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.

56 lines
1.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IMAGELIST_H
  8. #define IMAGELIST_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <utlvector.h>
  13. #include <vgui/vgui.h>
  14. #include <vgui/IImage.h>
  15. namespace vgui
  16. {
  17. //-----------------------------------------------------------------------------
  18. // Purpose: holds a collection of images
  19. // used by controls so that images can be refered to by indices
  20. //-----------------------------------------------------------------------------
  21. class ImageList
  22. {
  23. public:
  24. ImageList(bool deleteImagesWhenDone);
  25. ~ImageList();
  26. // adds a new image to the list, returning the index it was placed at
  27. int AddImage(vgui::IImage *image);
  28. // returns the number of images
  29. int GetImageCount();
  30. // returns true if an index is valid
  31. bool IsValidIndex(int imageIndex);
  32. // sets an image at a specified index, growing and adding NULL images if necessary
  33. void SetImageAtIndex(int index, vgui::IImage *image);
  34. // gets an image, imageIndex is of range [0, GetImageCount)
  35. // image index 0 is always the blank image
  36. vgui::IImage *GetImage(int imageIndex);
  37. private:
  38. CUtlVector<vgui::IImage *> m_Images;
  39. bool m_bDeleteImagesWhenDone;
  40. };
  41. } // namespace vgui
  42. #endif // IMAGELIST_H