Index: src/ch/ch.h =================================================================== diff -u -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae -r6f8b891b60eb0f33199fd29db75d4d9f4a22c248 --- src/ch/ch.h (.../ch.h) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae) +++ src/ch/ch.h (.../ch.h) (revision 6f8b891b60eb0f33199fd29db75d4d9f4a22c248) @@ -19,39 +19,36 @@ #ifndef __COPYHANDLER_H__ #define __COPYHANDLER_H__ -#include "resource.h" // main symbols #include "AppHelper.h" -#include "CfgProperties.h" #include "../libictranslate/ResourceManager.h" #include "../libchcore/TConfig.h" #include "TShellExtensionClient.h" #include "TCommandLineParser.h" +#include "../common/TLogger.h" +#include "../common/TLoggerInitializer.h" +#include "../libchcore/TCoreEngine.h" -///////////////////////////////////////////////////////////////////////////// -// CCopyHandlerApp: -// See CopyHandler.cpp for the implementation of this class -// - class CCopyHandlerApp : public CWinApp, public CAppHelper { public: CCopyHandlerApp(); ~CCopyHandlerApp(); - virtual BOOL InitInstance(); - virtual int ExitInstance(); + virtual BOOL InitInstance() override; + virtual int ExitInstance() override; - virtual void HtmlHelp(DWORD_PTR dwData, UINT nCmd); + virtual void HtmlHelp(DWORD_PTR dwData, UINT nCmd) override; PCTSTR GetHelpPath() const { return m_pszHelpFilePath; }; friend int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); - friend LRESULT MainRouter(ULONGLONG ullDst, UINT uiMsg, WPARAM wParam, LPARAM lParam); - friend CCopyHandlerApp& GetApp(); - friend ictranslate::CResourceManager& GetResManager(); - friend chcore::TConfig& GetConfig(); + friend CCopyHandlerApp& GetApplication(); + static ictranslate::CResourceManager& GetResManager(); + static chcore::TConfig& GetConfig(); + TLogger& GetLogger(); + void RegisterShellExtension(); void UnregisterShellExtension(); @@ -71,9 +68,33 @@ TShellExtensionClient m_tShellExtClient; TCommandLineParser m_cmdLineParser; + chcore::TCoreEngine m_chEngine; + TLoggerInitializer m_logInitializer; + TLogger m_log; + CWnd *m_pMainWindow; DECLARE_MESSAGE_MAP() }; +inline CCopyHandlerApp& GetApp() +{ + return GetApplication(); +} + +inline TLogger& GetLogger() +{ + return GetApp().GetLogger(); +} + +inline ictranslate::CResourceManager& GetResManager() +{ + return CCopyHandlerApp::GetResManager(); +} + +inline chcore::TConfig& GetConfig() +{ + return CCopyHandlerApp::GetConfig(); +} + #endif