Mercurial > mplayer.hg
comparison gui/wm/ws.c @ 35655:9ea476ced9ab
Cosmetic: Change parameter names.
Additionally, move comment where it should be.
author | ib |
---|---|
date | Tue, 15 Jan 2013 12:30:08 +0000 |
parents | 59a6b817a287 |
children | f2093dc82b5f |
comparison
equal
deleted
inserted
replaced
35654:4d7f8eba65ee | 35655:9ea476ced9ab |
---|---|
520 | 520 |
521 XClassHint wsClassHint; | 521 XClassHint wsClassHint; |
522 XTextProperty wsTextProperty; | 522 XTextProperty wsTextProperty; |
523 Window LeaderWindow; | 523 Window LeaderWindow; |
524 | 524 |
525 void wsCreateWindow(wsTWindow *win, int X, int Y, int wX, int hY, int bW, int cV, unsigned char D, char *label) | 525 // ---------------------------------------------------------------------------------------------- |
526 // wsCreateWindow: create a new window on the screen. | |
527 // x,y : window position | |
528 // w,h : window size | |
529 // b : window border size | |
530 // c : mouse cursor visible | |
531 // p : properties - "decoration", visible titlebar, etc ... | |
532 // ---------------------------------------------------------------------------------------------- | |
533 void wsCreateWindow(wsTWindow *win, int x, int y, int w, int h, int b, int c, unsigned char p, char *label) | |
526 { | 534 { |
527 int depth; | 535 int depth; |
528 | 536 |
529 win->Property = D; | 537 win->Property = p; |
530 | 538 |
531 if (D & wsShowFrame) | 539 if (p & wsShowFrame) |
532 win->Decorations = True; | 540 win->Decorations = True; |
533 | 541 |
534 wsHGC = DefaultGC(wsDisplay, wsScreen); | 542 wsHGC = DefaultGC(wsDisplay, wsScreen); |
535 | 543 |
536 wsWindowPosition(win, X, Y, wX, hY); | 544 wsWindowPosition(win, x, y, w, h); |
537 | 545 |
538 win->Width = wX; | 546 win->Width = w; |
539 win->Height = hY; | 547 win->Height = h; |
540 win->OldX = win->X; | 548 win->OldX = win->X; |
541 win->OldY = win->Y; | 549 win->OldY = win->Y; |
542 win->OldWidth = win->Width; | 550 win->OldWidth = win->Width; |
543 win->OldHeight = win->Height; | 551 win->OldHeight = win->Height; |
544 | 552 |
545 /* Border size for window. */ | 553 /* Border size for window. */ |
546 win->BorderWidth = bW; | 554 win->BorderWidth = b; |
547 /* Hide Mouse Cursor */ | 555 /* Hide Mouse Cursor */ |
548 win->wsCursor = None; | 556 win->wsCursor = None; |
549 win->wsMouseEventType = cV; | 557 win->wsMouseEventType = c; |
550 win->wsCursorData[0] = 0; | 558 win->wsCursorData[0] = 0; |
551 win->wsCursorPixmap = XCreateBitmapFromData(wsDisplay, wsRootWin, win->wsCursorData, 1, 1); | 559 win->wsCursorPixmap = XCreateBitmapFromData(wsDisplay, wsRootWin, win->wsCursorData, 1, 1); |
552 | 560 |
553 if (!(cV & wsShowMouseCursor)) | 561 if (!(c & wsShowMouseCursor)) |
554 win->wsCursor = XCreatePixmapCursor(wsDisplay, win->wsCursorPixmap, win->wsCursorPixmap, &win->wsColor, &win->wsColor, 0, 0); | 562 win->wsCursor = XCreatePixmapCursor(wsDisplay, win->wsCursorPixmap, win->wsCursorPixmap, &win->wsColor, &win->wsColor, 0, 0); |
555 | 563 |
556 depth = vo_find_depth_from_visuals(wsDisplay, wsScreen, NULL); | 564 depth = vo_find_depth_from_visuals(wsDisplay, wsScreen, NULL); |
557 | 565 |
558 if (depth < 15) { | 566 if (depth < 15) { |
582 ExposureMask | PropertyChangeMask | | 590 ExposureMask | PropertyChangeMask | |
583 EnterWindowMask | LeaveWindowMask | | 591 EnterWindowMask | LeaveWindowMask | |
584 VisibilityChangeMask | | 592 VisibilityChangeMask | |
585 KeyPressMask | KeyReleaseMask; | 593 KeyPressMask | KeyReleaseMask; |
586 | 594 |
587 if ((cV & wsHandleMouseButton)) | 595 if ((c & wsHandleMouseButton)) |
588 win->WindowAttrib.event_mask |= ButtonPressMask | ButtonReleaseMask; | 596 win->WindowAttrib.event_mask |= ButtonPressMask | ButtonReleaseMask; |
589 | 597 |
590 if ((cV & wsHandleMouseMove)) | 598 if ((c & wsHandleMouseMove)) |
591 win->WindowAttrib.event_mask |= PointerMotionMask; | 599 win->WindowAttrib.event_mask |= PointerMotionMask; |
592 | 600 |
593 win->WindowAttrib.cursor = win->wsCursor; | 601 win->WindowAttrib.cursor = win->wsCursor; |
594 win->WindowAttrib.override_redirect = False; | 602 win->WindowAttrib.override_redirect = False; |
595 | 603 |
596 if (D & wsOverredirect) | 604 if (p & wsOverredirect) |
597 win->WindowAttrib.override_redirect = True; | 605 win->WindowAttrib.override_redirect = True; |
598 | 606 |
599 win->WindowMask = CWBackPixel | CWBorderPixel | | 607 win->WindowMask = CWBackPixel | CWBorderPixel | |
600 CWColormap | CWEventMask | CWCursor | | 608 CWColormap | CWEventMask | CWCursor | |
601 CWOverrideRedirect; | 609 CWOverrideRedirect; |
643 win->Visible = wsNo; | 651 win->Visible = wsNo; |
644 win->Focused = wsNo; | 652 win->Focused = wsNo; |
645 win->Mapped = wsNo; | 653 win->Mapped = wsNo; |
646 win->Rolled = wsNo; | 654 win->Rolled = wsNo; |
647 | 655 |
648 if (D & wsShowWindow) { | 656 if (p & wsShowWindow) { |
649 XMapWindow(wsDisplay, win->WindowID); | 657 XMapWindow(wsDisplay, win->WindowID); |
650 wsMapWait(win); | 658 wsMapWait(win); |
651 } | 659 } |
652 | 660 |
653 wsCreateImage(win, win->Width, win->Height); | 661 wsCreateImage(win, win->Width, win->Height); |