art_internal.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/ribbon/art_internal.h
  3. // Purpose: Helper functions & classes used by ribbon art providers
  4. // Author: Peter Cawley
  5. // Modified by:
  6. // Created: 2009-08-04
  7. // Copyright: (C) Peter Cawley
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_RIBBON_ART_INTERNAL_H_
  11. #define _WX_RIBBON_ART_INTERNAL_H_
  12. #include "wx/defs.h"
  13. #if wxUSE_RIBBON
  14. WXDLLIMPEXP_RIBBON wxColour wxRibbonInterpolateColour(
  15. const wxColour& start_colour,
  16. const wxColour& end_colour,
  17. int position,
  18. int start_position,
  19. int end_position);
  20. WXDLLIMPEXP_RIBBON bool wxRibbonCanLabelBreakAtPosition(
  21. const wxString& label,
  22. size_t pos);
  23. WXDLLIMPEXP_RIBBON void wxRibbonDrawParallelGradientLines(
  24. wxDC& dc,
  25. int nlines,
  26. const wxPoint* line_origins,
  27. int stepx,
  28. int stepy,
  29. int numsteps,
  30. int offset_x,
  31. int offset_y,
  32. const wxColour& start_colour,
  33. const wxColour& end_colour);
  34. WXDLLIMPEXP_RIBBON wxBitmap wxRibbonLoadPixmap(
  35. const char* const* bits,
  36. wxColour fore);
  37. /*
  38. HSL colour class, using interface as discussed in wx-dev. Provided mainly
  39. for art providers to perform colour scheme calculations in the HSL colour
  40. space. If such a class makes it into base / core, then this class should be
  41. removed and users switched over to the one in base / core.
  42. 0.0 <= Hue < 360.0
  43. 0.0 <= Saturation <= 1.0
  44. 0.0 <= Luminance <= 1.0
  45. */
  46. class WXDLLIMPEXP_RIBBON wxRibbonHSLColour
  47. {
  48. public:
  49. wxRibbonHSLColour()
  50. : hue(0.0), saturation(0.0), luminance(0.0) {}
  51. wxRibbonHSLColour(float H, float S, float L)
  52. : hue(H), saturation(S), luminance(L) { }
  53. wxRibbonHSLColour(const wxColour& C);
  54. wxColour ToRGB() const;
  55. wxRibbonHSLColour& MakeDarker(float delta);
  56. wxRibbonHSLColour Darker(float delta) const;
  57. wxRibbonHSLColour Lighter(float delta) const;
  58. wxRibbonHSLColour Saturated(float delta) const;
  59. wxRibbonHSLColour Desaturated(float delta) const;
  60. wxRibbonHSLColour ShiftHue(float delta) const;
  61. float hue, saturation, luminance;
  62. };
  63. WXDLLIMPEXP_RIBBON wxRibbonHSLColour wxRibbonShiftLuminance(
  64. wxRibbonHSLColour colour, float amount);
  65. #endif // wxUSE_RIBBON
  66. #endif // _WX_RIBBON_ART_INTERNAL_H_