From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- addons/src/ao_doclist.c | 12 +++++++----- build/addons.m4 | 1 - 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/addons/src/ao_doclist.c b/addons/src/ao_doclist.c index 16a5ffa..108a2fe 100644 --- a/addons/src/ao_doclist.c +++ b/addons/src/ao_doclist.c @@ -126,14 +126,16 @@ static void ao_popup_position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *pu gint widget_height;
/* Retrieve size and position of both widget and menu */ - if (GTK_WIDGET_NO_WINDOW(widget)) + if (gtk_widget_get_has_window(widget)) { - gdk_window_get_position(widget->window, &wx, &wy); - wx += widget->allocation.x; - wy += widget->allocation.y; + GtkAllocation allocation; + gtk_widget_get_allocation(widget, &allocation); + gdk_window_get_position(gtk_widget_get_window(widget), &wx, &wy); + wx += allocation.x; + wy += allocation.y; } else - gdk_window_get_origin(widget->window, &wx, &wy); + gdk_window_get_origin(gtk_widget_get_window(widget), &wx, &wy); gtk_widget_size_request(widget, &widget_req); widget_height = widget_req.height; /* Better than allocation.height */
diff --git a/build/addons.m4 b/build/addons.m4 index e668612..22fc25a 100644 --- a/build/addons.m4 +++ b/build/addons.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_ADDONS], [ GP_ARG_DISABLE([Addons], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([Addons]) GP_COMMIT_PLUGIN_STATUS([Addons]) AC_CONFIG_FILES([ addons/Makefile
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanyinsertnum.m4 | 1 - geanyinsertnum/src/insertnum.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/build/geanyinsertnum.m4 b/build/geanyinsertnum.m4 index 08c2c6c..392dfb8 100644 --- a/build/geanyinsertnum.m4 +++ b/build/geanyinsertnum.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYINSERTNUM], [ GP_ARG_DISABLE([GeanyInsertNum], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyInsertNum]) GP_COMMIT_PLUGIN_STATUS([GeanyInsertNum]) AC_CONFIG_FILES([ geanyinsertnum/Makefile diff --git a/geanyinsertnum/src/insertnum.c b/geanyinsertnum/src/insertnum.c index 4fa6e45..6652ac4 100644 --- a/geanyinsertnum/src/insertnum.c +++ b/geanyinsertnum/src/insertnum.c @@ -388,8 +388,8 @@ static void on_insert_numbers_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GN
button = gtk_button_new_from_stock(GTK_STOCK_OK); g_signal_connect(button, "clicked", G_CALLBACK(on_insert_numbers_ok_clicked), &d); - gtk_box_pack_end(GTK_BOX(GTK_DIALOG(d.dialog)->action_area), button, TRUE, TRUE, 0); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d.dialog))), button, TRUE, TRUE, 0); + gtk_widget_set_can_default(button, TRUE); gtk_widget_grab_default(button);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d.start), start_value);
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanyinsertnum.m4 | 1 - geanyinsertnum/src/insertnum.c | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/build/geanyinsertnum.m4 b/build/geanyinsertnum.m4 index 08c2c6c..392dfb8 100644 --- a/build/geanyinsertnum.m4 +++ b/build/geanyinsertnum.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYINSERTNUM], [ GP_ARG_DISABLE([GeanyInsertNum], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyInsertNum]) GP_COMMIT_PLUGIN_STATUS([GeanyInsertNum]) AC_CONFIG_FILES([ geanyinsertnum/Makefile diff --git a/geanyinsertnum/src/insertnum.c b/geanyinsertnum/src/insertnum.c index 4fa6e45..18ab8cc 100644 --- a/geanyinsertnum/src/insertnum.c +++ b/geanyinsertnum/src/insertnum.c @@ -351,14 +351,14 @@ static void on_insert_numbers_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GN
label = gtk_label_new_with_mnemonic(_("_Base:")); gtk_table_attach_defaults(table, label, 0, 1, 1, 2); - combo = GTK_COMBO_BOX(gtk_combo_box_entry_new_text()); + combo = GTK_COMBO_BOX(gtk_combo_box_text_new_with_entry()); d.base = gtk_bin_get_child(GTK_BIN(combo)); set_entry(d.base, 2, label, "2..36"); g_signal_connect(d.base, "insert-text", G_CALLBACK(on_base_insert_text), NULL); - gtk_combo_box_append_text(combo, "2"); - gtk_combo_box_append_text(combo, "8"); - gtk_combo_box_append_text(combo, "10"); - gtk_combo_box_append_text(combo, "16"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "2"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "8"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "10"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "16"); gtk_table_attach(table, GTK_WIDGET(combo), 1, 3, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0); label = gtk_label_new(_("Letters:")); ui_widget_set_tooltip_text(label, case_tip); @@ -388,8 +388,8 @@ static void on_insert_numbers_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GN
button = gtk_button_new_from_stock(GTK_STOCK_OK); g_signal_connect(button, "clicked", G_CALLBACK(on_insert_numbers_ok_clicked), &d); - gtk_box_pack_end(GTK_BOX(GTK_DIALOG(d.dialog)->action_area), button, TRUE, TRUE, 0); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); + gtk_box_pack_end(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(d.dialog))), button, TRUE, TRUE, 0); + gtk_widget_set_can_default(button, TRUE); gtk_widget_grab_default(button);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(d.start), start_value);
On Fri, 5 Apr 2013 08:58:21 +0200 Quentin Glidic sardemff7+geany@sardemff7.net wrote:
geanyinsertnum/src/insertnum.c | 4 ++--
- GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
- gtk_widget_set_can_default(button, TRUE);
geanyinsertnum/src/insertnum.c | 14 +++++++-------
- combo = GTK_COMBO_BOX(gtk_combo_box_entry_new_text());
- combo = GTK_COMBO_BOX(gtk_combo_box_text_new_with_entry());
- gtk_combo_box_append_text(combo, "2");
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "2");
...
Thank you, Quentin, but...
Using gtkcompat requires either Geany >= 20130818 or gtk+ >= 2.24. Since I care more about the backwards compatibility than for gtk+3, my plans are to update insertnum when gtkcompat becomes part of geany- plugins, or when we increase the gtk+ requirements of Geany to gtk+ >= 2.24, or after 2 years - whichever comes first.
To the lead developer who reviews the gtkcompat patches: please do not apply the ones for insertnum.
Hi Dimitar,
On 6 April 2014 04:40, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
On Fri, 5 Apr 2013 08:58:21 +0200 Quentin Glidic sardemff7+geany@sardemff7.net wrote:
geanyinsertnum/src/insertnum.c | 4 ++--
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_set_can_default(button, TRUE);
geanyinsertnum/src/insertnum.c | 14 +++++++-------
combo = GTK_COMBO_BOX(gtk_combo_box_entry_new_text());
combo = GTK_COMBO_BOX(gtk_combo_box_text_new_with_entry());
gtk_combo_box_append_text(combo, "2");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "2");
...
Thank you, Quentin, but...
Using gtkcompat requires either Geany >= 20130818 or gtk+ >= 2.24.
I'm not sure I understand your Geany version number, is it a future date, and if so why 18 Aug?
Gtkcompat is supposed to handle compatibility for GTK back to 2.16 IIUC, If it doesn't thats a bug :). Geany's GTK minimum requirement hasn't been increased from 2.16 but it now also can be built with gtk3. The intention is to encourage plugins to do the same. We are not losing support for gtk2.
Since I care more about the backwards compatibility than for gtk+3, my plans are to update insertnum when gtkcompat becomes part of geany- plugins,
I guess it isn't clearly explained, gtkcompat.h is part of Geany, not the plugins, but they can use it since its only a header file. Its in Geany's Git. It doesn't become part of geany plugins.
or when we increase the gtk+ requirements of Geany to gtk+ >= 2.24, or after 2 years - whichever comes first.
Not sure why you want gtk 2.24? Anyway its your choice of course, user complaints that it doesn't work with gtk3 will be pointed to you :)
Cheers Lex
To the lead developer who reviews the gtkcompat patches: please do not apply the ones for insertnum.
-- E-gards: Jimmy _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On Sat, 6 Apr 2013 10:47:25 +1100 Lex Trotman elextr@gmail.com wrote:
On 6 April 2014 04:40, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
On Fri, 5 Apr 2013 08:58:21 +0200 Quentin Glidic sardemff7+geany@sardemff7.net wrote:
geanyinsertnum/src/insertnum.c | 4 ++--
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_widget_set_can_default(button, TRUE);
geanyinsertnum/src/insertnum.c | 14 +++++++-------
combo = GTK_COMBO_BOX(gtk_combo_box_entry_new_text());
combo = GTK_COMBO_BOX(gtk_combo_box_text_new_with_entry());
gtk_combo_box_append_text(combo, "2");
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "2");
...
Thank you, Quentin, but...
Using gtkcompat requires either Geany >= 20130818 or gtk+ >= 2.24.
I'm not sure I understand your Geany version number, is it a future date, and if so why 18 Aug?
Sorry, I meant ~20130313, when gtkcompat was added.
Gtkcompat is supposed to handle compatibility for GTK back to 2.16 IIUC, If it doesn't thats a bug :). Geany's GTK minimum requirement hasn't been increased from 2.16 but it now also can be built with gtk3. The intention is to encourage plugins to do the same. We are not losing support for gtk2.
Yes, I understand that, and it provides compatibility as far as I can tell without actually using it.
Since I care more about the backwards compatibility than for gtk+3, my plans are to update insertnum when gtkcompat becomes part of geany- plugins,
I guess it isn't clearly explained, gtkcompat.h is part of Geany, not the plugins, but they can use it since its only a header file. Its in Geany's Git. It doesn't become part of geany plugins.
It's explained well enough. The plugins are not only able, but expected to use it, because it's automatically included by plugindata.h. But that assumes they are build against Geany 2013-03-11, or with a new gtk+.
The problem is, my company is certified for information securily, and getting approval for a new version of any external software is a PITA. On the other hand, anything written by the employees, like my plugins, is OK by default - we are hired to write software, after all... :)
(Of course, I'm not using the company machines to write any GPL-ed software - only to compile and use it.)
or when we increase the gtk+ requirements of Geany to gtk+ >= 2.24, or after 2 years - whichever comes first.
Not sure why you want gtk 2.24?
Because GtkComboBoxText is from 2.24 (althought it's [re]defined in gtkcompat.h for any gtk < 3.0, with an explanation why).
Anyway its your choice of course, user complaints that it doesn't work with gtk3 will be pointed to you :)
My package manager shows 2795 depending on gtk+2, and 345 packages depending on gtk+3, which was released on 2011-07-28. :)
Anyway, I was too categorical. The old hack of #defining GTK_COMPAT_H before including geanyplugin.h, and manually writing any compatibility code, will probably work fine with all Geany versions. That'll look a bit ugly, and IMHO, letting the plugins decide whether to include "gtkcompat.h" would be better...
The problem is, my company is certified for information securily, and
getting approval for a new version of any external software is a PITA. On the other hand, anything written by the employees, like my plugins, is OK by default - we are hired to write software, after all... :)
Maybe you can "write" a gtkcompat.h yourself that looks mysteriously like the official one :)
and explicitly include it before plugindata.h.
I think that should work for all versions then?
Cheers Lex [...]
On 14-04-06 05:04 AM, Dimitar Zhekov wrote:
[...] Anyway, I was too categorical. The old hack of #defining GTK_COMPAT_H before including geanyplugin.h, and manually writing any compatibility code, will probably work fine with all Geany versions. That'll look a bit ugly, and IMHO, letting the plugins decide whether to include "gtkcompat.h" would be better...
I agree, gtkcompat.h should be optional, to be included explicitly only if a plugin needs/wants it. It does seem wrong to prevent plugins from targeting older versions of Geany from when this header didn't exist or forcing their min GTK+ to 2.24.
If we keep gtkcompat.h forced into all plugins maybe we should document the trick of blocking it out by predefining the guard macro like that.
Cheers, Matthew Brush
On 7 April 2013 06:31, Matthew Brush mbrush@codebrainz.ca wrote:
On 14-04-06 05:04 AM, Dimitar Zhekov wrote:
[...]
Anyway, I was too categorical. The old hack of #defining GTK_COMPAT_H before including geanyplugin.h, and manually writing any compatibility code, will probably work fine with all Geany versions. That'll look a bit ugly, and IMHO, letting the plugins decide whether to include "gtkcompat.h" would be better...
I agree, gtkcompat.h should be optional, to be included explicitly only if a plugin needs/wants it. It does seem wrong to prevent plugins from targeting older versions of Geany from when this header didn't exist or forcing their min GTK+ to 2.24.
If it does then that is indeed a bug in gtkcompat.h since Geany still supports 2.16. IIUC it defines stuff for versions that need it so the compat functions work on both old and new versions. It certainly creates things for < 2.18 and < 2.20.
If we keep gtkcompat.h forced into all plugins maybe we should document the trick of blocking it out by predefining the guard macro like that.
Essentially the plugin API has changed at 1.24, it no longer implicitly includes GTK2, it now implicitly includes GTK2 and GTK3 and the compat functions, and to compile against it plugins do indeed need to change. Such a change was inevitable to be able to move Geany to GTK3 since it isn't compatible with GTK2. gtkcompat.h is always available because Colomban wants plugins to support Geany running on GTK from 2.16 to 3.8.
I think this needs to be clearly described in the plugin docs and more clearly announced to the plugin maintainer community. If they don't want to change their plugin then they can continue to only compile against older versions, and that of course leads to the discussion in the other thread :)
Cheers Lex
Cheers, Matthew Brush
______________________________**_________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-**bin/mailman/listinfo/develhttps://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 13-04-06 01:56 PM, Lex Trotman wrote:
On 7 April 2013 06:31, Matthew Brush mbrush@codebrainz.ca wrote:
On 14-04-06 05:04 AM, Dimitar Zhekov wrote:
[...]
Anyway, I was too categorical. The old hack of #defining GTK_COMPAT_H before including geanyplugin.h, and manually writing any compatibility code, will probably work fine with all Geany versions. That'll look a bit ugly, and IMHO, letting the plugins decide whether to include "gtkcompat.h" would be better...
I agree, gtkcompat.h should be optional, to be included explicitly only if a plugin needs/wants it. It does seem wrong to prevent plugins from targeting older versions of Geany from when this header didn't exist or forcing their min GTK+ to 2.24.
If it does then that is indeed a bug in gtkcompat.h since Geany still supports 2.16. IIUC it defines stuff for versions that need it so the compat functions work on both old and new versions. It certainly creates things for < 2.18 and < 2.20.
The problem is that if you want to target any Geany from before 1.24 where it didn't provide a gtkcompat.h and you use any macros from it, then you have to assume GTK+ >2.16 because gtkcompat.h defines macros that transparently provides GTK+ >2.16 functionality for where that version isn't available. If the gtkcompat.h isn't available and plugins are using macros from it, they implicitly depend on GTK+ >2.16.
As an example, use the "can default" macro, gtkcompat.h defines something like this (paraphrasing):
#if !GTK_CHECK_VERSION(2,18,0) # define gtk_widget_set_can_default(wid, enable) \ if (enable) { GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT); } \ else { GTK_WIDGET_UNSET_FLAGS(wid, GTK_CAN_DEFAULT); } #endif
Say my plugin currently has the (deprecated since 2.18) call:
GTK_WIDGET_SET_FLAGS(wid, GTK_CAN_DEFAULT);
And I change my code to use gtkcompat.h/gtk2.18 call instead:
gtk_widget_set_can_default(wid, TRUE);
Now if gtkcompat.h isn't included (as it won't be in any version of Geany before the next release) and I try to compile my plugin against the older installed Geany headers, rather than getting the macro defined in gtkcompat.h, it's calling the real GTK+ 2.18 function, thus making it depend on GTK+ 2.18.
If we keep gtkcompat.h forced into all plugins maybe we should document the trick of blocking it out by predefining the guard macro like that.
Essentially the plugin API has changed at 1.24, it no longer implicitly includes GTK2, it now implicitly includes GTK2 and GTK3 and the compat functions, and to compile against it plugins do indeed need to change. Such a change was inevitable to be able to move Geany to GTK3 since it isn't compatible with GTK2. gtkcompat.h is always available because Colomban wants plugins to support Geany running on GTK from 2.16 to 3.8.
It works great for Geany core, because you know for a fact that gtkcompat.h is going to be available since it installs it itself. For plugins however, you have no idea what Geany version will be installed, so you can't depend on gtkcompat.h being available.
Cheers, Matthew Brush
The problem is that if you want to target any Geany from before 1.24 where
it didn't provide a gtkcompat.h and you use any macros from it, then you have to assume GTK+ >2.16 because gtkcompat.h defines macros that transparently provides GTK+ >2.16 functionality for where that version isn't available. If the gtkcompat.h isn't available and plugins are using macros from it, they implicitly depend on GTK+ >2.16.
Yes, for plugins to support GTK3 they should require a new API version.
Colomban should have bumped the API version with the introduction of gtkcompat.h since it adds new functionality, then they won't compile with older versions of the API, so can't be used with older Geany versions anyway.
The problem is that this new API isn't backward compatible with the old API. This is rare for Geany I admit, and we normally try to avoid it, but adding GTK3 to the API makes it incompatible.
If you want to support Geany < 1.24 then you can't support 1.24 and vice versa unless you do a bunch of #define and #ifdefs anyway, figuring if gtkcompat is available is probably the least of your worries :)
Anyone who wants to compile for older Geany's should use the 1.23 tarball or git tag. Probably that should be clearer somewhere, and maybe at the next release of g-p Frank will consider continuing to make the 1.23 tarball available with a note in "installing" on the plugins website.
Cheers Lex
Le 07/04/2013 00:08, Lex Trotman a écrit :
The problem is that if you want to target any Geany from before 1.24 where it didn't provide a gtkcompat.h and you use any macros from it, then you have to assume GTK+ >2.16 because gtkcompat.h defines macros that transparently provides GTK+ >2.16 functionality for where that version isn't available. If the gtkcompat.h isn't available and plugins are using macros from it, they implicitly depend on GTK+ >2.16.
Yes, for plugins to support GTK3 they should require a new API version.
Colomban should have bumped the API version with the introduction of gtkcompat.h since it adds new functionality, then they won't compile with older versions of the API, so can't be used with older Geany versions anyway.
Well... not exactly. The only thing Geany Git adds is macros mapping GTK functions that may have not been available on version where they are actually not available. At worst, it would maybe make a plugin get some warnings about redefinition of macros if the plugin did the same thing. AFAIK this is mostly harmless.
It's true, however, that Geany Git built against GTK3 *has* a different ABI, and somewhat fakes some API, but who cares since building and running against GTK3 *requires* GTK >= 3.0 AND Geany >= 1.24.
The problem is that this new API isn't backward compatible with the old API. This is rare for Geany I admit, and we normally try to avoid it, but adding GTK3 to the API makes it incompatible.
Why isn't it compatible? The API is different if and only if built against GTK3, something that wasn't possible before.
If you want to support Geany < 1.24 then you can't support 1.24 and vice versa unless you do a bunch of #define and #ifdefs anyway, figuring if gtkcompat is available is probably the least of your worries :)
Yes you can, the only thing that this thread shows tricky is that if one wants to support both (Geany < 1.24) AND (Geany >= 1.24 built against GTK3). And even here I can think of relatively easy ways to deal with this.
The easy way I can think of is, instead of trying to do some ugly crap at undefining GTKCOMPAT_H and running into crazy issues, simply check whether it's defined or not to see whether it's usable or not:
#ifdef GTKCOMPAT_H /* building against a version of Geany providing GTK compatibility * macros */ #else /* no compatibility macros, one may redefine those she needs */ #endif
Anyone who wants to compile for older Geany's should use the 1.23 tarball or git tag.
Why? If one wants to target Geany <= 1.23, they don't need GTK3 build, and then don't seen the smallest difference. The only thing is that when developing with 1.24 someone might not notice that they are using some recent GTK API, but we didn't force anyone to target GTK 2.16 before either.
Probably that should be clearer somewhere, and maybe at the next release of g-p Frank will consider continuing to make the 1.23 tarball available with a note in "installing" on the plugins website.
Why? We don't provide builds against each and every one of the older Geany releases, so I don't see the point.
Regards, Colomban
Le 06/04/2014 14:04, Dimitar Zhekov a écrit :
[...]
Gtkcompat is supposed to handle compatibility for GTK back to 2.16 IIUC, If it doesn't thats a bug :). Geany's GTK minimum requirement hasn't been increased from 2.16 but it now also can be built with gtk3. The intention is to encourage plugins to do the same. We are not losing support for gtk2.
Yes, I understand that, and it provides compatibility as far as I can tell without actually using it.
And apparently the test GTK 2.16 builds agree :)
Since I care more about the backwards compatibility than for gtk+3, my plans are to update insertnum when gtkcompat becomes part of geany- plugins,
I guess it isn't clearly explained, gtkcompat.h is part of Geany, not the plugins, but they can use it since its only a header file. Its in Geany's Git. It doesn't become part of geany plugins.
It's explained well enough. The plugins are not only able, but expected to use it, because it's automatically included by plugindata.h. But that assumes they are build against Geany 2013-03-11, or with a new gtk+.
Plugins are indeed supposed to use it if they want GTK3 compatibility. Otherwise, they should be able to simply ignore it and work as before.
The problem is, my company is certified for information securily, and getting approval for a new version of any external software is a PITA. On the other hand, anything written by the employees, like my plugins, is OK by default - we are hired to write software, after all... :)
(Of course, I'm not using the company machines to write any GPL-ed software - only to compile and use it.)
Understandable, indeed.
or when we increase the gtk+ requirements of Geany to gtk+ >= 2.24, or after 2 years - whichever comes first.
Not sure why you want gtk 2.24?
Because GtkComboBoxText is from 2.24 (althought it's [re]defined in gtkcompat.h for any gtk < 3.0, with an explanation why).
Anyway its your choice of course, user complaints that it doesn't work with gtk3 will be pointed to you :)
My package manager shows 2795 depending on gtk+2, and 345 packages depending on gtk+3, which was released on 2011-07-28. :)
Anyway, I was too categorical. The old hack of #defining GTK_COMPAT_H before including geanyplugin.h, and manually writing any compatibility code, will probably work fine with all Geany versions. That'll look a bit ugly, and IMHO,
As you see, it proven to break stuff (unsurprising since it's used in our headers, the primary reason why we include it implicitly).
However, as pointed out in the other mail, I don't see what would prevent you from doing a check on whether GTKCOMPAT_H is defined, which tell you basically whether you have to redefine the things or not.
letting the plugins decide whether to include "gtkcompat.h" would be better...
Since you did read gtkcompat.h comment about GtkComboBoxText, you'll understand that this isn't really possible: we expose an API that is not available in GTK3 anymore, so we ought to do something. And here it means either:
1) redefine the symbol if needed (hence gtkcompat.h inclusion)
2) Depend on a GTK version providing the new symbol (here 2.24)
3) Depend on a GTK version providing the old symbol (here < 3.0)
Since we don't want to depend on GTK 2.24, and obviously the goal was to support GTK3, I went with the option 1. And again, I don't see why it's a big deal.
Regards, Colomban
On 14-04-05 11:40 AM, Dimitar Zhekov wrote:
On Fri, 5 Apr 2013 08:58:21 +0200 Quentin Glidic sardemff7+geany@sardemff7.net wrote:
geanyinsertnum/src/insertnum.c | 4 ++--
- GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
- gtk_widget_set_can_default(button, TRUE);
geanyinsertnum/src/insertnum.c | 14 +++++++-------
- combo = GTK_COMBO_BOX(gtk_combo_box_entry_new_text());
- combo = GTK_COMBO_BOX(gtk_combo_box_text_new_with_entry());
- gtk_combo_box_append_text(combo, "2");
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "2");
...
Thank you, Quentin, but...
Using gtkcompat requires either Geany >= 20130818 or gtk+ >= 2.24. Since I care more about the backwards compatibility than for gtk+3, my plans are to update insertnum when gtkcompat becomes part of geany- plugins, or when we increase the gtk+ requirements of Geany to gtk+ >= 2.24, or after 2 years - whichever comes first.
To the lead developer who reviews the gtkcompat patches: please do not apply the ones for insertnum.
Hi,
Rather than breaking compat with older Geany or preventing GTK3 users from using the plugin, you could just add the 2 #if's needed to make the plugin build with GTK3 for now.
My $0.02
Cheers, Matthew Brush
On Fri, 05 Apr 2013 17:43:42 -0700 Matthew Brush mbrush@codebrainz.ca wrote:
On 14-04-05 11:40 AM, Dimitar Zhekov wrote:
On Fri, 5 Apr 2013 08:58:21 +0200 Quentin Glidic sardemff7+geany@sardemff7.net wrote:
geanyinsertnum/src/insertnum.c | 4 ++--
- GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
- gtk_widget_set_can_default(button, TRUE);
geanyinsertnum/src/insertnum.c | 14 +++++++-------
- combo = GTK_COMBO_BOX(gtk_combo_box_entry_new_text());
- combo = GTK_COMBO_BOX(gtk_combo_box_text_new_with_entry());
- gtk_combo_box_append_text(combo, "2");
- gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "2");
...
Thank you, Quentin, but...
Using gtkcompat requires either Geany >= 20130818 or gtk+ >= 2.24.
To the lead developer who reviews the gtkcompat patches: please do not apply the ones for insertnum.
Rather than breaking compat with older Geany or preventing GTK3 users from using the plugin, you could just add the 2 #if's needed to make the plugin build with GTK3 for now.
The above are only examples - there are actually 4 #if's, and more to avoid the deprecated symbols. And it would be easier without gtkcompat, which only muddles the water in this case. But I'll probably be able to get rid of it by #defining GTKCOMPAT_H before including geanyplugin.h.
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanylatex.m4 | 1 - geanylatex/src/geanylatex.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/build/geanylatex.m4 b/build/geanylatex.m4 index 398a368..d110416 100644 --- a/build/geanylatex.m4 +++ b/build/geanylatex.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYLATEX], [ GP_ARG_DISABLE([GeanyLaTeX], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyLaTeX]) GP_COMMIT_PLUGIN_STATUS([GeanyLaTeX]) AC_CONFIG_FILES([ geanylatex/Makefile diff --git a/geanylatex/src/geanylatex.c b/geanylatex/src/geanylatex.c index 4666d93..f8d231a 100644 --- a/geanylatex/src/geanylatex.c +++ b/geanylatex/src/geanylatex.c @@ -2105,8 +2105,8 @@ add_menu_to_menubar(void) { /* Build up menu for menubar */ menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); - gtk_menu_shell_insert( - menubar, menu_latex, g_list_length(menubar->children)-1); + gtk_menu_shell_appeng( + menubar, menu_latex);
menu_latex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu); @@ -2255,8 +2255,8 @@ add_menu_to_menubar(void) if (menu_bibtex == NULL) { menu_bibtex = gtk_menu_item_new_with_mnemonic(_("_BibTeX")); - gtk_menu_shell_insert( - menubar, menu_bibtex, g_list_length(menubar->children)-1); + gtk_menu_shell_append( + menubar, menu_bibtex);
menu_bibtex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_bibtex), menu_bibtex_menu);
Am 05.04.2013 08:58, schrieb Quentin Glidic:
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net
build/geanylatex.m4 | 1 - geanylatex/src/geanylatex.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/build/geanylatex.m4 b/build/geanylatex.m4 index 398a368..d110416 100644 --- a/build/geanylatex.m4 +++ b/build/geanylatex.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYLATEX], [ GP_ARG_DISABLE([GeanyLaTeX], [auto])
- GP_CHECK_PLUGIN_GTK2_ONLY([GeanyLaTeX]) GP_COMMIT_PLUGIN_STATUS([GeanyLaTeX]) AC_CONFIG_FILES([ geanylatex/Makefile
diff --git a/geanylatex/src/geanylatex.c b/geanylatex/src/geanylatex.c index 4666d93..f8d231a 100644 --- a/geanylatex/src/geanylatex.c +++ b/geanylatex/src/geanylatex.c @@ -2105,8 +2105,8 @@ add_menu_to_menubar(void) { /* Build up menu for menubar */ menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX"));
gtk_menu_shell_insert(
menubar, menu_latex, g_list_length(menubar->children)-1);
gtk_menu_shell_appeng(
menubar, menu_latex);
This looks like a typo. Do you test compile your stuff?
menu_latex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu);
@@ -2255,8 +2255,8 @@ add_menu_to_menubar(void) if (menu_bibtex == NULL) { menu_bibtex = gtk_menu_item_new_with_mnemonic(_("_BibTeX"));
gtk_menu_shell_insert(
menubar, menu_bibtex, g_list_length(menubar->children)-1);
gtk_menu_shell_append(
menubar, menu_bibtex);
menu_bibtex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_bibtex), menu_bibtex_menu);
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net ---
Sorry, I missed some warnings in the gtk_table deprecation ones Here is the full patch
build/geanylatex.m4 | 1 - geanylatex/src/bibtex.c | 2 +- geanylatex/src/geanylatex.c | 74 +++++++++++++++++++------------------- geanylatex/src/latexenvironments.c | 8 ++--- geanylatex/src/reftex.c | 2 +- geanylatex/src/templates.c | 2 +- 6 files changed, 44 insertions(+), 45 deletions(-)
diff --git a/build/geanylatex.m4 b/build/geanylatex.m4 index 398a368..d110416 100644 --- a/build/geanylatex.m4 +++ b/build/geanylatex.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYLATEX], [ GP_ARG_DISABLE([GeanyLaTeX], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyLaTeX]) GP_COMMIT_PLUGIN_STATUS([GeanyLaTeX]) AC_CONFIG_FILES([ geanylatex/Makefile diff --git a/geanylatex/src/bibtex.c b/geanylatex/src/bibtex.c index 03aa6a4..63b4e64 100644 --- a/geanylatex/src/bibtex.c +++ b/geanylatex/src/bibtex.c @@ -218,7 +218,7 @@ void glatex_parse_bib_file(const gchar* file, gpointer combobox) { tmp = glatex_parseLine_bib(bib_entries[i]); tmp_label_name = g_strdup(tmp->label_name); - gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp_label_name); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox), tmp_label_name); g_free(tmp); g_free(tmp_label_name); } diff --git a/geanylatex/src/geanylatex.c b/geanylatex/src/geanylatex.c index 4666d93..d18bf3e 100644 --- a/geanylatex/src/geanylatex.c +++ b/geanylatex/src/geanylatex.c @@ -305,10 +305,10 @@ plugin_configure(GtkDialog * dialog) config_widgets.lower_selection_on_smallcaps = gtk_check_button_new_with_label( _("Lower selection when formating smallcaps (\textsc{})"));
- config_widgets.glatex_autocompletion_active = gtk_combo_box_new_text(); - gtk_combo_box_insert_text(GTK_COMBO_BOX(config_widgets.glatex_autocompletion_active), 0, + config_widgets.glatex_autocompletion_active = gtk_combo_box_text_new(); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(config_widgets.glatex_autocompletion_active), 0, _("Don't care about this inside plugin")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(config_widgets.glatex_autocompletion_active), 1, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(config_widgets.glatex_autocompletion_active), 1, _("Always perform autocompletion on LaTeX"));
/* Configuration for auto completion feature */ @@ -889,7 +889,7 @@ glatex_insert_ref_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, gtk_table_set_row_spacings(GTK_TABLE(table), 6);
label_ref = gtk_label_new(_("Reference name:")); - textbox_ref = gtk_combo_box_entry_new_text(); + textbox_ref = gtk_combo_box_text_new_with_entry();
if (doc->real_path != NULL) { @@ -941,8 +941,8 @@ glatex_insert_ref_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, gchar *ref_string = NULL; GString *template_string = NULL;
- ref_string = g_strdup(gtk_combo_box_get_active_text( - GTK_COMBO_BOX(textbox_ref))); + ref_string = g_strdup(gtk_combo_box_text_get_active_text( + GTK_COMBO_BOX_TEXT(textbox_ref)));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio1)) == TRUE) { @@ -1254,7 +1254,7 @@ on_insert_bibtex_dialog_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, gtk_table_set_row_spacings(GTK_TABLE(table), 6);
label = gtk_label_new(_("BibTeX reference name:")); - textbox = gtk_combo_box_entry_new_text(); + textbox = gtk_combo_box_text_new_with_entry();
if (doc->real_path != NULL) { @@ -1299,8 +1299,8 @@ on_insert_bibtex_dialog_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, gchar *ref_string = NULL; GString *template_string = NULL;
- ref_string = g_strdup(gtk_combo_box_get_active_text( - GTK_COMBO_BOX(textbox))); + ref_string = g_strdup(gtk_combo_box_text_get_active_text( + GTK_COMBO_BOX_TEXT(textbox)));
if (ref_string != NULL) { @@ -1364,8 +1364,8 @@ on_wizard_response(G_GNUC_UNUSED GtkDialog *dialog, gint response, enc_latex_char = g_strconcat("\usepackage[", latex_encodings[encoding_int].latex,"]{inputenc}\n", NULL); } - fontsize = gtk_combo_box_get_active_text( - GTK_COMBO_BOX(glatex_wizard.fontsize_combobox)); + fontsize = gtk_combo_box_text_get_active_text( + GTK_COMBO_BOX_TEXT(glatex_wizard.fontsize_combobox)); author = g_strdup(gtk_entry_get_text(GTK_ENTRY(glatex_wizard.author_textbox))); date = g_strdup(gtk_entry_get_text(GTK_ENTRY(glatex_wizard.date_textbox))); title = g_strdup(gtk_entry_get_text(GTK_ENTRY(glatex_wizard.title_textbox))); @@ -1730,7 +1730,7 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, * adds default one */ label_template = gtk_label_new(_("Template:"));
- glatex_wizard.template_combobox = gtk_combo_box_new_text(); + glatex_wizard.template_combobox = gtk_combo_box_text_new(); ui_widget_set_tooltip_text(glatex_wizard.template_combobox, _("Set the template which should be used for creating the new document")); gtk_misc_set_alignment(GTK_MISC(label_template), 0, 0.5); @@ -1740,7 +1740,7 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem,
/* Adding default/build in templates to pull down and set the generic * one as default */ - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.template_combobox), + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.template_combobox), LATEX_WIZARD_TEMPLATE_DEFAULT, _("Default")); gtk_combo_box_set_active(GTK_COMBO_BOX(glatex_wizard.template_combobox), LATEX_WIZARD_TEMPLATE_DEFAULT); @@ -1753,18 +1753,18 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem,
/* Documentclass */ label_documentclass = gtk_label_new(_("Documentclass:")); - glatex_wizard.documentclass_combobox = gtk_combo_box_new_text(); + glatex_wizard.documentclass_combobox = gtk_combo_box_text_new(); ui_widget_set_tooltip_text(glatex_wizard.documentclass_combobox, _("Choose the kind of document you want to write")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.documentclass_combobox), 0, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.documentclass_combobox), 0, _("Book")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.documentclass_combobox), 1, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.documentclass_combobox), 1, _("Article")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.documentclass_combobox), 2, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.documentclass_combobox), 2, _("Report")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.documentclass_combobox), 3, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.documentclass_combobox), 3, _("Letter")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.documentclass_combobox), 4, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.documentclass_combobox), 4, _("Presentation"));
gtk_combo_box_set_active(GTK_COMBO_BOX(glatex_wizard.documentclass_combobox), 0); @@ -1777,12 +1777,12 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem, /* Encoding */ label_encoding = gtk_label_new(_("Encoding:"));
- glatex_wizard.encoding_combobox = gtk_combo_box_new_text(); + glatex_wizard.encoding_combobox = gtk_combo_box_text_new(); ui_widget_set_tooltip_text(glatex_wizard.encoding_combobox, _("Set the encoding for your new document")); for (i = 0; i < LATEX_ENCODINGS_MAX; i++) { - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.encoding_combobox), i, + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.encoding_combobox), i, latex_encodings[i].name); }
@@ -1796,10 +1796,10 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem,
/* fontsize */ label_fontsize = gtk_label_new(_("Font size")); - glatex_wizard.fontsize_combobox = gtk_combo_box_entry_new_text(); - gtk_combo_box_append_text(GTK_COMBO_BOX(glatex_wizard.fontsize_combobox),"10pt"); - gtk_combo_box_append_text(GTK_COMBO_BOX(glatex_wizard.fontsize_combobox),"11pt"); - gtk_combo_box_append_text(GTK_COMBO_BOX(glatex_wizard.fontsize_combobox),"12pt"); + glatex_wizard.fontsize_combobox = gtk_combo_box_text_new_with_entry(); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(glatex_wizard.fontsize_combobox),"10pt"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(glatex_wizard.fontsize_combobox),"11pt"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(glatex_wizard.fontsize_combobox),"12pt"); ui_widget_set_tooltip_text(glatex_wizard.fontsize_combobox, _("Set the default font size of your new document"));
@@ -1858,12 +1858,12 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem,
/* Papersize */ label_papersize = gtk_label_new(_("Paper size:")); - glatex_wizard.papersize_combobox = gtk_combo_box_new_text(); + glatex_wizard.papersize_combobox = gtk_combo_box_text_new(); ui_widget_set_tooltip_text(glatex_wizard.papersize_combobox, _("Choose the paper format for the newly created document")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.papersize_combobox), 0, "A4"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.papersize_combobox), 1, "A5"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.papersize_combobox), 2, "A6"); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.papersize_combobox), 0, "A4"); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.papersize_combobox), 1, "A5"); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.papersize_combobox), 2, "A6");
gtk_combo_box_set_active(GTK_COMBO_BOX(glatex_wizard.papersize_combobox), 0);
@@ -1874,12 +1874,12 @@ glatex_wizard_activated(G_GNUC_UNUSED GtkMenuItem * menuitem,
/* Paper direction */ label_orientation = gtk_label_new(_("Paper Orientation:")); - glatex_wizard.orientation_combobox = gtk_combo_box_new_text(); + glatex_wizard.orientation_combobox = gtk_combo_box_text_new(); ui_widget_set_tooltip_text(glatex_wizard.orientation_combobox, _("Choose the paper orientation for the newly created document")); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.orientation_combobox), 0, "Default"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.orientation_combobox), 1, "Portrait"); - gtk_combo_box_insert_text(GTK_COMBO_BOX(glatex_wizard.orientation_combobox), 2, "Landscape"); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.orientation_combobox), 0, "Default"); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.orientation_combobox), 1, "Portrait"); + gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(glatex_wizard.orientation_combobox), 2, "Landscape");
gtk_combo_box_set_active(GTK_COMBO_BOX(glatex_wizard.orientation_combobox), 0);
@@ -2105,8 +2105,8 @@ add_menu_to_menubar(void) { /* Build up menu for menubar */ menu_latex = gtk_menu_item_new_with_mnemonic(_("_LaTeX")); - gtk_menu_shell_insert( - menubar, menu_latex, g_list_length(menubar->children)-1); + gtk_menu_shell_append( + menubar, menu_latex);
menu_latex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu); @@ -2255,8 +2255,8 @@ add_menu_to_menubar(void) if (menu_bibtex == NULL) { menu_bibtex = gtk_menu_item_new_with_mnemonic(_("_BibTeX")); - gtk_menu_shell_insert( - menubar, menu_bibtex, g_list_length(menubar->children)-1); + gtk_menu_shell_append( + menubar, menu_bibtex);
menu_bibtex_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_bibtex), menu_bibtex_menu); diff --git a/geanylatex/src/latexenvironments.c b/geanylatex/src/latexenvironments.c index 7a192d7..21b310c 100644 --- a/geanylatex/src/latexenvironments.c +++ b/geanylatex/src/latexenvironments.c @@ -206,12 +206,12 @@ glatex_insert_environment_dialog(G_GNUC_UNUSED GtkMenuItem *menuitem, gtk_table_set_row_spacings(GTK_TABLE(table), 6);
label_env = gtk_label_new(_("Environment:")); - textbox_env = gtk_combo_box_entry_new_text(); + textbox_env = gtk_combo_box_text_new_with_entry();
max = glatex_count_menu_entries(glatex_environment_array, -1); for (i = 0; i < max; i++) { - gtk_combo_box_append_text(GTK_COMBO_BOX(textbox_env), + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(textbox_env), glatex_environment_array[i].label); }
@@ -235,8 +235,8 @@ glatex_insert_environment_dialog(G_GNUC_UNUSED GtkMenuItem *menuitem, { gchar *env_string = NULL;
- env_string = g_strdup(gtk_combo_box_get_active_text( - GTK_COMBO_BOX(textbox_env))); + env_string = g_strdup(gtk_combo_box_text_get_active_text( + GTK_COMBO_BOX_TEXT(textbox_env)));
if (env_string != NULL) { diff --git a/geanylatex/src/reftex.c b/geanylatex/src/reftex.c index c827cfd..fd7a528 100644 --- a/geanylatex/src/reftex.c +++ b/geanylatex/src/reftex.c @@ -46,7 +46,7 @@ void glatex_parse_aux_file(gchar *file, gpointer combobox) { tmp = glatex_parseLine(aux_entries[i]); tmp_label_name = g_strdup(tmp->label_name); - gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp_label_name); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox), tmp_label_name); g_free(tmp); g_free(tmp_label_name); } diff --git a/geanylatex/src/templates.c b/geanylatex/src/templates.c index f91be54..92a6f9c 100644 --- a/geanylatex/src/templates.c +++ b/geanylatex/src/templates.c @@ -100,7 +100,7 @@ void glatex_add_templates_to_combobox(GPtrArray *templates, GtkWidget *combobox) for (i = 0; i < templates->len; i++) { tmp = g_ptr_array_index(templates,i); - gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox), tmp->label); } }
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanylipsum.m4 | 1 - geanylipsum/src/geanylipsum.c | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/build/geanylipsum.m4 b/build/geanylipsum.m4 index 6bc52fa..d48db2c 100644 --- a/build/geanylipsum.m4 +++ b/build/geanylipsum.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYLIPSUM], [ GP_ARG_DISABLE([GeanyLipsum], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyLipsum]) GP_COMMIT_PLUGIN_STATUS([GeanyLipsum]) AC_CONFIG_FILES([ geanylipsum/Makefile diff --git a/geanylipsum/src/geanylipsum.c b/geanylipsum/src/geanylipsum.c index 36f7c54..c87143d 100644 --- a/geanylipsum/src/geanylipsum.c +++ b/geanylipsum/src/geanylipsum.c @@ -140,12 +140,9 @@ plugin_init(G_GNUC_UNUSED GeanyData *data) { GtkWidget *menu_lipsum = NULL; GKeyFile *config = g_key_file_new(); - GtkTooltips *tooltips = NULL; gchar *config_file = NULL; GeanyKeyGroup *key_group;
- tooltips = gtk_tooltips_new(); - main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
config_file = g_strconcat(geany->app->configdir, @@ -161,8 +158,7 @@ plugin_init(G_GNUC_UNUSED GeanyData *data)
/* Building menu entry */ menu_lipsum = gtk_image_menu_item_new_with_mnemonic(_("_Lipsum")); - gtk_tooltips_set_tip(tooltips, menu_lipsum, - _("Include Pseudotext to your code"), NULL); + gtk_widget_set_tooltip_text(menu_lipsum, _("Include Pseudotext to your code")); gtk_widget_show(menu_lipsum); g_signal_connect((gpointer) menu_lipsum, "activate", G_CALLBACK(lipsum_activated), NULL);
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanymacro.m4 | 1 - geanymacro/src/geanymacro.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/build/geanymacro.m4 b/build/geanymacro.m4 index 7146ac8..99cba3c 100644 --- a/build/geanymacro.m4 +++ b/build/geanymacro.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYMACRO], [ GP_ARG_DISABLE([GeanyMacro], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyMacro]) GP_COMMIT_PLUGIN_STATUS([GeanyMacro]) AC_CONFIG_FILES([ geanymacro/Makefile diff --git a/geanymacro/src/geanymacro.c b/geanymacro/src/geanymacro.c index e6aa80e..2f46226 100644 --- a/geanymacro/src/geanymacro.c +++ b/geanymacro/src/geanymacro.c @@ -901,7 +901,7 @@ NULL); GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport((GtkScrolledWindow*)scroll,label);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),scroll); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),scroll); gtk_widget_show(scroll);
/* set dialog size (leave width default) */ @@ -1065,7 +1065,7 @@ static gboolean InitializeMacroRecord(void)
/* create box to hold macro trigger entry box and label */ hbox=gtk_hbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),hbox); gtk_widget_show(hbox);
gtkl=gtk_label_new(_("Macro Trigger:")); @@ -1079,7 +1079,7 @@ static gboolean InitializeMacroRecord(void)
/* create box to hold macro name entry box, and label */ hbox=gtk_hbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),hbox); gtk_widget_show(hbox);
gtkl=gtk_label_new(_("Macro Name:")); @@ -1395,7 +1395,7 @@ static void EditSearchOptions(GtkTreeModel *model,GtkTreeIter *iter)
/* create box to hold widgets */ vbox=gtk_vbox_new(FALSE, 6); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),vbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),vbox); gtk_widget_show(vbox);
/* create combobox to hold search direction */ @@ -1538,7 +1538,7 @@ static void EditSCIREPLACESELText(GtkTreeModel *model,GtkTreeIter *iter)
/* create box to hold macro name entry box, and label */ hbox=gtk_hbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),hbox); gtk_widget_show(hbox);
gtkl=gtk_label_new(_("Text:")); @@ -1808,8 +1808,8 @@ static void EditMacroElements(Macro *m) GTK_SELECTION_SINGLE);
/* add table to dialog */ - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),table); -/* gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),table,FALSE,FALSE,2);*/ + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),table); +/* gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),table,FALSE,FALSE,2);*/ gtk_widget_show(table);
/* add buttons */ @@ -2109,7 +2109,7 @@ static void DoEditMacro(GtkMenuItem *menuitem, gpointer gdata) GTK_SELECTION_SINGLE);
/* add table to dialog */ - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),table,FALSE,FALSE,2); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),table,FALSE,FALSE,2); gtk_widget_show(table);
/* add buttons */
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net ---
Missed the GtkComboBox update
build/geanymacro.m4 | 1 - geanymacro/src/geanymacro.c | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/build/geanymacro.m4 b/build/geanymacro.m4 index 7146ac8..99cba3c 100644 --- a/build/geanymacro.m4 +++ b/build/geanymacro.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYMACRO], [ GP_ARG_DISABLE([GeanyMacro], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyMacro]) GP_COMMIT_PLUGIN_STATUS([GeanyMacro]) AC_CONFIG_FILES([ geanymacro/Makefile diff --git a/geanymacro/src/geanymacro.c b/geanymacro/src/geanymacro.c index e6aa80e..36a0ce8 100644 --- a/geanymacro/src/geanymacro.c +++ b/geanymacro/src/geanymacro.c @@ -901,7 +901,7 @@ NULL); GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport((GtkScrolledWindow*)scroll,label);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),scroll); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),scroll); gtk_widget_show(scroll);
/* set dialog size (leave width default) */ @@ -1065,7 +1065,7 @@ static gboolean InitializeMacroRecord(void)
/* create box to hold macro trigger entry box and label */ hbox=gtk_hbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),hbox); gtk_widget_show(hbox);
gtkl=gtk_label_new(_("Macro Trigger:")); @@ -1079,7 +1079,7 @@ static gboolean InitializeMacroRecord(void)
/* create box to hold macro name entry box, and label */ hbox=gtk_hbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),hbox); gtk_widget_show(hbox);
gtkl=gtk_label_new(_("Macro Name:")); @@ -1395,14 +1395,14 @@ static void EditSearchOptions(GtkTreeModel *model,GtkTreeIter *iter)
/* create box to hold widgets */ vbox=gtk_vbox_new(FALSE, 6); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),vbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),vbox); gtk_widget_show(vbox);
/* create combobox to hold search direction */ - gtkcb=gtk_combo_box_new_text(); - gtk_combo_box_append_text((GtkComboBox*)gtkcb,_("Search Forwards")); - gtk_combo_box_append_text((GtkComboBox*)gtkcb,_("Search Backwards")); - gtk_combo_box_set_active((GtkComboBox*)gtkcb,(mde->message==SCI_SEARCHNEXT)?0:1); + gtkcb=gtk_combo_box_text_new(); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkcb),_("Search Forwards")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkcb),_("Search Backwards")); + gtk_combo_box_set_active(GTK_COMBO_BOX(gtkcb),(mde->message==SCI_SEARCHNEXT)?0:1); gtk_box_pack_start(GTK_BOX(vbox),gtkcb,FALSE,FALSE,2); gtk_widget_show(gtkcb);
@@ -1538,7 +1538,7 @@ static void EditSCIREPLACESELText(GtkTreeModel *model,GtkTreeIter *iter)
/* create box to hold macro name entry box, and label */ hbox=gtk_hbox_new(FALSE,0); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),hbox); gtk_widget_show(hbox);
gtkl=gtk_label_new(_("Text:")); @@ -1808,8 +1808,8 @@ static void EditMacroElements(Macro *m) GTK_SELECTION_SINGLE);
/* add table to dialog */ - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),table); -/* gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),table,FALSE,FALSE,2);*/ + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),table); +/* gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),table,FALSE,FALSE,2);*/ gtk_widget_show(table);
/* add buttons */ @@ -2109,7 +2109,7 @@ static void DoEditMacro(GtkMenuItem *menuitem, gpointer gdata) GTK_SELECTION_SINGLE);
/* add table to dialog */ - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),table,FALSE,FALSE,2); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),table,FALSE,FALSE,2); gtk_widget_show(table);
/* add buttons */
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanynumberedbookmarks.m4 | 1 - .../src/geanynumberedbookmarks.c | 28 +++++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/build/geanynumberedbookmarks.m4 b/build/geanynumberedbookmarks.m4 index 670bab9..d506ac4 100644 --- a/build/geanynumberedbookmarks.m4 +++ b/build/geanynumberedbookmarks.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYNUMBEREDBOOKMARKS], [ GP_ARG_DISABLE([GeanyNumberedBookmarks], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyNumberedBookmarks]) GP_COMMIT_PLUGIN_STATUS([GeanyNumberedBookmarks]) AC_CONFIG_FILES([ geanynumberedbookmarks/Makefile diff --git a/geanynumberedbookmarks/src/geanynumberedbookmarks.c b/geanynumberedbookmarks/src/geanynumberedbookmarks.c index 2a22ec1..8d1e42a 100644 --- a/geanynumberedbookmarks/src/geanynumberedbookmarks.c +++ b/geanynumberedbookmarks/src/geanynumberedbookmarks.c @@ -378,7 +378,7 @@ static gboolean SaveIndividualSetting(GKeyFile *gkf,FileData *fd,gint iNumber,gc /* i==10 if no markers set */
/* skip if no folding data or markers */ - if(i==10 && (bRememberFolds==FALSE || fd->pcFolding==NULL) && + if(i==10 && (bRememberFolds==FALSE || fd->pcFolding==NULL) && (bRememberBookmarks==FALSE || fd->pcBookmarks==NULL)) return FALSE;
@@ -863,7 +863,7 @@ static gint NextFreeMarker(ScintillaObject* sci) l=scintilla_send_message(sci,SCI_MARKERSYMBOLDEFINED,m,0); if(l==SC_MARK_CIRCLE || l==SC_MARK_AVAILABLE) return m; - } + }
/* no empty markers available so return -1 */ /* in theory shouldn't get here but leave just in case my logic is flawed */ @@ -1228,19 +1228,19 @@ GtkWidget *plugin_configure(GtkDialog *dialog) /* save pointer to check_button */ g_object_set_data(G_OBJECT(dialog),"Geany_Numbered_Bookmarks_cb2",gtkw);
- gtkw=gtk_combo_box_new_text(); - gtk_combo_box_append_text((GtkComboBox*)gtkw,_("Move to start of line")); - gtk_combo_box_append_text((GtkComboBox*)gtkw,_("Move to remembered position in line")); - gtk_combo_box_append_text((GtkComboBox*)gtkw,_("Move to position in current line")); - gtk_combo_box_append_text((GtkComboBox*)gtkw,_("Move to End of line")); - gtk_combo_box_set_active((GtkComboBox*)gtkw,PositionInLine); + gtkw=gtk_combo_box_text_new(); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkw),_("Move to start of line")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkw),_("Move to remembered position in line")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkw),_("Move to position in current line")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkw),_("Move to End of line")); + gtk_combo_box_set_active(GTK_COMBO_BOX(gtkw),PositionInLine); gtk_box_pack_start(GTK_BOX(vbox),gtkw,FALSE,FALSE,2); g_object_set_data(G_OBJECT(dialog),"Geany_Numbered_Bookmarks_cb3",gtkw);
- gtkw=gtk_combo_box_new_text(); - gtk_combo_box_append_text((GtkComboBox*)gtkw,_("Save file settings with program settings")); - gtk_combo_box_append_text((GtkComboBox*)gtkw,_("Save file settings to filename with suffix")); - gtk_combo_box_set_active((GtkComboBox*)gtkw,WhereToSaveFileDetails); + gtkw=gtk_combo_box_text_new(); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkw),_("Save file settings with program settings")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gtkw),_("Save file settings to filename with suffix")); + gtk_combo_box_set_active(GTK_COMBO_BOX(gtkw),WhereToSaveFileDetails); gtk_box_pack_start(GTK_BOX(vbox),gtkw,FALSE,FALSE,2); g_object_set_data(G_OBJECT(dialog),"Geany_Numbered_Bookmarks_cb4",gtkw);
@@ -1288,7 +1288,7 @@ will move the bookmark there if it was set on a different line, or create it if GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport((GtkScrolledWindow*)scroll,label);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),scroll); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),scroll); gtk_widget_show(scroll);
/* set dialog size (leave width default) */ @@ -1360,7 +1360,7 @@ static void GotoBookMark(gint iBookMark) /* make sure view is not beyond start or end of document */ if(iLine+iLinesVisible>iLineCount) iLine=iLineCount-iLinesVisible; - + if(iLine<0) iLine=0;
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanyprj.m4 | 1 - geanyprj/src/menu.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/build/geanyprj.m4 b/build/geanyprj.m4 index 4c11ab4..c733e3c 100644 --- a/build/geanyprj.m4 +++ b/build/geanyprj.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYPRJ], [ GP_ARG_DISABLE([GeanyPrj], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyPrj]) GP_COMMIT_PLUGIN_STATUS([GeanyPrj]) AC_CONFIG_FILES([ geanyprj/Makefile diff --git a/geanyprj/src/menu.c b/geanyprj/src/menu.c index 42cc61e..8aaedb5 100644 --- a/geanyprj/src/menu.c +++ b/geanyprj/src/menu.c @@ -180,9 +180,9 @@ static PropertyDialogElements *build_properties_dialog(gboolean properties) label = gtk_label_new(_("Type:")); gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
- e->type = gtk_combo_box_new_text(); + e->type = gtk_combo_box_text_new(); for (i = 0; i < NEW_PROJECT_TYPE_SIZE; i++) - gtk_combo_box_append_text(GTK_COMBO_BOX(e->type), project_type_string[i]); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(e->type), project_type_string[i]); gtk_combo_box_set_active(GTK_COMBO_BOX(e->type), 0);
ui_table_add_row(GTK_TABLE(table), 4, label, e->type, NULL);
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/treebrowser.m4 | 1 - treebrowser/src/treebrowser.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/build/treebrowser.m4 b/build/treebrowser.m4 index 5936607..a4e127f 100644 --- a/build/treebrowser.m4 +++ b/build/treebrowser.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_TREEBROWSER], [ GP_ARG_DISABLE([Treebrowser], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([Treebrowser]) if [[ "$enable_treebrowser" != no ]]; then AC_CHECK_FUNC([creat], [enable_treebrowser=yes], diff --git a/treebrowser/src/treebrowser.c b/treebrowser/src/treebrowser.c index fd12a80..085ad64 100644 --- a/treebrowser/src/treebrowser.c +++ b/treebrowser/src/treebrowser.c @@ -1906,10 +1906,10 @@ plugin_configure(GtkDialog *dialog)
hbox = gtk_hbox_new(FALSE, 0); label = gtk_label_new(_("Toolbar")); - configure_widgets.SHOW_BARS = gtk_combo_box_new_text(); - gtk_combo_box_append_text( GTK_COMBO_BOX(configure_widgets.SHOW_BARS), _("Hidden")); - gtk_combo_box_append_text( GTK_COMBO_BOX(configure_widgets.SHOW_BARS), _("Top")); - gtk_combo_box_append_text( GTK_COMBO_BOX(configure_widgets.SHOW_BARS), _("Bottom")); + configure_widgets.SHOW_BARS = gtk_combo_box_text_new(); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(configure_widgets.SHOW_BARS), _("Hidden")); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(configure_widgets.SHOW_BARS), _("Top")); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(configure_widgets.SHOW_BARS), _("Bottom")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 6); gtk_box_pack_start(GTK_BOX(hbox), configure_widgets.SHOW_BARS, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 6); @@ -1919,10 +1919,10 @@ plugin_configure(GtkDialog *dialog)
hbox = gtk_hbox_new(FALSE, 0); label = gtk_label_new(_("Show icons")); - configure_widgets.SHOW_ICONS = gtk_combo_box_new_text(); - gtk_combo_box_append_text( GTK_COMBO_BOX(configure_widgets.SHOW_ICONS), _("None")); - gtk_combo_box_append_text( GTK_COMBO_BOX(configure_widgets.SHOW_ICONS), _("Base")); - gtk_combo_box_append_text( GTK_COMBO_BOX(configure_widgets.SHOW_ICONS), _("Content-type")); + configure_widgets.SHOW_ICONS = gtk_combo_box_text_new(); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(configure_widgets.SHOW_ICONS), _("None")); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(configure_widgets.SHOW_ICONS), _("Base")); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT(configure_widgets.SHOW_ICONS), _("Content-type")); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 6); gtk_box_pack_start(GTK_BOX(hbox), configure_widgets.SHOW_ICONS, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 6); @@ -2017,11 +2017,11 @@ static void kb_activate(guint key_id) case KB_RENAME_OBJECT: treebrowser_rename_current(); break; - + case KB_CREATE_FILE: treebrowser_create_new_current("file"); break; - + case KB_CREATE_DIR: treebrowser_create_new_current("directory"); break;
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/geanylua.m4 | 1 - geanylua/glspi_app.c | 4 ++-- geanylua/glspi_dlg.c | 14 +++++++------- geanylua/glspi_run.c | 8 ++++---- geanylua/gsdlg.c | 34 +++++++++++++++++----------------- 5 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/build/geanylua.m4 b/build/geanylua.m4 index 681eb8a..22c6e14 100644 --- a/build/geanylua.m4 +++ b/build/geanylua.m4 @@ -1,7 +1,6 @@ AC_DEFUN([GP_CHECK_GEANYLUA], [ GP_ARG_DISABLE([GeanyLua], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([GeanyLua])
AC_ARG_WITH([lua-pkg], AC_HELP_STRING([--with-lua-pkg=ARG], diff --git a/geanylua/glspi_app.c b/geanylua/glspi_app.c index c9ca48d..c475b9d 100644 --- a/geanylua/glspi_app.c +++ b/geanylua/glspi_app.c @@ -582,7 +582,7 @@ static gint glspi_keygrab(lua_State* L) gint pos=sci_get_position_from_line(doc->editor->sci, fvl+1); scintilla_send_message(doc->editor->sci,SCI_CALLTIPSHOW,pos+3, (sptr_t)prompt); } - gdk_window_add_filter(main_widgets->window->window, keygrab_cb, &km); + gdk_window_add_filter(gtk_widget_get_window(main_widgets->window), keygrab_cb, &km); do { while (gtk_events_pending()) { if (km.group==2) { break; } @@ -592,7 +592,7 @@ static gint glspi_keygrab(lua_State* L) dosleep(); } while (km.group!=2);
- gdk_window_remove_filter(main_widgets->window->window, keygrab_cb, &km); + gdk_window_remove_filter(gtk_widget_get_window(main_widgets->window), keygrab_cb, &km); if (prompt && doc && doc->is_valid) { sci_send_command(doc->editor->sci, SCI_CALLTIPCANCEL); } diff --git a/geanylua/glspi_dlg.c b/geanylua/glspi_dlg.c index 8066d74..7cd7221 100644 --- a/geanylua/glspi_dlg.c +++ b/geanylua/glspi_dlg.c @@ -163,17 +163,17 @@ static gint glspi_choose(lua_State* L) scroll=gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox),scroll); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),scroll); gtk_container_add(GTK_CONTAINER(scroll),tree);
gtk_widget_set_size_request(tree, 320, 240); gtk_widget_show_all(dialog); gtk_window_set_resizable(GTK_WINDOW(dialog), TRUE);
- gtk_signal_connect(GTK_OBJECT(tree), "button-press-event", - GTK_SIGNAL_FUNC(on_tree_clicked), dialog); - gtk_signal_connect(GTK_OBJECT(tree), "key-release-event", - GTK_SIGNAL_FUNC(on_tree_key_release), dialog); + g_signal_connect(G_OBJECT(tree), "button-press-event", + G_CALLBACK(on_tree_clicked), dialog); + g_signal_connect(G_OBJECT(tree), "key-release-event", + G_CALLBACK(on_tree_key_release), dialog);
rv=glspi_dialog_run(GTK_DIALOG(dialog));
@@ -294,7 +294,7 @@ static gint glspi_input(lua_State* L) gtk_widget_grab_default(ok_btn); entry=gtk_entry_new(); if (arg2) { gtk_entry_set_text(GTK_ENTRY(entry), arg2); } - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), entry); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), entry); gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); set_dialog_title(L,dialog); gtk_widget_set_size_request(entry, 320, -1); @@ -412,7 +412,7 @@ static gchar *file_dlg(lua_State* L, gboolean save, const gchar *path, const gch GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); #if NEED_OVERWRITE_PROMPT - gtk_signal_connect(GTK_OBJECT(dlg),"response",G_CALLBACK(on_file_dlg_response),&accepted); + g_signal_connect(G_OBJECT(dlg),"response",G_CALLBACK(on_file_dlg_response),&accepted); #else gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dlg), TRUE); #endif diff --git a/geanylua/glspi_run.c b/geanylua/glspi_run.c index 129cade..f41bd23 100644 --- a/geanylua/glspi_run.c +++ b/geanylua/glspi_run.c @@ -23,8 +23,8 @@ static void repaint_scintilla(void) { GeanyDocument* doc=document_get_current(); if ( doc && doc->is_valid ) { - gdk_window_invalidate_rect(GTK_WIDGET(doc->editor->sci)->window, NULL, TRUE); - gdk_window_process_updates(GTK_WIDGET(doc->editor->sci)->window, TRUE); + gdk_window_invalidate_rect(gtk_widget_get_window(GTK_WIDGET(doc->editor->sci)), NULL, TRUE); + gdk_window_process_updates(gtk_widget_get_window(GTK_WIDGET(doc->editor->sci)), TRUE); } }
@@ -209,8 +209,8 @@ static void debug_hook(lua_State *L, lua_Debug *ar) } } if (si->counter > 100000) { - gdk_window_invalidate_rect(main_widgets->window->window, NULL, TRUE); - gdk_window_process_updates(main_widgets->window->window, TRUE); + gdk_window_invalidate_rect(gtk_widget_get_window(main_widgets->window), NULL, TRUE); + gdk_window_process_updates(gtk_widget_get_window(main_widgets->window), TRUE); si->counter=0; } else si->counter++; } diff --git a/geanylua/gsdlg.c b/geanylua/gsdlg.c index d5fe523..bace2d7 100644 --- a/geanylua/gsdlg.c +++ b/geanylua/gsdlg.c @@ -70,7 +70,7 @@ void gsdlg_textarea(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label frm=gtk_frame_new(label); gtk_frame_set_shadow_type(GTK_FRAME(frm), GTK_SHADOW_ETCHED_IN); gtk_container_add(GTK_CONTAINER(frm),sw); - gtk_container_add(GTK_CONTAINER(dlg->vbox),frm); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(dlg)),frm); g_object_set_data_full(G_OBJECT(tv), TextKey, g_strdup(key), g_free); }
@@ -159,7 +159,7 @@ void gsdlg_file(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label) frm=gtk_frame_new(label); gtk_frame_set_shadow_type(GTK_FRAME(frm), GTK_SHADOW_ETCHED_IN); gtk_container_add(GTK_CONTAINER(frm),hbox); - gtk_container_add(GTK_CONTAINER(dlg->vbox),frm); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(dlg)),frm); g_object_set_data_full(G_OBJECT(input), TextKey, g_strdup(key), g_free); }
@@ -177,13 +177,13 @@ static void color_btn_clicked(GtkButton *button, gpointer user_data) cn=gtk_entry_get_text(GTK_ENTRY(user_data)); if (cn && *cn && gdk_color_parse(cn,&rgb)) { gtk_color_selection_set_current_color( - GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dlg)->colorsel), &rgb); + GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(dlg)), &rgb); } resp=gtk_dialog_run(GTK_DIALOG(dlg)); if (resp == GTK_RESPONSE_OK) { gchar *rv=NULL; gtk_color_selection_get_current_color( - GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dlg)->colorsel), &rgb); + GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(dlg)), &rgb); rv=g_strdup_printf("#%2.2X%2.2X%2.2X",rgb.red/256,rgb.green/256,rgb.blue/256); gtk_entry_set_text(GTK_ENTRY(user_data), rv); g_free(rv); @@ -211,7 +211,7 @@ void gsdlg_color(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr prompt) } gtk_box_pack_start(GTK_BOX(hbox), input,TRUE,TRUE,1); gtk_box_pack_start(GTK_BOX(hbox), btn,FALSE,FALSE,1); - gtk_container_add(GTK_CONTAINER(dlg->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(dlg)),hbox); g_object_set_data_full(G_OBJECT(input), TextKey, g_strdup(key), g_free); }
@@ -259,7 +259,7 @@ void gsdlg_font(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr prompt) } gtk_box_pack_start(GTK_BOX(hbox), input,TRUE,TRUE,1); gtk_box_pack_start(GTK_BOX(hbox), btn,FALSE,FALSE,1); - gtk_container_add(GTK_CONTAINER(dlg->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(dlg)),hbox); g_object_set_data_full(G_OBJECT(input), TextKey, g_strdup(key), g_free); }
@@ -278,7 +278,7 @@ static void gsdlg_entry(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr p gtk_box_pack_start(GTK_BOX(hbox), label,FALSE,FALSE,1); gtk_box_pack_start(GTK_BOX(hbox), input,TRUE,TRUE,1); gtk_entry_set_visibility(GTK_ENTRY(input), !masked); - gtk_container_add(GTK_CONTAINER(dlg->vbox),hbox); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(dlg)),hbox); g_object_set_data_full(G_OBJECT(input), TextKey, g_strdup(key), g_free); }
@@ -303,7 +303,7 @@ void gsdlg_checkbox(GtkDialog *dlg, GsDlgStr key, gboolean value, GsDlgStr label cb=gtk_check_button_new_with_label(label); g_object_set_data_full(G_OBJECT(cb),TextKey,g_strdup(key), g_free); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cb),value); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox),cb); + gtk_container_add(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))),cb); }
@@ -334,7 +334,7 @@ static GtkWidget *find_widget_by_key(GtkDialog *dlg, GType type, GsDlgStr key) g_return_val_if_fail(dlg, NULL); kv.key=key; kv.type=type; - gtk_container_foreach(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox),find_widget_by_key_cb,&kv); + gtk_container_foreach(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))),find_widget_by_key_cb,&kv); return kv.value; }
@@ -371,7 +371,7 @@ void gsdlg_group(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label) frm=gtk_frame_new(label); vbox=gtk_vbox_new(FALSE,FALSE); gtk_container_add(GTK_CONTAINER(frm),vbox); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox),frm); + gtk_container_add(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))),frm); }
/* Frame holds keyname, vbox holds default value */ @@ -450,11 +450,11 @@ void gsdlg_select(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label) hbox=gtk_hbox_new(FALSE,FALSE); cw=g_malloc0(sizeof(ComboWidgets)); g_object_set_data_full(G_OBJECT(hbox),DataKey,cw,g_free); - cw->combo=gtk_combo_box_new_text(); + cw->combo=gtk_combo_box_text_new(); cw->label=gtk_label_new(label); gtk_box_pack_start(GTK_BOX(hbox), cw->label,FALSE,FALSE,4); gtk_box_pack_start(GTK_BOX(hbox), cw->combo,TRUE,TRUE,1); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox),hbox); + gtk_container_add(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))),hbox); } /* Hbox holds keyname, combo holds default value */ g_object_set_data_full(G_OBJECT(hbox), TextKey, g_strdup(key), g_free); @@ -481,7 +481,7 @@ void gsdlg_option(GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label) values=g_object_steal_data(G_OBJECT(cw->combo), DataKey); values=g_slist_append(values, g_strdup(value)); g_object_set_data_full(G_OBJECT(cw->combo), DataKey, values, destroy_slist_and_data); - gtk_combo_box_append_text(GTK_COMBO_BOX(cw->combo), label); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(cw->combo), label); defval=g_object_get_data(G_OBJECT(cw->combo), TextKey); if (value && defval && g_str_equal(value,defval)) { select_combo(cw->combo,value); @@ -496,7 +496,7 @@ void gsdlg_label(GtkDialog *dlg, GsDlgStr text) GtkWidget *lab=NULL; g_return_if_fail(dlg); lab=gtk_label_new(text); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox), lab); + gtk_container_add(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))), lab); gtk_misc_set_alignment(GTK_MISC(lab), 0.0f, 0.0f); }
@@ -505,7 +505,7 @@ void gsdlg_label(GtkDialog *dlg, GsDlgStr text) void gsdlg_hr(GtkDialog *dlg) { g_return_if_fail(dlg); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox), gtk_hseparator_new()); + gtk_container_add(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))), gtk_hseparator_new()); }
@@ -534,7 +534,7 @@ GtkDialog *gsdlg_new(GsDlgStr title, GsDlgStr*btns) for (i=0; btns[i]; i++) { gtk_dialog_add_button(GTK_DIALOG(dlg),btns[i],i); } - gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dlg)->vbox), 4); + gtk_box_set_spacing(GTK_BOX(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))), 4); gtk_container_set_border_width(GTK_CONTAINER(dlg), 4); gtk_window_set_title(GTK_WINDOW(dlg),title); return dlg; @@ -605,7 +605,7 @@ GHashTable* gsdlg_run(GtkDialog *dlg, gint *btn, gpointer user_data) if (gsdlg_run_hook) { gsdlg_run_hook(FALSE,user_data); } if (*btn<0) *btn=-1; results=g_hash_table_new_full(g_str_hash,g_str_equal,g_free,g_free); - gtk_container_foreach(GTK_CONTAINER(GTK_DIALOG(dlg)->vbox),widgets_foreach,results); + gtk_container_foreach(GTK_CONTAINER(GTK_CONTAINER(gtk_dialog_get_content_area(dlg))),widgets_foreach,results); gtk_widget_hide(GTK_WIDGET(dlg)); return results; }
From: Quentin Glidic sardemff7+git@sardemff7.net
Signed-off-by: Quentin Glidic sardemff7+git@sardemff7.net --- build/pretty-printer.m4 | 1 - pretty-printer/src/ConfigUI.c | 132 +++++++++++++++++++++--------------------- 2 files changed, 66 insertions(+), 67 deletions(-)
diff --git a/build/pretty-printer.m4 b/build/pretty-printer.m4 index 92478d0..82a8f44 100644 --- a/build/pretty-printer.m4 +++ b/build/pretty-printer.m4 @@ -3,7 +3,6 @@ AC_DEFUN([GP_CHECK_PRETTYPRINTER], LIBXML_VERSION=2.6.27
GP_ARG_DISABLE([pretty-printer], [auto]) - GP_CHECK_PLUGIN_GTK2_ONLY([pretty-printer]) GP_CHECK_PLUGIN_DEPS([pretty-printer], [LIBXML], [libxml-2.0 >= ${LIBXML_VERSION}]) GP_COMMIT_PLUGIN_STATUS([Pretty Printer]) diff --git a/pretty-printer/src/ConfigUI.c b/pretty-printer/src/ConfigUI.c index 2aa1ab2..c9121bd 100644 --- a/pretty-printer/src/ConfigUI.c +++ b/pretty-printer/src/ConfigUI.c @@ -50,7 +50,7 @@ static GtkWidget* lineBreak; PrettyPrintingOptions* prettyPrintingOptions;
/* Will never be used, just here for example */ -GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog) +GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog) { PrettyPrintingOptions* ppo; GtkWidget* container; @@ -62,13 +62,13 @@ GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog) GtkWidget* emptyOptions; GtkWidget* indentationOptions; GtkWidget* lineReturnOptions; - + /* default printing options */ if (prettyPrintingOptions == NULL) { prettyPrintingOptions = createDefaultPrettyPrintingOptions(); } ppo = prettyPrintingOptions;
container = gtk_hbox_new(FALSE, 10); - + leftBox = gtk_vbox_new(FALSE, 6); commentOptions = createThreeOptionsBox(_("Comments"), _("Put on one line"), _("Inline if possible"), _("Alignment"), ppo->oneLineComment, ppo->inlineComment, ppo->alignComment, &commentOneLine, &commentInline, &commentAlign); textOptions = createThreeOptionsBox(_("Text nodes"), _("Put on one line"), _("Inline if possible"), _("Alignment"), ppo->oneLineText, ppo->inlineText, ppo->alignText, &textOneLine, &textInline, &textAlign); @@ -80,7 +80,7 @@ GtkWidget* createPrettyPrinterConfigUI(GtkDialog * dialog) gtk_box_pack_start(GTK_BOX(leftBox), commentOptions, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(leftBox), textOptions, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(leftBox), cdataOptions, FALSE, FALSE, 3); - + rightBox = gtk_vbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(rightBox), emptyOptions, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), indentationOptions, FALSE, FALSE, 3); @@ -97,26 +97,26 @@ void saveSettings(void) { int breakStyle; PrettyPrintingOptions* ppo = prettyPrintingOptions; - + ppo->oneLineComment = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(commentOneLine)); ppo->inlineComment = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(commentInline)); ppo->alignComment = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(commentAlign)); - + ppo->oneLineText = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(textOneLine)); ppo->inlineText = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(textInline)); ppo->alignText = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(textAlign)); - + ppo->oneLineCdata = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cdataOneLine)); ppo->inlineCdata = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cdataInline)); ppo->alignCdata = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cdataAlign)); - + ppo->emptyNodeStripping = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(emptyNodeStripping)); ppo->emptyNodeStrippingSpace = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(emptyNodeStrippingSpace)); ppo->forceEmptyNodeSplit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(emptyNodeSplit)); - + ppo->indentLength = gtk_spin_button_get_value(GTK_SPIN_BUTTON(indentationCount)); ppo->indentChar = gtk_combo_box_get_active(GTK_COMBO_BOX(indentationChar))==0 ? '\t' : ' '; - + breakStyle = gtk_combo_box_get_active(GTK_COMBO_BOX(lineBreak)); if (breakStyle == 0) ppo->newLineChars = "\r"; else if (breakStyle == 1) ppo->newLineChars = "\n"; @@ -125,74 +125,74 @@ void saveSettings(void)
/*============================================= PRIVATE FUNCTIONS =======================================*/
-/*GtkWidget* createTwoOptionsBox(const char* label, - const char* checkBox1, - const char* checkBox2, - gboolean cb1Active, - gboolean cb2Active, - GtkWidget** option1, +/*GtkWidget* createTwoOptionsBox(const char* label, + const char* checkBox1, + const char* checkBox2, + gboolean cb1Active, + gboolean cb2Active, + GtkWidget** option1, GtkWidget** option2) { GtkWidget* container = gtk_hbox_new(TRUE, 2); GtkWidget* rightBox = gtk_vbox_new(FALSE, 6); GtkWidget* leftBox = gtk_vbox_new(FALSE, 6); - + GtkWidget* lbl = gtk_label_new(label); GtkWidget* chb1 = gtk_check_button_new_with_label(checkBox1); GtkWidget* chb2 = gtk_check_button_new_with_label(checkBox2); - + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb1), cb1Active); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb2), cb2Active); - + gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3); - + gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb1, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb2, FALSE, FALSE, 3); - + *option1 = chb1; *option2 = chb2; - + return container; }*/
-static GtkWidget* createThreeOptionsBox(const char* label, - const char* checkBox1, - const char* checkBox2, - const char* checkBox3, - gboolean cb1Active, - gboolean cb2Active, - gboolean cb3Active, - GtkWidget** option1, - GtkWidget** option2, +static GtkWidget* createThreeOptionsBox(const char* label, + const char* checkBox1, + const char* checkBox2, + const char* checkBox3, + gboolean cb1Active, + gboolean cb2Active, + gboolean cb3Active, + GtkWidget** option1, + GtkWidget** option2, GtkWidget** option3) { GtkWidget* container = gtk_hbox_new(TRUE, 2); GtkWidget* rightBox = gtk_vbox_new(FALSE, 6); GtkWidget* leftBox = gtk_vbox_new(FALSE, 6); - + GtkWidget* lbl = gtk_label_new(label); GtkWidget* chb1 = gtk_check_button_new_with_label(checkBox1); GtkWidget* chb2 = gtk_check_button_new_with_label(checkBox2); GtkWidget* chb3 = gtk_check_button_new_with_label(checkBox3); - + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb1), cb1Active); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb2), cb2Active); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb3), cb3Active); - + gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3); - + gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb1, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb2, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb3, FALSE, FALSE, 3); - + *option1 = chb1; *option2 = chb2; *option3 = chb3; - + return container; }
@@ -201,28 +201,28 @@ GtkWidget* createEmptyTextOptions(gboolean optEmptyNodeStripping, gboolean optEm GtkWidget* container = gtk_hbox_new(FALSE, 2); GtkWidget* rightBox = gtk_vbox_new(FALSE, 6); GtkWidget* leftBox = gtk_vbox_new(FALSE, 6); - + GtkWidget* lbl = gtk_label_new(_("Empty nodes")); GtkWidget* chb1 = gtk_check_button_new_with_label(_("Concatenation (<x></x> to <x/>)")); GtkWidget* chb2 = gtk_check_button_new_with_label(_("Spacing (<x/> to <x />)")); GtkWidget* chb3 = gtk_check_button_new_with_label(_("Expansion (<x/> to <x></x>)")); - + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb1), optEmptyNodeStripping); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb2), optEmptyNodeStrippingSpace); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(chb3), optForceEmptyNodeSplit); - + gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3); - + gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb1, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb2, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), chb3, FALSE, FALSE, 3); - + emptyNodeStripping = chb1; emptyNodeStrippingSpace = chb2; emptyNodeSplit = chb3; - + return container; }
@@ -231,27 +231,27 @@ GtkWidget* createIndentationOptions(char indentation, int count) GtkWidget* container = gtk_hbox_new(FALSE, 20); GtkWidget* rightBox = gtk_hbox_new(FALSE, 6); GtkWidget* leftBox = gtk_vbox_new(FALSE, 6); - + GtkWidget* lbl = gtk_label_new(_("Indentation")); - GtkWidget* comboChar = gtk_combo_box_new_text(); + GtkWidget* comboChar = gtk_combo_box_text_new(); GtkWidget* spinIndent = gtk_spin_button_new_with_range(0, 100, 1); - - gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), _("Tab")); - gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), _("Space")); + + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), _("Tab")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), _("Space")); gtk_combo_box_set_active(GTK_COMBO_BOX(comboChar), (indentation == ' ') ? 1 : 0); - + gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinIndent), count); - + gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), comboChar, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), spinIndent, FALSE, FALSE, 3); - + gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3); - + indentationChar = comboChar; indentationCount = spinIndent; - + return container; }
@@ -260,28 +260,28 @@ static GtkWidget* createLineReturnOptions(const char* lineReturn) GtkWidget* container = gtk_hbox_new(FALSE, 25); GtkWidget* rightBox = gtk_hbox_new(FALSE, 6); GtkWidget* leftBox = gtk_vbox_new(FALSE, 6); - + GtkWidget* lbl = gtk_label_new(_("Line break")); - GtkWidget* comboChar = gtk_combo_box_new_text(); - + GtkWidget* comboChar = gtk_combo_box_text_new(); + int active = 0; - - gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), "\r"); - gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), "\n"); - gtk_combo_box_append_text(GTK_COMBO_BOX(comboChar), "\r\n"); - + + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), "\r"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), "\n"); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(comboChar), "\r\n"); + if (strlen(lineReturn) == 2) active = 2; else if (lineReturn[0] == '\n') active = 1; - + gtk_combo_box_set_active(GTK_COMBO_BOX(comboChar), active); - + gtk_box_pack_start(GTK_BOX(leftBox), lbl, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(rightBox), comboChar, FALSE, FALSE, 3); - + gtk_box_pack_start(GTK_BOX(container), leftBox, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(container), rightBox, FALSE, FALSE, 3); - + lineBreak = comboChar; - + return container; }
Hello guys,
I made a little patchset, enabling each plugin and fixing the GTK+3 support.
I build all the fixed plugins, and barely tested them.
GeanyPrj has some packing issues in the sidebar. TreeBrowser seems fine. Others are pretty trivial ones.
Lua is the exception, since I do not use Lua myself, no testing for this one.
Cheers,
On Fri, 05 Apr 2013 09:25:22 +0200 Quentin Glidic sardemff7+geany@sardemff7.net wrote:
I made a little patchset, enabling each plugin and fixing the GTK+3 support.
Please ignore Scope - I added gtk+3 support, but other parts of the plugin are under development, so it's not released yet.