]> Pileus Git - ~andy/gtk/blobdiff - modules/other/gail/gailexpander.c
Deprecate widget flag: GTK_WIDGET_MAPPED
[~andy/gtk] / modules / other / gail / gailexpander.c
index 006e95f87a658f7960569438c7f9152982705dde..1d46819469a9b35c42c933187c4ceda71a6bbcfc 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
@@ -45,6 +45,7 @@ static void                  gail_expander_real_initialize  (AtkObject         *
 static void                  gail_expander_finalize         (GObject           *object);
 static void                  gail_expander_init_textutil    (GailExpander      *expander,
                                                              GtkExpander       *widget);
+static G_CONST_RETURN gchar* gail_expander_get_full_text    (GtkExpander       *widget);
 
 static void                  atk_action_interface_init  (AtkActionIface *iface);
 static gboolean              gail_expander_do_action    (AtkAction      *action,
@@ -144,22 +145,6 @@ gail_expander_init (GailExpander *expander)
   expander->textutil = NULL;
 }
 
-AtkObject* 
-gail_expander_new (GtkWidget *widget)
-{
-  GObject *object;
-  AtkObject *accessible;
-
-  g_return_val_if_fail (GTK_IS_EXPANDER (widget), NULL);
-
-  object = g_object_new (GAIL_TYPE_EXPANDER, NULL);
-
-  accessible = ATK_OBJECT (object);
-  atk_object_initialize (accessible, widget);
-
-  return accessible;
-}
-
 static G_CONST_RETURN gchar*
 gail_expander_get_name (AtkObject *obj)
 {
@@ -185,7 +170,7 @@ gail_expander_get_name (AtkObject *obj)
 
       g_return_val_if_fail (GTK_IS_EXPANDER (widget), NULL);
 
-      return gtk_expander_get_label (GTK_EXPANDER (widget)); 
+      return gail_expander_get_full_text (GTK_EXPANDER (widget));
     }
 }
 
@@ -272,7 +257,7 @@ gail_expander_real_initialize (AtkObject *obj,
   ATK_OBJECT_CLASS (gail_expander_parent_class)->initialize (obj, data);
 
   expander = GTK_WIDGET (data);
-  if (GTK_WIDGET_MAPPED (expander))
+  if (gtk_widget_get_mapped (expander))
     gail_expander_init_textutil (gail_expander, GTK_EXPANDER (expander));
   else 
     g_signal_connect (expander,
@@ -309,7 +294,7 @@ gail_expander_real_notify_gtk (GObject    *obj,
       const gchar* label_text;
 
 
-      label_text = gtk_expander_get_label (expander);
+      label_text = gail_expander_get_full_text (expander);
 
       gail_expander = GAIL_EXPANDER (atk_obj);
       if (gail_expander->textutil)
@@ -339,6 +324,19 @@ gail_expander_real_notify_gtk (GObject    *obj,
     GAIL_WIDGET_CLASS (gail_expander_parent_class)->notify_gtk (obj, pspec);
 }
 
+static G_CONST_RETURN gchar*
+gail_expander_get_full_text (GtkExpander *widget)
+{
+  GtkWidget *label_widget;
+
+  label_widget = gtk_expander_get_label_widget (widget);
+
+  if (!GTK_IS_LABEL (label_widget))
+    return NULL;
+
+  return gtk_label_get_text (GTK_LABEL (label_widget));
+}
+
 static void
 gail_expander_init_textutil (GailExpander *expander,
                              GtkExpander  *widget)
@@ -346,7 +344,7 @@ gail_expander_init_textutil (GailExpander *expander,
   const gchar *label_text;
 
   expander->textutil = gail_text_util_new ();
-  label_text = gtk_expander_get_label (widget);
+  label_text = gail_expander_get_full_text (widget);
   gail_text_util_text_setup (expander->textutil, label_text);
 }
 
@@ -376,7 +374,7 @@ gail_expander_do_action (AtkAction *action,
      */
     return FALSE;
 
-  if (!GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+  if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
     return FALSE;
 
   expander = GAIL_EXPANDER (action);
@@ -406,7 +404,7 @@ idle_do_action (gpointer data)
 
   widget = GTK_ACCESSIBLE (gail_expander)->widget;
   if (widget == NULL /* State is defunct */ ||
-      !GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
+      !gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
     return FALSE;
 
   gtk_widget_activate (widget);
@@ -594,7 +592,7 @@ gail_expander_get_text (AtkText *text,
   if (!expander->textutil) 
     gail_expander_init_textutil (expander, GTK_EXPANDER (widget));
 
-  label_text = gtk_expander_get_label (GTK_EXPANDER (widget));
+  label_text = gail_expander_get_full_text (GTK_EXPANDER (widget));
 
   if (label_text == NULL)
     return NULL;