Border.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef Rahmen_H
  2. #define Rahmen_H
  3. #include "Drawing.h"
  4. namespace Framework
  5. {
  6. class Bild; //! Image.h
  7. class Rahmen : public Drawable
  8. {
  9. protected:
  10. int br;
  11. int farbe;
  12. bool alpha;
  13. bool breaks;
  14. int breakOffset;
  15. int breakLength;
  16. int lineLength;
  17. public:
  18. //! Constructor
  19. DLLEXPORT Rahmen();
  20. //! Destructor
  21. DLLEXPORT virtual ~Rahmen();
  22. //! Sets the width of the border
  23. //! \param br The width in pixels
  24. DLLEXPORT void setRamenBreite(int br);
  25. //! If this flag is set, the border is drawn dashed
  26. //! \param br 1 -> dashed, 0 -> solid
  27. //! \param brOff Starting point of the first line segment
  28. //! \param brLength Length of a gap
  29. //! \param lineLength Length of a line
  30. DLLEXPORT void setBreaks(
  31. bool br, int brOff = 0, int brLength = 10, int lineLength = 10);
  32. //! Returns the width of the border in pixels
  33. DLLEXPORT int getRBreite() const;
  34. //! Sets whether alpha blending should be used when drawing
  35. //! \param a 1 if alpha blending should be used
  36. DLLEXPORT void setAlpha(bool a);
  37. //! Sets the color of the border
  38. //! \param f The color in A8R8G8B8 format
  39. DLLEXPORT void setFarbe(int f);
  40. //! Returns the color of the border in A8R8G8B8 format
  41. DLLEXPORT int getFarbe() const;
  42. //! Returns whether the border is drawn with alpha blending
  43. DLLEXPORT bool hatAlpha() const;
  44. //! Returns 1 if the border is drawn dashed
  45. DLLEXPORT bool hasBreaks() const;
  46. //! Starting point of the first line segment
  47. DLLEXPORT int getBreakOffset() const;
  48. //! Length of a gap
  49. DLLEXPORT int getBreakLength() const;
  50. //! Length of a line
  51. DLLEXPORT int getLineLength() const;
  52. };
  53. //! A 2D GUI Framework drawing that draws a line border around a
  54. //! rectangle
  55. class LRahmen : public Rahmen
  56. {
  57. private:
  58. public:
  59. //! Constructor
  60. DLLEXPORT LRahmen();
  61. //! Destructor
  62. DLLEXPORT virtual ~LRahmen();
  63. //! Draws the border
  64. //! \param zRObj The image to draw the border into
  65. DLLEXPORT void render(Bild& zRObj) override;
  66. //! Copies the border so that it can be modified without affecting
  67. //! the original
  68. DLLEXPORT Drawable* dublizieren() const override;
  69. };
  70. class Rahmen3D : public Rahmen
  71. {
  72. public:
  73. //! Constructor
  74. DLLEXPORT Rahmen3D();
  75. //! Destructor
  76. DLLEXPORT virtual ~Rahmen3D();
  77. //! Draws the border
  78. //! \param zRObj The image to draw the border into
  79. DLLEXPORT void render(Bild& zRObj) override;
  80. //! Copies the border so that it can be modified without affecting
  81. //! the original
  82. DLLEXPORT Drawable* dublizieren() const override;
  83. };
  84. } // namespace Framework
  85. #endif