Overhauled the whole reverse video thing.
[projects/chimara/chimara.git] / libchimara / style.h
index 5766f843a97fa553dce66b98aecc547cea684ccc..0cfbbdd010884a7db7de28222193d9233eb3361f 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <gtk/gtk.h>
 #include <glib.h>
+#include <glib/gprintf.h>
 #include "glk.h"
 #include "chimara-glk.h"
 
@@ -19,6 +20,7 @@ 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 void style_stream_colors(strid_t str, GdkColor **foreground, GdkColor **background);
 
 typedef struct StyleSet {
        GHashTable *text_grid;
@@ -27,4 +29,17 @@ typedef struct StyleSet {
 
 #define CHIMARA_NUM_STYLES 13
 
+// #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