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(ChimaraGlk *glk);
13 G_GNUC_INTERNAL const gchar** style_get_tag_names();
14 G_GNUC_INTERNAL void reset_default_styles(ChimaraGlk *glk);
15 G_GNUC_INTERNAL GScanner *create_css_file_scanner(void);
16 G_GNUC_INTERNAL void scan_css_file(GScanner *scanner, ChimaraGlk *glk);
17 G_GNUC_INTERNAL PangoFontDescription *get_current_font(guint32 wintype);
18 G_GNUC_INTERNAL GtkTextTag* gtk_text_tag_copy(GtkTextTag *tag);
19 G_GNUC_INTERNAL void glkcolor_to_gdkcolor(glui32 val, GdkColor *color);
20 G_GNUC_INTERNAL gchar* glkcolor_to_hex(glui32 val);
21 G_GNUC_INTERNAL gchar* gdkcolor_to_hex(GdkColor *color);
22 G_GNUC_INTERNAL void style_stream_colors(strid_t str, GdkColor **foreground, GdkColor **background);
23 G_GNUC_INTERNAL void style_apply(winid_t win, GtkTextIter *start, GtkTextIter *end);
25 typedef struct StyleSet {
26 GHashTable *text_grid;
27 GHashTable *text_buffer;
30 #define CHIMARA_NUM_STYLES 12
32 //#define DEBUG_STYLES
34 #define ACTUAL_FG(tag) \
35 (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "background-gdk":"foreground-gdk")
37 #define ACTUAL_BG(tag) \
38 (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "foreground-gdk":"background-gdk")
40 #define ASSIGN_COLOR(to, from) \
41 (to)->red = (from)->red; \
42 (to)->green = (from)->green; \
43 (to)->blue = (from)->blue;