home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / progut~1 / stdwin.zoo / atari / window.h < prev   
Encoding:
C/C++ Source or Header  |  1989-10-19  |  2.5 KB  |  79 lines

  1. #include <aesbind.h>
  2. #include <vdibind.h>
  3. #ifndef __GNUC__
  4. #include <gemdefs.h>
  5. #include <obdefs.h>
  6. #else
  7. #include <gemfast.h>
  8. #include <time.h>
  9. #endif
  10.  
  11. #define WINDOW    struct window
  12.  
  13. #include "stdwin.h"
  14. #include "tools.h"
  15. #include "menu.h"
  16.  
  17. #define msec    unsigned long
  18.  
  19. struct window {
  20.     int    tag ;        /* 16 bit 'tag' for the user                  */
  21.     int    handle ;    /* handle to the physical GEM window          */
  22.     char    *title ;    /* text in title bar of window                */
  23.     void    (*drawproc)() ;    /* pointer to draw procedure                  */
  24.     int    fulled ;    /* flag indicating zoomed window or not       */
  25.     TEXTATTR    attr ;    /* local text attributes of window            */
  26.     int    h, v ;        /* position of window upper left corner in scr*/
  27.     int    width ;        /* width of window                            */
  28.     int    height ;    /* height of window                           */
  29.     int    orgh, orgv ;    /* position of window upper left corner in doc*/
  30.     int    doc_width ;    /* width of document                          */
  31.     int    doc_height ;    /* height of document                         */
  32.     bool    needupdate ;    /* document needs an update                   */
  33.     int    left, top ;    /* first coordinate of changed rectangle      */
  34.     int    right, bottom ;    /* second    "      "      "       "          */
  35.     msec    alarm ;        /*
  36.                 ** alarm time in milliseconds relative to last
  37.                 ** time booted.
  38.                 */
  39.     struct menubar    mbar ;    /* local menus of window                      */
  40.     bool    careton ;    /* show or remove text caret                  */
  41.     int    caret_h ;    /* horizontal position of caret               */
  42.     int    caret_v ;    /* vertical       "    "    "                 */
  43. } ;
  44.  
  45. #define TRUE    1
  46. #define FALSE    0
  47.  
  48. #define DOCTOSCR(win,doc_h,doc_v,scr_h,scr_v) { \
  49.             scr_h = (doc_h) + (win->h - win->orgh) ; \
  50.             scr_v = (doc_v) + (win->v - win->orgv) ; \
  51. /*wdebug ("  doc win org scr|h %3d %3d %3d %3d|v %3d %3d %3d %3d", \
  52.     doc_h, win->h, win->orgh, scr_h, doc_v, win->v, win->orgv, scr_v) ; \
  53. */            }
  54. #define SCRTODOC(win,scr_h,scr_v,doc_h,doc_v) { \
  55.             doc_h = (scr_h) - (win->h - win->orgh) ; \
  56.             doc_v = (scr_v) - (win->v - win->orgv) ; \
  57. /*wdebug ("  scr win org doc|h %3d %3d %3d %3d|v %3d %3d %3d %3d", \
  58.     scr_h, win->h, win->orgh, doc_h, scr_v, win->v, win->orgv, doc_v) ; \
  59. */            }
  60.  
  61. #define BAR_HEIGHT    (wlineheight () + 2)
  62.  
  63. #define    DEF_OPT    0xfef
  64.  
  65. #define RECT    left, top, right, bottom
  66. #define LEFT    0
  67. #define TOP    1
  68. #define RIGHT    2
  69. #define BOTTOM    3
  70.  
  71. #define MSTIME()    (clock () * (1000 / CLK_TCK))
  72.  
  73. WINDOW    *getwin () ;
  74.  
  75. /*
  76. extern int    tborder ;
  77. extern int    lborder ;
  78. */
  79.