ScummVM API documentation
low_level_system.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * Copyright (C) 2006-2010 - Frictional Games
24 *
25 * This file is part of HPL1 Engine.
26 */
27
28#ifndef HPL_LOWLEVELSYSTEM_H
29#define HPL_LOWLEVELSYSTEM_H
30
31#include "hpl1/engine/libraries/angelscript/angelscript.h"
32#include "hpl1/engine/system/MemoryManager.h"
33#include "hpl1/engine/system/SystemTypes.h"
34
35class asIScriptEngine;
36
37namespace hpl {
38
39#ifdef UPDATE_TIMING_ENABLED
40#define START_TIMING_EX(x, y) \
41 LogUpdate("Updating %s in file %s at line %d\n", x, __FILE__, __LINE__); \
42 unsigned int y##_lTime = GetApplicationTime();
43#define START_TIMING(x) \
44 LogUpdate("Updating %s in file %s at line %d\n", #x, __FILE__, __LINE__); \
45 unsigned int x##_lTime = GetApplicationTime();
46#define STOP_TIMING(x) LogUpdate(" Time spent: %d ms\n", GetApplicationTime() - x##_lTime);
47#define START_TIMING_TAB(x) \
48 LogUpdate("\tUpdating %s in file %s at line %d\n", #x, __FILE__, __LINE__); \
49 unsigned int x##_lTime = GetApplicationTime();
50#define STOP_TIMING_TAB(x) LogUpdate("\t Time spent: %d ms\n", GetApplicationTime() - x##_lTime);
51#else
52#define START_TIMING_EX(x, y)
53#define START_TIMING(x)
54#define STOP_TIMING(x)
55#define START_TIMING_TAB(x)
56#define STOP_TIMING_TAB(x)
57#endif
58
59class iScript;
60
61extern void SetLogFile(const tWString &File);
62extern void Error(const char *fmt, ...);
63extern void Warning(const char *fmt, ...);
64extern void Log(const char *fmt, ...);
65
66extern void SetUpdateLogActive(bool abX);
67extern void LogUpdate(const char *fmt, ...);
68
69extern void CreateMessageBoxW(const wchar_t *caption, const wchar_t *fmt, ...);
70extern void CreateMessageBoxW(eMsgBoxType eType, const wchar_t *caption, const wchar_t *fmt, ...);
71
72extern void OpenBrowserWindow(const tWString &URL);
73
74extern void CopyTextToClipboard(const tWString &text);
75extern tWString LoadTextFromClipboard();
76
77extern tWString GetSystemSpecialPath(eSystemPath pathType);
78
79extern bool FileExists(const tWString &fileName);
80extern void RemoveFile(const tWString &fileName);
81extern bool CloneFile(const tWString &srcFileName, const tWString &destFileName,
82 bool failIfExists);
83extern bool CreateFolder(const tWString &path);
84extern bool FolderExists(const tWString &path);
85extern bool IsFileLink(const tWString &path);
86extern bool LinkFile(const tWString &pointsTo, const tWString &link);
87extern bool RenameFile(const tWString &from, const tWString &to);
88extern cDate FileModifiedDate(const tWString &filePath);
89extern cDate FileCreationDate(const tWString &filePath);
90
91extern void SetWindowCaption(const tString &name);
92
93extern unsigned long GetApplicationTime();
94
96public:
99
104 unsigned long getTime();
105
110
117
123 bool addScriptFunc(const tString &funcDecl, asGENFUNC_t func, int callConv);
124
131 bool addScriptVar(const tString &varDecl, void *var);
132
137 void sleep(const unsigned int millisecs);
138
139private:
140 asIScriptEngine *_scriptEngine;
141 int _handleCount;
142};
143
144} // namespace hpl
145
146#endif // HPL_LOWLEVELSYSTEM_H
Definition: str.h:59
Definition: angelscript.h:639
Definition: low_level_system.h:95
bool addScriptVar(const tString &varDecl, void *var)
bool addScriptFunc(const tString &funcDecl, asGENFUNC_t func, int callConv)
void sleep(const unsigned int millisecs)
iScript * createScript(const tString &name)
unsigned long getTime()
Definition: SystemTypes.h:154
Definition: Script.h:223