Module GnomeMagDevice :: Class GnomeMagDevice
[hide private]
[frames] | no frames]

Class GnomeMagDevice

source code

AccessEngine.AEOutput.AEOutput --+
                                 |
                                GnomeMagDevice

GNOME Magnifier device. Currently manages a single zoom region, while exposing all of its properties for configuration.

Nested Classes [hide private]
  STYLE
Overrides the base AccessEngine.AEOutput.AEOutput.Style.Style class, filling in fields for supported style properties with their appropriate values.
Instance Methods [hide private]
 
init(self)
Initializes the gnome magnifier.
source code
 
postInit(self)
Called after the init method and after either AEOutput.loadStyles or AEOutput.createDistinctStyles.
source code
 
_correctContrast(self, style)
Uses a bug in versions of the GNOME magnifier to detect what version of the magnifier is running so that the scale of the color constrast values can be corrected.
source code
 
_setContrastValues(self, style, min, max, convert)
Sets all color contrast values at once.
source code
 
_initMag(self, style)
Set the magnifier object to the correct screen, position, and size.
source code
 
_getZoom(self)
Get magnifier's first zoom region, if it doesn't exist create one.
source code
 
close(self)
Stop and close the magnifier device.
source code
list of string
getCapabilities(self)
Returns: 'magnifier' as the only capability of this device.
source code
 
getProxy(self) source code
 
send(self, name, value, style=None)
Perform given command, or simply apply all dirty style properties.
source code
 
_setFullScreen(self, reset_viewport=True)
If source display is not target display, set magnifier to fullscreen.
source code
tuple
_getScreenSize(self, display_name)
Get the size of a given screen.
source code
boolean
_isDisplay(self, display_name)
Checks if given screen exists
source code
 
_setPos(self, zoom, roi_tuple)
Set ROI of zoomer.
source code
4-tuple of int
_getPos(self, zoom)
Get ROI of the zoomer including left, top, right, bottom coordinates.
source code
 
_updateSetting(self, style, setting)
Apply style attribute to magnifier or zoomer.
source code
Class Variables [hide private]
  MAGNIFIER_IID = "OAFIID:GNOME_Magnifier_Magnifier:0.9"
  MAGNIFIER_OBJ = "GNOME/Magnifier/Magnifier"
  property_trans_zoom = {'Invert': 'inverse-video', 'SmoothingTy...
  property_trans_mag = {'TargetDisplayScreen': 'target-display-s...
Instance Variables [hide private]
GNOME.Magnifier.Magnifier mag
Magnifier instance
PropertyBagProxy mag_pb_proxy
Proxy for the property bag on the magnifier
GNOME.Magnifier.ZoomRegion zoom
Zoom region
PropertyBagProxy zoom_pb_proxy
Proxy for property bag on the zoomer
Method Details [hide private]

init(self)

source code 
Initializes the gnome magnifier.
Raises:
  • AEOutput.InitError - When the device can not be initialized

postInit(self)

source code 
Called after the init method and after either AEOutput.loadStyles or AEOutput.createDistinctStyles. Override this method to perform additional initilization after the setting values are available.

_correctContrast(self, style)

source code 
Uses a bug in versions of the GNOME magnifier to detect what version of the magnifier is running so that the scale of the color constrast values can be corrected.
Parameters:

_setContrastValues(self, style, min, max, convert)

source code 
Sets all color contrast values at once.
Parameters:
  • style (GnomeMagStyle) - Style object
  • min (float) - Minimum value
  • max (float) - Maximum value
  • convert (callable) - Conversion equation

_initMag(self, style)

source code 
Set the magnifier object to the correct screen, position, and size.
Parameters:

_getZoom(self)

source code 
Get magnifier's first zoom region, if it doesn't exist create one. Resize viewport to magnifier's target display size.

getCapabilities(self)

source code 
Returns: list of string
'magnifier' as the only capability of this device.

_setFullScreen(self, reset_viewport=True)

source code 
If source display is not target display, set magnifier to fullscreen.
Parameters:
  • reset_viewport (boolean) - Snap zoomer's viewport to new magnifier size.

_getScreenSize(self, display_name)

source code 
Get the size of a given screen.
Parameters:
  • display_name (string) - Name of display.
Returns: tuple
Width and height of display, or (None, None) if there was trouble retrieving display size.

_isDisplay(self, display_name)

source code 
Checks if given screen exists
Parameters:
  • display_name (string) - Name of display.
Returns: boolean
True if screen exists, False if not.

_setPos(self, zoom, roi_tuple)

source code 
Set ROI of zoomer.
Parameters:
  • zoom (GNOME.Magnifier.ZoomRegion) - Zoomer to adjust.
  • roi_tuple (4-tuple of integer) - Region of interest in x,y,w,h

_getPos(self, zoom)

source code 
Get ROI of the zoomer including left, top, right, bottom coordinates.
Parameters:
  • zoom (GNOME.Magnifier.ZoomRegion) - Zoomer to adjust.
Returns: 4-tuple of int
Bounds of the zoomer region

_updateSetting(self, style, setting)

source code 
Apply style attribute to magnifier or zoomer.
Parameters:

Class Variable Details [hide private]

property_trans_zoom

Value:
{'Invert': 'inverse-video', 'SmoothingType': 'smoothing-type', 'Contra\
stRed': 'red-contrast', 'ContrastGreen': 'green-contrast', 'ContrastBl\
ue': 'blue-contrast'}

property_trans_mag

Value:
{'TargetDisplayScreen': 'target-display-screen', 'CursorScale': 'curso\
r-scale-factor', 'CursorColor': 'cursor-color', 'CrosswireSize': 'cros\
swire-size', 'CrosswireColor': 'crosswire-color', 'CrosswireClip': 'cr\
osswire-clip'}