diff options
19 files changed, 36 insertions, 979 deletions
diff --git a/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj b/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj index 3d6d361bbd..f30360ca36 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj +++ b/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj @@ -184,21 +184,21 @@ <ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="..\CommonLibs\CString.cpp" />
+ <ClCompile Include="src\CommonLibs\CString.cpp" />
<ClCompile Include="src\OptDlg.cpp" />
- <ClCompile Include="..\CommonLibs\Options.cpp" />
- <ClCompile Include="..\CommonLibs\pcre.cpp" />
+ <ClCompile Include="src\CommonLibs\Options.cpp" />
+ <ClCompile Include="src\CommonLibs\pcre.cpp" />
<ClCompile Include="src\ClientChangeNotify.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Common.h" />
- <ClInclude Include="..\CommonLibs\CString.h" />
+ <ClInclude Include="src\CommonLibs\CString.h" />
<ClInclude Include="src\Misc.h" />
- <ClInclude Include="..\CommonLibs\Options.h" />
- <ClInclude Include="..\CommonLibs\pcre.h" />
- <ClInclude Include="..\CommonLibs\pcre_main.h" />
+ <ClInclude Include="src\CommonLibs\Options.h" />
+ <ClInclude Include="src\CommonLibs\pcre.h" />
+ <ClInclude Include="src\CommonLibs\pcre_main.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="..\CommonLibs\TMyArray.h" />
+ <ClInclude Include="src\CommonLibs\TMyArray.h" />
<ClInclude Include="src\Version.h" />
</ItemGroup>
<ItemGroup>
diff --git a/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj.filters b/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj.filters index 6e25d96890..aaf82085aa 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj.filters +++ b/plugins/ClientChangeNotify/ClientChangeNotify_10.vcxproj.filters @@ -18,16 +18,16 @@ <ClCompile Include="src\ClientChangeNotify.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\CommonLibs\CString.cpp">
+ <ClCompile Include="src\CommonLibs\CString.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\OptDlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\CommonLibs\Options.cpp">
+ <ClCompile Include="src\CommonLibs\Options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\CommonLibs\pcre.cpp">
+ <ClCompile Include="src\CommonLibs\pcre.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\stdafx.cpp">
@@ -38,25 +38,25 @@ <ClInclude Include="src\Common.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\CString.h">
+ <ClInclude Include="src\CommonLibs\CString.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Misc.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\Options.h">
+ <ClInclude Include="src\CommonLibs\Options.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\pcre.h">
+ <ClInclude Include="src\CommonLibs\pcre.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\pcre_main.h">
+ <ClInclude Include="src\CommonLibs\pcre_main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\TMyArray.h">
+ <ClInclude Include="src\CommonLibs\TMyArray.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Version.h">
diff --git a/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj b/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj index 163b657735..ab35b5df9f 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj +++ b/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj @@ -187,21 +187,21 @@ <ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
- <ClCompile Include="..\CommonLibs\CString.cpp" />
+ <ClCompile Include="src\CommonLibs\CString.cpp" />
<ClCompile Include="src\OptDlg.cpp" />
- <ClCompile Include="..\CommonLibs\Options.cpp" />
- <ClCompile Include="..\CommonLibs\pcre.cpp" />
+ <ClCompile Include="src\CommonLibs\Options.cpp" />
+ <ClCompile Include="src\CommonLibs\pcre.cpp" />
<ClCompile Include="src\ClientChangeNotify.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Common.h" />
- <ClInclude Include="..\CommonLibs\CString.h" />
+ <ClInclude Include="src\CommonLibs\CString.h" />
<ClInclude Include="src\Misc.h" />
- <ClInclude Include="..\CommonLibs\Options.h" />
- <ClInclude Include="..\CommonLibs\pcre.h" />
- <ClInclude Include="..\CommonLibs\pcre_main.h" />
+ <ClInclude Include="src\CommonLibs\Options.h" />
+ <ClInclude Include="src\CommonLibs\pcre.h" />
+ <ClInclude Include="src\CommonLibs\pcre_main.h" />
<ClInclude Include="src\resource.h" />
- <ClInclude Include="..\CommonLibs\TMyArray.h" />
+ <ClInclude Include="src\CommonLibs\TMyArray.h" />
<ClInclude Include="src\Version.h" />
</ItemGroup>
<ItemGroup>
diff --git a/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj.filters b/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj.filters index 6e25d96890..aaf82085aa 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj.filters +++ b/plugins/ClientChangeNotify/ClientChangeNotify_11.vcxproj.filters @@ -18,16 +18,16 @@ <ClCompile Include="src\ClientChangeNotify.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\CommonLibs\CString.cpp">
+ <ClCompile Include="src\CommonLibs\CString.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\OptDlg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\CommonLibs\Options.cpp">
+ <ClCompile Include="src\CommonLibs\Options.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\CommonLibs\pcre.cpp">
+ <ClCompile Include="src\CommonLibs\pcre.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\stdafx.cpp">
@@ -38,25 +38,25 @@ <ClInclude Include="src\Common.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\CString.h">
+ <ClInclude Include="src\CommonLibs\CString.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Misc.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\Options.h">
+ <ClInclude Include="src\CommonLibs\Options.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\pcre.h">
+ <ClInclude Include="src\CommonLibs\pcre.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\pcre_main.h">
+ <ClInclude Include="src\CommonLibs\pcre_main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\resource.h">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\CommonLibs\TMyArray.h">
+ <ClInclude Include="src\CommonLibs\TMyArray.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Version.h">
diff --git a/plugins/ClientChangeNotify/src/Common.h b/plugins/ClientChangeNotify/src/Common.h index 7bcfb12636..2869333d1c 100644 --- a/plugins/ClientChangeNotify/src/Common.h +++ b/plugins/ClientChangeNotify/src/Common.h @@ -53,10 +53,10 @@ #include "m_metacontacts.h"
#include "m_ContactSettings.h"
-#include "..\CommonLibs\TMyArray.h"
-#include "..\CommonLibs\Options.h"
-#include "..\CommonLibs\CString.h"
-#include "..\CommonLibs\pcre.h"
+#include "CommonLibs\TMyArray.h"
+#include "CommonLibs\Options.h"
+#include "CommonLibs\CString.h"
+#include "CommonLibs\pcre.h"
#include "resource.h"
#include "Misc.h"
diff --git a/plugins/CommonLibs/CString.cpp b/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp index fde5e4dc2a..fde5e4dc2a 100644 --- a/plugins/CommonLibs/CString.cpp +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.cpp diff --git a/plugins/CommonLibs/CString.h b/plugins/ClientChangeNotify/src/CommonLibs/CString.h index c9a4a9538e..c9a4a9538e 100644 --- a/plugins/CommonLibs/CString.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.h diff --git a/plugins/CommonLibs/Options.cpp b/plugins/ClientChangeNotify/src/CommonLibs/Options.cpp index 36226b0f11..36226b0f11 100644 --- a/plugins/CommonLibs/Options.cpp +++ b/plugins/ClientChangeNotify/src/CommonLibs/Options.cpp diff --git a/plugins/CommonLibs/Options.h b/plugins/ClientChangeNotify/src/CommonLibs/Options.h index 666162c50a..666162c50a 100644 --- a/plugins/CommonLibs/Options.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/Options.h diff --git a/plugins/CommonLibs/TMyArray.h b/plugins/ClientChangeNotify/src/CommonLibs/TMyArray.h index 68ca908fe1..68ca908fe1 100644 --- a/plugins/CommonLibs/TMyArray.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/TMyArray.h diff --git a/plugins/CommonLibs/pcre.cpp b/plugins/ClientChangeNotify/src/CommonLibs/pcre.cpp index ae82e43435..ae82e43435 100644 --- a/plugins/CommonLibs/pcre.cpp +++ b/plugins/ClientChangeNotify/src/CommonLibs/pcre.cpp diff --git a/plugins/CommonLibs/pcre.h b/plugins/ClientChangeNotify/src/CommonLibs/pcre.h index 2663870f85..2663870f85 100644 --- a/plugins/CommonLibs/pcre.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/pcre.h diff --git a/plugins/CommonLibs/pcre_main.h b/plugins/ClientChangeNotify/src/CommonLibs/pcre_main.h index ca6e7449df..ca6e7449df 100644 --- a/plugins/CommonLibs/pcre_main.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/pcre_main.h diff --git a/plugins/CommonLibs/GroupCheckbox.cpp b/plugins/CommonLibs/GroupCheckbox.cpp deleted file mode 100644 index 8834014452..0000000000 --- a/plugins/CommonLibs/GroupCheckbox.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/*
- GroupCheckbox.cpp
- Copyright (c) 2007 Chervov Dmitry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "Common.h"
-#include "GroupCheckbox.h"
-#include "Themes.h"
-
-#define WM_THEMECHANGED 0x031A
-
-#define UM_INITCHECKBOX (WM_USER + 123)
-#define UM_AUTOSIZE (WM_USER + 124)
-
-#define CG_CHECKBOX_VERTINDENT 0
-#define CG_CHECKBOX_INDENT 1
-#define CG_CHECKBOX_WIDTH 16
-#define CG_TEXT_INDENT 2
-#define CG_ADDITIONAL_WIDTH 3
-
-// states
-#define CGS_UNCHECKED BST_UNCHECKED
-#define CGS_CHECKED BST_CHECKED
-#define CGS_INDETERMINATE BST_INDETERMINATE
-#define CGS_PRESSED BST_PUSHED // values above and including CGS_PRESSED must coincide with BST_ constants for BM_GETSTATE to work properly
-#define CGS_HOVERED 8
-
-// state masks
-#define CGSM_ISCHECKED 3 // mask for BM_GETCHECK
-#define CGSM_GETSTATE 7 // mask to get only valid values for BM_GETSTATE
-
-#ifndef lengthof
-#define lengthof(s) (sizeof(s) / sizeof(*s))
-#endif
-
-class CCheckboxData
-{
-public:
- CCheckboxData(): OldWndProc(NULL), Style(0), State(0), hFont(NULL) {};
-
- WNDPROC OldWndProc;
- int Style; // BS_CHECKBOX, BS_AUTOCHECKBOX, BS_3STATE or BS_AUTO3STATE
- int State;
- HFONT hFont;
-};
-
-static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
- CCheckboxData *dat = (CCheckboxData*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
- if (!dat)
- {
- return 0;
- }
- switch (Msg)
- {
- case UM_INITCHECKBOX:
- {
- LOGFONT lf;
- HFONT hFont = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0);
- if (!hFont)
- {
- hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
- }
- GetObject(hFont, sizeof(lf), &lf);
- lf.lfWeight = FW_BOLD;
- dat->hFont = CreateFontIndirect(&lf);
- SendMessage(hWnd, UM_AUTOSIZE, 0, 0);
- return 0;
- } break;
- case UM_AUTOSIZE:
- {
- HTHEME hTheme = pOpenThemeData ? pOpenThemeData(hWnd, L"BUTTON") : NULL;
- int Len = GetWindowTextLength(hWnd) + 1;
- HDC hdc = GetDC(hWnd);
- HFONT hOldFont = (HFONT)SelectObject(hdc, dat->hFont);
- RECT rcText = {0};
- if (hTheme && pGetThemeTextExtent)
- {
- WCHAR *szText = (WCHAR*)malloc(Len * sizeof(WCHAR));
- GetWindowTextW(hWnd, szText, Len);
- pGetThemeTextExtent(hTheme, hdc, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szText, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
- free(szText);
- } else
- {
- SIZE size;
- TCHAR *szText = (TCHAR*)malloc(Len * sizeof(TCHAR));
- GetWindowText(hWnd, szText, Len);
- GetTextExtentPoint32(hdc, szText, lstrlen(szText), &size);
- free(szText);
- rcText.right = size.cx;
- rcText.bottom = size.cy;
- }
-
- SelectObject(hdc, hOldFont);
- ReleaseDC(hWnd, hdc);
- if (hTheme && pCloseThemeData)
- {
- pCloseThemeData(hTheme);
- }
- OffsetRect(&rcText, CG_CHECKBOX_INDENT + CG_CHECKBOX_WIDTH + CG_TEXT_INDENT, 0);
- RECT rc;
- GetClientRect(hWnd, &rc);
- SetWindowPos(hWnd, 0, 0, 0, rcText.right + CG_ADDITIONAL_WIDTH, rc.bottom, SWP_NOMOVE | SWP_NOZORDER);
- } break;
- case BM_CLICK:
- {
- SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0);
- SendMessage(hWnd, WM_LBUTTONUP, 0, 0);
- return 0;
- } break;
- case BM_GETCHECK:
- {
- return dat->State & CGSM_ISCHECKED;
- } break;
- case BM_SETCHECK:
- {
- if ((wParam != BST_UNCHECKED && wParam != BST_CHECKED && wParam != BST_INDETERMINATE) || (wParam == BST_INDETERMINATE && dat->Style != BS_3STATE && dat->Style != BS_AUTO3STATE))
- { // invalid value
- wParam = BST_CHECKED;
- }
- dat->State &= ~CGSM_ISCHECKED;
- dat->State |= wParam;
- InvalidateRect(hWnd, NULL, false);
- SendMessage(GetParent(hWnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hWnd), BN_CLICKED), (LPARAM)hWnd);
- return 0;
- } break;
- case BM_SETSTATE:
- {
- if (wParam)
- {
- dat->State |= CGS_PRESSED;
- } else
- {
- dat->State &= ~CGS_PRESSED;
- }
- InvalidateRect(hWnd, NULL, false);
- return 0;
- } break;
- case BM_GETSTATE:
- {
- return (dat->State & CGSM_GETSTATE) | ((GetFocus() == hWnd) ? BST_FOCUS : 0);
- } break;
- case WM_GETDLGCODE:
- {
- return DLGC_BUTTON;
- } break;
- case WM_THEMECHANGED:
- case WM_ENABLE:
- {
- InvalidateRect(hWnd, NULL, false);
- return 0;
- } break;
- case WM_SETTEXT:
- {
- if (CallWindowProc(dat->OldWndProc, hWnd, Msg, wParam, lParam))
- {
- SendMessage(hWnd, UM_AUTOSIZE, 0, 0);
- }
- return 0;
- } break;
- case WM_KEYDOWN:
- {
- if (wParam == VK_SPACE)
- {
- SendMessage(hWnd, BM_SETSTATE, true, 0);
- }
- return 0;
- } break;
- case WM_KEYUP:
- {
- if (wParam == VK_SPACE)
- {
- SendMessage(hWnd, BM_SETCHECK, (SendMessage(hWnd, BM_GETCHECK, 0, 0) + 1) % ((dat->Style == BS_AUTO3STATE) ? 3 : 2), 0);
- SendMessage(hWnd, BM_SETSTATE, false, 0);
- }
- return 0;
- } break;
- case WM_CAPTURECHANGED:
- {
- SendMessage(hWnd, BM_SETSTATE, false, 0);
- return 0;
- } break;
- case WM_ERASEBKGND:
- {
- return true;
- } break;
- case WM_LBUTTONDOWN:
- case WM_LBUTTONDBLCLK:
- {
- SetFocus(hWnd);
- SendMessage(hWnd, BM_SETSTATE, true, 0);
- SetCapture(hWnd);
- return 0;
- } break;
- case WM_LBUTTONUP:
- {
- if (GetCapture() == hWnd)
- {
- ReleaseCapture();
- }
- SendMessage(hWnd, BM_SETSTATE, false, 0);
- if (dat->State & CGS_HOVERED && (dat->Style == BS_AUTOCHECKBOX || dat->Style == BS_AUTO3STATE))
- {
- SendMessage(hWnd, BM_SETCHECK, (SendMessage(hWnd, BM_GETCHECK, 0, 0) + 1) % ((dat->Style == BS_AUTO3STATE) ? 3 : 2), 0);
- }
- return 0;
- } break;
- case WM_MOUSEMOVE:
- {
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(tme);
- tme.dwFlags = TME_LEAVE;
- tme.dwHoverTime = HOVER_DEFAULT;
- tme.hwndTrack = hWnd;
- _TrackMouseEvent(&tme);
-
- POINT pt;
- GetCursorPos(&pt);
- if ((WindowFromPoint(pt) == hWnd) ^ ((dat->State & CGS_HOVERED) != 0))
- {
- dat->State ^= CGS_HOVERED;
- InvalidateRect(hWnd, NULL, false);
- }
- return 0;
- } break;
- case WM_MOUSELEAVE:
- {
- if (dat->State & CGS_HOVERED)
- {
- dat->State &= ~CGS_HOVERED;
- InvalidateRect(hWnd, NULL, false);
- }
- return 0;
- } break;
- case WM_SETFOCUS:
- case WM_KILLFOCUS:
- case WM_SYSCOLORCHANGE:
- {
- InvalidateRect(hWnd, NULL, false);
- return 0;
- } break;
- case WM_PAINT:
- {
- HDC hdc;
- PAINTSTRUCT ps;
- hdc = BeginPaint(hWnd, &ps);
- RECT rc;
- GetClientRect(hWnd, &rc);
- HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hbmMem = CreateCompatibleBitmap(hdc, rc.right, rc.bottom);
- HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem);
- HTHEME hTheme = pOpenThemeData ? pOpenThemeData(hWnd, L"BUTTON") : NULL;
- if (hTheme && pDrawThemeParentBackground)
- {
- pDrawThemeParentBackground(hWnd, hdcMem, NULL);
- } else
- {
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
- }
- int StateID = 0;
-#define CBSCHECK_UNCHECKED 1
-#define CBSCHECK_CHECKED 5
-#define CBSCHECK_MIXED 9
-#define CBSSTATE_NORMAL 0
-#define CBSSTATE_HOT 1
-#define CBSSTATE_PRESSED 2
-#define CBSSTATE_DISABLED 3
- switch (SendMessage(hWnd, BM_GETCHECK, 0, 0))
- {
- case BST_CHECKED:
- {
- StateID += CBSCHECK_CHECKED;
- } break;
- case BST_UNCHECKED:
- {
- StateID += CBSCHECK_UNCHECKED;
- } break;
- case BST_INDETERMINATE:
- {
- StateID += CBSCHECK_MIXED;
- } break;
- }
- if (!IsWindowEnabled(hWnd))
- {
- StateID += CBSSTATE_DISABLED;
- } else if (dat->State & CGS_PRESSED && (GetCapture() != hWnd || dat->State & CGS_HOVERED))
- {
- StateID += CBSSTATE_PRESSED;
- } else if (dat->State & CGS_PRESSED || dat->State & CGS_HOVERED)
- {
- StateID += CBSSTATE_HOT;
- }
- rc.left += CG_CHECKBOX_INDENT;
- rc.right = rc.left + CG_CHECKBOX_WIDTH; // left-align the image in the client area
- rc.top += CG_CHECKBOX_VERTINDENT;
- rc.bottom = rc.top + CG_CHECKBOX_WIDTH; // exact rc dimensions are necessary for DrawFrameControl to draw correctly
- if (hTheme && pDrawThemeBackground)
- {
- pDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, StateID, &rc, &rc);
- } else
- {
- int dfcStates[] =
- {0, 0, DFCS_PUSHED, DFCS_INACTIVE,
- DFCS_CHECKED, DFCS_CHECKED, DFCS_CHECKED | DFCS_PUSHED, DFCS_CHECKED | DFCS_INACTIVE,
- DFCS_BUTTON3STATE | DFCS_CHECKED, DFCS_BUTTON3STATE | DFCS_CHECKED, DFCS_BUTTON3STATE | DFCS_INACTIVE | DFCS_CHECKED | DFCS_PUSHED, DFCS_BUTTON3STATE | DFCS_INACTIVE | DFCS_CHECKED | DFCS_PUSHED};
- _ASSERT(StateID >= 1 && StateID <= lengthof(dfcStates));
- DrawFrameControl(hdcMem, &rc, DFC_BUTTON, dfcStates[StateID - 1]);
- }
-
- GetClientRect(hWnd, &rc);
- rc.left += CG_CHECKBOX_INDENT + CG_CHECKBOX_WIDTH + CG_TEXT_INDENT;
- int Len = GetWindowTextLength(hWnd) + 1;
- WCHAR *szTextW = NULL;
- TCHAR *szTextT = NULL;
- if (hTheme && pDrawThemeText && pGetThemeTextExtent)
- {
- szTextW = (WCHAR*)malloc(Len * sizeof(WCHAR));
- GetWindowTextW(hWnd, szTextW, Len);
- } else
- {
- szTextT = (TCHAR*)malloc(Len * sizeof(TCHAR));
- GetWindowText(hWnd, szTextT, Len);
- }
- HFONT hOldFont = (HFONT)SelectObject(hdcMem, dat->hFont);
- SetBkMode(hdcMem, TRANSPARENT);
- if (hTheme && pDrawThemeText && pGetThemeTextExtent)
- {
- pDrawThemeText(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextW, -1, DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rc);
- } else
- {
- DrawText(hdcMem, szTextT, -1, &rc, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
- }
- if (GetFocus() == hWnd)
- {
- RECT rcText = {0};
- if (hTheme && pDrawThemeText && pGetThemeTextExtent)
- {
- pGetThemeTextExtent(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextW, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
- } else
- {
- SIZE size;
- GetTextExtentPoint32(hdcMem, szTextT, lstrlen(szTextT), &size);
- rcText.right = size.cx;
- rcText.bottom = size.cy;
- }
- rcText.bottom = rc.bottom;
- OffsetRect(&rcText, rc.left, 0);
- InflateRect(&rcText, 1, -1);
- DrawFocusRect(hdcMem, &rcText);
- }
- free((hTheme && pDrawThemeText && pGetThemeTextExtent) ? (TCHAR*)szTextW : szTextT);
- SelectObject(hdcMem, hOldFont);
- if (hTheme && pCloseThemeData)
- {
- pCloseThemeData(hTheme);
- }
- BitBlt(hdc, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
- SelectObject(hdcMem, hbmOld);
- DeleteObject(hbmMem);
- DeleteDC(hdcMem);
- EndPaint(hWnd, &ps);
- return 0;
- } break;
- case WM_DESTROY:
- {
- if (dat->hFont)
- {
- DeleteObject(dat->hFont);
- }
- SetWindowLongPtr(hWnd, GWLP_USERDATA, NULL);
- CallWindowProc(dat->OldWndProc, hWnd, Msg, wParam, lParam);
- delete dat;
- return 0;
- } break;
- }
- return CallWindowProc(dat->OldWndProc, hWnd, Msg, wParam, lParam);
-}
-
-int MakeGroupCheckbox(HWND hWndCheckbox)
-{ // workaround to make SetTextColor work in WM_CTLCOLORSTATIC with windows themes enabled
- CCheckboxData *dat = new CCheckboxData();
- dat->OldWndProc = (WNDPROC)GetWindowLongPtr(hWndCheckbox, GWLP_WNDPROC);
- dat->State = SendMessage(hWndCheckbox, BM_GETSTATE, 0, 0);
- long Style = GetWindowLongPtr(hWndCheckbox, GWL_STYLE);
- dat->Style = Style & (BS_CHECKBOX | BS_AUTOCHECKBOX | BS_3STATE | BS_AUTO3STATE);
- _ASSERT(dat->Style == BS_CHECKBOX || dat->Style == BS_AUTOCHECKBOX || dat->Style == BS_3STATE || dat->Style == BS_AUTO3STATE);
- Style &= ~(BS_CHECKBOX | BS_AUTOCHECKBOX | BS_3STATE | BS_AUTO3STATE);
- Style |= BS_OWNERDRAW;
- SetWindowLongPtr(hWndCheckbox, GWL_STYLE, Style);
- SetWindowLongPtr(hWndCheckbox, GWLP_USERDATA, (LONG)dat);
- SetWindowLongPtr(hWndCheckbox, GWLP_WNDPROC, (LONG)CheckboxWndProc);
- SendMessage(hWndCheckbox, UM_INITCHECKBOX, 0, 0);
- return 0;
-}
diff --git a/plugins/CommonLibs/GroupCheckbox.h b/plugins/CommonLibs/GroupCheckbox.h deleted file mode 100644 index 3aa121f869..0000000000 --- a/plugins/CommonLibs/GroupCheckbox.h +++ /dev/null @@ -1,26 +0,0 @@ -/*
- GroupCheckbox.h
- Copyright (c) 2007 Chervov Dmitry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#pragma once
-
-#include <windows.h>
-#include <crtdbg.h>
-#include <commctrl.h>
-
-int MakeGroupCheckbox(HWND hWndCheckbox);
diff --git a/plugins/CommonLibs/ThemedImageCheckbox.cpp b/plugins/CommonLibs/ThemedImageCheckbox.cpp deleted file mode 100644 index 082e8accf8..0000000000 --- a/plugins/CommonLibs/ThemedImageCheckbox.cpp +++ /dev/null @@ -1,382 +0,0 @@ -/*
- ThemedImageCheckbox.cpp
- Copyright (c) 2007 Chervov Dmitry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "Common.h"
-#include "ThemedImageCheckbox.h"
-#include "Themes.h"
-#include "win2k.h"
-
-#define WM_THEMECHANGED 0x031A
-
-#define CG_CHECKBOX_VERTINDENT 2
-#define CG_CHECKBOX_INDENT 1
-#define CG_CHECKBOX_WIDTH 16
-#define CG_IMAGE_INDENT 7
-#define CG_ADDITIONAL_WIDTH 3
-
-// states
-#define CGS_UNCHECKED BST_UNCHECKED
-#define CGS_CHECKED BST_CHECKED
-#define CGS_INDETERMINATE BST_INDETERMINATE
-#define CGS_PRESSED BST_PUSHED // values above and including CGS_PRESSED must coincide with BST_ constants for BM_GETSTATE to work properly
-#define CGS_HOVERED 8
-
-// state masks
-#define CGSM_ISCHECKED 3 // mask for BM_GETCHECK
-#define CGSM_GETSTATE 7 // mask to get only valid values for BM_GETSTATE
-
-#ifndef lengthof
-#define lengthof(s) (sizeof(s) / sizeof(*s))
-#endif
-
-class CCheckboxData
-{
-public:
- CCheckboxData(): OldWndProc(NULL), Style(0), State(0), hBitmap(NULL), hIcon(NULL) {};
-
- WNDPROC OldWndProc;
- int Style; // BS_CHECKBOX, BS_AUTOCHECKBOX, BS_3STATE or BS_AUTO3STATE
- int State;
- HBITMAP hBitmap;
- HICON hIcon;
-};
-
-static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
- CCheckboxData *dat = (CCheckboxData*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
- if (!dat)
- {
- return 0;
- }
- switch (Msg)
- {
- case BM_CLICK:
- {
- SendMessage(hWnd, WM_LBUTTONDOWN, 0, 0);
- SendMessage(hWnd, WM_LBUTTONUP, 0, 0);
- return 0;
- } break;
- case BM_GETCHECK:
- {
- return dat->State & CGSM_ISCHECKED;
- } break;
- case BM_SETCHECK:
- {
- if ((wParam != BST_UNCHECKED && wParam != BST_CHECKED && wParam != BST_INDETERMINATE) || (wParam == BST_INDETERMINATE && dat->Style != BS_3STATE && dat->Style != BS_AUTO3STATE))
- { // invalid value
- wParam = BST_CHECKED;
- }
- dat->State &= ~CGSM_ISCHECKED;
- dat->State |= wParam;
- InvalidateRect(hWnd, NULL, false);
- SendMessage(GetParent(hWnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hWnd), BN_CLICKED), (LPARAM)hWnd);
- return 0;
- } break;
- case BM_SETSTATE:
- {
- if (wParam)
- {
- dat->State |= CGS_PRESSED;
- } else
- {
- dat->State &= ~CGS_PRESSED;
- }
- InvalidateRect(hWnd, NULL, false);
- return 0;
- } break;
- case BM_GETSTATE:
- {
- return (dat->State & CGSM_GETSTATE) | ((GetFocus() == hWnd) ? BST_FOCUS : 0);
- } break;
- case BM_SETIMAGE:
- {
- int PrevHandle = 0;
- switch (wParam)
- {
- case IMAGE_BITMAP:
- {
- PrevHandle = (int)dat->hBitmap;
- dat->hBitmap = (HBITMAP)lParam;
- } break;
- case IMAGE_ICON:
- {
- PrevHandle = (int)dat->hIcon;
- dat->hIcon = (HICON)lParam;
- } break;
- default:
- {
- return 0;
- }
- }
- InvalidateRect(hWnd, NULL, false);
- return PrevHandle;
- } break;
- case BM_GETIMAGE:
- {
- switch (wParam)
- {
- case IMAGE_BITMAP:
- {
- return (int)dat->hBitmap;
- } break;
- case IMAGE_ICON:
- {
- return (int)dat->hIcon;
- } break;
- }
- return 0;
- } break;
- case WM_GETDLGCODE:
- {
- return DLGC_BUTTON;
- } break;
- case WM_THEMECHANGED:
- case WM_ENABLE:
- {
- InvalidateRect(hWnd, NULL, false);
- return 0;
- } break;
- case WM_KEYDOWN:
- {
- if (wParam == VK_SPACE)
- {
- SendMessage(hWnd, BM_SETSTATE, true, 0);
- }
- return 0;
- } break;
- case WM_KEYUP:
- {
- if (wParam == VK_SPACE)
- {
- SendMessage(hWnd, BM_SETCHECK, (SendMessage(hWnd, BM_GETCHECK, 0, 0) + 1) % ((dat->Style == BS_AUTO3STATE) ? 3 : 2), 0);
- SendMessage(hWnd, BM_SETSTATE, false, 0);
- }
- return 0;
- } break;
- case WM_CAPTURECHANGED:
- {
- SendMessage(hWnd, BM_SETSTATE, false, 0);
- return 0;
- } break;
- case WM_ERASEBKGND:
- {
- return true;
- } break;
- case WM_LBUTTONDOWN:
- case WM_LBUTTONDBLCLK:
- {
- SetFocus(hWnd);
- SendMessage(hWnd, BM_SETSTATE, true, 0);
- SetCapture(hWnd);
- return 0;
- } break;
- case WM_LBUTTONUP:
- {
- if (GetCapture() == hWnd)
- {
- ReleaseCapture();
- }
- SendMessage(hWnd, BM_SETSTATE, false, 0);
- if (dat->State & CGS_HOVERED && (dat->Style == BS_AUTOCHECKBOX || dat->Style == BS_AUTO3STATE))
- {
- SendMessage(hWnd, BM_SETCHECK, (SendMessage(hWnd, BM_GETCHECK, 0, 0) + 1) % ((dat->Style == BS_AUTO3STATE) ? 3 : 2), 0);
- }
- return 0;
- } break;
- case WM_MOUSEMOVE:
- {
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(tme);
- tme.dwFlags = TME_LEAVE;
- tme.dwHoverTime = HOVER_DEFAULT;
- tme.hwndTrack = hWnd;
- _TrackMouseEvent(&tme);
-
- POINT pt;
- GetCursorPos(&pt);
- if ((WindowFromPoint(pt) == hWnd) ^ ((dat->State & CGS_HOVERED) != 0))
- {
- dat->State ^= CGS_HOVERED;
- InvalidateRect(hWnd, NULL, false);
- }
- return 0;
- } break;
- case WM_MOUSELEAVE:
- {
- if (dat->State & CGS_HOVERED)
- {
- dat->State &= ~CGS_HOVERED;
- InvalidateRect(hWnd, NULL, false);
- }
- return 0;
- } break;
- case WM_SETFOCUS:
- case WM_KILLFOCUS:
- case WM_SYSCOLORCHANGE:
- {
- InvalidateRect(hWnd, NULL, false);
- return 0;
- } break;
- case WM_PAINT:
- {
- HDC hdc;
- PAINTSTRUCT ps;
- hdc = BeginPaint(hWnd, &ps);
- RECT rc;
- GetClientRect(hWnd, &rc);
- HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hbmMem = CreateCompatibleBitmap(hdc, rc.right, rc.bottom);
- HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem);
- HTHEME hTheme = pOpenThemeData ? pOpenThemeData(hWnd, L"BUTTON") : NULL;
- if (hTheme && pDrawThemeParentBackground)
- {
- pDrawThemeParentBackground(hWnd, hdcMem, NULL);
- } else
- {
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
- }
- int StateID = 0;
-#define CBSCHECK_UNCHECKED 1
-#define CBSCHECK_CHECKED 5
-#define CBSCHECK_MIXED 9
-#define CBSSTATE_NORMAL 0
-#define CBSSTATE_HOT 1
-#define CBSSTATE_PRESSED 2
-#define CBSSTATE_DISABLED 3
- switch (SendMessage(hWnd, BM_GETCHECK, 0, 0))
- {
- case BST_CHECKED:
- {
- StateID += CBSCHECK_CHECKED;
- } break;
- case BST_UNCHECKED:
- {
- StateID += CBSCHECK_UNCHECKED;
- } break;
- case BST_INDETERMINATE:
- {
- StateID += CBSCHECK_MIXED;
- } break;
- }
- if (!IsWindowEnabled(hWnd))
- {
- StateID += CBSSTATE_DISABLED;
- } else if (dat->State & CGS_PRESSED && (GetCapture() != hWnd || dat->State & CGS_HOVERED))
- {
- StateID += CBSSTATE_PRESSED;
- } else if (dat->State & CGS_PRESSED || dat->State & CGS_HOVERED)
- {
- StateID += CBSSTATE_HOT;
- }
- rc.left += CG_CHECKBOX_INDENT;
- rc.right = rc.left + CG_CHECKBOX_WIDTH; // left-align the image in the client area
- rc.top += CG_CHECKBOX_VERTINDENT;
- rc.bottom = rc.top + CG_CHECKBOX_WIDTH; // exact rc dimensions are necessary for DrawFrameControl to draw correctly
- if (hTheme && pDrawThemeBackground)
- {
- pDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, StateID, &rc, &rc);
- } else
- {
- int dfcStates[] =
- {0, 0, DFCS_PUSHED, DFCS_INACTIVE,
- DFCS_CHECKED, DFCS_CHECKED, DFCS_CHECKED | DFCS_PUSHED, DFCS_CHECKED | DFCS_INACTIVE,
- DFCS_BUTTON3STATE | DFCS_CHECKED, DFCS_BUTTON3STATE | DFCS_CHECKED, DFCS_BUTTON3STATE | DFCS_INACTIVE | DFCS_CHECKED | DFCS_PUSHED, DFCS_BUTTON3STATE | DFCS_INACTIVE | DFCS_CHECKED | DFCS_PUSHED};
- _ASSERT(StateID >= 1 && StateID <= lengthof(dfcStates));
- DrawFrameControl(hdcMem, &rc, DFC_BUTTON, dfcStates[StateID - 1]);
- }
-
- GetClientRect(hWnd, &rc);
- RECT rcImage = rc;
- LPARAM hImage = NULL;
- DWORD DSFlags;
- HIMAGELIST hImageList = NULL;
- if (dat->hBitmap)
- {
- BITMAP bminfo;
- GetObject(dat->hBitmap, sizeof(bminfo), &bminfo);
- rcImage.right = bminfo.bmWidth;
- rcImage.bottom = bminfo.bmHeight;
- DSFlags = DST_BITMAP;
- hImage = (LPARAM)dat->hBitmap;
- } else
- {
- rcImage.right = GetSystemMetrics(SM_CXSMICON);
- rcImage.bottom = GetSystemMetrics(SM_CYSMICON);
- DSFlags = DST_ICON;
- if (dat->hIcon)
- {
- hImageList = ImageList_Create(rcImage.right, rcImage.bottom, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0);
- ImageList_AddIcon(hImageList, dat->hIcon);
- hImage = (LPARAM)ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
- }
- } // rcImage.right and rcImage.bottom are width and height, not absolute coordinates
- rcImage.left += CG_CHECKBOX_INDENT + CG_CHECKBOX_WIDTH + CG_IMAGE_INDENT;
- rcImage.top += (rc.bottom - rcImage.bottom) / 2;
- DrawState(hdcMem, NULL, NULL, hImage, 0, rcImage.left, rcImage.top, rcImage.right, rcImage.bottom, DSFlags | (IsWindowEnabled(hWnd) ? DSS_NORMAL : DSS_DISABLED));
- if (hImageList)
- {
- ImageList_RemoveAll(hImageList);
- ImageList_Destroy(hImageList);
- DestroyIcon((HICON)hImage);
- }
- if (GetFocus() == hWnd)
- {
- rcImage.right += rcImage.left;
- rcImage.bottom += rcImage.top;
- InflateRect(&rcImage, 1, 1);
- DrawFocusRect(hdcMem, &rcImage);
- }
- if (hTheme && pCloseThemeData)
- {
- pCloseThemeData(hTheme);
- }
- BitBlt(hdc, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
- SelectObject(hdcMem, hbmOld);
- DeleteObject(hbmMem);
- DeleteDC(hdcMem);
- EndPaint(hWnd, &ps);
- return 0;
- } break;
- case WM_DESTROY:
- {
- SetWindowLongPtr(hWnd, GWLP_USERDATA, NULL);
- CallWindowProc(dat->OldWndProc, hWnd, Msg, wParam, lParam);
- delete dat;
- return 0;
- } break;
- }
- return CallWindowProc(dat->OldWndProc, hWnd, Msg, wParam, lParam);
-}
-
-int MakeThemedImageCheckbox(HWND hWndCheckbox)
-{ // workaround to make checkbox with BS_ICON or BS_BITMAP work with windows themes enabled
- CCheckboxData *dat = new CCheckboxData();
- dat->OldWndProc = (WNDPROC)GetWindowLongPtr(hWndCheckbox, GWLP_WNDPROC);
- dat->State = SendMessage(hWndCheckbox, BM_GETSTATE, 0, 0);
- long Style = GetWindowLongPtr(hWndCheckbox, GWL_STYLE);
- _ASSERT(Style & BS_ICON || Style & BS_BITMAP);
- dat->Style = Style & (BS_CHECKBOX | BS_AUTOCHECKBOX | BS_3STATE | BS_AUTO3STATE);
- _ASSERT(dat->Style == BS_CHECKBOX || dat->Style == BS_AUTOCHECKBOX || dat->Style == BS_3STATE || dat->Style == BS_AUTO3STATE);
- Style &= ~(BS_CHECKBOX | BS_AUTOCHECKBOX | BS_3STATE | BS_AUTO3STATE);
- Style |= BS_OWNERDRAW;
- SetWindowLongPtr(hWndCheckbox, GWL_STYLE, Style);
- SetWindowLongPtr(hWndCheckbox, GWLP_USERDATA, (LONG)dat);
- SetWindowLongPtr(hWndCheckbox, GWLP_WNDPROC, (LONG)CheckboxWndProc);
- return 0;
-}
diff --git a/plugins/CommonLibs/ThemedImageCheckbox.h b/plugins/CommonLibs/ThemedImageCheckbox.h deleted file mode 100644 index f3449ec8fc..0000000000 --- a/plugins/CommonLibs/ThemedImageCheckbox.h +++ /dev/null @@ -1,26 +0,0 @@ -/*
- ThemedImageCheckbox.h
- Copyright (c) 2007 Chervov Dmitry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#pragma once
-
-#include <windows.h>
-#include <crtdbg.h>
-#include <commctrl.h>
-
-int MakeThemedImageCheckbox(HWND hWndCheckbox);
diff --git a/plugins/CommonLibs/Themes.cpp b/plugins/CommonLibs/Themes.cpp deleted file mode 100644 index 359d226b13..0000000000 --- a/plugins/CommonLibs/Themes.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*
- Themes.cpp
- Copyright (c) 2005-2007 Chervov Dmitry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "Common.h"
-#include "Themes.h"
-#include <tchar.h>
-
-tOpenThemeData pOpenThemeData = NULL;
-tCloseThemeData pCloseThemeData = NULL;
-tDrawThemeBackground pDrawThemeBackground = NULL;
-tDrawThemeParentBackground pDrawThemeParentBackground = NULL;
-tDrawThemeText pDrawThemeText = NULL;
-tGetThemeTextExtent pGetThemeTextExtent = NULL;
-tEnableThemeDialogTexture pEnableThemeDialogTexture = NULL;
-tSetWindowTheme pSetWindowTheme = NULL;
-
-void InitThemes()
-{
- if (IsWinVerXPPlus())
- {
- HMODULE hThemeAPI = GetModuleHandle(_T("uxtheme"));
- if (hThemeAPI)
- {
- pOpenThemeData = (tOpenThemeData)GetProcAddress(hThemeAPI, "OpenThemeData");
- pCloseThemeData = (tCloseThemeData)GetProcAddress(hThemeAPI, "CloseThemeData");
- pDrawThemeBackground = (tDrawThemeBackground)GetProcAddress(hThemeAPI, "DrawThemeBackground");
- pDrawThemeParentBackground = (tDrawThemeParentBackground)GetProcAddress(hThemeAPI, "DrawThemeParentBackground");
- pDrawThemeText = (tDrawThemeText)GetProcAddress(hThemeAPI, "DrawThemeText");
- pGetThemeTextExtent = (tGetThemeTextExtent)GetProcAddress(hThemeAPI, "GetThemeTextExtent");
- pEnableThemeDialogTexture = (tEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture");
- pSetWindowTheme = (tSetWindowTheme)GetProcAddress(hThemeAPI, "SetWindowTheme");
- }
- }
-}
diff --git a/plugins/CommonLibs/Themes.h b/plugins/CommonLibs/Themes.h deleted file mode 100644 index 524c7514a5..0000000000 --- a/plugins/CommonLibs/Themes.h +++ /dev/null @@ -1,51 +0,0 @@ -/*
- Themes.h
- Copyright (c) 2007 Chervov Dmitry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#pragma once
-
-#include <windows.h>
-#include <tmschema.h>
-
-typedef HANDLE HTHEME;
-
-// EnableThemeDialogTexture() flags
-#define ETDT_DISABLE 0x00000001
-#define ETDT_ENABLE 0x00000002
-#define ETDT_USETABTEXTURE 0x00000004
-#define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE)
-
-typedef HANDLE (WINAPI *tOpenThemeData)(HWND, LPCWSTR);
-typedef HRESULT (WINAPI *tCloseThemeData)(HANDLE);
-typedef HRESULT (WINAPI *tDrawThemeBackground)(HANDLE, HDC, int, int, const RECT*, const RECT*);
-typedef HRESULT (WINAPI *tDrawThemeParentBackground)(HWND, HDC, RECT*);
-typedef HRESULT (WINAPI *tDrawThemeText)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*);
-typedef HRESULT (WINAPI *tGetThemeTextExtent)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, const RECT*, RECT*);
-typedef HRESULT (WINAPI *tEnableThemeDialogTexture)(HWND, DWORD);
-typedef HRESULT (WINAPI *tSetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
-
-extern tOpenThemeData pOpenThemeData;
-extern tCloseThemeData pCloseThemeData;
-extern tDrawThemeBackground pDrawThemeBackground;
-extern tDrawThemeParentBackground pDrawThemeParentBackground;
-extern tDrawThemeText pDrawThemeText;
-extern tGetThemeTextExtent pGetThemeTextExtent;
-extern tEnableThemeDialogTexture pEnableThemeDialogTexture;
-extern tSetWindowTheme pSetWindowTheme;
-
-void InitThemes();
|