This commit is contained in:
Alan Dipert
2010-03-08 05:55:21 -05:00
commit 29c82be0c2
528 changed files with 159411 additions and 0 deletions

228
src/Makefile Normal file
View File

@@ -0,0 +1,228 @@
All: $(MOSAIC)
LIBHTMLW_DIR = ../libhtmlw
LIBXMX_DIR = ../libXmx
LIBXMX_INC = ../libXmx
LIBPNG_DIR = ../libpng
PROGRAM_LIBS = $(LIBWWW_DIR)/libwww.a $(LIBHTMLW_DIR)/libhtmlw.a $(LIBXMX_DIR)/libXmx.a $(LIBNUT_DIR)/libnut.a
LIBS = $(PROGRAM_LIBS) $(X_LIBS) $(PNG_LIBS) $(DTM_LIBS) $(HDF_LIBS) $(WAIS_LIBS) $(JPEG_LIBS) $(KRB_LIBS) $(MATH_LIB) $(SYS_LIBS)
CFILES = main.c gui.c gui-dialogs.c gui-menubar.c gui-documents.c gui-news.c\
newsrc.c\
gui-extras.c mo-www.c mo-dtm.c hotlist.c history.c\
annotate.c pan.c grpan.c grpan-www.c audan.c globalhist.c img.c\
picread.c xpmhash.c xpmread.c gifread.c pixmaps.c\
medcut.c mo-hdf.c hotfile.c child.c mailto.c readJPEG.c readPNG.c\
accept.c cciServer.c cciBindings.c cciBindings2.c support.c bla.c\
kcms.c md5.c proxy-dialogs.c proxy-misc.c gui-popup.c gui-ftp.c\
prefs.c
OBJS = main.o gui.o gui-dialogs.o gui-menubar.o gui-documents.o gui-news.o\
newsrc.o\
gui-extras.o mo-www.o mo-dtm.o hotlist.o history.o\
annotate.o pan.o grpan.o grpan-www.o audan.o globalhist.o img.o\
picread.o xpmhash.o xpmread.o gifread.o pixmaps.o\
medcut.o mo-hdf.o hotfile.o child.o mailto.o readJPEG.o readPNG.o\
accept.o cciServer.o cciBindings.o cciBindings2.o support.o bla.o\
kcms.o md5.o proxy-dialogs.o proxy-misc.o gui-popup.o gui-ftp.o\
prefs.o
AUXCFILES = hdf-browse.c
AUXOBJS = hdf-browse.o
hdf-browse.o: hdf-browse.c ../libhtmlw/HTML.h
$(CC) -c $(CFLAGS) $(AUX_CFLAGS) hdf-browse.c
globalhist.o: globalhist.c ../libhtmlw/HTML.h
$(CC) -c $(CFLAGS) $(AUX_CFLAGS) globalhist.c
$(MOSAIC): $(OBJS) $(AUXOBJS) $(HDFOBJS) $(PROGRAM_LIBS) $(DTM_LIBS)
$(PURIFY) $(CC) $(LDFLAGS) -o $(MOSAIC) $(OBJS) $(AUXOBJS) $(HDFOBJS) $(LIBS)
#HFILES = mosaic.h prefs.h prefs_defs.h xresources.h
#$(OBJS): $(HFILES)
#hotlist.o hotfile.o: hotlist.h
#gui.o: toolbar.h xresources.h ../libhtmlw/HTML.h bitmaps/*.xbm
#img.o: ../libhtmlw/HTML.h
#gui-documents.o: toolbar.h
#comment.o: comment.h
#kcms.o: kcms.h
#gui-popup.o: gui-popup.h
#pixmaps.o: pixmaps/*.xpm
#$(PIXMAPS)
#mo-dtm.o: ../libhtmlw/HTML.h
#prefs.o: prefs.h prefs_defs.h xresources.h
#depend:
# makedepend -m -- $(CFLAGS) -- $(CFILES)
wipe:
-rm -f Mosaic Mosaic-p Mosaic-q $(OBJS) core
clean:
-rm -f Mosaic Mosaic-p Mosaic-q *.o core
tags:
etags -t *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
main.o: cci.h port.h cciServer.h kcms.h
gui.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h port.h
gui.o: gui-documents.h main.h mo-www.h gui-menubar.h proxy.h pan.h pixmaps.h
gui.o: ../libwww2/HTAAUtil.h ../libhtmlw/HTML.h xresources.h cci.h
gui.o: pixmaps/*.xpm
gui.o: bitmaps/*.xbm
gui-dialogs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-dialogs.o: gui-dialogs.h gui-documents.h gui.h mo-www.h
gui-dialogs.o: ../libhtmlw/HTML.h ../libnut/system.h
gui-menubar.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-menubar.o: main.h ../libhtmlw/HTML.h gui.h grpan.h gui-ftp.h gui-popup.h
gui-menubar.o: hotlist.h gui-dialogs.h gui-news.h cci.h port.h
gui-menubar.o: cciBindings.h cciBindings2.h cciServer.h history.h pan.h
gui-menubar.o: annotate.h mo-www.h globalhist.h proxy.h
gui-menubar.o: ../libwww2/HTAAUtil.h
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
gui-documents.o: history.h ../libhtmlw/HTML.h cci.h port.h cciBindings.h
gui-news.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
gui-news.o: gui-news.h ../libnut/system.h ../libhtmlw/HTML.h newsrc.h
gui-news.o: ../libwww2/HTNews.h ../libwww2/HTAccess.h ../libwww2/HTUtils.h
gui-news.o: ../libwww2/HTString.h ../libwww2/HTAnchor.h ../libwww2/HTList.h
gui-news.o: ../libwww2/HTAtom.h ../libwww2/HTFormat.h ../libwww2/HTStream.h
gui-news.o: ../src/newsrc.h
newsrc.o: mosaic.h newsrc.h ../libXmx/Xmx.h toolbar.h
newsrc.o: prefs.h prefs_defs.h
gui-extras.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
gui-extras.o: gui-extras.h mo-www.h ../libhtmlw/HTML.h ../libnut/system.h
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
mo-www.o: mo-www.h ../libwww2/HTAAUtil.h ../libwww2/HTUtils.h
mo-www.o: ../libwww2/HTString.h ../libwww2/tcp.h ../libwww2/HTTCP.h
mo-www.o: ../libwww2/HTParse.h ../libwww2/HTAccess.h ../libwww2/HTAnchor.h
mo-www.o: ../libwww2/HTList.h ../libwww2/HTAtom.h ../libwww2/HTFormat.h
mo-www.o: ../libwww2/HTStream.h ../libwww2/HTML.h ../libwww2/HTMLDTD.h
mo-www.o: ../libwww2/SGML.h ../libwww2/HText.h ../libwww2/HTInit.h
mo-www.o: gui-dialogs.h gui.h
mo-dtm.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h mo-dtm.h
hotlist.o: mosaic.h ../libXmx/Xmx.h toolbar.h
hotlist.o: prefs.h prefs_defs.h hotlist.h hotfile.h gui.h
hotlist.o: mo-www.h bitmaps/hotlist.xbm ../libnut/system.h
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
history.o: gui.h mo-www.h gui-popup.h ../libhtmlw/HTML.h
history.o: hotlist.h ../libwww2/HTAAUtil.h
annotate.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
annotate.o: mo-www.h pan.h grpan.h bitmaps/annotate.xbm ../libnut/system.h
pan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h pan.h
pan.o: ../libhtmlw/HTML.h
grpan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h grpan.h
grpan.o: grpan-www.h pan.h mo-www.h
grpan-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
grpan-www.o: grpan-www.h
audan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h audan.h
audan.o: gui.h pan.h mo-www.h ../libnut/system.h
globalhist.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
globalhist.o: mo-www.h globalhist.h ../libhtmlw/HTML.h ../libnut/system.h
img.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h img.h
img.o: mo-www.h globalhist.h picread.h ../libhtmlw/HTML.h cci.h port.h
img.o: bitmaps/gopher_image.xbm bitmaps/gopher_movie.xbm
img.o: bitmaps/gopher_menu.xbm bitmaps/gopher_text.xbm
img.o: bitmaps/gopher_sound.xbm bitmaps/gopher_index.xbm
img.o: bitmaps/gopher_telnet.xbm bitmaps/gopher_binary.xbm
img.o: bitmaps/gopher_unknown.xbm
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
picread.o: picread.h gifread.h xpmread.h readJPEG.h readPNG.h
xpmhash.o: xpm.h
xpmread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h xpmread.h
gifread.o: gifread.h
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
pixmaps.o: pixmaps.h xpmread.h xpm.h
pixmaps.o: pixmaps/*.xpm
mo-hdf.o: mosaic.h ../libXmx/Xmx.h toolbar.h
mo-hdf.o: prefs.h prefs_defs.h mo-hdf.h mo-dtm.h
hotfile.o: mosaic.h ../libXmx/Xmx.h toolbar.h
hotfile.o: prefs.h prefs_defs.h hotlist.h mo-www.h ../libhtmlw/HTML.h
child.o: child.h list.h
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
mailto.o: ../libnut/url-utils.h ../libnut/system.h
readJPEG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readJPEG.h
readPNG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readPNG.h
accept.o: port.h accept.h memStuffForPipSqueeks.h
cciServer.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
cciServer.o: memStuffForPipSqueeks.h cci.h port.h accept.h
cciBindings.o: cci.h port.h mosaic.h ../libXmx/Xmx.h
cciBindings.o: toolbar.h prefs.h prefs_defs.h gui.h
cciBindings.o: cciServer.h cciBindings.h cciBindings2.h pan.h mo-www.h
cciBindings.o: annotate.h ../libhtmlw/HTML.h
cciBindings2.o: mosaic.h ../libXmx/Xmx.h
cciBindings2.o: toolbar.h prefs.h prefs_defs.h gui.h cci.h port.h
cciBindings2.o: cciBindings2.h cciServer.h list.h memStuffForPipSqueeks.h
cciBindings2.o: ../libwww2/HTFormat.h ../libwww2/HTUtils.h
cciBindings2.o: ../libwww2/HTString.h
cciBindings2.o: ../libwww2/HTStream.h ../libwww2/HTAtom.h ../libwww2/HTList.h
cciBindings2.o: ../libwww2/HTAnchor.h
support.o: cci.h port.h
bla.o: cciServer.h cci.h port.h list.h
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
bla.o: ../libwww2/HTMLDTD.h ../libwww2/SGML.h ../libwww2/HTCompressed.h
comment.o: mosaic.h ../libXmx/Xmx.h toolbar.h
comment.o: prefs.h prefs_defs.h gui.h comment.h
kcms.o: kcms.h
md5.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h md5.h
proxy-dialogs.o: proxy.h mosaic.h ../libXmx/Xmx.h
proxy-dialogs.o: toolbar.h prefs.h prefs_defs.h
proxy-misc.o: proxy.h
gui-popup.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-popup.o: gui-ftp.h mo-www.h gui-popup.h ../libhtmlw/HTML.h hotlist.h
gui-popup.o: gui-documents.h
gui-ftp.o: mosaic.h ../libXmx/Xmx.h toolbar.h
gui-ftp.o: prefs.h prefs_defs.h gui.h gui-ftp.h gui-popup.h
gui-ftp.o: ../libhtmlw/HTML.h hotlist.h ../libnut/system.h
prefs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h

236
src/Makefile.in Normal file
View File

@@ -0,0 +1,236 @@
# @configure_output@
# This file is used by Autoconf to make the real Makefile.
# DO NOT EDIT THIS FILE!
# If you want to change something do it to the Makefile autoconf
# creates. You should never have to edit this file.
CC= @CC@
LIBS = ../libhtmlw/libhtmlw.a ../libwww2/libwww.a ../libnut/libnut.a ../libXmx/libXmx.a @LIBS@
CPPFLAGS = @CPPFLAGS@ -I.. -I../libwww2
CFLAGS = @CFLAGS@
LIBHTMLW_DIR = ../libhtmlw
LIBXMX_DIR = ../libXmx
LIBXMX_INC = ../libXmx
LIBPNG_DIR = ../libpng
CFILES = main.c gui.c gui-dialogs.c gui-menubar.c gui-documents.c gui-news.c\
newsrc.c\
gui-extras.c mo-www.c mo-dtm.c hotlist.c history.c\
annotate.c pan.c grpan.c grpan-www.c audan.c globalhist.c img.c\
picread.c xpmhash.c xpmread.c gifread.c pixmaps.c\
medcut.c mo-hdf.c hotfile.c child.c mailto.c readJPEG.c readPNG.c\
accept.c cciServer.c cciBindings.c cciBindings2.c support.c bla.c\
comment.c kcms.c md5.c proxy-dialogs.c proxy-misc.c gui-popup.c gui-ftp.c\
prefs.c
OBJS = main.o gui.o gui-dialogs.o gui-menubar.o gui-documents.o gui-news.o\
newsrc.o\
gui-extras.o mo-www.o mo-dtm.o hotlist.o history.o\
annotate.o pan.o grpan.o grpan-www.o audan.o globalhist.o img.o\
picread.o xpmhash.o xpmread.o gifread.o pixmaps.o\
medcut.o mo-hdf.o hotfile.o child.o mailto.o readJPEG.o readPNG.o\
accept.o cciServer.o cciBindings.o cciBindings2.o support.o bla.o\
comment.o kcms.o md5.o proxy-dialogs.o proxy-misc.o gui-popup.o gui-ftp.o\
prefs.o
AUXCFILES = hdf-browse.c
AUXOBJS = hdf-browse.o
default: $(MOSAIC)
hdf-browse.o: hdf-browse.c ../libhtmlw/HTML.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) hdf-browse.c
globalhist.o: globalhist.c ../libhtmlw/HTML.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) globalhist.c
$(MOSAIC): $(OBJS) $(AUXOBJS) $(HDFOBJS) $(PROGRAM_LIBS) $(DTM_LIBS)
$(PURIFY) $(CC) $(LDFLAGS) -o $(MOSAIC) $(OBJS) $(AUXOBJS) $(HDFOBJS) $(LIBS)
#HFILES = mosaic.h prefs.h prefs_defs.h xresources.h
#$(OBJS): $(HFILES)
#hotlist.o hotfile.o: hotlist.h
#gui.o: toolbar.h xresources.h ../libhtmlw/HTML.h bitmaps/*.xbm
#img.o: ../libhtmlw/HTML.h
#gui-documents.o: toolbar.h
#comment.o: comment.h
#kcms.o: kcms.h
#gui-popup.o: gui-popup.h
#pixmaps.o: pixmaps/*.xpm
#$(PIXMAPS)
#mo-dtm.o: ../libhtmlw/HTML.h
#prefs.o: prefs.h prefs_defs.h xresources.h
#depend:
# makedepend -m -- $(CFLAGS) -- $(CFILES)
wipe:
-rm -f Mosaic Mosaic-p Mosaic-q $(OBJS) core
clean:
-rm -f Mosaic Mosaic-p Mosaic-q *.o core
tags:
etags -t *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
main.o: cci.h port.h cciServer.h kcms.h
gui.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h port.h
gui.o: gui-documents.h main.h mo-www.h gui-menubar.h proxy.h pan.h pixmaps.h
gui.o: ../libwww2/HTAAUtil.h ../libhtmlw/HTML.h xresources.h cci.h
gui.o: pixmaps/*.xpm
gui.o: bitmaps/*.xbm
gui-dialogs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-dialogs.o: gui-dialogs.h gui-documents.h gui.h mo-www.h
gui-dialogs.o: ../libhtmlw/HTML.h ../libnut/system.h
gui-menubar.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-menubar.o: main.h ../libhtmlw/HTML.h gui.h grpan.h gui-ftp.h gui-popup.h
gui-menubar.o: hotlist.h gui-dialogs.h gui-news.h cci.h port.h
gui-menubar.o: cciBindings.h cciBindings2.h cciServer.h history.h pan.h
gui-menubar.o: annotate.h mo-www.h globalhist.h proxy.h
gui-menubar.o: ../libwww2/HTAAUtil.h
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
gui-documents.o: history.h ../libhtmlw/HTML.h cci.h port.h cciBindings.h
gui-news.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
gui-news.o: gui-news.h ../libnut/system.h ../libhtmlw/HTML.h newsrc.h
gui-news.o: ../libwww2/HTNews.h ../libwww2/HTAccess.h ../libwww2/HTUtils.h
gui-news.o: ../libwww2/HTString.h ../libwww2/HTAnchor.h ../libwww2/HTList.h
gui-news.o: ../libwww2/HTAtom.h ../libwww2/HTFormat.h ../libwww2/HTStream.h
gui-news.o: ../src/newsrc.h
newsrc.o: mosaic.h newsrc.h ../libXmx/Xmx.h toolbar.h
newsrc.o: prefs.h prefs_defs.h
gui-extras.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
gui-extras.o: gui-extras.h mo-www.h ../libhtmlw/HTML.h ../libnut/system.h
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
mo-www.o: mo-www.h ../libwww2/HTAAUtil.h ../libwww2/HTUtils.h
mo-www.o: ../libwww2/HTString.h ../libwww2/tcp.h ../libwww2/HTTCP.h
mo-www.o: ../libwww2/HTParse.h ../libwww2/HTAccess.h ../libwww2/HTAnchor.h
mo-www.o: ../libwww2/HTList.h ../libwww2/HTAtom.h ../libwww2/HTFormat.h
mo-www.o: ../libwww2/HTStream.h ../libwww2/HTML.h ../libwww2/HTMLDTD.h
mo-www.o: ../libwww2/SGML.h ../libwww2/HText.h ../libwww2/HTInit.h
mo-www.o: gui-dialogs.h gui.h
mo-dtm.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h mo-dtm.h
hotlist.o: mosaic.h ../libXmx/Xmx.h toolbar.h
hotlist.o: prefs.h prefs_defs.h hotlist.h hotfile.h gui.h
hotlist.o: mo-www.h bitmaps/hotlist.xbm ../libnut/system.h
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
history.o: gui.h mo-www.h gui-popup.h ../libhtmlw/HTML.h
history.o: hotlist.h ../libwww2/HTAAUtil.h
annotate.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
annotate.o: mo-www.h pan.h grpan.h bitmaps/annotate.xbm ../libnut/system.h
pan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h pan.h
pan.o: ../libhtmlw/HTML.h
grpan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h grpan.h
grpan.o: grpan-www.h pan.h mo-www.h
grpan-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
grpan-www.o: grpan-www.h
audan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h audan.h
audan.o: gui.h pan.h mo-www.h ../libnut/system.h
globalhist.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
globalhist.o: mo-www.h globalhist.h ../libhtmlw/HTML.h ../libnut/system.h
img.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h img.h
img.o: mo-www.h globalhist.h picread.h ../libhtmlw/HTML.h cci.h port.h
img.o: bitmaps/gopher_image.xbm bitmaps/gopher_movie.xbm
img.o: bitmaps/gopher_menu.xbm bitmaps/gopher_text.xbm
img.o: bitmaps/gopher_sound.xbm bitmaps/gopher_index.xbm
img.o: bitmaps/gopher_telnet.xbm bitmaps/gopher_binary.xbm
img.o: bitmaps/gopher_unknown.xbm
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
picread.o: picread.h gifread.h xpmread.h readJPEG.h readPNG.h
xpmhash.o: xpm.h
xpmread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h xpmread.h
gifread.o: gifread.h
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
pixmaps.o: pixmaps.h xpmread.h xpm.h
pixmaps.o: pixmaps/*.xpm
mo-hdf.o: mosaic.h ../libXmx/Xmx.h toolbar.h
mo-hdf.o: prefs.h prefs_defs.h mo-hdf.h mo-dtm.h
hotfile.o: mosaic.h ../libXmx/Xmx.h toolbar.h
hotfile.o: prefs.h prefs_defs.h hotlist.h mo-www.h ../libhtmlw/HTML.h
child.o: child.h list.h
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
mailto.o: ../libnut/url-utils.h ../libnut/system.h
readJPEG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readJPEG.h
readPNG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readPNG.h
accept.o: port.h accept.h memStuffForPipSqueeks.h
cciServer.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
cciServer.o: memStuffForPipSqueeks.h cci.h port.h accept.h
cciBindings.o: cci.h port.h mosaic.h ../libXmx/Xmx.h
cciBindings.o: toolbar.h prefs.h prefs_defs.h gui.h
cciBindings.o: cciServer.h cciBindings.h cciBindings2.h pan.h mo-www.h
cciBindings.o: annotate.h ../libhtmlw/HTML.h
cciBindings2.o: mosaic.h ../libXmx/Xmx.h
cciBindings2.o: toolbar.h prefs.h prefs_defs.h gui.h cci.h port.h
cciBindings2.o: cciBindings2.h cciServer.h list.h memStuffForPipSqueeks.h
cciBindings2.o: ../libwww2/HTFormat.h ../libwww2/HTUtils.h
cciBindings2.o: ../libwww2/HTString.h /usr/include/stdarg.h
cciBindings2.o: ../libwww2/HTStream.h ../libwww2/HTAtom.h ../libwww2/HTList.h
cciBindings2.o: ../libwww2/HTAnchor.h
support.o: cci.h port.h
bla.o: cciServer.h cci.h port.h list.h
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h /usr/include/stdarg.h
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
bla.o: ../libwww2/HTMLDTD.h ../libwww2/SGML.h ../libwww2/HTCompressed.h
comment.o: mosaic.h ../libXmx/Xmx.h toolbar.h
comment.o: prefs.h prefs_defs.h gui.h comment.h
kcms.o: kcms.h
md5.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h md5.h
proxy-dialogs.o: proxy.h mosaic.h ../libXmx/Xmx.h
proxy-dialogs.o: toolbar.h prefs.h prefs_defs.h
proxy-misc.o: proxy.h
gui-popup.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-popup.o: gui-ftp.h mo-www.h gui-popup.h ../libhtmlw/HTML.h hotlist.h
gui-popup.o: gui-documents.h
gui-ftp.o: mosaic.h ../libXmx/Xmx.h toolbar.h
gui-ftp.o: prefs.h prefs_defs.h gui.h gui-ftp.h gui-popup.h
gui-ftp.o: ../libhtmlw/HTML.h hotlist.h ../libnut/system.h
prefs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h

228
src/Makefile.orig Normal file
View File

@@ -0,0 +1,228 @@
All: $(MOSAIC)
LIBHTMLW_DIR = ../libhtmlw
LIBXMX_DIR = ../libXmx
LIBXMX_INC = ../libXmx
LIBPNG_DIR = ../libpng
PROGRAM_LIBS = $(LIBWWW_DIR)/libwww.a $(LIBHTMLW_DIR)/libhtmlw.a $(LIBXMX_DIR)/libXmx.a $(LIBNUT_DIR)/libnut.a
LIBS = $(PROGRAM_LIBS) $(X_LIBS) $(PNG_LIBS) $(DTM_LIBS) $(HDF_LIBS) $(WAIS_LIBS) $(JPEG_LIBS) $(KRB_LIBS) $(MATH_LIB) $(SYS_LIBS)
CFILES = main.c gui.c gui-dialogs.c gui-menubar.c gui-documents.c gui-news.c\
newsrc.c\
gui-extras.c mo-www.c mo-dtm.c hotlist.c history.c\
annotate.c pan.c grpan.c grpan-www.c audan.c globalhist.c img.c\
picread.c xpmhash.c xpmread.c gifread.c pixmaps.c\
medcut.c mo-hdf.c hotfile.c child.c mailto.c readJPEG.c readPNG.c\
accept.c cciServer.c cciBindings.c cciBindings2.c support.c bla.c\
comment.c kcms.c md5.c proxy-dialogs.c proxy-misc.c gui-popup.c gui-ftp.c\
prefs.c
OBJS = main.o gui.o gui-dialogs.o gui-menubar.o gui-documents.o gui-news.o\
newsrc.o\
gui-extras.o mo-www.o mo-dtm.o hotlist.o history.o\
annotate.o pan.o grpan.o grpan-www.o audan.o globalhist.o img.o\
picread.o xpmhash.o xpmread.o gifread.o pixmaps.o\
medcut.o mo-hdf.o hotfile.o child.o mailto.o readJPEG.o readPNG.o\
accept.o cciServer.o cciBindings.o cciBindings2.o support.o bla.o\
comment.o kcms.o md5.o proxy-dialogs.o proxy-misc.o gui-popup.o gui-ftp.o\
prefs.o
AUXCFILES = hdf-browse.c
AUXOBJS = hdf-browse.o
hdf-browse.o: hdf-browse.c ../libhtmlw/HTML.h
$(CC) -c $(CFLAGS) $(AUX_CFLAGS) hdf-browse.c
globalhist.o: globalhist.c ../libhtmlw/HTML.h
$(CC) -c $(CFLAGS) $(AUX_CFLAGS) globalhist.c
$(MOSAIC): $(OBJS) $(AUXOBJS) $(HDFOBJS) $(PROGRAM_LIBS) $(DTM_LIBS)
$(PURIFY) $(CC) $(LDFLAGS) -o $(MOSAIC) $(OBJS) $(AUXOBJS) $(HDFOBJS) $(LIBS)
#HFILES = mosaic.h prefs.h prefs_defs.h xresources.h
#$(OBJS): $(HFILES)
#hotlist.o hotfile.o: hotlist.h
#gui.o: toolbar.h xresources.h ../libhtmlw/HTML.h bitmaps/*.xbm
#img.o: ../libhtmlw/HTML.h
#gui-documents.o: toolbar.h
#comment.o: comment.h
#kcms.o: kcms.h
#gui-popup.o: gui-popup.h
#pixmaps.o: pixmaps/*.xpm
#$(PIXMAPS)
#mo-dtm.o: ../libhtmlw/HTML.h
#prefs.o: prefs.h prefs_defs.h xresources.h
#depend:
# makedepend -m -- $(CFLAGS) -- $(CFILES)
wipe:
-rm -f Mosaic Mosaic-p Mosaic-q $(OBJS) core
clean:
-rm -f Mosaic Mosaic-p Mosaic-q *.o core
tags:
etags -t *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
main.o: cci.h port.h cciServer.h kcms.h
gui.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h port.h
gui.o: gui-documents.h main.h mo-www.h gui-menubar.h proxy.h pan.h pixmaps.h
gui.o: ../libwww2/HTAAUtil.h ../libhtmlw/HTML.h xresources.h cci.h
gui.o: pixmaps/*.xpm
gui.o: bitmaps/*.xbm
gui-dialogs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-dialogs.o: gui-dialogs.h gui-documents.h gui.h mo-www.h
gui-dialogs.o: ../libhtmlw/HTML.h ../libnut/system.h
gui-menubar.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-menubar.o: main.h ../libhtmlw/HTML.h gui.h grpan.h gui-ftp.h gui-popup.h
gui-menubar.o: hotlist.h gui-dialogs.h gui-news.h cci.h port.h
gui-menubar.o: cciBindings.h cciBindings2.h cciServer.h history.h pan.h
gui-menubar.o: annotate.h mo-www.h globalhist.h proxy.h
gui-menubar.o: ../libwww2/HTAAUtil.h
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
gui-documents.o: history.h ../libhtmlw/HTML.h cci.h port.h cciBindings.h
gui-news.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
gui-news.o: gui-news.h ../libnut/system.h ../libhtmlw/HTML.h newsrc.h
gui-news.o: ../libwww2/HTNews.h ../libwww2/HTAccess.h ../libwww2/HTUtils.h
gui-news.o: ../libwww2/HTString.h ../libwww2/HTAnchor.h ../libwww2/HTList.h
gui-news.o: ../libwww2/HTAtom.h ../libwww2/HTFormat.h ../libwww2/HTStream.h
gui-news.o: ../src/newsrc.h
newsrc.o: mosaic.h newsrc.h ../libXmx/Xmx.h toolbar.h
newsrc.o: prefs.h prefs_defs.h
gui-extras.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
gui-extras.o: gui-extras.h mo-www.h ../libhtmlw/HTML.h ../libnut/system.h
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
mo-www.o: mo-www.h ../libwww2/HTAAUtil.h ../libwww2/HTUtils.h
mo-www.o: ../libwww2/HTString.h ../libwww2/tcp.h ../libwww2/HTTCP.h
mo-www.o: ../libwww2/HTParse.h ../libwww2/HTAccess.h ../libwww2/HTAnchor.h
mo-www.o: ../libwww2/HTList.h ../libwww2/HTAtom.h ../libwww2/HTFormat.h
mo-www.o: ../libwww2/HTStream.h ../libwww2/HTML.h ../libwww2/HTMLDTD.h
mo-www.o: ../libwww2/SGML.h ../libwww2/HText.h ../libwww2/HTInit.h
mo-www.o: gui-dialogs.h gui.h
mo-dtm.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h mo-dtm.h
hotlist.o: mosaic.h ../libXmx/Xmx.h toolbar.h
hotlist.o: prefs.h prefs_defs.h hotlist.h hotfile.h gui.h
hotlist.o: mo-www.h bitmaps/hotlist.xbm ../libnut/system.h
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
history.o: gui.h mo-www.h gui-popup.h ../libhtmlw/HTML.h
history.o: hotlist.h ../libwww2/HTAAUtil.h
annotate.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
annotate.o: mo-www.h pan.h grpan.h bitmaps/annotate.xbm ../libnut/system.h
pan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h pan.h
pan.o: ../libhtmlw/HTML.h
grpan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h grpan.h
grpan.o: grpan-www.h pan.h mo-www.h
grpan-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
grpan-www.o: grpan-www.h
audan.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h audan.h
audan.o: gui.h pan.h mo-www.h ../libnut/system.h
globalhist.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
globalhist.o: mo-www.h globalhist.h ../libhtmlw/HTML.h ../libnut/system.h
img.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h img.h
img.o: mo-www.h globalhist.h picread.h ../libhtmlw/HTML.h cci.h port.h
img.o: bitmaps/gopher_image.xbm bitmaps/gopher_movie.xbm
img.o: bitmaps/gopher_menu.xbm bitmaps/gopher_text.xbm
img.o: bitmaps/gopher_sound.xbm bitmaps/gopher_index.xbm
img.o: bitmaps/gopher_telnet.xbm bitmaps/gopher_binary.xbm
img.o: bitmaps/gopher_unknown.xbm
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
picread.o: picread.h gifread.h xpmread.h readJPEG.h readPNG.h
xpmhash.o: xpm.h
xpmread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h xpmread.h
gifread.o: gifread.h
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
pixmaps.o: pixmaps.h xpmread.h xpm.h
pixmaps.o: pixmaps/*.xpm
mo-hdf.o: mosaic.h ../libXmx/Xmx.h toolbar.h
mo-hdf.o: prefs.h prefs_defs.h mo-hdf.h mo-dtm.h
hotfile.o: mosaic.h ../libXmx/Xmx.h toolbar.h
hotfile.o: prefs.h prefs_defs.h hotlist.h mo-www.h ../libhtmlw/HTML.h
child.o: child.h list.h
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
mailto.o: ../libnut/url-utils.h ../libnut/system.h
readJPEG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readJPEG.h
readPNG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readPNG.h
accept.o: port.h accept.h memStuffForPipSqueeks.h
cciServer.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
cciServer.o: memStuffForPipSqueeks.h cci.h port.h accept.h
cciBindings.o: cci.h port.h mosaic.h ../libXmx/Xmx.h
cciBindings.o: toolbar.h prefs.h prefs_defs.h gui.h
cciBindings.o: cciServer.h cciBindings.h cciBindings2.h pan.h mo-www.h
cciBindings.o: annotate.h ../libhtmlw/HTML.h
cciBindings2.o: mosaic.h ../libXmx/Xmx.h
cciBindings2.o: toolbar.h prefs.h prefs_defs.h gui.h cci.h port.h
cciBindings2.o: cciBindings2.h cciServer.h list.h memStuffForPipSqueeks.h
cciBindings2.o: ../libwww2/HTFormat.h ../libwww2/HTUtils.h
cciBindings2.o: ../libwww2/HTString.h /usr/include/stdarg.h
cciBindings2.o: ../libwww2/HTStream.h ../libwww2/HTAtom.h ../libwww2/HTList.h
cciBindings2.o: ../libwww2/HTAnchor.h
support.o: cci.h port.h
bla.o: cciServer.h cci.h port.h list.h
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h /usr/include/stdarg.h
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
bla.o: ../libwww2/HTMLDTD.h ../libwww2/SGML.h ../libwww2/HTCompressed.h
comment.o: mosaic.h ../libXmx/Xmx.h toolbar.h
comment.o: prefs.h prefs_defs.h gui.h comment.h
kcms.o: kcms.h
md5.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h md5.h
proxy-dialogs.o: proxy.h mosaic.h ../libXmx/Xmx.h
proxy-dialogs.o: toolbar.h prefs.h prefs_defs.h
proxy-misc.o: proxy.h
gui-popup.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
gui-popup.o: gui-ftp.h mo-www.h gui-popup.h ../libhtmlw/HTML.h hotlist.h
gui-popup.o: gui-documents.h
gui-ftp.o: mosaic.h ../libXmx/Xmx.h toolbar.h
gui-ftp.o: prefs.h prefs_defs.h gui.h gui-ftp.h gui-popup.h
gui-ftp.o: ../libhtmlw/HTML.h hotlist.h ../libnut/system.h
prefs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h

289
src/accept.c Normal file
View File

@@ -0,0 +1,289 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#ifdef linux
#define SCREWY_BLOCKING
#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#ifdef SCREWY_BLOCKING
#include <sys/fcntl.h>
#endif
/*For memset*/
#include <memory.h>
#ifdef MOTOROLA
#include <sys/filio.h>
#endif
#ifdef DGUX
#include <sys/file.h>
#endif
#ifdef SVR4
#ifndef SCO
#ifndef DGUX
#include <sys/filio.h>
#endif
#endif
#endif
#include "port.h"
#include "accept.h"
#include "memStuffForPipSqueeks.h"
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
ListenAddress NetServerInitSocket(portNumber)
/* return -1 on error */
int portNumber;
{
ListenAddress socketFD;
struct sockaddr_in serverAddress;
struct protoent *protocolEntry;
protocolEntry = getprotobyname("tcp");
if (protocolEntry) {
socketFD = socket(AF_INET, SOCK_STREAM,protocolEntry->p_proto);
}
else {
socketFD = socket(AF_INET, SOCK_STREAM,0);
}
if (socketFD < 0) {
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"Can't create socket.\n");
}
#endif
return(-1);
}
/* bzero((char *) &serverAddress, sizeof(serverAddress));*/
memset((char *) &serverAddress, 0, sizeof(serverAddress));
serverAddress.sin_family = AF_INET;
serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);
serverAddress.sin_port = htons(portNumber);
if (bind(socketFD, (struct sockaddr *) &serverAddress,
sizeof(serverAddress))<0){
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"Can't bind to address.\n");
}
#endif
return(-1);
}
#ifdef SCREWY_BLOCKING
/* set socket to non-blocking for linux */
fcntl(socketFD,FNDELAY,0);
#endif
if (listen(socketFD,5) == -1) {
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"Can't listen.\n");
}
#endif
return(-1);
}
#ifndef SCREWY_BLOCKING
/* set socket to non-blocking */
ioctl(socketFD,FIONBIO,0);
#endif
return(socketFD);
}
PortDescriptor *NetServerAccept(socketFD)
/* accept a connection off of a base socket */
/* do not block! */
/* return NULL if no connection else return PortDescriptor* */
ListenAddress socketFD;
{
int newSocketFD;
struct sockaddr_in clientAddress;
int clientAddressLength;
PortDescriptor *c;
/* it's assumed that the socketFD has already been set to non block*/
clientAddressLength = sizeof(clientAddress);
newSocketFD = accept(socketFD,(struct sockaddr *) &clientAddress,
&clientAddressLength);
if (newSocketFD < 0) {
return(NULL);
}
/* we have connection */
if (!(c =(PortDescriptor *)MALLOC(sizeof(PortDescriptor)))){
return(0);
}
c->socketFD = newSocketFD;
c->numInBuffer = 0;
return(c);
}
int NetRead(c,buffer,bufferSize)
/* read input from port, return number of bytes read */
PortDescriptor *c;
char *buffer;
int bufferSize;
{
int length;
length = read(c->socketFD, buffer, bufferSize);
return(length);
}
int NetServerWrite(c,buffer,bufferSize)
/* send buffer, return number of bytes sent */
PortDescriptor *c;
char *buffer;
int bufferSize;
{
int length;
length = write(c->socketFD,buffer,bufferSize);
return(length);
}
int NetCloseConnection(c)
/* close the connection */
PortDescriptor *c;
{
close(c->socketFD);
}
int NetCloseAcceptPort(s)
int s;
{
close(s);
}
int NetIsThereInput(p)
/* Do a non block check on socket for input and return 1 for yes, 0 for no */
PortDescriptor *p;
{
static struct timeval timeout = { 0L , 0L };
/*int val;*/
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(p->socketFD,&readfds);
if (0 < select(32, &readfds, 0, 0, &timeout)){
return(1);
}
else {
return(0);
}
}
int NetIsThereAConnection(socketFD)
/* Do a non block check on socket for input and return 1 for yes, 0 for no */
int socketFD;
{
static struct timeval timeout = { 0L , 0L };
/*int val;*/
fd_set readfds;
FD_ZERO(&readfds);
FD_SET(socketFD,&readfds);
if (0 < select(32, &readfds, 0, 0, &timeout)){
return(1);
}
else {
return(0);
}
}
int NetGetSocketDescriptor(s)
/* extract socket file descriptor from the Port structure */
PortDescriptor *s;
{
return(s->socketFD);
}

9
src/accept.h Normal file
View File

@@ -0,0 +1,9 @@
typedef int ListenAddress;
extern ListenAddress NetServerInitSocket();
extern PortDescriptor *NetServerAccept();
extern int NetRead();
extern int NetServerWrite();
extern int NetCloseConnection();
extern int NetIsThereInput();

913
src/annotate.c Normal file
View File

@@ -0,0 +1,913 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "mo-www.h"
#include "pan.h"
#include "grpan.h"
#include <pwd.h>
#include <sys/types.h>
#include <Xm/ToggleB.h>
#include <Xm/TextF.h>
#include "bitmaps/annotate.xbm"
#include "libnut/system.h"
typedef enum
{
mo_new_annotation = 0, mo_edit_annotation
} mo_amode;
/* ---------------------- mo_is_editable_annotation ----------------------- */
mo_status mo_is_editable_annotation (mo_window *win, char *text)
{
if (!win->current_node)
return mo_fail;
/*
* In group annotations we first need to check if this document is one,
* and we also need to set the annotation_type in current_node so we do the
* right thing when the Delete or Edit menus items are selected.
*/
/* For now, it can only be a pan or a grpan. */
if (mo_is_editable_grpan (text) == mo_succeed)
{
win->current_node->annotation_type = mo_annotation_workgroup;
return mo_succeed;
}
else if (mo_is_editable_pan (text) == mo_succeed)
{
win->current_node->annotation_type = mo_annotation_private;
return mo_succeed;
}
else
{
win->current_node->annotation_type = mo_annotation_private;
return mo_fail;
}
}
/* ---------------------- mo_fetch_annotation_links ----------------------- */
char *mo_fetch_annotation_links (char *url, int on_top)
{
char *pans, *grpans;
char *msg; /* used to compose the merged annotation returns */
char *uniqdoc = mo_url_to_unique_document (url);
char *rv = NULL;
pans = mo_fetch_pan_links (uniqdoc, on_top);
grpans = mo_fetch_grpan_links (uniqdoc);
/* Merge into pans */
if (!pans && !grpans)
{
/* pans is already NULL, do nothing */
}
else if (pans && !grpans)
{
/* pans is all there is, do nothing */
}
else if (!pans && grpans)
{
/* grpans is all there is, swap pans and grpans */
pans = grpans;
grpans = NULL;
}
else /* both exist */
{
char *ret = (char *)malloc (strlen (pans) + strlen (grpans) + 8);
strcpy (ret, grpans);
strcat (ret, pans);
free (grpans);
free (pans);
pans = ret;
}
/*
* If we have no annotations, return NULL now
*/
if (pans == NULL)
goto done;
/*
* Compose the annotations into msg, adding a line at either the top or
* bottom depending on where the annotations will appear.
*/
msg = (char *)malloc (strlen (pans) + 40);
if (on_top)
{
strcpy (msg, pans);
strcat (msg, "<hr>\n");
}
else
{
strcpy (msg, "<hr>\n");
strcat (msg, pans);
}
free(pans);
rv = msg;
done:
free (uniqdoc);
return rv;
}
/* ------------------------- set_annotation_mode -------------------------- */
static void set_annotation_mode (mo_window *win, int mode)
{
win->annotation_mode = mode;
XmxSetSensitive
(win->delete_button,
mode == mo_edit_annotation ? XmxSensitive : XmxNotSensitive);
return;
}
/* ----------------------- mo_post_annotate_window ------------------------ */
static XmxCallback (annotate_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
/* char *msg, *fnam, *cmd;
FILE *fp;*/
if (!win->current_node)
{
XtUnmanageChild (win->annotate_win);
return;
}
switch (XmxExtractToken ((int)client_data))
{
case 0:
/*
* When finished with the annotation window, do the right thing based
* on whether this is private or group, and whether this is an edit or
* a new annotation.
*/
if (win->pubpri == mo_annotation_public ||
win->pubpri == mo_annotation_workgroup)
{
char *txt = XmxTextGetString (win->annotate_text);
/* Make sure text exists before actually annotating. */
/* In the case of editing, no text should result in
a delete. */
if (txt && *txt)
{
if (win->annotation_mode == mo_new_annotation)
{
char *title = XmxTextGetString (win->annotate_title);
char *author = XmxTextGetString (win->annotate_author);
int i;
if (!title || !*title)
title = strdup ("Annotation with no title");
if (!author || !*author)
author = strdup ("No Author");
/* This is a temporary fix because Eric's real
fix doesn't seem to be working. */
for (i = 0; i < strlen (title); i++)
if (title[i] == '\"')
title[i] = '\'';
for (i = 0; i < strlen (author); i++)
if (author[i] == '\"')
author[i] = '\'';
/*
* Add the new annotation to the server -- with its real URL
* if inside an HDF file, else the canonical form.
*/
mo_new_grpan(mo_url_to_unique_document
(win->current_node->url), title, author, txt);
mo_set_win_current_node (win, win->current_node);
}
else /* edit annotation */
{
char *title = XmxTextGetString (win->annotate_title);
char *author = XmxTextGetString (win->annotate_author);
int i;
if (!title || !*title)
title = strdup ("Annotation with no title");
if (!author || !*author)
author = strdup ("No Author");
/* This is a temporary fix because Eric's real
fix doesn't seem to be working. */
for (i = 0; i < strlen (title); i++)
if (title[i] == '\"')
title[i] = '\'';
for (i = 0; i < strlen (author); i++)
if (author[i] == '\"')
author[i] = '\'';
/*
* Change the annotation on the server
*/
mo_modify_grpan(mo_url_to_unique_document
(win->current_node->url),
title, author, txt);
mo_reload_window_text (win, 0);
}
}
XtUnmanageChild (win->annotate_win);
}
else
{
char *txt = XmxTextGetString (win->annotate_text);
/* Make sure text exists before actually annotating. */
/* In the case of editing, no text should result in
a delete. */
if (txt && *txt)
{
if (win->annotation_mode == mo_new_annotation)
{
mo_new_pan
(mo_url_to_unique_document (win->current_node->url),
XmxTextGetString (win->annotate_title),
XmxTextGetString (win->annotate_author),
txt);
/* Inefficient, but safe. */
mo_write_pan_list ();
mo_set_win_current_node (win, win->current_node);
}
else /* edit annotation */
{
mo_modify_pan (win->editing_id,
XmxTextGetString (win->annotate_title),
XmxTextGetString (win->annotate_author),
txt);
/* Inefficient, but safe. */
mo_write_pan_list ();
mo_reload_window_text (win, 0);
}
}
XtUnmanageChild (win->annotate_win);
}
break;
case 1:
XtUnmanageChild (win->annotate_win);
/* Do nothing. */
break;
case 2:
mo_open_another_window
(win,
mo_assemble_help_url ("help-on-annotate-win.html"),
NULL, NULL);
break;
}
return;
}
#ifdef GRPAN_PASSWD
static XmxCallback (passwd_toggle_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
int on = XmToggleButtonGetState (win->passwd_toggle);
if (on)
{
XmxSetSensitive (win->passwd_label, XmxSensitive);
XmxSetSensitive (win->annotate_passwd, XmxSensitive);
}
else
{
XmxSetSensitive (win->passwd_label, XmxNotSensitive);
XmxSetSensitive (win->annotate_passwd, XmxNotSensitive);
XmxTextSetString (win->annotate_passwd, "\0");
}
return;
}
#endif
/* ---------------------- clear slate & include file ---------------------- */
static void do_slate (mo_window *win)
{
struct passwd *pw = getpwuid (getuid ());
/* Namestr has to be long, as passwd entries are now getting absurdly long. */
char namestr[1000];
sprintf (namestr, "%s (%s)",
get_pref_string(eDEFAULT_AUTHOR_EMAIL),
get_pref_string(eDEFAULT_AUTHOR_NAME));
XmxTextSetString (win->annotate_author, namestr);
sprintf (namestr, "%s %s","Annotation by",
get_pref_string(eDEFAULT_AUTHOR_NAME));
XmxTextSetString (win->annotate_title, namestr);
#ifdef GRPAN_PASSWD
XmxTextSetString (win->annotate_passwd, "\0");
#endif
XmxTextSetString (win->annotate_text, "\0");
return;
}
static XmxCallback (include_fsb_cb)
{
char *fname, efname[MO_LINE_LENGTH];
FILE *fp;
char line[MO_LINE_LENGTH], *status;
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
if (!win)
return;
XtUnmanageChild (win->include_fsb);
fname = (char *)malloc (128 * sizeof (char));
XmStringGetLtoR (((XmFileSelectionBoxCallbackStruct *)call_data)->value,
XmSTRING_DEFAULT_CHARSET,
&fname);
pathEval (efname, fname);
fp = fopen (efname, "r");
if (!fp)
{
char *buf, *final, tmpbuf[80];
int final_len;
buf=my_strerror(errno);
if (!buf || !*buf || !strcmp(buf,"Error 0")) {
sprintf(tmpbuf,"Uknown Error");
buf=tmpbuf;
}
final_len=30+((!efname || !*efname?3:strlen(efname))+13)+15+(strlen(buf)+13);
final=(char *)calloc(final_len,sizeof(char));
sprintf(final,"\nUnable to Open File:\n %s\n\nOpen Error:\n %s\n",(!efname || !*efname?" ":efname),buf);
XmxMakeErrorDialog (win->annotate_win,
final,
"Annotation Open Error");
XtManageChild (Xmx_w);
if (final) {
free(final);
final=NULL;
}
return;
}
while (1)
{
long pos;
status = fgets (line, MO_LINE_LENGTH, fp);
if (!status || !(*line))
goto done;
XmTextInsert (win->annotate_text,
pos = XmTextGetInsertionPosition (win->annotate_text),
line);
/* move insertion position to past this line to avoid inserting the
lines in reverse order */
XmTextSetInsertionPosition (win->annotate_text, pos + strlen(line));
}
done:
return;
}
static XmxCallback (include_button_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
if (!win->include_fsb)
{
win->include_fsb = XmxMakeFileSBDialog
(win->annotate_win,
"NCSA Mosaic: Include File In Annotation",
"Name of file to include:",
include_fsb_cb, 0);
}
else
{
XmFileSelectionDoSearch (win->include_fsb, NULL);
}
XmxManageRemanage (win->include_fsb);
return;
}
static XmxCallback (clear_button_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
do_slate (win);
return;
}
/* ------------------------- mo_delete_annotation ------------------------- */
mo_status mo_delete_annotation (mo_window *win, int id)
{
/* Delete the annotation currently being viewed. */
extern char *home_document;
if (!win->current_node)
return mo_fail;
mo_delete_pan (id);
/* Now that we've deleted the annotation, take care of
business. Damn, but this shouldn't have to happen here. */
if (win->current_node->previous)
{
mo_node *prev = win->current_node->previous;
mo_kill_node (win, win->current_node);
prev->next = NULL;
win->current_node = prev;
/* Set the text. */
mo_reload_window_text (win, 0);
}
else
{
/* No previous node; this only happens if someone's dumb enough
to have his/her home document be a personal annotation which
he/she then deletes. */
mo_kill_node (win, win->current_node);
win->current_node = NULL;
win->history = NULL;
mo_load_window_text (win, home_document, NULL);
}
return mo_succeed;
}
mo_status mo_delete_group_annotation (mo_window *win, char *url)
{
/* Delete the annotation currently being viewed. */
extern char *home_document;
if (!win->current_node)
return mo_fail;
mo_delete_grpan (mo_url_to_unique_document (url));
/* Now that we've deleted the annotation, take care of
business. Damn, but this shouldn't have to happen here. */
if (win->current_node->previous)
{
mo_node *prev = win->current_node->previous;
mo_kill_node (win, win->current_node);
prev->next = NULL;
win->current_node = prev;
/* Set the text. */
mo_reload_window_text (win, 0);
}
else
{
/* No previous node; this only happens if someone's dumb enough
to have his/her home document be a group annotation which
he/she then deletes. */
mo_kill_node (win, win->current_node);
win->current_node = NULL;
win->history = NULL;
mo_load_window_text (win, home_document, NULL);
}
return mo_succeed;
}
static XmxCallback (delete_button_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
XtUnmanageChild (win->annotate_win);
if (!win->current_node)
return;
if (win->current_node->annotation_type == mo_annotation_private)
{
mo_delete_annotation (win, win->editing_id);
}
else if (win->current_node->annotation_type == mo_annotation_workgroup)
{
mo_delete_group_annotation (win, win->current_node->url);
}
return;
}
/* ---------------------------- public/private ---------------------------- */
XmxOptionMenuStruct *pubpri_opts;
#ifdef GRPAN_PASSWD
static void do_privacy (mo_window *win)
{
/* If pubpri = mo_annotation_public, unfreeze the appropriate
GUI pieces. Else, freeze 'em. */
int on = XmToggleButtonGetState (win->passwd_toggle);
if (win->pubpri == mo_annotation_public ||
win->pubpri == mo_annotation_workgroup)
{
/* Match current state of on. */
if (on)
{
XmxSetSensitive (win->passwd_label, XmxSensitive);
XmxSetSensitive (win->annotate_passwd, XmxSensitive);
}
XmxSetSensitive (win->passwd_toggle, XmxSensitive);
XtVaSetValues (win->passwd_toggle, XmNfillOnSelect, True, NULL);
}
else
{
/* We're private. No password, nohow. */
XmxSetSensitive (win->passwd_label, XmxNotSensitive);
XmxSetSensitive (win->annotate_passwd, XmxNotSensitive);
XmxTextSetString (win->annotate_passwd, "\0");
XmxSetSensitive (win->passwd_toggle, XmxNotSensitive);
XtVaSetValues (win->passwd_toggle, XmNfillOnSelect, False, NULL);
}
return;
}
#endif
static XmxCallback (pubpri_opts_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
win->pubpri = XmxExtractToken ((int)client_data);
#ifdef GRPAN_PASSWD
do_privacy (win);
#endif
return;
}
/* OK, here's how we're gonna work this.
There will still only be one annotate window per document view window.
The annotate window will either be in new_annotation or edit_annotation mode.
This mode will be stored in win->annotation_mode.
Only routines in this file will touch that mode.
The mode will be set upon entry to mo_post_annotate_win.
If mo_post_annotate_win is told it's supposed to edit,
then it installs title, author, text, etc. as it sees fit.
If, while in edit mode, 'Clear Slate' gets hit,
mode flips to mo_edit_annotation regardless -- everything's wiped out.
*/
static void make_annotate_win (mo_window *win)
{
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget annotate_form/*, yap_label*/;
Widget logo;
Widget author_label, title_label, text_label;
Widget include_button, clear_button;
Widget sep;
#ifdef GRPAN_PASSWD
Widget passwd_frame, passwd_f;
#endif
/* Create it for the first time. */
XmxSetUniqid (win->id);
XmxSetArg (XmNresizePolicy, XmRESIZE_GROW);
win->annotate_win = XmxMakeFormDialog
(win->base, "NCSA Mosaic: Annotate Window" );
dialog_frame = XmxMakeFrame (win->annotate_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
annotate_form = XmxMakeForm (dialog_frame);
author_label = XmxMakeLabel (annotate_form, "Annotation Author:" );
win->annotate_author = XmxMakeTextField (annotate_form);
title_label = XmxMakeLabel (annotate_form, "Annotation Title:" );
win->annotate_title = XmxMakeTextField (annotate_form);
/* Let's just not do any of this shit if we don't have
group annotations yet. */
win->pubpri_menu = XmxRMakeOptionMenu
(annotate_form, "", pubpri_opts_cb, pubpri_opts);
XmxRSetSensitive (win->pubpri_menu, mo_annotation_public, XmxNotSensitive);
if (!get_pref_string(eANNOTATION_SERVER))
XmxRSetSensitive (win->pubpri_menu, mo_annotation_workgroup,
XmxNotSensitive);
win->pubpri = mo_annotation_private;
#ifdef GRPAN_PASSWD
/* --- Frame for the password fields. --- */
XmxSetArg (XmNmarginWidth, 4);
XmxSetArg (XmNmarginHeight, 4);
XmxSetArg (XmNadjustLast, True);
passwd_frame = XmxMakeFrame (annotate_form, XmxShadowEtchedOut);
passwd_f = XmxMakeForm (passwd_frame);
{
win->passwd_toggle = XmxMakeToggleButton
(passwd_f, "Password Protection" , passwd_toggle_cb, 0);
XmxSetToggleButton (win->passwd_toggle, XmxSet);
win->passwd_label = XmxMakeLabel (passwd_f, "Password:" );
XmxSetArg (XmNcolumns, 20);
win->annotate_passwd = XmxMakeTextField (passwd_f);
XmxSetOffsets (win->passwd_toggle, 1, 0, 2, 10);
XmxSetConstraints
(win->passwd_toggle, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_NONE, NULL, NULL, NULL, NULL);
XmxSetOffsets (win->passwd_label, 1, 0, 15, 10);
XmxSetConstraints
(win->passwd_label, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_WIDGET, XmATTACH_NONE, NULL, NULL, win->passwd_toggle, NULL);
XmxSetOffsets (win->annotate_passwd, 1, 0, 6, 6);
XmxSetConstraints
(win->annotate_passwd, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_WIDGET, XmATTACH_FORM, NULL, NULL, win->passwd_label, NULL);
}
#endif
logo = XmxMakeNamedLabel (annotate_form, NULL, "logo");
XmxApplyBitmapToLabelWidget
(logo, annotate_bits, annotate_width, annotate_height);
sep = XmxMakeHorizontalSeparator (annotate_form);
text_label = XmxMakeLabel
(annotate_form, "Enter the annotation text:");
clear_button = XmxMakePushButton
(annotate_form, "Clean Slate" , clear_button_cb, 0);
include_button = XmxMakePushButton
(annotate_form, "Include File..." , include_button_cb, 0);
win->delete_button = XmxMakePushButton
(annotate_form, "Delete" , delete_button_cb, 0);
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
XmxSetArg (XmNscrolledWindowMarginHeight, 8);
XmxSetArg (XmNcursorPositionVisible, True);
XmxSetArg (XmNeditable, True);
XmxSetArg (XmNeditMode, XmMULTI_LINE_EDIT);
XmxSetArg (XmNrows, 15);
XmxSetArg (XmNcolumns, 80);
win->annotate_text = XmxMakeScrolledText (annotate_form);
dialog_sep = XmxMakeHorizontalSeparator (annotate_form);
buttons_form = XmxMakeFormAndThreeButtonsSqueezed
(annotate_form, annotate_win_cb, "Save" ,
"Dismiss" , "Help..." ,
0, 1, 2);
/* Constraints for annotate_form. */
/* author_label: top form, bottom nothing,
left form, right nothing. */
XmxSetOffsets (author_label, 14, 10, 10, 10);
XmxSetConstraints
(author_label, XmATTACH_FORM, XmATTACH_NONE,
XmATTACH_FORM, XmATTACH_NONE, NULL, NULL, NULL, NULL);
/* annotate_author: top form, bottom nothing,
left author_label, right logo. */
XmxSetOffsets (win->annotate_author, 10, 10, 10, 10);
XmxSetConstraints
(win->annotate_author, XmATTACH_FORM, XmATTACH_NONE,
XmATTACH_WIDGET, XmATTACH_WIDGET,
NULL, NULL, author_label, logo);
/* title_label: top annotate_author, bottom nothing,
left form, right nothing */
XmxSetOffsets (title_label, 14, 10, 10, 10);
XmxSetConstraints
(title_label, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_FORM, XmATTACH_NONE,
win->annotate_author, NULL, NULL, NULL);
/* annotate_title: top annotate_author, bottom nothing,
left title_label, right logo. */
XmxSetOffsets (win->annotate_title, 10, 10, 10, 10);
XmxSetConstraints
(win->annotate_title, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_WIDGET, XmATTACH_WIDGET,
win->annotate_author, NULL, title_label, logo);
#ifdef GRPAN_PASSWD
XmxSetOffsets (win->pubpri_menu->base, 19, 10, 0, 10);
#else
XmxSetOffsets (win->pubpri_menu->base, 10, 10, 0, 10);
#endif
XmxSetConstraints
(win->pubpri_menu->base, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_FORM, XmATTACH_NONE,
win->annotate_title, NULL, NULL, NULL);
#ifdef GRPAN_PASSWD
/* passwd_frame: top annotate_title, bottom nothing,
left pubpri_menu, right form */
XmxSetOffsets (passwd_frame, 10, 10, 10, 10);
XmxSetConstraints
(passwd_frame, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_WIDGET, XmATTACH_FORM,
win->annotate_title, NULL, win->pubpri_menu->base, NULL);
XmxSetOffsets (sep, 10, 0, 0, 0);
XmxSetConstraints
(sep, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
XmATTACH_FORM, passwd_frame, NULL, NULL, NULL);
#else /* not GRPAN_PASSWD */
XmxSetOffsets (sep, 10, 0, 0, 0);
XmxSetConstraints
(sep, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
XmATTACH_FORM, win->pubpri_menu->base, NULL, NULL, NULL);
#endif /* not GRPAN_PASSWD */
/* text_label: top sep, bottom nothing,
left form, right nothing */
XmxSetOffsets (text_label, 12, 0, 10, 10);
XmxSetConstraints
(text_label, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_FORM, XmATTACH_NONE,
sep, NULL, NULL, NULL);
/* Buttons */
XmxSetOffsets (clear_button, 8, 0, 0, 3);
XmxSetConstraints
(clear_button, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_NONE, XmATTACH_WIDGET,
sep, NULL, NULL, include_button);
XmxSetOffsets (include_button, 8, 0, 0, 3);
XmxSetConstraints
(include_button, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_NONE, XmATTACH_WIDGET,
sep, NULL, NULL, win->delete_button);
XmxSetOffsets (win->delete_button, 8, 0, 10, 10);
XmxSetConstraints
(win->delete_button, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_NONE, XmATTACH_FORM,
sep, NULL, NULL, NULL);
/* logo: top form, bottom nothing,
left nothing, right form. */
XmxSetOffsets (logo, 5, 10, 10, 5);
XmxSetConstraints
(logo, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE, XmATTACH_FORM,
NULL, NULL, NULL, NULL);
XmxSetOffsets (XtParent (win->annotate_text), 0, 2, 0, 0);
XmxSetConstraints
(XtParent (win->annotate_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
XmATTACH_FORM, XmATTACH_FORM,
text_label, dialog_sep, NULL, NULL);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
XmATTACH_FORM,
NULL, buttons_form, NULL, NULL);
XmxSetConstraints
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM,
NULL, NULL, NULL, NULL);
XtRealizeWidget (win->annotate_win);
do_slate (win);
#ifdef GRPAN_PASSWD
do_privacy (win);
#endif
win->include_fsb = 0;
return;
}
/* For editing, we should pass in:
(x) a flag to indicate that we're editing
(a) the URL we're annotation
(b) the ID of the current annotation
(c) the starting Title
(d) the starting Author
(e) the starting Text.
(f) the original filename (probably not needed). */
/* If editflag is high, then:
* window title should change (to Edit Annotation)
* 'Annotate' should change to 'Commit'.
Right now this doesn't happen. */
mo_status mo_post_annotate_win
(mo_window *win, int edit_flag, int id, char *title, char *author,
char *text, char *fname)
{
if (!win->current_node)
return mo_fail;
/* First thing we do is create the window if it doesn't exist yet. */
if (!win->annotate_win)
make_annotate_win (win);
/* If we're in edit mode, then do the right thing. */
if (edit_flag)
{
set_annotation_mode (win, mo_edit_annotation);
win->editing_id = id;
/*
* When editing an annotation, we need to set pubpri
* properly so the right thing happens when we hit commit.
*/
if (win->current_node->annotation_type == mo_annotation_private)
win->pubpri = mo_annotation_private;
else if (win->current_node->annotation_type == mo_annotation_workgroup)
win->pubpri = mo_annotation_workgroup;
XmxRSetOptionMenuHistory(win->pubpri_menu, win->pubpri);
XmxTextSetString (win->annotate_author, author);
XmxTextSetString (win->annotate_title, title);
#ifdef GRPAN_PASSWD
XmxTextSetString (win->annotate_passwd, "\0");
#endif
XmxTextSetString (win->annotate_text, text);
XmTextSetTopCharacter (win->annotate_text, 0);
}
else
{
set_annotation_mode (win, mo_new_annotation);
}
/* Finally, we manage. */
XmxManageRemanage (win->annotate_win);
return mo_succeed;
}

77
src/annotate.h Normal file
View File

@@ -0,0 +1,77 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __ANNOTATE_H__
#define __ANNOTATE_H__
mo_status mo_post_annotate_win(mo_window *win, int, int,
char *, char *, char *, char *);
char *mo_fetch_annotation_links (char *, int);
mo_status mo_is_editable_annotation (mo_window *, char *);
mo_status mo_delete_annotation (mo_window *, int);
mo_status mo_delete_group_annotation (mo_window *, char *);
#endif

404
src/audan.c Normal file
View File

@@ -0,0 +1,404 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "audan.h"
#include "gui.h"
#include "pan.h"
#include "mo-www.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <pwd.h>
#include "libnut/system.h"
#ifdef HAVE_AUDIO_ANNOTATIONS
/* Check and make sure that the recording command we named
in the resource is actually there and executable. */
mo_status mo_audio_capable (void)
{
char *filename = get_pref_string(eRECORD_COMMAND_LOCATION);
struct stat buf;
int r;
r = stat (filename, &buf);
if (r != -1 && buf.st_mode & S_IXOTH)
return mo_succeed;
else
return mo_fail;
}
static XmxCallback (start_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
/* Take ourselves out of circulation. */
XmxSetSensitive (win->audio_start_button, XmxNotSensitive);
/* Come up with a new tmpnam. */
win->record_fnam = mo_tmpnam(win->current_node->url);
/* Fork off the recording process. */
if ((win->record_pid = fork ()) < 0)
{
/* Uh oh, no process. */
XmxMakeErrorDialog (win->audio_annotate_win,
"Unable to start audio recording process." ,
"Audio Annotation Error" );
XtManageChild (Xmx_w);
}
else if (win->record_pid == 0)
{
/* We're in the child. */
execl (get_pref_string(eRECORD_COMMAND_LOCATION),
get_pref_string(eRECORD_COMMAND),
win->record_fnam, (char *)0);
}
/* Let the user stop the record process. */
XmxSetSensitive (win->audio_stop_button, XmxSensitive);
}
static XmxCallback (stop_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
/* Take ourselves out of circulation. */
XmxSetSensitive (win->audio_stop_button, XmxNotSensitive);
/* Stop the record process. This works for both SGI recordaiff
and Sun record, apparently. */
kill (win->record_pid, SIGINT);
/* Wait until the process is dead. */
waitpid (win->record_pid, NULL, 0);
/* No more process. */
win->record_pid = 0;
/* Let the user make another recording. */
XmxSetSensitive (win->audio_start_button, XmxSensitive);
}
static XmxCallback (buttons_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
if (!win->current_node)
{
XtUnmanageChild (win->audio_annotate_win);
return;
}
switch (XmxExtractToken ((int)client_data))
{
case 0:
if (win->record_pid)
{
/* Stop the record process. */
kill (win->record_pid, SIGINT);
/* Wait until the process is dead. */
waitpid (win->record_pid, NULL, 0);
}
if (win->record_fnam)
{
if (win->audio_pubpri == mo_annotation_workgroup)
{
char namestr[200], titlestr[200];
unsigned char *data;
FILE *fp;
int len;
extern char *machine;
sprintf (namestr, "%s <%s>",
get_pref_string(eDEFAULT_AUTHOR_NAME),
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
sprintf (titlestr, "%s %s",
"Audio Annotation by" ,
get_pref_string(eDEFAULT_AUTHOR_NAME));
len = 0;
fp = fopen(win->record_fnam, "r");
if (fp != NULL)
{
/*
* Fine the length of the file the really cheesy way!
*/
fseek(fp, 0L, 0);
fseek(fp, 0L, 2);
len = ftell(fp);
fseek(fp, 0L, 0);
data = (unsigned char *)malloc(len * sizeof(unsigned char));
if (data != NULL)
{
len = fread(data, sizeof(char), len, fp);
}
else
{
len = 0;
}
fclose(fp);
}
if (len <= 0)
{
XmxMakeErrorDialog
(win->base, "Unable to complete audio annotation." ,
"Audio Annotation Error" );
XtManageChild (Xmx_w);
}
mo_audio_grpan(win->current_node->url, titlestr, namestr,
(char *)data, len);
if (data)
free((char *)data);
mo_set_win_current_node (win, win->current_node);
}
else
{
/* Do the right thing. */
int pan_id = mo_next_pan_id ();
char *default_directory =
get_pref_string(ePRIVATE_ANNOTATION_DIRECTORY);
char filename[500], *cmd, namestr[200], textstr[500], titlestr[200];
extern char *machine;
#ifdef __sgi
sprintf (filename, "%s/%s/%s%d.aiff", getenv ("HOME"),
default_directory,
"PAN-", pan_id);
#else /* sun or hp */
sprintf (filename, "%s/%s/%s%d.au", getenv ("HOME"),
default_directory,
"PAN-", pan_id);
#endif
/*SWP -- New "mv" fucntion to take care of these /bin/mv things*/
{
char retBuf[BUFSIZ];
int status;
if ((status=my_move(win->record_fnam,filename,retBuf,BUFSIZ,1))!=SYS_SUCCESS) {
application_user_info_wait(retBuf);
return;
}
}
sprintf (titlestr, "%s %s",
"Audio Annotation by" ,
get_pref_string(eDEFAULT_AUTHOR_NAME));
sprintf (namestr, "%s <%s>",
get_pref_string(eDEFAULT_AUTHOR_NAME),
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
sprintf (textstr,
"This is an audio annotation. <P>\n\nTo hear the annotation, click <A HREF=\"file:%s\">here</A>. <P>\n" , filename);
mo_new_pan (win->current_node->url, titlestr, namestr,
textstr);
/* Inefficient, but safe. */
mo_write_pan_list ();
mo_set_win_current_node (win, win->current_node);
}
}
win->record_pid = 0;
win->record_fnam = 0;
XtUnmanageChild (win->audio_annotate_win);
break;
case 1:
if (win->record_pid)
{
/* Stop the record process. */
kill (win->record_pid, SIGINT);
/* Wait until the process is dead. */
waitpid (win->record_pid, NULL, 0);
win->record_pid = 0;
win->record_fnam = 0;
}
XtUnmanageChild (win->audio_annotate_win);
break;
case 2:
mo_open_another_window
(win,
mo_assemble_help_url ("help-on-audio-annotate.html"),
NULL, NULL);
break;
}
return;
}
extern XmxOptionMenuStruct *pubpri_opts;
static XmxCallback (pubpri_opts_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
win->audio_pubpri = XmxExtractToken ((int)client_data);
return;
}
mo_status mo_post_audio_annotate_win (mo_window *win)
{
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget audio_annotate_form, yap_label;
if (!win->current_node)
return mo_fail;
if (!win->audio_annotate_win)
{
/* Create it for the first time. */
XmxSetUniqid (win->id);
XmxSetArg (XmNresizePolicy, XmRESIZE_GROW);
win->audio_annotate_win = XmxMakeFormDialog
(win->base, "NCSA Mosaic: Audio Annotate Window" );
dialog_frame = XmxMakeFrame (win->audio_annotate_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
XmxSetArg (XmNfractionBase, 2);
audio_annotate_form = XmxMakeForm (dialog_frame);
yap_label = XmxMakeLabel
(audio_annotate_form, "Press Start to start recording; Stop to stop recording.\nRepeat until you're satisfied with the annotation.\nThen either Save or Dismiss the annotation." );
win->audio_start_button = XmxMakePushButton (audio_annotate_form,
"Start" ,
start_cb,
0);
win->audio_stop_button = XmxMakePushButton (audio_annotate_form,
"Stop" ,
stop_cb,
0);
win->audio_pubpri_menu = XmxRMakeOptionMenu
(audio_annotate_form, "", pubpri_opts_cb, pubpri_opts);
XmxRSetSensitive (win->audio_pubpri_menu, mo_annotation_public,
XmxNotSensitive);
if (! get_pref_string(eANNOTATION_SERVER))
XmxRSetSensitive (win->audio_pubpri_menu, mo_annotation_workgroup,
XmxNotSensitive);
win->audio_pubpri = mo_annotation_private;
dialog_sep = XmxMakeHorizontalSeparator (audio_annotate_form);
buttons_form = XmxMakeFormAndThreeButtons
(audio_annotate_form, buttons_cb, "Save" ,
"Dismiss" , "Help..." ,
0, 1, 2);
/* Constraints for audio_annotate_form. */
XmxSetOffsets (yap_label, 10, 10, 10, 10);
XmxSetConstraints
(yap_label, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
NULL, NULL, NULL, NULL);
XmxSetOffsets (win->audio_start_button, 10, 10, 10, 10);
XmxSetConstraints
(win->audio_start_button, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_FORM, XmATTACH_NONE,
yap_label, NULL, NULL, NULL);
XmxSetOffsets (win->audio_stop_button, 10, 10, 10, 10);
XmxSetConstraints
(win->audio_stop_button, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_WIDGET, XmATTACH_NONE,
yap_label, NULL, win->audio_start_button, NULL);
XmxSetOffsets (win->audio_pubpri_menu->base, 10, 10, 10, 10);
XmxSetConstraints
(win->audio_pubpri_menu->base, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_WIDGET, XmATTACH_FORM,
yap_label, NULL, win->audio_stop_button, NULL);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
XmATTACH_FORM,
win->audio_pubpri_menu->base, NULL, NULL, NULL);
XmxSetConstraints
(buttons_form, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
XmATTACH_FORM,
dialog_sep, NULL, NULL, NULL);
}
XmxManageRemanage (win->audio_annotate_win);
XmxSetSensitive (win->audio_stop_button, XmxNotSensitive);
XmxSetSensitive (win->audio_start_button, XmxSensitive);
return mo_succeed;
}
#endif

75
src/audan.h Normal file
View File

@@ -0,0 +1,75 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __AUDAN_H__
#define __AUDAN_H__
#ifdef HAVE_AUDIO_ANNOTATIONS
mo_status mo_audio_capable (void);
mo_status mo_post_audio_annotate_win (mo_window *);
#endif
#endif

46
src/bitmaps/annotate.xbm Normal file
View File

@@ -0,0 +1,46 @@
#define annotate_width 64
#define annotate_height 64
static char annotate_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x10, 0x00, 0x00, 0x1c, 0x1d, 0x1d, 0x8e, 0xc7, 0x79, 0x1c, 0x00,
0xa2, 0xb3, 0x33, 0x11, 0x21, 0x12, 0x22, 0x00, 0x22, 0x21, 0xa1, 0x20,
0x21, 0x12, 0x21, 0x00, 0x38, 0x21, 0xa1, 0x20, 0x81, 0x13, 0x3f, 0x00,
0x26, 0x21, 0xa1, 0x20, 0x61, 0x12, 0x01, 0x00, 0x22, 0x21, 0xa1, 0x20,
0x21, 0x12, 0x01, 0x00, 0xb2, 0x21, 0x21, 0x11, 0x25, 0x5b, 0x22, 0x00,
0xec, 0xf3, 0x73, 0x0e, 0xc2, 0x26, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xff, 0xff, 0x3f, 0xc0, 0x3f, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x00,
0x90, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x00, 0x88, 0x00, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x00, 0x84, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x00,
0x82, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x00, 0x81, 0x00, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x80, 0x80, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0xc0,
0xff, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40,
0x00, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40,
0x00, 0x00, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x40, 0x00, 0x1f, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40,
0x00, 0x23, 0x00, 0x20, 0xc0, 0x20, 0x00, 0x40, 0x00, 0x43, 0x00, 0x20,
0xc0, 0x20, 0x00, 0x40, 0x00, 0x83, 0x00, 0x20, 0xc0, 0xe0, 0xff, 0xff,
0xff, 0x03, 0x01, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0xc0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20,
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x20, 0xc0, 0xff, 0xff, 0xff,
0xff, 0x03, 0x01, 0x20, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x20,
0x00, 0x00, 0x00, 0x40, 0x00, 0x43, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40,
0x00, 0x23, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x1f, 0x00, 0x20,
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0x01, 0x20, 0xe0, 0xe0, 0x00, 0x40,
0x00, 0x80, 0x01, 0x20, 0xe0, 0xe0, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f,
0xe0, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf1, 0xe0, 0xc3,
0x03, 0x8f, 0xc1, 0x07, 0xe0, 0xf1, 0xf0, 0xe7, 0x83, 0x9f, 0xe1, 0x07,
0x60, 0xdb, 0x38, 0x6e, 0x80, 0x98, 0x71, 0x00, 0x60, 0xdb, 0x18, 0xec,
0x01, 0x9f, 0x31, 0x00, 0x60, 0xdb, 0x18, 0xcc, 0x83, 0x9f, 0x31, 0x00,
0x60, 0xde, 0x18, 0x0c, 0xc7, 0x98, 0x31, 0x00, 0x60, 0xce, 0x38, 0x2e,
0xc6, 0x98, 0x71, 0x04, 0x60, 0xce, 0xf0, 0xe7, 0xc7, 0xbf, 0xe1, 0x07,
0x60, 0xc0, 0xe0, 0xc3, 0x83, 0xb3, 0xc1, 0x03};

10
src/bitmaps/busy_1.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_1_width 18
#define busy_1_height 18
#define busy_1_x_hot 8
#define busy_1_y_hot 8
static char busy_1_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x14, 0xa0, 0x00, 0x74, 0xbc, 0x00,
0xf4, 0xbf, 0x00, 0xe4, 0x9f, 0x00, 0xe4, 0x9f, 0x00, 0xc4, 0x8f, 0x00,
0x84, 0x87, 0x00, 0x84, 0x84, 0x00, 0x44, 0x88, 0x00, 0x24, 0x90, 0x00,
0x24, 0x90, 0x00, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_1_mask_width 18
#define busy_1_mask_height 18
static unsigned char busy_1_mask_bits[] = {
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfe, 0xff, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xee, 0xdf, 0x01,
0xce, 0xcf, 0x01, 0xce, 0xcf, 0x01, 0xee, 0xdc, 0x01, 0x7e, 0xf8, 0x01,
0x7e, 0xf8, 0x01, 0x3e, 0xf0, 0x01, 0x3e, 0xf0, 0x01, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, };

10
src/bitmaps/busy_2.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_2_width 18
#define busy_2_height 18
#define busy_2_x_hot 8
#define busy_2_y_hot 8
static char busy_2_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00,
0xd4, 0xa7, 0x00, 0xe4, 0x9f, 0x00, 0xe4, 0x9f, 0x00, 0xc4, 0x8f, 0x00,
0x84, 0x87, 0x00, 0x84, 0x85, 0x00, 0x44, 0x89, 0x00, 0x24, 0x91, 0x00,
0x24, 0x91, 0x00, 0x14, 0xa1, 0x00, 0x14, 0xa1, 0x00, 0xd4, 0xaf, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_2_mask_width 18
#define busy_2_mask_height 18
static unsigned char busy_2_mask_bits[] = {
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xfe, 0xf7, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xee, 0xdf, 0x01,
0xce, 0xcf, 0x01, 0xce, 0xcf, 0x01, 0xee, 0xdf, 0x01, 0xfe, 0xfb, 0x01,
0xfe, 0xfb, 0x01, 0xbe, 0xf3, 0x01, 0xfe, 0xff, 0x01, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, };

10
src/bitmaps/busy_3.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_3_width 18
#define busy_3_height 18
#define busy_3_x_hot 8
#define busy_3_y_hot 8
static char busy_3_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00,
0x14, 0xa7, 0x00, 0xe4, 0x9f, 0x00, 0xe4, 0x9f, 0x00, 0xc4, 0x8f, 0x00,
0x84, 0x87, 0x00, 0x84, 0x87, 0x00, 0x44, 0x8b, 0x00, 0x24, 0x93, 0x00,
0x24, 0x93, 0x00, 0x14, 0xa3, 0x00, 0xd4, 0xa7, 0x00, 0xf4, 0xbf, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_3_mask_width 18
#define busy_3_mask_height 18
static unsigned char busy_3_mask_bits[] = {
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x3e, 0xf7, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xee, 0xdf, 0x01,
0xce, 0xcf, 0x01, 0xce, 0xcf, 0x01, 0xee, 0xdf, 0x01, 0xfe, 0xff, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xf7, 0x01, 0xfe, 0xff, 0x01, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, };

10
src/bitmaps/busy_4.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_4_width 18
#define busy_4_height 18
#define busy_4_x_hot 8
#define busy_4_y_hot 8
static char busy_4_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00,
0x14, 0xa0, 0x00, 0x24, 0x93, 0x00, 0xe4, 0x9f, 0x00, 0xc4, 0x8f, 0x00,
0x84, 0x87, 0x00, 0x84, 0x87, 0x00, 0x44, 0x8b, 0x00, 0x24, 0x93, 0x00,
0x24, 0x93, 0x00, 0x94, 0xa7, 0x00, 0xf4, 0xaf, 0x00, 0xf4, 0xbf, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_4_mask_width 18
#define busy_4_mask_height 18
static unsigned char busy_4_mask_bits[] = {
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x3e, 0xf0, 0x01,
0x3e, 0xf3, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xee, 0xdf, 0x01,
0xce, 0xcf, 0x01, 0xce, 0xcf, 0x01, 0xee, 0xdf, 0x01, 0xfe, 0xff, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, };

10
src/bitmaps/busy_5.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_5_width 18
#define busy_5_height 18
#define busy_5_x_hot 8
#define busy_5_y_hot 8
static char busy_5_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00,
0x14, 0xa0, 0x00, 0x24, 0x90, 0x00, 0x24, 0x93, 0x00, 0xc4, 0x8f, 0x00,
0x84, 0x87, 0x00, 0x84, 0x87, 0x00, 0x44, 0x8b, 0x00, 0x24, 0x93, 0x00,
0x24, 0x93, 0x00, 0xd4, 0xa7, 0x00, 0xf4, 0xbf, 0x00, 0xf4, 0xbf, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_5_mask_width 18
#define busy_5_mask_height 18
static unsigned char busy_5_mask_bits[] = {
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x3e, 0xf0, 0x01,
0x3e, 0xf0, 0x01, 0x7e, 0xfb, 0x01, 0xfe, 0xff, 0x01, 0xee, 0xdf, 0x01,
0xce, 0xcf, 0x01, 0xce, 0xcf, 0x01, 0xee, 0xdf, 0x01, 0xfe, 0xff, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, };

10
src/bitmaps/busy_6.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_6_width 18
#define busy_6_height 18
#define busy_6_x_hot 8
#define busy_6_y_hot 8
static char busy_6_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x14, 0xa0, 0x00, 0x14, 0xa0, 0x00,
0x14, 0xa0, 0x00, 0x24, 0x90, 0x00, 0x24, 0x90, 0x00, 0x44, 0x88, 0x00,
0x84, 0x84, 0x00, 0x84, 0x84, 0x00, 0x44, 0x88, 0x00, 0x24, 0x93, 0x00,
0xa4, 0x9f, 0x00, 0xf4, 0xbf, 0x00, 0xf4, 0xbf, 0x00, 0xf4, 0xbf, 0x00,
0xfe, 0xff, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_6_mask_width 18
#define busy_6_mask_height 18
static unsigned char busy_6_mask_bits[] = {
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0x3e, 0xf0, 0x01,
0x3e, 0xf0, 0x01, 0x7e, 0xf8, 0x01, 0x7e, 0xf8, 0x01, 0xee, 0xdc, 0x01,
0xce, 0xcf, 0x01, 0xce, 0xcf, 0x01, 0xee, 0xdf, 0x01, 0xfe, 0xff, 0x01,
0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xfe, 0xff, 0x01, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0xff, 0xff, 0x03, };

11
src/bitmaps/busy_7.xbm Normal file
View File

@@ -0,0 +1,11 @@
#define busy_7_width 24
#define busy_7_height 24
#define busy_7_x_hot 11
#define busy_7_y_hot 11
static char busy_7_bits[] = {
0x00, 0x08, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x16, 0x00, 0x00, 0x25, 0x00,
0x80, 0x44, 0x00, 0x40, 0x88, 0x00, 0x20, 0x10, 0x01, 0x10, 0x10, 0x02,
0x08, 0x10, 0x04, 0x04, 0x10, 0x08, 0x1e, 0x30, 0x10, 0x63, 0xe0, 0x67,
0x84, 0x07, 0x38, 0x08, 0x0c, 0x10, 0x10, 0xf8, 0x0f, 0x20, 0xf8, 0x07,
0x40, 0xf8, 0x03, 0x80, 0xf8, 0x01, 0x00, 0xf1, 0x00, 0x00, 0x72, 0x00,
0x00, 0x34, 0x00, 0x00, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,10 @@
#define busy_7_mask_width 24
#define busy_7_mask_height 24
static unsigned char busy_7_mask_bits[] = {
0x00, 0x1e, 0x00, 0x00, 0x3f, 0x00, 0x80, 0x7f, 0x00, 0xc0, 0xff, 0x00,
0xe0, 0xef, 0x01, 0xf0, 0xdc, 0x03, 0x78, 0xb8, 0x07, 0x3c, 0x38, 0x0f,
0x1e, 0x38, 0x1e, 0x1f, 0x38, 0x3c, 0x7f, 0xf8, 0xff, 0xff, 0xf7, 0xff,
0xef, 0xef, 0xff, 0xde, 0xff, 0x7f, 0x3c, 0xfc, 0x3f, 0x78, 0xfc, 0x1f,
0xf0, 0xfc, 0x0f, 0xe0, 0xfd, 0x07, 0xc0, 0xfb, 0x03, 0x80, 0xff, 0x01,
0x00, 0xff, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x1c, 0x00,
};

10
src/bitmaps/busy_8.xbm Normal file
View File

@@ -0,0 +1,10 @@
#define busy_8_width 18
#define busy_8_height 18
#define busy_8_x_hot 8
#define busy_8_y_hot 9
static char busy_8_bits[] = {
0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0xfe, 0xff, 0x01, 0x02, 0x00, 0x01,
0x1e, 0xe0, 0x01, 0x62, 0x18, 0x01, 0x82, 0x04, 0x01, 0x02, 0x03, 0x01,
0x02, 0x00, 0x01, 0x02, 0xfe, 0x01, 0x02, 0xff, 0x01, 0x82, 0xfc, 0x01,
0x62, 0xf8, 0x01, 0x1e, 0xe0, 0x01, 0x02, 0x00, 0x01, 0xfe, 0xff, 0x01,
0x02, 0x00, 0x01, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,8 @@
#define busy_8_mask_width 18
#define busy_8_mask_height 18
static unsigned char busy_8_mask_bits[] = {
0x07, 0x80, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03,
0x7f, 0xf8, 0x03, 0xff, 0xfc, 0x03, 0xe7, 0x9f, 0x03, 0x87, 0x87, 0x03,
0x07, 0xff, 0x03, 0x07, 0xff, 0x03, 0x87, 0xff, 0x03, 0xe7, 0xff, 0x03,
0xff, 0xfc, 0x03, 0x7f, 0xf8, 0x03, 0xff, 0xff, 0x03, 0xff, 0xff, 0x03,
0xff, 0xff, 0x03, 0x07, 0x80, 0x03, };

11
src/bitmaps/busy_9.xbm Executable file
View File

@@ -0,0 +1,11 @@
#define busy_9_width 24
#define busy_9_height 24
#define busy_9_x_hot 11
#define busy_9_y_hot 11
static char busy_9_bits[] = {
0x00, 0x08, 0x00, 0x00, 0x18, 0x00, 0x00, 0x34, 0x00, 0x00, 0x52, 0x00,
0x00, 0x89, 0x00, 0x80, 0x08, 0x01, 0x40, 0x08, 0x02, 0x20, 0xc8, 0x07,
0x10, 0xf8, 0x0f, 0x08, 0xfc, 0x1f, 0xc4, 0xff, 0x3f, 0x23, 0xf8, 0x63,
0x1e, 0x30, 0x10, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x10, 0x10, 0x02,
0x20, 0x08, 0x01, 0x40, 0x88, 0x00, 0x80, 0x44, 0x00, 0x00, 0x25, 0x00,
0x00, 0x16, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,10 @@
#define busy_9_mask_width 24
#define busy_9_mask_height 24
static unsigned char busy_9_mask_bits[] = {
0x00, 0x3c, 0x00, 0x00, 0x7e, 0x00, 0x00, 0xff, 0x00, 0x80, 0xff, 0x01,
0xc0, 0xdf, 0x03, 0xe0, 0x9d, 0x07, 0xf0, 0xdc, 0x0f, 0x78, 0xfc, 0x1f,
0x3c, 0xfc, 0x3f, 0xde, 0xff, 0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xf8, 0xfb, 0x1f, 0x38, 0x3c, 0x1e, 0x38, 0x1e, 0x3c, 0x38, 0x0f,
0x78, 0xbc, 0x07, 0xf0, 0xdc, 0x03, 0xe0, 0xef, 0x01, 0xc0, 0xff, 0x00,
0x80, 0x7f, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x1c, 0x00,
};

View File

@@ -0,0 +1,9 @@
#define gopher_binary_width 20
#define gopher_binary_height 23
static char gopher_binary_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x3f, 0x00, 0x01, 0x60, 0x00, 0x01, 0xa0, 0x00, 0x71, 0x26, 0x01,
0xd9, 0x26, 0x02, 0xd9, 0xe6, 0x07, 0xd9, 0xc6, 0x0f, 0xd9, 0x06, 0x0c,
0x71, 0x06, 0x0c, 0x01, 0x00, 0x0c, 0x99, 0x03, 0x0c, 0xd9, 0x06, 0x0c,
0xd9, 0x06, 0x0c, 0xd9, 0x06, 0x0c, 0xd9, 0x06, 0x0c, 0x99, 0x03, 0x0c,
0x01, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

View File

@@ -0,0 +1,9 @@
#define gopher_ftp_width 20
#define gopher_ftp_height 23
static char gopher_ftp_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0xff, 0x07, 0x02, 0x00, 0x0c, 0xba, 0xf7, 0x0c, 0xba, 0xf7, 0x0d,
0x1a, 0xb3, 0x0d, 0x3a, 0xb3, 0x0d, 0x3a, 0xf3, 0x0d, 0x1a, 0xf3, 0x0c,
0x1a, 0x33, 0x0c, 0x1a, 0x33, 0x0c, 0x02, 0x00, 0x0c, 0xfe, 0xff, 0x0f,
0xfc, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0xfe, 0xff, 0x07,
0xff, 0xff, 0x0f, 0xfe, 0xff, 0x07, 0x04, 0x00, 0x02};

View File

@@ -0,0 +1,9 @@
#define gopher_image_width 20
#define gopher_image_height 23
static char gopher_image_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x07, 0x01, 0x00, 0x0c, 0x01, 0x1c, 0x0c, 0x01, 0x22, 0x0c,
0x01, 0x26, 0x0c, 0x01, 0x29, 0x0c, 0x01, 0x19, 0x0c, 0x81, 0x10, 0x0c,
0x81, 0x0c, 0x0c, 0x41, 0x08, 0x0c, 0x41, 0x06, 0x0c, 0xc1, 0x04, 0x0c,
0xc1, 0x03, 0x0c, 0xc1, 0x01, 0x0c, 0xc1, 0x00, 0x0c, 0x41, 0x00, 0x0c,
0x01, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

View File

@@ -0,0 +1,9 @@
#define gopher_index_width 20
#define gopher_index_height 23
static char gopher_index_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x07, 0x01, 0x00, 0x0c, 0x81, 0x0f, 0x0c, 0x41, 0x18, 0x0c,
0x21, 0x33, 0x0c, 0xa1, 0x25, 0x0c, 0xc1, 0x24, 0x0c, 0x01, 0x32, 0x0c,
0x01, 0x19, 0x0c, 0x81, 0x0c, 0x0c, 0x81, 0x06, 0x0c, 0x01, 0x07, 0x0c,
0x01, 0x07, 0x0c, 0x81, 0x0c, 0x0c, 0x81, 0x0e, 0x0c, 0x01, 0x07, 0x0c,
0x01, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

View File

@@ -0,0 +1,9 @@
#define gopher_menu_width 20
#define gopher_menu_height 23
static char gopher_menu_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0x01, 0x00, 0x04, 0x02, 0x00, 0x02, 0x04, 0x00, 0x01, 0xf8, 0x01,
0x01, 0x00, 0x02, 0x01, 0x00, 0x04, 0x01, 0x00, 0x0e, 0x01, 0x00, 0x0d,
0x01, 0x00, 0x0e, 0x01, 0x00, 0x0d, 0x01, 0x00, 0x0e, 0x01, 0x00, 0x0d,
0x01, 0x00, 0x0e, 0x01, 0x00, 0x0d, 0x01, 0x00, 0x0e, 0x55, 0x55, 0x0d,
0xaa, 0xaa, 0x0e, 0xfc, 0xff, 0x07, 0xf8, 0xff, 0x03};

View File

@@ -0,0 +1,9 @@
#define gopher_movie_width 20
#define gopher_movie_height 23
static char gopher_movie_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x07, 0xf9, 0xff, 0x0c, 0x19, 0xe0, 0x0c, 0x1f, 0xc0, 0x0f,
0x19, 0xe0, 0x0c, 0x19, 0xc0, 0x0c, 0x1f, 0xe0, 0x0f, 0x59, 0xd5, 0x0c,
0xf9, 0xff, 0x0c, 0xff, 0xff, 0x0f, 0x19, 0xe0, 0x0c, 0x19, 0xc0, 0x0c,
0x1f, 0xe0, 0x0f, 0x19, 0xc0, 0x0c, 0x19, 0xe0, 0x0c, 0x5f, 0xd5, 0x0f,
0xf9, 0xff, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

View File

@@ -0,0 +1,9 @@
#define gopher_sound_width 20
#define gopher_sound_height 23
static char gopher_sound_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x07, 0x01, 0x00, 0x0c, 0x01, 0x40, 0x0c, 0x01, 0x91, 0x0c,
0x81, 0x21, 0x0d, 0x41, 0x49, 0x0d, 0x3d, 0x51, 0x0d, 0x05, 0x55, 0x0d,
0x05, 0x55, 0x0d, 0x05, 0x55, 0x0d, 0x3d, 0x55, 0x0d, 0x7d, 0x51, 0x0d,
0xc1, 0x49, 0x0d, 0x81, 0x21, 0x0d, 0x01, 0x91, 0x0c, 0x01, 0x40, 0x0c,
0x01, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

View File

@@ -0,0 +1,9 @@
#define gopher_telnet_width 20
#define gopher_telnet_height 23
static char gopher_telnet_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0xff, 0x07, 0x02, 0x00, 0x0c, 0x7a, 0x37, 0x0c, 0x7a, 0x37, 0x0c,
0x32, 0x33, 0x0c, 0x32, 0x37, 0x0c, 0x32, 0x37, 0x0c, 0x32, 0x33, 0x0c,
0x32, 0xf7, 0x0c, 0x32, 0xf7, 0x0c, 0x02, 0x00, 0x0c, 0xfe, 0xff, 0x0f,
0xfc, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0xfe, 0xff, 0x07,
0xff, 0xff, 0x0f, 0xfe, 0xff, 0x07, 0x04, 0x00, 0x02};

View File

@@ -0,0 +1,9 @@
#define gopher_text_width 20
#define gopher_text_height 23
static char gopher_text_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x3f, 0x00, 0x01, 0x60, 0x00, 0x01, 0xa0, 0x00, 0xf9, 0x27, 0x01,
0x01, 0x20, 0x02, 0xf1, 0xe7, 0x07, 0x01, 0xc0, 0x0f, 0xf9, 0x07, 0x0c,
0x01, 0x00, 0x0c, 0xe1, 0x07, 0x0c, 0x01, 0x00, 0x0c, 0xf9, 0x07, 0x0c,
0x01, 0x00, 0x0c, 0xe1, 0x07, 0x0c, 0x01, 0x00, 0x0c, 0xf9, 0x07, 0x0c,
0x01, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

View File

@@ -0,0 +1,9 @@
#define gopher_unknown_width 20
#define gopher_unknown_height 23
static char gopher_unknown_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xff, 0x3f, 0x00, 0x01, 0x60, 0x00, 0x01, 0xa0, 0x00, 0x01, 0x20, 0x01,
0x01, 0x20, 0x02, 0x01, 0xe0, 0x07, 0x01, 0xc0, 0x0f, 0x01, 0x00, 0x0c,
0x01, 0x00, 0x0c, 0x01, 0x00, 0x0c, 0x01, 0x00, 0x0c, 0x01, 0x00, 0x0c,
0x01, 0x00, 0x0c, 0x01, 0x00, 0x0c, 0x01, 0x00, 0x0c, 0x01, 0x00, 0x0c,
0x01, 0x00, 0x0c, 0xff, 0xff, 0x0f, 0xfe, 0xff, 0x0f};

46
src/bitmaps/hotlist.xbm Normal file
View File

@@ -0,0 +1,46 @@
#define hotlist_width 64
#define hotlist_height 64
static char hotlist_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0e, 0xf8, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x0f, 0x08,
0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0x0f, 0x0c, 0x00, 0x00, 0x00, 0x40,
0x00, 0xc0, 0x07, 0x8c, 0x00, 0x01, 0x00, 0x40, 0x00, 0xc0, 0xc3, 0x8f,
0x00, 0x01, 0x80, 0x40, 0x00, 0xe0, 0x61, 0x8c, 0x00, 0x01, 0x80, 0x40,
0x00, 0xe0, 0x61, 0x8c, 0x00, 0xe1, 0xe1, 0x47, 0x00, 0xf0, 0x60, 0x8c,
0x00, 0x11, 0x82, 0x40, 0x0e, 0x70, 0x60, 0x8c, 0xff, 0x09, 0x84, 0x40,
0x1e, 0x78, 0x60, 0x8c, 0x00, 0x09, 0x84, 0x40, 0x1e, 0x38, 0x60, 0x8c,
0x00, 0x09, 0x84, 0x40, 0x3e, 0x3c, 0x60, 0x8c, 0x00, 0x09, 0x84, 0x40,
0x7c, 0x1c, 0x60, 0x8c, 0x00, 0x09, 0x84, 0x40, 0xf8, 0x1e, 0xe0, 0x8f,
0x00, 0x11, 0x02, 0x41, 0xf0, 0x0f, 0xe0, 0x8f, 0x00, 0xe1, 0x01, 0x46,
0xf0, 0x0f, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x07, 0x00, 0x0c,
0x00, 0x00, 0x00, 0x40, 0xc0, 0x07, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x7f,
0x80, 0x03, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xf8, 0xff, 0xff, 0xff, 0x7f,
0x00, 0x00, 0x0f, 0x08, 0x00, 0x00, 0x00, 0x40, 0x00, 0x80, 0x0f, 0x0c,
0x00, 0x00, 0x00, 0x40, 0x00, 0xc0, 0x07, 0x8c, 0x00, 0x04, 0x00, 0x40,
0x00, 0xc0, 0xc3, 0x8f, 0x00, 0x04, 0x00, 0x41, 0x00, 0xe0, 0x61, 0x8c,
0x00, 0x00, 0x00, 0x41, 0x00, 0xe0, 0x61, 0x8c, 0x00, 0xc4, 0xc7, 0x4f,
0x00, 0xf0, 0x60, 0x8c, 0x00, 0x24, 0x08, 0x41, 0x0e, 0x70, 0x60, 0x8c,
0x00, 0x24, 0x08, 0x41, 0x1e, 0x78, 0x60, 0x8c, 0x00, 0x24, 0x00, 0x41,
0x1e, 0x38, 0x60, 0x8c, 0x00, 0xc4, 0x03, 0x41, 0x3e, 0x3c, 0x60, 0x8c,
0x00, 0x04, 0x04, 0x41, 0x7c, 0x1c, 0x60, 0x8c, 0x00, 0x24, 0x08, 0x41,
0xf8, 0x1e, 0xe0, 0x8f, 0x00, 0x24, 0x08, 0x42, 0xf0, 0x0f, 0xe0, 0x8f,
0x7f, 0xc4, 0x07, 0x4c, 0xf0, 0x0f, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x40,
0xc0, 0x07, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x40, 0xc0, 0x07, 0x00, 0xfc,
0xff, 0xff, 0xff, 0x7f, 0x80, 0x03, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x00, 0x00,
0x00, 0x80, 0x01, 0x00, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00,
0xe0, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf1, 0xe0, 0xc3,
0x03, 0x8f, 0xc1, 0x07, 0xe0, 0xf1, 0xf0, 0xe7, 0x83, 0x9f, 0xe1, 0x07,
0x60, 0xdb, 0x38, 0x6e, 0x80, 0x98, 0x71, 0x00, 0x60, 0xdb, 0x18, 0xec,
0x01, 0x9f, 0x31, 0x00, 0x60, 0xdb, 0x18, 0xcc, 0x83, 0x9f, 0x31, 0x00,
0x60, 0xde, 0x18, 0x0c, 0xc7, 0x98, 0x31, 0x00, 0x60, 0xce, 0x38, 0x2e,
0xc6, 0x98, 0x71, 0x04, 0x60, 0xce, 0xf0, 0xe7, 0xc7, 0xbf, 0xe1, 0x07,
0x60, 0xc0, 0xe0, 0xc3, 0x83, 0xb3, 0xc1, 0x03};

46
src/bitmaps/iconify.xbm Normal file
View File

@@ -0,0 +1,46 @@
#define iconify_width 64
#define iconify_height 64
static unsigned char iconify_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0xfc, 0xff,
0xff, 0xff, 0xff, 0x03, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xf8, 0xff, 0xff,
0xff, 0xff, 0xff, 0x03, 0x00, 0xfc, 0x0f, 0x00, 0x00, 0x80, 0xff, 0x03,
0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0xff, 0x01, 0x00, 0x7e, 0x00, 0x00,
0x00, 0x00, 0xfe, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00,
0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00,
0x80, 0x07, 0x00, 0x1c, 0x3f, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x03,
0xff, 0x00, 0x00, 0x00, 0x80, 0x07, 0x80, 0x80, 0xff, 0x01, 0x00, 0x00,
0x80, 0x07, 0x40, 0x80, 0xff, 0x03, 0x00, 0x00, 0x80, 0x07, 0x20, 0x80,
0xff, 0x07, 0x00, 0x00, 0x00, 0x0f, 0x30, 0x00, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x0f, 0x38, 0xe0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x1e, 0x38, 0xf0,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x3e, 0x3c, 0xf0, 0x1f, 0x3f, 0x00, 0x00,
0x00, 0x7c, 0x7c, 0x00, 0x0e, 0x3e, 0x00, 0x00, 0x00, 0xf8, 0xfd, 0xc3,
0x01, 0x30, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0x60, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0x0f, 0x60, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x0f, 0x60, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x60, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xff, 0x1f, 0xf0, 0x01, 0x00, 0x00, 0x00, 0xfe, 0xff,
0x3f, 0xf0, 0x07, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x7f, 0xb8, 0x1f, 0x00,
0x00, 0x00, 0xfc, 0xff, 0x7f, 0x38, 0x3e, 0x00, 0x00, 0x00, 0xfc, 0xff,
0x7f, 0x3c, 0x7c, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x1c, 0x78, 0x00,
0x00, 0x00, 0xf8, 0xff, 0x7f, 0x1e, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0xff,
0xff, 0x0e, 0xf0, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x06, 0xe0, 0x01,
0x00, 0x00, 0xc0, 0xff, 0x7f, 0x03, 0xe0, 0x01, 0x00, 0x00, 0x80, 0xff,
0xff, 0x01, 0xe0, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xe0, 0x01,
0x00, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0xe0,
0x07, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x00, 0xfc, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00,
0x80, 0xff, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0xff, 0x01, 0x00,
0x00, 0xf0, 0x3f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00,
0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0xff, 0x01, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0xc0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };

View File

@@ -0,0 +1,46 @@
#define iconify_mask_width 64
#define iconify_mask_height 64
static unsigned char iconify_mask_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf8,
0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0xf8, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
0xff, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0x00, 0xf8, 0x7f, 0x00, 0xfc, 0xff,
0xff, 0x7f, 0x00, 0xfc, 0x7f, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfe,
0x7f, 0x80, 0xff, 0xff, 0xff, 0xff, 0x83, 0xff, 0x3f, 0xc0, 0xff, 0x0f,
0xf0, 0xff, 0xff, 0xff, 0x3f, 0xe0, 0xff, 0x01, 0x80, 0xff, 0xff, 0xff,
0x3f, 0xe0, 0x7f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0xf0, 0x3f, 0x00,
0x00, 0xfc, 0xff, 0xff, 0x3f, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0xff, 0xff,
0x3f, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0xe0, 0x07, 0x00,
0x00, 0xe0, 0xff, 0xff, 0x3f, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x7f, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x80, 0x01, 0x00,
0x00, 0x80, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x80, 0x00, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0x01, 0xfe,
0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0x03, 0xfe, 0xff, 0xff, 0x03, 0x00,
0x00, 0xc0, 0x07, 0xfc, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0x07, 0xfc,
0xff, 0xff, 0x0f, 0x00, 0x00, 0xf0, 0x0f, 0xfc, 0xff, 0xff, 0x1f, 0x00,
0x00, 0xf8, 0x0f, 0xfc, 0xff, 0xff, 0x3f, 0x00, 0x00, 0xfc, 0x0f, 0xfc,
0xff, 0xff, 0x7f, 0x00, 0x00, 0xfe, 0x07, 0xfc, 0xff, 0xff, 0xff, 0x01,
0x80, 0xff, 0x07, 0xfc, 0xff, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0x03, 0xfc,
0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0x01, 0xfe, 0x7f, 0x00, 0xff, 0xff,
0xff, 0xff, 0x00, 0xfe, 0x3f, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0xfe,
0x1f, 0x00, 0xfc, 0xff, 0xff, 0x07, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x1f, 0x00, 0xfc, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff,
0x7f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, };

14
src/bitmaps/security.xbm Normal file
View File

@@ -0,0 +1,14 @@
#define security_width 32
#define security_height 32
static char security_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };

46
src/bitmaps/xmosaic.xbm Normal file
View File

@@ -0,0 +1,46 @@
#define xmosaic_width 64
#define xmosaic_height 64
static char xmosaic_bits[] = {
0x00, 0x00, 0x40, 0x55, 0x55, 0x55, 0x55, 0x04, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x44, 0x0c,
0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1d, 0x00, 0x40, 0xc4, 0xff,
0xff, 0xff, 0x7f, 0x1e, 0x00, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x40, 0xfe, 0x00, 0x00, 0x00, 0x50, 0x06, 0x00, 0x88, 0x0f, 0x55,
0x55, 0x55, 0x05, 0x01, 0x00, 0xc0, 0x57, 0x00, 0x00, 0x00, 0x40, 0x01,
0x00, 0xf2, 0x03, 0x11, 0x11, 0x11, 0x11, 0x03, 0x00, 0x70, 0x44, 0x44,
0x44, 0x44, 0x44, 0x03, 0x00, 0xb5, 0xf0, 0xff, 0xff, 0xff, 0x9f, 0x03,
0x00, 0x18, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0x80, 0x2c, 0x7f, 0x50,
0x55, 0x55, 0xc1, 0x01, 0x00, 0x4d, 0x4f, 0x05, 0x00, 0x00, 0x20, 0x00,
0x80, 0x94, 0x13, 0x10, 0x11, 0x11, 0x31, 0x00, 0x00, 0xc1, 0x44, 0x44,
0x44, 0x44, 0x64, 0x00, 0x40, 0x76, 0x10, 0xf1, 0xff, 0xff, 0x71, 0x00,
0x00, 0x23, 0xc5, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x40, 0x30, 0xf8, 0x3f,
0x00, 0x00, 0x7c, 0x00, 0x00, 0x55, 0xfc, 0x01, 0x00, 0x00, 0x10, 0x00,
0x00, 0x08, 0x1f, 0x54, 0x05, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x0f, 0x01,
0x10, 0x00, 0x00, 0x00, 0x00, 0x84, 0x43, 0x10, 0x01, 0x00, 0x00, 0x00,
0x00, 0xcc, 0x01, 0x44, 0x24, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x10, 0x10,
0x51, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x44, 0x84, 0x00, 0x00, 0x00,
0x00, 0x70, 0x08, 0x11, 0x91, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x44,
0x44, 0x01, 0x00, 0x00, 0x00, 0x18, 0x08, 0x11, 0x11, 0x01, 0x00, 0x00,
0x00, 0x14, 0x40, 0x44, 0x44, 0x03, 0x00, 0x00, 0x00, 0x10, 0x08, 0x11,
0x11, 0x03, 0x00, 0x00, 0x00, 0x10, 0x40, 0x44, 0x44, 0x03, 0x00, 0x00,
0x00, 0x00, 0x08, 0x11, 0x11, 0x03, 0x02, 0x00, 0x00, 0x00, 0x40, 0x44,
0xc4, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x11, 0x91, 0x03, 0x09, 0x00,
0x00, 0x00, 0x00, 0x44, 0xc4, 0x01, 0x0c, 0x00, 0x00, 0x00, 0x40, 0x11,
0xf1, 0x81, 0x65, 0x00, 0x00, 0x00, 0x00, 0x44, 0xf4, 0x00, 0x04, 0x00,
0x00, 0x00, 0x00, 0x11, 0x79, 0x20, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x46,
0x3e, 0x40, 0x33, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x88, 0x27, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x07, 0xc2, 0x11, 0x00, 0x00, 0x0a, 0x00, 0x00,
0x80, 0xf0, 0x16, 0x00, 0x80, 0xa0, 0xaa, 0xaa, 0x2a, 0xf4, 0x90, 0x00,
0x00, 0x10, 0x00, 0x00, 0x00, 0x7d, 0x4d, 0x00, 0x40, 0x44, 0x44, 0x44,
0x44, 0x3f, 0xa9, 0x00, 0x00, 0x11, 0x11, 0x11, 0xd1, 0x4f, 0x5c, 0x00,
0x80, 0xfc, 0xff, 0xff, 0xff, 0x13, 0x46, 0x00, 0x00, 0xfe, 0xff, 0xff,
0xff, 0x44, 0x5b, 0x00, 0x40, 0x1c, 0x00, 0x00, 0x00, 0xd1, 0x27, 0x00,
0x10, 0x55, 0x55, 0x55, 0x55, 0xe4, 0x31, 0x00, 0x40, 0x00, 0x00, 0x00,
0x40, 0x78, 0x35, 0x00, 0x08, 0x11, 0x11, 0x11, 0x11, 0x7e, 0x18, 0x00,
0x40, 0x44, 0x44, 0x44, 0xc4, 0x5f, 0x1c, 0x00, 0x90, 0xff, 0xff, 0xff,
0xff, 0x17, 0x0f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x45, 0x07, 0x00,
0x94, 0x01, 0x00, 0x00, 0x00, 0xd1, 0x03, 0x00, 0x40, 0x55, 0x55, 0x55,
0x55, 0xf4, 0x01, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x00, 0x00,
0x44, 0x44, 0x44, 0x44, 0x44, 0x3f, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11,
0xf1, 0x1f, 0x00, 0x00, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,
0xf0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,46 @@
#define xmosaic_down_width 64
#define xmosaic_down_height 64
static char xmosaic_down_bits[] = {
0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff,
0xff, 0xff, 0xff, 0x2f, 0x00, 0x00, 0xf8, 0x8f, 0x88, 0x88, 0x88, 0x88,
0x00, 0x00, 0xfc, 0x22, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x9f, 0x00,
0x00, 0x00, 0x00, 0x88, 0x00, 0x80, 0x2f, 0xaa, 0xaa, 0xaa, 0xaa, 0x02,
0x00, 0xc0, 0x8b, 0x00, 0x00, 0x00, 0x80, 0x29, 0x00, 0xe0, 0xa2, 0xff,
0xff, 0xff, 0xff, 0x03, 0x00, 0xf0, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x09,
0x00, 0x38, 0xfa, 0x23, 0x22, 0x22, 0x22, 0x02, 0x00, 0x18, 0x7e, 0x88,
0x88, 0x88, 0x88, 0x10, 0x00, 0xac, 0x1e, 0x02, 0x00, 0x00, 0x00, 0x02,
0x00, 0x8c, 0x27, 0xaa, 0xaa, 0xaa, 0xaa, 0x08, 0x00, 0xe4, 0x8b, 0x00,
0x00, 0x00, 0x38, 0x02, 0x00, 0xda, 0x22, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x62, 0xc8, 0xff, 0xff, 0xff, 0x3f, 0x01, 0x00, 0x3a, 0xf2, 0x8b,
0x88, 0x88, 0x88, 0x00, 0x00, 0x95, 0xfc, 0x22, 0x22, 0x22, 0x22, 0x02,
0x00, 0xb2, 0xbe, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x09, 0x2f, 0x54,
0x55, 0x55, 0x05, 0x01, 0x00, 0x68, 0x0f, 0x01, 0x00, 0x00, 0x50, 0x00,
0x00, 0x88, 0x43, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x11, 0xf8,
0x3f, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x02, 0x7c, 0x62, 0x00, 0x00, 0x00,
0x00, 0xf2, 0x04, 0x9e, 0x88, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x2f,
0x22, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x81, 0x8f, 0x88, 0x02, 0x00, 0x00,
0x00, 0x30, 0x80, 0x23, 0x22, 0x00, 0x00, 0x00, 0x00, 0x90, 0xc0, 0x89,
0x88, 0x08, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x23, 0x22, 0x02, 0x00, 0x00,
0x00, 0x40, 0xc0, 0x88, 0x88, 0x10, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x22,
0x22, 0x02, 0x08, 0x00, 0x00, 0x00, 0xc0, 0x88, 0x88, 0x10, 0x08, 0x00,
0x00, 0x00, 0xc0, 0x22, 0x22, 0x02, 0x28, 0x00, 0x00, 0x00, 0x80, 0x88,
0x88, 0x10, 0x18, 0x00, 0x00, 0x00, 0x80, 0x22, 0x22, 0x00, 0x24, 0x00,
0x00, 0x00, 0x00, 0x89, 0x88, 0x10, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x21,
0x22, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x08, 0x08, 0x0b, 0x00,
0x00, 0x00, 0x00, 0x24, 0x22, 0x80, 0x33, 0x00, 0x00, 0x00, 0x00, 0x80,
0x08, 0xc2, 0x21, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0xf0, 0xba, 0x00,
0x00, 0x00, 0x00, 0xa0, 0x2a, 0xf8, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00,
0x80, 0x3f, 0xaa, 0x00, 0x00, 0x3e, 0x00, 0x00, 0xfc, 0x1f, 0x0c, 0x02,
0x00, 0xfe, 0xff, 0xff, 0xff, 0xa3, 0xc4, 0x00, 0x00, 0x8e, 0xff, 0xff,
0x8f, 0x08, 0x6e, 0x02, 0x00, 0x26, 0x22, 0x22, 0x22, 0x22, 0x83, 0x00,
0x00, 0x8c, 0x88, 0x88, 0x08, 0xc8, 0x29, 0x01, 0x00, 0x04, 0x00, 0x00,
0xa0, 0xf2, 0xb2, 0x00, 0x80, 0x83, 0xaa, 0xaa, 0x0a, 0xfe, 0x34, 0x01,
0xc0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x18, 0x00, 0xc0, 0xf9, 0xff, 0xff,
0xff, 0x0f, 0xad, 0x00, 0xc0, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0e, 0x00,
0xc0, 0x88, 0x88, 0x88, 0x88, 0xc0, 0x4f, 0x00, 0x80, 0x02, 0x00, 0x00,
0x00, 0xea, 0x03, 0x00, 0x80, 0xa0, 0xaa, 0xaa, 0xaa, 0xf0, 0x11, 0x00,
0x60, 0x0a, 0x00, 0x00, 0x00, 0x7f, 0x02, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0xbf, 0x08, 0x00, 0x78, 0xfe, 0xff, 0xff, 0xff, 0x23, 0x02, 0x00,
0xb8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x30, 0x22, 0x22, 0x22,
0x22, 0x22, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
0x20, 0xaa, 0xaa, 0xaa, 0xaa, 0x02, 0x00, 0x00};

View File

@@ -0,0 +1,46 @@
#define xmosaic_left_width 64
#define xmosaic_left_height 64
static char xmosaic_left_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x3f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x38, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00,
0x75, 0x35, 0x0f, 0x00, 0xa0, 0xa0, 0x03, 0x00, 0x30, 0xd0, 0x0f, 0x00,
0x20, 0x43, 0x1c, 0x00, 0x79, 0x9a, 0x1e, 0x00, 0x00, 0x9d, 0x7a, 0x00,
0x30, 0x18, 0x0c, 0x00, 0x9c, 0xe0, 0xe2, 0x00, 0xb5, 0x1c, 0x0d, 0x00,
0xf4, 0xaa, 0xd5, 0x01, 0x30, 0x18, 0x04, 0x00, 0x82, 0x0b, 0x87, 0x03,
0xb9, 0xba, 0x06, 0x00, 0xa8, 0x67, 0x9e, 0x07, 0x30, 0x18, 0x06, 0x00,
0x20, 0x1e, 0x0c, 0x0e, 0xb5, 0x3c, 0x07, 0x00, 0x00, 0xbd, 0x7e, 0x0f,
0x30, 0x18, 0x06, 0x00, 0x80, 0x78, 0x38, 0x1c, 0xb9, 0xba, 0x06, 0x00,
0x00, 0x78, 0xf5, 0x3e, 0x30, 0x18, 0x06, 0x00, 0x00, 0xe2, 0x70, 0x38,
0xb5, 0x3c, 0x07, 0x00, 0x00, 0xf0, 0xea, 0x35, 0x30, 0x18, 0x06, 0xc0,
0x0f, 0xc4, 0xe1, 0x70, 0xb9, 0xba, 0x06, 0xf0, 0x3f, 0xe0, 0xc5, 0x7b,
0x30, 0x18, 0x06, 0x0c, 0x7c, 0x88, 0xc3, 0x61, 0xb5, 0x3c, 0x07, 0x52,
0xf5, 0xc0, 0xdb, 0xf5, 0x30, 0x18, 0x06, 0x01, 0xe0, 0x11, 0x83, 0xe1,
0xb9, 0xba, 0x46, 0xaa, 0xea, 0x83, 0xab, 0xe5, 0x30, 0x18, 0x06, 0x00,
0x80, 0x13, 0x83, 0xc1, 0xb5, 0x3c, 0x27, 0x55, 0x55, 0x47, 0xcb, 0xd5,
0x30, 0x18, 0x06, 0x00, 0x00, 0x17, 0x83, 0xc1, 0xb9, 0xba, 0xa6, 0xaa,
0xaa, 0x86, 0xab, 0xe5, 0x30, 0x18, 0x06, 0x00, 0x00, 0x16, 0x83, 0xc1,
0xb5, 0x3c, 0x27, 0x55, 0x55, 0x47, 0xcb, 0xd5, 0x30, 0x18, 0x0e, 0x00,
0x00, 0x16, 0x83, 0xc1, 0xb9, 0xba, 0xae, 0xaa, 0xaa, 0x82, 0xab, 0xe5,
0x30, 0x18, 0x0c, 0x00, 0x00, 0x12, 0x83, 0xc1, 0xb5, 0x5c, 0x2d, 0x55,
0x55, 0x43, 0xcb, 0xd5, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x11, 0x83, 0xc1,
0xb9, 0x5a, 0x5e, 0xa8, 0xaa, 0x80, 0xab, 0xe5, 0x70, 0x18, 0x1c, 0x00,
0x00, 0x10, 0x83, 0xc1, 0x75, 0x7d, 0x9d, 0x40, 0x25, 0x40, 0xcb, 0xd5,
0x60, 0x38, 0x18, 0x00, 0x00, 0x10, 0x83, 0xc1, 0x6a, 0xb9, 0x3a, 0x02,
0x08, 0x80, 0xab, 0xe5, 0xe0, 0x70, 0x78, 0xa8, 0x02, 0x10, 0x83, 0xc1,
0xf4, 0x75, 0x75, 0x00, 0x00, 0x40, 0xcb, 0xd5, 0xc0, 0xe3, 0xe0, 0x00,
0x00, 0x10, 0x83, 0xc1, 0xa8, 0xe3, 0xe4, 0x01, 0x00, 0x80, 0xab, 0xe5,
0x80, 0x8b, 0x81, 0x03, 0x00, 0x10, 0x83, 0xc1, 0x50, 0x47, 0x53, 0x0f,
0x00, 0x40, 0xcb, 0xd5, 0x00, 0x2e, 0x0e, 0x1c, 0x00, 0x10, 0x83, 0xc1,
0x20, 0x9e, 0x5a, 0xea, 0x01, 0xa0, 0xaf, 0xe5, 0x80, 0x70, 0x60, 0x21,
0x00, 0x08, 0x87, 0xc1, 0x00, 0xe8, 0xd2, 0x55, 0x00, 0x40, 0xcf, 0xd5,
0x00, 0x02, 0x06, 0x00, 0x00, 0x08, 0x82, 0xc1, 0x00, 0x48, 0x55, 0x00,
0x00, 0x80, 0xa8, 0xe7, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x10, 0x81, 0xc3,
0x00, 0x00, 0x0a, 0x00, 0x00, 0x40, 0x54, 0xd5, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xea,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28};

View File

@@ -0,0 +1,46 @@
#define xmosaic_plain_width 64
#define xmosaic_plain_height 64
static char xmosaic_plain_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x06,
0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00,
0x00, 0x00, 0xc0, 0x01, 0x00, 0xe0, 0x01, 0xfe, 0xff, 0xff, 0xff, 0x03,
0x00, 0x70, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x30, 0xf8, 0xff,
0xff, 0xff, 0xff, 0x03, 0x00, 0x18, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03,
0x00, 0x08, 0x7e, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x0c, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, 0x00, 0x00, 0x38, 0x00,
0x00, 0xc0, 0x00, 0xfc, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x62, 0xc0, 0xff,
0xff, 0xff, 0x7f, 0x00, 0x00, 0x22, 0xf0, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x30, 0xf8, 0x3f, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x11, 0xfc, 0x01,
0x00, 0x00, 0x10, 0x00, 0x00, 0x09, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x03, 0xf0,
0x0f, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x01, 0xfc, 0x3f, 0x00, 0x00, 0x00,
0x00, 0xc0, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xff,
0x7f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x20, 0x80, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x10, 0xc0, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x10, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00,
0x00, 0x10, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x10, 0xc0, 0xff,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0x03, 0x08, 0x00, 0x00, 0x00, 0xc0, 0xff,
0xff, 0x03, 0x08, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x08, 0x00,
0x00, 0x00, 0x80, 0xff, 0xff, 0x01, 0x44, 0x00, 0x00, 0x00, 0x80, 0xff,
0xff, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x06, 0x00,
0x00, 0x00, 0x00, 0xfe, 0x3f, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0xfc,
0x1f, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xc0, 0x21, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0x90, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x00,
0x00, 0x3e, 0x00, 0x00, 0xf8, 0x3f, 0x88, 0x00, 0x00, 0xfe, 0xff, 0xff,
0xff, 0x0f, 0x4c, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x03, 0x46, 0x00,
0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x43, 0x00, 0x00, 0x1c, 0x00, 0x00,
0x00, 0xc0, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x31, 0x00,
0x80, 0x03, 0x00, 0x00, 0x00, 0x7c, 0x30, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x18, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x1c, 0x00,
0xc0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x0e, 0x00, 0xc0, 0xff, 0xff, 0xff,
0xff, 0x01, 0x07, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x70, 0x00, 0x00, 0x00,
0x00, 0xfe, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff,
0xff, 0x03, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View File

@@ -0,0 +1,46 @@
#define xmosaic_right_width 64
#define xmosaic_right_height 64
static char xmosaic_right_bits[] = {
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x11, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xab, 0x2a, 0x02, 0x00, 0x00, 0x50, 0x00, 0x00, 0xc3, 0x81, 0x08, 0x00,
0x00, 0x00, 0x05, 0x00, 0xe7, 0x15, 0x01, 0x00, 0x00, 0xaa, 0x12, 0x00,
0x83, 0x41, 0x10, 0x00, 0x00, 0x60, 0x40, 0x00, 0xab, 0xf3, 0x02, 0x00,
0xaa, 0x4b, 0x17, 0x00, 0x83, 0xe1, 0x10, 0x00, 0x84, 0x06, 0x0e, 0x01,
0xa7, 0xf5, 0x05, 0x80, 0x57, 0x5a, 0x79, 0x04, 0x83, 0xc1, 0x08, 0x00,
0x38, 0x70, 0x74, 0x00, 0xab, 0xd3, 0x02, 0x00, 0xf0, 0xca, 0xe2, 0x0a,
0x83, 0xc1, 0x08, 0x00, 0xc0, 0x81, 0xd1, 0x01, 0xa7, 0xd5, 0x01, 0x00,
0x80, 0x27, 0xc7, 0x15, 0x83, 0xc1, 0x08, 0x00, 0x00, 0x07, 0xc7, 0x03,
0xab, 0xd3, 0x02, 0x00, 0x00, 0xae, 0xae, 0x2f, 0x83, 0xc1, 0x08, 0x40,
0x15, 0x1e, 0x0e, 0x07, 0xa7, 0xd5, 0x01, 0x10, 0x40, 0x5c, 0x9d, 0x56,
0x83, 0xc1, 0x08, 0x00, 0x00, 0x18, 0x1c, 0x06, 0xab, 0xd3, 0x02, 0xa4,
0x02, 0xb9, 0xbe, 0xae, 0x83, 0xc1, 0x08, 0x00, 0x00, 0x38, 0x18, 0x0e,
0xa7, 0xd5, 0x01, 0x55, 0x15, 0x7a, 0x5a, 0x9d, 0x83, 0xc1, 0x88, 0x00,
0x00, 0x30, 0x18, 0x0c, 0xab, 0xd3, 0xc2, 0xaa, 0xaa, 0xb4, 0x3a, 0xad,
0x83, 0xc1, 0x48, 0x00, 0x00, 0x30, 0x18, 0x0c, 0xa7, 0xd5, 0x41, 0x55,
0x55, 0x75, 0x5d, 0x9d, 0x83, 0xc1, 0x68, 0x00, 0x00, 0x70, 0x18, 0x0c,
0xab, 0xd3, 0xe2, 0xaa, 0xaa, 0xe4, 0x3c, 0xad, 0x83, 0xc1, 0x68, 0x00,
0x00, 0x60, 0x18, 0x0c, 0xa7, 0xd5, 0x61, 0x55, 0x55, 0x65, 0x5d, 0x9d,
0x83, 0xc1, 0xe8, 0x00, 0x00, 0x60, 0x18, 0x0c, 0xab, 0xd3, 0xe2, 0xaa,
0xaa, 0xe4, 0x3c, 0xad, 0x83, 0xc1, 0xc8, 0x01, 0x00, 0x60, 0x18, 0x0c,
0xa7, 0xd5, 0xc1, 0x57, 0x55, 0x62, 0x5d, 0x9d, 0x87, 0xc1, 0x88, 0x07,
0x80, 0x60, 0x18, 0x0c, 0xaf, 0xdb, 0x03, 0xaf, 0x4a, 0xe0, 0x3c, 0xad,
0x86, 0xc3, 0x11, 0x3e, 0x30, 0x60, 0x18, 0x0c, 0xde, 0xa3, 0x07, 0xfc,
0x0f, 0x60, 0x5d, 0x9d, 0x0e, 0x87, 0x23, 0xf0, 0x03, 0x60, 0x18, 0x0c,
0xac, 0x57, 0x0f, 0x00, 0x00, 0xe0, 0x3c, 0xad, 0x1c, 0x0e, 0x47, 0x00,
0x00, 0x60, 0x18, 0x0c, 0x7c, 0xaf, 0x1e, 0x00, 0x00, 0x60, 0x5d, 0x9d,
0x38, 0x1c, 0x1e, 0x01, 0x00, 0x60, 0x18, 0x0c, 0xf0, 0x7e, 0xbd, 0x00,
0x00, 0xe0, 0x3c, 0xad, 0x70, 0x30, 0x78, 0x04, 0x00, 0x60, 0x18, 0x0c,
0xe0, 0x79, 0xe6, 0x15, 0x00, 0x60, 0x5d, 0x9d, 0xc0, 0xe1, 0xd0, 0x41,
0x00, 0x20, 0x18, 0x0c, 0x80, 0xab, 0x55, 0x2f, 0x00, 0xb0, 0x38, 0xad,
0x00, 0x47, 0x07, 0x39, 0x00, 0x30, 0x18, 0x0c, 0x00, 0x5e, 0xb9, 0x00,
0x00, 0x78, 0x59, 0x9e, 0x00, 0x38, 0xc2, 0x04, 0x00, 0xf0, 0x0b, 0x0c,
0x00, 0xc0, 0x05, 0x05, 0x00, 0xf0, 0xac, 0xae, 0x00, 0x00, 0x0a, 0x00,
0x00, 0x00, 0x1c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x55,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

222
src/bla.c Normal file
View File

@@ -0,0 +1,222 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/* CCI redirect object
** =================
*/
#include "../config.h"
#include <stdio.h>
#include "cciServer.h"
#include "list.h"
#include "memStuffForPipSqueeks.h"
#include "HTPlain.h"
#include "HTUtils.h"
#include "HText.h"
#include "HTFile.h"
#include "HTCompressed.h"
extern void MoCCISendOutputToClient();
extern void HTCompressedFileToFile (char *fnam, int compressed);
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
/* HTML Object
** -----------
*/
struct _HTStream {
WWW_CONST HTStreamClass * isa;
HTAtom *dataType;
char fileName[L_tmpnam]; /* name of temp file... kept for unlink()ing*/
FILE *fp;
int compressed;
};
/*_________________________________________________________________________
**
** A C T I O N R O U T I N E S
*/
/* Character handling
** ------------------
*/
PRIVATE void CCI_put_character ARGS2(HTStream *, me, char, c)
{
fputc(c,me->fp);
}
/* String handling
** ---------------
**
*/
PRIVATE void CCI_put_string ARGS2(HTStream *, me, WWW_CONST char*, s)
{
fwrite(s,1,strlen(s),me->fp);
}
PRIVATE void CCI_write ARGS3(HTStream *, me, WWW_CONST char*, s, int, l)
{
fwrite(s,1,l,me->fp);
}
/* Free an HTML object
** -------------------
**
** Note that the SGML parsing context is freed, but the created object is not,
** as it takes on an existence of its own unless explicitly freed.
*/
PRIVATE void CCI_free ARGS1(HTStream *, me)
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"CCI_free()\n");
}
#endif
/*
if (me->compressed != COMPRESSED_NOT)
{
#ifndef DISABLE_TRACE
if (cciTrace)
fprintf
(stderr,
"[CCI_free] OK, we're going to decompress HText\n");
#endif
HTCompressedHText (me->text, me->compressed, 1);
}
free(me);
*/
}
/* End writing
*/
PRIVATE void CCI_end_document ARGS1(HTStream *, me)
{
fclose(me->fp);
/* ship it */
if ( me->compressed != COMPRESSED_NOT)
HTCompressedFileToFile (me->fileName, me->compressed);
MoCCISendOutputToClient(HTAtom_name(me->dataType),me->fileName);
/*
unlink(me->fileName);
*/
}
PRIVATE void CCI_handle_interrupt ARGS1(HTStream *, me)
{
fclose(me->fp);
unlink(me->fileName);
}
/* Structured Object Class
** -----------------------
*/
PUBLIC WWW_CONST HTStreamClass CCIout =
{
"CCIout",
CCI_free,
CCI_end_document,
CCI_put_character, CCI_put_string, CCI_write,
CCI_handle_interrupt
};
/* New object
** ----------
*/
PUBLIC HTStream* CCIPresent ARGS5(
HTPresentation *, pres,
HTParentAnchor *, anchor,
HTStream *, sink,
HTFormat, format_in,
int, compressed)
{
HTStream* me = (HTStream*)malloc(sizeof(HTStream));
me->isa = &CCIout;
(void) tmpnam(me->fileName);
if (!(me->fp = fopen(me->fileName,"w"))) {
/*error, can't open tmp file */
return(sink);
}
me->dataType = pres->rep;
me->compressed = compressed;
/*
if (me->compressed == COMPRESSED_NOT)
HText_appendText(me->text, "<PLAINTEXT>\n");
*/
return (HTStream*) me;
}

66
src/bla.h Normal file
View File

@@ -0,0 +1,66 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */

329
src/cci.h Normal file
View File

@@ -0,0 +1,329 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#ifndef __CCI_H__
#define __CCI_H__
#define MCCI_MAX_RETURN_TEXT 1024
#define MCCI_VERSION "1.0"
/* return codes from cci api */
#define MCCI_OK 0
#define MCCI_FAIL 1
#define MCCI_OUTOFMEMORY 2
#define MCCI_REQUEST_FAIL 3
#define MCCI_NETWORK_ERROR 4
/* cci interface tokens used with api */
#define MCCI_DEFAULT 0
#define MCCI_OUTPUT_NONE 100
#define MCCI_OUTPUT_CURRENT 101
#define MCCI_OUTPUT_NEW 102
#define MCCI_ABSOLUTE 110
#define MCCI_RELATIVE 111
#define MCCI_PUBLIC_ANNOTATION 120
#define MCCI_GROUP_ANNOTATION 121
#define MCCI_PRIVATE_ANNOTATION 122
#define MCCI_ALL_ANNOTATION 123
#define MCCI_SEND_BEFORE 210
#define MCCI_SEND_AFTER 220
#define MCCI_SEND_HANDLER 230 /* ADC ZZZ */
/* protocol token strings */
#define MCCI_S_GET "GET"
#define MCCI_S_DISPLAY "DISPLAY"
#define MCCI_S_DISCONNECT "DISCONNECT"
#define MCCI_S_QUIT "QUIT"
#define MCCI_S_SEND "SEND"
#define MCCI_S_OUTPUT "OUTPUT"
#define MCCI_S_ANCHOR "ANCHOR"
#define MCCI_S_BEFORE "BEFORE"
#define MCCI_S_AFTER "AFTER"
#define MCCI_S_HANDLER "HANDLER" /* ADC ZZZ */
#define MCCI_S_BROWSERVIEW "BROWSERVIEW"
#define MCCI_S_GETANNOTATION "GETANNOTATION"
#define MCCI_S_PUTANNOTATION "PUTANNOTATION"
#define MCCI_S_PUBLIC_ANN "PUBLIC"
#define MCCI_S_GROUP_ANN "GROUP"
#define MCCI_S_PRIVATE_ANN "PRIVATE"
#define MCCI_S_ALL_ANN "ALL"
#define MCCI_S_FILE_TO_URL "FILETOURL"
#define MCCI_S_FORM "FORM"
#define MCCI_S_EVENT "EVENT"
#define MCCI_S_DOCOMMAND "DOCOMMAND"
#define MCCI_S_TO "TO"
#define MCCI_S_STOP "STOP"
#define MCCI_S_START "START"
#define MCCI_S_CURRENT "CURRENT"
#define MCCI_S_NEW "NEW"
#define MCCI_S_NONE "NONE"
#define MCCI_S_HEADER "HEADER"
#define MCCI_S_POST "POST"
#define MCCI_POST "cciPOST"
/* for DOCOMMAND options */
#define MCCI_ON "ON"
#define MCCI_OFF "OFF"
#define MCCI_UP "UP"
#define MCCI_DOWN "DOWN"
#define MCCI_CASE "CASE"
#define MCCI_NOCASE "NOCASE"
#define MCCI_UNDERLINE_DEFAULT "UNDERLINE_DEFAULT"
#define MCCI_UNDERLINE_LIGHT "UNDERLINE_LIGHT"
#define MCCI_UNDERLINE_MEDIUM "UNDERLINE_MEDIUM"
#define MCCI_UNDERLINE_HEAVY "UNDERLINE_HEAVY"
#define MCCI_UNDERLINE_NONE "UNDERLINE_NONE"
#define MCCI_TIMES_REGULAR "TIMES_REGULAR"
#define MCCI_TIMES_SMALL "TIMES_SMALL"
#define MCCI_TIMES_LARGE "TIMES_LARGE"
#define MCCI_HELVETICA_LARGE "HELVETICA_LARGE"
#define MCCI_HELVETICA_SMALL "HELVETICA_SMALL"
#define MCCI_HELVETICA_REGULAR "HELVETICA_REGULAR"
#define MCCI_NEWCENTURY_LARGE "NEWCENTURY_LARGE"
#define MCCI_NEWCENTURY_SMALL "NEWCENTURY_SMALL"
#define MCCI_NEWCENTURY_REGULAR "NEWCENTURY_REGULAR"
#define MCCI_LUCIDABRIGHT_LARGE "LUCIDABRIGHT_LARGE"
#define MCCI_LUCIDABRIGHT_SMALL "LUCIDABRIGHT_SMALL"
#define MCCI_LUCIDABRIGHT_REGULAR "LUCIDABRIGHT_REGULAR"
#define MCCI_PLAINTEXT "PLAINTEXT"
#define MCCI_FORMATTEDTEXT "FORMATTEDTEXT"
#define MCCI_POSTSCRIPT "POSTSCRIPT"
#define MCCI_HTML "HTML"
#define MCCI_BACK "BACK"
#define MCCI_FORWARD "FORWARD"
#define MCCI_HOME "HOME"
#define MCCI_RELOAD "RELOAD"
#define MCCI_SAVEAS "SAVEAS"
#define MCCI_CLONE "CLONE"
#define MCCI_NEWWINDOW "NEWWINDOW"
#define MCCI_CLOSEWINDOW "CLOSEWINDOW"
#define MCCI_OPENLOCAL "OPENLOCAL"
#define MCCI_RELOADIMAGES "RELOADIMAGES"
#define MCCI_REFRESHCURRENT "REFRESHCURRENT"
#define MCCI_FINDINCURRENT "FINDINCURRENT"
#define MCCI_VIEWSOURCE "VIEWSOURCE"
#define MCCI_EDITSOURCE "EDITSOURCE"
#define MCCI_PRINT "PRINT"
#define MCCI_CLOSEWINDOW "CLOSEWINDOW"
#define MCCI_EXITPROGRAM "EXITPROGRAM"
#define MCCI_FANCYSELECTIONS "FANCYSELECTIONS"
#define MCCI_LOADTOLOCALDISK "LOADTOLOCALDISK"
#define MCCI_DELAYIMAGELOAD "DELAYIMAGELOAD"
#define MCCI_RELOADCONFIG "RELOADCONFIG"
#define MCCI_FLUSHIMAGECACHE "FLUSHIMAGECACHE"
#define MCCI_CLEARGLOBALHISTORY "CLEARGLOBALHISTORY"
#define MCCI_WINDOWHISTORY "WINDOWHISTORY"
#define MCCI_HOTLIST "HOTLIST"
#define MCCI_FONT "FONT"
#define MCCI_ANCHORUNDERLINE "ANCHORUNDERLINE"
/******************* RETURN CODES ***********************/
/* successful return codes in protocol*/
#define MCCIR_OK 200
#define MCCIR_GET_OK 210
#define MCCIR_DISPLAY_OK 211
#define MCCIR_DISCONNECT_OK 212
#define MCCIR_QUIT_OK 213
#define MCCIR_SEND_OUTPUT_OK 214
#define MCCIR_SEND_O_STOP_OK 215
#define MCCIR_SEND_ANCHOR_OK 216
#define MCCIR_SEND_A_STOP_OK 217
#define MCCIR_POST_OK 218
#define MCCIR_BROWSERVIEW_OK 219
#define MCCIR_BROWSERVIEW_STOP_OK 220
#define MCCIR_ANNOTATION_REQ_OK 221
#define MCCIR_NO_ANNOTATION 222 /* no annotation for url */
#define MCCIR_FILE_TO_URL 223
#define MCCIR_FORM_OK 224
#define MCCIR_SEND_EVENT_OK 225
#define MCCIR_SEND_EVENT_STOP_OK 226
#define MCCIR_DOCOMMAND_OK 227
/* Send Anchor Before return codes */
#define MCCIR_SEND_ANCH_BEF_LINK_OK 280 /* clicked link */
#define MCCIR_SEND_ANCH_BEF_OPEN_OK 281 /* used open dialog */
#define MCCIR_SEND_ANCH_BEF_EDIT_OK 282 /* edited URL field */
#define MCCIR_SEND_ANCH_BEF_FORW_OK 283 /* clicked forward */
#define MCCIR_SEND_ANCH_BEF_BACK_OK 284 /* clicked back */
#define MCCIR_SEND_ANCH_BEF_RELO_OK 285 /* clicked reload */
#define MCCIR_SEND_ANCH_BEF_HIST_OK 286 /* from history */
#define MCCIR_SEND_ANCH_BEF_HOTL_OK 287 /* from hotlist */
#define MCCIR_SEND_ANCH_BEF_MCCI_OK 288 /* from CCI */
#define MCCIR_SEND_ANCH_BEF_OTHR_OK 289 /* from other source */
/* sendAnchor After return codes */
#define MCCIR_SEND_ANCH_AFT_LINK_OK 290 /* clicked link */
#define MCCIR_SEND_ANCH_AFT_OPEN_OK 291 /* used open dialog */
#define MCCIR_SEND_ANCH_AFT_EDIT_OK 292 /* edited URL field */
#define MCCIR_SEND_ANCH_AFT_FORW_OK 293 /* clicked forward */
#define MCCIR_SEND_ANCH_AFT_BACK_OK 294 /* clicked back */
#define MCCIR_SEND_ANCH_AFT_RELO_OK 295 /* clicked reload */
#define MCCIR_SEND_ANCH_AFT_HIST_OK 296 /* from history */
#define MCCIR_SEND_ANCH_AFT_HOTL_OK 297 /* from hotlist */
#define MCCIR_SEND_ANCH_AFT_MCCI_OK 298 /* from CCI */
#define MCCIR_SEND_ANCH_AFT_OTHR_OK 299 /* from other source */
/* ADC ZZZ */
#define MCCIR_SEND_ANCH_HAN_OTHR_OK 270 /* ADC ZZZ */
/* additional data follows repsonse code */
#define MCCIR_ANCHOR_INFO 301 /* anchor visited information */
#define MCCIR_SEND_DATA_OUTPUT 302 /* output from Send Output protocol */
#define MCCIR_SEND_BROWSERVIEW 303 /* output from Send Browserview proto */
#define MCCIR_POST_OUTPUT 304 /* output from post */
#define MCCIR_PUBLIC_ANNOTATION 305 /* public annotation reply */
#define MCCIR_GROUP_ANNOTATION 306 /* group annotation reply */
#define MCCIR_PRIVATE_ANNOTATION 307 /* private annotation reply */
#define MCCIR_FORM_RESPONSE 308 /* form submission reply */
#define MCCIR_SEND_EVENT 309 /* output form send event protocol */
#define MCCIR_SEND_MOUSE_ANCHOR 310 /* output from Send Mouse Anchor */
/* problem response codes... client problems*/
#define MCCIR_UNRECOGNIZED 401 /* what's this? */
#define MCCIR_ERROR 402 /* does not follow protocol */
/* problem response codes... broswer problems*/
#define MCCIR_REQ_FAILED 500 /* request failed */
#define MCCIR_GET_FAILED 501 /* request failed */
#define MCCIR_MAX_CONNECTIONS 502 /* Max number of connections exceeded */
#define MCCIR_NO_URL_FOR_FILE 503 /* couldn't translate filename to url */
#define MCCIR_DOCOMMAND_FAILED 504 /* command not implemented yet */
/* all possible events on the Web browser */
typedef enum{
/* selected from menu */
MOSAIC_NEW, MOSAIC_CLONE, MOSAIC_OPEN_URL, FILE_OPEN_LOCAL,
MOSAIC_RELOAD_CURRENT,
/*5*/ FILE_RELOAD_IMAGES, FILE_REFRESH_CURRENT, FILE_FIND_IN_CURRENT,
/*8*/ FILE_VIEW_SOURCE, FILE_EDIT_SOURCE, FILE_SOURCE_DATE, MOSAIC_SAVE_AS,
/*12*/ FILE_PRINT, FILE_MAIL_TO, FILE_CCI, MOSAIC_CLOSE, FILE_EXIT_PROGRAM,
/*17*/
OPTIONS_FANCY_SELECTIONS_ON, OPTIONS_FANCY_SELECTIONS_OFF,
OPTIONS_LOAD_TO_LOCAL_DISK_ON, OPTIONS_LOAD_TO_LOCAL_DISK_OFF,
OPTIONS_DELAY_IMAGE_LOADING_ON, OPTIONS_DELAY_IMAGE_LOADING_OFF,
OPTIONS_LOAD_IMAGES_IN_CURRENT, OPTIONS_RELOAD_CONFIG_FILES,
OPTIONS_FLUSH_IMAGE_CACHE, OPTIONS_CLEAR_GLOBAL_HISTORY,
/*27*/
OPTIONS_FONTS_TR, OPTIONS_FONTS_TS, OPTIONS_FONTS_TL,
OPTIONS_FONTS_HR, OPTIONS_FONTS_HS, OPTIONS_FONTS_HL,
OPTIONS_FONTS_NCR, OPTIONS_FONTS_NCS, OPTIONS_FONTS_NCL,
OPTIONS_FONTS_LBR, OPTIONS_FONTS_LBS, OPTIONS_FONTS_LBL,
/*39*/
OPTIONS_ANCHOR_UNDERLINES_DU, OPTIONS_ANCHOR_UNDERLINES_LU,
OPTIONS_ANCHOR_UNDERLINES_MU, OPTIONS_ANCHOR_UNDERLINES_HU,
OPTIONS_ANCHOR_UNDERLINES_NU,
/*44*/
MOSAIC_BACK, MOSAIC_FORWARD, MOSAIC_HOME_DOCUMENT,
NAVIGATE_WINDOW_HISTORY, NAVIGATE_HOTLIST,
NAVIGATE_ADD_CURRENT_TO_HOTLIST, NAVIGATE_INTERNET_STARTING_POINTS,
NAVIGATE_INTERNET_RESOURCES_META_INDEX,
/*52*/
ANNOTATE_ANNOTATE, ANNOTATE_AUDIO_ANNOTATE, ANNOTATE_EDIT_THIS_ANNOTATION,
ANNOTATE_DELETE_THIS_ANNOTATION,
/*56*/
NEWS_NEXT, NEWS_PREV, NEWS_NEXT_THREAD, NEWS_PREV_THREAD, NEWS_INDEX,
NEWS_LIST_GROUPS, NEWS_POST, NEWS_FOLLOW_UP, NEWS_FORMAT_TV,
NEWS_FORMAT_GV,
/*66*/
/* when user click on globe */
MOSAIC_GLOBE,
/* when user make selections from the bottom panel */
AUTHENTICATION_BUTTON,
/* when user submit a form, has to be valid */
FORM_SUBMIT,
/* when user edits the url text field in mosaic window and hit return */
MOSAIC_URL_TEXT_FIELD,
/*71*/
/* triggering anchor in HTML widget */
MOSAIC_URL_TRIGGER,
/* SWP -- 8/3/95 */
HELP_DEMO, HELP_MANUAL, HELP_ABOUT, HELP_ON_WINDOW, HELP_WHATS_NEW,
HELP_ON_VERSION, HELP_ON_FAQ, HELP_ON_HTML, HELP_ON_URLS,
HELP_MAIL_TECH_SUPPORT, FILE_OPEN_DTM_OUTPORT, FILE_BROADCAST_DOCUMENT,
FILE_KERBEROS_V4_LOGIN, FILE_KERBEROS_V5_LOGIN, HELP_COMMENT_CARD,
IMAGE_LOADED, LINK_LOADED, STARTUP,
/*90*/
/* Events for FTP transfer/commands. */
FTP_PUT, FTP_REMOVE, FTP_MKDIR ,
OPTIONS_FLUSH_PASSWD_CACHE
}CCI_events;
/*****************************************************************/
#include "port.h"
typedef PortDescriptor *MCCIPort;
#endif

983
src/cciBindings.c Normal file
View File

@@ -0,0 +1,983 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include <stdio.h>
#include <ctype.h>
#include "cci.h"
#include "mosaic.h"
#include "gui.h"
#include "cciServer.h"
#include "cciBindings.h"
#include "cciBindings2.h"
#include "pan.h"
#include "mo-www.h"
#include "annotate.h"
/* for setting some selections buttons*/
#include "libhtmlw/HTML.h"
extern mo_window *current_win;
extern char *home_document;
#ifndef DISABLE_TRACE
extern int cciTrace;
#endif
int cci_get = 0;
int cci_event = 0;
int cci_docommand = 0;
/*char *mo_post_pull_er_over (char *url, char *content_type,
char *post_data,
char **texthead);
char *MoReturnURLFromFileName(char *fileName);
char *mo_fetch_personal_annotations(char *url);
*/
/***************************************************************************/
/***************************************************************************/
/***************************************************************************/
/* */
/* This module contains bindings between the new cci code and the browser */
/* If you are retrofitting the cci on to your browser strip out everything */
/* except the function headers and the return values and stick in the */
/* appropriate calls for your browser. */
/* */
/***************************************************************************/
/***************************************************************************/
/***************************************************************************/
void MCCIRequestDoCommand(retCode, retText, command, parameter)
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
char *command;
char *parameter;
{
mo_window *win;
char *s, *end, *tmp_end, *w_id;
/* default assume to work */
*retCode = MCCIR_DOCOMMAND_OK;
strcpy(retText, "Executed the command");
if (!strcmp(command, MCCI_EXITPROGRAM)){
mo_exit ();
return;
}
if (!strcmp(command, MCCI_RELOADCONFIG)){
mo_re_init_formats ();
return;
}
if (!parameter){
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Parameters Required");
return;
}
s = parameter;
/*
GetWordFromString(s,&w_id,&end);
if ((!w_id) || (w_id == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a window id");
return;
}
s = end;
w_id = strdup(w_id);
tmp_end = strchr(w_id, ' ');
if (tmp_end) *tmp_end = '\0';
*/
/* got the window id here */
/*
if ((win = mo_fetch_window_by_id(atoi(w_id))) == NULL){
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Bad Window Id");
if (w_id) free(w_id);
return;
}
if (w_id) free(w_id);
*/
if (!current_win) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Current Window Not Available");
return;
}
win=current_win;
if (!strcmp(command, MCCI_BACK))
mo_back_node(win);
else if (!strcmp(command, MCCI_FORWARD))
mo_forward_node(win);
else if (!strcmp(command, MCCI_HOME))
mo_access_document (win, home_document);
else if (!strcmp(command, MCCI_RELOAD))
mo_reload_window_text (win, 0);
else if (!strcmp(command, MCCI_CLONE))
mo_duplicate_window (win);
else if (!strcmp(command, MCCI_CLOSEWINDOW))
mo_delete_window (win);
else if (!strcmp(command, MCCI_RELOADIMAGES))
mo_reload_window_text (win, 1);
else if (!strcmp(command, MCCI_REFRESHCURRENT))
mo_refresh_window_text (win);
else if (!strcmp(command, MCCI_VIEWSOURCE))
mo_post_source_window (win);
else if (!strcmp(command, MCCI_EDITSOURCE))
mo_edit_source(win);
else if (!strcmp(command, MCCI_NEWWINDOW))
mo_open_another_window (win, home_document, NULL, NULL);
else if (!strcmp(command, MCCI_FLUSHIMAGECACHE))
mo_flush_image_cache (win);
else if (!strcmp(command, MCCI_CLEARGLOBALHISTORY)){
mo_window *w = NULL;
mo_wipe_global_history (win);
while (w = mo_next_window (w))
mo_redisplay_window (w);
}
else if (!strcmp(command, MCCI_SAVEAS)){
/* need to get format filename */
char *format, *filename;
mo_status status;
/*FIX*/
/* s is pointed pass the window id part */
GetWordFromString(s,&format,&end); /* Get command */
if ((!format) || (format == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a format");
return;
}
s = end;
format = strdup(format);
tmp_end = strchr(format, ' ');
if (tmp_end) *tmp_end = '\0';
GetWordFromString(s,&filename,&end); /* Get command */
if ((!filename) || (filename == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a filename");
if (format) free(format);
return;
}
filename = strdup(filename);
sscanf(filename,"%s",filename); /* to get rid of /r/n */
cci_docommand = 1;
if (!strcmp(format, MCCI_PLAINTEXT))
status = mo_save_window(win, filename, 0);
else if (!strcmp(format, MCCI_FORMATTEDTEXT))
status = mo_save_window(win, filename, 1);
else if (!strcmp(format, MCCI_HTML))
status = mo_save_window(win, filename, 2);
else if (!strcmp(format, MCCI_POSTSCRIPT))
status = mo_save_window(win, filename, 4);
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Invalid Format");
if (filename) free(filename);
if (format) free(format);
cci_docommand = 0;
return;
}
cci_docommand = 0;
if (filename) free(filename);
if (format) free(format);
if (status == mo_fail){
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Unable to save file");
return;
}
}
else if (!strcmp(command, MCCI_FINDINCURRENT)){
/* need to get search_string and CASE|NOCASE */
char *s_string, *c;
mo_status found;
/* s is pointed pass the window id part */
GetWordFromString(s,&s_string,&end); /* Get command */
if ((!s_string) || (s_string == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a search string");
return;
}
s = end;
s_string = strdup(s_string);
tmp_end = strchr(s_string, ' ');
if (tmp_end) *tmp_end = '\0';
GetWordFromString(s,&c,&end); /* Get command */
if ((!c) || (c == end) ){
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify CASE");
if (s_string) free(s_string);
return;
}
c = strdup(c);
sscanf(c,"%s",c); /* to get rid of /r/n */
cci_docommand = 1;
if (!strcmp(c, MCCI_NOCASE))
found = mo_search_window(win, s_string, 0, 1, 0);
else if (!strcmp(c, MCCI_CASE))
found = mo_search_window(win, s_string, 0, 0, 0);
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Invalid CASE Specification");
cci_docommand = 0;
if(s_string) free(s_string);
if (c) free(c);
return;
}
cci_docommand = 0;
/**** should I return a error when not found ****/
if(s_string) free(s_string);
if (c) free(c);
}
else if (!strcmp(command, MCCI_PRINT)){
/* need to get format and printCommand */
char *format, *printCommand;
mo_status status;
/* s is pointed pass the window id part */
GetWordFromString(s,&format,&end); /* Get command */
if ((!format) || (format == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a print format");
return;
}
s = end;
format = strdup( format);
tmp_end = strchr(format, ' ');
if (tmp_end) *tmp_end = '\0';
if (s == NULL){
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a print command");
if (format) free(format);
return;
}
printCommand = s;
while(isalnum( (int) (*s)) || (*s == ' ') || (*s == '-'))
s++;
if (s) *s = '\0';
printCommand = strdup(printCommand);
cci_docommand = 1;
if (!strcmp(format, MCCI_PLAINTEXT))
status = mo_print_window(win, 0, printCommand);
else if (!strcmp(format, MCCI_FORMATTEDTEXT))
status = mo_print_window(win, 1, printCommand);
else if (!strcmp(format, MCCI_HTML))
status = mo_print_window(win, 2, printCommand);
else if (!strcmp(format, MCCI_POSTSCRIPT))
status = mo_print_window(win, 4, printCommand);
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Invalid Format");
cci_docommand = 0;
if (format) free(format);
return;
}
cci_docommand = 0;
if (format) free(format);
if (status == mo_fail){
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Unable to print file");
return;
}
}
else if (!strcmp(command, MCCI_FANCYSELECTIONS)){
/* need to get ON|OFF */
char *on_off;
/* s is pointed pass the window id part */
GetWordFromString(s,&on_off,&end); /* Get command */
if ((!on_off) || (on_off == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify ON|OFF");
return;
}
on_off = strdup(on_off);
sscanf(on_off,"%s", on_off);
if (!strcmp(on_off, MCCI_ON)){
win->pretty = 1;
mo_set_fancy_selections_toggle (win);
HTMLClearSelection (win->scrolled_win);
XmxSetArg (WbNfancySelections, True);
XmxSetValues (win->scrolled_win);
}
else if(!strcmp(on_off, MCCI_OFF)){
win->pretty = 0;
mo_set_fancy_selections_toggle (win);
HTMLClearSelection (win->scrolled_win);
XmxSetArg (WbNfancySelections, False);
XmxSetValues (win->scrolled_win);
}
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify ON|OFF");
if (on_off) free(on_off);
return;
}
if (on_off) free(on_off);
}
else if (!strcmp(command, MCCI_LOADTOLOCALDISK)){
/* need to get ON|OFF */
char *on_off;
/* s is pointed pass the window id part */
GetWordFromString(s,&on_off,&end); /* Get command */
if ((!on_off) || (on_off == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify ON|OFF");
return;
}
on_off = strdup(on_off);
sscanf(on_off,"%s", on_off);
if (!strcmp(on_off, MCCI_ON)){
win->binary_transfer = 1;
XmxRSetToggleState (win->menubar, mo_binary_transfer,
(win->binary_transfer ? XmxSet : XmxNotSet));
}
else if (!strcmp(on_off, MCCI_OFF)){
win->binary_transfer = 0;
XmxRSetToggleState (win->menubar, mo_binary_transfer,
(win->binary_transfer ? XmxSet : XmxNotSet));
}
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify ON|OFF");
if (on_off) free(on_off);
return;
}
if (on_off) free(on_off);
}
else if (!strcmp(command, MCCI_DELAYIMAGELOAD)){
/* need to get ON|OFF */
char *on_off;
/* s is pointed pass the window id part */
GetWordFromString(s,&on_off,&end); /* Get command */
if ((!on_off) || (on_off == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify ON|OFF");
return;
}
on_off = strdup(on_off);
sscanf(on_off,"%s", on_off);
if (!strcmp(on_off, MCCI_ON)){
win->delay_image_loads = 1;
XmxRSetToggleState(win->menubar, mo_delay_image_loads,
(win->delay_image_loads?XmxSet : XmxNotSet));
/*
XmxSetArg (WbNdelayImageLoads, True);
XmxSetValues (win->scrolled_win);
*/
XmxRSetSensitive (win->menubar, mo_expand_images_current,
win->delay_image_loads?XmxSensitive:XmxNotSensitive);
}
else if (!strcmp(on_off, MCCI_OFF)){
win->delay_image_loads = 0;
XmxRSetToggleState(win->menubar, mo_delay_image_loads,
(win->delay_image_loads?XmxSet : XmxNotSet));
/*
XmxSetArg (WbNdelayImageLoads, False);
XmxSetValues (win->scrolled_win);
*/
XmxRSetSensitive (win->menubar, mo_expand_images_current,
win->delay_image_loads?XmxSensitive:XmxNotSensitive);
}
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify ON|OFF");
if (on_off) free(on_off);
return;
}
if (on_off) free(on_off);
}
else if (!strcmp(command, MCCI_WINDOWHISTORY)){
}
else if (!strcmp(command, MCCI_HOTLIST)){
}
else if (!strcmp(command, MCCI_FONT)){
/* has to get fontname */
char *fontname;
/* s is pointed pass the window id part */
GetWordFromString(s,&fontname,&end); /* Get command */
if ((!fontname) || (fontname == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify fontname");
return;
}
fontname = strdup(fontname);
sscanf(fontname,"%s", fontname);
if (!strcmp(fontname, MCCI_TIMES_REGULAR))
mo_set_fonts(win, mo_regular_fonts);
else if(!strcmp(fontname, MCCI_TIMES_SMALL))
mo_set_fonts(win, mo_small_fonts);
else if(!strcmp(fontname, MCCI_TIMES_LARGE))
mo_set_fonts(win, mo_large_fonts);
else if(!strcmp(fontname, MCCI_HELVETICA_LARGE))
mo_set_fonts(win, mo_large_helvetica);
else if(!strcmp(fontname, MCCI_HELVETICA_SMALL))
mo_set_fonts(win, mo_small_helvetica);
else if(!strcmp(fontname, MCCI_HELVETICA_REGULAR))
mo_set_fonts(win, mo_regular_helvetica);
else if(!strcmp(fontname, MCCI_NEWCENTURY_LARGE))
mo_set_fonts(win, mo_large_newcentury);
else if(!strcmp(fontname, MCCI_NEWCENTURY_SMALL))
mo_set_fonts(win, mo_small_newcentury);
else if(!strcmp(fontname, MCCI_NEWCENTURY_REGULAR))
mo_set_fonts(win, mo_regular_newcentury);
else if(!strcmp(fontname, MCCI_LUCIDABRIGHT_LARGE))
mo_set_fonts(win, mo_large_lucidabright);
else if(!strcmp(fontname, MCCI_LUCIDABRIGHT_REGULAR))
mo_set_fonts(win, mo_regular_lucidabright);
else if(!strcmp(fontname, MCCI_LUCIDABRIGHT_SMALL))
mo_set_fonts(win, mo_small_lucidabright);
else{
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Invalid Fontname Specification");
if (fontname) free(fontname);
return;
}
if (fontname) free(fontname);
}
else if (!strcmp(command, MCCI_ANCHORUNDERLINE)){
/* need to get level */
char *level;
/* s is pointed pass the window id part */
GetWordFromString(s,&level,&end); /* Get command */
if ((!level) || (level == end)) {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "You Need to Specify a level");
return;
}
level = strdup(level);
sscanf(level,"%s", level);
if (!strcmp(level, MCCI_UNDERLINE_DEFAULT))
mo_set_underlines (win,mo_default_underlines);
else if (!strcmp(level, MCCI_UNDERLINE_LIGHT))
mo_set_underlines (win,mo_l1_underlines);
else if (!strcmp(level, MCCI_UNDERLINE_MEDIUM))
mo_set_underlines (win,mo_l2_underlines);
else if (!strcmp(level, MCCI_UNDERLINE_HEAVY))
mo_set_underlines (win,mo_l3_underlines);
else if (!strcmp(level, MCCI_UNDERLINE_NONE))
mo_set_underlines (win,mo_no_underlines);
else {
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Invalid Level Specification");
if (level) free(level);
return;
}
if (level) free(level);
}
else {/* command not recongized */
*retCode = MCCIR_DOCOMMAND_FAILED;
strcpy(retText, "Invalid Command");
}
return;
}
void MCCIRequestGetURL(retCode,retText,url,output,additionalHeader)
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
char *url;
int output;
char *additionalHeader; /* currently additional header ignored */
{
mo_status moStatus;
#ifndef DISABLE_TRACE
if (cciTrace) {
if (additionalHeader)
fprintf(stderr,"MCCIRequestGetURL(url=\"%s\",output=%d,header=\"%s\")\n",
url,output,additionalHeader);
else
fprintf(stderr,"MCCIRequestGetURL(url=\"%s\",output=%d)\n",
url,output);
}
#endif
if (! get_pref_int(eLOAD_LOCAL_FILE))
if (!my_strncasecmp(url,"file:",5)) {
*retCode = MCCIR_GET_FAILED;
strcpy(retText,
" Can't get local file (for CCI security reasons)");
return;
}
/*do it */
if (!strchr (url, ':')) {
url = mo_url_canonicalize_local (url);
}
switch (output) {
case MCCI_OUTPUT_CURRENT:
/* turn flag on so mosaic will know to do a get*/
cci_get = 1;
moStatus = mo_load_window_text (current_win, url, NULL);
if (moStatus == mo_succeed) {
*retCode = MCCIR_GET_OK;
strcpy(retText,"Got the URL");
}
else {
*retCode = MCCIR_GET_FAILED;
sprintf(retText,"Couldn't get URL %s",url);
}
break;
cci_get = 0; /* done with get, turn flag off */
case MCCI_OUTPUT_NEW:
/* turn flag on so mosaic will know to do a get*/
cci_get = 1;
if (!mo_open_another_window(current_win,url,NULL,NULL)) {
*retCode = MCCIR_GET_FAILED;
sprintf(retText,"Couldn't get URL %s",url);
}
else {
*retCode = MCCIR_GET_OK;
strcpy(retText,"Got the URL");
}
cci_get = 0; /* done with get, turn flag off */
break;
case MCCI_OUTPUT_NONE:
*retCode = MCCIR_GET_FAILED;
strcpy(retText,"Sorry, OUTPUT to no where not supported yet");
break;
default:
*retCode = MCCIR_GET_FAILED;
strcpy(retText,"Send output where???");
break;
}
return;
}
void MCCIRequestForm(client, retCode,retText,actionID,status)
MCCIPort client;
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
char *actionID;
int status;
{
mo_status moStatus;
MoCCIForm(client, actionID, status, 0);
*retCode = MCCIR_FORM_OK;
strcpy(retText, "Form Submit Received");
return;
}
void MCCIRequestSendAnchor(retCode,retText,client,status)
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
MCCIPort client;
int status; /* 0, MCCI_SEND_BEFORE, or MCCI_SEND_AFTER */
/* or MCCI_SEND_HANDLER ADC ZZZ */
/* anchor replies may be sent back using MCCISendAnchorHistory(client,url)*/
{
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestSendAnchor(%d)\n",status);
}
#endif
switch (status) {
case MCCI_SEND_BEFORE:
MoCCISendAnchor(client,1);
*retCode = MCCIR_SEND_ANCH_BEF_OTHR_OK;
strcpy(retText,"Send Anchor Before enabled");
break;
case MCCI_SEND_AFTER:
MoCCISendAnchor(client,2);
*retCode = MCCIR_SEND_ANCH_AFT_OTHR_OK;
strcpy(retText,"Send Anchor After enabled");
break;
case MCCI_SEND_HANDLER: /* ADC ZZZ */
MoCCISendAnchor(client,3);
*retCode = MCCIR_SEND_ANCH_HAN_OTHR_OK;
strcpy(retText,"Send Anchor Handler enabled");
break;
case 0:
MoCCISendAnchor(client,0);
*retCode = MCCIR_SEND_A_STOP_OK;
strcpy(retText,"Send Anchor disabled");
break;
}
}
void MCCIRequestSendOutput(retCode,retText,client,on,type)
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
MCCIPort client;
int on; /* boolean value....turn on - true, off - false */
char *type; /* if null, assume all types */
{
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestSendOutput(%d,%s)\n",on,type);
}
#endif
if (on) {
MoCCISendOutput(client,1,type);
*retCode = MCCIR_SEND_OUTPUT_OK;
strcpy(retText,"Send OUTPUT enabled");
}
else {
MoCCISendOutput(client,0,type);
*retCode = MCCIR_SEND_O_STOP_OK;
strcpy(retText,"Send OUTPUT disabled");
}
return;
}
void MCCIRequestSendEvent(retCode,retText,client,on)
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
MCCIPort client;
int on; /* boolean value....turn on - true, off - false */
{
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestEvent(%d)\n",on);
}
#endif
if (on) {
cci_event = 1;
MoCCISendEvent(client,1);
*retCode = MCCIR_SEND_EVENT_OK;
strcpy(retText,"Send EVENT enabled");
}
else {
/* set cci_event to 0 only if there are no client request */
MoCCISendEvent(client,0);
*retCode = MCCIR_SEND_EVENT_STOP_OK;
strcpy(retText,"Send EVENT disabled");
}
return;
}
void MCCIRequestSendBrowserView(retCode,retText,client,on)
int *retCode;
char *retText; /* must be less MCCI_MAX_RETURN_TEXT*/
MCCIPort client;
int on; /* boolean value....turn on - true, off - false */
{
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestSendBrowserView(%d)\n",on);
}
#endif
if (on) {
MoCCISendBrowserView(client,1);
*retCode = MCCIR_BROWSERVIEW_OK;
strcpy(retText,"Send BROWSERVIEW enabled");
}
else {
MoCCISendBrowserView(client,0);
*retCode = MCCIR_BROWSERVIEW_STOP_OK;
strcpy(retText,"Send BROWSERVIEW disabled");
}
return;
}
void MCCIRequestPost(client,retCode,retText,url,contentType,
postData,dataLength,output)
MCCIPort client;
int *retCode;
char *retText;
char *url;
char *contentType;
char *postData;
int dataLength;
int output;
{
char *textHead;
char *response;
char buff[256];
int length;
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestPost(): about to mo_post_pull_er_over()\n");
fprintf(stderr,"mo_post_pull_er_over(url=\"%s\",type=\"%s\",postData=\"%s\")\n"
,url,contentType,postData);
}
#endif
*retCode = MCCIR_POST_OK;
strcpy(retText,"Post Request ok");
switch(output) {
case MCCI_OUTPUT_NONE:
/* do not display output of post, but send the
output back through the cci to the client */
response = mo_post_pull_er_over(url,
contentType, postData, &textHead);
/* send response back through cci */
if (response && (length = strlen(response))) {
MCCISendResponseLine(client,MCCIR_POST_OUTPUT,
"POST output");
sprintf(buff,"Content-Length: %d\r\n",length);
if (length!=NetServerWrite(client,
buff,strlen(buff))){
/* this is pointless... I know */
strcpy(retText,"couldn't send output");
*retCode = MCCI_FAIL;
}
if (length!=NetServerWrite(client,
response,length)) {
/* this is pointless... I know */
strcpy(retText,"couldn't send output");
*retCode = MCCI_FAIL;
}
}
break;
case MCCI_OUTPUT_NEW:
/* open a new window and display posting... */
/* ...not done yet...*/
case MCCI_DEFAULT: /* default to output current */
case MCCI_OUTPUT_CURRENT:
default:
/* display in current window */
response = mo_post_pull_er_over(url,
contentType, postData, &textHead);
/*mo_decode_internal_reference(url,response,url);*/
mo_do_window_text(current_win,url,
response,response,1,url,0,0);
break;
}
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"result from mo_post_pull_er_over():\"%s\"\n",response);
fprintf(stderr,"MCCIRequestPost(): returning now\n");
}
#endif
}
void MCCIRequestDisplay(client,retCode,retText,url,contentType,
displayData,dataLength,output)
MCCIPort client;
int *retCode;
char *retText;
char *url;
char *contentType;
char *displayData;
int dataLength;
int output;
{
char *textHead;
char *response;
char buff[256];
int length;
char *ref;
char *new_url;
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestDisplay(): about to mo_post_pull_er_over()\n");
fprintf(stderr,"mo_post_pull_er_over(url=\"%s\",type=\"%s\", \
displayData=\"%s\")\n" ,url,contentType,displayData);
}
#endif
*retCode = MCCIR_DISPLAY_OK;
strcpy(retText,"Display Request ok");
switch(output) {
case MCCI_OUTPUT_NONE:
strcpy(retText, "OUTPUT NONE not support yet\n");
break;
case MCCI_OUTPUT_NEW:
/* open a new window and display... */
/* ...not done yet...*/
strcpy(retText, "OUTPUT NEW not support yet\n");
case MCCI_DEFAULT: /* default to output current */
case MCCI_OUTPUT_CURRENT:
default:
/* display in current window */
ref = strdup(url);
new_url = strdup(url);
if (strcmp(contentType, "text/html") == 0)
mo_do_window_text(current_win, new_url,
displayData, displayData, 1, ref, current_win->current_node->last_modified, current_win->current_node->expires);
else
strcpy(retText, "Display text/html only");
break;
}
#ifndef DISABLE_TRACE
if (cciTrace) {
fprintf(stderr,"MCCIRequestDisplay(): returning now\n");
}
#endif
}
void MCCIRequestQuit()
/* time to die */
{
mo_exit();
}
void MCCIRequestGetAnnotation(retCode,retText,retData,retDataLength,url,type)
int *retCode;
char *retText;
char **retData;
int *retDataLength;
char *url;
int type;
{
*retDataLength = 0;
if ((type == MCCI_PRIVATE_ANNOTATION) ||
(type == MCCI_ALL_ANNOTATION)) {
if ((*retData) = mo_fetch_personal_annotations(url)) {
*retCode = MCCIR_PRIVATE_ANNOTATION;
strcpy(retText,"Annotation follows");
*retDataLength = strlen(*retData);
}
else {
*retData = NULL;
*retCode = MCCIR_NO_ANNOTATION;
strcpy(retText,"No annotation for this URL");
}
}
else {
*retCode = MCCIR_NO_ANNOTATION;
strcpy(retText,"Only Private annotations currently supported");
}
return;
}
MCCIRequestPutAnnotation(retCode,retText,type,url,annotation,annotationLength)
int *retCode;
char *retText;
int type;
char *url;
char *annotation;
int annotationLength;
{
if (type == MCCI_PRIVATE_ANNOTATION) {
*retCode = mo_new_pan(url, NULL, NULL, annotation);
}
}
MCCIRequestFileToURL(retCode,retText,fileName)
int *retCode;
char *retText;
char *fileName;
{
char *url;
url = MoReturnURLFromFileName(fileName);
if (url) {
strcpy(retText,url);
*retCode = MCCIR_FILE_TO_URL;
}
else {
strcpy(retText,"No URL for given file name");
*retCode = MCCIR_NO_URL_FOR_FILE;
}
}

66
src/cciBindings.h Normal file
View File

@@ -0,0 +1,66 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */

1115
src/cciBindings2.c Normal file

File diff suppressed because it is too large Load Diff

107
src/cciBindings2.h Normal file
View File

@@ -0,0 +1,107 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __CCIBINDINGS2_H__
#define __CCIBINDINGS2_H__
#include "cci.h"
#include "cciServer.h"
cciStat *cciStatListFindEntry(MCCIPort findMe);
cciStat *cciStatListDeleteEntry(MCCIPort deleteMe);
void cciStatPreventSendAnchor(MCCIPort client, char *url);
int cciSafeToSend(cciStat *current, char *url);
void cciStatFree(cciStat *i);
void MoCCISendAnchor(MCCIPort client, int sendIt);
void MoCCISendAnchorToCCI(char *url, int beforeAfter);
void MoCCISendEvent(MCCIPort client, int on);
void MoCCISendMouseAnchor(MCCIPort client, int on);
void MoCCISendBrowserView(MCCIPort client, int on);
void MoCCIForm(MCCIPort client, char *actionID, int status, int close_connection);
int MoCCIPreInitialize();
int MoCCIInitialize(int portNumber);
int MoCCITerminateAllConnections();
int MoCCITerminateAConnection(MCCIPort client);
void MoCCIHandleInput(MCCIPort client,int source);
void MoCCINewConnection(XtAppContext app_context,int *source,XtInputId *inputID);
static XmxCallback (MoCCIWindowCallBack);
mo_status MoDisplayCCIWindow(mo_window *win);
void MoCCISendOutputToClient(char *contentType,char *fileName);
int MoCCIFormToClient(char *actionID, char *query, char *contentType,
char *post_data, int status);
void MoCCISendOutput(MCCIPort client,Boolean sendIt,char *contentType);
void MoCCIStartListening(Widget w,int port);
void MoCCISendEventOutput(CCI_events event_type);
void MoCCISendMouseAnchorOutput(char *anchor);
void MoCCISendBrowserViewOutput(char *url, char *contentType,
char *data, int dataLength);
int MoCCISendBrowserViewFile(char *url, char *contentType, char *filename);
int MoCCIMaxNumberOfConnectionsAllowed();
int MoCCICurrentNumberOfConnections();
void MoCCIAddFileURLToList(char *fileName,char *url);
char *MoReturnURLFromFileName(char *fileName);
void MoCCIAddAnchorToURL(char *url, char *urlAndAnchor);
#endif

1371
src/cciServer.c Normal file

File diff suppressed because it is too large Load Diff

18
src/cciServer.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef __CCISERVER_H__
#define __CCISERVER_H__
#include "cci.h"
extern int MCCIServerInitialize();
extern MCCIPort MCCICheckAndAcceptConnection();
extern int MCCISendResponseLine();
extern int MCCIIsThereInput();
extern int MCCIReadInputMessage();
typedef struct {
MCCIPort client;
int status;
char *url;
} cciStat; /* ejb 03/09/95 */
#endif

180
src/child.c Normal file
View File

@@ -0,0 +1,180 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/* this module intended to handle child process clean up through callbacks*/
/* written for version 2.5 */
#include "../config.h"
#include "child.h"
#include "list.h"
#include <stdio.h>
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
List childProcessList;
typedef struct {
pid_t pid;
void (*callback)();
void *callBackData;
} ProcessHandle;
static ProcessHandle *SearchForChildRecordByPID(pid_t pid);
void InitChildProcessor(void)
{
childProcessList = ListCreate();
}
/* Add a child process handler. Callback is made when child dies */
/* callback is of the form callback(callBackData,pid); */
void AddChildProcessHandler(pid_t pid,void (*callback)(), void *callBackData)
{
ProcessHandle *p;
if (!(p = (ProcessHandle *) malloc(sizeof(ProcessHandle)))) {
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"Out of Memory\n");
}
#endif
return;
}
p->pid = pid;
p->callback = callback;
p->callBackData = callBackData;
ListAddEntry(childProcessList,p);
}
static ProcessHandle *SearchForChildRecordByPID(pid_t pid)
{
ProcessHandle *p;
p = (ProcessHandle *) ListHead(childProcessList);
while(p) {
if (p->pid == pid) {
return(p);
}
p = (ProcessHandle *) ListNext(childProcessList);
}
return(NULL);
}
/* terminate the children...
you may want to remove SIGCHLD signal handler before calling this routine
*/
void KillAllChildren(void)
{
ProcessHandle *p;
/* first, be nice and send SIGHUP */
p = (ProcessHandle *) ListHead(childProcessList);
while(p) {
kill(p->pid,SIGHUP);
p = (ProcessHandle *) ListNext(childProcessList);
}
/* hack and slash */
p = (ProcessHandle *) ListHead(childProcessList);
while(p) {
kill(p->pid,SIGKILL);
p = (ProcessHandle *) ListNext(childProcessList);
}
}
/* callback routine for SIGCHLD signal handler */
void ChildTerminated(void)
{
pid_t pid;
ProcessHandle *p;
#ifdef __sgi
union wait stat_loc;
#else
int stat_loc;
#endif
#ifdef SVR4
pid = waitpid((pid_t)(-1),NULL,WNOHANG);
signal(SIGCHLD, (void (*)())ChildTerminated); /*Solaris resets the signal on a catch*/
#else
pid = wait3(&stat_loc,WNOHANG,NULL);
#endif
p = SearchForChildRecordByPID(pid);
if (!p) {
/* un registered child process */
return;
}
(p->callback)(p->callBackData,p->pid);
ListDeleteEntry(childProcessList,p);
free(p);
return;
}

72
src/child.h Normal file
View File

@@ -0,0 +1,72 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
void InitChildProcessor(void);
void AddChildProcessHandler(pid_t pid, void (*callback)(), void *callBackData);
void KillAllChildren(void);
void ChildTerminated(void);

251
src/comment.c Normal file
View File

@@ -0,0 +1,251 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Written By: Scott Powers
* Date: April 26, 1995
* Purpose: Creates a comment card for Mosaic. Submittal is via form
* and works in conjunction with a "C" cgi-bin program.
*/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "comment.h"
#include <pwd.h>
#include <sys/utsname.h>
#ifdef DEBUG_CC
int do_comment=1;
#else
int do_comment=0;
#endif
extern mo_window *current_win;
extern char *machine;
extern struct utsname mo_uname;
void CommentCard(mo_window *win);
int DumpHtml(char *htmlname);
char *MakeFilename();
void InitCard(char *fname);
void PutCardCount(long *num, char *fname);
long GetCardCount(char *fname);
void CommentCard(mo_window *win) {
FILE *fp;
long num[10];
char *fname;
int n;
char *htmlname, *htmlurl;
if (!win) {
win=mo_next_window(NULL);
}
if (!win) {
return;
}
for (n=0; n<10; n++) {
num[n]=0;
}
if (!do_comment) {
if (!(fname=MakeFilename())) {
return;
}
num[0]=GetCardCount(fname);
num[0]++;
}
#ifndef PRERELEASE
if (num[0]==COMMENT_TIME || do_comment) {
if (!(htmlname=tmpnam(NULL))) {
free(fname);
return;
}
if (!DumpHtml(htmlname)) {
free(fname);
return;
}
htmlurl=(char *)calloc(strlen(htmlname)+strlen("file://localhost")+10,sizeof(char));
sprintf(htmlurl,"file://localhost%s",htmlname);
mo_open_another_window(win,htmlurl,NULL,NULL);
free(htmlurl);
}
#endif
if (!do_comment) {
PutCardCount(num,fname);
}
free(fname);
return;
}
int DumpHtml(char *htmlname) {
FILE *fp;
if (!(fp=fopen(htmlname,"w"))) {
return(0);
}
fprintf(fp,"%s\n",comment_card_html_top);
fprintf(fp," Mosaic Compiled OS: %s<br>\n",MO_COMMENT_OS);
fprintf(fp," <input type=\"hidden\" name=\"os\" value=\"%s\">\n",MO_COMMENT_OS);
fprintf(fp," Sysname: %s<br>\n",mo_uname.sysname);
fprintf(fp," <input type=\"hidden\" name=\"sysname\" value=\"%s\">\n",mo_uname.sysname);
fprintf(fp," Release: %s<br>\n",mo_uname.release);
fprintf(fp," <input type=\"hidden\" name=\"release\" value=\"%s\">\n",mo_uname.release);
fprintf(fp,"%s\n",comment_card_html_bot);
fclose(fp);
return(1);
}
char *MakeFilename() {
char *hptr, home[256], *fname;
struct passwd *pwdent;
/*
* Try the HOME environment variable, then the password file, and
* finally give up.
*/
if (!(hptr=getenv("HOME"))) {
if (!(pwdent=getpwuid(getuid()))) {
return(NULL);
}
else {
strcpy(home,pwdent->pw_dir);
}
}
else {
strcpy(home,hptr);
}
fname=(char *)calloc(strlen(home)+strlen(COMMENT_CARD_FILENAME)+
strlen(MO_VERSION_STRING)+5,sizeof(char));
sprintf(fname,"%s/%s%s",home,COMMENT_CARD_FILENAME,MO_VERSION_STRING);
return(fname);
}
void InitCard(char *fname) {
FILE *fp;
long num[10];
int n;
if (!(fp=fopen(fname,"w"))) {
return;
}
num[0]=1;
n=fwrite(num,sizeof(long),2,fp);
fclose(fp);
return;
}
void PutCardCount(long *num, char *fname) {
FILE *fp;
int n;
if (!(fp=fopen(fname,"w"))) {
return;
}
n=fwrite(num,sizeof(long),2,fp);
fclose(fp);
return;
}
long GetCardCount(char *fname) {
FILE *fp;
long num[10];
int n;
if (!(fp=fopen(fname,"r"))) {
InitCard(fname);
return((long)0);
}
fseek(fp,0L,SEEK_SET);
n=fread(num,sizeof(long),2,fp);
fclose(fp);
return(num[0]);
}

299
src/comment.h Normal file
View File

@@ -0,0 +1,299 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#ifdef SAM_NO
#define COMMENT_CARD_FILENAME ".mosaic-cc-"
#define COMMENT_TIME 5
#define MO_COMMENT_OS "Not Supported" /**/
/* Only in the NCSA binaries! */
#define EASTER
#define EASTER_ARRAY
#define EASTER_EXTERNS
/* variables below */
#ifndef _COMMENT_H
#define _COMMENT_H
char *comment_card_html_top= \
"<title>\n" \
" Comment Card for Mosaic 2.6\n" \
"</title>\n" \
"\n" \
"<h1 align=center>\n" \
" Please Help Us Help You!!\n" \
"</h1>\n" \
"\n" \
"<hr>\n" \
"\n" \
"<h2>\n" \
" Thank you for using NCSA Mosaic! We are continually striving to\n" \
" improve Mosaic to better meet the needs of its users. We would\n" \
" appreciate your taking the time to answer these few questions.\n" \
"</h2>\n" \
"\n" \
"<hr>\n" \
"\n" \
"<form method=\"POST\" action=\"http://sdg.ncsa.uiuc.edu/XCGI/comment26\">\n" \
"\n" \
" <h3>\n" \
" <ul>\n" \
" <li>\n" \
" If you do not like surveys or you have already\n" \
" completed this survey, please press this\n" \
" button,\n" \
" <input type=\"submit\" value=\"Just Count Me\" \n" \
" name=\"countme\">,\n" \
" to be counted. Pushing the above button\n" \
" will send the following information about\n" \
" your system to be used in our statistics\n" \
" (completely anonymous):\n" \
" <p>\n" \
"\n";
char *comment_card_html_bot= \
" </p>\n" \
" </li>\n" \
" <br>\n" \
" <li>\n" \
" If you do not want to fill out this card,\n" \
" just push the \"Close Window\" button at the\n" \
" bottom of this window.\n" \
" </li>\n" \
" <br>\n" \
" <li>\n" \
" Otherwise, please proceed!\n" \
" </li>\n" \
" </ul>\n" \
" </h3>\n" \
"\n" \
" <hr>\n" \
"\n" \
" <p>\n" \
" How long have you been using Mosaic?\n" \
" <br>\n" \
" <select name=\"usage\">\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"never\">\n" \
" Never\n" \
" <option value=\"lt 1 mon\">\n" \
" Less Than 1 Month\n" \
" <option value=\"1-6 mon\">\n" \
" 1 - 6 Months\n" \
" <option value=\"6 mon-1 yr\">\n" \
" 6 Months to a Year\n" \
" <option value=\"1-2 yrs\">\n" \
" 1 - 2 Years\n" \
" <option value=\"gt 2 yrs\">\n" \
" More Than 2 Years\n" \
" </select>\n" \
" </p>\n" \
"\n" \
" <p>\n" \
" How familiar are you with the World Wide Web?\n" \
" <br>\n" \
" <select name=\"www\">\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"no experience\">\n" \
" No Experience\n" \
" <option value=\"novice\">\n" \
" Novice\n" \
" <option value=\"intermediate\">\n" \
" Intermediate\n" \
" <option value=\"expert\">\n" \
" Expert\n" \
" <option value=\"master\">\n" \
" Web Master\n" \
" </select>\n" \
" </p>\n" \
"\n" \
" <p>\n" \
" On which other platform(s) do you use Mosaic?\n" \
" <br>\n" \
" <select name=\"platform\">\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"no other\">\n" \
" No Other\n" \
" <option value=\"mac\">\n" \
" Macintosh\n" \
" <option value=\"windows\">\n" \
" Windows\n" \
" <option value=\"mac and windows\">\n" \
" Macintosh and Windows\n" \
" </select>\n" \
" </p>\n" \
"\n" \
" <p>\n" \
" What type of internet connection do you have?\n" \
" <br>\n" \
" <select name=\"connection\">\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"no connection\">\n" \
" No Connection\n" \
" <option value=\"don't know\">\n" \
" Don't Know\n" \
" <option value=\"modem lt 9600\">\n" \
" Modem Less Than 9600\n" \
" <option value=\"modem eq 9600\">\n" \
" Modem at 9600\n" \
" <option value=\"modem eq 144\">\n" \
" Modem at 14.4k\n" \
" <option value=\"modem eq 288\">\n" \
" Modem at 28.8k\n" \
" <option value=\"modem gt 288\">\n" \
" Modem Greater Than 28.8k\n" \
" <option value=\"isdn\">\n" \
" ISDN\n" \
" <option value=\"direct\">\n" \
" Direct Connection\n" \
" </select>\n" \
" </p>\n" \
"\n" \
" <p>\n" \
" Have you ever sent email to our technical support?\n" \
" <br>\n" \
" <select name=\"email\">\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"yes\">\n" \
" Yes, I Have\n" \
" <option value=\"no\">\n" \
" No, I Have Not\n" \
" </select>\n" \
"\n" \
" <dl>\n" \
" <dd>\n" \
" If so, was it satisfactory?\n" \
" <br>\n" \
" <select name=\"satisfied\">\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"yes\">\n" \
" Yes, It Was\n" \
" <option value=\"no\">\n" \
" No, It Was Not\n" \
" </select>\n" \
" <dl>\n" \
" <dd>\n" \
" Why or why not?\n" \
" <textarea name=\n" \
" \"satisfied_feedback\" \n" \
" rows=2 cols=40>\n" \
" </textarea>\n" \
" </dd>\n" \
" </dl>\n" \
" </dd>\n" \
" </dl>\n" \
" </p>\n" \
"\n" \
"<!---\n" \
"NOTE:\n" \
" The following list of browsers\n" \
" are IN ALPHABETICAL ORDER! Please Please Please, if you add one, put\n" \
" it in ALPHABETICAL order as well...so we are not accused of being\n" \
" perferential\n" \
"--->\n" \
" <p>\n" \
" What is your <b>favorite</b> Web browser?\n" \
" <dl>\n" \
" <dd>\n" \
" <select name=\"favorite\" size=5>\n" \
" <option value=\"no comment\" selected>\n" \
" No Comment\n" \
" <option value=\"arena\">\n" \
" Arena\n" \
" <option value=\"emacs-w3\">\n" \
" Emacs-W3\n" \
" <option value=\"spyglass\">\n" \
" Enhanced Mosaic (Spyglass)\n" \
" <option value=\"hot java\">\n" \
" Hot Java\n" \
" <option value=\"lynx\">\n" \
" Lynx\n" \
" <option value=\"ncsa\">\n" \
" N.C.S.A. Mosaic\n" \
" <option value=\"netscape $$$\">\n" \
" Netscape (for $$$)\n" \
" <option value=\"netscape free\">\n" \
" Netscape (for free)\n" \
" <option value=\"viola\">\n" \
" Viola\n" \
" </select>\n" \
" </dd>\n" \
" </dl>\n" \
" </p>\n" \
"\n" \
" <p>\n" \
" Other comments and/or suggestions are welcomed:\n" \
" <textarea name=\"comments_feedback\" rows=5 cols=60>\n" \
" </textarea>\n" \
" </p>\n" \
"\n" \
" <p>\n" \
" When you are done, please press this button:\n" \
" <input type=\"submit\" value=\"Submit Comment Card for X Mosaic\"\n" \
" name=\"submitme\">\n" \
" </p>\n" \
"\n" \
"</form>\n" \
"\n";
#endif
#endif // SAM_NO

53
src/copyright.tmpl Normal file
View File

@@ -0,0 +1,53 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/

886
src/gifread.c Normal file
View File

@@ -0,0 +1,886 @@
/* +-------------------------------------------------------------------+ */
/* | Copyright 1990 - 1994, David Koblas. (koblas@netcom.com) | */
/* | Permission to use, copy, modify, and distribute this software | */
/* | and its documentation for any purpose and without fee is hereby | */
/* | granted, provided that the above copyright notice appear in all | */
/* | copies and that both that copyright notice and this permission | */
/* | notice appear in supporting documentation. This software is | */
/* | provided "as is" without express or implied warranty. | */
/* +-------------------------------------------------------------------+ */
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include <stdio.h>
#include <X11/Intrinsic.h>
#include "gifread.h"
/*
#define TIMING 1
*/
#include <sys/time.h>
static struct timeval Tv;
static struct timezone Tz;
#define MAXCOLORMAPSIZE 256
#define TRUE 1
#define FALSE 0
#define CM_RED 0
#define CM_GREEN 1
#define CM_BLUE 2
#define MAX_LWZ_BITS 12
#define INTERLACE 0x40
#define LOCALCOLORMAP 0x80
#define BitSet(byte, bit) (((byte) & (bit)) == (bit))
#define ReadOK(file,buffer,len) (fread(buffer, len, 1, file) != 0)
#define LM_to_uint(a,b) (((b)<<8)|(a))
static struct {
unsigned int Width;
unsigned int Height;
unsigned char ColorMap[3][MAXCOLORMAPSIZE];
unsigned int BitPixel;
unsigned int ColorResolution;
unsigned int Background;
unsigned int AspectRatio;
/*
**
*/
int xGrayScale;
} GifScreen;
static struct {
int transparent;
int delayTime;
int inputFlag;
int disposal;
} Gif89 = { -1, -1, -1, 0 };
static int verbose = FALSE;
static int showComment = FALSE;
static int ReadColorMap(FILE *, int, unsigned char [3][MAXCOLORMAPSIZE], int *);
static int DoExtension(FILE *, int);
static int GetDataBlock(FILE *, unsigned char *);
static unsigned char *ReadImage(FILE *, int, int, XColor *, int,
unsigned char[3][MAXCOLORMAPSIZE], int, int, int);
/*
unsigned char *ReadGIF ARGS(( FILE *fd, int imageNumber, int *bg ));
static int ReadColorMap ARGS(( FILE *fd, int number, unsigned char buffer[3][MAXCOLORMAPSIZE] ));
static int DoExtension ARGS(( FILE *fd, int label ));
static int GetDataBlock ARGS(( FILE *fd, unsigned char *buf ));
static int GetCode ARGS(( FILE *fd, int code_size, int flag ));
static int LWZReadByte ARGS(( FILE *fd, int flag, int input_code_size ));
static unsigned char *ReadImage ARGS(( FILE *fd, int len, int height, unsigned char cmap[3][MAXCOLORMAPSIZE], int interlace, int ignore ));
*/
/*
static int ReadColorMap();
static int DoExtension();
static int GetDataBlock();
static int GetCode();
static int LWZReadByte();
static unsigned char *ReadImage();
*/
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
unsigned char *
ReadGIF(FILE *fd, int *w, int *h, XColor *colrs, int *bg)
{
unsigned char buf[16];
unsigned char c;
unsigned char localColorMap[3][MAXCOLORMAPSIZE];
int grayScale;
int useGlobalColormap;
int bitPixel;
int imageCount = 0;
char version[4];
int imageNumber = 1;
unsigned char *image = NULL;
int i;
#ifndef DISABLE_TRACE
if (srcTrace) {
gettimeofday(&Tv, &Tz);
fprintf(stderr, "ReadGIF_DK enter (%d.%d)\n", Tv.tv_sec, Tv.tv_usec);
}
#endif
verbose = FALSE;
showComment = FALSE;
/*
* Initialize GIF89 extensions
*/
Gif89.transparent = -1;
Gif89.delayTime = -1;
Gif89.inputFlag = -1;
Gif89.disposal = 0;
if (! ReadOK(fd,buf,6))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "error reading magic number\n");
}
#endif
return(NULL);
}
if (strncmp((char *)buf,"GIF",3) != 0)
{
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf(stderr, "not a GIF file\n");
#endif
return(NULL);
}
strncpy(version, (char *)buf + 3, 3);
version[3] = '\0';
if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "bad version number, not '87a' or '89a'\n");
}
#endif
return(NULL);
}
if (! ReadOK(fd,buf,7))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "failed to read screen descriptor\n");
}
#endif
return(NULL);
}
GifScreen.Width = LM_to_uint(buf[0],buf[1]);
GifScreen.Height = LM_to_uint(buf[2],buf[3]);
GifScreen.BitPixel = 2<<(buf[4]&0x07);
GifScreen.ColorResolution = (((buf[4]&0x70)>>3)+1);
GifScreen.Background = buf[5];
GifScreen.AspectRatio = buf[6];
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
int scale = 65536/MAXCOLORMAPSIZE;
if (ReadColorMap(fd,GifScreen.BitPixel,GifScreen.ColorMap,
&GifScreen.xGrayScale))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "error reading global colormap\n");
}
#endif
return(NULL);
}
for (i=0; i < GifScreen.BitPixel; i++)
{
colrs[i].red = GifScreen.ColorMap[0][i] * scale;
colrs[i].green = GifScreen.ColorMap[1][i] * scale;
colrs[i].blue = GifScreen.ColorMap[2][i] * scale;
colrs[i].pixel = i;
colrs[i].flags = DoRed|DoGreen|DoBlue;
}
for (i = GifScreen.BitPixel; i<MAXCOLORMAPSIZE; i++)
{
colrs[i].red = 0;
colrs[i].green = 0;
colrs[i].blue = 0;
colrs[i].pixel = i;
colrs[i].flags = DoRed|DoGreen|DoBlue;
}
}
if (GifScreen.AspectRatio != 0 && GifScreen.AspectRatio != 49) {
/* float r;
r = ( (float) GifScreen.AspectRatio + 15.0 ) / 64.0;*/
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "Warning: non-square pixels!\n");
}
#endif
}
while (image == NULL) {
if (! ReadOK(fd,&c,1))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "EOF / read error on image data\n");
}
#endif
return(NULL);
}
if (c == ';') { /* GIF terminator */
if (imageCount < imageNumber)
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "No images found in file\n");
}
#endif
return(NULL);
}
break;
}
if (c == '!') { /* Extension */
if (! ReadOK(fd,&c,1))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "EOF / read error on extention function code\n");
}
#endif
return(NULL);
}
DoExtension(fd, c);
continue;
}
if (c != ',') { /* Not a valid start character */
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "bogus character 0x%02x, ignoring\n",
(int)c);
}
#endif
continue;
}
++imageCount;
if (! ReadOK(fd,buf,9))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"couldn't read left/top/width/height\n");
}
#endif
return(NULL);
}
useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP);
bitPixel = 1<<((buf[8]&0x07)+1);
/*
* We only want to set width and height for the imageNumber
* we are requesting.
*/
if (imageCount == imageNumber)
{
*w = LM_to_uint(buf[4],buf[5]);
*h = LM_to_uint(buf[6],buf[7]);
}
if (! useGlobalColormap) {
if (ReadColorMap(fd,bitPixel,localColorMap,&grayScale))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "error reading local colormap\n");
}
#endif
return(NULL);
}
/*
* We only want to set the data for the
* imageNumber we are requesting.
*/
if (imageCount == imageNumber)
{
image = ReadImage(fd, LM_to_uint(buf[4],buf[5]),
LM_to_uint(buf[6],buf[7]), colrs,
bitPixel, localColorMap, grayScale,
BitSet(buf[8], INTERLACE),
imageCount != imageNumber);
}
else
{
/* unsigned char *tdata;
tdata =*/ ReadImage(fd, LM_to_uint(buf[4],buf[5]),
LM_to_uint(buf[6],buf[7]), colrs,
bitPixel, localColorMap, grayScale,
BitSet(buf[8], INTERLACE),
imageCount != imageNumber);
}
} else {
/*
* We only want to set the data for the
* imageNumber we are requesting.
*/
if (imageCount == imageNumber)
{
image = ReadImage(fd, LM_to_uint(buf[4],buf[5]),
LM_to_uint(buf[6],buf[7]), colrs,
GifScreen.BitPixel, GifScreen.ColorMap,
GifScreen.xGrayScale,
BitSet(buf[8], INTERLACE),
imageCount != imageNumber);
}
else
{
/* unsigned char *tdata;
tdata =*/ ReadImage(fd, LM_to_uint(buf[4],buf[5]),
LM_to_uint(buf[6],buf[7]), colrs,
GifScreen.BitPixel, GifScreen.ColorMap,
GifScreen.xGrayScale,
BitSet(buf[8], INTERLACE),
imageCount != imageNumber);
}
}
}
*bg = Gif89.transparent;
#ifndef DISABLE_TRACE
if (srcTrace) {
gettimeofday(&Tv, &Tz);
fprintf(stderr, "ReadGIF_DK exit (%d.%d)\n", Tv.tv_sec, Tv.tv_usec);
}
#endif
return(image);
}
static int
ReadColorMap(FILE *fd, int number, unsigned char buffer[3][MAXCOLORMAPSIZE],
int *gray)
{
int i;
unsigned char rgb[3];
int flag;
flag = TRUE;
for (i = 0; i < number; ++i) {
if (! ReadOK(fd, rgb, sizeof(rgb)))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "bad colormap\n");
}
#endif
return(TRUE);
}
buffer[CM_RED][i] = rgb[0] ;
buffer[CM_GREEN][i] = rgb[1] ;
buffer[CM_BLUE][i] = rgb[2] ;
flag &= (rgb[0] == rgb[1] && rgb[1] == rgb[2]);
}
*gray = flag;
return FALSE;
}
static int
DoExtension(FILE *fd, int label)
{
static char buf[256];
char str[256];
switch (label) {
case 0x01: /* Plain Text Extension */
strcpy(str,"Plain Text Extension");
#ifdef notdef
if (GetDataBlock(fd, (unsigned char*) buf) <= 0)
;
lpos = LM_to_uint(buf[0], buf[1]);
tpos = LM_to_uint(buf[2], buf[3]);
width = LM_to_uint(buf[4], buf[5]);
height = LM_to_uint(buf[6], buf[7]);
cellw = buf[8];
cellh = buf[9];
foreground = buf[10];
background = buf[11];
while (GetDataBlock(fd, (unsigned char*) buf) > 0) {
PPM_ASSIGN(image[ypos][xpos],
cmap[CM_RED][v],
cmap[CM_GREEN][v],
cmap[CM_BLUE][v]);
++index;
}
return FALSE;
#else
break;
#endif
case 0xff: /* Application Extension */
strcpy(str,"Application Extension");
break;
case 0xfe: /* Comment Extension */
strcpy(str,"Comment Extension");
while (GetDataBlock(fd, (unsigned char*) buf) > 0) {
if (showComment)
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "gif comment: %s\n", buf);
}
#endif
}
}
return FALSE;
case 0xf9: /* Graphic Control Extension */
strcpy(str,"Graphic Control Extension");
(void) GetDataBlock(fd, (unsigned char*) buf);
Gif89.disposal = (buf[0] >> 2) & 0x7;
Gif89.inputFlag = (buf[0] >> 1) & 0x1;
Gif89.delayTime = LM_to_uint(buf[1],buf[2]);
if ((buf[0] & 0x1) != 0)
Gif89.transparent = (int)((unsigned char)buf[3]);
while (GetDataBlock(fd, (unsigned char*) buf) > 0)
;
return FALSE;
default:
sprintf(str, "UNKNOWN (0x%02x)", label);
break;
}
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "got a '%s' extension\n", str);
}
#endif
while (GetDataBlock(fd, (unsigned char*) buf) > 0)
;
return FALSE;
}
static int ZeroDataBlock = FALSE;
static int
GetDataBlock(FILE *fd, unsigned char *buf)
{
unsigned char count;
count = 0;
if (! ReadOK(fd, &count, 1)) {
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "error in getting DataBlock size\n");
}
#endif
return -1;
}
ZeroDataBlock = count == 0;
if ((count != 0) && (! ReadOK(fd, buf, count))) {
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "error in reading DataBlock\n");
}
#endif
return -1;
}
return((int)count);
}
/*
** Pulled out of nextCode
*/
static int curbit, lastbit, get_done, last_byte;
static int return_clear;
/*
** Out of nextLWZ
*/
static int stack[(1<<(MAX_LWZ_BITS))*2], *sp;
static int code_size, set_code_size;
static int max_code, max_code_size;
static int clear_code, end_code;
static void initLWZ(int input_code_size)
{
/* static int inited = FALSE;*/
set_code_size = input_code_size;
code_size = set_code_size + 1;
clear_code = 1 << set_code_size ;
end_code = clear_code + 1;
max_code_size = 2 * clear_code;
max_code = clear_code + 2;
curbit = lastbit = 0;
last_byte = 2;
get_done = FALSE;
return_clear = TRUE;
sp = stack;
}
static int nextCode(FILE *fd, int code_size)
{
static unsigned char buf[280];
static int maskTbl[16] = {
0x0000, 0x0001, 0x0003, 0x0007,
0x000f, 0x001f, 0x003f, 0x007f,
0x00ff, 0x01ff, 0x03ff, 0x07ff,
0x0fff, 0x1fff, 0x3fff, 0x7fff,
};
int i, j, ret, end;
if (return_clear) {
return_clear = FALSE;
return clear_code;
}
end = curbit + code_size;
if (end >= lastbit) {
int count;
if (get_done) {
if (curbit >= lastbit)
{
#if 0
ERROR("ran off the end of my bits" );
#endif
}
return -1;
}
buf[0] = buf[last_byte-2];
buf[1] = buf[last_byte-1];
if ((count = GetDataBlock(fd, &buf[2])) == 0)
get_done = TRUE;
last_byte = 2 + count;
curbit = (curbit - lastbit) + 16;
lastbit = (2+count)*8 ;
end = curbit + code_size;
}
j = end / 8;
i = curbit / 8;
if (i == j)
ret = (int)buf[i];
else if (i + 1 == j)
ret = (int)buf[i] | ((int)buf[i+1] << 8);
else
ret = (int)buf[i] | ((int)buf[i+1] << 8) | ((int)buf[i+2] << 16);
ret = (ret >> (curbit % 8)) & maskTbl[code_size];
curbit += code_size;
return ret;
}
#define readLWZ(fd) ((sp > stack) ? *--sp : nextLWZ(fd))
static int nextLWZ(FILE *fd)
{
static int table[2][(1<< MAX_LWZ_BITS)];
static int firstcode, oldcode;
int code, incode;
register int i;
while ((code = nextCode(fd, code_size)) >= 0) {
if (code == clear_code) {
/* corrupt GIFs can make this happen */
if (clear_code >= (1<<MAX_LWZ_BITS))
{
return -2;
}
for (i = 0; i < clear_code; ++i) {
table[0][i] = 0;
table[1][i] = i;
}
for (; i < (1<<MAX_LWZ_BITS); ++i)
table[0][i] = table[1][i] = 0;
code_size = set_code_size+1;
max_code_size = 2*clear_code;
max_code = clear_code+2;
sp = stack;
do {
firstcode = oldcode = nextCode(fd, code_size);
} while (firstcode == clear_code);
return firstcode;
}
if (code == end_code) {
int count;
unsigned char buf[260];
if (ZeroDataBlock)
return -2;
while ((count = GetDataBlock(fd, buf)) > 0)
;
if (count != 0)
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"missing EOD in data stream (common occurence)");
}
#endif
}
return -2;
}
incode = code;
if (code >= max_code) {
*sp++ = firstcode;
code = oldcode;
}
while (code >= clear_code) {
*sp++ = table[1][code];
if (code == table[0][code])
{
#if 0
ERROR("circular table entry BIG ERROR");
#endif
return(code);
}
if ((int)sp >= ((int)stack + sizeof(stack)))
{
#if 0
ERROR("circular table STACK OVERFLOW!");
#endif
return(code);
}
code = table[0][code];
}
*sp++ = firstcode = table[1][code];
if ((code = max_code) <(1<<MAX_LWZ_BITS)) {
table[0][code] = oldcode;
table[1][code] = firstcode;
++max_code;
if ((max_code >= max_code_size) &&
(max_code_size < (1<<MAX_LWZ_BITS))) {
max_code_size *= 2;
++code_size;
}
}
oldcode = incode;
if (sp > stack)
return *--sp;
}
return code;
}
static unsigned char *
ReadImage(FILE *fd, int len, int height, XColor *colrs, int cmapSize,
unsigned char cmap[3][MAXCOLORMAPSIZE], int gray,
int interlace, int ignore)
{
unsigned char *dp, c;
int v;
int xpos = 0, ypos = 0/*, pass = 0*/;
unsigned char *image;
/*
** Initialize the Compression routines
*/
if (! ReadOK(fd,&c,1))
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "EOF / read error on image data\n");
}
#endif
return(NULL);
}
initLWZ(c);
/*
** If this is an "uninteresting picture" ignore it.
*/
if (ignore) {
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf(stderr, "skipping image...\n" );
#endif
while (readLWZ(fd) >= 0)
;
return(NULL);
}
image = (unsigned char *)calloc(len * height, sizeof(char));
if (image == NULL)
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "Cannot allocate space for image data\n");
}
#endif
return(NULL);
}
for (v = 0; v < MAXCOLORMAPSIZE; v++) {
colrs[v].red = colrs[v].green = colrs[v].blue = 0;
colrs[v].pixel = v;
colrs[v].flags = DoRed|DoGreen|DoBlue;
}
for (v = 0; v < cmapSize; v++) {
colrs[v].red = cmap[CM_RED][v] * 0x101;
colrs[v].green = cmap[CM_GREEN][v] * 0x101;
colrs[v].blue = cmap[CM_BLUE][v] * 0x101;
}
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf(stderr, "reading %d by %d%s GIF image\n",
len, height, interlace ? " interlaced" : "" );
#endif
if (interlace) {
int i;
int pass = 0, step = 8;
for (i = 0; i < height; i++) {
if (ypos < height)
{
dp = &image[len * ypos];
for (xpos = 0; xpos < len; xpos++) {
if ((v = readLWZ(fd)) < 0)
goto fini;
*dp++ = v;
}
}
if ((ypos += step) >= height) {
if (pass++ > 0)
step /= 2;
ypos = step / 2;
}
}
} else {
dp = image;
for (ypos = 0; ypos < height; ypos++) {
for (xpos = 0; xpos < len; xpos++) {
if ((v = readLWZ(fd)) < 0)
goto fini;
*dp++ = v;
}
}
}
fini:
if (readLWZ(fd)>=0)
{
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr,"too much input data, ignoring extra...");
}
#endif
}
return(image);
}

71
src/gifread.h Normal file
View File

@@ -0,0 +1,71 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GIFREAD_H__
#define __GIFREAD_H__
unsigned char *ReadGIF(FILE *fd, int *w, int *h, XColor *colrs, int *bg);
#endif

1238
src/globalhist.c Normal file

File diff suppressed because it is too large Load Diff

82
src/globalhist.h Normal file
View File

@@ -0,0 +1,82 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GLOBALHIST_H__
#define __GLOBALHIST_H__
mo_status mo_been_here_before_huh_dad (char *);
mo_status mo_here_we_are_son (char *);
mo_status mo_init_global_history (void);
mo_status mo_wipe_global_history (mo_window *);
mo_status mo_setup_global_history (void);
mo_status mo_write_global_history (void);
void *mo_fetch_cached_image_data (char *);
void *mo_fetch_cached_local_name (char *);
mo_status mo_cache_data (char *, void *, int);
mo_status mo_zap_cached_images_here (mo_window *);
mo_status mo_flush_image_cache (mo_window *);
mo_status mo_set_image_cache_nuke_threshold (void);
#endif

202
src/grpan-www.c Normal file
View File

@@ -0,0 +1,202 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "grpan-www.h"
/*for memcpy*/
#include <memory.h>
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
#if 0
/* libwww includes */
#include "tcp.h"
#include "HTAnchor.h"
#include "HTParse.h"
static int HtLoadHTTPANN(char *arg, char *data, int len, char *com);
/****************************************************************************
* name: HtLoadHTTPANN (PRIVATE)
* purpose: Issue a command to a group annotation server.
* inputs:
* - char *arg:
* - char *data:
* - int len:
* - char *com:
* returns:
*
* remarks:
*
****************************************************************************/
static int
HtLoadHTTPANN(char *arg, char *data, int len, char *com)
{
int s; /* Socket number for returned data */
char *command; /* The whole command */
int status; /* tcp return */
SockA soc_address; /* Binary network address */
SockA *sin = &soc_address;
char *tptr;
int fmt, compressed;
int command_len;
HTParentAnchor *anchor;
/*
* Set up defaults:
*/
#ifdef DECNET
sin->sdn_family = AF_DECnet; /* Family = DECnet, host order */
sin->sdn_objnum = DNP_OBJ; /* Default: http object number */
#else /* Internet */
sin->sin_family = AF_INET; /* Family = internet, host order */
sin->sin_port = htons(TCP_PORT); /* Default: http port */
#endif
tptr = HTParse(arg, "", PARSE_HOST);
status = HTParseInet(sin, tptr);
free(tptr);
if (status)
{
return(status);
}
/*
* Now, let's get a socket set up from the server for the data.
*/
#ifdef DECNET
s = socket(AF_DECnet, SOCK_STREAM, 0);
#else
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
#endif
status = connect
(s, (struct sockaddr*)&soc_address,sizeof(soc_address));
if (status < 0)
{
return(HTInetStatus("connect"));
}
/* If there's an anchor at this point, leave it in. */
tptr = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION|PARSE_ANCHOR);
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf(stderr, "HTParse(%s) returns:\n\t(%s)\n", arg, tptr);
}
#endif
command_len = strlen(com) + strlen(tptr);
command = malloc(command_len + len + 1);
if (command == NULL) outofmem(__FILE__, "HTLoadHTTP");
strcpy(command, com);
strcat(command, tptr);
if (len != 0)
{
char *bptr;
bptr = (char *)(command + command_len);
/* bcopy(data, bptr, len);*/
memcpy(bptr, data, len);
command_len += len;
}
else
{
command_len++;
}
free(tptr);
status = NETWRITE(s, command, command_len);
free(command);
if (status < 0)
{
return(HTInetStatus("send"));
}
tptr = HTParse(arg, "",
PARSE_ACCESS | PARSE_HOST | PARSE_PATH |
PARSE_PUNCTUATION);
#if 0
/* fmt = HTFileFormat (tptr, WWW_HTML, &compressed); */
fmt = WWW_HTML;
anchor = HTAnchor_parent(HTAnchor_findAddress(arg));
HTParseFormat(fmt, anchor, s, 0);
#endif
free(tptr);
status = NETCLOSE(s);
return(HT_LOADED);
}
#endif /* 0 */
char *
grpan_doit(char *com, char *url, char *data, int len, char **texthead)
{
#if 0
char *txt;
if (HtLoadHTTPANN(url, data, len, com) == HT_LOADED)
{
txt = mo_get_html_return(texthead);
return(txt);
}
*texthead = NULL;
#endif /* 0 */
return(NULL);
}

71
src/grpan-www.h Normal file
View File

@@ -0,0 +1,71 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GRPANWWW_H__
#define __GRPANWWW_H__
char *grpan_doit(char *com, char *url, char *data, int len, char **texthead);
#endif

675
src/grpan.c Normal file
View File

@@ -0,0 +1,675 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "grpan.h"
#include "grpan-www.h"
#include "pan.h"
#include "mo-www.h"
/*#ifdef __hpux || __sgi*/
#if defined(__hpux) || defined(__sgi) || defined(linux)
#include <time.h>
#endif
static char *EscapeStuff(char *title);
/* -------------------------- Group Annotations --------------------------- */
#define NCSA_GROUP_ANNOTATION_FORMAT_ONE \
"<ncsa-group-annotation-format-1>"
/* If Rdata.annotation_server is non-NULL, then every time we retrieve
a document from any remote system we ask the annotation server
about any annotations corresonding to that document.
The annotation server either returns NULL (none exist) or a block
of HTML-format text suitable for appending at the end of a document
that contain anchors that link to the annotations themselves.
The external interface to this module is as follows:
char *mo_fetch_grpan_links (char *url)
Return an HTML-format hyperlink table to be appended to
the document text, or NULL if no annotations exist.
If a non-NULL result is returned, the caller must free it.
mo_status mo_new_grpan (char *url, char *title, char *author,
char *text)
Add a new annotation for document named by 'url' to the
list of annotations for that document on the annotation server.
Return mo_succeed if successful, else mo_fail.
All functions herein behave properly if Rdata.annotation_server
is NULL; therefore, they can be freely called as desired.
*/
/*
* Escape quotes by preceding them with backslash.
* Also escape backslash with a preceding backslash.
*/
static char *EscapeStuff(char *title)
{
char *ret;
char *ptr;
char *tptr;
int ecnt;
if (title == NULL)
{
return(title);
}
ecnt = 0;
tptr = title;
while (*tptr != '\0')
{
if ((*tptr == '\"')||(*tptr == '\\'))
{
ecnt++;
}
tptr++;
}
if (ecnt == 0)
{
ret = strdup(title);
return(ret);
}
ret = (char *)malloc(strlen(title) + ecnt + 1);
ptr = ret;
tptr = title;
while (*tptr != '\0')
{
if ((*tptr == '\"')||(*tptr == '\\'))
{
*ptr++ = '\\';
*ptr++ = *tptr++;
}
else
{
*ptr++ = *tptr++;
}
}
*ptr = '\0';
return(ret);
}
/****************************************************************************
* name: mo_fetch_grpan_links
* purpose: Fetch the list of group annotations for this document.
* inputs:
* - char *url: The URL for which to fetch.
* returns:
* An HTML block with the list of group annotations, or NULL.
* remarks:
* Right now the server constructs the list for us. Later we will want
* to construct it ourselves to be able to support local kill lists,
* and the like.
****************************************************************************/
char *mo_fetch_grpan_links (char *url)
{
char *request;
char *ttxt, *ttxthead;
char *post_data, *status_ptr;
if (! get_pref_string(eANNOTATION_SERVER)) /* No annotation server */
{
return NULL;
}
else
{
/* Go get the anchor in the URL, if any. */
char *anch = mo_url_extract_anchor (url);
/* If there is one and it doesn't start with "hdfref",
then clip it off. WHAT ABOUT PERSONAL ANNOTATIONS??? */
if (anch && strncmp (anch, "hdfref", 6))
url = mo_url_canonicalize (url, "");
/* Sanity check. */
if (!url)
return NULL;
/* the old Bina grpan request */
/*
request = (char *)malloc(strlen(url) + 256);
sprintf
(request, "grpan://%s/url=\"%s\";=", Rdata.annotation_server, url);
ttxt = grpan_doit("ANN_GET ", request, (char *)NULL, 0, &ttxthead);
free(request);
*/
/* amb */
post_data = (char *)malloc(strlen(url) + 1024);
sprintf(post_data, "cmd=an_get&format=html&url=%s", url);
ttxt = mo_post_pull_er_over (get_pref_string(eANNOTATION_SERVER),
"application/x-www-form-urlencoded",
post_data, &ttxthead);
free(post_data);
/* check if status=200 was returned */
status_ptr=strstr(ttxt, "status=");
/*check for null... SWP*/
if (!status_ptr || (status_ptr && strncmp(status_ptr, "status=200", 10)!=0)) {
return(NULL);
}
/* /amb */
if ((ttxt == NULL)||(*ttxt == '\0')) /* No annotations */
{
return(NULL);
}
else
{
return(ttxt);
}
}
}
/****************************************************************************
* name: mo_is_editable_grpan
* purpose: Discover if a block of HTML is an editable group annotation.
* inputs:
* - char *text: Text block to check.
* returns:
* mo_succeed if it is, mo_fail if not.
* remarks:
*
****************************************************************************/
mo_status mo_is_editable_grpan (char *text)
{
if (!text)
return mo_fail;
if (!strncmp (text, NCSA_GROUP_ANNOTATION_FORMAT_ONE,
strlen (NCSA_GROUP_ANNOTATION_FORMAT_ONE)))
return mo_succeed;
else
return mo_fail;
}
/****************************************************************************
* name: mo_new_grpan
* purpose: Send a new group annotation to the server.
* inputs:
* - char *url: The URL of the document being annotated.
* - char *title: Title of the new annotation.
* - char *author: Author of the new annotation.
* - char *text: Text of the new annotation.
* returns:
* mo_succeed if the annotation was registered; mo_fail if not.
* remarks:
* Send a new group annotation to the server. The data (text) can actually
* be binary, but then you need to compose what you send with something other
* than strcat, and you may need to call a function other than
* mo_pull_er_over to send the binary request unmunged.
****************************************************************************/
mo_status mo_new_grpan (char *url, char *title, char *author, char *text)
{
if (! get_pref_string(eANNOTATION_SERVER)) /* No annotation server */
{
return mo_fail;
}
else
{
char *post_data;
char *request;
char *ttxt, *ttxthead;
time_t foo = time (NULL);
char *ts = ctime (&foo);
char *Etitle, *Euser;
char *esc_text;
ts[strlen(ts)-1] = '\0';
Etitle = EscapeStuff(title);
Euser = EscapeStuff(author);
/* The old Bina thing */
/*
request = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser) +
strlen(ts) + strlen(text) + 256);
if (request == NULL)
{
return mo_fail;
}
sprintf(request,
"grpan://%s/url=\"%s\";title=\"%s\";user=\"%s\";date=%s;length=%d;=",
Rdata.annotation_server, url, Etitle, Euser, ts, strlen(text));
ttxt = grpan_doit
("ANN_SET ", request, text, (strlen(text) + 1), &ttxthead);
free(request);
*/
/* amb */
post_data = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser)
+ strlen(ts) + strlen(text) + 256);
if (post_data == NULL)
return mo_fail;
esc_text = mo_escape_part(text);
sprintf(post_data, "cmd=an_post&url=%s&title=%s&author=%s&text=%s",
url, title, author, esc_text);
ttxt = mo_post_pull_er_over (get_pref_string(eANNOTATION_SERVER),
"application/x-www-form-urlencoded",
post_data, &ttxthead);
free(post_data);
/* /amb */
if (Etitle != NULL)
{
free(Etitle);
}
if (Euser != NULL)
{
free(Euser);
}
return mo_succeed;
}
}
/****************************************************************************
* name: mo_audio_grpan
* purpose: Send a new audio group annotation to the server.
* inputs:
* - char *url: The URL of the document being annotated.
* - char *title: Title of the new annotation.
* - char *author: Author of the new annotation.
* - char *data: Binary data of the new annotation.
* - int len:
* returns:
* mo_succeed if everything's OK, mo_fail else.
* remarks:
* The data is sound, either .au, or .aiff format.
****************************************************************************/
mo_status mo_audio_grpan (char *url, char *title, char *author,
char *data, int len)
{
if (! get_pref_string(eANNOTATION_SERVER)) /* No annotation server */
{
return mo_fail;
}
else
{
char *request;
char *ttxt, *ttxthead;
time_t foo = time (NULL);
char *ts = ctime (&foo);
char *Etitle, *Euser;
ts[strlen(ts)-1] = '\0';
Etitle = EscapeStuff(title);
Euser = EscapeStuff(author);
request = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser) +
strlen(ts) + 256);
if (request == NULL)
{
return mo_fail;
}
sprintf(request,
#ifdef __sgi
"grpan://%s/url=\"%s\";title=\"%s\";user=\"%s\";date=%s;audio=aiff;length=%d;=",
#else /* sun or hp */
"grpan://%s/url=\"%s\";title=\"%s\";user=\"%s\";date=%s;audio=au;length=%d;=",
#endif
get_pref_string(eANNOTATION_SERVER), url, Etitle, Euser, ts, len);
ttxt = grpan_doit("ANN_SET ", request, data, len, &ttxthead);
free(request);
if (Etitle != NULL)
{
free(Etitle);
}
if (Euser != NULL)
{
free(Euser);
}
return mo_succeed;
}
}
/****************************************************************************
* name: mo_modify_grpan
* purpose: Alter the content of an existing group annotation.
* inputs:
* inputs:
* - char *url: The URL of the annotation being changed.
* - char *title: Title of the new (modified) annotation.
* - char *author: Author of the new (modified) annotation.
* - char *text: Text of the new (modified) annotation.
* returns:
* mo_succeed if the annotation changes were registered; mo_fail if not.
* remarks:
*
****************************************************************************/
mo_status mo_modify_grpan (char *url, char *title, char *author, char *text)
{
if (! get_pref_string(eANNOTATION_SERVER)) /* No annotation server */
{
return mo_fail;
}
else
{
char *request;
char *ttxt, *ttxthead;
time_t foo = time (NULL);
char *ts = ctime (&foo);
char *Etitle, *Euser;
ts[strlen(ts)-1] = '\0';
Etitle = EscapeStuff(title);
Euser = EscapeStuff(author);
request = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser) +
strlen(ts) + strlen(text) + 256);
if (request == NULL)
{
return mo_fail;
}
sprintf(request,
"grpan://%s/url=\"%s\";title=\"%s\";user=\"%s\";date=%s;length=%d;=",
get_pref_string(eANNOTATION_SERVER), url, Etitle, Euser, ts, strlen(text));
ttxt = grpan_doit("ANN_CHANGE ", request, text, (strlen(text) + 1), &ttxthead);
free(request);
if (Etitle != NULL)
{
free(Etitle);
}
if (Euser != NULL)
{
free(Euser);
}
return mo_succeed;
}
}
/****************************************************************************
* name: mo_delete_grpan
* purpose: Delete the annotation whose url is passed.
* inputs:
* - char *url: URL of annotation to be deleted.
* returns:
* mo_succeed, if everything went OK.
* remarks:
*
****************************************************************************/
mo_status mo_delete_grpan (char *url)
{
if (! get_pref_string(eANNOTATION_SERVER)) /* No annotation server */
{
return mo_fail;
}
else
{
char *request;
char *ttxt, *ttxthead;
request = (char *)malloc(strlen(url) + 256);
sprintf
(request, "grpan://%s/url=\"%s\";=",
get_pref_string(eANNOTATION_SERVER), url);
ttxt = grpan_doit("ANN_DELETE ", request, (char *)NULL, 0, &ttxthead);
free(request);
return(mo_succeed);
}
}
/****************************************************************************
* name: mo_grok_grpan_pieces
* purpose: Read pieces of out an annotation.
* inputs:
* - char *url: URL of the annotation.
* - char *t: Text of the annotation.
* - char **title: Return title of the annotation.
* - char **author: Return author of the annotation.
* - char **text: Return text (body) of the annotation.
* - int *id: Return ID of the annotation.
* - char **fn: Unused.
* returns:
* mo_succeed if the return pointers were set to the right data;
* mo_fail if something went wrong.
* remarks:
*
****************************************************************************/
mo_status mo_grok_grpan_pieces (char *url, char *t,
char **title, char **author, char **text,
int *id, char **fn)
{
char *txt;
char *tptr;
char *head;
/* Fail if there isno annotation text */
txt = t;
if ((txt == NULL)||(*txt == '\0'))
{
return mo_fail;
}
/* Fail if this is not a group annotation */
if (strncmp (txt, NCSA_GROUP_ANNOTATION_FORMAT_ONE,
strlen (NCSA_GROUP_ANNOTATION_FORMAT_ONE)) != 0)
{
return mo_fail;
}
/* Skip the magic cookie */
tptr = txt;
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
/* Skip the title line */
tptr++;
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
/* skip to the beginning of the title after the header tag */
while (*tptr != '>')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
tptr++;
head = tptr;
/* skip to the end of the title before the close header tag */
while (*tptr != '<')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
*tptr = '\0';
*title = strdup(head); /* snarf out the title */
*tptr = '<';
/* skip to the end of the header line. */
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
/* skip to the beginning of the author after the address tag */
while (*tptr != '>')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
tptr++;
head = tptr;
/* skip to the end of the author before the close address tag */
while (*tptr != '<')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
*tptr = '\0';
*author = strdup(head); /* snarf the author name */
*tptr = '<';
/* skip to the end of the author line. */
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
/* skip to the end of the date line. */
tptr++;
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
/* skip to the end of the ___ line. */
tptr++;
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
/* skip to the end of the pre line. */
tptr++;
while (*tptr != '\n')
{
if (*tptr == '\0')
{
return mo_fail;
}
tptr++;
}
tptr++;
*text = strdup(tptr); /* snarf the remaining text */
/*
* Find the annotation file name at the end of the url, and strip
* the id number out of it.
*/
tptr = strrchr(url, '/');
if (tptr == NULL)
{
int hash, val;
if (sscanf(url, "%d-%d.html", &hash, &val) != 2)
{
return mo_fail;
}
*id = val;
}
else
{
int hash, val;
tptr++;
if (sscanf(tptr, "%d-%d.html", &hash, &val) != 2)
{
return mo_fail;
}
*id = val;
}
return mo_succeed;
}

80
src/grpan.h Normal file
View File

@@ -0,0 +1,80 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GRPAN_H__
#define __GRPAN_H__
char *mo_fetch_grpan_links (char *url);
mo_status mo_is_editable_grpan (char *text);
mo_status mo_new_grpan (char *url, char *title, char *author, char *text);
mo_status mo_audio_grpan (char *url, char *title, char *author,
char *data, int len);
mo_status mo_modify_grpan (char *url, char *title, char *author, char *text);
mo_status mo_delete_grpan (char *url);
mo_status mo_grok_grpan_pieces (char *url, char *t,
char **title, char **author, char **text,
int *id, char **fn);
#endif

3005
src/gui-dialogs.c Normal file

File diff suppressed because it is too large Load Diff

86
src/gui-dialogs.h Normal file
View File

@@ -0,0 +1,86 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUIDIALOGS_H__
#define __GUIDIALOGS_H__
mo_status mo_post_save_window (mo_window *);
/* called from libwww */
void rename_binary_file (char *);
mo_status mo_post_open_local_window (mo_window *);
mo_status mo_post_open_window (mo_window *);
#ifdef HAVE_DTM
mo_status mo_send_document_over_dtm (mo_window *);
mo_status mo_post_dtmout_window (mo_window *);
#endif
mo_status mo_post_mail_window (mo_window *);
mo_status mo_post_print_window (mo_window *);
mo_status mo_post_source_window (mo_window *);
mo_status mo_post_search_window (mo_window *);
mo_status mo_post_subscribe_win (mo_window *);
#endif

1331
src/gui-documents.c Normal file

File diff suppressed because it is too large Load Diff

86
src/gui-documents.h Normal file
View File

@@ -0,0 +1,86 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUIDOCUMENTS_H__
#define __GUIDOCUMENTS_H__
mo_status mo_back_impossible (mo_window *win);
mo_status mo_forward_impossible (mo_window *win);
mo_status mo_set_win_current_node (mo_window *, mo_node *);
mo_status mo_reload_window_text (mo_window *, int);
mo_status mo_refresh_window_text (mo_window *);
mo_status mo_load_window_text (mo_window *, char *, char *);
mo_status mo_duplicate_window_text (mo_window *, mo_window *);
mo_status mo_access_document (mo_window *, char *);
mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
char *txthead, int register_visit,
char *ref, char *last_modified, char *expires);
mo_status mo_post_access_document (mo_window *win, char *url,
char *content_type, char *post_data);
#endif

421
src/gui-extras.c Normal file
View File

@@ -0,0 +1,421 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "gui-extras.h"
#include "mo-www.h"
#include "libhtmlw/HTML.h"
#include <Xm/Xm.h>
#include <Xm/ScrolledW.h>
#include <Xm/List.h>
#include <Xm/Label.h>
#include "libnut/system.h"
static XmxCallback (links_win_cb);
static void links_list_cb(Widget w, XtPointer client, XtPointer call);
static XmxCallback (links_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
int *posns, pcount;
char *text,*fnam,*url;
switch (XmxExtractToken ((int)client_data)){
case 0: /* GOTO */
if(XmListGetSelectedPos(win->links_list, &posns, &pcount)){
if(pcount && XmStringGetLtoR(win->links_items[posns[0]-1],
XmSTRING_DEFAULT_CHARSET,
&text)){
if(strncmp(text,"===",3))
mo_access_document(win,text);
XtFree(text);
}
XtFree((char *)posns);
}
mo_gui_done_with_icon();
return;
case 3:
if(XmListGetSelectedPos(win->links_list, &posns, &pcount)){
if(pcount && XmStringGetLtoR(win->links_items[posns[0]-1],
XmSTRING_DEFAULT_CHARSET,
&text)){
if(strncmp(text,"===",3)){
/* SAVE TO FILE */
url = mo_url_canonicalize (text,win->current_node->url);
if(mo_pull_er_over_virgin(url,fnam = mo_tmpnam(text)))
rename_binary_file(fnam);
free(url);
free(fnam);
}
XtFree(text);
}
XtFree((char *)posns);
}
mo_gui_done_with_icon();
return;
case 1: /* DISMISS */
XtUnmanageChild (win->links_win);
break;
case 2: /* HELP */
mo_open_another_window
(win,
mo_assemble_help_url ("help-on-links.html"),
NULL, NULL);
break;
}
return;
}
static void links_list_cb(Widget w, XtPointer client, XtPointer call)
{
mo_window *win = (mo_window *) client;
char *text;
XmListCallbackStruct *cs = (XmListCallbackStruct *) call;
if(XmStringGetLtoR(win->links_items[cs->item_position-1],
XmSTRING_DEFAULT_CHARSET,
&text)){
if(strncmp(text,"===",3))
mo_access_document(win,text);
XtFree(text);
}
/* Don't unmanage the list. */
return;
}
mo_status mo_post_links_window(mo_window *win)
{
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget links_form, list, scroller, label;
if (!win->links_win)
{
/* Create it for the first time. */
XmxSetUniqid (win->id);
Xmx_n = 0;
win->links_win = XmxMakeFormDialog
(win->base, "NCSA Mosaic: Document Links" );
dialog_frame = XmxMakeFrame (win->links_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
links_form = XmxMakeForm (dialog_frame);
dialog_sep = XmxMakeHorizontalSeparator (links_form);
buttons_form = XmxMakeFormAndFourButtons
(links_form, links_win_cb,
"Goto URL" , "Save" ,
"Dismiss" , "Help..." ,
0, 3, 1, 2);
label = XtVaCreateManagedWidget("Document Links & Images ..." ,
xmLabelWidgetClass,
links_form,
XmNwidth, 500,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNtopOffset, 2,
NULL);
scroller = XtVaCreateWidget("scroller",
xmScrolledWindowWidgetClass,
links_form,
XmNheight, 100,
/* form attachments */
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, label,
XmNbottomAttachment, XmATTACH_WIDGET,
XmNbottomWidget, dialog_sep,
/* offsets */
XmNtopOffset, 10,
XmNbottomOffset, 10,
XmNleftOffset, 8,
XmNrightOffset, 8,
NULL);
list = XtVaCreateManagedWidget("list", xmListWidgetClass,
scroller,
XmNvisibleItemCount, 10,
XmNresizable, False,
XmNscrollBarDisplayPolicy, XmSTATIC,
XmNlistSizePolicy, XmCONSTANT,
NULL);
XtAddCallback(list, XmNdefaultActionCallback, links_list_cb, (XtPointer) win);
win->links_list = list;
win->links_items = NULL;
win->links_count = 0;
XtManageChild(scroller);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep,
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
NULL, buttons_form, NULL, NULL);
XmxSetConstraints
(buttons_form,
XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
NULL, NULL, NULL, NULL);
}
XmxManageRemanage (win->links_win);
mo_update_links_window(win);
return mo_succeed;
}
mo_status mo_update_links_window(mo_window *win)
{
char **hrefs,**imgs;
int i,p,count,hcount,icount;
XmString *xmstr;
hrefs = HTMLGetHRefs(win->scrolled_win,&hcount);
imgs = HTMLGetImageSrcs(win->scrolled_win,&icount);
count = icount + hcount;
if(!count){
XtVaSetValues(win->links_list,
XmNitemCount, 0,
NULL);
} else {
if(hrefs) count++;
if(imgs) count++;
xmstr = (XmString *) XtMalloc(sizeof(XmString)*count);
p=0;
if(hrefs){
xmstr[p++] =
XmStringCreateLtoR("=== Links ===" ,XmSTRING_DEFAULT_CHARSET);
for(i=0;i<hcount;i++,p++){
xmstr[p] =
XmStringCreateLtoR(hrefs[i],XmSTRING_DEFAULT_CHARSET);
free(hrefs[i]);
}
free(hrefs);
}
if(imgs){
xmstr[p++] =
XmStringCreateLtoR("=== Images ===" ,XmSTRING_DEFAULT_CHARSET);
for(i=0;i<icount;i++,p++){
xmstr[p] =
XmStringCreateLtoR(imgs[i],XmSTRING_DEFAULT_CHARSET);
free(imgs[i]);
}
free(imgs);
}
XtVaSetValues(win->links_list,
XmNitems, xmstr,
XmNitemCount, count,
NULL);
}
if(win->links_count) {
XtFree((char *)(win->links_items));
}
win->links_count = count;
win->links_items = xmstr;
return mo_succeed;
}
struct {
char *name;
char *expand;
} abouts[] = {
{"about",
"<TITLE>Some magic words...</TITLE><p><dl><dt>Old Developers<dd>alanb, davet, ebina, marca<dt>HTTPd Developers<dd>blong, spowers<dt>Current Developers<dd>dpape, ms-lee, pbleisch, spowers, swetland, tpreilly"
"<dt>Technical Support<dd>jgerard, jhabbley, mitch, mringenb, nhall, pzurich, yingxian<dt>Weird Guy<dd>mag<dt>Products<dd>httpd, mosaic, xmosaic<dt>Help!<dd>cci, cgi, help<dt>Places and Organizations<dd>acm, ncsa, sdg, uiuc<dt>Just For Fun...<dd>babylon5, jargon, jive</dl></p>"},
/* old developers */
{"alanb","0http://www.uiuc.edu/ph/www/alanb/"},
{"davet","0http://www.spyglass.com/~dthompso/"},
{"ebina","0http://www.netscape.com/people/ebina/"},
{"marca","0http://www.netscape.com/people/marca/"},
/* httpd developers */
{"blong","0http://www.uiuc.edu/ph/www/blong"},
/* spowers */
/* current developers */
{"dpape","0http://tanelorn.ncsa.uiuc.edu/~dpape"},
{"ms-lee","0http://www.cen.uiuc.edu/~ms-lee/"},
{"pbleisch","0http://www.uiuc.edu/ph/www/pbleisch"},
{"spowers","0http://shire.ncsa.uiuc.edu/"},
{"swetland","0http://hagbard.ncsa.uiuc.edu/swetland/"},
{"tpreilly","0http://valinor.ncsa.uiuc.edu/~tpreilly/"},
/* tech support */
{"jhabbley","0http://hobbes.ncsa.uiuc.edu/jhabbley/"},
{"mitch","0http://hobbes.ncsa.uiuc.edu/"},
{"mringenb","0http://www.cen.uiuc.edu/~mringenb/"},
{"nhall","0http://hobbes.ncsa.uiuc.edu/nhall/"},
{"pzurich","0http://www.cen.uiuc.edu/~pz3900/"},
{"yingxian","<title>Not sure...</title><p>She's our new tech support manager...but we're not sure what her website is..."},
/* weird guy */
{"mag","0http://sdg.ncsa.uiuc.edu/~mag/"},
/* products */
{"httpd","0http://hoohoo.ncsa.uiuc.edu/"},
{"mosaic","0http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/"},
{"xmosaic",
"<TITLE>NCSA X Mosaic</TITLE><P>Please read our disclaimer below (can you say, 'Joke?') before proceeding to:</p><blockquote><a href=\"http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/\">http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/</a>.</blockquote><hr><h1>X-Mosaic Disclaimer (humor)</h1><p>Consult your physician before using this program. Batteries not included. May cause drowsiness. Must be over 17. Not available in all states. Not responsible for acts of God. Prices subject to change without notice. Proof of purchase required. Read label before using. Some assembly required. Not responsible for typographical errors. Some restrictions apply. Subject to local regulation. Warrantee period limited. Close cover before striking. No resemblance to any person, living or dead, is intended. Subject to availability. No COD's. Sales tax not included. Shipping and handling extra. For external use only. May cause excitability. Avoid alcoholic beverages while using this software. If"
"symptoms persist, consult your physician. Keep this and all software out of the reach of children. Parental guidance suggested. The buyer assumes all risks associated with using this product. In case of irritation, flush eyes with cold water and consult your physician. Not insured by the Federal Deposit Insurance Corporation. Use with adequate ventilation. Avoid repeated or prolonged contact with skin. Contents under pressure; Do not puncture or incinerate. Store in original containers. Harmful if swallowed. Do not fold, bend, staple or mutilate. PLEASE NOTE: Some quantum physics theories suggest that when the consumer is not directly observing this product, it may cease to exist or will exist only in a vague and undetermined state.</p>"},
/* help */
{"cci","0http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/CCI/cci-spec.html"},
{"cgi","0http://hoohoo.ncsa.uiuc.edu/cgi/overview.html"},
{"help","0http://www.ncsa.uiuc.edu/SDG/Software/mosaic-x/"},
/* places & organizations */
{"acm","0http://www.acm.uiuc.edu/"},
{"ncsa","0http://www.ncsa.uiuc.edu/"},
{"sdg","0http://sdg.ncsa.uiuc.edu/"},
{"uiuc","0http://www.uiuc.edu/"},
/* for fun */
{"babylon5",
"<TITLE>Babylon 5 Info</TITLE><H1>Herein lie the secrets of Babylon 5 in X Mosaic</h1><hr><p>First, (if you have the precompiled binary version of X Mosaic) we are all quite proud of our Easter Egg...go to a site with '/b5', 'bab5', or 'babylon5' in the URL...</p><hr><p>Now for the best two Babylon 5 Websites!<br><br><blockquote><a href=\"http://www.hyperion.com/lurk/lurker.html\">The Lurker's Guide to Babylon 5</a><br><a href=\"http://www.babylon5.com/Babylon5/\">The Official Babylon 5 Website</a>"},
{"jargon","0http://hagbard.ncsa.uiuc.edu/cgi-bin/jargon"},
{"jive","0http://shire.ncsa.uiuc.edu/filters/"},
{"mozilla",
"<TITLE>Are you lost?</TITLE><H1>Surely you jest?</H1>"},
{NULL,NULL}
};
/* assorted FUN things */
char *mo_special_urls(char *url)
{
int i;
if(!url) return NULL;
if(strncmp(url,"about:",6)) return NULL;
for(i=0;abouts[i].name;i++) {
if(!strncmp(&url[6],abouts[i].name,strlen(abouts[i].name))) {
if(abouts[i].expand[0]=='0')
return abouts[i].expand;
else
return strdup(abouts[i].expand);
}
}
return NULL;
}
void System(char *cmd, char *title) {
char buf[BUFSIZ], final[BUFSIZ*2];
int retValue,skip_output=0;
*final='\0';
if ((retValue=my_system(cmd,buf,BUFSIZ))!=SYS_SUCCESS) {
/*give them the error code message*/
switch(retValue) {
case SYS_NO_COMMAND:
sprintf(final,"%s%s",final,"There was no command to execute.\n" );
break;
case SYS_FORK_FAIL:
sprintf(final,"%s%s",final,"The fork call failed.\n" );
break;
case SYS_PROGRAM_FAILED:
sprintf(final,"%s%s",final,"The program specified was not able to exec.\n" );
break;
case SYS_NO_RETBUF:
sprintf(final,"%s%s",final,"There was no return buffer.\n" );
break;
case SYS_FCNTL_FAILED:
sprintf(final,"%s%s",final,"Fcntl failed to set non-block on the pipe.\n" );
break;
}
/*give them the output*/
if (*buf) {
sprintf(final,"%s%s",final,buf);
}
}
else if (*buf) {
/*give them the output*/
sprintf(final,"%s%s",final,buf);
application_error(final,title);
return;
}
return;
}

73
src/gui-extras.h Normal file
View File

@@ -0,0 +1,73 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUIEXTRAS_H__
#define __GUIEXTRAS_H__
extern mo_status mo_post_links_window(mo_window *);
extern mo_status mo_update_links_window(mo_window *);
char *mo_special_urls(char *url);
void System(char *cmd, char *title);
#endif

352
src/gui-ftp.c Normal file
View File

@@ -0,0 +1,352 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "gui-ftp.h"
#include "gui-popup.h"
#include "libhtmlw/HTML.h"
#include "libnut/system.h"
#define MAX_BUF_LEN 512 /* Length of all of the buffers used for dialog message output */
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite);
/* gui-ftp handles all of the gui bits of the FTP send, remove, and mkdir
functionality. All of the actual transfer stuff is in libwww2/HTFTP.c
*/
/*--------------------- mo_handle_ftpput ---------------------------------*/
mo_status mo_handle_ftpput(mo_window *win)
{
int length;
char site[MAX_BUF_LEN+1], *cptr;
char tbuf[MAX_BUF_LEN+1];
if (!win->current_node)
return mo_fail;
/* Check to see if the url is somethin' like ftp://somewarez.31337.com */
if((strlen(win->current_node->url)>4) && strncmp("ftp:", win->current_node->url, 4)==0) {
win->ftp_site = strdup(win->current_node->url);
mo_post_ftpput_window(win);
} else {
sprintf(tbuf, "FTP Send requires you to be on a page with an FTP url.");
application_user_info_wait(tbuf);
return mo_fail;
}
return mo_succeed;
}
/* ---------------------- mo_post_ftpput_window ----------------------- */
static XmxCallback (ftpput_win_cb)
{
char *fname = NULL, efname[MO_LINE_LENGTH];
char tbuf[MAX_BUF_LEN+1];
int i, count, ret;
Widget fsbList;
XmString st;
XmStringTable selected_items;
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
XtUnmanageChild (win->ftpput_win); /* Down with the box */
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
XtVaGetValues (fsbList,
XmNselectedItems, &selected_items,
XmNselectedItemCount, &count,
NULL);
if (count) {
for (i=0; i<count; i++) {
XmStringGetLtoR (selected_items[i], XmSTRING_DEFAULT_CHARSET, &fname);
pathEval (efname, fname);
XtFree (fname);
/* Make the url something HTFTPSend will understand */
sprintf (tbuf, "%s&%s", win->ftp_site, efname);
if ((ret = HTFTPSend (tbuf)) != 0) { /* !HT_LOADED */
if (ret != -2) { /* If the user interrupted us, forget about telling them */
sprintf(tbuf, "FTP Send Failed! The file %s could not be sent.", efname);
application_user_info_wait(tbuf);
}
break;
} else {
mo_reload_window_text (win,0);
}
}
} else {
/* Get the filename out of the filespec box in case they typed something in */
XtVaGetValues (win->ftpput_win,
XmNdirSpec, &st,
NULL);
XmStringGetLtoR (st, XmSTRING_DEFAULT_CHARSET, &fname);
pathEval (efname, fname);
XtFree (fname);
sprintf (tbuf, "%s&%s", win->ftp_site, efname);
if ((ret = HTFTPSend (tbuf)) != 0) { /* !HT_LOADED */
if (ret != -2) { /* If the user interrupted us, forget about telling them */
sprintf(tbuf, "FTP Send Failed! The file %s could not be sent.", efname);
application_user_info_wait(tbuf);
}
} else {
mo_reload_window_text (win,0);
}
}
/* Clear out the selections, we have to do this because the XmFSB has no clue
it is being used in extended selection mode. */
XmListDeselectAllItems(fsbList);
free(win->ftp_site);
win->ftp_site = NULL;
return;
}
mo_status mo_post_ftpput_window (mo_window *win)
{
char tbuf[MAX_BUF_LEN+1];
Widget fsbList;
if( win->ftp_site == NULL ) {
return mo_fail;
}
sprintf( tbuf, "NCSA Mosaic: Send file to %s", win->ftp_site);
XmxSetUniqid (win->id);
if (!win->ftpput_win)
{
win->ftpput_win = XmxMakeFileSBDialog(win->base, tbuf, "Name of local file to send:", ftpput_win_cb, 0);
/* Change the selection mode */
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
XtVaSetValues (fsbList,
XmNselectionPolicy, XmEXTENDED_SELECT,
NULL);
} else {
XmFileSelectionDoSearch (win->ftpput_win, NULL);
}
XmxManageRemanage (win->ftpput_win);
return mo_succeed;
}
/*--------------------- mo_handle_ftpmkdir ---------------------------------*/
mo_status mo_handle_ftpmkdir(mo_window *win)
{
char tbuf[MAX_BUF_LEN+1];
if (!win->current_node)
return mo_fail;
/* Check to see if the url is somethin' like ftp://somewarez.31337.com */
if((strlen(win->current_node->url)>4) && strncmp("ftp:", win->current_node->url, 4)==0) {
win->ftp_site = strdup(win->current_node->url);
mo_post_ftpmkdir_window(win);
} else {
sprintf(tbuf, "FTP MkDir requires you to be on a page with an FTP url.");
application_user_info_wait(tbuf);
return mo_fail;
}
return mo_succeed;
}
/*--------------------- mo_post_ftpmkdir_window ---------------------------------*/
static XmxCallback (ftpmkdir_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
char *dirpath, tbuf[MAX_BUF_LEN+1];
int ret;
switch (XmxExtractToken ((int)client_data)) {
case 0: /* Create dir */
XtUnmanageChild (win->ftpmkdir_win);
dirpath = XmxTextGetString (win->ftpmkdir_text);
if (!dirpath || !(*dirpath)) {
/* nothing here so do nothing */
return;
}
sprintf (tbuf, "%s&%s", win->ftp_site, dirpath);
if( (ret = HTFTPMkDir (tbuf)) != 0) {
if (ret != -2) { /* If the user interrupted us, forget about telling them */
sprintf(tbuf, "FTP MkDir Failed! The directory %s could not be created.", dirpath);
application_user_info_wait(tbuf);
}
} else {
mo_reload_window_text (win, 0);
}
free(win->ftp_site);
win->ftp_site = NULL;
break;
case 1: /* Dismiss */
XtUnmanageChild (win->ftpmkdir_win);
break;
case 2: /* Help */
/* mo_open_another_window (win, mo_assemble_help_url ("docview-menubar-file.html"), NULL, NULL); */
break;
case 3: /* Clear */
XmxTextSetString (win->ftpmkdir_text, "");
break;
}
return;
}
mo_status mo_post_ftpmkdir_window (mo_window *win)
{
if (!win->ftpmkdir_win)
{
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget form, label;
/* Create it for the first time. */
XmxSetUniqid (win->id);
win->ftpmkdir_win = XmxMakeFormDialog (win->base, "NCSA Mosaic: FTP MkDir");
dialog_frame = XmxMakeFrame (win->ftpmkdir_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
form = XmxMakeForm (dialog_frame);
label = XmxMakeLabel (form, "Directory to Create: ");
XmxSetArg (XmNwidth, 310);
win->ftpmkdir_text = XmxMakeTextField (form);
XmxAddCallbackToText (win->ftpmkdir_text, ftpmkdir_win_cb, 0);
dialog_sep = XmxMakeHorizontalSeparator (form);
buttons_form = XmxMakeFormAndFourButtons
(form, ftpmkdir_win_cb, "Create", "Clear", "Dismiss", "Help...",
0, 3, 1, 2);
/* Constraints for form. */
XmxSetOffsets (label, 14, 0, 10, 0);
XmxSetConstraints
(label, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_NONE,
NULL, NULL, NULL, NULL);
XmxSetOffsets (win->ftpmkdir_text, 10, 0, 5, 10);
XmxSetConstraints
(win->ftpmkdir_text, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_WIDGET,
XmATTACH_FORM, NULL, NULL, label, NULL);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
XmATTACH_FORM,
win->ftpmkdir_text, buttons_form, NULL, NULL);
XmxSetConstraints
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM,
NULL, NULL, NULL, NULL);
}
XmxManageRemanage (win->ftpmkdir_win);
return mo_succeed;
}
/* ---------------------- mo_handle_ftpremove ----------------------- */
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite)
{
int ret;
char tbuf[MAX_BUF_LEN+1];
if ((ret = HTFTPRemove (urlNsite)) != 0) {
if (ret != -2) { /* If the user interrupted us, forget about telling them */
sprintf(tbuf, "FTP Remove Failed! The file could not be removed.");
application_user_info_wait(tbuf);
}
} else {
mo_reload_window_text (win, 0);
}
}
/* Ftp callback for the right mouse button menu */
void ftp_rmbm_cb(Widget w, XtPointer client_data, XtPointer call_data)
{
struct act_struct *acst = (struct act_struct *) client_data;
int which;
char *xurl, tbuf[MAX_BUF_LEN+1];
extern mo_window *current_win;
struct ele_rec *eptr;
which = acst->act_code;
eptr = acst->eptr;
switch(which) {
case mo_ftp_put:
mo_handle_ftpput (current_win);
break;
case mo_ftp_mkdir:
mo_handle_ftpmkdir (current_win);
break;
case mo_ftp_remove:
xurl = strrchr (eptr->anchorHRef, '/');
sprintf (tbuf, "%s%s", current_win->current_node->url, xurl);
mo_handle_ftpremove (current_win, tbuf);
break;
}
}

78
src/gui-ftp.h Normal file
View File

@@ -0,0 +1,78 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUIFTP_H__
#define __GUIFTP_H__
mo_status mo_handle_ftpput(mo_window *win);
mo_status mo_handle_ftpmkdir(mo_window *win);
mo_status mo_post_ftpput_window(mo_window *);
mo_status mo_post_ftpremove_window(mo_window *);
mo_status mo_post_ftpmkdir_window(mo_window *);
mo_status mo_post_ftpbar_window(mo_window *);
#endif

1961
src/gui-menubar.c Normal file

File diff suppressed because it is too large Load Diff

76
src/gui-menubar.h Normal file
View File

@@ -0,0 +1,76 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUIMENUBAR_H__
#define __GUIMENUBAR_H__
mo_status mo_set_fancy_selections_toggle (mo_window *);
mo_status mo_set_fonts (mo_window *, int);
mo_status mo_set_underlines (mo_window *, int);
XmxMenuRecord *mo_make_document_view_menubar (Widget);
void mo_set_agents(mo_window *win, int which);
XmxCallback (menubar_cb);
mo_status mo_init_menubar(void);
#endif

779
src/gui-news.c Normal file
View File

@@ -0,0 +1,779 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "gui-news.h"
#include "libnut/system.h"
#include <Xm/LabelG.h>
#include <Xm/PushB.h>
#include <Xm/ScrolledW.h>
#include <Xm/List.h>
#include <Xm/ToggleB.h>
#include <Xm/Text.h>
#include <Xm/TextF.h>
#include <Xm/Protocols.h>
#include "libhtmlw/HTML.h"
#include <pwd.h>
#include "newsrc.h"
#include "libwww2/HTNews.h"
#define MAX_BUF 512
void gui_news_post_subgroupwin (mo_window *win)
{
Widget w, f, b, s;
XmString str;
}
void gui_news_updateprefs (mo_window *win)
{
if (newsShowAllGroups) {
XmxRSetToggleState (win->menubar, mo_news_grp0, XmxSet);
XmxRSetToggleState (win->menubar, mo_news_grp1, XmxNotSet);
XmxRSetToggleState (win->menubar, mo_news_grp2, XmxNotSet);
} else if (newsShowReadGroups) {
XmxRSetToggleState (win->menubar, mo_news_grp0, XmxNotSet);
XmxRSetToggleState (win->menubar, mo_news_grp1, XmxNotSet);
XmxRSetToggleState (win->menubar, mo_news_grp2, XmxSet);
} else {
XmxRSetToggleState (win->menubar, mo_news_grp0, XmxNotSet);
XmxRSetToggleState (win->menubar, mo_news_grp1, XmxSet);
XmxRSetToggleState (win->menubar, mo_news_grp2, XmxNotSet);
}
if (newsShowAllArticles) {
XmxRSetToggleState (win->menubar, mo_news_art0, XmxSet);
XmxRSetToggleState (win->menubar, mo_news_art1, XmxNotSet);
} else {
XmxRSetToggleState (win->menubar, mo_news_art0, XmxNotSet);
XmxRSetToggleState (win->menubar, mo_news_art1, XmxSet);
}
if (ConfigView) {
XmxRSetToggleState (win->menubar, mo_news_fmt0, XmxNotSet);
XmxRSetToggleState (win->menubar, mo_news_fmt1, XmxSet);
} else {
XmxRSetToggleState (win->menubar, mo_news_fmt0, XmxSet);
XmxRSetToggleState (win->menubar, mo_news_fmt1, XmxNotSet);
}
}
void gui_news_subgroup(mo_window *win)
{
char buf[MAX_BUF+1];
if (NewsGroup) {
subscribegroup (NewsGroup);
newsrc_flush ();
sprintf (buf, "%s successfully subscribed", NewsGroup);
HTProgress (buf);
}
}
void gui_news_unsubgroup(mo_window *win)
{
char buf[MAX_BUF+1];
if (NewsGroup) {
unsubscribegroup (NewsGroup);
newsrc_flush ();
sprintf (buf, "%s successfully unsubscribed", NewsGroup);
HTProgress (buf);
}
}
void gui_news_flush(mo_window *win)
{
HTProgress ("Flushing newsrc data");
newsrc_flush ();
HTProgress ("");
}
void gui_news_flushgroup(mo_window *win)
{
char buf[1024+1];
if (!NewsGroupS)
return;
sprintf (buf, "Flushing newsrc data for %s", NewsGroupS?NewsGroupS->name : "current group");
HTProgress (buf);
newsrc_flush ();
HTProgress ("");
}
void gui_news_list(mo_window *win)
{
mo_load_window_text(win,"news:*",NULL);
}
void gui_news_showAllGroups (mo_window *win)
{
gui_news_flush (win);
newsGotList = 0;
HTSetNewsConfig (-1, -1, 1, 1, -1, -1,-1,-1);
gui_news_updateprefs (win);
mo_load_window_text (win, "news:*", NULL);
}
void gui_news_showGroups (mo_window *win)
{
/* Show only subbed groups */
HTSetNewsConfig (-1,-1,0,0,-1,-1,-1,-1);
gui_news_updateprefs (win);
mo_load_window_text (win, "news:*", NULL);
}
void gui_news_showReadGroups (mo_window *win)
{
HTSetNewsConfig (-1,-1,0,1,-1,-1,-1,-1);
gui_news_updateprefs (win);
mo_load_window_text (win, "news:*", NULL);
}
void gui_news_showAllArticles (mo_window *win)
{
char buf[512+1];
HTSetNewsConfig (-1,1,-1,-1,-1,-1,-1,-1);
gui_news_updateprefs (win);
if (!NewsGroup && !NewsGroupS)
return;
if (NewsGroupS)
sprintf (buf, "news:%s", NewsGroupS->name);
else
sprintf (buf, "news:%s", NewsGroup);
mo_load_window_text (win, buf, NULL);
}
void gui_news_showArticles (mo_window *win)
{
char buf[512+1];
HTSetNewsConfig (-1,0,-1,-1,-1,-1,-1,-1);
gui_news_updateprefs (win);
if (!NewsGroup && !NewsGroupS)
return;
if (NewsGroup)
sprintf (buf, "news:%s", NewsGroup);
else
sprintf (buf, "news:%s", NewsGroupS->name);
mo_load_window_text (win, buf, NULL);
}
void gui_news_markGroupRead (mo_window *win)
{
char buf[512+1];
if (!NewsGroupS)
return;
markrangeread (NewsGroupS, NewsGroupS->minart, NewsGroupS->maxart);
sprintf (buf, "All articles in %s marked read", NewsGroupS->name);
HTProgress (buf);
/* Return to newsgroup list */
sprintf (buf, "news:*");
mo_load_window_text (win, buf, NULL);
}
void gui_news_markGroupUnread (mo_window *win)
{
char buf[512+1];
if (!NewsGroupS)
return;
markrangeunread (NewsGroupS, NewsGroupS->minart, NewsGroupS->maxart);
sprintf (buf, "All articles in %s marked unread", NewsGroupS->name);
HTProgress (buf);
/* Return to newsgroup list */
sprintf (buf, "news:*");
mo_load_window_text (win, buf, NULL);
}
void gui_news_markArticleUnread (mo_window *win)
{
char buf[512+1];
if (!NewsGroupS || !CurrentArt)
return;
markunread (NewsGroupS, CurrentArt->num);
sprintf (buf, "Article %s marked unread", CurrentArt->ID);
HTProgress (buf);
sprintf (buf, "news:%s", NewsGroup);
mo_load_window_text (win, buf, NULL);
}
void gui_news_initflush (mo_window *win)
{
newsrc_initflush ();
}
void gui_news_index(mo_window *win)
{
char url[128];
newsrc_flush ();
strcpy(url,win->current_node->url);
news_index(url);
if(url[0])
mo_load_window_text(win,url,NULL);
}
void gui_news_prev(mo_window *win)
{
char url[128];
strcpy(url,win->current_node->url);
news_prev(url);
if(url[0]) mo_load_window_text(win,url,NULL);
}
void gui_news_next(mo_window *win)
{
char url[128];
strcpy(url,win->current_node->url);
news_next(url);
if(url[0]) mo_load_window_text(win,url,NULL);
}
void gui_news_prevt(mo_window *win)
{
char url[128];
strcpy(url,win->current_node->url);
news_prevt(url);
if(url[0]) mo_load_window_text(win,url,NULL);
}
void gui_news_nextt(mo_window *win)
{
char url[128];
strcpy(url,win->current_node->url);
news_nextt(url);
if(url[0]) mo_load_window_text(win,url,NULL);
}
static XmxCallback (include_fsb_cb)
{
char *fname, efname[MO_LINE_LENGTH];
FILE *fp;
char line[MO_LINE_LENGTH], *status;
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
if (!win)
return;
XtUnmanageChild (win->news_fsb_win);
fname = (char *)malloc (128 * sizeof (char));
XmStringGetLtoR (((XmFileSelectionBoxCallbackStruct *)call_data)->value,
XmSTRING_DEFAULT_CHARSET,
&fname);
pathEval (efname, fname);
fp = fopen (efname, "r");
if (!fp)
{
char *buf, *final, tmpbuf[80];
int final_len;
buf=my_strerror(errno);
if (!buf || !*buf || !strcmp(buf,"Error 0")) {
sprintf(tmpbuf,"Unknown Error");
buf=tmpbuf;
}
final_len=30+((!efname || !*efname?3:strlen(efname))+13)+15+(strlen(buf)+13);
final=(char *)calloc(final_len,sizeof(char));
sprintf(final,"\nUnable to Open Include File:\n %s\n\nOpen Error:\n %s\n" ,(!efname || !*efname?" ":efname),buf);
XmxMakeErrorDialog (win->news_win,
final,
"News Include Error" );
XtManageChild (Xmx_w);
if (final) {
free(final);
final=NULL;
}
return;
}
while (1)
{
long pos;
status = fgets (line, MO_LINE_LENGTH, fp);
if (!status || !(*line))
goto done;
XmTextInsert (win->news_text,
pos = XmTextGetInsertionPosition (win->news_text),
line);
/* move insertion position to past this line to avoid inserting the
lines in reverse order */
XmTextSetInsertionPosition (win->news_text, pos + strlen(line));
}
done:
fclose(fp);
return;
}
static XmxCallback (include_button_cb) /* Why is this here ?*/
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
return;
}
/* ----------------------- mo_post_news_window -------------------------- */
int NNTPpost(char *from, char *subj, char *ref, char *groups, char *msg);
int NNTPgetarthdrs(char *art,char **ref, char **grp, char **subj, char **from);
char *NNTPgetquoteline(char *art);
static XmxCallback (news_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
char *msg,*subj,*group,*from,*line;
switch (XmxExtractToken ((int)client_data))
{
case 0: /* POST */
XtUnmanageChild (win->news_win);
msg = XmxTextGetString (win->news_text);
from = XmxTextGetString (win->news_text_from);
subj = XmxTextGetString (win->news_text_subj);
group = XmxTextGetString (win->news_text_group);
if (!msg)
return;
if (msg[0] == '\0')
return;
NNTPpost(from, subj, NULL, group, msg);
free(msg);
free(from);
free(group);
free(subj);
case 1: /* DISMISS */
XtUnmanageChild (win->news_win);
/* since we're going to re-use this in different configs
we'll destroy it */
XtDestroyWidget (win->news_win);
win->news_win = NULL;
win->news_fsb_win = NULL;
/* Do nothing. */
break;
case 2: /* HELP */
mo_open_another_window
(win,
mo_assemble_help_url ("help-on-news.html"),
NULL, NULL);
break;
case 3: /* INSERT FILE */
if (!win->news_fsb_win) {
win->news_fsb_win = XmxMakeFileSBDialog
(win->news_win,
"NCSA Mosaic: Include File for News" ,
"Name of file to include:" ,
include_fsb_cb, 0);
} else {
XmFileSelectionDoSearch (win->news_fsb_win, NULL);
}
XmxManageRemanage (win->news_fsb_win);
break;
case 4: /* QUOTE */
break;
}
return;
}
static XmxCallback (follow_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
char *msg,*subj,*group,*from,*line;
int pos;
switch (XmxExtractToken ((int)client_data))
{
case 0: /* POST */
XtUnmanageChild (win->news_win);
msg = XmxTextGetString (win->news_text);
from = XmxTextGetString (win->news_text_from);
subj = XmxTextGetString (win->news_text_subj);
group = XmxTextGetString (win->news_text_group);
if (!msg)
return;
if (msg[0] == '\0')
return;
NNTPpost(from, subj, win->newsfollow_ref, group, msg);
free(msg);
free(from);
free(group);
free(subj);
case 1: /* DISMISS */
if(win->newsfollow_ref) free(win->newsfollow_ref);
if(win->newsfollow_grp) free(win->newsfollow_grp);
if(win->newsfollow_subj) free(win->newsfollow_subj);
if(win->newsfollow_from) free(win->newsfollow_from);
if(win->newsfollow_artid) free(win->newsfollow_artid);
XtUnmanageChild (win->news_win);
/* since we're going to re-use this in different configs
we'll destroy it */
XtDestroyWidget (win->news_win);
win->news_win = NULL;
win->news_fsb_win = NULL;
/* Do nothing. */
break;
case 2: /* HELP */
mo_open_another_window
(win,
mo_assemble_help_url ("help-on-news.html"),
NULL, NULL);
break;
case 3: /* INSERT FILE */
if (!win->news_fsb_win) {
win->news_fsb_win = XmxMakeFileSBDialog
(win->news_win,
"NCSA Mosaic: Include File for News" ,
"Name of file to include:" ,
include_fsb_cb, 0);
} else {
XmFileSelectionDoSearch (win->news_fsb_win, NULL);
}
XmxManageRemanage (win->news_fsb_win);
break;
case 4: /* QUOTE */
line = malloc(strlen(win->newsfollow_from)+30);
sprintf(line,"%s writes:\n\n",win->newsfollow_from);
XmTextInsert(win->news_text,
pos = XmTextGetInsertionPosition (win->news_text),
line);
/* move insertion position to past this line to avoid
inserting the lines in reverse order */
XmTextSetInsertionPosition (win->news_text, pos+strlen(line));
if(line = NNTPgetquoteline(win->newsfollow_artid)){
do {
XmTextInsert(win->news_text,
pos = XmTextGetInsertionPosition (win->news_text),
line);
/* move insertion position to past this line to avoid
inserting the lines in reverse order */
XmTextSetInsertionPosition (win->news_text, pos+strlen(line));
} while (line = NNTPgetquoteline(NULL));
}
break;
}
return;
}
mo_status mo_post_news_win (mo_window *win)
{
return mo_post_generic_news_win(win,0);
}
mo_status mo_post_follow_win (mo_window *win)
{
char *s;
if(strncmp("news:",win->current_node->url,5))
return mo_fail; /* fix me */
NNTPgetarthdrs(&(win->current_node->url)[5],
&(win->newsfollow_ref),
&(win->newsfollow_grp),
&(win->newsfollow_subj),
&(win->newsfollow_from));
/* add a re: if needed*/
if(strncmp("Re: ",win->newsfollow_subj,4) &&
strncmp("re: ",win->newsfollow_subj,4)){
s = malloc(strlen(win->newsfollow_subj)+5); /* this sucks -bjs*/
sprintf(s,"Re: %s",win->newsfollow_subj);
free(win->newsfollow_subj);
win->newsfollow_subj = s;
}
/* add this article to ref */
win->newsfollow_artid = malloc(strlen(win->current_node->url));
strcpy(win->newsfollow_artid, &(win->current_node->url)[5]);
if(!win->newsfollow_ref){
win->newsfollow_ref = malloc(strlen(win->current_node->url));
sprintf(win->newsfollow_ref,"<%s>",&(win->current_node->url)[5]);
} else {
s = malloc(strlen(win->newsfollow_ref)+
strlen(win->current_node->url)); /* this sucks -bjs*/
sprintf(s,"%s <%s>",win->newsfollow_ref,&(win->current_node->url)[5]);
free(win->newsfollow_ref);
win->newsfollow_ref = s;
}
return mo_post_generic_news_win(win,1);
}
mo_status mo_post_generic_news_win(mo_window *win, int follow)
{
char namestr[1024], tmp[1024];
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget news_form, yap_label, f_label, s_label, g_label;
FILE *fp;
long pos;
sprintf (namestr, "%s <%s>",
get_pref_string(eDEFAULT_AUTHOR_NAME),
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
if (!win->news_win)
{
/* Create it for the first time. */
XmxSetUniqid (win->id);
Xmx_n = 0;
win->news_win = XmxMakeFormDialog
(win->base, "NCSA Mosaic: News" );
dialog_frame = XmxMakeFrame (win->news_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
news_form = XmxMakeForm (dialog_frame);
XmxSetArg(XmNalignment, XmALIGNMENT_END);
f_label = XmxMakeLabel (news_form, "From:" );
XmxSetArg(XmNalignment, XmALIGNMENT_END);
s_label = XmxMakeLabel (news_form, "Subject:" );
XmxSetArg(XmNalignment, XmALIGNMENT_END);
g_label = XmxMakeLabel (news_form, "Groups:" );
if(follow)
yap_label = XmxMakeLabel (news_form, "Follow-up to UseNet News Article" );
else
yap_label = XmxMakeLabel (news_form, "Post a UseNet News Article" );
XmxSetArg (XmNcolumns, 65);
win->news_text_subj = XmxMakeText (news_form);
XmxSetArg (XmNcolumns, 65);
win->news_text_group = XmxMakeText (news_form);
XmxSetArg (XmNcolumns, 65);
XmxSetArg (XmNeditable, False);
win->news_text_from = XmxMakeText (news_form);
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
XmxSetArg (XmNscrolledWindowMarginHeight, 10);
XmxSetArg (XmNcursorPositionVisible, True);
XmxSetArg (XmNeditable, True);
XmxSetArg (XmNeditMode, XmMULTI_LINE_EDIT);
XmxSetArg (XmNrows, 30);
XmxSetArg (XmNcolumns, 80);
XmxSetArg (XmNwordWrap, True);
XmxSetArg (XmNscrollHorizontal, False);
win->news_text = XmxMakeScrolledText (news_form);
dialog_sep = XmxMakeHorizontalSeparator (news_form);
if(follow)
buttons_form = XmxMakeFormAndFiveButtons
(news_form, follow_win_cb,
"Post" , "Quote" , "Include File..." , "Dismiss" , "Help..." ,
0, 4, 3, 1, 2);
else
buttons_form = XmxMakeFormAndFourButtons
(news_form, news_win_cb,
"Post" , "Include File..." , "Dismiss" , "Help..." ,
0, 3, 1, 2);
/* Constraints for news_form. */
XmxSetOffsets (yap_label, 10, 20, 0, 0);
XmxSetConstraints
(yap_label,
XmATTACH_FORM, XmATTACH_NONE ,XmATTACH_FORM, XmATTACH_FORM,
NULL, NULL, NULL, NULL);
XmxSetOffsets (win->news_text_from, 10, 10, 10, 10);
XmxSetConstraints
(win->news_text_from,
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
yap_label, NULL, f_label, NULL);
XmxSetOffsets (f_label, 14, 10, 10, 10);
XmxSetConstraints
(f_label,
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_NONE, XmATTACH_NONE,
yap_label, NULL, NULL, NULL);
XmxSetOffsets (win->news_text_subj, 10, 10, 10, 10);
XmxSetConstraints
(win->news_text_subj,
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
win->news_text_from, NULL, s_label, NULL);
XmxSetOffsets (s_label, 14, 10, 10, 10);
XmxSetConstraints
(s_label,
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_NONE, XmATTACH_NONE,
win->news_text_from, NULL, NULL, NULL);
XmxSetOffsets (win->news_text_group, 10, 10, 10, 10);
XmxSetConstraints
(win->news_text_group,
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
win->news_text_subj, NULL, g_label, NULL);
XmxSetOffsets (g_label, 14, 10, 10, 10);
XmxSetConstraints
(g_label,
XmATTACH_WIDGET ,XmATTACH_NONE, XmATTACH_NONE, XmATTACH_NONE,
win->news_text_subj, NULL, NULL, NULL);
XmxSetOffsets (XtParent (win->news_text), 10, 0, 3, 3);
XmxSetConstraints
(XtParent (win->news_text),
XmATTACH_WIDGET, XmATTACH_WIDGET,XmATTACH_FORM, XmATTACH_FORM,
win->news_text_group, dialog_sep, NULL, NULL);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep,
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
NULL, buttons_form, NULL, NULL);
XmxSetConstraints
(buttons_form,
XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
NULL, NULL, NULL, NULL);
XmxTextSetString (win->news_text, "");
/* tack signature on the end if it exists - code from Martin Hamilton */
if (get_pref_string(eSIGNATURE)) {
XmxTextSetString (win->news_text, "\n\n");
/* leave a gap... */
XmTextSetInsertionPosition (win->news_text, 2);
if ((fp = fopen(get_pref_string(eSIGNATURE), "r")) != NULL) {
while(fgets(tmp, sizeof(tmp) - 1, fp)) {
XmTextInsert(win->news_text,
pos = XmTextGetInsertionPosition (win->news_text),
tmp);
XmTextSetInsertionPosition (win->news_text, pos + strlen(tmp));
}
fclose(fp);
} else {
XmxTextSetString (win->news_text, "");
}
}
XmTextSetInsertionPosition (win->news_text, 0);
if(follow){
XmxTextSetString (win->news_text_group, win->newsfollow_grp);
XmxTextSetString (win->news_text_subj, win->newsfollow_subj);
} else {
XmxTextSetString (win->news_text_group, "");
XmxTextSetString (win->news_text_subj, "");
}
XmxTextSetString (win->news_text_from, namestr);
}
XmxManageRemanage (win->news_win);
return mo_succeed;
}

96
src/gui-news.h Normal file
View File

@@ -0,0 +1,96 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUINEWS_H__
#define __GUINEWS_H__
mo_status mo_post_news_win (mo_window *);
mo_status mo_post_follow_win (mo_window *);
mo_status mo_post_generic_news_win (mo_window *, int follow);
void gui_news_post_subgroupwin (mo_window *win);
void gui_news_updateprefs (mo_window *win);
void gui_news_subgroup(mo_window *win);
void gui_news_unsubgroup(mo_window *win);
void gui_news_flush(mo_window *win);
void gui_news_flushgroup(mo_window *win);
void gui_news_list(mo_window *win);
void gui_news_showAllGroups (mo_window *win);
void gui_news_showGroups (mo_window *win);
void gui_news_showReadGroups (mo_window *win);
void gui_news_showAllArticles (mo_window *win);
void gui_news_showArticles (mo_window *win);
void gui_news_markGroupRead (mo_window *win);
void gui_news_markGroupUnread (mo_window *win);
void gui_news_markArticleUnread (mo_window *win);
void gui_news_initflush (mo_window *win);
void gui_news_index(mo_window *win);
void gui_news_prev(mo_window *win);
void gui_news_next(mo_window *win);
void gui_news_prevt(mo_window *win);
void gui_news_nextt(mo_window *win);
#endif

1229
src/gui-popup.c Normal file

File diff suppressed because it is too large Load Diff

437
src/gui-popup.h Normal file
View File

@@ -0,0 +1,437 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#ifndef __POPUP_H__
#define __POPUP_H__
#include "mosaic.h"
#include "libhtmlw/HTML.h"
#include "hotlist.h"
#include <Xm/DrawingA.h>
#include <Xm/ScrollBar.h>
#include <Xm/PushBG.h>
#include <Xm/SeparatoG.h>
#include <Xm/CascadeBG.h>
#include <Xm/ToggleBG.h>
#include <Xm/RowColumn.h>
#include <Xm/FileSB.h>
#include <X11/Xatom.h>
#define MAX_NUM_POPUP_ITEMS 50
#define ALL_TYPES (E_TEXT | E_BULLET | E_LINEFEED | E_IMAGE | E_WIDGET | E_HRULE | E_TABLE | E_ANCHOR)
#define TIGHT 0
#define LOOSE 1
#define COPY_URL_LABEL "Copy Link URL"
#define NEWS_NOANCHOR (E_TEXT | E_BULLET | E_LINEFEED | E_WIDGET | E_HRULE |E_TABLE)
typedef enum _w_class { LastItem=1, PushButton, Separator, CascadeButton,
ToggleButton, Widgt } w_class;
enum { I_Save, I_ViewExternal, I_ViewInternal, I_Reload,
M_ImageData, M_LinkData, M_FileData };
typedef struct act_struct
{
int act_code;
struct ele_rec *eptr;
void *str;
} act_struct;
typedef struct PopupItem
{
/* the top half must be filled in if this is to appear in the popup */
w_class class; /* this is a button, separator, label, cascade */
unsigned long int types; /* for which widget elements this button is to
popup for (the list of elements is below) */
int types_method; /* if TIGHT use == if LOOSE use & */
unsigned long int modes; /* news, http, ftp, etc. */
int modes_method; /* if TIGHT use == if LOOSE use & */
char *label;
/* these are needed for a button class */
struct act_struct acst; /* identifies the action */
void (*cbfp)(); /* callback function that takes act_struct
as client data */
/* theses are optional */
char mnemonic;
char *accel_text;
char *accel;
/* this is needed for a cascade class */
struct PopupItem *sub_items; /* NULL if this isn't a
pull_right */
/* this is for internal uses */
Widget _w;
int startup; /* are we sensitive when we start */
} PopupItem;
XmxCallbackPrototype (menubar_cb);
XmxCallbackPrototype (image_cb);
XmxCallbackPrototype (metadata_cb);
XmxCallbackPrototype (user_defs_cb);
XmxCallbackPrototype (ftp_rmbm_cb);
XmxCallbackPrototype (fsb_OKCallback);
XmxCallbackPrototype (fsb_CancelCallback);
XmxCallbackPrototype (copy_link_cb);
XmxCallbackPrototype (session_cb);
XmxCallbackPrototype (rbm_ballonify);
void fsb();
void ThirdButtonMenu();
char *getFileName(char *file_src);
Widget _PopupMenuBuilder(Widget parent, int type, char *title,
char mnem, PopupItem *items);
extern struct ele_rec *LocateElement();
void _set_eptr_field();
void mo_popup_set_something();
PopupItem *popup_build_user_defs();
PopupItem *build_user_defs_items();
char **user_defs_get_entries();
extern mo_window *current_win;
extern int file_exists();
extern char *my_chop();
extern char *my_strndup();
extern char *mo_escape_part();
void mo_make_popup();
void mo_init_hotmenu();
void mo_add_to_rbm_history(mo_window *win, char *url, char *title);
static Boolean convert_selection(Widget, Atom *, Atom *, Atom *, XtPointer *,
unsigned long *, int *);
#ifdef GUI_POPUP_H /* this is set in gui-popup.c -- it prevents multiple
instances of the following variables */
Boolean have_popup;
Widget popup = NULL;
PopupItem image_menu[] = {
{PushButton, 0, 0, 0, 0, "Save", {I_Save, NULL, NULL}, image_cb, 0, NULL,
NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Reload", {I_Reload, NULL, NULL}, image_cb, 0,
NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "View External", {I_ViewExternal, NULL, NULL},
image_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "View Internal", {I_ViewInternal, NULL, NULL},
image_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Get Image Metadata", {M_ImageData, NULL, NULL},
metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
/*
{LastItem, 0, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}
*/
{ LastItem },
};
PopupItem pan_menu[] = {
{PushButton, 0, 0, 0, 0, "Right", {0, NULL, NULL}, NULL, 0,
NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Up", {0, NULL, NULL}, NULL,
0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Left", {0, NULL, NULL}, NULL, 0,
NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Down", {0, NULL, NULL}, NULL,
0, NULL, NULL, NULL, NULL, 1},
/*
{LastItem, 0, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}
*/
{ LastItem },
};
PopupItem photo_cd_sub_menu[] = {
{PushButton, 0, 0, 0, 0,"Zoom In", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0,"Zoom Out", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Zoom Crop", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Crop", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{Separator, 0, 0, 0, 0, "Sep", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0,0, 0, "Enlarge", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Reduce", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{Separator, 0, 0, 0, 0, "Sep", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0,0, 0, "Undo", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{Separator, 0, 0, 0, 0, "Sep", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Rotate Clockwise", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL,
NULL, 1},
{PushButton, 0, 0, 0, 0, "Rotate Counter-Clockwise", {0, NULL, NULL}, NULL,
0, NULL, NULL, NULL, NULL, 1},
{CascadeButton, 0, 0,0, 0, "Pan", {0, NULL, NULL}, NULL, 0, NULL, NULL, pan_menu, NULL, 1},
{Separator, 0, 0,0, 0, "Sep", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Full Image", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0,0, 0,"Reset To Original", {0, NULL, NULL}, NULL, 0, NULL, NULL,
NULL, NULL, 1},
{Separator, 0, 0,0, 0, "Separator", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL},
{PushButton, 0, 0,0, 0,"Print This Image", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL,
NULL, 1},
{ToggleButton, 0, 0,0, 0, "Display PhotoCD Icon", {0, NULL, NULL}, NULL, 0, NULL, NULL,
NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Options", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
/*
{LastItem, 0, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}
*/
{ LastItem },
};
PopupItem file_menu[] = {
{PushButton, 0, 0, 0, 0, "Save Page", {mo_save_document, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Print", {mo_print_document, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Mail To", {mo_mail_document, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, 0, 0, 0, 0, "Get File Metadata", {M_FileData, NULL, NULL},
metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
{ LastItem },
};
PopupItem popup_items[] = {
/*---------------------------------------------------------------
Permanent stuff
---------------------------------------------------------------*/
{PushButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE,"Back",
{mo_back, NULL, NULL},
menubar_cb, 0, "B", NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Forward",
{mo_forward, NULL, NULL},
menubar_cb, 0, "F", NULL, NULL, NULL, 1},
/* negative one means this is a hotlist */
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Hotlist",
{-1, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "User",
{0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Session History",
{-2, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
/*---------------------------------------------------------------
Stuff if on a html page and not on a image or anchor
---------------------------------------------------------------*/
{Separator, (E_TEXT | E_BULLET | E_LINEFEED | E_WIDGET | E_HRULE |E_TABLE),
LOOSE, moMODE_ALL, LOOSE, "Separator", {0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{CascadeButton, (E_TEXT | E_BULLET | E_LINEFEED | E_WIDGET | E_HRULE |
E_TABLE),LOOSE, moMODE_ALL, LOOSE, "File",
{0, NULL, NULL}, NULL, 0, NULL, NULL, file_menu, NULL, 1},
/*---------------------------------------------------------------
Stuff if on any page and an anchor (including image anchor)
---------------------------------------------------------------*/
{Separator, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, "Separator",
{0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, COPY_URL_LABEL,
{0, NULL, NULL}, copy_link_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, "Get Link Metadata",
{M_LinkData, NULL, NULL}, metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
/*---------------------------------------------------------------
Stuff if on any page and a image (not including image link)
---------------------------------------------------------------*/
{Separator, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Separator",
{0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Save",
{I_Save, NULL, NULL}, image_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Reload",
{I_Reload, NULL, NULL},
image_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "View External",
{I_ViewExternal, NULL, NULL}, image_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "View Internal",
{I_ViewInternal, NULL, NULL}, image_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Get Image Metadata",
{M_ImageData, NULL, NULL}, metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
/*---------------------------------------------------------------
Stuff if on any page and a image link
---------------------------------------------------------------*/
{Separator, E_IMAGE | E_ANCHOR, TIGHT, moMODE_PLAIN, LOOSE, "Separator",
{0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{CascadeButton, E_IMAGE | E_ANCHOR, TIGHT, moMODE_PLAIN, LOOSE, "Image",
{0, NULL, NULL},
NULL, 0, NULL, NULL, image_menu, NULL, 1},
/*---------------------------------------------------------------
Stuff if on a ftp page
---------------------------------------------------------------*/
{Separator, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Separator",
{0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Put ...",
{mo_ftp_put, NULL, NULL},
ftp_rmbm_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Make Directory",
{mo_ftp_mkdir, NULL, NULL}, ftp_rmbm_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_ANCHOR, TIGHT, moMODE_FTP, TIGHT, "Remove",
{mo_ftp_remove, NULL, NULL}, ftp_rmbm_cb, 0, NULL, NULL, NULL, NULL, 1},
/*---------------------------------------------------------------
Stuff if on a news page and not a link
---------------------------------------------------------------*/
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Separator",
{0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Next Article",
{mo_news_next, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Previous Article",
{mo_news_prev, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Next Thread",
{mo_news_nextt, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Previous Thread",
{mo_news_prevt, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Article Index",
{mo_news_index, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Group Index",
{mo_news_groups, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, NULL,
{0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Post",
{mo_news_post, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Followup",
{mo_news_follow, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, NULL,
{0, NULL, NULL},
NULL, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Subscribe",
{mo_news_sub, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Unsubscribe",
{mo_news_unsub, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Subscribe",
{mo_news_sub_anchor, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Unsubscribe",
{mo_news_unsub_anchor, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Mark Group Read",
{mo_news_mread, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Mark Group Read",
{mo_news_mread_anchor, NULL, NULL},
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
/* {Separator, 0, 0, "Separator", 0, NULL, 0,
NULL, NULL, NULL, NULL},
{CascadeButton, 0, 0, "Kodak Photo CD", 0, NULL, 0,
NULL, NULL, photo_cd_sub_menu, NULL}, */
{ LastItem },
};
#endif
#endif

4952
src/gui.c Normal file

File diff suppressed because it is too large Load Diff

122
src/gui.h Normal file
View File

@@ -0,0 +1,122 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __GUI_H__
#define __GUI_H__
void mo_process_external_directive (char *directive, char *url);
mo_window *mo_next_window (mo_window *);
mo_window *mo_fetch_window_by_id (int);
mo_status mo_add_window_to_list (mo_window *);
char *mo_assemble_help_url (char *);
mo_status mo_busy (void);
mo_status mo_not_busy (void);
mo_status mo_redisplay_window (mo_window *);
mo_status mo_set_current_cached_win (mo_window *);
mo_status mo_set_dtm_menubar_functions (mo_window *);
mo_status mo_delete_window (mo_window *);
mo_window *mo_open_window (Widget, char *, mo_window *);
mo_window *mo_duplicate_window (mo_window *);
mo_window *mo_open_another_window (mo_window *, char *, char *, char *);
mo_status mo_open_initial_window (void);
void mo_gui_notify_progress (char *);
int mo_gui_check_icon (int);
void mo_gui_clear_icon (void);
void mo_gui_done_with_icon (void);
void kill_splash();
void MoCCINewConnection();
void mo_gui_update_meter(int level,char *text);
int animateCursor();
void createBusyCursors(Widget bob);
void stopBusyAnimation();
char *MakeFilename();
long GetCardCount(char *fname);
int anchor_visited_predicate (Widget, char *);
char *HTDescribeURL (char *);
mo_status mo_post_access_document (mo_window *win, char *url,
char *content_type,
char *post_data);
XmxCallbackPrototype (menubar_cb);
void mo_make_popup();
void mo_gui_check_security_icon_in_win(int type, mo_window *win);
void mo_gui_check_security_icon(int type);
void mo_assemble_controls(mo_window *win, int detach);
#ifdef HAVE_DTM
mo_status mo_register_dtm_blip (void);
#endif
void mo_do_gui (int, char **);
#endif /* not __GUI_H__ */

1905
src/hdf-browse.c Normal file

File diff suppressed because it is too large Load Diff

66
src/hdf-browse.h Normal file
View File

@@ -0,0 +1,66 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */

821
src/history.c Normal file
View File

@@ -0,0 +1,821 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "mo-www.h"
#include "gui-popup.h"
#include <time.h>
#include <sys/types.h>
#include "libhtmlw/HTML.h"
#define __SRC__
#include "../libwww2/HTAAUtil.h"
/*for memcpy*/
#include <memory.h>
extern Display *dsp;
void mo_add_to_rbm_history();
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
/* ------------------------------------------------------------------------ */
/* ----------------------------- HISTORY LIST ----------------------------- */
/* ------------------------------------------------------------------------ */
/* ---------------------------- kill functions ---------------------------- */
/* Free the data contained in an mo_node. Currently we only free
the text itself. */
mo_status mo_free_node_data (mo_node *node)
{
if (node->texthead != NULL)
{
free (node->texthead);
node->texthead = NULL;
}
if (node->title != NULL)
{
free (node->title);
node->title = NULL;
}
#if 0
/* Leads to memory getting freed twice in some cases, apparently.
Not sure why. */
if (node->url != NULL)
free (node->url);
if (node->ref != NULL)
{
free (node->ref);
node->ref = NULL;
}
#endif
if (node->cached_stuff)
{
HTMLFreeWidgetInfo (node->cached_stuff);
node->cached_stuff = NULL;
}
return mo_succeed;
}
/* Kill a single mo_node associated with a given mo_window; it
the history list exists we delete it from that. In any case
we call mo_free_node_data and return. */
mo_status mo_kill_node (mo_window *win, mo_node *node)
{
if (win->history_list)
XmListDeletePos (win->history_list, node->position);
mo_free_node_data (node);
return mo_succeed;
}
/* Iterate through all descendents of an mo_node, but not the given
mo_node itself, and kill them. This is equivalent to calling
mo_kill_node on each of those nodes, except this is faster since
all the Motif list entries can be killed at once. */
mo_status mo_kill_node_descendents (mo_window *win, mo_node *node)
{
mo_node *foo;
int count = 0;
if (node == NULL)
return mo_succeed;
for (foo = node->next; foo != NULL; foo = foo->next)
{
mo_free_node_data (foo);
count++;
}
/* Free count number of items from the end of the list... */
if (win->history_list && count)
{
XmListDeleteItemsPos (win->history_list, count, node->position + 1);
}
return mo_succeed;
}
/* ------------------------ mo_add_node_to_history ------------------------ */
/* Called from mo_record_visit to insert an mo_node into the history
list of an mo_window. */
mo_status mo_add_node_to_history (mo_window *win, mo_node *node)
{
/* If there is no current node, this is our first time through. */
if (win->history == NULL)
{
win->history = node;
node->previous = NULL;
node->next = NULL;
node->position = 1;
win->current_node = node;
}
else
{
/* Node becomes end of history list. */
/* Point back at current node. */
node->previous = win->current_node;
/* Point forward to nothing. */
node->next = NULL;
node->position = node->previous->position + 1;
/* Kill descendents of current node, since we'll never
be able to go forward to them again. */
mo_kill_node_descendents (win, win->current_node);
/* Current node points forward to this. */
win->current_node->next = node;
/* Current node now becomes new node. */
win->current_node = node;
}
if (win->history_list)
{
XmString xmstr =
XmxMakeXmstrFromString(
get_pref_boolean(eDISPLAY_URLS_NOT_TITLES) ?
node->url : node->title);
XmListAddItemUnselected
(win->history_list, xmstr, node->position);
XmStringFree (xmstr);
}
return mo_succeed;
}
/* ---------------------------- mo_grok_title ----------------------------- */
/* Make up an appropriate title for a document that does not otherwise
have one associated with it. */
static char *mo_grok_alternate_title (char *url, char *ref)
{
char *title, *foo1, *foo2;
if (!strncmp (url, "gopher:", 7))
{
/* It's a gopher server. */
/* Do we have a ref? */
if (ref)
{
char *tmp = ref;
while (*tmp && (*tmp == ' ' || *tmp == '\t'))
tmp++;
title = strdup (tmp);
goto done;
}
else
{
/* Nope, no ref. Make up a title. */
foo1 = url + 9;
foo2 = strstr (foo1, ":");
/* If there's a trailing colon (always should be.. ??)... */
if (foo2)
{
char *server = (char *) malloc ((foo2 - foo1 + 2));
/* bcopy (foo1, server, (foo2 - foo1));*/
memcpy(server, foo1, (foo2 - foo1));
server[(foo2 - foo1)] = '\0';
title = (char *) malloc ((strlen (server) + 32) * sizeof (char));
sprintf (title, "%s %s", "Gopher server at" , server);
/* OK, we got a title... */
free (server);
goto done;
}
else
{
/* Aw hell... */
title = strdup ("Gopher server" );
goto done;
}
}
}
/* If we got here, assume we should use 'ref' if possible
for the WAIS title. */
if (!strncmp (url, "wais:", 5) ||
!strncmp (url, "http://info.cern.ch:8001/", 25) ||
!strncmp (url, "http://info.cern.ch.:8001/", 26) ||
!strncmp (url, "http://www.ncsa.uiuc.edu:8001/", 30))
{
/* It's a WAIS server. */
/* Do we have a ref? */
if (ref)
{
title = strdup (ref);
goto done;
}
else
{
/* Nope, no ref. Make up a title. */
foo1 = url + 7;
foo2 = strstr (foo1, ":");
/* If there's a trailing colon (always should be.. ??)... */
if (foo2)
{
char *server = (char *) malloc ((foo2 - foo1 + 2));
/* bcopy (foo1, server, (foo2 - foo1));*/
memcpy(server, foo1, (foo2 - foo1));
server[(foo2 - foo1)] = '\0';
title = (char *) malloc ((strlen (server) + 32) * sizeof (char));
sprintf (title, "%s %s", "WAIS server at" , server);
/* OK, we got a title... */
free (server);
goto done;
}
else
{
/* Aw hell... */
title = strdup ("WAIS server" );
goto done;
}
}
}
if (!strncmp (url, "news:", 5))
{
/* It's a news source. */
if (strstr (url, "@"))
{
/* It's a news article. */
foo1 = url + 5;
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
sprintf (title, "%s %s", "USENET article" , foo1);
goto done;
}
else
{
/* It's a newsgroup. */
foo1 = url + 5;
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
sprintf (title, "%s %s", "USENET newsgroup" , foo1);
goto done;
}
}
if (!strncmp (url, "file:", 5))
{
/* It's a file. */
if (strncmp (url, "file:///", 8) == 0)
{
/* It's a local file. */
foo1 = url + 7;
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
sprintf (title, "%s %s", "Local file" , foo1);
goto done;
}
else if (strncmp (url, "file://localhost/", 17) == 0)
{
/* It's a local file. */
foo1 = url + 16;
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
sprintf (title, "%s %s", "Local file" , foo1);
goto done;
}
else
{
/* It's a remote file. */
foo1 = url + 7;
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
sprintf (title, "%s %s", "Remote file" , foo1);
goto done;
}
}
if (!strncmp (url, "ftp:", 4))
{
{
/* It's a remote file. */
foo1 = url + 6;
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
sprintf (title, "%s %s", "Remote file" , foo1);
goto done;
}
}
/* Punt... */
title = (char *) malloc ((strlen (url) + 24) * sizeof (char));
sprintf (title, "%s %s", "Untitled" , url);
done:
return title;
}
/* Figure out a title for the given URL. 'ref', if it exists,
was the text used for the anchor that pointed us to this URL;
it is not required to exist. */
char *mo_grok_title (mo_window *win, char *url, char *ref)
{
char *title = NULL, *t;
XtVaGetValues (win->scrolled_win, WbNtitleText, &title, NULL);
if (!title)
t = mo_grok_alternate_title (url, ref);
else if (!strcmp (title, "Document"))
t = mo_grok_alternate_title (url, ref);
else
{
char *tmp = title;
while (*tmp && (*tmp == ' ' || *tmp == '\t'))
tmp++;
if (*tmp)
t = strdup (tmp);
else
t = mo_grok_alternate_title (url, ref);
}
mo_convert_newlines_to_spaces (t);
return t;
}
/* --------------------------- mo_record_visit ---------------------------- */
extern int securityType;
/* Called when we visit a new node (as opposed to backing up or
going forward). Create an mo_node entry, call mo_grok_title
to figure out what the title is, and call mo_node_to_history
to add the new mo_node to both the window's data structures and
to its Motif history list. */
mo_status mo_record_visit (mo_window *win, char *url, char *newtext,
char *newtexthead, char *ref,
char *last_modified, char *expires)
{
mo_node *node = (mo_node *)malloc (sizeof (mo_node));
node->url = url;
node->text = newtext;
node->texthead = newtexthead;
node->ref = ref;
/* Figure out what the title is... */
node->title = mo_grok_title (win, url, ref);
node->authType=securityType;
securityType=HTAA_NONE;
mo_gui_check_security_icon_in_win(node->authType,win);
/* This will be recalc'd when we leave this node. */
node->docid = 1;
node->cached_stuff = NULL;
/* This may or may not be filled in later! (AF) */
node->last_modified = 0;
if (last_modified)
node->last_modified = strdup(last_modified);
node->expires = 0;
if (expires)
node->expires = strdup(expires);
mo_add_node_to_history (win, node);
mo_add_to_rbm_history(win, node->url, node->title);
return mo_succeed;
}
/* ------------------------- navigation functions ------------------------- */
/* Back up a node. */
mo_status mo_back_node (mo_window *win)
{
/* If there is no previous node, choke. */
if (!win->current_node || win->current_node->previous == NULL)
return mo_fail;
mo_gui_apply_default_icon();
mo_set_win_current_node (win, win->current_node->previous);
return mo_succeed;
}
/* Go forward a node. */
mo_status mo_forward_node (mo_window *win)
{
/* If there is no next node, choke. */
if (!win->current_node || win->current_node->next == NULL)
return mo_fail;
mo_gui_apply_default_icon();
mo_set_win_current_node (win, win->current_node->next);
return mo_succeed;
}
/* Visit an arbitrary position. This is called when a history
list entry is double-clicked upon.
Iterate through the window history; find the mo_node associated
with the given position. Call mo_set_win_current_node. */
mo_status mo_visit_position (mo_window *win, int pos)
{
mo_node *node;
for (node = win->history; node != NULL; node = node->next)
{
if (node->position == pos)
{
mo_set_win_current_node (win, node);
goto done;
}
}
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf (stderr, "UH OH BOSS, asked for position %d, ain't got it.\n",
pos);
}
#endif
done:
return mo_succeed;
}
/* ---------------------------- misc functions ---------------------------- */
mo_status mo_dump_history (mo_window *win)
{
mo_node *node;
#ifndef DISABLE_TRACE
if (srcTrace) {
fprintf (stderr, "----------------- history -------------- \n");
fprintf (stderr, "HISTORY is 0x%08x\n", win->history);
for (node = win->history; node != NULL; node = node->next)
{
fprintf (stderr, "NODE %d %s\n", node->position, node->url);
fprintf (stderr, " TITLE %s\n", node->title);
}
fprintf (stderr, "CURRENT NODE %d %s\n", win->current_node->position,
win->current_node->url);
fprintf (stderr, "----------------- history -------------- \n");
}
#endif
return mo_succeed;
}
/* ------------------------------------------------------------------------ */
/* ----------------------------- HISTORY GUI ------------------------------ */
/* ------------------------------------------------------------------------ */
/* We've just init'd a new history list widget; look at the window's
history and load 'er up. */
static void mo_load_history_list (mo_window *win, Widget list)
{
mo_node *node;
for (node = win->history; node != NULL; node = node->next)
{
XmString xmstr =
XmxMakeXmstrFromString (get_pref_boolean(eDISPLAY_URLS_NOT_TITLES) ?
node->url : node->title);
XmListAddItemUnselected
(list, xmstr, 0);
XmStringFree (xmstr);
}
XmListSetBottomPos (list, 0);
if (win->current_node)
XmListSelectPos (win->history_list, win->current_node->position, False);
return;
}
/* ----------------------------- mail history ----------------------------- */
static XmxCallback (mailhist_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
char *to, *subj;
FILE *fp;
switch (XmxExtractToken ((int)client_data))
{
case 0:
XtUnmanageChild (win->mailhist_win);
mo_busy ();
to = XmxTextGetString (win->mailhist_to_text);
if (!to)
return;
if (to[0] == '\0')
return;
subj = XmxTextGetString (win->mailhist_subj_text);
/* Open a file descriptor to sendmail. */
fp = mo_start_sending_mail_message (to, subj, "text/x-html", NULL);
if (!fp)
goto oops;
{
mo_node *node;
fprintf (fp, "<HTML>\n");
fprintf (fp, "<H1>History Path From %s</H1>\n",
get_pref_string(eDEFAULT_AUTHOR_NAME));
fprintf (fp, "<DL>\n");
for (node = win->history; node != NULL; node = node->next)
{
fprintf (fp, "<DT>%s\n<DD><A HREF=\"%s\">%s</A>\n",
node->title, node->url, node->url);
}
fprintf (fp, "</DL>\n");
fprintf (fp, "</HTML>\n");
}
mo_finish_sending_mail_message ();
oops:
free (to);
free (subj);
mo_not_busy ();
break;
case 1:
XtUnmanageChild (win->mailhist_win);
/* Do nothing. */
break;
case 2:
mo_open_another_window
(win,
mo_assemble_help_url ("help-on-nested-hotlists.html"),
NULL, NULL);
break;
}
return;
}
static mo_status mo_post_mailhist_win (mo_window *win)
{
/* This shouldn't happen. */
if (!win->history_win)
return mo_fail;
if (!win->mailhist_win)
{
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget mailhist_form, to_label, subj_label;
/* Create it for the first time. */
XmxSetUniqid (win->id);
win->mailhist_win = XmxMakeFormDialog
(win->history_win, "NCSA Mosaic: Mail Window History" );
dialog_frame = XmxMakeFrame (win->mailhist_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
mailhist_form = XmxMakeForm (dialog_frame);
to_label = XmxMakeLabel (mailhist_form, "Mail To:" );
XmxSetArg (XmNwidth, 335);
win->mailhist_to_text = XmxMakeTextField (mailhist_form);
subj_label = XmxMakeLabel (mailhist_form, "Subject:" );
win->mailhist_subj_text = XmxMakeTextField (mailhist_form);
dialog_sep = XmxMakeHorizontalSeparator (mailhist_form);
buttons_form = XmxMakeFormAndThreeButtons
(mailhist_form, mailhist_win_cb, "Mail" ,
"Dismiss" , "Help..." , 0, 1, 2);
/* Constraints for mailhist_form. */
XmxSetOffsets (to_label, 14, 0, 10, 0);
XmxSetConstraints
(to_label, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_NONE,
NULL, NULL, NULL, NULL);
XmxSetOffsets (win->mailhist_to_text, 10, 0, 5, 10);
XmxSetConstraints
(win->mailhist_to_text, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_WIDGET,
XmATTACH_FORM, NULL, NULL, to_label, NULL);
XmxSetOffsets (subj_label, 14, 0, 10, 0);
XmxSetConstraints
(subj_label, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
XmATTACH_NONE,
win->mailhist_to_text, NULL, NULL, NULL);
XmxSetOffsets (win->mailhist_subj_text, 10, 0, 5, 10);
XmxSetConstraints
(win->mailhist_subj_text, XmATTACH_WIDGET, XmATTACH_NONE,
XmATTACH_WIDGET,
XmATTACH_FORM, win->mailhist_to_text, NULL, subj_label, NULL);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
XmATTACH_FORM,
win->mailhist_subj_text, buttons_form, NULL, NULL);
XmxSetConstraints
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM,
NULL, NULL, NULL, NULL);
}
XtManageChild (win->mailhist_win);
return mo_succeed;
}
/* ---------------------------- history_win_cb ---------------------------- */
static XmxCallback (history_win_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
switch (XmxExtractToken ((int)client_data))
{
case 0:
XtUnmanageChild (win->history_win);
/* Dismissed -- do nothing. */
break;
case 1:
mo_post_mailhist_win (win);
break;
case 2:
mo_open_another_window
(win,
mo_assemble_help_url ("docview-menubar-navigate.html#history"),
NULL, NULL);
break;
}
return;
}
static XmxCallback (history_list_cb)
{
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
XmListCallbackStruct *cs = (XmListCallbackStruct *)call_data;
mo_visit_position (win, cs->item_position);
return;
}
mo_status mo_post_history_win (mo_window *win)
{
if (!win->history_win)
{
Widget dialog_frame;
Widget dialog_sep, buttons_form;
Widget history_label;
Widget history_form;
XtTranslations listTable;
static char listTranslations[] =
"~Shift ~Ctrl ~Meta ~Alt <Btn2Down>: ListKbdSelectAll() ListBeginSelect() \n\
~Shift ~Ctrl ~Meta ~Alt <Btn2Up>: ListEndSelect() ListKbdActivate()";
listTable = XtParseTranslationTable(listTranslations);
/* Create it for the first time. */
XmxSetUniqid (win->id);
win->history_win = XmxMakeFormDialog
(win->base, "NCSA Mosaic: Window History" );
dialog_frame = XmxMakeFrame (win->history_win, XmxShadowOut);
/* Constraints for base. */
XmxSetConstraints
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
/* Main form. */
history_form = XmxMakeForm (dialog_frame);
XmxSetArg (XmNalignment, XmALIGNMENT_BEGINNING);
history_label = XmxMakeLabel (history_form, "Where you've been:" );
/* History list itself. */
XmxSetArg (XmNresizable, False);
XmxSetArg (XmNscrollBarDisplayPolicy, XmSTATIC);
XmxSetArg (XmNlistSizePolicy, XmCONSTANT);
XmxSetArg (XmNwidth, 380);
XmxSetArg (XmNheight, 184);
win->history_list = XmxMakeScrolledList
(history_form, history_list_cb, 0);
XtAugmentTranslations (win->history_list, listTable);
dialog_sep = XmxMakeHorizontalSeparator (history_form);
buttons_form = XmxMakeFormAndThreeButtons(history_form,
history_win_cb,
"Mail To...",
"Dismiss",
"Help...",
1,
0,
2);
/* Constraints for history_form. */
XmxSetOffsets (history_label, 8, 0, 10, 10);
XmxSetConstraints
(history_label, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM,
XmATTACH_NONE, NULL, NULL, NULL, NULL);
/* History list is stretchable. */
XmxSetOffsets (XtParent (win->history_list), 0, 10, 10, 10);
XmxSetConstraints
(XtParent (win->history_list),
XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
history_label, dialog_sep, NULL, NULL);
XmxSetArg (XmNtopOffset, 10);
XmxSetConstraints
(dialog_sep,
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
NULL, buttons_form, NULL, NULL);
XmxSetConstraints
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
XmATTACH_FORM,
NULL, NULL, NULL, NULL);
/* Go get the history up to this point set up... */
mo_load_history_list (win, win->history_list);
}
XmxManageRemanage (win->history_win);
return mo_succeed;
}

83
src/history.h Normal file
View File

@@ -0,0 +1,83 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __HISTORY_H__
#define __HISTORY_H__
mo_status mo_free_node_data (mo_node *);
mo_status mo_kill_node (mo_window *, mo_node *);
mo_status mo_kill_node_descendents (mo_window *, mo_node *);
mo_status mo_add_node_to_history (mo_window *, mo_node *);
char *mo_grok_title (mo_window *, char *, char *);
mo_status mo_record_visit (mo_window *, char *, char *,
char *, char *, char *, char *);
mo_status mo_back_node (mo_window *);
mo_status mo_forward_node (mo_window *);
mo_status mo_visit_position (mo_window *, int);
mo_status mo_dump_history (mo_window *);
mo_status mo_post_history_win (mo_window *);
#endif

455
src/hotfile.c Normal file
View File

@@ -0,0 +1,455 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "hotlist.h"
#include "mo-www.h"
#include "libhtmlw/HTML.h"
/* The new file format provides support for nested hotlists of interesting
documents within the browser.
It uses a subset of HTML.
Here is a simplified BNF for this format:
<hotlist-file> ::= <start-html-tag><hotlist-document><end-html-tag>|
<hotlist-document>
<hotlist-document> ::= <head><body>|<body>
<head> ::= <start-head-tag><title element><end-head-tag>|<title element>
<body> ::= <start-body-tag><list><end-body-tag>|<list>
<list> ::= <structured-list>|<flat-list>
<structured-list> ::= <title-part><ul-list>|<ul-list>
<title-part> ::= <title-of-list>|<header-element>
<header-element> ::= <start-header-tag><title-of-list><end-header-tag>
<ul-list> ::= <start-ul-tag><list-of-items><end-ul-tag>|
<start-ul-tag><end-ul-tag>
<list-of-items> ::= <list-item> | <list-item><list-of-items>
<list-item> ::= <li-tag><item>
<item> ::= <structured-list>|<url-item>
<url-item> ::= <start-anchor-tag><title><end-anchor-tag>
<start-anchor-tag> ::= '<'<anchor-name><space><anchor-attrs>'>'
<anchor-attrs> ::= <href-attr>|<title-attr><space><href-attr>|
<href-attr><space><title-attr>
<href-attr> ::= <href-keyword>'='<url-val>
<url-val> ::= <double-quote><url><double-quote>|
<single-quote><url><single-quote>
<title-attr> ::= <title-keyword>'='<title-val>
<title-val> ::= <double-quote><title><double-quote>|
<single-quote><title><single-quote>
<flat-list> ::= <url-item>|<url-item><flat-list>
*/
extern char *ParseMarkTag();
extern struct mark_up *HTMLParse();
static int notSpacesOrNewLine(char *s);
static char * mo_extract_anchors(mo_hotlist *list, struct mark_up *mptr);
static void mo_parse_hotlist_list(mo_hotlist *list, struct mark_up **current);
static void fputExpanded(char *s, FILE *fp);
static void mo_write_list_r(mo_hotlist *list, FILE *fp);
static int notSpacesOrNewLine(char *s)
{
int retc = 0;
for (;*s && !retc; s++)
if (!isspace(*s)) retc = 1;
return retc;
}
/*
* extract a hotlist from any HTML document
*/
static char * mo_extract_anchors(mo_hotlist *list, struct mark_up *mptr)
{
mo_hotnode *node;
char *name = NULL;
char *last_text = NULL;
char *url = NULL, *title = NULL, *rbm=NULL;
for (; mptr != NULL; mptr = mptr->next)
switch (mptr->type)
{
case M_TITLE: /* title tag */
if (mptr->is_end && last_text)
/* if this is the end tag, take the last text as name */
name = mo_convert_newlines_to_spaces (strdup(last_text));
break;
case M_NONE: /* text, not tag */
if (notSpacesOrNewLine(mptr->text))
last_text = mptr->text;
break;
case M_ANCHOR:
if (!mptr->is_end)
{ /* start anchor tag */
last_text = NULL;
url = ParseMarkTag(mptr->start, MT_ANCHOR, AT_HREF);
title = ParseMarkTag(mptr->start, MT_ANCHOR, "title");
rbm = ParseMarkTag(mptr->start, MT_ANCHOR, "RBM"); /* SWP */
}
else
{ /* end anchor tag */
node = (mo_hotnode *)malloc (sizeof (mo_hotnode));
node->type = mo_t_url;
node->url = url;
/* if there is a title attribute in the anchor, take it,
otherwise take the last text */
node->title = title ? title :
(last_text ? strdup(last_text) : strdup("Unnamed"));
if (rbm!=NULL) {
node->rbm=1; /* SWP */
free(rbm);
}
else {
node->rbm=0;
}
mo_convert_newlines_to_spaces (node->title);
mo_append_item_to_hotlist (list, (mo_hot_item *)node);
rbm = url = title = last_text = NULL;
}
default:
break;
}
return name;
}
/*
* parse a structured hotlist file recursively
*/
static void mo_parse_hotlist_list(mo_hotlist *list, struct mark_up **current)
{
mo_hotlist *hotlist;
mo_hotnode *node;
char *last_text = NULL;
char *url = NULL, *title = NULL, *rbm=NULL;
struct mark_up *mptr;
int done = 0;
for (mptr = *current; mptr != NULL && !done; mptr && (mptr = mptr->next))
switch (mptr->type)
{
case M_NONE: /* text, not tag */
if (notSpacesOrNewLine(mptr->text))
last_text = mptr->text;
break;
case M_ANCHOR:
if (!mptr->is_end)
{ /* start anchor tag */
last_text = NULL;
url = ParseMarkTag(mptr->start, MT_ANCHOR, AT_HREF);
title = ParseMarkTag(mptr->start, MT_ANCHOR, "title");
rbm = ParseMarkTag(mptr->start, MT_ANCHOR, "RBM"); /* SWP */
}
else
{ /* end anchor tag */
node = (mo_hotnode *)malloc (sizeof (mo_hotnode));
node->type = mo_t_url;
node->url = url;
/* if there is a title attribute in the anchor, take it,
otherwise take the last text */
node->title = title ? title :
(last_text ? strdup(last_text) : strdup("Unnamed"));
if (node->title &&
node->title[strlen(node->title)-1] == '\n')
node->title[strlen(node->title)-1] = '\0';
if (rbm!=NULL) {
node->rbm=1; /* SWP */
free(rbm);
}
else {
node->rbm=0;
}
mo_convert_newlines_to_spaces (node->title);
mo_append_item_to_hotlist (list, (mo_hot_item *)node);
rbm = url = title = last_text = NULL;
}
break;
case M_UNUM_LIST:
if (!mptr->is_end)
{ /* start Unum List tag */
hotlist = (mo_hotlist *)malloc(sizeof(mo_hotlist));
hotlist->type = mo_t_list;
hotlist->nodelist = hotlist->nodelist_last = 0;
hotlist->parent = list;
hotlist->name = last_text ? strdup(last_text) : strdup("Unnamed");
if (hotlist->name &&
hotlist->name[strlen(hotlist->name)-1] == '\n')
hotlist->name[strlen(hotlist->name)-1] = '\0';
mo_convert_newlines_to_spaces (hotlist->name);
rbm=ParseMarkTag(mptr->start, MT_UNUM_LIST, "RBM");
if (rbm!=NULL) {
hotlist->rbm=1; /* SWP */
free(rbm);
}
else {
hotlist->rbm=0;
}
rbm=NULL;
mo_append_item_to_hotlist(list, (mo_hot_item *)hotlist);
mptr = mptr->next;
last_text = NULL;
mo_parse_hotlist_list(hotlist, &mptr);
/* after this call, mptr is positionned on the end Unum List tag */
}
else /* end Unum List tag */
*current = mptr, done = 1;
default:
break;
}
if (!done)
*current = NULL;
}
/* Read a hotlist from a file.
* fill the hotlist list given as parameter
*/
char * mo_read_new_hotlist(mo_hotlist *list, FILE *fp)
{
/* char *status;*/
char *name, *ptr;
int done, normal, has_list, depth;
long size;
struct mark_up *hot_mark_up, *mptr;
char *text;
setbuf(fp, NULL);
fseek(fp, 0L, SEEK_END);
size = ftell(fp);
text = malloc(size+1);
if (!text)
return NULL;
fseek(fp, 0L, SEEK_SET);
fread(text, (size_t)1, (size_t)size, fp);
text[size] = '\0';
/* parse the HTML document */
hot_mark_up = HTMLParse(NULL, text, NULL);
free(text);
/* some pre-processing to see if this is in hotlist format or if
this is a normal document
The algo is as follow: if an anchor is outside a list or if there
are more than one top level list, then it is not in hotlist format.
the 'normal' flag at the end of the pre-processing tells if it
is a normal document or a hotlist.
*/
done = 0;
normal = 0;
has_list = 0;
depth = 0;
for (mptr = hot_mark_up; mptr != NULL && !done; mptr = mptr->next)
{
switch (mptr->type)
{
case M_ANCHOR:
if (!depth)
done = 1, normal = 1;
break;
case M_UNUM_LIST:
if (!mptr->is_end) /* start unum list tag */
if (!depth && has_list)
done = 1, normal = 1;
else
depth++, has_list = 1;
else /* end unum list tag */
depth--;
default:
break;
}
if (done)
break;
}
/* now we know what kind of file we are dealing with */
if (normal) {
name = mo_extract_anchors(list, hot_mark_up);
}
else {
char *last_text = NULL;
done = 0;
for (mptr = hot_mark_up; mptr != NULL && !done; mptr = mptr->next)
switch (mptr->type)
{
case M_NONE: /* text, not tag */
if (notSpacesOrNewLine(mptr->text))
last_text = mptr->text;
break;
case M_UNUM_LIST: /* Unum List tag */
done = 1;
default:
break;
}
/* after this loop, mptr is positionned just after the
start anchor tag */
name = last_text ? mo_convert_newlines_to_spaces (strdup(last_text)) :
NULL;
mo_parse_hotlist_list(list, &mptr);
}
FreeObjList(hot_mark_up);
/*
* SWP
*
* Problem with hotlist name growing by 1 space with each write. So...
* we chop off all the spaces on the end here.
* We do it this way to get rid of all the people out there who already
* have hotlist names that are space infested.
*/
for (ptr=(name+strlen(name)-1); ptr && *ptr==' '; ptr--) {
*ptr='\0';
}
return name;
}
/*
* This function replace '>', '<' and '&' by their entity references
* and output them.
*/
static void fputExpanded(char *s, FILE *fp)
{
for (;*s;s++)
if (*s == '<')
fputs("&lt;", fp);
else if (*s == '>')
fputs("&gt;", fp);
else if (*s == '&')
fputs("&amp;", fp);
else
putc(*s, fp);
}
/*
* recursive function called to write a hotlist out to a file
*/
static void mo_write_list_r(mo_hotlist *list, FILE *fp)
{
mo_hot_item *item;
fputExpanded(list->name, fp);
if (list->rbm) {
fputs("\n<UL RBM>\n", fp);
}
else {
fputs("\n<UL>\n", fp);
}
for (item = list->nodelist; item != NULL; item = item->any.next)
if (item->type == mo_t_url) /* URL item */
{
if (!(item->hot.url)) {
continue;
}
if (item->hot.rbm) {
fputs("<LI> <A RBM HREF=\"", fp);
}
else {
fputs("<LI> <A HREF=\"", fp);
}
fputExpanded(item->hot.url, fp);
fputs("\"> ", fp);
if (!(item->hot.title)) {
fputs("No Title\n",fp);
}
else {
fputExpanded(item->hot.title, fp);
}
fputs("</A>\n", fp);
}
else /* list item */
{
fputs("<LI> ", fp);
mo_write_list_r(&(item->list), fp);
}
fputs("</UL>\n", fp);
}
/*
* Write a hotlist out to a file.
* Return mo_succeed if everything goes OK;
* mo_fail else.
*/
mo_status mo_write_hotlist (mo_hotlist *list, FILE *fp)
{
/* mo_hotnode *node;*/
fputs("<HTML>\n", fp);
fprintf(fp, "%s\n", NCSA_HOTLIST_FORMAT_COOKIE_THREE);
fputs("<TITLE>Hotlist from ", fp);
if (!get_pref_string(eDEFAULT_AUTHOR_NAME)) {
fputExpanded("Unknown", fp);
}
else {
fputExpanded(get_pref_string(eDEFAULT_AUTHOR_NAME), fp);
}
fputs("</TITLE>\n", fp);
mo_write_list_r(list, fp);
fputs("</HTML>\n", fp);
return mo_succeed;
}

74
src/hotfile.h Normal file
View File

@@ -0,0 +1,74 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __HOTFILE_H__
#define __HOTFILE_H__
char * mo_read_new_hotlist(mo_hotlist *list, FILE *fp);
mo_status mo_write_hotlist (mo_hotlist *list, FILE *fp);
#endif

2133
src/hotlist.c Normal file

File diff suppressed because it is too large Load Diff

176
src/hotlist.h Normal file
View File

@@ -0,0 +1,176 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*#include "mosaic.h"*/
#ifndef __HOTLIST_H__
#define __HOTLIST_H__
#include <pwd.h>
#define NCSA_HOTLIST_FORMAT_COOKIE_ONE \
"ncsa-xmosaic-hotlist-format-1"
#define NCSA_HOTLIST_FORMAT_COOKIE_TWO \
"<!-- ncsa-xmosaic-hotlist-format-2 -->"
#define NCSA_HOTLIST_FORMAT_COOKIE_THREE \
"<!-- ncsa-xmosaic-hotlist-format-3 -->"
/* ------------------------------ mo_item_type ---------------------------- */
typedef enum _mo_item_type
{
mo_t_url, mo_t_list
} mo_item_type;
/* ------------------------------ mo_any_item ----------------------------- */
/* mo_any_item is any item in a mo_hotlist. */
typedef struct mo_any_item
{
mo_item_type type;
char *name; /* title for an URL, name for a hotlist */
/* Position in the list; starting at 1... */
int position;
union mo_hot_item *previous;
union mo_hot_item *next;
} mo_any_item;
/* ------------------------------ mo_hotnode ------------------------------ */
/* mo_hotnode is a single item in a mo_hotlist. */
typedef struct mo_hotnode
{
mo_item_type type;
char *title; /* title for an URL */
/* Position in the list; starting at 1... */
int position;
union mo_hot_item *previous;
union mo_hot_item *next;
char *url;
char *lastdate;
int rbm; /* is it on the rbm? */
} mo_hotnode;
/* ------------------------------ mo_hotlist ------------------------------ */
/* mo_hotlist is a list of URL's and (cached) titles that can be
added to and deleted from freely, and stored and maintained across
sessions. */
typedef struct mo_hotlist
{
mo_item_type type;
char *name; /* name for a hotlist */
/* Position in the list; starting at 1... */
int position;
union mo_hot_item *previous;
union mo_hot_item *next;
/* specific to mo_hotlist */
struct mo_hotlist *parent;
union mo_hot_item *nodelist;
/* Point to last element in nodelist for fast appends. */
union mo_hot_item *nodelist_last;
int rbm; /* Is this list on the RBM? */
} mo_hotlist;
/* ------------------------------ mo_root_hotlist ------------------------- */
/* mo_root_hotlist is the root hotlist */
typedef struct mo_root_hotlist
{
mo_item_type type;
char *name; /* name for a hotlist */
/* Position in the list; starting at 1... */
int position;
union mo_hot_item *previous;
union mo_hot_item *next;
/* specific to mo_hotlist */
struct mo_hotlist *parent;
union mo_hot_item *nodelist;
/* Point to last element in nodelist for fast appends. */
union mo_hot_item *nodelist_last;
/* Filename for storing this hotlist to local disk; example is
$HOME/.mosaic-hotlist-default. */
char *filename;
/* Flag set to indicate whether this hotlist has to be written
back out to disk at some point. */
int modified;
} mo_root_hotlist;
/* ------------------------------ mo_hot_item ----------------------------- */
/* mo_hot_item is the union of all item type */
typedef union mo_hot_item
{
mo_item_type type;
mo_any_item any;
mo_hotnode hot;
mo_hotlist list;
mo_root_hotlist root;
} mo_hot_item;
void mo_append_item_to_hotlist (mo_hotlist *list, mo_hot_item *node);
#if 0
mo_status mo_dump_hotlist (mo_hotlist *);
#endif /* 0 */
mo_status mo_setup_default_hotlist (void);
mo_status mo_write_default_hotlist (void);
mo_status mo_post_hotlist_win (mo_window *);
mo_status mo_add_node_to_current_hotlist (mo_window *);
#endif

948
src/img.c Normal file
View File

@@ -0,0 +1,948 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "mosaic.h"
#include "gui.h"
#include "img.h"
#include "mo-www.h"
#include "globalhist.h"
#include "picread.h"
#include "libhtmlw/HTML.h"
#include "cci.h"
extern int cci_event;
#ifndef DISABLE_TRACE
extern int srcTrace;
#endif
#include "bitmaps/gopher_image.xbm"
#include "bitmaps/gopher_movie.xbm"
#include "bitmaps/gopher_menu.xbm"
#include "bitmaps/gopher_text.xbm"
#include "bitmaps/gopher_sound.xbm"
#include "bitmaps/gopher_index.xbm"
#include "bitmaps/gopher_telnet.xbm"
#include "bitmaps/gopher_binary.xbm"
#include "bitmaps/gopher_unknown.xbm"
ImageInfo *scaleImage(ImageInfo *img_data,char *width,char *height);
static ImageInfo *gopher_image = NULL;
static ImageInfo *gopher_movie = NULL;
static ImageInfo *gopher_menu = NULL;
static ImageInfo *gopher_text = NULL;
static ImageInfo *gopher_sound = NULL;
static ImageInfo *gopher_index = NULL;
static ImageInfo *gopher_telnet = NULL;
static ImageInfo *gopher_binary = NULL;
static ImageInfo *gopher_unknown = NULL;
/* for selective image loading */
#define blank_width 8
#define blank_height 8
static unsigned char blank_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
static ImageInfo *blank = NULL;
extern char **imagekill_sites;
/*******************************/
/* Defined in gui.c */
extern char *cached_url;
extern mo_window *current_win;
/* Defined in gui-documents.c */
extern int interrupted;
extern int loading_inlined_images;
extern int installed_colormap;
extern Colormap installed_cmap;
/*
(dsp, DefaultRootWindow (dsp), \
*/
#if defined(__STDC__) || defined(__sgi)
#define MAKE_IMGINFO_FROM_BITMAP(name) \
if (!name) \
{ \
name = (ImageInfo *)malloc (sizeof (ImageInfo)); \
name->ismap = 0; \
name->width = name##_width; \
name->height = name##_height; \
name->image_data = NULL; \
/* Bandaid for bug in Eric's code. */ \
name->internal = 1; \
name->transparent = 0; \
name->image = \
XCreatePixmapFromBitmapData \
(XtDisplay(swin), XtWindow(view), \
name##_bits, \
name##_width, name##_height, \
fg_pixel, bg_pixel, DefaultDepth(dsp, DefaultScreen(dsp))); \
} \
if (!name->image) \
{ \
name->image = \
XCreatePixmapFromBitmapData \
(XtDisplay(swin), XtWindow(view), \
name##_bits, \
name##_width, name##_height, \
fg_pixel, bg_pixel, DefaultDepth(dsp, DefaultScreen(dsp))); \
}
#else
#define MAKE_IMGINFO_FROM_BITMAP(name) \
if (!name) \
{ \
name = (ImageInfo *)malloc (sizeof (ImageInfo)); \
name->ismap = 0; \
name->width = name/**/_width; \
name->height = name/**/_height; \
name->image_data = NULL; \
/* Bandaid for bug in Eric's code. */ \
name->internal = 1; \
name->transparent = 0; \
name->image = \
XCreatePixmapFromBitmapData \
(XtDisplay(swin), XtWindow(view), \
name/**/_bits, \
name/**/_width, name/**/_height, \
fg_pixel, bg_pixel, DefaultDepth(dsp, DefaultScreen(dsp))); \
} \
if (!name->image) \
{ \
name->image = \
XCreatePixmapFromBitmapData \
(XtDisplay(swin), XtWindow(view), \
name/**/_bits, \
name/**/_width, name/**/_height, \
fg_pixel, bg_pixel, DefaultDepth(dsp, DefaultScreen(dsp))); \
}
#endif /* __STDC__ */
#define RETURN_IMGINFO_FROM_BITMAP(x) \
{ \
MAKE_IMGINFO_FROM_BITMAP(x); \
if (cci_event) MoCCISendEventOutput(IMAGE_LOADED); \
return x; \
}
/* ------------------------------------------------------------------------ */
ImageInfo *scaleImage(ImageInfo *img_data,char *width,char *height) {
/*
int widthInt,heightInt;
if (!width) {
widthInt=img_data->width;
}
else {
if (strchr(width,'%')) {
widthInt=(atoi(width)/100)*img_data->width;
}
else {
widthInt=atoi(width);
}
}
if (!height) {
heightInt=img_data->height;
}
else {
heightInt=atoi(height);
}
for (i=0; i<256; i++) {
convertRed[i]=(byte)img_data->reds[i];
convertGreen[i]=(byte)img_data->greens[i];
convertBlue[i]=(byte)img_data->blues[i];
}
img_data->image_data=SmoothResize(img_data->image_data,0,
img_data->width,img_data->height,
widthInt,heightInt,
convertRed,convertGreen,convertBlue,
newRed,newGreen,newBlue,256);
*/
return NULL;
}
/* ------------------------------------------------------------------------ */
unsigned char nums[]={
1,
2,
4,
8,
16,
32,
64,
128
};
/* Cache Load Hack: (BJS)
char *ir_hack_string, *diskfile, *url;
sprintf(ir_hack_string,"%s\0%s",diskfile,url);
ImageResolve(NULL,ir_hack_string,0,NULL,NULL);
*/
/* Width and Height Hack: (SWP)
Added "width" and "height" to the parameter list. These are used to
resize the image when we are done decoding. This'll be fun when we
start processing on a line-by-line basis.
If NULLs are passed, the width and height are not used.
*/
/* Image resolution function. */
/*static*/
ImageInfo *ImageResolve (Widget w, char *src, int noload, char *wid, char *hei)
{
extern Widget view; /*hw->html.view*/
Widget swin = current_win->scrolled_win;
int i, cnt;
unsigned char *data;
unsigned char *bg_map;
unsigned char *bgptr;
unsigned char *cptr;
unsigned char *ptr;
int width, height;
int Used[256];
XColor colrs[256];
ImageInfo *img_data;
/* char *txt;*/
int widthbyheight = 0;
char *fnam;
int rc;
int bg, bg_red, bg_green, bg_blue;
#ifdef HAVE_HDF
int ishdf = 0;
char *hdfref = NULL;
#endif
mo_window *win = NULL;
extern int Vclass;
static Pixel fg_pixel, bg_pixel;
static int done_fetch_colors = 0;
int j,bcnt;
/* Cache Load Hack - BJS 1/18/96 */ /* Fixed - SWP 02/01/96 */
if(!w) {
fnam = src;
while(*src != '\n') src++;
*src='\0';
src++;
goto stuffcache;
}
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr,
"[ImageResolve] I'm entering, src '%s', noload %d!\n",
src, noload);
#endif
if (!src)
return NULL;
if (current_win && current_win->scrolled_win == w)
{
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] already have current_win\n");
#endif
goto foundit;
}
while (win = mo_next_window (win))
{
if (win->scrolled_win == w)
{
mo_set_current_cached_win (win);
cached_url = win->current_node ? win->current_node->url : "lose";
win->cached_url = cached_url;
goto foundit;
}
}
/* Shit outta luck. */
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] aaaaaaaaaaaaaaaaaaaaagh\n");
#endif
return NULL;
foundit:
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] hello! win 0x%08x\n",
win);
#endif
/* Here is one place we do image_kill */
if(src){
if(imagekill_sites != NULL) {
for(i = 0; imagekill_sites[i]; i++) {
if(strstr(cached_url, imagekill_sites[i])) {
extern Widget view; /*hw->html.view*/
Widget swin = current_win->scrolled_win;
if (!done_fetch_colors){
if (!view)
return NULL;
/* First, go fetch the pixels. */
XtVaGetValues(view,
XtNforeground, &fg_pixel,
XtNbackground, &bg_pixel,
NULL);
done_fetch_colors = 1;
}
RETURN_IMGINFO_FROM_BITMAP(blank);
}
}
}
}
/* Internal images. */
if (strncmp (src, "internal-", 9) == 0)
{
if (!done_fetch_colors)
{
if (!view)
return NULL;
/* First, go fetch the pixels. */
XtVaGetValues(view,
XtNforeground, &fg_pixel,
XtNbackground, &bg_pixel,
NULL);
done_fetch_colors = 1;
}
if (strcmp (src, "internal-gopher-image") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_image);
if (strcmp (src, "internal-gopher-movie") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_movie);
if (strcmp (src, "internal-gopher-menu") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_menu);
if (strcmp (src, "internal-gopher-text") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_text);
if (strcmp (src, "internal-gopher-sound") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_sound);
if (strcmp (src, "internal-gopher-index") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_index);
if (strcmp (src, "internal-gopher-telnet") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_telnet);
if (strcmp (src, "internal-gopher-binary") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_binary);
if (strcmp (src, "internal-gopher-unknown") == 0)
RETURN_IMGINFO_FROM_BITMAP(gopher_unknown);
}
#ifdef HAVE_HDF
/* Incoming HDF image references will only be anchors,
so we can determine that they are in fact HDF image references
by doing strncmp here. */
if (strncmp (src, "#hdfref;", 8) == 0)
ishdf = 1;
/* OK, src is the URL we have to go hunt down.
First, we go get it. */
/* We can use cached_url here, since we set it in do_window_text. */
if (ishdf)
{
hdfref = &(src[8]);
src = mo_url_canonicalize_keep_anchor (src, cached_url);
}
else
#endif
stuffcache:
src = mo_url_canonicalize (src, cached_url);
/* Go see if we already have the image info hanging around. */
img_data = mo_fetch_cached_image_data (src);
if (img_data && img_data->image_data)
{
unsigned long bg_pixel;
XColor tmpcolr;
if (img_data->bg_index>=0) {
/* This code copied from xpmread.c. I could almost
* delete the code from there, but I suppose an XPM
* file could pathalogially have multiple transparent
* colour indicies. -- GWP
*/
XtVaGetValues(view, XtNbackground, &bg_pixel, NULL);
tmpcolr.pixel = bg_pixel;
XQueryColor(XtDisplay(view),
(installed_colormap ?
installed_cmap :
DefaultColormap(XtDisplay(view), DefaultScreen(XtDisplay(view)))),
&tmpcolr);
img_data->reds[img_data->bg_index]=tmpcolr.red;
img_data->greens[img_data->bg_index]=tmpcolr.green;
img_data->blues[img_data->bg_index]=tmpcolr.blue;
}
img_data->src = strdup(src);
free (src);
if (cci_event) MoCCISendEventOutput(IMAGE_LOADED);
return (ImageInfo *)img_data;
/*
if (!wid && !hei) {
return (ImageInfo *)img_data;
}
return(scaleImage(img_data,wid,hei));
*/
}
/* If we don't have the image cached and noload is high,
then just return NULL to avoid doing a network load. */
/* Also return if interrupted is high. */
if (noload || interrupted)
{
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "RETURNING Null noload %d interrupted %d\n",
noload, interrupted);
#endif
free (src);
return NULL;
}
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "GOING ON THROUGH...\n");
#endif
/*
* No transparent background by default
*/
bg = -1;
bg_map = NULL;
#ifdef HAVE_HDF
if (ishdf)
{
img_data =
(ImageInfo *)hdfGrokImage
(mo_hdf_fetch_local_filename (src),
hdfref,
&bg);
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] Did hdfGrokImage, got back 0x%08x\n",
img_data);
#endif
if (!img_data)
return NULL;
/* Yet another bandaid... */
img_data->internal = 0;
/* Fill out colrs array. */
for (i = 0; i < 256; i++)
{
colrs[i].red = img_data->reds[i];
colrs[i].green = img_data->greens[i];
colrs[i].blue = img_data->blues[i];
colrs[i].pixel = i;
colrs[i].flags = DoRed|DoGreen|DoBlue;
}
if (bg >= 0)
{
bg_red = colrs[bg].red;
bg_green = colrs[bg].green;
bg_blue = colrs[bg].blue;
bg_map = (unsigned char *)malloc(img_data->width * img_data->height);
}
}
else
#endif /* HAVE_HDF */
{
/* if w is NULL we're stuffing the cache with our own info...
BJS */
if(w) {
/* We have to load the image. */
fnam = mo_tmpnam(src);
interrupted = 0;
rc = mo_pull_er_over_virgin (src, fnam);
if (!rc)
{
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "mo_pull_er_over_virgin returned %d; bonging\n",
rc);
#endif
free (fnam);
return NULL;
}
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr,
"[ImageResolve] Got through mo_pull_er_over_virgin, rc %d\n",
rc);
#endif
#if 0
/* This causes problems. */
{
/* Check use_this_url_instead from HTAccess.c. */
extern char *use_this_url_instead;
if (use_this_url_instead)
{
free (src);
src = use_this_url_instead;
}
}
#endif
/*********************************************/
/* Send it through CCI if need be */
MoCCISendBrowserViewFile(src, "unknown", fnam);
}
data = ReadBitmap(fnam, &width, &height, colrs, &bg);
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr,
"[ImageResolve] Did ReadBitmap, got 0x%08x\n", data);
#endif
/* if we have a transparent background, prepare for it */
if ((bg >= 0)&&(data != NULL))
{
unsigned long bg_pixel;
XColor tmpcolr;
/* This code copied from xpmread.c. I could almost
* delete the code from there, but I suppose an XPM
* file could pathalogially have multiple transparent
* colour indicies. -- GWP
*/
XtVaGetValues(view, XtNbackground, &bg_pixel, NULL);
tmpcolr.pixel = bg_pixel;
XQueryColor(XtDisplay(view),
(installed_colormap ?
installed_cmap :
DefaultColormap(XtDisplay(view), DefaultScreen(XtDisplay(view)))),
&tmpcolr);
bg_red = colrs[bg].red = tmpcolr.red;
bg_green = colrs[bg].green = tmpcolr.green;
bg_blue = colrs[bg].blue = tmpcolr.blue;
colrs[bg].flags = DoRed|DoGreen|DoBlue;
bg_map = (unsigned char *)malloc(width * height);
}
/* Now delete the file. */
unlink(fnam);
{
char *hfnam = (char *)malloc ((strlen (fnam) + strlen(".html") + 5) * sizeof (char));
sprintf (hfnam, "%s.html", fnam);
unlink(hfnam);
free(hfnam);
}
if (w) {
free (fnam);
}
if (data == NULL)
{
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] data == NULL; punting...\n");
#endif
return NULL;
}
{
int found_bg=0;
if (data!=NULL) {
for (i=0; i<width*height; i++) {
if ((int)(data[i])==bg) {
found_bg=1;
break;
}
}
if (!found_bg) {
bg=(-1);
}
}
}
img_data = (ImageInfo *)malloc(sizeof(ImageInfo));
if ((bg >= 0)&&(data != NULL) &&
get_pref_boolean(eCLIPPING) &&
(get_pref_int(eMAX_CLIPPING_SIZE_X)==(-1) ||
get_pref_int(eMAX_CLIPPING_SIZE_X)>=width) &&
(get_pref_int(eMAX_CLIPPING_SIZE_Y)==(-1) ||
get_pref_int(eMAX_CLIPPING_SIZE_Y)>=height)) {
img_data->transparent=1;
img_data->clip_data=(unsigned char *)malloc(width * height);
memset(img_data->clip_data,0,(width*height));
img_data->bg_index=bg;
}
else {
img_data->transparent=0;
img_data->clip_data=NULL;
img_data->bg_index=(-1);
}
img_data->width = width;
img_data->height = height;
img_data->image_data = data;
img_data->image = 0;
img_data->clip = 0;
img_data->src = strdup(src);
/* Bandaid for bug afflicting Eric's code, apparently. */
img_data->internal = 0;
}
widthbyheight = img_data->width * img_data->height;
/* Fill out used array. */
for (i=0; i < 256; i++) {
Used[i] = 0;
}
cnt = 1;
bgptr = bg_map;
cptr = img_data->clip_data;
ptr = img_data->image_data;
/*This sets the bg map and also creates bitmap data for the
clip mask when there is a bg image */
for (i=0; i<img_data->height; i++) {
for (j=0,bcnt=0; j<img_data->width; j++) {
if (Used[(int)*ptr] == 0) {
Used[(int)*ptr] = cnt;
cnt++;
}
if (bg>=0) {
if (*ptr == bg) {
*bgptr = 1;
}
else {
*bgptr = 0;
if (img_data->transparent) {
*cptr += nums[(bcnt % 8)];
}
}
if (img_data->transparent &&
((bcnt % 8)==7 ||
j==(img_data->width-1))) {
cptr++;
}
bgptr++;
bcnt++;
}
ptr++;
}
}
cnt--;
/*
* If the image has too many colors, apply a median cut algorithm to
* reduce the color usage, and then reprocess it.
* Don't cut colors for direct mapped visuals like TrueColor.
*/
if ((cnt > get_pref_int(eCOLORS_PER_INLINED_IMAGE))&&(Vclass != TrueColor))
{
MedianCut(img_data->image_data, &img_data->width,
&img_data->height, colrs, 256,
get_pref_int(eCOLORS_PER_INLINED_IMAGE));
for (i=0; i < 256; i++)
Used[i] = 0;
cnt = 1;
ptr = img_data->image_data;
for (i=0; i < widthbyheight; i++)
{
if (Used[(int)*ptr] == 0)
{
Used[(int)*ptr] = cnt;
cnt++;
}
ptr++;
}
cnt--;
/* if we had a transparent bg, MedianCut used it. Get a new one */
if (bg >= 0)
{
cnt++;
bg = 256;
}
}
img_data->num_colors = cnt;
#ifdef HAVE_HDF
if (!ishdf)
#endif
{
img_data->reds = (int *)malloc(sizeof(int) * cnt);
img_data->greens = (int *)malloc(sizeof(int) * cnt);
img_data->blues = (int *)malloc(sizeof(int) * cnt);
}
/* bg is not set in here if it gets munged by MedCut */
for (i=0; i < 256; i++)
{
int indx;
if (Used[i] != 0)
{
indx = Used[i] - 1;
img_data->reds[indx] = colrs[i].red;
img_data->greens[indx] = colrs[i].green;
img_data->blues[indx] = colrs[i].blue;
/* squeegee in the background color */
if ((bg >= 0)&&(i == bg))
{
img_data->reds[indx] = bg_red;
img_data->greens[indx] = bg_green;
img_data->blues[indx] = bg_blue;
img_data->bg_index=indx;
}
}
}
/* if MedianCut ate our background, add the new one now. */
if (bg == 256)
{
img_data->reds[cnt - 1] = bg_red;
img_data->greens[cnt - 1] = bg_green;
img_data->blues[cnt - 1] = bg_blue;
img_data->bg_index=(cnt-1);
}
bgptr = bg_map;
cptr = img_data->clip_data;
ptr = img_data->image_data;
for (i=0; i < widthbyheight; i++)
{
*ptr = (unsigned char)(Used[(int)*ptr] - 1);
/* if MedianCut ate the background, enforce it here */
if (bg == 256)
{
if (*bgptr)
{
*ptr = (unsigned char)(cnt - 1);
}
bgptr++;
}
ptr++;
}
/* free the background map if we have one */
if (bg_map != NULL)
{
free (bg_map);
}
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] Doing mo_cache_data on '%s', 0x%08x\n",
src, img_data);
#endif
mo_cache_data (src, (void *)img_data, 0);
free (src);
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[ImageResolve] Leaving...\n");
#endif
if (cci_event) MoCCISendEventOutput(IMAGE_LOADED);
return img_data;
/*
if (!wid && !hei) {
return img_data;
}
return(scaleImage(img_data,wid,hei));
*/
}
static ImageInfo *DelayedImageResolve (Widget w, char *src)
{
ImageInfo *img;
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[DelayedImageResolve] I'm entering, src '%s'\n", src);
#endif
interrupted = 0;
loading_inlined_images = 1;
img = ImageResolve (w, src, 0, NULL, NULL);
loading_inlined_images = 0;
if (interrupted == 1)
{
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[DelayedImageResolve] Interrupted...\n");
#endif
interrupted = 0;
}
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[DelayedImageResolve] Returning 0x%08x\n", img);
#endif
/* need this here now...but may make other stuff look cheeeezy -- SWP */
mo_gui_done_with_icon ();
mo_gui_check_icon(-1);
return img;
}
mo_status mo_free_image_data (void *ptr)
{
ImageInfo *img = (ImageInfo *)ptr;
Widget swin=current_win->scrolled_win;
#ifndef DISABLE_TRACE
if (srcTrace)
fprintf (stderr, "[mo_free_image_info] Freeing 0x%08x\n", img);
#endif
if (!img)
return mo_fail;
if (img->reds)
{
free (img->reds);
img->reds = NULL;
}
if (img->greens)
{
free (img->greens);
img->greens = NULL;
}
if (img->blues)
{
free (img->blues);
img->blues = NULL;
}
if (img->image_data)
{
free (img->image_data);
img->image_data = NULL;
}
if (img->clip_data) {
free (img->clip_data);
img->clip_data = NULL;
}
if (img->src) {
free(img->src);
img->src=NULL;
}
if (img->image!=None) {
XFreePixmap(XtDisplay(swin),img->image);
img->image=None;
}
if (img->clip!=None) {
XFreePixmap(XtDisplay(swin),img->clip);
img->clip=None;
}
return mo_succeed;
}
mo_status mo_register_image_resolution_function (mo_window *win)
{
XmxSetArg (WbNresolveImageFunction, (long)ImageResolve);
XmxSetArg (WbNresolveDelayedImage, (long)DelayedImageResolve);
XmxSetValues (win->scrolled_win);
return mo_succeed;
}

73
src/img.h Normal file
View File

@@ -0,0 +1,73 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
* Created: Wed Apr 10 17:41:00 CDT 1996
* Author: Dan Pape
*
*/
/* this file contains stuff from the old "mosaic.h" file. I am breaking
that file up because it was too big, and required a re-compile of all
the source whenever something changed. */
#ifndef __IMG_H__
#define __IMG_H__
mo_status mo_free_image_data (void *);
mo_status mo_register_image_resolution_function (mo_window *);
#endif

536
src/international.h Normal file
View File

@@ -0,0 +1,536 @@
/*Internationalized*/
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
/*
*
* The idea for internationalization was pushed into the minds at NCSA due
* largely from the work put forth by the Mosaic TueV at _____ in Germany.
*
*
* All of the internationalization work on NCSA Mosaic was done by Scott
* Powers.
*
*/
#ifndef __INTERNATIONAL_H__
#define __INTERNATIONAL_H__
typedef enum {
/*
* File
*/
INT_FILE=0,
INT_FILE_NEW,
INT_FILE_CLONE,
INT_FILE_OPENURL,
INT_FILE_OPENLOCAL,
INT_FILE_RELOADCURRENT,
INT_FILE_RELOADIMAGES,
INT_FILE_REFRESHCURRENT,
INT_FILE_FINDINCURRENT,
INT_FILE_VIEWSOURCE,
INT_FILE_EDITSOURCE,
INT_FILE_SOURCEDATE,
INT_FILE_SAVEAS,
INT_FILE_PRINT,
INT_FILE_MAILTO,
INT_FILE_CCI,
INT_FILE_OPENDTMOUTPORT,
INT_FILE_BROADCASTOVERDTM,
INT_FILE_KERBEROSV4LOGIN,
INT_FILE_KERBEROSV5LOGIN,
INT_FILE_PROXYLIST,
INT_FILE_NOPROXYLIST,
INT_FILE_CLOSE,
INT_FILE_EXITPROGRAM,
/*
* Fonts Submenu
*/
INT_FONTS_TIMESREGULAR,
INT_FONTS_TIMESSMALL,
INT_FONTS_TIMESLARGE,
INT_FONTS_HELVETICAREGULAR,
INT_FONTS_HELVETICASMALL,
INT_FONTS_HELVETICALARGE,
INT_FONTS_NEWCENTURYREGULAR,
INT_FONTS_NEWCENTURYSMALL,
INT_FONTS_NEWCENTURYLARGE,
INT_FONTS_LUCIDABRIGHTREGULAR,
INT_FONTS_LUCIDABRIGHTSMALL,
INT_FONTS_LUCIDABRIGHTLARGE,
/*
* Underline Submenu
*/
INT_UNDERLINE_DEFAULTUNDERLINES,
INT_UNDERLINE_LIGHTUNDERLINES,
INT_UNDERLINE_MEDIUMUNDERLINES,
INT_UNDERLINE_HEAVYUNDERLINES,
INT_UNDERLINE_NOUNDERLINES,
/*
* Options Menubar
*/
INT_OPTIONS,
INT_OPTIONS_FANCYSELECTIONS,
INT_OPTIONS_LOADTOLOCALDISK,
INT_OPTIONS_TABLESUPPORT,
INT_OPTIONS_DELAYIMAGELOADING,
INT_OPTIONS_LOADIMAGESINCURRENT,
INT_OPTIONS_RELOADCONFIGFILES,
INT_OPTIONS_FLUSHIMAGECACHE,
INT_OPTIONS_CLEARGLOBALHISTORY,
INT_OPTIONS_FONTS,
INT_OPTIONS_ANCHORUNDERLINES,
/*
* Navigate Menubar
*/
INT_NAVIGATE,
INT_NAVIGATE_BACK,
INT_NAVIGATE_FORWARD,
INT_NAVIGATE_HOMEDOCUMENT,
INT_NAVIGATE_WINDOWHISTORY,
INT_NAVIGATE_DOCUMENTLINKS,
INT_NAVIGATE_HOTLIST,
INT_NAVIGATE_ADDCURRENTTOHOTLIST,
INT_NAVIGATE_INTERNETSTARTINGPOINTS,
INT_NAVIGATE_INTERNETRESOURCESMETAINDEX,
/*
* Annotate Menubar
*/
INT_ANNOTATE,
INT_ANNOTATE_ANNOTATE,
INT_ANNOTATE_AUDIOANNOTATE,
INT_ANNOTATE_EDITTHISANNOTATION,
INT_ANNOTATE_DELETETHISANNOTATION,
/*
* News Menubar
*/
INT_NEWS,
INT_NEWS_NEXT,
INT_NEWS_PREV,
INT_NEWS_NEXTTHREAD,
INT_NEWS_PREVTHREAD,
INT_NEWS_INDEX,
INT_NEWS_LISTGROUPS,
INT_NEWS_POST,
INT_NEWS_FOLLOWUP,
INT_NEWS_REPLY,
INT_NEWS_CANCEL,
INT_NEWS_FORMAT,
INT_NEWS_SUBSCRIBE,
INT_NEWS_UNSUBSCRIBE,
INT_NEWS_CATCHUP,
INT_NEWS_LISTALL,
INT_NEWS_LISTSUBSCRIBED,
/*
* News Format Submenu
*/
INT_NEWSFORMAT_THREADVIEW,
INT_NEWSFORMAT_GROUPVIEW,
INT_NEWSFORMAT_TREEVIEW,
/*
* Help Menubar
*/
INT_HELP,
INT_HELP_ABOUT,
INT_HELP_MANUAL,
INT_HELP_WHATSNEW,
INT_HELP_DEMO,
INT_HELP_ONVERSION,
INT_HELP_ONWINDOW,
INT_HELP_ONFAQ,
INT_HELP_ONHTML,
INT_HELP_ONURLS,
INT_HELP_MAILTECHSUPPORT,
INT_HELP_COMMENTCARD,
/*
* Documents Menubar
*/
INT_DOCUMENTS,
/*
* Push Buttons
*/
INT_PB_BACK,
INT_PB_FORWARD,
INT_PB_HOME,
INT_PB_RELOAD,
INT_PB_OPEN,
INT_PB_SAVEAS,
INT_PB_CLONE,
INT_PB_NEW,
INT_PB_CLOSE,
/*
* Buttons
*/
INT_BUTTON_OPEN,
INT_BUTTON_CLEAR,
INT_BUTTON_DISMISS,
INT_BUTTON_HELP,
INT_BUTTON_MAIL,
INT_BUTTON_MAILTO,
INT_BUTTON_PRINT,
INT_BUTTON_FIND,
INT_BUTTON_RESET,
INT_BUTTON_CLEANSLATE,
INT_BUTTON_INCLUDEFILE,
INT_BUTTON_DELETE,
INT_BUTTON_COMMIT,
INT_BUTTON_START,
INT_BUTTON_STOP,
INT_BUTTON_OK,
INT_BUTTON_GOTOURL,
INT_BUTTON_SAVE,
INT_BUTTON_POST,
INT_BUTTON_QUOTE,
INT_BUTTON_ADDCURRENT,
INT_BUTTON_REMOVE,
INT_BUTTON_EDIT,
INT_BUTTON_COPY,
INT_BUTTON_INSERT,
INT_BUTTON_UP,
INT_BUTTON_LOAD,
/*
* Security Icon
*/
INT_SECURITY,
INT_SECURITY_NONE,
INT_SECURITY_BASIC,
INT_SECURITY_KERBEROSV4,
INT_SECURITY_KERBEROSV5,
INT_SECURITY_MD5,
INT_SECURITY_DOMAIN,
INT_SECURITY_LOGIN,
INT_SECURITY_UNKNOWN,
/*
* Protect Me From Myself
*/
INT_PROTECTME,
INT_PROTECTME_YES,
INT_PROTECTME_NO,
/*
* Window Labels
*/
INT_WIN_TITLELABEL,
INT_WIN_URLLABEL,
/*
* String Error
*/
INT_STRERR_UNKNOWN,
/*
* Format Strings
*/
INT_FORMAT_BANNERS,
INT_FORMAT_FOOTNOTES,
INT_FORMAT_A4,
INT_FORMAT_US,
INT_FORMAT_FORMAT,
INT_FORMAT_NOMODE,
INT_FORMAT_INVALIDMODE,
/*
* Save Dialogs
*/
INT_SAVE_ERROR,
INT_SAVE_ERRORTITLE,
INT_SAVE_TITLE,
INT_SAVE_LABEL,
INT_SAVE_BINARYERROR,
INT_SAVE_BINARYERRORTITLE,
INT_SAVE_BINARYTITLE,
INT_SAVE_BINARYLABEL,
/*
* Open Dialogs
*/
INT_OPEN_LOCALTITLE,
INT_OPEN_LOCALLABEL,
INT_OPEN_TITLE,
INT_OPEN_LABEL,
INT_OPEN_DTMTITLE,
INT_OPEN_DTMLABEL,
/*
* Mail Dialogs
*/
INT_MAIL_TITLE,
INT_MAIL_TO,
INT_MAIL_SUBJECT,
/*
* my_system Error Strings
*/
INT_SYSTEM_NOCOMMAND,
INT_SYSTEM_FORKFAIL,
INT_SYSTEM_PROGRAMFAILED,
INT_SYSTEM_NORETBUF,
INT_SYSTEM_FCNTLFAILED,
/*
* Print Dialogs
*/
INT_PRINT_INFOTITLE,
INT_PRINT_TITLE,
INT_PRINT_COMMAND,
/*
* Source Dialogs
*/
INT_SOURCE_TITLE,
INT_SOURCE_LABEL,
INT_SOURCE_YESDATE,
INT_SOURCE_NODATE,
INT_SOURCE_EDITOPENERRORTITLE,
INT_SOURCE_EDITOPENERRORSTRING,
INT_SOURCE_EDITWRITEERRORTITLE,
INT_SOURCE_EDITWRITEERRORSTRING,
/*
* Find Dialogs
*/
INT_FIND_RESULTTITLE,
INT_FIND_RESULTNONE,
INT_FIND_RESULTNOMORE,
INT_FIND_TITLE,
INT_FIND_STRING,
INT_FIND_CASELESS,
INT_FIND_BACKWARDS,
/*
* Exit
*/
INT_EXIT_TITLE,
INT_EXIT_STRING,
/*
* Font Loading
*/
INT_FONTLOAD_ERRORSTRING,
INT_FONTLOAD_ERRORTITLE,
/*
* Global History
*/
INT_GLOBHIST_CLEARSTRING,
INT_GLOBHIST_CLEARTITLE,
/*
* Annotations
*/
INT_ANNOTATION_DELETESTRING,
INT_ANNOTATION_DELETETITLE,
INT_ANNOTATION_NOTITLE,
INT_ANNOTATION_NOAUTHOR,
INT_ANNOTATION_BY,
INT_ANNOTATION_OPENERRORTITLE,
INT_ANNOTATION_OPENERRORSTRING,
INT_ANNOTATION_INCLUDESTRING,
INT_ANNOTATION_INCLUDETITLE,
INT_ANNOTATION_TITLE,
INT_ANNOTATION_AUTHORSTRING,
INT_ANNOTATION_TITLESTRING,
INT_ANNOTATION_PASSWORDTOGGLE,
INT_ANNOTATION_PASSWORDSTRING,
INT_ANNOTATION_TEXTSTRING,
/*
* Title
*/
INT_TITLE_NOTITLE,
/*
* Audio Annotations
*/
INT_AUDIO_ERRORSTRING,
INT_AUDIO_ERRORTITLE,
INT_AUDIO_BY,
INT_AUDIO_COMPLETEERRORSTRING,
INT_AUDIO_COMPLETEERRORTITLE,
INT_AUDIO_ANCHOR,
INT_AUDIO_TITLE,
INT_AUDIO_INSTRUCTIONS,
/*
* CCI
*/
INT_CCI_ERRORADDRTITLE,
INT_CCI_ERRORADDRSTRING,
INT_CCI_PORTSTRING,
INT_CCI_PORTTITLE,
INT_CCI_ERRORREQTITLE,
INT_CCI_ERRORREQSTRING,
INT_CCI_NOSTRING,
INT_CCI_NOTITLE,
INT_CCI_TITLE,
INT_CCI_ADDR,
INT_CCI_TOGGLEACCEPT,
INT_CCI_TOGGLEOFF,
INT_CCI_ERRORLISTENTITLE,
INT_CCI_ERRORLISTENSTRING,
/*
* Document Links
*/
INT_LINKS_TITLE,
INT_LINKS_LABEL,
INT_LINKS_LINKSSTRING,
INT_LINKS_IMAGESSTRING,
/*
* News
*/
INT_NEWS_INCLUDEERRORSTRING,
INT_NEWS_INCLUDEERRORTITLE,
INT_NEWS_INCLUDESTRING,
INT_NEWS_INCLUDETITLE,
INT_NEWS_TITLE,
INT_NEWS_FROMSTRING,
INT_NEWS_SUBJECTSTRING,
INT_NEWS_GROUPSSTRING,
INT_NEWS_FOLLOWUPSTRING,
INT_NEWS_POSTSTRING,
INT_NEWS_ARTICLETITLESTRING,
INT_NEWS_GROUPTITLESTRING,
/*
* Gopher
*/
INT_GOPHER_TITLESTRING1,
INT_GOPHER_TITLESTRING2,
/*
* WAIS
*/
INT_WAIS_TITLESTRING1,
INT_WAIS_TITLESTRING2,
/*
* URL
*/
INT_URL_LOCALTITLESTRING,
INT_URL_REMOTETITLESTRING,
INT_URL_UNKNOWNTITLESTRING,
/*
* History
*/
INT_HISTORY_MAILTITLE,
INT_HISTORY_MAILTOLABEL,
INT_HISTORY_MAILSUBJECTLABEL,
INT_HISTORY_TITLE,
INT_HISTORY_HISTORYLABEL,
/*
* Hotlist
*/
INT_HOTLIST_INSERTTITLE,
INT_HOTLIST_EDITTITLE,
INT_HOTLIST_TITLELABEL,
INT_HOTLIST_URLLABEL,
INT_HOTLIST_URLNAME,
INT_HOTLIST_LISTNAME,
INT_HOTLIST_INSERTNAME,
INT_HOTLIST_APPENDNAME,
INT_HOTLIST_SAVEERROR,
INT_HOTLIST_SAVEERRORTITLE,
INT_HOTLIST_OPENERROR,
INT_HOTLIST_OPENERRORTITLE,
INT_HOTLIST_NONAME,
INT_HOTLIST_REMOVESTARTSTRING,
INT_HOTLIST_REMOVEENDSTRING,
INT_HOTLIST_REMOVETITLE,
INT_HOTLIST_MAILTITLE,
INT_HOTLIST_MAILTOLABEL,
INT_HOTLIST_MAILSUBJECTLABEL,
INT_HOTLIST_SELECTERRORTITLE,
INT_HOTLIST_SELECTERRORSTRING,
INT_HOTLIST_REMOVEERRORTITLE,
INT_HOTLIST_REMOVEERRORSTRING,
INT_HOTLIST_EDITERRORTITLE,
INT_HOTLIST_EDITERRORSTRING,
INT_HOTLIST_COPYERRORTITLE,
INT_HOTLIST_COPYERRORSTRING,
INT_HOTLIST_SAVETITLE,
INT_HOTLIST_SAVESTRING,
INT_HOTLIST_OPENTITLE,
INT_HOTLIST_OPENSTRING,
INT_HOTLIST_OPENCREATENAME,
INT_HOTLIST_OPENLOADNAME,
INT_HOTLIST_VIEWTITLE,
INT_SCOTTLIST_VIEWTITLE,
/*
* The End...
*/
MAX_INTER_TYPES
} iType;
#else
#endif

73
src/kcms.c Normal file
View File

@@ -0,0 +1,73 @@
/****************************************************************************
* NCSA Mosaic for the X Window System *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* 605 E. Springfield, Champaign IL 61820 *
* mosaic@ncsa.uiuc.edu *
* *
* Copyright (C) 1993, Board of Trustees of the University of Illinois *
* *
* NCSA Mosaic software, both binary and source (hereafter, Software) is *
* copyrighted by The Board of Trustees of the University of Illinois *
* (UI), and ownership remains with the UI. *
* *
* The UI grants you (hereafter, Licensee) a license to use the Software *
* for academic, research and internal business purposes only, without a *
* fee. Licensee may distribute the binary and source code (if released) *
* to third parties provided that the copyright notice and this statement *
* appears on all copies and that no charge is associated with such *
* copies. *
* *
* Licensee may make derivative works. However, if Licensee distributes *
* any derivative work based on or derived from the Software, then *
* Licensee will (1) notify NCSA regarding its distribution of the *
* derivative work, and (2) clearly notify users that such derivative *
* work is a modified version and not the original NCSA Mosaic *
* distributed by the UI. *
* *
* Any Licensee wishing to make commercial use of the Software should *
* contact the UI, c/o NCSA, to negotiate an appropriate license for such *
* commercial use. Commercial use includes (1) integration of all or *
* part of the source code into a product for sale or license by or on *
* behalf of Licensee to third parties, or (2) distribution of the binary *
* code or source code to third parties that need it to utilize a *
* commercial product sold or licensed by or on behalf of Licensee. *
* *
* UI MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR *
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED *
* WARRANTY. THE UI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE *
* USERS OF THIS SOFTWARE. *
* *
* By using or copying this Software, Licensee agrees to abide by the *
* copyright law and all other applicable laws of the U.S. including, but *
* not limited to, export control laws, and the terms of this license. *
* UI shall have the right to terminate this license immediately by *
* written notice upon Licensee's breach of, or non-compliance with, any *
* of its terms. Licensee may be held legally responsible for any *
* copyright infringement that is caused or encouraged by Licensee's *
* failure to abide by the terms of this license. *
* *
* Comments and questions are welcome and can be sent to *
* mosaic-x@ncsa.uiuc.edu. *
****************************************************************************/
#include "../config.h"
#include "kcms.h"
void CheckKCMS(void) {
/*replace this with the real lib call when we get it*/
KCMS_Enabled=0;
/*need a callback which will eventually decide this, but base the
default on whether KCMS is present or not*/
if (KCMS_Enabled) {
KCMS_Return_Format=JYCC;
}
else {
KCMS_Return_Format=JPEG;
}
return;
}

16
src/kcms.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef _KCMS_H_
int KCMS_Enabled;
int KCMS_Return_Format;
#define _KCMS_H_
#else
extern int KCMS_Enabled;
extern int KCMS_Return_Format;
#endif
#define JPEG 0
#define JYCC 1
#define GIF 2
void CheckKCMS(void);

29
src/list.h Normal file
View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
*
* Permission is granted to copy and distribute source with out fee.
* Commercialization of this product requires prior licensing
* from the National Center for Supercomputing Applications of the
* University of Illinois. Commercialization includes the integration of this
* code in part or whole into a product for resale. Free distribution of
* unmodified source and use of NCSA software is not considered
* commercialization.
*
*/
typedef struct LISTSTRUCT *List;
extern List ListCreate();
extern void ListDestroy();
extern int ListAddEntry();
extern int ListDeleteEntry();
extern int ListMakeEntryCurrent();
extern int ListCount();
extern char *ListHead();
extern char *ListTail();
extern char *ListCurrent();
extern char *ListNext();
extern char *ListPrev();
extern char *ListGetIndexedEntry();

34
src/listP.h Normal file
View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
*
* Permission is granted to copy and distribute source with out fee.
* Commercialization of this product requires prior licensing
* from the National Center for Supercomputing Applications of the
* University of Illinois. Commercialization includes the integration of this
* code in part or whole into a product for resale. Free distribution of
* unmodified source and use of NCSA software is not considered
* commercialization.
*
*/
#ifndef ___HAS_LIST_STUFF_BEEN_INCLUDED_BEFORE___
#define ___HAS_LIST_STUFF_BEEN_INCLUDED_BEFORE___
#include <stdlib.h>
#include "list.h"
struct LISTINSTANCE {
char *value;
struct LISTINSTANCE *next;
struct LISTINSTANCE *prev;
};
struct LISTSTRUCT {
struct LISTINSTANCE *head;
struct LISTINSTANCE *tail;
struct LISTINSTANCE *current;
int listCount;
};
#endif

Some files were not shown because too many files have changed in this diff Show More