Back to index

easystroke  0.5.5.1
Public Member Functions | Private Attributes
Children Class Reference

#include <grabber.h>

List of all members.

Public Member Functions

 Children (Window)
bool handle (XEvent &ev)
void add (Window)
void remove (Window)
void destroy (Window)

Private Attributes

Window parent

Detailed Description

Definition at line 36 of file grabber.h.


Constructor & Destructor Documentation

Children::Children ( Window  w)

Definition at line 102 of file grabber.cc.

                           : parent(w) {
       XSelectInput(dpy, parent, SubstructureNotifyMask);
       unsigned int n;
       Window dummyw1, dummyw2, *ch;
       XQueryTree(dpy, parent, &dummyw1, &dummyw2, &ch, &n);
       for (unsigned int i = 0; i < n; i++)
              add(ch[i]);
       XFree(ch);
}

Here is the call graph for this function:


Member Function Documentation

void Children::add ( Window  w)

Definition at line 160 of file grabber.cc.

                           {
       if (!w)
              return;

       XSelectInput(dpy, w, EnterWindowMask | PropertyChangeMask);
       get_frame(w);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Children::destroy ( Window  w)

Definition at line 173 of file grabber.cc.

                               {
       frame_win.erase1(w);
       frame_win.erase2(w);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Children::handle ( XEvent &  ev)

Definition at line 112 of file grabber.cc.

                                {
       switch (ev.type) {
              case CreateNotify:
                     if (ev.xcreatewindow.parent != parent)
                            return false;
                     add(ev.xcreatewindow.window);
                     return true;
              case DestroyNotify:
                     frame_child.erase1(ev.xdestroywindow.window);
                     frame_child.erase2(ev.xdestroywindow.window);
                     minimized.erase2(ev.xdestroywindow.window);
                     destroy(ev.xdestroywindow.window);
                     return true;
              case ReparentNotify:
                     if (ev.xreparent.event != parent)
                            return false;
                     if (ev.xreparent.window == parent)
                            return false;
                     if (ev.xreparent.parent == parent)
                            add(ev.xreparent.window);
                     else
                            remove(ev.xreparent.window);
                     return true;
              case PropertyNotify:
                     if (ev.xproperty.atom == *_NET_FRAME_WINDOW) {
                            if (ev.xproperty.state == PropertyDelete)
                                   frame_win.erase1(ev.xproperty.window);
                            if (ev.xproperty.state == PropertyNewValue)
                                   get_frame(ev.xproperty.window);
                            return true;
                     }
                     if (ev.xproperty.atom == *_NET_WM_STATE) {
                            if (ev.xproperty.state == PropertyDelete) {
                                   minimized.erase2(ev.xproperty.window);
                                   return true;
                            }
                            if (has_atom(ev.xproperty.window, *_NET_WM_STATE, *_NET_WM_STATE_HIDDEN))
                                   minimized.add(minimized_n++, ev.xproperty.window);
                            else
                                   minimized.erase2(ev.xproperty.window);
                            return true;
                     }
                     return false;
              default:
                     return false;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Children::remove ( Window  w)

Definition at line 168 of file grabber.cc.

                              {
       XSelectInput(dpy, w, 0);
       destroy(w);
}

Here is the call graph for this function:


Member Data Documentation

Window Children::parent [private]

Definition at line 37 of file grabber.h.


The documentation for this class was generated from the following files: