Blender V2.61 - r43446
|
#include <GHOST_Window.h>
Platform independent implementation of GHOST_IWindow. Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. Implements part of the GHOST_IWindow interface and adds some methods to be implemented by childs of this class.
Definition at line 49 of file GHOST_Window.h.
GHOST_Window::GHOST_Window | ( | GHOST_TUns32 | width, |
GHOST_TUns32 | height, | ||
GHOST_TWindowState | state, | ||
GHOST_TDrawingContextType | type = GHOST_kDrawingContextTypeNone , |
||
const bool | stereoVisual = false , |
||
const GHOST_TUns16 | numOfAASamples = 0 |
||
) |
implementation. virtual bool getValid() const = 0; virtual void setTitle(const STR_String& title) = 0; virtual void getTitle(STR_String& title) const = 0; virtual void getWindowBounds(GHOST_Rect& bounds) const = 0; virtual void getClientBounds(GHOST_Rect& bounds) const = 0; virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0; virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0; virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0; virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; virtual GHOST_TWindowState getState() const = 0; virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0; virtual GHOST_TWindowOrder getOrder(void) = 0; virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0; virtual GHOST_TSuccess swapBuffers() = 0; virtual GHOST_TSuccess activateDrawingContext() = 0; virtual GHOST_TSuccess invalidate() = 0; Constructor. Creates a new window and opens it. To check if the window was created properly, use the getValid() method.
width | The width the window. |
heigh | The height the window. |
state | The state the window is initially opened with. |
type | The type of drawing context installed in this window. |
stereoVisual | Stereo visual for quad buffered stereo. |
numOfAASamples | Number of samples used for AA (zero if no AA) |
Copyright (C) 2001 NaN Technologies B.V.
Definition at line 42 of file GHOST_Window.cpp.
References GHOST_kWindowStateFullScreen, m_canAcceptDragOperation, m_cursorGrabAccumPos, m_fullScreen, m_fullScreenHeight, m_fullScreenWidth, m_isUnsavedChanges, and m_progressBarVisible.
GHOST_Window::~GHOST_Window | ( | ) | [virtual] |
implementation. virtual bool getValid() const = 0; virtual void setTitle(const STR_String& title) = 0; virtual void getTitle(STR_String& title) const = 0; virtual void getWindowBounds(GHOST_Rect& bounds) const = 0; virtual void getClientBounds(GHOST_Rect& bounds) const = 0; virtual GHOST_TSuccess setClientWidth(GHOST_TUns32 width) = 0; virtual GHOST_TSuccess setClientHeight(GHOST_TUns32 height) = 0; virtual GHOST_TSuccess setClientSize(GHOST_TUns32 width, GHOST_TUns32 height) = 0; virtual void screenToClient(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; virtual void clientToScreen(GHOST_TInt32 inX, GHOST_TInt32 inY, GHOST_TInt32& outX, GHOST_TInt32& outY) const = 0; virtual GHOST_TWindowState getState() const = 0; virtual GHOST_TSuccess setState(GHOST_TWindowState state) = 0; virtual GHOST_TSuccess setOrder(GHOST_TWindowOrder order) = 0; virtual GHOST_TSuccess swapBuffers() = 0; virtual GHOST_TSuccess activateDrawingContext() = 0; virtual GHOST_TSuccess invalidate() = 0; Destructor. Closes the window and disposes resources allocated.
Definition at line 72 of file GHOST_Window.cpp.
bool GHOST_Window::canAcceptDragOperation | ( | ) | const [virtual] |
Returns acceptance of the dropped object Usually called by the "object dropped" event handling function
Implements GHOST_IWindow.
Definition at line 172 of file GHOST_Window.cpp.
References m_canAcceptDragOperation.
Referenced by GHOST_DropTargetWin32::DragOver(), and GHOST_DropTargetWin32::Drop().
virtual GHOST_TSuccess GHOST_Window::endProgressBar | ( | ) | [inline, virtual] |
Hides the progress bar in the icon
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowWin32.
Definition at line 197 of file GHOST_Window.h.
References GHOST_kFailure.
void GHOST_Window::getCursorGrabAccum | ( | GHOST_TInt32 & | x, |
GHOST_TInt32 & | y | ||
) | const [inline, virtual] |
Definition at line 371 of file GHOST_Window.h.
References m_cursorGrabAccumPos.
Referenced by GHOST_SystemWin32::processCursorEvent().
GHOST_TSuccess GHOST_Window::getCursorGrabBounds | ( | GHOST_Rect & | bounds | ) | [virtual] |
Gets the cursor grab region, if unset the window is used. reset when grab is disabled.
Definition at line 130 of file GHOST_Window.cpp.
References GHOST_kFailure, GHOST_kSuccess, m_cursorGrabBounds, GHOST_Rect::m_l, and GHOST_Rect::m_r.
Referenced by GHOST_SystemWin32::processCursorEvent().
void GHOST_Window::getCursorGrabInitPos | ( | GHOST_TInt32 & | x, |
GHOST_TInt32 & | y | ||
) | const [inline, virtual] |
Definition at line 365 of file GHOST_Window.h.
References m_cursorGrabInitPos.
GHOST_TGrabCursorMode GHOST_Window::getCursorGrabMode | ( | ) | const [inline, virtual] |
Definition at line 360 of file GHOST_Window.h.
References m_cursorGrab.
Referenced by GHOST_SystemCocoa::handleOpenDocumentRequest(), GHOST_SystemCocoa::handleQuitRequest(), and GHOST_SystemWin32::processCursorEvent().
GHOST_TStandardCursor GHOST_Window::getCursorShape | ( | ) | const [inline, virtual] |
Returns the current cursor shape.
Implements GHOST_IWindow.
Definition at line 383 of file GHOST_Window.h.
References m_cursorShape.
Referenced by GHOST_SystemCarbon::handleWindowEvent(), GHOST_SystemWin32::s_wndProc(), GHOST_WindowCarbon::setWindowCursorVisibility(), and GHOST_WindowWin32::setWindowCursorVisibility().
bool GHOST_Window::getCursorVisibility | ( | ) | const [inline, virtual] |
Returns the visibility state of the cursor.
Implements GHOST_IWindow.
Definition at line 355 of file GHOST_Window.h.
References m_cursorVisible.
Referenced by GHOST_SystemCarbon::handleWindowEvent(), GHOST_SystemWin32::s_wndProc(), GHOST_WindowCarbon::setWindowCursorShape(), GHOST_WindowWin32::setWindowCursorShape(), GHOST_WindowWin32::setWindowCustomCursorShape(), and GHOST_WindowCarbon::setWindowCustomCursorShape().
GHOST_TDrawingContextType GHOST_Window::getDrawingContextType | ( | ) | [inline, virtual] |
Returns the type of drawing context used in this window.
Implements GHOST_IWindow.
Definition at line 350 of file GHOST_Window.h.
References m_drawingContextType.
Referenced by GHOST_WindowSDL::swapBuffers().
bool GHOST_Window::getModifiedState | ( | ) | [virtual] |
Gets the window "modified" status, indicating unsaved changes
Implements GHOST_IWindow.
Definition at line 184 of file GHOST_Window.cpp.
References m_isUnsavedChanges.
void * GHOST_Window::getOSWindow | ( | ) | const [virtual] |
Returns the associated OS object/handle
Implements GHOST_IWindow.
Definition at line 76 of file GHOST_Window.cpp.
References NULL.
virtual GHOST_TUserDataPtr GHOST_Window::getUserData | ( | ) | const [inline, virtual] |
Returns the window user data.
Implements GHOST_IWindow.
Definition at line 242 of file GHOST_Window.h.
References m_userData.
virtual GHOST_TSuccess GHOST_Window::installDrawingContext | ( | GHOST_TDrawingContextType | type | ) | [protected, pure virtual] |
Tries to install a rendering context in this window.
type | The type of rendering context installed. |
Implemented in GHOST_WindowCarbon, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
Referenced by setDrawingContextType().
virtual GHOST_TSuccess GHOST_Window::removeDrawingContext | ( | ) | [protected, pure virtual] |
Removes the current drawing context.
Implemented in GHOST_WindowCarbon, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
Referenced by setDrawingContextType().
void GHOST_Window::setAcceptDragOperation | ( | bool | canAccept | ) | [virtual] |
Tells if the ongoing drag'n'drop object can be accepted upon mouse drop
Implements GHOST_IWindow.
Definition at line 167 of file GHOST_Window.cpp.
References m_canAcceptDragOperation.
Referenced by GHOST_DropTargetWin32::DragEnter().
GHOST_TSuccess GHOST_Window::setCursorGrab | ( | GHOST_TGrabCursorMode | mode, |
GHOST_Rect * | bounds | ||
) | [virtual] |
Sets the cursor grab.
mode | The new grab state of the cursor. |
Reimplemented from GHOST_IWindow.
Definition at line 108 of file GHOST_Window.cpp.
References bounds(), GHOST_IWindow::getClientBounds(), GHOST_kFailure, GHOST_kGrabDisable, GHOST_kSuccess, m_cursorGrab, m_cursorGrabBounds, GHOST_Rect::m_l, GHOST_Rect::m_r, and setWindowCursorGrab().
void GHOST_Window::setCursorGrabAccum | ( | GHOST_TInt32 | x, |
GHOST_TInt32 | y | ||
) | [inline, virtual] |
Definition at line 377 of file GHOST_Window.h.
References m_cursorGrabAccumPos.
Referenced by GHOST_SystemWin32::processCursorEvent(), and GHOST_WindowWin32::setWindowCursorGrab().
GHOST_TSuccess GHOST_Window::setCursorShape | ( | GHOST_TStandardCursor | cursorShape | ) | [virtual] |
Set the shape of the cursor.
cursor | The new cursor shape type id. |
Implements GHOST_IWindow.
Definition at line 136 of file GHOST_Window.cpp.
References GHOST_kFailure, GHOST_kSuccess, m_cursorShape, and setWindowCursorShape().
GHOST_TSuccess GHOST_Window::setCursorVisibility | ( | bool | visible | ) | [virtual] |
Shows or hides the cursor.
visible | The new visibility state of the cursor. |
Implements GHOST_IWindow.
Definition at line 97 of file GHOST_Window.cpp.
References GHOST_kFailure, GHOST_kSuccess, m_cursorVisible, and setWindowCursorVisibility().
GHOST_TSuccess GHOST_Window::setCustomCursorShape | ( | GHOST_TUns8 | bitmap[16][2], |
GHOST_TUns8 | mask[16][2], | ||
int | hotX, | ||
int | hotY | ||
) | [virtual] |
Set the shape of the cursor to a custom cursor.
bitmap | The bitmap data for the cursor. |
mask | The mask data for the cursor. |
hotX | The X coordinate of the cursor hotspot. |
hotY | The Y coordinate of the cursor hotspot. |
Implements GHOST_IWindow.
Definition at line 147 of file GHOST_Window.cpp.
References setCustomCursorShape().
Referenced by setCustomCursorShape().
GHOST_TSuccess GHOST_Window::setCustomCursorShape | ( | GHOST_TUns8 * | bitmap, |
GHOST_TUns8 * | mask, | ||
int | sizex, | ||
int | sizey, | ||
int | hotX, | ||
int | hotY, | ||
int | fg_color, | ||
int | bg_color | ||
) | [virtual] |
Implements GHOST_IWindow.
Definition at line 154 of file GHOST_Window.cpp.
References GHOST_kFailure, GHOST_kStandardCursorCustom, GHOST_kSuccess, m_cursorShape, and setWindowCustomCursorShape().
GHOST_TSuccess GHOST_Window::setDrawingContextType | ( | GHOST_TDrawingContextType | type | ) | [virtual] |
Tries to install a rendering context in this window. Child classes do not need to overload this method. They should overload the installDrawingContext and removeDrawingContext instead.
type | The type of rendering context installed. |
Implements GHOST_IWindow.
Definition at line 81 of file GHOST_Window.cpp.
References GHOST_kDrawingContextTypeNone, GHOST_kSuccess, installDrawingContext(), m_drawingContextType, and removeDrawingContext().
Referenced by GHOST_WindowCarbon::GHOST_WindowCarbon(), GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowCarbon::~GHOST_WindowCarbon(), and GHOST_WindowWin32::~GHOST_WindowWin32().
GHOST_TSuccess GHOST_Window::setModifiedState | ( | bool | isUnsavedChanges | ) | [virtual] |
Sets the window "modified" status, indicating unsaved changes
isUnsavedChanges | Unsaved changes or not |
Implements GHOST_IWindow.
Definition at line 177 of file GHOST_Window.cpp.
References GHOST_kSuccess, and m_isUnsavedChanges.
virtual GHOST_TSuccess GHOST_Window::setProgressBar | ( | float | progress | ) | [inline, virtual] |
Sets the progress bar value displayed in the window/application icon
progress | The progress % (0.0 to 1.0) |
Implements GHOST_IWindow.
Reimplemented in GHOST_WindowWin32.
Definition at line 192 of file GHOST_Window.h.
References GHOST_kFailure.
virtual void GHOST_Window::setUserData | ( | const GHOST_TUserDataPtr | userData | ) | [inline, virtual] |
Changes the window user data.
data | The window user data. |
Implements GHOST_IWindow.
Definition at line 251 of file GHOST_Window.h.
References m_userData.
virtual GHOST_TSuccess GHOST_Window::setWindowCursorGrab | ( | GHOST_TGrabCursorMode | mode | ) | [inline, protected, virtual] |
Sets the cursor grab on the window using native window system calls.
Reimplemented in GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
Definition at line 280 of file GHOST_Window.h.
References GHOST_kSuccess.
Referenced by setCursorGrab().
virtual GHOST_TSuccess GHOST_Window::setWindowCursorShape | ( | GHOST_TStandardCursor | shape | ) | [protected, pure virtual] |
Sets the cursor shape on the window using native window system calls.
Implemented in GHOST_WindowCarbon, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
Referenced by setCursorShape().
virtual GHOST_TSuccess GHOST_Window::setWindowCursorVisibility | ( | bool | visible | ) | [protected, pure virtual] |
Sets the cursor visibility on the window using native window system calls.
Implemented in GHOST_WindowCarbon, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
Referenced by setCursorVisibility().
virtual GHOST_TSuccess GHOST_Window::setWindowCustomCursorShape | ( | GHOST_TUns8 | bitmap[16][2], |
GHOST_TUns8 | mask[16][2], | ||
int | hotX, | ||
int | hotY | ||
) | [protected, pure virtual] |
Sets the cursor shape on the window using native window system calls.
Implemented in GHOST_WindowCarbon, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
Referenced by setCustomCursorShape().
virtual GHOST_TSuccess GHOST_Window::setWindowCustomCursorShape | ( | GHOST_TUns8 * | bitmap, |
GHOST_TUns8 * | mask, | ||
int | szx, | ||
int | szy, | ||
int | hotX, | ||
int | hotY, | ||
int | fg, | ||
int | bg | ||
) | [protected, pure virtual] |
Implemented in GHOST_WindowCarbon, GHOST_WindowNULL, GHOST_WindowSDL, GHOST_WindowWin32, and GHOST_WindowX11.
bool GHOST_Window::m_canAcceptDragOperation [protected] |
The acceptance of the "drop candidate" of the current drag'n'drop operation
Definition at line 326 of file GHOST_Window.h.
Referenced by canAcceptDragOperation(), GHOST_Window(), and setAcceptDragOperation().
GHOST_TGrabCursorMode GHOST_Window::m_cursorGrab [protected] |
The current grabbed state of the cursor
Definition at line 308 of file GHOST_Window.h.
Referenced by getCursorGrabMode(), setCursorGrab(), and GHOST_WindowWin32::setWindowCursorGrab().
GHOST_TInt32 GHOST_Window::m_cursorGrabAccumPos[2] [protected] |
Accumulated offset from m_cursorGrabInitPos.
Definition at line 314 of file GHOST_Window.h.
Referenced by getCursorGrabAccum(), GHOST_Window(), and setCursorGrabAccum().
GHOST_Rect GHOST_Window::m_cursorGrabBounds [protected] |
Wrap the cursor within this region.
Definition at line 317 of file GHOST_Window.h.
Referenced by getCursorGrabBounds(), setCursorGrab(), and GHOST_WindowWin32::setWindowCursorGrab().
GHOST_TInt32 GHOST_Window::m_cursorGrabInitPos[2] [protected] |
Initial grab location.
Definition at line 311 of file GHOST_Window.h.
Referenced by getCursorGrabInitPos(), and GHOST_WindowWin32::setWindowCursorGrab().
GHOST_TStandardCursor GHOST_Window::m_cursorShape [protected] |
The current shape of the cursor
Definition at line 320 of file GHOST_Window.h.
Referenced by getCursorShape(), setCursorShape(), and setCustomCursorShape().
bool GHOST_Window::m_cursorVisible [protected] |
The current visibility of the cursor
Definition at line 305 of file GHOST_Window.h.
Referenced by getCursorVisibility(), and setCursorVisibility().
The the of drawing context installed in this window.
Definition at line 299 of file GHOST_Window.h.
Referenced by GHOST_WindowCarbon::activateDrawingContext(), GHOST_WindowWin32::activateDrawingContext(), getDrawingContextType(), GHOST_WindowWin32::installDrawingContext(), GHOST_WindowCarbon::removeDrawingContext(), GHOST_WindowWin32::removeDrawingContext(), setDrawingContextType(), GHOST_WindowCarbon::swapBuffers(), and GHOST_WindowCarbon::updateDrawingContext().
bool GHOST_Window::m_fullScreen [protected] |
Stores wether this is a full screen window.
Definition at line 332 of file GHOST_Window.h.
Referenced by GHOST_WindowCarbon::getFullScreenDirty(), GHOST_WindowCarbon::getValid(), GHOST_Window(), GHOST_WindowCarbon::installDrawingContext(), and GHOST_WindowCarbon::invalidate().
GHOST_TUns32 GHOST_Window::m_fullScreenHeight [protected] |
Full-screen height
Definition at line 346 of file GHOST_Window.h.
Referenced by GHOST_Window(), and GHOST_WindowCarbon::installDrawingContext().
GHOST_TUns32 GHOST_Window::m_fullScreenWidth [protected] |
Full-screen width
Definition at line 344 of file GHOST_Window.h.
Referenced by GHOST_Window(), and GHOST_WindowCarbon::installDrawingContext().
bool GHOST_Window::m_isUnsavedChanges [protected] |
Modified state : are there unsaved changes
Definition at line 329 of file GHOST_Window.h.
Referenced by getModifiedState(), GHOST_Window(), and setModifiedState().
GHOST_TUns16 GHOST_Window::m_numOfAASamples [protected] |
Number of samples used in anti-aliasing, set to 0 if no AA
Definition at line 341 of file GHOST_Window.h.
Referenced by GHOST_WindowX11::GHOST_WindowX11().
bool GHOST_Window::m_progressBarVisible [protected] |
The presence of progress indicator with the application icon
Definition at line 323 of file GHOST_Window.h.
Referenced by GHOST_Window().
bool GHOST_Window::m_stereoVisual [protected] |
Stereo visual created. Only necessary for 'real' stereo support, ie quad buffered stereo. This is not always possible, depends on the graphics h/w
Definition at line 338 of file GHOST_Window.h.
Referenced by GHOST_WindowX11::GHOST_WindowX11(), and GHOST_WindowWin32::installDrawingContext().
GHOST_TUserDataPtr GHOST_Window::m_userData [protected] |
The window user data
Definition at line 302 of file GHOST_Window.h.
Referenced by getUserData(), and setUserData().