goocanvas r30 - in trunk: . src
- From: damon svn gnome org
- To: svn-commits-list gnome org
- Subject: goocanvas r30 - in trunk: . src
- Date: Mon, 17 Nov 2008 11:24:35 +0000 (UTC)
Author: damon
Date: Mon Nov 17 11:24:34 2008
New Revision: 30
URL: http://svn.gnome.org/viewvc/goocanvas?rev=30&view=rev
Log:
2008-11-17 Damon Chaplin <damon gnome org>
* src/goocanvasgrid.c: added "show-horz-grid-lines" and
"show-vert-grid-lines" properties, to turn off horz/vert grid lines.
Modified:
trunk/ChangeLog
trunk/src/goocanvasgrid.c
trunk/src/goocanvasgrid.h
Modified: trunk/src/goocanvasgrid.c
==============================================================================
--- trunk/src/goocanvasgrid.c (original)
+++ trunk/src/goocanvasgrid.c Mon Nov 17 11:24:34 2008
@@ -49,6 +49,8 @@
PROP_VERT_GRID_LINE_PATTERN,
PROP_BORDER_WIDTH,
PROP_BORDER_PATTERN,
+ PROP_SHOW_HORZ_GRID_LINES,
+ PROP_SHOW_VERT_GRID_LINES,
PROP_VERT_GRID_LINES_ON_TOP,
/* Convenience properties. */
@@ -180,6 +182,20 @@
GOO_TYPE_CAIRO_PATTERN,
G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_SHOW_HORZ_GRID_LINES,
+ g_param_spec_boolean ("show-horz-grid-lines",
+ _("Show Horizontal Grid Lines"),
+ _("If the horizontal grid lines are shown"),
+ TRUE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class, PROP_SHOW_VERT_GRID_LINES,
+ g_param_spec_boolean ("show-vert-grid-lines",
+ _("Show Vertical Grid Lines"),
+ _("If the vertical grid lines are shown"),
+ TRUE,
+ G_PARAM_READWRITE));
+
g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINES_ON_TOP,
g_param_spec_boolean ("vert-grid-lines-on-top",
_("Vertical Grid Lines On Top"),
@@ -272,6 +288,8 @@
grid_data->vert_grid_line_pattern = NULL;
grid_data->border_width = -1.0;
grid_data->border_pattern = NULL;
+ grid_data->show_horz_grid_lines = TRUE;
+ grid_data->show_vert_grid_lines = TRUE;
grid_data->vert_grid_lines_on_top = FALSE;
}
@@ -445,6 +463,12 @@
case PROP_BORDER_PATTERN:
g_value_set_boxed (value, grid_data->border_pattern);
break;
+ case PROP_SHOW_HORZ_GRID_LINES:
+ g_value_set_boolean (value, grid_data->show_horz_grid_lines);
+ break;
+ case PROP_SHOW_VERT_GRID_LINES:
+ g_value_set_boolean (value, grid_data->show_vert_grid_lines);
+ break;
case PROP_VERT_GRID_LINES_ON_TOP:
g_value_set_boolean (value, grid_data->vert_grid_lines_on_top);
break;
@@ -536,6 +560,12 @@
grid_data->border_pattern = g_value_get_boxed (value);
cairo_pattern_reference (grid_data->border_pattern);
break;
+ case PROP_SHOW_HORZ_GRID_LINES:
+ grid_data->show_horz_grid_lines = g_value_get_boolean (value);
+ break;
+ case PROP_SHOW_VERT_GRID_LINES:
+ grid_data->show_vert_grid_lines = g_value_get_boolean (value);
+ break;
case PROP_VERT_GRID_LINES_ON_TOP:
grid_data->vert_grid_lines_on_top = g_value_get_boolean (value);
break;
@@ -662,6 +692,9 @@
double x, max_x, max_y, max_bounds_x, line_width;
gboolean has_stroke;
+ if (!grid_data->show_vert_grid_lines)
+ return;
+
max_x = grid_data->x + grid_data->width;
max_y = grid_data->y + grid_data->height;
@@ -717,6 +750,9 @@
double y, max_x, max_y, max_bounds_y, line_width;
gboolean has_stroke;
+ if (!grid_data->show_horz_grid_lines)
+ return;
+
max_x = grid_data->x + grid_data->width;
max_y = grid_data->y + grid_data->height;
Modified: trunk/src/goocanvasgrid.h
==============================================================================
--- trunk/src/goocanvasgrid.h (original)
+++ trunk/src/goocanvasgrid.h Mon Nov 17 11:24:34 2008
@@ -38,6 +38,10 @@
/* The color/pattern for the border, or NULL to use the stroke color. */
cairo_pattern_t *border_pattern;
+ /* If the horizontal and vertical grid lines should be shown. */
+ guint show_horz_grid_lines : 1;
+ guint show_vert_grid_lines : 1;
+
/* If vertical grid lines are drawn on top. */
guint vert_grid_lines_on_top : 1;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]