+2001-08-15 Bill Haneman <bill.haneman@sun.com>
+
+ * registryd/registry.c : separated event listeners to use
+ 3 separate lists (focus, window, toolkit). Began testing
+ event names against hashes before relaying events.
+ * test/at.c : now register for events of type "focus:"
+ * test/app.c : now generate events of type "focus:"
+ * at-bridge/bridge.c : register with ATK for focus events,
+ and we now relay those focus events to any "focus:" listeners.
+ This now works with the bridge as a GTK_MODULE when running test/at.
+ * libspi/registry.c :
+ * libspi/listener.c : now we ref event sources before propagating, and unref on receipt.
+ * libspi/registry.c : some changes to internal structs, to support event typestring hashes.
+ * text/app.c : changed the way the appname is generated.
+
+ KNOWN PROBLEMS:
+ poll() fails after a few event notifications, when the number of file descriptors
+ gets too large. Investigating.
+
2001-08-15 Mark McLoughlin <mark@skynet.ie>
* at-bridge/Makefile.am: link against
char **v;
};
+static CORBA_Environment ev;
+static Accessibility_Registry registry;
+
static gboolean bridge_register_app (gpointer p);
+static void bridge_focus_tracker (AtkObject *object);
int
gtk_module_init(gint argc, char* argv[])
static gboolean
bridge_register_app (gpointer gp)
{
- CORBA_Environment ev;
CORBA_Object oclient;
AtkObject *atko;
char *obj_id;
char sbuf[30];
ArgStruct *args = (ArgStruct *)gp;
- Accessibility_Registry registry;
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");
}
fprintf(stderr, "About to register application\n");
+ bonobo_activate ();
+
+ /* Register for focus event notifications, and register app with central registry */
+ atk_add_focus_tracker (bridge_focus_tracker);
+
Accessibility_Registry_registerApplication (registry,
bonobo_object_corba_objref (bonobo_object (app)),
&ev);
- bonobo_activate ();
- bonobo_main (); /* because app is also a server */
return FALSE;
}
+
+static void bridge_focus_tracker (AtkObject *object)
+{
+ Accessibility_Event *e = g_new0(Accessibility_Event, 1);
+ e->type = CORBA_string_dup ("focus:");
+ e->target = bonobo_object_corba_objref (bonobo_object (accessible_new (object)));
+ e->detail1 = 0;
+ e->detail2 = 0;
+ Accessibility_Registry_notifyEvent (registry, e, &ev);
+}
char **v;
};
+static CORBA_Environment ev;
+static Accessibility_Registry registry;
+
static gboolean bridge_register_app (gpointer p);
+static void bridge_focus_tracker (AtkObject *object);
int
gtk_module_init(gint argc, char* argv[])
static gboolean
bridge_register_app (gpointer gp)
{
- CORBA_Environment ev;
CORBA_Object oclient;
AtkObject *atko;
char *obj_id;
char sbuf[30];
ArgStruct *args = (ArgStruct *)gp;
- Accessibility_Registry registry;
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");
}
fprintf(stderr, "About to register application\n");
+ bonobo_activate ();
+
+ /* Register for focus event notifications, and register app with central registry */
+ atk_add_focus_tracker (bridge_focus_tracker);
+
Accessibility_Registry_registerApplication (registry,
bonobo_object_corba_objref (bonobo_object (app)),
&ev);
- bonobo_activate ();
- bonobo_main (); /* because app is also a server */
return FALSE;
}
+
+static void bridge_focus_tracker (AtkObject *object)
+{
+ Accessibility_Event *e = g_new0(Accessibility_Event, 1);
+ e->type = CORBA_string_dup ("focus:");
+ e->target = bonobo_object_corba_objref (bonobo_object (accessible_new (object)));
+ e->detail1 = 0;
+ e->detail2 = 0;
+ Accessibility_Registry_notifyEvent (registry, e, &ev);
+}