appletdefs.h

Go to the documentation of this file.
00001 
00002 /*  $Id: appletdefs.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /* copyright 1991-96 UserLand Software, Inc. All Rights Reserved.*/
00005 
00006 
00007 #ifndef appletdefsinclude
00008 #define appletdefsinclude /*so other modules can tell if we've been included*/
00009 
00010 #define macintosh
00011 
00012 #undef windows
00013 
00014 #ifdef macintosh
00015     
00016     #define geneva kFontIDGeneva
00017     
00018     #ifdef MPWC
00019         
00020         #include <types.h>
00021         #include <resources.h>
00022         #include <dialogs.h>
00023         #include <menus.h>
00024         #include <fonts.h>
00025         #include <events.h>
00026         #include <controls.h>
00027         #include <segload.h>
00028         #include <memory.h>
00029         #include <toolutils.h>
00030         #include <packages.h>
00031         #include <sound.h>
00032         #include <files.h>
00033         #include <desk.h>
00034     
00035     #endif
00036     
00037     #define widthsmallicon 16 /*dimensions of a SICN resource*/
00038     #define heightsmallicon 16
00039     
00040     typedef ControlHandle hdlscrollbar;
00041     
00042     #ifdef coderesource
00043     
00044         #ifdef haveA5quickdrawglobals
00045         
00046             extern QDGlobals *a5quickdrawglobals;
00047         
00048         #else
00049             
00050             #define GetQDVarsPtr()  ((char *)*LMGetCurrentA5())
00051         
00052             #define a5quickdrawglobals ((QDGlobals *) (GetQDVarsPtr () - (sizeof (QDGlobals) - sizeof (GrafPtr))))
00053         
00054         #endif
00055         
00056         #define quickdrawglobal(x) (*a5quickdrawglobals).x
00057         
00058     #else
00059     
00060         #define quickdrawglobal(x) qd.x
00061     
00062     #endif
00063     
00064     #define sizegrowicon 15 /*it's square, this is the length of each side*/
00065      
00066     #define dragscreenmargin 4 /*for dragging windows, leave this many pixels on all sides*/
00067     
00068     #define doctitlebarheight 18 /*number of pixels in the title bar of each standard window*/
00069 
00070     #define lenbigstring 255
00071        
00072     #define OsType OSType
00073     
00074     #define bigstring Str255
00075     
00076     typedef unsigned short boolean;
00077     
00078     typedef unsigned char *ptrstring, **hdlstring;
00079     
00080     #define sysbeep SysBeep(1) 
00081     
00082     #define stringlength(bs) ((bs)[0])
00083     
00084     #define setstringlength(bs,len) (bs[0]=(char)len)
00085     
00086     #define setstringwithchar(ch,bs) {bs[0]=1;bs[1]=ch;}
00087     
00088     #define setemptystring(bs) (setstringlength(bs,0))
00089     
00090     #define isemptystring(bs) (stringlength(bs)==0)
00091     
00092     #define isemptyrect(r) EmptyRect (&r)
00093     
00094     #include <Printing.h>
00095     
00096 #endif
00097 
00098 
00099 #ifdef fldebug
00100     short __assert(char *, char *, short);
00101     #define assert(x)   ((void) ((x) ? 0 : __assert(#x, __FILE__, __LINE__)))
00102 #else
00103     #define assert(x)   ((void) 0)
00104 #endif
00105 
00106 
00107 
00108 #define true 1
00109 #define false 0
00110 
00111 #define infinity 32767
00112 #define longinfinity (long)0x7FFFFFFF
00113 #define intinfinity 32767
00114 #define intminusinfinity -32766
00115 
00116 #define emptystring (ptrstring) "\p"
00117 
00118 #define chnul           ((char) 0)
00119 #define chbacktab       ((char) 0)
00120 #define chhome          ((char) 1)
00121 #define chenter         ((char) 3)
00122 #define chend           ((char) 4)
00123 #define chhelp          ((char) 5)
00124 #define chbackspace     ((char) 8) 
00125 #define chtab           ((char) 9)
00126 #define chlinefeed      ((char) 10)
00127 #define chpageup        ((char) 11)
00128 #define chpagedown      ((char) 12)
00129 #define chreturn        ((char) 13)
00130 #define chescape        ((char) 27)
00131 #define chrightarrow    ((char) 29)
00132 #define chleftarrow     ((char) 28)
00133 #define chuparrow       ((char) 30)
00134 #define chdownarrow     ((char) 31)
00135 #define chsinglequote   ((char) 39)
00136 #define chdoublequote   ((char) 34)
00137 #define chspace         ((char) 32)
00138 #define chdelete        ((char) 127)
00139 
00140 
00141 typedef struct tydaterecord { 
00142     
00143     short day, month, year;
00144     
00145     short hour, minute, second;
00146     } tydaterecord;
00147 
00148  
00149 typedef enum tydirection { /*the possible values for a Toolkit direction parameter*/
00150     
00151     nodirection = 0, 
00152     
00153     up = 1, 
00154     
00155     down = 2, 
00156     
00157     left = 3,
00158     
00159     right = 4, 
00160     
00161     flatup = 5, 
00162     
00163     flatdown = 6, 
00164     
00165     sorted = 8,
00166     
00167     pageup = 9,
00168     
00169     pagedown = 10,
00170     
00171     pageleft = 11,
00172     
00173     pageright = 12
00174     } tydirection;
00175 
00176 
00177 #define ctdirections 12 /*the number of directions, for looping and arrays*/
00178 
00179 
00180 typedef enum tyjustification {
00181     
00182     leftjustified, 
00183     
00184     centerjustified, 
00185     
00186     rightjustified,
00187     
00188     fulljustified,
00189     
00190     unknownjustification
00191     } tyjustification;
00192     
00193     
00194 typedef enum tylinespacing {
00195     
00196     singlespaced = 1,
00197     
00198     oneandalittlespaced = 2,
00199     
00200     oneandaquarterspaced = 3,
00201     
00202     oneandahalfspaced = 4,
00203     
00204     doublespaced = 5,
00205     
00206     triplespaced = 6
00207     } tylinespacing;
00208 
00209 
00210 typedef void *ptrvoid;
00211 
00212 typedef char *ptrchar;
00213 
00214 typedef short *ptrint;
00215 
00216 typedef boolean (*callback) (void);
00217 
00218 typedef unsigned char byte, *ptrbyte;   
00219 
00220 #define mod %
00221 
00222 #define div /
00223 
00224 #define abs(x) ((x) < 0? -(x) : (x))
00225 
00226 #define odd(x) ((x) % 2)
00227 
00228 #define even(x) (!((x) % 2))
00229 
00230 #define max(x,y) ((x) > (y)? (x) : (y))
00231 
00232 #define min(x,y) ((x) < (y)? (x) : (y))
00233 
00234 #define bitboolean(fl) ((fl)?true:false)
00235 
00236 #define isnumeric(x) ((x >= '0') && (x <= '9'))
00237 
00238 #define longsizeof(x) (long)sizeof(x)
00239 
00240 #endif

Generated on Wed May 31 18:19:40 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6