You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(57) |
Aug
(16) |
Sep
(37) |
Oct
(26) |
Nov
(36) |
Dec
(41) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(78) |
Feb
(45) |
Mar
(37) |
Apr
(56) |
May
(50) |
Jun
(17) |
Jul
(38) |
Aug
(86) |
Sep
(27) |
Oct
(42) |
Nov
(46) |
Dec
(56) |
2009 |
Jan
(49) |
Feb
(94) |
Mar
(101) |
Apr
(70) |
May
(31) |
Jun
(56) |
Jul
(18) |
Aug
(48) |
Sep
(40) |
Oct
(61) |
Nov
(51) |
Dec
(24) |
2010 |
Jan
(12) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ir0...@us...> - 2007-07-21 15:22:08
|
Revision: 1356 http://emerge.svn.sourceforge.net/emerge/?rev=1356&view=rev Author: ir0nh34d Date: 2007-07-21 08:22:07 -0700 (Sat, 21 Jul 2007) Log Message: ----------- Allow for sizing even if dragBorder equals 0 Modified Paths: -------------- trunk/Source/emergeAppletEngine/emergeAppletEngine.h trunk/Source/emergeAppletEngine/main.cpp Modified: trunk/Source/emergeAppletEngine/emergeAppletEngine.h =================================================================== --- trunk/Source/emergeAppletEngine/emergeAppletEngine.h 2007-07-21 11:55:35 UTC (rev 1355) +++ trunk/Source/emergeAppletEngine/emergeAppletEngine.h 2007-07-21 15:22:07 UTC (rev 1356) @@ -73,7 +73,7 @@ extern "C" { #endif - DLL_EXPORT LRESULT EAEHitTest(HWND hwnd, int dragBorder, bool autoSize, int x, int y); + DLL_EXPORT LRESULT EAEHitTest(HWND hwnd, int guiBorder, bool autoSize, int x, int y); DLL_EXPORT HWND EAEUpdateGUI(HWND hwnd, bool shadow, WCHAR *zposition); DLL_EXPORT HWND EAEInitializeAppletWindow(HINSTANCE inst, WNDPROC windowProc); DLL_EXPORT HWND EAEInitializeTooltipWindow(HINSTANCE appletInstance); Modified: trunk/Source/emergeAppletEngine/main.cpp =================================================================== --- trunk/Source/emergeAppletEngine/main.cpp 2007-07-21 11:55:35 UTC (rev 1355) +++ trunk/Source/emergeAppletEngine/main.cpp 2007-07-21 15:22:07 UTC (rev 1356) @@ -43,11 +43,15 @@ // Returns: LRESULT // Purpose: Determine the mouse pointer type for the hit test //----- -LRESULT EAEHitTest(HWND hwnd, int dragBorder, bool autoSize, int x, int y) +LRESULT EAEHitTest(HWND hwnd, int guiBorder, bool autoSize, int x, int y) { RECT r; GetWindowRect(hwnd, &r); + int dragBorder = guiBorder; + if (dragBorder <= 0) + dragBorder = 1; + if (GetAsyncKeyState(VK_CONTROL) & 0x8000) return HTCAPTION; else if ((GetAsyncKeyState(VK_MENU) & 0x8000) && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-21 11:55:37
|
Revision: 1355 http://emerge.svn.sourceforge.net/emerge/?rev=1355&view=rev Author: ir0nh34d Date: 2007-07-21 04:55:35 -0700 (Sat, 21 Jul 2007) Log Message: ----------- Added window.padding Modified Paths: -------------- trunk/Source/emergeCommand/Applet.cpp trunk/Source/emergeGraphics/emergeGraphics.h trunk/Source/emergeLauncher/Applet.cpp trunk/Source/emergeSchemeEngine/SchemeEditor.cpp trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc trunk/Source/emergeSchemeEngine/main.cpp trunk/Source/emergeSchemeEngine/resource.h trunk/Source/emergeTasks/Applet.cpp trunk/Source/emergeTray/Applet.cpp trunk/Source/emergeVWM/Applet.cpp Modified: trunk/Source/emergeCommand/Applet.cpp =================================================================== --- trunk/Source/emergeCommand/Applet.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeCommand/Applet.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -566,7 +566,7 @@ LRESULT Applet::DoSize(DWORD width, DWORD height) { - int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; if (!IsWindowVisible(mainWnd)) return 1; @@ -649,7 +649,7 @@ pSettings->ReadSettings(); ESELoadScheme(pSettings->GetSchemeFile(), &guiInfo); - dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; if (mainFont != NULL) DeleteObject(mainFont); Modified: trunk/Source/emergeGraphics/emergeGraphics.h =================================================================== --- trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-21 11:55:35 UTC (rev 1355) @@ -119,6 +119,7 @@ WCHAR gradientMethod[MAX_PATH]; UINT bevelWidth; bool clickThrough; + UINT padding; } GUIINFO, *LPGUIINFO; Modified: trunk/Source/emergeLauncher/Applet.cpp =================================================================== --- trunk/Source/emergeLauncher/Applet.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeLauncher/Applet.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -251,7 +251,7 @@ { UINT i; RECT rect; - int x, y, dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int x, y, dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; if (_wcsicmp(pSettings->GetHorizontalDirection(), TEXT("left")) == 0) x = r.right - pSettings->GetIconSize() - dragBorder; @@ -418,7 +418,7 @@ autoSizeInfo.hwnd = mainWnd; autoSizeInfo.rect = wndRect; - autoSizeInfo.dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + autoSizeInfo.dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; autoSizeInfo.iconSize = pSettings->GetIconSize(); autoSizeInfo.iconSpacing = pSettings->GetIconSpacing(); autoSizeInfo.visibleIconCount = pSettings->GetItemListSize(); @@ -675,7 +675,7 @@ LRESULT Applet::DoSize(DWORD width, DWORD height) { - int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; if (!IsWindowVisible(mainWnd)) return 1; @@ -721,7 +721,7 @@ pSettings->ReadSettings(); ESELoadScheme(pSettings->GetSchemeFile(), &guiInfo); - dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; ShowWindow(mainWnd, SW_HIDE); Modified: trunk/Source/emergeSchemeEngine/SchemeEditor.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -185,8 +185,8 @@ SendDlgItemMessage(hwndDlg, IDC_CLICKTHROUGH, BM_SETCHECK, BST_CHECKED, 0); SetDlgItemInt(hwndDlg, IDC_BEVEL, guiInfo.bevelWidth, false); - SetDlgItemInt(hwndDlg, IDC_BORDER, guiInfo.dragBorder, false); + SetDlgItemInt(hwndDlg, IDC_PADDING, guiInfo.padding, false); SendDlgItemMessage(hwndDlg, IDC_METHOD, CB_ADDSTRING, 0, (LPARAM)TEXT("Solid")); SendDlgItemMessage(hwndDlg, IDC_METHOD, CB_ADDSTRING, 0, (LPARAM)TEXT("Vertical")); @@ -500,6 +500,7 @@ guiInfo.bevelWidth = GetDlgItemInt(hwndDlg, IDC_BEVEL, NULL, FALSE); guiInfo.dragBorder = GetDlgItemInt(hwndDlg, IDC_BORDER, NULL, FALSE); + guiInfo.padding = GetDlgItemInt(hwndDlg, IDC_PADDING, NULL, FALSE); guiInfo.gradientTo = colourTo; guiInfo.gradientFrom = colourFrom; Modified: trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc =================================================================== --- trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc 2007-07-21 11:55:35 UTC (rev 1355) @@ -93,6 +93,8 @@ EDITTEXT IDC_BEVEL,240,183,20,12,ES_AUTOHSCROLL LTEXT "Border:",IDC_STATIC,275,185,30,8 EDITTEXT IDC_BORDER,305,183,20,12,ES_AUTOHSCROLL + LTEXT "Padding:",IDC_STATIC,235,205,30,8 + EDITTEXT IDC_PADDING,265,203,20,12,ES_AUTOHSCROLL GROUPBOX "Gradient Settings",IDC_STATIC,5,220,320,50,WS_GROUP LTEXT "Method:",IDC_STATIC,10,235,30,8 Modified: trunk/Source/emergeSchemeEngine/main.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/main.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeSchemeEngine/main.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -36,7 +36,6 @@ // Globals WCHAR scheme[MAX_PATH]; HBRUSH bgBrush = NULL; -bool paintBorder = false; // Globals HINSTANCE dllInstance; @@ -102,6 +101,7 @@ ELWriteFileBool(schemeFile, TEXT("window.clickThrough:"), guiInfo->clickThrough); ELWriteFileInt(schemeFile, TEXT("window.dragborder:"), (int)guiInfo->dragBorder); ELWriteFileInt(schemeFile, TEXT("window.bevelWidth:"), (int)guiInfo->bevelWidth); + ELWriteFileInt(schemeFile, TEXT("window.padding:"), (int)guiInfo->padding); ELWriteFileColor(schemeFile, TEXT("gradient.colorFrom:"), guiInfo->gradientFrom); ELWriteFileColor(schemeFile, TEXT("gradient.colorTo:"), guiInfo->gradientTo); ELWriteFileString(schemeFile, TEXT("gradient.method:"), guiInfo->gradientMethod); @@ -128,11 +128,12 @@ GetSysColor(COLOR_ACTIVECAPTION)); ELReadFileColor(schemeFile, TEXT("color.font:"), &guiInfo->colorFont, GetSysColor(COLOR_BTNTEXT)); - paintBorder = ELReadFileColor(schemeFile, TEXT("color.border:"), &guiInfo->colorBorder, RGB(0, 0, 0)); + ELReadFileColor(schemeFile, TEXT("color.border:"), &guiInfo->colorBorder, RGB(0, 0, 0)); ELReadFileBool(schemeFile, TEXT("window.shadow:"), &guiInfo->windowShadow, true); ELReadFileBool(schemeFile, TEXT("window.clickThrough:"), &guiInfo->clickThrough, false); ELReadFileInt(schemeFile, TEXT("window.dragborder:"), (int*)&guiInfo->dragBorder, 1); ELReadFileInt(schemeFile, TEXT("window.bevelWidth:"), (int*)&guiInfo->bevelWidth, 1); + ELReadFileInt(schemeFile, TEXT("window.padding:"), (int*)&guiInfo->padding, 0); ELReadFileColor(schemeFile, TEXT("gradient.colorFrom:"), &guiInfo->gradientFrom, GetSysColor(COLOR_ACTIVECAPTION)); ELReadFileColor(schemeFile, TEXT("gradient.colorTo:"), &guiInfo->gradientTo, @@ -248,7 +249,7 @@ HBITMAP bgBMP = CreateDIBSection(bgDC, &bmi, DIB_RGB_COLORS, &bgBits, NULL, 0x0); SelectObject(bgDC, bgBMP); - if (paintBorder) + if (guiInfo->dragBorder > 0) { CreateBorder(bgDC, clientRect, guiInfo->colorBorder, guiInfo->alphaBorder, guiInfo->dragBorder); Modified: trunk/Source/emergeSchemeEngine/resource.h =================================================================== --- trunk/Source/emergeSchemeEngine/resource.h 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeSchemeEngine/resource.h 2007-07-21 11:55:35 UTC (rev 1355) @@ -41,6 +41,7 @@ #define IDC_SHADOW 402 #define IDC_BEVEL 403 #define IDC_BORDER 404 +#define IDC_PADDING 405 #define IDC_METHOD 500 #define IDC_INTERLACED 501 Modified: trunk/Source/emergeTasks/Applet.cpp =================================================================== --- trunk/Source/emergeTasks/Applet.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeTasks/Applet.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -233,7 +233,7 @@ { UINT i; RECT rect; - int x, y, dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int x, y, dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; WCHAR windowTitle[MAX_LINE_LENGTH]; if (_wcsicmp(pSettings->GetHorizontalDirection(), TEXT("left")) == 0) @@ -654,7 +654,7 @@ autoSizeInfo.hwnd = mainWnd; autoSizeInfo.rect = wndRect; - autoSizeInfo.dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + autoSizeInfo.dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; autoSizeInfo.iconSize = pSettings->GetIconSize(); autoSizeInfo.iconSpacing = pSettings->GetIconSpacing(); autoSizeInfo.visibleIconCount = (UINT)taskList.size(); @@ -943,7 +943,7 @@ LRESULT Applet::DoSize(DWORD width, DWORD height) { - int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; if (!IsWindowVisible(mainWnd)) return 1; @@ -1079,7 +1079,7 @@ ResetTaskIcons(); - dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; ShowWindow(mainWnd, SW_HIDE); Modified: trunk/Source/emergeTray/Applet.cpp =================================================================== --- trunk/Source/emergeTray/Applet.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeTray/Applet.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -339,7 +339,7 @@ void Applet::AdjustIcons() { RECT r, rect; - int x, y, dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int x, y, dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; std::vector<TrayIcon*>::iterator iter; GetClientRect(mainWnd, &r); @@ -497,7 +497,7 @@ autoSizeInfo.hwnd = mainWnd; autoSizeInfo.rect = wndRect; - autoSizeInfo.dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + autoSizeInfo.dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; autoSizeInfo.iconSize = ICON_SIZE; autoSizeInfo.iconSpacing = pSettings->GetIconSpacing(); @@ -798,7 +798,7 @@ LRESULT Applet::DoSize(DWORD width, DWORD height) { - int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; movesizeinprogress = false; @@ -846,7 +846,7 @@ pSettings->ReadSettings(); ESELoadScheme(pSettings->GetSchemeFile(), &guiInfo); - dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; ShowWindow(mainWnd, SW_HIDE); Modified: trunk/Source/emergeVWM/Applet.cpp =================================================================== --- trunk/Source/emergeVWM/Applet.cpp 2007-07-20 22:58:56 UTC (rev 1354) +++ trunk/Source/emergeVWM/Applet.cpp 2007-07-21 11:55:35 UTC (rev 1355) @@ -524,7 +524,7 @@ POINT pt; RECT clientRect, desktopRect; bool found = false; - UINT dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + UINT dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; int screenWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN), screenHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN); @@ -679,7 +679,7 @@ std::vector<Task*>::iterator iter; UINT row, column; float columnScalar, rowScalar; - UINT dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + UINT dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; // get window dimensions GetWindowRect(mainWnd, &rt); @@ -1011,7 +1011,7 @@ { std::vector<Task*>::iterator iter; RECT emptyRect; - int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; if (!IsWindowVisible(mainWnd)) return 1; @@ -1087,7 +1087,7 @@ pSettings->ReadSettings(); ESELoadScheme(pSettings->GetSchemeFile(), &guiInfo); - dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth + guiInfo.padding; ShowWindow(mainWnd, SW_HIDE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-20 22:58:57
|
Revision: 1354 http://emerge.svn.sourceforge.net/emerge/?rev=1354&view=rev Author: ir0nh34d Date: 2007-07-20 15:58:56 -0700 (Fri, 20 Jul 2007) Log Message: ----------- Fixed background alpha issue Modified Paths: -------------- trunk/Source/emergeSchemeEngine/main.cpp Modified: trunk/Source/emergeSchemeEngine/main.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/main.cpp 2007-07-20 13:15:18 UTC (rev 1353) +++ trunk/Source/emergeSchemeEngine/main.cpp 2007-07-20 22:58:56 UTC (rev 1354) @@ -172,14 +172,12 @@ guiInfo->alphaInactive = tmpAlpha; if ((guiInfo->alphaBackground <= 0) && !guiInfo->clickThrough) - { - guiInfo->alphaBackground = 1; + guiInfo->alphaBackground = 1; - tmpAlpha = guiInfo->alphaBackground; - tmpAlpha *= 255; - tmpAlpha /= 100; - guiInfo->alphaBackground = tmpAlpha; - } + tmpAlpha = guiInfo->alphaBackground; + tmpAlpha *= 255; + tmpAlpha /= 100; + guiInfo->alphaBackground = tmpAlpha; if (guiInfo->alphaForeground <= 0) guiInfo->alphaForeground = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-20 13:15:23
|
Revision: 1353 http://emerge.svn.sourceforge.net/emerge/?rev=1353&view=rev Author: ir0nh34d Date: 2007-07-20 06:15:18 -0700 (Fri, 20 Jul 2007) Log Message: ----------- Fixed transparency bug with zero background and zero active or inactive settings Modified Paths: -------------- trunk/Source/emergeCommand/Applet.cpp trunk/Source/emergeCommand/Applet.h trunk/Source/emergeLauncher/Applet.cpp trunk/Source/emergeLauncher/Applet.h trunk/Source/emergeSchemeEngine/emergeSchemeEngine.h trunk/Source/emergeSchemeEngine/main.cpp trunk/Source/emergeTasks/Applet.cpp trunk/Source/emergeTasks/Applet.h trunk/Source/emergeTray/Applet.cpp trunk/Source/emergeTray/Applet.h trunk/Source/emergeVWM/Applet.cpp trunk/Source/emergeVWM/Applet.h Modified: trunk/Source/emergeCommand/Applet.cpp =================================================================== --- trunk/Source/emergeCommand/Applet.cpp 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeCommand/Applet.cpp 2007-07-20 13:15:18 UTC (rev 1353) @@ -70,7 +70,7 @@ pApplet->UpdateTip(tstring); if (IsWindowVisible(hWnd)) - pApplet->DrawAlphaBlend(false); + pApplet->DrawAlphaBlend(); } } @@ -154,7 +154,7 @@ case WM_SHOWWINDOW: if (wParam) - pApplet->DrawAlphaBlend(false); + pApplet->DrawAlphaBlend(); break; case WM_TIMER: @@ -219,7 +219,9 @@ mainFont = NULL; appletMonitor = NULL; - BackgroundDC = NULL; + activeBackgroundDC = NULL; + inactiveBackgroundDC = NULL; + ZeroMemory(&oldrt, sizeof(RECT)); } @@ -230,6 +232,11 @@ // Unregister the specified Emerge Desktop messages PostMessage(ELGetCoreWindow(), EMERGE_UNREGISTER, (WPARAM)mainWnd, (LPARAM)EMERGE_CORE); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + // Destroy mainMenu if (pAppletMenu) delete pAppletMenu; @@ -299,7 +306,7 @@ return 1; } -void Applet::DrawAlphaBlend(bool forceRefresh) +void Applet::DrawAlphaBlend() { HDC hdc; // handle of the DC we will create BLENDFUNCTION bf; // structure for alpha blending @@ -316,16 +323,23 @@ // create a DC for our bitmap -- the source DC for AlphaBlend hdc = EGBeginPaint(mainWnd); - if ((!EqualRect(&clientrt, &oldrt)) || forceRefresh) + if (!EqualRect(&clientrt, &oldrt)) { CopyRect(&oldrt, &clientrt); - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); - BackgroundDC = ESEPaintBackground(clientrt); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + activeBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, true); + inactiveBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, false); } - BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, - BackgroundDC, 0, 0, SRCCOPY); + if (mouseOver) + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + activeBackgroundDC, 0, 0, SRCCOPY); + else + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + inactiveBackgroundDC, 0, 0, SRCCOPY); if (_wcsicmp(pSettings->GetClockTextAlign(), TEXT("center")) == 0) formatInfo.alignment = EGDAT_CENTER; @@ -373,7 +387,7 @@ if (!PtInRect(&rc, pt)) { mouseOver = false; - DrawAlphaBlend(false); + DrawAlphaBlend(); KillTimer(mainWnd, timerID); } @@ -457,7 +471,7 @@ } - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -491,7 +505,7 @@ if (!mouseOver) { mouseOver = true; - DrawAlphaBlend(false); + DrawAlphaBlend(); SetTimer(mainWnd, MOUSE_TIMER, MOUSE_POLL_TIME, NULL); } @@ -662,7 +676,8 @@ pCommand->UpdateGUI(); - DrawAlphaBlend(true); + ZeroMemory(&oldrt, sizeof(RECT)); + DrawAlphaBlend(); } LRESULT Applet::ShowCommand() Modified: trunk/Source/emergeCommand/Applet.h =================================================================== --- trunk/Source/emergeCommand/Applet.h 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeCommand/Applet.h 2007-07-20 13:15:18 UTC (rev 1353) @@ -62,7 +62,7 @@ bool fullScreen; HFONT mainFont; POINT anchor; - HDC BackgroundDC; + HDC activeBackgroundDC, inactiveBackgroundDC; RECT oldrt; HMONITOR appletMonitor; UINT ShellMessage; @@ -90,7 +90,7 @@ LRESULT DoEmergeNotify(UINT messageClass, UINT message); LRESULT DoDisplayChange(HWND hwnd); LRESULT DoDefault(UINT message, UINT shellMessage, HWND task); - void DrawAlphaBlend(bool forceRefresh); + void DrawAlphaBlend(); void UpdateGUI(); LRESULT ShowCommand(); void SetCommandText(WCHAR *commandText); Modified: trunk/Source/emergeLauncher/Applet.cpp =================================================================== --- trunk/Source/emergeLauncher/Applet.cpp 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeLauncher/Applet.cpp 2007-07-20 13:15:18 UTC (rev 1353) @@ -172,7 +172,9 @@ activeBrush = NULL; appletMonitor = NULL; - BackgroundDC = NULL; + activeBackgroundDC = NULL; + inactiveBackgroundDC = NULL; + ZeroMemory(&oldrt, sizeof(RECT)); } @@ -181,6 +183,11 @@ // Unregister the specified Emerge Desktop messages PostMessage(ELGetCoreWindow(), EMERGE_UNREGISTER, (WPARAM)mainWnd, (LPARAM)EMERGE_CORE); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + // Destroy mainMenu delete pAppletMenu; } @@ -430,7 +437,7 @@ UpdateIcons(); } -void Applet::DrawAlphaBlend(bool forceRefresh) +void Applet::DrawAlphaBlend() { HDC hdc; BLENDFUNCTION bf; @@ -445,16 +452,23 @@ // create a DC for our bitmap -- the source DC for AlphaBlend hdc = EGBeginPaint(mainWnd); - if ((!EqualRect(&clientrt, &oldrt)) || forceRefresh) - { - CopyRect(&oldrt, &clientrt); - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); - BackgroundDC = ESEPaintBackground(clientrt); - } + if (!EqualRect(&clientrt, &oldrt)) + { + CopyRect(&oldrt, &clientrt); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + activeBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, true); + inactiveBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, false); + } - BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, - BackgroundDC, 0, 0, SRCCOPY); + if (mouseOver) + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + activeBackgroundDC, 0, 0, SRCCOPY); + else + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + inactiveBackgroundDC, 0, 0, SRCCOPY); PaintItems(hdc, clientrt); bf.BlendOp = AC_SRC_OVER; @@ -488,7 +502,7 @@ if (!PtInRect(&rc, pt)) { mouseOver = false; - DrawAlphaBlend(false); + DrawAlphaBlend(); KillTimer(mainWnd, MOUSE_TIMER); } @@ -534,7 +548,7 @@ if (!mouseOver) { mouseOver = true; - DrawAlphaBlend(false); + DrawAlphaBlend(); SetTimer(mainWnd, MOUSE_TIMER, MOUSE_POLL_TIME, NULL); } @@ -627,7 +641,7 @@ } UpdateIcons(); - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -751,7 +765,8 @@ if (pAppletMenu) pAppletMenu->UpdateHook(); - DrawAlphaBlend(true); + ZeroMemory(&oldrt, sizeof(RECT)); + DrawAlphaBlend(); } void Applet::UpdateIcons() Modified: trunk/Source/emergeLauncher/Applet.h =================================================================== --- trunk/Source/emergeLauncher/Applet.h 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeLauncher/Applet.h 2007-07-20 13:15:18 UTC (rev 1353) @@ -56,7 +56,7 @@ HWND mainWnd, toolWnd, activeWnd; HMENU mainMenu; HHOOK menuHook; - HDC BackgroundDC; + HDC activeBackgroundDC, inactiveBackgroundDC; RECT oldrt; bool fullScreen; HBRUSH activeBrush; @@ -92,7 +92,7 @@ void CreateBrushes(); void DestroyBrushes(); void AdjustRect(RECT *wndRect); - void DrawAlphaBlend(bool forceRefresh); + void DrawAlphaBlend(); void UpdateGUI(); void UpdateTip(UINT index); void DeleteTip(UINT index); Modified: trunk/Source/emergeSchemeEngine/emergeSchemeEngine.h =================================================================== --- trunk/Source/emergeSchemeEngine/emergeSchemeEngine.h 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeSchemeEngine/emergeSchemeEngine.h 2007-07-20 13:15:18 UTC (rev 1353) @@ -47,7 +47,7 @@ DLL_EXPORT void ESEReadScheme(WCHAR *schemeFile, LPGUIINFO guiInfo); DLL_EXPORT void ESELoadScheme(WCHAR *schemeFile, LPGUIINFO guiInfo); DLL_EXPORT int ESEEditScheme(HWND wnd, WCHAR *schemeFile); - DLL_EXPORT HDC ESEPaintBackground(RECT clientRect); + DLL_EXPORT HDC ESEPaintBackground(RECT clientRect, LPGUIINFO guiInfo, bool active); #ifdef __cplusplus } #endif Modified: trunk/Source/emergeSchemeEngine/main.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/main.cpp 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeSchemeEngine/main.cpp 2007-07-20 13:15:18 UTC (rev 1353) @@ -36,15 +36,7 @@ // Globals WCHAR scheme[MAX_PATH]; HBRUSH bgBrush = NULL; -BYTE bgAlpha; -BYTE borderAlpha; -COLORREF bgColor; -COLORREF borderColor; -COLORREF gradientFrom; -COLORREF gradientTo; -WCHAR gradientMethod[MAX_PATH]; bool paintBorder = false; -UINT dragBorder, bevelWidth; // Globals HINSTANCE dllInstance; @@ -150,9 +142,7 @@ void ESELoadScheme(WCHAR *schemeFile, LPGUIINFO guiInfo) { - float srcAlphaCheck, checkValue; - int testAlpha, tmpAlpha; - HDC hdc; + int tmpAlpha; ESESetScheme(schemeFile); ESEReadScheme(scheme, guiInfo); @@ -182,12 +172,14 @@ guiInfo->alphaInactive = tmpAlpha; if ((guiInfo->alphaBackground <= 0) && !guiInfo->clickThrough) - guiInfo->alphaBackground = 1; + { + guiInfo->alphaBackground = 1; - tmpAlpha = guiInfo->alphaBackground; - tmpAlpha *= 255; - tmpAlpha /= 100; - guiInfo->alphaBackground = tmpAlpha; + tmpAlpha = guiInfo->alphaBackground; + tmpAlpha *= 255; + tmpAlpha /= 100; + guiInfo->alphaBackground = tmpAlpha; + } if (guiInfo->alphaForeground <= 0) guiInfo->alphaForeground = 1; @@ -228,52 +220,16 @@ tmpAlpha *= 255; tmpAlpha /= 100; guiInfo->alphaText = tmpAlpha; - - if (!guiInfo->clickThrough) - { - if (guiInfo->alphaInactive < guiInfo->alphaActive) - testAlpha = guiInfo->alphaInactive; - else - testAlpha = guiInfo->alphaActive; - - srcAlphaCheck = (float)guiInfo->alphaBackground * (float)(testAlpha / 255.0); - - // Base check on colour depth of display - hdc = CreateCompatibleDC(NULL); - if (GetDeviceCaps(hdc, BITSPIXEL) == 32) - checkValue = 0.5; - else - checkValue = 3.5; - DeleteDC(hdc); - - while (srcAlphaCheck < checkValue) - { - guiInfo->alphaBackground++; - srcAlphaCheck = (float)guiInfo->alphaBackground * (float)(testAlpha / 255.0); - } - } - - bgAlpha = guiInfo->alphaBackground; - borderAlpha = guiInfo->alphaBorder; - bgColor = guiInfo->colorBackground; - borderColor = guiInfo->colorBorder; - - dragBorder = guiInfo->dragBorder; - bevelWidth = guiInfo->bevelWidth; - - gradientFrom = guiInfo->gradientFrom; - gradientTo = guiInfo->gradientTo; - wcscpy(gradientMethod, guiInfo->gradientMethod); } -HDC ESEPaintBackground(RECT clientRect) +HDC ESEPaintBackground(RECT clientRect, LPGUIINFO guiInfo, bool active) { bool interlaced = false, bevelled = false, sunken = false; BLENDFUNCTION bf; BITMAPINFO bmi; VOID *gradientBits, *bgBits; - COLORREF colorTo = gradientTo; - COLORREF colorFrom = gradientFrom; + COLORREF colorTo = guiInfo->gradientTo; + COLORREF colorFrom = guiInfo->gradientFrom; HDC bgDC = CreateCompatibleDC(NULL); HDC gradientDC = CreateCompatibleDC(NULL); @@ -296,12 +252,12 @@ if (paintBorder) { - CreateBorder(bgDC, clientRect, borderColor, borderAlpha, dragBorder); + CreateBorder(bgDC, clientRect, guiInfo->colorBorder, guiInfo->alphaBorder, guiInfo->dragBorder); - x += dragBorder; - y += dragBorder; - width -= 2 * dragBorder; - height -= 2 * dragBorder; + x += guiInfo->dragBorder; + y += guiInfo->dragBorder; + width -= 2 * guiInfo->dragBorder; + height -= 2 * guiInfo->dragBorder; } bmi.bmiHeader.biWidth = width; @@ -313,41 +269,44 @@ bf.BlendOp = AC_SRC_OVER; bf.BlendFlags = 0; - bf.SourceConstantAlpha = bgAlpha; + if (active) + bf.SourceConstantAlpha = EGGetMinAlpha(guiInfo->alphaBackground, guiInfo->alphaActive); + else + bf.SourceConstantAlpha = EGGetMinAlpha(guiInfo->alphaBackground, guiInfo->alphaInactive); bf.AlphaFormat = AC_SRC_ALPHA; - if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("interlaced")) != NULL) + if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("interlaced")) != NULL) interlaced = true; - if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("raised")) != NULL) + if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("raised")) != NULL) bevelled = true; - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("sunken")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("sunken")) != NULL) { bevelled = true; sunken = true; } - if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("vertical")) != NULL) + if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("vertical")) != NULL) vgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("horizontal")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("horizontal")) != NULL) hgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("crossdiagonal")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("crossdiagonal")) != NULL) cdgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("diagonal")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("diagonal")) != NULL) dgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("pipecross")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("pipecross")) != NULL) pcgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("elliptic")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("elliptic")) != NULL) egradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("rectangle")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("rectangle")) != NULL) rgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); - else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("pyramid")) != NULL) + else if (wcsstr(wcslwr(wcsdup(guiInfo->gradientMethod)), TEXT("pyramid")) != NULL) pgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); else - vgradient(width, height, bgColor, bgColor, (BYTE*)gradientBits, interlaced); + vgradient(width, height, guiInfo->colorBackground, guiInfo->colorBackground, (BYTE*)gradientBits, interlaced); if (bevelled) - bevel(width, height, bevelWidth, (BYTE*)gradientBits, sunken); + bevel(width, height, guiInfo->bevelWidth, (BYTE*)gradientBits, sunken); AlphaBlend(bgDC, x, y, width, height, gradientDC, 0, 0, width, height, bf); Modified: trunk/Source/emergeTasks/Applet.cpp =================================================================== --- trunk/Source/emergeTasks/Applet.cpp 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeTasks/Applet.cpp 2007-07-20 13:15:18 UTC (rev 1353) @@ -137,7 +137,8 @@ activeWnd = NULL; appletMonitor = NULL; - BackgroundDC = NULL; + activeBackgroundDC = NULL; + inactiveBackgroundDC = NULL; ZeroMemory(&oldrt, sizeof(RECT)); } @@ -153,8 +154,10 @@ // Unregister as a Shell window ELRegisterShellHookWindow(mainWnd, false); - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); // Cleanup the icon vectors while (!taskList.empty()) @@ -374,7 +377,7 @@ SWP_NOZORDER | SWP_NOACTIVATE); } - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -399,7 +402,7 @@ icon = EGGetWindowIcon(task, true); (*iter)->SetIcon(icon); - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -431,7 +434,7 @@ SWP_NOZORDER | SWP_NOACTIVATE); } - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -611,7 +614,7 @@ } if (refresh) - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -670,7 +673,7 @@ UpdateIcons(); } -void Applet::DrawAlphaBlend(bool forceRefresh) +void Applet::DrawAlphaBlend() { HDC hdc; RECT clientrt, rt; @@ -683,16 +686,23 @@ hdc = EGBeginPaint(mainWnd); - if ((!EqualRect(&clientrt, &oldrt)) || forceRefresh) - { - CopyRect(&oldrt, &clientrt); - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); - BackgroundDC = ESEPaintBackground(clientrt); - } + if (!EqualRect(&clientrt, &oldrt)) + { + CopyRect(&oldrt, &clientrt); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + activeBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, true); + inactiveBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, false); + } - BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, - BackgroundDC, 0, 0, SRCCOPY); + if (mouseOver) + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + activeBackgroundDC, 0, 0, SRCCOPY); + else + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + inactiveBackgroundDC, 0, 0, SRCCOPY); PaintTasks(hdc, clientrt); bf.BlendOp = AC_SRC_OVER; @@ -728,7 +738,7 @@ if (!PtInRect(&rc, pt)) { mouseOver = false; - DrawAlphaBlend(false); + DrawAlphaBlend(); KillTimer(mainWnd, MOUSE_TIMER); } @@ -757,7 +767,7 @@ if (refresh) { (*iter)->ToggleVisible(); - DrawAlphaBlend(false); + DrawAlphaBlend(); } return 0; @@ -804,7 +814,7 @@ if (!mouseOver) { mouseOver = true; - DrawAlphaBlend(false); + DrawAlphaBlend(); SetTimer(mainWnd, MOUSE_TIMER, MOUSE_POLL_TIME, NULL); } @@ -898,7 +908,7 @@ UpdateIcons(); - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -972,7 +982,7 @@ if (messageClass & EMERGE_VWM) { activeWnd = NULL; - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -1013,7 +1023,7 @@ if ((task != mainWnd) && (task != activeWnd)) { activeWnd = task; - DrawAlphaBlend(false); + DrawAlphaBlend(); } return SetFlash(task, false); @@ -1026,7 +1036,7 @@ if ((task != mainWnd) && (task != activeWnd)) { activeWnd = task; - DrawAlphaBlend(false); + DrawAlphaBlend(); } return SetFlash(task, false); @@ -1116,6 +1126,7 @@ if (pAppletMenu) pAppletMenu->UpdateHook(); - DrawAlphaBlend(true); + ZeroMemory(&oldrt, sizeof(RECT)); + DrawAlphaBlend(); } Modified: trunk/Source/emergeTasks/Applet.h =================================================================== --- trunk/Source/emergeTasks/Applet.h 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeTasks/Applet.h 2007-07-20 13:15:18 UTC (rev 1353) @@ -57,7 +57,7 @@ HWND mainWnd, toolWnd, activeWnd; HMENU mainMenu; HHOOK menuHook; - HDC BackgroundDC; + HDC activeBackgroundDC, inactiveBackgroundDC; bool fullScreen; void ResetTaskIcons(); POINT anchor; @@ -99,7 +99,7 @@ void AdjustRect(RECT *wndRect); void BuildTasksList(); std::vector<Task*>::iterator FindTask(HWND hwnd); - void DrawAlphaBlend(bool forceRefresh); + void DrawAlphaBlend(); void UpdateGUI(); void SetActive(HWND hwnd); GUIINFO guiInfo; Modified: trunk/Source/emergeTray/Applet.cpp =================================================================== --- trunk/Source/emergeTray/Applet.cpp 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeTray/Applet.cpp 2007-07-20 13:15:18 UTC (rev 1353) @@ -198,7 +198,8 @@ appletMonitor = NULL; - BackgroundDC = NULL; + activeBackgroundDC = NULL; + inactiveBackgroundDC = NULL; // activeIcon = NULL; @@ -216,8 +217,10 @@ // Destroy mainMenu delete pAppletMenu; - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); // Cleanup the icon vectors while (!trayIconList.empty()) @@ -510,7 +513,7 @@ EAEAutoSize(autoSizeInfo); } -void Applet::DrawAlphaBlend(bool forceRefresh) +void Applet::DrawAlphaBlend() { HDC hdc; // handle of the DC we will create BLENDFUNCTION bf; // structure for alpha blending @@ -525,16 +528,23 @@ // create a DC for our bitmap -- the source DC for AlphaBlend hdc = EGBeginPaint(mainWnd); - if ((!EqualRect(&clientrt, &oldrt)) || forceRefresh) - { - CopyRect(&oldrt, &clientrt); - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); - BackgroundDC = ESEPaintBackground(clientrt); - } + if (!EqualRect(&clientrt, &oldrt)) + { + CopyRect(&oldrt, &clientrt); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + activeBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, true); + inactiveBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, false); + } - BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, - BackgroundDC, 0, 0, SRCCOPY); + if (mouseOver) + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + activeBackgroundDC, 0, 0, SRCCOPY); + else + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + inactiveBackgroundDC, 0, 0, SRCCOPY); PaintIcons(hdc, clientrt); bf.BlendOp = AC_SRC_OVER; @@ -586,7 +596,7 @@ }*/ mouseOver = false; - DrawAlphaBlend(false); + DrawAlphaBlend(); KillTimer(mainWnd, MOUSE_TIMER); ShowHiddenIcons(false, false); // roblarky } @@ -646,7 +656,7 @@ if (!mouseOver) { mouseOver = true; - DrawAlphaBlend(false); + DrawAlphaBlend(); ShowHiddenIcons(true, false); // roblarky SetTimer(mainWnd, MOUSE_TIMER, MOUSE_POLL_TIME, NULL); } @@ -750,7 +760,7 @@ AdjustIcons(); UpdateIcons(); - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -875,7 +885,8 @@ if (pAppletMenu) pAppletMenu->UpdateHook(); - DrawAlphaBlend(true); + ZeroMemory(&oldrt, sizeof(RECT)); + DrawAlphaBlend(); } //----- @@ -1069,7 +1080,7 @@ AdjustIcons(); - DrawAlphaBlend(false); + DrawAlphaBlend(); } } } @@ -1140,7 +1151,7 @@ AdjustIcons(); - DrawAlphaBlend(false); + DrawAlphaBlend(); } return 1; @@ -1223,7 +1234,7 @@ AdjustIcons(); } - DrawAlphaBlend(false); + DrawAlphaBlend(); return 1; } @@ -1276,7 +1287,7 @@ AdjustIcons(); - DrawAlphaBlend(false); + DrawAlphaBlend(); } return 1; Modified: trunk/Source/emergeTray/Applet.h =================================================================== --- trunk/Source/emergeTray/Applet.h 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeTray/Applet.h 2007-07-20 13:15:18 UTC (rev 1353) @@ -249,7 +249,7 @@ HWND mainWnd, toolWnd, trayWnd, notifyWnd; HMENU mainMenu; HHOOK menuHook; - HDC BackgroundDC; + HDC activeBackgroundDC, inactiveBackgroundDC; bool fullScreen; bool baseClassRegistered, trayClassRegistered, notifyClassRegistered; RECT HoverRect, oldrt; @@ -287,7 +287,7 @@ LRESULT DoDefault(UINT message, UINT shellMessage, HWND task); void AdjustIcons(); void AdjustRect(RECT *wndRect); - void DrawAlphaBlend(bool forceRefresh); + void DrawAlphaBlend(); void UpdateGUI(); void UnloadSSO(); void LoadSSO(); Modified: trunk/Source/emergeVWM/Applet.cpp =================================================================== --- trunk/Source/emergeVWM/Applet.cpp 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeVWM/Applet.cpp 2007-07-20 13:15:18 UTC (rev 1353) @@ -152,7 +152,9 @@ appletMonitor = NULL; - BackgroundDC = NULL; + activeBackgroundDC = NULL; + inactiveBackgroundDC = NULL; + ZeroMemory(&oldrt, sizeof(RECT)); } @@ -175,6 +177,11 @@ ELRegisterShellHookWindow(mainWnd, false); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + // Destroy mainMenu delete pAppletMenu; @@ -501,7 +508,7 @@ EndDeferWindowPos(dwp); - DrawAlphaBlend(false); + DrawAlphaBlend(); } //----- @@ -662,7 +669,7 @@ return 1; } -void Applet::DrawAlphaBlend(bool forceRefresh) +void Applet::DrawAlphaBlend() { HDC hdc; // handle of the DC we will create BLENDFUNCTION bf; // structure for alpha blending @@ -681,16 +688,23 @@ // create a DC for our bitmap -- the source DC for AlphaBlend hdc = EGBeginPaint(mainWnd); - if ((!EqualRect(&clientrt, &oldrt)) || forceRefresh) - { - CopyRect(&oldrt, &clientrt); - if (BackgroundDC != NULL) - DeleteDC(BackgroundDC); - BackgroundDC = ESEPaintBackground(clientrt); - } + if (!EqualRect(&clientrt, &oldrt)) + { + CopyRect(&oldrt, &clientrt); + if (activeBackgroundDC != NULL) + DeleteDC(activeBackgroundDC); + if (inactiveBackgroundDC != NULL) + DeleteDC(inactiveBackgroundDC); + activeBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, true); + inactiveBackgroundDC = ESEPaintBackground(clientrt, &guiInfo, false); + } - BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, - BackgroundDC, 0, 0, SRCCOPY); + if (mouseOver) + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + activeBackgroundDC, 0, 0, SRCCOPY); + else + BitBlt(hdc, clientrt.left, clientrt.top, clientrt.right - clientrt.left, clientrt.bottom - clientrt.top, + inactiveBackgroundDC, 0, 0, SRCCOPY); rowScalar = (float)(clientrt.bottom - (2 * dragBorder)) / (float)pSettings->GetDesktopRows(); @@ -772,7 +786,7 @@ if (!PtInRect(&rc, pt)) { mouseOver = false; - DrawAlphaBlend(false); + DrawAlphaBlend(); KillTimer(mainWnd, MOUSE_TIMER); } @@ -800,7 +814,7 @@ // Add new tasks EnumWindows(BuildTasksList, 0); - DrawAlphaBlend(false); + DrawAlphaBlend(); SetTimer(mainWnd, NEW_TASK_TIMER, NEW_TASK_POLL_TIME, NULL); @@ -878,7 +892,7 @@ if (!mouseOver) { mouseOver = true; - DrawAlphaBlend(false); + DrawAlphaBlend(); SetTimer(mainWnd, MOUSE_TIMER, MOUSE_POLL_TIME, NULL); } @@ -972,7 +986,7 @@ } - DrawAlphaBlend(false); + DrawAlphaBlend(); return 0; } @@ -1103,7 +1117,8 @@ if (pAppletMenu) pAppletMenu->UpdateHook(); - DrawAlphaBlend(true); + ZeroMemory(&oldrt, sizeof(RECT)); + DrawAlphaBlend(); } LRESULT Applet::DoNotify(HWND hwnd, LPARAM lParam) Modified: trunk/Source/emergeVWM/Applet.h =================================================================== --- trunk/Source/emergeVWM/Applet.h 2007-07-20 13:14:19 UTC (rev 1352) +++ trunk/Source/emergeVWM/Applet.h 2007-07-20 13:15:18 UTC (rev 1353) @@ -63,7 +63,7 @@ HWND mainWnd, toolWnd, oldActiveWindow, selectedWindow, oldTipWindow; HMENU mainMenu; HHOOK menuHook; - HDC BackgroundDC; + HDC activeBackgroundDC, inactiveBackgroundDC; RECT oldrt; TOOLINFO ti; POINT referencePt; @@ -96,7 +96,7 @@ LRESULT DesktopMouseEvent(HWND hwnd, UINT message, LPARAM lParam); LRESULT DoDisplayChange(HWND hwnd); LRESULT DoDefault(UINT message, UINT shellMessage, HWND task); - void DrawAlphaBlend(bool forceRefresh); + void DrawAlphaBlend(); void UpdateGUI(); bool IsWindowValidTask(HWND hwnd); void SwitchDesktop(UINT row, UINT column, bool gather); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-20 13:14:21
|
Revision: 1352 http://emerge.svn.sourceforge.net/emerge/?rev=1352&view=rev Author: ir0nh34d Date: 2007-07-20 06:14:19 -0700 (Fri, 20 Jul 2007) Log Message: ----------- Added EGGetMinAlpha Modified Paths: -------------- trunk/Source/emergeGraphics/emergeGraphics.h trunk/Source/emergeGraphics/main.cpp Modified: trunk/Source/emergeGraphics/emergeGraphics.h =================================================================== --- trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-12 21:33:34 UTC (rev 1351) +++ trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-20 13:14:19 UTC (rev 1352) @@ -140,6 +140,7 @@ DLL_EXPORT bool EGFillRect(HDC hdc, RECT *rect, BYTE alpha, COLORREF colour); DLL_EXPORT bool EGFrameRect(HDC hdc, RECT *rect, BYTE alpha, COLORREF colour); DLL_EXPORT UINT32 EGGetPixel(BYTE alpha, COLORREF colour); + DLL_EXPORT BYTE EGGetMinAlpha(BYTE alphaBase, BYTE alphaDelta); #ifdef __cplusplus } #endif Modified: trunk/Source/emergeGraphics/main.cpp =================================================================== --- trunk/Source/emergeGraphics/main.cpp 2007-07-12 21:33:34 UTC (rev 1351) +++ trunk/Source/emergeGraphics/main.cpp 2007-07-20 13:14:19 UTC (rev 1352) @@ -58,6 +58,32 @@ HDC hdc = NULL; HBITMAP hbitmap = NULL; +BYTE EGGetMinAlpha(BYTE alphaBase, BYTE alphaDelta) +{ + BYTE alphaMin = alphaBase; + float srcAlphaCheck, checkValue; + + if (alphaMin == 0) + return alphaMin; + + // Base check on colour depth of display + hdc = CreateCompatibleDC(NULL); + if (GetDeviceCaps(hdc, BITSPIXEL) == 32) + checkValue = 0.5; + else + checkValue = 3.5; + DeleteDC(hdc); + + srcAlphaCheck = (float)alphaMin * (float)(alphaDelta / 255.0); + while ((srcAlphaCheck < checkValue) && (alphaMin < 255)) + { + alphaMin++; + srcAlphaCheck = (float)alphaMin * (float)(alphaDelta / 255.0); + } + + return alphaMin; +} + //------ // Function: EGConvertIcon // Requires: HICON sourceIcon - input Icon This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-12 21:33:38
|
Revision: 1351 http://emerge.svn.sourceforge.net/emerge/?rev=1351&view=rev Author: roblarky Date: 2007-07-12 14:33:34 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Merged into all Applets, I feel quite comfortable with the changes now :-) Modified Paths: -------------- trunk/Source/emergeCommand/Applet.cpp trunk/Source/emergeCommand/Applet.h trunk/Source/emergeLauncher/Applet.cpp trunk/Source/emergeTasks/Applet.cpp trunk/Source/emergeTasks/Applet.h trunk/Source/emergeTray/Applet.cpp trunk/Source/emergeTray/Applet.h trunk/Source/emergeVWM/Applet.cpp trunk/Source/emergeVWM/Applet.h Modified: trunk/Source/emergeCommand/Applet.cpp =================================================================== --- trunk/Source/emergeCommand/Applet.cpp 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeCommand/Applet.cpp 2007-07-12 21:33:34 UTC (rev 1351) @@ -404,6 +404,12 @@ LRESULT Applet::DoSizing(HWND hwnd, UINT edge, LPRECT rect) { + int height; + int width; + + height = (*rect).bottom - (*rect).top; + width = (*rect).right - (*rect).left; + if (pSettings->GetSnapSize()) { SNAPSIZEINFO ssi; @@ -414,6 +420,43 @@ ELSnapSize(&ssi); } + if ((edge == WMSZ_TOPRIGHT) || (edge == WMSZ_TOP) || (edge == WMSZ_RIGHT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_BOTTOMRIGHT) || (edge == WMSZ_BOTTOM)) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_TOPLEFT) || (edge == WMSZ_LEFT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + if (edge == WMSZ_BOTTOMLEFT) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + DrawAlphaBlend(false); return 0; } Modified: trunk/Source/emergeCommand/Applet.h =================================================================== --- trunk/Source/emergeCommand/Applet.h 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeCommand/Applet.h 2007-07-12 21:33:34 UTC (rev 1351) @@ -41,6 +41,8 @@ #define FULLSCREEN_TIMER 1 #define FULLSCREEN_POLL_TIME 100 +#define MIN_APPLET_SIZE 10 + #include "AppletMenu.h" #include <locale.h> #include <vector> Modified: trunk/Source/emergeLauncher/Applet.cpp =================================================================== --- trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 21:33:34 UTC (rev 1351) @@ -574,7 +574,6 @@ LRESULT Applet::DoSizing(HWND hwnd, UINT edge, LPRECT rect) { - SNAPSIZEINFO ssi; int height; int width; @@ -583,6 +582,7 @@ if (!pSettings->GetAutoSize() && pSettings->GetSnapSize()) { + SNAPSIZEINFO ssi; ssi.AppletWindow = hwnd; ssi.AppletEdge = edge; ssi.AppletRect = rect; Modified: trunk/Source/emergeTasks/Applet.cpp =================================================================== --- trunk/Source/emergeTasks/Applet.cpp 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeTasks/Applet.cpp 2007-07-12 21:33:34 UTC (rev 1351) @@ -844,10 +844,15 @@ LRESULT Applet::DoSizing(HWND hwnd, UINT edge, LPRECT rect) { - SNAPSIZEINFO ssi; + int height; + int width; + height = (*rect).bottom - (*rect).top; + width = (*rect).right - (*rect).left; + if (!pSettings->GetAutoSize() && pSettings->GetSnapSize()) { + SNAPSIZEINFO ssi; ssi.AppletWindow = hwnd; ssi.AppletEdge = edge; ssi.AppletRect = rect; @@ -855,6 +860,43 @@ ELSnapSize(&ssi); } + if ((edge == WMSZ_TOPRIGHT) || (edge == WMSZ_TOP) || (edge == WMSZ_RIGHT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_BOTTOMRIGHT) || (edge == WMSZ_BOTTOM)) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_TOPLEFT) || (edge == WMSZ_LEFT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + if (edge == WMSZ_BOTTOMLEFT) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + UpdateIcons(); DrawAlphaBlend(false); return 0; Modified: trunk/Source/emergeTasks/Applet.h =================================================================== --- trunk/Source/emergeTasks/Applet.h 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeTasks/Applet.h 2007-07-12 21:33:34 UTC (rev 1351) @@ -37,6 +37,8 @@ #define MOUSE_TIMER 0 #define MOUSE_POLL_TIME 250 +#define MIN_APPLET_SIZE 10 + #include "AppletMenu.h" #include <vector> #include <process.h> Modified: trunk/Source/emergeTray/Applet.cpp =================================================================== --- trunk/Source/emergeTray/Applet.cpp 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeTray/Applet.cpp 2007-07-12 21:33:34 UTC (rev 1351) @@ -696,10 +696,15 @@ LRESULT Applet::DoSizing(HWND hwnd, UINT edge, LPRECT rect) { - SNAPSIZEINFO ssi; + int height; + int width; + height = (*rect).bottom - (*rect).top; + width = (*rect).right - (*rect).left; + if (!pSettings->GetAutoSize() && pSettings->GetSnapSize()) { + SNAPSIZEINFO ssi; ssi.AppletWindow = hwnd; ssi.AppletEdge = edge; ssi.AppletRect = rect; @@ -707,6 +712,42 @@ ELSnapSize(&ssi); } + if ((edge == WMSZ_TOPRIGHT) || (edge == WMSZ_TOP) || (edge == WMSZ_RIGHT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_BOTTOMRIGHT) || (edge == WMSZ_BOTTOM)) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_TOPLEFT) || (edge == WMSZ_LEFT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + if (edge == WMSZ_BOTTOMLEFT) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + AdjustIcons(); UpdateIcons(); DrawAlphaBlend(false); Modified: trunk/Source/emergeTray/Applet.h =================================================================== --- trunk/Source/emergeTray/Applet.h 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeTray/Applet.h 2007-07-12 21:33:34 UTC (rev 1351) @@ -37,6 +37,8 @@ #define MOUSE_TIMER 0 #define MOUSE_POLL_TIME 250 +#define MIN_APPLET_SIZE 10 + #include "AppletMenu.h" #include <vector> #include <process.h> Modified: trunk/Source/emergeVWM/Applet.cpp =================================================================== --- trunk/Source/emergeVWM/Applet.cpp 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeVWM/Applet.cpp 2007-07-12 21:33:34 UTC (rev 1351) @@ -918,6 +918,12 @@ LRESULT Applet::DoSizing(HWND hwnd, UINT edge, LPRECT rect) { + int height; + int width; + + height = (*rect).bottom - (*rect).top; + width = (*rect).right - (*rect).left; + if (pSettings->GetSnapSize()) { SNAPSIZEINFO ssi; @@ -929,6 +935,43 @@ ELSnapSize(&ssi); } + if ((edge == WMSZ_TOPRIGHT) || (edge == WMSZ_TOP) || (edge == WMSZ_RIGHT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_BOTTOMRIGHT) || (edge == WMSZ_BOTTOM)) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + + if ((edge == WMSZ_TOPLEFT) || (edge == WMSZ_LEFT)) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + if (edge == WMSZ_BOTTOMLEFT) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + + DrawAlphaBlend(false); return 0; } Modified: trunk/Source/emergeVWM/Applet.h =================================================================== --- trunk/Source/emergeVWM/Applet.h 2007-07-12 21:15:00 UTC (rev 1350) +++ trunk/Source/emergeVWM/Applet.h 2007-07-12 21:33:34 UTC (rev 1351) @@ -37,6 +37,8 @@ #define MOUSE_TIMER 0 #define MOUSE_POLL_TIME 250 +#define MIN_APPLET_SIZE 10 + #define NEW_TASK_TIMER 1 #define NEW_TASK_POLL_TIME 250 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-12 21:15:01
|
Revision: 1350 http://emerge.svn.sourceforge.net/emerge/?rev=1350&view=rev Author: roblarky Date: 2007-07-12 14:15:00 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Tightened and cleaned up code. Modified Paths: -------------- trunk/Source/emergeLauncher/Applet.cpp Modified: trunk/Source/emergeLauncher/Applet.cpp =================================================================== --- trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 20:34:17 UTC (rev 1349) +++ trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 21:15:00 UTC (rev 1350) @@ -590,64 +590,40 @@ ELSnapSize(&ssi); } - if ((edge == WMSZ_BOTTOM) && (height < MIN_APPLET_SIZE)) - (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; - - if ((edge == WMSZ_TOP) && (height < MIN_APPLET_SIZE)) - (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; - - if ((edge == WMSZ_RIGHT) && (width < MIN_APPLET_SIZE)) - (*rect).right = (*rect).left + MIN_APPLET_SIZE; - - if ((edge == WMSZ_LEFT) && (width < MIN_APPLET_SIZE)) - (*rect).left = (*rect).right - MIN_APPLET_SIZE; - - if (edge == WMSZ_TOPRIGHT) + if ((edge == WMSZ_TOPRIGHT) || (edge == WMSZ_TOP) || (edge == WMSZ_RIGHT)) { - if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) - { - if (height < MIN_APPLET_SIZE) - (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; - if (width < MIN_APPLET_SIZE) - (*rect).right = (*rect).left + MIN_APPLET_SIZE; - } + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; } - if (edge == WMSZ_BOTTOMRIGHT) + if ((edge == WMSZ_BOTTOMRIGHT) || (edge == WMSZ_BOTTOM)) { - if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) - { - if (height < MIN_APPLET_SIZE) - (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; - if (width < MIN_APPLET_SIZE) - (*rect).right = (*rect).left + MIN_APPLET_SIZE; - } + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; } - if (edge == WMSZ_TOPLEFT) + if ((edge == WMSZ_TOPLEFT) || (edge == WMSZ_LEFT)) { - if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) - { - if (height < MIN_APPLET_SIZE) - (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; - if (width < MIN_APPLET_SIZE) - (*rect).left = (*rect).right - MIN_APPLET_SIZE; - } + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; } if (edge == WMSZ_BOTTOMLEFT) { - if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) - { - if (height < MIN_APPLET_SIZE) - (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; - if (width < MIN_APPLET_SIZE) - (*rect).left = (*rect).right - MIN_APPLET_SIZE; - } + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; } UpdateIcons(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-12 20:34:18
|
Revision: 1349 http://emerge.svn.sourceforge.net/emerge/?rev=1349&view=rev Author: roblarky Date: 2007-07-12 13:34:17 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Removed an unnecessary block of code I added in DoSize. Modified Paths: -------------- trunk/Source/emergeLauncher/Applet.cpp Modified: trunk/Source/emergeLauncher/Applet.cpp =================================================================== --- trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 20:29:58 UTC (rev 1348) +++ trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 20:34:17 UTC (rev 1349) @@ -696,12 +696,6 @@ if (pSettings->GetAutoSize()) return 1; - if ((int)width < MIN_APPLET_SIZE) - width = (DWORD)MIN_APPLET_SIZE; - - if ((int)height < MIN_APPLET_SIZE) - height = (DWORD)MIN_APPLET_SIZE; - pSettings->SetSize(width - (2 * dragBorder), height - (2 * dragBorder)); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-12 20:29:59
|
Revision: 1348 http://emerge.svn.sourceforge.net/emerge/?rev=1348&view=rev Author: roblarky Date: 2007-07-12 13:29:58 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Added code to keep Applet from being resized too small. Modified Paths: -------------- trunk/Source/emergeLauncher/Applet.cpp trunk/Source/emergeLauncher/Applet.h Modified: trunk/Source/emergeLauncher/Applet.cpp =================================================================== --- trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 01:50:20 UTC (rev 1347) +++ trunk/Source/emergeLauncher/Applet.cpp 2007-07-12 20:29:58 UTC (rev 1348) @@ -575,7 +575,12 @@ LRESULT Applet::DoSizing(HWND hwnd, UINT edge, LPRECT rect) { SNAPSIZEINFO ssi; + int height; + int width; + height = (*rect).bottom - (*rect).top; + width = (*rect).right - (*rect).left; + if (!pSettings->GetAutoSize() && pSettings->GetSnapSize()) { ssi.AppletWindow = hwnd; @@ -585,6 +590,66 @@ ELSnapSize(&ssi); } + if ((edge == WMSZ_BOTTOM) && (height < MIN_APPLET_SIZE)) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if ((edge == WMSZ_TOP) && (height < MIN_APPLET_SIZE)) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if ((edge == WMSZ_RIGHT) && (width < MIN_APPLET_SIZE)) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + + if ((edge == WMSZ_LEFT) && (width < MIN_APPLET_SIZE)) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + + if (edge == WMSZ_TOPRIGHT) + { + if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + } + + if (edge == WMSZ_BOTTOMRIGHT) + { + if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).right = (*rect).left + MIN_APPLET_SIZE; + } + } + + if (edge == WMSZ_TOPLEFT) + { + if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) + { + if (height < MIN_APPLET_SIZE) + (*rect).top = (*rect).bottom - MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + } + + if (edge == WMSZ_BOTTOMLEFT) + { + if (width < MIN_APPLET_SIZE || height < MIN_APPLET_SIZE) + { + if (height < MIN_APPLET_SIZE) + (*rect).bottom = (*rect).top + MIN_APPLET_SIZE; + + if (width < MIN_APPLET_SIZE) + (*rect).left = (*rect).right - MIN_APPLET_SIZE; + } + } + UpdateIcons(); DrawAlphaBlend(false); return 0; @@ -631,6 +696,12 @@ if (pSettings->GetAutoSize()) return 1; + if ((int)width < MIN_APPLET_SIZE) + width = (DWORD)MIN_APPLET_SIZE; + + if ((int)height < MIN_APPLET_SIZE) + height = (DWORD)MIN_APPLET_SIZE; + pSettings->SetSize(width - (2 * dragBorder), height - (2 * dragBorder)); return 0; Modified: trunk/Source/emergeLauncher/Applet.h =================================================================== --- trunk/Source/emergeLauncher/Applet.h 2007-07-12 01:50:20 UTC (rev 1347) +++ trunk/Source/emergeLauncher/Applet.h 2007-07-12 20:29:58 UTC (rev 1348) @@ -37,6 +37,8 @@ #define MOUSE_TIMER 0 #define MOUSE_POLL_TIME 250 +#define MIN_APPLET_SIZE 10 + #include "AppletMenu.h" #include <vector> #include <process.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-12 01:50:22
|
Revision: 1347 http://emerge.svn.sourceforge.net/emerge/?rev=1347&view=rev Author: ir0nh34d Date: 2007-07-11 18:50:20 -0700 (Wed, 11 Jul 2007) Log Message: ----------- Added alphaDelta to address issues with the various font anti aliasing types Modified Paths: -------------- trunk/Source/emergeGraphics/emergeGraphics.h trunk/Source/emergeGraphics/main.cpp Modified: trunk/Source/emergeGraphics/emergeGraphics.h =================================================================== --- trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-10 20:37:33 UTC (rev 1346) +++ trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-12 01:50:20 UTC (rev 1347) @@ -68,6 +68,14 @@ #define EGDAT_CENTER 2 #define EGDAT_RIGHT 3 +#ifndef FE_FONTSMOOTHINGSTANDARD +#define FE_FONTSMOOTHINGSTANDARD 1 +#endif + +#ifndef FE_FONTSMOOTHINGCLEARTYPE +#define FE_FONTSMOOTHINGCLEARTYPE 2 +#endif + // Format Info typedef struct _FORMATINFO { Modified: trunk/Source/emergeGraphics/main.cpp =================================================================== --- trunk/Source/emergeGraphics/main.cpp 2007-07-10 20:37:33 UTC (rev 1346) +++ trunk/Source/emergeGraphics/main.cpp 2007-07-12 01:50:20 UTC (rev 1347) @@ -678,12 +678,13 @@ char *bmpBits; char *maskBits; int x,y; - UINT drawFlags; + UINT drawFlags, fontSmoothing = 0; UCHAR alphaValue; DRAWTEXTPARAMS dtp; UINT32 pixel; BLENDFUNCTION bf; BOOL ret; + float alphaDelta = 0.0; bf.BlendOp = AC_SRC_OVER; bf.BlendFlags = 0; @@ -733,6 +734,13 @@ GetDIBits(fillDC, fillBMP, 0, clientInfo.rt.bottom, bmpBits, &bmi, DIB_RGB_COLORS); GetDIBits(maskdc, hmask, 0, clientInfo.rt.bottom, maskBits, &bmi, DIB_RGB_COLORS); + SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &fontSmoothing, 0); + + if (fontSmoothing == FE_FONTSMOOTHINGCLEARTYPE) + alphaDelta = ((float)clientInfo.bgAlpha / 255.0) * 20.0; + else + alphaDelta = ((float)clientInfo.bgAlpha / 255.0) * 100.0; + for (y = 0; y < bmi.bmiHeader.biHeight; y++) for (x = 0; x < bmi.bmiHeader.biWidth; x++) { @@ -743,6 +751,9 @@ { alphaValue = (GetRValue(pixel) + GetGValue(pixel) + GetBValue(pixel)) / 3; + if (alphaValue < 255) + alphaValue -= (BYTE)alphaDelta; + ((UINT32 *)bmpBits)[x + ((bmi.bmiHeader.biHeight - (y + 1)) * bmi.bmiHeader.biWidth)] = EGGetPixel(alphaValue, formatInfo.color); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-10 20:37:34
|
Revision: 1346 http://emerge.svn.sourceforge.net/emerge/?rev=1346&view=rev Author: roblarky Date: 2007-07-10 13:37:33 -0700 (Tue, 10 Jul 2007) Log Message: ----------- Added movesizeinprogress (private) for use by ShowHiddenIcons. Modified Paths: -------------- trunk/Source/emergeTray/Applet.h Modified: trunk/Source/emergeTray/Applet.h =================================================================== --- trunk/Source/emergeTray/Applet.h 2007-07-10 20:36:29 UTC (rev 1345) +++ trunk/Source/emergeTray/Applet.h 2007-07-10 20:37:33 UTC (rev 1346) @@ -242,7 +242,7 @@ std::vector<TrayIcon*> trayIconList; std::vector<IOleCommandTarget*> ssoIconList; int cursorOffsetX, cursorOffsetY; - bool mouseOver, shadow; + bool mouseOver, shadow, movesizeinprogress; HINSTANCE mainInst; HWND mainWnd, toolWnd, trayWnd, notifyWnd; HMENU mainMenu; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-10 20:36:30
|
Revision: 1345 http://emerge.svn.sourceforge.net/emerge/?rev=1345&view=rev Author: roblarky Date: 2007-07-10 13:36:29 -0700 (Tue, 10 Jul 2007) Log Message: ----------- Added code to ignore Unhiding icons if Applet is in Move or Size state. Modified Paths: -------------- trunk/Source/emergeTray/Applet.cpp Modified: trunk/Source/emergeTray/Applet.cpp =================================================================== --- trunk/Source/emergeTray/Applet.cpp 2007-07-10 01:51:52 UTC (rev 1344) +++ trunk/Source/emergeTray/Applet.cpp 2007-07-10 20:36:29 UTC (rev 1345) @@ -306,6 +306,8 @@ pAppletMenu = new AppletMenu(mainWnd, mainInst); pAppletMenu->Initialize(); + movesizeinprogress = false; + // Set the window transparency mouseOver = false; UpdateGUI(); @@ -664,11 +666,14 @@ { anchor = ELGetAnchorPoint(hwnd); + movesizeinprogress = true; + return 0; } LRESULT Applet::DoMoving(HWND hwnd, RECT *lpRect) { + if (pSettings->GetSnapMove()) { SNAPMOVEINFO smi; @@ -693,7 +698,6 @@ { SNAPSIZEINFO ssi; - if (!pSettings->GetAutoSize() && pSettings->GetSnapSize()) { ssi.AppletWindow = hwnd; @@ -714,6 +718,8 @@ int x, y; RECT deskRect; + movesizeinprogress = false; + if (GetAsyncKeyState(VK_SHIFT) & 0x8000) return 1; @@ -743,6 +749,8 @@ { int dragBorder = guiInfo.dragBorder + guiInfo.bevelWidth; + movesizeinprogress = false; + if (!IsWindowVisible(mainWnd)) return 1; @@ -952,7 +960,7 @@ { std::vector<TrayIcon*>::iterator iter; - if ((pSettings->GetUnhideIcons())|| (force)) + if (((pSettings->GetUnhideIcons())|| (force)) && (!movesizeinprogress)) { // Go through each of the elements in the trayIcons array for (iter = trayIconList.begin(); iter != trayIconList.end(); iter++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-10 01:51:53
|
Revision: 1344 http://emerge.svn.sourceforge.net/emerge/?rev=1344&view=rev Author: ir0nh34d Date: 2007-07-09 18:51:52 -0700 (Mon, 09 Jul 2007) Log Message: ----------- Remove unnecessary safety check that messed up alpha text Modified Paths: -------------- trunk/Source/emergeGraphics/main.cpp Modified: trunk/Source/emergeGraphics/main.cpp =================================================================== --- trunk/Source/emergeGraphics/main.cpp 2007-07-10 00:21:38 UTC (rev 1343) +++ trunk/Source/emergeGraphics/main.cpp 2007-07-10 01:51:52 UTC (rev 1344) @@ -743,11 +743,7 @@ { alphaValue = (GetRValue(pixel) + GetGValue(pixel) + GetBValue(pixel)) / 3; - if (alphaValue < clientInfo.bgAlpha) - alphaValue = clientInfo.bgAlpha; - - ((UINT32 *)bmpBits) - [x + ((bmi.bmiHeader.biHeight - (y + 1)) * bmi.bmiHeader.biWidth)] = + ((UINT32 *)bmpBits)[x + ((bmi.bmiHeader.biHeight - (y + 1)) * bmi.bmiHeader.biWidth)] = EGGetPixel(alphaValue, formatInfo.color); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-10 00:21:43
|
Revision: 1343 http://emerge.svn.sourceforge.net/emerge/?rev=1343&view=rev Author: roblarky Date: 2007-07-09 17:21:38 -0700 (Mon, 09 Jul 2007) Log Message: ----------- Added an additional call to SortIcons. Modified Paths: -------------- trunk/Source/emergeTray/Applet.cpp Modified: trunk/Source/emergeTray/Applet.cpp =================================================================== --- trunk/Source/emergeTray/Applet.cpp 2007-07-08 00:49:33 UTC (rev 1342) +++ trunk/Source/emergeTray/Applet.cpp 2007-07-10 00:21:38 UTC (rev 1343) @@ -693,6 +693,7 @@ { SNAPSIZEINFO ssi; + if (!pSettings->GetAutoSize() && pSettings->GetSnapSize()) { ssi.AppletWindow = hwnd; @@ -970,7 +971,12 @@ } } + // roblarky - Added call here to ensure the icons would be sorted + // even if one was modified during mouseover (unhide) + SortIcons(); + UpdateGUI(); + } } // END roblarky This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-08 00:49:35
|
Revision: 1342 http://emerge.svn.sourceforge.net/emerge/?rev=1342&view=rev Author: ir0nh34d Date: 2007-07-07 17:49:33 -0700 (Sat, 07 Jul 2007) Log Message: ----------- Added text alpha to Scheme Editor Modified Paths: -------------- trunk/Source/emergeSchemeEngine/SchemeEditor.cpp trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc trunk/Source/emergeSchemeEngine/resource.h Modified: trunk/Source/emergeSchemeEngine/SchemeEditor.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-07 22:22:53 UTC (rev 1341) +++ trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-08 00:49:33 UTC (rev 1342) @@ -150,6 +150,10 @@ SendDlgItemMessage(hwndDlg, IDC_BORDERSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)guiInfo.alphaBorder); SetDlgItemInt(hwndDlg, IDC_BORDERALPHA, guiInfo.alphaBorder, false); + SendDlgItemMessage(hwndDlg, IDC_TEXTSLIDER, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 100)); + SendDlgItemMessage(hwndDlg, IDC_TEXTSLIDER, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)guiInfo.alphaText); + SetDlgItemInt(hwndDlg, IDC_TEXTALPHA, guiInfo.alphaText, false); + hbmColourBackground = EGCreateBitmap(0xff, colourBackground, colourRect); if (hbmColourBackground) SendDlgItemMessage(hwndDlg, IDC_BACKGROUNDCOLOUR, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hbmColourBackground); @@ -475,6 +479,7 @@ guiInfo.alphaFrame = GetDlgItemInt(hwndDlg, IDC_FRAMEALPHA, NULL, FALSE); guiInfo.alphaSelected = GetDlgItemInt(hwndDlg, IDC_SELECTEDALPHA, NULL, FALSE); guiInfo.alphaBorder = GetDlgItemInt(hwndDlg, IDC_BORDERALPHA, NULL, FALSE); + guiInfo.alphaText = GetDlgItemInt(hwndDlg, IDC_TEXTALPHA, NULL, FALSE); guiInfo.colorBackground = colourBackground; guiInfo.colorForeground = colourForeground; @@ -528,6 +533,7 @@ HWND frameSliderWnd = GetDlgItem(hwndDlg, IDC_FRAMESLIDER); HWND selectedSliderWnd = GetDlgItem(hwndDlg, IDC_SELECTEDSLIDER); HWND borderSliderWnd = GetDlgItem(hwndDlg, IDC_BORDERSLIDER); + HWND textSliderWnd = GetDlgItem(hwndDlg, IDC_TEXTSLIDER); UINT sliderValue; @@ -589,6 +595,13 @@ return TRUE; } + if (nmhdr->hwndFrom == textSliderWnd) + { + sliderValue = (UINT)SendMessage(textSliderWnd, TBM_GETPOS, 0, 0); + SetDlgItemInt(hwndDlg, IDC_TEXTALPHA, sliderValue, false); + return TRUE; + } + return FALSE; } Modified: trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc =================================================================== --- trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc 2007-07-07 22:22:53 UTC (rev 1341) +++ trunk/Source/emergeSchemeEngine/emergeSchemeEngine.rc 2007-07-08 00:49:33 UTC (rev 1342) @@ -34,7 +34,7 @@ END END -IDD_SCHEMEEDITOR DIALOGEX 0,0,330,280 +IDD_SCHEMEEDITOR DIALOGEX 0,0,330,300 STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION CAPTION "Emerge Desktop Scheme Editor" FONT 8, "MS Sans Serif" @@ -44,7 +44,7 @@ LTEXT "Current Scheme:",IDC_STATIC,140,8,60,8 LTEXT "",IDC_SCHEMENAME,200,8,100,8 - GROUPBOX "Opacity Settings",IDC_STATIC,5,25,185,170,WS_GROUP + GROUPBOX "Opacity Settings",IDC_STATIC,5,25,185,190,WS_GROUP LTEXT "Active:",IDC_STATIC,10,37,30,8 CONTROL "ActiveSlider",IDC_ACTIVESLIDER,"msctls_trackbar32",TBS_NOTICKS|WS_TABSTOP,55,35,100,15 EDITTEXT IDC_ACTIVEALPHA,160,36,20,10,ES_AUTOHSCROLL @@ -69,6 +69,9 @@ LTEXT "Border:",IDC_STATIC,10,177,30,8 CONTROL "BorderSlider",IDC_BORDERSLIDER,"msctls_trackbar32",TBS_NOTICKS|WS_TABSTOP,55,175,100,15 EDITTEXT IDC_BORDERALPHA,160,176,20,10,ES_AUTOHSCROLL + LTEXT "Text:",IDC_STATIC,10,197,30,8 + CONTROL "TextSlider",IDC_TEXTSLIDER,"msctls_trackbar32",TBS_NOTICKS|WS_TABSTOP,55,195,100,15 + EDITTEXT IDC_TEXTALPHA,160,196,20,10,ES_AUTOHSCROLL GROUPBOX "Color Settings",IDC_STATIC,195,25,130,135,WS_GROUP LTEXT "Background:",IDC_STATIC,200,39,40,8 @@ -91,19 +94,19 @@ LTEXT "Border:",IDC_STATIC,275,185,30,8 EDITTEXT IDC_BORDER,305,183,20,12,ES_AUTOHSCROLL - GROUPBOX "Gradient Settings",IDC_STATIC,5,200,320,50,WS_GROUP - LTEXT "Method:",IDC_STATIC,10,215,30,8 - COMBOBOX IDC_METHOD,40,213,80,150,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP - PUSHBUTTON "Interlaced",IDC_INTERLACED,130,215,60,10,BS_AUTOCHECKBOX - CONTROL "Flat",IDC_FLAT,"Button",BS_AUTORADIOBUTTON|WS_TABSTOP,200,215,40,10 - CONTROL "Raised",IDC_RAISED,"Button",BS_AUTORADIOBUTTON|WS_TABSTOP,240,215,40,10 - CONTROL "Sunken",IDC_SUNKEN,"Button",BS_AUTORADIOBUTTON|WS_TABSTOP,280,215,40,10 - LTEXT "From Color:",IDC_STATIC,80,234,40,8 - PUSHBUTTON "",IDC_FROMCOLOUR,120,230,16,16,BS_BITMAP|BS_FLAT - LTEXT "To Color:",IDC_STATIC,185,234,40,8 - PUSHBUTTON "",IDC_TOCOLOUR,225,230,16,16,BS_BITMAP|BS_FLAT + GROUPBOX "Gradient Settings",IDC_STATIC,5,220,320,50,WS_GROUP + LTEXT "Method:",IDC_STATIC,10,235,30,8 + COMBOBOX IDC_METHOD,40,233,80,150,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP + PUSHBUTTON "Interlaced",IDC_INTERLACED,130,235,60,10,BS_AUTOCHECKBOX + CONTROL "Flat",IDC_FLAT,"Button",BS_AUTORADIOBUTTON|WS_TABSTOP,200,235,40,10 + CONTROL "Raised",IDC_RAISED,"Button",BS_AUTORADIOBUTTON|WS_TABSTOP,240,235,40,10 + CONTROL "Sunken",IDC_SUNKEN,"Button",BS_AUTORADIOBUTTON|WS_TABSTOP,280,235,40,10 + LTEXT "From Color:",IDC_STATIC,80,254,40,8 + PUSHBUTTON "",IDC_FROMCOLOUR,120,250,16,16,BS_BITMAP|BS_FLAT + LTEXT "To Color:",IDC_STATIC,185,254,40,8 + PUSHBUTTON "",IDC_TOCOLOUR,225,250,16,16,BS_BITMAP|BS_FLAT - PUSHBUTTON "Preview",IDC_PREVIEW,5,260,60,14 - PUSHBUTTON "OK",IDOK,200,260,60,14 - PUSHBUTTON "Cancel",IDCANCEL,265,260,60,14 + PUSHBUTTON "Preview",IDC_PREVIEW,5,280,60,14 + PUSHBUTTON "OK",IDOK,200,280,60,14 + PUSHBUTTON "Cancel",IDCANCEL,265,280,60,14 END Modified: trunk/Source/emergeSchemeEngine/resource.h =================================================================== --- trunk/Source/emergeSchemeEngine/resource.h 2007-07-07 22:22:53 UTC (rev 1341) +++ trunk/Source/emergeSchemeEngine/resource.h 2007-07-08 00:49:33 UTC (rev 1342) @@ -26,6 +26,8 @@ #define IDC_SELECTEDALPHA 213 #define IDC_BORDERSLIDER 214 #define IDC_BORDERALPHA 215 +#define IDC_TEXTSLIDER 216 +#define IDC_TEXTALPHA 217 #define IDC_BACKGROUNDCOLOUR 300 #define IDC_FOREGROUNDCOLOUR 301 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-07 22:22:54
|
Revision: 1341 http://emerge.svn.sourceforge.net/emerge/?rev=1341&view=rev Author: ir0nh34d Date: 2007-07-07 15:22:53 -0700 (Sat, 07 Jul 2007) Log Message: ----------- Implemented true alpha blended text Modified Paths: -------------- trunk/Source/emergeCommand/Applet.cpp trunk/Source/emergeGraphics/emergeGraphics.h trunk/Source/emergeGraphics/main.cpp trunk/Source/emergeSchemeEngine/main.cpp Modified: trunk/Source/emergeCommand/Applet.cpp =================================================================== --- trunk/Source/emergeCommand/Applet.cpp 2007-07-06 22:41:36 UTC (rev 1340) +++ trunk/Source/emergeCommand/Applet.cpp 2007-07-07 22:22:53 UTC (rev 1341) @@ -340,7 +340,7 @@ CopyRect(&clientInfo.rt, &clientrt); clientInfo.bgAlpha = guiInfo.alphaBackground; - EGDrawAlphaText(clientInfo, formatInfo, commandText); + EGDrawAlphaText(guiInfo.alphaText, clientInfo, formatInfo, commandText); bf.BlendOp = AC_SRC_OVER; bf.BlendFlags = 0; Modified: trunk/Source/emergeGraphics/emergeGraphics.h =================================================================== --- trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-06 22:41:36 UTC (rev 1340) +++ trunk/Source/emergeGraphics/emergeGraphics.h 2007-07-07 22:22:53 UTC (rev 1341) @@ -97,6 +97,7 @@ BYTE alphaFrame; BYTE alphaSelected; BYTE alphaBorder; + BYTE alphaText; COLORREF colorBackground; COLORREF colorForeground; COLORREF colorFrame; @@ -125,11 +126,12 @@ DLL_EXPORT HICON EGGetFileIcon(WCHAR *file, UINT iconSize); DLL_EXPORT HICON EGGetWindowIcon(HWND hwnd, bool smallIcon); DLL_EXPORT HICON EGGetSystemIcon(UINT iconIndex, UINT iconSize); - DLL_EXPORT bool EGDrawAlphaText(CLIENTINFO clientInfo, FORMATINFO formatInfo, WCHAR *commandText); + DLL_EXPORT bool EGDrawAlphaText(BYTE alpha, CLIENTINFO clientInfo, FORMATINFO formatInfo, WCHAR *commandText); DLL_EXPORT HDC EGBeginPaint(HWND wnd); DLL_EXPORT void EGEndPaint(); DLL_EXPORT bool EGFillRect(HDC hdc, RECT *rect, BYTE alpha, COLORREF colour); DLL_EXPORT bool EGFrameRect(HDC hdc, RECT *rect, BYTE alpha, COLORREF colour); + DLL_EXPORT UINT32 EGGetPixel(BYTE alpha, COLORREF colour); #ifdef __cplusplus } #endif Modified: trunk/Source/emergeGraphics/main.cpp =================================================================== --- trunk/Source/emergeGraphics/main.cpp 2007-07-06 22:41:36 UTC (rev 1340) +++ trunk/Source/emergeGraphics/main.cpp 2007-07-07 22:22:53 UTC (rev 1341) @@ -203,13 +203,9 @@ VOID *bits; HDC hdc; BITMAPINFO bmi; - UCHAR ubRed, ubGreen, ubBlue; - float fAlphaFactor; + UINT32 pixel; - fAlphaFactor = (float)alpha / (float)0xff; - ubRed = (UCHAR)(GetRValue(colour) * fAlphaFactor); - ubGreen = (UCHAR)(GetGValue(colour) * fAlphaFactor); - ubBlue = (UCHAR)(GetBValue(colour) * fAlphaFactor); + pixel = EGGetPixel(alpha, colour); hdc = CreateCompatibleDC(NULL); @@ -230,10 +226,7 @@ // create our DIB section and select the bitmap into the dc bmp = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0x0); ((UINT32 *)bits)[0] = - (alpha << 24) | - (ubRed << 16) | - (ubGreen << 8) | - ubBlue; + pixel; brush = CreatePatternBrush(bmp); @@ -251,13 +244,9 @@ VOID *bits; HDC hdc; BITMAPINFO bmi; - UCHAR ubRed, ubGreen, ubBlue; - float fAlphaFactor; + UINT32 pixel; - fAlphaFactor = (float)alpha / (float)0xff; - ubRed = (UCHAR)(GetRValue(colour) * fAlphaFactor); - ubGreen = (UCHAR)(GetGValue(colour) * fAlphaFactor); - ubBlue = (UCHAR)(GetBValue(colour) * fAlphaFactor); + pixel = EGGetPixel(alpha, colour); hdc = CreateCompatibleDC(NULL); @@ -278,10 +267,7 @@ // create our DIB section and select the bitmap into the dc bmp = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &bits, NULL, 0x0); ((UINT32 *)bits)[0] = - (alpha << 24) | - (ubRed << 16) | - (ubGreen << 8) | - ubBlue; + pixel; lb.lbStyle = BS_DIBPATTERN; lb.lbColor = DIB_RGB_COLORS; @@ -402,20 +388,31 @@ return (ret == TRUE); } +UINT32 EGGetPixel(BYTE alpha, COLORREF colour) +{ + UINT32 pixel; + float fAlphaFactor; + + fAlphaFactor = (float)alpha / (float)0xff; + + pixel = (alpha << 24) | + ((UCHAR)(GetRValue(colour) * fAlphaFactor) << 16) | + ((UCHAR)(GetGValue(colour) * fAlphaFactor) << 8) | + (UCHAR)(GetBValue(colour) * fAlphaFactor); + + return pixel; +} + HBITMAP EGCreateBitmap(BYTE alpha, COLORREF colour, RECT wndRect) { HBITMAP bmp; HDC hdc; VOID *bits; BITMAPINFO bmi; - UCHAR ubRed, ubGreen, ubBlue; - float fAlphaFactor; + UINT32 pixel; ULONG ulWindowWidth, ulWindowHeight, x, y; - fAlphaFactor = (float)alpha / (float)0xff; - ubRed = (UCHAR)(GetRValue(colour) * fAlphaFactor); - ubGreen = (UCHAR)(GetGValue(colour) * fAlphaFactor); - ubBlue = (UCHAR)(GetBValue(colour) * fAlphaFactor); + pixel = EGGetPixel(alpha, colour); hdc = CreateCompatibleDC(NULL); @@ -443,10 +440,7 @@ for (y = 0; y < ulWindowHeight; y++) for (x = 0; x < ulWindowWidth; x++) ((UINT32 *)bits)[x + y * ulWindowWidth] = - (alpha << 24) | - (ubRed << 16) | - (ubGreen << 8) | - ubBlue; + pixel; DeleteDC(hdc); @@ -676,10 +670,10 @@ return icon; } -bool EGDrawAlphaText(CLIENTINFO clientInfo, FORMATINFO formatInfo, WCHAR *commandText) +bool EGDrawAlphaText(BYTE alpha, CLIENTINFO clientInfo, FORMATINFO formatInfo, WCHAR *commandText) { - HDC maskdc; - HBITMAP hmask, hbitmap; + HDC maskdc, fillDC; + HBITMAP hmask, fillBMP; BITMAPINFO bmi; char *bmpBits; char *maskBits; @@ -688,7 +682,25 @@ UCHAR alphaValue; DRAWTEXTPARAMS dtp; UINT32 pixel; + BLENDFUNCTION bf; + BOOL ret; + bf.BlendOp = AC_SRC_OVER; + bf.BlendFlags = 0; + bf.SourceConstantAlpha = alpha; + bf.AlphaFormat = AC_SRC_ALPHA; + + int width = clientInfo.rt.right - clientInfo.rt.left; + int height = clientInfo.rt.bottom - clientInfo.rt.top; + + if ((width <= 0) || (height <= 0)) + return false; + + fillDC = CreateCompatibleDC(NULL); + + fillBMP = EGCreateBitmap(0x00, formatInfo.color, clientInfo.rt); + SelectObject(fillDC, fillBMP); + maskdc = CreateCompatibleDC(NULL); hmask = EGCreateBitmap(0x00, RGB(0, 0, 0), clientInfo.rt); SelectObject(maskdc, hmask); @@ -710,22 +722,15 @@ else drawFlags |= DT_LEFT; - SetBkMode(clientInfo.hdc, TRANSPARENT); - SetTextColor(clientInfo.hdc, formatInfo.color); - SelectObject(clientInfo.hdc, formatInfo.font); - DrawTextEx(clientInfo.hdc, commandText, (int)wcslen(commandText), &clientInfo.rt, drawFlags , &dtp); - SetBkMode(maskdc, TRANSPARENT); SetTextColor(maskdc, RGB(255, 255, 255)); SelectObject(maskdc, formatInfo.font); DrawTextEx(maskdc, commandText, (int)wcslen(commandText), &clientInfo.rt, drawFlags , &dtp); - hbitmap = (HBITMAP)GetCurrentObject(clientInfo.hdc, OBJ_BITMAP); - - GetDIBits(clientInfo.hdc, hbitmap, 0, clientInfo.rt.bottom, NULL, &bmi, DIB_RGB_COLORS); + GetDIBits(fillDC, fillBMP, 0, clientInfo.rt.bottom, NULL, &bmi, DIB_RGB_COLORS); bmpBits = new char[bmi.bmiHeader.biSizeImage]; maskBits = new char[bmi.bmiHeader.biSizeImage]; - GetDIBits(clientInfo.hdc, hbitmap, 0, clientInfo.rt.bottom, bmpBits, &bmi, DIB_RGB_COLORS); + GetDIBits(fillDC, fillBMP, 0, clientInfo.rt.bottom, bmpBits, &bmi, DIB_RGB_COLORS); GetDIBits(maskdc, hmask, 0, clientInfo.rt.bottom, maskBits, &bmi, DIB_RGB_COLORS); for (y = 0; y < bmi.bmiHeader.biHeight; y++) @@ -742,20 +747,23 @@ alphaValue = clientInfo.bgAlpha; ((UINT32 *)bmpBits) - [x + ((bmi.bmiHeader.biHeight - (y + 1)) * bmi.bmiHeader.biWidth)] |= - (alphaValue << 24); + [x + ((bmi.bmiHeader.biHeight - (y + 1)) * bmi.bmiHeader.biWidth)] = + EGGetPixel(alphaValue, formatInfo.color); } } - SetDIBits(clientInfo.hdc, hbitmap, 0, clientInfo.rt.bottom, bmpBits, &bmi, DIB_RGB_COLORS); + SetDIBits(fillDC, fillBMP, 0, clientInfo.rt.bottom, bmpBits, &bmi, DIB_RGB_COLORS); + ret = AlphaBlend(clientInfo.hdc, clientInfo.rt.left, clientInfo.rt.top, width, height, fillDC, 0, 0, width, height, bf); // do cleanup + DeleteObject(fillBMP); + DeleteDC(fillDC); DeleteObject(hmask); DeleteDC(maskdc); delete bmpBits; delete maskBits; - return true; + return ret = TRUE; } HDC EGBeginPaint(HWND wnd) Modified: trunk/Source/emergeSchemeEngine/main.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/main.cpp 2007-07-06 22:41:36 UTC (rev 1340) +++ trunk/Source/emergeSchemeEngine/main.cpp 2007-07-07 22:22:53 UTC (rev 1341) @@ -99,6 +99,7 @@ ELWriteFileInt(schemeFile, TEXT("alpha.frame:"), (int)guiInfo->alphaFrame); ELWriteFileInt(schemeFile, TEXT("alpha.selected:"), (int)guiInfo->alphaSelected); ELWriteFileInt(schemeFile, TEXT("alpha.border:"), (int)guiInfo->alphaBorder); + ELWriteFileInt(schemeFile, TEXT("alpha.text:"), (int)guiInfo->alphaText); ELWriteFileColor(schemeFile, TEXT("color.background:"), guiInfo->colorBackground); ELWriteFileColor(schemeFile, TEXT("color.selected:"), guiInfo->colorSelected); ELWriteFileColor(schemeFile, TEXT("color.foreground:"), guiInfo->colorForeground); @@ -124,6 +125,7 @@ ELReadFileInt(schemeFile, TEXT("alpha.frame:"), (int*)&guiInfo->alphaFrame, 100); ELReadFileInt(schemeFile, TEXT("alpha.selected:"), (int*)&guiInfo->alphaSelected, 100); ELReadFileInt(schemeFile, TEXT("alpha.border:"), (int*)&guiInfo->alphaBorder, 100); + ELReadFileInt(schemeFile, TEXT("alpha.text:"), (int*)&guiInfo->alphaText, 100); ELReadFileColor(schemeFile, TEXT("color.background:"), &guiInfo->colorBackground, GetSysColor(COLOR_BTNFACE)); ELReadFileColor(schemeFile, TEXT("color.selected:"), &guiInfo->colorSelected, @@ -219,6 +221,14 @@ tmpAlpha /= 100; guiInfo->alphaBorder = tmpAlpha; + if (guiInfo->alphaText <= 0) + guiInfo->alphaText = 1; + + tmpAlpha = guiInfo->alphaText; + tmpAlpha *= 255; + tmpAlpha /= 100; + guiInfo->alphaText = tmpAlpha; + if (!guiInfo->clickThrough) { if (guiInfo->alphaInactive < guiInfo->alphaActive) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-06 22:41:40
|
Revision: 1340 http://emerge.svn.sourceforge.net/emerge/?rev=1340&view=rev Author: ir0nh34d Date: 2007-07-06 15:41:36 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Fix for scheme not being set on "OK" Modified Paths: -------------- trunk/Source/emergeSchemeEngine/SchemeEditor.cpp Modified: trunk/Source/emergeSchemeEngine/SchemeEditor.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-06 13:43:56 UTC (rev 1339) +++ trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-06 22:41:36 UTC (rev 1340) @@ -240,7 +240,10 @@ { case IDOK: if (DoSaveScheme(hwndDlg, scheme)) - EndDialog(hwndDlg, wParam); + { + ESESetScheme(scheme); + EndDialog(hwndDlg, wParam); + } return TRUE; case IDCANCEL: ESESetScheme(origScheme); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-06 13:44:04
|
Revision: 1339 http://emerge.svn.sourceforge.net/emerge/?rev=1339&view=rev Author: ir0nh34d Date: 2007-07-06 06:43:56 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Switch to using a temporary file for Preview Modified Paths: -------------- trunk/Source/emergeCommand/AppletMenu.cpp trunk/Source/emergeLauncher/AppletMenu.cpp trunk/Source/emergeLib/main.cpp trunk/Source/emergeSchemeEngine/SchemeEditor.cpp trunk/Source/emergeSchemeEngine/SchemeEditor.h trunk/Source/emergeTasks/AppletMenu.cpp trunk/Source/emergeTray/AppletMenu.cpp trunk/Source/emergeVWM/AppletMenu.cpp Modified: trunk/Source/emergeCommand/AppletMenu.cpp =================================================================== --- trunk/Source/emergeCommand/AppletMenu.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeCommand/AppletMenu.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -175,7 +175,7 @@ case 201: wcscpy(file, ESEGetScheme()); ESEEditScheme(mainWnd, file); - pSettings->SetSchemeFile(file); + pSettings->SetSchemeFile(ESEGetScheme()); case 202: pApplet->UpdateGUI(); break; Modified: trunk/Source/emergeLauncher/AppletMenu.cpp =================================================================== --- trunk/Source/emergeLauncher/AppletMenu.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeLauncher/AppletMenu.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -171,7 +171,7 @@ case 201: wcscpy(file, ESEGetScheme()); ESEEditScheme(mainWnd, file); - pSettings->SetSchemeFile(file); + pSettings->SetSchemeFile(ESEGetScheme()); case 202: pApplet->UpdateGUI(); break; Modified: trunk/Source/emergeLib/main.cpp =================================================================== --- trunk/Source/emergeLib/main.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeLib/main.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -1807,7 +1807,7 @@ if (GetTempPath(MAX_PATH, tmpPath) != 0) { - if (GetTempFileName(tmpPath, TEXT("emerge"), 0, tmpFile) != 0) + if (GetTempFileName(tmpPath, TEXT("eds"), 0, tmpFile) != 0) { wcsncpy(fileName, tmpFile, MAX_PATH); return true; Modified: trunk/Source/emergeSchemeEngine/SchemeEditor.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeSchemeEngine/SchemeEditor.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -46,6 +46,8 @@ (*this).hInstance = hInstance; (*this).mainWnd = mainWnd; + ELGetTempFileName(tmpFile); + hbmColourBackground = NULL; hbmColourForeground = NULL; hbmColourSelected = NULL; @@ -74,11 +76,13 @@ DeleteObject(hbmColourTo); if (hbmColourBorder) DeleteObject(hbmColourBorder); + + DeleteFile(tmpFile); } int SchemeEditor::Edit(WCHAR *schemeName) { - scheme = schemeName; + wcsncpy(scheme, schemeName, MAX_PATH); wcsncpy(origScheme, scheme, MAX_PATH); ESEReadScheme(scheme, &guiInfo); @@ -235,17 +239,16 @@ switch (LOWORD(wParam)) { case IDOK: - if (DoSaveScheme(hwndDlg)) + if (DoSaveScheme(hwndDlg, scheme)) EndDialog(hwndDlg, wParam); return TRUE; case IDCANCEL: - wcsncpy(scheme, origScheme, MAX_PATH); - ESEWriteScheme(scheme, &origGuiInfo); + ESESetScheme(origScheme); EndDialog(hwndDlg, wParam); return TRUE; case IDC_SAVEAS: DoSaveAs(hwndDlg); - if (DoSaveScheme(hwndDlg)) + if (DoSaveScheme(hwndDlg, scheme)) DoInitDialog(hwndDlg, false); return TRUE; case IDC_LOAD: @@ -347,7 +350,8 @@ } return FALSE; case IDC_PREVIEW: - if (DoSaveScheme(hwndDlg)) + ESESetScheme(tmpFile); + if (DoSaveScheme(hwndDlg, tmpFile)) PostMessage(mainWnd, EMERGE_NOTIFY, EMERGE_CORE, CORE_REFRESH); return TRUE; } @@ -429,7 +433,10 @@ ofn.Flags = OFN_PATHMUSTEXIST | OFN_EXPLORER | OFN_DONTADDTORECENT | OFN_OVERWRITEPROMPT; if (GetSaveFileName(&ofn)) - wcsncpy(scheme, file, MAX_PATH); + { + wcsncpy(scheme, file, MAX_PATH); + ESESetScheme(scheme); + } } BOOL SchemeEditor::DoColourChooser(COLORREF *colour) @@ -453,7 +460,7 @@ return res; } -bool SchemeEditor::DoSaveScheme(HWND hwndDlg) +bool SchemeEditor::DoSaveScheme(HWND hwndDlg, WCHAR *fileName) { WCHAR methodString[MAX_LINE_LENGTH]; @@ -503,7 +510,7 @@ wcscpy(guiInfo.gradientMethod, methodString); - ESEWriteScheme(scheme, &guiInfo); + ESEWriteScheme(fileName, &guiInfo); return true; } Modified: trunk/Source/emergeSchemeEngine/SchemeEditor.h =================================================================== --- trunk/Source/emergeSchemeEngine/SchemeEditor.h 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeSchemeEngine/SchemeEditor.h 2007-07-06 13:43:56 UTC (rev 1339) @@ -49,17 +49,18 @@ void DoSaveAs(HWND hwndDlg); private: + WCHAR tmpFile[MAX_PATH]; RECT colourRect; COLORREF colourBackground, colourForeground, colourSelected, colourFrame, colourFont; COLORREF colourFrom, colourTo, colourBorder; HINSTANCE hInstance; HWND mainWnd, toolWnd; GUIINFO guiInfo, origGuiInfo; - WCHAR *scheme, font[MAX_PATH], origScheme[MAX_PATH]; + WCHAR scheme[MAX_PATH], font[MAX_PATH], origScheme[MAX_PATH]; HBITMAP hbmColourBackground, hbmColourForeground, hbmColourSelected, hbmColourFrame, hbmColourFont; HBITMAP hbmColourFrom, hbmColourTo, hbmColourBorder; static BOOL CALLBACK SchemeEditorDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam); - bool DoSaveScheme(HWND hwndDlg); + bool DoSaveScheme(HWND hwndDlg, WCHAR *fileName); }; #endif Modified: trunk/Source/emergeTasks/AppletMenu.cpp =================================================================== --- trunk/Source/emergeTasks/AppletMenu.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeTasks/AppletMenu.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -171,7 +171,7 @@ case 201: wcscpy(file, ESEGetScheme()); ESEEditScheme(mainWnd, file); - pSettings->SetSchemeFile(file); + pSettings->SetSchemeFile(ESEGetScheme()); case 202: pApplet->UpdateGUI(); break; Modified: trunk/Source/emergeTray/AppletMenu.cpp =================================================================== --- trunk/Source/emergeTray/AppletMenu.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeTray/AppletMenu.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -184,7 +184,7 @@ case 201: wcscpy(file, ESEGetScheme()); ESEEditScheme(mainWnd, file); - pSettings->SetSchemeFile(file); + pSettings->SetSchemeFile(ESEGetScheme()); case 202: pApplet->UpdateGUI(); break; Modified: trunk/Source/emergeVWM/AppletMenu.cpp =================================================================== --- trunk/Source/emergeVWM/AppletMenu.cpp 2007-07-06 00:55:46 UTC (rev 1338) +++ trunk/Source/emergeVWM/AppletMenu.cpp 2007-07-06 13:43:56 UTC (rev 1339) @@ -176,7 +176,7 @@ case 201: wcscpy(file, ESEGetScheme()); ESEEditScheme(mainWnd, file); - pSettings->SetSchemeFile(file); + pSettings->SetSchemeFile(ESEGetScheme()); case 202: pApplet->UpdateGUI(); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rob...@us...> - 2007-07-06 00:55:50
|
Revision: 1338 http://emerge.svn.sourceforge.net/emerge/?rev=1338&view=rev Author: roblarky Date: 2007-07-05 17:55:46 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Re-committing; seems some commented code remained in the base. Modified Paths: -------------- trunk/Source/emergeTray/Applet.cpp Modified: trunk/Source/emergeTray/Applet.cpp =================================================================== --- trunk/Source/emergeTray/Applet.cpp 2007-07-05 23:01:35 UTC (rev 1337) +++ trunk/Source/emergeTray/Applet.cpp 2007-07-06 00:55:46 UTC (rev 1338) @@ -1479,14 +1479,9 @@ return trayIconList[index]; } - +// roblarky - Used to sort the visible icons first, then the hidden ones void Applet::SortIcons() { - /* - ELReadRegString(key, TEXT("HorizontalDirection"), horizontalDirection, TEXT("right")); - ELReadRegString(key, TEXT("VerticalDirection"), verticalDirection, TEXT("down")); - ELReadRegString(key, TEXT("DirectionOrientation"), directionOrientation, TEXT("horizontal")); - */ std::vector<TrayIcon*>::iterator iter; std::vector<TrayIcon*> trayIconListTmp; @@ -1497,22 +1492,7 @@ // Traverse the valid icon vector, painting each icon for (iter = trayIconList.begin(); iter != trayIconList.end(); iter++) { - /* - if (_wcsicmp(pSettings->GetDirectionOrientation(), TEXT("horizontal")) == 0) - { - } - - if (_wcsicmp(pSettings->GetHorizontalDirection(), TEXT("left")) == 0) - { - - } - - if (_wcsicmp(pSettings->GetVerticalDirection(), TEXT("up")) == 0) - { - - } - */ if ((*iter)->GetHidden()) { trayIconListTmp.push_back((*iter)); @@ -1521,7 +1501,6 @@ trayIconListTmp.insert(trayIconListTmp.begin() + insertCount,(*iter)); insertCount++; } - } trayIconList.assign(trayIconListTmp.begin(),trayIconListTmp.end()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-05 23:01:39
|
Revision: 1337 http://emerge.svn.sourceforge.net/emerge/?rev=1337&view=rev Author: ir0nh34d Date: 2007-07-05 16:01:35 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Added ELGetTempFileName Modified Paths: -------------- trunk/Source/emergeLib/emergeLib.h trunk/Source/emergeLib/main.cpp Modified: trunk/Source/emergeLib/emergeLib.h =================================================================== --- trunk/Source/emergeLib/emergeLib.h 2007-07-05 17:04:15 UTC (rev 1336) +++ trunk/Source/emergeLib/emergeLib.h 2007-07-05 23:01:35 UTC (rev 1337) @@ -292,6 +292,7 @@ DLL_EXPORT void ELWriteDebug(WCHAR *debugText); DLL_EXPORT void ELDisplayChange(HWND hwnd); DLL_EXPORT int ELMid(int left, int right); + DLL_EXPORT bool ELGetTempFileName(WCHAR *fileName); #ifdef __cplusplus } #endif Modified: trunk/Source/emergeLib/main.cpp =================================================================== --- trunk/Source/emergeLib/main.cpp 2007-07-05 17:04:15 UTC (rev 1336) +++ trunk/Source/emergeLib/main.cpp 2007-07-05 23:01:35 UTC (rev 1337) @@ -1801,14 +1801,30 @@ return TRUE; } +bool ELGetTempFileName(WCHAR *fileName) +{ + WCHAR tmpPath[MAX_PATH], tmpFile[MAX_PATH]; + + if (GetTempPath(MAX_PATH, tmpPath) != 0) + { + if (GetTempFileName(tmpPath, TEXT("emerge"), 0, tmpFile) != 0) + { + wcsncpy(fileName, tmpFile, MAX_PATH); + return true; + } + } + + return false; +} + bool WriteValue(WCHAR *fileName, WCHAR *keyword, WCHAR *value) { WCHAR fileLine[MAX_LINE_LENGTH], *token; - WCHAR tmpFile[MAX_PATH], tmpPath[MAX_PATH]; + WCHAR tmpFile[MAX_PATH]; bool written = false; - GetTempPath(MAX_PATH, tmpPath); - GetTempFileName(tmpPath, TEXT("eds"), 0, tmpFile); + if (!ELGetTempFileName(tmpFile)) + return false; FILE *tmpFP = _wfopen(tmpFile, TEXT("w")); FILE *existingFP = _wfopen(fileName, TEXT("r")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir0...@us...> - 2007-07-05 17:04:16
|
Revision: 1336 http://emerge.svn.sourceforge.net/emerge/?rev=1336&view=rev Author: ir0nh34d Date: 2007-07-05 10:04:15 -0700 (Thu, 05 Jul 2007) Log Message: ----------- Formatted to GNU standard Modified Paths: -------------- trunk/Source/emergeSchemeEngine/main.cpp Modified: trunk/Source/emergeSchemeEngine/main.cpp =================================================================== --- trunk/Source/emergeSchemeEngine/main.cpp 2007-07-05 16:56:49 UTC (rev 1335) +++ trunk/Source/emergeSchemeEngine/main.cpp 2007-07-05 17:04:15 UTC (rev 1336) @@ -285,14 +285,14 @@ SelectObject(bgDC, bgBMP); if (paintBorder) - { - CreateBorder(bgDC, clientRect, borderColor, borderAlpha, dragBorder); + { + CreateBorder(bgDC, clientRect, borderColor, borderAlpha, dragBorder); - x += dragBorder; - y += dragBorder; - width -= 2 * dragBorder; - height -= 2 * dragBorder; - } + x += dragBorder; + y += dragBorder; + width -= 2 * dragBorder; + height -= 2 * dragBorder; + } bmi.bmiHeader.biWidth = width; bmi.bmiHeader.biHeight = height; @@ -312,10 +312,10 @@ if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("raised")) != NULL) bevelled = true; else if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("sunken")) != NULL) - { - bevelled = true; - sunken = true; - } + { + bevelled = true; + sunken = true; + } if (wcsstr(wcslwr(wcsdup(gradientMethod)), TEXT("vertical")) != NULL) vgradient(width, height, colorFrom, colorTo, (BYTE*)gradientBits, interlaced); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |