|
GnuCash 2.4.99
|
Defines | |
| #define | GNC_GTK_PRINT_SETTINGS_EXPORT_DIR "gnc-pdf-export-directory" |
Functions | |
| void | gnc_print_operation_save_print_settings (GtkPrintOperation *op) |
| void | gnc_print_operation_init (GtkPrintOperation *op, const gchar *jobname) |
| void | gnc_ui_page_setup (GtkWindow *parent) |
| GtkPrintSettings * | gnc_print_get_settings (void) |
| #define GNC_GTK_PRINT_SETTINGS_EXPORT_DIR "gnc-pdf-export-directory" |
Key for saving the PDF-export directory in the print settings
Definition at line 70 of file print-session.h.
| GtkPrintSettings* gnc_print_get_settings | ( | void | ) |
Returns the pointer to our static GtkPrintSettings object. Watch out: This might get modified by other threads.
Definition at line 117 of file print-session.c.
{
return print_settings;
}
| void gnc_print_operation_init | ( | GtkPrintOperation * | op, |
| const gchar * | jobname | ||
| ) |
If print settings have been saved by gnc_print_operation_save_print_settings(), then set them on the given GtkPrintOperation op. Set the default page setup as well.
| op | non-NULL print operation |
| jobname | non-NULL print job name |
Definition at line 60 of file print-session.c.
{
g_return_if_fail(op);
/* Restore print settings */
G_LOCK(print_settings);
if (print_settings)
gtk_print_operation_set_print_settings(op, print_settings);
G_UNLOCK(print_settings);
/* Restore page setup */
G_LOCK(page_setup);
if (page_setup)
gtk_print_operation_set_default_page_setup(op, page_setup);
G_UNLOCK(page_setup);
gtk_print_operation_set_job_name ( op, jobname);
}
| void gnc_print_operation_save_print_settings | ( | GtkPrintOperation * | op | ) |
Retrieve the print settings from the GtkPrintOperation op and save them in a static variable.
| op | non-NULL print operation |
Definition at line 48 of file print-session.c.
{
g_return_if_fail(op);
G_LOCK(print_settings);
if (print_settings)
g_object_unref(print_settings);
print_settings = g_object_ref(gtk_print_operation_get_print_settings(op));
G_UNLOCK(print_settings);
}
| void gnc_ui_page_setup | ( | GtkWindow * | parent | ) |
Run a page setup dialog and save the resulting GtkPageSetup in a static variable.
| parent | Transient parent, or NULL |
Definition at line 80 of file print-session.c.
{
GtkPrintSettings *settings = NULL;
GtkPageSetup *old_page_setup, *new_page_setup;
/* Get a reference to the current print settings */
G_LOCK(print_settings);
settings = print_settings;
if (settings)
g_object_ref(settings);
G_UNLOCK(print_settings);
/* Get a reference to the current page setup */
G_LOCK(page_setup);
old_page_setup = page_setup;
if (old_page_setup)
g_object_ref(old_page_setup);
G_UNLOCK(page_setup);
/* Run dialog */
new_page_setup = gtk_print_run_page_setup_dialog(parent, old_page_setup,
settings);
/* Save new page setup */
G_LOCK(page_setup);
if (page_setup)
g_object_unref(page_setup);
page_setup = new_page_setup;
G_UNLOCK(page_setup);
/* Release references */
if (settings)
g_object_unref(settings);
if (old_page_setup)
g_object_unref(old_page_setup);
}
1.7.4