summaryrefslogtreecommitdiff
path: root/plugins/MyDetails
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MyDetails')
-rw-r--r--plugins/MyDetails/mydetails_12.vcxproj8
-rw-r--r--plugins/MyDetails/src/Version.h8
-rw-r--r--plugins/MyDetails/src/commons.h8
-rw-r--r--plugins/MyDetails/src/data.cpp24
-rw-r--r--plugins/MyDetails/src/data.h4
-rw-r--r--plugins/MyDetails/src/frame.cpp244
-rw-r--r--plugins/MyDetails/src/frame.h4
-rw-r--r--plugins/MyDetails/src/mydetails.cpp22
-rw-r--r--plugins/MyDetails/src/options.cpp58
-rw-r--r--plugins/MyDetails/src/options.h6
-rw-r--r--plugins/MyDetails/src/services.cpp192
11 files changed, 287 insertions, 291 deletions
diff --git a/plugins/MyDetails/mydetails_12.vcxproj b/plugins/MyDetails/mydetails_12.vcxproj
index 190909cdc7..9e03b987b8 100644
--- a/plugins/MyDetails/mydetails_12.vcxproj
+++ b/plugins/MyDetails/mydetails_12.vcxproj
@@ -84,7 +84,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>commons.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
@@ -114,7 +114,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>commons.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
@@ -143,7 +143,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>commons.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
@@ -172,7 +172,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>commons.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
diff --git a/plugins/MyDetails/src/Version.h b/plugins/MyDetails/src/Version.h
index 5d948e087f..bcc3b87b42 100644
--- a/plugins/MyDetails/src/Version.h
+++ b/plugins/MyDetails/src/Version.h
@@ -7,8 +7,8 @@
#define __PLUGIN_NAME "My details"
#define __FILENAME "MyDetails.dll"
-#define __DESCRIPTION "Shows and allows you to edit your details for all protocols."
-#define __AUTHOR "Ricardo Pescuma Domenecci, Drugwash"
+#define __DESCRIPTION "Shows and allows you to edit your details for all protocols."
+#define __AUTHOR "Ricardo Pescuma Domenecci, Drugwash"
#define __AUTHOREMAIL ""
-#define __AUTHORWEB "http://miranda-ng.org/p/MyDetails/"
-#define __COPYRIGHT "© 2005-2008 Ricardo Pescuma Domenecci, Drugwash"
+#define __AUTHORWEB "http://miranda-ng.org/p/MyDetails/"
+#define __COPYRIGHT "© 2005-2008 Ricardo Pescuma Domenecci, Drugwash"
diff --git a/plugins/MyDetails/src/commons.h b/plugins/MyDetails/src/commons.h
index c779a189db..b18b58c210 100644
--- a/plugins/MyDetails/src/commons.h
+++ b/plugins/MyDetails/src/commons.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
@@ -67,8 +67,6 @@ Boston, MA 02111-1307, USA.
#define SETTING_DEFAULT_NICK "DefaultNick"
extern HINSTANCE hInst;
-extern long nickname_dialog_open;
-extern long status_msg_dialog_open;
extern bool g_bFramesExist, g_bAvsExist;
#define PS_GETMYNICKNAMEMAXLENGTH "/GetMyNicknameMaxLength"
@@ -87,7 +85,7 @@ static __inline int DRAW_TEXT(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRe
{
if (!opts.replace_smileys)
return DrawText(hDC, lpString, nCount, lpRect, uFormat);
-
+
return Smileys_DrawText(hDC, lpString, nCount, lpRect, uFormat | (opts.resize_smileys ? DT_RESIZE_SMILEYS : 0),
opts.use_contact_list_smileys ? "clist" : protocol, NULL);
}
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp
index ca7c6069d9..8451c124d5 100644
--- a/plugins/MyDetails/src/data.cpp
+++ b/plugins/MyDetails/src/data.cpp
@@ -577,18 +577,18 @@ static char *StatusModeToDbSetting(int status, const char *suffix)
static char str[64];
switch (status) {
- case ID_STATUS_AWAY: prefix = "Away"; break;
- case ID_STATUS_NA: prefix = "Na"; break;
- case ID_STATUS_DND: prefix = "Dnd"; break;
- case ID_STATUS_OCCUPIED: prefix = "Occupied"; break;
- case ID_STATUS_FREECHAT: prefix = "FreeChat"; break;
- case ID_STATUS_ONLINE: prefix = "On"; break;
- case ID_STATUS_OFFLINE: prefix = "Off"; break;
- case ID_STATUS_INVISIBLE: prefix = "Inv"; break;
- case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break;
- case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
- case ID_STATUS_IDLE: prefix = "Idl"; break;
- default: return NULL;
+ case ID_STATUS_AWAY: prefix = "Away"; break;
+ case ID_STATUS_NA: prefix = "Na"; break;
+ case ID_STATUS_DND: prefix = "Dnd"; break;
+ case ID_STATUS_OCCUPIED: prefix = "Occupied"; break;
+ case ID_STATUS_FREECHAT: prefix = "FreeChat"; break;
+ case ID_STATUS_ONLINE: prefix = "On"; break;
+ case ID_STATUS_OFFLINE: prefix = "Off"; break;
+ case ID_STATUS_INVISIBLE: prefix = "Inv"; break;
+ case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break;
+ case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break;
+ case ID_STATUS_IDLE: prefix = "Idl"; break;
+ default: return NULL;
}
mir_strcpy(str, prefix);
mir_strcat(str, suffix);
diff --git a/plugins/MyDetails/src/data.h b/plugins/MyDetails/src/data.h
index 53bc6ade9d..2423da653d 100644
--- a/plugins/MyDetails/src/data.h
+++ b/plugins/MyDetails/src/data.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp
index 0ebffc15bf..e592404583 100644
--- a/plugins/MyDetails/src/frame.cpp
+++ b/plugins/MyDetails/src/frame.cpp
@@ -74,8 +74,8 @@ BYTE font_styles[] = { DBFONTF_BOLD, 0, 0, DBFONTF_ITALIC, DBFONTF_ITALIC };
COLORREF font_colors[] = { RGB(0, 0, 0), RGB(0, 0, 0), RGB(0, 0, 0), RGB(150, 150, 150), RGB(150, 150, 150) };
static ColourID
- bg_colour = { sizeof(bg_colour), LPGEN("My details"), LPGEN("Background"), MODULE_NAME, "BackgroundColor", 0, GetSysColor(COLOR_BTNFACE) },
- av_colour = { sizeof(av_colour), LPGEN("My details"), LPGEN("Avatar border"), MODULE_NAME, "AvatarBorderColor", 0, RGB(0, 0, 0) };
+bg_colour = { sizeof(bg_colour), LPGEN("My details"), LPGEN("Background"), MODULE_NAME, "BackgroundColor", 0, GetSysColor(COLOR_BTNFACE) },
+av_colour = { sizeof(av_colour), LPGEN("My details"), LPGEN("Avatar border"), MODULE_NAME, "AvatarBorderColor", 0, RGB(0, 0, 0) };
int CreateFrame();
void FixMainMenu();
@@ -191,7 +191,7 @@ void DeInitFrames()
DestroyWindow(hwnd_container);
}
-int ReloadFont(WPARAM wParam, LPARAM lParam)
+int ReloadFont(WPARAM, LPARAM)
{
for (int i = 0; i < NUM_FONTS; i++) {
if (hFont[i] != 0)
@@ -215,7 +215,7 @@ int ReloadColour(WPARAM, LPARAM)
return 0;
}
-int SmileyAddOptionsChangedHook(WPARAM wParam, LPARAM lParam)
+int SmileyAddOptionsChangedHook(WPARAM, LPARAM)
{
RefreshFrame();
return 0;
@@ -274,7 +274,7 @@ int CreateFrame()
hwnd_frame = CreateWindow(WINDOW_CLASS_NAME, TranslateT("My details"), WS_CHILD | WS_VISIBLE,
0, 0, 10, 10, (HWND)CallService(MS_CLUI_GETHWND, 0, 0), NULL, hInst, NULL);
- CLISTFrame Frame = {0};
+ CLISTFrame Frame = { 0 };
Frame.cbSize = sizeof(Frame);
Frame.tname = TranslateT("My details");
@@ -372,15 +372,15 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP
break;
case WM_SIZE:
- {
- HWND child = (HWND)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- RECT r;
- GetClientRect(hwnd, &r);
+ {
+ HWND child = (HWND)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ RECT r;
+ GetClientRect(hwnd, &r);
- SetWindowPos(child, 0, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOACTIVATE);
- InvalidateRect(child, NULL, TRUE);
- }
- return TRUE;
+ SetWindowPos(child, 0, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOACTIVATE);
+ InvalidateRect(child, NULL, TRUE);
+ }
+ return TRUE;
case WM_CLOSE:
db_set_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 0);
@@ -467,7 +467,7 @@ RECT GetRect(HDC hdc, RECT rc, SIZE s, UINT uFormat, int next_top, int text_left
// Make it fit inside original rc
r.top = max(next_top, r.top);
- r.bottom = min(rc.bottom, r.bottom);
+ r.bottom = min(rc.bottom, r.bottom);
r.left = max(text_left, r.left);
r.right = min(rc.right, r.right);
@@ -749,7 +749,7 @@ void CalcRectangles(HWND hwnd)
data->proto_rect = GetRect(hdc, tmp_r, proto->description, _T(""), proto, uFormat, next_top, tmp_text_left, false, true, false);
if (opts.show_protocol_cycle_button) {
- data->draw_proto_cycle= true;
+ data->draw_proto_cycle = true;
RECT prev = r;
prev.top = next_top;
@@ -1148,9 +1148,9 @@ void Draw(HWND hwnd, HDC hdc_orig)
adr.hTargetDC = hdc;
adr.rcDraw = data->img_rect;
adr.dwFlags = AVDRQ_OWNPIC | AVDRQ_HIDEBORDERONTRANSPARENCY
- | (opts.draw_avatar_border ? AVDRQ_DRAWBORDER : 0 )
- | (opts.draw_avatar_round_corner ? AVDRQ_ROUNDEDCORNER : 0 );
- adr.clrBorder = opts.draw_avatar_border_color;
+ | (opts.draw_avatar_border ? AVDRQ_DRAWBORDER : 0)
+ | (opts.draw_avatar_round_corner ? AVDRQ_ROUNDEDCORNER : 0);
+ adr.clrBorder = opts.draw_avatar_border_color;
adr.radius = round_radius;
adr.alpha = 255;
adr.szProto = proto->name;
@@ -1384,7 +1384,7 @@ void MakeHover(HWND hwnd, bool draw, bool *hover, POINT *p, RECT *r)
}
}
-void ShowGlobalStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, POINT &p)
+void ShowGlobalStatusMenu(HWND hwnd, MyDetailsFrameData *data, POINT &p)
{
HMENU submenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
@@ -1408,7 +1408,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto
// Find the correct menu item
int count = GetMenuItemCount(menu);
for (int i = 0; i < count && submenu == NULL; i++) {
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
@@ -1433,7 +1433,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto
if (submenu != NULL) {
p.x = (opts.draw_text_align_right ? data->status_rect.right : data->status_rect.left);
- p.y = data->status_rect.bottom + 1;
+ p.y = data->status_rect.bottom + 1;
ClientToScreen(hwnd, &p);
int ret = TrackPopupMenu(submenu, TPM_TOPALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD
@@ -1458,7 +1458,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto
RemoveMenu(submenu, i, MF_BYPOSITION);
p.x = (opts.draw_text_align_right ? data->status_rect.right : data->status_rect.left);
- p.y = data->status_rect.bottom + 1;
+ p.y = data->status_rect.bottom + 1;
ClientToScreen(hwnd, &p);
int ret = TrackPopupMenu(submenu, TPM_TOPALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD
@@ -1479,7 +1479,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P
TCHAR tmp[128];
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Enable listening to for %s"), proto->description);
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
mii.fType = MFT_STRING;
@@ -1504,7 +1504,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P
SetMenuItemInfo(submenu, ID_LISTENINGTOPOPUP_SENDLISTENINGTO, FALSE, &mii);
p.x = (opts.draw_text_align_right ? data->listening_to_rect.right : data->listening_to_rect.left);
- p.y = data->listening_to_rect.bottom + 1;
+ p.y = data->listening_to_rect.bottom + 1;
ClientToScreen(hwnd, &p);
int ret = TrackPopupMenu(submenu, TPM_TOPALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD
@@ -1529,47 +1529,47 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
switch (msg) {
case WM_CREATE:
- {
- data = new MyDetailsFrameData();
- memset(data, 0, sizeof(MyDetailsFrameData));
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
-
- data->recalc_rectangles = true;
- data->get_status_messages = false;
- data->showing_menu = false;
-
- data->protocol_number = db_get_w(NULL, "MyDetails", "ProtocolNumber", 0);
- if (data->protocol_number >= protocols->GetSize())
- data->protocol_number = 0;
-
- SetCycleTime(hwnd);
- SetStatusMessageRefreshTime(hwnd);
+ {
+ data = new MyDetailsFrameData();
+ memset(data, 0, sizeof(MyDetailsFrameData));
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(TRACKMOUSEEVENT);
- tme.dwFlags = TME_HOVER | TME_LEAVE;
- tme.hwndTrack = hwnd;
- tme.dwHoverTime = HOVER_DEFAULT;
- TrackMouseEvent(&tme);
- }
- return TRUE;
+ data->recalc_rectangles = true;
+ data->get_status_messages = false;
+ data->showing_menu = false;
+
+ data->protocol_number = db_get_w(NULL, "MyDetails", "ProtocolNumber", 0);
+ if (data->protocol_number >= protocols->GetSize())
+ data->protocol_number = 0;
+
+ SetCycleTime(hwnd);
+ SetStatusMessageRefreshTime(hwnd);
+
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(TRACKMOUSEEVENT);
+ tme.dwFlags = TME_HOVER | TME_LEAVE;
+ tme.hwndTrack = hwnd;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ TrackMouseEvent(&tme);
+ }
+ return TRUE;
case WM_PRINTCLIENT:
Draw(hwnd, (HDC)wParam);
return TRUE;
case WM_PAINT:
- {
- RECT r;
- if (GetUpdateRect(hwnd, &r, FALSE)) {
- PAINTSTRUCT ps;
+ {
+ RECT r;
+ if (GetUpdateRect(hwnd, &r, FALSE)) {
+ PAINTSTRUCT ps;
- HDC hdc = BeginPaint(hwnd, &ps);
- Draw(hwnd, hdc);
- EndPaint(hwnd, &ps);
- }
+ HDC hdc = BeginPaint(hwnd, &ps);
+ Draw(hwnd, hdc);
+ EndPaint(hwnd, &ps);
}
- return TRUE;
+ }
+ return TRUE;
case WM_SIZE:
data->recalc_rectangles = true;
@@ -1645,7 +1645,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
data->showing_menu = true;
if (opts.global_on_status)
- ShowGlobalStatusMenu(hwnd, data, proto, p);
+ ShowGlobalStatusMenu(hwnd, data, p);
else
ShowProtocolStatusMenu(hwnd, data, proto, p);
@@ -1661,7 +1661,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
HMENU menu = CreatePopupMenu();
- for (int i = protocols->GetSize() - 1; i >= 0 ; i--) {
+ for (int i = protocols->GetSize() - 1; i >= 0; i--) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1681,7 +1681,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
p.x = data->proto_rect.right;
else
p.x = data->proto_rect.left;
- p.y = data->proto_rect.bottom + 1;
+ p.y = data->proto_rect.bottom + 1;
ClientToScreen(hwnd, &p);
int ret = TrackPopupMenu(menu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, p.x, p.y, 0, hwnd, NULL);
@@ -1722,7 +1722,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
TCHAR tmp[128];
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my avatar for %s..."), proto->description);
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1762,7 +1762,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
TCHAR tmp[128];
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my nickname for %s..."), proto->description);
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1810,7 +1810,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
// Add this proto to menu
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."), proto->description);
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1830,7 +1830,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my status message for %s..."),
CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, proto->status, GSMDF_TCHAR));
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
@@ -1869,7 +1869,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
if (opts.global_on_status)
ShowProtocolStatusMenu(hwnd, data, proto, p);
else
- ShowGlobalStatusMenu(hwnd, data, proto, p);
+ ShowGlobalStatusMenu(hwnd, data, p);
}
// In listening to?
else if (data->draw_listening_to && InsideRect(&p, &data->listening_to_rect) && protocols->CanSetListeningTo())
@@ -1891,7 +1891,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
// Add this proto to menu
TCHAR tmp[128];
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Enable listening to for %s"), proto->description);
@@ -1939,7 +1939,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
mii.cch = (int)_tcslen(tmp);
mii.wID = 3;
- if ( !proto->CanSetStatusMsg()) {
+ if (!proto->CanSetStatusMsg()) {
mii.fMask |= MIIM_STATE;
mii.fState = MFS_DISABLED;
}
@@ -2057,14 +2057,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
case WM_NCMOUSELEAVE:
case WM_MOUSELEAVE:
- {
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(TRACKMOUSEEVENT);
- tme.dwFlags = TME_HOVER;
- tme.hwndTrack = hwnd;
- tme.dwHoverTime = HOVER_DEFAULT;
- TrackMouseEvent(&tme);
- }
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(TRACKMOUSEEVENT);
+ tme.dwFlags = TME_HOVER;
+ tme.hwndTrack = hwnd;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ TrackMouseEvent(&tme);
+ }
case WM_NCMOUSEMOVE:
MakeHover(hwnd, data->draw_img, &data->mouse_over_img, NULL, NULL);
MakeHover(hwnd, data->draw_nick, &data->mouse_over_nick, NULL, NULL);
@@ -2075,14 +2075,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
break;
case WM_MOUSEHOVER:
- {
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(TRACKMOUSEEVENT);
- tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = hwnd;
- tme.dwHoverTime = HOVER_DEFAULT;
- TrackMouseEvent(&tme);
- }
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(TRACKMOUSEEVENT);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ TrackMouseEvent(&tme);
+ }
case WM_MOUSEMOVE:
proto = protocols->Get(data->protocol_number);
if (proto != NULL) {
@@ -2097,38 +2097,36 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
break;
case WM_NOTIFY:
+ {
+ LPNMHDR lpnmhdr = (LPNMHDR)lParam;
+
+ switch (lpnmhdr->code) {
+ case TTN_GETDISPINFO:
{
- LPNMHDR lpnmhdr = (LPNMHDR)lParam;
-
- int i = (int)lpnmhdr->code;
-
- switch (lpnmhdr->code) {
- case TTN_GETDISPINFO:
- {
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- proto = protocols->Get(data->protocol_number);
-
- LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO)lpnmhdr;
- SendMessage(lpnmhdr->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 300);
-
- if (lpnmhdr->hwndFrom == data->nick_tt_hwnd)
- lpttd->lpszText = proto->nickname;
- else if (lpnmhdr->hwndFrom == data->status_tt_hwnd)
- lpttd->lpszText = proto->status_name;
- else if (lpnmhdr->hwndFrom == data->away_msg_tt_hwnd)
- lpttd->lpszText = proto->status_message;
- else if (lpnmhdr->hwndFrom == data->listening_to_tt_hwnd)
- lpttd->lpszText = proto->listening_to;
- else if (lpnmhdr->hwndFrom == data->next_proto_tt_hwnd)
- lpttd->lpszText = TranslateT("Show next account");
- else if (lpnmhdr->hwndFrom == data->prev_proto_tt_hwnd)
- lpttd->lpszText = TranslateT("Show previous account");
-
- return 0;
- }
- }
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ proto = protocols->Get(data->protocol_number);
+
+ LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO)lpnmhdr;
+ SendMessage(lpnmhdr->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 300);
+
+ if (lpnmhdr->hwndFrom == data->nick_tt_hwnd)
+ lpttd->lpszText = proto->nickname;
+ else if (lpnmhdr->hwndFrom == data->status_tt_hwnd)
+ lpttd->lpszText = proto->status_name;
+ else if (lpnmhdr->hwndFrom == data->away_msg_tt_hwnd)
+ lpttd->lpszText = proto->status_message;
+ else if (lpnmhdr->hwndFrom == data->listening_to_tt_hwnd)
+ lpttd->lpszText = proto->listening_to;
+ else if (lpnmhdr->hwndFrom == data->next_proto_tt_hwnd)
+ lpttd->lpszText = TranslateT("Show next account");
+ else if (lpnmhdr->hwndFrom == data->prev_proto_tt_hwnd)
+ lpttd->lpszText = TranslateT("Show previous account");
+
+ return 0;
}
- break;
+ }
+ }
+ break;
case WM_DESTROY:
KillTimer(hwnd, ID_FRAME_TIMER);
@@ -2138,7 +2136,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
delete data;
break;
- // Custom Messages //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // Custom Messages //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
case MWM_REFRESH:
KillTimer(hwnd, ID_RECALC_TIMER);
SetTimer(hwnd, ID_RECALC_TIMER, RECALC_TIME, NULL);
@@ -2192,7 +2190,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
return DefWindowProc(hwnd, msg, wParam, lParam);
}
-INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowHideFrameFunc(WPARAM, LPARAM)
{
if (g_bFramesExist)
CallService(MS_CLIST_FRAMES_SHFRAME, frame_id, 0);
@@ -2209,7 +2207,7 @@ INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR ShowFrameFunc(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowFrameFunc(WPARAM, LPARAM)
{
if (g_bFramesExist) {
int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0);
@@ -2228,7 +2226,7 @@ INT_PTR ShowFrameFunc(WPARAM wParam, LPARAM lParam)
}
-INT_PTR HideFrameFunc(WPARAM wParam, LPARAM lParam)
+INT_PTR HideFrameFunc(WPARAM, LPARAM)
{
if (g_bFramesExist) {
int flags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, frame_id), 0);
@@ -2324,7 +2322,7 @@ void SetStatusMessageRefreshTime(HWND hwnd)
SetTimer(hwnd, ID_STATUSMESSAGE_TIMER, opts.refresh_status_message_timer * 1000, NULL);
}
-INT_PTR PluginCommand_ShowNextProtocol(WPARAM wParam, LPARAM lParam)
+INT_PTR PluginCommand_ShowNextProtocol(WPARAM, LPARAM)
{
if (hwnd_frame == NULL)
return -1;
@@ -2346,7 +2344,7 @@ INT_PTR PluginCommand_ShowNextProtocol(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM wParam, LPARAM lParam)
+INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM, LPARAM)
{
if (hwnd_frame == NULL)
return -1;
@@ -2368,14 +2366,14 @@ INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR PluginCommand_ShowProtocol(WPARAM wParam, LPARAM lParam)
+INT_PTR PluginCommand_ShowProtocol(WPARAM, LPARAM lParam)
{
char *proto = (char *)lParam;
if (proto == NULL)
return -1;
int proto_num = -1;
- for (int i = 0 ; i < protocols->GetSize(); i++) {
+ for (int i = 0; i < protocols->GetSize(); i++) {
if (_stricmp(protocols->Get(i)->name, proto) == 0) {
proto_num = i;
break;
@@ -2434,7 +2432,7 @@ int SettingsChangedHook(WPARAM wParam, LPARAM lParam)
return 0;
}
-int AvatarChangedHook(WPARAM wParam, LPARAM lParam)
+int AvatarChangedHook(WPARAM wParam, LPARAM)
{
if (hwnd_frame == NULL)
return 0;
@@ -2447,7 +2445,7 @@ int AvatarChangedHook(WPARAM wParam, LPARAM lParam)
return 0;
}
-int ProtoAckHook(WPARAM wParam, LPARAM lParam)
+int ProtoAckHook(WPARAM, LPARAM lParam)
{
if (hwnd_frame == NULL)
return 0;
@@ -2477,7 +2475,7 @@ int ProtoAckHook(WPARAM wParam, LPARAM lParam)
return 0;
}
-int ListeningtoEnableStateChangedHook(WPARAM wParam, LPARAM lParam)
+int ListeningtoEnableStateChangedHook(WPARAM wParam, LPARAM)
{
if (hwnd_frame == NULL)
return 0;
diff --git a/plugins/MyDetails/src/frame.h b/plugins/MyDetails/src/frame.h
index 4ed686571f..db60847c33 100644
--- a/plugins/MyDetails/src/frame.h
+++ b/plugins/MyDetails/src/frame.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp
index e67a2c5b8c..1bfb2b5c85 100644
--- a/plugins/MyDetails/src/mydetails.cpp
+++ b/plugins/MyDetails/src/mydetails.cpp
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
#include "commons.h"
@@ -26,7 +26,7 @@ bool g_bAvsExist;
// Plugin data ////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo={
+PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -37,7 +37,7 @@ PLUGININFOEX pluginInfo={
__AUTHORWEB,
UNICODE_AWARE,
// {A82BAEB3-A33C-4036-B837-7803A5B6C2AB}
- {0xa82baeb3, 0xa33c, 0x4036, {0xb8, 0x37, 0x78, 0x3, 0xa5, 0xb6, 0xc2, 0xab}}
+ { 0xa82baeb3, 0xa33c, 0x4036, { 0xb8, 0x37, 0x78, 0x3, 0xa5, 0xb6, 0xc2, 0xab } }
};
static IconItem iconList[] =
@@ -49,36 +49,36 @@ static IconItem iconList[] =
// Functions //////////////////////////////////////////////////////////////////////////////////////
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
// Services ///////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR Menu_SetMyAvatarUI(WPARAM wParam, LPARAM lParam)
+static INT_PTR Menu_SetMyAvatarUI(WPARAM, LPARAM)
{
return PluginCommand_SetMyAvatarUI(0, 0);
}
-static INT_PTR Menu_SetMyNicknameUI(WPARAM wParam, LPARAM lParam)
+static INT_PTR Menu_SetMyNicknameUI(WPARAM, LPARAM)
{
return PluginCommand_SetMyNicknameUI(0, 0);
}
-static INT_PTR Menu_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam)
+static INT_PTR Menu_SetMyStatusMessageUI(WPARAM, LPARAM)
{
return PluginCommand_SetMyStatusMessageUI(0, 0);
}
// Hook called after init
-static int MainInit(WPARAM wparam, LPARAM lparam)
+static int MainInit(WPARAM, LPARAM)
{
g_bAvsExist = ServiceExists(MS_AV_GETMYAVATAR) != 0;
g_bFramesExist = ServiceExists(MS_CLIST_FRAMES_ADDFRAME) != 0;
@@ -128,7 +128,7 @@ static int MainInit(WPARAM wparam, LPARAM lparam)
return 0;
}
-static int MainUninit(WPARAM wParam, LPARAM lParam)
+static int MainUninit(WPARAM, LPARAM)
{
DeInitFrames();
return 0;
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp
index c159ae5cab..650120ebba 100644
--- a/plugins/MyDetails/src/options.cpp
+++ b/plugins/MyDetails/src/options.cpp
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
@@ -27,33 +27,33 @@ Options opts;
// Functions //////////////////////////////////////////////////////////////////////////////////////
static OptPageControl pageControls[] = {
- { &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (BYTE)1 },
- { &opts.seconds_to_show_protocol, CONTROL_SPIN, IDC_CYCLE_TIME, "CicleTime", (WORD)5, IDC_CYCLE_TIME_SPIN, (WORD)1, (WORD)255 },
- { &opts.draw_show_protocol_name, CONTROL_CHECKBOX, IDC_SHOW_PROTO_NAME, "ShowProtocolName", (BYTE)1 },
- { &opts.show_protocol_cycle_button, CONTROL_CHECKBOX, IDC_SHOW_CYCLE_PROTO_BUTTON, "ShowProtocolCycleButton", (BYTE)0 },
- { &opts.draw_text_rtl, CONTROL_CHECKBOX, IDC_TEXT_RTL, "TextRTL", (BYTE)0 },
- { &opts.draw_text_align_right, CONTROL_CHECKBOX, IDC_TEXT_ALIGN_RIGHT, "TextAlignRight", (BYTE)0 },
- { &opts.replace_smileys, CONTROL_CHECKBOX, IDC_REPLACE_SMILEYS, "ReplaceSmileys", (BYTE)1 },
- { &opts.resize_smileys, CONTROL_CHECKBOX, IDC_RESIZE_SMILEYS, "ResizeSmileys", (BYTE)0 },
- { &opts.use_contact_list_smileys, CONTROL_CHECKBOX, IDC_USE_CONTACT_LIST_SMILEYS, "UseContactListSmileys", (BYTE)0 },
- { &opts.global_on_avatar, CONTROL_CHECKBOX, IDC_GLOBAL_ON_AVATAR, "GlobalOnAvatar", (BYTE)0 },
- { &opts.global_on_nickname, CONTROL_CHECKBOX, IDC_GLOBAL_ON_NICKNAME, "GlobalOnNickname", (BYTE)0 },
- { &opts.global_on_status, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS, "GlobalOnStatus", (BYTE)0 },
- { &opts.global_on_status_message, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS_MESSAGE, "GlobalOnStatusMessage", (BYTE)0 },
- { &opts.draw_avatar_allow_to_grow, CONTROL_CHECKBOX, IDC_AVATAR_ALLOW_TO_GROW, "AvatarAllowToGrow", (BYTE)0 },
- { &opts.draw_avatar_custom_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_SIZE_CHK, "AvatarCustomSize", (BYTE)0 },
- { &opts.draw_avatar_custom_size_pixels, CONTROL_SPIN, IDC_AVATAR_CUSTOM_SIZE, "AvatarCustomSizePixels", (WORD)30, IDC_AVATAR_CUSTOM_SIZE_SPIN, (WORD)1, (WORD)255 },
- { &opts.draw_avatar_border, CONTROL_CHECKBOX, IDC_AVATAR_DRAW_BORDER, "AvatarDrawBorders", (BYTE)0 },
- { &opts.draw_avatar_round_corner, CONTROL_CHECKBOX, IDC_AVATAR_ROUND_CORNERS, "AvatarRoundCorners", (BYTE)1 },
- { &opts.draw_avatar_use_custom_corner_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, "AvatarUseCustomCornerSize", (BYTE)0 },
- { &opts.draw_avatar_custom_corner_size, CONTROL_SPIN, IDC_AVATAR_CUSTOM_CORNER_SIZE, "AvatarCustomCornerSize", (WORD)4, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, (WORD)1, (WORD)255 },
- { &opts.use_avatar_space_to_draw_text, CONTROL_CHECKBOX, IDC_AVATAR_USE_FREE_SPACE, "AvatarUseFreeSpaceToDrawText", (BYTE)1 },
- { &opts.resize_frame, CONTROL_CHECKBOX, IDC_RESIZE_FRAME, "ResizeFrame", (BYTE)0 },
- { &opts.use_skinning, CONTROL_CHECKBOX, IDC_USE_SKINNING, "UseSkinning", (BYTE)0 },
- { &opts.borders[RIGHT], CONTROL_SPIN, IDC_BORDER_RIGHT, "BorderRight", (WORD)8, IDC_BORDER_RIGHT_SPIN, (WORD)0, (WORD)255 },
- { &opts.borders[LEFT], CONTROL_SPIN, IDC_BORDER_LEFT, "BorderLeft", (WORD)8, IDC_BORDER_LEFT_SPIN, (WORD)0, (WORD)255 },
- { &opts.borders[TOP], CONTROL_SPIN, IDC_BORDER_TOP, "BorderTop", (WORD)8, IDC_BORDER_TOP_SPIN, (WORD)0, (WORD)255 },
- { &opts.borders[BOTTOM], CONTROL_SPIN, IDC_BORDER_BOTTOM, "BorderBottom", (WORD)8, IDC_BORDER_BOTTOM_SPIN, (WORD)0, (WORD)255 },
+ { &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (BYTE)1 },
+ { &opts.seconds_to_show_protocol, CONTROL_SPIN, IDC_CYCLE_TIME, "CicleTime", (WORD)5, IDC_CYCLE_TIME_SPIN, (WORD)1, (WORD)255 },
+ { &opts.draw_show_protocol_name, CONTROL_CHECKBOX, IDC_SHOW_PROTO_NAME, "ShowProtocolName", (BYTE)1 },
+ { &opts.show_protocol_cycle_button, CONTROL_CHECKBOX, IDC_SHOW_CYCLE_PROTO_BUTTON, "ShowProtocolCycleButton", (BYTE)0 },
+ { &opts.draw_text_rtl, CONTROL_CHECKBOX, IDC_TEXT_RTL, "TextRTL", (BYTE)0 },
+ { &opts.draw_text_align_right, CONTROL_CHECKBOX, IDC_TEXT_ALIGN_RIGHT, "TextAlignRight", (BYTE)0 },
+ { &opts.replace_smileys, CONTROL_CHECKBOX, IDC_REPLACE_SMILEYS, "ReplaceSmileys", (BYTE)1 },
+ { &opts.resize_smileys, CONTROL_CHECKBOX, IDC_RESIZE_SMILEYS, "ResizeSmileys", (BYTE)0 },
+ { &opts.use_contact_list_smileys, CONTROL_CHECKBOX, IDC_USE_CONTACT_LIST_SMILEYS, "UseContactListSmileys", (BYTE)0 },
+ { &opts.global_on_avatar, CONTROL_CHECKBOX, IDC_GLOBAL_ON_AVATAR, "GlobalOnAvatar", (BYTE)0 },
+ { &opts.global_on_nickname, CONTROL_CHECKBOX, IDC_GLOBAL_ON_NICKNAME, "GlobalOnNickname", (BYTE)0 },
+ { &opts.global_on_status, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS, "GlobalOnStatus", (BYTE)0 },
+ { &opts.global_on_status_message, CONTROL_CHECKBOX, IDC_GLOBAL_ON_STATUS_MESSAGE, "GlobalOnStatusMessage", (BYTE)0 },
+ { &opts.draw_avatar_allow_to_grow, CONTROL_CHECKBOX, IDC_AVATAR_ALLOW_TO_GROW, "AvatarAllowToGrow", (BYTE)0 },
+ { &opts.draw_avatar_custom_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_SIZE_CHK, "AvatarCustomSize", (BYTE)0 },
+ { &opts.draw_avatar_custom_size_pixels, CONTROL_SPIN, IDC_AVATAR_CUSTOM_SIZE, "AvatarCustomSizePixels", (WORD)30, IDC_AVATAR_CUSTOM_SIZE_SPIN, (WORD)1, (WORD)255 },
+ { &opts.draw_avatar_border, CONTROL_CHECKBOX, IDC_AVATAR_DRAW_BORDER, "AvatarDrawBorders", (BYTE)0 },
+ { &opts.draw_avatar_round_corner, CONTROL_CHECKBOX, IDC_AVATAR_ROUND_CORNERS, "AvatarRoundCorners", (BYTE)1 },
+ { &opts.draw_avatar_use_custom_corner_size, CONTROL_CHECKBOX, IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK, "AvatarUseCustomCornerSize", (BYTE)0 },
+ { &opts.draw_avatar_custom_corner_size, CONTROL_SPIN, IDC_AVATAR_CUSTOM_CORNER_SIZE, "AvatarCustomCornerSize", (WORD)4, IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN, (WORD)1, (WORD)255 },
+ { &opts.use_avatar_space_to_draw_text, CONTROL_CHECKBOX, IDC_AVATAR_USE_FREE_SPACE, "AvatarUseFreeSpaceToDrawText", (BYTE)1 },
+ { &opts.resize_frame, CONTROL_CHECKBOX, IDC_RESIZE_FRAME, "ResizeFrame", (BYTE)0 },
+ { &opts.use_skinning, CONTROL_CHECKBOX, IDC_USE_SKINNING, "UseSkinning", (BYTE)0 },
+ { &opts.borders[RIGHT], CONTROL_SPIN, IDC_BORDER_RIGHT, "BorderRight", (WORD)8, IDC_BORDER_RIGHT_SPIN, (WORD)0, (WORD)255 },
+ { &opts.borders[LEFT], CONTROL_SPIN, IDC_BORDER_LEFT, "BorderLeft", (WORD)8, IDC_BORDER_LEFT_SPIN, (WORD)0, (WORD)255 },
+ { &opts.borders[TOP], CONTROL_SPIN, IDC_BORDER_TOP, "BorderTop", (WORD)8, IDC_BORDER_TOP_SPIN, (WORD)0, (WORD)255 },
+ { &opts.borders[BOTTOM], CONTROL_SPIN, IDC_BORDER_BOTTOM, "BorderBottom", (WORD)8, IDC_BORDER_BOTTOM_SPIN, (WORD)0, (WORD)255 },
};
diff --git a/plugins/MyDetails/src/options.h b/plugins/MyDetails/src/options.h
index 8e215e80e3..5dce0b8677 100644
--- a/plugins/MyDetails/src/options.h
+++ b/plugins/MyDetails/src/options.h
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA.
#define BOTTOM 2
#define RIGHT 3
-struct Options
+struct Options
{
bool cycle_through_protocols;
int seconds_to_show_protocol;
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp
index c5a1798889..80de374451 100644
--- a/plugins/MyDetails/src/services.cpp
+++ b/plugins/MyDetails/src/services.cpp
@@ -29,7 +29,7 @@ static HWND hwndSetStatusMsg;
#define WMU_SETDATA (WM_USER + 1)
-static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM)
{
switch (msg) {
case WM_INITDIALOG:
@@ -38,72 +38,72 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
return TRUE;
case WMU_SETDATA:
- {
- int proto_num = (int)wParam;
+ {
+ int proto_num = (int)wParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, proto_num);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, proto_num);
- if (proto_num == -1) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+ if (proto_num == -1) {
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
- // All protos have the same nick?
- if (protocols->GetSize() > 0) {
- TCHAR *nick = protocols->Get(0)->nickname;
+ // All protos have the same nick?
+ if (protocols->GetSize() > 0) {
+ TCHAR *nick = protocols->Get(0)->nickname;
- bool foundDefNick = true;
- for (int i = 1; foundDefNick && i < protocols->GetSize(); i++) {
- if (_tcsicmp(protocols->Get(i)->nickname, nick) != 0) {
- foundDefNick = false;
- break;
- }
+ bool foundDefNick = true;
+ for (int i = 1; foundDefNick && i < protocols->GetSize(); i++) {
+ if (_tcsicmp(protocols->Get(i)->nickname, nick) != 0) {
+ foundDefNick = false;
+ break;
}
-
- if (foundDefNick)
- if (_tcsicmp(protocols->default_nick, nick) != 0)
- mir_tstrcpy(protocols->default_nick, nick);
}
- SetDlgItemText(hwndDlg, IDC_NICKNAME, protocols->default_nick);
- SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE, 0);
+ if (foundDefNick)
+ if (_tcsicmp(protocols->default_nick, nick) != 0)
+ mir_tstrcpy(protocols->default_nick, nick);
}
- else {
- Protocol *proto = protocols->Get(proto_num);
- TCHAR tmp[128];
- mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my nickname for %s"), proto->description);
+ SetDlgItemText(hwndDlg, IDC_NICKNAME, protocols->default_nick);
+ SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT, MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE, 0);
+ }
+ else {
+ Protocol *proto = protocols->Get(proto_num);
- SetWindowText(hwndDlg, tmp);
+ TCHAR tmp[128];
+ mir_sntprintf(tmp, SIZEOF(tmp), TranslateT("Set my nickname for %s"), proto->description);
- HICON hIcon = (HICON)CallProtoService(proto->name, PS_LOADICON, PLI_PROTOCOL, 0);
- if (hIcon != NULL) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
- DestroyIcon(hIcon);
- }
+ SetWindowText(hwndDlg, tmp);
- SetDlgItemText(hwndDlg, IDC_NICKNAME, proto->nickname);
- SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT,
- min(MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE, proto->GetNickMaxLength()), 0);
+ HICON hIcon = (HICON)CallProtoService(proto->name, PS_LOADICON, PLI_PROTOCOL, 0);
+ if (hIcon != NULL) {
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
+ DestroyIcon(hIcon);
}
- return TRUE;
+ SetDlgItemText(hwndDlg, IDC_NICKNAME, proto->nickname);
+ SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT,
+ min(MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE, proto->GetNickMaxLength()), 0);
}
+ return TRUE;
+ }
+
case WM_COMMAND:
switch (wParam) {
case IDOK:
- {
- TCHAR tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
- GetDlgItemText(hwndDlg, IDC_NICKNAME, tmp, SIZEOF(tmp));
+ {
+ TCHAR tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
+ GetDlgItemText(hwndDlg, IDC_NICKNAME, tmp, SIZEOF(tmp));
- LONG_PTR proto_num = GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (proto_num == -1)
- protocols->SetNicks(tmp);
- else
- protocols->Get(proto_num)->SetNick(tmp);
+ LONG_PTR proto_num = GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ if (proto_num == -1)
+ protocols->SetNicks(tmp);
+ else
+ protocols->Get(proto_num)->SetNick(tmp);
- DestroyWindow(hwndDlg);
- break;
- }
+ DestroyWindow(hwndDlg);
+ break;
+ }
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
@@ -122,14 +122,14 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
return FALSE;
}
-INT_PTR PluginCommand_SetMyNicknameUI(WPARAM wParam, LPARAM lParam)
+INT_PTR PluginCommand_SetMyNicknameUI(WPARAM, LPARAM lParam)
{
char *proto = (char *)lParam;
int proto_num = -1;
if (proto != NULL) {
int i;
- for (i = 0 ; i < protocols->GetSize() ; i++) {
+ for (i = 0; i < protocols->GetSize(); i++) {
if (_stricmp(protocols->Get(i)->name, proto) == 0) {
proto_num = i;
break;
@@ -154,7 +154,7 @@ INT_PTR PluginCommand_SetMyNicknameUI(WPARAM wParam, LPARAM lParam)
SetForegroundWindow(hwndSetNickname);
SetFocus(hwndSetNickname);
- ShowWindow(hwndSetNickname, SW_SHOW);
+ ShowWindow(hwndSetNickname, SW_SHOW);
return 0;
}
@@ -208,7 +208,7 @@ INT_PTR PluginCommand_GetMyNickname(WPARAM wParam, LPARAM lParam)
// Set avatar /////////////////////////////////////////////////////////////////////////////////////
-INT_PTR PluginCommand_SetMyAvatarUI(WPARAM wParam, LPARAM lParam)
+INT_PTR PluginCommand_SetMyAvatarUI(WPARAM, LPARAM lParam)
{
char *proto = (char *)lParam;
int proto_num = -1;
@@ -323,65 +323,65 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w
return TRUE;
case WMU_SETDATA:
- {
- SetStatusMessageData *data = (SetStatusMessageData *)malloc(sizeof(SetStatusMessageData));
- data->status = (int)wParam;
- data->proto_num = (int)lParam;
-
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data);
+ {
+ SetStatusMessageData *data = (SetStatusMessageData *)malloc(sizeof(SetStatusMessageData));
+ data->status = (int)wParam;
+ data->proto_num = (int)lParam;
- if (data->proto_num >= 0) {
- Protocol *proto = protocols->Get(data->proto_num);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)data);
- HICON hIcon = (HICON)CallProtoService(proto->name, PS_LOADICON, PLI_PROTOCOL, 0);
- if (hIcon != NULL) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
- DestroyIcon(hIcon);
- }
-
- TCHAR title[256];
- mir_sntprintf(title, SIZEOF(title), TranslateT("Set my status message for %s"), proto->description);
- SetWindowText(hwndDlg, title);
+ if (data->proto_num >= 0) {
+ Protocol *proto = protocols->Get(data->proto_num);
- SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
+ HICON hIcon = (HICON)CallProtoService(proto->name, PS_LOADICON, PLI_PROTOCOL, 0);
+ if (hIcon != NULL) {
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
+ DestroyIcon(hIcon);
}
- else if (data->status != 0) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedProtoIcon(NULL,data->status));
- TCHAR title[256];
- mir_sntprintf(title, SIZEOF(title), TranslateT("Set my status message for %s"),
- CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, data->status, GSMDF_TCHAR));
- SetWindowText(hwndDlg, title);
+ TCHAR title[256];
+ mir_sntprintf(title, SIZEOF(title), TranslateT("Set my status message for %s"), proto->description);
+ SetWindowText(hwndDlg, title);
- SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
- }
- else {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+ SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
+ }
+ else if (data->status != 0) {
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedProtoIcon(NULL, data->status));
- SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg());
- }
+ TCHAR title[256];
+ mir_sntprintf(title, SIZEOF(title), TranslateT("Set my status message for %s"),
+ CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, data->status, GSMDF_TCHAR));
+ SetWindowText(hwndDlg, title);
- return TRUE;
+ SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
}
+ else {
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+
+ SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg());
+ }
+
+ return TRUE;
+ }
case WM_COMMAND:
switch (wParam) {
case IDOK:
- {
- TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
- GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, SIZEOF(tmp));
+ {
+ TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
+ GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, SIZEOF(tmp));
- SetStatusMessageData *data = (SetStatusMessageData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ SetStatusMessageData *data = (SetStatusMessageData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (data->proto_num >= 0)
- protocols->Get(data->proto_num)->SetStatusMsg(tmp);
- else if (data->status == 0)
- protocols->SetStatusMsgs(tmp);
- else
- protocols->SetStatusMsgs(data->status, tmp);
+ if (data->proto_num >= 0)
+ protocols->Get(data->proto_num)->SetStatusMsg(tmp);
+ else if (data->status == 0)
+ protocols->SetStatusMsgs(tmp);
+ else
+ protocols->SetStatusMsgs(data->status, tmp);
- DestroyWindow(hwndDlg);
- }
- break;
+ DestroyWindow(hwndDlg);
+ }
+ break;
case IDCANCEL:
DestroyWindow(hwndDlg);
@@ -452,7 +452,7 @@ INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam)
SetForegroundWindow(hwndSetStatusMsg);
SetFocus(hwndSetStatusMsg);
- ShowWindow(hwndSetStatusMsg, SW_SHOW);
+ ShowWindow(hwndSetStatusMsg, SW_SHOW);
return 0;
}
@@ -461,7 +461,7 @@ INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam, LPARAM lParam)
}
-INT_PTR PluginCommand_CycleThroughtProtocols(WPARAM wParam, LPARAM lParam)
+INT_PTR PluginCommand_CycleThroughtProtocols(WPARAM wParam, LPARAM)
{
db_set_b(NULL, "MyDetails", "CicleThroughtProtocols", (BYTE)wParam);