summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorleo2006-02-16 00:43:45 +0000
committerleo2006-02-16 00:43:45 +0000
commitfbfc76ee445a633ff94b8f155a0781ea71a9d941 (patch)
treee15cd7cd6de1becf01a250be59b7a92c4d35bb2b /common
parentfc7282961f5c8021060f46301bbf2ae9733c6752 (diff)
OS X config script
git-svn-id: http://svn.leocad.org/trunk@477 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common')
-rw-r--r--common/basewnd.h14
-rw-r--r--common/defines.h31
-rwxr-xr-xcommon/opengl.h5
3 files changed, 43 insertions, 7 deletions
diff --git a/common/basewnd.h b/common/basewnd.h
index 1af4db6..f26f4f5 100644
--- a/common/basewnd.h
+++ b/common/basewnd.h
@@ -13,9 +13,9 @@ typedef struct
int index;
UINT command;
} BaseMenuItem;
+#endif
-#else
-
+#ifdef LC_LINUX
#include <gtk/gtk.h>
typedef GtkWidget* BaseWndXID;
typedef struct
@@ -25,6 +25,14 @@ typedef struct
} BaseMenuItem;
#endif
+#ifdef LC_MACOSX
+typedef void* BaseWndXID;
+typedef struct
+{
+ void* Dummy;
+} BaseMenuItem;
+#endif
+
// =============================================================================
// Message Box constants
@@ -74,7 +82,7 @@ class BaseWnd
void SetXID (BaseWndXID id)
{ m_pXID = id; }
-#ifndef WIN32
+#ifdef LC_LINUX
// FIXME: remove
operator GtkWidget* () const
{ return m_pXID; }
diff --git a/common/defines.h b/common/defines.h
index d1b50a7..ebea0ff 100644
--- a/common/defines.h
+++ b/common/defines.h
@@ -4,10 +4,8 @@
#ifndef _DEFINES_H_
#define _DEFINES_H_
-/////////////////////////////////////////////////////////////////////////////
-// System specific
-
-#if !(defined(LC_WINDOWS) || defined(LC_LINUX))
+// Check for supported platforms.
+#if !(defined(LC_WINDOWS) || defined(LC_LINUX) || defined(LC_MACOSX))
#error YOU NEED TO DEFINE YOUR OS
#endif
@@ -55,6 +53,31 @@ int stricmp(const char* str1, const char* str2);
#endif
+#ifdef LC_MACOSX
+#define LC_MAXPATH 1024 //FILENAME_MAX
+
+#define KEY_SHIFT 0x01
+#define KEY_CONTROL 0x02
+#define KEY_ESCAPE 0x03
+#define KEY_TAB 0x04
+#define KEY_INSERT 0x05
+#define KEY_DELETE 0x06
+#define KEY_UP 0x07
+#define KEY_DOWN 0x08
+#define KEY_LEFT 0x09
+#define KEY_RIGHT 0x0A
+#define KEY_PRIOR 0x0B
+#define KEY_NEXT 0x0C
+#define KEY_PLUS '+'
+#define KEY_MINUS '-'
+
+char* strupr(char* string);
+char* strlwr(char* string);
+int stricmp(const char* str1, const char* str2);
+
+#endif
+
+
/////////////////////////////////////////////////////////////////////////////
// LeoCAD constants
diff --git a/common/opengl.h b/common/opengl.h
index 2a56559..6445b5c 100755
--- a/common/opengl.h
+++ b/common/opengl.h
@@ -15,6 +15,11 @@
#include "linux_gl.h"
#endif
+#ifdef LC_MACOSX
+#include <OpenGL/gl.h>
+#include <AGL/agl.h>
+#endif
+
//#include <GL/glu.h> // TODO: remove all glu calls
void gluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez,
GLdouble centerx, GLdouble centery, GLdouble centerz,