Back to index

unity  6.0.0
Public Member Functions | Protected Attributes
X11Window Class Reference

#include <x11-window.h>

Inheritance diagram for X11Window:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 X11Window (Display *, Window id=0)
virtual ~X11Window ()
std::vector< unsigned int > transients ()
unsigned int id ()

Protected Attributes

Window mXid
Display * mDpy
bool mCreated

Detailed Description

Definition at line 31 of file x11-window.h.


Constructor & Destructor Documentation

X11Window::X11Window ( Display *  dpy,
Window  id = 0 
)

Definition at line 28 of file x11-window.cpp.

{
  if (id == 0)
  {
    XSetWindowAttributes attrib;
    XEvent                e;

    attrib.background_pixel = 0x0;
    attrib.backing_pixel = 0x0;

    id = XCreateWindow (dpy, DefaultRootWindow (dpy), 0, 0, 100, 100, 0,
                        DefaultDepth (dpy, DefaultScreen (dpy)), InputOutput,
                        DefaultVisual (dpy, DefaultScreen (dpy)), CWBackingPixel | CWBackPixel, &attrib);

    XSelectInput (dpy, id, ExposureMask | StructureNotifyMask);
    XMapRaised (dpy, id);

    while (1)
    {
      XNextEvent (dpy, &e);
      bool exposed = false;

      switch (e.type)
      {
      case Expose:
        if (e.xexpose.window == id)
          exposed = true;
        break;
      default:
        break;
      }

      if (exposed)
        break;
    }

    XClearWindow (dpy, id);

    mCreated = true;
  }
  else
    mCreated = false;

  mXid = id;
  mDpy = dpy;
}

Here is the call graph for this function:

X11Window::~X11Window ( ) [virtual]

Definition at line 75 of file x11-window.cpp.

{
  if (mCreated)
    XDestroyWindow (mDpy, mXid);
}

Member Function Documentation

unsigned int X11Window::id ( ) [inline]

Reimplemented in X11WindowReadTransients, and X11WindowFakeMinimizable.

Definition at line 40 of file x11-window.h.

{ return mXid; }

Here is the caller graph for this function:

std::vector<unsigned int> X11Window::transients ( )

Reimplemented in X11WindowReadTransients.


Member Data Documentation

bool X11Window::mCreated [protected]

Definition at line 46 of file x11-window.h.

Display* X11Window::mDpy [protected]

Definition at line 45 of file x11-window.h.

Window X11Window::mXid [protected]

Definition at line 44 of file x11-window.h.


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