]>
Commit | Line | Data |
---|---|---|
7bf85405 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: gdi.i | |
3 | // Purpose: SWIG interface file for wxDC, wxBrush, wxPen, wxFont, etc. | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 7/7/97 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 1998 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | ||
03e9bead RD |
14 | %module gdi |
15 | ||
16 | %{ | |
7bf85405 | 17 | #include "helpers.h" |
7bf85405 | 18 | #include <wx/metafile.h> |
af309447 | 19 | #include <wx/imaglist.h> |
105e45b9 | 20 | #ifndef __WXMSW__ |
08127323 | 21 | #include <wx/dcps.h> |
105e45b9 | 22 | #endif |
7bf85405 RD |
23 | %} |
24 | ||
25 | //---------------------------------------------------------------------- | |
26 | ||
27 | %include typemaps.i | |
28 | %include my_typemaps.i | |
29 | ||
30 | // Import some definitions of other classes, etc. | |
31 | %import _defs.i | |
32 | %import misc.i | |
33 | ||
b68dc582 RD |
34 | |
35 | %{ | |
36 | static wxString wxPyEmptyStr(""); | |
37 | %} | |
38 | ||
7bf85405 RD |
39 | //--------------------------------------------------------------------------- |
40 | ||
5bff6bb8 RD |
41 | // class wxGDIImage { |
42 | // public: | |
43 | // long GetHandle(); | |
44 | // void SetHandle(long handle); | |
45 | // bool Ok(); | |
46 | // int GetWidth(); | |
47 | // int GetHeight(); | |
48 | // int GetDepth(); | |
49 | // void SetWidth(int w); | |
50 | // void SetHeight(int h); | |
51 | // void SetDepth(int d); | |
52 | // void SetSize(const wxSize& size); | |
53 | // }; | |
6999b0d8 RD |
54 | |
55 | //--------------------------------------------------------------------------- | |
56 | ||
5bff6bb8 RD |
57 | class wxBitmap |
58 | //: public wxGDIImage | |
59 | { | |
7bf85405 RD |
60 | public: |
61 | wxBitmap(const wxString& name, long type); | |
62 | ~wxBitmap(); | |
63 | ||
7bf85405 RD |
64 | wxPalette* GetPalette(); |
65 | wxMask* GetMask(); | |
7bf85405 | 66 | bool LoadFile(const wxString& name, long flags); |
7bf85405 | 67 | bool SaveFile(const wxString& name, int type, wxPalette* palette = NULL); |
7bf85405 | 68 | void SetMask(wxMask* mask); |
fb5e0af0 | 69 | #ifdef __WXMSW__ |
b8b8dda7 | 70 | void SetPalette(wxPalette& palette); |
fb5e0af0 | 71 | #endif |
5bff6bb8 RD |
72 | |
73 | // wxGDIImage methods | |
74 | #ifdef __WXMSW__ | |
75 | long GetHandle(); | |
76 | void SetHandle(long handle); | |
77 | #endif | |
78 | bool Ok(); | |
79 | int GetWidth(); | |
80 | int GetHeight(); | |
81 | int GetDepth(); | |
82 | void SetWidth(int w); | |
83 | void SetHeight(int h); | |
84 | void SetDepth(int d); | |
85 | #ifdef __WXMSW__ | |
86 | void SetSize(const wxSize& size); | |
87 | #endif | |
f6bcfd97 BP |
88 | |
89 | wxBitmap GetSubBitmap( const wxRect& rect ); | |
90 | #ifdef __WXMSW__ | |
91 | bool CopyFromIcon(const wxIcon& icon); | |
92 | bool CopyFromCursor(const wxCursor& cursor); | |
93 | int GetQuality(); | |
94 | void SetQuality(int q); | |
95 | #endif | |
96 | ||
97 | %pragma(python) addtoclass = " | |
98 | def __del__(self,gdic=gdic): | |
99 | try: | |
100 | if self.thisown == 1 : | |
101 | gdic.delete_wxBitmap(self) | |
102 | except: | |
103 | pass | |
104 | " | |
7bf85405 RD |
105 | }; |
106 | ||
5bff6bb8 | 107 | |
7bf85405 | 108 | %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1); |
9c039d08 | 109 | |
8bf5d46e | 110 | #ifdef __WXMSW__ |
4c9993c3 | 111 | %new wxBitmap* wxBitmapFromData(PyObject* data, long type, |
8bf5d46e RD |
112 | int width, int height, int depth = 1); |
113 | #endif | |
114 | ||
7bf85405 RD |
115 | %{ // Alternate 'constructor' |
116 | wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) { | |
117 | return new wxBitmap(width, height, depth); | |
118 | } | |
119 | ||
8bf5d46e | 120 | #ifdef __WXMSW__ |
4c9993c3 | 121 | wxBitmap* wxBitmapFromData(PyObject* data, long type, |
8bf5d46e | 122 | int width, int height, int depth = 1) { |
4c9993c3 RD |
123 | if (! PyString_Check(data)) { |
124 | PyErr_SetString(PyExc_TypeError, "Expected string object"); | |
125 | return NULL; | |
126 | } | |
127 | ||
128 | return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth); | |
8bf5d46e RD |
129 | } |
130 | #endif | |
7bf85405 RD |
131 | %} |
132 | ||
133 | //--------------------------------------------------------------------------- | |
134 | ||
135 | class wxMask { | |
136 | public: | |
137 | wxMask(const wxBitmap& bitmap); | |
eb715945 | 138 | //~wxMask(); |
7bf85405 RD |
139 | }; |
140 | ||
141 | %new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour); | |
142 | %{ | |
143 | wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour) { | |
144 | return new wxMask(bitmap, colour); | |
145 | } | |
146 | %} | |
147 | ||
148 | ||
149 | //--------------------------------------------------------------------------- | |
150 | ||
151 | ||
5bff6bb8 RD |
152 | class wxIcon |
153 | //: public wxGDIImage | |
154 | { | |
7bf85405 | 155 | public: |
fb5e0af0 RD |
156 | wxIcon(const wxString& name, long flags, |
157 | int desiredWidth = -1, int desiredHeight = -1); | |
7bf85405 RD |
158 | ~wxIcon(); |
159 | ||
7bf85405 | 160 | bool LoadFile(const wxString& name, long flags); |
5bff6bb8 RD |
161 | |
162 | // wxGDIImage methods | |
163 | #ifdef __WXMSW__ | |
164 | long GetHandle(); | |
165 | void SetHandle(long handle); | |
166 | #endif | |
167 | bool Ok(); | |
168 | int GetWidth(); | |
169 | int GetHeight(); | |
170 | int GetDepth(); | |
171 | void SetWidth(int w); | |
172 | void SetHeight(int h); | |
173 | void SetDepth(int d); | |
174 | #ifdef __WXMSW__ | |
175 | void SetSize(const wxSize& size); | |
176 | #endif | |
f6bcfd97 BP |
177 | %pragma(python) addtoclass = " |
178 | def __del__(self,gdic=gdic): | |
179 | try: | |
180 | if self.thisown == 1 : | |
181 | gdic.delete_wxIcon(self) | |
182 | except: | |
183 | pass | |
184 | " | |
185 | ||
7bf85405 RD |
186 | }; |
187 | ||
8bf5d46e | 188 | |
7bf85405 RD |
189 | //--------------------------------------------------------------------------- |
190 | ||
5bff6bb8 RD |
191 | class wxCursor |
192 | //: public wxGDIImage | |
193 | { | |
7bf85405 | 194 | public: |
fb5e0af0 | 195 | #ifdef __WXMSW__ |
7bf85405 | 196 | wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0); |
fb5e0af0 | 197 | #endif |
7bf85405 | 198 | ~wxCursor(); |
5bff6bb8 RD |
199 | |
200 | // wxGDIImage methods | |
201 | #ifdef __WXMSW__ | |
202 | long GetHandle(); | |
203 | void SetHandle(long handle); | |
204 | #endif | |
205 | bool Ok(); | |
206 | #ifdef __WXMSW__ | |
207 | int GetWidth(); | |
208 | int GetHeight(); | |
209 | int GetDepth(); | |
210 | void SetWidth(int w); | |
211 | void SetHeight(int h); | |
212 | void SetDepth(int d); | |
213 | void SetSize(const wxSize& size); | |
214 | #endif | |
7bf85405 RD |
215 | }; |
216 | ||
9c039d08 | 217 | %name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id); |
7bf85405 | 218 | %{ // Alternate 'constructor' |
9c039d08 | 219 | wxCursor* wxPyStockCursor(int id) { |
7bf85405 RD |
220 | return new wxCursor(id); |
221 | } | |
222 | %} | |
223 | ||
224 | //---------------------------------------------------------------------- | |
225 | ||
f0261a72 RD |
226 | |
227 | enum wxFontEncoding | |
228 | { | |
229 | wxFONTENCODING_SYSTEM = -1, // system default | |
230 | wxFONTENCODING_DEFAULT, // current default encoding | |
231 | ||
232 | // ISO8859 standard defines a number of single-byte charsets | |
233 | wxFONTENCODING_ISO8859_1, // West European (Latin1) | |
234 | wxFONTENCODING_ISO8859_2, // Central and East European (Latin2) | |
235 | wxFONTENCODING_ISO8859_3, // Esperanto (Latin3) | |
236 | wxFONTENCODING_ISO8859_4, // Baltic languages (Estonian) (Latin4) | |
237 | wxFONTENCODING_ISO8859_5, // Cyrillic | |
238 | wxFONTENCODING_ISO8859_6, // Arabic | |
239 | wxFONTENCODING_ISO8859_7, // Greek | |
240 | wxFONTENCODING_ISO8859_8, // Hebrew | |
241 | wxFONTENCODING_ISO8859_9, // Turkish (Latin5) | |
242 | wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6) | |
243 | wxFONTENCODING_ISO8859_11, // Thai | |
244 | wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it | |
245 | // here anyhow to make all ISO8859 | |
246 | // consecutive numbers | |
247 | wxFONTENCODING_ISO8859_13, // Latin7 | |
248 | wxFONTENCODING_ISO8859_14, // Latin8 | |
249 | wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro) | |
250 | ||
251 | // Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html) | |
252 | wxFONTENCODING_KOI8, // we don't support any of KOI8 variants | |
253 | wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866 | |
254 | wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria | |
255 | ||
256 | // what would we do without Microsoft? They have their own encodings | |
257 | // for DOS | |
258 | wxFONTENCODING_CP437, // original MS-DOS codepage | |
259 | wxFONTENCODING_CP850, // CP437 merged with Latin1 | |
260 | wxFONTENCODING_CP852, // CP437 merged with Latin2 | |
261 | wxFONTENCODING_CP855, // another cyrillic encoding | |
262 | wxFONTENCODING_CP866, // and another one | |
263 | // and for Windows | |
264 | wxFONTENCODING_CP1250, // WinLatin2 | |
265 | wxFONTENCODING_CP1251, // WinCyrillic | |
266 | wxFONTENCODING_CP1252, // WinLatin1 | |
267 | ||
268 | wxFONTENCODING_MAX | |
269 | }; | |
270 | ||
0569df0f | 271 | |
7bf85405 RD |
272 | class wxFont { |
273 | public: | |
0569df0f RD |
274 | wxFont( int pointSize, int family, int style, int weight, |
275 | int underline=FALSE, char* faceName = "", | |
276 | wxFontEncoding encoding=wxFONTENCODING_DEFAULT); | |
277 | ~wxFont(); | |
7bf85405 | 278 | |
694759cf | 279 | bool Ok(); |
7bf85405 RD |
280 | wxString GetFaceName(); |
281 | int GetFamily(); | |
08127323 | 282 | #ifdef __WXMSW__ |
7bf85405 | 283 | int GetFontId(); |
08127323 | 284 | #endif |
7bf85405 RD |
285 | int GetPointSize(); |
286 | int GetStyle(); | |
287 | bool GetUnderlined(); | |
288 | int GetWeight(); | |
f0261a72 | 289 | wxFontEncoding GetEncoding(); |
7bf85405 RD |
290 | void SetFaceName(const wxString& faceName); |
291 | void SetFamily(int family); | |
292 | void SetPointSize(int pointSize); | |
293 | void SetStyle(int style); | |
294 | void SetUnderlined(bool underlined); | |
295 | void SetWeight(int weight); | |
f0261a72 RD |
296 | void SetEncoding(wxFontEncoding encoding); |
297 | wxString GetFamilyString(); | |
298 | wxString GetStyleString(); | |
299 | wxString GetWeightString(); | |
7bf85405 RD |
300 | }; |
301 | ||
f0261a72 RD |
302 | %inline %{ |
303 | wxFontEncoding wxFont_GetDefaultEncoding() { | |
304 | return wxFont::GetDefaultEncoding(); | |
305 | } | |
306 | ||
307 | void wxFont_SetDefaultEncoding(wxFontEncoding encoding) { | |
308 | wxFont::SetDefaultEncoding(encoding); | |
309 | } | |
310 | %} | |
311 | ||
0569df0f RD |
312 | |
313 | class wxFontList { | |
314 | public: | |
315 | ||
316 | void AddFont(wxFont* font); | |
317 | wxFont * FindOrCreateFont(int point_size, int family, int style, int weight, | |
318 | bool underline = FALSE, const char* facename = NULL, | |
319 | wxFontEncoding encoding = wxFONTENCODING_DEFAULT); | |
320 | void RemoveFont(wxFont *font); | |
321 | }; | |
322 | ||
323 | ||
7bf85405 RD |
324 | //---------------------------------------------------------------------- |
325 | ||
326 | class wxColour { | |
327 | public: | |
328 | wxColour(unsigned char red=0, unsigned char green=0, unsigned char blue=0); | |
329 | ~wxColour(); | |
330 | unsigned char Red(); | |
331 | unsigned char Green(); | |
332 | unsigned char Blue(); | |
333 | bool Ok(); | |
334 | void Set(unsigned char red, unsigned char green, unsigned char blue); | |
335 | %addmethods { | |
336 | PyObject* Get() { | |
337 | PyObject* rv = PyTuple_New(3); | |
338 | PyTuple_SetItem(rv, 0, PyInt_FromLong(self->Red())); | |
339 | PyTuple_SetItem(rv, 1, PyInt_FromLong(self->Green())); | |
340 | PyTuple_SetItem(rv, 2, PyInt_FromLong(self->Blue())); | |
341 | return rv; | |
342 | } | |
343 | } | |
9b3d3bc4 RD |
344 | %pragma(python) addtoclass = "asTuple = Get" |
345 | %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())" | |
346 | %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())" | |
347 | ||
7bf85405 RD |
348 | }; |
349 | ||
350 | %new wxColour* wxNamedColour(const wxString& colorName); | |
de20db99 | 351 | |
7bf85405 RD |
352 | %{ // Alternate 'constructor' |
353 | wxColour* wxNamedColour(const wxString& colorName) { | |
354 | return new wxColour(colorName); | |
355 | } | |
356 | %} | |
357 | ||
358 | ||
7bf85405 | 359 | |
0569df0f | 360 | class wxColourDatabase { |
7bf85405 | 361 | public: |
0569df0f RD |
362 | |
363 | wxColour *FindColour(const wxString& colour); | |
364 | wxString FindName(const wxColour& colour) const; | |
365 | ||
7bf85405 | 366 | %addmethods { |
0569df0f RD |
367 | void Append(const wxString& name, int red, int green, int blue) { |
368 | self->Append(name.c_str(), new wxColour(red, green, blue)); | |
7bf85405 | 369 | } |
7bf85405 | 370 | } |
0569df0f RD |
371 | }; |
372 | ||
373 | ||
374 | //---------------------------------------------------------------------- | |
375 | ||
376 | ||
377 | class wxPen { | |
378 | public: | |
379 | wxPen(wxColour& colour, int width=1, int style=wxSOLID); | |
380 | ~wxPen(); | |
7bf85405 RD |
381 | |
382 | int GetCap(); | |
383 | wxColour& GetColour(); | |
384 | ||
fb5e0af0 | 385 | int GetJoin(); |
7bf85405 RD |
386 | int GetStyle(); |
387 | int GetWidth(); | |
388 | bool Ok(); | |
389 | void SetCap(int cap_style); | |
390 | void SetColour(wxColour& colour); | |
aeeb6a44 RR |
391 | void SetJoin(int join_style); |
392 | void SetStyle(int style); | |
393 | void SetWidth(int width); | |
08127323 | 394 | |
aeeb6a44 RR |
395 | // **** This one needs to return a list of ints (wxDash) |
396 | int GetDashes(wxDash **dashes); | |
eec92d76 | 397 | void SetDashes(int LCOUNT, wxDash* choices); |
6999b0d8 RD |
398 | |
399 | #ifdef __WXMSW__ | |
400 | wxBitmap* GetStipple(); | |
b8b8dda7 | 401 | void SetStipple(wxBitmap& stipple); |
fb5e0af0 | 402 | #endif |
7bf85405 RD |
403 | }; |
404 | ||
0569df0f RD |
405 | |
406 | class wxPenList { | |
407 | public: | |
408 | ||
409 | void AddPen(wxPen* pen); | |
410 | wxPen* FindOrCreatePen(const wxColour& colour, int width, int style); | |
411 | void RemovePen(wxPen* pen); | |
412 | }; | |
413 | ||
414 | ||
415 | ||
7bf85405 RD |
416 | //---------------------------------------------------------------------- |
417 | ||
418 | class wxBrush { | |
419 | public: | |
0569df0f RD |
420 | wxBrush(const wxColour& colour, int style=wxSOLID); |
421 | ~wxBrush(); | |
26b9cf27 | 422 | |
7bf85405 RD |
423 | wxColour& GetColour(); |
424 | wxBitmap * GetStipple(); | |
425 | int GetStyle(); | |
426 | bool Ok(); | |
427 | void SetColour(wxColour &colour); | |
b8b8dda7 | 428 | void SetStipple(wxBitmap& bitmap); |
7bf85405 RD |
429 | void SetStyle(int style); |
430 | }; | |
431 | ||
0569df0f RD |
432 | |
433 | class wxBrushList { | |
434 | public: | |
435 | ||
436 | void AddBrush(wxBrush *brush); | |
437 | wxBrush * FindOrCreateBrush(const wxColour& colour, int style); | |
438 | void RemoveBrush(wxBrush *brush); | |
439 | }; | |
440 | ||
7bf85405 RD |
441 | //---------------------------------------------------------------------- |
442 | ||
443 | ||
444 | ||
445 | class wxDC { | |
446 | public: | |
fb5e0af0 | 447 | // wxDC(); **** abstract base class, can't instantiate. |
7bf85405 RD |
448 | ~wxDC(); |
449 | ||
450 | void BeginDrawing(); | |
efc5f224 RD |
451 | // %name(BlitXY) |
452 | bool Blit(long xdest, long ydest, | |
453 | long width, long height, | |
454 | wxDC *source, long xsrc, long ysrc, | |
455 | int logicalFunc = wxCOPY, int useMask = FALSE); | |
456 | // bool Blit(const wxPoint& destPt, const wxSize& sz, | |
457 | // wxDC *source, const wxPoint& srcPt, | |
458 | // int logicalFunc = wxCOPY, int useMask = FALSE); | |
459 | ||
7bf85405 RD |
460 | void Clear(); |
461 | void CrossHair(long x, long y); | |
462 | void DestroyClippingRegion(); | |
463 | long DeviceToLogicalX(long x); | |
464 | long DeviceToLogicalXRel(long x); | |
465 | long DeviceToLogicalY(long y); | |
466 | long DeviceToLogicalYRel(long y); | |
467 | void DrawArc(long x1, long y1, long x2, long y2, long xc, long yc); | |
bb0054cd | 468 | void DrawCircle(long x, long y, long radius); |
7bf85405 RD |
469 | void DrawEllipse(long x, long y, long width, long height); |
470 | void DrawEllipticArc(long x, long y, long width, long height, long start, long end); | |
471 | void DrawIcon(const wxIcon& icon, long x, long y); | |
472 | void DrawLine(long x1, long y1, long x2, long y2); | |
eec92d76 RD |
473 | void DrawLines(int PCOUNT, wxPoint* points, long xoffset=0, long yoffset=0); |
474 | void DrawPolygon(int PCOUNT, wxPoint* points, long xoffset=0, long yoffset=0, | |
7bf85405 RD |
475 | int fill_style=wxODDEVEN_RULE); |
476 | void DrawPoint(long x, long y); | |
477 | void DrawRectangle(long x, long y, long width, long height); | |
6999b0d8 | 478 | void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); |
7bf85405 | 479 | void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20); |
eec92d76 | 480 | void DrawSpline(int PCOUNT, wxPoint* points); |
7bf85405 RD |
481 | void DrawText(const wxString& text, long x, long y); |
482 | void EndDoc(); | |
483 | void EndDrawing(); | |
484 | void EndPage(); | |
485 | void FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE); | |
b8b8dda7 RD |
486 | wxBrush& GetBackground(); |
487 | wxBrush& GetBrush(); | |
7bf85405 RD |
488 | long GetCharHeight(); |
489 | long GetCharWidth(); | |
490 | void GetClippingBox(long *OUTPUT, long *OUTPUT, | |
491 | long *OUTPUT, long *OUTPUT); | |
b8b8dda7 | 492 | wxFont& GetFont(); |
7bf85405 | 493 | int GetLogicalFunction(); |
eec92d76 | 494 | void GetLogicalScale(double *OUTPUT, double *OUTPUT); |
7bf85405 RD |
495 | int GetMapMode(); |
496 | bool GetOptimization(); | |
b8b8dda7 | 497 | wxPen& GetPen(); |
fb5e0af0 RD |
498 | %addmethods { |
499 | %new wxColour* GetPixel(long x, long y) { | |
500 | wxColour* wc = new wxColour(); | |
501 | self->GetPixel(x, y, wc); | |
502 | return wc; | |
503 | } | |
504 | } | |
bb0054cd RD |
505 | %name(GetSizeTuple)void GetSize(int* OUTPUT, int* OUTPUT); |
506 | wxSize GetSize(); | |
eec92d76 | 507 | wxSize GetSizeMM(); |
7bf85405 | 508 | wxColour& GetTextBackground(); |
af309447 RD |
509 | void GetTextExtent(const wxString& string, long *OUTPUT, long *OUTPUT); |
510 | %name(GetFullTextExtent)void GetTextExtent(const wxString& string, | |
511 | long *OUTPUT, long *OUTPUT, long *OUTPUT, long* OUTPUT, | |
512 | const wxFont* font = NULL); | |
7bf85405 | 513 | wxColour& GetTextForeground(); |
eec92d76 | 514 | void GetUserScale(double *OUTPUT, double *OUTPUT); |
7bf85405 RD |
515 | long LogicalToDeviceX(long x); |
516 | long LogicalToDeviceXRel(long x); | |
517 | long LogicalToDeviceY(long y); | |
518 | long LogicalToDeviceYRel(long y); | |
519 | long MaxX(); | |
520 | long MaxY(); | |
521 | long MinX(); | |
522 | long MinY(); | |
523 | bool Ok(); | |
524 | void SetDeviceOrigin(long x, long y); | |
525 | void SetBackground(const wxBrush& brush); | |
526 | void SetBackgroundMode(int mode); | |
527 | void SetClippingRegion(long x, long y, long width, long height); | |
528 | void SetPalette(const wxPalette& colourMap); | |
529 | void SetBrush(const wxBrush& brush); | |
530 | void SetFont(const wxFont& font); | |
531 | void SetLogicalFunction(int function); | |
eec92d76 | 532 | void SetLogicalScale(double x, double y); |
7bf85405 RD |
533 | void SetMapMode(int mode); |
534 | void SetOptimization(bool optimize); | |
535 | void SetPen(const wxPen& pen); | |
536 | void SetTextBackground(const wxColour& colour); | |
537 | void SetTextForeground(const wxColour& colour); | |
538 | void SetUserScale(double x_scale, double y_scale); | |
539 | bool StartDoc(const wxString& message); | |
540 | void StartPage(); | |
541 | ||
542 | ||
efc5f224 RD |
543 | |
544 | void DrawBitmap(const wxBitmap& bitmap, long x, long y, | |
545 | int useMask = FALSE); | |
546 | ||
eec92d76 RD |
547 | bool CanDrawBitmap(); |
548 | bool CanGetTextExtent(); | |
549 | int GetDepth(); | |
550 | wxSize GetPPI(); | |
551 | ||
552 | void GetLogicalOrigin(int *OUTPUT, int *OUTPUT); | |
553 | void SetLogicalOrigin(int x, int y); | |
554 | void GetDeviceOrigin(int *OUTPUT, int *OUTPUT); | |
eec92d76 RD |
555 | void SetAxisOrientation(bool xLeftRight, bool yBottomUp); |
556 | ||
f6bcfd97 BP |
557 | void CalcBoundingBox(int x, int y); |
558 | void ResetBoundingBox(); | |
7bf85405 RD |
559 | }; |
560 | ||
561 | ||
562 | //---------------------------------------------------------------------- | |
563 | ||
564 | class wxMemoryDC : public wxDC { | |
565 | public: | |
566 | wxMemoryDC(); | |
567 | ||
568 | void SelectObject(const wxBitmap& bitmap); | |
569 | } | |
570 | ||
571 | %new wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC); | |
572 | %{ // Alternate 'constructor' | |
573 | wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC) { | |
574 | return new wxMemoryDC(oldDC); | |
575 | } | |
576 | %} | |
577 | ||
578 | ||
579 | //--------------------------------------------------------------------------- | |
580 | ||
581 | class wxScreenDC : public wxDC { | |
582 | public: | |
583 | wxScreenDC(); | |
584 | ||
26b9cf27 RD |
585 | %name(StartDrawingOnTopWin) bool StartDrawingOnTop(wxWindow* window); |
586 | bool StartDrawingOnTop(wxRect* rect = NULL); | |
7bf85405 RD |
587 | bool EndDrawingOnTop(); |
588 | }; | |
589 | ||
590 | //--------------------------------------------------------------------------- | |
591 | ||
592 | class wxClientDC : public wxDC { | |
593 | public: | |
594 | wxClientDC(wxWindow* win); | |
595 | }; | |
596 | ||
597 | //--------------------------------------------------------------------------- | |
598 | ||
599 | class wxPaintDC : public wxDC { | |
600 | public: | |
601 | wxPaintDC(wxWindow* win); | |
602 | }; | |
603 | ||
604 | //--------------------------------------------------------------------------- | |
605 | ||
b639c3c5 RD |
606 | class wxWindowDC : public wxDC { |
607 | public: | |
608 | wxWindowDC(wxWindow* win); | |
609 | }; | |
b639c3c5 RD |
610 | |
611 | //--------------------------------------------------------------------------- | |
612 | ||
be4d9c1f | 613 | #ifndef __WXMSW__ |
7bf85405 RD |
614 | class wxPostScriptDC : public wxDC { |
615 | public: | |
616 | wxPostScriptDC(const wxString& output, bool interactive = TRUE, wxWindow* win = NULL); | |
617 | }; | |
be4d9c1f | 618 | #endif |
7bf85405 RD |
619 | |
620 | //--------------------------------------------------------------------------- | |
621 | ||
7bf85405 | 622 | |
fb5e0af0 | 623 | #ifdef __WXMSW__ |
7bf85405 RD |
624 | class wxMetaFileDC : public wxDC { |
625 | public: | |
626 | wxMetaFileDC(const wxString& filename = wxPyEmptyStr); | |
627 | wxMetaFile* Close(); | |
628 | }; | |
fb5e0af0 | 629 | #endif |
7bf85405 RD |
630 | |
631 | //--------------------------------------------------------------------------- | |
632 | //--------------------------------------------------------------------------- | |
633 | ||
634 | ||
635 | %readonly | |
af309447 RD |
636 | %{ |
637 | #if 0 | |
638 | %} | |
7bf85405 RD |
639 | extern wxFont *wxNORMAL_FONT; |
640 | extern wxFont *wxSMALL_FONT; | |
641 | extern wxFont *wxITALIC_FONT; | |
642 | extern wxFont *wxSWISS_FONT; | |
7bf85405 | 643 | |
1afc06c2 | 644 | extern wxPen *wxRED_PEN; |
7bf85405 RD |
645 | extern wxPen *wxCYAN_PEN; |
646 | extern wxPen *wxGREEN_PEN; | |
647 | extern wxPen *wxBLACK_PEN; | |
648 | extern wxPen *wxWHITE_PEN; | |
649 | extern wxPen *wxTRANSPARENT_PEN; | |
650 | extern wxPen *wxBLACK_DASHED_PEN; | |
651 | extern wxPen *wxGREY_PEN; | |
652 | extern wxPen *wxMEDIUM_GREY_PEN; | |
653 | extern wxPen *wxLIGHT_GREY_PEN; | |
654 | ||
655 | extern wxBrush *wxBLUE_BRUSH; | |
656 | extern wxBrush *wxGREEN_BRUSH; | |
657 | extern wxBrush *wxWHITE_BRUSH; | |
658 | extern wxBrush *wxBLACK_BRUSH; | |
659 | extern wxBrush *wxTRANSPARENT_BRUSH; | |
660 | extern wxBrush *wxCYAN_BRUSH; | |
661 | extern wxBrush *wxRED_BRUSH; | |
662 | extern wxBrush *wxGREY_BRUSH; | |
663 | extern wxBrush *wxMEDIUM_GREY_BRUSH; | |
664 | extern wxBrush *wxLIGHT_GREY_BRUSH; | |
665 | ||
666 | extern wxColour *wxBLACK; | |
667 | extern wxColour *wxWHITE; | |
668 | extern wxColour *wxRED; | |
669 | extern wxColour *wxBLUE; | |
670 | extern wxColour *wxGREEN; | |
671 | extern wxColour *wxCYAN; | |
672 | extern wxColour *wxLIGHT_GREY; | |
673 | ||
674 | extern wxCursor *wxSTANDARD_CURSOR; | |
675 | extern wxCursor *wxHOURGLASS_CURSOR; | |
676 | extern wxCursor *wxCROSS_CURSOR; | |
677 | ||
678 | extern wxBitmap wxNullBitmap; | |
679 | extern wxIcon wxNullIcon; | |
680 | extern wxCursor wxNullCursor; | |
681 | extern wxPen wxNullPen; | |
682 | extern wxBrush wxNullBrush; | |
683 | extern wxPalette wxNullPalette; | |
684 | extern wxFont wxNullFont; | |
685 | extern wxColour wxNullColour; | |
686 | ||
0569df0f RD |
687 | |
688 | extern wxFontList* wxTheFontList; | |
689 | extern wxPenList* wxThePenList; | |
690 | extern wxBrushlist* wxTheBrushList; | |
691 | extern wxColourDatabase* wxTheColourDatabase; | |
692 | ||
693 | ||
af309447 RD |
694 | %readwrite |
695 | %{ | |
696 | #endif | |
697 | %} | |
698 | ||
b639c3c5 RD |
699 | //--------------------------------------------------------------------------- |
700 | ||
701 | class wxPalette { | |
702 | public: | |
eec92d76 | 703 | wxPalette(int LCOUNT, byte* choices, byte* choices, byte* choices); |
b639c3c5 RD |
704 | ~wxPalette(); |
705 | ||
706 | int GetPixel(byte red, byte green, byte blue); | |
707 | bool GetRGB(int pixel, byte* OUTPUT, byte* OUTPUT, byte* OUTPUT); | |
708 | bool Ok(); | |
709 | }; | |
710 | ||
711 | //--------------------------------------------------------------------------- | |
712 | ||
af309447 RD |
713 | enum { |
714 | wxIMAGELIST_DRAW_NORMAL , | |
715 | wxIMAGELIST_DRAW_TRANSPARENT, | |
716 | wxIMAGELIST_DRAW_SELECTED, | |
717 | wxIMAGELIST_DRAW_FOCUSED, | |
718 | wxIMAGE_LIST_NORMAL, | |
719 | wxIMAGE_LIST_SMALL, | |
720 | wxIMAGE_LIST_STATE | |
721 | }; | |
722 | ||
723 | class wxImageList { | |
724 | public: | |
dcd38683 | 725 | wxImageList(int width, int height, int mask=TRUE, int initialCount=1); |
af309447 RD |
726 | ~wxImageList(); |
727 | ||
728 | int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); | |
729 | %name(AddWithColourMask)int Add(const wxBitmap& bitmap, const wxColour& maskColour); | |
730 | %name(AddIcon)int Add(const wxIcon& icon); | |
f6bcfd97 | 731 | #ifdef __WXMSW__ |
b57bdb5a | 732 | bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap); |
b57bdb5a | 733 | #else |
f6bcfd97 BP |
734 | // %name(ReplaceIcon)bool Replace(int index, const wxIcon& icon); |
735 | // int Add(const wxBitmap& bitmap); | |
b57bdb5a RD |
736 | bool Replace(int index, const wxBitmap& bitmap); |
737 | #endif | |
af309447 RD |
738 | |
739 | bool Draw(int index, wxDC& dc, int x, int x, int flags = wxIMAGELIST_DRAW_NORMAL, | |
740 | const bool solidBackground = FALSE); | |
741 | ||
742 | int GetImageCount(); | |
743 | bool Remove(int index); | |
744 | bool RemoveAll(); | |
f6bcfd97 | 745 | void GetSize(int index, int& OUTPUT, int& OUTPUT); |
af309447 RD |
746 | }; |
747 | ||
b639c3c5 | 748 | |
7bf85405 RD |
749 | //--------------------------------------------------------------------------- |
750 |