Add a GtkPrintSettings parameter to the printer_create_cairo_surface
2006-06-16 Matthias Clasen <mclasen@redhat.com> * gtk/gtkprintbackend.h: Add a GtkPrintSettings parameter to the printer_create_cairo_surface method. * modules/printbackends/pdf/gtkprintbackendpdf.c: * modules/printbackends/cups/gtkprintbackendcups.c: * modules/printbackends/lpr/gtkprintbackendlpr.c: * gtk/gtkprinter.c (_gtk_printer_create_cairo_surface): * gtk/gtkprinter-private.h: * gtk/gtkprintjob.c (gtk_print_job_get_surface): Adapt all users.
This commit is contained in:

committed by
Matthias Clasen

parent
a0063d39d2
commit
956bcb4393
10
ChangeLog
10
ChangeLog
@ -1,5 +1,15 @@
|
|||||||
2006-06-16 Matthias Clasen <mclasen@redhat.com>
|
2006-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkprintbackend.h: Add a GtkPrintSettings parameter to the
|
||||||
|
printer_create_cairo_surface method.
|
||||||
|
|
||||||
|
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||||
|
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||||
|
* modules/printbackends/lpr/gtkprintbackendlpr.c:
|
||||||
|
* gtk/gtkprinter.c (_gtk_printer_create_cairo_surface):
|
||||||
|
* gtk/gtkprinter-private.h:
|
||||||
|
* gtk/gtkprintjob.c (gtk_print_job_get_surface): Adapt all users.
|
||||||
|
|
||||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_finalize): Don't
|
* gtk/gtkentrycompletion.c (gtk_entry_completion_finalize): Don't
|
||||||
leak match data. (#345107, Christian Weiske)
|
leak match data. (#345107, Christian Weiske)
|
||||||
|
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
2006-06-16 Matthias Clasen <mclasen@redhat.com>
|
2006-06-16 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkprintbackend.h: Add a GtkPrintSettings parameter to the
|
||||||
|
printer_create_cairo_surface method.
|
||||||
|
|
||||||
|
* modules/printbackends/pdf/gtkprintbackendpdf.c:
|
||||||
|
* modules/printbackends/cups/gtkprintbackendcups.c:
|
||||||
|
* modules/printbackends/lpr/gtkprintbackendlpr.c:
|
||||||
|
* gtk/gtkprinter.c (_gtk_printer_create_cairo_surface):
|
||||||
|
* gtk/gtkprinter-private.h:
|
||||||
|
* gtk/gtkprintjob.c (gtk_print_job_get_surface): Adapt all users.
|
||||||
|
|
||||||
* gtk/gtkentrycompletion.c (gtk_entry_completion_finalize): Don't
|
* gtk/gtkentrycompletion.c (gtk_entry_completion_finalize): Don't
|
||||||
leak match data. (#345107, Christian Weiske)
|
leak match data. (#345107, Christian Weiske)
|
||||||
|
|
||||||
|
@ -70,49 +70,50 @@ struct _GtkPrintBackendClass
|
|||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
/* Global backend methods: */
|
/* Global backend methods: */
|
||||||
void (*request_printer_list) (GtkPrintBackend *backend);
|
void (*request_printer_list) (GtkPrintBackend *backend);
|
||||||
void (*print_stream) (GtkPrintBackend *backend,
|
void (*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);
|
||||||
|
|
||||||
/* Printer methods: */
|
/* Printer methods: */
|
||||||
void (*printer_request_details) (GtkPrinter *printer);
|
void (*printer_request_details) (GtkPrinter *printer);
|
||||||
cairo_surface_t * (*printer_create_cairo_surface) (GtkPrinter *printer,
|
cairo_surface_t * (*printer_create_cairo_surface) (GtkPrinter *printer,
|
||||||
gdouble height,
|
GtkPrintSettings *settings,
|
||||||
gdouble width,
|
gdouble height,
|
||||||
gint cache_fd);
|
gdouble width,
|
||||||
GtkPrinterOptionSet * (*printer_get_options) (GtkPrinter *printer,
|
gint cache_fd);
|
||||||
GtkPrintSettings *settings,
|
GtkPrinterOptionSet * (*printer_get_options) (GtkPrinter *printer,
|
||||||
GtkPageSetup *page_setup);
|
GtkPrintSettings *settings,
|
||||||
gboolean (*printer_mark_conflicts) (GtkPrinter *printer,
|
GtkPageSetup *page_setup);
|
||||||
|
gboolean (*printer_mark_conflicts) (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options);
|
GtkPrinterOptionSet *options);
|
||||||
void (*printer_get_settings_from_options) (GtkPrinter *printer,
|
void (*printer_get_settings_from_options) (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options,
|
GtkPrinterOptionSet *options,
|
||||||
GtkPrintSettings *settings);
|
GtkPrintSettings *settings);
|
||||||
void (*printer_prepare_for_print) (GtkPrinter *printer,
|
void (*printer_prepare_for_print) (GtkPrinter *printer,
|
||||||
GtkPrintJob *print_job,
|
GtkPrintJob *print_job,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup);
|
GtkPageSetup *page_setup);
|
||||||
GList * (*printer_list_papers) (GtkPrinter *printer);
|
GList * (*printer_list_papers) (GtkPrinter *printer);
|
||||||
void (*printer_get_hard_margins) (GtkPrinter *printer,
|
void (*printer_get_hard_margins) (GtkPrinter *printer,
|
||||||
double *top,
|
double *top,
|
||||||
double *bottom,
|
double *bottom,
|
||||||
double *left,
|
double *left,
|
||||||
double *right);
|
double *right);
|
||||||
GtkPrintCapabilities (*printer_get_capabilities) (GtkPrinter *printer);
|
GtkPrintCapabilities (*printer_get_capabilities) (GtkPrinter *printer);
|
||||||
|
|
||||||
/* Signals */
|
/* Signals */
|
||||||
void (*printer_list_changed) (GtkPrintBackend *backend);
|
void (*printer_list_changed) (GtkPrintBackend *backend);
|
||||||
void (*printer_list_done) (GtkPrintBackend *backend);
|
void (*printer_list_done) (GtkPrintBackend *backend);
|
||||||
void (*printer_added) (GtkPrintBackend *backend,
|
void (*printer_added) (GtkPrintBackend *backend,
|
||||||
GtkPrinter *printer);
|
GtkPrinter *printer);
|
||||||
void (*printer_removed) (GtkPrintBackend *backend,
|
void (*printer_removed) (GtkPrintBackend *backend,
|
||||||
GtkPrinter *printer);
|
GtkPrinter *printer);
|
||||||
void (*printer_status_changed) (GtkPrintBackend *backend,
|
void (*printer_status_changed) (GtkPrintBackend *backend,
|
||||||
GtkPrinter *printer);
|
GtkPrinter *printer);
|
||||||
|
|
||||||
/* Padding for future expansion */
|
/* Padding for future expansion */
|
||||||
void (*_gtk_reserved1) (void);
|
void (*_gtk_reserved1) (void);
|
||||||
|
@ -45,6 +45,7 @@ void _gtk_printer_prepare_for_print (GtkPrinter
|
|||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup);
|
GtkPageSetup *page_setup);
|
||||||
cairo_surface_t * _gtk_printer_create_cairo_surface (GtkPrinter *printer,
|
cairo_surface_t * _gtk_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
|
GtkPrintSettings *settings,
|
||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height,
|
gdouble height,
|
||||||
gint cache_fd);
|
gint cache_fd);
|
||||||
|
@ -749,14 +749,16 @@ _gtk_printer_prepare_for_print (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cairo_surface_t *
|
cairo_surface_t *
|
||||||
_gtk_printer_create_cairo_surface (GtkPrinter *printer,
|
_gtk_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
gdouble width,
|
GtkPrintSettings *settings,
|
||||||
gdouble height,
|
gdouble width,
|
||||||
gint cache_fd)
|
gdouble height,
|
||||||
|
gint cache_fd)
|
||||||
{
|
{
|
||||||
GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
|
GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
|
||||||
|
|
||||||
return backend_class->printer_create_cairo_surface (printer, width, height, cache_fd);
|
return backend_class->printer_create_cairo_surface (printer, settings,
|
||||||
|
width, height, cache_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
GList *
|
GList *
|
||||||
|
@ -248,30 +248,38 @@ gtk_print_backend_cups_class_init (GtkPrintBackendCupsClass *class)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cairo_status_t
|
static cairo_status_t
|
||||||
_cairo_write_to_cups (void *cache_fd_as_pointer,
|
_cairo_write_to_cups (void *closure,
|
||||||
const unsigned char *data,
|
const unsigned char *data,
|
||||||
unsigned int length)
|
unsigned int length)
|
||||||
{
|
{
|
||||||
cairo_status_t result;
|
gint fd = GPOINTER_TO_INT (closure);
|
||||||
gint cache_fd;
|
gssize written;
|
||||||
cache_fd = GPOINTER_TO_INT (cache_fd_as_pointer);
|
|
||||||
|
|
||||||
result = CAIRO_STATUS_WRITE_ERROR;
|
|
||||||
|
|
||||||
/* write out the buffer */
|
while (length > 0)
|
||||||
if (write (cache_fd, data, length) != -1)
|
{
|
||||||
result = CAIRO_STATUS_SUCCESS;
|
written = write (fd, data, length);
|
||||||
|
|
||||||
return result;
|
if (written == -1)
|
||||||
|
{
|
||||||
|
if (errno == EAGAIN || errno == EINTR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return CAIRO_STATUS_WRITE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += written;
|
||||||
|
length -= written;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static cairo_surface_t *
|
static cairo_surface_t *
|
||||||
cups_printer_create_cairo_surface (GtkPrinter *printer,
|
cups_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height,
|
gdouble height,
|
||||||
gint cache_fd)
|
gint cache_fd)
|
||||||
{
|
{
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
|
|
||||||
@ -303,8 +311,8 @@ cups_free_print_stream_data (CupsPrintStreamData *data)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_print_cb (GtkPrintBackendCups *print_backend,
|
cups_print_cb (GtkPrintBackendCups *print_backend,
|
||||||
GtkCupsResult *result,
|
GtkCupsResult *result,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
CupsPrintStreamData *ps = user_data;
|
CupsPrintStreamData *ps = user_data;
|
||||||
@ -362,12 +370,12 @@ add_cups_options (const char *key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_print_backend_cups_print_stream (GtkPrintBackend *print_backend,
|
gtk_print_backend_cups_print_stream (GtkPrintBackend *print_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)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error;
|
||||||
GtkPrinterCups *cups_printer;
|
GtkPrinterCups *cups_printer;
|
||||||
@ -503,7 +511,7 @@ cups_dispatch_watch_check (GSource *source)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
cups_dispatch_watch_prepare (GSource *source,
|
cups_dispatch_watch_prepare (GSource *source,
|
||||||
gint *timeout_)
|
gint *timeout_)
|
||||||
{
|
{
|
||||||
GtkPrintCupsDispatchWatch *dispatch;
|
GtkPrintCupsDispatchWatch *dispatch;
|
||||||
|
|
||||||
@ -515,9 +523,9 @@ cups_dispatch_watch_prepare (GSource *source,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
cups_dispatch_watch_dispatch (GSource *source,
|
cups_dispatch_watch_dispatch (GSource *source,
|
||||||
GSourceFunc callback,
|
GSourceFunc callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkPrintCupsDispatchWatch *dispatch;
|
GtkPrintCupsDispatchWatch *dispatch;
|
||||||
GtkPrintCupsResponseCallbackFunc ep_callback;
|
GtkPrintCupsResponseCallbackFunc ep_callback;
|
||||||
@ -576,12 +584,12 @@ static GSourceFuncs _cups_dispatch_watch_funcs = {
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_execute (GtkPrintBackendCups *print_backend,
|
cups_request_execute (GtkPrintBackendCups *print_backend,
|
||||||
GtkCupsRequest *request,
|
GtkCupsRequest *request,
|
||||||
GtkPrintCupsResponseCallbackFunc callback,
|
GtkPrintCupsResponseCallbackFunc callback,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify notify,
|
GDestroyNotify notify,
|
||||||
GError **err)
|
GError **err)
|
||||||
{
|
{
|
||||||
GtkPrintCupsDispatchWatch *dispatch;
|
GtkPrintCupsDispatchWatch *dispatch;
|
||||||
|
|
||||||
@ -600,8 +608,8 @@ cups_request_execute (GtkPrintBackendCups *print_backend,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_printer_info_cb (GtkPrintBackendCups *backend,
|
cups_request_printer_info_cb (GtkPrintBackendCups *backend,
|
||||||
GtkCupsResult *result,
|
GtkCupsResult *result,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ipp_attribute_t *attr;
|
ipp_attribute_t *attr;
|
||||||
ipp_t *response;
|
ipp_t *response;
|
||||||
@ -671,7 +679,7 @@ cups_request_printer_info_cb (GtkPrintBackendCups *backend,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_printer_info (GtkPrintBackendCups *print_backend,
|
cups_request_printer_info (GtkPrintBackendCups *print_backend,
|
||||||
const gchar *printer_name)
|
const gchar *printer_name)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error;
|
||||||
GtkCupsRequest *request;
|
GtkCupsRequest *request;
|
||||||
@ -723,7 +731,7 @@ typedef struct {
|
|||||||
} CupsJobPollData;
|
} CupsJobPollData;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
job_object_died (gpointer user_data,
|
job_object_died (gpointer user_data,
|
||||||
GObject *where_the_object_was)
|
GObject *where_the_object_was)
|
||||||
{
|
{
|
||||||
CupsJobPollData *data = user_data;
|
CupsJobPollData *data = user_data;
|
||||||
@ -741,8 +749,8 @@ cups_job_poll_data_free (CupsJobPollData *data)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
|
cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
|
||||||
GtkCupsResult *result,
|
GtkCupsResult *result,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
CupsJobPollData *data = user_data;
|
CupsJobPollData *data = user_data;
|
||||||
ipp_attribute_t *attr;
|
ipp_attribute_t *attr;
|
||||||
@ -858,8 +866,8 @@ cups_job_info_poll_timeout (gpointer user_data)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_begin_polling_info (GtkPrintBackendCups *print_backend,
|
cups_begin_polling_info (GtkPrintBackendCups *print_backend,
|
||||||
GtkPrintJob *job,
|
GtkPrintJob *job,
|
||||||
int job_id)
|
int job_id)
|
||||||
{
|
{
|
||||||
CupsJobPollData *data;
|
CupsJobPollData *data;
|
||||||
|
|
||||||
@ -876,7 +884,7 @@ cups_begin_polling_info (GtkPrintBackendCups *print_backend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mark_printer_inactive (GtkPrinter *printer,
|
mark_printer_inactive (GtkPrinter *printer,
|
||||||
GtkPrintBackend *backend)
|
GtkPrintBackend *backend)
|
||||||
{
|
{
|
||||||
gtk_printer_set_is_active (printer, FALSE);
|
gtk_printer_set_is_active (printer, FALSE);
|
||||||
@ -885,9 +893,10 @@ mark_printer_inactive (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
find_printer (GtkPrinter *printer, const char *find_name)
|
find_printer (GtkPrinter *printer,
|
||||||
|
const gchar *find_name)
|
||||||
{
|
{
|
||||||
const char *printer_name;
|
const gchar *printer_name;
|
||||||
|
|
||||||
printer_name = gtk_printer_get_name (printer);
|
printer_name = gtk_printer_get_name (printer);
|
||||||
return g_ascii_strcasecmp (printer_name, find_name);
|
return g_ascii_strcasecmp (printer_name, find_name);
|
||||||
@ -895,8 +904,8 @@ find_printer (GtkPrinter *printer, const char *find_name)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
|
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
|
||||||
GtkCupsResult *result,
|
GtkCupsResult *result,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ipp_attribute_t *attr;
|
ipp_attribute_t *attr;
|
||||||
ipp_t *response;
|
ipp_t *response;
|
||||||
@ -1147,8 +1156,8 @@ get_ppd_data_free (GetPPDData *data)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_ppd_cb (GtkPrintBackendCups *print_backend,
|
cups_request_ppd_cb (GtkPrintBackendCups *print_backend,
|
||||||
GtkCupsResult *result,
|
GtkCupsResult *result,
|
||||||
GetPPDData *data)
|
GetPPDData *data)
|
||||||
{
|
{
|
||||||
ipp_t *response;
|
ipp_t *response;
|
||||||
GtkPrinter *printer;
|
GtkPrinter *printer;
|
||||||
@ -1170,7 +1179,7 @@ cups_request_ppd_cb (GtkPrintBackendCups *print_backend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_ppd (GtkPrinter *printer)
|
cups_request_ppd (GtkPrinter *printer)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error;
|
||||||
GtkPrintBackend *print_backend;
|
GtkPrintBackend *print_backend;
|
||||||
@ -1234,8 +1243,8 @@ cups_request_ppd (GtkPrinter *printer)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_request_default_printer_cb (GtkPrintBackendCups *print_backend,
|
cups_request_default_printer_cb (GtkPrintBackendCups *print_backend,
|
||||||
GtkCupsResult *result,
|
GtkCupsResult *result,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ipp_t *response;
|
ipp_t *response;
|
||||||
ipp_attribute_t *attr;
|
ipp_attribute_t *attr;
|
||||||
@ -1498,7 +1507,8 @@ static const char *cups_option_blacklist[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_option_text (ppd_file_t *ppd_file, ppd_option_t *option)
|
get_option_text (ppd_file_t *ppd_file,
|
||||||
|
ppd_option_t *option)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *utf8;
|
char *utf8;
|
||||||
@ -1518,7 +1528,8 @@ get_option_text (ppd_file_t *ppd_file, ppd_option_t *option)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_choice_text (ppd_file_t *ppd_file, ppd_choice_t *choice)
|
get_choice_text (ppd_file_t *ppd_file,
|
||||||
|
ppd_choice_t *choice)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
ppd_option_t *option = choice->option;
|
ppd_option_t *option = choice->option;
|
||||||
@ -1534,7 +1545,8 @@ get_choice_text (ppd_file_t *ppd_file, ppd_choice_t *choice)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
group_has_option (ppd_group_t *group, ppd_option_t *option)
|
group_has_option (ppd_group_t *group,
|
||||||
|
ppd_option_t *option)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1572,10 +1584,10 @@ value_is_off (const char *value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
available_choices (ppd_file_t *ppd,
|
available_choices (ppd_file_t *ppd,
|
||||||
ppd_option_t *option,
|
ppd_option_t *option,
|
||||||
ppd_choice_t ***available,
|
ppd_choice_t ***available,
|
||||||
gboolean keep_if_only_one_option)
|
gboolean keep_if_only_one_option)
|
||||||
{
|
{
|
||||||
ppd_option_t *other_option;
|
ppd_option_t *other_option;
|
||||||
int i, j;
|
int i, j;
|
||||||
@ -1735,9 +1747,9 @@ available_choices (ppd_file_t *ppd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkPrinterOption *
|
static GtkPrinterOption *
|
||||||
create_pickone_option (ppd_file_t *ppd_file,
|
create_pickone_option (ppd_file_t *ppd_file,
|
||||||
ppd_option_t *ppd_option,
|
ppd_option_t *ppd_option,
|
||||||
const char *gtk_name)
|
const gchar *gtk_name)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
ppd_choice_t **available;
|
ppd_choice_t **available;
|
||||||
@ -1784,9 +1796,9 @@ create_pickone_option (ppd_file_t *ppd_file,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkPrinterOption *
|
static GtkPrinterOption *
|
||||||
create_boolean_option (ppd_file_t *ppd_file,
|
create_boolean_option (ppd_file_t *ppd_file,
|
||||||
ppd_option_t *ppd_option,
|
ppd_option_t *ppd_option,
|
||||||
const char *gtk_name)
|
const gchar *gtk_name)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
ppd_choice_t **available;
|
ppd_choice_t **available;
|
||||||
@ -1822,8 +1834,8 @@ create_boolean_option (ppd_file_t *ppd_file,
|
|||||||
return option;
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static gchar *
|
||||||
get_option_name (const char *keyword)
|
get_option_name (const gchar *keyword)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1835,7 +1847,8 @@ get_option_name (const char *keyword)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
strptr_cmp (const void *a, const void *b)
|
strptr_cmp (const void *a,
|
||||||
|
const void *b)
|
||||||
{
|
{
|
||||||
char **aa = (char **)a;
|
char **aa = (char **)a;
|
||||||
char **bb = (char **)b;
|
char **bb = (char **)b;
|
||||||
@ -1844,7 +1857,9 @@ strptr_cmp (const void *a, const void *b)
|
|||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
string_in_table (char *str, const char *table[], int table_len)
|
string_in_table (gchar *str,
|
||||||
|
const gchar *table[],
|
||||||
|
gint table_len)
|
||||||
{
|
{
|
||||||
return bsearch (&str, table, table_len, sizeof (char *), (void *)strptr_cmp) != NULL;
|
return bsearch (&str, table, table_len, sizeof (char *), (void *)strptr_cmp) != NULL;
|
||||||
}
|
}
|
||||||
@ -1853,10 +1868,10 @@ string_in_table (char *str, const char *table[], int table_len)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_option (GtkPrinterOptionSet *set,
|
handle_option (GtkPrinterOptionSet *set,
|
||||||
ppd_file_t *ppd_file,
|
ppd_file_t *ppd_file,
|
||||||
ppd_option_t *ppd_option,
|
ppd_option_t *ppd_option,
|
||||||
ppd_group_t *toplevel_group,
|
ppd_group_t *toplevel_group,
|
||||||
GtkPrintSettings *settings)
|
GtkPrintSettings *settings)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
char *name;
|
char *name;
|
||||||
@ -1917,12 +1932,12 @@ handle_option (GtkPrinterOptionSet *set,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_group (GtkPrinterOptionSet *set,
|
handle_group (GtkPrinterOptionSet *set,
|
||||||
ppd_file_t *ppd_file,
|
ppd_file_t *ppd_file,
|
||||||
ppd_group_t *group,
|
ppd_group_t *group,
|
||||||
ppd_group_t *toplevel_group,
|
ppd_group_t *toplevel_group,
|
||||||
GtkPrintSettings *settings)
|
GtkPrintSettings *settings)
|
||||||
{
|
{
|
||||||
int i;
|
gint i;
|
||||||
|
|
||||||
/* Ignore installable options */
|
/* Ignore installable options */
|
||||||
if (strcmp (toplevel_group->name, "InstallableOptions") == 0)
|
if (strcmp (toplevel_group->name, "InstallableOptions") == 0)
|
||||||
@ -1937,9 +1952,9 @@ handle_group (GtkPrinterOptionSet *set,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkPrinterOptionSet *
|
static GtkPrinterOptionSet *
|
||||||
cups_printer_get_options (GtkPrinter *printer,
|
cups_printer_get_options (GtkPrinter *printer,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup)
|
GtkPageSetup *page_setup)
|
||||||
{
|
{
|
||||||
GtkPrinterOptionSet *set;
|
GtkPrinterOptionSet *set;
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
@ -2040,8 +2055,8 @@ cups_printer_get_options (GtkPrinter *printer,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
mark_option_from_set (GtkPrinterOptionSet *set,
|
mark_option_from_set (GtkPrinterOptionSet *set,
|
||||||
ppd_file_t *ppd_file,
|
ppd_file_t *ppd_file,
|
||||||
ppd_option_t *ppd_option)
|
ppd_option_t *ppd_option)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
char *name = get_option_name (ppd_option->keyword);
|
char *name = get_option_name (ppd_option->keyword);
|
||||||
@ -2057,8 +2072,8 @@ mark_option_from_set (GtkPrinterOptionSet *set,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
mark_group_from_set (GtkPrinterOptionSet *set,
|
mark_group_from_set (GtkPrinterOptionSet *set,
|
||||||
ppd_file_t *ppd_file,
|
ppd_file_t *ppd_file,
|
||||||
ppd_group_t *group)
|
ppd_group_t *group)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -2071,8 +2086,8 @@ mark_group_from_set (GtkPrinterOptionSet *set,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
set_conflicts_from_option (GtkPrinterOptionSet *set,
|
set_conflicts_from_option (GtkPrinterOptionSet *set,
|
||||||
ppd_file_t *ppd_file,
|
ppd_file_t *ppd_file,
|
||||||
ppd_option_t *ppd_option)
|
ppd_option_t *ppd_option)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
char *name;
|
char *name;
|
||||||
@ -2092,8 +2107,8 @@ set_conflicts_from_option (GtkPrinterOptionSet *set,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
set_conflicts_from_group (GtkPrinterOptionSet *set,
|
set_conflicts_from_group (GtkPrinterOptionSet *set,
|
||||||
ppd_file_t *ppd_file,
|
ppd_file_t *ppd_file,
|
||||||
ppd_group_t *group)
|
ppd_group_t *group)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -2146,12 +2161,12 @@ typedef struct {
|
|||||||
} NameMapping;
|
} NameMapping;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
map_settings_to_option (GtkPrinterOption *option,
|
map_settings_to_option (GtkPrinterOption *option,
|
||||||
const NameMapping table[],
|
const NameMapping table[],
|
||||||
int n_elements,
|
gint n_elements,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
const char *standard_name,
|
const gchar *standard_name,
|
||||||
const char *cups_name)
|
const gchar *cups_name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *name;
|
char *name;
|
||||||
@ -2196,12 +2211,12 @@ map_settings_to_option (GtkPrinterOption *option,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
map_option_to_settings (const char *value,
|
map_option_to_settings (const gchar *value,
|
||||||
const NameMapping table[],
|
const NameMapping table[],
|
||||||
int n_elements,
|
gint n_elements,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
const char *standard_name,
|
const gchar *standard_name,
|
||||||
const char *cups_name)
|
const gchar *cups_name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *name;
|
char *name;
|
||||||
@ -2376,7 +2391,7 @@ set_option_from_settings (GtkPrinterOption *option,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
foreach_option_get_settings (GtkPrinterOption *option,
|
foreach_option_get_settings (GtkPrinterOption *option,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
struct OptionData *data = user_data;
|
struct OptionData *data = user_data;
|
||||||
@ -2428,9 +2443,9 @@ foreach_option_get_settings (GtkPrinterOption *option,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cups_printer_get_settings_from_options (GtkPrinter *printer,
|
cups_printer_get_settings_from_options (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options,
|
GtkPrinterOptionSet *options,
|
||||||
GtkPrintSettings *settings)
|
GtkPrintSettings *settings)
|
||||||
{
|
{
|
||||||
struct OptionData data;
|
struct OptionData data;
|
||||||
const char *print_at, *print_at_time;
|
const char *print_at, *print_at_time;
|
||||||
@ -2465,10 +2480,10 @@ cups_printer_get_settings_from_options (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cups_printer_prepare_for_print (GtkPrinter *printer,
|
cups_printer_prepare_for_print (GtkPrinter *printer,
|
||||||
GtkPrintJob *print_job,
|
GtkPrintJob *print_job,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup)
|
GtkPageSetup *page_setup)
|
||||||
{
|
{
|
||||||
GtkPageSet page_set;
|
GtkPageSet page_set;
|
||||||
GtkPaperSize *paper_size;
|
GtkPaperSize *paper_size;
|
||||||
@ -2582,10 +2597,10 @@ cups_printer_list_papers (GtkPrinter *printer)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
cups_printer_get_hard_margins (GtkPrinter *printer,
|
cups_printer_get_hard_margins (GtkPrinter *printer,
|
||||||
double *top,
|
gdouble *top,
|
||||||
double *bottom,
|
gdouble *bottom,
|
||||||
double *left,
|
gdouble *left,
|
||||||
double *right)
|
gdouble *right)
|
||||||
{
|
{
|
||||||
ppd_file_t *ppd_file;
|
ppd_file_t *ppd_file;
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@ static void lpr_printer_prepare_for_print (GtkPrinter
|
|||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup);
|
GtkPageSetup *page_setup);
|
||||||
static cairo_surface_t * lpr_printer_create_cairo_surface (GtkPrinter *printer,
|
static cairo_surface_t * lpr_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
|
GtkPrintSettings *settings,
|
||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height,
|
gdouble height,
|
||||||
gint cache_fd);
|
gint cache_fd);
|
||||||
@ -163,36 +164,46 @@ gtk_print_backend_lpr_class_init (GtkPrintBackendLprClass *class)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cairo_status_t
|
static cairo_status_t
|
||||||
_cairo_write (void *cache_fd_as_pointer,
|
_cairo_write (void *closure,
|
||||||
const unsigned char *data,
|
const unsigned char *data,
|
||||||
unsigned int length)
|
unsigned int length)
|
||||||
{
|
{
|
||||||
cairo_status_t result;
|
gint fd = GPOINTER_TO_INT (closure);
|
||||||
gint cache_fd;
|
gssize written;
|
||||||
cache_fd = GPOINTER_TO_INT (cache_fd_as_pointer);
|
|
||||||
|
|
||||||
result = CAIRO_STATUS_WRITE_ERROR;
|
while (length > 0)
|
||||||
|
{
|
||||||
/* write out the buffer */
|
written = write (fd, data, length);
|
||||||
if (write (cache_fd, data, length) != -1)
|
|
||||||
result = CAIRO_STATUS_SUCCESS;
|
if (written == -1)
|
||||||
|
{
|
||||||
return result;
|
if (errno == EAGAIN || errno == EINTR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return CAIRO_STATUS_WRITE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += written;
|
||||||
|
length -= written;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static cairo_surface_t *
|
static cairo_surface_t *
|
||||||
lpr_printer_create_cairo_surface (GtkPrinter *printer,
|
lpr_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
gdouble width,
|
GtkPrintSettings *settings,
|
||||||
gdouble height,
|
gdouble width,
|
||||||
gint cache_fd)
|
gdouble height,
|
||||||
|
gint cache_fd)
|
||||||
{
|
{
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
|
|
||||||
surface = cairo_ps_surface_create_for_stream (_cairo_write, GINT_TO_POINTER (cache_fd), width, height);
|
surface = cairo_ps_surface_create_for_stream (_cairo_write, GINT_TO_POINTER (cache_fd), width, height);
|
||||||
|
|
||||||
/* TODO: DPI from settings object? */
|
/* TODO: DPI from settings object? */
|
||||||
cairo_ps_surface_set_dpi (surface, 300, 300);
|
cairo_surface_set_fallback_resolution (surface, 300, 300);
|
||||||
|
|
||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
@ -212,8 +223,8 @@ typedef struct {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
lpr_print_cb (GtkPrintBackendLpr *print_backend,
|
lpr_print_cb (GtkPrintBackendLpr *print_backend,
|
||||||
GError *error,
|
GError *error,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
_PrintStreamData *ps = (_PrintStreamData *) user_data;
|
_PrintStreamData *ps = (_PrintStreamData *) user_data;
|
||||||
|
|
||||||
@ -242,9 +253,9 @@ lpr_print_cb (GtkPrintBackendLpr *print_backend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
lpr_write (GIOChannel *source,
|
lpr_write (GIOChannel *source,
|
||||||
GIOCondition con,
|
GIOCondition con,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gchar buf[_LPR_MAX_CHUNK_SIZE];
|
gchar buf[_LPR_MAX_CHUNK_SIZE];
|
||||||
gsize bytes_read;
|
gsize bytes_read;
|
||||||
@ -289,12 +300,12 @@ lpr_write (GIOChannel *source,
|
|||||||
#define LPR_COMMAND "lpr"
|
#define LPR_COMMAND "lpr"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_print_backend_lpr_print_stream (GtkPrintBackend *print_backend,
|
gtk_print_backend_lpr_print_stream (GtkPrintBackend *print_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)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error;
|
||||||
GtkPrinter *printer;
|
GtkPrinter *printer;
|
||||||
@ -382,9 +393,9 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backend)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkPrinterOptionSet *
|
static GtkPrinterOptionSet *
|
||||||
lpr_printer_get_options (GtkPrinter *printer,
|
lpr_printer_get_options (GtkPrinter *printer,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup)
|
GtkPageSetup *page_setup)
|
||||||
{
|
{
|
||||||
GtkPrinterOptionSet *set;
|
GtkPrinterOptionSet *set;
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
@ -413,9 +424,9 @@ lpr_printer_get_options (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lpr_printer_get_settings_from_options (GtkPrinter *printer,
|
lpr_printer_get_settings_from_options (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options,
|
GtkPrinterOptionSet *options,
|
||||||
GtkPrintSettings *settings)
|
GtkPrintSettings *settings)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
|
|
||||||
@ -424,10 +435,10 @@ lpr_printer_get_settings_from_options (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lpr_printer_prepare_for_print (GtkPrinter *printer,
|
lpr_printer_prepare_for_print (GtkPrinter *printer,
|
||||||
GtkPrintJob *print_job,
|
GtkPrintJob *print_job,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup)
|
GtkPageSetup *page_setup)
|
||||||
{
|
{
|
||||||
double scale;
|
double scale;
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ static void gtk_print_backend_pdf_print_stream (GtkPrintBacke
|
|||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify dnotify);
|
GDestroyNotify dnotify);
|
||||||
static cairo_surface_t * pdf_printer_create_cairo_surface (GtkPrinter *printer,
|
static cairo_surface_t * pdf_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
|
GtkPrintSettings *settings,
|
||||||
gdouble width,
|
gdouble width,
|
||||||
gdouble height,
|
gdouble height,
|
||||||
gint cache_fd);
|
gint cache_fd);
|
||||||
@ -164,29 +165,39 @@ gtk_print_backend_pdf_class_init (GtkPrintBackendPdfClass *class)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cairo_status_t
|
static cairo_status_t
|
||||||
_cairo_write (void *cache_fd_as_pointer,
|
_cairo_write (void *closure,
|
||||||
const unsigned char *data,
|
const unsigned char *data,
|
||||||
unsigned int length)
|
unsigned int length)
|
||||||
{
|
{
|
||||||
cairo_status_t result;
|
gint fd = GPOINTER_TO_INT (closure);
|
||||||
gint cache_fd;
|
gssize written;
|
||||||
cache_fd = GPOINTER_TO_INT (cache_fd_as_pointer);
|
|
||||||
|
|
||||||
result = CAIRO_STATUS_WRITE_ERROR;
|
while (length > 0)
|
||||||
|
{
|
||||||
/* write out the buffer */
|
written = write (fd, data, length);
|
||||||
if (write (cache_fd, data, length) != -1)
|
|
||||||
result = CAIRO_STATUS_SUCCESS;
|
if (written == -1)
|
||||||
|
{
|
||||||
return result;
|
if (errno == EAGAIN || errno == EINTR)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return CAIRO_STATUS_WRITE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += written;
|
||||||
|
length -= written;
|
||||||
|
}
|
||||||
|
|
||||||
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static cairo_surface_t *
|
static cairo_surface_t *
|
||||||
pdf_printer_create_cairo_surface (GtkPrinter *printer,
|
pdf_printer_create_cairo_surface (GtkPrinter *printer,
|
||||||
gdouble width,
|
GtkPrintSettings *settings,
|
||||||
gdouble height,
|
gdouble width,
|
||||||
gint cache_fd)
|
gdouble height,
|
||||||
|
gint cache_fd)
|
||||||
{
|
{
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
|
|
||||||
@ -209,8 +220,8 @@ typedef struct {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
pdf_print_cb (GtkPrintBackendPdf *print_backend,
|
pdf_print_cb (GtkPrintBackendPdf *print_backend,
|
||||||
GError *error,
|
GError *error,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
_PrintStreamData *ps = (_PrintStreamData *) user_data;
|
_PrintStreamData *ps = (_PrintStreamData *) user_data;
|
||||||
|
|
||||||
@ -233,9 +244,9 @@ pdf_print_cb (GtkPrintBackendPdf *print_backend,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
pdf_write (GIOChannel *source,
|
pdf_write (GIOChannel *source,
|
||||||
GIOCondition con,
|
GIOCondition con,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gchar buf[_PDF_MAX_CHUNK_SIZE];
|
gchar buf[_PDF_MAX_CHUNK_SIZE];
|
||||||
gsize bytes_read;
|
gsize bytes_read;
|
||||||
@ -280,12 +291,12 @@ pdf_write (GIOChannel *source,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_print_backend_pdf_print_stream (GtkPrintBackend *print_backend,
|
gtk_print_backend_pdf_print_stream (GtkPrintBackend *print_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)
|
||||||
{
|
{
|
||||||
GError *error;
|
GError *error;
|
||||||
GtkPrinter *printer;
|
GtkPrinter *printer;
|
||||||
@ -356,9 +367,9 @@ gtk_print_backend_pdf_init (GtkPrintBackendPdf *backend)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkPrinterOptionSet *
|
static GtkPrinterOptionSet *
|
||||||
pdf_printer_get_options (GtkPrinter *printer,
|
pdf_printer_get_options (GtkPrinter *printer,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup)
|
GtkPageSetup *page_setup)
|
||||||
{
|
{
|
||||||
GtkPrinterOptionSet *set;
|
GtkPrinterOptionSet *set;
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
@ -387,9 +398,9 @@ pdf_printer_get_options (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pdf_printer_get_settings_from_options (GtkPrinter *printer,
|
pdf_printer_get_settings_from_options (GtkPrinter *printer,
|
||||||
GtkPrinterOptionSet *options,
|
GtkPrinterOptionSet *options,
|
||||||
GtkPrintSettings *settings)
|
GtkPrintSettings *settings)
|
||||||
{
|
{
|
||||||
GtkPrinterOption *option;
|
GtkPrinterOption *option;
|
||||||
|
|
||||||
@ -398,10 +409,10 @@ pdf_printer_get_settings_from_options (GtkPrinter *printer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pdf_printer_prepare_for_print (GtkPrinter *printer,
|
pdf_printer_prepare_for_print (GtkPrinter *printer,
|
||||||
GtkPrintJob *print_job,
|
GtkPrintJob *print_job,
|
||||||
GtkPrintSettings *settings,
|
GtkPrintSettings *settings,
|
||||||
GtkPageSetup *page_setup)
|
GtkPageSetup *page_setup)
|
||||||
{
|
{
|
||||||
double scale;
|
double scale;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user