Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

beos/LgiOsDefs.h

00001 #ifndef __LGI_OS_DEFS_H
00002 #define __LGI_OS_DEFS_H
00003 
00004 #include <AppKit.h>
00005 #include <InterfaceKit.h>
00006 #include <GameKit.h>
00007 
00008 #include <assert.h>
00009 #include <stdlib.h>
00010 #include <stdarg.h>
00011 #include <stdio.h>
00012 
00013 #include "LgiInc.h"
00014 
00016 // Typedefs
00017 typedef signed long long int        int64;
00018 typedef unsigned long long int      uint64;
00019 
00020 typedef BWindow                     *OsWindow;
00021 typedef BView                       *OsView;
00022 typedef BBitmap                     *OsBitmap;
00023 typedef thread_id                   OsThread;
00024 typedef BMessage                    GMessage;
00025 typedef team_id                     OsProcess;
00026 typedef char                        OsChar;
00027 typedef BView                       *OsPainter;
00028 
00029 class LgiClass OsAppArguments
00030 {
00031 public:
00032     int Args;
00033     char **Arg;
00034 
00035     OsAppArguments()
00036     {
00037         Args = 0;
00038         Arg = 0;
00039     }
00040 };
00041 
00043 // Defines
00044 #define _DEBUG                  1
00045 #define XP_CTRLS                1
00046 
00047 #ifndef BEOS
00048 #error "BEOS must be defined in your project, use -DBEOS."
00049 #endif
00050 #define MAKEINTRESOURCE(i)      ((char*)(i))
00051 
00052 // assert
00053 #ifdef _DEBUG
00054 extern void _lgi_assert(bool b, char *test, char *file, int line);
00055 #define LgiAssert(b)            _lgi_assert(b, #b, __FILE__, __LINE__)
00056 #else
00057 #define LgiAssert(b)            
00058 #endif
00059 
00060 #define LgiSleep(i)             snooze(i*1000)
00061 extern void _lgi_yield();
00062 #define LgiYield()              _lgi_yield()
00063 
00064 #define K_CHAR                  0x0
00065 #define SND_ASYNC 1
00066 #define DOUBLE_CLICK_THRESHOLD  5
00067 #define LGI_FileDropFormat      "Something?"
00068 #define LGI_WideCharset         "utf-8"
00069 
00070 #define IDOK                    1
00071 #define IDCANCEL                2
00072 #define IDYES                   3
00073 #define IDNO                    4
00074 
00075 #define MB_OK                   5
00076 #define MB_OKCANCEL             6
00077 #define MB_YESNO                7
00078 #define MB_YESNOCANCEL          8
00079 
00080 #define MB_SYSTEMMODAL          0x1000
00081 
00082 #define MK_LEFT                 B_PRIMARY_MOUSE_BUTTON
00083 #define MK_RIGHT                B_SECONDARY_MOUSE_BUTTON
00084 #define MK_MIDDLE               B_TERTIARY_MOUSE_BUTTON
00085 #define MK_CTRL                 0x08
00086 #define MK_ALT                  0x10
00087 #define MK_SHIFT                0x20
00088 
00089 // Window flags
00090 #define GWF_VISIBLE             0x00000001
00091 #define GWF_ENABLED             0x00000002
00092 #define GWF_FOCUS               0x00000004
00093 #define GWF_OVER                0x00000008
00094 #define GWF_DROP_TARGET         0x00000010
00095 #define GWF_SUNKEN              0x00000020
00096 #define GWF_FLAT                0x00000040
00097 #define GWF_RAISED              0x00000080
00098 #define GWF_BORDER              0x00000100
00099 #define GWF_DIALOG              0x00000200
00100 #define GWF_DESTRUCTOR          0x00000400
00101 #define GWF_QUIT_WND            0x00000800
00102 
00103 // Edge types
00104 #define SUNKEN                  1
00105 #define RAISED                  2
00106 #define CHISEL                  3
00107 #define FLAT                    4
00108 
00109 // Widgets
00110 #define CTRL_SUNKEN             0x80000000
00111 #define CTRL_FLAT               0x40000000
00112 #define CTRL_RAISED             0x20000000
00113 
00114 // Directories
00115 #define DIR_CHAR                '/'
00116 #define DIR_STR                 "/"
00117 #define EOL_SEQUENCE            "\n"
00118 #define LGI_PATH_SEPARATOR      ":"
00119 
00120 #define IsSlash(c)              (((c)=='/')OR((c)=='\\'))
00121 #define IsQuote(c)              (((c)=='\"')OR((c)=='\''))
00122 
00123 #define LGI_ALL_FILES           "*"
00124 
00125 // Messages
00126 #define M_USER                  (0xF0000000) // how strange, this isn't defined in BeOS?? :P
00127 
00128 // wParam = bool Inside; // is the mouse inside the client area?
00129 // lParam = MAKELONG(x, y); // mouse location
00130 #define M_MOUSEENTER            (M_USER+0x100)
00131 #define M_MOUSEEXIT             (M_USER+0x101)
00132 
00133 // wParam = (GView*) Wnd;
00134 // lParam = (int) Flags;
00135 #define M_CHANGE                (M_USER+0x102)
00136 
00137 // wParam = (GView*) Wnd;
00138 // lParam = (char*) Text; // description from window
00139 #define M_DESCRIBE              (M_USER+0x103)
00140 
00141 // return (bool)
00142 #define M_WANT_DIALOG_PROC      (M_USER+0x104)
00143 
00144 #define M_MENU                  (M_USER+0x105)
00145 #define M_COMMAND               (M_USER+0x106)
00146 #define M_DRAG_DROP             (M_USER+0x107)
00147 #define M_VSCROLL               (M_USER+0x108)
00148 #define M_HSCROLL               (M_USER+0x109)
00149 #define M_PULSE                 (M_USER+0x10a)
00150 #define M_CLOSE                 (M_USER+0x10b)
00151 #define M_CUT                   B_CUT
00152 #define M_COPY                  B_COPY
00153 #define M_PASTE                 B_PASTE
00154 
00155 // Mouse msgs
00156 #define LGI_MOUSE_CLICK         (M_USER+0x10b)      // BPoint pos;
00157                                                     // int32 flags;
00158 #define LGI_MOUSE_MOVE          (M_USER+0x10c)      // BPoint pos;
00159                                                     // int32 flags;
00160 #define LGI_MOUSE_ENTER         (M_USER+0x10d)
00161 #define LGI_MOUSE_EXIT          (M_USER+0x10e)
00162 
00163 // Dialog stuff
00164 #define IDOK                    1
00165 #define IDCANCEL                2
00166 
00167 // Keys
00168 #define VK_DELETE               B_DELETE
00169 #define VK_SHIFT                B_SHIFT_KEY
00170 #define VK_ESCAPE               B_ESCAPE
00171 #define VK_RETURN               B_ENTER
00172 #define VK_BACK                 B_BACKSPACE
00173 #define VK_RIGHT                B_RIGHT_ARROW
00174 #define VK_LEFT                 B_LEFT_ARROW
00175 #define VK_UP                   B_UP_ARROW
00176 #define VK_DOWN                 B_DOWN_ARROW
00177 #define VK_PRIOR                B_PAGE_UP
00178 #define VK_NEXT                 B_PAGE_DOWN
00179 #define VK_HOME                 B_HOME
00180 #define VK_END                  B_END
00181 #define VK_INSERT               B_INSERT
00182 
00183 // GKey flags
00184 #define LGI_VKEY_CTRL           B_CONTROL_KEY   // 0x0004
00185 #define LGI_VKEY_ALT            B_OPTION_KEY    // 0x0040
00186 #define LGI_VKEY_SHIFT          B_SHIFT_KEY     // 0x0001
00187 
00188 // GMouse flags
00189 #define LGI_VMOUSE_LEFT         B_PRIMARY_MOUSE_BUTTON      // 0x0001
00190 #define LGI_VMOUSE_MIDDLE       B_TERTIARY_MOUSE_BUTTON     // 0x0004
00191 #define LGI_VMOUSE_RIGHT        B_SECONDARY_MOUSE_BUTTON    // 0x0002
00192 
00193 #define LGI_VMOUSE_CTRL         0x08
00194 #define LGI_VMOUSE_ALT          0x10
00195 #define LGI_VMOUSE_SHIFT        0x20
00196 
00197 #define LGI_VMOUSE_DOWN         0x40
00198 #define LGI_VMOUSE_DOUBLE       0x80
00199 
00200 // The BeOS defines actually overlap some other keys
00201 // so I don't use them, instead I just defined my own block
00202 // of codes
00203 #define VK_F1                   0x11
00204 #define VK_F2                   0x12
00205 #define VK_F3                   0x13
00206 #define VK_F4                   0x14
00207 #define VK_F5                   0x15
00208 #define VK_F6                   0x16
00209 #define VK_F7                   0x17
00210 #define VK_F8                   0x18
00211 #define VK_F9                   0x19
00212 #define VK_F10                  0x01
00213 #define VK_F11                  0x02
00214 #define VK_F12                  0x03
00215 
00217 #define MsgCode(m) m->what
00218 extern int MsgA(GMessage *m);
00219 extern int MsgB(GMessage *m);
00220 extern GMessage CreateMsg(int m, int a, int b);
00221 
00223 // BeOS specific
00224 #define LGI_DRAW_VIEW_FLAGS     (B_POINTER_EVENTS | B_WILL_DRAW | B_NAVIGABLE | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE)
00225 #define LGI_NODRAW_VIEW_FLAGS   (B_POINTER_EVENTS | B_NAVIGABLE | B_FRAME_EVENTS)
00226 
00227 extern int stricmp(char *a, char *b);
00228 
00229 #endif

Generated on Wed Oct 26 14:46:50 2005 for Lgi by  doxygen 1.4.1