ITheme.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.9 $
  28. // $Modtime: $
  29. // $Log: ITheme.cs,v $
  30. // Revision 1.9 2004/08/12 20:29:01 jordi
  31. // Trackbar enhancement, fix mouse problems, highli thumb, etc
  32. //
  33. // Revision 1.8 2004/08/10 19:21:27 jordi
  34. // scrollbar enhancements and standarize on win colors defaults
  35. //
  36. // Revision 1.7 2004/08/10 18:52:30 jackson
  37. // Implement DrawItem functionality
  38. //
  39. // Revision 1.6 2004/08/09 21:36:34 jackson
  40. // Add support for drawing status bar and getting status bar item sizes
  41. //
  42. // Revision 1.5 2004/08/09 17:01:02 jackson
  43. // The theme engine now controls default window properties
  44. //
  45. // Revision 1.3 2004/08/08 22:54:21 jordi
  46. // Label BorderStyles
  47. //
  48. // Revision 1.2 2004/08/07 19:05:44 jordi
  49. // Theme colour support and GetSysColor defines
  50. //
  51. // Revision 1.1 2004/07/26 17:42:03 jordi
  52. // Theme support
  53. //
  54. //
  55. using System.Drawing;
  56. using System.Drawing.Drawing2D;
  57. using System.Drawing.Imaging;
  58. namespace System.Windows.Forms
  59. {
  60. internal interface ITheme
  61. {
  62. /* Default properties */
  63. Color DefaultControlBackColor {get;}
  64. Color DefaultControlForeColor {get;}
  65. Font DefaultFont {get;}
  66. Color DefaultWindowForeColor {get;}
  67. Color DefaultWindowBackColor {get;}
  68. /* Windows System Colors. Based on Wine */
  69. Color ColorScrollbar {get;} //COLOR_SCROLLBAR
  70. Color ColorBackground {get;} //COLOR_BACKGROUND
  71. Color ColorActiveTitle {get;} //COLOR_ACTIVECAPTION
  72. Color ColorInactiveTitle {get;} //COLOR_INACTIVECAPTION
  73. Color ColorMenu {get;} //COLOR_MENU
  74. Color ColorWindow {get;} //COLOR_WINDOW
  75. Color ColorWindowFrame {get;} //COLOR_WINDOWFRAME
  76. Color ColorMenuText {get;} //COLOR_MENUTEXT
  77. Color ColorWindowText {get;} //COLOR_WINDOWTEXT
  78. Color ColorTitleText {get;} //COLOR_CAPTIONTEXT
  79. Color ColorActiveBorder {get;} //COLOR_ACTIVEBORDER
  80. Color ColorInactiveBorder {get;} //COLOR_INACTIVEBORDER
  81. Color ColorAppWorkSpace {get;} //COLOR_APPWORKSPACE
  82. Color ColorHilight {get;} //COLOR_HIGHLIGHT
  83. Color ColorHilightText {get;} //COLOR_HIGHLIGHTTEXT
  84. Color ColorButtonFace {get;} //COLOR_BTNFACE
  85. Color ColorButtonShadow {get;} //COLOR_BTNSHADOW
  86. Color ColorGrayText {get;} //COLOR_GRAYTEXT
  87. Color ColorButtonText {get;} //COLOR_BTNTEXT
  88. Color ColorInactiveTitleText {get;} //COLOR_INACTIVECAPTIONTEXT
  89. Color ColorButtonHilight {get;} //COLOR_BTNHIGHLIGHT
  90. Color ColorButtonDkShadow {get;} //COLOR_3DDKSHADOW
  91. Color ColorButtonLight {get;} //COLOR_3DLIGHT
  92. Color ColorInfoText {get;} //COLOR_INFOTEXT
  93. Color ColorInfoWindow {get;} //COLOR_INFOBK
  94. Color ColorButtonAlternateFace {get;} //COLOR_ALTERNATEBTNFACE
  95. Color ColorHotTrackingColor {get;} //COLOR_HOTLIGHT
  96. Color ColorGradientActiveTitle {get;} //COLOR_GRADIENTACTIVECAPTION
  97. Color ColorGradientInactiveTitle {get;} //COLOR_GRADIENTINACTIVECAPTION
  98. /*
  99. Control sizing properties
  100. */
  101. int SizeGripWidth {get;}
  102. int StatusBarHorzGapWidth {get;}
  103. int ScrollBarButtonSize {get;}
  104. /*
  105. Methods that mimic ControlPaint signature and draw basic objects
  106. */
  107. void DrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
  108. ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
  109. Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
  110. int bottomWidth, ButtonBorderStyle bottomStyle);
  111. void DrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
  112. void DrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  113. void DrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
  114. void DrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
  115. void DrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  116. void DrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
  117. void DrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
  118. void DrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
  119. void DrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
  120. void DrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
  121. void DrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
  122. void DrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph);
  123. void DrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  124. void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
  125. void DrawReversibleLine (Point start, Point end, Color backColor);
  126. void DrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
  127. void DrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
  128. Color backColor);
  129. void DrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
  130. void DrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
  131. StringFormat format);
  132. /*
  133. Methods that draw complete controls
  134. */
  135. void DrawLabel (Graphics dc, Rectangle area, BorderStyle border_style, string text,
  136. Color fore_color, Color back_color, Font font, StringFormat string_format, bool Enabled);
  137. void DrawScrollBar (Graphics dc, Rectangle area, Rectangle thumb_pos,
  138. ref Rectangle first_arrow_area, ref Rectangle second_arrow_area,
  139. ButtonState first_arrow, ButtonState second_arrow,
  140. ref int scrollbutton_width, ref int scrollbutton_height,
  141. bool enabled, bool vertical);
  142. void DrawTrackBar (Graphics dc, Rectangle area, TrackBar tb,
  143. ref Rectangle thumb_pos, ref Rectangle thumb_area, bool highli_thumb,
  144. float ticks, int value_pos, bool mouse_value);
  145. void DrawProgressBar (Graphics dc, Rectangle area, Rectangle client_area,
  146. int barpos_pixels, int block_width);
  147. void DrawStatusBar (Graphics dc, Rectangle area, StatusBar sb);
  148. void DrawOwnerDrawBackground (DrawItemEventArgs e);
  149. void DrawOwnerDrawFocusRectangle (DrawItemEventArgs e);
  150. }
  151. }