Commit fa9c94f3 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Failure is a warning, not catastrophic

2004-06-26  Jody Goldberg <jody@gnome.org>

	* boot.c (excel_read_metadata) : Failure is a warning, not
	  catastrophic

	* ms-chart.c (ms_excel_chart_write) : do not write FBI
	(chart_write_axis_sets) : Handle transposed X-Y (bars)

2004-07-02  Jody Goldberg <jody@gnome.org>

	* graph/gog-theme.c (map_area_series_solid_default) : simplify now
	  that we're just filling in the color no need to twiddle types

	* graph/gog-style.c : rework GogStyle::fill share pattern:fore/back
	and gradient:start/end.
	merge all the different auto flags.
	initialize the gradient brightness to -1 to avoid starting with black
	Change fill from union to struct to simplify changing fill types
	Allow themed gradient fills


2004-07-01  Jody Goldberg <jody@gnome.org>

	* src/cmd-edit.c (sv_select_cur_depends) : find deps even for empty
	  cells.

2004-06-30  Jody Goldberg <jody@gnome.org>

	* src/stf.c (stf_init) : cvs exporter is one sheet only

	* src/gnumeric-gconf.c (get_schema) : typo
	(go_conf_get_type) : implement for #ifdef WITH_GNOME
parent 862dee98
2004-07-01 Jody Goldberg <jody@gnome.org>
* src/cmd-edit.c (sv_select_cur_depends) : find deps even for empty
cells.
2004-06-30 Jody Goldberg <jody@gnome.org>
* src/stf.c (stf_init) : cvs exporter is one sheet only
* src/gnumeric-gconf.c (get_schema) : typo
(go_conf_get_type) : implement for #ifdef WITH_GNOME
2004-06-23 Jean Brefort <jean.brefort@ac-dijon.fr>
* configure.in:
......
......@@ -50,12 +50,15 @@ Jody:
* Use first rather than last conditional value fmt as catch-all
* Implicit iteration for operators
* Make the unary operators XL compatible
* start work on xls export for charts
* basic xls export for charts
* start work on OOo export
* Skip ticks/labels for discrete axes
* Drag files from nautilus -> gnumeric
http://bugzilla.gnome.org/show_bug.cgi?id=143577
* fix grid printing
* fix merged cell printing and diagonal borders
* Allow themed series with gradients
* Fix prop dialog
Morten:
* Fix crash related to database functions (#138600). [backported]
......
2004-07-01 Jody Goldberg <jody@gnome.org>
* src/cmd-edit.c (sv_select_cur_depends) : find deps even for empty
cells.
2004-06-30 Jody Goldberg <jody@gnome.org>
* src/stf.c (stf_init) : cvs exporter is one sheet only
* src/gnumeric-gconf.c (get_schema) : typo
(go_conf_get_type) : implement for #ifdef WITH_GNOME
2004-06-23 Jean Brefort <jean.brefort@ac-dijon.fr>
* configure.in:
......
......@@ -106,7 +106,7 @@ excel_file_probe (GnmFileOpener const *fo, GsfInput *input, FileProbeLevel pl)
return data && data[0] == 0x09 && (data[1] & 0xf1) == 0;
}
stream = find_content_stream (GSF_INFILE (ole), NULL);
stream = find_content_stream (ole, NULL);
if (stream != NULL) {
g_object_unref (G_OBJECT (stream));
res = TRUE;
......@@ -121,7 +121,7 @@ excel_read_metadata (Workbook *wb, GsfInfile *ole, char const *name,
IOContext *context)
{
GError *err = NULL;
GsfInput *stream = gsf_infile_child_by_name (GSF_INFILE (ole), name);
GsfInput *stream = gsf_infile_child_by_name (ole, name);
if (stream != NULL) {
gsf_msole_metadata_read (stream, &err);
......@@ -177,7 +177,7 @@ excel_file_open (GnmFileOpener const *fo, IOContext *context,
return;
}
stream = find_content_stream (GSF_INFILE (ole), &is_97);
stream = find_content_stream (ole, &is_97);
if (stream == NULL) {
gnm_cmd_context_error_import (GNM_CMD_CONTEXT (context),
_("No Workbook or Book streams found."));
......@@ -192,9 +192,9 @@ excel_file_open (GnmFileOpener const *fo, IOContext *context,
excel_read_metadata (wb, ole, "\05DocumentSummaryInformation", context);
/* See if there are any macros to keep around */
stream = gsf_infile_child_by_name (GSF_INFILE (ole), "\01CompObj");
stream = gsf_infile_child_by_name (ole, "\01CompObj");
if (stream != NULL) {
GsfInput *macros = gsf_infile_child_by_name (GSF_INFILE (ole), "_VBA_PROJECT_CUR");
GsfInput *macros = gsf_infile_child_by_name (ole, "_VBA_PROJECT_CUR");
if (macros != NULL) {
g_object_set_data_full (G_OBJECT (wb), "MS_EXCEL_COMPOBJ",
gsf_structured_blob_read (stream), g_object_unref);
......
......@@ -380,23 +380,23 @@ BC_R(areaformat)(XLChartHandler const *handle,
BC_R(get_style) (s);
if (pattern > 0) {
s->style->fill.type = GOG_FILL_STYLE_PATTERN;
s->style->fill.is_auto = auto_format;
s->style->fill.auto_back = auto_format;
s->style->fill.invert_if_negative = invert_if_negative;
s->style->fill.u.pattern.pat.pattern = pattern - 1;
s->style->fill.u.pattern.pat.fore = BC_R(color) (q->data+0, "AreaFore");
s->style->fill.u.pattern.pat.back = BC_R(color) (q->data+4, "AreaBack");
if (s->style->fill.u.pattern.pat.pattern == 0) {
GOColor tmp = s->style->fill.u.pattern.pat.fore;
s->style->fill.u.pattern.pat.fore = s->style->fill.u.pattern.pat.back;
s->style->fill.u.pattern.pat.back = tmp;
s->style->fill.pattern.pattern = pattern - 1;
s->style->fill.pattern.fore = BC_R(color) (q->data+0, "AreaFore");
s->style->fill.pattern.back = BC_R(color) (q->data+4, "AreaBack");
if (s->style->fill.pattern.pattern == 0) {
GOColor tmp = s->style->fill.pattern.fore;
s->style->fill.pattern.fore = s->style->fill.pattern.back;
s->style->fill.pattern.back = tmp;
}
} else if (auto_format) {
s->style->fill.type = GOG_FILL_STYLE_PATTERN;
s->style->fill.is_auto = TRUE;
s->style->fill.auto_back = TRUE;
s->style->fill.invert_if_negative = invert_if_negative;
s->style->fill.u.pattern.pat.pattern = 0;
s->style->fill.u.pattern.pat.fore =
s->style->fill.u.pattern.pat.back = 0;
s->style->fill.pattern.pattern = 0;
s->style->fill.pattern.fore =
s->style->fill.pattern.back = 0;
} else
s->style->fill.type = GOG_FILL_STYLE_NONE;
......@@ -911,12 +911,12 @@ BC_R(gelframe) (XLChartHandler const *handle,
MS_OBJ_ATTR_FILL_PRESET, 0);
s->style->fill.type = GOG_FILL_STYLE_GRADIENT;
s->style->fill.u.gradient.start =
s->style->fill.pattern.fore =
ms_chart_map_color (s, fill_color, fill_alpha);
/* FIXME : make presets the same as 2 color for now */
if (!(shade_type & 8) || preset > 0) {
s->style->fill.u.gradient.end = ms_chart_map_color (s,
s->style->fill.pattern.back = ms_chart_map_color (s,
fill_back_color, fill_back_alpha);
} else {
float brightness;
......@@ -988,7 +988,7 @@ BC_R(gelframe) (XLChartHandler const *handle,
case 3 : dir = GO_GRADIENT_NW_TO_SE_MIRRORED; break;
}
}
s->style->fill.u.gradient.dir = dir;
s->style->fill.gradient.dir = dir;
}
ms_obj_attr_bag_destroy (attrs);
......@@ -2415,24 +2415,24 @@ chart_write_AREAFORMAT (XLChartWriteState *s, GogStyle const *style, gboolean di
back = RGBA_WHITE;
break;
case GOG_FILL_STYLE_PATTERN: {
pat = style->fill.u.pattern.pat.pattern + 1;
pat = style->fill.pattern.pattern + 1;
if (pat == 1) {
back = style->fill.u.pattern.pat.fore;
fore = style->fill.u.pattern.pat.back;
back = style->fill.pattern.fore;
fore = style->fill.pattern.back;
} else {
fore = style->fill.u.pattern.pat.fore;
back = style->fill.u.pattern.pat.back;
fore = style->fill.pattern.fore;
back = style->fill.pattern.back;
}
break;
}
case GOG_FILL_STYLE_GRADIENT:
pat = 1;
fore = back = style->fill.u.gradient.start;
fore = back = style->fill.pattern.fore;
#warning export gradients
break;
}
if (style->fill.is_auto && !disable_auto)
if (style->fill.auto_back && !disable_auto)
flags |= 1;
if (style->fill.invert_if_negative)
flags |= 2;
......@@ -2722,6 +2722,29 @@ store_dim (GogSeries const *series, GogMSDimType t,
GSF_LE_SET_GUINT16 (store_count, count);
}
static gboolean
style_is_completely_auto (GogStyle const *style)
{
if ((style->interesting_fields & GOG_STYLE_OUTLINE) &&
!style->outline.auto_color)
return FALSE;
if ((style->interesting_fields & GOG_STYLE_FILL)) {
if (style->fill.type != GOG_FILL_STYLE_PATTERN ||
!style->fill.auto_back)
return FALSE;
}
if ((style->interesting_fields & GOG_STYLE_LINE) &&
!style->line.auto_color)
return FALSE;
if ((style->interesting_fields & GOG_STYLE_MARKER)) {
if (!style->marker.auto_shape ||
!style->marker.auto_outline_color ||
!style->marker.auto_fill_color)
return FALSE;
}
return TRUE;
}
static void
chart_write_series (XLChartWriteState *s, GogSeries const *series, unsigned n)
{
......@@ -2759,7 +2782,7 @@ chart_write_series (XLChartWriteState *s, GogSeries const *series, unsigned n)
chart_write_BEGIN (s);
ms_biff_put_2byte (s->bp, BIFF_CHART_3dbarshape, 0); /* box */
style = GOG_STYLED_OBJECT (series)->style;
if (!gog_style_is_completely_auto (style)) {
if (!style_is_completely_auto (style)) {
if ((style->interesting_fields & GOG_STYLE_LINE))
chart_write_LINEFORMAT (s, &style->line, FALSE, FALSE);
else
......
......@@ -4470,11 +4470,11 @@ extract_gog_object_style (ExcelWriteState *ewb, GogObject *obj)
case GOG_FILL_STYLE_IMAGE :
break;
case GOG_FILL_STYLE_PATTERN :
put_color_bgr (ewb, go_color_to_bgr (style->fill.u.pattern.pat.fore));
put_color_bgr (ewb, go_color_to_bgr (style->fill.u.pattern.pat.back));
put_color_bgr (ewb, go_color_to_bgr (style->fill.pattern.fore));
put_color_bgr (ewb, go_color_to_bgr (style->fill.pattern.back));
break;
case GOG_FILL_STYLE_GRADIENT :
put_color_bgr (ewb, go_color_to_bgr (style->fill.u.gradient.start));
put_color_bgr (ewb, go_color_to_bgr (style->fill.pattern.fore));
}
if (style->interesting_fields & GOG_STYLE_MARKER) {
put_color_bgr (ewb, go_color_to_bgr (go_marker_get_outline_color (style->marker.mark)));
......
......@@ -122,6 +122,9 @@ cb_compare_deps (gconstpointer a, gconstpointer b)
GnmCell const *cell_b = b;
int tmp;
if (cell_a->base.sheet != cell_b->base.sheet)
return cell_a->base.sheet->index_in_wb - cell_b->base.sheet->index_in_wb;
tmp = cell_a->pos.row - cell_b->pos.row;
if (tmp != 0)
return tmp;
......@@ -146,16 +149,18 @@ cb_collect_deps (GnmDependent *dep, gpointer user)
void
sv_select_cur_depends (SheetView *sv)
{
GnmCell *cur_cell;
GnmCell *cur_cell, dummy;
GList *deps = NULL, *ptr = NULL;
g_return_if_fail (IS_SHEET_VIEW (sv));
cur_cell = sheet_cell_get (sv->sheet,
sv->edit_pos.col,
sv->edit_pos.row);
if (cur_cell == NULL)
return;
sv->edit_pos.col, sv->edit_pos.row);
if (cur_cell == NULL) {
dummy.base.sheet = sv_sheet (sv);
dummy.pos = sv->edit_pos;
cur_cell = &dummy;
}
cell_foreach_dep (cur_cell, cb_collect_deps, &deps);
if (deps == NULL)
......@@ -234,20 +239,33 @@ sv_select_cur_depends (SheetView *sv)
*
* Select all cells that are direct potential inputs to the
* current cell.
*/
**/
void
sv_select_cur_inputs (SheetView *sv)
{
GnmCell *cell;
GnmCell *cell;
GnmRange *r;
GSList *ranges, *ptr;
g_return_if_fail (IS_SHEET_VIEW (sv));
cell = sheet_cell_get (sv->sheet,
sv->edit_pos.col,
sv->edit_pos.row);
sv->edit_pos.col, sv->edit_pos.row);
if (cell == NULL || !cell_has_expr (cell))
return;
ranges = gnm_expr_get_ranges (cell->base.expression);
if (ranges == NULL)
return;
#if 0
sv_selection_reset (sv);
for (ptr = ranges ; ptr != NULL ; ptr = ptr->next)
sv_selection_add_range (sv,
r->start.col, r->start.row,
r->start.col, r->start.row,
r->end.col, r->end.row);
g_slist_free (ranges);
#endif
/* TODO : finish this */
sheet_update (sv->sheet);
......
......@@ -157,6 +157,8 @@ cmd_context_progress_message_set (GnmCmdContext *context, gchar const *msg)
{
g_return_if_fail (IS_GNM_CMD_CONTEXT (context));
if (msg == NULL)
msg = " ";
CC_CLASS (context)->progress_message_set (context, msg);
}
......
2004-07-02 Jody Goldberg <jody@gnome.org>
* graph/gog-theme.c (map_area_series_solid_default) : simplify now
that we're just filling in the color no need to twiddle types
* graph/gog-style.c : rework GogStyle::fill share pattern:fore/back
and gradient:start/end.
merge all the different auto flags.
initialize the gradient brightness to -1 to avoid starting with black
Change fill from union to struct to simplify changing fill types
Allow themed gradient fills
2004-06-30 Christopher James Lahey <clahey@ximian.com>
* drawing/god-text-model.c
......
......@@ -32,6 +32,21 @@ G_BEGIN_DECLS
GType go_doc_get_type (void);
#if 0
GODoc *go_doc_new_from_input (GsfInput *input,
GODocImporter const *fmt,
GOIOContext *context,
gchar const *encoding);
GODoc *go_doc_new_from_uri (char const *uri,
GnmFileOpener const *fmt,
GOIOContext *context,
gchar const *encoding);
gboolean go_doc_save (GODoc *doc, GOIOContext *context);
gboolean go_doc_save_as (GODoc *doc, GODocExporter *fmt, char const *uri,
GOIOContext *cc);
gboolean go_doc_sendto (GODoc *doc, GOIOContext *cc);
#endif
G_END_DECLS
#endif /* GO_DOC_H */
......@@ -223,7 +223,7 @@ gog_error_bar_prefs (GogSeries *series,
go_combo_color_set_allow_alpha (GO_COMBO_COLOR (w), TRUE);
gtk_label_set_mnemonic_widget (
GTK_LABEL (glade_xml_get_widget (gui, "color_label")), w);
go_combo_color_set_gocolor (GO_COMBO_COLOR (w), editor->color);
go_combo_color_set_color (GO_COMBO_COLOR (w), editor->color);
g_signal_connect (G_OBJECT (w),
"color_changed",
G_CALLBACK (cb_color_changed), editor);
......
......@@ -257,14 +257,14 @@ gog_renderer_gnome_print_draw_polygon (GogRenderer *renderer, ArtVpath const *pa
switch (style->fill.type) {
case GOG_FILL_STYLE_PATTERN:
gnome_print_gsave (prend->gp_context);
if (go_pattern_is_solid (&style->fill.u.pattern.pat, &color)) {
if (go_pattern_is_solid (&style->fill.pattern, &color)) {
set_color (prend, color);
gnome_print_fill (prend->gp_context);
} else {
ArtSVP *fill = art_svp_from_vpath ((ArtVpath *)path);
image = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, bbox.x1, bbox.y1);
gdk_pixbuf_fill (image, 0);
go_pattern_render_svp (&style->fill.u.pattern.pat,
go_pattern_render_svp (&style->fill.pattern,
fill, 0, 0, bbox.x1, bbox.y1,
gdk_pixbuf_get_pixels (image),
gdk_pixbuf_get_rowstride (image));
......@@ -294,8 +294,8 @@ gog_renderer_gnome_print_draw_polygon (GogRenderer *renderer, ArtVpath const *pa
8, ART_ALPHA_SEPARATE, NULL);
go_gradient_setup (&gradient,
style->fill.u.gradient.dir,
style->fill.u.gradient.start, style->fill.u.gradient.end,
style->fill.gradient.dir,
style->fill.pattern.back, style->fill.pattern.fore,
0, 0, PIXBUF_SIZE, PIXBUF_SIZE,
stops);
art_render_gradient_linear (render,
......@@ -313,12 +313,12 @@ gog_renderer_gnome_print_draw_polygon (GogRenderer *renderer, ArtVpath const *pa
break;
case GOG_FILL_STYLE_IMAGE:
image = style->fill.u.image.image;
image = style->fill.image.image;
if (image == NULL)
break;
gnome_print_gsave (prend->gp_context);
gnome_print_clip (prend->gp_context);
switch (style->fill.u.image.type) {
switch (style->fill.image.type) {
case GOG_IMAGE_CENTERED:
w = (bbox.x1 - bbox.x0) - gdk_pixbuf_get_width (image);
if (w > 0) w /= 2.; else w = 0.;
......
......@@ -232,7 +232,7 @@ gog_renderer_pixbuf_draw_polygon (GogRenderer *rend, ArtVpath const *path,
switch (style->fill.type) {
case GOG_FILL_STYLE_PATTERN:
go_pattern_render_svp (&style->fill.u.pattern.pat,
go_pattern_render_svp (&style->fill.pattern,
fill,
prend->x_offset,
prend->y_offset,
......@@ -248,8 +248,8 @@ gog_renderer_pixbuf_draw_polygon (GogRenderer *rend, ArtVpath const *path,
art_render_svp (render, fill);
go_gradient_setup (&gradient,
style->fill.u.gradient.dir,
style->fill.u.gradient.start, style->fill.u.gradient.end,
style->fill.gradient.dir,
style->fill.pattern.back, style->fill.pattern.fore,
bbox.x0, bbox.y0, bbox.x1, bbox.y1,
stops);
......@@ -262,7 +262,7 @@ gog_renderer_pixbuf_draw_polygon (GogRenderer *rend, ArtVpath const *path,
case GOG_FILL_STYLE_IMAGE: {
GdkRectangle path_rect, clip_rect, dest_rect;
image = style->fill.u.image.image;
image = style->fill.image.image;
if (image == NULL)
break;
......@@ -278,7 +278,7 @@ gog_renderer_pixbuf_draw_polygon (GogRenderer *rend, ArtVpath const *path,
clip_rect.height = prend->h;
if (gdk_rectangle_intersect (&path_rect, &clip_rect, &dest_rect)) {
switch (style->fill.u.image.type) {
switch (style->fill.image.type) {
case GOG_IMAGE_CENTERED:
w = ((bbox.x1 - bbox.x0) - gdk_pixbuf_get_width (image)) / 2.;
if (w < 0.) w = 0.;
......
......@@ -205,7 +205,7 @@ gog_renderer_svg_draw_polygon (GogRenderer *renderer, ArtVpath const *path,
switch (style->fill.type) {
case GOG_FILL_STYLE_PATTERN: {
GOColor color;
if (go_pattern_is_solid (&style->fill.u.pattern.pat, &color)) {
if (go_pattern_is_solid (&style->fill.pattern, &color)) {
buf = g_strdup_printf ("#%06x", color >> 8);
xmlNewProp (node, CC2XML ("fill"), CC2XML (buf));
g_free (buf);
......@@ -220,7 +220,8 @@ gog_renderer_svg_draw_polygon (GogRenderer *renderer, ArtVpath const *path,
}
case GOG_FILL_STYLE_GRADIENT:
id = g_strdup_printf ("g_%x_%x_%x", style->fill.u.gradient.dir, style->fill.u.gradient.start, style->fill.u.gradient.end);
id = g_strdup_printf ("g_%x_%x_%x", style->fill.gradient.dir,
style->fill.pattern.back, style->fill.pattern.fore);
name = (char*) g_hash_table_lookup (prend->table, id);
if (!name) {
double x1, y1, x2, y2;
......@@ -228,13 +229,13 @@ gog_renderer_svg_draw_polygon (GogRenderer *renderer, ArtVpath const *path,
xmlNodePtr child, stop;
name = g_strdup_printf ("grad%d", prend->grad++);
g_hash_table_insert (prend->table, id, name);
if (style->fill.u.gradient.dir < 4) {
if (style->fill.gradient.dir < 4) {
x1 = y1 = x2 = 0;
y2 = 1;
} else if (style->fill.u.gradient.dir < 8) {
} else if (style->fill.gradient.dir < 8) {
x1 = y1 = y2 = 0;
x2 = 1;
} else if (style->fill.u.gradient.dir < 12) {
} else if (style->fill.gradient.dir < 12) {
x1 = y1 = 0;
x2 = y2 = 1;
} else {
......@@ -245,28 +246,28 @@ gog_renderer_svg_draw_polygon (GogRenderer *renderer, ArtVpath const *path,
xmlAddChild (prend->defs, child);
xmlNewProp (child, CC2XML ("id"), CC2XML (name));
xmlNewProp (child, CC2XML ("gradientUnits"), CC2XML ("objectBoundingBox"));
switch (style->fill.u.gradient.dir % 4) {
switch (style->fill.gradient.dir % 4) {
case 0:
buf = (char*) "pad";
start = style->fill.u.gradient.start;
end = style->fill.u.gradient.end;
start = style->fill.pattern.fore;
end = style->fill.pattern.back;
break;
case 1:
buf = (char*) "pad";
start = style->fill.u.gradient.end;
end = style->fill.u.gradient.start;
start = style->fill.pattern.back;
end = style->fill.pattern.fore;
break;
case 2:
buf = (char*) "reflect";
start = style->fill.u.gradient.start;
end = style->fill.u.gradient.end;
start = style->fill.pattern.fore;
end = style->fill.pattern.back;
x2 = x1 + (x2 - x1) / 2;
y2 = y1 + (y2 - y1) / 2;
break;
default:
buf = (char*) "reflect";
start = style->fill.u.gradient.end;
end = style->fill.u.gradient.start;
start = style->fill.pattern.back;
end = style->fill.pattern.fore;
x2 = x1 + (x2 - x1) / 2;
y2 = y1 + (y2 - y1) / 2;
break;
......
......@@ -83,27 +83,20 @@ struct _GogStyle {
GogStyleLine outline, line;
struct {
GogFillStyle type;
gboolean is_auto;
gboolean invert_if_negative; /* placeholder for XL */
union {
struct {
GOPattern pat;
} pattern;
struct {
GOGradientDirection dir;
GOColor start;
GOColor end;
float brightness; /* < 0 => 2 color */
} gradient;
struct {
GogImageType type;
GdkPixbuf *image;
char *filename;
} image;
} u;
/* Don't persist these */
gboolean pattern_fore_auto, pattern_back_auto;
gboolean gradient_start_auto, gradient_end_auto;
gboolean auto_fore, auto_back; /* share between pattern and gradient */
gboolean invert_if_negative; /* placeholder for XL */
/* This could all be a union but why bother ? */
GOPattern pattern;
struct {
GOGradientDirection dir;
float brightness; /* < 0 => 2 color */
} gradient;
struct {
GogImageType type;
GdkPixbuf *image;
char *filename;
} image;
} fill;
GogStyleMark marker;
struct {
......@@ -116,7 +109,8 @@ struct _GogStyle {
GogStyle *gog_style_new (void);
GogStyle *gog_style_dup (GogStyle const *style);
void gog_style_assign (GogStyle *dst, GogStyle const *src);
void gog_style_apply_theme (GogStyle *dst, GogStyle const *src);
void gog_style_apply_theme (GogStyle *dst, GogStyle const *src,
gboolean override);
void gog_style_set_marker (GogStyle *style, GOMarker *marker);
void gog_style_set_font (GogStyle *style,
PangoFontDescription *desc);
......@@ -126,7 +120,7 @@ void gog_style_set_fill_image_filename (GogStyle *style, char *filename);
gboolean gog_style_is_different_size (GogStyle const *a, GogStyle const *b);
gboolean gog_style_is_marker_visible (GogStyle const *style);
gboolean gog_style_is_line_visible (GogStyle const *style);
gboolean gog_style_is_completely_auto (GogStyle const *style);
void gog_style_force_auto (GogStyle *style);
gpointer gog_style_editor (GogStyle *style,
GogStyle *default_style,
......
......@@ -207,7 +207,8 @@ gog_styled_object_get_style (GogStyledObject *gso)
GogStyle *
gog_styled_object_get_auto_style (GogStyledObject *gso)
{
GogStyle *res = gog_style_new ();
GogStyle *res = gog_style_dup (gso->style);
gog_style_force_auto (res);
gog_styled_object_apply_theme (gso, res);
return res;
}
......
......@@ -190,7 +190,7 @@ gog_theme_init_style (GogTheme *theme, GogStyle *style,
g_return_if_fail (elem != NULL);
#warning we should handle the applicability here not in the themes
gog_style_apply_theme (style, elem->style);
gog_style_apply_theme (style, elem->style, FALSE);
if (ind >= 0 && elem->map)
(elem->map) (style, ind);
}
......@@ -334,16 +334,14 @@ map_area_series_solid_default (GogStyle *style, unsigned ind)
unsigned palette_index = ind;
if (palette_index >= G_N_ELEMENTS (palette))
palette_index %= G_N_ELEMENTS (palette);
if (style->fill.is_auto) {
if (style->fill.type == GOG_FILL_STYLE_PATTERN)
style->fill.u.pattern.pat.back = palette [palette_index];
else if (style->fill.type == GOG_FILL_STYLE_GRADIENT &&
style->fill.u.gradient.brightness >= 0) {
style->fill.u.gradient.start = palette [palette_index];
/* force the brightness to reinterpolate */
if (style->fill.auto_back) {
style->fill.pattern.back = palette [palette_index];
/* force the brightness to reinterpolate */
if (style->fill.type == GOG_FILL_STYLE_GRADIENT &&
style->fill.gradient.brightness >= 0)
gog_style_set_fill_brightness (style,
style->fill.u.gradient.brightness);
}
style->fill.gradient.brightness);
}
palette_index += 8;
......@@ -372,16 +370,13 @@ map_area_series_solid_guppi (GogStyle *style, unsigned ind)
unsigned palette_index = ind;
if (palette_index >= G_N_ELEMENTS (palette))
palette_index %= G_N_ELEMENTS (palette);
if (style->fill.is_auto) {
if (style->fill.type == GOG_FILL_STYLE_PATTERN)
style->fill.u.pattern.pat.back = palette [palette_index];
else if (style->fill.type == GOG_FILL_STYLE_GRADIENT &&
style->fill.u.gradient.brightness >= 0) {
style->fill.u.gradient.start = palette [palette_index];
if (style->fill.auto_back) {
style->fill.pattern.back = palette [palette_index];
if (style->fill.type == GOG_FILL_STYLE_GRADIENT &&
style->fill.gradient.brightness >= 0)
/* force the brightness to reinterpolate */
gog_style_set_fill_brightness (style,
style->fill.u.gradient.brightness);
}
style->fill.gradient.brightness);
}
if (style->line.auto_color && !(style->disable_theming & GOG_STYLE_LINE))
style->line.color = palette [palette_index];
......@@ -413,7 +408,7 @@ gog_themes_init (void)
style->outline.width = 0; /* hairline */
style->outline.color = RGBA_BLACK;
style->fill.type = GOG_FILL_STYLE_PATTERN;
go_pattern_set_solid (&style->fill.u.pattern.pat, RGBA_WHITE);
go_pattern_set_solid (&style->fill.pattern, RGBA_WHITE);
gog_theme_add_element (theme, style, NULL, "GogChart", NULL);
/* legend */
......@@ -421,7 +416,7 @@ gog_themes_init (void)
style->outline.width = 0; /* hairline */
style->outline.color = RGBA_BLACK;
style->fill.type = GOG_FILL_STYLE_PATTERN;
go_pattern_set_solid (&style->fill.u.pattern.pat, RGBA_WHITE);
go_pattern_set_solid (&style->fill.pattern, RGBA_WHITE);
gog_theme_add_element (theme, style, NULL, "GogLegend", NULL);
/* Axis */
......@@ -437,7 +432,7 @@ gog_themes_init (void)
style->line.width = 0.; /* hairline */
style->line.color = RGBA_GREY (0x20);
style->fill.type = GOG_FILL_STYLE_PATTERN;
go_pattern_set_solid (&style->fill.u.pattern.pat, RGBA_GREY (0xd0));
go_pattern_set_solid (&style->fill.pattern, RGBA_GREY (0xd0));
gog_theme_add_element (theme, style, NULL, "GogGrid", NULL);
/* series */
......@@ -461,9 +456,9 @@ gog_themes_init (void)
style = gog_style_new ();
style->outline.width = -1; /* none */
style->fill.type = GOG_FILL_STYLE_GRADIENT;
style->fill.u.gradient.dir = GO_GRADIENT_N_TO_S;
style->fill.u.gradient.start = RGBA_BLUE;
style->fill.u.gradient.end = RGBA_BLACK;
style->fill.gradient.dir = GO_GRADIENT_N_TO_S;
style->fill.pattern.fore = RGBA_BLUE;
style->fill.pattern.back = RGBA_BLACK;
gog_theme_add_element (theme, style, NULL, "GogGraph", NULL);
/* chart */
......@@ -477,7 +472,7 @@ gog_themes_init (void)
style = gog_style_new ();
style->outline.color = RGBA_BLACK;
style->fill.type = GOG_FILL_STYLE_PATTERN;