6 #include <glib/gprintf.h>
8 #include "chimara-glk.h"
10 G_GNUC_INTERNAL void style_init_textbuffer(GtkTextBuffer *buffer);
11 G_GNUC_INTERNAL void style_init_textgrid(GtkTextBuffer *buffer);
12 G_GNUC_INTERNAL void style_init_more_prompt(winid_t win);
13 G_GNUC_INTERNAL void style_init(ChimaraGlk *glk);
14 G_GNUC_INTERNAL void style_update(ChimaraGlk *glk);
15 G_GNUC_INTERNAL const gchar** style_get_tag_names();
16 G_GNUC_INTERNAL void reset_default_styles(ChimaraGlk *glk);
17 G_GNUC_INTERNAL GScanner *create_css_file_scanner(void);
18 G_GNUC_INTERNAL void scan_css_file(GScanner *scanner, ChimaraGlk *glk);
19 G_GNUC_INTERNAL PangoFontDescription *get_current_font(guint32 wintype);
20 G_GNUC_INTERNAL GtkTextTag* gtk_text_tag_copy(GtkTextTag *tag);
21 G_GNUC_INTERNAL void glkcolor_to_gdkcolor(glui32 val, GdkColor *color);
22 G_GNUC_INTERNAL gchar* glkcolor_to_hex(glui32 val);
23 G_GNUC_INTERNAL gchar* gdkcolor_to_hex(GdkColor *color);
24 G_GNUC_INTERNAL void style_stream_colors(strid_t str, GdkColor **foreground, GdkColor **background);
26 typedef struct StyleSet {
27 GHashTable *text_grid;
28 GHashTable *text_buffer;
31 #define CHIMARA_NUM_STYLES 13
33 //#define DEBUG_STYLES
35 #define ACTUAL_FG(tag) \
36 (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "background-gdk":"foreground-gdk")
38 #define ACTUAL_BG(tag) \
39 (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "foreground-gdk":"background-gdk")
41 #define ASSIGN_COLOR(to, from) \
42 (to)->red = (from)->red; \
43 (to)->green = (from)->green; \
44 (to)->blue = (from)->blue;