Blender V2.61 - r43446
|
#include <GHOST_WindowCarbon.h>
Window on Mac OSX/Carbon. Carbon windows have a size widget in the lower right corner of the window. To force it to be visible, the height of the client rectangle is reduced so that applications do not draw in that area. GHOST will manage that area which is called the gutter. When OpenGL contexts are active, GHOST will use AGL_BUFFER_RECT to prevent OpenGL drawing outside the reduced client rectangle.
Definition at line 60 of file GHOST_WindowCarbon.h.
GHOST_WindowCarbon::GHOST_WindowCarbon | ( | const STR_String & | title, |
GHOST_TInt32 | left, | ||
GHOST_TInt32 | top, | ||
GHOST_TUns32 | width, | ||
GHOST_TUns32 | height, | ||
GHOST_TWindowState | state, | ||
GHOST_TDrawingContextType | type = GHOST_kDrawingContextTypeNone , |
||
const bool | stereoVisual = false , |
||
const GHOST_TUns16 | numOfAASamples = 0 |
||
) |
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. |
stereoVisual | Stereo visual for quad buffered stereo. |
Definition at line 93 of file GHOST_WindowCarbon.cpp.
References activateDrawingContext(), GHOST_TabletData::Active, err, gen2mac(), GHOST_kDrawingContextTypeOpenGL, GHOST_kTabletModeNone, GHOST_kWindowState8FullScreen, GHOST_kWindowState8Maximized, GHOST_kWindowState8Minimized, GHOST_kWindowState8Normal, GHOST_kWindowStateFullScreen, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, installDrawingContext(), kWEvents, left(), m_grafPtr, m_tablet, m_windowRef, myWEventHandlerProc(), NULL, GHOST_Window::setDrawingContextType(), setMac_windowState(), setTitle(), ugly_hack, and updateDrawingContext().
GHOST_WindowCarbon::~GHOST_WindowCarbon | ( | ) | [virtual] |
Destructor. Closes the window and disposes resources allocated.
Definition at line 192 of file GHOST_WindowCarbon.cpp.
References GHOST_kDrawingContextTypeNone, m_customCursor, m_windowRef, NULL, GHOST_Window::setDrawingContextType(), and ugly_hack.
GHOST_TSuccess GHOST_WindowCarbon::activateDrawingContext | ( | ) | [virtual] |
Activates the drawing context of this window.
Implements GHOST_IWindow.
Definition at line 451 of file GHOST_WindowCarbon.cpp.
References getClientBounds(), GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, m_aglCtx, GHOST_Rect::m_b, GHOST_Window::m_drawingContextType, GHOST_Rect::m_l, GHOST_Rect::m_r, and GHOST_Rect::m_t.
Referenced by GHOST_WindowCarbon().
void GHOST_WindowCarbon::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
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 359 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, and m_grafPtr.
void GHOST_WindowCarbon::gen2mac | ( | const STR_String & | in, |
Str255 | out | ||
) | const [protected, virtual] |
Converts a string object to a Mac Pascal string.
in | The string object to be converted. |
out | The converted string. |
Definition at line 576 of file GHOST_WindowCarbon.cpp.
References STR_String::Length(), and STR_String::Ptr().
Referenced by GHOST_WindowCarbon(), and setTitle().
GHOST_TabletData& GHOST_WindowCarbon::GetCarbonTabletData | ( | ) | [inline] |
Definition at line 217 of file GHOST_WindowCarbon.h.
References m_tablet.
void GHOST_WindowCarbon::getClientBounds | ( | GHOST_Rect & | bounds | ) | const [virtual] |
Returns the client rectangle dimensions. The left and top members of the rectangle are always zero.
bounds | The bounding rectangle of the cleient area of the window. |
Implements GHOST_IWindow.
Definition at line 250 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, GHOST_Rect::m_b, GHOST_Rect::m_l, GHOST_Rect::m_r, GHOST_Rect::m_t, and m_windowRef.
Referenced by activateDrawingContext(), setClientHeight(), setClientSize(), and setClientWidth().
bool GHOST_WindowCarbon::getFullScreenDirty | ( | ) | [virtual] |
Returns the dirty state of the window when in full-screen mode.
Definition at line 647 of file GHOST_WindowCarbon.cpp.
References GHOST_Window::m_fullScreen, and m_fullScreenDirty.
short GHOST_WindowCarbon::getMac_windowState | ( | ) | [virtual] |
Definition at line 744 of file GHOST_WindowCarbon.cpp.
References mac_windowState.
Referenced by myWEventHandlerProc().
GHOST_TWindowState GHOST_WindowCarbon::getState | ( | ) | const [virtual] |
Returns the state of the window (normal, minimized, maximized).
Implements GHOST_IWindow.
Definition at line 326 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, m_windowRef, and state.
const GHOST_TabletData* GHOST_WindowCarbon::GetTabletData | ( | ) | [inline, virtual] |
Returns the tablet data (pressure etc).
Implements GHOST_IWindow.
Definition at line 214 of file GHOST_WindowCarbon.h.
References m_tablet.
void GHOST_WindowCarbon::getTitle | ( | STR_String & | title | ) | const [virtual] |
Returns the title displayed in the title bar.
title | The title displayed in the title bar. |
Implements GHOST_IWindow.
Definition at line 228 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, m_windowRef, and mac2gen().
bool GHOST_WindowCarbon::getValid | ( | ) | const [virtual] |
Returns indication as to whether the window is valid.
Implements GHOST_IWindow.
Definition at line 206 of file GHOST_WindowCarbon.cpp.
References GHOST_Window::m_fullScreen, m_grafPtr, and m_windowRef.
Referenced by clientToScreen(), getClientBounds(), getState(), getTitle(), getWindowBounds(), installDrawingContext(), invalidate(), screenToClient(), setClientHeight(), setClientSize(), setClientWidth(), setOrder(), setState(), and setTitle().
void GHOST_WindowCarbon::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.
bounds | The bounding rectangle of the window. |
Implements GHOST_IWindow.
Definition at line 237 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, GHOST_Rect::m_b, GHOST_Rect::m_l, GHOST_Rect::m_r, GHOST_Rect::m_t, and m_windowRef.
GHOST_TSuccess GHOST_WindowCarbon::installDrawingContext | ( | GHOST_TDrawingContextType | type | ) | [protected, virtual] |
Tries to install a rendering context in this window.
type | The type of rendering context installed. |
Implements GHOST_Window.
Definition at line 480 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_kDrawingContextTypeNone, GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, m_aglCtx, GHOST_Window::m_fullScreen, GHOST_Window::m_fullScreenHeight, GHOST_Window::m_fullScreenWidth, m_grafPtr, s_firstaglCtx, sPreferredFormatFullScreen, and sPreferredFormatWindow.
Referenced by GHOST_WindowCarbon().
GHOST_TSuccess GHOST_WindowCarbon::invalidate | ( | void | ) | [protected, virtual] |
Invalidates the contents of this window.
Implements GHOST_IWindow.
Definition at line 553 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, GHOST_Window::m_fullScreen, m_fullScreenDirty, m_grafPtr, and m_windowRef.
void GHOST_WindowCarbon::loadCursor | ( | bool | visible, |
GHOST_TStandardCursor | cursor | ||
) | const [virtual] |
Definition at line 594 of file GHOST_WindowCarbon.cpp.
References GCMAP, GHOST_kStandardCursorBottomLeftCorner, GHOST_kStandardCursorBottomRightCorner, GHOST_kStandardCursorBottomSide, GHOST_kStandardCursorCopy, GHOST_kStandardCursorCrosshair, GHOST_kStandardCursorCustom, GHOST_kStandardCursorCycle, GHOST_kStandardCursorDefault, GHOST_kStandardCursorDestroy, GHOST_kStandardCursorHelp, GHOST_kStandardCursorInfo, GHOST_kStandardCursorLeftArrow, GHOST_kStandardCursorLeftRight, GHOST_kStandardCursorLeftSide, GHOST_kStandardCursorRightArrow, GHOST_kStandardCursorRightSide, GHOST_kStandardCursorSpray, GHOST_kStandardCursorText, GHOST_kStandardCursorTopLeftCorner, GHOST_kStandardCursorTopRightCorner, GHOST_kStandardCursorTopSide, GHOST_kStandardCursorUpDown, GHOST_kStandardCursorWait, and m_customCursor.
Referenced by GHOST_SystemCarbon::handleWindowEvent(), setWindowCursorShape(), setWindowCursorVisibility(), and setWindowCustomCursorShape().
void GHOST_WindowCarbon::mac2gen | ( | const Str255 | in, |
STR_String & | out | ||
) | const [protected, virtual] |
Converts a Mac Pascal string to a string object.
in | The string to be converted. |
out | The converted string object. |
Definition at line 586 of file GHOST_WindowCarbon.cpp.
Referenced by getTitle().
GHOST_TSuccess GHOST_WindowCarbon::removeDrawingContext | ( | ) | [protected, virtual] |
Removes the current drawing context.
Implements GHOST_Window.
Definition at line 529 of file GHOST_WindowCarbon.cpp.
References GHOST_kDrawingContextTypeNone, GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, m_aglCtx, GHOST_Window::m_drawingContextType, NULL, and s_firstaglCtx.
void GHOST_WindowCarbon::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
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 343 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, and m_grafPtr.
GHOST_TSuccess GHOST_WindowCarbon::setClientHeight | ( | GHOST_TUns32 | height | ) | [virtual] |
Resizes client rectangle height.
height | The new height of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 288 of file GHOST_WindowCarbon.cpp.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and m_windowRef.
GHOST_TSuccess GHOST_WindowCarbon::setClientSize | ( | GHOST_TUns32 | width, |
GHOST_TUns32 | height | ||
) | [virtual] |
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 306 of file GHOST_WindowCarbon.cpp.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and m_windowRef.
GHOST_TSuccess GHOST_WindowCarbon::setClientWidth | ( | GHOST_TUns32 | width | ) | [virtual] |
Resizes client rectangle width.
width | The new width of the client area of the window. |
Implements GHOST_IWindow.
Definition at line 276 of file GHOST_WindowCarbon.cpp.
References getClientBounds(), GHOST_Rect::getHeight(), getValid(), GHOST_Rect::getWidth(), GHOST_ASSERT, GHOST_kSuccess, and m_windowRef.
void GHOST_WindowCarbon::setMac_windowState | ( | short | value | ) | [virtual] |
Definition at line 739 of file GHOST_WindowCarbon.cpp.
References mac_windowState.
Referenced by GHOST_WindowCarbon(), and myWEventHandlerProc().
GHOST_TSuccess GHOST_WindowCarbon::setOrder | ( | GHOST_TWindowOrder | order | ) | [virtual] |
Sets the order of the window (bottom, top).
order | The order of the window. |
Implements GHOST_IWindow.
Definition at line 398 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, GHOST_kWindowOrderTop, and m_windowRef.
GHOST_TSuccess GHOST_WindowCarbon::setState | ( | GHOST_TWindowState | state | ) | [virtual] |
Sets the state of the window (normal, minimized, maximized).
state | The state of the window. |
Implements GHOST_IWindow.
Definition at line 375 of file GHOST_WindowCarbon.cpp.
References getValid(), GHOST_ASSERT, GHOST_kSuccess, GHOST_kWindowStateMaximized, GHOST_kWindowStateMinimized, GHOST_kWindowStateModified, GHOST_kWindowStateNormal, GHOST_kWindowStateUnModified, and m_windowRef.
void GHOST_WindowCarbon::setTitle | ( | const STR_String & | title | ) | [virtual] |
Sets the title displayed in the title bar.
title | The title to display in the title bar. |
Implements GHOST_IWindow.
Definition at line 219 of file GHOST_WindowCarbon.cpp.
References gen2mac(), getValid(), GHOST_ASSERT, and m_windowRef.
Referenced by GHOST_WindowCarbon().
GHOST_TSuccess GHOST_WindowCarbon::setWindowCursorShape | ( | GHOST_TStandardCursor | shape | ) | [protected, virtual] |
Sets the cursor shape on the window using native window system calls.
Implements GHOST_Window.
Definition at line 662 of file GHOST_WindowCarbon.cpp.
References GHOST_Window::getCursorVisibility(), GHOST_kSuccess, loadCursor(), m_customCursor, and m_windowRef.
GHOST_TSuccess GHOST_WindowCarbon::setWindowCursorVisibility | ( | bool | visible | ) | [protected, virtual] |
Sets the cursor visibility on the window using native window system calls.
Implements GHOST_Window.
Definition at line 653 of file GHOST_WindowCarbon.cpp.
References GHOST_Window::getCursorShape(), GHOST_kSuccess, loadCursor(), and m_windowRef.
GHOST_TSuccess GHOST_WindowCarbon::setWindowCustomCursorShape | ( | GHOST_TUns8 | bitmap[16][2], |
GHOST_TUns8 | mask[16][2], | ||
int | hotX, | ||
int | hotY | ||
) | [protected, virtual] |
Sets the cursor shape on the window using native window system calls.
Implements GHOST_Window.
Definition at line 732 of file GHOST_WindowCarbon.cpp.
References setWindowCustomCursorShape().
GHOST_TSuccess GHOST_WindowCarbon::setWindowCustomCursorShape | ( | GHOST_TUns8 * | bitmap, |
GHOST_TUns8 * | mask, | ||
int | sizex, | ||
int | sizey, | ||
int | hotX, | ||
int | hotY, | ||
int | fg_color, | ||
int | bg_color | ||
) | [protected, virtual] |
Sets the cursor shape on the window using native window system calls.
Implements GHOST_Window.
Definition at line 698 of file GHOST_WindowCarbon.cpp.
References GHOST_Window::getCursorVisibility(), GHOST_kFailure, GHOST_kStandardCursorCustom, GHOST_kSuccess, loadCursor(), m_customCursor, m_windowRef, and uns16ReverseBits().
Referenced by setWindowCustomCursorShape().
GHOST_TSuccess GHOST_WindowCarbon::swapBuffers | ( | ) | [virtual] |
Swaps front and back buffers of a window.
Implements GHOST_IWindow.
Definition at line 417 of file GHOST_WindowCarbon.cpp.
References GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, m_aglCtx, and GHOST_Window::m_drawingContextType.
GHOST_TSuccess GHOST_WindowCarbon::updateDrawingContext | ( | ) |
Updates the drawing context of this window. Needed whenever the window is changed.
Definition at line 437 of file GHOST_WindowCarbon.cpp.
References GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, m_aglCtx, and GHOST_Window::m_drawingContextType.
Referenced by GHOST_WindowCarbon(), and GHOST_SystemCarbon::handleWindowEvent().
AGLContext GHOST_WindowCarbon::m_aglCtx [protected] |
Definition at line 276 of file GHOST_WindowCarbon.h.
Referenced by activateDrawingContext(), installDrawingContext(), removeDrawingContext(), swapBuffers(), and updateDrawingContext().
Cursor* GHOST_WindowCarbon::m_customCursor [protected] |
Definition at line 281 of file GHOST_WindowCarbon.h.
Referenced by loadCursor(), setWindowCursorShape(), setWindowCustomCursorShape(), and ~GHOST_WindowCarbon().
bool GHOST_WindowCarbon::m_fullScreenDirty [protected] |
When running in full-screen this tells whether to refresh the window.
Definition at line 286 of file GHOST_WindowCarbon.h.
Referenced by getFullScreenDirty(), and invalidate().
CGrafPtr GHOST_WindowCarbon::m_grafPtr [protected] |
Definition at line 275 of file GHOST_WindowCarbon.h.
Referenced by clientToScreen(), getValid(), GHOST_WindowCarbon(), installDrawingContext(), invalidate(), and screenToClient().
GHOST_TabletData GHOST_WindowCarbon::m_tablet [protected] |
Definition at line 283 of file GHOST_WindowCarbon.h.
Referenced by GetCarbonTabletData(), GetTabletData(), and GHOST_WindowCarbon().
WindowRef GHOST_WindowCarbon::m_windowRef [protected] |
Definition at line 274 of file GHOST_WindowCarbon.h.
Referenced by getClientBounds(), getState(), getTitle(), getValid(), getWindowBounds(), GHOST_WindowCarbon(), invalidate(), setClientHeight(), setClientSize(), setClientWidth(), setOrder(), setState(), setTitle(), setWindowCursorShape(), setWindowCursorVisibility(), setWindowCustomCursorShape(), and ~GHOST_WindowCarbon().
short GHOST_WindowCarbon::mac_windowState [protected] |
specific MacOs X full screen window setting as we use partially system mechanism values : 0 not maximizable default 1 normal state 2 maximized state
this will be reworked when rebuilding GHOST carbon to use new OS X apis in order to be unified with GHOST fullscreen/maximised settings
(lukep)
Definition at line 299 of file GHOST_WindowCarbon.h.
Referenced by getMac_windowState(), and setMac_windowState().
AGLContext GHOST_WindowCarbon::s_firstaglCtx = NULL [static, protected] |
The first created OpenGL context (for sharing display lists)
Copyright (C) 2001 NaN Technologies B.V.
Definition at line 279 of file GHOST_WindowCarbon.h.
Referenced by installDrawingContext(), and removeDrawingContext().