Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
5.2 KiB

  1. Theme Schema File - 07/20/00
  2. ----------------------------
  3. 1. Description: the theme schema file is a "C" header file that uses special macros defined by
  4. the file "SchemaDef.h"
  5. 2. The system schema file (for uxtheme.dll and comctl32.dll) is named "TmSchema.h".
  6. 3. Purpose: the schema file defines a common set of enums, properties, class parts, and class states
  7. to be shared between the Theme Manager drawing/info routines, the theme authoring file, and the
  8. theme-aware controls
  9. 4. File layout:
  10. a. file start
  11. - the first part of the file contains some fixed information:
  12. //-----------------------------------------------------------------
  13. #if (defined(SCHEMA_STRINGS)) || (! defined(TMSCHEMA_H))
  14. //-----------------------------------------------------------------
  15. #define TMSCHEMA_H
  16. //-----------------------------------------------------------------
  17. #include "SchemaDef.h"
  18. //-----------------------------------------------------------------
  19. #define THEMEMGR_VERSION 1 // increment if order of props changes or
  20. // any props are deleted (will prevent loading
  21. // of controlsets that use older version
  22. //-----------------------------------------------------------------
  23. BEGIN_TM_SCHEMA(xxx)
  24. (where "xxx" is the schema name)
  25. b. enums section
  26. - this section contains one or more enum definitions
  27. - each enum definition defines an enum name and a set of named values
  28. - example:
  29. BEGIN_TM_ENUM(BGTYPE)
  30. TM_ENUM(BT, IMAGEFILE)
  31. TM_ENUM(BT, BORDERFILL)
  32. TM_ENUM(BT, NTLFILE)
  33. END_TM_ENUM()
  34. The above example declares an enum called "BGTYPE". It has 3 named
  35. values: IMAGEFILE (value=0), BORDERFILL (value=1), and NTLFILE (value=2)
  36. c. properties section
  37. - this section defines a set of properties based on the primitive
  38. property types or a previously declared enum
  39. - section starts with the line:
  40. BEGIN_TM_PROPS()
  41. - section ends with the line:
  42. END_TM_PROPS()
  43. - example property:
  44. TM_PROP(TMT, BORDERSIZE, INT)
  45. (declares a "BorderSize" property of type "int")
  46. - example property:
  47. TM_PROP(TMT, BGTYPE, ENUM)
  48. (declares a "BgType" property of type enum)
  49. d. parts/states section
  50. - this section contains one or more parts/states declarations
  51. - example:
  52. BEGIN_TM_CLASS_PARTS(BUTTON)
  53. TM_PART(BP, PUSHBUTTON)
  54. TM_PART(BP, RADIOBUTTON)
  55. TM_PART(BP, CHECKBOX)
  56. TM_PART(BP, GROUPBOX)
  57. TM_PART(BP, USERBUTTON)
  58. END_TM_CLASS_PARTS()
  59. (the above defines a class called "button" that
  60. has the 5 specified parts)
  61. - example:
  62. BEGIN_TM_PART_STATES(PUSHBUTTON)
  63. TM_STATE(PBS, NORMAL)
  64. TM_STATE(PBS, HOT)
  65. TM_STATE(PBS, PRESSED)
  66. TM_STATE(PBS, DISABLED)
  67. TM_STATE(PBS, DEFAULTED)
  68. END_TM_PART_STATES()
  69. (the above defines a part called "pushbutton" that has
  70. the 5 specified states)
  71. e. file ending
  72. - this section should look like:
  73. END_TM_SCHEMA(xxx)
  74. //---------------------------------------------------------------------------
  75. #endif // TMSCHEMA_H
  76. //---------------------------------------------------------------------------
  77. (where "xxx" is the schema name)
  78. 5. The system schema file (TmSchema.h) is compiled into:
  79. - uxtheme.dll (theme manager code)
  80. - comctl32.dll (common controls code)
  81. - packthem.exe (theme packaging utility)
  82. - <theme-aware custom controls>
  83. 6. custom controls can define their own schema file that extend the system schema. This
  84. schema file should be compiled into the control's DLL and the DLL should be registered
  85. as "Path" values under the registry key:
  86. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ThemeManager\CustomControls
  87. example: Path = "c:\program files\acme\keypad.dll"
  88. 7. during theme packaging, the "packthem.exe" will attempt to call each registered DLL to get its
  89. schema info. This call is automatically implemented when the schema file is built using the
  90. format described in this document.
  91. 8. uxtheme.dll will also load registered control DLL's for the schema during every theme load