~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/wxSmith/wxwidgets/wxscodercontext.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* This file is part of wxSmith plugin for Code::Blocks Studio
 
3
* Copyright (C) 2007  Bartlomiej Swiecki
 
4
*
 
5
* wxSmith is free software; you can redistribute it and/or modify
 
6
* it under the terms of the GNU General Public License as published by
 
7
* the Free Software Foundation; either version 3 of the License, or
 
8
* (at your option) any later version.
 
9
*
 
10
* wxSmith is distributed in the hope that it will be useful,
 
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
13
* GNU General Public License for more details.
 
14
*
 
15
* You should have received a copy of the GNU General Public License
 
16
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
 
17
*
 
18
* $Revision: 8251 $
 
19
* $Id: wxscodercontext.h 8251 2012-08-28 02:31:00Z ollydbg $
 
20
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/wxscodercontext.h $
 
21
*/
 
22
 
 
23
#ifndef WXSCODERCONTEXT_H
 
24
#define WXSCODERCONTEXT_H
 
25
 
 
26
#include <wx/string.h>
 
27
#include <wx/arrstr.h>
 
28
#include <wx/hashmap.h>
 
29
#include <wx/hashset.h>
 
30
#include "../wxscodinglang.h"
 
31
 
 
32
/** \brief This struct is responsible for keeping current code context while generating resource
 
33
 *
 
34
 * This struct keeps information needed to properly generate and store source code.
 
35
 * It contains code built so far, lists of include files, declarations etc.
 
36
 * It may also contain other data stored between generation of code in different items
 
37
 * in form of wxString->wxString map.
 
38
 */
 
39
struct wxsCoderContext
 
40
{
 
41
    WX_DECLARE_STRING_HASH_MAP(wxString,ExtraMap);
 
42
    WX_DECLARE_HASH_SET(wxString,wxStringHash,wxStringEqual,wxStringSet);
 
43
 
 
44
    wxsCodingLang m_Language;               ///< \brief Language in which code should be generated
 
45
    long          m_Flags;                  ///< \brief Flags used to generate code
 
46
    wxString      m_WindowParent;           ///< \brief Parent window name
 
47
 
 
48
    wxStringSet m_LocalHeaders;             ///< \brief List of headers included inside .cpp file which are included inside pch file
 
49
    wxStringSet m_LocalHeadersNonPCH;       ///< \brief List of headers included inside .cpp file which are not included in pch file
 
50
    wxStringSet m_GlobalHeaders;            ///< \brief List of headers containing declarations of resource's items included inside pch file
 
51
    wxStringSet m_GlobalHeadersNonPCH;      ///< \brief List of headers containing declarations of resource's items not included inside pch file
 
52
    wxStringSet m_ForwardDeclarations;      ///< \brief List of forward declarations of resource's items
 
53
    wxStringSet m_ForwardDeclarationsNonPCH;///< \brief List of forward declarations of resource's items
 
54
    wxStringSet m_LocalDeclarations;        ///< \brief List of declarations of local items (not visible in resource's class)
 
55
    wxStringSet m_GlobalDeclarations;       ///< \brief List of declarations of global items (which are being members of resource's class)
 
56
    wxArrayString m_IdEnumerations;         ///< \brief Code used to create list of identifiers as members of resource class
 
57
    wxArrayString m_IdInitializions;        ///< \brief Code used to initialize list of identifiers
 
58
    wxString    m_XRCFetchingCode;          ///< \brief Code which will fetch items from XRC file after it's loaded (through querying with IDs)
 
59
    wxString    m_BuildingCode;             ///< \brief Code which builds resource's items manually (when not using XRC file)
 
60
    wxString    m_EventsConnectingCode;     ///< \brief Code used to connect events
 
61
 
 
62
    ExtraMap      m_Extra;                  ///< \brief Extra data used to exchange information between items while they generate code
 
63
 
 
64
    /** \brief Adding header file into current context */
 
65
    void AddHeader(const wxString& Header,const wxString& DeclaredClass,long HeaderFlags=0);
 
66
 
 
67
    /*** \brief Adding forward declaration of item's class */
 
68
    void AddDeclaration(const wxString& Declaration);
 
69
 
 
70
    /** \brief Adding XRC fetching code */
 
71
    void AddXRCFetchingCode(const wxString& Code);
 
72
 
 
73
    /** \brief Adding Manually building code */
 
74
    void AddBuildingCode(const wxString& Code);
 
75
 
 
76
    /** \brief Adding event connecting code */
 
77
    void AddEventCode(const wxString& Code);
 
78
 
 
79
    /** \brief Adding id-generating code */
 
80
    void AddIdCode(const wxString& Enumeration,const wxString& Initialization);
 
81
 
 
82
    /** \brief Generate Unique name with given prefix
 
83
     *
 
84
     * The name is generated by adding number of declarations with this name so far.
 
85
     * The counter is stored as length of m_Extra map member
 
86
     */
 
87
    wxString GetUniqueName(const wxString& Prefix);
 
88
};
 
89
 
 
90
#endif