home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / graphics / a090_1 / h / edraw < prev    next >
Text File  |  1992-04-19  |  3KB  |  82 lines

  1. /**** edraw.h ****/
  2. /* Interface to 'eudlid_draw'. */
  3. /* By Paul Field
  4.  * See !ReadMe file for distribution/modification restrictions
  5.  *
  6.  * Stack checking is disabled for this module so that calls to it
  7.  * will not move flex blocks.
  8.  *
  9.  * The idea of this module is to :
  10.  *  i) provide a friendlier interface to euclid_draw
  11.  * ii) add extra functionality to euclid_draw
  12.  *
  13.  * Any suggestions are welcome.
  14.  *
  15.  */
  16.  
  17. #ifndef __edraw_h
  18. #define __edraw_h
  19.  
  20. #include "euclid.h"
  21. #include "os.h"
  22.  
  23. typedef struct edraw_splitinfostr edraw_splitinfo;
  24.  
  25. typedef struct edraw_info
  26.  { euclid_drawstyle style;     /* Do not use any timeout codes */
  27.    euclid_header    *structure;
  28.    int              xoffset;
  29.    int              yoffset;
  30.    const char       *camera;   /* NULL = no camera */
  31.    void             *vduvars;  /* NULL = current vdu vars */
  32.    unsigned int     timeout;   /* timeout in centiseconds (0 = none) */
  33.  
  34.    /* Variables filled in by draw routines */
  35.    /* You should treat these as 'read-only' - the routines */
  36.    /* will initialise and change them as is needed.        */
  37.    BOOL             timedout;   /* Initialised to FALSE */
  38.    euclid_drawinfo  *infoblock;
  39.    edraw_splitinfo  *splitinfo; /* Initialised as NULL */
  40.  }edraw_info;
  41.  
  42.  
  43. void edraw_initialise(edraw_info *info);
  44.  /* Call this to initialise a new 'info' block.
  45.   */
  46.  
  47. os_error *edraw_draw(edraw_info *info);
  48.  /* Basically the same functionality as euclid_draw except
  49.   *   i) the timeout comes from 'info->timout' rather than the style
  50.   *      (although in this call timeout of >254 will be treated as 254)
  51.   *  ii) if 'info->timedout' is TRUE the routine will assume you are continuing
  52.   *      a timedout picture
  53.   * iii) if you are not using timeouts 'info->timedout' will be set to FALSE.
  54.   *  iv) if there is an error 'info->timeout' will be set to FALSE.
  55.   *
  56.   * Basically this means that to draw a picture with timeouts you should
  57.   * keep calling 'edraw_draw' with the same info block until 'info->timeout'
  58.   * is FALSE. To stop the drawing prematurely call 'edraw_stop'.
  59.   */
  60.  
  61. void edraw_stop(edraw_info *info);
  62.  /* Call this routine only if you want to finish drawing a picture that has
  63.   * timedout. You should not call this after an error is returned from
  64.   * edraw_draw or edraw_split (these are sorted out for you).
  65.   * It will set 'info->timedout' to FALSE and throw away the 'splitinfo'
  66.   * block (if there was any).
  67.   */
  68.  
  69. os_error *edraw_split(edraw_info *info);
  70.  /* If there is not enough memory for euclid_draw to draw a picture it returns an error.
  71.   * This routine performs a euclid_draw but if it runs out of memory it splits the
  72.   * picture into smaller sections and then tries again.
  73.   * Timeouts that are greater than 254 are dealt with but euclid is a bit erratic
  74.   * in its checking of timeouts. You should set info->timeout to about half the
  75.   * time that you are repared to wait.
  76.   * As with 'edraw_draw', to draw a picture with timeouts just repeatedly call
  77.   * this routine until 'info->timeout' is FALSE. To stop the drawing prematurely
  78.   * call 'edraw_stop'.
  79.   * Currently, the graphics window may be corrupted by this call.
  80.   */
  81. #endif
  82.