CL_DisplayWindow Class Reference
[clanDisplay Window]

Top-level window class. More...

#include <display_window.h>

List of all members.

Public Member Functions

Construction

 CL_DisplayWindow ()
 Constructs a null instance.
 CL_DisplayWindow (const CL_StringRef &title, int width, int height, bool start_fullscreen=false, bool allow_resize=false, int flipping_buffers=2, CL_DisplayTarget target=CL_DisplayTarget())
 Constructs a window.
 CL_DisplayWindow (const CL_DisplayWindowDescription &description, CL_DisplayTarget target=CL_DisplayTarget())
 Constructs a window.
 CL_DisplayWindow (CL_DisplayWindowProvider *provider)
 Constructs a window.
 ~CL_DisplayWindow ()
Attributes

CL_Rect get_geometry () const
 Returns the position and size of the window frame.
CL_Rect get_viewport () const
 Returns the drawable area of the window (excluding window frame).
bool is_fullscreen () const
 Returns true if window is currently running fullscreen.
bool has_focus () const
 Returns true if window has focus.
CL_GraphicContextget_gc () const
 Return the graphic context for the window.
CL_InputContextget_ic () const
 Return the input context for the window.
CL_Signal_v0sig_lost_focus ()
 Signal emitted when window lost focus.
CL_Signal_v0sig_got_focus ()
 Signal emitted when window gain focus.
CL_Signal_v2< int, int > & sig_resize ()
 Signal emitted when window is resized.
CL_Signal_v1< const CL_Rect & > & sig_paint ()
 Signal emitted when an area of the window is invalidated.
CL_Signal_v0sig_window_close ()
 Signal emitted when window is closed.
CL_Signal_v0sig_window_destroy ()
 Signal emitted when window is destroyed.
CL_Signal_v0sig_window_minimized ()
 Signal emitted when window is minimized.
CL_Signal_v0sig_window_maximized ()
 Signal emitted when window is maximized.
CL_Signal_v0sig_window_restored ()
 Signal emitted when window is restored.
CL_Signal_v0sig_window_moved ()
 Signal emitted after a window has been moved.
CL_Callback_v1< CL_Rect & > & func_window_resize ()
 Callback called when a window is being resized.
CL_Callback_0< bool > & func_minimize_clicked ()
 Callback called when a window is asked to minimize itself.
bool is_null () const
 Returns true if this object is invalid.
void throw_if_null () const
 Throw an exception if this object is invalid.
bool is_visible () const
 returns true if this display window is visible
bool is_minimized () const
 Returns true if the window is minimized.
bool is_maximized () const
 Returns true if the window is maximized.
CL_DisplayWindowProviderget_provider () const
 Returns the display window provider.
bool is_clipboard_text_available () const
 Returns true if text is available in the clipboard.
bool is_clipboard_image_available () const
 Returns true if an image is available in the clipboard.
CL_String get_clipboard_text () const
 Returns the text stored in the clipboard.
CL_PixelBuffer get_clipboard_image () const
 Returns an image stored in the clipboard.
CL_Size get_minimum_size (bool client_area=false)
 Returns the minimum size the window can be resized to by the application user.
CL_Size get_maximum_size (bool client_area=false)
 Returns the maximum size the window can be resized to by the application user.
CL_String get_title () const
 Returns the window title.
Display * get_display () const
 Returns the X11 display handle.
Window get_window () const
 Handle to X11 window handle.
Operations

CL_Point client_to_screen (const CL_Point &client)
 Convert from window client coordinates to screen coordinates.
CL_Point screen_to_client (const CL_Point &screen)
 Convert from screen coordinates to client coordinates.
void capture_mouse (bool capture)
 Capture/Release the mouse.
void request_repaint (const CL_Rect &rect)
 Invalidates a region of a screen, causing a repaint.
void set_title (const CL_StringRef &title)
 Change window title.
void set_position (const CL_Rect &pos, bool client_area)
 Set window position and size.
void set_position (int x, int y)
 Set window position and size.
void set_enabled (bool enable)
 Set enabled.
void set_visible (bool visible, bool activate)
 Set visible.
void set_size (int width, int height, bool client_area)
 Resize window.
void set_minimum_size (int width, int height, bool client_area)
 Minimum size a window can be resized to by the application user.
void set_maximum_size (int width, int height, bool client_area)
 Maximum size a window can be resized to by the application user.
void minimize ()
 Minimizes the window.
void restore ()
 Restores the window.
void maximize ()
 Maximizes the window.
void show (bool activate=true)
 Displays the window in its current size and position.
void hide ()
 Hides the window.
void bring_to_front ()
 Raises the window on top of other windows.
void update (const CL_Rect &rect)
 Copy the specified rectangle area from back buffer to front buffer.
void flip (int interval=-1)
 Flip back buffer to front, making changes visible on screen.
void show_cursor ()
 Shows the mouse cursor.
void set_cursor (const CL_Cursor &cursor)
 Sets the current cursor icon.
void set_cursor (CL_StandardCursor type)
 Set cursor.
void hide_cursor ()
 Hides the mouse cursor.
void set_clipboard_text (const CL_StringRef &text)
 Stores text in the clipboard.
void set_clipboard_image (const CL_PixelBuffer &buf)
 Stores an image in the clipboard.
void set_large_icon (const CL_PixelBuffer &image)
 Sets the large icon used for this window.
void set_small_icon (const CL_PixelBuffer &image)
 Sets the small icon used for this window.

Detailed Description

Top-level window class.


Constructor & Destructor Documentation

CL_DisplayWindow::CL_DisplayWindow (  ) 

Constructs a null instance.

CL_DisplayWindow::CL_DisplayWindow ( const CL_StringRef title,
int  width,
int  height,
bool  start_fullscreen = false,
bool  allow_resize = false,
int  flipping_buffers = 2,
CL_DisplayTarget  target = CL_DisplayTarget() 
)

Constructs a window.

Parameters:
title = Titlebar text.
width = Width in pixels of window.
height = Height in pixels of window.
start_fullscreen = If true, window will go fullscreen.
allow_resize = If true, window will have resize grabbers and can be resized.
flipping_buffers = Number of flipping buffers in system. Default is that there is a front buffer and a back buffer.
target = Display target used to create the window.
CL_DisplayWindow::CL_DisplayWindow ( const CL_DisplayWindowDescription description,
CL_DisplayTarget  target = CL_DisplayTarget() 
)

Constructs a window.

Parameters:
description = Structure that describes how to create the display window.
target = Display target used to create the window.
CL_DisplayWindow::CL_DisplayWindow ( CL_DisplayWindowProvider provider  ) 

Constructs a window.

Parameters:
provider = Display target implementation object.
CL_DisplayWindow::~CL_DisplayWindow (  ) 

Member Function Documentation

void CL_DisplayWindow::bring_to_front (  ) 

Raises the window on top of other windows.

void CL_DisplayWindow::capture_mouse ( bool  capture  ) 

Capture/Release the mouse.

CL_Point CL_DisplayWindow::client_to_screen ( const CL_Point client  ) 

Convert from window client coordinates to screen coordinates.

void CL_DisplayWindow::flip ( int  interval = -1  ) 

Flip back buffer to front, making changes visible on screen.

The parameter interval specifies the minimum number of video frames that are displayed before a buffer swap will occur.

If interval is set to a value of 0, buffer swaps are not synchronized to a video frame.

If interval is set to a value of -1 (the default), then it will use the buffer swap used for previous flip. If its the first flip, it will use the system default.

Parameters:
interval = See note
CL_Callback_0<bool>& CL_DisplayWindow::func_minimize_clicked (  ) 

Callback called when a window is asked to minimize itself.

CL_Callback_v1<CL_Rect &>& CL_DisplayWindow::func_window_resize (  ) 

Callback called when a window is being resized.

CL_PixelBuffer CL_DisplayWindow::get_clipboard_image (  )  const

Returns an image stored in the clipboard.

Returns a null pixelbuffer if no image is available.

CL_String CL_DisplayWindow::get_clipboard_text (  )  const

Returns the text stored in the clipboard.

Display* CL_DisplayWindow::get_display (  )  const

Returns the X11 display handle.

CL_GraphicContext& CL_DisplayWindow::get_gc (  )  const

Return the graphic context for the window.

CL_Rect CL_DisplayWindow::get_geometry (  )  const

Returns the position and size of the window frame.

CL_InputContext& CL_DisplayWindow::get_ic (  )  const

Return the input context for the window.

CL_Size CL_DisplayWindow::get_maximum_size ( bool  client_area = false  ) 

Returns the maximum size the window can be resized to by the application user.

CL_Size CL_DisplayWindow::get_minimum_size ( bool  client_area = false  ) 

Returns the minimum size the window can be resized to by the application user.

CL_DisplayWindowProvider* CL_DisplayWindow::get_provider (  )  const

Returns the display window provider.

CL_String CL_DisplayWindow::get_title (  )  const

Returns the window title.

CL_Rect CL_DisplayWindow::get_viewport (  )  const

Returns the drawable area of the window (excluding window frame).

Window CL_DisplayWindow::get_window (  )  const

Handle to X11 window handle.

bool CL_DisplayWindow::has_focus (  )  const

Returns true if window has focus.

void CL_DisplayWindow::hide (  ) 

Hides the window.

void CL_DisplayWindow::hide_cursor (  ) 

Hides the mouse cursor.

bool CL_DisplayWindow::is_clipboard_image_available (  )  const

Returns true if an image is available in the clipboard.

bool CL_DisplayWindow::is_clipboard_text_available (  )  const

Returns true if text is available in the clipboard.

bool CL_DisplayWindow::is_fullscreen (  )  const

Returns true if window is currently running fullscreen.

bool CL_DisplayWindow::is_maximized (  )  const

Returns true if the window is maximized.

bool CL_DisplayWindow::is_minimized (  )  const

Returns true if the window is minimized.

bool CL_DisplayWindow::is_null (  )  const [inline]

Returns true if this object is invalid.

bool CL_DisplayWindow::is_visible (  )  const

returns true if this display window is visible

void CL_DisplayWindow::maximize (  ) 

Maximizes the window.

void CL_DisplayWindow::minimize (  ) 

Minimizes the window.

void CL_DisplayWindow::request_repaint ( const CL_Rect rect  ) 

Invalidates a region of a screen, causing a repaint.

void CL_DisplayWindow::restore (  ) 

Restores the window.

CL_Point CL_DisplayWindow::screen_to_client ( const CL_Point screen  ) 

Convert from screen coordinates to client coordinates.

void CL_DisplayWindow::set_clipboard_image ( const CL_PixelBuffer buf  ) 

Stores an image in the clipboard.

void CL_DisplayWindow::set_clipboard_text ( const CL_StringRef text  ) 

Stores text in the clipboard.

void CL_DisplayWindow::set_cursor ( CL_StandardCursor  type  ) 

Set cursor.

Parameters:
type = Standard Cursor
void CL_DisplayWindow::set_cursor ( const CL_Cursor cursor  ) 

Sets the current cursor icon.

void CL_DisplayWindow::set_enabled ( bool  enable  ) 

Set enabled.

Parameters:
enable = bool
void CL_DisplayWindow::set_large_icon ( const CL_PixelBuffer image  ) 

Sets the large icon used for this window.

void CL_DisplayWindow::set_maximum_size ( int  width,
int  height,
bool  client_area 
)

Maximum size a window can be resized to by the application user.

void CL_DisplayWindow::set_minimum_size ( int  width,
int  height,
bool  client_area 
)

Minimum size a window can be resized to by the application user.

void CL_DisplayWindow::set_position ( const CL_Rect pos,
bool  client_area 
)

Set window position and size.

Parameters:
pos = Window position and size.
client_area = true - Position relative to window client area
void CL_DisplayWindow::set_position ( int  x,
int  y 
)

Set window position and size.

Parameters:
x Window x position on desktop.
y Window y position on desktop.
void CL_DisplayWindow::set_size ( int  width,
int  height,
bool  client_area 
)

Resize window.

Parameters:
width = New width of window in pixels.
height = New height of window in pixels.
client_area = true - relative to the window client area
void CL_DisplayWindow::set_small_icon ( const CL_PixelBuffer image  ) 

Sets the small icon used for this window.

void CL_DisplayWindow::set_title ( const CL_StringRef title  ) 

Change window title.

void CL_DisplayWindow::set_visible ( bool  visible,
bool  activate 
)

Set visible.

Parameters:
visible = bool
activate = bool
void CL_DisplayWindow::show ( bool  activate = true  ) 

Displays the window in its current size and position.

void CL_DisplayWindow::show_cursor (  ) 

Shows the mouse cursor.

CL_Signal_v0& CL_DisplayWindow::sig_got_focus (  ) 

Signal emitted when window gain focus.

CL_Signal_v0& CL_DisplayWindow::sig_lost_focus (  ) 

Signal emitted when window lost focus.

CL_Signal_v1<const CL_Rect &>& CL_DisplayWindow::sig_paint (  ) 

Signal emitted when an area of the window is invalidated.

CL_Signal_v2<int, int>& CL_DisplayWindow::sig_resize (  ) 

Signal emitted when window is resized.

CL_Signal_v0& CL_DisplayWindow::sig_window_close (  ) 

Signal emitted when window is closed.

CL_Signal_v0& CL_DisplayWindow::sig_window_destroy (  ) 

Signal emitted when window is destroyed.

CL_Signal_v0& CL_DisplayWindow::sig_window_maximized (  ) 

Signal emitted when window is maximized.

CL_Signal_v0& CL_DisplayWindow::sig_window_minimized (  ) 

Signal emitted when window is minimized.

CL_Signal_v0& CL_DisplayWindow::sig_window_moved (  ) 

Signal emitted after a window has been moved.

CL_Signal_v0& CL_DisplayWindow::sig_window_restored (  ) 

Signal emitted when window is restored.

void CL_DisplayWindow::throw_if_null (  )  const

Throw an exception if this object is invalid.

void CL_DisplayWindow::update ( const CL_Rect rect  ) 

Copy the specified rectangle area from back buffer to front buffer.

Parameters:
rect Area that should be copied.

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