From f1ff18545a3e6283e64a91eff193d365af0c3372 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:17:12 +0000 Subject: [PATCH] Make more of AegisubApp's methods private Originally committed to SVN as r6049. --- aegisub/src/main.cpp | 5 +---- aegisub/src/main.h | 36 +++++++++++++++--------------------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index 2b77042e8..10eb47d6c 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -148,7 +148,7 @@ void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName) { #endif -/// @brief Handle wx assertions and redirct to the logging system. +/// @brief Handle wx assertions and redirect to the logging system. /// @param file File name /// @param line Line number /// @param func Function name @@ -193,9 +193,6 @@ bool AegisubApp::OnInit() { // Init icons. icon::icon_init(); - // Install assertion handler -// wxSetAssertHandler(wxAssertHandler); - const std::string conf_mru(StandardPaths::DecodePath("?user/mru.json")); config::mru = new agi::MRUManager(conf_mru, GET_DEFAULT_CONFIG(default_mru)); diff --git a/aegisub/src/main.h b/aegisub/src/main.h index 9e9cd0776..f50c4adea 100644 --- a/aegisub/src/main.h +++ b/aegisub/src/main.h @@ -81,7 +81,7 @@ namespace Automation4 { class AutoloadScriptManager; } /// Macro to subscribe to OptionValue changes #define OPT_SUB(x, ...) config::opt->Get(x)->Subscribe(__VA_ARGS__) -/// Macro to unsubscribe to OptionValue changes +/// Macro to unsubscribe from OptionValue changes #define OPT_UNSUB(x, ...) config::opt->Get(x)->Unsubscribe(__VA_ARGS__) /// Macro to get a path. @@ -105,8 +105,20 @@ class AegisubApp: public wxApp { agi::log::EmitSTDOUT *emit_stdout; #endif -public: + bool OnInit(); + int OnExit(); + int OnRun(); +#if !defined(_DEBUG) || defined(WITH_EXCEPTIONS) + void OnUnhandledException(); + void OnFatalException(); +#endif + + // This function wraps all event handler calls anywhere in the application and is + // our ticket to catch exceptions happening in event handlers. + void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const; + +public: /// DOCME AegisubLocale locale; @@ -116,30 +128,12 @@ public: /// DOCME Automation4::AutoloadScriptManager *global_scripts; - - /// @brief DOCME - /// @return - /// - static AegisubApp* Get() { return (AegisubApp*) wxTheApp; } - - bool OnInit(); - int OnExit(); - int OnRun(); + static AegisubApp* Get() { return (AegisubApp*)wxTheApp; } #ifdef __WXMAC__ // Apple events virtual void MacOpenFile(const wxString &filename); #endif - -#if !defined(_DEBUG) || defined(WITH_EXCEPTIONS) - void OnUnhandledException(); - void OnFatalException(); -#endif - - - // This function wraps all event handler calls anywhere in the application and is - // our ticket to catch exceptions happening in event handlers. - void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const; }; DECLARE_APP(AegisubApp)