* registryd/registry.c (desktop_remove_application),
(desktop_add_application): clean coding style.
* registryd/desktop.c (spi_desktop_remove_application),
(spi_desktop_add_application): kill re-enterency hazards.
(spi_desktop_dispose): remove bogus redundant cast
obscuring bug; fix bug too.
(spi_desktop_init): make the desktop object immortal.
git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@260
e2bd861d-eb25-0410-b326-
f6ed22b6b98c
+2002-03-19 Michael Meeks <michael@ximian.com>
+
+ * registryd/registry.c (desktop_remove_application),
+ (desktop_add_application): clean coding style.
+
+ * registryd/desktop.c (spi_desktop_remove_application),
+ (spi_desktop_add_application): kill re-enterency hazards.
+ (spi_desktop_dispose): remove bogus redundant cast
+ obscuring bug; fix bug too.
+ (spi_desktop_init): make the desktop object immortal.
+
2002-03-16 Bill Haneman <bill.haneman@sun.com>
* test/simple-at.c:
spi_base_construct (SPI_BASE (desktop), g_object_new (ATK_TYPE_OBJECT, NULL));
desktop->applications = NULL;
+ bonobo_object_set_immortal (BONOBO_OBJECT (desktop), TRUE);
atk_object_set_name (ATK_OBJECT (SPI_BASE (desktop)->gobj), "main");
}
while (desktop->applications)
{
- Application *app = (Application *) desktop->applications;
+ Application *app = desktop->applications->data;
+ g_assert (app->ref != CORBA_OBJECT_NIL);
spi_desktop_remove_application (desktop, app->ref);
}
app->ref = ref;
desktop->applications = g_list_append (desktop->applications, app);
- g_signal_emit (G_OBJECT (desktop), spi_desktop_signals[APPLICATION_ADDED], 0,
- g_list_index (desktop->applications, app));
- ORBit_small_listen_for_broken (app->ref, G_CALLBACK (abnormal_application_termination), app);
+ ORBit_small_listen_for_broken (
+ app->ref, G_CALLBACK (abnormal_application_termination), app);
+
+ g_signal_emit (G_OBJECT (desktop),
+ spi_desktop_signals[APPLICATION_ADDED], 0,
+ g_list_index (desktop->applications, app));
}
CORBA_exception_free (&ev);
spi_desktop_remove_application (SpiDesktop *desktop,
const Accessibility_Application app_ref)
{
+ guint idx;
GList *l;
CORBA_Environment ev;
+ g_return_if_fail (app_ref != CORBA_OBJECT_NIL);
g_return_if_fail (SPI_IS_DESKTOP (desktop));
CORBA_exception_init (&ev);
+ idx = 0;
for (l = desktop->applications; l; l = l->next)
{
Application *app = (Application *) l->data;
{
break;
}
+ idx++;
}
CORBA_exception_free (&ev);
{
Application *app = (Application *) l->data;
- g_signal_emit (G_OBJECT (desktop), spi_desktop_signals[APPLICATION_REMOVED], 0,
- g_list_index (desktop->applications, l));
desktop->applications = g_list_delete_link (desktop->applications, l);
ORBit_small_unlisten_for_broken (app->ref, G_CALLBACK (abnormal_application_termination));
bonobo_object_release_unref (app->ref, NULL);
g_free (app);
+
+ g_signal_emit (G_OBJECT (desktop), spi_desktop_signals[APPLICATION_REMOVED], 0, idx);
}
}
desktop_add_application (SpiDesktop *desktop,
guint index, gpointer data)
{
- BonoboObject *registry = BONOBO_OBJECT(data);
+ BonoboObject *registry = BONOBO_OBJECT (data);
Accessibility_Event e;
CORBA_Environment ev;
e.detail1 = index;
e.detail2 = 0;
CORBA_exception_init (&ev);
- Accessibility_Registry_notifyEvent (BONOBO_OBJREF(registry),
+ Accessibility_Registry_notifyEvent (BONOBO_OBJREF (registry),
&e, &ev);
CORBA_exception_free (&ev);
}
desktop_remove_application (SpiDesktop *desktop,
guint index, gpointer data)
{
- BonoboObject *registry = BONOBO_OBJECT(data);
+ BonoboObject *registry = BONOBO_OBJECT (data);
Accessibility_Event e;
CORBA_Environment ev;
e.detail1 = index;
e.detail2 = 0;
CORBA_exception_init (&ev);
- Accessibility_Registry_notifyEvent (BONOBO_OBJREF(registry),
+ Accessibility_Registry_notifyEvent (BONOBO_OBJREF (registry),
&e, &ev);
CORBA_exception_free (&ev);
}
registry->toolkit_listeners = NULL;
registry->desktop = spi_desktop_new ();
/* Register callback notification for application addition and removal */
- g_signal_connect (G_OBJECT (registry->desktop), "application_added",
- G_CALLBACK(desktop_add_application), (gpointer)registry);
- g_signal_connect (G_OBJECT (registry->desktop), "application_removed",
- G_CALLBACK(desktop_remove_application), (gpointer)registry);
+ g_signal_connect (G_OBJECT (registry->desktop),
+ "application_added",
+ G_CALLBACK (desktop_add_application),
+ registry);
+
+ g_signal_connect (G_OBJECT (registry->desktop),
+ "application_removed",
+ G_CALLBACK (desktop_remove_application),
+ registry);
registry->de_controller = NULL;
}
char *obj_id;
SpiRegistry *registry;
+ free (malloc (8)); /* -lefence */
+
if (!bonobo_init (&argc, argv))
{
g_error ("Could not initialize oaf / Bonobo");