summaryrefslogtreecommitdiff
path: root/public/vgui/IImage.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/vgui/IImage.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/vgui/IImage.h')
-rw-r--r--public/vgui/IImage.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/public/vgui/IImage.h b/public/vgui/IImage.h
new file mode 100644
index 0000000..eadc964
--- /dev/null
+++ b/public/vgui/IImage.h
@@ -0,0 +1,75 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef IIMAGE_H
+#define IIMAGE_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui/VGUI.h>
+
+class Color;
+
+namespace vgui
+{
+
+typedef unsigned long HTexture;
+
+enum iimage_rotation_t
+{
+ ROTATED_UNROTATED = 0,
+ ROTATED_CLOCKWISE_90,
+ ROTATED_ANTICLOCKWISE_90,
+ ROTATED_FLIPPED,
+};
+
+//-----------------------------------------------------------------------------
+// Purpose: Interface to drawing an image
+//-----------------------------------------------------------------------------
+class IImage
+{
+public:
+ // Call to Paint the image
+ // Image will draw within the current panel context at the specified position
+ virtual void Paint() = 0;
+
+ // Set the position of the image
+ virtual void SetPos(int x, int y) = 0;
+
+ // Gets the size of the content
+ virtual void GetContentSize(int &wide, int &tall) = 0;
+
+ // Get the size the image will actually draw in (usually defaults to the content size)
+ virtual void GetSize(int &wide, int &tall) = 0;
+
+ // Sets the size of the image
+ virtual void SetSize(int wide, int tall) = 0;
+
+ // Set the draw color
+ virtual void SetColor(Color col) = 0;
+
+ // virtual destructor
+ virtual ~IImage() {}
+
+ // not for general purpose use
+ // evicts the underlying image from memory if refcounts permit, otherwise ignored
+ // returns true if eviction occurred, otherwise false
+ virtual bool Evict() = 0;
+
+ virtual int GetNumFrames() = 0;
+ virtual void SetFrame( int nFrame ) = 0;
+ virtual HTexture GetID() = 0;
+
+ virtual void SetRotation( int iRotation ) = 0;
+};
+
+} // namespace vgui
+
+
+#endif // IIMAGE_H