]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/src/_artprov.i
Added a set of 2.4 compatibility classes for the wxDC classes that
[wxWidgets.git] / wxPython / src / _artprov.i
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: _artprov.i
3// Purpose: SWIG interface stuff for wxArtProvider
4//
5// Author: Robin Dunn
6//
7// Created: 18-June-1999
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#include <wx/artprov.h>
21%}
22
23//---------------------------------------------------------------------------
24
25
26// Art clients
27MAKE_CONST_WXSTRING(ART_TOOLBAR);
28MAKE_CONST_WXSTRING(ART_MENU);
29MAKE_CONST_WXSTRING(ART_FRAME_ICON);
30MAKE_CONST_WXSTRING(ART_CMN_DIALOG);
31MAKE_CONST_WXSTRING(ART_HELP_BROWSER);
32MAKE_CONST_WXSTRING(ART_MESSAGE_BOX);
33MAKE_CONST_WXSTRING(ART_OTHER);
34
35// Art IDs
36MAKE_CONST_WXSTRING(ART_ADD_BOOKMARK);
37MAKE_CONST_WXSTRING(ART_DEL_BOOKMARK);
38MAKE_CONST_WXSTRING(ART_HELP_SIDE_PANEL);
39MAKE_CONST_WXSTRING(ART_HELP_SETTINGS);
40MAKE_CONST_WXSTRING(ART_HELP_BOOK);
41MAKE_CONST_WXSTRING(ART_HELP_FOLDER);
42MAKE_CONST_WXSTRING(ART_HELP_PAGE);
43MAKE_CONST_WXSTRING(ART_GO_BACK);
44MAKE_CONST_WXSTRING(ART_GO_FORWARD);
45MAKE_CONST_WXSTRING(ART_GO_UP);
46MAKE_CONST_WXSTRING(ART_GO_DOWN);
47MAKE_CONST_WXSTRING(ART_GO_TO_PARENT);
48MAKE_CONST_WXSTRING(ART_GO_HOME);
49MAKE_CONST_WXSTRING(ART_FILE_OPEN);
50MAKE_CONST_WXSTRING(ART_PRINT);
51MAKE_CONST_WXSTRING(ART_HELP);
52MAKE_CONST_WXSTRING(ART_TIP);
53MAKE_CONST_WXSTRING(ART_REPORT_VIEW);
54MAKE_CONST_WXSTRING(ART_LIST_VIEW);
55MAKE_CONST_WXSTRING(ART_NEW_DIR);
56MAKE_CONST_WXSTRING(ART_FOLDER);
57MAKE_CONST_WXSTRING(ART_GO_DIR_UP);
58MAKE_CONST_WXSTRING(ART_EXECUTABLE_FILE);
59MAKE_CONST_WXSTRING(ART_NORMAL_FILE);
60MAKE_CONST_WXSTRING(ART_TICK_MARK);
61MAKE_CONST_WXSTRING(ART_CROSS_MARK);
62MAKE_CONST_WXSTRING(ART_ERROR);
63MAKE_CONST_WXSTRING(ART_QUESTION);
64MAKE_CONST_WXSTRING(ART_WARNING);
65MAKE_CONST_WXSTRING(ART_INFORMATION);
66MAKE_CONST_WXSTRING(ART_MISSING_IMAGE);
67
68//---------------------------------------------------------------------------
69
70%{ // Python aware wxArtProvider
71class wxPyArtProvider : public wxArtProvider {
72public:
73
74 virtual wxBitmap CreateBitmap(const wxArtID& id,
75 const wxArtClient& client,
76 const wxSize& size) {
77 wxBitmap rval = wxNullBitmap;
78 wxPyBeginBlockThreads();
79 if ((wxPyCBH_findCallback(m_myInst, "CreateBitmap"))) {
80 PyObject* so = wxPyConstructObject((void*)&size, wxT("wxSize"), 0);
81 PyObject* ro;
82 wxBitmap* ptr;
83 PyObject* s1, *s2;
84 s1 = wx2PyString(id);
85 s2 = wx2PyString(client);
86 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OOO)", s1, s2, so));
87 Py_DECREF(so);
88 Py_DECREF(s1);
89 Py_DECREF(s2);
90 if (ro) {
91 if (wxPyConvertSwigPtr(ro, (void**)&ptr, wxT("wxBitmap")))
92 rval = *ptr;
93 Py_DECREF(ro);
94 }
95 }
96 wxPyEndBlockThreads();
97 return rval;
98 }
99
100 PYPRIVATE;
101};
102%}
103
104// The one for SWIG to see
105%name(ArtProvider) class wxPyArtProvider /*: public wxObject*/
106{
107public:
108
109 %addtofunc wxPyArtProvider "self._setCallbackInfo(self, ArtProvider)"
110 wxPyArtProvider();
111
112 void _setCallbackInfo(PyObject* self, PyObject* _class);
113
114 DocStr(PushProvider, "Add new provider to the top of providers stack.");
115 static void PushProvider(wxPyArtProvider *provider);
116
117 DocStr(PopProvider, "Remove latest added provider and delete it.");
118 static bool PopProvider();
119
120 DocStr(RemoveProvider,
121 "Remove provider. The provider must have been added previously!\n"
122 "The provider is _not_ deleted.");
123 static bool RemoveProvider(wxPyArtProvider *provider);
124
125 DocStr(GetBitmap,
126 "Query the providers for bitmap with given ID and return it. Return\n"
127 "wx.NullBitmap if no provider provides it.");
128 static wxBitmap GetBitmap(const wxString& id,
129 const wxString& client = wxPyART_OTHER,
130 const wxSize& size = wxDefaultSize);
131
132 DocStr(GetIcon,
133 "Query the providers for icon with given ID and return it. Return\n"
134 "wx.NullIcon if no provider provides it.");
135 static wxIcon GetIcon(const wxString& id,
136 const wxString& client = wxPyART_OTHER,
137 const wxSize& size = wxDefaultSize);
138
139 %extend { void Destroy() { delete self; }}
140};
141
142
143
144//---------------------------------------------------------------------------
145%init %{
146 wxPyPtrTypeMap_Add("wxArtProvider", "wxPyArtProvider");
147%}
148//---------------------------------------------------------------------------