This file is indexed.

/usr/include/wx-3.0/wx/wxPython/i_files/_xmlres.i is in python-wxgtk3.0-dev 3.0.2.0+dfsg-7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/////////////////////////////////////////////////////////////////////////////
// Name:        _xmlres.i
// Purpose:     SWIG interface for wxXmlResource
//
// Author:      Robin Dunn
//
// Created:     4-June-2001
// RCS-ID:      $Id$
// Copyright:   (c) 2003 by Total Control Software
// Licence:     wxWindows license
/////////////////////////////////////////////////////////////////////////////

// Not a %module


//---------------------------------------------------------------------------
%newgroup



class wxPyXmlSubclassFactory;

enum {
    WX_XMLRES_CURRENT_VERSION_MAJOR,
    WX_XMLRES_CURRENT_VERSION_MINOR,
    WX_XMLRES_CURRENT_VERSION_RELEASE,
    WX_XMLRES_CURRENT_VERSION_REVISION,
};


enum wxXmlResourceFlags
{
    wxXRC_USE_LOCALE,
    wxXRC_NO_SUBCLASSING,
    wxXRC_NO_RELOADING
};



// This class holds XML resources from one or more .xml files
// (or derived forms, either binary or zipped -- see manual for
// details).

class wxXmlResource : public wxObject
{
public:

    %pythonAppend wxXmlResource(const wxString& filemask, int flags,
                  const wxString& domain=wxEmptyString)   "self.InitAllHandlers()"
    %pythonAppend wxXmlResource(int flags,
                  const wxString& domain=wxEmptyString)   "val.InitAllHandlers()"

    // Ctors.
    // Flags: wxXRC_USE_LOCALE
    //              translatable strings will be translated via _()
    //        wxXRC_NO_SUBCLASSING
    //              subclass property of object nodes will be ignored
    //              (useful for previews in XRC editors)
    wxXmlResource(const wxString& filemask, int flags = wxXRC_USE_LOCALE,
                  const wxString& domain=wxEmptyString);
    %RenameCtor(EmptyXmlResource,  wxXmlResource(int flags = wxXRC_USE_LOCALE,
                  const wxString& domain=wxEmptyString));
    
    ~wxXmlResource();

    //wxXmlNode* GetFirstRoot();  ** Link error
    
    // Loads resources from XML files that match given filemask.
    // This method understands VFS (see filesys.h).
    bool Load(const wxString& filemask);

    %extend {
        bool LoadFromString(buffer data, int DATASIZE) {
            static int s_memFileIdx = 0;

            // Check for memory FS. If not present, load the handler:
            wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"),
                                       wxT("dummy data"));
            wxFileSystem fsys;
            wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));
            wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));
            if (f)
                delete f;
            else
                wxFileSystem::AddHandler(new wxMemoryFSHandler);

            // Now put the resource data into the memory FS
            wxString filename(wxT("XRC_resource/data_string_"));
            filename << s_memFileIdx;
            s_memFileIdx += 1;
            wxMemoryFSHandler::AddFile(filename, (void*)data, DATASIZE);

            // Load the "file" into the resource object
            bool retval = self->Load(wxT("memory:") + filename );

            return retval;
        }
    }

    // Loads resources from single XRC file.
    bool LoadFile(const wxString& file);

    // Unload resource from the given XML file (wildcards not allowed)
    bool Unload(const wxString& filename);
    
    // Initialize handlers for all supported controls/windows. 
    void InitAllHandlers();


    %disownarg( wxPyXmlResourceHandler *handler );
    
    // Initialize only specific handler (or custom handler). Convention says
    // that handler name is equal to control's name plus 'XmlHandler', e.g.
    // wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. XML resource compiler
    // (xmlres) can create include file that contains initialization code for
    // all controls used within the resource.
    void AddHandler(wxPyXmlResourceHandler *handler);

    // Add a new handler at the begining of the handler list
    void InsertHandler(wxPyXmlResourceHandler *handler);

    %cleardisown( wxPyXmlResourceHandler *handler );

    
    // Removes all handlers
    void ClearHandlers();

    // Registers subclasses factory for use in XRC. This function is not meant
    // for public use, please see the comment above wxXmlSubclassFactory
    // definition.
    %disownarg( wxPyXmlSubclassFactory *factory );
    static void AddSubclassFactory(wxPyXmlSubclassFactory *factory);
    %cleardisown( wxPyXmlSubclassFactory *factory );


    // Loads menu from resource. Returns NULL on failure.
    wxMenu *LoadMenu(const wxString& name);

    // Loads menubar from resource. Returns NULL on failure.
    wxMenuBar *LoadMenuBar(const wxString& name);
    %Rename(LoadMenuBarOnFrame,  wxMenuBar* , LoadMenuBar(wxWindow *parent, const wxString& name));


    // Loads toolbar
    wxToolBar *LoadToolBar(wxWindow *parent, const wxString& name);

    // Loads dialog. dlg points to parent window (if any). Second form
    // is used to finish creation of already existing instance (main reason
    // for this is that you may want to use derived class with new event table)
    // Example (typical usage):
    //      MyDialog dlg;
    //      wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
    //      dlg->ShowModal();
    wxDialog *LoadDialog(wxWindow *parent, const wxString& name);
    %Rename(LoadOnDialog, bool,  LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name));

    // Loads panel. panel points to parent window (if any). Second form
    // is used to finish creation of already existing instance.
    wxPanel *LoadPanel(wxWindow *parent, const wxString& name);
    %Rename(LoadOnPanel, bool,  LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name));

    // Load a frame's contents from a resource
    wxFrame *LoadFrame(wxWindow* parent, const wxString& name);
    %Rename(LoadOnFrame, bool,  LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name));

    // Load an object from the resource specifying both the resource name and
    // the classname.  This lets you load nonstandard container windows.
    wxObject *LoadObject(wxWindow *parent, const wxString& name,
                         const wxString& classname);

    // Load an object from the resource specifying both the resource name and
    // the classname.  This form lets you finish the creation of an existing
    // instance.
    %Rename(LoadOnObject,
            bool,  LoadObject(wxObject *instance,
                              wxWindow *parent,
                              const wxString& name,
                              const wxString& classname));

    // These versions of LoadObject() look for the object with the given name
    // recursively (breadth first) and can be used to instantiate an individual
    // control defined anywhere in an XRC file. No check is done that the name
    // is unique, it's up to the caller to ensure this.
    wxObject *LoadObjectRecursively(wxWindow *parent,
                                    const wxString& name,
                                    const wxString& classname);

    %Rename(LoadOnObjectRecursively,
            bool , LoadObjectRecursively(wxObject *instance,
                                         wxWindow *parent,
                                         const wxString& name,
                                         const wxString& classname));

    
    // Loads a bitmap resource from a file.
    wxBitmap LoadBitmap(const wxString& name);

    // Loads an icon resource from a file.
    wxIcon LoadIcon(const wxString& name);

    // Attaches unknown control into given panel/window/dialog:
    // (unknown controls are used in conjunction with <object class="unknown">)
    bool AttachUnknownControl(const wxString& name, wxWindow *control,
                              wxWindow *parent = NULL);

    // Returns a numeric ID that is equivalent to the string ID used in an XML
    // resource. If an unknown str_id is requested (i.e. other than wxID_XXX
    // or integer), a new record is created which associates the given string
    // with a number. If value_if_not_found == wxID_NONE, the number is obtained via
    // wxNewId(). Otherwise value_if_not_found is used.
    // Macro XRCID(name) is provided for convenient use in event tables.
    static int GetXRCID(const wxString& str_id, int value_if_not_found = wxID_NONE);

    // Returns version info (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a)
    long GetVersion() const;

    // Compares resources version to argument. Returns -1 if resources version
    // is less than the argument, +1 if greater and 0 if they equal.
    int CompareVersion(int major, int minor, int release, int revision) const;


    // Gets global resources object or create one if none exists
    static wxXmlResource *Get();
    // Sets global resources object and returns pointer to previous one (may be NULL).
    static wxXmlResource *Set(wxXmlResource *res);

    // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING.
    int GetFlags();

    // Set flags after construction.
    void SetFlags(int flags) { m_flags = flags; }

    // Get/Set the domain to be passed to the translation functions, defaults to NULL.
    wxString GetDomain() const;
    void SetDomain(const wxString& domain);

    // This function returns the wxXmlNode containing the definition of the
    // object with the given name or NULL.
    //
    // It can be used to access additional information defined in the XRC file
    // and not used by wxXmlResource itself.
    const wxXmlNode *GetResourceNode(const wxString& name) const;

    
    %property(Domain, GetDomain, SetDomain, doc="See `GetDomain` and `SetDomain`");
    %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
    %property(Version, GetVersion, doc="See `GetVersion`");
};

//----------------------------------------------------------------------

%pythoncode {
def XRCID(str_id, value_if_not_found = wx.ID_NONE):
    return XmlResource_GetXRCID(str_id, value_if_not_found)

def XRCCTRL(window, str_id, *ignoreargs):
    return window.FindWindowById(XRCID(str_id))
};

//---------------------------------------------------------------------------