home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ucb_logoppc / source / ztcterm.h < prev   
Encoding:
C/C++ Source or Header  |  1997-01-14  |  4.2 KB  |  128 lines

  1. /*
  2.  *      ztcterm.h          IBM-specific graphics macros         mak
  3.  *
  4.  *    Copyright (C) 1993 by the Regents of the University of California
  5.  *
  6.  *      This program is free software; you can redistribute it and/or modify
  7.  *      it under the terms of the GNU General Public License as published by
  8.  *      the Free Software Foundation; either version 2 of the License, or
  9.  *      (at your option) any later version.
  10.  *  
  11.  *      This program is distributed in the hope that it will be useful,
  12.  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  *      GNU General Public License for more details.
  15.  *  
  16.  *      You should have received a copy of the GNU General Public License
  17.  *      along with this program; if not, write to the Free Software
  18.  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  *
  20.  */
  21.  
  22. #define GR_SIZE 10000
  23.  
  24. #define prepare_to_draw gr_mode()
  25. #define done_drawing nop()
  26.  
  27. #define prepare_to_draw_turtle nop()
  28. #define done_drawing_turtle nop()
  29.  
  30. #define screen_left 0
  31. #define screen_right (MaxX)
  32. #define screen_top 0
  33. #define screen_bottom (ibm_screen_bottom)
  34. #define max_screen_bottom (MaxY)
  35.  
  36. #define screen_height (1 + screen_bottom - screen_top)
  37. #define max_screen_height (1 + max_screen_bottom - screen_top)
  38. #define screen_width (1 + screen_right - screen_left)
  39.  
  40. #define screen_x_center (screen_left + (screen_width)/2)
  41. #define screen_y_center (screen_top + (max_screen_height)/2)
  42.  
  43. #define turtle_left_max ((screen_left) - (screen_x_center))
  44. #define turtle_right_max ((screen_right) - (screen_x_center))
  45. #define turtle_top_max ((screen_y_center) - (screen_top))
  46. #define turtle_bottom_max ((screen_y_center) - (screen_bottom))
  47.  
  48. #define screen_x_coord ((screen_x_center) + turtle_x)
  49. #define screen_y_coord ((screen_y_center) - turtle_y)
  50.  
  51. #define turtle_height t_height()
  52. #define turtle_half_bottom t_half_bottom()
  53. #define turtle_side t_side()
  54.  
  55. #define clear_screen erase_screen()
  56.  
  57. #define line_to(x,y) {if (current_vis==0) lineto((int)x,(int)y); else moveto((int)x,(int)y);}
  58. #define move_to(x,y) moveto((int)x,(int)y)
  59. #define draw_string(s) outtext((char *)s)
  60. #define set_pen_vis(v) current_vis = v
  61. #define set_pen_mode(m) set_ibm_pen_mode(m)
  62. #define set_pen_color(c) {ztc_set_penc(c);}
  63. #define set_back_ground(c) {ztc_set_bg(c);}
  64. #define set_pen_width(w) {ztc_penwidth = w;}
  65. #define set_pen_height(h) {ztc_penwidth = h;}
  66. #define set_pen_x(x) moveto((int)x, ztc_y)
  67. #define set_pen_y(y) moveto(ztc_x, (int)y)
  68.  
  69. /* pen_info is a stucture type with fields for the various
  70.    pen characteristics including the location, size, color,
  71.    mode (e.g. XOR or COPY), pattern, visibility (0 = visible) */
  72.  
  73. typedef struct { int    h;
  74.          int    v;
  75.          int    vis;
  76.          int    width;
  77.          int    color;
  78.          char    pattern[8];
  79.          int    mode; } pen_info;
  80.  
  81. #define p_info_x(p) p.h
  82. #define p_info_y(p) p.v
  83.  
  84. #define pen_width ztc_penwidth
  85. #define pen_height ztc_penwidth
  86. #define pen_mode get_ibm_pen_mode()
  87. #define pen_vis current_vis
  88. #define pen_x ztc_x
  89. #define pen_y ztc_y
  90. #define get_node_pen_pattern Get_node_pen_pattern()
  91. #define get_node_pen_mode Get_node_pen_mode()
  92.  
  93. #define pen_reverse ibm_pen_xor()
  94. #define pen_erase ibm_pen_erase()
  95. #define pen_down ibm_pen_down()
  96.  
  97. #define button Button()
  98. #define mouse_x mickey_x()
  99. #define mouse_y mickey_y()
  100.  
  101. #define full_screen f_screen()
  102. #define split_screen s_screen()
  103. #define text_screen t_screen()
  104.  
  105. /* definitions from term.c and math.c for ibmterm.c */
  106. extern int x_coord, y_coord, x_max, y_max, tty_charmode;
  107. extern char so_arr[], se_arr[];
  108.  
  109. /* definitions from ibmterm.c for graphics.c */
  110. extern void gr_mode();
  111. extern void ibm_pen_erase(), ibm_pen_down(), ibm_pen_xor();
  112. extern void set_ibm_pen_mode();
  113. extern int get_ibm_pen_mode();
  114. extern void save_pen(), restore_pen(), set_pen_pattern();
  115. extern void plain_xor_pen();
  116. extern void set_list_pen_pattern(), get_pen_pattern(), erase_screen();
  117. extern void label(), logofill();
  118. extern void t_screen(), s_screen(), f_screen(), tone();
  119. extern FIXNUM mickey_x(), mickey_y();
  120. extern NODE *Get_node_pen_pattern(), *Get_node_pen_mode();
  121. extern FIXNUM t_height();
  122. extern FIXNUM pen_color, back_ground;
  123. extern FLONUM t_half_bottom(), t_side();
  124. extern int current_vis, ibm_screen_bottom;
  125. extern BOOLEAN in_erase_mode;
  126. extern int ztc_penwidth;
  127. extern fg_coord_t ztc_x, ztc_y;
  128.