This file is indexed.

/usr/include/wxsmith/wxsresourcefactory.h is in libwxsmithlib-dev 13.12-3.

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
/*
* This file is part of wxSmith plugin for Code::Blocks Studio
* Copyright (C) 2006-2007  Bartlomiej Swiecki
*
* wxSmith is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wxSmith is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
*
* $Revision: 8574 $
* $Id: wxsresourcefactory.h 8574 2012-11-18 15:59:14Z mortenmacfly $
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-xx.yy/src/plugins/contrib/wxSmith/wxsresourcefactory.h $
*/

#ifndef WXSRESOURCEFACTORY_H
#define WXSRESOURCEFACTORY_H

#include <wx/string.h>
#include <wx/menu.h>

#include "prep.h"

class wxsResource;
class wxsProject;

/** \brief This class is responsible for creating resource classes
 *
 * This class is provided as singleton
 */
class wxsResourceFactory
{
    public:

        /** \brief Function generating resource class */
        static wxsResource* Build(const wxString& ResourceType,wxsProject* Project);

        /** \brief Checking if factory can handle given file as external resource */
        static bool CanHandleExternal(const wxString& FileName);

        /** \brief Building external resource object */
        static wxsResource* BuildExternal(const wxString& FileName);

        /** \brief Building wxSmith menu entries */
        static void BuildSmithMenu(wxMenu* menu);

        /** \brief Processing menu event for creating new resources
         *
         * This function is triggered when there's a chance that "Add ..." menu from
         * wxSmith has been clicked. In that case, wxsResourceFactory will process it
         * and return true. If it's not "Add ..." menu entry, it will return false
         */
        static bool NewResourceMenu(int Id,wxsProject* Project);

        /** \brief Getting tree icon id for given resource type */
        static int ResourceTreeIcon(const wxString &ResourceType);

        /** \brief Calling OnAttach for all factories */
        static void OnAttachAll();

        /** \brief Calling OnRelease for all factories */
        static void OnReleaseAll();

    protected:

        /** \brief Ctor */
        wxsResourceFactory();

        /** \brief Dctor */
        virtual ~wxsResourceFactory();

        /** \brief Called when plugin is being attached */
        virtual void OnAttach() {}

        /** \brief Called when plugin is being released */
        virtual void OnRelease() {}

        /** \brief Getting number of resource types inside this factory */
        virtual int OnGetCount() = 0;

        /** \brief Checking if given resource can be main in application */
        virtual void OnGetInfo(int Number,wxString& Name,wxString& GUI) = 0;

        /** \brief creating resource */
        virtual wxsResource* OnCreate(int Number,wxsProject* Project) = 0;

        /** \brief Checking if factory can handle given file as external resource */
        virtual bool OnCanHandleExternal(cb_unused const wxString& FileName) { return false; }

        /** \brief Building external resource object */
        virtual wxsResource* OnBuildExternal(cb_unused const wxString& FileName) { return 0; }

        /** \brief Function creating new resource object
         *
         * This function is responsible for creating new resource, adding it into project,
         * additionally adding new files to project and initialize resource with proper
         * data. Usually it will require some dialog box before creating resource
         * to get needed params.
         */
        virtual bool OnNewWizard(cb_unused int Number,wxsProject* Project) = 0;

        /** \brief Function getting icon in resource browser for this resource entry */
        virtual int OnResourceTreeIcon(cb_unused int Number) { return -1; }

    private:

        struct ResourceInfo
        {
            wxsResourceFactory* m_Factory;
            int m_Number;
            wxString m_GUI;
            int m_MenuId;
            ResourceInfo(): m_Factory(0), m_Number(0), m_MenuId(-1) {}
        };

        WX_DECLARE_STRING_HASH_MAP(ResourceInfo,HashT);

        wxsResourceFactory* m_Next;
        bool m_Attached;
        static wxsResourceFactory* m_UpdateQueue;
        static wxsResourceFactory* m_Initialized;
        static HashT m_Hash;
        static wxString m_LastExternalName;
        static wxsResourceFactory* m_LastExternalFactory;
        static bool m_AllAttached;

        static void InitializeFromQueue();
        inline void Initialize();

};

#endif