|
Blender V5.3
|
#include <GHOST_WindowWin32.hh>
Inherits GHOST_Window.
Public Attributes | |
| bool | mouse_present_ |
| bool | in_live_resize_ |
GHOST window on MS Windows OSs.
Definition at line 54 of file GHOST_WindowWin32.hh.
| GHOST_WindowWin32::GHOST_WindowWin32 | ( | GHOST_SystemWin32 * | system, |
| const char * | title, | ||
| int32_t | left, | ||
| int32_t | top, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| GHOST_TWindowState | state, | ||
| GHOST_TDrawingContextType | type, | ||
| const GHOST_ContextParams & | context_params, | ||
| GHOST_WindowWin32 * | parent_window, | ||
| bool | dialog, | ||
| const GHOST_GPUDevice & | preferred_device ) |
Constructor. Creates a new window and opens it. To check if the window was created properly, use the getValid() method.
| title | The text shown in the title bar of the window. |
| left | The coordinate of the left edge of the window. |
| top | The coordinate of the top edge of the window. |
| width | The width the window. |
| height | The height the window. |
| state | The state the window is initially opened with. |
| type | The type of drawing context installed in this window. |
| context_params | Context parameters such as stereo visual for quad buffered stereo. |
| parent_window | TODO. |
| preferred_device | Preferred device to use when new device will be created. |
Definition at line 54 of file GHOST_WindowWin32.cc.
References adjustWindowRectForClosestMonitor(), alloc_utf16_from_8(), blender::BLI_getenv(), CLSID_TaskbarList, GHOST_DirectManipulationHelper::create(), getDPIHint(), GHOST_System::getTabletAPI(), GHOST_DropTargetWin32::GHOST_DropTargetWin32(), GHOST_kTabletWinPointer, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_Window::GHOST_Window(), GHOST_WindowWin32(), in_live_resize_, loadWintab(), lostMouseCapture(), mouse_present_, GHOST_Window::setDrawingContextType(), state, ThemeRefresh(), and updateHDRInfo().
Referenced by GHOST_SystemWin32::createWindow(), GHOST_WindowWin32(), and ~GHOST_WindowWin32().
| GHOST_WindowWin32::~GHOST_WindowWin32 | ( | ) |
Destructor. Closes the window and disposes resources allocated.
Definition at line 258 of file GHOST_WindowWin32.cc.
References closeWintab(), GHOST_WindowWin32(), GHOST_Window::releaseNativeHandles(), and TBPF_NOPROGRESS.
| void GHOST_WindowWin32::adjustWindowRectForClosestMonitor | ( | LPRECT | win_rect, |
| DWORD | dwStyle, | ||
| DWORD | dwExStyle ) |
Adjusts a requested window rect to fit and position correctly in monitor.
| win_rect | pointer to rectangle that will be modified. |
| dwStyle | The Window Style of the window whose required size is to be calculated. |
| dwExStyle | The Extended Window Style of the window. |
Definition at line 314 of file GHOST_WindowWin32.cc.
Referenced by GHOST_WindowWin32().
|
overridevirtual |
Apply the window decoration style using the current flags and settings.
Reimplemented from GHOST_Window.
Definition at line 392 of file GHOST_WindowWin32.cc.
References GHOST_WindowDecorationStyleSettings::colored_titlebar_bg_color, GHOST_kDecorationColoredTitleBar, GHOST_kFailure, GHOST_kSuccess, GHOST_Window::window_decoration_style_flags_, and GHOST_Window::window_decoration_style_settings_.
|
overridevirtual |
Converts a point in client rectangle coordinates to screen coordinates.
| inX | The x-coordinate in the client rectangle. |
| inY | The y-coordinate in the client rectangle. |
| outX | The x-coordinate on the screen. |
| outY | The y-coordinate on the screen. |
Implements GHOST_IWindow.
Definition at line 528 of file GHOST_WindowWin32.cc.
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::closeWintab | ( | ) |
Closes Wintab for the window.
Definition at line 978 of file GHOST_WindowWin32.cc.
References WINTAB_PRINTF.
Referenced by GHOST_SystemWin32::setTabletAPI(), and ~GHOST_WindowWin32().
|
overridevirtual |
Hides the progress bar in the icon
Reimplemented from GHOST_Window.
Definition at line 1206 of file GHOST_WindowWin32.cc.
References GHOST_kFailure, GHOST_kSuccess, and TBPF_NOPROGRESS.
|
overridevirtual |
Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.
| bounds | The bounding rectangle of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 419 of file GHOST_WindowWin32.cc.
References GHOST_Rect::b_, GHOST_Rect::l_, GHOST_Rect::r_, and GHOST_Rect::t_.
Referenced by loadWintab(), GHOST_SystemWin32::processCursorEvent(), setClientHeight(), setClientSize(), and setClientWidth().
|
overridevirtual |
Returns the recommended DPI for this window.
Reimplemented from GHOST_Window.
Definition at line 1041 of file GHOST_WindowWin32.cc.
Referenced by GHOST_WindowWin32(), and updateDPI().
| HWND GHOST_WindowWin32::getHWND | ( | ) | const |
Access to the handle of the window.
Definition at line 364 of file GHOST_WindowWin32.cc.
Referenced by GHOST_DropTargetWin32::GHOST_DropTargetWin32(), GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processWintabEvent(), and GHOST_SystemWin32::s_wndProc().
|
overridevirtual |
Returns the handle of the window.
Reimplemented from GHOST_Window.
Definition at line 369 of file GHOST_WindowWin32.cc.
| GHOST_TSuccess GHOST_WindowWin32::getPointerInfo | ( | std::vector< GHOST_PointerInfoWin32 > & | outPointerInfo, |
| WPARAM | wParam, | ||
| LPARAM | lParam ) |
Translate WM_POINTER events into GHOST_PointerInfoWin32 structs.
| outPointerInfo | Storage to return resulting GHOST_PointerInfoWin32 structs. |
| wParam | WPARAM of the event. |
| lParam | LPARAM of the event. |
Definition at line 855 of file GHOST_WindowWin32.cc.
References GET_POINTERID_WPARAM, GHOST_ISystem::getSystem(), GHOST_kButtonMaskButton4, GHOST_kButtonMaskButton5, GHOST_kButtonMaskLeft, GHOST_kButtonMaskMiddle, GHOST_kButtonMaskRight, GHOST_kFailure, GHOST_kSuccess, GHOST_kTabletModeEraser, GHOST_kTabletModeStylus, and GHOST_SystemWin32::performanceCounterToMillis().
Referenced by GHOST_SystemWin32::processPointerEvent().
| HCURSOR GHOST_WindowWin32::getStandardCursor | ( | GHOST_TStandardCursor | shape | ) | const |
Loads the windows equivalent of a standard GHOST cursor.
Definition at line 719 of file GHOST_WindowWin32.cc.
References GHOST_kStandardCursorBottomLeftCorner, GHOST_kStandardCursorBottomRightCorner, GHOST_kStandardCursorCustom, GHOST_kStandardCursorDefault, GHOST_kStandardCursorHelp, GHOST_kStandardCursorMove, GHOST_kStandardCursorText, GHOST_kStandardCursorTopLeftCorner, GHOST_kStandardCursorTopRightCorner, GHOST_kStandardCursorTopSide, and GHOST_kStandardCursorWait.
Referenced by loadCursor().
|
overridevirtual |
Returns the state of the window (normal, minimized, maximized).
Implements GHOST_IWindow.
Definition at line 505 of file GHOST_WindowWin32.cc.
References GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, and GHOST_kWindowStateNormal.
Referenced by GHOST_SystemWin32::s_wndProc(), setOrder(), setState(), and GHOST_SystemWin32::setTabletAPI().
| GHOST_TabletData GHOST_WindowWin32::getTabletData | ( | ) |
Get the most recent Windows Pointer tablet data.
Definition at line 1003 of file GHOST_WindowWin32.cc.
References GHOST_kTabletWintab, and usingTabletAPI().
Referenced by GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processCursorEvent(), and GHOST_SystemWin32::s_wndProc().
|
overridevirtual |
Returns the title displayed in the title bar.
Implements GHOST_IWindow.
Definition at line 381 of file GHOST_WindowWin32.cc.
References conv_utf_16_to_8(), count_utf_8_from_16(), and L.
| GHOST_TTrackpadInfo GHOST_WindowWin32::getTrackpadInfo | ( | ) |
Definition at line 249 of file GHOST_WindowWin32.cc.
Referenced by GHOST_SystemWin32::processTrackpad().
|
overridevirtual |
Returns indication as to whether the window is valid.
Reimplemented from GHOST_Window.
Definition at line 359 of file GHOST_WindowWin32.cc.
References GHOST_Window::getValid().
Referenced by GHOST_SystemWin32::createWindow().
|
overridevirtual |
Returns the window rectangle dimensions. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
| bounds | The bounding rectangle of the window. |
Implements GHOST_IWindow.
Definition at line 409 of file GHOST_WindowWin32.cc.
References GHOST_Rect::b_, GHOST_Rect::l_, GHOST_Rect::r_, and GHOST_Rect::t_.
Referenced by setClientHeight(), setClientSize(), and setClientWidth().
| GHOST_Wintab * GHOST_WindowWin32::getWintab | ( | ) | const |
Retrieves pointer to Wintab if Wintab is the set Tablet API.
Definition at line 949 of file GHOST_WindowWin32.cc.
Referenced by GHOST_SystemWin32::processWintabEvent(), and GHOST_SystemWin32::s_wndProc().
|
overridevirtual |
Invalidates the contents of this window.
Implements GHOST_IWindow.
Definition at line 610 of file GHOST_WindowWin32.cc.
References GHOST_kFailure, and GHOST_kSuccess.
|
overridevirtual |
Reimplemented from GHOST_Window.
Definition at line 685 of file GHOST_WindowWin32.cc.
| void GHOST_WindowWin32::loadCursor | ( | bool | visible, |
| GHOST_TStandardCursor | cursor_shape ) const |
Definition at line 775 of file GHOST_WindowWin32.cc.
References getStandardCursor(), and GHOST_kStandardCursorDefault.
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::loadWintab | ( | bool | enable | ) |
Loads Wintab context for the window.
| enable | True if Wintab should be enabled after loading. Wintab should not be enabled if the window is minimized. |
Definition at line 954 of file GHOST_WindowWin32.cc.
References getClientBounds(), GHOST_Rect::isInside(), GHOST_Wintab::loadWintab(), WINTAB_PRINTF, x, and y.
Referenced by GHOST_WindowWin32(), and GHOST_SystemWin32::setTabletAPI().
| void GHOST_WindowWin32::lostMouseCapture | ( | ) |
Inform the window that it has lost mouse capture, called in response to native window system messages (WA_INACTIVE, WM_CAPTURECHANGED) or if ReleaseCapture() is explicitly called (for new window creation).
Definition at line 676 of file GHOST_WindowWin32.cc.
Referenced by GHOST_WindowWin32(), and GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::onPointerHitTest | ( | WPARAM | wParam | ) |
Handle DM_POINTERHITTEST events.
| wParam | wParam from the event. |
Definition at line 234 of file GHOST_WindowWin32.cc.
References GET_POINTERID_WPARAM.
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::resetPointerPenInfo | ( | ) |
Resets pointer pen tablet state.
Definition at line 944 of file GHOST_WindowWin32.cc.
Referenced by GHOST_SystemWin32::s_wndProc(), and GHOST_SystemWin32::setTabletAPI().
|
overridevirtual |
Converts a point in screen coordinates to client rectangle coordinates
| inX | The x-coordinate on the screen. |
| inY | The y-coordinate on the screen. |
| outX | The x-coordinate in the client rectangle. |
| outY | The y-coordinate in the client rectangle. |
Implements GHOST_IWindow.
Definition at line 517 of file GHOST_WindowWin32.cc.
|
overridevirtual |
Resizes client rectangle height.
| height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 467 of file GHOST_WindowWin32.cc.
References getClientBounds(), GHOST_Rect::getHeight(), GHOST_Rect::getWidth(), getWindowBounds(), GHOST_kFailure, and GHOST_kSuccess.
|
overridevirtual |
Resizes client rectangle.
| width | The new width of the client area of the window. |
| height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 486 of file GHOST_WindowWin32.cc.
References getClientBounds(), GHOST_Rect::getHeight(), GHOST_Rect::getWidth(), getWindowBounds(), GHOST_kFailure, and GHOST_kSuccess.
|
overridevirtual |
Resizes client rectangle width.
| width | The new width of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 448 of file GHOST_WindowWin32.cc.
References getClientBounds(), GHOST_Rect::getHeight(), GHOST_Rect::getWidth(), getWindowBounds(), GHOST_kFailure, and GHOST_kSuccess.
|
overridevirtual |
Sets the order of the window (bottom, top).
| order | The order of the window. |
Implements GHOST_IWindow.
Definition at line 582 of file GHOST_WindowWin32.cc.
References getState(), GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowOrderBottom, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, and setState().
|
overridevirtual |
Sets the progress bar value displayed in the window/application icon
| progress | The progress percentage (0.0 to 1.0). |
Reimplemented from GHOST_Window.
Definition at line 1196 of file GHOST_WindowWin32.cc.
References GHOST_kFailure, and GHOST_kSuccess.
|
overridevirtual |
Sets the state of the window (normal, minimized, maximized).
| state | The state of the window. |
Implements GHOST_IWindow.
Definition at line 539 of file GHOST_WindowWin32.cc.
References getState(), GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, and state.
Referenced by GHOST_SystemWin32::s_wndProc(), and setOrder().
|
overridevirtual |
Sets the title displayed in the title bar.
| title | The title to display in the title bar. |
Implements GHOST_IWindow.
Definition at line 374 of file GHOST_WindowWin32.cc.
References alloc_utf16_from_8().
| void GHOST_WindowWin32::ThemeRefresh | ( | ) |
Called when OS colors change and when the window is created.
Definition at line 1013 of file GHOST_WindowWin32.cc.
References L.
Referenced by GHOST_WindowWin32(), and GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::updateDirectManipulation | ( | ) |
Drive DirectManipulation context.
Definition at line 225 of file GHOST_WindowWin32.cc.
Referenced by GHOST_SystemWin32::driveTrackpad().
| void GHOST_WindowWin32::updateDPI | ( | ) |
Definition at line 1034 of file GHOST_WindowWin32.cc.
References getDPIHint().
Referenced by GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::updateHDRInfo | ( | ) |
Update HDR info on initialization and window changes.
Definition at line 1282 of file GHOST_WindowWin32.cc.
References GHOST_WINDOW_HDR_INFO_NONE, GHOST_WindowHDRInfo::hdr_enabled, GHOST_Window::hdr_info_, GHOST_WindowHDRInfo::sdr_white_level, and GHOST_WindowHDRInfo::wide_gamut_enabled.
Referenced by GHOST_WindowWin32(), GHOST_SystemWin32::processWindowSizeEvent(), and GHOST_SystemWin32::s_wndProc().
| void GHOST_WindowWin32::updateMouseCapture | ( | GHOST_MouseCaptureEventWin32 | event | ) |
Set or Release mouse capture (should be called for any real button press).
| event | Whether mouse was pressed and released, or an operator grabbed or ungrabbed the mouse. |
Definition at line 690 of file GHOST_WindowWin32.cc.
References MousePressed, MouseReleased, OperatorGrab, and OperatorUngrab.
Referenced by GHOST_SystemWin32::processButtonEvent(), GHOST_SystemWin32::processPointerEvent(), and GHOST_SystemWin32::processWintabEvent().
| bool GHOST_WindowWin32::usingTabletAPI | ( | GHOST_TTabletAPI | api | ) | const |
Query whether given tablet API should be used.
| api | Tablet API to test. |
Definition at line 985 of file GHOST_WindowWin32.cc.
References GHOST_kTabletAutomatic, GHOST_kTabletWinPointer, and GHOST_kTabletWintab.
Referenced by getTabletData(), GHOST_SystemWin32::processPointerEvent(), GHOST_SystemWin32::s_wndProc(), and GHOST_SystemWin32::setTabletAPI().
| bool GHOST_WindowWin32::in_live_resize_ |
True if the window currently resizing.
Definition at line 298 of file GHOST_WindowWin32.hh.
Referenced by GHOST_WindowWin32(), GHOST_SystemWin32::processWindowSizeEvent(), and GHOST_SystemWin32::s_wndProc().
| bool GHOST_WindowWin32::mouse_present_ |
True if the mouse is either over or captured by the window.
Definition at line 295 of file GHOST_WindowWin32.hh.
Referenced by GHOST_WindowWin32(), and GHOST_SystemWin32::s_wndProc().