summaryrefslogtreecommitdiff
path: root/plugins/ExternalAPI
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-03-31 19:11:08 +0300
committerMataes <mataes2007@gmail.com>2018-03-31 19:11:08 +0300
commita78e345c8eb7d73233e61900edaeacb34aa17bad (patch)
tree34125fd3bca70288c6c6fe7a9afd54e953397275 /plugins/ExternalAPI
parentbe11eb1671df3564bbe0e3c46f33d1867fbafc80 (diff)
AssocMgr: removed not used files and functions
Diffstat (limited to 'plugins/ExternalAPI')
-rw-r--r--plugins/ExternalAPI/m_assocmgr.h226
1 files changed, 85 insertions, 141 deletions
diff --git a/plugins/ExternalAPI/m_assocmgr.h b/plugins/ExternalAPI/m_assocmgr.h
index eabe570455..3cd384c188 100644
--- a/plugins/ExternalAPI/m_assocmgr.h
+++ b/plugins/ExternalAPI/m_assocmgr.h
@@ -36,109 +36,79 @@ Returns 0 on success, nonzero otherwise.
typedef struct {
int cbSize; // set to sizeof(FILETYPEDESC), in bytes
- union {
- const char *pszDescription; // description for options dialog and in registry.
- const TCHAR *ptszDescription; // please Translate(), use singular form here.
- const WCHAR *pwszDescription;
- };
+
+ const wchar_t *pwszDescription; // description for options dialog and in registry.
+
HINSTANCE hInstance; // instance of the calling module and where the icon
- // resource is located.
- // always be sure you set this to your own hInstance even if
- // you use the generic default icon
+ // resource is located.
+ // always be sure you set this to your own hInstance even if
+ // you use the generic default icon
UINT nIconResID; // resource id of an icon to use for the file type.
- // this icon should contain icons of all sizes and color depths
- // needed by Windows.
- // set this to 0 to use the generic 'miranda file' icon
- // provided by assocmgr.
+ // this icon should contain icons of all sizes and color depths
+ // needed by Windows.
+ // set this to 0 to use the generic 'miranda file' icon
+ // provided by assocmgr.
const char *pszService; // service to call when a file is opened
- // this service will be called with lParam set to
- // the file name being opened including path.
- // it can be assumed that the provided file name
- // is always the long path name.
- // return zero on suceess, nonzero on error.
- // Note: set this to NULL to pass the file name as
- // commandline argument to miranda32.exe (db file).
+ // this service will be called with lParam set to
+ // the file name being opened including path.
+ // it can be assumed that the provided file name
+ // is always the long path name.
+ // return zero on suceess, nonzero on error.
+ // Note: set this to NULL to pass the file name as
+ // commandline argument to miranda32.exe (db file).
DWORD flags; // see FTDF_* flags below
const char *pszFileExt; // file extension, e.g. ".ext"
- // first character must be a dot, assumed to be all lower case.
- // may only consist of ascii characters.
+ // first character must be a dot, assumed to be all lower case.
+ // may only consist of ascii characters.
const char *pszMimeType; // MIME type of the file, e.g. "application/x-icq"
- // may only consist of ascii characters.
- union {
- const char *pszVerbDesc; // description for the open verb e.g. "&Install".
- const TCHAR *ptszVerbDesc; // set this to NULL to use the default description.
- const WCHAR *pwszVerbDesc; // include an ampersand (&) character for a mnemonic key.
- }; // please Translate().
+ // may only consist of ascii characters.
+
+ const wchar_t *pwszVerbDesc; // description for the open verb e.g. "&Install".
+ // include an ampersand (&) character for a mnemonic key.
+ // please Translate().
} FILETYPEDESC;
#define FTDF_UNICODE 0x0001 // pszDescription and pszVerbDesc in struct are Unicode.
- // the specified service is called with Unicode parameters.
+// the specified service is called with Unicode parameters.
#define FTDF_DEFAULTDISABLED 0x0002 // file type is not registered by default, it needs to be
- // enabled explicitly on the options page.
+ // enabled explicitly on the options page.
#define FTDF_BROWSERAUTOOPEN 0x0004 // tells the browser to download and open the file directly
- // without prompt (currently IE and Opera6+) - be careful!
- // use only in conjunction with pszMimeType set.
- // this tells Windows that open can be safely invoked for
- // downloaded files.
- // Note that this flag may create a security risk,
- // because downloaded files could contain malicious content.
- // you need to protect against such an exploit.
+ // without prompt (currently IE and Opera6+) - be careful!
+ // use only in conjunction with pszMimeType set.
+ // this tells Windows that open can be safely invoked for
+ // downloaded files.
+ // Note that this flag may create a security risk,
+ // because downloaded files could contain malicious content.
+ // you need to protect against such an exploit.
#define FTDF_ISTEXT 0x0008 // tells Windows that this file can be opened
- // as a text file using e.g Notepad.
- // only has an effect on Windows XP and higher.
+ // as a text file using e.g Notepad.
+ // only has an effect on Windows XP and higher.
#define FTDF_ISSHORTCUT 0x0010 // file type behaves as shortcut, this means a
- // small overlay arrow is applied and the extension is never shown
-
-#if defined(_UNICODE)
- #define FTDF_TCHAR FTDF_UNICODE // strings in struct are WCHAR*, service accepts WCHAR*
-#else
- #define FTDF_TCHAR 0 // strings in struct are char*, service accepts char*
-#endif
+ // small overlay arrow is applied and the extension is never shown
-#if !defined(ASSOCMGR_NOHELPERFUNCTIONS)
-__inline static int AssocMgr_AddNewFileType(const char *ext,const char *mime,const char *desc,const char *verb,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+__inline static int AssocMgr_AddNewFileTypeW(const char *ext, const char *mime, const wchar_t *desc, const wchar_t *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
FILETYPEDESC ftd;
- ftd.cbSize=sizeof(FILETYPEDESC);
- ftd.pszFileExt=ext;
- ftd.pszMimeType=mime;
- ftd.pszDescription=desc;
- ftd.pszVerbDesc=verb;
- ftd.hInstance=hinst;
- ftd.nIconResID=iconid;
- ftd.pszService=service;
- ftd.flags=flags&~FTDF_UNICODE;
- return CallService(MS_ASSOCMGR_ADDNEWFILETYPE,0,(LPARAM)&ftd);
+ ftd.cbSize = sizeof(FILETYPEDESC);
+ ftd.pszFileExt = ext;
+ ftd.pszMimeType = mime;
+ ftd.pwszDescription = desc;
+ ftd.pwszVerbDesc = verb;
+ ftd.hInstance = hinst;
+ ftd.nIconResID = iconid;
+ ftd.pszService = service;
+ ftd.flags = flags | FTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWFILETYPE, 0, (LPARAM)&ftd);
}
-__inline static int AssocMgr_AddNewFileTypeW(const char *ext,const char *mime,const WCHAR *desc,const WCHAR *verb,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
-{
- FILETYPEDESC ftd;
- ftd.cbSize=sizeof(FILETYPEDESC);
- ftd.pszFileExt=ext;
- ftd.pszMimeType=mime;
- ftd.pwszDescription=desc;
- ftd.pwszVerbDesc=verb;
- ftd.hInstance=hinst;
- ftd.nIconResID=iconid;
- ftd.pszService=service;
- ftd.flags=flags|FTDF_UNICODE;
- return CallService(MS_ASSOCMGR_ADDNEWFILETYPE,0,(LPARAM)&ftd);
-}
-#if defined(_UNICODE)
- #define AssocMgr_AddNewFileTypeT AssocMgr_AddNewFileTypeW
-#else
- #define AssocMgr_AddNewFileTypeT AssocMgr_AddNewFileType
-#endif
-#endif
/* Remove a file type v0.1.0.0+
Remove a file type registered previously using
@@ -163,75 +133,49 @@ Returns 0 on success, nonzero otherwise.
typedef struct {
int cbSize; // set to sizeof(URLTYPEDESC), in bytes
- union {
- const char *pszDescription; // description for options dialog and in registry.
- const TCHAR *ptszDescription; // please Translate(), use singular form here.
- const WCHAR *pwszDescription;
- };
+
+ const wchar_t *pwszDescription; // description for options dialog and in registry.
+
HINSTANCE hInstance; // instance of the calling module and where the icon
- // resource is located.
- // always be sure you set this to your own hInstance even if
- // you use the generic default icon
+ // resource is located.
+ // always be sure you set this to your own hInstance even if
+ // you use the generic default icon
UINT nIconResID; // resource id of an icon to use for the url type.
- // only a small one (16x16) is needed by Windows,
- // e.g. proto icon as used in Miranda.
- // set this to 0 to use the default miranda icon.
+ // only a small one (16x16) is needed by Windows,
+ // e.g. proto icon as used in Miranda.
+ // set this to 0 to use the default miranda icon.
const char *pszService; // service to call when a url is opened (can't be NULL)
- // this service will be called with lParam set to
- // the url being opened including the prefix.
- // return zero on suceess, nonzero on error.
+ // this service will be called with lParam set to
+ // the url being opened including the prefix.
+ // return zero on suceess, nonzero on error.
DWORD flags; // see UTDF_* flags below
const char *pszProtoPrefix; // protocol prefix, e.g. "http:"
- // last character must be a colon, assumed to be all lower case.
- // may only consist of ascii characters.
+ // last character must be a colon, assumed to be all lower case.
+ // may only consist of ascii characters.
} URLTYPEDESC;
#define UTDF_UNICODE 0x0001 // pszDescription in struct is Unicode.
- // the specified service is called with Unicode parameters.
+// the specified service is called with Unicode parameters.
#define UTDF_DEFAULTDISABLED 0x0002 // url type is not registered by default, it needs to be
- // enabled explicitly on the options page.
-#if defined(_UNICODE)
- #define UTDF_TCHAR UTDF_UNICODE // strings in struct are WCHAR*, service accepts WCHAR*
-#else
- #define UTDF_TCHAR 0 // strings in struct are char*, service accepts char*
-#endif
+ // enabled explicitly on the options page.
-#if !defined(ASSOCMGR_NOHELPERFUNCTIONS)
-static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+static int __inline AssocMgr_AddNewUrlTypeW(const char *prefix, const wchar_t *desc, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
URLTYPEDESC utd;
- utd.cbSize=sizeof(URLTYPEDESC);
- utd.pszProtoPrefix=prefix;
- utd.pszDescription=desc;
- utd.hInstance=hinst;
- utd.nIconResID=iconid;
- utd.pszService=service;
- utd.flags=flags&~UTDF_UNICODE;
- return CallService(MS_ASSOCMGR_ADDNEWURLTYPE,0,(LPARAM)&utd);
+ utd.cbSize = sizeof(URLTYPEDESC);
+ utd.pszProtoPrefix = prefix;
+ utd.pwszDescription = desc;
+ utd.hInstance = hinst;
+ utd.nIconResID = iconid;
+ utd.pszService = service;
+ utd.flags = flags | UTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWURLTYPE, 0, (LPARAM)&utd);
}
-static int __inline AssocMgr_AddNewUrlTypeW(const char *prefix,const WCHAR *desc,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
-{
- URLTYPEDESC utd;
- utd.cbSize=sizeof(URLTYPEDESC);
- utd.pszProtoPrefix=prefix;
- utd.pwszDescription=desc;
- utd.hInstance=hinst;
- utd.nIconResID=iconid;
- utd.pszService=service;
- utd.flags=flags|UTDF_UNICODE;
- return CallService(MS_ASSOCMGR_ADDNEWURLTYPE,0,(LPARAM)&utd);
-}
-#if defined(_UNICODE)
- #define AssocMgr_AddNewUrlTypeT AssocMgr_AddNewUrlTypeW
-#else
- #define AssocMgr_AddNewUrlTypeT AssocMgr_AddNewUrlType
-#endif
-#endif
/* Remove an url protocol type v0.1.0.0+
Remove an url registered previously using
@@ -248,19 +192,19 @@ Returns 0 on success, nonzero otherwise.
#if defined(MoveMemory) && defined(lstrlen)
static __inline char *Netlib_UrlDecode(char *str)
{
- char *psz=str;
- for (;*psz;++psz)
- switch(*psz) {
- case '+':
- *psz=' ';
- break;
- case '%':
- if (!psz[1] || !psz[2]) break;
- MoveMemory(psz,&psz[1],2);
- psz[2]=0;
- *psz=(char)strtol(psz, nullptr,16);
- MoveMemory(&psz[1],&psz[3],mir_strlen(&psz[3])+1);
- break;
+ char *psz = str;
+ for (; *psz; ++psz)
+ switch (*psz) {
+ case '+':
+ *psz = ' ';
+ break;
+ case '%':
+ if (!psz[1] || !psz[2]) break;
+ MoveMemory(psz, &psz[1], 2);
+ psz[2] = 0;
+ *psz = (char)strtol(psz, nullptr, 16);
+ MoveMemory(&psz[1], &psz[3], mir_strlen(&psz[3]) + 1);
+ break;
}
return str;
}