[gnumeric] renamed GOColor macros



commit eb817e4afd970eb4c7b0ae0f5e01a2f14cfcbf0a
Author: Jean Brefort <jean brefort normalesup org>
Date:   Tue Sep 1 07:43:43 2009 +0200

    renamed GOColor macros

 ChangeLog                             |   16 ++++++++++++
 plugins/excel/ChangeLog               |    8 ++++++
 plugins/excel/ms-chart.c              |   18 ++++++------
 plugins/excel/ms-excel-read.c         |   10 +++---
 plugins/excel/ms-excel-write.c        |    8 +++---
 plugins/excel/xlsx-read.c             |   44 ++++++++++++++++----------------
 plugins/excel/xlsx-write.c            |    4 +-
 plugins/html/ChangeLog                |    5 +++
 plugins/html/html.c                   |    6 ++--
 plugins/html/latex.c                  |    6 ++--
 plugins/openoffice/ChangeLog          |    4 +++
 plugins/openoffice/openoffice-write.c |    2 +-
 src/dialogs/ChangeLog                 |    8 ++++++
 src/dialogs/dialog-autoformat.c       |    2 +-
 src/dialogs/dialog-cell-format.c      |    8 +++---
 src/dialogs/dialog-printer-setup.c    |   14 +++++-----
 src/gnm-pane.c                        |   14 +++++-----
 src/gnm-so-filled.c                   |   12 ++++----
 src/gnm-so-line.c                     |   12 ++++----
 src/gnm-so-polygon.c                  |    4 +-
 src/gui-util.c                        |    8 +++---
 src/item-bar.c                        |    8 +++---
 src/item-cursor.c                     |    6 ++--
 src/item-edit.c                       |    2 +-
 src/item-grid.c                       |    2 +-
 src/print-cell.c                      |    6 ++--
 src/sheet-object-cell-comment.c       |    2 +-
 src/style-color.c                     |    4 +-
 src/wbc-gtk.c                         |    4 +-
 29 files changed, 144 insertions(+), 103 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 89543ce..7d4c24f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2009-09-01  Jean Brefort  <jean brefort normalesup org>
+
+	* src/gnm-pane.c: renamed GOColor macros.
+	* src/gnm-so-filled.c: ditto.
+	* src/gnm-so-line.c: ditto.
+	* src/gnm-so-polygon.c: ditto.
+	* src/gui-util.c: ditto.
+	* src/item-bar.c: ditto.
+	* src/item-cursor.c: ditto.
+	* src/item-edit.c: ditto.
+	* src/item-grid.c: ditto.
+	* src/print-cell.c: ditto.
+	* src/sheet-object-cell-comment.c: ditto.
+	* src/style-color.c: ditto.
+	* src/wbc-gtk.c: ditto.
+
 2009-08-31  Jean Brefort  <jean brefort normalesup org>
 
 	* src/gnm-pane.c (new_control_point), (set_acetate_coords):
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 65d9705..0b2808d 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-01  Jean Brefort  <jean brefort normalesup org>
+
+	* ms-chart.c: renamed GOColor macros.
+	* ms-excel-read.c: ditto.
+	* ms-excel-write.c: ditto.
+	* xlsx-read.c: ditto.
+	* xlsx-write.c: ditto.
+
 2009-08-31  Jean Brefort  <jean brefort normalesup org>
 
 	* ms-chart.c (lineformat), (ms_excel_chart_read),
diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c
index d37419c..20a30e9 100644
--- a/plugins/excel/ms-chart.c
+++ b/plugins/excel/ms-chart.c
@@ -200,7 +200,7 @@ BC_R(color) (guint8 const *data, char const *type)
 	guint16 const b = (bgr >> 16) & 0xff;
 
 	d (1, g_printerr ("%s %02x:%02x:%02x;\n", type, r, g, b););
-	return RGBA_TO_UINT (r, g, b, 0xff);
+	return GO_RGBA_TO_UINT (r, g, b, 0xff);
 }
 
 /****************************************************************************/
@@ -1070,14 +1070,14 @@ ms_chart_map_color (XLChartReadState const *s, guint32 raw, guint32 alpha)
 	if ((~0x7ffffff) & raw) {
 		GnmColor *c = excel_palette_get (s->container.importer,
 			(0x7ffffff & raw));
-		res = GDK_TO_UINT (c->gdk_color);
+		res = GO_GDK_TO_UINT (c->gdk_color);
 		style_color_unref (c);
 	} else {
 		guint8 r, g, b;
 		r = (raw)       & 0xff;
 		g = (raw >> 8)  & 0xff;
 		b = (raw >> 16) & 0xff;
-		res = RGBA_TO_UINT (r, g, b, 0xff);
+		res = GO_RGBA_TO_UINT (r, g, b, 0xff);
 	}
 	return res;
 }
@@ -3846,9 +3846,9 @@ static unsigned
 chart_write_color (XLChartWriteState *s, guint8 *data, GOColor c)
 {
 	guint32 abgr;
-	abgr  = UINT_RGBA_R(c);
-	abgr |= UINT_RGBA_G(c) << 8;
-	abgr |= UINT_RGBA_B(c) << 16;
+	abgr  = GO_UINT_RGBA_R(c);
+	abgr |= GO_UINT_RGBA_G(c) << 8;
+	abgr |= GO_UINT_RGBA_B(c) << 16;
 	GSF_LE_SET_GUINT32 (data, abgr);
 
 	return palette_get_index (&s->ewb->base, abgr & 0xffffff);
@@ -3870,8 +3870,8 @@ chart_write_AREAFORMAT (XLChartWriteState *s, GOStyle const *style, gboolean dis
 #warning export images
 		case GO_STYLE_FILL_NONE:
 			pat = 0;
-			fore = RGBA_WHITE;
-			back = RGBA_WHITE;
+			fore = GO_RGBA_WHITE;
+			back = GO_RGBA_WHITE;
 			break;
 		case GO_STYLE_FILL_PATTERN: {
 			pat = style->fill.pattern.pattern + 1;
@@ -4865,7 +4865,7 @@ chart_write_axis (XLChartWriteState *s, GogAxis const *axis,
 		tick_color_index = chart_write_color (s, data+4, style->font.color); /* tick label color */
 		memset (data+8, 0, 16);
 		/* if font is black, set the auto color flag, otherwise, don't set */
-		flags = (style->font.color == RGBA_BLACK)? 0x03: 0x02;
+		flags = (style->font.color == GO_RGBA_BLACK)? 0x03: 0x02;
 		if (style->text_layout.auto_angle)
 			flags |= 0x20;
 		else if (style->text_layout.angle < -45)
diff --git a/plugins/excel/ms-excel-read.c b/plugins/excel/ms-excel-read.c
index e07ab6e..a871223 100644
--- a/plugins/excel/ms-excel-read.c
+++ b/plugins/excel/ms-excel-read.c
@@ -356,7 +356,7 @@ ms_sheet_map_color (ExcelReadSheet const *esheet, MSObj const *obj, MSObjAttrID
 		b = (attr->v.v_uint >> 16) & 0xff;
 	}
 
-	return RGBA_TO_UINT (r,g,b,0xff);
+	return GO_RGBA_TO_UINT (r,g,b,0xff);
 }
 
 /**
@@ -513,7 +513,7 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
 	case 0x04: /* Arc */
 		style = go_style_new ();
 		style->line.color = ms_sheet_map_color (esheet, obj,
-			MS_OBJ_ATTR_OUTLINE_COLOR, RGBA_BLACK);
+			MS_OBJ_ATTR_OUTLINE_COLOR, GO_RGBA_BLACK);
 		style->line.width = ms_obj_attr_get_uint (obj->attrs,
 			MS_OBJ_ATTR_OUTLINE_WIDTH, 0) / 256.;
 		style->line.dash_type = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_OUTLINE_HIDE)
@@ -534,15 +534,15 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
 	case 0x0E: /* Label */
 		style = go_style_new ();
 		style->line.color = ms_sheet_map_color (esheet, obj,
-			MS_OBJ_ATTR_OUTLINE_COLOR, RGBA_BLACK);
+			MS_OBJ_ATTR_OUTLINE_COLOR, GO_RGBA_BLACK);
 		style->line.width = ms_obj_attr_get_uint (obj->attrs,
 			MS_OBJ_ATTR_OUTLINE_WIDTH, 0) / 256.;
 		style->line.dash_type = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_OUTLINE_HIDE)
 			? GO_LINE_NONE : xl_pattern_to_line_type (ms_obj_attr_get_int (obj->attrs, MS_OBJ_ATTR_OUTLINE_STYLE, 1));
 		style->fill.pattern.back = ms_sheet_map_color (esheet, obj,
-			MS_OBJ_ATTR_FILL_COLOR, RGBA_WHITE);
+			MS_OBJ_ATTR_FILL_COLOR, GO_RGBA_WHITE);
 		style->fill.pattern.fore = ms_sheet_map_color (esheet, obj,
-			MS_OBJ_ATTR_FILL_BACKGROUND, RGBA_BLACK);
+			MS_OBJ_ATTR_FILL_BACKGROUND, GO_RGBA_BLACK);
 		style->fill.type = ms_obj_attr_bag_lookup (obj->attrs, MS_OBJ_ATTR_UNFILLED)
 			? GO_STYLE_FILL_NONE : GO_STYLE_FILL_PATTERN;
 
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index 1e16300..df4af75 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -141,9 +141,9 @@ static guint
 go_color_to_bgr (GOColor const c)
 {
 	guint32 abgr;
-	abgr  = UINT_RGBA_R(c);
-	abgr |= UINT_RGBA_G(c) << 8;
-	abgr |= UINT_RGBA_B(c) << 16;
+	abgr  = GO_UINT_RGBA_R(c);
+	abgr |= GO_UINT_RGBA_G(c) << 8;
+	abgr |= GO_UINT_RGBA_B(c) << 16;
 	return abgr;
 }
 
@@ -2117,7 +2117,7 @@ excel_font_from_go_font (XLExportBase *ewb, GOFont const *font)
 	efont->underline	= FALSE;
 	efont->strikethrough	= FALSE;
 	efont->script		= 0;
-	efont->color = go_color_to_bgr (RGBA_BLACK);
+	efont->color = go_color_to_bgr (GO_RGBA_BLACK);
 	efont->is_auto = FALSE;
 
 	return put_efont (efont, ewb);
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index ee1043e..1a609bd 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -444,7 +444,7 @@ attr_gocolor (GsfXMLIn *xin, xmlChar const **attrs,
 		guint8 const r = (rgb >> 16) & 0xff;
 		guint8 const g = (rgb >>  8) & 0xff;
 		guint8 const b = (rgb >>  0) & 0xff;
-		*res = RGBA_TO_UINT(r, g, b, 0xff);
+		*res = GO_RGBA_TO_UINT(r, g, b, 0xff);
 	}
 
 	return TRUE;
@@ -646,27 +646,27 @@ indexed_color (XLSXReadState *state, gint idx)
 	 */
 
 	if (idx == 1 || idx == 65)
-		return RGBA_WHITE;
+		return GO_RGBA_WHITE;
 	switch (idx) {
 	case 0:   /* black */
 	case 64 : /* system text ? */
 	case 81 : /* tooltip text */
 	case 0x7fff : /* system text ? */
-		return RGBA_BLACK;
+		return GO_RGBA_BLACK;
 
 	case 1 :  /* white */
 	case 65 : /* system back ? */
-		return RGBA_WHITE;
+		return GO_RGBA_WHITE;
 
 	case 80 : /* tooltip background */
-		return RGBA_YELLOW;
+		return GO_RGBA_YELLOW;
 
-	case 2 : return RGBA_RED;
-	case 3 : return RGBA_GREEN;
-	case 4 : return RGBA_BLUE;
-	case 5 : return RGBA_YELLOW;
-	case 6 : return RGBA_VIOLET;
-	case 7 : return RGBA_CYAN;
+	case 2 : return GO_RGBA_RED;
+	case 3 : return GO_RGBA_GREEN;
+	case 4 : return GO_RGBA_BLUE;
+	case 5 : return GO_RGBA_YELLOW;
+	case 6 : return GO_RGBA_VIOLET;
+	case 7 : return GO_RGBA_CYAN;
 
 	default :
 		 break;
@@ -676,11 +676,11 @@ indexed_color (XLSXReadState *state, gint idx)
 	if (idx < 0 || (int) G_N_ELEMENTS (excel_default_palette_v8) <= idx) {
 		g_warning ("EXCEL: color index (%d) is out of range (8..%d). Defaulting to black",
 			   idx + 8, (int)G_N_ELEMENTS (excel_default_palette_v8) + 8);
-		return RGBA_BLACK;
+		return GO_RGBA_BLACK;
 	}
 
 	/* TODO cache and ref */
-	return RGBA_TO_UINT (excel_default_palette_v8[idx].r,
+	return GO_RGBA_TO_UINT (excel_default_palette_v8[idx].r,
 			     excel_default_palette_v8[idx].g,
 			     excel_default_palette_v8[idx].b, 0xff);
 }
@@ -716,7 +716,7 @@ themed_color (GsfXMLIn *xin, gint idx)
 			      idx, (int) G_N_ELEMENTS (theme_elements));
 	}
 
-	return RGBA_BLACK;
+	return GO_RGBA_BLACK;
 }
 
 static GOFormat *
@@ -1527,7 +1527,7 @@ xlsx_draw_color_alpha (GsfXMLIn *xin, xmlChar const **attrs)
 	int val;
 	if (simple_int (xin, attrs, &val)) {
 		int level = 255 * val / 100000;
-		state->gocolor = UINT_RGBA_CHANGE_A (state->gocolor, level);
+		state->gocolor = GO_UINT_RGBA_CHANGE_A (state->gocolor, level);
 	}
 }
 
@@ -2394,10 +2394,10 @@ hue_to_color (int m1, int m2, int h)
 static GOColor
 apply_tint (GOColor orig, float tint)
 {
-	int r = UINT_RGBA_R (orig);
-	int g = UINT_RGBA_G (orig);
-	int b = UINT_RGBA_B (orig);
-	int a = UINT_RGBA_A (orig);
+	int r = GO_UINT_RGBA_R (orig);
+	int g = GO_UINT_RGBA_G (orig);
+	int b = GO_UINT_RGBA_B (orig);
+	int a = GO_UINT_RGBA_A (orig);
 	int maxC = b, minC = b, delta, sum, h, l, s, m1, m2;
 
 	if (fabs (tint) < .005)
@@ -2438,7 +2438,7 @@ apply_tint (GOColor orig, float tint)
 
 	if (s == 0) {            /* achromatic case */ 
 		r = (l * RGBMAX) / HLSMAX;
-		return RGBA_TO_UINT(r, r, r, a);
+		return GO_RGBA_TO_UINT(r, r, r, a);
 	}
 
 	if (l <= (HLSMAX/2))
@@ -2451,7 +2451,7 @@ apply_tint (GOColor orig, float tint)
 	g = (hue_to_color (m1, m2, h             )*RGBMAX + (HLSMAX/2)) / HLSMAX;
 	b = (hue_to_color (m1, m2, h - (HLSMAX/3))*RGBMAX + (HLSMAX/2)) / HLSMAX;
 
-	return RGBA_TO_UINT(r,g,b,a);
+	return GO_RGBA_TO_UINT(r,g,b,a);
 }
 				
 static GnmColor *
@@ -2473,7 +2473,7 @@ elem_color (GsfXMLIn *xin, xmlChar const **attrs)
 				return NULL;
 			}
 			has_color = TRUE;
-			c = RGBA_TO_UINT(r,g,b,a);
+			c = GO_RGBA_TO_UINT(r,g,b,a);
 		} else if (attr_int (xin, attrs, "indexed", &indx)) {
 			has_color = TRUE;
 			c = indexed_color (state, indx);
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 126ce43..65868bd 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -104,8 +104,8 @@ xlsx_add_rgb (GsfXMLOut *xml, char const *id, GOColor c)
 {
 	char buf [3 * 4 * sizeof (unsigned int) + 1];
 	sprintf (buf, "%02X%02X%02X%02X",
-		 UINT_RGBA_A (c), UINT_RGBA_R (c),
-		 UINT_RGBA_G (c), UINT_RGBA_B (c));
+		 GO_UINT_RGBA_A (c), GO_UINT_RGBA_R (c),
+		 GO_UINT_RGBA_G (c), GO_UINT_RGBA_B (c));
 	gsf_xml_out_add_cstr_unchecked (xml, id, buf);
 }
 static void
diff --git a/plugins/html/ChangeLog b/plugins/html/ChangeLog
index 537f030..483c06f 100644
--- a/plugins/html/ChangeLog
+++ b/plugins/html/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-01  Jean Brefort  <jean brefort normalesup org>
+
+	* html.c (html_get_text_color): renamed GOColor macros.
+	* latex.c (latex2e_write_multicolumn_cell): ditto.
+
 2009-08-30  Morten Welinder <terra gnome org>
 
 	* Release 1.9.11
diff --git a/plugins/html/html.c b/plugins/html/html.c
index 1e7f0fd..89c3cac 100644
--- a/plugins/html/html.c
+++ b/plugins/html/html.c
@@ -120,9 +120,9 @@ html_get_text_color (GnmCell *cell, GnmStyle const *style, guint *r, guint *g, g
 	if (fore == 0)
 		*r = *g = *b = 0;
 	else {
-		*r = UINT_RGBA_R (fore);
-		*g = UINT_RGBA_G (fore);
-		*b = UINT_RGBA_B (fore);
+		*r = GO_UINT_RGBA_R (fore);
+		*g = GO_UINT_RGBA_G (fore);
+		*b = GO_UINT_RGBA_B (fore);
 	}
 }
 static void
diff --git a/plugins/html/latex.c b/plugins/html/latex.c
index 314fd64..4fc3ee1 100644
--- a/plugins/html/latex.c
+++ b/plugins/html/latex.c
@@ -979,9 +979,9 @@ latex2e_write_multicolumn_cell (GsfOutput *output, GnmCell *cell, int start_col,
 		if (fore == 0)
 			r = g = b = 0;
 		else {
-			r = UINT_RGBA_R (fore);
-			g = UINT_RGBA_G (fore);
-			b = UINT_RGBA_B (fore);
+			r = GO_UINT_RGBA_R (fore);
+			g = GO_UINT_RGBA_G (fore);
+			b = GO_UINT_RGBA_B (fore);
 		}
 		if (r != 0 || g != 0 || b != 0) {
 			char *locale;
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 3eeb960..cc43048 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-01  Jean Brefort  <jean brefort normalesup org>
+
+	* openoffice-write.c (gnm_xml_out_add_hex_color): renamed GOColor macros.
+
 2009-08-30  Morten Welinder <terra gnome org>
 
 	* Release 1.9.11
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 53c42fe..2b8ff18 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -411,7 +411,7 @@ gnm_xml_out_add_hex_color (GsfXMLOut *o, char const *id, GnmColor const *c)
 
 /* FIXME! there should be a difference between white and transparent */
 
-	if ((UINT_RGBA_A (c->go_color) == 0) &&
+	if ((GO_UINT_RGBA_A (c->go_color) == 0) &&
 	    c->gdk_color.red/256 == 0xFF &&
 	    c->gdk_color.green/256 == 0xFF &&
 	    c->gdk_color.blue/256 == 0xFF)
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 2012058..9013c1d 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-01  Jean Brefort  <jean brefort normalesup org>
+
+	* dialog-autoformat.c (previews_load): renamed GOColor macros.
+	* dialog-cell-format.c (setup_color_pickers),
+	(draw_border_preview), (init_border_button), (fmt_dialog_impl): ditto.
+	* dialog-printer-setup.c (margin_preview_page_create),
+	(create_hf_preview_canvas): ditto.
+
 2009-08-31  Jean Brefort  <jean brefort normalesup org>
 
 	* dialog-autoformat.c (previews_load): replace GOStyle::outline.
diff --git a/src/dialogs/dialog-autoformat.c b/src/dialogs/dialog-autoformat.c
index b9e243e..54e5290 100644
--- a/src/dialogs/dialog-autoformat.c
+++ b/src/dialogs/dialog-autoformat.c
@@ -338,7 +338,7 @@ previews_load (AutoFormatState *state, int topindex)
 					NULL);
 				style = go_styled_object_get_style (GO_STYLED_OBJECT (state->selrect));
 				style->line.width = 3.;
-				style->line.color = RGBA_RED;
+				style->line.color = GO_RGBA_RED;
 				style->fill.pattern.back = 0;
 				
 				gtk_frame_set_shadow_type (state->frame[i], GTK_SHADOW_IN);
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 8356c5b..f73fa2c 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -390,7 +390,7 @@ setup_color_pickers (FormatState *state,
 	cg = go_color_group_fetch (color_group,
 		 wb_control_view (WORKBOOK_CONTROL (state->wbcg)));
 	combo = go_combo_color_new (NULL, default_caption, 
-		def_sc ? GDK_TO_UINT (def_sc->gdk_color) : RGBA_BLACK, cg);
+		def_sc ? GO_GDK_TO_UINT (def_sc->gdk_color) : GO_RGBA_BLACK, cg);
 	go_combo_box_set_title (GO_COMBO_BOX (combo), caption);
 
 	/* Connect to the sample canvas and redraw it */
@@ -1295,7 +1295,7 @@ draw_border_preview (FormatState *state)
 					       goc_polyline_get_type (),
 					       "points",	points,
 					       NULL)));
-			style->line.color = RGBA_TO_UINT (0xa1, 0xa1, 0xa1, 0xff); /* gray63 */
+			style->line.color = GO_RGBA_TO_UINT (0xa1, 0xa1, 0xa1, 0xff); /* gray63 */
 			style->line.width = 0.;
 		}
 		goc_points_unref (points);
@@ -1442,7 +1442,7 @@ init_border_button (FormatState *state, GnmStyleBorderLocation const i,
 		state->border.edge[i].is_selected = TRUE;
 	} else {
 		GnmColor const *c = border->color;
-		state->border.edge[i].rgba = RGBA_TO_UINT(
+		state->border.edge[i].rgba = GO_RGBA_TO_UINT(
 			c->gdk_color.red >> 8,
 			c->gdk_color.green >> 8,
 			c->gdk_color.blue >> 8, 0xff);
@@ -2501,7 +2501,7 @@ fmt_dialog_impl (FormatState *state, FormatDialogPosition_t pageno)
 	state->border.pattern.draw_preview = NULL;
 	state->border.pattern.current_pattern = NULL;
 	state->border.pattern.state = state;
-	state->border.rgba = RGBA_TO_UINT (
+	state->border.rgba = GO_RGBA_TO_UINT (
 		default_border_color->red   >> 8,
 		default_border_color->green >> 8,
 		default_border_color->blue  >> 8, 0xff);
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index f5006f6..9db330c 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -54,7 +54,7 @@
 #define PAGE_Y (PREVIEW_Y - PREVIEW_MARGIN_Y)
 
 #define MARGIN_COLOR_DEFAULT 0xa9a9a9ff /* dark gray */
-#define MARGIN_COLOR_ACTIVE RGBA_RED
+#define MARGIN_COLOR_ACTIVE GO_RGBA_RED
 
 #define HF_PREVIEW_X 350
 #define HF_PREVIEW_Y 75
@@ -432,8 +432,8 @@ margin_preview_page_create (PrinterSetupState *state)
 			"width",	 (double) x2-x1,
 			"height",	 (double) y2-y1,
 			NULL)));
-	style->fill.pattern.back = RGBA_BLACK;
-	style->line.color = RGBA_BLACK;
+	style->fill.pattern.back = GO_RGBA_BLACK;
+	style->line.color = GO_RGBA_BLACK;
 	style->line.width = 1.;
 
 	style = go_styled_object_get_style (
@@ -444,8 +444,8 @@ margin_preview_page_create (PrinterSetupState *state)
 			"width",	 (double) x2-x1,
 			"height",	 (double) y2-y1,
 			NULL)));
-	style->fill.pattern.back = RGBA_WHITE;
-	style->line.color = RGBA_BLACK;
+	style->fill.pattern.back = GO_RGBA_WHITE;
+	style->line.color = GO_RGBA_BLACK;
 	style->line.width = 1.;
 
 	draw_margins (state, x1, y1, x2, y2);
@@ -1876,7 +1876,7 @@ create_hf_preview_canvas (PrinterSetupState *state, gboolean header)
 			"width",	width,
 			"height",	height + (header ? -shadow: shadow),
 			NULL)));
-	gostyle->fill.pattern.back = RGBA_BLACK;
+	gostyle->fill.pattern.back = GO_RGBA_BLACK;
 	gostyle->line.width = 0.;
 	gostyle->line.color = 0;
 
@@ -1888,7 +1888,7 @@ create_hf_preview_canvas (PrinterSetupState *state, gboolean header)
 			"width",	width,
 			"height",	height,
 			NULL)));
-	gostyle->fill.pattern.back = RGBA_WHITE;
+	gostyle->fill.pattern.back = GO_RGBA_WHITE;
 	gostyle->line.width = 0.;
 	gostyle->line.color = 0;
 
diff --git a/src/gnm-pane.c b/src/gnm-pane.c
index f2413b7..199358b 100644
--- a/src/gnm-pane.c
+++ b/src/gnm-pane.c
@@ -1988,19 +1988,19 @@ gnm_pane_size_guide_start (GnmPane *pane, gboolean vert, int colrow, int width)
 	/* cheat for now and differentiate between col/row resize and frozen panes
 	 * using the width.  Frozen pane guides do not require a start line */
 	if (width == 1) {
-		style->line.color = RGBA_BLACK;
+		style->line.color = GO_RGBA_BLACK;
 		pane->size_guide.start = goc_item_new (pane->action_items,
 			GOC_TYPE_LINE,
 			"x0", x0, "y0", y0,
 			"x1", x1, "y1", y1,
 			NULL);
 		style = go_styled_object_get_style (GO_STYLED_OBJECT (pane->size_guide.start));
-		style->line.color = RGBA_BLACK;
+		style->line.color = GO_RGBA_BLACK;
 		style->line.width = width;
 	} else {
 		style->line.pattern = GO_PATTERN_GREY25;
-		style->line.color = RGBA_WHITE;
-		style->line.fore = RGBA_BLACK;
+		style->line.color = GO_RGBA_WHITE;
+		style->line.fore = GO_RGBA_BLACK;
 	}
 }
 
@@ -2693,7 +2693,7 @@ control_point_enter_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED
 	idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "index"));
 	if (idx != 8) {
 		GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
-		style->fill.pattern.back = RGBA_GREEN;
+		style->fill.pattern.back = GO_RGBA_GREEN;
 		goc_item_invalidate (item);
 		gnm_pane_display_obj_size_tip (pane, so);
 	}
@@ -2714,7 +2714,7 @@ control_point_leave_notify (GocItem *item, G_GNUC_UNUSED double x, G_GNUC_UNUSED
 	idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "index"));
 	if (idx != 8) {
 		GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
-		style->fill.pattern.back = RGBA_WHITE;
+		style->fill.pattern.back = GO_RGBA_WHITE;
 		goc_item_invalidate (item);
 		gnm_pane_clear_obj_size_tip (pane);
 	}
@@ -2857,7 +2857,7 @@ set_acetate_coords (GnmPane *pane, SheetObject *so, GocItem **ctrl_pts,
 			style->line.width = 1.;
 			style->line.auto_color = FALSE;
 			style->line.color = 0;
-			style->line.fore = RGBA_BLACK;
+			style->line.fore = GO_RGBA_BLACK;
 			ctrl_pts [9] = goc_item_new (pane->action_items,
 				GOC_TYPE_RECTANGLE,
 				"style", style,
diff --git a/src/gnm-so-filled.c b/src/gnm-so-filled.c
index c701c40..78bad6e 100644
--- a/src/gnm-so-filled.c
+++ b/src/gnm-so-filled.c
@@ -137,10 +137,10 @@ sof_default_style (void)
 	GOStyle *res = go_style_new ();
 	res->interesting_fields = GO_STYLE_OUTLINE | GO_STYLE_FILL;
 	res->line.width = 0; /* hairline */
-	res->line.color = RGBA_BLACK;
+	res->line.color = GO_RGBA_BLACK;
 	res->line.dash_type = GO_LINE_SOLID; /* anything but 0 */
 	res->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&res->fill.pattern, RGBA_WHITE);
+	go_pattern_set_solid (&res->fill.pattern, GO_RGBA_WHITE);
 	return res;
 }
 
@@ -252,10 +252,10 @@ gnm_so_filled_draw_cairo (SheetObject const *so, cairo_t *cr,
 	/* Draw the line */
 	cairo_set_line_width (cr, (style->line.width)? style->line.width: 1.);
 	cairo_set_source_rgba (cr,
-		UINT_RGBA_R(style->line.color),
-		UINT_RGBA_B(style->line.color),
-		UINT_RGBA_G(style->line.color),
-		UINT_RGBA_A(style->line.color));
+		GO_UINT_RGBA_R(style->line.color),
+		GO_UINT_RGBA_B(style->line.color),
+		GO_UINT_RGBA_G(style->line.color),
+		GO_UINT_RGBA_A(style->line.color));
 	cairo_stroke (cr);
 	/* Draw the text. */
 	if (*(sof->text) != '\0') {
diff --git a/src/gnm-so-line.c b/src/gnm-so-line.c
index 78ad5ed..11b9c55 100644
--- a/src/gnm-so-line.c
+++ b/src/gnm-so-line.c
@@ -51,7 +51,7 @@ typedef struct {
 static void
 go_arrow_init (GOArrow *res, double a, double b, double c)
 {
-	res->color = RGBA_BLACK;
+	res->color = GO_RGBA_BLACK;
 	res->a = a;
 	res->b = b;
 	res->c = c;
@@ -126,7 +126,7 @@ sol_default_style (void)
 	GOStyle *res = go_style_new ();
 	res->interesting_fields = GO_STYLE_LINE;
 	res->line.width   = 0; /* hairline */
-	res->line.color   = RGBA_BLACK;
+	res->line.color   = GO_RGBA_BLACK;
 	res->line.dash_type = GO_LINE_SOLID; /* anything but 0 */
 	return res;
 }
@@ -225,10 +225,10 @@ gnm_so_line_draw_cairo (SheetObject const *so, cairo_t *cr,
 
 	cairo_set_line_width (cr, (style->width)? style->width: 1.);
 	cairo_set_source_rgba (cr,
-		UINT_RGBA_R(style->color),
-		UINT_RGBA_B(style->color),
-		UINT_RGBA_G(style->color),
-		UINT_RGBA_A(style->color));
+		GO_UINT_RGBA_R(style->color),
+		GO_UINT_RGBA_B(style->color),
+		GO_UINT_RGBA_G(style->color),
+		GO_UINT_RGBA_A(style->color));
 
 	if (sol->end_arrow.c > 0.) {
 		double phi;
diff --git a/src/gnm-so-polygon.c b/src/gnm-so-polygon.c
index 53e689a..1460b13 100644
--- a/src/gnm-so-polygon.c
+++ b/src/gnm-so-polygon.c
@@ -121,11 +121,11 @@ sop_default_style (void)
 	GOStyle *res = go_style_new ();
 	res->interesting_fields = GO_STYLE_OUTLINE | GO_STYLE_FILL;
 	res->line.width = 0; /* hairline */
-	res->line.color = RGBA_BLACK;
+	res->line.color = GO_RGBA_BLACK;
 	res->line.dash_type = GO_LINE_SOLID; /* anything but 0 */
 	res->line.join = CAIRO_LINE_JOIN_ROUND;
 	res->fill.type = GO_STYLE_FILL_PATTERN;
-	go_pattern_set_solid (&res->fill.pattern, RGBA_WHITE);
+	go_pattern_set_solid (&res->fill.pattern, GO_RGBA_WHITE);
 	return res;
 }
 
diff --git a/src/gui-util.c b/src/gui-util.c
index c999a4e..52927ce 100644
--- a/src/gui-util.c
+++ b/src/gui-util.c
@@ -607,10 +607,10 @@ go_combo_color_get_style_color (GtkWidget *go_combo_color)
 	GnmColor *sc = NULL;
 	guint16   r, g, b;
 	GOColor color = go_combo_color_get_color (GO_COMBO_COLOR (go_combo_color), NULL);
-	if (UINT_RGBA_A (color) >= 0x80) {
-		r  = UINT_RGBA_R (color); r |= (r << 8);
-		g  = UINT_RGBA_G (color); g |= (g << 8);
-		b  = UINT_RGBA_B (color); b |= (b << 8);
+	if (GO_UINT_RGBA_A (color) >= 0x80) {
+		r  = GO_UINT_RGBA_R (color); r |= (r << 8);
+		g  = GO_UINT_RGBA_G (color); g |= (g << 8);
+		b  = GO_UINT_RGBA_B (color); b |= (b << 8);
 		sc = style_color_new (r, g, b);
 	}
 	return sc;
diff --git a/src/item-bar.c b/src/item-bar.c
index 7fc3548..3a689e2 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -243,21 +243,21 @@ ib_draw_cell (ItemBar const * const ib, cairo_t *cr,
 	case COL_ROW_NO_SELECTION:
 		shadow = GTK_SHADOW_OUT;
 		font   = ib->normal_font;
-		color = GDK_TO_UINT (widget->style->bg[GTK_STATE_ACTIVE]);
+		color = GO_GDK_TO_UINT (widget->style->bg[GTK_STATE_ACTIVE]);
 		ascent = ib->normal_font_ascent;
 		break;
 
 	case COL_ROW_PARTIAL_SELECTION:
 		shadow = GTK_SHADOW_OUT;
 		font   = ib->bold_font;
-		color = GDK_TO_UINT (widget->style->dark[GTK_STATE_PRELIGHT]);
+		color = GO_GDK_TO_UINT (widget->style->dark[GTK_STATE_PRELIGHT]);
 		ascent = ib->bold_font_ascent;
 		break;
 
 	case COL_ROW_FULL_SELECTION:
 		shadow = GTK_SHADOW_IN;
 		font   = ib->bold_font;
-		color = GDK_TO_UINT (widget->style->dark[GTK_STATE_NORMAL]);
+		color = GO_GDK_TO_UINT (widget->style->dark[GTK_STATE_NORMAL]);
 		ascent = ib->bold_font_ascent;
 		break;
 	}
@@ -326,7 +326,7 @@ item_bar_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
 	int shadow;
 	int first_line_offset = 1;
 	GtkStyle *style = gtk_widget_get_style (canvas);
-	GOColor color = GDK_TO_UINT (style->text[GTK_STATE_NORMAL]);
+	GOColor color = GO_GDK_TO_UINT (style->text[GTK_STATE_NORMAL]);
 	goc_canvas_c2w (item->canvas, x_0, y_0, &x0, &y0);
 	goc_canvas_c2w (item->canvas, x_1, y_1, &x1, &y1);
 
diff --git a/src/item-cursor.c b/src/item-cursor.c
index 425e8a0..268432c 100644
--- a/src/item-cursor.c
+++ b/src/item-cursor.c
@@ -146,8 +146,8 @@ item_cursor_realize (GocItem *item)
 	if (ic->style == ITEM_CURSOR_DRAG || ic->style == ITEM_CURSOR_AUTOFILL) {
 		GOPattern pat;
 		cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET (item->canvas)));
-		pat.fore = RGBA_BLACK;
-		pat.back = RGBA_WHITE;
+		pat.fore = GO_RGBA_BLACK;
+		pat.back = GO_RGBA_WHITE;
 		pat.pattern = GO_PATTERN_GREY50;
 		ic->stipple = go_pattern_create_cairo_pattern (&pat, cr);
 		cairo_destroy (cr);
@@ -1264,7 +1264,7 @@ item_cursor_init (ItemCursor *ic)
 	ic->auto_fill_handle_at_top = FALSE;
 	ic->auto_fill_handle_at_left = FALSE;
 	ic->drag_button = -1;
-	ic->color = RGBA_BLACK;
+	ic->color = GO_RGBA_BLACK;
 }
 
 GSF_CLASS (ItemCursor, item_cursor,
diff --git a/src/item-edit.c b/src/item-edit.c
index 40bb20c..2ae4d30 100644
--- a/src/item-edit.c
+++ b/src/item-edit.c
@@ -110,7 +110,7 @@ item_edit_draw (GocItem const *item, cairo_t *cr)
 	cairo_set_source_rgba (cr, 1., 1., 0.878431373, 1.);
 	cairo_fill (cr);
 
-	color = GDK_TO_UINT (gtk_widget_get_style (GTK_WIDGET (item->canvas))->black);
+	color = GO_GDK_TO_UINT (gtk_widget_get_style (GTK_WIDGET (item->canvas))->black);
 	cairo_set_source_rgba (cr, GO_COLOR_TO_CAIRO (color));
 	cairo_move_to (cr, left, top);
 	layout = pango_cairo_create_layout (cr);
diff --git a/src/item-grid.c b/src/item-grid.c
index b5d9fa7..3d67be7 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -417,7 +417,7 @@ item_grid_draw_region (GocItem const *item, cairo_t *cr, double x_0, double y_0,
 	/* Fill entire region with default background (even past far edge) */
 	cairo_save (cr);
 	/* FIXME: we previously used gs_white */
-	cairo_set_source_rgba (cr, GO_COLOR_TO_CAIRO (RGBA_WHITE));
+	cairo_set_source_rgba (cr, GO_COLOR_TO_CAIRO (GO_RGBA_WHITE));
 	cairo_rectangle (cr, x0, y0, width, height);
 	cairo_fill (cr);
 	cairo_restore (cr);
diff --git a/src/print-cell.c b/src/print-cell.c
index f02c383..1cc44e6 100644
--- a/src/print-cell.c
+++ b/src/print-cell.c
@@ -111,9 +111,9 @@ print_cell_gtk (GnmCell const *cell, GnmStyle const *mstyle,
 #endif
 		/* Set the font colour */
 		cairo_set_source_rgb (context,
-			 UINT_RGBA_R (fore_color) / 255.,
-			 UINT_RGBA_G (fore_color) / 255.,
-			 UINT_RGBA_B (fore_color) / 255.);
+			 GO_UINT_RGBA_R (fore_color) / 255.,
+			 GO_UINT_RGBA_G (fore_color) / 255.,
+			 GO_UINT_RGBA_B (fore_color) / 255.);
 
 		cairo_translate (context, x1+0.5, y1);
 
diff --git a/src/sheet-object-cell-comment.c b/src/sheet-object-cell-comment.c
index 9ec5303..c6a030e 100644
--- a/src/sheet-object-cell-comment.c
+++ b/src/sheet-object-cell-comment.c
@@ -259,7 +259,7 @@ cell_comment_new_view (SheetObject *so, SheetObjectViewContainer *container)
 		GO_STYLED_OBJECT (goc_item_new (GOC_GROUP (view),
 			GOC_TYPE_POLYGON, NULL)));
 	style->line.dash_type = GO_LINE_NONE;
-	style->fill.pattern.back = RGBA_RED;
+	style->fill.pattern.back = GO_RGBA_RED;
 	return gnm_pane_object_register (so, view, FALSE);
 }
 
diff --git a/src/style-color.c b/src/style-color.c
index 9cef5d6..9181233 100644
--- a/src/style-color.c
+++ b/src/style-color.c
@@ -44,7 +44,7 @@ style_color_new_uninterned (gushort red, gushort green, gushort blue,
 	sc->gdk_color.green = green;
 	sc->gdk_color.blue = blue;
 	sc->gdk_color.pixel = gs_white.pixel;
-	sc->go_color = RGBA_TO_UINT (red>>8,green>>8,blue>>8,0xff);
+	sc->go_color = GO_RGBA_TO_UINT (red>>8,green>>8,blue>>8,0xff);
 	sc->name = NULL;
 	sc->is_auto = is_auto;
 
@@ -110,7 +110,7 @@ GnmColor *
 style_color_new_go (GOColor c)
 {
 	return style_color_new_i8 (
-		UINT_RGBA_R (c), UINT_RGBA_G (c), UINT_RGBA_B (c));
+		GO_UINT_RGBA_R (c), GO_UINT_RGBA_G (c), GO_UINT_RGBA_B (c));
 }
 
 GnmColor *
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 431a978..ad53a7b 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -2798,7 +2798,7 @@ cb_fore_color_changed (GOActionComboColor *a, WBCGtk *wbcg)
 	c = go_action_combo_color_get_color (a, &is_default);
 
 	if (wbcg_is_editing (wbcg)) {
-		GnmColor *color = style_color_new_go (is_default ? RGBA_BLACK : c);
+		GnmColor *color = style_color_new_go (is_default ? GO_RGBA_BLACK : c);
 		wbcg_edit_add_markup (wbcg, pango_attr_foreground_new (
 			color->gdk_color.red, color->gdk_color.green, color->gdk_color.blue));
 		style_color_unref (color);
@@ -2816,7 +2816,7 @@ static void
 wbc_gtk_init_color_fore (WBCGtk *gtk)
 {
 	GnmColor *sc_auto_font = style_color_auto_font ();
-	GOColor   default_color = GDK_TO_UINT(sc_auto_font->gdk_color);
+	GOColor   default_color = GO_GDK_TO_UINT(sc_auto_font->gdk_color);
 	style_color_unref (sc_auto_font);
 
 	gtk->fore_color = go_action_combo_color_new ("ColorFore", "font",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]