]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/xrc/xrc.i
getting rid of warnings
[wxWidgets.git] / wxPython / contrib / xrc / xrc.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: xrc.i
3 // Purpose: Wrappers for the XML based Resource system
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 4-June-2001
8 // RCS-ID: $Id$
9 // Copyright: (c) 2001 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 %module xrc
14
15
16 %{
17 #include "wxPython.h"
18 #include "pyistream.h"
19 #include "wx/xrc/xml.h"
20 #include "wx/xrc/xmlres.h"
21 #include <wx/filesys.h>
22 #include <wx/fs_mem.h>
23 %}
24
25 //---------------------------------------------------------------------------
26
27 %include typemaps.i
28 %include my_typemaps.i
29
30 %extern wx.i
31 %extern windows.i
32 %extern _defs.i
33 %extern events.i
34 %extern controls.i
35
36 %extern streams.i
37
38
39 //---------------------------------------------------------------------------
40 %{
41 // Put some wx default wxChar* values into wxStrings.
42 static const wxString wxPyEmptyString(wxT(""));
43 static const wxString wxPyUTF8String(wxT("UTF-8"));
44 static const wxString wxPyStyleString(wxT("style"));
45 static const wxString wxPySizeString(wxT("size"));
46 static const wxString wxPyPosString(wxT("pos"));
47 static const wxString wxPyBitmapString(wxT("bitmap"));
48 static const wxString wxPyIconString(wxT("icon"));
49 static const wxString wxPyFontString(wxT("font"));
50 %}
51 //---------------------------------------------------------------------------
52
53 enum wxXmlResourceFlags
54 {
55 wxXRC_USE_LOCALE = 1,
56 wxXRC_NO_SUBCLASSING = 2
57 };
58
59
60 // This class holds XML resources from one or more .xml files
61 // (or derived forms, either binary or zipped -- see manual for
62 // details).
63
64 class wxXmlResource : public wxObject
65 {
66 public:
67 // Ctors.
68 // Flags: wxXRC_USE_LOCALE
69 // translatable strings will be translated via _()
70 // wxXRC_NO_SUBCLASSING
71 // subclass property of object nodes will be ignored
72 // (useful for previews in XRC editors)
73 wxXmlResource(const wxString& filemask, int flags = wxXRC_USE_LOCALE);
74 %name(wxEmptyXmlResource) wxXmlResource(int flags = wxXRC_USE_LOCALE);
75 %pragma(python) addtomethod = "__init__:self.InitAllHandlers()"
76 %pragma(python) addtomethod = "wxEmptyXmlResource:val.InitAllHandlers()"
77
78 ~wxXmlResource();
79
80
81 // Loads resources from XML files that match given filemask.
82 // This method understands VFS (see filesys.h).
83 bool Load(const wxString& filemask);
84
85 %addmethods {
86 bool LoadFromString(const wxString& data) {
87 static int s_memFileIdx = 0;
88
89 // Check for memory FS. If not present, load the handler:
90 wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"),
91 wxT("dummy data"));
92 wxFileSystem fsys;
93 wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));
94 wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));
95 if (f)
96 delete f;
97 else
98 wxFileSystem::AddHandler(new wxMemoryFSHandler);
99
100 // Now put the resource data into the memory FS
101 wxString filename(wxT("XRC_resource/data_string_"));
102 filename << s_memFileIdx;
103 s_memFileIdx += 1;
104 wxMemoryFSHandler::AddFile(filename, data);
105
106 // Load the "file" into the resource object
107 bool retval = self->Load(wxT("memory:") + filename );
108
109 return retval;
110 }
111 }
112
113 // Initialize handlers for all supported controls/windows. This will
114 // make the executable quite big because it forces linking against
115 // most of wxWin library
116 void InitAllHandlers();
117
118 // Initialize only specific handler (or custom handler). Convention says
119 // that handler name is equal to control's name plus 'XmlHandler', e.g.
120 // wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. XML resource compiler
121 // (xmlres) can create include file that contains initialization code for
122 // all controls used within the resource.
123 void AddHandler(wxPyXmlResourceHandler *handler);
124
125 // Add a new handler at the begining of the handler list
126 void InsertHandler(wxPyXmlResourceHandler *handler);
127
128 // Removes all handlers
129 void ClearHandlers();
130
131 // Loads menu from resource. Returns NULL on failure.
132 wxMenu *LoadMenu(const wxString& name);
133
134 // Loads menubar from resource. Returns NULL on failure.
135 wxMenuBar *LoadMenuBar(const wxString& name);
136 %name(LoadMenuBarOnFrame) wxMenuBar *LoadMenuBar(wxWindow *parent, const wxString& name);
137
138
139 // Loads toolbar
140 wxToolBar *LoadToolBar(wxWindow *parent, const wxString& name);
141
142 // Loads dialog. dlg points to parent window (if any). Second form
143 // is used to finish creation of already existing instance (main reason
144 // for this is that you may want to use derived class with new event table)
145 // Example (typical usage):
146 // MyDialog dlg;
147 // wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
148 // dlg->ShowModal();
149 wxDialog *LoadDialog(wxWindow *parent, const wxString& name);
150 %name(LoadOnDialog)bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name);
151
152 // Loads panel. panel points to parent window (if any). Second form
153 // is used to finish creation of already existing instance.
154 wxPanel *LoadPanel(wxWindow *parent, const wxString& name);
155 %name(LoadOnPanel)bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name);
156
157 // Load a frame's contents from a resource
158 wxFrame *LoadFrame(wxWindow* parent, const wxString& name);
159 %name(LoadOnFrame)bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name);
160
161 // Load an object from the resource specifying both the resource name and
162 // the classname. This lets you load nonstandard container windows.
163 wxObject *LoadObject(wxWindow *parent, const wxString& name,
164 const wxString& classname);
165
166 // Load an object from the resource specifying both the resource name and
167 // the classname. This form lets you finish the creation of an existing
168 // instance.
169 %name(LoadOnObject)bool LoadObject(wxObject *instance, wxWindow *parent, const wxString& name,
170 const wxString& classname);
171
172 // Loads bitmap or icon resource from file:
173 wxBitmap LoadBitmap(const wxString& name);
174 wxIcon LoadIcon(const wxString& name);
175
176 // Attaches unknown control into given panel/window/dialog:
177 // (unknown controls are used in conjunction with <object class="unknown">)
178 bool AttachUnknownControl(const wxString& name, wxWindow *control,
179 wxWindow *parent = NULL);
180
181 // Returns numeric ID that is equivalent to string id used in XML
182 // resource. To be used in event tables
183 // Macro XMLID is provided for convenience
184 static int GetXRCID(const wxString& str_id);
185
186 // Returns version info (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a)
187 long GetVersion() const;
188
189 // Compares resources version to argument. Returns -1 if resources version
190 // is less than the argument, +1 if greater and 0 if they equal.
191 int CompareVersion(int major, int minor, int release, int revision) const;
192
193
194 // Gets global resources object or create one if none exists
195 static wxXmlResource *Get();
196 // Sets global resources object and returns pointer to previous one (may be NULL).
197 static wxXmlResource *Set(wxXmlResource *res);
198
199 };
200
201 //----------------------------------------------------------------------
202
203 %pragma(python) code = "
204 def XRCID(str_id):
205 return wxXmlResource_GetXRCID(str_id)
206
207 def XRCCTRL(window, str_id, *ignoreargs):
208 return window.FindWindowById(XRCID(str_id))
209
210 XMLID = XRCID
211 XMLCTRL = XRCCTRL
212 "
213
214 //----------------------------------------------------------------------
215 //----------------------------------------------------------------------
216 // In order to provide wrappers for wxXmlResourceHandler we need to also
217 // provide the classes for representing and parsing XML.
218
219
220 // Represents XML node type.
221 enum wxXmlNodeType
222 {
223 // note: values are synchronized with xmlElementType from libxml
224 wxXML_ELEMENT_NODE,
225 wxXML_ATTRIBUTE_NODE,
226 wxXML_TEXT_NODE,
227 wxXML_CDATA_SECTION_NODE,
228 wxXML_ENTITY_REF_NODE,
229 wxXML_ENTITY_NODE,
230 wxXML_PI_NODE,
231 wxXML_COMMENT_NODE,
232 wxXML_DOCUMENT_NODE,
233 wxXML_DOCUMENT_TYPE_NODE,
234 wxXML_DOCUMENT_FRAG_NODE,
235 wxXML_NOTATION_NODE,
236 wxXML_HTML_DOCUMENT_NODE
237 };
238
239
240
241 // Represents node property(ies).
242 // Example: in <img src="hello.gif" id="3"/> "src" is property with value
243 // "hello.gif" and "id" is property with value "3".
244 class wxXmlProperty
245 {
246 public:
247 wxXmlProperty(const wxString& name = wxPyEmptyString,
248 const wxString& value = wxPyEmptyString,
249 wxXmlProperty *next = NULL);
250
251 wxString GetName() const;
252 wxString GetValue() const;
253 wxXmlProperty *GetNext() const;
254
255 void SetName(const wxString& name);
256 void SetValue(const wxString& value);
257 void SetNext(wxXmlProperty *next);
258 };
259
260
261
262
263 // Represents node in XML document. Node has name and may have content
264 // and properties. Most common node types are wxXML_TEXT_NODE (name and props
265 // are irrelevant) and wxXML_ELEMENT_NODE (e.g. in <title>hi</title> there is
266 // element with name="title", irrelevant content and one child (wxXML_TEXT_NODE
267 // with content="hi").
268 //
269 // If wxUSE_UNICODE is 0, all strings are encoded in the encoding given to Load
270 // (default is UTF-8).
271 class wxXmlNode
272 {
273 public:
274 wxXmlNode(wxXmlNode *parent = NULL,
275 wxXmlNodeType type = 0,
276 const wxString& name = wxPyEmptyString,
277 const wxString& content = wxPyEmptyString,
278 wxXmlProperty *props = NULL,
279 wxXmlNode *next = NULL);
280 ~wxXmlNode();
281
282
283 // user-friendly creation:
284 %name(wxXmlNodeEasy)wxXmlNode(wxXmlNodeType type, const wxString& name,
285 const wxString& content = wxPyEmptyString);
286
287 void AddChild(wxXmlNode *child);
288 void InsertChild(wxXmlNode *child, wxXmlNode *before_node);
289 bool RemoveChild(wxXmlNode *child);
290 void AddProperty(wxXmlProperty *prop);
291 %name(AddPropertyName)void AddProperty(const wxString& name, const wxString& value);
292 bool DeleteProperty(const wxString& name);
293
294 // access methods:
295 wxXmlNodeType GetType() const;
296 wxString GetName() const;
297 wxString GetContent() const;
298
299 wxXmlNode *GetParent() const;
300 wxXmlNode *GetNext() const;
301 wxXmlNode *GetChildren() const;
302
303 wxXmlProperty *GetProperties() const;
304 wxString GetPropVal(const wxString& propName,
305 const wxString& defaultVal) const;
306 bool HasProp(const wxString& propName) const;
307
308 void SetType(wxXmlNodeType type);
309 void SetName(const wxString& name);
310 void SetContent(const wxString& con);
311
312 void SetParent(wxXmlNode *parent);
313 void SetNext(wxXmlNode *next);
314 void SetChildren(wxXmlNode *child);
315
316 void SetProperties(wxXmlProperty *prop);
317 };
318
319
320
321 // This class holds XML data/document as parsed by XML parser.
322 class wxXmlDocument : public wxObject
323 {
324 public:
325 wxXmlDocument(const wxString& filename,
326 const wxString& encoding = wxPyUTF8String);
327 %name(wxXmlDocumentFromStream)wxXmlDocument(wxInputStream& stream,
328 const wxString& encoding = wxPyUTF8String);
329 %name(wxEmptyXmlDocument)wxXmlDocument();
330
331 ~wxXmlDocument();
332
333
334 // Parses .xml file and loads data. Returns TRUE on success, FALSE
335 // otherwise.
336 bool Load(const wxString& filename,
337 const wxString& encoding = wxPyUTF8String);
338 %name(LoadFromStream)bool Load(wxInputStream& stream,
339 const wxString& encoding = wxPyUTF8String);
340
341 // Saves document as .xml file.
342 bool Save(const wxString& filename) const;
343 %name(SaveToStream)bool Save(wxOutputStream& stream) const;
344
345 bool IsOk() const;
346
347 // Returns root node of the document.
348 wxXmlNode *GetRoot() const;
349
350 // Returns version of document (may be empty).
351 wxString GetVersion() const;
352
353 // Returns encoding of document (may be empty).
354 // Note: this is the encoding original file was saved in, *not* the
355 // encoding of in-memory representation!
356 wxString GetFileEncoding() const;
357
358 // Write-access methods:
359 void SetRoot(wxXmlNode *node);
360 void SetVersion(const wxString& version);
361 void SetFileEncoding(const wxString& encoding);
362
363 %addmethods {
364 // Returns encoding of in-memory representation of the document (same
365 // as passed to Load or ctor, defaults to UTF-8). NB: this is
366 // meaningless in Unicode build where data are stored as wchar_t*
367 wxString GetEncoding() {
368 #if wxUSE_UNICODE
369 return wxPyEmptyString;
370 #else
371 return self->GetEncoding();
372 #endif
373 }
374 }
375 };
376
377
378 //----------------------------------------------------------------------
379 // And now for wxXmlResourceHandler...
380
381
382
383 %{ // C++ version of Python aware wxXmlResourceHandler, for the pure virtual
384 // callbacks, as well as to make some protected things public so they can
385 // be wrapped.
386 class wxPyXmlResourceHandler : public wxXmlResourceHandler {
387 public:
388 wxPyXmlResourceHandler() : wxXmlResourceHandler() {}
389 //~wxPyXmlResourceHandler();
390
391 // Base class virtuals
392
393 DEC_PYCALLBACK_OBJECT__pure(DoCreateResource);
394 DEC_PYCALLBACK_BOOL_NODE_pure(CanHandle);
395
396 // wxObject* DoCreateResource() {
397 // wxObject* rv = NULL;
398 // wxPyBeginBlockThreads();
399 // if (wxPyCBH_findCallback(m_myInst, "DoCreateResource")) {
400 // PyObject* ro;
401 // ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
402 // if (ro) {
403 // SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p");
404 // Py_DECREF(ro);
405 // }
406 // }
407 // wxPyEndBlockThreads();
408 // return rv;
409 // }
410
411 // bool CanHandle(wxXmlNode* a) {
412 // bool rv=FALSE;
413 // wxPyBeginBlockThreads();
414 // if (wxPyCBH_findCallback(m_myInst, "CanHandle")) {
415 // PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0);
416 // rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
417 // Py_DECREF(obj);
418 // }
419 // wxPyEndBlockThreads();
420 // return rv;
421 // }
422
423
424
425 // accessors for protected members
426
427 wxXmlResource* GetResource() { return m_resource; }
428 wxXmlNode* GetNode() { return m_node; }
429 wxString GetClass() { return m_class; }
430 wxObject* GetParent() { return m_parent; }
431 wxObject* GetInstance() { return m_instance; }
432 wxWindow* GetParentAsWindow() { return m_parentAsWindow; }
433 wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; }
434
435
436 // turn some protected methods into public via delegation
437
438 bool IsOfClass(wxXmlNode *node, const wxString& classname)
439 { return wxXmlResourceHandler::IsOfClass(node, classname); }
440
441 wxString GetNodeContent(wxXmlNode *node)
442 { return wxXmlResourceHandler::GetNodeContent(node); }
443
444 bool HasParam(const wxString& param)
445 { return wxXmlResourceHandler::HasParam(param); }
446
447 wxXmlNode *GetParamNode(const wxString& param)
448 { return wxXmlResourceHandler::GetParamNode(param); }
449
450 wxString GetParamValue(const wxString& param)
451 { return wxXmlResourceHandler::GetParamValue(param); }
452
453 void AddStyle(const wxString& name, int value)
454 { wxXmlResourceHandler::AddStyle(name, value); }
455
456 void AddWindowStyles()
457 { wxXmlResourceHandler::AddWindowStyles(); }
458
459 int GetStyle(const wxString& param = wxT("style"), int defaults = 0)
460 { return wxXmlResourceHandler::GetStyle(param, defaults); }
461
462 wxString GetText(const wxString& param, bool translate = TRUE)
463 { return wxXmlResourceHandler::GetText(param, translate); }
464
465 int GetID()
466 { return wxXmlResourceHandler::GetID(); }
467
468 wxString GetName()
469 { return wxXmlResourceHandler::GetName(); }
470
471 bool GetBool(const wxString& param, bool defaultv = FALSE)
472 { return wxXmlResourceHandler::GetBool(param, defaultv); }
473
474 long GetLong( const wxString& param, long defaultv = 0 )
475 { return wxXmlResourceHandler::GetLong(param, defaultv); }
476
477 wxColour GetColour(const wxString& param)
478 { return wxXmlResourceHandler::GetColour(param); }
479
480 wxSize GetSize(const wxString& param = wxT("size"))
481 { return wxXmlResourceHandler::GetSize(param); }
482
483 wxPoint GetPosition(const wxString& param = wxT("pos"))
484 { return wxXmlResourceHandler::GetPosition(param); }
485
486 wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0)
487 { return wxXmlResourceHandler::GetDimension(param, defaultv); }
488
489 wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
490 const wxArtClient& defaultArtClient = wxART_OTHER,
491 wxSize size = wxDefaultSize)
492 { return wxXmlResourceHandler::GetBitmap(param, defaultArtClient, size); }
493
494 wxIcon GetIcon(const wxString& param = wxT("icon"),
495 const wxArtClient& defaultArtClient = wxART_OTHER,
496 wxSize size = wxDefaultSize)
497 { return wxXmlResourceHandler::GetIcon(param, defaultArtClient, size); }
498
499 wxFont GetFont(const wxString& param = wxT("font"))
500 { return wxXmlResourceHandler::GetFont(param); }
501
502 void SetupWindow(wxWindow *wnd)
503 { wxXmlResourceHandler::SetupWindow(wnd); }
504
505 void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE)
506 { wxXmlResourceHandler::CreateChildren(parent, this_hnd_only); }
507
508 void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL)
509 { wxXmlResourceHandler::CreateChildrenPrivately(parent, rootnode); }
510
511 wxObject *CreateResFromNode(wxXmlNode *node,
512 wxObject *parent, wxObject *instance = NULL)
513 { return wxXmlResourceHandler::CreateResFromNode(node, parent, instance); }
514
515 wxFileSystem& GetCurFileSystem()
516 { return wxXmlResourceHandler::GetCurFileSystem(); }
517
518
519 PYPRIVATE;
520 };
521
522 IMP_PYCALLBACK_OBJECT__pure(wxPyXmlResourceHandler, wxXmlResourceHandler, DoCreateResource);
523 IMP_PYCALLBACK_BOOL_NODE_pure(wxPyXmlResourceHandler, wxXmlResourceHandler, CanHandle);
524
525 %}
526
527
528 //----------------------------------------------------------------------
529 // Now the version that will be SWIGged.
530
531
532 %name(wxXmlResourceHandler) class wxPyXmlResourceHandler : public wxObject {
533 public:
534 wxPyXmlResourceHandler() : wxXmlResourceHandler() {}
535 //~wxPyXmlResourceHandler();
536
537 void _setCallbackInfo(PyObject* self, PyObject* _class);
538 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxXmlResourceHandler)"
539
540
541
542 // Creates an object (menu, dialog, control, ...) from an XML node.
543 // Should check for validity.
544 // parent is a higher-level object (usually window, dialog or panel)
545 // that is often neccessary to create the resource.
546 // If instance is non-NULL it should not create a new instance via 'new' but
547 // should rather use this one, and call its Create method.
548 wxObject *CreateResource(wxXmlNode *node, wxObject *parent,
549 wxObject *instance);
550
551 // Sets the parent resource.
552 void SetParentResource(wxXmlResource *res);
553
554
555 wxXmlResource* GetResource() { return m_resource; }
556 wxXmlNode* GetNode() { return m_node; }
557 wxString GetClass() { return m_class; }
558 wxObject* GetParent() { return m_parent; }
559 wxObject* GetInstance() { return m_instance; }
560 wxWindow* GetParentAsWindow() { return m_parentAsWindow; }
561 wxWindow* GetInstanceAsWindow() { return m_instanceAsWindow; }
562
563
564 // Returns true if the node has a property class equal to classname,
565 // e.g. <object class="wxDialog">.
566 bool IsOfClass(wxXmlNode *node, const wxString& classname);
567
568 // Gets node content from wxXML_ENTITY_NODE
569 // The problem is, <tag>content<tag> is represented as
570 // wxXML_ENTITY_NODE name="tag", content=""
571 // |-- wxXML_TEXT_NODE or
572 // wxXML_CDATA_SECTION_NODE name="" content="content"
573 wxString GetNodeContent(wxXmlNode *node);
574
575 // Check to see if a parameter exists.
576 bool HasParam(const wxString& param);
577
578 // Finds the node or returns NULL.
579 wxXmlNode *GetParamNode(const wxString& param);
580
581 // Finds the parameter value or returns the empty string.
582 wxString GetParamValue(const wxString& param);
583
584 // Add a style flag (e.g. wxMB_DOCKABLE) to the list of flags
585 // understood by this handler.
586 void AddStyle(const wxString& name, int value);
587
588 // Add styles common to all wxWindow-derived classes.
589 void AddWindowStyles();
590
591 // Gets style flags from text in form "flag | flag2| flag3 |..."
592 // Only understads flags added with AddStyle
593 int GetStyle(const wxString& param = wxPyStyleString, int defaults = 0);
594
595 // Gets text from param and does some conversions:
596 // - replaces \n, \r, \t by respective chars (according to C syntax)
597 // - replaces _ by & and __ by _ (needed for _File => &File because of XML)
598 // - calls wxGetTranslations (unless disabled in wxXmlResource)
599 wxString GetText(const wxString& param, bool translate = TRUE);
600
601 // Returns the XRCID.
602 int GetID();
603
604 // Returns the resource name.
605 wxString GetName();
606
607 // Gets a bool flag (1, t, yes, on, true are TRUE, everything else is FALSE).
608 bool GetBool(const wxString& param, bool defaultv = FALSE);
609
610 // Gets the integer value from the parameter.
611 long GetLong( const wxString& param, long defaultv = 0 );
612
613 // Gets colour in HTML syntax (#RRGGBB).
614 wxColour GetColour(const wxString& param);
615
616 // Gets the size (may be in dialog units).
617 wxSize GetSize(const wxString& param = wxPySizeString);
618
619 // Gets the position (may be in dialog units).
620 wxPoint GetPosition(const wxString& param = wxPyPosString);
621
622 // Gets a dimension (may be in dialog units).
623 wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0);
624
625 // Gets a bitmap.
626 wxBitmap GetBitmap(const wxString& param = wxPyBitmapString,
627 const wxArtClient& defaultArtClient = wxART_OTHER,
628 wxSize size = wxDefaultSize);
629
630 // Gets an icon.
631 wxIcon GetIcon(const wxString& param = wxPyIconString,
632 const wxArtClient& defaultArtClient = wxART_OTHER,
633 wxSize size = wxDefaultSize);
634
635 // Gets a font.
636 wxFont GetFont(const wxString& param = wxPyFontString);
637
638 // Sets common window options.
639 void SetupWindow(wxWindow *wnd);
640
641 // Creates children.
642 void CreateChildren(wxObject *parent, bool this_hnd_only = FALSE);
643
644 // Helper function.
645 void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL);
646
647 // Creates a resource from a node.
648 wxObject *CreateResFromNode(wxXmlNode *node,
649 wxObject *parent, wxObject *instance = NULL);
650
651 // helper
652 wxFileSystem& GetCurFileSystem();
653 };
654
655
656 //----------------------------------------------------------------------
657 //----------------------------------------------------------------------
658
659 %init %{
660
661 wxClassInfo::CleanUpClasses();
662 wxClassInfo::InitializeClasses();
663
664 wxXmlInitResourceModule();
665 wxXmlResource::Get()->InitAllHandlers();
666
667 %}
668
669 //----------------------------------------------------------------------
670 // This file gets appended to the shadow class file.
671 //----------------------------------------------------------------------
672
673 %pragma(python) include="_xrcextras.py";
674
675