2 #include "tilda-terminal.h"
3 #include "tilda-terminal-dbus-glue.h"
5 // FIXME: temporary helpers for gettext
11 tilda_terminal_dbus_register_object (TildaTerminal *tt)
15 // Register this object with DBus
16 object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d/Terminal%d",
17 tt->window_number, tt->number);
18 dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(tt));
23 * Start the current tt->shell in the given TildaTerminal
24 * NOTE: this will kill whatever is running in the terminal,
25 * NOTE: and run the current tt->shell instead :)
26 * Return: TRUE if ok, FALSE otherwise
29 tilda_terminal_start_shell (TildaTerminal *tt)
36 /* Launch a custom command if tt->shell is set (not NULL) */
39 /* Try to parse the user's custom command */
40 ret = g_shell_parse_argv (tt->shell, &argc, &argv, &error);
44 g_printerr (_("Problem parsing custom command: %s\n"), error->message);
45 g_printerr (_("Launching default shell instead\n"));
48 goto launch_default_shell;
51 /* Try to start the user's custom command */
52 ret = vte_terminal_fork_command (VTE_TERMINAL(tt->vte_term),
53 argv[0], /* Command */
54 argv, /* Arg Vector */
55 NULL, /* Env Vector */
56 tt->working_directory, /* Start directory */
57 TRUE, /* Add to lastlog */
58 TRUE, /* Add to utmp */
59 TRUE); /* Add to wtmp */
66 g_printerr (_("Unable to launch custom command: %s\n"), tt->shell);
67 g_printerr (_("Launching default shell instead\n"));
69 goto launch_default_shell;
72 return TRUE; /* SUCCESS: the early way out */
77 ret = vte_terminal_fork_command (VTE_TERMINAL(tt->vte_term),
78 NULL, /* Command -- VTE will figure it out */
79 NULL, /* Arg Vector */
80 NULL, /* Env Vector */
81 tt->working_directory, /* Start Directory */
82 TRUE, /* Add to lastlog */
83 TRUE, /* Add to utmp */
84 TRUE);/* Add to wtmp */
88 g_printerr (_("Unable to launch default shell\n"));
95 /*******************************************************************************
96 * All GObject stuff is below. You probably don't need to change this...
97 ******************************************************************************/
99 static GObjectClass *parent_class = NULL;
101 enum tilda_terminal_properties {
102 TILDA_TERMINAL_NUMBER = 1,
103 TILDA_TERMINAL_WINDOW_NUMBER,
106 /* All non-constructor-only properties */
107 TILDA_TERMINAL_BACKGROUND_IMAGE,
108 TILDA_TERMINAL_SHELL,
110 TILDA_TERMINAL_TITLE,
111 TILDA_TERMINAL_WORKING_DIRECTORY,
113 TILDA_TERMINAL_SCROLLBACK_LINES,
114 TILDA_TERMINAL_TRANSPARENCY_PERCENT,
116 TILDA_TERMINAL_BACKSPACE_BINDING,
117 TILDA_TERMINAL_DELETE_BINDING,
118 TILDA_TERMINAL_DYNAMIC_TITLE,
119 TILDA_TERMINAL_EXIT_ACTION,
121 TILDA_TERMINAL_SCROLL_BACKGROUND,
122 TILDA_TERMINAL_SCROLL_ON_OUTPUT,
123 TILDA_TERMINAL_SCROLL_ON_KEYSTROKE,
124 TILDA_TERMINAL_ANTIALIASED,
125 TILDA_TERMINAL_ALLOW_BOLD_TEXT,
126 TILDA_TERMINAL_CURSOR_BLINKS,
127 TILDA_TERMINAL_AUDIBLE_BELL,
128 TILDA_TERMINAL_VISIBLE_BELL,
129 TILDA_TERMINAL_DOUBLE_BUFFERED,
130 TILDA_TERMINAL_MOUSE_AUTOHIDE,
134 tilda_terminal_instance_init (GTypeInstance *instance,
137 TildaTerminal *self = (TildaTerminal *) instance;
139 /* Initialize instance members and allocate any necessary memory here.
140 * NOTE: any constructor-time values will be set later. */
141 self->dispose_has_run = FALSE;
144 self->vte_term = vte_terminal_new ();
145 self->scrollbar = gtk_vscrollbar_new (VTE_TERMINAL(self->vte_term)->adjustment);
146 self->hbox = gtk_hbox_new (FALSE, 0);
150 tilda_terminal_set_property (GObject *object,
155 TildaTerminal *self = (TildaTerminal *) object;
157 switch (property_id) {
159 case TILDA_TERMINAL_NUMBER:
160 self->number = g_value_get_int (value);
161 g_print ("terminal number: %d\n", self->number);
164 case TILDA_TERMINAL_WINDOW_NUMBER:
165 self->window_number = g_value_get_int (value);
166 g_print ("terminal parent window number: %d\n", self->window_number);
169 case TILDA_TERMINAL_TW:
170 self->parent_window = g_value_get_pointer (value);
171 g_print ("terminal parent window: 0x%x\n", self->parent_window);
172 g_print ("terminal parent window number (direct): %d\n", TILDA_WINDOW(self->parent_window)->number);
175 case TILDA_TERMINAL_BACKGROUND_IMAGE:
176 g_free (self->background_image);
177 self->background_image = g_value_dup_string (value);
178 vte_terminal_set_background_image_file (VTE_TERMINAL(self->vte_term), self->background_image);
179 g_print ("terminal back img: %s\n", self->background_image);
182 case TILDA_TERMINAL_SHELL:
183 g_free (self->shell);
184 self->shell = g_value_dup_string (value);
185 tilda_terminal_start_shell (self);
186 g_print ("terminal shell: %s\n", self->shell);
189 case TILDA_TERMINAL_FONT:
191 self->font = g_value_dup_string (value);
192 vte_terminal_set_font_from_string_full (VTE_TERMINAL(self->vte_term),
195 g_print ("terminal font: %s\n", self->font);
198 case TILDA_TERMINAL_TITLE:
199 g_free (self->title);
200 self->title = g_value_dup_string (value);
201 g_print ("terminal title: %s\n", self->title);
204 case TILDA_TERMINAL_WORKING_DIRECTORY:
205 g_free (self->working_directory);
206 self->working_directory = g_value_dup_string (value);
207 g_print ("terminal wrk dir: %s\n", self->working_directory);
210 case TILDA_TERMINAL_SCROLLBACK_LINES:
211 self->scrollback_lines = g_value_get_int (value);
212 vte_terminal_set_scrollback_lines (VTE_TERMINAL(self->vte_term), self->scrollback_lines);
213 g_print ("terminal scrollback lines: %d\n", self->scrollback_lines);
216 case TILDA_TERMINAL_TRANSPARENCY_PERCENT:
217 self->transparency_percent = g_value_get_int (value);
218 g_print ("terminal transp percent: %d\n", self->transparency_percent);
221 case TILDA_TERMINAL_BACKSPACE_BINDING:
222 self->backspace_binding = g_value_get_int (value);
223 vte_terminal_set_backspace_binding (VTE_TERMINAL(self->vte_term), self->backspace_binding);
224 g_print ("terminal backspace key: %d\n", self->backspace_binding);
227 case TILDA_TERMINAL_DELETE_BINDING:
228 self->delete_binding = g_value_get_int (value);
229 vte_terminal_set_delete_binding (VTE_TERMINAL(self->vte_term), self->delete_binding);
230 g_print ("terminal delete key: %d\n", self->delete_binding);
233 case TILDA_TERMINAL_DYNAMIC_TITLE:
234 self->dynamic_title = g_value_get_int (value);
235 g_print ("terminal dynamic title: %d\n", self->dynamic_title);
238 case TILDA_TERMINAL_EXIT_ACTION:
239 self->exit_action = g_value_get_int (value);
240 g_print ("terminal exit action: %d\n", self->exit_action);
243 case TILDA_TERMINAL_SCROLL_BACKGROUND:
244 self->scroll_background = g_value_get_boolean (value);
245 vte_terminal_set_scroll_background (VTE_TERMINAL(self->vte_term), self->scroll_background);
246 g_print ("terminal scroll background: %d\n", self->scroll_background);
249 case TILDA_TERMINAL_SCROLL_ON_OUTPUT:
250 self->scroll_on_output = g_value_get_boolean (value);
251 vte_terminal_set_scroll_on_output (VTE_TERMINAL(self->vte_term), self->scroll_on_output);
252 g_print ("terminal scroll on output: %d\n", self->scroll_on_output);
255 case TILDA_TERMINAL_SCROLL_ON_KEYSTROKE:
256 self->scroll_on_keystroke = g_value_get_boolean (value);
257 vte_terminal_set_scroll_on_keystroke (VTE_TERMINAL(self->vte_term), self->scroll_on_keystroke);
258 g_print ("terminal scroll on keystroke: %d\n", self->scroll_on_keystroke);
261 case TILDA_TERMINAL_ANTIALIASED:
262 self->antialiased = g_value_get_boolean (value);
263 vte_terminal_set_font_from_string_full (VTE_TERMINAL(self->vte_term),
266 g_print ("terminal antialiased: %d\n", self->antialiased);
269 case TILDA_TERMINAL_ALLOW_BOLD_TEXT:
270 self->allow_bold_text = g_value_get_boolean (value);
271 vte_terminal_set_allow_bold (VTE_TERMINAL(self->vte_term), self->allow_bold_text);
272 g_print ("terminal allow bold text: %d\n", self->allow_bold_text);
275 case TILDA_TERMINAL_CURSOR_BLINKS:
276 self->cursor_blinks = g_value_get_boolean (value);
277 vte_terminal_set_cursor_blinks (VTE_TERMINAL(self->vte_term), self->cursor_blinks);
278 g_print ("terminal cursor blinks: %d\n", self->cursor_blinks);
281 case TILDA_TERMINAL_AUDIBLE_BELL:
282 self->audible_bell = g_value_get_boolean (value);
283 vte_terminal_set_audible_bell (VTE_TERMINAL(self->vte_term), self->audible_bell);
284 g_print ("terminal audible bell: %d\n", self->audible_bell);
287 case TILDA_TERMINAL_VISIBLE_BELL:
288 self->visible_bell = g_value_get_boolean (value);
289 vte_terminal_set_visible_bell (VTE_TERMINAL(self->vte_term), self->visible_bell);
290 g_print ("terminal visible bell: %d\n", self->visible_bell);
293 case TILDA_TERMINAL_DOUBLE_BUFFERED:
294 self->double_buffered = g_value_get_boolean (value);
295 gtk_widget_set_double_buffered (GTK_WIDGET(self->vte_term), self->double_buffered);
296 g_print ("terminal double buffered: %d\n", self->double_buffered);
299 case TILDA_TERMINAL_MOUSE_AUTOHIDE:
300 self->mouse_autohide = g_value_get_boolean (value);
301 vte_terminal_set_mouse_autohide (VTE_TERMINAL(self->vte_term), self->mouse_autohide);
302 g_print ("terminal mouse autohide: %d\n", self->mouse_autohide);
306 /* We don't have this property... */
307 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
313 tilda_terminal_get_property (GObject *object,
318 TildaTerminal *self = (TildaTerminal *) object;
320 switch (property_id) {
322 case TILDA_TERMINAL_NUMBER:
323 g_value_set_int (value, self->number);
326 case TILDA_TERMINAL_WINDOW_NUMBER:
327 g_value_set_int (value, self->window_number);
330 case TILDA_TERMINAL_TW:
331 g_value_set_pointer (value, self->parent_window);
334 case TILDA_TERMINAL_BACKGROUND_IMAGE:
335 g_value_set_string (value, self->background_image);
338 case TILDA_TERMINAL_SHELL:
339 g_value_set_string (value, self->shell);
342 case TILDA_TERMINAL_FONT:
343 g_value_set_string (value, self->font);
346 case TILDA_TERMINAL_TITLE:
347 g_value_set_string (value, self->title);
350 case TILDA_TERMINAL_WORKING_DIRECTORY:
351 g_value_set_string (value, self->working_directory);
354 case TILDA_TERMINAL_SCROLLBACK_LINES:
355 g_value_set_int (value, self->scrollback_lines);
358 case TILDA_TERMINAL_TRANSPARENCY_PERCENT:
359 g_value_set_int (value, self->transparency_percent);
362 case TILDA_TERMINAL_BACKSPACE_BINDING:
363 g_value_set_int (value, self->backspace_binding);
366 case TILDA_TERMINAL_DELETE_BINDING:
367 g_value_set_int (value, self->delete_binding);
370 case TILDA_TERMINAL_DYNAMIC_TITLE:
371 g_value_set_int (value, self->dynamic_title);
374 case TILDA_TERMINAL_EXIT_ACTION:
375 g_value_set_int (value, self->exit_action);
378 case TILDA_TERMINAL_SCROLL_BACKGROUND:
379 g_value_set_boolean (value, self->scroll_background);
382 case TILDA_TERMINAL_SCROLL_ON_OUTPUT:
383 g_value_set_boolean (value, self->scroll_on_output);
386 case TILDA_TERMINAL_SCROLL_ON_KEYSTROKE:
387 g_value_set_boolean (value, self->scroll_on_keystroke);
390 case TILDA_TERMINAL_ANTIALIASED:
391 g_value_set_boolean (value, self->antialiased);
394 case TILDA_TERMINAL_ALLOW_BOLD_TEXT:
395 g_value_set_boolean (value, self->allow_bold_text);
398 case TILDA_TERMINAL_CURSOR_BLINKS:
399 g_value_set_boolean (value, self->cursor_blinks);
402 case TILDA_TERMINAL_AUDIBLE_BELL:
403 g_value_set_boolean (value, self->audible_bell);
406 case TILDA_TERMINAL_VISIBLE_BELL:
407 g_value_set_boolean (value, self->visible_bell);
410 case TILDA_TERMINAL_DOUBLE_BUFFERED:
411 g_value_set_boolean (value, self->double_buffered);
414 case TILDA_TERMINAL_MOUSE_AUTOHIDE:
415 g_value_set_boolean (value, self->mouse_autohide);
419 /* We don't have this property... */
420 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
426 tilda_terminal_constructor (GType type,
427 guint n_construct_properties,
428 GObjectConstructParam *construct_properties)
433 /* Invoke parent constructor */
434 TildaTerminalClass *klass;
435 klass = TILDA_TERMINAL_CLASS (g_type_class_peek (TILDA_TYPE_TERMINAL));
436 obj = parent_class->constructor (type,
437 n_construct_properties,
438 construct_properties);
440 /* Do other stuff here. The object is ready to go now, and all
441 * ctor properties have been set.
443 * TODO: This is the place to do DBus-init */
444 self = TILDA_TERMINAL(obj);
446 /* Pack into the hbox */
447 gtk_box_pack_end (GTK_BOX(self->hbox), self->scrollbar, FALSE, FALSE, 0);
448 gtk_box_pack_end (GTK_BOX(self->hbox), self->vte_term, TRUE, TRUE, 0);
449 gtk_widget_show (self->scrollbar);
452 g_signal_connect (G_OBJECT(self->vte_term), "child-exited",
453 G_CALLBACK(gtk_main_quit), self);
455 tilda_terminal_start_shell (self);
456 tilda_terminal_dbus_register_object (self);
462 tilda_terminal_dispose (GObject *obj)
464 TildaTerminal *self = (TildaTerminal *) obj;
466 /* We don't want to run dispose twice, so just return immediately */
467 if (self->dispose_has_run)
470 self->dispose_has_run = TRUE;
473 * In dispose, you are supposed to free all types referenced from this
474 * object which might themselves hold a reference to self. Generally,
475 * the most simple solution is to unref all members on which you own a
479 /* Chain up to the parent class */
480 G_OBJECT_CLASS (parent_class)->dispose (obj);
484 tilda_terminal_finalize (GObject *obj)
486 TildaTerminal *self = (TildaTerminal *) obj;
489 * Here, complete object destruction.
490 * You might not need to do much...
493 // TODO: g_free() any primitives here
494 g_free (self->background_image);
495 g_free (self->shell);
497 g_free (self->title);
498 g_free (self->working_directory);
501 /* Chain up to the parent class */
502 G_OBJECT_CLASS (parent_class)->finalize (obj);
506 tilda_terminal_class_init (gpointer g_class,
507 gpointer g_class_data)
509 GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
510 TildaTerminalClass *klass = TILDA_TERMINAL_CLASS (g_class);
513 /* Hook our functions to this type */
514 gobject_class->set_property = tilda_terminal_set_property;
515 gobject_class->get_property = tilda_terminal_get_property;
516 gobject_class->dispose = tilda_terminal_dispose;
517 gobject_class->finalize = tilda_terminal_finalize;
518 gobject_class->constructor = tilda_terminal_constructor;
520 parent_class = g_type_class_peek_parent (klass);
522 /* Hook the TildaTerminal type into DBus */
523 dbus_g_object_type_install_info (tilda_terminal_get_type(), &dbus_glib_tilda_terminal_object_info);
525 /* Install all of the properties */
526 pspec = g_param_spec_int ("number",
528 "Set terminal's number",
530 INT_MAX, // max value
532 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
534 g_object_class_install_property (gobject_class,
535 TILDA_TERMINAL_NUMBER,
538 pspec = g_param_spec_int ("window-number",
539 "Number of the window to which this terminal belongs",
540 "Set the number of the parent window",
544 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
546 g_object_class_install_property (gobject_class,
547 TILDA_TERMINAL_WINDOW_NUMBER,
550 pspec = g_param_spec_pointer ("parent-window",
551 "Pointer to terminal's parent TildaWindow",
552 "Set the pointer to the terminal's parent TildaWindow",
553 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
555 g_object_class_install_property (gobject_class,
559 pspec = g_param_spec_string ("background-image",
560 "Terminal's background image",
561 "Get/Set terminal's background image",
565 g_object_class_install_property (gobject_class,
566 TILDA_TERMINAL_BACKGROUND_IMAGE,
569 pspec = g_param_spec_string ("shell",
571 "Get/Set terminal's shell",
575 g_object_class_install_property (gobject_class,
576 TILDA_TERMINAL_SHELL,
579 pspec = g_param_spec_string ("font",
581 "Get/Set terminal's font",
585 g_object_class_install_property (gobject_class,
589 pspec = g_param_spec_string ("title",
591 "Get/Set terminal's title",
595 g_object_class_install_property (gobject_class,
596 TILDA_TERMINAL_TITLE,
599 pspec = g_param_spec_string ("working-directory",
600 "Terminal's initial working directory",
601 "Get/Set terminal's initial working directory",
605 g_object_class_install_property (gobject_class,
606 TILDA_TERMINAL_WORKING_DIRECTORY,
609 pspec = g_param_spec_int ("scrollback-lines",
610 "Terminal's scrollback amount (lines)",
611 "Get/Set terminal's scrollback amount",
613 INT_MAX, // TODO: artificially limit this?
617 g_object_class_install_property (gobject_class,
618 TILDA_TERMINAL_SCROLLBACK_LINES,
621 pspec = g_param_spec_int ("transparency-percent",
622 "Terminal's transparency (percent)",
623 "Get/Set terminal's transparency",
629 g_object_class_install_property (gobject_class,
630 TILDA_TERMINAL_TRANSPARENCY_PERCENT,
633 pspec = g_param_spec_int ("backspace-binding",
634 "Terminal's backspace binding",
635 "Get/Set terminal's backspace key binding",
637 VTE_ERASE_DELETE_SEQUENCE,
641 g_object_class_install_property (gobject_class,
642 TILDA_TERMINAL_BACKSPACE_BINDING,
645 pspec = g_param_spec_int ("delete-binding",
646 "Terminal's delete binding",
647 "Get/Set terminal's delete key binding",
649 VTE_ERASE_DELETE_SEQUENCE,
653 g_object_class_install_property (gobject_class,
654 TILDA_TERMINAL_DELETE_BINDING,
657 pspec = g_param_spec_int ("dynamic-title",
658 "Terminal's dynamic title generation method",
659 "Get/Set terminal's dynamic title generation method",
665 g_object_class_install_property (gobject_class,
666 TILDA_TERMINAL_DYNAMIC_TITLE,
669 pspec = g_param_spec_int ("exit-action",
670 "Terminal's action upon child exit",
671 "Get/Set terminal's action upon child exit",
677 g_object_class_install_property (gobject_class,
678 TILDA_TERMINAL_EXIT_ACTION,
681 pspec = g_param_spec_boolean ("scroll-background",
682 "Controls terminal's scrolling behavior",
683 "Get/Set terminal's scrolling behavior",
687 g_object_class_install_property (gobject_class,
688 TILDA_TERMINAL_SCROLL_BACKGROUND,
691 pspec = g_param_spec_boolean ("scroll-on-output",
692 "Controls terminal's scrolling behavior on output",
693 "Get/Set terminal's scrolling behavior on output",
697 g_object_class_install_property (gobject_class,
698 TILDA_TERMINAL_SCROLL_ON_OUTPUT,
701 pspec = g_param_spec_boolean ("scroll-on-keystroke",
702 "Controls the terminal's scrolling behavior on keystroke",
703 NULL, FALSE, G_PARAM_READWRITE);
705 g_object_class_install_property (gobject_class,
706 TILDA_TERMINAL_SCROLL_ON_KEYSTROKE,
709 pspec = g_param_spec_boolean ("antialiased",
710 "Attempt to antialias fonts",
711 NULL, FALSE, G_PARAM_READWRITE);
713 g_object_class_install_property (gobject_class,
714 TILDA_TERMINAL_ANTIALIASED,
717 pspec = g_param_spec_boolean ("allow-bold-text",
719 NULL, FALSE, G_PARAM_READWRITE);
721 g_object_class_install_property (gobject_class,
722 TILDA_TERMINAL_ALLOW_BOLD_TEXT,
725 pspec = g_param_spec_boolean ("cursor-blinks",
726 NULL, NULL, FALSE, G_PARAM_READWRITE);
728 g_object_class_install_property (gobject_class,
729 TILDA_TERMINAL_CURSOR_BLINKS,
732 pspec = g_param_spec_boolean ("audible-bell",
733 NULL, NULL, FALSE, G_PARAM_READWRITE);
735 g_object_class_install_property (gobject_class,
736 TILDA_TERMINAL_AUDIBLE_BELL,
739 pspec = g_param_spec_boolean ("visible-bell",
740 NULL, NULL, FALSE, G_PARAM_READWRITE);
742 g_object_class_install_property (gobject_class,
743 TILDA_TERMINAL_VISIBLE_BELL,
746 pspec = g_param_spec_boolean ("double-buffered",
747 NULL, NULL, FALSE, G_PARAM_READWRITE);
749 g_object_class_install_property (gobject_class,
750 TILDA_TERMINAL_DOUBLE_BUFFERED,
753 pspec = g_param_spec_boolean ("mouse-autohide",
754 NULL, NULL, FALSE, G_PARAM_READWRITE);
756 g_object_class_install_property (gobject_class,
757 TILDA_TERMINAL_MOUSE_AUTOHIDE,
762 tilda_terminal_get_type (void)
764 static GType type = 0;
768 static const GTypeInfo info = {
769 sizeof (TildaTerminalClass),
770 NULL, /* base_init */
771 NULL, /* base_finalize */
772 tilda_terminal_class_init, /* class_init */
773 NULL, /* class_finalize */
774 NULL, /* class_data */
775 sizeof (TildaTerminal),
777 tilda_terminal_instance_init, /* instance_init */
780 type = g_type_register_static (G_TYPE_OBJECT,
791 int main (int argc, char *argv[])
794 gint test_number = INT_MIN;
795 gchar *test_string = NULL;
797 /* Initialize the GObject type system */
799 gtk_init (&argc, &argv);
801 tt = g_object_new (TILDA_TYPE_TERMINAL, "number", 10, NULL);
802 g_object_get (G_OBJECT (tt), "number", &test_number, NULL);
803 g_assert (test_number == 10);
805 g_object_unref (G_OBJECT (tt));
807 tt = g_object_new (TILDA_TYPE_TERMINAL, "number", 22, NULL);
808 g_object_get (G_OBJECT (tt), "number", &test_number, NULL);
809 g_assert (test_number == 22);
811 g_object_set (G_OBJECT (tt), "font", "hello I'm a font");
812 g_object_set (G_OBJECT (tt), "font", "Bitstream Vera Sans Mono 13");
814 g_object_get (G_OBJECT (tt), "font", &test_string, NULL);
815 g_print ("Read Font: %s\n", test_string);
816 // NOTE: you MUST free the string!!!!
817 g_free (test_string);
819 g_object_set (G_OBJECT (tt), "transparency-percent", 50);
821 g_object_unref (G_OBJECT (tt));
828 /* vim: set ts=4 sts=4 sw=4 noet tw=112: */