summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ExternalAPI/m_cluiframes.h (renamed from buddyexpectator/m_cluiframes.h)0
-rw-r--r--buddyexpectator/BuddyExpectator10.vcxproj4
-rw-r--r--buddyexpectator/BuddyExpectator8.vcproj4
-rw-r--r--buddyexpectator/buddyexpectator.vcproj4
-rw-r--r--buddyexpectator/m_popup.h418
-rw-r--r--buddyexpectator/m_updater.h150
6 files changed, 6 insertions, 574 deletions
diff --git a/buddyexpectator/m_cluiframes.h b/ExternalAPI/m_cluiframes.h
index dbed148..dbed148 100644
--- a/buddyexpectator/m_cluiframes.h
+++ b/ExternalAPI/m_cluiframes.h
diff --git a/buddyexpectator/BuddyExpectator10.vcxproj b/buddyexpectator/BuddyExpectator10.vcxproj
index 1397d45..2d48cc2 100644
--- a/buddyexpectator/BuddyExpectator10.vcxproj
+++ b/buddyexpectator/BuddyExpectator10.vcxproj
@@ -65,7 +65,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -109,7 +109,7 @@
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
diff --git a/buddyexpectator/BuddyExpectator8.vcproj b/buddyexpectator/BuddyExpectator8.vcproj
index c9f2883..fd4fb47 100644
--- a/buddyexpectator/BuddyExpectator8.vcproj
+++ b/buddyexpectator/BuddyExpectator8.vcproj
@@ -48,7 +48,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../../include"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -145,7 +145,7 @@
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="../../include"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS"
StringPooling="true"
RuntimeLibrary="0"
diff --git a/buddyexpectator/buddyexpectator.vcproj b/buddyexpectator/buddyexpectator.vcproj
index 9317393..a83a32c 100644
--- a/buddyexpectator/buddyexpectator.vcproj
+++ b/buddyexpectator/buddyexpectator.vcproj
@@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../../include"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@@ -68,7 +68,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="../../include"
+ AdditionalIncludeDirectories="../../include;../ExternalAPI"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
diff --git a/buddyexpectator/m_popup.h b/buddyexpectator/m_popup.h
deleted file mode 100644
index 9dc9d61..0000000
--- a/buddyexpectator/m_popup.h
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
-===============================================================================
- PopUp plugin
-Plugin Name: PopUp
-Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
- Victor Pavlychko (nullbie@gmail.com)
-===============================================================================
-The purpose of this plugin is to give developers a common "platform/interface"
-to show PopUps. It is born from the source code of NewStatusNotify, another
-plugin I've made.
-
-Remember that users *must* have this plugin enabled, or they won't get any
-popup. Write this in the requirements, do whatever you wish ;-)... but tell
-them!
-===============================================================================
-*/
-
-#ifndef __m_popup_h__
-#define __m_popup_h__
-
-/*
-NOTE! Since Popup 1.0.1.2 there is a main meun group called "PopUps" where I
-have put a "Enable/Disable" item. You can add your own "enable/disable" items
-by adding these lines before you call MS_CLIST_ADDMAINMENUITEM:
-mi.pszPopUpName = Translate("PopUps");
-mi.position = 0; //You don't need it and it's better if you put it to zero.
-*/
-
-#ifndef POPUP_VERSION
-#define POPUP_VERSION 0x02010003
-#endif
-
-#define MAX_CONTACTNAME 2048
-#define MAX_SECONDLINE 2048
-#define MAX_ACTIONTITLE 64
-
-// Popup Action flags
-#define PAF_ENABLED 0x01 // Actions is enabled. You may store one global
- // action set and toggle some items depending on
- // popup you are requesting
-
-// ANSI Popup Action
-typedef struct
-{
- int cbSize; // sizeof(POPUPACTION)
- HICON lchIcon; // Action Icon
- union
- { // Action title text
- char lptzTitle[MAX_ACTIONTITLE];
- char lpzTitle[MAX_ACTIONTITLE];
- };
- DWORD flags; // set of PAF_* flags
- WPARAM wParam; // wParam for UM_POPUPACTION message
- LPARAM lParam; // lParam for UM_POPUPACTION message
-} POPUPACTION, *LPPOPUPACTION;
-
-// Unicode version of POPUPACTION
-typedef struct
-{
- int cbSize;
- HICON lchIcon;
- union
- {
- WCHAR lptzTitle[MAX_ACTIONTITLE];
- WCHAR lpwzTitle[MAX_ACTIONTITLE];
- };
- DWORD flags;
- WPARAM wParam;
- LPARAM lParam;
-} POPUPACTIONW, *LPPOPUPACTIONW;
-
-// This is the basic data you'll need to fill and pass to the service function.
-typedef struct
-{
- HANDLE lchContact; // Handle to the contact, can be NULL (main contact).
- HICON lchIcon; // Handle to a icon to be shown. Cannot be NULL.
- union
- {
- char lptzContactName[MAX_CONTACTNAME]; // This is the contact name or the first line in the plugin. Cannot be NULL.
- char lpzContactName[MAX_CONTACTNAME];
- };
- union
- {
- char lptzText[MAX_SECONDLINE]; // This is the second line text. Users can choose to hide it. Cannot be NULL.
- char lpzText[MAX_SECONDLINE];
- };
- COLORREF colorBack; // COLORREF to be used for the background. Can be NULL, default will be used.
- COLORREF colorText; // COLORREF to be used for the text. Can be NULL, default will be used.
- WNDPROC PluginWindowProc; // Read below. Can be NULL; default will be used.
- void * PluginData; // Read below. Can be NULL.
-} POPUPDATA, * LPPOPUPDATA;
-
-// Extended popup data
-typedef struct
-{
- HANDLE lchContact;
- HICON lchIcon;
- union
- {
- char lptzContactName[MAX_CONTACTNAME];
- char lpzContactName[MAX_CONTACTNAME];
- };
- union
- {
- char lptzText[MAX_SECONDLINE];
- char lpzText[MAX_SECONDLINE];
- };
- COLORREF colorBack;
- COLORREF colorText;
- WNDPROC PluginWindowProc;
- void * PluginData;
- int iSeconds; // Custom delay time in seconds. -1 means "forever", 0 means "default time".
-
-#if POPUP_VERSION < 0x02010003
- // For compatability
- char cZero[16]; // Some unused bytes which may come useful in the future.
-
-#else
- // you *MUST* pass APT_NEWDATA flag for services to take care of this data
- HBITMAP hbmAvatar; // Bitmap to use instead of avatar
- int actionCount; // Amount of passed actions
- LPPOPUPACTION lpActions; // Popup Actions
- int cbSize; // struct size for future
-#endif
-} POPUPDATAEX, *LPPOPUPDATAEX;
-
-// Unicode version of POPUPDATAEX
-typedef struct
-{
- HANDLE lchContact;
- HICON lchIcon;
- union
- {
- WCHAR lptzContactName[MAX_CONTACTNAME];
- WCHAR lpwzContactName[MAX_CONTACTNAME];
- };
- union
- {
- WCHAR lptzText[MAX_CONTACTNAME];
- WCHAR lpwzText[MAX_CONTACTNAME];
- };
- COLORREF colorBack;
- COLORREF colorText;
- WNDPROC PluginWindowProc;
- void * PluginData;
- int iSeconds;
-#if POPUP_VERSION < 0x02010003
- char cZero[16];
-#else
- HBITMAP hbmAvatar;
- int actionCount;
- LPPOPUPACTIONW lpActions;
- int cbSize;
-#endif
-} POPUPDATAW, *LPPOPUPDATAW;
-
-#if defined(_UNICODE) || defined(UNICODE)
- typedef POPUPDATAW POPUPDATAT;
- typedef LPPOPUPDATAW LPPOPUPDATAT;
- typedef POPUPACTIONW POPUPACTIONT;
- typedef LPPOPUPACTIONW LPPOPUPACTIONT;
-#else
- typedef POPUPDATAEX POPUPDATAT;
- typedef LPPOPUPDATAEX LPPOPUPDATAT;
- typedef POPUPACTION POPUPACTIONT;
- typedef LPPOPUPACTION LPPOPUPACTIONT;
-#endif
-
-/* PopUp/AddPopup
-Creates, adds and shows a popup, given a (valid) POPUPDATA structure pointer.
-
-wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
-lParam = 0
-
-Returns: > 0 on success, 0 if creation went bad, -1 if the PopUpData contained unacceptable values.
-NOTE: it returns -1 if the PopUpData was not valid, if there were already too many popups, if the module was disabled.
-Otherwise, it can return anything else...
-
-Popup Plus 2.0.4.0+
-You may pass additional creation flags via lParam:
- APF_RETURN_HWND ....... function returns handle to newly created popup window (however this calls are a bit slower)
- APF_CUSTOM_POPUP ...... new popup is created in hidden state and doesn't obey to popup queue rules.
- you may control it via UM_* messages and custom window procedure (not yet implemented)
- APF_NO_HISTORY ........ do not log this popup in popup history (useful for previews)
- APF_NO_POPUP .......... do not show popup. this is useful if you want popup yo be stored in history only
- APF_NEWDATA ........... use new version of POPUPDATAEX/POPUPDATAW structs
-*/
-#define APF_RETURN_HWND 0x01
-#define APF_CUSTOM_POPUP 0x02
-#define APF_NO_HISTORY 0x04
-#define APF_NO_POPUP 0x08
-#define APF_NEWDATA 0x10
-
-#define MS_POPUP_ADDPOPUP "PopUp/AddPopUp"
-static int __inline PUAddPopUp(POPUPDATA* ppdp) {
- return CallService(MS_POPUP_ADDPOPUP, (WPARAM)ppdp,0);
-}
-
-#define MS_POPUP_ADDPOPUPEX "PopUp/AddPopUpEx"
-static int __inline PUAddPopUpEx(POPUPDATAEX* ppdp) {
- return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
-}
-
-#define MS_POPUP_ADDPOPUPW "PopUp/AddPopUpW"
-static int __inline PUAddPopUpW(POPUPDATAW* ppdp) {
- return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp,0);
-}
-
-#if defined(_UNICODE) || defined(UNICODE)
- #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPW
- #define PUAddPopUpT PUAddPopUpW
-#else
- #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPEX
- #define PUAddPopUpT PUAddPopUpEx
-#endif
-
-
-/* PopUp/GetContact
-Returns the handle to the contact associated to the specified PopUpWindow.
-
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = 0;
-
-Returns: the HANDLE of the contact. Can return NULL, meaning it's the main contact. -1 means failure.
-*/
-#define MS_POPUP_GETCONTACT "PopUp/GetContact"
-static HANDLE __inline PUGetContact(HWND hPopUpWindow) {
- return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopUpWindow,0);
-}
-
-/* PopUp/GetPluginData
-Returns custom plugin date associated with popup
-
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = (LPARAM)(PLUGINDATA*)PluginDataAddress;
-
-Returns: the address of the PLUGINDATA structure. Can return NULL, meaning nothing was given. -1 means failure.
-
-IMPORTANT NOTE: it doesn't seem to work if you do:
-CallService(..., (LPARAM)aPointerToAStruct);
-and then use that struct.
-Do this, instead:
-aPointerToStruct = CallService(..., (LPARAM)aPointerToAStruct);
-and it will work. Just look at the example I've written above (PopUpDlgProc).
-
-*/
-#define MS_POPUP_GETPLUGINDATA "PopUp/GetPluginData"
-static void __inline * PUGetPluginData(HWND hPopUpWindow) {
- long * uselessPointer = NULL;
- return (void*)CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hPopUpWindow,(LPARAM)uselessPointer);
-}
-
-/* PopUp/IsSecondLineShown
-Checks if second line is enable
-
-wParam = 0
-lParam = 0
-
-Returns: 0 if the user has chosen not to have the second line, 1 if he choose to have the second line.
-*/
-#define MS_POPUP_ISSECONDLINESHOWN "PopUp/IsSecondLineShown"
-static BOOL __inline PUIsSecondLineShown() {
- return (BOOL)CallService(MS_POPUP_ISSECONDLINESHOWN,0,0);
-}
-
-/* PopUp/Query
-
-Requests an action or an answer from PopUp module.
-
-wParam = (WPARAM)wpQuery
-
-returns 0 on success, -1 on error, 1 on stupid calls ;-)
-*/
-
-#define PUQS_ENABLEPOPUPS 1 // returns 0 if state was changed, 1 if state wasn't changed
-#define PUQS_DISABLEPOPUPS 2 // " "
-#define PUQS_GETSTATUS 3 //Returns 1 (TRUE) if popups are enabled, 0 (FALSE) if popups are disabled.
-
-#define MS_POPUP_QUERY "PopUp/Query"
-
-/* UM_FREEPLUGINDATA
-Process this message if you have allocated your own memory. (i.e.: POPUPDATA.PluginData != NULL)
-
-wParam = 0
-lParam = 0
-*/
-#define UM_FREEPLUGINDATA (WM_USER + 0x0200)
-
-/* UM_DESTROYPOPUP
-Send this message when you want to destroy the popup, or use the function below.
-
-wParam = 0
-lParam = 0
-*/
-#define UM_DESTROYPOPUP (WM_USER + 0x0201)
-static int __inline PUDeletePopUp(HWND hWndPopUp) {
- return (int)SendMessage(hWndPopUp, UM_DESTROYPOPUP,0,0);
-}
-
-/* UM_INITPOPUP
-This message is sent to the PopUp when its creation has been finished, so POPUPDATA (and thus your PluginData) is reachable.
-Catch it if you needed to catch WM_CREATE or WM_INITDIALOG, which you'll never ever get in your entire popup-life.
-Return value: if you process this message, return 0. If you don't process it, return 0. Do whatever you like ;-)
-
-wParam = (WPARAM)(HWND)hPopUpWindow (this is useless, you get message inside your popup window)
-lParam = 0
-*/
-#define UM_INITPOPUP (WM_USER + 0x0202)
-
-/* PopUp/Changetext
-Changes the text displayed in the second line of the popup.
-
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = (LPARAM)(char*)lpzNewText
-
-returns: > 0 for success, -1 for failure, 0 if the failure is due to second line not being shown. (but you could call
-PUIsSecondLineShown() before changing the text...)
-*/
-#define MS_POPUP_CHANGETEXT "PopUp/Changetext"
-static int __inline PUChangeText(HWND hWndPopUp, LPCTSTR lpzNewText) {
- return (int)CallService(MS_POPUP_CHANGETEXT, (WPARAM)hWndPopUp, (LPARAM)lpzNewText);
-}
-
-#define MS_POPUP_CHANGETEXTW "PopUp/ChangetextW"
-static int __inline PUChangeTextW(HWND hWndPopUp, LPCWSTR lpwzNewText) {
- return (int)CallService(MS_POPUP_CHANGETEXTW, (WPARAM)hWndPopUp, (LPARAM)lpwzNewText);
-}
-
-#if defined(_UNICODE) || defined(UNICODE)
- #define MS_POPUP_CHANGETEXTT MS_POPUP_CHANGETEXTW
- #define PUChangeTextT PUChangeTextW
-#else
- #define MS_POPUP_CHANGETEXTT MS_POPUP_CHANGETEXT
- #define PUChangeTextT PUChangeText
-#endif
-
-/* PopUp/Change
-Changes the entire popup
-
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = (LPARAM)(POPUPDATAEX*)newData
-*/
-#define MS_POPUP_CHANGE "PopUp/Change"
-static int __inline PUChange(HWND hWndPopUp, POPUPDATAEX *newData) {
- return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
-}
-
-#define MS_POPUP_CHANGEW "PopUp/ChangeW"
-static int __inline PUChangeW(HWND hWndPopUp, POPUPDATAW *newData) {
- return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
-}
-
-#if defined(_UNICODE) || defined(UNICODE)
- #define MS_POPUP_CHANGET MS_POPUP_CHANGEW
- #define PUChangeT PUChangeW
-#else
- #define MS_POPUP_CHANGET MS_POPUP_CHANGE
- #define PUChangeT PUChange
-#endif
-
-/* UM_CHANGEPOPUP
-This message is triggered by Change/ChangeText services. You also may post it directly, but make
-sure you allocate memory via miranda mmi, because popup will mir_free() them!
-
-wParam = Modification type
-lParam = value of type defined by wParam
-*/
-
-#define CPT_TEXT 1 // lParam = (char *)text
-#define CPT_TEXTW 2 // lParam = (WCHAR *)text
-#define CPT_TITLE 3 // lParam = (char *)title
-#define CPT_TITLEW 4 // lParam = (WCHAR *)title
-#define CPT_DATA 5 // lParam = (POPUPDATA *)data
-#define CPT_DATAEX 6 // lParam = (POPUPDATAEX *)data
-#define CPT_DATAW 7 // lParam = (POPUPDATAW *)data
-#define CPT_DATA2 8 // lParam = (POPUPDATA2 *)data -- see m_popup2.h for details
-
-#define UM_CHANGEPOPUP (WM_USER + 0x0203)
-
-#if defined(_UNICODE) || defined(UNICODE)
- #define CPT_TEXTT CPT_TEXTW
- #define CPT_TITLET CPT_TITLEW
- #define CPT_DATAT CPT_DATAW
-#else
- #define CPT_TEXTT CPT_TEXT
- #define CPT_TITLET CPT_TITLE
- #define CPT_DATAT CPT_DATA
-#endif
-
-/* UM_POPUPACTION
-Popup Action notification
-
-wParam and lParam are specified bu plugin.
-wParam = 0 is used buy popup plus internally!
-*/
-
-#define UM_POPUPACTION (WM_USER + 0x0204)
-
-/* PopUp/ShowMessage
-This is mainly for developers.
-Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal
-window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
-
-wParam = (char *)lpzMessage
-lParam = 0;
-
-Returns: 0 if the popup was shown, -1 in case of failure.
-*/
-#define SM_WARNING 0x01 //Triangle icon.
-#define SM_NOTIFY 0x02 //Exclamation mark icon.
-#define SM_ERROR 0x03 //Cross icon.
-#define MS_POPUP_SHOWMESSAGE "PopUp/ShowMessage"
-
-static int __inline PUShowMessage(char *lpzText, DWORD kind) {
- return (int)CallService(MS_POPUP_SHOWMESSAGE, (WPARAM)lpzText,(LPARAM)kind);
-}
-
-#endif // __m_popup_h__
diff --git a/buddyexpectator/m_updater.h b/buddyexpectator/m_updater.h
deleted file mode 100644
index 488d372..0000000
--- a/buddyexpectator/m_updater.h
+++ /dev/null
@@ -1,150 +0,0 @@
-#ifndef _M_UPDATER_H
-#define _M_UPDATER_H
-
-// NOTES:
-// - For langpack updates, include a string of the following format in the langpack text file:
-// ";FLID: <file listing name> <version>"
-// version must be four numbers seperated by '.', in the range 0-255 inclusive
-// - Updater will disable plugins that are downloaded but were not active prior to the update (this is so that, if an archive contains e.g. ansi and
-// unicode versions, the correct plugin will be the only one active after the new version is installed)...so if you add a support plugin, you may need
-// to install an ini file to make the plugin activate when miranda restarts after the update
-// - Updater will replace all dlls that have the same internal shortName as a downloaded update dll (this is so that msn1.dll and msn2.dll, for example,
-// will both be updated) - so if you have a unicode and a non-unicode version of a plugin in your archive, you should make the internal names different (which will break automatic
-// updates from the file listing if there is only one file listing entry for both versions, unless you use the 'MS_UPDATE_REGISTER' service below)
-// - Updater will install all files in the root of the archive into the plugins folder, except for langpack files that contain the FLID string which go into the root folder (same
-// folder as miranda32.exe)...all folders in the archive will also be copied to miranda's root folder, and their contents transferred into the new folders. The only exception is a
-// special folder called 'root_files' - if there is a folder by that name in the archive, it's contents will also be copied into miranda's root folder - this is intended to be used
-// to install additional dlls etc that a plugin may require)
-
-// if you set Update.szUpdateURL to the following value when registering, as well as setting your beta site and version data,
-// Updater will ignore szVersionURL and pbVersionPrefix, and attempt to find the file listing URL's from the backend XML data.
-// for this to work, the plugin name in pluginInfo.shortName must match the file listing exactly (except for case)
-#define UPDATER_AUTOREGISTER "UpdaterAUTOREGISTER"
-// Updater will also use the backend xml data if you provide URL's that reference the miranda file listing for updates (so you can use that method
-// if e.g. your plugin shortName does not match the file listing) - it will grab the file listing id from the end of these URLs
-
-typedef struct Update_tag {
- int cbSize;
- char *szComponentName; // component name as it will appear in the UI (will be translated before displaying)
-
- char *szVersionURL; // URL where the current version can be found (NULL to disable)
- BYTE *pbVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
- // (note that this URL could point at a binary file - dunno why, but it could :)
- int cpbVersionPrefix; // number of bytes pointed to by pbVersionPrefix
- char *szUpdateURL; // URL where dll/zip is located
- // set to UPDATER_AUTOREGISTER if you want Updater to find the file listing URLs (ensure plugin shortName matches file listing!)
-
- char *szBetaVersionURL; // URL where the beta version can be found (NULL to disable betas)
- BYTE *pbBetaVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
- int cpbBetaVersionPrefix; // number of bytes pointed to by pbVersionPrefix
- char *szBetaUpdateURL; // URL where dll/zip is located
-
- BYTE *pbVersion; // bytes of current version, used for comparison with those in VersionURL
- int cpbVersion; // number of bytes pointed to by pbVersion
-
- char *szBetaChangelogURL; // url for displaying changelog for beta versions
-} Update;
-
-// register a comonent with Updater
-//
-// wparam = 0
-// lparam = (LPARAM)&Update
-#define MS_UPDATE_REGISTER "Update/Register"
-
-// utility functions to create a version string from a DWORD or from pluginInfo
-// point buf at a buffer at least 16 chars wide - but note the version string returned may be shorter
-//
-__inline static char *CreateVersionString(DWORD version, char *buf) {
- mir_snprintf(buf, 16, "%d.%d.%d.%d", (version >> 24) & 0xFF, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
- return buf;
-}
-
-__inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *buf) {
- return CreateVersionString(pluginInfo->version, buf);
-}
-
-__inline static char *CreateVersionStringPluginEx(PLUGININFOEX *pluginInfo, char *buf) {
- return CreateVersionString(pluginInfo->version, buf);
-}
-
-
-// register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing
-// NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1,
-// four numbers between 0 and 255 inclusivem, so no letters, brackets, etc.)
-//
-// wParam = (int)fileID - this is the file ID from the file listing (i.e. the number at the end of the download link)
-// lParam = (PLUGININFO*)&pluginInfo
-#define MS_UPDATE_REGISTERFL "Update/RegisterFL"
-
-// this function can be used to 'unregister' components - useful for plugins that register non-plugin/langpack components and
-// may need to change those components on the fly
-// lParam = (char *)szComponentName
-#define MS_UPDATE_UNREGISTER "Update/Unregister"
-
-// this event is fired when the startup process is complete, but NOT if a restart is imminent
-// it is designed for status managment plugins to use as a trigger for beggining their own startup process
-// wParam = lParam = 0 (unused)
-// (added in version 0.1.6.0)
-#define ME_UPDATE_STARTUPDONE "Update/StartupDone"
-
-// this service can be used to enable/disable Updater's global status control
-// it can be called from the StartupDone event handler
-// wParam = (BOOL)enable
-// lParam = 0
-// (added in version 0.1.6.0)
-#define MS_UPDATE_ENABLESTATUSCONTROL "Update/EnableStatusControl"
-
-// An description of usage of the above service and event:
-// Say you are a status control plugin that normally sets protocol or global statuses in your ModulesLoaded event handler.
-// In order to make yourself 'Updater compatible', you would move the status control code from ModulesLoaded to another function,
-// say DoStartup. Then, in ModulesLoaded you would check for the existence of the MS_UPDATE_ENABLESTATUSCONTROL service.
-// If it does not exist, call DoStartup. If it does exist, hook the ME_UPDATE_STARTUPDONE event and call DoStartup from there. You may
-// also wish to call MS_UPDATE_ENABLESTATUSCONTROL with wParam == FALSE at this time, to disable Updater's own status control feature.
-
-// this service can be used to determine whether updates are possible for a component with the given name
-// wParam = 0
-// lParam = (char *)szComponentName
-// returns TRUE if updates are supported, FALSE otherwise
-#define MS_UPDATE_ISUPDATESUPPORTED "Update/IsUpdateSupported"
-
-#endif
-
-
-/////////////// Usage Example ///////////////
-
-#ifdef EXAMPLE_CODE
-
-// you need to #include "m_updater.h" and HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded) in your Load function...
-
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
-
- Update update = {0}; // for c you'd use memset or ZeroMemory...
- char szVersion[16];
-
- update.cbSize = sizeof(Update);
-
- update.szComponentName = pluginInfo.shortName;
- update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
- update.cpbVersion = strlen((char *)update.pbVersion);
-
- // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
- // before the version that we use to locate it on the page
- // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
- // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
- update.szUpdateURL = "http://scottellis.com.au:81/test/updater.zip";
- update.szVersionURL = "http://scottellis.com.au:81/test/updater_test.html";
- update.pbVersionPrefix = (BYTE *)"Updater version ";
-
- update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
-
- // do the same for the beta versions of the above struct members if you wish to allow beta updates from another URL
-
- CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
-
- // Alternatively, to register a plugin with e.g. file ID 2254 on the file listing...
- // CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
-
- return 0;
-}
-
-#endif