~s-cecilio/lenmus/v5.3

« back to all changes in this revision

Viewing changes to include/lenmus_app.h

  • Committer: cecilios
  • Date: 2011-06-12 17:25:18 UTC
  • Revision ID: svn-v4:2587a929-2f0e-0410-ae78-fe6f687d5efe:branches/TRY-5.0:687
Initial update for v5.0 first working core using lomse

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------------------
 
2
//    LenMus Phonascus: The teacher of music
 
3
//    Copyright (c) 2002-2011 LenMus project
 
4
//
 
5
//    This program is free software; you can redistribute it and/or modify it under the
 
6
//    terms of the GNU General Public License as published by the Free Software Foundation,
 
7
//    either version 3 of the License, or (at your option) any later version.
 
8
//
 
9
//    This program is distributed in the hope that it will be useful, but WITHOUT ANY
 
10
//    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
11
//    PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
12
//
 
13
//    You should have received a copy of the GNU General Public License along with this
 
14
//    program. If not, see <http://www.gnu.org/licenses/>.
 
15
//
 
16
//    For any comment, suggestion or feature request, please contact the manager of
 
17
//    the project at cecilios@users.sourceforge.net
 
18
//
 
19
//---------------------------------------------------------------------------------------
 
20
 
 
21
#ifndef __LENMUS_APP_H__        //to avoid nested includes
 
22
#define __LENMUS_APP_H__
 
23
 
 
24
//lenmus
 
25
#include "lenmus_injectors.h"
 
26
 
 
27
//wxWidgets
 
28
#include <wx/wxprec.h>
 
29
#include <wx/app.h>
 
30
#include <wx/frame.h>
 
31
#include <wx/snglinst.h>
 
32
 
 
33
 
 
34
namespace lenmus
 
35
{
 
36
 
 
37
//forward declarations
 
38
class MainFrame;
 
39
class SplashFrame;
 
40
 
 
41
//---------------------------------------------------------------------------------------
 
42
// Define the application
 
43
class TheApp : public wxApp
 
44
{
 
45
protected:
 
46
    MainFrame* m_frame;
 
47
//    bool            m_fUseGui;
 
48
    wxSingleInstanceChecker*    m_pInstanceChecker;
 
49
//    lmDocManager*     m_pDocManager;
 
50
    wxLocale*           m_pLocale;          //locale we'll be using (user config)
 
51
    SplashFrame*        m_pSplash;
 
52
    ApplicationScope    m_appScope;
 
53
    long                m_nSplashStartTime;
 
54
    long                m_nSplashVisibleMilliseconds;
 
55
//    wxBitmap        m_background;       //background bitmap (user config)
 
56
 
 
57
public:
 
58
    TheApp();
 
59
 
 
60
    // event handlers
 
61
    bool OnInit();
 
62
    int OnExit();
 
63
//    void OnChangeLanguage(wxCommandEvent& WXUNUSED(event));
 
64
//
 
65
//    // Accessors
 
66
//    wxBitmap& GetBackgroundBitmap() const { return (wxBitmap&) m_background; }
 
67
//    wxString GetLanguageCanonicalName() { return m_pLocale->GetCanonicalName(); }
 
68
//    wxString GetLocaleName() { return m_pLocale->GetLocale(); }
 
69
//    wxString GetLocaleSysName() { return m_pLocale->GetSysName(); }
 
70
//    const wxString GetCurrentUser();
 
71
//
 
72
//      //overrides
 
73
//      virtual int FilterEvent(wxEvent& event);
 
74
//    virtual void OnFatalException();
 
75
//    virtual void OnInitCmdLine(wxCmdLineParser& parser);
 
76
//    virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
 
77
//
 
78
//    ApplicationScope& app_scope() { return m_appScope; }
 
79
//    LibraryScope& library_scope() { return m_appScope.library_scope(); }
 
80
 
 
81
private:
 
82
    bool do_application_setup();
 
83
    void do_application_cleanup();
 
84
    void create_paths_object();
 
85
    void load_user_preferences();
 
86
    void create_needed_folders_if_dont_exist();
 
87
 
 
88
    void get_main_window_placement(wxRect* frameRect, bool* fMaximized);
 
89
    void get_default_placement(wxRect* defRect);
 
90
//    wxString GetInstallerLanguage();
 
91
//    wxString ChooseLanguage(wxWindow *parent);
 
92
//    void SetUpLocale(wxString lang);
 
93
    SplashFrame* create_GUI(int milliseconds, bool fFirstTime);
 
94
//    void SendForensicLog(wxString& sLogFile, bool fHandlingCrash);
 
95
//    void ParseCommandLine();
 
96
//    void SetUpCurrentLanguage();
 
97
    void create_main_frame();
 
98
//    void wait_and_destroy_splash();
 
99
    void show_welcome_window();
 
100
//    void RecoverScoreIfPreviousCrash();
 
101
//    void CheckForUpdates();
 
102
    void configure_midi();
 
103
//    void CreateDocumentManager();
 
104
//    void CreateDocumentTemplates();
 
105
//    void InitializeXrcResources();
 
106
//    void DefineTraceMasks();
 
107
//    void OpenDataBase();
 
108
//
 
109
//
 
110
//    DECLARE_EVENT_TABLE()
 
111
 
 
112
};
 
113
 
 
114
 
 
115
 
 
116
}   // namespace lenmus
 
117
 
 
118
#endif    // __LENMUS_APP_H__
 
119