#include "tilda-terminal.h"
#include "tilda-terminal-dbus-glue.h"
-// FIXME: temporary helpers for gettext
-// TODO: remove these
-#define _(X) X
-#define N_(X) X
-
#define DINGUS1 "(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+(:[0-9]*)?"
#define DINGUS2 "(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\) ,\\\"]"
static void
tilda_terminal_dbus_register_object (TildaTerminal *tt)
{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(tt));
+
+ TildaWindow *parent_window = TILDA_WINDOW(tt->parent_window);
gchar *object_path;
// Register this object with DBus
object_path = g_strdup_printf ("/net/sourceforge/Tilda/Window%d/Terminal%d",
- tt->window_number, tt->number);
+ parent_window->number, tt->number);
dbus_g_connection_register_g_object (dbus_connection, object_path, G_OBJECT(tt));
g_free (object_path);
}
+gboolean
+tilda_terminal_run_command (TildaTerminal *self, gchar *command, GError **error)
+{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(self));
+
+ vte_terminal_feed_child (VTE_TERMINAL(self->vte_term), command, -1);
+ vte_terminal_feed_child (VTE_TERMINAL(self->vte_term), "\n", -1);
+
+ return TRUE;
+}
+
+gboolean
+tilda_terminal_close (TildaTerminal *self, GError **error)
+{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(self));
+
+ TildaWindow *parent_window = TILDA_WINDOW(self->parent_window);
+
+ tilda_window_remove_terminal (parent_window, self->number);
+
+ return TRUE;
+}
+
/**
* Start the current tt->shell in the given TildaTerminal
* NOTE: this will kill whatever is running in the terminal,
static gboolean
tilda_terminal_start_shell (TildaTerminal *tt)
{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(tt));
+
gint ret;
gint argc;
gchar **argv;
static void
tilda_terminal_child_exited_cb (GtkWidget *widget, gpointer data)
{
+ debug_enter ();
+ debug_assert (GTK_IS_WIDGET(widget));
+ debug_assert (TILDA_IS_TERMINAL(data));
+
TildaTerminal *self = TILDA_TERMINAL(data);
/* These can stay here. They don't need to go into a header because
switch (self->exit_action)
{
case EXIT_TERMINAL:
- tilda_window_remove_term (TILDA_WINDOW(self->parent_window), self->number);
+ tilda_window_remove_terminal (TILDA_WINDOW(self->parent_window), self->number);
break;
case RESTART_COMMAND:
vte_terminal_feed (VTE_TERMINAL(self->vte_term), "\r\n\r\n", 4);
static void
tilda_terminal_window_title_changed_cb (GtkWidget *widget, gpointer data)
{
+ debug_enter ();
+ debug_assert (GTK_IS_WIDGET(widget));
+ debug_assert (TILDA_IS_TERMINAL(data));
+
TildaTerminal *self = TILDA_TERMINAL(data);
TildaWindow *parent_window = TILDA_WINDOW(self->parent_window);
GtkWidget *label;
new_title = g_strdup_printf ("%s - %s", self->title, vte_title);
break;
- case NOT_DISPLAYED:
default:
- g_printerr (_("FIXME: Bad value of self->dynamic_title\n"));
+ debug_printf ("ERROR: Bad value of self->dynamic_title\n");
+ case NOT_DISPLAYED:
new_title = g_strdup(self->title);
break;
}
GdkEventButton *event,
gpointer data)
{
+ debug_enter ();
+ debug_assert (GTK_IS_WIDGET(widget));
+ debug_assert (TILDA_IS_TERMINAL(data));
+ debug_printf ("event->button = %d\n", event->button);
+
GError *error = NULL;
TildaTerminal *self = TILDA_TERMINAL(data);
VteTerminal *terminal = VTE_TERMINAL(self->vte_term);
/* Check if we can launch a web browser, and do so if possible */
if ((event->state & GDK_CONTROL_MASK) && match != NULL)
{
-#if DEBUG
- g_print ("Got a Ctrl+Left Click -- Matched: `%s' (%d)\n", match, tag);
-#endif
web_browser_cmd = g_strescape (self->web_browser, NULL);
cmd = g_strdup_printf ("%s %s", web_browser_cmd, match);
-#if DEBUG
- g_print ("Launching command: `%s'\n", cmd);
-#endif
+
+ debug_printf ("Got a Ctrl+Left-Click -- match: '%s' tag: %d\n", match, tag);
+ debug_printf ("Launching command: '%s'\n", cmd);
+
ret = g_spawn_command_line_async(cmd, &error);
/* Check that the command launched */
static void
tilda_terminal_set_transparent (TildaTerminal *self)
{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(self));
+
TildaWindow *parent_window = TILDA_WINDOW(self->parent_window);
gdouble temp;
static void
tilda_terminal_set_scrollbar_position (TildaTerminal *self)
{
+ debug_enter ();
+ debug_assert (TILDA_IS_TERMINAL(self));
+
enum scrollbar_positions { DISABLED, LEFT, RIGHT };
switch (self->scrollbar_position)
{
gtk_widget_show (self->scrollbar);
break;
- case DISABLED:
default:
+ debug_printf ("ERROR: Bad scrollbar position\n");
+ case DISABLED:
gtk_widget_hide (self->scrollbar);
break;
}
enum tilda_terminal_properties {
TILDA_TERMINAL_NUMBER = 1,
- TILDA_TERMINAL_WINDOW_NUMBER,
- TILDA_TERMINAL_TW,
+ TILDA_TERMINAL_PARENT_WINDOW,
/* All non-constructor-only properties */
TILDA_TERMINAL_BACKGROUND_IMAGE,
tilda_terminal_instance_init (GTypeInstance *instance,
gpointer g_class)
{
+ debug_enter ();
+
TildaTerminal *self = (TildaTerminal *) instance;
/* Initialize instance members and allocate any necessary memory here.
case TILDA_TERMINAL_NUMBER:
self->number = g_value_get_int (value);
- g_print ("terminal number: %d\n", self->number);
+ debug_printf ("terminal number: %d\n", self->number);
break;
- case TILDA_TERMINAL_WINDOW_NUMBER:
- self->window_number = g_value_get_int (value);
- g_print ("terminal parent window number: %d\n", self->window_number);
- break;
-
- case TILDA_TERMINAL_TW:
+ case TILDA_TERMINAL_PARENT_WINDOW:
self->parent_window = g_value_get_pointer (value);
- g_print ("terminal parent window: 0x%x\n", self->parent_window);
- g_print ("terminal parent window number (direct): %d\n", TILDA_WINDOW(self->parent_window)->number);
+ debug_printf ("terminal parent window: 0x%x\n", self->parent_window);
break;
case TILDA_TERMINAL_BACKGROUND_IMAGE:
g_free (self->background_image);
self->background_image = g_value_dup_string (value);
vte_terminal_set_background_image_file (VTE_TERMINAL(self->vte_term), self->background_image);
- g_print ("terminal back img: %s\n", self->background_image);
+ debug_printf ("terminal back img: %s\n", self->background_image);
break;
case TILDA_TERMINAL_SHELL:
g_free (self->shell);
self->shell = g_value_dup_string (value);
tilda_terminal_start_shell (self);
- g_print ("terminal shell: %s\n", self->shell);
+ debug_printf ("terminal shell: %s\n", self->shell);
break;
case TILDA_TERMINAL_FONT:
vte_terminal_set_font_from_string_full (VTE_TERMINAL(self->vte_term),
self->font,
self->antialiased);
- g_print ("terminal font: %s\n", self->font);
+ debug_printf ("terminal font: %s\n", self->font);
break;
case TILDA_TERMINAL_TITLE:
g_free (self->title);
self->title = g_value_dup_string (value);
- g_print ("terminal title: %s\n", self->title);
+ debug_printf ("terminal title: %s\n", self->title);
break;
case TILDA_TERMINAL_WORKING_DIRECTORY:
g_free (self->working_directory);
self->working_directory = g_value_dup_string (value);
- g_print ("terminal wrk dir: %s\n", self->working_directory);
+ debug_printf ("terminal wrk dir: %s\n", self->working_directory);
break;
case TILDA_TERMINAL_WEB_BROWSER:
g_free (self->web_browser);
self->web_browser = g_value_dup_string (value);
- g_print ("terminal web browser: %s\n", self->web_browser);
+ debug_printf ("terminal web browser: %s\n", self->web_browser);
break;
case TILDA_TERMINAL_SCROLLBACK_LINES:
self->scrollback_lines = g_value_get_int (value);
vte_terminal_set_scrollback_lines (VTE_TERMINAL(self->vte_term), self->scrollback_lines);
- g_print ("terminal scrollback lines: %d\n", self->scrollback_lines);
+ debug_printf ("terminal scrollback lines: %d\n", self->scrollback_lines);
break;
case TILDA_TERMINAL_TRANSPARENCY_PERCENT:
self->transparency_percent = g_value_get_int (value);
tilda_terminal_set_transparent (self);
- g_print ("terminal transp percent: %d\n", self->transparency_percent);
+ debug_printf ("terminal transp percent: %d\n", self->transparency_percent);
break;
case TILDA_TERMINAL_BACKSPACE_BINDING:
self->backspace_binding = g_value_get_int (value);
vte_terminal_set_backspace_binding (VTE_TERMINAL(self->vte_term), self->backspace_binding);
- g_print ("terminal backspace key: %d\n", self->backspace_binding);
+ debug_printf ("terminal backspace key: %d\n", self->backspace_binding);
break;
case TILDA_TERMINAL_DELETE_BINDING:
self->delete_binding = g_value_get_int (value);
vte_terminal_set_delete_binding (VTE_TERMINAL(self->vte_term), self->delete_binding);
- g_print ("terminal delete key: %d\n", self->delete_binding);
+ debug_printf ("terminal delete key: %d\n", self->delete_binding);
break;
case TILDA_TERMINAL_DYNAMIC_TITLE:
self->dynamic_title = g_value_get_int (value);
- g_print ("terminal dynamic title: %d\n", self->dynamic_title);
+ debug_printf ("terminal dynamic title: %d\n", self->dynamic_title);
break;
case TILDA_TERMINAL_EXIT_ACTION:
self->exit_action = g_value_get_int (value);
- g_print ("terminal exit action: %d\n", self->exit_action);
+ debug_printf ("terminal exit action: %d\n", self->exit_action);
break;
case TILDA_TERMINAL_SCROLLBAR_POSITION:
self->scrollbar_position = g_value_get_int (value);
tilda_terminal_set_scrollbar_position (self);
- g_print ("terminal scrollbar position: %d\n", self->scrollbar_position);
+ debug_printf ("terminal scrollbar position: %d\n", self->scrollbar_position);
break;
case TILDA_TERMINAL_SCROLL_BACKGROUND:
self->scroll_background = g_value_get_boolean (value);
vte_terminal_set_scroll_background (VTE_TERMINAL(self->vte_term), self->scroll_background);
- g_print ("terminal scroll background: %d\n", self->scroll_background);
+ debug_printf ("terminal scroll background: %d\n", self->scroll_background);
break;
case TILDA_TERMINAL_SCROLL_ON_OUTPUT:
self->scroll_on_output = g_value_get_boolean (value);
vte_terminal_set_scroll_on_output (VTE_TERMINAL(self->vte_term), self->scroll_on_output);
- g_print ("terminal scroll on output: %d\n", self->scroll_on_output);
+ debug_printf ("terminal scroll on output: %d\n", self->scroll_on_output);
break;
case TILDA_TERMINAL_SCROLL_ON_KEYSTROKE:
self->scroll_on_keystroke = g_value_get_boolean (value);
vte_terminal_set_scroll_on_keystroke (VTE_TERMINAL(self->vte_term), self->scroll_on_keystroke);
- g_print ("terminal scroll on keystroke: %d\n", self->scroll_on_keystroke);
+ debug_printf ("terminal scroll on keystroke: %d\n", self->scroll_on_keystroke);
break;
case TILDA_TERMINAL_ANTIALIASED:
vte_terminal_set_font_from_string_full (VTE_TERMINAL(self->vte_term),
self->font,
self->antialiased);
- g_print ("terminal antialiased: %d\n", self->antialiased);
+ debug_printf ("terminal antialiased: %d\n", self->antialiased);
break;
case TILDA_TERMINAL_ALLOW_BOLD_TEXT:
self->allow_bold_text = g_value_get_boolean (value);
vte_terminal_set_allow_bold (VTE_TERMINAL(self->vte_term), self->allow_bold_text);
- g_print ("terminal allow bold text: %d\n", self->allow_bold_text);
+ debug_printf ("terminal allow bold text: %d\n", self->allow_bold_text);
break;
case TILDA_TERMINAL_CURSOR_BLINKS:
self->cursor_blinks = g_value_get_boolean (value);
vte_terminal_set_cursor_blinks (VTE_TERMINAL(self->vte_term), self->cursor_blinks);
- g_print ("terminal cursor blinks: %d\n", self->cursor_blinks);
+ debug_printf ("terminal cursor blinks: %d\n", self->cursor_blinks);
break;
case TILDA_TERMINAL_AUDIBLE_BELL:
self->audible_bell = g_value_get_boolean (value);
vte_terminal_set_audible_bell (VTE_TERMINAL(self->vte_term), self->audible_bell);
- g_print ("terminal audible bell: %d\n", self->audible_bell);
+ debug_printf ("terminal audible bell: %d\n", self->audible_bell);
break;
case TILDA_TERMINAL_VISIBLE_BELL:
self->visible_bell = g_value_get_boolean (value);
vte_terminal_set_visible_bell (VTE_TERMINAL(self->vte_term), self->visible_bell);
- g_print ("terminal visible bell: %d\n", self->visible_bell);
+ debug_printf ("terminal visible bell: %d\n", self->visible_bell);
break;
case TILDA_TERMINAL_DOUBLE_BUFFERED:
self->double_buffered = g_value_get_boolean (value);
gtk_widget_set_double_buffered (GTK_WIDGET(self->vte_term), self->double_buffered);
- g_print ("terminal double buffered: %d\n", self->double_buffered);
+ debug_printf ("terminal double buffered: %d\n", self->double_buffered);
break;
case TILDA_TERMINAL_MOUSE_AUTOHIDE:
self->mouse_autohide = g_value_get_boolean (value);
vte_terminal_set_mouse_autohide (VTE_TERMINAL(self->vte_term), self->mouse_autohide);
- g_print ("terminal mouse autohide: %d\n", self->mouse_autohide);
+ debug_printf ("terminal mouse autohide: %d\n", self->mouse_autohide);
break;
default:
g_value_set_int (value, self->number);
break;
- case TILDA_TERMINAL_WINDOW_NUMBER:
- g_value_set_int (value, self->window_number);
- break;
-
- case TILDA_TERMINAL_TW:
+ case TILDA_TERMINAL_PARENT_WINDOW:
g_value_set_pointer (value, self->parent_window);
break;
guint n_construct_properties,
GObjectConstructParam *construct_properties)
{
+ debug_enter ();
+
GObject *obj;
TildaTerminal *self;
gint ret;
construct_properties);
/* Do other stuff here. The object is ready to go now, and all
- * ctor properties have been set.
- *
- * TODO: This is the place to do DBus-init */
+ * ctor properties have been set. */
self = TILDA_TERMINAL(obj);
/* Pack into the hbox */
gtk_box_pack_end (GTK_BOX(self->hbox), self->scrollbar, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX(self->hbox), self->vte_term, TRUE, TRUE, 0);
gtk_widget_show (self->scrollbar);
+ gtk_widget_show (self->vte_term);
+ gtk_widget_show (self->hbox);
/* Match URL's, etc */
ret = vte_terminal_match_add (VTE_TERMINAL(self->vte_term), DINGUS1);
static void
tilda_terminal_dispose (GObject *obj)
{
+ debug_enter ();
+
TildaTerminal *self = (TildaTerminal *) obj;
/* We don't want to run dispose twice, so just return immediately */
static void
tilda_terminal_finalize (GObject *obj)
{
+ debug_enter ();
+
TildaTerminal *self = (TildaTerminal *) obj;
/*
* Here, complete object destruction.
* You might not need to do much...
*/
-
- // TODO: g_free() any primitives here
g_free (self->background_image);
g_free (self->shell);
g_free (self->font);
tilda_terminal_class_init (gpointer g_class,
gpointer g_class_data)
{
+ debug_enter ();
+
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
TildaTerminalClass *klass = TILDA_TERMINAL_CLASS (g_class);
GParamSpec *pspec;
/* Install all of the properties */
pspec = g_param_spec_int ("number",
- "Terminal number",
- "Set terminal's number",
+ _("Terminal number"),
+ NULL,
0, // min value
INT_MAX, // max value
0, // def value
TILDA_TERMINAL_NUMBER,
pspec);
- pspec = g_param_spec_int ("window-number",
- "Number of the window to which this terminal belongs",
- "Set the number of the parent window",
- 0,
- INT_MAX,
- 0x0000beef,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
-
- g_object_class_install_property (gobject_class,
- TILDA_TERMINAL_WINDOW_NUMBER,
- pspec);
-
pspec = g_param_spec_pointer ("parent-window",
- "Pointer to terminal's parent TildaWindow",
- "Set the pointer to the terminal's parent TildaWindow",
+ _("Pointer to terminal's parent TildaWindow"),
+ NULL,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
- TILDA_TERMINAL_TW,
+ TILDA_TERMINAL_PARENT_WINDOW,
pspec);
pspec = g_param_spec_string ("background-image",
- "Terminal's background image",
- "Get/Set terminal's background image",
+ _("Terminal's background image"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("shell",
- "Terminal's shell",
- "Get/Set terminal's shell",
+ _("Terminal's shell"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("font",
- "Terminal's font",
- "Get/Set terminal's font",
+ _("Terminal's font"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("title",
- "Terminal's title",
- "Get/Set terminal's title",
+ _("Terminal's title"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("working-directory",
- "Terminal's initial working directory",
- "Get/Set terminal's initial working directory",
+ _("Terminal's initial working directory"),
+ NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_string ("web-browser",
- "Terminal's web browser command",
+ _("Terminal's web browser command"),
NULL,
NULL,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_int ("scrollback-lines",
- "Terminal's scrollback amount (lines)",
- "Get/Set terminal's scrollback amount",
+ _("Terminal's scrollback amount (lines)"),
+ NULL,
0,
INT_MAX, // TODO: artificially limit this?
1000,
pspec);
pspec = g_param_spec_int ("transparency-percent",
- "Terminal's transparency (percent)",
- "Get/Set terminal's transparency",
+ _("Terminal's transparency (percent)"),
+ NULL,
0,
100,
0,
pspec);
pspec = g_param_spec_int ("backspace-binding",
- "Terminal's backspace binding",
- "Get/Set terminal's backspace key binding",
+ _("Terminal's backspace binding"),
+ NULL,
VTE_ERASE_AUTO,
VTE_ERASE_DELETE_SEQUENCE,
VTE_ERASE_AUTO,
pspec);
pspec = g_param_spec_int ("delete-binding",
- "Terminal's delete binding",
- "Get/Set terminal's delete key binding",
+ _("Terminal's delete binding"),
+ NULL,
VTE_ERASE_AUTO,
VTE_ERASE_DELETE_SEQUENCE,
VTE_ERASE_AUTO,
pspec);
pspec = g_param_spec_int ("dynamic-title",
- "Terminal's dynamic title generation method",
- "Get/Set terminal's dynamic title generation method",
+ _("Terminal's dynamic title generation method"),
+ NULL,
0,
INT_MAX,
0,
pspec);
pspec = g_param_spec_int ("exit-action",
- "Terminal's action upon child exit",
- "Get/Set terminal's action upon child exit",
+ _("Terminal's action upon child exit"),
+ NULL,
0,
INT_MAX,
0,
pspec);
pspec = g_param_spec_int ("scrollbar-position",
- "Terminal's scrollbar position",
+ _("Terminal's scrollbar position"),
NULL,
0,
INT_MAX,
pspec);
pspec = g_param_spec_boolean ("scroll-background",
- "Controls terminal's scrolling behavior",
- "Get/Set terminal's scrolling behavior",
+ _("Controls terminal's scrolling behavior"),
+ NULL,
FALSE,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_boolean ("scroll-on-output",
- "Controls terminal's scrolling behavior on output",
- "Get/Set terminal's scrolling behavior on output",
+ _("Controls terminal's scrolling behavior on output"),
+ NULL,
FALSE,
G_PARAM_READWRITE);
pspec);
pspec = g_param_spec_boolean ("scroll-on-keystroke",
- "Controls the terminal's scrolling behavior on keystroke",
+ _("Controls the terminal's scrolling behavior on keystroke"),
NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
pspec);
pspec = g_param_spec_boolean ("antialiased",
- "Attempt to antialias fonts",
+ _("Attempt to antialias fonts"),
NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
pspec);
pspec = g_param_spec_boolean ("allow-bold-text",
- "Allow bold text",
+ _("Allow bold text"),
NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
pspec);
pspec = g_param_spec_boolean ("cursor-blinks",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Enable cursor blinking"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_CURSOR_BLINKS,
pspec);
pspec = g_param_spec_boolean ("audible-bell",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Enable the audible bell"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_AUDIBLE_BELL,
pspec);
pspec = g_param_spec_boolean ("visible-bell",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Enable the visible bell"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_VISIBLE_BELL,
pspec);
pspec = g_param_spec_boolean ("double-buffered",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Double buffer the terminal"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_DOUBLE_BUFFERED,
pspec);
pspec = g_param_spec_boolean ("mouse-autohide",
- NULL, NULL, FALSE, G_PARAM_READWRITE);
+ _("Hide the mouse cursor while typing"),
+ NULL, FALSE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class,
TILDA_TERMINAL_MOUSE_AUTOHIDE,
return type;
}
-#if 0
-
-int main (int argc, char *argv[])
-{
- GObject *tt;
- gint test_number = INT_MIN;
- gchar *test_string = NULL;
-
- /* Initialize the GObject type system */
- g_type_init ();
- gtk_init (&argc, &argv);
-
- tt = g_object_new (TILDA_TYPE_TERMINAL, "number", 10, NULL);
- g_object_get (G_OBJECT (tt), "number", &test_number, NULL);
- g_assert (test_number == 10);
-
- g_object_unref (G_OBJECT (tt));
-
- tt = g_object_new (TILDA_TYPE_TERMINAL, "number", 22, NULL);
- g_object_get (G_OBJECT (tt), "number", &test_number, NULL);
- g_assert (test_number == 22);
-
- g_object_set (G_OBJECT (tt), "font", "hello I'm a font");
- g_object_set (G_OBJECT (tt), "font", "Bitstream Vera Sans Mono 13");
-
- g_object_get (G_OBJECT (tt), "font", &test_string, NULL);
- g_print ("Read Font: %s\n", test_string);
- // NOTE: you MUST free the string!!!!
- g_free (test_string);
-
- g_object_set (G_OBJECT (tt), "transparency-percent", 50);
-
- g_object_unref (G_OBJECT (tt));
-
- return 0;
-}
-
-#endif
-
/* vim: set ts=4 sts=4 sw=4 noet tw=112: */