home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume17 / mgr / part33 < prev    next >
Text File  |  1989-01-19  |  46KB  |  1,174 lines

  1. Subject:  v17i034:  MGR, Bellcore window manager, Part33/61
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4.  
  5. Submitted-by: Stephen A. Uhler <sau@bellcore.com>
  6. Posting-number: Volume 17, Issue 34
  7. Archive-name: mgr/part33
  8.  
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 33 (of 61)."
  19. # Contents:  font-16/Uoldeng22x30rI font-32/Uoldeng22x30rI src/cut.c
  20. #   src/win_stack.c
  21. # Wrapped by rsalz@papaya.bbn.com on Thu Nov 17 21:05:41 1988
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'font-16/Uoldeng22x30rI' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'font-16/Uoldeng22x30rI'\"
  25. else
  26. echo shar: Extracting \"'font-16/Uoldeng22x30rI'\" \(10460 characters\)
  27. sed "s/^X//" >'font-16/Uoldeng22x30rI' <<'END_OF_FILE'
  28. Xbegin 644 oldeng22x30rI.fnt
  29. XM%A8>"%L@   #______________________?_________________________
  30. XM____________________________________________________________
  31. XM__________PO_'/S__N_8 /_',.^.=W_^[_'(?^;__\<S_'(?\<A__^[?A_N
  32. XM_]Y_PW/__>?\-Q__ __@?O\[G_W<__/Y\_G]WQW/^___________________
  33. XM___?______[______________\______]__________]___W____________
  34. XM_________________________________________\     #____________
  35. XM_________^/_________________________________________________
  36. XM______________________________________________@'^ ?!_W0_  '^
  37. XM 8 \ X'_=#^ 0-]-__X!G^ 0/X! W_\:+ _ _QP_@4%_\</X5(_^ /_  /X:
  38. XM"_C07^&@@?#\'@V%^/_O__________________^_______S______W______
  39. XM_P?_____K__________K___O____________________________________
  40. XM_________________\     #_____________________\'_____________
  41. XM______________________________________]_____________________
  42. XM______________________ 3^ \Q_N _  #^ P \!P'^X#^ F#Y&__X#'^ N
  43. XM&X"8/_R)& ^ _#H? 3C_PZ'P$\?]^'>  /^)Q_!./_B8..QX/ U#^  /____
  44. XM______________]?______C______[_______,/_____C__________C__^/
  45. XM____________________________]_______?__]_____________\     #
  46. XM_____________________^'________________________________\__\W
  47. XM__^?__Y___Q__P!__WW_^_/__/__\_____________________________?#
  48. XM^YSQ_-A_FOA^YOQ]SF/\V'^Y'G_$__[G'^Y?![D>?_F#&\=A^(</<'C_B'#W
  49. XM!\?[_ ^X ?^+Q_P>/_@XN/QX?8SC_  ?__________________\/______C_
  50. XM_____Y______^./_____C__________C__^/________________________
  51. XM____[______^___[_____________\     #______________________7_
  52. XM_______________________________X+_X/__\%__P7__Q__P!__@'_\ ?_
  53. XM^"__X+____________________________^C_\GQ^9W_\OQ_^?__]'?YGO_^
  54. XM'O_B___]'_^?C_X>_^6+'\?W\Q>/\7C_,7C_%\?[_Q_[]_^+Q_Q>/_BXN/XW
  55. XM_XWC_P ___________________\'______C______P______^/______C___
  56. XM_______C__^/____________________________C______\___S________
  57. XM_____\     #______________________O_________________________
  58. XM______^$'_T?__"#_\(/__C__@#_^ /_X ?_A!_^$'__________________
  59. XM__________BQ_S'Q\QW_XOQ_Y?__S'?S'?_Y'__B___S'_Y?W_D>_\6+'\/W
  60. XM\Q?'\7C_,7Q_%\?Y_[_W=_^+Q_Q>/_BXN/XW_XWC__]_________________
  61. XM__^/______C______X?_____^/______C__________C__^/____________
  62. XM________________C______Y___G_____________\     #____________
  63. XM__________?_______________________________^/'_\?__'C_\>/__C_
  64. XM_O__^(?__ __CQ_^/'____________________________!Q_C'Q\QW_XOQ_
  65. XMQ?__C'?S&__Q'__B___C'_Q?__$>_\6+'\/WXQ?'\7C^,7Q_%\?P/__F=_^+
  66. XMQ_Q>/_BXN/\/_XWC__]____________________?______C______\/_____
  67. XM^/______C___O__^___C__^/____________________________C______Y
  68. XM___G_____________\     #____________________________________
  69. XM__________________^/'_\?__'C_\>/__G__O__^/___]__CQ_^/'______
  70. XM______________________!X_C%SYQW_XGA_Q?__C'?G%__Q%W_B___C'_Q>
  71. XM/_$>_\6+']'WYQ?C\7C^<7X_%\?D!\?,=_^+Q_Q>/_BXN/\/_XWC__[_____
  72. XM______________________C______^'_____^/______C___'__\?__C__^/
  73. XM____________________________C______Q___'_____________\     #
  74. XM______________________________________________________^/'_\?
  75. XM__'C_\>/__'__O__^/___]__CQ_^/'_]___W______________________]X
  76. XM_#%GYQW_PH1_A8__# ?G#__A%#_"___#'_A9'^$>_X0('Y'WQQ?CX0#\<7X^
  77. XM%X_F "/,=_\(!_A /_BXN/P!_PP#__W___________________________C_
  78. XM______#_____^/______C___O__^___C__^/________________________
  79. XM____C______Q___'_____________\     #________________________
  80. XM______________________________^/'_\?__/C_\^/__+__O__^/___[__
  81. XMCQ_^/'_X___C______________________[X^#$3QQW_@OQ_!07^# ?' ?_!
  82. XM$C^"__^#'_!''\$>_P0('QCWQQ?CP7C\<7X\%C_CP#><=_X+Q_!>/_" @/P!
  83. XM_@WC__O___________________________C_______A?____^!______C___
  84. XM_______C__^/____________________________@?_____Q___'________
  85. XM_____\     #________________________________________________
  86. XM______^/'_\?___C__^/_^3__''_^/___W__CQ_^/'_P?__!____________
  87. XM__________X >#!QQQW_@OQ_! /^# ?'%G_!!C^"__^#'_!?C\$>_P0('Q@'
  88. XMQQ #P7C\<0 \$!_P^!^<=_X+Q_!>/^"XN/P!_@WC_X#_________________
  89. XM______[/__B?__Y___0__^?_^!___S__C/__-__\W__CO_^/__]]]_WW__]_
  90. XM_^[___?__-O__GO_@?__??_X]__CWW_'M_\TW_P??\     #____________
  91. XM__________________________________________^/'_\?___#__\?_^C_
  92. XM_ "_^/?__W__@!_^.'_X___C______________________P >#%QQQW_@H1_
  93. XM!??^# ?'%S_!%C^"__^#'_!?C\$>_P0('P!WQQ?CP7C\<7X\ Q_X&P\<=_X(
  94. XM!_! /^"XN/^'_@WC_X#_______________________P"__@%__P/_XX__X/_
  95. XM^#___-O_B%_^#__X/__B'_^/__XPP?C!__P__\!__\/_^ /_^ ?_@__^./_X
  96. XM0O_A#"^#!_X(/_@ _\     #____________________________________
  97. XM__________________^/'_\?__\#__X__]C__&!_^(+__G__P#_]!'_]___W
  98. XM______________________P /C%QQQW_XGA_Q??_C'?'$#_Q$#_B___C'_Q?
  99. XMG_$>_\6+']QWQQ?C\0#\<7X_!Q_\ \\<=_^+Q_Q>/^" @/]C_XWC_X#_____
  100. XM__________________Y!__B#_^ /_XX__#/_^/__X\/_AC_]'__\?__AC_^/
  101. XM__P((_ C_^,7_X8O_C%_]$/_X@__C__^,'_\,?_PPQ^P#_T<?_8!_\     #
  102. XM____________________________________________!_________^/'_\?
  103. XM__X#__\7_[C__?A_^''__/__@!__O'____________________________W^
  104. XM/C$!QQW_XOQ_Q??_C'?'%Q_Q%C_B___C'_Q>/_$>_\6+']XWQQ #\7C\<0 _
  105. XM%X__ $\<=_^+Q_Q>/_BXN/]C_XP#_]________________________]Q__CC
  106. XM_^&?_XX__C'_^/__X\?_CC__'__\?__CS_^/__XXX_CC_^./_\<?_CC__&?_
  107. XMXY__C__^./_\<?_QQQ_QG_\<?__S_\     #________________________
  108. XM___________________^#_________^/'_\?__S___^/_P ?__Q_^/'__/__
  109. XMCQ___'____________________________O^/C%QQQW_XOQ_Q??_C'?'%Q_Q
  110. XM$#_B___C'_Q8/_$>_\6+']XWYQ?G\7C^<7Y_%X__X \<=_^+Q_Q>/_BXN/[Q
  111. XM_XWC_]________________________\Q__CC_^/__XX__CC_^/__X\?_CC__
  112. XM'__\?__CG_^/__XXX_CC_^./_\<?_CC__'__X[__C__^./_\<?_QQQ_X__\<
  113. XM?__/_\     #___________________________________________\'___
  114. XM______^/'_\?__W___^/__C___Q_^/'_^/__CQ___'__________________
  115. XM__________O_'G$!XSV_XOQ_Q??_C'?G,#_Q%C_B___C'_Q''_$^_\6+']\7
  116. XMXS?G\7C^,WY_%X__[ ^,]O^+Q_Q>/_BXN/[Q_XWC_[__________________
  117. XM______Y1__CC_^/__XX__CG_^/__X\?_CC__'__\?__B'_^/__XXX_CC_^./
  118. XM_\<?_CC__'__X!__C__^./_\<?_QQQ_X__\<?_^__\     #____________
  119. XM__________________________________________^/'_\?__O___^/__C_
  120. XM__Q_^/'_^?__CQ___'____________________________?_'N-QXWV_YOQ_
  121. XMS??_G'?C=S_S-C_B___G'_S?'_-^_\6+']\7\_?/\7C_/WS_%\?_[D^-]O^+
  122. XMQ_Q>/_BXN/WX_XWC_W________________________QQ__CC_^/__XX__B?_
  123. XM^/__X\?_CC__'__\?__A'_^/__XXX_CC_^./_\<?_CC__'__^ ?_C__^./_\
  124. XM<?_QQQ_\?_\<?_P/_\     #____________________________________
  125. XM____W______]______^/'_\?__O___^/__C___Q_^/'_\?__CQ___'_]___W
  126. XM_____________________^/OC\]Q\/T_Z/Q_P/?_G'?S]G_Q=G_F__^/'_P>
  127. XMC_ ^_\6+'X^'\_?/\7C_/WS_#\?_WL_#]/^#Q_Q>/_@XN/CX_XWC_O______
  128. XM__________________QQ__CC_^/__XX__A__^/__X\?_CC__'__\?__C'_^/
  129. XM__XXX_CC_^./_\<?_CC__'___<?_C__^./_\<?_QQQ_\?_\<?_[__\     #
  130. XM________________________________________C______X______^/'_\?
  131. XM__L'__"/__C__P1_^/'_\/__CQ__A'_X___C_____________________X#?
  132. XMCP-Q\O!_X#Q_@!=^!'?S]'_@<G\N__X''_@-C^ &WPV+'D.'^/<?P7C_CW'^
  133. XM T?X ]_+P?^ Q_Q^/_@8N. T;XWC_@?[______________________QQ__CC
  134. XM_^/__XX__C__^/__X\?_CC__'__\?__CB_^/__XXX_CC_^./_\<?_CC__'__
  135. XM^<?_C__^./_\<?_QQQ_&/_\<?_[__\     #________________________
  136. XM________________!______P?_____^"'_\7__8"_^ /__B__@!_^"'_\)__
  137. XM@A__ '_P?__!_____________________P _C@!Q^ #_P A_  #\ '?X\/_ 
  138. XM!OX.__P#/_ #Q<  /@V+'0#'_#0_@1#_PD/\ .+P #_@ _\ !?P /_ ( , ,
  139. XM7XWC_  '______________________X@__1C_]'?_T8__@[_]&__X,?_!C__
  140. XM'__\?__1A_]%__P08?!A_]&/_X,?_1C__&__\$?_1?_^,'_\<?_QQQ^ -_\<
  141. XM?_P#?\     #________________________________________A______X
  142. XM______]!__X/__ !_\ ___!__ '_]!__^'__0?_^ ?_X___A____________
  143. XM_________AQ_S#@/_ '_AP/^'P'X8/?\<_^&#OP!__AA?^''PX? ? -'B#C'
  144. XM_Q#_@0__\8_X<>'F '_P!_X<(_X?_^&$/X<>/W '^  /________________
  145. XM______\9__X?__@__^'__P'__A__P ?_CG__C__^/__XC__C__XXX_CC__A_
  146. XM_P#__X#_^A__X!__X__\"/_Z#__H"/\!#_\ ?_@ _\     #____________
  147. XM____________________________U______]_______S__^?__'[_]]___S_
  148. XM_/O__S___?__\__^^__]___U_____________________/[_Z?X__PW_/\?\
  149. XM_^/S^??_#_\_G?W#__/X_\_OYS_X_<?OT?WG_\/_L3___!_S^_//8/_\-_S_
  150. XM=_^__\_N_S^_?GX/\_@?______________________^[__]___S___?__\?_
  151. XM_W___,O_WO__W___/__]W__W__]]]_WW__W__T/__]C__S___G__]___/?__
  152. XM/__\<_]SG_^?___!_\     #____________________________________
  153. XM____[______________________________________________________[
  154. XM_____________________/__^?____W_/__\___S__?___\__?W___/__\__
  155. XM_S___?__\?______\7___]_S___??___]_S______\___S___G__________
  156. XM_________________________________________^/__O______'_______
  157. XM_____________\?___C___________________________]______\     #
  158. XM________________________________________W___________________
  159. XM___________________________________W_____________________?__
  160. XM^_____W_?__]___W__?___]__OY___?__]___W___?__\_______\7___]_W
  161. XM___>____]_W______]___W___G__________________________________
  162. XM_________________^/__W______'____________________\?___C_____
  163. XM______________________]X_____\     #________________________
  164. XM____________________________________________________________
  165. XM_________________________________?__^_____W_?__]___W__?___]_
  166. XM_G^?__?__]___W___O__]_______\7___\_W___N____]_W______]___W__
  167. XM_GX/__________________________________________________/__S__
  168. XM____G____________________\?___C___________________________]P
  169. XM?____\     #________________________________________________
  170. XM____________________________________________________________
  171. XM_________?__^_____W_?__]___W__?___]__C____?__]___W___O__]___
  172. XM____\7___\]W___Q____]_W______]___W___P '____________________
  173. XM____________________________Y_/__Q______G___________________
  174. XM_\?___C___________________________\ ?____\     #____________
  175. XM____________________________________________________________
  176. XM_____________________________________________?__^_____W_?__]
  177. XM_]_W__?___]__C____?__]___W_W_S__]_______\7___\=W________]_W_
  178. XM_____]___W___P #____________________________________________
  179. XM____R>?__Q_____X/____________________\?___A_________________
  180. XM__________\'?____\     #____________________________________
  181. XM____________________________________________________________
  182. XM_____________________O___?____G_O__^_S_[_^?___^__#____O__^__
  183. XM_[_/_\?_^_______\?___^#[________Y_[______^___[___X'[________
  184. XM________________________________________TH___A_____P?_______
  185. XM_____________\____C___________________________^/?____\     #
  186. XM____________________________________________________________
  187. XM_________________________________________________________S__
  188. XM_F____'_S___//_\_\?____/_'____S___/__\\______/______\O____#\
  189. XM________Q_\_______/__\_____[________________________________
  190. XM_________________1___C_____P_____________________]____G_____
  191. XM________________________?____\     #________________________
  192. XM____________________________________________________________
  193. XM_________________________________\___Y____O_\___P___/^_____S
  194. XM_/____\___S___#______S______]_____G_/_______[__/______S___/_
  195. XM_____________________________________________________G___G__
  196. XM___V_____________________[____O____________________________\
  197. X&_____\  
  198. Xend
  199. END_OF_FILE
  200. # end of 'font-16/Uoldeng22x30rI'
  201. fi
  202. if test -f 'font-32/Uoldeng22x30rI' -a "${1}" != "-c" ; then 
  203.   echo shar: Will not clobber existing file \"'font-32/Uoldeng22x30rI'\"
  204. else
  205. echo shar: Extracting \"'font-32/Uoldeng22x30rI'\" \(10460 characters\)
  206. sed "s/^X//" >'font-32/Uoldeng22x30rI' <<'END_OF_FILE'
  207. Xbegin 644 oldeng22x30rI.fnt
  208. XM&!8>"%L@   #______________________?_________________________
  209. XM____________________________________________________________
  210. XM__________PO_'/S__N_8 /_',.^.=W_^[_'(?^;__\<S_'(?\<A__^[?A_N
  211. XM_]Y_PW/__>?\-Q__ __@?O\[G_W<__/Y\_G]WQW/^___________________
  212. XM___?______[______________\______]__________]___W____________
  213. XM_________________________________________\     #____________
  214. XM_________^/_________________________________________________
  215. XM______________________________________________@'^ ?!_W0_  '^
  216. XM 8 \ X'_=#^ 0-]-__X!G^ 0/X! W_\:+ _ _QP_@4%_\</X5(_^ /_  /X:
  217. XM"_C07^&@@?#\'@V%^/_O__________________^_______S______W______
  218. XM_P?_____K__________K___O____________________________________
  219. XM_________________\     #_____________________\'_____________
  220. XM______________________________________]_____________________
  221. XM______________________ 3^ \Q_N _  #^ P \!P'^X#^ F#Y&__X#'^ N
  222. XM&X"8/_R)& ^ _#H? 3C_PZ'P$\?]^'>  /^)Q_!./_B8..QX/ U#^  /____
  223. XM______________]?______C______[_______,/_____C__________C__^/
  224. XM____________________________]_______?__]_____________\     #
  225. XM_____________________^'________________________________\__\W
  226. XM__^?__Y___Q__P!__WW_^_/__/__\_____________________________?#
  227. XM^YSQ_-A_FOA^YOQ]SF/\V'^Y'G_$__[G'^Y?![D>?_F#&\=A^(</<'C_B'#W
  228. XM!\?[_ ^X ?^+Q_P>/_@XN/QX?8SC_  ?__________________\/______C_
  229. XM_____Y______^./_____C__________C__^/________________________
  230. XM____[______^___[_____________\     #______________________7_
  231. XM_______________________________X+_X/__\%__P7__Q__P!__@'_\ ?_
  232. XM^"__X+____________________________^C_\GQ^9W_\OQ_^?__]'?YGO_^
  233. XM'O_B___]'_^?C_X>_^6+'\?W\Q>/\7C_,7C_%\?[_Q_[]_^+Q_Q>/_BXN/XW
  234. XM_XWC_P ___________________\'______C______P______^/______C___
  235. XM_______C__^/____________________________C______\___S________
  236. XM_____\     #______________________O_________________________
  237. XM______^$'_T?__"#_\(/__C__@#_^ /_X ?_A!_^$'__________________
  238. XM__________BQ_S'Q\QW_XOQ_Y?__S'?S'?_Y'__B___S'_Y?W_D>_\6+'\/W
  239. XM\Q?'\7C_,7Q_%\?Y_[_W=_^+Q_Q>/_BXN/XW_XWC__]_________________
  240. XM__^/______C______X?_____^/______C__________C__^/____________
  241. XM________________C______Y___G_____________\     #____________
  242. XM__________?_______________________________^/'_\?__'C_\>/__C_
  243. XM_O__^(?__ __CQ_^/'____________________________!Q_C'Q\QW_XOQ_
  244. XMQ?__C'?S&__Q'__B___C'_Q?__$>_\6+'\/WXQ?'\7C^,7Q_%\?P/__F=_^+
  245. XMQ_Q>/_BXN/\/_XWC__]____________________?______C______\/_____
  246. XM^/______C___O__^___C__^/____________________________C______Y
  247. XM___G_____________\     #____________________________________
  248. XM__________________^/'_\?__'C_\>/__G__O__^/___]__CQ_^/'______
  249. XM______________________!X_C%SYQW_XGA_Q?__C'?G%__Q%W_B___C'_Q>
  250. XM/_$>_\6+']'WYQ?C\7C^<7X_%\?D!\?,=_^+Q_Q>/_BXN/\/_XWC__[_____
  251. XM______________________C______^'_____^/______C___'__\?__C__^/
  252. XM____________________________C______Q___'_____________\     #
  253. XM______________________________________________________^/'_\?
  254. XM__'C_\>/__'__O__^/___]__CQ_^/'_]___W______________________]X
  255. XM_#%GYQW_PH1_A8__# ?G#__A%#_"___#'_A9'^$>_X0('Y'WQQ?CX0#\<7X^
  256. XM%X_F "/,=_\(!_A /_BXN/P!_PP#__W___________________________C_
  257. XM______#_____^/______C___O__^___C__^/________________________
  258. XM____C______Q___'_____________\     #________________________
  259. XM______________________________^/'_\?__/C_\^/__+__O__^/___[__
  260. XMCQ_^/'_X___C______________________[X^#$3QQW_@OQ_!07^# ?' ?_!
  261. XM$C^"__^#'_!''\$>_P0('QCWQQ?CP7C\<7X\%C_CP#><=_X+Q_!>/_" @/P!
  262. XM_@WC__O___________________________C_______A?____^!______C___
  263. XM_______C__^/____________________________@?_____Q___'________
  264. XM_____\     #________________________________________________
  265. XM______^/'_\?___C__^/_^3__''_^/___W__CQ_^/'_P?__!____________
  266. XM__________X >#!QQQW_@OQ_! /^# ?'%G_!!C^"__^#'_!?C\$>_P0('Q@'
  267. XMQQ #P7C\<0 \$!_P^!^<=_X+Q_!>/^"XN/P!_@WC_X#_________________
  268. XM______[/__B?__Y___0__^?_^!___S__C/__-__\W__CO_^/__]]]_WW__]_
  269. XM_^[___?__-O__GO_@?__??_X]__CWW_'M_\TW_P??\     #____________
  270. XM__________________________________________^/'_\?___#__\?_^C_
  271. XM_ "_^/?__W__@!_^.'_X___C______________________P >#%QQQW_@H1_
  272. XM!??^# ?'%S_!%C^"__^#'_!?C\$>_P0('P!WQQ?CP7C\<7X\ Q_X&P\<=_X(
  273. XM!_! /^"XN/^'_@WC_X#_______________________P"__@%__P/_XX__X/_
  274. XM^#___-O_B%_^#__X/__B'_^/__XPP?C!__P__\!__\/_^ /_^ ?_@__^./_X
  275. XM0O_A#"^#!_X(/_@ _\     #____________________________________
  276. XM__________________^/'_\?__\#__X__]C__&!_^(+__G__P#_]!'_]___W
  277. XM______________________P /C%QQQW_XGA_Q??_C'?'$#_Q$#_B___C'_Q?
  278. XMG_$>_\6+']QWQQ?C\0#\<7X_!Q_\ \\<=_^+Q_Q>/^" @/]C_XWC_X#_____
  279. XM__________________Y!__B#_^ /_XX__#/_^/__X\/_AC_]'__\?__AC_^/
  280. XM__P((_ C_^,7_X8O_C%_]$/_X@__C__^,'_\,?_PPQ^P#_T<?_8!_\     #
  281. XM____________________________________________!_________^/'_\?
  282. XM__X#__\7_[C__?A_^''__/__@!__O'____________________________W^
  283. XM/C$!QQW_XOQ_Q??_C'?'%Q_Q%C_B___C'_Q>/_$>_\6+']XWQQ #\7C\<0 _
  284. XM%X__ $\<=_^+Q_Q>/_BXN/]C_XP#_]________________________]Q__CC
  285. XM_^&?_XX__C'_^/__X\?_CC__'__\?__CS_^/__XXX_CC_^./_\<?_CC__&?_
  286. XMXY__C__^./_\<?_QQQ_QG_\<?__S_\     #________________________
  287. XM___________________^#_________^/'_\?__S___^/_P ?__Q_^/'__/__
  288. XMCQ___'____________________________O^/C%QQQW_XOQ_Q??_C'?'%Q_Q
  289. XM$#_B___C'_Q8/_$>_\6+']XWYQ?G\7C^<7Y_%X__X \<=_^+Q_Q>/_BXN/[Q
  290. XM_XWC_]________________________\Q__CC_^/__XX__CC_^/__X\?_CC__
  291. XM'__\?__CG_^/__XXX_CC_^./_\<?_CC__'__X[__C__^./_\<?_QQQ_X__\<
  292. XM?__/_\     #___________________________________________\'___
  293. XM______^/'_\?__W___^/__C___Q_^/'_^/__CQ___'__________________
  294. XM__________O_'G$!XSV_XOQ_Q??_C'?G,#_Q%C_B___C'_Q''_$^_\6+']\7
  295. XMXS?G\7C^,WY_%X__[ ^,]O^+Q_Q>/_BXN/[Q_XWC_[__________________
  296. XM______Y1__CC_^/__XX__CG_^/__X\?_CC__'__\?__B'_^/__XXX_CC_^./
  297. XM_\<?_CC__'__X!__C__^./_\<?_QQQ_X__\<?_^__\     #____________
  298. XM__________________________________________^/'_\?__O___^/__C_
  299. XM__Q_^/'_^?__CQ___'____________________________?_'N-QXWV_YOQ_
  300. XMS??_G'?C=S_S-C_B___G'_S?'_-^_\6+']\7\_?/\7C_/WS_%\?_[D^-]O^+
  301. XMQ_Q>/_BXN/WX_XWC_W________________________QQ__CC_^/__XX__B?_
  302. XM^/__X\?_CC__'__\?__A'_^/__XXX_CC_^./_\<?_CC__'__^ ?_C__^./_\
  303. XM<?_QQQ_\?_\<?_P/_\     #____________________________________
  304. XM____W______]______^/'_\?__O___^/__C___Q_^/'_\?__CQ___'_]___W
  305. XM_____________________^/OC\]Q\/T_Z/Q_P/?_G'?S]G_Q=G_F__^/'_P>
  306. XMC_ ^_\6+'X^'\_?/\7C_/WS_#\?_WL_#]/^#Q_Q>/_@XN/CX_XWC_O______
  307. XM__________________QQ__CC_^/__XX__A__^/__X\?_CC__'__\?__C'_^/
  308. XM__XXX_CC_^./_\<?_CC__'___<?_C__^./_\<?_QQQ_\?_\<?_[__\     #
  309. XM________________________________________C______X______^/'_\?
  310. XM__L'__"/__C__P1_^/'_\/__CQ__A'_X___C_____________________X#?
  311. XMCP-Q\O!_X#Q_@!=^!'?S]'_@<G\N__X''_@-C^ &WPV+'D.'^/<?P7C_CW'^
  312. XM T?X ]_+P?^ Q_Q^/_@8N. T;XWC_@?[______________________QQ__CC
  313. XM_^/__XX__C__^/__X\?_CC__'__\?__CB_^/__XXX_CC_^./_\<?_CC__'__
  314. XM^<?_C__^./_\<?_QQQ_&/_\<?_[__\     #________________________
  315. XM________________!______P?_____^"'_\7__8"_^ /__B__@!_^"'_\)__
  316. XM@A__ '_P?__!_____________________P _C@!Q^ #_P A_  #\ '?X\/_ 
  317. XM!OX.__P#/_ #Q<  /@V+'0#'_#0_@1#_PD/\ .+P #_@ _\ !?P /_ ( , ,
  318. XM7XWC_  '______________________X@__1C_]'?_T8__@[_]&__X,?_!C__
  319. XM'__\?__1A_]%__P08?!A_]&/_X,?_1C__&__\$?_1?_^,'_\<?_QQQ^ -_\<
  320. XM?_P#?\     #________________________________________A______X
  321. XM______]!__X/__ !_\ ___!__ '_]!__^'__0?_^ ?_X___A____________
  322. XM_________AQ_S#@/_ '_AP/^'P'X8/?\<_^&#OP!__AA?^''PX? ? -'B#C'
  323. XM_Q#_@0__\8_X<>'F '_P!_X<(_X?_^&$/X<>/W '^  /________________
  324. XM______\9__X?__@__^'__P'__A__P ?_CG__C__^/__XC__C__XXX_CC__A_
  325. XM_P#__X#_^A__X!__X__\"/_Z#__H"/\!#_\ ?_@ _\     #____________
  326. XM____________________________U______]_______S__^?__'[_]]___S_
  327. XM_/O__S___?__\__^^__]___U_____________________/[_Z?X__PW_/\?\
  328. XM_^/S^??_#_\_G?W#__/X_\_OYS_X_<?OT?WG_\/_L3___!_S^_//8/_\-_S_
  329. XM=_^__\_N_S^_?GX/\_@?______________________^[__]___S___?__\?_
  330. XM_W___,O_WO__W___/__]W__W__]]]_WW__W__T/__]C__S___G__]___/?__
  331. XM/__\<_]SG_^?___!_\     #____________________________________
  332. XM____[______________________________________________________[
  333. XM_____________________/__^?____W_/__\___S__?___\__?W___/__\__
  334. XM_S___?__\?______\7___]_S___??___]_S______\___S___G__________
  335. XM_________________________________________^/__O______'_______
  336. XM_____________\?___C___________________________]______\     #
  337. XM________________________________________W___________________
  338. XM___________________________________W_____________________?__
  339. XM^_____W_?__]___W__?___]__OY___?__]___W___?__\_______\7___]_W
  340. XM___>____]_W______]___W___G__________________________________
  341. XM_________________^/__W______'____________________\?___C_____
  342. XM______________________]X_____\     #________________________
  343. XM____________________________________________________________
  344. XM_________________________________?__^_____W_?__]___W__?___]_
  345. XM_G^?__?__]___W___O__]_______\7___\_W___N____]_W______]___W__
  346. XM_GX/__________________________________________________/__S__
  347. XM____G____________________\?___C___________________________]P
  348. XM?____\     #________________________________________________
  349. XM____________________________________________________________
  350. XM_________?__^_____W_?__]___W__?___]__C____?__]___W___O__]___
  351. XM____\7___\]W___Q____]_W______]___W___P '____________________
  352. XM____________________________Y_/__Q______G___________________
  353. XM_\?___C___________________________\ ?____\     #____________
  354. XM____________________________________________________________
  355. XM_____________________________________________?__^_____W_?__]
  356. XM_]_W__?___]__C____?__]___W_W_S__]_______\7___\=W________]_W_
  357. XM_____]___W___P #____________________________________________
  358. XM____R>?__Q_____X/____________________\?___A_________________
  359. XM__________\'?____\     #____________________________________
  360. XM____________________________________________________________
  361. XM_____________________O___?____G_O__^_S_[_^?___^__#____O__^__
  362. XM_[_/_\?_^_______\?___^#[________Y_[______^___[___X'[________
  363. XM________________________________________TH___A_____P?_______
  364. XM_____________\____C___________________________^/?____\     #
  365. XM____________________________________________________________
  366. XM_________________________________________________________S__
  367. XM_F____'_S___//_\_\?____/_'____S___/__\\______/______\O____#\
  368. XM________Q_\_______/__\_____[________________________________
  369. XM_________________1___C_____P_____________________]____G_____
  370. XM________________________?____\     #________________________
  371. XM____________________________________________________________
  372. XM_________________________________\___Y____O_\___P___/^_____S
  373. XM_/____\___S___#______S______]_____G_/_______[__/______S___/_
  374. XM_____________________________________________________G___G__
  375. XM___V_____________________[____O____________________________\
  376. X&_____\  
  377. Xend
  378. END_OF_FILE
  379. # end of 'font-32/Uoldeng22x30rI'
  380. fi
  381. if test -f 'src/cut.c' -a "${1}" != "-c" ; then 
  382.   echo shar: Will not clobber existing file \"'src/cut.c'\"
  383. else
  384. echo shar: Extracting \"'src/cut.c'\" \(10755 characters\)
  385. sed "s/^X//" >'src/cut.c' <<'END_OF_FILE'
  386. X/*                        Copyright (c) 1987 Bellcore
  387. X *                            All Rights Reserved
  388. X *       Permission is granted to copy or use this program, EXCEPT that it
  389. X *       may not be sold for profit, the copyright notice must be reproduced
  390. X *       on copies, and credit should be given to Bellcore where it is due.
  391. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  392. X */
  393. X/*    $Header: cut.c,v 4.2 88/06/27 11:13:00 bianchi Exp $
  394. X    $Source: /tmp/mgrsrc/src/RCS/cut.c,v $
  395. X*/
  396. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/cut.c,v $$Revision: 4.2 $";
  397. X
  398. X/* cut and paste text */
  399. X
  400. X#include <stdio.h> 
  401. X#include "bitmap.h"
  402. X#include "defs.h"
  403. X#include "font.h"
  404. X#include "window.h"
  405. X#include "event.h"
  406. X
  407. X/* stuff global buffer into input stream */
  408. X
  409. Xint 
  410. Xpaste()
  411. X   {
  412. X   if (snarf) {
  413. X      do_event(EVENT_PASTE,active,E_MAIN);
  414. X      Write(ACTIVE(to_fd),snarf,strlen(snarf));
  415. X#ifdef DEBUG
  416. X      dprintf(y)(stderr,"%s: Pasting [%s]\n",ACTIVE(tty), snarf?snarf:"EMPTY");
  417. X#endif
  418. X      }
  419. X#ifdef DEBUG
  420. X   else {
  421. X      dprintf(y)(stderr,"%s: Nothing to paste\n",ACTIVE(tty));
  422. X      }
  423. X#endif
  424. X   }
  425. X
  426. X/* cut text from a window, put in global buffer */
  427. X
  428. X
  429. X#define MAXROWS        64        /* greatest char height */
  430. X#define MAXCOLS        32        /* widest char (bits in u-long) */
  431. X
  432. XBITMAP *glyph;                /* spot for glyph comparison */
  433. Xunsigned long data[MAXROWS];        /* bit data for glyph */
  434. XBITMAP *check;                /* other spot for glyph comparison */
  435. Xunsigned long data2[MAXROWS];        /* bit data for other glyph */
  436. X
  437. Xstatic struct entry **table;        /* hash table */
  438. X
  439. X/* sweep out and cut text */
  440. X
  441. Xint
  442. Xcut()
  443. X   {
  444. X   register int i,j;
  445. X   register WINDOW *win = active;        /* window to cut text from */
  446. X   int count;                    /* # of snarfed chars */
  447. X   int errors = 0;                /* number of misses */
  448. X   int cols=1, rows=0;                /* rows and cols swept */
  449. X   int col,row;                    /* starting col and row */
  450. X   int maxcol;                    /* # of cols in row */
  451. X   int x,y;                    /* bit position in bitmap */
  452. X   int hcode;                    /* hash code */
  453. X   int button;                    /* button from move_mouse */
  454. X   char c;                    /* matched char */
  455. X   char *pntr;                    /* current char in line */
  456. X   struct entry *entry;                /* current hash table entry */
  457. X   char *line;                    /* buffer to receive text */
  458. X   char get_match(),*malloc();
  459. X   char *to_tabs(), *fixline();
  460. X
  461. X   /* return immediately if window is not snarffable */
  462. X
  463. X   if (W(flags) & W_SNARFABLE ==0)
  464. X      return(0);
  465. X
  466. X   /* initialize comparison registers */
  467. X
  468. X   glyph = bit_alloc(32,FSIZE(high),data,1);
  469. X   check = bit_alloc(32,FSIZE(high),data2,1);
  470. X   bit_blit(check,0,0,32,FSIZE(high),BIT_CLR,NULL_DATA,0,0);
  471. X
  472. X   /* build hash table */
  473. X
  474. X   if ((table = W(font)->table) == NULL) {
  475. X#ifdef DEBUG
  476. X      dprintf(C)(stderr,"building cut table\n");
  477. X#endif
  478. X      table = W(font)->table =
  479. X                    (struct entry **) malloc (sizeof (struct entry) * H_SIZE);
  480. X      bzero(table, sizeof(struct entry) * H_SIZE);
  481. X   
  482. X      for(i = FSIZE(start);i<FSIZE(start)+FSIZE(count);i++) {
  483. X         if (W(font)->glyph[i] && i >= ' ') {
  484. X            hcode = get_hash(W(font)->glyph[i],0,0,FSIZE(wide),FSIZE(high),0);
  485. X            enter(hcode,i);
  486. X            }
  487. X         }
  488. X      }
  489. X
  490. X   /* find cut region */
  491. X
  492. X   SETMOUSEICON(&mouse_cut);
  493. X   button = move_mouse(screen,mouse,&mousex,&mousey,0);
  494. X   SETMOUSEICON(&mouse_arrow);
  495. X   i = get_text(screen,mouse,mousex,mousey,&cols,&rows,win,E_SWTEXTT);
  496. X   if (i == 0) {
  497. X      do_button(0);
  498. X      return(0);
  499. X   }
  500. X
  501. X   /* find extent of cut region */
  502. X
  503. X   col = (mousex-(W(x0)+SUM_BDR+W(text.x)))/FSIZE(wide);
  504. X   maxcol = (W(text.wide) ? W(text.wide) : BIT_WIDE(W(window)))/FSIZE(wide);
  505. X   row = (mousey-(W(y0)+SUM_BDR+W(text.y)))/FSIZE(high);
  506. X
  507. X   if (W(flags)&W_SNARFLINES) {        /* snarf lines only */
  508. X#ifdef DEBUG
  509. X      dprintf(C)(stderr,"Cutting lines only\n");
  510. X#endif
  511. X      col = 0;
  512. X      cols = maxcol;
  513. X      }
  514. X
  515. X#ifdef DEBUG
  516. X   dprintf(C)(stderr,"Cut got %d,%d  %d x %d\n",col,row,cols,rows);
  517. X#endif
  518. X
  519. X   /* look up characters */
  520. X
  521. X   pntr = line = malloc(1+(1+maxcol)*(rows+1));    /* max possible cut */
  522. X   switch(rows) {
  523. X      case 0:            /* 1 row */
  524. X         y = W(text.y)+row*FSIZE(high);
  525. X         for(x=W(text.x)+col*FSIZE(wide),i=0;i<cols;i++,x+=FSIZE(wide)) {
  526. X            c = get_match(W(window),x,y,FSIZE(wide),FSIZE(high));
  527. X            *pntr++ = c ? c : (errors++,C_NOCHAR);
  528. X            }
  529. X         if (col+cols == maxcol && c==' ')
  530. X            pntr = fixline(line,pntr);
  531. X         break;
  532. X      case 1:            /* 2 rows */
  533. X         y = W(text.y)+row*FSIZE(high);
  534. X         for(x=W(text.x)+col*FSIZE(wide),i=0;i<maxcol;i++,x+=FSIZE(wide)) {
  535. X            c = get_match(W(window),x,y,FSIZE(wide),FSIZE(high));
  536. X            *pntr++ = c ? c : (errors++,C_NOCHAR);
  537. X            }
  538. X         pntr = fixline(line,pntr);
  539. X
  540. X         y += FSIZE(high);
  541. X         for(x=W(text.x),i=0;i<col+cols;i++,x+=FSIZE(wide)) {
  542. X            c = get_match(W(window),x,y,FSIZE(wide),FSIZE(high));
  543. X            *pntr++ = c ? c : (errors++,C_NOCHAR);
  544. X            }
  545. X         if (col+cols == maxcol && c==' ')
  546. X            pntr = fixline(line,pntr);
  547. X         break;
  548. X
  549. X      default:            /* > 2 rows */
  550. X         y = W(text.y)+row*FSIZE(high);
  551. X         for(x=W(text.x)+col*FSIZE(wide),i=0;i<maxcol;i++,x+=FSIZE(wide)) {
  552. X            c = get_match(W(window),x,y,FSIZE(wide),FSIZE(high));
  553. X            *pntr++ = c ? c : (errors++,C_NOCHAR);
  554. X            }
  555. X         pntr = fixline(line,pntr);
  556. X
  557. X         for(j=0;j<rows-1;j++) {
  558. X            y += FSIZE(high);
  559. X            for(x=W(text.x),i=0;i<maxcol;i++,x+=FSIZE(wide)) {
  560. X               c = get_match(W(window),x,y,FSIZE(wide),FSIZE(high));
  561. X               *pntr++ = c ? c : (errors++,C_NOCHAR);
  562. X               }
  563. X            pntr = fixline(line,pntr);
  564. X            }
  565. X
  566. X         y += FSIZE(high);
  567. X         for(x=W(text.x),i=0;i<col+cols;i++,x+=FSIZE(wide)) {
  568. X            c = get_match(W(window),x,y,FSIZE(wide),FSIZE(high));
  569. X            *pntr++ = c ? c : (errors++,C_NOCHAR);
  570. X            }
  571. X         if (col+cols == maxcol && c==' ')
  572. X            pntr = fixline(line,pntr);
  573. X
  574. X         break;
  575. X      }
  576. X   *pntr = '\0';
  577. X   bit_destroy(check);
  578. X   bit_destroy(glyph);
  579. X
  580. X   /* put text into snarf buffer */
  581. X
  582. X   count = pntr-line;
  583. X#ifdef DEBUG
  584. X   dprintf(C)(stderr,"snarfed %d chars, %d errors\n",count,errors);
  585. X   dprintf(C)(stderr,"snarfed [%s]\n",line);
  586. X#endif
  587. X
  588. X   if (!(W(flags)&W_SNARFHARD)  && errors > 0 || 2*errors > count) {
  589. X      oops();
  590. X      count = 0;
  591. X      }
  592. X   else {
  593. X      if (W(flags)&W_SNARFTABS)
  594. X         to_tabs(col,line,line);
  595. X
  596. X      if (snarf && button < BUTTON_SYS) {            /* add to cut buffer */
  597. X         char *tmp = malloc(strlen(snarf) + strlen(line) +1);
  598. X         count += strlen(snarf);
  599. X         strcpy(tmp,snarf);
  600. X         strcat(tmp,line);
  601. X         free(snarf);
  602. X         free(line);
  603. X         snarf = tmp;
  604. X         }
  605. X      else if (snarf) {                    /* replace cut buffer */
  606. X         free(snarf);
  607. X         snarf = line;
  608. X         }
  609. X      else                        /* new cut buffer */
  610. X         snarf = line;
  611. X
  612. X      /* send snarf events (if any) */
  613. X      id_message = W(pid);
  614. X      for(win=active;win != (WINDOW *) 0;win=W(next))
  615. X         do_event(EVENT_SNARFED,win,E_MAIN);
  616. X      }
  617. X   do_button(0);
  618. X   return(count);
  619. X   }
  620. X
  621. X/* given bitmap, get hash code */
  622. X
  623. Xstatic int
  624. Xget_hash(map,x,y,w,h,how)
  625. XBITMAP *map;
  626. Xint x,y,w,h;        /* where in map */  
  627. Xint how;        /* 0-> normal, 1->inverted */
  628. X   {
  629. X   register unsigned long sum = 0;
  630. X   register int i,j;
  631. X   bit_blit(glyph,0,0,32,h,BIT_CLR,NULL_DATA,0,0);
  632. X   bit_blit(glyph,32-w,0,w,h,how ? BIT_NOT(BIT_SRC) : BIT_SRC,map,x,y);
  633. X         for (j=0;j<h;j++)
  634. X            sum += data[j]*(j+1);
  635. X   return(sum%H_SIZE);
  636. X   }
  637. X
  638. X/* enter a glyph into the hash table */
  639. X
  640. Xstatic int
  641. Xenter(item,value)
  642. Xint item;
  643. Xunsigned char value;
  644. X   {
  645. X   register struct entry *entry;
  646. X   char *malloc();
  647. X
  648. X   if (table[item] == (struct entry *) 0) {
  649. X      table[item] = (struct entry *) malloc(sizeof (struct entry));
  650. X      table[item] -> value = value;
  651. X      table[item] -> next = (struct entry *) 0;
  652. X      }
  653. X   else {
  654. X      for(entry = table[item];entry->next;entry = entry -> next);
  655. X      entry -> next  = (struct entry *) malloc(sizeof (struct entry));
  656. X      entry -> next -> value = value;
  657. X      entry -> next -> next = (struct entry *) 0;
  658. X      }
  659. X   }
  660. X
  661. X/* find a character match in current font */
  662. X
  663. Xstatic char
  664. Xget_match(map,x,y,w,h)
  665. XBITMAP *map;                /* bitmap containing text */
  666. Xint x,y,w,h;                /* position of glyph in "map" */
  667. X   {
  668. X   register struct entry *entry;
  669. X   register WINDOW *win = active;
  670. X   int code;                /* hash code */
  671. X   int size = sizeof(long) * h;
  672. X
  673. X   code = get_hash(map,x,y,w,h,0);        /* leaves char in glyph */
  674. X   for(entry=table[code];entry;entry=entry->next) {
  675. X      bit_blit(check,32-w,0,w,h,BIT_SRC,W(font)->glyph[entry->value],0,0);
  676. X      if (bcmp(data,data2,size)==0) {
  677. X         return(entry->value);
  678. X         }
  679. X      }
  680. X
  681. X   /* try inverse video version */
  682. X
  683. X   code = get_hash(map,x,y,w,h,1);        /* leaves char in glyph */
  684. X   for(entry=table[code];entry;entry=entry->next) {
  685. X      bit_blit(check,32-w,0,w,h,BIT_SRC,W(font)->glyph[entry->value],0,0);
  686. X      if (bcmp(data,data2,size)==0) {
  687. X         return(entry->value);
  688. X         }
  689. X      }
  690. X   return('\0');
  691. X   }
  692. X   
  693. X/* zap a font hash table */
  694. X
  695. Xzap_fhash(fnt)
  696. Xstruct font *fnt;
  697. X   {
  698. X   register struct entry *entry, *next;
  699. X   register int i;
  700. X
  701. X   if (fnt->table) {
  702. X      for(i=0;i<H_SIZE;i++)
  703. X         for(entry=table[i];entry;entry=next) {
  704. X            next = entry->next;
  705. X            free(entry);
  706. X            }
  707. X      free(fnt->table);
  708. X      }
  709. X   }
  710. X
  711. X/* change trailing white space into \n */
  712. X
  713. Xchar *
  714. Xfixline(s,pnt)
  715. Xchar *s;
  716. Xregister char *pnt;
  717. X   {
  718. X   while (*--pnt == ' ' && pnt > s);
  719. X   *++pnt = '\n';
  720. X   return(++pnt);
  721. X   }
  722. X
  723. X/* change spaces to tabs */
  724. X
  725. Xstatic char *
  726. Xto_tabs(pos,in,out)
  727. Xregister int pos;                /* starting col # */
  728. Xregister char *in;                /* input str */
  729. Xregister char *out;                /* output str - tabs */
  730. X   {
  731. X   char *s = out;                /* start of out str */
  732. X   register char c;                /* current input char */
  733. X   register int spaces = 0;            /* # pending spaces */
  734. X   
  735. X#ifdef DEBUG
  736. X   dprintf(C)(stderr,"-> TABS");
  737. X#endif
  738. X   while(pos++,c = *in++) {
  739. X
  740. X      if (c=='\n' || c=='\r' || c=='\f')    /* reset column counter */
  741. X         pos =0;
  742. X
  743. X      if (c == ' ') {
  744. X         spaces++;
  745. X         if (pos && pos%8 == 0) {        /* ' ' -> \t */
  746. X            c = '\t';
  747. X#ifdef DEBUG
  748. X            dprintf(C)(stderr,".");
  749. X#endif
  750. X            spaces=0;
  751. X            }
  752. X         }
  753. X      else for(;spaces>0;spaces--) {        /* output spaces */
  754. X         *out++ = ' ';
  755. X         }
  756. X         
  757. X      if (spaces == 0)
  758. X         *out++ = c;
  759. X      }
  760. X   *out = '\0';
  761. X#ifdef DEBUG
  762. X   dprintf(C)(stderr,"\n");
  763. X#endif
  764. X   return(s);
  765. X   }
  766. X
  767. X/* can't cut, ring bell */
  768. X
  769. Xstatic int
  770. Xoops()
  771. X   {
  772. X   register WINDOW *win = active;
  773. X
  774. X   CLEAR(W(window),BIT_NOT(BIT_DST));
  775. X   write(2,"\007",1);
  776. X   CLEAR(W(window),BIT_NOT(BIT_DST));
  777. X   }
  778. END_OF_FILE
  779. # end of 'src/cut.c'
  780. fi
  781. if test -f 'src/win_stack.c' -a "${1}" != "-c" ; then 
  782.   echo shar: Will not clobber existing file \"'src/win_stack.c'\"
  783. else
  784. echo shar: Extracting \"'src/win_stack.c'\" \(10948 characters\)
  785. sed "s/^X//" >'src/win_stack.c' <<'END_OF_FILE'
  786. X/*                        Copyright (c) 1987 Bellcore
  787. X *                            All Rights Reserved
  788. X *       Permission is granted to copy or use this program, EXCEPT that it
  789. X *       may not be sold for profit, the copyright notice must be reproduced
  790. X *       on copies, and credit should be given to Bellcore where it is due.
  791. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  792. X */
  793. X/*    $Header: win_stack.c,v 4.2 88/07/20 10:22:55 sau Exp $
  794. X    $Source: /tmp/mgrsrc/src/RCS/win_stack.c,v $
  795. X*/
  796. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/win_stack.c,v $$Revision: 4.2 $";
  797. X
  798. X/* push - pop window environment */
  799. X
  800. X#include "bitmap.h"
  801. X#include "font.h"
  802. X#include "defs.h"
  803. X#include "window.h"
  804. X#include "menu.h"
  805. X#include "event.h"
  806. X#include <stdio.h>
  807. X
  808. X#define S(x)    (stack->x)
  809. X
  810. X/* push a window on the environment stack */
  811. X
  812. Xint
  813. Xwin_push(win,level)
  814. Xregister WINDOW *win;        /* window to push */
  815. Xint level;            /* what things to push */
  816. X   {
  817. X   register WINDOW *stack;    /* pushed window goes here */
  818. X   register int i,j;
  819. X   char *malloc(), *save_line(), *print_stack();
  820. X   struct menu_state *menu_copy();
  821. X
  822. X   if ((stack = (WINDOW *) malloc(sizeof(WINDOW))) == (WINDOW *) 0)
  823. X      return(-1);
  824. X    
  825. X   if (level == 0)
  826. X      level = P_DEFAULT;
  827. X
  828. X#ifdef DEBUG
  829. X   dprintf(P)(stderr,"%s Stacking %s\n",
  830. X                   W(tty),print_stack(level));
  831. X#endif
  832. X
  833. X   /* setup stacked window */
  834. X
  835. X   *stack = *win;    /* structure assignment */
  836. X   W(stack) = stack;
  837. X
  838. X   /* bcopy(win,stack,sizeof(WINDOW)); */
  839. X
  840. X   for(j=0;j<MAXMENU;j++)
  841. X      S(menus)[j] = (struct menu_state *) 0;
  842. X   for(j=0;j<MAXEVENTS;j++)
  843. X      S(events)[j] = (char *) 0;
  844. X   for(j=0;j<MAXBITMAPS;j++)
  845. X      S(bitmaps)[j] = (BITMAP *) 0;
  846. X   S(save) = (BITMAP *) 0;
  847. X   S(clip_list) = (char *) 0;
  848. X
  849. X   /* setup each pushed item */
  850. X
  851. X   for(i=1;i!=P_MAX;i <<= 1)
  852. X      switch (level&i) {
  853. X         case P_MENU:        /* save the menus */
  854. X#ifdef DEBUG
  855. X              dprintf(P)(stderr,"  menus ");
  856. X#endif
  857. X              for(j=0;j<MAXMENU;j++)
  858. X                 if (W(menus)[j] && (level&P_CLEAR)) {
  859. X                    S(menus)[j] = W(menus)[j]; 
  860. X                    W(menus)[j] = (struct menu_state *) 0;
  861. X#ifdef DEBUG
  862. X                    dprintf(P)(stderr,"%d ",j);
  863. X#endif
  864. X                    }
  865. X                 else if (W(menus)[j]) {
  866. X                    S(menus)[j] = menu_copy(W(menus)[j]); 
  867. X#ifdef DEBUG
  868. X                    dprintf(P)(stderr,"%d ",j);
  869. X#endif
  870. X                    }
  871. X#ifdef DEBUG
  872. X              dprintf(P)(stderr,"\n");
  873. X#endif
  874. X              break;
  875. X         case P_EVENT:        /* save the events */
  876. X
  877. X#ifdef DEBUG
  878. X              dprintf(P)(stderr,"  events ");
  879. X#endif
  880. X              if (IS_EVENT(win,EVENT_STACK))
  881. X                 EVENT_SET_MASK(win,EVENT_STFLAG);
  882. X
  883. X              if (level&P_CLEAR) 
  884. X                 W(event_mask) = IS_EVENT(win,EVENT_STFLAG);
  885. X              else
  886. X                 EVENT_CLEAR_MASK(win,EVENT_STACK);
  887. X
  888. X              for(j=0;j<MAXEVENTS;j++)
  889. X                 if (W(events)[j] && (level&P_CLEAR)) {
  890. X                    S(events)[j] = W(events)[j]; 
  891. X                    W(events)[j] = (char *) 0;
  892. X#ifdef DEBUG
  893. X                    dprintf(P)(stderr,"%d ",j);
  894. X#endif
  895. X                    }
  896. X                 else if (W(events)[j]) {
  897. X                    S(events)[j] = save_line(W(events)[j]); 
  898. X#ifdef DEBUG
  899. X                    dprintf(P)(stderr,"%d ",j);
  900. X#endif
  901. X                    }
  902. X#ifdef DEBUG
  903. X              dprintf(P)(stderr,"\n");
  904. X                        
  905. X#endif
  906. X              break;
  907. X         case P_BITMAP:        /* save the bitmaps */
  908. X#ifdef DEBUG
  909. X              dprintf(P)(stderr,"  bitmaps ");
  910. X#endif
  911. X              for(j=0;j<MAXBITMAPS;j++)
  912. X                 if (W(bitmaps)[j] && level&P_CLEAR) {
  913. X                    S(bitmaps)[j] = W(bitmaps)[j];
  914. X                    W(bitmaps)[j] = (BITMAP *) 0;
  915. X#ifdef DEBUG
  916. X                    dprintf(P)(stderr,"%d ",j);
  917. X#endif
  918. X                    }
  919. X                 else if (W(bitmaps)[j]) {
  920. X                    S(bitmaps)[j] = bit_alloc(BIT_WIDE(W(bitmaps)[j]),
  921. X                                       BIT_HIGH(W(bitmaps)[j]),NULL_DATA,
  922. X                                       BIT_DEPTH(W(bitmaps)[j]));
  923. X                    bit_blit(S(bitmaps)[j],0,0,BIT_WIDE(W(bitmaps)[j]),
  924. X                             BIT_HIGH(W(bitmaps)[j]),BIT_SRC,W(bitmaps)[j],0,0);
  925. X#ifdef DEBUG
  926. X                    dprintf(P)(stderr,"%d ",j);
  927. X#endif
  928. X                    }
  929. X#ifdef DEBUG
  930. X              dprintf(P)(stderr,"\n");
  931. X#endif
  932. X              break;
  933. X         case P_WINDOW:        /* save the bit image */
  934. X#ifdef DEBUG
  935. X              dprintf(P)(stderr,"  window\n");
  936. X#endif
  937. X              S(save) = bit_alloc(BIT_WIDE(W(border)),BIT_HIGH(W(border)),
  938. X                                  NULL_DATA,DEPTH);
  939. X              if (W(save) && !(W(flags)&W_ACTIVE))
  940. X                 bit_blit(S(save),0,0,BIT_WIDE(W(save)),BIT_HIGH(W(save)),
  941. X                          BIT_SRC,W(save),0,0);
  942. X              else
  943. X                 bit_blit(S(save),0,0,BIT_WIDE(W(border)),BIT_HIGH(W(border)),
  944. X                          BIT_SRC,W(border),0,0);
  945. X              break;
  946. X         case P_POSITION:    /* save the window position */
  947. X#ifdef DEBUG
  948. X              dprintf(P)(stderr,"  position\n");
  949. X#endif
  950. X              S(esc)[1] = BIT_WIDE(W(border));
  951. X              S(esc)[2] = BIT_HIGH(W(border));
  952. X              break;
  953. X         case P_TEXT:        /* save text region */
  954. X              if (level&P_CLEAR) {
  955. X                 W(text).x = 0;
  956. X                 W(text).y = 0;
  957. X                 W(text).wide = 0;
  958. X                 W(text).high = 0;
  959. X                 }
  960. X              break;
  961. X         case P_MOUSE:        /* save mouse position */
  962. X#ifdef DEBUG
  963. X              dprintf(P)(stderr,"  mouse\n");
  964. X#endif
  965. X              S(esc)[3] = mousex;
  966. X              S(esc)[4] = mousey;
  967. X              break;
  968. X         case P_FLAGS:        /* save window flags  */
  969. X              if (level&P_CLEAR) {
  970. X                 W(flags)  &= ~W_SAVE;
  971. X                 W(flags)  |= W_BACKGROUND;
  972. X                 W(style) = NOCOLOR&BIT_SRC | GETCOLOR(BLACK);
  973. X                 W(background) = NOCOLOR&W(background) | GETCOLOR(WHITE);
  974. X                 if (win == active)
  975. X                    border(win,SUM_BDR-1,1);
  976. X                 else
  977. X                    border(win,BLK_BDR,WH_BDR);
  978. X                 }
  979. X              break;
  980. X         }
  981. X
  982. X   S(code) = level;
  983. X   S(window) = (BITMAP *) 0;
  984. X   S(border) = (BITMAP *) 0;
  985. X   S(snarf) = (char *) 0;
  986. X   S(bitmap) = (BITMAP *) 0;
  987. X   return(level);
  988. X   }
  989. X
  990. X/* pop the window stack */
  991. X
  992. Xint
  993. Xwin_pop(win)
  994. XWINDOW *win;                /* window to pop to */
  995. X   {
  996. X   register int i,j;
  997. X   register WINDOW *stack = W(stack);    /* window to pop from */
  998. X   char *print_stack();
  999. X
  1000. X   if (stack == (WINDOW *) 0) {
  1001. X#ifdef DEBUG
  1002. X      dprintf(P)(stderr,"  No environment to pop\n");
  1003. X#endif
  1004. X      return(-1);
  1005. X      }
  1006. X
  1007. X#ifdef DEBUG
  1008. X   dprintf(P)(stderr,"%s popping %s\n",W(tty),print_stack(S(code)));
  1009. X#endif
  1010. X
  1011. X   /* pop each item stacked */
  1012. X
  1013. X   for(i=1;i!=P_MAX;i <<= 1)
  1014. X      switch (S(code)&i) {
  1015. X         case P_MENU:        /* restore the menus */
  1016. X#ifdef DEBUG
  1017. X              dprintf(P)(stderr,"  menus ");
  1018. X#endif
  1019. X              W(menu[0]) = S(menu[0]);
  1020. X              W(menu[1]) = S(menu[1]);
  1021. X              for(j=0;j<MAXMENU;j++) {
  1022. X                 if (W(menus)[j]) {
  1023. X#ifdef DEBUG
  1024. X                    dprintf(P)(stderr,"d(%d) ",j);
  1025. X#endif
  1026. X                    menu_destroy(W(menus)[j]);
  1027. X                    }
  1028. X                 if (S(menus)[j]) {
  1029. X#ifdef DEBUG
  1030. X                    dprintf(P)(stderr,"r(%d) ",j);
  1031. X#endif
  1032. X                    W(menus)[j] = S(menus)[j];
  1033. X                    S(menus)[j] = (struct menu_state *) 0;
  1034. X                    }
  1035. X                 else
  1036. X                    W(menus)[j] = (struct menu_state *) 0;
  1037. X                 }
  1038. X#ifdef DEBUG
  1039. X              dprintf(P)(stderr,"\n");
  1040. X#endif
  1041. X              break;
  1042. X         case P_EVENT:        /* restore the events */
  1043. X
  1044. X#ifdef DEBUG
  1045. X              dprintf(P)(stderr,"  events ");
  1046. X#endif
  1047. X              for(j=0;j<MAXEVENTS;j++) {
  1048. X                 if (W(events)[j]) {
  1049. X#ifdef DEBUG
  1050. X                    dprintf(P)(stderr,"d(%d) ",j);
  1051. X#endif
  1052. X                    free(W(events)[j]);
  1053. X                    }
  1054. X                 W(events)[j] = S(events)[j];
  1055. X                 S(events)[j] = (char *) 0;
  1056. X                 }
  1057. X              W(event_mask) = S(event_mask);
  1058. X#ifdef DEBUG
  1059. X              dprintf(P)(stderr,"\n");
  1060. X#endif
  1061. X              break;
  1062. X         case P_CURSOR:        /* restore the cursor position */
  1063. X              W(x) = S(x);
  1064. X              W(y) = S(y);
  1065. X              W(gx) = S(gx);
  1066. X              W(gy) = S(gy);
  1067. X              break;
  1068. X         case P_BITMAP:        /* restore the bitmaps */
  1069. X              for(j=0;j<MAXBITMAPS;j++) {
  1070. X                 if (W(bitmaps)[j])
  1071. X                    bit_destroy(W(bitmaps)[j]);
  1072. X                 W(bitmaps)[j] = S(bitmaps)[j];
  1073. X                 S(bitmaps)[j] = (BITMAP *) 0;
  1074. X                 }
  1075. X#ifdef DEBUG
  1076. X              dprintf(P)(stderr,"  bitmaps\n");
  1077. X#endif
  1078. X              break;
  1079. X         case P_FONT:        /* restore font */
  1080. X              W(font) = S(font);
  1081. X              break;
  1082. X         case P_TEXT:        /* restore text region */
  1083. X              W(text) = S(text);
  1084. X              break;
  1085. X         case P_POSITION:    /* restore the window position */
  1086. X              if (win!= active)
  1087. X                 cursor_off();
  1088. X              ACTIVE_OFF();
  1089. X              expose(win);
  1090. X
  1091. X              shape(S(x0),S(y0),S(esc)[1],S(esc)[2]);
  1092. X
  1093. X              ACTIVE_ON();
  1094. X#ifdef DEBUG
  1095. X              dprintf(P)(stderr,"  position\n");
  1096. X#endif
  1097. X              break;
  1098. X         case P_WINDOW:        /* restore the window contents */
  1099. X              if (W(save))
  1100. X                 bit_destroy(W(save));
  1101. X              W(save) = bit_alloc(BIT_WIDE(W(border)),BIT_HIGH(W(border)),
  1102. X                                  NULL_DATA,DEPTH);
  1103. X              bit_blit(W(border),0,0,BIT_WIDE(S(save)),BIT_HIGH(S(save)),
  1104. X                       BIT_SRC,S(save),0,0);
  1105. X#ifdef DEBUG
  1106. X              dprintf(P)(stderr,"  window\n");
  1107. X#endif
  1108. X              break;
  1109. X         case P_FLAGS:        /* restore the window flags */
  1110. X              W(op) = S(op);
  1111. X              W(style) = S(style);
  1112. X              W(background) = S(background);
  1113. X              W(dup) = S(dup);
  1114. X              W(flags) = (S(flags)&W_SAVE) | (W(flags)&(~W_SAVE));
  1115. X              if (win == active)
  1116. X                 border(win,SUM_BDR-1,1);
  1117. X              else
  1118. X                 border(win,BLK_BDR,WH_BDR);
  1119. X#ifdef DEBUG
  1120. X              dprintf(P)(stderr,"  flags\n");
  1121. X#endif
  1122. X              break;
  1123. X         case P_MOUSE:        /* save mouse position */
  1124. X#ifdef DEBUG
  1125. X              dprintf(P)(stderr,"  mouse\n");
  1126. X#endif
  1127. X              mousex =S(esc)[3] ;
  1128. X              mousey =S(esc)[4] ;
  1129. X              break;
  1130. X         }
  1131. X#ifdef DEBUG
  1132. X   dprintf(P)(stderr,"%s\n",S(stack)?"another stack":"no environments stacked");
  1133. X#endif
  1134. X   W(stack) = S(stack);
  1135. X   unlink_win(stack,0);
  1136. X
  1137. X   return(0);
  1138. X   }
  1139. X
  1140. X/* in-implemented window stack manipulation */
  1141. X
  1142. Xwin_swap(win,x,y)
  1143. XWINDOW *win;
  1144. Xint x,y;        /* entries on stack to swap  1=1st stack entry */
  1145. X   {
  1146. X   register int i,j;
  1147. X   WINDOW *winx, *winy;
  1148. X   }
  1149. END_OF_FILE
  1150. # end of 'src/win_stack.c'
  1151. fi
  1152. echo shar: End of archive 33 \(of 61\).
  1153. cp /dev/null ark33isdone
  1154. MISSING=""
  1155. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
  1156.     21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 \
  1157.     38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 \
  1158.     55 56 57 58 59 60 61 ; do
  1159.     if test ! -f ark${I}isdone ; then
  1160.     MISSING="${MISSING} ${I}"
  1161.     fi
  1162. done
  1163. if test "${MISSING}" = "" ; then
  1164.     echo You have unpacked all 61 archives.
  1165.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1166. else
  1167.     echo You still need to unpack the following archives:
  1168.     echo "        " ${MISSING}
  1169. fi
  1170. ##  End of shell archive.
  1171. exit 0
  1172.