From c2d827972a16f1710406d15e58304aecc4e1c9b5 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 23 May 2012 05:53:27 +0000 Subject: moved some api headers git-svn-id: http://svn.miranda-ng.org/main/trunk@139 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/INCLUDE/m_cln_skinedit.h | 174 ------ plugins/ExternalAPI/m_cln_skinedit.h | 69 ++- plugins/ExternalAPI/m_ircscript.h | 129 ++++ plugins/ExternalAPI/m_libJSON.h | 678 +++++++++++++++++++++ plugins/ExternalAPI/m_listeningto.h | 36 +- plugins/ExternalAPI/m_simpleaway.h | 59 +- plugins/ListeningTo/m_listeningto.h | 88 --- plugins/Mwclist/m_fontservice.h | 30 - plugins/Mwclist/m_mwclc.h | 27 - plugins/Quotes/m_Quotes.h | 35 -- plugins/Scriver/m_historyevents.h | 847 --------------------------- plugins/SimpleStatusMsg/m_simpleaway.h | 103 ---- plugins/SpellChecker/m_spellchecker.h | 77 --- plugins/json/m_libJSON.h | 678 --------------------- protocols/IRCG/m_ircscript.h | 129 ---- 15 files changed, 915 insertions(+), 2244 deletions(-) delete mode 100644 plugins/Clist_nicer/INCLUDE/m_cln_skinedit.h create mode 100644 plugins/ExternalAPI/m_ircscript.h create mode 100644 plugins/ExternalAPI/m_libJSON.h delete mode 100644 plugins/ListeningTo/m_listeningto.h delete mode 100644 plugins/Mwclist/m_fontservice.h delete mode 100644 plugins/Mwclist/m_mwclc.h delete mode 100644 plugins/Quotes/m_Quotes.h delete mode 100644 plugins/Scriver/m_historyevents.h delete mode 100644 plugins/SimpleStatusMsg/m_simpleaway.h delete mode 100644 plugins/SpellChecker/m_spellchecker.h delete mode 100644 plugins/json/m_libJSON.h delete mode 100644 protocols/IRCG/m_ircscript.h diff --git a/plugins/Clist_nicer/INCLUDE/m_cln_skinedit.h b/plugins/Clist_nicer/INCLUDE/m_cln_skinedit.h deleted file mode 100644 index a1e69bb6e1..0000000000 --- a/plugins/Clist_nicer/INCLUDE/m_cln_skinedit.h +++ /dev/null @@ -1,174 +0,0 @@ - -/* - * services - */ - -#define MS_CLNSE_INVOKE "CLN_Skinedit/Invoke" -#define MS_CLNSE_FILLBYCURRENTSEL "CLN_Skinedit/FillByCurrentSel" - -/* - * data structs - */ - -typedef struct _tagImageItem { - char szName[40]; - HBITMAP hbm; - BYTE bLeft, bRight, bTop, bBottom; // sizing margins - BYTE alpha; - DWORD dwFlags; - HDC hdc; - HBITMAP hbmOld; - LONG inner_height, inner_width; - LONG width, height; - BLENDFUNCTION bf; - BYTE bStretch; - HBRUSH fillBrush; - LONG glyphMetrics[4]; - struct _tagImageItem *nextItem; -} ImageItem; - -typedef struct _tagButtonItem { - char szName[40]; - HWND hWnd; - LONG xOff, yOff; - LONG width, height; - ImageItem *imgNormal, *imgPressed, *imgHover; - LONG normalGlyphMetrics[4]; - LONG hoverGlyphMetrics[4]; - LONG 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)(struct _tagButtonItem *item, HWND hwndDlg, struct MessageWindowData *dat, HWND hwndItem); - void (*pfnCallback)(struct _tagButtonItem *item, HWND hwndDlg, struct MessageWindowData *dat, HWND hwndItem); - TCHAR tszLabel[40]; - struct _tagButtonItem *nextItem; -} ButtonItem; - -typedef struct _tagButtonSet { - ButtonItem *items; - LONG left, top, right, bottom; // client area offsets, calculated from button layout -} ButtonSet; - -typedef struct { - char 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; - ImageItem *imageItem; -} StatusItems_t; - -typedef struct { - BOOL bGRADIENT; - BOOL bCORNER; - BOOL bCOLOR; - BOOL bCOLOR2; - BOOL bCOLOR2_TRANSPARENT; - BOOL bTEXTCOLOR; - BOOL bALPHA; - BOOL bMARGIN_LEFT; - BOOL bMARGIN_TOP; - BOOL bMARGIN_RIGHT; - BOOL bMARGIN_BOTTOM; - BOOL bIGNORED; - BOOL bBORDERSTYLE; -} ChangedSItems_t; - -typedef struct _tagSkinDescription { - DWORD cbSize; - StatusItems_t *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 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/ExternalAPI/m_cln_skinedit.h b/plugins/ExternalAPI/m_cln_skinedit.h index 5ee66829c5..a1e69bb6e1 100644 --- a/plugins/ExternalAPI/m_cln_skinedit.h +++ b/plugins/ExternalAPI/m_cln_skinedit.h @@ -10,18 +10,32 @@ * data structs */ -struct TWindowData; -class CImageItem; - -struct ButtonItem { - TCHAR szName[40]; +typedef struct _tagImageItem { + char szName[40]; + HBITMAP hbm; + BYTE bLeft, bRight, bTop, bBottom; // sizing margins + BYTE alpha; + DWORD dwFlags; + HDC hdc; + HBITMAP hbmOld; + LONG inner_height, inner_width; + LONG width, height; + BLENDFUNCTION bf; + BYTE bStretch; + HBRUSH fillBrush; + LONG glyphMetrics[4]; + struct _tagImageItem *nextItem; +} ImageItem; + +typedef struct _tagButtonItem { + char 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]; + ImageItem *imgNormal, *imgPressed, *imgHover; + LONG normalGlyphMetrics[4]; + LONG hoverGlyphMetrics[4]; + LONG pressedGlyphMetrics[4]; DWORD dwFlags, dwStockFlags; DWORD uId; TCHAR szTip[256]; @@ -29,21 +43,19 @@ struct ButtonItem { 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); + void (*pfnAction)(struct _tagButtonItem *item, HWND hwndDlg, struct MessageWindowData *dat, HWND hwndItem); + void (*pfnCallback)(struct _tagButtonItem *item, HWND hwndDlg, struct MessageWindowData *dat, HWND hwndItem); TCHAR tszLabel[40]; - ButtonItem* nextItem; - HANDLE hContact; - TWindowData *dat; -}; + struct _tagButtonItem *nextItem; +} ButtonItem; typedef struct _tagButtonSet { ButtonItem *items; LONG left, top, right, bottom; // client area offsets, calculated from button layout } ButtonSet; -struct CSkinItem { - TCHAR szName[40]; +typedef struct { + char szName[40]; char szDBname[40]; int statusID; @@ -65,12 +77,28 @@ struct CSkinItem { int MARGIN_BOTTOM; BYTE IGNORED; DWORD BORDERSTYLE; - CImageItem *imageItem; -}; + ImageItem *imageItem; +} StatusItems_t; + +typedef struct { + BOOL bGRADIENT; + BOOL bCORNER; + BOOL bCOLOR; + BOOL bCOLOR2; + BOOL bCOLOR2_TRANSPARENT; + BOOL bTEXTCOLOR; + BOOL bALPHA; + BOOL bMARGIN_LEFT; + BOOL bMARGIN_TOP; + BOOL bMARGIN_RIGHT; + BOOL bMARGIN_BOTTOM; + BOOL bIGNORED; + BOOL bBORDERSTYLE; +} ChangedSItems_t; typedef struct _tagSkinDescription { DWORD cbSize; - CSkinItem *StatusItems; + StatusItems_t *StatusItems; int lastItem; int firstItem; char szModule[100]; @@ -96,7 +124,6 @@ typedef struct _tagSkinDescription { #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 diff --git a/plugins/ExternalAPI/m_ircscript.h b/plugins/ExternalAPI/m_ircscript.h new file mode 100644 index 0000000000..ddab3b96bb --- /dev/null +++ b/plugins/ExternalAPI/m_ircscript.h @@ -0,0 +1,129 @@ + +/* + This file is a description of the interface between the Miranda Scripting + Plugin (MSP) and IRC. It is mainly an internal draft. + + The MSP is a powerful PHP based scripting engine + which can automate many tasks in Miranda IM. With the implementation of + this interface IRC can also benefit from the advantages MSP brings. The + interface has been constructed by the respective authors of IRC and MSP. + + The idea is that MSP and IRC should communicate via the interface outlined herein, + but MSP should "package" the data in attractive functions that can be easily + used by eager scripters. + + Note that m_chat.h should be #included as the events defined therein is used in this interface + + The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are + illustrated by the following matrix (MSP has 4 services and IRC 4 services): + + + -------------------------------------------------- + | | | + | Incoming raw data | Data going | + | from server | to GUI | + | (before processing) | (after processing) | + | | | + -------------------------------------------------- + | | | + | Outgoing raw data | Data going | + | to server | from GUI | + | (after processing) | (before processing) | + | | | + -------------------------------------------------- + + (processing refers to the IRC plugin reacting to different commands) + +*/ + + +//------------------------- HANDLING RAW MESSAGES ------------------------ +/* + + The two leftmost boxes are related to data sent to and from the server in RAW form. + (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS") + + It is very useful for scripters to be able to manipulate and add RAW streams of data. + + The below structure is used when RAW data is generated and IRC must trigger an + event in MSP so the scripts can do their magic. + + If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to + allocate from the same heap. Do not free the data. + + wParam= Module name + lParam= (LPARAM)( char* )pszRaw + returns nonzero if the message should be dropped +*/ + +/* + NOTE! IRC will implement two services which also uses the same parameters: + + "/InsertRawIn" //used for inserting a "fake" incoming RAW event + "/InsertRawOut" //used for inserting a "fake" outgoing RAW event + +*/ + + +#define MS_MBOT_IRC_RAW_IN "MBot/IrcRawIn" +#define MS_MBOT_IRC_RAW_OUT "MBot/IrcRawOut" + + +//------------------------- HANDLING GUI MESSAGES 1 ------------------------ +/* + + The top rightmost box is related to data sent to the gui + (currently chat.dll) in the form of GCEVENT's. (see m_chat.h) + + While maybe not as useful to the scripter, it can be useful to be able to + "tap into" messages to the GUI from the IRC plugin. + + If the data is modified make sure to realloc() or similar. + + wParam= (WPARAM) (WPARAM_GUI_IN) &wgi + lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h + returns nonzero if the message should be dropped +*/ + +/* + NOTE! IRC will implement a service which also uses the same parameters: + + "/InsertGuiIn" //used for inserting a "fake" event to the GUI + +*/ +typedef struct MBOT_GUI_WPARAM_IN_STRUCT +{ + const char* pszModule; + WPARAM wParam; +}WPARAM_GUI_IN; + +#define MS_MBOT_IRC_GUI_IN "MBot/IrcGuiIn" + + +//------------------------- HANDLING GUI MESSAGES 2 ------------------------ +/* + + The bottom rightmost box is related to data sent from the gui + (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook, + but for MSP this is done via a service instead. + + It can be useful for scripters to simulate user actions, like entering text, closing the window etc + + If the data is modified make sure to realloc() or similar. + + wParam= Module name + lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h + returns nonzero if the message should be dropped +*/ + +/* + NOTE! IRC will implement a service which also uses the same parameters: + + "/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI + +*/ + +#define MS_MBOT_IRC_GUI_OUT "MBot/IrcGuiOut" + +#define MS_MBOT_REGISTERIRC "MBot/RegisterIRCModule" + diff --git a/plugins/ExternalAPI/m_libJSON.h b/plugins/ExternalAPI/m_libJSON.h new file mode 100644 index 0000000000..6c9597a496 --- /dev/null +++ b/plugins/ExternalAPI/m_libJSON.h @@ -0,0 +1,678 @@ +#ifndef MIM_LIBJSON_H +#define MIM_LIBJSON_H + +#define IsJSONServiceAvailable() (ServiceExists(MS_JSON_FREE)) +#define json_getJSI(a) CallService(MS_JSON_GETINTERFACE,(WPARAM)a,0) + +#ifndef LIBJSON_H + #define JSONNODE void //so that JSONNODE* is void* + typedef JSONNODE** JSONNODE_ITERATOR; +#endif + +// This function get the service interface for direct calling +// wParam=(WPARAM)(LPJSONSERVICEINTERFACE) +// lParam=0 +// Return value ALWAYS 0 + +typedef struct { + /* + stuff that's in namespace libJSON + */ + void (*free)(void * str); + void (*delete_)(JSONNODE * node); + // #ifdef JSON_MEMORY_MANAGE + void (*free_all)(void); + void (*delete_all)(void); + // #endif + JSONNODE * (*parse)(const char * json); + char * (*strip_white_space)(const char * json); + // #ifdef JSON_VALIDATE + JSONNODE * (*validate)(const char * json); + // #endif + + /* + stuff that's in class JSONNode + */ + //ctors + JSONNODE * (*new_a)(const char * name, const char * value); + JSONNODE * (*new_i)(const char * name, long value); + JSONNODE * (*new_f)(const char * name, double value); + JSONNODE * (*new_b)(const char * name, int value); //because C bools are ints and C++ will implicitly cast it + JSONNODE * (*new_)(char type); + JSONNODE * (*copy)(const JSONNODE * orig); + JSONNODE * (*duplicate)(const JSONNODE * orig); + + //assignment + void (*set_a)(JSONNODE * node, const char * value); + void (*set_i)(JSONNODE * node, long value); + void (*set_f)(JSONNODE * node, double value); + void (*set_b)(JSONNODE * node, int value); //because C bools are ints ane C++ will implicit + void (*set_n)(JSONNODE * node, const JSONNODE * orig); + + //inspectors + char (*type)(const JSONNODE * node); + unsigned int (*size)(const JSONNODE * node); + int (*empty)(const JSONNODE * node); + char * (*name)(const JSONNODE * node); + // #ifdef JSON_COMMENTS + char * (*get_comment)(const JSONNODE * node); + // #endif + char * (*as_string)(const JSONNODE * node); + long (*as_int)(const JSONNODE * node); + double (*as_float)(const JSONNODE * node); + int (*as_bool)(const JSONNODE * node); + JSONNODE * (*as_node)(const JSONNODE * node); + JSONNODE * (*as_array)(const JSONNODE * node); + // #ifdef JSON_BINARY + void * (*as_binary)(const JSONNODE * node, unsigned long * size); + // #endif + // #ifdef JSON_WRITER + char * (*write)(const JSONNODE * node); + char * (*write_formatted)(const JSONNODE * node); + // #endif + + //modifiers + void (*set_name)(JSONNODE * node, const char * name); + // #ifdef JSON_COMMENTS + void (*set_comment)(JSONNODE * node, const char * comment); + // #endif + void (*clear)(JSONNODE * node); + void (*nullify)(JSONNODE * node); + void (*swap)(JSONNODE * node, JSONNODE * node2); + void (*merge)(JSONNODE * node, JSONNODE * node2); + // #ifndef JSON_PREPARSE + void (*preparse)(JSONNODE * node); + // #endif + // #ifdef JSON_BINARY + void (*set_binary)(JSONNODE * node, const void * data, unsigned long length); + // #endif + void (*cast)(JSONNODE * node, char type); + + //children access + void (*reserve)(JSONNODE * node, unsigned int siz); + JSONNODE * (*at)(JSONNODE * node, unsigned int pos); + JSONNODE * (*get)(JSONNODE * node, const char * name); + // #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS + JSONNODE * (*get_nocase)(JSONNODE * node, const char * name); + JSONNODE * (*pop_back_nocase)(JSONNODE * node, const char * name); + // #endif + void (*push_back)(JSONNODE * node, JSONNODE * node2); + JSONNODE * (*pop_back_at)(JSONNODE * node, unsigned int pos); + JSONNODE * (*pop_back)(JSONNODE * node, const char * name); + // #ifdef JSON_ITERATORS + JSONNODE_ITERATOR (*find)(JSONNODE * node, const char * name); + // #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS + JSONNODE_ITERATOR (*find_nocase)(JSONNODE * node, const char * name); + // #endif + JSONNODE_ITERATOR (*erase)(JSONNODE * node, JSONNODE_ITERATOR it); + JSONNODE_ITERATOR (*erase_multi)(JSONNODE * node, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); + JSONNODE_ITERATOR (*insert)(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE * node2); + JSONNODE_ITERATOR (*insert_multi)(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); + + //iterator functions + JSONNODE_ITERATOR (*begin)(JSONNODE * node); + JSONNODE_ITERATOR (*end)(JSONNODE * node); + // #endif + + //comparison + int (*equal)(JSONNODE * node, JSONNODE * node2); +} JSONSERVICEINTERFACE, *PJSONSERVICEINTERFACE, *LPJSONSERVICEINTERFACE; + +extern JSONSERVICEINTERFACE jsi; + +#ifndef LIBJSON_H +#define json_free(a) jsi.free(a) +#define json_delete(a) jsi.delete_(a) +// #ifdef JSON_MEMORY_MANAGE +#define json_free_all() jsi.free_all() +#define json_delete_all() jsi.delete_all() +// #endif +#define json_parse(a) jsi.parse(a) +#define json_strip_white_space(a) jsi.strip_white_space(a) +// #ifdef JSON_VALIDATE +#define json_validate(a) jsi.validate(a) +// #endif +#define json_new_a(a,b) jsi.new_a(a,b) +#define json_new_i(a,b) jsi.new_i(a,b) +#define json_new_f(a,b) jsi.new_f(a,b) +#define json_new_b(a,b) jsi.new_b(a,b) +#define json_new(a) jsi.new_(a) +#define json_copy(a) jsi.copy(a) +#define json_duplicate(a) jsi.duplicate(a) +#define json_set_a(a,b) jsi.set_a(a,b) +#define json_set_i(a,b) jsi.set_i(a,b) +#define json_set_f(a,b) jsi.set_f(a,b) +#define json_set_b(a,b) jsi.set_b(a,b) +#define json_set_n(a,b) jsi.set_n(a,b) +#define json_type(a) jsi.type(a) +#define json_size(a) jsi.size(a) +#define json_empty(a) jsi.empty(a) +#define json_name(a) jsi.name(a) +// #ifdef JSON_COMMENTS +#define json_get_comment(a) jsi.get_comment(a) +// #endif +#define json_as_string(a) jsi.as_string(a) +#define json_as_int(a) jsi.as_int(a) +#define json_as_float(a) jsi.as_float(a) +#define json_as_bool(a) jsi.as_bool(a) +#define json_as_node(a) jsi.as_node(a) +#define json_as_array(a) jsi.as_array(a) +// #ifdef JSON_BINARY +#define json_as_binary(a,b) jsi.as_binary(a,b) +// #endif +// #ifdef JSON_WRITER +#define json_write(a) jsi.write(a) +#define json_write_formatted(a) jsi.write_formatted(a) +// #endif +#define json_set_name(a,b) jsi.set_name(a,b) +// #ifdef JSON_COMMENTS +#define json_set_comment(a,b) jsi.set_comment(a,b) +// #endif +#define json_clear(a) jsi.clear(a) +#define json_nullify(a) jsi.nullify(a) +#define json_swap(a,b) jsi.swap(a,b) +#define json_merge(a,b) jsi.merge(a,b) +// #ifndef JSON_PREPARSE +#define json_preparse(a) jsi.preparse(a) +// #endif +// #ifdef JSON_BINARY +#define json_set_binary(a,b,c) jsi.set_binary(a,b,c) +// #endif +#define json_cast(a,b) jsi.cast(a,b) +#define json_reserve(a,b) jsi.reserve(a,b) +#define json_at(a,b) jsi.at(a,b) +#define json_get(a,b) jsi.get(a,b) +// #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS +#define json_get_nocase(a,b) jsi.get_nocase(a,b) +#define json_pop_back_nocase(a,b) jsi.pop_back_nocase(a,b) +// #endif +#define json_push_back(a,b) jsi.push_back(a,b) +#define json_pop_back_at(a,b) jsi.pop_back_at(a,b) +#define json_pop_back(a,b) jsi.pop_back(a,b) +// #ifdef JSON_ITERATORS +#define json_find(a,b) jsi.find(a,b) +// #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS +#define json_find_nocase(a,b) jsi.find_nocase(a,b) +// #endif +#define json_erase(a,b) jsi.erase(a,b) +#define json_erase_multi(a,b,c) jsi.erase_multi(a,b,c) +#define json_insert(a,b,c) jsi.insert(a,b,c) +#define json_insert_multi(a,b,c,d) jsi.insert_multi(a,b,c,d) +#define json_begin(a) jsi.begin(a) +#define json_end(a) jsi.end(a) +#define json_equal(a,b) jsi.equal(a,b) +#endif + +#define MS_JSON_GETINTERFACE "JSON/GetInterface" + +// This function removes the memory allocated by various functions that return strings, +// such as MS_JSON_AS_*, json_write... +// wParam=(WPARAM)(LPVOID)pVoid +// lParam=0 +// Return value ALWAYS 0 +#define MS_JSON_FREE "JSON/Free" + +// Delete specified node and all its children +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Return value ALWAYS 0 +#define MS_JSON_DELETE "JSON/Delete" + +// + +// This function parses JSON text and returns you a HANDLE which is the root node of the text +// that you just passed it. If bad JSON is sent to this method it may return NULL. +// wParam=(WPARAM)(LPCSTR)szJSON +// lParam=0 +// Returns a HANDLE on success, NULL on failure +// * Remember to free the handle with MS_JSON_DELETE +#define MS_JSON_PARSE "JSON/Parse" + +// This function removes anything that the JSON standard defines as white space, +// including extra tabs, spaces, formatting, and comments. This makes this function useful +// for compressing json that needs to be stored or sent over a network. +// wParam=(WPARAM)(LPCSTR)szJSON +// lParam=0 +// Returns a newly allocated valid JSON that is free of all white space +// * Remember to free the string with MS_JSON_FREE +#define MS_JSON_STRIP_WHITE_SPACE "JSON/StripWhiteSpace" + + +// + +// This function creates a string node with the name and value specified. +// wParam=(WPARAM)(LPCSTR)szName +// lParam=(LPARAM)(LPCSTR)szValue +// Returns a newly allocated node +// You must (*delete the resulting node or attach it to something as a child. +#define MS_JSON_NEW_STRING "JSON/NewA" + +// This function creates a integer node with the name and value specified. +// wParam=(WPARAM)(LPCSTR)szName +// lParam=(LPARAM)(long)lValue +// Returns a newly allocated node +// You must (*delete the resulting node or attach it to something as a child. +// Warning: The value IS SIGNED, for unsigned use MS_JSON_NEW_FLOAT instead. +#define MS_JSON_NEW_INTEGER "JSON/NewI" + +// This function creates a floating point node with the name and value specified. +// wParam=(WPARAM)(LPCSTR)szName +// lParam=(LPARAM)(float)fValue +// Returns a newly allocated node +// You must (*delete the resulting node or attach it to something as a child. +#define MS_JSON_NEW_FLOAT "JSON/NewF" + +// This function creates a boolean node with the name and value specified. +// wParam=(WPARAM)(LPCSTR)szName +// lParam=(LPARAM)(int)iValue +// Returns a newly allocated node +// You must (*delete the resulting node or attach it to something as a child. +#define MS_JSON_NEW_BOOLEAN "JSON/NewB" + +// This function creates an empty node of the specified type. +// This would normally be used to start serializing something or writing a configuration file. +// wParam=(WPARAM)(char)cType +// lParam=0 +// Returns a newly allocated node +// You must (*delete the resulting node or attach it to something as a child. +#define JSON_NULL '\0' +#define JSON_STRING '\1' +#define JSON_NUMBER '\2' +#define JSON_BOOL '\3' +#define JSON_ARRAY '\4' +#define JSON_NODE '\5' + +#define MS_JSON_NEW "JSON/New" + +// This function copies a JSONNODE and returns the new copy. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns an exact copy of the node parameter +#define MS_JSON_COPY "JSON/Copy" + +// Constructs a JSONNODE object, by copying the contents of JSONNODE. +// This is different from the MS_JSON_COPY because it makes a literal copy, +// not reference counting. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a HANDLE that is a new copy of the original node. +#define MS_JSON_DUPLICATE "JSON/Duplicate" + +// Sets the string value of the JSONNODE. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(LPCSTR)szValue +// Return value ALWAYS 0 +#define MS_JSON_SET_STRING "JSON/SetA" + +// Sets the integer value of the JSONNODE. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(long)lValue +// Return value ALWAYS 0 +// Warning: The value IS SIGNED, for unsigned use MS_JSON_SET_FLOAT instead. +#define MS_JSON_SET_INTEGER "JSON/SetI" + +// Sets the floating point value of the JSONNODE. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(float)fValue +// Return value ALWAYS 0 +#define MS_JSON_SET_FLOAT "JSON/SetF" + +// Sets the boolean value of the JSONNODE. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(int)iValue +// Return value ALWAYS 0 +#define MS_JSON_SET_BOOLEAN "JSON/SetB" + +// Sets the value of the JSONNODE to the value of the other, +// usually through fast and simple reference counting. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(HANDLE)hValueNode +// Return value ALWAYS 0 +#define MS_JSON_SET_NODE "JSON/SetN" + +// Returns the type of the JSONNODE. +// usually through fast and simple reference counting. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns value of JSON_* (See MS_JSON_NEW) +#define MS_JSON_TYPE "JSON/Type" + +// Returns the number of children that the node has. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns the number of children +// This should be zero for anything other than JSON_ARRAY or JSON_NODE, +// but this is only guaranteed with the JSON_SAFE option turned on (by default). +// This is because casting may or may not purge the children. +#define MS_JSON_SIZE "JSON/Size" + +// Returns whether or not the node has any children. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns 0 if the node is empty, nonzero if not +// If the node is not of JSON_NODE or JSON_ARRAY it will invariably return true. +#define MS_JSON_EMPTY "JSON/Empty" + +// Returns the name of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a newly allocated string. +// If there is no name, then it returns a blank string. +#define MS_JSON_NAME "JSON/Name" + +// + +// Returns the string representation of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a newly allocated string representation of the node. +// The return value may be different depending on the type of the node +// JSON_NULL: "" or "null" depending on how it was created +// JSON_STRING: The unescaped string value +// JSON_NUMBER: The number in string form (may be in scientific notation) +// JSON_BOOL: "true" or "false" +// JSON_ARRAY: "" +// JSON_NODE: "" +#define MS_JSON_AS_STRING "JSON/AsString" + +// Returns the integer representation of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns the integer representation of the node. +// The return value may be different depending on the type of the node +// JSON_NULL: 0 +// JSON_STRING: Undefined +// JSON_NUMBER: Truncated Value +// JSON_BOOL: 1 if true, 0 if false +// JSON_ARRAY: Undefined +// JSON_NODE: Undefined +// Warning: The value IS SIGNED, for unsigned use MS_JSON_AS_FLOAT instead. +// If the value is actually a floating point value, it will continue on ahead +// and simply truncate the value. So 15.9 will be returned as 15. +#define MS_JSON_AS_INTEGER "JSON/AsInt" + +// Returns the floating point representation of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns the floating point representation of the node. +// The return value may be different depending on the type of the node +// JSON_NULL: 0.0 +// JSON_STRING: Undefined +// JSON_NUMBER: Value +// JSON_BOOL: 1.0 if true, 0.0 if false +// JSON_ARRAY: Undefined +// JSON_NODE: Undefined +#define MS_JSON_AS_FLOAT "JSON/AsFloat" + +// Returns the boolean representation of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns the boolean representation of the node. +// The return value may be different depending on the type of the node +// JSON_NULL: 0.0 +// JSON_STRING: Undefined +// JSON_NUMBER: Value == 0.0 +// JSON_BOOL: Value +// JSON_ARRAY: Undefined +// JSON_NODE: Undefined +#define MS_JSON_AS_BOOLEAN "JSON/AsBool" + +// Returns the boolean representation of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a HANDLE of the node. +// The return value may be different depending on the type of the node +// JSON_NULL: Empty node +// JSON_STRING: Empty node +// JSON_NUMBER: Empty node +// JSON_BOOL: Empty node +// JSON_ARRAY: Array converted to a node +// JSON_NODE: A copy of the node +// For anything other than node and array, it simply returns an +// empty node. If the caller is an array, it will convert it to a node. +// This command creates a new JSONNODE that has to be deleted or attached to a parent. +#define MS_JSON_AS_NODE "JSON/AsNode" + +// Returns the array representation of the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a HANDLE of the node. +// The return value may be different depending on the type of the node +// JSON_NULL: Empty node +// JSON_STRING: Empty node +// JSON_NUMBER: Empty node +// JSON_BOOL: Empty node +// JSON_ARRAY: A copy of the array +// JSON_NODE: An array of the children +// For anything other than node and array, it simply returns an +// empty array. If the caller is an node, it will convert it to an array by stripping +// all of the names of each child. +// This command creates a new JSONNODE that has to be deleted or attached to a parent. +#define MS_JSON_AS_ARRAY "JSON/AsArray" + +// + +// Returns JSON text, with no white space or comments. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a JSON text of the node being written. +// Remember to free the return value with MS_JSON_FREE +// Designed to create JSON that is very small, and therefore, faster to send between +// servers or write to a disk. The flipside is that it's nearly impossible to read by human eyes. +// Only root nodes (JSON_NODE and JSON_ARRAYs) are meant to be written, +// all others will return a blank string. +#define MS_JSON_WRITE "JSON/Write" + +// Returns JSON text that has been indented and prettied up so that it can be easily +// read and modified by humans. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Returns a JSON text of the node being written. +// Remember to free the return value with MS_JSON_FREE +// Only root nodes (JSON_NODE and JSON_ARRAYs) are meant to be written, +// all others will return a blank string. +#define MS_JSON_WRITE_FORMATTED "JSON/WriteFormatted" + +// Sets the name of the JSONNode. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(LPCSTR)szName +// Return value ALWAYS 0 +#define MS_JSON_SET_NAME "JSON/SetName" + +// Clears all children from the node. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Return value ALWAYS 0 +#define MS_JSON_CLEAR "JSON/Clear" + +// Nulls out the node +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Return value ALWAYS 0 +#define MS_JSON_NULLIFY "JSON/Nullify" + +// Swaps the contents of two nodes. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(WPARAM)(HANDLE)hCode2 +// Return value ALWAYS 0 +// This is very fast because JSONNODE is just a wrapper around an +// internal structure, so it simply swaps pointers to those structures. +#define MS_JSON_SWAP "JSON/Swap" + +// Merge the contents of nodes +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(WPARAM)(HANDLE)hCode2 +// Return value ALWAYS 0 +// It's possible that you may end up with multiple copies of the same node, +// through duplication and such. To save space, you might want to merge the +// internal reference counted structure. +#define MS_JSON_MERGE "JSON/Merge" + +// Preparse the json +// wParam=(WPARAM)(HANDLE)hNode +// lParam=0 +// Return value ALWAYS 0 +// libjson's lazy parsing makes parsing JSON that is not entirely used very fast, +// but sometimes you want to parse it all at once, making the next reads a little faster +#define MS_JSON_PREPARSE "JSON/Preparse" + +// (*set_binary not reflected as it requires 3 parameters +/* +#ifdef JSON_BINARY + void (*set_binary(JSONNODE * node, const void * data, unsigned long length); +#endif + */ + +// Will change the node to a different type and do any conversions necessary. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(char)cType +// Return value ALWAYS 0 +// Value of cType refer to MS_JSON_NEW +#define MS_JSON_CAST "JSON/Cast" + +// This function reserves children space, this makes the program faster and use less memory +// as it doesn't have to keep allocating new memory when it runs out. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(int)iSize +// Return value ALWAYS 0 +// Value of cType refer to MS_JSON_NEW +#define MS_JSON_RESERVE "JSON/Reserve" + +// This will give you a reference to a child node at a specific location. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(int)iPos +// Returns the HANDLE to the iPos' node of hNode +// This is a safe function and will return zero if you go out of bounds. +// The returned value is still a child, so do not try and delete the results. +#define MS_JSON_AT "JSON/At" + +// This will give you a reference to a child node by its name. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(LPCSTR)szName +// Returns the HANDLE of the child named szName +// This is a safe function and will return zero if that child does not exist. +// The returned value is still a child, so do not try and delete the results. +#define MS_JSON_GET "JSON/Get" + +// + +// This function pushes a new child node on the back of the child list. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(HANDLE)hNode2 +// Return value ALWAYS 0 +// This method copies the child, so altering the parameter later will not affect the one in the children. +// The child is then managed, so do not try and delete it later. +#define MS_JSON_PUSH_BACK "JSON/PushBack" + +// This will give remove a JSONNODE from it's parent and return it to you. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(int)iPos +// Returns the HANDLE of the child named szName +// Because it's removed from the parent, you must delete it yourself. +#define MS_JSON_POP_BACK_AT "JSON/PopBackAt" + +// This will give remove a JSONNODE from it's parent and return it to you. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(LPCSTR)szName +// Returns the HANDLE of the child named szName +// Because it's removed from the parent, you must delete it yourself. +#define MS_JSON_POP_BACK "JSON/PopBack" + +// functions with JSON_ITERATORS not reflected + #ifdef JSON_ITERATORS + JSONNODE_ITERATOR (*find(JSONNODE * node, const char * name); + #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS + JSONNODE_ITERATOR (*find_nocase(JSONNODE * node, const char * name); + #endif + JSONNODE_ITERATOR (*erase(JSONNODE * node, JSONNODE_ITERATOR it); + JSONNODE_ITERATOR (*erase_multi(JSONNODE * node, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); + JSONNODE_ITERATOR (*insert(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE * node2); + JSONNODE_ITERATOR (*insert_multi(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); + + //iterator functions + JSONNODE_ITERATOR (*begin(JSONNODE * node); + JSONNODE_ITERATOR (*end(JSONNODE * node); + #endif + +// Checks if the value held within the nodes are equal. +// wParam=(WPARAM)(HANDLE)hNode +// lParam=(LPARAM)(HANDLE)hNode2 +// Returns 0 if not equal, nonzero otherwise +// This ignores things like comments, but for JSON_NODE and JSON_ARRAYs, +// this is a deep comparison, checking each child too. +#define MS_JSON_EQUAL "JSON/Equal" + +#endif // MIM_LIBJSON_H diff --git a/plugins/ExternalAPI/m_listeningto.h b/plugins/ExternalAPI/m_listeningto.h index c1d8d63052..cc0b2990d2 100644 --- a/plugins/ExternalAPI/m_listeningto.h +++ b/plugins/ExternalAPI/m_listeningto.h @@ -1,32 +1,29 @@ /* -ListeningTo plugin for Miranda IM -========================================================================== -Copyright (C) 2005-2011 Ricardo Pescuma Domenecci - (C) 2010-2011 Merlin_de +Copyright (C) 2006 Ricardo Pescuma Domenecci This 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. +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 General Public License for more details. +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 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. +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_LISTENINGTO_H__ # define __M_LISTENINGTO_H__ -#ifndef MIID_LISTENINGTO + #define MIID_LISTENINGTO { 0x1fc1efa, 0xaa9f, 0x461b, { 0x92, 0x69, 0xaf, 0x66, 0x6b, 0x89, 0x31, 0xee } } -#endif + // To be used by other plugins to send listening info to miranda #define MIRANDA_WINDOWCLASS _T("Miranda.ListeningTo") @@ -69,6 +66,15 @@ lParam: BOOL - enabled #define ME_LISTENINGTO_ENABLE_STATE_CHANGED "ListeningTo/EnableStateChanged" +/* +Notification fired when listening info changed + +wParam: LISTENINGTOINFO * - pointer to listening info structure or NULL +lParam: NULL +*/ +#define ME_LISTENINGTO_LISTENING_INFO_CHANGED "ListeningTo/ListeningInfoChanged" + + /* Provide new info about a song change to listening to diff --git a/plugins/ExternalAPI/m_simpleaway.h b/plugins/ExternalAPI/m_simpleaway.h index e451c93f32..e70dcbf4ac 100644 --- a/plugins/ExternalAPI/m_simpleaway.h +++ b/plugins/ExternalAPI/m_simpleaway.h @@ -1,39 +1,42 @@ /* -SimpleAway plugin for Miranda-IM +Simple Status Message plugin for Miranda IM +Copyright (C) 2006-2010 Bartosz 'Dezeath' Białek, (C) 2005 Harven -Copyright © 2005 Harven, © 2006-2008 Dezeath - -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 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. +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., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef M_SIMPLEAWAY_H__ #define M_SIMPLEAWAY_H__ 1 +// +// NOTE: These services are deprecated. Please do not use them anymore. +// Take a look at m_simplestatusmsg.h instead. +// + // Represents status that a protocol(s) is/are currently in #define ID_STATUS_CURRENT 40082 // Force a change of global status mode/message -// wParam = (int)new status, from statusmodes.h or ID_STATUS_CURRENT -// lParam = (char *)status message +// wParam = (int)new status (from statusmodes.h), 0 or ID_STATUS_CURRENT for current +// lParam = (TCHAR *)status message #define MS_SA_SETSTATUSMODE "SimpleAway/SetStatusMode" #define MS_AWAYSYS_SETSTATUSMODE MS_SA_SETSTATUSMODE // for compatibility with some plugins // Brings up the status message dialog // wParam = 0 -// lParam = (char *)protocol name, NULL if for all protocols +// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols #define MS_SA_SHOWSTATUSMSGDIALOG "SimpleAway/ShowStatusMessageDialog" // Similar to the service above, for internal use only @@ -41,8 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Force a change of status mode/message. The status message dialog will appear, // depending on the configuration of the user -// wParam = (int)new status, from statusmodes.h -// lParam = (char *)protocol name, NULL if for all protocols +// wParam = (int)new status +// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols // Returns 1 when changed without showing the status message dialog #define MS_SA_CHANGESTATUSMSG "SimpleAway/ChangeStatusMessage" @@ -58,13 +61,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Returns immediately, without waiting for the message to retrieve #define MS_SA_COPYAWAYMSG "SimpleAway/CopyAwayMsg" +// Go to URL in away/na/etc message of a contact +// wParam = (WPARAM)(HANDLE)hContact +// lParam = 0 +#define MS_SA_GOTOURLMSG "SimpleAway/GoToURLMsg" + // Returns the default status message for a status in specified protocol module -// or the current status message for the specified protocol if ID_STATUS_CURRENT is used -// wParam = (int)status, from statusmodes.h or ID_STATUS_CURRENT -// lParam = (char *)protocol name, NULL if for all protocols +// or the current status message for the specified protocol if 0 or ID_STATUS_CURRENT is used +// wParam = (int)status, 0 or ID_STATUS_CURRENT for current +// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols // Returns status msg. Remember to free the return value #ifndef MS_AWAYMSG_GETSTATUSMSG -#define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage" + #define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage" +#endif +#ifndef MS_AWAYMSG_GETSTATUSMSGW + #define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW" +#endif + +#ifndef MS_AWAYMSG_GETSTATUSMSGT + #ifdef _UNICODE + #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSGW + #else + #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSG + #endif #endif // Force a change to specified global status mode/message diff --git a/plugins/ListeningTo/m_listeningto.h b/plugins/ListeningTo/m_listeningto.h deleted file mode 100644 index cc0b2990d2..0000000000 --- a/plugins/ListeningTo/m_listeningto.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -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_LISTENINGTO_H__ -# define __M_LISTENINGTO_H__ - - -#define MIID_LISTENINGTO { 0x1fc1efa, 0xaa9f, 0x461b, { 0x92, 0x69, 0xaf, 0x66, 0x6b, 0x89, 0x31, 0xee } } - - -// To be used by other plugins to send listening info to miranda -#define MIRANDA_WINDOWCLASS _T("Miranda.ListeningTo") -#define MIRANDA_DW_PROTECTION 0x8754 - -#define LISTENINGTO_ANSI 1 -#define LISTENINGTO_UNICODE 2 - -#ifdef UNICODE -# define LISTENINGTO_TCHAR LISTENINGTO_UNICODE -#else -# define LISTENINGTO_TCHAR LISTENINGTO_ANSI -#endif - - -/* -Return TRUE if sending listening to is enabled for this protocol - -wParam: char * - protocol name or NULL for all protocols -lParam: ignored -*/ -#define MS_LISTENINGTO_ENABLED "ListeningTo/Enabled" - - -/* -Enable/disable sending listening to this protocol - -wParam: char * - protocol name or NULL for all protocols -lParam: BOOL - TRUE to enable, FALSE to disable -*/ -#define MS_LISTENINGTO_ENABLE "ListeningTo/Enable" - - -/* -Notification fired when enable state changed - -wParam: char * - protocol name or NULL for all protocols -lParam: BOOL - enabled -*/ -#define ME_LISTENINGTO_ENABLE_STATE_CHANGED "ListeningTo/EnableStateChanged" - - -/* -Notification fired when listening info changed - -wParam: LISTENINGTOINFO * - pointer to listening info structure or NULL -lParam: NULL -*/ -#define ME_LISTENINGTO_LISTENING_INFO_CHANGED "ListeningTo/ListeningInfoChanged" - - -/* -Provide new info about a song change to listening to - -wParam: WCHAR * or char * - song data, in format "\\0\\0\\0\\0<Artist>\\0<Album>\\0<Track>\\0<Year>\\0<Genre>\\0<Length (secs)>\\0<Radio Station>\\0" -lParam: format of wParam: one of LISTENINGTO_ANSI or LISTENINGTO_UNICODE . Anything else will be handled as unicode -*/ -#define MS_LISTENINGTO_SET_NEW_SONG "ListeningTo/SetNewSong" - - - -#endif // __M_LISTENINGTO_H__ diff --git a/plugins/Mwclist/m_fontservice.h b/plugins/Mwclist/m_fontservice.h deleted file mode 100644 index 3723029ecb..0000000000 --- a/plugins/Mwclist/m_fontservice.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright Scott Ellis (mail@scottellis.com.au) 2005 -// This software is licenced under the GPL (General Public Licence) -// available at http://www.gnu.org/copyleft/gpl.html - -#ifndef _FONT_SERVICE_API_INC -#define _FONT_SERVICE_API_INC - -typedef struct FontID_tag { - int cbSize; - char group[64]; - char name[64]; - char dbSettingsGroup[32]; - char prefix[32]; - int order; -} FontID; - -// register a font -// wparam = (FontID *)&font_id -// lparam = 0 -#define MS_FONT_REGISTER "Font/Register" - -// get a font -// wparam = (FontID *)&font_id (only name and group matter) -// lParam = (LOGFONT *)&logfont -#define MS_FONT_GET "Font/Get" - -// fired when a user modifies font settings, so reget your fonts -#define ME_FONT_RELOAD "Font/Reload" - -#endif \ No newline at end of file diff --git a/plugins/Mwclist/m_mwclc.h b/plugins/Mwclist/m_mwclc.h deleted file mode 100644 index b7b5102c32..0000000000 --- a/plugins/Mwclist/m_mwclc.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2003 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. -*/ -#ifndef _M_CLC_ -#define _M_CLC_ - - -#endif diff --git a/plugins/Quotes/m_Quotes.h b/plugins/Quotes/m_Quotes.h deleted file mode 100644 index f4bbb06cd3..0000000000 --- a/plugins/Quotes/m_Quotes.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__ -#define __7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__ - -/* - * Export the contact (or all contacts) to xml file - * wParam = (WPARAM)(HANDLE)hContact to export or 0 to export all contacts - * lParam = (LPARAM)(const char*)pszFileName - pointer to file name to export or - * 0 in this case the dialog to select a file to export would be shown - * returns 0 if export was successfull, - * -1 if user canceled export and - * value greater than zero if error occurred during exporting - */ -#define MS_QUOTES_EXPORT "Quotes/Export" - -/* - * Import the contact (or all contacts) from xml file - * wParam = flags - * lParam = (LPARAM)(const char*)pszFileName - pointer to file name to import or - * 0 in this case the dialog to select a file to import would be shown - * returns 0 if import was successfull, - * -1 if user canceled import and - * value greater than zero if error occurred during importing - */ - -// if contact(s) exists user would be asked to overwrite these contacts -// #define QUOTES_IMPORT_PROMPT_TO_OVERWRITE_EXISTING_CONTACTS 0x0000 -// if contact(s) exists it would be overwrite without any prompt -// #define QUOTES_IMPORT_SILENT_OVERWRITE_EXISTING_CONTACTS 0x0001 -// if contact(s) exists during importing it would be ignored -#define QUOTES_IMPORT_SKIP_EXISTING_CONTACTS 0x0002 - -#define MS_QUOTES_IMPORT "Quotes/Import" - - -#endif //__7D8F07A4_72AF_4838_9C5C_6FDFF57D0DC6_m_Quotes_h__ diff --git a/plugins/Scriver/m_historyevents.h b/plugins/Scriver/m_historyevents.h deleted file mode 100644 index b1ae2b9792..0000000000 --- a/plugins/Scriver/m_historyevents.h +++ /dev/null @@ -1,847 +0,0 @@ -/* -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 __inline 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 __inline 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 __inline 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 __inline BOOL HistoryEvents_CanHandle(WORD eventType) -{ - if (!ServiceExists(MS_HISTORYEVENTS_CAN_HANDLE)) - return FALSE; - - return (BOOL) CallService(MS_HISTORYEVENTS_CAN_HANDLE, (WPARAM) eventType, 0); -} - -static __inline HICON HistoryEvents_GetIcon(WORD eventType) -{ - if (!ServiceExists(MS_HISTORYEVENTS_GET_ICON)) - return NULL; - - return (HICON) CallService(MS_HISTORYEVENTS_GET_ICON, (WPARAM) eventType, 0); -} - -static __inline int HistoryEvents_GetFlags(WORD eventType) -{ - if (!ServiceExists(MS_HISTORYEVENTS_GET_FLAGS)) - return -1; - - return (int) CallService(MS_HISTORYEVENTS_GET_FLAGS, (WPARAM) eventType, 0); -} - -static __inline void HistoryEvents_ReleaseIcon(HICON icon) -{ - CallService(MS_HISTORYEVENTS_RELEASE_ICON, (WPARAM) icon, 0); -} - -static __inline 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 __inline 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 __inline 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 __inline 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 __inline 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 __inline 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 __inline 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__ -/* -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_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/SimpleStatusMsg/m_simpleaway.h b/plugins/SimpleStatusMsg/m_simpleaway.h deleted file mode 100644 index e70dcbf4ac..0000000000 --- a/plugins/SimpleStatusMsg/m_simpleaway.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - -Simple Status Message plugin for Miranda IM -Copyright (C) 2006-2010 Bartosz 'Dezeath' Białek, (C) 2005 Harven - -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., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef M_SIMPLEAWAY_H__ -#define M_SIMPLEAWAY_H__ 1 - -// -// NOTE: These services are deprecated. Please do not use them anymore. -// Take a look at m_simplestatusmsg.h instead. -// - -// Represents status that a protocol(s) is/are currently in -#define ID_STATUS_CURRENT 40082 - -// Force a change of global status mode/message -// wParam = (int)new status (from statusmodes.h), 0 or ID_STATUS_CURRENT for current -// lParam = (TCHAR *)status message -#define MS_SA_SETSTATUSMODE "SimpleAway/SetStatusMode" -#define MS_AWAYSYS_SETSTATUSMODE MS_SA_SETSTATUSMODE // for compatibility with some plugins - -// Brings up the status message dialog -// wParam = 0 -// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols -#define MS_SA_SHOWSTATUSMSGDIALOG "SimpleAway/ShowStatusMessageDialog" - -// Similar to the service above, for internal use only -#define MS_SA_TTCHANGESTATUSMSG "SimpleAway/TTChangeStatusMessage" - -// Force a change of status mode/message. The status message dialog will appear, -// depending on the configuration of the user -// wParam = (int)new status -// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols -// Returns 1 when changed without showing the status message dialog -#define MS_SA_CHANGESTATUSMSG "SimpleAway/ChangeStatusMessage" - -// For checking if SimpleAway is running -// wParam = lParam = 0 -// Always returns 1 -#define MS_SA_ISSARUNNING "SimpleAway/IsSARunning" - -// Copy the away/na/etc message of a contact -// wParam = (WPARAM)(HANDLE)hContact -// lParam = 0 -// Returns 0 on success or nonzero on failure -// Returns immediately, without waiting for the message to retrieve -#define MS_SA_COPYAWAYMSG "SimpleAway/CopyAwayMsg" - -// Go to URL in away/na/etc message of a contact -// wParam = (WPARAM)(HANDLE)hContact -// lParam = 0 -#define MS_SA_GOTOURLMSG "SimpleAway/GoToURLMsg" - -// Returns the default status message for a status in specified protocol module -// or the current status message for the specified protocol if 0 or ID_STATUS_CURRENT is used -// wParam = (int)status, 0 or ID_STATUS_CURRENT for current -// lParam = (LPARAM)(char *)protocol name, NULL if for all protocols -// Returns status msg. Remember to free the return value -#ifndef MS_AWAYMSG_GETSTATUSMSG - #define MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage" -#endif -#ifndef MS_AWAYMSG_GETSTATUSMSGW - #define MS_AWAYMSG_GETSTATUSMSGW "SRAway/GetStatusMessageW" -#endif - -#ifndef MS_AWAYMSG_GETSTATUSMSGT - #ifdef _UNICODE - #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSGW - #else - #define MS_AWAYMSG_GETSTATUSMSGT MS_AWAYMSG_GETSTATUSMSG - #endif -#endif - -// Force a change to specified global status mode/message -// (calls MS_SA_CHANGESTATUSMSG with proper parameters) -// wParam = lParam = 0 -#define MS_SA_SETOFFLINESTATUS "SimpleAway/SetOfflineStatus" -#define MS_SA_SETONLINESTATUS "SimpleAway/SetOnlineStatus" -#define MS_SA_SETAWAYSTATUS "SimpleAway/SetAwayStatus" -#define MS_SA_SETDNDSTATUS "SimpleAway/SetDNDStatus" -#define MS_SA_SETNASTATUS "SimpleAway/SetNAStatus" -#define MS_SA_SETOCCUPIEDSTATUS "SimpleAway/SetOccupiedStatus" -#define MS_SA_SETFREECHATSTATUS "SimpleAway/SetFreeChatStatus" -#define MS_SA_SETINVISIBLESTATUS "SimpleAway/SetInvisibleStatus" -#define MS_SA_SETONTHEPHONESTATUS "SimpleAway/SetOnThePhoneStatus" -#define MS_SA_SETOUTTOLUNCHSTATUS "SimpleAway/SetOutToLunchStatus" - -#endif // M_SIMPLEAWAY_H__ diff --git a/plugins/SpellChecker/m_spellchecker.h b/plugins/SpellChecker/m_spellchecker.h deleted file mode 100644 index c7b5d3c922..0000000000 --- a/plugins/SpellChecker/m_spellchecker.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (C) 2006-2010 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__ - - -#define MIID_SPELLCHECKER { 0x26eed12a, 0x7016, 0x4d0f, { 0x9b, 0x4a, 0xc, 0xaa, 0x7e, 0x22, 0x29, 0xf3 } } - - - -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 - HWND hwndOwner; // The hwnd of owner of the popup menu. If it is null, hwnd is used -} 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/json/m_libJSON.h b/plugins/json/m_libJSON.h deleted file mode 100644 index 6c9597a496..0000000000 --- a/plugins/json/m_libJSON.h +++ /dev/null @@ -1,678 +0,0 @@ -#ifndef MIM_LIBJSON_H -#define MIM_LIBJSON_H - -#define IsJSONServiceAvailable() (ServiceExists(MS_JSON_FREE)) -#define json_getJSI(a) CallService(MS_JSON_GETINTERFACE,(WPARAM)a,0) - -#ifndef LIBJSON_H - #define JSONNODE void //so that JSONNODE* is void* - typedef JSONNODE** JSONNODE_ITERATOR; -#endif - -// This function get the service interface for direct calling -// wParam=(WPARAM)(LPJSONSERVICEINTERFACE) -// lParam=0 -// Return value ALWAYS 0 - -typedef struct { - /* - stuff that's in namespace libJSON - */ - void (*free)(void * str); - void (*delete_)(JSONNODE * node); - // #ifdef JSON_MEMORY_MANAGE - void (*free_all)(void); - void (*delete_all)(void); - // #endif - JSONNODE * (*parse)(const char * json); - char * (*strip_white_space)(const char * json); - // #ifdef JSON_VALIDATE - JSONNODE * (*validate)(const char * json); - // #endif - - /* - stuff that's in class JSONNode - */ - //ctors - JSONNODE * (*new_a)(const char * name, const char * value); - JSONNODE * (*new_i)(const char * name, long value); - JSONNODE * (*new_f)(const char * name, double value); - JSONNODE * (*new_b)(const char * name, int value); //because C bools are ints and C++ will implicitly cast it - JSONNODE * (*new_)(char type); - JSONNODE * (*copy)(const JSONNODE * orig); - JSONNODE * (*duplicate)(const JSONNODE * orig); - - //assignment - void (*set_a)(JSONNODE * node, const char * value); - void (*set_i)(JSONNODE * node, long value); - void (*set_f)(JSONNODE * node, double value); - void (*set_b)(JSONNODE * node, int value); //because C bools are ints ane C++ will implicit - void (*set_n)(JSONNODE * node, const JSONNODE * orig); - - //inspectors - char (*type)(const JSONNODE * node); - unsigned int (*size)(const JSONNODE * node); - int (*empty)(const JSONNODE * node); - char * (*name)(const JSONNODE * node); - // #ifdef JSON_COMMENTS - char * (*get_comment)(const JSONNODE * node); - // #endif - char * (*as_string)(const JSONNODE * node); - long (*as_int)(const JSONNODE * node); - double (*as_float)(const JSONNODE * node); - int (*as_bool)(const JSONNODE * node); - JSONNODE * (*as_node)(const JSONNODE * node); - JSONNODE * (*as_array)(const JSONNODE * node); - // #ifdef JSON_BINARY - void * (*as_binary)(const JSONNODE * node, unsigned long * size); - // #endif - // #ifdef JSON_WRITER - char * (*write)(const JSONNODE * node); - char * (*write_formatted)(const JSONNODE * node); - // #endif - - //modifiers - void (*set_name)(JSONNODE * node, const char * name); - // #ifdef JSON_COMMENTS - void (*set_comment)(JSONNODE * node, const char * comment); - // #endif - void (*clear)(JSONNODE * node); - void (*nullify)(JSONNODE * node); - void (*swap)(JSONNODE * node, JSONNODE * node2); - void (*merge)(JSONNODE * node, JSONNODE * node2); - // #ifndef JSON_PREPARSE - void (*preparse)(JSONNODE * node); - // #endif - // #ifdef JSON_BINARY - void (*set_binary)(JSONNODE * node, const void * data, unsigned long length); - // #endif - void (*cast)(JSONNODE * node, char type); - - //children access - void (*reserve)(JSONNODE * node, unsigned int siz); - JSONNODE * (*at)(JSONNODE * node, unsigned int pos); - JSONNODE * (*get)(JSONNODE * node, const char * name); - // #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS - JSONNODE * (*get_nocase)(JSONNODE * node, const char * name); - JSONNODE * (*pop_back_nocase)(JSONNODE * node, const char * name); - // #endif - void (*push_back)(JSONNODE * node, JSONNODE * node2); - JSONNODE * (*pop_back_at)(JSONNODE * node, unsigned int pos); - JSONNODE * (*pop_back)(JSONNODE * node, const char * name); - // #ifdef JSON_ITERATORS - JSONNODE_ITERATOR (*find)(JSONNODE * node, const char * name); - // #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS - JSONNODE_ITERATOR (*find_nocase)(JSONNODE * node, const char * name); - // #endif - JSONNODE_ITERATOR (*erase)(JSONNODE * node, JSONNODE_ITERATOR it); - JSONNODE_ITERATOR (*erase_multi)(JSONNODE * node, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); - JSONNODE_ITERATOR (*insert)(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE * node2); - JSONNODE_ITERATOR (*insert_multi)(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); - - //iterator functions - JSONNODE_ITERATOR (*begin)(JSONNODE * node); - JSONNODE_ITERATOR (*end)(JSONNODE * node); - // #endif - - //comparison - int (*equal)(JSONNODE * node, JSONNODE * node2); -} JSONSERVICEINTERFACE, *PJSONSERVICEINTERFACE, *LPJSONSERVICEINTERFACE; - -extern JSONSERVICEINTERFACE jsi; - -#ifndef LIBJSON_H -#define json_free(a) jsi.free(a) -#define json_delete(a) jsi.delete_(a) -// #ifdef JSON_MEMORY_MANAGE -#define json_free_all() jsi.free_all() -#define json_delete_all() jsi.delete_all() -// #endif -#define json_parse(a) jsi.parse(a) -#define json_strip_white_space(a) jsi.strip_white_space(a) -// #ifdef JSON_VALIDATE -#define json_validate(a) jsi.validate(a) -// #endif -#define json_new_a(a,b) jsi.new_a(a,b) -#define json_new_i(a,b) jsi.new_i(a,b) -#define json_new_f(a,b) jsi.new_f(a,b) -#define json_new_b(a,b) jsi.new_b(a,b) -#define json_new(a) jsi.new_(a) -#define json_copy(a) jsi.copy(a) -#define json_duplicate(a) jsi.duplicate(a) -#define json_set_a(a,b) jsi.set_a(a,b) -#define json_set_i(a,b) jsi.set_i(a,b) -#define json_set_f(a,b) jsi.set_f(a,b) -#define json_set_b(a,b) jsi.set_b(a,b) -#define json_set_n(a,b) jsi.set_n(a,b) -#define json_type(a) jsi.type(a) -#define json_size(a) jsi.size(a) -#define json_empty(a) jsi.empty(a) -#define json_name(a) jsi.name(a) -// #ifdef JSON_COMMENTS -#define json_get_comment(a) jsi.get_comment(a) -// #endif -#define json_as_string(a) jsi.as_string(a) -#define json_as_int(a) jsi.as_int(a) -#define json_as_float(a) jsi.as_float(a) -#define json_as_bool(a) jsi.as_bool(a) -#define json_as_node(a) jsi.as_node(a) -#define json_as_array(a) jsi.as_array(a) -// #ifdef JSON_BINARY -#define json_as_binary(a,b) jsi.as_binary(a,b) -// #endif -// #ifdef JSON_WRITER -#define json_write(a) jsi.write(a) -#define json_write_formatted(a) jsi.write_formatted(a) -// #endif -#define json_set_name(a,b) jsi.set_name(a,b) -// #ifdef JSON_COMMENTS -#define json_set_comment(a,b) jsi.set_comment(a,b) -// #endif -#define json_clear(a) jsi.clear(a) -#define json_nullify(a) jsi.nullify(a) -#define json_swap(a,b) jsi.swap(a,b) -#define json_merge(a,b) jsi.merge(a,b) -// #ifndef JSON_PREPARSE -#define json_preparse(a) jsi.preparse(a) -// #endif -// #ifdef JSON_BINARY -#define json_set_binary(a,b,c) jsi.set_binary(a,b,c) -// #endif -#define json_cast(a,b) jsi.cast(a,b) -#define json_reserve(a,b) jsi.reserve(a,b) -#define json_at(a,b) jsi.at(a,b) -#define json_get(a,b) jsi.get(a,b) -// #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS -#define json_get_nocase(a,b) jsi.get_nocase(a,b) -#define json_pop_back_nocase(a,b) jsi.pop_back_nocase(a,b) -// #endif -#define json_push_back(a,b) jsi.push_back(a,b) -#define json_pop_back_at(a,b) jsi.pop_back_at(a,b) -#define json_pop_back(a,b) jsi.pop_back(a,b) -// #ifdef JSON_ITERATORS -#define json_find(a,b) jsi.find(a,b) -// #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS -#define json_find_nocase(a,b) jsi.find_nocase(a,b) -// #endif -#define json_erase(a,b) jsi.erase(a,b) -#define json_erase_multi(a,b,c) jsi.erase_multi(a,b,c) -#define json_insert(a,b,c) jsi.insert(a,b,c) -#define json_insert_multi(a,b,c,d) jsi.insert_multi(a,b,c,d) -#define json_begin(a) jsi.begin(a) -#define json_end(a) jsi.end(a) -#define json_equal(a,b) jsi.equal(a,b) -#endif - -#define MS_JSON_GETINTERFACE "JSON/GetInterface" - -// This function removes the memory allocated by various functions that return strings, -// such as MS_JSON_AS_*, json_write... -// wParam=(WPARAM)(LPVOID)pVoid -// lParam=0 -// Return value ALWAYS 0 -#define MS_JSON_FREE "JSON/Free" - -// Delete specified node and all its children -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Return value ALWAYS 0 -#define MS_JSON_DELETE "JSON/Delete" - -// <!-- These functions are only available if JSON_MEMORY_MANAGE is defined on building -/* -// This function removes all of the memory that libjson has allocated for strings and binary. -// This allows for bulk frees and garbage collection. -// wParam=lParam=0 -// Return value ALWAYS 0 -#define MS_JSON_FREE_ALL "JSON/FreeAll" - -// Destructs the JSONNode object and cleans itself up. -// wParam=lParam=0 -// Return value ALWAYS 0 -#define MS_JSON_DELETE_ALL "JSON/DeleteAll" -*/ -// --> - -// This function parses JSON text and returns you a HANDLE which is the root node of the text -// that you just passed it. If bad JSON is sent to this method it may return NULL. -// wParam=(WPARAM)(LPCSTR)szJSON -// lParam=0 -// Returns a HANDLE on success, NULL on failure -// * Remember to free the handle with MS_JSON_DELETE -#define MS_JSON_PARSE "JSON/Parse" - -// This function removes anything that the JSON standard defines as white space, -// including extra tabs, spaces, formatting, and comments. This makes this function useful -// for compressing json that needs to be stored or sent over a network. -// wParam=(WPARAM)(LPCSTR)szJSON -// lParam=0 -// Returns a newly allocated valid JSON that is free of all white space -// * Remember to free the string with MS_JSON_FREE -#define MS_JSON_STRIP_WHITE_SPACE "JSON/StripWhiteSpace" - - -// <!-- These functions are only available if JSON_VALIDATE is defined on building -/* -// This function validates the text by parsing it completely and looking for anything that is -// malformed. If bad JSON is sent to this method it will throw a std::invalid_argument exception, -// otherwise it returns the root node of the text. -// wParam=(WPARAM)(LPCSTR)szJSON -// lParam=0 -// Returns a HANDLE on success -// * Remember to free the handle with MS_JSON_DELETE -#define MS_JSON_VALIDATE "JSON/Validate" -*/ -// --> - -// This function creates a string node with the name and value specified. -// wParam=(WPARAM)(LPCSTR)szName -// lParam=(LPARAM)(LPCSTR)szValue -// Returns a newly allocated node -// You must (*delete the resulting node or attach it to something as a child. -#define MS_JSON_NEW_STRING "JSON/NewA" - -// This function creates a integer node with the name and value specified. -// wParam=(WPARAM)(LPCSTR)szName -// lParam=(LPARAM)(long)lValue -// Returns a newly allocated node -// You must (*delete the resulting node or attach it to something as a child. -// Warning: The value IS SIGNED, for unsigned use MS_JSON_NEW_FLOAT instead. -#define MS_JSON_NEW_INTEGER "JSON/NewI" - -// This function creates a floating point node with the name and value specified. -// wParam=(WPARAM)(LPCSTR)szName -// lParam=(LPARAM)(float)fValue -// Returns a newly allocated node -// You must (*delete the resulting node or attach it to something as a child. -#define MS_JSON_NEW_FLOAT "JSON/NewF" - -// This function creates a boolean node with the name and value specified. -// wParam=(WPARAM)(LPCSTR)szName -// lParam=(LPARAM)(int)iValue -// Returns a newly allocated node -// You must (*delete the resulting node or attach it to something as a child. -#define MS_JSON_NEW_BOOLEAN "JSON/NewB" - -// This function creates an empty node of the specified type. -// This would normally be used to start serializing something or writing a configuration file. -// wParam=(WPARAM)(char)cType -// lParam=0 -// Returns a newly allocated node -// You must (*delete the resulting node or attach it to something as a child. -#define JSON_NULL '\0' -#define JSON_STRING '\1' -#define JSON_NUMBER '\2' -#define JSON_BOOL '\3' -#define JSON_ARRAY '\4' -#define JSON_NODE '\5' - -#define MS_JSON_NEW "JSON/New" - -// This function copies a JSONNODE and returns the new copy. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns an exact copy of the node parameter -#define MS_JSON_COPY "JSON/Copy" - -// Constructs a JSONNODE object, by copying the contents of JSONNODE. -// This is different from the MS_JSON_COPY because it makes a literal copy, -// not reference counting. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a HANDLE that is a new copy of the original node. -#define MS_JSON_DUPLICATE "JSON/Duplicate" - -// Sets the string value of the JSONNODE. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szValue -// Return value ALWAYS 0 -#define MS_JSON_SET_STRING "JSON/SetA" - -// Sets the integer value of the JSONNODE. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(long)lValue -// Return value ALWAYS 0 -// Warning: The value IS SIGNED, for unsigned use MS_JSON_SET_FLOAT instead. -#define MS_JSON_SET_INTEGER "JSON/SetI" - -// Sets the floating point value of the JSONNODE. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(float)fValue -// Return value ALWAYS 0 -#define MS_JSON_SET_FLOAT "JSON/SetF" - -// Sets the boolean value of the JSONNODE. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(int)iValue -// Return value ALWAYS 0 -#define MS_JSON_SET_BOOLEAN "JSON/SetB" - -// Sets the value of the JSONNODE to the value of the other, -// usually through fast and simple reference counting. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(HANDLE)hValueNode -// Return value ALWAYS 0 -#define MS_JSON_SET_NODE "JSON/SetN" - -// Returns the type of the JSONNODE. -// usually through fast and simple reference counting. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns value of JSON_* (See MS_JSON_NEW) -#define MS_JSON_TYPE "JSON/Type" - -// Returns the number of children that the node has. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns the number of children -// This should be zero for anything other than JSON_ARRAY or JSON_NODE, -// but this is only guaranteed with the JSON_SAFE option turned on (by default). -// This is because casting may or may not purge the children. -#define MS_JSON_SIZE "JSON/Size" - -// Returns whether or not the node has any children. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns 0 if the node is empty, nonzero if not -// If the node is not of JSON_NODE or JSON_ARRAY it will invariably return true. -#define MS_JSON_EMPTY "JSON/Empty" - -// Returns the name of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a newly allocated string. -// If there is no name, then it returns a blank string. -#define MS_JSON_NAME "JSON/Name" - -// <!-- These functions are only available if JSON_COMMENTS is defined on building -/* -// Returns the comment attached to the node -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a newly allocated string. -#define MS_JSON_COMMENT "JSON/Comment" - -// Sets the comment that will be associated with the JSONNode. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szComment -// Return value ALWAYS 0 -#define MS_JSON_SET_COMMENT "JSON/SetComment" -*/ -// --> - -// Returns the string representation of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a newly allocated string representation of the node. -// The return value may be different depending on the type of the node -// JSON_NULL: "" or "null" depending on how it was created -// JSON_STRING: The unescaped string value -// JSON_NUMBER: The number in string form (may be in scientific notation) -// JSON_BOOL: "true" or "false" -// JSON_ARRAY: "" -// JSON_NODE: "" -#define MS_JSON_AS_STRING "JSON/AsString" - -// Returns the integer representation of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns the integer representation of the node. -// The return value may be different depending on the type of the node -// JSON_NULL: 0 -// JSON_STRING: Undefined -// JSON_NUMBER: Truncated Value -// JSON_BOOL: 1 if true, 0 if false -// JSON_ARRAY: Undefined -// JSON_NODE: Undefined -// Warning: The value IS SIGNED, for unsigned use MS_JSON_AS_FLOAT instead. -// If the value is actually a floating point value, it will continue on ahead -// and simply truncate the value. So 15.9 will be returned as 15. -#define MS_JSON_AS_INTEGER "JSON/AsInt" - -// Returns the floating point representation of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns the floating point representation of the node. -// The return value may be different depending on the type of the node -// JSON_NULL: 0.0 -// JSON_STRING: Undefined -// JSON_NUMBER: Value -// JSON_BOOL: 1.0 if true, 0.0 if false -// JSON_ARRAY: Undefined -// JSON_NODE: Undefined -#define MS_JSON_AS_FLOAT "JSON/AsFloat" - -// Returns the boolean representation of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns the boolean representation of the node. -// The return value may be different depending on the type of the node -// JSON_NULL: 0.0 -// JSON_STRING: Undefined -// JSON_NUMBER: Value == 0.0 -// JSON_BOOL: Value -// JSON_ARRAY: Undefined -// JSON_NODE: Undefined -#define MS_JSON_AS_BOOLEAN "JSON/AsBool" - -// Returns the boolean representation of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a HANDLE of the node. -// The return value may be different depending on the type of the node -// JSON_NULL: Empty node -// JSON_STRING: Empty node -// JSON_NUMBER: Empty node -// JSON_BOOL: Empty node -// JSON_ARRAY: Array converted to a node -// JSON_NODE: A copy of the node -// For anything other than node and array, it simply returns an -// empty node. If the caller is an array, it will convert it to a node. -// This command creates a new JSONNODE that has to be deleted or attached to a parent. -#define MS_JSON_AS_NODE "JSON/AsNode" - -// Returns the array representation of the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a HANDLE of the node. -// The return value may be different depending on the type of the node -// JSON_NULL: Empty node -// JSON_STRING: Empty node -// JSON_NUMBER: Empty node -// JSON_BOOL: Empty node -// JSON_ARRAY: A copy of the array -// JSON_NODE: An array of the children -// For anything other than node and array, it simply returns an -// empty array. If the caller is an node, it will convert it to an array by stripping -// all of the names of each child. -// This command creates a new JSONNODE that has to be deleted or attached to a parent. -#define MS_JSON_AS_ARRAY "JSON/AsArray" - -// <!-- These functions are only available if JSON_BINARY is defined on building -/* -// Returns the binary value that was part of this node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPDWORD)pdwSize -// Returns a Base64 decoded binary data as std::string. -// The return value may be different depending on the type of the node -// JSON_NULL: Undefined -// JSON_STRING: The binary data from the decoded Base64 -// JSON_NUMBER: Undefined -// JSON_BOOL: Undefined -// JSON_ARRAY: Undefined -// JSON_NODE: Undefined -// It returns it as a std::string, you can use the data() function to retrieve it in binary form. -// This allows you to use size() to know how large the binary data is. -// pdwSize points to a DWORD to receive how many bytes the data is -#define MS_JSON_AS_BINARY "JSON/AsBinary" -*/ -// --> - -// Returns JSON text, with no white space or comments. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a JSON text of the node being written. -// Remember to free the return value with MS_JSON_FREE -// Designed to create JSON that is very small, and therefore, faster to send between -// servers or write to a disk. The flipside is that it's nearly impossible to read by human eyes. -// Only root nodes (JSON_NODE and JSON_ARRAYs) are meant to be written, -// all others will return a blank string. -#define MS_JSON_WRITE "JSON/Write" - -// Returns JSON text that has been indented and prettied up so that it can be easily -// read and modified by humans. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Returns a JSON text of the node being written. -// Remember to free the return value with MS_JSON_FREE -// Only root nodes (JSON_NODE and JSON_ARRAYs) are meant to be written, -// all others will return a blank string. -#define MS_JSON_WRITE_FORMATTED "JSON/WriteFormatted" - -// Sets the name of the JSONNode. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szName -// Return value ALWAYS 0 -#define MS_JSON_SET_NAME "JSON/SetName" - -// Clears all children from the node. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Return value ALWAYS 0 -#define MS_JSON_CLEAR "JSON/Clear" - -// Nulls out the node -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Return value ALWAYS 0 -#define MS_JSON_NULLIFY "JSON/Nullify" - -// Swaps the contents of two nodes. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(WPARAM)(HANDLE)hCode2 -// Return value ALWAYS 0 -// This is very fast because JSONNODE is just a wrapper around an -// internal structure, so it simply swaps pointers to those structures. -#define MS_JSON_SWAP "JSON/Swap" - -// Merge the contents of nodes -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(WPARAM)(HANDLE)hCode2 -// Return value ALWAYS 0 -// It's possible that you may end up with multiple copies of the same node, -// through duplication and such. To save space, you might want to merge the -// internal reference counted structure. -#define MS_JSON_MERGE "JSON/Merge" - -// Preparse the json -// wParam=(WPARAM)(HANDLE)hNode -// lParam=0 -// Return value ALWAYS 0 -// libjson's lazy parsing makes parsing JSON that is not entirely used very fast, -// but sometimes you want to parse it all at once, making the next reads a little faster -#define MS_JSON_PREPARSE "JSON/Preparse" - -// (*set_binary not reflected as it requires 3 parameters -/* -#ifdef JSON_BINARY - void (*set_binary(JSONNODE * node, const void * data, unsigned long length); -#endif - */ - -// Will change the node to a different type and do any conversions necessary. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(char)cType -// Return value ALWAYS 0 -// Value of cType refer to MS_JSON_NEW -#define MS_JSON_CAST "JSON/Cast" - -// This function reserves children space, this makes the program faster and use less memory -// as it doesn't have to keep allocating new memory when it runs out. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(int)iSize -// Return value ALWAYS 0 -// Value of cType refer to MS_JSON_NEW -#define MS_JSON_RESERVE "JSON/Reserve" - -// This will give you a reference to a child node at a specific location. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(int)iPos -// Returns the HANDLE to the iPos' node of hNode -// This is a safe function and will return zero if you go out of bounds. -// The returned value is still a child, so do not try and delete the results. -#define MS_JSON_AT "JSON/At" - -// This will give you a reference to a child node by its name. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szName -// Returns the HANDLE of the child named szName -// This is a safe function and will return zero if that child does not exist. -// The returned value is still a child, so do not try and delete the results. -#define MS_JSON_GET "JSON/Get" - -// <!-- These functions are only available if JSON_CASE_INSENSITIVE_FUNCTIONS is defined on building -/* -// This will give you a reference to a child node by its name. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szName -// Returns the HANDLE of the child named szName -// This is a safe function and will return zero if that child does not exist. -// The returned value is still a child, so do not try and delete the results. -#define MS_JSON_GET_NOCASE "JSON/GetNocase" - -// This will give remove a JSONNODE from it's parent and return it to you. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szName -// Returns the HANDLE of the child named szName -// Because it's removed from the parent, you must delete it yourself. -#define MS_JSON_POP_BACK_NOCASE "JSON/PopBackNocase" -*/ -// --> - -// This function pushes a new child node on the back of the child list. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(HANDLE)hNode2 -// Return value ALWAYS 0 -// This method copies the child, so altering the parameter later will not affect the one in the children. -// The child is then managed, so do not try and delete it later. -#define MS_JSON_PUSH_BACK "JSON/PushBack" - -// This will give remove a JSONNODE from it's parent and return it to you. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(int)iPos -// Returns the HANDLE of the child named szName -// Because it's removed from the parent, you must delete it yourself. -#define MS_JSON_POP_BACK_AT "JSON/PopBackAt" - -// This will give remove a JSONNODE from it's parent and return it to you. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(LPCSTR)szName -// Returns the HANDLE of the child named szName -// Because it's removed from the parent, you must delete it yourself. -#define MS_JSON_POP_BACK "JSON/PopBack" - -// functions with JSON_ITERATORS not reflected - #ifdef JSON_ITERATORS - JSONNODE_ITERATOR (*find(JSONNODE * node, const char * name); - #ifdef JSON_CASE_INSENSITIVE_FUNCTIONS - JSONNODE_ITERATOR (*find_nocase(JSONNODE * node, const char * name); - #endif - JSONNODE_ITERATOR (*erase(JSONNODE * node, JSONNODE_ITERATOR it); - JSONNODE_ITERATOR (*erase_multi(JSONNODE * node, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); - JSONNODE_ITERATOR (*insert(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE * node2); - JSONNODE_ITERATOR (*insert_multi(JSONNODE * node, JSONNODE_ITERATOR it, JSONNODE_ITERATOR start, JSONNODE_ITERATOR end); - - //iterator functions - JSONNODE_ITERATOR (*begin(JSONNODE * node); - JSONNODE_ITERATOR (*end(JSONNODE * node); - #endif - -// Checks if the value held within the nodes are equal. -// wParam=(WPARAM)(HANDLE)hNode -// lParam=(LPARAM)(HANDLE)hNode2 -// Returns 0 if not equal, nonzero otherwise -// This ignores things like comments, but for JSON_NODE and JSON_ARRAYs, -// this is a deep comparison, checking each child too. -#define MS_JSON_EQUAL "JSON/Equal" - -#endif // MIM_LIBJSON_H diff --git a/protocols/IRCG/m_ircscript.h b/protocols/IRCG/m_ircscript.h deleted file mode 100644 index ddab3b96bb..0000000000 --- a/protocols/IRCG/m_ircscript.h +++ /dev/null @@ -1,129 +0,0 @@ - -/* - This file is a description of the interface between the Miranda Scripting - Plugin (MSP) and IRC. It is mainly an internal draft. - - The MSP is a powerful PHP based scripting engine - which can automate many tasks in Miranda IM. With the implementation of - this interface IRC can also benefit from the advantages MSP brings. The - interface has been constructed by the respective authors of IRC and MSP. - - The idea is that MSP and IRC should communicate via the interface outlined herein, - but MSP should "package" the data in attractive functions that can be easily - used by eager scripters. - - Note that m_chat.h should be #included as the events defined therein is used in this interface - - The IRC plugin communicates with MSP mainly through 8 (2 x 4) services which are - illustrated by the following matrix (MSP has 4 services and IRC 4 services): - - - -------------------------------------------------- - | | | - | Incoming raw data | Data going | - | from server | to GUI | - | (before processing) | (after processing) | - | | | - -------------------------------------------------- - | | | - | Outgoing raw data | Data going | - | to server | from GUI | - | (after processing) | (before processing) | - | | | - -------------------------------------------------- - - (processing refers to the IRC plugin reacting to different commands) - -*/ - - -//------------------------- HANDLING RAW MESSAGES ------------------------ -/* - - The two leftmost boxes are related to data sent to and from the server in RAW form. - (a typical RAW message looks like this: ":nick!user@host COMMAND PARAMETERS") - - It is very useful for scripters to be able to manipulate and add RAW streams of data. - - The below structure is used when RAW data is generated and IRC must trigger an - event in MSP so the scripts can do their magic. - - If the data is modified make sure to use MS_SYSTEM_GET_MMI and then mmi_realloc() to - allocate from the same heap. Do not free the data. - - wParam= Module name - lParam= (LPARAM)( char* )pszRaw - returns nonzero if the message should be dropped -*/ - -/* - NOTE! IRC will implement two services which also uses the same parameters: - - "<Module m_name>/InsertRawIn" //used for inserting a "fake" incoming RAW event - "<Module m_name>/InsertRawOut" //used for inserting a "fake" outgoing RAW event - -*/ - - -#define MS_MBOT_IRC_RAW_IN "MBot/IrcRawIn" -#define MS_MBOT_IRC_RAW_OUT "MBot/IrcRawOut" - - -//------------------------- HANDLING GUI MESSAGES 1 ------------------------ -/* - - The top rightmost box is related to data sent to the gui - (currently chat.dll) in the form of GCEVENT's. (see m_chat.h) - - While maybe not as useful to the scripter, it can be useful to be able to - "tap into" messages to the GUI from the IRC plugin. - - If the data is modified make sure to realloc() or similar. - - wParam= (WPARAM) (WPARAM_GUI_IN) &wgi - lParam= (LPARAM)(GCEVENT *)&gce // see m_chat.h - returns nonzero if the message should be dropped -*/ - -/* - NOTE! IRC will implement a service which also uses the same parameters: - - "<Module m_name>/InsertGuiIn" //used for inserting a "fake" event to the GUI - -*/ -typedef struct MBOT_GUI_WPARAM_IN_STRUCT -{ - const char* pszModule; - WPARAM wParam; -}WPARAM_GUI_IN; - -#define MS_MBOT_IRC_GUI_IN "MBot/IrcGuiIn" - - -//------------------------- HANDLING GUI MESSAGES 2 ------------------------ -/* - - The bottom rightmost box is related to data sent from the gui - (currently chat.dll) in the form of GCHOOKS's. Originally this is carried out in a hook, - but for MSP this is done via a service instead. - - It can be useful for scripters to simulate user actions, like entering text, closing the window etc - - If the data is modified make sure to realloc() or similar. - - wParam= Module name - lParam= (LPARAM)(GCHOOK *)gch // see m_chat.h - returns nonzero if the message should be dropped -*/ - -/* - NOTE! IRC will implement a service which also uses the same parameters: - - "<Module m_name>/InsertGuiOut" //used for inserting a "fake" outgoing event to the GUI - -*/ - -#define MS_MBOT_IRC_GUI_OUT "MBot/IrcGuiOut" - -#define MS_MBOT_REGISTERIRC "MBot/RegisterIRCModule" - -- cgit v1.2.3