2008-05-28 15:25:36 +00:00
|
|
|
/* GtkPrinter
|
2006-04-21 15:09:32 +00:00
|
|
|
* Copyright (C) 2006 John (J5) Palmieri <johnp@redhat.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2006-04-21 15:09:32 +00:00
|
|
|
*/
|
2008-05-28 15:07:04 +00:00
|
|
|
|
2012-12-28 14:57:34 +00:00
|
|
|
#ifndef __GTK_PRINTER_H__
|
|
|
|
#define __GTK_PRINTER_H__
|
|
|
|
|
2009-10-21 18:30:04 +00:00
|
|
|
#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION)
|
2008-05-29 09:34:53 +00:00
|
|
|
#error "Only <gtk/gtkunixprint.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2006-04-21 15:09:32 +00:00
|
|
|
#include <cairo.h>
|
2008-05-28 15:07:04 +00:00
|
|
|
#include <gtk/gtk.h>
|
2006-04-21 15:09:32 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2007-05-01 13:33:47 +00:00
|
|
|
#define GTK_TYPE_PRINT_CAPABILITIES (gtk_print_capabilities_get_type ())
|
2006-04-21 15:09:32 +00:00
|
|
|
|
2007-04-30 19:12:00 +00:00
|
|
|
/* Note, this type is manually registered with GObject in gtkprinter.c
|
|
|
|
* If you add any flags, update the registration as well!
|
|
|
|
*/
|
2011-04-17 23:07:41 +00:00
|
|
|
/**
|
|
|
|
* 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
|
2018-06-25 23:21:08 +00:00
|
|
|
* pages per sheet
|
2011-04-17 23:07:41 +00:00
|
|
|
* @GTK_PRINT_CAPABILITY_NUMBER_UP_LAYOUT: Print dialog will allow to rearrange
|
2018-06-25 23:21:08 +00:00
|
|
|
* pages when printing multiple pages per sheet
|
2011-04-17 23:07:41 +00:00
|
|
|
*
|
2021-02-27 15:54:24 +00:00
|
|
|
* Specifies which features the print dialog should offer.
|
2021-02-18 18:28:48 +00:00
|
|
|
*
|
2011-04-17 23:07:41 +00:00
|
|
|
* If neither %GTK_PRINT_CAPABILITY_GENERATE_PDF nor
|
2021-02-18 18:28:48 +00:00
|
|
|
* %GTK_PRINT_CAPABILITY_GENERATE_PS is specified, GTK assumes that all
|
2011-04-17 23:07:41 +00:00
|
|
|
* formats are supported.
|
|
|
|
*/
|
2007-04-30 19:12:00 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2008-08-21 10:25:27 +00:00
|
|
|
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
|
2007-04-30 19:12:00 +00:00
|
|
|
} GtkPrintCapabilities;
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2007-05-01 13:33:47 +00:00
|
|
|
GType gtk_print_capabilities_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
#define GTK_TYPE_PRINTER (gtk_printer_get_type ())
|
|
|
|
#define GTK_PRINTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINTER, GtkPrinter))
|
|
|
|
#define GTK_IS_PRINTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINTER))
|
|
|
|
|
2019-05-26 20:35:55 +00:00
|
|
|
typedef struct _GtkPrinter GtkPrinter;
|
|
|
|
typedef struct _GtkPrintBackend GtkPrintBackend;
|
2006-04-21 15:09:32 +00:00
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
GType gtk_printer_get_type (void) G_GNUC_CONST;
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
GtkPrinter *gtk_printer_new (const char *name,
|
2008-05-21 02:17:30 +00:00
|
|
|
GtkPrintBackend *backend,
|
|
|
|
gboolean virtual_);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
GtkPrintBackend *gtk_printer_get_backend (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
const char * gtk_printer_get_name (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
const char * gtk_printer_get_state_message (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
const char * gtk_printer_get_description (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
const char * gtk_printer_get_location (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 18:40:36 +00:00
|
|
|
const char * gtk_printer_get_icon_name (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
int gtk_printer_get_job_count (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
gboolean gtk_printer_is_active (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-07-15 17:34:34 +00:00
|
|
|
gboolean gtk_printer_is_paused (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-07-15 17:34:34 +00:00
|
|
|
gboolean gtk_printer_is_accepting_jobs (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
gboolean gtk_printer_is_virtual (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
gboolean gtk_printer_is_default (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
gboolean gtk_printer_accepts_pdf (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
gboolean gtk_printer_accepts_ps (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
GList *gtk_printer_list_papers (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
GtkPageSetup *gtk_printer_get_default_page_size (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
int gtk_printer_compare (GtkPrinter *a,
|
2008-05-21 02:17:30 +00:00
|
|
|
GtkPrinter *b);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
gboolean gtk_printer_has_details (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
void gtk_printer_request_details (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-05-21 02:17:30 +00:00
|
|
|
GtkPrintCapabilities gtk_printer_get_capabilities (GtkPrinter *printer);
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2008-02-06 22:58:47 +00:00
|
|
|
gboolean gtk_printer_get_hard_margins (GtkPrinter *printer,
|
2020-07-24 20:32:16 +00:00
|
|
|
double *top,
|
|
|
|
double *bottom,
|
|
|
|
double *left,
|
|
|
|
double *right);
|
2018-07-04 16:40:33 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2018-04-12 09:31:37 +00:00
|
|
|
gboolean gtk_printer_get_hard_margins_for_paper_size (GtkPrinter *printer,
|
|
|
|
GtkPaperSize *paper_size,
|
2020-07-24 20:32:16 +00:00
|
|
|
double *top,
|
|
|
|
double *bottom,
|
|
|
|
double *left,
|
|
|
|
double *right);
|
2006-04-21 15:09:32 +00:00
|
|
|
|
2010-05-16 00:11:16 +00:00
|
|
|
/**
|
|
|
|
* GtkPrinterFunc:
|
2021-05-20 13:17:04 +00:00
|
|
|
* @printer: a `GtkPrinter`
|
2011-01-18 05:28:24 +00:00
|
|
|
* @data: (closure): user data passed to gtk_enumerate_printers()
|
2010-05-16 00:11:16 +00:00
|
|
|
*
|
|
|
|
* The type of function passed to gtk_enumerate_printers().
|
2021-02-27 15:54:24 +00:00
|
|
|
*
|
2010-05-16 00:11:16 +00:00
|
|
|
* 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
|
|
|
|
*/
|
2006-06-19 22:18:38 +00:00
|
|
|
typedef gboolean (*GtkPrinterFunc) (GtkPrinter *printer,
|
|
|
|
gpointer data);
|
|
|
|
|
2013-03-20 22:17:32 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2006-06-19 22:18:38 +00:00
|
|
|
void gtk_enumerate_printers (GtkPrinterFunc func,
|
|
|
|
gpointer data,
|
|
|
|
GDestroyNotify destroy,
|
|
|
|
gboolean wait);
|
2006-12-24 13:16:05 +00:00
|
|
|
|
2006-04-21 15:09:32 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_PRINTER_H__ */
|