aboutsummaryrefslogtreecommitdiff
path: root/sp/src/public/maya/IMayaVGui.h
blob: eda8f25518b86a4cee84c9ee355c62ad55b532e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
//
// Purpose: Interface for dealing with vgui focus issues across all plugins
//
// $NoKeywords: $
//===========================================================================//

#ifndef IMAYAVGUI_H
#define IMAYAVGUI_H

#ifdef _WIN32
#pragma once
#endif


#include "tier0/platform.h"
#include "appframework/iappsystem.h"
#include "vgui_controls/Frame.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
namespace vgui
{
	class EditablePanel;
}

class CVsVGuiWindowBase;


//-----------------------------------------------------------------------------
// Factory for creating vgui windows
//-----------------------------------------------------------------------------
abstract_class IMayaVguiWindowFactory
{
public:
	virtual void CreateVguiWindow( const char *pPanelName ) = 0; 
	virtual void DestroyVguiWindow( const char *pPanelName ) = 0; 
	virtual vgui::Frame *GetVGuiPanel( const char *pPanelName = NULL ) = 0;
	virtual CVsVGuiWindowBase *GetVGuiWindow( const char *pPanelName = NULL ) = 0;
};


//-----------------------------------------------------------------------------
// Interface for dealing with vgui focus issues across all plugins
//-----------------------------------------------------------------------------
#define MAYA_VGUI_INTERFACE_VERSION "VMayaVGui001"
abstract_class IMayaVGui : public IAppSystem
{
public:
	virtual void InstallVguiWindowFactory( const char *pWindowTypeName, IMayaVguiWindowFactory *pFactory ) = 0;
	virtual void RemoveVguiWindowFactory( const char *pWindowTypeName, IMayaVguiWindowFactory *pFactory ) = 0;
	virtual void SetFocus( void *hWnd, int hVGuiContext ) = 0;
	virtual bool HasFocus( void *hWnd ) = 0;

	// In this mode, maya's in a strange re-entrant mode waiting for a modal dialog
	// We still get WM_PAINT messages, but we're in the middle of a callstack
	// deep in the bowels of VGUI
	virtual void SetModalMode( bool bEnable ) = 0;
	virtual bool IsInModalMode( ) const = 0;
};

extern IMayaVGui* g_pMayaVGui;


#endif // IMAYAVGUI_H