Remove commented out code.
[geeqie.git] / src / ui_misc.c
index 22f5fd3..45a087e 100644 (file)
@@ -556,11 +556,7 @@ static void pref_link_sensitivity_cb(GtkWidget *watch, GtkStateType prev_state,
 {
        GtkWidget *widget = data;
 
-#if GTK_CHECK_VERSION(2,20,0)
        gtk_widget_set_sensitive(widget, gtk_widget_is_sensitive(watch));
-#else
-       gtk_widget_set_sensitive(widget, GTK_WIDGET_IS_SENSITIVE(watch));
-#endif
 }
 
 void pref_link_sensitivity(GtkWidget *widget, GtkWidget *watch)
@@ -741,23 +737,9 @@ GtkWidget *pref_table_spin_new_int(GtkWidget *table, gint column, gint row,
 }
 
 
-#if ! GTK_CHECK_VERSION(2,12,0)
-
-static void pref_toolbar_destroy_cb(GtkWidget *widget, gpointer data)
-{
-       GtkTooltips *tips = data;
-
-       g_object_unref(G_OBJECT(tips));
-}
-
-#endif
-
 GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style)
 {
        GtkWidget *tbar;
-#if ! GTK_CHECK_VERSION(2,12,0)
-       GtkTooltips *tips;
-#endif
        
        tbar = gtk_toolbar_new();
        gtk_toolbar_set_style(GTK_TOOLBAR(tbar), style);
@@ -767,27 +749,6 @@ GtkWidget *pref_toolbar_new(GtkWidget *parent_box, GtkToolbarStyle style)
                gtk_box_pack_start(GTK_BOX(parent_box), tbar, FALSE, FALSE, 0);
                gtk_widget_show(tbar);
                }
-
-#if ! GTK_CHECK_VERSION(2,12,0)
-       tips = gtk_tooltips_new();
-
-       /* take ownership of tooltips */
-#  ifdef GTK_OBJECT_FLOATING
-       /* GTK+ < 2.10 */
-       g_object_ref(G_OBJECT(tips));
-       gtk_object_sink(GTK_OBJECT(tips));
-#  else
-       /* GTK+ >= 2.10 */
-       g_object_ref_sink(G_OBJECT(tips));
-#  endif
-
-       g_object_set_data(G_OBJECT(tbar), "tooltips", tips);
-       g_signal_connect(G_OBJECT(tbar), "destroy",
-                        G_CALLBACK(pref_toolbar_destroy_cb), tips);
-
-       gtk_tooltips_enable(tips);
-#endif
-
        return tbar;
 }
 
@@ -830,18 +791,8 @@ GtkWidget *pref_toolbar_button(GtkWidget *toolbar,
 
        if (description)
                {
-
-#if GTK_CHECK_VERSION(2,12,0)
-
                gtk_widget_set_tooltip_text(item, description);
-                       
-#else
-               GtkTooltips *tips;
-
-               tips = g_object_get_data(G_OBJECT(toolbar), "tooltips");
-               gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(item), tips, description, NULL);
-#endif
-       }
+               }
 
        return item;
 }
@@ -899,11 +850,7 @@ static void date_selection_popup_hide(DateSelection *ds)
 {
        if (!ds->window) return;
 
-#if GTK_CHECK_VERSION(2,20,0)
        if (gtk_widget_has_grab(ds->window))
-#else
-       if (GTK_WIDGET_HAS_GRAB(ds->window))
-#endif
                {
                gtk_grab_remove(ds->window);
                gdk_keyboard_ungrab(GDK_CURRENT_TIME);
@@ -967,14 +914,14 @@ static gboolean date_selection_popup_keypress_cb(GtkWidget *widget, GdkEventKey
 
        switch (event->keyval)
                {
-               case GDK_Return:
-               case GDK_KP_Enter:
-               case GDK_Tab:
-               case GDK_ISO_Left_Tab:
+               case GDK_KEY_Return:
+               case GDK_KEY_KP_Enter:
+               case GDK_KEY_Tab:
+               case GDK_KEY_ISO_Left_Tab:
                        date_selection_popup_sync(ds);
                        date_selection_popup_hide(ds);
                        break;
-               case GDK_Escape:
+               case GDK_KEY_Escape:
                        date_selection_popup_hide(ds);
                        break;
                default:
@@ -1338,11 +1285,7 @@ static gboolean sizer_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpoi
 
        if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE;
 
-#if GTK_CHECK_VERSION(2,20,0)
        if (gdk_pointer_is_grabbed() && gtk_widget_has_grab(sd->sizer))
-#else
-       if (gdk_pointer_is_grabbed() && GTK_WIDGET_HAS_GRAB(sd->sizer))
-#endif
                {
                gtk_grab_remove(sd->sizer);
                gdk_pointer_ungrab(bevent->time);
@@ -1381,12 +1324,24 @@ static gboolean sizer_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpoin
 
 static gboolean sizer_expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
 {
+#if GTK_CHECK_VERSION(3,0,0)
+       GtkAllocation allocation;
+
+       gtk_widget_get_allocation(widget, &allocation);
+
+       cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(widget));
+
+       gtk_render_handle (gtk_widget_get_style_context (widget),
+                          cr, allocation.x, allocation.y, allocation.width, allocation.height);
+       cairo_destroy(cr);
+#else
        SizerData *sd = data;
        GdkRectangle clip;
        GtkOrientation orientation;
        GtkStateType state;
        GtkAllocation allocation;
 
+       gtk_widget_get_allocation(widget, &allocation);
 
        if (sd->position & SIZER_POS_LEFT || sd->position & SIZER_POS_RIGHT)
                {
@@ -1406,14 +1361,6 @@ static gboolean sizer_expose_cb(GtkWidget *widget, GdkEventExpose *event, gpoint
                state = gtk_widget_get_state(widget);
                }
 
-       gtk_widget_get_allocation(widget, &allocation);
-#if GTK_CHECK_VERSION(3,0,0)
-       cairo_t *cr = gdk_cairo_create(gtk_widget_get_window(widget));
-
-       gtk_render_handle (gtk_widget_get_style_context (widget),
-                          cr, allocation.x, allocation.y, allocation.width, allocation.height);    
-       cairo_destroy(cr);
-#else
        gdk_region_get_clipbox(event->region, &clip);
 
        gtk_paint_handle(gtk_widget_get_style(widget), gtk_widget_get_window(widget), state,