OSDN Git Service

Rename m_nApplicationID m_nAppID and rename m_szCurrentApplication
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Tue, 12 Jul 2011 08:11:37 +0000 (17:11 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Wed, 13 Jul 2011 05:28:30 +0000 (14:28 +0900)
m_appName.

xkeymacs/properties.cpp
xkeymacs/properties.h
xkeymacs/propertiesadvanced.cpp
xkeymacs/propertiesadvanced.h
xkeymacsdll/xkeymacsdll.cpp
xkeymacsdll/xkeymacsdll.h

index 2dfdff4..2a77e41 100644 (file)
@@ -19,7 +19,7 @@ static char THIS_FILE[] = __FILE__;
 CProperties::CProperties(CWnd* pParent /*=NULL*/)\r
        : CDialog(CProperties::IDD, pParent)\r
 {\r
-       m_nApplicationID = 0;\r
+       m_nAppID = 0;\r
        //{{AFX_DATA_INIT(CProperties)\r
        m_nSettingStyle = -1;\r
        m_nKillRingMax = 0;\r
@@ -89,7 +89,7 @@ BOOL CProperties::OnInitDialog()
        InitApplicationList();\r
 \r
        CProfile::LoadData();\r
-       m_szCurrentApplication.LoadString(IDS_DEFAULT);\r
+       m_appName.LoadString(IDS_DEFAULT);\r
        SetDialogData();\r
        EnableUseDefaultButton(FALSE);\r
        EnableLoadDefaultButton(FALSE);\r
@@ -109,8 +109,8 @@ void CProperties::OnDropdownApplication()
                m_cApplication.SetCurSel(nID);\r
        } else {\r
                GetDialogData();\r
-               m_szCurrentApplication.LoadString(IDS_DEFAULT_TITLE);\r
-               m_cApplication.SelectString(-1, m_szCurrentApplication);\r
+               m_appName.LoadString(IDS_DEFAULT_TITLE);\r
+               m_cApplication.SelectString(-1, m_appName);\r
                SetDialogData();\r
        }\r
 }\r
@@ -119,12 +119,12 @@ void CProperties::OnSelchangeApplication()
 {\r
        GetDialogData();\r
 \r
-       CProfile::GetApplicationTitle(&m_cApplication, m_szCurrentApplication, m_cApplication.GetCurSel());\r
+       CProfile::GetApplicationTitle(&m_cApplication, m_appName, m_cApplication.GetCurSel());\r
        int nStart;\r
-       if ((nStart = m_szCurrentApplication.ReverseFind(_T('('))) != -1) {\r
+       if ((nStart = m_appName.ReverseFind(_T('('))) != -1) {\r
                ++nStart;\r
-               m_szCurrentApplication =\r
-                       m_szCurrentApplication.Mid(nStart, m_szCurrentApplication.GetLength() - nStart - 1);\r
+               m_appName =\r
+                       m_appName.Mid(nStart, m_appName.GetLength() - nStart - 1);\r
        }\r
 \r
        SetDialogData();\r
@@ -138,24 +138,24 @@ void CProperties::InitApplicationList()
 \r
 int CProperties::GetCurrentApplicationID()\r
 {\r
-       return CProfile::GetCurrentApplicationID(&m_cApplication, m_szCurrentApplication);\r
+       return CProfile::GetCurrentApplicationID(&m_cApplication, m_appName);\r
 }\r
 \r
 void CProperties::GetDialogData()\r
 {\r
        UpdateData();\r
        if (m_nSettingStyle == SETTING_DEFAULT) {\r
-               CProfile::ClearData(m_szCurrentApplication);\r
+               CProfile::ClearData(m_appName);\r
                return;\r
        }\r
-       m_nApplicationID = CProfile::AssignAppID(m_szCurrentApplication);\r
-       CProfile::SetSettingStyle(m_nApplicationID, m_nSettingStyle);\r
-       CProfile::UpdateApplicationTitle(&m_cApplication, m_szCurrentApplication, m_nApplicationID, TRUE);\r
-       CProfile::SetKillRingMax(m_nApplicationID, m_nKillRingMax);\r
-       CProfile::SetUseDialogSetting(m_nApplicationID, m_cUseDialogSetting.GetCheck() == BST_CHECKED);\r
+       m_nAppID = CProfile::AssignAppID(m_appName);\r
+       CProfile::SetSettingStyle(m_nAppID, m_nSettingStyle);\r
+       CProfile::UpdateApplicationTitle(&m_cApplication, m_appName, m_nAppID, TRUE);\r
+       CProfile::SetKillRingMax(m_nAppID, m_nKillRingMax);\r
+       CProfile::SetUseDialogSetting(m_nAppID, m_cUseDialogSetting.GetCheck() == BST_CHECKED);\r
        CString szWindowText;\r
        m_cWindowText.GetWindowText(szWindowText);\r
-       CProfile::SetWindowText(m_nApplicationID, szWindowText);\r
+       CProfile::SetWindowText(m_nAppID, szWindowText);\r
 \r
        if (m_sheet.GetActivePage() == &m_basic) // FIXME\r
                m_basic.GetDialogData();\r
@@ -167,15 +167,15 @@ void CProperties::GetDialogData()
 \r
 void CProperties::SetDialogData()\r
 {\r
-       m_nApplicationID = CProfile::GetAppID(m_szCurrentApplication);\r
-       m_nSettingStyle = CProfile::GetSettingStyle(m_nApplicationID);\r
-       if (m_nApplicationID == MAX_APP)\r
-               m_nApplicationID = CProfile::DefaultAppID(); // fall back to the default\r
-       EnableUseDefaultButton(!CProfile::IsDefault(m_szCurrentApplication) && !CProfile::IsDialog(m_szCurrentApplication));\r
-       CProfile::UpdateApplicationTitle(&m_cApplication, m_szCurrentApplication, m_nApplicationID, FALSE);\r
-       m_nKillRingMax = CProfile::GetKillRingMax(m_nApplicationID);\r
-       m_cUseDialogSetting.SetCheck(CProfile::GetUseDialogSetting(m_nApplicationID) ? BST_CHECKED : BST_UNCHECKED);\r
-       m_cWindowText.SetWindowText(CProfile::GetWindowText(m_nApplicationID));\r
+       m_nAppID = CProfile::GetAppID(m_appName);\r
+       m_nSettingStyle = CProfile::GetSettingStyle(m_nAppID);\r
+       if (m_nAppID == MAX_APP)\r
+               m_nAppID = CProfile::DefaultAppID(); // fall back to the default\r
+       EnableUseDefaultButton(!CProfile::IsDefault(m_appName) && !CProfile::IsDialog(m_appName));\r
+       CProfile::UpdateApplicationTitle(&m_cApplication, m_appName, m_nAppID, FALSE);\r
+       m_nKillRingMax = CProfile::GetKillRingMax(m_nAppID);\r
+       m_cUseDialogSetting.SetCheck(CProfile::GetUseDialogSetting(m_nAppID) ? BST_CHECKED : BST_UNCHECKED);\r
+       m_cWindowText.SetWindowText(CProfile::GetWindowText(m_nAppID));\r
        UpdateData(FALSE);\r
 \r
        if (m_sheet.GetActivePage() == &m_basic) // FIXME\r
@@ -224,7 +224,7 @@ void CProperties::EnableControl(TAB_NAME tab)
 void CProperties::EnableUseDialogSettingButton(BOOL bEnable)\r
 {\r
        m_cUseDialogSetting.EnableWindow(bEnable);\r
-       if (CProfile::IsDialog(m_szCurrentApplication)) {\r
+       if (CProfile::IsDialog(m_appName)) {\r
                m_cUseDialogSetting.EnableWindow(FALSE);\r
        }\r
 }\r
@@ -232,7 +232,7 @@ void CProperties::EnableUseDialogSettingButton(BOOL bEnable)
 void CProperties::EnableLoadDefaultButton(BOOL bEnable)\r
 {\r
        m_cLoadDefault.EnableWindow(bEnable);\r
-       if (CProfile::IsDefault(m_szCurrentApplication)) {\r
+       if (CProfile::IsDefault(m_appName)) {\r
                m_cLoadDefault.EnableWindow(FALSE);\r
        }\r
 }\r
@@ -266,7 +266,7 @@ void CProperties::OnApply()
 \r
 void CProperties::OnLoadDefault() \r
 {\r
-       CProfile::CopyData(m_szCurrentApplication, CString(MAKEINTRESOURCE(IDS_DEFAULT)));\r
+       CProfile::CopyData(m_appName, CString(MAKEINTRESOURCE(IDS_DEFAULT)));\r
        SetDialogData();\r
 }\r
 \r
@@ -282,12 +282,12 @@ void CProperties::OnClearAll()
 \r
 int CProperties::GetApplicationID()\r
 {\r
-       return m_nApplicationID;\r
+       return m_nAppID;\r
 }\r
 \r
 CString CProperties::GetCurrentApplication()\r
 {\r
-       return m_szCurrentApplication;\r
+       return m_appName;\r
 }\r
 \r
 void CProperties::OnSettingDefault() \r
@@ -307,8 +307,8 @@ void CProperties::OnSettingSpecific()
        UpdateData();\r
        EnableControl(ACTIVE_TAB);\r
 \r
-       if (CProfile::GetAppID(m_szCurrentApplication) == MAX_APP) {\r
-               CProfile::CopyData(m_szCurrentApplication, CString(MAKEINTRESOURCE(IDS_DEFAULT)));\r
+       if (CProfile::GetAppID(m_appName) == MAX_APP) {\r
+               CProfile::CopyData(m_appName, CString(MAKEINTRESOURCE(IDS_DEFAULT)));\r
                SetDialogData();\r
        }\r
 }\r
index 67c6881..3cec7f1 100644 (file)
@@ -68,12 +68,12 @@ protected:
        //}}AFX_MSG\r
        DECLARE_MESSAGE_MAP()\r
 private:\r
-       int m_nApplicationID;\r
+       int m_nAppID;\r
        CPropertiesList m_list;\r
        CPropertiesAdvanced m_advanced;\r
        CPropertiesBasic m_basic;\r
        CPropertySheet m_sheet;\r
-       CString m_szCurrentApplication;\r
+       CString m_appName;\r
        void EnableLoadDefaultButton(BOOL bEnable);\r
        void EnableUseDefaultButton(BOOL bEnable);\r
        void EnableUseDialogSettingButton(BOOL bEnable);\r
index 13dddd5..10015e8 100644 (file)
@@ -16,7 +16,7 @@ static char THIS_FILE[] = __FILE__;
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 // CPropertiesAdvanced property page\r
-int    CPropertiesAdvanced::m_nApplicationID = 0;\r
+int    CPropertiesAdvanced::m_nAppID = 0;\r
 int CPropertiesAdvanced::m_nCommandID = 0;\r
 CEdit * CPropertiesAdvanced::m_pNewKey = NULL;\r
 CButton * CPropertiesAdvanced::m_pAssign = NULL;\r
@@ -91,11 +91,11 @@ BOOL CPropertiesAdvanced::OnSetActive()
 \r
 void CPropertiesAdvanced::SetDialogData()\r
 {\r
-       m_nApplicationID = m_pProperties->GetApplicationID();\r
-       if (m_nApplicationID == MAX_APP)\r
+       m_nAppID = m_pProperties->GetApplicationID();\r
+       if (m_nAppID == MAX_APP)\r
                return;\r
        InitCommandIDs();\r
-       m_bEnableCUA = CProfile::GetEnableCUA(m_nApplicationID);\r
+       m_bEnableCUA = CProfile::GetEnableCUA(m_nAppID);\r
        SetCurrentKeys();\r
        UpdateData(FALSE);\r
 }\r
@@ -140,7 +140,7 @@ BOOL CPropertiesAdvanced::OnInitDialog()
 {\r
        CPropertyPage::OnInitDialog();\r
 \r
-       m_nApplicationID = m_pProperties->GetApplicationID();\r
+       m_nAppID = m_pProperties->GetApplicationID();\r
        InitCategoryList();\r
        SetCommands();\r
 \r
@@ -259,7 +259,7 @@ void CPropertiesAdvanced::SetCurrentKeys()
        if (szCategory.Compare(CString(MAKEINTRESOURCE(IDS_ORIGINAL)))) {\r
                for (int nType = 0; nType < MAX_COMMAND_TYPE; ++nType) {\r
                        for (int nKey = 0; nKey < MAX_KEY; ++nKey) {\r
-                               if (CCommands::GetCommandName(CProfile::GetCommandID(m_nApplicationID, nType, nKey)) == szCurrentCommandName) {\r
+                               if (CCommands::GetCommandName(CProfile::GetCommandID(m_nAppID, nType, nKey)) == szCurrentCommandName) {\r
                                        CString sz;\r
                                        sz.Format(_T("%s%s"), CProfile::CommandType2String(nType), CProfile::Key2String(nKey));\r
                                        m_cCurrentKeys.AddString(sz);\r
@@ -290,10 +290,10 @@ void CPropertiesAdvanced::SetCurrentKeys()
                }\r
        } else {\r
                const int nIndex = CDotXkeymacs::GetIndex(szCurrentCommandName);\r
-               for (int nKeyID = 0; nKeyID < CDotXkeymacs::GetKeyNumber(nIndex, m_nApplicationID); ++nKeyID) {\r
+               for (int nKeyID = 0; nKeyID < CDotXkeymacs::GetKeyNumber(nIndex, m_nAppID); ++nKeyID) {\r
                        int nType = 0;\r
                        int nKey = 0;\r
-                       CDotXkeymacs::GetKey(nIndex, m_nApplicationID, nKeyID, &nType, &nKey);\r
+                       CDotXkeymacs::GetKey(nIndex, m_nAppID, nKeyID, &nType, &nKey);\r
 \r
                        CString sz;\r
                        sz.Format(_T("%s%s"), CProfile::CommandType2String(nType), CProfile::Key2String(nKey));\r
@@ -351,9 +351,9 @@ void CPropertiesAdvanced::OnSetfocusNewKey()
 void CPropertiesAdvanced::OnAssign() \r
 {\r
        // Remove Current Setting\r
-       CProfile::SetCommandID(m_nApplicationID, m_nAssignCommandType, m_nAssignKey, 0);\r
+       CProfile::SetCommandID(m_nAppID, m_nAssignCommandType, m_nAssignKey, 0);\r
        SetCommandID(m_nAssignCommandType, m_nAssignKey, 0);\r
-       CDotXkeymacs::RemoveKey(m_nApplicationID, m_nAssignCommandType, m_nAssignKey);\r
+       CDotXkeymacs::RemoveKey(m_nAppID, m_nAssignCommandType, m_nAssignKey);\r
 \r
        // Assign New Setting\r
        CString szItem;\r
@@ -363,12 +363,12 @@ void CPropertiesAdvanced::OnAssign()
                m_cCategory.GetLBText(m_cCategory.GetCurSel(), szCategory);\r
 \r
                if (szCategory.Compare(CString(MAKEINTRESOURCE(IDS_ORIGINAL)))) {\r
-                       CProfile::SetCommandID(m_nApplicationID, m_nAssignCommandType, m_nAssignKey, m_nCommandID);\r
+                       CProfile::SetCommandID(m_nAppID, m_nAssignCommandType, m_nAssignKey, m_nCommandID);\r
                        SetCommandID(m_nAssignCommandType, m_nAssignKey, m_nCommandID);\r
                } else {\r
                        CString szCurrentCommandName;\r
                        m_cCommands.GetText(m_cCommands.GetCurSel(), szCurrentCommandName);\r
-                       CDotXkeymacs::SetKey(CDotXkeymacs::GetIndex(szCurrentCommandName), m_nApplicationID, m_nAssignCommandType, m_nAssignKey);\r
+                       CDotXkeymacs::SetKey(CDotXkeymacs::GetIndex(szCurrentCommandName), m_nAppID, m_nAssignCommandType, m_nAssignKey);\r
                }\r
                m_cCurrentKeys.AddString(szItem);\r
        }\r
@@ -382,12 +382,12 @@ void CPropertiesAdvanced::OnRemove()
        m_cCategory.GetLBText(m_cCategory.GetCurSel(), szCategory);\r
 \r
        if (szCategory.Compare(CString(MAKEINTRESOURCE(IDS_ORIGINAL)))) {\r
-               CProfile::SetCommandID(m_nApplicationID, m_nRemoveCommandType, m_nRemoveKey, 0);\r
+               CProfile::SetCommandID(m_nAppID, m_nRemoveCommandType, m_nRemoveKey, 0);\r
                SetCommandID(m_nRemoveCommandType, m_nRemoveKey, 0);\r
        } else {\r
                CString szCurrentCommandName;\r
                m_cCommands.GetText(m_cCommands.GetCurSel(), szCurrentCommandName);\r
-               CDotXkeymacs::RemoveKey(CDotXkeymacs::GetIndex(szCurrentCommandName), m_nApplicationID, m_nRemoveCommandType, m_nRemoveKey);\r
+               CDotXkeymacs::RemoveKey(CDotXkeymacs::GetIndex(szCurrentCommandName), m_nAppID, m_nRemoveCommandType, m_nRemoveKey);\r
        }\r
 \r
        m_cCurrentKeys.DeleteString(m_cCurrentKeys.GetCurSel());\r
@@ -493,10 +493,10 @@ void CPropertiesAdvanced::SetNewKey()
        if (m_pCurrentlyAssigned) {\r
                CString szCurrentlyAssigned(_T("Currently assigned to:\n"));\r
 \r
-               if (m_nCommandIDs[m_nAssignCommandType][m_nAssignKey] || CDotXkeymacs::GetIndex(m_nApplicationID, m_nAssignCommandType, m_nAssignKey) == -1) {\r
+               if (m_nCommandIDs[m_nAssignCommandType][m_nAssignKey] || CDotXkeymacs::GetIndex(m_nAppID, m_nAssignCommandType, m_nAssignKey) == -1) {\r
                        szCurrentlyAssigned += CCommands::GetCommandName(m_nCommandIDs[m_nAssignCommandType][m_nAssignKey]);\r
                } else {\r
-                       szCurrentlyAssigned += CDotXkeymacs::GetFunctionSymbol(CDotXkeymacs::GetIndex(m_nApplicationID, m_nAssignCommandType, m_nAssignKey));\r
+                       szCurrentlyAssigned += CDotXkeymacs::GetFunctionSymbol(CDotXkeymacs::GetIndex(m_nAppID, m_nAssignCommandType, m_nAssignKey));\r
                }\r
                m_pCurrentlyAssigned->SetWindowText(szCurrentlyAssigned);\r
        }\r
@@ -539,7 +539,7 @@ void CPropertiesAdvanced::InitCommandIDs()
 {\r
        for (int nType = 0; nType < MAX_COMMAND_TYPE; ++nType) {\r
                for (int nKey = 0; nKey < MAX_KEY; ++nKey) {\r
-                       SetCommandID(nType, nKey, CProfile::GetCommandID(m_nApplicationID, nType, nKey));\r
+                       SetCommandID(nType, nKey, CProfile::GetCommandID(m_nAppID, nType, nKey));\r
                }\r
        }\r
 }\r
@@ -563,7 +563,7 @@ void CPropertiesAdvanced::OnKillfocusNewKey()
 void CPropertiesAdvanced::OnEnableCua() \r
 {\r
        UpdateData();\r
-       CProfile::SetEnableCUA(m_nApplicationID, m_bEnableCUA);\r
+       CProfile::SetEnableCUA(m_nAppID, m_bEnableCUA);\r
 }\r
 \r
 BOOL CPropertiesAdvanced::IsCtrlDown()\r
index 2bf1374..168a20b 100644 (file)
@@ -67,7 +67,7 @@ protected:
        //}}AFX_MSG\r
        DECLARE_MESSAGE_MAP()\r
 private:\r
-       static int m_nApplicationID;\r
+       static int m_nAppID;\r
        static BOOL IsFooDown(CString szCommandName);\r
        static BOOL IsShiftDown();\r
        static BOOL IsMetaDown();\r
index 3445ed1..441863d 100644 (file)
@@ -239,7 +239,7 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
        CList<CClipboardSnap *, CClipboardSnap *> CXkeymacsDll::m_oKillRing;\r
        int             CXkeymacsDll::m_nKillRing = 0;\r
        int             CXkeymacsDll::m_nOriginal[MAX_COMMAND_TYPE][MAX_KEY] = {'\0'};\r
-       int             CXkeymacsDll::m_nApplicationID = 0;\r
+       int             CXkeymacsDll::m_nAppID = 0;\r
        int             CXkeymacsDll::m_nAccelerate = 0;\r
        int             CXkeymacsDll::m_nKeyboardSpeed = 31;\r
        HCURSOR CXkeymacsDll::m_hCursor[MAX_STATUS] = {'\0'};\r
@@ -347,8 +347,8 @@ void CXkeymacsDll::ShowKeyboardHookState()
        } else {\r
                msg.nState = STATUS_DISABLE_WOCQ;\r
        }\r
-       if (m_Config.nSettingStyle[m_nApplicationID] == SETTING_DISABLE\r
-        || (!_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Default"))\r
+       if (m_Config.nSettingStyle[m_nAppID] == SETTING_DISABLE\r
+        || (!_tcsicmp(m_Config.szSpecialApp[m_nAppID], _T("Default"))\r
          && CUtils::IsDefaultIgnoreApplication())) {\r
                msg.nState = STATUS_DISABLE;\r
                m_hCurrentCursor = m_hCursor[STATUS_DISABLE];\r
@@ -569,30 +569,30 @@ void CXkeymacsDll::Kdu(BYTE bVk, DWORD n, BOOL bOriginal)
 void CXkeymacsDll::InitKeyboardProc(BOOL bImeComposition)\r
 {\r
        CUtils::SetApplicationName(bImeComposition);\r
-       if (_tcsnicmp(m_Config.szSpecialApp[m_nApplicationID], CUtils::GetApplicationName(), 0xF) || !IsMatchWindowText(m_Config.szWindowText[m_nApplicationID])) {     // PROCESSENTRY32 has only 0xF bytes of Name\r
-               m_nApplicationID = -1;\r
+       if (_tcsnicmp(m_Config.szSpecialApp[m_nAppID], CUtils::GetApplicationName(), 0xF) || !IsMatchWindowText(m_Config.szWindowText[m_nAppID])) {     // PROCESSENTRY32 has only 0xF bytes of Name\r
+               m_nAppID = -1;\r
                for (int nAppID = 0; nAppID < MAX_APP; ++nAppID) {\r
                        if (_tcsnicmp(m_Config.szSpecialApp[nAppID], CUtils::GetApplicationName(), 0xF) || !IsMatchWindowText(m_Config.szWindowText[nAppID]))\r
                                continue;\r
-                       if (m_nApplicationID < 0)\r
-                               m_nApplicationID = nAppID;\r
+                       if (m_nAppID < 0)\r
+                               m_nAppID = nAppID;\r
                        else {\r
-                               const LPCSTR curText = m_Config.szWindowText[m_nApplicationID];\r
+                               const LPCSTR curText = m_Config.szWindowText[m_nAppID];\r
                                const LPCSTR newText = m_Config.szWindowText[nAppID];\r
                                const int curType = CUtils::GetWindowTextType(curText);\r
                                const int newType = CUtils::GetWindowTextType(newText);\r
                                if (curType < newType || curType == newType && _tcscmp(curText, newText) <= 0)\r
-                                       m_nApplicationID = nAppID;\r
+                                       m_nAppID = nAppID;\r
                        }\r
                }\r
-               if (m_nApplicationID < 0)\r
-                       m_nApplicationID = GetAppID(_T("Default"), 0);\r
+               if (m_nAppID < 0)\r
+                       m_nAppID = GetAppID(_T("Default"), 0);\r
        }\r
-       if (m_Config.nSettingStyle[m_nApplicationID] != SETTING_DISABLE &&\r
-                       (_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Default")) || !CUtils::IsDefaultIgnoreApplication()) &&\r
-                       !bImeComposition && CUtils::IsDialog() && m_Config.bUseDialogSetting[m_nApplicationID])\r
+       if (m_Config.nSettingStyle[m_nAppID] != SETTING_DISABLE &&\r
+                       (_tcsicmp(m_Config.szSpecialApp[m_nAppID], _T("Default")) || !CUtils::IsDefaultIgnoreApplication()) &&\r
+                       !bImeComposition && CUtils::IsDialog() && m_Config.bUseDialogSetting[m_nAppID])\r
                // Use Dialog Setting\r
-               m_nApplicationID = GetAppID(_T("Dialog"), m_nApplicationID);\r
+               m_nAppID = GetAppID(_T("Dialog"), m_nAppID);\r
 \r
        ICONMSG msg[3] = {\r
                {CX_ICON, OFF_ICON, ""},\r
@@ -657,8 +657,8 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
                break;\r
        }\r
 \r
-#define fCommand(type) (Commands[m_Config.nCommandID[m_nApplicationID][(type)][nKey]].fCommand)\r
-#define nFunctionID (m_Config.nFunctionID[m_nApplicationID][nType][nKey])\r
+#define fCommand(type) (Commands[m_Config.nCommandID[m_nAppID][(type)][nKey]].fCommand)\r
+#define nFunctionID (m_Config.nFunctionID[m_nAppID][nType][nKey])\r
 \r
        if (bRelease) {\r
                switch (nOrigKey) {\r
@@ -691,11 +691,11 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
                goto DO_NOTHING;\r
        }\r
 \r
-       if (m_Config.nSettingStyle[m_nApplicationID] == SETTING_DISABLE)\r
+       if (m_Config.nSettingStyle[m_nAppID] == SETTING_DISABLE)\r
                goto DO_NOTHING;\r
 \r
        // Do Nothing for Meadow, Mule for Win32, ... if those use default setting.\r
-       if (!_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Default")) && CUtils::IsDefaultIgnoreApplication())\r
+       if (!_tcsicmp(m_Config.szSpecialApp[m_nAppID], _T("Default")) && CUtils::IsDefaultIgnoreApplication())\r
                goto DO_NOTHING;\r
 \r
        switch (IsPassThrough(nKey)) {\r
@@ -711,7 +711,7 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
        int nType = IsDown(VK_SHIFT) * SHIFT | IsControl() * CONTROL | IsMeta() * META | CCommands::bC_x() * CONTROLX;\r
        // Ignore undefined C-x ?\r
        if (nType & CONTROLX && fCommand(nType) == NULL && nFunctionID < 0) {\r
-               if (m_Config.bIgnoreUndefinedC_x[m_nApplicationID]) {\r
+               if (m_Config.bIgnoreUndefinedC_x[m_nAppID]) {\r
                        CCommands::Reset(GOTO_HOOK);\r
                        goto HOOK;\r
                }\r
@@ -719,7 +719,7 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
        }\r
        // Ignore undefined Meta Ctrl+?\r
        if (CCommands::bM_() && nType & CONTROL && fCommand(nType) == NULL && nFunctionID < 0) {\r
-               if (m_Config.bIgnoreUndefinedMetaCtrl[m_nApplicationID]) {\r
+               if (m_Config.bIgnoreUndefinedMetaCtrl[m_nAppID]) {\r
                        if (CheckOriginal(CONTROL, nKey))\r
                                goto DO_NOTHING;\r
                        CCommands::Reset(GOTO_HOOK);\r
@@ -980,7 +980,7 @@ BOOL CXkeymacsDll::IsDepressedModifier(int (__cdecl *Modifier)(void), BOOL bPhys
        BYTE bVk = 0;\r
        do {\r
                if (IsValidKey(bVk) && IsDown(bVk, bPhysicalKey) &&\r
-                               Commands[m_Config.nCommandID[m_nApplicationID][NONE][bVk]].fCommand == Modifier)\r
+                               Commands[m_Config.nCommandID[m_nAppID][NONE][bVk]].fCommand == Modifier)\r
                        return TRUE;\r
        } while (++bVk);\r
        return FALSE;\r
@@ -1021,7 +1021,7 @@ BOOL CXkeymacsDll::IsMeta()
 \r
 void CXkeymacsDll::AddKillRing(BOOL bNewData)\r
 {\r
-       if (m_Config.nKillRingMax[m_nApplicationID] == 0) {\r
+       if (m_Config.nKillRingMax[m_nAppID] == 0) {\r
                return;\r
        }\r
 \r
@@ -1052,7 +1052,7 @@ void CXkeymacsDll::AddKillRing(BOOL bNewData)
 \r
        m_nKillRing = 0;\r
 \r
-       if (m_Config.nKillRingMax[m_nApplicationID] < m_oKillRing.GetCount()) {\r
+       if (m_Config.nKillRingMax[m_nAppID] < m_oKillRing.GetCount()) {\r
                CClipboardSnap *pSnap = m_oKillRing.GetTail();\r
                delete pSnap;\r
                pSnap = NULL;\r
@@ -1064,7 +1064,7 @@ void CXkeymacsDll::AddKillRing(BOOL bNewData)
 // Return FALSE if there is no more data\r
 CClipboardSnap* CXkeymacsDll::GetKillRing(CClipboardSnap* pSnap, BOOL bForce)\r
 {\r
-       if (m_Config.nKillRingMax[m_nApplicationID] == 0) {\r
+       if (m_Config.nKillRingMax[m_nAppID] == 0) {\r
                return NULL;\r
        }\r
 \r
@@ -1118,7 +1118,7 @@ void CXkeymacsDll::IncreaseKillRingIndex(int nKillRing)
 \r
 BOOL CXkeymacsDll::GetEnableCUA()\r
 {\r
-       return m_Config.bEnableCUA[m_nApplicationID];\r
+       return m_Config.bEnableCUA[m_nAppID];\r
 }\r
 \r
 void CXkeymacsDll::StartRecordMacro()\r
@@ -1165,7 +1165,7 @@ int CXkeymacsDll::IsPassThrough(BYTE nKey)
        BYTE bVk = 0;\r
        do {\r
                if (IsDown(bVk)\r
-                && (Commands[m_Config.nCommandID[m_nApplicationID][NONE][bVk]].fCommand == CCommands::PassThrough)) {\r
+                && (Commands[m_Config.nCommandID[m_nAppID][NONE][bVk]].fCommand == CCommands::PassThrough)) {\r
                        if (bVk == nKey) {\r
                                return GOTO_HOOK;\r
                        }\r
@@ -1219,7 +1219,7 @@ void CXkeymacsDll::CallFunction(int nFuncID)
        for (std::vector<KeyBind>::const_iterator p = keybinds.begin(); p != keybinds.end(); ++p) {\r
                const int nType = p->nType;\r
                const BYTE bVk = p->bVk;\r
-               int (*fCommand)() = nType < MAX_COMMAND_TYPE ? Commands[m_Config.nCommandID[m_nApplicationID][nType][bVk]].fCommand : NULL;\r
+               int (*fCommand)() = nType < MAX_COMMAND_TYPE ? Commands[m_Config.nCommandID[m_nAppID][nType][bVk]].fCommand : NULL;\r
                if (fCommand) {\r
                        if (fCommand == CCommands::ExecuteExtendedCommand)\r
                                bM_x = TRUE;\r
@@ -1227,7 +1227,7 @@ void CXkeymacsDll::CallFunction(int nFuncID)
                                SetModifierState(0, before);\r
                                bInitialized = TRUE;\r
                        }\r
-//                     CUtils::Log("CallFunction: Command Name: %s", Commands[m_Config.nCommandID[m_nApplicationID][nType][bVk]].szCommandName);\r
+//                     CUtils::Log("CallFunction: Command Name: %s", Commands[m_Config.nCommandID[m_nAppID][nType][bVk]].szCommandName);\r
                        while (fCommand() == GOTO_RECURSIVE)\r
                                ;\r
                        continue;\r
@@ -1535,7 +1535,7 @@ void CXkeymacsDll::DoSetCursor()
 \r
 BOOL CXkeymacsDll::Get326Compatible()\r
 {\r
-       return m_Config.b326Compatible[m_nApplicationID];\r
+       return m_Config.b326Compatible[m_nAppID];\r
 }\r
 \r
 void CXkeymacsDll::InvokeM_x(const TCHAR *const szPath)\r
index d7d2a6a..d3c4a67 100644 (file)
@@ -138,7 +138,7 @@ private:
        static void SetOriginal(UINT nType, BYTE bVk);\r
        static int CheckOriginal(UINT nType, BYTE bVk);\r
        static void InitKeyboardProc(BOOL bImeComposition);\r
-       static int m_nApplicationID;\r
+       static int m_nAppID;\r
        static int m_nOriginal[MAX_COMMAND_TYPE][MAX_KEY];\r
        static int m_nKillRing;\r
        static CList<CClipboardSnap *, CClipboardSnap *> m_oKillRing;\r