Accessibility_Event *e,
CORBA_Environment *ev);
-static char* lookup_toolkit_event_for_name (char *generic_name);
+static char *reverse_lookup_name_for_toolkit_event (char *toolkit_name);
-static char* reverse_lookup_name_for_toolkit_event (char *toolkit_name);
+static const char *
+lookup_toolkit_event_for_name (const char *generic_name)
+{
+ char *toolkit_specific_name;
+ SpiApplicationClass *klass = g_type_class_peek (SPI_APPLICATION_TYPE);
+#ifdef SPI_DEBUG
+ fprintf (stderr, "looking for %s in hash table.\n", generic_name);
+#endif
+ toolkit_specific_name =
+ (char *) g_hash_table_lookup (klass->toolkit_event_names, generic_name);
+#ifdef SPI_DEBUG
+ fprintf (stderr, "generic event %s converted to %s\n", generic_name, toolkit_specific_name);
+#endif
+ return toolkit_specific_name;
+}
/*
* Implemented GObject::finalize
impl_accessibility_application_get_toolkit_name (PortableServer_Servant servant,
CORBA_Environment *ev)
{
- CORBA_char *retval;
- SpiApplication *application = SPI_APPLICATION (bonobo_object_from_servant (servant));
- retval = CORBA_string_dup (atk_get_toolkit_name ());
- return retval;
+ return CORBA_string_dup (atk_get_toolkit_name ());
}
static CORBA_string
impl_accessibility_application_get_version (PortableServer_Servant servant,
CORBA_Environment *ev)
{
- CORBA_char *retval;
- SpiApplication *application = SPI_APPLICATION (bonobo_object_from_servant (servant));
- retval = CORBA_string_dup (atk_get_toolkit_version ());
- return retval;
+ return CORBA_string_dup (atk_get_toolkit_version ());
}
static CORBA_long
impl_accessibility_application_get_id (PortableServer_Servant servant,
CORBA_Environment *ev)
{
- CORBA_long retval;
- SpiApplication *application = SPI_APPLICATION (bonobo_object_from_servant (servant));
- retval = (CORBA_long) application->id;
- return retval;
+ SpiApplication *application = SPI_APPLICATION (
+ bonobo_object_from_servant (servant));
+ return application->id;
}
static void
const CORBA_long id,
CORBA_Environment *ev)
{
- SpiApplication *application = SPI_APPLICATION (bonobo_object_from_servant (servant));
- application->id = id;
+ SpiApplication *application = SPI_APPLICATION (
+ bonobo_object_from_servant (servant));
+ application->id = id;
}
#define APP_STATIC_BUFF_SZ 64
SpiAccessible *source;
CORBA_Environment ev;
GSignalQuery signal_query;
- gchar *name;
+ const gchar *name;
char sbuf[APP_STATIC_BUFF_SZ];
char *generic_name;
}
else
{
+ aobject = NULL;
g_error("received event from non-AtkImplementor");
}
SpiAccessible *source;
CORBA_Environment ev;
GSignalQuery signal_query;
- gchar *name;
+ const char *name;
char sbuf[APP_STATIC_BUFF_SZ];
g_signal_query (signal_hint->signal_id, &signal_query);
e->detail1 = 0;
e->detail2 = 0;
if (the_app) notify_listeners (the_app->toolkit_listeners, e, &ev);
- bonobo_object_unref (source);
+ bonobo_object_unref (BONOBO_OBJECT (source));
g_object_unref (G_OBJECT (aobject));
}
return TRUE;
{
guint spi_listener_id;
spi_listener_id =
- atk_add_global_event_listener (spi_application_toolkit_event_listener, event_name);
+ atk_add_global_event_listener (spi_application_toolkit_event_listener, (char *) event_name);
the_app->toolkit_listeners = g_list_append (the_app->toolkit_listeners,
CORBA_Object_duplicate (listener, ev));
#ifdef SPI_DEBUG
const CORBA_char *event_name,
CORBA_Environment *ev)
{
- guint spi_listener_id;
- char *toolkit_specific_event_name = lookup_toolkit_event_for_name (event_name);
+ guint spi_listener_id = 0;
+ const char *toolkit_specific_event_name =
+ lookup_toolkit_event_for_name (event_name);
if (toolkit_specific_event_name)
{
spi_listener_id =
}
static char *
-lookup_toolkit_event_for_name (char *generic_name)
-{
- char *toolkit_specific_name;
- SpiApplicationClass *klass = g_type_class_peek (SPI_APPLICATION_TYPE);
-#ifdef SPI_DEBUG
- fprintf (stderr, "looking for %s in hash table.\n", generic_name);
-#endif
- toolkit_specific_name =
- (char *) g_hash_table_lookup (klass->toolkit_event_names, generic_name);
-#ifdef SPI_DEBUG
- fprintf (stderr, "generic event %s converted to %s\n", generic_name, toolkit_specific_name);
-#endif
- return toolkit_specific_name;
-}
-
-static char *
reverse_lookup_name_for_toolkit_event (char *toolkit_specific_name)
{
char *generic_name;
the_app = application;
}
-GType
-spi_application_get_type (void)
-{
- static GType type = 0;
-
- if (!type) {
- static const GTypeInfo tinfo = {
- sizeof (SpiApplicationClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) spi_application_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class data */
- sizeof (SpiApplication),
- 0, /* n preallocs */
- (GInstanceInitFunc) spi_application_init,
- NULL /* value table */
- };
- /*
- * Bonobo_type_unique auto-generates a load of
- * CORBA structures for us. All derived types must
- * use bonobo_type_unique.
- */
- type = bonobo_type_unique (
- PARENT_TYPE,
- POA_Accessibility_Application__init,
- NULL,
- G_STRUCT_OFFSET (SpiApplicationClass, epv),
- &tinfo,
- "SpiApplication");
- }
-
- return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiApplication,
+ Accessibility_Application,
+ PARENT_TYPE, spi_application);
SpiApplication *
spi_application_new (AtkObject *app_root)