[gtk+/refactor: 2/16] gail: use accessor functions to access GtkToggleButton



commit 9ed9bfc9c8452ef32a2479f04e0a733b6a5011e9
Author: Javier Jardón <jjardon gnome org>
Date:   Tue Oct 19 18:46:07 2010 +0200

    gail: use accessor functions to access GtkToggleButton
    
    Also, we can access button->in_button directly now.
    Commented some code until some gail expert can fix this.

 modules/other/gail/gailbutton.c       |    8 ++++++++
 modules/other/gail/gailtogglebutton.c |    2 +-
 modules/other/gail/tests/testlib.c    |    2 +-
 modules/other/gail/tests/testtable.c  |    8 ++++----
 4 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/modules/other/gail/gailbutton.c b/modules/other/gail/gailbutton.c
index 8e0fee4..8a18726 100644
--- a/modules/other/gail/gailbutton.c
+++ b/modules/other/gail/gailbutton.c
@@ -539,7 +539,9 @@ idle_do_action (gpointer data)
 	case 0:
 	  /* first a press */ 
 
+          /* FIXME: Do not access public member
 	  button->in_button = TRUE;
+          */
 	  g_signal_emit_by_name (button, "enter");
 	  /*
 	   * Simulate a button press event. calling gtk_button_pressed() does
@@ -557,11 +559,15 @@ idle_do_action (gpointer data)
 	  /* then a release */
 	  tmp_event.button.type = GDK_BUTTON_RELEASE;
 	  gtk_widget_event (widget, &tmp_event);
+          /* FIXME: Do not access public member
 	  button->in_button = FALSE;
+          */
 	  g_signal_emit_by_name (button, "leave");
 	  break;
 	case 1:
+          /* FIXME: Do not access public member
 	  button->in_button = TRUE;
+          */
 	  g_signal_emit_by_name (button, "enter");
 	  /*
 	   * Simulate a button press event. calling gtk_button_pressed() does
@@ -577,7 +583,9 @@ idle_do_action (gpointer data)
 	  gtk_widget_event (widget, &tmp_event);
 	  break;
 	case 2:
+          /* FIXME: Do not access public member
 	  button->in_button = FALSE;
+          */
 	  g_signal_emit_by_name (button, "leave");
 	  break;
 	default:
diff --git a/modules/other/gail/gailtogglebutton.c b/modules/other/gail/gailtogglebutton.c
index b984d28..63f8d44 100644
--- a/modules/other/gail/gailtogglebutton.c
+++ b/modules/other/gail/gailtogglebutton.c
@@ -84,7 +84,7 @@ gail_toggle_button_toggled_gtk (GtkWidget       *widget)
 
   accessible = gtk_widget_get_accessible (widget);
   atk_object_notify_state_change (accessible, ATK_STATE_CHECKED, 
-                                  toggle_button->active);
+                                  gtk_toggle_button_get_active (toggle_button));
 } 
 
 static AtkStateSet*
diff --git a/modules/other/gail/tests/testlib.c b/modules/other/gail/tests/testlib.c
index 3e254af..8323e29 100644
--- a/modules/other/gail/tests/testlib.c
+++ b/modules/other/gail/tests/testlib.c
@@ -713,7 +713,7 @@ gchar **tests_set(gint window, int *count)
   for (i = 0; i < testcount[window]; i++)
     {
       nullparam = FALSE;
-      if (GTK_TOGGLE_BUTTON(listoftests[window][i].toggleButton)->active)
+      if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (listoftests[window][i].toggleButton)))
         {
           num = listoftests[window][i].numParameters;
           for (j = 0; j < num; j++)
diff --git a/modules/other/gail/tests/testtable.c b/modules/other/gail/tests/testtable.c
index e11b403..e1a65d2 100644
--- a/modules/other/gail/tests/testtable.c
+++ b/modules/other/gail/tests/testtable.c
@@ -73,11 +73,11 @@ static void choicecb (GtkWidget *widget, gpointer data)
   AtkObject **ptr_to_obj = (AtkObject **)data;
   AtkObject *obj = *ptr_to_obj;
 
-  if (GTK_TOGGLE_BUTTON(tc->tb_others)->active)
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tc->tb_others)))
   {
     other_runtest(obj);
   }
-  else if (GTK_TOGGLE_BUTTON(tc->tb_ref_selection)->active)
+  else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tc->tb_ref_selection)))
   {
     const gchar *indexstr;
     gint index;
@@ -87,7 +87,7 @@ static void choicecb (GtkWidget *widget, gpointer data)
 
     ref_selection_runtest(obj, index); 
   }
-  else if (GTK_TOGGLE_BUTTON(tc->tb_ref_at)->active)
+  else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tc->tb_ref_at)))
   {
     const gchar *rowstr, *colstr;
     gint row, col;
@@ -99,7 +99,7 @@ static void choicecb (GtkWidget *widget, gpointer data)
  
     ref_at_runtest(obj, row, col);
   }
-  else if (GTK_TOGGLE_BUTTON(tc->tb_ref_accessible_child)->active)
+  else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (tc->tb_ref_accessible_child)))
   {
     const gchar *childstr;
     gint childno;



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