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.

64 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #if !defined( IVIEWPORT_H )
  14. #define IVIEWPORT_H
  15. #ifdef _WIN32
  16. #pragma once
  17. #endif
  18. #include <vgui/VGUI.h>
  19. #include "viewport_panel_names.h"
  20. #include "inputsystem/InputEnums.h"
  21. class KeyValues;
  22. abstract_class IViewPortPanel
  23. {
  24. public:
  25. virtual ~IViewPortPanel() {};
  26. virtual const char *GetName( void ) = 0;// return identifer name
  27. virtual void SetData(KeyValues *data) = 0; // set ViewPortPanel data
  28. virtual void Reset( void ) = 0; // clears internal state, deactivates it
  29. virtual void Update( void ) = 0; // updates all (size, position, content, etc)
  30. virtual bool NeedsUpdate( void ) = 0; // query panel if content needs to be updated
  31. virtual bool HasInputElements( void ) = 0; // true if panel contains elments which accepts input
  32. virtual void ShowPanel( bool state ) = 0; // activate VGUI Frame
  33. virtual GameActionSet_t GetPreferredActionSet() = 0;
  34. // VGUI functions:
  35. virtual vgui::VPANEL GetVPanel( void ) = 0; // returns VGUI panel handle
  36. virtual bool IsVisible() = 0; // true if panel is visible
  37. virtual void SetParent( vgui::VPANEL parent ) = 0;
  38. };
  39. abstract_class IViewPort
  40. {
  41. public:
  42. virtual void UpdateAllPanels( void ) = 0;
  43. virtual void ShowPanel( const char *pName, bool state ) = 0;
  44. virtual void ShowPanel( IViewPortPanel* pPanel, bool state ) = 0;
  45. virtual void ShowBackGround(bool bShow) = 0;
  46. virtual IViewPortPanel* FindPanelByName(const char *szPanelName) = 0;
  47. virtual IViewPortPanel* GetActivePanel( void ) = 0;
  48. virtual void PostMessageToPanel( const char *pName, KeyValues *pKeyValues ) = 0;
  49. };
  50. extern IViewPort *gViewPortInterface;
  51. #endif // IVIEWPORT_H