|
| 1 | +#ifdef__cplusplus |
| 2 | +extern"C" { |
| 3 | +#endif |
| 4 | + |
| 5 | +#ifdef_MSC_VER// MSVC compiler |
| 6 | +#defineMUI_EXPORT __declspec(dllexport) __stdcall |
| 7 | +#else |
| 8 | +#defineMUI_EXPORT |
| 9 | +#endif |
| 10 | + |
| 11 | + |
| 12 | +//------------------------------------------------------------------------------ |
| 13 | +// ModernUI_Animation Prototypes |
| 14 | +//------------------------------------------------------------------------------ |
| 15 | +voidMUI_EXPORTMUIAnimationRegister();// Use 'ModernUI_Animation' as class in RadASM custom class control |
| 16 | +HWNDMUI_EXPORTMUIAnimationCreateHWNDhWndParent,DWORDxpos,DWORDypos,DWORDdwWidth,DWORDdwHeight,DWORDdwResourceID,DWORDdwStyle); |
| 17 | +unsignedintMUI_EXPORTMUIAnimationSetProperty(HWNDhModernUI_Animation,DWORDdwProperty,DWORDdwPropertyValue); |
| 18 | +unsignedintMUI_EXPORTMUIAnimationGetProperty(HWNDhModernUI_Animation,DWORDdwProperty); |
| 19 | + |
| 20 | +// Add image handle (bitmap, icon or png) as an animation frame image |
| 21 | +boolMUI_EXPORTMUIAnimationAddFrame(HWNDhModernUI_Animation,DWORDdwImageType,POINTER*lpMuiAnimationFrameStruct); |
| 22 | +boolMUI_EXPORTMUIAnimationAddFrames(HWNDhModernUI_Animation,DWORDdwImageType,POINTER*lpArrayMuiAnimationFrameStructs,DWORDdwCount); |
| 23 | +// Load an image resource id (bitmap, icon or png) as an animation frame image |
| 24 | +boolMUI_EXPORTMUIAnimationLoadFrame(HWNDhModernUI_Animation,DWORDdwImageType,POINTER*lpMuiAnimationFrameStruct); |
| 25 | +boolMUI_EXPORTMUIAnimationLoadFrames(HWNDhModernUI_Animation,DWORDdwImageType,POINTER*lpArrayMuiAnimationFrameStructs,DWORDdwCount); |
| 26 | +// Create a series of animation frames images from a sprite sheet |
| 27 | +boolMUI_EXPORTMUIAnimationAddSpriteSheet(HWNDhModernUI_Animation,DWORDdwImageType,HANDLEhImageSpriteSheet,DWORDdwSpriteCount,POINTER*lpFrameTimes,DWORDdwFrameTimeSize,DWORDdwFrameTimeType); |
| 28 | +boolMUI_EXPORTMUIAnimationLoadSpriteSheet(HWNDhModernUI_Animation,DWORDdwImageType,DWORDidResSpriteSheet,DWORDdwSpriteCount,POINTER*lpFrameTimes,DWORDdwFrameTimeSize,DWORDdwFrameTimeType); |
| 29 | +// Insert image handle as an animation frame image |
| 30 | +boolMUI_EXPORTMUIAnimationInsertFrame(HWNDhModernUI_Animation,DWORDdwImageType,POINTER*lpMuiAnimationFrameStruct,DWORDdwFrameIndex,BOOLbInsertBefore); |
| 31 | +boolMUI_EXPORTMUIAnimationInsertFrames(HWNDhModernUI_Animation,DWORDdwImageType,POINTER*lpArrayMuiAnimationFrameStructs,DWORDdwCount,DWORDdwFrameIndex,BOOLbInsertBefore); |
| 32 | + |
| 33 | +// Frame Operations |
| 34 | +boolMUI_EXPORTMUIAnimationClear(HWNDhModernUI_Animation); |
| 35 | +boolMUI_EXPORTMUIAnimationDeleteFrames(HWNDhModernUI_Animation); |
| 36 | +boolMUI_EXPORTMUIAnimationDeleteFrame(HWNDhModernUI_Animation,DWORDdwFrameIndex); |
| 37 | +boolMUI_EXPORTMUIAnimationMoveFrame(HWNDhModernUI_Animation,DWORDdwFrameIndexFrom,DWORDdwFrameIndexTo); |
| 38 | +boolMUI_EXPORTMUIAnimationCopyFrame(HWNDhModernUI_Animation,DWORDdwFrameIndexFrom,DWORDdwFrameIndexTo); |
| 39 | +boolMUI_EXPORTMUIAnimationCropFrame(HWNDhModernUI_Animation,DWORDdwFrameIndex,LPRECT*lpRect); |
| 40 | +boolMUI_EXPORTMUIAnimationCropFrames(HWNDhModernUI_Animation,LPRECT*lpRect); |
| 41 | + |
| 42 | +// Save frames to file |
| 43 | +boolMUI_EXPORTMUIAnimationExportSpriteSheet(HWNDhModernUI_Animation,DWORDdwImageType,LPCSTR*lpszSpritesheetFilename,LPCSTR*lpszFrameTimesFilename); |
| 44 | +boolMUI_EXPORTMUIAnimationExportFrame(HWNDhModernUI_Animation,DWORDdwImageType,LPCSTR*lpszFrameFilename,DWORDdwFrameIndex); |
| 45 | +boolMUI_EXPORTMUIAnimationExportFrames(HWNDhModernUI_Animation,DWORDdwImageType,LPCSTR*lpszFrameFolder,LPCSTR*lpszFilePrefix,BOOLbFileFrameNo); |
| 46 | + |
| 47 | +// Load frames from file |
| 48 | +boolMUI_EXPORTMUIAnimationImportSpriteSheet(HWNDhModernUI_Animation,DWORDdwImageType,LPCSTR*lpszSpritesheetFilename,LPCSTR*lpszFrameTimesFilename); |
| 49 | +boolMUI_EXPORTMUIAnimationImportFrame(HWNDhModernUI_Animation,DWORDdwImageType,LPCSTR*lpszFrameFilename,DWORDdwFrameIndex); |
| 50 | + |
| 51 | +// Frame Information |
| 52 | +boolMUI_EXPORTMUIAnimationGetFrameInfo(HWNDhModernUI_Animation,DWORDdwFrameIndex,POINTER*lpMuiAnimationFrameStruct); |
| 53 | +HANDLEMUI_EXPORTMUIAnimationGetFrameImage(HWNDhModernUI_Animation,DWORDdwFrameIndex,POINTER*lpdwFrameType); |
| 54 | +unsignedintMUIAnimationGetFrameTime(HWNDhModernUI_Animation,DWORDdwFrameIndex); |
| 55 | + |
| 56 | +boolMUI_EXPORTMUIAnimationSetFrameInfo(HWNDhModernUI_Animation,DWORDdwFrameIndex,POINTER*lpMuiAnimationFrameStruct); |
| 57 | +boolMUI_EXPORTMUIAnimationSetFrameImage(HWNDhModernUI_Animation,DWORDdwFrameIndex,DWORDdwFrameType,HANDLEhFrameImage); |
| 58 | +boolMUI_EXPORTMUIAnimationSetFrameTime(HWNDhModernUI_Animation,DWORDdwFrameIndex,DWORDdwFrameTime); |
| 59 | + |
| 60 | +// Animation control |
| 61 | +voidMUI_EXPORTMUIAnimationStart(HWNDhModernUI_Animation); |
| 62 | +voidMUI_EXPORTMUIAnimationStop(HWNDhModernUI_Animation); |
| 63 | +voidMUI_EXPORTMUIAnimationPause(HWNDhModernUI_Animation); |
| 64 | +voidMUI_EXPORTMUIAnimationResume(HWNDhModernUI_Animation); |
| 65 | +voidMUI_EXPORTMUIAnimationStep(HWNDhModernUI_Animation,BOOLbReverse); |
| 66 | +voidMUI_EXPORTMUIAnimationSpeed(HWNDhModernUI_Animation,FLOATfSpeedFactor); |
| 67 | + |
| 68 | +voidMUI_EXPORTMUIAnimationSetDefaultTime(HWNDhModernUI_Animation,DWORDdwDefaultFrameTime); |
| 69 | + |
| 70 | +voidMUI_EXPORTMUIAnimationNotifyCallback(HWNDhModernUI_Animation,POINTER*lpNMAnimationStruct); |
| 71 | + |
| 72 | + |
| 73 | +//------------------------------------------------------------------------------ |
| 74 | +// ModernUI_Animation Messages |
| 75 | +//------------------------------------------------------------------------------ |
| 76 | +#defineMUIAM_ADDFRAME WM_USER+1752 // wParam = dwImageType, lParam = lpAnimationFrameStruct |
| 77 | +#defineMUIAM_LOADFRAME WM_USER+1751 // wParam = dwImageType, lParam = idResImage |
| 78 | +#defineMUIAM_START WM_USER+1750 // wParam & lParam = NULL |
| 79 | +#defineMUIAM_STOP WM_USER+1749 // wParam & lParam = NULL |
| 80 | +#defineMUIAM_STEP WM_USER+1748 // wParam = bReverse |
| 81 | +#defineMUIAM_SPEED WM_USER+1745 // wParam = dwSpeedFactor |
| 82 | + |
| 83 | + |
| 84 | +//------------------------------------------------------------------------------ |
| 85 | +// ModernUI_Animation Notifications |
| 86 | +//------------------------------------------------------------------------------ |
| 87 | +#defineMUIAN_STOP 0 // Animation is stopped |
| 88 | +#defineMUIAN_START 1 // Animation has started |
| 89 | +#defineMUIAN_PAUSE 2 // Animation is paused |
| 90 | +#defineMUIAN_RESUME 3 // Animation has resumed |
| 91 | +#defineMUIAN_STEP 4 // Animation stepping |
| 92 | +#defineMUIAN_FRAME 5 // Occurs every frame shown |
| 93 | + |
| 94 | + |
| 95 | +//------------------------------------------ |
| 96 | +// ModernUI_Animation Structures |
| 97 | +//------------------------------------------ |
| 98 | +IFNDEFMUI_ANIMATION_FRAME// lpMuiAnimationFrameStruct |
| 99 | +typedefstructMUI_ANIMATION_FRAME |
| 100 | +{ |
| 101 | +DWORDdwFrameType,// DWORD. Image type: MUIAIT_BMP, MUIAIT_ICO, MUIAIT_PNG |
| 102 | +DWORDdwFrameImage,// DWORD/HANDLE. Handle or resource ID of image: Bitmap, Icon or PNG (RT_BITMAP, RT_ICON or RT_RCDATA resource) |
| 103 | +DWORDdwFrameTime,// DWORD. Frame time in milliseconds |
| 104 | +DWORDlParam// DWORD. Custom user specified value |
| 105 | +} |
| 106 | +ENDIF |
| 107 | + |
| 108 | +IFNDEFMUI_ANIMATION_FT_FULL// For array of frame times for every frame in array |
| 109 | +typedefstructMUI_ANIMATION_FT_FULL |
| 110 | +{ |
| 111 | +DWORDdwFrameTime |
| 112 | +} |
| 113 | +ENDIF |
| 114 | + |
| 115 | +IFNDEFMUI_ANIMATION_FT_COMPACT// For array of frame times for specified frame indexes in each entry |
| 116 | +typedefstructMUI_ANIMATION_FT_COMPACT |
| 117 | +{ |
| 118 | +DWORDdwFrameID, |
| 119 | +DWORDdwFrameTime |
| 120 | +} |
| 121 | +ENDIF |
| 122 | + |
| 123 | +IFNDEFNM_ANIMATION_FRAME// ModernUI_Animation Notification Item |
| 124 | +typedefstructNM_ANIMATION_FRAME |
| 125 | +{ |
| 126 | +DWORDdwFrameIndex,// DWORD. Frame index |
| 127 | +DWORDdwFrameType,// DWORD. Image type: MUIAIT_BMP, MUIAIT_ICO, MUIAIT_PNG |
| 128 | +DWORDdwFrameImage,// HANDLE. Handle of image: Bitmap, Icon or PNG |
| 129 | +DWORDdwFrameTime,// DWORD. Frame time in milliseconds |
| 130 | +DWORDlParam// DWORD. Custom user specified value |
| 131 | +} |
| 132 | +ENDIF |
| 133 | + |
| 134 | +IFNDEFNM_ANIMATION// Notification Message Structure for ModernUI_Animation |
| 135 | +typedefstructNM_ANIMATION |
| 136 | +{ |
| 137 | +NMHDRhdr, |
| 138 | +NM_ANIMATION_FRAMEitem |
| 139 | +} |
| 140 | +ENDIF |
| 141 | + |
| 142 | + |
| 143 | +//------------------------------------------ |
| 144 | +// ModernUI_Animation Styles |
| 145 | +// |
| 146 | +//------------------------------------------ |
| 147 | +#defineMUIAS_NOSTRETCH 0x0 |
| 148 | +#defineMUIAS_NOCENTER 0x1 |
| 149 | +#defineMUIAS_CENTER 0x2 |
| 150 | +#defineMUIAS_STRETCH 0x3 |
| 151 | +#defineMUIAS_LCLICK 0x4 |
| 152 | +#defineMUIAS_RCLICK 0x8 |
| 153 | +#defineMUIAS_HAND 0x10 |
| 154 | +#defineMUIAS_CONTROL 0x20 |
| 155 | + |
| 156 | +//------------------------------------------------------------------------------ |
| 157 | +// ModernUI_Animation Properties: Use with MUIAnimationSetProperty / |
| 158 | +// MUIAnimationGetProperty or MUI_SETPROPERTY / MUI_GETPROPERTY msgs |
| 159 | +//------------------------------------------------------------------------------ |
| 160 | +#defineAnimationBackColor 0 // RGBCOLOR. Background color of animation |
| 161 | +#defineAnimationBorderColor 4 // RGBCOLOR. Border color of animation |
| 162 | +#defineAnimationLoop 8 // BOOL. Loop animation back to start. Default is TRUE |
| 163 | +#defineAnimationNotifications 12 // BOOL. Allow notifications via WM_NOTIFY. Default is TRUE |
| 164 | +#defineAnimationNotifyCallback 16 // DWORD. Address of custom notifications callback function (MUIAnimationNotifyCallback) |
| 165 | +#defineAnimationDllInstance 20 // DWORD. Instance of DLL if using control in a DLL |
| 166 | +#defineAnimationParam 24 // DWORD. Custom user specified value |
| 167 | + |
| 168 | +// Animation Image Type: |
| 169 | +#defineMUIAIT_NONE 0 |
| 170 | +#defineMUIAIT_BMP 1 |
| 171 | +#defineMUIAIT_ICO 2 |
| 172 | +#defineMUIAIT_PNG 3 |
| 173 | + |
| 174 | +// Animation Frame Type: |
| 175 | +#defineMUIAFT_FULL 0 |
| 176 | +#defineMUIAFT_COMPACT 1 |
| 177 | + |
| 178 | + |
| 179 | +#ifdef__cplusplus |
| 180 | +} |
| 181 | +#endif |