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.

94 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef ICLIENTPANEL_H
  8. #define ICLIENTPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui/VGUI.h>
  13. #ifdef GetClassName
  14. #undef GetClassName
  15. #endif
  16. class KeyValues;
  17. namespace vgui
  18. {
  19. class Panel;
  20. class SurfaceBase;
  21. enum EInterfaceID
  22. {
  23. ICLIENTPANEL_STANDARD_INTERFACE = 0,
  24. };
  25. //-----------------------------------------------------------------------------
  26. // Purpose: Interface from vgui panels -> Client panels
  27. // This interface cannot be changed without rebuilding all vgui projects
  28. // Primarily this interface handles dispatching messages from core vgui to controls
  29. // The additional functions are all their for debugging or optimization reasons
  30. // To add to this later, use QueryInterface() to see if they support new interfaces
  31. //-----------------------------------------------------------------------------
  32. class IClientPanel
  33. {
  34. public:
  35. virtual VPANEL GetVPanel() = 0;
  36. // straight interface to Panel functions
  37. virtual void Think() = 0;
  38. virtual void PerformApplySchemeSettings() = 0;
  39. virtual void PaintTraverse(bool forceRepaint, bool allowForce) = 0;
  40. virtual void Repaint() = 0;
  41. virtual VPANEL IsWithinTraverse(int x, int y, bool traversePopups) = 0;
  42. virtual void GetInset(int &top, int &left, int &right, int &bottom) = 0;
  43. virtual void GetClipRect(int &x0, int &y0, int &x1, int &y1) = 0;
  44. virtual void OnChildAdded(VPANEL child) = 0;
  45. virtual void OnSizeChanged(int newWide, int newTall) = 0;
  46. virtual void InternalFocusChanged(bool lost) = 0;
  47. virtual bool RequestInfo(KeyValues *outputData) = 0;
  48. virtual void RequestFocus(int direction) = 0;
  49. virtual bool RequestFocusPrev(VPANEL existingPanel) = 0;
  50. virtual bool RequestFocusNext(VPANEL existingPanel) = 0;
  51. virtual void OnMessage(const KeyValues *params, VPANEL ifromPanel) = 0;
  52. virtual VPANEL GetCurrentKeyFocus() = 0;
  53. virtual int GetTabPosition() = 0;
  54. // for debugging purposes
  55. virtual const char *GetName() = 0;
  56. virtual const char *GetClassName() = 0;
  57. // get scheme handles from panels
  58. virtual HScheme GetScheme() = 0;
  59. // gets whether or not this panel should scale with screen resolution
  60. virtual bool IsProportional() = 0;
  61. // auto-deletion
  62. virtual bool IsAutoDeleteSet() = 0;
  63. // deletes this
  64. virtual void DeletePanel() = 0;
  65. // interfaces
  66. virtual void *QueryInterface(EInterfaceID id) = 0;
  67. // returns a pointer to the vgui controls baseclass Panel *
  68. virtual Panel *GetPanel() = 0;
  69. // returns the name of the module this panel is part of
  70. virtual const char *GetModuleName() = 0;
  71. virtual void OnTick() = 0;
  72. };
  73. } // namespace vgui
  74. #endif // ICLIENTPANEL_H