Convert GailCheck(Sub)MenuItem to GtkAccessible classes
This is along the same lines as the previous commit, with the same caveat.
This commit is contained in:
@ -33,7 +33,8 @@
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkintl.h"
|
||||
|
||||
#include "a11y/gtkcheckmenuitemaccessible.h"
|
||||
#include "a11y/gtkchecksubmenuitemaccessible.h"
|
||||
|
||||
/**
|
||||
* SECTION:gtkcheckmenuitem
|
||||
@ -102,6 +103,24 @@ G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_IT
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
|
||||
gtk_check_menu_item_activatable_interface_init))
|
||||
|
||||
static AtkObject *
|
||||
gtk_check_menu_item_get_accessible (GtkWidget *widget)
|
||||
{
|
||||
GObject *object;
|
||||
AtkObject *accessible;
|
||||
|
||||
/* FIXME this is not really right, submenus can come and go */
|
||||
if (gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget)))
|
||||
object = g_object_new (GTK_TYPE_CHECK_SUBMENU_ITEM_ACCESSIBLE, NULL);
|
||||
else
|
||||
object = g_object_new (GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, NULL);
|
||||
|
||||
accessible = ATK_OBJECT (object);
|
||||
atk_object_initialize (accessible, widget);
|
||||
|
||||
return accessible;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
{
|
||||
@ -150,7 +169,8 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
||||
GTK_PARAM_READABLE));
|
||||
|
||||
widget_class->draw = gtk_check_menu_item_draw;
|
||||
|
||||
widget_class->get_accessible = gtk_check_menu_item_get_accessible;
|
||||
|
||||
menu_item_class->activate = gtk_check_menu_item_activate;
|
||||
menu_item_class->hide_on_activate = FALSE;
|
||||
menu_item_class->toggle_size_request = gtk_check_menu_item_toggle_size_request;
|
||||
|
||||
Reference in New Issue
Block a user