aboutsummaryrefslogtreecommitdiff
path: root/sp/src/public/vgui/IVGui.h
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /sp/src/public/vgui/IVGui.h
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/public/vgui/IVGui.h')
-rw-r--r--sp/src/public/vgui/IVGui.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/sp/src/public/vgui/IVGui.h b/sp/src/public/vgui/IVGui.h
new file mode 100644
index 00000000..06a3ec8c
--- /dev/null
+++ b/sp/src/public/vgui/IVGui.h
@@ -0,0 +1,105 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//===========================================================================//
+
+#ifndef IVGUI_H
+#define IVGUI_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier1/interface.h"
+#include <vgui/VGUI.h>
+
+#include "appframework/IAppSystem.h"
+
+class KeyValues;
+
+namespace vgui
+{
+
+// safe handle to a panel - can be converted to and from a VPANEL
+typedef unsigned long HPanel;
+typedef int HContext;
+
+enum
+{
+ DEFAULT_VGUI_CONTEXT = ((vgui::HContext)~0)
+};
+
+// safe handle to a panel - can be converted to and from a VPANEL
+typedef unsigned long HPanel;
+
+//-----------------------------------------------------------------------------
+// Purpose: Interface to core vgui components
+//-----------------------------------------------------------------------------
+class IVGui : public IAppSystem
+{
+public:
+ // activates vgui message pump
+ virtual void Start() = 0;
+
+ // signals vgui to Stop running
+ virtual void Stop() = 0;
+
+ // returns true if vgui is current active
+ virtual bool IsRunning() = 0;
+
+ // runs a single frame of vgui
+ virtual void RunFrame() = 0;
+
+ // broadcasts "ShutdownRequest" "id" message to all top-level panels in the app
+ virtual void ShutdownMessage(unsigned int shutdownID) = 0;
+
+ // panel allocation
+ virtual VPANEL AllocPanel() = 0;
+ virtual void FreePanel(VPANEL panel) = 0;
+
+ // debugging prints
+ virtual void DPrintf(PRINTF_FORMAT_STRING const char *format, ...) = 0;
+ virtual void DPrintf2(PRINTF_FORMAT_STRING const char *format, ...) = 0;
+ virtual void SpewAllActivePanelNames() = 0;
+
+ // safe-pointer handle methods
+ virtual HPanel PanelToHandle(VPANEL panel) = 0;
+ virtual VPANEL HandleToPanel(HPanel index) = 0;
+ virtual void MarkPanelForDeletion(VPANEL panel) = 0;
+
+ // makes panel receive a 'Tick' message every frame (~50ms, depending on sleep times/framerate)
+ // panel is automatically removed from tick signal list when it's deleted
+ virtual void AddTickSignal(VPANEL panel, int intervalMilliseconds = 0 ) = 0;
+ virtual void RemoveTickSignal(VPANEL panel) = 0;
+
+ // message sending
+ virtual void PostMessage(VPANEL target, KeyValues *params, VPANEL from, float delaySeconds = 0.0f) = 0;
+
+ // Creates/ destroys vgui contexts, which contains information
+ // about which controls have mouse + key focus, for example.
+ virtual HContext CreateContext() = 0;
+ virtual void DestroyContext( HContext context ) = 0;
+
+ // Associates a particular panel with a vgui context
+ // Associating NULL is valid; it disconnects the panel from the context
+ virtual void AssociatePanelWithContext( HContext context, VPANEL pRoot ) = 0;
+
+ // Activates a particular context, use DEFAULT_VGUI_CONTEXT
+ // to get the one normally used by VGUI
+ virtual void ActivateContext( HContext context ) = 0;
+
+ // whether to sleep each frame or not, true = sleep
+ virtual void SetSleep( bool state) = 0;
+
+ // data accessor for above
+ virtual bool GetShouldVGuiControlSleep() = 0;
+};
+
+#define VGUI_IVGUI_INTERFACE_VERSION "VGUI_ivgui008"
+
+};
+
+
+#endif // IVGUI_H