1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface stuff for wxArtProvider
7 // Created: 18-June-1999
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 #include <wx/artprov.h>
23 //---------------------------------------------------------------------------
27 MAKE_CONST_WXSTRING(ART_TOOLBAR);
28 MAKE_CONST_WXSTRING(ART_MENU);
29 MAKE_CONST_WXSTRING(ART_FRAME_ICON);
30 MAKE_CONST_WXSTRING(ART_CMN_DIALOG);
31 MAKE_CONST_WXSTRING(ART_HELP_BROWSER);
32 MAKE_CONST_WXSTRING(ART_MESSAGE_BOX);
33 MAKE_CONST_WXSTRING(ART_OTHER);
36 MAKE_CONST_WXSTRING(ART_ADD_BOOKMARK);
37 MAKE_CONST_WXSTRING(ART_DEL_BOOKMARK);
38 MAKE_CONST_WXSTRING(ART_HELP_SIDE_PANEL);
39 MAKE_CONST_WXSTRING(ART_HELP_SETTINGS);
40 MAKE_CONST_WXSTRING(ART_HELP_BOOK);
41 MAKE_CONST_WXSTRING(ART_HELP_FOLDER);
42 MAKE_CONST_WXSTRING(ART_HELP_PAGE);
43 MAKE_CONST_WXSTRING(ART_GO_BACK);
44 MAKE_CONST_WXSTRING(ART_GO_FORWARD);
45 MAKE_CONST_WXSTRING(ART_GO_UP);
46 MAKE_CONST_WXSTRING(ART_GO_DOWN);
47 MAKE_CONST_WXSTRING(ART_GO_TO_PARENT);
48 MAKE_CONST_WXSTRING(ART_GO_HOME);
49 MAKE_CONST_WXSTRING(ART_FILE_OPEN);
50 MAKE_CONST_WXSTRING(ART_PRINT);
51 MAKE_CONST_WXSTRING(ART_HELP);
52 MAKE_CONST_WXSTRING(ART_TIP);
53 MAKE_CONST_WXSTRING(ART_REPORT_VIEW);
54 MAKE_CONST_WXSTRING(ART_LIST_VIEW);
55 MAKE_CONST_WXSTRING(ART_NEW_DIR);
56 MAKE_CONST_WXSTRING(ART_FOLDER);
57 MAKE_CONST_WXSTRING(ART_GO_DIR_UP);
58 MAKE_CONST_WXSTRING(ART_EXECUTABLE_FILE);
59 MAKE_CONST_WXSTRING(ART_NORMAL_FILE);
60 MAKE_CONST_WXSTRING(ART_TICK_MARK);
61 MAKE_CONST_WXSTRING(ART_CROSS_MARK);
62 MAKE_CONST_WXSTRING(ART_ERROR);
63 MAKE_CONST_WXSTRING(ART_QUESTION);
64 MAKE_CONST_WXSTRING(ART_WARNING);
65 MAKE_CONST_WXSTRING(ART_INFORMATION);
66 MAKE_CONST_WXSTRING(ART_MISSING_IMAGE);
68 //---------------------------------------------------------------------------
70 %{ // Python aware wxArtProvider
71 class wxPyArtProvider : public wxArtProvider {
74 virtual wxBitmap CreateBitmap(const wxArtID& id,
75 const wxArtClient& client,
77 wxBitmap rval = wxNullBitmap;
78 wxPyBeginBlockThreads();
79 if ((wxPyCBH_findCallback(m_myInst, "CreateBitmap"))) {
80 PyObject* so = wxPyConstructObject((void*)&size, wxT("wxSize"), 0);
85 s2 = wx2PyString(client);
86 ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(OOO)", s1, s2, so));
91 if (wxPyConvertSwigPtr(ro, (void**)&ptr, wxT("wxBitmap")))
96 wxPyEndBlockThreads();
104 // The one for SWIG to see
105 %name(ArtProvider) class wxPyArtProvider /*: public wxObject*/
109 %pythonAppend wxPyArtProvider "self._setCallbackInfo(self, ArtProvider)"
112 void _setCallbackInfo(PyObject* self, PyObject* _class);
114 DocStr(PushProvider, "Add new provider to the top of providers stack.");
115 static void PushProvider(wxPyArtProvider *provider);
117 DocStr(PopProvider, "Remove latest added provider and delete it.");
118 static bool PopProvider();
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);
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);
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);
139 %extend { void Destroy() { delete self; }}
144 //---------------------------------------------------------------------------
146 wxPyPtrTypeMap_Add("wxArtProvider", "wxPyArtProvider");
148 //---------------------------------------------------------------------------