summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--README35
-rwxr-xr-xatk/atkaction.h7
-rwxr-xr-xatk/atkcomponent.h1
-rwxr-xr-xatk/atkeditabletext.h1
-rwxr-xr-xatk/atkhypertext.h1
-rwxr-xr-xatk/atkimage.h1
-rwxr-xr-xatk/atkobject.c84
-rwxr-xr-xatk/atkobject.h61
-rwxr-xr-xatk/atkselection.h1
-rwxr-xr-xatk/atktable.h1
-rwxr-xr-xatk/atktext.h1
-rwxr-xr-xatk/atkvalue.h1
13 files changed, 116 insertions, 81 deletions
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..a3b1614
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,2 @@
+This is the initial release of ATK, the Accessibility Tookit, which will be
+used obtain accessibily information from GTK+ and GNOME widgets.
diff --git a/README b/README
new file mode 100644
index 0000000..24444ed
--- /dev/null
+++ b/README
@@ -0,0 +1,35 @@
+This directory contains the ATK library.
+
+For more information about ATK and accessibility in GNOME, see:
+ http://developer.gnome.org/projects/gap
+
+Dependencies
+============
+
+In order to get CVS atk installed on your system, you need to have
+the most recent CVS version of glib installed as well.
+
+Building
+========
+
+To compile a CVS version of atk on your system, you will need to take
+several steps to setup the tree for compilation. You can do all these
+steps at once by running:
+
+ cvsroot/atk# ./autogen.sh
+
+Basically this does the following for you:
+
+ cvsroot/atk# aclocal; automake; autoconf
+
+ The above commands create the "configure" script. Now you
+ can run the configure script in cvsroot/atk to create all
+ the Makefiles.
+
+Before running autogen.sh or configure, make sure you have libtool
+in your path.
+
+Note that autogen.sh runs configure for you. If you wish to pass
+options like --prefix=/usr to configure you can give those options
+to autogen.sh and they will be passed on to configure.
+
diff --git a/atk/atkaction.h b/atk/atkaction.h
index 0f36872..3651c4c 100755
--- a/atk/atkaction.h
+++ b/atk/atkaction.h
@@ -44,6 +44,7 @@ extern "C" {
#define _TYPEDEF_ATK_ACTION_
typedef struct _AtkAction AtkAction;
#endif
+typedef struct _AtkActionIface AtkActionIface;
struct _AtkActionIface
{
@@ -68,8 +69,8 @@ struct _AtkActionIface
/*
* Returns a keybinding associated with this action, if one exists.
*/
- G_CONST_RETURN gchar* (*get_keybinding) (AtkAction *action,
- gint i);
+ G_CONST_RETURN gchar* (*get_keybinding) (AtkAction *action,
+ gint i);
};
GType atk_action_get_type ();
@@ -90,6 +91,8 @@ void atk_action_do_action (AtkAction *action,
gint atk_action_get_n_actions (AtkAction *action);
G_CONST_RETURN gchar* atk_action_get_description (AtkAction *action,
gint i);
+G_CONST_RETURN gchar* atk_action_get_keybinding (AtkAction *action,
+ gint i);
/*
diff --git a/atk/atkcomponent.h b/atk/atkcomponent.h
index 42c21e5..5e1b63f 100755
--- a/atk/atkcomponent.h
+++ b/atk/atkcomponent.h
@@ -42,6 +42,7 @@ extern "C" {
#define _TYPEDEF_ATK_COMPONENT_
typedef struct _AtkComponent AtkComponent;
#endif
+typedef struct _AtkComponentIface AtkComponentIface;
typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
diff --git a/atk/atkeditabletext.h b/atk/atkeditabletext.h
index cab9b6a..46ce9e5 100755
--- a/atk/atkeditabletext.h
+++ b/atk/atkeditabletext.h
@@ -41,6 +41,7 @@ extern "C" {
#define _TYPEDEF_ATK_EDITABLE_TEXT_
typedef struct _AtkEditableText AtkEditableText;
#endif
+typedef struct _AtkEditableTextIface AtkEditableTextIface;
struct _AtkEditableTextIface
{
diff --git a/atk/atkhypertext.h b/atk/atkhypertext.h
index e69f638..1c7d7c7 100755
--- a/atk/atkhypertext.h
+++ b/atk/atkhypertext.h
@@ -45,6 +45,7 @@ extern "C" {
#define _TYPEDEF_ATK_HYPERTEXT_
typedef struct _AtkHypertext AtkHypertext;
#endif
+typedef struct _AtkHypertextIface AtkHypertextIface;
typedef struct _AtkHyperLink AtkHyperLink;
diff --git a/atk/atkimage.h b/atk/atkimage.h
index 51ec881..59bf596 100755
--- a/atk/atkimage.h
+++ b/atk/atkimage.h
@@ -41,6 +41,7 @@ extern "C" {
#define _TYPEDEF_ATK_IMAGE_
typedef struct _AtkImage AtkImage;
#endif
+typedef struct _AtkImageIface AtkImageIface;
typedef enum
{
diff --git a/atk/atkobject.c b/atk/atkobject.c
index 42bb1b5..00b44ed 100755
--- a/atk/atkobject.c
+++ b/atk/atkobject.c
@@ -56,11 +56,6 @@ struct _AtkRelation
};
-typedef struct
-{
- GObject object;
-} _AtkIfaceImplementor;
-
static void atk_object_class_init (AtkObjectClass *klass);
static void atk_object_init (AtkObject *accessible,
AtkObjectClass *klass);
@@ -233,7 +228,7 @@ atk_object_init (AtkObject *accessible,
}
GType
-atk_object_iface_get_type (void)
+atk_implementor_get_type (void)
{
static GType type = 0;
@@ -241,12 +236,12 @@ atk_object_iface_get_type (void)
{
static const GTypeInfo typeInfo =
{
- sizeof (AtkObjectIface),
+ sizeof (AtkImplementorIface),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
} ;
- type = g_type_register_static (G_TYPE_INTERFACE, "AtkObjectIface", &typeInfo, 0) ;
+ type = g_type_register_static (G_TYPE_INTERFACE, "AtkImplementorIface", &typeInfo, 0) ;
}
return type;
@@ -257,7 +252,7 @@ atk_object_get_name (AtkObject *accessible)
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), NULL);
+ g_return_val_if_fail (accessible != NULL, NULL);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -272,7 +267,7 @@ atk_object_get_description (AtkObject *accessible)
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), NULL);
+ g_return_val_if_fail (accessible != NULL, NULL);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -287,7 +282,7 @@ atk_object_get_parent (AtkObject *accessible)
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), NULL);
+ g_return_val_if_fail (accessible != NULL, NULL);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -302,7 +297,7 @@ atk_object_get_n_accessible_children (AtkObject *accessible)
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), 0);
+ g_return_val_if_fail (accessible != NULL, 0);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), 0);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -318,7 +313,7 @@ atk_object_ref_accessible_child (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), NULL);
+ g_return_val_if_fail (accessible != NULL, NULL);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -333,7 +328,7 @@ atk_object_get_relation_set (AtkObject *accessible)
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), NULL);
+ g_return_val_if_fail (accessible != NULL, NULL);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -344,7 +339,7 @@ atk_object_get_relation_set (AtkObject *accessible)
}
AtkRole
-atk_role_register (gchar *name)
+atk_role_register (const gchar *name)
{
/* TODO: associate name with new type */
static guint type = ATK_ROLE_LAST_DEFINED;
@@ -355,7 +350,7 @@ AtkRole
atk_object_get_role (AtkObject *accessible) {
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), ATK_ROLE_UNKNOWN);
+ g_return_val_if_fail (accessible != NULL, ATK_ROLE_UNKNOWN);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), ATK_ROLE_UNKNOWN);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -366,7 +361,7 @@ atk_object_get_role (AtkObject *accessible) {
}
AtkStateType
-atk_state_type_register (gchar *name)
+atk_state_type_register (const gchar *name)
{
/* TODO: associate name with new type */
static guint type = ATK_STATE_LAST_DEFINED;
@@ -380,7 +375,7 @@ AtkState
atk_object_get_state (AtkObject *accessible) {
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), 0);
+ g_return_val_if_fail (accessible != NULL, 0);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), 0);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -395,7 +390,7 @@ atk_object_get_index_in_parent (AtkObject *accessible)
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), -1);
+ g_return_val_if_fail (accessible != NULL, -1);
g_return_val_if_fail (ATK_OBJECT (accessible), -1);
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -411,9 +406,9 @@ atk_object_set_name (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_if_fail ((accessible != NULL));
+ g_return_if_fail (accessible != NULL);
g_return_if_fail (ATK_IS_OBJECT (accessible));
- g_return_if_fail ((name != NULL));
+ g_return_if_fail (name != NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
if (klass->set_name)
@@ -429,9 +424,9 @@ atk_object_set_description (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_if_fail ((accessible != NULL));
+ g_return_if_fail (accessible != NULL);
g_return_if_fail (ATK_IS_OBJECT (accessible));
- g_return_if_fail ((description != NULL));
+ g_return_if_fail (description != NULL);
klass = ATK_OBJECT_GET_CLASS (accessible);
if (klass->set_description)
@@ -447,7 +442,7 @@ atk_object_set_parent (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_if_fail ((accessible != NULL));
+ g_return_if_fail (accessible != NULL);
g_return_if_fail (ATK_IS_OBJECT (accessible));
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -461,7 +456,7 @@ atk_object_set_role (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_if_fail ((accessible != NULL));
+ g_return_if_fail (accessible != NULL);
g_return_if_fail (ATK_IS_OBJECT (accessible));
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -475,7 +470,7 @@ atk_object_connect_property_change_handler (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_val_if_fail ((accessible != NULL), 0);
+ g_return_val_if_fail (accessible != NULL, 0);
g_return_val_if_fail (ATK_IS_OBJECT (accessible), 0);
g_return_val_if_fail ((handler != NULL), 0);
@@ -492,7 +487,7 @@ atk_object_remove_property_change_handler (AtkObject *accessible,
{
AtkObjectClass *klass;
- g_return_if_fail ((accessible != NULL));
+ g_return_if_fail (accessible != NULL);
g_return_if_fail (ATK_IS_OBJECT (accessible));
klass = ATK_OBJECT_GET_CLASS (accessible);
@@ -501,7 +496,7 @@ atk_object_remove_property_change_handler (AtkObject *accessible,
}
AtkRelationType
-atk_relation_type_register (gchar *name)
+atk_relation_type_register (const gchar *name)
{
/* TODO: associate name with new type */
static guint type = ATK_RELATION_LAST_DEFINED;
@@ -513,7 +508,7 @@ atk_relation_new (GArray *target,
AtkRelationType relationship)
{
AtkRelation* relation;
- g_return_val_if_fail ((target != NULL), NULL);
+ g_return_val_if_fail (target != NULL, NULL);
relation = (AtkRelation *) g_malloc (sizeof (AtkRelation));
@@ -533,7 +528,7 @@ atk_relation_set_contains (AtkRelationSet *set,
AtkRelation *item;
gint i;
- g_return_val_if_fail ((set != NULL), FALSE);
+ g_return_val_if_fail (set != NULL, FALSE);
array_item = set->relations;
if (array_item == NULL)
@@ -653,7 +648,7 @@ atk_relation_get_target (AtkRelation *relation)
return relation->target;
}
-gchar*
+G_CONST_RETURN gchar*
atk_state_mask_get_name (AtkStateMask state)
{
gint n;
@@ -671,7 +666,7 @@ atk_state_mask_get_name (AtkStateMask state)
}
AtkStateMask
-atk_state_mask_for_name (gchar *name)
+atk_state_mask_for_name (const gchar *name)
{
gint i;
@@ -686,23 +681,26 @@ atk_state_mask_for_name (gchar *name)
/**
* Return a reference to an object's AtkObject implementation, if
* the object implements AtkObjectIface.
- * @object: The GObject instance which should implement #AtkObjectIface
+ * @object: The GObject instance which should implement #AtkImplementorIface
* if a non-null return value is required.
*/
AtkObject *
-atk_object_ref_accessible (AtkIfaceImplementor *object)
+atk_implementor_ref_accessible (AtkImplementor *object)
{
- AtkObjectIface *iface;
- AtkObject *accessible = NULL;
+ AtkImplementorIface *iface;
+ AtkObject *accessible = NULL;
+
+ g_return_val_if_fail (object != NULL, NULL);
+ g_return_val_if_fail (ATK_IS_IMPLEMENTOR (object), NULL);
- g_return_val_if_fail ((object != NULL), NULL);
- g_return_val_if_fail ((iface = ATK_OBJECT_GET_IFACE (object)), NULL );
+ iface = ATK_IMPLEMENTOR_GET_IFACE (object);
- if (iface != NULL) accessible = (*(iface->ref_accessible)) (object) ;
+ if (iface != NULL)
+ accessible = iface->ref_accessible (object);
g_return_val_if_fail ((accessible != NULL), NULL);
- return ATK_OBJECT (accessible) ;
+ return accessible;
}
AtkRelationSet*
@@ -713,9 +711,9 @@ atk_object_real_get_relation_set (AtkObject *accessible)
static void
atk_object_real_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
AtkObject *accessible;
diff --git a/atk/atkobject.h b/atk/atkobject.h
index dba5452..2167049 100755
--- a/atk/atkobject.h
+++ b/atk/atkobject.h
@@ -221,7 +221,7 @@ typedef enum
ATK_ROLE_LAST_DEFINED
} AtkRole;
-AtkRole atk_role_register (gchar *name);
+AtkRole atk_role_register (const gchar *name);
typedef enum
{
@@ -302,7 +302,7 @@ typedef enum
ATK_STATE_LAST_DEFINED
} AtkStateType;
-AtkStateType atk_state_type_register (gchar *name);
+AtkStateType atk_state_type_register (const gchar *name);
#define ATK_TYPE_OBJECT (atk_object_get_type ())
@@ -312,36 +312,25 @@ AtkStateType atk_state_type_register (gchar *name);
#define ATK_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_OBJECT))
#define ATK_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_OBJECT, AtkObjectClass))
-#define ATK_TYPE_OBJECT_IFACE (atk_object_iface_get_type ())
-#define ATK_OBJECT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_OBJECT_IFACE, AtkObjectIface))
+#define ATK_TYPE_IMPLEMENTOR (atk_implementor_get_type ())
+#define ATK_IS_IMPLEMENTOR(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_IMPLEMENTOR)
+#define ATK_IMPLEMENTOR(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_IMPLEMENTOR, AtkImplementor)
+#define ATK_IMPLEMENTOR_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_IMPLEMENTOR, AtkImplementorIface))
-/* Forward declarations of interface structures */
+typedef struct _AtkImplementor AtkImplementor; /* dummy typedef */
+typedef struct _AtkImplementorIface AtkImplementorIface;
-typedef struct _AtkIfaceImplementor AtkIfaceImplementor;
-typedef struct _AtkObjectIface AtkObjectIface;
+typedef struct _AtkObject AtkObject;
+typedef struct _AtkObjectClass AtkObjectClass;
+typedef struct _AtkRelation AtkRelation;
+typedef struct _AtkRelationSet AtkRelationSet;
-typedef struct _AtkActionIface AtkActionIface;
-typedef struct _AtkComponentIface AtkComponentIface;
-typedef struct _AtkEditableTextIface AtkEditableTextIface;
-typedef struct _AtkHypertextIface AtkHypertextIface;
-typedef struct _AtkImageIface AtkImageIface;
-typedef struct _AtkSelectionIface AtkSelectionIface;
-typedef struct _AtkTableIface AtkTableIface;
-typedef struct _AtkTextIface AtkTextIface;
-typedef struct _AtkValueIface AtkValueIface;
+typedef guint64 AtkStateMask;
+typedef guint64 AtkState;
-
-typedef struct _AtkObject AtkObject;
-typedef struct _AtkObjectClass AtkObjectClass;
-typedef struct _AtkRelation AtkRelation;
-typedef struct _AtkRelationSet AtkRelationSet;
-
-typedef guint64 AtkStateMask;
-typedef guint64 AtkState;
-
-#define ATK_STATE(state_enum) ((AtkStateMask)(1 << ((guint64)(state_enum)%64)))
+#define ATK_STATE(state_enum) ((AtkStateMask)(1 << ((guint64)(state_enum)%64)))
struct _AtkPropertyValues
{
@@ -350,7 +339,7 @@ struct _AtkPropertyValues
GValue new_value;
};
-typedef struct _AtkPropertyValues AtkPropertyValues;
+typedef struct _AtkPropertyValues AtkPropertyValues;
/*
* For most properties the old_value field of AtkPropertyValues will
@@ -467,17 +456,17 @@ void (* remove_property_change_handler) (AtkObject
};
GType atk_object_get_type (void);
-struct _AtkObjectIface
+struct _AtkImplementorIface
{
GTypeInterface parent;
- AtkObject* (*ref_accessible) (AtkIfaceImplementor *accessible);
+ AtkObject* (*ref_accessible) (AtkImplementor *implementor);
};
-GType atk_object_iface_get_type (void);
+GType atk_implementor_get_type (void);
/*
- * This method uses the ref_accessible method in AtkObjectIface,
- * if the object's class implements AtkObjectIface.
+ * This method uses the ref_accessible method in AtkImplementorIface,
+ * if the object's class implements AtkImplementorIface.
* Otherwise it returns %NULL.
*
* IMPORTANT:
@@ -487,7 +476,7 @@ GType atk_object_iface_get_type (void);
* program to unreference the object when no longer needed.
* (c.f. gtk_widget_get_accessible() where this is not the case).
*/
-AtkObject* atk_object_ref_accessible (AtkIfaceImplementor *accessible);
+AtkObject* atk_implementor_ref_accessible (AtkImplementor *implementor);
/*
* Properties directly supported by AtkObject
@@ -586,7 +575,7 @@ typedef enum
ATK_RELATION_LAST_DEFINED
} AtkRelationType;
-AtkRelationType atk_relation_type_register (gchar *name);
+AtkRelationType atk_relation_type_register (const gchar *name);
/*
* Create a new relation for the specified key and the specified list
@@ -635,8 +624,8 @@ AtkRelationType atk_relation_get_type (AtkRelation *relation
*/
GArray* atk_relation_get_target (AtkRelation *relation);
-gchar* atk_state_mask_get_name (AtkStateMask state);
-AtkStateMask atk_state_mask_for_name (gchar *name);
+G_CONST_RETURN gchar* atk_state_mask_get_name (AtkStateMask state);
+AtkStateMask atk_state_mask_for_name (const gchar *name);
#ifdef __cplusplus
}
diff --git a/atk/atkselection.h b/atk/atkselection.h
index 52051c1..d4bf73f 100755
--- a/atk/atkselection.h
+++ b/atk/atkselection.h
@@ -42,6 +42,7 @@ extern "C" {
#define _TYPEDEF_ATK_SELECTION_
typedef struct _AtkSelection AtkSelection;
#endif
+typedef struct _AtkSelectionIface AtkSelectionIface;
struct _AtkSelectionIface
{
diff --git a/atk/atktable.h b/atk/atktable.h
index 3ccdd98..d229dc3 100755
--- a/atk/atktable.h
+++ b/atk/atktable.h
@@ -41,6 +41,7 @@ extern "C" {
#define _TYPEDEF_ATK_TABLE_
typedef struct _AtkTable AtkTable;
#endif
+typedef struct _AtkTableIface AtkTableIface;
struct _AtkTableIface
{
diff --git a/atk/atktext.h b/atk/atktext.h
index 16136b9..601b76a 100755
--- a/atk/atktext.h
+++ b/atk/atktext.h
@@ -38,6 +38,7 @@ extern "C" {
#define _TYPEDEF_ATK_TEXT_
typedef struct _AtkText AtkText;
#endif
+typedef struct _AtkTextIface AtkTextIface;
typedef enum {
ATK_TEXT_BOUNDARY_CHAR,
diff --git a/atk/atkvalue.h b/atk/atkvalue.h
index bbf8be8..ba77973 100755
--- a/atk/atkvalue.h
+++ b/atk/atkvalue.h
@@ -43,6 +43,7 @@ extern "C" {
#define _TYPEDEF_ATK_VALUE__
typedef struct _AtkValue AtkValue;
#endif
+typedef struct _AtkValueIface AtkValueIface;
struct _AtkValueIface
{