Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.8 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Core implementation of vgui
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VGUI_BORDER_H
  8. #define VGUI_BORDER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui/vgui.h>
  13. #include <vgui/IBorder.h>
  14. #include <vgui/IScheme.h>
  15. #include <color.h>
  16. class KeyValues;
  17. namespace vgui
  18. {
  19. //-----------------------------------------------------------------------------
  20. // Purpose: Interface to panel borders
  21. // Borders have a close relationship with panels
  22. //-----------------------------------------------------------------------------
  23. class Border : public IBorder
  24. {
  25. public:
  26. Border();
  27. ~Border();
  28. virtual void Paint(VPANEL panel);
  29. virtual void Paint(int x0, int y0, int x1, int y1);
  30. virtual void Paint(int x0, int y0, int x1, int y1, int breakSide, int breakStart, int breakStop);
  31. virtual void SetInset(int left, int top, int right, int bottom);
  32. virtual void GetInset(int &left, int &top, int &right, int &bottom);
  33. virtual void ApplySchemeSettings(IScheme *pScheme, KeyValues *inResourceData);
  34. virtual const char *GetName();
  35. virtual void SetName(const char *name);
  36. virtual backgroundtype_e GetBackgroundType();
  37. virtual bool PaintFirst( void ) { return false; }
  38. protected:
  39. int _inset[4];
  40. private:
  41. // protected copy constructor to prevent use
  42. Border(Border&);
  43. void ParseSideSettings(int side_index, KeyValues *inResourceData, IScheme *pScheme);
  44. char *_name;
  45. // border drawing description
  46. struct line_t
  47. {
  48. Color col;
  49. int startOffset;
  50. int endOffset;
  51. };
  52. struct side_t
  53. {
  54. int count;
  55. line_t *lines;
  56. };
  57. side_t _sides[4]; // left, top, right, bottom
  58. backgroundtype_e m_eBackgroundType;
  59. friend class VPanel;
  60. };
  61. } // namespace vgui
  62. #endif // VGUI_BORDER_H