[geany/geany] d0a431: Remove pre-GTK+ 2.24 preprocessor checks and related code
Matthew Brush
git-noreply at xxxxx
Mon Apr 13 01:05:28 UTC 2015
Branch: refs/heads/master
Author: Matthew Brush <matt at geany.org>
Committer: Matthew Brush <matt at geany.org>
Date: Mon, 13 Apr 2015 01:05:28 UTC
Commit: d0a431e071fa09165abacbde1dad33a24fac1cf1
https://github.com/geany/geany/commit/d0a431e071fa09165abacbde1dad33a24fac1cf1
Log Message:
-----------
Remove pre-GTK+ 2.24 preprocessor checks and related code
Modified Paths:
--------------
src/dialogs.c
src/gtkcompat.h
src/printing.c
src/ui_utils.c
Modified: src/dialogs.c
6 lines changed, 1 insertions(+), 5 deletions(-)
===================================================================
@@ -897,12 +897,8 @@ void dialogs_show_open_font(void)
gtk_window_set_type_hint(GTK_WINDOW(ui_widgets.open_fontsel), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_widget_set_name(ui_widgets.open_fontsel, "GeanyDialog");
-#if GTK_CHECK_VERSION(2, 20, 0)
- /* apply button doesn't have a getter and is hidden by default, but we'd like to show it */
apply_button = gtk_dialog_get_widget_for_response(GTK_DIALOG(ui_widgets.open_fontsel), GTK_RESPONSE_APPLY);
-#else
- apply_button = GTK_FONT_SELECTION_DIALOG(ui_widgets.open_fontsel)->apply_button;
-#endif
+
if (apply_button)
gtk_widget_show(apply_button);
Modified: src/gtkcompat.h
25 lines changed, 0 insertions(+), 25 deletions(-)
===================================================================
@@ -71,31 +71,6 @@ G_BEGIN_DECLS
#endif
/* GtkWidget */
-#if ! GTK_CHECK_VERSION(2, 18, 0)
-# define compat_widget_set_flag(widget, flag, enable) \
- do { \
- GtkWidget *set_flag__widget = (widget); \
- GtkWidgetFlags set_flag__flag = (flag); \
- if (enable) \
- GTK_WIDGET_SET_FLAGS(set_flag__widget, set_flag__flag); \
- else \
- GTK_WIDGET_UNSET_FLAGS(set_flag__widget, set_flag__flag); \
- } while (0)
-# define gtk_widget_set_can_default(widget, can_default) \
- compat_widget_set_flag((widget), GTK_CAN_DEFAULT, (can_default))
-# define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL(widget)
-# define gtk_widget_is_sensitive(widget) GTK_WIDGET_IS_SENSITIVE(widget)
-# define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS(widget)
-# define gtk_widget_get_sensitive(widget) GTK_WIDGET_SENSITIVE(widget)
-# define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE(widget)
-# define gtk_widget_set_has_window(widget, has_window) \
- compat_widget_set_flag((widget), GTK_NO_WINDOW, !(has_window))
-# define gtk_widget_set_can_focus(widget, can_focus) \
- compat_widget_set_flag((widget), GTK_CAN_FOCUS, (can_focus))
-#endif
-#if ! GTK_CHECK_VERSION(2, 20, 0)
-# define gtk_widget_get_mapped(widget) GTK_WIDGET_MAPPED(widget)
-#endif
#if ! GTK_CHECK_VERSION(3, 0, 0)
# define gtk_widget_get_allocated_height(widget) (((GtkWidget *) (widget))->allocation.height)
# define gtk_widget_get_allocated_width(widget) (((GtkWidget *) (widget))->allocation.width)
Modified: src/printing.c
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -523,9 +523,7 @@ static void printing_print_gtk(GeanyDocument *doc)
gtk_print_operation_set_unit(op, GTK_UNIT_POINTS);
gtk_print_operation_set_show_progress(op, TRUE);
-#if GTK_CHECK_VERSION(2, 18, 0)
gtk_print_operation_set_embed_page_setup(op, TRUE);
-#endif
g_signal_connect(op, "begin-print", G_CALLBACK(begin_print), &dinfo);
g_signal_connect(op, "end-print", G_CALLBACK(end_print), &dinfo);
Modified: src/ui_utils.c
25 lines changed, 1 insertions(+), 24 deletions(-)
===================================================================
@@ -1495,29 +1495,6 @@ GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog)
}
-static GtkWidget *dialog_get_widget_for_response(GtkDialog *dialog, gint response_id)
-{
-#if GTK_CHECK_VERSION(2, 20, 0)
- return gtk_dialog_get_widget_for_response(dialog, response_id);
-#else /* GTK < 2.20 */
- /* base logic stolen from GTK */
- GtkWidget *action_area = gtk_dialog_get_action_area(dialog);
- GtkWidget *widget = NULL;
- GList *children, *node;
-
- children = gtk_container_get_children(GTK_CONTAINER(action_area));
- for (node = children; node && ! widget; node = node->next)
- {
- if (gtk_dialog_get_response_for_widget(dialog, node->data) == response_id)
- widget = node->data;
- }
- g_list_free(children);
-
- return widget;
-#endif
-}
-
-
/* Reorders a dialog's buttons
* @param dialog A dialog
* @param response First response ID to reorder
@@ -1541,7 +1518,7 @@ void ui_dialog_set_primary_button_order(GtkDialog *dialog, gint response, ...)
va_start(ap, response);
for (position = 0; response != -1; position++)
{
- GtkWidget *child = dialog_get_widget_for_response(dialog, response);
+ GtkWidget *child = gtk_dialog_get_widget_for_response(dialog, response);
if (child)
gtk_box_reorder_child(GTK_BOX(action_area), child, position);
else
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list