Commit b78835d8 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow

get rid of libgnomeprint


svn path=/trunk/; revision=15482
parent 3dba5419
2007-03-29 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* delete the "print" field from all sheet objects. We
are now using the draw_cairo method
* src/print-cell.c (gnm_print_make_rect_path): delete
(print_cell): delete
(print_rectangle): delete
(print_cell_background): delete
(print_merged_range): delete
(gnm_print_cell_range): delete
* src/sheet-object.c (sheet_object_print): delete
* src/print-cell.h (gnm_print_make_rect_path): delete
(gnm_print_cell_range): delete
* src/sheet-object.h (sheet_object_print): delete
* src/sheet-object-cell-comment.c (cell_comment_print): delete
* src/dialogs/dialog-printer-setup.c: comment out all currently
unused functions
(PrinterSetupStateNew): rename to PrinterSetupState
(printer_setup_state_new_new): rename to printer_setup_state_new
* src/dialogs/dialogs.h (dialog_printer_setup): does not depend on
gnomeprint
* src/dialogs/Makefile.am: remove libgnomeprint condition
* src/style-font.h: remove libgnomeprint include
* src/xml-sax-read.c: comment out gnomeprint dependency
* src/xml-sax-write.c: ditto
* src/xml-io.c: ditto
* src/gnumeric-gconf.c (gnm_conf_init_extras): remove libgnomeprint
dependency
* src/sheet-object-graph.c (gnm_sog_print): delete
* src/pattern.c (gnumeric_background_set_pc): delete
* src/pattern.h (gnumeric_background_set_pc): delete
* src/gnm-so-line.c (gnm_so_line_print): delete
* src/Makefile.am: remove libgnomeprint condition
* src/sheet-filter.c: remove "print" field
* src/validation.c: ditto
* src/sheet-object-image.c (gnm_soi_print): delete
* src/gnm-so-filled.c (make_rect): delete
(make_ellipse): delete
(gnm_so_filled_print): delete
(set_color): delete
* src/style-border.c (style_border_set_pc_dash): delete
(style_border_set_pc): delete
(print_hline): delete
(print_vline): delete
(gnm_style_borders_row_print): delete
(gnm_style_border_print_diag): delete
* src/style-border.h (style_border_set_pc_dash): delete
(style_border_set_pc): delete
(gnm_style_borders_row_print): delete
(gnm_style_border_print_diag): delete
* src/wbcg-actions.c: enable print commands
* src/print-info.c: comment out libgnomeprint dependencies
* src/print-info.h: ditto
* src/wbc-gtk.c: remove print menu disabling
* src/sheet-object-impl.h: remove "print" field
* src/gnm-so-polygon.c (gnm_so_polygon_print): delete
* plugins/excel/ms-excel-read.c: comment out gnomeprint dependency
* configure.in: remove libgnomeprint tests
* component/gnumeric.c: comment out gnomeprint dependency
2007-03-29 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/print.c: uncomment (#if 0 ... #endif)
......
......@@ -39,7 +39,6 @@
#include <selection.h>
#include <sheet.h>
#include <sheet-object-impl.h>
#include <print-cell.h>
#include <sheet-object.h>
#include <command-context.h>
#include <command-context-stderr.h>
......@@ -289,6 +288,7 @@ go_gnm_component_draw (GOComponent *component, int width_pixels, int height_pixe
#endif
}
#if 0
static void
go_gnm_component_print (GOComponent *component, GnomePrintContext *gpc,
double width, double height)
......@@ -358,6 +358,8 @@ go_gnm_component_print (GOComponent *component, GnomePrintContext *gpc,
gnome_print_grestore (gpc);
}
#endif
static void
cb_gognm_save (GtkAction *a, WorkbookControlGUI *wbcg)
{
......@@ -453,7 +455,7 @@ go_gnm_component_class_init (GOComponentClass *klass)
klass->get_data = go_gnm_component_get_data;
klass->set_data = go_gnm_component_set_data;
klass->draw = go_gnm_component_draw;
klass->print = go_gnm_component_print;
klass->print= NULL;
klass->edit = go_gnm_component_edit;
}
......
......@@ -195,42 +195,6 @@ fi
AM_CONDITIONAL(WITH_GTK, $gnumeric_with_gtk)
AM_CONDITIONAL(WITH_GNOME, $gnumeric_with_gnome)
dnl ========= Check for libgnomeprintui
gnome_print_reqs="
libgnomeprint-2.2 >= 2.8.2
libgnomeprintui-2.2 >= 2.8.2
"
AC_ARG_ENABLE(gnome-print,
[AC_HELP_STRING([--disable-gnome-print], [Compile without print support])],
enable_gnome_print="$enableval",
enable_gnome_print=yes)
LIBGNOMEPRINT_REQUIRED=2.8.2
LIBGNOMEPRINTUI_REQUIRED=2.8.2
if test x$enable_gnome_print = xyes; then
PKG_CHECK_MODULES(GNOME_PRINT,
$gnome_print_reqs,
HAVE_GNOME_PRINT=yes, HAVE_GNOME_PRINT=no)
else
HAVE_GNOME_PRINT=no
fi
AC_SUBST(GNOME_PRINT_CFLAGS)
AC_SUBST(GNOME_PRINT_LIBS)
if test "x$HAVE_GNOME_PRINT" = "xyes"; then
AC_DEFINE([WITH_GNOME_PRINT],[1],[Enable Print Support.])
gnumeric_reqs="$gnumeric_reqs $gnome_print_reqs"
else
if test "x$enable_gnome_print" = "xyes"; then
AC_MSG_ERROR([gnome print libs not found])
fi
fi
AM_CONDITIONAL(WITH_GNOME_PRINT, test "x$HAVE_GNOME_PRINT" = "xyes")
dnl ****************************
dnl now that we have selected out libraries the whole collection in one
dnl shot so that we can have a nice neat compile/link line
......@@ -275,10 +239,6 @@ if test "x$gnumeric_with_gnome" = "xtrue"; then
CFLAGS="$CFLAGS -DBONOBO_UI_DISABLE_DEPRECATED"
fi
if test "x$HAVE_GNOME_PRINT" = "xyes"; then
CFLAGS="$CFLAGS -DWITH_GNOME_PRINT"
fi
dnl ==============================================
dnl Maemo/Hildon based User Interface
......@@ -1092,7 +1052,6 @@ Configuration:
UI: ${ui_msg}
Print Support: ${HAVE_GNOME_PRINT}
Perl Support: ${perl_msg}
Python Support: ${python_msg}
......
......@@ -659,10 +659,6 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
static void
excel_print_unit_init_inch (PrintUnit *pu, double val)
{
#ifdef WITH_GNOME_PRINT
GnomePrintUnit const *uinch = gnome_print_unit_get_by_abbreviation ("in");
pu->desired_display = uinch; /* FIXME: should be more global */
#endif
pu->points = GO_IN_TO_PT (val);
}
......
......@@ -156,13 +156,10 @@ libspreadsheet_la_SOURCES = \
xml-sax-read.c \
xml-sax-write.c \
gnumeric-gconf.c \
gnumeric-gconf-priv.h
if WITH_GNOME_PRINT
libspreadsheet_la_SOURCES += \
gnumeric-gconf-priv.h \
print.c \
print-cell.c
endif
# When we switch to subversion fix this to nest as
# libspreadsheet-ver/ssheet/header
......@@ -287,13 +284,10 @@ libspreadsheet_include_HEADERS = \
xml-io.h \
xml-io-version.h \
xml-sax.h \
gnumeric-gconf.h
if WITH_GNOME_PRINT
libspreadsheet_include_HEADERS += \
gnumeric-gconf.h \
print.h \
print-cell.h
endif
gnumeric_SOURCES = \
io-context-gtk.c \
......
......@@ -78,11 +78,8 @@ base_files = \
dialog-workbook-attr.c \
dialog-zoom.c \
dialogs.h \
tool-dialogs.h
if WITH_GNOME_PRINT
base_files += dialog-printer-setup.c
endif
tool-dialogs.h \
dialog-printer-setup.c
gladedir = $(gnumeric_datadir)/glade
glade_DATA = \
......@@ -150,10 +147,7 @@ glade_DATA = \
tabulate.glade \
variance-tests.glade \
view.glade \
workbook-attr.glade
workbook-attr.glade \
print.glade
if WITH_GNOME_PRINT
glade_DATA += print.glade
endif
EXTRA_DIST = $(glade_DATA)
......@@ -39,11 +39,6 @@
#include <style.h>
#include <gnumeric-gconf.h>
#include <libgnomeprint/gnome-print-job.h>
#include <libgnomeprint/gnome-print-unit.h>
#include <libgnomeprintui/gnome-print-paper-selector.h>
#include <libgnomeprintui/gnome-print-unit-selector.h>
#include <goffice/cut-n-paste/foocanvas/foo-canvas.h>
#include <goffice/cut-n-paste/foocanvas/foo-canvas-util.h>
#include <goffice/cut-n-paste/foocanvas/foo-canvas-line.h>
......@@ -81,6 +76,8 @@
#define HF_PAGE 1
#if 0
/* FIXME: Now that we have added a header/footer sample
* preview widget, we should rename the preview widget for the margins
* to be more specific.
......@@ -167,13 +164,15 @@ typedef struct {
HFPreviewInfo *pi_footer;
} PrinterSetupState;
#endif
typedef struct {
WorkbookControlGUI *wbcg;
Sheet *sheet;
PrintInformation *pi;
} PrinterSetupStateNew;
} PrinterSetupState;
#if 0
typedef struct {
PrinterSetupState *state;
......@@ -1619,6 +1618,7 @@ do_setup_main_dialog (PrinterSetupState *state)
}
static PrinterSetupState *
printer_setup_state_new (WorkbookControlGUI *wbcg, Sheet *sheet)
{
......@@ -1648,19 +1648,22 @@ printer_setup_state_new (WorkbookControlGUI *wbcg, Sheet *sheet)
return state;
}
#endif
static PrinterSetupStateNew *
printer_setup_state_new_new (WorkbookControlGUI *wbcg, Sheet *sheet)
static PrinterSetupState *
printer_setup_state_new (WorkbookControlGUI *wbcg, Sheet *sheet)
{
PrinterSetupStateNew *state;
PrinterSetupState *state;
state = g_new0 (PrinterSetupStateNew, 1);
state = g_new0 (PrinterSetupState, 1);
state->wbcg = wbcg;
state->sheet = sheet;
state->pi = print_info_dup (sheet->print_info);
return state;
}
#if 0
static void
do_fetch_page (PrinterSetupState *state)
{
......@@ -1772,11 +1775,13 @@ fetch_settings (PrinterSetupState *state)
do_fetch_page_info (state);
}
#endif
static void
dialog_printer_setup_done_cb (GtkPageSetup *page_setup,
gpointer data)
{
PrinterSetupStateNew *state = data;
PrinterSetupState *state = data;
if (page_setup) {
print_info_set_page_setup (state->pi, page_setup);
......@@ -1790,7 +1795,7 @@ dialog_printer_setup_done_cb (GtkPageSetup *page_setup,
void
dialog_printer_setup (WorkbookControlGUI *wbcg, Sheet *sheet)
{
PrinterSetupStateNew *state = printer_setup_state_new_new (wbcg, sheet);
PrinterSetupState *state = printer_setup_state_new (wbcg, sheet);
GtkPageSetup *page_setup = print_info_get_page_setup (state->pi);
gtk_print_run_page_setup_dialog_async
......
......@@ -39,9 +39,7 @@ void dialog_workbook_attr (WorkbookControlGUI *wbcg);
void dialog_goal_seek (WorkbookControlGUI *wbcg, Sheet *sheet);
void dialog_solver (WorkbookControlGUI *wbcg, Sheet *sheet);
void dialog_simulation (WorkbookControlGUI *wbcg, Sheet *sheet);
#ifdef WITH_GNOME_PRINT
void dialog_printer_setup (WorkbookControlGUI *wbcg, Sheet *sheet);
#endif
void dialog_autocorrect (WorkbookControlGUI *wbcg);
void dialog_advanced_filter (WorkbookControlGUI *wbcg);
void dialog_shuffle (WorkbookControlGUI *wbcg);
......
......@@ -245,131 +245,6 @@ gnm_so_filled_new_view (SheetObject *so, SheetObjectViewContainer *container)
return gnm_pane_object_register (so, FOO_CANVAS_ITEM (group), TRUE);
}
#ifdef WITH_GNOME_PRINT
static void
make_rect (GnomePrintContext *gp_context, double x1, double x2, double y1, double y2)
{
gnome_print_moveto (gp_context, x1, y1);
gnome_print_lineto (gp_context, x2, y1);
gnome_print_lineto (gp_context, x2, y2);
gnome_print_lineto (gp_context, x1, y2);
gnome_print_lineto (gp_context, x1, y1);
}
/*
* The following lines are copy and paste from dia. The ellipse logic has been
* slightly adapted. I have _no_ idea what's going on...
*/
/* This constant is equal to sqrt(2)/3*(8*cos(pi/8) - 4 - 1/sqrt(2)) - 1.
* Its use should be quite obvious.
*/
#define ELLIPSE_CTRL1 0.26521648984
/* this constant is equal to 1/sqrt(2)*(1-ELLIPSE_CTRL1).
* Its use should also be quite obvious.
*/
#define ELLIPSE_CTRL2 0.519570402739
#define ELLIPSE_CTRL3 M_SQRT1_2
/* this constant is equal to 1/sqrt(2)*(1+ELLIPSE_CTRL1).
* Its use should also be quite obvious.
*/
#define ELLIPSE_CTRL4 0.894643159635
static void
make_ellipse (GnomePrintContext *gp_context,
double x1, double x2, double y1, double y2)
{
double width = x2 - x1;
double height = y2 - y1;
double center_x = x1 + width / 2.0;
double center_y = y1 + height / 2.0;
double cw1 = ELLIPSE_CTRL1 * width / 2.0;
double cw2 = ELLIPSE_CTRL2 * width / 2.0;
double cw3 = ELLIPSE_CTRL3 * width / 2.0;
double cw4 = ELLIPSE_CTRL4 * width / 2.0;
double ch1 = ELLIPSE_CTRL1 * height / 2.0;
double ch2 = ELLIPSE_CTRL2 * height / 2.0;
double ch3 = ELLIPSE_CTRL3 * height / 2.0;
double ch4 = ELLIPSE_CTRL4 * height / 2.0;
gnome_print_moveto (gp_context, x1, center_y);
gnome_print_curveto (gp_context,
x1, center_y - ch1,
center_x - cw4, center_y - ch2,
center_x - cw3, center_y - ch3);
gnome_print_curveto (gp_context,
center_x - cw2, center_y - ch4,
center_x - cw1, y1,
center_x, y1);
gnome_print_curveto (gp_context,
center_x + cw1, y1,
center_x + cw2, center_y - ch4,
center_x + cw3, center_y - ch3);
gnome_print_curveto (gp_context,
center_x + cw4, center_y - ch2,
x2, center_y - ch1,
x2, center_y);
gnome_print_curveto (gp_context,
x2, center_y + ch1,
center_x + cw4, center_y + ch2,
center_x + cw3, center_y + ch3);
gnome_print_curveto (gp_context,
center_x + cw2, center_y + ch4,
center_x + cw1, y2,
center_x, y2);
gnome_print_curveto (gp_context,
center_x - cw1, y2,
center_x - cw2, center_y + ch4,
center_x - cw3, center_y + ch3);
gnome_print_curveto (gp_context,
center_x - cw4, center_y + ch2,
x1, center_y + ch1,
x1, center_y);
}
static void
set_color (GnomePrintContext *gp_context, GOColor color)
{
double r = ((double) UINT_RGBA_R (color)) / 255.;
double g = ((double) UINT_RGBA_G (color)) / 255.;
double b = ((double) UINT_RGBA_B (color)) / 255.;
double a = ((double) UINT_RGBA_A (color)) / 255.;
gnome_print_setrgbcolor (gp_context, r, g, b);
gnome_print_setopacity (gp_context, a);
}
static void
gnm_so_filled_print (SheetObject const *so, GnomePrintContext *gp_context,
double width, double height)
{
GnmSOFilled *sof = GNM_SO_FILLED (so);
GogStyle const *style = sof->style;
GOColor c;
gnome_print_newpath (gp_context);
if (sof->is_oval)
make_ellipse (gp_context, 0., width, 0., -height);
else
make_rect (gp_context, 0., width, 0., -height);
gnome_print_closepath (gp_context);
if (style->fill.type == GOG_FILL_STYLE_PATTERN &&
go_pattern_is_solid (&style->fill.pattern, &c)) {
gnome_print_gsave (gp_context);
set_color (gp_context, c);
gnome_print_fill (gp_context);
gnome_print_grestore (gp_context);
}
if (style->outline.color != 0 &&
style->outline.width >= 0 &&
style->outline.pattern != 0) {
gnome_print_setlinewidth (gp_context, style->outline.width);
set_color (gp_context, style->outline.color);
gnome_print_stroke (gp_context);
}
}
#endif /* WITH_GNOME_PRINT*/
#endif /* WITH_GTK */
static void
......@@ -619,13 +494,8 @@ gnm_so_filled_class_init (GObjectClass *gobject_class)
#ifdef WITH_GTK
so_class->new_view = gnm_so_filled_new_view;
so_class->user_config = gnm_so_filled_user_config;
so_class->print = NULL;
#ifdef WITH_GNOME_PRINT
so_class->print = gnm_so_filled_print;
#endif /* WITH_GNOME_PRINT */
#endif /* WITH_GTK */
so_class->draw_cairo = gnm_so_filled_draw_cairo;
g_object_class_install_property (gobject_class, SOF_PROP_STYLE,
......
......@@ -203,87 +203,6 @@ gnm_so_line_new_view (SheetObject *so, SheetObjectViewContainer *container)
return gnm_pane_object_register (so, item, TRUE);
}
#ifdef WITH_GNOME_PRINT
static void
gnm_so_line_print (SheetObject const *so, GnomePrintContext *ctx,
double width, double height)
{
GnmSOLine *sol = GNM_SO_LINE (so);
GogStyleLine const *style = &sol->style->line;
double x1, y1, x2, y2;
if (style->color == 0 || style->width < 0 || style->pattern == 0)
return;
switch (so->anchor.base.direction) {
case GOD_ANCHOR_DIR_UP_RIGHT:
case GOD_ANCHOR_DIR_DOWN_RIGHT:
x1 = 0.;
x2 = width;
break;
case GOD_ANCHOR_DIR_UP_LEFT:
case GOD_ANCHOR_DIR_DOWN_LEFT:
x1 = width;
x2 = 0.;
break;
default:
g_warning ("Cannot guess direction!");
return;
}
switch (so->anchor.base.direction) {
case GOD_ANCHOR_DIR_UP_LEFT:
case GOD_ANCHOR_DIR_UP_RIGHT:
y1 = -height;
y2 = 0.;
break;
case GOD_ANCHOR_DIR_DOWN_LEFT:
case GOD_ANCHOR_DIR_DOWN_RIGHT:
y1 = 0.;
y2 = -height;
break;
default:
g_warning ("Cannot guess direction!");
return;
}
gnome_print_setrgbcolor (ctx,
DOUBLE_RGBA_R (style->color),
DOUBLE_RGBA_G (style->color),
DOUBLE_RGBA_B (style->color));
if (sol->end_arrow.c > 0.) {
double phi;
phi = atan2 (y2 - y1, x2 - x1) - M_PI_2;
gnome_print_gsave (ctx);
gnome_print_translate (ctx, x2, y2);
gnome_print_rotate (ctx, phi / (2 * M_PI) * 360);
gnome_print_setlinewidth (ctx, 1.0);
gnome_print_newpath (ctx);
gnome_print_moveto (ctx, 0.0, 0.0);
gnome_print_lineto (ctx, -sol->end_arrow.c, -sol->end_arrow.b);
gnome_print_lineto (ctx, 0.0, -sol->end_arrow.a);
gnome_print_lineto (ctx, sol->end_arrow.c, -sol->end_arrow.b);
gnome_print_closepath (ctx);
gnome_print_fill (ctx);
gnome_print_grestore (ctx);
/* Make the line shorter so that the arrow won't be
* on top of a (perhaps quite fat) line. */
x2 += sol->end_arrow.a * sin (phi);
y2 -= sol->end_arrow.a * cos (phi);
}
gnome_print_setlinewidth (ctx, style->width);
gnome_print_newpath (ctx);
gnome_print_moveto (ctx, x1, y1);
gnome_print_lineto (ctx, x2, y2);
gnome_print_stroke (ctx);
}
#endif /* WITH_GNOME_PRINT */
#endif /* WITH_GTK */
static void
......@@ -550,12 +469,6 @@ gnm_so_line_class_init (GObjectClass *gobject_class)
so_class->draw_cairo = gnm_so_line_draw_cairo;
so_class->user_config = gnm_so_line_user_config;
so_class->new_view = gnm_so_line_new_view;
so_class->print = NULL;
#ifdef WITH_GNOME_PRINT
so_class->print = gnm_so_line_print;
#endif /* WITH_GNOME_PRINT */
#endif /* WITH_GTK */
g_object_class_install_property (gobject_class, SOL_PROP_STYLE,
......
......@@ -192,14 +192,6 @@ gnm_so_polygon_user_config (SheetObject *so, SheetControl *sc)
_("Polygon Properties"));
}
#ifdef WITH_GNOME_PRINT
static void
gnm_so_polygon_print (SheetObject const *so, GnomePrintContext *gp_context,
double base_x, double base_y)
{
}
#endif /* WITH_GNOME_PRINT */
#endif /* WITH_GTK */
static void
......@@ -334,12 +326,6 @@ gnm_so_polygon_class_init (GObjectClass *gobject_class)
#ifdef WITH_GTK
so_class->new_view = gnm_so_polygon_new_view;
so_class->user_config = gnm_so_polygon_user_config;
so_class->print = NULL;
#ifdef WITH_GNOME_PRINT
so_class->print = gnm_so_polygon_print;
#endif /* WITH_GNOME_PRINT */
#endif /* WITH_GTK */
so_class->draw_cairo = gnm_so_polygon_draw_cairo;
......
......@@ -1611,20 +1611,6 @@ gnm_conf_init_essential (void)
(node, PRINTSETUP_GCONF_MARGIN_TOP, 0.0, 10000.0, 120.0);
prefs.print_margin_bottom.points = go_conf_load_double
(node, PRINTSETUP_GCONF_MARGIN_BOTTOM, 0.0, 10000.0, 120.0);
#ifdef WITH_GNOME_PRINT
{
/* Note: the desired display unit is stored in the */
/* printer config. So we are never using this field */
/* inside the margin structure, but only setting it */
/* in various input routines. */
prefs.print_margin_top.desired_display
= gnome_print_unit_get_by_abbreviation ("cm");
prefs.print_margin_bottom.desired_display
= prefs.print_margin_top.desired_display;
}
#endif
prefs.print_all_sheets = go_conf_load_bool (
node, PRINTSETUP_GCONF_ALL_SHEETS, TRUE);
prefs.printer_header = go_conf_load_str_list (node, PRINTSETUP_GCONF_HEADER);
......
......@@ -165,93 +165,6 @@ gnumeric_background_set_gc (GnmStyle const *mstyle, GdkGC *gc,
return FALSE;
}
/*
* gnumeric_background_set_pc : Set up a GnomePrintContext to paint the
* background of a cell when printing.
* return : TRUE if there is a background to paint.
*/
#ifdef WITH_GNOME_PRINT
gboolean
gnumeric_background_set_pc (GnmStyle const *mstyle, GnomePrintContext *context)
{
int pattern;
/*
* Draw the background if the PATTERN is non 0
* Draw a stipple too if the pattern is > 1
*/
pattern = gnm_style_get_pattern (mstyle);
if (pattern > 0) {
GnmColor const *back_col = gnm_style_get_back_color (mstyle);
g_return_val_if_fail (back_col != NULL, FALSE);
/* Support printing grey scale patterns.
* This effectively applies a brightness threshold to get
* the desired results.
* The array used provides good real-life results.
* The true_grey array is theoretically correct but doesn't
* distinguish the shades clearly.
*
* Note: The first element of the grey array isn't used.
*
* FIXME: This code assumes the pattern colour is black, which
* is normally true (gnumeric selects it automatically).
* But correctly we should mix the pattern color against
* the background color. We handle the easy (pattern == 24)
* case below.
*/
if (pattern >= 1 && pattern <= 6) {
static double const grey[] = { 1.0, 1.0, .30, .45, .60, .75, .90};
#if 0
static double const true_grey[] = { 1.0, 1.0, .0625, .125, .25, .50, .75};
#endif
gnome_print_setrgbcolor (context,
back_col->gdk_color.red * grey[pattern] / (double) 0xffff,
back_col->gdk_color.green * grey[pattern] / (double) 0xffff,
back_col->gdk_color.blue * grey[pattern] / (double) 0xffff);
}
/* This is a special case where the user has selected
* 'foreground solid', so we need to paint it the pattern
* color.
*/
if (pattern == 24) {
GnmColor const *pat_col = gnm_style_get_pattern_color (mstyle);
g_return_val_if_fail (pat_col != NULL, FALSE);
gnome_print_setrgbcolor (context,
pat_col->gdk_color.red / (double) 0xffff,
pat_col->gdk_color.green / (double) 0xffff,
pat_col->gdk_color.blue / (double) 0xffff);
}
#if 0
/* FIXME: How to do the other patterns? */
if (pattern > 1) {
GnmColor const *pat_col = gnm_style_get_pattern_color (mstyle);
g_return_val_if_fail (pat_col != NULL, FALSE);
gdk_gc_set_fill (gc, GDK_OPAQUE_STIPPLED);
gdk_gc_set_rgb_fg_color (gc, &pat_col->color);
gdk_gc_set_rgb_bg_color (gc, back);
gdk_gc_set_stipple (gc,
gnumeric_pattern_get_stipple (XXX,
pattern));
foo_canvas_set_stipple_origin (canvas, gc);
} else {
gdk_gc_set_fill (gc, GDK_SOLID);
gdk_gc_set_rgb_fg_color (gc, back);
}
#endif
return TRUE;
}
return FALSE;
}
#endif
/*
* gnumeric_background_set_gtk : Set up a cairo context to paint the
* background of a cell when printing.
......
......@@ -4,10 +4,6 @@
#include "style.h"
#include <goffice/cut-n-paste/foocanvas/foo-canvas.h>
#ifdef WITH_GNOME_PRINT
#include <libgnomeprint/gnome-print.h>
#endif
#define GNUMERIC_SHEET_PATTERNS 25
gboolean gnumeric_background_set_gc (GnmStyle const *style,
......@@ -16,9 +12,4 @@ gboolean gnumeric_background_set_gc (GnmStyle const *style,
gboolean gnumeric_background_set_gtk (GnmStyle const *style,
cairo_t *context);
#ifdef WITH_GNOME_PRINT
gboolean gnumeric_background_set_pc (GnmStyle const *style,
GnomePrintContext *context);
#endif
#endif /* GNUMERIC_PATTERN_H */