Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goffice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
42
Issues
42
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
goffice
Commits
7630cac9
Commit
7630cac9
authored
Jan 17, 2004
by
Jean Bréfort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bubble plots added
parent
2bd44088
Changes
103
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
103 changed files
with
275 additions
and
27239 deletions
+275
-27239
ChangeLog
ChangeLog
+0
-1545
Makefile.am
Makefile.am
+0
-19
goffice/data/Makefile.am
goffice/data/Makefile.am
+0
-8
goffice/data/go-data-impl.h
goffice/data/go-data-impl.h
+0
-87
goffice/data/go-data-simple.c
goffice/data/go-data-simple.c
+0
-255
goffice/data/go-data-simple.h
goffice/data/go-data-simple.h
+0
-43
goffice/data/go-data.c
goffice/data/go-data.c
+0
-331
goffice/data/go-data.h
goffice/data/go-data.h
+0
-69
goffice/goffice.c
goffice/goffice.c
+0
-64
goffice/goffice.h
goffice/goffice.h
+0
-33
goffice/graph/Makefile.am
goffice/graph/Makefile.am
+0
-85
goffice/graph/README
goffice/graph/README
+0
-30
goffice/graph/goffice-graph.h
goffice/graph/goffice-graph.h
+0
-146
goffice/graph/gog-axis-prefs.glade
goffice/graph/gog-axis-prefs.glade
+0
-372
goffice/graph/gog-axis.c
goffice/graph/gog-axis.c
+0
-1405
goffice/graph/gog-axis.h
goffice/graph/gog-axis.h
+0
-66
goffice/graph/gog-chart-impl.h
goffice/graph/gog-chart-impl.h
+0
-55
goffice/graph/gog-chart.c
goffice/graph/gog-chart.c
+0
-647
goffice/graph/gog-chart.h
goffice/graph/gog-chart.h
+0
-58
goffice/graph/gog-control-foocanvas.c
goffice/graph/gog-control-foocanvas.c
+0
-278
goffice/graph/gog-control-foocanvas.h
goffice/graph/gog-control-foocanvas.h
+0
-38
goffice/graph/gog-data-allocator.c
goffice/graph/gog-data-allocator.c
+0
-61
goffice/graph/gog-data-allocator.h
goffice/graph/gog-data-allocator.h
+0
-53
goffice/graph/gog-data-set.c
goffice/graph/gog-data-set.c
+0
-208
goffice/graph/gog-data-set.h
goffice/graph/gog-data-set.h
+0
-69
goffice/graph/gog-graph-impl.h
goffice/graph/gog-graph-impl.h
+0
-60
goffice/graph/gog-graph.c
goffice/graph/gog-graph.c
+0
-580
goffice/graph/gog-graph.h
goffice/graph/gog-graph.h
+0
-54
goffice/graph/gog-grid.c
goffice/graph/gog-grid.c
+0
-108
goffice/graph/gog-grid.h
goffice/graph/gog-grid.h
+0
-37
goffice/graph/gog-guru.c
goffice/graph/gog-guru.c
+0
-1386
goffice/graph/gog-guru.glade
goffice/graph/gog-guru.glade
+0
-409
goffice/graph/gog-guru.h
goffice/graph/gog-guru.h
+0
-40
goffice/graph/gog-label.c
goffice/graph/gog-label.c
+0
-235
goffice/graph/gog-label.h
goffice/graph/gog-label.h
+0
-37
goffice/graph/gog-legend.c
goffice/graph/gog-legend.c
+0
-376
goffice/graph/gog-legend.h
goffice/graph/gog-legend.h
+0
-37
goffice/graph/gog-object-xml.c
goffice/graph/gog-object-xml.c
+0
-397
goffice/graph/gog-object-xml.h
goffice/graph/gog-object-xml.h
+0
-57
goffice/graph/gog-object.c
goffice/graph/gog-object.c
+0
-835
goffice/graph/gog-object.h
goffice/graph/gog-object.h
+0
-153
goffice/graph/gog-outlined-object.c
goffice/graph/gog-outlined-object.c
+0
-162
goffice/graph/gog-outlined-object.h
goffice/graph/gog-outlined-object.h
+0
-56
goffice/graph/gog-plot-engine.c
goffice/graph/gog-plot-engine.c
+0
-421
goffice/graph/gog-plot-engine.h
goffice/graph/gog-plot-engine.h
+0
-58
goffice/graph/gog-plot-impl.h
goffice/graph/gog-plot-impl.h
+0
-95
goffice/graph/gog-plot.c
goffice/graph/gog-plot.c
+0
-472
goffice/graph/gog-plot.h
goffice/graph/gog-plot.h
+0
-66
goffice/graph/gog-renderer-gnome-print.c
goffice/graph/gog-renderer-gnome-print.c
+0
-548
goffice/graph/gog-renderer-gnome-print.h
goffice/graph/gog-renderer-gnome-print.h
+0
-36
goffice/graph/gog-renderer-impl.h
goffice/graph/gog-renderer-impl.h
+0
-85
goffice/graph/gog-renderer-pixbuf.c
goffice/graph/gog-renderer-pixbuf.c
+0
-701
goffice/graph/gog-renderer-pixbuf.h
goffice/graph/gog-renderer-pixbuf.h
+0
-42
goffice/graph/gog-renderer-svg.c
goffice/graph/gog-renderer-svg.c
+0
-636
goffice/graph/gog-renderer-svg.h
goffice/graph/gog-renderer-svg.h
+0
-35
goffice/graph/gog-renderer.c
goffice/graph/gog-renderer.c
+0
-511
goffice/graph/gog-renderer.h
goffice/graph/gog-renderer.h
+0
-64
goffice/graph/gog-series-impl.h
goffice/graph/gog-series-impl.h
+0
-84
goffice/graph/gog-series.c
goffice/graph/gog-series.c
+0
-391
goffice/graph/gog-series.h
goffice/graph/gog-series.h
+0
-45
goffice/graph/gog-style-prefs.glade
goffice/graph/gog-style-prefs.glade
+0
-1466
goffice/graph/gog-style.c
goffice/graph/gog-style.c
+0
-1731
goffice/graph/gog-style.h
goffice/graph/gog-style.h
+0
-144
goffice/graph/gog-styled-object.c
goffice/graph/gog-styled-object.c
+0
-211
goffice/graph/gog-styled-object.h
goffice/graph/gog-styled-object.h
+0
-58
goffice/graph/gog-theme.c
goffice/graph/gog-theme.c
+0
-505
goffice/graph/gog-theme.h
goffice/graph/gog-theme.h
+0
-50
goffice/graph/gog-view.c
goffice/graph/gog-view.c
+0
-578
goffice/graph/gog-view.h
goffice/graph/gog-view.h
+0
-81
goffice/gtk/go-charmap-sel.c
goffice/gtk/go-charmap-sel.c
+0
-674
goffice/gtk/go-charmap-sel.h
goffice/gtk/go-charmap-sel.h
+0
-54
goffice/gtk/go-color-group.c
goffice/gtk/go-color-group.c
+0
-331
goffice/gtk/go-color-group.h
goffice/gtk/go-color-group.h
+0
-76
goffice/gtk/go-color-palette.c
goffice/gtk/go-color-palette.c
+0
-615
goffice/gtk/go-color-palette.h
goffice/gtk/go-color-palette.h
+0
-109
goffice/gtk/go-combo-box.c
goffice/gtk/go-combo-box.c
+0
-864
goffice/gtk/go-combo-box.h
goffice/gtk/go-combo-box.h
+0
-91
goffice/gtk/go-combo-color.c
goffice/gtk/go-combo-color.c
+0
-379
goffice/gtk/go-combo-color.h
goffice/gtk/go-combo-color.h
+0
-87
goffice/gtk/go-combo-pixmaps.c
goffice/gtk/go-combo-pixmaps.c
+0
-246
goffice/gtk/go-combo-pixmaps.h
goffice/gtk/go-combo-pixmaps.h
+0
-75
goffice/gtk/go-locale-sel.c
goffice/gtk/go-locale-sel.c
+0
-679
goffice/gtk/go-locale-sel.h
goffice/gtk/go-locale-sel.h
+0
-49
goffice/utils/Makefile.am
goffice/utils/Makefile.am
+0
-25
goffice/utils/go-color.c
goffice/utils/go-color.c
+0
-403
goffice/utils/go-color.h
goffice/utils/go-color.h
+0
-120
goffice/utils/go-font.c
goffice/utils/go-font.c
+0
-180
goffice/utils/go-font.h
goffice/utils/go-font.h
+0
-54
goffice/utils/go-format.c
goffice/utils/go-format.c
+0
-125
goffice/utils/go-format.h
goffice/utils/go-format.h
+0
-43
goffice/utils/go-gradient.c
goffice/utils/go-gradient.c
+0
-210
goffice/utils/go-gradient.h
goffice/utils/go-gradient.h
+0
-61
goffice/utils/go-marker.c
goffice/utils/go-marker.c
+0
-624
goffice/utils/go-marker.h
goffice/utils/go-marker.h
+0
-97
goffice/utils/go-pattern.c
goffice/utils/go-pattern.c
+0
-576
goffice/utils/go-pattern.h
goffice/utils/go-pattern.h
+0
-77
goffice/utils/go-units.h
goffice/utils/go-units.h
+0
-43
goffice/utils/goffice-utils.h
goffice/utils/goffice-utils.h
+0
-38
plugins/Makefile.am
plugins/Makefile.am
+0
-1
plugins/plot_xy/gog-xy.c
plugins/plot_xy/gog-xy.c
+244
-74
plugins/plot_xy/gog-xy.h
plugins/plot_xy/gog-xy.h
+20
-0
plugins/plot_xy/plot-types.xml.in
plugins/plot_xy/plot-types.xml.in
+6
-0
plugins/plot_xy/plugin.xml.in
plugins/plot_xy/plugin.xml.in
+5
-1
No files found.
ChangeLog
deleted
100644 → 0
View file @
2bd44088
This diff is collapsed.
Click to expand it.
Makefile.am
deleted
100644 → 0
View file @
2bd44088
SUBDIRS
=
graph utils
# data
noinst_LTLIBRARIES
=
libgoffice.la
libgoffice_la_LIBADD
=
\
utils/libgoffice-utils.la
\
graph/libgoffice-graph.la
libgoffice_la_SOURCES
=
\
goffice.c
\
goffice.h
# prune this when the code moves
INCLUDES
=
-I
$(top_srcdir)
\
-I
$(top_srcdir)
/src
\
-I
$(top_srcdir)
/src/cut-n-paste-code
\
-I
$(top_srcdir)
/src/cut-n-paste-code/foocanvas
\
$(GNUMERIC_CFLAGS)
goffice/data/Makefile.am
deleted
100644 → 0
View file @
2bd44088
gradient_iconsdir
=
$(gnumeric_gladedir)
gradient_icons_DATA
=
\
gradient_n2s.png
\
gradient_ne2sw.png
\
gradient_nw2se.png
\
gradient_w2e.png
EXTRA_DIST
=
$(gradient_icons_DATA)
goffice/data/go-data-impl.h
deleted
100644 → 0
View file @
2bd44088
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* go-data-impl.h :
*
* Copyright (C) 2003 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#ifndef GO_DATA_IMPL_H
#define GO_DATA_IMPL_H
#include <goffice/graph/goffice-graph.h>
#include <goffice/graph/go-data.h>
#include <glib-object.h>
G_BEGIN_DECLS
typedef
enum
{
GO_DATA_CACHE_IS_VALID
=
1
<<
0
,
GO_DATA_IS_EDITABLE
=
1
<<
1
,
GO_DATA_VECTOR_LEN_CACHED
=
1
<<
2
}
GODataFlags
;
struct
_GOData
{
GObject
base
;
gint32
flags
;
/* dunno what to do with these yet */
};
typedef
struct
{
GObjectClass
base
;
GOData
*
(
*
dup
)
(
GOData
const
*
src
);
gboolean
(
*
eq
)
(
GOData
const
*
a
,
GOData
const
*
b
);
GOFormat
*
(
*
preferred_fmt
)
(
GOData
const
*
dat
);
char
*
(
*
as_str
)
(
GOData
const
*
dat
);
gboolean
(
*
from_str
)
(
GOData
*
dat
,
char
const
*
str
);
void
(
*
emit_changed
)
(
GOData
*
dat
);
/* signals */
void
(
*
changed
)
(
GOData
*
dat
);
}
GODataClass
;
/* protected */
void
go_data_emit_changed
(
GOData
*
dat
);
struct
_GODataScalar
{
GOData
base
;
};
typedef
struct
{
GODataClass
base
;
double
(
*
get_value
)
(
GODataScalar
*
scalar
);
char
const
*
(
*
get_str
)
(
GODataScalar
*
scalar
);
/* PangoLayout *(get_fmt_str) (GODataScalar *scalar); */
}
GODataScalarClass
;
struct
_GODataVector
{
GOData
base
;
int
len
;
/* negative if dirty, includes missing values */
double
*
values
;
/* NULL = inititialized/unsupported, nan = missing */
double
minimum
,
maximum
;
};
typedef
struct
{
GODataClass
base
;
void
(
*
load_len
)
(
GODataVector
*
vec
);
void
(
*
load_values
)
(
GODataVector
*
vec
);
double
(
*
get_value
)
(
GODataVector
*
vec
,
unsigned
i
);
char
*
(
*
get_str
)
(
GODataVector
*
vec
,
unsigned
i
);
/* PangoLayout *(get_fmt_str) (GODataVector *vec, unsigned i); */
}
GODataVectorClass
;
G_END_DECLS
#endif
/* GO_DATA_IMPL_H */
goffice/data/go-data-simple.c
deleted
100644 → 0
View file @
2bd44088
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* go-data-simple.c :
*
* Copyright (C) 2003 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <gnumeric-config.h>
#include <goffice/graph/go-data-simple.h>
#include <goffice/graph/go-data-impl.h>
#include <gsf/gsf-impl-utils.h>
#include <src/gnumeric-i18n.h>
#include <src/mathfunc.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
struct
_GODataScalarVal
{
GODataScalar
base
;
double
val
;
char
*
str
;
};
typedef
GODataScalarClass
GODataScalarValClass
;
static
GObjectClass
*
scalar_val_parent_klass
;
static
void
go_data_scalar_val_finalize
(
GObject
*
obj
)
{
GODataScalarVal
*
val
=
(
GODataScalarVal
*
)
obj
;
if
(
val
->
str
!=
NULL
)
{
g_free
(
val
->
str
);
val
->
str
=
NULL
;
}
if
(
scalar_val_parent_klass
->
finalize
)
(
*
scalar_val_parent_klass
->
finalize
)
(
obj
);
}
static
GOData
*
go_data_scalar_val_dup
(
GOData
const
*
src
)
{
GODataScalarVal
*
dst
=
g_object_new
(
G_OBJECT_TYPE
(
src
),
NULL
);
GODataScalarVal
const
*
src_val
=
(
GODataScalarVal
const
*
)
src
;
dst
->
val
=
src_val
->
val
;
return
GO_DATA
(
dst
);
}
static
gboolean
go_data_scalar_val_eq
(
GOData
const
*
a
,
GOData
const
*
b
)
{
GODataScalarVal
const
*
sval_a
=
(
GODataScalarVal
const
*
)
a
;
GODataScalarVal
const
*
sval_b
=
(
GODataScalarVal
const
*
)
b
;
/* GOData::eq is used for identity, not arithamtic */
return
sval_a
->
val
==
sval_b
->
val
;
}
static
char
*
go_data_scalar_val_as_str
(
GOData
const
*
dat
)
{
return
g_strdup
(
go_data_scalar_get_str
(
GO_DATA_SCALAR
(
dat
)));
}
static
gboolean
go_data_scalar_val_from_str
(
GOData
*
dat
,
char
const
*
str
)
{
GODataScalarVal
*
sval
=
(
GODataScalarVal
*
)
dat
;
double
tmp
;
char
*
end
;
errno
=
0
;
/* strto(ld) sets errno, but does not clear it. */
tmp
=
strtod
(
str
,
&
end
);
if
(
end
==
str
||
*
end
!=
'\0'
||
errno
==
ERANGE
)
return
FALSE
;
g_free
(
sval
->
str
);
sval
->
str
=
NULL
;
sval
->
val
=
tmp
;
return
TRUE
;
}
static
double
go_data_scalar_val_get_value
(
GODataScalar
*
dat
)
{
GODataScalarVal
const
*
sval
=
(
GODataScalarVal
const
*
)
dat
;
return
sval
->
val
;
}
static
char
const
*
go_data_scalar_val_get_str
(
GODataScalar
*
dat
)
{
GODataScalarVal
*
sval
=
(
GODataScalarVal
*
)
dat
;
if
(
sval
->
str
==
NULL
)
sval
->
str
=
g_strdup_printf
(
"%g"
,
sval
->
val
);
return
sval
->
str
;
}
static
void
go_data_scalar_val_class_init
(
GObjectClass
*
gobject_klass
)
{
GODataClass
*
godata_klass
=
(
GODataClass
*
)
gobject_klass
;
GODataScalarClass
*
scalar_klass
=
(
GODataScalarClass
*
)
gobject_klass
;
scalar_val_parent_klass
=
g_type_class_peek_parent
(
gobject_klass
);
gobject_klass
->
finalize
=
go_data_scalar_val_finalize
;
godata_klass
->
dup
=
go_data_scalar_val_dup
;
godata_klass
->
eq
=
go_data_scalar_val_eq
;
godata_klass
->
as_str
=
go_data_scalar_val_as_str
;
godata_klass
->
from_str
=
go_data_scalar_val_from_str
;
scalar_klass
->
get_value
=
go_data_scalar_val_get_value
;
scalar_klass
->
get_str
=
go_data_scalar_val_get_str
;
}
GSF_CLASS
(
GODataScalarVal
,
go_data_scalar_val
,
go_data_scalar_val_class_init
,
NULL
,
GO_DATA_SCALAR_TYPE
)
GOData
*
go_data_scalar_val_new
(
double
val
)
{
GODataScalarVal
*
res
=
g_object_new
(
GO_DATA_SCALAR_VAL_TYPE
,
NULL
);
res
->
val
=
val
;
return
GO_DATA
(
res
);
}
/*****************************************************************************/
struct
_GODataScalarStr
{
GODataScalar
base
;
char
const
*
str
;
gboolean
needs_free
;
};
typedef
GODataScalarClass
GODataScalarStrClass
;
static
GObjectClass
*
scalar_str_parent_klass
;
static
void
go_data_scalar_str_finalize
(
GObject
*
obj
)
{
GODataScalarStr
*
str
=
(
GODataScalarStr
*
)
obj
;
if
(
str
->
needs_free
&&
str
->
str
!=
NULL
)
{
g_free
((
char
*
)
str
->
str
);
str
->
str
=
NULL
;
}
if
(
scalar_str_parent_klass
->
finalize
)
(
*
scalar_str_parent_klass
->
finalize
)
(
obj
);
}
static
GOData
*
go_data_scalar_str_dup
(
GOData
const
*
src
)
{
GODataScalarStr
*
dst
=
g_object_new
(
G_OBJECT_TYPE
(
src
),
NULL
);
GODataScalarStr
const
*
src_val
=
(
GODataScalarStr
const
*
)
src
;
dst
->
needs_free
=
TRUE
;
dst
->
str
=
g_strdup
(
src_val
->
str
);
return
GO_DATA
(
dst
);
}
static
gboolean
go_data_scalar_str_eq
(
GOData
const
*
a
,
GOData
const
*
b
)
{
GODataScalarStr
const
*
str_a
=
(
GODataScalarStr
const
*
)
a
;
GODataScalarStr
const
*
str_b
=
(
GODataScalarStr
const
*
)
b
;
return
0
==
strcmp
(
str_a
->
str
,
str_b
->
str
);
}
static
char
*
go_data_scalar_str_as_str
(
GOData
const
*
dat
)
{
GODataScalarStr
const
*
str
=
(
GODataScalarStr
const
*
)
dat
;
return
g_strdup
(
str
->
str
);
}
static
gboolean
go_data_scalar_str_from_str
(
GOData
*
dat
,
char
const
*
string
)
{
GODataScalarStr
*
str
=
(
GODataScalarStr
*
)
dat
;
if
(
str
->
str
==
string
)
return
TRUE
;
if
(
str
->
needs_free
)
g_free
((
char
*
)
str
->
str
);
str
->
str
=
g_strdup
(
string
);
return
TRUE
;
}
static
double
go_data_scalar_str_get_value
(
GODataScalar
*
dat
)
{
return
gnm_nan
;
}
static
char
const
*
go_data_scalar_str_get_str
(
GODataScalar
*
dat
)
{
GODataScalarStr
const
*
str
=
(
GODataScalarStr
const
*
)
dat
;
return
str
->
str
;
}
static
void
go_data_scalar_str_class_init
(
GObjectClass
*
gobject_klass
)
{
GODataClass
*
godata_klass
=
(
GODataClass
*
)
gobject_klass
;
GODataScalarClass
*
scalar_klass
=
(
GODataScalarClass
*
)
gobject_klass
;
scalar_str_parent_klass
=
g_type_class_peek_parent
(
gobject_klass
);
gobject_klass
->
finalize
=
go_data_scalar_str_finalize
;
godata_klass
->
dup
=
go_data_scalar_str_dup
;
godata_klass
->
eq
=
go_data_scalar_str_eq
;
godata_klass
->
as_str
=
go_data_scalar_str_as_str
;
godata_klass
->
from_str
=
go_data_scalar_str_from_str
;
scalar_klass
->
get_value
=
go_data_scalar_str_get_value
;
scalar_klass
->
get_str
=
go_data_scalar_str_get_str
;
}
static
void
go_data_scalar_str_init
(
GObject
*
obj
)
{
GODataScalarStr
*
str
=
(
GODataScalarStr
*
)
obj
;
str
->
str
=
""
;
str
->
needs_free
=
FALSE
;
}
GSF_CLASS
(
GODataScalarStr
,
go_data_scalar_str
,
go_data_scalar_str_class_init
,
go_data_scalar_str_init
,
GO_DATA_SCALAR_TYPE
)
GOData
*
go_data_scalar_str_new
(
char
const
*
str
,
gboolean
needs_free
)
{
GODataScalarStr
*
res
=
g_object_new
(
GO_DATA_SCALAR_STR_TYPE
,
NULL
);
res
->
str
=
str
;
res
->
needs_free
=
needs_free
;
return
GO_DATA
(
res
);
}
goffice/data/go-data-simple.h
deleted
100644 → 0
View file @
2bd44088
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* go-data-simple.h :
*
* Copyright (C) 2003 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#ifndef GO_DATA_SIMPLE_H
#define GO_DATA_SIMPLE_H
#include <goffice/graph/goffice-graph.h>
#include <goffice/graph/go-data.h>
#define GO_DATA_SCALAR_VAL_TYPE (go_data_scalar_val_get_type ())
#define GO_DATA_SCALAR_VAL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_SCALAR_VAL_TYPE, GODataScalarVal))
#define IS_GO_DATA_SCALAR_VAL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_DATA_SCALAR_VAL_TYPE))
typedef
struct
_GODataScalarVal
GODataScalarVal
;
GType
go_data_scalar_val_get_type
(
void
);
GOData
*
go_data_scalar_val_new
(
double
val
);
#define GO_DATA_SCALAR_STR_TYPE (go_data_scalar_str_get_type ())
#define GO_DATA_SCALAR_STR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GO_DATA_SCALAR_STR_TYPE, GODataScalarStr))
#define IS_GO_DATA_SCALAR_STR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GO_DATA_SCALAR_STR_TYPE))
typedef
struct
_GODataScalarStr
GODataScalarStr
;
GType
go_data_scalar_str_get_type
(
void
);
GOData
*
go_data_scalar_str_new
(
char
const
*
str
,
gboolean
needs_free
);
#endif
/* GO_DATA_SIMPLE_H */
goffice/data/go-data.c
deleted
100644 → 0
View file @
2bd44088
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* go-data.c :
*
* Copyright (C) 2003 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
#include <gnumeric-config.h>
#include <goffice/graph/go-data.h>
#include <goffice/graph/go-data-impl.h>
#include <gsf/gsf-impl-utils.h>
#include <src/gnumeric-i18n.h>
#include <string.h>
#include <src/mathfunc.h>
#define GO_DATA_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GO_DATA_TYPE, GODataClass))
#define IS_GO_DATA_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GO_DATA_TYPE))
#define GO_DATA_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GO_DATA_TYPE, GODataClass))
enum
{
CHANGED
,
LAST_SIGNAL
};
static
gulong
go_data_signals
[
LAST_SIGNAL
]
=
{
0
,
};
/* trivial fall back */
static
GOData
*
go_data_dup_real
(
GOData
const
*
src
)
{
char
*
str
=
go_data_as_str
(
src
);
GOData
*
dst
=
g_object_new
(
G_OBJECT_TYPE
(
src
),
NULL
);
if
(
dst
!=
NULL
)
go_data_from_str
(
dst
,
str
);
g_free
(
str
);
return
dst
;
}
static
void
go_data_init
(
GOData
*
data
)
{
data
->
flags
=
0
;
}
#if 0
static GObjectClass *parent_klass;
static void
go_data_finalize (GOData *obj)
{
g_warning ("finalize");
if (parent_klass->finalize)
(parent_klass->finalize) (obj);
}
#endif
static
void
go_data_class_init
(
GODataClass
*
klass
)
{
go_data_signals
[
CHANGED
]
=
g_signal_new
(
"changed"
,
G_TYPE_FROM_CLASS
(
klass
),
G_SIGNAL_RUN_LAST
,
G_STRUCT_OFFSET
(
GODataClass
,
changed
),
NULL
,
NULL
,
g_cclosure_marshal_VOID__VOID
,
G_TYPE_NONE
,
0
);
klass
->
dup
=
go_data_dup_real
;
#if 0
{
GObjectClass *gobj_klass = (GObjectClass *)klass;
gobj_klass->finalize = go_data_finalize;
parent_klass = g_type_class_peek_parent (klass);
}
#endif
}
GSF_CLASS_ABSTRACT
(
GOData
,
go_data
,
go_data_class_init
,
go_data_init
,
G_TYPE_OBJECT
)
/**
* go_data_dup :
* @src : #GOData
*
* A deep copy of @src.
**/
GOData
*
go_data_dup
(
GOData
const
*
src
)
{
if
(
src
!=
NULL
)
{
GODataClass
const
*
klass
=
GO_DATA_GET_CLASS
(
src
);
g_return_val_if_fail
(
klass
!=
NULL
,
NULL
);
return
(
*
klass
->
dup
)
(
src
);
}
return
NULL
;
}
/**
* go_data_eq :
* @a : #GOData
* @b : #GOData
*
* Returns TRUE if @a and @b are the same
**/
gboolean
go_data_eq
(
GOData
const
*
a
,
GOData
const
*
b
)
{
if
(
a
==
b
)
return
TRUE
;
else
{
GODataClass
*
a_klass
=
GO_DATA_GET_CLASS
(
a
);
GODataClass
*
b_klass
=
GO_DATA_GET_CLASS
(
b
);
g_return_val_if_fail
(
a_klass
!=
NULL
,
FALSE
);
g_return_val_if_fail
(
a_klass
->
eq
!=
NULL
,
FALSE
);
if
(
a_klass
!=
b_klass
)
return
FALSE
;
return
(
*
a_klass
->
eq
)
(
a
,
b
);
}
}
/**
* go_data_prefered_fmt :
* @dat : #GOData
*
* Caller is responsible for unrefing the result.
* Returns the fmt preferred by the the data
**/
GOFormat
*
go_data_preferred_fmt
(
GOData
const
*
dat
)
{
GODataClass
const
*
klass
=
GO_DATA_GET_CLASS
(
dat
);
g_return_val_if_fail
(
klass
!=
NULL
,
NULL
);
if
(
klass
->
preferred_fmt
)
return
(
*
klass
->
preferred_fmt
)
(
dat
);
return
NULL
;
}
/**
* go_data_as_str :
* @dat : #GOData
*
* Return a string representation of the data source that the caller is
* responsible for freeing
*
* NOTE : This is the _source_ not the content.
**/
char
*
go_data_as_str
(
GOData
const
*
dat
)
{
GODataClass
const
*
klass
=
GO_DATA_GET_CLASS
(
dat
);
g_return_val_if_fail
(
klass
!=
NULL
,
NULL
);