summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2000-07-16 19:29:15 +0000
committerleo2000-07-16 19:29:15 +0000
commit6b9d54b5ef8d4fa9ff61f7b8d46928d4cedcc4a2 (patch)
treeb1d4a02cc043b16fe06a9bf17bc2ce2eab6c8c3b
parentc59fcf58a5ebab315696bc1ed91329baa49a615a (diff)
The functions declared here should exist for all systems, so it was moved
to the 'common' directory. git-svn-id: http://svn.leocad.org/trunk@81 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rwxr-xr-xcommon/system.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/common/system.h b/common/system.h
new file mode 100755
index 0000000..a41aff9
--- /dev/null
+++ b/common/system.h
@@ -0,0 +1,102 @@
+#ifndef _SYSTEM_H_
+#define _SYSTEM_H_
+
+#include "defines.h"
+#include "typedefs.h"
+
+// Profile functions
+bool Sys_ProfileSaveInt (const char *section, const char *key, int value);
+bool Sys_ProfileSaveString (const char *section, const char *key, const char *value);
+int Sys_ProfileLoadInt (const char *section, const char *key, int default_value);
+char* Sys_ProfileLoadString (const char *section, const char *key, const char *default_value);
+
+// Memory render
+void* Sys_StartMemoryRender (int width, int height);
+void Sys_FinishMemoryRender (void* param);
+
+// Cursor functions
+void Sys_BeginWait ();
+void Sys_EndWait ();
+void Sys_GetCursorPos (int *x, int *y);
+void Sys_SetCursorPos (int x, int y);
+
+// Message Box
+#define LC_OK 1
+#define LC_CANCEL 2
+#define LC_ABORT 3
+#define LC_RETRY 4
+#define LC_IGNORE 5
+#define LC_YES 6
+#define LC_NO 7
+
+#define LC_MB_OK 0x000
+#define LC_MB_OKCANCEL 0x001
+//#define LC_MB_ABORTRETRYIGNORE 0x002
+#define LC_MB_YESNOCANCEL 0x003
+#define LC_MB_YESNO 0x004
+//#define LC_MB_RETRYCANCEL 0x005
+
+#define LC_MB_ICONERROR 0x010
+#define LC_MB_ICONQUESTION 0x020
+#define LC_MB_ICONWARNING 0x040
+#define LC_MB_ICONINFORMATION 0x080
+
+#define LC_MB_TYPEMASK 0x00F
+#define LC_MB_ICONMASK 0x0F0
+
+int Sys_MessageBox (const char* text, const char* caption="LeoCAD", int type=LC_MB_OK|LC_MB_ICONINFORMATION);
+
+
+
+
+
+
+
+
+
+class File;
+class Camera;
+class PieceInfo;
+
+// 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);
+
+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 SystemSetGroup(int nNew);
+void SystemSetWindowCaption(char* caption);
+void SystemRedrawView();
+void SystemPieceComboAdd(char* name);
+
+void SystemCaptureMouse();
+void SystemReleaseMouse();
+
+void SystemExportClipboard(File* clip);
+File* SystemImportClipboard();
+
+void SystemSwapBuffers();
+void SystemPumpMessages();
+long SystemGetTicks();
+
+
+#endif // _SYSTEM_H_