Back to index

unity  6.0.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
unity.emulators.panel.UnityPanel Class Reference
Inheritance diagram for unity.emulators.panel.UnityPanel:
Inheritance graph
[legend]
Collaboration diagram for unity.emulators.panel.UnityPanel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def move_mouse_below_the_panel
def move_mouse_over_menus
def move_mouse_over_grab_area
def move_mouse_over_window_buttons
def move_mouse_over_indicators
def get_indicator_entries
def get_active_indicator
def get_indicator_entry
def title
def desktop_is_active
def menus_shown
def window_buttons_shown
def window_buttons
def menus
def grab_area
def indicators
def geometry

Static Public Attributes

string DBUS_SERVICE = "com.canonical.Unity"
string DBUS_OBJECT = "/com/canonical/Unity/Debug"

Private Member Functions

def __get_menu_view
def __get_window_buttons
def __get_grab_area
def __get_indicators_view

Private Attributes

 _mouse

Detailed Description

An individual panel for a monitor.

Definition at line 51 of file panel.py.


Constructor & Destructor Documentation

def unity.emulators.panel.UnityPanel.__init__ (   self,
  args,
  kwargs 
)

Definition at line 54 of file panel.py.

00054 
00055     def __init__(self, *args, **kwargs):
00056         super(UnityPanel, self).__init__(*args, **kwargs)
00057         self._mouse = Mouse()


Member Function Documentation

Return the panel grab area.

Definition at line 70 of file panel.py.

00070 
00071     def __get_grab_area(self):
00072         """Return the panel grab area."""
00073         grab_areas = self.menus.get_children_by_type(GrabArea)
00074         assert(len(grab_areas) == 1)
00075         return grab_areas[0]

Here is the caller graph for this function:

Return the menu view.

Definition at line 76 of file panel.py.

00076 
00077     def __get_indicators_view(self):
00078         """Return the menu view."""
00079         indicators = self.get_children_by_type(Indicators)
00080         assert(len(indicators) == 1)
00081         return indicators[0]

Here is the caller graph for this function:

Return the menu view.

Definition at line 58 of file panel.py.

00058 
00059     def __get_menu_view(self):
00060         """Return the menu view."""
00061         menus = self.get_children_by_type(MenuView)
00062         assert(len(menus) == 1)
00063         return menus[0]

Here is the caller graph for this function:

Return the window buttons view.

Definition at line 64 of file panel.py.

00064 
00065     def __get_window_buttons(self):
00066         """Return the window buttons view."""
00067         buttons = self.menus.get_children_by_type(WindowButtons)
00068         assert(len(buttons) == 1)
00069         return buttons[0]

Here is the caller graph for this function:

Definition at line 162 of file panel.py.

00162 
00163     def desktop_is_active(self):
00164         return self.menus.desktop_active

Returns a tuple of (x,y,w,h) for the current panel.

Definition at line 190 of file panel.py.

00190 
00191     def geometry(self):
00192         """Returns a tuple of (x,y,w,h) for the current panel."""
00193         return (self.x, self.y, self.width, self.height)
00194 

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the indicator entry that is currently active

Definition at line 143 of file panel.py.

00143 
00144     def get_active_indicator(self):
00145         """Returns the indicator entry that is currently active"""
00146         entries = self.get_indicator_entries(False, True)
00147         entries = filter(lambda e: e.active == True, entries)
00148         assert(len(entries) <= 1)
00149         return entries[0] if entries else None

Here is the call graph for this function:

Here is the caller graph for this function:

def unity.emulators.panel.UnityPanel.get_indicator_entries (   self,
  visible_only = True,
  include_hidden_menus = False 
)
Returns a list of entries for this panel including both menus and indicators

Definition at line 135 of file panel.py.

00135 
00136     def get_indicator_entries(self, visible_only=True, include_hidden_menus=False):
00137         """Returns a list of entries for this panel including both menus and indicators"""
00138         entries = []
00139         if include_hidden_menus or self.menus_shown:
00140             entries = self.menus.get_entries()
00141         entries += self.indicators.get_ordered_entries(visible_only)
00142         return entries

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the indicator entry for the given ID or None

Definition at line 150 of file panel.py.

00150 
00151     def get_indicator_entry(self, entry_id):
00152         """Returns the indicator entry for the given ID or None"""
00153         entries = self.get_indicator_entries(False, True)
00154         entries = filter(lambda e: e.entry_id == entry_id, entries)
00155         assert(len(entries) <= 1)
00156         return entries[0] if entries else None

Here is the call graph for this function:

Definition at line 182 of file panel.py.

00182 
00183     def grab_area(self):
00184         return self.__get_grab_area()

Here is the call graph for this function:

Definition at line 186 of file panel.py.

00186 
00187     def indicators(self):
00188         return self.__get_indicators_view()

Here is the call graph for this function:

Definition at line 178 of file panel.py.

00178 
00179     def menus(self):
00180         return self.__get_menu_view()

Here is the call graph for this function:

Definition at line 166 of file panel.py.

00166 
00167     def menus_shown(self):
00168         return self.active and self.menus.draw_menus

Here is the call graph for this function:

Here is the caller graph for this function:

Places the mouse to bottom of this panel.

Definition at line 82 of file panel.py.

00082 
00083     def move_mouse_below_the_panel(self):
00084         """Places the mouse to bottom of this panel."""
00085         (x, y, w, h) = self.geometry
00086         target_x = x + w / 2
00087         target_y = y + h + 10
00088 
00089         logger.debug("Moving mouse away from panel.")
00090         self._mouse.move(target_x, target_y)

Here is the call graph for this function:

Move the mouse over the grab area for this panel.

Definition at line 108 of file panel.py.

00108 
00109     def move_mouse_over_grab_area(self):
00110         """Move the mouse over the grab area for this panel."""
00111         (x, y, w, h) = self.grab_area.geometry
00112         target_x = x + w / 2
00113         target_y = y + h / 2
00114 
00115         logger.debug("Moving mouse to center of grab area.")
00116         self._mouse.move(target_x, target_y)

Here is the caller graph for this function:

Move the mouse over the center of the indicators area for this panel.

Definition at line 126 of file panel.py.

00126 
00127     def move_mouse_over_indicators(self):
00128         """Move the mouse over the center of the indicators area for this panel."""
00129         (x, y, w, h) = self.indicators.geometry
00130         target_x = x + w / 2
00131         target_y = y + h / 2
00132 
00133         logger.debug("Moving mouse to center of the indicators area.")
00134         self._mouse.move(target_x, target_y)

Move the mouse over the menu area for this panel.

Definition at line 91 of file panel.py.

00091 
00092     def move_mouse_over_menus(self):
00093         """Move the mouse over the menu area for this panel."""
00094         (x, y, w, h) = self.menus.geometry
00095         target_x = x + w / 2
00096         target_y = y + h / 2
00097 
00098         # The menu view has bigger geometry than the real layout
00099         menu_entries = self.menus.get_entries()
00100         if len(menu_entries) > 0:
00101             first_x = menu_entries[0].x
00102             last_x = menu_entries[-1].x + menu_entries[-1].width / 2
00103 
00104             target_x = first_x + (last_x - first_x) / 2
00105 
00106         logger.debug("Moving mouse to center of menu area.")
00107         self._mouse.move(target_x, target_y)

Move the mouse over the center of the window buttons area for this panel.

Definition at line 117 of file panel.py.

00117 
00118     def move_mouse_over_window_buttons(self):
00119         """Move the mouse over the center of the window buttons area for this panel."""
00120         (x, y, w, h) = self.window_buttons.geometry
00121         target_x = x + w / 2
00122         target_y = y + h / 2
00123 
00124         logger.debug("Moving mouse to center of the window buttons.")
00125         self._mouse.move(target_x, target_y)

Definition at line 158 of file panel.py.

00158 
00159     def title(self):
00160         return self.menus.panel_title

Definition at line 174 of file panel.py.

00174 
00175     def window_buttons(self):
00176         return self.__get_window_buttons()

Here is the call graph for this function:

Definition at line 170 of file panel.py.

00170 
00171     def window_buttons_shown(self):
00172         return self.menus.draw_window_buttons


Member Data Documentation

Definition at line 56 of file panel.py.

string unity.emulators.UnityIntrospectionObject.DBUS_OBJECT = "/com/canonical/Unity/Debug" [static, inherited]

Definition at line 19 of file __init__.py.

string unity.emulators.UnityIntrospectionObject.DBUS_SERVICE = "com.canonical.Unity" [static, inherited]

Definition at line 18 of file __init__.py.


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