No need to include empty default signal handlers
[projects/chimara/chimara.git] / libchimara / style.h
1 #ifndef STYLE_H
2 #define STYLE_H
3
4 #include <gtk/gtk.h>
5 #include <glib.h>
6 #include <glib/gprintf.h>
7 #include "glk.h"
8 #include "chimara-glk.h"
9
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);
24
25 typedef struct StyleSet {
26         GHashTable *text_grid;
27         GHashTable *text_buffer;
28 } StyleSet;
29
30 #define CHIMARA_NUM_STYLES 12
31
32 //#define DEBUG_STYLES
33
34 #define ACTUAL_FG(tag) \
35         (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "background-gdk":"foreground-gdk")
36
37 #define ACTUAL_BG(tag) \
38         (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "foreground-gdk":"background-gdk")
39
40 #define ASSIGN_COLOR(to, from) \
41         (to)->red = (from)->red; \
42         (to)->green = (from)->green; \
43         (to)->blue = (from)->blue;
44
45 #endif