MacWindow

Engine/source/windowManager/mac/macWindow.h

More...

Classes:

Public Friends

Private Static Attributes

SafariWindowInfo *

Public Functions

Does the work of actually locking or unlocking the mouse, based on the value of shouldLockMouse().

bool

If we're fullscreen, this function returns us to desktop mode.

Convert the coordinate given in this window space to screen coordinates.

Destroy the window on screen.

Get the position and size (fullscreen windows are always at (0,0)).

const char *

Get the window's caption.

Get the Client Area Extent (Resolution) of this window.

CGDirectDisplayID

Return a pointer to the GFX device this window is bound to.

Return a pointer to this window's render target.

void *

Get the platform specific object needed to create or attach an accelerated graohics drawing context on or to the window Win32 D3D and OpenGL typically needs an HWND Mac Cocoa OpenGL typically needs an NSOpenGLView Mac Carbon OpenGL typically needs a WindowRef.

Get the position of this window.

Get our current video mode - if the window has been resized, it will reflect this.

Get the ID that uniquely identifies this window in the context of its window manager.

hide()

Hide the window on screen.

bool

Returns true if the window has input focus.

bool
bool

Returns true if the window is maximized.

bool

Returns true if the window is minimized.

bool

Is the mouse locked ?

bool

Returns true if the window is instantiated in the OS.

bool

Returns true if the window is visible.

Maximize the window on screen.

Minimize the window on screen.

Restore the window from a Maximized or Minimized state.

Convert the given screen coordinates to coordinates in this window space.

setBounds(const RectI & newBounds)

The bounds of a Window are defined as the entire area occupied by that Window.

bool
setCaption(const char * cap)

Set the window's caption.

The Client Rectangle or "Render Area" of a window is the area that is occupied by a given client that is rendering to that window.

setDisplay(CGDirectDisplayID display)

Set Focused State (Foreground)

setMouseLocked(bool enable)

Lock the mouse to this window.

setPosition(const Point2I newPosition)

The Position of a window is always in relation to the very upper left of the window.

bool
setSize(const Point2I & newSize)

Resize the window to have a new size (but be in the same position).

bool
setType(S32 windowType)
bool

Should the mouse be locked at the next opportunity ?

show()

Show the window on screen.

Public Static Functions

setSafariWindow(NSWindow * window, S32 x, S32 y, S32 width, S32 height)

Protected Functions

_setFullscreen(bool fullScreen)

Private Functions

MacWindow(U32 windowId, const char * windowText, Point2I clientExtent)
_initCocoaWindow(const char * windowText, Point2I clientExtent)

Detailed Description

Public Friends

Private Static Attributes

MacWindow * sInstance 
SafariWindowInfo * sSafariWindowInfo 

Private Attributes

NSWindow * mCocoaWindow 
GFXVideoMode mCurrentMode 
NSDictionary * mDefaultDisplayMode 
GFXDevice * mDevice 
CGDirectDisplayID mDisplay 
CGRect mDisplayBounds 
bool mFullscreen 
CGRect mMainDisplayBounds 
bool mMouseCaptured 
bool mMouseLocked 
MacWindow * mNextWindow 
MacWindowManager * mOwningWindowManager 
bool mShouldFullscreen 
bool mShouldMouseLock 
U32 mSkipMouseEvents 
GFXWindowTargetRef mTarget 
const char * mTitle 

Public Functions

~MacWindow()

_associateMouse()

_centerMouse()

_disassociateCocoaWindow()

_dissociateMouse()

_doMouseLockNow()

Does the work of actually locking or unlocking the mouse, based on the value of shouldLockMouse().

Disassociates the cursor movement from the mouse input and hides the mouse when locking. Re-associates cursor movement with mouse input and shows the mouse when unlocking.

Returns true if we locked or unlocked the mouse. Returns false if the mouse was already in the correct state.

_setVideoMode(const GFXVideoMode & mode)

Reimplemented from: PlatformWindow

_skipAnotherMouseEvent()

_skipNextMouseEvent()

_skippedMouseEvent()

centerWindow()

Reimplemented from: PlatformWindow

clearFocus()

clearFullscreen()

Reimplemented from: PlatformWindow

clientToScreen(const Point2I & point)

Reimplemented from: PlatformWindow

close()

Reimplemented from: PlatformWindow

getBounds()

Reimplemented from: PlatformWindow

getCaption()

Reimplemented from: PlatformWindow

getClientExtent()

Reimplemented from: PlatformWindow

getDisplay()

getDisplayBounds()

getGFXDevice()

Reimplemented from: PlatformWindow

getGFXTarget()

Reimplemented from: PlatformWindow

getMainDisplayBounds()

getNextWindow()

Reimplemented from: PlatformWindow

getPlatformDrawable()

Reimplemented from: PlatformWindow

getPosition()

Reimplemented from: PlatformWindow

getVideoMode()

Reimplemented from: PlatformWindow

getWindowId()

Reimplemented from: PlatformWindow

hide()

Reimplemented from: PlatformWindow

isFocused()

Reimplemented from: PlatformWindow

isFullscreen()

Reimplemented from: PlatformWindow

isMaximized()

Reimplemented from: PlatformWindow

isMinimized()

Reimplemented from: PlatformWindow

isMouseLocked()

Reimplemented from: PlatformWindow

isOpen()

Reimplemented from: PlatformWindow

isVisible()

Reimplemented from: PlatformWindow

maximize()

Reimplemented from: PlatformWindow

minimize()

Reimplemented from: PlatformWindow

restore()

Reimplemented from: PlatformWindow

screenToClient(const Point2I & point)

Reimplemented from: PlatformWindow

setBounds(const RectI & newBounds)

Reimplemented from: PlatformWindow

setCaption(const char * cap)

Reimplemented from: PlatformWindow

setClientExtent(const Point2I newExtent)

Reimplemented from: PlatformWindow

setDisplay(CGDirectDisplayID display)

setFocus()

Reimplemented from: PlatformWindow

setMouseLocked(bool enable)

Reimplemented from: PlatformWindow

setPosition(const Point2I newPosition)

Reimplemented from: PlatformWindow

setSize(const Point2I & newSize)

Reimplemented from: PlatformWindow

setType(S32 windowType)

shouldLockMouse()

Reimplemented from: PlatformWindow

show()

Reimplemented from: PlatformWindow

Public Static Functions

hideBrowserWindow(bool hide)

setSafariWindow(NSWindow * window, S32 x, S32 y, S32 width, S32 height)

Protected Functions

_setFullscreen(bool fullScreen)

Reimplemented from: PlatformWindow

Private Functions

MacWindow(U32 windowId, const char * windowText, Point2I clientExtent)

_initCocoaWindow(const char * windowText, Point2I clientExtent)

_onAppEvent(WindowId , S32 )

setWindowId(U32 newid)

signalGainFocus()