[goffice] GOArrow: rearrange things a bit.



commit c86702cdd85b641989cff43efd58012ef69a50b3
Author: Morten Welinder <terra gnome org>
Date:   Thu Oct 15 15:52:25 2009 -0400

    GOArrow: rearrange things a bit.

 ChangeLog                      |    6 ++++++
 goffice/canvas/goc-line.c      |    4 ++--
 goffice/gtk/go-line-selector.c |    2 +-
 goffice/utils/go-line.c        |   27 +++++++++++++++++----------
 goffice/utils/go-line.h        |   10 +++++-----
 5 files changed, 31 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f1f1b6d..4674388 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-15  Morten Welinder  <terra gnome org>
+
+	* goffice/utils/go-line.c (go_line_dash_as_label): Translate here.
+	* goffice/gtk/go-line-selector.c (go_line_dash_palette_get_tooltip_func):
+	Don't translate here.
+
 2009-10-14  Morten Welinder  <terra gnome org>
 
 	* goffice/canvas/goc-line.c (goc_line_class_init): Change to
diff --git a/goffice/canvas/goc-line.c b/goffice/canvas/goc-line.c
index c9383c9..77109c6 100644
--- a/goffice/canvas/goc-line.c
+++ b/goffice/canvas/goc-line.c
@@ -127,7 +127,7 @@ handle_arrow_bounds (GOArrow const *arrow, GocItem *item)
 	switch (arrow->typ) {
 	case GO_ARROW_NONE:
 		break;
-	case GO_ARROW_TRIANGLE: {
+	case GO_ARROW_KITE: {
 		double d = hypot (arrow->b, arrow->c);
 		item->x0 -= d;
 		item->x1 += d;
@@ -215,7 +215,7 @@ draw_arrow (GOArrow const *arrow, cairo_t *cr, GOStyle *style,
 	w = style->line.width ? style->line.width / 2.0 : 0.5;
 
 	switch (arrow->typ) {
-	case GO_ARROW_TRIANGLE:
+	case GO_ARROW_KITE:
 		cairo_save (cr);
 		cairo_translate (cr, (int) *endx, (int) *endy);
 		cairo_rotate (cr, phi);
diff --git a/goffice/gtk/go-line-selector.c b/goffice/gtk/go-line-selector.c
index 771435d..8f2b246 100644
--- a/goffice/gtk/go-line-selector.c
+++ b/goffice/gtk/go-line-selector.c
@@ -64,7 +64,7 @@ go_line_dash_palette_render_func (cairo_t *cr,
 static char const *
 go_line_dash_palette_get_tooltip_func (int index, void *data)
 {
-	return _(go_line_dash_as_label (index));
+	return go_line_dash_as_label (index);
 }
 
 /**
diff --git a/goffice/utils/go-line.c b/goffice/utils/go-line.c
index 13e2d4b..9f15c66 100644
--- a/goffice/utils/go-line.c
+++ b/goffice/utils/go-line.c
@@ -20,10 +20,7 @@
  */
 
 #include <goffice/goffice-config.h>
-
-#include "go-color.h"
-#include "go-line.h"
-#include <goffice/math/go-math.h>
+#include <goffice/goffice.h>
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
@@ -173,7 +170,7 @@ go_line_dash_as_label (GOLineDashType type)
 			break;
 		}
 	}
-	return ret;
+	return _(ret);
 }
 
 /**
@@ -354,7 +351,7 @@ static struct {
 	char const *name;
 } arrow_types[] = {
 	{ GO_LINE_NONE, "none" },
-	{ GO_ARROW_TRIANGLE, "triangle" },
+	{ GO_ARROW_KITE, "kite" },
 	{ GO_ARROW_OVAL, "oval" }
 };
 
@@ -400,12 +397,10 @@ go_arrow_get_type (void)
 }
 
 void
-go_arrow_init (GOArrow *res,
-	       GOArrowType typ, GOColor color,
+go_arrow_init (GOArrow *res, GOArrowType typ,
 	       double a, double b, double c)
 {
 	res->typ = typ;
-	res->color = color;
 	res->a = a;
 	res->b = b;
 	res->c = c;
@@ -414,7 +409,19 @@ go_arrow_init (GOArrow *res,
 void
 go_arrow_clear (GOArrow *dst)
 {
-	go_arrow_init (dst, GO_ARROW_NONE, GO_COLOR_BLACK, 0, 0, 0);
+	go_arrow_init (dst, GO_ARROW_NONE, 0, 0, 0);
+}
+
+void
+go_arrow_init_kite (GOArrow *dst, double a, double b, double c)
+{
+	go_arrow_init (dst, GO_ARROW_KITE, a, b, c);
+}
+
+void
+go_arrow_init_oval (GOArrow *dst, double ra, double rb)
+{
+	go_arrow_init (dst, GO_ARROW_OVAL, ra, rb, 0);
 }
 
 GOArrow *
diff --git a/goffice/utils/go-line.h b/goffice/utils/go-line.h
index 582bf93..7e8d312 100644
--- a/goffice/utils/go-line.h
+++ b/goffice/utils/go-line.h
@@ -48,7 +48,7 @@ gboolean		 go_line_interpolation_auto_skip	(GOLineInterpolation type);
 
 typedef enum {
 	GO_ARROW_NONE,
-	GO_ARROW_TRIANGLE,
+	GO_ARROW_KITE,
 	GO_ARROW_OVAL
 	/* GO_ARROW_STEALTH */
 	/* GO_ARROW_DIAMOND */
@@ -57,7 +57,6 @@ typedef enum {
 
 typedef struct {
 	GOArrowType typ;
-	GOColor	color;
 	double a, b, c;
 } GOArrow;
 
@@ -68,10 +67,11 @@ char const *go_arrow_type_as_str (GOArrowType typ);
 GOArrowType go_arrow_type_from_str (const char *name);
 
 GOArrow *go_arrow_dup (GOArrow *src);
-void go_arrow_clear (GOArrow *dst);
-void go_arrow_init (GOArrow *res,
-		    GOArrowType typ, GOColor color,
+void go_arrow_init (GOArrow *res, GOArrowType typ,
 		    double a, double b, double c);
+void go_arrow_clear (GOArrow *dst);
+void go_arrow_init_kite (GOArrow *dst, double a, double b, double c);
+void go_arrow_init_oval (GOArrow *dst, double ra, double rb);
 
 G_END_DECLS
 



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