Blender V2.61 - r43446
Public Member Functions | Public Attributes | Protected Member Functions

GHOST_WindowX11 Class Reference

#include <GHOST_WindowX11.h>

Inheritance diagram for GHOST_WindowX11:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 GHOST_WindowX11 (GHOST_SystemX11 *system, Display *display, const STR_String &title, GHOST_TInt32 left, GHOST_TInt32 top, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, const GHOST_TEmbedderWindowID parentWindow, GHOST_TDrawingContextType type=GHOST_kDrawingContextTypeNone, const bool stereoVisual=false, const GHOST_TUns16 numOfAASamples=0)
bool getValid () const
void setTitle (const STR_String &title)
void getTitle (STR_String &title) 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)
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_TWindowState getState () const
GHOST_TSuccess setState (GHOST_TWindowState state)
GHOST_TSuccess setOrder (GHOST_TWindowOrder order)
GHOST_TSuccess swapBuffers ()
GHOST_TSuccess activateDrawingContext ()
GHOST_TSuccess invalidate ()
 ~GHOST_WindowX11 ()
void validate ()
Window getXWindow ()
const GHOST_TabletDataGetTabletData ()

Public Attributes

bool m_post_init
GHOST_TWindowState m_post_state

Protected Member Functions

GHOST_TSuccess installDrawingContext (GHOST_TDrawingContextType type)
GHOST_TSuccess removeDrawingContext ()
GHOST_TSuccess setWindowCursorVisibility (bool visible)
GHOST_TSuccess setWindowCursorGrab (GHOST_TGrabCursorMode mode)
GHOST_TGrabCursorMode getWindowCursorGrab () const
GHOST_TSuccess setWindowCursorShape (GHOST_TStandardCursor shape)
GHOST_TSuccess setWindowCustomCursorShape (GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY)
GHOST_TSuccess setWindowCustomCursorShape (GHOST_TUns8 *bitmap, GHOST_TUns8 *mask, int sizex, int sizey, int hotX, int hotY, int fg_color, int bg_color)

Detailed Description

X11 implementation of GHOST_IWindow. Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

Author:
Laurence Bourn
Date:
October 26, 2001

Definition at line 56 of file GHOST_WindowX11.h.


Constructor & Destructor Documentation

GHOST_WindowX11::GHOST_WindowX11 ( GHOST_SystemX11 system,
Display *  display,
const STR_String title,
GHOST_TInt32  left,
GHOST_TInt32  top,
GHOST_TUns32  width,
GHOST_TUns32  height,
GHOST_TWindowState  state,
const GHOST_TEmbedderWindowID  parentWindow,
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.

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.
parentWindowParent (embedder) window
typeThe type of drawing context installed in this window.
stereoVisualStereo visual for quad buffered stereo.
numOfAASamplesNumber of samples used for AA (zero if no AA)

Definition at line 152 of file GHOST_WindowX11.cpp.

References BLENDER_ICON_48x48x24, BLENDER_ICON_HEIGHT, BLENDER_ICON_WIDTH, addon::engine::free(), GHOST_kSuccess, GHOST_kWindowStateMinimized, GHOST_kWindowStateNormal, GHOST_PRINT, i, installDrawingContext(), left(), len(), STR_String::Length(), GHOST_SystemX11::m_delete_window_atom, GHOST_Window::m_numOfAASamples, m_post_init, m_post_state, GHOST_Window::m_stereoVisual, GHOST_SystemX11::m_wm_protocols, GHOST_SystemX11::m_wm_take_focus, None, NULL, setTitle(), and state.

GHOST_WindowX11::~GHOST_WindowX11 ( )

Destructor. Closes the window and disposes resources allocated.

Definition at line 1272 of file GHOST_WindowX11.cpp.

References None, and s_firstContext.


Member Function Documentation

GHOST_TSuccess GHOST_WindowX11::activateDrawingContext ( ) [virtual]

Activates the drawing context of this window.

Returns:
A boolean success indicator.

Implements GHOST_IWindow.

Definition at line 1218 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, and NULL.

void GHOST_WindowX11::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 821 of file GHOST_WindowX11.cpp.

Referenced by getClientBounds().

void GHOST_WindowX11::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 731 of file GHOST_WindowX11.cpp.

References clientToScreen(), GHOST_Rect::m_b, GHOST_Rect::m_l, GHOST_Rect::m_r, and GHOST_Rect::m_t.

Referenced by getWindowBounds().

GHOST_TWindowState GHOST_WindowX11::getState ( ) const [virtual]

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

Returns:
The state of the window.

Implements GHOST_IWindow.

Definition at line 1035 of file GHOST_WindowX11.cpp.

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

Referenced by setState().

const GHOST_TabletData* GHOST_WindowX11::GetTabletData ( ) [inline, virtual]

Returns the tablet data (pressure etc).

Returns:
The tablet data (pressure etc).

Implements GHOST_IWindow.

Definition at line 219 of file GHOST_WindowX11.h.

References NULL.

void GHOST_WindowX11::getTitle ( STR_String title) const [virtual]

Returns the title displayed in the title bar.

Parameters:
titleThe title displayed in the title bar.

Implements GHOST_IWindow.

Definition at line 709 of file GHOST_WindowX11.cpp.

References NULL.

bool GHOST_WindowX11::getValid ( ) const [virtual]

Returns indication as to whether the window is valid.

Returns:
The validity of the window.

Implements GHOST_IWindow.

Definition at line 683 of file GHOST_WindowX11.cpp.

Referenced by GHOST_SystemX11::createWindow().

void GHOST_WindowX11::getWindowBounds ( GHOST_Rect bounds) const [virtual]

Returns the window rectangle dimensions. These are screen coordinates.

Parameters:
boundsThe bounding rectangle of the window.

Implements GHOST_IWindow.

Definition at line 721 of file GHOST_WindowX11.cpp.

References getClientBounds().

GHOST_TGrabCursorMode GHOST_WindowX11::getWindowCursorGrab ( ) const [protected]
Window GHOST_WindowX11::getXWindow ( )

Return a handle to the x11 window type.

Definition at line 676 of file GHOST_WindowX11.cpp.

Referenced by GHOST_SystemX11::getClipboard(), GHOST_SystemX11::getClipboard_xcout(), and GHOST_SystemX11::putClipboard().

GHOST_TSuccess GHOST_WindowX11::installDrawingContext ( GHOST_TDrawingContextType  type) [protected, virtual]

Tries to install a rendering context in this window.

Parameters:
typeThe type of rendering context installed.
Returns:
Indication as to whether installation has succeeded.

Implements GHOST_Window.

Definition at line 1336 of file GHOST_WindowX11.cpp.

References GHOST_kDrawingContextTypeNone, GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, GHOST_kSuccess, NULL, and s_firstContext.

Referenced by GHOST_WindowX11().

GHOST_TSuccess GHOST_WindowX11::invalidate ( ) [virtual]

Invalidates the contents of this window.

Returns:
Indication of success.

Implements GHOST_IWindow.

Definition at line 1229 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::removeDrawingContext ( ) [protected, virtual]

Removes the current drawing context.

Returns:
Indication as to whether removal has succeeded.

Implements GHOST_Window.

Definition at line 1376 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, and NULL.

void GHOST_WindowX11::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 794 of file GHOST_WindowX11.cpp.

GHOST_TSuccess GHOST_WindowX11::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 766 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::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 779 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::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 753 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::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 1148 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, GHOST_kWindowOrderBottom, GHOST_kWindowOrderTop, None, and MakeCursor::root.

GHOST_TSuccess GHOST_WindowX11::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 1057 of file GHOST_WindowX11.cpp.

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

void GHOST_WindowX11::setTitle ( const STR_String 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 690 of file GHOST_WindowX11.cpp.

References STR_String::Length(), and STR_String::ReadPtr().

Referenced by GHOST_WindowX11().

GHOST_TSuccess GHOST_WindowX11::setWindowCursorGrab ( GHOST_TGrabCursorMode  mode) [protected, virtual]

Sets the cursor grab on the window using native window system calls.

Parameters:
warpOnly used when grab is enabled, hides the mouse and allows gragging outside the screen.

Reimplemented from GHOST_Window.

Definition at line 1485 of file GHOST_WindowX11.cpp.

References GHOST_kGrabDisable, GHOST_kGrabHide, GHOST_kGrabNormal, GHOST_kSuccess, and None.

GHOST_TSuccess GHOST_WindowX11::setWindowCursorShape ( GHOST_TStandardCursor  shape) [protected, virtual]

Sets the cursor shape on the window using native window system calls.

Implements GHOST_Window.

Definition at line 1530 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::setWindowCursorVisibility ( bool  visible) [protected, virtual]

Sets the cursor visibility on the window using native window system calls.

Implements GHOST_Window.

Definition at line 1466 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::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 1543 of file GHOST_WindowX11.cpp.

References GHOST_kSuccess.

GHOST_TSuccess GHOST_WindowX11::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 (Arbitrary size/color).

Implements GHOST_Window.

Definition at line 1557 of file GHOST_WindowX11.cpp.

References GHOST_kFailure, GHOST_kSuccess, and L.

GHOST_TSuccess GHOST_WindowX11::swapBuffers ( ) [virtual]

Swaps front and back buffers of a window.

Returns:
A boolean success indicator.

Implements GHOST_IWindow.

Definition at line 1206 of file GHOST_WindowX11.cpp.

References GHOST_kDrawingContextTypeOpenGL, GHOST_kFailure, and GHOST_kSuccess.

void GHOST_WindowX11::validate ( )

X11 system specific calls

The reverse of invalidate! Tells this window that all events for it have been pushed into the GHOST event queue.

called by the X11 system implementation when expose events for the window have been pushed onto the GHOST queue

Definition at line 1260 of file GHOST_WindowX11.cpp.


Member Data Documentation

Definition at line 232 of file GHOST_WindowX11.h.

Referenced by GHOST_WindowX11().

Definition at line 233 of file GHOST_WindowX11.h.

Referenced by GHOST_WindowX11().


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