From: rodin Date: Tue, 11 May 2010 12:06:33 +0000 (+0000) Subject: Improvements to the iliad client X-Git-Tag: v0.9~190 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=c68bad985554078c59f3bd0b4e9ee3be1cfe5d37;p=projects%2Fchimara%2Fchimara.git Improvements to the iliad client --- diff --git a/iliad/chimara.png b/iliad/chimara.png index 92a4211..05b3cd9 100644 Binary files a/iliad/chimara.png and b/iliad/chimara.png differ diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index 5162046..b422ef1 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -137,6 +137,7 @@ enum { CHAR_INPUT, LINE_INPUT, TEXT_BUFFER_OUTPUT, + ILIAD_SCREEN_UPDATE, LAST_SIGNAL }; @@ -687,6 +688,12 @@ chimara_glk_text_buffer_output(ChimaraGlk *self, guint window_rock, gchar *text) /* Default signal handler */ } +static void +chimara_glk_iliad_screen_update(ChimaraGlk *self, gboolean typing) +{ + /* Default signal handler */ +} + /* COMPAT: G_PARAM_STATIC_STRINGS only appeared in GTK 2.13.0 */ #ifndef G_PARAM_STATIC_STRINGS @@ -722,6 +729,8 @@ chimara_glk_class_init(ChimaraGlkClass *klass) klass->char_input = chimara_glk_char_input; klass->line_input = chimara_glk_line_input; klass->text_buffer_output = chimara_glk_text_buffer_output; + klass->iliad_screen_update = chimara_glk_iliad_screen_update; + /** * ChimaraGlk::stopped: * @glk: The widget that received the signal @@ -797,6 +806,20 @@ chimara_glk_class_init(ChimaraGlkClass *klass) G_STRUCT_OFFSET(ChimaraGlkClass, text_buffer_output), NULL, NULL, _chimara_marshal_VOID__UINT_STRING, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + /** + * ChimaraGlk::iliad-update-screen: + * @self: The widget that received the signal + * @typing: Whether to perform a typing or full screen update + * + * Iliad specific signal which is emitted whenever the screen needs to be updated. + * Since iliad screen updates are very slow, updating should only be done when + * necessary. + */ + chimara_glk_signals[ILIAD_SCREEN_UPDATE] = g_signal_new("iliad-screen-update", + G_OBJECT_CLASS_TYPE(klass), 0, + G_STRUCT_OFFSET(ChimaraGlkClass, iliad_screen_update), NULL, NULL, + _chimara_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /* Properties */ /** diff --git a/libchimara/chimara-glk.h b/libchimara/chimara-glk.h index 75c7740..8eca95f 100644 --- a/libchimara/chimara-glk.h +++ b/libchimara/chimara-glk.h @@ -36,6 +36,7 @@ typedef struct _ChimaraGlkClass { void(* char_input) (ChimaraGlk *self, guint32 window_rock, guint keysym); void(* line_input) (ChimaraGlk *self, guint32 window_rock, gchar *text); void(* text_buffer_output) (ChimaraGlk *self, guint32 window_rock, gchar *text); + void(* iliad_screen_update) (ChimaraGlk *self, gboolean typing); } ChimaraGlkClass; /** diff --git a/libchimara/chimara-marshallers.txt b/libchimara/chimara-marshallers.txt index d4fccc5..559ccfc 100644 --- a/libchimara/chimara-marshallers.txt +++ b/libchimara/chimara-marshallers.txt @@ -3,3 +3,4 @@ VOID:UINT,UINT VOID:UINT,STRING VOID:STRING,STRING +VOID:BOOLEAN diff --git a/player/iliad.c b/player/iliad.c index ac1460a..abb2ad1 100644 --- a/player/iliad.c +++ b/player/iliad.c @@ -49,11 +49,16 @@ #include #include #include +/*#include "xepdmgrclient.h"*/ + /* Global pointers to widgets */ GtkWidget *window = NULL; GtkWidget *glk = NULL; +/* Display manager */ +/* sEpd *epd = NULL;*/ + static erClientChannel_t erbusyChannel; static erClientChannel_t ertoolbarChannel; @@ -81,6 +86,23 @@ on_save() chimara_glk_feed_line_input( CHIMARA_GLK(glk), "save" ); } +gboolean +update_screen(gpointer data) +{ + printf("Update screen from idle handler\n"); + dmDisplay(dmCmdPriorNormal, dmQFull); + + return FALSE; +} + +static void +on_iliad_screen_update(ChimaraGlk *glk, gboolean typing) +{ + printf("Update screen\n"); + g_idle_add_full(G_PRIORITY_DEFAULT_IDLE+100, update_screen, NULL, NULL); +} + + static void create_window(void) { @@ -93,11 +115,12 @@ create_window(void) "border-width", 6, "spacing", 6, "ignore-errors", TRUE, + "style-sheet", "style.css", NULL); - chimara_glk_set_default_font_string(CHIMARA_GLK(glk), "Serif 12"); - chimara_glk_set_monospace_font_string(CHIMARA_GLK(glk), "Monospace 12"); + g_signal_connect(glk, "started", G_CALLBACK(on_started), NULL); g_signal_connect(glk, "stopped", G_CALLBACK(on_stopped), NULL); + g_signal_connect(glk, "iliad-screen-update", G_CALLBACK(on_iliad_screen_update), NULL); GtkWidget *vbox = gtk_vbox_new(FALSE, 0); GtkWidget *toolbar = gtk_toolbar_new(); @@ -161,6 +184,15 @@ main(int argc, char *argv[]) textdomain(GETTEXT_PACKAGE); #endif + /* Setup connection to display manager deamon */ + /* + if( (epd = EpdInit(NULL)) == NULL ) { + g_critical("Could not connect to xepdmgr server\n"); + return 1; + } + EpdRefreshAuto(epd, 0); + */ + if( !g_thread_supported() ) g_thread_init(NULL); gdk_threads_init();