Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1:/tmp/cvs-serv2505 Modified Files: AnyEdit.dsp AnyEdit.rc ChangeLog.txt MainFrm.cpp MainFrm.h resource.h Added Files: Plugin.cpp Plugin.h Log Message: Added Initial plugin support Added diff plugin --- NEW FILE: Plugin.cpp --- #include "stdafx.h" #include "AnyEdit.h" #include "Plugin.h" void CPlugin::OpenUrl(LPCSTR url) { theApp.OpenBrowserWindow(url); } LPCSTR CPlugin::GetAppPath() { return theApp.GetAppPath(); } --- NEW FILE: Plugin.h --- #ifndef PLUGIN_H #define PLUGIN_H class CPlugin { public: virtual void OpenUrl(LPCSTR url); virtual LPCSTR GetAppPath(); }; #endif Index: AnyEdit.dsp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.dsp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AnyEdit.dsp 9 Jul 2003 07:17:55 -0000 1.17 --- AnyEdit.dsp 18 Jul 2003 19:05:36 -0000 1.18 *************** *** 392,395 **** --- 392,399 ---- # Begin Source File + SOURCE=.\Plugin.cpp + # End Source File + # Begin Source File + SOURCE=.\QuickJump.cpp # End Source File *************** *** 1056,1059 **** --- 1060,1067 ---- SOURCE=.\includes\PaletteCommandFrameWnd.h + # End Source File + # Begin Source File + + SOURCE=.\Plugin.h # End Source File # Begin Source File Index: AnyEdit.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/AnyEdit.rc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AnyEdit.rc 17 Jul 2003 11:32:15 -0000 1.22 --- AnyEdit.rc 18 Jul 2003 19:05:36 -0000 1.23 *************** *** 153,156 **** --- 153,160 ---- MENUITEM "&Customize...", ID_VIEW_CUSTOMIZE END + POPUP "Plugins" + BEGIN + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN1 + END POPUP "&Help" BEGIN *************** *** 461,464 **** --- 465,472 ---- MENUITEM "&Customize...", ID_VIEW_CUSTOMIZE END + POPUP "Plugins" + BEGIN + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN1 + END POPUP "&Window" BEGIN *************** *** 902,905 **** --- 910,917 ---- MENUITEM "&Customize...", ID_VIEW_CUSTOMIZE END + POPUP "Plugins" + BEGIN + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN1 + END POPUP "&Help" BEGIN *************** *** 910,913 **** --- 922,957 ---- MENUITEM SEPARATOR MENUITEM "&About AnyEdit...", ID_APP_ABOUT + END + END + + IDR_POPUP_PLUGINS MENU DISCARDABLE + BEGIN + POPUP "<PLUGINS>" + BEGIN + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN1 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN2 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN3 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN4 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN5 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN6 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN7 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN8 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN9 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN10 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN11 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN12 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN13 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN14 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN15 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN16 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN17 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN18 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN19 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN20 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN21 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN22 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN23 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN24 + MENUITEM "<plugin1>", ID_PLUGINS_PLUGIN25 END END Index: ChangeLog.txt =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ChangeLog.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ChangeLog.txt 17 Jul 2003 11:32:15 -0000 1.26 --- ChangeLog.txt 18 Jul 2003 19:05:36 -0000 1.27 *************** *** 29,32 **** --- 29,34 ---- 22) Bug replace whole word fixed.[#741234] 23) User tool can run with no window open [#750948] + 24) Added Initial Plugin support + 25) Added Diff Plugin Beta 1.0 Index: MainFrm.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MainFrm.cpp 17 Jul 2003 11:32:15 -0000 1.23 --- MainFrm.cpp 18 Jul 2003 19:05:36 -0000 1.24 *************** *** 50,53 **** --- 50,54 ---- #include "Splash.h" #include "Parser.h" + #include "Plugin.h" #ifdef _DEBUG *************** *** 57,60 **** --- 58,62 ---- #endif + typedef int (*ENTRY_FUNCTION)(CPlugin *); IMPLEMENT_MSG(UPM_FINISHED) *************** *** 119,122 **** --- 121,125 ---- ON_UPDATE_COMMAND_UI_RANGE(ID_VIEW_USER_TOOLBAR1, ID_VIEW_USER_TOOLBAR1 + iMaxUserToolbars - 1, OnUpdateToolsViewUserToolbar) ON_COMMAND_EX_RANGE(ID_USER_TOOL1, ID_USER_TOOL10, OnSelectedUserTools) + ON_COMMAND_EX_RANGE(ID_PLUGINS_PLUGIN1, ID_PLUGINS_PLUGIN25, OnSelectedPlugin) ON_UPDATE_COMMAND_UI_RANGE(ID_USER_TOOL1, ID_USER_TOOL10, OnUpdateUserTools) ON_COMMAND_EX_RANGE(ID_CUR_TOOL1, ID_CUR_TOOL5, OnCurrentUserTools) *************** *** 412,415 **** --- 415,433 ---- } + if (pMenuPopup->GetMenuBar ()->CommandToIndex (ID_PLUGINS_PLUGIN1) >= 0) + { + pMenuPopup->RemoveAllItems (); + + CMenu menu; + VERIFY(menu.LoadMenu (IDR_POPUP_PLUGINS)); + + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); + + LoadPluginMenus (*pPopup); + pMenuPopup->GetMenuBar ()->ImportFromMenu (*pPopup, TRUE); + } + + if (pMenuPopup->GetMenuBar ()->CommandToIndex (ID_FILE_RECENTWORKSPACES_WS1) >= 0) { *************** *** 518,521 **** --- 536,563 ---- } + void CMainFrame::LoadPluginMenus(CMenu &popUp) + { + CString app_path = theApp.GetAppPath(); + CStringArray plugins; + app_path+= _T("Plugins"); + msc.GetFilesInFolder(app_path,"*.dll",plugins); + + int y=plugins.GetSize(); + int pluginPos = 0; + int ccnt = ID_PLUGINS_PLUGIN1; + for(int i=0;i<y;i++) + { + popUp.ModifyMenu(ccnt,MF_STRING,ccnt,plugins.GetAt(i).Left(plugins.GetAt(i).GetLength()-4)); + ccnt++; + pluginPos++; + } + + for(int xy=pluginPos;xy<26;xy++) + { + popUp.DeleteMenu(pluginPos,MF_BYPOSITION); + } + + } + void CMainFrame::LoadToolMenus(CMenu &popUp) { *************** *** 1102,1105 **** --- 1144,1169 ---- { pCmdUI->Enable(m_wndWorkSpace.IsWorkspaceLoaded()); + } + + void CMainFrame::OnSelectedPlugin(UINT id) + { + CString app_path = theApp.GetAppPath(); + CStringArray plugins; + app_path+= _T("Plugins"); + msc.GetFilesInFolder(app_path,"*.dll",plugins); + int position = ID_PLUGINS_PLUGIN1 - id; + app_path+="\\"; + app_path+= plugins.GetAt(-position); + ENTRY_FUNCTION PluginFunction = NULL; + HINSTANCE hinst = LoadLibrary(app_path); + if(hinst) + { + PluginFunction = (ENTRY_FUNCTION)GetProcAddress(hinst,"EntryFunction"); + CPlugin plugin; + if(PluginFunction) + PluginFunction(&plugin); + FreeLibrary(hinst); + } + } Index: MainFrm.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/MainFrm.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MainFrm.h 17 Jul 2003 11:32:15 -0000 1.17 --- MainFrm.h 18 Jul 2003 19:05:36 -0000 1.18 *************** *** 31,39 **** protected: ! void LoadSettingsFromRegistry ! (); ! void SaveSettingsToRegistry ! (); void LoadToolMenus(CMenu &popUp); void LoadRecentMenus(CMenu &popUp); void LoadCurrentToolMenu(CMenu &popUp,LPCSTR curLang); --- 31,38 ---- protected: ! void LoadSettingsFromRegistry(); ! void SaveSettingsToRegistry(); void LoadToolMenus(CMenu &popUp); + void LoadPluginMenus(CMenu &popUp); void LoadRecentMenus(CMenu &popUp); void LoadCurrentToolMenu(CMenu &popUp,LPCSTR curLang); *************** *** 160,163 **** --- 159,163 ---- afx_msg void OnUpdateToolsViewUserToolbar (CCmdUI* pCmdUI); afx_msg void OnUpdateUserTools (CCmdUI* pCmdUI); + afx_msg void OnSelectedPlugin(UINT id); afx_msg void OnSelectedUserTools(UINT id); afx_msg void OnCurrentUserTools(UINT id); Index: resource.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/resource.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** resource.h 9 Jul 2003 07:17:55 -0000 1.14 --- resource.h 18 Jul 2003 19:05:36 -0000 1.15 *************** *** 101,104 **** --- 101,105 ---- #define IDD_DIALOG1 247 #define IDC_CURSOR1 249 + #define IDR_POPUP_PLUGINS 249 #define IDI_ICON1 250 #define IDD_DIALOG2 251 *************** *** 422,425 **** --- 423,451 ---- #define ID_CONFIGURE_CURRENTDOCUMENT_BOOKMARKMARGIN 33041 #define ID_CONFIGURE_CURRENTDOCUMENT_FOLDMARGIN 33044 + #define ID_PLUGINS_PLUGIN1 33045 + #define ID_PLUGINS_PLUGIN2 33046 + #define ID_PLUGINS_PLUGIN3 33047 + #define ID_PLUGINS_PLUGIN4 33048 + #define ID_PLUGINS_PLUGIN5 33049 + #define ID_PLUGINS_PLUGIN6 33050 + #define ID_PLUGINS_PLUGIN7 33051 + #define ID_PLUGINS_PLUGIN8 33052 + #define ID_PLUGINS_PLUGIN9 33053 + #define ID_PLUGINS_PLUGIN10 33054 + #define ID_PLUGINS_PLUGIN11 33055 + #define ID_PLUGINS_PLUGIN12 33056 + #define ID_PLUGINS_PLUGIN13 33057 + #define ID_PLUGINS_PLUGIN14 33058 + #define ID_PLUGINS_PLUGIN15 33059 + #define ID_PLUGINS_PLUGIN16 33060 + #define ID_PLUGINS_PLUGIN17 33061 + #define ID_PLUGINS_PLUGIN18 33062 + #define ID_PLUGINS_PLUGIN19 33063 + #define ID_PLUGINS_PLUGIN20 33064 + #define ID_PLUGINS_PLUGIN21 33065 + #define ID_PLUGINS_PLUGIN22 33066 + #define ID_PLUGINS_PLUGIN23 33067 + #define ID_PLUGINS_PLUGIN24 33068 + #define ID_PLUGINS_PLUGIN25 33069 #define ID_OUTPUT_CLEAR 57632 #define ID_OUTPUT_COPY 57634 *************** *** 436,441 **** #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 249 ! #define _APS_NEXT_COMMAND_VALUE 33045 #define _APS_NEXT_CONTROL_VALUE 1088 #define _APS_NEXT_SYMED_VALUE 105 --- 462,467 ---- #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 250 ! #define _APS_NEXT_COMMAND_VALUE 33070 #define _APS_NEXT_CONTROL_VALUE 1088 #define _APS_NEXT_SYMED_VALUE 105 |