1 #include <gdk/gdkx.h> /* for gdk_x11_window_set_user_time() */
5 #include "tilda-config.h"
6 #include "tilda-controller.h"
7 #include "tilda-window.h"
8 #include "tilda-window-dbus-glue.h"
9 #include "tomboykeybinder.h"
12 * Find the TildaTerminal corresponding to the currently selected
13 * tab in self->notebook. This could go away if TildaTerminal were
14 * a proper subclass of GtkWidget.
16 static TildaTerminal *
17 tilda_window_find_current_terminal (TildaWindow *self)
20 debug_assert (TILDA_IS_WINDOW(self));
24 gint current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK(self->notebook));
25 GtkWidget *box = gtk_notebook_get_nth_page (GTK_NOTEBOOK(self->notebook), current_page);
27 for (i=0; i<self->terms->len; ++i)
29 ret = g_ptr_array_index (self->terms, i);
35 debug_printf ("ERROR: unable to find current terminal!\n");
40 tilda_window_find_next_free_terminal_number (TildaWindow *self)
43 debug_assert (TILDA_IS_WINDOW(self));
48 for (i=0; i<INT_MAX; ++i)
52 for (j=0; j<self->terms->len; ++j)
54 TildaTerminal *tt = g_ptr_array_index (self->terms, j);
71 * Clean up and remove self completely from the program
73 * Should only be used by DBus...
76 tilda_window_close (TildaWindow *self)
79 debug_assert (TILDA_IS_WINDOW(self));
81 tilda_controller_remove_window (TILDA_CONTROLLER(self->controller), self->number);
87 tilda_window_add_terminal (TildaWindow *self)
90 debug_assert (TILDA_IS_WINDOW(self));
97 number = tilda_window_find_next_free_terminal_number (self);
98 tt = g_object_new (TILDA_TYPE_TERMINAL,
100 "parent-window", self,
102 g_ptr_array_add (self->terms, tt);
104 label = gtk_label_new ("Tilda");
105 notebook_index = gtk_notebook_prepend_page (GTK_NOTEBOOK(self->notebook), tt->hbox, label);
106 gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK(self->notebook), tt->hbox, TRUE, TRUE, GTK_PACK_END);
107 gtk_notebook_set_current_page (GTK_NOTEBOOK(self->notebook), notebook_index);
109 if (gtk_notebook_get_n_pages (GTK_NOTEBOOK(self->notebook)) > 1)
110 gtk_notebook_set_show_tabs (GTK_NOTEBOOK(self->notebook), TRUE);
112 /* Focus the VTE Terminal */
113 gtk_widget_grab_focus (tt->vte_term);
119 * Remove the TildaTerminal with the given number from the given
122 * Return: TRUE on success, FALSE otherwise.
125 tilda_window_remove_terminal (TildaWindow *self, gint terminal_number)
128 debug_assert (TILDA_IS_WINDOW(self));
129 debug_assert (terminal_number >= 0);
133 for (i=0; i<self->terms->len; ++i)
135 TildaTerminal *tt = g_ptr_array_index (self->terms, i);
137 if (tt->number == terminal_number)
139 gint notebook_index = gtk_notebook_page_num (GTK_NOTEBOOK(self->notebook), tt->hbox);
141 /* Make sure the index was valid */
142 if (notebook_index == -1)
144 debug_printf ("ERROR: Bad Notebook Tab\n");
148 /* Actually remove the terminal */
149 gtk_notebook_remove_page (GTK_NOTEBOOK (self->notebook), notebook_index);
151 /* We should hide the tabs if there is only one tab left */
152 if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (self->notebook)) == 1)
153 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (self->notebook), FALSE);
155 /* Remove the term from our lists, then free it */
156 g_ptr_array_remove_fast (self->terms, tt);
157 g_object_unref (G_OBJECT(tt));
159 /* With no pages left, it's time to remove this window */
160 if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (self->notebook)) < 1)
162 debug_printf ("no terminals left, closing window %d\n", self->number);
163 tilda_controller_remove_window (TILDA_CONTROLLER(self->controller), self->number);
166 /* Leave the loop, we're done */
175 * This sets up the given TildaWindow for the capability of real
176 * transparency, if the X server is capable of it. */
178 tilda_window_setup_real_transparency (TildaWindow *self)
181 debug_assert (TILDA_IS_WINDOW(self));
184 GdkColormap *colormap;
186 screen = gtk_widget_get_screen (GTK_WIDGET(self->window));
187 colormap = gdk_screen_get_rgba_colormap (screen);
189 /* If possible, set the RGBA colormap so VTE can use real alpha
190 * channels for transparency. */
191 if (colormap != NULL && gdk_screen_is_composited (screen))
193 gtk_widget_set_colormap (GTK_WIDGET(self->window), colormap);
194 self->have_real_transparency = TRUE;
198 self->have_real_transparency = FALSE;
201 /* Center the given TildaWindow in the horizontal axis */
203 tilda_window_center_horizontally (TildaWindow *self)
206 debug_assert (TILDA_IS_WINDOW(self));
208 const gint screen_center = gdk_screen_width() / 2;
209 const gint tilda_center = self->width / 2;
210 const gint center_coord = screen_center - tilda_center;
212 g_object_set (G_OBJECT(self), "x-position", center_coord, NULL);
215 /* Center the given TildaWindow in the vertical axis */
217 tilda_window_center_vertically (TildaWindow *self)
220 debug_assert (TILDA_IS_WINDOW(self));
222 const gint screen_center = gdk_screen_height() / 2;
223 const gint tilda_center = self->height / 2;
224 const gint center_coord = screen_center - tilda_center;
226 g_object_set (G_OBJECT(self), "y-position", center_coord, NULL);
230 tilda_window_keybinding_cb (const gchar *keystr, gpointer data)
233 debug_assert (TILDA_IS_WINDOW(data));
235 TildaWindow *self = TILDA_WINDOW(data);
238 /* This call sets the X11 window property _NET_WM_USER_TIME, which GTK+ normally
239 * sets for us. However, because this callback is activated via a global keybinding,
240 * we see the event before GDK / GTK+ does. Therefore, to get the focus, we must
241 * set the property ourselves. */
242 gdk_x11_window_set_user_time (GTK_WIDGET(self->window)->window,
243 tomboy_keybinder_get_current_event_time());
247 case WINDOW_UP: /* Pull the window up */
249 /* Bugfix: having this here keeps the tilda window from being
250 * hidden if you turn off "stick", pull it down on workspace 1,
251 * switch to workspace 2, then pull it up and back down. Without
252 * this, something in metacity (at least) hides the window. Stupid. */
253 gtk_window_deiconify (GTK_WINDOW(self->window));
255 /* Re-set the window properties that do not linger after hiding the
256 * window. I know this looks stupid, but it keeps all of the state-
257 * changing code in the place it belongs: the property-setting code. */
258 g_object_set (G_OBJECT(self),
259 "keep-above", self->keep_above,
260 "stick", self->stick,
262 gtk_widget_show (GTK_WIDGET(self->window));
264 /* Focusing the term here works perfectly, near as I can tell */
265 tt = tilda_window_find_current_terminal (self);
266 gtk_widget_grab_focus (GTK_WIDGET(tt->vte_term));
268 self->state = WINDOW_DOWN;
271 case WINDOW_DOWN: /* Pull the window up */
273 gtk_widget_hide (GTK_WIDGET(self->window));
275 self->state = WINDOW_UP;
279 debug_printf ("ERROR: Window is in a bad state!\n");
281 /* Pretend we're down, for good measure.... */
282 self->state = WINDOW_DOWN;
288 * Attempt to bind the new_key to show this window.
290 * Return: TRUE if successful, FALSE otherwise.
293 tilda_window_try_to_bind_key (TildaWindow *self, const gchar *new_key)
296 debug_assert (TILDA_IS_WINDOW(self));
298 gboolean ret = FALSE;
300 /* Make sure the new key is not null in any way */
301 if (new_key == NULL || g_ascii_strcasecmp("", new_key) == 0)
304 /* Check that no other windows are using the key */
305 // FIXME: there should be a hidden option to disable this. Maybe some people want
306 // to have logs in two Tildas, and just show them with one key. Crazy...
307 if (tilda_controller_global_key_in_use(TILDA_CONTROLLER(self->controller), new_key))
310 /* Unbind if we were set */
312 tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb);
314 ret = tomboy_keybinder_bind (new_key, tilda_window_keybinding_cb, self);
316 /* If it was successful, update the self->key variable and be done with it */
320 self->key = g_strdup (new_key);
324 g_printerr (_("Bind key '%s' failed. Reverting to original keybinding\n"), self->key);
326 /* Not successful, so rebind the old key, and return FALSE */
327 if (self->key != NULL && g_ascii_strcasecmp("",self->key) != 0)
329 ret = tomboy_keybinder_bind (self->key, tilda_window_keybinding_cb, self);
331 /* Check that it went ok */
333 g_printerr (_("Unable to re-bind original key '%s'. Oh shit...\n"), self->key);
336 g_printerr (_("No original key to revert to!\n"));
342 tilda_window_dbus_register_object (TildaWindow *self)
345 debug_assert (TILDA_IS_WINDOW(self));
349 // Register this object with DBus
350 object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d", self->number);
351 dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(self));
352 g_free (object_path);
355 /*******************************************************************************
356 * ALL GOBJECT STUFF BELOW PLEASE
357 ******************************************************************************/
359 static GObjectClass *parent_class = NULL;
361 enum tilda_window_properties {
362 TILDA_WINDOW_NUMBER = 1,
363 TILDA_WINDOW_CONTROLLER,
369 TILDA_WINDOW_X_POSITION,
370 TILDA_WINDOW_Y_POSITION,
371 TILDA_WINDOW_INITIAL_TERMINALS,
373 TILDA_WINDOW_TAB_POSITION,
374 TILDA_WINDOW_ANIMATION_ORIENTATION,
375 TILDA_WINDOW_ANIMATION_DELAY,
377 TILDA_WINDOW_KEEP_ABOVE,
378 TILDA_WINDOW_SKIP_TASKBAR_HINT,
380 TILDA_WINDOW_HIDDEN_AT_START,
381 TILDA_WINDOW_CENTERED_HORIZONTALLY,
382 TILDA_WINDOW_CENTERED_VERTICALLY,
384 TILDA_WINDOW_HAVE_REAL_TRANSPARENCY,
388 tilda_window_instance_init (GTypeInstance *instance,
393 TildaWindow *self = (TildaWindow *) instance;
394 self->dispose_has_run = FALSE;
396 /* Initialize all properties */
397 self->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
398 self->notebook = gtk_notebook_new ();
399 self->terms = g_ptr_array_new ();
401 /* Somewhat of a "poison" value, incase we don't set this */
402 self->number = 0xdeadbeef;
403 self->controller = NULL;
405 self->state = WINDOW_UP;
409 tilda_window_set_property (GObject *object,
414 TildaWindow *self = (TildaWindow *) object;
416 switch (property_id) {
418 case TILDA_WINDOW_NUMBER:
419 self->number = g_value_get_int (value);
420 debug_printf ("window number: %d\n", self->number);
423 case TILDA_WINDOW_CONTROLLER:
424 self->controller = g_value_get_pointer (value);
425 debug_printf ("window controller: 0x%x\n", self->controller);
428 case TILDA_WINDOW_KEY:
429 tilda_window_try_to_bind_key (self, g_value_get_string (value));
430 debug_printf ("window key %s\n", self->key);
433 case TILDA_WINDOW_HEIGHT:
434 self->height = g_value_get_int (value);
435 gtk_widget_set_size_request (self->window, self->width, self->height);
436 gtk_window_resize (GTK_WINDOW(self->window), self->width, self->height);
437 debug_printf ("window height: %d\n", self->height);
440 case TILDA_WINDOW_WIDTH:
441 self->width = g_value_get_int (value);
442 gtk_widget_set_size_request (self->window, self->width, self->height);
443 gtk_window_resize (GTK_WINDOW(self->window), self->width, self->height);
444 debug_printf ("window width: %d\n", self->width);
447 case TILDA_WINDOW_X_POSITION:
448 self->x_position = g_value_get_int (value);
449 gtk_window_move (GTK_WINDOW(self->window), self->x_position, self->y_position);
450 debug_printf ("window x position: %d\n", self->x_position);
453 case TILDA_WINDOW_Y_POSITION:
454 self->y_position = g_value_get_int (value);
455 gtk_window_move (GTK_WINDOW(self->window), self->x_position, self->y_position);
456 debug_printf ("window y position: %d\n", self->y_position);
459 case TILDA_WINDOW_INITIAL_TERMINALS:
460 self->initial_terminals = g_value_get_int (value);
461 debug_printf ("window initial terminals: %d\n", self->initial_terminals);
464 case TILDA_WINDOW_TAB_POSITION:
465 self->tab_position = g_value_get_enum (value);
466 gtk_notebook_set_tab_pos (GTK_NOTEBOOK(self->notebook), self->tab_position);
467 debug_printf ("window tab position: %d\n", self->tab_position);
470 case TILDA_WINDOW_ANIMATION_ORIENTATION:
471 self->animation_orientation = g_value_get_enum (value);
472 debug_printf ("window animation orientation: %d\n", self->animation_orientation);
475 case TILDA_WINDOW_ANIMATION_DELAY:
476 self->animation_delay = g_value_get_int (value);
477 debug_printf ("window animation delay: %d\n", self->animation_delay);
480 case TILDA_WINDOW_KEEP_ABOVE:
481 self->keep_above = g_value_get_boolean (value);
482 gtk_window_set_keep_above (GTK_WINDOW(self->window), self->keep_above);
483 debug_printf ("window keep above: %d\n", self->keep_above);
486 case TILDA_WINDOW_SKIP_TASKBAR_HINT:
487 self->skip_taskbar_hint = g_value_get_boolean (value);
488 gtk_window_set_skip_taskbar_hint (GTK_WINDOW(self->window), self->skip_taskbar_hint);
489 debug_printf ("window skip taskbar hint: %d\n", self->skip_taskbar_hint);
492 case TILDA_WINDOW_STICK:
493 self->stick = g_value_get_boolean (value);
495 /* This is moderately ugly, but GTK+ does it this way... */
496 self->stick ? gtk_window_stick (GTK_WINDOW(self->window))
497 : gtk_window_unstick (GTK_WINDOW(self->window));
498 debug_printf ("window stick: %d\n", self->stick);
501 case TILDA_WINDOW_HIDDEN_AT_START:
502 self->hidden_at_start = g_value_get_boolean (value);
503 debug_printf ("window hidden at start: %d\n", self->hidden_at_start);
506 case TILDA_WINDOW_CENTERED_HORIZONTALLY:
507 self->centered_horizontally = g_value_get_boolean (value);
508 if (self->centered_horizontally)
509 tilda_window_center_horizontally (self);
510 debug_printf ("window centered horizontally: %d\n", self->centered_horizontally);
513 case TILDA_WINDOW_CENTERED_VERTICALLY:
514 self->centered_vertically = g_value_get_boolean (value);
515 if (self->centered_vertically)
516 tilda_window_center_vertically (self);
517 debug_printf ("window centered vertically: %d\n", self->centered_vertically);
520 case TILDA_WINDOW_HAVE_REAL_TRANSPARENCY:
521 self->have_real_transparency = g_value_get_boolean (value);
522 debug_printf ("window have real transp: %d\n", self->have_real_transparency);
526 /* We don't have this property */
527 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
533 tilda_window_get_property (GObject *object,
538 TildaWindow *self = (TildaWindow *) object;
540 switch (property_id) {
542 case TILDA_WINDOW_NUMBER:
543 g_value_set_int (value, self->number);
546 case TILDA_WINDOW_CONTROLLER:
547 g_value_set_pointer (value, self->controller);
550 case TILDA_WINDOW_KEY:
551 g_value_set_string (value, self->key);
554 case TILDA_WINDOW_HEIGHT:
555 g_value_set_int (value, self->height);
558 case TILDA_WINDOW_WIDTH:
559 g_value_set_int (value, self->width);
562 case TILDA_WINDOW_X_POSITION:
563 g_value_set_int (value, self->x_position);
566 case TILDA_WINDOW_Y_POSITION:
567 g_value_set_int (value, self->y_position);
570 case TILDA_WINDOW_INITIAL_TERMINALS:
571 g_value_set_int (value, self->initial_terminals);
574 case TILDA_WINDOW_TAB_POSITION:
575 g_value_set_enum (value, self->tab_position);
578 case TILDA_WINDOW_ANIMATION_ORIENTATION:
579 g_value_set_enum (value, self->animation_orientation);
582 case TILDA_WINDOW_ANIMATION_DELAY:
583 g_value_set_int (value, self->animation_delay);
586 case TILDA_WINDOW_KEEP_ABOVE:
587 g_value_set_boolean (value, self->keep_above);
590 case TILDA_WINDOW_SKIP_TASKBAR_HINT:
591 g_value_set_boolean (value, self->skip_taskbar_hint);
594 case TILDA_WINDOW_STICK:
595 g_value_set_boolean (value, self->stick);
598 case TILDA_WINDOW_HIDDEN_AT_START:
599 g_value_set_boolean (value, self->hidden_at_start);
602 case TILDA_WINDOW_CENTERED_HORIZONTALLY:
603 g_value_set_boolean (value, self->centered_horizontally);
606 case TILDA_WINDOW_CENTERED_VERTICALLY:
607 g_value_set_boolean (value, self->centered_vertically);
610 case TILDA_WINDOW_HAVE_REAL_TRANSPARENCY:
611 g_value_set_boolean (value, self->have_real_transparency);
615 /* We don't have this property */
616 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
622 tilda_window_constructor (GType type,
623 guint n_construct_properties,
624 GObjectConstructParam *construct_properties)
632 /* Invoke parent constructor */
633 TildaWindowClass *klass;
634 klass = TILDA_WINDOW_CLASS (g_type_class_peek (TILDA_TYPE_WINDOW));
635 obj = parent_class->constructor (type,
636 n_construct_properties,
637 construct_properties);
639 /* Do other stuff here. The object is ready to go now, and all
640 * ctor properties have been set.
642 self = TILDA_WINDOW(obj);
644 /* Try to set up real transparency */
645 tilda_window_setup_real_transparency (self);
647 gtk_container_add (GTK_CONTAINER(self->window), self->notebook);
648 g_object_set (G_OBJECT(self->notebook), "can-focus", FALSE, NULL);
649 gtk_widget_show (self->notebook);
651 /* Tilda is never decorated */
652 gtk_window_set_decorated (GTK_WINDOW(self->window), FALSE);
654 /* Set all of the properties out of the config file */
655 tilda_window_set_property_from_config (self, "key");
657 // FIXME: hack -- start the wizard in this case :)
660 gchar *key = g_strdup_printf ("F%d", self->number+3);
661 g_object_set (G_OBJECT(self), "key", key, NULL);
664 g_critical ("HACK: start the wizard here\n");
667 tilda_window_set_property_from_config (self, "height");
668 tilda_window_set_property_from_config (self, "width");
669 tilda_window_set_property_from_config (self, "x-position");
670 tilda_window_set_property_from_config (self, "y-position");
671 tilda_window_set_property_from_config (self, "initial-terminals");
672 tilda_window_set_property_from_config (self, "animation-delay");
674 tilda_window_set_property_from_config (self, "tab-position");
675 tilda_window_set_property_from_config (self, "animation-orientation");
677 tilda_window_set_property_from_config (self, "keep-above");
678 tilda_window_set_property_from_config (self, "skip-taskbar-hint");
679 tilda_window_set_property_from_config (self, "stick");
680 tilda_window_set_property_from_config (self, "hidden-at-start");
681 tilda_window_set_property_from_config (self, "centered-horizontally");
682 tilda_window_set_property_from_config (self, "centered-vertically");
684 /* Add the initial terminal(s) */
685 for (i=0; i<self->initial_terminals; ++i)
686 tilda_window_add_terminal (self);
688 /* Show us if we're ready. If not, just remain hidden. All sub-widgets must
689 * be gtk_widget_show()n by this point. */
690 if (!self->hidden_at_start)
692 gtk_widget_show (self->window);
693 self->state = WINDOW_DOWN;
696 self->state = WINDOW_UP;
698 /* Register this object with DBus */
699 tilda_window_dbus_register_object (self);
705 tilda_window_dispose (GObject *obj)
709 TildaWindow *self = (TildaWindow *) obj;
711 /* We don't want to run dispose twice, so just return immediately */
712 if (self->dispose_has_run)
716 * In dispose, you are supposed to free all types referenced from this
717 * object which might themselves hold a reference to self. Generally,
718 * the most simple solution is to unref all members on which you own a
721 * NOTE: See the following for how to deal with GtkObject-derived things:
722 * http://library.gnome.org/devel/gtk/unstable/GtkObject.html
724 g_ptr_array_foreach (self->terms, g_object_unref, NULL);
725 gtk_widget_destroy (self->window);
727 /* Unbind if we were set */
729 tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb);
731 /* Chain up to the parent class */
732 G_OBJECT_CLASS (parent_class)->dispose (obj);
736 tilda_window_finalize (GObject *obj)
740 TildaWindow *self = (TildaWindow *) obj;
743 * Here, complete the object's destruction.
744 * You might not need to do much...
746 // TODO: g_free() any primitives here
747 g_ptr_array_free (self->terms, TRUE);
750 /* Chain up to the parent class */
751 G_OBJECT_CLASS (parent_class)->finalize (obj);
755 tilda_window_class_init (gpointer g_class,
756 gpointer g_class_data)
760 GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
761 TildaWindowClass *klass = TILDA_WINDOW_CLASS (g_class);
764 /* Hook our functions to this type */
765 gobject_class->set_property = tilda_window_set_property;
766 gobject_class->get_property = tilda_window_get_property;
767 gobject_class->dispose = tilda_window_dispose;
768 gobject_class->finalize = tilda_window_finalize;
769 gobject_class->constructor = tilda_window_constructor;
771 parent_class = g_type_class_peek_parent (klass);
773 /* Install all of the properties */
774 pspec = g_param_spec_int ("number",
778 INT_MAX, // max value
780 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
782 g_object_class_install_property (gobject_class,
786 pspec = g_param_spec_pointer ("controller",
787 _("Pointer to window's controlling TildaController"),
789 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
791 g_object_class_install_property (gobject_class,
792 TILDA_WINDOW_CONTROLLER,
795 pspec = g_param_spec_string ("key",
796 _("Window's drop-down keybinding"),
801 g_object_class_install_property (gobject_class,
805 pspec = g_param_spec_int ("height",
806 _("Window's height"),
813 g_object_class_install_property (gobject_class,
817 pspec = g_param_spec_int ("width",
825 g_object_class_install_property (gobject_class,
829 pspec = g_param_spec_int ("x-position",
830 _("Window's x position"),
837 g_object_class_install_property (gobject_class,
838 TILDA_WINDOW_X_POSITION,
841 pspec = g_param_spec_int ("y-position",
842 _("Window's y position"),
849 g_object_class_install_property (gobject_class,
850 TILDA_WINDOW_Y_POSITION,
853 pspec = g_param_spec_int ("initial-terminals",
854 _("Window's inital number of terminals"),
861 g_object_class_install_property (gobject_class,
862 TILDA_WINDOW_INITIAL_TERMINALS,
865 pspec = g_param_spec_enum ("tab-position",
866 _("Position of window's tab bar"),
868 gtk_position_type_get_type(),
872 g_object_class_install_property (gobject_class,
873 TILDA_WINDOW_TAB_POSITION,
876 pspec = g_param_spec_enum ("animation-orientation",
877 _("Window's animation orientation"),
879 gtk_position_type_get_type(),
883 g_object_class_install_property (gobject_class,
884 TILDA_WINDOW_ANIMATION_ORIENTATION,
887 pspec = g_param_spec_int ("animation-delay",
888 _("Amount of time in milliseconds between animation intervals"),
895 g_object_class_install_property (gobject_class,
896 TILDA_WINDOW_ANIMATION_DELAY,
899 pspec = g_param_spec_boolean ("keep-above",
900 _("Keep this window above all others"),
905 g_object_class_install_property (gobject_class,
906 TILDA_WINDOW_KEEP_ABOVE,
909 pspec = g_param_spec_boolean ("skip-taskbar-hint",
910 _("Hide this window in the taskbar if TRUE"),
915 g_object_class_install_property (gobject_class,
916 TILDA_WINDOW_SKIP_TASKBAR_HINT,
919 pspec = g_param_spec_boolean ("stick",
920 _("Display this window on all workspaces"),
925 g_object_class_install_property (gobject_class,
929 pspec = g_param_spec_boolean ("hidden-at-start",
930 _("Hide the window when it is first created"),
935 g_object_class_install_property (gobject_class,
936 TILDA_WINDOW_HIDDEN_AT_START,
939 pspec = g_param_spec_boolean ("centered-horizontally",
940 _("Center the window horizontally"),
945 g_object_class_install_property (gobject_class,
946 TILDA_WINDOW_CENTERED_HORIZONTALLY,
949 pspec = g_param_spec_boolean ("centered-vertically",
950 _("Center the window vertically"),
955 g_object_class_install_property (gobject_class,
956 TILDA_WINDOW_CENTERED_VERTICALLY,
959 pspec = g_param_spec_boolean ("have-real-transparency",
960 NULL, NULL, FALSE, G_PARAM_READABLE);
962 g_object_class_install_property (gobject_class,
963 TILDA_WINDOW_HAVE_REAL_TRANSPARENCY,
966 /* Hook the TildaWindow type into DBus */
967 dbus_g_object_type_install_info (tilda_window_get_type(), &dbus_glib_tilda_window_object_info);
971 tilda_window_get_type (void)
973 static GType type = 0;
977 static const GTypeInfo info = {
978 sizeof (TildaWindowClass),
979 NULL, /* base_init */
980 NULL, /* base_finalize */
981 tilda_window_class_init, /* class_init */
982 NULL, /* class_finalize */
983 NULL, /* class_data */
984 sizeof (TildaWindow),
986 tilda_window_instance_init, /* instance_init */
989 type = g_type_register_static (G_TYPE_OBJECT,
998 /* vim: set ts=4 sts=4 sw=4 noet tw=112: */