summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-29 16:41:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-29 16:41:17 +0000
commit451c98173d83ee1618d7923890e803dd7067de40 (patch)
treeb747494401925ec184b45a6d22d24683d8b3e38f /plugins/SendScreenshotPlus/src
parent82637f50c80f6b9b7dad3d3d49535bab277596aa (diff)
resource clearance moved to ME_SYSTEM_PRESHUTDOWN instead of ME_SYSTEM_OKTOEXIT
git-svn-id: http://svn.miranda-ng.org/main/trunk@5527 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
-rw-r--r--plugins/SendScreenshotPlus/src/dlg_msgbox.cpp63
-rw-r--r--plugins/SendScreenshotPlus/src/mir_icolib.cpp56
-rw-r--r--plugins/SendScreenshotPlus/src/mir_string.cpp73
-rw-r--r--plugins/SendScreenshotPlus/src/mir_string.h58
4 files changed, 62 insertions, 188 deletions
diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp
index de6d03b297..4ada4d76e9 100644
--- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp
+++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp
@@ -112,77 +112,56 @@ void MakePopupAction(POPUPACTION &pa, INT id)
pa.wParam = MAKEWORD(id, BN_CLICKED);
pa.lParam = 0;
- switch (id)
- {
+ switch (id) {
case IDOK:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/Ok");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Ok");
break;
case IDCLOSE:
case IDCANCEL:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/Cancel");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Cancel");
break;
case IDABORT:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/Abort");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Abort");
break;
case IDRETRY:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_UPDATE);
- mir_strcpy(pa.lpzTitle, MODNAME"/Retry");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_UPDATE);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Retry");
break;
case IDIGNORE:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/Ignore");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Ignore");
break;
case IDYES:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/Yes");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Yes");
break;
case IDNO:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/No");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
+ lstrcpyA(pa.lpzTitle, MODNAME"/No");
break;
case IDHELP:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/Help");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
+ lstrcpyA(pa.lpzTitle, MODNAME"/Help");
break;
case IDALL:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
- mir_strcpy(pa.lpzTitle, MODNAME"/All");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_OK);
+ lstrcpyA(pa.lpzTitle, MODNAME"/All");
break;
case IDNONE:
- {
- pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
- mir_strcpy(pa.lpzTitle, MODNAME"/None");
- }
+ pa.lchIcon = IcoLib_GetIcon(ICO_PLUG_CANCEL);
+ lstrcpyA(pa.lpzTitle, MODNAME"/None");
}
}
diff --git a/plugins/SendScreenshotPlus/src/mir_icolib.cpp b/plugins/SendScreenshotPlus/src/mir_icolib.cpp
index 2523aa196c..041a84b7d0 100644
--- a/plugins/SendScreenshotPlus/src/mir_icolib.cpp
+++ b/plugins/SendScreenshotPlus/src/mir_icolib.cpp
@@ -26,48 +26,46 @@ this file is taken from UserinfoEx plugin and support UserinfoEx icon pack !!!!
#include "global.h"
+HICON ghDefIcon = NULL;
+
+//IDI_PLUG_MAIN must be the first icon from Plugin.dll, all other icon must be IDI_PLUG_MAIN+n
-typedef struct _ICODESC
+struct
{
LPSTR pszName;
LPSTR pszDesc;
LPSTR pszSection;
WORD idResource;
BYTE size;
-} ICODESC;
-
-HICON ghDefIcon = NULL;
-
-//IDI_PLUG_MAIN must be the first icon from Plugin.dll, all other icon must be IDI_PLUG_MAIN+n
-static ICODESC icoDesc[] =
+}
+static icoDesc[] =
{
// common
- { ICO_PLUG_SSWINDOW1, LPGEN("Screenshot Icon1"), SECT_COMMON, IDI_PLUG_MAIN, -1 },
- { ICO_PLUG_SSWINDOW2, LPGEN("Screenshot Icon2"), SECT_COMMON, IDI_PLUG_ICON1, 0 },
- { ICO_PLUG_SSTARGET, LPGEN("Target Cursor"), SECT_COMMON, IDI_PLUG_ICON2, 1 },
- { ICO_PLUG_SSMONITOR, LPGEN("Target Desktop"), SECT_COMMON, IDI_PLUG_ICON3, 1 },
- { ICO_PLUG_SSDEFAULT, LPGEN("Default"), SECT_COMMON, IDI_PLUG_DEFAULT, 0 },
+ { ICO_PLUG_SSWINDOW1, LPGEN("Screenshot Icon1"), SECT_COMMON, IDI_PLUG_MAIN, -1 },
+ { ICO_PLUG_SSWINDOW2, LPGEN("Screenshot Icon2"), SECT_COMMON, IDI_PLUG_ICON1, 0 },
+ { ICO_PLUG_SSTARGET, LPGEN("Target Cursor"), SECT_COMMON, IDI_PLUG_ICON2, 1 },
+ { ICO_PLUG_SSMONITOR, LPGEN("Target Desktop"), SECT_COMMON, IDI_PLUG_ICON3, 1 },
+ { ICO_PLUG_SSDEFAULT, LPGEN("Default"), SECT_COMMON, IDI_PLUG_DEFAULT, 0 },
// overlays
- { ICO_PLUG_OVERLAYON, LPGEN("overlay on"), SECT_OVERLAY, IDI_PLUG_OVERLAYON, 0 },
- { ICO_PLUG_OVERLAYOFF, LPGEN("overlay off"), SECT_OVERLAY, IDI_PLUG_OVERLAYOFF,0 },
+ { ICO_PLUG_OVERLAYON, LPGEN("overlay on"), SECT_OVERLAY, IDI_PLUG_OVERLAYON, 0 },
+ { ICO_PLUG_OVERLAYOFF, LPGEN("overlay off"), SECT_OVERLAY, IDI_PLUG_OVERLAYOFF, 0 },
// button icons
- { ICO_PLUG_SSHELP, LPGEN("Help"), SECT_BUTTONS, IDI_PLUG_HELP, 0 },
- { ICO_PLUG_SSFOLDERO, LPGEN("Open Folder"), SECT_BUTTONS, IDI_PLUG_FOLDERO, 0 },
- { ICO_PLUG_SSDESKOFF, LPGEN("description off"), SECT_BUTTONS, IDI_PLUG_DESKOFF, 0 },
- { ICO_PLUG_SSDESKON, LPGEN("description on"), SECT_BUTTONS, IDI_PLUG_DESKON, 0 },
- { ICO_PLUG_SSDELOFF, LPGEN("delete off"), SECT_BUTTONS, IDI_PLUG_DELOFF, 0 },
- { ICO_PLUG_SSDELON, LPGEN("delete on"), SECT_BUTTONS, IDI_PLUG_DELON, 0 },
- { ICO_PLUG_ARROWL, LPGEN("Prev"), SECT_BUTTONS, IDI_PLUG_ARROWL, 0 },
- { ICO_PLUG_ARROWR, LPGEN("Next"), SECT_BUTTONS, IDI_PLUG_ARROWR, 0 },
-
- { ICO_PLUG_UPDATE, LPGEN("Update"), SECT_BUTTONS, IDI_PLUG_UPDATE, 0 },
- { ICO_PLUG_OK, LPGEN("OK"), SECT_BUTTONS, IDI_PLUG_OK, 0 },
- { ICO_PLUG_CANCEL, LPGEN("Cancel"), SECT_BUTTONS, IDI_PLUG_CLOSE, 0 },
- { ICO_PLUG_APPLY, LPGEN("Apply"), SECT_BUTTONS, IDI_PLUG_APPLY, 0 },
- { ICO_PLUG_EDIT, LPGEN("Edit"), SECT_BUTTONS, IDI_PLUG_EDIT, 0 },
- { ICO_PLUG_DOWNARROW, LPGEN("Down arrow"), SECT_BUTTONS, IDI_PLUG_DOWNARROW, 0 },
+ { ICO_PLUG_SSHELP, LPGEN("Help"), SECT_BUTTONS, IDI_PLUG_HELP, 0 },
+ { ICO_PLUG_SSFOLDERO, LPGEN("Open Folder"), SECT_BUTTONS, IDI_PLUG_FOLDERO, 0 },
+ { ICO_PLUG_SSDESKOFF, LPGEN("description off"), SECT_BUTTONS, IDI_PLUG_DESKOFF, 0 },
+ { ICO_PLUG_SSDESKON, LPGEN("description on"), SECT_BUTTONS, IDI_PLUG_DESKON, 0 },
+ { ICO_PLUG_SSDELOFF, LPGEN("delete off"), SECT_BUTTONS, IDI_PLUG_DELOFF, 0 },
+ { ICO_PLUG_SSDELON, LPGEN("delete on"), SECT_BUTTONS, IDI_PLUG_DELON, 0 },
+ { ICO_PLUG_ARROWL, LPGEN("Prev"), SECT_BUTTONS, IDI_PLUG_ARROWL, 0 },
+ { ICO_PLUG_ARROWR, LPGEN("Next"), SECT_BUTTONS, IDI_PLUG_ARROWR, 0 },
+ { ICO_PLUG_UPDATE, LPGEN("Update"), SECT_BUTTONS, IDI_PLUG_UPDATE, 0 },
+ { ICO_PLUG_OK, LPGEN("OK"), SECT_BUTTONS, IDI_PLUG_OK, 0 },
+ { ICO_PLUG_CANCEL, LPGEN("Cancel"), SECT_BUTTONS, IDI_PLUG_CLOSE, 0 },
+ { ICO_PLUG_APPLY, LPGEN("Apply"), SECT_BUTTONS, IDI_PLUG_APPLY, 0 },
+ { ICO_PLUG_EDIT, LPGEN("Edit"), SECT_BUTTONS, IDI_PLUG_EDIT, 0 },
+ { ICO_PLUG_DOWNARROW, LPGEN("Down arrow"), SECT_BUTTONS, IDI_PLUG_DOWNARROW, 0 },
};
/**
diff --git a/plugins/SendScreenshotPlus/src/mir_string.cpp b/plugins/SendScreenshotPlus/src/mir_string.cpp
index 251b5fd45e..d3550e6a04 100644
--- a/plugins/SendScreenshotPlus/src/mir_string.cpp
+++ b/plugins/SendScreenshotPlus/src/mir_string.cpp
@@ -27,15 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "global.h"
-char *mir_strncpy(char *pszDest, const char *pszSrc, const size_t cchDest)
-{
- if (!pszDest || !pszSrc || !cchDest)
- return NULL;
- pszDest = strncpy(pszDest, pszSrc, cchDest-1);
- pszDest[cchDest-1] = 0;
- return pszDest;
-}
-
wchar_t *mir_wcsncpy(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDest)
{
if (!pszDest || !pszSrc || !cchDest)
@@ -45,15 +36,6 @@ wchar_t *mir_wcsncpy(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDe
return pszDest;
}
-char *mir_strncat(char *pszDest, const char *pszSrc, const size_t cchDest)
-{
- if (!pszDest || !pszSrc || !cchDest)
- return NULL;
- strncat(pszDest, pszSrc, cchDest-1);
- pszDest[cchDest-1] = 0;
- return pszDest;
-}
-
wchar_t *mir_wcsncat(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDest)
{
if (!pszDest || !pszSrc || !cchDest)
@@ -63,55 +45,14 @@ wchar_t *mir_wcsncat(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDe
return pszDest;
}
-char *mir_strncat_c(char *pszDest, const char cSrc) {
- size_t lenNew = strlen(pszDest) + 2;
- if (!pszDest)
- pszDest = (char *) mir_alloc(sizeof(char) * lenNew);
- else
- pszDest = (char *) mir_realloc(pszDest, sizeof(char) * lenNew);
- pszDest[lenNew-2] = cSrc;
- pszDest[lenNew-1] = 0;
- return pszDest;
-}
-
-wchar_t *mir_wcsncat_c(wchar_t *pwszDest, const wchar_t wcSrc) {
- size_t lenNew = wcslen(pwszDest) + 2;
- if (!pwszDest)
- pwszDest = (wchar_t *) mir_alloc(sizeof(wchar_t) * lenNew);
- else
- pwszDest = (wchar_t *) mir_realloc(pwszDest, sizeof(wchar_t) * lenNew);
- pwszDest[lenNew-2] = wcSrc;
- pwszDest[lenNew-1] = 0;
- return pwszDest;
-}
-
-char *mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo) {
- char *pszReturn = NULL;
- size_t sizeNew, sizeLen = strlen(pszDest);
- if (sizeFrom >= 0 && sizeFrom < sizeLen && sizeTo >= 0 && sizeTo <= sizeLen && sizeFrom < sizeTo) {
- sizeNew = sizeLen - (sizeTo - sizeFrom);
- size_t sizeCopy = sizeNew - sizeFrom;
- pszReturn = (char *) mir_alloc(sizeNew + 1);
- memcpy(pszReturn, pszDest, sizeFrom);
- memcpy(pszReturn + sizeFrom, pszDest + sizeTo, sizeCopy);
- pszReturn[sizeNew] = 0;
- }
-
- pszDest = (char *) mir_realloc(pszDest, sizeNew + 1);
- pszDest = mir_strcpy(pszDest, pszReturn);
- mir_free(pszReturn);
- return pszDest;
-}
-
//---------------------------------------------------------------------------
void mir_stradd(char* &pszDest, const char *pszSrc)
{
- if(!pszSrc) {
+ if(!pszSrc)
return;
- }
- else if(!pszDest) {
+
+ if(!pszDest)
pszDest = mir_strdup(pszSrc);
- }
else {
size_t lenDest = strlen(pszDest);
size_t lenSrc = strlen(pszSrc);
@@ -125,12 +66,11 @@ void mir_stradd(char* &pszDest, const char *pszSrc)
void mir_wcsadd(wchar_t* &pszDest, const wchar_t *pszSrc)
{
- if(!pszSrc) {
+ if(!pszSrc)
return;
- }
- else if(!pszDest) {
+
+ if(!pszDest)
pszDest = mir_wstrdup(pszSrc);
- }
else {
size_t lenDest = wcslen(pszDest);
size_t lenSrc = wcslen(pszSrc);
@@ -141,4 +81,3 @@ void mir_wcsadd(wchar_t* &pszDest, const wchar_t *pszSrc)
pszDest[lenNew-1] = 0;
}
}
-
diff --git a/plugins/SendScreenshotPlus/src/mir_string.h b/plugins/SendScreenshotPlus/src/mir_string.h
index c560048147..7c03b9dc48 100644
--- a/plugins/SendScreenshotPlus/src/mir_string.h
+++ b/plugins/SendScreenshotPlus/src/mir_string.h
@@ -1,7 +1,7 @@
/*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
This file is part of Send Screenshot Plus, a Miranda IM plugin.
Copyright (c) 2010 Ing.U.Horn
@@ -27,58 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef _MIR_STRING_H_INCLUDED_
#define _MIR_STRING_H_INCLUDED_
-#define mir_wcsdup mir_wstrdup
+#define mir_tcsadd mir_wcsadd
+#define mir_tcsncpy mir_wcsncpy
+#define mir_tcsncat mir_wcsncat
-
- #define mir_tcslen mir_wcslen
- #define mir_tcscpy mir_wcscpy
- #define mir_tcsncpy mir_wcsncpy
- #define mir_tcsncat mir_wcsncat
- #define mir_tcsdup mir_wcsdup
- #define mir_tcscmp mir_wcscmp
- #define mir_tcsncmp mir_wcsncmp
- #define mir_tcsicmp mir_wcsicmp
- #define mir_tcsnicmp mir_wcsnicmp
- #define mir_tcschr mir_wcschr
- #define mir_tcsrchr mir_wcsrchr
- #define mir_tcsncat_c mir_wcsncat_c
- #define mir_tcsadd mir_wcsadd
-
-
-
-#define mir_strlen(s) (((s)!=0)?strlen(s):0)
-#define mir_strcpy(d,s) (((s)!=0&&(d)!=0)?strcpy(d,s):0)
-#define mir_strcmp(s1,s2) ((s1)==0||(s2)==0||strcmp((s1),(s2)))
-#define mir_strncmp(s1,s2,n) ((s1)==0||(s2)==0||strncmp((s1),(s2),(n)))
-#define mir_stricmp(s1,s2) ((s1)==0||(s2)==0||_stricmp((s1),(s2)))
-#define mir_strnicmp(s1,s2,n) ((s1)==0||(s2)==0||_strnicmp((s1),(s2),(n)))
-#define mir_strchr(s,c) (((s)!=0)?strchr((s),(c)):0)
-#define mir_strrchr(s,c) (((s)!=0)?strrchr((s),(c)):0)
-
-#define mir_wcslen(s) (((s)!=0)?wcslen(s):0)
-#define mir_wcscpy(d,s) (((s)!=0&&(d)!=0)?wcscpy(d,s):0)
-#define mir_wcscmp(s1,s2) ((s1)==0||(s2)==0||wcscmp((s1),(s2)))
-#define mir_wcsncmp(s1,s2,n) ((s1)==0||(s2)==0||wcsncmp((s1),(s2),(n)))
-#define mir_wcsicmp(s1,s2) ((s1)==0||(s2)==0||_wcsicmp((s1),(s2)))
-#define mir_wcsnicmp(s1,s2,n) ((s1)==0||(s2)==0||_wcsnicmp((s1),(s2),(n)))
-#define mir_wcschr(s,c) (((s)!=0)?wcschr((s),(c)):0)
-#define mir_wcsrchr(s,c) (((s)!=0)?wcsrchr((s),(c)):0)
-
-//#define mir_free(ptr) (if (x) mmi.free(x); *(&(x)) = 0;}
#define mir_freeAndNil(ptr) {if(ptr) mir_free(ptr); ptr = NULL;}
-char * mir_strncpy(char *pszDest, const char *pszSrc, const size_t cchDest);
-wchar_t * mir_wcsncpy(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDest);
-
-char * mir_strncat(char *pszDest, const char *pszSrc, const size_t cchDest);
-wchar_t * mir_wcsncat(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDest);
-
-char * mir_strncat_c(char *pszDest, const char cSrc);
-char * mir_wcsncat_c(char *pszDest, const char cSrc);
-
-char * mir_strnerase(char *pszDest, size_t sizeFrom, size_t sizeTo);
+wchar_t* mir_wcsncpy(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDest);
+wchar_t* mir_wcsncat(wchar_t *pszDest, const wchar_t *pszSrc, const size_t cchDest);
-void mir_stradd(char * &pszDest, const char *pszSrc);
-void mir_wcsadd(wchar_t * &pszDest, const wchar_t *pszSrc);
+void mir_stradd(char * &pszDest, const char *pszSrc);
+void mir_wcsadd(wchar_t * &pszDest, const wchar_t *pszSrc);
#endif /* _MIR_STRING_H_INCLUDED_ */ \ No newline at end of file