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.

73 lines
2.5 KiB

  1. //========= Copyright � 1996-2005, 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. class KeyValues;
  21. abstract_class IViewPortPanel
  22. {
  23. public:
  24. virtual ~IViewPortPanel() {};
  25. virtual const char *GetName( void ) = 0;// return identifer name
  26. virtual void SetData(KeyValues *data) = 0; // set ViewPortPanel data
  27. virtual void Reset( void ) = 0; // clears internal state, deactivates it
  28. virtual void Update( void ) = 0; // updates all (size, position, content, etc)
  29. virtual bool NeedsUpdate( void ) = 0; // query panel if content needs to be updated
  30. virtual bool HasInputElements( void ) = 0; // true if panel contains elments which accepts input
  31. virtual void ReloadScheme( void ) {}
  32. virtual bool CanReplace( const char *panelName ) const { return true; } // returns true if this panel can appear on top of the given panel
  33. virtual bool CanBeReopened( void ) const { return true; } // returns true if this panel can be re-opened after being hidden by another panel
  34. virtual void ShowPanel( bool state ) = 0; // activate VGUI Frame
  35. // VGUI functions:
  36. virtual vgui::VPANEL GetVPanel( void ) = 0; // returns VGUI panel handle
  37. virtual bool IsVisible() = 0; // true if panel is visible
  38. virtual void SetParent( vgui::VPANEL parent ) = 0;
  39. virtual bool WantsBackgroundBlurred( void ) = 0;
  40. virtual void UpdateVisibility( void ) {}
  41. virtual void ViewportThink( void ) {}
  42. virtual void LevelInit( void ) {}
  43. };
  44. abstract_class IViewPort
  45. {
  46. public:
  47. virtual void UpdateAllPanels( void ) = 0;
  48. virtual void ShowPanel( const char *pName, bool state, KeyValues *data, bool autoDeleteData = true ) = 0;
  49. virtual void ShowPanel( const char *pName, bool state ) = 0;
  50. virtual void ShowPanel( IViewPortPanel* pPanel, bool state ) = 0;
  51. virtual void ShowBackGround(bool bShow) = 0;
  52. virtual IViewPortPanel* FindPanelByName(const char *szPanelName) = 0;
  53. virtual IViewPortPanel* GetActivePanel( void ) = 0;
  54. virtual void LevelInit( void ) = 0;
  55. virtual void RecreatePanel( const char *szPanelName ) = 0;
  56. virtual void PostMessageToPanel( const char *pName, KeyValues *pKeyValues ) = 0;
  57. };
  58. extern IViewPort *GetViewPortInterface();
  59. extern IViewPort *GetFullscreenViewPortInterface();
  60. #endif // IVIEWPORT_H