Update of /cvsroot/anyedit/AnyEditv2/Plugins/Diff In directory sc8-pr-cvs1:/tmp/cvs-serv27703/Plugins/Diff Modified Files: Diff.cpp Diff.def Diff.plg Diff.rc Resource.h Removed Files: Diff.aps Diff.clw Diff.ncb Diff.opt Log Message: Added plugin support. Plugins can expose there own menus and accelerators Index: Diff.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/Diff.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Diff.cpp 18 Jul 2003 19:05:36 -0000 1.1 --- Diff.cpp 23 Jul 2003 09:41:35 -0000 1.2 *************** *** 14,18 **** #endif ! static AFX_EXTENSION_MODULE DiffDLL = { NULL, NULL }; --- 14,18 ---- #endif ! HINSTANCE hDLLInstance = NULL ; static AFX_EXTENSION_MODULE DiffDLL = { NULL, NULL }; *************** *** 44,47 **** --- 44,48 ---- new CDynLinkLibrary(DiffDLL); + hDLLInstance = hInstance ; } else if (dwReason == DLL_PROCESS_DETACH) *************** *** 56,65 **** ! extern "C" int EntryFunction(CPlugin * plugin) { - CDiffDlg dlg; - dlg.SetPlugin(plugin); - dlg.DoModal(); - //plugin->OpenUrl("http://www.google.com"); return 0; } --- 57,83 ---- ! extern "C" int OnMenuClick(CPlugin * plugin,UINT menu_id) ! { ! if(menu_id==ID_TOOLS_DIFFTOOL) ! { ! CDiffDlg dlg; ! dlg.SetPlugin(plugin); ! dlg.DoModal(); ! } ! return 0; ! } ! ! extern "C" int plugin_init(CPlugin * plugin) ! { ! CMenu test; ! test.LoadMenu(IDR_MENU1); ! plugin->AddMenu(&test,ANYEDIT_MAIN|ANYEDIT_DOCUMENT|ANYEDIT_BROWSER ,TRUE); ! HACCEL hMerge = LoadAccelerators(hDLLInstance, MAKEINTRESOURCE(IDR_ACCELERATOR1)) ; ! plugin->AddAccelerator(hMerge,ANYEDIT_MAIN|ANYEDIT_DOCUMENT|ANYEDIT_BROWSER); ! return 0; ! } ! ! extern "C" int plugin_exit(CPlugin * plugin) { return 0; } Index: Diff.def =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/Diff.def,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Diff.def 18 Jul 2003 19:05:36 -0000 1.1 --- Diff.def 23 Jul 2003 09:41:35 -0000 1.2 *************** *** 6,8 **** EXPORTS ; Explicit exports can go here ! EntryFunction \ No newline at end of file --- 6,10 ---- EXPORTS ; Explicit exports can go here ! OnMenuClick ! plugin_init ! plugin_exit \ No newline at end of file Index: Diff.plg =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/Diff.plg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Diff.plg 18 Jul 2003 19:05:36 -0000 1.1 --- Diff.plg 23 Jul 2003 09:41:35 -0000 1.2 *************** *** 7,10 **** --- 7,49 ---- </h3> <h3>Command Lines</h3> + Creating command line "rc.exe /l 0x409 /fo"Release/Diff.res" /d "NDEBUG" /d "_AFXDLL" "C:\OS\AnyEditv2\Plugins\Diff\Diff.rc"" + Creating temporary file "C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EA.tmp" with contents + [ + /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT" /Fp"Release/Diff.pch" /Yu"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c + "C:\OS\AnyEditv2\Plugins\Diff\DiffEngine.cpp" + "C:\OS\AnyEditv2\Plugins\Diff\FilePartition.cpp" + "C:\OS\AnyEditv2\Plugins\Diff\Diff.cpp" + "C:\OS\AnyEditv2\Plugins\Diff\DiffDlg.cpp" + ] + Creating command line "cl.exe @C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EA.tmp" + Creating temporary file "C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EB.tmp" with contents + [ + /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_AFXEXT" /Fp"Release/Diff.pch" /Yc"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c + "C:\OS\AnyEditv2\Plugins\Diff\StdAfx.cpp" + ] + Creating command line "cl.exe @C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EB.tmp" + Creating temporary file "C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EC.tmp" with contents + [ + /nologo /subsystem:windows /dll /incremental:no /pdb:"Release/Diff.pdb" /machine:I386 /def:".\Diff.def" /out:"../../bin/Plugins/Diff.dll" /implib:"Release/Diff.lib" + .\Release\DiffEngine.obj + .\Release\FilePartition.obj + .\Release\Diff.obj + .\Release\DiffDlg.obj + .\Release\StdAfx.obj + .\Release\Diff.res + ] + Creating command line "link.exe @C:\DOCUME~1\deep\LOCALS~1\Temp\RSP4EC.tmp" + <h3>Output Window</h3> + Compiling resources... + Compiling... + StdAfx.cpp + Compiling... + DiffEngine.cpp + FilePartition.cpp + Diff.cpp + DiffDlg.cpp + Generating Code... + Linking... + Creating library Release/Diff.lib and object Release/Diff.exp Index: Diff.rc =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/Diff.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Diff.rc 18 Jul 2003 19:05:36 -0000 1.1 --- Diff.rc 23 Jul 2003 09:41:35 -0000 1.2 *************** *** 108,116 **** // ! IDD_DIALOG1 DIALOGEX 0, 0, 283, 82 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "diff tool" ! FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "Diff",IDOK,171,61,50,14 --- 108,116 ---- // ! IDD_DIALOG1 DIALOGEX 0, 0, 283, 85 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "diff tool" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN DEFPUSHBUTTON "Diff",IDOK,171,61,50,14 *************** *** 143,146 **** --- 143,183 ---- END #endif // APSTUDIO_INVOKED + + + ///////////////////////////////////////////////////////////////////////////// + // + // Menu + // + + IDR_MENU1 MENU DISCARDABLE + BEGIN + POPUP "Tools" + BEGIN + MENUITEM "Diff Tool", ID_TOOLS_DIFFTOOL + END + END + + + ///////////////////////////////////////////////////////////////////////////// + // + // Accelerator + // + + IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE + BEGIN + "D", ID_TOOLS_DIFFTOOL, VIRTKEY, SHIFT, CONTROL, + NOINVERT + END + + + ///////////////////////////////////////////////////////////////////////////// + // + // String Table + // + + STRINGTABLE DISCARDABLE + BEGIN + ID_TOOLS_DIFFTOOL "Find difference between two files" + END #endif // English (U.S.) resources Index: Resource.h =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/Plugins/Diff/Resource.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Resource.h 18 Jul 2003 19:05:36 -0000 1.1 --- Resource.h 23 Jul 2003 09:41:35 -0000 1.2 *************** *** 6,13 **** --- 6,17 ---- #define ID_EDIT1 1000 #define ID_BUTTON1 1001 + #define IDR_MENU1 1001 #define ID_EDIT2 1002 + #define IDR_ACCELERATOR1 1002 #define ID_BUTTON2 1003 #define ID_CHECK1 1004 #define ID_CHECK2 1005 + #define ID_FILE_OHOHAOSDHF 32773 + #define ID_TOOLS_DIFFTOOL 50001 // Next default values for new objects *************** *** 15,20 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 1001 ! #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 1000 --- 19,24 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 1003 ! #define _APS_NEXT_COMMAND_VALUE 32774 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 1000 --- Diff.aps DELETED --- --- Diff.clw DELETED --- --- Diff.ncb DELETED --- --- Diff.opt DELETED --- |