Commit 48cf7d9e authored by Adrian Johnson's avatar Adrian Johnson Committed by Carlos Garcia Campos
Browse files

Set unix printer hard margins on print context

parent be686e2b
...@@ -140,6 +140,11 @@ void _gtk_print_context_set_page_setup (GtkPrintCon ...@@ -140,6 +140,11 @@ void _gtk_print_context_set_page_setup (GtkPrintCon
GtkPageSetup *page_setup); GtkPageSetup *page_setup);
void _gtk_print_context_translate_into_margin (GtkPrintContext *context); void _gtk_print_context_translate_into_margin (GtkPrintContext *context);
void _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context); void _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context);
void _gtk_print_context_set_hard_margins (GtkPrintContext *context,
gdouble top,
gdouble bottom,
gdouble left,
gdouble right);
G_END_DECLS G_END_DECLS
......
...@@ -538,12 +538,16 @@ finish_print (PrintResponseData *rdata, ...@@ -538,12 +538,16 @@ finish_print (PrintResponseData *rdata,
GtkPrintOperation *op = rdata->op; GtkPrintOperation *op = rdata->op;
GtkPrintOperationPrivate *priv = op->priv; GtkPrintOperationPrivate *priv = op->priv;
GtkPrintJob *job; GtkPrintJob *job;
gdouble top, bottom, left, right;
if (rdata->do_print) if (rdata->do_print)
{ {
gtk_print_operation_set_print_settings (op, settings); gtk_print_operation_set_print_settings (op, settings);
priv->print_context = _gtk_print_context_new (op); priv->print_context = _gtk_print_context_new (op);
if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
_gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right);
if (page_setup != NULL && if (page_setup != NULL &&
(gtk_print_operation_get_default_page_setup (op) == NULL || (gtk_print_operation_get_default_page_setup (op) == NULL ||
page_setup_set)) page_setup_set))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment