def applySkin(self, desktop, parent):

		attribs = [ ]
		from enigma import eSize

		def parseSize(str):
			x, y = str.split(',')
			return eSize(int(x), int(y))
	
		def parseColumnValue(value):
			x, length, color, fontname, fontheight, align, itemindex = value.split(',')
			return (int(x), int(length), parseColor(color), gFont(fontname,int(fontheight)), int(fontheight), int(itemindex), int(align))

		for (attrib, value) in self.skinAttributes:
			if attrib == "size":
				self.instance.setSize(parseSize(value))
				attribs.append((attrib,value))
			elif attrib == "column0":
				self.columns["0"] = parseColumnValue(value)
			elif attrib == "column1":
				self.columns["1"] = parseColumnValue(value)
			elif attrib == "column2":
				self.columns["2"] = parseColumnValue(value)
			elif attrib == "rowHeight":
				self.rowHeight = int(value)
			elif attrib == "primetimeoffset":
				self.primetimeoffset = int(value)
			elif attrib == "backgroundColor":
				self.backgroundColor = parseColor(value)
				self.instance.clear(self.backgroundColor)
				attribs.append((attrib,value))
			else:
				attribs.append((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 2
0
	def applySkin(self, desktop, parent):

		attribs = [ ]
		from enigma import eSize

		def parseSize(str):
			x, y = str.split(',')
			return eSize(int(x), int(y))

		for (attrib, value) in self.skinAttributes:
			if attrib == "size":
				self.instance.setSize(parseSize(value))
				attribs.append((attrib,value))
			elif attrib == "nocColor":
			        self.nocColor = parseColor(value)
			elif attrib == "emmColor":
				self.emmColor = parseColor(value)
			elif attrib == "ecmColor":
				self.ecmColor = parseColor(value)
			elif attrib == "font":
				self.font = parseFont(value, ((1,1),(1,1)))
			elif attrib == "backgroundColor":
				self.backgroundColor = parseColor(value)
				self.instance.clear(self.backgroundColor)
				attribs.append((attrib,value))
			else:
				attribs.append((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 3
0
	def applySkin(self,desktop,parent):
		if parent.__class__.__name__=="ChannelSelection":
			self.is_channelselection=True
			if not config.usage.use_extended_pig_channelselection.value:
				self.decoder=0
				self.this_instance.setDecoder(self.decoder)
		if self.skinAttributes is not None:
			attribs=[]
			for (attrib,value) in self.skinAttributes:
				if attrib=="OverScan":
					if value.lower()=="false" or value=="0":
						self.instance.setOverscan(False)
				else:
					attribs.append((attrib,value))
				if attrib=="position":
					x=value.split(',')[0]
					y=value.split(',')[1]
				elif attrib=="size":
					w=value.split(',')[0]
					h=value.split(',')[1]

			self.skinAttributes=attribs
			x=format(int(float(x)/self.fb_w*720.0),'x').zfill(8)
			y=format(int(float(y)/self.fb_h*576.0),'x').zfill(8)
			w=format(int(float(w)/self.fb_w*720.0),'x').zfill(8)
			h=format(int(float(h)/self.fb_h*576.0),'x').zfill(8)
			self.fb_size=[w,h,x,y]
		ret=Renderer.applySkin(self,desktop,parent)
		if ret:
			self.Position=self.instance.position()
			self.Size=self.instance.size()
		return ret
Esempio n. 4
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value) in self.skinAttributes:
			if attrib == "NumberOfItems":
				self.numberOfItems = int(value)
				attribs.append((attrib, value))
			if attrib == "noLabel":
				self.hideLabel = int(value)
				attribs.append((attrib, value))
			if attrib == "numOfSpaces":
				self.numOfSpaces = int(value)
				attribs.append((attrib, value))
			if attrib == "timeColor":
				self.timecolor = self.hex2strColor(parseColor(value).argb())
				attribs.append((attrib, value))
			if attrib == "labelColor":
				self.labelcolor = self.hex2strColor(parseColor(value).argb())
				attribs.append((attrib, value))
			if attrib == "foregroundColor":
				self.foregroundColor = self.hex2strColor(parseColor(value).argb())
				attribs.append((attrib, value))
		for (attrib, value) in attribs:
			self.skinAttributes.remove((attrib, value))
		self.timecolor = self.formatColorString(self.timecolor)
		self.labelcolor  = self.formatColorString(self.labelcolor)
		self.foregroundColor  = self.formatColorString(self.foregroundColor)
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 5
0
	def applySkin(self, desktop, parent):
		def getIntValue(val, limit, default):
			try:	x = max(limit, int(val))
			except:	x = default
			return x
		
		if self.skinAttributes is not None:
			attribs = [ ]
			for (attrib, value) in self.skinAttributes:
				if attrib == "typeCaret":
					val = value.lower()
					if val in ("0","none"):
						self.caret = ""
					elif val in ("1","underscore"):
						self.caret = "_"
					elif val in ("2","block"):
						self.caret = " "
					else:
						self.caret = str(value)
					self.mark = (self.caret == " ")
				elif attrib == "typeSpeed":
					x = getIntValue(value, 0, 600)
					if x > 0: self.speed = max(25, int(60000/x))
				elif attrib == "typeStartDelay":
					self.delay = getIntValue(value, 0, self.delay)
				elif attrib == "typeRepeats":
					self.maxrep = getIntValue(value, 0, self.maxrep)
				elif attrib == "noCaret":
					if not value.lower() in ("0","false","no","off"):
						self.caret = ""
				else:
					attribs.append((attrib,value))
			self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 6
0
	def applySkin(self, desktop, parent):
		if self.skinAttributes is not None:
			attribs = []
			for (attrib, value) in self.skinAttributes:
				if attrib == "OverScan":
					if value.lower() == "false" or value == "0":
						self.instance.setOverscan(False)
				else:
					attribs.append((attrib, value))
				if attrib == "position":
					x = value.split(',')[0]
					y = value.split(',')[1]
				elif attrib == "size":
					w = value.split(',')[0]
					h = value.split(',')[1]
			self.skinAttributes = attribs
			x = format(int(float(x) / self.fb_w * 720.0), 'x').zfill(8)
			y = format(int(float(y) / self.fb_h * 576.0), 'x').zfill(8)
			w = format(int(float(w) / self.fb_w * 720.0), 'x').zfill(8)
			h = format(int(float(h) / self.fb_h * 576.0), 'x').zfill(8)
			self.fb_size = [w, h, x, y]
				
		ret = Renderer.applySkin(self, desktop, parent)
		if ret:
			self.Position = self.instance.position()
			self.Size = self.instance.size()
		return ret
Esempio n. 7
0
    def applySkin(self, desktop, parent):
        attribs = []
        longtext_attribs = []
        for attrib, value in self.skinAttributes:
            if attrib.find('step') != -1:
                self.step = int(value)
            if attrib.find('steptime') != -1:
                self.steptime = int(value)
            if attrib.find('startdelay') != -1:
                self.startdelay = int(value)
            if attrib.find('font') != -1 or attrib.find('size') != -1 or attrib.find('zPosition') != -1 or attrib.find('transparent') != -1 or attrib.find('backgroundColor') != -1 or attrib.find('foregroundColor') != -1 or attrib.find('valign') != -1 or attrib.find('halign') != -1:
                longtext_attribs.append((attrib, value))
            if attrib != 'font' and attrib != 'valign' and attrib != 'halign' and attrib != 'foregroundColor' and attrib != 'step' and attrib != 'steptime' and attrib != 'startdelay' and attrib != 'css':
                attribs.append((attrib, value))
            if attrib.find('css') != -1:
                from skin import cascadingStyleSheets
                styles = value.split(',')
                for style in styles:
                    for _attrib in cascadingStyleSheets[style].keys():
                        _value = cascadingStyleSheets[style][_attrib]
                        if _attrib.find('step') != -1:
                            self.step = int(_value)
                        if _attrib.find('steptime') != -1:
                            self.steptime = int(_value)
                        if _attrib.find('startdelay') != -1:
                            self.startdelay = int(_value)
                        if _attrib.find('font') != -1 or _attrib.find('size') != -1 or _attrib.find('zPosition') != -1 or _attrib.find('transparent') != -1 or _attrib.find('backgroundColor') != -1 or _attrib.find('foregroundColor') != -1 or _attrib.find('valign') != -1 or _attrib.find('halign') != -1:
                            longtext_attribs.append((_attrib, _value))
                        if _attrib != 'font' and _attrib != 'valign' and _attrib != 'halign' and _attrib != 'foregroundColor' and _attrib != 'step' and _attrib != 'steptime' and _attrib != 'startdelay':
                            attribs.append((_attrib, _value))

        skin.applyAllAttributes(self.long_text, desktop, longtext_attribs, parent.scale)
        self.long_text.move(ePoint(0, 0))
        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 8
0
	def applySkin(self, desktop, parent):
		attribs = self.skinAttributes[:]
		for (attrib, value) in self.skinAttributes:
			if attrib == "path":
				self.addPath(value)
				attribs.remove((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 9
0
	def applySkin(self, desktop, parent):
		attribs = [ ]
		for (attrib, value) in self.skinAttributes:
			if attrib == "position":
				self.posY = int(value.strip().split(",")[1])
			attribs.append((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 10
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, what,) in self.skinAttributes:
			if (attrib == 'text'):
				self.setText(what)
				self.forced=True
			else:
				attribs.append((attrib, what))
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 11
0
	def applySkin(self, desktop, parent):
		attribs = self.skinAttributes[:]
		for (attrib, value) in self.skinAttributes:
			if attrib == "allVisible":
				self.allVisible = value == "1"
				attribs.remove((attrib,value))
				break
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 12
0
	def applySkin(self, desktop, parent):
		attribs = [ ]
		for (attrib, value) in self.skinAttributes:
			if attrib == "path":
				self.path = value
			else:
				attribs.append((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 13
0
	def applySkin(self, desktop, parent):
		self.sequence = None
		fix_fb_aspect = None
		canvas_size = None
		size = None
		pos = None
		size_idx = None
		pos_idx = None
		attribs = []

		def parseValuePair(str):
			a, b = str.split(',')
			return (int(a), int(b))

		idx = 0
		for (attrib, value) in self.skinAttributes:
			if attrib == "correct_aspect":
				fix_fb_aspect = value
				continue
			elif attrib == "canvas_size":
				canvas_size = parseValuePair(value)
				continue
			elif attrib == "size":
				size = parseValuePair(value)
				size_idx = idx
			elif attrib == "position":
				pos = parseValuePair(value)
				pos_idx = idx
			attribs.append((attrib, value))
			idx += 1

		if fix_fb_aspect and size and pos is not None:
			aspect = AVSwitch().getFramebufferScale()
			if fix_fb_aspect == 'height':
				fixed_height = (size[1] * aspect[0]) / aspect[1]
				y_corr = fixed_height - size[1]
				attribs[pos_idx] = ("position", str(pos[0])+','+str(pos[1] - y_corr))
				attribs[size_idx] = ("size", str(size[0])+','+str(fixed_height))
			elif fix_fb_aspect == 'width':
				fixed_width = (size[0] * aspect[1]) / aspect[0]
				x_corr = size[0] - fixed_width
				attribs[pos_idx] = ("position", str(pos[0] + x_corr)+','+str(pos[1]))
				attribs[size_idx] = ("size", str(fixed_width)+','+str(size[1]))

		self.skinAttributes = attribs

		ret = Renderer.applySkin(self, desktop, parent)

		if canvas_size is not None:
			size = canvas_size

		if size:
			self.instance.setSize(eSize(size[0], size[1]))

		self.pull_updates()

		return ret
Esempio n. 14
0
	def applySkin(self, desktop, parent):
		self.sequence = None
		fix_fb_aspect = None
		canvas_size = None
		size = None
		pos = None
		size_idx = None
		pos_idx = None
		attribs = []

		idx = 0
		for (attrib, value) in self.skinAttributes:
			if attrib == "correct_aspect":
				fix_fb_aspect = value
				continue
			elif attrib == "canvas_size":
				s = parseSize(value, ((1,1),(1,1)), desktop=desktop, guiObject=self.instance)
				canvas_size = s.width(), s.height()
				continue
			elif attrib == "size":
				s = parseSize(value, ((1,1),(1,1)), desktop=desktop, guiObject=self.instance)
				size = s.width(), s.height()
				size_idx = idx
			elif attrib == "position":
				p = parsePosition(value, ((1,1),(1,1)), desktop=desktop, guiObject=self.instance)
				pos = p.x(), p.y()
				pos_idx = idx
			attribs.append((attrib, value))
			idx += 1

		if fix_fb_aspect and size and pos is not None:
			aspect = AVSwitch().getFramebufferScale()
			if fix_fb_aspect == 'height':
				fixed_height = (size[1] * aspect[0]) / aspect[1]
				y_corr = fixed_height - size[1]
				attribs[pos_idx] = ("position", str(pos[0])+','+str(pos[1] - y_corr))
				attribs[size_idx] = ("size", str(size[0])+','+str(fixed_height))
			elif fix_fb_aspect == 'width':
				fixed_width = (size[0] * aspect[1]) / aspect[0]
				x_corr = size[0] - fixed_width
				attribs[pos_idx] = ("position", str(pos[0] + x_corr)+','+str(pos[1]))
				attribs[size_idx] = ("size", str(fixed_width)+','+str(size[1]))

		self.skinAttributes = attribs

		ret = Renderer.applySkin(self, desktop, parent)

		if canvas_size is not None:
			size = canvas_size

		if size:
			self.instance.setSize(eSize(size[0], size[1]))

		self.pull_updates()

		return ret
Esempio n. 15
0
 def applySkin(self, desktop, parent):
     attribs = []
     for None in self.skinAttributes:
         (attrib, value) = None
         if attrib == 'path':
             self.path = value
             continue
         attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'size':
                self.size = value.split(',')
            attribs.append((attrib, value))

        self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, parent)
        return ret
Esempio n. 17
0
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'path':
                self.path = iconpath
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 18
0
    def applySkin(self, desktop, parent):
        muyqzl = []
        for ywprvi, value in self.skinAttributes:
            if ywprvi == 'size':
                self.lxktpt = value.split(',')
            muyqzl.append((ywprvi, value))

        self.skinAttributes = muyqzl
        zlzvtk = Renderer.applySkin(self, desktop, parent)
        return zlzvtk
	def applySkin(self, desktop, parent):
		self.number = 0
		attribs = [ ]
		for (attrib, value) in self.skinAttributes:
			if attrib == "number":
				self.number = int(value)
			else:
				attribs.append((attrib, value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 20
0
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'DescriptionText':
                self.DescriptionText = value
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 21
0
	def applySkin(self, desktop, parent):
		attribs = self.skinAttributes[:]
		for (attrib, value) in self.skinAttributes:
			if attrib == "path":
				self.addPath(value)
				attribs.remove((attrib,value))
			elif attrib == "isFrontDisplayPicon":
				self.showPicon = value == "0"
				attribs.remove((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 22
0
        def applySkin(self, desktop, parent):
            atrs = []
            for atr, value in self.skinAttributes:
		if (atr == 'path'):
			self.path = value                    
                elif atr == 'size':
                    self.size = value.split(',')
                atrs.append((atr, value))
            self.skinAttributes = atrs
            aply = Renderer.applySkin(self, desktop, parent)
            return aply
Esempio n. 23
0
    def applySkin(self, desktop, parent):
        attribs = self.skinAttributes[:]
        for attrib, value in self.skinAttributes:
            if attrib == 'path':
                self.addPath(value)
                attribs.remove((attrib, value))
            elif attrib == 'size':
                self.piconsize = value

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 24
0
	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)
Esempio n. 25
0
 def applySkin(self, desktop, parent):
     attribs = self.skinAttributes[:]
     for (attrib, value) in self.skinAttributes:
         if attrib == "hidePip":
             self.hidePip = value == 1
             attribs.remove((attrib, value))
     self.skinAttributes = attribs
     ret = Renderer.applySkin(self, desktop, parent)
     if ret:
         self.Position = self.instance.position()
         self.Size = self.instance.size()
     return ret
Esempio n. 26
0
 def applySkin(self, desktop, parent):
     attribs = []
     for (attrib, value) in self.skinAttributes:
         if attrib == "size":
             self.sizeX = int(value.strip().split(",")[0])
             attribs.append((attrib, value))
         elif attrib == "emptyText":
             self.EmptyText = value
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 27
0
 def applySkin(self, desktop, parent):
     attribs = []
     for (
             attrib,
             value,
     ) in self.skinAttributes:
         if (attrib == 'path'):
             self.path = value
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 28
0
    def applySkin(self, desktop, parent):
        attribs = []
        longtext_attribs = []
        for attrib, value in self.skinAttributes:
            if attrib.find('step') != -1:
                self.step = int(value)
            if attrib.find('steptime') != -1:
                self.steptime = int(value)
            if attrib.find('startdelay') != -1:
                self.startdelay = int(value)
            if attrib.find('font') != -1 or attrib.find(
                    'size'
            ) != -1 or attrib.find('zPosition') != -1 or attrib.find(
                    'transparent') != -1 or attrib.find(
                        'backgroundColor') != -1 or attrib.find(
                            'foregroundColor') != -1 or attrib.find(
                                'valign') != -1 or attrib.find('halign') != -1:
                longtext_attribs.append((attrib, value))
            if attrib != 'font' and attrib != 'valign' and attrib != 'halign' and attrib != 'foregroundColor' and attrib != 'step' and attrib != 'steptime' and attrib != 'startdelay' and attrib != 'css':
                attribs.append((attrib, value))
            if attrib.find('css') != -1:
                from skin import cascadingStyleSheets
                styles = value.split(',')
                for style in styles:
                    for _attrib in cascadingStyleSheets[style].keys():
                        _value = cascadingStyleSheets[style][_attrib]
                        if _attrib.find('step') != -1:
                            self.step = int(_value)
                        if _attrib.find('steptime') != -1:
                            self.steptime = int(_value)
                        if _attrib.find('startdelay') != -1:
                            self.startdelay = int(_value)
                        if _attrib.find('font') != -1 or _attrib.find(
                                'size') != -1 or _attrib.find(
                                    'zPosition') != -1 or _attrib.find(
                                        'transparent') != -1 or _attrib.find(
                                            'backgroundColor'
                                        ) != -1 or _attrib.find(
                                            'foregroundColor'
                                        ) != -1 or _attrib.find(
                                            'valign') != -1 or _attrib.find(
                                                'halign') != -1:
                            longtext_attribs.append((_attrib, _value))
                        if _attrib != 'font' and _attrib != 'valign' and _attrib != 'halign' and _attrib != 'foregroundColor' and _attrib != 'step' and _attrib != 'steptime' and _attrib != 'startdelay':
                            attribs.append((_attrib, _value))

        skin.applyAllAttributes(self.long_text, desktop, longtext_attribs,
                                parent.scale)
        self.long_text.move(ePoint(0, 0))
        self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, parent)
        self.changed((self.CHANGED_DEFAULT, ))
        return ret
Esempio n. 29
0
 def applySkin(self, desktop, parent):
     attribs = self.skinAttributes[:]
     for (attrib, value) in self.skinAttributes:
         if attrib == "path":
             self.addPath(value)
             attribs.remove((attrib, value))
         elif attrib == "isFrontDisplayPicon":
             self.showPicon = value == "0"
             attribs.remove((attrib, value))
     self.skinAttributes = attribs
     self.changed((self.CHANGED_ALL, ))
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 30
0
	def applySkin(self, desktop, parent):
		attribs = [ ]
		for (attrib, value) in self.skinAttributes:
			if attrib == "size":
				self.sizeX = int(value.strip().split(",")[0])
				attribs.append((attrib,value))
			elif attrib == "emptyText":
				self.EmptyText = value
			else:
				attribs.append((attrib,value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 31
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value) in self.skinAttributes:
			if attrib == 'path':
				self.path = value
			elif attrib == 'size':
				self.size = value.split(',')
			elif attrib == 'pixdelay':
				self.pixdelay = int(value)
			attribs.append((attrib, value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 32
0
    def applySkin(self, desktop, parent):
        attribs = self.skinAttributes[:]
        for attrib, value in self.skinAttributes:
            if attrib == 'iconspath':
                if value[:1] == '/':
                    self.iconPath = value
                else:
                    self.iconPath = resolveFilename(SCOPE_CURRENT_SKIN, value)
                attribs.remove((attrib, value))

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 33
0
	def applySkin(self, desktop, parent):
		attribs = self.skinAttributes[:]
		for (attrib, value) in self.skinAttributes:
			if attrib == "hidePip":
				self.hidePip = value == 1
				attribs.remove((attrib,value))
		self.skinAttributes = attribs
		ret = Renderer.applySkin(self, desktop, parent)
		if ret:
			self.Position = self.instance.position()
			self.Size = self.instance.size()
		return ret
Esempio n. 34
0
    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)
Esempio n. 35
0
    def applySkin(self, desktop, parent):
        attribs = self.skinAttributes[:]
        for attrib, value in self.skinAttributes:
            if attrib == 'iconspath':
                if value[:1] == '/':
                    self.iconPath = value
                else:
                    self.iconPath = resolveFilename(SCOPE_CURRENT_SKIN, value)
                attribs.remove((attrib, value))

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 36
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value,) in self.skinAttributes:
			if (attrib == 'path'):
				self.path = value
			elif (attrib == 'picon_default'):
				self.picon_default = value
			else:
				attribs.append((attrib, value))
				
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 37
0
 def applySkin(self, desktop, parent):
     attribs = self.skinAttributes[:]
     for (attrib, value) in self.skinAttributes:
         if attrib == "path":
             lcdPiconLocator.addSearchPath(value)
             attribs.remove((attrib, value))
         elif attrib == "size":
             self.piconsize = value
     self.skinAttributes = attribs
     rc = Renderer.applySkin(self, desktop, parent)
     self.changed((self.CHANGED_DEFAULT, ))
     return rc
Esempio n. 38
0
class speedyj00zekPiconAnimation(Renderer):
    __module__ = __name__

    def __init__(self):
        Renderer.__init__(self)
        self.pixmaps = 'animatedPicons'
        self.pixdelay = 50
        self.doAnim = False
        self.doLockPath = False
        self.animCounter = 0
        self.count = 0
        self.slideIcon = 0
        self.pixstep = 1
        self.pics = []
        self.picsFolder = []
        self.animTimer = eTimer()
        self.animTimer.callback.append(self.timerEvent)
        self.what = ['CHANGED_DEFAULT','CHANGED_ALL','CHANGED_CLEAR','CHANGED_SPECIFIC','CHANGED_POLL']

    def applySkin(self, desktop, parent):
        if DBG: j00zekDEBUG('[j00zekPiconAnimation]:[applySkin] >>>')
        #Load attribs
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'pixmaps':
                self.pixmaps = value
            elif attrib == 'lockpath':
                if value == 'True':
                    self.doLockPath = True
            elif attrib == 'pixdelay':
                self.pixdelay = int(value)
                if self.pixdelay < 40:
                    self.pixdelay = 50
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        #Load animation into memory
        try:
            if config.plugins.j00zekPiconAnimation.UserPathEnabled.value == True and self.doLockPath == False:
                if os.path.exists(config.plugins.j00zekPiconAnimation.UserPath.value):
                    self.loadPNGsAnim(config.plugins.j00zekPiconAnimation.UserPath.value)
                    self.loadPNGsSubFolders(config.plugins.j00zekPiconAnimation.UserPath.value)
                elif DBG: j00zekDEBUG('[j00zekPiconAnimation]:[applySkin] User path "%s" selected but does NOT exist' % config.plugins.j00zekPiconAnimation.UserPath.value)
            else:
                for path in searchPaths:
                    if self.loadPNGsAnim(os.path.join(path, self.pixmaps)) == True:
                        break
                self.loadPNGsSubFolders(os.path.join(path, self.pixmaps))
        except Exception, e:
            if DBG: j00zekDEBUG('[j00zekPiconAnimation]:[applySkin] Exception %s' % str(e))
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 39
0
 def applySkin(self, desktop, parent):
     self.number = 0
     attribs = []
     for (attrib, value) in self.skinAttributes:
         if attrib == "number":
             self.number = int(value)
         elif attrib == "lines":
             self.number = int(value) + 1
             self.lines = True
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 40
0
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'path':
                self.path = value
            elif attrib == 'pixmap':
                self.noCoverFile = value
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, parent)
        return ret
Esempio n. 41
0
 def applySkin(self, desktop, parent):
     attribs = []
     for attrib, value in self.skinAttributes:
         if attrib == 'path':
             self.path = value
         elif attrib == 'piconWidth':
             self.piconWidth = int(value)
         elif attrib == 'piconHeight':
             self.piconHeight = int(value)
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
 def applySkin(self, desktop, parent):
     attribs = []
     for (
             attrib,
             value,
     ) in self.skinAttributes:
         if attrib == 'text':
             value = self.text
             attribs.append((attrib, value))
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 43
0
	def applySkin(self, desktop, parent):
		attribs = [ ]
		for (attrib, value) in self.skinAttributes:
			if attrib == "path":
				self.path = value
			else:
				attribs.append((attrib,value))
			if attrib == "size":
				value = value.split(',')
				if len(value) == 2:
					self.size = value[0] + "x" + value[1]
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 44
0
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'path':
                self.path = value
            elif attrib == 'pixmap':
                self.noCoverFile = value
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, parent)
        return ret
Esempio n. 45
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value,) in self.skinAttributes:
			if attrib == 'path':
				self.path = value
				if value.endswith("/"):
					self.path = value
				else:
					self.path = value + "/"
			else:
				attribs.append((attrib, value))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 46
0
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'pixmap':
                self.noCoverPixmap = LoadPixmap(value)
            elif attrib == 'useCache':
                self.use_cache = value
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        ret = Renderer.applySkin(self, desktop, parent)
        return ret
Esempio n. 47
0
 def applySkin(self, desktop, parent):
     atrs = []
     for atr, value in self.skinAttributes:
         if (atr == 'path'):
             self.path = value
         elif atr == 'size':
             self.size = value.split(',')
         elif atr == "pixdelay":
             self.pixdelay = int(value)
         atrs.append((atr, value))
     self.skinAttributes = atrs
     aply = Renderer.applySkin(self, desktop, parent)
     return aply
Esempio n. 48
0
	def applySkin(self, desktop, parent):
		attribs = self.skinAttributes[:]
		for attrib, value in self.skinAttributes:
			if attrib == "size":
				self.piconsize = value
			elif attrib == 'nextEvent':          # 0(current), 1, 2, 3.........
				self.nxEvnt = int(value)
			elif attrib == 'usedImage':          # poster, banner, backdrop
				self.nxEvntUsed = value
			elif attrib == 'delayPic':          # delay time(ms) for poster-banner-backdrop showing...
				self.delayPicTime = int(value)
			
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'pixmaps':
                self.pixmaps = value.split(',')
            elif attrib == 'pixdelay':
                self.pixdelay = int(value)
            elif attrib == 'control':
                self.control = int(value)
            else:
                attribs.append((attrib, value))

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 50
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value,) in self.skinAttributes:
		        if attrib == "path":
			      self.path = value                         
			elif attrib == "pixdelay":
				self.pixdelay = int(value)			
			elif attrib == "control":
				self.control = int(value)				
			else:
				attribs.append((attrib, value))
				
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 51
0
    def applySkin(self, desktop, parent):
        attribs = []
        for attrib, value in self.skinAttributes:
            if attrib == 'path':
                self.path = value
            else:
                attribs.append((attrib, value))
            if attrib == 'size':
                value = value.split(',')
                if len(value) == 2:
                    self.size = value[0] + 'x' + value[1]

        self.skinAttributes = attribs
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 52
0
    def applySkin(self, desktop, parent):
        attribs = self.skinAttributes[:]
        for attrib, value in self.skinAttributes:
            if attrib == 'path':
                self.addPath(value)
                attribs.remove((attrib, value))
            elif attrib == 'size':
                self.piconsize = value
            elif attrib == 'picontype':
                self.piconType = value
                attribs.remove((attrib, value))
            elif attrib == 'showdefaultpic':
                if value in ('False', 'no'): self.ShowDefault = False
                attribs.remove((attrib, value))
            elif attrib == 'gifsupport':
                if value in ('True', 'yes'): self.GIFsupport = True
                attribs.remove((attrib, value))
            elif attrib == 'doAnimation':
                try:
                    animVals = value.split(
                        ','
                    )  # doAnimationanimation="<'blink'|>,<fadeInTime>,<showTime>,<fadeOutTime>,<hideTime>"
                    self.animationType = animVals[0]

                    self.animTimer = eTimer()
                    if self.animationType == 'blink':  #doAnimationanimation="blink,<showTime>,<hideTime>"
                        self.animTimer.callback.append(self.doBlink)
                        self.showTime = int(animVals[1])
                        self.hideTime = int(animVals[2])
                    else:
                        self.fadeInTime = int(animVals[1])
                        self.showTime = int(animVals[2])
                        self.fadeOutTime = int(animVals[3])
                        self.hideTime = int(animVals[4])

                    self.animTimerInitCall = False
                    attribs.remove((attrib, value))
                except Exception as e:
                    self.animationType = None
                    if DBG:
                        j00zekDEBUG('[j00zekPicons:applySkin] Exception=%s' %
                                    str(e))

        self.skinAttributes = attribs
        if DBG:
            j00zekDEBUG(
                '[j00zekPicons:applySkin] self.piconType=%s, self.ShowDefault=%s'
                % (self.piconType, self.ShowDefault))
        return Renderer.applySkin(self, desktop, parent)
 def applySkin(self, desktop, parent):
     attribs = []
     for (attrib, value) in self.skinAttributes:
         if attrib == "numEvents":
             self.numEvents = int(value)
         elif attrib == "maxDescriptionLines":
             self.numDescLines = int(value)
         elif attrib == "font":
             self.used_font = parseFont(value, ((1, 1), (1, 1)))
         elif attrib == "foregroundColor":
             self.fcolor = parseColor(value)
         elif attrib == "foregroundColorTime":
             self.timecolor = parseColor(value)
         elif attrib == "backgroundColor":
             self.bcolor = parseColor(value)
         elif attrib == "foregroundColorDescription":
             self.fdcolor = parseColor(value)
         elif attrib == "fontDescription":
             self.desc_font = parseFont(value, ((1, 1), (1, 1)))
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     self.testSizeLabel.setFont(self.used_font)
     self.testSizeLabel.resize(eSize(self.W + 500, 20))
     self.testSizeLabel.setVAlign(eLabel.alignTop)
     self.testSizeLabel.setHAlign(eLabel.alignLeft)
     self.testSizeLabel.setNoWrap(1)
     tmp = int(fontRenderClass.getInstance().getLineHeight(self.used_font)
               or self.used_font.pointSize / 6 + self.used_font.pointSize)
     self.testSizeLabel.setText("WQq")
     self.lineHeight = self.testSizeLabel.calculateSize().height()
     if tmp > self.lineHeight:
         self.lineHeight = tmp
     self.testSizeLabel.setText("59:59  ")
     self.timeWidth = self.testSizeLabel.calculateSize().width() + 10
     self.testSizeLabel.setText("")
     self.testSizeLabel.setFont(self.desc_font)
     tmp = int(fontRenderClass.getInstance().getLineHeight(self.desc_font)
               or self.desc_font.pointSize / 6 + self.desc_font.pointSize)
     self.testSizeLabel.setText("WQq")
     self.lineHeight_desc = self.testSizeLabel.calculateSize().height()
     if tmp > self.testSizeLabel.calculateSize().height():
         self.lineHeight_desc = tmp
     self.lineHeight_desc *= self.numDescLines
     self.testSizeLabel.setText("")
     self.testSizeLabel.resize(eSize(self.W - 10, 1000))
     self.testSizeLabel.setHAlign(eLabel.alignBlock)
     self.testSizeLabel.setNoWrap(0)
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 54
0
    def applySkin(self, desktop, parent):
        attribs = []
        width = None
        fontsize = None
        for attrib, value in self.skinAttributes:
            if attrib == 'size':
                width = float(value.split(',')[0])
            elif attrib == 'font':
                fontsize = float(value.split(';')[1])
            attribs.append((attrib, value))

        self.skinAttributes = attribs
        if width and fontsize:
            self.stringlength = int(width / fontsize * 1.9)
        return Renderer.applySkin(self, desktop, parent)
Esempio n. 55
0
 def applySkin(self, desktop, parent):
     attribs = []
     for (
             attrib,
             value,
     ) in self.skinAttributes:
         if attrib == 'foregroundColor':
             self.colors = value
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     self.firstColor = self.convert_color(self.colors.split(',')[0].strip())
     self.secondColor = self.convert_color(
         self.colors.split(',')[-1].strip())
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 56
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, what,) in self.skinAttributes:
			if (attrib == 'hColor'):
				self.fColorh = parseColor(what)
			elif (attrib == 'mColor'):
				self.fColorm = parseColor(what)
			elif (attrib == 'sColor'):
				self.fColors = parseColor(what)
			elif (attrib == 'linewidth'):
				self.linewidth = int(what)
			else:
				attribs.append((attrib, what))
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)
Esempio n. 57
0
 def applySkin(self, desktop, parent):
     attribs = []
     for (attrib, value) in self.skinAttributes:
         if attrib == "pixmapPath":
             for scope in (SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN):
                 tmp = resolveFilename(scope, value)
                 if '%d' in tmp and fileExists(tmp % (0)):
                     self.pixmapPath = tmp
                     break
         elif attrib == "pixmapCount":
             self.pixmapCount = int(value)
         else:
             attribs.append((attrib, value))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 58
0
 def applySkin(self, desktop, parent):
     attribs = self.skinAttributes[:]
     for (attrib, value) in self.skinAttributes:
         if attrib == "path":
             self.addPath(value)
             attribs.remove((attrib, value))
         elif attrib == "isFrontDisplayPicon":
             self.showPicon = value == "0"
             attribs.remove((attrib, value))
         elif attrib == "usePicLoad":
             self.usePicLoad = value == "1"
             attribs.remove((attrib, value))
         elif attrib == "size":
             self.piconsize = value
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 59
0
 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)
         elif (attrib == 'linewidth'):
             self.linewidth = int(what)
         else:
             attribs.append((attrib, what))
     self.skinAttributes = attribs
     return Renderer.applySkin(self, desktop, parent)
Esempio n. 60
0
	def applySkin(self, desktop, parent):
		attribs = []
		for (attrib, value,) in self.skinAttributes:
			if (attrib == 'path'):
				self.path = value
			elif (attrib == 'picon_default'):
				self.picon_default = value
			elif attrib == "pixmaps":
				self.pixmaps = value.split(',')
			elif attrib == "pixdelay":
				self.pixdelay = int(value)
			else:
				attribs.append((attrib, value))
				
		self.skinAttributes = attribs
		return Renderer.applySkin(self, desktop, parent)