Gizmod::X11FocusWatcher Class Reference

Watches for focus changes on X11 windows. More...

#include <X11FocusWatcher.hpp>

Inheritance diagram for Gizmod::X11FocusWatcher:

Inheritance graph
[legend]
Collaboration diagram for Gizmod::X11FocusWatcher:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void init ()
 Initialize (create a thread and watch).
bool isApplicationRunning (std::string WindowTitle)
 Is an application running? (by window title).
virtual void onFocusIn (X11FocusEvent const &Event)
 Event triggered on a Focus In.
virtual void onFocusOut (X11FocusEvent const &Event)
 Event triggered on a Focus Out.
bool setInputFocus (std::string WindowTitle)
 Set the current input focus.
void shutdown ()
 Shutdown the thread that watches for focus changes.
 X11FocusWatcher ()
 X11FocusWatcher Default Constructor.
virtual ~X11FocusWatcher ()
 X11FocusWatcher Destructor.

Static Public Member Functions

static int x11ErrorHandler (Display *display, XErrorEvent *error)
 Error handler.
static int x11IOErrorHandler (Display *display)
 IO error handler.

Classes

struct  X11FocusWatcherThreadProc


Detailed Description

Watches for focus changes on X11 windows.

Definition at line 128 of file X11FocusWatcher.hpp.


Member Function Documentation

void X11FocusWatcher::init (  ) 

Initialize (create a thread and watch).

Initialize the focus watcher (create a new thread and start watching).

Definition at line 310 of file X11FocusWatcher.cpp.

bool X11FocusWatcher::isApplicationRunning ( std::string  WindowTitle  ) 

Is an application running? (by window title).

Test is an application is running by checking for its window title.

Parameters:
WindowTitle The title of the window to find
Note this opens a new display so that the focus watcher can remain using single threaded X11

Definition at line 323 of file X11FocusWatcher.cpp.

void X11FocusWatcher::onFocusIn ( X11FocusEvent const &  Event  )  [virtual]

Event triggered on a Focus In.

Parameters:
Event The Focus Event

Definition at line 360 of file X11FocusWatcher.cpp.

References cdbg, Gizmod::X11FocusEvent::WindowClass, Gizmod::X11FocusEvent::WindowName, and Gizmod::X11FocusEvent::WindowNameFormal.

void X11FocusWatcher::onFocusOut ( X11FocusEvent const &  Event  )  [virtual]

Event triggered on a Focus Out.

Event triggered on a Focus In.

Parameters:
Event The Focus Event

Definition at line 369 of file X11FocusWatcher.cpp.

References cdbg, Gizmod::X11FocusEvent::WindowClass, Gizmod::X11FocusEvent::WindowName, and Gizmod::X11FocusEvent::WindowNameFormal.

bool X11FocusWatcher::setInputFocus ( std::string  WindowTitle  ) 

Set the current input focus.

Sets the currently focused window.

Parameters:
WindowTitle The title of the window to raise
Note this opens a new display so that the focus watcher can remain using single threaded X11

Definition at line 454 of file X11FocusWatcher.cpp.

void X11FocusWatcher::shutdown (  ) 

Shutdown the thread that watches for focus changes.

Signal the watching thread to shut itself down.

Definition at line 481 of file X11FocusWatcher.cpp.

References cdbg5.

Referenced by ~X11FocusWatcher().

int X11FocusWatcher::x11ErrorHandler ( Display *  display,
XErrorEvent *  error 
) [static]

Error handler.

Handle X11 errors.

Definition at line 69 of file X11FocusWatcher.cpp.

int X11FocusWatcher::x11IOErrorHandler ( Display *  display  )  [static]

IO error handler.

Handle X11 IO errors.

Definition at line 77 of file X11FocusWatcher.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 10:07:09 2007 for gizmod by  doxygen 1.5.3