[gtk+] Use _gtk_accessible_set_factory_type in GtkSeparatorMenuItem



commit ed901afe37b308d6d88aa68a9336357156ed014e
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Feb 17 01:34:10 2011 -0500

    Use _gtk_accessible_set_factory_type in GtkSeparatorMenuItem

 gtk/gtkseparatormenuitem.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)
---
diff --git a/gtk/gtkseparatormenuitem.c b/gtk/gtkseparatormenuitem.c
index 664d349..96f2119 100644
--- a/gtk/gtkseparatormenuitem.c
+++ b/gtk/gtkseparatormenuitem.c
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#include "gtkaccessible.h"
+#include "gtkaccessibleprivate.h"
 #include "gtkseparatormenuitem.h"
 
 /**
@@ -133,28 +133,12 @@ gtk_separator_menu_item_accessible_factory_init (AtkObjectFactory *factory)
 static AtkObject *
 gtk_separator_menu_item_get_accessible (GtkWidget *widget)
 {
-  static gboolean initialized = FALSE;
+  static gboolean initialized = FALSE
 
   if (G_UNLIKELY (!initialized))
     {
-      AtkObjectFactory *factory;
-      AtkRegistry *registry;
-      GType derived_type;
-      GType derived_atk_type;
-
-      /* Figure out whether accessibility is enabled by looking at the
-       * type of the accessible object which would be created for our
-       * parent type
-       */
-      derived_type = g_type_parent (GTK_TYPE_SEPARATOR_MENU_ITEM);
-
-      registry = atk_get_default_registry ();
-      factory = atk_registry_get_factory (registry, derived_type);
-      derived_atk_type = atk_object_factory_get_accessible_type (factory);
-      if (g_type_is_a (derived_atk_type, GTK_TYPE_ACCESSIBLE))
-        atk_registry_set_factory_type (registry,
-                                       GTK_TYPE_SEPARATOR_MENU_ITEM,
-                                       gtk_separator_menu_item_accessible_factory_get_type ());
+      _gtk_accessible_set_factory_type (GTK_TYPE_SEPARATOR_MENU_ITEM,
+                                        gtk_separator_menu_item_accessible_factory_get_type ());
 
       initialized = TRUE;
     }



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