Main Page | Class List | File List | Class Members | File Members | Related Pages

Handler Class Reference

#include <handler.h>

Collaboration diagram for Handler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Handler (Window w=0, Manager *parent=0, const char *name=0)
 ~Handler ()
void handleConfigureRequest (XConfigureRequestEvent *)
void handleMapRequest (XMapRequestEvent *)
void handlePropertyChange (XPropertyEvent *)

Public Attributes

QRect clientGeometry

Private Types

enum  states {
  sEmpty = 0, sModal = 1, sSticky = 1 << 1, smaxVert = 1 << 2,
  smaxHorz = 1 << 3, sShaded = 1 << 4, sSkipTaskbar = 1 << 5, sSkipPager = 1 << 6
}

Private Member Functions

void setupClient ()
void createFrame ()
void getXClientName ()
void initPosition ()
void fixupPositionBasedOnStruts (Strut *)
bool getExtendedWMHintString (Atom, char **)
void getExtendedNetWMStates ()
void * getExtendedNetPropertyData (Window, Atom, Atom, int *)
void setWMState (int state)
long getWMState ()
void setExtendedWMState ()
void gravitate (int)
void reparent ()
int titleHeight ()
void unhide ()

Private Attributes

Window clientId
ManagerParent
Display * dpy
border clientBorder
QRect handlerGeometry
QRect desktopRect
QRect oldClientGeometry
QString title
QString clientName
Frameframe
int titleBarHeight
bool hasNetName
bool hasTitle
int ignoreUnmap
Window transFor
XSizeHints * size
Colormap cmap
int winState

Detailed Description

Here is where a client window is handled. This class is derived from QObject, as it should be able to use Qt's signals and slots.
At the time the c'tor is invoked, it is not clear if this window is to get any decorations. That is one of the reasons I didn't derive from QWidget.


Member Enumeration Documentation

enum Handler::states [private]
 

Enumeration values:
sEmpty 
sModal 
sSticky 
smaxVert 
smaxHorz 
sShaded 
sSkipTaskbar 
sSkipPager 


Constructor & Destructor Documentation

Handler::Handler Window  w = 0,
Manager parent = 0,
const char *  name = 0
 

The constructor is responsible to gather various information about the window to be handled here.
Some reasonable defaults are set, so that we have some values to work with.
It is therefore rather long, despite my efforts to split it up into some more readable functions.

Here is the call graph for this function:

Handler::~Handler  ) 
 


Member Function Documentation

void Handler::createFrame  )  [private]
 

Here is where we decorate the window. For now, we just decorate every window in the full decoration style, including titlebar and buttons.

Todo:
This will have to be differentiated

void Handler::fixupPositionBasedOnStruts Strut  )  [private]
 

void * Handler::getExtendedNetPropertyData Window  win,
Atom  prop,
Atom  type,
int *  items
[private]
 

Just a wrapper for XGetWindowProperty. The returned data must be XFree()d by the caller.

void Handler::getExtendedNetWMStates  )  [private]
 

Gets the extended WM states from th X server and sets the corresponding bits in winState.

Here is the call graph for this function:

bool Handler::getExtendedWMHintString Atom  a,
char **  name
[private]
 

This makes a difference if utf8 is returned or not, therefore returns a bool. The calling function must know this, because QString has to use different methods to populate a string.

long Handler::getWMState  )  [private]
 

If we can't find a state we're going to have to assume Withdrawn. This is not exactly optimal, since we can't really distinguish between the case where no WM has run yet and when the state was explicitly removed (Clients are allowed to either set the atom to Withdrawn or just remove it... yuck.)

void Handler::getXClientName  )  [private]
 

Gets the client name. We first try to get an extended WM string, as this may be utf-8 encoded - Qt likes this. If we can't get a name with this method, we try the XFetchName method. If this should fail too, we set the name to no name

See also:
getExtendedWMHintString()

Here is the call graph for this function:

void Handler::gravitate int  multiplier  )  [private]
 

Todo:
not sure about this one, i think it is wanting more attention. For now, we use aewm++'s idea

Here is the call graph for this function:

void Handler::handleConfigureRequest XConfigureRequestEvent *   ) 
 

void Handler::handleMapRequest XMapRequestEvent *   ) 
 

void Handler::handlePropertyChange XPropertyEvent *   ) 
 

void Handler::initPosition  )  [private]
 

called for windows that are mapped for the first time.

Todo:
do something for Strut

void Handler::reparent  )  [private]
 

void Handler::setExtendedWMState  )  [private]
 

Tell the X server about a new extended WM state. This looks rather longish, as it has to do some bit aerobics with the enum values in winState. I think it's worth having it this way.

void Handler::setupClient  )  [private]
 

This is one of the spin-offs of the c'tor. Here is where initial client specific information is gathered.

Here is the call graph for this function:

void Handler::setWMState int  state  )  [private]
 

int Handler::titleHeight  )  [private]
 

void Handler::unhide  )  [private]
 

Raises a hidden window if it belongs to the current desktop.

Todo:
We don't have any desktops right now, so we raise it anyway.


Member Data Documentation

border Handler::clientBorder [private]
 

QRect Handler::clientGeometry
 

Window Handler::clientId [private]
 

QString Handler::clientName [private]
 

Colormap Handler::cmap [private]
 

QRect Handler::desktopRect [private]
 

Display* Handler::dpy [private]
 

Frame* Handler::frame [private]
 

QRect Handler::handlerGeometry [private]
 

bool Handler::hasNetName [private]
 

bool Handler::hasTitle [private]
 

int Handler::ignoreUnmap [private]
 

QRect Handler::oldClientGeometry [private]
 

Manager* Handler::Parent [private]
 

XSizeHints* Handler::size [private]
 

QString Handler::title [private]
 

int Handler::titleBarHeight [private]
 

Window Handler::transFor [private]
 

int Handler::winState [private]
 


The documentation for this class was generated from the following files:
Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for rwm 0.2 by Rolf C. Rönnau using doxygen 1.4.2