Commit bcbbbe51 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Make gtk_printer_has_details() and gtk_printer_request_details() public.

2007-04-29  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtk.symbols:
        * gtk/gtkprinter-private.h:
        * gtk/gtkprinter.[hc]: Make gtk_printer_has_details() and
        gtk_printer_request_details() public.

        * gtk/gtkpagesetupunixdialog.c:
        * gtk/gtkprintunixdialog.c: Update callers.  (#389203,
        Christian Persch)



svn path=/trunk/; revision=17690
parent 6c1d4a21
2007-04-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtkprinter-private.h:
* gtk/gtkprinter.[hc]: Make gtk_printer_has_details() and
gtk_printer_request_details() public.
* gtk/gtkpagesetupunixdialog.c:
* gtk/gtkprintunixdialog.c: Update callers. (#389203,
Christian Persch)
2007-04-28 Matthias Clasen <mclasen@redhat.com>
* configure.in: Add --enable-test-print-backend, defaulting
......
2007-04-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk-sections.txt: Add gtk_printer_{has,request}_details
2007-04-28 Matthias Clasen <mclasen@redhat.com>
* gtk/tmpl/gtkdnd.sgml: Document GTK_TARGET_OTHER_*
......
......@@ -6214,6 +6214,8 @@ gtk_printer_accepts_ps
gtk_printer_accepts_pdf
gtk_printer_list_papers
gtk_printer_compare
gtk_printer_has_details
gtk_printer_request_details
GtkPrinterFunc
gtk_enumerate_printers
......
......@@ -2620,6 +2620,8 @@ gtk_printer_list_papers
gtk_printer_accepts_pdf
gtk_printer_accepts_ps
gtk_printer_compare
gtk_printer_has_details
gtk_printer_request_details
gtk_enumerate_printers
#endif
#endif
......
......@@ -797,7 +797,7 @@ printer_changed_callback (GtkComboBox *combo_box,
gtk_tree_model_get (gtk_combo_box_get_model (combo_box), &iter,
PRINTER_LIST_COL_PRINTER, &printer, -1);
if (printer == NULL || _gtk_printer_has_details (printer))
if (printer == NULL || gtk_printer_has_details (printer))
fill_paper_sizes_from_printer (dialog, printer);
else
{
......@@ -805,7 +805,7 @@ printer_changed_callback (GtkComboBox *combo_box,
priv->request_details_tag =
g_signal_connect (printer, "details-acquired",
G_CALLBACK (printer_changed_finished_callback), dialog);
_gtk_printer_request_details (printer);
gtk_printer_request_details (printer);
}
......@@ -1737,7 +1737,7 @@ margins_from_printer_changed (CustomPaperDialog *data)
if (printer)
{
if (_gtk_printer_has_details (printer))
if (gtk_printer_has_details (printer))
{
set_margins_from_printer (data, printer);
gtk_combo_box_set_active (combo, 0);
......@@ -1748,7 +1748,7 @@ margins_from_printer_changed (CustomPaperDialog *data)
data->request_details_tag =
g_signal_connect (printer, "details-acquired",
G_CALLBACK (get_margins_finished_callback), data);
_gtk_printer_request_details (printer);
gtk_printer_request_details (printer);
}
g_object_unref (printer);
......
......@@ -30,12 +30,11 @@
G_BEGIN_DECLS
gboolean _gtk_printer_has_details (GtkPrinter *printer);
void _gtk_printer_request_details (GtkPrinter *printer);
GtkPrinterOptionSet *_gtk_printer_get_options (GtkPrinter *printer,
GtkPrintSettings *settings,
GtkPageSetup *page_setup,
GtkPrintCapabilities capabilities);gboolean _gtk_printer_mark_conflicts (GtkPrinter *printer,
GtkPrintCapabilities capabilities);
gboolean _gtk_printer_mark_conflicts (GtkPrinter *printer,
GtkPrinterOptionSet *options);
void _gtk_printer_get_settings_from_options (GtkPrinter *printer,
GtkPrinterOptionSet *options,
......
......@@ -582,9 +582,21 @@ gtk_printer_set_job_count (GtkPrinter *printer,
return TRUE;
}
/**
* gtk_printer_has_details:
* @printer: a #GtkPrinter
*
* Returns whether the printer details are available.
*
* Return value: %TRUE if @printer details are available
*
* Since: 2.12
*/
gboolean
_gtk_printer_has_details (GtkPrinter *printer)
gtk_printer_has_details (GtkPrinter *printer)
{
g_return_val_if_fail (GTK_IS_PRINTER (printer), FALSE);
return printer->priv->has_details;
}
......@@ -727,10 +739,23 @@ gtk_printer_set_is_default (GtkPrinter *printer,
printer->priv->is_default = TRUE;
}
/**
* gtk_printer_request_details:
* @printer: a #GtkPrinter
*
* Requests the printer details. When the details are available,
* the "details-acquired" signal will be emitted on @printer.
*
* Since: 2.12
*/
void
_gtk_printer_request_details (GtkPrinter *printer)
gtk_printer_request_details (GtkPrinter *printer)
{
GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
GtkPrintBackendClass *backend_class;
g_return_if_fail (GTK_IS_PRINTER (printer));
backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
backend_class->printer_request_details (printer);
}
......@@ -788,7 +813,9 @@ _gtk_printer_create_cairo_surface (GtkPrinter *printer,
* gtk_printer_list_papers:
* @printer:
*
* Lists all the page sizes @printer supports.
* Lists all the paper sizes @printer supports.
* This will return and empty list unless the printer's details are available, see
* gtk_printer_has_details() and gtk_printer_request_details().
*
* Return value: a newly allocated list of newly allocated #GtkPageSetup:s.
*
......
......@@ -80,9 +80,10 @@ gboolean gtk_printer_is_default (GtkPrinter *printer
gboolean gtk_printer_accepts_pdf (GtkPrinter *printer);
gboolean gtk_printer_accepts_ps (GtkPrinter *printer);
GList *gtk_printer_list_papers (GtkPrinter *printer);
gint gtk_printer_compare (GtkPrinter *a,
GtkPrinter *b);
gboolean gtk_printer_has_details (GtkPrinter *printer);
void gtk_printer_request_details (GtkPrinter *printer);
typedef gboolean (*GtkPrinterFunc) (GtkPrinter *printer,
gpointer data);
......
......@@ -1245,13 +1245,13 @@ selected_printer_changed (GtkTreeSelection *selection,
-1);
}
if (printer != NULL && !_gtk_printer_has_details (printer))
if (printer != NULL && !gtk_printer_has_details (printer))
{
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
priv->request_details_tag =
g_signal_connect (printer, "details-acquired",
G_CALLBACK (printer_details_acquired), dialog);
_gtk_printer_request_details (printer);
gtk_printer_request_details (printer);
g_object_unref (printer);
return;
}
......
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