+#include "tilda.h"
#include "tilda-window.h"
+#include "tilda-window-dbus-glue.h"
static gboolean
tilda_window_add_term (TildaWindow *tw)
{
// FIXME: this is totally bad, but it's a good hack for feasability
static gint mynumber = 0;
- TildaTerminal *tt = g_object_new (TILDA_TYPE_TERMINAL, "number", mynumber++, NULL);
+ TildaTerminal *tt = g_object_new (TILDA_TYPE_TERMINAL,
+ "number", mynumber++,
+ "window-number", tw->number,
+ NULL);
g_ptr_array_add (tw->terms, tt);
GtkWidget *label = gtk_label_new ("Tilda");
return TRUE;
}
+static void
+tilda_window_dbus_register_object (TildaWindow *tw)
+{
+ gchar *object_path;
+
+ // Register this object with DBus
+ object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d", tw->number);
+ dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(tw));
+ g_free (object_path);
+}
+
/*******************************************************************************
* ALL GOBJECT STUFF BELOW PLEASE
******************************************************************************/
* TODO: This is the place to do DBus-init */
self = TILDA_WINDOW(obj);
+ /* Register this object with DBus */
+ tilda_window_dbus_register_object (self);
+
gtk_container_add (GTK_CONTAINER(self->window), self->notebook);
gtk_widget_show (self->notebook);
pspec);
/* TODO: more properties */
+
+ /* Hook the TildaWindow type into DBus */
+ dbus_g_object_type_install_info (tilda_window_get_type(), &dbus_glib_tilda_window_object_info);
}
GType