comparison mupdf-source/thirdparty/zint/backend/emf.h @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 /* emf.h - header structure for Microsoft EMF */
2 /*
3 libzint - the open source barcode library
4 Copyright (C) 2016-2024 Robin Stuart <rstuart114@gmail.com>
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of the project nor the names of its contributors
16 may be used to endorse or promote products derived from this software
17 without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
23 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 SUCH DAMAGE.
30 */
31 /* SPDX-License-Identifier: BSD-3-Clause */
32
33 #ifndef Z_EMF_H
34 #define Z_EMF_H
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39
40 #ifdef OUT_USE_PRAGMA_PACK
41 #pragma pack(1)
42 #endif
43
44 typedef struct rect_l {
45 int32_t left;
46 int32_t top;
47 int32_t right;
48 int32_t bottom;
49 } OUT_PACK rect_l_t;
50
51 typedef struct size_l {
52 uint32_t cx;
53 uint32_t cy;
54 } OUT_PACK size_l_t;
55
56 typedef struct point_l {
57 int32_t x;
58 int32_t y;
59 } OUT_PACK point_l_t;
60
61 typedef struct color_ref {
62 uint8_t red;
63 uint8_t green;
64 uint8_t blue;
65 uint8_t reserved;
66 } OUT_PACK color_ref_t;
67
68 typedef struct log_brush_ex {
69 uint32_t brush_style;
70 color_ref_t color;
71 uint32_t brush_hatch;
72 } OUT_PACK log_brush_ex_t;
73
74 typedef struct log_pen {
75 uint32_t pen_style;
76 point_l_t width;
77 color_ref_t color_ref;
78 } OUT_PACK log_pen_t;
79
80 typedef struct log_font {
81 int32_t height;
82 int32_t width;
83 int32_t escapement;
84 int32_t orientation;
85 int32_t weight;
86 uint8_t italic;
87 uint8_t underline;
88 uint8_t strike_out;
89 uint8_t char_set;
90 uint8_t out_precision;
91 uint8_t clip_precision;
92 uint8_t quality;
93 uint8_t pitch_and_family;
94 unsigned char facename[64];
95 } OUT_PACK log_font_t;
96
97 typedef struct emr_text {
98 point_l_t reference;
99 uint32_t chars;
100 uint32_t off_string;
101 uint32_t options;
102 rect_l_t rectangle;
103 uint32_t off_dx;
104 } OUT_PACK emr_text_t;
105
106 typedef struct emf_header {
107 rect_l_t bounds;
108 rect_l_t frame;
109 uint32_t record_signature;
110 uint32_t version;
111 uint32_t bytes;
112 uint32_t records;
113 uint16_t handles;
114 uint16_t reserved;
115 uint32_t n_description;
116 uint32_t off_description;
117 uint32_t n_pal_entries;
118 size_l_t device;
119 size_l_t millimeters;
120 /* HeaderExtension1 Object */
121 uint32_t cb_pixel_format;
122 uint32_t off_pixel_format;
123 uint32_t b_open_gl;
124 /* HeaderExtension2 Object */
125 size_l_t micrometers;
126 } OUT_PACK emf_header_t;
127
128 typedef struct emr_header {
129 uint32_t type;
130 uint32_t size;
131 emf_header_t emf_header;
132 } OUT_PACK emr_header_t;
133
134 typedef struct emr_mapmode {
135 uint32_t type;
136 uint32_t size;
137 uint32_t mapmode;
138 } OUT_PACK emr_mapmode_t;
139
140 typedef struct emr_setworldtransform {
141 uint32_t type;
142 uint32_t size;
143 float m11;
144 float m12;
145 float m21;
146 float m22;
147 float dx;
148 float dy;
149 } OUT_PACK emr_setworldtransform_t;
150
151 typedef struct emr_createbrushindirect {
152 uint32_t type;
153 uint32_t size;
154 uint32_t ih_brush;
155 log_brush_ex_t log_brush;
156 } OUT_PACK emr_createbrushindirect_t;
157
158 typedef struct emr_createpen {
159 uint32_t type;
160 uint32_t size;
161 uint32_t ih_pen;
162 log_pen_t log_pen;
163 } OUT_PACK emr_createpen_t;
164
165 typedef struct emr_selectobject {
166 uint32_t type;
167 uint32_t size;
168 uint32_t ih_object;
169 } OUT_PACK emr_selectobject_t;
170
171 typedef struct emr_rectangle {
172 uint32_t type;
173 uint32_t size;
174 rect_l_t box;
175 } OUT_PACK emr_rectangle_t;
176
177 typedef struct emr_ellipse {
178 uint32_t type;
179 uint32_t size;
180 rect_l_t box;
181 } OUT_PACK emr_ellipse_t;
182
183 typedef struct emr_polygon {
184 uint32_t type;
185 uint32_t size;
186 rect_l_t bounds;
187 uint32_t count;
188 point_l_t a_points_a;
189 point_l_t a_points_b;
190 point_l_t a_points_c;
191 point_l_t a_points_d;
192 point_l_t a_points_e;
193 point_l_t a_points_f;
194 } OUT_PACK emr_polygon_t;
195
196 typedef struct emr_extcreatefontindirectw {
197 uint32_t type;
198 uint32_t size;
199 uint32_t ih_fonts;
200 log_font_t elw;
201 } OUT_PACK emr_extcreatefontindirectw_t;
202
203 typedef struct emr_settextalign {
204 uint32_t type;
205 uint32_t size;
206 uint32_t text_alignment_mode;
207 } OUT_PACK emr_settextalign_t;
208
209 typedef struct emr_settextcolor {
210 uint32_t type;
211 uint32_t size;
212 color_ref_t color;
213 } OUT_PACK emr_settextcolor_t;
214
215 typedef struct emr_exttextoutw {
216 uint32_t type;
217 uint32_t size;
218 rect_l_t bounds;
219 uint32_t i_graphics_mode;
220 float ex_scale;
221 float ey_scale;
222 emr_text_t w_emr_text;
223 } OUT_PACK emr_exttextoutw_t;
224
225 typedef struct emr_eof {
226 uint32_t type;
227 uint32_t size;
228 uint32_t n_pal_entries;
229 uint32_t off_pal_entries;
230 uint32_t size_last;
231 } OUT_PACK emr_eof_t;
232
233 typedef struct box {
234 emr_rectangle_t top;
235 emr_rectangle_t bottom;
236 emr_rectangle_t left;
237 emr_rectangle_t right;
238 } OUT_PACK box_t;
239
240 #ifdef OUT_USE_PRAGMA_PACK
241 #pragma pack()
242 #endif
243
244 #ifdef __cplusplus
245 }
246 #endif /* __cplusplus */
247
248 /* vim: set ts=4 sw=4 et : */
249 #endif /* Z_EMF_H */