X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fstyle.h;h=ee456d88c8ab3dab868009f3f8570b647a708021;hb=3c59ba5eef5cb4d39c06eb7f523b9c3b026bdc9b;hp=9a16c1a7d983971e3bd2d6857f5d3f8fe6f58c50;hpb=cb02f32df09ceaf4c10bf8fd60837100d719057b;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/style.h b/libchimara/style.h index 9a16c1a..ee456d8 100644 --- a/libchimara/style.h +++ b/libchimara/style.h @@ -3,22 +3,43 @@ #include #include -#include -#include +#include #include "glk.h" -#include "magic.h" -#include "chimara-glk-private.h" -#include "stream.h" -#include "strio.h" +#include "chimara-glk.h" G_GNUC_INTERNAL void style_init_textbuffer(GtkTextBuffer *buffer); G_GNUC_INTERNAL void style_init_textgrid(GtkTextBuffer *buffer); -G_GNUC_INTERNAL void style_init(); -G_GNUC_INTERNAL PangoFontDescription* get_current_font(guint32 wintype); +G_GNUC_INTERNAL void style_init(ChimaraGlk *glk); +G_GNUC_INTERNAL const gchar** style_get_tag_names(); +G_GNUC_INTERNAL void reset_default_styles(ChimaraGlk *glk); +G_GNUC_INTERNAL GScanner *create_css_file_scanner(void); +G_GNUC_INTERNAL void scan_css_file(GScanner *scanner, ChimaraGlk *glk); +G_GNUC_INTERNAL PangoFontDescription *get_current_font(guint32 wintype); +G_GNUC_INTERNAL GtkTextTag* gtk_text_tag_copy(GtkTextTag *tag); +G_GNUC_INTERNAL void glkcolor_to_gdkcolor(glui32 val, GdkColor *color); +G_GNUC_INTERNAL gchar* glkcolor_to_hex(glui32 val); +G_GNUC_INTERNAL gchar* gdkcolor_to_hex(GdkColor *color); +G_GNUC_INTERNAL void style_stream_colors(strid_t str, GdkColor **foreground, GdkColor **background); +G_GNUC_INTERNAL void style_apply(winid_t win, GtkTextIter *start, GtkTextIter *end); typedef struct StyleSet { GHashTable *text_grid; GHashTable *text_buffer; } StyleSet; +#define CHIMARA_NUM_STYLES 12 + +//#define DEBUG_STYLES + +#define ACTUAL_FG(tag) \ + (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "background-gdk":"foreground-gdk") + +#define ACTUAL_BG(tag) \ + (GPOINTER_TO_INT( g_object_get_data(G_OBJECT((tag)), "reverse-color")) ? "foreground-gdk":"background-gdk") + +#define ASSIGN_COLOR(to, from) \ + (to)->red = (from)->red; \ + (to)->green = (from)->green; \ + (to)->blue = (from)->blue; + #endif