summaryrefslogtreecommitdiff
path: root/win/system.h
blob: a62d3c0107ae6469196dbb2cafa483e49a33c2b4 (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//
//	system.h
////////////////////////////////////////////////////

#ifndef _SYSTEM_H_
#define _SYSTEM_H_

class File;
class Camera;
class PieceInfo;
#include "defines.h"
#include "typedefs.h"

void Export3DStudio();

// Profile
int SystemGetProfileInt(const char* section, const char* entry, const int defaultvalue);
bool SystemSetProfileInt(const char* section, const char* entry, const int value);
bool SystemSetProfileString(const char* section, const char* entry, const char* value);
const char* SystemGetProfileString(const char* section, const char* entry, const char* defaultvalue);

// User Interface
void SystemUpdateViewport(int nNew, int nOld);
void SystemUpdateAction(int nNew, int nOld);
void SystemUpdateColorList(int nNew);
void SystemUpdateRenderingMode(bool bBackground, bool bFast);
void SystemUpdateUndoRedo(char* undo, char* redo);
void SystemUpdateSnap(const unsigned long nSnap);
void SystemUpdateCurrentCamera(Camera* pOld, Camera* pNew, Camera* pCamera);
void SystemUpdateCameraMenu(Camera* pCamera);
void SystemUpdateTime(bool bAnimation, int nTime, int nTotal);
void SystemUpdateAnimation(bool bAnimation, bool bAddKeys);
void SystemUpdateMoveSnap(unsigned short nMoveSnap);
void SystemUpdateSelected(unsigned long flags);
void SystemUpdateRecentMenu(char names[4][LC_MAXPATH]);
void SystemUpdatePaste(bool enable);
void SystemUpdatePlay(bool play, bool stop);
void SystemUpdateFocus(void* object, unsigned char type);

// Memory render
void* SystemStartRender(int width, int height);
void SystemFinishRender(void* param);
LC_IMAGE* SystemGetRenderImage(void* param);

// Message box
#define LC_OK		IDOK
#define LC_CANCEL	IDCANCEL
#define LC_ABORT	IDABORT
#define LC_RETRY	IDRETRY
#define LC_IGNORE	IDIGNORE
#define LC_YES		IDYES
#define LC_NO		IDNO

#define LC_MB_OK				MB_OK
#define LC_MB_OKCANCEL			MB_OKCANCEL
#define LC_MB_ABORTRETRYIGNORE	MB_ABORTRETRYIGNORE
#define LC_MB_YESNOCANCEL		MB_YESNOCANCEL
#define LC_MB_YESNO				MB_YESNO
#define LC_MB_RETRYCANCEL		MB_RETRYCANCEL
#define LC_MB_ICONERROR			MB_ICONHAND
#define LC_MB_ICONQUESTION		MB_ICONQUESTION
#define LC_MB_ICONWARNING		MB_ICONEXCLAMATION
#define LC_MB_ICONINFORMATION	MB_ICONASTERISK

void SystemInit();
void SystemFinish();
int SystemDoMessageBox(char* prompt, int nMode);
bool SystemDoDialog(int nMode, void* param);
void SystemDoPopupMenu(int nMenu, int x, int y);
void SystemDoWaitCursor(int nCode);

void SystemSetWindowCaption(char* caption);
void SystemRedrawView();
void SystemPieceComboAdd(char* name);
inline void SystemSetGroup(int group)
{
	AfxGetMainWnd()->PostMessage (WM_LC_UPDATE_LIST, group+2, 0);
}

void SystemExportClipboard(File* clip);
File* SystemImportClipboard();

void SystemCaptureMouse();
void SystemReleaseMouse();

inline void SystemPumpMessages()
{
	MSG msg;
	while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
}

inline long SystemGetTicks()
{
	return GetTickCount();
}

inline void SystemSwapBuffers()
{
	SwapBuffers(wglGetCurrentDC());
}

#endif // _SYSTEM_H_