AGCEventsIDL.xsl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3. <xsl:script src="AGCEventsXML.js">
  4. <![CDATA[
  5. var g_strMaxIndent = " ";
  6. var g_strCommentBar = "/////////////////////////////////////////////////////////////////////////////";
  7. function GetPrefix(node)
  8. {
  9. var attr = node.attributes.getNamedItem("Prefix");
  10. if (attr)
  11. return attr.value;
  12. var theParent = node.parentNode;
  13. return theParent ? GetPrefix(theParent) : "__ERROR_NO_PREFIX__";
  14. }
  15. function GetLevel(node)
  16. {
  17. // Count the levels deep that we are
  18. var nLevels = -1;
  19. var parentNode = node.parentNode;
  20. while (parentNode)
  21. {
  22. ++nLevels;
  23. parentNode = parentNode.parentNode;
  24. }
  25. return nLevels;
  26. }
  27. function GetIndent(node)
  28. {
  29. var nLevels = GetLevel(node);
  30. return g_strMaxIndent.substr(0, nLevels * 2);
  31. }
  32. function GetIndentedCommentBar(node)
  33. {
  34. var nLevels = GetLevel(node);
  35. var nSpaces = nLevels * 2;
  36. return g_strMaxIndent.substr(0, nLevels * 2) + g_strCommentBar.substr(nSpaces);
  37. }
  38. ]]>
  39. </xsl:script>
  40. <xsl:template match="/">
  41. <xsl:apply-templates/>
  42. </xsl:template>
  43. <xsl:template match="AGCEvents" xsl:space="preserve">
  44. /////////////////////////////////////////////////////////////////////////////
  45. // <xsl:value-of select="@outputfile"/>
  46. //
  47. // This is an ALWAYS GENERATED file. It should *not* be edited directly.
  48. //
  49. // It was generated at <xsl:value-of select="@time"/> from the following script:
  50. // <xsl:value-of select="@scriptfullname"/>
  51. //
  52. // The input files were:
  53. // <xsl:value-of select="@xmlfile"/>
  54. // <xsl:value-of select="@xslfile"/>
  55. //
  56. // It should be included from AGCIDL.idl.
  57. //
  58. <![CDATA[
  59. /////////////////////////////////////////////////////////////////////////////
  60. // AGCEventID
  61. //
  62. [
  63. uuid(014CE25C-1482-11d3-8B5F-00C04F681633),
  64. helpstring("IDs of the different Events that IAdminEvents handles.")
  65. ]
  66. typedef [v1_enum] enum AGCEventID
  67. {
  68. ///////////////////////////////////////////////////////////////////////////
  69. //
  70. EventID_Unknown = 0,
  71. ]]>
  72. <xsl:apply-templates/>
  73. <![CDATA[
  74. ]]>
  75. ///////////////////////////////////////////////////////////////////////////
  76. } AGCEventID;
  77. </xsl:template>
  78. <xsl:template match="EventGroup" xml:space="preserve">
  79. <xsl:eval>GetIndentedCommentBar(this)</xsl:eval>
  80. <xsl:eval>GetIndent(this)</xsl:eval>// <xsl:value-of select="@DisplayName"/> Events
  81. <xsl:eval>GetIndent(this)</xsl:eval><xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name" />_LowerBound = <xsl:value-of select="@LowerBound" />,
  82. <xsl:for-each select="Event"><xsl:eval>GetIndent(this);</xsl:eval><xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name"/> = <xsl:value-of select="@id"/>,
  83. </xsl:for-each><xsl:apply-templates select="EventGroup"/>
  84. <xsl:eval>GetIndent(this)</xsl:eval><xsl:eval>GetPrefix(this)</xsl:eval><xsl:value-of select="@Name" />_UpperBound = <xsl:value-of select="@UpperBound" />,
  85. <xsl:eval>GetIndent(this)</xsl:eval>// End: <xsl:value-of select="@DisplayName"/> Events
  86. <xsl:eval>GetIndentedCommentBar(this)</xsl:eval>
  87. </xsl:template>
  88. </xsl:stylesheet>