[Rejected] include global defines xml files (new feature) (1 Viewer)

ajp8164

Portal Pro
January 9, 2008
575
1,166
Atlanta, GA
Home Country
United States of America United States of America
This patch allows for skin developers to create one or more xml files that contain only <define> nodes. 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.

Below is a sample xml skin file that contains only defines (the name of the file is arbitrary) and an example of how to consume this file in another xml skin file. I have bolded the reference to defines.xml and highlighted in red the use of a specific define (screenWidth).

Note that the <include> for defines.xml must appear inside the <controls> node. This implementation allows you to have both an included defines xml file and a set of defines locally specified inside the target skin file (e.g., timeTextColor in this case BasicHome.xml). The implementation aggregates the defines from both files.

defines.xml:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
	[COLOR="Red"]<define>#screenWidth:1366</define>[/COLOR]
	<define>#screenHeight:768</define>
	<define>#screenTitleTextColor:FFFFFFFF</define>
</window>

BasicHome.xml: (a sample consumer of defines.xml)
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
	<id>35</id>
	<defaultcontrol>1</defaultcontrol>
	<allowoverlay>no</allowoverlay>
	<disabletopbar>yes</disabletopbar>	

	<define>#timeTextColor:FFFFFFFF</define>

	<controls>	

		[B]<include>defines.xml</include>[/B]
		<include>common.background.xml</include>
		
	    <!-- MAIN MENU BAR -->
		<control>
			<type>image</type>
			<id>999</id>
			[COLOR="Red"]<width>#screenWidth</width>[/COLOR]
			<height>84</height>
			<texture>menubar.png</texture>
		</control>
...
 

Attachments

  • include_defines.patch
    30.6 KB

misterd

Retired Team Member
  • Premium Supporter
  • April 4, 2006
    1,597
    314
    Home Country
    Germany Germany
    The idea itself is good, but the integration breaks the structure of the xml files. You include something within the controls tag that is normally not defined in the controls tags. If the include would be directly in the window tag it would make more sense and would have a chance for integration.

    Therefor I will reject this patch. :sorry:

    MisterD
     

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    Home Country
    United States of America United States of America
    @MisterD

    I have posted a 2nd attempt patch in a separate thread (just to keep things clean) that addresses this concern. I too noticed this when I create the implementation; thanks for forcing me to improve the implementation :D
    https://forum.team-mediaportal.com/submit-patches-mediaportal-tv-server-etc-325/include-global-defines-xml-files-2nd-attempt-69899/#post504250

    -Andy


    The idea itself is good, but the integration breaks the structure of the xml files. You include something within the controls tag that is normally not defined in the controls tags. If the include would be directly in the window tag it would make more sense and would have a chance for integration.

    Therefor I will reject this patch. :sorry:

    MisterD
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,567
    10,557
    Königstein (Taunus)
    Home Country
    Germany Germany
    If you put all necessary <define>s into the reference.xml, you have a central point. What I found out during my time of skinning that the interpretation of a lot of <define>s in a skin slow down the skin peformance significantly.
     

    Users who are viewing this thread

    Top Bottom