Ejemplo n.º 1
0
    def __init__(self, window, outtrans, runit, dict, cb):
        self.windows = [window,]
        self.outtrans = outtrans

        self.__duration = dict.get('dur', 1)
        self.__multiElement = dict.get('coordinated')
        self.__childrenClip = dict.get('clipBoundary', 'children') == 'children'

        self.__callback = cb

        trtype = dict.get('trtype', 'fade')
        subtype = dict.get('subtype')
        klass = Transitions.TransitionFactory(trtype, subtype)
        self.__transitiontype = klass(self, dict)

        self.__fiber_id = None
        self.__running = 0

        self.__startprogress = dict.get('startProgress', 0)
        self.__endprogress = dict.get('endProgress', 1)
        if self.__endprogress <= self.__startprogress:
            self.__transperiod = 0
        elif self.__duration <= 0:
            self.__transperiod = 0
            self.__startprogress = self.__endprogress
        else:
            self.__transperiod = float(self.__endprogress - self.__startprogress) / self.__duration

        # shortcut flag for static (not video) transitions
        self._surf_updated = 0

        # rect for use with wnd._paintOnSurf
        # offset windowpos with respect to VisibleWindowPos
        self._paint_rect = None
Ejemplo n.º 2
0
    def __init__(self, window, outtrans, runit, dict, cb):
        self.windows = [
            window,
        ]
        self.outtrans = outtrans

        self.__duration = dict.get('dur', 1)
        self.__multiElement = dict.get('coordinated')
        self.__childrenClip = dict.get('clipBoundary',
                                       'children') == 'children'

        self.__callback = cb

        trtype = dict.get('trtype', 'fade')
        subtype = dict.get('subtype')
        klass = Transitions.TransitionFactory(trtype, subtype)
        self.__transitiontype = klass(self, dict)

        self.__fiber_id = None
        self.__running = 0

        self.__startprogress = dict.get('startProgress', 0)
        self.__endprogress = dict.get('endProgress', 1)
        if self.__endprogress <= self.__startprogress:
            self.__transperiod = 0
            #raise AssertionError
        elif self.__duration <= 0:
            self.__transperiod = 0
            self.__startprogress = self.__endprogress
        else:
            self.__transperiod = float(self.__endprogress -
                                       self.__startprogress) / self.__duration
Ejemplo n.º 3
0
    def __init__(self, window, outtrans, runit, dict, cb):
        self.window = window
        self.outtrans = outtrans
        self.dict = dict
        self.cb = cb

        trtype = dict.get('trtype')
        subtype = dict.get('subtype')
        klass = Transitions.TransitionFactory(trtype, subtype)
        self.__transitiontype = klass(self, self.dict)

        self.__running = 0
        self._lastvalue = None
Ejemplo n.º 4
0
    def __init__(self, window, inout, runit, dict, cb):
        dur = dict.get('dur', 1)
        self.exclude_first_window = 0
        # if this is a coordinated transition with clipBoundary==children we should not
        # include the parent in the clip.
        if dict.get('coordinated') and dict.get('clipBoundary',
                                                'children') == 'children':
            self.exclude_first_window = 1
        self.windows = [window]
        self.outtransition = inout
        self.starttime = time.time()  # Correct?
        self.duration = dur
        self.running = runit
        self.value = 0
        trtype = dict.get('trtype', 'fade')
        subtype = dict.get('subtype')
        self.__callback = cb
        klass = Transitions.TransitionFactory(trtype, subtype)
        self.transitiontype = klass(self, dict)
        self.dstrgn = None
        self.verbatimrgn = None
        self.move_resize()
        self.currentparameters = None

        ##         self.reverse = (dict['direction'] == 'reverse')
        self.reverse = 0
        if not self.reverse:
            self.startprogress = dict.get('startProgress', 0)
            self.endprogress = dict.get('endProgress', 1)
        else:
            self.startprogress = 1.0 - dict.get('endProgress', 1)
            self.endprogress = 1.0 - dict.get('startProgress', 0)
        # Now recompute starttime and "duration" based on these values
        if self.endprogress != self.startprogress:
            self.duration = self.duration / (self.endprogress -
                                             self.startprogress)
        self.starttime = self.starttime - (self.startprogress * self.duration)

        self.__idleid = mw_globals.toplevel.setidleproc(self._idleproc)