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