Commit 318192b9 authored by Matthias Clasen's avatar Matthias Clasen

Convert GailNotebook to GtkNotebookAccessible

parent 6012f096
......@@ -25,7 +25,7 @@ gail_c_sources = \
gailmenu.c \
gailmenushell.c \
gailmenuitem.c \
gailnotebook.c \
gtknotebookaccessible.c \
gailnotebookpage.c \
gtkpanedaccessible.c \
gtkprogressbaraccessible.c \
......@@ -76,7 +76,7 @@ gail_private_h_sources = \
gailmenu.h \
gailmenushell.h \
gailmenuitem.h \
gailnotebook.h \
gtknotebookaccessible.h \
gailnotebookpage.h \
gtkpanedaccessible.h \
gtkprogressbaraccessible.h \
......
......@@ -34,7 +34,6 @@
#include "gailmenu.h"
#include "gailmenushell.h"
#include "gailmenuitem.h"
#include "gailnotebook.h"
#include "gailradiomenuitem.h"
#include "gailrenderercell.h"
#include "gailstatusbar.h"
......@@ -64,8 +63,6 @@ static gboolean gail_switch_page_watcher(GSignalInvocationHint *ihint,
guint n_param_values,
const GValue *param_values,
gpointer data);
static AtkObject* gail_get_accessible_for_widget (GtkWidget *widget,
gboolean *transient);
static void gail_finish_select (GtkWidget *widget);
static void gail_map_cb (GtkWidget *widget);
static void gail_map_submenu_cb (GtkWidget *widget);
......@@ -98,7 +95,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GT
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU, GailMenu, gail_menu, GTK_TYPE_MENU)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WINDOW, GailWindow, gail_window, GTK_TYPE_BIN)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_CHECK_MENU_ITEM, GailCheckMenuItem, gail_check_menu_item, gail_check_menu_item_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_RADIO_MENU_ITEM, GailRadioMenuItem, gail_radio_menu_item, gail_radio_menu_item_new)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_EXPANDER, GailExpander, gail_expander, GTK_TYPE_EXPANDER)
......@@ -854,7 +850,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU, gail_menu);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WINDOW, gail_window);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_STATUSBAR, gail_statusbar);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_NOTEBOOK, gail_notebook);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
......
......@@ -140,7 +140,7 @@ gail_notebook_page_init (GailNotebookPage *page)
}
AtkObject*
gail_notebook_page_new (GailNotebook *notebook,
gail_notebook_page_new (GtkNotebookAccessible *notebook,
GtkWidget *child)
{
GObject *object;
......@@ -148,7 +148,7 @@ gail_notebook_page_new (GailNotebook *notebook,
GailNotebookPage *page;
GtkWidget *label;
g_return_val_if_fail (GAIL_IS_NOTEBOOK (notebook), NULL);
g_return_val_if_fail (GTK_IS_NOTEBOOK_ACCESSIBLE (notebook), NULL);
g_return_val_if_fail (GTK_WIDGET (child), NULL);
object = g_object_new (GAIL_TYPE_NOTEBOOK_PAGE, NULL);
......
......@@ -20,7 +20,7 @@
#ifndef __GAIL_NOTEBOOK_PAGE_H__
#define __GAIL_NOTEBOOK_PAGE_H__
#include "gailnotebook.h"
#include "gtknotebookaccessible.h"
#include "gailtextutil.h"
G_BEGIN_DECLS
......@@ -40,20 +40,21 @@ struct _GailNotebookPage
AtkObject parent;
GtkAccessible *notebook;
GtkWidget *child;
GailTextUtil *textutil;
};
GType gail_notebook_page_get_type (void);
struct _GailNotebookPageClass
{
AtkObjectClass parent_class;
};
AtkObject *gail_notebook_page_new (GailNotebook *notebook, GtkWidget *child);
GType gail_notebook_page_get_type (void);
AtkObject *gail_notebook_page_new (GtkNotebookAccessible *notebook,
GtkWidget *child);
void gail_notebook_page_invalidate (GailNotebookPage *page);
......
......@@ -17,30 +17,30 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_NOTEBOOK_H__
#define __GAIL_NOTEBOOK_H__
#ifndef __GTK_NOTEBOOK_ACCESSIBLE_H__
#define __GTK_NOTEBOOK_ACCESSIBLE_H__
#include "gailcontainer.h"
G_BEGIN_DECLS
#define GAIL_TYPE_NOTEBOOK (gail_notebook_get_type ())
#define GAIL_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_NOTEBOOK, GailNotebook))
#define GAIL_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_NOTEBOOK, GailNotebookClass))
#define GAIL_IS_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_NOTEBOOK))
#define GAIL_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_NOTEBOOK))
#define GAIL_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_NOTEBOOK, GailNotebookClass))
#define GTK_TYPE_NOTEBOOK_ACCESSIBLE (gtk_notebook_accessible_get_type ())
#define GTK_NOTEBOOK_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessible))
#define GTK_NOTEBOOK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessibleClass))
#define GTK_IS_NOTEBOOK_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE))
#define GTK_IS_NOTEBOOK_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK_ACCESSIBLE))
#define GTK_NOTEBOOK_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK_ACCESSIBLE, GtkNotebookAccessibleClass))
typedef struct _GailNotebook GailNotebook;
typedef struct _GailNotebookClass GailNotebookClass;
typedef struct _GtkNotebookAccessible GtkNotebookAccessible;
typedef struct _GtkNotebookAccessibleClass GtkNotebookAccessibleClass;
struct _GailNotebook
struct _GtkNotebookAccessible
{
GailContainer parent;
/*
* page_cache maintains a list of pre-ref'd Notebook Pages.
* This cache is queried by gail_notebook_ref_child().
* This cache is queried by gtk_notebook_accessible_ref_child().
* If the page is found in the list then a new page does not
* need to be created
*/
......@@ -50,13 +50,13 @@ struct _GailNotebook
guint idle_focus_id;
};
GType gail_notebook_get_type (void);
struct _GailNotebookClass
struct _GtkNotebookAccessibleClass
{
GailContainerClass parent_class;
};
GType gtk_notebook_accessible_get_type (void);
G_END_DECLS
#endif /* __GAIL_NOTEBOOK_H__ */
#endif /* __GTK_NOTEBOOK_ACCESSIBLE_H__ */
......@@ -43,6 +43,7 @@
#include "gtkdnd.h"
#include "gtkbuildable.h"
#include "gtktypebuiltins.h"
#include "a11y/gtknotebookaccessible.h"
/**
......@@ -1152,6 +1153,8 @@ gtk_notebook_class_init (GtkNotebookClass *class)
add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
g_type_class_add_private (class, sizeof (GtkNotebookPrivate));
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_NOTEBOOK_ACCESSIBLE);
}
static void
......
......@@ -76,7 +76,7 @@ window1
variant: <omitted>
weight: <omitted>
wrap-mode: word
unnamed-GailNotebook-3
unnamed-GtkNotebookAccessible-3
"page tab list"
parent: unnamed-GailContainer-1
index: 2
......@@ -89,7 +89,7 @@ window1
selected children: unnamed-GailNotebookPage-4
unnamed-GailNotebookPage-4
"page tab"
parent: unnamed-GailNotebook-3
parent: unnamed-GtkNotebookAccessible-3
index: 0
state: enabled selectable selected showing visible
<AtkComponent>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment