Hi,
Matt Emson a écrit :
Graeme Geldenhuys wrote:
Anyway, I saw that FPC 2.4.0 has a Haiku release (I was quite
surprised -
kudos to the FPC developers!).
FPC supported BeOS since FPC 2.0. I believe the first port was by
Pavel Kasselberger (sp?) for his Pixel image editor. I used to be
involved in the effort to port some kind of API mapping, so I can give
a little info.
If i remember correctly, the BeOS port was started in the 1.x series.
Now, FPC 2.4 should be pretty much complete under Haiku. All packages
are not heavily tested though. Some bugs probably remains here and
there. The text mode IDE even work with mouse and debugging support.
How mature/stable is FPC on Haiku? Is it
usable, or is it still very experimental?
The BeAPI (the API that Haiku has inherited) is C++ based and
*heavily* multithreaded. As such, it is (was) pretty laborious to get
any GUI apps working. I wrote some simple wrappers, which worked okay.
They are probably still available in the Be FPC Source Forge repo. The
other guys on the project started to write a real API wrapper, and at
that point I sort of dropped out of the loop, so I'm unsure exactly
how far they got. I remember the API having a lot of circular
dependencies and modelling it in the same way as the BeAPI layed out
files was pretty impossible. That was the last I spoke to them.
Your biggest issue is not C++, it is multithreading. In BeOS, every
app has a thread (as normal) and every window has a separate Thread
(actually, more than one, as there is one or more in the app_server
for every one in the executable, but at the simplest level, the one
per window is fairly accurate.) BeOS used B as a prefix, much like
Borland's T. So you get a BLooper (a "thread"), then BMessenger
(Postbox/message sender) and BHandler (a "message" handler), a BWindow
inherits from both (IIRC) and IPC is done via an object based system
comprising of BMessages that contain lists of values (basic data
types, instances of class/structures, pointers etc.) The whole system
is extremely client/server. Sending a message between two applications
is trivial. This is all pretty easy to wrap with a little thought.
However, some controls need to be created in the right thread context,
so it starts getting messy. Anyway, I'm working on 10 year old
information, but Haiku is modelled very much after the original BeOS.
Mind you, Haiku now has a QT 4.x port, so you might find that is
simpler to get going?
This has not changed under Haiku. The GUI API is the same
(http://www.haiku-os.org/legacy-docs/bebook/). Haiku is just more POSIX
than BeOS. The wrapper is still in the same state. But i plan to rework
on this in the future now that the compiler side is pretty much
complete. Maybe the first step should be to switch to svn as i am not
sure i still remember how to use cvs. At least, befpc still compile and
work under Haiku. I have even found a bug in Haiku using the sample
program (http://dev.haiku-os.org/ticket/1651).
Olivier
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel