Commit 8432ea35 authored by Matthias Clasen's avatar Matthias Clasen

Convert GailButton to GtkButtonAccessible

This drops the AtkText implementation, and also strips handling
of children out. Instead of listening for enter/leave/press/released,
just listen for state changes on the widget.
parent a3113386
......@@ -7,7 +7,7 @@ gail_c_sources = \
gtkarrowaccessible.c \
gailbooleancell.c \
gtkboxaccessible.c \
gailbutton.c \
gtkbuttonaccessible.c \
gailcell.c \
gailcellparent.c \
gtkcheckmenuitemaccessible.c \
......@@ -58,7 +58,7 @@ gail_private_h_sources = \
gtkarrowaccessible.h \
gailbooleancell.h \
gtkboxaccessible.h \
gailbutton.h \
gtkbuttonaccessible.h \
gailcell.h \
gailcellparent.h \
gtkcheckmenuitemaccessible.h \
......
......@@ -24,7 +24,6 @@
#include <gtk/gtkx.h>
#include "gailbooleancell.h"
#include "gailbutton.h"
#include "gailcell.h"
#include "gailcontainer.h"
#include "gailcontainercell.h"
......@@ -84,7 +83,6 @@ static GQuark quark_focus_object = 0;
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BUTTON, GailButton, gail_button, GTK_TYPE_BUTTON)
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)
......@@ -834,7 +832,6 @@ gail_accessibility_module_init (void)
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WIDGET, gail_widget);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CONTAINER, gail_container);
GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BUTTON, gail_button);
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);
......
This diff is collapsed.
This diff is collapsed.
......@@ -17,45 +17,36 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GAIL_BUTTON_H__
#define __GAIL_BUTTON_H__
#ifndef __GTK_BUTTON_ACCESSIBLE_H__
#define __GTK_BUTTON_ACCESSIBLE_H__
#include "gailcontainer.h"
#include "gailtextutil.h"
G_BEGIN_DECLS
#define GAIL_TYPE_BUTTON (gail_button_get_type ())
#define GAIL_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_BUTTON, GailButton))
#define GAIL_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_BUTTON, GailButtonClass))
#define GAIL_IS_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_BUTTON))
#define GAIL_IS_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_BUTTON))
#define GAIL_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_BUTTON, GailButtonClass))
#define GTK_TYPE_BUTTON_ACCESSIBLE (gtk_button_accessible_get_type ())
#define GTK_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessible))
#define GTK_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass))
#define GTK_IS_BUTTON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BUTTON_ACCESSIBLE))
#define GTK_IS_BUTTON_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BUTTON_ACCESSIBLE))
#define GTK_BUTTON_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BUTTON_ACCESSIBLE, GtkButtonAccessibleClass))
typedef struct _GailButton GailButton;
typedef struct _GailButtonClass GailButtonClass;
typedef struct _GtkButtonAccessible GtkButtonAccessible;
typedef struct _GtkButtonAccessibleClass GtkButtonAccessibleClass;
struct _GailButton
struct _GtkButtonAccessible
{
GailContainer parent;
/*
* Cache the widget state so we know the previous state when it changed
*/
gint8 state;
gchar *click_keybinding;
GailTextUtil *textutil;
};
GType gail_button_get_type (void);
struct _GailButtonClass
struct _GtkButtonAccessibleClass
{
GailContainerClass parent_class;
};
GType gtk_button_accessible_get_type (void);
G_END_DECLS
#endif /* __GAIL_BUTTON_H__ */
#endif /* __GTK_BUTTON_ACCESSIBLE_H__ */
......@@ -190,7 +190,7 @@ gtk_link_button_accessible_get_hyperlink (AtkHyperlinkImpl *impl)
static void atk_hypertext_impl_interface_init (AtkHyperlinkImplIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, gtk_link_button_accessible, GAIL_TYPE_BUTTON,
G_DEFINE_TYPE_WITH_CODE (GtkLinkButtonAccessible, gtk_link_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_HYPERLINK_IMPL, atk_hypertext_impl_interface_init))
static void
......
......@@ -20,7 +20,7 @@
#ifndef __GTK_LINK_BUTTON_ACCESSIBLE_H__
#define __GTK_LINK_BUTTON_ACCESSIBLE_H__
#include "gailbutton.h"
#include "gtkbuttonaccessible.h"
G_BEGIN_DECLS
......@@ -36,14 +36,14 @@ typedef struct _GtkLinkButtonAccessibleClass GtkLinkButtonAccessibleClass;
struct _GtkLinkButtonAccessible
{
GailButton parent;
GtkButtonAccessible parent;
AtkHyperlink *link;
};
struct _GtkLinkButtonAccessibleClass
{
GailButtonClass parent_class;
GtkButtonAccessibleClass parent_class;
};
GType gtk_link_button_accessible_get_type (void);
......
......@@ -28,7 +28,7 @@
static void atk_action_interface_init (AtkActionIface *iface);
static void atk_value_interface_init (AtkValueIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkScaleButtonAccessible, gtk_scale_button_accessible, GAIL_TYPE_BUTTON,
G_DEFINE_TYPE_WITH_CODE (GtkScaleButtonAccessible, gtk_scale_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init));
......
......@@ -21,7 +21,7 @@
#define __GTK_SCALE_BUTTON_ACCESSIBLE_H__
#include <gtk/gtk.h>
#include "gailbutton.h"
#include "gtkbuttonaccessible.h"
G_BEGIN_DECLS
......@@ -37,12 +37,12 @@ typedef struct _GtkScaleButtonAccessibleClass GtkScaleButtonAccessibleClass;
struct _GtkScaleButtonAccessible
{
GailButton parent;
GtkButtonAccessible parent;
};
struct _GtkScaleButtonAccessibleClass
{
GailButtonClass parent_class;
GtkButtonAccessibleClass parent_class;
};
GType gtk_scale_button_accessible_get_type (void);
......
......@@ -24,7 +24,7 @@
#include "gtktogglebuttonaccessible.h"
G_DEFINE_TYPE (GtkToggleButtonAccessible, gtk_toggle_button_accessible, GAIL_TYPE_BUTTON)
G_DEFINE_TYPE (GtkToggleButtonAccessible, gtk_toggle_button_accessible, GTK_TYPE_BUTTON_ACCESSIBLE)
static void
gtk_toggle_button_accessible_toggled (GtkWidget *widget)
......
......@@ -20,7 +20,7 @@
#ifndef __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__
#define __GTK_TOGGLE_BUTTON_ACCESSIBLE_H__
#include "gailbutton.h"
#include "gtkbuttonaccessible.h"
G_BEGIN_DECLS
......@@ -36,12 +36,12 @@ typedef struct _GtkToggleButtonAccessibleClass GtkToggleButtonAccessibleClass;
struct _GtkToggleButtonAccessible
{
GailButton parent;
GtkButtonAccessible parent;
};
struct _GtkToggleButtonAccessibleClass
{
GailButtonClass parent_class;
GtkButtonAccessibleClass parent_class;
};
GType gtk_toggle_button_accessible_get_type (void);
......
......@@ -58,6 +58,7 @@
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "a11y/gtkbuttonaccessible.h"
static const GtkBorder default_default_border = { 1, 1, 1, 1 };
......@@ -528,6 +529,8 @@ gtk_button_class_init (GtkButtonClass *klass)
GTK_PARAM_READABLE));
g_type_class_add_private (gobject_class, sizeof (GtkButtonPrivate));
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_BUTTON_ACCESSIBLE);
}
static void
......
......@@ -316,7 +316,7 @@ window1
<AtkComponent>
layer: widget
alpha: 1
License
unnamed-GtkToggleButtonAccessible-8
"toggle button"
parent: unnamed-GtkBoxAccessible-7
index: 0
......@@ -326,44 +326,13 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: License
character count: 7
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>l
Credits
unnamed-GtkToggleButtonAccessible-9
"toggle button"
parent: unnamed-GtkBoxAccessible-7
index: 1
......@@ -373,44 +342,13 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Credits
character count: 7
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>r
Close
unnamed-GtkButtonAccessible-10
"push button"
parent: unnamed-GtkBoxAccessible-7
index: 2
......@@ -420,37 +358,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Close
character count: 5
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: 20 x 20
image description: (null)
......
......@@ -16,37 +16,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: -1 x -1
image description: (null)
......
This diff is collapsed.
This diff is collapsed.
......@@ -40,37 +40,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: -1 x -1
image description: (null)
......@@ -88,37 +57,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: -1 x -1
image description: (null)
......@@ -134,37 +72,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: -1 x -1
image description: (null)
......@@ -180,37 +87,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: -1 x -1
image description: (null)
......
......@@ -102,7 +102,7 @@ window1
<AtkComponent>
layer: widget
alpha: 1
unnamed-GailButton-10
unnamed-GtkButtonAccessible-10
"push button"
parent: unnamed-GtkBoxAccessible-5
index: 1
......@@ -112,12 +112,8 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: (null)
character count: 0
caret offset: 0
<AtkImage>
image size: 20 x 20
image size: -1 x -1
image description: (null)
<AtkAction>
action 0 name: click
......@@ -1313,7 +1309,7 @@ window1
<AtkComponent>
layer: widget
alpha: 1
Help
unnamed-GtkButtonAccessible-58
"push button"
parent: unnamed-GtkBoxAccessible-57
index: 0
......@@ -1323,44 +1319,13 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Help
character count: 4
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>h
OK
unnamed-GtkButtonAccessible-59
"push button"
parent: unnamed-GtkBoxAccessible-57
index: 1
......@@ -1370,44 +1335,13 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: OK
character count: 2
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: 20 x 20
image description: (null)
<AtkAction>
action 0 name: click
action 0 keybinding: <Alt>o
Cancel
unnamed-GtkButtonAccessible-60
"push button"
parent: unnamed-GtkBoxAccessible-57
index: 2
......@@ -1417,37 +1351,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Cancel
character count: 6
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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
<AtkImage>
image size: 20 x 20
image description: (null)
......
......@@ -16,37 +16,6 @@ window1
<AtkComponent>
layer: widget
alpha: 1
<AtkText>
text: Hello World!
character count: 12
caret offset: 0
default attributes: bg-color: <omitted>
bg-full-height: 0
bg-stipple: false
direction: <omitted>
editable: false
family-name: <omitted>
fg-color: <omitted>
fg-stipple: false
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>