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.

541 lines
19 KiB

  1. Windows Themes .INI Files - 05/10/00
  2. ------------------------------------
  3. 1. A theme .ini file is a standard Windows .ini file. All text is compared
  4. case-insensitive. The File can be created in either ANSI or UNICODE
  5. character sets.
  6. 2. Types and names of theme files
  7. - there are 2 types of theme .ini files:
  8. - themes.ini - specifies available color schemes and sizes for a theme
  9. - classdata file - contains theme data for specific size/color
  10. 3. primitive property values
  11. - below is the list of primitive property types and their associated
  12. value format
  13. - when values have multiple parts, the parts can be separated by
  14. optional commas
  15. - value parts must be listed in the order described unless the optional
  16. partnames are used (format: partname:value)
  17. 4. primitive property types (10):
  18. - string (any text to right of "='; no quotes)
  19. - int (signed integer or hex number)
  20. - bool (one of the values: "true" or "false")
  21. - color (comma-sep. list of 3 numbers. partnames: "r", "g", "b")
  22. - enum (a string value that gets matched to a declared enum)
  23. - margins (a comma-sep. list of 4 int's. partnames: "lw", "rw", "th", "bh"
  24. note: these can be negative & control spacing of odd-shaped images)
  25. - filename (a relative path that gets fully qualified; currently cannot contain
  26. spaces or quotes; filenames are relative to the theme's directory)
  27. - size (an integer followed by optional "twips", "pixels", or "points")
  28. (the default size units is "pixels")
  29. - position (a comma-sep. list of 2 int's. partnames: "x", "y".
  30. interpreted as pixels)
  31. - rect (a comma-sep. list of 4 int's. partnames: "l", "t", "r", "b")
  32. - font (familyname, size, fontflags. familyname can contain spaces)
  33. ex: arial, 10 (the default font units is "points")
  34. ex: ms san serif, 18 pixels, bold italic
  35. 5. there are a number of predefined enums and property names (based on primitive types);
  36. refer to the file "TmSchema.h" for a current and complete list
  37. 6. all theme files consists of 1 or more sections. each section contains
  38. 1 or more property-setting lines of the form:
  39. <name> "=" <value>
  40. 7. <property names>
  41. - for the "<name> = "<value>" lines within the any section except the [documentation] section,
  42. <name> is required to be a primative name, a predefined enum name, or a predefined type.
  43. - examples:
  44. - ImageFile
  45. - SizingMargins
  46. - myPredefinedStringName
  47. - this hard "typing" of property names gives us some parsing services at file load time
  48. and helps standardize the name of recurring properties.
  49. - a list of which property names apply to each drawing routine can be found in Appendix B.
  50. 8. Sections allowed in "themes.ini" files:
  51. - [documentation] section
  52. - [Size.xxx] sections
  53. - [ColorScheme.xxx] sections
  54. - [File.xxx] sections
  55. - the "documentation" section is optional
  56. - at least one occurance of each of the "size", "ColorScheme", and "file"
  57. sections are required
  58. 9. [documentation] section:
  59. - any property name can go here; unrecognized property names are ignored without generating
  60. errors
  61. - all properties in the [documentation] section are interpreted as string properties
  62. - certain properties in this section are recognized and used by the theme selection UI. these
  63. properties are also written to a string table in the packed theme file, for localization
  64. access. the recognized properties are:
  65. - DisplayName
  66. - ToolTip
  67. - Author
  68. - Company
  69. - Copyright
  70. - URL
  71. - Version
  72. - Description
  73. 10. [ColorScheme.xxx] section:
  74. - the "xxx" should be replaced the simple color scheme name (no spaces)
  75. - the first [ColorScheme.xxx] section in the "themes.ini" file is the
  76. default Color Scheme (for UI selection)
  77. - the property names recognized in a [ColorScheme.xxx] section are:
  78. - DisplayName (UI name for this color scheme choice)
  79. - ToolTip (tooltip text for this color scheme choice)
  80. - FromColor1 (thru FromColor5)
  81. - ToColor1 (thru ToColor5)
  82. - FromHue1 (thru FromHue5)
  83. - ToHue1 (thru ToHue5)
  84. - each color scheme is a set of transformations on the explicit
  85. color values and the colors contained in each image of associated
  86. classdata files
  87. - For example, the following sections specifies 3 color schemes:
  88. [ColorScheme.Bright]
  89. DisplayName "Bright Colors"
  90. FromColor1 = 128 0 0
  91. ToColor1 = 255 0 0
  92. [ColorScheme.Dark]
  93. DisplayName = "Dark Colors"
  94. FromColor1 = 128 0 0
  95. ToColor1 = 25 0 0
  96. [ColorScheme.Random]
  97. DisplayName = "Wierd, Random Colors"
  98. Tooltip = "Caution: this is a dev-authored color scheme"
  99. FromColor1 = 128 0 0
  100. ToColor1 = 255 3 32
  101. - an empty set of transformations can be used to name the normal, untransformed color
  102. scheme. this could be used by a file for its default color scheme or a file that
  103. doesn't support color scheme transformations (where each color scheme is implemented
  104. as a separate classdata file). Examples:
  105. [ColorScheme.Default]
  106. DisplayName = "Default"
  107. [ColorScheme.RedDesign]
  108. DisplayName = "Fall Reds"
  109. 11. [Size.xxx] section:
  110. - the "xxx" should be replaced the simple size name (no spaces)
  111. - the first [Size.xxx] section in the "themes.ini" file is the
  112. default Size (for UI selection)
  113. - the property names recognized in a [Size.xxx] section are:
  114. - DisplayName
  115. - ToolTip
  116. - the "DisplayName" property will be the name of the size in the UI to select a theme
  117. - the "ToolTip" property specifies the tooltip text to be used in the theme
  118. selection UI for this size
  119. - For example, the following sections specifies 3 sizes:
  120. [Sizes.Default]
  121. DisplayName = "Default"
  122. [Sizes.Small]
  123. DisplayName = "Very Small"
  124. Tooltip = "Choose this if you like to squint"
  125. [Sizes.Large]
  126. DisplayName = "Very Large"
  127. 12. [File.xxx] section:
  128. - the "xxx" should be replaced a simple, unique name for the classdata file (no spaces)
  129. - the propertes recognized in this section are:
  130. - Filename (to name the classdata file)
  131. - ColorSchemes (to specify the list of color schemes
  132. that the file supports)
  133. - Sizes (to specify the sizes that the file supports)
  134. - Examples:
  135. [File.One]
  136. Filename = large.ini
  137. ColorSchemes = default, red, green, blue
  138. Sizes = Large
  139. [File.Two]
  140. Filename = smallred.ini
  141. ColorSchemes = red
  142. Sizes = Small
  143. - the "ColorSchemes" property must specify a comma separated list of previously
  144. declared simple color scheme names (from [ColorScheme.xxx] sections)
  145. - the "Sizes" property must specify a comma separated list of previously
  146. declared simple size names (from [Size.xxx] sections)
  147. - the lists can be continued on multiple lines by starting the continued line
  148. with an equals sign ("=")
  149. - each unique color/size combination can only be associated with one file
  150. 13. Sections allowed in "classdata" files:
  151. - [globals] section
  152. - [sysmetrics] section
  153. - class sections
  154. - all sections are optional
  155. - multiple class sections allowed
  156. - if used, the [globals] section must be the first section
  157. - if used, the [sysmetrics] section must appear before any class sections
  158. 14. [globals] section:
  159. - the globals section is a list of <property name> settings that are inherited by each parent class
  160. section. the class section can overwrite any of the properties set in the global section. At runtime,
  161. a control can use the "GetPropertyOrigin()" to determine if the property is specified locally,
  162. in the parent node, globally, or not at all.
  163. - the "CharSet" property, which specifies the numeric character set for all fonts in the
  164. classdata file, has the following special rules:
  165. - can only appear in the [globals] section
  166. - must appear before the first "Font" property setting
  167. 15. [sysmetrics] section:
  168. - this section allows a theme author to set the system metrics when the theme is loaded
  169. so that the look of non-themed applications can be made to more closely match the look
  170. of the theme.
  171. - for this section, the "appname::" option is not allowed
  172. - for this section, the ".partid" option is not allowed
  173. - the supported system metrics are:
  174. - system colors
  175. Scrollbar, Background, ActiveCaption, InactiveCaption, Menu
  176. Window, WindowFrame, MenuText, WindowText, CaptionText
  177. ActiveBorder, InactiveBorder, AppWorkSpace, Highlight, HighlightText
  178. BtnFace, BtnShadow, GrayText, BtnText, InactiveCaptionText
  179. BtnHighlight, DkShadow3d, Light3d, InfoText, InfoBk, ButtonAlternateFace, HotTracking
  180. GradientActiveCaption, GradientInactiveCaption, MenuBar, MenuHilight
  181. - system fonts
  182. CaptionFont, SmallCaptionFont, MenuFont, StatusFont, MsgBoxFont
  183. IconTitleFont
  184. - system sizes
  185. BorderWidth, ScrollBarWidth, ScrollBarHeight, CaptionBarWidth, CaptionBarHeight
  186. SmCaptionBarWidth, SmCaptionBarHeight, MenuBarWidth, MenuBarHeight
  187. - system booleans
  188. FlatMenus, DropShadows, MouseVanish, CursorShadow
  189. TooltipFade, TooltipAnimation, SelectionFade
  190. - system strings
  191. CssName, XmlName
  192. - only the above property names are allowed in this section
  193. - if any values of any of the above system metrics are not specifed, they
  194. default to the system setting for the "Windows Standard" scheme.
  195. 16. class sections:
  196. - the section name for class sections is consists of 1-4 names, as shown below. Each
  197. name can contain 1 or more the following chars: letters, numbers, "-", and "_").
  198. a. (optional) group name followed by a "::"
  199. (the "group name" is the base name of an application for the OpenThemeData() API
  200. but can also be any logical grouping name when passed by the SetWindowTheme() API).
  201. b. the windows classname or user-created name
  202. c. (optional) a "." followed by a child part name. Note: the child
  203. part name must be defined as a part name for its class in the "TmSchema.h" file
  204. d. (optional) a state named enclosed in parenthesis. Note: the
  205. state name must be defined as a state name for its part int the
  206. "TmSchema.h" file
  207. - examples:
  208. [button] // simple class name
  209. [button-OK] // specialized class name
  210. [explorer::button] // only applies to buttons in "explorer"
  211. [button.pushbutton] // a part of button called "pushbutton"
  212. [button.pushbutton(up)] // the "up" state of pushbuton
  213. [button(disabled)] // the "disabled" state of button
  214. - there are some special predeclared names that are not registered class names but are recognized
  215. by the theme code as appropriate:
  216. - dialog (for dialog frame/backgrounds)
  217. - menu (for uxcontrol menus)
  218. - desktop (for desktop wallpaper)
  219. - nonclient (for captioned window frames)
  220. - child sections inherit from their parent section of the same name. at runtime,
  221. each API for the theme drawing & information take a PartId (int) to select the parent
  222. or child section.
  223. - state sections inherit from their parent class or part section of the same name.
  224. at runtime, each API for theme drawing & information take a PartId (int) to
  225. select the state of the part or class.
  226. - these state, part, and parent class sections contain, together with the
  227. inherited "globals" section, all of the properties values needed to draw
  228. the specified window class (see section 7 on <property names>).
  229. - a list of the standard controls/windows, along with which drawing services they
  230. use, can be found in Appendix C.
  231. 17. applications that don't want to apply the current Theme
  232. - applications that want to have no theme-effects on their controls or who want to specify another
  233. theme will have put this info into the registry under the "ThemeManager" key. More details to follow on
  234. this.
  235. APPENDIX A: Theme Drawing Routines and their Associated Properties:
  236. DrawBackground:
  237. - BgType = ImageFile
  238. - ImageFile
  239. - SizingMode (enum: TrueSize, Stretch, Tile, TileHorz, TileVert, TileCenter, SystemSize, SystemPos)
  240. - SizingMargins
  241. - ContentMargins
  242. - ImageCount
  243. - BorderOnly (bool)
  244. - Transparent (bool)
  245. - TransparentColor
  246. - BgFill (bool)
  247. - FillColor (used when drawing TRUESIZE imsages with BgFill is TRUE )
  248. - BgType = BorderFill
  249. - BorderType (enum: Rect, RoundRect, Ellipse)
  250. - BorderColor
  251. - BorderSize
  252. - RoundCornerWidth (int as percentage; only for RoundRect)
  253. - RoundCornerHeight (int as percentage; only for RoundRect)
  254. - FillType (enum: Solid, VertGradient, HorzGradient, RadialGradient, TileImage)
  255. - FillColor (for Solid)
  256. - GradientColor1 - GradientColor5 (for gradient filltypes)
  257. - GradientRatio1 - GradientRatio5 (for gradient filltypes)
  258. - ImageFile (for TileImage)
  259. - BgType = NtlFile (not yet implemented)
  260. - NtlFile
  261. - ImageFile (for TileImage)
  262. - ContentMargins
  263. DrawText:
  264. - Font
  265. - TextColor
  266. - ContentAlignment
  267. - TextShadowOffset
  268. - TextShadowColor
  269. - TextShadowType
  270. - TextBorderColor
  271. - TextBorderSize
  272. "NonFrame" Drawing:
  273. - AutoSize (bool)
  274. - Offset (x,y)
  275. - OffsetType
  276. - CaptionMargins
  277. Progress Drawing:
  278. - ProgressChunkSize
  279. - ProgressSpaceSize
  280. APPENDIX B: Parts and States of the standard controls and windows:
  281. The list below shows how the Ux Controls are broken down into
  282. parts and states. This list is provided to give the reader an idea
  283. of the parts/states but for up-to-date information, please
  284. refer to the "TmSchema.h" file.
  285. An asterisk (*) is shown by the parts that support text drawing.
  286. All parts support background drawing.
  287. "NonClient" Parts & States:
  288. Frame = Active, Inactive, Disabled
  289. Caption (*) = Active, Inactive, Disabled
  290. HorzScroll = Normal, Hot, Pushed, Disabled
  291. HorzThumb = Normal, Hot, Pushed, Disabled
  292. VertScroll = Normal, Hot, Pushed, Disabled
  293. VertThumb = Normal, Hot, Pushed, Disabled
  294. SysButton = Normal, Hot, Pushed, Disabled
  295. MINButton = Normal, Hot, Pushed, Disabled
  296. MAXButton = Normal, Hot, Pushed, Disabled
  297. CloseButton = Normal, Hot, Pushed, Disabled
  298. HorzScroll
  299. HorzThumb
  300. VertScroll
  301. VertThumb
  302. "Button" Parts & States:
  303. PushButton (*) = Up, Pushed, Disabled, Hot, UpDefault
  304. RadioButton (*) = Unchecked(1), Checked, UncheckedDown, CheckedDown
  305. CheckBox (*) = Unchecked(1), Checked, UncheckedDown, CheckedDown
  306. GroupBox (*)
  307. UserButton
  308. "Rebar" Parts & States:
  309. Gripper
  310. GripperVert
  311. Band
  312. "Toolbar" Parts:
  313. Button (*)
  314. DropDownButton
  315. SplitButton
  316. SplitButtonDropDown
  317. Separator
  318. SeparatorVert
  319. "Toolbar" Common States:
  320. Up, Pushed, Disabled, Hot, Checked
  321. "Status" Parts:
  322. Pane
  323. Gripper
  324. "Menu" Parts:
  325. MenuItem (*)
  326. MenuDropDown
  327. MenuBarItem (*)
  328. MenuBarDropDown
  329. Chevron
  330. Separator
  331. "Menu" Common States:
  332. Normal
  333. Selected
  334. Demoted
  335. "ListView" Parts:
  336. ListItem (*)
  337. ListGroup (*)
  338. ListDetail
  339. ListSortedDetail
  340. EmptyText
  341. "ListView" Common States:
  342. Normal
  343. Hot
  344. Selected
  345. SelectedNotFocus
  346. Disabled
  347. "Header" Parts:
  348. HeaderItem (*)
  349. "Header" Common States:
  350. Normal
  351. Hot
  352. Pushed
  353. SortedUp
  354. SortedDown
  355. "Progress" Parts:
  356. Bar
  357. BarVert
  358. Chunk
  359. ChunkVert
  360. "TabControl" Parts & States:
  361. TabItem (*) = Normal, Disabled, Hot, Selected, Focused
  362. TabItemLeftEdge = Normal, Disabled, Hot, Selected, Focused
  363. TabItemRightEdge = Normal, Disabled, Hot, Selected, Focused
  364. TabItemBothEdge = Normal, Disabled, Hot, Selected, Focused
  365. TopTabItem (*) = Normal, Disabled, Hot, Selected, Focused
  366. TopTabItemLeftEdge = Normal, Disabled, Hot, Selected, Focused
  367. TopTabItemRightEdge = Normal, Disabled, Hot, Selected, Focused
  368. TopTabItemBothEdge = Normal, Disabled, Hot, Selected, Focused
  369. Pane
  370. "Trackbar" Parts & States:
  371. Trackbar = Normal
  372. Track = Normal
  373. TrackVert = Normal
  374. Thumb = Normal, Hover, Pressed, Focused
  375. ThumbTop = Normal, Hover, Pressed, Focused
  376. ThumbBottom = Normal, Hover, Pressed, Focused
  377. ThumbVert = Normal, Hover, Pressed, Focused
  378. ThumbLeft = Normal, Hover, Pressed, Focused
  379. ThumbRight = Normal, Hover, Pressed, Focused
  380. Tics = Normal
  381. TicsVert = Normal
  382. "ToolTip" Parts:
  383. Standard (*)
  384. StandardTitle (*)
  385. Balloon (*)
  386. BalloonTitle (*)