]> spindle.queued.net Git - midori/commitdiff
Update uses of deprecated GTK+ macros and API
authorChristian Dywan <christian@twotoasts.de>
Fri, 2 Apr 2010 16:54:29 +0000 (18:54 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 2 Apr 2010 16:54:29 +0000 (18:54 +0200)
midori/midori-browser.c
midori/midori-view.c
midori/sokoke.c
midori/sokoke.h

index a72916c3405e1406068a892b80bff92d1d82beb2..19eefe9ef53cd225d2f6a21fea00c990bb9e5b17 100644 (file)
@@ -5658,7 +5658,7 @@ midori_browser_size_allocate_cb (MidoriBrowser* browser,
 {
     GtkWidget* widget = GTK_WIDGET (browser);
 
-    if (GTK_WIDGET_REALIZED (widget) && !browser->alloc_timeout)
+    if (gtk_widget_get_realized (widget) && !browser->alloc_timeout)
     {
         gpointer last_page;
 
@@ -6681,7 +6681,8 @@ midori_browser_toolbar_item_button_press_event_cb (GtkWidget*      toolitem,
     if (event->button == 2)
     {
         GtkWidget* parent = gtk_widget_get_parent (toolitem);
-        GtkAction* action = gtk_widget_get_action (parent);
+        GtkAction* action = gtk_activatable_get_related_action (
+            GTK_ACTIVATABLE (parent));
 
         return midori_browser_menu_middle_click_on_navigation_action (browser, action);
     }
index 7a90c4dce0348532288e3f52c3f65e61cca3b3d2..6c8fd0d314666bfb5bf67ab420f2e5cf5a4f0088 100644 (file)
@@ -2340,7 +2340,7 @@ midori_view_populate_popup (MidoriView* view,
         menuitem = sokoke_action_create_popup_menu_item (
                 gtk_action_group_get_action (actions, "Encoding"));
         gtk_menu_shell_append (menu_shell, menuitem);
-        if (GTK_WIDGET_IS_SENSITIVE (menuitem))
+        if (gtk_widget_get_sensitive (menuitem))
         {
             GtkWidget* sub_menu;
             static const GtkActionEntry encodings[] = {
index 8bcafe6bba137a52ea9ab2695c0d663b8a102f5e..2eeb6684054a0eabcfcf9e1d7795421d4fcdcc61 100644 (file)
@@ -859,7 +859,8 @@ sokoke_get_desktop (void)
         GdkDisplay* display = gdk_display_get_default ();
         Display* xdisplay = GDK_DISPLAY_XDISPLAY (display);
         Window root_window = RootWindow (xdisplay, 0);
-        Atom save_mode_atom = gdk_x11_get_xatom_by_name ("_DT_SAVE_MODE");
+        Atom save_mode_atom = gdk_x11_get_xatom_by_name_for_display (
+            display, "_DT_SAVE_MODE");
         Atom actual_type;
         int actual_format;
         unsigned long n_items, bytes;
@@ -1016,7 +1017,7 @@ sokoke_entry_set_default_text (GtkEntry*    entry,
                                             PANGO_STYLE_ITALIC);
         gtk_entry_set_text (entry, default_text);
     }
-    else if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry)))
+    else if (!gtk_widget_has_focus (GTK_WIDGET (entry)))
     {
         gint has_default = GPOINTER_TO_INT (
             g_object_get_data (G_OBJECT (entry), "sokoke_has_default"));
index fbd9e38c15633bf8a74620f67f955bf2930f2ce6..8ad6a8d07d50a46ea36aee3041e6827b183ba8ac 100644 (file)
     #define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL (widget)
     #define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS (widget)
     #define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE (widget)
+    #define gtk_widget_get_sensitive(widget) GTK_WIDGET_IS_SENSITIVE (widget)
+#endif
+
+#if !GTK_CHECK_VERSION (2, 20, 0)
+    #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED (widget)
 #endif
 
 #if !GTK_CHECK_VERSION(2, 12, 0)