gtk/modules/printbackends/gtkprintercpdb.h
tinytrebuchet 41b60bbd6c New CPDB print backend for GTK Print Dialog
The Common Print Dialog Backends (CPDB) concept has GUI-toolkit-independent
backends for each print technology (CUPS, Print to File, cloud printing
services, ...) and each print dialog (GTK, Qt, Chromium, ...) is supposed
to use this backend, so that changes in print technologies can be centrally
and quickly covered by changing the backends and everything new gets available
in all print dialogs.

This commit provides a GTK print dialog backend to add support for the CPDB
concept. It communicates with all installed CPDB backends and so gives support
for all these print technologies to the GTK print dialog.

To make use of CPDB the GTK print dialog is supposed to be installed with this
backend and the 'Print To File' backend, and not any others to prevent printer
duplication.
2023-02-11 01:13:48 +05:30

46 lines
1.6 KiB
C

/* GtkPrinterCpdb
* Copyright (C) 2022, 2023 TinyTrebuchet <tinytrebuchet@protonmail.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
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_PRINTER_CPDB_H__
#define __GTK_PRINTER_CPDB_H__
#include <glib-object.h>
#include <cpdb/cpdb-frontend.h>
#include <gtk/gtkprinterprivate.h>
G_BEGIN_DECLS
#define GTK_TYPE_PRINTER_CPDB (gtk_printer_cpdb_get_type ())
G_DECLARE_FINAL_TYPE (GtkPrinterCpdb, gtk_printer_cpdb, GTK, PRINTER_CPDB, GtkPrinter)
struct _GtkPrinterCpdb
{
GtkPrinter parent_instance;
cpdb_printer_obj_t *printer_obj;
};
void gtk_printer_cpdb_register_type (GTypeModule *module);
cpdb_printer_obj_t *gtk_printer_cpdb_get_printer_obj (GtkPrinterCpdb *cpdb_printer);
void gtk_printer_cpdb_set_printer_obj (GtkPrinterCpdb *cpdb_printer,
cpdb_printer_obj_t *printer_obj);
G_END_DECLS
#endif /* __GTK_PRINTER_CPDB_H__ */