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