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