argv@sun.com (Dan Heller) (12/08/89)
Submitted-by: Dan Heller <argv@sun.com> Posting-number: Volume 5, Issue 43 Archive-name: xview.demos/part05 #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # If this archive is complete, you will see the following message at the end: # "End of archive 5 (of 6)." # Contents: xview.demos/Imakefile xview.demos/canvas/Imakefile # xview.demos/canvas/Makefile xview.demos/canvas/line.c # xview.demos/color/Imakefile xview.demos/cursor/Imakefile # xview.demos/cursor/simple_cursor.c # xview.demos/cursor/stop_cursor.c xview.demos/defaults/Imakefile # xview.demos/defaults/default_size.c # xview.demos/defaults/default_text.c xview.demos/fonts/Imakefile # xview.demos/frames/Imakefile xview.demos/icons/icon_demo.c # xview.demos/icons/open.icon xview.demos/menus/Imakefile # xview.demos/misc/Imakefile xview.demos/misc/screen.c # xview.demos/misc/svrimage.c xview.demos/misc/type_to_string.c # xview.demos/notice/Imakefile xview.demos/notice/simple_notice.c # xview.demos/notifier/Imakefile xview.demos/notifier/interpose.c # xview.demos/notifier/notify_input.c # xview.demos/notifier/ntfy_do_dis.c xview.demos/notifier/ntfy_sig.c # xview.demos/panels/btn_menu.c xview.demos/panels/client_data.c # xview.demos/panels/repaint.c xview.demos/panels/simple_panel.c # xview.demos/panels/stop_frame.c xview.demos/scrollbar/Imakefile # xview.demos/seln_svc/Imakefile xview.demos/sv_compat/Imakefile # xview.demos/ttysw/Imakefile xview.demos/ttysw/textsw_to_ttysw.c # xview.demos/ttysw/xv_termsw.c # Wrapped by argv@island on Thu Dec 7 23:18:28 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'xview.demos/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/Imakefile'\" else echo shar: Extracting \"'xview.demos/Imakefile'\" \(1105 characters\) sed "s/^X//" >'xview.demos/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.1 89/07/21 SMI X# X# Top-level Imakefile for binaries X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header file directories X# DEMO_DEST is the desired location of the demo binaries X# Other binaries will be installed in the standard X11 bin (BINDIR). X# X X#define IHaveSubdirs YES X#define INCLUDES -I. -I.. X X#include "../XView.config" X XDEMO_DEST=/tmp XHELP_DEST=$(USRLIBDIR)/help XRANLIBINSTFLAGS= XAR=ar ruvl X X# X# Uncomment the following line if you wish to use the merged XView library X# (libxview.a) Comment out the other definition of LDFLAGS. X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvin -lxvol -lX11 -lm XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 -lm X XSUBDIRS= clock cmdtool dbxtool demos textedit X X# X# PassCDebugFlags will pass information to subdirectories X# X#define PassCDebugFlags 'HEADER_DEST=$(HEADER_DEST)' 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'LIBRARY_DEST=$(LIBRARY_DEST)' 'DEMO_DEST=$(DEMO_DEST)' 'LIBICCCM=$(LIBICCCM)' X'HELP_DEST=$(HELP_DEST)' 'LDFLAGS=$(LDFLAGS)' X XMakeSubdirs($(SUBDIRS)) X XDependSubdirs($(SUBDIRS)) X END_OF_FILE if test 1105 -ne `wc -c <'xview.demos/Imakefile'`; then echo shar: \"'xview.demos/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/Imakefile' fi if test -f 'xview.demos/canvas/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/canvas/Imakefile'\" else echo shar: Extracting \"'xview.demos/canvas/Imakefile'\" \(707 characters\) sed "s/^X//" >'xview.demos/canvas/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for canvas X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=canvas_event canvas_input line scroll_view split_views X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o X END_OF_FILE if test 707 -ne `wc -c <'xview.demos/canvas/Imakefile'`; then echo shar: \"'xview.demos/canvas/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/canvas/Imakefile' fi if test -f 'xview.demos/canvas/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/canvas/Makefile'\" else echo shar: Extracting \"'xview.demos/canvas/Makefile'\" \(191 characters\) sed "s/^X//" >'xview.demos/canvas/Makefile' <<'END_OF_FILE' X# makefile for canvas XLDFLAGS= -lxview -lX11 X XTARGETS=canvas_event canvas_input line scroll_view split_views X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 191 -ne `wc -c <'xview.demos/canvas/Makefile'`; then echo shar: \"'xview.demos/canvas/Makefile'\" unpacked with wrong size! fi # end of 'xview.demos/canvas/Makefile' fi if test -f 'xview.demos/canvas/line.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/canvas/line.c'\" else echo shar: Extracting \"'xview.demos/canvas/line.c'\" \(1250 characters\) sed "s/^X//" >'xview.demos/canvas/line.c' <<'END_OF_FILE' X/* X * line.c -- demonstrates installing a repaint routine in a canvas. X * The routine is called whenever the canvas needs to be repainted. X * This usually occurs when the canvas is exposed or resized. X */ X#include <X11/Xlib.h> X#include <xview/xview.h> X#include <xview/canvas.h> X#include <xview/xv_xrect.h> X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X void canvas_repaint_proc(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(NULL, FRAME, NULL); X X (void) xv_create(frame, CANVAS, X CANVAS_REPAINT_PROC, canvas_repaint_proc, X CANVAS_X_PAINT_WINDOW, TRUE, X NULL); X X xv_main_loop(frame); X} X X/* X * repaint routine draws a line from the top left to the bottom right X * corners of the window X */ Xvoid Xcanvas_repaint_proc(canvas, paint_window, dpy, xwin, xrects) XCanvas canvas; /* unused */ XXv_Window paint_window; /* unused */ XDisplay *dpy; XWindow xwin; XXv_xrectlist *xrects; /* unused */ X{ X GC gc; X int width, height; X X gc = DefaultGC(dpy, DefaultScreen(dpy)); X width = (int)xv_get(paint_window, XV_WIDTH); X height = (int)xv_get(paint_window, XV_HEIGHT); X X XDrawLine(dpy, xwin, gc, 0, 0, width, height); X} END_OF_FILE if test 1250 -ne `wc -c <'xview.demos/canvas/line.c'`; then echo shar: \"'xview.demos/canvas/line.c'\" unpacked with wrong size! fi # end of 'xview.demos/canvas/line.c' fi if test -f 'xview.demos/color/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/color/Imakefile'\" else echo shar: Extracting \"'xview.demos/color/Imakefile'\" \(727 characters\) sed "s/^X//" >'xview.demos/color/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for color X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=color color_animate color_logo color_objs x_draw XICON= cardback.icon X Xall: $(ICON) $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 727 -ne `wc -c <'xview.demos/color/Imakefile'`; then echo shar: \"'xview.demos/color/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/color/Imakefile' fi if test -f 'xview.demos/cursor/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/cursor/Imakefile'\" else echo shar: Extracting \"'xview.demos/cursor/Imakefile'\" \(686 characters\) sed "s/^X//" >'xview.demos/cursor/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for cursor X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=hot_spot simple_cursor stop_cursor X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 686 -ne `wc -c <'xview.demos/cursor/Imakefile'`; then echo shar: \"'xview.demos/cursor/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/cursor/Imakefile' fi if test -f 'xview.demos/cursor/simple_cursor.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/cursor/simple_cursor.c'\" else echo shar: Extracting \"'xview.demos/cursor/simple_cursor.c'\" \(1643 characters\) sed "s/^X//" >'xview.demos/cursor/simple_cursor.c' <<'END_OF_FILE' X/* X * simple_cursor.c -- create a cursor (looks like an hourglass) and X * assign it to a canvas window. X */ X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/cursor.h> X#include <xview/svrimage.h> X X/* data that describes the cursor's image -- see SERVER_IMAGE below */ Xshort cursor_bits[] = { X/* Width=16, Height=16, Depth=1, */ X 0x7FFE,0x4002,0x200C,0x1A38,0x0FF0,0x07E0,0x03C0,0x0180, X 0x0180,0x0240,0x0520,0x0810,0x1108,0x23C4,0x47E2,0x7FFE X}; X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Canvas canvas; X Xv_Cursor cursor; X Server_image svr_image; X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X /* X * create a server image to use as the cursor's image. X */ X svr_image = (Server_image)xv_create(XV_NULL, SERVER_IMAGE, X XV_WIDTH, 16, X XV_HEIGHT, 16, X SERVER_IMAGE_BITS, cursor_bits, X NULL); X /* X * create a cursor based on the image just created X */ X cursor = (Xv_Cursor)xv_create(XV_NULL, CURSOR, X CURSOR_IMAGE, svr_image, X NULL); X X /* X * Create a base frame and a canvas X */ X frame = (Frame)xv_create(XV_NULL, FRAME, NULL); X canvas = (Canvas)xv_create(frame, CANVAS, X XV_WIDTH, 100, X XV_HEIGHT, 100, X NULL); X /* X * set the cursor to the paint window for the canvas X * Do not set it for the canvas itself. X */ X xv_set(xv_get(canvas, CANVAS_NTH_PAINT_WINDOW, 0), X WIN_CURSOR, cursor, X NULL); X X window_fit(frame); X window_main_loop(frame); X} END_OF_FILE if test 1643 -ne `wc -c <'xview.demos/cursor/simple_cursor.c'`; then echo shar: \"'xview.demos/cursor/simple_cursor.c'\" unpacked with wrong size! fi # end of 'xview.demos/cursor/simple_cursor.c' fi if test -f 'xview.demos/cursor/stop_cursor.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/cursor/stop_cursor.c'\" else echo shar: Extracting \"'xview.demos/cursor/stop_cursor.c'\" \(1529 characters\) sed "s/^X//" >'xview.demos/cursor/stop_cursor.c' <<'END_OF_FILE' X/* X * color_cursor.c -- create a predefined cursor and assign it to a canvas. X */ X#include <stdio.h> X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/cursor.h> X Xvoid Xdo_it(item, event) X{ X Rect *r; X Panel panel = xv_get(item, PANEL_PARENT_PANEL); X X r = (Rect *)xv_get(xv_get(panel, XV_ROOT), WIN_MOUSE_XY); X fprintf(stderr, "Root window: "); X rect_print(r); X fputc('\n', stderr); X r = (Rect *)xv_get(xv_get(panel, CANVAS_NTH_PAINT_WINDOW, 0), WIN_MOUSE_XY); X fprintf(stderr, "panel window: "); X rect_print(r); X fputc('\n', stderr); X} X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Canvas canvas; X Xv_Cursor cursor; X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv); X X /* X * create a cursor based on the image just created X */ X cursor = xv_create(XV_NULL, CURSOR, X CURSOR_SRC_CHAR, OLC_STOP_PTR, X NULL); X X /* X * Create a base frame and a canvas X */ X frame = xv_create(XV_NULL, FRAME, NULL); X canvas = xv_create(frame, PANEL, X XV_WIDTH, 100, X XV_HEIGHT, 100, X NULL); X /* X * set the cursor to the paint window for the canvas X * Do not set it for the canvas itself. X */ X xv_set(xv_get(canvas, CANVAS_NTH_PAINT_WINDOW, 0), X WIN_CURSOR, cursor, X NULL); X xv_create(canvas, PANEL_BUTTON, X PANEL_LABEL_STRING, "Do It", X PANEL_NOTIFY_PROC, do_it, X NULL); X X window_fit(frame); X window_main_loop(frame); X} END_OF_FILE if test 1529 -ne `wc -c <'xview.demos/cursor/stop_cursor.c'`; then echo shar: \"'xview.demos/cursor/stop_cursor.c'\" unpacked with wrong size! fi # end of 'xview.demos/cursor/stop_cursor.c' fi if test -f 'xview.demos/defaults/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/defaults/Imakefile'\" else echo shar: Extracting \"'xview.demos/defaults/Imakefile'\" \(680 characters\) sed "s/^X//" >'xview.demos/defaults/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for defaults X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=default_size default_text X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 680 -ne `wc -c <'xview.demos/defaults/Imakefile'`; then echo shar: \"'xview.demos/defaults/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/defaults/Imakefile' fi if test -f 'xview.demos/defaults/default_size.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/defaults/default_size.c'\" else echo shar: Extracting \"'xview.demos/defaults/default_size.c'\" \(1378 characters\) sed "s/^X//" >'xview.demos/defaults/default_size.c' <<'END_OF_FILE' X/* X * default_scale.c -- demonstrate the use of defaults_get_enum(). X * Specify a table of font scales and query the resource database X * for legal values. For example, you may have the following in X * your .Xdefaults (which must be loaded into the resource database): X * font.scale: large X */ X#include <xview/xview.h> X#include <xview/font.h> X#include <xview/defaults.h> X#include <xview/textsw.h> X XDefaults_pairs size_pairs[] = { X "small", WIN_SCALE_SMALL, X "medium", WIN_SCALE_MEDIUM, X "large", WIN_SCALE_LARGE, X "extralarge", WIN_SCALE_EXTRALARGE, X /* the NULL entry is the default if Resource not found */ X NULL, WIN_SCALE_MEDIUM, X}; X Xmain(argc, argv) Xchar *argv[]; X{ X Frame frame; X Xv_Font font; X int scale; X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(NULL, FRAME, NULL); X X scale = defaults_get_enum("font.scale", "Font.Scale", size_pairs); X /* get the default font for the frame, scaled to resource */ X font = xv_find(frame, FONT, X FONT_RESCALE_OF, xv_find(frame, FONT, NULL), scale, X NULL); X X xv_create(frame, TEXTSW, X XV_FONT, font, X WIN_COLUMNS, 80, X WIN_ROWS, 10, X NULL); X X window_fit(frame); X xv_main_loop(frame); X} END_OF_FILE if test 1378 -ne `wc -c <'xview.demos/defaults/default_size.c'`; then echo shar: \"'xview.demos/defaults/default_size.c'\" unpacked with wrong size! fi # end of 'xview.demos/defaults/default_size.c' fi if test -f 'xview.demos/defaults/default_text.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/defaults/default_text.c'\" else echo shar: Extracting \"'xview.demos/defaults/default_text.c'\" \(769 characters\) sed "s/^X//" >'xview.demos/defaults/default_text.c' <<'END_OF_FILE' X/* X * default_text.c -- use the defaults package to get a font name from X * the resource database to set the textsw's font. X */ X#include <xview/xview.h> X#include <xview/font.h> X#include <xview/defaults.h> X#include <xview/textsw.h> X Xmain(argc, argv) Xchar *argv[]; X{ X Frame frame; X Xv_Font font; X char *name; X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(NULL, FRAME, NULL); X X name = defaults_get_string("textsw.font","Textsw.Font", "fixed"), X font = xv_find(frame, FONT, X FONT_NAME, name, X NULL); X X xv_create(frame, TEXTSW, X XV_FONT, font, X WIN_COLUMNS, 80, X WIN_ROWS, 10, X NULL); X X window_fit(frame); X xv_main_loop(frame); X} END_OF_FILE if test 769 -ne `wc -c <'xview.demos/defaults/default_text.c'`; then echo shar: \"'xview.demos/defaults/default_text.c'\" unpacked with wrong size! fi # end of 'xview.demos/defaults/default_text.c' fi if test -f 'xview.demos/fonts/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/fonts/Imakefile'\" else echo shar: Extracting \"'xview.demos/fonts/Imakefile'\" \(678 characters\) sed "s/^X//" >'xview.demos/fonts/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for fonts X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=fonts simple_font type_font X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 678 -ne `wc -c <'xview.demos/fonts/Imakefile'`; then echo shar: \"'xview.demos/fonts/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/fonts/Imakefile' fi if test -f 'xview.demos/frames/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/frames/Imakefile'\" else echo shar: Extracting \"'xview.demos/frames/Imakefile'\" \(686 characters\) sed "s/^X//" >'xview.demos/frames/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for frames X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=frame_color simple_frame subframe X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 686 -ne `wc -c <'xview.demos/frames/Imakefile'`; then echo shar: \"'xview.demos/frames/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/frames/Imakefile' fi if test -f 'xview.demos/icons/icon_demo.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/icons/icon_demo.c'\" else echo shar: Extracting \"'xview.demos/icons/icon_demo.c'\" \(1789 characters\) sed "s/^X//" >'xview.demos/icons/icon_demo.c' <<'END_OF_FILE' X/* X * icon_demo.c -- demonstrate how an icon is used. Create a server X * image and create an icon object with the image as the ICON_IMAGE. X * Use the icon as the frame's icon. X */ X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/svrimage.h> X#include <xview/icon.h> X Xshort open_bits[] = { X#include "open.icon" X}; X Xshort closed_bits[] = { X#include "closed.icon" X}; X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X Server_image open_image, closed_image; X Icon icon; X void close_frame(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(XV_NULL, FRAME, NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X X open_image = (Server_image)xv_create(NULL, SERVER_IMAGE, X XV_WIDTH, 64, X XV_HEIGHT, 64, X SERVER_IMAGE_BITS, open_bits, X NULL); X X closed_image = (Server_image)xv_create(NULL, SERVER_IMAGE, X XV_WIDTH, 64, X XV_HEIGHT, 64, X SERVER_IMAGE_BITS, closed_bits, X NULL); X X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_IMAGE, open_image, X PANEL_NOTIFY_PROC, close_frame, X NULL); X X icon = (Icon)xv_create(frame, ICON, X ICON_IMAGE, closed_image, X XV_X, 100, X XV_Y, 100, X NULL); X xv_set(frame, FRAME_ICON, icon, NULL); X X window_fit(panel); X window_fit(frame); X xv_main_loop(frame); X} X Xvoid Xclose_frame(item, event) XPanel_item item; XEvent *event; X{ X Frame frame = xv_get(xv_get(item, PANEL_PARENT_PANEL), XV_OWNER); X xv_set(frame, FRAME_CLOSED, TRUE, NULL); X} END_OF_FILE if test 1789 -ne `wc -c <'xview.demos/icons/icon_demo.c'`; then echo shar: \"'xview.demos/icons/icon_demo.c'\" unpacked with wrong size! fi # end of 'xview.demos/icons/icon_demo.c' fi if test -f 'xview.demos/icons/open.icon' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/icons/open.icon'\" else echo shar: Extracting \"'xview.demos/icons/open.icon'\" \(1933 characters\) sed "s/^X//" >'xview.demos/icons/open.icon' <<'END_OF_FILE' X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 X */ X 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFF00, X 0x0080,0x0000,0x0000,0x0100,0x009F,0xFFFF,0xFFFF,0xF900, X 0x0090,0x0002,0x4000,0x0900,0x0090,0x0002,0x4000,0x0900, X 0x0090,0x0002,0x4000,0x0900,0x0090,0x0042,0x4000,0x0900, X 0x0090,0x1082,0x4021,0x0900,0x0090,0x2102,0x4042,0x0900, X 0x0090,0x4202,0x4084,0x0900,0x0090,0x8402,0x4108,0x0900, X 0x0091,0x0802,0x4210,0x0900,0x0090,0x1042,0x4020,0x8900, X 0x0090,0x2082,0x4041,0x0900,0x0090,0x4102,0x4082,0x0900, X 0x0090,0x8202,0x4104,0x0900,0x0091,0x0402,0x4208,0x0900, X 0x0090,0x0802,0x4010,0x0900,0x0090,0x0002,0x4000,0x0900, X 0x0090,0x0002,0x4000,0x0900,0x0090,0x0002,0x4000,0x0900, X 0x0090,0x0002,0x4000,0x0900,0x0090,0x0002,0x4000,0x0900, X 0x0090,0x0002,0x4000,0x0900,0x009F,0xFFFE,0x7FFF,0xF900, X 0x0090,0x0000,0x0000,0x0900,0x0090,0x001F,0xF800,0x0900, X 0x0090,0x001F,0xF800,0x0900,0x0090,0x0000,0x0000,0x0900, X 0x009F,0xFFFF,0xFFFF,0xF900,0x0090,0x0000,0x0000,0x0900, X 0x0090,0x0000,0x0000,0x0900,0x0090,0x0000,0x0000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x0003,0x8000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x001F,0xF000,0x0900, X 0x0090,0x000F,0xE000,0x0900,0x0090,0x0007,0xC000,0x0900, X 0x0090,0x0003,0x8000,0x0900,0x0090,0x0001,0x0000,0x0900, X 0x0090,0x0000,0x0000,0x0900,0x009F,0xFFFF,0xFFFF,0xF900, X 0x0080,0x0000,0x0000,0x0100,0x0080,0x0000,0x0000,0x0100, X 0x00FF,0xFFFF,0xFFFF,0xFF00,0x0000,0x0000,0x0000,0x0000, X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, X 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 END_OF_FILE if test 1933 -ne `wc -c <'xview.demos/icons/open.icon'`; then echo shar: \"'xview.demos/icons/open.icon'\" unpacked with wrong size! fi # end of 'xview.demos/icons/open.icon' fi if test -f 'xview.demos/menus/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/menus/Imakefile'\" else echo shar: Extracting \"'xview.demos/menus/Imakefile'\" \(704 characters\) sed "s/^X//" >'xview.demos/menus/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for menus X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=menu menu_dir menu_dir2 pin_menu simple_menu xv_menu X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o X END_OF_FILE if test 704 -ne `wc -c <'xview.demos/menus/Imakefile'`; then echo shar: \"'xview.demos/menus/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/menus/Imakefile' fi if test -f 'xview.demos/misc/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/misc/Imakefile'\" else echo shar: Extracting \"'xview.demos/misc/Imakefile'\" \(689 characters\) sed "s/^X//" >'xview.demos/misc/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for misc X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=drag_n_drop fullscreen screen svrimage X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 689 -ne `wc -c <'xview.demos/misc/Imakefile'`; then echo shar: \"'xview.demos/misc/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/misc/Imakefile' fi if test -f 'xview.demos/misc/screen.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/misc/screen.c'\" else echo shar: Extracting \"'xview.demos/misc/screen.c'\" \(864 characters\) sed "s/^X//" >'xview.demos/misc/screen.c' <<'END_OF_FILE' X/* X * screen.c -- get some simple info about the current screen: X * width, height, depth. X */ X#include <X11/Xlib.h> X#include <xview/xview.h> X#include <xview/screen.h> X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Xv_Screen screen; X Display *dpy; X int screen_no; X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(XV_NULL, FRAME, NULL); X X dpy = (Display *)xv_get(frame, XV_DISPLAY); X printf("Server display = '%s'\n", dpy->vendor); X screen = (Xv_Screen)xv_get(frame, XV_SCREEN); X X screen_no = (int)xv_get(screen, SCREEN_NUMBER); X printf("Screen #%d:\n\twidth: %d\n\theight: %d\n\tdepth: %d\n", X screen_no, X DisplayWidth(dpy, screen_no), X DisplayHeight(dpy, screen_no), X DefaultDepth(dpy, screen_no)); X} END_OF_FILE if test 864 -ne `wc -c <'xview.demos/misc/screen.c'`; then echo shar: \"'xview.demos/misc/screen.c'\" unpacked with wrong size! fi # end of 'xview.demos/misc/screen.c' fi if test -f 'xview.demos/misc/svrimage.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/misc/svrimage.c'\" else echo shar: Extracting \"'xview.demos/misc/svrimage.c'\" \(1506 characters\) sed "s/^X//" >'xview.demos/misc/svrimage.c' <<'END_OF_FILE' X/* X * svrimage.c -- demonstrate how a server image can be created and used. X * The "bits" used to create the image are taken arbitrarily from X * <images/trash.icon> X */ X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/svrimage.h> X#include <X11/Xlib.h> X Xshort image_bits[] = { X 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, 0x0000,0x0000, X 0x0007,0xE000, 0x0004,0x2000, 0x03FF,0xFFC0, 0x0200,0x0040, X 0x02FF,0xFF40, 0x0080,0x0100, 0x00AA,0xAB00, 0x00AA,0xAB00, X 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, X 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, X 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, X 0x00AA,0xAB00, 0x00AA,0xAB00, 0x00AA,0xAB00, 0x0091,0x1300, X 0x00C0,0x0200, 0x003F,0xFC00 X}; X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Server_image image; X Panel panel; X void exit(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X image = (Server_image)xv_create(NULL, SERVER_IMAGE, X XV_WIDTH, 32, X XV_HEIGHT, 30, X SERVER_IMAGE_BITS, image_bits, X NULL); X X frame = (Frame)xv_create(NULL, FRAME, NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_IMAGE, image, X PANEL_NOTIFY_PROC, exit, X NULL); X X window_fit(panel); X window_fit(frame); X xv_main_loop(frame); X} END_OF_FILE if test 1506 -ne `wc -c <'xview.demos/misc/svrimage.c'`; then echo shar: \"'xview.demos/misc/svrimage.c'\" unpacked with wrong size! fi # end of 'xview.demos/misc/svrimage.c' fi if test -f 'xview.demos/misc/type_to_string.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/misc/type_to_string.c'\" else echo shar: Extracting \"'xview.demos/misc/type_to_string.c'\" \(1283 characters\) sed "s/^X//" >'xview.demos/misc/type_to_string.c' <<'END_OF_FILE' X/* X * a useful library routine for getting the type of an XView object. X * Typical use: X * printf("object is: %s\n", type_to_string(xv_get(obj, XV_TYPE))); X */ X#include <xview/xview.h> X#include <xview/textsw.h> X#include <xview/panel.h> X#include <xview/server.h> X#include <xview/font.h> X#include <xview/svrimage.h> X#include <xview/termsw.h> X#include <xview/ttysw.h> X#include <xview/tty.h> X#include <xview/text.h> X Xchar * Xtype_to_string(type) Xlong type; X{ X static char *sprintf(), buf[32]; X switch (type) { X case CANVAS_TYPE : return "canvas"; X case FONT_TYPE : return "font"; X case FRAME_TYPE : return "frame"; X case ICON_TYPE : return "icon"; X case MENU_TYPE : return "menu"; X case PANEL_TYPE : return "panel"; X case SCREEN_TYPE : return "screen"; X case SERVER_IMAGE_TYPE : return "server image"; X case TERMSW_TYPE : return "term"; X case TERMSW_VIEW_TYPE : return "termsw view"; X case TERMSW_MODE_TYPE : return "termsw mode"; X case TTYSW_MODE_TYPE : return "ttysw mode"; X case TEXTSW_TYPE : return "text subwindow"; X case TTY_VIEW_TYPE : return "tty view"; X case TTY_TYPE : return "tty"; X case WINDOW_TYPE : return "window"; X case WIN_MESSAGE_TYPE : return "win message"; X case WIN_TYPE : return "win"; X default : X return sprintf(buf, "%x: Unknown type", type); X } X} END_OF_FILE if test 1283 -ne `wc -c <'xview.demos/misc/type_to_string.c'`; then echo shar: \"'xview.demos/misc/type_to_string.c'\" unpacked with wrong size! fi # end of 'xview.demos/misc/type_to_string.c' fi if test -f 'xview.demos/notice/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notice/Imakefile'\" else echo shar: Extracting \"'xview.demos/notice/Imakefile'\" \(688 characters\) sed "s/^X//" >'xview.demos/notice/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for notice X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=notice simple_notice trigger_notice X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 688 -ne `wc -c <'xview.demos/notice/Imakefile'`; then echo shar: \"'xview.demos/notice/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/notice/Imakefile' fi if test -f 'xview.demos/notice/simple_notice.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notice/simple_notice.c'\" else echo shar: Extracting \"'xview.demos/notice/simple_notice.c'\" \(1724 characters\) sed "s/^X//" >'xview.demos/notice/simple_notice.c' <<'END_OF_FILE' X/* X * simple_notice.c -- Demonstrate the use of notices. X */ X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/notice.h> X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X Xv_opaque my_notify_proc(); X X /* X * Initialize XView, create a frame, a panel and one panel button. X */ X xv_init(XV_INIT_ARGS, argc, argv, NULL); X X frame = (Frame)xv_create(XV_NULL, FRAME, NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, my_notify_proc, X NULL); X X /* make sure everything looks good */ X window_fit(panel); X window_fit(frame); X X /* start window event processing */ X xv_main_loop(frame); X} X X/* X * my_notify_proc() -- called when the user selects the Quit button. X * The notice appears as a result of notice_prompt(). Here X * the user must chooses YES or NO to confirm or deny quitting. X */ XXv_opaque Xmy_notify_proc(item, event) XPanel_item item; XEvent *event; X{ X int result; X Panel panel = (Panel)xv_get(item, PANEL_PARENT_PANEL); X Window win; X Window root = (Window)xv_get(xv_get(panel, XV_ROOT), XV_XID); X int x, y; X X XTranslateCoordinates(xv_get(panel, XV_DISPLAY), X xv_get(panel, XV_XID), root, event_x(event), event_y(event), X &x, &y, &win); X X result = notice_prompt(panel, NULL, X NOTICE_MESSAGE_STRINGS, "Do you really want to quit?", NULL, X NOTICE_FOCUS_XY, x, y, X NOTICE_BUTTON_YES, "Yes", X NOTICE_BUTTON_NO, "No", X NULL); X X if (result == NOTICE_YES) X exit(0); X} END_OF_FILE if test 1724 -ne `wc -c <'xview.demos/notice/simple_notice.c'`; then echo shar: \"'xview.demos/notice/simple_notice.c'\" unpacked with wrong size! fi # end of 'xview.demos/notice/simple_notice.c' fi if test -f 'xview.demos/notifier/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notifier/Imakefile'\" else echo shar: Extracting \"'xview.demos/notifier/Imakefile'\" \(716 characters\) sed "s/^X//" >'xview.demos/notifier/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for notifier X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=animate interpose notify_input ntfy_do_dis ntfy_pipe ntfy_sig X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 716 -ne `wc -c <'xview.demos/notifier/Imakefile'`; then echo shar: \"'xview.demos/notifier/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/notifier/Imakefile' fi if test -f 'xview.demos/notifier/interpose.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notifier/interpose.c'\" else echo shar: Extracting \"'xview.demos/notifier/interpose.c'\" \(1551 characters\) sed "s/^X//" >'xview.demos/notifier/interpose.c' <<'END_OF_FILE' X/* X * interpose.c -- shows how to use an interpose destroy function X */ X#include <xview/xview.h> X#include <xview/frame.h> X#include <xview/panel.h> X#include <xview/notice.h> X XFrame frame; X XNotify_value Xdestroy_func(client, status) XNotify_client client; XDestroy_status status; X{ X if (status == DESTROY_CHECKING) { X int answer = notice_prompt(client, NULL, X NOTICE_MESSAGE_STRINGS, "Really Quit?", NULL, X NOTICE_BUTTON_YES, "No", X NOTICE_BUTTON_NO, "Yes", X NULL); X if (answer == NOTICE_YES) X notify_veto_destroy(client); X } else if (status == DESTROY_CLEANUP) { X puts("cleaning up"); X /* allow frame to be destroyed */ X return notify_next_destroy_func(client, status); X } else if (status == DESTROY_SAVE_YOURSELF) X puts("save yourself?"); X else X puts("process death"); X return NOTIFY_DONE; X} X Xmain (argc, argv) Xint argc; Xchar *argv[]; X{ X Panel panel; X int quit(); X X xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create (NULL, FRAME, X FRAME_LABEL, argv[0], X XV_WIDTH, 200, X XV_HEIGHT, 100, X NULL); X notify_interpose_destroy_func(frame, destroy_func); X X panel = (Panel)xv_create (frame, PANEL, NULL); X (void) xv_create (panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, quit, X NULL); X xv_main_loop(frame); X} X Xint Xquit() X{ X xv_destroy_safe(frame); X return XV_OK; X} END_OF_FILE if test 1551 -ne `wc -c <'xview.demos/notifier/interpose.c'`; then echo shar: \"'xview.demos/notifier/interpose.c'\" unpacked with wrong size! fi # end of 'xview.demos/notifier/interpose.c' fi if test -f 'xview.demos/notifier/notify_input.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notifier/notify_input.c'\" else echo shar: Extracting \"'xview.demos/notifier/notify_input.c'\" \(1572 characters\) sed "s/^X//" >'xview.demos/notifier/notify_input.c' <<'END_OF_FILE' X/* X * notify_input.c -- use notify_set_input_func to monitor the state of X * a file. The notifier is running and checking the file descriptors X * of the opened files associated with the command line args. The X * routine installed by notify_set_input_func() is called whenever X * there is data to be read. When there is no more data to be read X * for that file, the input function is unregistered. When all files X * have been read, notify_start() returns and the program exits. X */ X#include <stdio.h> X#include <sys/ioctl.h> X#include <xview/notify.h> X Xmain(argc, argv) Xchar *argv[]; X{ X Notify_value read_it(); X Notify_client client = (Notify_client)10101; /* arbitrary */ X FILE *fp; X X while (*++argv) X if (!(fp = fopen(*argv, "r"))) X perror(*argv); X else { X (void) notify_set_input_func(client, read_it, fileno(fp)); X client++; /* next client is new/unique */ X } X X /* loops continuously */ X notify_start(); X} X X/* X * read_it() is called whenever there is input to be read. Actually, X * it's called continuously, so check to see if there is input to be X * read first. X */ XNotify_value Xread_it(client, fd) XNotify_client client; Xint fd; X{ X char buf[BUFSIZ]; X int bytes, i; X X if (ioctl(fd, FIONREAD, &bytes) == -1 || bytes == 0) X (void) notify_set_input_func(client, NOTIFY_FUNC_NULL, fd); X else X do X if ((i = read(fd, buf, sizeof buf)) > 0) X (void) write(1, buf, i); X while (i > 0 && bytes -= i > 0); X return NOTIFY_DONE; X} END_OF_FILE if test 1572 -ne `wc -c <'xview.demos/notifier/notify_input.c'`; then echo shar: \"'xview.demos/notifier/notify_input.c'\" unpacked with wrong size! fi # end of 'xview.demos/notifier/notify_input.c' fi if test -f 'xview.demos/notifier/ntfy_do_dis.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notifier/ntfy_do_dis.c'\" else echo shar: Extracting \"'xview.demos/notifier/ntfy_do_dis.c'\" \(1534 characters\) sed "s/^X//" >'xview.demos/notifier/ntfy_do_dis.c' <<'END_OF_FILE' X/* X * ntfy_do_dis.c -- show an example of implicit notifier dispatching X * by calling notify_do_dispatch(). Create a frame, panel and "Quit" X * button, and then loop on calls to read() from stdin. Event X * processing is still maintained because the Notifier uses it's own X * non-blocking read(). X */ X#include <stdio.h> X#include <xview/xview.h> X#include <xview/frame.h> X#include <xview/panel.h> X XFrame frame; X Xmain (argc, argv) Xint argc; Xchar *argv[]; X{ X Panel panel; X char buf[BUFSIZ]; X int n, quit(); X X xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create (NULL, FRAME, X FRAME_LABEL, argv[0], X XV_WIDTH, 200, X XV_HEIGHT, 100, X XV_SHOW, TRUE, X NULL); X X panel = (Panel)xv_create (frame, PANEL, NULL); X X (void) xv_create (panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, quit, X NULL); X X /* Force the frame to be displayed by flushing the server */ X XFlush(xv_get(frame, XV_DISPLAY)); X X /* tell the Notifier that it should use its own read() so that it X * can also detect and dispatch events. This allows us to loop X * in this code segment and still process events. X */ X notify_do_dispatch(); X X puts("Frame being displayed -- type away."); X while ((n = read(0, buf, sizeof buf)) >= 0) X printf("read %d bytes\n", n); X X printf("read() returned %d\n", n); X} X Xint Xquit() X{ X xv_destroy_safe(frame); X return XV_OK; X} END_OF_FILE if test 1534 -ne `wc -c <'xview.demos/notifier/ntfy_do_dis.c'`; then echo shar: \"'xview.demos/notifier/ntfy_do_dis.c'\" unpacked with wrong size! fi # end of 'xview.demos/notifier/ntfy_do_dis.c' fi if test -f 'xview.demos/notifier/ntfy_sig.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/notifier/ntfy_sig.c'\" else echo shar: Extracting \"'xview.demos/notifier/ntfy_sig.c'\" \(993 characters\) sed "s/^X//" >'xview.demos/notifier/ntfy_sig.c' <<'END_OF_FILE' X/* X * ntfy_sig.c -- shows how to catch signals using the notifier X */ X#include <xview/xview.h> X#include <xview/frame.h> X#include <xview/panel.h> X XFrame frame; X XNotify_value Xsigint_handler(client, sig, when) XNotify_client client; Xint sig; X{ X printf("Received signal %d\n", sig); X return NOTIFY_DONE; X} X Xmain (argc, argv) Xint argc; Xchar *argv[]; X{ X Panel panel; X char buf[BUFSIZ]; X int n, quit(); X X xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create (NULL, FRAME, X FRAME_LABEL, argv[0], X XV_WIDTH, 200, X XV_HEIGHT, 100, X NULL); X X panel = (Panel)xv_create (frame, PANEL, NULL); X X (void) xv_create (panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, quit, X NULL); X X notify_set_signal_func(frame, sigint_handler, SIGINT, NOTIFY_ASYNC); X X xv_main_loop(frame); X} X Xint Xquit() X{ X xv_destroy_safe(frame); X return XV_OK; X} END_OF_FILE if test 993 -ne `wc -c <'xview.demos/notifier/ntfy_sig.c'`; then echo shar: \"'xview.demos/notifier/ntfy_sig.c'\" unpacked with wrong size! fi # end of 'xview.demos/notifier/ntfy_sig.c' fi if test -f 'xview.demos/panels/btn_menu.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/panels/btn_menu.c'\" else echo shar: Extracting \"'xview.demos/panels/btn_menu.c'\" \(1429 characters\) sed "s/^X//" >'xview.demos/panels/btn_menu.c' <<'END_OF_FILE' X/* X * btn_menu.c -- display a panel that has an OPEN LOOK menu button. X * The choices displayed are Yes, No and Quit. If Quit is selected X * in the menu, the program exits. X */ X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/openmenu.h> X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X Menu menu; X int selected(); X void menu_proc(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(NULL, FRAME, NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X X /* Create the menu _before_ the panel button */ X menu = (Menu)xv_create(NULL, MENU, X MENU_NOTIFY_PROC, menu_proc, X MENU_STRINGS, "Yes", "No", "Quit", NULL, X NULL); X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Y/N/Q", X PANEL_NOTIFY_PROC, selected, X PANEL_ITEM_MENU, menu, /* attach menu to button */ X NULL); X window_fit(panel); X window_fit(frame); X xv_main_loop(frame); X} X Xint Xselected(item, event) XPanel_item item; XEvent *event; X{ X printf("%s selected...\n", xv_get(item, PANEL_LABEL_STRING)); X return XV_OK; X} X Xvoid Xmenu_proc(menu, menu_item) XMenu menu; XMenu_item menu_item; X{ X printf("Menu Item: %s\n", xv_get(menu_item, MENU_STRING)); X if (!strcmp((char *)xv_get(menu_item, MENU_STRING), "Quit")) X exit(0); X} END_OF_FILE if test 1429 -ne `wc -c <'xview.demos/panels/btn_menu.c'`; then echo shar: \"'xview.demos/panels/btn_menu.c'\" unpacked with wrong size! fi # end of 'xview.demos/panels/btn_menu.c' fi if test -f 'xview.demos/panels/client_data.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/panels/client_data.c'\" else echo shar: Extracting \"'xview.demos/panels/client_data.c'\" \(897 characters\) sed "s/^X//" >'xview.demos/panels/client_data.c' <<'END_OF_FILE' X/* X * client_data.c -- demonstrate the use of PANEL_CLIENT_DATA attached X * to panel items. Attach the base frame to the "Quit" panel item so X * that the notify procedure can call xv_destroy_safe() on the frame. X */ X#include <xview/xview.h> X#include <xview/panel.h> X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X int quit(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(XV_NULL, FRAME, NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, quit, X PANEL_CLIENT_DATA, frame, X NULL); X X xv_main_loop(frame); X puts("The program is now done."); X exit(0); X} X Xquit(item) XPanel_item item; X{ X Frame frame = (Frame)xv_get(item, PANEL_CLIENT_DATA); X xv_destroy_safe(frame); X} END_OF_FILE if test 897 -ne `wc -c <'xview.demos/panels/client_data.c'`; then echo shar: \"'xview.demos/panels/client_data.c'\" unpacked with wrong size! fi # end of 'xview.demos/panels/client_data.c' fi if test -f 'xview.demos/panels/repaint.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/panels/repaint.c'\" else echo shar: Extracting \"'xview.demos/panels/repaint.c'\" \(1023 characters\) sed "s/^X//" >'xview.demos/panels/repaint.c' <<'END_OF_FILE' X#include <xview/xview.h> X#include <xview/panel.h> X#include <xview/scrollbar.h> X Xstatic short grey_bits[] = { X#include <images/grey_stencil_50.pr> X}; Xmpr_static(grey, 64, 64, 1, grey_bits); X Xvoid Xpanel_repaint(panel, pw) XPanel panel; XXv_Window pw; X{ X xv_replrop(pw, 0, 0, xv_get(pw, XV_WIDTH), xv_get(pw, XV_HEIGHT), X PIX_SET, &grey, 0, 0); X} X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X int quit(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X frame = xv_create(XV_NULL, FRAME, NULL); X panel = xv_create(frame, PANEL, X OPENWIN_SHOW_BORDERS, TRUE, X PANEL_REPAINT_PROC, panel_repaint, X NULL); X xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, quit, X PANEL_CLIENT_DATA, frame, X NULL); X /* window_fit(panel); */ X window_fit(frame); X X xv_main_loop(frame); X exit(0); X} X Xquit(item) XPanel_item item; X{ X Frame frame = xv_get(item, PANEL_CLIENT_DATA); X xv_destroy_safe(frame); X} END_OF_FILE if test 1023 -ne `wc -c <'xview.demos/panels/repaint.c'`; then echo shar: \"'xview.demos/panels/repaint.c'\" unpacked with wrong size! fi # end of 'xview.demos/panels/repaint.c' fi if test -f 'xview.demos/panels/simple_panel.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/panels/simple_panel.c'\" else echo shar: Extracting \"'xview.demos/panels/simple_panel.c'\" \(749 characters\) sed "s/^X//" >'xview.demos/panels/simple_panel.c' <<'END_OF_FILE' X/* X * simple_panel.c -- program to display a panel button that says "Quit". X * Selecting the panel button exits the program. X */ X#include <xview/xview.h> X#include <xview/frame.h> X#include <xview/panel.h> X Xmain (argc, argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X void quit(); X X xv_init (XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(NULL, FRAME, X FRAME_LABEL, argv[0], X XV_WIDTH, 200, X XV_HEIGHT, 100, X NULL); X X panel = (Panel)xv_create(frame, PANEL, NULL); X X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, quit, X NULL); X X xv_main_loop(frame); X} X Xvoid Xquit() X{ X exit(0); X} END_OF_FILE if test 749 -ne `wc -c <'xview.demos/panels/simple_panel.c'`; then echo shar: \"'xview.demos/panels/simple_panel.c'\" unpacked with wrong size! fi # end of 'xview.demos/panels/simple_panel.c' fi if test -f 'xview.demos/panels/stop_frame.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/panels/stop_frame.c'\" else echo shar: Extracting \"'xview.demos/panels/stop_frame.c'\" \(1343 characters\) sed "s/^X//" >'xview.demos/panels/stop_frame.c' <<'END_OF_FILE' X/* X * stop.c -- Use a server image as a panel message item. X */ X#include <xview/xview.h> X#include <xview/svrimage.h> X#include <xview/panel.h> X Xstatic short stop_bits[] = { X 0x3E00, 0x7F00, 0xFF80, 0xFF80, 0xFF80, 0xFF80, 0xFF80, 0x7F00, X 0x3E00, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x7F00, 0x0000 X}; X Xmain(argc, argv) Xchar *argv[]; X{ X Frame frame; X Panel panel; X Server_image stopsign; X X xv_init(); X X frame = (Frame)xv_create(NULL, FRAME, X FRAME_SHOW_HEADER, FALSE, X NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X X stopsign = (Server_image)xv_create(NULL, SERVER_IMAGE, X XV_WIDTH, 16, X XV_HEIGHT, 16, X SERVER_IMAGE_DEPTH, 1, X SERVER_IMAGE_BITS, stop_bits, X NULL); X X (void) xv_create(panel, PANEL_MESSAGE, X PANEL_LABEL_IMAGE, stopsign, X NULL); X (void) xv_create(panel, PANEL_MESSAGE, X PANEL_LABEL_STRING, X "This action will cause unsaved edits to be lost.", X NULL); X (void)xv_create(panel, PANEL_BUTTON, X PANEL_NEXT_ROW, -1, X XV_X, 110, X PANEL_LABEL_STRING, "Ok", X NULL); X (void)xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Cancel", X NULL); X X window_fit(panel); X window_fit(frame); X xv_main_loop(frame); X} END_OF_FILE if test 1343 -ne `wc -c <'xview.demos/panels/stop_frame.c'`; then echo shar: \"'xview.demos/panels/stop_frame.c'\" unpacked with wrong size! fi # end of 'xview.demos/panels/stop_frame.c' fi if test -f 'xview.demos/scrollbar/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/scrollbar/Imakefile'\" else echo shar: Extracting \"'xview.demos/scrollbar/Imakefile'\" \(682 characters\) sed "s/^X//" >'xview.demos/scrollbar/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for scrollbar X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=scroll_cells scroll_cells2 X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 682 -ne `wc -c <'xview.demos/scrollbar/Imakefile'`; then echo shar: \"'xview.demos/scrollbar/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/scrollbar/Imakefile' fi if test -f 'xview.demos/seln_svc/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/seln_svc/Imakefile'\" else echo shar: Extracting \"'xview.demos/seln_svc/Imakefile'\" \(701 characters\) sed "s/^X//" >'xview.demos/seln_svc/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for seln_svc X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=long_seln seln seln_line simple_seln text_seln X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o END_OF_FILE if test 701 -ne `wc -c <'xview.demos/seln_svc/Imakefile'`; then echo shar: \"'xview.demos/seln_svc/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/seln_svc/Imakefile' fi if test -f 'xview.demos/sv_compat/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/sv_compat/Imakefile'\" else echo shar: Extracting \"'xview.demos/sv_compat/Imakefile'\" \(664 characters\) sed "s/^X//" >'xview.demos/sv_compat/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for sv_compat X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARGETS=pw_draw X Xall: $(TARGETS) X X${TARGETS}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o X END_OF_FILE if test 664 -ne `wc -c <'xview.demos/sv_compat/Imakefile'`; then echo shar: \"'xview.demos/sv_compat/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/sv_compat/Imakefile' fi if test -f 'xview.demos/ttysw/Imakefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/ttysw/Imakefile'\" else echo shar: Extracting \"'xview.demos/ttysw/Imakefile'\" \(807 characters\) sed "s/^X//" >'xview.demos/ttysw/Imakefile' <<'END_OF_FILE' X# X# @(#)Imakefile 1.3 89/12/06 SMI X# X# Imakefile for ttysw X# X# LIBRARY_DEST is the location of the XView libraries X# HEADER_DEST is the location of the XView header files X# LIBDIR is the directory containing the X11 library (libX11.a) X# X XLIBRARY_DEST=/home/xview/usr/lib XHEADER_DEST=/home/xview/usr/include X XLIBDIR=/home/X11/lib XLDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxview -lX11 XINCLUDES= -I.. -I$(HEADER_DEST) -I$(TOP) -DSTANDALONE X X# Uncomment the following line to use libxvol.a and libxvin.a X# X#LDFLAGS=-L$(LIBRARY_DEST) -L$(LIBDIR) -lxvol -lxvin -lX11 X XTARG1=sample_tty textsw_to_ttysw xv_termsw XTARG2=ttycurses XTARGETS=$(TARG1) $(TARG2) X Xall: $(TARGETS) X X${TARG1}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o X X${TARG2}: $$@.c $$@.o X ${CC} ${CFLAGS} ${LDFLAGS} -o $@ $@.o -lcurses -ltermlib END_OF_FILE if test 807 -ne `wc -c <'xview.demos/ttysw/Imakefile'`; then echo shar: \"'xview.demos/ttysw/Imakefile'\" unpacked with wrong size! fi # end of 'xview.demos/ttysw/Imakefile' fi if test -f 'xview.demos/ttysw/textsw_to_ttysw.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/ttysw/textsw_to_ttysw.c'\" else echo shar: Extracting \"'xview.demos/ttysw/textsw_to_ttysw.c'\" \(1589 characters\) sed "s/^X//" >'xview.demos/ttysw/textsw_to_ttysw.c' <<'END_OF_FILE' X/* X * textsw_to_ttysw.c -- send text from a text subwindow to a X * tty subwindow using ttysw_output() X */ X#include <stdio.h> X#include <xview/panel.h> X#include <xview/xview.h> X#include <xview/textsw.h> X#include <xview/tty.h> X XTextsw textsw; XTty ttysw; X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X void text_to_tty(), exit(); X X xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); X X frame = (Frame)xv_create(XV_NULL, FRAME, X FRAME_LABEL, argv[0], X NULL); X panel = (Panel)xv_create(frame, PANEL, X PANEL_LAYOUT, PANEL_VERTICAL, X NULL); X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Quit", X PANEL_NOTIFY_PROC, exit, X NULL); X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Text To Tty", X PANEL_NOTIFY_PROC, text_to_tty, X NULL); X window_fit(panel); X X textsw = (Textsw)xv_create(frame, TEXTSW, X WIN_ROWS, 10, X WIN_COLUMNS, 80, X NULL); X ttysw = (Tty)xv_create(frame, TTY, X WIN_BELOW, textsw, X WIN_X, 0, X TTY_ARGV, TTY_ARGV_DO_NOT_FORK, X NULL); X X window_fit(frame); X xv_main_loop(frame); X} X X/* X * callback routine for the panel button -- read text from textsw X * and send it to the ttysw using ttysw_output() X */ Xvoid Xtext_to_tty(item, event) XPanel_item item; XEvent *event; X{ X char buf[BUFSIZ]; X X (void) xv_get(textsw, TEXTSW_CONTENTS, 0, buf, sizeof buf); X ttysw_output(ttysw, buf, strlen(buf)); X} END_OF_FILE if test 1589 -ne `wc -c <'xview.demos/ttysw/textsw_to_ttysw.c'`; then echo shar: \"'xview.demos/ttysw/textsw_to_ttysw.c'\" unpacked with wrong size! fi # end of 'xview.demos/ttysw/textsw_to_ttysw.c' fi if test -f 'xview.demos/ttysw/xv_termsw.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'xview.demos/ttysw/xv_termsw.c'\" else echo shar: Extracting \"'xview.demos/ttysw/xv_termsw.c'\" \(1593 characters\) sed "s/^X//" >'xview.demos/ttysw/xv_termsw.c' <<'END_OF_FILE' X/* X * xv_termsw.c X * Demonstrate incorporation of a Term subwindow in an application; X * keyboard input to the termsw can come either directly to the X * termsw or from an adjoining panel text item. X */ X#include <stdio.h> X#include <xview/xview.h> X#include <xview/panel.h> X/* #include <xview/tty.h> */ X#include <xview/termsw.h> X XTermsw term; XPanel_item text_item; X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X Frame frame; X Panel panel; X int notify_proc(); X X xv_init(XV_INIT_ARGS, argc, argv, NULL); X X frame = (Frame)xv_create(NULL, FRAME, NULL); X panel = (Panel)xv_create(frame, PANEL, NULL); X text_item = (Panel_item)xv_create(panel, PANEL_TEXT, X PANEL_LABEL_STRING, "Command:", X PANEL_NOTIFY_PROC, notify_proc, X PANEL_VALUE_DISPLAY_LENGTH, 20, X NULL); X (void) xv_create(panel, PANEL_BUTTON, X PANEL_LABEL_STRING, "Apply", X PANEL_NOTIFY_PROC, notify_proc, X NULL); X window_fit_height(panel); X X term = (Termsw)xv_create(frame, TERMSW, NULL); X X window_fit(frame); X xv_main_loop(frame); X} X X/* X * This procedure is called when the user this return on the X * panel text item or clicking on the <apply> button. X * Use ttysw_input() to feed the string to the termal window. X */ Xint Xnotify_proc(item,event) XPanel_item item; XEvent *event; X{ X char str[81]; X X sprintf(str, "%.81s\n", (char *)xv_get(text_item, PANEL_VALUE)); X ttysw_input(term, str, strlen(str)); X xv_set(text_item, PANEL_VALUE, "", NULL); X return XV_OK; X} END_OF_FILE if test 1593 -ne `wc -c <'xview.demos/ttysw/xv_termsw.c'`; then echo shar: \"'xview.demos/ttysw/xv_termsw.c'\" unpacked with wrong size! fi # end of 'xview.demos/ttysw/xv_termsw.c' fi echo shar: End of archive 5 \(of 6\). cp /dev/null ark5isdone MISSING="" for I in 1 2 3 4 5 6 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 6 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0