Back to index

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

List of all members.

Public Member Functions

def __init__
def visible
def icons
def current_icon
def selection_index
def mode
def initiate
def next_icon
def previous_icon
def cancel
def terminate
def select
def next_via_mouse
def previous_via_mouse
def detail_selection_index
def detail_current_count
def show_details
def hide_details
def next_detail
def previous_detail

Public Attributes

 controller

Private Attributes

 _mouse

Detailed Description

A class for interacting with the switcher.

Abstracts out switcher implementation, and makes the necessary functionality available
to consumer code.

Definition at line 32 of file switcher.py.


Constructor & Destructor Documentation

Definition at line 40 of file switcher.py.

00040 
00041     def __init__(self):
00042         super(Switcher, self).__init__()
00043         self._mouse = Mouse()
00044         controllers = SwitcherController.get_all_instances()
00045         assert(len(controllers) == 1)
00046         self.controller = controllers[0]


Member Function Documentation

Stop switcher without activating the selected icon and releasing the keys.

NOTE: Does not release Alt.

Definition at line 110 of file switcher.py.

00110 
00111     def cancel(self):
00112         """Stop switcher without activating the selected icon and releasing the keys.
00113 
00114         NOTE: Does not release Alt.
00115 
00116         """
00117         logger.debug("Cancelling switcher.")
00118         self.keybinding("switcher/cancel")
00119         self.controller.visible.wait_for(False)

The currently selected switcher icon

Definition at line 62 of file switcher.py.

00062 
00063     def current_icon(self):
00064         """The currently selected switcher icon"""
00065         return self.icons[self.selection_index]

Here is the call graph for this function:

The number of shown details

Definition at line 151 of file switcher.py.

00151 
00152     def detail_current_count(self):
00153         """The number of shown details"""
00154         return self.controller.model.detail_current_count

The index of the currently selected detail

Definition at line 146 of file switcher.py.

00146 
00147     def detail_selection_index(self):
00148         """The index of the currently selected detail"""
00149         return self.controller.model.detail_selection_index

Hide detail mode.

Definition at line 161 of file switcher.py.

00161 
00162     def hide_details(self):
00163         """Hide detail mode."""
00164         logger.debug("Hiding details view.")
00165         self.keybinding("switcher/detail_stop")
00166         self.controller.model.detail_selection.wait_for(False)

The set of icons in the switcher model

Definition at line 55 of file switcher.py.

00055 
00056     def icons(self):
00057         """The set of icons in the switcher model
00058 
00059         """
00060         return self.controller.model.icons

Here is the caller graph for this function:

Initiates the switcher in designated mode. Defaults to NORMAL

Definition at line 85 of file switcher.py.

00085 
00086     def initiate(self, mode=SwitcherMode.NORMAL):
00087         """Initiates the switcher in designated mode. Defaults to NORMAL"""
00088         if mode == SwitcherMode.NORMAL:
00089             logger.debug("Initiating switcher with Alt+Tab")
00090             self.keybinding_hold_part_then_tap("switcher/reveal_normal")
00091             self.visible.wait_for(True)
00092         elif mode == SwitcherMode.DETAIL:
00093             logger.debug("Initiating switcher detail mode with Alt+`")
00094             self.keybinding_hold_part_then_tap("switcher/reveal_details")
00095             self.visible.wait_for(True)
00096         elif mode == SwitcherMode.ALL:
00097             logger.debug("Initiating switcher in 'all workspaces' mode. Ctrl+Alt+Tab")
00098             self.keybinding_hold_part_then_tap("switcher/reveal_all")
00099             self.controller.model.only_detail_on_viewport.wait_for(False)

Returns the SwitcherMode that the switcher is currently in.

Definition at line 72 of file switcher.py.

00072 
00073     def mode(self):
00074         """Returns the SwitcherMode that the switcher is currently in."""
00075         if not self.visible:
00076             return None
00077         if self.controller.model.detail_selection and not self.controller.model.only_detail_on_viewport:
00078             return SwitcherMode.DETAIL, SwitcherMode.ALL
00079         elif self.controller.model.detail_selection:
00080             return SwitcherMode.DETAIL
00081         elif not self.controller.model.only_detail_on_viewport:
00082             return SwitcherMode.ALL
00083         else:
00084             return SwitcherMode.NORMAL

Here is the call graph for this function:

Move to next detail in the switcher.

Definition at line 167 of file switcher.py.

00167 
00168     def next_detail(self):
00169         """Move to next detail in the switcher."""
00170         logger.debug("Selecting next item in details mode.")
00171         self.keybinding("switcher/detail_next")

Move to the next icon.

Definition at line 100 of file switcher.py.

00100 
00101     def next_icon(self):
00102         """Move to the next icon."""
00103         logger.debug("Selecting next item in switcher.")
00104         self.keybinding("switcher/next")

Move to the next icon using the mouse scroll wheel.

Definition at line 133 of file switcher.py.

00133 
00134     def next_via_mouse(self):
00135         """Move to the next icon using the mouse scroll wheel."""
00136         logger.debug("Selecting next item in switcher with mouse scroll wheel.")
00137         self._mouse.press(6)
00138         self._mouse.release(6)

Move to the previous detail in the switcher.

Definition at line 172 of file switcher.py.

00172 
00173     def previous_detail(self):
00174         """Move to the previous detail in the switcher."""
00175         logger.debug("Selecting previous item in details mode.")
00176         self.keybinding("switcher/detail_prev")
00177 

Move to the previous icon.

Definition at line 105 of file switcher.py.

00105 
00106     def previous_icon(self):
00107         """Move to the previous icon."""
00108         logger.debug("Selecting previous item in switcher.")
00109         self.keybinding("switcher/prev")

Move to the previous icon using the mouse scroll wheel.

Definition at line 139 of file switcher.py.

00139 
00140     def previous_via_mouse(self):
00141         """Move to the previous icon using the mouse scroll wheel."""
00142         logger.debug("Selecting previous item in switcher with mouse scroll wheel.")
00143         self._mouse.press(7)
00144         self._mouse.release(7)

Stop switcher and activate the selected icon.

Definition at line 127 of file switcher.py.

00127 
00128     def select(self):
00129         """Stop switcher and activate the selected icon."""
00130         logger.debug("Stopping switcher")
00131         self.keybinding_release("switcher/reveal_normal")
00132         self.controller.visible.wait_for(False)

The index of the currently selected icon

Definition at line 67 of file switcher.py.

00067 
00068     def selection_index(self):
00069         """The index of the currently selected icon"""
00070         return self.controller.model.selection_index

Here is the caller graph for this function:

Show detail mode.

Definition at line 155 of file switcher.py.

00155 
00156     def show_details(self):
00157         """Show detail mode."""
00158         logger.debug("Showing details view.")
00159         self.keybinding("switcher/detail_start")
00160         self.controller.model.detail_selection.wait_for(True)

Stop switcher without activating the selected icon.

Definition at line 120 of file switcher.py.

00120 
00121     def terminate(self):
00122         """Stop switcher without activating the selected icon."""
00123         logger.debug("Terminating switcher.")
00124         self.keybinding("switcher/cancel")
00125         self.keybinding_release("switcher/reveal_normal")
00126         self.controller.visible.wait_for(False)

Is the switcher currently visible

Definition at line 48 of file switcher.py.

00048 
00049     def visible(self):
00050         """Is the switcher currently visible
00051 
00052         """
00053         return self.controller.visible

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file switcher.py.

Definition at line 45 of file switcher.py.


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