OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [standalone/] [wxwin/] [configtooldoc.h] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
// configtooldoc.h :
23
//
24
//===========================================================================
25
//#####DESCRIPTIONBEGIN####
26
//
27
// Author(s):   julians
28
// Contact(s):  julians
29
// Date:        2000/10/05
30
// Version:     $Id: configtooldoc.h,v 1.15 2001/08/10 14:58:21 julians Exp $
31
// Purpose:
32
// Description: Header file for ecConfigToolDoc
33
// Requires:
34
// Provides:
35
// See also:
36
// Known bugs:
37
// Usage:
38
//
39
//####DESCRIPTIONEND####
40
//
41
//===========================================================================
42
 
43
#ifndef _ECOS_CONFIGTOOLDOC_H_
44
#define _ECOS_CONFIGTOOLDOC_H_
45
 
46
#ifdef __GNUG__
47
#pragma interface "configtooldoc.h"
48
#endif
49
 
50
#include "cdl.hxx"
51
 
52
#include "configitem.h"
53
 
54
#if ecUSE_MLT
55
#include "memmap.h"
56
#endif
57
 
58
class ecConfigItem;
59
 
60
// Tell OnCreate to prompt for a repository instead of just loading it silently
61
#define ecDOC_PROMPT_FOR_REPOSITORY 8
62
 
63
/*
64
 * ecConfigToolDoc
65
 * Holds the saveable configtool information
66
 */
67
 
68
class ecConfigToolDoc: public wxDocument
69
{
70
    DECLARE_DYNAMIC_CLASS(ecConfigToolDoc)
71
public:
72
    ecConfigToolDoc();
73
    ~ecConfigToolDoc();
74
 
75
//// Overrides
76
    virtual bool OnCreate(const wxString& path, long flags);
77
    virtual bool OnOpenDocument(const wxString& filename);
78
    virtual bool OnSaveDocument(const wxString& filename);
79
    virtual bool OnNewDocument() { return TRUE; }
80
    virtual bool OnCloseDocument() ;
81
    virtual bool Save(); // Overridden only to correct bug in wxWindows, docview.cpp
82
 
83
//// Error and other handlers
84
    static void CdlLoadErrorHandler(std::string message);
85
    static void CdlLoadWarningHandler(std::string message);
86
    static void CdlParseErrorHandler (std::string message);
87
    static void CdlParseWarningHandler (std::string message);
88
    static void CdlTransactionHandler (const CdlTransactionCallback & data);
89
    static CdlInferenceCallbackResult CdlInferenceHandler (CdlTransaction data);
90
    static CdlInferenceCallbackResult CdlGlobalInferenceHandler(CdlTransaction data);
91
 
92
//// Accessors
93
    CdlPackagesDatabase GetCdlPkgData () { return m_CdlPkgData; }
94
    CdlConfiguration GetCdlConfig () { return m_CdlConfig; }
95
    CdlInterpreter GetCdlInterpreter() { return m_CdlInterp; }
96
 
97
    // Absolute path name to root of respository - parent of PackagesDir below
98
    void SetRepository(const wxString& pszRepository)  { m_strRepository = ecFileName(pszRepository); }
99
    const ecFileName& GetRepository() const { return m_strRepository; }
100
 
101
    wxString GetDefaultHardware () ;
102
        const wxString& GetTemplateVersion() const { return m_templateVersion; }
103
    wxString GetPackageName (const wxString & strAlias);
104
 
105
    // Absolute path name to "packages" directory - i.e. the one under the repository
106
    // named "packages" in a delivery or "ecc" in CVS:
107
    const ecFileName& GetPackagesDir() const { return m_strPackagesDir; }
108
 
109
    const wxString& GetInstallTree() const { return m_strInstallTree; }
110
    const wxString& GetBuildTree() const { return m_strBuildTree; }
111
    void SetInstallTree(const wxString& str) { m_strInstallTree = str; }
112
    void SetBuildTree(const wxString& str) { m_strBuildTree = str; }
113
 
114
    wxList& GetItems() { return m_items; }
115
    ecConfigItem* GetItem(size_t i) { return (ecConfigItem*) m_items[i]; }
116
 
117
    CdlBuildInfo& GetBuildInfo() { return m_BuildInfo; }
118
 
119
#if wxCHECK_VERSION(2, 6, 0)
120
    ecConfigItem* GetFirstItem() { return (m_items.GetCount() == 0 ? (ecConfigItem*) NULL : (ecConfigItem*) m_items.GetFirst()->GetData()); }
121
#else
122
    ecConfigItem* GetFirstItem() { return (m_items.Number() == 0 ? (ecConfigItem*) NULL : (ecConfigItem*) m_items.First()->Data()); }
123
#endif
124
 
125
    const wxString GetCurrentTargetPrefix();
126
 
127
    const wxString HTMLHelpLinkFileName();
128
 
129
    const ecFileName MLTDir ();
130
    const ecFileName CurrentLinkerScript();
131
    const wxString CurrentMemoryLayout ();
132
 
133
    const ecFileName GetDocBase() const { return GetRepository() + wxT("doc"); }
134
 
135
//// Operations
136
    bool OpenRepository(const wxString& pszRepository = wxEmptyString, bool bPromptInitially=FALSE) ;
137
    bool OpenRepository (ecFileName& strNewRepository, CdlPackagesDatabase &NewCdlPkgData,CdlInterpreter &NewCdlInterp,CdlConfiguration &NewCdlConfig, wxString &strNewPackagesDir);
138
    void CloseRepository() ;
139
    // Find a valid repository given a directory name
140
    bool FindRepository (ecFileName& repositoryIn, ecFileName& repositoryOut) const;
141
    void EnableCallbacks (bool bEnable=TRUE);
142
    void AddContents (const CdlContainer container, ecConfigItem *pParent);
143
    void AddAllItems();
144
    ecConfigItem* AddItem (const CdlUserVisible vitem, ecConfigItem * pParent);
145
    void DeleteItems();
146
 
147
    // Use the wxHtmlHelpController
148
    bool ShowInternalHtmlHelp (const wxString& strURL);
149
 
150
    // Use an external browser
151
    bool ShowExternalHtmlHelp (const wxString& strURL);
152
 
153
    bool ShowURL(const wxString& strURL);
154
    // If prefix is TRUE, add file:// to beginning
155
    bool QualifyDocURL(wxString &strURL, bool prefix = TRUE);
156
    void CheckRadios();
157
    bool GenerateHeaders();
158
    bool ExportFile();
159
    bool ImportFile();
160
    void RunTests();
161
 
162
    // A standalone method for generating a build tree without saving first
163
    bool GenerateBuildTree();
164
    // Can we generate the build tree yet?
165
    bool CanGenerateBuildTree() ;
166
 
167
    void SelectTemplate (const wxString& newTemplate, const wxString& newTemplateVersion);
168
    void SelectHardware (const wxString& newTemplate);
169
    void SelectPackages ();
170
        void RegenerateData();
171
    bool UpdateBuildInfo(bool bFirstTime=FALSE);
172
    int GetTestExeNames (wxArrayString& arTestExes, wxArrayString& arMissing) ;
173
    bool SaveMemoryMap();
174
    bool CopyMLTFiles();
175
    bool SwitchMemoryLayout (bool bNewTargetPlatform);
176
    bool NewMemoryLayout (const wxString &strPrefix);
177
 
178
        // Find the ecConfigItem referencing the given CdlValuable
179
        ecConfigItem * Find (CdlValuable v);
180
        ecConfigItem * Find(const wxString & strWhat, ecWhereType where = ecInMacro);
181
 
182
    enum GlobalConflictOutcome {OK,Cancel,NotDone};
183
    // Resolve conflicts
184
    GlobalConflictOutcome ResolveGlobalConflicts(wxList *parConflictsOfInterest=NULL);
185
    bool CheckConflictsBeforeSave();
186
    void LogConflicts (const std::list<CdlConflict> & conflicts);
187
    void UpdateFailingRuleCount();
188
 
189
    bool SetValue(ecConfigItem &ti, long nValue, CdlTransaction transaction = NULL);
190
    bool SetValue(ecConfigItem &ti, const wxString &strValue, CdlTransaction transaction = NULL);
191
    bool SetValue (ecConfigItem &ti, double dValue, CdlTransaction transaction = NULL);
192
    bool SetEnabled(ecConfigItem &ti, bool bEnabled, CdlTransaction transaction = NULL);
193
 
194
    // Rebuild the .hhc, .hhp, .hhk files and reinitialize the help controller
195
    bool RebuildHelpIndex(bool force = TRUE);
196
 
197
protected:
198
    CdlPackagesDatabase m_CdlPkgData;
199
    CdlInterpreter      m_CdlInterp;
200
    CdlConfiguration    m_CdlConfig;
201
    wxString            m_templateVersion;
202
    ecFileName          m_strPackagesDir;
203
    wxString            m_strCdlErrorMessage;
204
    wxString            m_strMemoryLayoutFolder;
205
    wxString            m_strLinkerScriptFolder;
206
    ecFileName          m_strBuildTree;
207
    ecFileName          m_strInstallTree;
208
    wxList              m_items;
209
    CdlBuildInfo                m_BuildInfo;
210
 
211
    // This data supports communication of information to the failing rules dialog invoked by CdlGlobalInferenceHandler():
212
    GlobalConflictOutcome m_ConflictsOutcome;
213
    wxList              m_arConflictsOfInterest; // used by CRulesView::OnResolve (TODO change comment)
214
 
215
public:
216
    ecFileName          m_strRepository;
217
    bool                m_bRepositoryOpen;
218
 
219
#if ecUSE_MLT
220
    mem_map             m_memoryMap;
221
    wxString            m_strSelectedSection;
222
    wxString            m_strSelectedRegion;
223
#endif
224
};
225
 
226
 
227
#endif
228
        // _ECOS_CONFIGTOOLDOC_H_

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.