[Xfce4-commits] [xfce/xfwm4] 14/32: Remove usage of deprecated macroses and private fields

noreply at xfce.org noreply at xfce.org
Tue Dec 5 09:22:00 CET 2017


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit c225a438c82f97d8992c21d3260da6a9274c65a6
Author: Viktor Odintsev <zakhams at gmail.com>
Date:   Sun Jul 2 21:26:41 2017 +0300

    Remove usage of deprecated macroses and private fields
---
 src/client.c       |  4 +---
 src/event_filter.c |  4 ++--
 src/events.c       | 22 +++++++++++-----------
 src/menu.c         | 10 +++++-----
 src/netwm.c        |  3 +--
 src/screen.c       | 10 +++++-----
 src/tabwin.c       | 17 +++++++++++------
 src/ui_style.c     |  8 ++++----
 src/xsync.c        |  3 +--
 9 files changed, 41 insertions(+), 40 deletions(-)

diff --git a/src/client.c b/src/client.c
index 464e987..54c14b6 100644
--- a/src/client.c
+++ b/src/client.c
@@ -435,8 +435,7 @@ clientUpdateUrgency (Client *c)
             c->blink_timeout_id =
                 g_timeout_add_full (G_PRIORITY_DEFAULT,
                                     CLIENT_BLINK_TIMEOUT,
-                                    (GtkFunction) urgent_cb,
-                                    (gpointer) c, NULL);
+                                    urgent_cb, c, NULL);
         }
     }
     if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_SEEN_ACTIVE)
@@ -975,7 +974,6 @@ clientApplyMWMHints (Client *c, gboolean update)
 {
     ScreenInfo *screen_info;
     DisplayInfo *display_info;
-    PropMwmHints *mwm_hints;
     XWindowChanges wc;
 
     g_return_if_fail (c != NULL);
diff --git a/src/event_filter.c b/src/event_filter.c
index 918483e..c0f5edd 100644
--- a/src/event_filter.c
+++ b/src/event_filter.c
@@ -212,8 +212,8 @@ eventFilterAddWin (GdkScreen *gscr, long event_mask)
     g_return_val_if_fail (GDK_IS_SCREEN (gscr), NULL);
 
     event_win = gdk_screen_get_root_window (gscr);
-    xroot = (Window) GDK_DRAWABLE_XID(event_win);
-    dpy = GDK_DRAWABLE_XDISPLAY(event_win);
+    xroot = gdk_x11_window_get_xid (event_win);
+    dpy = gdk_x11_display_get_xdisplay (gdk_window_get_display (event_win));
 
     gdk_error_trap_push ();
     gdk_x11_grab_server ();
diff --git a/src/events.c b/src/events.c
index 0c7e3ae..c7a8ceb 100644
--- a/src/events.c
+++ b/src/events.c
@@ -811,10 +811,10 @@ titleButton (Client * c, guint state, XButtonEvent * ev)
             ev->window = ev->root;
             if (screen_info->button_handler_id)
             {
-                g_signal_handler_disconnect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
+                g_signal_handler_disconnect (G_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
             }
-            screen_info->button_handler_id = g_signal_connect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)),
-                                                      "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) c);
+            screen_info->button_handler_id = g_signal_connect (G_OBJECT (myScreenGetGtkWidget (screen_info)),
+                                                      "button_press_event", G_CALLBACK (show_popup_cb), (gpointer) c);
             /* Let GTK handle this for us. */
         }
     }
@@ -1001,10 +1001,10 @@ handleButtonPress (DisplayInfo *display_info, XButtonEvent * ev)
                     ev->window = ev->root;
                     if (screen_info->button_handler_id)
                     {
-                        g_signal_handler_disconnect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
+                        g_signal_handler_disconnect (G_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
                     }
-                    screen_info->button_handler_id = g_signal_connect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)),
-                                                              "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) c);
+                    screen_info->button_handler_id = g_signal_connect (G_OBJECT (myScreenGetGtkWidget (screen_info)),
+                                                              "button_press_event", G_CALLBACK (show_popup_cb), (gpointer) c);
                     /* Let GTK handle this for us. */
                 }
             }
@@ -2591,10 +2591,10 @@ show_window_menu (Client *c, gint px, gint py, guint button, guint32 timestamp)
 
     if (screen_info->button_handler_id)
     {
-        g_signal_handler_disconnect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
+        g_signal_handler_disconnect (G_OBJECT (myScreenGetGtkWidget (screen_info)), screen_info->button_handler_id);
     }
-    screen_info->button_handler_id = g_signal_connect (GTK_OBJECT (myScreenGetGtkWidget (screen_info)),
-                                              "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) NULL);
+    screen_info->button_handler_id = g_signal_connect (G_OBJECT (myScreenGetGtkWidget (screen_info)),
+                                              "button_press_event", G_CALLBACK (show_popup_cb), (gpointer) NULL);
 
     if (!xfwmWindowDeleted(&menu_event_window))
     {
@@ -2860,9 +2860,9 @@ initPerScreenCallbacks (ScreenInfo *screen_info)
 
     screen_info->button_handler_id =
         g_signal_connect (G_OBJECT (myScreenGetGtkWidget (screen_info)),
-                          "button_press_event", GTK_SIGNAL_FUNC (show_popup_cb), (gpointer) NULL);
+                          "button_press_event", G_CALLBACK (show_popup_cb), (gpointer) NULL);
     g_signal_connect (G_OBJECT (myScreenGetGtkWidget (screen_info)), "client_event",
-                      GTK_SIGNAL_FUNC (client_event_cb), NULL);
+                      G_CALLBACK (client_event_cb), NULL);
     g_object_connect (G_OBJECT(screen_info->gscr),
                       "signal::size-changed",
                       G_CALLBACK(size_changed_cb), (gpointer) (screen_info),
diff --git a/src/menu.c b/src/menu.c
index e8869ee..04f20b4 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -286,7 +286,7 @@ menu_default (GdkScreen *gscr, Window xid, MenuOp ops, MenuOp insensitive, MenuF
                     }
                     ws_menu = menu_workspace (menu, insensitive, ws, nws, wsn, wsn_items);
                     gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), ws_menu);
-                    g_signal_connect (GTK_OBJECT (ws_menu), "selection-done", GTK_SIGNAL_FUNC (menu_closed), menu);
+                    g_signal_connect (G_OBJECT (ws_menu), "selection-done", G_CALLBACK (menu_closed), menu);
                     break;
                 default:
                     if (menuitems[i].image_name)
@@ -318,7 +318,7 @@ menu_default (GdkScreen *gscr, Window xid, MenuOp ops, MenuOp insensitive, MenuF
         }
         ++i;
     }
-    g_signal_connect (GTK_OBJECT (menu->menu), "selection-done", GTK_SIGNAL_FUNC (menu_closed), menu);
+    g_signal_connect (G_OBJECT (menu->menu), "selection-done", G_CALLBACK (menu_closed), menu);
 
     return (menu);
 }
@@ -340,8 +340,8 @@ menu_item_connect (GtkWidget * item, MenuData * item_data)
     TRACE ("entering menu_item_connect");
     g_return_val_if_fail (item != NULL, NULL);
     g_return_val_if_fail (GTK_IS_MENU_ITEM (item), NULL);
-    g_signal_connect_closure (GTK_OBJECT (item), "activate",
-        g_cclosure_new (GTK_SIGNAL_FUNC (activate_cb), item_data,
+    g_signal_connect_closure (G_OBJECT (item), "activate",
+        g_cclosure_new (G_CALLBACK (activate_cb), item_data,
             (GClosureNotify) closure_notify), FALSE);
     return (item);
 }
@@ -360,7 +360,7 @@ menu_check_and_close (void)
     if (menu_open)
     {
         TRACE ("menu open, emitting deactivate signal");
-        g_signal_emit_by_name (GTK_OBJECT (menu_open), "deactivate");
+        g_signal_emit_by_name (G_OBJECT (menu_open), "deactivate");
         menu_open = NULL;
         return (TRUE);
     }
diff --git a/src/netwm.c b/src/netwm.c
index 7f48bea..12a220e 100644
--- a/src/netwm.c
+++ b/src/netwm.c
@@ -1517,8 +1517,7 @@ clientSendNetWMPing (Client *c, guint32 timestamp)
     c->ping_timeout_id =
         g_timeout_add_full (G_PRIORITY_DEFAULT,
                             CLIENT_PING_TIMEOUT,
-                            (GtkFunction) ping_timeout_cb,
-                            (gpointer) c, NULL);
+                            ping_timeout_cb, c, NULL);
     return (TRUE);
 }
 
diff --git a/src/screen.c b/src/screen.c
index 609ca94..74342f2 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -203,15 +203,15 @@ myScreenInit (DisplayInfo *display_info, GdkScreen *gscr, unsigned long event_ma
     g_object_unref (G_OBJECT (layout));
 
     screen_info->xscreen = gdk_x11_screen_get_xscreen (gscr);
-    screen_info->xroot = (Window) GDK_DRAWABLE_XID(gdk_screen_get_root_window (gscr));
-    screen_info->screen = gdk_screen_get_number (gscr);
-    screen_info->cmap = GDK_COLORMAP_XCOLORMAP(gdk_screen_get_system_colormap (gscr));
+    screen_info->xroot = gdk_x11_window_get_xid (gdk_screen_get_root_window (gscr));
+    screen_info->screen = gdk_x11_screen_get_screen_number (gscr);
+    screen_info->cmap = DefaultColormapOfScreen (screen_info->xscreen);
     screen_info->depth = DefaultDepth (display_info->dpy, screen_info->screen);
     screen_info->visual = DefaultVisual (display_info->dpy, screen_info->screen);
     screen_info->shape_win = (Window) None;
     myScreenComputeSize (screen_info);
 
-    screen_info->xfwm4_win = GDK_WINDOW_XWINDOW (screen_info->gtk_win->window);
+    screen_info->xfwm4_win = gdk_x11_window_get_xid (gtk_widget_get_window (screen_info->gtk_win));
     if (!myScreenSetWMAtom (screen_info, replace_wm))
     {
         gtk_widget_destroy (screen_info->gtk_win);
@@ -431,7 +431,7 @@ myScreenGetGdkWindow (ScreenInfo *screen_info)
     g_return_val_if_fail (screen_info, NULL);
     TRACE ("entering myScreenGetGdkWindow");
 
-    return screen_info->gtk_win->window;
+    return gtk_widget_get_window (screen_info->gtk_win);
 }
 
 gboolean
diff --git a/src/tabwin.c b/src/tabwin.c
index 83c3b8b..d2bccf2 100644
--- a/src/tabwin.c
+++ b/src/tabwin.c
@@ -110,7 +110,7 @@ get_color (GtkWidget *win, GtkStateType state_type)
 
     g_return_val_if_fail (win != NULL, NULL);
     g_return_val_if_fail (GTK_IS_WIDGET (win), NULL);
-    g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL);
+    g_return_val_if_fail (gtk_widget_get_realized (win), NULL);
 
     style = gtk_rc_get_style (win);
     if (!style)
@@ -137,11 +137,16 @@ tabwin_expose (GtkWidget *tabwin_widget, GdkEventExpose *event, gpointer data)
     gdouble alpha = WIN_ALPHA;
     gint border_radius = WIN_BORDER_RADIUS;
     gdouble degrees = G_PI / 180.0;
-    gdouble width = tabwin_widget->allocation.width;
-    gdouble height = tabwin_widget->allocation.height;
+    GtkAllocation allocation;
+    gdouble width;
+    gdouble height;
+
+    gtk_widget_get_allocation (tabwin_widget, &allocation);
+    width = allocation.width;
+    height = allocation.height;
 
     screen = gtk_widget_get_screen (GTK_WIDGET(tabwin_widget));
-    cr = gdk_cairo_create (tabwin_widget->window);
+    cr = gdk_cairo_create (gtk_widget_get_window (tabwin_widget));
     if (G_UNLIKELY (cr == NULL))
       return FALSE;
 
@@ -869,11 +874,11 @@ tabwinCreateWidget (Tabwin *tabwin, ScreenInfo *screen_info, gint monitor_num)
     gtk_box_pack_start (GTK_BOX (vbox), windowlist, TRUE, TRUE, 0);
 
     g_signal_connect_swapped (tabwin_widget, "configure-event",
-                              GTK_SIGNAL_FUNC (tabwinConfigure),
+                              G_CALLBACK (tabwinConfigure),
                               (gpointer) tabwin_widget);
 
     g_signal_connect (tabwin_widget, "expose-event",
-                      GTK_SIGNAL_FUNC (tabwin_expose),
+                      G_CALLBACK (tabwin_expose),
                       (gpointer) tabwin_widget);
 
     gtk_widget_show_all (GTK_WIDGET (tabwin_widget));
diff --git a/src/ui_style.c b/src/ui_style.c
index 6c61756..e38da9d 100644
--- a/src/ui_style.c
+++ b/src/ui_style.c
@@ -167,7 +167,7 @@ getUIStyle (GtkWidget * win, const gchar * name, const gchar * state)
 
     g_return_val_if_fail (win != NULL, NULL);
     g_return_val_if_fail (GTK_IS_WIDGET (win), NULL);
-    g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL);
+    g_return_val_if_fail (gtk_widget_get_realized (win), NULL);
 
     style = gtk_rc_get_style (win);
     if (!style)
@@ -231,7 +231,7 @@ getUIStyle_gc (GtkWidget * win, const gchar * name, const gchar * state)
 
     g_return_val_if_fail (win != NULL, NULL);
     g_return_val_if_fail (GTK_IS_WIDGET (win), NULL);
-    g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL);
+    g_return_val_if_fail (gtk_widget_get_realized (win), NULL);
 
     style = gtk_rc_get_style (win);
     if (!style)
@@ -252,7 +252,7 @@ getUIPangoFontDesc (GtkWidget * win)
 
     g_return_val_if_fail (win != NULL, NULL);
     g_return_val_if_fail (GTK_IS_WIDGET (win), NULL);
-    g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL);
+    g_return_val_if_fail (gtk_widget_get_realized (win), NULL);
 
     return (win->style->font_desc);
 }
@@ -264,7 +264,7 @@ getUIPangoContext (GtkWidget * win)
 
     g_return_val_if_fail (win != NULL, NULL);
     g_return_val_if_fail (GTK_IS_WIDGET (win), NULL);
-    g_return_val_if_fail (GTK_WIDGET_REALIZED (win), NULL);
+    g_return_val_if_fail (gtk_widget_get_realized (win), NULL);
 
     return (gtk_widget_get_pango_context (win));
 }
diff --git a/src/xsync.c b/src/xsync.c
index 55f69c4..d7ca1ef 100644
--- a/src/xsync.c
+++ b/src/xsync.c
@@ -206,8 +206,7 @@ clientXSyncResetTimeout (Client * c)
     clientXSyncClearTimeout (c);
     c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
                                               CLIENT_XSYNC_TIMEOUT,
-                                              (GtkFunction) clientXSyncTimeout,
-                                              (gpointer) c, NULL);
+                                              clientXSyncTimeout, c, NULL);
 }
 
 void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list