summaryrefslogtreecommitdiff
path: root/plugins/Popup/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-01 12:56:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-01 12:56:22 +0000
commit70e0c09fcffa5520d3cfdc4708c81248b135c796 (patch)
tree6d000d835ddf3c890d1d23a7f946fd62111f8497 /plugins/Popup/src
parent4a58d85d8dd5f120eb0d0c429e0b46cdeb25c629 (diff)
- more warning fixes;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@11191 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r--plugins/Popup/src/actions.cpp6
-rw-r--r--plugins/Popup/src/bitmap_funcs.cpp4
-rw-r--r--plugins/Popup/src/config.cpp32
-rw-r--r--plugins/Popup/src/def_settings.h12
-rw-r--r--plugins/Popup/src/effects.cpp1
-rw-r--r--plugins/Popup/src/font.cpp9
-rw-r--r--plugins/Popup/src/history.cpp2
-rw-r--r--plugins/Popup/src/icons.cpp2
-rw-r--r--plugins/Popup/src/main.cpp193
-rw-r--r--plugins/Popup/src/notifications.cpp6
-rw-r--r--plugins/Popup/src/opt_adv.cpp98
-rw-r--r--plugins/Popup/src/opt_class.cpp90
-rw-r--r--plugins/Popup/src/opt_contacts.cpp8
-rw-r--r--plugins/Popup/src/opt_gen.cpp84
-rw-r--r--plugins/Popup/src/opt_skins.cpp96
-rw-r--r--plugins/Popup/src/opttree.cpp12
-rw-r--r--plugins/Popup/src/popup_gdiplus.cpp34
-rw-r--r--plugins/Popup/src/popup_thread.cpp19
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp84
-rw-r--r--plugins/Popup/src/services.cpp14
-rw-r--r--plugins/Popup/src/skin.cpp24
-rw-r--r--plugins/Popup/src/version.h2
22 files changed, 407 insertions, 425 deletions
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp
index 9bd52deea2..f92a72bfdf 100644
--- a/plugins/Popup/src/actions.cpp
+++ b/plugins/Popup/src/actions.cpp
@@ -44,7 +44,7 @@ void LoadActions()
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE, 0), "General/Dismiss popup", 0},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_COPY, 0), "General/Copy to clipboard", 0},
- //remove popup action
+ // remove popup action
#if defined(_DEBUG)
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_POPUP_ON, 0), "Popup Plus/Test action", PAF_ENABLED},
{ sizeof(POPUPACTION), IcoLib_GetIcon(ICO_ACT_CLOSE, 0), "Popup Plus/Second test action", 0},
@@ -246,7 +246,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
group.mask = LVGF_HEADER | LVGF_GROUPID;
LPTSTR wszGroup = mir_a2t(szGroup);
group.pszHeader = TranslateTS(wszGroup);
- group.cchHeader = mir_tstrlen(wszGroup);
+ group.cchHeader = (int)mir_tstrlen(wszGroup);
grpId = group.iGroupId = groups.getCount();
int grpId = ListView_InsertGroup(hwndList, -1, &group);
mir_free(wszGroup);
@@ -357,7 +357,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
db_set_b(NULL, "PopupActions", gActions[i]->lpzTitle, (gActions[i]->flags & PAF_ENABLED) ? 1 : 0);
}
- //overrideActions
+ // overrideActions
db_set_dw(NULL, MODULNAME, "OverrideLeft", PopupOptions.overrideLeft);
db_set_dw(NULL, MODULNAME, "OverrideMiddle", PopupOptions.overrideMiddle);
db_set_dw(NULL, MODULNAME, "OverrideRight", PopupOptions.overrideRight);
diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp
index fe3a281f32..ae34336679 100644
--- a/plugins/Popup/src/bitmap_funcs.cpp
+++ b/plugins/Popup/src/bitmap_funcs.cpp
@@ -596,10 +596,10 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
void MyBitmap::Draw_Text(TCHAR *str, int x, int y)
{
- SIZE sz; GetTextExtentPoint32(this->getDC(), str, mir_tstrlen(str), &sz);
+ SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000);
this->saveAlpha(x, y, sz.cx, sz.cy);
- DrawText(this->getDC(), str, mir_tstrlen(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
+ DrawText(this->getDC(), str, (int)mir_tstrlen(str), &rc, DT_LEFT | DT_TOP | DT_SINGLELINE | DT_NOPREFIX);
this->restoreAlpha(x, y, sz.cx, sz.cy);
}
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp
index 33374c027f..c3f5a44151 100644
--- a/plugins/Popup/src/config.cpp
+++ b/plugins/Popup/src/config.cpp
@@ -23,10 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
-//===== General Plugin =====
+// ===== General Plugin =====
HINSTANCE hInst;
HANDLE hMainThread;
-//MNOTIFYLINK *notifyLink; //deprecatet
+// MNOTIFYLINK *notifyLink; // deprecatet
HANDLE hSemaphore;
BOOL closing = FALSE;
@@ -35,17 +35,17 @@ HANDLE folderId;
BOOL gbPopupLoaded = FALSE;
BOOL gbHppInstalled = FALSE;
-//===== Brushes, Colours and Fonts =====
+// ===== Brushes, Colours and Fonts =====
HBITMAP hbmNoAvatar;
-//===== Options =====
+// ===== Options =====
POPUPOPTIONS PopupOptions;
-//SKINELEMENT *skin;
-//SKINELEMENT *w_skin;
-//SKINELEMENT *n_skin;
+// SKINELEMENT *skin;
+// SKINELEMENT *w_skin;
+// SKINELEMENT *n_skin;
-//===== Plugin information =====
+// ===== Plugin information =====
PLUGININFOEX pluginInfoEx =
{
@@ -58,23 +58,23 @@ PLUGININFOEX pluginInfoEx =
__COPYRIGHT,
__AUTHORWEB,
UNICODE_AWARE,
- // {26A9125D-7863-4E01-AF0E-D14EF95C5054}
+ // {26A9125D-7863-4E01-AF0E-D14EF95C5054}
{0x26a9125d, 0x7863, 0x4e01, {0xaf, 0xe, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54}}
};
HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
-//====== Common Vars ========================
+// ====== Common Vars ========================
-// common funcs
+// common funcs
void LoadOptions() {
memset(&PopupOptions, 0, sizeof(PopupOptions));
#if defined(_DEBUG)
PopupOptions.debug = db_get_b(NULL, MODULNAME, "debug", FALSE);
#endif
- //Load Popup Options
+ // Load Popup Options
if (!OptionLoaded){
LoadOption_General();
LoadOption_Skins();
@@ -106,7 +106,7 @@ void PopupPreview()
ppd.lptzText = lptzText1Eng;
ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
- if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+ if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); // Pause
memset(&ppd, 0, sizeof(ppd));
ppd.cbSize = sizeof(ppd);
@@ -117,13 +117,13 @@ void PopupPreview()
ppd.hbmAvatar = hbmNoAvatar;
CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY);
- if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+ if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); // Pause
PUShowMessageT(TranslateT("This is a notification message"), (DWORD)SM_NOTIFY|0x80000000);
- if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+ if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); // Pause
PUShowMessageT(TranslateT("This is a warning message"), (DWORD)SM_WARNING|0x80000000);
- if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
+ if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME*2)/3); // Pause
PUShowMessageT(TranslateT("This is an error message"), (DWORD)SM_ERROR|0x80000000);
}
diff --git a/plugins/Popup/src/def_settings.h b/plugins/Popup/src/def_settings.h
index 9d09e9f9ee..2bfc5d7cf1 100644
--- a/plugins/Popup/src/def_settings.h
+++ b/plugins/Popup/src/def_settings.h
@@ -28,7 +28,7 @@ enum
STYLE_FC_BEVELED,
STYLE_FC_FLAT,
- //ranges:
+ // ranges:
STYLE_FC_MIN = STYLE_FC_BEVELED,
STYLE_FC_MAX = STYLE_FC_FLAT
};
@@ -46,7 +46,7 @@ enum
// STYLE_SZ_CLOCKW = 7,
// STYLE_SZ_CLOCK = 2 + 3 + 4 * STYLE_SZ_CLOCKW + 2,
- //Text and Name are style dependant.
+ // Text and Name are style dependant.
STYLE_SZ_TEXTW_FLAT = 146,
STYLE_SZ_NAMEW_FLAT = 101,
STYLE_SZ_TEXTW_BEVELED = 125,
@@ -66,7 +66,7 @@ enum
POS_UPPERRIGHT,
POS_CENTER,
- //ranges
+ // ranges
POS_MINVALUE = POS_UPPERLEFT,
POS_MAXVALUE = POS_CENTER
};
@@ -92,8 +92,8 @@ enum
};
enum
{
- TIMER_TIMETOLIVE = 26378, //My Birthday, send me something 8)
- TIMER_TESTCHANGE = 60477, //You know who you are.
+ TIMER_TIMETOLIVE = 26378, // My Birthday, send me something 8)
+ TIMER_TESTCHANGE = 60477, // You know who you are.
ANIM_TIME = 250,
FADE_TIME = (ANIM_TIME),
@@ -105,7 +105,7 @@ enum
UM_SETDLGITEMINT = 5674
};
-//Defaults:
+// Defaults:
enum
{
SETTING_BACKCOLOUR_DEFAULT = RGB(173,206,247),
diff --git a/plugins/Popup/src/effects.cpp b/plugins/Popup/src/effects.cpp
index 42fc307b16..1d1b329af9 100644
--- a/plugins/Popup/src/effects.cpp
+++ b/plugins/Popup/src/effects.cpp
@@ -74,7 +74,6 @@ public:
virtual void destroy() { delete this; }
};
-//template<class T> static int svcCreateEffect(WPARAM, LPARAM) { return (int)(new T); }
static INT_PTR svcCreateEffect_MyTestEffect(WPARAM, LPARAM) { return (INT_PTR)(new MyTestEffect); }
void PopupEfectsInitialize()
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp
index 4e821502c4..716472f9fd 100644
--- a/plugins/Popup/src/font.cpp
+++ b/plugins/Popup/src/font.cpp
@@ -46,27 +46,22 @@ void InitFonts() {
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), SIZEOF(fid.name));
mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
- //fid.deffontsettings.style = DBFONTF_BOLD;
- //fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), SIZEOF(fid.name));
mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
- fid.deffontsettings.style = 0;
- //fid.deffontsettings.colour = RGB(0, 0, 0);
+ fid.deffontsettings.style = 0;
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), SIZEOF(fid.name));
mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
- //fid.deffontsettings.style = 0;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), SIZEOF(fid.name));
mir_snprintf(fid.prefix, SIZEOF(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
- //fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
ColourIDT cid = {0};
@@ -131,7 +126,7 @@ void ReloadFonts()
mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, SIZEOF(cid.name));
fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf);
- //update class popupps(only temp at this point, must rework)
+ // update class popupps(only temp at this point, must rework)
char setting[256];
for (int i = 0; i < gTreeData.getCount(); i++) {
if (gTreeData[i]->typ == 2) {
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp
index b9c52023b1..edc3a66d0b 100644
--- a/plugins/Popup/src/history.cpp
+++ b/plugins/Popup/src/history.cpp
@@ -416,5 +416,5 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&ieWindow);
}
}
- return FALSE; //DefWindowProc(hwnd, msg, wParam, lParam);
+ return FALSE; // DefWindowProc(hwnd, msg, wParam, lParam);
}
diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp
index 8beaa5ef7f..5d9432a700 100644
--- a/plugins/Popup/src/icons.cpp
+++ b/plugins/Popup/src/icons.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static IconItem iconList[] =
{
- //toolbar
+ // toolbar
{ LPGEN("Popups are enabled"), ICO_TB_POPUP_ON, IDI_POPUP },
{ LPGEN("Popups are disabled"), ICO_TB_POPUP_OFF, IDI_NOPOPUP },
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 8272df4782..3680e6ee42 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -29,82 +29,72 @@ WORD SETTING_MAXIMUMWIDTH_MAX = GetSystemMetrics(SM_CXSCREEN);
HANDLE hEventNotify;
-//===== MessageBoxes =====
-//void MB(char*); //This one is for Debug purposes
-//void Log(char*); //This one is used to notify the user
-//void HigherLower(int, int); //Used for integer input boxes (out of bound values).
-//void NotifyError(DWORD, char*, int, char*); //Used to notify an error giving some error codes to report.
-
-//===== Options =====
+//===== Options =========================================================================
static int OptionsInitialize(WPARAM,LPARAM);
void UpgradeDb();
-//===== Initializations =====
+//===== Initializations =================================================================
static int OkToExit(WPARAM,LPARAM);
bool OptionLoaded = false;
int hLangpack = 0;
-//===== Global variables =====
-//===== DLLs =====
-HMODULE hUserDll = 0;
-HMODULE hMsimgDll = 0;
-HMODULE hKernelDll = 0;
-HMODULE hGdiDll = 0;
-HMODULE hDwmapiDll = 0;
+//===== Global variables ================================================================
+HMODULE hUserDll = 0;
+HMODULE hMsimgDll = 0;
+HMODULE hKernelDll = 0;
+HMODULE hGdiDll = 0;
+HMODULE hDwmapiDll = 0;
-//===== User wnd class =====
GLOBAL_WND_CLASSES g_wndClass = {0};
-//===== MTextControl ====
-HANDLE htuText;
-HANDLE htuTitle;
+HANDLE htuText;
+HANDLE htuTitle;
-//===== Menu item =====
HGENMENU hMenuRoot;
HGENMENU hMenuItem;
HGENMENU hMenuItemHistory;
-//===== Event Handles =====
-HANDLE hTTButton;
+HANDLE hTTButton;
+
+//===== Options pages ===================================================================
-//===== Options pages =====
static int OptionsInitialize(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.position = 100000000;
+ odp.position = 100000000;
odp.groupPosition = 910000000;
- odp.hInstance = hInst;
- odp.flags = ODPF_BOLDGROUPS;
- odp.pszTitle = MODULNAME_PLU;
+ odp.hInstance = hInst;
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.pszTitle = MODULNAME_PLU;
- odp.pszTab = LPGEN("General");
- odp.pfnDlgProc = DlgProcPopupGeneral;
+ odp.pszTab = LPGEN("General");
+ odp.pfnDlgProc = DlgProcPopupGeneral;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP_GENERAL);
Options_AddPage(wParam, &odp);
- odp.pszTab = LPGEN("Classes");
- odp.pfnDlgProc = DlgProcOptsClasses;
+ odp.pszTab = LPGEN("Classes");
+ odp.pfnDlgProc = DlgProcOptsClasses;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFICATIONS);
Options_AddPage(wParam, &odp);
- odp.pszTab = LPGEN("Actions");
- odp.pfnDlgProc = DlgProcPopupActions;
+ odp.pszTab = LPGEN("Actions");
+ odp.pfnDlgProc = DlgProcPopupActions;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACTIONS);
Options_AddPage(wParam, &odp);
- odp.pszTab = LPGEN("Contacts");
- odp.pfnDlgProc = DlgProcContactOpts;
+ odp.pszTab = LPGEN("Contacts");
+ odp.pfnDlgProc = DlgProcContactOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTACTS);
Options_AddPage(wParam, &odp);
- odp.pszTab = LPGEN("Advanced");
- odp.pfnDlgProc = DlgProcPopupAdvOpts;
+ odp.pszTab = LPGEN("Advanced");
+ odp.pfnDlgProc = DlgProcPopupAdvOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP_ADVANCED);
Options_AddPage(wParam, &odp);
- odp.pszGroup = LPGEN("Skins");
- odp.pszTab = LPGEN(MODULNAME_PLU);
- odp.pfnDlgProc = DlgProcPopSkinsOpts;
+ odp.pszGroup = LPGEN("Skins");
+ odp.pszTab = LPGEN(MODULNAME_PLU);
+ odp.pfnDlgProc = DlgProcPopSkinsOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN2);
Options_AddPage(wParam, &odp);
return 0;
@@ -121,12 +111,12 @@ static int IconsChanged(WPARAM, LPARAM)
LoadActions();
CLISTMENUITEM mi = { sizeof(mi) };
- if (PopupOptions.ModuleIsEnabled == TRUE) { //The module is enabled.
- //The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
+ if (PopupOptions.ModuleIsEnabled == TRUE) { // The module is enabled.
+ // The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_ON, 0);
}
- else { //The module is disabled.
- //The action to do is enable popups (show enabled), then write "disable popup" in the new item.
+ else { // The module is disabled.
+ // The action to do is enable popups (show enabled), then write "disable popup" in the new item.
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF, 0);
}
mi.flags = CMIM_ICON;
@@ -156,21 +146,21 @@ static int TTBLoaded(WPARAM, LPARAM)
return 0;
}
-//===== EnableDisableMenuCommand =====
+//===== EnableDisableMenuCommand ========================================================
INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
if (PopupOptions.ModuleIsEnabled) {
- //The module is enabled.
- //The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
+ // The module is enabled.
+ // The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item.
PopupOptions.ModuleIsEnabled = FALSE;
db_set_b(NULL, "Popup", "ModuleIsEnabled", FALSE);
mi.ptszName = LPGENT("Enable Popups");
mi.hIcon = IcoLib_GetIcon(ICO_POPUP_OFF,0);
}
else {
- //The module is disabled.
- //The action to do is enable popups (show enabled), then write "disable popup" in the new item.
+ // The module is disabled.
+ // The action to do is enable popups (show enabled), then write "disable popup" in the new item.
PopupOptions.ModuleIsEnabled = TRUE;
db_set_b(NULL, "Popup", "ModuleIsEnabled", TRUE);
mi.ptszName = LPGENT("Disable Popups");
@@ -197,42 +187,40 @@ void InitMenuItems(void)
{
CLISTMENUITEM mi = { sizeof(mi) };
// support new genmenu style
- mi.flags = CMIF_ROOTHANDLE|CMIF_TCHAR;
- mi.hParentMenu = HGENMENU_ROOT;
+ mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
+ mi.hParentMenu = HGENMENU_ROOT;
// Build main menu
- mi.position = -1000000000 /*1000001*/;
- mi.ptszName = LPGENT(MODULNAME_PLU);
- mi.hIcon = IcoLib_GetIcon(PopupOptions.ModuleIsEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF ,0);
- hMenuRoot = Menu_AddMainMenuItem(&mi);
+ mi.position = -1000000000 /*1000001*/;
+ mi.ptszName = LPGENT(MODULNAME_PLU);
+ mi.hIcon = IcoLib_GetIcon(PopupOptions.ModuleIsEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0);
+ hMenuRoot = Menu_AddMainMenuItem(&mi);
// Add item to main menu
- mi.hParentMenu = (HGENMENU)hMenuRoot;
+ mi.hParentMenu = (HGENMENU)hMenuRoot;
CreateServiceFunction(MENUCOMMAND_SVC, svcEnableDisableMenuCommand);
- mi.ptszName = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups");
- mi.pszService = MENUCOMMAND_SVC;
- hMenuItem = Menu_AddMainMenuItem(&mi);
+ mi.ptszName = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups");
+ mi.pszService = MENUCOMMAND_SVC;
+ hMenuItem = Menu_AddMainMenuItem(&mi);
// Popup History
CreateServiceFunction(MENUCOMMAND_HISTORY, svcShowHistory);
- mi.position = 1000000000;
- mi.popupPosition = 1999990000;
- mi.ptszName = LPGENT("Popup History");
- mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
- mi.pszService = MENUCOMMAND_HISTORY;
- hMenuItemHistory = Menu_AddMainMenuItem(&mi);
-
+ mi.position = 1000000000;
+ mi.popupPosition = 1999990000;
+ mi.ptszName = LPGENT("Popup History");
+ mi.hIcon = IcoLib_GetIcon(ICO_HISTORY, 0);
+ mi.pszService = MENUCOMMAND_HISTORY;
+ hMenuItemHistory = Menu_AddMainMenuItem(&mi);
}
-//===== GetStatus =====
+//===== GetStatus =======================================================================
INT_PTR GetStatus(WPARAM, LPARAM)
{
return PopupOptions.ModuleIsEnabled;
}
-
-//register Hotkey
+// register Hotkey
void LoadHotkey()
{
HOTKEYDESC hk = { sizeof(hk) };
@@ -250,40 +238,42 @@ void LoadHotkey()
Hotkey_Register(&hk);
}
-//menu
-//Function which makes the initializations
+// menu
+// Function which makes the initializations
static int ModulesLoaded(WPARAM,LPARAM)
{
- //check if History++ is installed
+ // check if History++ is installed
gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) &&
(CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112));
- //check if MText plugin is installed
+
+ // check if MText plugin is installed
+ mir_getMTI(&MText);
if (MText.Register) {
htuText = MText.Register("Popup Plus/Text", MTEXT_FANCY_DEFAULT);
htuTitle = MText.Register("Popup Plus/Title",MTEXT_FANCY_DEFAULT);
}
else htuTitle = htuText = NULL;
- //check if OptionLoaded
+ // check if OptionLoaded
if (!OptionLoaded)
LoadOptions();
- //Uninstalling purposes
+ // Uninstalling purposes
if (ServiceExists("PluginSweeper/Add"))
CallService("PluginSweeper/Add", (WPARAM)Translate(MODULNAME), (LPARAM)MODULNAME);
- //load fonts / create hook
+ // load fonts / create hook
InitFonts();
HookEvent(ME_FONT_RELOAD, FontsChanged);
- //load actions and notifications
+ // load actions and notifications
LoadActions();
LoadNotifications();
- //hook TopToolBar
+ // hook TopToolBar
HookEvent(ME_TTB_MODULELOADED, TTBLoaded);
- //Folder plugin support
+ // Folder plugin support
folderId = FoldersRegisterCustomPathT(LPGEN("Skins"), LPGEN("Popup Plus"), MIRANDA_PATHT _T("\\Skins\\Popup"));
- //load skin
+ // load skin
skins.load(_T("dir"));
const PopupSkin *skin;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
@@ -291,35 +281,35 @@ static int ModulesLoaded(WPARAM,LPARAM)
PopupOptions.SkinPack = mir_tstrdup(skin->getName());
skin->loadOpts();
}
- //init PopupEfects
+ // init PopupEfects
PopupEfectsInitialize();
- //MessageAPI support
+ // MessageAPI support
SrmmMenu_Load();
- //Hotkey
+ // Hotkey
LoadHotkey();
gbPopupLoaded = TRUE;
return 0;
}
-//=== DllMain =====
-//DLL entry point, Required to store the instance handle
+//=== DllMain ===========================================================================
+// DLL entry point, Required to store the instance handle
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
return TRUE;
}
-//===== MirandaPluginInfo =====
-//Called by Miranda to get the information associated to this plugin.
-//It only returns the PLUGININFOEX structure, without any test on the version
-//@param mirandaVersion - The version of the application calling this function
+//===== MirandaPluginInfo ===============================================================
+// Called by Miranda to get the information associated to this plugin.
+// It only returns the PLUGININFOEX structure, without any test on the version
+// @param mirandaVersion - The version of the application calling this function
MIRAPI PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfoEx;
}
-//called before the app goes into shutdown routine to make sure everyone is happy to exit
+// called before the app goes into shutdown routine to make sure everyone is happy to exit
static int OkToExit(WPARAM, LPARAM)
{
closing = TRUE;
@@ -334,14 +324,13 @@ static int OnShutdown(WPARAM, LPARAM)
return 0;
}
-//===== Load =====
-//Initializes the services provided and the link to those needed
-//Called when the plugin is loaded into Miranda
+//===== Load ============================================================================
+// Initializes the services provided and the link to those needed
+// Called when the plugin is loaded into Miranda
MIRAPI int Load(void)
{
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
- mir_getMTI(&MText);
mir_getLP(&pluginInfoEx);
CreateServiceFunction(MS_POPUP_GETSTATUS, GetStatus);
@@ -353,7 +342,7 @@ MIRAPI int Load(void)
#endif
LoadGDIPlus();
- //Transparent and animation routines
+ // Transparent and animation routines
hDwmapiDll = LoadLibrary(_T("dwmapi.dll"));
MyDwmEnableBlurBehindWindow = 0;
if (hDwmapiDll)
@@ -363,7 +352,7 @@ MIRAPI int Load(void)
LoadPopupThread();
if (!LoadPopupWnd2()) {
MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
- return 0; //We couldn't register our Window Class, don't hook any event: the plugin will act as if it was disabled.
+ return 0; // We couldn't register our Window Class, don't hook any event: the plugin will act as if it was disabled.
}
RegisterOptPrevBox();
@@ -380,7 +369,7 @@ MIRAPI int Load(void)
if (!OptionLoaded)
LoadOptions();
- //Service Functions
+ // Service Functions
hEventNotify = CreateHookableEvent(ME_POPUP_FILTER);
CreateServiceFunction(MS_POPUP_ADDPOPUP, Popup_AddPopup);
@@ -410,18 +399,18 @@ MIRAPI int Load(void)
CreateServiceFunction(MS_POPUP_UNREGISTERCLASS, Popup_UnregisterPopupClass);
CreateServiceFunction(MS_POPUP_ADDPOPUPCLASS, Popup_CreateClassPopup);
- //load icons / create hook
+ // load icons / create hook
InitIcons();
HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
- //add menu items
+ // add menu items
InitMenuItems();
return 0;
}
-//===== Unload =====
-//Prepare the plugin to stop
-//Called by Miranda when it will exit or when the plugin gets deselected
+//===== Unload ==========================================================================
+// Prepare the plugin to stop
+// Called by Miranda when it will exit or when the plugin gets deselected
MIRAPI int Unload(void)
{
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index 0008852e25..a789b56e56 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -251,14 +251,14 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen)
ppd->iSeconds = ptd->timeoutValue;
*disableWhen = ptd->enabled ? ptd->disableWhen : 0xFFFFFFFF;
- LOGFONTA lf; //dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
- FontID fontid = {0}; //use ansi version of fontID coz POPUPNOTIFICATION use char
+ LOGFONTA lf; // dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
+ FontID fontid = {0}; // use ansi version of fontID coz POPUPNOTIFICATION use char
fontid.cbSize = sizeof(fontid);
mir_snprintf(fontid.group, SIZEOF(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", ptd->notification.lpzName);
ppd->colorText = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fontid, (LPARAM)&lf);
- ColourID colourid = {0}; //use ansi version of ColourID coz POPUPNOTIFICATION use char
+ ColourID colourid = {0}; // use ansi version of ColourID coz POPUPNOTIFICATION use char
colourid.cbSize = sizeof(colourid);
mir_snprintf(colourid.group, SIZEOF(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", ptd->notification.lpzName);
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index 40728b454f..1b9adc6327 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -28,7 +28,7 @@ HWND hwndBox = NULL;
LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK AlphaTrackBarWndProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-//effekt name for drop down box
+// effekt name for drop down box
LIST<TCHAR> g_lstPopupVfx(5, _tcsicmp);
void OptAdv_RegisterVfx(char *name)
{
@@ -42,66 +42,66 @@ void OptAdv_UnregisterVfx()
g_lstPopupVfx.destroy();
}
-//Main Dialog Proc
+// Main Dialog Proc
void LoadOption_AdvOpts()
{
- //History
+ // History
PopupOptions.EnableHistory = db_get_b(NULL, MODULNAME, "EnableHistory", TRUE);
PopupOptions.HistorySize = db_get_w(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
PopupOptions.UseHppHistoryLog = db_get_b(NULL, MODULNAME, "UseHppHistoryLog", TRUE);
- //Avatars
+ // Avatars
PopupOptions.avatarBorders = db_get_b(NULL, MODULNAME, "AvatarBorders", TRUE);
PopupOptions.avatarPNGBorders = db_get_b(NULL, MODULNAME, "AvatarPNGBorders", FALSE);
PopupOptions.avatarRadius = db_get_b(NULL, MODULNAME, "AvatarRadius", 2);
PopupOptions.avatarSize = db_get_w(NULL, MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
PopupOptions.EnableAvatarUpdates = db_get_b(NULL, MODULNAME, "EnableAvatarUpdates", FALSE);
- //Monitor
+ // Monitor
PopupOptions.Monitor = db_get_b(NULL, MODULNAME, "Monitor", SETTING_MONITOR_DEFAULT);
- //Transparency
+ // Transparency
PopupOptions.UseTransparency = db_get_b(NULL, MODULNAME, "UseTransparency", TRUE);
PopupOptions.Alpha = db_get_b(NULL, MODULNAME, "Alpha", SETTING_ALPHA_DEFAULT);
PopupOptions.OpaqueOnHover = db_get_b(NULL, MODULNAME, "OpaqueOnHover", TRUE);
- //Effects
+ // Effects
PopupOptions.UseAnimations = db_get_b(NULL, MODULNAME, "UseAnimations", TRUE);
PopupOptions.UseEffect = db_get_b(NULL, MODULNAME, "Fade", TRUE);
PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL, MODULNAME, "Effect", "", DBVT_TCHAR);
PopupOptions.FadeIn = db_get_dw(NULL, MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
PopupOptions.FadeOut = db_get_dw(NULL, MODULNAME, "FadeOutTime", SETTING_FADEOUTTIME_DEFAULT);
- //other old stuff
+ // other old stuff
PopupOptions.MaxPopups = db_get_w(NULL, MODULNAME, "MaxPopups", 20);
}
INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
TCHAR tstr[64];
- static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+ static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG
UINT idCtrl;
switch (msg) {
case WM_INITDIALOG:
- //Create preview box:
+ // Create preview box:
{
hwndBox = CreateWindowEx(
- WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
- _T(BOXPREVIEW_WNDCLASS), // Class name
- NULL, // Title
- DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
- CW_USEDEFAULT, // x
- CW_USEDEFAULT, // y
- CW_USEDEFAULT, // Width
- CW_USEDEFAULT, // Height
- HWND_DESKTOP, // Parent
- NULL, // menu handle
- hInst, // Instance
+ WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
+ _T(BOXPREVIEW_WNDCLASS), // Class name
+ NULL, // Title
+ DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
+ CW_USEDEFAULT, // x
+ CW_USEDEFAULT, // y
+ CW_USEDEFAULT, // Width
+ CW_USEDEFAULT, // Height
+ HWND_DESKTOP, // Parent
+ NULL, // menu handle
+ hInst, // Instance
(LPVOID)0);
ShowWindow(hwndBox, SW_HIDE);
}
- //Group: History
+ // Group: History
{
CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopupOptions.EnableHistory);
SetDlgItemInt(hwnd, IDC_HISTORYSIZE, PopupOptions.HistorySize, FALSE);
@@ -121,16 +121,16 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.EnableHistory);
EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopupOptions.EnableHistory && gbHppInstalled);
}
- //Group: Avatars
+ // Group: Avatars
{
- //Borders
+ // Borders
CheckDlgButton(hwnd, IDC_AVT_BORDER, PopupOptions.avatarBorders);
CheckDlgButton(hwnd, IDC_AVT_PNGBORDER, PopupOptions.avatarPNGBorders);
EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.avatarBorders);
- //Radius
+ // Radius
SetDlgItemInt(hwnd, IDC_AVT_RADIUS, PopupOptions.avatarRadius, FALSE);
SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopupOptions.avatarSize / 2), 0));
- //Size
+ // Size
mir_subclassWindow(GetDlgItem(hwnd, IDC_AVT_SIZE_SLIDE), AvatarTrackBarWndProc);
SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETRANGE, FALSE,
@@ -138,10 +138,10 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwnd, IDC_AVT_SIZE_SLIDE, TBM_SETPOS, TRUE,
max(PopupOptions.avatarSize, SETTING_AVTSIZE_MIN));
SetDlgItemInt(hwnd, IDC_AVT_SIZE, PopupOptions.avatarSize, FALSE);
- //Request avatars
+ // Request avatars
CheckDlgButton(hwnd, IDC_AVT_REQUEST, PopupOptions.EnableAvatarUpdates);
}
- //Group: Monitor
+ // Group: Monitor
{
BOOL bMonitor = 0;
@@ -154,9 +154,9 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_MIRANDAWND), bMonitor);
EnableWindow(GetDlgItem(hwnd, IDC_ACTIVEWND), bMonitor);
}
- //Group: Transparency
+ // Group: Transparency
{
- //win2k+
+ // win2k+
CheckDlgButton(hwnd, IDC_TRANS, PopupOptions.UseTransparency);
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopupOptions.Alpha);
@@ -175,11 +175,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
ShowWindow(GetDlgItem(hwnd, IDC_TRANS), SW_SHOW);
}
- //Group: Effects
+ // Group: Effects
{
- //Use Animations
+ // Use Animations
CheckDlgButton(hwnd, IDC_USEANIMATIONS, PopupOptions.UseAnimations);
- //Fade
+ // Fade
SetDlgItemInt(hwnd, IDC_FADEIN, PopupOptions.FadeIn, FALSE);
SetDlgItemInt(hwnd, IDC_FADEOUT, PopupOptions.FadeOut, FALSE);
UDACCEL aAccels[] = {{0,50},{1,100},{3,500}};
@@ -197,7 +197,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT), how);
EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_SPIN), how);
EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), how);
- //effects drop down
+ // effects drop down
{
DWORD dwItem, dwActiveItem = 0;
@@ -220,11 +220,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
}
- //later check stuff
+ // later check stuff
SetDlgItemInt(hwnd, IDC_MAXPOPUPS, PopupOptions.MaxPopups, FALSE);
SendDlgItemMessage(hwnd, IDC_MAXPOPUPS_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwnd, IDC_MAXPOPUPS), 0);
SendDlgItemMessage(hwnd, IDC_MAXPOPUPS_SPIN, UDM_SETRANGE, 0, MAKELONG(999, 1));
- TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG
bDlgInit = true;
return TRUE;
@@ -249,7 +249,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_COMMAND:
idCtrl = LOWORD(wParam);
switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
+ case BN_CLICKED: // Button controls
switch (idCtrl) {
case IDC_ENABLE_HISTORY:
PopupOptions.EnableHistory = !PopupOptions.EnableHistory;
@@ -337,7 +337,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case CBN_SELCHANGE:
- //lParam = Handle to the control
+ // lParam = Handle to the control
switch (idCtrl) {
case IDC_EFFECT:
{
@@ -361,9 +361,9 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
- case EN_CHANGE: //Edit controls change
+ case EN_CHANGE: // Edit controls change
if (!bDlgInit) break;
- //lParam = Handle to the control
+ // lParam = Handle to the control
switch (idCtrl) {
case IDC_MAXPOPUPS:
{
@@ -413,8 +413,8 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
- case EN_KILLFOCUS: //Edit controls lost fokus
- //lParam = Handle to the control
+ case EN_KILLFOCUS: // Edit controls lost fokus
+ // lParam = Handle to the control
switch (idCtrl) {
case IDC_MAXPOPUPS:
{
@@ -423,7 +423,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
PopupOptions.MaxPopups = 20;
if (maxPop != PopupOptions.MaxPopups) {
SetDlgItemInt(hwnd, idCtrl, PopupOptions.MaxPopups, FALSE);
- //ErrorMSG(1);
+ // ErrorMSG(1);
SetFocus((HWND)lParam);
}
}
@@ -494,31 +494,31 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return TRUE;
case PSN_APPLY:
- //History
+ // History
db_set_b(NULL, MODULNAME, "EnableHistory", (BYTE)PopupOptions.EnableHistory);
db_set_w(NULL, MODULNAME, "HistorySize", PopupOptions.HistorySize);
PopupHistoryResize();
db_set_b(NULL, MODULNAME, "UseHppHistoryLog", PopupOptions.UseHppHistoryLog);
- //Avatars
+ // Avatars
db_set_b(NULL, MODULNAME, "AvatarBorders", PopupOptions.avatarBorders);
db_set_b(NULL, MODULNAME, "AvatarPNGBorders", PopupOptions.avatarPNGBorders);
db_set_b(NULL, MODULNAME, "AvatarRadius", PopupOptions.avatarRadius);
db_set_w(NULL, MODULNAME, "AvatarSize", PopupOptions.avatarSize);
db_set_b(NULL, MODULNAME, "EnableAvatarUpdates", PopupOptions.EnableAvatarUpdates);
- //Monitor
+ // Monitor
db_set_b(NULL, MODULNAME, "Monitor", PopupOptions.Monitor);
- //Transparency
+ // Transparency
db_set_b(NULL, MODULNAME, "UseTransparency", PopupOptions.UseTransparency);
db_set_b(NULL, MODULNAME, "Alpha", PopupOptions.Alpha);
db_set_b(NULL, MODULNAME, "OpaqueOnHover", PopupOptions.OpaqueOnHover);
- //Effects
+ // Effects
db_set_b(NULL, MODULNAME, "UseAnimations", PopupOptions.UseAnimations);
db_set_b(NULL, MODULNAME, "Fade", PopupOptions.UseEffect);
db_set_ts(NULL, MODULNAME, "Effect", PopupOptions.Effect);
db_set_dw(NULL, MODULNAME, "FadeInTime", PopupOptions.FadeIn);
db_set_dw(NULL, MODULNAME, "FadeOutTime", PopupOptions.FadeOut);
- //other old stuff
+ // other old stuff
db_set_w(NULL, MODULNAME, "MaxPopups", (BYTE)PopupOptions.MaxPopups);
}
return TRUE;
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index 3410671606..a2f007d906 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
//---------------------------------------------------------------------------
-//Workaround for MS bug ComboBox_SelectItemData
+// Workaround for MS bug ComboBox_SelectItemData
int ComboBox_SelectItem(HWND hwndCtl, int indexStart, char* data) {
int i=0;
for ( i ; i < ComboBox_GetCount(hwndCtl); i++) {
@@ -37,7 +37,7 @@ int ComboBox_SelectItem(HWND hwndCtl, int indexStart, char* data) {
}
//---------------------------------------------------------------------------
-//Dialog Proc
+// Dialog Proc
struct {
UINT idCtrl;
@@ -62,7 +62,7 @@ static ctrlsAll[] = {
{IDC_TXT_RACTION ,0 ,1 ,1},
{IDC_RACTION ,0 ,1 ,1},
- {IDC_CHECKWINDOW ,0 ,0 ,0}, //may be delete ??
+ {IDC_CHECKWINDOW ,0 ,0 ,0}, // may be delete ??
{IDC_TXT_TITLE3 ,0 ,1 ,0},
{IDC_SOFFLINE ,0 ,1 ,0},
@@ -174,26 +174,26 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case WM_INITDIALOG:
TranslateDialogDefault( hwnd );
{
- //Treeview
+ // Treeview
HWND hwndTree = GetDlgItem(hwnd, IDC_TREE1);
int iconIndex = 0;
char iconName[MAXMODULELABELLENGTH];
TCHAR itemName[MAXMODULELABELLENGTH];
TreeView_DeleteAllItems(hwndTree);
- //Treeview create image list
+ // Treeview create image list
HIMAGELIST hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR|ILC_COLOR32|ILC_MASK, 5, num_classes+1);
ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(ICO_OPT_GROUP,0));
TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
for (i=0; i < gTreeData.getCount(); ++i) {
switch (gTreeData[i]->typ) {
- case 1: //Treeview part for typ 1 (notification)
+ case 1: // Treeview part for typ 1 (notification)
mir_snprintf(iconName, SIZEOF(iconName), "%s_%S_%S", MODULNAME, gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIcon(iconName));
mir_sntprintf(itemName, SIZEOF(itemName), _T("%s/%s"), gTreeData[i]->pszTreeRoot, gTreeData[i]->pszDescription);
break;
- case 2: //Treeview part typ 2 (popup class api)
+ case 2: // Treeview part typ 2 (popup class api)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, gTreeData[i]->pupClass.hIcon);
mir_sntprintf(itemName, SIZEOF(itemName), _T("%s/%s"), LPGENT("CLASS Plugins")/*gTreeData[i]->pszTreeRoot*/, gTreeData[i]->pszDescription);
break;
@@ -202,7 +202,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
OptTree_Translate(hwndTree);
- //Bold Title
+ // Bold Title
for (i = 0; i < SIZEOF(titleIds); ++i) {
LOGFONT lf;
GetObject((HFONT)SendDlgItemMessage(hwnd, titleIds[i], WM_GETFONT, 0, 0), sizeof(lf), &lf);
@@ -210,10 +210,10 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwnd, titleIds[i], WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);
}
- //spindown for Timeout
+ // spindown for Timeout
SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_INFINITE));
SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)0, TRUE);
- //status buttons
+ // status buttons
for (i = 0; i < SIZEOF(statusButtons); ++i) {
SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONSETASPUSHBTN, TRUE, 0);
@@ -222,11 +222,11 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwnd, statusButtons[i].idCtrl, BUTTONADDTOOLTIP,
(WPARAM)Translate(statusButtons[i].title), 0);
}
- //info icon
+ // info icon
SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_MISC_NOTIFY,0), 0);
- //more button
+ // more button
EnableWindow(GetDlgItem(hwnd, IDC_MORE), FALSE);
- //preview button
+ // preview button
ShowWindow(GetDlgItem(hwnd, IDC_CHECKWINDOW), SW_HIDE);
SendMessage(hwnd, WM_USER, 0, 0);
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case WM_USER:
{
HWND hTV = GetDlgItem(hwnd, IDC_TREE1);
- //get TreeView selection
+ // get TreeView selection
TVITEM tvi = { 0 };
tvi.hItem = TreeView_GetSelection(hTV);
tvi.mask = TVIF_PARAM|TVIF_HANDLE|TVIF_TEXT;
@@ -247,33 +247,33 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
POPUPTREEDATA* ptd = (POPUPTREEDATA *)tvi.lParam;
LPTSTR psztSelect = NULL;
int index = 0;
- //combo left action (default)
+ // combo left action (default)
HWND hCtrl = GetDlgItem(hwnd, IDC_LACTION);
ComboBox_ResetContent(hCtrl);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)),POPUP_ACTION_DISMISS);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)),POPUP_ACTION_NOTHING);
- //combo right action (default)
+ // combo right action (default)
hCtrl = GetDlgItem(hwnd, IDC_RACTION);
ComboBox_ResetContent(hCtrl);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_DISMISS)),POPUP_ACTION_DISMISS);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT(POPUP_ACTION_NOTHING)),POPUP_ACTION_NOTHING);
- //element typ1 (Notification)
+ // element typ1 (Notification)
if (ptd->typ == 1) {
LPTSTR psztAction = NULL;
- //Timeout
+ // Timeout
SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
- //combo left action (EXTRA)
+ // combo left action (EXTRA)
hCtrl = GetDlgItem(hwnd, IDC_LACTION);
for (i = 0; i < ptd->notification.actionCount; ++i) {
psztAction = mir_a2t(ptd->notification.lpActions[i].lpzTitle);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)),ptd->notification.lpActions[i].lpzTitle);
mir_free(psztAction); psztAction = NULL;
}
- //combo right action (EXTRA)
+ // combo right action (EXTRA)
hCtrl = GetDlgItem(hwnd, IDC_RACTION);
psztAction = NULL;
for (i = 0; i < ptd->notification.actionCount; ++i) {
@@ -281,43 +281,43 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateTS(psztAction)),ptd->notification.lpActions[i].lpzTitle);
mir_free(psztAction); psztAction = NULL;
}
- //enable all controls
+ // enable all controls
for (i = 0; i < SIZEOF(ctrlsAll); ++i){
ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1 ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp1);
}
- //enable or disable controls ctrlsEnable
+ // enable or disable controls ctrlsEnable
for (i = 0; i < SIZEOF(ctrlsEnable); ++i)
EnableWindow(GetDlgItem(hwnd, ctrlsEnable[i]), ptd->enabled ? TRUE : FALSE);
- //show or hide controls ctrlsContact
+ // show or hide controls ctrlsContact
for (i = 0; i < SIZEOF(ctrlsContact); ++i)
ShowWindow(GetDlgItem(hwnd, ctrlsContact[i]), ptd->notification.dwFlags&PNF_CONTACT ? SW_SHOW : SW_HIDE);
- //statusButtons state
+ // statusButtons state
for (i = 0; i < SIZEOF(statusButtons); ++i)
CheckDlgButton(hwnd, statusButtons[i].idCtrl, ptd->disableWhen & statusButtons[i].disableWhenFlag ? TRUE : FALSE);
}
- //element typ2 (CLASS Plugins)
+ // element typ2 (CLASS Plugins)
else if (ptd->typ == 2) {
- //Timeout
+ // Timeout
SetDlgItemInt(hwnd,IDC_TIMEOUT, (UINT)ptd->timeoutValue, TRUE);
SendDlgItemMessage(hwnd, IDC_TIMEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(250, -1));
- //enable ctrls
+ // enable ctrls
for (i = 0; i < SIZEOF(ctrlsAll); ++i){
ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2 ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp2);
}
}
- //checkbox enable notify
+ // checkbox enable notify
CheckDlgButton(hwnd, IDC_ENABLE, ptd->enabled ? TRUE : FALSE);
- //combo left action (SELECT)
+ // combo left action (SELECT)
hCtrl = GetDlgItem(hwnd, IDC_LACTION);
- ComboBox_SelectItem (hCtrl, -1, ptd->leftAction); //use Workaround for MS bug ComboBox_SelectItemData
- //combo right action (SELECT)
+ ComboBox_SelectItem (hCtrl, -1, ptd->leftAction); // use Workaround for MS bug ComboBox_SelectItemData
+ // combo right action (SELECT)
hCtrl = GetDlgItem(hwnd, IDC_RACTION);
- ComboBox_SelectItem (hCtrl, -1, ptd->rightAction); //use Workaround for MS bug ComboBox_SelectItemData
- } //end if (tvi.lParam)
+ ComboBox_SelectItem (hCtrl, -1, ptd->rightAction); // use Workaround for MS bug ComboBox_SelectItemData
+ } // end if (tvi.lParam)
else {
- //enable / disable controls
+ // enable / disable controls
for (int i=0; i < SIZEOF(ctrlsAll); ++i) {
ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0 ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0);
@@ -332,7 +332,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
POPUPTREEDATA* ptd = (POPUPTREEDATA *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (!ptd) break;
switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
+ case BN_CLICKED: // Button controls
switch(idCtrl) {
case IDC_ENABLE:
ptd->enabled = (BYTE)Button_GetCheck((HWND)lParam);
@@ -353,13 +353,13 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
ppd.colorText = ptd->colorText;
POPUPTREEDATA *ptdPrev = NULL;
if (ptd->typ == 1) {
- //we work with a copy for preview
+ // we work with a copy for preview
ptdPrev = (POPUPTREEDATA *)mir_alloc(sizeof(POPUPTREEDATA));
memcpy(ptdPrev, ptd, sizeof(POPUPTREEDATA));
ptdPrev->enabled = ptd->enabled;
ptdPrev->timeoutValue = ptd->timeoutValue;
- strcpy(ptdPrev->leftAction, ptd->leftAction); //geht noch nicht??
- strcpy(ptdPrev->rightAction, ptd->rightAction); //geht noch nicht??
+ strcpy(ptdPrev->leftAction, ptd->leftAction); // geht noch nicht??
+ strcpy(ptdPrev->rightAction, ptd->rightAction); // geht noch nicht??
ptdPrev->disableWhen = ptd->disableWhen;
ppd.lchNotification = (HANDLE)ptdPrev;
@@ -394,7 +394,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
break;
- case CBN_SELCHANGE: //ComboBox controls
+ case CBN_SELCHANGE: // ComboBox controls
switch(idCtrl) {
case IDC_LACTION:
mir_strncpy(ptd->leftAction,
@@ -411,7 +411,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
break;
- case EN_CHANGE: //Edit controls
+ case EN_CHANGE: // Edit controls
switch(idCtrl) {
case IDC_TIMEOUT:
int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
@@ -422,7 +422,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
}
break;
- case EN_KILLFOCUS: //Edit controls lost fokus
+ case EN_KILLFOCUS: // Edit controls lost fokus
switch(idCtrl) {
case IDC_TIMEOUT:
int seconds = GetDlgItemInt(hwnd, idCtrl, NULL, TRUE);
@@ -450,7 +450,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case 1:
LoadNotificationSettings(gTreeData[i], "PopupNotifications");
break;
- case 2: //not finish
+ case 2: // not finish
LoadClassSettings(gTreeData[i], PU_MODULCLASS);
gTreeData[i]->timeoutValue = gTreeData[i]->pupClass.iSeconds;
break;
@@ -465,7 +465,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
gTreeData[i]->notification.iSeconds = gTreeData[i]->timeoutValue;
SaveNotificationSettings(gTreeData[i],"PopupNotifications");
break;
- case 2: //not finish
+ case 2: // not finish
gTreeData[i]->pupClass.iSeconds = gTreeData[i]->timeoutValue;
SaveClassSettings(gTreeData[i],"PopupCLASS");
break;
@@ -507,12 +507,12 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul)
ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
- szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); //standart ??
+ szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
- szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); //standart ??
+ szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); // standart ??
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp
index 6540d9e645..9bf3b9024b 100644
--- a/plugins/Popup/src/opt_contacts.cpp
+++ b/plugins/Popup/src/opt_contacts.cpp
@@ -34,8 +34,8 @@ static void sttSetAllContactIcons(HWND hwndList)
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0);
DWORD dwMode = db_get_b(hContact, MODULNAME, "ShowMode", 0);
for (int i = 0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
- //hIml element [0] = SKINICON_OTHER_SMALLDOT
- //hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
+ // hIml element [0] = SKINICON_OTHER_SMALLDOT
+ // hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (dwMode == i) ? i + 1 : 0));
}
}
@@ -87,8 +87,8 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
int iImage = SendDlgItemMessage(hwnd,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
if (iImage != EMPTY_EXTRA_ICON) {
for (int i=0; i < 4 /*SIZEOF(sttIcons)*/; ++i)
- //hIml element [0] = SKINICON_OTHER_SMALLDOT
- //hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
+ // hIml element [0] = SKINICON_OTHER_SMALLDOT
+ // hIml element [1..5] = IcoLib_GetIcon(....) ~ old sttIcons
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, (i==nm->iColumn)?i+1:0));
}
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index 5b39304862..78a4d160ba 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-//Helper for Status Tree
+// Helper for Status Tree
static int CountStatusModes(DWORD flags)
{
int res = 0;
@@ -38,7 +38,7 @@ static int CountStatusModes(DWORD flags)
if (flags & PF2_FREECHAT) ++res;
if (flags & PF2_OUTTOLUNCH) ++res;
if (flags & PF2_ONTHEPHONE) ++res;
- if (res) ++res; // Offline
+ if (res) ++res; // Offline
return res;
}
@@ -85,49 +85,49 @@ int AddStatusModes(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flags)
}
-//Main Dialog Proc
+// Main Dialog Proc
void LoadOption_General()
{
- //Seconds
+ // Seconds
PopupOptions.InfiniteDelay = db_get_b(NULL, MODULNAME, "InfiniteDelay", FALSE);
PopupOptions.Seconds =
DBGetContactSettingRangedWord(NULL, MODULNAME, "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
PopupOptions.LeaveHovered = db_get_b(NULL, MODULNAME, "LeaveHovered", TRUE);
- //Dynamic Resize
+ // Dynamic Resize
PopupOptions.DynamicResize = db_get_b(NULL, MODULNAME, "DynamicResize", FALSE);
PopupOptions.UseMinimumWidth = db_get_b(NULL, MODULNAME, "UseMinimumWidth", TRUE);
PopupOptions.MinimumWidth = db_get_w(NULL, MODULNAME, "MinimumWidth", 160);
PopupOptions.UseMaximumWidth = db_get_b(NULL, MODULNAME, "UseMaximumWidth", TRUE);
PopupOptions.MaximumWidth = db_get_w(NULL, MODULNAME, "MaximumWidth", 300);
- //Position
+ // Position
PopupOptions.Position =
DBGetContactSettingRangedByte(NULL, MODULNAME, "Position", POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
- //Configure popup area
+ // Configure popup area
PopupOptions.gapTop = db_get_w(NULL, MODULNAME, "gapTop", 5);
PopupOptions.gapBottom = db_get_w(NULL, MODULNAME, "gapBottom", 5);
PopupOptions.gapLeft = db_get_w(NULL, MODULNAME, "gapLeft", 5);
PopupOptions.gapRight = db_get_w(NULL, MODULNAME, "gapRight", 5);
PopupOptions.spacing = db_get_w(NULL, MODULNAME, "spacing", 5);
- //Spreading
+ // Spreading
PopupOptions.Spreading =
DBGetContactSettingRangedByte(NULL, MODULNAME, "Spreading", SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
- //miscellaneous
+ // miscellaneous
PopupOptions.ReorderPopups = db_get_b(NULL, MODULNAME, "ReorderPopups", TRUE);
PopupOptions.ReorderPopupsWarning = db_get_b(NULL, MODULNAME, "ReorderPopupsWarning", TRUE);
- //disable When
+ // disable When
PopupOptions.ModuleIsEnabled = db_get_b(NULL, "Popup", "ModuleIsEnabled", TRUE);
PopupOptions.DisableWhenFullscreen = db_get_b(NULL, MODULNAME, "DisableWhenFullscreen", TRUE);
}
INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+ static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG
static OPTTREE_OPTION *statusOptions = NULL;
static int statusOptionsCount = 0;
@@ -139,7 +139,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
switch (msg) {
case WM_INITDIALOG:
- //Seconds of delay
+ // Seconds of delay
CheckDlgButton(hwnd, IDC_INFINITEDELAY, PopupOptions.InfiniteDelay);
CheckDlgButton(hwnd, IDC_LEAVEHOVERED, PopupOptions.LeaveHovered);
EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopupOptions.InfiniteDelay);
@@ -149,26 +149,26 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
SetDlgItemInt(hwnd, IDC_SECONDS, PopupOptions.Seconds, FALSE);
SendDlgItemMessage(hwnd, IDC_SECONDS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_MIN));
- //Dynamic Resize
+ // Dynamic Resize
CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.DynamicResize);
SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENT("Maximum width") : LPGENT("Width"));
- //Minimum Width
+ // Minimum Width
CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.UseMinimumWidth);
SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN));
SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopupOptions.MinimumWidth, FALSE);
- //Maximum Width
+ // Maximum Width
PopupOptions.UseMaximumWidth = PopupOptions.DynamicResize ? PopupOptions.UseMaximumWidth : TRUE;
CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.UseMaximumWidth);
SendDlgItemMessage(hwnd, IDC_MAXIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN));
SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopupOptions.MaximumWidth, FALSE);
- //And finally let's enable/disable them.
+ // And finally let's enable/disable them.
EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize);
EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth);
EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.UseMaximumWidth);
EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth);
- //Position combobox.
+ // Position combobox.
{
HWND hCtrl = GetDlgItem(hwnd, IDC_WHERE);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Upper left corner")), POS_UPPERLEFT);
@@ -177,30 +177,30 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Upper right corner")), POS_UPPERRIGHT);
SendDlgItemMessage(hwnd, IDC_WHERE, CB_SETCURSEL, PopupOptions.Position, 0);
}
- //Configure popup area
+ // Configure popup area
{
HWND hCtrl = GetDlgItem(hwnd, IDC_CUSTOMPOS);
SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)_T("Popup area"), BATF_TCHAR);
SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RESIZE, 0));
}
- //Spreading combobox
+ // Spreading combobox
{
HWND hCtrl = GetDlgItem(hwnd, IDC_LAYOUT);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Horizontal")), SPREADING_HORIZONTAL);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Vertical")), SPREADING_VERTICAL);
SendDlgItemMessage(hwnd, IDC_LAYOUT, CB_SETCURSEL, PopupOptions.Spreading, 0);
}
- //miscellaneous
+ // miscellaneous
CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups);
- //Popup enabled
+ // Popup enabled
CheckDlgButton(hwnd, IDC_POPUPENABLED, PopupOptions.ModuleIsEnabled ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.DisableWhenFullscreen);
EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), PopupOptions.ModuleIsEnabled);
EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), PopupOptions.ModuleIsEnabled);
- //new status options
+ // new status options
{
int protocolCount = 0;
PROTOACCOUNT **protocols;
@@ -244,13 +244,13 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENT("Global Status"));
}
- TranslateDialogDefault(hwnd); //do it on end of WM_INITDIALOG
+ TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG
bDlgInit = true;
return TRUE;
case WM_COMMAND:
switch (HIWORD(wParam)) {
- case BN_CLICKED: //Button controls
+ case BN_CLICKED: // Button controls
switch (LOWORD(wParam)) {
case IDC_INFINITEDELAY:
PopupOptions.InfiniteDelay = !PopupOptions.InfiniteDelay;
@@ -291,7 +291,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_USEMAXIMUMWIDTH:
PopupOptions.UseMaximumWidth = Button_GetCheck((HWND)lParam);
- if (!PopupOptions.DynamicResize) { //ugly - set always on if DynamicResize = off
+ if (!PopupOptions.DynamicResize) { // ugly - set always on if DynamicResize = off
CheckDlgButton(hwnd, LOWORD(wParam), BST_CHECKED);
PopupOptions.UseMaximumWidth = TRUE;
}
@@ -357,9 +357,9 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
- case CBN_SELCHANGE: //ComboBox controls
+ case CBN_SELCHANGE: // ComboBox controls
switch (LOWORD(wParam)) {
- //lParam = Handle to the control
+ // lParam = Handle to the control
case IDC_WHERE:
PopupOptions.Position = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -371,10 +371,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
- case EN_CHANGE: //Edit controls change
+ case EN_CHANGE: // Edit controls change
if (!bDlgInit) break;
switch (LOWORD(wParam)) {
- //lParam = Handle to the control
+ // lParam = Handle to the control
case IDC_SECONDS:
{
int seconds = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
@@ -408,12 +408,12 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
}
break;
- }//end switch(idCtrl)
+ }// end switch(idCtrl)
break;
- case EN_KILLFOCUS: //Edit controls lost fokus
+ case EN_KILLFOCUS: // Edit controls lost fokus
switch (LOWORD(wParam)) {
- //lParam = Handle to the control
+ // lParam = Handle to the control
case IDC_SECONDS:
{
int seconds = GetDlgItemInt(hwnd, LOWORD(wParam), NULL, FALSE);
@@ -480,38 +480,38 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return TRUE;
case PSN_APPLY:
- //Seconds
+ // Seconds
db_set_b(NULL, MODULNAME, "InfiniteDelay", PopupOptions.InfiniteDelay);
db_set_w(NULL, MODULNAME, "Seconds", (WORD)PopupOptions.Seconds);
db_set_b(NULL, MODULNAME, "LeaveHovered", PopupOptions.LeaveHovered);
- //Dynamic Resize
+ // Dynamic Resize
db_set_b(NULL, MODULNAME, "DynamicResize", PopupOptions.DynamicResize);
db_set_b(NULL, MODULNAME, "UseMinimumWidth", PopupOptions.UseMinimumWidth);
db_set_w(NULL, MODULNAME, "MinimumWidth", PopupOptions.MinimumWidth);
db_set_b(NULL, MODULNAME, "UseMaximumWidth", PopupOptions.UseMaximumWidth);
db_set_w(NULL, MODULNAME, "MaximumWidth", PopupOptions.MaximumWidth);
- //Position
+ // Position
db_set_b(NULL, MODULNAME, "Position", (BYTE)PopupOptions.Position);
- //Configure popup area
+ // Configure popup area
db_set_w(NULL, MODULNAME, "gapTop", (WORD)PopupOptions.gapTop);
db_set_w(NULL, MODULNAME, "gapBottom", (WORD)PopupOptions.gapBottom);
db_set_w(NULL, MODULNAME, "gapLeft", (WORD)PopupOptions.gapLeft);
db_set_w(NULL, MODULNAME, "gapRight", (WORD)PopupOptions.gapRight);
db_set_w(NULL, MODULNAME, "spacing", (WORD)PopupOptions.spacing);
- //Spreading
+ // Spreading
db_set_b(NULL, MODULNAME, "Spreading", (BYTE)PopupOptions.Spreading);
- //miscellaneous
- Check_ReorderPopups(hwnd); //this save also PopupOptions.ReorderPopups
+ // miscellaneous
+ Check_ReorderPopups(hwnd); // this save also PopupOptions.ReorderPopups
- //disable When
+ // disable When
db_set_b(NULL, MODULNAME, "DisableWhenFullscreen", PopupOptions.DisableWhenFullscreen);
- //new status options
+ // new status options
{
int protocolCount;
PROTOACCOUNT **protocols;
@@ -586,7 +586,7 @@ void Check_ReorderPopups(HWND hwnd) {
switch (res) {
case IDYES:
PopupOptions.ReorderPopups = TRUE;
- //Reset warning for next option change !!!
+ // Reset warning for next option change !!!
PopupOptions.ReorderPopupsWarning = TRUE;
break;
case IDNO:
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index c859e7f620..6fa00b6af1 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -40,7 +40,7 @@ void RegisterOptPrevBox()
wcl.hInstance = hInst;
wcl.hIcon = NULL;
wcl.hCursor = LoadCursor(NULL, IDC_ARROW);
- wcl.hbrBackground = NULL; //(HBRUSH)GetStockObject(LTGRAY_BRUSH);
+ wcl.hbrBackground = NULL; // (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wcl.lpszMenuName = NULL;
wcl.lpszClassName = _T(BOXPREVIEW_WNDCLASS);
wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
@@ -52,8 +52,8 @@ void RegisterOptPrevBox()
MSGERROR(msg);
}
- // register custom class for dialog box with drop-shadow attribute
- // "#32770" stays for class name of default system dialog box
+ // register custom class for dialog box with drop-shadow attribute
+ // "#32770" stays for class name of default system dialog box
GetClassInfoEx(hInst, _T("#32770"), &wcl);
wcl.hInstance = hInst;
wcl.lpszClassName = _T("PopupPlusDlgBox");
@@ -189,9 +189,9 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
mir_tstrlen(options[pos].pszSettingName)+
mir_strlen(skin->getFlagName(i)) +10 ));
- wsprintf(options[pos].pszOptionName, _T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i)); //!!!!!!!!!!!!!
+ wsprintf(options[pos].pszOptionName, _T("%s/%hs"), options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!!
options[pos].bState = skin->getFlag(i) ? TRUE : FALSE;
- options[pos].Data = i; //skin flag index
+ options[pos].Data = i; // skin flag index
*dwGlobalOptions |= skin->getFlag(i) ? (1 << (i-1)) : 0;
pos++;
}
@@ -199,7 +199,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos
return pos;
}
-/////////////////////////////////////////////////////////////////////////////////////////
+// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /
static LPTSTR mainOption [] = {
LPGENT("Show clock"),
@@ -250,7 +250,7 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos,
options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*(
mir_tstrlen(options[pos].pszSettingName)+
mir_tstrlen(mainOption[i]) + 10));
- wsprintf(options[pos].pszOptionName, _T("%s/%s"), options[pos].pszSettingName, mainOption[i]); //!!!!!!!!!!!!!
+ wsprintf(options[pos].pszOptionName, _T("%s/%s"), options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!!
options[pos].bState = bCheck;
pos++;
}
@@ -269,23 +269,23 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw
options = NULL;
*OptionsCount = 0;
}
- //add "Global options"
+ // add "Global options"
DWORD dwGlobalOptions = 0;
int pos = SkinOptionList_AddMain(options, OptionsCount, 0, &dwGlobalOptions);
- //add "Skin options"
+ // add "Skin options"
DWORD dwSkinOptions = 0;
pos = SkinOptionList_AddSkin(options, OptionsCount, pos, &dwSkinOptions);
- //generate treeview
+ // generate treeview
int index = -1;
OptTree_ProcessMessage(hwndDlg, WM_INITDIALOG, 0, 0, &index, IDC_SKIN_LIST_OPT, options, *OptionsCount);
- //check "Skin options" state
+ // check "Skin options" state
char prefix[128];
mir_snprintf(prefix, SIZEOF(prefix),"skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
- //check "Global Settings"
+ // check "Global Settings"
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
dwGlobalOptions, _T("Global settings"));
@@ -293,9 +293,9 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw
}
void LoadOption_Skins() {
- //skin pack
+ // skin pack
PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(NULL,MODULNAME, "SkinPack", "* Popup Classic",DBVT_TCHAR);
- //more Skin options
+ // more Skin options
PopupOptions.DisplayTime = db_get_b(NULL,MODULNAME, "DisplayTime", TRUE);
PopupOptions.DropShadow = db_get_b(NULL,MODULNAME, "DropShadow", TRUE);
PopupOptions.EnableFreeformShadows = db_get_b(NULL,MODULNAME, "EnableShadowRegion", 1);
@@ -306,7 +306,7 @@ void LoadOption_Skins() {
INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static bool bDlgInit = false; //some controls send WM_COMMAND before or during WM_INITDIALOG
+ static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG
static HANDLE hhkFontsReload = 0;
static OPTTREE_OPTION *skinOptions = NULL;
static int skinOptionsCount = 0;
@@ -354,7 +354,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
HWND hCtrl = NULL;
DWORD dwIndex = 0;
- //Skin List
+ // Skin List
hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST);
ListBox_ResetContent(hCtrl);
LPTSTR Temp = NULL;
@@ -365,19 +365,19 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
- //Skin List reload button
+ // Skin List reload button
SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_OPT_RELOAD,0));
SendMessage(GetDlgItem(hwndDlg, IDC_BTN_RELOAD), BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0);
- //Skin Option List
+ // Skin Option List
SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
- //PreviewBox
+ // PreviewBox
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_PREVIEWBOX), WndProcPreviewBox);
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
- //hooks
+ // hooks
hhkFontsReload = HookEventMessage(ME_FONT_RELOAD, hwndDlg, WM_USER);
TranslateDialogDefault(hwndDlg);
@@ -394,11 +394,11 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
HWND hCtrl = NULL;
UINT idCtrl = LOWORD(wParam);
switch (HIWORD(wParam)) {
- case BN_KILLFOCUS: //Button controls
- case BN_SETFOCUS: //Button controls
+ case BN_KILLFOCUS: // Button controls
+ case BN_SETFOCUS: // Button controls
return TRUE;
break;
- case BN_CLICKED: //Button controls
+ case BN_CLICKED: // Button controls
switch(idCtrl) {
case IDC_PREVIEW:
PopupPreview();
@@ -419,7 +419,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
ListBox_SetItemData(hCtrl, dwIndex, sl->name);
}
ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack));
- //make shure we have select skin (ListBox_SetCurSel may be fail)
+ // make shure we have select skin (ListBox_SetCurSel may be fail)
ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin);
if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) {
mir_free(PopupOptions.SkinPack);
@@ -429,25 +429,25 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack)) {
- //update Skin Option List from reload SkinPack
+ // update Skin Option List from reload SkinPack
bDlgInit = false;
bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }//end IDC_BTN_RELOAD:
+ }// end IDC_BTN_RELOAD:
break;
case IDC_GETSKINS:
- CallService(MS_UTILS_OPENURL,0,(LPARAM)"http://miranda-ng.org/addons/category/13");
+ CallService(MS_UTILS_OPENURL,0,(LPARAM)"http:// miranda-ng.org/addons/category/13");
break;
- }//end switch(idCtrl)
+ }// end switch(idCtrl)
updatePreviewImage(GetDlgItem(hwndDlg, IDC_PREVIEWBOX));
break;
- case CBN_SELCHANGE: //combo box controls
+ case CBN_SELCHANGE: // combo box controls
switch(idCtrl) {
case IDC_SKINLIST:
{
- //Skin list change
+ // Skin list change
mir_free(PopupOptions.SkinPack);
PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage(
hwndDlg,
@@ -460,7 +460,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
mir_free(PopupOptions.SkinPack);
PopupOptions.SkinPack = mir_tstrdup(skin->getName());
- //update Skin Option List
+ // update Skin Option List
bDlgInit = false;
bDlgInit = SkinOptionList_Update (skinOptions, &skinOptionsCount, hwndDlg);
}
@@ -468,11 +468,11 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- }//end switch(idCtrl)
+ }// end switch(idCtrl)
break;
- }//end switch (HIWORD(wParam))
+ }// end switch (HIWORD(wParam))
break;
- }// end WM_COMMAND
+ }// end WM_COMMAND
return FALSE;
case WM_NOTIFY:
@@ -486,24 +486,24 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case PSN_APPLY:
{
- //skin pack
+ // skin pack
db_set_ts(NULL, MODULNAME, "SkinPack", PopupOptions.SkinPack);
- //skin options
+ // skin options
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopupOptions.SkinPack))
skin->saveOpts();
skins.freeAllButActive();
- //more Skin options
+ // more Skin options
db_set_b(NULL, MODULNAME, "DisplayTime", PopupOptions.DisplayTime);
db_set_b(NULL, MODULNAME, "DropShadow", PopupOptions.DropShadow);
db_set_b(NULL, MODULNAME, "EnableShadowRegion", PopupOptions.EnableFreeformShadows);
db_set_b(NULL, MODULNAME, "EnableAeroGlass", PopupOptions.EnableAeroGlass);
db_set_b(NULL, MODULNAME, "UseMText", PopupOptions.UseMText);
- }//end PSN_APPLY:
+ }// end PSN_APPLY:
return TRUE;
- }//switch (((LPNMHDR)lParam)->code)
+ }// switch (((LPNMHDR)lParam)->code)
break;
- }//end switch (((LPNMHDR)lParam)->idFrom)
+ }// end switch (((LPNMHDR)lParam)->idFrom)
return FALSE;
case WM_DESTROY:
@@ -523,7 +523,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
skinOptionsCount = 0;
}
return TRUE;
- }//end switch (msg)
+ }// end switch (msg)
return FALSE;
}
@@ -533,7 +533,7 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
switch (mode) {
case 0:
- { // Avatar
+ { // Avatar
HDC hdcAvatar = CreateCompatibleDC(mydc);
HBITMAP hbmSave = (HBITMAP)SelectObject(hdcAvatar, hbmNoAvatar);
GetClientRect(hwnd, &rc);
@@ -548,7 +548,7 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
break;
}
case 1:
- { // Opacity
+ { // Opacity
HBRUSH hbr = CreateSolidBrush(fonts.clBack);
HFONT hfnt = (HFONT)SelectObject(mydc, fonts.title);
GetClientRect(hwnd, &rc);
@@ -556,15 +556,15 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
DrawIconEx(mydc, 10, (rc.bottom-rc.top-16)/2, IcoLib_GetIcon(ICO_POPUP_ON,0), 16, 16, 0, hbr, DI_NORMAL);
SetBkMode(mydc, TRANSPARENT);
GetClientRect(hwnd, &rc);
- rc.left += 30; // 10+16+4 -- icon
+ rc.left += 30; // 10+16+4 -- icon
rc.right -= (rc.right-rc.left)/3;
rc.bottom -= (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ DrawText(mydc, _T(MODULNAME_LONG), (int)mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
- rc.left += 30; // 10+16+4 -- icon
+ rc.left += 30; // 10+16+4 -- icon
rc.left += (rc.right-rc.left)/3;
rc.top += (rc.bottom-rc.top)/3;
- DrawText(mydc, _T(MODULNAME_LONG), mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER);
+ DrawText(mydc, _T(MODULNAME_LONG), (int)mir_tstrlen(_T(MODULNAME_LONG)), &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER);
GetClientRect(hwnd, &rc);
FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
SelectObject(mydc, hfnt);
@@ -573,7 +573,7 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode)
break;
case 2:
- { // Position
+ { // Position
HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
GetClientRect(hwnd, &rc);
FillRect(mydc, &rc, hbr);
diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp
index 515e13256e..dd85cc81d0 100644
--- a/plugins/Popup/src/opttree.cpp
+++ b/plugins/Popup/src/opttree.cpp
@@ -105,12 +105,12 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd
sectionName = itemName;
while (sectionName) {
- // allow multi-level tree
+ // allow multi-level tree
TCHAR *pItemName = sectionName;
HTREEITEM hItem;
if (sectionName = _tcschr(sectionName, '/')) {
- // one level deeper
+ // one level deeper
*sectionName = 0;
sectionName++;
}
@@ -121,7 +121,7 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd
TVINSERTSTRUCT tvis = {0};
tvis.hParent = hSection;
- tvis.hInsertAfter = TVI_LAST;//TVI_SORT;
+ tvis.hInsertAfter = TVI_LAST;// TVI_SORT;
tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;
tvis.item.pszText = pItemName;
tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
@@ -180,12 +180,12 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, i
sectionName = itemName;
while (sectionName) {
- // allow multi-level tree
+ // allow multi-level tree
TCHAR *pItemName = sectionName;
HTREEITEM hItem;
if (sectionName = _tcschr(sectionName, '/')) {
- // one level deeper
+ // one level deeper
*sectionName = 0;
sectionName++;
}
@@ -196,7 +196,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, i
TVINSERTSTRUCT tvis = {0};
tvis.hParent = hSection;
- tvis.hInsertAfter = TVI_LAST;//TVI_SORT;
+ tvis.hInsertAfter = TVI_LAST;// TVI_SORT;
tvis.item.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.pszText = pItemName;
tvis.item.state = tvis.item.stateMask = TVIS_EXPANDED;
diff --git a/plugins/Popup/src/popup_gdiplus.cpp b/plugins/Popup/src/popup_gdiplus.cpp
index 9a4b4ed96f..c85f756c75 100644
--- a/plugins/Popup/src/popup_gdiplus.cpp
+++ b/plugins/Popup/src/popup_gdiplus.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#undef Translate
-// fix for old SDK and new GDI+
+// fix for old SDK and new GDI+
#define ULONG_PTR unsigned long
#include "gdiplus.h"
@@ -56,7 +56,7 @@ void UnloadGDIPlus()
Gdiplus::GdiplusShutdown(g_gdiplusToken);
}
__except ( EXCEPTION_EXECUTE_HANDLER ) {
- // do nothing
+ // do nothing
}
gbGdiPlusLoaded = true;
g_gdiplusToken = 0;
@@ -64,10 +64,10 @@ void UnloadGDIPlus()
using namespace Gdiplus;
-/////////////////////////////////////////////////////////////////////////////////
-// GDIPlus_IsAnimatedGIF and GDIPlus_ExtractAnimatedGIF
-// based on routine from http://www.codeproject.com/vcpp/gdiplus/imageexgdi.asp
-//
+// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /
+// GDIPlus_IsAnimatedGIF and GDIPlus_ExtractAnimatedGIF
+// based on routine from http:// www.codeproject.com/vcpp/gdiplus/imageexgdi.asp
+//
HBITMAP SkinEngine_CreateDIB32(int cx, int cy)
{
@@ -78,11 +78,11 @@ HBITMAP SkinEngine_CreateDIB32(int cx, int cy)
BITMAPINFO RGB32BitsBITMAPINFO;
memset(&RGB32BitsBITMAPINFO, 0, sizeof(BITMAPINFO));
RGB32BitsBITMAPINFO.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
- RGB32BitsBITMAPINFO.bmiHeader.biWidth=cx;//bm.bmWidth;
- RGB32BitsBITMAPINFO.bmiHeader.biHeight=cy;//bm.bmHeight;
+ RGB32BitsBITMAPINFO.bmiHeader.biWidth=cx;// bm.bmWidth;
+ RGB32BitsBITMAPINFO.bmiHeader.biHeight=cy;// bm.bmHeight;
RGB32BitsBITMAPINFO.bmiHeader.biPlanes=1;
RGB32BitsBITMAPINFO.bmiHeader.biBitCount=32;
- // pointer used for direct Bitmap pixels access
+ // pointer used for direct Bitmap pixels access
UINT *ptPixels;
@@ -107,10 +107,10 @@ BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName)
UINT count = image.GetFrameDimensionsCount();
GUID* pDimensionIDs = new GUID[count];
- // Get the list of frame dimensions from the Image object.
+ // Get the list of frame dimensions from the Image object.
image.GetFrameDimensionsList(pDimensionIDs, count);
- // Get the number of frames in the first dimension.
+ // Get the number of frames in the first dimension.
nFrameCount = image.GetFrameCount(&pDimensionIDs[0]);
delete []pDimensionIDs;
@@ -137,17 +137,17 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP *
count = image.GetFrameDimensionsCount();
GUID* pDimensionIDs = new GUID[count];
- // Get the list of frame dimensions from the Image object.
+ // Get the list of frame dimensions from the Image object.
image.GetFrameDimensionsList(pDimensionIDs, count);
- // Get the number of frames in the first dimension.
+ // Get the number of frames in the first dimension.
nFrameCount = image.GetFrameCount(&pDimensionIDs[0]);
- // Assume that the image has a property item of type PropertyItemEquipMake.
- // Get the size of that property item.
+ // Assume that the image has a property item of type PropertyItemEquipMake.
+ // Get the size of that property item.
int nSize = image.GetPropertyItemSize(PropertyTagFrameDelay);
- // Allocate a buffer to receive the property item.
+ // Allocate a buffer to receive the property item.
pPropertyItem = (PropertyItem*) mir_alloc(nSize);
image.GetPropertyItem(PropertyTagFrameDelay, nSize, pPropertyItem);
@@ -175,7 +175,7 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP *
0.0f, 0.0f, 0.0f, ((float)255)/255, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
- //attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
+ // attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
graphics.SetInterpolationMode(InterpolationModeHighQualityBicubic);
int * delays=(int*)mir_alloc(nFrameCount*sizeof(int));
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp
index 2c34d7e610..d4eec8539a 100644
--- a/plugins/Popup/src/popup_thread.cpp
+++ b/plugins/Popup/src/popup_thread.cpp
@@ -23,9 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
#include <process.h>
-//#include <list>
-// globals
+// globals
static int gIdleRequests = 0;
static bool gTerminating = false;
static HWND gHwndManager = 0;
@@ -35,10 +34,10 @@ static HANDLE hThread = 0;
static LIST<PopupWnd2> popupList(3);
-// forwards
+// forwards
enum
{
- // message id's
+ // message id's
UTM_PT_FIRST = WM_USER+1607,
UTM_STOP_THREAD,
UTM_ADD_WINDOW,
@@ -62,15 +61,15 @@ bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd)
if (prev)
prevSize = prev->getSize();
- //we have only one monitor (cant check it together with 1.if)
+ // we have only one monitor (cant check it together with 1.if)
RECT rc;
if ( GetSystemMetrics(SM_CMONITORS) == 1)
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
- else { //Multimonitor stuff (we have more then 1)
+ else { // Multimonitor stuff (we have more then 1)
HWND hWnd;
if (PopupOptions.Monitor == MN_MIRANDA)
hWnd = (HWND)CallService(MS_CLUI_GETHWND,0,0);
- else // PopupOptions.Monitor == MN_ACTIVE
+ else // PopupOptions.Monitor == MN_ACTIVE
hWnd = GetForegroundWindow();
HMONITOR hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);
@@ -202,10 +201,10 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA
return DefWindowProc(hwnd, message, wParam, lParam);
}
-// thread func
+// thread func
static unsigned __stdcall PopupThread(void *arg)
{
- // Create manager window
+ // Create manager window
DWORD err;
WNDCLASSEX wcl;
wcl.cbSize = sizeof(wcl);
@@ -257,7 +256,7 @@ void StopPopupThread()
void UnloadPopupThread()
{
- // We won't waint for thread to exit, Miranda's thread unsind mechanism will do that for us.
+ // We won't waint for thread to exit, Miranda's thread unsind mechanism will do that for us.
WaitForSingleObject(hThread, INFINITE);
CloseHandle(hThread);
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index e56281bd37..6eeef7e451 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -86,18 +86,18 @@ bool LoadPopupWnd2()
if (!g_wndClass.cPopupEditBox) {
TCHAR msg[2048];
mir_sntprintf(msg, SIZEOF(msg), TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
- wclw.cbSize, //UINT cbSize;
- wclw.style, //UINT style;
- wclw.lpfnWndProc, //WNDPROC lpfnWndProc;
- wclw.cbClsExtra, //int cbClsExtra;
- wclw.cbWndExtra, //int cbWndExtra;
- wclw.hInstance, //HINSTANCE hInstance;
- wclw.hIcon, //HICON hIcon;
- wclw.hCursor, //HCURSOR hCursor;
- wclw.hbrBackground, //HBRUSH hbrBackground;
- wclw.lpszMenuName, //LPCWSTR lpszMenuName;
- wclw.lpszClassName, //LPCWSTR lpszClassName;
- wclw.hIconSm //HICON hIconSm;
+ wclw.cbSize, // UINT cbSize;
+ wclw.style, // UINT style;
+ wclw.lpfnWndProc, // WNDPROC lpfnWndProc;
+ wclw.cbClsExtra, // int cbClsExtra;
+ wclw.cbWndExtra, // int cbWndExtra;
+ wclw.hInstance, // HINSTANCE hInstance;
+ wclw.hIcon, // HICON hIcon;
+ wclw.hCursor, // HCURSOR hCursor;
+ wclw.hbrBackground, // HBRUSH hbrBackground;
+ wclw.lpszMenuName, // LPCWSTR lpszMenuName;
+ wclw.lpszClassName, // LPCWSTR lpszClassName;
+ wclw.hIconSm // HICON hIconSm;
);
MSGERROR(msg);
@@ -183,21 +183,21 @@ void PopupWnd2::startThread()
void PopupWnd2::create()
{
m_hwnd = CreateWindowEx(
- WS_EX_TRANSPARENT| // prevents unwanted clicks
- WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
- _T(POPUP_WNDCLASS), // Class name
- NULL, // Title
- DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
- CW_USEDEFAULT, // x
- CW_USEDEFAULT, // y
- CW_USEDEFAULT, // Width
- CW_USEDEFAULT, // Height
- HWND_DESKTOP, // Parent
- NULL, // menu handle
- hInst, // Instance
+ WS_EX_TRANSPARENT| // prevents unwanted clicks
+ WS_EX_TOOLWINDOW|WS_EX_TOPMOST, // dwStyleEx
+ _T(POPUP_WNDCLASS), // Class name
+ NULL, // Title
+ DS_SETFONT|DS_FIXEDSYS|WS_POPUP, // dwStyle
+ CW_USEDEFAULT, // x
+ CW_USEDEFAULT, // y
+ CW_USEDEFAULT, // Width
+ CW_USEDEFAULT, // Height
+ HWND_DESKTOP, // Parent
+ NULL, // menu handle
+ hInst, // Instance
(LPVOID)this);
- // Shadows
+ // Shadows
ULONG_PTR style = GetClassLongPtr(m_hwnd, GCL_STYLE);
if (m_options->DropShadow && !(style & CS_DROPSHADOW))
style |= CS_DROPSHADOW;
@@ -206,7 +206,7 @@ void PopupWnd2::create()
SetClassLongPtr(m_hwnd, GCL_STYLE, style);
- // tooltips
+ // tooltips
m_hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
@@ -229,7 +229,7 @@ void PopupWnd2::updateLayered(BYTE opacity)
BLENDFUNCTION blend;
blend.BlendOp = AC_SRC_OVER;
blend.BlendFlags = 0;
- blend.SourceConstantAlpha = opacity; //m_options->UseTransparency ? opacity : 255;
+ blend.SourceConstantAlpha = opacity; // m_options->UseTransparency ? opacity : 255;
blend.AlphaFormat = AC_SRC_ALPHA;
UpdateLayeredWindow(m_hwnd, NULL, &ptDst, &m_sz,
@@ -256,22 +256,22 @@ void PopupWnd2::update()
const PopupSkin *skin = skins.getSkin(m_lpzSkin?m_lpzSkin:m_options->SkinPack);
if (!skin) return;
- // update avatar
+ // update avatar
fixAvatar();
- // destroy content bitmap so animate() can reallocate it if needed
+ // destroy content bitmap so animate() can reallocate it if needed
if (m_bmp) {
delete m_bmp;
m_bmp = NULL;
}
- // measure popup
+ // measure popup
if (m_bmpBase) delete m_bmpBase;
if (m_bmpAnimate) delete m_bmpAnimate;
m_bmpBase = new MyBitmap(1,1);
skin->measure(m_bmpBase->getDC(), this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options);
- // render popup
+ // render popup
m_bmpBase->allocate(m_sz.cx, m_sz.cy);
HDC hdc = m_bmpBase->getDC();
if (!skin) return;
@@ -282,7 +282,7 @@ void PopupWnd2::update()
{
SetTextColor(hdc, m_clClock);
HFONT hfnSave = (HFONT)SelectObject(m_bmpBase->getDC(), fonts.clock);
- SIZE sz; GetTextExtentPoint32(m_bmpBase->getDC(), m_time, mir_tstrlen(m_time), &sz);
+ SIZE sz; GetTextExtentPoint32(m_bmpBase->getDC(), m_time, (int)mir_tstrlen(m_time), &sz);
m_bmpBase->Draw_Text(m_time, this->m_sz.cx - sz.cx - STYLE_SZ_GAP - skin->getRightGap(), STYLE_SZ_GAP);
SelectObject(m_bmpBase->getDC(), hfnSave);
}
@@ -310,7 +310,7 @@ void PopupWnd2::animate()
m_bmpBase = NULL;
}
- // update layered window if supported
+ // update layered window if supported
updateLayered((m_options->UseTransparency && !(m_bIsHovered && m_options->OpaqueOnHover)) ? m_options->Alpha : 255);
if (m_bReshapeWindow)
@@ -330,7 +330,7 @@ void PopupWnd2::animate()
DeleteObject(bb.hRgnBlur);
}
- // update tooltips
+ // update tooltips
for (int i=0; i < m_actionCount; ++i) {
char *title = strchr(m_actions[i].actionA.lpzTitle, '/');
if (title) title++;
@@ -338,8 +338,8 @@ void PopupWnd2::animate()
AddTooltipTranslated(m_hwndToolTip, m_hwnd, i, m_actions[i].rc, title);
}
-// if (!customPopup && hwnd /*&& IsWindowVisible(hwnd)*/)
-// PopupThreadUpdateWindow(this);
+// if (!customPopup && hwnd /*&& IsWindowVisible(hwnd)*/)
+// PopupThreadUpdateWindow(this);
}
}
@@ -436,7 +436,7 @@ void PopupWnd2::show()
m_bSlide = m_bFade = false;
updateLayered((m_options->UseTransparency && !(m_bIsHovered && m_options->OpaqueOnHover)) ? m_options->Alpha : 255);
- //updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
+ // updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
SetWindowPos(m_hwnd, 0, m_pos.x, m_pos.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE|SWP_DEFERERASE|SWP_NOSENDCHANGING|SWP_SHOWWINDOW);
}
@@ -867,7 +867,7 @@ BOOL IsUtfSendAvailable(MCONTACT hContact)
{
char* szProto = GetContactProto(hContact);
if (szProto == NULL) return FALSE;
- //check for MetaContact and get szProto from subcontact
+ // check for MetaContact and get szProto from subcontact
if (!strcmp(szProto, META_PROTO)) {
MCONTACT hSubContact = db_mc_getDefault(hContact);
if (!hSubContact)
@@ -886,9 +886,9 @@ void AddMessageToDB(MCONTACT hContact, char *msg, int flag/*bool utf*/)
dbei.szModule = GetContactProto(hContact);
dbei.timestamp = time(NULL);
if ( !((flag & PREF_UTF) == PREF_UTF) && (flag & PREF_UNICODE) == PREF_UNICODE)
- dbei.cbBlob = (mir_tstrlen((LPTSTR)msg) + 1)*sizeof(TCHAR);
+ dbei.cbBlob = ((int)mir_tstrlen((LPTSTR)msg) + 1)*sizeof(TCHAR);
else
- dbei.cbBlob = mir_strlen(msg) + 1;
+ dbei.cbBlob = (int)mir_strlen(msg) + 1;
dbei.pBlob = (PBYTE)msg;
db_event_add(hContact, &dbei);
}
@@ -1005,8 +1005,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case ACT_DEF_REPLY:
{
if (!m_customPopup) PopupThreadLock();
- //RECT rc = renderInfo.textRect;
- //MapWindowPoints(hwnd, NULL, (LPPOINT)&rc, 2);
+ // RECT rc = renderInfo.textRect;
+ // MapWindowPoints(hwnd, NULL, (LPPOINT)&rc, 2);
RECT rc; GetWindowRect(m_hwnd, &rc);
HWND hwndEditBox = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST,
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 6c2fd14c6d..d1a71e5752 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
-int num_classes = 0; //for core class api support
+int num_classes = 0; // for core class api support
//===== Popup/AddPopup
INT_PTR Popup_AddPopup(WPARAM wParam, LPARAM lParam)
@@ -260,7 +260,7 @@ INT_PTR Popup_ShowMessageW(WPARAM wParam, LPARAM lParam)
ppd2.lchNotification = g_hntfNotification;
ppd2.lptzTitle = TranslateT("Notify");
break;
- default: //No no no... you must give me a good value.
+ default: // No no no... you must give me a good value.
return -1;
}
return Popup_AddPopup2((WPARAM)&ppd2, (LPARAM)((lParam & 0x80000000)?APF_NO_HISTORY:0));
@@ -285,14 +285,14 @@ INT_PTR Popup_Query(WPARAM wParam, LPARAM)
switch (wParam) {
case PUQS_ENABLEPOPUPS: {
- if (PopupOptions.ModuleIsEnabled) return 1; //They're already ON!!!
- else { //Module was disabled.
+ if (PopupOptions.ModuleIsEnabled) return 1; // They're already ON!!!
+ else { // Module was disabled.
svcEnableDisableMenuCommand(0,0);
return 0;
}
}
case PUQS_DISABLEPOPUPS: {
- if (!(PopupOptions.ModuleIsEnabled)) return 1; //They're already OFF!!!
+ if (!(PopupOptions.ModuleIsEnabled)) return 1; // They're already OFF!!!
else {
svcEnableDisableMenuCommand(0,0);
return 0;
@@ -376,7 +376,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
}
LoadClassSettings(ptd, PU_MODULCLASS);
- //we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
+ // we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
mir_snprintf(setting, 256, "%s/TextCol", ptd->pupClass.pszName);
ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = {0};
@@ -394,7 +394,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam)
fid.deffontsettings.colour = fonts.clText;
FontRegisterT(&fid);
- //we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
+ // we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
mir_snprintf(setting, 256, "%s/BgCol", ptd->pupClass.pszName);
ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = {0};
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp
index d9010f4af4..40526579e9 100644
--- a/plugins/Popup/src/skin.cpp
+++ b/plugins/Popup/src/skin.cpp
@@ -63,7 +63,7 @@ SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const
SIZE szText, szSpace;
LPTSTR wname = mir_a2t(name);
TCHAR *str = TranslateTS(wname);
- GetTextExtentPoint32(hdc, str, mir_tstrlen(str), &szText);
+ GetTextExtentPoint32(hdc, str, (int)mir_tstrlen(str), &szText);
mir_free(wname);
GetTextExtentPoint32(hdc, _T(" "), 1, &szSpace);
@@ -126,7 +126,7 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h
LPTSTR wname = mir_a2t(name);
TCHAR *str = TranslateTS(wname);
- GetTextExtentPoint32(bmp->getDC(), str, mir_tstrlen(str), &szText);
+ GetTextExtentPoint32(bmp->getDC(), str, (int)mir_tstrlen(str), &szText);
bmp->Draw_Text(str,
(PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16),
max(y + 2, y + 2 + (((PopupOptions.actions&ACT_LARGE) ? 32 : 16) - szText.cy) / 2));
@@ -180,7 +180,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
if ((head->type & ST_TYPEMASK) == ST_CLOCK)
break;
- if (head && head->myBmp) {//layerd clock
+ if (head && head->myBmp) { // layerd clock
SIZE szNew;
szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT];
szNew.cy = head->myBmp->getHeight();
@@ -194,9 +194,9 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
wnd->getArgs()->add("clock.height", szNew.cy);
STYLE_SZ_CLOCK = szNew.cx;
}
- else { //normal clock
+ else { // normal clock
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
wnd->getArgs()->add("clock.width", sz.cx + 2 * STYLE_SZ_GAP);
wnd->getArgs()->add("clock.height", sz.cy);
@@ -239,7 +239,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
- DrawTextEx(hdc, wnd->getText(), mir_tstrlen(wnd->getText()), &rc,
+ DrawTextEx(hdc, wnd->getText(), (int)mir_tstrlen(wnd->getText()), &rc,
DT_CALCRECT | DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
szNew.cx = rc.right;
szNew.cy = rc.bottom;
@@ -282,7 +282,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, 0, 0, szNew.cx, 0);
- DrawTextEx(hdc, wnd->getTitle(), mir_tstrlen(wnd->getTitle()), &rc,
+ DrawTextEx(hdc, wnd->getTitle(), (int)mir_tstrlen(wnd->getTitle()), &rc,
DT_CALCRECT | DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
szNew.cx = rc.right;
szNew.cy = rc.bottom;
@@ -344,7 +344,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options
}
else {
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
wnd->getArgs()->add("clock.width", sz.cx + 2 * STYLE_SZ_GAP);
wnd->getArgs()->add("clock.height", sz.cy);
@@ -438,7 +438,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
}
else {
HFONT hfnSave = (HFONT)SelectObject(hdc, fonts.clock);
- SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(hdc, wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
SelectObject(hdc, hfnSave);
STYLE_SZ_CLOCK = sz.cx + 2 * STYLE_SZ_GAP;
}
@@ -502,7 +502,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
case PopupWnd2::TT_UNICODE:
{
RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy);
- DrawTextEx(hdc, wnd->getText(), mir_tstrlen(wnd->getText()), &rc,
+ DrawTextEx(hdc, wnd->getText(), (int)mir_tstrlen(wnd->getText()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
}
break;
@@ -551,7 +551,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
{
HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy);
- DrawTextEx(hdc, wnd->getTitle(), mir_tstrlen(wnd->getTitle()), &rc,
+ DrawTextEx(hdc, wnd->getTitle(), (int)mir_tstrlen(wnd->getTitle()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
SelectObject(hdc, hFntSave);
}
@@ -691,7 +691,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *o
SetTextColor(hdc, wnd->getClockColor());
HFONT hfnSave = (HFONT)SelectObject(bmp->getDC(), fonts.clock);
- SIZE sz; GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), mir_tstrlen(wnd->getTime()), &sz);
+ SIZE sz; GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
bmp->Draw_Text(wnd->getTime(), x, y);
SelectObject(bmp->getDC(), hfnSave);
}
diff --git a/plugins/Popup/src/version.h b/plugins/Popup/src/version.h
index 445ddb4096..8c2bd1831c 100644
--- a/plugins/Popup/src/version.h
+++ b/plugins/Popup/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 2
#define __MINOR_VERSION 1
#define __RELEASE_NUM 1
-#define __BUILD_NUM 9
+#define __BUILD_NUM 10
#include <stdver.h>