ITheme.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2004 Novell, Inc.
  21. //
  22. // Authors:
  23. // Jordi Mas i Hernandez, [email protected]
  24. //
  25. //
  26. //
  27. // $Revision: 1.10 $
  28. // $Modtime: $
  29. // $Log: ITheme.cs,v $
  30. // Revision 1.10 2004/08/15 23:20:54 ravindra
  31. // Changes to Theme for ToolBar control and also dos2unix format.
  32. //
  33. // Revision 1.9 2004/08/12 20:29:01 jordi
  34. // Trackbar enhancement, fix mouse problems, highli thumb, etc
  35. //
  36. // Revision 1.8 2004/08/10 19:21:27 jordi
  37. // scrollbar enhancements and standarize on win colors defaults
  38. //
  39. // Revision 1.7 2004/08/10 18:52:30 jackson
  40. // Implement DrawItem functionality
  41. //
  42. // Revision 1.6 2004/08/09 21:36:34 jackson
  43. // Add support for drawing status bar and getting status bar item sizes
  44. //
  45. // Revision 1.5 2004/08/09 17:01:02 jackson
  46. // The theme engine now controls default window properties
  47. //
  48. // Revision 1.3 2004/08/08 22:54:21 jordi
  49. // Label BorderStyles
  50. //
  51. // Revision 1.2 2004/08/07 19:05:44 jordi
  52. // Theme colour support and GetSysColor defines
  53. //
  54. // Revision 1.1 2004/07/26 17:42:03 jordi
  55. // Theme support
  56. //
  57. //
  58. using System.Drawing;
  59. using System.Drawing.Drawing2D;
  60. using System.Drawing.Imaging;
  61. namespace System.Windows.Forms
  62. {
  63. internal interface ITheme
  64. {
  65. /* Default properties */
  66. Color DefaultControlBackColor {get;}
  67. Color DefaultControlForeColor {get;}
  68. Font DefaultFont {get;}
  69. Color DefaultWindowForeColor {get;}
  70. Color DefaultWindowBackColor {get;}
  71. /* Windows System Colors. Based on Wine */
  72. Color ColorScrollbar {get;} //COLOR_SCROLLBAR
  73. Color ColorBackground {get;} //COLOR_BACKGROUND
  74. Color ColorActiveTitle {get;} //COLOR_ACTIVECAPTION
  75. Color ColorInactiveTitle {get;} //COLOR_INACTIVECAPTION
  76. Color ColorMenu {get;} //COLOR_MENU
  77. Color ColorWindow {get;} //COLOR_WINDOW
  78. Color ColorWindowFrame {get;} //COLOR_WINDOWFRAME
  79. Color ColorMenuText {get;} //COLOR_MENUTEXT
  80. Color ColorWindowText {get;} //COLOR_WINDOWTEXT
  81. Color ColorTitleText {get;} //COLOR_CAPTIONTEXT
  82. Color ColorActiveBorder {get;} //COLOR_ACTIVEBORDER
  83. Color ColorInactiveBorder {get;} //COLOR_INACTIVEBORDER
  84. Color ColorAppWorkSpace {get;} //COLOR_APPWORKSPACE
  85. Color ColorHilight {get;} //COLOR_HIGHLIGHT
  86. Color ColorHilightText {get;} //COLOR_HIGHLIGHTTEXT
  87. Color ColorButtonFace {get;} //COLOR_BTNFACE
  88. Color ColorButtonShadow {get;} //COLOR_BTNSHADOW
  89. Color ColorGrayText {get;} //COLOR_GRAYTEXT
  90. Color ColorButtonText {get;} //COLOR_BTNTEXT
  91. Color ColorInactiveTitleText {get;} //COLOR_INACTIVECAPTIONTEXT
  92. Color ColorButtonHilight {get;} //COLOR_BTNHIGHLIGHT
  93. Color ColorButtonDkShadow {get;} //COLOR_3DDKSHADOW
  94. Color ColorButtonLight {get;} //COLOR_3DLIGHT
  95. Color ColorInfoText {get;} //COLOR_INFOTEXT
  96. Color ColorInfoWindow {get;} //COLOR_INFOBK
  97. Color ColorButtonAlternateFace {get;} //COLOR_ALTERNATEBTNFACE
  98. Color ColorHotTrackingColor {get;} //COLOR_HOTLIGHT
  99. Color ColorGradientActiveTitle {get;} //COLOR_GRADIENTACTIVECAPTION
  100. Color ColorGradientInactiveTitle {get;} //COLOR_GRADIENTINACTIVECAPTION
  101. /*
  102. Control sizing properties
  103. */
  104. int SizeGripWidth {get;}
  105. int StatusBarHorzGapWidth {get;}
  106. int ScrollBarButtonSize {get;}
  107. /*
  108. ToolBar Control properties
  109. */
  110. int ToolBarImageGripWidth {get;} // Grip width for the Image on the ToolBarButton
  111. int ToolBarSeparatorWidth {get;} // width of the separator
  112. int ToolBarDropDownWidth { get; } // width of the dropdown arrow rect
  113. int ToolBarDropDownArrowWidth { get; } // width for the dropdown arrow on the ToolBarButton
  114. int ToolBarDropDownArrowHeight { get; } // height for the dropdown arrow on the ToolBarButton
  115. /*
  116. Methods that mimic ControlPaint signature and draw basic objects
  117. */
  118. void DrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
  119. ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
  120. Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
  121. int bottomWidth, ButtonBorderStyle bottomStyle);
  122. void DrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
  123. void DrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  124. void DrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
  125. void DrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
  126. void DrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  127. void DrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
  128. void DrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
  129. void DrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
  130. void DrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
  131. void DrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
  132. void DrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
  133. void DrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph);
  134. void DrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  135. void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
  136. void DrawReversibleLine (Point start, Point end, Color backColor);
  137. void DrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
  138. void DrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
  139. Color backColor);
  140. void DrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
  141. void DrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
  142. StringFormat format);
  143. /*
  144. Methods that draw complete controls
  145. */
  146. void DrawLabel (Graphics dc, Rectangle area, BorderStyle border_style, string text,
  147. Color fore_color, Color back_color, Font font, StringFormat string_format, bool Enabled);
  148. void DrawScrollBar (Graphics dc, Rectangle area, Rectangle thumb_pos,
  149. ref Rectangle first_arrow_area, ref Rectangle second_arrow_area,
  150. ButtonState first_arrow, ButtonState second_arrow,
  151. ref int scrollbutton_width, ref int scrollbutton_height,
  152. bool enabled, bool vertical);
  153. void DrawTrackBar (Graphics dc, Rectangle area, TrackBar tb,
  154. ref Rectangle thumb_pos, ref Rectangle thumb_area, bool highli_thumb,
  155. float ticks, int value_pos, bool mouse_value);
  156. void DrawProgressBar (Graphics dc, Rectangle area, Rectangle client_area,
  157. int barpos_pixels, int block_width);
  158. void DrawToolBar (Graphics dc, ToolBar control, StringFormat format);
  159. void DrawStatusBar (Graphics dc, Rectangle area, StatusBar sb);
  160. void DrawOwnerDrawBackground (DrawItemEventArgs e);
  161. void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
  162. }
  163. }