Cosmetic cleanups.
2006-06-12 Matthias Clasen <mclasen@redhat.com> * gtk/gtkprintjob.c: * gtk/gtkprintbackend.c: * gtk/gtkpagesetupunixdialog.c: * gtk/gtkprintunixdialog.c: Cosmetic cleanups.
This commit is contained in:

committed by
Matthias Clasen

parent
4d01cb2ca4
commit
01e3463f91
@ -1,3 +1,10 @@
|
|||||||
|
2006-06-12 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkprintjob.c:
|
||||||
|
* gtk/gtkprintbackend.c:
|
||||||
|
* gtk/gtkpagesetupunixdialog.c:
|
||||||
|
* gtk/gtkprintunixdialog.c: Cosmetic cleanups.
|
||||||
|
|
||||||
2006-06-11 Matthias Clasen <mclasen@redhat.com>
|
2006-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkassistant.c: Add an accessible implementation in
|
* gtk/gtkassistant.c: Add an accessible implementation in
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2006-06-12 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkprintjob.c:
|
||||||
|
* gtk/gtkprintbackend.c:
|
||||||
|
* gtk/gtkpagesetupunixdialog.c:
|
||||||
|
* gtk/gtkprintunixdialog.c: Cosmetic cleanups.
|
||||||
|
|
||||||
2006-06-11 Matthias Clasen <mclasen@redhat.com>
|
2006-06-11 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/gtkassistant.c: Add an accessible implementation in
|
* gtk/gtkassistant.c: Add an accessible implementation in
|
||||||
|
@ -602,7 +602,8 @@ get_current_page_setup (GtkPageSetupUnixDialog *dialog)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
page_setup_is_equal (GtkPageSetup *a, GtkPageSetup *b)
|
page_setup_is_equal (GtkPageSetup *a,
|
||||||
|
GtkPageSetup *b)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
gtk_paper_size_is_equal (gtk_page_setup_get_paper_size (a),
|
gtk_paper_size_is_equal (gtk_page_setup_get_paper_size (a),
|
||||||
@ -614,7 +615,8 @@ page_setup_is_equal (GtkPageSetup *a, GtkPageSetup *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
page_setup_is_same_size (GtkPageSetup *a, GtkPageSetup *b)
|
page_setup_is_same_size (GtkPageSetup *a,
|
||||||
|
GtkPageSetup *b)
|
||||||
{
|
{
|
||||||
return gtk_paper_size_is_equal (gtk_page_setup_get_paper_size (a),
|
return gtk_paper_size_is_equal (gtk_page_setup_get_paper_size (a),
|
||||||
gtk_page_setup_get_paper_size (b));
|
gtk_page_setup_get_paper_size (b));
|
||||||
@ -796,7 +798,8 @@ printer_changed_callback (GtkComboBox *combo_box,
|
|||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
/* If we're waiting for a specific printer but the user changed
|
/* If we're waiting for a specific printer but the user changed
|
||||||
to another printer, cancel that wait. */
|
* to another printer, cancel that wait.
|
||||||
|
*/
|
||||||
if (priv->waiting_for_printer)
|
if (priv->waiting_for_printer)
|
||||||
{
|
{
|
||||||
g_free (priv->waiting_for_printer);
|
g_free (priv->waiting_for_printer);
|
||||||
|
@ -193,11 +193,11 @@ _gtk_print_backend_module_create (GtkPrintBackendModule *pb_module)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkPrintBackend *
|
static GtkPrintBackend *
|
||||||
_gtk_print_backend_create (const char *backend_name)
|
_gtk_print_backend_create (const gchar *backend_name)
|
||||||
{
|
{
|
||||||
GSList *l;
|
GSList *l;
|
||||||
char *module_path;
|
gchar *module_path;
|
||||||
char *full_name;
|
gchar *full_name;
|
||||||
GtkPrintBackendModule *pb_module;
|
GtkPrintBackendModule *pb_module;
|
||||||
GtkPrintBackend *pb;
|
GtkPrintBackend *pb;
|
||||||
|
|
||||||
@ -229,8 +229,9 @@ _gtk_print_backend_create (const char *backend_name)
|
|||||||
pb = _gtk_print_backend_module_create (pb_module);
|
pb = _gtk_print_backend_module_create (pb_module);
|
||||||
|
|
||||||
/* Increase use-count so that we don't unload print backends.
|
/* Increase use-count so that we don't unload print backends.
|
||||||
There is a problem with module unloading in the cups module,
|
* There is a problem with module unloading in the cups module,
|
||||||
see cups_dispatch_watch_finalize for details. */
|
* see cups_dispatch_watch_finalize for details.
|
||||||
|
*/
|
||||||
g_type_module_use (G_TYPE_MODULE (pb_module));
|
g_type_module_use (G_TYPE_MODULE (pb_module));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,8 +239,6 @@ _gtk_print_backend_create (const char *backend_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return pb;
|
return pb;
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -267,7 +266,7 @@ gtk_print_backend_initialize (void)
|
|||||||
|
|
||||||
|
|
||||||
GList *
|
GList *
|
||||||
gtk_print_backend_load_modules ()
|
gtk_print_backend_load_modules (void)
|
||||||
{
|
{
|
||||||
GList *result;
|
GList *result;
|
||||||
GtkPrintBackend *backend;
|
GtkPrintBackend *backend;
|
||||||
@ -312,10 +311,10 @@ static void fallback_printer_request_details (GtkPrinter
|
|||||||
static gboolean fallback_printer_mark_conflicts (GtkPrinter *printer,
|
static gboolean fallback_printer_mark_conflicts (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options);
|
GtkPrinterOptionSet *options);
|
||||||
static void fallback_printer_get_hard_margins (GtkPrinter *printer,
|
static void fallback_printer_get_hard_margins (GtkPrinter *printer,
|
||||||
double *top,
|
gdouble *top,
|
||||||
double *bottom,
|
gdouble *bottom,
|
||||||
double *left,
|
gdouble *left,
|
||||||
double *right);
|
gdouble *right);
|
||||||
static GList * fallback_printer_list_papers (GtkPrinter *printer);
|
static GList * fallback_printer_list_papers (GtkPrinter *printer);
|
||||||
static GtkPrintCapabilities fallback_printer_get_capabilities (GtkPrinter *printer);
|
static GtkPrintCapabilities fallback_printer_get_capabilities (GtkPrinter *printer);
|
||||||
|
|
||||||
@ -401,7 +400,8 @@ gtk_print_backend_dispose (GObject *object)
|
|||||||
priv = backend->priv;
|
priv = backend->priv;
|
||||||
|
|
||||||
/* We unref the printers in dispose, not in finalize so that
|
/* We unref the printers in dispose, not in finalize so that
|
||||||
we can break refcount cycles with gtk_print_backend_destroy */
|
* we can break refcount cycles with gtk_print_backend_destroy
|
||||||
|
*/
|
||||||
if (priv->printers)
|
if (priv->printers)
|
||||||
{
|
{
|
||||||
g_hash_table_destroy (priv->printers);
|
g_hash_table_destroy (priv->printers);
|
||||||
@ -418,7 +418,7 @@ fallback_printer_request_details (GtkPrinter *printer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
fallback_printer_mark_conflicts (GtkPrinter *printer,
|
fallback_printer_mark_conflicts (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options)
|
GtkPrinterOptionSet *options)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -426,10 +426,10 @@ fallback_printer_mark_conflicts (GtkPrinter *printer,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
fallback_printer_get_hard_margins (GtkPrinter *printer,
|
fallback_printer_get_hard_margins (GtkPrinter *printer,
|
||||||
double *top,
|
gdouble *top,
|
||||||
double *bottom,
|
gdouble *bottom,
|
||||||
double *left,
|
gdouble *left,
|
||||||
double *right)
|
gdouble *right)
|
||||||
{
|
{
|
||||||
*top = 0;
|
*top = 0;
|
||||||
*bottom = 0;
|
*bottom = 0;
|
||||||
@ -451,9 +451,9 @@ fallback_printer_get_capabilities (GtkPrinter *printer)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
printer_hash_to_sorted_active_list (const gchar *key,
|
printer_hash_to_sorted_active_list (const gchar *key,
|
||||||
gpointer value,
|
gpointer value,
|
||||||
GList **out_list)
|
GList **out_list)
|
||||||
{
|
{
|
||||||
GtkPrinter *printer;
|
GtkPrinter *printer;
|
||||||
|
|
||||||
@ -471,7 +471,7 @@ printer_hash_to_sorted_active_list (const gchar *key,
|
|||||||
|
|
||||||
void
|
void
|
||||||
gtk_print_backend_add_printer (GtkPrintBackend *backend,
|
gtk_print_backend_add_printer (GtkPrintBackend *backend,
|
||||||
GtkPrinter *printer)
|
GtkPrinter *printer)
|
||||||
{
|
{
|
||||||
GtkPrintBackendPrivate *priv;
|
GtkPrintBackendPrivate *priv;
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ gtk_print_backend_add_printer (GtkPrintBackend *backend,
|
|||||||
|
|
||||||
void
|
void
|
||||||
gtk_print_backend_remove_printer (GtkPrintBackend *backend,
|
gtk_print_backend_remove_printer (GtkPrintBackend *backend,
|
||||||
GtkPrinter *printer)
|
GtkPrinter *printer)
|
||||||
{
|
{
|
||||||
GtkPrintBackendPrivate *priv;
|
GtkPrintBackendPrivate *priv;
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ gtk_print_backend_get_printer_list (GtkPrintBackend *backend)
|
|||||||
priv->printer_list_requested = TRUE;
|
priv->printer_list_requested = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -550,7 +550,7 @@ gtk_print_backend_printer_list_is_done (GtkPrintBackend *print_backend)
|
|||||||
|
|
||||||
GtkPrinter *
|
GtkPrinter *
|
||||||
gtk_print_backend_find_printer (GtkPrintBackend *backend,
|
gtk_print_backend_find_printer (GtkPrintBackend *backend,
|
||||||
const gchar *printer_name)
|
const gchar *printer_name)
|
||||||
{
|
{
|
||||||
GtkPrintBackendPrivate *priv;
|
GtkPrintBackendPrivate *priv;
|
||||||
GtkPrinter *printer;
|
GtkPrinter *printer;
|
||||||
@ -568,12 +568,12 @@ gtk_print_backend_find_printer (GtkPrintBackend *backend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_print_backend_print_stream (GtkPrintBackend *backend,
|
gtk_print_backend_print_stream (GtkPrintBackend *backend,
|
||||||
GtkPrintJob *job,
|
GtkPrintJob *job,
|
||||||
gint data_fd,
|
gint data_fd,
|
||||||
GtkPrintJobCompleteFunc callback,
|
GtkPrintJobCompleteFunc callback,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify dnotify)
|
GDestroyNotify dnotify)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_PRINT_BACKEND (backend));
|
g_return_if_fail (GTK_IS_PRINT_BACKEND (backend));
|
||||||
|
|
||||||
@ -589,11 +589,11 @@ void
|
|||||||
gtk_print_backend_destroy (GtkPrintBackend *print_backend)
|
gtk_print_backend_destroy (GtkPrintBackend *print_backend)
|
||||||
{
|
{
|
||||||
/* The lifecycle of print backends and printers are tied, such that
|
/* The lifecycle of print backends and printers are tied, such that
|
||||||
the backend owns the printers, but the printers also ref the backend.
|
* the backend owns the printers, but the printers also ref the backend.
|
||||||
This is so that if the app has a reference to a printer its backend
|
* This is so that if the app has a reference to a printer its backend
|
||||||
will be around. However, this results in a cycle, which we break
|
* will be around. However, this results in a cycle, which we break
|
||||||
with this call, which causes the print backend to release its printers.
|
* with this call, which causes the print backend to release its printers.
|
||||||
*/
|
*/
|
||||||
g_object_run_dispose (G_OBJECT (print_backend));
|
g_object_run_dispose (G_OBJECT (print_backend));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ struct _GtkPrintJobPrivate
|
|||||||
{
|
{
|
||||||
gchar *title;
|
gchar *title;
|
||||||
|
|
||||||
int spool_file_fd;
|
gint spool_file_fd;
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
|
|
||||||
GtkPrintStatus status;
|
GtkPrintStatus status;
|
||||||
@ -457,8 +457,8 @@ gtk_print_job_get_surface (GtkPrintJob *job,
|
|||||||
g_return_val_if_fail (priv->spool_file_fd == -1, NULL);
|
g_return_val_if_fail (priv->spool_file_fd == -1, NULL);
|
||||||
|
|
||||||
priv->spool_file_fd = g_file_open_tmp ("gtkprint_XXXXXX",
|
priv->spool_file_fd = g_file_open_tmp ("gtkprint_XXXXXX",
|
||||||
&filename,
|
&filename,
|
||||||
error);
|
error);
|
||||||
if (priv->spool_file_fd == -1)
|
if (priv->spool_file_fd == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -470,8 +470,8 @@ gtk_print_job_get_surface (GtkPrintJob *job,
|
|||||||
height = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
|
height = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
|
||||||
|
|
||||||
priv->surface = _gtk_printer_create_cairo_surface (priv->printer,
|
priv->surface = _gtk_printer_create_cairo_surface (priv->printer,
|
||||||
width, height,
|
width, height,
|
||||||
priv->spool_file_fd);
|
priv->spool_file_fd);
|
||||||
|
|
||||||
return priv->surface;
|
return priv->surface;
|
||||||
}
|
}
|
||||||
@ -493,7 +493,7 @@ gtk_print_job_get_surface (GtkPrintJob *job,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gtk_print_job_set_track_print_status (GtkPrintJob *job,
|
gtk_print_job_set_track_print_status (GtkPrintJob *job,
|
||||||
gboolean track_status)
|
gboolean track_status)
|
||||||
{
|
{
|
||||||
GtkPrintJobPrivate *priv;
|
GtkPrintJobPrivate *priv;
|
||||||
|
|
||||||
@ -501,7 +501,14 @@ gtk_print_job_set_track_print_status (GtkPrintJob *job,
|
|||||||
|
|
||||||
priv = job->priv;
|
priv = job->priv;
|
||||||
|
|
||||||
priv->track_print_status = track_status;
|
track_status = track_status != FALSE;
|
||||||
|
|
||||||
|
if (priv->track_print_status != track_status)
|
||||||
|
{
|
||||||
|
priv->track_print_status = track_status;
|
||||||
|
|
||||||
|
g_object_notify (job, "track-status");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,7 +106,7 @@ enum {
|
|||||||
PRINTER_LIST_N_COLS
|
PRINTER_LIST_N_COLS
|
||||||
};
|
};
|
||||||
|
|
||||||
#define _EXTENTION_POINT_MAIN_PAGE_CUSTOM_INPUT "gtk-main-page-custom-input"
|
#define _EXTENSION_POINT_MAIN_PAGE_CUSTOM_INPUT "gtk-main-page-custom-input"
|
||||||
|
|
||||||
struct GtkPrintUnixDialogPrivate
|
struct GtkPrintUnixDialogPrivate
|
||||||
{
|
{
|
||||||
@ -164,15 +164,17 @@ struct GtkPrintUnixDialogPrivate
|
|||||||
|
|
||||||
GHashTable *extension_points;
|
GHashTable *extension_points;
|
||||||
|
|
||||||
/* These are set initially on selected printer (either default printer, printer
|
/* These are set initially on selected printer (either default printer,
|
||||||
* taken from set settings, or user-selected), but when any setting is changed
|
* printer taken from set settings, or user-selected), but when any setting
|
||||||
* by the user it is cleared */
|
* is changed by the user it is cleared.
|
||||||
|
*/
|
||||||
GtkPrintSettings *initial_settings;
|
GtkPrintSettings *initial_settings;
|
||||||
|
|
||||||
/* This is the initial printer set by set_settings. We look for it in the
|
/* This is the initial printer set by set_settings. We look for it in the
|
||||||
* added printers. We clear this whenever the user manually changes
|
* added printers. We clear this whenever the user manually changes
|
||||||
* to another printer, when the user changes a setting or when we find
|
* to another printer, when the user changes a setting or when we find
|
||||||
* this printer */
|
* this printer.
|
||||||
|
*/
|
||||||
char *waiting_for_printer;
|
char *waiting_for_printer;
|
||||||
gboolean internal_printer_change;
|
gboolean internal_printer_change;
|
||||||
|
|
||||||
@ -184,7 +186,7 @@ struct GtkPrintUnixDialogPrivate
|
|||||||
gulong options_changed_handler;
|
gulong options_changed_handler;
|
||||||
gulong mark_conflicts_id;
|
gulong mark_conflicts_id;
|
||||||
|
|
||||||
char *format_for_printer;
|
gchar *format_for_printer;
|
||||||
|
|
||||||
gint current_page;
|
gint current_page;
|
||||||
};
|
};
|
||||||
@ -193,7 +195,7 @@ G_DEFINE_TYPE (GtkPrintUnixDialog, gtk_print_unix_dialog, GTK_TYPE_DIALOG)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_default_printer (GtkPrintUnixDialog *dialog,
|
is_default_printer (GtkPrintUnixDialog *dialog,
|
||||||
GtkPrinter *printer)
|
GtkPrinter *printer)
|
||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
|
|
||||||
@ -679,7 +681,7 @@ wrap_in_frame (const gchar *label,
|
|||||||
GtkWidget *child)
|
GtkWidget *child)
|
||||||
{
|
{
|
||||||
GtkWidget *frame, *alignment, *label_widget;
|
GtkWidget *frame, *alignment, *label_widget;
|
||||||
char *bold_text;
|
gchar *bold_text;
|
||||||
|
|
||||||
label_widget = gtk_label_new ("");
|
label_widget = gtk_label_new ("");
|
||||||
gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
|
||||||
@ -763,7 +765,7 @@ add_option_to_table (GtkPrinterOption *option,
|
|||||||
{
|
{
|
||||||
GtkTable *table;
|
GtkTable *table;
|
||||||
GtkWidget *label, *widget;
|
GtkWidget *label, *widget;
|
||||||
int row;
|
gint row;
|
||||||
|
|
||||||
table = GTK_TABLE (user_data);
|
table = GTK_TABLE (user_data);
|
||||||
|
|
||||||
@ -904,7 +906,7 @@ update_dialog_from_settings (GtkPrintUnixDialog *dialog)
|
|||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
GList *groups, *l;
|
GList *groups, *l;
|
||||||
char *group;
|
gchar *group;
|
||||||
GtkWidget *table, *frame;
|
GtkWidget *table, *frame;
|
||||||
gboolean has_advanced, has_job;
|
gboolean has_advanced, has_job;
|
||||||
|
|
||||||
@ -1104,7 +1106,7 @@ schedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
priv->mark_conflicts_id = g_idle_add (mark_conflicts_callback,
|
priv->mark_conflicts_id = g_idle_add (mark_conflicts_callback,
|
||||||
dialog);
|
dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1471,7 +1473,7 @@ create_main_page (GtkPrintUnixDialog *dialog)
|
|||||||
gtk_widget_show (custom_input);
|
gtk_widget_show (custom_input);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), custom_input, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), custom_input, FALSE, FALSE, 0);
|
||||||
g_hash_table_insert (priv->extension_points,
|
g_hash_table_insert (priv->extension_points,
|
||||||
_EXTENTION_POINT_MAIN_PAGE_CUSTOM_INPUT,
|
_EXTENSION_POINT_MAIN_PAGE_CUSTOM_INPUT,
|
||||||
custom_input);
|
custom_input);
|
||||||
|
|
||||||
hbox = gtk_hbox_new (FALSE, 18);
|
hbox = gtk_hbox_new (FALSE, 18);
|
||||||
@ -1568,8 +1570,7 @@ create_main_page (GtkPrintUnixDialog *dialog)
|
|||||||
label = gtk_label_new (_("General"));
|
label = gtk_label_new (_("General"));
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
|
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), main_vbox, label);
|
||||||
main_vbox, label);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -1583,11 +1584,11 @@ dialog_get_page_ranges (GtkPrintUnixDialog *dialog,
|
|||||||
gint *n_ranges_out)
|
gint *n_ranges_out)
|
||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
int i, n_ranges;
|
gint i, n_ranges;
|
||||||
const char *text, *p;
|
const gchar *text, *p;
|
||||||
char *next;
|
gchar *next;
|
||||||
GtkPageRange *ranges;
|
GtkPageRange *ranges;
|
||||||
int start, end;
|
gint start, end;
|
||||||
|
|
||||||
text = gtk_entry_get_text (GTK_ENTRY (priv->page_range_entry));
|
text = gtk_entry_get_text (GTK_ENTRY (priv->page_range_entry));
|
||||||
|
|
||||||
@ -1654,7 +1655,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
|
|||||||
gint n_ranges)
|
gint n_ranges)
|
||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
int i;
|
gint i;
|
||||||
GString *s = g_string_new ("");
|
GString *s = g_string_new ("");
|
||||||
|
|
||||||
for (i = 0; i < n_ranges; i++)
|
for (i = 0; i < n_ranges; i++)
|
||||||
@ -1667,8 +1668,7 @@ dialog_set_page_ranges (GtkPrintUnixDialog *dialog,
|
|||||||
g_string_append (s, ",");
|
g_string_append (s, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_entry_set_text (GTK_ENTRY (priv->page_range_entry),
|
gtk_entry_set_text (GTK_ENTRY (priv->page_range_entry), s->str);
|
||||||
s->str);
|
|
||||||
|
|
||||||
g_string_free (s, TRUE);
|
g_string_free (s, TRUE);
|
||||||
}
|
}
|
||||||
@ -1688,7 +1688,8 @@ dialog_get_print_pages (GtkPrintUnixDialog *dialog)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dialog_set_print_pages (GtkPrintUnixDialog *dialog, GtkPrintPages pages)
|
dialog_set_print_pages (GtkPrintUnixDialog *dialog,
|
||||||
|
GtkPrintPages pages)
|
||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
|
|
||||||
@ -1785,8 +1786,8 @@ static gint
|
|||||||
dialog_get_pages_per_sheet (GtkPrintUnixDialog *dialog)
|
dialog_get_pages_per_sheet (GtkPrintUnixDialog *dialog)
|
||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
const char *val;
|
const gchar *val;
|
||||||
int num;
|
gint num;
|
||||||
|
|
||||||
val = gtk_printer_option_widget_get_value (priv->pages_per_sheet);
|
val = gtk_printer_option_widget_get_value (priv->pages_per_sheet);
|
||||||
|
|
||||||
@ -1810,15 +1811,15 @@ draw_page_cb (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
GtkPrintUnixDialogPrivate *priv = dialog->priv;
|
||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
double ratio;
|
gdouble ratio;
|
||||||
int w, h, tmp, shadow_offset;
|
gint w, h, tmp, shadow_offset;
|
||||||
int pages_x, pages_y, i, x, y, layout_w, layout_h;
|
gint pages_x, pages_y, i, x, y, layout_w, layout_h;
|
||||||
double page_width, page_height;
|
gdouble page_width, page_height;
|
||||||
GtkPageOrientation orientation;
|
GtkPageOrientation orientation;
|
||||||
gboolean landscape;
|
gboolean landscape;
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
PangoFontDescription *font;
|
PangoFontDescription *font;
|
||||||
char *text;
|
gchar *text;
|
||||||
GdkColor *color;
|
GdkColor *color;
|
||||||
|
|
||||||
orientation = gtk_page_setup_get_orientation (priv->page_setup);
|
orientation = gtk_page_setup_get_orientation (priv->page_setup);
|
||||||
@ -2586,9 +2587,9 @@ gtk_print_unix_dialog_set_settings (GtkPrintUnixDialog *dialog,
|
|||||||
GtkPrintSettings *settings)
|
GtkPrintSettings *settings)
|
||||||
{
|
{
|
||||||
GtkPrintUnixDialogPrivate *priv;
|
GtkPrintUnixDialogPrivate *priv;
|
||||||
const char *printer;
|
const gchar *printer;
|
||||||
GtkPageRange *ranges;
|
GtkPageRange *ranges;
|
||||||
int num_ranges;
|
gint num_ranges;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
|
g_return_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog));
|
||||||
g_return_if_fail (settings == NULL || GTK_IS_PRINT_SETTINGS (settings));
|
g_return_if_fail (settings == NULL || GTK_IS_PRINT_SETTINGS (settings));
|
||||||
@ -2652,7 +2653,7 @@ gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog)
|
|||||||
GtkPrintSettings *settings;
|
GtkPrintSettings *settings;
|
||||||
GtkPrintPages print_pages;
|
GtkPrintPages print_pages;
|
||||||
GtkPageRange *ranges;
|
GtkPageRange *ranges;
|
||||||
int n_ranges;
|
gint n_ranges;
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), NULL);
|
g_return_val_if_fail (GTK_IS_PRINT_UNIX_DIALOG (dialog), NULL);
|
||||||
|
|
||||||
@ -2706,8 +2707,8 @@ gtk_print_unix_dialog_get_settings (GtkPrintUnixDialog *dialog)
|
|||||||
|
|
||||||
void
|
void
|
||||||
gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
|
gtk_print_unix_dialog_add_custom_tab (GtkPrintUnixDialog *dialog,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
GtkWidget *tab_label)
|
GtkWidget *tab_label)
|
||||||
{
|
{
|
||||||
gtk_notebook_insert_page (GTK_NOTEBOOK (dialog->priv->notebook),
|
gtk_notebook_insert_page (GTK_NOTEBOOK (dialog->priv->notebook),
|
||||||
child, tab_label, 2);
|
child, tab_label, 2);
|
||||||
|
Reference in New Issue
Block a user