summaryrefslogtreecommitdiff
path: root/public/movieobjects/idmemakefileutils.h
blob: 7145f30488a10f27f5373bf184d69c8970c72d6d (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
68
69
70
71
72
73
74
75
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Interface for makefiles to build differently depending on where they are run from
//
//===========================================================================//

#ifndef IDMEMAKEFILEUTILS_H
#define IDMEMAKEFILEUTILS_H

#ifdef _WIN32
#pragma once
#endif

#include "appframework/IAppSystem.h"
#include "vstdlib/iprocessutils.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CDmElement;


//-----------------------------------------------------------------------------
// Interface version
//-----------------------------------------------------------------------------
#define DMEMAKEFILE_UTILS_INTERFACE_VERSION "VDmeMakeFileUtils001"


//-----------------------------------------------------------------------------
// Interface for makefiles to build differently depending on where they are run from
//-----------------------------------------------------------------------------
enum CompilationState_t
{
	COMPILATION_SUCCESSFUL = 0,
	COMPILATION_NOT_COMPLETE,
	COMPILATION_FAILED,
};

abstract_class IDmeMakefileUtils : public IAppSystem
{
public:
	// Methods related to compilation
	virtual void PerformCompile( CDmElement *pElement, bool bBuildAllDependencies ) = 0;

	// Are we in the middle of compiling something?
	virtual bool IsCurrentlyCompiling( ) = 0;

	// Returns the size of the buffer to pass into UpdateCompilation()
	virtual int GetCompileOutputSize() = 0;

	// Updates the compilation
	virtual CompilationState_t UpdateCompilation( char *pOutputBuf, int nBufLen ) = 0;

	// Aborts the compilation
	virtual void AbortCurrentCompilation() = 0;

	// Opens an external editor for this element
	virtual void PerformOpenEditor( CDmElement *pElement ) = 0;

	// Returns the exit code of the failed compilation (if COMPILATION_FAILED occurred)
	virtual int GetExitCode() = 0;

	// Somewhere in here, we need a method of populating choice lists
	// for things like choosing vstInfoNodes to export for DCC makefiles
};


//-----------------------------------------------------------------------------
// Default implementation
//-----------------------------------------------------------------------------
IDmeMakefileUtils* GetDefaultDmeMakefileUtils();


#endif // IDMEMAKEFILEUTILS_H