-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp_printer.h
More file actions
143 lines (125 loc) · 3.84 KB
/
Copy pathphp_printer.h
File metadata and controls
143 lines (125 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2003 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Frank M. Kromann <frank@kromann.info> |
| Daniel Beulshausen <daniel@php4win.de> |
| Contribution: |
| Philippe MAES <luckyluke@dlfp.org> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_PRINTER_H
#define PHP_PRINTER_H
#if HAVE_PRINTER
#ifdef PHP_WIN32
#include <Winspool.h>
#else
/* Linux/Unix CUPS support */
#ifdef HAVE_CUPS
#include <cups/cups.h>
#include <cups/ppd.h>
#endif
#endif
extern zend_module_entry printer_module_entry;
#define printer_module_ptr &printer_module_entry
#define PHP_PRINTER_VERSION "0.2.0"
/* Compatibility macro for PHP < 8.0 */
#ifndef RETURN_THROWS
#define RETURN_THROWS() return
#endif
PHP_MINIT_FUNCTION(printer);
PHP_MINFO_FUNCTION(printer);
PHP_MSHUTDOWN_FUNCTION(printer);
PHP_FUNCTION(printer_open);
PHP_FUNCTION(printer_close);
PHP_FUNCTION(printer_write);
PHP_FUNCTION(printer_list);
PHP_FUNCTION(printer_set_option);
PHP_FUNCTION(printer_get_option);
PHP_FUNCTION(printer_create_dc);
PHP_FUNCTION(printer_delete_dc);
PHP_FUNCTION(printer_start_doc);
PHP_FUNCTION(printer_end_doc);
PHP_FUNCTION(printer_start_page);
PHP_FUNCTION(printer_end_page);
PHP_FUNCTION(printer_create_pen);
PHP_FUNCTION(printer_delete_pen);
PHP_FUNCTION(printer_select_pen);
PHP_FUNCTION(printer_create_brush);
PHP_FUNCTION(printer_delete_brush);
PHP_FUNCTION(printer_select_brush);
PHP_FUNCTION(printer_create_font);
PHP_FUNCTION(printer_delete_font);
PHP_FUNCTION(printer_select_font);
PHP_FUNCTION(printer_logical_fontheight);
PHP_FUNCTION(printer_draw_roundrect);
PHP_FUNCTION(printer_draw_rectangle);
PHP_FUNCTION(printer_draw_text);
PHP_FUNCTION(printer_draw_elipse);
PHP_FUNCTION(printer_draw_line);
PHP_FUNCTION(printer_draw_chord);
PHP_FUNCTION(printer_draw_pie);
PHP_FUNCTION(printer_draw_bmp);
PHP_FUNCTION(printer_abort);
#ifdef PHP_WIN32
typedef struct {
HANDLE handle;
LPTSTR name;
DOCINFO info;
HDC dc;
PRINTER_INFO_2 *pi2;
DWORD dmModifiedFields;
} printer;
#else
/* Linux/Unix printer structure using CUPS */
#ifdef HAVE_CUPS
typedef struct {
http_t *http;
char *name;
char *title;
char *datatype;
int job_id;
cups_dest_t *dest;
int num_options;
cups_option_t *options;
} printer;
#else
/* Dummy structure when CUPS is not available */
typedef struct {
char *name;
char *title;
char *datatype;
int job_id;
} printer;
#endif /* HAVE_CUPS */
#endif /* PHP_WIN32 */
ZEND_BEGIN_MODULE_GLOBALS(printer)
char *default_printer;
ZEND_END_MODULE_GLOBALS(printer)
#ifdef ZTS
#define PRINTERG(v) TSRMG(printer_globals_id, zend_printer_globals *, v)
#else
#define PRINTERG(v) (printer_globals.v)
#endif
#else
#define printer_module_ptr NULL
#endif
#define phpext_printer_ptr printer_module_ptr
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/