]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/xrc.py
disown wxPyXmlResourceHandler
[wxWidgets.git] / wxPython / src / gtk / xrc.py
CommitLineData
0085ce49 1# This file was created automatically by SWIG 1.3.29.
2ef75293
RD
2# Don't modify this file, modify the SWIG interface instead.
3
4"""
5The `XmlResource` class allows program resources defining menus, layout of
6controls on a panel, etc. to be loaded from an XML file.
7"""
8
9import _xrc
0085ce49
RD
10import new
11new_instancemethod = new.instancemethod
093d3ff1 12def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
0085ce49 13 if (name == "thisown"): return self.this.own(value)
093d3ff1 14 if (name == "this"):
0085ce49
RD
15 if type(value).__name__ == 'PySwigObject':
16 self.__dict__[name] = value
093d3ff1
RD
17 return
18 method = class_type.__swig_setmethods__.get(name,None)
19 if method: return method(self,value)
0085ce49 20 if (not static) or hasattr(self,name):
093d3ff1
RD
21 self.__dict__[name] = value
22 else:
23 raise AttributeError("You cannot add attributes to %s" % self)
24
25def _swig_setattr(self,class_type,name,value):
26 return _swig_setattr_nondynamic(self,class_type,name,value,0)
27
28def _swig_getattr(self,class_type,name):
0085ce49 29 if (name == "thisown"): return self.this.own()
093d3ff1
RD
30 method = class_type.__swig_getmethods__.get(name,None)
31 if method: return method(self)
32 raise AttributeError,name
33
0085ce49
RD
34def _swig_repr(self):
35 try: strthis = "proxy of " + self.this.__repr__()
36 except: strthis = ""
37 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
38
093d3ff1
RD
39import types
40try:
41 _object = types.ObjectType
42 _newclass = 1
43except AttributeError:
44 class _object : pass
45 _newclass = 0
46del types
47
48
49def _swig_setattr_nondynamic_method(set):
50 def set_attr(self,name,value):
0085ce49
RD
51 if (name == "thisown"): return self.this.own(value)
52 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
53 set(self,name,value)
54 else:
55 raise AttributeError("You cannot add attributes to %s" % self)
56 return set_attr
57
58
2ef75293
RD
59import _core
60wx = _core
61__docfilter__ = wx.__DocFilter(globals())
62#---------------------------------------------------------------------------
63
64WX_XMLRES_CURRENT_VERSION_MAJOR = _xrc.WX_XMLRES_CURRENT_VERSION_MAJOR
65WX_XMLRES_CURRENT_VERSION_MINOR = _xrc.WX_XMLRES_CURRENT_VERSION_MINOR
66WX_XMLRES_CURRENT_VERSION_RELEASE = _xrc.WX_XMLRES_CURRENT_VERSION_RELEASE
67WX_XMLRES_CURRENT_VERSION_REVISION = _xrc.WX_XMLRES_CURRENT_VERSION_REVISION
68XRC_USE_LOCALE = _xrc.XRC_USE_LOCALE
69XRC_NO_SUBCLASSING = _xrc.XRC_NO_SUBCLASSING
70XRC_NO_RELOADING = _xrc.XRC_NO_RELOADING
71class XmlResource(_core.Object):
093d3ff1 72 """Proxy of C++ XmlResource class"""
0085ce49
RD
73 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
74 __repr__ = _swig_repr
75 def __init__(self, *args, **kwargs):
fc46b7f3 76 """__init__(self, String filemask, int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource"""
0085ce49 77 _xrc.XmlResource_swiginit(self,_xrc.new_XmlResource(*args, **kwargs))
2ef75293
RD
78 self.InitAllHandlers()
79
0085ce49
RD
80 __swig_destroy__ = _xrc.delete_XmlResource
81 __del__ = lambda self : None;
2ef75293
RD
82 def Load(*args, **kwargs):
83 """Load(self, String filemask) -> bool"""
84 return _xrc.XmlResource_Load(*args, **kwargs)
85
86 def LoadFromString(*args, **kwargs):
87 """LoadFromString(self, String data) -> bool"""
88 return _xrc.XmlResource_LoadFromString(*args, **kwargs)
89
943e8dfd
RD
90 def Unload(*args, **kwargs):
91 """Unload(self, String filename) -> bool"""
92 return _xrc.XmlResource_Unload(*args, **kwargs)
93
2ef75293
RD
94 def InitAllHandlers(*args, **kwargs):
95 """InitAllHandlers(self)"""
96 return _xrc.XmlResource_InitAllHandlers(*args, **kwargs)
97
98 def AddHandler(*args, **kwargs):
99 """AddHandler(self, XmlResourceHandler handler)"""
100 return _xrc.XmlResource_AddHandler(*args, **kwargs)
101
102 def InsertHandler(*args, **kwargs):
103 """InsertHandler(self, XmlResourceHandler handler)"""
104 return _xrc.XmlResource_InsertHandler(*args, **kwargs)
105
106 def ClearHandlers(*args, **kwargs):
107 """ClearHandlers(self)"""
108 return _xrc.XmlResource_ClearHandlers(*args, **kwargs)
109
110 def AddSubclassFactory(*args, **kwargs):
111 """AddSubclassFactory(XmlSubclassFactory factory)"""
112 return _xrc.XmlResource_AddSubclassFactory(*args, **kwargs)
113
114 AddSubclassFactory = staticmethod(AddSubclassFactory)
115 def LoadMenu(*args, **kwargs):
116 """LoadMenu(self, String name) -> Menu"""
117 return _xrc.XmlResource_LoadMenu(*args, **kwargs)
118
119 def LoadMenuBar(*args, **kwargs):
120 """LoadMenuBar(self, String name) -> MenuBar"""
121 return _xrc.XmlResource_LoadMenuBar(*args, **kwargs)
122
123 def LoadMenuBarOnFrame(*args, **kwargs):
124 """LoadMenuBarOnFrame(self, Window parent, String name) -> MenuBar"""
125 return _xrc.XmlResource_LoadMenuBarOnFrame(*args, **kwargs)
126
127 def LoadToolBar(*args, **kwargs):
128 """LoadToolBar(self, Window parent, String name) -> wxToolBar"""
129 return _xrc.XmlResource_LoadToolBar(*args, **kwargs)
130
131 def LoadDialog(*args, **kwargs):
132 """LoadDialog(self, Window parent, String name) -> wxDialog"""
133 return _xrc.XmlResource_LoadDialog(*args, **kwargs)
134
135 def LoadOnDialog(*args, **kwargs):
136 """LoadOnDialog(self, wxDialog dlg, Window parent, String name) -> bool"""
137 return _xrc.XmlResource_LoadOnDialog(*args, **kwargs)
138
139 def LoadPanel(*args, **kwargs):
140 """LoadPanel(self, Window parent, String name) -> wxPanel"""
141 return _xrc.XmlResource_LoadPanel(*args, **kwargs)
142
143 def LoadOnPanel(*args, **kwargs):
144 """LoadOnPanel(self, wxPanel panel, Window parent, String name) -> bool"""
145 return _xrc.XmlResource_LoadOnPanel(*args, **kwargs)
146
147 def LoadFrame(*args, **kwargs):
148 """LoadFrame(self, Window parent, String name) -> wxFrame"""
149 return _xrc.XmlResource_LoadFrame(*args, **kwargs)
150
151 def LoadOnFrame(*args, **kwargs):
152 """LoadOnFrame(self, wxFrame frame, Window parent, String name) -> bool"""
153 return _xrc.XmlResource_LoadOnFrame(*args, **kwargs)
154
155 def LoadObject(*args, **kwargs):
156 """LoadObject(self, Window parent, String name, String classname) -> Object"""
157 return _xrc.XmlResource_LoadObject(*args, **kwargs)
158
159 def LoadOnObject(*args, **kwargs):
160 """LoadOnObject(self, Object instance, Window parent, String name, String classname) -> bool"""
161 return _xrc.XmlResource_LoadOnObject(*args, **kwargs)
162
163 def LoadBitmap(*args, **kwargs):
164 """LoadBitmap(self, String name) -> Bitmap"""
165 return _xrc.XmlResource_LoadBitmap(*args, **kwargs)
166
167 def LoadIcon(*args, **kwargs):
168 """LoadIcon(self, String name) -> Icon"""
169 return _xrc.XmlResource_LoadIcon(*args, **kwargs)
170
171 def AttachUnknownControl(*args, **kwargs):
172 """AttachUnknownControl(self, String name, Window control, Window parent=None) -> bool"""
173 return _xrc.XmlResource_AttachUnknownControl(*args, **kwargs)
174
175 def GetXRCID(*args, **kwargs):
2131d850 176 """GetXRCID(String str_id, int value_if_not_found=ID_NONE) -> int"""
2ef75293
RD
177 return _xrc.XmlResource_GetXRCID(*args, **kwargs)
178
179 GetXRCID = staticmethod(GetXRCID)
180 def GetVersion(*args, **kwargs):
181 """GetVersion(self) -> long"""
182 return _xrc.XmlResource_GetVersion(*args, **kwargs)
183
184 def CompareVersion(*args, **kwargs):
185 """CompareVersion(self, int major, int minor, int release, int revision) -> int"""
186 return _xrc.XmlResource_CompareVersion(*args, **kwargs)
187
188 def Get(*args, **kwargs):
189 """Get() -> XmlResource"""
190 return _xrc.XmlResource_Get(*args, **kwargs)
191
192 Get = staticmethod(Get)
193 def Set(*args, **kwargs):
194 """Set(XmlResource res) -> XmlResource"""
195 return _xrc.XmlResource_Set(*args, **kwargs)
196
197 Set = staticmethod(Set)
198 def GetFlags(*args, **kwargs):
199 """GetFlags(self) -> int"""
200 return _xrc.XmlResource_GetFlags(*args, **kwargs)
201
202 def SetFlags(*args, **kwargs):
203 """SetFlags(self, int flags)"""
204 return _xrc.XmlResource_SetFlags(*args, **kwargs)
205
fc46b7f3
RD
206 def GetDomain(*args, **kwargs):
207 """GetDomain(self) -> String"""
208 return _xrc.XmlResource_GetDomain(*args, **kwargs)
209
210 def SetDomain(*args, **kwargs):
211 """SetDomain(self, String domain)"""
212 return _xrc.XmlResource_SetDomain(*args, **kwargs)
213
2131d850 214_xrc.XmlResource_swigregister(XmlResource)
2ef75293
RD
215cvar = _xrc.cvar
216UTF8String = cvar.UTF8String
217StyleString = cvar.StyleString
218SizeString = cvar.SizeString
219PosString = cvar.PosString
220BitmapString = cvar.BitmapString
221IconString = cvar.IconString
222FontString = cvar.FontString
223
224def EmptyXmlResource(*args, **kwargs):
fc46b7f3 225 """EmptyXmlResource(int flags=XRC_USE_LOCALE, String domain=wxEmptyString) -> XmlResource"""
2ef75293 226 val = _xrc.new_EmptyXmlResource(*args, **kwargs)
2ef75293
RD
227 val.InitAllHandlers()
228 return val
229
230def XmlResource_AddSubclassFactory(*args, **kwargs):
0085ce49
RD
231 """XmlResource_AddSubclassFactory(XmlSubclassFactory factory)"""
232 return _xrc.XmlResource_AddSubclassFactory(*args, **kwargs)
2ef75293
RD
233
234def XmlResource_GetXRCID(*args, **kwargs):
2131d850 235 """XmlResource_GetXRCID(String str_id, int value_if_not_found=ID_NONE) -> int"""
0085ce49 236 return _xrc.XmlResource_GetXRCID(*args, **kwargs)
2ef75293 237
0085ce49
RD
238def XmlResource_Get(*args):
239 """XmlResource_Get() -> XmlResource"""
240 return _xrc.XmlResource_Get(*args)
2ef75293
RD
241
242def XmlResource_Set(*args, **kwargs):
0085ce49
RD
243 """XmlResource_Set(XmlResource res) -> XmlResource"""
244 return _xrc.XmlResource_Set(*args, **kwargs)
2ef75293 245
01f6b6d3
RD
246def XRCID(str_id, value_if_not_found = wx.ID_NONE):
247 return XmlResource_GetXRCID(str_id, value_if_not_found)
2ef75293
RD
248
249def XRCCTRL(window, str_id, *ignoreargs):
250 return window.FindWindowById(XRCID(str_id))
251
252#---------------------------------------------------------------------------
253
254class XmlSubclassFactory(object):
093d3ff1 255 """Proxy of C++ XmlSubclassFactory class"""
0085ce49
RD
256 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
257 __repr__ = _swig_repr
258 def __init__(self, *args, **kwargs):
2ef75293 259 """__init__(self) -> XmlSubclassFactory"""
0085ce49 260 _xrc.XmlSubclassFactory_swiginit(self,_xrc.new_XmlSubclassFactory(*args, **kwargs))
2ef75293
RD
261 self._setCallbackInfo(self, XmlSubclassFactory)
262
263 def _setCallbackInfo(*args, **kwargs):
264 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
265 return _xrc.XmlSubclassFactory__setCallbackInfo(*args, **kwargs)
266
2131d850 267_xrc.XmlSubclassFactory_swigregister(XmlSubclassFactory)
2ef75293
RD
268
269#---------------------------------------------------------------------------
270
271XML_ELEMENT_NODE = _xrc.XML_ELEMENT_NODE
272XML_ATTRIBUTE_NODE = _xrc.XML_ATTRIBUTE_NODE
273XML_TEXT_NODE = _xrc.XML_TEXT_NODE
274XML_CDATA_SECTION_NODE = _xrc.XML_CDATA_SECTION_NODE
275XML_ENTITY_REF_NODE = _xrc.XML_ENTITY_REF_NODE
276XML_ENTITY_NODE = _xrc.XML_ENTITY_NODE
277XML_PI_NODE = _xrc.XML_PI_NODE
278XML_COMMENT_NODE = _xrc.XML_COMMENT_NODE
279XML_DOCUMENT_NODE = _xrc.XML_DOCUMENT_NODE
280XML_DOCUMENT_TYPE_NODE = _xrc.XML_DOCUMENT_TYPE_NODE
281XML_DOCUMENT_FRAG_NODE = _xrc.XML_DOCUMENT_FRAG_NODE
282XML_NOTATION_NODE = _xrc.XML_NOTATION_NODE
283XML_HTML_DOCUMENT_NODE = _xrc.XML_HTML_DOCUMENT_NODE
284class XmlProperty(object):
093d3ff1 285 """Proxy of C++ XmlProperty class"""
0085ce49
RD
286 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
287 __repr__ = _swig_repr
288 def __init__(self, *args, **kwargs):
2ef75293
RD
289 """
290 __init__(self, String name=EmptyString, String value=EmptyString,
291 XmlProperty next=None) -> XmlProperty
292 """
0085ce49 293 _xrc.XmlProperty_swiginit(self,_xrc.new_XmlProperty(*args, **kwargs))
2ef75293
RD
294 def GetName(*args, **kwargs):
295 """GetName(self) -> String"""
296 return _xrc.XmlProperty_GetName(*args, **kwargs)
297
298 def GetValue(*args, **kwargs):
299 """GetValue(self) -> String"""
300 return _xrc.XmlProperty_GetValue(*args, **kwargs)
301
302 def GetNext(*args, **kwargs):
303 """GetNext(self) -> XmlProperty"""
304 return _xrc.XmlProperty_GetNext(*args, **kwargs)
305
306 def SetName(*args, **kwargs):
307 """SetName(self, String name)"""
308 return _xrc.XmlProperty_SetName(*args, **kwargs)
309
310 def SetValue(*args, **kwargs):
311 """SetValue(self, String value)"""
312 return _xrc.XmlProperty_SetValue(*args, **kwargs)
313
314 def SetNext(*args, **kwargs):
315 """SetNext(self, XmlProperty next)"""
316 return _xrc.XmlProperty_SetNext(*args, **kwargs)
317
2131d850 318_xrc.XmlProperty_swigregister(XmlProperty)
2ef75293
RD
319
320class XmlNode(object):
093d3ff1 321 """Proxy of C++ XmlNode class"""
0085ce49
RD
322 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
323 __repr__ = _swig_repr
324 def __init__(self, *args, **kwargs):
2ef75293
RD
325 """
326 __init__(self, XmlNode parent=None, int type=0, String name=EmptyString,
327 String content=EmptyString, XmlProperty props=None,
328 XmlNode next=None) -> XmlNode
329 """
0085ce49
RD
330 _xrc.XmlNode_swiginit(self,_xrc.new_XmlNode(*args, **kwargs))
331 __swig_destroy__ = _xrc.delete_XmlNode
332 __del__ = lambda self : None;
2ef75293
RD
333 def AddChild(*args, **kwargs):
334 """AddChild(self, XmlNode child)"""
335 return _xrc.XmlNode_AddChild(*args, **kwargs)
336
337 def InsertChild(*args, **kwargs):
ae5bc7f3 338 """InsertChild(self, XmlNode child, XmlNode before_node) -> bool"""
2ef75293
RD
339 return _xrc.XmlNode_InsertChild(*args, **kwargs)
340
341 def RemoveChild(*args, **kwargs):
342 """RemoveChild(self, XmlNode child) -> bool"""
343 return _xrc.XmlNode_RemoveChild(*args, **kwargs)
344
345 def AddProperty(*args, **kwargs):
346 """AddProperty(self, XmlProperty prop)"""
347 return _xrc.XmlNode_AddProperty(*args, **kwargs)
348
349 def AddPropertyName(*args, **kwargs):
350 """AddPropertyName(self, String name, String value)"""
351 return _xrc.XmlNode_AddPropertyName(*args, **kwargs)
352
353 def DeleteProperty(*args, **kwargs):
354 """DeleteProperty(self, String name) -> bool"""
355 return _xrc.XmlNode_DeleteProperty(*args, **kwargs)
356
357 def GetType(*args, **kwargs):
358 """GetType(self) -> int"""
359 return _xrc.XmlNode_GetType(*args, **kwargs)
360
361 def GetName(*args, **kwargs):
362 """GetName(self) -> String"""
363 return _xrc.XmlNode_GetName(*args, **kwargs)
364
365 def GetContent(*args, **kwargs):
366 """GetContent(self) -> String"""
367 return _xrc.XmlNode_GetContent(*args, **kwargs)
368
33d6fd3b
RD
369 def IsWhitespaceOnly(*args, **kwargs):
370 """IsWhitespaceOnly(self) -> bool"""
371 return _xrc.XmlNode_IsWhitespaceOnly(*args, **kwargs)
372
373 def GetDepth(*args, **kwargs):
374 """GetDepth(self, XmlNode grandparent=None) -> int"""
375 return _xrc.XmlNode_GetDepth(*args, **kwargs)
376
377 def GetNodeContent(*args, **kwargs):
378 """GetNodeContent(self) -> String"""
379 return _xrc.XmlNode_GetNodeContent(*args, **kwargs)
380
2ef75293
RD
381 def GetParent(*args, **kwargs):
382 """GetParent(self) -> XmlNode"""
383 return _xrc.XmlNode_GetParent(*args, **kwargs)
384
385 def GetNext(*args, **kwargs):
386 """GetNext(self) -> XmlNode"""
387 return _xrc.XmlNode_GetNext(*args, **kwargs)
388
389 def GetChildren(*args, **kwargs):
390 """GetChildren(self) -> XmlNode"""
391 return _xrc.XmlNode_GetChildren(*args, **kwargs)
392
393 def GetProperties(*args, **kwargs):
394 """GetProperties(self) -> XmlProperty"""
395 return _xrc.XmlNode_GetProperties(*args, **kwargs)
396
397 def GetPropVal(*args, **kwargs):
398 """GetPropVal(self, String propName, String defaultVal) -> String"""
399 return _xrc.XmlNode_GetPropVal(*args, **kwargs)
400
401 def HasProp(*args, **kwargs):
402 """HasProp(self, String propName) -> bool"""
403 return _xrc.XmlNode_HasProp(*args, **kwargs)
404
405 def SetType(*args, **kwargs):
406 """SetType(self, int type)"""
407 return _xrc.XmlNode_SetType(*args, **kwargs)
408
409 def SetName(*args, **kwargs):
410 """SetName(self, String name)"""
411 return _xrc.XmlNode_SetName(*args, **kwargs)
412
413 def SetContent(*args, **kwargs):
414 """SetContent(self, String con)"""
415 return _xrc.XmlNode_SetContent(*args, **kwargs)
416
417 def SetParent(*args, **kwargs):
418 """SetParent(self, XmlNode parent)"""
419 return _xrc.XmlNode_SetParent(*args, **kwargs)
420
421 def SetNext(*args, **kwargs):
422 """SetNext(self, XmlNode next)"""
423 return _xrc.XmlNode_SetNext(*args, **kwargs)
424
425 def SetChildren(*args, **kwargs):
426 """SetChildren(self, XmlNode child)"""
427 return _xrc.XmlNode_SetChildren(*args, **kwargs)
428
429 def SetProperties(*args, **kwargs):
430 """SetProperties(self, XmlProperty prop)"""
431 return _xrc.XmlNode_SetProperties(*args, **kwargs)
432
2131d850 433_xrc.XmlNode_swigregister(XmlNode)
2ef75293
RD
434
435def XmlNodeEasy(*args, **kwargs):
436 """XmlNodeEasy(int type, String name, String content=EmptyString) -> XmlNode"""
437 val = _xrc.new_XmlNodeEasy(*args, **kwargs)
2ef75293
RD
438 return val
439
33d6fd3b
RD
440XML_NO_INDENTATION = _xrc.XML_NO_INDENTATION
441XMLDOC_NONE = _xrc.XMLDOC_NONE
442XMLDOC_KEEP_WHITESPACE_NODES = _xrc.XMLDOC_KEEP_WHITESPACE_NODES
2ef75293 443class XmlDocument(_core.Object):
093d3ff1 444 """Proxy of C++ XmlDocument class"""
0085ce49
RD
445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
446 __repr__ = _swig_repr
447 def __init__(self, *args, **kwargs):
2ef75293 448 """__init__(self, String filename, String encoding=UTF8String) -> XmlDocument"""
0085ce49
RD
449 _xrc.XmlDocument_swiginit(self,_xrc.new_XmlDocument(*args, **kwargs))
450 __swig_destroy__ = _xrc.delete_XmlDocument
451 __del__ = lambda self : None;
2ef75293 452 def Load(*args, **kwargs):
33d6fd3b 453 """Load(self, String filename, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool"""
2ef75293
RD
454 return _xrc.XmlDocument_Load(*args, **kwargs)
455
456 def LoadFromStream(*args, **kwargs):
33d6fd3b 457 """LoadFromStream(self, InputStream stream, String encoding=UTF8String, int flags=XMLDOC_NONE) -> bool"""
2ef75293
RD
458 return _xrc.XmlDocument_LoadFromStream(*args, **kwargs)
459
460 def Save(*args, **kwargs):
33d6fd3b 461 """Save(self, String filename, int indentstep=1) -> bool"""
2ef75293
RD
462 return _xrc.XmlDocument_Save(*args, **kwargs)
463
464 def SaveToStream(*args, **kwargs):
33d6fd3b 465 """SaveToStream(self, OutputStream stream, int indentstep=1) -> bool"""
2ef75293
RD
466 return _xrc.XmlDocument_SaveToStream(*args, **kwargs)
467
468 def IsOk(*args, **kwargs):
469 """IsOk(self) -> bool"""
470 return _xrc.XmlDocument_IsOk(*args, **kwargs)
471
472 def GetRoot(*args, **kwargs):
473 """GetRoot(self) -> XmlNode"""
474 return _xrc.XmlDocument_GetRoot(*args, **kwargs)
475
476 def GetVersion(*args, **kwargs):
477 """GetVersion(self) -> String"""
478 return _xrc.XmlDocument_GetVersion(*args, **kwargs)
479
480 def GetFileEncoding(*args, **kwargs):
481 """GetFileEncoding(self) -> String"""
482 return _xrc.XmlDocument_GetFileEncoding(*args, **kwargs)
483
ae5bc7f3
RD
484 def DetachRoot(*args, **kwargs):
485 """DetachRoot(self) -> XmlNode"""
486 return _xrc.XmlDocument_DetachRoot(*args, **kwargs)
487
2ef75293
RD
488 def SetRoot(*args, **kwargs):
489 """SetRoot(self, XmlNode node)"""
490 return _xrc.XmlDocument_SetRoot(*args, **kwargs)
491
492 def SetVersion(*args, **kwargs):
493 """SetVersion(self, String version)"""
494 return _xrc.XmlDocument_SetVersion(*args, **kwargs)
495
496 def SetFileEncoding(*args, **kwargs):
497 """SetFileEncoding(self, String encoding)"""
498 return _xrc.XmlDocument_SetFileEncoding(*args, **kwargs)
499
2131d850 500_xrc.XmlDocument_swigregister(XmlDocument)
2ef75293
RD
501
502def XmlDocumentFromStream(*args, **kwargs):
503 """XmlDocumentFromStream(InputStream stream, String encoding=UTF8String) -> XmlDocument"""
504 val = _xrc.new_XmlDocumentFromStream(*args, **kwargs)
2ef75293
RD
505 return val
506
507def EmptyXmlDocument(*args, **kwargs):
508 """EmptyXmlDocument() -> XmlDocument"""
509 val = _xrc.new_EmptyXmlDocument(*args, **kwargs)
2ef75293
RD
510 return val
511
512#---------------------------------------------------------------------------
513
514class XmlResourceHandler(_core.Object):
093d3ff1 515 """Proxy of C++ XmlResourceHandler class"""
0085ce49
RD
516 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
517 __repr__ = _swig_repr
518 def __init__(self, *args, **kwargs):
2ef75293 519 """__init__(self) -> XmlResourceHandler"""
0085ce49 520 _xrc.XmlResourceHandler_swiginit(self,_xrc.new_XmlResourceHandler(*args, **kwargs))
2ef75293
RD
521 self._setCallbackInfo(self, XmlResourceHandler)
522
523 def _setCallbackInfo(*args, **kwargs):
524 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
525 return _xrc.XmlResourceHandler__setCallbackInfo(*args, **kwargs)
526
527 def CreateResource(*args, **kwargs):
528 """CreateResource(self, XmlNode node, Object parent, Object instance) -> Object"""
529 return _xrc.XmlResourceHandler_CreateResource(*args, **kwargs)
530
531 def SetParentResource(*args, **kwargs):
532 """SetParentResource(self, XmlResource res)"""
533 return _xrc.XmlResourceHandler_SetParentResource(*args, **kwargs)
534
535 def GetResource(*args, **kwargs):
536 """GetResource(self) -> XmlResource"""
537 return _xrc.XmlResourceHandler_GetResource(*args, **kwargs)
538
539 def GetNode(*args, **kwargs):
540 """GetNode(self) -> XmlNode"""
541 return _xrc.XmlResourceHandler_GetNode(*args, **kwargs)
542
543 def GetClass(*args, **kwargs):
544 """GetClass(self) -> String"""
545 return _xrc.XmlResourceHandler_GetClass(*args, **kwargs)
546
547 def GetParent(*args, **kwargs):
548 """GetParent(self) -> Object"""
549 return _xrc.XmlResourceHandler_GetParent(*args, **kwargs)
550
551 def GetInstance(*args, **kwargs):
552 """GetInstance(self) -> Object"""
553 return _xrc.XmlResourceHandler_GetInstance(*args, **kwargs)
554
555 def GetParentAsWindow(*args, **kwargs):
556 """GetParentAsWindow(self) -> Window"""
557 return _xrc.XmlResourceHandler_GetParentAsWindow(*args, **kwargs)
558
2ef75293
RD
559 def IsOfClass(*args, **kwargs):
560 """IsOfClass(self, XmlNode node, String classname) -> bool"""
561 return _xrc.XmlResourceHandler_IsOfClass(*args, **kwargs)
562
563 def GetNodeContent(*args, **kwargs):
564 """GetNodeContent(self, XmlNode node) -> String"""
565 return _xrc.XmlResourceHandler_GetNodeContent(*args, **kwargs)
566
567 def HasParam(*args, **kwargs):
568 """HasParam(self, String param) -> bool"""
569 return _xrc.XmlResourceHandler_HasParam(*args, **kwargs)
570
571 def GetParamNode(*args, **kwargs):
572 """GetParamNode(self, String param) -> XmlNode"""
573 return _xrc.XmlResourceHandler_GetParamNode(*args, **kwargs)
574
575 def GetParamValue(*args, **kwargs):
576 """GetParamValue(self, String param) -> String"""
577 return _xrc.XmlResourceHandler_GetParamValue(*args, **kwargs)
578
579 def AddStyle(*args, **kwargs):
580 """AddStyle(self, String name, int value)"""
581 return _xrc.XmlResourceHandler_AddStyle(*args, **kwargs)
582
583 def AddWindowStyles(*args, **kwargs):
584 """AddWindowStyles(self)"""
585 return _xrc.XmlResourceHandler_AddWindowStyles(*args, **kwargs)
586
587 def GetStyle(*args, **kwargs):
588 """GetStyle(self, String param=StyleString, int defaults=0) -> int"""
589 return _xrc.XmlResourceHandler_GetStyle(*args, **kwargs)
590
591 def GetText(*args, **kwargs):
592 """GetText(self, String param, bool translate=True) -> String"""
593 return _xrc.XmlResourceHandler_GetText(*args, **kwargs)
594
595 def GetID(*args, **kwargs):
596 """GetID(self) -> int"""
597 return _xrc.XmlResourceHandler_GetID(*args, **kwargs)
598
599 def GetName(*args, **kwargs):
600 """GetName(self) -> String"""
601 return _xrc.XmlResourceHandler_GetName(*args, **kwargs)
602
603 def GetBool(*args, **kwargs):
604 """GetBool(self, String param, bool defaultv=False) -> bool"""
605 return _xrc.XmlResourceHandler_GetBool(*args, **kwargs)
606
607 def GetLong(*args, **kwargs):
608 """GetLong(self, String param, long defaultv=0) -> long"""
609 return _xrc.XmlResourceHandler_GetLong(*args, **kwargs)
610
611 def GetColour(*args, **kwargs):
612 """GetColour(self, String param) -> Colour"""
613 return _xrc.XmlResourceHandler_GetColour(*args, **kwargs)
614
615 def GetSize(*args, **kwargs):
616 """GetSize(self, String param=SizeString) -> Size"""
617 return _xrc.XmlResourceHandler_GetSize(*args, **kwargs)
618
619 def GetPosition(*args, **kwargs):
620 """GetPosition(self, String param=PosString) -> Point"""
621 return _xrc.XmlResourceHandler_GetPosition(*args, **kwargs)
622
623 def GetDimension(*args, **kwargs):
624 """GetDimension(self, String param, int defaultv=0) -> int"""
625 return _xrc.XmlResourceHandler_GetDimension(*args, **kwargs)
626
627 def GetBitmap(*args, **kwargs):
628 """
629 GetBitmap(self, String param=BitmapString, wxArtClient defaultArtClient=wxART_OTHER,
630 Size size=DefaultSize) -> Bitmap
631 """
632 return _xrc.XmlResourceHandler_GetBitmap(*args, **kwargs)
633
634 def GetIcon(*args, **kwargs):
635 """
636 GetIcon(self, String param=IconString, wxArtClient defaultArtClient=wxART_OTHER,
637 Size size=DefaultSize) -> Icon
638 """
639 return _xrc.XmlResourceHandler_GetIcon(*args, **kwargs)
640
641 def GetFont(*args, **kwargs):
642 """GetFont(self, String param=FontString) -> Font"""
643 return _xrc.XmlResourceHandler_GetFont(*args, **kwargs)
644
645 def SetupWindow(*args, **kwargs):
646 """SetupWindow(self, Window wnd)"""
647 return _xrc.XmlResourceHandler_SetupWindow(*args, **kwargs)
648
649 def CreateChildren(*args, **kwargs):
650 """CreateChildren(self, Object parent, bool this_hnd_only=False)"""
651 return _xrc.XmlResourceHandler_CreateChildren(*args, **kwargs)
652
653 def CreateChildrenPrivately(*args, **kwargs):
654 """CreateChildrenPrivately(self, Object parent, XmlNode rootnode=None)"""
655 return _xrc.XmlResourceHandler_CreateChildrenPrivately(*args, **kwargs)
656
657 def CreateResFromNode(*args, **kwargs):
658 """CreateResFromNode(self, XmlNode node, Object parent, Object instance=None) -> Object"""
659 return _xrc.XmlResourceHandler_CreateResFromNode(*args, **kwargs)
660
661 def GetCurFileSystem(*args, **kwargs):
662 """GetCurFileSystem(self) -> FileSystem"""
663 return _xrc.XmlResourceHandler_GetCurFileSystem(*args, **kwargs)
664
2131d850 665_xrc.XmlResourceHandler_swigregister(XmlResourceHandler)
2ef75293
RD
666
667#----------------------------------------------------------------------------
668# The global was removed in favor of static accessor functions. This is for
669# backwards compatibility:
670
671TheXmlResource = XmlResource_Get()
672
673
674#----------------------------------------------------------------------------
675# Create a factory for handling the subclass property of the object tag.
676
677
678def _my_import(name):
679 mod = __import__(name)
680 components = name.split('.')
681 for comp in components[1:]:
682 mod = getattr(mod, comp)
683 return mod
684
685
686class XmlSubclassFactory_Python(XmlSubclassFactory):
687 def __init__(self):
688 XmlSubclassFactory.__init__(self)
689
690 def Create(self, className):
691 assert className.find('.') != -1, "Module name must be specified!"
692 mname = className[:className.rfind('.')]
693 cname = className[className.rfind('.')+1:]
694 module = _my_import(mname)
695 klass = getattr(module, cname)
696 inst = klass()
697 return inst
698
699
700XmlResource_AddSubclassFactory(XmlSubclassFactory_Python())
701
702#----------------------------------------------------------------------------
703
704
32fe5131 705