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.

84 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IMAGE_H
  8. #define IMAGE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui/vgui.h>
  13. #include <color.h>
  14. #include <vgui/IImage.h>
  15. namespace vgui
  16. {
  17. class Panel;
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Basic image control
  20. //-----------------------------------------------------------------------------
  21. class Image : public IImage
  22. {
  23. public:
  24. Image();
  25. virtual ~Image();
  26. // Set the position of the image
  27. virtual void SetPos( int x, int y );
  28. // Get the position of the image
  29. virtual void GetPos( int &x, int &y );
  30. // Get the size of the image
  31. virtual void GetSize( int &wide, int &tall );
  32. virtual void GetContentSize( int &wide, int &tall );
  33. // Set the draw color
  34. virtual void SetColor( Color color );
  35. // set the background color
  36. virtual void SetBkColor( Color color ) { DrawSetColor( color ); }
  37. // Get the draw color
  38. virtual Color GetColor();
  39. virtual bool Evict();
  40. virtual int GetNumFrames();
  41. virtual void SetFrame( int nFrame );
  42. virtual HTexture GetID();
  43. virtual void SetRotation( int iRotation ) { return; };
  44. // Get the size of the image
  45. virtual int GetTall();
  46. virtual int GetWide();
  47. protected:
  48. virtual void SetSize(int wide, int tall);
  49. virtual void DrawSetColor(Color color);
  50. virtual void DrawSetColor(int r, int g, int b, int a);
  51. virtual void DrawFilledRect(int x0, int y0, int x1, int y1);
  52. virtual void DrawOutlinedRect(int x0, int y0, int x1, int y1);
  53. virtual void DrawLine(int x0,int y0,int x1,int y1);
  54. virtual void DrawPolyLine(int *px, int *py, int numPoints);
  55. virtual void DrawSetTextFont(HFont font);
  56. virtual void DrawSetTextColor(Color color);
  57. virtual void DrawSetTextColor(int r, int g, int b, int a);
  58. virtual void DrawSetTextPos(int x,int y);
  59. virtual void DrawPrintText(const wchar_t *str, int strlen);
  60. virtual void DrawPrintText(int x, int y, const wchar_t *str, int strlen);
  61. virtual void DrawPrintChar(wchar_t ch);
  62. virtual void DrawPrintChar(int x, int y, wchar_t ch);
  63. virtual void DrawSetTexture(int id);
  64. virtual void DrawTexturedRect(int x0, int y0, int x1, int y1);
  65. virtual void Paint() = 0;
  66. private:
  67. int _pos[2];
  68. int _size[2];
  69. Color _color;
  70. };
  71. } // namespace vgui
  72. #endif // IMAGE_H