[gtk+/refactor: 99/106] Add _gtk_spin_button_get_panel private function



commit cbbffa18f848d1b741ab5f69c53ae77343a9ebb6
Author: Javier Jardón <jjardon gnome org>
Date:   Tue Jul 13 00:11:39 2010 +0200

    Add _gtk_spin_button_get_panel private function
    
    It's needed in gtktestutils.c

 gtk/gtkspinbutton.c |    6 ++++++
 gtk/gtkspinbutton.h |    3 +++
 gtk/gtktestutils.c  |   13 +++++++++----
 3 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 6b2eaf0..727fa59 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -2428,3 +2428,9 @@ gtk_spin_button_update (GtkSpinButton *spin_button)
   else
     gtk_spin_button_set_value (spin_button, val);
 }
+
+GdkWindow *
+_gtk_spin_button_get_panel (GtkSpinButton *spin_button)
+{
+  return spin_button->priv->panel;
+}
diff --git a/gtk/gtkspinbutton.h b/gtk/gtkspinbutton.h
index 957682f..ba38984 100644
--- a/gtk/gtkspinbutton.h
+++ b/gtk/gtkspinbutton.h
@@ -169,6 +169,9 @@ void		gtk_spin_button_set_snap_to_ticks  (GtkSpinButton  *spin_button,
 gboolean        gtk_spin_button_get_snap_to_ticks  (GtkSpinButton  *spin_button);
 void            gtk_spin_button_update             (GtkSpinButton  *spin_button);
 
+/* private */
+GdkWindow*      _gtk_spin_button_get_panel         (GtkSpinButton  *spin_button);
+
 G_END_DECLS
 
 #endif /* __GTK_SPIN_BUTTON_H__ */
diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c
index e84d487..3a76d6b 100644
--- a/gtk/gtktestutils.c
+++ b/gtk/gtktestutils.c
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include <gtk/gtk.h>
+#include "gtkspinbutton.h"
 
 #include <locale.h>
 #include <string.h>
@@ -189,14 +190,18 @@ gtk_test_spin_button_click (GtkSpinButton  *spinner,
                             guint           button,
                             gboolean        upwards)
 {
+  GdkWindow *panel;
   gboolean b1res = FALSE, b2res = FALSE;
-  if (spinner->panel)
+
+  panel = _gtk_spin_button_get_panel (spinner);
+
+  if (panel)
     {
       gint width, height, pos;
-      gdk_drawable_get_size (spinner->panel, &width, &height);
+      gdk_drawable_get_size (panel, &width, &height);
       pos = upwards ? 0 : height - 1;
-      b1res = gdk_test_simulate_button (spinner->panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
-      b2res = gdk_test_simulate_button (spinner->panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
+      b1res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS);
+      b2res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE);
     }
   return b1res && b2res;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]