Example #1
0
class cRotation(object):
    """ Rotation abstraction layer """
    def __init__(self):
        Logger.debug (u'Loading Orientation Support' )
        self.bLocked = False
        self.oRotation = OS_GetRotationObject()
    def Lock(self):
        """ Locks the rotation on a device """
        Logger.debug (u'Orientation Lock' )
        if self.oRotation:
            self.oRotation.lock()
        self.bLocked = True
    def SetOrientation_Landscape(self):
        """rotate a device to landscape """
        Logger.debug (u'SetOrientation_Landscape' )
        if self.oRotation:
            self.oRotation.set_landscape()
    def SetOrientation_Portrait(self):
        """rotate a device to portrait """
        Logger.debug (u'SetOrientation_Portrait' )
        if self.oRotation:
            self.oRotation.set_portrait()
Example #2
0
 def __init__(self):
     Logger.debug(u'Loading Orientation Support')
     self.bLocked: bool = False
     self.oRotation: cRotation = OS_GetRotationObject()