Back to index

unity  6.0.0
Classes | Typedefs | Functions | Variables
unity::MT Namespace Reference

Classes

class  GrabHandleGroup
class  GrabHandleWindow
class  GrabHandle
class  DummyDamager
class  X11TextureFactory
class  X11Texture
class  X11ImplFactory
class  X11GrabHandleImpl
class  Texture

Typedefs

typedef std::pair
< Texture::Ptr, nux::Geometry > 
TextureSize
typedef std::pair
< Texture::Ptr, nux::Geometry > 
TextureLayout

Functions

unsigned int getLayoutForMask (unsigned int state, unsigned int actions)

Variables

unsigned int FADE_MSEC = 0
unsigned int MaximizedVertMask = CompWindowStateMaximizedVertMask
unsigned int MaximizedHorzMask = CompWindowStateMaximizedHorzMask
unsigned int MoveMask = CompWindowActionMoveMask
unsigned int ResizeMask = CompWindowActionResizeMask
static const unsigned int NUM_HANDLES = 9
static const unsigned int PositionLock = (1 << 0)
static const unsigned int PositionSet = (1 << 2)
static const unsigned int TopLeftHandle = (1 << 0)
static const unsigned int TopHandle = (1 << 1)
static const unsigned int TopRightHandle = (1 << 2)
static const unsigned int RightHandle = (1 << 3)
static const unsigned int BottomRightHandle = (1 << 4)
static const unsigned int BottomHandle = (1 << 5)
static const unsigned int BottomLeftHandle = (1 << 6)
static const unsigned int LeftHandle = (1 << 7)
static const unsigned int MiddleHandle = (1 << 8)
static const std::map
< unsigned int, int > 
maskHandles
static const std::map< int,
unsigned int > 
handlesMask

Typedef Documentation

typedef std::pair<Texture::Ptr, nux::Geometry> unity::MT::TextureLayout

Definition at line 70 of file unity-mt-texture.h.

typedef std::pair<Texture::Ptr, nux::Geometry> unity::MT::TextureSize

Definition at line 69 of file unity-mt-texture.h.


Function Documentation

unsigned int unity::MT::getLayoutForMask ( unsigned int  state,
unsigned int  actions 
)

Definition at line 23 of file unity-mt-grab-handle-layout.cpp.

{
  unsigned int allHandles = 0;
  for (unsigned int i = 0; i < NUM_HANDLES; i++)
  {
    allHandles |= (1 << i);
  }

  struct _skipInfo
  {
    /* All must match in order for skipping to apply */
    unsigned int state; /* Match if in state */
    unsigned int notstate; /* Match if not in state */
    unsigned int actions; /* Match if in actions */
    unsigned int notactions; /* Match if not in actions */
    unsigned int allowOnly;
  };

  const unsigned int numSkipInfo = 5;
  const struct _skipInfo skip[5] =
  {
    /* Vertically maximized, don't care
     * about left or right handles, or
     * the movement handle */
    {
      MaximizedVertMask,
      MaximizedHorzMask,
      0, static_cast<unsigned int>(~0),
      LeftHandle | RightHandle | MiddleHandle
    },
    /* Horizontally maximized, don't care
     * about top or bottom handles, or
     * the movement handle */
    {
      MaximizedHorzMask,
      MaximizedVertMask,
      0, static_cast<unsigned int>(~0),
      TopHandle | BottomHandle | MiddleHandle
    },
    /* Maximized, don't care about the movement
    * handle */
    {
      MaximizedVertMask | MaximizedHorzMask,
      0, 0, static_cast<unsigned int>(~0),
      MiddleHandle
    },
    /* Immovable, don't show move handle */
    {
      0,
      static_cast<unsigned int>(~0),
      static_cast<unsigned int>(~0), MoveMask,
      TopLeftHandle | TopHandle | TopRightHandle |
      LeftHandle | RightHandle |
      BottomLeftHandle | BottomHandle | BottomRightHandle
    },
    /* Not resizable, don't show resize handle */
    {
      0,
      static_cast<unsigned int>(~0),
      static_cast<unsigned int>(~0), ResizeMask,
      MiddleHandle
    },
  };

  /* Set the high bit if it was zero */
  if (!state)
    state |= 0x8000;

  /* Set the high bit if it was zero */
  if (!actions)
    actions |= 0x8000;

  for (unsigned int j = 0; j < numSkipInfo; j++)
  {
    const bool exactState = skip[j].state && skip[j].state != static_cast <unsigned int> (~0);
    const bool exactActions = skip[j].actions && skip[j].actions != static_cast <unsigned int> (~0);

    bool stateMatch = false;
    bool actionMatch = false;

    if (exactState)
      stateMatch = (skip[j].state & state) == skip[j].state;
    else
      stateMatch = skip[j].state & state;

    stateMatch &= !(state & skip[j].notstate);

    if (exactActions)
      actionMatch = (skip[j].actions & actions) == skip[j].actions;
    else
      actionMatch = skip[j].actions & actions;

    actionMatch &= !(actions & skip[j].notactions);

    if (stateMatch || actionMatch)
      allHandles &= skip[j].allowOnly;  
  }

  return allHandles;
}

Here is the caller graph for this function:


Variable Documentation

const unsigned int unity::MT::BottomHandle = (1 << 5) [static]

Definition at line 50 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::BottomLeftHandle = (1 << 6) [static]

Definition at line 51 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::BottomRightHandle = (1 << 4) [static]

Definition at line 49 of file unity-mt-grab-handle.h.

unsigned int unity::MT::FADE_MSEC = 0

Definition at line 21 of file unity-mt-grab-handle-group.cpp.

const std::map<int, unsigned int> unity::MT::handlesMask [static]
Initial value:
 {
 { 0, TopLeftHandle },
 { 1, TopHandle },
 { 2, TopRightHandle },
 { 3, RightHandle },
 { 4, BottomRightHandle},
 { 5, BottomHandle },
 { 6, BottomLeftHandle },
 { 7, LeftHandle },
 { 8, MiddleHandle }
}

Definition at line 67 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::LeftHandle = (1 << 7) [static]

Definition at line 52 of file unity-mt-grab-handle.h.

const std::map<unsigned int, int> unity::MT::maskHandles [static]
Initial value:
 {
 { TopLeftHandle, 0 },
 { TopHandle, 1 },
 { TopRightHandle, 2 },
 { RightHandle, 3 },
 { BottomRightHandle, 4},
 { BottomHandle, 5 },
 { BottomLeftHandle, 6 },
 { LeftHandle, 7 },
 { MiddleHandle, 8 }
}

Definition at line 55 of file unity-mt-grab-handle.h.

unsigned int unity::MT::MaximizedHorzMask = CompWindowStateMaximizedHorzMask

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

unsigned int unity::MT::MaximizedVertMask = CompWindowStateMaximizedVertMask

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

const unsigned int unity::MT::MiddleHandle = (1 << 8) [static]

Definition at line 53 of file unity-mt-grab-handle.h.

unsigned int unity::MT::MoveMask = CompWindowActionMoveMask

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

const unsigned int unity::MT::NUM_HANDLES = 9 [static]

Definition at line 37 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::PositionLock = (1 << 0) [static]

Definition at line 40 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::PositionSet = (1 << 2) [static]

Definition at line 43 of file unity-mt-grab-handle.h.

unsigned int unity::MT::ResizeMask = CompWindowActionResizeMask

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

const unsigned int unity::MT::RightHandle = (1 << 3) [static]

Definition at line 48 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::TopHandle = (1 << 1) [static]

Definition at line 46 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::TopLeftHandle = (1 << 0) [static]

Definition at line 45 of file unity-mt-grab-handle.h.

const unsigned int unity::MT::TopRightHandle = (1 << 2) [static]

Definition at line 47 of file unity-mt-grab-handle.h.