]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gdi.i
fixed clipping of items with icons text in report mode
[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"
7bf85405 18#include <wx/metafile.h>
af309447 19#include <wx/imaglist.h>
105e45b9 20#ifndef __WXMSW__
08127323 21#include <wx/dcps.h>
105e45b9 22#endif
7bf85405
RD
23%}
24
25//----------------------------------------------------------------------
26
27%include typemaps.i
28%include my_typemaps.i
29
30// Import some definitions of other classes, etc.
31%import _defs.i
32%import misc.i
33
b68dc582
RD
34%{
35 static wxString wxPyEmptyStr("");
36%}
37
7bf85405
RD
38//---------------------------------------------------------------------------
39
9416aa89
RD
40class wxGDIObject : public wxObject {
41public:
42 wxGDIObject();
43 ~wxGDIObject();
44
45 bool GetVisible();
46 void SetVisible( bool visible );
47
48 bool IsNull();
49
50};
6999b0d8
RD
51
52//---------------------------------------------------------------------------
53
9416aa89 54class wxBitmap : public wxGDIObject
5bff6bb8 55{
7bf85405 56public:
0a651eb8 57 wxBitmap(const wxString& name, wxBitmapType type);
7bf85405
RD
58 ~wxBitmap();
59
7bf85405
RD
60 wxPalette* GetPalette();
61 wxMask* GetMask();
7bf85405 62 bool LoadFile(const wxString& name, long flags);
7bf85405 63 bool SaveFile(const wxString& name, int type, wxPalette* palette = NULL);
7bf85405 64 void SetMask(wxMask* mask);
fb5e0af0 65#ifdef __WXMSW__
b8b8dda7 66 void SetPalette(wxPalette& palette);
fb5e0af0 67#endif
5bff6bb8
RD
68
69 // wxGDIImage methods
70#ifdef __WXMSW__
71 long GetHandle();
72 void SetHandle(long handle);
73#endif
74 bool Ok();
75 int GetWidth();
76 int GetHeight();
77 int GetDepth();
78 void SetWidth(int w);
79 void SetHeight(int h);
80 void SetDepth(int d);
81#ifdef __WXMSW__
82 void SetSize(const wxSize& size);
83#endif
f6bcfd97
BP
84
85 wxBitmap GetSubBitmap( const wxRect& rect );
86#ifdef __WXMSW__
87 bool CopyFromIcon(const wxIcon& icon);
88 bool CopyFromCursor(const wxCursor& cursor);
89 int GetQuality();
90 void SetQuality(int q);
91#endif
92
93 %pragma(python) addtoclass = "
94 def __del__(self,gdic=gdic):
95 try:
96 if self.thisown == 1 :
97 gdic.delete_wxBitmap(self)
98 except:
99 pass
100"
7bf85405
RD
101};
102
5bff6bb8 103
96bfd053 104// Declarations of some alternate "constructors"
7bf85405 105%new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1);
96bfd053
RD
106%new wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings);
107%new wxBitmap* wxBitmapFromIcon(const wxIcon& icon);
d56cebe7 108%new wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 );
9c039d08 109
d56cebe7
RD
110// #ifdef __WXMSW__
111// %new wxBitmap* wxBitmapFromData(PyObject* data, long type,
112// int width, int height, int depth = 1);
113// #endif
8bf5d46e 114
96bfd053
RD
115
116
117%{ // Implementations of some alternate "constructors"
118
7bf85405
RD
119 wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1) {
120 return new wxBitmap(width, height, depth);
121 }
122
96bfd053
RD
123 static char** ConvertListOfStrings(PyObject* listOfStrings) {
124 char** cArray = NULL;
125 int count;
126
127 if (!PyList_Check(listOfStrings)) {
128 PyErr_SetString(PyExc_TypeError, "Expected a list of strings.");
129 return NULL;
130 }
131 count = PyList_Size(listOfStrings);
132 cArray = new char*[count];
133
134 for(int x=0; x<count; x++) {
135 // TODO: Need some validation and error checking here
136 cArray[x] = PyString_AsString(PyList_GET_ITEM(listOfStrings, x));
137 }
138 return cArray;
139 }
140
d56cebe7 141
96bfd053
RD
142 wxBitmap* wxBitmapFromXPMData(PyObject* listOfStrings) {
143 char** cArray = NULL;
144 wxBitmap* bmp;
145
146 cArray = ConvertListOfStrings(listOfStrings);
147 if (! cArray)
148 return NULL;
149 bmp = new wxBitmap(cArray);
150 delete [] cArray;
151 return bmp;
152 }
153
154
155 wxBitmap* wxBitmapFromIcon(const wxIcon& icon) {
156 return new wxBitmap(icon);
157 }
158
159
d56cebe7
RD
160 wxBitmap* wxBitmapFromBits(char* bits, int width, int height, int depth = 1 ) {
161 return new wxBitmap(bits, width, height, depth);
162 }
926bb76c 163
4c9993c3 164
d56cebe7
RD
165// #ifdef __WXMSW__
166// wxBitmap* wxBitmapFromData(PyObject* data, long type,
167// int width, int height, int depth = 1) {
168// if (! PyString_Check(data)) {
169// PyErr_SetString(PyExc_TypeError, "Expected string object");
170// return NULL;
171// }
172// return new wxBitmap((void*)PyString_AsString(data), type, width, height, depth);
173// }
174// #endif
7bf85405
RD
175%}
176
177//---------------------------------------------------------------------------
178
9416aa89 179class wxMask : public wxObject {
7bf85405
RD
180public:
181 wxMask(const wxBitmap& bitmap);
eb715945 182 //~wxMask();
96bfd053
RD
183
184 %addmethods { void Destroy() { delete self; } }
7bf85405
RD
185};
186
187%new wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour);
188%{
189 wxMask* wxMaskColour(const wxBitmap& bitmap, const wxColour& colour) {
190 return new wxMask(bitmap, colour);
191 }
192%}
193
194
195//---------------------------------------------------------------------------
196
197
9416aa89 198class wxIcon : public wxGDIObject
5bff6bb8 199{
7bf85405 200public:
fb5e0af0
RD
201 wxIcon(const wxString& name, long flags,
202 int desiredWidth = -1, int desiredHeight = -1);
7bf85405
RD
203 ~wxIcon();
204
7bf85405 205 bool LoadFile(const wxString& name, long flags);
5bff6bb8
RD
206
207 // wxGDIImage methods
208#ifdef __WXMSW__
209 long GetHandle();
210 void SetHandle(long handle);
211#endif
212 bool Ok();
213 int GetWidth();
214 int GetHeight();
215 int GetDepth();
216 void SetWidth(int w);
217 void SetHeight(int h);
218 void SetDepth(int d);
219#ifdef __WXMSW__
220 void SetSize(const wxSize& size);
221#endif
96bfd053
RD
222 void CopyFromBitmap(const wxBitmap& bmp);
223
f6bcfd97
BP
224 %pragma(python) addtoclass = "
225 def __del__(self,gdic=gdic):
226 try:
227 if self.thisown == 1 :
228 gdic.delete_wxIcon(self)
229 except:
230 pass
231"
7bf85405
RD
232};
233
8bf5d46e 234
96bfd053
RD
235// Declarations of some alternate "constructors"
236%new wxIcon* wxEmptyIcon();
237%new wxIcon* wxIconFromXPMData(PyObject* listOfStrings);
238
239%{ // Implementations of some alternate "constructors"
240 wxIcon* wxEmptyIcon() {
241 return new wxIcon();
242 }
243
244 wxIcon* wxIconFromXPMData(PyObject* listOfStrings) {
245 char** cArray = NULL;
246 wxIcon* icon;
247
248 cArray = ConvertListOfStrings(listOfStrings);
249 if (! cArray)
250 return NULL;
251 icon = new wxIcon(cArray);
252 delete [] cArray;
253 return icon;
254 }
255%}
256
7bf85405
RD
257//---------------------------------------------------------------------------
258
9416aa89 259class wxCursor : public wxGDIObject
5bff6bb8 260{
7bf85405 261public:
fb5e0af0 262#ifdef __WXMSW__
7bf85405 263 wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0);
fb5e0af0 264#endif
7bf85405 265 ~wxCursor();
5bff6bb8
RD
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
7bf85405
RD
282};
283
9c039d08 284%name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id);
7bf85405 285%{ // Alternate 'constructor'
9c039d08 286 wxCursor* wxPyStockCursor(int id) {
7bf85405
RD
287 return new wxCursor(id);
288 }
289%}
290
291//----------------------------------------------------------------------
292
f0261a72
RD
293
294enum 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
0569df0f 338
9416aa89 339class wxFont : public wxGDIObject {
7bf85405 340public:
0569df0f
RD
341 wxFont( int pointSize, int family, int style, int weight,
342 int underline=FALSE, char* faceName = "",
343 wxFontEncoding encoding=wxFONTENCODING_DEFAULT);
344 ~wxFont();
7bf85405 345
694759cf 346 bool Ok();
7bf85405
RD
347 wxString GetFaceName();
348 int GetFamily();
08127323 349#ifdef __WXMSW__
7bf85405 350 int GetFontId();
08127323 351#endif
7bf85405
RD
352 int GetPointSize();
353 int GetStyle();
354 bool GetUnderlined();
355 int GetWeight();
f0261a72 356 wxFontEncoding GetEncoding();
7bf85405
RD
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);
f0261a72
RD
363 void SetEncoding(wxFontEncoding encoding);
364 wxString GetFamilyString();
365 wxString GetStyleString();
366 wxString GetWeightString();
7bf85405
RD
367};
368
f0261a72
RD
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
0569df0f 379
9416aa89 380class wxFontList : public wxObject {
0569df0f
RD
381public:
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
7bf85405
RD
391//----------------------------------------------------------------------
392
9416aa89 393class wxColour : public wxObject {
7bf85405
RD
394public:
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 }
9b3d3bc4
RD
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
7bf85405
RD
415};
416
417%new wxColour* wxNamedColour(const wxString& colorName);
de20db99 418
7bf85405
RD
419%{ // Alternate 'constructor'
420 wxColour* wxNamedColour(const wxString& colorName) {
421 return new wxColour(colorName);
422 }
423%}
424
425
7bf85405 426
9416aa89 427class wxColourDatabase : public wxObject {
7bf85405 428public:
0569df0f
RD
429
430 wxColour *FindColour(const wxString& colour);
431 wxString FindName(const wxColour& colour) const;
432
7bf85405 433 %addmethods {
0569df0f
RD
434 void Append(const wxString& name, int red, int green, int blue) {
435 self->Append(name.c_str(), new wxColour(red, green, blue));
7bf85405 436 }
7bf85405 437 }
0569df0f
RD
438};
439
440
441//----------------------------------------------------------------------
442
443
9416aa89 444class wxPen : public wxGDIObject {
0569df0f
RD
445public:
446 wxPen(wxColour& colour, int width=1, int style=wxSOLID);
447 ~wxPen();
7bf85405
RD
448
449 int GetCap();
25832b3f 450 wxColour GetColour();
7bf85405 451
fb5e0af0 452 int GetJoin();
7bf85405
RD
453 int GetStyle();
454 int GetWidth();
455 bool Ok();
456 void SetCap(int cap_style);
457 void SetColour(wxColour& colour);
aeeb6a44
RR
458 void SetJoin(int join_style);
459 void SetStyle(int style);
460 void SetWidth(int width);
08127323 461
aeeb6a44
RR
462 // **** This one needs to return a list of ints (wxDash)
463 int GetDashes(wxDash **dashes);
eec92d76 464 void SetDashes(int LCOUNT, wxDash* choices);
6999b0d8
RD
465
466#ifdef __WXMSW__
467 wxBitmap* GetStipple();
b8b8dda7 468 void SetStipple(wxBitmap& stipple);
fb5e0af0 469#endif
7bf85405
RD
470};
471
0569df0f 472
9416aa89 473class wxPenList : public wxObject {
0569df0f
RD
474public:
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
7bf85405
RD
483//----------------------------------------------------------------------
484
9416aa89 485class wxBrush : public wxGDIObject {
7bf85405 486public:
0569df0f
RD
487 wxBrush(const wxColour& colour, int style=wxSOLID);
488 ~wxBrush();
26b9cf27 489
25832b3f 490 wxColour GetColour();
7bf85405
RD
491 wxBitmap * GetStipple();
492 int GetStyle();
493 bool Ok();
494 void SetColour(wxColour &colour);
b8b8dda7 495 void SetStipple(wxBitmap& bitmap);
7bf85405
RD
496 void SetStyle(int style);
497};
498
0569df0f
RD
499
500class wxBrushList {
501public:
502
503 void AddBrush(wxBrush *brush);
504 wxBrush * FindOrCreateBrush(const wxColour& colour, int style);
505 void RemoveBrush(wxBrush *brush);
506};
507
7bf85405
RD
508//----------------------------------------------------------------------
509
510
511
9416aa89 512class wxDC : public wxObject {
7bf85405 513public:
fb5e0af0 514// wxDC(); **** abstract base class, can't instantiate.
7bf85405
RD
515 ~wxDC();
516
517 void BeginDrawing();
efc5f224
RD
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
7bf85405
RD
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);
bb0054cd 535 void DrawCircle(long x, long y, long radius);
7bf85405
RD
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);
eec92d76
RD
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,
7bf85405
RD
542 int fill_style=wxODDEVEN_RULE);
543 void DrawPoint(long x, long y);
544 void DrawRectangle(long x, long y, long width, long height);
6999b0d8 545 void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
7bf85405 546 void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20);
eec92d76 547 void DrawSpline(int PCOUNT, wxPoint* points);
7bf85405
RD
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);
b8b8dda7
RD
553 wxBrush& GetBackground();
554 wxBrush& GetBrush();
7bf85405
RD
555 long GetCharHeight();
556 long GetCharWidth();
557 void GetClippingBox(long *OUTPUT, long *OUTPUT,
558 long *OUTPUT, long *OUTPUT);
b8b8dda7 559 wxFont& GetFont();
7bf85405 560 int GetLogicalFunction();
eec92d76 561 void GetLogicalScale(double *OUTPUT, double *OUTPUT);
7bf85405
RD
562 int GetMapMode();
563 bool GetOptimization();
b8b8dda7 564 wxPen& GetPen();
fb5e0af0
RD
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 }
bb0054cd
RD
572 %name(GetSizeTuple)void GetSize(int* OUTPUT, int* OUTPUT);
573 wxSize GetSize();
eec92d76 574 wxSize GetSizeMM();
25832b3f 575 wxColour GetTextBackground();
af309447
RD
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);
25832b3f 580 wxColour GetTextForeground();
eec92d76 581 void GetUserScale(double *OUTPUT, double *OUTPUT);
7bf85405
RD
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);
eec92d76 599 void SetLogicalScale(double x, double y);
7bf85405
RD
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
efc5f224
RD
610
611 void DrawBitmap(const wxBitmap& bitmap, long x, long y,
612 int useMask = FALSE);
613
eec92d76
RD
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);
eec92d76
RD
622 void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
623
f6bcfd97
BP
624 void CalcBoundingBox(int x, int y);
625 void ResetBoundingBox();
c7e7022c
RD
626
627#ifdef __WXMSW__
628 long GetHDC();
629#endif
7bf85405
RD
630};
631
632
633//----------------------------------------------------------------------
634
635class wxMemoryDC : public wxDC {
636public:
637 wxMemoryDC();
638
639 void SelectObject(const wxBitmap& bitmap);
640}
641
642%new wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC);
643%{ // Alternate 'constructor'
644 wxMemoryDC* wxMemoryDCFromDC(wxDC* oldDC) {
645 return new wxMemoryDC(oldDC);
646 }
647%}
648
649
650//---------------------------------------------------------------------------
651
652class wxScreenDC : public wxDC {
653public:
654 wxScreenDC();
655
26b9cf27
RD
656 %name(StartDrawingOnTopWin) bool StartDrawingOnTop(wxWindow* window);
657 bool StartDrawingOnTop(wxRect* rect = NULL);
7bf85405
RD
658 bool EndDrawingOnTop();
659};
660
661//---------------------------------------------------------------------------
662
663class wxClientDC : public wxDC {
664public:
665 wxClientDC(wxWindow* win);
666};
667
668//---------------------------------------------------------------------------
669
670class wxPaintDC : public wxDC {
671public:
672 wxPaintDC(wxWindow* win);
673};
674
675//---------------------------------------------------------------------------
676
b639c3c5
RD
677class wxWindowDC : public wxDC {
678public:
679 wxWindowDC(wxWindow* win);
680};
b639c3c5
RD
681
682//---------------------------------------------------------------------------
683
be4d9c1f 684#ifndef __WXMSW__
7bf85405
RD
685class wxPostScriptDC : public wxDC {
686public:
687 wxPostScriptDC(const wxString& output, bool interactive = TRUE, wxWindow* win = NULL);
688};
be4d9c1f 689#endif
7bf85405
RD
690
691//---------------------------------------------------------------------------
692
7bf85405 693
fb5e0af0 694#ifdef __WXMSW__
7bf85405
RD
695class wxMetaFileDC : public wxDC {
696public:
697 wxMetaFileDC(const wxString& filename = wxPyEmptyStr);
698 wxMetaFile* Close();
699};
fb5e0af0 700#endif
7bf85405
RD
701
702//---------------------------------------------------------------------------
703//---------------------------------------------------------------------------
704
705
706%readonly
af309447
RD
707%{
708#if 0
709%}
7bf85405
RD
710extern wxFont *wxNORMAL_FONT;
711extern wxFont *wxSMALL_FONT;
712extern wxFont *wxITALIC_FONT;
713extern wxFont *wxSWISS_FONT;
7bf85405 714
1afc06c2 715extern wxPen *wxRED_PEN;
7bf85405
RD
716extern wxPen *wxCYAN_PEN;
717extern wxPen *wxGREEN_PEN;
718extern wxPen *wxBLACK_PEN;
719extern wxPen *wxWHITE_PEN;
720extern wxPen *wxTRANSPARENT_PEN;
721extern wxPen *wxBLACK_DASHED_PEN;
722extern wxPen *wxGREY_PEN;
723extern wxPen *wxMEDIUM_GREY_PEN;
724extern wxPen *wxLIGHT_GREY_PEN;
725
726extern wxBrush *wxBLUE_BRUSH;
727extern wxBrush *wxGREEN_BRUSH;
728extern wxBrush *wxWHITE_BRUSH;
729extern wxBrush *wxBLACK_BRUSH;
730extern wxBrush *wxTRANSPARENT_BRUSH;
731extern wxBrush *wxCYAN_BRUSH;
732extern wxBrush *wxRED_BRUSH;
733extern wxBrush *wxGREY_BRUSH;
734extern wxBrush *wxMEDIUM_GREY_BRUSH;
735extern wxBrush *wxLIGHT_GREY_BRUSH;
736
737extern wxColour *wxBLACK;
738extern wxColour *wxWHITE;
739extern wxColour *wxRED;
740extern wxColour *wxBLUE;
741extern wxColour *wxGREEN;
742extern wxColour *wxCYAN;
743extern wxColour *wxLIGHT_GREY;
744
745extern wxCursor *wxSTANDARD_CURSOR;
746extern wxCursor *wxHOURGLASS_CURSOR;
747extern wxCursor *wxCROSS_CURSOR;
748
749extern wxBitmap wxNullBitmap;
750extern wxIcon wxNullIcon;
751extern wxCursor wxNullCursor;
752extern wxPen wxNullPen;
753extern wxBrush wxNullBrush;
754extern wxPalette wxNullPalette;
755extern wxFont wxNullFont;
756extern wxColour wxNullColour;
757
0569df0f
RD
758
759extern wxFontList* wxTheFontList;
760extern wxPenList* wxThePenList;
761extern wxBrushlist* wxTheBrushList;
762extern wxColourDatabase* wxTheColourDatabase;
763
764
af309447
RD
765%readwrite
766%{
767#endif
768%}
769
b639c3c5
RD
770//---------------------------------------------------------------------------
771
9416aa89 772class wxPalette : public wxGDIObject {
b639c3c5 773public:
eec92d76 774 wxPalette(int LCOUNT, byte* choices, byte* choices, byte* choices);
b639c3c5
RD
775 ~wxPalette();
776
777 int GetPixel(byte red, byte green, byte blue);
778 bool GetRGB(int pixel, byte* OUTPUT, byte* OUTPUT, byte* OUTPUT);
779 bool Ok();
780};
781
782//---------------------------------------------------------------------------
783
af309447
RD
784enum {
785 wxIMAGELIST_DRAW_NORMAL ,
786 wxIMAGELIST_DRAW_TRANSPARENT,
787 wxIMAGELIST_DRAW_SELECTED,
788 wxIMAGELIST_DRAW_FOCUSED,
789 wxIMAGE_LIST_NORMAL,
790 wxIMAGE_LIST_SMALL,
791 wxIMAGE_LIST_STATE
792};
793
9416aa89 794class wxImageList : public wxObject {
af309447 795public:
dcd38683 796 wxImageList(int width, int height, int mask=TRUE, int initialCount=1);
af309447
RD
797 ~wxImageList();
798
799 int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
800 %name(AddWithColourMask)int Add(const wxBitmap& bitmap, const wxColour& maskColour);
801 %name(AddIcon)int Add(const wxIcon& icon);
f6bcfd97 802#ifdef __WXMSW__
b57bdb5a 803 bool Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
b57bdb5a 804#else
f6bcfd97
BP
805// %name(ReplaceIcon)bool Replace(int index, const wxIcon& icon);
806// int Add(const wxBitmap& bitmap);
b57bdb5a
RD
807 bool Replace(int index, const wxBitmap& bitmap);
808#endif
af309447
RD
809
810 bool Draw(int index, wxDC& dc, int x, int x, int flags = wxIMAGELIST_DRAW_NORMAL,
811 const bool solidBackground = FALSE);
812
813 int GetImageCount();
814 bool Remove(int index);
815 bool RemoveAll();
f6bcfd97 816 void GetSize(int index, int& OUTPUT, int& OUTPUT);
af309447
RD
817};
818
b639c3c5 819
9416aa89
RD
820//---------------------------------------------------------------------------
821// Regions, etc.
822
823enum wxRegionContain {
824 wxOutRegion, wxPartRegion, wxInRegion
825};
826
827
828class wxRegion : public wxGDIObject {
829public:
830 wxRegion(long x=0, long y=0, long width=0, long height=0);
831 ~wxRegion();
832
833 void Clear();
834 wxRegionContain Contains(long x, long y);
835 %name(ContainsPoint)wxRegionContain Contains(const wxPoint& pt);
836 %name(ContainsRect)wxRegionContain Contains(const wxRect& rect);
837 %name(ContainsRectDim)wxRegionContain Contains(long x, long y, long w, long h);
838
839 wxRect GetBox();
840
841 bool Intersect(long x, long y, long width, long height);
842 %name(IntersectRect)bool Intersect(const wxRect& rect);
843 %name(IntersectRegion)bool Intersect(const wxRegion& region);
844
845 bool IsEmpty();
846
847 bool Union(long x, long y, long width, long height);
848 %name(UnionRect)bool Union(const wxRect& rect);
849 %name(UnionRegion)bool Union(const wxRegion& region);
850
851 bool Subtract(long x, long y, long width, long height);
852 %name(SubtractRect)bool Subtract(const wxRect& rect);
853 %name(SubtractRegion)bool Subtract(const wxRegion& region);
854
855 bool Xor(long x, long y, long width, long height);
856 %name(XorRect)bool Xor(const wxRect& rect);
857 %name(XorRegion)bool Xor(const wxRegion& region);
858};
859
860
861
862class wxRegionIterator : public wxObject {
863public:
864 wxRegionIterator(const wxRegion& region);
865 ~wxRegionIterator();
866
867 long GetX();
868 long GetY();
869 long GetW();
870 long GetWidth();
871 long GetH();
872 long GetHeight();
873 wxRect GetRect();
874 bool HaveRects();
875 void Reset();
876
877 %addmethods {
878 void Next() {
879 (*self) ++;
880 }
881 };
882};
883
884
7bf85405
RD
885//---------------------------------------------------------------------------
886