Change I/O signals to pass a unique window ID
[projects/chimara/chimara.git] / libchimara / window.h
index 48ced889e332dc5464c9d5e0d89e26e290ab85cc..1ce7aaa6d3d40a498fd17a3019fbde49a7b00224 100644 (file)
@@ -2,11 +2,15 @@
 #define WINDOW_H
 
 #include <gtk/gtk.h>
+#include "chimara-glk-private.h"
 #include "glk.h"
-
+#include "gi_dispa.h"
 #include "stream.h"
 #include "input.h"
 #include "style.h"
+#include "hyperlink.h"
+#include "mouse.h"
+#include "graphics.h"
 
 
 enum InputRequestType
@@ -28,6 +32,8 @@ struct glk_window_struct
 {
        /*< private >*/
        glui32 magic, rock;
+       char *librock; /* "library rock" - unique string identifier */
+       gidispatch_rock_t disprock;
        /* Pointer to the node in the global tree that contains this window */
        GNode *window_node;
        /* Window parameters */
@@ -37,6 +43,10 @@ struct glk_window_struct
        /* "frame" is the widget that is the child of the ChimaraGlk container, such 
        as a scroll window. It may be the same as "widget". */
        GtkWidget *frame;
+       /* In text buffer windows, the scrolled window and the pager are extra
+       widgets that are neither "widget" nor "frame" */
+       GtkWidget *scrolledwindow;
+       GtkWidget *pager;
        /* Width and height of the window's size units, in pixels */
        int unit_width;
        int unit_height;
@@ -55,14 +65,43 @@ struct glk_window_struct
        gchar *line_input_buffer;
        glui32 *line_input_buffer_unicode;
        glui32 line_input_buffer_max_len;
+       gidispatch_rock_t buffer_rock;
        gboolean mouse_input_requested;
+       GList *history;
+       GList *history_pos;
+       GSList *extra_line_terminators;
+       GSList *current_extra_line_terminators;
+       /* Line input echoing (text buffers only) */
+       gboolean echo_line_input;
+       gboolean echo_current_line_input;
        /* Line input field (text grids only) */
        glui32 input_length;
        GtkTextChildAnchor *input_anchor;
        GtkWidget *input_entry;
+       gulong line_input_entry_changed;
        /* Signal handlers */
-       gulong keypress_handler;
+       gulong char_input_keypress_handler;
+       gulong line_input_keypress_handler;
        gulong insert_text_handler;
+       gulong tag_event_handler;
+       gulong shutdown_keypress_handler;
+       gulong button_press_event_handler;
+       gulong size_allocate_handler;
+       gulong pager_keypress_handler;
+       gulong pager_adjustment_handler;
+       /* Window buffer */
+       GString *buffer;
+       GtkTextTag *zcolor;
+       GtkTextTag *zcolor_reversed;
+       /* Hyperlinks */
+       GHashTable *hyperlinks;
+       struct hyperlink *current_hyperlink;
+       gboolean hyperlink_event_requested;
+       /* Graphics */
+       glui32 background_color;
+       cairo_surface_t *backing_store;
+       /* Pager (textbuffer only) */
+       gboolean currently_paging;
 };
 
 #endif