[lazarus] GTK2 interface
Andrew Johnson
acjgenius at earthlink.net
Sat Sep 6 12:02:51 EDT 2003
On Sat, 2003-09-06 at 10:04, Marc Weustink wrote:
> At 19:54 5-9-2003 -0400, Andrew Johnson wrote:
>
> [snip]
>
> >4th - related to the above, we need to get rid of Gtkclist and GtkText
> >for list and memo in the gtk2 interface(perferably with actual {$ifdef
> >GTK1} in the gtk files). these are not only deprecated but quite buggy
> >at times, we should replace them with the far more reliable/featurefull
> >TextView/TreeView which should allow us to be more accurate to the
> >original Delphi anyway, though it will likely require quite a
> >significant amount of work to implement properly.. (volunteers anyone?)
>
>
> I hope that some of those IFDEF GTK1 are temporary ?
>
> I noticed one in TGTKObject.GetCursorpos.
> IMO it is complete useless to have defines there. GetCursorpos is virtual
> and the proper implementation should appear in an overridden
> TGTK2Object.GetCursorpos.
> IMO we have an object model for that, don't pollute it with ifdefs to get
> another object.
much of this is temporary. many of these are done this way _because_ the
stuff is not easy to override, thus problem #3. as for instance the
getcursorpos. that particular routine I was testing, and plan on redoing
in gtk2 interface anyway. But for instance that {$IFdef GTK1} and more
an {$IfNdef Win32} need to be used around that routine, because in gtk2
almost no X calls should be needed(especially in gtk 2.2) for what we
do, and on windows obviously we can't use it. Given that gtk2 is nearly
as featurfull on windows as linux nowadays(if quite a bit slower) we
will want to disable calls like that etc. When I mean {$IfDef GTK1} I
mean around things like this which don't exist, or shouldn't be used in
gtk2 interface, not that we won't be overriding them in the gtk2
interface anyway. aka -
TGtkObject.GetCursorPos;
begin
{$Ifdef GTK1}
the deprecated stuff
{$IfDef X11}
X11 specific hack to do this
{$Else}
{$IfDef Win32}
win32 specific hack to do this
{$Else}
dummy stuff other workarounds etc.
{$EndIF}
{$EndIF}
{$EndIf}
end;
TGtk2Object.GetCursorPos;
begin
{$Ifdef GTK2_2}
gtk2_2 function to do this
{$else}
gtk2_0 specific workaround
{$IfDef X11}
X11 specific hack to do this
{$Else}
{$IfDef Win32}
win32 specific hack to do this
{$Else}
dummy stuff other workarounds etc.
{$EndIF}
{$EndIf}
end;
hopefully not every function will need to be like this, but right now
the X vs GTK, widget and widget hacks are so intertwined that overriding
for gtk2 or for X11 vs win32 vs maybe framebuffer support later etc is a
major pain. And When I say a GTK2 interface I don't mean an overlay on
top of the gtk1 which inherits all its deprecated functionaliy, or has
hacks for X11. I want the ability to compile lazarus with the gtk2
backend and have it link against the proper libs so we could run
anywhere that gtk2 runs. right now thats flat out impossible, in fact
its quite plausible that it will only work as well as it does for me
with gtk2.2.3 on X114.3 and with pangoxft backend (what I am using).
Also note that much of this is what I said I wanted in proc functions,
not in the object hierarchy in the long run. where an issue like this
arrises put the version/interface specific functionality into a called
function, which is then $IfDef'ed or put into version/os/etc specific
includes like the ide has.
Andrew
p.s pardon my inability to be consise and to the point and my in general
long windedness. :)
More information about the Lazarus
mailing list