Team Fortress 2 Source Code as on 22/4/2020
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.

75 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IIMAGE_H
  8. #define IIMAGE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui/VGUI.h>
  13. class Color;
  14. namespace vgui
  15. {
  16. typedef unsigned long HTexture;
  17. enum iimage_rotation_t
  18. {
  19. ROTATED_UNROTATED = 0,
  20. ROTATED_CLOCKWISE_90,
  21. ROTATED_ANTICLOCKWISE_90,
  22. ROTATED_FLIPPED,
  23. };
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Interface to drawing an image
  26. //-----------------------------------------------------------------------------
  27. class IImage
  28. {
  29. public:
  30. // Call to Paint the image
  31. // Image will draw within the current panel context at the specified position
  32. virtual void Paint() = 0;
  33. // Set the position of the image
  34. virtual void SetPos(int x, int y) = 0;
  35. // Gets the size of the content
  36. virtual void GetContentSize(int &wide, int &tall) = 0;
  37. // Get the size the image will actually draw in (usually defaults to the content size)
  38. virtual void GetSize(int &wide, int &tall) = 0;
  39. // Sets the size of the image
  40. virtual void SetSize(int wide, int tall) = 0;
  41. // Set the draw color
  42. virtual void SetColor(Color col) = 0;
  43. // virtual destructor
  44. virtual ~IImage() {}
  45. // not for general purpose use
  46. // evicts the underlying image from memory if refcounts permit, otherwise ignored
  47. // returns true if eviction occurred, otherwise false
  48. virtual bool Evict() = 0;
  49. virtual int GetNumFrames() = 0;
  50. virtual void SetFrame( int nFrame ) = 0;
  51. virtual HTexture GetID() = 0;
  52. virtual void SetRotation( int iRotation ) = 0;
  53. };
  54. } // namespace vgui
  55. #endif // IIMAGE_H