diff options
author | Alexander Larsson <alexl@redhat.com> | 2006-05-04 13:43:32 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2006-05-04 13:43:32 +0000 |
commit | c36d8f3cb3781db3cf41b1888c7daf8487324d78 (patch) | |
tree | d2ca4427d7aabba33cc64b05f96f4a261334064c /gtk/gtkprintbackend.h | |
parent | 89b5cb64808fe544a4e0c6717bdb0c24908097b0 (diff) | |
download | gtk+-c36d8f3cb3781db3cf41b1888c7daf8487324d78.tar.gz |
Added new symbols
2006-05-04 Alexander Larsson <alexl@redhat.com>
* gtk/gtk.symbols:
Added new symbols
* gtk/gtkpagesetupunixdialog.c:
* gtk/gtkprintunixdialog.c:
Destroy backends when finalizing dialogs.
Fix printer leak in selected_printer_changed.
* gtk/gtkprintbackend.[ch]:
Convert from interface to baseclass.
Move printer hashtable here so that the baseclass can handle
the slightly complicated ownership model.
Add gtk_print_backend_destroy which runs the dispose method,
causing the ref-cycles between the backend and its printers
to be broken.
Add gtk_print_backend_unref_at_idle().
* gtk/gtkprinter.[ch]:
GtkPrinter objects now ref their backend so that its always
availible, since its needed for the printer object to work.
This causes a reference-cycle that is broken using
gtk_print_backend_destroy.
Add gtk_printer_compare.
* gtk/gtkprintoperation-private.h:
* gtk/gtkprintoperation-unix.c:
* gtk/gtkprintoperation.c:
Implement !show_dialog for unix.
Make sure the print data is fully spooled before returning
from a sync run_dialog.
* modules/printbackends/cups/gtkcupsutils.[ch]:
Add gtk_cups_request_ipp_add_strings
* modules/printbackends/cups/gtkprintbackendcups.c:
* modules/printbackends/cups/gtkprintercups.c:
* modules/printbackends/lpr/gtkprintbackendlpr.c:
* modules/printbackends/pdf/gtkprintbackendpdf.c:
Convert backends to derive instead of implementing interface.
Move common code into baseclass.
CUPS:
Remove the printer polling in dispose, not finalize.
In the cups watch, remove the backend at idle instead of
immediately, since the unref can cause the module to be unloaded.
Limit the number of printer attributes requested
Get printer uri in initial printer listing so that we can use
the printer object immediately.
* tests/Makefile.am:
* tests/testnouiprint.c:
Add testcase for !show_dialog.
Diffstat (limited to 'gtk/gtkprintbackend.h')
-rw-r--r-- | gtk/gtkprintbackend.h | 88 |
1 files changed, 59 insertions, 29 deletions
diff --git a/gtk/gtkprintbackend.h b/gtk/gtkprintbackend.h index 4e2a05c4b3..fc48690ba3 100644 --- a/gtk/gtkprintbackend.h +++ b/gtk/gtkprintbackend.h @@ -39,7 +39,8 @@ G_BEGIN_DECLS -typedef struct _GtkPrintBackendIface GtkPrintBackendIface; +typedef struct _GtkPrintBackendClass GtkPrintBackendClass; +typedef struct _GtkPrintBackendPrivate GtkPrintBackendPrivate; #define GTK_PRINT_BACKEND_ERROR (gtk_print_backend_error_quark ()) @@ -51,22 +52,28 @@ typedef enum GQuark gtk_print_backend_error_quark (void); -#define GTK_TYPE_PRINT_BACKEND (gtk_print_backend_get_type ()) -#define GTK_PRINT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_BACKEND, GtkPrintBackend)) -#define GTK_IS_PRINT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_BACKEND)) -#define GTK_PRINT_BACKEND_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_PRINT_BACKEND, GtkPrintBackendIface)) +#define GTK_TYPE_PRINT_BACKEND (gtk_print_backend_get_type ()) +#define GTK_PRINT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_BACKEND, GtkPrintBackend)) +#define GTK_PRINT_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PRINT_BACKEND, GtkPrintBackendClass)) +#define GTK_IS_PRINT_BACKEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_BACKEND)) +#define GTK_IS_PRINT_BACKEND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_BACKEND)) +#define GTK_PRINT_BACKEND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_BACKEND, GtkPrintBackendClass)) -struct _GtkPrintBackendIface +struct _GtkPrintBackend { - GTypeInterface base_iface; + GObject parent_instance; - /* Global backend methods: */ - GList * (*get_printer_list) (GtkPrintBackend *printer_backend); + GtkPrintBackendPrivate *priv; +}; - GtkPrinter * (*find_printer) (GtkPrintBackend *print_backend, - const gchar *printer_name); - void (*print_stream) (GtkPrintBackend *print_backend, - GtkPrintJob *job, +struct _GtkPrintBackendClass +{ + GObjectClass parent_class; + + /* Global backend methods: */ + void (*request_printer_list) (GtkPrintBackend *backend); + void (*print_stream) (GtkPrintBackend *backend, + GtkPrintJob *job, gint data_fd, GtkPrintJobCompleteFunc callback, gpointer user_data, @@ -97,26 +104,49 @@ struct _GtkPrintBackendIface double *left, double *right); - /* Signals - */ - void (*printer_list_changed) (void); - void (*printer_added) (GtkPrinter *printer); - void (*printer_removed) (GtkPrinter *printer); - void (*printer_status_changed) (GtkPrinter *printer); + /* Signals */ + void (*printer_list_changed) (GtkPrintBackend *backend); + void (*printer_list_done) (GtkPrintBackend *backend); + void (*printer_added) (GtkPrintBackend *backend, + GtkPrinter *printer); + void (*printer_removed) (GtkPrintBackend *backend, + GtkPrinter *printer); + void (*printer_status_changed) (GtkPrintBackend *backend, + GtkPrinter *printer); + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); + void (*_gtk_reserved5) (void); + void (*_gtk_reserved6) (void); + void (*_gtk_reserved7) (void); }; GType gtk_print_backend_get_type (void) G_GNUC_CONST; -GList *gtk_print_backend_get_printer_list (GtkPrintBackend *print_backend); -GtkPrinter *gtk_print_backend_find_printer (GtkPrintBackend *print_backend, - const gchar *printer_name); -void gtk_print_backend_print_stream (GtkPrintBackend *print_backend, - GtkPrintJob *job, - gint data_fd, - GtkPrintJobCompleteFunc callback, - gpointer user_data, - GDestroyNotify dnotify); -GList * gtk_print_backend_load_modules (void); +GList *gtk_print_backend_get_printer_list (GtkPrintBackend *print_backend); +gboolean gtk_print_backend_printer_list_is_done (GtkPrintBackend *print_backend); +GtkPrinter *gtk_print_backend_find_printer (GtkPrintBackend *print_backend, + const gchar *printer_name); +void gtk_print_backend_print_stream (GtkPrintBackend *print_backend, + GtkPrintJob *job, + gint data_fd, + GtkPrintJobCompleteFunc callback, + gpointer user_data, + GDestroyNotify dnotify); +GList * gtk_print_backend_load_modules (void); +void gtk_print_backend_unref_at_idle (GtkPrintBackend *print_backend); +void gtk_print_backend_destroy (GtkPrintBackend *print_backend); + +/* Backend-only functions for GtkPrintBackend */ + +void gtk_print_backend_add_printer (GtkPrintBackend *print_backend, + GtkPrinter *printer); +void gtk_print_backend_remove_printer (GtkPrintBackend *print_backend, + GtkPrinter *printer); +void gtk_print_backend_set_list_done (GtkPrintBackend *backend); /* Backend-only functions for GtkPrinter */ |