diff options
Diffstat (limited to 'plugins/tabsrmm/API')
-rw-r--r-- | plugins/tabsrmm/API/m_buttonbar.h | 54 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_cln_skinedit.h | 147 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_fingerprint.h | 50 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_flash.h | 93 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_folders.h | 282 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_historyevents.h | 424 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_ieview.h | 194 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_mathmodule.h | 200 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_metacontacts.h | 128 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_msg_buttonsbar.h | 120 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_nudge.h | 5 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_popup2.h | 457 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_smileyadd.h | 252 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_spellchecker.h | 72 | ||||
-rw-r--r-- | plugins/tabsrmm/API/m_updater.h | 150 |
15 files changed, 2628 insertions, 0 deletions
diff --git a/plugins/tabsrmm/API/m_buttonbar.h b/plugins/tabsrmm/API/m_buttonbar.h new file mode 100644 index 0000000000..9be67e965b --- /dev/null +++ b/plugins/tabsrmm/API/m_buttonbar.h @@ -0,0 +1,54 @@ +#ifndef _BUTTONSBAR_H
+#define _BUTTONSBAR_H
+
+#define MIN_CBUTTONID 4000
+#define MAX_CBUTTONID 5000
+
+#define BBSF_IMBUTTON (1<<0)
+#define BBSF_CHATBUTTON (1<<1)
+#define BBSF_CANBEHIDDEN (1<<2)
+#define BBSF_NTBSWAPED (1<<3)
+#define BBSF_NTBDESTRUCT (1<<4)
+
+typedef struct _tagCustomButtonData
+ {
+ DWORD dwButtonOrigID; // id of button used while button creation and to store button info in DB
+ char * pszModuleName; //module name without spaces and underline symbols (e.g. "tabsrmm")
+
+ DWORD dwButtonCID;
+ DWORD dwArrowCID; //only use with BBBF_ISARROWBUTTON flag
+
+ TCHAR * ptszTooltip; //button's tooltip
+
+ DWORD dwPosition; // default order pos of button, counted from window edge (left or right)
+ int iButtonWidth; //must be 22 for regular button and 33 for button with arrow
+ HANDLE hIcon; //Handle to icolib registred icon
+ BOOL bIMButton,bChatButton;
+ BOOL bCanBeHidden,bHidden,bAutoHidden,bDummy,bDisabled,bPushButton;
+ BOOL bLSided,bRSided;
+ BYTE opFlags;
+ }CustomButtonData;
+
+static INT_PTR CB_ModifyButton(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_RemoveButton(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam);
+static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam);
+static void CB_GetButtonSettings(HANDLE hContact,CustomButtonData *cbd);
+
+void CB_WriteButtonSettings(HANDLE hContact,CustomButtonData *cbd);
+int sstSortButtons(const void * vmtbi1, const void * vmtbi2);
+
+void CB_DeInitCustomButtons();
+void CB_InitCustomButtons();
+void CB_InitDefaultButtons();
+void CB_ReInitCustomButtons();
+
+/* MinGW doesn't like this struct declatations below */
+void BB_UpdateIcons(HWND hdlg,struct TWindowData *dat);
+void BB_RefreshTheme(const TWindowData *dat);
+void CB_DestroyAllButtons(HWND hwndDlg,struct TWindowData *dat);
+void CB_DestroyButton(HWND hwndDlg,struct TWindowData *dat,DWORD dwButtonCID,DWORD dwFlags);
+void CB_ChangeButton(HWND hwndDlg,struct TWindowData *dat,CustomButtonData* cbd);
+
+#endif
diff --git a/plugins/tabsrmm/API/m_cln_skinedit.h b/plugins/tabsrmm/API/m_cln_skinedit.h new file mode 100644 index 0000000000..5ee66829c5 --- /dev/null +++ b/plugins/tabsrmm/API/m_cln_skinedit.h @@ -0,0 +1,147 @@ +
+/*
+ * services
+ */
+
+#define MS_CLNSE_INVOKE "CLN_Skinedit/Invoke"
+#define MS_CLNSE_FILLBYCURRENTSEL "CLN_Skinedit/FillByCurrentSel"
+
+/*
+ * data structs
+ */
+
+struct TWindowData;
+class CImageItem;
+
+struct ButtonItem {
+ TCHAR szName[40];
+ HWND hWnd;
+ LONG xOff, yOff;
+ LONG width, height;
+ CImageItem *imgNormal, *imgPressed, *imgHover;
+ LONG_PTR normalGlyphMetrics[4];
+ LONG_PTR hoverGlyphMetrics[4];
+ LONG_PTR pressedGlyphMetrics[4];
+ DWORD dwFlags, dwStockFlags;
+ DWORD uId;
+ TCHAR szTip[256];
+ char szService[256];
+ char szModule[256], szSetting[256];
+ BYTE bValuePush[256], bValueRelease[256];
+ DWORD type;
+ void (*pfnAction)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
+ void (*pfnCallback)(ButtonItem *item, HWND hwndDlg, TWindowData *dat, HWND hwndItem);
+ TCHAR tszLabel[40];
+ ButtonItem* nextItem;
+ HANDLE hContact;
+ TWindowData *dat;
+};
+
+typedef struct _tagButtonSet {
+ ButtonItem *items;
+ LONG left, top, right, bottom; // client area offsets, calculated from button layout
+} ButtonSet;
+
+struct CSkinItem {
+ TCHAR szName[40];
+ char szDBname[40];
+ int statusID;
+
+ BYTE GRADIENT;
+ BYTE CORNER;
+
+ DWORD COLOR;
+ DWORD COLOR2;
+
+ BYTE COLOR2_TRANSPARENT;
+
+ DWORD TEXTCOLOR;
+
+ int ALPHA;
+
+ int MARGIN_LEFT;
+ int MARGIN_TOP;
+ int MARGIN_RIGHT;
+ int MARGIN_BOTTOM;
+ BYTE IGNORED;
+ DWORD BORDERSTYLE;
+ CImageItem *imageItem;
+};
+
+typedef struct _tagSkinDescription {
+ DWORD cbSize;
+ CSkinItem *StatusItems;
+ int lastItem;
+ int firstItem;
+ char szModule[100];
+ HWND hWndParent, hWndTab;
+ HWND hwndCLUI;
+ HWND hwndSkinEdit; /* out param */
+ HWND hwndImageEdit; /* out param */
+ HMENU hMenuItems;
+ void (*pfnSaveCompleteStruct)(void);
+ void (*pfnClcOptionsChanged )(void);
+ void* (*pfnMalloc)(unsigned int);
+ void (*pfnFree)(void);
+ void* (*pfnRealloc)(void *, unsigned int);
+ void* reserved[20];
+} SKINDESCRIPTION;
+
+// defines
+
+// FLAGS
+#define CORNER_NONE 0
+#define CORNER_ACTIVE 1
+#define CORNER_TL 2
+#define CORNER_TR 4
+#define CORNER_BR 8
+#define CORNER_BL 16
+#define CORNER_ALL (CORNER_TL | CORNER_TR | CORNER_BR | CORNER_BL | CORNER_ACTIVE)
+
+#define GRADIENT_NONE 0
+#define GRADIENT_ACTIVE 1
+#define GRADIENT_LR 2
+#define GRADIENT_RL 4
+#define GRADIENT_TB 8
+#define GRADIENT_BT 16
+
+#define IMAGE_PERPIXEL_ALPHA 1
+#define IMAGE_FLAG_DIVIDED 2
+#define IMAGE_FILLSOLID 4
+#define IMAGE_GLYPH 8
+
+#define IMAGE_STRETCH_V 1
+#define IMAGE_STRETCH_H 2
+#define IMAGE_STRETCH_B 4
+
+#define BUTTON_ISINTERNAL 1
+#define BUTTON_ISTOGGLE 2
+#define BUTTON_ISSERVICE 4
+#define BUTTON_ISPROTOSERVICE 8
+#define BUTTON_PASSHCONTACTW 16
+#define BUTTON_PASSHCONTACTL 32
+#define BUTTON_ISDBACTION 64
+#define BUTTON_ISCONTACTDBACTION 128
+#define BUTTON_DBACTIONONCONTACT 256
+#define BUTTON_ISSIDEBAR 512
+#define BUTTON_NORMALGLYPHISICON 1024
+#define BUTTON_PRESSEDGLYPHISICON 2048
+#define BUTTON_HOVERGLYPHISICON 4096
+#define BUTTON_HASLABEL 8192
+
+#define CLCDEFAULT_GRADIENT 0
+#define CLCDEFAULT_CORNER 0
+
+#define CLCDEFAULT_COLOR 0xd0d0d0
+#define CLCDEFAULT_COLOR2 0xd0d0d0
+
+#define CLCDEFAULT_TEXTCOLOR 0x000000
+
+#define CLCDEFAULT_COLOR2_TRANSPARENT 1
+
+#define CLCDEFAULT_ALPHA 100
+#define CLCDEFAULT_MRGN_LEFT 0
+#define CLCDEFAULT_MRGN_TOP 0
+#define CLCDEFAULT_MRGN_RIGHT 0
+#define CLCDEFAULT_MRGN_BOTTOM 0
+#define CLCDEFAULT_IGNORE 1
diff --git a/plugins/tabsrmm/API/m_fingerprint.h b/plugins/tabsrmm/API/m_fingerprint.h new file mode 100644 index 0000000000..0101166e57 --- /dev/null +++ b/plugins/tabsrmm/API/m_fingerprint.h @@ -0,0 +1,50 @@ +/*
+Based on Miranda plugin template, originally by Richard Hughes
+http://miranda-icq.sourceforge.net/
+
+Miranda IM: the free IM client for Microsoft Windows
+
+Copyright 2000-2006 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/************************************************************************/
+/* Author: Artem Shpynov aka FYR mailto:shpynov@nm.ru */
+/* icons by Angeli-Ka */
+/* January 12, 2006 */
+/************************************************************************/
+
+
+/*
+ * FINGERPRINT PLUGIN SERVICES HEADER
+ */
+
+/*
+ * Service SameClients MS_FP_SAMECLIENTS
+ * wParam - char * first MirVer value
+ * lParam - char * second MirVer value
+ * return pointer to char string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
+ */
+#define MS_FP_SAMECLIENTS "Fingerprint/SameClients"
+
+/*
+ * ServiceGetClientIcon MS_FP_GETCLIENTICON
+ * wParam - char * MirVer value to get client for.
+ * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+ */
+#define MS_FP_GETCLIENTICON "Fingerprint/GetClientIcon"
diff --git a/plugins/tabsrmm/API/m_flash.h b/plugins/tabsrmm/API/m_flash.h new file mode 100644 index 0000000000..bfc9e9f0a2 --- /dev/null +++ b/plugins/tabsrmm/API/m_flash.h @@ -0,0 +1,93 @@ +/*
+Miranda FlashAvatars Plugin
+Plugin support header file
+Copyright (C) 2006 Big Muscle
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+// Service functions
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+ */
+#define MS_FAVATAR_DESTROY "FlashAvatar/Destroy"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+ */
+#define MS_FAVATAR_MAKE "FlashAvatar/Make"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM LPRECT
+ */
+#define MS_FAVATAR_RESIZE "FlashAvatar/Resize"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM not used
+ */
+#define MS_FAVATAR_GETINFO "FlashAvatar/GetInfo"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM BSTR
+ */
+#define MS_FAVATAR_SETEMOFACE "FlashAvatar/SetEmoFace"
+
+#define MS_FAVATAR_SETPOS "FlashAvatar/SetPos"
+
+/**
+ WPARAM FLASHAVATAR* (hContact, hParentWindow)
+ LPARAM COLORREF
+ */
+
+#define MS_FAVATAR_SETBKCOLOR "FlashAvatar/SetBkColor"
+
+// tZers macros
+/**
+ WPARAM not used
+ LPARAM not used
+*/
+#define MS_TZERS_SUPPORT "FlashAvatar/tZers"
+#define EVENTTYPE_TZERS 4
+
+// Avatar emotion faces
+#define AV_SMILE "smile"
+#define AV_SAD "sad"
+#define AV_LAUGH "laugh"
+#define AV_MAD "mad"
+#define AV_CRY "cry"
+#define AV_OFFLINE "offline"
+#define AV_BUSY "busy"
+#define AV_LOVE "love"
+#define AV_NORMAL "stam"
+
+#define FAVATAR_WIDTH 52
+#define FAVATAR_HEIGHT 64
+
+// FLASHAVATAR structure
+typedef struct {
+ HANDLE hContact; // contact who flash avatar belongs to
+ HWND hWindow; // handle of flash avatar object
+ HWND hParentWindow; // handle of flash avatar's parent object
+ char* cUrl; // url of .swf file
+ int id; // unique number of plugin which wants to use avatar service
+ char* cProto; // contacts protocol
+ char reserved[16]; // future usage
+} FLASHAVATAR;
diff --git a/plugins/tabsrmm/API/m_folders.h b/plugins/tabsrmm/API/m_folders.h new file mode 100644 index 0000000000..c6820abcda --- /dev/null +++ b/plugins/tabsrmm/API/m_folders.h @@ -0,0 +1,282 @@ +/*
+Custom profile folders plugin for Miranda IM
+
+Copyright © 2005 Cristian Libotean
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_CUSTOM_FOLDERS_H
+#define M_CUSTOM_FOLDERS_H
+
+#define FOLDERS_API 501 //dunno why it's here but it is :)
+
+#define PROFILE_PATH "%profile_path%"
+#define CURRENT_PROFILE "%current_profile%"
+#define MIRANDA_PATH "%miranda_path%"
+#define PLUGINS_PATH "%miranda_path%" "\\plugins"
+
+#define TO_WIDE(x) L ## x
+
+#define PROFILE_PATHW L"%profile_path%"
+#define CURRENT_PROFILEW L"%current_profile%"
+#define MIRANDA_PATHW L"%miranda_path%"
+
+#define FOLDER_AVATARS PROFILE_PATH "\\" CURRENT_PROFILE "\\avatars"
+#define FOLDER_VCARDS PROFILE_PATH "\\" CURRENT_PROFILE "\\vcards"
+#define FOLDER_LOGS PROFILE_PATH "\\" CURRENT_PROFILE "\\logs"
+#define FOLDER_RECEIVED_FILES PROFILE_PATH "\\" CURRENT_PROFILE "\\received files"
+#define FOLDER_DOCS MIRANDA_PATH "\\" "docs"
+
+#define FOLDER_CONFIG PLUGINS_PATH "\\" "config"
+
+#define FOLDER_SCRIPTS MIRANDA_PATH "\\" "scripts"
+
+#define FOLDER_UPDATES MIRANDA_PATH "\\" "updates"
+
+#define FOLDER_CUSTOMIZE MIRANDA_PATH "\\" "customize"
+#define FOLDER_CUSTOMIZE_SOUNDS FOLDER_CUSTOMIZE "\\sounds"
+#define FOLDER_CUSTOMIZE_ICONS FOLDER_CUSTOMIZE "\\icons"
+#define FOLDER_CUSTOMIZE_SMILEYS FOLDER_CUSTOMIZE "\\smileys"
+#define FOLDER_CUSTOMIZE_SKINS FOLDER_CUSTOMIZE "\\skins"
+#define FOLDER_CUSTOMIZE_THEMES FOLDER_CUSTOMIZE "\\themes"
+
+
+#define FOLDERS_NAME_MAX_SIZE 64 //maximum name and section size
+
+#define FF_UNICODE 0x00000001
+
+#if defined (UNICODE)
+ #define FF_TCHAR FF_UNICODE
+#else
+ #define FF_TCHAR 0
+#endif
+
+typedef struct{
+ int cbSize; //size of struct
+ char szSection[FOLDERS_NAME_MAX_SIZE]; //section name, if it doesn't exist it will be created otherwise it will just add this entry to it
+ char szName[FOLDERS_NAME_MAX_SIZE]; //entry name - will be shown in options
+ union{
+ const char *szFormat; //default string format. Fallback string in case there's no entry in the database for this folder. This should be the initial value for the path, users will be able to change it later.
+ const wchar_t *szFormatW; //String is dup()'d so you can free it later. If you set the unicode string don't forget to set the flag accordingly.
+ const TCHAR *szFormatT;
+ };
+ DWORD flags; //FF_* flags
+} FOLDERSDATA;
+
+/*Folders/Register/Path service
+ wParam - not used, must be 0
+ lParam - (LPARAM) (const FOLDERDATA *) - Data structure filled with
+ the necessary information.
+ Returns a handle to the registered path or 0 on error.
+ You need to use this to call the other services.
+*/
+#define MS_FOLDERS_REGISTER_PATH "Folders/Register/Path"
+
+/*Folders/Get/PathSize service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (int *) - pointer to the variable that receives the size of the path
+ string (not including the null character). Depending on the flags set when creating the path
+ it will either call strlen() or wcslen() to get the length of the string.
+ Returns the size of the buffer.
+*/
+#define MS_FOLDERS_GET_SIZE "Folders/Get/PathSize"
+
+typedef struct{
+ int cbSize;
+ int nMaxPathSize; //maximum size of buffer. This represents the number of characters that can be copied to it (so for unicode strings you don't send the number of bytes but the length of the string).
+ union{
+ char *szPath; //pointer to the buffer that receives the path without the last "\\"
+ wchar_t *szPathW; //unicode version of the buffer.
+ TCHAR *szPathT;
+ };
+} FOLDERSGETDATA;
+
+/*Folders/Get/Path service
+ wParam - (WPARAM) (int) - handle to registered path
+ lParam - (LPARAM) (FOLDERSGETDATA *) pointer to a FOLDERSGETDATA that has all the relevant fields filled.
+ Should return 0 on success, or nonzero otherwise.
+*/
+#define MS_FOLDERS_GET_PATH "Folders/Get/Path"
+
+typedef struct{
+ int cbSize;
+ union{
+ char **szPath; //address of a string variable (char *) or (wchar_t*) where the path should be stored (the last \ won't be copied).
+ wchar_t **szPathW; //unicode version of string.
+ TCHAR **szPathT;
+ };
+} FOLDERSGETALLOCDATA;
+
+/*Folders/GetRelativePath/Alloc service
+ wParam - (WPARAM) (int) - Handle to registered path
+ lParam - (LPARAM) (FOLDERSALLOCDATA *) data
+ This service is the same as MS_FOLDERS_GET_PATH with the difference that this service
+ allocates the needed space for the buffer. It uses miranda's memory functions for that and you need
+ to use those to free the resulting buffer.
+ Should return 0 on success, or nonzero otherwise. Currently it only returns 0.
+*/
+#define MS_FOLDERS_GET_PATH_ALLOC "Folders/Get/Path/Alloc"
+
+
+/*Folders/On/Path/Changed
+ wParam - (WPARAM) 0
+ lParam - (LPARAM) 0
+ Triggered when the folders change, you should reget the paths you registered.
+*/
+#define ME_FOLDERS_PATH_CHANGED "Folders/On/Path/Changed"
+
+#ifndef FOLDERS_NO_HELPER_FUNCTIONS
+
+#ifndef M_UTILS_H__
+#error The helper functions require that m_utils.h be included in the project. Please include that file if you want to use the helper functions. If you don't want to use the functions just define FOLDERS_NO_HELPER_FUNCTIONS.
+#endif
+//#include "../../../include/newpluginapi.h"
+
+__inline static HANDLE FoldersRegisterCustomPath(const char *section, const char *name, const char *defaultPath)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0';
+ fd.szFormat = defaultPath;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static HANDLE FoldersRegisterCustomPathW(const char *section, const char *name, const wchar_t *defaultPathW)
+{
+ FOLDERSDATA fd = {0};
+ if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
+ fd.cbSize = sizeof(FOLDERSDATA);
+ strncpy(fd.szSection, section, FOLDERS_NAME_MAX_SIZE);
+ fd.szSection[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ strncpy(fd.szName, name, FOLDERS_NAME_MAX_SIZE);
+ fd.szName[FOLDERS_NAME_MAX_SIZE - 1] = '\0'; //make sure it's NULL terminated
+ fd.szFormatW = defaultPathW;
+ fd.flags = FF_UNICODE;
+ return (HANDLE) CallService(MS_FOLDERS_REGISTER_PATH, 0, (LPARAM) &fd);
+}
+
+__inline static int FoldersGetCustomPath(HANDLE hFolderEntry, char *path, const int size, char *notFound)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ char buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+
+ return res;
+}
+
+__inline static int FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ return res;
+}
+
+__inline static int FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, const int size, char *notFound, char *fileName)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = size;
+ fgd.szPath = path;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ char buffer[MAX_PATH];
+ CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ mir_snprintf(path, size, "%s", buffer);
+ }
+ if (strlen(path) > 0)
+ {
+ strcat(path, "\\");
+ }
+ else{
+ path[0] = '\0';
+ }
+
+ if (fileName)
+ {
+ strcat(path, fileName);
+ }
+
+ return res;
+}
+
+__inline static int FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pathW, const int count, wchar_t *notFoundW, wchar_t *fileNameW)
+{
+ FOLDERSGETDATA fgd = {0};
+ int res;
+ fgd.cbSize = sizeof(FOLDERSGETDATA);
+ fgd.nMaxPathSize = count;
+ fgd.szPathW = pathW;
+ res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
+ if (res)
+ {
+ wcsncpy(pathW, notFoundW, count);
+ pathW[count - 1] = '\0';
+ }
+
+ if (wcslen(pathW) > 0)
+ {
+ wcscat(pathW, L"\\");
+ }
+ else{
+ pathW[0] = L'\0';
+ }
+
+ if (fileNameW)
+ {
+ wcscat(pathW, fileNameW);
+ }
+
+ return res;
+}
+
+# ifdef _UNICODE
+# define FoldersGetCustomPathT FoldersGetCustomPathW
+# define FoldersGetCustomPathExT FoldersGetCustomPathExW
+# define FoldersRegisterCustomPathT FoldersRegisterCustomPathW
+#else
+# define FoldersGetCustomPathT FoldersGetCustomPath
+# define FoldersGetCustomPathExT FoldersGetCustomPath
+# define FoldersRegisterCustomPathT FoldersRegisterCustomPath
+#endif
+
+#endif
+
+#endif //M_CUSTOM_FOLDERS_H
\ No newline at end of file diff --git a/plugins/tabsrmm/API/m_historyevents.h b/plugins/tabsrmm/API/m_historyevents.h new file mode 100644 index 0000000000..f73bf95b0f --- /dev/null +++ b/plugins/tabsrmm/API/m_historyevents.h @@ -0,0 +1,424 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_HISTORYEVENTS_H__
+# define __M_HISTORYEVENTS_H__
+
+
+#define MIID_HISTORYEVENTS { 0xc8be8543, 0x6618, 0x4030, { 0x85, 0xcf, 0x90, 0x82, 0xc7, 0xde, 0x7f, 0xf7 } }
+
+
+#define HISTORYEVENTS_FORMAT_CHAR 1
+#define HISTORYEVENTS_FORMAT_WCHAR 2
+#define HISTORYEVENTS_FORMAT_RICH_TEXT 4
+#define HISTORYEVENTS_FORMAT_HTML 8
+
+#define HISTORYEVENTS_FLAG_DEFAULT (1 << 0) // Is a miranda core event type
+#define HISTORYEVENTS_FLAG_SHOW_IM_SRMM (1 << 1) // If this event has to be shown in srmm dialog
+#define HISTORYEVENTS_FLAG_USE_SENT_FLAG (1 << 2) // Means that it can be a sent or received and uses DBEF_SENT to mark that
+#define HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE (1 << 3) // Means that who is drawing this should draw the contact name before the text
+#define HISTORYEVENTS_FLAG_ONLY_LOG_IF_SRMM_OPEN (1 << 4) // If this event will be logged only if the message window is open
+#define HISTORYEVENTS_FLAG_FLASH_MSG_WINDOW (1 << 5) // If this event will trigger the openning/flashing of the message window
+#define HISTORYEVENTS_REGISTERED_IN_ICOLIB (9 << 16) // If the icon is a name already registered in icolib
+#define HISTORYEVENTS_FLAG_KEEP_ONE_YEAR (1 << 8) // By default store in db for 1 year
+#define HISTORYEVENTS_FLAG_KEEP_SIX_MONTHS (2 << 8) // By default store in db for 6 months
+#define HISTORYEVENTS_FLAG_KEEP_ONE_MONTH (3 << 8) // By default store in db for 1 month
+#define HISTORYEVENTS_FLAG_KEEP_ONE_WEEK (4 << 8) // By default store in db for 1 week
+#define HISTORYEVENTS_FLAG_KEEP_ONE_DAY (5 << 8) // By default store in db for 1 day
+#define HISTORYEVENTS_FLAG_KEEP_FOR_SRMM (6 << 8) // By default store in db only enought for message log
+#define HISTORYEVENTS_FLAG_KEEP_MAX_TEN (7 << 8) // By default store in db max 10 entries
+#define HISTORYEVENTS_FLAG_KEEP_MAX_HUNDRED (8 << 8) // By default store in db for 100 entries
+#define HISTORYEVENTS_FLAG_KEEP_DONT (9 << 8) // By default don't store in db (aka ignore it)
+
+
+// This function must be implemented by subscribers. It must return a pointer or NULL
+// to say it can't handle the text
+typedef void * (*fGetHistoryEventText)(HANDLE hContact, HANDLE hDbEvent, DBEVENTINFO *dbe, int format);
+
+typedef struct {
+ int cbSize;
+ char *module;
+ char *name; // Internal event name
+ char *description; // Will be translated. When retrieving it is already translated
+ WORD eventType; // The event type it can handle
+ union {
+ HICON defaultIcon;
+ char * defaultIconName; // if HISTORYEVENTS_REGISTERED_IN_ICOLIB is set. Always use this one when retrieving
+ };
+ int supports; // What kind of return is supported - or of HISTORYEVENTS_FORMAT_*
+ int flags; // or of HISTORYEVENTS_FLAG_*
+ fGetHistoryEventText pfGetHistoryEventText; // NULL to use default get text (similar to message, without extra format)
+
+ // Aditional data if wants to use add to history services
+ char **templates; // Each entry is: "Name\nDefault\n%var%\tDescription\n%var%\tDescription\n%var%\tDescription"
+ int numTemplates;
+
+} HISTORY_EVENT_HANDLER;
+
+
+/*
+Get the number of registered events
+
+wParam: ignored
+lParam: ignored
+Return: The number of events registered with the plugin
+*/
+#define MS_HISTORYEVENTS_GET_COUNT "HistoryEvents/GetCount"
+
+
+/*
+Get an event by number or by type.
+To retrieve by number, pass -1 as type. To retrieve by type, pass -1 as number.
+
+wParam: (int) event number
+lParam: (int) event type
+Return: (const HISTORY_EVENT_HANDLER *) if the event exists, NULL otherwise. Don't change the
+ returned strunc: it is a pointer to the internall struct.
+*/
+#define MS_HISTORYEVENTS_GET_EVENT "HistoryEvents/GetEvent"
+
+
+/*
+Register a plugin that can handle an event type. This must be called during the call to the
+Load function of the plugin. In ModulesLoaded callback all plugins have to be already registered,
+so srmm and history modules can query then.
+
+wParam: HISTORY_EVENT_HANDLER *
+lParam: ignored
+Return: 0 for success
+*/
+#define MS_HISTORYEVENTS_REGISTER "HistoryEvents/Register"
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hDbEvent;
+ DBEVENTINFO *dbe; // Optional
+ int format; // one of HISTORYEVENTS_FORMAT_*
+
+} HISTORY_EVENT_PARAM;
+
+/*
+Check if an event can be handled by any subscribers
+
+wParam: WORD - event type
+lParam: ignored
+Return: BOOL
+*/
+#define MS_HISTORYEVENTS_CAN_HANDLE "HistoryEvents/CanHandle"
+
+/*
+Get the icon for a history event type
+
+wParam: WORD - event type
+lParam: ignored
+Return: HICON - after use free with MS_HISTORYEVENTS_RELEASE_ICON
+*/
+#define MS_HISTORYEVENTS_GET_ICON "HistoryEvents/GetIcon"
+
+/*
+Get the flags for a history event type
+
+wParam: WORD - event type
+lParam: ignored
+Return: int - or of HISTORYEVENTS_FLAG_* or -1 if error
+*/
+#define MS_HISTORYEVENTS_GET_FLAGS "HistoryEvents/GetFlags"
+
+/*
+Release the icon for a history event type. This is really just a forward to icolib
+
+wParam: HICON
+lParam: ignored
+*/
+#define MS_HISTORYEVENTS_RELEASE_ICON "Skin2/Icons/ReleaseIcon"
+
+/*
+Get the text for a history event type
+
+wParam: HISTORY_EVENT_PARAM *
+lParam: ignored
+Return: char * or wchar * depending on sent flags. Free with mir_free or MS_HISTORYEVENTS_RELEASE_TEXT
+*/
+#define MS_HISTORYEVENTS_GET_TEXT "HistoryEvents/GetText"
+
+/*
+Release the text for a history event type. Internally is just a call to mir_free
+
+wParam: char * or wchar *
+lParam: ignored
+*/
+#define MS_HISTORYEVENTS_RELEASE_TEXT "HistoryEvents/ReleaseText"
+
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact;
+ WORD eventType;
+ int templateNum;
+ TCHAR **variables;
+ int numVariables;
+ PBYTE additionalData;
+ int additionalDataSize;
+ int flags; // Flags for the event type
+} HISTORY_EVENT_ADD;
+
+/*
+Add an registered event to the history. This is a helper service
+
+wParam: HISTORY_EVENT_ADD
+lParam: ignored
+Return: HANDLE to the db event
+*/
+#define MS_HISTORYEVENTS_ADD_TO_HISTORY "HistoryEvents/AddToHistory"
+
+/*
+Check if a template is enabled
+
+wParam: event type
+lParam: template num
+Return: TRUE or FALSE
+*/
+#define MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE "HistoryEvents/IsEnabledTemplate"
+
+
+
+// Helper functions //////////////////////////////////////////////////////////////////////////////
+
+
+
+
+static int HistoryEvents_Register(char *module, char *name, char *description, int eventType, HICON defaultIcon,
+ int supports, int flags, fGetHistoryEventText pfGetHistoryEventText)
+{
+ HISTORY_EVENT_HANDLER heh = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_REGISTER))
+ return 1;
+
+ heh.cbSize = sizeof(heh);
+ heh.module = module;
+ heh.name = name;
+ heh.description = description;
+ heh.eventType = eventType;
+ heh.defaultIcon = defaultIcon;
+ heh.supports = supports;
+ heh.flags = flags;
+ heh.pfGetHistoryEventText = pfGetHistoryEventText;
+ return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0);
+}
+
+static int HistoryEvents_RegisterWithTemplates(char *module, char *name, char *description, int eventType, HICON defaultIcon,
+ int supports, int flags, fGetHistoryEventText pfGetHistoryEventText,
+ char **templates, int numTemplates)
+{
+ HISTORY_EVENT_HANDLER heh = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_REGISTER))
+ return 1;
+
+ heh.cbSize = sizeof(heh);
+ heh.module = module;
+ heh.name = name;
+ heh.description = description;
+ heh.eventType = eventType;
+ heh.defaultIcon = defaultIcon;
+ heh.supports = supports;
+ heh.flags = flags;
+ heh.pfGetHistoryEventText = pfGetHistoryEventText;
+ heh.templates = templates;
+ heh.numTemplates = numTemplates;
+ return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0);
+}
+
+static int HistoryEvents_RegisterMessageStyle(char *module, char *name, char *description, int eventType, HICON defaultIcon,
+ int flags, char **templates, int numTemplates)
+{
+ HISTORY_EVENT_HANDLER heh = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_REGISTER))
+ return 1;
+
+ heh.cbSize = sizeof(heh);
+ heh.module = module;
+ heh.name = name;
+ heh.description = description;
+ heh.eventType = eventType;
+ heh.defaultIcon = defaultIcon;
+ heh.flags = flags;
+ heh.templates = templates;
+ heh.numTemplates = numTemplates;
+ return CallService(MS_HISTORYEVENTS_REGISTER, (WPARAM) &heh, 0);
+}
+
+static BOOL HistoryEvents_CanHandle(WORD eventType)
+{
+ if (!ServiceExists(MS_HISTORYEVENTS_CAN_HANDLE))
+ return FALSE;
+
+ return (BOOL) CallService(MS_HISTORYEVENTS_CAN_HANDLE, (WPARAM) eventType, 0);
+}
+
+static HICON HistoryEvents_GetIcon(WORD eventType)
+{
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_ICON))
+ return NULL;
+
+ return (HICON) CallService(MS_HISTORYEVENTS_GET_ICON, (WPARAM) eventType, 0);
+}
+
+static int HistoryEvents_GetFlags(WORD eventType)
+{
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_FLAGS))
+ return -1;
+
+ return (int) CallService(MS_HISTORYEVENTS_GET_FLAGS, (WPARAM) eventType, 0);
+}
+
+static void HistoryEvents_ReleaseIcon(HICON icon)
+{
+ CallService(MS_HISTORYEVENTS_RELEASE_ICON, (WPARAM) icon, 0);
+}
+
+static char * HistoryEvents_GetTextA(HANDLE hDbEvent, DBEVENTINFO *dbe)
+{
+ HISTORY_EVENT_PARAM hep = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT))
+ return NULL;
+
+ hep.cbSize = sizeof(hep);
+ hep.hDbEvent = hDbEvent;
+ hep.dbe = dbe;
+ hep.format = HISTORYEVENTS_FORMAT_CHAR;
+ return (char *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0);
+}
+
+static wchar_t * HistoryEvents_GetTextW(HANDLE hDbEvent, DBEVENTINFO *dbe)
+{
+ HISTORY_EVENT_PARAM hep = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT))
+ return NULL;
+
+ hep.cbSize = sizeof(hep);
+ hep.hDbEvent = hDbEvent;
+ hep.dbe = dbe;
+ hep.format = HISTORYEVENTS_FORMAT_WCHAR;
+ return (wchar_t *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0);
+}
+
+static char * HistoryEvents_GetRichText(HANDLE hDbEvent, DBEVENTINFO *dbe)
+{
+ HISTORY_EVENT_PARAM hep = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_GET_TEXT))
+ return NULL;
+
+ hep.cbSize = sizeof(hep);
+ hep.hDbEvent = hDbEvent;
+ hep.dbe = dbe;
+ hep.format = HISTORYEVENTS_FORMAT_RICH_TEXT;
+ return (char *) CallService(MS_HISTORYEVENTS_GET_TEXT, (WPARAM) &hep, 0);
+}
+
+#define HistoryEvents_ReleaseText mir_free
+//static void HistoryEvents_ReleaseText(void *str)
+//{
+// if (!ServiceExists(MS_HISTORYEVENTS_RELEASE_TEXT))
+// return;
+//
+// CallService(MS_HISTORYEVENTS_RELEASE_TEXT, (WPARAM) str, 0);
+//}
+
+static HANDLE HistoryEvents_AddToHistoryEx(HANDLE hContact, WORD eventType, int templateNum,
+ TCHAR **variables, int numVariables,
+ PBYTE additionalData, int additionalDataSize,
+ int flags)
+{
+ HISTORY_EVENT_ADD hea = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY))
+ return NULL;
+
+ hea.cbSize = sizeof(hea);
+ hea.hContact = hContact;
+ hea.eventType = eventType;
+ hea.templateNum = templateNum;
+ hea.numVariables = numVariables;
+ hea.variables = variables;
+ hea.additionalData = additionalData;
+ hea.additionalDataSize = additionalDataSize;
+ hea.flags = flags;
+
+ return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0);
+}
+
+static HANDLE HistoryEvents_AddToHistoryVars(HANDLE hContact, WORD eventType, int templateNum,
+ TCHAR **variables, int numVariables,
+ int flags)
+{
+ HISTORY_EVENT_ADD hea = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY))
+ return NULL;
+
+ hea.cbSize = sizeof(hea);
+ hea.hContact = hContact;
+ hea.eventType = eventType;
+ hea.templateNum = templateNum;
+ hea.numVariables = numVariables;
+ hea.variables = variables;
+ hea.flags = flags;
+
+ return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0);
+}
+
+static HANDLE HistoryEvents_AddToHistorySimple(HANDLE hContact, WORD eventType, int templateNum, int flags)
+{
+ HISTORY_EVENT_ADD hea = {0};
+
+ if (!ServiceExists(MS_HISTORYEVENTS_ADD_TO_HISTORY))
+ return NULL;
+
+ hea.cbSize = sizeof(hea);
+ hea.hContact = hContact;
+ hea.eventType = eventType;
+ hea.templateNum = templateNum;
+ hea.flags = flags;
+
+ return (HANDLE) CallService(MS_HISTORYEVENTS_ADD_TO_HISTORY, (WPARAM) &hea, 0);
+}
+
+static BOOL HistoryEvents_IsEnabledTemplate(WORD eventType, int templateNum)
+{
+ return (BOOL) CallService(MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE, eventType, templateNum);
+}
+
+#ifdef UNICODE
+# define HistoryEvents_GetTextT HistoryEvents_GetTextW
+#else
+# define HistoryEvents_GetTextT HistoryEvents_GetTextA
+#endif
+
+
+
+#endif // __M_HISTORYEVENTS_H__
diff --git a/plugins/tabsrmm/API/m_ieview.h b/plugins/tabsrmm/API/m_ieview.h new file mode 100644 index 0000000000..e8fa237900 --- /dev/null +++ b/plugins/tabsrmm/API/m_ieview.h @@ -0,0 +1,194 @@ +/*
+
+IEView Plugin for Miranda IM
+Copyright (C) 2005 Piotr Piastucki
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef M_IEVIEW_INCLUDED
+#define M_IEVIEW_INCLUDED
+
+#define MS_IEVIEW_WINDOW "IEVIEW/NewWindow"
+#define MS_IEVIEW_EVENT "IEVIEW/Event"
+#define MS_IEVIEW_NAVIGATE "IEVIEW/Navigate"
+
+#define ME_IEVIEW_OPTIONSCHANGED "IEVIEW/OptionsChanged"
+
+/* IEView window commands */
+#define IEW_CREATE 1 // create new window (control)
+#define IEW_DESTROY 2 // destroy control
+#define IEW_SETPOS 3 // set window position and size
+#define IEW_SCROLLBOTTOM 4 // scroll text to bottom
+
+/* IEView window type/mode */
+#define IEWM_TABSRMM 1 // TabSRMM-compatible HTML builder
+#define IEWM_SCRIVER 3 // Scriver-compatible HTML builder
+#define IEWM_MUCC 4 // MUCC group chats GUI
+#define IEWM_CHAT 5 // chat.dll group chats GUI
+#define IEWM_HISTORY 6 // history viewer
+#define IEWM_BROWSER 256 // empty browser window
+
+typedef struct {
+ int cbSize; // size of the strusture
+ int iType; // one of IEW_* values
+ DWORD dwMode; // compatibility mode - one of IEWM_* values
+ DWORD dwFlags; // flags, one of IEWF_* values
+ HWND parent; // parent window HWND
+ HWND hwnd; // IEW_CREATE returns WebBrowser control's HWND here
+ int x; // IE control horizontal position
+ int y; // IE control vertical position
+ int cx; // IE control horizontal size
+ int cy; // IE control vertical size
+
+} IEVIEWWINDOW;
+
+#define IEEDF_UNICODE 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string
+#define IEEDF_UNICODE_TEXT 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string
+#define IEEDF_UNICODE_NICK 0x00000002 // if set pszNick is a pointer to wchar_t string instead of char string
+#define IEEDF_UNICODE_TEXT2 0x00000004 // if set pszText2 is a pointer to wchar_t string instead of char string
+
+/* The following flags are valid only for message events (IEED_EVENT_MESSAGE) */
+#define IEEDF_FORMAT_FONT 0x00000100 // if set pszFont (font name) is valid and should be used
+#define IEEDF_FORMAT_SIZE 0x00000200 // if set fontSize is valid and should be used
+#define IEEDF_FORMAT_COLOR 0x00000400 // if set color is valid and should be used
+#define IEEDF_FORMAT_STYLE 0x00000800 // if set fontSize is valid and should be used
+
+#define IEEDF_READ 0x00001000 // if set
+#define IEEDF_SENT 0x00002000 // if set
+#define IEEDF_RTL 0x00004000 // if set
+
+#define IEED_EVENT_MESSAGE 0x0001 // message
+#define IEED_EVENT_STATUSCHANGE 0x0002 // status change
+#define IEED_EVENT_FILE 0x0003 // file
+#define IEED_EVENT_URL 0x0004 // url
+#define IEED_EVENT_ERRMSG 0x0005 // error message
+#define IEED_EVENT_SYSTEM 0x0006 // system event
+
+#define IEED_MUCC_EVENT_MESSAGE 0x0001 // message
+#define IEED_MUCC_EVENT_TOPIC 0x0002 // topic change
+#define IEED_MUCC_EVENT_JOINED 0x0003 // user joined
+#define IEED_MUCC_EVENT_LEFT 0x0004 // user left
+#define IEED_MUCC_EVENT_ERROR 0x0005 // error
+
+/* MUCC-related dwData bit flags */
+#define IEEDD_MUCC_SHOW_NICK 0x00000001
+#define IEEDD_MUCC_MSG_ON_NEW_LINE 0x00000002
+#define IEEDD_MUCC_SHOW_DATE 0x00000010
+#define IEEDD_MUCC_SHOW_TIME 0x00000020
+#define IEEDD_MUCC_SECONDS 0x00000040
+#define IEEDD_MUCC_LONG_DATE 0x00000080
+
+#define IEED_GC_EVENT_HIGHLIGHT 0x8000
+#define IEED_GC_EVENT_MESSAGE 0x0001
+#define IEED_GC_EVENT_TOPIC 0x0002
+#define IEED_GC_EVENT_JOIN 0x0003
+#define IEED_GC_EVENT_PART 0x0004
+#define IEED_GC_EVENT_QUIT 0x0006
+#define IEED_GC_EVENT_NICK 0x0007
+#define IEED_GC_EVENT_ACTION 0x0008
+#define IEED_GC_EVENT_KICK 0x0009
+#define IEED_GC_EVENT_NOTICE 0x000A
+#define IEED_GC_EVENT_INFORMATION 0x000B
+#define IEED_GC_EVENT_ADDSTATUS 0x000C
+#define IEED_GC_EVENT_REMOVESTATUS 0x000D
+
+/* GC-related dwData bit flags */
+#define IEEDD_GC_SHOW_NICK 0x00000001
+#define IEEDD_GC_SHOW_TIME 0x00000002
+#define IEEDD_GC_SHOW_ICON 0x00000004
+#define IEEDD_GC_MSG_ON_NEW_LINE 0x00001000
+
+#define IE_FONT_BOLD 0x000100 // Bold font flag
+#define IE_FONT_ITALIC 0x000200 // Italic font flag
+#define IE_FONT_UNDERLINE 0x000400 // Underlined font flags
+
+typedef struct tagIEVIEWEVENTDATA {
+ int cbSize;
+ int iType; // Event type, one of MUCC_EVENT_* values
+ DWORD dwFlags; // Event flags - IEEF_*
+ const char *fontName; // Text font name
+ int fontSize; // Text font size (in pixels)
+ int fontStyle; // Text font style (combination of IE_FONT_* flags)
+ COLORREF color; // Text color
+ union {
+ const TCHAR *ptszNick; // Nick, usage depends on type of event
+ const char *pszNick; // Nick - ANSII
+ const wchar_t *pszNickW; // Nick - Unicode
+ };
+ union {
+ const TCHAR *ptszText; // Text, usage depends on type of event
+ const char *pszText; // Text - ANSII
+ const wchar_t *pszTextW; // Text - Unicode
+ };
+ DWORD dwData; // DWORD data e.g. status see IEEDD_* values
+ BOOL bIsMe; // TRUE if the event is related to the user
+ DWORD time; // Time of the event
+ struct tagIEVIEWEVENTDATA *next;
+ union {
+ const TCHAR *ptszText2; // Text2, usage depends on type of event
+ const char *pszText2; // Text2 - ANSII
+ const wchar_t *pszText2W; // Text2 - Unicode
+ };
+} IEVIEWEVENTDATA;
+
+/* IEView events */
+#define IEE_LOG_DB_EVENTS 1 // log specified number of DB events
+#define IEE_CLEAR_LOG 2 // clear log
+#define IEE_GET_SELECTION 3 // get selected text
+#define IEE_SAVE_DOCUMENT 4 // save current document
+#define IEE_LOG_MEM_EVENTS 5 // log specified number of IEView events
+
+/* IEView event flags */
+#define IEEF_RTL 1 // turn on RTL support
+#define IEEF_NO_UNICODE 2 // disable Unicode support - valid for IEE_LOG_DB_EVENTS and IEE_GET_SELECTION events
+
+#define IEVIEWEVENT_SIZE_V1 28
+#define IEVIEWEVENT_SIZE_V2 32
+#define IEVIEWEVENT_SIZE_V3 36
+
+typedef struct {
+ int cbSize; // size of the strusture
+ int iType; // one of IEE_* values
+ DWORD dwFlags; // one of IEEF_* values
+ HWND hwnd; // HWND returned by IEW_CREATE
+ HANDLE hContact; // contact
+ union {
+ HANDLE hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
+ // the last event actually logged or NULL if no event was logged (IEE_LOG_EVENTS)
+ IEVIEWEVENTDATA *eventData; // the pointer to an array of IEVIEWEVENTDATA objects (IEE_LOG_IEV_EVENTS)
+ };
+ int count; // number of events to log
+ int codepage; // ANSI codepage
+ const char *pszProto; // Name of the protocol
+} IEVIEWEVENT;
+
+#define IEN_NAVIGATE 1 // navigate to the given destination
+#define IENF_UNICODE 1 // if set urlW is used instead of urlW
+
+typedef struct {
+ int cbSize; // size of the strusture
+ int iType; // one of IEN_* values
+ DWORD dwFlags; // one of IEEF_* values
+ HWND hwnd; // HWND returned by IEW_CREATE
+ union {
+ const char *url; // Text, usage depends on type of event
+ const wchar_t *urlW; // Text - Unicode
+ };
+} IEVIEWNAVIGATE;
+
+#endif
+
diff --git a/plugins/tabsrmm/API/m_mathmodule.h b/plugins/tabsrmm/API/m_mathmodule.h new file mode 100644 index 0000000000..6328406bc3 --- /dev/null +++ b/plugins/tabsrmm/API/m_mathmodule.h @@ -0,0 +1,200 @@ +#ifndef M_MATHMODULE_H_
+#define M_MATHMODULE_H_
+//---------------------------------------------------
+
+
+/*
+ **************************
+ * 2 *
+ ** * x + 2 Pi
+ ** ************* + R
+ * Sin(wt)
+ *
+
+ Math-Module
+ **************
+
+ Miranda Plugin by Stephan Kassemeyer
+
+
+ MathModule API - (c) Stephan Kassemeyer
+ 8 May, 2004
+
+*/
+
+
+// ---------
+
+/*
+ Miranda Service-functions defined by MathModule
+ call with the
+ int (*CallService)(const char * servicename,WPARAM,LPARAM)
+ that you get from miranda when Miranda calls the
+ Load(PLUGINLINK * link)
+ of your PlugIn-dll
+ the CallService function then is:
+ link->CallServiceSync(Servicename,wparam,lparam)
+*/
+
+// ---------
+
+#define MATH_RTF_REPLACE_FORMULAE "Math/RtfReplaceFormulae"
+// replace all formulas in a RichEdit with bitmaps.
+// wParam = 0
+// lParam = *TMathRichedit Info
+// return: TRUE if replacement succeeded, FALSE if not (disable by user?).
+typedef struct
+{
+ HWND hwndRichEditControl; // handle of richedit.
+ CHARRANGE* sel; // NULL: replace all.
+ int disableredraw;
+}TMathRicheditInfo;
+// WARNING: !!!
+// Strange things happen if you use this function twice on the same CHARRANGE:
+// if Math-startDelimiter == Math-endDelimiter, there is the following problem:
+// it might be that someone forgot an endDelimiter, this results in a lonesome startdelimiter.
+// if you try to MATH_REPLACE_FORMULAE the second time, startDelimiters and endDelimiters are mixed up.
+// The same problem occours if we have empty formulae, because two succeding delimiters are
+// replaced with a single delimiter.
+
+
+#define MATH_GET_STARTDELIMITER "Math/GetStartDelimiter"
+// returns the delimiter that marks the beginning of a formula
+// wparam=0
+// lparam=0
+// result=*char Delimiter
+// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER
+
+#define MATH_GETENDDELIMITER "Math/GetEndDelimiter"
+// returns the delimiter that marks the end of a formula
+// wparam=0
+// lparam=0
+// result=*char Delimiter
+// !!! the result-buffer must be deleted with MTH_FREE_MATH_BUFFER
+
+#define MTH_FREE_MATH_BUFFER "Math/FreeRTFBitmapText"
+// deletes any buffer that MathModule has created.
+// wparam=0
+// lparam=(*char) buffer
+// result=0
+
+#define MATH_SETBKGCOLOR "Math/SetBackGroundColor"
+// changes the background color of the next formula to be rendered.
+// wparam=0
+// lparam=(COLORREF) color
+// result=0
+
+#define MATH_SET_PARAMS "Math/SetParams"
+// sets a parameter (only integer values) encoded in wparam
+// wparam=paramcode
+// lparam=parametervalue
+// paramcodes:
+#define MATH_PARAM_BKGCOLOR 0 // (COLORREF) std-rgb-color or TRANSPARENT_Color
+#define MATH_PARAM_FONTCOLOR 1 // (COLORREF) std-rgb-color
+#define RESIZE_HWND 2 // (HWND) preview window resizes RESIZE_HWND when it is being resized.
+#define ToolboxEdit_HWND 3 // (HWND) If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox.
+// you can make the BKGCOLOR Transparent (default) by using this color:
+#define TRANSPARENT_Color 0xffffffff -1 // this is default
+
+#define MTH_GETBITMAP "Math/GetBitmap"
+//returns Bitmap that represents the formula given in lparam (string-pointer)
+//this formula has NO Delimiters.
+//wparam=0
+//lparam=(*char)Formula
+//result=(HBITMAP) bitmap
+//!!! the bitmap must be deleted with DeleteObject(hobject)
+
+//example:
+//HBITMAP Bmp=(HBITMAP)CallService(MTH_GETBITMAP,0, (LPARAM)formula);
+
+#define MTH_GET_RTF_BITMAPTEXT "Math/GetRTFBitmapText"
+// returns rich-text stream that includes bitmaps from text given in lparam
+// text included between MATH_GET_STARTDELIMITER and MATH_GETENDDELIMITER
+// hereby is replaced with a rtf-bitmap-stream that represents the corresponding formula
+// wparam=0
+// lparam=*char text
+// result=*char rtfstream
+// !!! the result-buffer must be deleted with MTH_FREE_RTF_BITMAPTEXT
+
+#define MTH_FREE_RTF_BITMAPTEXT "Math/FreeRTFBitmapText"
+// deletes the buffer that MTH_GET_RTF_BITMAPTEXT has created.
+// wparam=0
+// lparam=(*char) buffer
+// result=0
+
+
+// **************************************************************
+// The following is still SRMM - specific.
+// I plan to modify it, so that other PlugIns can take advantage of e.g. preview-window....
+
+#define MTH_SHOW "Math/Show"
+// shows the preview-window
+// wparam=0
+// lparam=0
+// result=0
+
+#define MTH_HIDE "Math/Hide"
+// hides the preview-window
+// wparam=0
+// lparam=0
+// result=0
+
+#define MTH_RESIZE "Math/Resize"
+// sets the size of the preview-window
+// wparam=0
+// lparam=(*TMathWindowInfo)
+// result=0
+typedef struct
+{
+ int top;
+ int left;
+ int right;
+ int bottom;
+} TMathWindowInfo;
+
+#define MTH_SETFORMULA "Math/SetFormula"
+// sets the text that the preview-window should parse to display formulas found inside
+// wparam=0
+// lparam=(*char) text
+// result=0
+
+#define MTH_Set_ToolboxEditHwnd "Math/SetTBhwnd"
+// If this hwnd (of an edit-box) is set, MathModule can insert Formula-elements from the Math-Toolbox.
+// wparam=0
+// lparam=handle
+
+#define MTH_Set_Srmm_HWND "Math/SetSrmmHWND" //übergibt fenster-Handle des aktuellen Message-Dialogs
+// If MathModule knows the handle of a SRMM-based window, following features exist:
+// - preview window resizes Math-Srmm when it is being resized.
+// wparam=0
+// lparam=handle
+// result=0
+
+#define MTH_GET_PREVIEW_HEIGHT "Math/getPreviewHeight"
+// returns the height of the whole preview-window (including system-menu-bar)
+// consider this when maximizing a window to that preview-window is hooked on top or bottom
+// it returns the height no matter whether preview-window is visible or not
+// wparam=0
+// lparam=0
+// result=(int) height
+
+#define MTH_GET_PREVIEW_SHOWN "Math/getPreviewShown"
+// returns 1 if preview window is visible
+// returns 0 if preview window is invisible
+// result=(int) shown
+
+#define MTH_SUBSTITUTE_DELIMITER "Math/SubstituteDelimiter"
+// replaces Substitute given lparam-structure with internal Math-Delimiter
+// wparam=0
+// lparam=(TMathSubstInfo) substInfo
+// result=0
+typedef struct
+{
+ HWND EditHandle;
+ char* Substitute;
+} TMathSubstInfo;
+
+//---------------------------------------------------
+#endif
+//#ifndef M_MATHMODULE_H_
+
diff --git a/plugins/tabsrmm/API/m_metacontacts.h b/plugins/tabsrmm/API/m_metacontacts.h new file mode 100644 index 0000000000..fd85638237 --- /dev/null +++ b/plugins/tabsrmm/API/m_metacontacts.h @@ -0,0 +1,128 @@ +/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright © 2004 Universite Louis PASTEUR, STRASBOURG.
+Copyright © 2004 Scott Ellis (www.scottellis.com.au mail@scottellis.com.au)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#ifndef M_METACONTACTS_H__
+#define M_METACONTACTS_H__ 1
+
+//gets the handle for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the default contact, or null on failure
+#define MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault"
+
+//gets the contact number for the default contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD contact number, or -1 on failure
+#define MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum"
+
+//gets the handle for the 'most online' contact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a handle to the 'most online' contact
+#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
+
+//gets the number of subcontacts for a metacontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns a DWORD representing the number of subcontacts for the given metacontact
+#define MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts"
+
+//gets the handle of a subcontact, using the subcontact's number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns a handle to the specified subcontact
+#define MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact"
+
+//sets the default contact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault"
+
+//sets the default contact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success
+#define MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+//wParam=(HANDLE)hMetaContact
+//lParam=(DWORD)contact number
+//returns 0 on success
+#define MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
+
+//forces the metacontact to send using a specific subcontact, using the subcontact's handle
+//wParam=(HANDLE)hMetaContact
+//lParam=(HANDLE)hSubcontact
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
+
+//'unforces' the metacontact to send using a specific subcontact
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 0 on success (will fail if 'force default' is in effect)
+#define MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
+
+//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+// overrides (and clears) 'force send' above, and will even force use of offline contacts
+// will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+//wParam=(HANDLE)hMetaContact
+//lParam=0
+//returns 1(true) or 0(false) representing new state of 'force default'
+#define MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
+
+// method to get state of 'force' for a metacontact
+// wParam=(HANDLE)hMetaContact
+// lParam= (DWORD)&contact_number or NULL
+//
+// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+// or if none is in force, the value (DWORD)-1 will be copied
+// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
+#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
+
+// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hDefaultContact
+#define ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged"
+
+// fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when
+// contacts are reordered) - a signal to re-read metacontact data
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+
+// fired when a metacontact is forced to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=(HANDLE)hForceContact
+#define ME_MC_FORCESEND "MetaContacts/ForceSend"
+
+// fired when a metacontact is 'unforced' to send using a specific subcontact
+// wParam=(HANDLE)hMetaContact
+// lParam=0
+#define ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
+
+// method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+// wParam=lParam=0
+#define MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName"
+
+#endif
diff --git a/plugins/tabsrmm/API/m_msg_buttonsbar.h b/plugins/tabsrmm/API/m_msg_buttonsbar.h new file mode 100644 index 0000000000..31735f8bd4 --- /dev/null +++ b/plugins/tabsrmm/API/m_msg_buttonsbar.h @@ -0,0 +1,120 @@ +#ifndef M_MSG_BUTTONSBAR_H__
+#define M_MSG_BUTTONSBAR_H__
+
+//////////////////////////////////////////////////////////////////////////
+// Services
+//
+//////////////////////////////////////////////////////////////////////////
+// Adding a button
+//
+// wParam = 0
+// lParam = (BBButton *) &description
+#define MS_BB_ADDBUTTON "TabSRMM/ButtonsBar/AddButton"
+
+//////////////////////////////////////////////////////////////////////////
+// Remove button
+//
+// wParam = 0
+// lParam = (BBButton *) &description, only button ID and ModuleName used
+#define MS_BB_REMOVEBUTTON "TabSRMM/ButtonsBar/RemoveButton"
+
+//////////////////////////////////////////////////////////////////////////
+// ModifyButton(global)
+//
+// wParam = 0
+// lParam = (BBButton *) &description
+#define MS_BB_MODIFYBUTTON "TabSRMM/ButtonsBar/ModifyButton"
+
+
+#define BBSF_HIDDEN (1<<0)
+#define BBSF_DISABLED (1<<1)
+#define BBSF_PUSHED (1<<2)
+#define BBSF_RELEASED (1<<3)
+
+//////////////////////////////////////////////////////////////////////////
+// GetButtonState(local)
+//
+// wParam = hContact
+// lParam = (BBButton *) &description , only ModuleName and ID used
+// Returns BBButton struct with BBSF_ bbbFlags:
+#define MS_BB_GETBUTTONSTATE "TabSRMM/ButtonsBar/GetButtonState"
+
+//////////////////////////////////////////////////////////////////////////
+// SetButtonState (local)
+//
+// wParam = hContact
+// lParam = (BBButton *) &description , ModuleName, ID,hIcon,Tooltip, and BBSF_ bbbFlags are used
+#define MS_BB_SETBUTTONSTATE "TabSRMM/ButtonsBar/SetButtonState"
+
+
+////////////////////////////////////////////////////////////////
+//Events
+//
+///////////////////////////////////////////////////
+// ToolBar loaded event
+// wParam = 0;
+// lParam = 0;
+// This event will be send after module loaded and after each toolbar reset
+// You should add your buttons on this event
+#define ME_MSG_TOOLBARLOADED "TabSRMM/ButtonsBar/ModuleLoaded"
+
+///////////////////////////////////////////////////
+// ButtonClicked event
+// wParam = (HANDLE)hContact;
+// lParam = (CustomButtonClickData *)&CustomButtonClickData;
+// catch to show a popup menu, etc.
+#define ME_MSG_BUTTONPRESSED "TabSRMM/ButtonsBar/ButtonPressed"
+
+
+//event flags
+#define BBCF_RIGHTBUTTON (1<<0)
+#define BBCF_SHIFTPRESSED (1<<1)
+#define BBCF_CONTROLPRESSED (1<<2)
+#define BBCF_ARROWCLICKED (1<<3)
+
+typedef struct {
+ int cbSize;
+ POINT pt; // screen coordinates for menus
+ char* pszModule; // button owners name
+ DWORD dwButtonId; // registered button ID
+ HWND hwndFrom; // button parents HWND
+ HANDLE hContact; //
+ DWORD flags; // BBCF_ flags
+ } CustomButtonClickData;
+
+
+//button flags
+#define BBBF_DISABLED (1<<0)
+#define BBBF_HIDDEN (1<<1)
+#define BBBF_ISPUSHBUTTON (1<<2)
+#define BBBF_ISARROWBUTTON (1<<3)
+#define BBBF_ISCHATBUTTON (1<<4)
+#define BBBF_ISIMBUTTON (1<<5)
+#define BBBF_ISLSIDEBUTTON (1<<6)
+#define BBBF_ISRSIDEBUTTON (1<<7)
+#define BBBF_CANBEHIDDEN (1<<8)
+#define BBBF_ISDUMMYBUTTON (1<<9)
+#define BBBF_ANSITOOLTIP (1<<10)
+
+#define BBBF_CREATEBYID (1<<11) //only for tabsrmm internal use
+
+typedef struct _tagBBButton
+ {
+ int cbSize; // size of structure
+
+ DWORD dwButtonID; // your button ID, will be combined with pszModuleName for storing settings, etc...
+
+ char* pszModuleName; //module name without spaces and underline symbols (e.g. "tabsrmm")
+ union{
+ char* pszTooltip; //button's tooltip
+ TCHAR* ptszTooltip;
+ };
+ DWORD dwDefPos; // default order pos of button, counted from window edge (left or right)
+ // use value >100, because internal buttons using 10,20,30... 80, etc
+ int iButtonWidth; // must be 0
+ DWORD bbbFlags; // combine of BBBF_ flags above
+ HANDLE hIcon; //Handle to icolib registered icon, it's better to register with pszSection = "TabSRMM/Toolbar"
+ }BBButton;
+
+
+#endif //M_MSG_BUTTONSBAR_H__
diff --git a/plugins/tabsrmm/API/m_nudge.h b/plugins/tabsrmm/API/m_nudge.h new file mode 100644 index 0000000000..e87e410508 --- /dev/null +++ b/plugins/tabsrmm/API/m_nudge.h @@ -0,0 +1,5 @@ +#define MS_SHAKE_CLIST "SHAKE/Service/ShakeClist"
+#define MS_SHAKE_CHAT "SHAKE/Service/ShakeChat"
+#define MS_SHAKE_CLIST_TRIGGER "SHAKE/Service/TriggerShakeClist"
+#define MS_SHAKE_CHAT_TRIGGER "SHAKE/Service/TirggerShakeChat"
+#define MS_NUDGE_SEND "NUDGE/Send"
diff --git a/plugins/tabsrmm/API/m_popup2.h b/plugins/tabsrmm/API/m_popup2.h new file mode 100644 index 0000000000..cec5abb395 --- /dev/null +++ b/plugins/tabsrmm/API/m_popup2.h @@ -0,0 +1,457 @@ +/*
+===============================================================================
+ 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_popup2_h__
+#define __m_popup2_h__
+
+#ifndef POPUP_VERSION
+#define POPUP_VERSION 0x02010003
+#endif
+
+#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
+ // Action title text. Please use module name as prefix
+ // (e.g. "Popup Plus/Dismiss Popup") and don't translate
+ // This is translates by popup. So no unicode.
+ 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;
+
+///////////////////////////////////////////////////////////////
+// Few notes about new popup api
+// ------------------------------
+// When you call any ADD service, Popup Plus creates local
+// copy of POPUPDATA2 to store the data. Each time you call
+// CHANGE service this data is updated. You can use the
+// MS_POPUP_GETDATA2 service to retrieve Popups's copy of
+// this data, however you MUST NOT chahge that.
+
+// unicode or ansi mode
+#define PU2_ANSI 0x00
+#define PU2_UNICODE 0x01
+#if defined(UNICODE) || defined(_UNICODE)
+ #define PU2_TCHAR PU2_UNICODE
+#else
+ #define PU2_TCHAR PU2_ANSI
+#endif
+
+#define PU2_CUSTOM_POPUP 0x02
+
+typedef struct
+{
+ // general
+ int cbSize;
+ DWORD flags;
+
+ // miranda bindings
+ HANDLE lchContact;
+ HANDLE lchEvent;
+
+ // style
+ COLORREF colorBack;
+ COLORREF colorText;
+ HICON lchIcon;
+ HBITMAP hbmAvatar;
+ union
+ {
+ char *lpzTitle;
+ WCHAR *lpwzTitle;
+ TCHAR *lptzTitle;
+ };
+ union
+ {
+ char *lpzText;
+ WCHAR *lpwzText;
+ TCHAR *lptzText;
+ };
+ char *lpzSkin;
+
+ // time and timeout
+ int iSeconds;
+ DWORD dwTimestamp;
+
+ // plugin bindings
+ WNDPROC PluginWindowProc;
+ void *PluginData;
+
+ // popup actions
+ int actionCount;
+ POPUPACTION *lpActions;
+
+ HANDLE lchNotification;
+} POPUPDATA2, *LPPOPUPDATA2;
+
+// Creates new popup
+// wParam = (WPARAM)(LPPOPUPDATA2)&ppd2
+// lParam = (LPARAM)(combination of APF_* flags)
+// returns: window handle (if requested) of NULL on success, -1 on failure.
+#define MS_POPUP_ADDPOPUP2 "Popup/AddPopup2"
+
+// Update an popup
+// wParam = (WPARAM)(HWND)hwndPopup
+// lParam = (LPARAM)(LPPOPUPDATA2)&ppd2
+// returns: zero on success, -1 on failure.
+#define MS_POPUP_CHANGEPOPUP2 "Popup/ChangePopup2"
+
+// deprecatet !!! (only for compatibility) use new POPUPDATA2 struct for extended popup
+// Extended popup data V2 (ansi version)
+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".
+ // +2.1.0.3
+ // you *MUST* pass APF_NEWDATA flag for services to take care of this data
+ HANDLE hNotification; // Reserved. Must be NULL
+ int actionCount; // Amount of passed actions
+ LPPOPUPACTION lpActions; // Popup Actions
+ int cbSize; // struct size for future
+} POPUPDATAEX_V2, *LPPOPUPDATAEX_V2;
+
+// deprecatet !!! (only for compatibility) use new POPUPDATA2 struct for extended popup
+// Unicode version of POPUPDATAEX_V2
+typedef struct
+{
+ HANDLE lchContact;
+ HICON lchIcon;
+ union
+ {
+ WCHAR lptzContactName[MAX_CONTACTNAME];
+ WCHAR lpwzContactName[MAX_CONTACTNAME];
+ };
+ union
+ {
+ WCHAR lptzText[MAX_SECONDLINE];
+ WCHAR lpwzText[MAX_SECONDLINE];
+ };
+ COLORREF colorBack;
+ COLORREF colorText;
+ WNDPROC PluginWindowProc;
+ void * PluginData;
+ int iSeconds;
+ // +2.1.0.3
+ // you *MUST* pass APF_NEWDATA flag for services to take care of this data
+ HANDLE hNotification;
+ int actionCount;
+ LPPOPUPACTION lpActions;
+ int cbSize;
+} POPUPDATAW_V2, *LPPOPUPDATAW_V2;
+
+// deprecatet !!! (only for compatibility) use new POPUPDATA2 struct for extended popup
+#if defined(_UNICODE) || defined(UNICODE)
+ typedef POPUPDATAW_V2 POPUPDATAT_V2;
+ typedef LPPOPUPDATAW_V2 LPPOPUPDATAT_V2;
+#else
+ typedef POPUPDATAEX_V2 POPUPDATAT_V2;
+ typedef LPPOPUPDATAEX_V2 LPPOPUPDATAT_V2;
+#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:
+/* core define see miranda\include\m_popup.h
+ 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)
+additional APF_ flags */
+#define APF_NO_HISTORY 0x04 //do not log this popup in popup history (useful for previews)
+#define APF_NO_POPUP 0x08 //do not show popup. this is useful if you want popup yo be stored in history only
+#define APF_NEWDATA 0x10 //deprecatet!! only for use with old POPUPDATAEX_V2/POPUPDATAW_V2 structs
+
+//overload function for POPUPDATAEX_V2/POPUPDATAW_V2
+static INT_PTR __inline PUAddPopUpEx(POPUPDATAEX_V2* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
+}
+
+static INT_PTR __inline PUAddPopUpW(POPUPDATAW_V2* ppdp) {
+ return CallService(MS_POPUP_ADDPOPUPW, (WPARAM)ppdp,0);
+}
+
+static int __inline PUChange(HWND hWndPopUp, POPUPDATAEX_V2 *newData) {
+ return (int)CallService(MS_POPUP_CHANGE, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+#define MS_POPUP_CHANGEW "PopUp/ChangeW"
+static int __inline PUChangeW(HWND hWndPopUp, POPUPDATAW_V2 *newData) {
+ return (int)CallService(MS_POPUP_CHANGEW, (WPARAM)hWndPopUp, (LPARAM)newData);
+}
+
+/* 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
+
+/* core define see miranda\include\m_popup.h
+#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 *) or (POPUPDATAEX_V2 *)data see CPT_DATA2
+#define CPT_DATAW 7 // lParam = (POPUPDATAW *) or (POPUPDATAW_V2 *)data see CPT_DATA2
+additional CPT_ flag*/
+#define CPT_DATA2 8 // lParam = (POPUPDATA2 *)data -- see m_popup2.h for details
+
+/* 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)
+
+/* UM_POPUPMODIFYACTIONICON
+Modify Popup Action Icon
+
+wParam = (WPARAM)(LPPOPUPACTIONID)&actionId
+lParam = (LPARAM)(HICON)hIcon
+*/
+
+typedef struct
+{
+ WPARAM wParam;
+ LPARAM lParam;
+} POPUPACTIONID, *LPPOPUPACTIONID;
+
+#define UM_POPUPMODIFYACTIONICON (WM_USER + 0x0205)
+static int __inline PUModifyActionIcon(HWND hWndPopUp, WPARAM wParam, LPARAM lParam, HICON hIcon) {
+ POPUPACTIONID actionId = { wParam, lParam };
+ return (int)SendMessage(hWndPopUp, UM_POPUPMODIFYACTIONICON, (WPARAM)&actionId, (LPARAM)hIcon);
+}
+
+/* UM_POPUPSHOW
+Show popup at position
+
+wParam = x
+lParam = y
+*/
+#define UM_POPUPSHOW (WM_USER + 0x0206)
+
+/* PopUp/RegisterActions
+Registers your action in popup action list
+
+wParam = (WPARAM)(LPPOPUPACTION)actions
+lParam = (LPARAM)actionCount
+
+Returns: 0 if the popup was shown, -1 in case of failure.
+*/
+#define MS_POPUP_REGISTERACTIONS "PopUp/RegisterActions"
+
+static int __inline PURegisterActions(LPPOPUPACTION actions, int count) {
+ return (int)CallService(MS_POPUP_REGISTERACTIONS, (WPARAM)actions,(LPARAM)count);
+}
+
+/* PopUp/RegisterNotification
+Registers your action in popup action list
+
+wParam = (WPARAM)(LPPOPUPNOTIFICATION)info
+lParam = 0
+
+Returns: handle of registered notification or sero on failure
+*/
+#define MS_POPUP_REGISTERNOTIFICATION "PopUp/RegisterNotification"
+
+#define PNAF_CALLBACK 0x01
+
+#define POPUP_ACTION_NOTHING "Do nothing"
+#define POPUP_ACTION_DISMISS "Dismiss popup"
+
+typedef struct
+{
+ char lpzTitle[64];
+ DWORD dwFlags;
+ union
+ {
+ struct
+ {
+ char lpzLModule[MAXMODULELABELLENGTH];
+ char lpzLSetting[MAXMODULELABELLENGTH];
+ DBVARIANT dbvLData;
+ char lpzRModule[MAXMODULELABELLENGTH];
+ char lpzRSetting[MAXMODULELABELLENGTH];
+ DBVARIANT dbvRData;
+ };
+ struct
+ {
+ DWORD dwCookie;
+ void (*pfnCallback)(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam, DWORD cookie);
+ };
+ };
+} POPUPNOTIFYACTION, *LPPOPUPNOTIFYACTION;
+
+#define PNF_CONTACT 0x01
+
+typedef struct
+{
+ int cbSize;
+ DWORD dwFlags; // set of PNF_* flags
+ char lpzGroup[MAXMODULELABELLENGTH];
+ char lpzName[MAXMODULELABELLENGTH];
+ HICON lchIcon; // this will be registered in icolib
+ COLORREF colorBack; // this will be registered in fontservice
+ COLORREF colorText; // this will be registered in fontservice
+ int iSeconds; // default timeout
+ int actionCount; // for unified action comboboxes
+ LPPOPUPNOTIFYACTION lpActions;
+ char *lpzLAction;
+ char *lpzRAction;
+ char *pszReserved1; // reserved for future use
+ DLGPROC pfnReserved2; // reserved for future use
+} POPUPNOTIFICATION, *LPPOPUPNOTIFICATION;
+
+static HANDLE __inline PURegisterNotification(LPPOPUPNOTIFICATION notification) {
+ return (HANDLE)CallService(MS_POPUP_REGISTERNOTIFICATION, (WPARAM)notification, (LPARAM)0);
+}
+
+/* PopUp/UnhookEventAsync
+Using of "UnhookEvent" inside PluginWindowProc in conjunction with HookEventMessage
+may cause deadlocks. Use this service instead. It will queue event unhook into main
+thread and notify you when everything has finished.
+
+Deadlock scenario:
+ 1. Event is fired with NotifyEventHooks in the main thread
+ 2. Miranda core calls EnterCriticalSection(csHooks) and starts notifications
+ 3. You decide to unhook event, therefore call UnhookEvent
+ 4. Miranda core *INSIDE YOUR THREAD* calls EnterCriticalSection(csHooks) and
+ waits for main thread to finish processing
+ 5. Main thread calls SendMessage(hwnd, ...) to notify your window
+ 6. Your window's thread is busy waiting for main thread to leave critical section
+ 7. deadlock....
+
+wParam = (WPARAM)(HWND)hwndPopup
+lParam = (LPARAM)(HANDLE)hEvent
+
+Returns: 0 if everything gone ok. -1 if service was not found (and unsafe unhook was performed)
+*/
+
+#define MS_POPUP_UNHOOKEVENTASYNC "PopUp/UnhookEventAsync"
+
+/* UM_POPUPUNHOOKCOMPLETE
+Modify Popup Action Icon
+
+wParam = 0
+lParam = (LPARAM)(HANDLE)hEventUnhooked
+*/
+#define UM_POPUPUNHOOKCOMPLETE (WM_USER + 0x0206)
+
+static int __inline PUUnhookEventAsync(HWND hwndPopup, HANDLE hEvent) {
+ if (ServiceExists(MS_POPUP_UNHOOKEVENTASYNC))
+ return (int)CallService(MS_POPUP_UNHOOKEVENTASYNC, (WPARAM)hwndPopup,(LPARAM)hEvent);
+
+ // old popup plugins: unhook service not found
+ UnhookEvent(hEvent);
+ PostMessage(hwndPopup, UM_POPUPUNHOOKCOMPLETE, 0, (LPARAM)hEvent);
+ return 0;
+}
+
+/* PopUp/GetStatus
+Returns 1 when popups are showen and 0 when not
+wParam = 0
+lParam = 0
+*/
+#define MS_POPUP_GETSTATUS "PopUp/GetStatus"
+
+#ifdef __cplusplus
+/* PopUp/RegisterVfx
+Register new animation (fade in/out) effect
+wParam = 0
+lParam = (LPARAM)(char *)vfx_name
+*/
+
+#define MS_POPUP_REGISTERVFX "PopUp/RegisterVfx"
+
+/* PopUp/Vfx/<vfx_name>
+Define this service to create vfx instance
+wParam = 0
+lParam = 0
+return = (int)(IPopupPlusEffect *)vfx
+*/
+
+#define MS_POPUP_CREATEVFX "PopUp/Vfx/"
+
+class IPopupPlusEffect
+{
+public:
+ virtual void beginEffect(int w, int h, int alpha0, int alpha1, int frameCount) = 0;
+ virtual void beginFrame(int frame) = 0;
+ virtual int getPixelAlpha(int x, int y) = 0;
+ virtual void endFrame() = 0;
+ virtual void endEffect() = 0;
+ virtual void destroy() = 0;
+};
+#endif // __cplusplus
+
+
+/* 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.
+
+/* core define see miranda\include\m_popup.h
+#define SM_WARNING 0x01 //Triangle icon.
+#define SM_NOTIFY 0x02 //Exclamation mark icon.
+additional SM_ flags */
+#define SM_ERROR 0x03 //Cross icon.
+#ifndef MS_POPUP_SHOWMESSAGE
+#define MS_POPUP_SHOWMESSAGE "PopUp/ShowMessage"
+#define MS_POPUP_SHOWMESSAGEW "PopUp/ShowMessageW"
+#endif
+
+#endif // __m_popup2_h__
diff --git a/plugins/tabsrmm/API/m_smileyadd.h b/plugins/tabsrmm/API/m_smileyadd.h new file mode 100644 index 0000000000..72c6b52077 --- /dev/null +++ b/plugins/tabsrmm/API/m_smileyadd.h @@ -0,0 +1,252 @@ +/*
+Miranda SmileyAdd Plugin
+Copyright (C) 2005-2008 Boris Krasnovskiy
+Copyright (C) 2003-2004 Rein-Peter de Boer
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <richedit.h>
+
+#define SAFLRE_INSERTEMF 2 // insert smiley as EMF into RichEdit, otherwise bitmap inserted
+ // this flag allows "true" transparency
+#define SAFLRE_OUTGOING 4 // Parsing outgoing message
+#define SAFLRE_NOCUSTOM 8 // Do not use custom smileys
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ HWND hwndRichEditControl; //handle to the rich edit control
+ CHARRANGE* rangeToReplace; //same meaning as for normal Richedit use (NULL = replaceall)
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. SmileyAdd will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL, "Standard" will be used
+ unsigned flags; //Flags (SAFLRE_*) that define the behaivior
+ BOOL disableRedraw; //Parameter have been depricated, have no effect on operation
+ HANDLE hContact; //Contact handle
+} SMADD_RICHEDIT3;
+
+//Replace smileys in a rich edit control...
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_RICHEDIT3*) &smre; //pointer to SMADD_RICHEDIT3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_REPLACESMILEYS "SmileyAdd/ReplaceSmileys"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; //protocol to use... if you have defined a protocol, you can
+ //use your own protocol name. Smiley add will automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ int xPosition; //Postition to place the selectwindow
+ int yPosition; // "
+ int Direction; //Direction (i.e. size upwards/downwards/etc) of the window 0, 1, 2, 3
+
+ HWND hwndTarget; //Window, where to send the message when smiley is selected.
+ UINT targetMessage; //Target message, to be sent.
+ LPARAM targetWParam; //Target WParam to be sent (LParam will be char* to select smiley)
+ //see the example file.
+ HWND hwndParent; //Parent window for smiley dialog
+ HANDLE hContact; //Contact handle
+} SMADD_SHOWSEL3;
+
+//Show smiley selection window
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_SHOWSEL3*) &smre; //pointer to SMADD_SHOWSEL3
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_SHOWSELECTION "SmileyAdd/ShowSmileySelection"
+
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* Protocolname; // " "
+ HICON ButtonIcon; //RETURN VALUE: this is filled with the icon handle
+ //of the smiley that can be used on the button
+ //if used with GETINFO2 handle must be destroyed by user!
+ //NULL if the buttonicon is not defined...
+ int NumberOfVisibleSmileys; //Number of visible smileys defined.
+ int NumberOfSmileys; //Number of total smileys defined
+ HANDLE hContact; //Contact handle
+} SMADD_INFO2;
+
+//get button smiley icon
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_INFO2*) &smgi; //pointer to SMADD_INFO2
+//return: TRUE if API succeeded (all parameters were valid) , FALSE if not.
+#define MS_SMILEYADD_GETINFO2 "SmileyAdd/GetInfo2"
+
+// Event notifies that SmileyAdd options have changed
+// Message dialogs usually need to redraw it's content on reception of this event
+//wParam = Contact handle which options have changed, NULL if global options changed
+//lParam = (LPARAM) 0; not used
+#define ME_SMILEYADD_OPTIONSCHANGED "SmileyAdd/OptionsChanged"
+
+#define SAFL_PATH 1 // provide smiley file path, icon otherwise
+#define SAFL_UNICODE 2 // string fields in OPTIONSDIALOGPAGE are WCHAR*
+#define SAFL_OUTGOING 4 // Parsing outgoing message
+#define SAFL_NOCUSTOM 8 // Do not use custom smileys
+
+#if defined _UNICODE || defined UNICODE
+ #define SAFL_TCHAR SAFL_UNICODE
+#else
+ #define SAFL_TCHAR 0
+#endif
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ const char* Protocolname; //protocol to use... if you have defined a protocol, u can
+ //use your own protocol name. Smiley add wil automatically
+ //select the smileypack that is defined for your protocol.
+ //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //if you prefer those icons.
+ //If not found or NULL: "Standard" will be used
+ union {
+ TCHAR* str; //String to parse
+ char* astr;
+ wchar_t* wstr;
+ };
+ unsigned flag; //One of the SAFL_ flags specifies parsing requirements
+ //This parameter should be filled by the user
+
+ unsigned numSmileys; //Number of Smileys found, this parameter filled by SmileyAdd
+ unsigned oflag; //One of the SAFL_ flags specifies content of the parse results
+ //this parameter filled by SmileyAdd
+ HANDLE hContact; //Contact handle
+} SMADD_BATCHPARSE2;
+
+typedef struct
+{
+ unsigned startChar; //Starting smiley character
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ unsigned size; //Number of characters in smiley (0 if not found)
+ //Because of iterative nature of the API caller should set this
+ //parameter to correct value
+ union {
+ const TCHAR* filepath;
+ const char* afilepath;
+ const wchar_t* wfilepath;
+ HICON hIcon; //User responsible for destroying icon handle
+ };
+} SMADD_BATCHPARSERES;
+
+//find all smileys in text, API parses the provided text and returns all smileys found
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSE2*) &smgp; //pointer to SMADD_BATCHPARSE2
+//function returns pointer to array SMADD_BATCHPARSERES records for each smiley found
+//if no smileys found NULL is returned
+//if non NULL value returned pointer must be freed with MS_SMILEYADD_BATCHFREE API
+#define MS_SMILEYADD_BATCHPARSE "SmileyAdd/BatchParse"
+
+//Free memory allocated by MS_SMILEYADD_BATCHPARSE
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_BATCHPARSERES*) &smgp; //pointer to SMADD_BATCHPARSERES
+#define MS_SMILEYADD_BATCHFREE "SmileyAdd/BatchFree"
+
+typedef struct
+{
+ unsigned cbSize; //size of the structure
+ char* name; //smiley category name for reference
+ char* dispname; //smiley category name for display
+} SMADD_REGCAT;
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_REGCAT*) &smgp; pointer to SMADD_REGCAT
+#define MS_SMILEYADD_REGISTERCATEGORY "SmileyAdd/RegisterCategory"
+
+//Register smiley category
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) Pointer to protocol name or NULL for all;
+#define MS_SMILEYADD_RELOAD "SmileyAdd/Reload"
+
+#ifndef MIID_SMILEY
+// {E03C71B2-6DEE-467e-A4F0-DD516745876A}
+#define MIID_SMILEY { 0xe03c71b2, 0x6dee, 0x467e, { 0xa4, 0xf0, 0xdd, 0x51, 0x67, 0x45, 0x87, 0x6a } }
+#endif
+
+/**
+ NM_FIREVIEWCHANGE is WM_NOTIFY Message for notify parent of host window about smiley are going to be repaint
+
+ The proposed action is next: Owner of RichEdit windows received NM_FIREVIEWCHANGE through WM_NOTIFY
+ twice first time before painting|invalidating (FVCN_PREFIRE) and second time - after (FVCN_POSTFIRE).
+ The Owner window may change any values of received FVCNDATA_NMHDR structure in order to raise needed action.
+ For example it may substitute FVCA_INVALIDATE to FVCA_CUSTOMDRAW event to force painting on self offscreen context.
+
+ It can be:
+ FVCA_CUSTOMDRAW - in this case you need to provide valid HDC to draw on and valid RECT of smiley
+ FVCA_INVALIDATE - to invalidate specified rect of window
+ FVCA_NONE - skip any action. But be aware - animation will be stopped till next repainting of smiley.
+ FVCA_SENDVIEWCHANGE - to notify richedit ole about object changed. Be aware Richedit will fully reconstruct itself
+
+ Another point is moment of received smiley rect - it is only valid if FVCA_DRAW is initially set,
+ and it is PROBABLY valid if FVCA_INVALIDATE is set. And it most probably invalid in case of FVCA_SENDVIEWCHANGE.
+ The smiley position is relative last full paint HDC. Usually it is relative to top-left corner of host
+ richedit (NOT it client area) in windows coordinates.
+
+*/
+
+// Type of Event one of
+#define FVCN_PREFIRE 1
+#define FVCN_POSTFIRE 2
+
+// Action of event are going to be done
+#define FVCA_NONE 0
+#define FVCA_DRAW 1 // do not modify hdc in case of _DRAW, Use _CUSTOMDRAW
+#define FVCA_CUSTOMDRAW 2
+//#define FVCA_INVALIDATE 3 (not supported)
+//#define FVCA_SENDVIEWCHANGE 4 (not supported)
+#define FVCA_SKIPDRAW 5
+
+// Extended NMHDR structure for WM_NOTIFY
+typedef struct
+{
+ //NMHDR structure
+ HWND hwndFrom; // Window of smiley host
+ UINT idFrom; // ignored
+ UINT code; // NM_FIREVIEWCHANGE
+
+ size_t cbSize;
+ BYTE bEvent; // FVCN_ value - pre- or post- painting
+ BYTE bAction; // FVCA_ keys
+ HDC hDC; // Canvas to draw on
+ RECT rcRect; // Valid/should be in case of FVCA_DRAW
+ COLORREF clrBackground; // color to fill background if fTransparent is not set
+ BOOL fTransparent; // if need to fill back color (not supported)
+ LPARAM lParam; // used by host window PreFire and PostFire event
+} FVCNDATA_NMHDR;
+
+// Code of WM_NOTIFY message (code)
+#define NM_FIREVIEWCHANGE NM_FIRST+1;
+
+typedef struct
+{
+ unsigned cbSize; // size of the structure
+ HANDLE hContact;
+ int type; // 0 - directory, 1 - file;
+ TCHAR* path; // smiley category name for reference
+} SMADD_CONT;
+
+//Loads all smileys for the contact
+//wParam = (WPARAM) 0; not used
+//lParam = (LPARAM) (SMADD_CONT*) &dir; // pointer to directory to load smiley from
+#define MS_SMILEYADD_LOADCONTACTSMILEYS "SmileyAdd/LoadContactSmileys"
diff --git a/plugins/tabsrmm/API/m_spellchecker.h b/plugins/tabsrmm/API/m_spellchecker.h new file mode 100644 index 0000000000..b09f146b0d --- /dev/null +++ b/plugins/tabsrmm/API/m_spellchecker.h @@ -0,0 +1,72 @@ +/*
+Copyright (C) 2006 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __M_SPELLCHECKER_H__
+# define __M_SPELLCHECKER_H__
+
+
+typedef struct {
+ int cbSize;
+ HANDLE hContact; // The contact to get the settings from, or NULL
+ HWND hwnd; // The hwnd of the richedit
+ char *window_name; // A name for this richedit
+} SPELLCHECKER_ITEM;
+
+typedef struct {
+ int cbSize;
+ HWND hwnd; // The hwnd of the richedit
+ HMENU hMenu; // The handle to the menu
+ POINT pt; // The point, in screen coords
+} SPELLCHECKER_POPUPMENU;
+
+
+/*
+Adds a richedit control for the spell checker to check
+
+wParam: SPELLCHECKER_ITEM *
+lParam: ignored
+return: 0 on success
+*/
+#define MS_SPELLCHECKER_ADD_RICHEDIT "SpellChecker/AddRichedit"
+
+
+/*
+Removes a richedit control for the spell checker to check
+
+wParam: HWND
+lParam: ignored
+return: 0 on success
+*/
+#define MS_SPELLCHECKER_REMOVE_RICHEDIT "SpellChecker/RemoveRichedit"
+
+
+/*
+Show context menu
+
+wParam: SPELLCHECKER_POPUPMENU
+lParam: ignored
+return: the control id selected by the user, 0 if no one was selected, < 0 on error
+*/
+#define MS_SPELLCHECKER_SHOW_POPUP_MENU "SpellChecker/ShowPopupMenu"
+
+
+
+
+#endif // __M_SPELLCHECKER_H__
diff --git a/plugins/tabsrmm/API/m_updater.h b/plugins/tabsrmm/API/m_updater.h new file mode 100644 index 0000000000..488d3722ce --- /dev/null +++ b/plugins/tabsrmm/API/m_updater.h @@ -0,0 +1,150 @@ +#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
|