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


Public Member Functions | Static Public Member Functions
Xfc::Gdk::Event Class Reference

The Event object represents a GdkEvent. More...

#include <xfc/gdk/events.hh>

Inheritance diagram for Xfc::Gdk::Event:
Xfc::G::Boxed Xfc::Object Xfc::Trackable Xfc::Gdk::EventAny Xfc::Gdk::EventButton Xfc::Gdk::EventClient Xfc::Gdk::EventConfigure Xfc::Gdk::EventCrossing Xfc::Gdk::EventDND Xfc::Gdk::EventExpose Xfc::Gdk::EventFocus Xfc::Gdk::EventKey Xfc::Gdk::EventMotion Xfc::Gdk::EventOwnerChange Xfc::Gdk::EventProperty Xfc::Gdk::EventProximity Xfc::Gdk::EventScroll Xfc::Gdk::EventSelection Xfc::Gdk::EventSetting Xfc::Gdk::EventVisibility Xfc::Gdk::EventWindowState

List of all members.

Public Member Functions

Constructors

Static Public Member Functions


Detailed Description

The Event object represents a GdkEvent.

Event is the base class from which all event objects are derived. Event doesn't have a virtual destructor because it's not meant to be used to derive suclasses, other than the ones derived by XFC.


Constructor & Destructor Documentation

Xfc::Gdk::Event::Event ( EventType  type) [explicit]

Construct a new event of the specified type.

Parameters:
typeThe EventType.
Xfc::Gdk::Event::Event ( GdkEvent *  event) [explicit]

Construct a new event from an existing GdkEvent.

Parameters:
eventA pointer to a GdkEvent.

The event can be a newly created GdkEvent or an existing GdkEvent. The Event object created is a temporary object. It doesn't take over the ownership of GdkEvent and GdkEvent is not freed by the destructor.

Xfc::Gdk::Event::Event ( GdkEvent *  event,
bool  copy 
)

Construct a new event from an existing GdkEvent.

Parameters:
eventA pointer to a GdkEvent.
copyWhether the Color object should make a copy of GdkEvent or not.

The event can be a newly created GdkEvent or an existing GdkEvent. If copy is true Event will make a copy of GdkEvent. If copy is false Event wont make a copy but instead takes over the ownership of GdkEvent. Either way, the destructor will free GdkEvent when the Event object is destroyed. This constructor is used by G::Boxed::wrap() to wrap GdkEvent objects in a C++ wrapper.

Xfc::Gdk::Event::Event ( const Event src)

Copy constructor.

Parameters:
srcThe source event.

Member Function Documentation

If this is a "button-press" or "button-release" event, returns a pointer to the EventButton, otherwise returns null.

Reimplemented in Xfc::Gdk::EventButton.

If this is a "client" event, returns a pointer to the EventClient, otherwise returns null.

If this is a "configure" event, returns a pointer to the EventConfigure, otherwise returns null.

If this is an "enter-notify" or "leave-notify" event, returns a pointer to the EventCrossing, otherwise returns null.

If this is an "drag" or "drop" event, returns a pointer to the EventDND, otherwise returns null.

If this is a "focus-change" event, returns a pointer to the EventFocus, otherwise returns null.

static Pointer<Event> Xfc::Gdk::Event::get ( ) [static]

Checks all open displays for an event to process, fetching events from the windowing system if necessary (see Gdk::Display::get_event()).

Returns:
A smart pointer to the next event to be processed, or null if no events are pending.
bool Xfc::Gdk::Event::get_axis ( AxisUse  axis_use,
double *  value 
) const

Extract the axis value for a particular axis use from an event structure.

Parameters:
axis_useThe axis use to look for.
valueThe location to store the value found.
Returns:
true if the specified axis was found, otherwise false.
bool Xfc::Gdk::Event::get_coords ( double *  x_win,
double *  y_win 
) const

Extract the event window relative x/y coordinates from the event.

Parameters:
x_winThe location to put event window x coordinate.
y_winThe location to put event window y coordinate.
Returns:
true if the event delivered event window coordinates.
static Pointer<EventExpose> Xfc::Gdk::Event::get_graphics_expose ( const Window window) [static]

Waits for a GraphicsExpose or NoExpose event from the X server.

Returns:
An EventExpose if a GraphicsExpose event was received, or null if a NoExpose event was received.

This is used in the GtkText widget in GTK+ to make sure any GraphicsExpose events are handled before the widget is scrolled.

bool Xfc::Gdk::Event::get_root_coords ( double *  x_root,
double *  y_root 
) const

Extract the root window relative x/y coordinates from the event.

Parameters:
x_rootThe location to put root window x coordinate.
y_rootThe location to put root window y coordinate.
Returns:
true if the event delivered root window coordinates.

Returns the screen for the event.

Returns:
The Screen for the event.

The screen is typically the screen for any()->window(), but for events such as mouse events, it is the screen where the the pointer was when the event occurs. That is, the screen which has the root window to which motion()->x_root and motion()->y_root are relative.

If the event contains a "state" field, puts that field in state; otherwise stores an empty state (0).

Parameters:
stateThe return location for the state.
Returns:
true if there was a state field in the event.

The event may be null, in which case it's treated as if the event had no state field.

unsigned int Xfc::Gdk::Event::get_time ( ) const

Returns the time stamp of the event, if there is one; otherwise returns GDK_CURRENT_TIME.

Returns:
The time stamp field from the event.

If event is null, returns GDK_CURRENT_TIME.

If this is a "key-press" or "key-release" event, returns a pointer to the EventKey, otherwise returns null.

If this is a "motion-notify" event, returns a pointer to the EventMotion, otherwise returns null.

Event& Xfc::Gdk::Event::operator= ( const Event src)

Assignment operator.

Parameters:
srcThe source event.

If this is an "owner_change" event, returns a pointer to the EventOwnerChange, otherwise returns null.

static Pointer<Event> Xfc::Gdk::Event::peek ( ) [static]

If there is an event waiting in the event queue of some open display, returns a wrapped copy of it (see Gdk::Display::peek_event()).

Returns:
A smart pointer to a newly allocated Event, or null if no events are in any queues.

If this is a "property-notify" event, returns a pointer to the EventProperty, otherwise returns null.

Reimplemented in Xfc::Gdk::EventSelection.

If this is an "proximity-in" or "proximity-out" event, returns a pointer to the EventProximity, otherwise returns null.

Appends a copy of this event onto the front of the event queue for any()->window()'s display, or the default event queue if any()->window() is null (see Gdk::Display::put_event()).

If this is a "scroll" event, returns a pointer to the EventScroll, otherwise returns null.

If this is a "selection" event, returns a pointer to the EventSelection, otherwise returns null.

Reimplemented in Xfc::Gdk::EventOwnerChange, and Xfc::Gdk::EventSelection.

bool Xfc::Gdk::Event::send_client_message ( GdkNativeWindow  winid,
const Display display = 0 
)

Sends an X ClientMessage event to a given window.

Parameters:
displayThe Display for the window where the message is to be sent, or null for the default display.
winidThe window to send the X ClientMessage event to.
Returns:
true on success, false on failure or if the event is not an EventClient.

This could be used for communicating between different applications, though the amount of data is limited to 20 bytes. If display is null the given window must be on the default Display.

Sends an X ClientMessage event to all toplevel windows on the default Screen.

Toplevel windows are determined by checking for the WM_STATE property, as described in the Inter-Client Communication Conventions Manual (ICCCM). If no windows are found with the WM_STATE property set, the message is sent to all children of the root window.

Note: This method does nothing if the event is not an EventClient.

void Xfc::Gdk::Event::set_screen ( Screen screen)

Sets the screen for event to screen.

The event must have been allocated by GTK+.

Parameters:
screenA Screen.

If this is a "setting" event, returns a pointer to the EventSetting, otherwise returns null.

If this is a "visibility-notify" event, returns a pointer to the EventVisibility, otherwise returns null.

If this is a "window-state" event, returns a pointer to the EventWindowState, otherwise returns null.


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