GType moz_container_get_type(void) { static GType moz_container_type = 0; if (!moz_container_type) { static GTypeInfo moz_container_info = { sizeof(MozContainerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) moz_container_class_init, /* class_init */ NULL, /* class_destroy */ NULL, /* class_data */ sizeof(MozContainer), /* instance_size */ 0, /* n_preallocs */ (GInstanceInitFunc) moz_container_init, /* instance_init */ NULL, /* value_table */ }; moz_container_type = g_type_register_static (GTK_TYPE_CONTAINER, "MozContainer", &moz_container_info, 0); #ifdef ACCESSIBILITY /* Set a factory to return accessible object with ROLE_REDUNDANT for * MozContainer, so that gail won't send focus notification for it */ atk_registry_set_factory_type(atk_get_default_registry(), moz_container_type, mai_redundant_object_factory_get_type()); #endif } return moz_container_type; }
JNIEXPORT void JNICALL ATK_NATIVE(_1atk_1registry_1set_1factory_1type) (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2) { ATK_NATIVE_ENTER(env, that, _1atk_1registry_1set_1factory_1type_FUNC); atk_registry_set_factory_type((AtkRegistry *)arg0, (GType)arg1, (GType)arg2); ATK_NATIVE_EXIT(env, that, _1atk_1registry_1set_1factory_1type_FUNC); }
static AtkObject * mate_druid_get_accessible (GtkWidget *widget) { static gboolean first_time = TRUE; if (first_time) { 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 * the parent type of MateDruid. */ derived_type = g_type_parent (MATE_TYPE_DRUID); 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, MATE_TYPE_DRUID, mate_druid_accessible_factory_get_type ()); } first_time = FALSE; } return GTK_WIDGET_CLASS (parent_class)->get_accessible (widget); }
static AtkObject * gtk_switch_get_accessible (GtkWidget *widget) { static gboolean first_time = TRUE; if (G_UNLIKELY (first_time)) { 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 the * parent type of GtkSwitch */ derived_type = g_type_parent (GTK_TYPE_SWITCH); 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_SWITCH, gtk_switch_accessible_factory_get_type ()); first_time = FALSE; } return GTK_WIDGET_CLASS (gtk_switch_parent_class)->get_accessible (widget); }
static AtkObject * panel_menu_button_get_accessible (GtkWidget *widget) { static gboolean first_time = TRUE; g_return_val_if_fail (widget != NULL, NULL); if (first_time && panel_a11y_get_is_a11y_enabled (widget)) atk_registry_set_factory_type (atk_get_default_registry (), PANEL_TYPE_MENU_BUTTON, panel_menu_button_accessible_factory_get_type ()); first_time = FALSE; return GTK_WIDGET_CLASS (panel_menu_button_parent_class)->get_accessible (widget); }
static void goo_canvas_widget_class_init (GooCanvasWidgetClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->dispose = goo_canvas_widget_dispose; gobject_class->get_property = goo_canvas_widget_get_property; gobject_class->set_property = goo_canvas_widget_set_property; simple_class->simple_update = goo_canvas_widget_update; simple_class->simple_paint = goo_canvas_widget_paint; simple_class->simple_is_item_at = goo_canvas_widget_is_item_at; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_WIDGET, goo_canvas_widget_accessible_factory_get_type ()); } g_object_class_install_property (gobject_class, PROP_WIDGET, g_param_spec_object ("widget", _("Widget"), _("The widget to place in the canvas"), GTK_TYPE_WIDGET, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the widget"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the widget"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the widget, or -1 to use its requested width"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the widget, or -1 to use its requested height"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("How to position the widget relative to the item's x and y coordinate settings"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_override_property (gobject_class, PROP_VISIBILITY, "visibility"); }