Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gdk::Display Class Reference

A GdkDisplay C++ wrapper class. More...

#include <xfc/gdk/display.hh>

Inheritance diagram for Xfc::Gdk::Display:

Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable List of all members.

Signal Prototypes

Public Member Functions

Accessors
Methods
Signal Proxies

Static Public Member Functions

Accessors
Methods

Detailed Description

A GdkDisplay C++ wrapper class.

The purpose of Display objects are two fold:

Display objects are the GDK representation of the X Display which can be described as a workstation consisting of a keyboard, a pointing device (such as a mouse) and one or more screens. It is used to open and keep track of various Screen objects currently instantiated by the application. It is also used to grab and release the keyboard and mouse pointer.


Constructor & Destructor Documentation

Xfc::Gdk::Display::Display ( GdkDisplay *  display,
bool  owns_reference = true 
) [explicit, protected]

Construct a new Display from an existing GdkDisplay.

Parameters:
display A pointer to a GdkDisplay.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The display can be a newly created GdkDisplay or an existing GdkDisplay. (see G::Object::Object).

Xfc::Gdk::Display::Display ( GdkDisplay *  display,
bool  owns_reference = true 
) [explicit, protected]

Construct a new Display from an existing GdkDisplay.

Parameters:
display A pointer to a GdkDisplay.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The display can be a newly created GdkDisplay or an existing GdkDisplay. (see G::Object::Object).


Member Function Documentation

String Xfc::Gdk::Display::get_name (  )  const

Gets the name of the display.

Returns:
A String representing the display name.

int Xfc::Gdk::Display::get_n_screens (  )  const

Gets the number of screen managed by the display.

Returns:
The number of screens.

Screen* Xfc::Gdk::Display::get_screen ( int  screen_num  )  const

Returns a screen object for one of the screens of the display.

Parameters:
screen_num The screen number.
Returns:
The Screen object.

Screen* Xfc::Gdk::Display::get_default_screen (  )  const

Get the default screen for the display.

Returns:
The default Screen object for the display.

bool Xfc::Gdk::Display::pointer_is_grabbed (  )  const

Test if the pointer is grabbed.

Returns:
true if an active X pointer grab is in effect

bool Xfc::Gdk::Display::list_devices ( std::vector< Device * > &  devices  )  const

Returns the list of available input devices attached to the display.

Parameters:
devices A reference to a vector of Device* to hold the list of devices.
Returns:
true if the vector is not empty.
The devices in this list are statically allocated and will be freed by GTK+.

Device* Xfc::Gdk::Display::get_core_pointer (  )  const

Returns the core pointer device for the given display.

Returns:
The core pointer device; this is owned by the display and must not be unreferenced.

void Xfc::Gdk::Display::get_pointer ( Screen **  screen,
int *  x,
int *  y,
ModifierType mask = 0 
) const

Gets the current location of the pointer and the current modifier mask for the display.

Parameters:
screen The location to store the screen that the cursor is on, or null.
x The location to store root window X coordinate of pointer, or null.
y The location to store root window Y coordinate of pointer, or null.
mask The location to store current modifier mask, or null.

void Xfc::Gdk::Display::get_pointer ( Screen **  screen,
Point point,
ModifierType mask = 0 
) const

Gets the current location of the pointer and the current modifier mask for the display.

Parameters:
screen The location to store the screen that the cursor is on, or null.
point The location to store root window X and Y coordinates of the pointer, or null.
mask The location to store current modifier mask, or null.

Point Xfc::Gdk::Display::get_pointer ( Screen **  screen = 0,
ModifierType mask = 0 
) const

Gets the current location of the pointer and the current modifier mask for the display.

Parameters:
screen The location to store the screen that the cursor is on, or null.
mask The location to store current modifier mask, or null.
Returns:
A Point storing root window X and Y coordinates of the pointer.

Window* Xfc::Gdk::Display::get_window_at_pointer ( int *  win_x,
int *  win_y 
) const

Obtains the window underneath the mouse pointer, returning the location of that window in win_x, win_y for the screen.

Parameters:
win_x The return location for the X origin of the window under the pointer.
win_y The return location for the Y origin of the window under the pointer.
Returns:
The window under the mouse pointer, or null.
Returns null if the window under the mouse pointer is not known to GDK (for example, belongs to another application).

Window* Xfc::Gdk::Display::get_window_at_pointer ( Point win_origin  )  const

Obtains the window underneath the mouse pointer, returning the location of that window in win_origin for the screen.

Parameters:
win_origin The return location for the X and Y origin of the window under the pointer.
Returns:
The window under the mouse pointer, or null.
Returns null if the window under the mouse pointer is not known to GDK (for example, belongs to another application).

bool Xfc::Gdk::Display::supports_cursor_alpha (  )  const

Determines if cursors can use an 8bit alpha channel on display, otherwise, cursors are restricted to bilevel alpha (i.e.

a mask).

Returns:
true if cursors can have alpha channels.

bool Xfc::Gdk::Display::supports_cursor_color (  )  const

Determines if multicolored cursors are supported on display.

Returns:
true if cursors can have multiple colors.
If multicolored cursors not supported cursors have only a forground and a background color.

unsigned int Xfc::Gdk::Display::get_default_cursor_size (  )  const

Gets the default size to use for cursors on the display.

Returns:
The default cursor size.

void Xfc::Gdk::Display::get_maximal_cursor_size ( unsigned int *  width,
unsigned int *  height 
) const

Gets the maximal size to use for cursors on the display.

Parameters:
width The return location for the maximal cursor width.
height The return location for the maximal cursor height.

Window* Xfc::Gdk::Display::get_default_group (  )  const

Gets the default group leader window for all toplevel windows on display.

Returns:
The default group leader window for the display.
This window is implicitly created by GDK (see Gdk::Window::set_group()).

bool Xfc::Gdk::Display::supports_selection_notification (  )  const

Determines whether Gdk::EventOwnerChange events will be sent when the owner of a selection changes.

Returns:
Whether Gdk::EventOwnerChange events will be sent.

bool Xfc::Gdk::Display::supports_clipboard_persistence (  )  const

Determines whether the speicifed display supports clipboard persistance.

Returns:
true if the display supports clipboard persistance.
Persistance means if it's possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is running.

static Display* Xfc::Gdk::Display::get_default (  )  [static]

Gets the default display.

Returns:
The default Display, or null if there is no default display.

void Xfc::Gdk::Display::pointer_ungrab ( unsigned int  time = GDK_CURRENT_TIME  ) 

Release any pointer grab.

Parameters:
time A timestap (e.g. GDK_CURRENT_TIME).

void Xfc::Gdk::Display::keyboard_ungrab ( unsigned int  time = GDK_CURRENT_TIME  ) 

Release any keyboard grab.

Parameters:
time A timestap (e.g. GDK_CURRENT_TIME).

void Xfc::Gdk::Display::sync (  ) 

Flushes any requests queued for the windowing system and waits until all requests have been handled.

This is often used for making sure that the display is synchronized with the current state of the program. Calling sync() before gdk_error_trap_pop() makes sure that any errors generated from earlier requests are handled before the error trap is removed. This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

void Xfc::Gdk::Display::flush (  ) 

Flushes any requests queued for the windowing system.

This happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this function explicitely. A common case where this function needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.

This method is most useful for X11. On windowing systems where requests are handled synchronously, this method will do nothing.

Pointer<Event> Xfc::Gdk::Display::get_event (  ) 

Gets the next GdkEvent to be processed for display, fetching events from the windowing system if necessary.

Returns:
The next GdkEvent to be processed, or null if no events are pending.

Pointer<Event> Xfc::Gdk::Display::peek_event (  ) 

Gets a copy of the first GdkEvent in the display's event queue, without removing the event from the queue.

Returns:
A copy of the first GdkEvent on the event queue, or null if no events are in the queue.
This method will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.

void Xfc::Gdk::Display::put_event ( const Gdk::Event event  ) 

Appends a copy of the given event onto the front of the event queue for display.

Parameters:
event A GdkEvent.

void Xfc::Gdk::Display::add_client_message_filter ( Atom  message_type,
GdkFilterFunc  func,
void *  data 
)

Adds a filter to be called when X ClientMessage events are received.

Parameters:
message_type The type of ClientMessage events to receive; This will be checked against the message_type field of the XClientMessage event struct.
func The function to call to process the event.
data User data to pass to func.

void Xfc::Gdk::Display::set_double_click_time ( unsigned int  msec  ) 

Sets the double click time (two clicks within this time interval count as a double click and result in a GDK_2BUTTON_PRESS event).

Parameters:
msec The double click time in milliseconds (thousandths of a second).
Applications should NOT set this, it is a global user-configured setting.

void Xfc::Gdk::Display::set_double_click_distance ( unsigned int  distance  ) 

Sets the double click distance (two clicks within this distance count as a double click and result in a GDK_2BUTTON_PRESS event).

Parameters:
distance The distance in pixels.
Applications should not set this, it is a global user-configured setting.

bool Xfc::Gdk::Display::request_selection_notification ( Atom  selection  ) 

Request Gdk::EventOwnerChange events for ownership changes of the selection named by the given atom.

Parameters:
selection The Gdk::Atom naming the selection for which ownership change notification is requested.
Returns:
Whether GdkEventOwnerChange events will be sent.

void Xfc::Gdk::Display::store_clipboard ( Window clipboard_window,
unsigned int  time 
)

Issues a request to the the clipboard manager to store the clipboard data for all available targets.

Parameters:
clipboard_window A Gdk::Window belonging to the clipboard owner.
time A timestamp.
On X11, this is a special program that works according to the freedesktop clipboard specification, available at freedesktop.org.

void Xfc::Gdk::Display::store_clipboard ( Window clipboard_window,
unsigned int  time,
const std::vector< Atom targets 
)

Issues a request to the the clipboard manager to store the clipboard data.

Parameters:
clipboard_window A Gdk::Window belonging to the clipboard owner.
time A timestamp.
targets A vector of Gdk::Atom containing the targets that should be saved.
On X11, this is a special program that works according to the freedesktop clipboard specification, available at freedesktop.org.

static Display* Xfc::Gdk::Display::open ( const String display_name  )  [static]

Opens a display.

Parameters:
display_name The name of the display to open.
Returns:
A Display, or null if the display could not be opened.


Member Data Documentation

const ClosedSignalType Xfc::Gdk::Display::closed_signal [static, protected]

Closed signal (see signal_closed()).

Calls a slot with the signature:

< void function(bool is_error);
< // is_error: Is true if the display was closed due to an error.
<


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3