Recent

Author Topic: Lazarus under BeOS, is possible?  (Read 9827 times)

jose_filemaker

  • Guest
Lazarus under BeOS, is possible?
« on: May 08, 2006, 06:13:36 pm »
Hace mucho que no uso BeOS (hoy en día YelowTab), pero mi pregunta es si es posible compilar el LAZARUS para que funcione bajo este sistema operativo, o sobre el futuro HaikuOS (BeOS Open Source)

A simple question: Is posible to compile the lazarus source code for running under the BeOS platform (YellowTab, Haiku, ...)?

Sorry by my very poor english.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
RE: Lazarus under BeOS, is possible?
« Reply #1 on: May 09, 2006, 01:18:04 am »
The first step is to get the Free Pascal Compiler running under BeOS. I don´t know if Free Pascal works without modifications under BeOS.

If Free Pascal doesn´t support BeOS yet you will need to write a Run-time library for BeOS so the compiler can work.

Next it´s necessary to see what visual widgetsets are supported under BeOS. If Gtk works on BeOS you can just use it for a quick start.

If not then you will need to write a new LCL interface. There is documentation about this on the wiki.

Anonymous

  • Guest
RE: Lazarus under BeOS, is possible?
« Reply #2 on: May 13, 2006, 08:20:20 am »
http://sf.net/projects/befpc
FreePascal 2.1.1 for BeOS/Zeta is now availble

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
RE: Lazarus under BeOS, is possible?
« Reply #3 on: May 13, 2006, 09:20:38 pm »
Ok, so now you only need to create a new widgetset for Lazarus. =) There is a tutorial here:

http://wiki.lazarus.freepascal.org/index.php/LCL_Internals#How_to_create_a_new_Widgetset

Anonymous

  • Guest
RE: Lazarus under BeOS, is possible?
« Reply #4 on: May 14, 2006, 01:02:56 pm »
Thanks, I'll try :-)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
RE: Lazarus under BeOS, is possible?
« Reply #5 on: May 14, 2006, 11:55:20 pm »
You will probably want to join the mailling list and ask Mattias to add a new directory on the lcl interfaces for beos. The directory should have the name of the utilized widgetset.

Anonymous

  • Guest
RE: Lazarus under BeOS, is possible?
« Reply #6 on: May 15, 2006, 08:59:31 am »
Another good idea: make sure the changes in for beos, that are on sourceforge are merged in the fpc SVN repository. Then other Lazarus developers can at least try cross-compilation even if they don't have beos installed.

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: RE: Lazarus under BeOS, is possible?
« Reply #7 on: May 15, 2006, 11:11:11 am »
Quote from: "Vincent"
Another good idea: make sure the changes in for beos, that are on sourceforge are merged in the fpc SVN repository. Then other Lazarus developers can at least try cross-compilation even if they don't have beos installed.


Yes, it was me, but I got logged out. :-(

Anonymous

  • Guest
RE: Re: RE: Lazarus under BeOS, is possible?
« Reply #8 on: June 20, 2006, 03:44:00 pm »
I have one question about creating widgets. When I use for example Form1.Visible := True what method is activated in TWSCustomForm? I don't know how to handle this.

First screen (not to much but today I start working on this)
(http://img223.imageshack.us/img223/1668/16pa1.th.png)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: RE: Re: RE: Lazarus under BeOS, is possible?
« Reply #9 on: June 20, 2006, 04:15:11 pm »
Quote from: "Anonymous"
I have one question about creating widgets. When I use for example Form1.Visible := True what method is activated in TWSCustomForm? I don't know how to handle this.


Maybe we should create a list of what is needed to implement each feature.

Visibility is implemented on 2 places.

* The first is for forms, this is what you are looking for. For forms you must implement a WinAPI function called ShowWindow. On Qt widgetset it is located at qtwinapi.inc file. On your code it will be located on a similar **winapi.inc file. Don´t forget to also add a header to the file **winapih.inc

Bellow is code that implements this function on the Qt widgetset. It should be very easy to understand and implement. You can also take a look how Gtk implements this.

{------------------------------------------------------------------------------
  function ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;

  nCmdShow:
    SW_SHOWNORMAL, SW_MINIMIZE, SW_SHOWMAXIMIZED
------------------------------------------------------------------------------}
function TQtWidgetSet.ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;
var
  Widget: QWidgetH;
begin
  {$ifdef VerboseQtWinAPI}
    WriteLn('WinAPI ShowWindow');
  {$endif}

  Result := False;
 
  Widget := QWidgetH(hWnd);

//  if Widget = nil then RaiseException('TQtWidgetSet.ShowWindow  hWnd is nil');

  case nCmdShow of

    SW_SHOW: QWidget_setVisible(Widget, True);

    SW_SHOWNORMAL: QWidget_showNormal(Widget);

    SW_MINIMIZE: QWidget_setWindowState(Widget, QtWindowMinimized);

    SW_SHOWMINIMIZED: QWidget_showMinimized(Widget);

    SW_SHOWMAXIMIZED: QWidget_showMaximized(Widget);

    SW_HIDE: QWidget_setVisible(Widget, False);
   
  end;

  Result := True;
end;


* - The second is for controls. You need to implement T**WSWinControl.ShowHide class function. Bellow is a sample code for Qt.

{------------------------------------------------------------------------------
  Method: TQtWSWinControl.ShowHide
  Params:  AWinControl     - the calling object

  Returns: Nothing

  Shows or hides a widget.
 ------------------------------------------------------------------------------}
class procedure TQtWSWinControl.ShowHide(const AWinControl: TWinControl);
begin
  if AWinControl = nil then exit;

  if not AWinControl.HandleAllocated then exit;

  if AWinControl.HandleObjectShouldBeVisible then
   QWidget_setVisible(TQtWidget(AWinControl.Handle).Widget, True)
  else QWidget_setVisible(TQtWidget(AWinControl.Handle).Widget, False);
end;

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
RE: Re: RE: Re: RE: Lazarus under BeOS, is possible?
« Reply #10 on: June 20, 2006, 04:29:38 pm »
Ok, I created a wiki page about this:

http://wiki.lazarus.freepascal.org/index.php/LCL_Internals#Implementing_visibility_for_forms_and_controls

You can also help me document what is needed to make each part working =)

A good documentation can make it much, much easier to write new widgetsets.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: RE: Re: RE: Lazarus under BeOS, is possible?
« Reply #11 on: June 20, 2006, 04:36:36 pm »
Quote from: "Anonymous"
First screen (not to much but today I start working on this)


That´s great news!

Don´t hesitate to ask for more help =)