[lazarus] Wrapping glib with objects

Shane Miller SMiller1 at stvgb.org
Mon Jun 14 11:45:46 EDT 1999

Wrapping glib is a good idea.  In reference to your queastions:
1) Why not pass around TObjects and type cast them internally as a TLinkedList or whatever and store the gpointer within the class itself.  Then you can pass the gpointer within the class that they passed you....understand?

2) I would go with TThread simply because our thought here is to create a Delphi-like environment and even if it's not perfect we would like to port over Delphi apps into this environment and have them compile.  Creating a TThread to be added to our library would be useful.


There are a few issues I would like some comments upon, though.

1.  glib likes to pass around gpointers.  I like to pass around TObjects.  There are merits in doing both.  By passing around TObjects we wave the application programmer from constantly doing this: pointer( thing ).  But, by restricting the user to TObjects, they can't store records.  The obvious solution is to overload the Inser function so that it accepts both pointers and TObjects.  Any other suggestions?

2.  glib provides OS-independed threading/thread synchronization control.  How should this be wrapped?  Should it be a class, TThread, like Delphi 3 does it?  Or should we integrate threading into TObject, like Java does it?  I love the Java constructs, but that is a LOT more work on our part!  Any suggestions?

I'm sure there's more, but I can't remember them anymore.

John Margaglione
jmargaglione at hotmail.com


More information about the Lazarus mailing list