[Approved] include global defines xml files (3rd attempt) (1 Viewer)

ajp8164

Portal Pro
January 9, 2008
575
1,166
Atlanta, GA
Home Country
United States of America United States of America
This is a third attempt :) to have this feature accepted. In this implementation the references.xml file is leveraged.

-----

This patch allows for skin developers to place <define> nodes inside the references.xml file. This is useful for centralizing the definitions for colors, design screen sizes and other parameters used in controls. Without this feature skin designers either hard code the values into controls or create defines in every xml file. Either way, this leaves the skin designer (or re-designer) with a lot of work to switch the values of these control parameters.

This implementation does not alter the prior implementation of the <define> node. You may still place a <define> node inside the <window> node of an xml skin file. However, if you place the same <define> node in both the references.xml file as well as the skin file for a window definition then the value defined in the skin file will override the value set in the references.xml. This behavior mirrors the present behavior of the references.xml control "template" attributes being overridden by the values defined in skin window file.

Below is a sample references.xml file fragment that contains defines. By the way: promoting the use of <style> tags too :)

references.xml:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<controls>
	<skin>
		<width>1366</width>
		<height>768</height>
		<version>1.0.1.0</version>
	</skin>
	[COLOR="Red"]<define>#screenWidth:1366</define>
	<define>#screenHeight:768</define>
	<define>#screenTitleTextColor:FFFFFFFF</define>
	<define>#timeTextColor:FFFFFFFF</define>[/COLOR]
	<style Name="smallTitle">
		<id>0</id>
		<width>220</width>
		<font>font10</font>
		<textcolor>ffffffff</textcolor>
		<shadowAngle>45</shadowAngle>
		<shadowDistance>2</shadowDistance>
		<shadowColor>ff222222</shadowColor>
	</style>
	<control>
		<description>default image</description>
		<type>image</type>
		<id>1</id>
		<posX>0</posX>
		<posY>0</posY>
		<width>32</width>
		<height>32</height>
		<texture>background.png</texture>
		<colorkey>0</colorkey>
		<colordiffuse>ffffffff</colordiffuse>
		<filtered>yes</filtered>
		<centered>no</centered>
		<keepaspectratio>no</keepaspectratio>
		<visible>yes</visible>
	</control>
...
 

Attachments

  • defines_in_references.patch
    30.7 KB

chemelli

Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    Sorry but no place for new features/changes in skin engine. Will consider it to after 1.1.0

    Simone
     

    aj1405

    Portal Pro
    September 30, 2007
    443
    302
    Home Country
    Norway Norway
    Thanks ajp8164.

    Your patch would greatly ease the job for us skinners.

    With the help of your patch and String.Equals we would be able to control all pre defined user customization from one file.

    I urge the MediaPortal developers to reconsider adding this patch.
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Hi,

    We are in feature freeze. This is clearly a new feature, and could cause other problems. Therefore, as Simone said, the correct time to consider this is after 1.1.0 is released.

    Mark
     

    Users who are viewing this thread

    Top Bottom