[Geany-devel] Glade Code Generation and GtkBuilder

Lex Trotman elextr at xxxxx
Tue Aug 30 02:18:07 UTC 2011


On 30 August 2011 11:35, Matthew Brush <mbrush at codebrainz.ca> wrote:
> On 08/29/2011 05:20 PM, Lex Trotman wrote:
>>
>> [...]
>
>> Well, I don't think there is anything wrong with looking at GTK-3 but
>> it *is* too early to remove support for GTK-2.  I've not looked at
>> what changed for GTK-3, can we support both without much work (after
>> gtkbuilder is incorporated)?  Lots of #ifdefs would be bad.
>>
>
> Until the snag with the deprecated widgets used in the Glade generated code,
> the changes were extremely trivial and wouldn't at all break the current
> GTK+ version support.  All of them were documented in the migration
> guide[1].
>
> A quick list of the changes I had to make:
>  - Update Scintilla since it now supports GTK+ 3.

Yes, although IIUC GTK-3 support is still experimental

>  - Replace a few direct member accesses with accessor functions.

So long as the accessors are available in GTK 2.12 otherwise #if hell begins

>  - Switch from using GtkComboBoxEntry to GtkComboBox.

Well, a ComboBox created with new_with_entry that is.

>  - Replace GtkNotebookPage with gpointer.

Mostly it seems to be GtkWidget * not gpointer but also some of
notebook.c might need a bit more changed since it fakes
GtkNotebookPage.

>  - Fix use of GDK_<keynamehere> and include of gdkkeysyms.h.

Shouldn't be too hard

>  - Add some alternate #ifdef'd code for "Height-for-width" layout in the
> GeanyWrapLabel widget[2]

With the new layout capabilities we should first look if we need our
own widget any more, less to maintain but more #if.

>
> The last two are the only ones that require some version checking/different
> code handling.  Actually, some of the changes should probably be made even
> without thinking of GTK+ 3, since they are considered good practice even
> with GTK+ 2.

True.

Other things to think about:

How to ensure that users download the correct version, since the one
executable can't do both, you can only compile and link against one
version of GTK.  This increases the Geany maintenance workload as
there now needs to be two versions supported, tested etc.

How to ensure plugins are linked against the right version, or
determine which version they support, that might need two sets of
API/ABI say <1000 for GTK2 and >1000 for GTK3.

This looks like a lot more work than the current Geany contributors
can handle so I would suggest it will take a while.  In the meantime I
guess you can either try to make your plugin not require GTK-3 or
maintain your own GTK-3 git branch.  And of course Geany would also be
grateful for patches with those changes that are GTK-2 compatible good
practice to start the main project down the road.

Cheers
Lex



More information about the Devel mailing list