home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / Tutorial / C Guide / Time_module / includes / Project.h < prev   
Encoding:
C/C++ Source or Header  |  1998-09-20  |  3.6 KB  |  144 lines

  1.  
  2. #include <dos.h>
  3. #include <clib/alib_protos.h>
  4. #include <proto/dos.h>
  5. #include <proto/asl.h>
  6. #include <proto/exec.h>
  7. #include <proto/utility.h>
  8. #include <proto/diskfont.h>
  9. #include <proto/gadtools.h>
  10. #include <proto/graphics.h>
  11. #include <proto/intuition.h>
  12. #include <proto/datatypes.h>
  13.  
  14. /* possible later to add also an ARexx port - 
  15.    I am lazy and so I prepare this here already :-) */
  16.  
  17. #ifdef AREXX
  18. #include <proto/rexxsyslib.h> 
  19. #endif
  20.  
  21. #include <dos/exall.h>
  22. #include <dos/dostags.h>
  23. #include <exec/memory.h>
  24. #include <exec/execbase.h>
  25. #include <graphics/scale.h>
  26. #include <libraries/gadtools.h>
  27. #include <intuition/gadgetclass.h>
  28. #include <datatypes/pictureclass.h>
  29.  
  30.  
  31. /* CatComp should use numbers to address the strings */
  32.  
  33. #define  CATCOMP_NUMBERS
  34. #include "includes/buildin.strings"
  35.  
  36.  
  37. /* Yep..., we are creating a module ... */
  38.  
  39. #define  _DOPUS_MODULE_DEF
  40. #include <dopus/modules.h>
  41.  
  42.  
  43. /* We do not use any stuff from string.h or stdlib.h ...   */
  44. /* I use the replacements instead, thanks to Dirk Stoecker */
  45. /* See sdi_std.h for more info */
  46.  
  47. #define  SDI_TO_ANSI
  48. #include <sdi_std.h>
  49.  
  50. /********************************************************************/
  51.  
  52. #include "includes/Clock_IPC.h"
  53.  
  54. /********************************************************************/
  55.  
  56. #define VERSION_STRING "Time.module 1.03 © Helmut Hummel"
  57.  
  58. #define COMMAND_0      "CoolClock"
  59.  
  60. #define CMD_0_TEMPL    "LE=LeftEdge/N,TE=TopEdge/N,AD=AutostartDelay/N,Font/K,FS=Fontsize/N,FP=FrontPen/N,BP=BackPen/N,TM=TextMode/K,TS=TextStyle/K,Plain/S,T=Transparent/S,Pic=Picture/K,B=Border/K,Alarm/K,Sound/K,Quit/S"
  61.  
  62. #define CLOCKARG_COUNT 15
  63.  
  64. #define ARG_LEFT       fargs->FA_Arguments[0]
  65. #define ARG_TOP        fargs->FA_Arguments[1]
  66. #define ARG_DELAY      fargs->FA_Arguments[2]
  67. #define ARG_FONT       fargs->FA_Arguments[3]
  68. #define ARG_SIZE       fargs->FA_Arguments[4]
  69. #define ARG_APEN       fargs->FA_Arguments[5]
  70. #define ARG_BPEN       fargs->FA_Arguments[6]
  71. #define ARG_MODE       fargs->FA_Arguments[7]
  72. #define ARG_STYLE      fargs->FA_Arguments[8]
  73. #define ARG_PLAIN      fargs->FA_Arguments[9]
  74. #define ARG_TRANS      fargs->FA_Arguments[10]
  75. #define ARG_PIC        fargs->FA_Arguments[11]
  76. #define ARG_BORDER     fargs->FA_Arguments[12]
  77. #define ARG_ALARM      fargs->FA_Arguments[13]
  78. #define ARG_SOUND      fargs->FA_Arguments[14]
  79. #define ARG_QUIT       fargs->FA_Arguments[15] 
  80.  
  81. #define CLOCKCONFIG    "DOpus5:Settings/CoolClock.prefs"
  82. #define CLOCKSTARTVAR  "dopus/CoolClock"
  83. #define ALARM_SCRIPT   "DOpus5:System/CoolClock.scp"
  84.  
  85.  
  86. /* The "subtemplates" */
  87.  
  88. #define MODE_TEMPL     "JAM1/S,JAM2/S,CPL=COMPLEMENT/S,INV=INVERSVID/S"
  89. #define STYLE_TEMPL    "NORMAL/S,UL=UNDERLINE/S,BOLD/S,ITALIC/S"
  90. #define ON_OFF_TEMPL   "1/S,ON/S,TRUE/S,YES/S,0/S,OFF/S,FALSE/S,NO/S"
  91.  
  92. #define NO_CASE        1 << 4
  93.  
  94. /********************************************************************/
  95.  
  96. /* we need a structure to pass all data to the main process */
  97.  
  98. typedef struct
  99. {
  100.     struct IBox ibox;
  101.     ULONG  flags;
  102.     struct TextAttr txtattr;
  103.     char   alarm[8];
  104.     char   fontname[32];
  105.     char   picture[256];
  106. }  CPrefsData;
  107.  
  108.  
  109.  
  110. typedef struct
  111. {
  112.      ULONG           startdata;
  113.      ULONG           a4;
  114.      struct Library *library;
  115.      struct Library *module;
  116.      IPCData        *ipc;
  117.      struct Window  *win;
  118.      ObjectList     *olist;
  119.      struct Gadget  *gad;
  120.      
  121. }   StartupData;
  122.  
  123.  
  124. #define FLG_ENABLED   1 << 0
  125.  
  126.  
  127. /********************************************************************/
  128. // GLOBAL POINTERS
  129.  
  130. /* from the modinit.c */
  131.  
  132. extern APTR mempool;
  133.  
  134.  
  135. /* from the clock itself */
  136. /* since this pointer is for each process read-only, */
  137. /* it must not be protected within a semaphore       */
  138.  
  139. extern IPCData *clock_ipc;
  140.  
  141. /* we "steal" something from the GST ... */
  142. extern char *strcat( char *, char *);
  143.  
  144.