ITheme.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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.2 $
  28. // $Modtime: $
  29. // $Log: ITheme.cs,v $
  30. // Revision 1.2 2004/08/07 19:05:44 jordi
  31. // Theme colour support and GetSysColor defines
  32. //
  33. // Revision 1.1 2004/07/26 17:42:03 jordi
  34. // Theme support
  35. //
  36. //
  37. using System.Drawing;
  38. using System.Drawing.Drawing2D;
  39. using System.Drawing.Imaging;
  40. namespace System.Windows.Forms
  41. {
  42. internal interface ITheme
  43. {
  44. /* Internal colors to paint controls */
  45. Color ColorLight {get;}
  46. Color ColorDisabled {get;}
  47. Color ColorDark {get;}
  48. Color ColorMain {get;}
  49. Color ColorFocus {get;}
  50. Color ColorShadow {get;}
  51. Color ColorLightTop {get;}
  52. /* Windows System Colors. Based on Wine */
  53. Color ColorScrollbar {get;} //COLOR_SCROLLBAR
  54. Color ColorBackground {get;} //COLOR_BACKGROUND
  55. Color ColorActiveTitle {get;} //COLOR_ACTIVECAPTION
  56. Color ColorInactiveTitle {get;} //COLOR_INACTIVECAPTION
  57. Color ColorMenu {get;} //COLOR_MENU
  58. Color ColorWindow {get;} //COLOR_WINDOW
  59. Color WindowFrame {get;} //COLOR_WINDOWFRAME
  60. Color ColorMenuText {get;} //COLOR_MENUTEXT
  61. Color ColorWindowText {get;} //COLOR_WINDOWTEXT
  62. Color ColorTitleText {get;} //COLOR_CAPTIONTEXT
  63. Color ColorActiveBorder {get;} //COLOR_ACTIVEBORDER
  64. Color ColorInactiveBorder {get;} //COLOR_INACTIVEBORDER
  65. Color ColorAppWorkSpace {get;} //COLOR_APPWORKSPACE
  66. Color ColorHilight {get;} //COLOR_HIGHLIGHT
  67. Color ColorHilightText {get;} //COLOR_HIGHLIGHTTEXT
  68. Color ColorButtonFace {get;} //COLOR_BTNFACE
  69. Color ColorButtonShadow {get;} //COLOR_BTNSHADOW
  70. Color ColorGrayText {get;} //COLOR_GRAYTEXT
  71. Color ColorButtonText {get;} //COLOR_BTNTEXT
  72. Color ColorInactiveTitleText {get;} //COLOR_INACTIVECAPTIONTEXT
  73. Color ColorButtonHilight {get;} //COLOR_BTNHIGHLIGHT
  74. Color ColorButtonDkShadow {get;} //COLOR_3DDKSHADOW
  75. Color ColorButtonLight {get;} //COLOR_3DLIGHT
  76. Color ColorInfoText {get;} //COLOR_INFOTEXT
  77. Color ColorInfoWindow {get;} //COLOR_INFOBK
  78. Color ColorButtonAlternateFace {get;} //COLOR_ALTERNATEBTNFACE
  79. Color ColorHotTrackingColor {get;} //COLOR_HOTLIGHT
  80. Color ColorGradientActiveTitle {get;} //COLOR_GRADIENTACTIVECAPTION
  81. Color ColorGradientInactiveTitle {get;} //COLOR_GRADIENTINACTIVECAPTION
  82. /*
  83. Methods that mimic ControlPaint signature and draw basic objects
  84. */
  85. void DrawBorder (Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
  86. ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
  87. Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor,
  88. int bottomWidth, ButtonBorderStyle bottomStyle);
  89. void DrawBorder3D (Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides);
  90. void DrawButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  91. void DrawCaptionButton (Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state);
  92. void DrawCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state);
  93. void DrawComboButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  94. void DrawContainerGrabHandle (Graphics graphics, Rectangle bounds);
  95. void DrawFocusRectangle (Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor);
  96. void DrawGrabHandle (Graphics graphics, Rectangle rectangle, bool primary, bool enabled);
  97. void DrawGrid (Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor);
  98. void DrawImageDisabled (Graphics graphics, Image image, int x, int y, Color background);
  99. void DrawLockedFrame (Graphics graphics, Rectangle rectangle, bool primary);
  100. void DrawMenuGlyph (Graphics graphics, Rectangle rectangle, MenuGlyph glyph);
  101. void DrawRadioButton (Graphics graphics, Rectangle rectangle, ButtonState state);
  102. void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style);
  103. void DrawReversibleLine (Point start, Point end, Color backColor);
  104. void DrawScrollButton (Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state);
  105. void DrawSelectionFrame (Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect,
  106. Color backColor);
  107. void DrawSizeGrip (Graphics graphics, Color backColor, Rectangle bounds);
  108. void DrawStringDisabled (Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle,
  109. StringFormat format);
  110. /*
  111. Methods that draw complex controls
  112. */
  113. void DrawLabel (Graphics dc, Rectangle area, BorderStyle border_style, string text,
  114. Color fore_color, Color back_color, Font font, StringFormat string_format, bool Enabled);
  115. void DrawScrollBar (Graphics dc, Rectangle area, Rectangle thumb_pos,
  116. ref Rectangle first_arrow_area, ref Rectangle second_arrow_area,
  117. ButtonState first_arrow, ButtonState second_arrow,
  118. ref int scrollbutton_width, ref int scrollbutton_height,
  119. bool enabled, bool vertical);
  120. void DrawTrackBar (Graphics dc, Rectangle area, ref Rectangle thumb_pos,
  121. ref Rectangle thumb_area, TickStyle style, int ticks, Orientation orientation, bool focused);
  122. void DrawProgressBar (Graphics dc, Rectangle area, Rectangle client_area,
  123. int barpos_pixels, int block_width);
  124. }
  125. }