Improvements to the iliad client
authorrodin <rodin@ddfedd41-794f-dd11-ae45-00112f111e67>
Tue, 11 May 2010 12:06:33 +0000 (12:06 +0000)
committerrodin <rodin@ddfedd41-794f-dd11-ae45-00112f111e67>
Tue, 11 May 2010 12:06:33 +0000 (12:06 +0000)
iliad/chimara.png
libchimara/chimara-glk.c
libchimara/chimara-glk.h
libchimara/chimara-marshallers.txt
player/iliad.c

index 92a4211a5a8b2d63902a743a7d4b434ba920d9a1..05b3cd90fbaae4580766008f441fafe461e79f91 100644 (file)
Binary files a/iliad/chimara.png and b/iliad/chimara.png differ
index 5162046fee0470530782c1f09fa28f2b35287bd6..b422ef1792c1f14e5c7cf563babb1b612e21effc 100644 (file)
@@ -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 */
     /**
index 75c774075772080c9601b7c394b526bd5d5e0b0a..8eca95f17a7066efd0d6041fb03d36afad17dd66 100644 (file)
@@ -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;
 
 /**
index d4fccc52bf60f6ae469e1b34021b3695a38ace68..559ccfcf48a2a2af6f2288095e8ea39c99b4f4e8 100644 (file)
@@ -3,3 +3,4 @@
 VOID:UINT,UINT
 VOID:UINT,STRING
 VOID:STRING,STRING
+VOID:BOOLEAN
index ac1460adf0d612456558211cdfe67729f9add2f5..abb2ad121587fab5bdb2f12f8e49ee2c01af3b50 100644 (file)
 #include <liberipc/eripcviewer.h>
 #include <liberipc/eripctoolbar.h>
 #include <liberipc/eripcbusyd.h>
+/*#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();