Mercurial > mplayer.hg
comparison Gui/win32/gui.c @ 19570:e9ea7852e803
vo_colorkey change to avoid clashes with other black windows
author | vayne |
---|---|
date | Mon, 28 Aug 2006 18:40:22 +0000 |
parents | 69b134c4caea |
children | a894b3a3d28c |
comparison
equal
deleted
inserted
replaced
19569:7ba51e3ffca6 | 19570:e9ea7852e803 |
---|---|
61 float sub_aspect; | 61 float sub_aspect; |
62 | 62 |
63 DWORD oldtime; | 63 DWORD oldtime; |
64 NOTIFYICONDATA nid; | 64 NOTIFYICONDATA nid; |
65 int console_state = 0; | 65 int console_state = 0; |
66 | |
67 static HBRUSH colorbrush = NULL; //Handle to colorkey brush | |
68 static COLORREF windowcolor = RGB(255,0,255); //Windowcolor == colorkey | |
66 | 69 |
67 void console_toggle(void) | 70 void console_toggle(void) |
68 { | 71 { |
69 if (console_state) | 72 if (console_state) |
70 { | 73 { |
601 { | 604 { |
602 PAINTSTRUCT ps; | 605 PAINTSTRUCT ps; |
603 RECT rect; | 606 RECT rect; |
604 HDC hdc = BeginPaint(hWnd, &ps); | 607 HDC hdc = BeginPaint(hWnd, &ps); |
605 HDC hMemDC = CreateCompatibleDC(hdc); | 608 HDC hMemDC = CreateCompatibleDC(hdc); |
609 HBRUSH blackbrush = (HBRUSH)GetStockObject(BLACK_BRUSH); | |
606 int width, height; | 610 int width, height; |
607 GetClientRect(hWnd, &rect); | 611 GetClientRect(hWnd, &rect); |
608 width = rect.right - rect.left; | 612 width = rect.right - rect.left; |
609 height = rect.bottom - rect.top; | 613 height = rect.bottom - rect.top; |
610 if(guiIntfStruct.Playing == 0) | 614 if(guiIntfStruct.Playing == 0) |
617 desc = gui->skin->windows[i]; | 621 desc = gui->skin->windows[i]; |
618 | 622 |
619 SelectObject(hMemDC, get_bitmap(hWnd)); | 623 SelectObject(hMemDC, get_bitmap(hWnd)); |
620 StretchBlt(hdc, 0, 0, width, height, hMemDC, 0, 0, desc->base->bitmap[0]->width, | 624 StretchBlt(hdc, 0, 0, width, height, hMemDC, 0, 0, desc->base->bitmap[0]->width, |
621 desc->base->bitmap[0]->height, SRCCOPY); | 625 desc->base->bitmap[0]->height, SRCCOPY); |
626 } else { | |
627 FillRect(GetDC(hWnd), &rect, fullscreen?blackbrush:colorbrush); | |
622 } | 628 } |
623 DeleteDC(hMemDC); | 629 DeleteDC(hMemDC); |
624 EndPaint(hWnd, &ps); | 630 EndPaint(hWnd, &ps); |
625 return 0; | 631 return 0; |
626 } | 632 } |
1331 HDC hdc = NULL; | 1337 HDC hdc = NULL; |
1332 BITMAPINFO binfo; | 1338 BITMAPINFO binfo; |
1333 window_priv_t *priv = NULL; | 1339 window_priv_t *priv = NULL; |
1334 window *desc = NULL; | 1340 window *desc = NULL; |
1335 int i, x = -1, y = -1; | 1341 int i, x = -1, y = -1; |
1336 vo_colorkey = 0xff000000; | 1342 vo_colorkey = 0xff00ff; |
1337 | 1343 |
1338 for (i=0; i<gui->skin->windowcount; i++) | 1344 for (i=0; i<gui->skin->windowcount; i++) |
1339 if(gui->skin->windows[i]->type == wiSub) | 1345 if(gui->skin->windows[i]->type == wiSub) |
1340 desc = gui->skin->windows[i]; | 1346 desc = gui->skin->windows[i]; |
1341 | 1347 |
1343 { | 1349 { |
1344 mp_msg(MSGT_GPLAYER, MSGL_FATAL, "[GUI] Invalid skin description\n"); | 1350 mp_msg(MSGT_GPLAYER, MSGL_FATAL, "[GUI] Invalid skin description\n"); |
1345 return 1; | 1351 return 1; |
1346 } | 1352 } |
1347 | 1353 |
1354 windowcolor = vo_colorkey; | |
1355 colorbrush = CreateSolidBrush(windowcolor); | |
1348 wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; | 1356 wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; |
1349 wc.lpfnWndProc = SubProc; | 1357 wc.lpfnWndProc = SubProc; |
1350 wc.cbClsExtra = 0; | 1358 wc.cbClsExtra = 0; |
1351 wc.cbWndExtra = 0; | 1359 wc.cbWndExtra = 0; |
1352 wc.hInstance = instance; | 1360 wc.hInstance = instance; |
1353 wc.hCursor = LoadCursor(NULL, IDC_ARROW); | 1361 wc.hCursor = LoadCursor(NULL, IDC_ARROW); |
1354 wc.hIcon = gui->icon; | 1362 wc.hIcon = gui->icon; |
1355 wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); | 1363 wc.hbrBackground = NULL; //WM_PAINT will handle background color switching; |
1356 wc.lpszClassName = "MPlayer Sub for Windows"; | 1364 wc.lpszClassName = "MPlayer Sub for Windows"; |
1357 wc.lpszMenuName = NULL; | 1365 wc.lpszMenuName = NULL; |
1358 RegisterClass(&wc); | 1366 RegisterClass(&wc); |
1359 | 1367 |
1360 /* create the sub window menu */ | 1368 /* create the sub window menu */ |