├── Ext.rc ├── EXTICON.BMP ├── README.txt ├── Perspective.dsw ├── Common.h ├── Perspective.sln ├── Ext.def ├── Main.h ├── resource.h ├── General.cpp ├── Main.cpp ├── Perspective.dsp ├── Runtime.cpp ├── Perspective.vcproj └── Edittime.cpp /Ext.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andos/Perspective/HEAD/Ext.rc -------------------------------------------------------------------------------- /EXTICON.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Andos/Perspective/HEAD/EXTICON.BMP -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Can distort the background much faster than Lens object for MMF but is limited to the following effects: 2 | Perspective, Panorama, Sine Wave, Sine Offset, Custom and Custom Offset -------------------------------------------------------------------------------- /Perspective.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "Perspective"=.\Perspective.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /Common.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef COMMON_H 3 | #define COMMON_H 4 | 5 | #if defined(_DEBUG) && defined(WIN32) 6 | #define _CRTDBG_MAP_ALLOC 1 7 | #endif 8 | 9 | #define IN_EXT_VERSION2 10 | #define COXSDK 11 | 12 | // ---------------------------------------------- 13 | // VERSION AND BUILD YOUR EXTENSION CAN WORK WITH 14 | // ---------------------------------------------- 15 | //#define TGFEXT // TGF, MMF Standard and MMF Pro 16 | #define MMFEXT // MMF Standard and MMF Pro 17 | //#define PROEXT // MMF Pro only 18 | 19 | // Build number of the minimum required version of MMF 20 | #define MINBUILD 228 21 | 22 | // General includes 23 | #include "ccxhdr.h" 24 | #include "Surface.h" 25 | 26 | // Specific to this cox 27 | #include "resource.h" 28 | #include "main.h" 29 | #include "TigsExt.hpp" 30 | 31 | // Globals and Prototypes 32 | extern HINSTANCE hInstLib; 33 | extern short conditionsInfos[]; 34 | extern short actionsInfos[]; 35 | extern short expressionsInfos[]; 36 | 37 | long (WINAPI * ConditionJumps[])(LPRDATA rdPtr, long param1, long param2); 38 | short (WINAPI * ActionJumps[])(LPRDATA rdPtr, long param1, long param2); 39 | long (WINAPI * ExpressionJumps[])(LPRDATA rdPtr, long param); 40 | 41 | // Used to ensure the MMF version is 1.5, you can safely ignore this 42 | #if defined(MMFEXT) 43 | #define IS_COMPATIBLE(v) (v->mvGetVersion != NULL && (v->mvGetVersion() & MMFBUILD_MASK) >= MINBUILD && (v->mvGetVersion() & MMFVERSION_MASK) >= MMFVERSION_20 && ((v->mvGetVersion() & MMFVERFLAG_MASK) & MMFVERFLAG_HOME) == 0) 44 | #elif defined(PROEXT) 45 | #define IS_COMPATIBLE(v) (v->mvGetVersion != NULL && (v->mvGetVersion() & MMFBUILD_MASK) >= MINBUILD && (v->mvGetVersion() & MMFVERSION_MASK) >= MMFVERSION_20 && ((v->mvGetVersion() & MMFVERFLAG_MASK) & MMFVERFLAG_PRO) != 0) 46 | #else 47 | #define IS_COMPATIBLE(v) (v->mvGetVersion != NULL && (v->mvGetVersion() & MMFBUILD_MASK) >= MINBUILD && (v->mvGetVersion() & MMFVERSION_MASK) >= MMFVERSION_20) 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /Perspective.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Perspective", "Perspective.vcproj", "{3BCB4C73-71F6-43B6-803D-41411F92652A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release_Small|Win32 = Release_Small|Win32 10 | Release|Win32 = Release|Win32 11 | Run_Only_Small|Win32 = Run_Only_Small|Win32 12 | Run_Only|Win32 = Run_Only|Win32 13 | Vitalize_Small|Win32 = Vitalize_Small|Win32 14 | Vitalize|Win32 = Vitalize|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Debug|Win32.Build.0 = Debug|Win32 19 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Release_Small|Win32.ActiveCfg = Release_Small|Win32 20 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Release_Small|Win32.Build.0 = Release_Small|Win32 21 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Release|Win32.ActiveCfg = Release|Win32 22 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Release|Win32.Build.0 = Release|Win32 23 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Run_Only_Small|Win32.ActiveCfg = Run_Only_Small|Win32 24 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Run_Only_Small|Win32.Build.0 = Run_Only_Small|Win32 25 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Run_Only|Win32.ActiveCfg = Run_Only|Win32 26 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Run_Only|Win32.Build.0 = Run_Only|Win32 27 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Vitalize_Small|Win32.ActiveCfg = Vitalize_Small|Win32 28 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Vitalize_Small|Win32.Build.0 = Vitalize_Small|Win32 29 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Vitalize|Win32.ActiveCfg = Vitalize|Win32 30 | {3BCB4C73-71F6-43B6-803D-41411F92652A}.Vitalize|Win32.Build.0 = Vitalize|Win32 31 | EndGlobalSection 32 | GlobalSection(SolutionProperties) = preSolution 33 | HideSolutionNode = FALSE 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /Ext.def: -------------------------------------------------------------------------------- 1 | 2 | EXPORTS 3 | GetInfos @2 4 | LoadObject @6 5 | UnloadObject @7 6 | PutObject @8 7 | RemoveObject @9 8 | ; MakeIconEx @11 9 | 10 | CreateObject @14 11 | GetHelpFileName @16 12 | EditObject @18 13 | GetObjectRect @19 14 | EditorDisplay @20 15 | IsTransparent @21 16 | PrepareToWriteObject @22 17 | UpdateFileNames @23 18 | ; EnumElts @24 19 | Initialize @25 20 | Free @26 21 | ; ExportTexts @27 22 | ; ImportTexts @28 23 | ; GetSubType @29 24 | UsesFile @30 25 | CreateFromFile @31 26 | DuplicateObject @32 27 | GetObjInfos @36 28 | 29 | GetTextCaps @37 30 | GetTextAlignment @38 31 | SetTextAlignment @39 32 | GetTextFont @40 33 | SetTextFont @41 34 | GetTextClr @42 35 | SetTextClr @43 36 | 37 | GetDependencies @44 38 | GetFilters @45 39 | 40 | ; conditionsTable @47 41 | ; actionsTable @48 42 | ; expressionsTable @49 43 | 44 | CreateRunObject @50 45 | DestroyRunObject @51 46 | HandleRunObject @52 47 | DisplayRunObject @53 48 | PauseRunObject @57 49 | ContinueRunObject @58 50 | GetRunObjectInfos @59 51 | 52 | GetConditionMenu @60 53 | GetActionMenu @61 54 | GetExpressionMenu @62 55 | GetConditionCodeFromMenu @63 56 | GetActionCodeFromMenu @64 57 | GetExpressionCodeFromMenu @65 58 | GetConditionString @66 59 | GetActionString @67 60 | GetExpressionString @68 61 | InitParameter @69 62 | EditParameter @70 63 | GetParameterString @71 64 | GetConditionTitle @72 65 | GetActionTitle @73 66 | GetExpressionTitle @74 67 | GetConditionInfos @75 68 | GetActionInfos @76 69 | GetExpressionInfos @77 70 | UpdateEditStructure @78 71 | GetRunObjectDataSize @80 72 | ; SaveBackground @81 73 | ; RestoreBackground @82 74 | ; KillBackground @83 75 | ; WindowProc @84 76 | StartApp @85 77 | EndApp @86 78 | StartFrame @87 79 | EndFrame @88 80 | GetExpressionParam @89 81 | 82 | ; GetRunObjectSurface @90 83 | ; GetRunObjectCollisionMask @91 84 | 85 | ; GetRunObjectFont @92 86 | ; SetRunObjectFont @93 87 | ; GetRunObjectTextColor @94 88 | ; SetRunObjectTextColor @95 89 | 90 | SetEditSize @99 91 | GetProperties @100 92 | ReleaseProperties @101 93 | GetPropValue @102 94 | SetPropValue @103 95 | IsPropEnabled @104 96 | GetPropCheck @105 97 | SetPropCheck @106 98 | GetPropCreateParam @107 99 | ReleasePropCreateParam @108 100 | EditProp @109 101 | GetDebugTree @110 102 | GetDebugItem @111 103 | EditDebugItem @112 104 | -------------------------------------------------------------------------------- /Main.h: -------------------------------------------------------------------------------- 1 | // Object identifier "pskt" 2 | #define IDENTIFIER MAKEID(p,s,k,t) 3 | 4 | // ------------------------------ 5 | // DEFINITION OF CONDITIONS CODES 6 | // ------------------------------ 7 | #define CND_CONDITION 0 8 | #define CND_LAST 0 9 | 10 | // --------------------------- 11 | // DEFINITION OF ACTIONS CODES 12 | // --------------------------- 13 | #define ACT_ACTION 0 14 | #define ACT_LAST 18 15 | 16 | // ------------------------------- 17 | // DEFINITION OF EXPRESSIONS CODES 18 | // ------------------------------- 19 | #define EXP_EXPRESSION 0 20 | #define EXP_LAST 6 21 | 22 | 23 | #define HORIZONTAL 0 24 | #define VERTICAL 1 25 | #define PANORAMA 0 26 | #define PERSPECTIVE 1 27 | #define SINEWAVE 2 28 | #define SINEOFFSET 3 29 | #define CUSTOM 4 30 | #define CUSTOMOFFSET 5 31 | 32 | #define LEFTRIGHTTOPBOTTOM 0 33 | #define RIGHTLEFTBOTTOMTOP 1 34 | 35 | 36 | 37 | // -------------------------------- 38 | // EDITION OF OBJECT DATA STRUCTURE 39 | // -------------------------------- 40 | // These values let you store data in your extension that will be saved in the CCA. 41 | // You would use these with a dialog... 42 | 43 | typedef struct tagEDATA_V1 44 | { 45 | extHeader eHeader; 46 | short sx; 47 | short sy; 48 | short swidth; 49 | short sheight; 50 | char Effect; 51 | bool Direction; 52 | int DefaultZoom; 53 | int DefaultOffset; 54 | int SineWaveWaves; 55 | bool PerspectiveDir; 56 | bool resample; 57 | 58 | } EDITDATA; 59 | typedef EDITDATA _far * LPEDATA; 60 | 61 | // Object versions 62 | #define KCX_CURRENT_VERSION 1 63 | 64 | // -------------------------------- 65 | // RUNNING OBJECT DATA STRUCTURE 66 | // -------------------------------- 67 | // If you want to store anything between actions/conditions/expressions 68 | // you should store it here. Also, some OEFLAGS require you to add 69 | // structures to this structure. 70 | 71 | typedef struct tagRDATA 72 | { 73 | headerObject rHo; // Header 74 | rCom roc; 75 | rSpr rs; 76 | rMvt rm; 77 | cSurface * TempImage; 78 | int Effect; 79 | bool Direction; 80 | int ZoomValue; 81 | int Offset; 82 | int SineWaveWaves; 83 | bool PerspectiveDir; 84 | int * CustomArray; 85 | bool resample; 86 | 87 | } RUNDATA; 88 | typedef RUNDATA _far * LPRDATA; 89 | 90 | // Size when editing the object under level editor 91 | // ----------------------------------------------- 92 | #define MAX_EDITSIZE sizeof(EDITDATA) 93 | 94 | // Default flags 95 | // ------------- 96 | #define OEFLAGS OEFLAG_SPRITES|OEFLAG_BACKSAVE|OEFLAG_SCROLLINGINDEPENDANT|OEFLAG_RUNBEFOREFADEIN|OEFLAG_NEVERKILL|OEFLAG_NEVERSLEEP|OEFLAG_MOVEMENTS 97 | #define OEPREFS OEPREFS_BACKSAVE|OEPREFS_SCROLLINGINDEPENDANT|OEPREFS_LOADONCALL|OEPREFS_KILL 98 | 99 | /* See OEFLAGS.txt for more info on these useful things! */ 100 | 101 | 102 | // If to handle message, specify the priority of the handling procedure 103 | // 0= low, 255= very high. You should use 100 as normal. 104 | // -------------------------------------------------------------------- 105 | #define WINDOWPROC_PRIORITY 100 106 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Ext.rc 4 | // 5 | #define MN_ACTIONS 101 6 | #define MN_EXPRESSIONS 102 7 | #define MN_CONDITIONS 103 8 | #define IDST_OBJNAME 128 9 | #define IDST_AUTHOR 129 10 | #define IDST_COPYRIGHT 130 11 | #define IDST_COMMENT 131 12 | #define IDST_HTTP 132 13 | #define DB_SETUP 20003 14 | #define ID_HELP 20004 15 | #define IDS_PROP_TEXTTITLE 20005 16 | #define IDS_PANORAMA 20006 17 | #define IDS_PERSPECTIVE 20007 18 | #define IDS_SINEWAVE 20008 19 | #define IDS_CUSTOM 20009 20 | #define IDS_HORIZONTALDIR 20010 21 | #define IDS_VERTICALDIR 20011 22 | #define IDS_RIGHTTOP 20012 23 | #define IDS_LEFTBOTTOM 20013 24 | #define IDS_DEFAULTVALUES 20014 25 | #define IDS_EFFECT 20015 26 | #define IDS_DIRECTION 20016 27 | #define IDS_ORIENTATION 20017 28 | #define IDS_ZOOMVALUE 20018 29 | #define IDS_OFFSET 20019 30 | #define IDS_SINEWAVESNUM 20020 31 | #define IDS_QUALITY 20021 32 | #define IDS_SINEOFFSET 20022 33 | #define IDS_CUSTOMOFFSET 20023 34 | #define AID_actSetZoomValue 25000 35 | #define AP0ID_actSetZoomValue 25001 36 | #define AID_actSetPanorama 25010 37 | #define AID_actSetPerspective 25020 38 | #define AID_actSetSineWave 25030 39 | #define AID_actSetCustom 25040 40 | #define AID_actSetNumWaves 25050 41 | #define AP0ID_actSetNumWaves 25051 42 | #define AID_actSetOffset 25060 43 | #define AP0ID_actSetOffset 25061 44 | #define AID_actSetHorizontal 25070 45 | #define AID_actSetVertical 25080 46 | #define AID_actSetLeftTop 25090 47 | #define AID_actSetRightBottom 25100 48 | #define AID_actSetCustomValue 25110 49 | #define AP0ID_actSetCustomValue 25111 50 | #define AP1ID_actSetCustomValue 25112 51 | #define AID_actSetWidth 25120 52 | #define AP0ID_actSetWidth 25121 53 | #define AID_actSetHeight 25130 54 | #define AP0ID_actSetHeight 25131 55 | #define AID_actSetResampleOn 25140 56 | #define AID_actSetResampleOff 25150 57 | #define AID_actSetSineOffset 25160 58 | #define AID_actSetCustomOffset 25170 59 | 60 | #define EID_expGetZoomValue 27000 61 | #define EID_expGetOffset 27010 62 | #define EID_expNumWaves 27020 63 | #define EID_expGetCustom 27030 64 | #define EID_expGetWidth 27040 65 | #define EID_expGetHeight 27050 66 | 67 | 68 | // Next default values for new objects 69 | // 70 | #ifdef APSTUDIO_INVOKED 71 | #ifndef APSTUDIO_READONLY_SYMBOLS 72 | #define _APS_NO_MFC 1 73 | #define _APS_NEXT_RESOURCE_VALUE 103 74 | #define _APS_NEXT_COMMAND_VALUE 40001 75 | #define _APS_NEXT_CONTROL_VALUE 1001 76 | #define _APS_NEXT_SYMED_VALUE 101 77 | #endif 78 | #endif 79 | -------------------------------------------------------------------------------- /General.cpp: -------------------------------------------------------------------------------- 1 | 2 | // ============================================================================ 3 | // 4 | // The following routines are used internally by MMF, and should not need to 5 | // be modified. 6 | // 7 | // 8 | // ============================================================================ 9 | 10 | // Common Include 11 | #include "common.h" 12 | 13 | HINSTANCE hInstLib; 14 | 15 | // ============================================================================ 16 | // 17 | // LIBRARY ENTRY & QUIT POINTS 18 | // 19 | // ============================================================================ 20 | 21 | // ----------------- 22 | // Entry points 23 | // ----------------- 24 | // Usually you do not need to do any initialization here: you will prefer to 25 | // do them in "Initialize" found in Edittime.cpp 26 | BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) 27 | { 28 | switch (dwReason) 29 | { 30 | // DLL is attaching to the address space of the current process. 31 | case DLL_PROCESS_ATTACH: 32 | 33 | hInstLib = hDLL; // Store HINSTANCE 34 | break; 35 | 36 | // A new thread is being created in the current process. 37 | case DLL_THREAD_ATTACH: 38 | break; 39 | 40 | // A thread is exiting cleanly. 41 | case DLL_THREAD_DETACH: 42 | break; 43 | 44 | // The calling process is detaching the DLL from its address space. 45 | case DLL_PROCESS_DETACH: 46 | break; 47 | } 48 | 49 | return TRUE; 50 | } 51 | 52 | // ----------------- 53 | // Initialize 54 | // ----------------- 55 | // Where you want to do COLD-START initialization. 56 | // Called when the extension is loaded into memory. 57 | // 58 | extern "C" int WINAPI DLLExport Initialize(mv _far *mV, int quiet) 59 | { 60 | // No error 61 | return 0; 62 | } 63 | 64 | // ----------------- 65 | // Free 66 | // ----------------- 67 | // Where you want to kill and initialized data opened in the above routine 68 | // Called just before freeing the DLL. 69 | // 70 | extern "C" int WINAPI DLLExport Free(mv _far *mV) 71 | { 72 | // No error 73 | return 0; 74 | } 75 | 76 | // ============================================================================ 77 | // 78 | // GENERAL INFO 79 | // 80 | // ============================================================================ 81 | 82 | // ----------------- 83 | // Get Infos 84 | // ----------------- 85 | // 86 | extern "C" 87 | { 88 | DWORD WINAPI DLLExport GetInfos(int info) 89 | { 90 | 91 | switch (info) 92 | { 93 | case KGI_VERSION: 94 | return EXT_VERSION2; // Do not change 95 | case KGI_PLUGIN: 96 | return EXT_PLUGIN_VERSION1; // Do not change 97 | case KGI_PRODUCT: 98 | return PRODUCT_VERSION_STANDARD; // Works with MMF Standard or above 99 | case KGI_BUILD: 100 | return 219; // Works with build 219 or above 101 | default: 102 | return 0; 103 | } 104 | } 105 | } 106 | 107 | // ---------------------------------------------------------- 108 | // GetRunObjectInfos 109 | // ---------------------------------------------------------- 110 | // Fills an information structure that tells CC&C everything 111 | // about the object, its actions, conditions and expressions 112 | // 113 | 114 | short WINAPI DLLExport GetRunObjectInfos(mv _far *mV, fpKpxRunInfos infoPtr) 115 | { 116 | infoPtr->conditions = (LPBYTE)ConditionJumps; 117 | infoPtr->actions = (LPBYTE)ActionJumps; 118 | infoPtr->expressions = (LPBYTE)ExpressionJumps; 119 | 120 | infoPtr->numOfConditions = CND_LAST; 121 | infoPtr->numOfActions = ACT_LAST; 122 | infoPtr->numOfExpressions = EXP_LAST; 123 | 124 | infoPtr->editDataSize = MAX_EDITSIZE; 125 | infoPtr->editFlags= OEFLAGS; 126 | 127 | infoPtr->windowProcPriority = WINDOWPROC_PRIORITY; 128 | 129 | // See doc 130 | infoPtr->editPrefs = OEPREFS; 131 | 132 | // Identifier, for run-time identification 133 | infoPtr->identifier = IDENTIFIER; 134 | 135 | // Current version 136 | infoPtr->version = KCX_CURRENT_VERSION; 137 | 138 | return TRUE; 139 | } 140 | 141 | // ---------------------------------------------------------- 142 | // GetDependencies 143 | // ---------------------------------------------------------- 144 | // Returns the name of the external modules that you wish MMF to include 145 | // with stand-alone applications (these modules must be in the MMF 146 | // Data\Runtime folder). 147 | // 148 | 149 | //LPCSTR szDep[] = { 150 | // "MyDll.dll", 151 | // NULL 152 | //}; 153 | 154 | LPCSTR* WINAPI DLLExport GetDependencies() 155 | { 156 | return NULL; // szDep; 157 | } 158 | 159 | // ----------------- 160 | // LoadObject 161 | // ----------------- 162 | // Routine called for each object when the object is read from the MFA file (edit time) 163 | // or from the CCN or EXE file (run time). 164 | // You can load data here, reserve memory etc... 165 | // 166 | int WINAPI DLLExport LoadObject(mv _far *mV, LPCSTR fileName, LPEDATA edPtr, int reserved) 167 | { 168 | return 0; 169 | } 170 | 171 | // ----------------- 172 | // UnloadObject 173 | // ----------------- 174 | // The counterpart of the above routine: called just before the object is 175 | // deleted from the frame. 176 | // 177 | void WINAPI DLLExport UnloadObject(mv _far *mV, LPEDATA edPtr, int reserved) 178 | { 179 | } 180 | 181 | // -------------------- 182 | // UpdateEditStructure 183 | // -------------------- 184 | // For you to update your object structure to newer versions 185 | // Called at both edit time and run time 186 | // 187 | HGLOBAL WINAPI DLLExport UpdateEditStructure(mv __far *mV, void __far * OldEdPtr) 188 | { 189 | // We do nothing here 190 | return 0; 191 | } 192 | 193 | // -------------------- 194 | // UpdateFileNames 195 | // -------------------- 196 | // If you store file names in your datazone, they have to be relocated when the 197 | // application is moved to a different directory: this routine does it. 198 | // Called at edit time and run time. 199 | // 200 | // Call lpfnUpdate to update your file pathname (refer to the documentation) 201 | // 202 | void WINAPI DLLExport UpdateFileNames(mv _far *mV, LPSTR appName, LPEDATA edPtr, void (WINAPI * lpfnUpdate)(LPSTR, LPSTR)) 203 | { 204 | } 205 | 206 | // --------------------- 207 | // EnumElts 208 | // --------------------- 209 | // 210 | // Uncomment this function if you need to store an image in the image bank. 211 | // 212 | // Note: do not forget to enable the function in the .def file 213 | // if you remove the comments below. 214 | // 215 | /* 216 | int WINAPI DLLExport EnumElts (mv __far *mV, LPEDATA edPtr, ENUMELTPROC enumProc, ENUMELTPROC undoProc, LPARAM lp1, LPARAM lp2) 217 | { 218 | int error = 0; 219 | 220 | // Replace wImgIdx with the name of the WORD variable you create within the edit structure 221 | 222 | // Enum images 223 | if ( (error = enumProc(&edPtr->wImgIdx, IMG_TAB, lp1, lp2)) != 0 ) 224 | { 225 | // Undo enum images 226 | undoProc (&edPtr->wImgIdx, IMG_TAB, lp1, lp2); 227 | } 228 | 229 | return error; 230 | } 231 | */ 232 | 233 | -------------------------------------------------------------------------------- /Main.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // 3 | // This file are where the Conditions/Actions/Expressions are defined. 4 | // You can manually enter these, or use CICK (recommended) 5 | // See the Extension FAQ in this SDK for more info and where to download it 6 | // 7 | // ============================================================================ 8 | 9 | // Common Include 10 | #include "common.h" 11 | int resizePerspective(LPRDATA rdPtr, int oldsize); 12 | 13 | // Quick memo: content of the eventInformations arrays 14 | // --------------------------------------------------- 15 | // Menu ID 16 | // String ID 17 | // Code 18 | // Flags 19 | // Number_of_parameters 20 | // Parameter_type [Number_of_parameters] 21 | // Parameter_TitleString [Number_of_parameters] 22 | 23 | // Definitions of parameters for each condition 24 | short conditionsInfos[]= 25 | { 26 | 0 }; 27 | 28 | // Definitions of parameters for each action 29 | short actionsInfos[]= 30 | { 31 | AID_actSetZoomValue, AID_actSetZoomValue, 0, 0, 1, PARAM_EXPRESSION, AP0ID_actSetZoomValue, 32 | AID_actSetPanorama, AID_actSetPanorama, 1, 0, 0, 33 | AID_actSetPerspective, AID_actSetPerspective, 2, 0, 0, 34 | AID_actSetSineWave, AID_actSetSineWave, 3, 0, 0, 35 | AID_actSetCustom, AID_actSetCustom, 4, 0, 0, 36 | AID_actSetNumWaves, AID_actSetNumWaves, 5, 0, 1, PARAM_EXPRESSION, AP0ID_actSetNumWaves, 37 | AID_actSetOffset, AID_actSetOffset, 6, 0, 1, PARAM_EXPRESSION, AP0ID_actSetOffset, 38 | AID_actSetHorizontal, AID_actSetHorizontal, 7, 0, 0, 39 | AID_actSetVertical, AID_actSetVertical, 8, 0, 0, 40 | AID_actSetLeftTop, AID_actSetLeftTop, 9, 0, 0, 41 | AID_actSetRightBottom, AID_actSetRightBottom, 10, 0, 0, 42 | AID_actSetCustomValue, AID_actSetCustomValue, 11, 0, 2, PARAM_EXPRESSION, PARAM_EXPRESSION, AP0ID_actSetCustomValue, AP1ID_actSetCustomValue, 43 | AID_actSetWidth, AID_actSetWidth, 12, 0, 1, PARAM_EXPRESSION, AP0ID_actSetWidth, 44 | AID_actSetHeight, AID_actSetHeight, 13, 0, 1, PARAM_EXPRESSION, AP0ID_actSetHeight, 45 | AID_actSetResampleOn, AID_actSetResampleOn, 14, 0, 0, 46 | AID_actSetResampleOff, AID_actSetResampleOff, 15, 0, 0, 47 | AID_actSetSineOffset, AID_actSetSineOffset, 16, 0, 0, 48 | AID_actSetCustomOffset, AID_actSetCustomOffset, 17, 0, 0, 49 | 0 }; 50 | 51 | 52 | // Definitions of parameters for each expression 53 | short expressionsInfos[]= 54 | { 55 | EID_expGetZoomValue, EID_expGetZoomValue, 0, 0, 0, 56 | EID_expGetOffset, EID_expGetOffset, 1, 0, 0, 57 | EID_expNumWaves, EID_expNumWaves, 2, 0, 0, 58 | EID_expGetCustom, EID_expGetCustom, 3, 0, 1, EXPPARAM_LONG, 0, 59 | EID_expGetWidth, EID_expGetWidth, 4, 0, 0, 60 | EID_expGetHeight, EID_expGetHeight, 5, 0, 0, 61 | 0 }; 62 | 63 | 64 | 65 | // ============================================================================ 66 | // 67 | // CONDITION ROUTINES 68 | // 69 | // ============================================================================ 70 | 71 | 72 | 73 | // ============================================================================ 74 | // 75 | // ACTIONS ROUTINES 76 | // 77 | // ============================================================================ 78 | 79 | short WINAPI DLLExport actSetZoomValue(LPRDATA rdPtr, long param1, long param2) 80 | { 81 | rdPtr->ZoomValue = param1; 82 | rdPtr->roc.rcChanged = true; 83 | return 0; 84 | } 85 | 86 | short WINAPI DLLExport actSetPanorama(LPRDATA rdPtr, long param1, long param2) 87 | { 88 | rdPtr->Effect = PANORAMA; 89 | rdPtr->roc.rcChanged = true; 90 | return 0; 91 | } 92 | 93 | short WINAPI DLLExport actSetPerspective(LPRDATA rdPtr, long param1, long param2) 94 | { 95 | rdPtr->Effect = PERSPECTIVE; 96 | rdPtr->roc.rcChanged = true; 97 | return 0; 98 | } 99 | 100 | short WINAPI DLLExport actSetSineWave(LPRDATA rdPtr, long param1, long param2) 101 | { 102 | rdPtr->Effect = SINEWAVE; 103 | rdPtr->roc.rcChanged = true; 104 | return 0; 105 | } 106 | 107 | short WINAPI DLLExport actSetCustom(LPRDATA rdPtr, long param1, long param2) 108 | { 109 | rdPtr->Effect = CUSTOM; 110 | rdPtr->roc.rcChanged = true; 111 | return 0; 112 | } 113 | 114 | short WINAPI DLLExport actSetSineOffset(LPRDATA rdPtr, long param1, long param2) 115 | { 116 | rdPtr->Effect = SINEOFFSET; 117 | rdPtr->roc.rcChanged = true; 118 | return 0; 119 | } 120 | 121 | short WINAPI DLLExport actSetCustomOffset(LPRDATA rdPtr, long param1, long param2) 122 | { 123 | rdPtr->Effect = CUSTOMOFFSET; 124 | rdPtr->roc.rcChanged = true; 125 | return 0; 126 | } 127 | 128 | 129 | short WINAPI DLLExport actSetNumWaves(LPRDATA rdPtr, long param1, long param2) 130 | { 131 | rdPtr->SineWaveWaves = param1; 132 | rdPtr->roc.rcChanged = true; 133 | return 0; 134 | } 135 | 136 | short WINAPI DLLExport actSetOffset(LPRDATA rdPtr, long param1, long param2) 137 | { 138 | rdPtr->Offset = param1; 139 | rdPtr->roc.rcChanged = true; 140 | return 0; 141 | } 142 | 143 | short WINAPI DLLExport actSetHorizontal(LPRDATA rdPtr, long param1, long param2) 144 | { 145 | int OldSize = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 146 | int NewSize = rdPtr->rHo.hoImgWidth; 147 | 148 | rdPtr->Direction = HORIZONTAL; 149 | rdPtr->roc.rcChanged = true; 150 | 151 | int MinSize = min(OldSize,NewSize); 152 | int * NewCustom = new int[NewSize]; 153 | memset(NewCustom,0,NewSize*sizeof(int)); 154 | 155 | for(int i=0; iCustomArray[i]; 157 | 158 | delete[] rdPtr->CustomArray; 159 | rdPtr->CustomArray = NewCustom; 160 | 161 | return 0; 162 | } 163 | 164 | short WINAPI DLLExport actSetVertical(LPRDATA rdPtr, long param1, long param2) 165 | { 166 | int OldSize = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 167 | int NewSize = rdPtr->rHo.hoImgHeight; 168 | 169 | rdPtr->Direction = VERTICAL; 170 | rdPtr->roc.rcChanged = true; 171 | 172 | int MinSize = min(OldSize,NewSize); 173 | int * NewCustom = new int[NewSize]; 174 | memset(NewCustom,0,NewSize*sizeof(int)); 175 | 176 | for(int i=0; iCustomArray[i]; 178 | 179 | delete[] rdPtr->CustomArray; 180 | rdPtr->CustomArray = NewCustom; 181 | 182 | return 0; 183 | } 184 | 185 | short WINAPI DLLExport actSetLeftTop(LPRDATA rdPtr, long param1, long param2) 186 | { 187 | rdPtr->PerspectiveDir = 0; 188 | rdPtr->roc.rcChanged = true; 189 | return 0; 190 | } 191 | 192 | short WINAPI DLLExport actSetRightBottom(LPRDATA rdPtr, long param1, long param2) 193 | { 194 | rdPtr->PerspectiveDir = 1; 195 | rdPtr->roc.rcChanged = true; 196 | return 0; 197 | } 198 | 199 | short WINAPI DLLExport actSetCustomValue(LPRDATA rdPtr, long param1, long param2) 200 | { 201 | int size = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 202 | 203 | if(param1 >= 0 && param1 < size) 204 | rdPtr->CustomArray[param1] = param2; 205 | 206 | rdPtr->roc.rcChanged = true; 207 | 208 | return 0; 209 | } 210 | 211 | short WINAPI DLLExport actSetWidth(LPRDATA rdPtr, long param1, long param2) 212 | { 213 | int oldSize = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 214 | rdPtr->rHo.hoImgWidth = param1; 215 | return resizePerspective(rdPtr, oldSize); 216 | } 217 | 218 | short WINAPI DLLExport actSetHeight(LPRDATA rdPtr, long param1, long param2) 219 | { 220 | int oldSize = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 221 | rdPtr->rHo.hoImgHeight = param1; 222 | return resizePerspective(rdPtr, oldSize); 223 | } 224 | 225 | 226 | int resizePerspective(LPRDATA rdPtr, int oldsize){ 227 | //Recreate temp-image 228 | /* rdPtr->TempImage->Delete(); 229 | fprh rhPtr = rdPtr->rHo.hoAdRunHeader; 230 | LPSURFACE ps = WinGetSurface((int)rhPtr->rhIdEditWin); 231 | LPSURFACE pProto = NULL; 232 | if ( GetSurfacePrototype(&pProto, ps->GetDepth(), ST_MEMORY, SD_DIB) ){ 233 | rdPtr->TempImage->Create(rdPtr->rHo.hoImgWidth, rdPtr->rHo.hoImgHeight, pProto); 234 | if( !rdPtr->TempImage->IsValid() ) 235 | {return -1;} 236 | } */ 237 | 238 | // Delete temp image so that it's automatically recreated with the correct size 239 | if ( rdPtr->TempImage != NULL ) 240 | { 241 | delete rdPtr->TempImage; 242 | rdPtr->TempImage = NULL; 243 | } 244 | 245 | //Recreate temp-array 246 | 247 | int size = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 248 | int * newArray = new int[size]; 249 | int numNewInts = min(size,oldsize); 250 | for(int i=0;iCustomArray[i]; 253 | else 254 | newArray[i] = 0; 255 | } 256 | delete [] rdPtr->CustomArray; 257 | rdPtr->CustomArray = newArray; 258 | rdPtr->roc.rcChanged = true; 259 | 260 | return 0; 261 | } 262 | 263 | 264 | short WINAPI DLLExport actSetResampleOn(LPRDATA rdPtr, long param1, long param2) 265 | { 266 | rdPtr->resample = true; 267 | rdPtr->roc.rcChanged = true; 268 | return 0; 269 | } 270 | 271 | short WINAPI DLLExport actSetResampleOff(LPRDATA rdPtr, long param1, long param2) 272 | { 273 | rdPtr->resample = false; 274 | rdPtr->roc.rcChanged = true; 275 | return 0; 276 | } 277 | 278 | 279 | // ============================================================================ 280 | // 281 | // EXPRESSIONS ROUTINES 282 | // 283 | // ============================================================================ 284 | 285 | long WINAPI DLLExport expGetZoomValue(LPRDATA rdPtr, long param1) 286 | { 287 | return rdPtr->ZoomValue; 288 | } 289 | 290 | long WINAPI DLLExport expGetOffset(LPRDATA rdPtr, long param1) 291 | { 292 | return rdPtr->Offset; 293 | } 294 | 295 | long WINAPI DLLExport expNumWaves(LPRDATA rdPtr, long param1) 296 | { 297 | return rdPtr->SineWaveWaves; 298 | } 299 | 300 | long WINAPI DLLExport expGetCustom(LPRDATA rdPtr, long param1) 301 | { 302 | long p1=CNC_GetFirstExpressionParameter(rdPtr, param1, TYPE_INT); 303 | int size = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 304 | 305 | return rdPtr->CustomArray[min(max(0,p1),size-1)]; 306 | } 307 | 308 | long WINAPI DLLExport expGetWidth(LPRDATA rdPtr, long param1) 309 | { 310 | return rdPtr->rHo.hoImgWidth; 311 | } 312 | 313 | long WINAPI DLLExport expGetHeight(LPRDATA rdPtr, long param1) 314 | { 315 | return rdPtr->rHo.hoImgHeight; 316 | } 317 | 318 | // ---------------------------------------------------------- 319 | // Condition / Action / Expression jump table 320 | // ---------------------------------------------------------- 321 | // Contains the address inside the extension of the different 322 | // routines that handle the action, conditions and expressions. 323 | // Located at the end of the source for convinience 324 | // Must finish with a 0 325 | // 326 | long (WINAPI * ConditionJumps[])(LPRDATA rdPtr, long param1, long param2) = 327 | { 328 | 0}; 329 | 330 | short (WINAPI * ActionJumps[])(LPRDATA rdPtr, long param1, long param2) = 331 | { 332 | actSetZoomValue, 333 | actSetPanorama, 334 | actSetPerspective, 335 | actSetSineWave, 336 | actSetCustom, 337 | actSetNumWaves, 338 | actSetOffset, 339 | actSetHorizontal, 340 | actSetVertical, 341 | actSetLeftTop, 342 | actSetRightBottom, 343 | actSetCustomValue, 344 | actSetWidth, 345 | actSetHeight, 346 | actSetResampleOn, 347 | actSetResampleOff, 348 | actSetSineOffset, 349 | actSetCustomOffset, 350 | 0 351 | }; 352 | 353 | long (WINAPI * ExpressionJumps[])(LPRDATA rdPtr, long param) = 354 | { 355 | expGetZoomValue, 356 | expGetOffset, 357 | expNumWaves, 358 | expGetCustom, 359 | expGetWidth, 360 | expGetHeight, 361 | 0 362 | }; -------------------------------------------------------------------------------- /Perspective.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="Perspective" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 6 | 7 | CFG=Perspective - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "Perspective.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "Perspective.mak" CFG="Perspective - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "Perspective - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") 21 | !MESSAGE "Perspective - Win32 Release_Small" (based on "Win32 (x86) Dynamic-Link Library") 22 | !MESSAGE "Perspective - Win32 Run_Only_Small" (based on "Win32 (x86) Dynamic-Link Library") 23 | !MESSAGE "Perspective - Win32 Vitalize" (based on "Win32 (x86) Dynamic-Link Library") 24 | !MESSAGE "Perspective - Win32 Vitalize_Small" (based on "Win32 (x86) Dynamic-Link Library") 25 | !MESSAGE "Perspective - Win32 Release_Hwa" (based on "Win32 (x86) Dynamic-Link Library") 26 | !MESSAGE "Perspective - Win32 Run_Only_Hwa" (based on "Win32 (x86) Dynamic-Link Library") 27 | !MESSAGE 28 | 29 | # Begin Project 30 | # PROP AllowPerConfigDependencies 0 31 | # PROP Scc_ProjName "" 32 | # PROP Scc_LocalPath "" 33 | CPP=cl.exe 34 | MTL=midl.exe 35 | RSC=rc.exe 36 | 37 | !IF "$(CFG)" == "Perspective - Win32 Debug" 38 | 39 | # PROP BASE Use_MFC 0 40 | # PROP BASE Use_Debug_Libraries 1 41 | # PROP BASE Output_Dir "Debug" 42 | # PROP BASE Intermediate_Dir "Debug" 43 | # PROP BASE Target_Dir "" 44 | # PROP Use_MFC 0 45 | # PROP Use_Debug_Libraries 1 46 | # PROP Output_Dir ".\Debug" 47 | # PROP Intermediate_Dir ".\Debug" 48 | # PROP Ignore_Export_Lib 0 49 | # PROP Target_Dir "" 50 | # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "V2Perspective32_EXPORTS" /YX /FD /GZ /c 51 | # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "\MMF2Sdk\Inc" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /YX /FD /GZ /c 52 | # SUBTRACT CPP /Fr 53 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 54 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 55 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 56 | # ADD RSC /l 0x409 /fo".\Debug\Ext.res" /i "\MMF2Sdk\Inc" /d "_DEBUG" /d "EDITOR" 57 | BSC32=bscmake.exe 58 | # ADD BASE BSC32 /nologo 59 | # ADD BSC32 /nologo 60 | LINK32=link.exe 61 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept 62 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2_hwa\dll\debug\mmfs2.lib /nologo /dll /debug /machine:I386 /def:".\Ext.def" /out:"\mmf2_hwa\run\extensions\hwa\Perspective.mfx" 63 | # SUBTRACT LINK32 /pdb:none 64 | 65 | !ELSEIF "$(CFG)" == "Perspective - Win32 Release_Small" 66 | 67 | # PROP BASE Use_MFC 0 68 | # PROP BASE Use_Debug_Libraries 0 69 | # PROP BASE Output_Dir "V2Perspective32___Win32_Release_Small" 70 | # PROP BASE Intermediate_Dir "V2Perspective32___Win32_Release_Small" 71 | # PROP BASE Ignore_Export_Lib 0 72 | # PROP BASE Target_Dir "" 73 | # PROP Use_MFC 0 74 | # PROP Use_Debug_Libraries 0 75 | # PROP Output_Dir ".\Release_Small" 76 | # PROP Intermediate_Dir ".\Release_Small" 77 | # PROP Ignore_Export_Lib 0 78 | # PROP Target_Dir "" 79 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /YX /FD /c 80 | # ADD CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "COMPILE_SMALL" /YX /FD /c 81 | # SUBTRACT CPP /Fr 82 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 83 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 84 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 85 | # ADD RSC /l 0x409 /fo".\Release_Small\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "EDITOR" 86 | BSC32=bscmake.exe 87 | # ADD BASE BSC32 /nologo 88 | # ADD BSC32 /nologo 89 | LINK32=link.exe 90 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\cncs32.lib /nologo /dll /machine:I386 /out:".\Release/Perspective.mfx" 91 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2Sdk\lib\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Release_Small/Perspective.mfx" 92 | # SUBTRACT LINK32 /pdb:none /nodefaultlib 93 | # Begin Special Build Tool 94 | TargetPath=.\Release_Small\Perspective.mfx 95 | SOURCE="$(InputPath)" 96 | PostBuild_Cmds=copy $(TargetPath) .\ToInstall\Files\Extensions 97 | # End Special Build Tool 98 | 99 | !ELSEIF "$(CFG)" == "Perspective - Win32 Run_Only_Small" 100 | 101 | # PROP BASE Use_MFC 0 102 | # PROP BASE Use_Debug_Libraries 0 103 | # PROP BASE Output_Dir "V2Perspective32___Win32_Run_Only_Small" 104 | # PROP BASE Intermediate_Dir "V2Perspective32___Win32_Run_Only_Small" 105 | # PROP BASE Ignore_Export_Lib 0 106 | # PROP BASE Target_Dir "" 107 | # PROP Use_MFC 0 108 | # PROP Use_Debug_Libraries 0 109 | # PROP Output_Dir ".\Run_Only_Small" 110 | # PROP Intermediate_Dir ".\Run_Only_Small" 111 | # PROP Ignore_Export_Lib 0 112 | # PROP Target_Dir "" 113 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /YX /FD /c 114 | # ADD CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /D "COMPILE_SMALL" /YX /FD /c 115 | # SUBTRACT CPP /Fr 116 | # ADD BASE MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 117 | # ADD MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 118 | # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "RUN_ONLY" 119 | # ADD RSC /l 0x409 /fo".\Run_Only_Small\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "RUN_ONLY" 120 | BSC32=bscmake.exe 121 | # ADD BASE BSC32 /nologo 122 | # ADD BSC32 /nologo 123 | LINK32=link.exe 124 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\cncs32.lib /nologo /dll /machine:I386 /out:".\Run_Only/Perspective.mfx" 125 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2Sdk\lib\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Run_Only_Small/Perspective.mfx" 126 | # SUBTRACT LINK32 /pdb:none /nodefaultlib 127 | # Begin Special Build Tool 128 | TargetPath=.\Run_Only_Small\Perspective.mfx 129 | SOURCE="$(InputPath)" 130 | PostBuild_Cmds=copy $(TargetPath) .\ToInstall\Files\Data\Runtime 131 | # End Special Build Tool 132 | 133 | !ELSEIF "$(CFG)" == "Perspective - Win32 Vitalize" 134 | 135 | # PROP BASE Use_MFC 0 136 | # PROP BASE Use_Debug_Libraries 0 137 | # PROP BASE Output_Dir "V2Perspective32___Win32_Vitalize" 138 | # PROP BASE Intermediate_Dir "V2Perspective32___Win32_Vitalize" 139 | # PROP BASE Ignore_Export_Lib 0 140 | # PROP BASE Target_Dir "" 141 | # PROP Use_MFC 0 142 | # PROP Use_Debug_Libraries 0 143 | # PROP Output_Dir ".\Vitalize" 144 | # PROP Intermediate_Dir ".\Vitalize" 145 | # PROP Ignore_Export_Lib 0 146 | # PROP Target_Dir "" 147 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /YX /FD /c 148 | # ADD CPP /nologo /MD /W3 /GX /O2 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /D "VITALIZE" /YX /FD /c 149 | # SUBTRACT CPP /Fr 150 | # ADD BASE MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 151 | # ADD MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 152 | # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "RUN_ONLY" 153 | # ADD RSC /l 0x409 /fo".\Vitalize\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "RUN_ONLY" /d "VITALIZE" 154 | BSC32=bscmake.exe 155 | # ADD BASE BSC32 /nologo 156 | # ADD BSC32 /nologo 157 | LINK32=link.exe 158 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib\cncs32.lib /nologo /dll /machine:I386 /out:".\Run_Only/Perspective.mfx" 159 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2Sdk\lib\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Vitalize\Perspective.mox" 160 | # SUBTRACT LINK32 /pdb:none 161 | 162 | !ELSEIF "$(CFG)" == "Perspective - Win32 Vitalize_Small" 163 | 164 | # PROP BASE Use_MFC 0 165 | # PROP BASE Use_Debug_Libraries 0 166 | # PROP BASE Output_Dir "V2Perspective32___Win32_Vitalize_Small" 167 | # PROP BASE Intermediate_Dir "V2Perspective32___Win32_Vitalize_Small" 168 | # PROP BASE Ignore_Export_Lib 0 169 | # PROP BASE Target_Dir "" 170 | # PROP Use_MFC 0 171 | # PROP Use_Debug_Libraries 0 172 | # PROP Output_Dir ".\Vitalize_Small" 173 | # PROP Intermediate_Dir ".\Vitalize_Small" 174 | # PROP Ignore_Export_Lib 0 175 | # PROP Target_Dir "" 176 | # ADD BASE CPP /nologo /W3 /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /D "COMPILE_SMALL" /YX /FD /c 177 | # ADD CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /D "COMPILE_SMALL" /D "VITALIZE" /YX /FD /c 178 | # SUBTRACT CPP /Fr 179 | # ADD BASE MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 180 | # ADD MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 181 | # ADD BASE RSC /l 0x409 /d "NDEBUG" /d "RUN_ONLY" 182 | # ADD RSC /l 0x409 /fo".\Vitalize_Small\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "RUN_ONLY" /d "VITALIZE" 183 | BSC32=bscmake.exe 184 | # ADD BASE BSC32 /nologo 185 | # ADD BSC32 /nologo 186 | LINK32=link.exe 187 | # ADD BASE LINK32 kernel32.lib user32.lib msvcrt.lib ..\lib\cncs32.lib /nologo /dll /machine:I386 /nodefaultlib /out:".\Run_Only_Small/Perspective.mfx" 188 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2Sdk\lib\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Vitalize_Small/Perspective.mox" 189 | # SUBTRACT LINK32 /pdb:none /nodefaultlib 190 | 191 | !ELSEIF "$(CFG)" == "Perspective - Win32 Release_Hwa" 192 | 193 | # PROP BASE Use_MFC 0 194 | # PROP BASE Use_Debug_Libraries 0 195 | # PROP BASE Output_Dir "Perspective___Win32_Release_Hwa" 196 | # PROP BASE Intermediate_Dir "Perspective___Win32_Release_Hwa" 197 | # PROP BASE Ignore_Export_Lib 0 198 | # PROP BASE Target_Dir "" 199 | # PROP Use_MFC 0 200 | # PROP Use_Debug_Libraries 0 201 | # PROP Output_Dir "Release_Hwa" 202 | # PROP Intermediate_Dir "Release_Hwa" 203 | # PROP Ignore_Export_Lib 0 204 | # PROP Target_Dir "" 205 | # ADD BASE CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "COMPILE_SMALL" /Fr /YX /FD /c 206 | # ADD CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "COMPILE_SMALL" /YX /FD /c 207 | # SUBTRACT CPP /Fr 208 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 209 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 210 | # ADD BASE RSC /l 0x409 /fo".\Release_Small\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "EDITOR" 211 | # ADD RSC /l 0x409 /fo".\Release_Hwa\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "EDITOR" 212 | BSC32=bscmake.exe 213 | # ADD BASE BSC32 /nologo 214 | # ADD BSC32 /nologo 215 | LINK32=link.exe 216 | # ADD BASE LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2Sdk\lib\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Release_Small/Perspective.mfx" 217 | # SUBTRACT BASE LINK32 /pdb:none /nodefaultlib 218 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2_Hwa\dll\release\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Release_Hwa/Perspective.mfx" 219 | # SUBTRACT LINK32 /pdb:none /nodefaultlib 220 | # Begin Special Build Tool 221 | TargetPath=.\Release_Hwa\Perspective.mfx 222 | SOURCE="$(InputPath)" 223 | PostBuild_Cmds=@rem copy $(TargetPath) .\ToInstall\Files\Extensions 224 | # End Special Build Tool 225 | 226 | !ELSEIF "$(CFG)" == "Perspective - Win32 Run_Only_Hwa" 227 | 228 | # PROP BASE Use_MFC 0 229 | # PROP BASE Use_Debug_Libraries 0 230 | # PROP BASE Output_Dir "Perspective___Win32_Run_Only_Hwa" 231 | # PROP BASE Intermediate_Dir "Perspective___Win32_Run_Only_Hwa" 232 | # PROP BASE Ignore_Export_Lib 0 233 | # PROP BASE Target_Dir "" 234 | # PROP Use_MFC 0 235 | # PROP Use_Debug_Libraries 0 236 | # PROP Output_Dir ".\Run_Only_Hwa" 237 | # PROP Intermediate_Dir ".\Run_Only_Hwa" 238 | # PROP Ignore_Export_Lib 0 239 | # PROP Target_Dir "" 240 | # ADD BASE CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /D "COMPILE_SMALL" /Fr /YX /FD /c 241 | # ADD CPP /nologo /MD /W3 /O1 /I "\MMF2Sdk\Inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "STRICT" /D "RUN_ONLY" /D "COMPILE_SMALL" /YX /FD /c 242 | # SUBTRACT CPP /Fr 243 | # ADD BASE MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 244 | # ADD MTL /nologo /D "NDEBUG" /D "RUN_ONLY" /mktyplib203 /win32 245 | # ADD BASE RSC /l 0x409 /fo".\Run_Only_Small\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "RUN_ONLY" 246 | # ADD RSC /l 0x409 /fo".\Run_Only_Hwa\Ext.res" /i "\MMF2Sdk\Inc" /d "NDEBUG" /d "RUN_ONLY" 247 | BSC32=bscmake.exe 248 | # ADD BASE BSC32 /nologo 249 | # ADD BSC32 /nologo 250 | LINK32=link.exe 251 | # ADD BASE LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2Sdk\lib\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Run_Only_Small/Perspective.mfx" 252 | # SUBTRACT BASE LINK32 /pdb:none /nodefaultlib 253 | # ADD LINK32 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib \MMF2_Hwa\dll\release\mmfs2.lib /nologo /dll /machine:I386 /def:".\Ext.def" /out:".\Run_Only_Hwa/Perspective.mfx" 254 | # SUBTRACT LINK32 /pdb:none /nodefaultlib 255 | # Begin Special Build Tool 256 | TargetPath=.\Run_Only_Hwa\Perspective.mfx 257 | SOURCE="$(InputPath)" 258 | PostBuild_Cmds=@rem copy $(TargetPath) .\ToInstall\Files\Data\Runtime 259 | # End Special Build Tool 260 | 261 | !ENDIF 262 | 263 | # Begin Target 264 | 265 | # Name "Perspective - Win32 Debug" 266 | # Name "Perspective - Win32 Release_Small" 267 | # Name "Perspective - Win32 Run_Only_Small" 268 | # Name "Perspective - Win32 Vitalize" 269 | # Name "Perspective - Win32 Vitalize_Small" 270 | # Name "Perspective - Win32 Release_Hwa" 271 | # Name "Perspective - Win32 Run_Only_Hwa" 272 | # Begin Group "Source Files" 273 | 274 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 275 | # Begin Source File 276 | 277 | SOURCE=.\Edittime.cpp 278 | # End Source File 279 | # Begin Source File 280 | 281 | SOURCE=.\Ext.def 282 | # PROP Exclude_From_Scan -1 283 | 284 | !IF "$(CFG)" == "Perspective - Win32 Debug" 285 | 286 | # PROP BASE Exclude_From_Build 1 287 | 288 | !ELSEIF "$(CFG)" == "Perspective - Win32 Release_Small" 289 | 290 | # PROP BASE Exclude_From_Build 1 291 | 292 | !ELSEIF "$(CFG)" == "Perspective - Win32 Run_Only_Small" 293 | 294 | # PROP BASE Exclude_From_Build 1 295 | 296 | !ELSEIF "$(CFG)" == "Perspective - Win32 Vitalize" 297 | 298 | # PROP BASE Exclude_From_Build 1 299 | 300 | !ELSEIF "$(CFG)" == "Perspective - Win32 Vitalize_Small" 301 | 302 | # PROP BASE Exclude_From_Build 1 303 | 304 | !ELSEIF "$(CFG)" == "Perspective - Win32 Release_Hwa" 305 | 306 | !ELSEIF "$(CFG)" == "Perspective - Win32 Run_Only_Hwa" 307 | 308 | !ENDIF 309 | 310 | # End Source File 311 | # Begin Source File 312 | 313 | SOURCE=.\Ext.rc 314 | # PROP Exclude_From_Scan -1 315 | 316 | !IF "$(CFG)" == "Perspective - Win32 Debug" 317 | 318 | # PROP BASE Exclude_From_Build 1 319 | 320 | !ELSEIF "$(CFG)" == "Perspective - Win32 Release_Small" 321 | 322 | # PROP BASE Exclude_From_Build 1 323 | 324 | !ELSEIF "$(CFG)" == "Perspective - Win32 Run_Only_Small" 325 | 326 | # PROP BASE Exclude_From_Build 1 327 | 328 | !ELSEIF "$(CFG)" == "Perspective - Win32 Vitalize" 329 | 330 | # PROP BASE Exclude_From_Build 1 331 | 332 | !ELSEIF "$(CFG)" == "Perspective - Win32 Vitalize_Small" 333 | 334 | # PROP BASE Exclude_From_Build 1 335 | 336 | !ELSEIF "$(CFG)" == "Perspective - Win32 Release_Hwa" 337 | 338 | !ELSEIF "$(CFG)" == "Perspective - Win32 Run_Only_Hwa" 339 | 340 | !ENDIF 341 | 342 | # End Source File 343 | # Begin Source File 344 | 345 | SOURCE=.\General.cpp 346 | # End Source File 347 | # Begin Source File 348 | 349 | SOURCE=.\Main.cpp 350 | # End Source File 351 | # Begin Source File 352 | 353 | SOURCE=.\Runtime.cpp 354 | # End Source File 355 | # End Group 356 | # Begin Group "Header Files" 357 | 358 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 359 | # Begin Source File 360 | 361 | SOURCE=.\Common.h 362 | # End Source File 363 | # Begin Source File 364 | 365 | SOURCE=.\Main.h 366 | # End Source File 367 | # Begin Source File 368 | 369 | SOURCE=.\Resource.h 370 | # End Source File 371 | # Begin Source File 372 | 373 | SOURCE=.\TigsExt.hpp 374 | # End Source File 375 | # End Group 376 | # Begin Group "Resource Files" 377 | 378 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 379 | # Begin Source File 380 | 381 | SOURCE=.\res\EXTICON.BMP 382 | # PROP Exclude_From_Scan -1 383 | # PROP BASE Exclude_From_Build 1 384 | # PROP Exclude_From_Build 1 385 | # End Source File 386 | # Begin Source File 387 | 388 | SOURCE=.\res\Extimg.bmp 389 | # PROP Exclude_From_Scan -1 390 | # PROP BASE Exclude_From_Build 1 391 | # PROP Exclude_From_Build 1 392 | # End Source File 393 | # End Group 394 | # Begin Group "Information" 395 | 396 | # PROP Default_Filter "txt" 397 | # Begin Source File 398 | 399 | SOURCE=..\Help\CoxSdk.chm 400 | # End Source File 401 | # End Group 402 | # Begin Group "MMF Headers" 403 | 404 | # PROP Default_Filter "" 405 | # Begin Source File 406 | 407 | SOURCE="C:\Program Files\Microsoft Visual Studio\Vc98\Include\Basetsd.h" 408 | # End Source File 409 | # Begin Source File 410 | 411 | SOURCE=..\..\Inc\Ccx.h 412 | # End Source File 413 | # Begin Source File 414 | 415 | SOURCE=..\..\Inc\Ccxhdr.h 416 | # End Source File 417 | # Begin Source File 418 | 419 | SOURCE=..\..\Inc\CfcError.h 420 | # End Source File 421 | # Begin Source File 422 | 423 | SOURCE=..\..\Inc\CfcFile.h 424 | # End Source File 425 | # Begin Source File 426 | 427 | SOURCE=..\..\Inc\Cncf.h 428 | # End Source File 429 | # Begin Source File 430 | 431 | SOURCE=..\..\Inc\cncr.h 432 | # End Source File 433 | # Begin Source File 434 | 435 | SOURCE=..\..\Inc\Cncy.h 436 | # End Source File 437 | # Begin Source File 438 | 439 | SOURCE=..\..\Inc\Cnpdll.h 440 | # End Source File 441 | # Begin Source File 442 | 443 | SOURCE=..\..\Inc\colors.h 444 | # End Source File 445 | # Begin Source File 446 | 447 | SOURCE=..\..\Inc\EVTCCX.H 448 | # End Source File 449 | # Begin Source File 450 | 451 | SOURCE=..\..\Inc\Fill.h 452 | # End Source File 453 | # Begin Source File 454 | 455 | SOURCE=..\..\Inc\FilterMgr.h 456 | # End Source File 457 | # Begin Source File 458 | 459 | SOURCE=..\..\Inc\ImageFlt.h 460 | # End Source File 461 | # Begin Source File 462 | 463 | SOURCE=..\..\Inc\ImgFlt.h 464 | # End Source File 465 | # Begin Source File 466 | 467 | SOURCE=..\..\Inc\Palet.h 468 | # End Source File 469 | # Begin Source File 470 | 471 | SOURCE=..\..\Inc\PictEdDefs.h 472 | # End Source File 473 | # Begin Source File 474 | 475 | SOURCE=..\..\Inc\Props.h 476 | # End Source File 477 | # Begin Source File 478 | 479 | SOURCE=..\..\Inc\PTYPE.H 480 | # End Source File 481 | # Begin Source File 482 | 483 | SOURCE=..\..\Inc\SoundFilter.h 484 | # End Source File 485 | # Begin Source File 486 | 487 | SOURCE=..\..\Inc\SoundFilterMgr.h 488 | # End Source File 489 | # Begin Source File 490 | 491 | SOURCE=..\..\Inc\Surface.h 492 | # End Source File 493 | # Begin Source File 494 | 495 | SOURCE=..\..\Inc\TigsExt.hpp 496 | # End Source File 497 | # Begin Source File 498 | 499 | SOURCE=..\..\Inc\WinMacro.h 500 | # End Source File 501 | # End Group 502 | # End Target 503 | # End Project 504 | -------------------------------------------------------------------------------- /Runtime.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // 3 | // This file contains routines that are handled during the Runtime. 4 | // 5 | // Including creating, display, and handling your object. 6 | // 7 | // ============================================================================ 8 | 9 | // Common Include 10 | #include "common.h" 11 | 12 | // DEBUGGER ///////////////////////////////////////////////////////////////// 13 | 14 | #if !defined(RUN_ONLY) 15 | // Identifiers of items displayed in the debugger 16 | enum 17 | { 18 | // Example 19 | // ------- 20 | // DB_CURRENTSTRING, 21 | // DB_CURRENTVALUE, 22 | // DB_CURRENTCHECK, 23 | // DB_CURRENTCOMBO 24 | }; 25 | 26 | // Items displayed in the debugger 27 | WORD DebugTree[]= 28 | { 29 | // Example 30 | // ------- 31 | // DB_CURRENTSTRING|DB_EDITABLE, 32 | // DB_CURRENTVALUE|DB_EDITABLE, 33 | // DB_CURRENTCHECK, 34 | // DB_CURRENTCOMBO, 35 | 36 | // End of table (required) 37 | DB_END 38 | }; 39 | 40 | #endif // !defined(RUN_ONLY) 41 | 42 | 43 | // -------------------- 44 | // GetRunObjectDataSize 45 | // -------------------- 46 | // Returns the size of the runtime datazone of the object 47 | // 48 | ushort WINAPI DLLExport GetRunObjectDataSize(fprh rhPtr, LPEDATA edPtr) 49 | { 50 | return(sizeof(RUNDATA)); 51 | } 52 | 53 | 54 | // ---------------- 55 | // OnLostDevice : called when the device is lost 56 | // ---------------- 57 | void CALLBACK OnLostDevice(cSurface* pSf, LPARAM lParam) 58 | { 59 | if ( lParam != 0 ) 60 | { 61 | LPRDATA rdPtr = (LPRDATA)lParam; 62 | if ( rdPtr != NULL ) 63 | { 64 | // Delete HWA surfaces 65 | if ( rdPtr->TempImage != NULL ) 66 | { 67 | delete rdPtr->TempImage; 68 | rdPtr->TempImage = NULL; 69 | } 70 | } 71 | } 72 | } 73 | 74 | // --------------- 75 | // CreateRunObject 76 | // --------------- 77 | // The routine where the object is actually created 78 | // 79 | short WINAPI DLLExport CreateRunObject(LPRDATA rdPtr, LPEDATA edPtr, fpcob cobPtr) 80 | { 81 | fprh rhPtr = rdPtr->rHo.hoAdRunHeader; 82 | LPSURFACE ps = WinGetSurface((int)rhPtr->rhIdEditWin); 83 | 84 | rdPtr->ZoomValue = edPtr->DefaultZoom; 85 | rdPtr->Offset = edPtr->DefaultOffset; 86 | rdPtr->Effect = edPtr->Effect; 87 | rdPtr->Direction = edPtr->Direction; 88 | rdPtr->PerspectiveDir = edPtr->PerspectiveDir; 89 | rdPtr->SineWaveWaves = edPtr->SineWaveWaves; 90 | 91 | rdPtr->roc.rcChanged = true; 92 | 93 | rdPtr->rHo.hoImgWidth = edPtr->swidth; 94 | rdPtr->rHo.hoImgHeight = edPtr->sheight; 95 | 96 | rdPtr->resample = edPtr->resample; 97 | 98 | int size = (rdPtr->Direction == HORIZONTAL) ? rdPtr->rHo.hoImgWidth : rdPtr->rHo.hoImgHeight; 99 | 100 | rdPtr->CustomArray = new int[size]; 101 | for(int i=0;iCustomArray[i] = rdPtr->ZoomValue; 103 | 104 | BOOL bHWA = ((rhPtr->rh4.rh4Mv->mvAppMode & SM_D3D) != 0); 105 | if ( bHWA ) 106 | { 107 | mvNeebBackgroundAccess(rhPtr->rh4.rh4Mv, rhPtr->rhFrame, TRUE); 108 | if ( ps != NULL ) 109 | ps->AddLostDeviceCallBack(OnLostDevice, (LPARAM)rdPtr); 110 | } 111 | 112 | return 0; 113 | } 114 | 115 | 116 | // ---------------- 117 | // DestroyRunObject 118 | // ---------------- 119 | // Destroys the run-time object 120 | // 121 | short WINAPI DLLExport DestroyRunObject(LPRDATA rdPtr, long fast) 122 | { 123 | // HWA: remove lost device callback function 124 | fprh rhPtr = rdPtr->rHo.hoAdRunHeader; 125 | BOOL bHWA = ((rhPtr->rh4.rh4Mv->mvAppMode & SM_D3D) != 0); 126 | if ( bHWA ) 127 | { 128 | cSurface* psf = WinGetSurface((int)rdPtr->rHo.hoAdRunHeader->rhIdEditWin); 129 | if ( psf != NULL ) 130 | psf->RemoveLostDeviceCallBack(OnLostDevice, (LPARAM)rdPtr); 131 | } 132 | 133 | if ( rdPtr->TempImage != NULL ) 134 | { 135 | delete rdPtr->TempImage; 136 | rdPtr->TempImage = NULL; 137 | } 138 | 139 | delete[] rdPtr->CustomArray; 140 | return 0; 141 | } 142 | 143 | 144 | // ---------------- 145 | // HandleRunObject 146 | // ---------------- 147 | // Called (if you want) each loop, this routine makes the object live 148 | // 149 | short WINAPI DLLExport HandleRunObject(LPRDATA rdPtr) 150 | { 151 | if (rdPtr->roc.rcChanged) 152 | return REFLAG_DISPLAY; 153 | else 154 | return 0; 155 | 156 | return 0; 157 | } 158 | 159 | // ---------------- 160 | // DisplayRunObject 161 | // ---------------- 162 | // Draw the object in the application screen. 163 | // 164 | short WINAPI DLLExport DisplayRunObject(LPRDATA rdPtr) 165 | { 166 | fprh rhPtr = rdPtr->rHo.hoAdRunHeader; 167 | LPSURFACE psw = WinGetSurface((int)rhPtr->rhIdEditWin); 168 | LPSURFACE ps = psw; 169 | BOOL bHWA = ((rhPtr->rh4.rh4Mv->mvAppMode & SM_D3D) != 0); 170 | 171 | // Create temp surface 172 | if ( rdPtr->TempImage == NULL ) 173 | { 174 | LPSURFACE pProto = ps; 175 | if ( bHWA ) 176 | GetSurfacePrototype(&pProto, ps->GetDepth(), ST_HWA_RTTEXTURE, ps->GetDriver()); 177 | 178 | rdPtr->TempImage = new cSurface; 179 | rdPtr->TempImage->Create(rdPtr->rHo.hoImgWidth, rdPtr->rHo.hoImgHeight, pProto ); 180 | 181 | if( !rdPtr->TempImage->IsValid() ) 182 | { 183 | // Create a DIB surface if it couldn't create the same surface type as the PS surface. 184 | if ( GetSurfacePrototype(&pProto, ps->GetDepth(), ST_MEMORY, SD_DIB) ) 185 | rdPtr->TempImage->Create(rdPtr->rHo.hoImgWidth, rdPtr->rHo.hoImgHeight, pProto); 186 | } 187 | } 188 | 189 | int ImageWidth = rdPtr->rHo.hoImgWidth; 190 | int ImageHeight = rdPtr->rHo.hoImgHeight; 191 | int X = rdPtr->rHo.hoRect.left; 192 | int Y = rdPtr->rHo.hoRect.top; 193 | int Effect = rdPtr->Effect; 194 | int Zoom = rdPtr->ZoomValue; 195 | int Offset = rdPtr->Offset; 196 | DWORD drawMode = (rdPtr->resample) ? STRF_RESAMPLE : 0; 197 | DWORD blitFlags = 0; 198 | BlitMode blitMethod = BMODE_OPAQUE; 199 | float WaveIncrement = (rdPtr->SineWaveWaves * 360)/(float)ImageHeight; 200 | 201 | if(Effect==SINEOFFSET || Effect == CUSTOMOFFSET){ 202 | if ( !bHWA ) 203 | { 204 | blitMethod = BMODE_TRANSP; 205 | rdPtr->TempImage->Fill(0,0,0); 206 | } 207 | } 208 | 209 | // HWA : get current render target (to use as source) and begin rendering (= set render target to temp surface) 210 | if ( bHWA ) 211 | { 212 | ps = psw->GetRenderTargetSurface(); 213 | rdPtr->TempImage->BeginRendering(TRUE, 0); 214 | //drawMode |= STRF_COPYALPHA; 215 | //blitFlags |= BLTF_COPYALPHA; 216 | } 217 | 218 | // Note for Andos : a switch / case is usually more optimized than series of if 219 | 220 | //------------------- 221 | // PANORAMA EFFECT 222 | //------------------- 223 | 224 | if(Effect == PANORAMA && rdPtr->Direction == HORIZONTAL) 225 | for(int i = 0; i <= ImageWidth; i++) 226 | { 227 | float CurrentSinStep = (float)((float)(i-ImageWidth/2)/(ImageWidth/3.1415) + 3.1415/2); 228 | int CurrentHeight = (int)max(1,ImageHeight + sin( CurrentSinStep ) * Zoom - Zoom); 229 | 230 | ps->Stretch( *rdPtr->TempImage, i, 0, 1, ImageHeight, X+i, Y+ImageHeight/2-CurrentHeight/2, 1, CurrentHeight,BMODE_OPAQUE,BOP_COPY,0,drawMode); 231 | } 232 | 233 | if(Effect == PANORAMA && rdPtr->Direction == VERTICAL) 234 | for(int i = 0; i <= ImageHeight; i++) 235 | { 236 | float CurrentSinStep = (float)((float)(i-ImageHeight/2)/(ImageHeight/3.1415) + 3.1415/2); 237 | int CurrentWidth = (int)max(1,ImageWidth + sin( CurrentSinStep ) * Zoom - Zoom); 238 | 239 | ps->Stretch( *rdPtr->TempImage, 0, i, ImageWidth, 1, X+ImageWidth/2-CurrentWidth/2, Y+i, CurrentWidth, 1,BMODE_OPAQUE,BOP_COPY,0,drawMode); 240 | } 241 | 242 | //------------------- 243 | // PERSPECTIVE EFFECT 244 | //------------------- 245 | 246 | //LEFT -> RIGHT 247 | if(Effect == PERSPECTIVE && rdPtr->Direction == HORIZONTAL && rdPtr->PerspectiveDir == LEFTRIGHTTOPBOTTOM) 248 | for(int i = 0; i <= ImageWidth; i++) 249 | { 250 | int CurrentZoom = (i*Zoom)/ImageWidth; 251 | float CurrentFactor = (float)((ImageHeight + CurrentZoom)/( ImageHeight+0.0)); 252 | int FinalHeight = (int)(ImageHeight / CurrentFactor + 0.5); 253 | ps->Stretch( *rdPtr->TempImage, i, 0, 1, ImageHeight, X+i, Y + ImageHeight/2 - FinalHeight/2, 1, FinalHeight,BMODE_OPAQUE,BOP_COPY,0,drawMode); 254 | } 255 | 256 | //TOP -> BOTTOM 257 | if(Effect == PERSPECTIVE && rdPtr->Direction == VERTICAL && rdPtr->PerspectiveDir == LEFTRIGHTTOPBOTTOM) 258 | for(int i = 0; i <= ImageHeight; i++) 259 | { 260 | int CurrentZoom = (i*Zoom)/ImageHeight; 261 | float CurrentFactor = (float)((ImageWidth + CurrentZoom)/( ImageWidth+0.0)); 262 | int FinalWidth = (int)(ImageWidth / CurrentFactor + 0.5); 263 | ps->Stretch( *rdPtr->TempImage, 0, i, ImageWidth, 1, X+ImageWidth/2-FinalWidth/2, Y+i, FinalWidth, 1,BMODE_OPAQUE,BOP_COPY,0,drawMode); 264 | } 265 | 266 | 267 | //LEFT <- RIGHT 268 | if(Effect == PERSPECTIVE && rdPtr->Direction == HORIZONTAL && rdPtr->PerspectiveDir == RIGHTLEFTBOTTOMTOP) 269 | for(int i = 0; i <= ImageWidth; i++) 270 | { 271 | int CurrentZoom = ((ImageWidth-i-1)*Zoom)/ImageWidth; 272 | float CurrentFactor = (float)((ImageHeight + CurrentZoom)/( ImageHeight+0.0)); 273 | int FinalHeight = (int)(ImageHeight / CurrentFactor + 0.5); 274 | ps->Stretch( *rdPtr->TempImage, i, 0, 1, ImageHeight, X+i, Y + ImageHeight/2 - FinalHeight/2, 1, FinalHeight,BMODE_OPAQUE,BOP_COPY,0,drawMode); 275 | } 276 | 277 | //TOP <- BOTTOM 278 | if(Effect == PERSPECTIVE && rdPtr->Direction == VERTICAL && rdPtr->PerspectiveDir == RIGHTLEFTBOTTOMTOP) 279 | for(int i = 0; i <= ImageHeight; i++) 280 | { 281 | int CurrentZoom = ((ImageHeight-i-1)*Zoom)/ImageHeight; 282 | float CurrentFactor = (float)((ImageWidth + CurrentZoom)/( ImageWidth+0.0)); 283 | int FinalWidth = (int)(ImageWidth / CurrentFactor + 0.5); 284 | ps->Stretch( *rdPtr->TempImage, 0, i, ImageWidth, 1, X+ImageWidth/2-FinalWidth/2, Y+i, FinalWidth, 1,BMODE_OPAQUE,BOP_COPY,0,drawMode); 285 | } 286 | 287 | 288 | //------------------- 289 | // SINE WAVE EFFECT 290 | //------------------- 291 | 292 | float delta = (float)(3.141592/180.0); 293 | 294 | if(Effect == SINEWAVE && rdPtr->Direction == HORIZONTAL) 295 | for(int i = 0; i <= ImageWidth; i++){ 296 | int FinalHeight = max( 1,(int)(ImageHeight + sin((i*WaveIncrement + rdPtr->Offset)*delta)*rdPtr->ZoomValue - rdPtr->ZoomValue)); 297 | ps->Stretch( *rdPtr->TempImage, i, 0, 1, ImageHeight, X+i, Y + ImageHeight/2 - FinalHeight/2, 1, FinalHeight,BMODE_OPAQUE,BOP_COPY,0,drawMode); 298 | } 299 | 300 | if(Effect == SINEWAVE && rdPtr->Direction == VERTICAL) 301 | for(int i = 0; i <= ImageHeight; i++){ 302 | int FinalWidth = max( 1,(int)(ImageWidth + sin((i*WaveIncrement + rdPtr->Offset)*delta)*rdPtr->ZoomValue - rdPtr->ZoomValue)); 303 | ps->Stretch( *rdPtr->TempImage, 0, i, ImageWidth, 1, X+ImageWidth/2 - FinalWidth/2, Y+i, FinalWidth , 1,BMODE_OPAQUE,BOP_COPY,0,drawMode); 304 | } 305 | 306 | 307 | //------------------- 308 | // SINE OFFSET EFFECT 309 | //------------------- 310 | 311 | if(Effect == SINEOFFSET && rdPtr->Direction == HORIZONTAL) 312 | for(int i = 0; i <= ImageHeight; i++){ 313 | ps->Blit( *rdPtr->TempImage, (int)(sin((i*WaveIncrement+Offset)*delta)*Zoom) , i, X, Y+i,ImageWidth,1,BMODE_OPAQUE,BOP_COPY,0,blitFlags); 314 | } 315 | 316 | if(Effect == SINEOFFSET && rdPtr->Direction == VERTICAL) 317 | for(int i = 0; i <= ImageWidth; i++){ 318 | ps->Blit( *rdPtr->TempImage, i , (int)(sin((i*WaveIncrement+Offset)*delta)*Zoom), X+i, Y,1,ImageHeight,BMODE_OPAQUE,BOP_COPY,0,blitFlags); 319 | } 320 | 321 | 322 | //------------------- 323 | // CUSTOM 324 | //------------------- 325 | if(Effect == CUSTOM && rdPtr->Direction == HORIZONTAL) 326 | for(int i = 0; i <= ImageWidth; i++) 327 | { 328 | int FinalHeight = (int)(ImageHeight / ((rdPtr->CustomArray[i] * (Zoom/100.0) +100) / 100.0)); 329 | ps->Stretch( *rdPtr->TempImage, i, 0, 1, ImageHeight, X+i, Y + ImageHeight/2 - FinalHeight/2+Offset, 1, FinalHeight,BMODE_OPAQUE,BOP_COPY,0,drawMode); 330 | } 331 | 332 | if(Effect == CUSTOM && rdPtr->Direction == VERTICAL) 333 | for(int i = 0; i <= ImageHeight; i++) 334 | { 335 | int FinalWidth = (int)(ImageWidth / ((rdPtr->CustomArray[i] * (Zoom/100.0) +100) / 100.0)); 336 | ps->Stretch( *rdPtr->TempImage, 0, i, ImageWidth, 1, X+ ImageWidth/2 - FinalWidth/2+Offset, Y+i, FinalWidth, 1,BMODE_OPAQUE,BOP_COPY,0,drawMode); 337 | } 338 | 339 | //------------------- 340 | // CUSTOM OFFSET 341 | //------------------- 342 | if(Effect == CUSTOMOFFSET && rdPtr->Direction == HORIZONTAL) 343 | for(int i = 0; i <= ImageWidth; i++){ 344 | ps->Blit(*rdPtr->TempImage, i, (int)(rdPtr->CustomArray[i]*(Zoom/100.0))+Offset, X+i,Y,1,ImageHeight,BMODE_OPAQUE,BOP_COPY,0,blitFlags); 345 | } 346 | 347 | if(Effect == CUSTOMOFFSET && rdPtr->Direction == VERTICAL) 348 | for(int i = 0; i <= ImageHeight; i++){ 349 | ps->Blit(*rdPtr->TempImage, (int)(rdPtr->CustomArray[i]*(Zoom/100.0))+Offset, i, X,Y+i,ImageWidth,1,BMODE_OPAQUE,BOP_COPY,0,blitFlags); 350 | } 351 | 352 | if ( bHWA ) 353 | { 354 | rdPtr->TempImage->EndRendering(); 355 | psw->ReleaseRenderTargetSurface(ps); 356 | } 357 | 358 | //------------------- 359 | // BLIT 360 | //------------------- 361 | 362 | rdPtr->TempImage->Blit( 363 | *psw, 364 | rdPtr->rHo.hoRect.left, 365 | rdPtr->rHo.hoRect.top, 366 | 0,0, 367 | rdPtr->rHo.hoImgWidth, 368 | rdPtr->rHo.hoImgHeight, 369 | blitMethod, 370 | BOP_COPY, 371 | 0 372 | ); 373 | 374 | WinAddZone(rhPtr->rhIdEditWin, &rdPtr->rHo.hoRect); 375 | 376 | return 0; 377 | } 378 | 379 | // ------------------- 380 | // GetRunObjectSurface 381 | // ------------------- 382 | // Implement this function instead of DisplayRunObject if your extension 383 | // supports ink effects and transitions. Note: you can support ink effects 384 | // in DisplayRunObject too, but this is automatically done if you implement 385 | // GetRunObjectSurface (MMF applies the ink effect to the transition). 386 | // 387 | // Note: do not forget to enable the function in the .def file 388 | // if you remove the comments below. 389 | /* 390 | cSurface* WINAPI DLLExport GetRunObjectSurface(LPRDATA rdPtr) 391 | { 392 | return NULL; 393 | } 394 | */ 395 | 396 | // ------------------------- 397 | // GetRunObjectCollisionMask 398 | // ------------------------- 399 | // Implement this function if your extension supports fine collision mode (OEPREFS_FINECOLLISIONS), 400 | // Or if it's a background object and you want Obstacle properties for this object. 401 | // 402 | // Should return NULL if the object is not transparent. 403 | // 404 | // Note: do not forget to enable the function in the .def file 405 | // if you remove the comments below. 406 | // 407 | /* 408 | cSurface* WINAPI DLLExport GetRunObjectCollisionMask(LPRDATA rdPtr, LPARAM lParam) 409 | { 410 | // Typical example for active objects 411 | // ---------------------------------- 412 | // Opaque? collide with box 413 | if ( (rdPtr->rs.rsEffect & EFFECTFLAG_TRANSPARENT) == 0 ) // Note: only if your object has the OEPREFS_INKEFFECTS option 414 | return NULL; 415 | 416 | // Transparent? Create mask 417 | LPSMASK pMask = rdPtr->m_pColMask; 418 | if ( pMask == NULL ) 419 | { 420 | if ( rdPtr->m_pSurface != NULL ) 421 | { 422 | DWORD dwMaskSize = rdPtr->m_pSurface->CreateMask(NULL, lParam); 423 | if ( dwMaskSize != 0 ) 424 | { 425 | pMask = (LPSMASK)calloc(dwMaskSize, 1); 426 | if ( pMask != NULL ) 427 | { 428 | rdPtr->m_pSurface->CreateMask(pMask, lParam); 429 | rdPtr->m_pColMask = pMask; 430 | } 431 | } 432 | } 433 | } 434 | 435 | // Note: for active objects, lParam is always the same. 436 | // For background objects (OEFLAG_BACKGROUND), lParam maybe be different if the user uses your object 437 | // as obstacle and as platform. In this case, you should store 2 collision masks 438 | // in your data: one if lParam is 0 and another one if lParam is different from 0. 439 | 440 | return pMask; 441 | } 442 | */ 443 | 444 | // ---------------- 445 | // PauseRunObject 446 | // ---------------- 447 | // Enters the pause mode 448 | // 449 | short WINAPI DLLExport PauseRunObject(LPRDATA rdPtr) 450 | { 451 | // Ok 452 | return 0; 453 | } 454 | 455 | 456 | // ----------------- 457 | // ContinueRunObject 458 | // ----------------- 459 | // Quits the pause mode 460 | // 461 | short WINAPI DLLExport ContinueRunObject(LPRDATA rdPtr) 462 | { 463 | // Ok 464 | return 0; 465 | } 466 | 467 | 468 | // ============================================================================ 469 | // 470 | // START APP / END APP / START FRAME / END FRAME routines 471 | // 472 | // ============================================================================ 473 | 474 | // ------------------- 475 | // StartApp 476 | // ------------------- 477 | // Called when the application starts or restarts. 478 | // Useful for storing global data 479 | // 480 | void WINAPI DLLExport StartApp(mv _far *mV, CRunApp* pApp) 481 | { 482 | OutputDebugString("Start app\n"); 483 | 484 | // Example 485 | // ------- 486 | // Delete global data (if restarts application) 487 | // CMyData* pData = (CMyData*)mV->mvGetExtUserData(pApp, hInstLib); 488 | // if ( pData != NULL ) 489 | // { 490 | // delete pData; 491 | // mV->mvSetExtUserData(pApp, hInstLib, NULL); 492 | // } 493 | } 494 | 495 | // ------------------- 496 | // EndApp 497 | // ------------------- 498 | // Called when the application ends. 499 | // 500 | void WINAPI DLLExport EndApp(mv _far *mV, CRunApp* pApp) 501 | { 502 | OutputDebugString("End app\n"); 503 | 504 | // Example 505 | // ------- 506 | // Delete global data 507 | // CMyData* pData = (CMyData*)mV->mvGetExtUserData(pApp, hInstLib); 508 | // if ( pData != NULL ) 509 | // { 510 | // delete pData; 511 | // mV->mvSetExtUserData(pApp, hInstLib, NULL); 512 | // } 513 | } 514 | 515 | // ------------------- 516 | // StartFrame 517 | // ------------------- 518 | // Called when the frame starts or restarts. 519 | // 520 | void WINAPI DLLExport StartFrame(mv _far *mV, DWORD dwReserved, int nFrameIndex) 521 | { 522 | char tutu[100]; 523 | wsprintf(tutu, "Start Frame %d\n", nFrameIndex); 524 | 525 | OutputDebugString(tutu); 526 | } 527 | 528 | // ------------------- 529 | // EndFrame 530 | // ------------------- 531 | // Called when the frame ends. 532 | // 533 | void WINAPI DLLExport EndFrame(mv _far *mV, DWORD dwReserved, int nFrameIndex) 534 | { 535 | char tutu[100]; 536 | wsprintf(tutu, "End Frame %d\n", nFrameIndex); 537 | 538 | OutputDebugString(tutu); 539 | } 540 | 541 | // ============================================================================ 542 | // 543 | // TEXT ROUTINES (if OEFLAG_TEXT) 544 | // 545 | // ============================================================================ 546 | 547 | // ------------------- 548 | // GetRunObjectFont 549 | // ------------------- 550 | // Return the font used by the object. 551 | // 552 | /* 553 | 554 | // Note: do not forget to enable the functions in the .def file 555 | // if you remove the comments below. 556 | 557 | void WINAPI GetRunObjectFont(LPRDATA rdPtr, LOGFONT* pLf) 558 | { 559 | // Example 560 | // ------- 561 | // GetObject(rdPtr->m_hFont, sizeof(LOGFONT), pLf); 562 | } 563 | 564 | // ------------------- 565 | // SetRunObjectFont 566 | // ------------------- 567 | // Change the font used by the object. 568 | // 569 | void WINAPI SetRunObjectFont(LPRDATA rdPtr, LOGFONT* pLf, RECT* pRc) 570 | { 571 | // Example 572 | // ------- 573 | // HFONT hFont = CreateFontIndirect(pLf); 574 | // if ( hFont != NULL ) 575 | // { 576 | // if (rdPtr->m_hFont!=0) 577 | // DeleteObject(rdPtr->m_hFont); 578 | // rdPtr->m_hFont = hFont; 579 | // SendMessage(rdPtr->m_hWnd, WM_SETFONT, (WPARAM)rdPtr->m_hFont, FALSE); 580 | // } 581 | 582 | } 583 | 584 | // --------------------- 585 | // GetRunObjectTextColor 586 | // --------------------- 587 | // Return the text color of the object. 588 | // 589 | COLORREF WINAPI GetRunObjectTextColor(LPRDATA rdPtr) 590 | { 591 | // Example 592 | // ------- 593 | return 0; // rdPtr->m_dwColor; 594 | } 595 | 596 | // --------------------- 597 | // SetRunObjectTextColor 598 | // --------------------- 599 | // Change the text color of the object. 600 | // 601 | void WINAPI SetRunObjectTextColor(LPRDATA rdPtr, COLORREF rgb) 602 | { 603 | // Example 604 | // ------- 605 | rdPtr->m_dwColor = rgb; 606 | InvalidateRect(rdPtr->m_hWnd, NULL, TRUE); 607 | } 608 | */ 609 | 610 | 611 | // ============================================================================ 612 | // 613 | // DEBUGGER ROUTINES 614 | // 615 | // ============================================================================ 616 | 617 | // ----------------- 618 | // GetDebugTree 619 | // ----------------- 620 | // This routine returns the address of the debugger tree 621 | // 622 | LPWORD WINAPI DLLExport GetDebugTree(LPRDATA rdPtr) 623 | { 624 | #if !defined(RUN_ONLY) 625 | return DebugTree; 626 | #else 627 | return NULL; 628 | #endif // !defined(RUN_ONLY) 629 | } 630 | 631 | // ----------------- 632 | // GetDebugItem 633 | // ----------------- 634 | // This routine returns the text of a given item. 635 | // 636 | void WINAPI DLLExport GetDebugItem(LPSTR pBuffer, LPRDATA rdPtr, int id) 637 | { 638 | #if !defined(RUN_ONLY) 639 | 640 | // Example 641 | // ------- 642 | /* 643 | char temp[DB_BUFFERSIZE]; 644 | 645 | switch (id) 646 | { 647 | case DB_CURRENTSTRING: 648 | LoadString(hInstLib, IDS_CURRENTSTRING, temp, DB_BUFFERSIZE); 649 | wsprintf(pBuffer, temp, rdPtr->text); 650 | break; 651 | case DB_CURRENTVALUE: 652 | LoadString(hInstLib, IDS_CURRENTVALUE, temp, DB_BUFFERSIZE); 653 | wsprintf(pBuffer, temp, rdPtr->value); 654 | break; 655 | case DB_CURRENTCHECK: 656 | LoadString(hInstLib, IDS_CURRENTCHECK, temp, DB_BUFFERSIZE); 657 | if (rdPtr->check) 658 | wsprintf(pBuffer, temp, "TRUE"); 659 | else 660 | wsprintf(pBuffer, temp, "FALSE"); 661 | break; 662 | case DB_CURRENTCOMBO: 663 | LoadString(hInstLib, IDS_CURRENTCOMBO, temp, DB_BUFFERSIZE); 664 | wsprintf(pBuffer, temp, rdPtr->combo); 665 | break; 666 | } 667 | */ 668 | 669 | #endif // !defined(RUN_ONLY) 670 | } 671 | 672 | // ----------------- 673 | // EditDebugItem 674 | // ----------------- 675 | // This routine allows to edit editable items. 676 | // 677 | void WINAPI DLLExport EditDebugItem(LPRDATA rdPtr, int id) 678 | { 679 | #if !defined(RUN_ONLY) 680 | 681 | // Example 682 | // ------- 683 | /* 684 | switch (id) 685 | { 686 | case DB_CURRENTSTRING: 687 | { 688 | EditDebugInfo dbi; 689 | char buffer[256]; 690 | 691 | dbi.pText=buffer; 692 | dbi.lText=TEXT_MAX; 693 | dbi.pTitle=NULL; 694 | 695 | strcpy(buffer, rdPtr->text); 696 | long ret=callRunTimeFunction(rdPtr, RFUNCTION_EDITTEXT, 0, (LPARAM)&dbi); 697 | if (ret) 698 | strcpy(rdPtr->text, dbi.pText); 699 | } 700 | break; 701 | case DB_CURRENTVALUE: 702 | { 703 | EditDebugInfo dbi; 704 | 705 | dbi.value=rdPtr->value; 706 | dbi.pTitle=NULL; 707 | 708 | long ret=callRunTimeFunction(rdPtr, RFUNCTION_EDITINT, 0, (LPARAM)&dbi); 709 | if (ret) 710 | rdPtr->value=dbi.value; 711 | } 712 | break; 713 | } 714 | */ 715 | #endif // !defined(RUN_ONLY) 716 | } 717 | 718 | 719 | -------------------------------------------------------------------------------- /Perspective.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 27 | 30 | 33 | 36 | 39 | 48 | 66 | 69 | 76 | 79 | 94 | 97 | 100 | 103 | 108 | 111 | 114 | 117 | 118 | 127 | 130 | 133 | 136 | 139 | 148 | 164 | 167 | 174 | 177 | 190 | 193 | 196 | 199 | 204 | 207 | 210 | 213 | 214 | 223 | 226 | 229 | 232 | 235 | 244 | 262 | 265 | 272 | 275 | 290 | 293 | 296 | 299 | 304 | 307 | 310 | 315 | 316 | 325 | 328 | 331 | 334 | 337 | 346 | 362 | 365 | 372 | 375 | 389 | 392 | 395 | 398 | 403 | 406 | 409 | 412 | 413 | 422 | 425 | 428 | 431 | 434 | 443 | 459 | 462 | 469 | 472 | 485 | 488 | 491 | 494 | 499 | 502 | 505 | 510 | 511 | 520 | 523 | 526 | 529 | 532 | 541 | 557 | 560 | 567 | 570 | 583 | 586 | 589 | 592 | 597 | 600 | 603 | 608 | 609 | 618 | 621 | 624 | 627 | 630 | 639 | 657 | 660 | 667 | 670 | 685 | 688 | 691 | 694 | 699 | 702 | 705 | 710 | 711 | 712 | 713 | 714 | 715 | 719 | 722 | 725 | 730 | 731 | 734 | 739 | 740 | 743 | 748 | 749 | 752 | 757 | 758 | 761 | 766 | 767 | 770 | 775 | 776 | 779 | 784 | 785 | 786 | 789 | 790 | 793 | 796 | 801 | 802 | 805 | 810 | 811 | 814 | 819 | 820 | 823 | 828 | 829 | 832 | 837 | 838 | 841 | 846 | 847 | 850 | 855 | 856 | 857 | 860 | 863 | 868 | 869 | 872 | 877 | 878 | 881 | 886 | 887 | 890 | 895 | 896 | 899 | 904 | 905 | 908 | 913 | 914 | 917 | 922 | 923 | 924 | 927 | 930 | 935 | 936 | 939 | 944 | 945 | 948 | 953 | 954 | 957 | 962 | 963 | 966 | 971 | 972 | 975 | 980 | 981 | 984 | 989 | 990 | 991 | 994 | 997 | 1002 | 1003 | 1006 | 1011 | 1012 | 1015 | 1020 | 1021 | 1024 | 1029 | 1030 | 1033 | 1038 | 1039 | 1042 | 1047 | 1048 | 1051 | 1056 | 1057 | 1058 | 1059 | 1063 | 1066 | 1067 | 1070 | 1071 | 1074 | 1075 | 1076 | 1080 | 1083 | 1084 | 1085 | 1088 | 1091 | 1092 | 1095 | 1096 | 1099 | 1100 | 1103 | 1104 | 1107 | 1108 | 1111 | 1112 | 1115 | 1116 | 1119 | 1120 | 1123 | 1124 | 1127 | 1128 | 1131 | 1132 | 1135 | 1136 | 1139 | 1140 | 1143 | 1144 | 1147 | 1148 | 1151 | 1152 | 1155 | 1156 | 1159 | 1160 | 1163 | 1164 | 1167 | 1168 | 1171 | 1172 | 1175 | 1176 | 1179 | 1180 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | -------------------------------------------------------------------------------- /Edittime.cpp: -------------------------------------------------------------------------------- 1 | 2 | // ============================================================================ 3 | // 4 | // This file contains routines that are handled only during the Edittime, 5 | // under the Frame and Event editors. 6 | // 7 | // Including creating, display, and setting up your object. 8 | // 9 | // ============================================================================ 10 | 11 | // Common 12 | #include "common.h" 13 | 14 | #if !defined(RUN_ONLY) 15 | 16 | // PROPERTIES ///////////////////////////////////////////////////////////////// 17 | 18 | 19 | // Property identifiers 20 | 21 | enum { 22 | PROPID_SETTINGS = PROPID_EXTITEM_CUSTOM_FIRST, 23 | PROPID_PERSPECTIVEOBJECT, 24 | PROPID_EFFECT, 25 | PROPID_DIRECTION, 26 | PROPID_ORIENTATION, 27 | PROPID_DEFAULTVALUES, 28 | PROPID_ZOOM, 29 | PROPID_OFFSET, 30 | PROPID_SINEWAVES, 31 | PROPID_QUALITY 32 | }; 33 | 34 | 35 | LPCSTR EffectList[] = 36 | { 37 | 0, 38 | MAKEINTRESOURCE(IDS_PANORAMA), 39 | MAKEINTRESOURCE(IDS_PERSPECTIVE), 40 | MAKEINTRESOURCE(IDS_SINEWAVE), 41 | MAKEINTRESOURCE(IDS_SINEOFFSET), 42 | MAKEINTRESOURCE(IDS_CUSTOM), 43 | MAKEINTRESOURCE(IDS_CUSTOMOFFSET), 44 | NULL 45 | }; 46 | 47 | LPCSTR DirList[] = 48 | { 49 | 0, 50 | MAKEINTRESOURCE(IDS_HORIZONTALDIR), 51 | MAKEINTRESOURCE(IDS_VERTICALDIR), 52 | NULL 53 | }; 54 | 55 | LPCSTR OrientationList[] = 56 | { 57 | 0, 58 | MAKEINTRESOURCE(IDS_RIGHTTOP), 59 | MAKEINTRESOURCE(IDS_LEFTBOTTOM), 60 | NULL 61 | }; 62 | 63 | 64 | int ZoomRange[] = { 0 , 32767 }; 65 | int OffsetRange[] = { -16383 , 16383 }; 66 | int WaveRange[] = { 0 , 32767 }; 67 | 68 | // Property definitions 69 | // 70 | // Type, ID, Text, Text of Info box [, Options, Init Param] 71 | // 72 | 73 | PropData Properties[] = { 74 | 75 | PropData_Group (PROPID_PERSPECTIVEOBJECT, IDS_PROP_TEXTTITLE, IDS_PROP_TEXTTITLE ), 76 | PropData_ComboBox (PROPID_EFFECT, IDS_EFFECT, IDS_EFFECT, EffectList ), 77 | PropData_ComboBox (PROPID_DIRECTION, IDS_DIRECTION, IDS_DIRECTION, DirList ), 78 | PropData_ComboBox (PROPID_ORIENTATION, IDS_ORIENTATION, IDS_ORIENTATION, OrientationList ), 79 | PropData_CheckBox (PROPID_QUALITY, IDS_QUALITY, IDS_QUALITY), 80 | PropData_Group (PROPID_DEFAULTVALUES, IDS_DEFAULTVALUES, IDS_DEFAULTVALUES ), 81 | PropData_SpinEdit (PROPID_ZOOM, IDS_ZOOMVALUE, IDS_ZOOMVALUE , &ZoomRange ), 82 | PropData_SpinEdit (PROPID_OFFSET, IDS_OFFSET, IDS_OFFSET , &OffsetRange), 83 | PropData_SpinEdit (PROPID_SINEWAVES, IDS_SINEWAVESNUM, IDS_SINEWAVESNUM , &WaveRange), 84 | 85 | // End of table (required) 86 | PropData_End() 87 | }; 88 | 89 | // SETUP PROC ///////////////////////////////////////////////////////////////// 90 | 91 | // Prototype of setup procedure 92 | BOOL CALLBACK DLLExport setupProc(HWND hDlg,uint msgType,WPARAM wParam,LPARAM lParam); 93 | 94 | // Structure defined to pass edptr and mv into setup box 95 | typedef struct tagSetP 96 | { 97 | EDITDATA _far * edpt; 98 | mv _far * kv; 99 | } setupParams; 100 | 101 | #endif // !defined(RUN_ONLY) 102 | 103 | 104 | // ----------------- 105 | // GetObjInfos 106 | // ----------------- 107 | // Return object info 108 | // 109 | // Info displayed in the object's About properties 110 | // Note: ObjComment is also displayed in the Quick Description box in the Insert Object dialog box 111 | // 112 | void WINAPI DLLExport GetObjInfos (mv _far *mV, LPEDATA edPtr, LPSTR ObjName, LPSTR ObjAuthor, LPSTR ObjCopyright, LPSTR ObjComment, LPSTR ObjHttp) 113 | { 114 | #ifndef RUN_ONLY 115 | // Name 116 | LoadString(hInstLib, IDST_OBJNAME,ObjName, 255); 117 | 118 | // Author 119 | LoadString(hInstLib, IDST_AUTHOR,ObjAuthor,255); 120 | 121 | // Copyright 122 | LoadString(hInstLib, IDST_COPYRIGHT,ObjCopyright,255); 123 | 124 | // Comment 125 | LoadString(hInstLib, IDST_COMMENT,ObjComment,1024); 126 | 127 | // Internet address 128 | LoadString(hInstLib, IDST_HTTP,ObjHttp,255); 129 | #endif // !defined(RUN_ONLY) 130 | } 131 | 132 | // ----------------- 133 | // GetHelpFileName 134 | // ----------------- 135 | // Returns the help filename of the object. 136 | // 137 | LPCSTR WINAPI GetHelpFileName() 138 | { 139 | #ifndef RUN_ONLY 140 | // Return a file without path if your help file can be loaded by the MMF help file. 141 | // return "MyExt.chm"; 142 | 143 | // Or return the path of your file, relatively to the MMF directory 144 | // if your file is not loaded by the MMF help file. 145 | return "Help\\MyExt.chm"; 146 | #else 147 | return NULL; 148 | #endif // !defined(RUN_ONLY) 149 | } 150 | 151 | // ----------------- 152 | // BmpToImg 153 | // ----------------- 154 | // Converts an image from the resource to an image displayable under CC&C 155 | // Not used in this template, but it is a good example on how to create 156 | // an image. 157 | // 158 | /* 159 | WORD BmpToImg(int bmID, npAppli idApp, short HotX = 0, short HotY = 0, short ActionX = 0, short ActionY = 0) 160 | { 161 | Img ifo; 162 | WORD img; 163 | HRSRC hs; 164 | HGLOBAL hgBuf; 165 | LPBYTE adBuf; 166 | LPBITMAPINFOHEADER adBmi; 167 | 168 | img = 0; 169 | if ((hs = FindResource(hInstLib, MAKEINTRESOURCE(bmID), RT_BITMAP)) != NULL) 170 | { 171 | if ((hgBuf = LoadResource(hInstLib, hs)) != NULL) 172 | { 173 | if ((adBuf = (LPBYTE)LockResource(hgBuf)) != NULL) 174 | { 175 | adBmi = (LPBITMAPINFOHEADER)adBuf; 176 | ifo.imgXSpot = HotX; 177 | ifo.imgYSpot = HotY; 178 | ifo.imgXAction = ActionX; 179 | ifo.imgYAction = ActionY; 180 | if (adBmi->biBitCount > 4) 181 | RemapDib((LPBITMAPINFO)adBmi, idApp, NULL); 182 | img = (WORD)DibToImage(idApp, &ifo, adBmi); 183 | UnlockResource(hgBuf); 184 | } 185 | FreeResource(hgBuf); 186 | } 187 | } 188 | return img; 189 | } 190 | */ 191 | 192 | // ============================================================================ 193 | // 194 | // ROUTINES USED UNDER FRAME EDITOR 195 | // 196 | // ============================================================================ 197 | 198 | 199 | // -------------------- 200 | // MakeIcon 201 | // -------------------- 202 | // Called once object is created or modified, just after setup. 203 | // 204 | // Note: this function is optional. If it's not defined in your extension, 205 | // MMF2 will load the EXO_ICON bitmap if it's defined in your resource file. 206 | // 207 | // If you need to draw the icon manually, remove the comments around this function and in the .def file. 208 | // 209 | /* 210 | int WINAPI DLLExport MakeIconEx ( mv _far *mV, cSurface* pIconSf, LPSTR lpName, fpObjInfo oiPtr, LPEDATA edPtr ) 211 | { 212 | int error = -1; 213 | #ifndef RUN_ONLY 214 | if ( pIconSf->LoadImage(hInstLib, EXO_ICON) != 0 ) 215 | error = 0; 216 | #endif // !defined(RUN_ONLY) 217 | return error; 218 | } 219 | */ 220 | 221 | // -------------------- 222 | // SetupProc 223 | // -------------------- 224 | // This routine is yours. You may even not need a setup dialog box. 225 | // I have put it as an example... 226 | 227 | #ifndef RUN_ONLY 228 | 229 | BOOL CALLBACK DLLExport setupProc(HWND hDlg,uint msgType,WPARAM wParam,LPARAM lParam) 230 | { 231 | setupParams _far * spa; 232 | EDITDATA _far * edPtr; 233 | 234 | switch (msgType) 235 | { 236 | case WM_INITDIALOG: // Init dialog 237 | SetWindowLong(hDlg, DWL_USER, lParam); 238 | spa = (setupParams far *)lParam; 239 | edPtr = spa->edpt; 240 | 241 | 242 | return TRUE; 243 | 244 | case WM_COMMAND: // Command 245 | spa = (setupParams far *)GetWindowLong(hDlg, DWL_USER); 246 | edPtr = spa->edpt; 247 | 248 | switch (wmCommandID) 249 | { 250 | case IDOK: 251 | 252 | // Close the dialog 253 | EndDialog(hDlg, IDOK); 254 | return 0; 255 | 256 | case IDCANCEL: 257 | // User pressed cancel, don't save anything 258 | // Close the dialog 259 | EndDialog(hDlg, IDCANCEL); 260 | return 0; 261 | 262 | case ID_HELP: 263 | { 264 | // Call the mvHelp function 265 | // 266 | spa->kv->mvHelp(GetHelpFileName(), 0 /*HH_DISPLAY_TOPIC*/, NULL /*(LPARAM)"index.html"*/); 267 | } 268 | return 0; 269 | 270 | 271 | default: 272 | break; 273 | } 274 | break; 275 | 276 | default: 277 | break; 278 | } 279 | return FALSE; 280 | } 281 | 282 | #endif // !defined(RUN_ONLY) 283 | 284 | // -------------------- 285 | // CreateObject 286 | // -------------------- 287 | // Called when you choose "Create new object". It should display the setup box 288 | // and initialize everything in the datazone. 289 | 290 | int WINAPI DLLExport CreateObject(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr) 291 | { 292 | #ifndef RUN_ONLY 293 | // Check compatibility 294 | if ( IS_COMPATIBLE(mV) ) 295 | { 296 | 297 | // Set default object flags 298 | edPtr->sx = 0; 299 | edPtr->sy = 0; 300 | edPtr->swidth = 300; 301 | edPtr->sheight = 100; 302 | 303 | edPtr->DefaultOffset = 0; 304 | edPtr->DefaultZoom = 75; 305 | edPtr->Direction = false; 306 | edPtr->Effect = 0; 307 | 308 | edPtr->SineWaveWaves = 4; 309 | edPtr->PerspectiveDir = 0; 310 | 311 | edPtr->resample = false; 312 | 313 | // Call setup (remove this and return 0 if your object does not need a setup) 314 | return 0; // No error 315 | 316 | } 317 | #endif // !defined(RUN_ONLY) 318 | 319 | // Error 320 | return -1; 321 | } 322 | 323 | // -------------------- 324 | // SelectPopup 325 | // -------------------- 326 | // One of the option from the menu has been selected, and not a default menu option 327 | // automatically handled by CC&C: this routine is then called. 328 | // 329 | BOOL WINAPI EditObject (mv _far *mV, fpObjInfo oiPtr, fpLevObj loPtr, LPEDATA edPtr) 330 | { 331 | return FALSE; 332 | } 333 | 334 | // -------------------- 335 | // SetEditSize 336 | // -------------------- 337 | // Called by CC&C when the object has been resized 338 | // 339 | // Note: remove the comments if your object can be resized (and remove the comments in the .def file) 340 | 341 | BOOL WINAPI SetEditSize(LPMV mv, LPEDATA edPtr, int cx, int cy) 342 | { 343 | #ifndef RUN_ONLY 344 | edPtr->swidth = cx; 345 | edPtr->sheight = cy; 346 | #endif // !defined(RUN_ONLY) 347 | return TRUE; // OK 348 | } 349 | 350 | 351 | // -------------------- 352 | // PutObject 353 | // -------------------- 354 | // Called when each individual object is dropped in the frame. 355 | // 356 | void WINAPI DLLExport PutObject(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr, ushort cpt) 357 | { 358 | #ifndef RUN_ONLY 359 | #endif // !defined(RUN_ONLY) 360 | } 361 | 362 | // -------------------- 363 | // RemoveObject 364 | // -------------------- 365 | // Called when each individual object is removed from the frame. 366 | // 367 | void WINAPI DLLExport RemoveObject(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr, ushort cpt) 368 | { 369 | #ifndef RUN_ONLY 370 | // Is the last object removed? 371 | if (0 == cpt) 372 | { 373 | // Do whatever necessary to remove our data 374 | } 375 | #endif // !defined(RUN_ONLY) 376 | } 377 | 378 | // -------------------- 379 | // DuplicateObject 380 | // -------------------- 381 | // Called when an object is created from another one (note: should be called CloneObject instead...) 382 | // 383 | void WINAPI DLLExport DuplicateObject(mv __far *mV, fpObjInfo oiPtr, LPEDATA edPtr) 384 | { 385 | #ifndef RUN_ONLY 386 | #endif // !defined(RUN_ONLY) 387 | } 388 | 389 | // -------------------- 390 | // GetObjectRect 391 | // -------------------- 392 | // Returns the size of the rectangle of the object in the frame editor. 393 | // 394 | void WINAPI DLLExport GetObjectRect(mv _far *mV, RECT FAR *rc, fpLevObj loPtr, LPEDATA edPtr) 395 | { 396 | #ifndef RUN_ONLY 397 | rc->right = rc->left + edPtr->swidth; 398 | rc->bottom = rc->top + edPtr->sheight; 399 | #endif // !defined(RUN_ONLY) 400 | return; 401 | } 402 | 403 | 404 | // -------------------- 405 | // EditorDisplay 406 | // -------------------- 407 | // Displays the object under the frame editor 408 | // 409 | // Note: this function is optional. If it's not defined in your extension, 410 | // MMF2 will load and display the EXO_IMAGE bitmap if it's defined in your resource file. 411 | // 412 | // If you need to draw the icon manually, remove the comments around this function and in the .def file. 413 | // 414 | 415 | void WINAPI DLLExport EditorDisplay(mv _far *mV, fpObjInfo oiPtr, fpLevObj loPtr, LPEDATA edPtr, RECT FAR *rc) 416 | { 417 | #ifndef RUN_ONLY 418 | 419 | LPSURFACE ps = WinGetSurface((int)mV->mvIdEditWin); 420 | if ( ps != NULL ) // Do the following if this surface exists 421 | { 422 | int x = rc->left; // get our boundaries 423 | int y = rc->top; 424 | int w = rc->right-rc->left; 425 | int h = rc->bottom-rc->top; 426 | 427 | LPSURFACE pProto = NULL; 428 | GetSurfacePrototype(&pProto, ps->GetDepth(), ST_MEMORYWITHDC, SD_DIB); 429 | 430 | cSurface is; 431 | is.Create(edPtr->swidth, edPtr->sheight, pProto); 432 | is.Fill(200,200,200); 433 | is.Line(0,0,w,h,1,DARK_GRAY); 434 | is.Line(0,h,w,0,1,DARK_GRAY); 435 | is.Rectangle(0,0,w,h,NULL,1,DARK_GRAY,false); 436 | is.Blit(*ps, x, y, BMODE_TRANSP, BOP_BLEND, 90); 437 | } 438 | 439 | #endif // !defined(RUN_ONLY) 440 | } 441 | 442 | 443 | // -------------------- 444 | // IsTransparent 445 | // -------------------- 446 | // This routine tells CC&C if the mouse pointer is over a transparent zone of the object. 447 | // 448 | 449 | extern "C" BOOL WINAPI DLLExport IsTransparent(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr, int dx, int dy) 450 | { 451 | #ifndef RUN_ONLY 452 | // Write your code here 453 | #endif // !defined(RUN_ONLY) 454 | return FALSE; 455 | } 456 | 457 | // -------------------- 458 | // PrepareToWriteObject 459 | // -------------------- 460 | // Just before writing the datazone when saving the application, CC&C calls this routine. 461 | // 462 | void WINAPI DLLExport PrepareToWriteObject(mv _far *mV, LPEDATA edPtr, fpObjInfo adoi) 463 | { 464 | #ifndef RUN_ONLY 465 | // Write your code here 466 | #endif // !defined(RUN_ONLY) 467 | } 468 | 469 | // -------------------- 470 | // GetFilters 471 | // -------------------- 472 | 473 | BOOL WINAPI GetFilters(LPMV mV, LPEDATA edPtr, DWORD dwFlags, LPVOID pReserved) 474 | { 475 | #ifndef RUN_ONLY 476 | // If your extension uses image filters 477 | // if ( (dwFlags & GETFILTERS_IMAGES) != 0 ) 478 | // return TRUE; 479 | 480 | // If your extension uses sound filters 481 | // if ( (dwFlags & GETFILTERS_SOUNDS) != 0 ) 482 | // return TRUE; 483 | #endif // RUN_ONLY 484 | return FALSE; 485 | } 486 | 487 | // -------------------- 488 | // UsesFile 489 | // -------------------- 490 | // Triggers when a file is dropped onto the frame 491 | // Return TRUE if you can create an object from the given file 492 | // 493 | BOOL WINAPI DLLExport UsesFile (LPMV mV, LPSTR fileName) 494 | { 495 | BOOL r = FALSE; 496 | #ifndef RUN_ONLY 497 | 498 | // Example: return TRUE if file extension is ".txt" 499 | /* 500 | LPSTR ext, npath; 501 | 502 | if ( fileName != NULL ) 503 | { 504 | if ( (ext=(LPSTR)malloc(_MAX_EXT)) != NULL ) 505 | { 506 | if ( (npath=(LPSTR)malloc(_MAX_PATH)) != NULL ) 507 | { 508 | strcpy(npath, fileName); 509 | _splitpath(npath, NULL, NULL, NULL, ext); 510 | if ( _stricmp(ext, ".txt") == 0 ) 511 | r = TRUE; 512 | free(npath); 513 | } 514 | free(ext); 515 | } 516 | } */ 517 | #endif // !defined(RUN_ONLY) 518 | return r; 519 | } 520 | 521 | 522 | // -------------------- 523 | // CreateFromFile 524 | // -------------------- 525 | // Creates a new object from file 526 | // 527 | void WINAPI DLLExport CreateFromFile (LPMV mV, LPSTR fileName, LPEDATA edPtr) 528 | { 529 | #ifndef RUN_ONLY 530 | // Initialize your extension data from the given file 531 | // edPtr->swidth = 32; 532 | // edPtr->sheight = 32; 533 | 534 | // Example: store the filename 535 | // strcpy(edPtr->myFileName, fileName); 536 | #endif // !defined(RUN_ONLY) 537 | } 538 | 539 | // ============================================================================ 540 | // 541 | // PROPERTIES 542 | // 543 | // ============================================================================ 544 | 545 | // -------------------- 546 | // GetProperties 547 | // -------------------- 548 | // Inserts properties into the properties of the object. 549 | // 550 | BOOL WINAPI DLLExport GetProperties(LPMV mV, LPEDATA edPtr, BOOL bMasterItem) 551 | { 552 | #ifndef RUN_ONLY 553 | mvInsertProps(mV, edPtr, Properties, PROPID_TAB_GENERAL, TRUE); 554 | #endif // !defined(RUN_ONLY) 555 | 556 | // OK 557 | return TRUE; 558 | } 559 | 560 | // -------------------- 561 | // ReleaseProperties 562 | // -------------------- 563 | // Called when the properties are removed from the property window. 564 | // 565 | void WINAPI DLLExport ReleaseProperties(LPMV mV, LPEDATA edPtr, BOOL bMasterItem) 566 | { 567 | #ifndef RUN_ONLY 568 | // Write your code here 569 | #endif // !defined(RUN_ONLY) 570 | } 571 | 572 | // -------------------- 573 | // GetPropCreateParam 574 | // -------------------- 575 | // Called when a property is initialized and its creation parameter is NULL (in the PropData). 576 | // Allows you, for example, to change the content of a combobox property according to specific settings in the EDITDATA structure. 577 | // 578 | LPARAM WINAPI DLLExport GetPropCreateParam(LPMV mV, LPEDATA edPtr, UINT nPropID) 579 | { 580 | #ifndef RUN_ONLY 581 | // Example 582 | // ------- 583 | // if ( nPropID == PROPID_COMBO ) 584 | // { 585 | // switch (edPtr->sType) 586 | // { 587 | // case TYPE1: 588 | // return (LPARAM)ComboList1; 589 | // case TYPE2: 590 | // return (LPARAM)ComboList2; 591 | // } 592 | // } 593 | #endif // !defined(RUN_ONLY) 594 | return NULL; 595 | } 596 | 597 | // ---------------------- 598 | // ReleasePropCreateParam 599 | // ---------------------- 600 | // Called after a property has been initialized. 601 | // Allows you, for example, to free memory allocated in GetPropCreateParam. 602 | // 603 | void WINAPI DLLExport ReleasePropCreateParam(LPMV mV, LPEDATA edPtr, UINT nPropID, LPARAM lParam) 604 | { 605 | #ifndef RUN_ONLY 606 | #endif // !defined(RUN_ONLY) 607 | } 608 | 609 | // -------------------- 610 | // GetPropValue 611 | // -------------------- 612 | // Returns the value of properties that have a value. 613 | // Note: see GetPropCheck for checkbox properties 614 | // 615 | LPVOID WINAPI DLLExport GetPropValue(LPMV mV, LPEDATA edPtr, UINT nPropID) 616 | { 617 | #ifndef RUN_ONLY 618 | 619 | switch (nPropID) 620 | { 621 | 622 | case PROPID_EFFECT: 623 | return new CPropDWordValue(edPtr->Effect); 624 | 625 | case PROPID_DIRECTION: 626 | return new CPropDWordValue(edPtr->Direction); 627 | 628 | case PROPID_ORIENTATION: 629 | return new CPropDWordValue(edPtr->PerspectiveDir); 630 | 631 | case PROPID_ZOOM: 632 | return new CPropDWordValue(edPtr->DefaultZoom); 633 | 634 | case PROPID_OFFSET: 635 | return new CPropDWordValue(edPtr->DefaultOffset); 636 | 637 | case PROPID_SINEWAVES: 638 | return new CPropDWordValue(edPtr->SineWaveWaves); 639 | 640 | } 641 | 642 | // } 643 | #endif // !defined(RUN_ONLY) 644 | return NULL; 645 | } 646 | 647 | // -------------------- 648 | // GetPropCheck 649 | // -------------------- 650 | // Returns the checked state of properties that have a check box. 651 | // 652 | BOOL WINAPI DLLExport GetPropCheck(LPMV mV, LPEDATA edPtr, UINT nPropID) 653 | { 654 | #ifndef RUN_ONLY 655 | 656 | switch (nPropID) { 657 | 658 | case PROPID_QUALITY: 659 | return edPtr->resample; 660 | } 661 | 662 | #endif // !defined(RUN_ONLY) 663 | return 0; // Unchecked 664 | } 665 | 666 | // -------------------- 667 | // SetPropValue 668 | // -------------------- 669 | // This routine is called by MMF after a property has been modified. 670 | // 671 | void WINAPI DLLExport SetPropValue(LPMV mV, LPEDATA edPtr, UINT nPropID, LPVOID lParam) 672 | { 673 | #ifndef RUN_ONLY 674 | // Gets the pointer to the CPropValue structure 675 | CPropValue* pValue = (CPropValue*)lParam; 676 | 677 | // ------- 678 | switch (nPropID) 679 | { 680 | 681 | case PROPID_EFFECT: 682 | edPtr->Effect = (char)((CPropDWordValue*)pValue)->m_dwValue; 683 | break; 684 | 685 | case PROPID_DIRECTION: 686 | 687 | edPtr->Direction = (((CPropDWordValue*)pValue)->m_dwValue == 1) ? true : false; 688 | break; 689 | 690 | case PROPID_ORIENTATION: 691 | edPtr->PerspectiveDir = (((CPropDWordValue*)pValue)->m_dwValue == 1) ? true : false; 692 | break; 693 | 694 | case PROPID_ZOOM: 695 | edPtr->DefaultZoom = ((CPropDWordValue*)pValue)->m_dwValue; 696 | break; 697 | 698 | case PROPID_OFFSET: 699 | edPtr->DefaultOffset = ((CPropDWordValue*)pValue)->m_dwValue; 700 | break; 701 | 702 | case PROPID_SINEWAVES: 703 | edPtr->SineWaveWaves = ((CPropDWordValue*)pValue)->m_dwValue; 704 | break; 705 | 706 | } 707 | 708 | 709 | // You may want to have your object redrawn in the frame editor after the modifications, 710 | // in this case, just call this function 711 | // mvInvalidateObject(mV, edPtr); 712 | 713 | #endif // !defined(RUN_ONLY) 714 | } 715 | 716 | // -------------------- 717 | // SetPropCheck 718 | // -------------------- 719 | // This routine is called by MMF when the user modifies a checkbox in the properties. 720 | // 721 | void WINAPI DLLExport SetPropCheck(LPMV mV, LPEDATA edPtr, UINT nPropID, BOOL nCheck) 722 | { 723 | #ifndef RUN_ONLY 724 | 725 | switch (nPropID) 726 | { 727 | case PROPID_QUALITY: 728 | edPtr->resample = (nCheck==1) ? true : false; 729 | mvInvalidateObject(mV, edPtr); 730 | mvRefreshProp(mV, edPtr, PROPID_QUALITY,false); 731 | break; 732 | } 733 | #endif // !defined(RUN_ONLY) 734 | } 735 | 736 | // -------------------- 737 | // EditProp 738 | // -------------------- 739 | // This routine is called when the user clicks the button of a Button or EditButton property. 740 | // 741 | BOOL WINAPI DLLExport EditProp(LPMV mV, LPEDATA edPtr, UINT nPropID) 742 | { 743 | #ifndef RUN_ONLY 744 | 745 | // Example 746 | // ------- 747 | /* 748 | if (nPropID==PROPID_EDITCONTENT) 749 | { 750 | if ( EditObject(mV, NULL, NULL, edPtr) ) 751 | return TRUE; 752 | } 753 | */ 754 | 755 | #endif // !defined(RUN_ONLY) 756 | return FALSE; 757 | } 758 | 759 | // -------------------- 760 | // IsPropEnabled 761 | // -------------------- 762 | // This routine returns the enabled state of a property. 763 | // 764 | BOOL WINAPI IsPropEnabled(LPMV mV, LPEDATA edPtr, UINT nPropID) 765 | { 766 | #ifndef RUN_ONLY 767 | // Example 768 | // ------- 769 | /* 770 | switch (nPropID) { 771 | 772 | case PROPID_CHECK: 773 | return (edPtr->nComboIndex != 0); 774 | } 775 | */ 776 | #endif // !defined(RUN_ONLY) 777 | return TRUE; 778 | } 779 | 780 | 781 | // ============================================================================ 782 | // 783 | // TEXT PROPERTIES 784 | // 785 | // ============================================================================ 786 | 787 | // -------------------- 788 | // GetTextCaps 789 | // -------------------- 790 | // Return the text capabilities of the object under the frame editor. 791 | // 792 | DWORD WINAPI DLLExport GetTextCaps(mv _far *mV, LPEDATA edPtr) 793 | { 794 | return 0; // (TEXT_ALIGN_LEFT|TEXT_ALIGN_HCENTER|TEXT_ALIGN_RIGHT|TEXT_ALIGN_TOP|TEXT_ALIGN_VCENTER|TEXT_ALIGN_BOTTOM|TEXT_FONT|TEXT_COLOR); 795 | } 796 | 797 | // -------------------- 798 | // GetTextFont 799 | // -------------------- 800 | // Return the font used the object. 801 | // Note: the pStyle and cbSize parameters are obsolete and passed for compatibility reasons only. 802 | // 803 | BOOL WINAPI DLLExport GetTextFont(mv _far *mV, LPEDATA edPtr, LPLOGFONT plf, LPSTR pStyle, UINT cbSize) 804 | { 805 | #if !defined(RUN_ONLY) 806 | // Example: copy LOGFONT structure from EDITDATA 807 | // memcpy(plf, &edPtr->m_lf, sizeof(LOGFONT)); 808 | #endif // !defined(RUN_ONLY) 809 | 810 | return TRUE; 811 | } 812 | 813 | // -------------------- 814 | // SetTextFont 815 | // -------------------- 816 | // Change the font used the object. 817 | // Note: the pStyle parameter is obsolete and passed for compatibility reasons only. 818 | // 819 | BOOL WINAPI DLLExport SetTextFont(mv _far *mV, LPEDATA edPtr, LPLOGFONT plf, LPCSTR pStyle) 820 | { 821 | #if !defined(RUN_ONLY) 822 | // Example: copy LOGFONT structure to EDITDATA 823 | // memcpy(&edPtr->m_lf, plf, sizeof(LOGFONT)); 824 | #endif // !defined(RUN_ONLY) 825 | 826 | return TRUE; 827 | } 828 | 829 | // -------------------- 830 | // GetTextClr 831 | // -------------------- 832 | // Get the text color of the object. 833 | // 834 | COLORREF WINAPI DLLExport GetTextClr(mv _far *mV, LPEDATA edPtr) 835 | { 836 | // Example 837 | return 0; // edPtr->fontColor; 838 | } 839 | 840 | // -------------------- 841 | // SetTextClr 842 | // -------------------- 843 | // Set the text color of the object. 844 | // 845 | void WINAPI DLLExport SetTextClr(mv _far *mV, LPEDATA edPtr, COLORREF color) 846 | { 847 | // Example 848 | //edPtr->fontColor = color; 849 | } 850 | 851 | // -------------------- 852 | // GetTextAlignment 853 | // -------------------- 854 | // Get the text alignment of the object. 855 | // 856 | DWORD WINAPI DLLExport GetTextAlignment(mv _far *mV, LPEDATA edPtr) 857 | { 858 | DWORD dw = 0; 859 | #if !defined(RUN_ONLY) 860 | // Example 861 | // ------- 862 | /* if ( (edPtr->eData.dwFlags & ALIGN_LEFT) != 0 ) 863 | dw |= TEXT_ALIGN_LEFT; 864 | if ( (edPtr->eData.dwFlags & ALIGN_HCENTER) != 0 ) 865 | dw |= TEXT_ALIGN_HCENTER; 866 | if ( (edPtr->eData.dwFlags & ALIGN_RIGHT) != 0 ) 867 | dw |= TEXT_ALIGN_RIGHT; 868 | if ( (edPtr->eData.dwFlags & ALIGN_TOP) != 0 ) 869 | dw |= TEXT_ALIGN_TOP; 870 | if ( (edPtr->eData.dwFlags & ALIGN_VCENTER) != 0 ) 871 | dw |= TEXT_ALIGN_VCENTER; 872 | if ( (edPtr->eData.dwFlags & ALIGN_BOTTOM) != 0 ) 873 | dw |= TEXT_ALIGN_BOTTOM; 874 | */ 875 | #endif // !defined(RUN_ONLY) 876 | return dw; 877 | } 878 | 879 | // -------------------- 880 | // SetTextAlignment 881 | // -------------------- 882 | // Set the text alignment of the object. 883 | // 884 | void WINAPI DLLExport SetTextAlignment(mv _far *mV, LPEDATA edPtr, DWORD dwAlignFlags) 885 | { 886 | #if !defined(RUN_ONLY) 887 | // Example 888 | // ------- 889 | /* DWORD dw = edPtr->eData.dwFlags; 890 | 891 | if ( (dwAlignFlags & TEXT_ALIGN_LEFT) != 0 ) 892 | dw = (dw & ~(ALIGN_LEFT|ALIGN_HCENTER|ALIGN_RIGHT)) | ALIGN_LEFT; 893 | if ( (dwAlignFlags & TEXT_ALIGN_HCENTER) != 0 ) 894 | dw = (dw & ~(ALIGN_LEFT|ALIGN_HCENTER|ALIGN_RIGHT)) | ALIGN_HCENTER; 895 | if ( (dwAlignFlags & TEXT_ALIGN_RIGHT) != 0 ) 896 | dw = (dw & ~(ALIGN_LEFT|ALIGN_HCENTER|ALIGN_RIGHT)) | ALIGN_RIGHT; 897 | 898 | if ( (dwAlignFlags & TEXT_ALIGN_TOP) != 0 ) 899 | dw = (dw & ~(ALIGN_TOP|ALIGN_VCENTER|ALIGN_BOTTOM)) | ALIGN_TOP; 900 | if ( (dwAlignFlags & TEXT_ALIGN_VCENTER) != 0 ) 901 | dw = (dw & ~(ALIGN_TOP|ALIGN_VCENTER|ALIGN_BOTTOM)) | ALIGN_VCENTER; 902 | if ( (dwAlignFlags & TEXT_ALIGN_BOTTOM) != 0 ) 903 | dw = (dw & ~(ALIGN_TOP|ALIGN_VCENTER|ALIGN_BOTTOM)) | ALIGN_BOTTOM; 904 | 905 | edPtr->eData.dwFlags = dw; 906 | */ 907 | #endif // !defined(RUN_ONLY) 908 | } 909 | 910 | 911 | // ============================================================================ 912 | // 913 | // ROUTINES USED UNDER EVENT / TIME / STEP-THROUGH EDITOR 914 | // You should not need to change these routines 915 | // 916 | // ============================================================================ 917 | 918 | // ----------------- 919 | // menucpy 920 | // ----------------- 921 | // Internal routine used later, copy one menu onto another 922 | // 923 | #ifndef RUN_ONLY 924 | void menucpy(HMENU hTargetMenu, HMENU hSourceMenu) 925 | { 926 | int n, id, nMn; 927 | NPSTR strBuf; 928 | HMENU hSubMenu; 929 | 930 | nMn = GetMenuItemCount(hSourceMenu); 931 | strBuf = (NPSTR)LocalAlloc(LPTR, 80); 932 | for (n=0; ninfos.code != code) 983 | eiPtr = EVINFO2_NEXT(eiPtr); 984 | 985 | return eiPtr; 986 | } 987 | #endif // !defined(RUN_ONLY) 988 | 989 | 990 | // ---------------------------------------------------- 991 | // GetConditionMenu / GetActionMenu / GetExpressionMenu 992 | // ---------------------------------------------------- 993 | // Load the condition/action/expression menu from the resource, eventually 994 | // enable or disable some options, and returns it to CC&C. 995 | // 996 | HMENU WINAPI DLLExport GetConditionMenu(mv _far *mV, fpObjInfo oiPtr, LPEDATA edPtr) 997 | { 998 | #ifndef RUN_ONLY 999 | // Check compatibility 1000 | if ( IS_COMPATIBLE(mV) ) 1001 | return GetPopupMenu(MN_CONDITIONS); 1002 | #endif // !defined(RUN_ONLY) 1003 | return NULL; 1004 | } 1005 | 1006 | HMENU WINAPI DLLExport GetActionMenu(mv _far *mV, fpObjInfo oiPtr, LPEDATA edPtr) 1007 | { 1008 | #ifndef RUN_ONLY 1009 | // Check compatibility 1010 | if ( IS_COMPATIBLE(mV) ) 1011 | return GetPopupMenu(MN_ACTIONS); 1012 | #endif // !defined(RUN_ONLY) 1013 | return NULL; 1014 | } 1015 | 1016 | HMENU WINAPI DLLExport GetExpressionMenu(mv _far *mV, fpObjInfo oiPtr, LPEDATA edPtr) 1017 | { 1018 | #ifndef RUN_ONLY 1019 | // Check compatibility 1020 | if ( IS_COMPATIBLE(mV) ) 1021 | return GetPopupMenu(MN_EXPRESSIONS); 1022 | #endif // !defined(RUN_ONLY) 1023 | return NULL; 1024 | } 1025 | 1026 | 1027 | // ------------------------------------------------------- 1028 | // GetConditionTitle / GetActionTitle / GetExpressionTitle 1029 | // ------------------------------------------------------- 1030 | // Returns the title of the dialog box displayed when entering 1031 | // parameters for the condition, action or expressions, if any. 1032 | // Here, we simply return the title of the menu option 1033 | // 1034 | 1035 | #ifndef RUN_ONLY 1036 | void GetCodeTitle(LPEVENTINFOS2 eiPtr, short code, short param, short mn, LPSTR strBuf, WORD maxLen) 1037 | { 1038 | HMENU hMn; 1039 | 1040 | // Finds event in array 1041 | eiPtr=GetEventInformations(eiPtr, code); 1042 | 1043 | // If a special string is to be returned 1044 | short strID = EVINFO2_PARAMTITLE(eiPtr, param); 1045 | 1046 | if ( strID != 0 ) 1047 | LoadString(hInstLib, strID, strBuf, maxLen); 1048 | else 1049 | { 1050 | // Otherwise, returns the menu option 1051 | if ((hMn = LoadMenu(hInstLib, MAKEINTRESOURCE(mn))) != NULL ) 1052 | { 1053 | GetMenuString(hMn, eiPtr->menu, strBuf, maxLen, MF_BYCOMMAND); 1054 | DestroyMenu(hMn); 1055 | } 1056 | } 1057 | } 1058 | #else 1059 | #define GetCodeTitle(a,b,c,d,e,f) 1060 | #endif // !defined(RUN_ONLY) 1061 | 1062 | void WINAPI DLLExport GetConditionTitle(mv _far *mV, short code, short param, LPSTR strBuf, short maxLen) 1063 | { 1064 | GetCodeTitle((LPEVENTINFOS2)conditionsInfos, code, param, MN_CONDITIONS, strBuf, maxLen); 1065 | } 1066 | void WINAPI DLLExport GetActionTitle(mv _far *mV, short code, short param, LPSTR strBuf, short maxLen) 1067 | { 1068 | GetCodeTitle((LPEVENTINFOS2)actionsInfos, code, param, MN_ACTIONS, strBuf, maxLen); 1069 | } 1070 | void WINAPI DLLExport GetExpressionTitle(mv _far *mV, short code, LPSTR strBuf, short maxLen) 1071 | { 1072 | GetCodeTitle((LPEVENTINFOS2)expressionsInfos, code, 0, MN_EXPRESSIONS, strBuf, maxLen); 1073 | } 1074 | 1075 | // ------------------------------------------------------- 1076 | // GetConditionTitle / GetActionTitle / GetExpressionTitle 1077 | // ------------------------------------------------------- 1078 | // From a menu ID, these routines returns the code of the condition, 1079 | // action or expression, as defined in the .H file 1080 | // 1081 | 1082 | short WINAPI DLLExport GetConditionCodeFromMenu(mv _far *mV, short menuId) 1083 | { 1084 | #ifndef RUN_ONLY 1085 | LPEVENTINFOS2 eiPtr; 1086 | int n; 1087 | 1088 | for (n=CND_LAST, eiPtr=(LPEVENTINFOS2)conditionsInfos; n>0 && eiPtr->menu!=menuId; n--) 1089 | eiPtr = EVINFO2_NEXT(eiPtr); 1090 | if (n>0) 1091 | return eiPtr->infos.code; 1092 | #endif // !defined(RUN_ONLY) 1093 | return -1; 1094 | } 1095 | 1096 | short WINAPI DLLExport GetActionCodeFromMenu(mv _far *mV, short menuId) 1097 | { 1098 | #ifndef RUN_ONLY 1099 | LPEVENTINFOS2 eiPtr; 1100 | int n; 1101 | 1102 | for (n=ACT_LAST, eiPtr=(LPEVENTINFOS2)actionsInfos; n>0 && eiPtr->menu!=menuId; n--) 1103 | eiPtr = EVINFO2_NEXT(eiPtr); 1104 | if (n>0) 1105 | return eiPtr->infos.code; 1106 | #endif // !defined(RUN_ONLY) 1107 | return -1; 1108 | } 1109 | 1110 | short WINAPI DLLExport GetExpressionCodeFromMenu(mv _far *mV, short menuId) 1111 | { 1112 | #ifndef RUN_ONLY 1113 | LPEVENTINFOS2 eiPtr; 1114 | int n; 1115 | 1116 | for (n=EXP_LAST, eiPtr=(LPEVENTINFOS2)expressionsInfos; n>0 && eiPtr->menu!=menuId; n--) 1117 | eiPtr = EVINFO2_NEXT(eiPtr); 1118 | if (n>0) 1119 | return eiPtr->infos.code; 1120 | #endif // !defined(RUN_ONLY) 1121 | return -1; 1122 | } 1123 | 1124 | 1125 | // ------------------------------------------------------- 1126 | // GetConditionInfos / GetActionInfos / GetExpressionInfos 1127 | // ------------------------------------------------------- 1128 | // From a action / condition / expression code, returns 1129 | // an infosEvents structure. 1130 | // 1131 | 1132 | LPINFOEVENTSV2 WINAPI DLLExport GetConditionInfos(mv _far *mV, short code) 1133 | { 1134 | #ifndef RUN_ONLY 1135 | return &GetEventInformations((LPEVENTINFOS2)conditionsInfos, code)->infos; 1136 | #else 1137 | return NULL; 1138 | #endif // !defined(RUN_ONLY) 1139 | } 1140 | 1141 | LPINFOEVENTSV2 WINAPI DLLExport GetActionInfos(mv _far *mV, short code) 1142 | { 1143 | #ifndef RUN_ONLY 1144 | return &GetEventInformations((LPEVENTINFOS2)actionsInfos, code)->infos; 1145 | #else 1146 | return NULL; 1147 | #endif // !defined(RUN_ONLY) 1148 | } 1149 | 1150 | LPINFOEVENTSV2 WINAPI DLLExport GetExpressionInfos(mv _far *mV, short code) 1151 | { 1152 | #ifndef RUN_ONLY 1153 | return &GetEventInformations((LPEVENTINFOS2)expressionsInfos, code)->infos; 1154 | #else 1155 | return NULL; 1156 | #endif // !defined(RUN_ONLY) 1157 | } 1158 | 1159 | 1160 | // ---------------------------------------------------------- 1161 | // GetConditionString / GetActionString / GetExpressionString 1162 | // ---------------------------------------------------------- 1163 | // From a action / condition / expression code, returns 1164 | // the string to use for displaying it under the event editor 1165 | // 1166 | 1167 | void WINAPI DLLExport GetConditionString(mv _far *mV, short code, LPSTR strPtr, short maxLen) 1168 | { 1169 | #ifndef RUN_ONLY 1170 | // Check compatibility 1171 | if ( IS_COMPATIBLE(mV) ) 1172 | LoadString(hInstLib, GetEventInformations((LPEVENTINFOS2)conditionsInfos, code)->string, strPtr, maxLen); 1173 | #endif // !defined(RUN_ONLY) 1174 | } 1175 | 1176 | void WINAPI DLLExport GetActionString(mv _far *mV, short code, LPSTR strPtr, short maxLen) 1177 | { 1178 | #ifndef RUN_ONLY 1179 | // Check compatibility 1180 | if ( IS_COMPATIBLE(mV) ) 1181 | LoadString(hInstLib, GetEventInformations((LPEVENTINFOS2)actionsInfos, code)->string, strPtr, maxLen); 1182 | #endif // !defined(RUN_ONLY) 1183 | } 1184 | 1185 | void WINAPI DLLExport GetExpressionString(mv _far *mV, short code, LPSTR strPtr, short maxLen) 1186 | { 1187 | #ifndef RUN_ONLY 1188 | // Check compatibility 1189 | if ( IS_COMPATIBLE(mV) ) 1190 | LoadString(hInstLib, GetEventInformations((LPEVENTINFOS2)expressionsInfos, code)->string, strPtr, maxLen); 1191 | #endif // !defined(RUN_ONLY) 1192 | } 1193 | 1194 | // ---------------------------------------------------------- 1195 | // GetExpressionParam 1196 | // ---------------------------------------------------------- 1197 | // Returns the parameter name to display in the expression editor 1198 | // 1199 | void WINAPI DLLExport GetExpressionParam(mv _far *mV, short code, short param, LPSTR strBuf, short maxLen) 1200 | { 1201 | #if !defined(RUN_ONLY) 1202 | short strID; 1203 | 1204 | // Finds event in array 1205 | LPEVENTINFOS2 eiPtr=GetEventInformations((LPEVENTINFOS2)expressionsInfos, code); 1206 | 1207 | // If a special string is to be returned 1208 | strID = EVINFO2_PARAMTITLE(eiPtr, param); 1209 | if ( strID != 0 ) 1210 | LoadString(hInstLib, strID, strBuf, maxLen); 1211 | else 1212 | *strBuf=0; 1213 | #endif // !defined(RUN_ONLY) 1214 | } 1215 | 1216 | // ---------------------------------------------------------- 1217 | // Custom Parameters 1218 | // ---------------------------------------------------------- 1219 | 1220 | // -------------------- 1221 | // InitParameter 1222 | // -------------------- 1223 | // Initialize the parameter. 1224 | // 1225 | void WINAPI InitParameter(mv _far *mV, short code, paramExt* pExt) 1226 | { 1227 | #if !defined(RUN_ONLY) 1228 | // Example 1229 | // ------- 1230 | // strcpy(&pExt->pextData[0], "Parameter Test"); 1231 | // pExt->pextSize = sizeof(paramExt) + strlen(pExt->pextData)+1; 1232 | #endif // !defined(RUN_ONLY) 1233 | } 1234 | 1235 | // Example of custom parameter setup proc 1236 | // -------------------------------------- 1237 | /* 1238 | #if !defined(RUN_ONLY) 1239 | BOOL CALLBACK DLLExport SetupProc(HWND hDlg, UINT msgType, WPARAM wParam, LPARAM lParam) 1240 | { 1241 | paramExt* pExt; 1242 | 1243 | switch (msgType) 1244 | { 1245 | case WM_INITDIALOG: // Init dialog 1246 | 1247 | // Save edptr 1248 | SetWindowLong(hDlg, DWL_USER, lParam); 1249 | pExt=(paramExt*)lParam; 1250 | 1251 | SetDlgItemText(hDlg, IDC_EDIT, pExt->pextData); 1252 | return TRUE; 1253 | 1254 | case WM_COMMAND: // Command 1255 | 1256 | // Retrieve edptr 1257 | pExt = (paramExt *)GetWindowLong(hDlg, DWL_USER); 1258 | 1259 | switch (wmCommandID) 1260 | { 1261 | case IDOK: // Exit 1262 | GetDlgItemText(hDlg, IDC_EDIT, pExt->pextData, 500); 1263 | pExt->pextSize=sizeof(paramExt)+strlen(pExt->pextData)+1; 1264 | EndDialog(hDlg, TRUE); 1265 | return TRUE; 1266 | 1267 | default: 1268 | break; 1269 | } 1270 | break; 1271 | 1272 | default: 1273 | break; 1274 | } 1275 | return FALSE; 1276 | } 1277 | #endif // !defined(RUN_ONLY) 1278 | */ 1279 | 1280 | // -------------------- 1281 | // EditParameter 1282 | // -------------------- 1283 | // Edit the parameter. 1284 | // 1285 | void WINAPI EditParameter(mv _far *mV, short code, paramExt* pExt) 1286 | { 1287 | #if !defined(RUN_ONLY) 1288 | 1289 | // Example 1290 | // ------- 1291 | // DialogBoxParam(hInstLib, MAKEINTRESOURCE(DB_TRYPARAM), mV->mvHEditWin, SetupProc, (LPARAM)(LPBYTE)pExt); 1292 | 1293 | #endif // !defined(RUN_ONLY) 1294 | } 1295 | 1296 | // -------------------- 1297 | // GetParameterString 1298 | // -------------------- 1299 | // Initialize the parameter. 1300 | // 1301 | void WINAPI GetParameterString(mv _far *mV, short code, paramExt* pExt, LPSTR pDest, short size) 1302 | { 1303 | #if !defined(RUN_ONLY) 1304 | 1305 | // Example 1306 | // ------- 1307 | // wsprintf(pDest, "Super parameter %s", pExt->pextData); 1308 | 1309 | #endif // !defined(RUN_ONLY) 1310 | } 1311 | 1312 | --------------------------------------------------------------------------------