2
0

ITheme.cs 7.0 KB

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