* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib-object.h>
#include <glib/gi18n-lib.h>
-#ifdef G_OS_WIN32
-#define STRICT
-#include <windows.h>
-#undef STRICT
-#undef FOCUS_EVENT /* <windows.h> pollutes the namespace
- * like a six hundred pound gorilla */
-#endif
-
#include "atk.h"
#include "atkmarshal.h"
+#include "atkprivate.h"
/**
* SECTION:atkobject
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 ()
{
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);
}
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,
_("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,
* 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",
}
/**
- * 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
*
* @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,
const gchar*
atk_role_get_localized_name (AtkRole role)
{
- gettext_initialization ();
+ _gettext_initialization ();
return dgettext (GETTEXT_PACKAGE, atk_role_get_name (role));
}