| 278 | } |
| 279 | |
| 280 | static LRESULT |
| 281 | onWMPaint(HWND hWnd, WPARAM wParam UNUSED, LPARAM lParam UNUSED) |
| 282 | { |
| 283 | SIZE sz; |
| 284 | WCHAR wbuf[BUFSZ]; |
| 285 | RECT rt; |
| 286 | PAINTSTRUCT ps; |
| 287 | PNHStatusWindow data; |
| 288 | int width, height; |
| 289 | RECT clear_rect; |
| 290 | HDC front_buffer_hdc; |
| 291 | |
| 292 | data = (PNHStatusWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA); |
| 293 | |
| 294 | front_buffer_hdc = BeginPaint(hWnd, &ps); |
| 295 | GetClientRect(hWnd, &rt); |
| 296 | |
| 297 | width = rt.right - rt.left; |
| 298 | height = rt.bottom - rt.top; |
| 299 | |
| 300 | back_buffer_size(&data->back_buffer, width, height); |
| 301 | |
| 302 | HDC hdc = data->back_buffer.hdc; |
| 303 | |
| 304 | SetBkColor(hdc, status_bg_color); |
| 305 | SetTextColor(hdc, status_fg_color); |
| 306 | |
| 307 | clear_rect.left = 0; |
| 308 | clear_rect.top = 0; |
| 309 | clear_rect.right = width; |
| 310 | clear_rect.bottom = height; |
| 311 | |
| 312 | FillRect(hdc, &clear_rect, status_bg_brush); |
| 313 | |
| 314 | if (data->status_lines != NULL) { |
| 315 | |
| 316 | data->has_blink_fields = FALSE; |
| 317 | |
| 318 | for (int line = 0; line < NHSW_LINES; line++) { |
| 319 | LONG left = rt.left; |
| 320 | LONG cy = 0; |
| 321 | int vlen; |
| 322 | |
| 323 | mswin_status_line * status_line = &data->status_lines->lines[line]; |
| 324 | |
| 325 | for (int i = 0; i < status_line->status_strings.count; i++) { |
| 326 | mswin_status_string * status_string = status_line->status_strings.status_strings[i]; |
| 327 | int clr, atr; |
| 328 | int fntatr = ATR_NONE; |
| 329 | COLORREF nFg, nBg; |
| 330 | |
| 331 | if (status_string->str == NULL || status_string->str[0] == '\0') |
| 332 | continue; |
| 333 | |
| 334 | clr = status_string->color; |
| 335 | atr = status_string->attribute; |
| 336 | |
| 337 | const char *str = status_string->str; |
no test coverage detected