[dia/dia-next: 3/59] Use GdkRGBA instead of GdkColor/Color
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/dia-next: 3/59] Use GdkRGBA instead of GdkColor/Color
- Date: Wed, 9 Jan 2019 18:34:33 +0000 (UTC)
commit 4308f5ba6ced0ecafb8695cb47bd45633b1fb33c
Author: Zander Brown <zbrown gnome org>
Date: Mon Dec 10 22:55:58 2018 +0000
Use GdkRGBA instead of GdkColor/Color
Means we have just one representation of colours, things will be broken
app/color_area.c | 41 ++++------
app/connectionpoint_ops.c | 7 +-
app/diagram.h | 2 +-
app/diagrid.h | 2 +-
app/diapagelayout.c | 2 +-
app/display.c | 1 -
app/handle_ops.c | 9 +--
app/highlight.h | 1 -
app/linewidth_area.c | 2 +-
app/magnify.c | 6 +-
app/modify_tool.c | 5 +-
app/navigation.c | 4 +-
app/preferences.c | 18 ++---
bindings/dia-properties.cpp | 2 +-
bindings/dia-properties.h | 4 +-
bindings/dia-renderer.h | 34 ++++-----
lib/Makefile.am | 2 -
lib/arrows.c | 84 ++++++++++-----------
lib/arrows.h | 3 +-
lib/attributes.c | 14 ++--
lib/attributes.h | 12 +--
lib/bezier-common.c | 2 +-
lib/color.c | 121 ------------------------------
lib/color.h | 62 ---------------
lib/dia_svg.c | 2 +-
lib/dia_svg.h | 2 +-
lib/dia_xml.c | 4 +-
lib/dia_xml.h | 6 +-
lib/diaarrowchooser.c | 11 +--
lib/diacolorselector.c | 18 ++---
lib/diagramdata.c | 6 +-
lib/diagramdata.h | 6 +-
lib/diaimportrenderer.c | 76 +++++++++----------
lib/dialib.c | 3 -
lib/dialinechooser.c | 4 +-
lib/diapathrenderer.c | 42 +++++------
lib/diapatternselector.c | 2 +-
lib/diarenderer.c | 86 ++++++++++-----------
lib/diarenderer.h | 48 ++++++------
lib/diasvgrenderer.c | 40 +++++-----
lib/diasvgrenderer.h | 2 +-
lib/diatransformrenderer.c | 26 +++----
lib/diatypes.h | 3 -
lib/layer.c | 2 +-
lib/libdia.def | 6 --
lib/pattern.c | 15 ++--
lib/pattern.h | 6 +-
lib/persistence.c | 26 +++----
lib/persistence.h | 6 +-
lib/prop_attr.c | 8 +-
lib/prop_attr.h | 2 +-
lib/prop_pattern.c | 4 +-
lib/properties.h | 7 +-
lib/proplist.c | 8 +-
lib/renderer/diacairo-interactive.c | 23 +++---
lib/renderer/diacairo-renderer.c | 38 +++++-----
lib/standard-path.c | 8 +-
lib/text.c | 8 +-
lib/text.h | 8 +-
lib/textattr.h | 3 +-
lib/widgets.h | 5 +-
objects/AADL/aadl.h | 4 +-
objects/Database/compound.c | 6 +-
objects/Database/database.h | 10 +--
objects/Database/table.c | 14 ++--
objects/ER/attribute.c | 8 +-
objects/ER/entity.c | 4 +-
objects/ER/relationship.c | 4 +-
objects/FS/flow-ortho.c | 6 +-
objects/FS/flow.c | 10 +--
objects/GRAFCET/action.c | 3 +-
objects/GRAFCET/boolequation.c | 2 +-
objects/GRAFCET/boolequation.h | 4 +-
objects/GRAFCET/condition.c | 5 +-
objects/GRAFCET/step.c | 4 +-
objects/GRAFCET/transition.c | 5 +-
objects/GRAFCET/vergent.c | 1 -
objects/Istar/goal.c | 1 -
objects/Istar/other.c | 1 -
objects/Jackson/domain.c | 1 -
objects/KAOS/goal.c | 1 -
objects/KAOS/metabinrel.c | 2 +-
objects/KAOS/other.c | 1 -
objects/Misc/analog_clock.c | 9 +--
objects/Misc/diagram_as_object.c | 4 +-
objects/Misc/grid_object.c | 7 +-
objects/Misc/measure.c | 2 +-
objects/Misc/n_gon.c | 6 +-
objects/Misc/tree.c | 2 +-
objects/SADT/annotation.c | 4 +-
objects/SADT/arrow.c | 13 ++--
objects/SADT/box.c | 5 +-
objects/UML/activity.c | 4 +-
objects/UML/actor.c | 4 +-
objects/UML/association.c | 4 +-
objects/UML/branch.c | 6 +-
objects/UML/class.c | 24 +++---
objects/UML/class.h | 6 +-
objects/UML/class_dialog.c | 6 +-
objects/UML/classicon.c | 4 +-
objects/UML/component.c | 4 +-
objects/UML/component_feature.c | 2 +-
objects/UML/constraint.c | 4 +-
objects/UML/dependency.c | 4 +-
objects/UML/fork.c | 2 +-
objects/UML/generalization.c | 4 +-
objects/UML/implements.c | 4 +-
objects/UML/large_package.c | 6 +-
objects/UML/lifeline.c | 4 +-
objects/UML/message.c | 4 +-
objects/UML/node.c | 4 +-
objects/UML/note.c | 4 +-
objects/UML/object.c | 4 +-
objects/UML/realizes.c | 4 +-
objects/UML/small_package.c | 4 +-
objects/UML/state.c | 4 +-
objects/UML/state_term.c | 4 +-
objects/UML/transition.c | 4 +-
objects/UML/usecase.c | 4 +-
objects/chronogram/chronoline.c | 11 ++-
objects/chronogram/chronoref.c | 5 +-
objects/custom/custom_object.c | 12 +--
objects/custom_lines/line_info.h | 2 +-
objects/flowchart/box.c | 8 +-
objects/flowchart/diamond.c | 8 +-
objects/flowchart/ellipse.c | 8 +-
objects/flowchart/parallelogram.c | 8 +-
objects/network/basestation.c | 4 +-
objects/network/bus.c | 2 +-
objects/network/radiocell.c | 4 +-
objects/network/wanlink.c | 4 +-
objects/standard/arc.c | 6 +-
objects/standard/bezier.c | 4 +-
objects/standard/beziergon.c | 10 +--
objects/standard/box.c | 10 +--
objects/standard/ellipse.c | 12 +--
objects/standard/image.c | 4 +-
objects/standard/line.c | 4 +-
objects/standard/outline.c | 4 +-
objects/standard/polygon.c | 10 +--
objects/standard/polyline.c | 4 +-
objects/standard/textobj.c | 6 +-
objects/standard/zigzagline.c | 4 +-
plug-ins/cgm/cgm.c | 40 +++++-----
plug-ins/drs/dia-render-script-import.c | 11 ++-
plug-ins/drs/dia-render-script-renderer.c | 38 +++++-----
plug-ins/dxf/dxf-export.c | 28 +++----
plug-ins/dxf/dxf-import.c | 16 ++--
plug-ins/hpgl/hpgl.c | 28 +++----
plug-ins/metapost/render_metapost.c | 30 ++++----
plug-ins/metapost/render_metapost.h | 2 +-
plug-ins/pgf/render_pgf.c | 98 ++++++++++++------------
plug-ins/pixbuf/pixbuf.c | 10 +--
plug-ins/postscript/diapsft2renderer.c | 6 +-
plug-ins/postscript/diapsrenderer.c | 32 ++++----
plug-ins/postscript/diapsrenderer.h | 5 +-
plug-ins/pstricks/render_pstricks.c | 54 ++++++-------
plug-ins/python/pydia-color.c | 4 +-
plug-ins/python/pydia-color.h | 5 +-
plug-ins/python/pydia-render.c | 26 +++----
plug-ins/python/pydia-text.h | 1 -
plug-ins/shape/shape-export.c | 24 +++---
plug-ins/svg/render_svg.c | 10 +--
plug-ins/svg/svg-import.c | 6 +-
plug-ins/vdx/vdx-common.c | 1 -
plug-ins/vdx/vdx-export.c | 38 +++++-----
plug-ins/vdx/vdx-import.c | 10 +--
plug-ins/vdx/vdx.h | 4 +-
plug-ins/vdx/visio-types.h | 10 +--
plug-ins/wpg/wpg-import.c | 6 +-
plug-ins/wpg/wpg.c | 30 ++++----
plug-ins/xfig/xfig-common.c | 4 +-
plug-ins/xfig/xfig-export.c | 74 +++++++++---------
plug-ins/xfig/xfig-import.c | 10 +--
174 files changed, 928 insertions(+), 1178 deletions(-)
---
diff --git a/app/color_area.c b/app/color_area.c
index 92871d3a..006e75e5 100644
--- a/app/color_area.c
+++ b/app/color_area.c
@@ -22,7 +22,6 @@
#include <stdio.h>
-#include "../lib/color.h"
#include "intl.h"
#include "color_area.h"
@@ -49,8 +48,8 @@ static GdkPixbuf *swap_pixmap = NULL;
static GtkWidget *color_select = NULL;
static int color_select_active = 0;
static int edit_color;
-static Color stored_foreground;
-static Color stored_background;
+static GdkRGBA stored_foreground;
+static GdkRGBA stored_background;
static void
@@ -106,9 +105,8 @@ color_area_target (int x,
static void
color_area_draw (cairo_t *color_area_ctx)
{
- Color col;
- GdkColor *win_bg;
- GdkColor fg, bg;
+ GdkRGBA *win_bg;
+ GdkRGBA fg, bg;
gint rect_w, rect_h;
gint width, height;
gint img_width, img_height;
@@ -124,10 +122,8 @@ color_area_draw (cairo_t *color_area_ctx)
style = gtk_widget_get_style(color_area);
win_bg = &(style->bg[GTK_STATE_NORMAL]);
- col = attributes_get_foreground();
- color_convert(&col, &fg);
- col = attributes_get_background();
- color_convert(&col, &bg);
+ fg = attributes_get_foreground();
+ bg = attributes_get_background();
rect_w = width * 0.65;
rect_h = height * 0.65;
@@ -192,17 +188,12 @@ color_selection_ok (GtkWidget *w,
GtkColorSelectionDialog *cs)
{
GtkColorSelection *colorsel;
- GdkColor color;
+ GdkRGBA color;
guint alpha;
- Color col;
colorsel=GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(cs));
- gtk_color_selection_get_current_color(colorsel,&color);
- GDK_COLOR_TO_DIA(color, col);
-
- alpha = gtk_color_selection_get_current_alpha(colorsel);
- col.alpha = alpha / 65535.0;
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (colorsel), &color);
if (edit_color == FOREGROUND) {
attributes_set_foreground(&col);
@@ -255,17 +246,13 @@ color_selection_changed (GtkWidget *w,
GtkColorSelectionDialog *cs)
{
GtkColorSelection *colorsel;
- GdkColor color;
+ GdkRGBA color;
guint alpha;
- Color col;
colorsel=GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(cs));
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (colorsel), &color);
gtk_color_selection_get_current_color(colorsel,&color);
- GDK_COLOR_TO_DIA(color, col);
-
- alpha = gtk_color_selection_get_current_alpha(colorsel);
- col.alpha = alpha / 65535.0;
if (edit_color == FOREGROUND) {
attributes_set_foreground(&col);
@@ -279,9 +266,8 @@ color_selection_changed (GtkWidget *w,
static void
color_area_edit (void)
{
- Color col;
GtkWidget *window;
- GdkColor color;
+ GdkRGBA color;
GtkColorSelectionDialog *csd;
GtkColorSelection *colorsel;
@@ -291,10 +277,10 @@ color_area_edit (void)
}
if (active_color == FOREGROUND) {
- col = attributes_get_foreground();
+ color = attributes_get_foreground();
edit_color = FOREGROUND;
} else {
- col = attributes_get_background();
+ color = attributes_get_background();
edit_color = BACKGROUND;
}
@@ -355,7 +341,6 @@ color_area_edit (void)
/* Make sure window is shown before setting its colors: */
gtk_widget_show_now (color_select);
}
- DIA_COLOR_TO_GDK(col, color);
gtk_color_selection_set_current_color(colorsel, &color);
gtk_color_selection_set_current_alpha(colorsel, (guint)(col.alpha * 65535.0));
diff --git a/app/connectionpoint_ops.c b/app/connectionpoint_ops.c
index 26d078c3..44173e36 100644
--- a/app/connectionpoint_ops.c
+++ b/app/connectionpoint_ops.c
@@ -21,14 +21,13 @@
#include "connectionpoint_ops.h"
#include "object_ops.h"
-#include "color.h"
#include "object.h"
#include "connectionpoint.h"
#define CONNECTIONPOINT_SIZE 7
#define CHANGED_TRESHOLD 0.001
-static Color connectionpoint_color = { 0.4, 0.4, 1.0, 1.0 };
+static GdkRGBA connectionpoint_color = { 0.4, 0.4, 1.0, 1.0 };
#define CP_SZ (CONNECTIONPOINT_SIZE/2)
@@ -37,7 +36,7 @@ connectionpoint_draw(ConnectionPoint *conpoint,
DDisplay *ddisp,
DiaRenderer *renderer,
DiaInteractiveRendererInterface *irenderer,
- Color *color)
+ GdkRGBA *color)
{
int x,y;
Point *point = &conpoint->pos;
@@ -59,7 +58,7 @@ void
object_draw_connectionpoints(DiaObject *obj, DDisplay *ddisp)
{
int i;
- static Color midpoint_color = { 1.0, 0.0, 0.0, 1.0 };
+ static GdkRGBA midpoint_color = { 1.0, 0.0, 0.0, 1.0 };
DiaRenderer *renderer = ddisp->renderer;
DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (ddisp->renderer);
DiaInteractiveRendererInterface *irenderer =
diff --git a/app/diagram.h b/app/diagram.h
index 1c213cfa..b5509621 100644
--- a/app/diagram.h
+++ b/app/diagram.h
@@ -48,7 +48,7 @@ struct _Diagram {
char *autosavefilename; /* Holds the name of the current autosave file
* for this diagram, or NULL. */
- Color pagebreak_color; /*!< just to show page breaks */
+ GdkRGBA pagebreak_color; /*!< just to show page breaks */
DiaGrid grid; /*!< the display grid */
/*! almost completely unused guides (load and save code is there) */
diff --git a/app/diagrid.h b/app/diagrid.h
index 3239d71e..0690596c 100644
--- a/app/diagrid.h
+++ b/app/diagrid.h
@@ -19,7 +19,7 @@ struct _DiaGrid {
gboolean dynamic;
/* The color of the grid lines.
*/
- Color colour;
+ GdkRGBA colour;
/** True if this grid is a hex grid. */
gboolean hex;
/** Size of each edge on a hex grid. */
diff --git a/app/diapagelayout.c b/app/diapagelayout.c
index 53522718..dd0fe0f6 100644
--- a/app/diapagelayout.c
+++ b/app/diapagelayout.c
@@ -58,7 +58,7 @@ struct _DiaPageLayout {
GtkWidget *darea;
- GdkColor white, black, blue;
+ GdkRGBA white, black, blue;
gint papernum; /* index into page_metrics array */
/* position of paper preview */
diff --git a/app/display.c b/app/display.c
index 7dc3c4a2..ff5e9fe3 100644
--- a/app/display.c
+++ b/app/display.c
@@ -32,7 +32,6 @@
#include "disp_callbacks.h"
#include "interface.h"
#include "focus.h"
-#include "color.h"
#include "object.h"
#include "handle_ops.h"
#include "connectionpoint_ops.h"
diff --git a/app/handle_ops.c b/app/handle_ops.c
index 03fe31d9..1b80c703 100644
--- a/app/handle_ops.c
+++ b/app/handle_ops.c
@@ -19,12 +19,11 @@
#include "handle_ops.h"
#include "handle.h"
-#include "color.h"
/* This value is best left odd so that the handles are centered. */
#define HANDLE_SIZE 9
-static const Color handle_color[NUM_HANDLE_TYPES<<1] =
+static const GdkRGBA handle_color[NUM_HANDLE_TYPES<<1] =
{
{ 0.0, 0.0, 0.5, 1.0 }, /* HANDLE_NON_MOVABLE */
{ 0.0, 1.0, 0.0, 1.0 }, /* HANDLE_MAJOR_CONTROL */
@@ -35,7 +34,7 @@ static const Color handle_color[NUM_HANDLE_TYPES<<1] =
{ 0.7, 0.4, 0.0, 1.0 }, /* HANDLE_MINOR_CONTROL */
};
-static const Color handle_color_connected[NUM_HANDLE_TYPES<<1] =
+static const GdkRGBA handle_color_connected[NUM_HANDLE_TYPES<<1] =
{
{ 0.0, 0.0, 0.5, 1.0 }, /* HANDLE_NON_MOVABLE */
{ 1.0, 0.0, 0.0, 1.0 }, /* HANDLE_MAJOR_CONTROL */
@@ -54,7 +53,7 @@ handle_draw(Handle *handle, DDisplay *ddisp)
DiaRenderer *renderer = ddisp->renderer;
DiaInteractiveRendererInterface *irenderer =
DIA_GET_INTERACTIVE_RENDERER_INTERFACE (ddisp->renderer);
- const Color *color;
+ const GdkRGBA *color;
ddisplay_transform_coords(ddisp, handle->pos.x, handle->pos.y, &x, &y);
/* change handle color to reflect different behaviour for multiple selected */
@@ -78,7 +77,7 @@ handle_draw(Handle *handle, DDisplay *ddisp)
y - HANDLE_SIZE/2 + 1,
HANDLE_SIZE-2, HANDLE_SIZE-2,
/* it does not change the color, but does not reflect taht in the signature */
- (Color *)color);
+ (GdkRGBA *)color);
irenderer->draw_pixel_rect(renderer,
x - HANDLE_SIZE/2,
diff --git a/app/highlight.h b/app/highlight.h
index 8913de6b..ac737ff8 100644
--- a/app/highlight.h
+++ b/app/highlight.h
@@ -22,7 +22,6 @@
#include "diatypes.h"
#include "diagram.h"
-#include "color.h"
/* Each object holds the color it is highlighted with.
*/
diff --git a/app/linewidth_area.c b/app/linewidth_area.c
index 891406b2..d9a0c687 100644
--- a/app/linewidth_area.c
+++ b/app/linewidth_area.c
@@ -65,7 +65,7 @@ linewidth_area_target (int x, int y)
static void
linewidth_area_draw (GtkWidget *linewidth_area)
{
- GdkColor *win_bg, *win_fg;
+ GdkRGBA *win_bg, *win_fg;
int width, height;
int i;
int x_offs;
diff --git a/app/magnify.c b/app/magnify.c
index 88f77930..1439e3ca 100644
--- a/app/magnify.c
+++ b/app/magnify.c
@@ -105,12 +105,12 @@ magnify_motion(MagnifyTool *tool, GdkEventMotion *event,
intPoint tl, br;
if (tool->box_active) {
- GdkColor white;
+ GdkRGBA white;
cairo_t *ctx;
double dashes[] = { 3 };
tool->moved = TRUE;
- color_convert(&color_white, &white);
+ gdk_rgba_parse (&white, "#FFFFFF");
ctx = gdk_cairo_create(gtk_widget_get_window(ddisp->canvas));
@@ -119,7 +119,7 @@ magnify_motion(MagnifyTool *tool, GdkEventMotion *event,
cairo_set_line_join (ctx, CAIRO_LINE_JOIN_MITER);
cairo_set_dash (ctx, dashes, 1, 0);
- gdk_cairo_set_source_color (ctx, &white);
+ gdk_cairo_set_source_rgba (ctx, &white);
cairo_set_operator (ctx, CAIRO_OPERATOR_XOR);
tl.x = MIN(tool->x, tool->oldx); tl.y = MIN(tool->y, tool->oldy);
diff --git a/app/modify_tool.c b/app/modify_tool.c
index a7f96784..f7556a61 100644
--- a/app/modify_tool.c
+++ b/app/modify_tool.c
@@ -297,9 +297,10 @@ modify_button_press(ModifyTool *tool, GdkEventButton *event,
tool->y1 = tool->y2 = (int) event->y;
if (tool->gc == NULL) {
- GdkColor white;
+ GdkRGBA white;
+
+ gdk_rgba_parse (&white, "#FFFFFF");
- color_convert(&color_white, &white);
tool->gc = gdk_gc_new(gtk_widget_get_window(ddisp->canvas));
gdk_gc_set_line_attributes(tool->gc, 1, GDK_LINE_ON_OFF_DASH,
GDK_CAP_BUTT, GDK_JOIN_MITER);
diff --git a/app/navigation.c b/app/navigation.c
index c9413a9e..649adfc1 100644
--- a/app/navigation.c
+++ b/app/navigation.c
@@ -239,8 +239,8 @@ on_button_navigation_popup_pressed (GtkButton * button, gpointer _ddisp)
} else { /*the miniframe is very small, so we use a minimalist cursor*/
gchar cursor_none_data[] = { 0x00 };
GdkBitmap * bitmap;
- GdkColor fg = { 0, 65535, 65535, 65535};
- GdkColor bg = { 0, 0, 0, 0 };
+ GdkRGBA fg = { 0, 1, 1, 1 };
+ GdkRGBA bg = { 0, 0, 0, 0 };
bitmap = gdk_bitmap_create_from_data(NULL, cursor_none_data, 1, 1);
nav->cursor = gdk_cursor_new_from_pixmap(bitmap, bitmap, &fg, &bg, 1, 1);
diff --git a/app/preferences.c b/app/preferences.c
index c45cd38d..bb195f09 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -91,8 +91,8 @@ static int default_int_w = 500;
static int default_int_h = 400;
static int default_undo_depth = 15;
static guint default_recent_documents = 5;
-static Color default_colour = DEFAULT_GRID_COLOR;
-static Color pbreak_colour = DEFAULT_PAGEBREAK_COLOR;
+static GdkRGBA default_colour = DEFAULT_GRID_COLOR;
+static GdkRGBA pbreak_colour = DEFAULT_PAGEBREAK_COLOR;
static const gchar *default_paper_name = NULL;
static const gchar *default_length_unit = "Centimeter";
static const gchar *default_fontsize_unit = "Point";
@@ -301,8 +301,8 @@ prefs_set_defaults(void)
*(real *)ptr = persistence_register_real(prefs_data[i].name, *(real *)ptr);
break;
case PREF_COLOUR:
- *(Color *)ptr = *(Color *)prefs_data[i].default_value;
- *(Color *)ptr = *persistence_register_color(prefs_data[i].name, (Color *)ptr);
+ *(GdkRGBA *)ptr = *(GdkRGBA *)prefs_data[i].default_value;
+ *(GdkRGBA *)ptr = *persistence_register_color(prefs_data[i].name, (GdkRGBA *)ptr);
break;
case PREF_CHOICE:
case PREF_STRING:
@@ -345,7 +345,7 @@ prefs_save(void)
persistence_set_real(prefs_data[i].name, *(real *)ptr);
break;
case PREF_COLOUR:
- persistence_set_color(prefs_data[i].name, (Color *)ptr);
+ persistence_set_color(prefs_data[i].name, (GdkRGBA *)ptr);
break;
case PREF_CHOICE:
case PREF_STRING:
@@ -385,7 +385,7 @@ prefs_set_value_in_widget(GtkWidget * widget, DiaPrefData *data,
(gfloat) (*((real *)ptr)));
break;
case PREF_COLOUR:
- dia_color_selector_set_color(widget, (Color *)ptr);
+ dia_color_selector_set_color(widget, (GdkRGBA *)ptr);
break;
case PREF_CHOICE: {
GList *names = (data->choice_list_function)(data);
@@ -436,9 +436,9 @@ prefs_get_value_from_widget(GtkWidget * widget, DiaPrefData *data,
}
break;
case PREF_COLOUR: {
- Color prev = *(Color *)ptr;
- dia_color_selector_get_color(widget, (Color *)ptr);
- changed = memcmp (&prev, ptr, sizeof(Color));
+ GdkRGBA prev = *(GdkRGBA *)ptr;
+ dia_color_selector_get_color(widget, (GdkRGBA *)ptr);
+ changed = memcmp (&prev, ptr, sizeof(GdkRGBA));
}
break;
case PREF_CHOICE: {
diff --git a/bindings/dia-properties.cpp b/bindings/dia-properties.cpp
index 77e2521b..64f91553 100644
--- a/bindings/dia-properties.cpp
+++ b/bindings/dia-properties.cpp
@@ -165,7 +165,7 @@ dia::Property< ::Property* >::~Property ()
* in the .swig file.
*/
bool
-dia::Property< ::Property* >::get (::_Color* v) const
+dia::Property< ::Property* >::get (::GdkRGBA* v) const
{
g_return_val_if_fail (self != NULL, false);
if (strcmp (self->descr->type, PROP_TYPE_COLOUR) == 0) {
diff --git a/bindings/dia-properties.h b/bindings/dia-properties.h
index d9f32313..05a5e49d 100644
--- a/bindings/dia-properties.h
+++ b/bindings/dia-properties.h
@@ -40,7 +40,7 @@ public :
//! one more ;)
virtual bool get (::_Rectangle* p) const { return false; }
//! and this one ...
- virtual bool get (::_Color* p) const { return false; }
+ virtual bool get (::GdkRGBA* p) const { return false; }
//! we can also handle vector<IProperty*>
virtual bool get (const std::vector<IProperty*>**) const { return false; }
@@ -131,7 +131,7 @@ public :
//! one more ;)
virtual bool get (::_Rectangle* p) const;
//! and this one ...
- virtual bool get (::_Color* p) const;
+ virtual bool get (::GdkRGBA* p) const;
//! we can also handle vector<IProperty*>
virtual bool get (const std::vector<IProperty*>**) const;
diff --git a/bindings/dia-renderer.h b/bindings/dia-renderer.h
index bc770903..a52466f7 100644
--- a/bindings/dia-renderer.h
+++ b/bindings/dia-renderer.h
@@ -73,29 +73,29 @@ public :
virtual void set_font (Font* font, double height);
//! Draw a line from start to end, using color and the current line style
//! \ingroup RendererRequired
- virtual void draw_line (Point *start, Point *end, Color *color);
+ virtual void draw_line (Point *start, Point *end, GdkRGBA *color);
//! Fill and/or stroke a rectangle, given its upper-left and lower-right corners
//! \ingroup RendererRequired
- virtual void draw_rect (Point *ul_corner, Point *lr_corner, Color *fill, Color *stroke);
+ virtual void draw_rect (Point *ul_corner, Point *lr_corner, GdkRGBA *fill, GdkRGBA *stroke);
//! the polygon is filled using the current fill type, no border is drawn
//! \ingroup RendererRequired
- virtual void draw_polygon (Point *points, int num_points, Color *fill, Color *stroke);
+ virtual void draw_polygon (Point *points, int num_points, GdkRGBA *fill, GdkRGBA *stroke);
//! Draw an arc, given its center, the bounding box (widget, height), the start angle and the end angle
//! \ingroup RendererRequired
virtual void draw_arc (Point *center, double width, double height,
double angle1, double angle2,
- Color *color);
+ GdkRGBA *color);
//! Same a DrawArcFunc except the arc is filled (a pie-chart)
//! \ingroup RendererRequired
virtual void fill_arc (Point *center, double width, double height,
double angle1, double angle2,
- Color *color);
+ GdkRGBA *color);
//! Draw an ellipse, given its center and the bounding box
//! \ingroup RendererRequired
- virtual void draw_ellipse (Point *center, double width, double height, Color *fill, Color *stroke);
+ virtual void draw_ellipse (Point *center, double width, double height, GdkRGBA *fill, GdkRGBA *stroke);
//! Print a string at pos, using the current font
//! \ingroup RendererRequired
- virtual void draw_string (const gchar *text, Point *pos, Alignment alignment, Color *color);
+ virtual void draw_string (const gchar *text, Point *pos, Alignment alignment, GdkRGBA *color);
//! Draw an image, given its bounding box
//! \ingroup RendererRequired
virtual void draw_image (Point *point, double width, double height, Image* image);
@@ -106,13 +106,13 @@ public :
//! draw a bezier line - possibly as approximation consisting of straight lines
//! \ingroup RenderMedium
- virtual void draw_bezier (BezPoint *points, int numpoints, Color *color);
+ virtual void draw_bezier (BezPoint *points, int numpoints, GdkRGBA *color);
//! fill and/or stroke a bezier - possibly as approximation consisting of a polygon
//! \ingroup RenderMedium
- virtual void draw_beziergon (BezPoint *points, int numpoints, Color *fill, Color *stroke);
+ virtual void draw_beziergon (BezPoint *points, int numpoints, GdkRGBA *fill, GdkRGBA *stroke);
//! drawing a polyline - or fallback to single line segments
//! \ingroup RenderMedium
- virtual void draw_polyline (Point *points, int num_points, Color *color);
+ virtual void draw_polyline (Point *points, int num_points, GdkRGBA *color);
//! draw a Text. It holds its own information like position, style, ...
//! \ingroup RenderMedium
virtual void draw_text (Text* text);
@@ -123,30 +123,30 @@ public :
//! a polyline with round coners
//! \ingroup RenderHigh
- virtual void draw_rounded_polyline (Point *points, int num_points, Color *color, double radius);
+ virtual void draw_rounded_polyline (Point *points, int num_points, GdkRGBA *color, double radius);
//! specialized draw_rect() with round corners
//! \ingroup RenderHigh
virtual void draw_rounded_rect (Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius);
+ GdkRGBA *fill, GdkRGBA *stroke, real radius);
//! specialized draw_line() for renderers with an own concept of Arrow
//! \ingroup RenderHigh
- virtual void draw_line_with_arrows (Point *start, Point *end, real line_width, Color *line_color,
+ virtual void draw_line_with_arrows (Point *start, Point *end, real line_width, GdkRGBA *line_color,
Arrow *start_arrow, Arrow *end_arrow);
//! specialized draw_line() for renderers with an own concept of Arrow
//! \ingroup RenderHigh
- virtual void draw_arc_with_arrows (Point *start, Point *end, Point *midpoint, real line_width, Color
*color,
+ virtual void draw_arc_with_arrows (Point *start, Point *end, Point *midpoint, real line_width, GdkRGBA
*color,
Arrow *start_arrow, Arrow *end_arrow);
//! specialized draw_polyline() for renderers with an own concept of Arrow
//! \ingroup RenderHigh
- virtual void draw_polyline_with_arrows (Point *points, int num_points, real line_width, Color *color,
+ virtual void draw_polyline_with_arrows (Point *points, int num_points, real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
//! specialized draw_rounded_polyline() for renderers with an own concept of Arrow
//! \ingroup RenderHigh
- virtual void draw_rounded_polyline_with_arrows (Point *points, int num_points, real line_width, Color
*color,
+ virtual void draw_rounded_polyline_with_arrows (Point *points, int num_points, real line_width, GdkRGBA
*color,
Arrow *start_arrow, Arrow *end_arrow, real radius);
//! specialized draw_bezier() for renderers with an own concept of Arrow
//! \ingroup RenderHigh
- virtual void draw_bezier_with_arrows (BezPoint *points, int num_points, real line_width, Color *color,
+ virtual void draw_bezier_with_arrows (BezPoint *points, int num_points, real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
private :
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e689c121..e9b521f8 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -72,8 +72,6 @@ libdia_la_SOURCES = \
layer.c \
geometry.h \
geometry.c \
- color.h \
- color.c \
dia_xml.c \
dia_xml.h \
dia_xml_libxml.h \
diff --git a/lib/arrows.c b/lib/arrows.c
index 8df15805..b5dc6e64 100644
--- a/lib/arrows.c
+++ b/lib/arrows.c
@@ -46,7 +46,7 @@
static void
draw_empty_ellipse(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color);
+ GdkRGBA *fg_color);
static void
calculate_double_arrow(Point *second_to, Point *second_from,
const Point *to, const Point *from, real length);
@@ -54,7 +54,7 @@ calculate_double_arrow(Point *second_to, Point *second_from,
static void
draw_crow_foot(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color);
+ GdkRGBA *fg_colorGdkRGBA *bg_color);
static int
calculate_diamond(Point *poly/*[4]*/, const Point *to, const Point *from,
real length, real width);
@@ -391,7 +391,7 @@ calculate_crow(Point *poly, const Point *to, const Point *from,
static void
draw_none_or_many(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
Point second_from, second_to;
@@ -424,7 +424,7 @@ draw_none_or_many(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_one_exactly(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
Point vl,vt;
Point bs,be;
@@ -468,7 +468,7 @@ draw_one_exactly(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_one_or_many(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
Point poly[6];
@@ -500,7 +500,7 @@ draw_one_or_many(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_one_or_none(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
Point vl,vt;
Point bs,be;
@@ -540,7 +540,7 @@ draw_one_or_none(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_crow_foot(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
Point poly[3];
@@ -567,7 +567,7 @@ draw_crow_foot(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_lines(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[3];
@@ -603,7 +603,7 @@ calculate_ellipse (Point *poly, const Point *to, const Point *from,
static void
draw_fill_ellipse(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
BezPoint bp[5];
Point vl,vt;
@@ -668,7 +668,7 @@ draw_fill_ellipse(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_empty_ellipse(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color)
+ GdkRGBA *fg_color)
{
BezPoint bp[5];
Point vl,vt;
@@ -768,7 +768,7 @@ calculate_box (Point *poly, const Point *to, const Point *from,
static void
draw_fill_box(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color,Color *bg_color)
+ GdkRGBA *fg_color,GdkRGBA *bg_color)
{
Point poly[6];
real lw_factor,clength,cwidth;
@@ -817,7 +817,7 @@ calculate_dot (Point *poly, const Point *to, const Point *from,
static void
draw_fill_dot(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
BezPoint bp[5];
Point vl,vt;
@@ -905,7 +905,7 @@ draw_fill_dot(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_integral(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color)
+ GdkRGBA *fg_color)
{
BezPoint bp[2];
Point vl,vt;
@@ -994,7 +994,7 @@ calculate_slashed (Point *poly, const Point *to, const Point *from,
static void
draw_slashed(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[6];
@@ -1068,7 +1068,7 @@ calculate_halfhead(Point *poly, const Point *to, const Point *from,
static void
draw_halfhead(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[3];
@@ -1094,7 +1094,7 @@ draw_halfhead(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_triangle(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *bg_color, Color *fg_color)
+ GdkRGBA *bg_color, GdkRGBA *fg_color)
{
Point poly[3];
@@ -1169,7 +1169,7 @@ calculate_diamond(Point *poly, const Point *to, const Point *from,
static void
draw_diamond(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
Point poly[4];
@@ -1195,7 +1195,7 @@ draw_diamond(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_half_diamond(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[4];
@@ -1271,7 +1271,7 @@ calculate_slashed_cross(Point *poly, const Point *to, const Point *from,
static void
draw_slashed_cross(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[6];
@@ -1335,7 +1335,7 @@ calculate_backslash (Point *poly, const Point *to, const Point *from,
static void
draw_backslash(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[2];
@@ -1361,7 +1361,7 @@ draw_backslash(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_cross(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[6];
@@ -1425,7 +1425,7 @@ calculate_double_arrow(Point *second_to, Point *second_from,
static void
draw_double_triangle(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *bg_color, Color *fg_color)
+ GdkRGBA *bg_color, GdkRGBA *fg_color)
{
Point second_from, second_to;
@@ -1504,7 +1504,7 @@ calculate_concave(Point *poly, const Point *to, const Point *from,
static void
draw_concave_triangle(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point poly[4];
@@ -1533,7 +1533,7 @@ draw_concave_triangle(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_rounded(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point p = *to;
Point delta;
@@ -1586,7 +1586,7 @@ draw_rounded(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_open_rounded(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point p = *to;
Point delta;
@@ -1630,7 +1630,7 @@ draw_open_rounded(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_filled_dot_n_triangle(DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
Point p_dot = *to, p_tri = *to, delta;
real len, rayon;
@@ -1680,7 +1680,7 @@ draw_filled_dot_n_triangle(DiaRenderer *renderer, Point *to, Point *from,
*/
static void
draw_three_dots(DiaRenderer *renderer, Point *to, Point *from,
- real length, real width, real linewidth, Color *fg_color)
+ real length, real width, real linewidth, GdkRGBA *fg_color)
{
gdouble dot_width;
@@ -1714,7 +1714,7 @@ draw_three_dots(DiaRenderer *renderer, Point *to, Point *from,
static void
draw_hollow_triangle (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_triangle(renderer, to, from, length, width, linewidth, bg_color, fg_color);
}
@@ -1722,14 +1722,14 @@ draw_hollow_triangle (DiaRenderer *renderer, Point *to, Point *from,
static void
draw_filled_triangle (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_triangle(renderer, to, from, length, width, linewidth, fg_color, fg_color);
}
static void
draw_unfilled_triangle (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_triangle(renderer, to, from, length, width, linewidth, NULL, fg_color);
}
@@ -1737,42 +1737,42 @@ draw_unfilled_triangle (DiaRenderer *renderer, Point *to, Point *from,
static void
draw_hollow_diamond (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_diamond(renderer, to, from, length, width, linewidth, bg_color, fg_color);
}
static void
draw_filled_diamond (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_diamond(renderer, to, from, length, width, linewidth, fg_color, fg_color);
}
static void
draw_filled_ellipse (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_fill_ellipse(renderer,to,from,length,width,linewidth,fg_color,fg_color);
}
static void
draw_filled_dot (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_fill_dot(renderer,to,from,length,width,linewidth,fg_color,fg_color);
}
static void
draw_filled_box (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_fill_box(renderer,to,from,length,width,linewidth,fg_color,fg_color);
}
static void
draw_filled_concave (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_concave_triangle(renderer, to, from, length, width, linewidth, fg_color, fg_color);
}
@@ -1790,14 +1790,14 @@ calculate_double_triangle (Point *poly, const Point *to, const Point *from,
static void
draw_double_hollow_triangle (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_double_triangle(renderer, to, from, length, width, linewidth, bg_color, fg_color);
}
static void
draw_double_filled_triangle (DiaRenderer *renderer, Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
draw_double_triangle(renderer, to, from, length, width, linewidth, fg_color, fg_color);
}
@@ -1817,8 +1817,8 @@ struct ArrowDesc {
real length,
real width,
real linewidth, /* the lines width also used in many arrows */
- Color *fg_color, /* the main drawin color */
- Color *bg_color); /* not always used */
+ GdkRGBA *fg_color, /* the main drawin color */
+ GdkRGBA *bg_color); /* not always used */
} arrow_types[] =
{{NC_("Arrow", "None"),ARROW_NONE},
{NC_("Arrow", "Lines"),ARROW_LINES, calculate_arrow, draw_lines},
@@ -1906,7 +1906,7 @@ void
arrow_draw(DiaRenderer *renderer, ArrowType type,
Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color)
+ GdkRGBA *fg_color, GdkRGBA *bg_color)
{
switch(type) {
case ARROW_NONE:
@@ -1957,7 +1957,7 @@ arrow_draw(DiaRenderer *renderer, ArrowType type,
Arrow arrow = {type, length, width};
Rectangle bbox = {0, };
Point p1, p2;
- Color col = { 1.0, 0.0, 1.0, 1.0 };
+ GdkRGBA col = { 1.0, 0.0, 1.0, 1.0 };
arrow_bbox (&arrow, linewidth, to, from, &bbox);
diff --git a/lib/arrows.h b/lib/arrows.h
index 07ca5139..795614bb 100644
--- a/lib/arrows.h
+++ b/lib/arrows.h
@@ -20,7 +20,6 @@
#include "diatypes.h"
#include "geometry.h"
-#include "color.h"
#include "dia_xml.h"
#include "diacontext.h"
@@ -103,7 +102,7 @@ struct _Arrow {
void arrow_draw(DiaRenderer *renderer, ArrowType type,
Point *to, Point *from,
real length, real width, real linewidth,
- Color *fg_color, Color *bg_color);
+ GdkRGBA *fg_color, GdkRGBA *bg_color);
/** following the signature pattern of lib/boundingbox.h
* the arrow bounding box is returned in rect
diff --git a/lib/attributes.c b/lib/attributes.c
index 7a44ae32..45426b4c 100644
--- a/lib/attributes.c
+++ b/lib/attributes.c
@@ -21,8 +21,8 @@
#include "intl.h"
#include "persistence.h"
-static Color attributes_foreground = { 0.0f, 0.0f, 0.0f, 1.0f };
-static Color attributes_background = { 1.0f, 1.0f, 1.0f, 1.0f };
+static GdkRGBA attributes_foreground = { 0.0f, 0.0f, 0.0f, 1.0f };
+static GdkRGBA attributes_background = { 1.0f, 1.0f, 1.0f, 1.0f };
static real attributes_default_linewidth = 0.1;
@@ -42,7 +42,7 @@ static real attributes_font_height = 0.8;
/** Get the foreground color attribute (lines and text)
* @returns The current foreground color as set in the toolbox.
*/
-Color
+GdkRGBA
attributes_get_foreground(void)
{
return attributes_foreground;
@@ -51,7 +51,7 @@ attributes_get_foreground(void)
/** Get the background color attribute (for box background and such)
* @returns The current background color as set in the toolbox.
*/
-Color
+GdkRGBA
attributes_get_background(void)
{
return attributes_background;
@@ -62,7 +62,7 @@ attributes_get_background(void)
* not stored by ths function and can be freed afterwards.
*/
void
-attributes_set_foreground(Color *color)
+attributes_set_foreground(GdkRGBA *color)
{
attributes_foreground = *color;
persistence_set_color("fg_color", color);
@@ -73,7 +73,7 @@ attributes_set_foreground(Color *color)
* not stored by ths function and can be freed afterwards.
*/
void
-attributes_set_background(Color *color)
+attributes_set_background(GdkRGBA *color)
{
attributes_background = *color;
persistence_set_color("bg_color", color);
@@ -84,7 +84,7 @@ attributes_set_background(Color *color)
void
attributes_swap_fgbg(void)
{
- Color temp;
+ GdkRGBA temp;
temp = attributes_foreground;
attributes_set_foreground(&attributes_background);
attributes_set_background(&temp);
diff --git a/lib/attributes.h b/lib/attributes.h
index 490b06d9..1b88be9e 100644
--- a/lib/attributes.h
+++ b/lib/attributes.h
@@ -20,16 +20,18 @@
#include "dia-enums.h"
#include "geometry.h"
-#include "color.h"
#include "arrows.h"
#include "font.h"
G_BEGIN_DECLS
-Color attributes_get_foreground(void);
-Color attributes_get_background(void);
-void attributes_set_foreground(Color *color);
-void attributes_set_background(Color *color);
+GdkRGBA color_black = { 0, 0, 0, 1 };
+GdkRGBA color_white = { 1, 1, 1, 1 };
+
+GdkRGBA attributes_get_foreground(void);
+GdkRGBA attributes_get_background(void);
+void attributes_set_foreground(GdkRGBA *color);
+void attributes_set_background(GdkRGBA *color);
void attributes_swap_fgbg(void);
void attributes_default_fgbg(void);
diff --git a/lib/bezier-common.c b/lib/bezier-common.c
index fef28adc..24eddeac 100644
--- a/lib/bezier-common.c
+++ b/lib/bezier-common.c
@@ -163,7 +163,7 @@ bezier_draw_control_lines (int num_points,
BezPoint *points,
DiaRenderer *renderer)
{
- Color line_colour = { 0.0, 0.0, 0.6, 1.0 };
+ GdkRGBA line_colour = { 0.0, 0.0, 0.6, 1.0 };
Point startpoint;
int i;
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index 44ca103e..1e6a0707 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -393,7 +393,7 @@ _parse_color(gint32 *color, const char *str)
* \ingroup DiaSvg
*/
gboolean
-dia_svg_parse_color (const gchar *str, Color *color)
+dia_svg_parse_color (const gchar *str, GdkRGBA *color)
{
gint32 c;
gboolean ret = _parse_color (&c, str);
diff --git a/lib/dia_svg.h b/lib/dia_svg.h
index 08beca3e..8313b66f 100644
--- a/lib/dia_svg.h
+++ b/lib/dia_svg.h
@@ -56,7 +56,7 @@ struct _DiaSvgStyle {
void dia_svg_style_init (DiaSvgStyle *gs, DiaSvgStyle *parent_style);
void dia_svg_style_copy (DiaSvgStyle *dest, DiaSvgStyle *src);
-gboolean dia_svg_parse_color(const gchar *str, Color *color);
+gboolean dia_svg_parse_color(const gchar *str, GdkRGBA *color);
void dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale);
void dia_svg_parse_style_string (DiaSvgStyle *s, real user_scale, const gchar *str);
/* parse the svg sub format for pathes int an array of BezPoint */
diff --git a/lib/dia_xml.c b/lib/dia_xml.c
index 2425cb9c..7dd040b4 100644
--- a/lib/dia_xml.c
+++ b/lib/dia_xml.c
@@ -653,7 +653,7 @@ hex_digit(char c, DiaContext *ctx)
* \ingroup DiagramXmlIn
*/
void
-data_color(DataNode data, Color *col, DiaContext *ctx)
+data_color(DataNode data, GdkRGBA *col, DiaContext *ctx)
{
xmlChar *val;
int r=0, g=0, b=0, a=0;
@@ -1162,7 +1162,7 @@ convert_to_hex(float x, char *str)
* \ingroup DiagramXmlOut
*/
void
-data_add_color(AttributeNode attr, const Color *col, DiaContext *ctx)
+data_add_color(AttributeNode attr, const GdkRGBA *col, DiaContext *ctx)
{
char buffer[1+8+1];
DataNode data_node;
diff --git a/lib/dia_xml.h b/lib/dia_xml.h
index 0205336a..8f9809af 100644
--- a/lib/dia_xml.h
+++ b/lib/dia_xml.h
@@ -19,8 +19,8 @@
#define DIA_XML_H
#include <glib.h>
+#include <gdk/gdk.h>
#include "geometry.h"
-#include "color.h"
#include "font.h"
#include "diacontext.h"
#include <libxml/tree.h>
@@ -75,7 +75,7 @@ int data_int(DataNode data, DiaContext *ctx);
int data_enum(DataNode data, DiaContext *ctx);
real data_real(DataNode data, DiaContext *ctx);
int data_boolean(DataNode data, DiaContext *ctx);
-void data_color(DataNode data, Color *col, DiaContext *ctx);
+void data_color(DataNode data, GdkRGBA *col, DiaContext *ctx);
void data_point(DataNode data, Point *point, DiaContext *ctx);
void data_bezpoint(DataNode data, BezPoint *point, DiaContext *ctx);
void data_rectangle(DataNode data, Rectangle *rect, DiaContext *ctx);
@@ -90,7 +90,7 @@ void data_add_int(AttributeNode attr, int data, DiaContext *ctx);
void data_add_enum(AttributeNode attr, int data, DiaContext *ctx);
void data_add_real(AttributeNode attr, real data, DiaContext *ctx);
void data_add_boolean(AttributeNode attr, int data, DiaContext *ctx);
-void data_add_color(AttributeNode attr, const Color *col, DiaContext *ctx);
+void data_add_color(AttributeNode attr, const GdkRGBA *col, DiaContext *ctx);
void data_add_point(AttributeNode attr, const Point *point, DiaContext *ctx);
void data_add_bezpoint(AttributeNode attr, const BezPoint *point, DiaContext *ctx);
void data_add_rectangle(AttributeNode attr, const Rectangle *rect, DiaContext *ctx);
diff --git a/lib/diaarrowchooser.c b/lib/diaarrowchooser.c
index c5779fff..9531c806 100644
--- a/lib/diaarrowchooser.c
+++ b/lib/diaarrowchooser.c
@@ -201,20 +201,17 @@ dia_arrow_preview_draw (GtkWidget *widget, cairo_t *ctx)
renderer_ops->begin_render(DIA_RENDERER (renderer), NULL);
renderer_ops->set_linewidth(DIA_RENDERER (renderer), linewidth);
{
- Color color_bg, color_fg;
GtkStyle *style = gtk_widget_get_style (widget);
/* the text colors are the best approximation to what we had */
- GdkColor bg = style->base[gtk_widget_get_state(widget)];
- GdkColor fg = style->text[gtk_widget_get_state(widget)];
+ GdkRGBA bg = style->base[gtk_widget_get_state(widget)];
+ GdkRGBA fg = style->text[gtk_widget_get_state(widget)];
- GDK_COLOR_TO_DIA(bg, color_bg);
- GDK_COLOR_TO_DIA(fg, color_fg);
- renderer_ops->draw_line(DIA_RENDERER (renderer), &from, &to, &color_fg);
+ renderer_ops->draw_line(DIA_RENDERER (renderer), &from, &to, &fg);
arrow_draw (DIA_RENDERER (renderer), arrow_type.type,
&arrow_head, &from,
arrow_type.length,
arrow_type.width,
- linewidth, &color_fg, &color_bg);
+ linewidth, &fg, &bg);
}
renderer_ops->end_render(DIA_RENDERER (renderer));
g_object_unref(renderer);
diff --git a/lib/diacolorselector.c b/lib/diacolorselector.c
index c1b859bb..a41a7383 100644
--- a/lib/diacolorselector.c
+++ b/lib/diacolorselector.c
@@ -60,7 +60,7 @@ dia_color_selector_color_set (GtkColorButton *button, gpointer user_data)
{
DiaColorSelector *cs = DIACOLORSELECTOR(user_data);
gchar *entry;
- GdkColor gcol;
+ GdkRGBA gcol;
gtk_color_button_get_color (button, &gcol);
@@ -75,7 +75,7 @@ dia_color_selector_value_changed (DiaDynamicMenu *ddm, gpointer user_data)
{
DiaColorSelector *cs = DIACOLORSELECTOR(user_data);
gchar *entry = dia_dynamic_menu_get_entry(cs->ddm);
- GdkColor gcol;
+ GdkRGBA gcol;
gdk_color_parse (entry, &gcol);
g_free(entry);
@@ -176,7 +176,7 @@ dia_color_selector_more_ok(GtkWidget *ok, gpointer userdata)
{
DiaColorSelector *cs = g_object_get_data(G_OBJECT(userdata), "dia-cs");
GtkWidget *colorsel = GTK_WIDGET(userdata);
- GdkColor gcol;
+ GdkRGBA gcol;
guint galpha;
gchar *entry;
GtkWidget *cs2 = gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG(colorsel));
@@ -236,7 +236,7 @@ dia_color_selector_more_callback(GtkWidget *widget, gpointer userdata)
tmplist != NULL || advance;
tmplist = g_list_next(tmplist)) {
const gchar* spec;
- GdkColor color;
+ GdkRGBA color;
/* handle both lists */
if (!tmplist && advance) {
@@ -316,7 +316,7 @@ dia_color_selector_new (void)
return GTK_WIDGET ( g_object_new (dia_color_selector_get_type (), NULL));
}
void
-dia_color_selector_get_color(GtkWidget *widget, Color *color)
+dia_color_selector_get_color(GtkWidget *widget, GdkRGBA *color)
{
DiaColorSelector *cs = DIACOLORSELECTOR(widget);
gchar *entry = dia_dynamic_menu_get_entry(cs->ddm);
@@ -337,7 +337,7 @@ dia_color_selector_get_color(GtkWidget *widget, Color *color)
void
dia_color_selector_set_color (GtkWidget *widget,
- const Color *color)
+ const GdkRGBA *color)
{
DiaColorSelector *cs = DIACOLORSELECTOR(widget);
gint red, green, blue;
@@ -357,11 +357,7 @@ dia_color_selector_set_color (GtkWidget *widget,
g_free (entry);
if (cs->use_alpha) {
- GdkColor gcol;
-
- color_convert (color, &gcol);
- gtk_color_button_set_color (cs->color_button, &gcol);
- gtk_color_button_set_alpha (cs->color_button, MIN(color->alpha * 65535, 65535));
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (cs->color_button), color);
}
}
diff --git a/lib/diagramdata.c b/lib/diagramdata.c
index d031f5d2..20383dea 100644
--- a/lib/diagramdata.c
+++ b/lib/diagramdata.c
@@ -107,10 +107,14 @@ _diagram_data_selection_changed (DiagramData* dia, int n)
static void
diagram_data_init(DiagramData *data)
{
- Color* color = persistence_register_color ("new_diagram_bgcolour", &color_white);
+ GdkRGBA tmp;
+ GdkRGBA* color;
gboolean compress = persistence_register_boolean ("compress_save", TRUE);
Layer *first_layer;
+ gdk_rgba_parse (&tmp, "#FFFFFF");
+ color = persistence_register_color ("new_diagram_bgcolour", &tmp);
+
data->extents.left = 0.0;
data->extents.right = 10.0;
data->extents.top = 0.0;
diff --git a/lib/diagramdata.h b/lib/diagramdata.h
index 9ca9cc56..1e4133e4 100644
--- a/lib/diagramdata.h
+++ b/lib/diagramdata.h
@@ -20,10 +20,10 @@
#define DIAGRAMDATA_H
#include <glib.h>
+#include <gdk/gdk.h>
#include <string.h>
#include "diatypes.h"
-#include "color.h"
#include "geometry.h"
#include "paper.h"
@@ -39,7 +39,7 @@ struct _NewDiagramData {
gfloat scaling;
gboolean fitto;
gint fitwidth, fitheight;
- Color bg_color, pagebreak_color, grid_color;
+ GdkRGBA bg_color, pagebreak_color, grid_color;
int compress_save;
gchar *unit, *font_unit;
};
@@ -65,7 +65,7 @@ struct _DiagramData {
Rectangle extents; /*!< The extents of the diagram */
- Color bg_color; /*!< The diagrams background color */
+ GdkRGBA bg_color; /*!< The diagrams background color */
PaperInfo paper; /*!< info about the page info for the diagram */
gboolean is_compressed; /*!< TRUE if by default it should be save compressed.
diff --git a/lib/diaimportrenderer.c b/lib/diaimportrenderer.c
index 95648cea..f8bdb142 100644
--- a/lib/diaimportrenderer.c
+++ b/lib/diaimportrenderer.c
@@ -41,38 +41,38 @@ static void set_fillstyle (DiaRenderer *renderer, FillStyle mode);
static void draw_line (DiaRenderer *renderer,
Point *start, Point *end,
- Color *color);
+ GdkRGBA *color);
static void draw_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_arc (DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void fill_arc (DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void draw_ellipse (DiaRenderer *renderer,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_bezier (DiaRenderer *renderer,
BezPoint *points,
int numpoints,
- Color *color);
+ GdkRGBA *color);
static void draw_beziergon (DiaRenderer *renderer,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke);
+ GdkRGBA *fill,
+ GdkRGBA *stroke);
static void draw_string (DiaRenderer *renderer,
const gchar *text,
Point *pos,
Alignment alignment,
- Color *color);
+ GdkRGBA *color);
static void draw_image (DiaRenderer *renderer,
Point *point,
real width, real height,
@@ -80,22 +80,22 @@ static void draw_image (DiaRenderer *renderer,
static void draw_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color);
+ GdkRGBA *color);
static void draw_rounded_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color, real radius);
+ GdkRGBA *color, real radius);
static void draw_polygon (DiaRenderer *renderer,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_rounded_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius);
+ GdkRGBA *fill, GdkRGBA *stroke, real radius);
static void draw_line_with_arrows (DiaRenderer *renderer,
Point *start, Point *end,
real line_width,
- Color *line_color,
+ GdkRGBA *line_color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_arc_with_arrows (DiaRenderer *renderer,
@@ -103,19 +103,19 @@ static void draw_arc_with_arrows (DiaRenderer *renderer,
Point *end,
Point *midpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_polyline_with_arrows (DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_rounded_polyline_with_arrows (DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow,
real radius);
@@ -124,7 +124,7 @@ static void draw_bezier_with_arrows (DiaRenderer *renderer,
BezPoint *points,
int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
@@ -268,8 +268,8 @@ set_fillstyle (DiaRenderer *renderer, FillStyle mode)
static void
_apply_style (DiaImportRenderer *self,
DiaObject *obj,
- const Color *fill,
- const Color *stroke,
+ const GdkRGBA *fill,
+ const GdkRGBA *stroke,
real radius)
{
GPtrArray *props = g_ptr_array_new ();
@@ -310,7 +310,7 @@ _push_object (DiaImportRenderer *self, DiaObject *obj)
* \memberof _DiaImportRenderer
*/
static void
-draw_line (DiaRenderer *renderer, Point *start, Point *end, Color *color)
+draw_line (DiaRenderer *renderer, Point *start, Point *end, GdkRGBA *color)
{
Point points[2];
points[0] = *start;
@@ -361,7 +361,7 @@ _make_arc (Point *center,
static void
draw_arc (DiaRenderer *renderer, Point *center,
real width, real height, real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = _make_arc (center, width, height, angle1, angle2);
@@ -377,7 +377,7 @@ draw_arc (DiaRenderer *renderer, Point *center,
static void
draw_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_box (ul_corner->x, ul_corner->y,
@@ -396,7 +396,7 @@ draw_rect (DiaRenderer *renderer,
static void
fill_arc (DiaRenderer *renderer, Point *center,
real width, real height, real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
#if 0 /* does not work till 'Standard - Arc' supports filling */
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
@@ -422,7 +422,7 @@ fill_arc (DiaRenderer *renderer, Point *center,
static void
draw_ellipse (DiaRenderer *renderer, Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_ellipse (center->x - width / 2, center->y - height / 2, width, height);
@@ -439,7 +439,7 @@ draw_ellipse (DiaRenderer *renderer, Point *center,
static void
draw_string (DiaRenderer *renderer,
const gchar *text, Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_text (pos->x, pos->y);
@@ -494,7 +494,7 @@ draw_image (DiaRenderer *renderer,
static void
draw_bezier (DiaRenderer *renderer,
BezPoint *points, int numpoints,
- Color *color)
+ GdkRGBA *color)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_bezierline (numpoints, points, NULL, NULL);
@@ -511,8 +511,8 @@ draw_bezier (DiaRenderer *renderer,
static void
draw_beziergon (DiaRenderer *renderer,
BezPoint *points, int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object;
@@ -531,7 +531,7 @@ draw_beziergon (DiaRenderer *renderer,
static void
draw_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
draw_rounded_polyline (renderer, points, num_points, color, 0.0);
}
@@ -544,7 +544,7 @@ draw_polyline (DiaRenderer *renderer,
static void
draw_rounded_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color, real radius)
+ GdkRGBA *color, real radius)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_polyline (num_points, points, NULL, NULL);
@@ -560,7 +560,7 @@ draw_rounded_polyline (DiaRenderer *renderer,
static void
draw_polygon (DiaRenderer *renderer,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_polygon (num_points, points);
@@ -576,7 +576,7 @@ draw_polygon (DiaRenderer *renderer,
static void
draw_rounded_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius)
+ GdkRGBA *fill, GdkRGBA *stroke, real radius)
{
DiaImportRenderer *self = DIA_IMPORT_RENDERER (renderer);
DiaObject *object = create_standard_box (ul_corner->x, ul_corner->y,
@@ -596,7 +596,7 @@ draw_line_with_arrows(DiaRenderer *renderer,
Point *startpoint,
Point *endpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -619,7 +619,7 @@ static void
draw_polyline_with_arrows(DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -638,7 +638,7 @@ static void
draw_rounded_polyline_with_arrows(DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow,
real radius)
@@ -661,7 +661,7 @@ draw_arc_with_arrows (DiaRenderer *renderer,
Point *endpoint,
Point *midpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -688,7 +688,7 @@ draw_bezier_with_arrows(DiaRenderer *renderer,
BezPoint *points,
int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
diff --git a/lib/dialib.c b/lib/dialib.c
index 2d99e66c..cdeadd8a 100644
--- a/lib/dialib.c
+++ b/lib/dialib.c
@@ -29,7 +29,6 @@
#include "dialib.h"
#include "message.h"
#include "utils.h"
-#include "color.h"
#include "object.h"
#include "dia_dirs.h"
#include "properties.h" /* stdprops_init() */
@@ -118,8 +117,6 @@ libdia_init (guint flags)
dia_log_message ("Config from %s", diagtkrc);
gtk_rc_parse(diagtkrc);
g_free(diagtkrc);
-
- color_init();
}
initialized = TRUE;
diff --git a/lib/dialinechooser.c b/lib/dialinechooser.c
index c8795633..e5d0ea9a 100644
--- a/lib/dialinechooser.c
+++ b/lib/dialinechooser.c
@@ -122,8 +122,8 @@ dia_line_preview_expose(GtkWidget *widget, GdkEventExpose *event)
double dash_list[6];
int line_width = 2;
GtkStyle *style;
- GdkColor bg;
- GdkColor fg;
+ GdkRGBA bg;
+ GdkRGBA fg;
cairo_t *ctx;
if (gtk_widget_is_drawable(widget)) {
diff --git a/lib/diapathrenderer.c b/lib/diapathrenderer.c
index 1a836c0d..730066c4 100644
--- a/lib/diapathrenderer.c
+++ b/lib/diapathrenderer.c
@@ -47,8 +47,8 @@ struct _DiaPathRenderer
GPtrArray *pathes;
- Color stroke;
- Color fill;
+ GdkRGBA stroke;
+ GdkRGBA fill;
PathLastOp last_op;
};
@@ -113,8 +113,8 @@ dia_path_renderer_finalize (GObject *object)
*/
static GArray *
_get_current_path (DiaPathRenderer *self,
- const Color *stroke,
- const Color *fill)
+ const GdkRGBA *stroke,
+ const GdkRGBA *fill)
{
GArray *path;
/* creating a new path for every new color */
@@ -304,7 +304,7 @@ _path_arc_segment (GArray *path,
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
GArray *points = _get_current_path (renderer, line_colour, NULL);
@@ -316,7 +316,7 @@ draw_line(DiaRenderer *self,
static void
_polyline(DiaRenderer *self,
Point *points, int num_points,
- const Color *fill, const Color *stroke)
+ const GdkRGBA *fill, const GdkRGBA *stroke)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
int i;
@@ -339,7 +339,7 @@ _polyline(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
_polyline (self, points, num_points, NULL, line_colour);
_remove_duplicated_path (DIA_PATH_RENDERER (self));
@@ -351,7 +351,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
@@ -372,7 +372,7 @@ draw_polygon(DiaRenderer *self,
static void
draw_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
GArray *path = _get_current_path (renderer, stroke, fill);
@@ -448,7 +448,7 @@ _arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- const Color *stroke, const Color *fill)
+ const GdkRGBA *stroke, const GdkRGBA *fill)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
GArray *path = _get_current_path (renderer, stroke, fill);
@@ -464,7 +464,7 @@ draw_arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
_arc (self, center, width, height, angle1, angle2, color, NULL);
_remove_duplicated_path (DIA_PATH_RENDERER (self));
@@ -478,7 +478,7 @@ fill_arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
_arc (self, center, width, height, angle1, angle2, NULL, color);
}
@@ -547,7 +547,7 @@ static void
draw_ellipse (DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
GArray *path = _get_current_path (renderer, stroke, fill);
@@ -557,7 +557,7 @@ draw_ellipse (DiaRenderer *self,
static void
_bezier (DiaRenderer *self,
BezPoint *points, int numpoints,
- const Color *fill, const Color *stroke)
+ const GdkRGBA *fill, const GdkRGBA *stroke)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
GArray *path = _get_current_path (renderer, stroke, fill);
@@ -581,7 +581,7 @@ static void
draw_bezier (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color)
+ GdkRGBA *color)
{
_bezier(self, points, numpoints, NULL, color);
_remove_duplicated_path (DIA_PATH_RENDERER (self));
@@ -594,8 +594,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
_bezier(self, points, numpoints, fill, stroke);
}
@@ -647,7 +647,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
if (text && strlen(text)) {
Text *text_obj;
@@ -677,8 +677,8 @@ draw_image(DiaRenderer *self,
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
/* warning colors ;) */
- Color stroke = { 1.0, 0.0, 0.0, 0.75 };
- Color fill = { 1.0, 1.0, 0.0, 0.5 };
+ GdkRGBA stroke = { 1.0, 0.0, 0.0, 0.75 };
+ GdkRGBA fill = { 1.0, 1.0, 0.0, 0.5 };
GArray *path = _get_current_path (renderer, &stroke, &fill);
Point to = *point;
@@ -707,7 +707,7 @@ draw_image(DiaRenderer *self,
static void
draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius)
+ GdkRGBA *fill, GdkRGBA *stroke, real radius)
{
DiaPathRenderer *renderer = DIA_PATH_RENDERER (self);
real rx = (lr_corner->x - ul_corner->x) / 2;
diff --git a/lib/diapatternselector.c b/lib/diapatternselector.c
index 7b92a66f..429bb0f0 100644
--- a/lib/diapatternselector.c
+++ b/lib/diapatternselector.c
@@ -117,7 +117,7 @@ static DiaPattern *
_create_preset_pattern (guint n)
{
DiaPattern *pat;
- Color color;
+ GdkRGBA color;
g_return_val_if_fail (n < G_N_ELEMENTS (_pattern_presets), NULL);
switch (_pattern_presets[n].type) {
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index 7ed882ab..06542050 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -66,38 +66,38 @@ static void set_font (DiaRenderer *renderer, DiaFont *font, real height);
static void draw_line (DiaRenderer *renderer,
Point *start, Point *end,
- Color *color);
+ GdkRGBA *color);
static void draw_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_arc (DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void fill_arc (DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void draw_ellipse (DiaRenderer *renderer,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_bezier (DiaRenderer *renderer,
BezPoint *points,
int numpoints,
- Color *color);
+ GdkRGBA *color);
static void draw_beziergon (DiaRenderer *renderer,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke);
+ GdkRGBA *fill,
+ GdkRGBA *stroke);
static void draw_string (DiaRenderer *renderer,
const gchar *text,
Point *pos,
Alignment alignment,
- Color *color);
+ GdkRGBA *color);
static void draw_image (DiaRenderer *renderer,
Point *point,
real width, real height,
@@ -105,7 +105,7 @@ static void draw_image (DiaRenderer *renderer,
static void draw_text (DiaRenderer *renderer,
Text *text);
static void draw_text_line (DiaRenderer *renderer,
- TextLine *text_line, Point *pos, Alignment alignment, Color *color);
+ TextLine *text_line, Point *pos, Alignment alignment, GdkRGBA *color);
static void draw_rotated_text (DiaRenderer *renderer, Text *text,
Point *center, real angle);
static void draw_rotated_image (DiaRenderer *renderer,
@@ -116,24 +116,24 @@ static void draw_rotated_image (DiaRenderer *renderer,
static void draw_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color);
+ GdkRGBA *color);
static void draw_rounded_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color, real radius);
+ GdkRGBA *color, real radius);
static void draw_polygon (DiaRenderer *renderer,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static real get_text_width (DiaRenderer *renderer,
const gchar *text, int length);
static void draw_rounded_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius);
+ GdkRGBA *fill, GdkRGBA *stroke, real radius);
static void draw_line_with_arrows (DiaRenderer *renderer,
Point *start, Point *end,
real line_width,
- Color *line_color,
+ GdkRGBA *line_color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_arc_with_arrows (DiaRenderer *renderer,
@@ -141,19 +141,19 @@ static void draw_arc_with_arrows (DiaRenderer *renderer,
Point *end,
Point *midpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_polyline_with_arrows (DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_rounded_polyline_with_arrows (DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow,
real radius);
@@ -162,7 +162,7 @@ static void draw_bezier_with_arrows (DiaRenderer *renderer,
BezPoint *points,
int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
@@ -262,7 +262,7 @@ draw_object (DiaRenderer *renderer,
/* visual complaints - not completely correct */
Point pt[4];
Rectangle *bb = &object->bounding_box;
- Color red = { 1.0, 0.0, 0.0, 1.0 };
+ GdkRGBA red = { 1.0, 0.0, 0.0, 1.0 };
pt[0].x = matrix->xx * bb->left + matrix->xy * bb->top + matrix->x0;
pt[0].y = matrix->yx * bb->left + matrix->yy * bb->top + matrix->y0;
@@ -458,7 +458,7 @@ set_fillstyle (DiaRenderer *renderer, FillStyle mode)
* \memberof _DiaRenderer \pure
*/
static void
-draw_line (DiaRenderer *renderer, Point *start, Point *end, Color *color)
+draw_line (DiaRenderer *renderer, Point *start, Point *end, GdkRGBA *color)
{
g_warning ("%s::draw_line not implemented!",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
@@ -475,11 +475,11 @@ draw_line (DiaRenderer *renderer, Point *start, Point *end, Color *color)
static void
draw_polygon (DiaRenderer *renderer,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaRendererClass *klass = DIA_RENDERER_GET_CLASS (renderer);
int i;
- Color *color = fill ? fill : stroke;
+ GdkRGBA *color = fill ? fill : stroke;
g_return_if_fail (num_points > 1);
g_return_if_fail (color != NULL);
@@ -503,7 +503,7 @@ draw_polygon (DiaRenderer *renderer,
static void
draw_arc (DiaRenderer *renderer, Point *center,
real width, real height, real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
g_warning ("%s::draw_arc not implemented!",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
@@ -516,7 +516,7 @@ draw_arc (DiaRenderer *renderer, Point *center,
static void
fill_arc (DiaRenderer *renderer, Point *center,
real width, real height, real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
g_warning ("%s::fill_arc not implemented!",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
@@ -528,7 +528,7 @@ fill_arc (DiaRenderer *renderer, Point *center,
static void
draw_ellipse (DiaRenderer *renderer, Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
g_warning ("%s::draw_ellipse not implemented!",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
@@ -560,7 +560,7 @@ set_font (DiaRenderer *renderer, DiaFont *font, real height)
static void
draw_string (DiaRenderer *renderer,
const gchar *text, Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
g_warning ("%s::draw_string not implemented!",
G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
@@ -685,7 +685,7 @@ draw_rotated_text (DiaRenderer *renderer, Text *text,
&g_array_index (path, BezPoint, 0), path->len,
&text->color);
} else {
- Color magenta = { 1.0, 0.0, 1.0, 1.0 };
+ GdkRGBA magenta = { 1.0, 0.0, 1.0, 1.0 };
Point pt = center ? *center : text->position;
DiaMatrix m = { 1, 0, 0, 1, pt.x, pt.y };
DiaMatrix t = { 1, 0, 0, 1, -pt.x, -pt.y };
@@ -738,7 +738,7 @@ draw_rotated_image (DiaRenderer *renderer,
*/
static void
draw_text_line (DiaRenderer *renderer,
- TextLine *text_line, Point *pos, Alignment alignment, Color *color)
+ TextLine *text_line, Point *pos, Alignment alignment, GdkRGBA *color)
{
DIA_RENDERER_GET_CLASS(renderer)->set_font(renderer,
text_line_get_font(text_line),
@@ -932,7 +932,7 @@ approximate_bezier (BezierApprox *bezier,
static void
draw_bezier (DiaRenderer *renderer,
BezPoint *points, int numpoints,
- Color *color)
+ GdkRGBA *color)
{
BezierApprox *bezier;
@@ -967,7 +967,7 @@ draw_bezier (DiaRenderer *renderer,
static void
draw_beziergon (DiaRenderer *renderer,
BezPoint *points, int numpoints,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
BezierApprox *bezier;
@@ -1005,7 +1005,7 @@ draw_beziergon (DiaRenderer *renderer,
static void
draw_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
if (DIA_RENDERER_GET_CLASS(renderer)->draw_polygon == &draw_polygon) {
g_warning ("%s::draw_rect and draw_polygon not implemented!",
@@ -1035,7 +1035,7 @@ draw_rect (DiaRenderer *renderer,
static void
draw_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
DiaRendererClass *klass = DIA_RENDERER_GET_CLASS (renderer);
int i;
@@ -1078,7 +1078,7 @@ calculate_min_radius( Point *p1, Point *p2, Point *p3 )
static void
draw_rounded_polyline (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color, real radius)
+ GdkRGBA *color, real radius)
{
DiaRendererClass *klass = DIA_RENDERER_GET_CLASS (renderer);
int i = 0;
@@ -1140,7 +1140,7 @@ draw_rounded_polyline (DiaRenderer *renderer,
static void
draw_rounded_rect (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius)
+ GdkRGBA *fill, GdkRGBA *stroke, real radius)
{
DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
/* clip radius per axis to use the full API;) */
@@ -1219,7 +1219,7 @@ draw_line_with_arrows(DiaRenderer *renderer,
Point *startpoint,
Point *endpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -1277,7 +1277,7 @@ static void
draw_polyline_with_arrows(DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -1354,7 +1354,7 @@ static void
draw_rounded_polyline_with_arrows(DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow,
real radius)
@@ -1573,7 +1573,7 @@ draw_arc_with_arrows (DiaRenderer *renderer,
Point *endpoint,
Point *midpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -1694,7 +1694,7 @@ draw_bezier_with_arrows(DiaRenderer *renderer,
BezPoint *points,
int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -1870,7 +1870,7 @@ dia_renderer_get_height_pixels (DiaRenderer *renderer)
* \relates _DiaRenderer
*/
void
-bezier_render_fill (DiaRenderer *renderer, BezPoint *pts, int total, Color *color)
+bezier_render_fill (DiaRenderer *renderer, BezPoint *pts, int total, GdkRGBA *color)
{
int i;
gboolean needs_split = FALSE;
@@ -1936,7 +1936,7 @@ bezier_render_fill (DiaRenderer *renderer, BezPoint *pts, int total, Color *colo
* \relates _DiaRenderer
*/
G_GNUC_UNUSED static void
-bezier_render_fill_old (DiaRenderer *renderer, BezPoint *pts, int total, Color *color)
+bezier_render_fill_old (DiaRenderer *renderer, BezPoint *pts, int total, GdkRGBA *color)
{
int i, n = 0;
/* first draw the fills */
@@ -1978,7 +1978,7 @@ bezier_render_fill_old (DiaRenderer *renderer, BezPoint *pts, int total, Color *
* \relates _DiaRenderer
*/
void
-bezier_render_stroke (DiaRenderer *renderer, BezPoint *pts, int total, Color *color)
+bezier_render_stroke (DiaRenderer *renderer, BezPoint *pts, int total, GdkRGBA *color)
{
int i, n = 0;
for (i = 1; i < total; ++i) {
diff --git a/lib/diarenderer.h b/lib/diarenderer.h
index 368becac..becf237e 100644
--- a/lib/diarenderer.h
+++ b/lib/diarenderer.h
@@ -130,35 +130,35 @@ struct _DiaRendererClass
/*! Draw a line from start to end, using color and the current line style */
void (*draw_line) (DiaRenderer *renderer,
Point *start, Point *end,
- Color *color);
+ GdkRGBA *color);
/*! the polygon is filled using the current fill type and stroked with the current line style */
void (*draw_polygon) (DiaRenderer *renderer,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
/*! Draw an arc, given its center, the bounding box (widget, height),
the start angle and the end angle. It's counter-clockwise if angle2>angle1 */
void (*draw_arc) (DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
/*! Same a DrawArcFunc except the arc is filled (a pie-chart) */
void (*fill_arc) (DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
/*! Draw an ellipse, given its center and the bounding box */
void (*draw_ellipse) (DiaRenderer *renderer,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
/*! Print a string at pos, using the current font */
void (*draw_string) (DiaRenderer *renderer,
const gchar *text,
Point *pos,
Alignment alignment,
- Color *color);
+ GdkRGBA *color);
/*! Draw an image, given its bounding box */
void (*draw_image) (DiaRenderer *renderer,
Point *point,
@@ -173,28 +173,28 @@ struct _DiaRendererClass
void (*draw_bezier) (DiaRenderer *renderer,
BezPoint *points,
int numpoints,
- Color *color);
+ GdkRGBA *color);
/*! Fill and/or stroke a closed bezier */
void (*draw_beziergon) (DiaRenderer *renderer,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke);
+ GdkRGBA *fill,
+ GdkRGBA *stroke);
/*! Draw a line joining multiple points, using color and the current
line style */
void (*draw_polyline) (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color);
+ GdkRGBA *color);
/*! Print a Text. It holds its own information. */
void (*draw_text) (DiaRenderer *renderer,
Text *text);
/*! Print a TextLine. It holds its own font/size information. */
void (*draw_text_line) (DiaRenderer *renderer,
- TextLine *text_line, Point *pos, Alignment alignment, Color *color);
+ TextLine *text_line, Point *pos, Alignment alignment, GdkRGBA *color);
/*! Draw a rectangle, given its upper-left and lower-right corners */
void (*draw_rect) (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
/*
* Highest level functions, probably only to be implemented by
@@ -203,18 +203,18 @@ struct _DiaRendererClass
/*! Draw a rounded rectangle, given its upper-left and lower-right corners */
void (*draw_rounded_rect) (DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius);
+ GdkRGBA *fill, GdkRGBA *stroke, real radius);
/*! Draw a line joining multiple points, using color and the current
line style with rounded corners between segments */
void (*draw_rounded_polyline) (DiaRenderer *renderer,
Point *points, int num_points,
- Color *color, real radius );
+ GdkRGBA *color, real radius );
/*! Highest level function doing specific arrow positioning */
void (*draw_line_with_arrows) (DiaRenderer *renderer,
Point *start, Point *end,
real line_width,
- Color *line_color,
+ GdkRGBA *line_color,
Arrow *start_arrow,
Arrow *end_arrow);
/*! Highest level function doing specific arrow positioning */
@@ -222,20 +222,20 @@ struct _DiaRendererClass
Point *start, Point *end,
Point *midpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
/*! Highest level function doing specific arrow positioning */
void (*draw_polyline_with_arrows) (DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
void (*draw_rounded_polyline_with_arrows) (DiaRenderer *renderer,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow,
real radius);
@@ -244,7 +244,7 @@ struct _DiaRendererClass
BezPoint *points,
int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
/*! allows to adapt DiaObject implementations to certain renderer capabilities */
@@ -294,15 +294,15 @@ struct _DiaInteractiveRendererInterface
/*! Draw a line from start to end, using color and the current line style */
void (*draw_pixel_line) (DiaRenderer *renderer,
int x1, int y1, int x2, int y2,
- Color *color);
+ GdkRGBA *color);
/*! Draw a rectangle, given its upper-left and lower-right corners in pixels. */
void (*draw_pixel_rect) (DiaRenderer *renderer,
int x, int y, int width, int height,
- Color *color);
+ GdkRGBA *color);
/*! Fill a rectangle, given its upper-left and lower-right corners in pixels. */
void (*fill_pixel_rect) (DiaRenderer *renderer,
int x, int y, int width, int height,
- Color *color);
+ GdkRGBA *color);
/*! Copy already rendered content to the given window */
void (*copy_to_window) (DiaRenderer *renderer,
gpointer window,
@@ -331,8 +331,8 @@ int dia_renderer_get_width_pixels (DiaRenderer*);
int dia_renderer_get_height_pixels (DiaRenderer*);
/* Some standalone render helper functiions */
-void bezier_render_fill (DiaRenderer *renderer, BezPoint *pts, int total, Color *color);
-void bezier_render_stroke (DiaRenderer *renderer, BezPoint *pts, int total, Color *color);
+void bezier_render_fill (DiaRenderer *renderer, BezPoint *pts, int total, GdkRGBA *color);
+void bezier_render_stroke (DiaRenderer *renderer, BezPoint *pts, int total, GdkRGBA *color);
/*! \brief query DIA_RENDER_BOUNDING_BOXES */
int render_bounding_boxes (void);
diff --git a/lib/diasvgrenderer.c b/lib/diasvgrenderer.c
index e5c6e076..77983389 100644
--- a/lib/diasvgrenderer.c
+++ b/lib/diasvgrenderer.c
@@ -55,7 +55,7 @@
g_ascii_formatd(buf,sizeof(buf),"%g",(d)*renderer->scale)
static void
draw_text_line(DiaRenderer *self, TextLine *text_line,
- Point *pos, Alignment alignment, Color *colour);
+ Point *pos, Alignment alignment, GdkRGBA *colour);
/*!
* \brief Initialize to SVG rendering defaults
@@ -85,7 +85,7 @@ _make_pattern_key (const DiaPattern *pattern)
static gboolean
_color_stop_do (real ofs,
- const Color *col,
+ const GdkRGBA *col,
gpointer user_data)
{
xmlNodePtr parent = (xmlNodePtr)user_data;
@@ -391,8 +391,8 @@ set_pattern(DiaRenderer *self, DiaPattern *pattern)
*/
static const gchar *
get_draw_style(DiaSvgRenderer *renderer,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
static GString *str = NULL;
gchar linewidth_buf[DTOSTR_BUF_SIZE];
@@ -446,7 +446,7 @@ get_draw_style(DiaSvgRenderer *renderer,
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -473,7 +473,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
int i;
@@ -502,7 +502,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
int i;
@@ -534,7 +534,7 @@ draw_polygon (DiaRenderer *self,
static void
draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -563,7 +563,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -606,7 +606,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -650,7 +650,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -674,8 +674,8 @@ static void
_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke,
+ GdkRGBA *fill,
+ GdkRGBA *stroke,
gboolean closed)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
@@ -748,7 +748,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *stroke)
+ GdkRGBA *stroke)
{
_bezier(self, points, numpoints, NULL, stroke, FALSE);
}
@@ -761,13 +761,13 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
/* optimize for stroke-width==0 && fill==stroke */
if ( fill && stroke && renderer->linewidth == 0.0
- && memcmp(fill, stroke, sizeof(Color))==0)
+ && memcmp(fill, stroke, sizeof(GdkRGBA))==0)
stroke = NULL;
_bezier(self, points, numpoints, fill, stroke, TRUE);
}
@@ -780,7 +780,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
TextLine *text_line = text_line_new(text, self->font, self->font_height);
draw_text_line(self, text_line, pos, alignment, colour);
@@ -793,7 +793,7 @@ draw_string(DiaRenderer *self,
*/
static void
draw_text_line(DiaRenderer *self, TextLine *text_line,
- Point *pos, Alignment alignment, Color *colour)
+ Point *pos, Alignment alignment, GdkRGBA *colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -907,7 +907,7 @@ draw_image(DiaRenderer *self,
static void
draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real rounding)
+ GdkRGBA *fill, GdkRGBA *stroke, real rounding)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
diff --git a/lib/diasvgrenderer.h b/lib/diasvgrenderer.h
index 2821dd2c..d398da79 100644
--- a/lib/diasvgrenderer.h
+++ b/lib/diasvgrenderer.h
@@ -48,7 +48,7 @@ struct _DiaSvgRendererClass
{
DiaRendererClass parent_class;
- const gchar* (*get_draw_style) (DiaSvgRenderer*, Color* fill, Color *stroke);
+ const gchar* (*get_draw_style) (DiaSvgRenderer*, GdkRGBA* fill, GdkRGBA *stroke);
};
G_END_DECLS
diff --git a/lib/diatransformrenderer.c b/lib/diatransformrenderer.c
index f48a24be..60465e6a 100644
--- a/lib/diatransformrenderer.c
+++ b/lib/diatransformrenderer.c
@@ -195,7 +195,7 @@ set_fillstyle(DiaRenderer *self, FillStyle mode)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
Point p1 = *start;
Point p2 = *end;
@@ -211,7 +211,7 @@ draw_line(DiaRenderer *self,
static void
_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke,
+ GdkRGBA *fill, GdkRGBA *stroke,
gboolean closed)
{
Point *a_pts = g_newa (Point, num_points);
@@ -236,7 +236,7 @@ _polyline(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *stroke)
+ GdkRGBA *stroke)
{
_polyline (self, points, num_points, NULL, stroke, FALSE);
}
@@ -247,7 +247,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
_polyline (self, points, num_points, fill, stroke, TRUE);
}
@@ -255,7 +255,7 @@ draw_polygon(DiaRenderer *self,
static void
_bezier (DiaRenderer *self,
BezPoint *points, int num_points,
- Color *fill, Color *stroke,
+ GdkRGBA *fill, GdkRGBA *stroke,
gboolean closed)
{
BezPoint *a_pts = g_newa (BezPoint, num_points);
@@ -280,7 +280,7 @@ _arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *stroke, Color *fill)
+ GdkRGBA *stroke, GdkRGBA *fill)
{
GArray *path = g_array_new (FALSE, FALSE, sizeof(BezPoint));
path_build_arc (path, center, width, height, angle1, angle2, stroke == NULL);
@@ -296,7 +296,7 @@ draw_arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
_arc (self, center, width, height, angle1, angle2, color, NULL);
}
@@ -309,7 +309,7 @@ fill_arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
_arc (self, center, width, height, angle1, angle2, NULL, color);
}
@@ -321,7 +321,7 @@ static void
draw_ellipse (DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
GArray *path = g_array_new (FALSE, FALSE, sizeof(BezPoint));
path_build_ellipse (path, center, width, height);
@@ -336,7 +336,7 @@ static void
draw_bezier (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color)
+ GdkRGBA *color)
{
_bezier(self, points, numpoints, NULL, color, FALSE);
}
@@ -348,8 +348,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points, /* Last point must be same as first point */
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
_bezier(self, points, numpoints, fill, stroke, TRUE);
}
@@ -449,7 +449,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
if (text && strlen(text)) {
Text *text_obj;
diff --git a/lib/diatypes.h b/lib/diatypes.h
index f4f3d4c0..89a3bc4e 100644
--- a/lib/diatypes.h
+++ b/lib/diatypes.h
@@ -46,9 +46,6 @@ typedef struct _PolyBBExtras PolyBBExtras;
typedef struct _LineBBExtras LineBBExtras;
typedef struct _ElementBBExtras ElementBBExtras;
-/* In color.h: */
-typedef struct _Color Color;
-
/* In connection.h: */
typedef struct _Connection Connection;
diff --git a/lib/layer.c b/lib/layer.c
index e1a9636b..b4131f19 100644
--- a/lib/layer.c
+++ b/lib/layer.c
@@ -93,7 +93,7 @@ layer_render(Layer *layer, DiaRenderer *renderer, Rectangle *update,
if (update==NULL || rectangle_intersects(update, &obj->bounding_box)) {
if ((render_bounding_boxes()) && (renderer->is_interactive)) {
Point p1, p2;
- Color col;
+ GdkRGBA col;
p1.x = obj->bounding_box.left;
p1.y = obj->bounding_box.top;
p2.x = obj->bounding_box.right;
diff --git a/lib/libdia.def b/lib/libdia.def
index 8d9b5b9a..1f825d3a 100644
--- a/lib/libdia.def
+++ b/lib/libdia.def
@@ -77,12 +77,6 @@ EXPORTS
change_list_add
change_list_create
- color_convert
- color_equals
- color_init
- color_new_rgb
- color_new_rgba
-
composite_add_attribute
composite_find_attribute
diff --git a/lib/pattern.c b/lib/pattern.c
index 06f1b298..a7f69b69 100644
--- a/lib/pattern.c
+++ b/lib/pattern.c
@@ -21,7 +21,6 @@
#include <config.h>
#include "diatypes.h"
#include "pattern.h"
-#include "color.h"
#include <glib-object.h>
typedef struct _DiaPatternClass DiaPatternClass;
@@ -30,7 +29,7 @@ static GType _dia_pattern_get_type (void) G_GNUC_CONST;
typedef struct _ColorStop
{
- Color color;
+ GdkRGBA color;
real offset;
} ColorStop;
@@ -120,10 +119,10 @@ dia_pattern_set_point (DiaPattern *self, real x, real y)
if (self->type == DIA_RADIAL_GRADIENT) {
real dist = distance_ellipse_point (&self->start, self->radius*2, self->radius*2, 0.0, &self->other);
if (dist > 0) {
- /* If the point defined by �fx� and �fy� lies outside the circle defined
- * by �cx�, �cy� and �r�, then the user agent shall set the focal point to
- * the intersection of the line from (�cx�, �cy�) to (�fx�, �fy�) with the
- * circle defined by �cx�, �cy� and �r�
+ /* If the point defined by �fx� and �fy� lies outside the circle defined
+ * by �cx�, �cy� and �r�, then the user agent shall set the focal point to
+ * the intersection of the line from (�cx�, �cy�) to (�fx�, �fy�) with the
+ * circle defined by �cx�, �cy� and �r�
*/
Point p1 = self->start;
Point p2 = self->other;
@@ -191,7 +190,7 @@ dia_pattern_get_radius (DiaPattern *self, real *r)
* \ingroup DiaPattern
*/
void
-dia_pattern_add_color (DiaPattern *self, real pos, const Color *color)
+dia_pattern_add_color (DiaPattern *self, real pos, const GdkRGBA *color)
{
ColorStop stop;
real former = 0.0;
@@ -226,7 +225,7 @@ dia_pattern_set_pattern (DiaPattern *self, DiaPattern *pat)
* \ingroup DiaPattern
*/
void
-dia_pattern_get_fallback_color (DiaPattern *self, Color *color)
+dia_pattern_get_fallback_color (DiaPattern *self, GdkRGBA *color)
{
g_return_if_fail (self != NULL && color != NULL);
if (self->stops->len > 0)
diff --git a/lib/pattern.h b/lib/pattern.h
index 5989d0b1..ecdbb5fb 100644
--- a/lib/pattern.h
+++ b/lib/pattern.h
@@ -45,15 +45,15 @@ DiaPattern *dia_pattern_new (DiaPatternType pt, guint flags, real x, real y);
void dia_pattern_set_radius (DiaPattern *self, real r);
void dia_pattern_set_point (DiaPattern *pattern, real x, real y);
-void dia_pattern_add_color (DiaPattern *pattern, real pos, const Color *stop);
+void dia_pattern_add_color (DiaPattern *pattern, real pos, const GdkRGBA *stop);
void dia_pattern_set_pattern (DiaPattern *pattern, DiaPattern *pat);
-void dia_pattern_get_fallback_color (DiaPattern *pattern, Color *color);
+void dia_pattern_get_fallback_color (DiaPattern *pattern, GdkRGBA *color);
void dia_pattern_get_points (DiaPattern *pattern, Point *p1, Point *p2);
void dia_pattern_get_radius (DiaPattern *pattern, real *r);
void dia_pattern_get_settings (DiaPattern *pattern, DiaPatternType *type, guint *flags);
-typedef gboolean (*DiaColorStopFunc) (real ofs, const Color *col, gpointer user_data);
+typedef gboolean (*DiaColorStopFunc) (real ofs, const GdkRGBA *col, gpointer user_data);
void dia_pattern_foreach (DiaPattern *pattern, DiaColorStopFunc fn, gpointer user_data);
G_END_DECLS
diff --git a/lib/persistence.c b/lib/persistence.c
index 2cba2cb4..eca06901 100644
--- a/lib/persistence.c
+++ b/lib/persistence.c
@@ -226,7 +226,7 @@ persistence_load_color(gchar *role, xmlNodePtr node, DiaContext *ctx)
/* Find the contents? */
attr = composite_find_attribute(node, "colorvalue");
if (attr != NULL) {
- Color *colorval = g_new(Color, 1);
+ GdkRGBA *colorval = g_new(GdkRGBA, 1);
data_color(attribute_first_data(attr), colorval, ctx);
g_hash_table_insert(persistent_colors, role, colorval);
}
@@ -460,7 +460,7 @@ persistence_save_color(gpointer key, gpointer value, gpointer data)
colornode = (ObjectNode)xmlNewChild(tree, NULL, (const xmlChar *)"color", NULL);
xmlSetProp(colornode, (const xmlChar *)"role", (xmlChar *)key);
- data_add_color(new_attribute(colornode, "colorvalue"), (Color *)value, ctx);
+ data_add_color(new_attribute(colornode, "colorvalue"), (GdkRGBA *)value, ctx);
}
static void
@@ -1212,46 +1212,46 @@ persistence_set_string(gchar *role, const gchar *newvalue)
*
* Remember that colors returned are private, not to be deallocated.
* They will be smashed in some undefined way by persistence_set_color */
-Color *
-persistence_register_color(gchar *role, Color *defaultvalue)
+GdkRGBA *
+persistence_register_color(gchar *role, GdkRGBA *defaultvalue)
{
- Color *colorval;
+ GdkRGBA *colorval;
if (role == NULL) return 0;
if (persistent_colors == NULL) {
persistent_colors = _dia_hash_table_str_any_new();
}
- colorval = (Color *)g_hash_table_lookup(persistent_colors, role);
+ colorval = (GdkRGBA *)g_hash_table_lookup(persistent_colors, role);
if (colorval == NULL) {
- colorval = g_new(Color, 1);
+ colorval = g_new(GdkRGBA, 1);
*colorval = *defaultvalue;
g_hash_table_insert(persistent_colors, role, colorval);
}
return colorval;
}
-Color *
+GdkRGBA *
persistence_get_color(gchar *role)
{
- Color *colorval;
+ GdkRGBA *colorval;
if (persistent_colors == NULL) {
g_warning("No persistent colors to get for %s!", role);
return 0;
}
- colorval = (Color *)g_hash_table_lookup(persistent_colors, role);
+ colorval = (GdkRGBA *)g_hash_table_lookup(persistent_colors, role);
if (colorval != NULL) return colorval;
g_warning("No color to get for %s", role);
return 0;
}
void
-persistence_set_color(gchar *role, Color *newvalue)
+persistence_set_color(gchar *role, GdkRGBA *newvalue)
{
- Color *colorval;
+ GdkRGBA *colorval;
if (persistent_colors == NULL) {
g_warning("No persistent colors yet for %s!", role);
return;
}
- colorval = (Color *)g_hash_table_lookup(persistent_colors, role);
+ colorval = (GdkRGBA *)g_hash_table_lookup(persistent_colors, role);
if (colorval != NULL)
*colorval = *newvalue;
else
diff --git a/lib/persistence.h b/lib/persistence.h
index 5980a774..db8ff519 100644
--- a/lib/persistence.h
+++ b/lib/persistence.h
@@ -70,8 +70,8 @@ gchar *persistence_register_string(gchar *role, gchar *defaultvalue);
gchar *persistence_get_string(gchar *role);
void persistence_set_string(gchar *role, const gchar *newvalue);
-Color *persistence_register_color(gchar *role, Color *defaultvalue);
-Color *persistence_get_color(gchar *role);
-void persistence_set_color(gchar *role, Color *newvalue);
+GdkRGBA *persistence_register_color(gchar *role, GdkRGBA *defaultvalue);
+GdkRGBA *persistence_get_color(gchar *role);
+void persistence_set_color(gchar *role, GdkRGBA *newvalue);
#endif
diff --git a/lib/prop_attr.c b/lib/prop_attr.c
index 3da4ec8e..87aee7b0 100644
--- a/lib/prop_attr.c
+++ b/lib/prop_attr.c
@@ -327,11 +327,11 @@ colorprop_get_from_offset(ColorProperty *prop,
void *base, guint offset, guint offset2)
{
if (offset2 == 0) {
- prop->color_data = struct_member(base,offset,Color);
+ prop->color_data = struct_member(base,offset,GdkRGBA);
} else {
void *base2 = struct_member(base,offset,void*);
g_return_if_fail (base2 != NULL);
- prop->color_data = struct_member(base2,offset2,Color);
+ prop->color_data = struct_member(base2,offset2,GdkRGBA);
}
}
@@ -340,11 +340,11 @@ colorprop_set_from_offset(ColorProperty *prop,
void *base, guint offset, guint offset2)
{
if (offset2 == 0) {
- struct_member(base,offset,Color) = prop->color_data;
+ struct_member(base,offset,GdkRGBA) = prop->color_data;
} else {
void *base2 = struct_member(base,offset,void*);
g_return_if_fail (base2 != NULL);
- struct_member(base2,offset2,Color) = prop->color_data;
+ struct_member(base2,offset2,GdkRGBA) = prop->color_data;
g_return_if_fail (offset2 == offsetof(Text, color));
text_set_color ((Text *)base2, &prop->color_data);
}
diff --git a/lib/prop_attr.h b/lib/prop_attr.h
index fb89f5d2..17504221 100644
--- a/lib/prop_attr.h
+++ b/lib/prop_attr.h
@@ -53,7 +53,7 @@ typedef struct {
*/
typedef struct {
Property common;
- Color color_data;
+ GdkRGBA color_data;
} ColorProperty;
/*!
diff --git a/lib/prop_pattern.c b/lib/prop_pattern.c
index 93273f9e..89ef79e9 100644
--- a/lib/prop_pattern.c
+++ b/lib/prop_pattern.c
@@ -104,7 +104,7 @@ data_pattern (DataNode node, DiaContext *ctx)
guint nvals = attribute_num_data(attr);
guint i;
real offset = 0.0;
- Color color = color_black;
+ GdkRGBA color = color_black;
for (i=0; (i < nvals) && data; i++, data = data_next(data)) {
attr = composite_find_attribute(data, "offset");
@@ -133,7 +133,7 @@ typedef struct
} StopUserData;
static gboolean
-_data_add_stop (real ofs, const Color *col, gpointer user_data)
+_data_add_stop (real ofs, const GdkRGBA *col, gpointer user_data)
{
StopUserData *ud = (StopUserData *)user_data;
AttributeNode attr = ud->node;
diff --git a/lib/properties.h b/lib/properties.h
index 8211b011..34758849 100644
--- a/lib/properties.h
+++ b/lib/properties.h
@@ -42,7 +42,6 @@
#include "geometry.h"
#include "arrows.h"
-#include "color.h"
#include "font.h"
#include "dia_xml.h"
#include "intl.h"
@@ -437,10 +436,10 @@ GPtrArray *prop_list_from_single(Property *prop);
/* Convenience functions to construct a prop list from standard properties */
void prop_list_add_line_width (GPtrArray *plist, real line_width);
void prop_list_add_line_style (GPtrArray *plist, LineStyle line_style, real dash);
-void prop_list_add_line_colour (GPtrArray *plist, const Color *color);
-void prop_list_add_fill_colour (GPtrArray *plist, const Color *color);
+void prop_list_add_line_colour (GPtrArray *plist, const GdkRGBA *color);
+void prop_list_add_fill_colour (GPtrArray *plist, const GdkRGBA *color);
void prop_list_add_show_background (GPtrArray *plist, gboolean fill);
-void prop_list_add_text_colour (GPtrArray *plist, const Color *color);
+void prop_list_add_text_colour (GPtrArray *plist, const GdkRGBA *color);
/* addding a text(string) property - just the string no attributes */
void prop_list_add_text (GPtrArray *plist, const char *name, const char *value);
diff --git a/lib/proplist.c b/lib/proplist.c
index e47ba2f9..0ce5a8ac 100644
--- a/lib/proplist.c
+++ b/lib/proplist.c
@@ -248,7 +248,7 @@ prop_list_add_line_style (GPtrArray *plist, LineStyle line_style, real dash)
g_ptr_array_add (plist, prop);
}
static void
-_prop_list_add_colour (GPtrArray *plist, const char *name, const Color *color)
+_prop_list_add_colour (GPtrArray *plist, const char *name, const GdkRGBA *color)
{
Property *prop = make_new_prop (name, PROP_TYPE_COLOUR, 0);
@@ -256,12 +256,12 @@ _prop_list_add_colour (GPtrArray *plist, const char *name, const Color *color)
g_ptr_array_add (plist, prop);
}
void
-prop_list_add_line_colour (GPtrArray *plist, const Color *color)
+prop_list_add_line_colour (GPtrArray *plist, const GdkRGBA *color)
{
_prop_list_add_colour (plist, "line_colour", color);
}
void
-prop_list_add_fill_colour (GPtrArray *plist, const Color *color)
+prop_list_add_fill_colour (GPtrArray *plist, const GdkRGBA *color)
{
_prop_list_add_colour (plist, "fill_colour", color);
}
@@ -347,7 +347,7 @@ prop_list_add_enum (GPtrArray *plist, const char *name, int value)
g_ptr_array_add (plist, prop);
}
void
-prop_list_add_text_colour (GPtrArray *plist, const Color *color)
+prop_list_add_text_colour (GPtrArray *plist, const GdkRGBA *color)
{
_prop_list_add_colour (plist, "text_colour", color);
}
diff --git a/lib/renderer/diacairo-interactive.c b/lib/renderer/diacairo-interactive.c
index 80334d7e..335c311b 100644
--- a/lib/renderer/diacairo-interactive.c
+++ b/lib/renderer/diacairo-interactive.c
@@ -26,7 +26,6 @@
#include <gtk/gtk.h> /* GTK_CHECK_VERSION */
#include "intl.h"
-#include "color.h"
#include "diatransform.h"
#include "object.h"
#include "textline.h"
@@ -56,7 +55,7 @@ struct _DiaCairoInteractiveRenderer
GdkRegion *clip_region;
/** If non-NULL, this rendering is a highlighting with the given color. */
- Color *highlight_color;
+ GdkRGBA *highlight_color;
};
struct _DiaCairoInteractiveRendererClass
@@ -71,15 +70,15 @@ static void clip_region_add_rect(DiaRenderer *renderer,
static void draw_pixel_line(DiaRenderer *renderer,
int x1, int y1,
int x2, int y2,
- Color *color);
+ GdkRGBA *color);
static void draw_pixel_rect(DiaRenderer *renderer,
int x, int y,
int width, int height,
- Color *color);
+ GdkRGBA *color);
static void fill_pixel_rect(DiaRenderer *renderer,
int x, int y,
int width, int height,
- Color *color);
+ GdkRGBA *color);
static void set_size (DiaRenderer *renderer,
gpointer window,
int width, int height);
@@ -176,10 +175,10 @@ get_text_width(DiaRenderer *object,
return result;
}
/** Used as background? for text editing */
-static Color text_edit_color = {1.0, 1.0, 0.7 };
+static GdkRGBA text_edit_color = {1.0, 1.0, 0.7 };
static real
-calculate_relative_luminance (const Color *c)
+calculate_relative_luminance (const GdkRGBA *c)
{
real R, G, B;
@@ -191,7 +190,7 @@ calculate_relative_luminance (const Color *c)
}
static void
draw_text_line (DiaRenderer *self, TextLine *text_line,
- Point *pos, Alignment alignment, Color *color)
+ Point *pos, Alignment alignment, GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
DiaCairoInteractiveRenderer *interactive = DIA_CAIRO_INTERACTIVE_RENDERER (self);
@@ -200,7 +199,7 @@ draw_text_line (DiaRenderer *self, TextLine *text_line,
/* the high_light color is just taken as a hint, alternative needs
* to have some contrast to cursor color (curently hard coded black)
*/
- static Color alternate_color = { 0.5, 0.5, 0.4 };
+ static GdkRGBA alternate_color = { 0.5, 0.5, 0.4 };
real rl, cr1, cr2;
/* just draw the box */
@@ -515,7 +514,7 @@ static void
draw_pixel_line(DiaRenderer *object,
int x1, int y1,
int x2, int y2,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (object);
double x1u = x1 + .5, y1u = y1 + .5, x2u = x2 + .5, y2u = y2 + .5;
@@ -538,7 +537,7 @@ static void
draw_pixel_rect(DiaRenderer *object,
int x, int y,
int width, int height,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (object);
double x1u = x + .5, y1u = y + .5, x2u = x + width + .5, y2u = y + height + .5;
@@ -560,7 +559,7 @@ static void
fill_pixel_rect(DiaRenderer *object,
int x, int y,
int width, int height,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (object);
double x1u = x + .5, y1u = y + .5, x2u = x + width + .5, y2u = y + height + .5;
diff --git a/lib/renderer/diacairo-renderer.c b/lib/renderer/diacairo-renderer.c
index 33c77b6c..b46778b0 100644
--- a/lib/renderer/diacairo-renderer.c
+++ b/lib/renderer/diacairo-renderer.c
@@ -67,7 +67,7 @@ begin_render(DiaRenderer *self, const Rectangle *update)
real lmargin = 0.0, tmargin = 0.0;
gboolean paginated = renderer->surface && /* only with our own pagination, not GtkPrint */
cairo_surface_get_type (renderer->surface) == CAIRO_SURFACE_TYPE_PDF && !renderer->skip_show_page;
- Color background = color_white;
+ GdkRGBA background = color_white;
if (renderer->surface && !renderer->cr)
renderer->cr = cairo_create (renderer->surface);
@@ -226,7 +226,7 @@ set_pattern (DiaRenderer *self, DiaPattern *pattern)
}
static gboolean
-_add_color_stop (real ofs, const Color *col, gpointer user_data)
+_add_color_stop (real ofs, const GdkRGBA *col, gpointer user_data)
{
cairo_pattern_t *pat = (cairo_pattern_t *)user_data;
@@ -529,7 +529,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
@@ -548,7 +548,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
int i;
@@ -574,7 +574,7 @@ draw_polyline(DiaRenderer *self,
static void
_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *color,
+ GdkRGBA *color,
gboolean fill)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
@@ -607,7 +607,7 @@ _polygon(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
if (fill)
_polygon (self, points, num_points, fill, TRUE);
@@ -618,7 +618,7 @@ draw_polygon(DiaRenderer *self,
static void
_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *color,
+ GdkRGBA *color,
gboolean fill)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
@@ -643,7 +643,7 @@ _rect(DiaRenderer *self,
static void
draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
if (fill)
_rect (self, ul_corner, lr_corner, fill, TRUE);
@@ -656,7 +656,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
Point start;
@@ -701,7 +701,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
Point start;
@@ -738,7 +738,7 @@ static void
_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *color,
+ GdkRGBA *color,
gboolean fill)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
@@ -775,7 +775,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
if (fill)
_ellipse (self, center, width, height, fill, TRUE);
@@ -787,7 +787,7 @@ static void
_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color,
+ GdkRGBA *color,
gboolean fill,
gboolean closed)
{
@@ -834,7 +834,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color)
+ GdkRGBA *color)
{
_bezier (self, points, numpoints, color, FALSE, FALSE);
}
@@ -843,8 +843,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
if (fill)
_bezier (self, points, numpoints, fill, TRUE, TRUE);
@@ -857,7 +857,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
int len = strlen(text);
@@ -1086,7 +1086,7 @@ static gpointer parent_class = NULL;
static void
draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke,
+ GdkRGBA *fill, GdkRGBA *stroke,
real radius)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
@@ -1122,7 +1122,7 @@ draw_rounded_rect (DiaRenderer *self,
static void
draw_rounded_polyline (DiaRenderer *self,
Point *points, int num_points,
- Color *color, real radius)
+ GdkRGBA *color, real radius)
{
DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
diff --git a/lib/standard-path.c b/lib/standard-path.c
index 23224fc2..f52af0bf 100644
--- a/lib/standard-path.c
+++ b/lib/standard-path.c
@@ -77,13 +77,13 @@ struct _StdPath {
int stroke_or_fill;
- Color line_color;
+ GdkRGBA line_color;
real line_width;
LineStyle line_style;
real dashlength;
LineJoin line_join;
LineCaps line_caps;
- Color fill_color;
+ GdkRGBA fill_color;
/*! mirroring (stdpath->stroke_or_fill & PDO_FILL) */
gboolean show_background;
@@ -400,7 +400,7 @@ stdpath_draw(StdPath *stdpath, DiaRenderer *renderer)
if (DIA_RENDERER_GET_CLASS (renderer)->is_capable_to(renderer, RENDER_HOLES)) {
if (stdpath->stroke_or_fill & PDO_FILL) {
- Color fill = stdpath->fill_color;
+ GdkRGBA fill = stdpath->fill_color;
if (stdpath->pattern) {
dia_pattern_get_fallback_color (stdpath->pattern, &fill);
if (DIA_RENDERER_GET_CLASS (renderer)->is_capable_to(renderer, RENDER_PATTERN))
@@ -422,7 +422,7 @@ stdpath_draw(StdPath *stdpath, DiaRenderer *renderer)
/* step-wise approach */
/* if it wouldn't RENDER_HOLES it presumably also wouldn't RENDER_PATTERN ... */
if (stdpath->stroke_or_fill & PDO_FILL) {
- Color fill = stdpath->fill_color;
+ GdkRGBA fill = stdpath->fill_color;
if (stdpath->pattern)
dia_pattern_get_fallback_color (stdpath->pattern, &fill);
bezier_render_fill (renderer, stdpath->points, stdpath->num_points, &fill);
diff --git a/lib/text.c b/lib/text.c
index 3d8684bf..9f58268c 100644
--- a/lib/text.c
+++ b/lib/text.c
@@ -291,7 +291,7 @@ text_set_string(Text *text, const char *string)
Text *
new_text(const char *string, DiaFont *font, real height,
- Point *pos, Color *color, Alignment align)
+ Point *pos, GdkRGBA *color, Alignment align)
{
Text *text;
@@ -323,7 +323,7 @@ new_text(const char *string, DiaFont *font, real height,
* Fallback function returning a default initialized text object.
*/
Text *
-new_text_default(Point *pos, Color *color, Alignment align)
+new_text_default(Point *pos, GdkRGBA *color, Alignment align)
{
Text *text;
DiaFont *font;
@@ -422,7 +422,7 @@ text_set_position(Text *text, Point *pos)
}
void
-text_set_color(Text *text, Color *col)
+text_set_color(Text *text, GdkRGBA *col)
{
text->color = *col;
}
@@ -1109,7 +1109,7 @@ data_text(AttributeNode text_attr, DiaContext *ctx)
DiaFont *font;
real height;
Point pos = {0.0, 0.0};
- Color col;
+ GdkRGBA col;
Alignment align;
AttributeNode attr;
Text *text;
diff --git a/lib/text.h b/lib/text.h
index e8bf8178..7f9c5acf 100644
--- a/lib/text.h
+++ b/lib/text.h
@@ -51,7 +51,7 @@ struct _Text {
DiaFont *font;
real height;
Point position;
- Color color;
+ GdkRGBA color;
Alignment alignment;
/* Cursor pos: */
@@ -69,8 +69,8 @@ struct _Text {
/* makes an internal copy of the string */
/*! \brief Text object creation \memberof _Text */
Text *new_text(const char *string, DiaFont *font, real height,
- Point *pos, Color *color, Alignment align);
-Text *new_text_default(Point *pos, Color *color, Alignment align);
+ Point *pos, GdkRGBA *color, Alignment align);
+Text *new_text_default(Point *pos, GdkRGBA *color, Alignment align);
void text_destroy(Text *text);
Text *text_copy(Text *text);
gchar *text_get_line(const Text *text, int line);
@@ -80,7 +80,7 @@ void text_set_height(Text *text, real height);
real text_get_height(const Text *text);
void text_set_font(Text *text, DiaFont *font);
void text_set_position(Text *text, Point *pos);
-void text_set_color(Text *text, Color *col);
+void text_set_color(Text *text, GdkRGBA *col);
void text_set_alignment(Text *text, Alignment align);
real text_distance_from(Text *text, Point *point);
void text_calc_boundingbox(Text *text, Rectangle *box);
diff --git a/lib/textattr.h b/lib/textattr.h
index 993f7fc8..55e0d7d1 100644
--- a/lib/textattr.h
+++ b/lib/textattr.h
@@ -21,13 +21,12 @@
#include "diatypes.h"
#include "font.h"
#include "geometry.h"
-#include "color.h"
struct _TextAttributes {
DiaFont *font;
real height;
Point position;
- Color color;
+ GdkRGBA color;
Alignment alignment;
};
diff --git a/lib/widgets.h b/lib/widgets.h
index d35cb086..881ed4ee 100644
--- a/lib/widgets.h
+++ b/lib/widgets.h
@@ -23,7 +23,6 @@
#include "diatypes.h"
#include "font.h"
-#include "color.h"
#include "arrows.h"
#include "units.h"
@@ -54,9 +53,9 @@ void dia_line_style_selector_set_linestyle (DiaLineStyleSelector *as,
GType dia_color_selector_get_type (void);
GtkWidget* dia_color_selector_new (void);
void dia_color_selector_set_use_alpha (GtkWidget *cs, gboolean use_alpha);
-void dia_color_selector_get_color (GtkWidget *cs, Color *color);
+void dia_color_selector_get_color (GtkWidget *cs, GdkRGBA *color);
void dia_color_selector_set_color (GtkWidget *cs,
- const Color *color);
+ const GdkRGBA *color);
/* DiaArrowSelector */
diff --git a/objects/AADL/aadl.h b/objects/AADL/aadl.h
index 2247f3ef..0f2d0545 100755
--- a/objects/AADL/aadl.h
+++ b/objects/AADL/aadl.h
@@ -81,8 +81,8 @@ struct _Aadlbox
int num_connections;
ConnectionPoint **connections;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
Aadlbox_specific *specific;
};
diff --git a/objects/Database/compound.c b/objects/Database/compound.c
index 524b1a06..6e421fc6 100644
--- a/objects/Database/compound.c
+++ b/objects/Database/compound.c
@@ -66,14 +66,14 @@ struct _Compound {
gint num_arms;
real line_width;
- Color line_color;
+ GdkRGBA line_color;
};
struct _CompoundState {
ArmHandleState * handle_states;
gint num_handles; /* num_arms = num_handles-1 */
real line_width;
- Color line_color;
+ GdkRGBA line_color;
};
struct _ArmHandleState {
@@ -561,7 +561,7 @@ compound_draw (Compound * comp, DiaRenderer * renderer)
#if DEBUG_DRAW_MP_DIRECTION
{
Point p = comp->mount_point.pos;
- Color red = { 1.0, 0.0, 0.0, 1.0 };
+ GdkRGBA red = { 1.0, 0.0, 0.0, 1.0 };
gchar dirs = comp->mount_point.directions;
if (dirs & DIR_NORTH)
p.y -= 1.0;
diff --git a/objects/Database/database.h b/objects/Database/database.h
index cb4efa02..b2e382a0 100644
--- a/objects/Database/database.h
+++ b/objects/Database/database.h
@@ -64,9 +64,9 @@ struct _Table {
DiaFont * comment_font;
/* colors */
- Color line_color;
- Color fill_color;
- Color text_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
+ GdkRGBA text_color;
real border_width;
@@ -129,8 +129,8 @@ struct _TableReference {
real line_width;
real dashlength;
LineStyle line_style;
- Color line_color;
- Color text_color;
+ GdkRGBA line_color;
+ GdkRGBA text_color;
gchar * start_point_desc;
gchar * end_point_desc;
diff --git a/objects/Database/table.c b/objects/Database/table.c
index 67f85f26..72d6e0f7 100644
--- a/objects/Database/table.c
+++ b/objects/Database/table.c
@@ -77,7 +77,7 @@ static DiaMenu * table_object_menu(DiaObject *, Point *);
static ObjectChange * table_show_comments_cb(DiaObject *, Point *, gpointer);
static void underline_table_attribute (DiaRenderer *, Point,
TableAttribute *, Table *);
-static void fill_diamond (DiaRenderer *, real, real, Point *, Color *);
+static void fill_diamond (DiaRenderer *, real, real, Point *, GdkRGBA *);
static void table_init_fonts (Table *);
static TableAttribute *table_attribute_new (void);
@@ -98,7 +98,7 @@ static gchar * create_documentation_tag (gchar * comment,
static void draw_comments(DiaRenderer *renderer,
DiaFont *font,
real font_height,
- Color *text_color,
+ GdkRGBA *text_color,
gchar *comment,
gboolean comment_tagging,
gint Comment_line_length,
@@ -606,7 +606,7 @@ static void
draw_comments(DiaRenderer *renderer,
DiaFont *font,
real font_height,
- Color *text_color,
+ GdkRGBA *text_color,
gchar *comment,
gboolean comment_tagging,
gint Comment_line_length,
@@ -644,7 +644,7 @@ draw_comments(DiaRenderer *renderer,
static void
fill_diamond (DiaRenderer *renderer, real half_height, real width,
- Point * lower_midpoint, Color * color)
+ Point * lower_midpoint, GdkRGBA * color)
{
Point poly[4];
@@ -672,9 +672,9 @@ table_draw_attributesbox (Table * table, DiaRenderer * renderer,
Point endP;
Point indicP;
GList * list;
- Color * text_color = &table->text_color;
- Color * fill_color = &table->fill_color;
- Color * line_color = &table->line_color;
+ GdkRGBA * text_color = &table->text_color;
+ GdkRGBA * fill_color = &table->fill_color;
+ GdkRGBA * line_color = &table->line_color;
DiaFont * attr_font;
real attr_font_height;
real scale;
diff --git a/objects/ER/attribute.c b/objects/ER/attribute.c
index 61651c3a..51a409a0 100644
--- a/objects/ER/attribute.c
+++ b/objects/ER/attribute.c
@@ -60,8 +60,8 @@ struct _AttributeState {
gboolean multivalue;
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
};
struct _Attribute {
@@ -80,8 +80,8 @@ struct _Attribute {
gboolean multivalue;
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
};
static real attribute_distance_from(Attribute *attribute, Point *point);
diff --git a/objects/ER/entity.c b/objects/ER/entity.c
index 999d9d5e..0fc385e7 100644
--- a/objects/ER/entity.c
+++ b/objects/ER/entity.c
@@ -54,8 +54,8 @@ struct _Entity {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean associative;
diff --git a/objects/ER/relationship.c b/objects/ER/relationship.c
index 1f89c566..cd8d6c6e 100644
--- a/objects/ER/relationship.c
+++ b/objects/ER/relationship.c
@@ -66,8 +66,8 @@ struct _Relationship {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
};
diff --git a/objects/FS/flow-ortho.c b/objects/FS/flow-ortho.c
index 06bd337c..ebea8a40 100644
--- a/objects/FS/flow-ortho.c
+++ b/objects/FS/flow-ortho.c
@@ -341,7 +341,7 @@ orthflow_draw(Orthflow *orthflow, DiaRenderer *renderer)
{
DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
int n = orthflow->orth.numpoints ;
- Color* render_color = &orthflow_color_signal;
+ GdkRGBA* render_color = &orthflow_color_signal;
Point *points;
real linewidth;
Arrow arrow;
@@ -424,7 +424,7 @@ orthflow_create(Point *startpoint,
orthflow->text = text_copy( orthflow_default_label ) ;
text_set_position( orthflow->text, &p ) ;
} else {
- Color* color = &orthflow_color_signal;
+ GdkRGBA* color = &orthflow_color_signal;
switch (orthflow->type) {
case ORTHFLOW_ENERGY:
@@ -502,7 +502,7 @@ orthflow_update_data(Orthflow *orthflow)
OrthConn *orth = &orthflow->orth ;
DiaObject *obj = &orth->object;
Rectangle rect;
- Color* color = &orthflow_color_signal;
+ GdkRGBA* color = &orthflow_color_signal;
switch (orthflow->type) {
case ORTHFLOW_ENERGY:
diff --git a/objects/FS/flow.c b/objects/FS/flow.c
index 07086e85..8e6bb998 100644
--- a/objects/FS/flow.c
+++ b/objects/FS/flow.c
@@ -40,9 +40,9 @@
#include "pixmaps/flow.xpm"
-Color flow_color_energy = { 1.0f, 0.0f, 0.0f, 1.0f };
-Color flow_color_material = { 0.8f, 0.0f, 0.8f, 1.0f };
-Color flow_color_signal = { 0.0f, 0.0f, 1.0f, 1.0f };
+GdkRGBA flow_color_energy = { 1.0f, 0.0f, 0.0f, 1.0f };
+GdkRGBA flow_color_material = { 0.8f, 0.0f, 0.8f, 1.0f };
+GdkRGBA flow_color_signal = { 0.0f, 0.0f, 1.0f, 1.0f };
typedef struct _Flow Flow;
typedef enum {
@@ -312,7 +312,7 @@ flow_draw(Flow *flow, DiaRenderer *renderer)
Point *endpoints, p1, p2;
Arrow arrow;
int n1 = 1, n2 = 0;
- Color* render_color = NULL;
+ GdkRGBA* render_color = NULL;
assert(flow != NULL);
assert(renderer != NULL);
@@ -464,7 +464,7 @@ flow_update_data(Flow *flow)
Connection *conn = &flow->connection;
DiaObject *obj = &conn->object;
Rectangle rect;
- Color* color = NULL;
+ GdkRGBA* color = NULL;
if (connpoint_is_autogap(flow->connection.endpoint_handles[0].connected_to) ||
connpoint_is_autogap(flow->connection.endpoint_handles[1].connected_to)) {
diff --git a/objects/GRAFCET/action.c b/objects/GRAFCET/action.c
index 54d7068a..7da2f503 100644
--- a/objects/GRAFCET/action.c
+++ b/objects/GRAFCET/action.c
@@ -32,7 +32,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "geometry.h"
#include "text.h"
@@ -327,7 +326,7 @@ action_draw(Action *action, DiaRenderer *renderer)
Point ul,br,p1,p2;
int i;
real chunksize;
- Color cl;
+ GdkRGBA cl;
renderer_ops->set_linewidth(renderer, ACTION_LINE_WIDTH);
renderer_ops->set_linestyle(renderer, LINESTYLE_SOLID, 0.0);
diff --git a/objects/GRAFCET/boolequation.c b/objects/GRAFCET/boolequation.c
index 58b9c5a7..176c0dec 100644
--- a/objects/GRAFCET/boolequation.c
+++ b/objects/GRAFCET/boolequation.c
@@ -566,7 +566,7 @@ boolequation_set_value(Boolequation *booleq, const gchar *value)
Boolequation *
boolequation_create(const gchar *value, DiaFont *font, real fontheight,
- Color *color)
+ GdkRGBA *color)
{
Boolequation *booleq;
diff --git a/objects/GRAFCET/boolequation.h b/objects/GRAFCET/boolequation.h
index 050201d8..c15e1f79 100644
--- a/objects/GRAFCET/boolequation.h
+++ b/objects/GRAFCET/boolequation.h
@@ -35,7 +35,7 @@ typedef struct _Block Block;
typedef struct {
DiaFont *font;
real fontheight;
- Color color;
+ GdkRGBA color;
Point pos;
@@ -53,7 +53,7 @@ typedef struct {
extern Boolequation *boolequation_create(const gchar *value, DiaFont *font,
- real fontheight, Color *color);
+ real fontheight, GdkRGBA *color);
extern void boolequation_destroy(Boolequation *rcep);
extern void boolequation_set_value(Boolequation *rcep, const gchar *value);
diff --git a/objects/GRAFCET/condition.c b/objects/GRAFCET/condition.c
index 49876c5b..80d2859b 100644
--- a/objects/GRAFCET/condition.c
+++ b/objects/GRAFCET/condition.c
@@ -32,7 +32,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "geometry.h"
#include "text.h"
@@ -58,7 +57,7 @@ typedef struct _Condition {
gchar *cond_value;
DiaFont *cond_font;
real cond_fontheight;
- Color cond_color;
+ GdkRGBA cond_color;
/* computed values : */
Rectangle labelbb;
@@ -330,7 +329,7 @@ condition_create(Point *startpoint,
DiaFont *default_font;
real default_fontheight;
- Color fg_color;
+ GdkRGBA fg_color;
condition = g_malloc0(sizeof(Condition));
conn = &condition->connection;
diff --git a/objects/GRAFCET/step.c b/objects/GRAFCET/step.c
index 5de8f85c..cead2047 100644
--- a/objects/GRAFCET/step.c
+++ b/objects/GRAFCET/step.c
@@ -72,7 +72,7 @@ typedef struct _Step {
DiaFont *font;
real font_size;
- Color font_color;
+ GdkRGBA font_color;
Handle north,south;
Point SD1,SD2,NU1,NU2;
@@ -242,7 +242,7 @@ static void step_been_renamed(const gchar *sid)
if (*endptr == '\0') __stepnum = snum + 1;
}
-static Color color_red = { 1.0f, 0.0f, 0.0f, 1.0f };
+static GdkRGBA color_red = { 1.0f, 0.0f, 0.0f, 1.0f };
static real
step_distance_from(Step *step, Point *point)
diff --git a/objects/GRAFCET/transition.c b/objects/GRAFCET/transition.c
index 152f7c9c..ead57823 100644
--- a/objects/GRAFCET/transition.c
+++ b/objects/GRAFCET/transition.c
@@ -32,7 +32,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "geometry.h"
#include "text.h"
@@ -62,7 +61,7 @@ typedef struct _Transition {
Boolequation *receptivity;
DiaFont *rcep_font;
real rcep_fontheight;
- Color rcep_color;
+ GdkRGBA rcep_color;
char *rcep_value;
ConnectionPoint connections[2];
@@ -374,7 +373,7 @@ transition_create(Point *startpoint,
Element *elem;
DiaFont *default_font = NULL;
real default_fontheight;
- Color fg_color;
+ GdkRGBA fg_color;
transition = g_malloc0(sizeof(Transition));
elem = &transition->element;
diff --git a/objects/GRAFCET/vergent.c b/objects/GRAFCET/vergent.c
index 4bd2771c..1434bf83 100644
--- a/objects/GRAFCET/vergent.c
+++ b/objects/GRAFCET/vergent.c
@@ -32,7 +32,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "geometry.h"
#include "connpoint_line.h"
diff --git a/objects/Istar/goal.c b/objects/Istar/goal.c
index 04338535..401641fc 100644
--- a/objects/Istar/goal.c
+++ b/objects/Istar/goal.c
@@ -43,7 +43,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/softgoal.xpm"
diff --git a/objects/Istar/other.c b/objects/Istar/other.c
index df32736a..c39fd8a8 100644
--- a/objects/Istar/other.c
+++ b/objects/Istar/other.c
@@ -42,7 +42,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/resource.xpm"
diff --git a/objects/Jackson/domain.c b/objects/Jackson/domain.c
index b961c375..a59fa924 100644
--- a/objects/Jackson/domain.c
+++ b/objects/Jackson/domain.c
@@ -43,7 +43,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/given_domain.xpm"
diff --git a/objects/KAOS/goal.c b/objects/KAOS/goal.c
index 403b4402..a3d47625 100644
--- a/objects/KAOS/goal.c
+++ b/objects/KAOS/goal.c
@@ -43,7 +43,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/goal.xpm"
diff --git a/objects/KAOS/metabinrel.c b/objects/KAOS/metabinrel.c
index b8c96a18..1384468a 100644
--- a/objects/KAOS/metabinrel.c
+++ b/objects/KAOS/metabinrel.c
@@ -91,7 +91,7 @@ struct _Mbr {
#define MBR_DEC_SIZE 1.0
-static Color color_red = { 1.0f, 0.0f, 0.0f, 1.0f };
+static GdkRGBA color_red = { 1.0f, 0.0f, 0.0f, 1.0f };
static DiaFont *mbr_font = NULL;
diff --git a/objects/KAOS/other.c b/objects/KAOS/other.c
index 8d4fac27..6604124a 100644
--- a/objects/KAOS/other.c
+++ b/objects/KAOS/other.c
@@ -43,7 +43,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/agent.xpm"
diff --git a/objects/Misc/analog_clock.c b/objects/Misc/analog_clock.c
index 51cd651a..e23f7fab 100644
--- a/objects/Misc/analog_clock.c
+++ b/objects/Misc/analog_clock.c
@@ -35,7 +35,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "dynamic_obj.h"
@@ -48,13 +47,13 @@ typedef struct _Chronoline {
ConnectionPoint hour_tip, min_tip, sec_tip;
ConnectionPoint center_cp;
- Color border_color;
+ GdkRGBA border_color;
real border_line_width;
- Color inner_color;
+ GdkRGBA inner_color;
gboolean show_background;
- Color arrow_color;
+ GdkRGBA arrow_color;
real arrow_line_width;
- Color sec_arrow_color;
+ GdkRGBA sec_arrow_color;
real sec_arrow_line_width;
gboolean show_ticks;
diff --git a/objects/Misc/diagram_as_object.c b/objects/Misc/diagram_as_object.c
index 0a030ff1..2e0052f4 100644
--- a/objects/Misc/diagram_as_object.c
+++ b/objects/Misc/diagram_as_object.c
@@ -54,9 +54,9 @@ typedef struct _DiagramAsElement {
ConnectionPoint connections[NUM_CONNECTIONS];
- Color border_color;
+ GdkRGBA border_color;
real border_line_width;
- Color inner_color;
+ GdkRGBA inner_color;
gboolean show_background;
gchar *filename;
diff --git a/objects/Misc/grid_object.c b/objects/Misc/grid_object.c
index c572d970..0253d68d 100644
--- a/objects/Misc/grid_object.c
+++ b/objects/Misc/grid_object.c
@@ -36,7 +36,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/grid_object.xpm"
@@ -51,13 +50,13 @@ typedef struct _Grid_Object {
gint cells_cols;
ConnectionPoint *cells;
- Color border_color;
+ GdkRGBA border_color;
real border_line_width;
- Color inner_color;
+ GdkRGBA inner_color;
gboolean show_background;
gint grid_rows;
gint grid_cols;
- Color gridline_color;
+ GdkRGBA gridline_color;
real gridline_width;
} Grid_Object;
diff --git a/objects/Misc/measure.c b/objects/Misc/measure.c
index 7b962688..c7c10418 100644
--- a/objects/Misc/measure.c
+++ b/objects/Misc/measure.c
@@ -38,7 +38,7 @@ typedef struct _Measure {
DiaFont *font;
real font_height;
- Color line_color;
+ GdkRGBA line_color;
real line_width;
real scale;
DiaUnit unit;
diff --git a/objects/Misc/n_gon.c b/objects/Misc/n_gon.c
index fe7b4b1a..4071761c 100644
--- a/objects/Misc/n_gon.c
+++ b/objects/Misc/n_gon.c
@@ -63,8 +63,8 @@ struct _Ngon {
LineJoin line_join;
real dashlength;
real line_width;
- Color stroke;
- Color fill;
+ GdkRGBA stroke;
+ GdkRGBA fill;
gboolean show_background;
DiaPattern *pattern;
@@ -228,7 +228,7 @@ _ngon_draw(Ngon *ng, DiaRenderer *renderer)
gboolean pattern_fill = ng->show_background
&& ng->pattern != NULL
&& renderer_ops->is_capable_to(renderer, RENDER_PATTERN);
- Color fill;
+ GdkRGBA fill;
g_return_if_fail (ng->points->len);
diff --git a/objects/Misc/tree.c b/objects/Misc/tree.c
index 3fcd258e..3e30361d 100644
--- a/objects/Misc/tree.c
+++ b/objects/Misc/tree.c
@@ -47,7 +47,7 @@ typedef struct _Tree {
Handle **handles;
Point *parallel_points;
Point real_ends[2];
- Color line_color;
+ GdkRGBA line_color;
} Tree;
enum change_type {
diff --git a/objects/SADT/annotation.c b/objects/SADT/annotation.c
index 1464b08a..933d7f15 100644
--- a/objects/SADT/annotation.c
+++ b/objects/SADT/annotation.c
@@ -48,7 +48,7 @@ typedef struct _Annotation {
Text *text;
- Color line_color;
+ GdkRGBA line_color;
} Annotation;
@@ -120,7 +120,7 @@ static ObjectOps annotation_ops = {
#ifdef TEMPORARY_EVENT_TEST
static gboolean
handle_btn1(Annotation *annotation, Property *prop) {
- Color col;
+ GdkRGBA col;
col = annotation->text->color;
/* g_message("in handle_btn1 for object %p col=%.2f:%.2f:%.2f",
annotation,col.red,col.green,col.blue); */
diff --git a/objects/SADT/arrow.c b/objects/SADT/arrow.c
index f59d3de0..144f1895 100644
--- a/objects/SADT/arrow.c
+++ b/objects/SADT/arrow.c
@@ -32,7 +32,6 @@
#include "connectionpoint.h"
#include "diarenderer.h"
#include "attributes.h"
-#include "color.h"
#include "properties.h"
#include "sadt.h"
@@ -65,7 +64,7 @@ typedef struct _Sadtarrow {
Sadtarrow_style style;
gboolean autogray;
- Color line_color;
+ GdkRGBA line_color;
} Sadtarrow;
static ObjectChange* sadtarrow_move_handle(Sadtarrow *sadtarrow, Handle *handle,
@@ -229,9 +228,9 @@ sadtarrow_move(Sadtarrow *sadtarrow, Point *to)
}
static void draw_dot(DiaRenderer *renderer,
- Point *end, Point *vect, Color *col);
+ Point *end, Point *vect, GdkRGBA *col);
static void draw_tunnel(DiaRenderer *renderer,
- Point *end, Point *vect, Color *col);
+ Point *end, Point *vect, GdkRGBA *col);
#define GBASE .45
#define GMULT .55
@@ -243,7 +242,7 @@ sadtarrow_draw(Sadtarrow *sadtarrow, DiaRenderer *renderer)
OrthConn *orth = &sadtarrow->orth;
Point *points;
int n;
- Color col;
+ GdkRGBA col;
Arrow arrow;
points = &orth->points[0];
@@ -291,7 +290,7 @@ sadtarrow_draw(Sadtarrow *sadtarrow, DiaRenderer *renderer)
}
static void draw_dot(DiaRenderer *renderer,
- Point *end, Point *vect, Color *col)
+ Point *end, Point *vect, GdkRGBA *col)
{
DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
Point vv,vp,vt,pt;
@@ -320,7 +319,7 @@ static void draw_dot(DiaRenderer *renderer,
}
static void draw_tunnel(DiaRenderer *renderer,
- Point *end, Point *vect, Color *col)
+ Point *end, Point *vect, GdkRGBA *col)
{
DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
Point vv,vp,vt1,vt2;
diff --git a/objects/SADT/box.c b/objects/SADT/box.c
index 1981db41..e70059e8 100644
--- a/objects/SADT/box.c
+++ b/objects/SADT/box.c
@@ -39,7 +39,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "pixmaps/sadtbox.xpm"
@@ -65,8 +64,8 @@ typedef struct _Box {
gchar *id;
real padding;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
} Box;
static real sadtbox_distance_from(Box *box, Point *point);
diff --git a/objects/UML/activity.c b/objects/UML/activity.c
index 79301873..9915e3cc 100644
--- a/objects/UML/activity.c
+++ b/objects/UML/activity.c
@@ -49,8 +49,8 @@ struct _State {
Text *text;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
diff --git a/objects/UML/actor.c b/objects/UML/actor.c
index a65d7c15..9ab4e3c8 100644
--- a/objects/UML/actor.c
+++ b/objects/UML/actor.c
@@ -44,8 +44,8 @@ struct _Actor {
Text *text;
real line_width;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
#define ACTOR_WIDTH 2.2
diff --git a/objects/UML/association.c b/objects/UML/association.c
index 95356990..3848a6a8 100644
--- a/objects/UML/association.c
+++ b/objects/UML/association.c
@@ -137,8 +137,8 @@ struct _Association {
AssociationEnd end[2];
- Color text_color;
- Color line_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
DiaFont *font;
real font_height;
diff --git a/objects/UML/branch.c b/objects/UML/branch.c
index cd56026d..29ee0377 100644
--- a/objects/UML/branch.c
+++ b/objects/UML/branch.c
@@ -48,8 +48,8 @@ struct _Branch
{
Element element;
ConnectionPoint connections[NUM_CONNECTIONS];
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
static const double BRANCH_BORDERWIDTH = 0.1;
@@ -244,7 +244,7 @@ static void branch_update_data(Branch *branch)
branch->connections[3].pos.y = elem->corner.y + elem->height;
branch->connections[3].directions = DIR_SOUTH;
- extra->border_trans = BRANCH_BORDERWIDTH / 1.4142; /* not 2.0, it is rotated 45� */
+ extra->border_trans = BRANCH_BORDERWIDTH / 1.4142; /* not 2.0, it is rotated 45� */
element_update_boundingbox(elem);
obj->position = elem->corner;
diff --git a/objects/UML/class.c b/objects/UML/class.c
index 5cd7cdb2..0e9e2f52 100644
--- a/objects/UML/class.c
+++ b/objects/UML/class.c
@@ -572,7 +572,7 @@ uml_underline_text(DiaRenderer *renderer,
DiaFont *font,
real font_height,
gchar *string,
- Color *color,
+ GdkRGBA *color,
real line_width,
real underline_width)
{
@@ -720,7 +720,7 @@ static void
uml_draw_comments(DiaRenderer *renderer,
DiaFont *font,
real font_height,
- Color *text_color,
+ GdkRGBA *text_color,
gchar *comment,
gboolean comment_tagging,
gint Comment_line_length,
@@ -795,7 +795,7 @@ umlclass_draw_namebox(UMLClass *umlclass, DiaRenderer *renderer, Element *elem )
Point StartPoint;
Point LowerRightPoint;
real Yoffset;
- Color *text_color = ¨class->text_color;
+ GdkRGBA *text_color = ¨class->text_color;
@@ -880,9 +880,9 @@ umlclass_draw_attributebox(UMLClass *umlclass, DiaRenderer *renderer, Element *e
Point StartPoint;
Point LowerRight;
DiaFont *font;
- Color *fill_color = ¨class->fill_color;
- Color *line_color = ¨class->line_color;
- Color *text_color = ¨class->text_color;
+ GdkRGBA *fill_color = ¨class->fill_color;
+ GdkRGBA *line_color = ¨class->line_color;
+ GdkRGBA *text_color = ¨class->text_color;
GList *list;
StartPoint.x = elem->corner.x;
@@ -967,9 +967,9 @@ umlclass_draw_operationbox(UMLClass *umlclass, DiaRenderer *renderer, Element *e
Point LowerRight;
DiaFont *font;
GList *list;
- Color *fill_color = ¨class->fill_color;
- Color *line_color = ¨class->line_color;
- Color *text_color = ¨class->text_color;
+ GdkRGBA *fill_color = ¨class->fill_color;
+ GdkRGBA *line_color = ¨class->line_color;
+ GdkRGBA *text_color = ¨class->text_color;
StartPoint.x = elem->corner.x;
@@ -1119,9 +1119,9 @@ umlclass_draw_template_parameters_box(UMLClass *umlclass, DiaRenderer *renderer,
DiaFont *font = umlclass->normal_font;
real font_height = umlclass->font_height;
real ascent;
- Color *fill_color = ¨class->fill_color;
- Color *line_color = ¨class->line_color;
- Color *text_color = ¨class->text_color;
+ GdkRGBA *fill_color = ¨class->fill_color;
+ GdkRGBA *line_color = ¨class->line_color;
+ GdkRGBA *text_color = ¨class->text_color;
/*
diff --git a/objects/UML/class.h b/objects/UML/class.h
index 46bc07ff..5a2e888f 100644
--- a/objects/UML/class.h
+++ b/objects/UML/class.h
@@ -103,9 +103,9 @@ struct _UMLClass {
int comment_line_length; /**< Maximum line length for comments */
int comment_tagging; /**< bool: if the {documentation = } tag should be used */
- Color line_color;
- Color fill_color;
- Color text_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
+ GdkRGBA text_color;
/** Attributes: aka member variables */
GList *attributes;
diff --git a/objects/UML/class_dialog.c b/objects/UML/class_dialog.c
index 2910924c..0aed2d5c 100644
--- a/objects/UML/class_dialog.c
+++ b/objects/UML/class_dialog.c
@@ -95,9 +95,9 @@ struct _UMLClassState {
int comment_tagging;
real line_width;
- Color line_color;
- Color fill_color;
- Color text_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
+ GdkRGBA text_color;
/* Attributes: */
GList *attributes;
diff --git a/objects/UML/classicon.c b/objects/UML/classicon.c
index f6dd9b92..e515e12c 100644
--- a/objects/UML/classicon.c
+++ b/objects/UML/classicon.c
@@ -49,8 +49,8 @@ struct _Classicon {
int stereotype;
int is_object;
Text *text;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
real line_width;
};
diff --git a/objects/UML/component.c b/objects/UML/component.c
index fe5b9437..f00b504c 100644
--- a/objects/UML/component.c
+++ b/objects/UML/component.c
@@ -49,8 +49,8 @@ struct _Component {
char *st_stereotype;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
#define COMPONENT_BORDERWIDTH 0.1
diff --git a/objects/UML/component_feature.c b/objects/UML/component_feature.c
index 49a75ec7..102538e8 100644
--- a/objects/UML/component_feature.c
+++ b/objects/UML/component_feature.c
@@ -71,7 +71,7 @@ struct _Compfeat {
Point text_pos;
Handle text_handle;
- Color line_color;
+ GdkRGBA line_color;
real line_width;
};
diff --git a/objects/UML/constraint.c b/objects/UML/constraint.c
index 9f853394..8fc38103 100644
--- a/objects/UML/constraint.c
+++ b/objects/UML/constraint.c
@@ -48,8 +48,8 @@ struct _Constraint {
Point text_pos;
real text_width;
- Color text_color;
- Color line_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
DiaFont *font;
real font_height;
diff --git a/objects/UML/dependency.c b/objects/UML/dependency.c
index f5cdd892..c5718fe5 100644
--- a/objects/UML/dependency.c
+++ b/objects/UML/dependency.c
@@ -47,8 +47,8 @@ struct _Dependency {
Alignment text_align;
real text_width;
- Color text_color;
- Color line_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
int draw_arrow;
char *name;
diff --git a/objects/UML/fork.c b/objects/UML/fork.c
index 8669b339..2838fe2f 100644
--- a/objects/UML/fork.c
+++ b/objects/UML/fork.c
@@ -47,7 +47,7 @@ typedef struct _Fork Fork;
struct _Fork
{
Element element;
- Color fill_color;
+ GdkRGBA fill_color;
ConnectionPoint connections[NUM_CONNECTIONS];
};
diff --git a/objects/UML/generalization.c b/objects/UML/generalization.c
index 21c762c6..06a978ca 100644
--- a/objects/UML/generalization.c
+++ b/objects/UML/generalization.c
@@ -48,10 +48,10 @@ struct _Generalization {
DiaFont *font;
real font_height;
- Color text_color;
+ GdkRGBA text_color;
real line_width;
- Color line_color;
+ GdkRGBA line_color;
char *name;
char *stereotype; /* excluding << and >> */
diff --git a/objects/UML/implements.c b/objects/UML/implements.c
index 4475f0e1..9b01272d 100644
--- a/objects/UML/implements.c
+++ b/objects/UML/implements.c
@@ -48,10 +48,10 @@ struct _Implements {
DiaFont *font;
real font_height;
- Color text_color;
+ GdkRGBA text_color;
real line_width;
- Color line_color;
+ GdkRGBA line_color;
gchar *text;
Point text_pos;
diff --git a/objects/UML/large_package.c b/objects/UML/large_package.c
index c7206b0d..0568e1b8 100644
--- a/objects/UML/large_package.c
+++ b/objects/UML/large_package.c
@@ -54,9 +54,9 @@ struct _LargePackage {
real line_width;
- Color text_color;
- Color line_color;
- Color fill_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
real font_height;
diff --git a/objects/UML/lifeline.c b/objects/UML/lifeline.c
index c110a2bb..1fe1eb75 100644
--- a/objects/UML/lifeline.c
+++ b/objects/UML/lifeline.c
@@ -59,8 +59,8 @@ struct _Lifeline {
int draw_focuscontrol;
int draw_cross;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
ConnPointLine *northwest,*southwest,*northeast,*southeast;
diff --git a/objects/UML/message.c b/objects/UML/message.c
index 1e2f9a75..e3ae0158 100644
--- a/objects/UML/message.c
+++ b/objects/UML/message.c
@@ -61,8 +61,8 @@ struct _Message {
Point text_pos;
real text_width;
- Color text_color;
- Color line_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
DiaFont *font;
real font_height;
diff --git a/objects/UML/node.c b/objects/UML/node.c
index 10a0c11a..43e24abe 100644
--- a/objects/UML/node.c
+++ b/objects/UML/node.c
@@ -49,8 +49,8 @@ struct _Node
ConnectionPoint connections[NUM_CONNECTIONS];
Text *name;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
real line_width;
};
diff --git a/objects/UML/note.c b/objects/UML/note.c
index fa39f2c9..f8c54516 100644
--- a/objects/UML/note.c
+++ b/objects/UML/note.c
@@ -45,8 +45,8 @@ struct _Note {
Text *text;
real line_width;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
#define NOTE_BORDERWIDTH 0.1
diff --git a/objects/UML/object.c b/objects/UML/object.c
index 2ea38305..8d82a80d 100644
--- a/objects/UML/object.c
+++ b/objects/UML/object.c
@@ -54,8 +54,8 @@ struct _Objet {
TextAttributes text_attrs; /* for both text objects */
real line_width;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
Point ex_pos, st_pos;
int is_active;
diff --git a/objects/UML/realizes.c b/objects/UML/realizes.c
index fcb2ede1..c081f020 100644
--- a/objects/UML/realizes.c
+++ b/objects/UML/realizes.c
@@ -45,8 +45,8 @@ struct _Realizes {
Alignment text_align;
real text_width;
- Color text_color;
- Color line_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
DiaFont *font;
real font_height;
diff --git a/objects/UML/small_package.c b/objects/UML/small_package.c
index 16d36294..bec999d2 100644
--- a/objects/UML/small_package.c
+++ b/objects/UML/small_package.c
@@ -50,8 +50,8 @@ struct _SmallPackage {
char *st_stereotype;
real line_width;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
/* The old border width, kept for compatibility with dia files created with
diff --git a/objects/UML/state.c b/objects/UML/state.c
index e1de050a..83a7fc0a 100644
--- a/objects/UML/state.c
+++ b/objects/UML/state.c
@@ -61,8 +61,8 @@ struct _State {
Text *text;
int state_type;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
real line_width;
diff --git a/objects/UML/state_term.c b/objects/UML/state_term.c
index fb851d38..9cd881d0 100644
--- a/objects/UML/state_term.c
+++ b/objects/UML/state_term.c
@@ -47,8 +47,8 @@ struct _State {
int is_final;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
diff --git a/objects/UML/transition.c b/objects/UML/transition.c
index 9ca169c6..e0dc7c13 100644
--- a/objects/UML/transition.c
+++ b/objects/UML/transition.c
@@ -38,8 +38,8 @@ typedef struct _Transition Transition;
struct _Transition {
OrthConn orth;
- Color text_color;
- Color line_color;
+ GdkRGBA text_color;
+ GdkRGBA line_color;
Handle trigger_text_handle;
Point trigger_text_pos;
diff --git a/objects/UML/usecase.c b/objects/UML/usecase.c
index c52e8efd..62a798a9 100644
--- a/objects/UML/usecase.c
+++ b/objects/UML/usecase.c
@@ -50,8 +50,8 @@ struct _Usecase {
int collaboration;
real line_width;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
};
diff --git a/objects/chronogram/chronoline.c b/objects/chronogram/chronoline.c
index b160bcc0..1abaf324 100644
--- a/objects/chronogram/chronoline.c
+++ b/objects/chronogram/chronoline.c
@@ -39,7 +39,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "chronogram.h"
@@ -54,11 +53,11 @@ typedef struct _Chronoline {
Element element;
real main_lwidth;
- Color color;
+ GdkRGBA color;
real start_time;
real end_time;
real data_lwidth;
- Color data_color;
+ GdkRGBA data_color;
char *events;
char *name;
real rise_time;
@@ -66,7 +65,7 @@ typedef struct _Chronoline {
gboolean multibit;
DiaFont *font;
real font_size;
- Color font_color;
+ GdkRGBA font_color;
/* computed values : */
ConnPointLine *snap; /* not saved ; num_connections derived from
@@ -76,7 +75,7 @@ typedef struct _Chronoline {
int checksum;
real labelwidth;
real y_down,y_up;
- Color gray, datagray;
+ GdkRGBA gray, datagray;
} Chronoline;
@@ -470,7 +469,7 @@ chronoline_draw(Chronoline *chronoline, DiaRenderer *renderer)
&chronoline->font_color);
}
-inline static void grayify(Color *col,Color *src)
+inline static void grayify(GdkRGBA *col,GdkRGBA *src)
{
col->red = .5 * (src->red + color_white.red);
col->green = .5 * (src->green + color_white.green);
diff --git a/objects/chronogram/chronoref.c b/objects/chronogram/chronoref.c
index a82e532d..f99917fc 100644
--- a/objects/chronogram/chronoref.c
+++ b/objects/chronogram/chronoref.c
@@ -39,7 +39,6 @@
#include "attributes.h"
#include "text.h"
#include "connpoint_line.h"
-#include "color.h"
#include "properties.h"
#include "chronogram.h"
@@ -53,7 +52,7 @@ typedef struct _Chronoref {
real main_lwidth;
real light_lwidth;
- Color color;
+ GdkRGBA color;
real start_time;
real end_time;
real time_step;
@@ -61,7 +60,7 @@ typedef struct _Chronoref {
DiaFont *font;
real font_size;
- Color font_color;
+ GdkRGBA font_color;
ConnPointLine *scale; /* not saved ; num_connections derived from
start_time, end_time, time_step. */
diff --git a/objects/custom/custom_object.c b/objects/custom/custom_object.c
index d22a195d..88bb5a48 100644
--- a/objects/custom/custom_object.c
+++ b/objects/custom/custom_object.c
@@ -101,8 +101,8 @@ struct _Custom {
ConnectionPoint *connections;
/*! width calculate from line_width */
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
LineStyle line_style;
real dashlength;
@@ -131,7 +131,7 @@ static void custom_draw_displaylist(GList *display_list, Custom *custom,
static void custom_draw_element(GraphicElement* el, Custom *custom,
DiaRenderer *renderer, GArray *arr, GArray *barr, real* cur_line,
real* cur_dash, LineCaps* cur_caps, LineJoin* cur_join,
- LineStyle* cur_style, Color* fg, Color* bg);
+ LineStyle* cur_style, GdkRGBA* fg, GdkRGBA* bg);
static void custom_update_data(Custom *custom, AnchorShape h, AnchorShape v);
static void custom_reposition_text(Custom *custom, GraphicElementText *text);
static DiaObject *custom_create(Point *startpoint,
@@ -820,7 +820,7 @@ custom_move(Custom *custom, Point *to)
}
static void
-get_colour(Custom *custom, Color *colour, gint32 c, real opacity)
+get_colour(Custom *custom, GdkRGBA *colour, gint32 c, real opacity)
{
switch (c) {
case DIA_SVG_COLOUR_NONE:
@@ -889,7 +889,7 @@ custom_draw_displaylist(GList *display_list, Custom *custom, DiaRenderer *render
GList *tmp;
for (tmp = display_list; tmp; tmp = tmp->next) {
GraphicElement *el = tmp->data;
- Color fg, bg;
+ GdkRGBA fg, bg;
/*
* Because we do not know if any of these values are reused in the loop,
@@ -905,7 +905,7 @@ static void
custom_draw_element(GraphicElement* el, Custom *custom, DiaRenderer *renderer,
GArray *arr, GArray *barr, real* cur_line, real* cur_dash,
LineCaps* cur_caps, LineJoin* cur_join, LineStyle* cur_style,
- Color* fg, Color* bg)
+ GdkRGBA* fg, GdkRGBA* bg)
{
DiaRendererClass *renderer_ops = DIA_RENDERER_GET_CLASS (renderer);
Point p1, p2;
diff --git a/objects/custom_lines/line_info.h b/objects/custom_lines/line_info.h
index 48c0b2d5..fbd9bf3a 100644
--- a/objects/custom_lines/line_info.h
+++ b/objects/custom_lines/line_info.h
@@ -49,7 +49,7 @@ typedef struct _LineInfo {
gchar *name;
gchar *icon_filename;
CustomLineType type;
- Color line_color;
+ GdkRGBA line_color;
LineStyle line_style;
real dashlength;
real line_width;
diff --git a/objects/flowchart/box.c b/objects/flowchart/box.c
index f9948f1e..ddad5113 100644
--- a/objects/flowchart/box.c
+++ b/objects/flowchart/box.c
@@ -58,8 +58,8 @@ struct _Box {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
LineStyle line_style;
real dashlength;
@@ -592,11 +592,11 @@ box_save(Box *box, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
box->border_width, ctx);
- if (!color_equals(&box->border_color, &color_black))
+ if (!gdk_rgba_equal(&box->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&box->border_color, ctx);
- if (!color_equals(&box->inner_color, &color_white))
+ if (!gdk_rgba_equal(&box->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&box->inner_color, ctx);
diff --git a/objects/flowchart/diamond.c b/objects/flowchart/diamond.c
index 9018150d..2140a38f 100644
--- a/objects/flowchart/diamond.c
+++ b/objects/flowchart/diamond.c
@@ -59,8 +59,8 @@ struct _Diamond {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
LineStyle line_style;
real dashlength;
@@ -563,11 +563,11 @@ diamond_save(Diamond *diamond, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
diamond->border_width, ctx);
- if (!color_equals(&diamond->border_color, &color_black))
+ if (!gdk_rgba_equal(&diamond->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&diamond->border_color, ctx);
- if (!color_equals(&diamond->inner_color, &color_white))
+ if (!gdk_rgba_equal(&diamond->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&diamond->inner_color, ctx);
diff --git a/objects/flowchart/ellipse.c b/objects/flowchart/ellipse.c
index e3451593..8e31c691 100644
--- a/objects/flowchart/ellipse.c
+++ b/objects/flowchart/ellipse.c
@@ -59,8 +59,8 @@ struct _Ellipse {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
LineStyle line_style;
real dashlength;
@@ -535,11 +535,11 @@ ellipse_save(Ellipse *ellipse, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
ellipse->border_width, ctx);
- if (!color_equals(&ellipse->border_color, &color_black))
+ if (!gdk_rgba_equal(&ellipse->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&ellipse->border_color, ctx);
- if (!color_equals(&ellipse->inner_color, &color_white))
+ if (!gdk_rgba_equal(&ellipse->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&ellipse->inner_color, ctx);
diff --git a/objects/flowchart/parallelogram.c b/objects/flowchart/parallelogram.c
index 1da7356c..276e6dfc 100644
--- a/objects/flowchart/parallelogram.c
+++ b/objects/flowchart/parallelogram.c
@@ -59,8 +59,8 @@ struct _Pgram {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
LineStyle line_style;
real dashlength;
@@ -619,11 +619,11 @@ pgram_save(Pgram *pgram, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
pgram->border_width, ctx);
- if (!color_equals(&pgram->border_color, &color_black))
+ if (!gdk_rgba_equal(&pgram->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&pgram->border_color, ctx);
- if (!color_equals(&pgram->inner_color, &color_white))
+ if (!gdk_rgba_equal(&pgram->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&pgram->inner_color, ctx);
diff --git a/objects/network/basestation.c b/objects/network/basestation.c
index 91d662c7..919cf4f8 100644
--- a/objects/network/basestation.c
+++ b/objects/network/basestation.c
@@ -45,8 +45,8 @@ struct _Basestation {
ConnectionPoint connections[NUM_CONNECTIONS];
- Color line_colour;
- Color fill_colour;
+ GdkRGBA line_colour;
+ GdkRGBA fill_colour;
Text *text;
diff --git a/objects/network/bus.c b/objects/network/bus.c
index 1734a31a..0a202e8e 100644
--- a/objects/network/bus.c
+++ b/objects/network/bus.c
@@ -47,7 +47,7 @@ typedef struct _Bus {
Handle **handles;
Point *parallel_points;
Point real_ends[2];
- Color line_color;
+ GdkRGBA line_color;
} Bus;
enum change_type {
diff --git a/objects/network/radiocell.c b/objects/network/radiocell.c
index 39335038..51a7e6b8 100644
--- a/objects/network/radiocell.c
+++ b/objects/network/radiocell.c
@@ -45,12 +45,12 @@ struct _RadioCell {
PolyShape poly; /* always 1st! */
real radius; /* pseudo-radius */
Point center; /* point in the center */
- Color line_colour;
+ GdkRGBA line_colour;
LineStyle line_style;
real dashlength;
real line_width;
gboolean show_background;
- Color fill_colour;
+ GdkRGBA fill_colour;
Text *text;
};
diff --git a/objects/network/wanlink.c b/objects/network/wanlink.c
index b503b6c3..391abe7e 100644
--- a/objects/network/wanlink.c
+++ b/objects/network/wanlink.c
@@ -44,8 +44,8 @@
typedef struct _WanLink {
Connection connection;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
real width;
Point poly[WANLINK_POLY_LEN];
diff --git a/objects/standard/arc.c b/objects/standard/arc.c
index 425a1d6e..0a48ffcf 100644
--- a/objects/standard/arc.c
+++ b/objects/standard/arc.c
@@ -56,7 +56,7 @@ struct _Arc {
Handle middle_handle; /*!< _Handle on the middle of the cicumference portion */
Handle center_handle; /*!< Handle on he center of the full circle */
- Color arc_color; /*!< Color of the Arc */
+ GdkRGBA arc_color; /*!< Color of the Arc */
real curve_distance; /*!< distance between middle_handle and chord */
real line_width; /*!< line width for the Arc */
LineStyle line_style; /*!< line style for the Arc */
@@ -653,7 +653,7 @@ arc_draw(Arc *arc, DiaRenderer *renderer)
if (renderer->is_interactive &&
dia_object_is_selected(&arc->connection.object)) {
/* draw the central angle */
- Color line_color = { 0.0, 0.0, 0.6, 1.0 };
+ GdkRGBA line_color = { 0.0, 0.0, 0.6, 1.0 };
renderer_ops->set_linewidth(renderer, 0);
renderer_ops->set_linestyle(renderer, LINESTYLE_DOTTED, 1);
@@ -942,7 +942,7 @@ arc_save(Arc *arc, ObjectNode obj_node, DiaContext *ctx)
{
connection_save(&arc->connection, obj_node, ctx);
- if (!color_equals(&arc->arc_color, &color_black))
+ if (!gdk_rgba_equal(&arc->arc_color, &color_black))
data_add_color(new_attribute(obj_node, "arc_color"),
&arc->arc_color, ctx);
diff --git a/objects/standard/bezier.c b/objects/standard/bezier.c
index 005d5031..1599fe3c 100644
--- a/objects/standard/bezier.c
+++ b/objects/standard/bezier.c
@@ -50,7 +50,7 @@ typedef struct _Bezierline Bezierline;
struct _Bezierline {
BezierConn bez;
- Color line_color;
+ GdkRGBA line_color;
LineStyle line_style;
LineJoin line_join;
LineCaps line_caps;
@@ -606,7 +606,7 @@ bezierline_save(Bezierline *bezierline, ObjectNode obj_node,
}
bezierconn_save(&bezierline->bez, obj_node, ctx);
- if (!color_equals(&bezierline->line_color, &color_black))
+ if (!gdk_rgba_equal(&bezierline->line_color, &color_black))
data_add_color(new_attribute(obj_node, "line_color"),
&bezierline->line_color, ctx);
diff --git a/objects/standard/beziergon.c b/objects/standard/beziergon.c
index 52d1b1ac..8f87d6cd 100644
--- a/objects/standard/beziergon.c
+++ b/objects/standard/beziergon.c
@@ -49,10 +49,10 @@
typedef struct _Beziergon {
BezierShape bezier;
- Color line_color;
+ GdkRGBA line_color;
LineStyle line_style;
LineJoin line_join;
- Color inner_color;
+ GdkRGBA inner_color;
gboolean show_background;
real dashlength;
real line_width;
@@ -231,7 +231,7 @@ beziergon_draw(Beziergon *beziergon, DiaRenderer *renderer)
renderer_ops->set_linecaps(renderer, LINECAPS_BUTT);
if (beziergon->show_background) {
- Color fill = beziergon->inner_color;
+ GdkRGBA fill = beziergon->inner_color;
if (beziergon->pattern) {
dia_pattern_get_fallback_color (beziergon->pattern, &fill);
if (renderer_ops->is_capable_to(renderer, RENDER_PATTERN))
@@ -381,7 +381,7 @@ beziergon_save(Beziergon *beziergon, ObjectNode obj_node,
{
beziershape_save(&beziergon->bezier, obj_node, ctx);
- if (!color_equals(&beziergon->line_color, &color_black))
+ if (!gdk_rgba_equal(&beziergon->line_color, &color_black))
data_add_color(new_attribute(obj_node, "line_color"),
&beziergon->line_color, ctx);
@@ -389,7 +389,7 @@ beziergon_save(Beziergon *beziergon, ObjectNode obj_node,
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
beziergon->line_width, ctx);
- if (!color_equals(&beziergon->inner_color, &color_white))
+ if (!gdk_rgba_equal(&beziergon->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&beziergon->inner_color, ctx);
diff --git a/objects/standard/box.c b/objects/standard/box.c
index 2992b6a9..520284d9 100644
--- a/objects/standard/box.c
+++ b/objects/standard/box.c
@@ -61,8 +61,8 @@ struct _Box {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
LineStyle line_style;
LineJoin line_join;
@@ -360,7 +360,7 @@ box_draw(Box *box, DiaRenderer *renderer)
renderer_ops->set_linecaps(renderer, LINECAPS_BUTT);
if (box->show_background) {
- Color fill = box->inner_color;
+ GdkRGBA fill = box->inner_color;
renderer_ops->set_fillstyle(renderer, FILLSTYLE_SOLID);
if (box->pattern) {
dia_pattern_get_fallback_color (box->pattern, &fill);
@@ -554,11 +554,11 @@ box_save(Box *box, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
box->border_width, ctx);
- if (!color_equals(&box->border_color, &color_black))
+ if (!gdk_rgba_equal(&box->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&box->border_color, ctx);
- if (!color_equals(&box->inner_color, &color_white))
+ if (!gdk_rgba_equal(&box->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&box->inner_color, ctx);
diff --git a/objects/standard/ellipse.c b/objects/standard/ellipse.c
index 74964633..79c89d90 100644
--- a/objects/standard/ellipse.c
+++ b/objects/standard/ellipse.c
@@ -60,14 +60,14 @@ struct _Ellipse {
Handle center_handle;
real border_width;
- Color border_color;
- Color inner_color;
+ GdkRGBA border_color;
+ GdkRGBA inner_color;
gboolean show_background;
AspectType aspect;
LineStyle line_style;
real dashlength;
DiaPattern *pattern;
- real angle; /*!< between [-45�-45�] to simplify connection point handling */
+ real angle; /*!< between [-45�-45�] to simplify connection point handling */
};
static struct _EllipseProperties {
@@ -351,7 +351,7 @@ ellipse_draw(Ellipse *ellipse, DiaRenderer *renderer)
renderer_ops->set_linewidth(renderer, ellipse->border_width);
renderer_ops->set_linestyle(renderer, ellipse->line_style, ellipse->dashlength);
if (ellipse->show_background) {
- Color fill = ellipse->inner_color;
+ GdkRGBA fill = ellipse->inner_color;
renderer_ops->set_fillstyle(renderer, FILLSTYLE_SOLID);
if (ellipse->pattern) {
dia_pattern_get_fallback_color (ellipse->pattern, &fill);
@@ -569,11 +569,11 @@ ellipse_save(Ellipse *ellipse, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
ellipse->border_width, ctx);
- if (!color_equals(&ellipse->border_color, &color_black))
+ if (!gdk_rgba_equal(&ellipse->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&ellipse->border_color, ctx);
- if (!color_equals(&ellipse->inner_color, &color_white))
+ if (!gdk_rgba_equal(&ellipse->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&ellipse->inner_color, ctx);
diff --git a/objects/standard/image.c b/objects/standard/image.c
index a2d556f7..8cd83351 100644
--- a/objects/standard/image.c
+++ b/objects/standard/image.c
@@ -59,7 +59,7 @@ struct _Image {
ConnectionPoint connections[NUM_CONNECTIONS];
real border_width;
- Color border_color;
+ GdkRGBA border_color;
LineStyle line_style;
real dashlength;
@@ -699,7 +699,7 @@ image_save(Image *image, ObjectNode obj_node, DiaContext *ctx)
data_add_real(new_attribute(obj_node, "border_width"),
image->border_width, ctx);
- if (!color_equals(&image->border_color, &color_black))
+ if (!gdk_rgba_equal(&image->border_color, &color_black))
data_add_color(new_attribute(obj_node, "border_color"),
&image->border_color, ctx);
diff --git a/objects/standard/line.c b/objects/standard/line.c
index 53c57624..4b52f3a7 100644
--- a/objects/standard/line.c
+++ b/objects/standard/line.c
@@ -57,7 +57,7 @@ typedef struct _Line {
ConnPointLine *cpl;
- Color line_color;
+ GdkRGBA line_color;
real line_width;
LineStyle line_style;
LineCaps line_caps;
@@ -646,7 +646,7 @@ line_save(Line *line, ObjectNode obj_node, DiaContext *ctx)
connpointline_save(line->cpl, obj_node, "numcp", ctx);
- if (!color_equals(&line->line_color, &color_black))
+ if (!gdk_rgba_equal(&line->line_color, &color_black))
data_add_color(new_attribute(obj_node, "line_color"),
&line->line_color, ctx);
diff --git a/objects/standard/outline.c b/objects/standard/outline.c
index deaaebac..d9f606c9 100644
--- a/objects/standard/outline.c
+++ b/objects/standard/outline.c
@@ -56,8 +56,8 @@ typedef struct _Outline {
DiaFont *font;
real font_height;
- Color line_color;
- Color fill_color;
+ GdkRGBA line_color;
+ GdkRGBA fill_color;
gboolean show_background;
real line_width;
diff --git a/objects/standard/polygon.c b/objects/standard/polygon.c
index 103ce79b..634d7475 100644
--- a/objects/standard/polygon.c
+++ b/objects/standard/polygon.c
@@ -54,10 +54,10 @@ Fix crashes:)
typedef struct _Polygon {
PolyShape poly;
- Color line_color;
+ GdkRGBA line_color;
LineStyle line_style;
LineJoin line_join;
- Color inner_color;
+ GdkRGBA inner_color;
gboolean show_background;
real dashlength;
real line_width;
@@ -222,7 +222,7 @@ polygon_draw(Polygon *polygon, DiaRenderer *renderer)
PolyShape *poly = &polygon->poly;
Point *points;
int n;
- Color fill;
+ GdkRGBA fill;
points = &poly->points[0];
n = poly->numpoints;
@@ -352,7 +352,7 @@ polygon_save(Polygon *polygon, ObjectNode obj_node,
{
polyshape_save(&polygon->poly, obj_node, ctx);
- if (!color_equals(&polygon->line_color, &color_black))
+ if (!gdk_rgba_equal(&polygon->line_color, &color_black))
data_add_color(new_attribute(obj_node, "line_color"),
&polygon->line_color, ctx);
@@ -360,7 +360,7 @@ polygon_save(Polygon *polygon, ObjectNode obj_node,
data_add_real(new_attribute(obj_node, PROP_STDNAME_LINE_WIDTH),
polygon->line_width, ctx);
- if (!color_equals(&polygon->inner_color, &color_white))
+ if (!gdk_rgba_equal(&polygon->inner_color, &color_white))
data_add_color(new_attribute(obj_node, "inner_color"),
&polygon->inner_color, ctx);
diff --git a/objects/standard/polyline.c b/objects/standard/polyline.c
index 80468ca7..e4150a5d 100644
--- a/objects/standard/polyline.c
+++ b/objects/standard/polyline.c
@@ -45,7 +45,7 @@
typedef struct _Polyline {
PolyConn poly;
- Color line_color;
+ GdkRGBA line_color;
LineStyle line_style;
LineJoin line_join;
LineCaps line_caps;
@@ -468,7 +468,7 @@ polyline_save(Polyline *polyline, ObjectNode obj_node,
{
polyconn_save(&polyline->poly, obj_node, ctx);
- if (!color_equals(&polyline->line_color, &color_black))
+ if (!gdk_rgba_equal(&polyline->line_color, &color_black))
data_add_color(new_attribute(obj_node, "line_color"),
&polyline->line_color, ctx);
diff --git a/objects/standard/textobj.c b/objects/standard/textobj.c
index 37eb0f20..3552a92d 100644
--- a/objects/standard/textobj.c
+++ b/objects/standard/textobj.c
@@ -62,7 +62,7 @@ struct _Textobj {
/*! vertical alignment of the whole text block */
Valign vert_align;
/*! bounding box filling */
- Color fill_color;
+ GdkRGBA fill_color;
/*! background to be filled or transparent */
gboolean show_background;
/*! margin used for background drawing and connection point placement */
@@ -409,7 +409,7 @@ textobj_create(Point *startpoint,
{
Textobj *textobj;
DiaObject *obj;
- Color col;
+ GdkRGBA col;
DiaFont *font = NULL;
real font_height;
@@ -566,7 +566,7 @@ _textobj_convert_to_path_callback (DiaObject *obj, Point *clicked, gpointer data
if (path) {
ObjectChange *change;
- Color bg = textobj->fill_color;
+ GdkRGBA bg = textobj->fill_color;
/* FIXME: otherwise object_substitue() will tint the text with bg */
textobj->fill_color = text->color;
diff --git a/objects/standard/zigzagline.c b/objects/standard/zigzagline.c
index ccfffd76..99f207b3 100644
--- a/objects/standard/zigzagline.c
+++ b/objects/standard/zigzagline.c
@@ -47,7 +47,7 @@
typedef struct _Zigzagline {
OrthConn orth;
- Color line_color;
+ GdkRGBA line_color;
LineStyle line_style;
LineJoin line_join;
LineCaps line_caps;
@@ -480,7 +480,7 @@ zigzagline_save(Zigzagline *zigzagline, ObjectNode obj_node,
{
orthconn_save(&zigzagline->orth, obj_node, ctx);
- if (!color_equals(&zigzagline->line_color, &color_black))
+ if (!gdk_rgba_equal(&zigzagline->line_color, &color_black))
data_add_color(new_attribute(obj_node, "line_color"),
&zigzagline->line_color, ctx);
diff --git a/plug-ins/cgm/cgm.c b/plug-ins/cgm/cgm.c
index a18554f5..a0e5df2e 100644
--- a/plug-ins/cgm/cgm.c
+++ b/plug-ins/cgm/cgm.c
@@ -97,7 +97,7 @@ write_uint32(FILE *fp, guint32 n)
}
static void
-write_colour(FILE *fp, Color *c)
+write_colour(FILE *fp, GdkRGBA *c)
{
putc((int)(c->red * 255), fp);
putc((int)(c->green * 255), fp);
@@ -203,7 +203,7 @@ typedef struct _LineAttrCGM
int join;
int style;
real width;
- Color color;
+ GdkRGBA color;
} LineAttrCGM;
@@ -212,14 +212,14 @@ typedef struct _FillEdgeAttrCGM
{
int fill_style; /* Fill style */
- Color fill_color; /* Fill color */
+ GdkRGBA fill_color; /* Fill color */
int edgevis; /* Edge visibility */
int cap; /* Edge cap */
int join; /* Edge join */
int style; /* Edge style */
real width; /* Edge width */
- Color color; /* Edge color */
+ GdkRGBA color; /* Edge color */
} FillEdgeAttrCGM;
@@ -229,7 +229,7 @@ typedef struct _TextAttrCGM
{
int font_num;
real font_height;
- Color color;
+ GdkRGBA color;
} TextAttrCGM;
@@ -336,7 +336,7 @@ swap_y( CgmRenderer *renderer, real y)
static void
-write_line_attributes( CgmRenderer *renderer, Color *color )
+write_line_attributes( CgmRenderer *renderer, GdkRGBA *color )
{
LineAttrCGM *lnew, *lold;
@@ -395,8 +395,8 @@ LineAttrCGM *lnew, *lold;
*/
static void
-write_filledge_attributes( CgmRenderer *renderer, Color *fill_color,
- Color *edge_color )
+write_filledge_attributes( CgmRenderer *renderer, GdkRGBA *fill_color,
+ GdkRGBA *edge_color )
{
FillEdgeAttrCGM *fnew, *fold;
@@ -500,7 +500,7 @@ FillEdgeAttrCGM *fnew, *fold;
static void
-write_text_attributes( CgmRenderer *renderer, Color *text_color)
+write_text_attributes( CgmRenderer *renderer, GdkRGBA *text_color)
{
TextAttrCGM *tnew, *told;
@@ -687,7 +687,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
CgmRenderer *renderer = CGM_RENDERER(self);
@@ -703,7 +703,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
CgmRenderer *renderer = CGM_RENDERER(self);
int i;
@@ -720,7 +720,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
CgmRenderer *renderer = CGM_RENDERER(self);
int i;
@@ -737,7 +737,7 @@ draw_polygon (DiaRenderer *self,
static void
draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
CgmRenderer *renderer = CGM_RENDERER(self);
@@ -805,7 +805,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
CgmRenderer *renderer = CGM_RENDERER(self);
@@ -818,7 +818,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
CgmRenderer *renderer = CGM_RENDERER(self);
@@ -830,7 +830,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
CgmRenderer *renderer = CGM_RENDERER(self);
real ynew;
@@ -900,7 +900,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *colour)
+ GdkRGBA *colour)
{
CgmRenderer *renderer = CGM_RENDERER(self);
@@ -916,8 +916,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points, /* Last point must be same as first point */
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
CgmRenderer *renderer = CGM_RENDERER(self);
@@ -940,7 +940,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
CgmRenderer *renderer = CGM_RENDERER(self);
double x = pos->x, y = swap_y(renderer, pos->y);
diff --git a/plug-ins/drs/dia-render-script-import.c b/plug-ins/drs/dia-render-script-import.c
index 00bdf148..32b8506f 100644
--- a/plug-ins/drs/dia-render-script-import.c
+++ b/plug-ins/drs/dia-render-script-import.c
@@ -24,7 +24,6 @@
#include <config.h>
#include "geometry.h"
-#include "color.h"
#include "diagramdata.h"
#include "group.h"
#include "intl.h"
@@ -126,18 +125,18 @@ _parse_bezpoints (xmlNodePtr node, const char *attrib)
}
return arr;
}
-static Color *
+static GdkRGBA *
_parse_color (xmlNodePtr node, const char *attrib)
{
xmlChar *str = xmlGetProp(node, (const xmlChar *)attrib);
- Color *val = NULL;
+ GdkRGBA *val = NULL;
if (str) {
int r, g, b, a = 255;
int n = sscanf ((gchar *)str, "#%02x%02x%02x%02x", &r, &g, &b, &a);
if (n > 2) {
- val = g_new (Color, 1);
+ val = g_new (GdkRGBA, 1);
val->red = r / 255.0;
val->green = g / 255.0;
val->blue = b / 255.0;
@@ -282,8 +281,8 @@ _render_object (xmlNodePtr render, DiaContext *ctx)
ops->set_font (ir, font, _parse_real (node, "height"));
dia_font_unref (font);
} else {
- Color *stroke = _parse_color (node, "stroke");
- Color *fill = _parse_color (node, "fill");
+ GdkRGBA *stroke = _parse_color (node, "stroke");
+ GdkRGBA *fill = _parse_color (node, "fill");
if (xmlStrcmp (node->name, (const xmlChar *)"line") == 0) {
Point p1 = _parse_point (node, "start");
diff --git a/plug-ins/drs/dia-render-script-renderer.c b/plug-ins/drs/dia-render-script-renderer.c
index a381c881..8f0aeea5 100644
--- a/plug-ins/drs/dia-render-script-renderer.c
+++ b/plug-ins/drs/dia-render-script-renderer.c
@@ -177,7 +177,7 @@ is_capable_to (DiaRenderer *self, RenderCapability cap)
}
static void
-_node_set_color (xmlNodePtr node, const char *name, const Color *color)
+_node_set_color (xmlNodePtr node, const char *name, const GdkRGBA *color)
{
gchar *value;
@@ -405,7 +405,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *color)
+ GdkRGBA *color)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -419,7 +419,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -432,7 +432,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -451,7 +451,7 @@ draw_polygon (DiaRenderer *self,
static void
_rounded_rect(DiaRenderer *self,
Point *lefttop, Point *rightbottom,
- Color *fill, Color *stroke, real *rounding)
+ GdkRGBA *fill, GdkRGBA *stroke, real *rounding)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -475,7 +475,7 @@ _rounded_rect(DiaRenderer *self,
static void
draw_rect(DiaRenderer *self,
Point *lefttop, Point *rightbottom,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
_rounded_rect(self, lefttop, rightbottom, fill, stroke, NULL);
}
@@ -483,7 +483,7 @@ draw_rect(DiaRenderer *self,
static void
draw_rounded_rect(DiaRenderer *self,
Point *lefttop, Point *rightbottom,
- Color *fill, Color *stroke, real rounding)
+ GdkRGBA *fill, GdkRGBA *stroke, real rounding)
{
_rounded_rect(self, lefttop, rightbottom, fill, stroke, &rounding);
}
@@ -493,7 +493,7 @@ _arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color,
+ GdkRGBA *color,
gboolean fill)
{
DrsRenderer *renderer = DRS_RENDERER (self);
@@ -515,7 +515,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
_arc (self, center, width, height, angle1, angle2, color, FALSE);
}
@@ -524,7 +524,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
_arc (self, center, width, height, angle1, angle2, color, TRUE);
}
@@ -533,7 +533,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -553,8 +553,8 @@ static void
_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -571,7 +571,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color)
+ GdkRGBA *color)
{
_bezier (self, points, numpoints, NULL, color);
}
@@ -579,11 +579,11 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
if (!fill && stroke) { /* maybe this is too clever: close path by existance of fill attribute */
- Color transparent = { 0, };
+ GdkRGBA transparent = { 0, };
_bezier (self, points, numpoints, &transparent, stroke);
} else {
_bezier (self, points, numpoints, fill, stroke);
@@ -593,7 +593,7 @@ draw_beziergon (DiaRenderer *self,
static void
draw_rounded_polyline (DiaRenderer *self,
Point *points, int num_points,
- Color *color, real radius )
+ GdkRGBA *color, real radius )
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
@@ -608,7 +608,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
DrsRenderer *renderer = DRS_RENDERER (self);
xmlNodePtr node;
diff --git a/plug-ins/dxf/dxf-export.c b/plug-ins/dxf/dxf-export.c
index b80636fc..58e46d83 100644
--- a/plug-ins/dxf/dxf-export.c
+++ b/plug-ins/dxf/dxf-export.c
@@ -66,7 +66,7 @@ typedef struct _LineAttrdxf
int join;
char *style;
real width;
- Color color;
+ GdkRGBA color;
} LineAttrdxf;
@@ -75,14 +75,14 @@ typedef struct _FillEdgeAttrdxf
{
int fill_style; /* Fill style */
- Color fill_color; /* Fill color */
+ GdkRGBA fill_color; /* Fill color */
int edgevis; /* Edge visibility */
int cap; /* Edge cap */
int join; /* Edge join */
char *style; /* Edge style */
real width; /* Edge width */
- Color color; /* Edge color */
+ GdkRGBA color; /* Edge color */
} FillEdgeAttrdxf;
@@ -92,7 +92,7 @@ typedef struct _TextAttrdxf
{
int font_num;
real font_height;
- Color color;
+ GdkRGBA color;
} TextAttrdxf;
@@ -238,7 +238,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
}
static int
-dxf_color (const Color *color)
+dxf_color (const GdkRGBA *color)
{
/* Fixed colors
* 0 - black ?
@@ -259,7 +259,7 @@ dxf_color (const Color *color)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
DxfRenderer *renderer = DXF_RENDERER(self);
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
@@ -282,7 +282,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
DxfRenderer *renderer = DXF_RENDERER(self);
int i;
@@ -310,9 +310,9 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
- Color *color = fill ? fill : stroke;
+ GdkRGBA *color = fill ? fill : stroke;
DxfRenderer *renderer = DXF_RENDERER(self);
/* We could emulate all polygons with multiple SOLID but it might not be
* worth the effort. Following the easy part of polygons with 3 or 4 points.
@@ -348,7 +348,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
DxfRenderer *renderer = DXF_RENDERER(self);
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
@@ -382,7 +382,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
/* emulate by SOLID? */
}
@@ -391,11 +391,11 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DxfRenderer *renderer = DXF_RENDERER(self);
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
- Color *color = fill ? fill : stroke; /* emulate fill by SOLID? */
+ GdkRGBA *color = fill ? fill : stroke; /* emulate fill by SOLID? */
/* draw a circle instead of an ellipse, if it's one */
if(width == height){
@@ -426,7 +426,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
DxfRenderer *renderer = DXF_RENDERER(self);
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
diff --git a/plug-ins/dxf/dxf-import.c b/plug-ins/dxf/dxf-import.c
index 77f82b6b..9120ea00 100644
--- a/plug-ins/dxf/dxf-import.c
+++ b/plug-ins/dxf/dxf-import.c
@@ -113,7 +113,7 @@ _dxf_color_get_by_layer (const Layer *layer)
return 0;
}
static void
-_color_init_from_rgb (Color *color, RGB_t rgb)
+_color_init_from_rgb (GdkRGBA *color, RGB_t rgb)
{
color->red = rgb.r / 255.0;
color->green = rgb.g / 255.0;
@@ -176,7 +176,7 @@ read_entity_line_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
Handle *h1, *h2;
DiaObject *line_obj;
- Color line_colour;
+ GdkRGBA line_colour;
RGB_t color = { 0, };
GPtrArray *props;
@@ -257,7 +257,7 @@ read_entity_solid_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
DiaObject *polygon_obj;
MultipointCreateData *pcd;
- Color fill_colour;
+ GdkRGBA fill_colour;
GPtrArray *props;
@@ -389,7 +389,7 @@ read_entity_polyline_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
DiaObject *polyline_obj;
MultipointCreateData *pcd;
- Color line_colour;
+ GdkRGBA line_colour;
GPtrArray *props;
@@ -594,7 +594,7 @@ read_entity_circle_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
DiaObject *ellipse_obj;
RGB_t color = { 0, };
- Color line_colour;
+ GdkRGBA line_colour;
GPtrArray *props;
@@ -671,7 +671,7 @@ read_entity_arc_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
DiaObject *arc_obj;
RGB_t color = { 0, };
- Color line_colour;
+ GdkRGBA line_colour;
GPtrArray *props;
real line_width = DEFAULT_LINE_WIDTH;
@@ -761,7 +761,7 @@ read_entity_ellipse_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
DiaObject *ellipse_obj;
RGB_t color = { 0, };
- Color line_colour;
+ GdkRGBA line_colour;
GPtrArray *props;
real line_width = DEFAULT_LINE_WIDTH;
@@ -844,7 +844,7 @@ read_entity_text_dxf(FILE *filedxf, DxfData *data, DiagramData *dia)
Handle *h1, *h2;
DiaObject *text_obj;
- Color text_colour;
+ GdkRGBA text_colour;
TextProperty *tprop;
GPtrArray *props;
diff --git a/plug-ins/hpgl/hpgl.c b/plug-ins/hpgl/hpgl.c
index 208d76de..09962a8d 100644
--- a/plug-ins/hpgl/hpgl.c
+++ b/plug-ins/hpgl/hpgl.c
@@ -75,7 +75,7 @@ struct _HpglRenderer
* The number of pens is limited. This is used to select one.
*/
struct {
- Color color;
+ GdkRGBA color;
float width;
int has_it;
} pen[HPGL_MAX_PENS];
@@ -100,7 +100,7 @@ struct _HpglRendererClass
/* hpgl helpers */
static void
-hpgl_select_pen(HpglRenderer* renderer, Color* color, real width)
+hpgl_select_pen(HpglRenderer* renderer, GdkRGBA* color, real width)
{
int nPen = 0;
int i;
@@ -297,7 +297,7 @@ set_font(DiaRenderer *object, DiaFont *font, real height)
static void
draw_line(DiaRenderer *object,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
HpglRenderer *renderer = HPGL_RENDERER (object);
@@ -313,7 +313,7 @@ draw_line(DiaRenderer *object,
static void
draw_polyline(DiaRenderer *object,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
HpglRenderer *renderer = HPGL_RENDERER (object);
int i;
@@ -341,9 +341,9 @@ draw_polyline(DiaRenderer *object,
static void
draw_polygon(DiaRenderer *object,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
- Color *color = fill ? fill : stroke;
+ GdkRGBA *color = fill ? fill : stroke;
DIAG_NOTE(g_message("draw_polygon n:%d %f,%f ...",
num_points, points->x, points->y));
g_return_if_fail (color != NULL);
@@ -355,9 +355,9 @@ draw_polygon(DiaRenderer *object,
static void
draw_rect(DiaRenderer *object,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
- Color *colour = fill ? fill : stroke;
+ GdkRGBA *colour = fill ? fill : stroke;
HpglRenderer *renderer = HPGL_RENDERER (object);
g_return_if_fail (colour != NULL);
@@ -377,7 +377,7 @@ draw_arc(DiaRenderer *object,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
HpglRenderer *renderer = HPGL_RENDERER (object);
Point start;
@@ -410,7 +410,7 @@ fill_arc(DiaRenderer *object,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
HpglRenderer *renderer = HPGL_RENDERER (object);
@@ -436,7 +436,7 @@ static void
draw_ellipse_by_arc (DiaRenderer *renderer,
Point *center,
real width, real height,
- Color *colour)
+ GdkRGBA *colour)
{
real a, b, e, d, alpha, c, x, y;
real g, gamma, r;
@@ -484,10 +484,10 @@ static void
draw_ellipse(DiaRenderer *object,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
HpglRenderer *renderer = HPGL_RENDERER (object);
- Color *colour = fill ? fill : stroke;
+ GdkRGBA *colour = fill ? fill : stroke;
DIAG_NOTE(g_message("draw_ellipse %fx%f center @ %f,%f",
width, height, center->x, center->y));
@@ -511,7 +511,7 @@ static void
draw_string(DiaRenderer *object,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
HpglRenderer *renderer = HPGL_RENDERER (object);
real width, height;
diff --git a/plug-ins/metapost/render_metapost.c b/plug-ins/metapost/render_metapost.c
index 63a0b787..880504a3 100644
--- a/plug-ins/metapost/render_metapost.c
+++ b/plug-ins/metapost/render_metapost.c
@@ -164,7 +164,7 @@ end_draw_op(MetapostRenderer *renderer)
fprintf(renderer->file, "\n withpen pencircle scaled %sx",
g_ascii_formatd(d1_buf, sizeof(d1_buf), "%5.4f", (gdouble) renderer->line_width) );
- if (!color_equals(&renderer->color, &color_black))
+ if (!gdk_rgba_equal(&renderer->color, &color_black))
fprintf(renderer->file, "\n withcolor (%s, %s, %s)",
g_ascii_formatd(d1_buf, sizeof(d1_buf), "%5.4f", (gdouble) renderer->color.red),
g_ascii_formatd(d2_buf, sizeof(d2_buf), "%5.4f", (gdouble) renderer->color.green),
@@ -175,7 +175,7 @@ end_draw_op(MetapostRenderer *renderer)
}
static void
-set_line_color(MetapostRenderer *renderer,Color *color)
+set_line_color(MetapostRenderer *renderer,GdkRGBA *color)
{
gchar red_buf[DTOSTR_BUF_SIZE];
gchar green_buf[DTOSTR_BUF_SIZE];
@@ -437,7 +437,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_color)
+ GdkRGBA *line_color)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
gchar sx_buf[DTOSTR_BUF_SIZE];
@@ -456,7 +456,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_color)
+ GdkRGBA *line_color)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
int i;
@@ -481,7 +481,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
int i;
@@ -526,7 +526,7 @@ metapost_arc(MetapostRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color, int filled)
+ GdkRGBA *color, int filled)
{
double radius1,radius2;
double angle3;
@@ -571,7 +571,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
@@ -583,7 +583,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
@@ -594,7 +594,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
gchar d1_buf[DTOSTR_BUF_SIZE];
@@ -638,7 +638,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints, /* numpoints = 4+3*n, n=>0 */
- Color *color)
+ GdkRGBA *color)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
gint i;
@@ -685,8 +685,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
gint i;
@@ -755,7 +755,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
MetapostRenderer *renderer = METAPOST_RENDERER (self);
gchar height_buf[DTOSTR_BUF_SIZE];
@@ -795,7 +795,7 @@ draw_string(DiaRenderer *self,
mp_dtostr(px_buf, pos->x),
mp_dtostr(py_buf, pos->y) );
- if (!color_equals(&renderer->color, &color_black))
+ if (!gdk_rgba_equal(&renderer->color, &color_black))
fprintf(renderer->file, "\n withcolor (%s, %s, %s)",
g_ascii_formatd(red_buf, sizeof(red_buf), "%5.4f", (gdouble) renderer->color.red),
g_ascii_formatd(green_buf, sizeof(green_buf), "%5.4f", (gdouble) renderer->color.green),
@@ -1014,7 +1014,7 @@ export_metapost(DiagramData *data, DiaContext *ctx,
gchar d3_buf[DTOSTR_BUF_SIZE];
gchar d4_buf[DTOSTR_BUF_SIZE];
- Color initial_color;
+ GdkRGBA initial_color;
file = g_fopen(filename, "wb");
diff --git a/plug-ins/metapost/render_metapost.h b/plug-ins/metapost/render_metapost.h
index 7758d8fc..b716f57d 100644
--- a/plug-ins/metapost/render_metapost.h
+++ b/plug-ins/metapost/render_metapost.h
@@ -53,7 +53,7 @@ struct _MetapostRenderer
LineCaps saved_line_cap;
LineJoin saved_line_join;
- Color color;
+ GdkRGBA color;
real line_width;
real dash_length;
diff --git a/plug-ins/pgf/render_pgf.c b/plug-ins/pgf/render_pgf.c
index 1617d716..5f40a7ac 100644
--- a/plug-ins/pgf/render_pgf.c
+++ b/plug-ins/pgf/render_pgf.c
@@ -88,86 +88,86 @@ static void set_fillstyle(DiaRenderer *self, FillStyle mode);
static void set_font(DiaRenderer *self, DiaFont *font, real height);
static void draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_color);
+ GdkRGBA *line_color);
static void draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_color);
+ GdkRGBA *line_color);
static void draw_rounded_polyline (DiaRenderer *self,
Point *points, int num_points,
- Color *color, real radius);
+ GdkRGBA *color, real radius);
static void draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_rounded_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius);
+ GdkRGBA *fill, GdkRGBA *stroke, real radius);
static void draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color);
+ GdkRGBA *color);
static void draw_beziergon(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke);
+ GdkRGBA *fill,
+ GdkRGBA *stroke);
static void draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color);
+ GdkRGBA *color);
static void draw_image(DiaRenderer *self,
Point *point,
real width, real height,
DiaImage *image);
static void draw_line_with_arrows(DiaRenderer *renderer, Point *start, Point *end,
- real line_width, Color *line_color,
+ real line_width, GdkRGBA *line_color,
Arrow *start_arrow, Arrow *end_arrow);
static void draw_arc_with_arrows(DiaRenderer *renderer, Point *start, Point *end, Point *midpoint,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
static void draw_polyline_with_arrows(DiaRenderer *renderer, Point *points, int num_points,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
static void draw_rounded_polyline_with_arrows(DiaRenderer *renderer,
- Point *points, int num_points, real line_width, Color *color,
+ Point *points, int num_points, real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow, real radius);
static void draw_bezier_with_arrows(DiaRenderer *renderer, BezPoint *points, int num_points,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
/*store the higher level arrow functions for arrows not (yet) implemented in this PGF macro*/
void (*orig_draw_line_with_arrows) (DiaRenderer *renderer, Point *start, Point *end,
- real line_width, Color *line_color,
+ real line_width, GdkRGBA *line_color,
Arrow *start_arrow, Arrow *end_arrow);
void (*orig_draw_arc_with_arrows) (DiaRenderer *renderer, Point *start, Point *end, Point *midpoint,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
void (*orig_draw_polyline_with_arrows) (DiaRenderer *renderer, Point *points, int num_points,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
void (*orig_draw_rounded_polyline_with_arrows) (DiaRenderer *renderer,
- Point *points, int num_points, real line_width, Color *color,
+ Point *points, int num_points, real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow, real radius);
void (*orig_draw_bezier_with_arrows) (DiaRenderer *renderer, BezPoint *points, int num_points,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow);
@@ -294,7 +294,7 @@ pgf_renderer_class_init (PgfRendererClass *klass)
static void
-set_line_color(PgfRenderer *renderer,Color *color)
+set_line_color(PgfRenderer *renderer,GdkRGBA *color)
{
gchar red_buf[DTOSTR_BUF_SIZE];
gchar green_buf[DTOSTR_BUF_SIZE];
@@ -310,7 +310,7 @@ set_line_color(PgfRenderer *renderer,Color *color)
}
static void
-set_fill_color(PgfRenderer *renderer,Color *color)
+set_fill_color(PgfRenderer *renderer,GdkRGBA *color)
{
gchar red_buf[DTOSTR_BUF_SIZE];
gchar green_buf[DTOSTR_BUF_SIZE];
@@ -475,7 +475,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_color)
+ GdkRGBA *line_color)
{
PgfRenderer *renderer = PGF_RENDERER(self);
gchar sx_buf[DTOSTR_BUF_SIZE];
@@ -495,7 +495,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_color)
+ GdkRGBA *line_color)
{
PgfRenderer *renderer = PGF_RENDERER(self);
int i;
@@ -521,7 +521,7 @@ draw_polyline(DiaRenderer *self,
from each segment of the polyline*/
static void draw_rounded_polyline (DiaRenderer *self,
Point *points, int num_points,
- Color *color, real radius)
+ GdkRGBA *color, real radius)
{
gchar rad_buf[DTOSTR_BUF_SIZE];
@@ -536,7 +536,7 @@ static void draw_rounded_polyline (DiaRenderer *self,
static void
pgf_polygon(PgfRenderer *renderer,
Point *points, gint num_points,
- Color *line_color, gboolean filled)
+ GdkRGBA *line_color, gboolean filled)
{
gint i;
gchar px_buf[DTOSTR_BUF_SIZE];
@@ -562,7 +562,7 @@ pgf_polygon(PgfRenderer *renderer,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PgfRenderer *renderer = PGF_RENDERER(self);
@@ -576,7 +576,7 @@ draw_polygon(DiaRenderer *self,
static void
pgf_rect(PgfRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *color, gboolean filled)
+ GdkRGBA *color, gboolean filled)
{
gchar ulx_buf[DTOSTR_BUF_SIZE];
gchar uly_buf[DTOSTR_BUF_SIZE];
@@ -602,7 +602,7 @@ pgf_rect(PgfRenderer *renderer,
static void
stroke_rounded_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *color, real radius)
+ GdkRGBA *color, real radius)
{
gchar rad_buf[DTOSTR_BUF_SIZE];
@@ -617,7 +617,7 @@ stroke_rounded_rect(DiaRenderer *self,
static void
fill_rounded_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *color, real radius)
+ GdkRGBA *color, real radius)
{
PgfRenderer *renderer = PGF_RENDERER(self);
gchar rad_buf[DTOSTR_BUF_SIZE];
@@ -631,7 +631,7 @@ fill_rounded_rect(DiaRenderer *self,
static void
draw_rounded_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real radius)
+ GdkRGBA *fill, GdkRGBA *stroke, real radius)
{
if (fill)
fill_rounded_rect (self, ul_corner, lr_corner, fill, radius);
@@ -644,7 +644,7 @@ pgf_arc(PgfRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color,int filled)
+ GdkRGBA *color,int filled)
{
double radius1,radius2;
int ang1,ang2;
@@ -701,7 +701,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
PgfRenderer *renderer = PGF_RENDERER(self);
@@ -713,7 +713,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
PgfRenderer *renderer = PGF_RENDERER(self);
@@ -724,7 +724,7 @@ static void
pgf_ellipse(PgfRenderer *renderer,
Point *center,
real width, real height,
- Color *color, gboolean filled)
+ GdkRGBA *color, gboolean filled)
{
gchar cx_buf[DTOSTR_BUF_SIZE];
gchar cy_buf[DTOSTR_BUF_SIZE];
@@ -751,7 +751,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PgfRenderer *renderer = PGF_RENDERER(self);
@@ -765,7 +765,7 @@ static void
pgf_bezier (PgfRenderer *renderer,
BezPoint *points,
gint numpoints,
- Color *fill, Color *stroke,
+ GdkRGBA *fill, GdkRGBA *stroke,
gboolean closed)
{
gint i;
@@ -824,7 +824,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints, /* numpoints = 4+3*n, n=>0 */
- Color *color)
+ GdkRGBA *color)
{
PgfRenderer *renderer = PGF_RENDERER(self);
@@ -837,8 +837,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
PgfRenderer *renderer = PGF_RENDERER(self);
@@ -891,7 +891,7 @@ set_arrows(PgfRenderer *renderer, Arrow *start_arrow, Arrow *end_arrow)
static void
draw_line_with_arrows(DiaRenderer *self, Point *start, Point *end,
- real line_width, Color *line_color,
+ real line_width, GdkRGBA *line_color,
Arrow *start_arrow, Arrow *end_arrow)
{
int nat_arr;
@@ -929,7 +929,7 @@ draw_line_with_arrows(DiaRenderer *self, Point *start, Point *end,
static void
draw_arc_with_arrows(DiaRenderer *self, Point *start, Point *end, Point *midpoint,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow)
{
int nat_arr;
@@ -965,7 +965,7 @@ draw_arc_with_arrows(DiaRenderer *self, Point *start, Point *end, Point *midpoin
static void
draw_polyline_with_arrows(DiaRenderer *self, Point *points, int num_points,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow)
{
int nat_arr;
@@ -1001,7 +1001,7 @@ draw_polyline_with_arrows(DiaRenderer *self, Point *points, int num_points,
static void
draw_rounded_polyline_with_arrows(DiaRenderer *self,
- Point *points, int num_points, real line_width, Color *color,
+ Point *points, int num_points, real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow, real radius)
{
int nat_arr;
@@ -1039,7 +1039,7 @@ draw_rounded_polyline_with_arrows(DiaRenderer *self,
static void
draw_bezier_with_arrows(DiaRenderer *self, BezPoint *points, int num_points,
- real line_width, Color *color,
+ real line_width, GdkRGBA *color,
Arrow *start_arrow, Arrow *end_arrow)
{
int nat_arr;
@@ -1128,7 +1128,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
PgfRenderer *renderer = PGF_RENDERER(self);
gchar *escaped = tex_escape_string(text, renderer->ctx);
@@ -1184,7 +1184,7 @@ export_pgf(DiagramData *data, DiaContext *ctx,
gchar scale1_buf[DTOSTR_BUF_SIZE];
gchar scale2_buf[DTOSTR_BUF_SIZE];
- Color initial_color;
+ GdkRGBA initial_color;
file = g_fopen(filename, "wb");
diff --git a/plug-ins/pixbuf/pixbuf.c b/plug-ins/pixbuf/pixbuf.c
index 8cf8028b..e7c0b6a9 100644
--- a/plug-ins/pixbuf/pixbuf.c
+++ b/plug-ins/pixbuf/pixbuf.c
@@ -39,7 +39,7 @@ export_data(DiagramData *data, DiaContext *ctx,
void* user_data)
{
DiaCairoRenderer *renderer;
- GdkColor color;
+ GdkRGBA color;
int width, height;
GdkPixbuf* pixbuf = NULL;
GError* error = NULL;
@@ -68,8 +68,7 @@ export_data(DiagramData *data, DiaContext *ctx,
cctx = cairo_create (renderer->surface);
/* draw background */
- color_convert (&data->bg_color, &color);
- gdk_cairo_set_source_color (cctx, &color);
+ gdk_cairo_set_source_rgba (cctx, &data->bg_color);
cairo_rectangle (cctx, 0, 0, width, height);
cairo_fill (cctx);
@@ -220,11 +219,6 @@ dia_plugin_init(PluginInfo *info)
GSList* formats = gdk_pixbuf_get_formats ();
GSList* sl;
- /* if we get this far we still may be running non-interactive. To avoid complains
- * from color_convert() we are initializing ourselves ;)
- */
- color_init ();
-
/*
* Instead of hard-coding capabilities, ask GdkPixbuf what's installed
*/
diff --git a/plug-ins/postscript/diapsft2renderer.c b/plug-ins/postscript/diapsft2renderer.c
index 9399ee9b..791b916e 100644
--- a/plug-ins/postscript/diapsft2renderer.c
+++ b/plug-ins/postscript/diapsft2renderer.c
@@ -79,7 +79,7 @@ static void dia_ps_ft2_renderer_class_init (DiaPsFt2RendererClass *klass);
static void
draw_text_line(DiaRenderer *self,
TextLine *text_line,
- Point *pos, Alignment alignment, Color *color);
+ Point *pos, Alignment alignment, GdkRGBA *color);
static gpointer parent_class = NULL;
@@ -336,7 +336,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
DiaPsFt2Renderer *renderer = DIA_PS_FT2_RENDERER(self);
TextLine *text_line = text_line_new(text, renderer->current_font,
@@ -348,7 +348,7 @@ draw_string(DiaRenderer *self,
static void
draw_text_line(DiaRenderer *self,
TextLine *text_line,
- Point *pos, Alignment alignment, Color *color)
+ Point *pos, Alignment alignment, GdkRGBA *color)
{
DiaPsFt2Renderer *renderer = DIA_PS_FT2_RENDERER(self);
PangoLayout *layout;
diff --git a/plug-ins/postscript/diapsrenderer.c b/plug-ins/postscript/diapsrenderer.c
index e442f247..07b38d00 100644
--- a/plug-ins/postscript/diapsrenderer.c
+++ b/plug-ins/postscript/diapsrenderer.c
@@ -51,13 +51,13 @@ static gboolean renderer_is_epsi(DiaPsRenderer *renderer) {
void
lazy_setcolor(DiaPsRenderer *renderer,
- Color *color)
+ GdkRGBA *color)
{
gchar r_buf[DTOSTR_BUF_SIZE];
gchar g_buf[DTOSTR_BUF_SIZE];
gchar b_buf[DTOSTR_BUF_SIZE];
- if (!color_equals(color, &(renderer->lcolor))) {
+ if (!gdk_rgba_equal(color, &(renderer->lcolor))) {
renderer->lcolor = *color;
fprintf(renderer->file, "%s %s %s srgb\n",
psrenderer_dtostr(r_buf, (gdouble) color->red),
@@ -293,7 +293,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_color)
+ GdkRGBA *line_color)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
gchar sx_buf[DTOSTR_BUF_SIZE];
@@ -313,7 +313,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_color)
+ GdkRGBA *line_color)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
int i;
@@ -339,7 +339,7 @@ static void
psrenderer_polygon(DiaPsRenderer *renderer,
Point *points,
gint num_points,
- Color *line_color,
+ GdkRGBA *line_color,
gboolean filled)
{
gint i;
@@ -367,7 +367,7 @@ psrenderer_polygon(DiaPsRenderer *renderer,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
/* XXX: not optimized to fill and stroke at once */
@@ -382,7 +382,7 @@ psrenderer_arc(DiaPsRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color,
+ GdkRGBA *color,
gboolean filled)
{
gchar cx_buf[DTOSTR_BUF_SIZE];
@@ -423,7 +423,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
psrenderer_arc(renderer, center, width, height, angle1, angle2, color, FALSE);
@@ -434,7 +434,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
psrenderer_arc(renderer, center, width, height, angle1, angle2, color, TRUE);
@@ -444,7 +444,7 @@ static void
psrenderer_ellipse(DiaPsRenderer *renderer,
Point *center,
real width, real height,
- Color *color,
+ GdkRGBA *color,
gboolean filled)
{
gchar cx_buf[DTOSTR_BUF_SIZE];
@@ -466,7 +466,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
if (fill)
@@ -479,7 +479,7 @@ static void
psrenderer_bezier(DiaPsRenderer *renderer,
BezPoint *points,
gint numpoints,
- Color *color,
+ GdkRGBA *color,
gboolean filled)
{
gint i;
@@ -530,7 +530,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints, /* numpoints = 4+3*n, n=>0 */
- Color *color)
+ GdkRGBA *color)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
psrenderer_bezier(renderer, points, numpoints, color, FALSE);
@@ -540,8 +540,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points, /* Last point must be same as first point */
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
if (fill)
@@ -616,7 +616,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
Point pos_adj;
diff --git a/plug-ins/postscript/diapsrenderer.h b/plug-ins/postscript/diapsrenderer.h
index 267330f8..eae3cf33 100644
--- a/plug-ins/postscript/diapsrenderer.h
+++ b/plug-ins/postscript/diapsrenderer.h
@@ -2,7 +2,6 @@
#define DIA_PS_RENDERER_H
#include <stdio.h>
-#include "color.h"
#include "diarenderer.h"
@@ -38,7 +37,7 @@ struct _DiaPsRenderer
guint pstype;
guint pagenum;
- Color lcolor;
+ GdkRGBA lcolor;
gchar *title;
gchar *paper;
@@ -59,7 +58,7 @@ struct _DiaPsRendererClass
void (*end_prolog) (DiaPsRenderer *renderer);
};
-void lazy_setcolor(DiaPsRenderer *renderer, Color *color);
+void lazy_setcolor(DiaPsRenderer *renderer, GdkRGBA *color);
G_END_DECLS
diff --git a/plug-ins/pstricks/render_pstricks.c b/plug-ins/pstricks/render_pstricks.c
index 44b0ffdb..65ce1eae 100644
--- a/plug-ins/pstricks/render_pstricks.c
+++ b/plug-ins/pstricks/render_pstricks.c
@@ -74,40 +74,40 @@ static void set_fillstyle(DiaRenderer *self, FillStyle mode);
static void set_font(DiaRenderer *self, DiaFont *font, real height);
static void draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_color);
+ GdkRGBA *line_color);
static void draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_color);
+ GdkRGBA *line_color);
static void draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color);
+ GdkRGBA *color);
static void draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color);
+ GdkRGBA *color);
static void draw_beziergon(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke);
+ GdkRGBA *fill,
+ GdkRGBA *stroke);
static void draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color);
+ GdkRGBA *color);
static void draw_image(DiaRenderer *self,
Point *point,
real width, real height,
@@ -216,7 +216,7 @@ pstricks_renderer_class_init (PstricksRendererClass *klass)
static void
-set_line_color(PstricksRenderer *renderer,Color *color)
+set_line_color(PstricksRenderer *renderer,GdkRGBA *color)
{
gchar red_buf[DTOSTR_BUF_SIZE];
gchar green_buf[DTOSTR_BUF_SIZE];
@@ -230,7 +230,7 @@ set_line_color(PstricksRenderer *renderer,Color *color)
}
static void
-set_fill_color(PstricksRenderer *renderer,Color *color)
+set_fill_color(PstricksRenderer *renderer,GdkRGBA *color)
{
gchar red_buf[DTOSTR_BUF_SIZE];
gchar green_buf[DTOSTR_BUF_SIZE];
@@ -390,7 +390,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_color)
+ GdkRGBA *line_color)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
gchar sx_buf[DTOSTR_BUF_SIZE];
@@ -410,7 +410,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_color)
+ GdkRGBA *line_color)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
int i;
@@ -434,7 +434,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
gint i;
@@ -477,7 +477,7 @@ pstricks_arc(PstricksRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color,int filled)
+ GdkRGBA *color,int filled)
{
double radius1,radius2;
gchar cx_buf[DTOSTR_BUF_SIZE];
@@ -525,7 +525,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
@@ -537,7 +537,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
@@ -548,7 +548,7 @@ static void
pstricks_ellipse(PstricksRenderer *renderer,
Point *center,
real width, real height,
- Color *color, gboolean filled)
+ GdkRGBA *color, gboolean filled)
{
gchar cx_buf[DTOSTR_BUF_SIZE];
gchar cy_buf[DTOSTR_BUF_SIZE];
@@ -569,7 +569,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
@@ -583,8 +583,8 @@ static void
pstricks_bezier(PstricksRenderer *renderer,
BezPoint *points,
gint numpoints,
- Color *fill,
- Color *stroke,
+ GdkRGBA *fill,
+ GdkRGBA *stroke,
gboolean closed)
{
gint i;
@@ -647,7 +647,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints, /* numpoints = 4+3*n, n=>0 */
- Color *color)
+ GdkRGBA *color)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
@@ -659,8 +659,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
@@ -718,7 +718,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
gchar *escaped = NULL;
@@ -862,7 +862,7 @@ export_pstricks(DiagramData *data, DiaContext *ctx,
gchar scale1_buf[DTOSTR_BUF_SIZE];
gchar scale2_buf[DTOSTR_BUF_SIZE];
- Color initial_color;
+ GdkRGBA initial_color;
file = g_fopen(filename, "wb");
diff --git a/plug-ins/python/pydia-color.c b/plug-ins/python/pydia-color.c
index dcf27439..8c37cfff 100644
--- a/plug-ins/python/pydia-color.c
+++ b/plug-ins/python/pydia-color.c
@@ -27,7 +27,7 @@
/*
* New
*/
-PyObject* PyDiaColor_New (Color* color)
+PyObject* PyDiaColor_New (GdkRGBA* color)
{
PyDiaColor *self;
@@ -55,7 +55,7 @@ static int
PyDiaColor_Compare(PyDiaColor *self,
PyDiaColor *other)
{
- return memcmp(&(self->color), &(other->color), sizeof(Color));
+ return memcmp(&(self->color), &(other->color), sizeof(GdkRGBA));
}
/*
diff --git a/plug-ins/python/pydia-color.h b/plug-ins/python/pydia-color.h
index 0f8aa621..bbb33d2b 100644
--- a/plug-ins/python/pydia-color.h
+++ b/plug-ins/python/pydia-color.h
@@ -2,15 +2,14 @@
#define PYDIA_COLOR_H
#include <Python.h>
-#include "color.h"
typedef struct {
PyObject_HEAD
- Color color;
+ GdkRGBA color;
} PyDiaColor;
extern PyTypeObject PyDiaColor_Type;
-PyObject* PyDiaColor_New (Color* color);
+PyObject* PyDiaColor_New (GdkRGBA* color);
#endif
diff --git a/plug-ins/python/pydia-render.c b/plug-ins/python/pydia-render.c
index 7e04b733..78a8ec06 100644
--- a/plug-ins/python/pydia-render.c
+++ b/plug-ins/python/pydia-render.c
@@ -539,7 +539,7 @@ draw_object (DiaRenderer *renderer, DiaObject *object, DiaMatrix *matrix)
static void
draw_line(DiaRenderer *renderer,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -582,7 +582,7 @@ draw_line(DiaRenderer *renderer,
static void
draw_polyline(DiaRenderer *renderer,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -621,7 +621,7 @@ draw_polyline(DiaRenderer *renderer,
static void
draw_polygon(DiaRenderer *renderer,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -660,7 +660,7 @@ draw_polygon(DiaRenderer *renderer,
static void
draw_rect(DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -702,7 +702,7 @@ draw_rect(DiaRenderer *renderer,
static void
draw_rounded_rect(DiaRenderer *renderer,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real rounding)
+ GdkRGBA *fill, GdkRGBA *stroke, real rounding)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -747,7 +747,7 @@ draw_arc(DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -793,7 +793,7 @@ fill_arc(DiaRenderer *renderer,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -838,7 +838,7 @@ static void
draw_ellipse(DiaRenderer *renderer,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -883,7 +883,7 @@ static void
draw_bezier(DiaRenderer *renderer,
BezPoint *points,
int num_points,
- Color *colour)
+ GdkRGBA *colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -916,7 +916,7 @@ static void
fill_bezier(DiaRenderer *renderer,
BezPoint *points, /* Last point must be same as first point */
int num_points,
- Color *colour)
+ GdkRGBA *colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -952,8 +952,8 @@ static void
draw_beziergon (DiaRenderer *renderer,
BezPoint *points,
int num_points,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
@@ -1007,7 +1007,7 @@ static void
draw_string(DiaRenderer *renderer,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
diff --git a/plug-ins/python/pydia-text.h b/plug-ins/python/pydia-text.h
index 29e01419..f54e3c50 100644
--- a/plug-ins/python/pydia-text.h
+++ b/plug-ins/python/pydia-text.h
@@ -2,7 +2,6 @@
#define PYDIA_TEXT_H
#include <Python.h>
-#include "color.h"
typedef struct {
PyObject_HEAD
diff --git a/plug-ins/shape/shape-export.c b/plug-ins/shape/shape-export.c
index ffd64ceb..bdbb0ca8 100644
--- a/plug-ins/shape/shape-export.c
+++ b/plug-ins/shape/shape-export.c
@@ -99,27 +99,27 @@ static void end_render(DiaRenderer *self);
static void draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour);
+ GdkRGBA *line_colour);
static void
draw_object(DiaRenderer *self,
DiaObject *object,
DiaMatrix *matrix);
static void draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_colour);
+ GdkRGBA *line_colour);
static void draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real rounding);
+ GdkRGBA *fill, GdkRGBA *stroke, real rounding);
static void draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
/* helper functions */
static void add_connection_point(ShapeRenderer *renderer,
@@ -372,7 +372,7 @@ add_connection_point (ShapeRenderer *renderer,
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
Point center;
ShapeRenderer *renderer = SHAPE_RENDERER(self);
@@ -398,7 +398,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
int i;
@@ -439,7 +439,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
int i;
@@ -526,7 +526,7 @@ add_rectangle_connection_points (ShapeRenderer *renderer,
static void
draw_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
ShapeRenderer *renderer = SHAPE_RENDERER(self);
@@ -545,7 +545,7 @@ draw_rect (DiaRenderer *self,
static void
draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke, real rounding)
+ GdkRGBA *fill, GdkRGBA *stroke, real rounding)
{
ShapeRenderer *renderer = SHAPE_RENDERER(self);
@@ -590,7 +590,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
ShapeRenderer *renderer = SHAPE_RENDERER(self);
diff --git a/plug-ins/svg/render_svg.c b/plug-ins/svg/render_svg.c
index 1af057a6..f7330317 100644
--- a/plug-ins/svg/render_svg.c
+++ b/plug-ins/svg/render_svg.c
@@ -109,9 +109,9 @@ static void draw_object (DiaRenderer *renderer,
static void draw_string (DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour);
+ GdkRGBA *colour);
static void draw_text_line (DiaRenderer *self, TextLine *text_line,
- Point *pos, Alignment alignment, Color *colour);
+ Point *pos, Alignment alignment, GdkRGBA *colour);
static void draw_text (DiaRenderer *self, Text *text);
static void draw_rotated_text (DiaRenderer *self, Text *text, Point *center, real angle);
static void draw_rotated_image (DiaRenderer *self, Point *point,
@@ -396,7 +396,7 @@ node_set_text_style (xmlNodePtr node,
const DiaFont *font,
real font_height,
Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
real saved_width;
gchar d_buf[G_ASCII_DTOSTR_BUF_SIZE];
@@ -477,7 +477,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
@@ -500,7 +500,7 @@ draw_string(DiaRenderer *self,
*/
static void
draw_text_line(DiaRenderer *self, TextLine *text_line,
- Point *pos, Alignment alignment, Color *colour)
+ Point *pos, Alignment alignment, GdkRGBA *colour)
{
DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
xmlNodePtr node;
diff --git a/plug-ins/svg/svg-import.c b/plug-ins/svg/svg-import.c
index 0d1ac0ee..63cedcbd 100644
--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -62,10 +62,10 @@ static gboolean import_svg (xmlDocPtr doc, DiagramData *dia, DiaContext *ctx, vo
static GPtrArray *make_element_props(real xpos, real ypos, real width, real height);
/* TODO: use existing implementation in dia source */
-static Color
+static GdkRGBA
get_colour(gint32 c, real opacity)
{
- Color colour;
+ GdkRGBA colour;
colour.red = ((c & 0xff0000) >> 16) / 255.0;
colour.green = ((c & 0x00ff00) >> 8) / 255.0;
colour.blue = (c & 0x0000ff) / 255.0;
@@ -1317,7 +1317,7 @@ read_gradient (xmlNodePtr node, DiaSvgStyle *parent_gs, GHashTable *pattern_ht,
while (child) {
if (xmlStrcmp(child->name, (const xmlChar *)"stop")==0) {
DiaSvgStyle gs;
- Color color;
+ GdkRGBA color;
real offset = 0.0;
dia_svg_style_init (&gs, &gradient_gs);
diff --git a/plug-ins/vdx/vdx-common.c b/plug-ins/vdx/vdx-common.c
index 5a6f52ef..8f8fad59 100644
--- a/plug-ins/vdx/vdx-common.c
+++ b/plug-ins/vdx/vdx-common.c
@@ -21,7 +21,6 @@
#include <stdio.h>
#include <glib.h>
-#include "color.h"
#include <visio-types.h>
diff --git a/plug-ins/vdx/vdx-export.c b/plug-ins/vdx/vdx-export.c
index c173ed8e..668f12fd 100644
--- a/plug-ins/vdx/vdx-export.c
+++ b/plug-ins/vdx/vdx-export.c
@@ -104,7 +104,7 @@ static gboolean export_vdx(DiagramData *data, DiaContext *ctx,
void* user_data);
static int
-vdxCheckColor(VDXRenderer *renderer, Color *color);
+vdxCheckColor(VDXRenderer *renderer, GdkRGBA *color);
static gpointer parent_class = NULL;
@@ -159,7 +159,7 @@ static void
begin_render(DiaRenderer *self, const Rectangle *update)
{
VDXRenderer *renderer = VDX_RENDERER(self);
- Color c;
+ GdkRGBA c;
renderer->depth = 0;
@@ -314,15 +314,15 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
*/
static int
-vdxCheckColor(VDXRenderer *renderer, Color *color)
+vdxCheckColor(VDXRenderer *renderer, GdkRGBA *color)
{
int i;
- Color cmp_color;
+ GdkRGBA cmp_color;
for (i = 0; i < renderer->Colors->len; i++)
{
cmp_color = g_array_index(renderer->Colors, Color, i);
- if (color_equals(color, &cmp_color)) return i;
+ if (gdk_rgba_equal(color, &cmp_color)) return i;
}
/* Grow table */
g_array_append_val(renderer->Colors, *color);
@@ -361,7 +361,7 @@ vdxCheckFont(VDXRenderer *renderer)
* @todo join, caps, dashlength
*/
static void
-create_Line(VDXRenderer *renderer, Color *color, struct vdx_Line *Line,
+create_Line(VDXRenderer *renderer, GdkRGBA *color, struct vdx_Line *Line,
Arrow *start_arrow, Arrow *end_arrow)
{
/* A Line (colour etc) */
@@ -406,7 +406,7 @@ create_Line(VDXRenderer *renderer, Color *color, struct vdx_Line *Line,
*/
static void
-create_Fill(VDXRenderer *renderer, Color *color, struct vdx_Fill *Fill)
+create_Fill(VDXRenderer *renderer, GdkRGBA *color, struct vdx_Fill *Fill)
{
/* A Fill (colour etc) */
memset(Fill, 0, sizeof(*Fill));
@@ -425,7 +425,7 @@ create_Fill(VDXRenderer *renderer, Color *color, struct vdx_Fill *Fill)
*/
static void
-draw_line(DiaRenderer *self, Point *start, Point *end, Color *color)
+draw_line(DiaRenderer *self, Point *start, Point *end, GdkRGBA *color)
{
VDXRenderer *renderer = VDX_RENDERER(self);
Point a, b;
@@ -526,7 +526,7 @@ draw_line(DiaRenderer *self, Point *start, Point *end, Color *color)
*/
static void draw_polyline(DiaRenderer *self, Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
VDXRenderer *renderer = VDX_RENDERER(self);
Point a, b;
@@ -632,7 +632,7 @@ static void draw_polyline(DiaRenderer *self, Point *points, int num_points,
static void
_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke,
+ GdkRGBA *fill, GdkRGBA *stroke,
real radius)
{
VDXRenderer *renderer = VDX_RENDERER(self);
@@ -759,7 +759,7 @@ _polygon (DiaRenderer *self,
static void
draw_polygon (DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
_polygon (self, points, num_points, fill, stroke, 0.0);
}
@@ -767,7 +767,7 @@ draw_polygon (DiaRenderer *self,
static void
draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke,
+ GdkRGBA *fill, GdkRGBA *stroke,
real radius)
{
Point points[4]; /* close path done by _polygon() */
@@ -795,7 +795,7 @@ static void draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
VDXRenderer *renderer = VDX_RENDERER(self);
Point a;
@@ -932,7 +932,7 @@ fill_arc (DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
VDXRenderer *renderer = VDX_RENDERER(self);
Point a;
@@ -1083,7 +1083,7 @@ static void
draw_ellipse (DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
VDXRenderer *renderer = VDX_RENDERER(self);
Point a;
@@ -1184,7 +1184,7 @@ draw_ellipse (DiaRenderer *self,
static void draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
VDXRenderer *renderer = VDX_RENDERER(self);
Point a;
@@ -1410,7 +1410,7 @@ static void draw_image(DiaRenderer *self,
*/
const char *
-vdx_string_color(const Color c)
+vdx_string_color(const GdkRGBA c)
{
static char buf[8];
sprintf(buf, "#%.2X%.2X%.2X",
@@ -1474,7 +1474,7 @@ static void
write_header(DiagramData *data, VDXRenderer *renderer)
{
FILE *file = renderer->file;
- Color c;
+ GdkRGBA c;
const char *f;
unsigned int i;
struct vdx_StyleSheet StyleSheet;
@@ -1485,7 +1485,7 @@ write_header(DiagramData *data, VDXRenderer *renderer)
struct vdx_Char Char;
struct vdx_Para Para;
struct vdx_Tabs Tabs;
- static Color color_black = { 0.0, 0.0, 0.0, 1.0 };
+ static GdkRGBA color_black = { 0.0, 0.0, 0.0, 1.0 };
g_debug("write_header");
diff --git a/plug-ins/vdx/vdx-import.c b/plug-ins/vdx/vdx-import.c
index 9b5d1d59..52b73ee5 100644
--- a/plug-ins/vdx/vdx-import.c
+++ b/plug-ins/vdx/vdx-import.c
@@ -193,11 +193,11 @@ static PropDescription vdx_text_descs[] = {
* @param ctx the context for error/warning messages
* @return A Dia Color object
*/
-Color
+GdkRGBA
vdx_parse_color(const char *s, const VDXDocument *theDoc, DiaContext *ctx)
{
int colorvalues;
- Color c = {0, 0, 0, 0};
+ GdkRGBA c = {0, 0, 0, 0};
if (s[0] == '#')
{
sscanf(s, "#%xd", &colorvalues);
@@ -238,7 +238,7 @@ vdx_get_colors(xmlNodePtr cur, VDXDocument* theDoc, DiaContext *ctx)
for (ColorEntry = cur->xmlChildrenNode; ColorEntry;
ColorEntry = ColorEntry->next) {
- Color color;
+ GdkRGBA color;
struct vdx_ColorEntry temp_ColorEntry;
if (xmlIsBlankNode(ColorEntry)) { continue; }
@@ -613,7 +613,7 @@ vdx_simple_properties(DiaObject *obj,
if (Line)
{
- Color color;
+ GdkRGBA color;
prop_list_add_line_width (props,Line->LineWeight * vdx_Line_Scale);
@@ -654,7 +654,7 @@ vdx_simple_properties(DiaObject *obj,
if (Fill && Fill->FillPattern)
{
- Color color;
+ GdkRGBA color;
/* Dia can't do fill patterns, so we have to choose either the
foreground or background colour.
diff --git a/plug-ins/vdx/vdx.h b/plug-ins/vdx/vdx.h
index ca223c1c..3355adb7 100644
--- a/plug-ins/vdx/vdx.h
+++ b/plug-ins/vdx/vdx.h
@@ -77,11 +77,11 @@ static const ArrowType vdx_Arrows[] = { ARROW_NONE,
#define VDX_NAMEU_LEN 30
#define DEG_TO_RAD M_PI/180.0 /* Degrees to radians */
-Color
+GdkRGBA
vdx_parse_color(const char *s, const VDXDocument *theDoc, DiaContext *ctx);
const char *
-vdx_string_color(const Color c);
+vdx_string_color(const GdkRGBA c);
void *
vdx_read_object(xmlNodePtr cur, VDXDocument *theDoc, void *p, DiaContext *ctx);
diff --git a/plug-ins/vdx/visio-types.h b/plug-ins/vdx/visio-types.h
index 4d9111f0..39b76b84 100644
--- a/plug-ins/vdx/visio-types.h
+++ b/plug-ins/vdx/visio-types.h
@@ -75,7 +75,7 @@ struct vdx_Char
struct vdx_any any;
unsigned int AsianFont; /* F=Inh */
gboolean Case; /* F=0,Inh =0 */
- Color Color; /* F=0,0,0,19))",0,1,16))",1,14,15,2,4,GUARD(IF(Sheet.5!User.active,0,19)),HSL(0,0 */
+ GdkRGBA Color; /* F=0,0,0,19))",0,1,16))",1,14,15,2,4,GUARD(IF(Sheet.5!User.active,0,19)),HSL(0,0 */
float ColorTrans; /* F=0%,Inh,No Formula */
unsigned int ComplexScriptFont; /* F=Inh */
float ComplexScriptSize; /* F=Inh Unit=DT */
@@ -335,9 +335,9 @@ struct vdx_Field
struct vdx_Fill
{
struct vdx_any any;
- Color FillBkgnd; /* F=0,1,14,15,18,2,8,HSL(0,0,128),HSL(0,0,181),HSL(0,0,210),HSL(0,0,240),HSL(0,0, */
+ GdkRGBA FillBkgnd; /* F=0,1,14,15,18,2,8,HSL(0,0,128),HSL(0,0,181),HSL(0,0,210),HSL(0,0,240),HSL(0,0, */
float FillBkgndTrans; /* F=0%,Inh,No Formula */
- Color FillForegnd; /* F=0,0,0,20)",0,1,17)",0,10,19))",1,10,11,12,13,14,15,17,18,19,2,20,21,23,3,4,5, */
+ GdkRGBA FillForegnd; /* F=0,0,0,20)",0,1,17)",0,10,19))",1,10,11,12,13,14,15,17,18,19,2,20,21,23,3,4,5,
*/
float FillForegndTrans; /* F=0%,Inh,No Formula */
unsigned int FillPattern; /* F=0,1,31,GUARD(0),GUARD(1),Guard(0),Inh */
float ShapeShdwObliqueAngle; /* F=Inh */
@@ -347,7 +347,7 @@ struct vdx_Fill
gboolean ShapeShdwType; /* F=Inh =0,1 */
unsigned int ShdwBkgnd; /* F=1,GUARD(0),Inh */
float ShdwBkgndTrans; /* F=0%,Inh,No Formula */
- Color ShdwForegnd; /* F=0,15,8,GUARD(0),HSL(0,0,205),HSL(0,0,206),HSL(0,0,208),HSL(0,0,210),HSL(0,0,2 */
+ GdkRGBA ShdwForegnd; /* F=0,15,8,GUARD(0),HSL(0,0,205),HSL(0,0,206),HSL(0,0,208),HSL(0,0,210),HSL(0,0,2
*/
float ShdwForegndTrans; /* F=0%,Inh,No Formula */
unsigned int ShdwPattern; /* F=0,0),1,0)',GUARD(0),Guard(0),Inh */
};
@@ -561,7 +561,7 @@ struct vdx_Line
unsigned int EndArrow; /* F=0,3,41,4)))',4,GUARD(0),Inh =0,1,10,11,12,13,14,15,16,4,5,9 */
unsigned int EndArrowSize; /* F=1,2,IF(User.UMLError,0,2),Inh =0,1,2,3,4 */
gboolean LineCap; /* F=0,1,Inh =0,1 */
- Color LineColor; /* F=0,1,14,15,2,3,4,GUARD(Sheet.5!FillForegnd),HSL(0,0,0),HSL(0,0,240),HSL(0,0,60 */
+ GdkRGBA LineColor; /* F=0,1,14,15,2,3,4,GUARD(Sheet.5!FillForegnd),HSL(0,0,0),HSL(0,0,240),HSL(0,0,60 */
float LineColorTrans; /* F=0%,Inh,No Formula */
unsigned int LinePattern; /* F=0,1,1,0,1)',2,23,3,4,3,1)))',9,GUARD(1),Inh,Sheet.8!LinePattern */
float LineWeight; /* F=0.0033333333333333DT,0.01DT,0.03DT,0.12PT,0.24PT,0.254MM,0.5MM,0PT,GUARD(0.24
Unit=IN,MM,PT */
diff --git a/plug-ins/wpg/wpg-import.c b/plug-ins/wpg/wpg-import.c
index 2e5b4ec3..0424f5a9 100644
--- a/plug-ins/wpg/wpg-import.c
+++ b/plug-ins/wpg/wpg-import.c
@@ -54,9 +54,9 @@ struct _WpgImportRenderer {
WPGLineAttr LineAttr;
WPGColorRGB* pPal;
- Color stroke;
- Color fill;
- Color text_color;
+ GdkRGBA stroke;
+ GdkRGBA fill;
+ GdkRGBA text_color;
Alignment text_align;
};
diff --git a/plug-ins/wpg/wpg.c b/plug-ins/wpg/wpg.c
index 47ef0b5b..c9175286 100644
--- a/plug-ins/wpg/wpg.c
+++ b/plug-ins/wpg/wpg.c
@@ -161,7 +161,7 @@ fwrite_le(void* buf, size_t size, size_t count, FILE* f)
* helper functions
*/
static guint8
-LookupColor(WpgRenderer *renderer, Color* colour)
+LookupColor(WpgRenderer *renderer, GdkRGBA* colour)
{
/* find nearest color in the renderers color map */
/* the following hack does only work with a correctly
@@ -211,7 +211,7 @@ WriteRecHead(WpgRenderer *renderer, WPG_Type Type, guint32 Size)
}
static void
-WriteLineAttr(WpgRenderer *renderer, Color* colour)
+WriteLineAttr(WpgRenderer *renderer, GdkRGBA* colour)
{
g_assert(4 == sizeof(WPGLineAttr));
@@ -222,7 +222,7 @@ WriteLineAttr(WpgRenderer *renderer, Color* colour)
}
static void
-WriteFillAttr(WpgRenderer *renderer, Color* colour, gboolean bFill)
+WriteFillAttr(WpgRenderer *renderer, GdkRGBA* colour, gboolean bFill)
{
g_assert(2 == sizeof(WPGFillAttr));
@@ -270,7 +270,7 @@ begin_render(DiaRenderer *self, const Rectangle *update)
gint16 i;
guint8* pPal;
- Color color = { 1.0, 1.0, 1.0, 1.0 };
+ GdkRGBA color = { 1.0, 1.0, 1.0, 1.0 };
DIAG_NOTE(g_message("begin_render"));
@@ -450,7 +450,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
gint16 pData[4];
@@ -473,7 +473,7 @@ draw_line(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *line_colour)
+ GdkRGBA *line_colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
int i;
@@ -508,7 +508,7 @@ draw_polyline(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
WpgRenderer *renderer = WPG_RENDERER (self);
gint16* pData;
@@ -553,7 +553,7 @@ draw_polygon(DiaRenderer *self,
static void
draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
WpgRenderer *renderer = WPG_RENDERER (self);
gint16* pData;
@@ -592,7 +592,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
WPGEllipse ell;
@@ -632,7 +632,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour)
+ GdkRGBA *colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
WPGEllipse ell;
@@ -672,7 +672,7 @@ static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
WpgRenderer *renderer = WPG_RENDERER (self);
WPGEllipse ell;
@@ -706,7 +706,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *colour)
+ GdkRGBA *colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
WPGPoint* pts;
@@ -769,8 +769,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
DIAG_NOTE(g_message("draw_beziezgon %d points", numpoints));
@@ -797,7 +797,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour)
+ GdkRGBA *colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
gint16 len;
diff --git a/plug-ins/xfig/xfig-common.c b/plug-ins/xfig/xfig-common.c
index 9ba855a8..1ca479b3 100644
--- a/plug-ins/xfig/xfig-common.c
+++ b/plug-ins/xfig/xfig-common.c
@@ -16,11 +16,9 @@
#include <errno.h>
#include <locale.h>
-#include "color.h"
-
#include "xfig.h"
-Color fig_default_colors[FIG_MAX_DEFAULT_COLORS] =
+GdkRGBA fig_default_colors[FIG_MAX_DEFAULT_COLORS] =
{ { 0x00, 0x00, 0x00, 0xff }, { 0x00, 0x00, 0xff, 0xff }, { 0x00, 0xff, 0x00, 0xff }, { 0x00, 0xff, 0xff,
0xff },
{ 0xff, 0x00, 0x00, 0xff }, { 0xff, 0x00, 0xff, 0xff }, { 0xff, 0xff, 0x00, 0xff }, { 0xff, 0xff, 0xff,
0xff },
{ 0x00, 0x00, 0x8f, 0xff }, { 0x00, 0x00, 0xb0, 0xff }, { 0x00, 0x00, 0xd1, 0xff }, { 0x87, 0xcf, 0xff,
0xff },
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index 4ea32ba2..d85d30ca 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -91,7 +91,7 @@ struct _XfigRenderer
real fontheight;
gboolean color_pass;
- Color user_colors[512];
+ GdkRGBA user_colors[512];
int max_user_color;
gchar *warnings[MAX_WARNING];
@@ -113,70 +113,70 @@ static void set_fillstyle(DiaRenderer *self, FillStyle mode);
static void set_font(DiaRenderer *self, DiaFont *font, real height);
static void draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *color);
+ GdkRGBA *color);
static void draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *color);
+ GdkRGBA *color);
static void draw_line_with_arrows(DiaRenderer *self,
Point *start, Point *end,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_polyline_with_arrows(DiaRenderer *self,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour);
+ GdkRGBA *colour);
static void draw_arc_with_arrows(DiaRenderer *self,
Point *startpoint,
Point *endpoint,
Point *midpoint,
real line_width,
- Color *colour,
+ GdkRGBA *colour,
Arrow *start_arrow,
Arrow *end_arrow);
static void fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *colour);
+ GdkRGBA *colour);
static void draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke);
+ GdkRGBA *fill, GdkRGBA *stroke);
static void draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *colour);
+ GdkRGBA *colour);
static void draw_bezier_with_arrows(DiaRenderer *self,
BezPoint *points,
int numpoints,
real line_width,
- Color *colour,
+ GdkRGBA *colour,
Arrow *start_arrow,
Arrow *end_arrow);
static void draw_beziergon(DiaRenderer *self,
BezPoint *points, /* Last point must be same as first point */
int numpoints,
- Color *fill,
- Color *stroke);
+ GdkRGBA *fill,
+ GdkRGBA *stroke);
static void draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *colour);
+ GdkRGBA *colour);
static void draw_image(DiaRenderer *self,
Point *point,
real width, real height,
@@ -312,15 +312,15 @@ figLineWidth(XfigRenderer *renderer)
The color pseudo object even must be placed first in the xfig file.
*/
static void
-figCheckColor(XfigRenderer *renderer, Color *color)
+figCheckColor(XfigRenderer *renderer, GdkRGBA *color)
{
int i;
for (i = 0; i < FIG_MAX_DEFAULT_COLORS; i++) {
- if (color_equals(color, &fig_default_colors[i])) return;
+ if (gdk_rgba_equal(color, &fig_default_colors[i])) return;
}
for (i = 0; i < renderer->max_user_color; i++) {
- if (color_equals(color, &renderer->user_colors[i])) return;
+ if (gdk_rgba_equal(color, &renderer->user_colors[i])) return;
}
if (renderer->max_user_color == FIG_MAX_USER_COLORS) {
figWarn(renderer, WARNING_OUT_OF_COLORS);
@@ -334,16 +334,16 @@ figCheckColor(XfigRenderer *renderer, Color *color)
}
static int
-figColor(XfigRenderer *renderer, Color *color)
+figColor(XfigRenderer *renderer, GdkRGBA *color)
{
int i;
for (i = 0; i < FIG_MAX_DEFAULT_COLORS; i++) {
- if (color_equals(color, &fig_default_colors[i]))
+ if (gdk_rgba_equal(color, &fig_default_colors[i]))
return i;
}
for (i = 0; i < renderer->max_user_color; i++) {
- if (color_equals(color, &renderer->user_colors[i]))
+ if (gdk_rgba_equal(color, &renderer->user_colors[i]))
return i + FIG_MAX_DEFAULT_COLORS;
}
return 0;
@@ -564,7 +564,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
static void
draw_line(DiaRenderer *self,
Point *start, Point *end,
- Color *color)
+ GdkRGBA *color)
{
XfigRenderer *renderer = XFIG_RENDERER(self);
gchar d_buf[DTOSTR_BUF_SIZE];
@@ -588,7 +588,7 @@ static void
draw_line_with_arrows(DiaRenderer *self,
Point *start, Point *end,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -622,7 +622,7 @@ draw_line_with_arrows(DiaRenderer *self,
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
- Color *color)
+ GdkRGBA *color)
{
int i;
XfigRenderer *renderer = XFIG_RENDERER(self);
@@ -651,7 +651,7 @@ static void
draw_polyline_with_arrows(DiaRenderer *self,
Point *points, int num_points,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -689,7 +689,7 @@ draw_polyline_with_arrows(DiaRenderer *self,
static void
draw_polygon(DiaRenderer *self,
Point *points, int num_points,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
int i;
XfigRenderer *renderer = XFIG_RENDERER(self);
@@ -723,7 +723,7 @@ draw_polygon(DiaRenderer *self,
static void
draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
XfigRenderer *renderer = XFIG_RENDERER(self);
gchar d_buf[DTOSTR_BUF_SIZE];
@@ -756,7 +756,7 @@ draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
Point first, second, last;
int direction = angle2 > angle1 ? 1 : 0; /* Dia not always gives counterclockwise */
@@ -822,7 +822,7 @@ draw_arc_with_arrows(DiaRenderer *self,
Point *endpoint,
Point *midpoint,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -875,7 +875,7 @@ fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
- Color *color)
+ GdkRGBA *color)
{
Point first, second, last;
XfigRenderer *renderer = XFIG_RENDERER(self);
@@ -923,7 +923,7 @@ static void
draw_ellipse (DiaRenderer *self,
Point *center,
real width, real height,
- Color *fill, Color *stroke)
+ GdkRGBA *fill, GdkRGBA *stroke)
{
XfigRenderer *renderer = XFIG_RENDERER(self);
gchar d_buf[DTOSTR_BUF_SIZE];
@@ -952,7 +952,7 @@ static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *color)
+ GdkRGBA *color)
{
XfigRenderer *renderer = XFIG_RENDERER(self);
@@ -969,7 +969,7 @@ draw_bezier_with_arrows(DiaRenderer *self,
BezPoint *points,
int numpoints,
real line_width,
- Color *color,
+ GdkRGBA *color,
Arrow *start_arrow,
Arrow *end_arrow)
{
@@ -987,8 +987,8 @@ static void
draw_beziergon (DiaRenderer *self,
BezPoint *points,
int numpoints,
- Color *fill,
- Color *stroke)
+ GdkRGBA *fill,
+ GdkRGBA *stroke)
{
XfigRenderer *renderer = XFIG_RENDERER(self);
@@ -1007,7 +1007,7 @@ static void
draw_string(DiaRenderer *self,
const char *text,
Point *pos, Alignment alignment,
- Color *color)
+ GdkRGBA *color)
{
guchar *figtext = NULL;
XfigRenderer *renderer = XFIG_RENDERER(self);
diff --git a/plug-ins/xfig/xfig-import.c b/plug-ins/xfig/xfig-import.c
index 2798167f..43ff73b1 100644
--- a/plug-ins/xfig/xfig-import.c
+++ b/plug-ins/xfig/xfig-import.c
@@ -55,7 +55,7 @@
#define BUFLEN 512
-static Color fig_colors[FIG_MAX_USER_COLORS];
+static GdkRGBA fig_colors[FIG_MAX_USER_COLORS];
/** Eats the rest of the line.
*/
@@ -95,7 +95,7 @@ skip_comments(FILE *file) {
return FALSE;
}
-static Color
+static GdkRGBA
fig_color(int color_index, DiaContext *ctx)
{
if (color_index <= -1)
@@ -112,10 +112,10 @@ fig_color(int color_index, DiaContext *ctx)
}
}
-static Color
+static GdkRGBA
fig_area_fill_color(int area_fill, int color_index, DiaContext *ctx)
{
- Color col;
+ GdkRGBA col;
col = fig_color(color_index, ctx);
if (area_fill == -1) return col;
if (area_fill >= 0 && area_fill <= 20) {
@@ -1056,7 +1056,7 @@ fig_read_object(FILE *file, DiaContext *ctx)
case 0: { /* Color pseudo-object. */
int colornumber;
int colorvalues;
- Color color;
+ GdkRGBA color;
if (fscanf(file, " %d #%xd", &colornumber, &colorvalues) != 2) {
dia_context_add_message_with_errno(ctx, errno, _("Couldn't read color\n"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]