1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface file for wxDC, wxBrush, wxPen, etc.
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
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>
27 //----------------------------------------------------------------------
30 %include my_typemaps.i
32 // Import some definitions of other classes, etc.
38 //---------------------------------------------------------------------------
40 // Put some wx default wxChar* values into wxStrings.
41 static const wxString wxPyEmptyString(wxT(""));
43 //---------------------------------------------------------------------------
45 class wxGDIObject : public wxObject {
51 void SetVisible( bool visible );
57 //---------------------------------------------------------------------------
59 class wxBitmap : public wxGDIObject
62 wxBitmap(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY);
65 wxPalette* GetPalette();
67 bool LoadFile(const wxString& name, wxBitmapType type=wxBITMAP_TYPE_ANY);
68 bool SaveFile(const wxString& name, wxBitmapType type, wxPalette* palette = NULL);
69 void SetMask(wxMask* mask);
71 void SetPalette(wxPalette& palette);
77 void SetHandle(long handle);
84 void SetHeight(int h);
87 void SetSize(const wxSize& size);
90 wxBitmap GetSubBitmap( const wxRect& rect );
91 bool CopyFromIcon(const wxIcon& icon);
93 bool CopyFromCursor(const wxCursor& cursor);
95 void SetQuality(int q);
98 %pragma(python) addtoclass = "
99 def __del__(self,gdic=gdic):
101 if self.thisown == 1 :
102 gdic.delete_wxBitmap(self)
109 // Declarations of some alternate "constructors"
110 %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1);
111 %new wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings);
112 %new wxBitmap* wxBitmapFromIcon(const wxIcon& icon);
113 %new wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 );
116 // %new wxBitmap* wxBitmapFromData(PyObject* data, long type,
117 // int width, int height, int depth = 1);
122 %{ // Implementations of some alternate "constructors"
124 wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) {
125 return new wxBitmap(width, height, depth);
128 static char** ConvertListOfStrings(PyObject* listOfStrings) {
129 char** cArray = NULL;
132 if (!PyList_Check(listOfStrings)) {
133 PyErr_SetString(PyExc_TypeError, "Expected a list of strings.");
136 count = PyList_Size(listOfStrings);
137 cArray = new char*[count];
139 for(int x=0; x<count; x++) {
140 // TODO: Need some validation and error checking here
141 cArray[x] = PyString_AsString(PyList_GET_ITEM(listOfStrings, x));
147 wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings) {
148 char** cArray = NULL;
151 cArray = ConvertListOfStrings(listOfStrings);
154 bmp = new wxBitmap(cArray);
160 wxBitmap* wxBitmapFromIcon(const wxIcon& icon) {
161 return new wxBitmap(icon);
165 wxBitmap* wxBitmapFromBits(PyObject* bits, int width, int height, int depth = 1 ) {
168 PyString_AsStringAndSize(bits, &buf, &length);
169 return new wxBitmap(buf, width, height, depth);
174 // wxBitmap* wxBitmapFromData(PyObject* data, long type,
175 // int width, int height, int depth = 1) {
176 // if (! PyString_Check(data)) {
177 // PyErr_SetString(PyExc_TypeError, "Expected string object");
180 // return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth);
185 //---------------------------------------------------------------------------
187 class wxMask : public wxObject {
189 wxMask(const wxBitmap& bitmap);
192 %addmethods { void Destroy() { delete self; } }
195 %new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour);
197 wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour) {
198 return new wxMask(bitmap, colour);
203 //---------------------------------------------------------------------------
206 class wxIcon : public wxGDIObject
209 wxIcon(const wxString& name, long flags,
210 int desiredWidth = -1, int desiredHeight = -1);
214 bool LoadFile(const wxString& name, long flags);
217 // wxGDIImage methods
220 void SetHandle(long handle);
226 void SetWidth(int w);
227 void SetHeight(int h);
228 void SetDepth(int d);
230 void SetSize(const wxSize& size);
232 void CopyFromBitmap(const wxBitmap& bmp);
234 %pragma(python) addtoclass = "
235 def __del__(self,gdic=gdic):
237 if self.thisown == 1 :
238 gdic.delete_wxIcon(self)
245 // Declarations of some alternate "constructors"
246 %new wxIcon* wxEmptyIcon();
247 %new wxIcon* wxIconFromXPMData(PyObject* listOfStrings);
248 %new wxIcon* wxIconFromBitmap(const wxBitmap& bmp);
250 %{ // Implementations of some alternate "constructors"
251 wxIcon* wxEmptyIcon() {
255 wxIcon* wxIconFromXPMData(PyObject* listOfStrings) {
256 char** cArray = NULL;
259 cArray = ConvertListOfStrings(listOfStrings);
262 icon = new wxIcon(cArray);
267 wxIcon* wxIconFromBitmap(const wxBitmap& bmp) {
268 wxIcon* icon = new wxIcon();
269 icon->CopyFromBitmap(bmp);
274 //---------------------------------------------------------------------------
279 // default constructor
282 // initializes the bundle with the icon(s) found in the file
283 %name(wxIconBundleFromFile) wxIconBundle( const wxString& file, long type );
285 // initializes the bundle with a single icon
286 %name(wxIconBundleFromIcon)wxIconBundle( const wxIcon& icon );
290 // adds the icon to the collection, if the collection already
291 // contains an icon with the same width and height, it is
293 void AddIcon( const wxIcon& icon );
295 // adds all the icons contained in the file to the collection,
296 // if the collection already contains icons with the same
297 // width and height, they are replaced
298 %name(AddIconFromFile)void AddIcon( const wxString& file, long type );
300 // returns the icon with the given size; if no such icon exists,
301 // returns the icon with size wxSYS_ICON_[XY]; if no such icon exists,
302 // returns the first icon in the bundle
303 const wxIcon& GetIcon( const wxSize& size ) const;
306 //---------------------------------------------------------------------------
308 class wxCursor : public wxGDIObject
312 wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0);
316 // wxGDIImage methods
319 void SetHandle(long handle);
326 void SetWidth(int w);
327 void SetHeight(int h);
328 void SetDepth(int d);
329 void SetSize(const wxSize& size);
333 %name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id);
334 %{ // Alternate 'constructor'
335 wxCursor* wxPyStockCursor(int id) {
336 return new wxCursor(id);
340 //----------------------------------------------------------------------
342 class wxColour : public wxObject {
344 wxColour(unsigned char red=0, unsigned char green=0, unsigned char blue=0);
347 unsigned char Green();
348 unsigned char Blue();
350 void Set(unsigned char red, unsigned char green, unsigned char blue);
353 PyObject* rv = PyTuple_New(3);
354 PyTuple_SetItem(rv, 0, PyInt_FromLong(self->Red()));
355 PyTuple_SetItem(rv, 1, PyInt_FromLong(self->Green()));
356 PyTuple_SetItem(rv, 2, PyInt_FromLong(self->Blue()));
360 %pragma(python) addtoclass = "asTuple = Get"
361 %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())"
362 %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())"
366 %new wxColour* wxNamedColour(const wxString& colorName);
368 %{ // Alternate 'constructor'
369 wxColour* wxNamedColour(const wxString& colorName) {
370 return new wxColour(colorName);
376 class wxColourDatabase : public wxObject {
379 wxColour *FindColour(const wxString& colour);
380 wxString FindName(const wxColour& colour) const;
383 void Append(const wxString& name, int red, int green, int blue) {
384 // first see if the name is already there
385 wxString cName = name;
387 wxString cName2 = cName;
388 if ( !cName2.Replace(wxT("GRAY"), wxT("GREY")) )
391 wxNode *node = self->First();
393 const wxChar *key = node->GetKeyString();
394 if ( cName == key || cName2 == key ) {
395 wxColour* c = (wxColour *)node->Data();
396 c->Set(red, green, blue);
402 // otherwise append the new colour
403 self->Append(name.c_str(), new wxColour(red, green, blue));
409 //----------------------------------------------------------------------
411 class wxPen : public wxGDIObject {
413 wxPen(wxColour& colour, int width=1, int style=wxSOLID);
417 wxColour GetColour();
423 void SetCap(int cap_style);
424 void SetColour(wxColour& colour);
425 void SetJoin(int join_style);
426 void SetStyle(int style);
427 void SetWidth(int width);
430 void SetDashes(int LCOUNT, wxDash* choices);
431 //int GetDashes(wxDash **dashes);
433 PyObject* GetDashes() {
435 int count = self->GetDashes(&dashes);
436 wxPyBeginBlockThreads();
437 PyObject* retval = PyList_New(0);
438 for (int x=0; x<count; x++)
439 PyList_Append(retval, PyInt_FromLong(dashes[x]));
440 wxPyEndBlockThreads();
446 wxBitmap* GetStipple();
447 void SetStipple(wxBitmap& stipple);
454 // The list of ints for the dashes needs to exist for the life of the pen
455 // so we make it part of the class to save it. wxPyPen is aliased to wxPen
459 class wxPyPen : public wxPen {
461 wxPyPen(wxColour& colour, int width=1, int style=wxSOLID)
462 : wxPen(colour, width, style)
469 void SetDashes(int nb_dashes, const wxDash *dash) {
472 m_dash = new wxDash[nb_dashes];
473 for (int i=0; i<nb_dashes; i++) {
476 wxPen::SetDashes(nb_dashes, m_dash);
485 class wxPyPen : public wxPen {
487 wxPyPen(wxColour& colour, int width=1, int style=wxSOLID);
490 void SetDashes(int LCOUNT, wxDash* choices);
496 class wxPenList : public wxObject {
499 void AddPen(wxPen* pen);
500 wxPen* FindOrCreatePen(const wxColour& colour, int width, int style);
501 void RemovePen(wxPen* pen);
508 //----------------------------------------------------------------------
510 class wxBrush : public wxGDIObject {
512 wxBrush(const wxColour& colour, int style=wxSOLID);
515 wxColour GetColour();
516 wxBitmap * GetStipple();
519 void SetColour(wxColour &colour);
520 void SetStipple(wxBitmap& bitmap);
521 void SetStyle(int style);
525 class wxBrushList : public wxObject {
528 void AddBrush(wxBrush *brush);
529 wxBrush * FindOrCreateBrush(const wxColour& colour, int style);
530 void RemoveBrush(wxBrush *brush);
535 //----------------------------------------------------------------------
539 class wxDC : public wxObject {
541 // wxDC(); **** abstract base class, can't instantiate.
546 bool Blit(long xdest, long ydest,
547 long width, long height,
548 wxDC *source, long xsrc, long ysrc,
549 int logicalFunc = wxCOPY, int useMask = FALSE);
550 // bool Blit(const wxPoint& destPt, const wxSize& sz,
551 // wxDC *source, const wxPoint& srcPt,
552 // int logicalFunc = wxCOPY, int useMask = FALSE);
555 void CrossHair(long x, long y);
556 void DestroyClippingRegion();
557 long DeviceToLogicalX(long x);
558 long DeviceToLogicalXRel(long x);
559 long DeviceToLogicalY(long y);
560 long DeviceToLogicalYRel(long y);
561 void DrawArc(long x1, long y1, long x2, long y2, long xc, long yc);
562 void DrawCircle(long x, long y, long radius);
563 void DrawEllipse(long x, long y, long width, long height);
564 void DrawEllipticArc(long x, long y, long width, long height, long start, long end);
565 void DrawIcon(const wxIcon& icon, long x, long y);
567 void DrawLabel(const wxString& text, const wxRect& rect,
568 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
569 int indexAccel = -1);
572 wxRect DrawImageLabel(const wxString& text,
573 const wxBitmap& image,
575 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
576 int indexAccel = -1) {
578 self->DrawLabel(text, image, rect, alignment, indexAccel, &rv);
583 void DrawLine(long x1, long y1, long x2, long y2);
584 void DrawLines(int PCOUNT, wxPoint* points, long xoffset=0, long yoffset=0);
585 void DrawPolygon(int PCOUNT, wxPoint* points, long xoffset=0, long yoffset=0,
586 int fill_style=wxODDEVEN_RULE);
587 void DrawPoint(long x, long y);
588 void DrawRectangle(long x, long y, long width, long height);
589 %name(DrawRectangleRect)void DrawRectangle(const wxRect& rect);
590 void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
591 void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20);
592 void DrawSpline(int PCOUNT, wxPoint* points);
593 void DrawText(const wxString& text, long x, long y);
597 bool FloodFill(long x, long y, const wxColour& colour, int style=wxFLOOD_SURFACE);
598 wxBrush GetBackground();
600 long GetCharHeight();
602 void GetClippingBox(long *OUTPUT, long *OUTPUT,
603 long *OUTPUT, long *OUTPUT);
605 int GetLogicalFunction();
606 void GetLogicalScale(double *OUTPUT, double *OUTPUT);
608 bool GetOptimization();
611 %new wxColour* GetPixel(long x, long y) {
612 wxColour* wc = new wxColour();
613 self->GetPixel(x, y, wc);
617 %name(GetSizeTuple)void GetSize(int* OUTPUT, int* OUTPUT);
620 wxColour GetTextBackground();
621 void GetTextExtent(const wxString& string, long *OUTPUT, long *OUTPUT);
622 %name(GetFullTextExtent)void GetTextExtent(const wxString& string,
623 long *OUTPUT, long *OUTPUT, long *OUTPUT, long* OUTPUT,
624 const wxFont* font = NULL);
625 wxColour GetTextForeground();
626 void GetUserScale(double *OUTPUT, double *OUTPUT);
627 long LogicalToDeviceX(long x);
628 long LogicalToDeviceXRel(long x);
629 long LogicalToDeviceY(long y);
630 long LogicalToDeviceYRel(long y);
636 void SetDeviceOrigin(long x, long y);
637 void SetBackground(const wxBrush& brush);
638 void SetBackgroundMode(int mode);
639 void SetClippingRegion(long x, long y, long width, long height);
640 %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region);
641 %name(SetClippingRect) void SetClippingRegion(const wxRect& rect);
642 void SetPalette(const wxPalette& colourMap);
643 void SetBrush(const wxBrush& brush);
644 void SetFont(const wxFont& font);
645 void SetLogicalFunction(int function);
646 void SetLogicalScale(double x, double y);
647 void SetMapMode(int mode);
648 void SetOptimization(bool optimize);
649 void SetPen(const wxPen& pen);
650 void SetTextBackground(const wxColour& colour);
651 void SetTextForeground(const wxColour& colour);
652 void SetUserScale(double x_scale, double y_scale);
653 bool StartDoc(const wxString& message);
658 void DrawBitmap(const wxBitmap& bitmap, long x, long y,
659 int useMask = FALSE);
661 bool CanDrawBitmap();
662 bool CanGetTextExtent();
666 void GetLogicalOrigin(int *OUTPUT, int *OUTPUT);
667 void SetLogicalOrigin(int x, int y);
668 void GetDeviceOrigin(int *OUTPUT, int *OUTPUT);
669 void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
671 void CalcBoundingBox(int x, int y);
672 void ResetBoundingBox();
675 void GetBoundingBox(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT);
676 // See below for implementation
685 // NOTE: These methods are VERY SIMILAR in implentation. It would be
686 // nice to factor out common code and or turn them into a set of
687 // template-like macros.
689 // Draw a point for every set of coordinants in pyPoints, optionally
690 // setting a new pen for each
691 PyObject* _DrawPointList(PyObject* pyPoints, PyObject* pyPens) {
692 wxPyBeginBlockThreads();
694 bool isFastSeq = PyList_Check(pyPoints) || PyTuple_Check(pyPoints);
695 bool isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
704 if (!PySequence_Check(pyPoints)) {
707 if (!PySequence_Check(pyPens)) {
710 numObjs = PySequence_Length(pyPoints);
711 numPens = PySequence_Length(pyPens);
713 for (i = 0; i < numObjs; i++) {
717 obj = PySequence_Fast_GET_ITEM(pyPens, i);
720 obj = PySequence_GetItem(pyPens, i);
722 if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) {
733 // Get the point coordinants
735 obj = PySequence_Fast_GET_ITEM(pyPoints, i);
738 obj = PySequence_GetItem(pyPoints, i);
740 if (! _2int_seq_helper(obj, &x1, &y1)) {
745 if (PyErr_Occurred()) {
753 // Now draw the point
754 self->DrawPoint(x1, y1);
765 PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
769 PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x,y) sequences.");
774 wxPyEndBlockThreads();
779 // Draw a line for every set of coordinants in pyLines, optionally
780 // setting a new pen for each
781 PyObject* _DrawLineList(PyObject* pyLines, PyObject* pyPens) {
782 wxPyBeginBlockThreads();
784 bool isFastSeq = PyList_Check(pyLines) || PyTuple_Check(pyLines);
785 bool isFastPens = PyList_Check(pyPens) || PyTuple_Check(pyPens);
794 if (!PySequence_Check(pyLines)) {
797 if (!PySequence_Check(pyPens)) {
800 numObjs = PySequence_Length(pyLines);
801 numPens = PySequence_Length(pyPens);
803 for (i = 0; i < numObjs; i++) {
807 obj = PySequence_Fast_GET_ITEM(pyPens, i);
810 obj = PySequence_GetItem(pyPens, i);
812 if (SWIG_GetPtrObj(obj, (void **) &pen, "_wxPen_p")) {
823 // Get the line coordinants
825 obj = PySequence_Fast_GET_ITEM(pyLines, i);
828 obj = PySequence_GetItem(pyLines, i);
830 if (! _4int_seq_helper(obj, &x1, &y1, &x2, &y2)) {
835 if (PyErr_Occurred()) {
843 self->DrawLine(x1, y1, x2, y2);
854 PyErr_SetString(PyExc_TypeError, "Expected a sequence of wxPens");
859 PyErr_SetString(PyExc_TypeError, "Expected a sequence of (x1,y1, x2,y2) sequences.");
864 wxPyEndBlockThreads();
870 %pragma(python) addtoclass = "
871 def DrawPointList(self, points, pens=None):
874 elif isinstance(pens, wxPenPtr):
876 elif len(pens) != len(points):
877 raise ValueError('points and pens must have same length')
878 return self._DrawPointList(points, pens)
880 def DrawLineList(self, lines, pens=None):
883 elif isinstance(pens, wxPenPtr):
885 elif len(pens) != len(lines):
886 raise ValueError('lines and pens must have same length')
887 return self._DrawLineList(lines, pens)
896 static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) {
904 //----------------------------------------------------------------------
906 class wxMemoryDC : public wxDC {
910 void SelectObject(const wxBitmap& bitmap);
913 %new wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC);
914 %{ // Alternate 'constructor'
915 wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC) {
916 return new wxMemoryDC(oldDC);
921 //---------------------------------------------------------------------------
923 class wxBufferedDC : public wxMemoryDC {
925 // Construct a wxBufferedDC using a user supplied buffer.
926 wxBufferedDC( wxDC *dc, const wxBitmap &buffer );
928 // Construct a wxBufferedDC with an internal buffer of 'area'
929 // (where area is usually something like the size of the window
931 %name(wxBufferedDCInternalBuffer)wxBufferedDC( wxDC *dc, const wxSize &area );
933 // Blits the buffer to the dc, and detaches the dc from
934 // the buffer. Usually called in the dtor or by the dtor
935 // of derived classes if the BufferedDC must blit before
936 // the derived class (which may own the dc it's blitting
941 %pragma(python) addtomethod =
942 "__init__:self._dc = _args[0] # save a ref so the other dc won't be deleted before self"
943 %pragma(python) addtomethod =
944 "wxBufferedDCInternalBuffer:val._dc = _args[0] # save a ref so the other dc won't be deleted before self"
948 class wxBufferedPaintDC : public wxBufferedDC
951 wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap );
954 //---------------------------------------------------------------------------
956 class wxScreenDC : public wxDC {
960 %name(StartDrawingOnTopWin) bool StartDrawingOnTop(wxWindow* window);
961 bool StartDrawingOnTop(wxRect* rect = NULL);
962 bool EndDrawingOnTop();
965 //---------------------------------------------------------------------------
967 class wxClientDC : public wxDC {
969 wxClientDC(wxWindow* win);
972 //---------------------------------------------------------------------------
974 class wxPaintDC : public wxDC {
976 wxPaintDC(wxWindow* win);
979 //---------------------------------------------------------------------------
981 class wxWindowDC : public wxDC {
983 wxWindowDC(wxWindow* win);
986 //---------------------------------------------------------------------------
992 #include <wx/metafile.h>
995 class wxMetaFile : public wxObject {
997 wxMetaFile(const wxString& filename = wxPyEmptyString);
1001 bool SetClipboard(int width = 0, int height = 0);
1007 const wxString& GetFileName() const { return m_filename; }
1011 // bool wxMakeMetaFilePlaceable(const wxString& filename,
1012 // int minX, int minY, int maxX, int maxY, float scale=1.0);
1015 class wxMetaFileDC : public wxDC {
1017 wxMetaFileDC(const wxString& filename = wxPyEmptyString,
1018 int width = 0, int height = 0,
1019 const wxString& description = wxPyEmptyString);
1020 wxMetaFile* Close();
1025 //---------------------------------------------------------------------------
1027 class wxPalette : public wxGDIObject {
1029 wxPalette(int LCOUNT, byte* choices, byte* choices, byte* choices);
1032 int GetPixel(byte red, byte green, byte blue);
1033 bool GetRGB(int pixel, byte* OUTPUT, byte* OUTPUT, byte* OUTPUT);
1037 //---------------------------------------------------------------------------
1040 wxIMAGELIST_DRAW_NORMAL ,
1041 wxIMAGELIST_DRAW_TRANSPARENT,
1042 wxIMAGELIST_DRAW_SELECTED,
1043 wxIMAGELIST_DRAW_FOCUSED,
1044 wxIMAGE_LIST_NORMAL,
1049 class wxImageList : public wxObject {
1051 wxImageList(int width, int height, int mask=TRUE, int initialCount=1);
1054 int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
1055 %name(AddWithColourMask)int Add(const wxBitmap& bitmap, const wxColour& maskColour);
1056 %name(AddIcon)int Add(const wxIcon& icon);
1058 bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
1060 // %name(ReplaceIcon)bool Replace(int index, const wxIcon& icon);
1061 // int Add(const wxBitmap& bitmap);
1062 bool Replace(int index, const wxBitmap& bitmap);
1065 bool Draw(int index, wxDC& dc, int x, int x, int flags = wxIMAGELIST_DRAW_NORMAL,
1066 const bool solidBackground = FALSE);
1068 int GetImageCount();
1069 bool Remove(int index);
1071 void GetSize(int index, int& OUTPUT, int& OUTPUT);
1075 //---------------------------------------------------------------------------
1078 enum wxRegionContain {
1079 wxOutRegion, wxPartRegion, wxInRegion
1083 class wxRegion : public wxGDIObject {
1085 wxRegion(long x=0, long y=0, long width=0, long height=0);
1087 %name(wxRegionFromPoints)wxRegion(int PCOUNT, wxPoint* points, int fillStyle = wxWINDING_RULE);
1093 bool Offset(wxCoord x, wxCoord y);
1096 wxRegionContain Contains(long x, long y);
1097 %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
1098 %name(ContainsRect)wxRegionContain Contains(const wxRect& rect);
1099 %name(ContainsRectDim)wxRegionContain Contains(long x, long y, long w, long h);
1103 bool Intersect(long x, long y, long width, long height);
1104 %name(IntersectRect)bool Intersect(const wxRect& rect);
1105 %name(IntersectRegion)bool Intersect(const wxRegion& region);
1109 bool Union(long x, long y, long width, long height);
1110 %name(UnionRect)bool Union(const wxRect& rect);
1111 %name(UnionRegion)bool Union(const wxRegion& region);
1113 bool Subtract(long x, long y, long width, long height);
1114 %name(SubtractRect)bool Subtract(const wxRect& rect);
1115 %name(SubtractRegion)bool Subtract(const wxRegion& region);
1117 bool Xor(long x, long y, long width, long height);
1118 %name(XorRect)bool Xor(const wxRect& rect);
1119 %name(XorRegion)bool Xor(const wxRegion& region);
1124 class wxRegionIterator : public wxObject {
1126 wxRegionIterator(const wxRegion& region);
1127 ~wxRegionIterator();
1147 //---------------------------------------------------------------------------
1154 extern wxFont *wxNORMAL_FONT;
1155 extern wxFont *wxSMALL_FONT;
1156 extern wxFont *wxITALIC_FONT;
1157 extern wxFont *wxSWISS_FONT;
1159 extern wxPen *wxRED_PEN;
1160 extern wxPen *wxCYAN_PEN;
1161 extern wxPen *wxGREEN_PEN;
1162 extern wxPen *wxBLACK_PEN;
1163 extern wxPen *wxWHITE_PEN;
1164 extern wxPen *wxTRANSPARENT_PEN;
1165 extern wxPen *wxBLACK_DASHED_PEN;
1166 extern wxPen *wxGREY_PEN;
1167 extern wxPen *wxMEDIUM_GREY_PEN;
1168 extern wxPen *wxLIGHT_GREY_PEN;
1170 extern wxBrush *wxBLUE_BRUSH;
1171 extern wxBrush *wxGREEN_BRUSH;
1172 extern wxBrush *wxWHITE_BRUSH;
1173 extern wxBrush *wxBLACK_BRUSH;
1174 extern wxBrush *wxTRANSPARENT_BRUSH;
1175 extern wxBrush *wxCYAN_BRUSH;
1176 extern wxBrush *wxRED_BRUSH;
1177 extern wxBrush *wxGREY_BRUSH;
1178 extern wxBrush *wxMEDIUM_GREY_BRUSH;
1179 extern wxBrush *wxLIGHT_GREY_BRUSH;
1181 extern wxColour *wxBLACK;
1182 extern wxColour *wxWHITE;
1183 extern wxColour *wxRED;
1184 extern wxColour *wxBLUE;
1185 extern wxColour *wxGREEN;
1186 extern wxColour *wxCYAN;
1187 extern wxColour *wxLIGHT_GREY;
1189 extern wxCursor *wxSTANDARD_CURSOR;
1190 extern wxCursor *wxHOURGLASS_CURSOR;
1191 extern wxCursor *wxCROSS_CURSOR;
1194 extern wxBitmap wxNullBitmap;
1195 extern wxIcon wxNullIcon;
1196 extern wxCursor wxNullCursor;
1197 extern wxPen wxNullPen;
1198 extern wxBrush wxNullBrush;
1199 extern wxPalette wxNullPalette;
1200 extern wxFont wxNullFont;
1201 extern wxColour wxNullColour;
1204 extern wxFontList* wxTheFontList;
1205 extern wxPenList* wxThePenList;
1206 extern wxBrushList* wxTheBrushList;
1207 extern wxColourDatabase* wxTheColourDatabase;
1215 //---------------------------------------------------------------------------
1216 //---------------------------------------------------------------------------