update Changes
[imager.git] / W32 / W32.xs
CommitLineData
718b8c97
TC
1#define PERL_NO_GET_CONTEXT
2#ifdef __cplusplus
3extern "C" {
4#endif
5#include "EXTERN.h"
6#include "perl.h"
7#include "XSUB.h"
8#include "imext.h"
9#include "imperl.h"
10#include "imw32.h"
11
12DEFINE_IMAGER_CALLBACKS;
13
14MODULE = Imager::Font::W32 PACKAGE = Imager::Font::W32
15
16void
17i_wf_bbox(face, size, text_sv, utf8=0)
8d14daab
TC
18 const char *face
19 i_img_dim size
718b8c97
TC
20 SV *text_sv
21 int utf8
22 PREINIT:
8d14daab 23 i_img_dim cords[BOUNDING_BOX_COUNT];
718b8c97
TC
24 int rc, i;
25 char const *text;
26 STRLEN text_len;
27 PPCODE:
28 text = SvPV(text_sv, text_len);
29#ifdef SvUTF8
30 if (SvUTF8(text_sv))
31 utf8 = 1;
32#endif
33 if (rc = i_wf_bbox(face, size, text, text_len, cords, utf8)) {
34 EXTEND(SP, rc);
35 for (i = 0; i < rc; ++i)
36 PUSHs(sv_2mortal(newSViv(cords[i])));
37 }
38
39undef_int
40i_wf_text(face, im, tx, ty, cl, size, text_sv, align, aa, utf8 = 0)
8d14daab 41 const char *face
718b8c97 42 Imager::ImgRaw im
8d14daab
TC
43 i_img_dim tx
44 i_img_dim ty
718b8c97 45 Imager::Color cl
8d14daab 46 i_img_dim size
718b8c97
TC
47 SV *text_sv
48 int align
49 int aa
50 int utf8
51 PREINIT:
52 char const *text;
53 STRLEN text_len;
54 CODE:
55 text = SvPV(text_sv, text_len);
56#ifdef SvUTF8
57 if (SvUTF8(text_sv))
58 utf8 = 1;
59#endif
60 RETVAL = i_wf_text(face, im, tx, ty, cl, size, text, text_len,
61 align, aa, utf8);
62 OUTPUT:
63 RETVAL
64
65undef_int
66i_wf_cp(face, im, tx, ty, channel, size, text_sv, align, aa, utf8 = 0)
8d14daab 67 const char *face
718b8c97 68 Imager::ImgRaw im
8d14daab
TC
69 i_img_dim tx
70 i_img_dim ty
718b8c97 71 int channel
8d14daab 72 i_img_dim size
718b8c97
TC
73 SV *text_sv
74 int align
75 int aa
76 int utf8
77 PREINIT:
78 char const *text;
79 STRLEN text_len;
80 CODE:
81 text = SvPV(text_sv, text_len);
82#ifdef SvUTF8
83 if (SvUTF8(text_sv))
84 utf8 = 1;
85#endif
86 RETVAL = i_wf_cp(face, im, tx, ty, channel, size, text, text_len,
87 align, aa, utf8);
88 OUTPUT:
89 RETVAL
90
91undef_int
92i_wf_addfont(font)
93 char *font
94
95undef_int
96i_wf_delfont(font)
97 char *font
98
99
100BOOT:
101 PERL_INITIALIZE_IMAGER_CALLBACKS;