home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / commodity / superdark / programmer.lha / programmer / includes / struct.h < prev    next >
C/C++ Source or Header  |  1995-01-05  |  4KB  |  121 lines

  1. /* File struct.h */
  2.  
  3. /* Various structures used in SuperDark, */
  4. /* especally to communicate with the     */
  5. /* current blanking module!         */
  6.  
  7. /* This file is included here for various reasons! */
  8. #include <graphics/displayinfo.h>
  9. #include <dos/dos.h>
  10.  
  11. #define    MAX_NOM    50    /* nombre maximum de modules*/
  12.  
  13. /* Type of screen wanted by the application  */
  14.  
  15. typedef enum{
  16.     SCR_GIVEN,    /* The module want a copy of current screen (in    */
  17.             /* appel_proc->s                */
  18.     SCR_OWN        /* The module will create his own screen (default)*/
  19. }type_screen;
  20.  
  21. /* Was used to said if we want to be run only in wb2.0...But now */
  22. /* SuperDark only run in wb2.0 or higher!             */
  23.  
  24. #define    DARK_WB_13    0x1234
  25. #define    DARK_WB_20    0x4321
  26.  
  27. typedef    struct    ModeNode
  28. {
  29.     struct    Node    mn_Node;
  30.     ULONG    DisplayID;
  31.     SHORT    MaxDepth;
  32.     SHORT    MinX,MinY;
  33.     SHORT    MaxX,MaxY;
  34.     char    Name[DISPLAYNAMELEN];
  35. };
  36.  
  37. /* Private structure used by the commodities and proc_main.o    */
  38.  
  39. struct    my_data{
  40.     struct    Task    *task;
  41.     struct    Task    *task_dark;
  42.     int        sigstop;    /* Fin de l'effet            */
  43.     int        sigstart;    /* Demarrage de l'effet blank        */
  44.     int        signext;    /* Prochain effet            */
  45.     ULONG        sigtimeout;    /* Signal de timeout */
  46.     int        flg_stop;    /* si TRUE alors il faut arreter l'effet*/
  47.     int        flg_send;    /* si TRUE alors on peut envoyer signal */
  48.     int        flg_alea;    /* TRUE -> Mode aleatoire        */
  49.     int        tempo;        /* valeur de la tempo d'attente     */
  50.     int        tempo_end;    /* valeur de la tempo d'attente de fin, en mode aleatoire */
  51.     int        debug1;
  52.     int        debug2;
  53. };
  54.  
  55. /* Note: only names of unused fields have changed since the older */
  56. /*       version of superdark, but nothing else                   */
  57.  
  58. struct    appel_proc{
  59.     struct    MsgPort    mp;
  60.     struct    RastPort *rp;    /* Pointer to s->RastPort        */
  61.                 /* (SCREEN_GIVEN) only            */
  62.     struct    RastPort *rps;    /* Pointer to the rastport of the    */
  63.                 /* current screen            */
  64.     struct    Screen    *s;    /* copy of current Screen is        */
  65.                 /* SCREEN_GIVEN mode            */
  66.     UBYTE    version;    /* Version number of SuperDark         */
  67.     UBYTE    revision;    /* revision number of SDark        */
  68.     UBYTE    proc_main_ver;    /* Version of proc main.o, set by proc_main.o */
  69.     UBYTE    fut1;        /* for future use            */
  70.  
  71.     BPTR    out_hd;        /* Handler to an output. Used by    */
  72.                 /* proc_main for debugging        */
  73.  
  74.     struct    my_data    *p_info;
  75.     struct    Window    *win;
  76.     UBYTE    flg_watchdog;    /* used by the watch dog system           */
  77.     UBYTE    enable_watchdog;/* flg to say if watchdog is ok or not    */
  78.     UBYTE    flg_test;    /* Said that the blanker is running in  */
  79.                 /* test mode                */
  80.     UBYTE    flags;        /* Some more flags            */
  81.  
  82.     type_screen    type_screen;
  83.     int    code_ret;    /* code ret                */
  84.     struct    tom_gadget    *p_gadg;
  85.  
  86.     char    *p_texte;    /* ptr to information text        */
  87.     struct    List    *ml;    /* List of available modes        */
  88.     struct    Screen    *scr;    /* last screen used in random mode    */
  89.     struct    Screen    *current_scr; /* current screen            */
  90. };
  91.  
  92. typedef    enum {DO_DARK,DO_EXIT,DO_STOP}Type_Action;
  93.  
  94. /* Structure returned by the loaded module!    */
  95. /* or send to the module            */
  96.  
  97. typedef    struct    BlankerMsg{
  98.     struct    Message    Msg;
  99.     struct    Task    *Blanker_Task;
  100.     Type_Action Action;
  101. };
  102.  
  103. #define SIG_MAIN_DARK_DO_DARK    SIGBREAKF_CTRL_D
  104. #define SIG_MAIN_DARK_STOP_DARK    SIGBREAKF_CTRL_C
  105. #define SIG_MAIN_DARK_EXIT    SIGBREAKF_CTRL_E
  106. #define SIG_MAIN_DARK_WATCHDOG    SIGBREAKF_CTRL_F
  107.  
  108. #define    SIG_DARK_MAIN_STOPPED    SIGBREAKF_CTRL_E
  109. #define    SIG_DARK_MAIN_EXITED    SIGBREAKF_CTRL_D
  110.  
  111.  
  112. #define    printd    if(flg_debug)printf
  113.  
  114. /* Name of the filename where the random files are selected */
  115. #define    NAME_FILE_ALEA    "s:dark_random.cfg"
  116.  
  117. extern    int    tst_end();
  118. extern    VOID    proc_init();
  119. extern    VOID    proc_end();
  120. extern    VOID    proc_save();
  121.