VirtualBox

Changeset 7607 in vbox for trunk/src/VBox/Main/xml


Ignore:
Timestamp:
Mar 27, 2008 9:33:38 PM (17 years ago)
Author:
vboxsync
Message:

Main: Added more OS Type IDs.

Location:
trunk/src/VBox/Main/xml
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/SchemaDefs.xsl

    r7466 r7607  
    1010
    1111     Copyright (C) 2006-2007 innotek GmbH
    12    
     12
    1313     This file is part of VirtualBox Open Source Edition (OSE), as
    1414     available from http://www.virtualbox.org. This file is free software;
     
    2828<xsl:strip-space elements="*"/>
    2929
     30<xsl:param name="mode" expr=''/>
     31
    3032<!--
    3133//  helpers
     
    5456-->
    5557<xsl:template match="*"/>
    56 
    57 <!--
    58  *  header
    59 -->
     58<xsl:template match="*" mode="declare"/>
     59<xsl:template match="*" mode="declare.enum"/>
     60<xsl:template match="*" mode="define"/>
     61
    6062<xsl:template match="/">
     63  <xsl:choose>
     64    <xsl:when test="$mode='declare'">
     65      <xsl:apply-templates select="/" mode="declare"/>
     66    </xsl:when>
     67    <xsl:when test="$mode='define'">
     68      <xsl:apply-templates select="/" mode="define"/>
     69    </xsl:when>
     70    <xsl:otherwise>
     71      <xsl:message terminate="yes">
     72Value '<xsl:value-of select="$mode"/>' of parameter 'mode' is invalid!
     73      </xsl:message>
     74    </xsl:otherwise>
     75  </xsl:choose>
     76</xsl:template>
     77
     78<!--
     79 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     80 *  declare mode (C++ header file)
     81 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     82-->
     83
     84<xsl:template match="/" mode="declare">
    6185<xsl:text>
    6286/*
    6387 *  DO NOT EDIT.
    6488 *
    65  *  This header is automatically generated from the VirtualBox XML Schema
    66  *  and contains selected schema constraints defined in C.
     89 *  This header is automatically generated from the VirtualBox XML Settings
     90 *  Schema and contains selected schema constraints declared in C++.
    6791 */
    6892
     
    7094#define ____H_SCHEMADEFS
    7195
    72 struct SchemaDefs
     96namespace SchemaDefs
    7397{
    7498    enum
     
    76100</xsl:text>
    77101
    78   <xsl:apply-templates select="xsd:schema"/>
     102  <xsl:apply-templates select="xsd:schema" mode="declare.enum"/>
    79103
    80104<xsl:text>    };
    81 };
     105</xsl:text>
     106
     107<xsl:apply-templates select="xsd:schema" mode="declare"/>
     108
     109<xsl:text>}
    82110
    83111#endif // ____H_SCHEMADEFS
     
    86114
    87115<!--
    88  *  extract schema definitions
    89 -->
    90 <xsl:template match="xsd:schema">
     116 *  enumeration values
     117-->
     118<xsl:template match="xsd:schema" mode="declare.enum">
    91119
    92120  <!-- process include statements -->
     
    94122    <!-- skip VirtualBox-settings-root.xsd inclusion as it is computed at runtime -->
    95123    <xsl:if test="not(@schemaLocation='VirtualBox-settings-root.xsd')">
    96       <xsl:apply-templates select="document(@schemaLocation)/xsd:schema"/>
     124      <xsl:apply-templates select="document(@schemaLocation)/xsd:schema" mode="declare.enum"/>
    97125    </xsl:if>
    98126  </xsl:for-each>
     
    123151    "/>
    124152  </xsl:call-template>
     153
    125154  <xsl:call-template name="defineEnumMember">
    126155    <xsl:with-param name="member" select="'        MaxGuestMonitors'"/>
     
    135164    "/>
    136165  </xsl:call-template>
     166
    137167  <xsl:call-template name="defineEnumMember">
    138168    <xsl:with-param name="member" select="'        SerialPortCount'"/>
     
    141171    "/>
    142172  </xsl:call-template>
     173
    143174  <xsl:call-template name="defineEnumMember">
    144175    <xsl:with-param name="member" select="'        ParallelPortCount'"/>
     
    147178    "/>
    148179  </xsl:call-template>
     180
    149181  <xsl:call-template name="defineEnumMember">
    150182    <xsl:with-param name="member" select="'        MaxBootPosition'"/>
     
    156188</xsl:template>
    157189
     190<!--
     191 *  aliases (defines) for individual OSTypeIds array elements
     192-->
     193<xsl:template match="xsd:schema" mode="declare">
     194
     195  <xsl:text>&#x0A;    extern const char *OSTypeIds[];&#x0A;</xsl:text>
     196
     197  <xsl:text>&#x0A;    enum { OSTypeId_COUNT = </xsl:text>
     198  <xsl:value-of select="count (
     199    xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration |
     200    document(xsd:include[not(@schemaLocation='VirtualBox-settings-root.xsd')]/@schemaLocation)/xsd:schema/xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration
     201  )"/>
     202  <xsl:text> };&#x0A;&#x0A;</xsl:text>
     203
     204  <xsl:for-each select="
     205    xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration |
     206    document(xsd:include[not(@schemaLocation='VirtualBox-settings-root.xsd')]/@schemaLocation)/xsd:schema/xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration
     207  ">
     208    <xsl:text>    #define SchemaDefs_OSTypeId_</xsl:text>
     209    <xsl:value-of select="@value"/>
     210    <xsl:text> SchemaDefs::OSTypeIds [</xsl:text>
     211    <xsl:value-of select="position()-1"/>
     212    <xsl:text>]&#x0A;</xsl:text>
     213  </xsl:for-each>
     214
     215</xsl:template>
     216
     217<!--
     218 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     219 *  define mode (C++ source file)
     220 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     221-->
     222
     223<xsl:template match="/" mode="define">
     224<xsl:text>
     225/*
     226 *  DO NOT EDIT.
     227 *
     228 *  This source is automatically generated from the VirtualBox XML Settings
     229 *  Schema and contains selected schema constraints defined in C++.
     230 */
     231
     232#include "SchemaDefs.h"
     233
     234namespace SchemaDefs
     235{
     236</xsl:text>
     237
     238<xsl:apply-templates select="xsd:schema" mode="define"/>
     239
     240<xsl:text>}
     241</xsl:text>
     242</xsl:template>
     243
     244<!--
     245 *  array of OSTypeIds
     246-->
     247<xsl:template match="xsd:schema" mode="define">
     248  <xsl:text>    const char *OSTypeIds[] =
     249    {
     250</xsl:text>
     251  <xsl:for-each select="
     252    xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration |
     253    document(xsd:include[not(@schemaLocation='VirtualBox-settings-root.xsd')]/@schemaLocation)/xsd:schema/xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration
     254  ">
     255    <xsl:text>        "</xsl:text>
     256    <xsl:value-of select="@value"/>
     257    <xsl:text>",
     258</xsl:text>
     259  </xsl:for-each>
     260  <xsl:text>    };
     261</xsl:text>
     262</xsl:template>
     263
     264<!--
     265 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     266 *  END
     267 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     268-->
     269
    158270</xsl:stylesheet>
  • trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd

    r7556 r7607  
    131131<xsd:simpleType name="TGuestOSType">
    132132  <xsd:restriction base="xsd:string">
     133    <!-- @todo on next format change, rename dos to DOS, win2k3 to Win2003 and
     134    so on. Possibly also use prefixes that determine the platform family:
     135    Win_31, Win_Vista, Linux_ArchLinux, Unix_FreeBSD and so on. -->
    133136    <xsd:enumeration value="unknown"/>
    134137    <xsd:enumeration value="dos"/>
     
    142145    <xsd:enumeration value="win2k3"/>
    143146    <xsd:enumeration value="winvista"/>
     147    <xsd:enumeration value="win2k8"/>
    144148    <xsd:enumeration value="os2warp3"/>
    145149    <xsd:enumeration value="os2warp4"/>
    146150    <xsd:enumeration value="os2warp45"/>
     151    <xsd:enumeration value="ecs"/>
    147152    <xsd:enumeration value="linux22"/>
    148153    <xsd:enumeration value="linux24"/>
    149154    <xsd:enumeration value="linux26"/>
     155    <xsd:enumeration value="archlinux"/>
     156    <xsd:enumeration value="debian"/>
     157    <xsd:enumeration value="opensuse"/>
     158    <xsd:enumeration value="fedoracore"/>
     159    <xsd:enumeration value="gentoo"/>
     160    <xsd:enumeration value="mandriva"/>
     161    <xsd:enumeration value="redhat"/>
     162    <xsd:enumeration value="ubuntu"/>
     163    <xsd:enumeration value="xandros"/>
    150164    <xsd:enumeration value="freebsd"/>
    151165    <xsd:enumeration value="openbsd"/>
     
    182196
    183197<xsd:simpleType name="TBIOSBootMenuModeType">
    184     <xsd:restriction base="xsd:string">
    185       <xsd:enumeration value="Disabled"/>
    186       <xsd:enumeration value="MenuOnly"/>
    187       <xsd:enumeration value="MessageAndMenu"/>
    188     </xsd:restriction>
     198  <xsd:restriction base="xsd:string">
     199    <xsd:enumeration value="Disabled"/>
     200    <xsd:enumeration value="MenuOnly"/>
     201    <xsd:enumeration value="MessageAndMenu"/>
     202  </xsd:restriction>
    189203</xsd:simpleType>
    190204
     
    197211
    198212<xsd:simpleType name="TClipboardMode">
    199     <xsd:restriction base="xsd:string">
    200       <xsd:enumeration value="Disabled"/>
    201       <xsd:enumeration value="HostToGuest"/>
    202       <xsd:enumeration value="GuestToHost"/>
    203       <xsd:enumeration value="Bidirectional"/>
    204     </xsd:restriction>
     213  <xsd:restriction base="xsd:string">
     214    <xsd:enumeration value="Disabled"/>
     215    <xsd:enumeration value="HostToGuest"/>
     216    <xsd:enumeration value="GuestToHost"/>
     217    <xsd:enumeration value="Bidirectional"/>
     218  </xsd:restriction>
    205219</xsd:simpleType>
    206220
    207221<xsd:simpleType name="TPortMode">
    208     <xsd:restriction base="xsd:string">
    209       <xsd:enumeration value="Disconnected"/>
    210       <xsd:enumeration value="HostPipe"/>
    211       <xsd:enumeration value="HostDevice"/>
    212     </xsd:restriction>
     222  <xsd:restriction base="xsd:string">
     223    <xsd:enumeration value="Disconnected"/>
     224    <xsd:enumeration value="HostPipe"/>
     225    <xsd:enumeration value="HostDevice"/>
     226  </xsd:restriction>
    213227</xsd:simpleType>
    214228
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette