gboolean outline_flag, gboolean reverse_flag);
static void print_sheets_merge (GnomePrintConfig *config, glLabel * label,
- GList *record_list,
gboolean preview_flag,
gint n_copies, gint first,
gboolean collate_flag,
GtkWidget *wframe;
GtkWidget *copies = NULL, *prmerge = NULL;
GtkWidget *wvbox, *outline_check, *reverse_check;
- GList *record_list;
gint n_records;
vbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
prmerge = gl_wdgt_print_merge_new (label);
gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), prmerge);
- record_list = gl_merge_read_record_list (merge);
-
- n_records = gl_merge_count_records( record_list );
+ n_records = gl_merge_get_record_count( merge );
gl_wdgt_print_merge_set_copies (GL_WDGT_PRINT_MERGE(prmerge),
n_copies, first, n_records,
collate_flag);
GtkWidget *printer_select;
GnomePrintConfig *config;
glMerge *merge;
- GList *record_list;
switch (response) {
} else {
- record_list = gl_merge_read_record_list (merge);
gl_wdgt_print_merge_get_copies (GL_WDGT_PRINT_MERGE (prmerge),
&n_copies, &first,
&collate_flag);
- print_sheets_merge (config, label, record_list,
+ print_sheets_merge (config, label,
(response == GNOME_PRINT_DIALOG_RESPONSE_PREVIEW),
n_copies, first,
collate_flag,
/*---------------------------------------------------------------------------*/
static void
print_sheets (GnomePrintConfig *config,
- glLabel * label,
- gboolean preview_flag,
- gint n_sheets,
- gint first,
- gint last,
- gboolean outline_flag,
- gboolean reverse_flag)
+ glLabel *label,
+ gboolean preview_flag,
+ gint n_sheets,
+ gint first,
+ gint last,
+ gboolean outline_flag,
+ gboolean reverse_flag)
{
GnomePrintMaster *master;
/*---------------------------------------------------------------------------*/
static void
print_sheets_merge (GnomePrintConfig *config,
- glLabel * label,
- GList * record_list,
- gboolean preview_flag,
- gint n_copies,
- gint first,
- gboolean collate_flag,
- gboolean outline_flag,
- gboolean reverse_flag)
+ glLabel *label,
+ gboolean preview_flag,
+ gint n_copies,
+ gint first,
+ gboolean collate_flag,
+ gboolean outline_flag,
+ gboolean reverse_flag)
{
GnomePrintMaster *master;
master = gnome_print_master_new_from_config (config);
if ( collate_flag ) {
- gl_print_merge_collated (master, label, record_list,
+ gl_print_merge_collated (master, label,
n_copies, first,
outline_flag, reverse_flag);
} else {
- gl_print_merge_uncollated (master, label, record_list,
+ gl_print_merge_uncollated (master, label,
n_copies, first,
outline_flag, reverse_flag);
}
void
gl_print_merge_collated (GnomePrintMaster *master,
glLabel *label,
- GList *record_list,
gint n_copies,
gint first,
gboolean outline_flag,
gboolean reverse_flag)
{
- PrintInfo *pi;
- gint i_sheet, i_label, n_labels_per_page, i_copy;
- glMergeRecord *record;
- GList *p;
- glTemplateOrigin *origins;
+ glMerge *merge;
+ const GList *record_list;
+ PrintInfo *pi;
+ gint i_sheet, i_label, n_labels_per_page, i_copy;
+ glMergeRecord *record;
+ GList *p;
+ glTemplateOrigin *origins;
gl_debug (DEBUG_PRINT, "START");
+ merge = gl_label_get_merge (label);
+ record_list = gl_merge_get_record_list (merge);
+
pi = print_info_new (master, label);
n_labels_per_page = gl_template_get_n_labels (pi->template);
i_sheet = 0;
i_label = first - 1;
- for ( p=record_list; p!=NULL; p=p->next ) {
+ for ( p=(GList *)record_list; p!=NULL; p=p->next ) {
record = (glMergeRecord *)p->data;
if ( record->select_flag ) {
for (i_copy = 0; i_copy < n_copies; i_copy++) {
if ((i_label == 0) || (i_sheet == 0)) {
+ i_sheet++;
print_page_begin (pi);
}
void
gl_print_merge_uncollated (GnomePrintMaster *master,
glLabel *label,
- GList *record_list,
gint n_copies,
gint first,
gboolean outline_flag,
gboolean reverse_flag)
{
- PrintInfo *pi;
- gint i_sheet, i_label, n_labels_per_page, i_copy;
- glMergeRecord *record;
- GList *p;
- glTemplateOrigin *origins;
+ glMerge *merge;
+ const GList *record_list;
+ PrintInfo *pi;
+ gint i_sheet, i_label, n_labels_per_page, i_copy;
+ glMergeRecord *record;
+ GList *p;
+ glTemplateOrigin *origins;
gl_debug (DEBUG_PRINT, "START");
+ merge = gl_label_get_merge (label);
+ record_list = gl_merge_get_record_list (merge);
+
pi = print_info_new (master, label);
n_labels_per_page = gl_template_get_n_labels (pi->template);
for (i_copy = 0; i_copy < n_copies; i_copy++) {
- for ( p=record_list; p!=NULL; p=p->next ) {
+ for ( p=(GList *)record_list; p!=NULL; p=p->next ) {
record = (glMergeRecord *)p->data;
if ( record->select_flag ) {
if ((i_label == 0) || (i_sheet == 0)) {
+ i_sheet++;
print_page_begin (pi);
}
gboolean reverse_flag)
{
gint n_per_page;
- GList *record_list = NULL;
glMerge *merge;
glTemplate *template;
gl_print_simple (master, label, n_sheets, 1, n_per_page,
outline_flag, reverse_flag);
} else {
- record_list = gl_merge_read_record_list (merge);
-
- gl_print_merge_collated (master, label, record_list,
- n_copies, 1,
+ gl_print_merge_collated (master, label, n_copies, 1,
outline_flag, reverse_flag);
}
gl_template_free (&template);
{
gchar *str;
+ gl_debug (DEBUG_PRINT, "START");
+
pi->sheet++;
str = g_strdup_printf ("sheet%02d", pi->sheet);
/* Translate and scale, so that our origin is at the upper left. */
gnome_print_translate (pi->pc, 0.0, pi->page_height);
gnome_print_scale (pi->pc, 1.0, -1.0);
+
+ gl_debug (DEBUG_PRINT, "END");
}
/*---------------------------------------------------------------------------*/
static void
print_page_end (PrintInfo *pi)
{
+ gl_debug (DEBUG_PRINT, "START");
+
gnome_print_showpage (pi->pc);
+
+ gl_debug (DEBUG_PRINT, "END");
}
/*---------------------------------------------------------------------------*/