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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [standalone/] [wxwin/] [configtool.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, 2005, 2008 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
// configtool.h :
23
//
24
//===========================================================================
25
//#####DESCRIPTIONBEGIN####
26
//
27
// Author(s):   julians
28
// Contact(s):  julians
29
// Date:        2000/08/24
30
// Version:     $Id: configtool.h,v 1.27 2001/10/11 12:31:42 julians Exp $
31
// Purpose:
32
// Description: main header file for the ConfigTool application
33
// Requires:
34
// Provides:
35
// See also:
36
// Known bugs:
37
// Usage:
38
//
39
//####DESCRIPTIONEND####
40
//
41
//===========================================================================
42
 
43
#ifndef _ECOS_CONFIGTOOL_H_
44
#define _ECOS_CONFIGTOOL_H_
45
 
46
#ifdef __GNUG__
47
#pragma interface "configtool.h"
48
#endif
49
 
50
#include "wx/wx.h"
51
#include "wx/help.h"
52
#include "wx/docview.h"
53
#include "wx/process.h"
54
#include "wx/timer.h"
55
#include "wx/gizmos/splittree.h"
56
 
57
#include "appsettings.h"
58
 
59
class ecValueWindow;
60
class ecMainFrame;
61
class ecConfigTreeCtrl;
62
class ecMemoryLayoutWindow;
63
class ecConfigToolDoc;
64
class ecSplashScreen;
65
class ecPipedProcess;
66
 
67
/*
68
#ifdef __WXMSW__
69
#include "wx/msw/helpchm.h"
70
#undef wxHelpController
71
#define wxHelpController wxCHMHelpController
72
#endif
73
*/
74
 
75
#if defined(__WXGTK__) || defined(__WXMSW__)
76
#include "wx/html/helpctrl.h"
77
#undef wxHelpController
78
#define wxHelpController wxHtmlHelpController
79
#endif
80
 
81
#ifdef __VISUALC__
82
#pragma warning(disable:4786)
83
#endif
84
 
85
#if defined(__WXMSW__) && defined(__WXDEBUG__)
86
// MLT code does not build yet so ecUSE_MLT is always 0
87
#define ecUSE_MLT   0
88
#else
89
#define ecUSE_MLT   0
90
#endif
91
 
92
// If 1, can optionally use non-standard wxHTML extension to set the base doc path
93
// If 0, NEVER uses relative paths.
94
#define ecDOCSYSTEM_USE_RELATIVE_URLS 1
95
 
96
#if defined(__WXMSW__) && defined(__WXDEBUG__)
97
#define ecUSE_EXPERIMENTAL_CODE 1
98
#endif
99
 
100
//class WXDLLEXPORT wxZipFSHandler;
101
#include "wx/fs_zip.h"
102
class WXDLLEXPORT wxFileSystem;
103
 
104
// Define a new application type, each program should derive a class from wxApp
105
class ecApp : public wxApp
106
{
107
    friend class ecMainFrame;
108
public:
109
//// Ctor & dtor
110
    ecApp();
111
    ~ecApp();
112
 
113
//// Operations
114
    virtual bool OnInit();
115
    virtual int OnExit();
116
 
117
    // Log to output window
118
    void Log(const wxString& msg);
119
 
120
    // Launch strFileName with the given viewer, or find a viewer if strViewer s empty
121
    bool Launch(const wxString & strFileName,const wxString &strViewer);
122
 
123
    // Under Unix, (*cmdLine) is set to the command string appropriate to setting up the variables
124
    // Under Windows, cmdLine isn't used
125
    bool PrepareEnvironment(bool bWithBuildTools = TRUE, wxString* cmdLine = NULL);
126
 
127
    // Fire off a subprocess to build the library or tests
128
    void Build(const wxString& strWhat = wxEmptyString) ;
129
 
130
    bool InitializeHelpController();
131
 
132
    void SetStatusText(const wxString& text, bool clearFailingRulesPane = TRUE);
133
 
134
//// Helpers
135
    // Check if there is a (unique) .ecc file in dir
136
    bool FindSaveFileInDir(const wxString& dir, wxString& saveFile);
137
 
138
    // Initialize window settings object
139
    bool InitializeWindowSettings(bool beforeWindowConstruction);
140
 
141
    // Load resources from disk
142
    bool LoadResources();
143
 
144
    // Load a bitmap resource from resource.bin
145
    bool LoadBitmapResource(wxBitmap& bitmap, const wxString& filename, int bitmapType, bool addToMemoryFS);
146
 
147
    // Load a text resource from resource.bin
148
    bool LoadTextResource(wxString& text, const wxString& filename, bool addToMemoryFS);
149
 
150
    // Get a text resource from the memory filesystem
151
    bool GetMemoryTextResource(const wxString& filename, wxString& text);
152
 
153
    // Version-stamp the splash screen
154
    bool VersionStampSplashScreen();
155
 
156
//// Accessors
157
 
158
    // Get settings
159
    ecSettings& GetSettings() { return m_settings; }
160
 
161
    // Get help controller
162
    wxHelpController& GetHelpController() { return * m_helpController; }
163
    bool HasHelpController() const { return (m_helpController != NULL); }
164
    void DestroyHelpController() { if (m_helpController) delete m_helpController; m_helpController = NULL; }
165
 
166
    // Get app dir
167
    wxString GetAppDir() const { return m_appDir; }
168
 
169
    // Prepend the current app program directory to the name
170
    wxString GetFullAppPath(const wxString& filename) const;
171
 
172
    // Are we running in 32K colours or more?
173
    bool GetHiColour() const;
174
 
175
    // Get main icon
176
    const wxIcon& GetMainIcon() const { return m_mainIcon; }
177
    void SetMainIcon(const wxIcon& icon) { m_mainIcon = icon; }
178
 
179
    // What's This? menu with single item
180
    wxMenu* GetWhatsThisMenu() const { return m_whatsThisMenu; }
181
 
182
    // Main frame
183
    ecMainFrame* GetMainFrame() const { return m_mainFrame; }
184
 
185
    // Config tree control
186
    ecConfigTreeCtrl* GetTreeCtrl() const ;
187
 
188
    // MLT window
189
    ecMemoryLayoutWindow* GetMLTWindow() const ;
190
 
191
    // Document manager
192
    wxDocManager* GetDocManager() const { return m_docManager; }
193
 
194
    // Get active document
195
    ecConfigToolDoc* GetConfigToolDoc() const;
196
 
197
    wxString GetHelpFile() const { return m_helpFile; }
198
    void SetHelpFile(const wxString& file) { m_helpFile = file; }
199
 
200
    wxFileSystem* GetFileSystem() const { return m_fileSystem; }
201
 
202
    // Lock out value changes while conflicts are being resolved, for example
203
    bool GetValuesLocked() { return (m_valuesLocked > 0); }
204
    void LockValues() { m_valuesLocked ++; }
205
    void UnlockValues() { m_valuesLocked --; wxASSERT( m_valuesLocked >= 0); }
206
 
207
//// Events
208
    void OnWhatsThis(wxCommandEvent& event);
209
    void OnProcessTerminated(wxProcess* process);
210
 
211
 
212
//// Data members
213
    ecSettings          m_settings;
214
    wxString            m_appDir;
215
    wxHelpController*   m_helpController;
216
    wxIcon              m_mainIcon; // Reuse in dialogs
217
    wxMenu*             m_whatsThisMenu;
218
    wxDocManager*       m_docManager;
219
    ecMainFrame*        m_mainFrame;
220
    static bool         sm_arMounted[26];
221
    int                 m_valuesLocked; // Lock values from being changed
222
 
223
public:
224
 
225
    ecSplashScreen*     m_splashScreen;
226
    wxString            m_strOriginalPath;
227
    ecConfigToolDoc*    m_currentDoc;
228
    wxString            m_helpFile;
229
    ecPipedProcess*     m_pipedProcess;
230
    wxBitmap            m_splashScreenBitmap;
231
    wxZipFSHandler*     m_zipHandler;
232
    wxFileSystem*       m_fileSystem;
233
 
234
DECLARE_EVENT_TABLE()
235
};
236
 
237
DECLARE_APP(ecApp);
238
 
239
/*
240
 * ecPingTimer
241
 * Just to force idle processing now and again while
242
 * the library or tests are building
243
 */
244
 
245
class ecPingTimer: public wxTimer
246
{
247
public:
248
    ecPingTimer() {}
249
 
250
    virtual void Notify() ;
251
};
252
 
253
/*
254
 * ecPipedProcess
255
 * For running builds and capturing the output
256
 */
257
 
258
class ecPipedProcess : public wxProcess
259
{
260
public:
261
    ecPipedProcess()
262
    {
263
        Redirect();
264
        m_pingTimer.Start(100);
265
        m_pid = 0;
266
    }
267
    ~ecPipedProcess()
268
    {
269
        m_pingTimer.Stop();
270
    }
271
 
272
//// Overrides
273
    virtual void OnTerminate(int pid, int status);
274
 
275
//// Operations
276
    virtual bool HasInput();
277
 
278
//// Accessors
279
    void SetPid(long pid) { m_pid = pid; }
280
    long GetPid() const { return m_pid; }
281
 
282
protected:
283
    ecPingTimer m_pingTimer;
284
    long        m_pid;
285
};
286
 
287
// IDs for the controls and the menu commands
288
 
289
//// Menus & tools
290
#define ecID_NEW_REGION                 2102
291
#define ecID_NEW_SECTION                2103
292
#define ecID_DELETE                     2104
293
#define ecID_PROPERTIES                 2105
294
 
295
// File menu
296
#define ecID_IMPORT                     2150
297
#define ecID_EXPORT                     2151
298
 
299
// Edit menu
300
#define ecID_SAVE_OUTPUT                2152
301
#define ecID_FIND_NEXT                  2153
302
 
303
// View menu
304
#define ecID_SETTINGS                   2162
305
#define ecID_TOOLBARS                   2163
306
#define ecID_TOOLBARS_STANDARD          2164
307
#define ecID_TOOLBARS_MEMORY            2165
308
#define ecID_VIEW_NEXT                  2166
309
#define ecID_VIEW_PREVIOUS              2167
310
#define ecID_TOGGLE_CONFLICTS           2168
311
#define ecID_TOGGLE_PROPERTIES          2169
312
#define ecID_TOGGLE_MEMORY              2170
313
#define ecID_TOGGLE_SHORT_DESCR         2171
314
#define ecID_TOGGLE_OUTPUT              2172
315
 
316
// Build menu
317
#define ecID_STOP_BUILD                 2180
318
#define ecID_BUILD_LIBRARY              2181
319
#define ecID_BUILD_TESTS                2182
320
#define ecID_CLEAN                      2183
321
#define ecID_BUILD_OPTIONS              2184
322
#define ecID_BUILD_REPOSITORY           2185
323
#define ecID_BUILD_TEMPLATES            2186
324
#define ecID_BUILD_PACKAGES             2187
325
#define ecID_GENERATE_BUILD_TREE        2188
326
 
327
// Tools menu
328
#define ecID_PATHS                      2200
329
#define ecID_PATHS_BUILD_TOOLS          2201
330
#define ecID_PATHS_USER_TOOLS           2202
331
#define ecID_SHELL                      2203
332
#define ecID_RUN_TESTS                  2204
333
#define ecID_PLATFORMS                  2205
334
#define ecID_RESOLVE_CONFLICTS          2206
335
#define ecID_ADMINISTRATION             2207
336
#define ecID_TOOLS_OPTIONS              2208
337
#define ecID_INDEX_DOCS                 2209
338
 
339
// Help menu
340
#define ecID_CONFIGTOOL_HELP            2220
341
#define ecID_ECOS_HELP                  2221
342
#define ecID_REDHAT_WEB                 2222
343
#define ecID_REDHAT_WEB_HOME            2223
344
#define ecID_REDHAT_WEB_ECOS            2224
345
#define ecID_REDHAT_WEB_NET_RELEASE     2225
346
#define ecID_REDHAT_WEB_UITRON          2226
347
#define ecID_CONTEXT_HELP               2227
348
#define ecID_REPOSITORY_INFO            2228
349
 
350
// Tree right-click menu
351
#define ecID_WHATS_THIS            2250
352
#define ecID_TREE_PROPERTIES            2251
353
#define ecID_TREE_RESTORE_DEFAULTS      2252
354
#define ecID_TREE_VISIT_DOC             2253
355
#define ecID_TREE_VIEW_HEADER           2254
356
#define ecID_TREE_UNLOAD_PACKAGE        2255
357
 
358
// Conflict window right-click menu
359
#define ecID_LOCATE_ITEM                2256
360
#define ecID_RESOLVE_ITEM               2257
361
 
362
//// Controls & windows
363
 
364
#define ecID_TREE_CTRL                  2000
365
#define ecID_SPLITTER_WINDOW            2001
366
#define ecID_VALUE_WINDOW               2002
367
#define ecID_MAIN_FRAME                 2003
368
#define ecID_SCROLLED_WINDOW            2004
369
#define ecID_TOOLBAR                    2005
370
 
371
#define ecID_CONFLICTS_WINDOW           2006
372
#define ecID_PROPERTIES_WINDOW          2007
373
#define ecID_MEMORY_WINDOW              2008
374
#define ecID_SHORT_DESCR_WINDOW         2009
375
#define ecID_OUTPUT_WINDOW              2010
376
 
377
#define ecID_CONFIG_SASH_WINDOW         2020
378
#define ecID_CONFLICTS_SASH_WINDOW      2021
379
#define ecID_PROPERTIES_SASH_WINDOW     2022
380
#define ecID_MEMORY_SASH_WINDOW         2023
381
#define ecID_SHORT_DESCR_SASH_WINDOW    2024
382
#define ecID_OUTPUT_SASH_WINDOW         2025
383
#define ecID_ABOUT_DIALOG               2026
384
#define ecID_ABOUT_DIALOG_HTML_WINDOW   2027
385
#define ecID_FIND_DIALOG                2028
386
 
387
// The control used to edit a config item value
388
#define ecID_ITEM_EDIT_WINDOW           2030
389
 
390
#define ecID_SETTINGS_DIALOG            2031
391
#define ecID_SETTINGS_NOTEBOOK          2032
392
#define ecID_SETTINGS_DISPLAY           2033
393
#define ecID_SETTINGS_VIEWER            2034
394
#define ecID_SETTINGS_PATH              2035
395
#define ecID_SETTINGS_CONFLICT_RESOLUTION 2036
396
#define ecID_SETTINGS_RUN               2037
397
 
398
#define ecID_SECTION_DIALOG             2040
399
#define ecID_SECTION_NOTEBOOK           2041
400
#define ecID_SECTION_GENERAL            2042
401
#define ecID_SECTION_RELOCATION         2043
402
#define ecID_SECTION_NOTE               2044
403
 
404
#define ecID_PLATFORM_EDITOR_DIALOG     2050
405
#define ecID_BUILD_OPTIONS_DIALOG       2051
406
#define ecID_PLATFORMS_DIALOG           2052
407
#define ecID_TEMPLATES_DIALOG           2053
408
#define ecID_ADMIN_DIALOG               2054
409
#define ecID_PACKAGES_DIALOG            2055
410
 
411
#define ecID_RUN_TESTS_DIALOG           2056
412
#define ecID_RUN_TESTS_NOTEBOOK         2057
413
#define ecID_RUN_TESTS_EXECUTABLES      2058
414
#define ecID_RUN_TESTS_OUTPUT           2059
415
#define ecID_RUN_TESTS_SUMMARY          2060
416
 
417
#define ecID_RUN_TESTS_RUN              2061
418
#define ecID_RUN_TESTS_PROPERTIES       2062
419
 
420
//#define ecID_RUN_TESTS_TEST_LIST        2062
421
//#define ecID_RUN_TESTS_SUMMARY_LIST     2063
422
//#define ecID_CONFIG_PROPERTIES_LIST     2064
423
 
424
#define ecID_CHOOSE_REPOSITORY_DIALOG   2070
425
#define ecID_CONFIG_PROPERTIES_DIALOG   2071
426
 
427
#define ecID_LICENSE_DIALOG             2080
428
#define ecID_LICENSE_TEXT               2081
429
 
430
#define ecID_FOLDER_DIALOG              2090
431
#define ecID_FOLDER_DIALOG_MSG          2091
432
#define ecID_FOLDER_DIALOG_BROWSE       2092
433
#define ecID_FOLDER_DIALOG_PATHS        2093
434
 
435
#define ecID_REPOS_DIALOG_HTML_WINDOW   2094
436
#define ecID_REPOS_DIALOG               2095
437
 
438
#define ecID_BUILD_TOOLS_DIALOG         2300
439
#define ecID_USER_TOOLS_DIALOG          2301
440
#define ecID_EDIT_STRING_DIALOG         2302
441
#define ecID_STRING_EDIT_TEXTCTRL       2303
442
 
443
#endif
444
        // _ECOS_CONFIGTOOL_H_

powered by: WebSVN 2.1.0

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