home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume5 / xview.demos / part05 < prev    next >
Internet Message Format  |  1989-12-07  |  64KB

  1. Path: uunet!island!sun.com
  2. From: argv@sun.com (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v05i043: XView example programs, Part05/06
  5. Message-ID: <1243@island.uu.net>
  6. Date: 8 Dec 89 07:38:54 GMT
  7. Sender: argv@island.uu.net
  8. Lines: 2052
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: Dan Heller <argv@sun.com>
  12. Posting-number: Volume 5, Issue 43
  13. Archive-name: xview.demos/part05
  14.  
  15.  
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  22. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  23. # If this archive is complete, you will see the following message at the end:
  24. #        "End of archive 5 (of 6)."
  25. # Contents:  xview.demos/Imakefile xview.demos/canvas/Imakefile
  26. #   xview.demos/canvas/Makefile xview.demos/canvas/line.c
  27. #   xview.demos/color/Imakefile xview.demos/cursor/Imakefile
  28. #   xview.demos/cursor/simple_cursor.c
  29. #   xview.demos/cursor/stop_cursor.c xview.demos/defaults/Imakefile
  30. #   xview.demos/defaults/default_size.c
  31. #   xview.demos/defaults/default_text.c xview.demos/fonts/Imakefile
  32. #   xview.demos/frames/Imakefile xview.demos/icons/icon_demo.c
  33. #   xview.demos/icons/open.icon xview.demos/menus/Imakefile
  34. #   xview.demos/misc/Imakefile xview.demos/misc/screen.c
  35. #   xview.demos/misc/svrimage.c xview.demos/misc/type_to_string.c
  36. #   xview.demos/notice/Imakefile xview.demos/notice/simple_notice.c
  37. #   xview.demos/notifier/Imakefile xview.demos/notifier/interpose.c
  38. #   xview.demos/notifier/notify_input.c
  39. #   xview.demos/notifier/ntfy_do_dis.c xview.demos/notifier/ntfy_sig.c
  40. #   xview.demos/panels/btn_menu.c xview.demos/panels/client_data.c
  41. #   xview.demos/panels/repaint.c xview.demos/panels/simple_panel.c
  42. #   xview.demos/panels/stop_frame.c xview.demos/scrollbar/Imakefile
  43. #   xview.demos/seln_svc/Imakefile xview.demos/sv_compat/Imakefile
  44. #   xview.demos/ttysw/Imakefile xview.demos/ttysw/textsw_to_ttysw.c
  45. #   xview.demos/ttysw/xv_termsw.c
  46. # Wrapped by argv@island on Thu Dec  7 23:18:28 1989
  47. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  48. if test -f 'xview.demos/Imakefile' -a "${1}" != "-c" ; then 
  49.   echo shar: Will not clobber existing file \"'xview.demos/Imakefile'\"
  50. else
  51. echo shar: Extracting \"'xview.demos/Imakefile'\" \(1105 characters\)
  52. sed "s/^X//" >'xview.demos/Imakefile' <<'END_OF_FILE'
  53. X#
  54. X# @(#)Imakefile 1.1 89/07/21 SMI
  55. X#
  56. X# Top-level Imakefile for binaries
  57. X#
  58. X#    LIBRARY_DEST is the location of the XView libraries
  59. X#    HEADER_DEST is the location of the XView header file directories
  60. X#    DEMO_DEST is the desired location of the demo binaries
  61. X#    Other binaries will be installed in the standard X11 bin (BINDIR).
  62. X#
  63. X
  64. X#define IHaveSubdirs YES
  65. X#define INCLUDES -I. -I.. 
  66. X
  67. X#include "../XView.config"
  68. X
  69. XDEMO_DEST=/tmp
  70. XHELP_DEST=$(USRLIBDIR)/help
  71. XRANLIBINSTFLAGS=
  72. XAR=ar ruvl
  73. X
  74. X#
  75. X# Uncomment the following line if you wish to use the merged XView library
  76. X# (libxview.a) Comment out the other definition of LDFLAGS.
  77. X#
  78. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvin -lxvol -lX11 -lm
  79. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 -lm
  80. X
  81. XSUBDIRS= clock cmdtool dbxtool demos textedit
  82. X
  83. X#
  84. X# PassCDebugFlags will pass information to subdirectories
  85. X#
  86. X#define PassCDebugFlags 'HEADER_DEST=$(HEADER_DEST)' 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'LIBRARY_DEST=$(LIBRARY_DEST)' 'DEMO_DEST=$(DEMO_DEST)' 'LIBICCCM=$(LIBICCCM)'
  87. X'HELP_DEST=$(HELP_DEST)' 'LDFLAGS=$(LDFLAGS)'
  88. X
  89. XMakeSubdirs($(SUBDIRS))
  90. X
  91. XDependSubdirs($(SUBDIRS))
  92. X
  93. END_OF_FILE
  94. if test 1105 -ne `wc -c <'xview.demos/Imakefile'`; then
  95.     echo shar: \"'xview.demos/Imakefile'\" unpacked with wrong size!
  96. fi
  97. # end of 'xview.demos/Imakefile'
  98. fi
  99. if test -f 'xview.demos/canvas/Imakefile' -a "${1}" != "-c" ; then 
  100.   echo shar: Will not clobber existing file \"'xview.demos/canvas/Imakefile'\"
  101. else
  102. echo shar: Extracting \"'xview.demos/canvas/Imakefile'\" \(707 characters\)
  103. sed "s/^X//" >'xview.demos/canvas/Imakefile' <<'END_OF_FILE'
  104. X#
  105. X# @(#)Imakefile 1.3 89/12/06 SMI
  106. X#
  107. X# Imakefile for canvas
  108. X#
  109. X# LIBRARY_DEST is the location of the XView libraries
  110. X# HEADER_DEST is the location of the XView header files
  111. X# LIBDIR is the directory containing the X11 library (libX11.a)
  112. X#
  113. X
  114. XLIBRARY_DEST=/home/xview/usr/lib
  115. XHEADER_DEST=/home/xview/usr/include
  116. X
  117. XLIBDIR=/home/X11/lib
  118. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  119. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  120. X
  121. X# Uncomment the following line to use libxvol.a and libxvin.a
  122. X#
  123. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  124. X
  125. XTARGETS=canvas_event canvas_input line scroll_view split_views
  126. X
  127. Xall: $(TARGETS)
  128. X
  129. X${TARGETS}: $$@.c $$@.o 
  130. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  131. X
  132. END_OF_FILE
  133. if test 707 -ne `wc -c <'xview.demos/canvas/Imakefile'`; then
  134.     echo shar: \"'xview.demos/canvas/Imakefile'\" unpacked with wrong size!
  135. fi
  136. # end of 'xview.demos/canvas/Imakefile'
  137. fi
  138. if test -f 'xview.demos/canvas/Makefile' -a "${1}" != "-c" ; then 
  139.   echo shar: Will not clobber existing file \"'xview.demos/canvas/Makefile'\"
  140. else
  141. echo shar: Extracting \"'xview.demos/canvas/Makefile'\" \(191 characters\)
  142. sed "s/^X//" >'xview.demos/canvas/Makefile' <<'END_OF_FILE'
  143. X# makefile for canvas
  144. XLDFLAGS= -lxview -lX11
  145. X
  146. XTARGETS=canvas_event canvas_input line scroll_view split_views
  147. X
  148. Xall: $(TARGETS)
  149. X
  150. X${TARGETS}: $$@.c $$@.o 
  151. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  152. END_OF_FILE
  153. if test 191 -ne `wc -c <'xview.demos/canvas/Makefile'`; then
  154.     echo shar: \"'xview.demos/canvas/Makefile'\" unpacked with wrong size!
  155. fi
  156. # end of 'xview.demos/canvas/Makefile'
  157. fi
  158. if test -f 'xview.demos/canvas/line.c' -a "${1}" != "-c" ; then 
  159.   echo shar: Will not clobber existing file \"'xview.demos/canvas/line.c'\"
  160. else
  161. echo shar: Extracting \"'xview.demos/canvas/line.c'\" \(1250 characters\)
  162. sed "s/^X//" >'xview.demos/canvas/line.c' <<'END_OF_FILE'
  163. X/*
  164. X * line.c -- demonstrates installing a repaint routine in a canvas.
  165. X * The routine is called whenever the canvas needs to be repainted.
  166. X * This usually occurs when the canvas is exposed or resized.
  167. X */
  168. X#include <X11/Xlib.h>
  169. X#include <xview/xview.h>
  170. X#include <xview/canvas.h>
  171. X#include <xview/xv_xrect.h>
  172. X
  173. Xmain(argc, argv)
  174. Xint argc;
  175. Xchar *argv[];
  176. X{
  177. X    Frame frame;
  178. X    void  canvas_repaint_proc();
  179. X
  180. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  181. X
  182. X    frame = (Frame)xv_create(NULL, FRAME, NULL);
  183. X
  184. X    (void) xv_create(frame, CANVAS,
  185. X        CANVAS_REPAINT_PROC,    canvas_repaint_proc,
  186. X        CANVAS_X_PAINT_WINDOW,  TRUE,
  187. X        NULL);
  188. X
  189. X    xv_main_loop(frame);
  190. X}
  191. X
  192. X/*
  193. X * repaint routine draws a line from the top left to the bottom right
  194. X * corners of the window
  195. X */
  196. Xvoid
  197. Xcanvas_repaint_proc(canvas, paint_window, dpy, xwin, xrects)
  198. XCanvas        canvas;         /* unused */
  199. XXv_Window     paint_window;   /* unused */
  200. XDisplay      *dpy;
  201. XWindow        xwin;
  202. XXv_xrectlist *xrects;         /* unused */
  203. X{
  204. X    GC gc;
  205. X    int width, height;
  206. X
  207. X    gc = DefaultGC(dpy, DefaultScreen(dpy));
  208. X    width = (int)xv_get(paint_window, XV_WIDTH);
  209. X    height = (int)xv_get(paint_window, XV_HEIGHT);
  210. X
  211. X    XDrawLine(dpy, xwin, gc, 0, 0, width, height);
  212. X}
  213. END_OF_FILE
  214. if test 1250 -ne `wc -c <'xview.demos/canvas/line.c'`; then
  215.     echo shar: \"'xview.demos/canvas/line.c'\" unpacked with wrong size!
  216. fi
  217. # end of 'xview.demos/canvas/line.c'
  218. fi
  219. if test -f 'xview.demos/color/Imakefile' -a "${1}" != "-c" ; then 
  220.   echo shar: Will not clobber existing file \"'xview.demos/color/Imakefile'\"
  221. else
  222. echo shar: Extracting \"'xview.demos/color/Imakefile'\" \(727 characters\)
  223. sed "s/^X//" >'xview.demos/color/Imakefile' <<'END_OF_FILE'
  224. X#
  225. X# @(#)Imakefile 1.3 89/12/06 SMI
  226. X#
  227. X# Imakefile for color
  228. X#
  229. X# LIBRARY_DEST is the location of the XView libraries
  230. X# HEADER_DEST is the location of the XView header files
  231. X# LIBDIR is the directory containing the X11 library (libX11.a)
  232. X#
  233. X
  234. XLIBRARY_DEST=/home/xview/usr/lib
  235. XHEADER_DEST=/home/xview/usr/include
  236. X
  237. XLIBDIR=/home/X11/lib
  238. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  239. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  240. X
  241. X# Uncomment the following line to use libxvol.a and libxvin.a
  242. X#
  243. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  244. X
  245. XTARGETS=color color_animate color_logo color_objs x_draw
  246. XICON= cardback.icon
  247. X
  248. Xall: $(ICON) $(TARGETS)
  249. X
  250. X${TARGETS}: $$@.c $$@.o 
  251. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  252. END_OF_FILE
  253. if test 727 -ne `wc -c <'xview.demos/color/Imakefile'`; then
  254.     echo shar: \"'xview.demos/color/Imakefile'\" unpacked with wrong size!
  255. fi
  256. # end of 'xview.demos/color/Imakefile'
  257. fi
  258. if test -f 'xview.demos/cursor/Imakefile' -a "${1}" != "-c" ; then 
  259.   echo shar: Will not clobber existing file \"'xview.demos/cursor/Imakefile'\"
  260. else
  261. echo shar: Extracting \"'xview.demos/cursor/Imakefile'\" \(686 characters\)
  262. sed "s/^X//" >'xview.demos/cursor/Imakefile' <<'END_OF_FILE'
  263. X#
  264. X# @(#)Imakefile 1.3 89/12/06 SMI
  265. X#
  266. X# Imakefile for cursor
  267. X#
  268. X# LIBRARY_DEST is the location of the XView libraries
  269. X# HEADER_DEST is the location of the XView header files
  270. X# LIBDIR is the directory containing the X11 library (libX11.a)
  271. X#
  272. X
  273. XLIBRARY_DEST=/home/xview/usr/lib
  274. XHEADER_DEST=/home/xview/usr/include
  275. X
  276. XLIBDIR=/home/X11/lib
  277. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  278. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  279. X
  280. X# Uncomment the following line to use libxvol.a and libxvin.a
  281. X#
  282. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  283. X
  284. XTARGETS=hot_spot simple_cursor stop_cursor
  285. X
  286. Xall: $(TARGETS)
  287. X
  288. X${TARGETS}: $$@.c $$@.o 
  289. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  290. END_OF_FILE
  291. if test 686 -ne `wc -c <'xview.demos/cursor/Imakefile'`; then
  292.     echo shar: \"'xview.demos/cursor/Imakefile'\" unpacked with wrong size!
  293. fi
  294. # end of 'xview.demos/cursor/Imakefile'
  295. fi
  296. if test -f 'xview.demos/cursor/simple_cursor.c' -a "${1}" != "-c" ; then 
  297.   echo shar: Will not clobber existing file \"'xview.demos/cursor/simple_cursor.c'\"
  298. else
  299. echo shar: Extracting \"'xview.demos/cursor/simple_cursor.c'\" \(1643 characters\)
  300. sed "s/^X//" >'xview.demos/cursor/simple_cursor.c' <<'END_OF_FILE'
  301. X/*
  302. X * simple_cursor.c -- create a cursor (looks like an hourglass) and
  303. X * assign it to a canvas window.
  304. X */
  305. X#include <xview/xview.h>
  306. X#include <xview/panel.h>
  307. X#include <xview/cursor.h>
  308. X#include <xview/svrimage.h>
  309. X
  310. X/* data that describes the cursor's image -- see SERVER_IMAGE below */
  311. Xshort cursor_bits[] = {
  312. X/* Width=16, Height=16, Depth=1, */
  313. X    0x7FFE,0x4002,0x200C,0x1A38,0x0FF0,0x07E0,0x03C0,0x0180,
  314. X    0x0180,0x0240,0x0520,0x0810,0x1108,0x23C4,0x47E2,0x7FFE
  315. X};
  316. X
  317. Xmain(argc, argv)
  318. Xint argc;
  319. Xchar *argv[];
  320. X{
  321. X    Frame        frame;
  322. X    Canvas       canvas;
  323. X    Xv_Cursor    cursor;
  324. X    Server_image svr_image;
  325. X
  326. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  327. X
  328. X    /*
  329. X     * create a server image to use as the cursor's image.
  330. X     */
  331. X    svr_image = (Server_image)xv_create(XV_NULL, SERVER_IMAGE,
  332. X        XV_WIDTH,               16,
  333. X        XV_HEIGHT,              16,
  334. X        SERVER_IMAGE_BITS,      cursor_bits,
  335. X        NULL);
  336. X    /*
  337. X     * create a cursor based on the image just created
  338. X     */
  339. X    cursor = (Xv_Cursor)xv_create(XV_NULL, CURSOR,
  340. X        CURSOR_IMAGE,           svr_image,
  341. X        NULL);
  342. X
  343. X    /*
  344. X     * Create a base frame and a canvas
  345. X     */
  346. X    frame = (Frame)xv_create(XV_NULL, FRAME, NULL);
  347. X    canvas = (Canvas)xv_create(frame, CANVAS,
  348. X        XV_WIDTH,               100,
  349. X        XV_HEIGHT,              100,
  350. X        NULL);
  351. X    /*
  352. X     * set the cursor to the paint window for the canvas
  353. X     * Do not set it for the canvas itself.
  354. X     */
  355. X    xv_set(xv_get(canvas, CANVAS_NTH_PAINT_WINDOW, 0),
  356. X        WIN_CURSOR,             cursor,
  357. X        NULL);
  358. X
  359. X    window_fit(frame);
  360. X    window_main_loop(frame);
  361. X}
  362. END_OF_FILE
  363. if test 1643 -ne `wc -c <'xview.demos/cursor/simple_cursor.c'`; then
  364.     echo shar: \"'xview.demos/cursor/simple_cursor.c'\" unpacked with wrong size!
  365. fi
  366. # end of 'xview.demos/cursor/simple_cursor.c'
  367. fi
  368. if test -f 'xview.demos/cursor/stop_cursor.c' -a "${1}" != "-c" ; then 
  369.   echo shar: Will not clobber existing file \"'xview.demos/cursor/stop_cursor.c'\"
  370. else
  371. echo shar: Extracting \"'xview.demos/cursor/stop_cursor.c'\" \(1529 characters\)
  372. sed "s/^X//" >'xview.demos/cursor/stop_cursor.c' <<'END_OF_FILE'
  373. X/*
  374. X * color_cursor.c -- create a predefined cursor and assign it to a canvas.
  375. X */
  376. X#include <stdio.h>
  377. X#include <xview/xview.h>
  378. X#include <xview/panel.h>
  379. X#include <xview/cursor.h>
  380. X
  381. Xvoid
  382. Xdo_it(item, event)
  383. X{
  384. X    Rect *r;
  385. X    Panel panel = xv_get(item, PANEL_PARENT_PANEL);
  386. X
  387. X    r = (Rect *)xv_get(xv_get(panel, XV_ROOT), WIN_MOUSE_XY);
  388. X    fprintf(stderr, "Root window: ");
  389. X    rect_print(r);
  390. X    fputc('\n', stderr);
  391. X    r = (Rect *)xv_get(xv_get(panel, CANVAS_NTH_PAINT_WINDOW, 0), WIN_MOUSE_XY);
  392. X    fprintf(stderr, "panel window: ");
  393. X    rect_print(r);
  394. X    fputc('\n', stderr);
  395. X}
  396. X
  397. Xmain(argc, argv)
  398. Xint argc;
  399. Xchar *argv[];
  400. X{
  401. X    Frame        frame;
  402. X    Canvas       canvas;
  403. X    Xv_Cursor    cursor;
  404. X
  405. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv);
  406. X
  407. X    /*
  408. X     * create a cursor based on the image just created
  409. X     */
  410. X    cursor = xv_create(XV_NULL, CURSOR,
  411. X        CURSOR_SRC_CHAR,        OLC_STOP_PTR,
  412. X        NULL);
  413. X
  414. X    /*
  415. X     * Create a base frame and a canvas
  416. X     */
  417. X    frame = xv_create(XV_NULL, FRAME, NULL);
  418. X    canvas = xv_create(frame, PANEL,
  419. X        XV_WIDTH,               100,
  420. X        XV_HEIGHT,              100,
  421. X        NULL);
  422. X    /*
  423. X     * set the cursor to the paint window for the canvas
  424. X     * Do not set it for the canvas itself.
  425. X     */
  426. X    xv_set(xv_get(canvas, CANVAS_NTH_PAINT_WINDOW, 0),
  427. X        WIN_CURSOR,             cursor,
  428. X        NULL);
  429. X    xv_create(canvas, PANEL_BUTTON,
  430. X    PANEL_LABEL_STRING,    "Do It",
  431. X    PANEL_NOTIFY_PROC,    do_it,
  432. X    NULL);
  433. X
  434. X    window_fit(frame);
  435. X    window_main_loop(frame);
  436. X}
  437. END_OF_FILE
  438. if test 1529 -ne `wc -c <'xview.demos/cursor/stop_cursor.c'`; then
  439.     echo shar: \"'xview.demos/cursor/stop_cursor.c'\" unpacked with wrong size!
  440. fi
  441. # end of 'xview.demos/cursor/stop_cursor.c'
  442. fi
  443. if test -f 'xview.demos/defaults/Imakefile' -a "${1}" != "-c" ; then 
  444.   echo shar: Will not clobber existing file \"'xview.demos/defaults/Imakefile'\"
  445. else
  446. echo shar: Extracting \"'xview.demos/defaults/Imakefile'\" \(680 characters\)
  447. sed "s/^X//" >'xview.demos/defaults/Imakefile' <<'END_OF_FILE'
  448. X#
  449. X# @(#)Imakefile 1.3 89/12/06 SMI
  450. X#
  451. X# Imakefile for defaults
  452. X#
  453. X# LIBRARY_DEST is the location of the XView libraries
  454. X# HEADER_DEST is the location of the XView header files
  455. X# LIBDIR is the directory containing the X11 library (libX11.a)
  456. X#
  457. X
  458. XLIBRARY_DEST=/home/xview/usr/lib
  459. XHEADER_DEST=/home/xview/usr/include
  460. X
  461. XLIBDIR=/home/X11/lib
  462. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  463. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  464. X
  465. X# Uncomment the following line to use libxvol.a and libxvin.a
  466. X#
  467. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  468. X
  469. XTARGETS=default_size default_text
  470. X
  471. Xall: $(TARGETS)
  472. X
  473. X${TARGETS}: $$@.c $$@.o 
  474. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  475. END_OF_FILE
  476. if test 680 -ne `wc -c <'xview.demos/defaults/Imakefile'`; then
  477.     echo shar: \"'xview.demos/defaults/Imakefile'\" unpacked with wrong size!
  478. fi
  479. # end of 'xview.demos/defaults/Imakefile'
  480. fi
  481. if test -f 'xview.demos/defaults/default_size.c' -a "${1}" != "-c" ; then 
  482.   echo shar: Will not clobber existing file \"'xview.demos/defaults/default_size.c'\"
  483. else
  484. echo shar: Extracting \"'xview.demos/defaults/default_size.c'\" \(1378 characters\)
  485. sed "s/^X//" >'xview.demos/defaults/default_size.c' <<'END_OF_FILE'
  486. X/*
  487. X * default_scale.c -- demonstrate the use of defaults_get_enum().
  488. X * Specify a table of font scales and query the resource database
  489. X * for legal values.  For example, you may have the following in
  490. X * your .Xdefaults (which must be loaded into the resource database):
  491. X *      font.scale: large
  492. X */
  493. X#include <xview/xview.h>
  494. X#include <xview/font.h>
  495. X#include <xview/defaults.h>
  496. X#include <xview/textsw.h>
  497. X
  498. XDefaults_pairs size_pairs[] = {
  499. X    "small",            WIN_SCALE_SMALL,
  500. X    "medium",           WIN_SCALE_MEDIUM,
  501. X    "large",            WIN_SCALE_LARGE,
  502. X    "extralarge",       WIN_SCALE_EXTRALARGE,
  503. X    /* the NULL entry is the default if Resource not found */
  504. X    NULL,               WIN_SCALE_MEDIUM,
  505. X};
  506. X
  507. Xmain(argc, argv)
  508. Xchar *argv[];
  509. X{
  510. X    Frame       frame;
  511. X    Xv_Font     font;
  512. X    int         scale;
  513. X
  514. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  515. X
  516. X    frame = (Frame)xv_create(NULL, FRAME, NULL);
  517. X
  518. X    scale = defaults_get_enum("font.scale", "Font.Scale", size_pairs);
  519. X    /* get the default font for the frame, scaled to resource */
  520. X    font = xv_find(frame, FONT,
  521. X        FONT_RESCALE_OF,        xv_find(frame, FONT, NULL), scale,
  522. X        NULL);
  523. X
  524. X    xv_create(frame, TEXTSW,
  525. X        XV_FONT,                font,
  526. X        WIN_COLUMNS,            80,
  527. X        WIN_ROWS,               10,
  528. X        NULL);
  529. X
  530. X    window_fit(frame);
  531. X    xv_main_loop(frame);
  532. X}
  533. END_OF_FILE
  534. if test 1378 -ne `wc -c <'xview.demos/defaults/default_size.c'`; then
  535.     echo shar: \"'xview.demos/defaults/default_size.c'\" unpacked with wrong size!
  536. fi
  537. # end of 'xview.demos/defaults/default_size.c'
  538. fi
  539. if test -f 'xview.demos/defaults/default_text.c' -a "${1}" != "-c" ; then 
  540.   echo shar: Will not clobber existing file \"'xview.demos/defaults/default_text.c'\"
  541. else
  542. echo shar: Extracting \"'xview.demos/defaults/default_text.c'\" \(769 characters\)
  543. sed "s/^X//" >'xview.demos/defaults/default_text.c' <<'END_OF_FILE'
  544. X/*
  545. X * default_text.c -- use the defaults package to get a font name from
  546. X * the resource database to set the textsw's font.
  547. X */
  548. X#include <xview/xview.h>
  549. X#include <xview/font.h>
  550. X#include <xview/defaults.h>
  551. X#include <xview/textsw.h>
  552. X
  553. Xmain(argc, argv)
  554. Xchar *argv[];
  555. X{
  556. X    Frame       frame;
  557. X    Xv_Font     font;
  558. X    char        *name;
  559. X
  560. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  561. X
  562. X    frame = (Frame)xv_create(NULL, FRAME, NULL);
  563. X
  564. X    name = defaults_get_string("textsw.font","Textsw.Font", "fixed"),
  565. X    font = xv_find(frame, FONT,
  566. X        FONT_NAME,      name,
  567. X        NULL);
  568. X
  569. X    xv_create(frame, TEXTSW,
  570. X        XV_FONT,        font,
  571. X        WIN_COLUMNS,    80,
  572. X        WIN_ROWS,       10,
  573. X        NULL);
  574. X
  575. X    window_fit(frame);
  576. X    xv_main_loop(frame);
  577. X}
  578. END_OF_FILE
  579. if test 769 -ne `wc -c <'xview.demos/defaults/default_text.c'`; then
  580.     echo shar: \"'xview.demos/defaults/default_text.c'\" unpacked with wrong size!
  581. fi
  582. # end of 'xview.demos/defaults/default_text.c'
  583. fi
  584. if test -f 'xview.demos/fonts/Imakefile' -a "${1}" != "-c" ; then 
  585.   echo shar: Will not clobber existing file \"'xview.demos/fonts/Imakefile'\"
  586. else
  587. echo shar: Extracting \"'xview.demos/fonts/Imakefile'\" \(678 characters\)
  588. sed "s/^X//" >'xview.demos/fonts/Imakefile' <<'END_OF_FILE'
  589. X#
  590. X# @(#)Imakefile 1.3 89/12/06 SMI
  591. X#
  592. X# Imakefile for fonts
  593. X#
  594. X# LIBRARY_DEST is the location of the XView libraries
  595. X# HEADER_DEST is the location of the XView header files
  596. X# LIBDIR is the directory containing the X11 library (libX11.a)
  597. X#
  598. X
  599. XLIBRARY_DEST=/home/xview/usr/lib
  600. XHEADER_DEST=/home/xview/usr/include
  601. X
  602. XLIBDIR=/home/X11/lib
  603. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  604. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  605. X
  606. X# Uncomment the following line to use libxvol.a and libxvin.a
  607. X#
  608. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  609. X
  610. XTARGETS=fonts simple_font type_font
  611. X
  612. Xall: $(TARGETS)
  613. X
  614. X${TARGETS}: $$@.c $$@.o 
  615. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  616. END_OF_FILE
  617. if test 678 -ne `wc -c <'xview.demos/fonts/Imakefile'`; then
  618.     echo shar: \"'xview.demos/fonts/Imakefile'\" unpacked with wrong size!
  619. fi
  620. # end of 'xview.demos/fonts/Imakefile'
  621. fi
  622. if test -f 'xview.demos/frames/Imakefile' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'xview.demos/frames/Imakefile'\"
  624. else
  625. echo shar: Extracting \"'xview.demos/frames/Imakefile'\" \(686 characters\)
  626. sed "s/^X//" >'xview.demos/frames/Imakefile' <<'END_OF_FILE'
  627. X#
  628. X# @(#)Imakefile 1.3 89/12/06 SMI
  629. X#
  630. X# Imakefile for frames
  631. X#
  632. X# LIBRARY_DEST is the location of the XView libraries
  633. X# HEADER_DEST is the location of the XView header files
  634. X# LIBDIR is the directory containing the X11 library (libX11.a)
  635. X#
  636. X
  637. XLIBRARY_DEST=/home/xview/usr/lib
  638. XHEADER_DEST=/home/xview/usr/include
  639. X
  640. XLIBDIR=/home/X11/lib
  641. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  642. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  643. X
  644. X# Uncomment the following line to use libxvol.a and libxvin.a
  645. X#
  646. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  647. X
  648. XTARGETS=frame_color simple_frame subframe
  649. X
  650. Xall: $(TARGETS)
  651. X
  652. X${TARGETS}: $$@.c $$@.o 
  653. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  654. END_OF_FILE
  655. if test 686 -ne `wc -c <'xview.demos/frames/Imakefile'`; then
  656.     echo shar: \"'xview.demos/frames/Imakefile'\" unpacked with wrong size!
  657. fi
  658. # end of 'xview.demos/frames/Imakefile'
  659. fi
  660. if test -f 'xview.demos/icons/icon_demo.c' -a "${1}" != "-c" ; then 
  661.   echo shar: Will not clobber existing file \"'xview.demos/icons/icon_demo.c'\"
  662. else
  663. echo shar: Extracting \"'xview.demos/icons/icon_demo.c'\" \(1789 characters\)
  664. sed "s/^X//" >'xview.demos/icons/icon_demo.c' <<'END_OF_FILE'
  665. X/*
  666. X * icon_demo.c -- demonstrate how an icon is used.  Create a server
  667. X * image and create an icon object with the image as the ICON_IMAGE.
  668. X * Use the icon as the frame's icon.
  669. X */
  670. X#include <xview/xview.h>
  671. X#include <xview/panel.h>
  672. X#include <xview/svrimage.h>
  673. X#include <xview/icon.h>
  674. X
  675. Xshort open_bits[] =  {
  676. X#include "open.icon"
  677. X};
  678. X
  679. Xshort closed_bits[] =  {
  680. X#include "closed.icon"
  681. X};
  682. X
  683. Xmain(argc, argv)
  684. Xint     argc;
  685. Xchar    *argv[];
  686. X{
  687. X    Frame               frame;
  688. X    Panel               panel;
  689. X    Server_image        open_image, closed_image;
  690. X    Icon                icon;
  691. X    void                close_frame();
  692. X
  693. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  694. X
  695. X    frame = (Frame)xv_create(XV_NULL, FRAME, NULL);
  696. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  697. X
  698. X    open_image = (Server_image)xv_create(NULL, SERVER_IMAGE,
  699. X        XV_WIDTH,               64,
  700. X        XV_HEIGHT,              64,
  701. X        SERVER_IMAGE_BITS,      open_bits,
  702. X        NULL);
  703. X
  704. X    closed_image = (Server_image)xv_create(NULL, SERVER_IMAGE,
  705. X        XV_WIDTH,               64,
  706. X        XV_HEIGHT,              64,
  707. X        SERVER_IMAGE_BITS,      closed_bits,
  708. X        NULL);
  709. X
  710. X    (void) xv_create(panel, PANEL_BUTTON,
  711. X        PANEL_LABEL_IMAGE,      open_image,
  712. X        PANEL_NOTIFY_PROC,      close_frame,
  713. X        NULL);
  714. X
  715. X    icon = (Icon)xv_create(frame, ICON,
  716. X        ICON_IMAGE,             closed_image,
  717. X        XV_X,                   100,
  718. X        XV_Y,                   100,
  719. X        NULL);
  720. X    xv_set(frame, FRAME_ICON, icon, NULL);
  721. X
  722. X    window_fit(panel);
  723. X    window_fit(frame);
  724. X    xv_main_loop(frame);
  725. X}
  726. X
  727. Xvoid
  728. Xclose_frame(item, event)
  729. XPanel_item item;
  730. XEvent *event;
  731. X{
  732. X    Frame       frame = xv_get(xv_get(item, PANEL_PARENT_PANEL), XV_OWNER);
  733. X    xv_set(frame, FRAME_CLOSED, TRUE, NULL);
  734. X}
  735. END_OF_FILE
  736. if test 1789 -ne `wc -c <'xview.demos/icons/icon_demo.c'`; then
  737.     echo shar: \"'xview.demos/icons/icon_demo.c'\" unpacked with wrong size!
  738. fi
  739. # end of 'xview.demos/icons/icon_demo.c'
  740. fi
  741. if test -f 'xview.demos/icons/open.icon' -a "${1}" != "-c" ; then 
  742.   echo shar: Will not clobber existing file \"'xview.demos/icons/open.icon'\"
  743. else
  744. echo shar: Extracting \"'xview.demos/icons/open.icon'\" \(1933 characters\)
  745. sed "s/^X//" >'xview.demos/icons/open.icon' <<'END_OF_FILE'
  746. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  747. X */
  748. X    0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFF00,
  749. X    0x0080,0x0000,0x0000,0x0100,0x009F,0xFFFF,0xFFFF,0xF900,
  750. X    0x0090,0x0002,0x4000,0x0900,0x0090,0x0002,0x4000,0x0900,
  751. X    0x0090,0x0002,0x4000,0x0900,0x0090,0x0042,0x4000,0x0900,
  752. X    0x0090,0x1082,0x4021,0x0900,0x0090,0x2102,0x4042,0x0900,
  753. X    0x0090,0x4202,0x4084,0x0900,0x0090,0x8402,0x4108,0x0900,
  754. X    0x0091,0x0802,0x4210,0x0900,0x0090,0x1042,0x4020,0x8900,
  755. X    0x0090,0x2082,0x4041,0x0900,0x0090,0x4102,0x4082,0x0900,
  756. X    0x0090,0x8202,0x4104,0x0900,0x0091,0x0402,0x4208,0x0900,
  757. X    0x0090,0x0802,0x4010,0x0900,0x0090,0x0002,0x4000,0x0900,
  758. X    0x0090,0x0002,0x4000,0x0900,0x0090,0x0002,0x4000,0x0900,
  759. X    0x0090,0x0002,0x4000,0x0900,0x0090,0x0002,0x4000,0x0900,
  760. X    0x0090,0x0002,0x4000,0x0900,0x009F,0xFFFE,0x7FFF,0xF900,
  761. X    0x0090,0x0000,0x0000,0x0900,0x0090,0x001F,0xF800,0x0900,
  762. X    0x0090,0x001F,0xF800,0x0900,0x0090,0x0000,0x0000,0x0900,
  763. X    0x009F,0xFFFF,0xFFFF,0xF900,0x0090,0x0000,0x0000,0x0900,
  764. X    0x0090,0x0000,0x0000,0x0900,0x0090,0x0000,0x0000,0x0900,
  765. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900,
  766. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900,
  767. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900,
  768. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900,
  769. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900,
  770. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x001F,0xF000,0x0900,
  771. X    0x0090,0x000F,0xE000,0x0900,0x0090,0x0007,0xC000,0x0900,
  772. X    0x0090,0x0003,0x8000,0x0900,0x0090,0x0001,0x0000,0x0900,
  773. X    0x0090,0x0000,0x0000,0x0900,0x009F,0xFFFF,0xFFFF,0xF900,
  774. X    0x0080,0x0000,0x0000,0x0100,0x0080,0x0000,0x0000,0x0100,
  775. X    0x00FF,0xFFFF,0xFFFF,0xFF00,0x0000,0x0000,0x0000,0x0000,
  776. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  777. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  778. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  779. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  780. END_OF_FILE
  781. if test 1933 -ne `wc -c <'xview.demos/icons/open.icon'`; then
  782.     echo shar: \"'xview.demos/icons/open.icon'\" unpacked with wrong size!
  783. fi
  784. # end of 'xview.demos/icons/open.icon'
  785. fi
  786. if test -f 'xview.demos/menus/Imakefile' -a "${1}" != "-c" ; then 
  787.   echo shar: Will not clobber existing file \"'xview.demos/menus/Imakefile'\"
  788. else
  789. echo shar: Extracting \"'xview.demos/menus/Imakefile'\" \(704 characters\)
  790. sed "s/^X//" >'xview.demos/menus/Imakefile' <<'END_OF_FILE'
  791. X#
  792. X# @(#)Imakefile 1.3 89/12/06 SMI
  793. X#
  794. X# Imakefile for menus
  795. X#
  796. X# LIBRARY_DEST is the location of the XView libraries
  797. X# HEADER_DEST is the location of the XView header files
  798. X# LIBDIR is the directory containing the X11 library (libX11.a)
  799. X#
  800. X
  801. XLIBRARY_DEST=/home/xview/usr/lib
  802. XHEADER_DEST=/home/xview/usr/include
  803. X
  804. XLIBDIR=/home/X11/lib
  805. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  806. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  807. X
  808. X# Uncomment the following line to use libxvol.a and libxvin.a
  809. X#
  810. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  811. X
  812. XTARGETS=menu menu_dir menu_dir2 pin_menu simple_menu xv_menu
  813. X
  814. Xall: $(TARGETS)
  815. X
  816. X${TARGETS}: $$@.c $$@.o 
  817. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  818. X
  819. END_OF_FILE
  820. if test 704 -ne `wc -c <'xview.demos/menus/Imakefile'`; then
  821.     echo shar: \"'xview.demos/menus/Imakefile'\" unpacked with wrong size!
  822. fi
  823. # end of 'xview.demos/menus/Imakefile'
  824. fi
  825. if test -f 'xview.demos/misc/Imakefile' -a "${1}" != "-c" ; then 
  826.   echo shar: Will not clobber existing file \"'xview.demos/misc/Imakefile'\"
  827. else
  828. echo shar: Extracting \"'xview.demos/misc/Imakefile'\" \(689 characters\)
  829. sed "s/^X//" >'xview.demos/misc/Imakefile' <<'END_OF_FILE'
  830. X#
  831. X# @(#)Imakefile 1.3 89/12/06 SMI
  832. X#
  833. X# Imakefile for misc
  834. X#
  835. X# LIBRARY_DEST is the location of the XView libraries
  836. X# HEADER_DEST is the location of the XView header files
  837. X# LIBDIR is the directory containing the X11 library (libX11.a)
  838. X#
  839. X
  840. XLIBRARY_DEST=/home/xview/usr/lib
  841. XHEADER_DEST=/home/xview/usr/include
  842. X
  843. XLIBDIR=/home/X11/lib
  844. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  845. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  846. X
  847. X# Uncomment the following line to use libxvol.a and libxvin.a
  848. X#
  849. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  850. X
  851. XTARGETS=drag_n_drop fullscreen screen svrimage
  852. X
  853. Xall: $(TARGETS)
  854. X
  855. X${TARGETS}: $$@.c $$@.o 
  856. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  857. END_OF_FILE
  858. if test 689 -ne `wc -c <'xview.demos/misc/Imakefile'`; then
  859.     echo shar: \"'xview.demos/misc/Imakefile'\" unpacked with wrong size!
  860. fi
  861. # end of 'xview.demos/misc/Imakefile'
  862. fi
  863. if test -f 'xview.demos/misc/screen.c' -a "${1}" != "-c" ; then 
  864.   echo shar: Will not clobber existing file \"'xview.demos/misc/screen.c'\"
  865. else
  866. echo shar: Extracting \"'xview.demos/misc/screen.c'\" \(864 characters\)
  867. sed "s/^X//" >'xview.demos/misc/screen.c' <<'END_OF_FILE'
  868. X/*
  869. X * screen.c -- get some simple info about the current screen:
  870. X * width, height, depth.
  871. X */
  872. X#include <X11/Xlib.h>
  873. X#include <xview/xview.h>
  874. X#include <xview/screen.h>
  875. X
  876. Xmain(argc, argv)
  877. Xint     argc;
  878. Xchar    *argv[];
  879. X{
  880. X    Frame               frame;
  881. X    Xv_Screen           screen;
  882. X    Display             *dpy;
  883. X    int                 screen_no;
  884. X
  885. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  886. X
  887. X    frame = (Frame)xv_create(XV_NULL, FRAME, NULL);
  888. X
  889. X    dpy = (Display *)xv_get(frame, XV_DISPLAY);
  890. X    printf("Server display = '%s'\n", dpy->vendor);
  891. X    screen = (Xv_Screen)xv_get(frame, XV_SCREEN);
  892. X
  893. X    screen_no = (int)xv_get(screen, SCREEN_NUMBER);
  894. X    printf("Screen #%d:\n\twidth: %d\n\theight: %d\n\tdepth: %d\n",
  895. X        screen_no,
  896. X        DisplayWidth(dpy, screen_no),
  897. X        DisplayHeight(dpy, screen_no),
  898. X        DefaultDepth(dpy, screen_no));
  899. X}
  900. END_OF_FILE
  901. if test 864 -ne `wc -c <'xview.demos/misc/screen.c'`; then
  902.     echo shar: \"'xview.demos/misc/screen.c'\" unpacked with wrong size!
  903. fi
  904. # end of 'xview.demos/misc/screen.c'
  905. fi
  906. if test -f 'xview.demos/misc/svrimage.c' -a "${1}" != "-c" ; then 
  907.   echo shar: Will not clobber existing file \"'xview.demos/misc/svrimage.c'\"
  908. else
  909. echo shar: Extracting \"'xview.demos/misc/svrimage.c'\" \(1506 characters\)
  910. sed "s/^X//" >'xview.demos/misc/svrimage.c' <<'END_OF_FILE'
  911. X/*
  912. X * svrimage.c -- demonstrate how a server image can be created and used.
  913. X * The "bits" used to create the image are taken arbitrarily from
  914. X * <images/trash.icon>
  915. X */
  916. X#include <xview/xview.h>
  917. X#include <xview/panel.h>
  918. X#include <xview/svrimage.h>
  919. X#include <X11/Xlib.h>
  920. X
  921. Xshort image_bits[] =  {
  922. X    0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000,
  923. X    0x0007,0xE000, 0x0004,0x2000, 0x03FF,0xFFC0, 0x0200,0x0040,
  924. X    0x02FF,0xFF40, 0x0080,0x0100, 0x00AA,0xAB00, 0x00AA,0xAB00,
  925. X    0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00,
  926. X    0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00,
  927. X    0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00,
  928. X    0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x0091,0x1300,
  929. X    0x00C0,0x0200, 0x003F,0xFC00
  930. X};
  931. X
  932. Xmain(argc, argv)
  933. Xint     argc;
  934. Xchar    *argv[];
  935. X{
  936. X    Frame               frame;
  937. X    Server_image        image;
  938. X    Panel               panel;
  939. X    void                exit();
  940. X
  941. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  942. X
  943. X    image = (Server_image)xv_create(NULL, SERVER_IMAGE,
  944. X        XV_WIDTH,               32,
  945. X        XV_HEIGHT,              30,
  946. X        SERVER_IMAGE_BITS,      image_bits,
  947. X        NULL);
  948. X
  949. X    frame = (Frame)xv_create(NULL, FRAME, NULL);
  950. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  951. X    (void) xv_create(panel, PANEL_BUTTON,
  952. X        PANEL_LABEL_IMAGE,      image,
  953. X        PANEL_NOTIFY_PROC,      exit,
  954. X        NULL);
  955. X
  956. X    window_fit(panel);
  957. X    window_fit(frame);
  958. X    xv_main_loop(frame);
  959. X}
  960. END_OF_FILE
  961. if test 1506 -ne `wc -c <'xview.demos/misc/svrimage.c'`; then
  962.     echo shar: \"'xview.demos/misc/svrimage.c'\" unpacked with wrong size!
  963. fi
  964. # end of 'xview.demos/misc/svrimage.c'
  965. fi
  966. if test -f 'xview.demos/misc/type_to_string.c' -a "${1}" != "-c" ; then 
  967.   echo shar: Will not clobber existing file \"'xview.demos/misc/type_to_string.c'\"
  968. else
  969. echo shar: Extracting \"'xview.demos/misc/type_to_string.c'\" \(1283 characters\)
  970. sed "s/^X//" >'xview.demos/misc/type_to_string.c' <<'END_OF_FILE'
  971. X/*
  972. X * a useful library routine for getting the type of an XView object.
  973. X * Typical use:
  974. X *    printf("object is: %s\n", type_to_string(xv_get(obj, XV_TYPE)));
  975. X */
  976. X#include <xview/xview.h>
  977. X#include <xview/textsw.h>
  978. X#include <xview/panel.h>
  979. X#include <xview/server.h>
  980. X#include <xview/font.h>
  981. X#include <xview/svrimage.h>
  982. X#include <xview/termsw.h>
  983. X#include <xview/ttysw.h>
  984. X#include <xview/tty.h>
  985. X#include <xview/text.h>
  986. X
  987. Xchar *
  988. Xtype_to_string(type)
  989. Xlong type;
  990. X{
  991. X    static char *sprintf(), buf[32];
  992. X    switch (type) {
  993. X    case CANVAS_TYPE : return "canvas";
  994. X    case FONT_TYPE : return "font";
  995. X    case FRAME_TYPE : return "frame";
  996. X    case ICON_TYPE : return "icon";
  997. X    case MENU_TYPE : return "menu";
  998. X    case PANEL_TYPE : return "panel";
  999. X    case SCREEN_TYPE : return "screen";
  1000. X    case SERVER_IMAGE_TYPE : return "server image";
  1001. X    case TERMSW_TYPE : return "term";
  1002. X    case TERMSW_VIEW_TYPE : return "termsw view";
  1003. X    case TERMSW_MODE_TYPE : return "termsw mode";
  1004. X    case TTYSW_MODE_TYPE : return "ttysw mode";
  1005. X    case TEXTSW_TYPE : return "text subwindow";
  1006. X    case TTY_VIEW_TYPE : return "tty view";
  1007. X    case TTY_TYPE : return "tty";
  1008. X    case WINDOW_TYPE : return "window";
  1009. X    case WIN_MESSAGE_TYPE : return "win message";
  1010. X    case WIN_TYPE : return "win";
  1011. X    default :
  1012. X        return sprintf(buf, "%x: Unknown type", type);
  1013. X    }
  1014. X}
  1015. END_OF_FILE
  1016. if test 1283 -ne `wc -c <'xview.demos/misc/type_to_string.c'`; then
  1017.     echo shar: \"'xview.demos/misc/type_to_string.c'\" unpacked with wrong size!
  1018. fi
  1019. # end of 'xview.demos/misc/type_to_string.c'
  1020. fi
  1021. if test -f 'xview.demos/notice/Imakefile' -a "${1}" != "-c" ; then 
  1022.   echo shar: Will not clobber existing file \"'xview.demos/notice/Imakefile'\"
  1023. else
  1024. echo shar: Extracting \"'xview.demos/notice/Imakefile'\" \(688 characters\)
  1025. sed "s/^X//" >'xview.demos/notice/Imakefile' <<'END_OF_FILE'
  1026. X#
  1027. X# @(#)Imakefile 1.3 89/12/06 SMI
  1028. X#
  1029. X# Imakefile for notice
  1030. X#
  1031. X# LIBRARY_DEST is the location of the XView libraries
  1032. X# HEADER_DEST is the location of the XView header files
  1033. X# LIBDIR is the directory containing the X11 library (libX11.a)
  1034. X#
  1035. X
  1036. XLIBRARY_DEST=/home/xview/usr/lib
  1037. XHEADER_DEST=/home/xview/usr/include
  1038. X
  1039. XLIBDIR=/home/X11/lib
  1040. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  1041. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  1042. X
  1043. X# Uncomment the following line to use libxvol.a and libxvin.a
  1044. X#
  1045. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  1046. X
  1047. XTARGETS=notice simple_notice trigger_notice
  1048. X
  1049. Xall: $(TARGETS)
  1050. X
  1051. X${TARGETS}: $$@.c $$@.o 
  1052. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  1053. END_OF_FILE
  1054. if test 688 -ne `wc -c <'xview.demos/notice/Imakefile'`; then
  1055.     echo shar: \"'xview.demos/notice/Imakefile'\" unpacked with wrong size!
  1056. fi
  1057. # end of 'xview.demos/notice/Imakefile'
  1058. fi
  1059. if test -f 'xview.demos/notice/simple_notice.c' -a "${1}" != "-c" ; then 
  1060.   echo shar: Will not clobber existing file \"'xview.demos/notice/simple_notice.c'\"
  1061. else
  1062. echo shar: Extracting \"'xview.demos/notice/simple_notice.c'\" \(1724 characters\)
  1063. sed "s/^X//" >'xview.demos/notice/simple_notice.c' <<'END_OF_FILE'
  1064. X/*
  1065. X * simple_notice.c -- Demonstrate the use of notices.
  1066. X */
  1067. X#include <xview/xview.h>
  1068. X#include <xview/panel.h>
  1069. X#include <xview/notice.h>
  1070. X
  1071. Xmain(argc,argv)
  1072. Xint     argc;
  1073. Xchar    *argv[];
  1074. X{
  1075. X    Frame       frame;
  1076. X    Panel       panel;
  1077. X    Xv_opaque   my_notify_proc();
  1078. X
  1079. X    /*
  1080. X     * Initialize XView, create a frame, a panel and one panel button.
  1081. X     */
  1082. X    xv_init(XV_INIT_ARGS, argc, argv, NULL);
  1083. X
  1084. X    frame = (Frame)xv_create(XV_NULL, FRAME, NULL);
  1085. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  1086. X    xv_create(panel, PANEL_BUTTON,
  1087. X        PANEL_LABEL_STRING,     "Quit",
  1088. X        PANEL_NOTIFY_PROC,      my_notify_proc,
  1089. X        NULL);
  1090. X
  1091. X    /* make sure everything looks good */
  1092. X    window_fit(panel);
  1093. X    window_fit(frame);
  1094. X
  1095. X    /* start window event processing */
  1096. X    xv_main_loop(frame);
  1097. X}
  1098. X
  1099. X/*
  1100. X * my_notify_proc() -- called when the user selects the Quit button.
  1101. X *      The notice appears as a result of notice_prompt().  Here
  1102. X *      the user must chooses YES or NO to confirm or deny quitting.
  1103. X */
  1104. XXv_opaque
  1105. Xmy_notify_proc(item, event)
  1106. XPanel_item  item;
  1107. XEvent      *event;
  1108. X{
  1109. X    int         result;
  1110. X    Panel       panel = (Panel)xv_get(item, PANEL_PARENT_PANEL);
  1111. X    Window      win;
  1112. X    Window      root = (Window)xv_get(xv_get(panel, XV_ROOT), XV_XID);
  1113. X    int         x, y;
  1114. X
  1115. X    XTranslateCoordinates(xv_get(panel, XV_DISPLAY),
  1116. X        xv_get(panel, XV_XID), root, event_x(event), event_y(event),
  1117. X        &x, &y, &win);
  1118. X
  1119. X    result = notice_prompt(panel, NULL,
  1120. X        NOTICE_MESSAGE_STRINGS, "Do you really want to quit?", NULL,
  1121. X        NOTICE_FOCUS_XY,        x, y,
  1122. X        NOTICE_BUTTON_YES,      "Yes",
  1123. X        NOTICE_BUTTON_NO,       "No",
  1124. X        NULL);
  1125. X
  1126. X    if (result == NOTICE_YES)
  1127. X        exit(0);
  1128. X}
  1129. END_OF_FILE
  1130. if test 1724 -ne `wc -c <'xview.demos/notice/simple_notice.c'`; then
  1131.     echo shar: \"'xview.demos/notice/simple_notice.c'\" unpacked with wrong size!
  1132. fi
  1133. # end of 'xview.demos/notice/simple_notice.c'
  1134. fi
  1135. if test -f 'xview.demos/notifier/Imakefile' -a "${1}" != "-c" ; then 
  1136.   echo shar: Will not clobber existing file \"'xview.demos/notifier/Imakefile'\"
  1137. else
  1138. echo shar: Extracting \"'xview.demos/notifier/Imakefile'\" \(716 characters\)
  1139. sed "s/^X//" >'xview.demos/notifier/Imakefile' <<'END_OF_FILE'
  1140. X#
  1141. X# @(#)Imakefile 1.3 89/12/06 SMI
  1142. X#
  1143. X# Imakefile for notifier
  1144. X#
  1145. X# LIBRARY_DEST is the location of the XView libraries
  1146. X# HEADER_DEST is the location of the XView header files
  1147. X# LIBDIR is the directory containing the X11 library (libX11.a)
  1148. X#
  1149. X
  1150. XLIBRARY_DEST=/home/xview/usr/lib
  1151. XHEADER_DEST=/home/xview/usr/include
  1152. X
  1153. XLIBDIR=/home/X11/lib
  1154. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  1155. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  1156. X
  1157. X# Uncomment the following line to use libxvol.a and libxvin.a
  1158. X#
  1159. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  1160. X
  1161. XTARGETS=animate interpose notify_input ntfy_do_dis ntfy_pipe ntfy_sig
  1162. X
  1163. Xall: $(TARGETS)
  1164. X
  1165. X${TARGETS}: $$@.c $$@.o 
  1166. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  1167. END_OF_FILE
  1168. if test 716 -ne `wc -c <'xview.demos/notifier/Imakefile'`; then
  1169.     echo shar: \"'xview.demos/notifier/Imakefile'\" unpacked with wrong size!
  1170. fi
  1171. # end of 'xview.demos/notifier/Imakefile'
  1172. fi
  1173. if test -f 'xview.demos/notifier/interpose.c' -a "${1}" != "-c" ; then 
  1174.   echo shar: Will not clobber existing file \"'xview.demos/notifier/interpose.c'\"
  1175. else
  1176. echo shar: Extracting \"'xview.demos/notifier/interpose.c'\" \(1551 characters\)
  1177. sed "s/^X//" >'xview.demos/notifier/interpose.c' <<'END_OF_FILE'
  1178. X/*
  1179. X * interpose.c -- shows how to use an interpose destroy function
  1180. X */
  1181. X#include <xview/xview.h>
  1182. X#include <xview/frame.h>
  1183. X#include <xview/panel.h>
  1184. X#include <xview/notice.h>
  1185. X
  1186. XFrame frame;
  1187. X
  1188. XNotify_value
  1189. Xdestroy_func(client, status)
  1190. XNotify_client client;
  1191. XDestroy_status status;
  1192. X{
  1193. X    if (status == DESTROY_CHECKING) {
  1194. X        int answer = notice_prompt(client, NULL,
  1195. X            NOTICE_MESSAGE_STRINGS, "Really Quit?", NULL,
  1196. X            NOTICE_BUTTON_YES,  "No",
  1197. X            NOTICE_BUTTON_NO,   "Yes",
  1198. X            NULL);
  1199. X        if (answer == NOTICE_YES)
  1200. X            notify_veto_destroy(client);
  1201. X    } else if (status == DESTROY_CLEANUP) {
  1202. X        puts("cleaning up");
  1203. X        /* allow frame to be destroyed */
  1204. X        return notify_next_destroy_func(client, status);
  1205. X    } else if (status == DESTROY_SAVE_YOURSELF)
  1206. X        puts("save yourself?");
  1207. X    else
  1208. X        puts("process death");
  1209. X    return NOTIFY_DONE;
  1210. X}
  1211. X
  1212. Xmain (argc, argv)
  1213. Xint argc;
  1214. Xchar *argv[];
  1215. X{
  1216. X    Panel panel;
  1217. X    int   quit();
  1218. X
  1219. X    xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1220. X
  1221. X    frame = (Frame)xv_create (NULL, FRAME,
  1222. X        FRAME_LABEL,    argv[0],
  1223. X        XV_WIDTH,       200,
  1224. X        XV_HEIGHT,      100,
  1225. X        NULL);
  1226. X    notify_interpose_destroy_func(frame, destroy_func);
  1227. X
  1228. X    panel = (Panel)xv_create (frame, PANEL, NULL);
  1229. X    (void) xv_create (panel, PANEL_BUTTON,
  1230. X            PANEL_LABEL_STRING,         "Quit",
  1231. X            PANEL_NOTIFY_PROC,          quit,
  1232. X            NULL);
  1233. X    xv_main_loop(frame);
  1234. X}
  1235. X
  1236. Xint
  1237. Xquit()
  1238. X{
  1239. X    xv_destroy_safe(frame);
  1240. X    return XV_OK;
  1241. X}
  1242. END_OF_FILE
  1243. if test 1551 -ne `wc -c <'xview.demos/notifier/interpose.c'`; then
  1244.     echo shar: \"'xview.demos/notifier/interpose.c'\" unpacked with wrong size!
  1245. fi
  1246. # end of 'xview.demos/notifier/interpose.c'
  1247. fi
  1248. if test -f 'xview.demos/notifier/notify_input.c' -a "${1}" != "-c" ; then 
  1249.   echo shar: Will not clobber existing file \"'xview.demos/notifier/notify_input.c'\"
  1250. else
  1251. echo shar: Extracting \"'xview.demos/notifier/notify_input.c'\" \(1572 characters\)
  1252. sed "s/^X//" >'xview.demos/notifier/notify_input.c' <<'END_OF_FILE'
  1253. X/*
  1254. X * notify_input.c -- use notify_set_input_func to monitor the state of
  1255. X * a file.  The notifier is running and checking the file descriptors
  1256. X * of the opened files associated with the command line args.  The
  1257. X * routine installed by notify_set_input_func() is called whenever
  1258. X * there is data to be read.  When there is no more data to be read
  1259. X * for that file, the input function is unregistered.  When all files
  1260. X * have been read, notify_start() returns and the program exits.
  1261. X */
  1262. X#include <stdio.h>
  1263. X#include <sys/ioctl.h>
  1264. X#include <xview/notify.h>
  1265. X
  1266. Xmain(argc, argv)
  1267. Xchar *argv[];
  1268. X{
  1269. X    Notify_value   read_it();
  1270. X    Notify_client  client = (Notify_client)10101; /* arbitrary */
  1271. X    FILE           *fp;
  1272. X
  1273. X    while (*++argv)
  1274. X        if (!(fp = fopen(*argv, "r")))
  1275. X            perror(*argv);
  1276. X        else {
  1277. X            (void) notify_set_input_func(client, read_it, fileno(fp));
  1278. X            client++; /* next client is new/unique */
  1279. X        }
  1280. X
  1281. X    /* loops continuously */
  1282. X    notify_start();
  1283. X}
  1284. X
  1285. X/*
  1286. X * read_it() is called whenever there is input to be read.  Actually,
  1287. X * it's called continuously, so check to see if there is input to be
  1288. X * read first.
  1289. X */
  1290. XNotify_value
  1291. Xread_it(client, fd)
  1292. XNotify_client   client;
  1293. Xint fd;
  1294. X{
  1295. X    char buf[BUFSIZ];
  1296. X    int bytes, i;
  1297. X
  1298. X    if (ioctl(fd, FIONREAD, &bytes) == -1 || bytes == 0)
  1299. X        (void) notify_set_input_func(client, NOTIFY_FUNC_NULL, fd);
  1300. X    else
  1301. X        do
  1302. X            if ((i = read(fd, buf, sizeof buf)) > 0)
  1303. X                (void) write(1, buf, i);
  1304. X        while (i > 0 && bytes -= i > 0);
  1305. X    return NOTIFY_DONE;
  1306. X}
  1307. END_OF_FILE
  1308. if test 1572 -ne `wc -c <'xview.demos/notifier/notify_input.c'`; then
  1309.     echo shar: \"'xview.demos/notifier/notify_input.c'\" unpacked with wrong size!
  1310. fi
  1311. # end of 'xview.demos/notifier/notify_input.c'
  1312. fi
  1313. if test -f 'xview.demos/notifier/ntfy_do_dis.c' -a "${1}" != "-c" ; then 
  1314.   echo shar: Will not clobber existing file \"'xview.demos/notifier/ntfy_do_dis.c'\"
  1315. else
  1316. echo shar: Extracting \"'xview.demos/notifier/ntfy_do_dis.c'\" \(1534 characters\)
  1317. sed "s/^X//" >'xview.demos/notifier/ntfy_do_dis.c' <<'END_OF_FILE'
  1318. X/*
  1319. X * ntfy_do_dis.c -- show an example of implicit notifier dispatching
  1320. X * by calling notify_do_dispatch().  Create a frame, panel and "Quit"
  1321. X * button, and then loop on calls to read() from stdin.  Event
  1322. X * processing is still maintained because the Notifier uses it's own
  1323. X * non-blocking read().
  1324. X */
  1325. X#include <stdio.h>
  1326. X#include <xview/xview.h>
  1327. X#include <xview/frame.h>
  1328. X#include <xview/panel.h>
  1329. X
  1330. XFrame frame;
  1331. X
  1332. Xmain (argc, argv)
  1333. Xint argc;
  1334. Xchar *argv[];
  1335. X{
  1336. X    Panel panel;
  1337. X    char  buf[BUFSIZ];
  1338. X    int   n, quit();
  1339. X
  1340. X    xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1341. X
  1342. X    frame = (Frame)xv_create (NULL, FRAME,
  1343. X        FRAME_LABEL,    argv[0],
  1344. X        XV_WIDTH,       200,
  1345. X        XV_HEIGHT,      100,
  1346. X        XV_SHOW,        TRUE,
  1347. X        NULL);
  1348. X
  1349. X    panel = (Panel)xv_create (frame, PANEL, NULL);
  1350. X
  1351. X    (void) xv_create (panel, PANEL_BUTTON,
  1352. X            PANEL_LABEL_STRING,         "Quit",
  1353. X            PANEL_NOTIFY_PROC,          quit,
  1354. X            NULL);
  1355. X
  1356. X    /* Force the frame to be displayed by flushing the server */
  1357. X    XFlush(xv_get(frame, XV_DISPLAY));
  1358. X
  1359. X    /* tell the Notifier that it should use its own read() so that it
  1360. X     * can also detect and dispatch events.  This allows us to loop
  1361. X     * in this code segment and still process events.
  1362. X     */
  1363. X    notify_do_dispatch();
  1364. X
  1365. X    puts("Frame being displayed -- type away.");
  1366. X    while ((n = read(0, buf, sizeof buf)) >= 0)
  1367. X        printf("read %d bytes\n", n);
  1368. X
  1369. X    printf("read() returned %d\n", n);
  1370. X}
  1371. X
  1372. Xint
  1373. Xquit()
  1374. X{
  1375. X    xv_destroy_safe(frame);
  1376. X    return XV_OK;
  1377. X}
  1378. END_OF_FILE
  1379. if test 1534 -ne `wc -c <'xview.demos/notifier/ntfy_do_dis.c'`; then
  1380.     echo shar: \"'xview.demos/notifier/ntfy_do_dis.c'\" unpacked with wrong size!
  1381. fi
  1382. # end of 'xview.demos/notifier/ntfy_do_dis.c'
  1383. fi
  1384. if test -f 'xview.demos/notifier/ntfy_sig.c' -a "${1}" != "-c" ; then 
  1385.   echo shar: Will not clobber existing file \"'xview.demos/notifier/ntfy_sig.c'\"
  1386. else
  1387. echo shar: Extracting \"'xview.demos/notifier/ntfy_sig.c'\" \(993 characters\)
  1388. sed "s/^X//" >'xview.demos/notifier/ntfy_sig.c' <<'END_OF_FILE'
  1389. X/*
  1390. X * ntfy_sig.c -- shows how to catch signals using the notifier
  1391. X */
  1392. X#include <xview/xview.h>
  1393. X#include <xview/frame.h>
  1394. X#include <xview/panel.h>
  1395. X
  1396. XFrame frame;
  1397. X
  1398. XNotify_value
  1399. Xsigint_handler(client, sig, when)
  1400. XNotify_client client;
  1401. Xint sig;
  1402. X{
  1403. X    printf("Received signal %d\n", sig);
  1404. X    return NOTIFY_DONE;
  1405. X}
  1406. X
  1407. Xmain (argc, argv)
  1408. Xint argc;
  1409. Xchar *argv[];
  1410. X{
  1411. X    Panel panel;
  1412. X    char  buf[BUFSIZ];
  1413. X    int   n, quit();
  1414. X
  1415. X    xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1416. X
  1417. X    frame = (Frame)xv_create (NULL, FRAME,
  1418. X        FRAME_LABEL,    argv[0],
  1419. X        XV_WIDTH,       200,
  1420. X        XV_HEIGHT,      100,
  1421. X        NULL);
  1422. X
  1423. X    panel = (Panel)xv_create (frame, PANEL, NULL);
  1424. X
  1425. X    (void) xv_create (panel, PANEL_BUTTON,
  1426. X            PANEL_LABEL_STRING,         "Quit",
  1427. X            PANEL_NOTIFY_PROC,          quit,
  1428. X            NULL);
  1429. X
  1430. X    notify_set_signal_func(frame, sigint_handler, SIGINT, NOTIFY_ASYNC);
  1431. X
  1432. X    xv_main_loop(frame);
  1433. X}
  1434. X
  1435. Xint
  1436. Xquit()
  1437. X{
  1438. X    xv_destroy_safe(frame);
  1439. X    return XV_OK;
  1440. X}
  1441. END_OF_FILE
  1442. if test 993 -ne `wc -c <'xview.demos/notifier/ntfy_sig.c'`; then
  1443.     echo shar: \"'xview.demos/notifier/ntfy_sig.c'\" unpacked with wrong size!
  1444. fi
  1445. # end of 'xview.demos/notifier/ntfy_sig.c'
  1446. fi
  1447. if test -f 'xview.demos/panels/btn_menu.c' -a "${1}" != "-c" ; then 
  1448.   echo shar: Will not clobber existing file \"'xview.demos/panels/btn_menu.c'\"
  1449. else
  1450. echo shar: Extracting \"'xview.demos/panels/btn_menu.c'\" \(1429 characters\)
  1451. sed "s/^X//" >'xview.demos/panels/btn_menu.c' <<'END_OF_FILE'
  1452. X/*
  1453. X * btn_menu.c -- display a panel that has an OPEN LOOK menu button.
  1454. X * The choices displayed are Yes, No and Quit.  If Quit is selected
  1455. X * in the menu, the program exits.
  1456. X */
  1457. X#include <xview/xview.h>
  1458. X#include <xview/panel.h>
  1459. X#include <xview/openmenu.h>
  1460. X
  1461. Xmain(argc, argv)
  1462. Xint argc;
  1463. Xchar *argv[];
  1464. X{
  1465. X    Frame       frame;
  1466. X    Panel       panel;
  1467. X    Menu        menu;
  1468. X    int         selected();
  1469. X    void        menu_proc();
  1470. X
  1471. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1472. X
  1473. X    frame = (Frame)xv_create(NULL, FRAME, NULL);
  1474. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  1475. X
  1476. X    /* Create the menu _before_ the panel button */
  1477. X    menu = (Menu)xv_create(NULL, MENU,
  1478. X        MENU_NOTIFY_PROC,       menu_proc,
  1479. X        MENU_STRINGS,           "Yes", "No", "Quit", NULL,
  1480. X        NULL);
  1481. X    (void) xv_create(panel, PANEL_BUTTON,
  1482. X        PANEL_LABEL_STRING,     "Y/N/Q",
  1483. X        PANEL_NOTIFY_PROC,      selected,
  1484. X        PANEL_ITEM_MENU,        menu, /* attach menu to button */
  1485. X        NULL);
  1486. X    window_fit(panel);
  1487. X    window_fit(frame);
  1488. X    xv_main_loop(frame);
  1489. X}
  1490. X
  1491. Xint
  1492. Xselected(item, event)
  1493. XPanel_item item;
  1494. XEvent *event;
  1495. X{
  1496. X    printf("%s selected...\n", xv_get(item, PANEL_LABEL_STRING));
  1497. X    return XV_OK;
  1498. X}
  1499. X
  1500. Xvoid
  1501. Xmenu_proc(menu, menu_item)
  1502. XMenu menu;
  1503. XMenu_item menu_item;
  1504. X{
  1505. X    printf("Menu Item: %s\n", xv_get(menu_item, MENU_STRING));
  1506. X    if (!strcmp((char *)xv_get(menu_item, MENU_STRING), "Quit"))
  1507. X        exit(0);
  1508. X}
  1509. END_OF_FILE
  1510. if test 1429 -ne `wc -c <'xview.demos/panels/btn_menu.c'`; then
  1511.     echo shar: \"'xview.demos/panels/btn_menu.c'\" unpacked with wrong size!
  1512. fi
  1513. # end of 'xview.demos/panels/btn_menu.c'
  1514. fi
  1515. if test -f 'xview.demos/panels/client_data.c' -a "${1}" != "-c" ; then 
  1516.   echo shar: Will not clobber existing file \"'xview.demos/panels/client_data.c'\"
  1517. else
  1518. echo shar: Extracting \"'xview.demos/panels/client_data.c'\" \(897 characters\)
  1519. sed "s/^X//" >'xview.demos/panels/client_data.c' <<'END_OF_FILE'
  1520. X/*
  1521. X * client_data.c -- demonstrate the use of PANEL_CLIENT_DATA attached
  1522. X * to panel items.  Attach the base frame to the "Quit" panel item so
  1523. X * that the notify procedure can call xv_destroy_safe() on the frame.
  1524. X */
  1525. X#include <xview/xview.h>
  1526. X#include <xview/panel.h>
  1527. X
  1528. Xmain(argc, argv)
  1529. Xint argc;
  1530. Xchar *argv[];
  1531. X{
  1532. X    Frame  frame;
  1533. X    Panel  panel;
  1534. X    int    quit();
  1535. X
  1536. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1537. X
  1538. X    frame = (Frame)xv_create(XV_NULL, FRAME, NULL);
  1539. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  1540. X    (void) xv_create(panel, PANEL_BUTTON,
  1541. X        PANEL_LABEL_STRING,     "Quit",
  1542. X        PANEL_NOTIFY_PROC,      quit,
  1543. X        PANEL_CLIENT_DATA,      frame,
  1544. X        NULL);
  1545. X
  1546. X    xv_main_loop(frame);
  1547. X    puts("The program is now done.");
  1548. X    exit(0);
  1549. X}
  1550. X
  1551. Xquit(item)
  1552. XPanel_item item;
  1553. X{
  1554. X    Frame frame = (Frame)xv_get(item, PANEL_CLIENT_DATA);
  1555. X    xv_destroy_safe(frame);
  1556. X}
  1557. END_OF_FILE
  1558. if test 897 -ne `wc -c <'xview.demos/panels/client_data.c'`; then
  1559.     echo shar: \"'xview.demos/panels/client_data.c'\" unpacked with wrong size!
  1560. fi
  1561. # end of 'xview.demos/panels/client_data.c'
  1562. fi
  1563. if test -f 'xview.demos/panels/repaint.c' -a "${1}" != "-c" ; then 
  1564.   echo shar: Will not clobber existing file \"'xview.demos/panels/repaint.c'\"
  1565. else
  1566. echo shar: Extracting \"'xview.demos/panels/repaint.c'\" \(1023 characters\)
  1567. sed "s/^X//" >'xview.demos/panels/repaint.c' <<'END_OF_FILE'
  1568. X#include <xview/xview.h>
  1569. X#include <xview/panel.h>
  1570. X#include <xview/scrollbar.h>
  1571. X
  1572. Xstatic short grey_bits[] = {
  1573. X#include <images/grey_stencil_50.pr>
  1574. X};
  1575. Xmpr_static(grey, 64, 64, 1, grey_bits);
  1576. X
  1577. Xvoid
  1578. Xpanel_repaint(panel, pw)
  1579. XPanel panel;
  1580. XXv_Window pw;
  1581. X{
  1582. X    xv_replrop(pw, 0, 0, xv_get(pw, XV_WIDTH), xv_get(pw, XV_HEIGHT),
  1583. X    PIX_SET, &grey, 0, 0);
  1584. X}
  1585. X
  1586. Xmain(argc, argv)
  1587. Xint argc;
  1588. Xchar *argv[];
  1589. X{
  1590. X    Frame    frame;
  1591. X    Panel       panel;
  1592. X    int         quit();
  1593. X
  1594. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1595. X    frame = xv_create(XV_NULL, FRAME, NULL);
  1596. X    panel = xv_create(frame, PANEL,
  1597. X    OPENWIN_SHOW_BORDERS,    TRUE,
  1598. X    PANEL_REPAINT_PROC,    panel_repaint,
  1599. X    NULL);
  1600. X    xv_create(panel, PANEL_BUTTON,
  1601. X        PANEL_LABEL_STRING,     "Quit",
  1602. X        PANEL_NOTIFY_PROC,      quit,
  1603. X    PANEL_CLIENT_DATA,    frame,
  1604. X        NULL);
  1605. X    /* window_fit(panel); */
  1606. X    window_fit(frame);
  1607. X
  1608. X    xv_main_loop(frame);
  1609. X    exit(0);
  1610. X}
  1611. X
  1612. Xquit(item)
  1613. XPanel_item item;
  1614. X{
  1615. X    Frame frame = xv_get(item, PANEL_CLIENT_DATA);
  1616. X    xv_destroy_safe(frame);
  1617. X}
  1618. END_OF_FILE
  1619. if test 1023 -ne `wc -c <'xview.demos/panels/repaint.c'`; then
  1620.     echo shar: \"'xview.demos/panels/repaint.c'\" unpacked with wrong size!
  1621. fi
  1622. # end of 'xview.demos/panels/repaint.c'
  1623. fi
  1624. if test -f 'xview.demos/panels/simple_panel.c' -a "${1}" != "-c" ; then 
  1625.   echo shar: Will not clobber existing file \"'xview.demos/panels/simple_panel.c'\"
  1626. else
  1627. echo shar: Extracting \"'xview.demos/panels/simple_panel.c'\" \(749 characters\)
  1628. sed "s/^X//" >'xview.demos/panels/simple_panel.c' <<'END_OF_FILE'
  1629. X/*
  1630. X * simple_panel.c -- program to display a panel button that says "Quit".
  1631. X * Selecting the panel button exits the program.
  1632. X */
  1633. X#include <xview/xview.h>
  1634. X#include <xview/frame.h>
  1635. X#include <xview/panel.h>
  1636. X
  1637. Xmain (argc, argv)
  1638. Xint argc;
  1639. Xchar *argv[];
  1640. X{
  1641. X    Frame  frame;
  1642. X    Panel  panel;
  1643. X    void   quit();
  1644. X
  1645. X    xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1646. X
  1647. X    frame = (Frame)xv_create(NULL, FRAME,
  1648. X        FRAME_LABEL,    argv[0],
  1649. X        XV_WIDTH,       200,
  1650. X        XV_HEIGHT,      100,
  1651. X        NULL);
  1652. X
  1653. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  1654. X
  1655. X    (void) xv_create(panel, PANEL_BUTTON,
  1656. X        PANEL_LABEL_STRING,  "Quit",
  1657. X        PANEL_NOTIFY_PROC,   quit,
  1658. X        NULL);
  1659. X
  1660. X    xv_main_loop(frame);
  1661. X}
  1662. X
  1663. Xvoid
  1664. Xquit()
  1665. X{
  1666. X    exit(0);
  1667. X}
  1668. END_OF_FILE
  1669. if test 749 -ne `wc -c <'xview.demos/panels/simple_panel.c'`; then
  1670.     echo shar: \"'xview.demos/panels/simple_panel.c'\" unpacked with wrong size!
  1671. fi
  1672. # end of 'xview.demos/panels/simple_panel.c'
  1673. fi
  1674. if test -f 'xview.demos/panels/stop_frame.c' -a "${1}" != "-c" ; then 
  1675.   echo shar: Will not clobber existing file \"'xview.demos/panels/stop_frame.c'\"
  1676. else
  1677. echo shar: Extracting \"'xview.demos/panels/stop_frame.c'\" \(1343 characters\)
  1678. sed "s/^X//" >'xview.demos/panels/stop_frame.c' <<'END_OF_FILE'
  1679. X/*
  1680. X * stop.c -- Use a server image as a panel message item.
  1681. X */
  1682. X#include <xview/xview.h>
  1683. X#include <xview/svrimage.h>
  1684. X#include <xview/panel.h>
  1685. X
  1686. Xstatic short stop_bits[] = {
  1687. X    0x3E00, 0x7F00, 0xFF80, 0xFF80, 0xFF80, 0xFF80, 0xFF80, 0x7F00,
  1688. X    0x3E00, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x7F00, 0x0000
  1689. X};
  1690. X
  1691. Xmain(argc, argv)
  1692. Xchar *argv[];
  1693. X{
  1694. X    Frame frame;
  1695. X    Panel panel;
  1696. X    Server_image stopsign;
  1697. X
  1698. X    xv_init();
  1699. X
  1700. X    frame = (Frame)xv_create(NULL, FRAME,
  1701. X        FRAME_SHOW_HEADER,  FALSE,
  1702. X        NULL);
  1703. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  1704. X
  1705. X    stopsign = (Server_image)xv_create(NULL, SERVER_IMAGE,
  1706. X        XV_WIDTH,           16,
  1707. X        XV_HEIGHT,          16,
  1708. X        SERVER_IMAGE_DEPTH, 1,
  1709. X        SERVER_IMAGE_BITS,  stop_bits,
  1710. X        NULL);
  1711. X
  1712. X    (void) xv_create(panel, PANEL_MESSAGE,
  1713. X        PANEL_LABEL_IMAGE,  stopsign,
  1714. X        NULL);
  1715. X    (void) xv_create(panel, PANEL_MESSAGE,
  1716. X        PANEL_LABEL_STRING,
  1717. X            "This action will cause unsaved edits to be lost.",
  1718. X        NULL);
  1719. X    (void)xv_create(panel, PANEL_BUTTON,
  1720. X        PANEL_NEXT_ROW,     -1,
  1721. X        XV_X,               110,
  1722. X        PANEL_LABEL_STRING, "Ok",
  1723. X        NULL);
  1724. X    (void)xv_create(panel, PANEL_BUTTON,
  1725. X        PANEL_LABEL_STRING, "Cancel",
  1726. X        NULL);
  1727. X
  1728. X    window_fit(panel);
  1729. X    window_fit(frame);
  1730. X    xv_main_loop(frame);
  1731. X}
  1732. END_OF_FILE
  1733. if test 1343 -ne `wc -c <'xview.demos/panels/stop_frame.c'`; then
  1734.     echo shar: \"'xview.demos/panels/stop_frame.c'\" unpacked with wrong size!
  1735. fi
  1736. # end of 'xview.demos/panels/stop_frame.c'
  1737. fi
  1738. if test -f 'xview.demos/scrollbar/Imakefile' -a "${1}" != "-c" ; then 
  1739.   echo shar: Will not clobber existing file \"'xview.demos/scrollbar/Imakefile'\"
  1740. else
  1741. echo shar: Extracting \"'xview.demos/scrollbar/Imakefile'\" \(682 characters\)
  1742. sed "s/^X//" >'xview.demos/scrollbar/Imakefile' <<'END_OF_FILE'
  1743. X#
  1744. X# @(#)Imakefile 1.3 89/12/06 SMI
  1745. X#
  1746. X# Imakefile for scrollbar
  1747. X#
  1748. X# LIBRARY_DEST is the location of the XView libraries
  1749. X# HEADER_DEST is the location of the XView header files
  1750. X# LIBDIR is the directory containing the X11 library (libX11.a)
  1751. X#
  1752. X
  1753. XLIBRARY_DEST=/home/xview/usr/lib
  1754. XHEADER_DEST=/home/xview/usr/include
  1755. X
  1756. XLIBDIR=/home/X11/lib
  1757. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  1758. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  1759. X
  1760. X# Uncomment the following line to use libxvol.a and libxvin.a
  1761. X#
  1762. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  1763. X
  1764. XTARGETS=scroll_cells scroll_cells2
  1765. X
  1766. Xall: $(TARGETS)
  1767. X
  1768. X${TARGETS}: $$@.c $$@.o 
  1769. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  1770. END_OF_FILE
  1771. if test 682 -ne `wc -c <'xview.demos/scrollbar/Imakefile'`; then
  1772.     echo shar: \"'xview.demos/scrollbar/Imakefile'\" unpacked with wrong size!
  1773. fi
  1774. # end of 'xview.demos/scrollbar/Imakefile'
  1775. fi
  1776. if test -f 'xview.demos/seln_svc/Imakefile' -a "${1}" != "-c" ; then 
  1777.   echo shar: Will not clobber existing file \"'xview.demos/seln_svc/Imakefile'\"
  1778. else
  1779. echo shar: Extracting \"'xview.demos/seln_svc/Imakefile'\" \(701 characters\)
  1780. sed "s/^X//" >'xview.demos/seln_svc/Imakefile' <<'END_OF_FILE'
  1781. X#
  1782. X# @(#)Imakefile 1.3 89/12/06 SMI
  1783. X#
  1784. X# Imakefile for seln_svc
  1785. X#
  1786. X# LIBRARY_DEST is the location of the XView libraries
  1787. X# HEADER_DEST is the location of the XView header files
  1788. X# LIBDIR is the directory containing the X11 library (libX11.a)
  1789. X#
  1790. X
  1791. XLIBRARY_DEST=/home/xview/usr/lib
  1792. XHEADER_DEST=/home/xview/usr/include
  1793. X
  1794. XLIBDIR=/home/X11/lib
  1795. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  1796. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  1797. X
  1798. X# Uncomment the following line to use libxvol.a and libxvin.a
  1799. X#
  1800. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  1801. X
  1802. XTARGETS=long_seln seln seln_line simple_seln text_seln
  1803. X
  1804. Xall: $(TARGETS)
  1805. X
  1806. X${TARGETS}: $$@.c $$@.o 
  1807. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  1808. END_OF_FILE
  1809. if test 701 -ne `wc -c <'xview.demos/seln_svc/Imakefile'`; then
  1810.     echo shar: \"'xview.demos/seln_svc/Imakefile'\" unpacked with wrong size!
  1811. fi
  1812. # end of 'xview.demos/seln_svc/Imakefile'
  1813. fi
  1814. if test -f 'xview.demos/sv_compat/Imakefile' -a "${1}" != "-c" ; then 
  1815.   echo shar: Will not clobber existing file \"'xview.demos/sv_compat/Imakefile'\"
  1816. else
  1817. echo shar: Extracting \"'xview.demos/sv_compat/Imakefile'\" \(664 characters\)
  1818. sed "s/^X//" >'xview.demos/sv_compat/Imakefile' <<'END_OF_FILE'
  1819. X#
  1820. X# @(#)Imakefile 1.3 89/12/06 SMI
  1821. X#
  1822. X# Imakefile for sv_compat
  1823. X#
  1824. X# LIBRARY_DEST is the location of the XView libraries
  1825. X# HEADER_DEST is the location of the XView header files
  1826. X# LIBDIR is the directory containing the X11 library (libX11.a)
  1827. X#
  1828. X
  1829. XLIBRARY_DEST=/home/xview/usr/lib
  1830. XHEADER_DEST=/home/xview/usr/include
  1831. X
  1832. XLIBDIR=/home/X11/lib
  1833. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  1834. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  1835. X
  1836. X# Uncomment the following line to use libxvol.a and libxvin.a
  1837. X#
  1838. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  1839. X
  1840. XTARGETS=pw_draw
  1841. X
  1842. Xall: $(TARGETS)
  1843. X
  1844. X${TARGETS}: $$@.c $$@.o 
  1845. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o 
  1846. X
  1847. END_OF_FILE
  1848. if test 664 -ne `wc -c <'xview.demos/sv_compat/Imakefile'`; then
  1849.     echo shar: \"'xview.demos/sv_compat/Imakefile'\" unpacked with wrong size!
  1850. fi
  1851. # end of 'xview.demos/sv_compat/Imakefile'
  1852. fi
  1853. if test -f 'xview.demos/ttysw/Imakefile' -a "${1}" != "-c" ; then 
  1854.   echo shar: Will not clobber existing file \"'xview.demos/ttysw/Imakefile'\"
  1855. else
  1856. echo shar: Extracting \"'xview.demos/ttysw/Imakefile'\" \(807 characters\)
  1857. sed "s/^X//" >'xview.demos/ttysw/Imakefile' <<'END_OF_FILE'
  1858. X#
  1859. X# @(#)Imakefile 1.3 89/12/06 SMI
  1860. X#
  1861. X# Imakefile for ttysw
  1862. X#
  1863. X# LIBRARY_DEST is the location of the XView libraries
  1864. X# HEADER_DEST is the location of the XView header files
  1865. X# LIBDIR is the directory containing the X11 library (libX11.a)
  1866. X#
  1867. X
  1868. XLIBRARY_DEST=/home/xview/usr/lib
  1869. XHEADER_DEST=/home/xview/usr/include
  1870. X
  1871. XLIBDIR=/home/X11/lib
  1872. XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11
  1873. XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE
  1874. X
  1875. X# Uncomment the following line to use libxvol.a and libxvin.a
  1876. X#
  1877. X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11
  1878. X
  1879. XTARG1=sample_tty textsw_to_ttysw xv_termsw 
  1880. XTARG2=ttycurses
  1881. XTARGETS=$(TARG1) $(TARG2)
  1882. X
  1883. Xall: $(TARGETS)
  1884. X
  1885. X${TARG1}: $$@.c $$@.o 
  1886. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o
  1887. X
  1888. X${TARG2}: $$@.c $$@.o
  1889. X    ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o -lcurses -ltermlib
  1890. END_OF_FILE
  1891. if test 807 -ne `wc -c <'xview.demos/ttysw/Imakefile'`; then
  1892.     echo shar: \"'xview.demos/ttysw/Imakefile'\" unpacked with wrong size!
  1893. fi
  1894. # end of 'xview.demos/ttysw/Imakefile'
  1895. fi
  1896. if test -f 'xview.demos/ttysw/textsw_to_ttysw.c' -a "${1}" != "-c" ; then 
  1897.   echo shar: Will not clobber existing file \"'xview.demos/ttysw/textsw_to_ttysw.c'\"
  1898. else
  1899. echo shar: Extracting \"'xview.demos/ttysw/textsw_to_ttysw.c'\" \(1589 characters\)
  1900. sed "s/^X//" >'xview.demos/ttysw/textsw_to_ttysw.c' <<'END_OF_FILE'
  1901. X/*
  1902. X * textsw_to_ttysw.c -- send text from a text subwindow to a 
  1903. X * tty subwindow using ttysw_output()
  1904. X */
  1905. X#include <stdio.h>
  1906. X#include <xview/panel.h>
  1907. X#include <xview/xview.h>
  1908. X#include <xview/textsw.h>
  1909. X#include <xview/tty.h>
  1910. X
  1911. XTextsw  textsw;
  1912. XTty     ttysw;
  1913. X
  1914. Xmain(argc,argv)
  1915. Xint     argc;
  1916. Xchar    *argv[];
  1917. X{
  1918. X    Frame       frame;
  1919. X    Panel       panel;
  1920. X    void        text_to_tty(), exit();
  1921. X
  1922. X    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
  1923. X
  1924. X    frame = (Frame)xv_create(XV_NULL, FRAME,
  1925. X        FRAME_LABEL, argv[0],
  1926. X        NULL);
  1927. X    panel = (Panel)xv_create(frame, PANEL,
  1928. X        PANEL_LAYOUT, PANEL_VERTICAL,
  1929. X        NULL);
  1930. X    (void) xv_create(panel, PANEL_BUTTON,
  1931. X        PANEL_LABEL_STRING,     "Quit",
  1932. X        PANEL_NOTIFY_PROC,      exit,
  1933. X        NULL);
  1934. X    (void) xv_create(panel, PANEL_BUTTON,
  1935. X        PANEL_LABEL_STRING,     "Text To Tty",
  1936. X        PANEL_NOTIFY_PROC,      text_to_tty,
  1937. X        NULL);
  1938. X    window_fit(panel);
  1939. X
  1940. X    textsw = (Textsw)xv_create(frame, TEXTSW,
  1941. X        WIN_ROWS,       10,
  1942. X        WIN_COLUMNS,    80,
  1943. X        NULL);
  1944. X    ttysw = (Tty)xv_create(frame, TTY,
  1945. X        WIN_BELOW,      textsw,
  1946. X        WIN_X,          0,
  1947. X        TTY_ARGV,       TTY_ARGV_DO_NOT_FORK,
  1948. X        NULL);
  1949. X
  1950. X    window_fit(frame);
  1951. X    xv_main_loop(frame);
  1952. X}
  1953. X
  1954. X/*
  1955. X * callback routine for the panel button -- read text from textsw 
  1956. X * and send it to the ttysw using ttysw_output()
  1957. X */
  1958. Xvoid
  1959. Xtext_to_tty(item, event)
  1960. XPanel_item item;
  1961. XEvent *event;
  1962. X{
  1963. X    char buf[BUFSIZ];
  1964. X
  1965. X    (void) xv_get(textsw, TEXTSW_CONTENTS, 0, buf, sizeof buf);
  1966. X    ttysw_output(ttysw, buf, strlen(buf));
  1967. X}
  1968. END_OF_FILE
  1969. if test 1589 -ne `wc -c <'xview.demos/ttysw/textsw_to_ttysw.c'`; then
  1970.     echo shar: \"'xview.demos/ttysw/textsw_to_ttysw.c'\" unpacked with wrong size!
  1971. fi
  1972. # end of 'xview.demos/ttysw/textsw_to_ttysw.c'
  1973. fi
  1974. if test -f 'xview.demos/ttysw/xv_termsw.c' -a "${1}" != "-c" ; then 
  1975.   echo shar: Will not clobber existing file \"'xview.demos/ttysw/xv_termsw.c'\"
  1976. else
  1977. echo shar: Extracting \"'xview.demos/ttysw/xv_termsw.c'\" \(1593 characters\)
  1978. sed "s/^X//" >'xview.demos/ttysw/xv_termsw.c' <<'END_OF_FILE'
  1979. X/*
  1980. X * xv_termsw.c
  1981. X * Demonstrate incorporation of a Term subwindow in an application;
  1982. X * keyboard input to the termsw can come either directly to the
  1983. X * termsw or from an adjoining panel text item.
  1984. X */
  1985. X#include <stdio.h>
  1986. X#include <xview/xview.h>
  1987. X#include <xview/panel.h>
  1988. X/* #include <xview/tty.h> */
  1989. X#include <xview/termsw.h>
  1990. X
  1991. XTermsw          term;
  1992. XPanel_item      text_item;
  1993. X
  1994. Xmain(argc,argv)
  1995. Xint     argc;
  1996. Xchar    *argv[];
  1997. X{
  1998. X    Frame       frame;
  1999. X    Panel       panel;
  2000. X    int         notify_proc();
  2001. X
  2002. X    xv_init(XV_INIT_ARGS, argc, argv, NULL);
  2003. X
  2004. X    frame = (Frame)xv_create(NULL, FRAME, NULL);
  2005. X    panel = (Panel)xv_create(frame, PANEL, NULL);
  2006. X    text_item = (Panel_item)xv_create(panel, PANEL_TEXT,
  2007. X        PANEL_LABEL_STRING,         "Command:",
  2008. X        PANEL_NOTIFY_PROC,          notify_proc,
  2009. X        PANEL_VALUE_DISPLAY_LENGTH, 20,
  2010. X        NULL);
  2011. X    (void) xv_create(panel, PANEL_BUTTON,
  2012. X        PANEL_LABEL_STRING,     "Apply",
  2013. X        PANEL_NOTIFY_PROC,      notify_proc,
  2014. X        NULL);
  2015. X    window_fit_height(panel);
  2016. X
  2017. X    term = (Termsw)xv_create(frame, TERMSW, NULL);
  2018. X
  2019. X    window_fit(frame);
  2020. X    xv_main_loop(frame);
  2021. X}
  2022. X
  2023. X/*
  2024. X * This procedure is called when the user this return on the
  2025. X * panel text item or clicking on the <apply> button.
  2026. X * Use ttysw_input() to feed the string to the termal window.
  2027. X */
  2028. Xint
  2029. Xnotify_proc(item,event)
  2030. XPanel_item      item;
  2031. XEvent   *event;
  2032. X{
  2033. X    char        str[81];
  2034. X    
  2035. X    sprintf(str, "%.81s\n", (char *)xv_get(text_item, PANEL_VALUE));
  2036. X    ttysw_input(term, str, strlen(str));
  2037. X    xv_set(text_item, PANEL_VALUE, "", NULL);
  2038. X    return XV_OK;
  2039. X}
  2040. END_OF_FILE
  2041. if test 1593 -ne `wc -c <'xview.demos/ttysw/xv_termsw.c'`; then
  2042.     echo shar: \"'xview.demos/ttysw/xv_termsw.c'\" unpacked with wrong size!
  2043. fi
  2044. # end of 'xview.demos/ttysw/xv_termsw.c'
  2045. fi
  2046. echo shar: End of archive 5 \(of 6\).
  2047. cp /dev/null ark5isdone
  2048. MISSING=""
  2049. for I in 1 2 3 4 5 6 ; do
  2050.     if test ! -f ark${I}isdone ; then
  2051.     MISSING="${MISSING} ${I}"
  2052.     fi
  2053. done
  2054. if test "${MISSING}" = "" ; then
  2055.     echo You have unpacked all 6 archives.
  2056.     rm -f ark[1-9]isdone
  2057. else
  2058.     echo You still need to unpack the following archives:
  2059.     echo "        " ${MISSING}
  2060. fi
  2061. ##  End of shell archive.
  2062. exit 0
  2063.