Example #1
0
	def __init__(self, session):
		Renderer.__init__(self)
		
		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()
		self.poll_timer.callback.append(self.poll)
	def __init__(self, session):
		printl("", self , "S")

		Renderer.__init__(self)

		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()
		self.poll_timer.callback.append(self.poll)

		printl("", self, "C")
Example #3
0
	def __init__(self, session):
		printl("", self , "S")

		Renderer.__init__(self)

		self.showiframe = Showiframe()
		self.session = session
		self.poll_timer = eTimer()

		if getOeVersion() != "oe22":
			self.poll_timer.callback.append(self.poll)
		else:
			self.poll_timerConn = self.poll_timer.timeout.connect(self.poll)

		printl("", self, "C")
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, what) in self.skinAttributes:
			if (attrib == 'foregroundColor'):
				self.fColor = parseColor(what)
			elif (attrib == 'backgroundColor'):
				self.bColor = parseColor(what)
			else:
				attribs.append((attrib, what))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Example #5
0
    def applySkin(self, desktop, screen):
        def retValue(val, limit, default, Min=False):
            try:
                if Min:
                    x = min(limit, int(val))
                else:
                    x = max(limit, int(val))
            except:
                x = default
            return x

        self.halign = valign = eLabel.alignLeft
        if self.skinAttributes:
            attribs = []
            for (attrib, value) in self.skinAttributes:
                if attrib == "font":
                    self.txfont = parseFont(value, ((1, 1), (1, 1)))
                elif attrib == "foregroundColor":
                    self.fcolor = parseColor(value)
                elif attrib == "backgroundColor":
                    self.bcolor = parseColor(value)
                elif attrib == "shadowColor":
                    self.scolor = parseColor(value)
                elif attrib == "shadowOffset":
                    x, y = value.split(',')
                    self.soffset = (int(x), int(y))
                elif attrib == "valign" and value in ("top", "center",
                                                      "bottom"):
                    valign = {
                        "top": eLabel.alignTop,
                        "center": eLabel.alignCenter,
                        "bottom": eLabel.alignBottom
                    }[value]
                    self.txtflags |= {
                        "top": RT_VALIGN_TOP,
                        "center": RT_VALIGN_CENTER,
                        "bottom": RT_VALIGN_BOTTOM
                    }[value]
                elif attrib == "halign" and value in ("left", "center",
                                                      "right", "block"):
                    self.halign = {
                        "left": eLabel.alignLeft,
                        "center": eLabel.alignCenter,
                        "right": eLabel.alignRight,
                        "block": eLabel.alignBlock
                    }[value]
                    self.txtflags |= {
                        "left": RT_HALIGN_LEFT,
                        "center": RT_HALIGN_CENTER,
                        "right": RT_HALIGN_RIGHT,
                        "block": RT_HALIGN_BLOCK
                    }[value]
                elif attrib == "noWrap":
                    if value == "0":
                        self.txtflags |= RT_WRAP
                    else:
                        self.txtflags &= ~RT_WRAP
                elif attrib == "options":
                    options = value.split(',')
                    for opt in options:
                        val = ''
                        pos = opt.find('=')
                        if pos != -1:
                            val = opt[pos + 1:].strip()
                            opt = opt[:pos].strip()
                        if opt == "wrap":
                            if val == "0":
                                self.txtflags &= ~RT_WRAP
                            else:
                                self.txtflags |= RT_WRAP
                        elif opt == "nowrap":
                            if val == "0":
                                self.txtflags |= RT_WRAP
                            else:
                                self.txtflags &= ~RT_WRAP
                        elif opt == "movetype" and val in ("none", "running",
                                                           "swimming"):
                            self.type = {
                                "none": NONE,
                                "running": RUNNING,
                                "swimming": SWIMMING
                            }[val]
                        elif opt == "direction" and val in ("left", "right",
                                                            "top", "bottom"):
                            self.direction = {
                                "left": LEFT,
                                "right": RIGHT,
                                "top": TOP,
                                "bottom": BOTTOM
                            }[val]
                        elif opt == "step" and val:
                            #retValue(val, limit, default, Min=False)
                            self.mStep = retValue(val, 1, self.mStep)
                        elif opt == "steptime" and val:
                            self.mStepTimeout = retValue(
                                val, 25, self.mStepTimeout)
                        elif opt == "startdelay" and val:
                            self.mStartDelay = retValue(
                                val, 0, self.mStartDelay)
                        elif opt == "pause" and val:
                            self.mLoopTimeout = retValue(
                                val, 0, self.mLoopTimeout)
                        elif opt == "oneshot" and val:
                            self.mOneShot = retValue(val, 0, self.mOneShot)
                        elif opt == "repeat" and val:
                            self.mRepeat = retValue(val, 0, self.mRepeat)
                        elif opt == "always" and val:
                            self.mAlways = retValue(val, 0, self.mAlways)
                        elif opt == "startpoint" and val:
                            self.mStartPoint = int(val)
                else:
                    attribs.append((attrib, value))
            self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, screen)
        #if self.type == RUNNING and self.direction in (LEFT,RIGHT):
        #	self.halign = eLabel.alignLeft
        #	self.txtflags = RT_HALIGN_LEFT | (self.txtflags & RT_WRAP)
        if self.mOneShot:
            self.mOneShot = max(self.mStepTimeout, self.mOneShot)
        if self.mLoopTimeout:
            self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout)

        self.test_label.setFont(self.txfont)
        #self.test_label.setForegroundColor(self.fcolor)
        #self.test_label.setBackgroundColor(self.bcolor)
        #if not self.scolor is None:
        #	self.test_label.setShadowColor(self.scolor)
        #	self.test_label.setShadowOffset(ePoint(self.soffset[0], self.soffset[1]))
        if not (self.txtflags & RT_WRAP):
            self.test_label.setNoWrap(1)
        self.test_label.setVAlign(valign)
        self.test_label.setHAlign(self.halign)
        self.test_label.move(ePoint(self.W, self.H))
        self.test_label.resize(eSize(self.W, self.H))
        #self.test_label.hide()
        #self.changed((self.CHANGED_DEFAULT,))
        return ret
Example #6
0
	def __init__(self):
		Renderer.__init__(self)
		self.PicLoad = ePicLoad()
		self.PicLoad.PictureData.get().append(self.updatePicon)
		self.piconsize = (0, 0)
		config.lcd.picon_pack.addNotifier(self.configChanged)
 def __init__(self):
     Renderer.__init__(self)
     self.timer = eTimer()
     self.timer.callback.append(self.pollme)
Example #8
0
 def connect(self, source):
     Renderer.connect(self, source)
     self.changed((self.CHANGED_DEFAULT, ))
Example #9
0
	def __init__(self):
		Renderer.__init__(self)
		self.pngname = None
		self.defaultpngname = resolveFilename(SCOPE_CURRENT_SKIN, "picon_default.png")
Example #10
0
	def connect(self, source):
		Renderer.connect(self, source)
Example #11
0
	def __init__(self):
		Renderer.__init__(self)
		self.path = 'picon'
		self.nameCache = {}
		self.pngname = ''
 def __init__(self):
     Renderer.__init__(self)
     self.nameCache = {}
     self.picname = ""
     self.scalecover = "1"
Example #13
0
	def __init__(self):
		Renderer.__init__(self)
		self.__content = None
		self.__wrap_around = True
		self.__selection_enabled = True
		self.__scrollbarMode = "showOnDemand"
Example #14
0
File: Pig.py Project: zukon/enigma2
	def __init__(self):
		Renderer.__init__(self)
		self.Position = self.Size = None
		self.hidePip = True
Example #15
0
 def __init__(self):
     Renderer.__init__(self)
     self.pngname = ""
 def __init__(self):
     Renderer.__init__(self)
     self.size = None
     self.nameAudioCache = {}
     self.pngname = ""
     self.path = ""
 def __init__(self):
     Renderer.__init__(self)
     self.path = 'piconUni'
     self.scale = '0'
     self.nameCache = {}
     self.pngname = ''
 def __init__(self):
     Renderer.__init__(self)
     VariableText.__init__(self)
     self.trrtmz = eEPGCache.getInstance()
Example #19
0
 def __init__(self):
     Renderer.__init__(self)
     VariableText.__init__(self)
Example #20
0
	def __init__(self):
		Renderer.__init__(self)
		VariableValue.__init__(self)
		self.__start = 0
		self.__end = 100
Example #21
0
	def applySkin(self, desktop, screen):
		def retValue(val, limit, default, Min=False):
			try:
				if Min:
					x = min(limit, int(val))
				else:
					x = max(limit, int(val))
			except:
					x = default
			return x

		def setWrapFlag(attrib, value):
			if (attrib.lower() == "wrap" and value == "0") or \
			   (attrib.lower() == "nowrap" and value != "0"):
				self.txtflags &= ~RT_WRAP
			else:
				self.txtflags |= RT_WRAP

		self.halign = valign = eLabel.alignLeft
		if self.skinAttributes:
			attribs = []
			for (attrib, value) in self.skinAttributes:
				if attrib == "font":
					self.txfont = parseFont(value, ((1, 1), (1, 1)))
				elif attrib == "foregroundColor":
					self.scroll_label.setForegroundColor(parseColor(value))
				elif attrib in ("shadowColor", "borderColor"):	# fake for openpli-enigma2
					self.scroll_label.setShadowColor(parseColor(value))
				elif attrib == "shadowOffset":
					x, y = value.split(',')
					self.soffset = (int(x), int(y))
					self.scroll_label.setShadowOffset(ePoint(self.soffset))
				elif attrib == "borderWidth":			# fake for openpli-enigma2
					self.soffset = (-int(value), -int(value))
				elif attrib == "valign" and value in ("top", "center", "bottom"):
					valign = {"top": eLabel.alignTop, "center": eLabel.alignCenter, "bottom": eLabel.alignBottom}[value]
					self.txtflags |= {"top": RT_VALIGN_TOP, "center": RT_VALIGN_CENTER, "bottom": RT_VALIGN_BOTTOM}[value]
				elif attrib == "halign" and value in ("left", "center", "right", "block"):
					self.halign = {"left": eLabel.alignLeft, "center": eLabel.alignCenter, "right": eLabel.alignRight, "block": eLabel.alignBlock}[value]
					self.txtflags |= {"left": RT_HALIGN_LEFT, "center": RT_HALIGN_CENTER, "right": RT_HALIGN_RIGHT, "block": RT_HALIGN_BLOCK}[value]
				elif attrib == "noWrap":
					setWrapFlag(attrib, value)
				elif attrib == "options":
					options = value.split(',')
					for o in options:
						if '=' in o:
							opt, val = (x.strip() for x in o.split('=', 1))
						else:
							opt, val = o.strip(), ""

						if opt == "":
							continue
						elif opt in ("wrap", "nowrap"):
							setWrapFlag(opt, val)
						elif opt == "movetype" and val in ("none", "running", "swimming"):
							self.type = {"none": NONE, "running": RUNNING, "swimming": SWIMMING}[val]
						elif opt == "direction" and val in ("left", "right", "top", "bottom"):
							self.direction = {"left": LEFT, "right": RIGHT, "top": TOP, "bottom": BOTTOM}[val]
						elif opt == "step" and val:
							self.mStep = retValue(val, 1, self.mStep)
						elif opt == "steptime" and val:
							self.mStepTimeout = retValue(val, 25, self.mStepTimeout)
						elif opt == "startdelay" and val:
							self.mStartDelay = retValue(val, 0, self.mStartDelay)
						elif opt == "pause" and val:
							self.mLoopTimeout = retValue(val, 0, self.mLoopTimeout)
						elif opt == "oneshot" and val:
							self.mOneShot = retValue(val, 0, self.mOneShot)
						elif opt == "repeat" and val:
							self.mRepeat = retValue(val, 0, self.mRepeat)
						elif opt == "always" and val:
							self.mAlways = retValue(val, 0, self.mAlways)
						elif opt == "startpoint" and val:
							self.mStartPoint = int(val)
						elif opt == "pagedelay" and val:
							self.mPageDelay = retValue(val, 0, self.mPageDelay)
						elif opt == "pagelength" and val:
							self.mPageLength = retValue(val, 0, self.mPageLength)
				else:
					attribs.append((attrib, value))
					if attrib == "backgroundColor":
						self.scroll_label.setBackgroundColor(parseColor(value))
					elif attrib == "transparent":
						self.scroll_label.setTransparent(int(value))

			self.skinAttributes = attribs
		ret = Renderer.applySkin(self, desktop, screen)

		if self.mOneShot:
			self.mOneShot = max(self.mStepTimeout, self.mOneShot)
		if self.mLoopTimeout:
			self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout)
		if self.mPageDelay:
			self.mPageDelay = max(self.mStepTimeout, self.mPageDelay)

		self.scroll_label.setFont(self.txfont)
		if not (self.txtflags & RT_WRAP):
			self.scroll_label.setNoWrap(1)
		self.scroll_label.setVAlign(valign)
		self.scroll_label.setHAlign(self.halign)
		self.scroll_label.move(ePoint(0, 0))
		self.scroll_label.resize(eSize(self.W, self.H))
		# test for auto correction text height:
		if self.direction in (TOP, BOTTOM):
			from enigma import fontRenderClass
			flh = int(fontRenderClass.getInstance().getLineHeight(self.txfont) or self.txfont.pointSize / 6 + self.txfont.pointSize)
			self.scroll_label.setText("WQq")
			if flh > self.scroll_label.calculateSize().height():
				self.lineHeight = flh
			self.scroll_label.setText("")
		return ret
Example #22
0
 def __init__(self):
     Renderer.__init__(self)
     self.Position = self.Size = None
Example #23
0
 def __init__(self):
     Renderer.__init__(self)
     VariableValue.__init__(self)
 def __init__(self):
     Renderer.__init__(self)
     self.fColor = gRGB(255, 255, 255, 0)
     self.bColor = gRGB(0, 0, 0, 255)
     self.numval = -1
Example #25
0
 def __init__(self):
     self.lines = False
     Renderer.__init__(self)
     VariableText.__init__(self)
     self.epgcache = eEPGCache.getInstance()
Example #26
0
 def __init__(self):
     Renderer.__init__(self)
     self.delayPicTime = 100
Example #27
0
 def __init__(self):
     Renderer.__init__(self)
     VariableText.__init__(self)
     self.vol_timer = eTimer()
     self.vol_timer.callback.append(self.pollme)
 def __init__(self):
     Renderer.__init__(self)
     self.path = "cript"
     self.nameCache = {}
     self.pngName = ""
     self.picon_default = "picon_default.png"
Example #29
0
	def destroy(self):
		# remove the notifier before properties get destroyed
		config.lcd.picon_pack.removeNotifier(self.configChanged)
		Renderer.destroy(self)
Example #30
0
 def __init__(self):
     Renderer.__init__(self)
     self.nameCache = {}
     self.picname = ''
 def __init__(self):
     Renderer.__init__(self)
 def __init__(self):
     Renderer.__init__(self)
     self.path = "picon"
     self.nameCache = {}
     self.pngname = ""
	def __init__(self):
		Renderer.__init__(self)
		self.fColor = gRGB(255, 255, 255, 0)
		self.bColor = gRGB(0, 0, 0, 255)
		self.numval = -1
 def __init__(self):
     Renderer.__init__(self)
     self.pstrNm = ''
     self.evntNm = ''
Example #35
0
 def __init__(self):
     Renderer.__init__(self)
    def applySkin(self, desktop, screen):
        def retValue(val, limit, default, Min=False):
            try:
                if Min:
                    x = min(limit, int(val))
                else:
                    x = max(limit, int(val))
            except:
                x = default

            return x

        def setWrapFlag(attrib, value):
            if attrib.lower() == 'wrap' and value == '0' or attrib.lower(
            ) == 'nowrap' and value != '0':
                self.txtflags &= ~RT_WRAP
            else:
                self.txtflags |= RT_WRAP

        self.halign = valign = eLabel.alignLeft
        if self.skinAttributes:
            attribs = []
            for attrib, value in self.skinAttributes:
                if attrib == 'font':
                    self.txfont = parseFont(value, ((1, 1), (1, 1)))
                elif attrib == 'foregroundColor':
                    self.scroll_label.setForegroundColor(parseColor(value))
                elif attrib in ('shadowColor', 'borderColor'):
                    self.scroll_label.setShadowColor(parseColor(value))
                elif attrib == 'shadowOffset':
                    x, y = value.split(',')
                    self.soffset = (int(x), int(y))
                    self.scroll_label.setShadowOffset(ePoint(self.soffset))
                elif attrib == 'borderWidth':
                    self.soffset = (-int(value), -int(value))
                elif attrib == 'valign' and value in ('top', 'center',
                                                      'bottom'):
                    valign = {
                        'top': eLabel.alignTop,
                        'center': eLabel.alignCenter,
                        'bottom': eLabel.alignBottom
                    }[value]
                    self.txtflags |= {
                        'top': RT_VALIGN_TOP,
                        'center': RT_VALIGN_CENTER,
                        'bottom': RT_VALIGN_BOTTOM
                    }[value]
                elif attrib == 'halign' and value in ('left', 'center',
                                                      'right', 'block'):
                    self.halign = {
                        'left': eLabel.alignLeft,
                        'center': eLabel.alignCenter,
                        'right': eLabel.alignRight,
                        'block': eLabel.alignBlock
                    }[value]
                    self.txtflags |= {
                        'left': RT_HALIGN_LEFT,
                        'center': RT_HALIGN_CENTER,
                        'right': RT_HALIGN_RIGHT,
                        'block': RT_HALIGN_BLOCK
                    }[value]
                elif attrib == 'noWrap':
                    setWrapFlag(attrib, value)
                elif attrib == 'options':
                    options = value.split(',')
                    for o in options:
                        if o.find('=') != -1:
                            opt, val = (x.strip() for x in o.split('=', 1))
                        else:
                            opt, val = o.strip(), ''
                        if opt == '':
                            continue
                        elif opt in ('wrap', 'nowrap'):
                            setWrapFlag(opt, val)
                        elif opt == 'movetype' and val in ('none', 'running',
                                                           'swimming'):
                            self.type = {
                                'none': NONE,
                                'running': RUNNING,
                                'swimming': SWIMMING
                            }[val]
                        elif opt == 'direction' and val in ('left', 'right',
                                                            'top', 'bottom'):
                            self.direction = {
                                'left': LEFT,
                                'right': RIGHT,
                                'top': TOP,
                                'bottom': BOTTOM
                            }[val]
                        elif opt == 'step' and val:
                            self.mStep = retValue(val, 1, self.mStep)
                        elif opt == 'steptime' and val:
                            self.mStepTimeout = retValue(
                                val, 25, self.mStepTimeout)
                        elif opt == 'startdelay' and val:
                            self.mStartDelay = retValue(
                                val, 0, self.mStartDelay)
                        elif opt == 'pause' and val:
                            self.mLoopTimeout = retValue(
                                val, 0, self.mLoopTimeout)
                        elif opt == 'oneshot' and val:
                            self.mOneShot = retValue(val, 0, self.mOneShot)
                        elif opt == 'repeat' and val:
                            self.mRepeat = retValue(val, 0, self.mRepeat)
                        elif opt == 'always' and val:
                            self.mAlways = retValue(val, 0, self.mAlways)
                        elif opt == 'startpoint' and val:
                            self.mStartPoint = int(val)
                        elif opt == 'pagedelay' and val:
                            self.mPageDelay = retValue(val, 0, self.mPageDelay)
                        elif opt == 'pagelength' and val:
                            self.mPageLength = retValue(
                                val, 0, self.mPageLength)

                else:
                    attribs.append((attrib, value))
                    if attrib == 'backgroundColor':
                        self.scroll_label.setBackgroundColor(parseColor(value))
                    elif attrib == 'transparent':
                        self.scroll_label.setTransparent(int(value))

            self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, screen)
        if self.mOneShot:
            self.mOneShot = max(self.mStepTimeout, self.mOneShot)
        if self.mLoopTimeout:
            self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout)
        if self.mPageDelay:
            self.mPageDelay = max(self.mStepTimeout, self.mPageDelay)
        self.scroll_label.setFont(self.txfont)
        if not self.txtflags & RT_WRAP:
            self.scroll_label.setNoWrap(1)
        self.scroll_label.setVAlign(valign)
        self.scroll_label.setHAlign(self.halign)
        self.scroll_label.move(ePoint(0, 0))
        self.scroll_label.resize(eSize(self.W, self.H))
        if self.direction in (TOP, BOTTOM):
            from enigma import fontRenderClass
            flh = int(fontRenderClass.getInstance().getLineHeight(self.txfont)
                      or self.txfont.pointSize / 6 + self.txfont.pointSize)
            self.scroll_label.setText('WQq')
            if flh > self.scroll_label.calculateSize().height():
                self.lineHeight = flh
            self.scroll_label.setText('')
        return ret