goffice r2178 - in trunk: . goffice/graph goffice/utils plugins/plot_pie plugins/plot_radar plugins/plot_surface plugins/plot_xy plugins/reg_linear plugins/smoothing
- From: jbrefort svn gnome org
- To: svn-commits-list gnome org
- Subject: goffice r2178 - in trunk: . goffice/graph goffice/utils plugins/plot_pie plugins/plot_radar plugins/plot_surface plugins/plot_xy plugins/reg_linear plugins/smoothing
- Date: Thu, 21 Aug 2008 18:14:56 +0000 (UTC)
Author: jbrefort
Date: Thu Aug 21 18:14:56 2008
New Revision: 2178
URL: http://svn.gnome.org/viewvc/goffice?rev=2178&view=rev
Log:
2008-08-21 Jean Brefort <jean brefort normalesup org>
* all files: renamed GOG_PARAM_PERSISTENT to GO_PARAM_PERSISTENT and
GogPersist to GOPersist.
Added:
trunk/goffice/utils/go-persist.c
trunk/goffice/utils/go-persist.h
Modified:
trunk/ChangeLog
trunk/goffice/graph/gog-3d-box.c
trunk/goffice/graph/gog-axis-line.c
trunk/goffice/graph/gog-axis.c
trunk/goffice/graph/gog-chart.c
trunk/goffice/graph/gog-error-bar.c
trunk/goffice/graph/gog-graph.c
trunk/goffice/graph/gog-grid.c
trunk/goffice/graph/gog-label.c
trunk/goffice/graph/gog-legend.c
trunk/goffice/graph/gog-object-xml.c
trunk/goffice/graph/gog-object-xml.h
trunk/goffice/graph/gog-object.c
trunk/goffice/graph/gog-object.h
trunk/goffice/graph/gog-outlined-object.c
trunk/goffice/graph/gog-plot.c
trunk/goffice/graph/gog-reg-curve.c
trunk/goffice/graph/gog-series.c
trunk/goffice/graph/gog-style.c
trunk/goffice/graph/gog-style.h
trunk/goffice/graph/gog-styled-object.c
trunk/goffice/utils/Makefile.am
trunk/plugins/plot_pie/gog-pie.c
trunk/plugins/plot_radar/gog-radar.c
trunk/plugins/plot_surface/gog-xyz-surface.c
trunk/plugins/plot_surface/gog-xyz.c
trunk/plugins/plot_xy/gog-xy.c
trunk/plugins/reg_linear/gog-lin-reg.c
trunk/plugins/smoothing/gog-exp-smooth.c
trunk/plugins/smoothing/gog-moving-avg.c
Modified: trunk/goffice/graph/gog-3d-box.c
==============================================================================
--- trunk/goffice/graph/gog-3d-box.c (original)
+++ trunk/goffice/graph/gog-3d-box.c Thu Aug 21 18:14:56 2008
@@ -21,10 +21,11 @@
#include <goffice/goffice-config.h>
#include <goffice/graph/gog-3d-box.h>
+#include <goffice/graph/gog-chart.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
-#include <goffice/graph/gog-chart.h>
#ifdef GOFFICE_WITH_GTK
#include <goffice/gtk/goffice-gtk.h>
@@ -283,28 +284,28 @@
_("Euler angle psi"),
0, 360, 70,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE
- | GOG_PARAM_PERSISTENT));
+ | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, BOX3D_PROP_THETA,
g_param_spec_int ("theta",
"Theta",
_("Euler angle theta"),
0, 360, 10,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE
- | GOG_PARAM_PERSISTENT));
+ | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, BOX3D_PROP_PHI,
g_param_spec_int ("phi",
"Phi",
_("Euler angle phi"),
0, 360, 270,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE
- | GOG_PARAM_PERSISTENT));
+ | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, BOX3D_PROP_FOV,
g_param_spec_int ("fov",
"FoV",
_("Field of view"),
0, 90, 10,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE
- | GOG_PARAM_PERSISTENT));
+ | GO_PARAM_PERSISTENT));
#ifdef GOFFICE_WITH_GTK
gog_klass->populate_editor = gog_3d_box_populate_editor;
Modified: trunk/goffice/graph/gog-axis-line.c
==============================================================================
--- trunk/goffice/graph/gog-axis-line.c (original)
+++ trunk/goffice/graph/gog-axis-line.c Thu Aug 21 18:14:56 2008
@@ -31,6 +31,7 @@
#include <goffice/graph/gog-style.h>
#include <goffice/graph/gog-theme.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
@@ -689,64 +690,64 @@
_("Axis position (as a string)"),
_("Where to position an axis low, high, or crossing"),
"low",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MAJOR_TICK_LABELED,
g_param_spec_boolean ("major-tick-labeled",
_("Major labels"),
_("Show labels for major ticks"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MAJOR_TICK_IN,
g_param_spec_boolean ("major-tick-in",
_("Inside major ticks"),
_("Major tick marks inside the chart area"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MAJOR_TICK_OUT,
g_param_spec_boolean ("major-tick-out",
_("Outside major ticks"),
_("Major tick marks outside the chart area"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MAJOR_TICK_SIZE_PTS,
g_param_spec_int ("major-tick-size-pts",
_("Major tick size"),
_("Size of the major tick marks, in points"),
0, 20, 4,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MINOR_TICK_IN,
g_param_spec_boolean ("minor-tick-in",
_("Inside minor ticks"),
_("Minor tick marks inside the chart area"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MINOR_TICK_OUT,
g_param_spec_boolean ("minor-tick-out",
_("Outside minor ticks"),
_("Minor tick marks outside the axis"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_MINOR_TICK_SIZE_PTS,
g_param_spec_int ("minor-tick-size-pts",
_("Minor tick size"),
_("Size of the minor tick marks, in points"),
0, 15, 2,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_CROSS_AXIS_ID,
g_param_spec_uint ("cross-axis-id",
_("Cross axis id"),
_("Which axis to cross"),
0, G_MAXUINT, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_BASE_PROP_PADDING_PTS,
g_param_spec_int ("padding-pts",
_("Axis padding"),
_("Distance from axis line to plot area, in points"),
-G_MAXINT, G_MAXINT, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
#ifdef GOFFICE_WITH_GTK
gog_klass->populate_editor = gog_axis_base_populate_editor;
Modified: trunk/goffice/graph/gog-axis.c
==============================================================================
--- trunk/goffice/graph/gog-axis.c (original)
+++ trunk/goffice/graph/gog-axis.c Thu Aug 21 18:14:56 2008
@@ -36,6 +36,7 @@
#include <goffice/graph/gog-renderer.h>
#include <goffice/math/go-math.h>
#include <goffice/utils/go-format.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/data/go-data-simple.h>
#include <gsf/gsf-impl-utils.h>
@@ -1786,18 +1787,18 @@
g_param_spec_boolean ("invert-axis", _("Invert axis"),
_("Scale from high to low rather than low to high"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_PROP_MAP,
g_param_spec_string ("map-name", _("MapName"),
_("The name of the map for scaling"),
"linear",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_PROP_ASSIGNED_FORMAT_STR_XL,
g_param_spec_string ("assigned-format-string-XL",
_("Assigned XL format"),
_("The user assigned format to use for non-discrete axis labels (XL format)"),
"General",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_PROP_CIRCULAR_ROTATION,
g_param_spec_double ("circular-rotation",
_("Rotation of circular axis"),
@@ -1805,13 +1806,13 @@
GOG_AXIS_CIRCULAR_ROTATION_MIN,
GOG_AXIS_CIRCULAR_ROTATION_MAX,
0.0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, AXIS_PROP_POLAR_UNIT,
g_param_spec_string ("polar-unit",
_("Polar axis set unit"),
_("Polar axis set unit"),
polar_units[GOG_AXIS_POLAR_UNIT_DEGREES].name,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_object_register_roles (gog_klass, roles, G_N_ELEMENTS (roles));
Modified: trunk/goffice/graph/gog-chart.c
==============================================================================
--- trunk/goffice/graph/gog-chart.c (original)
+++ trunk/goffice/graph/gog-chart.c Thu Aug 21 18:14:56 2008
@@ -35,6 +35,7 @@
#include <goffice/graph/gog-renderer.h>
#include <goffice/math/go-math.h>
#include <goffice/math/go-matrix3x3.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -482,13 +483,13 @@
_("Plot area"),
_("Position and size of plot area, in percentage of chart size"),
"0 0 1 1",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, CHART_PROP_PLOT_AREA_IS_MANUAL,
g_param_spec_boolean ("is-plot-area-manual",
_("Manual plot area"),
_("Is plot area manual"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_klass->view_type = gog_chart_view_get_type ();
gog_klass->update = gog_chart_update;
Modified: trunk/goffice/graph/gog-error-bar.c
==============================================================================
--- trunk/goffice/graph/gog-error-bar.c (original)
+++ trunk/goffice/graph/gog-error-bar.c Thu Aug 21 18:14:56 2008
@@ -30,6 +30,7 @@
#include <goffice/data/go-data-impl.h>
#include <goffice/data/go-data.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -360,7 +361,7 @@
}
static gboolean
-gog_error_bar_persist_dom_load (GogPersist *gp, xmlNode *node)
+gog_error_bar_persist_dom_load (GOPersist *gp, xmlNode *node)
{
GogErrorBar *bar = GOG_ERROR_BAR (gp);
@@ -405,7 +406,7 @@
}
static void
-gog_error_bar_persist_sax_save (GogPersist const *gp, GsfXMLOut *output)
+gog_error_bar_persist_sax_save (GOPersist const *gp, GsfXMLOut *output)
{
GogErrorBar *bar = GOG_ERROR_BAR (gp);
char const *str;
@@ -437,7 +438,7 @@
}
static void
-gog_error_bar_persist_prep_sax (GogPersist *gp, GsfXMLIn *xin, xmlChar const **attrs)
+gog_error_bar_persist_prep_sax (GOPersist *gp, GsfXMLIn *xin, xmlChar const **attrs)
{
GogErrorBar *bar = GOG_ERROR_BAR (gog_xml_read_state_get_obj (xin));
@@ -470,7 +471,7 @@
}
static void
-gog_error_bar_persist_init (GogPersistClass *iface)
+gog_error_bar_persist_init (GOPersistClass *iface)
{
iface->dom_load = gog_error_bar_persist_dom_load;
iface->prep_sax = gog_error_bar_persist_prep_sax;
@@ -480,7 +481,7 @@
GSF_CLASS_FULL (GogErrorBar, gog_error_bar,
NULL, NULL, gog_error_bar_class_init, NULL,
gog_error_bar_init, G_TYPE_OBJECT, 0,
- GSF_INTERFACE (gog_error_bar_persist_init, GOG_PERSIST_TYPE))
+ GSF_INTERFACE (gog_error_bar_persist_init, GO_PERSIST_TYPE))
/**
Modified: trunk/goffice/graph/gog-graph.c
==============================================================================
--- trunk/goffice/graph/gog-graph.c (original)
+++ trunk/goffice/graph/gog-graph.c Thu Aug 21 18:14:56 2008
@@ -27,6 +27,7 @@
#include <goffice/graph/gog-style.h>
#include <goffice/graph/gog-theme.h>
#include <goffice/data/go-data.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/utils/go-units.h>
#include <gsf/gsf-impl-utils.h>
@@ -340,19 +341,19 @@
_("Theme name"),
_("The name of the theme for elements of the graph"),
"default",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GRAPH_PROP_WIDTH,
g_param_spec_double ("width-pts",
_("Width"),
_("Logical graph width, in points"),
0.0, G_MAXDOUBLE, GOG_GRAPH_DEFAULT_WIDTH,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GRAPH_PROP_HEIGHT,
g_param_spec_double ("height-pts",
_("Height"),
_("Logical graph heigth, in points"),
0.0, G_MAXDOUBLE, GOG_GRAPH_DEFAULT_HEIGHT,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GRAPH_PROP_DOCUMENT,
g_param_spec_object ("document",
_("Document"),
Modified: trunk/goffice/graph/gog-grid.c
==============================================================================
--- trunk/goffice/graph/gog-grid.c (original)
+++ trunk/goffice/graph/gog-grid.c Thu Aug 21 18:14:56 2008
@@ -29,6 +29,7 @@
#include <goffice/graph/gog-view.h>
#include <goffice/graph/gog-theme.h>
#include <goffice/graph/gog-renderer.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/math/go-math.h>
@@ -116,7 +117,7 @@
_("Numerical type of this backplane"),
GOG_GRID_UNKNOWN, GOG_GRID_TYPES, GOG_GRID_UNKNOWN,
GSF_PARAM_STATIC | G_PARAM_READWRITE
- | GOG_PARAM_PERSISTENT));
+ | GO_PARAM_PERSISTENT));
gog_klass->view_type = gog_grid_view_get_type ();
style_klass->init_style = gog_grid_init_style;
Modified: trunk/goffice/graph/gog-label.c
==============================================================================
--- trunk/goffice/graph/gog-label.c (original)
+++ trunk/goffice/graph/gog-label.c Thu Aug 21 18:14:56 2008
@@ -33,6 +33,7 @@
#include <goffice/graph/gog-reg-curve.h>
#include <goffice/graph/gog-data-allocator.h>
#include <goffice/data/go-data.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -147,7 +148,7 @@
_("Allow markup"),
_("Support basic html-ish markup"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_klass->view_type = gog_text_view_get_type ();
style_klass->init_style = gog_text_init_style;
@@ -425,13 +426,13 @@
_("Show equation"),
_("Show the equation on the graph"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, REG_EQN_SHOW_R2,
g_param_spec_boolean ("show-r2",
_("Show coefficient"),
_("Show the correlation coefficient on the graph"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/goffice/graph/gog-legend.c
==============================================================================
--- trunk/goffice/graph/gog-legend.c (original)
+++ trunk/goffice/graph/gog-legend.c Thu Aug 21 18:14:56 2008
@@ -30,6 +30,7 @@
#include <goffice/utils/go-color.h>
#include <goffice/math/go-math.h>
#include <goffice/utils/go-marker.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/utils/go-units.h>
#include <gsf/gsf-impl-utils.h>
@@ -206,13 +207,13 @@
_("Swatch Size pts"),
_("size of the swatches in pts."),
0, G_MAXDOUBLE, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, LEGEND_SWATCH_PADDING_PTS,
g_param_spec_double ("swatch-padding-pts",
_("Swatch Padding pts"),
_("padding between the swatches in pts."),
0, G_MAXDOUBLE, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/goffice/graph/gog-object-xml.c
==============================================================================
--- trunk/goffice/graph/gog-object-xml.c (original)
+++ trunk/goffice/graph/gog-object-xml.c Thu Aug 21 18:14:56 2008
@@ -27,6 +27,7 @@
#include <goffice/graph/gog-data-set.h>
#include <goffice/data/go-data.h>
#include <goffice/utils/go-color.h>
+#include <goffice/utils/go-persist.h>
#include <string.h>
#include <stdlib.h>
@@ -38,45 +39,6 @@
#define GOG_BACKPLANE_OLD_ROLE_NAME "Grid"
#define GOG_BACKPLANE_NEW_ROLE_NAME "Backplane"
-GType
-gog_persist_get_type (void)
-{
- static GType gog_persist_type = 0;
-
- if (!gog_persist_type) {
- static GTypeInfo const gog_persist_info = {
- sizeof (GogPersistClass), /* class_size */
- NULL, /* base_init */
- NULL, /* base_finalize */
- };
-
- gog_persist_type = g_type_register_static (G_TYPE_INTERFACE,
- "GogPersist", &gog_persist_info, 0);
- }
-
- return gog_persist_type;
-}
-
-gboolean
-gog_persist_dom_load (GogPersist *gp, xmlNode *node)
-{
- g_return_val_if_fail (IS_GOG_PERSIST (gp), FALSE);
- return GOG_PERSIST_GET_CLASS (gp)->dom_load (gp, node);
-}
-
-void
-gog_persist_sax_save (GogPersist const *gp, GsfXMLOut *output)
-{
- g_return_if_fail (IS_GOG_PERSIST (gp));
- GOG_PERSIST_GET_CLASS (gp)->sax_save (gp, output);
-}
-void
-gog_persist_prep_sax (GogPersist *gp, GsfXMLIn *xin, xmlChar const **attrs)
-{
- g_return_if_fail (IS_GOG_PERSIST (gp));
- GOG_PERSIST_GET_CLASS (gp)->prep_sax (gp, xin, attrs);
-}
-
static void
gog_object_set_arg_full (char const *name, char const *val, GogObject *obj, xmlNode *xml_node)
{
@@ -115,8 +77,8 @@
xmlFree (type_name);
if (type != 0) {
val_obj = g_object_new (type, NULL);
- if (IS_GOG_PERSIST (val_obj) &&
- gog_persist_dom_load (GOG_PERSIST (val_obj), xml_node)) {
+ if (IS_GO_PERSIST (val_obj) &&
+ go_persist_dom_load (GO_PERSIST (val_obj), xml_node)) {
g_value_set_object (&res, val_obj);
success = TRUE;
}
@@ -197,10 +159,10 @@
case G_TYPE_OBJECT:
val_obj = g_value_get_object (&value);
if (val_obj != NULL) {
- if (IS_GOG_PERSIST (val_obj)) {
+ if (IS_GO_PERSIST (val_obj)) {
gsf_xml_out_start_element (output, "property");
gsf_xml_out_add_cstr_unchecked (output, "name", pspec->name);
- gog_persist_sax_save (GOG_PERSIST (val_obj), output);
+ go_persist_sax_save (GO_PERSIST (val_obj), output);
gsf_xml_out_end_element (output); /* </property> */
} else
g_warning ("How are we supposed to persist this ??");
@@ -300,13 +262,13 @@
/* properties */
props = g_object_class_list_properties (G_OBJECT_GET_CLASS (obj), &n);
while (n-- > 0)
- if (props[n]->flags & GOG_PARAM_PERSISTENT)
+ if (props[n]->flags & GO_PARAM_PERSISTENT)
gog_object_write_property_sax (obj, props[n], output);
g_free (props);
- if (IS_GOG_PERSIST (obj)) /* anything special for this class */
- gog_persist_sax_save (GOG_PERSIST (obj), output);
+ if (IS_GO_PERSIST (obj)) /* anything special for this class */
+ go_persist_sax_save (GO_PERSIST (obj), output);
if (IS_GOG_DATASET (obj)) /* convenience to save data */
gog_dataset_sax_save (GOG_DATASET (obj), output);
@@ -356,8 +318,8 @@
res->explicitly_typed_role = explicitly_typed_role;
- if (IS_GOG_PERSIST (res))
- gog_persist_dom_load (GOG_PERSIST (res), node);
+ if (IS_GO_PERSIST (res))
+ go_persist_dom_load (GO_PERSIST (res), node);
if (IS_GOG_DATASET (res)) /* convenience to save data */
gog_dataset_dom_load (GOG_DATASET (res), node);
@@ -516,8 +478,8 @@
state->obj_stack = g_slist_prepend (state->obj_stack, state->obj);
state->obj = obj;
state->prop_pushed_obj = TRUE;
- if (IS_GOG_PERSIST (obj))
- gog_persist_prep_sax (GOG_PERSIST (obj), xin, attrs);
+ if (IS_GO_PERSIST (obj))
+ go_persist_prep_sax (GO_PERSIST (obj), xin, attrs);
}
}
@@ -603,8 +565,8 @@
}
if (res != NULL) {
res->explicitly_typed_role = (type != NULL);
- if (IS_GOG_PERSIST (res))
- gog_persist_prep_sax (GOG_PERSIST (res), xin, attrs);
+ if (IS_GO_PERSIST (res))
+ go_persist_prep_sax (GO_PERSIST (res), xin, attrs);
}
state->obj_stack = g_slist_prepend (state->obj_stack, state->obj);
Modified: trunk/goffice/graph/gog-object-xml.h
==============================================================================
--- trunk/goffice/graph/gog-object-xml.h (original)
+++ trunk/goffice/graph/gog-object-xml.h Thu Aug 21 18:14:56 2008
@@ -29,30 +29,6 @@
G_BEGIN_DECLS
-typedef struct _GogPersist GogPersist;
-
-typedef struct {
- GTypeInterface base;
-
- gboolean (*dom_load) (GogPersist *gp, xmlNode *node);
- void (*prep_sax) (GogPersist *gp, GsfXMLIn *xin, xmlChar const **attrs);
- void (*sax_save) (GogPersist const *gp, GsfXMLOut *output);
-} GogPersistClass;
-
-#define GOG_PERSIST_TYPE (gog_persist_get_type ())
-#define GOG_PERSIST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_PERSIST_TYPE, GogPersist))
-#define IS_GOG_PERSIST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GOG_PERSIST_TYPE))
-#define GOG_PERSIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GOG_PERSIST_TYPE, GogPersistClass))
-#define IS_GOG_PERSIST_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOG_PERSIST_TYPE))
-#define GOG_PERSIST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GOG_PERSIST_TYPE, GogPersistClass))
-
-GType gog_persist_get_type (void);
-
-gboolean gog_persist_dom_load (GogPersist *gp, xmlNode *node);
-void gog_persist_sax_save (GogPersist const *gp, GsfXMLOut *output);
-void gog_persist_prep_sax (GogPersist *gp,
- GsfXMLIn *xin, xmlChar const **attrs);
-
void gog_object_set_arg (char const *name, char const *val, GogObject *obj);
void go_xml_out_add_color (GsfXMLOut *out, char const *id, GOColor c);
void gog_object_write_xml_sax(GogObject const *obj, GsfXMLOut *output);
Modified: trunk/goffice/graph/gog-object.c
==============================================================================
--- trunk/goffice/graph/gog-object.c (original)
+++ trunk/goffice/graph/gog-object.c Thu Aug 21 18:14:56 2008
@@ -24,6 +24,7 @@
#include <goffice/graph/gog-graph-impl.h> /* for gog_graph_request_update */
#include <goffice/graph/gog-data-set.h>
#include <goffice/data/go-data.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -740,43 +741,43 @@
_("Object ID"),
_("Object numerical ID"),
0, G_MAXINT, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (klass, OBJECT_PROP_POSITION,
g_param_spec_string ("position",
_("Position"),
_("Position and size of object, in percentage of parent size"),
"0 0 1 1",
- GSF_PARAM_STATIC | G_PARAM_READWRITE|GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE|GO_PARAM_PERSISTENT));
g_object_class_install_property (klass, OBJECT_PROP_POSITION_COMPASS,
g_param_spec_string ("compass",
_("Compass"),
_("Compass auto position flags"),
"top",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT | GOG_PARAM_POSITION));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT | GOG_PARAM_POSITION));
g_object_class_install_property (klass, OBJECT_PROP_POSITION_ALIGNMENT,
g_param_spec_string ("alignment",
_("Alignment"),
_("Alignment flag"),
"fill",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT | GOG_PARAM_POSITION));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT | GOG_PARAM_POSITION));
g_object_class_install_property (klass, OBJECT_PROP_POSITION_IS_MANUAL,
g_param_spec_boolean ("is-position-manual",
_("Is position manual"),
_("Is position manual"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (klass, OBJECT_PROP_POSITION_ANCHOR,
g_param_spec_string ("anchor",
_("Anchor"),
_("Anchor for manual position"),
"top-left",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT | GOG_PARAM_POSITION));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT | GOG_PARAM_POSITION));
g_object_class_install_property (klass, OBJECT_PROP_INVISIBLE,
g_param_spec_boolean ("invisible",
_("Should the object be hidden"),
_("Should the object be hidden"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_object_signals [CHILD_ADDED] = g_signal_new ("child-added",
G_TYPE_FROM_CLASS (klass),
@@ -1010,7 +1011,7 @@
/* properties */
props = g_object_class_list_properties (G_OBJECT_GET_CLASS (src), &n);
while (n-- > 0)
- if (props[n]->flags & GOG_PARAM_PERSISTENT) {
+ if (props[n]->flags & GO_PARAM_PERSISTENT) {
g_value_init (&val, props[n]->value_type);
g_object_get_property (G_OBJECT (src), props[n]->name, &val);
g_object_set_property (G_OBJECT (dst), props[n]->name, &val);
Modified: trunk/goffice/graph/gog-object.h
==============================================================================
--- trunk/goffice/graph/gog-object.h (original)
+++ trunk/goffice/graph/gog-object.h Thu Aug 21 18:14:56 2008
@@ -139,7 +139,6 @@
#define IS_GOG_OBJECT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOG_OBJECT_TYPE))
#define GOG_OBJECT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOG_OBJECT_TYPE, GogObjectClass))
-#define GOG_PARAM_PERSISTENT (1 << (G_PARAM_USER_SHIFT+0))
#define GOG_PARAM_FORCE_SAVE (1 << (G_PARAM_USER_SHIFT+1)) /* even if the value == default */
#define GOG_PARAM_POSITION (1 << (G_PARAM_USER_SHIFT+2)) /* position parameters */
Modified: trunk/goffice/graph/gog-outlined-object.c
==============================================================================
--- trunk/goffice/graph/gog-outlined-object.c (original)
+++ trunk/goffice/graph/gog-outlined-object.c Thu Aug 21 18:14:56 2008
@@ -26,6 +26,7 @@
#include <goffice/graph/gog-graph.h>
#include <goffice/graph/gog-view.h>
#include <goffice/graph/gog-renderer.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/utils/go-units.h>
#include <glib/gi18n-lib.h>
@@ -80,7 +81,7 @@
_("Padding Pts"),
_("Number of pts separating charts in the grid"),
0, G_MAXDOUBLE, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/goffice/graph/gog-plot.c
==============================================================================
--- trunk/goffice/graph/gog-plot.c (original)
+++ trunk/goffice/graph/gog-plot.c Thu Aug 21 18:14:56 2008
@@ -32,6 +32,7 @@
#include <goffice/graph/gog-renderer.h>
#include <goffice/data/go-data.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-persist.h>
#include <glib/gi18n-lib.h>
#ifdef GOFFICE_WITH_GTK
@@ -529,25 +530,25 @@
_("Vary style by element"),
_("Use a different style for each segments"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT | GOG_PARAM_FORCE_SAVE));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT | GOG_PARAM_FORCE_SAVE));
g_object_class_install_property (gobject_klass, PLOT_PROP_AXIS_X,
g_param_spec_uint ("x-axis",
_("X axis"),
_("Reference to X axis"),
0, G_MAXINT, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, PLOT_PROP_AXIS_Y,
g_param_spec_uint ("y-axis",
_("Y axis"),
_("Reference to Y axis"),
0, G_MAXINT, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, PLOT_PROP_GROUP,
g_param_spec_string ("plot-group",
_("Plot group"),
_("Name of plot group if any"),
NULL,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, PLOT_PROP_GURU_HINTS,
g_param_spec_string ("guru-hints",
_("Guru hints"),
@@ -560,7 +561,7 @@
_("Default interpolation"),
_("Default type of series line interpolation"),
"linear",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_klass->children_reordered = gog_plot_children_reordered;
gog_object_register_roles (gog_klass, roles, G_N_ELEMENTS (roles));
Modified: trunk/goffice/graph/gog-reg-curve.c
==============================================================================
--- trunk/goffice/graph/gog-reg-curve.c (original)
+++ trunk/goffice/graph/gog-reg-curve.c Thu Aug 21 18:14:56 2008
@@ -34,6 +34,7 @@
#include <goffice/data/go-data.h>
#include <goffice/math/go-math.h>
#include <goffice/utils/go-line.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -196,7 +197,7 @@
_("Skip invalid"),
_("Skip invalid data"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/goffice/graph/gog-series.c
==============================================================================
--- trunk/goffice/graph/gog-series.c (original)
+++ trunk/goffice/graph/gog-series.c Thu Aug 21 18:14:56 2008
@@ -27,6 +27,7 @@
#include <goffice/graph/gog-style.h>
#include <goffice/graph/gog-error-bar.h>
#include <goffice/data/go-data.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -229,7 +230,7 @@
_("Index"),
_("Index of the corresponding data element"),
0, G_MAXINT, 0,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT | GOG_PARAM_FORCE_SAVE));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT | GOG_PARAM_FORCE_SAVE));
}
GSF_CLASS (GogSeriesElement, gog_series_element,
@@ -617,19 +618,19 @@
_("Has-legend"),
_("Should the series show up in legends"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, SERIES_PROP_INTERPOLATION,
g_param_spec_string ("interpolation",
_("Interpolation"),
_("Type of line interpolation"),
"linear",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, SERIES_PROP_FILL_TYPE,
g_param_spec_string ("fill-type",
_("Fill type"),
_("How to fill the area"),
"invalid",
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
klass->valid_fill_type_list = NULL;
Modified: trunk/goffice/graph/gog-style.c
==============================================================================
--- trunk/goffice/graph/gog-style.c (original)
+++ trunk/goffice/graph/gog-style.c Thu Aug 21 18:14:56 2008
@@ -31,6 +31,7 @@
#include <goffice/utils/go-image.h>
#include <goffice/utils/go-line.h>
#include <goffice/utils/go-marker.h>
+#include <goffice/utils/go-persist.h>
#ifdef GOFFICE_WITH_GTK
#include <goffice/gtk/goffice-gtk.h>
@@ -1635,7 +1636,7 @@
}
static gboolean
-gog_style_persist_dom_load (GogPersist *gp, xmlNode *node)
+gog_style_persist_dom_load (GOPersist *gp, xmlNode *node)
{
GogStyle *style = GOG_STYLE (gp);
xmlNode *ptr;
@@ -1797,7 +1798,7 @@
}
static void
-gog_style_persist_sax_save (GogPersist const *gp, GsfXMLOut *output)
+gog_style_persist_sax_save (GOPersist const *gp, GsfXMLOut *output)
{
GogStyle const *style = GOG_STYLE (gp);
@@ -1819,7 +1820,7 @@
}
static void
-gog_style_persist_prep_sax (GogPersist *gp, GsfXMLIn *xin, xmlChar const **attrs)
+gog_style_persist_prep_sax (GOPersist *gp, GsfXMLIn *xin, xmlChar const **attrs)
{
static GsfXMLInNode const dtd[] = {
GSF_XML_IN_NODE (STYLE, STYLE,
@@ -1871,7 +1872,7 @@
}
static void
-gog_style_persist_init (GogPersistClass *iface)
+gog_style_persist_init (GOPersistClass *iface)
{
iface->dom_load = gog_style_persist_dom_load;
iface->prep_sax = gog_style_persist_prep_sax;
@@ -1881,7 +1882,7 @@
GSF_CLASS_FULL (GogStyle, gog_style,
NULL, NULL, gog_style_class_init, NULL,
gog_style_init, G_TYPE_OBJECT, 0,
- GSF_INTERFACE (gog_style_persist_init, GOG_PERSIST_TYPE))
+ GSF_INTERFACE (gog_style_persist_init, GO_PERSIST_TYPE))
gboolean
gog_style_is_different_size (GogStyle const *a, GogStyle const *b)
Modified: trunk/goffice/graph/gog-style.h
==============================================================================
--- trunk/goffice/graph/gog-style.h (original)
+++ trunk/goffice/graph/gog-style.h Thu Aug 21 18:14:56 2008
@@ -119,7 +119,7 @@
} font;
struct {
double angle;
- gboolean auto_angle;
+ gboolean auto_angle;
} text_layout;
};
Modified: trunk/goffice/graph/gog-styled-object.c
==============================================================================
--- trunk/goffice/graph/gog-styled-object.c (original)
+++ trunk/goffice/graph/gog-styled-object.c Thu Aug 21 18:14:56 2008
@@ -25,6 +25,7 @@
#include <goffice/graph/gog-theme.h>
#include <goffice/graph/gog-graph.h>
#include <goffice/app/go-doc.h>
+#include <goffice/utils/go-persist.h>
#include <glib/gi18n-lib.h>
#include <gsf/gsf-impl-utils.h>
@@ -190,7 +191,7 @@
_("Style"),
_("A pointer to the GogStyle object"),
GOG_STYLE_TYPE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/goffice/utils/Makefile.am
==============================================================================
--- trunk/goffice/utils/Makefile.am (original)
+++ trunk/goffice/utils/Makefile.am Thu Aug 21 18:14:56 2008
@@ -26,7 +26,8 @@
\
go-glib-extras.c \
go-libxml-extras.c \
- go-pango-extras.c
+ go-pango-extras.c \
+ go-persist.c
libgoffice_utils_ladir = $(goffice_include_dir)/utils
libgoffice_utils_la_HEADERS = \
@@ -50,7 +51,8 @@
regutf8.h \
go-glib-extras.h \
go-libxml-extras.h \
- go-pango-extras.h
+ go-pango-extras.h \
+ go-persist.h
CLEANFILES = \
go-marshalers.h \
Added: trunk/goffice/utils/go-persist.c
==============================================================================
--- (empty file)
+++ trunk/goffice/utils/go-persist.c Thu Aug 21 18:14:56 2008
@@ -0,0 +1,63 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * go-persist.c :
+ *
+ * Copyright (C) 2003-2008 Jody Goldberg (jody gnome org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ */
+
+#include <goffice/goffice-config.h>
+#include <goffice/utils/go-persist.h>
+
+GType
+go_persist_get_type (void)
+{
+ static GType go_persist_type = 0;
+
+ if (!go_persist_type) {
+ static GTypeInfo const go_persist_info = {
+ sizeof (GOPersistClass), /* class_size */
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ };
+
+ go_persist_type = g_type_register_static (G_TYPE_INTERFACE,
+ "GOPersist", &go_persist_info, 0);
+ }
+
+ return go_persist_type;
+}
+
+gboolean
+gog_persist_dom_load (GOPersist *gp, xmlNode *node)
+{
+ g_return_val_if_fail (IS_GO_PERSIST (gp), FALSE);
+ return GO_PERSIST_GET_CLASS (gp)->dom_load (gp, node);
+}
+
+void
+gog_persist_sax_save (GOPersist const *gp, GsfXMLOut *output)
+{
+ g_return_if_fail (IS_GO_PERSIST (gp));
+ GO_PERSIST_GET_CLASS (gp)->sax_save (gp, output);
+}
+void
+gog_persist_prep_sax (GOPersist *gp, GsfXMLIn *xin, xmlChar const **attrs)
+{
+ g_return_if_fail (IS_GO_PERSIST (gp));
+ GO_PERSIST_GET_CLASS (gp)->prep_sax (gp, xin, attrs);
+}
+
Added: trunk/goffice/utils/go-persist.h
==============================================================================
--- (empty file)
+++ trunk/goffice/utils/go-persist.h Thu Aug 21 18:14:56 2008
@@ -0,0 +1,59 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * go-persist.h :
+ *
+ * Copyright (C) 2003-2008 Jody Goldberg (jody gnome org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ */
+#ifndef GO_PERSIST_H
+#define GO_PERSIST_H
+
+#include <goffice/utils/goffice-utils.h>
+#include <glib-object.h>
+#include <libxml/tree.h>
+#include <gsf/gsf-libxml.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GOPersist GOPersist;
+
+typedef struct {
+ GTypeInterface base;
+
+ gboolean (*dom_load) (GOPersist *gp, xmlNode *node);
+ void (*prep_sax) (GOPersist *gp, GsfXMLIn *xin, xmlChar const **attrs);
+ void (*sax_save) (GOPersist const *gp, GsfXMLOut *output);
+} GOPersistClass;
+
+#define GO_PERSIST_TYPE (gog_persist_get_type ())
+#define GO_PERSIST(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_PERSIST_TYPE, GOPersist))
+#define IS_GO_PERSIST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_PERSIST_TYPE))
+#define GO_PERSIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GO_PERSIST_TYPE, GOPersistClass))
+#define IS_GO_PERSIST_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GO_PERSIST_TYPE))
+#define GO_PERSIST_GET_CLASS(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GO_PERSIST_TYPE, GOPersistClass))
+
+GType gog_persist_get_type (void);
+
+gboolean go_persist_dom_load (GOPersist *gp, xmlNode *node);
+void go_persist_sax_save (GOPersist const *gp, GsfXMLOut *output);
+void go_persist_prep_sax (GOPersist *gp,
+ GsfXMLIn *xin, xmlChar const **attrs);
+
+#define GO_PARAM_PERSISTENT (1 << (G_PARAM_USER_SHIFT+0))
+
+G_END_DECLS
+
+#endif /* GO_PERSIST_H */
Modified: trunk/plugins/plot_pie/gog-pie.c
==============================================================================
--- trunk/plugins/plot_pie/gog-pie.c (original)
+++ trunk/plugins/plot_pie/gog-pie.c Thu Aug 21 18:14:56 2008
@@ -28,6 +28,7 @@
#include <goffice/data/go-data.h>
#include <goffice/math/go-math.h>
#include <goffice/utils/go-color.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/app/module-plugin-defs.h>
#include <glib/gi18n-lib.h>
@@ -106,7 +107,7 @@
_("Separation"),
_("Amount a slice is extended as a percentage of the radius"),
0, 1000, 0.,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
GSF_DYNAMIC_CLASS (GogPieSeriesElement, gog_pie_series_element,
@@ -233,13 +234,13 @@
_("Initial angle"),
_("Degrees clockwise from 12 O'Clock."),
0, G_MAXFLOAT, 0.,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, PLOT_PROP_DEFAULT_SEPARATION,
g_param_spec_float ("default-separation",
_("Default separation"),
_("Default amount a slice is extended as a percentage of the radius"),
0, G_MAXFLOAT, 0.,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, PLOT_PROP_IN_3D,
g_param_spec_boolean ("in-3d",
_("In 3d"),
@@ -251,7 +252,7 @@
_("Span"),
_("Total angle used as a percentage of the full circle"),
10., 100., 100.,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
{
static GogSeriesDimDesc dimensions[] = {
Modified: trunk/plugins/plot_radar/gog-radar.c
==============================================================================
--- trunk/plugins/plot_radar/gog-radar.c (original)
+++ trunk/plugins/plot_radar/gog-radar.c Thu Aug 21 18:14:56 2008
@@ -34,6 +34,7 @@
#include <goffice/math/go-math.h>
#include <goffice/utils/go-color.h>
#include <goffice/utils/go-marker.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/app/module-plugin-defs.h>
#include <glib/gi18n-lib.h>
@@ -206,14 +207,14 @@
_("Default markers"),
_("Should the default style of a series include markers"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass,
PLOT_PROP_DEFAULT_STYLE_HAS_FILL,
g_param_spec_boolean ("default-style-has-fill",
_("Default fill"),
_("Should the default style of a series include fill"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
/* Fill in GogPlotClass methods */
gog_plot_klass->desc.num_series_min = 1;
Modified: trunk/plugins/plot_surface/gog-xyz-surface.c
==============================================================================
--- trunk/plugins/plot_surface/gog-xyz-surface.c (original)
+++ trunk/plugins/plot_surface/gog-xyz-surface.c Thu Aug 21 18:14:56 2008
@@ -28,6 +28,7 @@
#include <goffice/math/go-math.h>
#include <goffice/utils/go-format.h>
#include <goffice/utils/go-path.h>
+#include <goffice/utils/go-persist.h>
#include <glib/gi18n-lib.h>
#include <gsf/gsf-impl-utils.h>
@@ -235,13 +236,13 @@
_("Rows"),
_("Number of rows"),
2, 1000, 10,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, XYZ_SURFACE_PROP_COLUMNS,
g_param_spec_uint ("columns",
_("Columns"),
_("Number of columns"),
2, 1000, 10,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_object_klass->type_name = gog_xyz_surface_plot_type_name;
gog_object_klass->update = gog_xyz_surface_plot_update;
Modified: trunk/plugins/plot_surface/gog-xyz.c
==============================================================================
--- trunk/plugins/plot_surface/gog-xyz.c (original)
+++ trunk/plugins/plot_surface/gog-xyz.c Thu Aug 21 18:14:56 2008
@@ -31,6 +31,7 @@
#include <goffice/graph/gog-chart.h>
#include <goffice/math/go-math.h>
#include <goffice/utils/go-format.h>
+#include <goffice/utils/go-persist.h>
#include <glib/gi18n-lib.h>
#include <gsf/gsf-impl-utils.h>
@@ -379,7 +380,7 @@
_("Transposed"),
_("Transpose the plot"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE|GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE|GO_PARAM_PERSISTENT));
/* Fill in GOGObject superclass values */
gog_object_klass->update = gog_xyz_plot_update;
Modified: trunk/plugins/plot_xy/gog-xy.c
==============================================================================
--- trunk/plugins/plot_xy/gog-xy.c (original)
+++ trunk/plugins/plot_xy/gog-xy.c Thu Aug 21 18:14:56 2008
@@ -36,6 +36,7 @@
#include <goffice/utils/go-format.h>
#include <goffice/math/go-math.h>
#include <goffice/utils/go-line.h>
+#include <goffice/utils/go-persist.h>
#include <goffice/app/module-plugin-defs.h>
#ifdef GOFFICE_WITH_GTK
@@ -342,25 +343,25 @@
_("Has markers by default"),
_("Should the default style of a series include markers"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_XY_PROP_DEFAULT_STYLE_HAS_LINES,
g_param_spec_boolean ("default-style-has-lines",
_("Has lines by default"),
_("Should the default style of a series include lines"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_XY_PROP_DEFAULT_STYLE_HAS_FILL,
g_param_spec_boolean ("default-style-has-fill",
_("Has fill by default"),
_("Should the default style of a series include fill"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_XY_PROP_USE_SPLINES,
g_param_spec_boolean ("use-splines",
_("Use splines"),
_("Should the plot use splines instead of linear interpolation"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_klass->type_name = gog_xy_plot_type_name;
{
@@ -511,25 +512,25 @@
_("Size as area"),
_("Display size as area instead of diameter"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_BUBBLE_PROP_SHOW_NEGATIVES,
g_param_spec_boolean ("show-negatives",
_("Show negatives"),
_("Draw bubbles for negative values"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_BUBBLE_PROP_IN_3D,
g_param_spec_boolean ("in-3d",
_("In 3d"),
_("Draw 3d bubbles"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_BUBBLE_PROP_SCALE,
g_param_spec_float ("bubble-scale",
_("Bubble scale"),
_("Fraction of default radius used for display"),
0., 3., 1.,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
{
static GogSeriesDimDesc dimensions[] = {
{ N_("X"), GOG_SERIES_SUGGESTED, FALSE,
@@ -771,19 +772,19 @@
_("Has lines by default"),
_("Should the default style of a series include lines"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_XY_COLOR_PROP_DEFAULT_STYLE_HAS_FILL,
g_param_spec_boolean ("default-style-has-fill",
_("Has fill by default"),
_("Should the default style of a series include fill"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, GOG_XY_COLOR_PROP_HIDE_OUTLIERS,
g_param_spec_boolean ("hide-outliers",
_("hide-outliers"),
_("Hide data outside of the color axis bounds"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
gog_klass->type_name = gog_xy_color_plot_type_name;
gog_klass->update = gog_xy_color_plot_update;
gog_klass->populate_editor = gog_xy_color_plot_populate_editor;
@@ -1661,19 +1662,19 @@
_("X error bars"),
_("GogErrorBar *"),
GOG_ERROR_BAR_TYPE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, SERIES_PROP_YERRORS,
g_param_spec_object ("y-errors",
_("Y error bars"),
_("GogErrorBar *"),
GOG_ERROR_BAR_TYPE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, SERIES_PROP_INVALID_AS_ZERO,
g_param_spec_boolean ("invalid-as-zero",
_("Invalid as zero"),
_("Replace invalid values by 0 when drawing markers or bubbles"),
FALSE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
series_klass->valid_fill_type_list = valid_fill_type_list;
}
Modified: trunk/plugins/reg_linear/gog-lin-reg.c
==============================================================================
--- trunk/plugins/reg_linear/gog-lin-reg.c (original)
+++ trunk/plugins/reg_linear/gog-lin-reg.c Thu Aug 21 18:14:56 2008
@@ -29,6 +29,7 @@
#include <goffice/data/go-data.h>
#include <goffice/graph/gog-series-impl.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-persist.h>
#include <glib/gi18n-lib.h>
#include <gsf/gsf-impl-utils.h>
@@ -264,13 +265,13 @@
_("Affine"),
_("If true, a non-zero constant is allowed"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, REG_LIN_REG_CURVE_PROP_DIMS,
g_param_spec_uint ("dims",
_("Dims"),
_("Number of x-vectors"),
1, 10, 1,
- GSF_PARAM_STATIC | G_PARAM_READWRITE|GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE|GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/plugins/smoothing/gog-exp-smooth.c
==============================================================================
--- trunk/plugins/smoothing/gog-exp-smooth.c (original)
+++ trunk/plugins/smoothing/gog-exp-smooth.c Thu Aug 21 18:14:56 2008
@@ -26,6 +26,7 @@
#include <goffice/graph/gog-data-allocator.h>
#include <goffice/math/go-math.h>
#include <goffice/math/go-rangefunc.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -232,7 +233,7 @@
_("Steps"),
_("Number of interpolation steps"),
10, G_MAXINT, 100,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
Modified: trunk/plugins/smoothing/gog-moving-avg.c
==============================================================================
--- trunk/plugins/smoothing/gog-moving-avg.c (original)
+++ trunk/plugins/smoothing/gog-moving-avg.c Thu Aug 21 18:14:56 2008
@@ -23,6 +23,7 @@
#include "gog-moving-avg.h"
#include <goffice/app/go-plugin.h>
#include <goffice/math/go-math.h>
+#include <goffice/utils/go-persist.h>
#include <gsf/gsf-impl-utils.h>
#include <glib/gi18n-lib.h>
@@ -196,13 +197,13 @@
_("Span"),
_("Number of averaged values"),
2, G_MAXINT, 3,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
g_object_class_install_property (gobject_klass, MOVING_AVG_PROP_XAVG,
g_param_spec_boolean ("xavg",
_("Average X"),
_("Use averaged x values"),
TRUE,
- GSF_PARAM_STATIC | G_PARAM_READWRITE | GOG_PARAM_PERSISTENT));
+ GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]