Commit ed08bacc authored by Matthias Clasen's avatar Matthias Clasen

Convert GailWindow to GtkWindowAccessible

While doing this, drop the get_mdi_zorder implementation
that really should come from the window manager side. Dropping
this saves some 500 lines.
parent 8432ea35
......@@ -50,7 +50,7 @@ gail_c_sources = \
gtktreeviewaccessible.c \
gailutil.c \
gailwidget.c \
gailwindow.c
gtkwindowaccessible.c
libgailincludedir=$(includedir)/gail-3.0/gail
......@@ -101,7 +101,7 @@ gail_private_h_sources = \
gailtoplevel.h \
gtktreeviewaccessible.h \
gailutil.h \
gailwindow.h
gtkwindowaccessible.h
gail_public_h_sources = \
gailwidget.h
......
......@@ -35,7 +35,6 @@
#include "gailtoplevel.h"
#include "gailutil.h"
#include "gailwidget.h"
#include "gailwindow.h"
#include "gailfactory.h"
......@@ -85,7 +84,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDG
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL)
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_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
......@@ -834,7 +832,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CONTAINER, gail_container);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU_BAR, gail_menu_shell);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU, gail_menu);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WINDOW, gail_window);
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);
......
......@@ -24,7 +24,7 @@
#include <gtk/gtk.h>
#include "gailutil.h"
#include "gailtoplevel.h"
#include "gailwindow.h"
#include "gtkwindowaccessible.h"
static void gail_util_class_init (GailUtilClass *klass);
static void gail_util_init (GailUtil *utils);
......@@ -147,7 +147,7 @@ gail_util_add_global_event_listener (GSignalEmissionHook listener,
do_window_event_initialization ();
initialized = TRUE;
}
rc = add_listener (listener, "GailWindow", split_string[1], event_type);
rc = add_listener (listener, "GtkWindowAccessible", split_string[1], event_type);
}
else
{
......@@ -403,9 +403,9 @@ do_window_event_initialization (void)
AtkObject *root;
/*
* Ensure that GailWindowClass exists.
* Ensure that GtkWindowAccessibleClass exists.
*/
g_type_class_ref (GAIL_TYPE_WINDOW);
g_type_class_ref (GTK_TYPE_WINDOW_ACCESSIBLE);
g_signal_add_emission_hook (g_signal_lookup ("window-state-event", GTK_TYPE_WIDGET),
0, state_event_watcher, NULL, (GDestroyNotify) NULL);
g_signal_add_emission_hook (g_signal_lookup ("configure-event", GTK_TYPE_WIDGET),
......@@ -461,15 +461,15 @@ state_event_watcher (GSignalInvocationHint *hint,
atk_obj = gtk_widget_get_accessible (widget);
if (GAIL_IS_WINDOW (atk_obj))
if (GTK_IS_WINDOW_ACCESSIBLE (atk_obj))
{
parent = atk_object_get_parent (atk_obj);
if (parent == atk_get_root ())
{
signal_id = g_signal_lookup (signal_name, GAIL_TYPE_WINDOW);
g_signal_emit (atk_obj, signal_id, 0);
}
{
signal_id = g_signal_lookup (signal_name, GTK_TYPE_WINDOW_ACCESSIBLE);
g_signal_emit (atk_obj, signal_id, 0);
}
return TRUE;
}
else
......@@ -485,17 +485,15 @@ window_added (AtkObject *atk_obj,
{
GtkWidget *widget;
if (!GAIL_IS_WINDOW (child)) return;
if (!GTK_IS_WINDOW_ACCESSIBLE (child)) return;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (child));
if (!widget)
return;
g_signal_connect (widget, "focus-in-event",
(GCallback) window_focus, NULL);
g_signal_connect (widget, "focus-out-event",
(GCallback) window_focus, NULL);
g_signal_emit (child, g_signal_lookup ("create", GAIL_TYPE_WINDOW), 0);
g_signal_connect (widget, "focus-in-event", (GCallback) window_focus, NULL);
g_signal_connect (widget, "focus-out-event", (GCallback) window_focus, NULL);
g_signal_emit (child, g_signal_lookup ("create", GTK_TYPE_WINDOW_ACCESSIBLE), 0);
}
......@@ -507,7 +505,7 @@ window_removed (AtkObject *atk_obj,
GtkWidget *widget;
GtkWindow *window;
if (!GAIL_IS_WINDOW (child)) return;
if (!GTK_IS_WINDOW_ACCESSIBLE (child)) return;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (child));
if (!widget)
......@@ -526,11 +524,11 @@ window_removed (AtkObject *atk_obj,
atk_obj = gtk_widget_get_accessible (widget);
signal_name = "deactivate";
g_signal_emit (atk_obj, g_signal_lookup (signal_name, GAIL_TYPE_WINDOW), 0);
g_signal_emit (atk_obj, g_signal_lookup (signal_name, GTK_TYPE_WINDOW_ACCESSIBLE), 0);
}
g_signal_handlers_disconnect_by_func (widget, (gpointer) window_focus, NULL);
g_signal_emit (child, g_signal_lookup ("destroy", GAIL_TYPE_WINDOW), 0);
g_signal_emit (child, g_signal_lookup ("destroy", GTK_TYPE_WINDOW_ACCESSIBLE), 0);
}
static gboolean
......@@ -544,7 +542,7 @@ window_focus (GtkWidget *widget,
atk_obj = gtk_widget_get_accessible (widget);
signal_name = (event->in) ? "activate" : "deactivate";
g_signal_emit (atk_obj, g_signal_lookup (signal_name, GAIL_TYPE_WINDOW), 0);
g_signal_emit (atk_obj, g_signal_lookup (signal_name, GTK_TYPE_WINDOW_ACCESSIBLE), 0);
return FALSE;
}
......@@ -593,15 +591,15 @@ configure_event_watcher (GSignalInvocationHint *hint,
}
atk_obj = gtk_widget_get_accessible (widget);
if (GAIL_IS_WINDOW (atk_obj))
if (GTK_IS_WINDOW_ACCESSIBLE (atk_obj))
{
parent = atk_object_get_parent (atk_obj);
if (parent == atk_get_root ())
{
signal_id = g_signal_lookup (signal_name, GAIL_TYPE_WINDOW);
g_signal_emit (atk_obj, signal_id, 0);
}
{
signal_id = g_signal_lookup (signal_name, GTK_TYPE_WINDOW_ACCESSIBLE);
g_signal_emit (atk_obj, signal_id, 0);
}
return TRUE;
}
else
......
......@@ -17,35 +17,35 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_WINDOW_H__
#define __GAIL_WINDOW_H__
#ifndef __GTK_WINDOW_ACCESSIBLE_H__
#define __GTK_WINDOW_ACCESSIBLE_H__
#include "gailcontainer.h"
G_BEGIN_DECLS
#define GAIL_TYPE_WINDOW (gail_window_get_type ())
#define GAIL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_WINDOW, GailWindow))
#define GAIL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_WINDOW, GailWindowClass))
#define GAIL_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_WINDOW))
#define GAIL_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_WINDOW))
#define GAIL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_WINDOW, GailWindowClass))
#define GTK_TYPE_WINDOW_ACCESSIBLE (gtk_window_accessible_get_type ())
#define GTK_WINDOW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW_ACCESSIBLE, GtkWindowAccessible))
#define GTK_WINDOW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WINDOW_ACCESSIBLE, GtkWindowAccessibleClass))
#define GTK_IS_WINDOW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WINDOW_ACCESSIBLE))
#define GTK_IS_WINDOW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WINDOW_ACCESSIBLE))
#define GTK_WINDOW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WINDOW_ACCESSIBLE, GtkWindowAccessibleClass))
typedef struct _GailWindow GailWindow;
typedef struct _GailWindowClass GailWindowClass;
typedef struct _GtkWindowAccessible GtkWindowAccessible;
typedef struct _GtkWindowAccessibleClass GtkWindowAccessibleClass;
struct _GailWindow
struct _GtkWindowAccessible
{
GailContainer parent;
};
GType gail_window_get_type (void);
struct _GailWindowClass
struct _GtkWindowAccessibleClass
{
GailContainerClass parent_class;
};
GType gtk_window_accessible_get_type (void);
G_END_DECLS
#endif /* __GAIL_WINDOW_H__ */
#endif /* __GTK_WINDOW_ACCESSIBLE_H__ */
......@@ -50,6 +50,7 @@
#include "gtkcontainerprivate.h"
#include "gtkintl.h"
#include "gtktypebuiltins.h"
#include "a11y/gtkwindowaccessible.h"
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
......@@ -1060,6 +1061,8 @@ gtk_window_class_init (GtkWindowClass *klass)
add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
add_tab_bindings (binding_set, GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_WINDOW_ACCESSIBLE);
}
static void
......
......@@ -6,136 +6,355 @@ window1
<AtkComponent>
layer: window
alpha: 1
button1
"push button"
index: 0
name: Page 1
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
button2
"push button"
index: 1
name: Page 2
state: enabled focusable sensitive visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
unnamed-GtkBoxAccessible-0
"filler"
parent: unnamed-GtkBoxAccessible-1
index: 1
parent: window1
index: 0
state: enabled horizontal sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
unnamed-GtkButtonAccessible-2
"push button"
unnamed-GtkFrameAccessible-1
"panel"
parent: unnamed-GtkBoxAccessible-0
index: 0
name: Close
state: enabled focusable sensitive
state: enabled sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>c
unnamed-GtkButtonAccessible-3
"push button"
unnamed-GtkBoxAccessible-2
"filler"
parent: unnamed-GtkFrameAccessible-1
index: 0
state: enabled sensitive showing vertical visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
Page 1
"label"
parent: unnamed-GtkBoxAccessible-2
index: 0
name: Page 1
state: enabled multi-line sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Page 1
character count: 6
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
indent: 0
invisible: false
justification: left
language: <omitted>
left-margin: 0
pixels-above-lines: 0
pixels-below-lines: 0
pixels-inside-wrap: 0
right-margin: 0
rise: 0
scale: 1
size: <omitted>
stretch: <omitted>
strikethrough: false
style: <omitted>
underline: none
variant: <omitted>
weight: <omitted>
wrap-mode: word
Page 1
"label"
parent: unnamed-GtkBoxAccessible-2
index: 1
name: Page 1
state: enabled multi-line sensitive visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Page 1
character count: 6
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
indent: 0
invisible: false
justification: left
language: <omitted>
left-margin: 0
pixels-above-lines: 0
pixels-below-lines: 0
pixels-inside-wrap: 0
right-margin: 0
rise: 0
scale: 1
size: <omitted>
stretch: <omitted>
strikethrough: false
style: <omitted>
underline: none
variant: <omitted>
weight: <omitted>
wrap-mode: word
Page 2
"label"
parent: unnamed-GtkBoxAccessible-2
index: 2
name: Page 2
state: enabled multi-line sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Page 2
character count: 6
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
indent: 0
invisible: false
justification: left
language: <omitted>
left-margin: 0
pixels-above-lines: 0
pixels-below-lines: 0
pixels-inside-wrap: 0
right-margin: 0
rise: 0
scale: 1
size: <omitted>
stretch: <omitted>
strikethrough: false
style: <omitted>
underline: none
variant: <omitted>
weight: <omitted>
wrap-mode: word
Page 2
"label"
parent: unnamed-GtkBoxAccessible-2
index: 3
name: Page 2
state: enabled multi-line sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Page 2
character count: 6
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
indent: 0
invisible: false
justification: left
language: <omitted>
left-margin: 0
pixels-above-lines: 0
pixels-below-lines: 0
pixels-inside-wrap: 0
right-margin: 0
rise: 0
scale: 1
size: <omitted>
stretch: <omitted>
strikethrough: false
style: <omitted>
underline: none
variant: <omitted>
weight: <omitted>
wrap-mode: word
unnamed-GtkBoxAccessible-3
"filler"
parent: unnamed-GtkBoxAccessible-0
index: 1
name: Cancel
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>c
unnamed-GtkButtonAccessible-4
"push button"
parent: unnamed-GtkBoxAccessible-0
index: 2
name: Finish
state: focusable
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>f
unnamed-GtkButtonAccessible-5
"push button"
parent: unnamed-GtkBoxAccessible-0
index: 3
name: Go Back
state: enabled focusable sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>b
unnamed-GtkButtonAccessible-6
"push button"
parent: unnamed-GtkBoxAccessible-0
index: 4
name: Continue
state: focusable showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>o
unnamed-GtkButtonAccessible-7
"push button"
parent: unnamed-GtkBoxAccessible-0
index: 5
name: Apply
state: enabled focusable sensitive
state: enabled sensitive showing vertical visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>a
unnamed-GtkNotebookAccessible-4
"page tab list"
parent: unnamed-GtkBoxAccessible-3
index: 0
state: enabled sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkSelection>
selected children: unnamed-GtkNotebookPageAccessible-5
unnamed-GtkNotebookPageAccessible-5
"page tab"
parent: unnamed-GtkNotebookAccessible-4
index: 0
state: enabled selectable selected showing visible
<AtkComponent>
layer: widget
alpha: 1
button1
"push button"
index: 0
name: Button 1
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
unnamed-GtkNotebookPageAccessible-6
"page tab"
parent: unnamed-GtkNotebookAccessible-4
index: 1
state: enabled selectable visible
<AtkComponent>
layer: widget
alpha: 1
button2
"push button"
index: 1
name: Button 2
state: enabled focusable sensitive visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
unnamed-GtkBoxAccessible-7
"filler"
parent: unnamed-GtkBoxAccessible-3
index: 1
state: enabled horizontal sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
unnamed-GtkButtonAccessible-8
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 0
name: Close
state: enabled focusable sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>c
unnamed-GtkButtonAccessible-9
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 1
name: Cancel
state: enabled focusable sensitive showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>c
unnamed-GtkButtonAccessible-10
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 2
name: Finish
state: focusable
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>f
unnamed-GtkButtonAccessible-11
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 3
name: Go Back
state: enabled focusable sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>b
unnamed-GtkButtonAccessible-12
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 4
name: Continue
state: focusable showing visible
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>o
unnamed-GtkButtonAccessible-13
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 5
name: Apply
state: enabled focusable sensitive
toolkit: gail
<AtkComponent>
layer: widget
alpha: 1
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>a
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