Back to index

unity  6.0.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes
WindowManager Class Reference

#include <WindowManager.h>

Inheritance diagram for WindowManager:
Inheritance graph
[legend]
Collaboration diagram for WindowManager:
Collaboration graph
[legend]

List of all members.

Public Types

enum  FocusVisibility { OnlyVisible, ForceUnminimizeInvisible, ForceUnminimizeOnCurrentDesktop }
typedef std::list
< Introspectable * > 
IntrospectableList

Public Member Functions

 WindowManager ()
virtual guint32 GetActiveWindow ()=0
virtual bool IsWindowMaximized (guint32 xid)=0
virtual bool IsWindowDecorated (guint32 xid)=0
virtual bool IsWindowOnCurrentDesktop (guint32 xid)=0
virtual bool IsWindowObscured (guint32 xid)=0
virtual bool IsWindowMapped (guint32 xid)=0
virtual bool IsWindowVisible (guint32 xid)=0
virtual bool IsWindowOnTop (guint32 xid)=0
virtual bool IsWindowClosable (guint32 xid)=0
virtual bool IsWindowMinimizable (guint32 xid)=0
virtual bool IsWindowMaximizable (guint32 xid)=0
virtual void ShowDesktop ()=0
virtual void Restore (guint32 xid)=0
virtual void RestoreAt (guint32 xid, int x, int y)=0
virtual void Minimize (guint32 xid)=0
virtual void Close (guint32 xid)=0
virtual void Activate (guint32 xid)=0
virtual void Raise (guint32 xid)=0
virtual void Lower (guint32 xid)=0
virtual void TerminateScale ()=0
virtual bool IsScaleActive ()=0
virtual bool IsScaleActiveForGroup ()=0
virtual void InitiateExpo ()=0
virtual bool IsExpoActive ()=0
virtual void FocusWindowGroup (std::vector< Window > windows, FocusVisibility, int monitor=-1, bool only_top_win=true)=0
virtual bool ScaleWindowGroup (std::vector< Window > windows, int state, bool force)=0
virtual void Decorate (guint32 xid)
virtual void Undecorate (guint32 xid)
virtual bool IsScreenGrabbed ()=0
virtual bool IsViewPortSwitchStarted ()=0
virtual void MoveResizeWindow (guint32 xid, nux::Geometry geometry)=0
void StartMove (guint32 xid, int, int)
virtual int GetWindowMonitor (guint32 xid) const =0
virtual nux::Geometry GetWindowGeometry (guint32 xid) const =0
virtual nux::Geometry GetWindowSavedGeometry (guint32 xid) const =0
virtual nux::Geometry GetScreenGeometry () const =0
virtual nux::Geometry GetWorkAreaGeometry (guint32 xid=0) const =0
virtual unsigned long long GetWindowActiveNumber (guint32 xid)=0
virtual void SetWindowIconGeometry (Window window, nux::Geometry const &geo)=0
virtual void CheckWindowIntersections (nux::Geometry const &region, bool &active, bool &any)=0
virtual int WorkspaceCount ()=0
virtual bool saveInputFocus ()=0
virtual bool restoreInputFocus ()=0
GVariant * Introspect ()
void AddChild (Introspectable *child)
void RemoveChild (Introspectable *child)
virtual IntrospectableList GetIntrospectableChildren ()
guint64 GetIntrospectionId () const

Static Public Member Functions

static WindowManagerDefault ()
static void SetDefault (WindowManager *manager)

Public Attributes

sigc::signal< void, guint32 > window_mapped
sigc::signal< void, guint32 > window_unmapped
sigc::signal< void, guint32 > window_maximized
sigc::signal< void, guint32 > window_restored
sigc::signal< void, guint32 > window_minimized
sigc::signal< void, guint32 > window_unminimized
sigc::signal< void, guint32 > window_shaded
sigc::signal< void, guint32 > window_unshaded
sigc::signal< void, guint32 > window_shown
sigc::signal< void, guint32 > window_hidden
sigc::signal< void, guint32 > window_resized
sigc::signal< void, guint32 > window_moved
sigc::signal< void, guint32 > window_focus_changed
sigc::signal< void, guint32 > window_decorated
sigc::signal< void, guint32 > window_undecorated
sigc::signal< void > initiate_spread
sigc::signal< void > terminate_spread
sigc::signal< void > initiate_expo
sigc::signal< void > terminate_expo
sigc::signal< void > compiz_screen_grabbed
sigc::signal< void > compiz_screen_ungrabbed
sigc::signal< void > compiz_screen_viewport_switch_started
sigc::signal< void > compiz_screen_viewport_switch_ended
sigc::signal< void, const char
*, const char
*, CompOption::Vector & > 
compiz_event

Protected Member Functions

std::string GetName () const
virtual void AddProperties (GVariantBuilder *builder)=0
virtual std::string GetChildsName () const
 Please don't override this unless you really need to. The only valid reason is if you have a property that simply must be called 'Children'.

Private Attributes

Atom m_MoveResizeAtom

Detailed Description

Definition at line 28 of file WindowManager.h.


Member Typedef Documentation

Definition at line 34 of file Introspectable.h.


Member Enumeration Documentation

Enumerator:
OnlyVisible 
ForceUnminimizeInvisible 
ForceUnminimizeOnCurrentDesktop 

Definition at line 42 of file WindowManager.h.


Constructor & Destructor Documentation

Definition at line 36 of file WindowManager.h.

                  :
    m_MoveResizeAtom(XInternAtom(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
                                 "_NET_WM_MOVERESIZE", FALSE))
  {
  };

Member Function Documentation

virtual void WindowManager::Activate ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

Definition at line 78 of file Introspectable.cpp.

{
  _children.push_back(child);
  child->_parents.push_back(this);
}

Here is the caller graph for this function:

virtual void WindowManager::AddProperties ( GVariantBuilder *  builder) [protected, pure virtual]
virtual void WindowManager::CheckWindowIntersections ( nux::Geometry const &  region,
bool &  active,
bool &  any 
) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

virtual void WindowManager::Close ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual void WindowManager::Decorate ( guint32  xid) [inline, virtual]

Reimplemented in PluginAdapter.

Definition at line 86 of file WindowManager.h.

{};

Here is the caller graph for this function:

Reimplemented in PluginAdapter.

Definition at line 240 of file WindowManager.cpp.

virtual void WindowManager::FocusWindowGroup ( std::vector< Window >  windows,
FocusVisibility  ,
int  monitor = -1,
bool  only_top_win = true 
) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual guint32 WindowManager::GetActiveWindow ( ) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

std::string unity::debug::Introspectable::GetChildsName ( ) const [protected, virtual, inherited]

Please don't override this unless you really need to. The only valid reason is if you have a property that simply must be called 'Children'.

Definition at line 92 of file Introspectable.cpp.

{
  return "Children";
}

Here is the caller graph for this function:

Introspectable::IntrospectableList unity::debug::Introspectable::GetIntrospectableChildren ( ) [virtual, inherited]

Reimplemented in unity::hud::View, unity::launcher::LauncherModel, unity::QuicklistView, and unity::dash::ResultView.

Definition at line 41 of file Introspectable.cpp.

{
  return _children;
}

Here is the caller graph for this function:

guint64 unity::debug::Introspectable::GetIntrospectionId ( ) const [inherited]

Definition at line 97 of file Introspectable.cpp.

{
  return _id;
}

Here is the caller graph for this function:

std::string WindowManager::GetName ( ) const [protected, virtual]

Implements unity::debug::Introspectable.

Definition at line 254 of file WindowManager.cpp.

{
  return "WindowManager";
}
virtual nux::Geometry WindowManager::GetScreenGeometry ( ) const [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

virtual unsigned long long WindowManager::GetWindowActiveNumber ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual nux::Geometry WindowManager::GetWindowGeometry ( guint32  xid) const [pure virtual]

Implemented in PluginAdapter.

Here is the caller graph for this function:

virtual int WindowManager::GetWindowMonitor ( guint32  xid) const [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual nux::Geometry WindowManager::GetWindowSavedGeometry ( guint32  xid) const [pure virtual]

Implemented in PluginAdapter.

virtual nux::Geometry WindowManager::GetWorkAreaGeometry ( guint32  xid = 0) const [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

virtual void WindowManager::InitiateExpo ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

GVariant * unity::debug::Introspectable::Introspect ( ) [inherited]

Definition at line 47 of file Introspectable.cpp.

{
  GVariantBuilder  builder;
  GVariantBuilder  child_builder;
  gint             n_children = 0;

  g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
  g_variant_builder_add(&builder, "{sv}", "id", g_variant_new_uint64(_id));

  AddProperties(&builder);

  g_variant_builder_init(&child_builder, G_VARIANT_TYPE("as"));

  auto children = GetIntrospectableChildren();
  for (auto it = children.begin(); it != children.end(); it++)
  {
    if ((*it)->GetName() != "")
    {
      g_variant_builder_add(&child_builder, "s", (*it)->GetName().c_str());
      n_children++;
    }
  }

  GVariant* child_results = g_variant_builder_end(&child_builder);

  if (n_children > 0)
    g_variant_builder_add(&builder, "{sv}", GetChildsName().c_str(), child_results);
  return g_variant_builder_end(&builder);
}

Here is the call graph for this function:

virtual bool WindowManager::IsExpoActive ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

virtual bool WindowManager::IsScaleActive ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

virtual bool WindowManager::IsScaleActiveForGroup ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

virtual bool WindowManager::IsScreenGrabbed ( ) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsViewPortSwitchStarted ( ) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

virtual bool WindowManager::IsWindowClosable ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowDecorated ( guint32  xid) [pure virtual]

Implemented in WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowMapped ( guint32  xid) [pure virtual]

Implemented in WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowMaximizable ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

virtual bool WindowManager::IsWindowMaximized ( guint32  xid) [pure virtual]

Implemented in WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowMinimizable ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowObscured ( guint32  xid) [pure virtual]

Implemented in WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowOnCurrentDesktop ( guint32  xid) [pure virtual]

Implemented in WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowOnTop ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual bool WindowManager::IsWindowVisible ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual void WindowManager::Lower ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual void WindowManager::Minimize ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual void WindowManager::MoveResizeWindow ( guint32  xid,
nux::Geometry  geometry 
) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

virtual void WindowManager::Raise ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

Definition at line 85 of file Introspectable.cpp.

{
  _children.remove(child);
  child->_parents.remove(this);
}

Here is the caller graph for this function:

virtual void WindowManager::Restore ( guint32  xid) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

virtual void WindowManager::RestoreAt ( guint32  xid,
int  x,
int  y 
) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

virtual bool WindowManager::restoreInputFocus ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

virtual bool WindowManager::saveInputFocus ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

virtual bool WindowManager::ScaleWindowGroup ( std::vector< Window >  windows,
int  state,
bool  force 
) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

void WindowManager::SetDefault ( WindowManager manager) [static]

Definition at line 249 of file WindowManager.cpp.

{
  window_manager = manager;
}

Here is the caller graph for this function:

virtual void WindowManager::SetWindowIconGeometry ( Window  window,
nux::Geometry const &  geo 
) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

virtual void WindowManager::ShowDesktop ( ) [pure virtual]

Implemented in PluginAdapter, and WindowManagerDummy.

Here is the caller graph for this function:

void WindowManager::StartMove ( guint32  xid,
int  x,
int  y 
)

Definition at line 261 of file WindowManager.cpp.

{
  if (x < 0 || y < 0)
    return;

  XEvent ev;
  Display* d = nux::GetGraphicsDisplay()->GetX11Display();

  /* We first need to ungrab the pointer. FIXME: Evil */

  XUngrabPointer(d, CurrentTime);

  // --------------------------------------------------------------------------
  // FIXME: This is a workaround until the non-paired events issue is fixed in
  // nux
  XButtonEvent bev =
  {
    ButtonRelease,
    0,
    False,
    d,
    0,
    0,
    0,
    CurrentTime,
    x, y,
    x, y,
    0,
    Button1,
    True
  };
  XEvent* e = (XEvent*)&bev;
  nux::GetWindowThread()->ProcessForeignEvent(e, NULL);

  ev.xclient.type    = ClientMessage;
  ev.xclient.display = d;

  ev.xclient.serial     = 0;
  ev.xclient.send_event = true;

  ev.xclient.window     = xid;
  ev.xclient.message_type = m_MoveResizeAtom;
  ev.xclient.format     = 32;

  ev.xclient.data.l[0] = x; // x_root
  ev.xclient.data.l[1] = y; // y_root
  ev.xclient.data.l[2] = NET_WM_MOVERESIZE_MOVE; //direction
  ev.xclient.data.l[3] = 1; // button
  ev.xclient.data.l[4] = 2; // source

  XSendEvent(d, DefaultRootWindow(d), FALSE,
             SubstructureRedirectMask | SubstructureNotifyMask,
             &ev);

  XSync(d, FALSE);
}
virtual void WindowManager::TerminateScale ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:

virtual void WindowManager::Undecorate ( guint32  xid) [inline, virtual]

Reimplemented in PluginAdapter.

Definition at line 87 of file WindowManager.h.

{};

Here is the caller graph for this function:

virtual int WindowManager::WorkspaceCount ( ) [pure virtual]

Implemented in WindowManagerDummy, and PluginAdapter.

Here is the caller graph for this function:


Member Data Documentation

sigc::signal<void, const char*, const char*, CompOption::Vector&> WindowManager::compiz_event

Definition at line 140 of file WindowManager.h.

Definition at line 135 of file WindowManager.h.

Definition at line 136 of file WindowManager.h.

Definition at line 138 of file WindowManager.h.

Definition at line 137 of file WindowManager.h.

sigc::signal<void> WindowManager::initiate_expo

Definition at line 132 of file WindowManager.h.

sigc::signal<void> WindowManager::initiate_spread

Definition at line 129 of file WindowManager.h.

Definition at line 147 of file WindowManager.h.

sigc::signal<void> WindowManager::terminate_expo

Definition at line 133 of file WindowManager.h.

sigc::signal<void> WindowManager::terminate_spread

Definition at line 130 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_decorated

Definition at line 126 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_focus_changed

Definition at line 125 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_hidden

Definition at line 122 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_mapped

Definition at line 113 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_maximized

Definition at line 115 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_minimized

Definition at line 117 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_moved

Definition at line 124 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_resized

Definition at line 123 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_restored

Definition at line 116 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_shaded

Definition at line 119 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_shown

Definition at line 121 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_undecorated

Definition at line 127 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_unmapped

Definition at line 114 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_unminimized

Definition at line 118 of file WindowManager.h.

sigc::signal<void, guint32> WindowManager::window_unshaded

Definition at line 120 of file WindowManager.h.


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