Respect BL_FLUSH and BL_RESET indications to mswin_status_update.
This commit is contained in:
+9
-12
@@ -298,13 +298,7 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
FillRect(hdc, &clear_rect, status_bg_brush);
|
FillRect(hdc, &clear_rect, status_bg_brush);
|
||||||
|
|
||||||
// TODO: Put it around for loop instead -- temporary to get a better diff
|
if (data->status_lines != NULL) {
|
||||||
if (data->status_lines == NULL) {
|
|
||||||
BitBlt(front_buffer_hdc, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
|
|
||||||
|
|
||||||
EndPaint(hWnd, &ps);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->has_blink_fields = FALSE;
|
data->has_blink_fields = FALSE;
|
||||||
|
|
||||||
@@ -362,9 +356,9 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
float redReduction = 0.5f;
|
float redReduction = 0.5f;
|
||||||
float greenReduction = 0.5f;
|
float greenReduction = 0.5f;
|
||||||
float blueReduction = 0.25f;
|
float blueReduction = 0.25f;
|
||||||
uchar red = (uchar) (GetRValue(nFg) * (1.0f - redReduction));
|
uchar red = (uchar)(GetRValue(nFg) * (1.0f - redReduction));
|
||||||
uchar green = (uchar) (GetGValue(nFg) * (1.0f - greenReduction));
|
uchar green = (uchar)(GetGValue(nFg) * (1.0f - greenReduction));
|
||||||
uchar blue = (uchar) (GetBValue(nFg) * (1.0f - blueReduction));
|
uchar blue = (uchar)(GetBValue(nFg) * (1.0f - blueReduction));
|
||||||
nFg = RGB(red, green, blue);
|
nFg = RGB(red, green, blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,7 +420,8 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
DrawTextA(hdc, str, vlen, &barrect, DT_LEFT);
|
DrawTextA(hdc, str, vlen, &barrect, DT_LEFT);
|
||||||
}
|
}
|
||||||
DeleteObject(back_brush);
|
DeleteObject(back_brush);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (atr & HL_INVERSE) {
|
if (atr & HL_INVERSE) {
|
||||||
COLORREF tmp = nFg;
|
COLORREF tmp = nFg;
|
||||||
nFg = nBg;
|
nFg = nBg;
|
||||||
@@ -445,7 +440,8 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
/* draw */
|
/* draw */
|
||||||
DrawTextW(hdc, wbuf, vlen, &rt, DT_LEFT);
|
DrawTextW(hdc, wbuf, vlen, &rt, DT_LEFT);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
/* get bounding rectangle */
|
/* get bounding rectangle */
|
||||||
GetTextExtentPoint32A(hdc, str, vlen, &sz);
|
GetTextExtentPoint32A(hdc, str, vlen, &sz);
|
||||||
|
|
||||||
@@ -462,6 +458,7 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
rt.left = left;
|
rt.left = left;
|
||||||
rt.top += cy;
|
rt.top += cy;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BitBlt(front_buffer_hdc, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
|
BitBlt(front_buffer_hdc, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
|
||||||
|
|
||||||
|
|||||||
+5
-14
@@ -3015,18 +3015,6 @@ mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color,
|
|||||||
|
|
||||||
logDebug("mswin_status_update(%d, %p, %d, %d, %x, %p)\n", idx, ptr, chg, percent, color, condmasks);
|
logDebug("mswin_status_update(%d, %p, %d, %d, %x, %p)\n", idx, ptr, chg, percent, color, condmasks);
|
||||||
|
|
||||||
#if 0 // TODO: this code was dead ... do we need to respond to these updates?
|
|
||||||
switch (idx) {
|
|
||||||
case BL_RESET:
|
|
||||||
reset_state = TRUE;
|
|
||||||
/* FALLTHRU */
|
|
||||||
case BL_FLUSH:
|
|
||||||
/* FALLTHRU */
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
|
|
||||||
nhassert(idx <= SIZE(_status_fields));
|
nhassert(idx <= SIZE(_status_fields));
|
||||||
@@ -3101,11 +3089,14 @@ mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send command to status window */
|
}
|
||||||
|
|
||||||
|
if (idx == BL_FLUSH || idx == BL_RESET) {
|
||||||
|
/* send command to status window to update */
|
||||||
ZeroMemory(&update_cmd_data, sizeof(update_cmd_data));
|
ZeroMemory(&update_cmd_data, sizeof(update_cmd_data));
|
||||||
update_cmd_data.status_lines = &_status_lines;
|
update_cmd_data.status_lines = &_status_lines;
|
||||||
SendMessage(mswin_hwnd_from_winid(WIN_STATUS), WM_MSNH_COMMAND,
|
SendMessage(mswin_hwnd_from_winid(WIN_STATUS), WM_MSNH_COMMAND,
|
||||||
(WPARAM) MSNH_MSG_UPDATE_STATUS, (LPARAM) &update_cmd_data);
|
(WPARAM)MSNH_MSG_UPDATE_STATUS, (LPARAM)&update_cmd_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user