X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkprinter.h;h=2115fd15db7416a2d827e5baaa0ad58938db64bb;hb=3b2182e711ace4a2d6843848208224cd7525d530;hp=2d8bec1f82c4e86bc95ad4559a1375a779de5f52;hpb=eb7f97bb9bda3daf3b09f3035f10f6719749e69f;p=~andy%2Fgtk diff --git a/gtk/gtkprinter.h b/gtk/gtkprinter.h index 2d8bec1f8..2115fd15d 100644 --- a/gtk/gtkprinter.h +++ b/gtk/gtkprinter.h @@ -1,4 +1,4 @@ -/* GtkPrinter +/* GtkPrinter * Copyright (C) 2006 John (J5) Palmieri * * This library is free software; you can redistribute it and/or @@ -12,17 +12,18 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ + #ifndef __GTK_PRINTER_H__ #define __GTK_PRINTER_H__ -#include +#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) +#error "Only can be included directly." +#endif + #include -#include -#include +#include G_BEGIN_DECLS @@ -31,17 +32,40 @@ G_BEGIN_DECLS /* Note, this type is manually registered with GObject in gtkprinter.c * If you add any flags, update the registration as well! */ +/** + * GtkPrintCapabilities: + * @GTK_PRINT_CAPABILITY_PAGE_SET: Print dialog will offer printing even/odd pages. + * @GTK_PRINT_CAPABILITY_COPIES: Print dialog will allow to print multiple copies. + * @GTK_PRINT_CAPABILITY_COLLATE: Print dialog will allow to collate multiple copies. + * @GTK_PRINT_CAPABILITY_REVERSE: Print dialog will allow to print pages in reverse order. + * @GTK_PRINT_CAPABILITY_SCALE: Print dialog will allow to scale the output. + * @GTK_PRINT_CAPABILITY_GENERATE_PDF: The program will send the document to + * the printer in PDF format + * @GTK_PRINT_CAPABILITY_GENERATE_PS: The program will send the document to + * the printer in Postscript format + * @GTK_PRINT_CAPABILITY_PREVIEW: Print dialog will offer a preview + * @GTK_PRINT_CAPABILITY_NUMBER_UP: Print dialog will offer printing multiple + * pages per sheet. Since 2.12 + * @GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT: Print dialog will allow to rearrange + * pages when printing multiple pages per sheet. Since 2.14 + * + * An enum for specifying which features the print dialog should offer. + * If neither %GTK_PRINT_CAPABILITY_GENERATE_PDF nor + * %GTK_PRINT_CAPABILITY_GENERATE_PS is specified, GTK+ assumes that all + * formats are supported. + */ typedef enum { - GTK_PRINT_CAPABILITY_PAGE_SET = 1 << 0, - GTK_PRINT_CAPABILITY_COPIES = 1 << 1, - GTK_PRINT_CAPABILITY_COLLATE = 1 << 2, - GTK_PRINT_CAPABILITY_REVERSE = 1 << 3, - GTK_PRINT_CAPABILITY_SCALE = 1 << 4, - GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5, - GTK_PRINT_CAPABILITY_GENERATE_PS = 1 << 6, - GTK_PRINT_CAPABILITY_PREVIEW = 1 << 7, - GTK_PRINT_CAPABILITY_NUMBER_UP = 1 << 8 + GTK_PRINT_CAPABILITY_PAGE_SET = 1 << 0, + GTK_PRINT_CAPABILITY_COPIES = 1 << 1, + GTK_PRINT_CAPABILITY_COLLATE = 1 << 2, + GTK_PRINT_CAPABILITY_REVERSE = 1 << 3, + GTK_PRINT_CAPABILITY_SCALE = 1 << 4, + GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5, + GTK_PRINT_CAPABILITY_GENERATE_PS = 1 << 6, + GTK_PRINT_CAPABILITY_PREVIEW = 1 << 7, + GTK_PRINT_CAPABILITY_NUMBER_UP = 1 << 8, + GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT = 1 << 9 } GtkPrintCapabilities; GType gtk_print_capabilities_get_type (void) G_GNUC_CONST; @@ -64,6 +88,7 @@ struct _GtkPrinter { GObject parent_instance; + /*< private >*/ GtkPrinterPrivate *priv; }; @@ -71,8 +96,9 @@ struct _GtkPrinterClass { GObjectClass parent_class; - void (*details_acquired) (GtkPrinter *printer, gboolean success); - + void (*details_acquired) (GtkPrinter *printer, + gboolean success); + /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); @@ -81,31 +107,53 @@ struct _GtkPrinterClass void (*_gtk_reserved5) (void); void (*_gtk_reserved6) (void); void (*_gtk_reserved7) (void); + void (*_gtk_reserved8) (void); }; -GType gtk_printer_get_type (void) G_GNUC_CONST; -GtkPrinter *gtk_printer_new (const gchar *name, - GtkPrintBackend *backend, - gboolean virtual_); -GtkPrintBackend *gtk_printer_get_backend (GtkPrinter *printer); -G_CONST_RETURN gchar *gtk_printer_get_name (GtkPrinter *printer); -G_CONST_RETURN gchar *gtk_printer_get_state_message (GtkPrinter *printer); -G_CONST_RETURN gchar *gtk_printer_get_description (GtkPrinter *printer); -G_CONST_RETURN gchar *gtk_printer_get_location (GtkPrinter *printer); -G_CONST_RETURN gchar *gtk_printer_get_icon_name (GtkPrinter *printer); -gint gtk_printer_get_job_count (GtkPrinter *printer); -gboolean gtk_printer_is_active (GtkPrinter *printer); -gboolean gtk_printer_is_virtual (GtkPrinter *printer); -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); -GtkPrintCapabilities gtk_printer_get_capabilities (GtkPrinter *printer); - +GType gtk_printer_get_type (void) G_GNUC_CONST; +GtkPrinter *gtk_printer_new (const gchar *name, + GtkPrintBackend *backend, + gboolean virtual_); +GtkPrintBackend *gtk_printer_get_backend (GtkPrinter *printer); +const gchar * gtk_printer_get_name (GtkPrinter *printer); +const gchar * gtk_printer_get_state_message (GtkPrinter *printer); +const gchar * gtk_printer_get_description (GtkPrinter *printer); +const gchar * gtk_printer_get_location (GtkPrinter *printer); +const gchar * gtk_printer_get_icon_name (GtkPrinter *printer); +gint gtk_printer_get_job_count (GtkPrinter *printer); +gboolean gtk_printer_is_active (GtkPrinter *printer); +gboolean gtk_printer_is_paused (GtkPrinter *printer); +gboolean gtk_printer_is_accepting_jobs (GtkPrinter *printer); +gboolean gtk_printer_is_virtual (GtkPrinter *printer); +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); +GtkPageSetup *gtk_printer_get_default_page_size (GtkPrinter *printer); +gint gtk_printer_compare (GtkPrinter *a, + GtkPrinter *b); +gboolean gtk_printer_has_details (GtkPrinter *printer); +void gtk_printer_request_details (GtkPrinter *printer); +GtkPrintCapabilities gtk_printer_get_capabilities (GtkPrinter *printer); +gboolean gtk_printer_get_hard_margins (GtkPrinter *printer, + gdouble *top, + gdouble *bottom, + gdouble *left, + gdouble *right); + +/** + * GtkPrinterFunc: + * @printer: a #GtkPrinter + * @data: (closure): user data passed to gtk_enumerate_printers() + * + * The type of function passed to gtk_enumerate_printers(). + * Note that you need to ref @printer, if you want to keep + * a reference to it after the function has returned. + * + * Returns: %TRUE to stop the enumeration, %FALSE to continue + * + * Since: 2.10 + */ typedef gboolean (*GtkPrinterFunc) (GtkPrinter *printer, gpointer data);