home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / IRIT / DRAWFN3S.ZIP / GRAPHGNG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-06  |  3.6 KB  |  113 lines

  1. /*************************************************************************
  2. * Global definitions of    GraphGen.c for all the world...             *
  3. *************************************************************************/
  4.  
  5. #ifndef    GRAPH_GEN_H    /* Define only once */
  6. #define    GRAPH_GEN_H
  7.  
  8. #ifndef __MSDOS__
  9. #define FULL_LINE_STYLE        1
  10. #define DOTTED_LINE_STYLE    2
  11. #endif /* __MSDOS__ */
  12.  
  13. /* The following conditional compilation flags are also in GraphGen.c!       */
  14. /* #define NOGRAPHICS      /* If no graphics to perform (only routine calls). */
  15. /* #define NOWINDOWS           /* If no windows routines to be included. */
  16. /* #define NOMENUS             /* If no menus routines to be included. */
  17. /* #define NOHELP        /* If no print help routines to be included. */
  18. /* #define DEBUG           /* Print graphics driver info and dies... */
  19. #define SINGLEPAGE          /* If more than one pages should be supported. */
  20.  
  21. #define    MENU_MAX_ITEMS 14         /* Maximum number of items in menu. */
  22. #define    MENU_MAX_LEN   20          /* Maximum length of string entry. */
  23.  
  24. typedef struct MenuItem    {
  25.    int color;
  26.    char    string[MENU_MAX_LEN];
  27. } MenuItem;
  28.  
  29. extern    int    GGGraphMode;             /* The Graphics mode value. */
  30. extern    double GGAspectRatio;       /* Aspect ratio of a pixel in the screen. */
  31. extern    int    GGScreenMaxX, GGScreenMaxY;/* The maximum res. of the screen. */
  32. extern    int    GGScreenMaxColors;      /* The maximum # of colors available. */
  33. extern    int    GGScreenMaxPages;    /* The maximum # of pages available. */
  34. extern    int    GGScreenErrorCode;         /* Reports any graphics errors. */
  35. extern    struct palettetype palette;           /* Used to read palette info. */
  36. extern    int    GGCurrentCursorX, GGCurrentCursorY;/* Cursor current position.*/
  37. extern    int    GGScreenGraphicMode;     /* TRUE if current mode is graphic. */
  38.  
  39. #ifndef    TRUE
  40. #define    TRUE    -1
  41. #define    FALSE    0
  42. #endif
  43.  
  44. #define    MSG_AREA_X      1.25            /* General notes goes to here... */
  45. #define    MSG_AREA_Y     -0.9
  46. #define    MSG_AREA_WIDTH  0.7
  47.  
  48. #define MAX_HELP_MENU_CHAR 20          /* Maximum of chars per help line. */
  49.  
  50. #define MENU_FRAME_COLOR    RED
  51. #define HELP_COLOR        CYAN
  52. #define HELP_COLOR_HEADER    YELLOW
  53.  
  54. #ifndef    NOWINDOWS
  55.  
  56. #define SW_MIN_X    1.2                   /* The STATUS window. */
  57. #define SW_MAX_X    2.0
  58. #define SW_MIN_Y    -0.97
  59. #define    SW_MAX_Y    0.97
  60. #define SW_FRAME_COLOR    LIGHTRED
  61. #define SW_LINE_COLOR    MAGENTA
  62.  
  63.  
  64. #define VW_MIN_X    -0.97                 /* The VIEW window. */
  65. #define VW_MAX_X    1.1
  66. #define VW_MIN_Y    -0.97
  67. #define    VW_MAX_Y    0.97
  68. #define VW_FRAME_COLOR    LIGHTGREEN
  69. #define VW_LINE_COLOR    GREEN
  70.  
  71. #endif    NOWINDOWS
  72.  
  73. /* And finally the external routine prototypes: */
  74.  
  75. void GGMyMove(double x, double y);
  76. void GGMyDraw(double x, double y);
  77. void GGMySetColor(int color);
  78. #ifdef __MSDOS__
  79. void GGInitGraph(void);
  80. #else
  81. void GGInitGraph(int argc, char **argv);
  82. void GGMySetLineStyle(int Style);
  83. #endif /* __MSDOS__ */
  84. void GGCloseGraph(void);
  85. void GGGetPoint(double *x, double *y);
  86. void GGDrawPoint(double p[], char title[], int PointColor);
  87.  
  88. #ifndef NOMENUS
  89. int GGMenuDraw(int n, struct MenuItem m[], int erase);
  90. int GGMenuPick(void);
  91. int GGConfirm(char *s);
  92. #endif    NOMENUS
  93.  
  94. #ifndef NOHELP
  95. void GGPrintHelpMenu(char *FileName, char *MenuName);
  96. #endif    NOHELP
  97.  
  98. void GGClearMenuArea(void);
  99. void GGClearViewArea(void);
  100. void GGClearAllScreen(void);
  101. void GGViewPortMenuArea(void);
  102. void GGViewPortViewArea(void);
  103. void GGViewPortAllScreen(void);
  104. void GGPutErrorMsg(char *s);
  105. void GGPutMsgXY(char *s, double x, double y);
  106. void GGGetGraphicLine(double x, double y, char s[], int color);
  107. void GGTone(int Frequency, int Duration);
  108.  
  109. #define GGXYPutStr(x, y, s) GGPutMsgXY(s, x, y)/* Same duty - different name.*/
  110.  
  111. #endif    GRAPH_GEN_H
  112.  
  113.