Back to index

unity  6.0.0
Public Member Functions | Private Attributes
unity::MT::X11GrabHandleImpl Class Reference

#include <unity-mt-grab-handles.h>

Inheritance diagram for unity::MT::X11GrabHandleImpl:
Inheritance graph
[legend]
Collaboration diagram for unity::MT::X11GrabHandleImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 X11GrabHandleImpl (Display *dpy, const GrabHandle::Ptr &h)
 ~X11GrabHandleImpl ()
void show ()
void hide ()
void buttonPress (int x, int y, unsigned int button) const
void lockPosition (int x, int y, unsigned int flags)
void damage (const nux::Geometry &g)

Private Attributes

boost::weak_ptr
< unity::MT::GrabHandle
mGrabHandle
Window mIpw
Display * mDpy

Detailed Description

Definition at line 98 of file unity-mt-grab-handles.h.


Constructor & Destructor Documentation

Definition at line 64 of file unity-mt-grab-handles.cpp.

                                                                                 :
  mGrabHandle (h),
  mIpw (None),
  mDpy (dpy)
{

}

Definition at line 134 of file unity-mt-grab-handles.cpp.

{
  if (mIpw)
  {
    UnityMTGrabHandlesScreen::get(screen)->removeHandleWindow(mIpw);

    XDestroyWindow(mDpy, mIpw);
  }
}

Member Function Documentation

void unity::MT::X11GrabHandleImpl::buttonPress ( int  x,
int  y,
unsigned int  button 
) const [virtual]

Implements unity::MT::GrabHandle::Impl.

Definition at line 145 of file unity-mt-grab-handles.cpp.

{
  unity::MT::GrabHandle::Ptr gh = mGrabHandle.lock ();
  gh->requestMovement (x, y, button);
}
void unity::MT::X11GrabHandleImpl::damage ( const nux::Geometry &  g) [inline, virtual]

Implements unity::MT::GrabHandle::Impl.

Definition at line 119 of file unity-mt-grab-handles.h.

  {
    CompRegion r (g.x, g.y, g.width, g.height);
    CompositeScreen::get (screen)->damageRegion (r);
  }

Implements unity::MT::GrabHandle::Impl.

Definition at line 102 of file unity-mt-grab-handles.cpp.

{
  if (mIpw)
    XUnmapWindow (mDpy, mIpw);
}
void unity::MT::X11GrabHandleImpl::lockPosition ( int  x,
int  y,
unsigned int  flags 
) [virtual]

Implements unity::MT::GrabHandle::Impl.

Definition at line 109 of file unity-mt-grab-handles.cpp.

{
  XWindowChanges xwc;
  unsigned int   vm = 0;

  if (!mIpw)
    return;

  if (flags & unity::MT::PositionSet)
  {
    xwc.x = x;
    xwc.y = y;
    vm |= CWX | CWY;
  }

  unity::MT::GrabHandle::Ptr gh = mGrabHandle.lock ();

  gh->raise ();

  XConfigureWindow(screen->dpy(), mIpw, vm, &xwc);
  XSelectInput(screen->dpy(), mIpw, ButtonPressMask | ButtonReleaseMask);
}

Implements unity::MT::GrabHandle::Impl.

Definition at line 73 of file unity-mt-grab-handles.cpp.

{
  if (mIpw)
  {
    XMapWindow (mDpy, mIpw);
    return;
  }

  XSetWindowAttributes xswa;

  xswa.override_redirect = TRUE;

  unity::MT::GrabHandle::Ptr gh = mGrabHandle.lock ();

  mIpw = XCreateWindow(mDpy,
                       DefaultRootWindow (mDpy),
                       -100, -100,
                       gh->width (),
                       gh->height (),
                       0,
                       CopyFromParent, InputOnly,
                       CopyFromParent, CWOverrideRedirect, &xswa);

  UnityMTGrabHandlesScreen::get(screen)->addHandleWindow(gh, mIpw);

  XMapWindow (mDpy, mIpw);
}

Member Data Documentation

Definition at line 129 of file unity-mt-grab-handles.h.

Definition at line 127 of file unity-mt-grab-handles.h.

Definition at line 128 of file unity-mt-grab-handles.h.


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