home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / System Extensions / Macintosh Drag and Drop 1.1.1 / Demo Applications / DragText Sources / globals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-21  |  1.6 KB  |  89 lines  |  [TEXT/KAHL]

  1. /*
  2.  *
  3.  *        globals.h
  4.  *
  5.  *        Global variables and constants.
  6.  *        
  7.  *
  8.  *        Author:        Rob Johnston
  9.  *        Date:        Monday, January 20, 1992
  10.  *
  11.  *        Copyright © 1992 Apple Computer, Inc.
  12.  *
  13.  */
  14.  
  15.  
  16. /*
  17.  *    Window Constants.
  18.  */
  19.  
  20. #define    MaxDocumentCount        8
  21.  
  22. #define    InitialH                16
  23. #define    InitialV                42
  24.  
  25. #define    TopMargin                6
  26. #define    LeftMargin                6
  27. #define    RightMargin                6
  28. #define    BottomMargin            6
  29.  
  30. #define    ScrollResolution        12
  31.  
  32.  
  33. /*
  34.  *    File Constants.
  35.  */
  36.  
  37. #define    FileCreator                'dNet'
  38. #define    FileType                'TEXT'
  39.  
  40.  
  41. /*
  42.  *    Data Structures.
  43.  */
  44.  
  45. typedef struct Document {
  46.     WindowPtr        theWindow;
  47.     TEHandle        theTE;
  48.     short            docTop;
  49.     RgnHandle        hiliteRgn;
  50.     ControlHandle    vScroll, hScroll;
  51.     short            vScrollPos;
  52.     short            fRefNum;
  53.     short            dirty;
  54.     Handle            undoDragText;
  55.     short            undoSelStart, undoSelEnd;
  56.     short            lastSelStart, lastSelEnd;
  57. } Document;
  58.  
  59.  
  60. /*
  61.  *    Global Variables.
  62.  *
  63.  *    If the flag _AllocateGlobals_ is defined then "extern" is defined as NULL.
  64.  *    This makes the following definitions actually declare the variables,
  65.  *    otherwise, the variables are declared as extern. This scheme allows all
  66.  *    files to include this file to gain access to the program's global variables
  67.  *    and also allows the main.c file to define them.
  68.  */
  69.  
  70. #ifdef    _AllocateGlobals_
  71. #define    extern
  72. #endif
  73.  
  74.  
  75. extern    short            gQuit, gQuitting;
  76. extern    short            gDocumentCount;
  77. extern    Document        *gDocumentList[MaxDocumentCount];
  78. extern    short            gFontItem, gSizeItem;
  79. extern    short            gInBackground;
  80. extern    Document        *gFrontDocument;
  81. extern    short            gCanUndoDrag;
  82. extern    WindowPtr        gUndoFrontmost, gLastFrontmost;
  83.  
  84.  
  85. #ifdef    _AllocateGlobals_
  86. #undef    extern
  87. #endif
  88.  
  89.