+<2001-09-30 Bill Haneman <bill.haneman@sun.com>
+
+ * libspi/accessible.c:
+ Stubbed-in the implementations for
+ Accessibility_Accessible_getState and
+ Accessibility_Accessible_getRelationSet.
+ * libspi/registry.c:
+ Improved de-registration process and fixed some bugs,
+ deregistration should work correctly
+ once the compare_object_func()'s CORBA_Object_hash
+ usage is fixed (currently still broken).
+ (Probably the event listener registration still needs
+ fixing.)
+ * libspi/desktop.c:
+ Added initialization of applications list (to NULL).
+ * util/magnifier.c:
+ Reduced speech compression from 0.5 to 0.7, for demo.
+ Changed call to gdk_window_set_decorations()
+ to gtk_window_set_decorated().
+ * at-bridge/bridge.c:
+ Bridge now deregisters when app exits, via
+ registration of a cleanup function
+ with the g_atexit() call.
+ Required making 'app' static, renamed 'this_app'.
+ Fixed broken use of bonobo_init, passing argv wrongly.
+
<2001-09-27 Bill Haneman <bill.haneman@sun.com>
* util:
static CORBA_Environment ev;
static Accessibility_Registry registry;
+static Application *this_app;
static gboolean bridge_register_app (gpointer p);
static void bridge_focus_tracker (AtkObject *object);
+static void bridge_exit_func(void);
int
gtk_module_init(gint *argc, gchar **argv[])
args->c = *argc;
args->v = *argv;
g_idle_add (bridge_register_app, args);
+ g_atexit (bridge_exit_func);
}
static gboolean
char *obj_id;
ArgStruct *args = (ArgStruct *)gp;
- Application *app;
-
CORBA_exception_init(&ev);
- if (!bonobo_init (&(args->c), &args->v))
+ if (!bonobo_init (&(args->c), args->v))
{
g_error ("Could not initialize Bonobo");
}
/* Create the accesssible application server object */
- app = application_new(atk_get_root ());
+ this_app = application_new(atk_get_root ());
obj_id = "OAFIID:Accessibility_Registry:proto0.1";
atk_add_focus_tracker (bridge_focus_tracker);
Accessibility_Registry_registerApplication (registry,
- bonobo_object_corba_objref (bonobo_object (app)),
+ bonobo_object_corba_objref (bonobo_object (this_app)),
&ev);
return FALSE;
}
+static void bridge_exit_func()
+{
+ fprintf (stderr, "exiting bridge\n");
+ Accessibility_Registry_deregisterApplication (registry,
+ bonobo_object_corba_objref (
+ bonobo_object (this_app)),
+ &ev);
+ fprintf (stderr, "bridge exit func complete.\n");
+}
+
static void bridge_focus_tracker (AtkObject *object)
{
Accessibility_Event *e = Accessibility_Event__alloc();
static CORBA_Environment ev;
static Accessibility_Registry registry;
+static Application *this_app;
static gboolean bridge_register_app (gpointer p);
static void bridge_focus_tracker (AtkObject *object);
+static void bridge_exit_func(void);
int
gtk_module_init(gint *argc, gchar **argv[])
args->c = *argc;
args->v = *argv;
g_idle_add (bridge_register_app, args);
+ g_atexit (bridge_exit_func);
}
static gboolean
char *obj_id;
ArgStruct *args = (ArgStruct *)gp;
- Application *app;
-
CORBA_exception_init(&ev);
- if (!bonobo_init (&(args->c), &args->v))
+ if (!bonobo_init (&(args->c), args->v))
{
g_error ("Could not initialize Bonobo");
}
/* Create the accesssible application server object */
- app = application_new(atk_get_root ());
+ this_app = application_new(atk_get_root ());
obj_id = "OAFIID:Accessibility_Registry:proto0.1";
atk_add_focus_tracker (bridge_focus_tracker);
Accessibility_Registry_registerApplication (registry,
- bonobo_object_corba_objref (bonobo_object (app)),
+ bonobo_object_corba_objref (bonobo_object (this_app)),
&ev);
return FALSE;
}
+static void bridge_exit_func()
+{
+ fprintf (stderr, "exiting bridge\n");
+ Accessibility_Registry_deregisterApplication (registry,
+ bonobo_object_corba_objref (
+ bonobo_object (this_app)),
+ &ev);
+ fprintf (stderr, "bridge exit func complete.\n");
+}
+
static void bridge_focus_tracker (AtkObject *object)
{
Accessibility_Event *e = Accessibility_Event__alloc();
return retval;
}
+/*
+ * CORBA Accessibility::Accessible::getState method implementation
+ */
+static Accessibility_StateSet
+impl_accessibility_accessible_get_state (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ Accessibility_StateSet retval;
+ Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant));
+ AtkStateSet *state = atk_object_ref_state_set (accessible->atko);
+ retval = CORBA_OBJECT_NIL;
+ printf ("Accessible get_state.\n");
+ /* TODO: implement the bonobo stateset class */
+ return (Accessibility_StateSet) retval;
+}
+
+/*
+ * CORBA Accessibility::Accessible::getRelationSet method implementation
+ */
+static Accessibility_RelationSet *
+impl_accessibility_accessible_get_relation_set (PortableServer_Servant servant,
+ const CORBA_long index,
+ CORBA_Environment *ev)
+{
+ Accessibility_RelationSet *retval;
+ Accessible *accessible = ACCESSIBLE (bonobo_object_from_servant (servant));
+ AtkRelationSet *relation_set = atk_object_ref_relation_set (accessible->atko);
+ retval = CORBA_sequence_Accessibility_Relation__alloc ();
+ /*
+ * TODO: fill the sequence with relation set objects, themselves
+ * initialized from the AtkRelation object in the AtkRelationSet.
+ */
+ printf ("Accessible get_relation_set.\n");
+ return retval;
+}
+
/*
* CORBA Accessibility::Accessible::getRole method implementation
*/
epv->getChildAtIndex = impl_accessibility_accessible_get_child_at_index;
epv->getIndexInParent = impl_accessibility_accessible_get_index_in_parent;
- /* epv->getRelationSet = impl_accessibility_accessible_get_relation_set; */
- /* epv->getState = impl_accessibility_accessible_get_state; */
+ epv->getRelationSet = impl_accessibility_accessible_get_relation_set;
+ epv->getState = impl_accessibility_accessible_get_state;
epv->getRole = impl_accessibility_accessible_get_role;
}
desktop_init (Desktop *desktop)
{
ACCESSIBLE (desktop)->atko = g_object_new (atk_object_get_type(), NULL);
+ desktop->applications = NULL;
atk_object_set_name (ATK_OBJECT (ACCESSIBLE (desktop)->atko), "main");
}
*/
/*
- * registry.c: test for accessibility implementation
- *
+ * registry.c: the main accessibility service registry implementation
*/
#ifdef SPI_DEBUG
CORBA_Environment ev;
long long diff = ((CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev)) -
(CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev)));
+
+#ifdef SPI_DEBUG
+ fprintf (stderr, "comparing %p to %p, via hashes %ld and %ld; diff %ld\n",
+ p1, p2,
+ CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev),
+ CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev),
+ (long) diff);
+#endif
+
return ((diff < 0) ? -1 : ((diff > 0) ? 1 : 0));
}
CORBA_Environment * ev)
{
Registry *registry = REGISTRY (bonobo_object_from_servant (servant));
- GList *list = g_list_find_custom (registry->applications, application, compare_object_hash);
+ GList *list = g_list_find_custom (registry->desktop->applications, application, compare_object_hash);
+
+#ifdef SPI_DEBUG
+ gint i;
+#endif
+
if (list)
{
- fprintf (stderr, "deregistering application\n");
- registry->applications = g_list_delete_link (registry->applications, list);
+#ifdef SPI_DEBUG
+ fprintf (stderr, "deregistering application %p\n", application);
+#endif
+ registry->desktop->applications = g_list_delete_link (registry->desktop->applications, list);
+#ifdef SPI_DEBUG
+ fprintf (stderr, "there are now %d apps registered.\n", g_list_length (registry->desktop->applications));
+ for (i = 0; i < g_list_length (registry->desktop->applications); ++i) {
+ fprintf (stderr, "getting application %d\n", i);
+ fprintf (stderr, "object address %p\n",
+ g_list_nth_data (registry->desktop->applications, i));
+ }
+#endif
}
+ else
+ fprintf (stderr, "could not deregister application\n");
}
/*
epv->registerGlobalEventListener = impl_accessibility_registry_register_global_event_listener;
epv->deregisterGlobalEventListener = impl_accessibility_registry_deregister_global_event_listener;
epv->deregisterGlobalEventListenerAll = impl_accessibility_registry_deregister_global_event_listener_all;
+ epv->getDeviceEventController = impl_accessibility_registry_get_device_event_controller;
epv->getDesktopCount = impl_accessibility_registry_get_desktop_count;
epv->getDesktop = impl_accessibility_registry_get_desktop;
epv->getDesktopList = impl_accessibility_registry_get_desktop_list;
- epv->getDeviceEventController = impl_accessibility_registry_get_device_event_controller;
+
((ListenerClass *) klass)->epv.notifyEvent = impl_registry_notify_event;
}
desktop_init (Desktop *desktop)
{
ACCESSIBLE (desktop)->atko = g_object_new (atk_object_get_type(), NULL);
+ desktop->applications = NULL;
atk_object_set_name (ATK_OBJECT (ACCESSIBLE (desktop)->atko), "main");
}
*/
/*
- * registry.c: test for accessibility implementation
- *
+ * registry.c: the main accessibility service registry implementation
*/
#ifdef SPI_DEBUG
CORBA_Environment ev;
long long diff = ((CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev)) -
(CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev)));
+
+#ifdef SPI_DEBUG
+ fprintf (stderr, "comparing %p to %p, via hashes %ld and %ld; diff %ld\n",
+ p1, p2,
+ CORBA_Object_hash ((CORBA_Object) p1, (CORBA_unsigned_long) 0, &ev),
+ CORBA_Object_hash ((CORBA_Object) p2, (CORBA_unsigned_long) 0, &ev),
+ (long) diff);
+#endif
+
return ((diff < 0) ? -1 : ((diff > 0) ? 1 : 0));
}
CORBA_Environment * ev)
{
Registry *registry = REGISTRY (bonobo_object_from_servant (servant));
- GList *list = g_list_find_custom (registry->applications, application, compare_object_hash);
+ GList *list = g_list_find_custom (registry->desktop->applications, application, compare_object_hash);
+
+#ifdef SPI_DEBUG
+ gint i;
+#endif
+
if (list)
{
- fprintf (stderr, "deregistering application\n");
- registry->applications = g_list_delete_link (registry->applications, list);
+#ifdef SPI_DEBUG
+ fprintf (stderr, "deregistering application %p\n", application);
+#endif
+ registry->desktop->applications = g_list_delete_link (registry->desktop->applications, list);
+#ifdef SPI_DEBUG
+ fprintf (stderr, "there are now %d apps registered.\n", g_list_length (registry->desktop->applications));
+ for (i = 0; i < g_list_length (registry->desktop->applications); ++i) {
+ fprintf (stderr, "getting application %d\n", i);
+ fprintf (stderr, "object address %p\n",
+ g_list_nth_data (registry->desktop->applications, i));
+ }
+#endif
}
+ else
+ fprintf (stderr, "could not deregister application\n");
}
/*
epv->registerGlobalEventListener = impl_accessibility_registry_register_global_event_listener;
epv->deregisterGlobalEventListener = impl_accessibility_registry_deregister_global_event_listener;
epv->deregisterGlobalEventListenerAll = impl_accessibility_registry_deregister_global_event_listener_all;
+ epv->getDeviceEventController = impl_accessibility_registry_get_device_event_controller;
epv->getDesktopCount = impl_accessibility_registry_get_desktop_count;
epv->getDesktop = impl_accessibility_registry_get_desktop;
epv->getDesktopList = impl_accessibility_registry_get_desktop_list;
- epv->getDeviceEventController = impl_accessibility_registry_get_device_event_controller;
+
((ListenerClass *) klass)->epv.notifyEvent = impl_registry_notify_event;
}
_festival_write ("(audio_mode'async)\n", fd);
_festival_write ("(Parameter.set 'Duration_Model 'Tree_ZScore)\n", fd);
- _festival_write ("(Parameter.set 'Duration_Stretch 0.5)\n", fd);
+ _festival_write ("(Parameter.set 'Duration_Stretch 0.7)\n", fd);
return fd;
}
gdk_window_resize (window->window, magnifier->mag_data->mag_width, magnifier->mag_data->mag_height);
magnifier->mag_data->output_window = window;
if (global_options.fullscreen) gdk_window_stick (window->window);
- gdk_window_set_decorations(window->window, 0);
+ gtk_window_set_decorated(window, FALSE);
gdk_window_set_functions(window->window, 0);
gdk_window_raise(window->window);