Commit 17b569dd authored by Morten Welinder's avatar Morten Welinder

Namespace

parent f4915422
......@@ -29,6 +29,8 @@ Morten:
* Fix spinner properties dialog.
* SheetObjectImage fixes.
* Fix problem reading images from xls.
* Namespace fixes
--------------------------------------------------------------------------
Gnumeric 1.12.20
......
......@@ -832,7 +832,7 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
static void
excel_init_margins (ExcelReadSheet *esheet)
{
PrintInformation *pi;
GnmPrintInformation *pi;
double points;
double short_points;
......@@ -4605,7 +4605,7 @@ excel_read_GUTS (BiffQuery *q, ExcelReadSheet *esheet)
static void
excel_read_SETUP (BiffQuery *q, ExcelReadSheet *esheet)
{
PrintInformation *pi = esheet->sheet->print_info;
GnmPrintInformation *pi = esheet->sheet->print_info;
guint16 flags;
gboolean rotate_paper = FALSE;
gboolean portrait_orientation = TRUE;
......@@ -6367,7 +6367,7 @@ excel_read_HEADER_FOOTER (GnmXLImporter const *importer,
BiffQuery *q, ExcelReadSheet *esheet,
gboolean is_header)
{
PrintInformation *pi = esheet->sheet->print_info;
GnmPrintInformation *pi = esheet->sheet->print_info;
if (q->length) {
char *str;
......@@ -6446,7 +6446,7 @@ static void
excel_read_MARGIN (BiffQuery *q, ExcelReadSheet *esheet)
{
double m;
PrintInformation *pi = esheet->sheet->print_info;
GnmPrintInformation *pi = esheet->sheet->print_info;
XL_CHECK_CONDITION (q->length >= 8);
m = GO_IN_TO_PT (gsf_le_get_double (q->data));
......
......@@ -735,7 +735,7 @@ xls_header_footer_export1 (GString *res, const char *s, const char *section)
char *
xls_header_footer_export (const PrintHF *hf)
xls_header_footer_export (const GnmPrintHF *hf)
{
GString *res = g_string_new (NULL);
......@@ -747,7 +747,7 @@ xls_header_footer_export (const PrintHF *hf)
}
void
xls_header_footer_import (PrintHF *hf, const char *txt)
xls_header_footer_import (GnmPrintHF *hf, const char *txt)
{
char section = 'L';
GString *accum;
......
......@@ -102,8 +102,8 @@ unsigned xls_paper_size (GtkPaperSize *ps, gboolean rotated);
/*****************************************************************************/
char *xls_header_footer_export (const PrintHF *hf);
void xls_header_footer_import (PrintHF *hf, const char *txt);
char *xls_header_footer_export (const GnmPrintHF *hf);
void xls_header_footer_import (GnmPrintHF *hf, const char *txt);
/*****************************************************************************/
......
......@@ -166,7 +166,7 @@ gnm_color_to_bgr (GnmColor const *c)
static int
map_pattern_to_xl (int i)
{
static int const map_to_excel[GNUMERIC_SHEET_PATTERNS + 1] = {
static int const map_to_excel[GNM_PATTERNS_MAX + 1] = {
0,
1, 3, 2, 4, 17, 18,
5, 6, 8, 7, 9, 10,
......@@ -536,7 +536,7 @@ points_to_inches (double pts)
void
excel_write_SETUP (BiffPut *bp, ExcelWriteSheet *esheet)
{
PrintInformation *pi = NULL;
GnmPrintInformation *pi = NULL;
double header = 0., footer = 0.;
guint8 *data = ms_biff_put_len_next (bp, BIFF_SETUP, 34);
guint16 flags = 0;
......@@ -5108,7 +5108,7 @@ excel_write_PAGE_BREAK (BiffPut *bp, GnmPageBreaks const *breaks)
}
static void
excel_write_HEADER_FOOTER (BiffPut *bp, PrintHF const *hf, int id)
excel_write_HEADER_FOOTER (BiffPut *bp, GnmPrintHF const *hf, int id)
{
char *s = xls_header_footer_export (hf);
......@@ -5127,7 +5127,7 @@ static void
write_sheet_head (BiffPut *bp, ExcelWriteSheet *esheet)
{
guint8 *data;
PrintInformation *pi;
GnmPrintInformation *pi;
Sheet const *sheet = esheet->gnum_sheet;
Workbook const *wb = sheet->workbook;
double left;
......
......@@ -1714,11 +1714,11 @@ static void
xlsx_sheet_page_setup (G_GNUC_UNUSED GsfXMLIn *xin, G_GNUC_UNUSED xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
PrintInformation *pi = state->sheet->print_info;
GnmPrintInformation *pi = state->sheet->print_info;
gboolean tmp;
if (pi->page_setup == NULL)
print_info_load_defaults (pi);
gnm_print_info_load_defaults (pi);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_bool (xin, attrs, "fitToPage", &tmp))
......@@ -1766,7 +1766,7 @@ xlsx_paper_size (gdouble width, gdouble height, GtkUnit unit, int code)
}
static gboolean
xlsx_set_paper_from_code (PrintInformation *pi, int code)
xlsx_set_paper_from_code (GnmPrintInformation *pi, int code)
{
XLSXPaperDefs paper[] =
{{ 0 , 0 , 0 , GTK_UNIT_MM , NULL },
......@@ -1915,7 +1915,7 @@ static void
xlsx_CT_PageSetup (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
PrintInformation *pi = state->sheet->print_info;
GnmPrintInformation *pi = state->sheet->print_info;
int orient, paper_code = 0, scale, tmp_int;
gboolean orient_set = FALSE, first_page_number = TRUE, tmp_bool;
gnm_float width = 0., height = 0.;
......@@ -1945,7 +1945,7 @@ xlsx_CT_PageSetup (GsfXMLIn *xin, xmlChar const **attrs)
};
if (pi->page_setup == NULL)
print_info_load_defaults (pi);
gnm_print_info_load_defaults (pi);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_enum (xin, attrs, "orientation", orientation_types, &orient))
......@@ -1995,7 +1995,7 @@ xlsx_CT_PageMargins (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
gnm_float margin;
PrintInformation *pi = state->sheet->print_info;
GnmPrintInformation *pi = state->sheet->print_info;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_float (xin, attrs, "left", &margin))
......@@ -2017,7 +2017,7 @@ static void
xlsx_CT_oddheader_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
PrintInformation *pi = state->sheet->print_info;
GnmPrintInformation *pi = state->sheet->print_info;
xls_header_footer_import (pi->header, xin->content->str);
}
......@@ -2025,7 +2025,7 @@ static void
xlsx_CT_oddfooter_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
PrintInformation *pi = state->sheet->print_info;
GnmPrintInformation *pi = state->sheet->print_info;
xls_header_footer_import (pi->footer, xin->content->str);
}
......
......@@ -2514,7 +2514,7 @@ xlsx_find_paper_code (GtkPaperSize *psize)
static void
xlsx_write_print_info_hf (XLSXWriteState *state, GsfXMLOut *xml,
const PrintHF *hf, const char *hftext)
const GnmPrintHF *hf, const char *hftext)
{
char *s = xls_header_footer_export (hf);
......@@ -2528,7 +2528,7 @@ xlsx_write_print_info_hf (XLSXWriteState *state, GsfXMLOut *xml,
static void
xlsx_write_print_info (XLSXWriteState *state, GsfXMLOut *xml)
{
PrintInformation *pi = state->sheet->print_info;
GnmPrintInformation *pi = state->sheet->print_info;
double h_margin, f_margin;
double left;
double right;
......@@ -2742,7 +2742,7 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *wb_part, Sheet *sheet)
char const *chart_drawing_rel_id = NULL;
char const *legacy_drawing_rel_id = NULL;
GnmStyle **col_styles;
PrintInformation *pi = NULL;
GnmPrintInformation *pi = NULL;
GHashTable *zorder;
int z;
......
......@@ -1838,7 +1838,7 @@ gnumeric_get_link (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
sheet = (a->sheet == NULL) ? ei->pos->sheet : a->sheet;
gnm_cellpos_init_cellref (&pos, a, &(ei->pos->eval), sheet);
link = sheet_hlink_find (sheet, &pos);
link = gnm_sheet_hlink_find (sheet, &pos);
if (link)
return value_new_string (gnm_hlink_get_target (link));
......
......@@ -467,8 +467,8 @@ struct _OOParseState {
GnmPageBreaks *h, *v;
} page_breaks;
PrintInformation *cur_pi;
PrintHF *cur_hf;
GnmPrintInformation *cur_pi;
GnmPrintHF *cur_hf;
char **cur_hf_format;
int rep_rows_from;
int rep_rows_to;
......@@ -2365,7 +2365,7 @@ odf_pi_parse_format (GsfXMLIn *xin, char **fmt)
}
static void
odf_pi_parse_hf (GsfXMLIn *xin, PrintHF *hf)
odf_pi_parse_hf (GsfXMLIn *xin, GnmPrintHF *hf)
{
odf_pi_parse_format (xin, &hf->left_format);
odf_pi_parse_format (xin, &hf->middle_format);
......@@ -2373,7 +2373,7 @@ odf_pi_parse_hf (GsfXMLIn *xin, PrintHF *hf)
}
static void
odf_pi_parse_expressions (GsfXMLIn *xin, PrintInformation *pi)
odf_pi_parse_expressions (GsfXMLIn *xin, GnmPrintInformation *pi)
{
odf_pi_parse_hf (xin, pi->header);
odf_pi_parse_hf (xin, pi->footer);
......@@ -2410,13 +2410,13 @@ oo_table_start (GsfXMLIn *xin, xmlChar const **attrs)
if (style_name != NULL) {
OOSheetStyle const *style = g_hash_table_lookup (state->styles.sheet, style_name);
if (style) {
PrintInformation *pi = NULL;
GnmPrintInformation *pi = NULL;
if (style->master_page_name)
pi = g_hash_table_lookup (state->styles.master_pages,
style->master_page_name);
if (pi != NULL) {
print_info_free (state->pos.sheet->print_info);
state->pos.sheet->print_info = print_info_dup (pi);
gnm_print_info_free (state->pos.sheet->print_info);
state->pos.sheet->print_info = gnm_print_info_dup (pi);
odf_pi_parse_expressions (xin, state->pos.sheet->print_info);
}
g_object_set (state->pos.sheet,
......@@ -5733,7 +5733,7 @@ odf_header_properties (GsfXMLIn *xin, xmlChar const **attrs)
if (state->print.cur_pi == NULL)
return;
gps = print_info_get_page_setup (state->print.cur_pi);
gps = gnm_print_info_get_page_setup (state->print.cur_pi);
page_margin = gtk_page_setup_get_top_margin (gps, GTK_UNIT_POINTS);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
......@@ -5757,7 +5757,7 @@ odf_footer_properties (GsfXMLIn *xin, xmlChar const **attrs)
if (state->print.cur_pi == NULL)
return;
gps = print_info_get_page_setup (state->print.cur_pi);
gps = gnm_print_info_get_page_setup (state->print.cur_pi);
page_margin = gtk_page_setup_get_bottom_margin (gps, GTK_UNIT_POINTS);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
......@@ -5803,7 +5803,7 @@ odf_page_layout_properties (GsfXMLIn *xin, xmlChar const **attrs)
if (state->print.cur_pi == NULL)
return;
gps = print_info_get_page_setup (state->print.cur_pi);
gps = gnm_print_info_get_page_setup (state->print.cur_pi);
gtk_page_setup_set_orientation (gps, GTK_PAGE_ORIENTATION_PORTRAIT);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
......@@ -5901,7 +5901,7 @@ odf_page_layout (GsfXMLIn *xin, xmlChar const **attrs)
oo_warning (xin, _("Missing page layout identifier"));
name = "Missing page layout identifier";
}
state->print.cur_pi = print_information_new (TRUE);
state->print.cur_pi = gnm_print_information_new (TRUE);
g_hash_table_insert (state->styles.page_layouts, g_strdup (name),
state->print.cur_pi);
}
......@@ -5937,7 +5937,7 @@ odf_master_page (GsfXMLIn *xin, xmlChar const **attrs)
OOParseState *state = (OOParseState *)xin->user_state;
char const *name = NULL;
char const *pl_name = NULL;
PrintInformation *pi = NULL;
GnmPrintInformation *pi = NULL;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_STYLE, "name"))
......@@ -5951,19 +5951,19 @@ odf_master_page (GsfXMLIn *xin, xmlChar const **attrs)
if (pi == NULL) {
if (state->ver != OOO_VER_1) /* For OOO_VER_1 this may be acceptable */
oo_warning (xin, _("Master page style without page layout encountered!"));
state->print.cur_pi = print_information_new (TRUE);
state->print.cur_pi = gnm_print_information_new (TRUE);
} else
state->print.cur_pi = print_info_dup (pi);
state->print.cur_pi = gnm_print_info_dup (pi);
if (name == NULL) {
oo_warning (xin, _("Master page style without name encountered!"));
name = "Master page style without name encountered!";
}
print_hf_free (state->print.cur_pi->header);
print_hf_free (state->print.cur_pi->footer);
state->print.cur_pi->header = print_hf_new (NULL, NULL, NULL);
state->print.cur_pi->footer = print_hf_new (NULL, NULL, NULL);
gnm_print_hf_free (state->print.cur_pi->header);
gnm_print_hf_free (state->print.cur_pi->footer);
state->print.cur_pi->header = gnm_print_hf_new (NULL, NULL, NULL);
state->print.cur_pi->footer = gnm_print_hf_new (NULL, NULL, NULL);
g_hash_table_insert (state->styles.master_pages, g_strdup (name), state->print.cur_pi);
}
......@@ -6005,7 +6005,7 @@ odf_header_footer (GsfXMLIn *xin, xmlChar const **attrs)
if (state->print.cur_pi == NULL)
return;
gps = print_info_get_page_setup (state->print.cur_pi);
gps = gnm_print_info_get_page_setup (state->print.cur_pi);
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (oo_attr_bool (xin, attrs, OO_NS_STYLE, "display",
......@@ -13354,10 +13354,10 @@ openoffice_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *io_cont
(GDestroyNotify) odf_oo_cell_style_unref);
state.styles.master_pages = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) print_info_free);
(GDestroyNotify) gnm_print_info_free);
state.styles.page_layouts = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) print_info_free);
(GDestroyNotify) gnm_print_info_free);
state.formats = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) go_format_unref);
......
......@@ -299,7 +299,7 @@ table_master_page_style_name (GnmOOExport *state, Sheet const *sheet)
}
static char *
page_layout_name (GnmOOExport *state, PrintInformation *pi)
page_layout_name (GnmOOExport *state, GnmPrintInformation *pi)
{
return oo_item_name (state, OO_ITEM_PAGE_LAYOUT, pi);
}
......@@ -5250,7 +5250,7 @@ odf_master_styles_to_xl_styles (GnmOOExport *state)
Sheet const *sheet = workbook_sheet_by_index (state->wb, i);
if (sheet->print_info->page_setup == NULL)
print_info_load_defaults (sheet->print_info);
gnm_print_info_load_defaults (sheet->print_info);
if (sheet->print_info->header != NULL) {
odf_hf_region_to_xl_styles
......@@ -5320,12 +5320,12 @@ odf_write_hf_region (GnmOOExport *state, char const *format, char const *id)
}
static void
odf_write_hf (GnmOOExport *state, PrintInformation *pi, char const *id, gboolean header)
odf_write_hf (GnmOOExport *state, GnmPrintInformation *pi, char const *id, gboolean header)
{
PrintHF *hf = header ? pi->header : pi->footer;
GnmPrintHF *hf = header ? pi->header : pi->footer;
double page_margin;
double hf_height;
GtkPageSetup *gps = print_info_get_page_setup (pi);
GtkPageSetup *gps = gnm_print_info_get_page_setup (pi);
if (hf == NULL)
return;
......@@ -5458,12 +5458,12 @@ odf_write_office_styles (GnmOOExport *state)
}
static void
odf_write_hf_style (GnmOOExport *state, PrintInformation *pi, char const *id, gboolean header)
odf_write_hf_style (GnmOOExport *state, GnmPrintInformation *pi, char const *id, gboolean header)
{
PrintHF *hf = header ? pi->header : pi->footer;
GnmPrintHF *hf = header ? pi->header : pi->footer;
double page_margin;
double hf_height;
GtkPageSetup *gps = print_info_get_page_setup (pi);
GtkPageSetup *gps = gnm_print_info_get_page_setup (pi);
if (hf == NULL)
return;
......@@ -5493,7 +5493,7 @@ odf_write_hf_style (GnmOOExport *state, PrintInformation *pi, char const *id, gb
static void
odf_write_page_layout (GnmOOExport *state, PrintInformation *pi,
odf_write_page_layout (GnmOOExport *state, GnmPrintInformation *pi,
Sheet const *sheet)
{
static char const *centre_type [] = {
......@@ -5504,7 +5504,7 @@ odf_write_page_layout (GnmOOExport *state, PrintInformation *pi,
NULL };
char *name = page_layout_name (state, pi);
GtkPageSetup *gps = print_info_get_page_setup (pi);
GtkPageSetup *gps = gnm_print_info_get_page_setup (pi);
int i;
GtkPageOrientation orient = gtk_page_setup_get_orientation (gps);
gboolean landscape = !(orient == GTK_PAGE_ORIENTATION_PORTRAIT ||
......
......@@ -5744,7 +5744,7 @@ typedef struct {
GnmCommand cmd;
GSList *old_pi;
PrintInformation *new_pi;
GnmPrintInformation *new_pi;
} CmdPrintSetup;
MAKE_GNM_COMMAND (CmdPrintSetup, cmd_print_setup, NULL)
......@@ -5768,9 +5768,9 @@ cmd_print_setup_undo (GnmCommand *cmd, WorkbookControl *wbc)
g_return_val_if_fail (me->old_pi != NULL, TRUE);
if (me->cmd.sheet) {
PrintInformation *pi = me->old_pi->data;
print_info_free (me->cmd.sheet->print_info);
me->cmd.sheet->print_info = print_info_dup (pi);
GnmPrintInformation *pi = me->old_pi->data;
gnm_print_info_free (me->cmd.sheet->print_info);
me->cmd.sheet->print_info = gnm_print_info_dup (pi);
if (me->cmd.sheet->sheet_type == GNM_SHEET_OBJECT)
update_sheet_graph_cb (me->cmd.sheet);
} else {
......@@ -5780,13 +5780,13 @@ cmd_print_setup_undo (GnmCommand *cmd, WorkbookControl *wbc)
g_return_val_if_fail (g_slist_length (infos) == n, TRUE);
for (i = 0 ; i < n ; i++) {
PrintInformation *pi = infos->data;
GnmPrintInformation *pi = infos->data;
Sheet *sheet = workbook_sheet_by_index (book, i);
g_return_val_if_fail (infos != NULL, TRUE);
print_info_free (sheet->print_info);
sheet->print_info = print_info_dup (pi);
gnm_print_info_free (sheet->print_info);
sheet->print_info = gnm_print_info_dup (pi);
if (sheet->sheet_type == GNM_SHEET_OBJECT)
update_sheet_graph_cb (sheet);
infos = infos->next;
......@@ -5807,8 +5807,8 @@ cmd_print_setup_redo (GnmCommand *cmd, WorkbookControl *wbc)
if (save_pis)
me->old_pi = g_slist_append (me->old_pi, me->cmd.sheet->print_info);
else
print_info_free (me->cmd.sheet->print_info);
me->cmd.sheet->print_info = print_info_dup (me->new_pi);
gnm_print_info_free (me->cmd.sheet->print_info);
me->cmd.sheet->print_info = gnm_print_info_dup (me->new_pi);
if (me->cmd.sheet->sheet_type == GNM_SHEET_OBJECT)
update_sheet_graph_cb (me->cmd.sheet);
} else {
......@@ -5820,8 +5820,8 @@ cmd_print_setup_redo (GnmCommand *cmd, WorkbookControl *wbc)
if (save_pis)
me->old_pi = g_slist_prepend (me->old_pi, sheet->print_info);
else
print_info_free (sheet->print_info);
sheet->print_info = print_info_dup (me->new_pi);
gnm_print_info_free (sheet->print_info);
sheet->print_info = gnm_print_info_dup (me->new_pi);
if (sheet->sheet_type == GNM_SHEET_OBJECT)
update_sheet_graph_cb (sheet);
}
......@@ -5838,15 +5838,15 @@ cmd_print_setup_finalize (GObject *cmd)
GSList *list = me->old_pi;
if (me->new_pi)
print_info_free (me->new_pi);
gnm_print_info_free (me->new_pi);
for (; list; list = list->next)
print_info_free ((PrintInformation *) list->data);
gnm_print_info_free ((GnmPrintInformation *) list->data);
g_slist_free (me->old_pi);
gnm_command_finalize (cmd);
}
gboolean
cmd_print_setup (WorkbookControl *wbc, Sheet *sheet, PrintInformation const *pi)
cmd_print_setup (WorkbookControl *wbc, Sheet *sheet, GnmPrintInformation const *pi)
{
CmdPrintSetup *me;
......@@ -5860,7 +5860,7 @@ cmd_print_setup (WorkbookControl *wbc, Sheet *sheet, PrintInformation const *pi)
else
me->cmd.cmd_descriptor = g_strdup (_("Page Setup For All Sheets"));
me->old_pi = NULL;
me->new_pi = print_info_dup (pi);
me->new_pi = gnm_print_info_dup (pi);
return gnm_command_push_undo (wbc, G_OBJECT (me));
}
......
......@@ -133,7 +133,7 @@ gboolean cmd_merge_data (WorkbookControl *wbc, Sheet *sheet,
GnmValue *merge_zone, GSList *merge_fields, GSList *merge_data);
gboolean cmd_change_meta_data (WorkbookControl *wbc, GSList *changes, GSList *removed);
gboolean cmd_print_setup (WorkbookControl *wbc, Sheet *sheet, PrintInformation const *pi);
gboolean cmd_print_setup (WorkbookControl *wbc, Sheet *sheet, GnmPrintInformation const *pi);
gboolean cmd_define_name (WorkbookControl *wbc, char const *name,
GnmParsePos const *pp,
GnmExprTop const *texpr,
......
......@@ -109,7 +109,7 @@ struct _PrinterSetupState {
WBCGtk *wbcg;
Sheet *sheet;
GtkBuilder *gui;
PrintInformation *pi;
GnmPrintInformation *pi;
GtkWidget *dialog;
GtkWidget *sheet_selector;
......@@ -145,8 +145,8 @@ struct _PrinterSetupState {
GnmExprEntry *left_entry;
/* The header and footer data. */
PrintHF *header;
PrintHF *footer;
GnmPrintHF *header;
GnmPrintHF *footer;
/* The header and footer customize dialogs. */
GtkWidget *customize_header;
......@@ -184,7 +184,7 @@ struct _HFCustomizeState {
GtkWidget *dialog;
GtkBuilder *gui;
PrinterSetupState *printer_setup_state;
PrintHF **hf;
GnmPrintHF **hf;
gboolean is_header;
GtkTextBuffer *left_buffer;
GtkTextBuffer *middle_buffer;
......@@ -871,13 +871,13 @@ static void
display_hf_preview (PrinterSetupState *state, gboolean header)
{
gchar *text = NULL;
PrintHF *sample = NULL;
HFRenderInfo *hfi;
GnmPrintHF *sample = NULL;
GnmPrintHFRenderInfo *hfi;
HFPreviewInfo *pi;
g_return_if_fail (state != NULL);
hfi = hf_render_info_new ();
hfi = gnm_print_hf_render_info_new ();
hfi->page = 1;
hfi->pages = 99;
......@@ -891,19 +891,19 @@ display_hf_preview (PrinterSetupState *state, gboolean header)
sample = state->footer;
}
text = hf_format_render (sample->left_format, hfi, HF_RENDER_PRINT);
text = gnm_print_hf_format_render (sample->left_format, hfi, HF_RENDER_PRINT);
goc_item_set (pi->left, "text", text ? text : "", NULL);
g_free (text);
text = hf_format_render (sample->middle_format, hfi, HF_RENDER_PRINT);
text = gnm_print_hf_format_render (sample->middle_format, hfi, HF_RENDER_PRINT);
goc_item_set (pi->middle, "text", text ? text : "", NULL);
g_free (text);
text = hf_format_render (sample->right_format, hfi, HF_RENDER_PRINT);
text = gnm_print_hf_format_render (sample->right_format, hfi, HF_RENDER_PRINT);
goc_item_set (pi->right, "text", text ? text : "", NULL);
g_free (text);
hf_render_info_destroy (hfi);
gnm_print_hf_render_info_destroy (hfi);
}
static void
......@@ -921,15 +921,15 @@ do_footer_customize (PrinterSetupState *state)
static void
header_changed (GtkComboBox *menu, PrinterSetupState *state)
{
GList *selection = g_list_nth (hf_formats,
GList *selection = g_list_nth (gnm_print_hf_formats,
gtk_combo_box_get_active (menu));
PrintHF *format = (selection)? selection->data: NULL;
GnmPrintHF *format = (selection)? selection->data: NULL;
if (format == NULL) {
do_header_customize (state);
} else {
print_hf_free (state->header);
state->header = print_hf_copy (format);
gnm_print_hf_free (state->header);
state->header = gnm_print_hf_copy (format);
}
display_hf_preview (state, TRUE);
......@@ -938,15 +938,15 @@ header_changed (GtkComboBox *menu, PrinterSetupState *state)
static void
footer_changed (GtkComboBox *menu, PrinterSetupState *state)
{
GList *selection = g_list_nth (hf_formats,
GList *selection = g_list_nth (gnm_print_hf_formats,
gtk_combo_box_get_active (menu));
PrintHF *format = (selection)? selection->data: NULL;
GnmPrintHF *format = (selection)? selection->data: NULL;
if (format == NULL) {
do_footer_customize (state);
} else {
print_hf_free (state->footer);
state->footer = print_hf_copy (format);
gnm_print_hf_free (state->footer);
state->footer = gnm_print_hf_copy (format);
}
display_hf_preview (state, FALSE);
......@@ -977,15 +977,15 @@ create_hf_name (char const *left, char const *middle, char const *right)
}
static void
append_hf_item (GtkListStore *store, PrintHF *format, HFRenderInfo *hfi)
append_hf_item (GtkListStore *store, GnmPrintHF *format, GnmPrintHFRenderInfo *hfi)
{
GtkTreeIter iter;
char *left, *middle, *right;
char *res;
left = hf_format_render (format->left_format, hfi, HF_RENDER_PRINT);
middle = hf_format_render (format->middle_format, hfi, HF_RENDER_PRINT);
right = hf_format_render (format->right_format, hfi, HF_RENDER_PRINT);
left = gnm_print_hf_format_render (format->left_format, hfi, HF_RENDER_PRINT);
middle = gnm_print_hf_format_render (format->middle_format, hfi, HF_RENDER_PRINT);
right = gnm_print_hf_format_render (format->right_format, hfi, HF_RENDER_PRINT);
res = create_hf_name (left, middle, right);
......@@ -1009,12 +1009,12 @@ static void
fill_hf (PrinterSetupState *state, GtkComboBox *om, GCallback callback, gboolean header)
{
GList *l;
HFRenderInfo *hfi;
GnmPrintHFRenderInfo *hfi;
GtkListStore *store;
PrintHF *select = header ? state->header : state->footer;
GnmPrintHF *select = header ? state->header : state->footer;
int i, idx = -1;
hfi = hf_render_info_new ();
hfi = gnm_print_hf_render_info_new ();
hfi->page = 1;
hfi->pages = 99;
......@@ -1022,10 +1022,10 @@ fill_hf (PrinterSetupState *state, GtkComboBox *om, GCallback callback, gboolean
gtk_combo_box_set_model (om, GTK_TREE_MODEL (store));
g_object_unref (store);
for (i = 0, l = hf_formats; l; l = l->next, i++) {
PrintHF *format = l->data;
for (i = 0, l = gnm_print_hf_formats; l; l = l->next, i++) {
GnmPrintHF *format = l->data;
if (print_hf_same (format, select))
if (gnm_print_hf_same (format, select))
idx = i;
append_hf_item (store, format, hfi);
......@@ -1037,7 +1037,7 @@ fill_hf (PrinterSetupState *state, GtkComboBox *om, GCallback callback, gboolean
gtk_combo_box_set_active (om, idx);
g_signal_connect (G_OBJECT (om), "changed", callback, state);
hf_render_info_destroy (hfi);
gnm_print_hf_render_info_destroy (hfi);
}
static void
......@@ -1052,9 +1052,9 @@ do_setup_hf_menus (PrinterSetupState *state)
footer = GTK_COMBO_BOX (go_gtk_builder_get_widget (state->gui, "option-menu-footer"));
if (state->header)
print_hf_register (state->header);
gnm_print_hf_register (state->header);
if (state->footer)
print_hf_register (state->footer);
gnm_print_hf_register (state->footer);
if (state->header)
fill_hf (state, header, G_CALLBACK (header_changed), TRUE);
......@@ -1396,14 +1396,14 @@ hf_customize_apply (HFCustomizeState *hf_state)
middle_format = text_get (hf_state, hf_state->middle_buffer);
right_format = text_get (hf_state, hf_state->right_buffer);
print_hf_free (*(hf_state->hf));
*(hf_state->hf) = print_hf_new (left_format, middle_format, right_format);
gnm_print_hf_free (*(hf_state->hf));
*(hf_state->hf) = gnm_print_hf_new (left_format, middle_format, right_format);
g_free (left_format);
g_free (middle_format);
g_free (right_format);
print_hf_register (*(hf_state->hf));
gnm_print_hf_register (*(hf_state->hf));
do_setup_hf_menus (hf_state->printer_setup_state);
display_hf_preview (hf_state->printer_setup_state, hf_state->is_header);
......@@ -2106,10 +2106,10 @@ do_setup_hf (PrinterSetupState *state)
"text", 0,
NULL);
state->header = print_hf_copy (state->pi->header ? state->pi->header :