X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=atk%2Fatkobject.c;h=fb61babfe0942df19b15bdbdfee100b4097e830c;hb=dd7c22e2586adf23bc7d9f52c793cbf127b2a753;hp=e034c91075684321c98ed724e378c9ee8a0913e8;hpb=8e41ac14d7290ca24806338f1a231111e96d3790;p=platform%2Fupstream%2Fatk.git diff --git a/atk/atkobject.c b/atk/atkobject.c old mode 100755 new mode 100644 index e034c91..fb61bab --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -17,22 +17,17 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include #include - -#ifdef G_OS_WIN32 -#define STRICT -#include -#undef STRICT -#undef FOCUS_EVENT /* pollutes the namespace - * like a six hundred pound gorilla */ -#endif +#include #include "atk.h" #include "atkmarshal.h" -#include "atkintl.h" +#include "atkprivate.h" /** * SECTION:atkobject @@ -277,98 +272,6 @@ static const gchar* const atk_object_name_property_table_summary = "accessible-t static const gchar* const atk_object_name_property_table_caption_object = "accessible-table-caption-object"; static const gchar* const atk_object_name_property_hypertext_num_links = "accessible-hypertext-nlinks"; -#ifdef G_OS_WIN32 - -static HMODULE atk_dll; - -BOOL WINAPI -DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - atk_dll = (HMODULE) hinstDLL; - break; - } - - return TRUE; -} - -static const char * -get_atk_locale_dir (void) -{ - static gchar *atk_localedir = NULL; - - if (!atk_localedir) - { - const gchar *p; - gchar *root, *temp; - - /* ATK_LOCALEDIR might end in either /lib/locale or - * /share/locale. Scan for that slash. - */ - p = ATK_LOCALEDIR + strlen (ATK_LOCALEDIR); - while (*--p != '/') - ; - while (*--p != '/') - ; - - root = g_win32_get_package_installation_directory_of_module (atk_dll); - temp = g_build_filename (root, p, NULL); - g_free (root); - - /* atk_localedir is passed to bindtextdomain() which isn't - * UTF-8-aware. - */ - atk_localedir = g_win32_locale_filename_from_utf8 (temp); - g_free (temp); - } - return atk_localedir; -} - -#undef ATK_LOCALEDIR - -#define ATK_LOCALEDIR get_atk_locale_dir() - -#endif - -static void -gettext_initialization (void) -{ -#ifdef ENABLE_NLS - static gboolean gettext_initialized = FALSE; - - if (!gettext_initialized) - { - const char *dir = g_getenv ("ATK_ALT_LOCALEDIR"); - - gettext_initialized = TRUE; - if (dir == NULL) - dir = ATK_LOCALEDIR; - - bindtextdomain (GETTEXT_PACKAGE, dir); -#ifdef HAVE_BIND_TEXTDOMAIN_CODESET - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); -#endif - } -#endif -} - -static void -compact_role_name (gchar *role_name) -{ - gchar *p = role_name; - - while (*p) - { - if (*p == '-') - *p = ' '; - p++; - } -} - static void initialize_role_names () { @@ -390,7 +293,7 @@ initialize_role_names () enum_value = g_enum_get_value (G_ENUM_CLASS (enum_class), i); role_name = g_strdup (enum_value->value_nick); // We want the role names to be in the format "check button" and not "check-button" - compact_role_name (role_name); + _compact_name (role_name); g_ptr_array_add (role_names, role_name); } @@ -461,13 +364,13 @@ atk_object_class_init (AtkObjectClass *klass) klass->visible_data_changed = NULL; klass->active_descendant_changed = NULL; - gettext_initialization (); + _gettext_initialization (); 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"), + _("Object instance’s name formatted for assistive technology access"), NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, @@ -484,6 +387,16 @@ atk_object_class_init (AtkObjectClass *klass) _("Parent of the current accessible as returned by atk_object_get_parent()"), ATK_TYPE_OBJECT, G_PARAM_READWRITE)); + + /** + * AtkObject:accessible-value: + * + * Numeric value of this object, in case being and AtkValue. + * + * Deprecated: Since 2.12. Use atk_value_get_value_and_text() to get + * the value, and value-changed signal to be notified on their value + * changes. + */ g_object_class_install_property (gobject_class, PROP_VALUE, g_param_spec_double (atk_object_name_property_value, @@ -520,6 +433,14 @@ atk_object_class_init (AtkObjectClass *klass) G_MAXINT, G_MININT, G_PARAM_READABLE)); + + /** + * AtkObject:accessible-table-caption: + * + * Table caption. + * + * Deprecated: Since 1.3. Use table-caption-object instead. + */ g_object_class_install_property (gobject_class, PROP_TABLE_CAPTION, g_param_spec_string (atk_object_name_property_table_caption, @@ -527,6 +448,14 @@ atk_object_class_init (AtkObjectClass *klass) _("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)); + /** + * AtkObject:accessible-table-column-header: + * + * Accessible table column header. + * + * Deprecated: Since 2.12. Use atk_table_get_column_header() and + * atk_table_set_column_header() instead. + */ g_object_class_install_property (gobject_class, PROP_TABLE_COLUMN_HEADER, g_param_spec_object (atk_object_name_property_table_column_header, @@ -534,6 +463,15 @@ atk_object_class_init (AtkObjectClass *klass) _("Is used to notify that the table column header has changed"), ATK_TYPE_OBJECT, G_PARAM_READWRITE)); + + /** + * AtkObject:accessible-table-column-description: + * + * Accessible table column description. + * + * Deprecated: Since 2.12. Use atk_table_get_column_description() + * and atk_table_set_column_description() instead. + */ g_object_class_install_property (gobject_class, PROP_TABLE_COLUMN_DESCRIPTION, g_param_spec_string (atk_object_name_property_table_column_description, @@ -541,6 +479,15 @@ atk_object_class_init (AtkObjectClass *klass) _("Is used to notify that the table column description has changed"), NULL, G_PARAM_READWRITE)); + + /** + * AtkObject:accessible-table-row-header: + * + * Accessible table row header. + * + * Deprecated: Since 2.12. Use atk_table_get_row_header() and + * atk_table_set_row_header() instead. + */ g_object_class_install_property (gobject_class, PROP_TABLE_ROW_HEADER, g_param_spec_object (atk_object_name_property_table_row_header, @@ -548,6 +495,14 @@ atk_object_class_init (AtkObjectClass *klass) _("Is used to notify that the table row header has changed"), ATK_TYPE_OBJECT, G_PARAM_READWRITE)); + /** + * AtkObject:accessible-table-row-description: + * + * Accessible table row description. + * + * Deprecated: Since 2.12. Use atk_table_get_row_description() and + * atk_table_set_row_description() instead. + */ g_object_class_install_property (gobject_class, PROP_TABLE_ROW_DESCRIPTION, g_param_spec_string (atk_object_name_property_table_row_description, @@ -613,7 +568,7 @@ atk_object_class_init (AtkObjectClass *klass) * The signal "focus-event" is emitted when an object gained or lost * focus. * - * Deprecated: Since 2.9.4. Use #AtkObject::state-change signal instead. + * Deprecated: 2.9.4: Use the #AtkObject::state-change signal instead. */ atk_object_signals[FOCUS_EVENT] = g_signal_new ("focus_event", @@ -1191,7 +1146,7 @@ atk_object_set_role (AtkObject *accessible, } /** - * atk_object_connect_property_change_handler: + * atk_object_connect_property_change_handler: (skip) * @accessible: an #AtkObject * @handler: a function to be called when a property changes its value * @@ -1245,7 +1200,10 @@ atk_object_remove_property_change_handler (AtkObject *accessible, * @state: an #AtkState whose state is changed * @value: a gboolean which indicates whether the state is being set on or off * - * Emits a state-change signal for the specified state. + * Emits a state-change signal for the specified state. + * + * Note that as a general rule when the state of an existing object changes, + * emitting a notification is expected. **/ void atk_object_notify_state_change (AtkObject *accessible, @@ -1611,7 +1569,7 @@ atk_role_get_name (AtkRole role) const gchar* atk_role_get_localized_name (AtkRole role) { - gettext_initialization (); + _gettext_initialization (); return dgettext (GETTEXT_PACKAGE, atk_role_get_name (role)); }