Blender  V2.93
Public Member Functions | Public Attributes | List of all members
GHOST_WindowWin32 Class Reference

#include <GHOST_WindowWin32.h>

Inherits GHOST_Window.

Public Member Functions

 GHOST_WindowWin32 (GHOST_SystemWin32 *system, const char *title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, GHOST_TDrawingContextType type=GHOST_kDrawingContextTypeNone, bool wantStereoVisual=false, bool alphaBackground=false, GHOST_WindowWin32 *parentWindow=0, bool is_debug=false, bool dialog=false)
 
 ~GHOST_WindowWin32 ()
 
bool getValid () const
 
HWND getHWND () const
 
void setTitle (const char *title)
 
std::string getTitle () const
 
void getWindowBounds (GHOST_Rect &bounds) const
 
void getClientBounds (GHOST_Rect &bounds) const
 
GHOST_TSuccess setClientWidth (GHOST_TUns32 width)
 
GHOST_TSuccess setClientHeight (GHOST_TUns32 height)
 
GHOST_TSuccess setClientSize (GHOST_TUns32 width, GHOST_TUns32 height)
 
GHOST_TWindowState getState () const
 
void screenToClient (GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const
 
void clientToScreen (GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32 &outX, GHOST_TInt32 &outY) const
 
GHOST_TSuccess setState (GHOST_TWindowState state)
 
GHOST_TSuccess setOrder (GHOST_TWindowOrder order)
 
GHOST_TSuccess invalidate ()
 
GHOST_TSuccess setProgressBar (float progress)
 
GHOST_TSuccess endProgressBar ()
 
void updateMouseCapture (GHOST_MouseCaptureEventWin32 event)
 
void lostMouseCapture ()
 
bool isDialog () const
 
HCURSOR getStandardCursor (GHOST_TStandardCursor shape) const
 
void loadCursor (bool visible, GHOST_TStandardCursor cursorShape) const
 
const GHOST_TabletDatagetTabletData ()
 
bool useTabletAPI (GHOST_TTabletAPI api) const
 
GHOST_TSuccess getPointerInfo (std::vector< GHOST_PointerInfoWin32 > &outPointerInfo, WPARAM wParam, LPARAM lParam)
 
void processWin32TabletActivateEvent (WORD state)
 
void processWin32TabletInitEvent ()
 
void processWin32TabletEvent (WPARAM wParam, LPARAM lParam)
 
void bringTabletContextToFront ()
 
GHOST_TSuccess beginFullScreen () const
 
GHOST_TSuccess endFullScreen () const
 
GHOST_TUns16 getDPIHint () override
 
- Public Member Functions inherited from GHOST_Window
 GHOST_Window (GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, const bool wantStereoVisual=false, const bool exclusive=false)
 
virtual ~GHOST_Window ()
 
virtual void * getOSWindow () const
 
GHOST_TStandardCursor getCursorShape () const
 
GHOST_TSuccess setCursorShape (GHOST_TStandardCursor cursorShape)
 
GHOST_TSuccess setCustomCursorShape (GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, bool canInvertColor)
 
bool getCursorVisibility () const
 
GHOST_TGrabCursorMode getCursorGrabMode () const
 
bool getCursorGrabModeIsWarp () const
 
GHOST_TAxisFlag getCursorGrabAxis () const
 
void getCursorGrabInitPos (GHOST_TInt32 &x, GHOST_TInt32 &y) const
 
void getCursorGrabAccum (GHOST_TInt32 &x, GHOST_TInt32 &y) const
 
void setCursorGrabAccum (GHOST_TInt32 x, GHOST_TInt32 y)
 
GHOST_TSuccess setCursorVisibility (bool visible)
 
GHOST_TSuccess setCursorGrab (GHOST_TGrabCursorMode mode, GHOST_TAxisFlag wrap_axis, GHOST_Rect *bounds, GHOST_TInt32 mouse_ungrab_xy[2])
 
GHOST_TSuccess getCursorGrabBounds (GHOST_Rect &bounds)
 
GHOST_TSuccess setSwapInterval (int interval)
 
GHOST_TSuccess getSwapInterval (int &intervalOut)
 
void setAcceptDragOperation (bool canAccept)
 
bool canAcceptDragOperation () const
 
virtual GHOST_TSuccess setModifiedState (bool isUnsavedChanges)
 
virtual bool getModifiedState ()
 
GHOST_TDrawingContextType getDrawingContextType ()
 
GHOST_TSuccess setDrawingContextType (GHOST_TDrawingContextType type)
 
virtual GHOST_TSuccess swapBuffers ()
 
virtual GHOST_TSuccess activateDrawingContext ()
 
GHOST_TSuccess updateDrawingContext ()
 
virtual unsigned int getDefaultFramebuffer ()
 
GHOST_TUserDataPtr getUserData () const
 
void setUserData (const GHOST_TUserDataPtr userData)
 
float getNativePixelSize (void)
 
- Public Member Functions inherited from GHOST_IWindow
virtual ~GHOST_IWindow ()
 

Public Attributes

bool m_tabletInRange
 
bool m_inLiveResize
 
HMODULE handle = NULL
 
GHOST_WIN32_WTInfo info
 
GHOST_WIN32_WTOpen open
 
GHOST_WIN32_WTClose close
 
GHOST_WIN32_WTPacket packet
 
GHOST_WIN32_WTEnable enable
 
GHOST_WIN32_WTOverlap overlap
 
HCTX tablet
 
LONG maxPressure
 
LONG maxAzimuth
 
LONG maxAltitude
 

Additional Inherited Members

- Protected Member Functions inherited from GHOST_Window
GHOST_TSuccess releaseNativeHandles ()
 
- Protected Attributes inherited from GHOST_Window
GHOST_TDrawingContextType m_drawingContextType
 
GHOST_TUserDataPtr m_userData
 
bool m_cursorVisible
 
GHOST_TGrabCursorMode m_cursorGrab
 
GHOST_TAxisFlag m_cursorGrabAxis
 
GHOST_TInt32 m_cursorGrabInitPos [2]
 
GHOST_TInt32 m_cursorGrabAccumPos [2]
 
GHOST_Rect m_cursorGrabBounds
 
GHOST_TStandardCursor m_cursorShape
 
bool m_progressBarVisible
 
bool m_canAcceptDragOperation
 
bool m_isUnsavedChanges
 
bool m_fullScreen
 
bool m_wantStereoVisual
 
GHOST_TUns32 m_fullScreenWidth
 
GHOST_TUns32 m_fullScreenHeight
 
float m_nativePixelSize
 

Detailed Description

GHOST window on M$ Windows OSs.

Definition at line 247 of file GHOST_WindowWin32.h.

Constructor & Destructor Documentation

◆ GHOST_WindowWin32()

GHOST_WindowWin32::GHOST_WindowWin32 ( GHOST_SystemWin32 system,
const char *  title,
GHOST_TInt32  left,
GHOST_TInt32  top,
GHOST_TUns32  width,
GHOST_TUns32  height,
GHOST_TWindowState  state,
GHOST_TDrawingContextType  type = GHOST_kDrawingContextTypeNone,
bool  wantStereoVisual = false,
bool  alphaBackground = false,
GHOST_WindowWin32 parentWindow = 0,
bool  is_debug = false,
bool  dialog = false 
)

Constructor. Creates a new window and opens it. To check if the window was created properly, use the getValid() method.

Parameters
titleThe text shown in the title bar of the window.
leftThe coordinate of the left edge of the window.
topThe coordinate of the top edge of the window.
widthThe width the window.
heightThe height the window.
stateThe state the window is initially opened with.
typeThe type of drawing context installed in this window.
wantStereoVisualStereo visual for quad buffered stereo.
parentWindowHwndTODO.

Definition at line 61 of file GHOST_WindowWin32.cpp.

References alloc_utf16_from_8(), CLSID_TaskbarList, FALSE, free(), GHOST_System::getTabletAPI(), GHOST_kTabletNative, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_TABLET_DATA_NONE, height, left, LPVOID, GHOST_System::m_windowFocus, max, min, NULL, PACKETDATA, PACKETMODE, GHOST_Window::setDrawingContextType(), state, top, type, and width.

◆ ~GHOST_WindowWin32()

GHOST_WindowWin32::~GHOST_WindowWin32 ( )

Member Function Documentation

◆ beginFullScreen()

GHOST_TSuccess GHOST_WindowWin32::beginFullScreen ( ) const
inlinevirtual

Implements GHOST_IWindow.

Definition at line 454 of file GHOST_WindowWin32.h.

References GHOST_kFailure.

◆ bringTabletContextToFront()

void GHOST_WindowWin32::bringTabletContextToFront ( )

Definition at line 1150 of file GHOST_WindowWin32.cpp.

References GHOST_kTabletWintab, and useTabletAPI().

Referenced by GHOST_SystemWin32::processWindowEvent().

◆ clientToScreen()

void GHOST_WindowWin32::clientToScreen ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 outY 
) const
virtual

Converts a point in screen coordinates to client rectangle coordinates

Parameters
inXThe x-coordinate in the client rectangle.
inYThe y-coordinate in the client rectangle.
outXThe x-coordinate on the screen.
outYThe y-coordinate on the screen.

Implements GHOST_IWindow.

Definition at line 507 of file GHOST_WindowWin32.cpp.

References Freestyle::Nature::POINT.

◆ endFullScreen()

GHOST_TSuccess GHOST_WindowWin32::endFullScreen ( void  ) const
inlinevirtual

Implements GHOST_IWindow.

Definition at line 459 of file GHOST_WindowWin32.h.

References GHOST_kFailure.

◆ endProgressBar()

GHOST_TSuccess GHOST_WindowWin32::endProgressBar ( )
virtual

Hides the progress bar in the icon

Reimplemented from GHOST_Window.

Definition at line 1255 of file GHOST_WindowWin32.cpp.

References GHOST_kFailure, GHOST_kSuccess, ITaskbarList3::SetProgressState(), and TBPF_NOPROGRESS.

◆ getClientBounds()

void GHOST_WindowWin32::getClientBounds ( GHOST_Rect bounds) const
virtual

Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.

Parameters
boundsThe bounding rectangle of the client area of the window.

Implements GHOST_IWindow.

Definition at line 398 of file GHOST_WindowWin32.cpp.

References bounds(), and Freestyle::Nature::POINT.

Referenced by GHOST_SystemWin32::processCursorEvent(), setClientHeight(), setClientSize(), and setClientWidth().

◆ getDPIHint()

GHOST_TUns16 GHOST_WindowWin32::getDPIHint ( )
overridevirtual

Returns the recommended DPI for this window.

Returns
The recommended DPI for this window.

Reimplemented from GHOST_Window.

Definition at line 1161 of file GHOST_WindowWin32.cpp.

References USER_DEFAULT_SCREEN_DPI.

◆ getHWND()

HWND GHOST_WindowWin32::getHWND ( ) const

Access to the handle of the window.

Returns
The handle of the window.

Definition at line 365 of file GHOST_WindowWin32.cpp.

Referenced by GHOST_DropTargetWin32::GHOST_DropTargetWin32().

◆ getPointerInfo()

GHOST_TSuccess GHOST_WindowWin32::getPointerInfo ( std::vector< GHOST_PointerInfoWin32 > &  outPointerInfo,
WPARAM  wParam,
LPARAM  lParam 
)

◆ getStandardCursor()

HCURSOR GHOST_WindowWin32::getStandardCursor ( GHOST_TStandardCursor  shape) const

◆ getState()

GHOST_TWindowState GHOST_WindowWin32::getState ( ) const
virtual

Returns the state of the window (normal, minimized, maximized).

Returns
The state of the window.

Implements GHOST_IWindow.

Definition at line 484 of file GHOST_WindowWin32.cpp.

References GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, and result.

Referenced by GHOST_SystemWin32::s_wndProc(), setOrder(), and setState().

◆ getTabletData()

const GHOST_TabletData& GHOST_WindowWin32::getTabletData ( )
inline

◆ getTitle()

std::string GHOST_WindowWin32::getTitle ( ) const
virtual

Returns the title displayed in the title bar.

Returns
The title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 377 of file GHOST_WindowWin32.cpp.

References conv_utf_16_to_8(), count_utf_8_from_16(), and L.

◆ getValid()

bool GHOST_WindowWin32::getValid ( ) const
virtual

Returns indication as to whether the window is valid.

Returns
The validity of the window.

Reimplemented from GHOST_Window.

Definition at line 360 of file GHOST_WindowWin32.cpp.

References GHOST_Window::getValid().

Referenced by GHOST_SystemWin32::createWindow().

◆ getWindowBounds()

void GHOST_WindowWin32::getWindowBounds ( GHOST_Rect bounds) const
virtual

Returns the window rectangle dimensions. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

Parameters
boundsThe bounding rectangle of the window.

Implements GHOST_IWindow.

Definition at line 388 of file GHOST_WindowWin32.cpp.

References bounds().

Referenced by setClientHeight(), setClientSize(), and setClientWidth().

◆ invalidate()

GHOST_TSuccess GHOST_WindowWin32::invalidate ( void  )
virtual

Invalidates the contents of this window.

Implements GHOST_IWindow.

Definition at line 587 of file GHOST_WindowWin32.cpp.

References FALSE, GHOST_kFailure, and GHOST_kSuccess.

◆ isDialog()

bool GHOST_WindowWin32::isDialog ( ) const
virtual

Reimplemented from GHOST_Window.

Definition at line 701 of file GHOST_WindowWin32.cpp.

◆ loadCursor()

void GHOST_WindowWin32::loadCursor ( bool  visible,
GHOST_TStandardCursor  cursorShape 
) const

◆ lostMouseCapture()

void GHOST_WindowWin32::lostMouseCapture ( )

Inform the window that it has lost mouse capture, called in response to native window system messages.

Definition at line 692 of file GHOST_WindowWin32.cpp.

Referenced by GHOST_SystemWin32::s_wndProc().

◆ processWin32TabletActivateEvent()

void GHOST_WindowWin32::processWin32TabletActivateEvent ( WORD  state)

Definition at line 1019 of file GHOST_WindowWin32.cpp.

References GHOST_kTabletWintab, state, and useTabletAPI().

Referenced by GHOST_SystemWin32::s_wndProc().

◆ processWin32TabletEvent()

void GHOST_WindowWin32::processWin32TabletEvent ( WPARAM  wParam,
LPARAM  lParam 
)

◆ processWin32TabletInitEvent()

void GHOST_WindowWin32::processWin32TabletInitEvent ( )

◆ screenToClient()

void GHOST_WindowWin32::screenToClient ( GHOST_TInt32  inX,
GHOST_TInt32  inY,
GHOST_TInt32 outX,
GHOST_TInt32 outY 
) const
virtual

Converts a point in screen coordinates to client rectangle coordinates

Parameters
inXThe x-coordinate on the screen.
inYThe y-coordinate on the screen.
outXThe x-coordinate in the client rectangle.
outYThe y-coordinate in the client rectangle.

Implements GHOST_IWindow.

Definition at line 496 of file GHOST_WindowWin32.cpp.

References Freestyle::Nature::POINT.

◆ setClientHeight()

GHOST_TSuccess GHOST_WindowWin32::setClientHeight ( GHOST_TUns32  height)
virtual

Resizes client rectangle height.

Parameters
heightThe new height of the client area of the window.

Implements GHOST_IWindow.

Definition at line 446 of file GHOST_WindowWin32.cpp.

References getClientBounds(), GHOST_Rect::getHeight(), GHOST_Rect::getWidth(), getWindowBounds(), GHOST_kFailure, GHOST_kSuccess, and height.

◆ setClientSize()

GHOST_TSuccess GHOST_WindowWin32::setClientSize ( GHOST_TUns32  width,
GHOST_TUns32  height 
)
virtual

Resizes client rectangle.

Parameters
widthThe new width of the client area of the window.
heightThe new height of the client area of the window.

Implements GHOST_IWindow.

Definition at line 465 of file GHOST_WindowWin32.cpp.

References getClientBounds(), GHOST_Rect::getHeight(), GHOST_Rect::getWidth(), getWindowBounds(), GHOST_kFailure, GHOST_kSuccess, height, and width.

◆ setClientWidth()

GHOST_TSuccess GHOST_WindowWin32::setClientWidth ( GHOST_TUns32  width)
virtual

Resizes client rectangle width.

Parameters
widthThe new width of the client area of the window.

Implements GHOST_IWindow.

Definition at line 427 of file GHOST_WindowWin32.cpp.

References getClientBounds(), GHOST_Rect::getHeight(), GHOST_Rect::getWidth(), getWindowBounds(), GHOST_kFailure, GHOST_kSuccess, and width.

◆ setOrder()

GHOST_TSuccess GHOST_WindowWin32::setOrder ( GHOST_TWindowOrder  order)
virtual

Sets the order of the window (bottom, top).

Parameters
orderThe order of the window.
Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 560 of file GHOST_WindowWin32.cpp.

References FALSE, getState(), GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowOrderBottom, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, NULL, order, and setState().

◆ setProgressBar()

GHOST_TSuccess GHOST_WindowWin32::setProgressBar ( float  progress)
virtual

Sets the progress bar value displayed in the window/application icon

Parameters
progressThe progress percentage (0.0 to 1.0).

Reimplemented from GHOST_Window.

Definition at line 1246 of file GHOST_WindowWin32.cpp.

References GHOST_kFailure, GHOST_kSuccess, and ITaskbarList3::SetProgressValue().

◆ setState()

GHOST_TSuccess GHOST_WindowWin32::setState ( GHOST_TWindowState  state)
virtual

Sets the state of the window (normal, minimized, maximized).

Parameters
stateThe state of the window.
Returns
Indication of success.

Implements GHOST_IWindow.

Definition at line 518 of file GHOST_WindowWin32.cpp.

References getState(), GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, and state.

Referenced by GHOST_SystemWin32::s_wndProc(), and setOrder().

◆ setTitle()

void GHOST_WindowWin32::setTitle ( const char *  title)
virtual

Sets the title displayed in the title bar.

Parameters
titleThe title to display in the title bar.

Implements GHOST_IWindow.

Definition at line 370 of file GHOST_WindowWin32.cpp.

References alloc_utf16_from_8(), and free().

◆ updateMouseCapture()

void GHOST_WindowWin32::updateMouseCapture ( GHOST_MouseCaptureEventWin32  event)

Register a mouse capture state (should be called for any real button press, controls mouse capturing).

Parameters
eventWhether mouse was pressed and released, or an operator grabbed or ungrabbed the mouse.

Definition at line 706 of file GHOST_WindowWin32.cpp.

References MousePressed, MouseReleased, OperatorGrab, and OperatorUngrab.

Referenced by GHOST_SystemWin32::processButtonEvent(), and GHOST_SystemWin32::processPointerEvent().

◆ useTabletAPI()

bool GHOST_WindowWin32::useTabletAPI ( GHOST_TTabletAPI  api) const

Member Data Documentation

◆ close

GHOST_WIN32_WTClose GHOST_WindowWin32::close

Definition at line 564 of file GHOST_WindowWin32.h.

◆ enable

GHOST_WIN32_WTEnable GHOST_WindowWin32::enable

Definition at line 566 of file GHOST_WindowWin32.h.

◆ handle

HMODULE GHOST_WindowWin32::handle = NULL

WinTab.dll handle.

Definition at line 559 of file GHOST_WindowWin32.h.

◆ info

GHOST_WIN32_WTInfo GHOST_WindowWin32::info

API functions

Definition at line 562 of file GHOST_WindowWin32.h.

◆ m_inLiveResize

bool GHOST_WindowWin32::m_inLiveResize

if the window currently resizing

Definition at line 470 of file GHOST_WindowWin32.h.

Referenced by GHOST_SystemWin32::s_wndProc().

◆ m_tabletInRange

bool GHOST_WindowWin32::m_tabletInRange

Whether a tablet stylus is being tracked.

Definition at line 467 of file GHOST_WindowWin32.h.

Referenced by GHOST_SystemWin32::processCursorEvent(), and GHOST_SystemWin32::processPointerEvent().

◆ maxAltitude

LONG GHOST_WindowWin32::maxAltitude

Definition at line 572 of file GHOST_WindowWin32.h.

◆ maxAzimuth

LONG GHOST_WindowWin32::maxAzimuth

Definition at line 572 of file GHOST_WindowWin32.h.

◆ maxPressure

LONG GHOST_WindowWin32::maxPressure

Definition at line 571 of file GHOST_WindowWin32.h.

◆ open

GHOST_WIN32_WTOpen GHOST_WindowWin32::open

Definition at line 563 of file GHOST_WindowWin32.h.

◆ overlap

GHOST_WIN32_WTOverlap GHOST_WindowWin32::overlap

Definition at line 567 of file GHOST_WindowWin32.h.

◆ packet

GHOST_WIN32_WTPacket GHOST_WindowWin32::packet

Definition at line 565 of file GHOST_WindowWin32.h.

◆ tablet

HCTX GHOST_WindowWin32::tablet

Stores the Tablet context if detected Tablet features using WinTab.dll

Definition at line 570 of file GHOST_WindowWin32.h.


The documentation for this class was generated from the following files: