[Geany-devel] About disabling GTK+/GLib deprecated symbols
Nick Treleaven
nick.treleaven at xxxxx
Tue Oct 14 14:38:27 UTC 2008
Hi,
On Tue, 14 Oct 2008 03:59:26 +0200
Colomban Wendling <ban-ubuntu at club-internet.fr> wrote:
> Hi all,
>
> I've tried to compile Geany with the --disable-deprecated configure
> option, but I used… GTK+ 2.12 and GLib 2.16. Of course, it hasn't
> worked (mostly because of the new tooltip API and GObject
> generalization), but it's not really the reason of my mail.
That option is to disable deprecated elements in Geany's plugin API.
> In src/utils.c, g_strcasecmp() is used, but it is deprecated since
> 2.2. I dunno if the reason why it was deprecated have any incidence
> on what it is used here (I think not), but it breaks build without
> deprecated symbols even with 2.6.
But using deprecated functions isn't really a problem until GTK 3.0, no?
Anyway thanks for looking at it ;-)
> An easy fix is to copy the function (with another name or so) in the
> Geany's source code.
Either that, or use a replacement GLib function for it. I
probably wrote that code, but using the global tags autocompletion I
didn't realize it was deprecated (maybe we could use
GTK_DISABLE_DEPRECATED etc for tag file generation).
> Another think I've noticed is that the tagmanager use GMemChunks for
> allocating memory, but the new GSlice API seems to be really faster
> (and simpler). What do you think about using it when compiling with
> GLib >= 2.10? It is easy to set up, just two macros to update.
> (patch attached - geany_r3060_tagmanager_gslice.patch)
Probably we could apply this after the 0.15 release.
> Last thing: about marshal closures. I dunno if g_cclosure_marshal*()
> are present in GLib 2.6, but gtk_marshal*() are deprecated now, and I
> think glib-genmarshal is not a really recent tool. Then, it can be
> nice to move gtk_marshal*() to corresponding g_cclosure_marshal*()
> and/or to define which are needed in geany-marshal.[ch] files or so.
> (another patch attached - geany_r3060_no_gtk_marshal.patch).
No idea about this - but I guess we should apply it to fix deprecation
problems.
(I really don't like GObject code in C, maybe we could use Vala for
GeanyObject??)
> Patch for this is not really good because I'm not really knowing about
> automake & friends, and a make rule should be created to automatically
> create geany-marshal.[ch] from geany-marshal.list using
> glib-genmarshal at compile-time.
Probably a normal Make rule could be put in src/Makefile.am to do that.
> I attach a last patch, the global modifications I made do compile with
> --disable-deprecated with GTK+ 2.12 and GLib 2.16, if this is useful
> for anyone. Anything works but Scintilla, I've not understood the
> exact goal of calls using deprecated functions, and it haven't found
> an easy way to make it use newer functions.
gtk_widget_set_tooltip_text() was only added in GTK+ 2.12, we still
support 2.6 (see HACKING). Maybe that function could be mimiced for GTK
< 2.12 with something like ui_widget_set_tooltip_text().
To sum up, we can probably apply all these after the 0.15 release, but
with some changes. Thanks for submitting them.
Regards,
Nick
More information about the Devel
mailing list