summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-10-10 21:02:24 -0400
committerTingPing <tingping@tingping.se>2013-10-10 21:02:24 -0400
commitcbf275777ce3c9d4357f7a7ce6a8a89c51857df3 (patch)
tree7f2e65f1589b691f27cb5d4d098ba35b748a7b71 /src
parent04f34feb26227dc02500fafa6e0b77b0b310aea7 (diff)
xtext: store palette as GdkColors
Diffstat (limited to 'src')
-rw-r--r--src/fe-gtk/xtext.c18
-rw-r--r--src/fe-gtk/xtext.h2
2 files changed, 6 insertions, 14 deletions
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index 49001b02..efe372fb 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -349,19 +349,13 @@ backend_draw_text (GtkXText *xtext, int dofill, GdkGC *gc, int x, int y,
 static void
 xtext_set_fg (GtkXText *xtext, GdkGC *gc, int index)
 {
-	GdkColor col;
-
-	col.pixel = xtext->palette[index];
-	gdk_gc_set_foreground (gc, &col);
+	gdk_gc_set_foreground (gc, &xtext->palette[index]);
 }
 
 static void
 xtext_set_bg (GtkXText *xtext, GdkGC *gc, int index)
 {
-	GdkColor col;
-
-	col.pixel = xtext->palette[index];
-	gdk_gc_set_background (gc, &col);
+	gdk_gc_set_background (gc, &xtext->palette[index]);
 }
 
 static void
@@ -685,8 +679,7 @@ gtk_xtext_realize (GtkWidget * widget)
 	gdk_gc_set_foreground (xtext->thin_gc, &col);
 
 	/* for the marker bar (marker) */
-	col.pixel = xtext->palette[XTEXT_MARKER];
-	gdk_gc_set_foreground (xtext->marker_gc, &col);
+	gdk_gc_set_foreground (xtext->marker_gc, &xtext->palette[XTEXT_MARKER]);
 
 	xtext_set_fg (xtext, xtext->fgc, XTEXT_FG);
 	xtext_set_bg (xtext, xtext->fgc, XTEXT_BG);
@@ -3241,7 +3234,7 @@ gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[])
 
 	for (i = (XTEXT_COLS-1); i >= 0; i--)
 	{
-		xtext->palette[i] = palette[i].pixel;
+		xtext->palette[i] = palette[i];
 	}
 
 	if (GTK_WIDGET_REALIZED (xtext))
@@ -3250,8 +3243,7 @@ gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[])
 		xtext_set_bg (xtext, xtext->fgc, XTEXT_BG);
 		xtext_set_fg (xtext, xtext->bgc, XTEXT_BG);
 
-		col.pixel = xtext->palette[XTEXT_MARKER];
-		gdk_gc_set_foreground (xtext->marker_gc, &col);
+		gdk_gc_set_foreground (xtext->marker_gc, &xtext->palette[XTEXT_MARKER]);
 	}
 	xtext->col_fore = XTEXT_FG;
 	xtext->col_back = XTEXT_BG;
diff --git a/src/fe-gtk/xtext.h b/src/fe-gtk/xtext.h
index 4f3e1ec7..c704638f 100644
--- a/src/fe-gtk/xtext.h
+++ b/src/fe-gtk/xtext.h
@@ -141,7 +141,7 @@ struct _GtkXText
 	GdkGC *dark_gc;
 	GdkGC *thin_gc;
 	GdkGC *marker_gc;
-	gulong palette[XTEXT_COLS];
+	GdkColor palette[XTEXT_COLS];
 
 	gint io_tag;					  /* for delayed refresh events */
 	gint add_io_tag;				  /* "" when adding new text */