GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gdk::Display Class Reference

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

#include <gfc/gdk/display.hh>

Inheritance diagram for GFC::Gdk::Display:

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

Signal Prototypes

Public Member Functions

Constructors
Accessors
Methods
Signal Proxies

Static Public Member Functions

Protected Member Functions

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

GFC::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

void GFC::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 GFC::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.

Device* GFC::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.

Display* GFC::Gdk::Display::get_default  )  [static]
 

Gets the default display.

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

unsigned int GFC::Gdk::Display::get_default_cursor_size  )  const
 

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

Returns:
The default cursor size.

Window* GFC::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()).

Screen* GFC::Gdk::Display::get_default_screen  )  const
 

Get the default screen for the display.

Returns:
The default Screen object for the display.

Pointer<Event> GFC::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.

void GFC::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.

int GFC::Gdk::Display::get_n_screens  )  const
 

Gets the number of screen managed by the display.

Returns:
The number of screens.

String GFC::Gdk::Display::get_name  )  const
 

Gets the name of the display.

Returns:
A String representing the display name.

Point GFC::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.

void GFC::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.

void GFC::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.

Screen* GFC::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.

Window* GFC::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).

Window* GFC::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).

void GFC::Gdk::Display::keyboard_ungrab unsigned int  time  ) 
 

Release any keyboard grab.

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

bool GFC::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+.

Display* GFC::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.

Pointer<Event> GFC::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.

bool GFC::Gdk::Display::pointer_is_grabbed  )  const
 

Test if the pointer is grabbed.

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

void GFC::Gdk::Display::pointer_ungrab unsigned int  time  ) 
 

Release any pointer grab.

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

void GFC::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 GFC::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.

void GFC::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.

bool GFC::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 GFC::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.

void GFC::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.


Member Data Documentation

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

Closed signal (see sig_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:
Generated on Tue Aug 24 00:34:35 2004 for GFC-UI by doxygen 1.3.8