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

Subversion Repositories openrisc

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

Go to most recent revision | 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, 2003 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
// appsettings.h :
23
//
24
//===========================================================================
25
//#####DESCRIPTIONBEGIN####
26
//
27
// Author(s):   julians, jld
28
// Contact(s):  julians
29
// Date:        2000/08/29
30
// Version:     $Id: appsettings.h,v 1.12 2001/12/14 17:34:03 julians Exp $
31
// Purpose:
32
// Description: Header file for the ConfigTool application settings
33
// Requires:
34
// Provides:
35
// See also:
36
// Known bugs:
37
// Usage:
38
//
39
//####DESCRIPTIONEND####
40
//
41
//===========================================================================
42
 
43
#ifndef _ECOS_APPSETTINGS_H_
44
#define _ECOS_APPSETTINGS_H_
45
 
46
#include "wx/config.h"
47
#include "filename.h"
48
#include "ecutils.h"
49
#include "eCosTest.h"
50
 
51
#ifdef __WXMSW__
52
#include "wx/msw/winundef.h"
53
#endif
54
 
55
// Frame status
56
#define ecSHOW_STATUS_NORMAL        0x01
57
#define ecSHOW_STATUS_MINIMIZED     0x02
58
#define ecSHOW_STATUS_MAXIMIZED     0x03
59
 
60
// What kind of browser (wxHtmlHelpController, default browser, custom browser)
61
enum ecBrowserType { ecInternal, ecAssociatedExternal, ecCustomExternal };
62
 
63
/*
64
 * ecRunTestSettings
65
 * Settings relating to running tests
66
 */
67
enum ResetType   {RESET_NONE,  RESET_X10, RESET_MANUAL};
68
enum TimeoutType {TIMEOUT_NONE,TIMEOUT_SPECIFIED, TIMEOUT_AUTOMATIC};
69
 
70
class ecRunTestsSettings: public wxObject
71
{
72
DECLARE_DYNAMIC_CLASS(ecRunTestsSettings)
73
public:
74
    ecRunTestsSettings();
75
    ecRunTestsSettings(const ecRunTestsSettings& settings);
76
 
77
//// Operations
78
    void Copy(const ecRunTestsSettings& settings);
79
 
80
    bool SaveConfig(wxConfig& config);
81
    bool LoadConfig(wxConfig& config);
82
 
83
//// Data members
84
    CeCosTest::ExecutionParameters  m_ep;
85
    int         m_nTimeout;
86
    int         m_nDownloadTimeout;
87
    int         m_nTimeoutType;
88
    int         m_nDownloadTimeoutType;
89
    bool        m_bRemote;
90
    bool        m_bSerial;
91
    int         m_nBaud;
92
    int         m_nLocalTCPIPPort;
93
    int         m_nReset;
94
    int         m_nResourcePort;
95
    int         m_nRemotePort;
96
    bool        m_bFarmed;
97
    wxString    m_strPort; // Serial port
98
    wxString    m_strTarget;
99
 
100
    wxString    m_strRemoteHost;
101
    wxString    m_strResourceHost;
102
    wxString    m_strLocalTCPIPHost;
103
    wxString    m_strReset;
104
};
105
 
106
/*
107
 * ecSettings
108
 * Various application settings
109
 */
110
 
111
class ecSettings: public wxObject
112
{
113
DECLARE_DYNAMIC_CLASS(ecSettings)
114
public:
115
    ecSettings();
116
    ecSettings(const ecSettings& settings);
117
    ~ecSettings();
118
 
119
//// Operations
120
    // Copy from settings to 'this'
121
    void Copy(const ecSettings& settings);
122
 
123
    // Load config info
124
    bool LoadConfig();
125
 
126
    // Save config info
127
    bool SaveConfig();
128
 
129
    // Load and save font descriptions
130
    bool LoadFont(wxConfig& config, const wxString& windowName, wxFont& font);
131
    bool SaveFont(wxConfig& config, const wxString& windowName, const wxFont& font);
132
    bool LoadFonts(wxConfig& config);
133
    bool SaveFonts(wxConfig& config);
134
    bool ApplyFontsToWindows();
135
 
136
    // Do some initialisation within ecApp::OnInit
137
    bool Init();
138
 
139
    // Show settings dialog
140
    void ShowSettingsDialog(const wxString& page = wxEmptyString);
141
 
142
    // Create new filename
143
    wxString GenerateFilename(const wxString& rootName);
144
 
145
    // Go looking for potential candidates in SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
146
    int GetRepositoryRegistryClues(wxArrayString& arstr, const wxString& pszPrefix);
147
 
148
    // Finds the path of the latest installed eCos (Unix only)
149
    wxString FindLatestVersion();
150
 
151
    // Find the subkey of the latest installed eCos, e.g. "1.4.9"
152
    wxString GetInstallVersionKey ();
153
 
154
#ifdef __WXMSW__
155
    // Find the location of the Cygwin installation
156
    wxString GetCygwinInstallPath ();
157
#endif
158
 
159
//// Accessors
160
 
161
    wxString GetAppName() const { return m_appName; }
162
 
163
    // Get a name suitable for the configuration file on all platforms:
164
    // e.g. eCos Configuration Tool on Windows, .eCosConfigTool on Unix
165
    wxString GetConfigAppName() const ;
166
 
167
    wxString& GetLastFilename() { return m_lastFilename; }
168
 
169
    const ecFileName& DefaultExternalBrowser() ;
170
 
171
    const wxString& GetUserToolsDir() const { return m_userToolsDir; }
172
    const wxString& GetBuildToolsDir() const { return m_buildToolsDir; }  /* Only used if no other clues */
173
 
174
    wxStringToStringMap& GetBinDirs() { return m_arstrBinDirs; }
175
 
176
    ecRunTestsSettings& GetRunTestsSettings() { return m_runTestsSettings; }
177
 
178
    wxWindowSettings& GetWindowSettings() { return m_windowSettings; }
179
 
180
public:
181
    bool                    m_showToolBar;
182
    wxRect                  m_frameSize;
183
    wxString                m_appName;     // The current name of the app...
184
    bool                    m_showSplashScreen; // Show the splash screen
185
    wxString                m_userName;
186
    int                     m_serialNumber;
187
    wxString                m_lastFilename; // So we can auto-generate sensible filenames
188
    int                     m_frameStatus;
189
 
190
        // Sash window sizes
191
        wxSize                                  m_treeSashSize;
192
        wxSize                                  m_conflictsSashSize;
193
        wxSize                                  m_propertiesSashSize;
194
        wxSize                                  m_shortDescrSashSize;
195
        wxSize                                  m_memorySashSize;
196
        wxSize                                  m_outputSashSize;
197
    int                     m_configPaneWidth; // The sash to the right of the tree
198
    bool                    m_showConflictsWindow;
199
    bool                    m_showPropertiesWindow;
200
    bool                    m_showShortDescrWindow;
201
    bool                    m_showMemoryWindow;
202
    bool                    m_showOutputWindow;
203
 
204
    // Are we showing macro names, or ordinary names?
205
    bool                    m_showMacroNames ;
206
 
207
    // Are we merely editing the .ecc file and not saving build trees?
208
    // This option is specified on the command line and not saved.
209
    bool                    m_editSaveFileOnly;
210
 
211
    // Viewers & browsers
212
    bool                    m_bUseCustomViewer;
213
    bool                    m_bUseExternalBrowser;
214
    wxString                m_strBrowser;
215
    ecFileName              m_strViewer;
216
    ecBrowserType           m_eUseCustomBrowser;
217
    static ecFileName       m_strDefaultExternalBrowser;
218
    bool                    m_bHex;
219
 
220
    ecFileName              m_userToolsDir;
221
    ecFileName              m_buildToolsDir; /* Only used if no other clues */
222
 
223
    wxString                m_strMakeOptions;
224
 
225
    wxStringToStringMap     m_arstrBinDirs;  // Not saved
226
    wxArrayString           m_userToolPaths; // Not saved
227
 
228
    ecFileName              m_strRepository; // This is saved/loaded via ecSettings, and
229
                                             // copied to/from ecConfigToolDoc on doc creation/deletion.
230
                                             // This is because the doc doesn't have its own profile loading/saving.
231
 
232
    enum {Never=0, Immediate=1, Deferred=2, SuggestFixes=4};
233
    int                     m_nRuleChecking; // OR of above values
234
 
235
    // Find dialog settings
236
    wxString                m_findText;
237
    bool                    m_findMatchWholeWord;
238
    bool                    m_findMatchCase;
239
    bool                    m_findDirection; // Down is TRUE, Up is FALSE
240
    wxString                m_findSearchWhat; // Macro names, item names etc.
241
    wxPoint                 m_findDialogPos; // Position of dialog
242
 
243
    // Run tests settings
244
    ecRunTestsSettings      m_runTestsSettings;
245
 
246
    // Font settings
247
    wxWindowSettings        m_windowSettings;
248
 
249
    // Packages dialog settings
250
    bool                    m_omitHardwarePackages;
251
    bool                    m_matchPackageNamesExactly;
252
};
253
 
254
#endif
255
        // _ECOS_APPSETTINGS_H_

powered by: WebSVN 2.1.0

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