diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-16 23:08:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-16 23:08:55 +0000 |
commit | 0c060267ccea726d5c2c2fd1e45d1f16965fb01e (patch) | |
tree | ef15e5533dbda23f63e423056b9d746e5d643ae3 /plugins/Popup | |
parent | af58213e6005cbf4b9ce8be2ad66eb6eae3df4a9 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14975 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup')
-rw-r--r-- | plugins/Popup/Popup.vcxproj | 5 | ||||
-rw-r--r-- | plugins/Popup/src/effects.cpp | 16 | ||||
-rw-r--r-- | plugins/Popup/src/opt_adv.cpp | 9 | ||||
-rw-r--r-- | plugins/Popup/src/opt_adv.h | 2 | ||||
-rw-r--r-- | plugins/Popup/src/opt_class.cpp | 2 | ||||
-rw-r--r-- | plugins/Popup/src/popup_wnd2.cpp | 2 | ||||
-rw-r--r-- | plugins/Popup/src/skin.cpp | 42 |
7 files changed, 38 insertions, 40 deletions
diff --git a/plugins/Popup/Popup.vcxproj b/plugins/Popup/Popup.vcxproj index 4e7e70524e..4499109c4e 100644 --- a/plugins/Popup/Popup.vcxproj +++ b/plugins/Popup/Popup.vcxproj @@ -25,4 +25,9 @@ <ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
</ImportGroup>
+ <ItemDefinitionGroup>
+ <ClCompile>
+ <ExceptionHandling>Sync</ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
</Project>
\ No newline at end of file diff --git a/plugins/Popup/src/effects.cpp b/plugins/Popup/src/effects.cpp index ede4d633f1..dfc8139d08 100644 --- a/plugins/Popup/src/effects.cpp +++ b/plugins/Popup/src/effects.cpp @@ -37,17 +37,17 @@ protected: int alpha;
public:
- virtual void beginEffect(int w, int h, int alpha0, int alpha1, int frameCount)
+ virtual void beginEffect(int _w, int _h, int _alpha0, int _alpha1, int _frameCount)
{
- this->w = w;
- this->h = h;
- this->alpha0 = alpha0;
- this->alpha1 = alpha1;
- this->frameCount = frameCount;
+ w = _w;
+ h = _h;
+ alpha0 = _alpha0;
+ alpha1 = _alpha1;
+ frameCount = _frameCount;
}
- virtual void beginFrame(int frame)
+ virtual void beginFrame(int _frame)
{
- this->frame = frame;
+ frame = _frame;
stage = (frame * 2 > frameCount) ? 1 : 0;
if (stage == 0)
alpha = alpha0 + (alpha1 - alpha0) * frame * 2 / frameCount;
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 68dd085240..b5fa1f5d20 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -199,19 +199,16 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(hwnd, IDC_FADEOUT_TXT2), how);
// effects drop down
{
- DWORD dwItem, dwActiveItem = 0;
-
- BOOL how = TRUE;
-
+ how = TRUE;
EnableWindow(GetDlgItem(hwnd, IDC_EFFECT), how);
EnableWindow(GetDlgItem(hwnd, IDC_EFFECT_TXT), how);
HWND hCtrl = GetDlgItem(hwnd, IDC_EFFECT);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("No effect")), -2);
ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Fade in/out")), -1);
- dwActiveItem = (DWORD)PopupOptions.UseEffect;
+ DWORD dwActiveItem = (DWORD)PopupOptions.UseEffect;
for (int i = 0; i < g_lstPopupVfx.getCount(); ++i) {
- dwItem = ComboBox_AddString(hCtrl, TranslateTS(g_lstPopupVfx[i]));
+ DWORD dwItem = ComboBox_AddString(hCtrl, TranslateTS(g_lstPopupVfx[i]));
ComboBox_SetItemData(hCtrl, dwItem, i);
if (PopupOptions.UseEffect && !mir_tstrcmp(g_lstPopupVfx[i], PopupOptions.Effect))
dwActiveItem = dwItem;
diff --git a/plugins/Popup/src/opt_adv.h b/plugins/Popup/src/opt_adv.h index 07e6a96617..6a0c1e66d1 100644 --- a/plugins/Popup/src/opt_adv.h +++ b/plugins/Popup/src/opt_adv.h @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __opt_adv_h__
#define __opt_adv_h__
-extern HWND hwndBox;
-
void OptAdv_RegisterVfx(char *name);
void OptAdv_UnregisterVfx();
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index da96d69c60..25a1f78d6f 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -315,7 +315,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l } // end if (tvi.lParam)
else {
// enable / disable controls
- for (int i = 0; i < _countof(ctrlsAll); ++i) {
+ for (i = 0; i < _countof(ctrlsAll); ++i) {
ShowWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0 ? SW_SHOW : SW_HIDE);
EnableWindow(GetDlgItem(hwnd, ctrlsAll[i].idCtrl), ctrlsAll[i].onTyp0);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index a0dd244046..efd5aa0086 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -1129,7 +1129,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case CURSOR_TIMER:
- POINT pt; GetCursorPos(&pt);
+ GetCursorPos(&pt);
if (abs(pt.x - m_ptPrevCursor.x) + abs(pt.y - m_ptPrevCursor.y) > 4) {
SetWindowLongPtr(m_hwnd, GWL_EXSTYLE, GetWindowLongPtr(m_hwnd, GWL_EXSTYLE) & ~WS_EX_TRANSPARENT);
KillTimer(m_hwnd, CURSOR_TIMER);
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 723b6f6a41..544069e276 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -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(), (int)mir_tstrlen(wnd->getTime()), &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);
@@ -483,16 +483,15 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW else
SetTextColor(hdc, wnd->getTextColor());
{
- POINT pos;
- pos.x = head->fx.eval(wnd->getArgs());
- pos.y = head->fy.eval(wnd->getArgs());
- SIZE sz;
+ POINT pt;
+ pt.x = head->fx.eval(wnd->getArgs());
+ pt.y = head->fy.eval(wnd->getArgs());
sz.cx = wnd->getRenderInfo()->textw;
sz.cy = 1000;
- SetRect(&wnd->getRenderInfo()->textRect, pos.x, pos.y,
- pos.x + wnd->getRenderInfo()->realtextw,
- pos.y + wnd->getRenderInfo()->texth);
+ SetRect(&wnd->getRenderInfo()->textRect, pt.x, pt.y,
+ pt.x + wnd->getRenderInfo()->realtextw,
+ pt.y + wnd->getRenderInfo()->texth);
if ((drawFlags&DF_STATIC) && !wnd->isTextEmpty()) {
HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.text);
@@ -500,13 +499,13 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW switch (wnd->getTextType()) {
case PopupWnd2::TT_UNICODE:
{
- RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy);
+ RECT rc; SetRect(&rc, pt.x, pt.y, pt.x + sz.cx, pt.y + sz.cy);
DrawTextEx(hdc, wnd->getText(), (int)mir_tstrlen(wnd->getText()), &rc,
DT_EXPANDTABS | DT_LEFT | DT_NOPREFIX | DT_TOP | DT_WORDBREAK/*|DT_RTLREADING*/, NULL);
}
break;
case PopupWnd2::TT_MTEXT:
- MText.Display(hdc, pos, sz, wnd->getTextM());
+ MText.Display(hdc, pt, sz, wnd->getTextM());
break;
}
SelectObject(hdc, hFntSave);
@@ -519,12 +518,12 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW drawActionBar(bmp, wnd,
db_get_b(NULL, MODULNAME, "CenterActions", 0) ?
- (pos.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) :
+ (pt.x + (textAreaWidth - wnd->getRenderInfo()->actw) / 2) :
(PopupOptions.actions&ACT_RIGHTICONS) ?
- (pos.x + textAreaWidth - wnd->getRenderInfo()->actw) :
+ (pt.x + textAreaWidth - wnd->getRenderInfo()->actw) :
// else
- pos.x,
- pos.y + wnd->getRenderInfo()->texth + 3);
+ pt.x,
+ pt.y + wnd->getRenderInfo()->texth + 3);
actionsRendered = true;
}
@@ -538,10 +537,9 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SetTextColor(hdc, wnd->getTitleColor());
{
bmp->saveAlpha();
- POINT pos;
- pos.x = head->fx.eval(wnd->getArgs());
- pos.y = head->fy.eval(wnd->getArgs());
- SIZE sz;
+ POINT pt;
+ pt.x = head->fx.eval(wnd->getArgs());
+ pt.y = head->fy.eval(wnd->getArgs());
sz.cx = wnd->getRenderInfo()->titlew;
sz.cy = 1000;
@@ -549,7 +547,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW case PopupWnd2::TT_UNICODE:
{
HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
- RECT rc; SetRect(&rc, pos.x, pos.y, pos.x + sz.cx, pos.y + sz.cy);
+ RECT rc; SetRect(&rc, pt.x, pt.y, pt.x + sz.cx, pt.y + sz.cy);
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);
@@ -557,7 +555,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW break;
case PopupWnd2::TT_MTEXT:
HFONT hFntSave = (HFONT)SelectObject(hdc, fonts.title);
- MText.Display(hdc, pos, sz, wnd->getTitleM());
+ MText.Display(hdc, pt, sz, wnd->getTitleM());
SelectObject(hdc, hFntSave);
break;
}
@@ -690,7 +688,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SetTextColor(hdc, wnd->getClockColor());
HFONT hfnSave = (HFONT)SelectObject(bmp->getDC(), fonts.clock);
- SIZE sz; GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
+ GetTextExtentPoint32(bmp->getDC(), wnd->getTime(), (int)mir_tstrlen(wnd->getTime()), &sz);
bmp->Draw_Text(wnd->getTime(), x, y);
SelectObject(bmp->getDC(), hfnSave);
}
@@ -1115,7 +1113,7 @@ bool Skins::load() if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(_T("."), ffd.cFileName) && mir_tstrcmp(_T(".."), ffd.cFileName)) {
SetCurrentDirectory(ffd.cFileName);
- SKINLIST *skin = new SKINLIST;
+ skin = new SKINLIST;
skin->next = m_skins;
m_skins = skin;
m_skins->name = mir_tstrdup(ffd.cFileName);
|