diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/delphi/m_api.pas | 1 | ||||
-rw-r--r-- | include/delphi/testdll.dpr | 1 | ||||
-rw-r--r-- | include/m_addcontact.h | 68 | ||||
-rw-r--r-- | include/m_contacts.h | 9 | ||||
-rw-r--r-- | include/m_core.h | 33 | ||||
-rw-r--r-- | include/m_idle.h | 33 | ||||
-rw-r--r-- | include/m_json.h | 25 | ||||
-rw-r--r-- | include/m_langpack.h | 6 | ||||
-rw-r--r-- | include/m_message.h | 5 | ||||
-rw-r--r-- | include/m_protosvc.h | 30 | ||||
-rw-r--r-- | include/m_system_cpp.h | 62 | ||||
-rw-r--r-- | include/newpluginapi.h | 1 |
12 files changed, 149 insertions, 125 deletions
diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas index 2abea6900c..252d3fef6e 100644 --- a/include/delphi/m_api.pas +++ b/include/delphi/m_api.pas @@ -132,7 +132,6 @@ type version :dword;
description:PAnsiChar;
author :PAnsiChar;
- authorEmail:PAnsiChar;
copyright :PAnsiChar;
homepage :PAnsiChar;
flags :byte; // right now the only flag, UNICODE_AWARE, is recognized here
diff --git a/include/delphi/testdll.dpr b/include/delphi/testdll.dpr index f19fd9ea40..135ceeb0a0 100644 --- a/include/delphi/testdll.dpr +++ b/include/delphi/testdll.dpr @@ -14,7 +14,6 @@ begin PluginInfo.version :=$00000001;
PluginInfo.description:='The long description of your plugin, to go in the plugin options dialog';
PluginInfo.author :='J. Random Hacker';
- PluginInfo.authorEmail:='noreply@sourceforge.net';
PluginInfo.copyright :='(c) 2003 J. Random Hacker';
PluginInfo.homepage :='http://miranda-icq.sourceforge.net/';
PluginInfo.flags :=UNICODE_AWARE;
diff --git a/include/m_addcontact.h b/include/m_addcontact.h deleted file mode 100644 index c4ee042ef6..0000000000 --- a/include/m_addcontact.h +++ /dev/null @@ -1,68 +0,0 @@ -/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (c) 2012-17 Miranda NG project (https://miranda-ng.org)
-Copyright (c) 2000-08 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_ADDCONTACT_H__
-#define M_ADDCONTACT_H__ 1
-
-typedef struct{
- int handleType; // one of the HANDLE_ constants
- union {
- MEVENT hDbEvent; // hDbEvent if acs.handleType == HANDLE_EVENT
- MCONTACT hContact; // hContact if acs.handleType == HANDLE_CONTACT
- // ignored if acs.handleType == HANDLE_SEARCHRESULT
- };
- const char *szProto; // ignored if acs.handleType != HANDLE_SEARCHRESULT
- PROTOSEARCHRESULT *psr; // ignored if acs.handleType != HANDLE_SEARCHRESULT
-}ADDCONTACTSTRUCT;
-
-/*
- Description: Open the add contact dialog, see notes
-
- wParam = [ (WPARAM)hWndParent ]
- lParam = (LPARAM)(ADDCONTACTSTRUCT*)&acs
-
- Notes:
-
- During 0.3.0.0 development (circa 2003/06/08)
-
- An entire copy of the ADDCONTACTSTRUCT structure is made,
- the PROTOSEARCHRESULT is also copied at psr->cbSize, all default
- strings are copied (even if they're not needed/used)
- if you pass a structure that is bigger than PROTOSEARCHRESULT
- then do not use pointers in the newly defined area because
- they will not be copied.
-
- passing wParam == NULL will result in a dialog that is created modeless
-
- Before the circa, a modal dialog was *always* created and
- strings within PROTOSEARCHRESULT were not copied.
-
-*/
-
-#define HANDLE_SEARCHRESULT 0
-#define HANDLE_EVENT 1
-#define HANDLE_CONTACT 2
-#define MS_ADDCONTACT_SHOW "AddContact/Show"
-
-#endif // M_ADDCONTACT_H__
diff --git a/include/m_contacts.h b/include/m_contacts.h index 9295074932..17811981b3 100644 --- a/include/m_contacts.h +++ b/include/m_contacts.h @@ -79,4 +79,13 @@ EXTERN_C MIR_APP_DLL(wchar_t*) Contact_GetInfo( MCONTACT hContact, // contact id or NULL for the global data
const char *szProto = NULL); // protocol for global data. if skipped, grabbed from hContact
+/////////////////////////////////////////////////////////////////////////////////////////
+// Add contact's dialog
+
+// passing hWnd == NULL will result in a dialog that is created modeless
+
+EXTERN_C MIR_APP_DLL(void) Contact_Add(MCONTACT hContact, HWND hwndParent = nullptr);
+EXTERN_C MIR_APP_DLL(void) Contact_AddByEvent(MEVENT hEvent, HWND hwndParent = nullptr);
+EXTERN_C MIR_APP_DLL(void) Contact_AddBySearch(const char *m_szProto, struct PROTOSEARCHRESULT *m_psr, HWND hwndParent = nullptr);
+
#endif // M_CONTACTS_H__
diff --git a/include/m_core.h b/include/m_core.h index 6438116551..ff2e754157 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -397,11 +397,11 @@ MIR_CORE_DLL(void) mir_hmac_sha256(BYTE hashout[MIR_SHA256_HASH_SIZE], const BYT ///////////////////////////////////////////////////////////////////////////////
// strings
-MIR_CORE_DLL(void*) mir_base64_decode(const char *input, unsigned *outputLen);
-MIR_CORE_DLL(char*) mir_base64_encode(const BYTE *input, unsigned inputLen);
-MIR_CORE_DLL(char*) mir_base64_encodebuf(const BYTE *input, unsigned inputLen, char *output, unsigned outLen);
+MIR_CORE_DLL(void*) mir_base64_decode(const char *input, size_t *outputLen);
+MIR_CORE_DLL(char*) mir_base64_encode(const void *input, size_t inputLen);
+MIR_CORE_DLL(char*) mir_base64_encodebuf(const void *input, size_t inputLen, char *output, size_t outLen);
-__forceinline unsigned mir_base64_encode_bufsize(unsigned inputLen)
+__forceinline size_t mir_base64_encode_bufsize(size_t inputLen)
{
return 4 * ((inputLen + 2) / 3) + 1;
}
@@ -533,23 +533,18 @@ MIR_CORE_DLL(void) KillModuleSubclassing(HMODULE hInst); ///////////////////////////////////////////////////////////////////////////////
// Windows utilities
-MIR_CORE_DLL(BOOL) IsWinVerVistaPlus();
-MIR_CORE_DLL(BOOL) IsWinVer7Plus();
-MIR_CORE_DLL(BOOL) IsWinVer8Plus();
-MIR_CORE_DLL(BOOL) IsWinVer81Plus();
-MIR_CORE_DLL(BOOL) IsWinVer10Plus();
+MIR_CORE_DLL(BOOL) IsWinVerVistaPlus();
+MIR_CORE_DLL(BOOL) IsWinVer7Plus();
+MIR_CORE_DLL(BOOL) IsWinVer8Plus();
+MIR_CORE_DLL(BOOL) IsWinVer81Plus();
+MIR_CORE_DLL(BOOL) IsWinVer10Plus();
-MIR_CORE_DLL(BOOL) IsFullScreen();
-MIR_CORE_DLL(BOOL) IsWorkstationLocked();
-MIR_CORE_DLL(BOOL) IsScreenSaverRunning();
+MIR_CORE_DLL(BOOL) IsFullScreen();
+MIR_CORE_DLL(BOOL) IsWorkstationLocked();
+MIR_CORE_DLL(BOOL) IsScreenSaverRunning();
+MIR_CORE_DLL(BOOL) IsTerminalDisconnected();
-MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize);
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// retrieves the hLangpack of a plugin by its HINSTANCE
-// returns hLangpack if found, or 0 if error occurred
-
-MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE);
+MIR_CORE_DLL(BOOL) GetOSDisplayString(wchar_t *buf, size_t bufSize);
///////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_idle.h b/include/m_idle.h index 58d786ac8a..635fb7a643 100644 --- a/include/m_idle.h +++ b/include/m_idle.h @@ -31,9 +31,6 @@ for "long" idle. Thie module will generate long/short events based on these user and other information too. If you are unsure which idle mode to report for, report it
for short idle.*/
-#define IDF_ISIDLE 0x1 // idle has become active (if not set, inactive)
-#define IDF_PRIVACY 0x8 // if set, the information provided shouldn't be given to third parties.
-
/*
wParam: 0
lParam: IDF_* (or'd field)
@@ -47,18 +44,11 @@ for short idle.*/ set.
Version: 0.3.4a+ (2004/09/16)
*/
-#define ME_IDLE_CHANGED "Miranda/Idle/Changed"
-typedef struct {
- int cbSize; // sizeof()
- int idleTime; // idle in mins, if zero then disabled
- int privacy; // user doesnt want other people seeing anything more than they are idle
- int aaStatus; // status to go to when user is auto away
- int aaLock; // the status shouldn't be unset if its set
- int idleType;
- int idlesoundsoff;
-}
- MIRANDA_IDLE_INFO;
+#define IDF_ISIDLE 0x1 // idle has become active (if not set, inactive)
+#define IDF_PRIVACY 0x8 // if set, the information provided shouldn't be given to third parties.
+
+#define ME_IDLE_CHANGED "Miranda/Idle/Changed"
/*
wParam; 0
@@ -69,6 +59,21 @@ typedef struct { Version: 0.3.4 (2004/09/16)
*/
+struct MIRANDA_IDLE_INFO
+{
+ int idleTime; // idle in mins, if zero then disabled
+ int privacy; // user doesnt want other people seeing anything more than they are idle
+ int aaStatus; // status to go to when user is auto away
+ int aaLock; // the status shouldn't be unset if its set
+ int idleType;
+ int idlesoundsoff;
+};
+
#define MS_IDLE_GETIDLEINFO "Miranda/Idle/GetInfo"
+__forceinline int Idle_GetInfo(MIRANDA_IDLE_INFO &pInfo)
+{
+ return CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&pInfo);
+}
+
#endif // M_IDLE_H__
diff --git a/include/m_json.h b/include/m_json.h index d63c6184e4..9211e408fb 100644 --- a/include/m_json.h +++ b/include/m_json.h @@ -126,6 +126,8 @@ LIBJSON_DLL(JSONNode*) json_pop_back(JSONNode *node, const char *name); //comparison
LIBJSON_DLL(int) json_equal(JSONNode *node, JSONNode *node2);
+}
+
#ifdef __cplusplus
class JSONROOT
@@ -142,7 +144,28 @@ public: __forceinline JSONNode* Parse(LPCSTR text) { return (m_node = json_parse(text)); }
};
-}
+struct NULL_PARAM : public PARAM
+{
+ __forceinline NULL_PARAM(LPCSTR _name) : PARAM(_name)
+ {}
+ ;
+};
+
+struct JSON_PARAM : public PARAM
+{
+ JSONNode node;
+ __forceinline JSON_PARAM(LPCSTR _name, JSONNode _node) :
+ PARAM(_name), node(_node)
+ {}
+};
+
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT_PARAM ¶m);
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const INT64_PARAM ¶m);
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const BOOL_PARAM ¶m);
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const CHAR_PARAM ¶m);
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const WCHAR_PARAM ¶m);
+LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const NULL_PARAM ¶m); +LIBJSON_DLL(JSONNode&) operator<<(JSONNode &json, const JSON_PARAM ¶m); #endif // __cplusplus
diff --git a/include/m_langpack.h b/include/m_langpack.h index 7d97d36499..45e408a499 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -92,6 +92,12 @@ EXTERN_C MIR_CORE_DLL(int) Langpack_GetDefaultLocale(void); EXTERN_C MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr);
/////////////////////////////////////////////////////////////////////////////////////////
+// retrieves the hLangpack of a plugin by its HINSTANCE
+// returns hLangpack if found, or 0 if error occurred
+
+EXTERN_C MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// reloads langpack
// wParam = 0 (ignored)
// lParam = (LPARAM)(wchar_t*)langpack file name or NULL to reload the current one
diff --git a/include/m_message.h b/include/m_message.h index ece398ca66..8e96220ac5 100644 --- a/include/m_message.h +++ b/include/m_message.h @@ -299,4 +299,9 @@ struct CustomButtonClickData DWORD flags; // BBCF_ flags
};
+/////////////////////////////////////////////////////////////////////////////////////////
+// color table for embedded color chooser
+
+EXTERN_C MIR_APP_DLL(COLORREF*) Srmm_GetColorTable(int *pTableSize = nullptr);
+
#endif // M_MESSAGE_H__
diff --git a/include/m_protosvc.h b/include/m_protosvc.h index cc6c6ccc13..4c1064e6e4 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -338,7 +338,8 @@ static __inline unsigned long Proto_Status2Flag(int status) #define PSR_UNICODE 0x0001 // all strings go in UTF16-LE
#define PSR_UTF8 0x0002 // all strings go in UTF8
-typedef struct {
+struct PROTOSEARCHRESULT
+{
int cbSize;
MAllStrings nick;
MAllStrings firstName;
@@ -346,7 +347,7 @@ typedef struct { MAllStrings email;
MAllStrings id;
int flags;
-} PROTOSEARCHRESULT;
+};
#define PS_BASICSEARCH "/BasicSearch"
@@ -371,11 +372,12 @@ typedef struct { // Results are returned as for PS_BASICSEARCH.
// This function is only available if the PF1_SEARCHBYNAME capability is set
-typedef struct {
+struct PROTOSEARCHBYNAME
+{
wchar_t *pszNick;
wchar_t *pszFirstName;
wchar_t *pszLastName;
-} PROTOSEARCHBYNAME;
+};
#define PS_SEARCHBYNAME "/SearchByName"
@@ -405,12 +407,13 @@ typedef struct { #define PS_SEARCHBYADVANCED "/SearchByAdvanced"
-typedef struct {
+struct CUSTOMSEARCHRESULTS
+{
size_t nSize;
int nFieldCount;
wchar_t **pszFields;
PROTOSEARCHRESULT psr;
-} CUSTOMSEARCHRESULTS;
+};
///////////////////////////////////////////////////////////////////////////////
// Adds a search result to the contact list
@@ -465,10 +468,11 @@ typedef struct { #define FILERESUME_RENAME 3
#define FILERESUME_SKIP 4
-typedef struct {
+struct PROTOFILERESUME
+{
int action; // a FILERESUME_ flag
const wchar_t *szFilename; // full path. Only valid if action == FILERESUME_RENAME
-} PROTOFILERESUME;
+};
#define PS_FILERESUME "/FileResume"
@@ -743,14 +747,15 @@ typedef struct { // DB event: EVENTTYPE_MESSAGE, blob contains szMessage without 0 terminator
// Return 0 - success, other failure
-typedef struct {
+struct PROTORECVEVENT
+{
DWORD flags;
DWORD timestamp; // unix time
char *szMessage; // message body in utf8
LPARAM lParam; // extra space for the network level protocol module
void *pCustomData;
DWORD cbCustomDataSize;
-} PROTORECVEVENT;
+};
#define PREF_CREATEREAD 1 // create the database event with the 'read' flag set
#define PREF_RTL 4 // 0.5+ addition: support for right-to-left messages
@@ -801,14 +806,15 @@ __forceinline INT_PTR Proto_AuthRecv(const char *szProtoName, PROTORECVEVENT *pc #define PRFF_UNICODE 1
-typedef struct {
+struct PROTORECVFILET
+{
DWORD dwFlags; // PRFF_*
DWORD timestamp; // unix time
MAllStrings descr; // file description
int fileCount; // number of files being transferred
MAllStringArray files; // array of file names
LPARAM lParam; // extra space for the network level protocol module
-} PROTORECVFILET;
+};
#define PSR_FILE "/RecvFile"
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h index be7c6ff84f..11ccbfc0b2 100644 --- a/include/m_system_cpp.h +++ b/include/m_system_cpp.h @@ -92,9 +92,8 @@ public: __inline explicit pass_ptrA(char *_p) : mir_ptr(_p) {}
__inline ~pass_ptrA() { zero(); }
__inline char* operator = (char *_p){ zero(); return mir_ptr::operator=(_p); }
- __inline void zero()
- {
- if (data) SecureZeroMemory(data, mir_strlen(data));
+ __inline void zero() {
+ if (data) SecureZeroMemory(data, mir_strlen(data));
}
};
@@ -105,14 +104,11 @@ public: __inline explicit pass_ptrW(wchar_t *_p) : mir_ptr(_p) {}
__inline ~pass_ptrW() { zero(); }
__inline wchar_t* operator = (wchar_t *_p){ zero(); return mir_ptr::operator=(_p); }
- __inline void zero()
- {
- if (data) SecureZeroMemory(data, mir_wstrlen(data)*sizeof(wchar_t));
+ __inline void zero() {
+ if (data) SecureZeroMemory(data, mir_wstrlen(data)*sizeof(wchar_t));
}
};
-typedef pass_ptrW pass_ptrT;
-
///////////////////////////////////////////////////////////////////////////////
// mir_cslockfull - controllable locker for the critical sections
@@ -319,6 +315,56 @@ public: void remove(size_t sz);
};
+///////////////////////////////////////////////////////////////////////////////
+// parameter classes for XML, JSON & HTTP requests
+
+struct PARAM
+{
+ const char *szName;
+ __forceinline PARAM(const char *_name) : szName(_name)
+ {}
+};
+
+struct BOOL_PARAM : public PARAM
+{
+ bool bValue;
+ __forceinline BOOL_PARAM(const char *_name, bool _value) :
+ PARAM(_name), bValue(_value)
+ {}
+};
+
+struct INT_PARAM : public PARAM
+{
+ int32_t iValue;
+ __forceinline INT_PARAM(const char *_name, int32_t _value) :
+ PARAM(_name), iValue(_value)
+ {}
+};
+
+struct INT64_PARAM : public PARAM
+{
+ int64_t iValue;
+ __forceinline INT64_PARAM(const char *_name, int64_t _value) :
+ PARAM(_name), iValue(_value)
+ {}
+};
+
+struct CHAR_PARAM : public PARAM
+{
+ const char *szValue;
+ __forceinline CHAR_PARAM(const char *_name, const char *_value) :
+ PARAM(_name), szValue(_value)
+ {}
+};
+
+struct WCHAR_PARAM : public PARAM
+{
+ const wchar_t *wszValue;
+ __forceinline WCHAR_PARAM(const char *_name, const wchar_t *_value) :
+ PARAM(_name), wszValue(_value)
+ {}
+};
+
#endif
#endif // M_SYSTEM_CPP_H
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 35c11c0d9b..c35502a157 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -113,7 +113,6 @@ struct PLUGININFOEX DWORD version;
char *description;
char *author;
- char *authorEmail;
char *copyright;
char *homepage;
BYTE flags; // right now the only flag, UNICODE_AWARE, is recognized here
|