summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadraig O'Briain <padraig.obriain@sun.com>2003-12-01 12:59:25 +0000
committerPadraig O'Briain <padraigo@src.gnome.org>2003-12-01 12:59:25 +0000
commit0b2c017c9eef2dfe3c95b6b9423336fec0da3342 (patch)
tree8ad99e6fe7654ca8b108bb8028ff89f70889a61d
parent97af614e5990927c4e23dc9ba7d50515862f8278 (diff)
downloadatk-0b2c017c9eef2dfe3c95b6b9423336fec0da3342.tar.gz
Make nicks and blurbs of properties translatable. Add new property
2003-12-03 Padraig O'Briain <padraig.obriain@sun.com> * atk/atkobject.c: (atk_object_class_init): Make nicks and blurbs of properties translatable. Add new property "accessible-hypertext-nlinks". (atk_object_real_get_property): Add support for new property "accessible-hypertext-nlinks". * atk/atkhyperlink.h: Remove unnecessary comments. Add signal link_activated. * atk/atkhyperlink.c: aAdd signals link_activated and new properties "number-of-anchors, end-index and start-index. This fixes bug #112390.
-rw-r--r--ChangeLog15
-rwxr-xr-xatk/atkhyperlink.c65
-rwxr-xr-xatk/atkhyperlink.h37
-rwxr-xr-xatk/atkobject.c73
4 files changed, 124 insertions, 66 deletions
diff --git a/ChangeLog b/ChangeLog
index d642e2b..8bf5155 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2003-12-03 Padraig O'Briain <padraig.obriain@sun.com>
+
+ * atk/atkobject.c: (atk_object_class_init): Make nicks and blurbs of
+ properties translatable. Add new property "accessible-hypertext-nlinks".
+ (atk_object_real_get_property): Add support for new property
+ "accessible-hypertext-nlinks".
+
+ * atk/atkhyperlink.h: Remove unnecessary comments. Add signal
+ link_activated.
+
+ * atk/atkhyperlink.c: aAdd signals link_activated and new properties
+ "number-of-anchors, end-index and start-index.
+
+ This fixes bug #112390.
+
2003-11-29 Danilo Ĺ egan <dsegan@gmx.net>
* configure.in: Added "af" to ALL_LINGUAS.
diff --git a/atk/atkhyperlink.c b/atk/atkhyperlink.c
index 0b61853..6307c3b 100755
--- a/atk/atkhyperlink.c
+++ b/atk/atkhyperlink.c
@@ -18,12 +18,23 @@
*/
#include "atkhyperlink.h"
+#include "atkintl.h"
+
+enum
+{
+ LINK_ACTIVATED,
+
+ LAST_SIGNAL
+};
enum
{
PROP_0, /* gobject convention */
PROP_SELECTED_LINK,
+ PROP_NUMBER_ANCHORS,
+ PROP_END_INDEX,
+ PROP_START_INDEX,
PROP_LAST
};
@@ -38,6 +49,8 @@ static void atk_hyperlink_real_get_property (GObject *object,
static void atk_hyperlink_action_iface_init (AtkActionIface *iface);
+static guint atk_hyperlink_signals[LAST_SIGNAL] = { 0, };
+
static gpointer parent_class = NULL;
GType
@@ -82,13 +95,52 @@ atk_hyperlink_class_init (AtkHyperlinkClass *klass)
gobject_class->get_property = atk_hyperlink_real_get_property;
+ klass->link_activated = NULL;
+
g_object_class_install_property (gobject_class,
PROP_SELECTED_LINK,
g_param_spec_boolean ("selected-link",
- "Selected Link",
- "Specifies whether the AtkHyperlink object is selected",
+ _("Selected Link"),
+ _("Specifies whether the AtkHyperlink object is selected"),
FALSE,
G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class,
+ PROP_NUMBER_ANCHORS,
+ g_param_spec_int ("number-of-anchors",
+ _("Number of Anchors"),
+ _("The number of anchors associated with the AtkHyperlink object"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class,
+ PROP_END_INDEX,
+ g_param_spec_int ("end-index",
+ _("End index"),
+ _("The end index of the AtkHyperlink object"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+ g_object_class_install_property (gobject_class,
+ PROP_END_INDEX,
+ g_param_spec_int ("start-index",
+ _("Start index"),
+ _("The start index of the AtkHyperlink object"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
+ atk_hyperlink_signals[LINK_ACTIVATED] =
+ g_signal_new ("link_activated",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (AtkHyperlinkClass, link_activated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+
}
static void
@@ -112,6 +164,15 @@ atk_hyperlink_real_get_property (GObject *object,
case PROP_SELECTED_LINK:
g_value_set_boolean (value, atk_hyperlink_is_selected_link (link));
break;
+ case PROP_NUMBER_ANCHORS:
+ g_value_set_int (value, atk_hyperlink_get_n_anchors (link));
+ break;
+ case PROP_END_INDEX:
+ g_value_set_int (value, atk_hyperlink_get_end_index (link));
+ break;
+ case PROP_START_INDEX:
+ g_value_set_int (value, atk_hyperlink_get_start_index (link));
+ break;
default:
break;
}
diff --git a/atk/atkhyperlink.h b/atk/atkhyperlink.h
index f3c24e8..a5d3716 100755
--- a/atk/atkhyperlink.h
+++ b/atk/atkhyperlink.h
@@ -62,51 +62,20 @@ struct _AtkHyperlinkClass
{
GObjectClass parent;
- /*
- * Returns a string specifying the URI associated with the nth anchor
- * of this link.
- */
gchar* (* get_uri) (AtkHyperlink *link_,
gint i);
- /*
- * Returns an object which represents the link action, as appropriate for
- * that link.
- */
AtkObject* (* get_object) (AtkHyperlink *link_,
gint i);
- /*
- * Gets the index with the hypertext document at which this link ends
- */
gint (* get_end_index) (AtkHyperlink *link_);
-
- /*
- * Gets the index with the hypertext document at which this link begins
- */
gint (* get_start_index) (AtkHyperlink *link_);
-
- /*
- * Since the document a link is associated with may have changed, this
- * method returns whether or not this link is still valid (with respect
- * to the document is references)
- */
gboolean (* is_valid) (AtkHyperlink *link_);
-
- /*
- * Returns the number of anchors associated with this link
- */
gint (* get_n_anchors) (AtkHyperlink *link_);
-
- /*
- * Returns a set of bitflags which encode state information.
- * Used by non-virtualized state query methods, not intended,
- * for direct client use. It is virtualized, but clients should use
- * atk_hyperlink_is_inline (), etc.
- */
guint (* link_state) (AtkHyperlink *link_);
-
gboolean (* is_selected_link) (AtkHyperlink *link_);
+
+ /* Signals */
+ void ( *link_activated) (AtkHyperlink *link_);
AtkFunction pad1;
- AtkFunction pad2;
};
GType atk_hyperlink_get_type (void);
diff --git a/atk/atkobject.c b/atk/atkobject.c
index 6b302e5..4f877ab 100755
--- a/atk/atkobject.c
+++ b/atk/atkobject.c
@@ -54,6 +54,7 @@ enum
PROP_TABLE_ROW_HEADER,
PROP_TABLE_SUMMARY,
PROP_TABLE_CAPTION_OBJECT,
+ PROP_HYPERTEXT_NUM_LINKS,
PROP_LAST /* gobject convention */
};
@@ -219,6 +220,7 @@ static const gchar* atk_object_name_property_table_row_description = "accessible
static const gchar* atk_object_name_property_table_row_header = "accessible-table-row-header";
static const gchar* atk_object_name_property_table_summary = "accessible-table-summary";
static const gchar* atk_object_name_property_table_caption_object = "accessible-table-caption-object";
+static const gchar* atk_object_name_property_hypertext_num_links = "accessible-hypertext-nlinks";
GType
atk_object_get_type (void)
@@ -289,31 +291,29 @@ atk_object_class_init (AtkObjectClass *klass)
g_object_class_install_property (gobject_class,
PROP_NAME,
g_param_spec_string (atk_object_name_property_name,
- "Accessible Name",
- "Object instance\'s name formatted for "
- "assistive technology access",
+ _("Accessible Name"),
+ _("Object instance\'s name formatted for assistive technology access"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_DESCRIPTION,
g_param_spec_string (atk_object_name_property_description,
- "Accessible Description",
- "Description of an object, formatted for "
- "assistive technology access",
+ _("Accessible Description"),
+ _("Description of an object, formatted for assistive technology access"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_PARENT,
g_param_spec_object (atk_object_name_property_parent,
- "Accessible Parent",
- "Is used to notify that the parent has changed ",
+ _("Accessible Parent"),
+ _("Is used to notify that the parent has changed"),
ATK_TYPE_OBJECT,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_VALUE,
g_param_spec_double (atk_object_name_property_value,
- "Accessible Value",
- "Is used to notify that the value has changed ",
+ _("Accessible Value"),
+ _("Is used to notify that the value has changed"),
0.0,
G_MAXDOUBLE,
0.0,
@@ -321,8 +321,8 @@ atk_object_class_init (AtkObjectClass *klass)
g_object_class_install_property (gobject_class,
PROP_ROLE,
g_param_spec_int (atk_object_name_property_role,
- "Accessible Role",
- "The accessible role of this object ",
+ _("Accessible Role"),
+ _("The accessible role of this object"),
0,
G_MAXINT,
0,
@@ -330,8 +330,8 @@ atk_object_class_init (AtkObjectClass *klass)
g_object_class_install_property (gobject_class,
PROP_LAYER,
g_param_spec_int (atk_object_name_property_component_layer,
- "Accessible Layer",
- "The accessible layer of this object ",
+ _("Accessible Layer"),
+ _("The accessible layer of this object"),
0,
G_MAXINT,
0,
@@ -339,8 +339,8 @@ atk_object_class_init (AtkObjectClass *klass)
g_object_class_install_property (gobject_class,
PROP_MDI_ZORDER,
g_param_spec_int (atk_object_name_property_component_mdi_zorder,
- "Accessible MDI Value",
- "The accessible MDI value of this object ",
+ _("Accessible MDI Value"),
+ _("The accessible MDI value of this object"),
G_MININT,
G_MAXINT,
G_MININT,
@@ -348,52 +348,61 @@ atk_object_class_init (AtkObjectClass *klass)
g_object_class_install_property (gobject_class,
PROP_TABLE_CAPTION,
g_param_spec_string (atk_object_name_property_table_caption,
- "Accessible Table Caption",
- "Is used to notify that the table caption has changed; this property should not be used. accessible-table-caption-object should be used instead",
+ _("Accessible Table Caption"),
+ _("Is used to notify that the table caption has changed; this property should not be used. accessible-table-caption-object should be used instead"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TABLE_COLUMN_HEADER,
g_param_spec_object (atk_object_name_property_table_column_header,
- "Accessible Table Column Header",
- "Is used to notify that the table column header has changed ",
+ _("Accessible Table Column Header"),
+ _("Is used to notify that the table column header has changed"),
ATK_TYPE_OBJECT,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TABLE_COLUMN_DESCRIPTION,
g_param_spec_string (atk_object_name_property_table_column_description,
- "Accessible Table Column Description",
- "Is used to notify that the table columnscription has changed ",
+ _("Accessible Table Column Description"),
+ _("Is used to notify that the table column description has changed"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TABLE_ROW_HEADER,
g_param_spec_object (atk_object_name_property_table_row_header,
- "Accessible Table Row Header",
- "Is used to notify that the table row header has changed ",
+ _("Accessible Table Row Header"),
+ _("Is used to notify that the table row header has changed"),
ATK_TYPE_OBJECT,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TABLE_ROW_DESCRIPTION,
g_param_spec_string (atk_object_name_property_table_row_description,
- "Accessible Table Row Description",
- "Is used to notify that the table row description has changed ",
+ _("Accessible Table Row Description"),
+ _("Is used to notify that the table row description has changed"),
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TABLE_SUMMARY,
g_param_spec_object (atk_object_name_property_table_summary,
- "Accessible Table Summary",
- "Is used to notify that the table summary has changed ",
+ _("Accessible Table Summary"),
+ _("Is used to notify that the table summary has changed"),
ATK_TYPE_OBJECT,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TABLE_CAPTION_OBJECT,
g_param_spec_object (atk_object_name_property_table_caption_object,
- "Accessible Table Caption Object",
- "Is used to notify that the table caption has changed ",
+ _("Accessible Table Caption Object"),
+ _("Is used to notify that the table caption has changed"),
ATK_TYPE_OBJECT,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_HYPERTEXT_NUM_LINKS,
+ g_param_spec_int (atk_object_name_property_hypertext_num_links,
+ _("Accessible Hypertext Number of Links"),
+ _("The number of links which the current AtkHypertext has"),
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE));
atk_object_signals[CHILDREN_CHANGED] =
g_signal_new ("children_changed",
G_TYPE_FROM_CLASS (klass),
@@ -1047,6 +1056,10 @@ atk_object_real_get_property (GObject *object,
if (ATK_IS_TABLE (accessible))
g_value_set_object (value, atk_table_get_caption (ATK_TABLE (accessible)));
break;
+ case PROP_HYPERTEXT_NUM_LINKS:
+ if (ATK_IS_HYPERTEXT (accessible))
+ g_value_set_set (value, atk_hypertext_get_n_links (ATK_HYPERTEXT (accessible)));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;