]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_stockobjs.i
Tweaks for demos on MacOSX
[wxWidgets.git] / wxPython / src / _stockobjs.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _stockobjs.i
3 // Purpose: SWIG interface defining "stock" GDI objects
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 13-Sept-2003
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17 %newgroup
18
19
20 // See also wxPy_ReinitStockObjects in helpers.cpp
21 %immutable;
22 %threadWrapperOff;
23
24 wxFont* const wxNORMAL_FONT;
25 wxFont* const wxSMALL_FONT;
26 wxFont* const wxITALIC_FONT;
27 wxFont* const wxSWISS_FONT;
28
29 wxPen* const wxRED_PEN;
30 wxPen* const wxCYAN_PEN;
31 wxPen* const wxGREEN_PEN;
32 wxPen* const wxBLACK_PEN;
33 wxPen* const wxWHITE_PEN;
34 wxPen* const wxTRANSPARENT_PEN;
35 wxPen* const wxBLACK_DASHED_PEN;
36 wxPen* const wxGREY_PEN;
37 wxPen* const wxMEDIUM_GREY_PEN;
38 wxPen* const wxLIGHT_GREY_PEN;
39
40 wxBrush* const wxBLUE_BRUSH;
41 wxBrush* const wxGREEN_BRUSH;
42 wxBrush* const wxWHITE_BRUSH;
43 wxBrush* const wxBLACK_BRUSH;
44 wxBrush* const wxTRANSPARENT_BRUSH;
45 wxBrush* const wxCYAN_BRUSH;
46 wxBrush* const wxRED_BRUSH;
47 wxBrush* const wxGREY_BRUSH;
48 wxBrush* const wxMEDIUM_GREY_BRUSH;
49 wxBrush* const wxLIGHT_GREY_BRUSH;
50
51 wxColour* const wxBLACK;
52 wxColour* const wxWHITE;
53 wxColour* const wxRED;
54 wxColour* const wxBLUE;
55 wxColour* const wxGREEN;
56 wxColour* const wxCYAN;
57 wxColour* const wxLIGHT_GREY;
58
59 wxCursor* const wxSTANDARD_CURSOR;
60 wxCursor* const wxHOURGLASS_CURSOR;
61 wxCursor* const wxCROSS_CURSOR;
62
63
64 const wxBitmap wxNullBitmap;
65 const wxIcon wxNullIcon;
66 const wxCursor wxNullCursor;
67 const wxPen wxNullPen;
68 const wxBrush wxNullBrush;
69 const wxPalette wxNullPalette;
70 const wxFont wxNullFont;
71 const wxColour wxNullColour;
72
73 %threadWrapperOn;
74 %mutable;
75
76
77 //---------------------------------------------------------------------------
78
79 class wxPenList : public wxObject {
80 public:
81
82 void AddPen(wxPen* pen);
83 wxPen* FindOrCreatePen(const wxColour& colour, int width, int style);
84 void RemovePen(wxPen* pen);
85
86 int GetCount();
87 };
88
89
90 //---------------------------------------------------------------------------
91
92 class wxBrushList : public wxObject {
93 public:
94
95 void AddBrush(wxBrush *brush);
96 wxBrush * FindOrCreateBrush(const wxColour& colour, int style=wxSOLID);
97 void RemoveBrush(wxBrush *brush);
98
99 int GetCount();
100 };
101
102 //---------------------------------------------------------------------------
103
104 MustHaveApp(wxColourDatabase);
105
106 class wxColourDatabase : public wxObject {
107 public:
108 wxColourDatabase();
109 ~wxColourDatabase();
110
111 // find colour by name or name for the given colour
112 wxColour Find(const wxString& name) const;
113 wxString FindName(const wxColour& colour) const;
114 %pythoncode { FindColour = Find }
115
116 // add a new colour to the database
117 void AddColour(const wxString& name, const wxColour& colour);
118
119 %extend {
120 void Append(const wxString& name, int red, int green, int blue) {
121 self->AddColour(name, wxColour(red, green, blue));
122 }
123 }
124 };
125
126 //---------------------------------------------------------------------------
127
128 class wxFontList : public wxObject {
129 public:
130
131 void AddFont(wxFont* font);
132 wxFont * FindOrCreateFont(int point_size, int family, int style, int weight,
133 bool underline = false, const wxString& facename = wxPyEmptyString,
134 wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
135 void RemoveFont(wxFont *font);
136
137 int GetCount();
138 };
139
140 //---------------------------------------------------------------------------
141 %newgroup
142
143
144
145 // See also wxPy_ReinitStockObjects in helpers.cpp
146 %immutable;
147
148 wxFontList* const wxTheFontList;
149 wxPenList* const wxThePenList;
150 wxBrushList* const wxTheBrushList;
151 wxColourDatabase* const wxTheColourDatabase;
152
153 %mutable;
154
155
156 //---------------------------------------------------------------------------
157
158 %pythoncode { NullColor = NullColour }
159
160
161
162