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


Public Member Functions | Static Public Member Functions | Static Protected Attributes
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.

Public Member Functions

Static Public Member Functions

Static Protected Attributes

Constructors


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:
displayA pointer to a GdkDisplay.
owns_referenceSet 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

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_typeThe type of ClientMessage events to receive; This will be checked against the message_type field of the XClientMessage event struct.
funcThe function to call to process the event.
dataUser data to pass to func.

Closes the connection windowing system for the display, and cleans up associated resources.

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.

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.

Gets the default display.

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

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

Returns:
The default cursor size.

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()).

Get the default screen for the display.

Returns:
The default Screen object for the display.

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.
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:
widthThe return location for the maximal cursor width.
heightThe return location for the maximal cursor height.

Gets the number of screen managed by the display.

Returns:
The number of screens.

Gets the name of the display.

Returns:
A String representing the display name.
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:
screenThe location to store the screen that the cursor is on, or null.
xThe location to store root window X coordinate of pointer, or null.
yThe location to store root window Y coordinate of pointer, or null.
maskThe 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:
screenThe location to store the screen that the cursor is on, or null.
pointThe location to store root window X and Y coordinates of the pointer, or null.
maskThe 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:
screenThe location to store the screen that the cursor is on, or null.
maskThe location to store current modifier mask, or null.
Returns:
A Point storing root window X and Y coordinates of the pointer.
Screen* Xfc::Gdk::Display::get_screen ( int  screen_num) const

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

Parameters:
screen_numThe screen number.
Returns:
The Screen object.
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_xThe return location for the X origin of the window under the pointer.
win_yThe 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).

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

Parameters:
win_originThe 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).

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

Release any keyboard grab.

Parameters:
timeA timestap (e.g. GDK_CURRENT_TIME).
bool Xfc::Gdk::Display::list_devices ( std::vector< Device * > &  devices) const

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

Parameters:
devicesA 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+.

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

Opens a display.

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

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.

Test if the pointer is grabbed.

Returns:
true if an active X pointer grab is in effect
void Xfc::Gdk::Display::pointer_ungrab ( unsigned int  time = GDK_CURRENT_TIME)

Release any pointer grab.

Parameters:
timeA timestap (e.g. GDK_CURRENT_TIME).
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:
eventA GdkEvent.

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

Parameters:
selectionThe Gdk::Atom naming the selection for which ownership change notification is requested.
Returns:
Whether GdkEventOwnerChange events will be sent.
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:
distanceThe distance in pixels.

Applications should not set this, it is a global user-configured setting.

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:
msecThe 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::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_windowA Gdk::Window belonging to the clipboard owner.
timeA 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_windowA Gdk::Window belonging to the clipboard owner.
timeA timestamp.
targetsA 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.

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.

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.

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.

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

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

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.


Member Data Documentation

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