Editing XMBML Coding

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
== Basic XMBML Structure ==
This page will outline the logic behind [[XMB]] .xml configuration files.  
This page outlines the logic behind [[XMB]] XML configuration files. For some practise usage see: [[XMBML Coding Examples]]


== Basic XML Structure ==
This is a reduced version of [[XMB-Network | category_network.xml]] with only one icon (tex_browser) that launches the webbrowser (type:x-xmb/xmlwebbrowser). The .xml is loaded starting from <View id="root">, then inside the <Items> table there is a <Query> linking to #seg_browser (the character "#" links to a <View id> in the same file, so is linked to <View id="seg_browser">). When <View id="seg_browser"> is loaded first starts reading the table of <Items> that contains an <Item> that is linked using attr="browser" to a table of attributes <Table key="browser"
This is a reduced version of [[XMB-Network | category_network.xml]] with only one icon (tex_browser) that launches the webbrowser (type:x-xmb/xmlwebbrowser). The .xml is loaded starting from <View id="root">, then inside the <Items> table there is a <Query> linking to #seg_browser (the character "#" links to a <View id> in the same file, so is linked to <View id="seg_browser">). When <View id="seg_browser"> is loaded first starts reading the table of <Items> that contains an <Item> that is linked using attr="browser" to a table of attributes <Table key="browser"


{{Boxcode|code=<syntaxhighlight lang="xml">
{{Boxcode|content=<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>


Line 32: Line 32:
**&lt;View id="seg_browser"&gt; contains 1 &lt;Items&gt; with the key="browser"
**&lt;View id="seg_browser"&gt; contains 1 &lt;Items&gt; with the key="browser"


{{Boxcode|code=<syntaxhighlight lang="xml">
{{Boxcode|content=<syntaxhighlight lang="xml">
<View id="root">
<View id="root">
<Items>
<Items>
Line 71: Line 71:
|+Tags used by class/subclass
|+Tags used by class/subclass
! Query classes x-xmb !! <key> !! <attr> !! <src> !! Remarks
! Query classes x-xmb !! <key> !! <attr> !! <src> !! Remarks
|-
| <Query class="type:x-xmb/'''category'''" || {{Yes}} || {{Yes}} || {{Yes}} || Main/Root XMB
|-
|-
| <Query class="type:x-xmb/'''folder-pixmap'''" || {{Yes}} || {{Yes}} || {{Yes}} || Has many uses see [[XMBML Functions|here]]
| <Query class="type:x-xmb/'''folder-pixmap'''" || {{Yes}} || {{Yes}} || {{Yes}} || Has many uses see [[XMBML Functions|here]]
Line 102: Line 100:
! Item classes x-xmb !! <key> !! <attr> !! <src> !! Remarks
! Item classes x-xmb !! <key> !! <attr> !! <src> !! Remarks
|-
|-
| <Item class="type:x-xmb/'''module-action'''" || {{Yes}} || {{Yes}} || {{No}} || Uses a particular module to support the XMB item. See [[XMBML module-action]] page
| <Item class="type:x-xmb/'''module-action'''" || {{Yes}} || {{Yes}} || {{No}} || Uses a particular module to support the XMB item. See [[VSH_module-action|VSH module-action]] page
|-
|-
| <Item class="type:x-xmb/'''vmc-new'''" || {{Yes}} || {{Yes}} || {{No}} ||  
| <Item class="type:x-xmb/'''vmc-new'''" || {{Yes}} || {{Yes}} || {{No}} ||  
Line 109: Line 107:
|-
|-
| <Item class="type:x-xmb/'''xmleditingvideo'''" || {{Yes}} || {{Yes}} || {{No}} ||  
| <Item class="type:x-xmb/'''xmleditingvideo'''" || {{Yes}} || {{Yes}} || {{No}} ||  
|-
| <Item class="type:x-xmb/'''xmlflashplayer'''" || {{Yes}} || {{Yes}} || {{No}} ||
|-
|-
| <Item class="type:x-xmb/'''xmlgameexit'''" || {{Yes}} || {{No}} || {{No}} ||  
| <Item class="type:x-xmb/'''xmlgameexit'''" || {{Yes}} || {{No}} || {{No}} ||  
Line 286: Line 282:
|-
|-
| x-host/'''mount-info''' || ? || ? || ? || found inside explore_plugin.sprx
| x-host/'''mount-info''' || ? || ? || ? || found inside explore_plugin.sprx
|-
| x-host/'''unknown''' || ? || ? || ? || found inside explore_plugin.sprx
|-
|-
| x-host/'''directory''' || ? || ? || ? || found inside explore_plugin.sprx
| x-host/'''directory''' || ? || ? || ? || found inside explore_plugin.sprx
Line 343: Line 341:
| {{No}} || ? || ? || {{No}} || ? || ? || ? || ? || ?
| {{No}} || ? || ? || {{No}} || ? || ? || ? || ? || ?
| ? || ? || ?
| ? || ? || ?
| {{Yes}} || ? || ? || ? || ? || ? || ? || {{Yes}} || ? || ? || ? || {{Yes}} || ? || ? || ?
| {{Yes}} || ? || ? || ? || ? || ? || ? || {{Yes}} || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "none", "hide", "game_pspemu_viewmode", "game_pspemu_3d", "game_psemu_upcon", "game_psemu_smooth", "pad_assign", "pad_vibration", "bt_device_utility", "audio_setting", "voice_changer", "net_netlist"
| "none", "hide"
|-
|-
| connection
| cf_connection
| ? || ? || ? || ? || ? || ? || ? || {{Yes}} || {{Yes}}
| ? || ? || ? || ? || ? || ? || ? || {{Yes}} || {{Yes}}
| ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| "xcb://localhost/query?..."
|-
| cf_connection
| ? || ? || ? || ? || ? || ? || ? || {{Yes}} || ?
| ? || ? || ?
| ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
Line 373: Line 364:
| {{No}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| {{No}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "segment", "grid", "Video"
| "segment"
|-
|-
| content_id
| content_id
Line 429: Line 420:
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || {{Yes}}
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || {{Yes}}
| ?
| ?
| "game", "video", "tv"
| "game"
|-
|-
| custom_priority
| custom_priority
Line 436: Line 427:
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "game=-80", "video=-80", "tv=-80"
| "game=-80", "video=-80"  
|-
|-
| data_connection
| data_connection
Line 457: Line 448:
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "0" - float number
| "0"  
|-
|-
| fo_lbl2_alpha
| fo_lbl2_alpha
Line 464: Line 455:
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "0" - float number
| "0"  
|-
|-
| focus
| focus
Line 485: Line 476:
| {{Yes}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| {{Yes}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "6". "-50", "-49", "-48", "-47", "-46". "-80"
| "0", "1", "2", "3", "4", "5", "6", "-46", "-47", "-48", "-49", "-50"  
|-
|-
| fs_path
| fs_path
Line 507: Line 498:
| ?
| ?
| "/dev_hdd0/myicon.png"  
| "/dev_hdd0/myicon.png"  
|-
| icon_fixed_height
| {{Yes}} || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| "181"
|-
| icon_fixed_width
| {{Yes}} || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| "181"
|-
|-
| icon_notation
| icon_notation
Line 611: Line 588:
| {{Yes}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| {{Yes}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "NotifyErrorNoExecute", "http://m.facebook.com", 0, 1
| "NotifyErrorNoExecute", "http://m.facebook.com"
|-
|-
| module_name
| module_name
Line 626: Line 603:
| ?
| ?
| "xcb://localhost/query?..."
| "xcb://localhost/query?..."
|-
| name
| ? || ? || ? || ? || ? || ? || ? || ? || ?
| ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| "Flash Player[test.swf]"
|-
|-
| path
| path
Line 639: Line 609:
| ? || ? || ? || ? || ? || ? || ? || ? || ? || {{Yes}} || ? || ? || ? || ? || ?
| ? || ? || ? || ? || ? || ? || ? || ? || ? || {{Yes}} || ? || ? || ? || ? || ?
| ?
| ?
| "flash0/vsh/resource/flash/test.swf"
| ?
|-
|-
| pkg_src
| pkg_src
Line 681: Line 651:
| {{No}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| {{No}} || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ? || ?
| ?
| ?
| "msg_error_no_file", any message text from explore_plugin rco works
| "msg_error_no_file"
|-
|-
| title
| title
Line 818: Line 788:
'''icon_rsc'''. Displays an image from a .rco as XMB icon. Cannot be used at the same time as 'icon'
'''icon_rsc'''. Displays an image from a .rco as XMB icon. Cannot be used at the same time as 'icon'


'''info'''. Displays XMB title information from plain text input. This is shown below the 'title' or 'title_rsc' entry in a smaller font
'''info'''. Displays XMB title information from plain text input. This is shown below the 'title' or 'title_rsc' entry in a smaller font. Cannot be used at the same time as 'info_rsc'


'''info_rsc'''. Displays XMB title information from relevant .rco. This is shown below the 'title' or 'title_rsc' entry in a smaller font
'''info_rsc'''. Displays XMB title information from relevant .rco. This is shown below the 'title' or 'title_rsc' entry ins a smaller font. Cannot be used at the same time as 'info'


'''ingame''' Use: tells the PS3 if the item can be accessed ingame
'''ingame''' Use: tells the PS3 if the item can be accessed ingame
Line 842: Line 812:
'''module_action'''. Is the commanded to be used by the module
'''module_action'''. Is the commanded to be used by the module


'''module_name''' Use: the name of the module to be used from the [[XMBML module-action]] list
'''module_name''' Use: the name of the module to be used from this [[VSH Module-Action|list]]


'''str_noitem'''. Displays information from relevant .rco when no data/XMB items are found
'''str_noitem'''. Displays information from relevant .rco when no data/XMB items are found
Line 850: Line 820:
'''title_rsc'''. Displays XMB main title text referred from relevant .rco. Cannot be used at the same time as 'title'
'''title_rsc'''. Displays XMB main title text referred from relevant .rco. Cannot be used at the same time as 'title'


==Loading resource files from the associated .rco==
== Examples ==
The attributes with names containing '''rsc''' (resource), '''str''' (string), or '''msg''' (message), as '''icon_rsc''', '''title_rsc''', '''info_rsc''', and '''instruction_rsc''' can load images or texts from the .rco associated with the XMB column (the variants of explore_category_****.rco, and explore_plugin_full.rco that is common for all XMB categories, also some others that are specific for a category as gamelib_plugin.rco or gamedata_plugin.rco)
 
{{RCO TOC reference types}}
=== An XMB item tree ===
For this we will make a XMB item which will act as a folder opening up into 3 other XMB items.
 
1/ First create the root XMB item which acts as a folder
{{Boxcode|content=<syntaxhighlight lang="xml">
<View id="XMB_Folder_1">
<Attributes>
<Table key="xmb_folder">
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair>
<Pair key="title"><String>XMB Menu Item</String></Pair>
<Pair key="info"><String>This will subdivide into 3 items :)</String></Pair>
<Pair key="child"><String>segment</String></Pair>
</Table>
</Attributes>
<Items>
<Query class="type:x-xmb/folder-pixmap"  key="xmb_folder" attr="xmb_folder" src="#XMB_Folder_1_container" />
</Items>
</View>
</syntaxhighlight>}}
Important Notes:
* I've used "''&lt;Query class="type:x-xmb/folder-pixmap"''" for &lt;Items&gt; sub-entry type as it is good for displaying menus.
* The 'attr' in the &lt;Items&gt; sub-entry (xmb_folder) is the same as the table key in Attibutes, so those attributes are assigned to the xmb_folder &lt;Items&gt; sub-entry.
* the 'src' is pointing to 'XMB_Folder_1_container' - the another XMB .xml entry in the current .xml
* the icon is from a .rco file and is a basic folder icon, like what the 'Game Data' XMB item uses
* 'title' and 'info' are in plain text
* 'child' is set as 'segment' so the XMB knows this item will subdivide into other XMB items
 
In order to create a working XMB sub menu the root xmb item (in this "XMB_Folder_1") must have its 'src' linking to a "container" (its the best way to think about it) and not directly linking to XMB items in the sub menu.( If you do not do this when you select your root XMB item to display a sub menu, the 'output' or 'action' of the XMB items of the sub menu will be shown rather than the actual XMB items):
 
{{Boxcode|content=<syntaxhighlight lang="xml">
<View id="XMB_Folder_1_container">
<Items>
<Query class="type:x-xmb/folder-pixmap"  key="xmb_folder_container" src="#XMB_Folder_1_contents" />
</Items>
</View>
</syntaxhighlight>}}
Important Notes:
* This has no attributes as it simply acts as a contents container/linker
 
Now to create the XMB .xml entry which holds the sub menu items:
 
{{Boxcode|content=<syntaxhighlight lang="xml">
<View id="XMB_Folder_1_contents">
<Attributes>
<Table key="xmb_subitem_1">
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair>
<Pair key="title"><String>XMB Sub Menu Item</String></Pair>
<Pair key="info"><String>Dummy Sub item 1</String></Pair>
<Pair key="str_noitem"><String>msg_error_no_gamedata</String></Pair>
</Table>
<Table key="xmb_subitem_2">
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair>
<Pair key="title"><String>XMB Sub Menu Item</String></Pair>
<Pair key="info"><String>Dummy Sub item 2</String></Pair>
<Pair key="str_noitem"><String>msg_error_no_gamedata</String></Pair>
</Table>
<Table key="xmb_subitem_3">
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair>
<Pair key="title"><String>XMB Sub Menu Item</String></Pair>
<Pair key="info"><String>Dummy Sub item 3</String></Pair>
<Pair key="str_noitem"><String>msg_error_no_gamedata</String></Pair>
</Table>
</Attributes>
<Items>
<Query class="type:x-xmb/folder-pixmap"  key="xmb_subitem_1" attr="xmb_subitem_1" />
<Query class="type:x-xmb/folder-pixmap"  key="xmb_subitem_2" attr="xmb_subitem_2" />
<Query class="type:x-xmb/folder-pixmap"  key="xmb_subitem_3" attr="xmb_subitem_3" />
</Items>
</View>
</syntaxhighlight>}}
 
Important Notes:
* These are dummy items, they do not 'go anywhere' or perform any function. They will just print the str_noitem message when clicked because they have no function
* notice how the &lt;attr&gt; from the &lt;Items&gt; sub entries matches the &lt;Table keys&gt; from the &lt;Attributes&gt; sub entries
* The &lt;Attributes&gt; and the &lt;Items&gt; sub entries do not have to be in the same order to work
 
=== A Web-Site link ===
This type of entry could be placed on the root of the XMB category, or in an XMB Item Tree. This is also an application of the '[[VSH:Module-Action|module-action]]' function. Example:
 
{{Boxcode|content=<syntaxhighlight lang="xml">
<View id="seg_xmb_weblink">
<Attributes>
<Table key="link_1">
<Pair key="icon_rsc"><String>dev_wiki_icon</String></Pair>
<Pair key="title"><String>PS3 Dev Wiki</String></Pair>
<Pair key="info"><String>Some info here</String></Pair>
<Pair key="module_name"><String>webbrowser_plugin</String></Pair>
<Pair key="module_action"><String>http://www.ps3devwiki.com/</String></Pair>
  </Table>
</Attributes>
<Items>
<Item class="type:x-xmb/module-action" key="link_1" attr="link_1"/>
</Items>
</View>
</syntaxhighlight>}}
 
*Important Notes:
**The 'Attributes' for this Web-Link follows the Attribute rules for a 'module-action' entry. 
**The 'webbrowser_plugin' module has been used to handle the request in the 'module_action' pair key, which is a web address
**The 'attr' in the Items sub-entry is the same as the table key in the 'Attributes' sub-entry.
**Remember that the icon_rsc string will search the rco file(used by the module running the category which this web link is on) for the icon 'dev_wiki_icon'. Whereas the title and info strings will just print the contents of the string.




{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
{{System Firmware}}<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)