]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gdi.i
oops, have to commit this after accidentally committing intl.cpp to not break compila...
[wxWidgets.git] / wxPython / src / gdi.i
CommitLineData
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"
af309447 18#include <wx/imaglist.h>
6d8b4f8d
RD
19#include <wx/fontmap.h>
20#include <wx/fontenc.h>
21#include <wx/fontmap.h>
22#include <wx/fontutil.h>
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 34
7bf85405
RD
35//---------------------------------------------------------------------------
36
9416aa89
RD
37class wxGDIObject : public wxObject {
38public:
39 wxGDIObject();
40 ~wxGDIObject();
41
42 bool GetVisible();
43 void SetVisible( bool visible );
44
45 bool IsNull();
46
47};
6999b0d8
RD
48
49//---------------------------------------------------------------------------
50
9416aa89 51class wxBitmap : public wxGDIObject
5bff6bb8 52{
7bf85405 53public:
e6056257 54 wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_BMP);
7bf85405
RD
55 ~wxBitmap();
56
7bf85405
RD
57 wxPalette* GetPalette();
58 wxMask* GetMask();
e6056257
RD
59 bool LoadFile(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_BMP);
60 bool SaveFile(const wxString& name, wxBitmapType type, wxPalette* palette = NULL);
7bf85405 61 void SetMask(wxMask* mask);
fb5e0af0 62#ifdef __WXMSW__
b8b8dda7 63 void SetPalette(wxPalette& palette);
fb5e0af0 64#endif
5bff6bb8
RD
65
66 // wxGDIImage methods
67#ifdef __WXMSW__
68 long GetHandle();
69 void SetHandle(long handle);
70#endif
71 bool Ok();
72 int GetWidth();
73 int GetHeight();
74 int GetDepth();
75 void SetWidth(int w);
76 void SetHeight(int h);
77 void SetDepth(int d);
78#ifdef __WXMSW__
79 void SetSize(const wxSize& size);
80#endif
f6bcfd97
BP
81
82 wxBitmap GetSubBitmap( const wxRect& rect );
f6bcfd97 83 bool CopyFromIcon(const wxIcon& icon);
ecc08ead 84#ifdef __WXMSW__
f6bcfd97
BP
85 bool CopyFromCursor(const wxCursor& cursor);
86 int GetQuality();
87 void SetQuality(int q);
88#endif
89
90 %pragma(python) addtoclass = "
91 def __del__(self,gdic=gdic):
92 try:
93 if self.thisown == 1 :
94 gdic.delete_wxBitmap(self)
95 except:
96 pass
97"
7bf85405
RD
98};
99
5bff6bb8 100
96bfd053 101// Declarations of some alternate "constructors"
7bf85405 102%new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1);
96bfd053
RD
103%new wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings);
104%new wxBitmap* wxBitmapFromIcon(const wxIcon& icon);
d56cebe7 105%new wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 );
9c039d08 106
d56cebe7
RD
107// #ifdef __WXMSW__
108// %new wxBitmap* wxBitmapFromData(PyObject* data, long type,
109// int width, int height, int depth = 1);
110// #endif
8bf5d46e 111
96bfd053
RD
112
113
114%{ // Implementations of some alternate "constructors"
115
7bf85405
RD
116 wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) {
117 return new wxBitmap(width, height, depth);
118 }
119
96bfd053
RD
120 static char** ConvertListOfStrings(PyObject* listOfStrings) {
121 char** cArray = NULL;
122 int count;
123
124 if (!PyList_Check(listOfStrings)) {
125 PyErr_SetString(PyExc_TypeError, "Expected a list of strings.");
126 return NULL;
127 }
128 count = PyList_Size(listOfStrings);
129 cArray = new char*[count];
130
131 for(int x=0; x<count; x++) {
132 // TODO: Need some validation and error checking here
133 cArray[x] = PyString_AsString(PyList_GET_ITEM(listOfStrings, x));
134 }
135 return cArray;
136 }
137
d56cebe7 138
96bfd053
RD
139 wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings) {
140 char** cArray = NULL;
141 wxBitmap* bmp;
142
143 cArray = ConvertListOfStrings(listOfStrings);
144 if (! cArray)
145 return NULL;
146 bmp = new wxBitmap(cArray);
147 delete [] cArray;
148 return bmp;
149 }
150
151
152 wxBitmap* wxBitmapFromIcon(const wxIcon& icon) {
153 return new wxBitmap(icon);
154 }
155
156
d56cebe7
RD
157 wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 ) {
158 return new wxBitmap(bits, width, height, depth);
159 }
926bb76c 160
4c9993c3 161
d56cebe7
RD
162// #ifdef __WXMSW__
163// wxBitmap* wxBitmapFromData(PyObject* data, long type,
164// int width, int height, int depth = 1) {
165// if (! PyString_Check(data)) {
166// PyErr_SetString(PyExc_TypeError, "Expected string object");
167// return NULL;
168// }
169// return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth);
170// }
171// #endif
7bf85405
RD
172%}
173
174//---------------------------------------------------------------------------
175
9416aa89 176class wxMask : public wxObject {
7bf85405
RD
177public:
178 wxMask(const wxBitmap& bitmap);
eb715945 179 //~wxMask();
96bfd053
RD
180
181 %addmethods { void Destroy() { delete self; } }
7bf85405
RD
182};
183
184%new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour);
185%{
186 wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour) {
187 return new wxMask(bitmap, colour);
188 }
189%}
190
191
192//---------------------------------------------------------------------------
193
194
9416aa89 195class wxIcon : public wxGDIObject
5bff6bb8 196{
7bf85405 197public:
fb5e0af0
RD
198 wxIcon(const wxString& name, long flags,
199 int desiredWidth = -1, int desiredHeight = -1);
7bf85405
RD
200 ~wxIcon();
201
6abe8375 202#ifndef __WXMAC__
7bf85405 203 bool LoadFile(const wxString& name, long flags);
6abe8375 204#endif
5bff6bb8
RD
205
206 // wxGDIImage methods
207#ifdef __WXMSW__
208 long GetHandle();
209 void SetHandle(long handle);
210#endif
211 bool Ok();
212 int GetWidth();
213 int GetHeight();
214 int GetDepth();
215 void SetWidth(int w);
216 void SetHeight(int h);
217 void SetDepth(int d);
218#ifdef __WXMSW__
219 void SetSize(const wxSize& size);
220#endif
96bfd053
RD
221 void CopyFromBitmap(const wxBitmap& bmp);
222
f6bcfd97
BP
223 %pragma(python) addtoclass = "
224 def __del__(self,gdic=gdic):
225 try:
226 if self.thisown == 1 :
227 gdic.delete_wxIcon(self)
228 except:
229 pass
230"
7bf85405
RD
231};
232
8bf5d46e 233
96bfd053
RD
234// Declarations of some alternate "constructors"
235%new wxIcon* wxEmptyIcon();
236%new wxIcon* wxIconFromXPMData(PyObject* listOfStrings);
237
238%{ // Implementations of some alternate "constructors"
239 wxIcon* wxEmptyIcon() {
240 return new wxIcon();
241 }
242
243 wxIcon* wxIconFromXPMData(PyObject* listOfStrings) {
244 char** cArray = NULL;
245 wxIcon* icon;
246
247 cArray = ConvertListOfStrings(listOfStrings);
248 if (! cArray)
249 return NULL;
250 icon = new wxIcon(cArray);
251 delete [] cArray;
252 return icon;
253 }
254%}
255
7bf85405
RD
256//---------------------------------------------------------------------------
257
9416aa89 258class wxCursor : public wxGDIObject
5bff6bb8 259{
7bf85405 260public:
fb5e0af0 261#ifdef __WXMSW__
7bf85405 262 wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0);
fb5e0af0 263#endif
7bf85405 264 ~wxCursor();
5bff6bb8
RD
265
266 // wxGDIImage methods
267#ifdef __WXMSW__
268 long GetHandle();
269 void SetHandle(long handle);
270#endif
271 bool Ok();
272#ifdef __WXMSW__
273 int GetWidth();
274 int GetHeight();
275 int GetDepth();
276 void SetWidth(int w);
277 void SetHeight(int h);
278 void SetDepth(int d);
279 void SetSize(const wxSize& size);
280#endif
7bf85405
RD
281};
282
9c039d08 283%name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id);
7bf85405 284%{ // Alternate 'constructor'
9c039d08 285 wxCursor* wxPyStockCursor(int id) {
7bf85405
RD
286 return new wxCursor(id);
287 }
288%}
289
290//----------------------------------------------------------------------
291
f0261a72 292
6d8b4f8d
RD
293enum wxFontFamily
294{
295 wxFONTFAMILY_DEFAULT = wxDEFAULT,
296 wxFONTFAMILY_DECORATIVE = wxDECORATIVE,
297 wxFONTFAMILY_ROMAN = wxROMAN,
298 wxFONTFAMILY_SCRIPT = wxSCRIPT,
299 wxFONTFAMILY_SWISS = wxSWISS,
300 wxFONTFAMILY_MODERN = wxMODERN,
301 wxFONTFAMILY_TELETYPE = wxTELETYPE,
ce914f73
RD
302 wxFONTFAMILY_MAX,
303 wxFONTFAMILY_UNKNOWN
6d8b4f8d
RD
304};
305
306// font styles
307enum wxFontStyle
308{
309 wxFONTSTYLE_NORMAL = wxNORMAL,
310 wxFONTSTYLE_ITALIC = wxITALIC,
311 wxFONTSTYLE_SLANT = wxSLANT,
312 wxFONTSTYLE_MAX
313};
314
315// font weights
316enum wxFontWeight
317{
318 wxFONTWEIGHT_NORMAL = wxNORMAL,
319 wxFONTWEIGHT_LIGHT = wxLIGHT,
320 wxFONTWEIGHT_BOLD = wxBOLD,
321 wxFONTWEIGHT_MAX
322};
323
324
325// font encodings
f0261a72
RD
326enum wxFontEncoding
327{
328 wxFONTENCODING_SYSTEM = -1, // system default
329 wxFONTENCODING_DEFAULT, // current default encoding
330
331 // ISO8859 standard defines a number of single-byte charsets
332 wxFONTENCODING_ISO8859_1, // West European (Latin1)
333 wxFONTENCODING_ISO8859_2, // Central and East European (Latin2)
334 wxFONTENCODING_ISO8859_3, // Esperanto (Latin3)
6d8b4f8d 335 wxFONTENCODING_ISO8859_4, // Baltic (old) (Latin4)
f0261a72
RD
336 wxFONTENCODING_ISO8859_5, // Cyrillic
337 wxFONTENCODING_ISO8859_6, // Arabic
338 wxFONTENCODING_ISO8859_7, // Greek
339 wxFONTENCODING_ISO8859_8, // Hebrew
340 wxFONTENCODING_ISO8859_9, // Turkish (Latin5)
341 wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6)
342 wxFONTENCODING_ISO8859_11, // Thai
343 wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it
344 // here anyhow to make all ISO8859
345 // consecutive numbers
6d8b4f8d 346 wxFONTENCODING_ISO8859_13, // Baltic (Latin7)
f0261a72
RD
347 wxFONTENCODING_ISO8859_14, // Latin8
348 wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro)
6d8b4f8d 349 wxFONTENCODING_ISO8859_MAX,
f0261a72
RD
350
351 // Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
352 wxFONTENCODING_KOI8, // we don't support any of KOI8 variants
353 wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866
354 wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria
355
356 // what would we do without Microsoft? They have their own encodings
357 // for DOS
358 wxFONTENCODING_CP437, // original MS-DOS codepage
359 wxFONTENCODING_CP850, // CP437 merged with Latin1
360 wxFONTENCODING_CP852, // CP437 merged with Latin2
361 wxFONTENCODING_CP855, // another cyrillic encoding
362 wxFONTENCODING_CP866, // and another one
363 // and for Windows
6d8b4f8d 364 wxFONTENCODING_CP874, // WinThai
98624b49
RD
365 wxFONTENCODING_CP932, // Japanese (shift-JIS)
366 wxFONTENCODING_CP936, // Chiniese simplified (GB)
367 wxFONTENCODING_CP949, // Korean (Hangul charset)
368 wxFONTENCODING_CP950, // Chinese (traditional - Big5)
f0261a72
RD
369 wxFONTENCODING_CP1250, // WinLatin2
370 wxFONTENCODING_CP1251, // WinCyrillic
371 wxFONTENCODING_CP1252, // WinLatin1
6d8b4f8d
RD
372 wxFONTENCODING_CP1253, // WinGreek (8859-7)
373 wxFONTENCODING_CP1254, // WinTurkish
374 wxFONTENCODING_CP1255, // WinHebrew
375 wxFONTENCODING_CP1256, // WinArabic
376 wxFONTENCODING_CP1257, // WinBaltic (same as Latin 7)
377 wxFONTENCODING_CP12_MAX,
378
379 wxFONTENCODING_UTF7, // UTF-7 Unicode encoding
380 wxFONTENCODING_UTF8, // UTF-8 Unicode encoding
381
382 wxFONTENCODING_UNICODE, // Unicode - currently used only by
383 // wxEncodingConverter class
f0261a72
RD
384
385 wxFONTENCODING_MAX
386};
387
0569df0f 388
6d8b4f8d
RD
389
390// wxNativeFontInfo is platform-specific font representation: this struct
391// should be considered as opaque font description only used by the native
392// functions, the user code can only get the objects of this type from
393// somewhere and pass it somewhere else (possibly save them somewhere using
394// ToString() and restore them using FromString())
395struct wxNativeFontInfo
396{
b5a5d647
RD
397#ifdef __WXGTK__
398 // init the elements from an XLFD, return TRUE if ok
399 bool FromXFontName(const wxString& xFontName);
400
ce914f73
RD
401 // return false if we were never initialized with a valid XLFD
402 bool IsDefault() const;
403
b5a5d647
RD
404 // generate an XLFD using the fontElements
405 wxString GetXFontName() const;
ce914f73
RD
406
407 // set the XFLD
408 void SetXFontName(const wxString& xFontName);
b5a5d647
RD
409#endif
410
411 wxNativeFontInfo() { Init(); }
412
413 // reset to the default state
414 void Init();
415
1893b029 416#ifndef __WXGTK__
b5a5d647
RD
417 // accessors and modifiers for the font elements
418 int GetPointSize() const;
419 wxFontStyle GetStyle() const;
420 wxFontWeight GetWeight() const;
421 bool GetUnderlined() const;
422 wxString GetFaceName() const;
423 wxFontFamily GetFamily() const;
424 wxFontEncoding GetEncoding() const;
425
426 void SetPointSize(int pointsize);
427 void SetStyle(wxFontStyle style);
428 void SetWeight(wxFontWeight weight);
429 void SetUnderlined(bool underlined);
430 void SetFaceName(wxString facename);
431 void SetFamily(wxFontFamily family);
432 void SetEncoding(wxFontEncoding encoding);
1893b029 433#endif
b5a5d647 434
6d8b4f8d
RD
435 // it is important to be able to serialize wxNativeFontInfo objects to be
436 // able to store them (in config file, for example)
437 bool FromString(const wxString& s);
438 wxString ToString() const;
439
440 %addmethods {
441 wxString __str__() {
442 return self->ToString();
443 }
444 }
b5a5d647
RD
445
446 // we also want to present the native font descriptions to the user in some
447 // human-readable form (it is not platform independent neither, but can
448 // hopefully be understood by the user)
449 bool FromUserString(const wxString& s);
450 wxString ToUserString() const;
6d8b4f8d
RD
451};
452
453
454// wxFontMapper manages user-definable correspondence between logical font
455// names and the fonts present on the machine.
456//
457// The default implementations of all functions will ask the user if they are
458// not capable of finding the answer themselves and store the answer in a
459// config file (configurable via SetConfigXXX functions). This behaviour may
460// be disabled by giving the value of FALSE to "interactive" parameter.
461// However, the functions will always consult the config file to allow the
462// user-defined values override the default logic and there is no way to
463// disable this - which shouldn't be ever needed because if "interactive" was
464// never TRUE, the config file is never created anyhow.
465class wxFontMapper
466{
467public:
468 wxFontMapper();
469 ~wxFontMapper();
470
471
472 // find an alternative for the given encoding (which is supposed to not be
473 // available on this system). If successful, return TRUE and rwxFontEcoding
474 // that can be used it wxFont ctor otherwise return FALSE
475 //bool GetAltForEncoding(wxFontEncoding encoding,
476 // wxFontEncoding *alt_encoding,
477 // const wxString& facename = wxEmptyString,
478 // bool interactive = TRUE);
479
480
481 // Find an alternative for the given encoding (which is supposed to not be
482 // available on this system). If successful, returns the encoding otherwise
483 // returns None.
484 %addmethods {
485 PyObject* GetAltForEncoding(wxFontEncoding encoding,
486 const wxString& facename = wxEmptyString,
487 bool interactive = TRUE) {
488 wxFontEncoding alt_enc;
489 if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive))
490 return PyInt_FromLong(alt_enc);
491 else {
492 Py_INCREF(Py_None);
493 return Py_None;
494 }
495 }
496 }
497
498
499 // checks whether given encoding is available in given face or not.
500 // If no facename is given,
501 bool IsEncodingAvailable(wxFontEncoding encoding,
502 const wxString& facename = wxEmptyString);
503
504 // returns the encoding for the given charset (in the form of RFC 2046) or
505 // wxFONTENCODING_SYSTEM if couldn't decode it
506 wxFontEncoding CharsetToEncoding(const wxString& charset,
507 bool interactive = TRUE);
508
509 // return internal string identifier for the encoding (see also
510 // GetEncodingDescription())
511 static wxString GetEncodingName(wxFontEncoding encoding);
512
513 // return user-readable string describing the given encoding
514 //
515 // NB: hard-coded now, but might change later (read it from config?)
516 static wxString GetEncodingDescription(wxFontEncoding encoding);
517
518 // the parent window for modal dialogs
519 void SetDialogParent(wxWindow *parent);
520
521 // the title for the dialogs (note that default is quite reasonable)
522 void SetDialogTitle(const wxString& title);
523
524 // functions which allow to configure the config object used: by default,
525 // the global one (from wxConfigBase::Get() will be used) and the default
526 // root path for the config settings is the string returned by
527 // GetDefaultConfigPath()
528
529
530 // set the config object to use (may be NULL to use default)
531 void SetConfig(wxConfigBase *config);
532
533 // set the root config path to use (should be an absolute path)
534 void SetConfigPath(const wxString& prefix);
535
536 // return default config path
537 static const wxChar *GetDefaultConfigPath();
538};
539
540
541
542
9416aa89 543class wxFont : public wxGDIObject {
7bf85405 544public:
0569df0f
RD
545 wxFont( int pointSize, int family, int style, int weight,
546 int underline=FALSE, char* faceName = "",
547 wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
6d8b4f8d
RD
548
549 %name(wxFontFromNativeInfo)wxFont(const wxNativeFontInfo& info);
550
0569df0f 551 ~wxFont();
7bf85405 552
6d8b4f8d
RD
553 bool Ok() const;
554 int GetPointSize() const;
555 int GetFamily() const;
556 int GetStyle() const;
557 int GetWeight() const;
558 bool GetUnderlined() const;
559 wxString GetFaceName() const;
560 wxFontEncoding GetEncoding() const;
68320e40
RD
561
562 bool IsFixedWidth();
563
6d8b4f8d 564 wxNativeFontInfo* GetNativeFontInfo() const;
b5a5d647
RD
565 wxString GetNativeFontInfoDesc() const;
566 wxString GetNativeFontInfoUserDesc() const;
6d8b4f8d 567
7bf85405 568 void SetPointSize(int pointSize);
6d8b4f8d 569 void SetFamily(int family);
7bf85405 570 void SetStyle(int style);
7bf85405 571 void SetWeight(int weight);
6d8b4f8d
RD
572 void SetFaceName(const wxString& faceName);
573 void SetUnderlined(bool underlined);
f0261a72 574 void SetEncoding(wxFontEncoding encoding);
6d8b4f8d 575 void SetNativeFontInfo(const wxNativeFontInfo& info);
b5a5d647
RD
576 // void SetNativeFontInfo(const wxString& info);
577 void SetNativeFontInfoUserDesc(const wxString& info);
7bf85405 578
6d8b4f8d
RD
579 wxString GetFamilyString() const;
580 wxString GetStyleString() const;
581 wxString GetWeightString() const;
f0261a72 582
6d8b4f8d
RD
583 static wxFontEncoding GetDefaultEncoding();
584 static void SetDefaultEncoding(wxFontEncoding encoding);
585
586};
f0261a72 587
0569df0f 588
9416aa89 589class wxFontList : public wxObject {
0569df0f
RD
590public:
591
592 void AddFont(wxFont* font);
593 wxFont * FindOrCreateFont(int point_size, int family, int style, int weight,
594 bool underline = FALSE, const char* facename = NULL,
595 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
596 void RemoveFont(wxFont *font);
2f4e9287
RD
597
598 int GetCount();
0569df0f
RD
599};
600
601
7bf85405
RD
602//----------------------------------------------------------------------
603
9416aa89 604class wxColour : public wxObject {
7bf85405
RD
605public:
606 wxColour(unsigned char red=0, unsigned char green=0, unsigned char blue=0);
607 ~wxColour();
608 unsigned char Red();
609 unsigned char Green();
610 unsigned char Blue();
611 bool Ok();
612 void Set(unsigned char red, unsigned char green, unsigned char blue);
613 %addmethods {
614 PyObject* Get() {
615 PyObject* rv = PyTuple_New(3);
616 PyTuple_SetItem(rv, 0, PyInt_FromLong(self->Red()));
617 PyTuple_SetItem(rv, 1, PyInt_FromLong(self->Green()));
618 PyTuple_SetItem(rv, 2, PyInt_FromLong(self->Blue()));
619 return rv;
620 }
621 }
9b3d3bc4
RD
622 %pragma(python) addtoclass = "asTuple = Get"
623 %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
624 %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
625
7bf85405
RD
626};
627
628%new wxColour* wxNamedColour(const wxString& colorName);
de20db99 629
7bf85405
RD
630%{ // Alternate 'constructor'
631 wxColour* wxNamedColour(const wxString& colorName) {
632 return new wxColour(colorName);
633 }
634%}
635
636
7bf85405 637
9416aa89 638class wxColourDatabase : public wxObject {
7bf85405 639public:
0569df0f
RD
640
641 wxColour *FindColour(const wxString& colour);
642 wxString FindName(const wxColour& colour) const;
643
7bf85405 644 %addmethods {
0569df0f
RD
645 void Append(const wxString& name, int red, int green, int blue) {
646 self->Append(name.c_str(), new wxColour(red, green, blue));
7bf85405 647 }
7bf85405 648 }
0569df0f
RD
649};
650
651
652//----------------------------------------------------------------------
653
9416aa89 654class wxPen : public wxGDIObject {
0569df0f
RD
655public:
656 wxPen(wxColour& colour, int width=1, int style=wxSOLID);
657 ~wxPen();
7bf85405
RD
658
659 int GetCap();
25832b3f 660 wxColour GetColour();
7bf85405 661
fb5e0af0 662 int GetJoin();
7bf85405
RD
663 int GetStyle();
664 int GetWidth();
665 bool Ok();
666 void SetCap(int cap_style);
667 void SetColour(wxColour& colour);
aeeb6a44
RR
668 void SetJoin(int join_style);
669 void SetStyle(int style);
670 void SetWidth(int width);
08127323 671
aeeb6a44 672 // **** This one needs to return a list of ints (wxDash)
ecc08ead 673 //int GetDashes(wxDash **dashes);
eec92d76 674 void SetDashes(int LCOUNT, wxDash* choices);
6999b0d8
RD
675
676#ifdef __WXMSW__
677 wxBitmap* GetStipple();
b8b8dda7 678 void SetStipple(wxBitmap& stipple);
fb5e0af0 679#endif
7bf85405
RD
680};
681
0569df0f 682
ecc08ead 683
05f30eec
RD
684
685// The list of ints for the dashes needs to exist for the life of the pen
686// so we make it part of the class to save it. wxPyPen is aliased to wxPen
687// in _extras.py
688
ecc08ead
RD
689%{
690class wxPyPen : public wxPen {
691public:
692 wxPyPen(wxColour& colour, int width=1, int style=wxSOLID)
693 : wxPen(colour, width, style)
694 { m_dash = NULL; }
695 ~wxPyPen() {
696 if (m_dash)
05f30eec 697 delete [] m_dash;
ecc08ead
RD
698 }
699
700 void SetDashes(int nb_dashes, const wxDash *dash) {
05f30eec
RD
701 if (m_dash)
702 delete [] m_dash;
ecc08ead 703 m_dash = new wxDash[nb_dashes];
05f30eec 704 for (int i=0; i<nb_dashes; i++) {
ecc08ead 705 m_dash[i] = dash[i];
05f30eec 706 }
ecc08ead
RD
707 wxPen::SetDashes(nb_dashes, m_dash);
708 }
709
710private:
711 wxDash* m_dash;
712};
713%}
714
715
ecc08ead
RD
716class wxPyPen : public wxPen {
717public:
718 wxPyPen(wxColour& colour, int width=1, int style=wxSOLID);
719 ~wxPyPen();
720
721 void SetDashes(int LCOUNT, wxDash* choices);
722};
723
724
725
05f30eec 726
9416aa89 727class wxPenList : public wxObject {
0569df0f
RD
728public:
729
730 void AddPen(wxPen* pen);
731 wxPen* FindOrCreatePen(const wxColour& colour, int width, int style);
732 void RemovePen(wxPen* pen);
2f4e9287
RD
733
734 int GetCount();
0569df0f
RD
735};
736
737
738
7bf85405
RD
739//----------------------------------------------------------------------
740
9416aa89 741class wxBrush : public wxGDIObject {
7bf85405 742public:
0569df0f
RD
743 wxBrush(const wxColour& colour, int style=wxSOLID);
744 ~wxBrush();
26b9cf27 745
25832b3f 746 wxColour GetColour();
7bf85405
RD
747 wxBitmap * GetStipple();
748 int GetStyle();
749 bool Ok();
750 void SetColour(wxColour &colour);
b8b8dda7 751 void SetStipple(wxBitmap& bitmap);
7bf85405
RD
752 void SetStyle(int style);
753};
754
0569df0f 755
6ee2116b 756class wxBrushList : public wxObject {
0569df0f
RD
757public:
758
759 void AddBrush(wxBrush *brush);
760 wxBrush * FindOrCreateBrush(const wxColour& colour, int style);
761 void RemoveBrush(wxBrush *brush);
2f4e9287
RD
762
763 int GetCount();
0569df0f
RD
764};
765
7bf85405
RD
766//----------------------------------------------------------------------
767
768
769
9416aa89 770class wxDC : public wxObject {
7bf85405 771public:
fb5e0af0 772// wxDC(); **** abstract base class, can't instantiate.
7bf85405
RD
773 ~wxDC();
774
775 void BeginDrawing();
efc5f224
RD
776// %name(BlitXY)
777 bool Blit(long xdest, long ydest,
778 long width, long height,
779 wxDC *source, long xsrc, long ysrc,
780 int logicalFunc = wxCOPY, int useMask = FALSE);
781// bool Blit(const wxPoint& destPt, const wxSize& sz,
782// wxDC *source, const wxPoint& srcPt,
783// int logicalFunc = wxCOPY, int useMask = FALSE);
784
7bf85405
RD
785 void Clear();
786 void CrossHair(long x, long y);
787 void DestroyClippingRegion();
788 long DeviceToLogicalX(long x);
789 long DeviceToLogicalXRel(long x);
790 long DeviceToLogicalY(long y);
791 long DeviceToLogicalYRel(long y);
792 void DrawArc(long x1, long y1, long x2, long y2, long xc, long yc);
bb0054cd 793 void DrawCircle(long x, long y, long radius);
7bf85405
RD
794 void DrawEllipse(long x, long y, long width, long height);
795 void DrawEllipticArc(long x, long y, long width, long height, long start, long end);
796 void DrawIcon(const wxIcon& icon, long x, long y);
23bed520
RD
797
798 void DrawLabel(const wxString& text, const wxRect& rect,
799 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
800 int indexAccel = -1);
801
802 %addmethods {
803 wxRect DrawImageLabel(const wxString& text,
804 const wxBitmap& image,
805 const wxRect& rect,
806 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
807 int indexAccel = -1) {
808 wxRect rv;
809 self->DrawLabel(text, image, rect, alignment, indexAccel, &rv);
810 return rv;
811 }
812 }
813
7bf85405 814 void DrawLine(long x1, long y1, long x2, long y2);
eec92d76
RD
815 void DrawLines(int PCOUNT, wxPoint* points, long xoffset=0, long yoffset=0);
816 void DrawPolygon(int PCOUNT, wxPoint* points, long xoffset=0, long yoffset=0,
7bf85405
RD
817 int fill_style=wxODDEVEN_RULE);
818 void DrawPoint(long x, long y);
819 void DrawRectangle(long x, long y, long width, long height);
6999b0d8 820 void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
7bf85405 821 void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20);
eec92d76 822 void DrawSpline(int PCOUNT, wxPoint* points);
7bf85405
RD
823 void DrawText(const wxString& text, long x, long y);
824 void EndDoc();
825 void EndDrawing();
826 void EndPage();
827 void FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
c5943253
RD
828 wxBrush GetBackground();
829 wxBrush GetBrush();
7bf85405
RD
830 long GetCharHeight();
831 long GetCharWidth();
832 void GetClippingBox(long *OUTPUT, long *OUTPUT,
833 long *OUTPUT, long *OUTPUT);
c5943253 834 wxFont GetFont();
7bf85405 835 int GetLogicalFunction();
eec92d76 836 void GetLogicalScale(double *OUTPUT, double *OUTPUT);
7bf85405
RD
837 int GetMapMode();
838 bool GetOptimization();
c5943253 839 wxPen GetPen();
fb5e0af0
RD
840 %addmethods {
841 %new wxColour* GetPixel(long x, long y) {
842 wxColour* wc = new wxColour();
843 self->GetPixel(x, y, wc);
844 return wc;
845 }
846 }
bb0054cd
RD
847 %name(GetSizeTuple)void GetSize(int* OUTPUT, int* OUTPUT);
848 wxSize GetSize();
eec92d76 849 wxSize GetSizeMM();
25832b3f 850 wxColour GetTextBackground();
af309447
RD
851 void GetTextExtent(const wxString& string, long *OUTPUT, long *OUTPUT);
852 %name(GetFullTextExtent)void GetTextExtent(const wxString& string,
853 long *OUTPUT, long *OUTPUT, long *OUTPUT, long* OUTPUT,
854 const wxFont* font = NULL);
25832b3f 855 wxColour GetTextForeground();
eec92d76 856 void GetUserScale(double *OUTPUT, double *OUTPUT);
7bf85405
RD
857 long LogicalToDeviceX(long x);
858 long LogicalToDeviceXRel(long x);
859 long LogicalToDeviceY(long y);
860 long LogicalToDeviceYRel(long y);
861 long MaxX();
862 long MaxY();
863 long MinX();
864 long MinY();
865 bool Ok();
866 void SetDeviceOrigin(long x, long y);
867 void SetBackground(const wxBrush& brush);
868 void SetBackgroundMode(int mode);
869 void SetClippingRegion(long x, long y, long width, long height);
19a97bd6 870 %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region);
7bf85405
RD
871 void SetPalette(const wxPalette& colourMap);
872 void SetBrush(const wxBrush& brush);
873 void SetFont(const wxFont& font);
874 void SetLogicalFunction(int function);
eec92d76 875 void SetLogicalScale(double x, double y);
7bf85405
RD
876 void SetMapMode(int mode);
877 void SetOptimization(bool optimize);
878 void SetPen(const wxPen& pen);
879 void SetTextBackground(const wxColour& colour);
880 void SetTextForeground(const wxColour& colour);
881 void SetUserScale(double x_scale, double y_scale);
882 bool StartDoc(const wxString& message);
883 void StartPage();
884
885
efc5f224
RD
886
887 void DrawBitmap(const wxBitmap& bitmap, long x, long y,
888 int useMask = FALSE);
889
eec92d76
RD
890 bool CanDrawBitmap();
891 bool CanGetTextExtent();
892 int GetDepth();
893 wxSize GetPPI();
894
895 void GetLogicalOrigin(int *OUTPUT, int *OUTPUT);
896 void SetLogicalOrigin(int x, int y);
897 void GetDeviceOrigin(int *OUTPUT, int *OUTPUT);
eec92d76
RD
898 void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
899
f6bcfd97
BP
900 void CalcBoundingBox(int x, int y);
901 void ResetBoundingBox();
c7e7022c 902
9d37f964
RD
903 %addmethods {
904 void GetBoundingBox(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT);
905 // See below for implementation
906 }
907
c7e7022c
RD
908#ifdef __WXMSW__
909 long GetHDC();
910#endif
9d37f964
RD
911
912
913 %addmethods {
76e280e7 914 // NOTE: These methods are VERY SIMILAR in implentation. It would be
17c0e08c 915 // nice to factor out common code and or turn them into a set of
76e280e7
RD
916 // template-like macros.
917
9d37f964
RD
918 // Draw a point for every set of coordinants in pyPoints, optionally
919 // setting a new pen for each
920 PyObject* _DrawPointList(PyObject* pyPoints, PyObject* pyPens) {
921 bool isFastSeq = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
922 bool isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
923 int numObjs = 0;
924 int numPens = 0;
925 wxPen* pen;
926 PyObject* obj;
927 int x1, y1;
928 int i = 0;
929
930 if (!PySequence_Check(pyPoints)) {
931 goto err0;
932 }
933 if (!PySequence_Check(pyPens)) {
934 goto err1;
935 }
936 numObjs = PySequence_Length(pyPoints);
937 numPens = PySequence_Length(pyPens);
938
939 for (i = 0; i < numObjs; i++) {
940 // Use a new pen?
941 if (i < numPens) {
942 if (isFastPens) {
943 obj = PySequence_Fast_GET_ITEM(pyPens, i);
944 }
945 else {
946 obj = PySequence_GetItem(pyPens, i);
947 }
948 if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) {
76e280e7
RD
949 if (!isFastPens)
950 Py_DECREF(obj);
9d37f964
RD
951 goto err1;
952 }
953
954 self->SetPen(*pen);
955 if (!isFastPens)
956 Py_DECREF(obj);
957 }
958
959 // Get the point coordinants
960 if (isFastSeq) {
961 obj = PySequence_Fast_GET_ITEM(pyPoints, i);
962 }
963 else {
964 obj = PySequence_GetItem(pyPoints, i);
965 }
966 if (! _2int_seq_helper(obj, &x1, &y1)) {
76e280e7
RD
967 if (!isFastPens)
968 Py_DECREF(obj);
9d37f964
RD
969 goto err0;
970 }
971
972 // Now draw the point
973 self->DrawPoint(x1, y1);
974
975 if (!isFastSeq)
976 Py_DECREF(obj);
977 }
978
979 Py_INCREF(Py_None);
980 return Py_None;
981
982 err1:
983 PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
984 return NULL;
985 err0:
986 PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
987 return NULL;
988 }
989
990
991 // Draw a line for every set of coordinants in pyLines, optionally
992 // setting a new pen for each
993 PyObject* _DrawLineList(PyObject* pyLines, PyObject* pyPens) {
994 bool isFastSeq = PyList_Check(pyLines) || PyTuple_Check(pyLines);
995 bool isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
996 int numObjs = 0;
997 int numPens = 0;
998 wxPen* pen;
999 PyObject* obj;
1000 int x1, y1, x2, y2;
1001 int i = 0;
1002
1003 if (!PySequence_Check(pyLines)) {
1004 goto err0;
1005 }
1006 if (!PySequence_Check(pyPens)) {
1007 goto err1;
1008 }
1009 numObjs = PySequence_Length(pyLines);
1010 numPens = PySequence_Length(pyPens);
1011
1012 for (i = 0; i < numObjs; i++) {
1013 // Use a new pen?
1014 if (i < numPens) {
1015 if (isFastPens) {
1016 obj = PySequence_Fast_GET_ITEM(pyPens, i);
1017 }
1018 else {
1019 obj = PySequence_GetItem(pyPens, i);
1020 }
1021 if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) {
76e280e7
RD
1022 if (!isFastPens)
1023 Py_DECREF(obj);
9d37f964
RD
1024 goto err1;
1025 }
1026
1027 self->SetPen(*pen);
1028 if (!isFastPens)
1029 Py_DECREF(obj);
1030 }
1031
1032 // Get the line coordinants
1033 if (isFastSeq) {
1034 obj = PySequence_Fast_GET_ITEM(pyLines, i);
1035 }
1036 else {
1037 obj = PySequence_GetItem(pyLines, i);
1038 }
1039 if (! _4int_seq_helper(obj, &x1, &y1, &x2, &y2)) {
76e280e7
RD
1040 if (!isFastPens)
1041 Py_DECREF(obj);
9d37f964
RD
1042 goto err0;
1043 }
1044
1045 // Now draw the line
1046 self->DrawLine(x1, y1, x2, y2);
1047
1048 if (!isFastSeq)
1049 Py_DECREF(obj);
1050 }
1051
1052 Py_INCREF(Py_None);
1053 return Py_None;
1054
1055 err1:
1056 PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
1057 return NULL;
1058 err0:
1059 PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x2,y2) sequences.");
1060 return NULL;
1061 }
1062 }
1063
1064
1065 %pragma(python) addtoclass = "
1066 def DrawPointList(self, points, pens=None):
1067 if pens is None:
1068 pens = []
1069 elif isinstance(pens, wxPenPtr):
1070 pens = [pens]
1071 elif len(pens) != len(points):
1072 raise ValueError('points and pens must have same length')
1073 return self._DrawPointList(points, pens)
1074
1075 def DrawLineList(self, lines, pens=None):
1076 if pens is None:
1077 pens = []
1078 elif isinstance(pens, wxPenPtr):
1079 pens = [pens]
1080 elif len(pens) != len(lines):
1081 raise ValueError('lines and pens must have same length')
1082 return self._DrawLineList(lines, pens)
1083"
1084
1085
7bf85405
RD
1086};
1087
1088
9d37f964
RD
1089
1090%{
1091static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) {
1092 *x1 = dc->MinX();
1093 *y1 = dc->MinY();
1094 *x2 = dc->MaxX();
1095 *y2 = dc->MaxY();
1096}
1097%}
1098
7bf85405
RD
1099//----------------------------------------------------------------------
1100
1101class wxMemoryDC : public wxDC {
1102public:
1103 wxMemoryDC();
1104
1105 void SelectObject(const wxBitmap& bitmap);
1106}
1107
1108%new wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC);
1109%{ // Alternate 'constructor'
1110 wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC) {
1111 return new wxMemoryDC(oldDC);
1112 }
1113%}
1114
1115
1116//---------------------------------------------------------------------------
1117
1118class wxScreenDC : public wxDC {
1119public:
1120 wxScreenDC();
1121
26b9cf27
RD
1122 %name(StartDrawingOnTopWin) bool StartDrawingOnTop(wxWindow* window);
1123 bool StartDrawingOnTop(wxRect* rect = NULL);
7bf85405
RD
1124 bool EndDrawingOnTop();
1125};
1126
1127//---------------------------------------------------------------------------
1128
1129class wxClientDC : public wxDC {
1130public:
1131 wxClientDC(wxWindow* win);
1132};
1133
1134//---------------------------------------------------------------------------
1135
1136class wxPaintDC : public wxDC {
1137public:
1138 wxPaintDC(wxWindow* win);
1139};
1140
1141//---------------------------------------------------------------------------
1142
b639c3c5
RD
1143class wxWindowDC : public wxDC {
1144public:
1145 wxWindowDC(wxWindow* win);
1146};
b639c3c5
RD
1147
1148//---------------------------------------------------------------------------
1149
7bf85405 1150
fb5e0af0 1151#ifdef __WXMSW__
17c0e08c
RD
1152
1153%{
1154#include <wx/metafile.h>
1155%}
1156
1157class wxMetaFile : public wxObject {
1158public:
23bed520 1159 wxMetaFile(const wxString& filename = wxEmptyString);
17c0e08c
RD
1160 ~wxMetaFile();
1161
1162 bool Ok();
1163 bool SetClipboard(int width = 0, int height = 0);
1164
1165 wxSize GetSize();
1166 int GetWidth();
1167 int GetHeight();
1168
1169 const wxString& GetFileName() const { return m_filename; }
1170
1171};
1172
1173// bool wxMakeMetaFilePlaceable(const wxString& filename,
1174// int minX, int minY, int maxX, int maxY, float scale=1.0);
1175
1176
7bf85405
RD
1177class wxMetaFileDC : public wxDC {
1178public:
23bed520 1179 wxMetaFileDC(const wxString& filename = wxEmptyString,
17c0e08c 1180 int width = 0, int height = 0,
23bed520 1181 const wxString& description = wxEmptyString);
7bf85405
RD
1182 wxMetaFile* Close();
1183};
17c0e08c 1184
fb5e0af0 1185#endif
7bf85405 1186
b639c3c5
RD
1187//---------------------------------------------------------------------------
1188
9416aa89 1189class wxPalette : public wxGDIObject {
b639c3c5 1190public:
eec92d76 1191 wxPalette(int LCOUNT, byte* choices, byte* choices, byte* choices);
b639c3c5
RD
1192 ~wxPalette();
1193
1194 int GetPixel(byte red, byte green, byte blue);
1195 bool GetRGB(int pixel, byte* OUTPUT, byte* OUTPUT, byte* OUTPUT);
1196 bool Ok();
1197};
1198
1199//---------------------------------------------------------------------------
1200
af309447
RD
1201enum {
1202 wxIMAGELIST_DRAW_NORMAL ,
1203 wxIMAGELIST_DRAW_TRANSPARENT,
1204 wxIMAGELIST_DRAW_SELECTED,
1205 wxIMAGELIST_DRAW_FOCUSED,
1206 wxIMAGE_LIST_NORMAL,
1207 wxIMAGE_LIST_SMALL,
1208 wxIMAGE_LIST_STATE
1209};
1210
9416aa89 1211class wxImageList : public wxObject {
af309447 1212public:
dcd38683 1213 wxImageList(int width, int height, int mask=TRUE, int initialCount=1);
af309447
RD
1214 ~wxImageList();
1215
1216 int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
1217 %name(AddWithColourMask)int Add(const wxBitmap& bitmap, const wxColour& maskColour);
1218 %name(AddIcon)int Add(const wxIcon& icon);
f6bcfd97 1219#ifdef __WXMSW__
b57bdb5a 1220 bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
b57bdb5a 1221#else
f6bcfd97
BP
1222// %name(ReplaceIcon)bool Replace(int index, const wxIcon& icon);
1223// int Add(const wxBitmap& bitmap);
b57bdb5a
RD
1224 bool Replace(int index, const wxBitmap& bitmap);
1225#endif
af309447
RD
1226
1227 bool Draw(int index, wxDC& dc, int x, int x, int flags = wxIMAGELIST_DRAW_NORMAL,
1228 const bool solidBackground = FALSE);
1229
1230 int GetImageCount();
1231 bool Remove(int index);
1232 bool RemoveAll();
f6bcfd97 1233 void GetSize(int index, int& OUTPUT, int& OUTPUT);
af309447
RD
1234};
1235
b639c3c5 1236
9416aa89
RD
1237//---------------------------------------------------------------------------
1238// Regions, etc.
1239
1240enum wxRegionContain {
1241 wxOutRegion, wxPartRegion, wxInRegion
1242};
1243
1244
1245class wxRegion : public wxGDIObject {
1246public:
1247 wxRegion(long x=0, long y=0, long width=0, long height=0);
1248 ~wxRegion();
1249
1250 void Clear();
23bed520
RD
1251 bool Offset(wxCoord x, wxCoord y);
1252
9416aa89
RD
1253 wxRegionContain Contains(long x, long y);
1254 %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
1255 %name(ContainsRect)wxRegionContain Contains(const wxRect& rect);
1256 %name(ContainsRectDim)wxRegionContain Contains(long x, long y, long w, long h);
1257
1258 wxRect GetBox();
1259
1260 bool Intersect(long x, long y, long width, long height);
1261 %name(IntersectRect)bool Intersect(const wxRect& rect);
1262 %name(IntersectRegion)bool Intersect(const wxRegion& region);
1263
1264 bool IsEmpty();
1265
1266 bool Union(long x, long y, long width, long height);
1267 %name(UnionRect)bool Union(const wxRect& rect);
1268 %name(UnionRegion)bool Union(const wxRegion& region);
1269
1270 bool Subtract(long x, long y, long width, long height);
1271 %name(SubtractRect)bool Subtract(const wxRect& rect);
1272 %name(SubtractRegion)bool Subtract(const wxRegion& region);
1273
1274 bool Xor(long x, long y, long width, long height);
1275 %name(XorRect)bool Xor(const wxRect& rect);
1276 %name(XorRegion)bool Xor(const wxRegion& region);
1277};
1278
1279
1280
1281class wxRegionIterator : public wxObject {
1282public:
1283 wxRegionIterator(const wxRegion& region);
1284 ~wxRegionIterator();
1285
1286 long GetX();
1287 long GetY();
1288 long GetW();
1289 long GetWidth();
1290 long GetH();
1291 long GetHeight();
1292 wxRect GetRect();
1293 bool HaveRects();
1294 void Reset();
1295
1296 %addmethods {
1297 void Next() {
1298 (*self) ++;
1299 }
1300 };
1301};
1302
1303
7bf85405
RD
1304//---------------------------------------------------------------------------
1305
c5943253
RD
1306%readonly
1307%{
1308#if 0
1309%}
1310
1311extern wxFont *wxNORMAL_FONT;
1312extern wxFont *wxSMALL_FONT;
1313extern wxFont *wxITALIC_FONT;
1314extern wxFont *wxSWISS_FONT;
1315
1316extern wxPen *wxRED_PEN;
1317extern wxPen *wxCYAN_PEN;
1318extern wxPen *wxGREEN_PEN;
1319extern wxPen *wxBLACK_PEN;
1320extern wxPen *wxWHITE_PEN;
1321extern wxPen *wxTRANSPARENT_PEN;
1322extern wxPen *wxBLACK_DASHED_PEN;
1323extern wxPen *wxGREY_PEN;
1324extern wxPen *wxMEDIUM_GREY_PEN;
1325extern wxPen *wxLIGHT_GREY_PEN;
1326
1327extern wxBrush *wxBLUE_BRUSH;
1328extern wxBrush *wxGREEN_BRUSH;
1329extern wxBrush *wxWHITE_BRUSH;
1330extern wxBrush *wxBLACK_BRUSH;
1331extern wxBrush *wxTRANSPARENT_BRUSH;
1332extern wxBrush *wxCYAN_BRUSH;
1333extern wxBrush *wxRED_BRUSH;
1334extern wxBrush *wxGREY_BRUSH;
1335extern wxBrush *wxMEDIUM_GREY_BRUSH;
1336extern wxBrush *wxLIGHT_GREY_BRUSH;
1337
1338extern wxColour *wxBLACK;
1339extern wxColour *wxWHITE;
1340extern wxColour *wxRED;
1341extern wxColour *wxBLUE;
1342extern wxColour *wxGREEN;
1343extern wxColour *wxCYAN;
1344extern wxColour *wxLIGHT_GREY;
1345
1346extern wxCursor *wxSTANDARD_CURSOR;
1347extern wxCursor *wxHOURGLASS_CURSOR;
1348extern wxCursor *wxCROSS_CURSOR;
1349
1350
1351extern wxBitmap wxNullBitmap;
1352extern wxIcon wxNullIcon;
1353extern wxCursor wxNullCursor;
1354extern wxPen wxNullPen;
1355extern wxBrush wxNullBrush;
1356extern wxPalette wxNullPalette;
1357extern wxFont wxNullFont;
1358extern wxColour wxNullColour;
1359
1360
1361extern wxFontList* wxTheFontList;
1362extern wxPenList* wxThePenList;
1363extern wxBrushList* wxTheBrushList;
1364extern wxColourDatabase* wxTheColourDatabase;
1365
1366
1367%readwrite
1368%{
1369#endif
1370%}
1371
1372//---------------------------------------------------------------------------
1373//---------------------------------------------------------------------------
1374