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.

60 lines
1.5 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef IG15_H
  7. #define IG15_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. typedef void * G15_HANDLE;
  12. typedef enum
  13. {
  14. G15_BUTTON_1, G15_BUTTON_2, G15_BUTTON_3, G15_BUTTON_4
  15. } G15SoftButton;
  16. typedef enum
  17. {
  18. G15_SMALL, G15_MEDIUM, G15_BIG
  19. } G15TextSize;
  20. typedef enum
  21. {
  22. G15_SCROLLING_TEXT, G15_STATIC_TEXT, G15_ICON, G15_PROGRESS_BAR, G15_UNKNOWN
  23. } G15ObjectType;
  24. class IG15
  25. {
  26. public:
  27. virtual void GetLCDSize( int &w, int &h ) = 0;
  28. // w, h should match the return value from GetLCDSize!!!
  29. // Creates the underlying object
  30. virtual bool Init( char const *name ) = 0;
  31. // Destroys the underlying object
  32. virtual void Shutdown() = 0;
  33. virtual bool IsConnected() = 0;
  34. // Add/remove
  35. virtual G15_HANDLE AddText(G15ObjectType type, G15TextSize size, int alignment, int maxLengthPixels) = 0;
  36. virtual G15_HANDLE AddIcon( void *icon, int sizeX, int sizeY) = 0;
  37. virtual void RemoveAndDestroyObject( G15_HANDLE hObject ) = 0;
  38. // Change
  39. virtual int SetText(G15_HANDLE handle, char const * text) = 0;
  40. virtual int SetOrigin(G15_HANDLE handle, int x, int y) = 0;
  41. virtual int SetVisible(G15_HANDLE handle, bool visible) = 0;
  42. virtual bool ButtonTriggered(int button) = 0;
  43. virtual void UpdateLCD( unsigned int dwTimestamp) = 0;
  44. };
  45. #define G15_INTERFACE_VERSION "G15_INTERFACE_VERSION001"
  46. #endif // IG15_H