[Xfce4-commits] [apps/ristretto] 01/02: Prepare for gtk3 migration: Do not use GTK_WIDGET_* macros

noreply at xfce.org noreply at xfce.org
Tue Sep 13 16:03:49 CEST 2016


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

f2404 pushed a commit to branch master
in repository apps/ristretto.

commit 5c3fabe6d4707dfb273dfdc50e2b084188bcb178
Author: Igor <f2404 at yandex.ru>
Date:   Tue Sep 13 17:01:21 2016 +0300

    Prepare for gtk3 migration: Do not use GTK_WIDGET_* macros
---
 src/image_viewer.c    |  6 +++---
 src/main_window.c     |  8 ++++----
 src/monitor_chooser.c | 18 +++++++++---------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/image_viewer.c b/src/image_viewer.c
index 82f8ead..fb47f8b 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -499,7 +499,7 @@ rstto_image_viewer_realize(GtkWidget *widget)
     g_return_if_fail (widget != NULL);
     g_return_if_fail (RSTTO_IS_IMAGE_VIEWER(widget));
 
-    GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+    gtk_widget_set_realized (widget, TRUE);
 
     g_value_init (&val_bg_color, GDK_TYPE_COLOR);
     g_value_init (&val_bg_color_fs, GDK_TYPE_COLOR);
@@ -595,7 +595,7 @@ rstto_image_viewer_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
     gint border_width = 0;
 
     gtk_widget_set_allocation (widget, allocation);
-    if (GTK_WIDGET_REALIZED (widget))
+    if (gtk_widget_get_realized (widget))
     {
         gdk_window_move_resize (gtk_widget_get_window (widget),
                 allocation->x + border_width,
@@ -1503,7 +1503,7 @@ rstto_image_viewer_paint (GtkWidget *widget, cairo_t *ctx)
     RsttoImageViewer *viewer = RSTTO_IMAGE_VIEWER (widget);
     GtkAllocation allocation;
     
-    if (GTK_WIDGET_REALIZED (widget))
+    if (gtk_widget_get_realized (widget))
     {
         gtk_widget_get_allocation (widget, &allocation);
         correct_adjustments (viewer);
diff --git a/src/main_window.c b/src/main_window.c
index 08dd18e..86a7be2 100644
--- a/src/main_window.c
+++ b/src/main_window.c
@@ -1563,7 +1563,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
     switch (rstto_image_list_get_n_images (window->priv->image_list))
     {
         case 0: 
-            if ( GTK_WIDGET_VISIBLE (window) )
+            if ( gtk_widget_get_visible (GTK_WIDGET (window)) )
             {
                 if ( 0 != (gdk_window_get_state (GTK_WIDGET (window)->window) & GDK_WINDOW_STATE_FULLSCREEN ))
                 {
@@ -1866,7 +1866,7 @@ rstto_main_window_update_buttons (RsttoMainWindow *window)
                 FALSE);
     }
 
-    if ( GTK_WIDGET_VISIBLE (window) )
+    if (gtk_widget_get_visible (GTK_WIDGET (window)) )
     {
         gtk_ui_manager_remove_ui (
             window->priv->ui_manager,
@@ -1907,7 +1907,7 @@ rstto_window_save_geometry_timer (gpointer user_data)
     gint width = 0;
     gint height = 0;
     /* check if the window is still visible */
-    if (GTK_WIDGET_VISIBLE (window))
+    if (gtk_widget_get_visible (GTK_WIDGET (window)))
     {
         /* determine the current state of the window */
         gint state = gdk_window_get_state (GTK_WIDGET (window)->window);
@@ -2705,7 +2705,7 @@ cb_rstto_main_window_configure_event (GtkWidget *widget, GdkEventConfigure *even
         window->priv->window_save_geometry_timer_id = 0;
 
         /* check if we should schedule another save timer */
-        if (GTK_WIDGET_VISIBLE (widget))
+        if (gtk_widget_get_visible (GTK_WIDGET (window)))
         {
             /* save the geometry one second after the last configure event */
             window->priv->window_save_geometry_timer_id = g_timeout_add (
diff --git a/src/monitor_chooser.c b/src/monitor_chooser.c
index 43754cd..d5be3b4 100644
--- a/src/monitor_chooser.c
+++ b/src/monitor_chooser.c
@@ -188,7 +188,7 @@ rstto_monitor_chooser_realize(GtkWidget *widget)
     g_return_if_fail (widget != NULL);
     g_return_if_fail (RSTTO_IS_MONITOR_CHOOSER (widget));
 
-    GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+    gtk_widget_set_realized (widget, TRUE);
 
     gtk_widget_get_allocation (widget, &allocation);
 
@@ -225,13 +225,13 @@ static void
 rstto_monitor_chooser_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
 {
     gtk_widget_set_allocation (widget, allocation);
-    if (GTK_WIDGET_REALIZED (widget))
+    if (gtk_widget_get_realized (widget))
     {
         gdk_window_move_resize (gtk_widget_get_window (widget),
-            allocation->x,
-            allocation->y,
-            allocation->width,
-            allocation->height);
+                allocation->x,
+                allocation->y,
+                allocation->width,
+                allocation->height);
     }
 }
 
@@ -706,16 +706,16 @@ rstto_monitor_chooser_set_image_surface (
     {
         if (monitor->image_surface)
         {
-            cairo_surface_destroy(monitor->image_surface);
+            cairo_surface_destroy (monitor->image_surface);
         }
 
         monitor->image_surface = surface;
 
         retval = monitor_id;
     }
-    if (GTK_WIDGET_REALIZED (GTK_WIDGET(chooser)))
+    if (gtk_widget_get_realized (GTK_WIDGET (chooser)))
     {
-        rstto_monitor_chooser_paint (GTK_WIDGET(chooser));
+        rstto_monitor_chooser_paint (GTK_WIDGET (chooser));
     }
 
     return retval;

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


More information about the Xfce4-commits mailing list