Revision: 1138
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1138&view=rev
Author:   bruclik
Date:     2008-09-07 23:01:30 +0000 (Sun, 07 Sep 2008)

Log Message:
-----------
Replaced gtk depreceated code.

Modified Paths:
--------------
    trunk/src/collect-table.c
    trunk/src/dupe.c
    trunk/src/image-load.c
    trunk/src/image.c
    trunk/src/layout.c
    trunk/src/layout_image.c
    trunk/src/layout_util.h
    trunk/src/pixbuf-renderer.c
    trunk/src/pixbuf_util.c
    trunk/src/thumb.c
    trunk/src/ui_misc.c
    trunk/src/ui_tabcomp.c
    trunk/src/ui_tree_edit.c

Modified: trunk/src/collect-table.c
===================================================================
--- trunk/src/collect-table.c   2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/collect-table.c   2008-09-07 23:01:30 UTC (rev 1138)
@@ -1337,7 +1337,7 @@
 
                pb = gdk_pixbuf_new_from_xpm_data((const gchar **)marker_xpm);
                gdk_pixbuf_render_pixmap_and_mask(pb, &pixmap, &mask, 128);
-               gdk_pixbuf_unref(pb);
+               g_object_unref(pb);
 
                gdk_drawable_get_size(pixmap, &w, &h);
 

Modified: trunk/src/dupe.c
===================================================================
--- trunk/src/dupe.c    2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/dupe.c    2008-09-07 23:01:30 UTC (rev 1138)
@@ -1953,7 +1953,7 @@
                gtk_box_pack_start(GTK_BOX(gd->vbox), image, FALSE, FALSE, 0);
                gtk_widget_show(image);
 
-               gdk_pixbuf_unref(pixbuf);
+               g_object_unref(pixbuf);
                }
 
        gtk_widget_show(gd->dialog);

Modified: trunk/src/image-load.c
===================================================================
--- trunk/src/image-load.c      2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/image-load.c      2008-09-07 23:01:30 UTC (rev 1138)
@@ -172,7 +172,8 @@
                il->area_param_list = g_list_delete_link(il->area_param_list, 
il->area_param_list);
                }
 
-       if (il->pixbuf) gdk_pixbuf_unref(il->pixbuf);
+       if (il->pixbuf) g_object_unref(il->pixbuf);
+
        file_data_unref(il->fd);
 #ifdef HAVE_GTHREAD
        g_mutex_free(il->data_mutex);
@@ -317,9 +318,11 @@
                return;
                }
 
-       if (il->pixbuf) gdk_pixbuf_unref(il->pixbuf);
+       if (il->pixbuf) g_object_unref(il->pixbuf);
+
        il->pixbuf = pb;
-       if (il->pixbuf) gdk_pixbuf_ref(il->pixbuf);
+       if (il->pixbuf) g_object_ref(il->pixbuf);
+
        g_mutex_unlock(il->data_mutex);
 }
 

Modified: trunk/src/image.c
===================================================================
--- trunk/src/image.c   2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/image.c   2008-09-07 23:01:30 UTC (rev 1138)
@@ -540,7 +540,7 @@
 
        if (options->image.enable_read_ahead && imd->image_fd && 
!imd->image_fd->pixbuf && image_loader_get_pixbuf(imd->il))
                {
-               imd->image_fd->pixbuf = 
gdk_pixbuf_ref(image_loader_get_pixbuf(imd->il));
+               imd->image_fd->pixbuf = 
g_object_ref(image_loader_get_pixbuf(imd->il));
                image_cache_set(imd, imd->image_fd);
                }
 
@@ -1619,10 +1619,19 @@
        if (frame)
                {
                imd->frame = gtk_frame_new(NULL);
-               gtk_widget_ref(imd->pr);
+#if GTK_CHECK_VERSION(2,12,0)
+        g_object_ref(imd->pr);
+#else
+        gtk_widget_ref(imd->pr);
+#endif
                if (imd->has_frame != -1) 
gtk_container_remove(GTK_CONTAINER(imd->widget), imd->pr);
                gtk_container_add(GTK_CONTAINER(imd->frame), imd->pr);
-               gtk_widget_unref(imd->pr);
+
+#if GTK_CHECK_VERSION(2,12,0)
+        g_object_unref(imd->pr);
+#else
+        gtk_widget_unref(imd->pr);
+#endif
                g_signal_connect(G_OBJECT(imd->frame), "expose_event",
                                 G_CALLBACK(selectable_frame_expose_cb), NULL);
 
@@ -1641,7 +1650,11 @@
                }
        else
                {
+#if GTK_CHECK_VERSION(2,12,0)
+               g_object_ref(imd->pr);
+#else
                gtk_widget_ref(imd->pr);
+#endif
                if (imd->frame)
                        {
                        gtk_container_remove(GTK_CONTAINER(imd->frame), 
imd->pr);
@@ -1649,7 +1662,12 @@
                        imd->frame = NULL;
                        }
                gtk_box_pack_start_defaults(GTK_BOX(imd->widget), imd->pr);
-               gtk_widget_unref(imd->pr);
+
+#if GTK_CHECK_VERSION(2,12,0)
+       g_object_unref(imd->pr);
+#else
+       gtk_widget_unref(imd->pr);
+#endif
                }
 
        gtk_widget_show(imd->pr);

Modified: trunk/src/layout.c
===================================================================
--- trunk/src/layout.c  2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/layout.c  2008-09-07 23:01:30 UTC (rev 1138)
@@ -253,7 +253,11 @@
 static void layout_sort_menu_hide_cb(GtkWidget *widget, gpointer data)
 {
        /* destroy the menu */
+#if GTK_CHECK_VERSION(2,12,0)
+       g_object_unref(widget);
+#else
        gtk_widget_unref(GTK_WIDGET(widget));
+#endif
 }
 
 static void layout_sort_button_press_cb(GtkWidget *widget, gpointer data)
@@ -1985,7 +1989,7 @@
 
                pixbuf = pixbuf_inline(PIXBUF_INLINE_LOGO);
                image_change_pixbuf(lw->image, pixbuf, 1.0);
-               gdk_pixbuf_unref(pixbuf);
+               g_object_unref(pixbuf);
                }
 
        if (geometry)

Modified: trunk/src/layout_image.c
===================================================================
--- trunk/src/layout_image.c    2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/layout_image.c    2008-09-07 23:01:30 UTC (rev 1138)
@@ -1507,8 +1507,11 @@
                {
                lw->split_images[i] = image_new(TRUE);
 
+#if GTK_CHECK_VERSION(2,12,0)
+               g_object_ref(lw->split_images[i]->widget);
+#else
                gtk_widget_ref(lw->split_images[i]->widget);
-
+#endif
                image_background_set_color(lw->split_images[i], 
options->image.use_custom_border_color ? &options->image.border_color : NULL);
 
                image_auto_refresh_enable(lw->split_images[i], TRUE);
@@ -1599,7 +1602,11 @@
                {
                if (lw->split_images[i])
                        {
+#if GTK_CHECK_VERSION(2,12,0)
+                       g_object_unref(lw->split_images[i]->widget);
+#else
                        gtk_widget_unref(lw->split_images[i]->widget);
+#endif
                        lw->split_images[i] = NULL;
                        }
                }
@@ -1653,7 +1660,11 @@
                {
                if (lw->split_images[i])
                        {
+#if GTK_CHECK_VERSION(2,12,0)
+                       g_object_unref(lw->split_images[i]->widget);
+#else
                        gtk_widget_unref(lw->split_images[i]->widget);
+#endif
                        lw->split_images[i] = NULL;
                        }
                }
@@ -1729,7 +1740,11 @@
                {
                if (lw->split_images[i])
                        {
+#if GTK_CHECK_VERSION(2,12,0)
+                       g_object_unref(lw->split_images[i]->widget);
+#else
                        gtk_widget_unref(lw->split_images[i]->widget);
+#endif
                        lw->split_images[i] = NULL;
                        }
                }

Modified: trunk/src/layout_util.h
===================================================================
--- trunk/src/layout_util.h     2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/layout_util.h     2008-09-07 23:01:30 UTC (rev 1138)
@@ -34,9 +34,7 @@
 void layout_actions_add_window(LayoutWindow *lw, GtkWidget *window);
 GtkWidget *layout_actions_menu_bar(LayoutWindow *lw);
 
-GtkWidget *layout_button(GtkWidget *box, gchar **pixmap_data, const gchar 
*stock_id, gint toggle,
-                        GtkTooltips *tooltips, const gchar *tip_text,
-                        GtkSignalFunc func, gpointer data);
+
 GtkWidget *layout_button_bar(LayoutWindow *lw);
 
 void layout_keyboard_init(LayoutWindow *lw, GtkWidget *window);

Modified: trunk/src/pixbuf-renderer.c
===================================================================
--- trunk/src/pixbuf-renderer.c 2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/pixbuf-renderer.c 2008-09-07 23:01:30 UTC (rev 1138)
@@ -530,8 +530,9 @@
        pr_queue_clear(pr);
        pr_tile_free_all(pr);
 
+
        if (pr->pixbuf) g_object_unref(pr->pixbuf);
-       if (pr->spare_tile) gdk_pixbuf_unref(pr->spare_tile);
+       if (pr->spare_tile) g_object_unref(pr->spare_tile);
 
        pr_scroller_timer_set(pr, FALSE);
        pr_overlay_list_clear(pr);
@@ -1837,7 +1838,7 @@
 {
        if (!it) return;
 
-       if (it->pixbuf) gdk_pixbuf_unref(it->pixbuf);
+       if (it->pixbuf) g_object_unref(it->pixbuf);
        if (it->pixmap) g_object_unref(it->pixmap);
 
        g_free(it);

Modified: trunk/src/pixbuf_util.c
===================================================================
--- trunk/src/pixbuf_util.c     2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/pixbuf_util.c     2008-09-07 23:01:30 UTC (rev 1138)
@@ -330,7 +330,7 @@
                        }
                }
 
-       gdk_pixbuf_unref(buffer);
+       g_object_unref(buffer);
 
 #if 0
        /* this is the simple version of rotation (roughly 2-4x slower) */
@@ -472,7 +472,7 @@
                        dest = gdk_pixbuf_copy(pixbuf);
                        break;
                }
-       if (tmp) gdk_pixbuf_unref(tmp);
+       if (tmp) g_object_unref(tmp);
        return dest;
 
 }

Modified: trunk/src/thumb.c
===================================================================
--- trunk/src/thumb.c   2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/thumb.c   2008-09-07 23:01:30 UTC (rev 1138)
@@ -214,12 +214,13 @@
                        {
                        if (tl->fd->thumb_pixbuf) 
g_object_unref(tl->fd->thumb_pixbuf);
                        tl->fd->thumb_pixbuf = pixbuf;
-                       gdk_pixbuf_ref(tl->fd->thumb_pixbuf);
+
+                       g_object_ref(tl->fd->thumb_pixbuf);
                        }
                save = image_loader_get_shrunk(il);
                }
 
-       if (rotated) gdk_pixbuf_unref(rotated);
+       if (rotated) g_object_unref(rotated);
        
        /* save it ? */
        if (tl->cache_enable && save)
@@ -651,7 +652,7 @@
 
                        tmp = pixbuf;
                        pixbuf = gdk_pixbuf_scale_simple(tmp, width, height, 
GDK_INTERP_NEAREST);
-                       gdk_pixbuf_unref(tmp);
+                       g_object_unref(tmp);
                        }
 
                return pixbuf;

Modified: trunk/src/ui_misc.c
===================================================================
--- trunk/src/ui_misc.c 2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/ui_misc.c 2008-09-07 23:01:30 UTC (rev 1138)
@@ -718,6 +718,8 @@
        return spin;
 }
 
+#if ! GTK_CHECK_VERSION(2,12,0)
+
 static void pref_toolbar_destroy_cb(GtkWidget *widget, gpointer data)
 {
        GtkTooltips *tips = data;
@@ -725,11 +727,15 @@
        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);
 
@@ -739,23 +745,25 @@
                gtk_widget_show(tbar);
                }
 
+#if ! GTK_CHECK_VERSION(2,12,0)
        tips = gtk_tooltips_new();
 
        /* take ownership of tooltips */
-#ifdef GTK_OBJECT_FLOATING
+#  ifdef GTK_OBJECT_FLOATING
        /* GTK+ < 2.10 */
        g_object_ref(G_OBJECT(tips));
        gtk_object_sink(GTK_OBJECT(tips));
-#else
+#  else
        /* GTK+ >= 2.10 */
        g_object_ref_sink(G_OBJECT(tips));
-#endif
+#  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;
 }
@@ -799,11 +807,18 @@
 
        if (description)
                {
+
+#if GTK_CHECK_VERSION(2,12,0)
+
+               gtk_widget_set_tooltip_text(GTK_TOOL_ITEM(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;
 }

Modified: trunk/src/ui_tabcomp.c
===================================================================
--- trunk/src/ui_tabcomp.c      2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/ui_tabcomp.c      2008-09-07 23:01:30 UTC (rev 1138)
@@ -205,8 +205,11 @@
                /*close the menu */
                gtk_menu_popdown(GTK_MENU(widget));
                /* doing this does not emit the "selection done" signal, unref 
it ourselves */
+#if GTK_CHECK_VERSION(2,12,0)
+               g_object_unref(widget);
+#else
                gtk_widget_unref(widget);
-
+#endif
                return TRUE;
                }
 
@@ -634,7 +637,8 @@
 
        pixbuf = gdk_pixbuf_new_from_inline(-1, icon_tabcomp, FALSE, NULL);
        icon = gtk_image_new_from_pixbuf(pixbuf);
-       gdk_pixbuf_unref(pixbuf);
+       g_object_unref(pixbuf);
+
        gtk_container_add(GTK_CONTAINER(button), icon);
        gtk_widget_show(icon);
 

Modified: trunk/src/ui_tree_edit.c
===================================================================
--- trunk/src/ui_tree_edit.c    2008-09-07 19:42:19 UTC (rev 1137)
+++ trunk/src/ui_tree_edit.c    2008-09-07 23:01:30 UTC (rev 1138)
@@ -266,7 +266,11 @@
         * use x_offset instead for X scroll (sigh)
         */
        gtk_tree_view_get_cell_area(widget, tpath, tv_column, &rect);
+#if GTK_CHECK_VERSION(2,12,0)
+       gtk_tree_view_convert_bin_window_to_widget_coords(widget, 0, 0, 
&x_offset, &y_offset);
+#else
        gtk_tree_view_tree_to_widget_coords(widget, 0, 0, &x_offset, &y_offset);
+#endif
        gdk_window_get_origin(GTK_WIDGET(widget)->window, &x_origin, &y_origin);
 
        if (gtk_tree_view_get_headers_visible(widget))
@@ -358,7 +362,12 @@
        gtk_tree_view_get_cell_area(widget, tpath, NULL, &crect);
        gtk_tree_path_free(tpath);
 
+
+#if GTK_CHECK_VERSION(2,12,0)
+       gtk_tree_view_convert_bin_window_to_widget_coords(widget, crect.x, 
crect.y, &cx, &cy);
+#else
        gtk_tree_view_widget_to_tree_coords(widget, crect.x, crect.y, &cx, &cy);
+#endif
 
        if (fully_visible)
                {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to