#include <string.h>
#include <config.h>
+#include <glib.h>
#include <atk/atkutil.h>
#include <libspi/application.h>
+#include <locale.h>
#include "spi-private.h"
/* Our parent Gtk object type */
g_list_free (application->toolkit_listeners);
application->toolkit_listeners = NULL;
- g_print ("application finalize called\n");
(G_OBJECT_CLASS (spi_application_parent_class))->finalize (object);
}
e.source = CORBA_OBJECT_NIL;
e.detail1 = 0;
e.detail2 = 0;
- spi_init_any_nil (&e.any_data);
+ spi_init_any_nil (&e.any_data,
+ spi_accessible_new_return (atk_get_root (), FALSE, NULL),
+ Accessibility_ROLE_UNKNOWN,
+ "");
notify_listeners (the_app->toolkit_listeners, source, &e);
bonobo_object_unref (BONOBO_OBJECT (source));
return TRUE;
}
+static CORBA_string
+impl_accessibility_application_get_locale (PortableServer_Servant servant,
+ Accessibility_LOCALE_TYPE lctype,
+ CORBA_Environment *ev)
+{
+ int category;
+ switch (lctype)
+ {
+ case Accessibility_LOCALE_TYPE_COLLATE:
+ category = LC_COLLATE;
+ break;
+ case Accessibility_LOCALE_TYPE_CTYPE:
+ category = LC_CTYPE;
+ break;
+ case Accessibility_LOCALE_TYPE_MONETARY:
+ category = LC_MONETARY;
+ break;
+ case Accessibility_LOCALE_TYPE_NUMERIC:
+ category = LC_NUMERIC;
+ break;
+ case Accessibility_LOCALE_TYPE_MESSAGES:
+ default:
+ category = LC_MESSAGES;
+ break;
+ }
+ return CORBA_string_dup (setlocale (category, NULL));
+}
+
static void
impl_accessibility_application_register_toolkit_event_listener (PortableServer_Servant servant,
Accessibility_EventListener listener,
epv->_get_id = impl_accessibility_application_get_id;
epv->_set_id = impl_accessibility_application_set_id;
epv->registerToolkitEventListener = impl_accessibility_application_register_toolkit_event_listener;
+ epv->getLocale = impl_accessibility_application_get_locale;
init_toolkit_names (&klass->generic_event_names, &klass->toolkit_event_names);
}
BONOBO_TYPE_FUNC_FULL (SpiApplication,
Accessibility_Application,
- PARENT_TYPE, spi_application);
+ PARENT_TYPE, spi_application)
SpiApplication *
spi_application_new (AtkObject *app_root)
{
return SPI_APPLICATION (spi_accessible_construct (
- SPI_APPLICATION_TYPE, app_root));
+ SPI_APPLICATION_TYPE, app_root));
}