libpayload: Rename PDCurses-3.4 to PDCurses

Change-Id: If881ec130833c7e7e62caa3d31e350a531f5bc8e
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/12398
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Stefan Reinauer
2015-11-10 09:00:41 -08:00
parent 2ea24dabd6
commit 4f85a1eb76
164 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,234 @@
# Makefile for PDCurses library for AIX/X11
SHELL = @SHELL@
THIS = Makefile
@SET_MAKE@
PDCURSES_SRCDIR = ..
osdir = .
srcdir = $(PDCURSES_SRCDIR)/pdcurses
PDCURSES_CONFIG_H =$(PDCURSES_SRCDIR)/config.h
PDCURSES_CURSES_H =$(PDCURSES_SRCDIR)/curses.h
PDCURSES_CURSPRIV_H =$(PDCURSES_SRCDIR)/curspriv.h
PDCURSES_HEADERS =$(PDCURSES_CONFIG_H) $(PDCURSES_CURSES_H) \
$(PDCURSES_CURSPRIV_H)
PDCURSES_X11_H =$(osdir)/pdcx11.h
MH_EXTRA_LIBS = @MH_EXTRA_LIBS@
CFLAGS = @CFLAGS@ @DYN_COMP@
CPPFLAGS = @DEFS@ -DXCURSES @SYS_DEFS@ -I$(PDCURSES_SRCDIR)
BUILD = @CC@ -c $(CFLAGS) $(CPPFLAGS) @MH_XINC_DIR@
LINK = @CC@
LDFLAGS =
LIBCURSES = libXCurses.a
all : $(LIBCURSES)
install :
echo Does nothing at the moment
clean :
-rm -rf *.o *.sho trace $(LIBCURSES)
distclean: clean
-rm -f Makefile
mostlyclean: clean
realclean: distclean
LIBOBJS = addch.o addchstr.o addstr.o attr.o beep.o bkgd.o border.o \
clear.o color.o delch.o deleteln.o deprec.o getch.o getstr.o getyx.o \
inch.o inchstr.o initscr.o inopts.o insch.o insstr.o instr.o kernel.o \
keyname.o mouse.o move.o outopts.o overlay.o pad.o panel.o printw.o \
refresh.o scanw.o scr_dump.o scroll.o slk.o termattr.o terminfo.o \
touch.o util.o window.o debug.o
PDCOBJS = pdcclip.o pdcdisp.o pdcgetsc.o pdckbd.o pdcscrn.o pdcsetsc.o \
pdcutil.o pdcx11.o x11.o sb.o ScrollBox.o
$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) curses.exp
ld -bnoentry -bM:SRE -bE:curses.exp $(MH_LIBS) $(MH_EXTRA_LIBS) \
$(LIBOBJS) $(PDCOBJS) -o $@
$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_X11_H)
terminfo.o: $(TERM_HEADER)
curses.exp: ../exp-base.def
cat ../exp-base.def > curses.exp
echo Xinitscr >> curses.exp
echo XCursesExit >> curses.exp
echo sb_init >> curses.exp
echo sb_set_horz >> curses.exp
echo sb_set_vert >> curses.exp
echo sb_get_horz >> curses.exp
echo sb_get_vert >> curses.exp
echo sb_refresh >> curses.exp
addch.o: $(srcdir)/addch.c
$(BUILD) $(srcdir)/addch.c
addchstr.o: $(srcdir)/addchstr.c
$(BUILD) $(srcdir)/addchstr.c
addstr.o: $(srcdir)/addstr.c
$(BUILD) $(srcdir)/addstr.c
attr.o: $(srcdir)/attr.c
$(BUILD) $(srcdir)/attr.c
beep.o: $(srcdir)/beep.c
$(BUILD) $(srcdir)/beep.c
bkgd.o: $(srcdir)/bkgd.c
$(BUILD) $(srcdir)/bkgd.c
border.o: $(srcdir)/border.c
$(BUILD) $(srcdir)/border.c
clear.o: $(srcdir)/clear.c
$(BUILD) $(srcdir)/clear.c
color.o: $(srcdir)/color.c
$(BUILD) $(srcdir)/color.c
delch.o: $(srcdir)/delch.c
$(BUILD) $(srcdir)/delch.c
deleteln.o: $(srcdir)/deleteln.c
$(BUILD) $(srcdir)/deleteln.c
deprec.o: $(srcdir)/deprec.c
$(BUILD) $(srcdir)/deprec.c
getch.o: $(srcdir)/getch.c
$(BUILD) $(srcdir)/getch.c
getstr.o: $(srcdir)/getstr.c
$(BUILD) $(srcdir)/getstr.c
getyx.o: $(srcdir)/getyx.c
$(BUILD) $(srcdir)/getyx.c
inch.o: $(srcdir)/inch.c
$(BUILD) $(srcdir)/inch.c
inchstr.o: $(srcdir)/inchstr.c
$(BUILD) $(srcdir)/inchstr.c
initscr.o: $(srcdir)/initscr.c
$(BUILD) $(srcdir)/initscr.c
inopts.o: $(srcdir)/inopts.c
$(BUILD) $(srcdir)/inopts.c
insch.o: $(srcdir)/insch.c
$(BUILD) $(srcdir)/insch.c
insstr.o: $(srcdir)/insstr.c
$(BUILD) $(srcdir)/insstr.c
instr.o: $(srcdir)/instr.c
$(BUILD) $(srcdir)/instr.c
kernel.o: $(srcdir)/kernel.c
$(BUILD) $(srcdir)/kernel.c
keyname.o: $(srcdir)/keyname.c
$(BUILD) $(srcdir)/keyname.c
mouse.o: $(srcdir)/mouse.c
$(BUILD) $(srcdir)/mouse.c
move.o: $(srcdir)/move.c
$(BUILD) $(srcdir)/move.c
outopts.o: $(srcdir)/outopts.c
$(BUILD) $(srcdir)/outopts.c
overlay.o: $(srcdir)/overlay.c
$(BUILD) $(srcdir)/overlay.c
pad.o: $(srcdir)/pad.c
$(BUILD) $(srcdir)/pad.c
panel.o: $(srcdir)/panel.c $(PDCURSES_SRCDIR)/panel.h
$(BUILD) $(srcdir)/panel.c
printw.o: $(srcdir)/printw.c
$(BUILD) $(srcdir)/printw.c
refresh.o: $(srcdir)/refresh.c
$(BUILD) $(srcdir)/refresh.c
scanw.o: $(srcdir)/scanw.c
$(BUILD) $(srcdir)/scanw.c
scr_dump.o: $(srcdir)/scr_dump.c
$(BUILD) $(srcdir)/scr_dump.c
scroll.o: $(srcdir)/scroll.c
$(BUILD) $(srcdir)/scroll.c
slk.o: $(srcdir)/slk.c
$(BUILD) $(srcdir)/slk.c
termattr.o: $(srcdir)/termattr.c
$(BUILD) $(srcdir)/termattr.c
terminfo.o: $(srcdir)/terminfo.c
$(BUILD) $(srcdir)/terminfo.c
touch.o: $(srcdir)/touch.c
$(BUILD) $(srcdir)/touch.c
util.o: $(srcdir)/util.c
$(BUILD) $(srcdir)/util.c
window.o: $(srcdir)/window.c
$(BUILD) $(srcdir)/window.c
debug.o: $(srcdir)/debug.c
$(BUILD) $(srcdir)/debug.c
pdcclip.o: $(osdir)/pdcclip.c
$(BUILD) $(osdir)/pdcclip.c
pdcdisp.o: $(osdir)/pdcdisp.c
$(BUILD) $(osdir)/pdcdisp.c
pdcgetsc.o: $(osdir)/pdcgetsc.c
$(BUILD) $(osdir)/pdcgetsc.c
pdckbd.o: $(osdir)/pdckbd.c
$(BUILD) $(osdir)/pdckbd.c
pdcscrn.o: $(osdir)/pdcscrn.c
$(BUILD) $(osdir)/pdcscrn.c
pdcsetsc.o: $(osdir)/pdcsetsc.c
$(BUILD) $(osdir)/pdcsetsc.c
pdcutil.o: $(osdir)/pdcutil.c
$(BUILD) $(osdir)/pdcutil.c
pdcx11.o: $(osdir)/pdcx11.c
$(BUILD) $(osdir)/pdcx11.c
ScrollBox.o: $(osdir)/ScrollBox.c
$(BUILD) $(osdir)/ScrollBox.c
sb.o: $(osdir)/sb.c
$(BUILD) $(osdir)/sb.c
x11.o: $(osdir)/x11.c
$(BUILD) $(osdir)/x11.c

View File

@@ -0,0 +1,572 @@
# Makefile for PDCurses library for X11
SHELL = @SHELL@
THIS = Makefile
@SET_MAKE@
PDCURSES_SRCDIR = ..
osdir = .
srcdir = $(PDCURSES_SRCDIR)/pdcurses
demodir = $(PDCURSES_SRCDIR)/demos
PDCURSES_CONFIG_H =$(PDCURSES_SRCDIR)/config.h
PDCURSES_CURSES_H =$(PDCURSES_SRCDIR)/curses.h
PDCURSES_CURSPRIV_H =$(PDCURSES_SRCDIR)/curspriv.h
PDCURSES_HEADERS =$(PDCURSES_CONFIG_H) $(PDCURSES_CURSES_H) \
$(PDCURSES_CURSPRIV_H)
PDCURSES_X11_H =$(osdir)/pdcx11.h
SHLPRE = @SHLPRE@
SHLPST = @SHLPST@
LD_RXLIB1 = @LD_RXLIB1@
LD_RXLIB2 = @MH_XLIBS@ @MH_EXTRA_LIBS@ -lc
CFLAGS = @CFLAGS@
CPPFLAGS = @DEFS@ -DXCURSES @SYS_DEFS@ -I$(PDCURSES_SRCDIR)
BUILD = @CC@ -c $(CFLAGS) $(CPPFLAGS) @MH_XINC_DIR@
DYN_BUILD = @O2SAVE@ $(BUILD) @DYN_COMP@ @CC2O@
LINK = @PURIFY@ @CC@
#LDFLAGS = $(LIB_DEPS) @LDFLAGS@ @LIBS@ @MH_XLIBS@ @MH_EXTRA_LIBS@
LDFLAGS = $(LIBCURSES) @LDFLAGS@ @LIBS@ @MH_XLIBS@ @MH_EXTRA_LIBS@
RANLIB = @RANLIB@
LIBCURSES = libXCurses.a
LIB_DEPS = -L$(PDCURSES_SRCDIR)/x11 -lXCurses
PDCLIBS = $(LIBCURSES) @SHL_TARGETS@
DEMOS = firework newdemo ptest rain testcurs tuidemo worm xmas
DEMOOBJS = firework.o newdemo.o ptest.o rain.o testcurs.o tui.o \
tuidemo.o worm.o xmas.o
SHLFILE = XCurses
all: $(PDCLIBS) $(DEMOS)
install:
echo Does nothing at the moment
clean:
-rm -rf *.o *.sho trace $(PDCLIBS) $(DEMOS)
demos: $(DEMOS)
distclean: clean
-rm -f Makefile
mostlyclean: clean
realclean: distclean
LIBOBJS = addch.o addchstr.o addstr.o attr.o beep.o bkgd.o border.o \
clear.o color.o delch.o deleteln.o deprec.o getch.o getstr.o getyx.o \
inch.o inchstr.o initscr.o inopts.o insch.o insstr.o instr.o kernel.o \
keyname.o mouse.o move.o outopts.o overlay.o pad.o panel.o printw.o \
refresh.o scanw.o scr_dump.o scroll.o slk.o termattr.o terminfo.o \
touch.o util.o window.o debug.o
PDCOBJS = pdcclip.o pdcdisp.o pdcgetsc.o pdckbd.o pdcscrn.o pdcsetsc.o \
pdcutil.o pdcx11.o x11.o sb.o ScrollBox.o
LIBSHOBJS = $(LIBOBJS:.o=.sho)
PDCSHOBJS = $(PDCOBJS:.o=.sho)
SHOFILES = $(LIBSHOBJS) $(PDCSHOBJS)
$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
ar rv $@ $?
-$(RANLIB) $@
$(SHLPRE)$(SHLFILE)$(SHLPST) : $(SHOFILES)
$(LD_RXLIB1) -o $@ $(SHOFILES) $(LD_RXLIB2)
$(LIBOBJS) $(PDCOBJS) $(SHOFILES) : $(PDCURSES_HEADERS)
$(PDCOBJS) $(PDCSHOBJS) : $(PDCURSES_X11_H)
$(DEMOOBJS) : $(PDCURSES_CURSES_H)
$(DEMOS) : $(LIBCURSES)
terminfo.o terminfo.sho: $(TERM_HEADER)
addch.o: $(srcdir)/addch.c
$(BUILD) $(srcdir)/addch.c
addchstr.o: $(srcdir)/addchstr.c
$(BUILD) $(srcdir)/addchstr.c
addstr.o: $(srcdir)/addstr.c
$(BUILD) $(srcdir)/addstr.c
attr.o: $(srcdir)/attr.c
$(BUILD) $(srcdir)/attr.c
beep.o: $(srcdir)/beep.c
$(BUILD) $(srcdir)/beep.c
bkgd.o: $(srcdir)/bkgd.c
$(BUILD) $(srcdir)/bkgd.c
border.o: $(srcdir)/border.c
$(BUILD) $(srcdir)/border.c
clear.o: $(srcdir)/clear.c
$(BUILD) $(srcdir)/clear.c
color.o: $(srcdir)/color.c
$(BUILD) $(srcdir)/color.c
delch.o: $(srcdir)/delch.c
$(BUILD) $(srcdir)/delch.c
deleteln.o: $(srcdir)/deleteln.c
$(BUILD) $(srcdir)/deleteln.c
deprec.o: $(srcdir)/deprec.c
$(BUILD) $(srcdir)/deprec.c
getch.o: $(srcdir)/getch.c
$(BUILD) $(srcdir)/getch.c
getstr.o: $(srcdir)/getstr.c
$(BUILD) $(srcdir)/getstr.c
getyx.o: $(srcdir)/getyx.c
$(BUILD) $(srcdir)/getyx.c
inch.o: $(srcdir)/inch.c
$(BUILD) $(srcdir)/inch.c
inchstr.o: $(srcdir)/inchstr.c
$(BUILD) $(srcdir)/inchstr.c
initscr.o: $(srcdir)/initscr.c
$(BUILD) $(srcdir)/initscr.c
inopts.o: $(srcdir)/inopts.c
$(BUILD) $(srcdir)/inopts.c
insch.o: $(srcdir)/insch.c
$(BUILD) $(srcdir)/insch.c
insstr.o: $(srcdir)/insstr.c
$(BUILD) $(srcdir)/insstr.c
instr.o: $(srcdir)/instr.c
$(BUILD) $(srcdir)/instr.c
kernel.o: $(srcdir)/kernel.c
$(BUILD) $(srcdir)/kernel.c
keyname.o: $(srcdir)/keyname.c
$(BUILD) $(srcdir)/keyname.c
mouse.o: $(srcdir)/mouse.c
$(BUILD) $(srcdir)/mouse.c
move.o: $(srcdir)/move.c
$(BUILD) $(srcdir)/move.c
outopts.o: $(srcdir)/outopts.c
$(BUILD) $(srcdir)/outopts.c
overlay.o: $(srcdir)/overlay.c
$(BUILD) $(srcdir)/overlay.c
pad.o: $(srcdir)/pad.c
$(BUILD) $(srcdir)/pad.c
panel.o: $(srcdir)/panel.c $(PDCURSES_SRCDIR)/panel.h
$(BUILD) $(srcdir)/panel.c
printw.o: $(srcdir)/printw.c
$(BUILD) $(srcdir)/printw.c
refresh.o: $(srcdir)/refresh.c
$(BUILD) $(srcdir)/refresh.c
scanw.o: $(srcdir)/scanw.c
$(BUILD) $(srcdir)/scanw.c
scr_dump.o: $(srcdir)/scr_dump.c
$(BUILD) $(srcdir)/scr_dump.c
scroll.o: $(srcdir)/scroll.c
$(BUILD) $(srcdir)/scroll.c
slk.o: $(srcdir)/slk.c
$(BUILD) $(srcdir)/slk.c
termattr.o: $(srcdir)/termattr.c
$(BUILD) $(srcdir)/termattr.c
terminfo.o: $(srcdir)/terminfo.c
$(BUILD) $(srcdir)/terminfo.c
touch.o: $(srcdir)/touch.c
$(BUILD) $(srcdir)/touch.c
util.o: $(srcdir)/util.c
$(BUILD) $(srcdir)/util.c
window.o: $(srcdir)/window.c
$(BUILD) $(srcdir)/window.c
debug.o: $(srcdir)/debug.c
$(BUILD) $(srcdir)/debug.c
pdcclip.o: $(osdir)/pdcclip.c
$(BUILD) $(osdir)/pdcclip.c
pdcdisp.o: $(osdir)/pdcdisp.c
$(BUILD) $(osdir)/pdcdisp.c
pdcgetsc.o: $(osdir)/pdcgetsc.c
$(BUILD) $(osdir)/pdcgetsc.c
pdckbd.o: $(osdir)/pdckbd.c
$(BUILD) $(osdir)/pdckbd.c
pdcscrn.o: $(osdir)/pdcscrn.c
$(BUILD) $(osdir)/pdcscrn.c
pdcsetsc.o: $(osdir)/pdcsetsc.c
$(BUILD) $(osdir)/pdcsetsc.c
pdcutil.o: $(osdir)/pdcutil.c
$(BUILD) $(osdir)/pdcutil.c
pdcx11.o: $(osdir)/pdcx11.c
$(BUILD) $(osdir)/pdcx11.c
ScrollBox.o: $(osdir)/ScrollBox.c
$(BUILD) $(osdir)/ScrollBox.c
sb.o: $(osdir)/sb.c
$(BUILD) $(osdir)/sb.c
x11.o: $(osdir)/x11.c
$(BUILD) $(osdir)/x11.c
addch.sho: $(srcdir)/addch.c
$(DYN_BUILD) $(srcdir)/addch.c
@SAVE2O@
addchstr.sho: $(srcdir)/addchstr.c
$(DYN_BUILD) $(srcdir)/addchstr.c
@SAVE2O@
addstr.sho: $(srcdir)/addstr.c
$(DYN_BUILD) $(srcdir)/addstr.c
@SAVE2O@
attr.sho: $(srcdir)/attr.c
$(DYN_BUILD) $(srcdir)/attr.c
@SAVE2O@
beep.sho: $(srcdir)/beep.c
$(DYN_BUILD) $(srcdir)/beep.c
@SAVE2O@
bkgd.sho: $(srcdir)/bkgd.c
$(DYN_BUILD) $(srcdir)/bkgd.c
@SAVE2O@
border.sho: $(srcdir)/border.c
$(DYN_BUILD) $(srcdir)/border.c
@SAVE2O@
clear.sho: $(srcdir)/clear.c
$(DYN_BUILD) $(srcdir)/clear.c
@SAVE2O@
color.sho: $(srcdir)/color.c
$(DYN_BUILD) $(srcdir)/color.c
@SAVE2O@
delch.sho: $(srcdir)/delch.c
$(DYN_BUILD) $(srcdir)/delch.c
@SAVE2O@
deleteln.sho: $(srcdir)/deleteln.c
$(DYN_BUILD) $(srcdir)/deleteln.c
@SAVE2O@
deprec.sho: $(srcdir)/deprec.c
$(DYN_BUILD) $(srcdir)/deprec.c
@SAVE2O@
getch.sho: $(srcdir)/getch.c
$(DYN_BUILD) $(srcdir)/getch.c
@SAVE2O@
getstr.sho: $(srcdir)/getstr.c
$(DYN_BUILD) $(srcdir)/getstr.c
@SAVE2O@
getyx.sho: $(srcdir)/getyx.c
$(DYN_BUILD) $(srcdir)/getyx.c
@SAVE2O@
inch.sho: $(srcdir)/inch.c
$(DYN_BUILD) $(srcdir)/inch.c
@SAVE2O@
inchstr.sho: $(srcdir)/inchstr.c
$(DYN_BUILD) $(srcdir)/inchstr.c
@SAVE2O@
initscr.sho: $(srcdir)/initscr.c
$(DYN_BUILD) $(srcdir)/initscr.c
@SAVE2O@
inopts.sho: $(srcdir)/inopts.c
$(DYN_BUILD) $(srcdir)/inopts.c
@SAVE2O@
insch.sho: $(srcdir)/insch.c
$(DYN_BUILD) $(srcdir)/insch.c
@SAVE2O@
insstr.sho: $(srcdir)/insstr.c
$(DYN_BUILD) $(srcdir)/insstr.c
@SAVE2O@
instr.sho: $(srcdir)/instr.c
$(DYN_BUILD) $(srcdir)/instr.c
@SAVE2O@
kernel.sho: $(srcdir)/kernel.c
$(DYN_BUILD) $(srcdir)/kernel.c
@SAVE2O@
keyname.sho: $(srcdir)/keyname.c
$(DYN_BUILD) $(srcdir)/keyname.c
@SAVE2O@
mouse.sho: $(srcdir)/mouse.c
$(DYN_BUILD) $(srcdir)/mouse.c
@SAVE2O@
move.sho: $(srcdir)/move.c
$(DYN_BUILD) $(srcdir)/move.c
@SAVE2O@
outopts.sho: $(srcdir)/outopts.c
$(DYN_BUILD) $(srcdir)/outopts.c
@SAVE2O@
overlay.sho: $(srcdir)/overlay.c
$(DYN_BUILD) $(srcdir)/overlay.c
@SAVE2O@
pad.sho: $(srcdir)/pad.c
$(DYN_BUILD) $(srcdir)/pad.c
@SAVE2O@
panel.sho: $(srcdir)/panel.c $(PDCURSES_SRCDIR)/panel.h
$(DYN_BUILD) $(srcdir)/panel.c
@SAVE2O@
printw.sho: $(srcdir)/printw.c
$(DYN_BUILD) $(srcdir)/printw.c
@SAVE2O@
refresh.sho: $(srcdir)/refresh.c
$(DYN_BUILD) $(srcdir)/refresh.c
@SAVE2O@
scanw.sho: $(srcdir)/scanw.c
$(DYN_BUILD) $(srcdir)/scanw.c
@SAVE2O@
scr_dump.sho: $(srcdir)/scr_dump.c
$(DYN_BUILD) $(srcdir)/scr_dump.c
@SAVE2O@
scroll.sho: $(srcdir)/scroll.c
$(DYN_BUILD) $(srcdir)/scroll.c
@SAVE2O@
slk.sho: $(srcdir)/slk.c
$(DYN_BUILD) $(srcdir)/slk.c
@SAVE2O@
termattr.sho: $(srcdir)/termattr.c
$(DYN_BUILD) $(srcdir)/termattr.c
@SAVE2O@
terminfo.sho: $(srcdir)/terminfo.c
$(DYN_BUILD) $(srcdir)/terminfo.c
@SAVE2O@
touch.sho: $(srcdir)/touch.c
$(DYN_BUILD) $(srcdir)/touch.c
@SAVE2O@
util.sho: $(srcdir)/util.c
$(DYN_BUILD) $(srcdir)/util.c
@SAVE2O@
window.sho: $(srcdir)/window.c
$(DYN_BUILD) $(srcdir)/window.c
@SAVE2O@
debug.sho: $(srcdir)/debug.c
$(DYN_BUILD) $(srcdir)/debug.c
@SAVE2O@
pdcclip.sho: $(osdir)/pdcclip.c
$(DYN_BUILD) $(osdir)/pdcclip.c
@SAVE2O@
pdcdisp.sho: $(osdir)/pdcdisp.c
$(DYN_BUILD) $(osdir)/pdcdisp.c
@SAVE2O@
pdcgetsc.sho: $(osdir)/pdcgetsc.c
$(DYN_BUILD) $(osdir)/pdcgetsc.c
@SAVE2O@
pdckbd.sho: $(osdir)/pdckbd.c
$(DYN_BUILD) $(osdir)/pdckbd.c
@SAVE2O@
pdcscrn.sho: $(osdir)/pdcscrn.c
$(DYN_BUILD) $(osdir)/pdcscrn.c
@SAVE2O@
pdcsetsc.sho: $(osdir)/pdcsetsc.c
$(DYN_BUILD) $(osdir)/pdcsetsc.c
@SAVE2O@
pdcutil.sho: $(osdir)/pdcutil.c
$(DYN_BUILD) $(osdir)/pdcutil.c
@SAVE2O@
pdcx11.sho: $(osdir)/pdcx11.c
$(DYN_BUILD) $(osdir)/pdcx11.c
@SAVE2O@
ScrollBox.sho: $(osdir)/ScrollBox.c
$(DYN_BUILD) $(osdir)/ScrollBox.c
@SAVE2O@
sb.sho: $(osdir)/sb.c
$(DYN_BUILD) $(osdir)/sb.c
@SAVE2O@
x11.sho: $(osdir)/x11.c
$(DYN_BUILD) $(osdir)/x11.c
@SAVE2O@
firework: firework.o
$(LINK) firework.o -o $@ $(LDFLAGS)
newdemo: newdemo.o
$(LINK) newdemo.o -o $@ $(LDFLAGS)
ptest: ptest.o
$(LINK) ptest.o -o $@ $(LDFLAGS)
rain: rain.o
$(LINK) rain.o -o $@ $(LDFLAGS)
testcurs: testcurs.o
$(LINK) testcurs.o -o $@ $(LDFLAGS)
tuidemo: tuidemo.o tui.o
$(LINK) tui.o tuidemo.o -o $@ $(LDFLAGS)
worm: worm.o
$(LINK) worm.o -o $@ $(LDFLAGS)
xmas: xmas.o
$(LINK) xmas.o -o $@ $(LDFLAGS)
firework.o: $(demodir)/firework.c
$(BUILD) $(demodir)/firework.c
newdemo.o: $(demodir)/newdemo.c
$(BUILD) $(demodir)/newdemo.c
ptest.o: $(demodir)/ptest.c $(PDCURSES_SRCDIR)/panel.h
$(BUILD) $(demodir)/ptest.c
rain.o: $(demodir)/rain.c
$(BUILD) $(demodir)/rain.c
testcurs.o: $(demodir)/testcurs.c
$(BUILD) $(demodir)/testcurs.c
tui.o: $(demodir)/tui.c $(demodir)/tui.h
$(BUILD) $(demodir)/tui.c
tuidemo.o: $(demodir)/tuidemo.c
$(BUILD) $(demodir)/tuidemo.c
worm.o: $(demodir)/worm.c
$(BUILD) $(demodir)/worm.c
xmas.o: $(demodir)/xmas.c
$(BUILD) $(demodir)/xmas.c
# This section provides for compiling and linking the
# ncurses test programs.
ncurses_testdir = $(HOME)/ncurses-5.6/test
NCURSES_TESTS = bs gdc hanoi knight tclock ncurses
ncurses_tests: $(NCURSES_TESTS)
ncurses_clean:
-rm -f *.o trace $(NCURSES_TESTS)
NCFLAGS = -I. -I$(ncurses_testdir)
bs: bs.o $(LIBCURSES)
$(LINK) bs.o -o $@ $(LDFLAGS)
gdc: gdc.o $(LIBCURSES)
$(LINK) gdc.o -o $@ $(LDFLAGS)
hanoi: hanoi.o $(LIBCURSES)
$(LINK) hanoi.o -o $@ $(LDFLAGS)
knight: knight.o $(LIBCURSES)
$(LINK) knight.o -o $@ $(LDFLAGS)
tclock: tclock.o $(LIBCURSES)
$(LINK) tclock.o -o $@ $(LDFLAGS) -lm
view: view.o $(LIBCURSES)
$(LINK) view.o -o $@ $(LDFLAGS)
ncurses: ncurses.o $(LIBCURSES)
$(LINK) ncurses.o -o $@ $(LDFLAGS)
bs.o: $(ncurses_testdir)/bs.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/bs.c
gdc.o: $(ncurses_testdir)/gdc.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/gdc.c
hanoi.o: $(ncurses_testdir)/hanoi.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/hanoi.c
knight.o: $(ncurses_testdir)/knight.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/knight.c
tclock.o: $(ncurses_testdir)/tclock.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/tclock.c
view.o: $(ncurses_testdir)/view.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/view.c
ncurses.o: $(ncurses_testdir)/ncurses.c $(PDCURSES_CURSES_H)
$(BUILD) $(NCFLAGS) $(ncurses_testdir)/ncurses.c

View File

@@ -0,0 +1,64 @@
PDCurses for X11
================
This is a port of PDCurses for X11, aka XCurses. It is designed to
allow existing curses programs to be re-compiled with PDCurses,
resulting in native X11 programs.
Building
--------
. Run "./configure" in the top-level directory.
To build the wide-character version of the library, specify
"--enable-widec" as a parameter. To use X Input Methods, add
"--enable-xim". I recommend these options, but I haven't yet made
them the defaults, for the sake of backwards compatibility and due to
their new and relatively untested status.
If your system is lacking in UTF-8 support, you can force the use of
UTF-8 instead of the system locale via "--enable-force-utf8". This is
generally more useful in Windows.
If configure can't find your X include files or X libraries, you can
specify the paths with the arguments "--x-includes=inc_path" and/or
"--x-libraries=lib_path".
By default, the library and demo programs are built with the optimizer
switch -O2. You can turn this off, and turn on debugging (-g), by
adding "--with-debug" to the configure command.
. Run "make". This should build libXCurses and all the demo programs.
. Optionally, run "make install". curses.h and panel.h will be renamed
when installed (to xcurses.h and xpanel.h), to avoid conflicts with
any existing curses installations. Unrenamed copies of curses.h and
panel.h are installed in (by default) /usr/local/include/xcurses.
libXpanel is just a symlink to libXCurses. Both curses and panel
functions are in the main library.
Distribution Status
-------------------
As of April 13, 2006, the files in this directory are released to the
Public Domain, except for ScrollBox*, which are under essentially the
MIT X License.
To be Done
----------
- have newterm() create a new X window
- provide a command line parsing function to enable X command line
arguments to be parsed and stripped from the arguments passed back
to the calling procedure.
Acknowledgements
----------------
X11 port was provided by Mark Hessling <mark@rexx.org>

View File

@@ -0,0 +1,321 @@
/*
* Copyright 1989 O'Reilly and Associates, Inc.
The X Consortium, and any party obtaining a copy of these files from
the X Consortium, directly or indirectly, is granted, free of charge, a
full and unrestricted irrevocable, world-wide, paid up, royalty-free,
nonexclusive right and license to deal in this software and
documentation files (the "Software"), including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons who receive
copies from any such party to do so. This license includes without
limitation a license to do the foregoing actions under any patents of
the party supplying this software to the X Consortium.
$Id: ScrollBox.c,v 1.15 2008/07/14 04:24:52 wmcbrine Exp $
*/
/* ScrollBox.c - scrollBox composite widget */
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include "x11/ScrollBoxP.h"
#include <stdio.h>
#define INITIAL_WIDTH 300
#define INITIAL_HEIGHT 300
/************************************************************************
* *
* scrollBox Resources *
* *
************************************************************************/
static XtResource resources[] =
{
{ XtNhSpace, XtCHSpace, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.h_space),
XtRImmediate, (XtPointer)4 },
{ XtNvSpace, XtCVSpace, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.v_space),
XtRImmediate, (XtPointer)4 },
{ XtNheightInc, XtCHeightInc, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.increment_height),
XtRImmediate, (XtPointer)13 },
{ XtNwidthInc, XtCWidthInc, XtRDimension, sizeof(Dimension),
XtOffset(ScrollBoxWidget, scrollBox.increment_width),
XtRImmediate, (XtPointer)7 },
};
/************************************************************************
* *
* Full class record constant *
* *
************************************************************************/
static void Initialize(Widget, Widget, ArgList, Cardinal *);
static void Resize(Widget);
static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *);
static void ChangeManaged(Widget);
static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *,
XtWidgetGeometry *);
static XtGeometryResult GeometryManager(Widget, XtWidgetGeometry *,
XtWidgetGeometry *);
static void RefigureLocations(Widget);
ScrollBoxClassRec scrollBoxClassRec = {
{
/* core_class fields */
/* superclass */ (WidgetClass) &compositeClassRec,
/* class_name */ "scrollBox",
/* widget_size */ sizeof(ScrollBoxRec),
/* class_initialize */ NULL,
/* class_part_init */ NULL,
/* class_inited */ FALSE,
/* initialize */ Initialize,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* num_resources */ XtNumber(resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ NULL,
/* resize */ Resize,
/* expose */ NULL,
/* set_values */ SetValues,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ NULL,
/* query_geometry */ QueryGeometry,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},{
/* composite_class fields */
/* geometry_manager */ GeometryManager,
/* change_managed */ ChangeManaged,
/* insert_child */ XtInheritInsertChild,
/* delete_child */ XtInheritDeleteChild,
/* extension */ NULL
},{
/* scrollBox class fields */
/* empty */ 0,
}
};
WidgetClass scrollBoxWidgetClass = (WidgetClass)&scrollBoxClassRec;
/************************************************************************
* *
* Private Routines *
* *
************************************************************************/
/* Do a layout, either actually assigning positions, or just
calculating size. */
static void DoLayout(Widget w, Boolean doit)
{
ScrollBoxWidget sbw = (ScrollBoxWidget)w;
Widget wmain, vscroll, hscroll, child;
Dimension mw, mh; /* main window */
Dimension vh; /* vertical scrollbar length (height) */
Dimension hw; /* horizontal scrollbar length (width) */
Position vx;
Position hy;
Cardinal i;
if (sbw->composite.num_children != 3)
XtAppError(XtWidgetToApplicationContext(w),
"ScrollBox: must manage exactly three widgets.");
for (i = 0; i < sbw->composite.num_children; i++)
{
child = sbw->composite.children[i];
if (!XtIsManaged(child))
XtAppError(XtWidgetToApplicationContext(w),
"ScrollBox: all three widgets must be managed.");
}
/* Child one is the main window, two is the vertical scrollbar,
and three is the horizontal scrollbar. */
wmain = sbw->composite.children[0];
vscroll = sbw->composite.children[1];
hscroll = sbw->composite.children[2];
/* Size all three widgets so that space is fully utilized. */
mw = sbw->core.width - (2 * sbw->scrollBox.h_space) -
vscroll->core.width - (2 * vscroll->core.border_width) -
(2 * wmain->core.border_width);
mh = sbw->core.height - (2 * sbw->scrollBox.v_space) -
hscroll->core.height - (2 * hscroll->core.border_width) -
(2 * wmain->core.border_width);
/* Force the main window to be sized to the appropriate increment. */
mw = (mw / sbw->scrollBox.increment_width) *
sbw->scrollBox.increment_width;
mh = ((mh / sbw->scrollBox.increment_height) *
sbw->scrollBox.increment_height) +
sbw->scrollBox.increment_height;
vx = wmain->core.x + mw + sbw->scrollBox.h_space +
wmain->core.border_width + vscroll->core.border_width;
hy = wmain->core.y + mh + sbw->scrollBox.v_space +
wmain->core.border_width + hscroll->core.border_width;
vh = mh; /* scrollbars are always same length as main window */
hw = mw;
if (doit)
{
XtResizeWidget(wmain, mw, mh, 1);
XtResizeWidget(vscroll, vscroll->core.width, vh, 1);
XtMoveWidget(vscroll, vx, vscroll->core.y);
XtResizeWidget(hscroll, hw, hscroll->core.height, 1);
XtMoveWidget(hscroll, hscroll->core.x, hy);
}
}
static XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *request,
XtWidgetGeometry *reply)
{
XtWidgetGeometry allowed;
if (request->request_mode & ~(XtCWQueryOnly | CWWidth | CWHeight))
return XtGeometryNo;
if (request->request_mode & CWWidth)
allowed.width = request->width;
else
allowed.width = w->core.width;
if (request->request_mode & CWHeight)
allowed.height = request->height;
else
allowed.height = w->core.height;
if (allowed.width == w->core.width && allowed.height == w->core.height)
return XtGeometryNo;
if (!(request->request_mode & XtCWQueryOnly))
RefigureLocations(w);
return XtGeometryYes;
}
static void RefigureLocations(Widget w)
{
DoLayout(w, False);
}
/* Calculate preferred size. We can't just use the current sizes
of the children, because that calculation would always end up with
our current size. Could query each child, and use that size to
recalculate a size for us, then if it ends up being larger than width
and height passed in, accept bounding box. However, we know our
children and they don't have any particular preferred geometry,
except the bigger the better. Therefore, if the parent suggested a
size, we'll take it. */
static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request,
XtWidgetGeometry *reply_return)
{
XtGeometryResult result=XtGeometryNo;
request->request_mode &= CWWidth | CWHeight;
/* parent isn't going to change w or h, so nothing to re-compute */
if (request->request_mode == 0)
return XtGeometryYes;
/* if proposed size is large enough, accept it. Otherwise, suggest
our arbitrary initial size. */
if (request->request_mode & CWHeight)
{
if (request->height < INITIAL_HEIGHT)
{
result = XtGeometryAlmost;
reply_return->height = INITIAL_HEIGHT;
reply_return->request_mode &= CWHeight;
}
else
result = XtGeometryYes;
}
if (request->request_mode & CWWidth)
{
if (request->width < INITIAL_WIDTH)
{
result = XtGeometryAlmost;
reply_return->width = INITIAL_WIDTH;
reply_return->request_mode &= CWWidth;
}
else
result = XtGeometryYes;
}
return result;
}
/* Actually layout the scrollBox */
static void Resize(Widget w)
{
DoLayout(w, True);
}
static void ChangeManaged(Widget w)
{
DoLayout(w, True);
}
static void Initialize(Widget request, Widget new,
ArgList args, Cardinal *num_args)
{
ScrollBoxWidget newsbw = (ScrollBoxWidget)new;
if (newsbw->core.width == 0)
newsbw->core.width = INITIAL_WIDTH;
if (newsbw->core.height == 0)
newsbw->core.height = INITIAL_HEIGHT;
}
static Boolean SetValues(Widget current, Widget request, Widget new,
ArgList args, Cardinal *num_args)
{
ScrollBoxWidget sbwcurrent = (ScrollBoxWidget)current;
ScrollBoxWidget sbwnew = (ScrollBoxWidget)new;
/* need to relayout if h_space or v_space change */
if ((sbwnew->scrollBox.h_space != sbwcurrent->scrollBox.h_space) ||
(sbwnew->scrollBox.v_space != sbwcurrent->scrollBox.v_space))
DoLayout(new, True);
return False;
}

View File

@@ -0,0 +1,53 @@
/*
* Copyright 1989 O'Reilly and Associates, Inc.
The X Consortium, and any party obtaining a copy of these files from
the X Consortium, directly or indirectly, is granted, free of charge, a
full and unrestricted irrevocable, world-wide, paid up, royalty-free,
nonexclusive right and license to deal in this software and
documentation files (the "Software"), including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons who receive
copies from any such party to do so. This license includes without
limitation a license to do the foregoing actions under any patents of
the party supplying this software to the X Consortium.
$Id: ScrollBox.h,v 1.4 2008/07/14 04:24:52 wmcbrine Exp $
*/
#ifndef _XORAscrollBox_h
#define _XORAscrollBox_h
/************************************************************************
* *
* scrollBox Widget (subclass of CompositeClass) *
* *
************************************************************************/
/* Parameters:
Name Class RepType Default Value
---- ----- ------- -------------
background Background Pixel XtDefaultBackground
border BorderColor Pixel XtDefaultForeground
borderWidth BorderWidth Dimension 1
destroyCallback Callback Pointer NULL
hSpace HSpace Dimension 4
height Height Dimension 0
mappedWhenManaged MappedWhenManaged Boolean True
vSpace VSpace Dimension 4
width Width Dimension 0
x Position Position 0
y Position Position 0
*/
/* Class record constants */
extern WidgetClass scrollBoxWidgetClass;
typedef struct _ScrollBoxClassRec *ScrollBoxWidgetClass;
typedef struct _ScrollBoxRec *ScrollBoxWidget;
#endif /* _XORAscrollBox_h */

View File

@@ -0,0 +1,72 @@
/*
* Copyright 1989 O'Reilly and Associates, Inc.
The X Consortium, and any party obtaining a copy of these files from
the X Consortium, directly or indirectly, is granted, free of charge, a
full and unrestricted irrevocable, world-wide, paid up, royalty-free,
nonexclusive right and license to deal in this software and
documentation files (the "Software"), including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons who receive
copies from any such party to do so. This license includes without
limitation a license to do the foregoing actions under any patents of
the party supplying this software to the X Consortium.
$Id: ScrollBoxP.h,v 1.5 2008/07/14 04:24:52 wmcbrine Exp $
*/
/*
* scrollBoxP.h - Private definitions for scrollBox widget
*
*/
#ifndef _XORAscrollBoxP_h
#define _XORAscrollBoxP_h
/************************************************************************
* *
* scrollBox Widget Private Data *
* *
************************************************************************/
#include "x11/ScrollBox.h"
#include <X11/CompositeP.h>
/* New fields for the scrollBox widget class record */
typedef struct _ScrollBoxClass {
int empty;
} ScrollBoxClassPart;
/* Full class record declaration */
typedef struct _ScrollBoxClassRec {
CoreClassPart core_class;
CompositeClassPart composite_class;
ScrollBoxClassPart scrollBox_class;
} ScrollBoxClassRec;
extern ScrollBoxClassRec scrollBoxClassRec;
/* New fields for the scrollBox widget record */
typedef struct {
Dimension h_space, v_space;
Dimension preferred_width, preferred_height;
Dimension last_query_width, last_query_height;
Dimension increment_width, increment_height;
XtGeometryMask last_query_mode;
} ScrollBoxPart;
/************************************************************************
* *
* Full instance record declaration *
* *
************************************************************************/
typedef struct _ScrollBoxRec {
CorePart core;
CompositePart composite;
ScrollBoxPart scrollBox;
} ScrollBoxRec;
#endif /* _XORAscrollBoxP_h */

View File

@@ -0,0 +1,46 @@
#define big_icon_width 64
#define big_icon_height 64
static unsigned char big_icon_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, 0xf0, 0xff,
0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xc1, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0xff, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0xc7, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x80, 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80,
0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 0xc7, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x80, 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0,
0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe0, 0xc3, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0xf0, 0xe3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8,
0xf1, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0xf8, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x7e, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f,
0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0xff, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x8f, 0xdf, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc7,
0xcf, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe3, 0xc7, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0xf1, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0,
0xc1, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8, 0xc0, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x78, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78,
0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78, 0xc0, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x78, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8,
0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xff, 0x03, 0x00, 0x00,
0x00, 0x00, 0xf0, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe0,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0xff, 0x03, 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, 0xc0, 0x23, 0x50, 0x1e,
0x7c, 0xf0, 0xe0, 0x03, 0x60, 0x26, 0x50, 0x33, 0xc6, 0x98, 0x31, 0x06,
0x30, 0x2c, 0xd0, 0x61, 0x83, 0x0d, 0x1b, 0x0c, 0x10, 0x28, 0xd0, 0x40,
0x01, 0x05, 0x0a, 0x08, 0x10, 0x20, 0x50, 0x00, 0x01, 0x05, 0x0a, 0x08,
0x10, 0x20, 0x50, 0x00, 0x03, 0x04, 0x1a, 0x00, 0x10, 0x20, 0x50, 0x00,
0x06, 0x04, 0x32, 0x00, 0x10, 0x20, 0x50, 0x00, 0x7c, 0xfc, 0xe3, 0x03,
0x10, 0x20, 0x50, 0x00, 0xc0, 0x04, 0x00, 0x06, 0x10, 0x20, 0x50, 0x00,
0x80, 0x05, 0x00, 0x0c, 0x10, 0x20, 0x50, 0x00, 0x01, 0x05, 0x0a, 0x08,
0x10, 0x28, 0x50, 0x00, 0x01, 0x05, 0x0a, 0x08, 0x30, 0x6c, 0x58, 0x00,
0x83, 0x0d, 0x1b, 0x0c, 0x60, 0xc6, 0x4c, 0x00, 0xc6, 0x98, 0x31, 0x06,
0xc0, 0x83, 0x47, 0x00, 0x7c, 0xf0, 0xe0, 0x03, 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};

View File

@@ -0,0 +1,203 @@
/* Public Domain Curses */
/* $Id: compose.h,v 1.3 2008/07/14 04:24:52 wmcbrine Exp $ */
/* Tables and variables for the built-in compose key system. This file
is not included when PDCurses is built with XIM support. */
#define MAX_COMPOSE_CHARS 14
#define MAX_COMPOSE_PRE 60
static const char *compose_chars =
"`'~^,/\"AaPpSs!?0123CcRr-_<>Xx.=Yy |EeIiOoUu+NnLlgDd:*TtMmVv";
/*
` : À È Ì Ò Ù à è ì ò ù
' : ´ Á É Í Ó Ú Ý á é í ó ú ý ´
~ : Ã Ñ Õ ã ñ õ
^ : Â Ê Î Ô Û â ê î ô û ° ¹ ² ³
, : ¸ Ç ç ¸
/ : Ø ø µ µ
" : ¨ Ä Ë Ï Ö Ü ä ë ï ö ü ÿ ¨
A : Æ À Á Ã Â Å Å Ã Â ª
a : æ à á ã â å å ã â ª
P : Þ ¶ ¶
p : þ ¶ ¶
S : § § § º ª
s : ß § ª ¹ ² ³ º §
! : ¡ ¡
? : ¿ ¿
0 : ° °
1 : ¹ ½ ¼ ¹
2 : ² ²
3 : ³ ¾ ³
C : © Ç ¢ ¢
c : ¢ © ç ¢ ¢
R : ®
r : ®
- : ­ ± ¬ ­ ¯ ÷
_ : ¯ ¯
< : «
> : «
X : ¤ ×
x : × ¤ ×
. : · · ·
= : ¥ ¥
Y : ¥ Ý ¥
y : ¥ ý ÿ ¥ ¥
:
| : ¦ ¢ ¦ Þ þ ¦ £
E : È É Ê Ë Ê
e : è é ê ë ê
I : Ì Í Î Ï Î
i : ì í î ï î
O : Ò Ó Ô Õ Ö Ø © ® Õ Ô Å å
o : ° Å å ¤ õ ò ó ô õ ö ø ô º
U : Ù Ú Û Ü Û
u : ù ú û ü µ û
+ : ±
N : Ñ Ñ ¬
n : ñ ñ ¬
L : £ £ £
l : £ £ £
g : ¤
D : ° Ð
d : ° ð
: : ÷
* : µ µ å Å
T : Þ
t : þ
M : ×
m : ×
V : ¦
v : ¦
*/
static const char compose_lookups[MAX_COMPOSE_PRE][MAX_COMPOSE_CHARS] =
{
/* ` */ {'A','E','I','O','U','a','e','i','o','u', 0, 0, 0, 0},
/* ' */ {' ','A','E','I','O','U','Y','a','e','i','o','u','y', 39},
/* ~ */ {'A','N','O','a','n','o', 0, 0, 0, 0, 0, 0, 0, 0},
/* ^ */ {'A','E','I','O','U','a','e','i','o','u','0','1','2','3'},
/* , */ {' ','C','c',',', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* / */ {'O','o','u','U', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* " */ {' ','A','E','I','O','U','a','e','i','o','u','y','\"', 0},
/* A */ {'E','`', 39,'~','^','"','o','*','-','>','_', 0, 0, 0},
/* a */ {'e','`', 39,'~','^','"','o','*','-','>','_', 0, 0, 0},
/* P */ {' ','G','!', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* p */ {' ','g','!', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* S */ {'S','!','O','0','A', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* s */ {'s','!','a','1','2','3','0','o', 0, 0, 0, 0, 0, 0},
/* ! */ {' ','!', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* ? */ {' ','?', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 0 */ {'^','*', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 1 */ {' ','2','4','^', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 2 */ {' ','^', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 3 */ {' ','4','^', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* C */ {'O',',','$','|', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* c */ {'|','o',',','/','$', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* R */ {'O', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* r */ {'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* - */ {' ','+',',','-','^',':', 0, 0, 0, 0, 0, 0, 0, 0},
/* _ */ {'_','^', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* < */ {'<', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* > */ {'>', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* X */ {'O','X', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* x */ {' ','o','x', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* . */ {' ','^','.', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* = */ {'Y','y', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* Y */ {'=', 39,'-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* y */ {'=', 39,'"','$','-', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* */ {' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* | */ {' ','c','|','P','p','^','-', 0, 0, 0, 0, 0, 0, 0},
/* E */ {'`', 39,'^','"','>', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* e */ {'`', 39,'^','"','>', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* I */ {'`', 39,'^','"','>', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* i */ {'`', 39,'^','"','>', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* O */ {'`', 39,'^','~','"','/','C','R','-','>','A','a', 0, 0},
/* o */ {' ','A','a','x','-','`', 39,'^','~','"','/','>','_', 0},
/* U */ {'`', 39,'^','"','>', 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* u */ {'`', 39,'^','"',' ','>', 0, 0, 0, 0, 0, 0, 0, 0},
/* + */ {'-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* N */ {'~','-','O', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* n */ {'~','-','o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* L */ {'$','=','-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* l */ {'$','=','-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* g */ {'$', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* D */ {'E','-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* d */ {'e','-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* : */ {'-', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* * */ {'m','M','a','A', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* T */ {'H', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* t */ {'h', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* M */ {'U', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* m */ {'u', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* V */ {'B', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* v */ {'b', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};
static const unsigned char compose_keys[MAX_COMPOSE_PRE][MAX_COMPOSE_CHARS] =
{
/* ` */ {192,200,204,210,217,224,232,236,242,249, 0, 0, 0, 0},
/* ' */ {180,193,201,205,211,218,221,225,233,237,243,250,253,180},
/* ~ */ {195,209,213,227,241,245, 0, 0, 0, 0, 0, 0, 0, 0},
/* ^ */ {194,202,206,212,219,226,234,238,244,251,176,185,178,179},
/* , */ {184,199,231,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* / */ {216,248,181,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* " */ {168,196,203,207,214,220,228,235,239,246,252,255,168, 0},
/* A */ {198,192,193,195,194,196,197,197,195,194,170, 0, 0, 0},
/* a */ {230,224,225,227,226,228,229,229,227,226,170, 0, 0, 0},
/* P */ {222,182,182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* p */ {254,182,182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* S */ {167,167,167,186,170, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* s */ {223,167,170,185,178,179,186,167, 0, 0, 0, 0, 0, 0},
/* ! */ {161,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* ? */ {191,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 0 */ {176,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 1 */ {185,189,188,185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 2 */ {178,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* 3 */ {179,190,179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* C */ {169,199,162,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* c */ {162,169,231,162,162, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* R */ {174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* r */ {174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* - */ {173,177,172,173,175,247, 0, 0, 0, 0, 0, 0, 0, 0},
/* _ */ {175,175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* < */ {171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* > */ {187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* X */ {164,215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* x */ {215,164,215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* . */ {183,183,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* = */ {165,165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* Y */ {165,221,165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* y */ {165,253,255,165,165, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* */ {160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* | */ {166,162,166,222,254,166,163, 0, 0, 0, 0, 0, 0, 0},
/* E */ {200,201,202,203,202, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* e */ {232,233,234,235,234, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* I */ {204,205,206,207,206, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* i */ {236,237,238,239,238, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* O */ {210,211,212,213,214,216,169,174,213,212,197,229, 0, 0},
/* o */ {176,197,229,164,245,242,243,244,245,246,248,244,186, 0},
/* U */ {217,218,219,220,219, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* u */ {249,250,251,252,181,251, 0, 0, 0, 0, 0, 0, 0, 0},
/* + */ {177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* N */ {209,209,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* n */ {241,241,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* L */ {163,163,163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* l */ {163,163,163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* g */ {164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* D */ {176,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* d */ {176,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* : */ {247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* * */ {181,181,229,197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* T */ {222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* t */ {254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* M */ {215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* u */ {215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* V */ {166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/* v */ {166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};
static KeySym compose_key = 0;
static int compose_mask = 0;

View File

@@ -0,0 +1,14 @@
#define little_icon_width 32
#define little_icon_height 32
static unsigned char little_icon_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0x30, 0x00, 0x00, 0xfc, 0x31, 0x00, 0x00, 0x8c, 0x33, 0x00,
0x00, 0x0c, 0x33, 0x00, 0x00, 0x0c, 0x33, 0x00, 0x00, 0x8c, 0x33, 0x00,
0x00, 0xcc, 0x39, 0x00, 0x00, 0xec, 0x3c, 0x00, 0x00, 0x7c, 0x3e, 0x00,
0x00, 0x3c, 0x37, 0x00, 0x00, 0x9c, 0x33, 0x00, 0x00, 0xcc, 0x31, 0x00,
0x00, 0xcc, 0x30, 0x00, 0x00, 0xcc, 0x30, 0x00, 0x00, 0xcc, 0x31, 0x00,
0x00, 0x8c, 0x3f, 0x00, 0x00, 0x0c, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4c, 0x2a, 0xc6, 0x18, 0x52, 0x5a, 0x29, 0x25,
0x42, 0x0a, 0x21, 0x05, 0x42, 0x0a, 0xe6, 0x18, 0x42, 0x0a, 0x28, 0x20,
0x52, 0x0a, 0x29, 0x25, 0x8c, 0x09, 0xc6, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

View File

@@ -0,0 +1,47 @@
/* $Id: ncurses_cfg.h,v 1.8 2006/12/28 01:02:03 wmcbrine Exp $
*
* This file is only used with the ncurses test programs.
*
* Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build
* it), or edit ncurses_testdir appropriately in the Makefile. Configure
* and build PDCurses for X11. (Sorry, other ports won't work yet.)
* Change to this directory, and:
*
* "make ncurses_tests" to start.
* "make ncurses_clean" when you're done.
*
* Builds: bs gdc hanoi knight tclock ncurses
*/
#define NCURSES_MOUSE_VERSION 2
#include "../config.h"
#include <curses.h>
#define ExitProgram exit
#define HAVE_CURSES_VERSION 1
#define HAVE_GETBEGX 1
#define HAVE_GETCURX 1
#define HAVE_GETMAXX 1
#define HAVE_GETNSTR 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETWIN 1
#define HAVE_LIBPANEL 1
#define HAVE_LOCALE_H 1
#define HAVE_NAPMS 1
#define HAVE_PANEL_H 1
#define HAVE_PUTWIN 1
#define HAVE_SLK_COLOR 1
#define HAVE_SLK_INIT 1
#define HAVE_WRESIZE 1
#ifdef PDC_WIDE
# define USE_WIDEC_SUPPORT 1
#endif
/* Fool ncurses.c so it gives us all the tests, and doesn't redefine
ACS_ chars
*/
#define NCURSES_VERSION PDCURSES

View File

@@ -0,0 +1,170 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcclip.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $")
#include <stdlib.h>
/*man-start**************************************************************
Name: clipboard
Synopsis:
int PDC_getclipboard(char **contents, long *length);
int PDC_setclipboard(const char *contents, long length);
int PDC_freeclipboard(char *contents);
int PDC_clearclipboard(void);
Description:
PDC_getclipboard() gets the textual contents of the system's
clipboard. This function returns the contents of the clipboard
in the contents argument. It is the responsibilitiy of the
caller to free the memory returned, via PDC_freeclipboard().
The length of the clipboard contents is returned in the length
argument.
PDC_setclipboard copies the supplied text into the system's
clipboard, emptying the clipboard prior to the copy.
PDC_clearclipboard() clears the internal clipboard.
Return Values:
indicator of success/failure of call.
PDC_CLIP_SUCCESS the call was successful
PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for
the clipboard contents
PDC_CLIP_EMPTY the clipboard contains no text
PDC_CLIP_ACCESS_ERROR no clipboard support
Portability X/Open BSD SYS V
PDC_getclipboard - - -
PDC_setclipboard - - -
PDC_freeclipboard - - -
PDC_clearclipboard - - -
**man-end****************************************************************/
int PDC_getclipboard(char **contents, long *length)
{
#ifdef PDC_WIDE
wchar_t *wcontents;
#endif
int result = 0;
int len;
PDC_LOG(("PDC_getclipboard() - called\n"));
XCursesInstructAndWait(CURSES_GET_SELECTION);
if (XC_read_socket(xc_display_sock, &result, sizeof(int)) < 0)
XCursesExitCursesProcess(5, "exiting from PDC_getclipboard");
if (result == PDC_CLIP_SUCCESS)
{
if (XC_read_socket(xc_display_sock, &len, sizeof(int)) < 0)
XCursesExitCursesProcess(5, "exiting from PDC_getclipboard");
#ifdef PDC_WIDE
wcontents = malloc((len + 1) * sizeof(wchar_t));
*contents = malloc(len * 3 + 1);
if (!wcontents || !*contents)
#else
*contents = malloc(len + 1);
if (!*contents)
#endif
XCursesExitCursesProcess(6, "exiting from PDC_getclipboard - "
"synchronization error");
if (len)
{
if (XC_read_socket(xc_display_sock,
#ifdef PDC_WIDE
wcontents, len * sizeof(wchar_t)) < 0)
#else
*contents, len) < 0)
#endif
XCursesExitCursesProcess(5, "exiting from PDC_getclipboard");
}
#ifdef PDC_WIDE
wcontents[len] = 0;
len = PDC_wcstombs(*contents, wcontents, len * 3);
free(wcontents);
#endif
(*contents)[len] = '\0';
*length = len;
}
return result;
}
int PDC_setclipboard(const char *contents, long length)
{
#ifdef PDC_WIDE
wchar_t *wcontents;
#endif
int rc;
PDC_LOG(("PDC_setclipboard() - called\n"));
#ifdef PDC_WIDE
wcontents = malloc((length + 1) * sizeof(wchar_t));
if (!wcontents)
return PDC_CLIP_MEMORY_ERROR;
length = PDC_mbstowcs(wcontents, contents, length);
#endif
XCursesInstruct(CURSES_SET_SELECTION);
/* Write, then wait for X to do its stuff; expect return code. */
if (XC_write_socket(xc_display_sock, &length, sizeof(long)) >= 0)
{
if (XC_write_socket(xc_display_sock,
#ifdef PDC_WIDE
wcontents, length * sizeof(wchar_t)) >= 0)
{
free(wcontents);
#else
contents, length) >= 0)
{
#endif
if (XC_read_socket(xc_display_sock, &rc, sizeof(int)) >= 0)
return rc;
}
}
XCursesExitCursesProcess(5, "exiting from PDC_setclipboard");
return PDC_CLIP_ACCESS_ERROR; /* not reached */
}
int PDC_freeclipboard(char *contents)
{
PDC_LOG(("PDC_freeclipboard() - called\n"));
free(contents);
return PDC_CLIP_SUCCESS;
}
int PDC_clearclipboard(void)
{
int rc;
long len = 0;
PDC_LOG(("PDC_clearclipboard() - called\n"));
XCursesInstruct(CURSES_CLEAR_SELECTION);
/* Write, then wait for X to do its stuff; expect return code. */
if (XC_write_socket(xc_display_sock, &len, sizeof(long)) >= 0)
if (XC_read_socket(xc_display_sock, &rc, sizeof(int)) >= 0)
return rc;
XCursesExitCursesProcess(5, "exiting from PDC_clearclipboard");
return PDC_CLIP_ACCESS_ERROR; /* not reached */
}

View File

@@ -0,0 +1,132 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcdisp.c,v 1.46 2008/07/14 04:24:52 wmcbrine Exp $")
#include <string.h>
#ifdef CHTYPE_LONG
# define A(x) ((chtype)x | A_ALTCHARSET)
chtype acs_map[128] =
{
A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10),
A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19),
A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(',
')', '*',
# ifdef PDC_WIDE
0x2192, 0x2190, 0x2191, 0x2193,
# else
'>', '<', '^', 'v',
# endif
'/',
# ifdef PDC_WIDE
0x2588,
# else
A(0),
# endif
'1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=',
'>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
# ifdef PDC_WIDE
0x2666, 0x2592,
# else
A(1), A(2),
# endif
'b', 'c', 'd', 'e',
# ifdef PDC_WIDE
0x00b0, 0x00b1, 0x2591, 0x00a4, 0x2518, 0x2510, 0x250c, 0x2514,
0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524,
0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3,
0x00b7,
# else
A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16),
A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25),
A(26), A(27), A(28), A(29), A(30), 0xb7,
# endif
A(127)
};
# undef A
#endif
int PDC_display_cursor(int oldrow, int oldcol, int newrow, int newcol,
int visibility)
{
char buf[30];
int idx, pos;
PDC_LOG(("%s:PDC_display_cursor() - called: NEW row %d col %d, vis %d\n",
XCLOGMSG, newrow, newcol, visibility));
if (visibility == -1)
{
/* Only send the CURSES_DISPLAY_CURSOR message, no data */
idx = CURSES_DISPLAY_CURSOR;
memcpy(buf, &idx, sizeof(int));
idx = sizeof(int);
}
else
{
idx = CURSES_CURSOR;
memcpy(buf, &idx, sizeof(int));
idx = sizeof(int);
pos = oldrow + (oldcol << 8);
memcpy(buf + idx, &pos, sizeof(int));
idx += sizeof(int);
pos = newrow + (newcol << 8);
memcpy(buf + idx, &pos, sizeof(int));
idx += sizeof(int);
}
if (XC_write_socket(xc_display_sock, buf, idx) < 0)
XCursesExitCursesProcess(1, "exiting from PDC_display_cursor");
return OK;
}
/* position hardware cursor at (y, x) */
void PDC_gotoyx(int row, int col)
{
PDC_LOG(("PDC_gotoyx() - called: row %d col %d\n", row, col));
PDC_display_cursor(SP->cursrow, SP->curscol, row, col, SP->visibility);
}
/* update the given physical line to look like the corresponding line in
curscr */
void PDC_transform_line(int lineno, int x, int len, const chtype *srcp)
{
PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno));
XC_get_line_lock(lineno);
memcpy(Xcurscr + XCURSCR_Y_OFF(lineno) + (x * sizeof(chtype)), srcp,
len * sizeof(chtype));
*(Xcurscr + XCURSCR_START_OFF + lineno) = x;
*(Xcurscr + XCURSCR_LENGTH_OFF + lineno) = len;
XC_release_line_lock(lineno);
XCursesInstructAndWait(CURSES_REFRESH);
}

View File

@@ -0,0 +1,30 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcgetsc.c,v 1.26 2008/07/14 04:24:52 wmcbrine Exp $")
/* return width of screen/viewport */
int PDC_get_columns(void)
{
PDC_LOG(("PDC_get_columns() - called\n"));
return XCursesCOLS;
}
/* get the cursor size/shape */
int PDC_get_cursor_mode(void)
{
return 0;
}
/* return number of screen rows */
int PDC_get_rows(void)
{
PDC_LOG(("PDC_get_rows() - called\n"));
return XCursesLINES;
}

View File

@@ -0,0 +1,102 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdckbd.c,v 1.62 2008/07/14 04:24:52 wmcbrine Exp $")
/*man-start**************************************************************
Name: pdckbd
Synopsis:
unsigned long PDC_get_input_fd(void);
Description:
PDC_get_input_fd() returns the file descriptor that PDCurses
reads its input from. It can be used for select().
Portability X/Open BSD SYS V
PDC_get_input_fd - - -
**man-end****************************************************************/
/* check if a key or mouse event is waiting */
bool PDC_check_key(void)
{
struct timeval socket_timeout = {0};
int s;
/* Is something ready to be read on the socket ? Must be a key. */
FD_ZERO(&xc_readfds);
FD_SET(xc_key_sock, &xc_readfds);
if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL,
NULL, &socket_timeout)) < 0)
XCursesExitCursesProcess(3, "child - exiting from "
"PDC_check_key select failed");
PDC_LOG(("%s:PDC_check_key() - returning %s\n", XCLOGMSG,
s ? "TRUE" : "FALSE"));
return !!s;
}
/* return the next available key or mouse event */
int PDC_get_key(void)
{
unsigned long newkey = 0;
int key = 0;
if (XC_read_socket(xc_key_sock, &newkey, sizeof(unsigned long)) < 0)
XCursesExitCursesProcess(2, "exiting from PDC_get_key");
pdc_key_modifiers = (newkey >> 24) & 0xFF;
key = (int)(newkey & 0x00FFFFFF);
if (key == KEY_MOUSE && SP->key_code)
{
if (XC_read_socket(xc_key_sock, &pdc_mouse_status,
sizeof(MOUSE_STATUS)) < 0)
XCursesExitCursesProcess(2, "exiting from PDC_get_key");
}
PDC_LOG(("%s:PDC_get_key() - key %d returned\n", XCLOGMSG, key));
return key;
}
unsigned long PDC_get_input_fd(void)
{
PDC_LOG(("PDC_get_input_fd() - called\n"));
return xc_key_sock;
}
void PDC_set_keyboard_binary(bool on)
{
PDC_LOG(("PDC_set_keyboard_binary() - called\n"));
}
/* discard any pending keyboard or mouse input -- this is the core
routine for flushinp() */
void PDC_flushinp(void)
{
PDC_LOG(("PDC_flushinp() - called\n"));
while (PDC_check_key())
PDC_get_key();
}
int PDC_mouse_set(void)
{
return OK;
}
int PDC_modifiers_set(void)
{
return OK;
}

View File

@@ -0,0 +1,150 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcscrn.c,v 1.55 2008/07/14 04:24:52 wmcbrine Exp $")
/* COLOR_PAIR to attribute encoding table. */
short *xc_atrtab = (short *)NULL;
/* close the physical screen */
void PDC_scr_close(void)
{
PDC_LOG(("PDC_scr_close() - called\n"));
}
void PDC_scr_free(void)
{
XCursesExit();
xc_atrtab = (short *)NULL;
}
/* open the physical screen -- allocate SP, miscellaneous intialization */
int PDC_scr_open(int argc, char **argv)
{
extern bool sb_started;
PDC_LOG(("PDC_scr_open() - called\n"));
if ((XCursesInitscr(argc, argv) == ERR) || !SP)
return ERR;
SP->cursrow = SP->curscol = 0;
SP->orig_attr = FALSE;
SP->sb_on = sb_started;
SP->sb_total_y = 0;
SP->sb_viewport_y = 0;
SP->sb_cur_y = 0;
SP->sb_total_x = 0;
SP->sb_viewport_x = 0;
SP->sb_cur_x = 0;
return OK;
}
/* the core of resize_term() */
int PDC_resize_screen(int nlines, int ncols)
{
PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n",
nlines, ncols));
if (nlines || ncols || !SP->resized)
return ERR;
shmdt((char *)Xcurscr);
XCursesInstructAndWait(CURSES_RESIZE);
if ((shmid_Xcurscr = shmget(shmkey_Xcurscr,
SP->XcurscrSize + XCURSESSHMMIN, 0700)) < 0)
{
perror("Cannot allocate shared memory for curscr");
kill(xc_otherpid, SIGKILL);
return ERR;
}
XCursesLINES = SP->lines;
XCursesCOLS = SP->cols;
PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d SP->lines %d "
"SP->cols %d\n", XCLOGMSG, shmid_Xcurscr,
shmkey_Xcurscr, SP->lines, SP->cols));
Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0);
xc_atrtab = (short *)(Xcurscr + XCURSCR_ATRTAB_OFF);
SP->resized = FALSE;
return OK;
}
void PDC_reset_prog_mode(void)
{
PDC_LOG(("PDC_reset_prog_mode() - called.\n"));
}
void PDC_reset_shell_mode(void)
{
PDC_LOG(("PDC_reset_shell_mode() - called.\n"));
}
void PDC_restore_screen_mode(int i)
{
}
void PDC_save_screen_mode(int i)
{
}
void PDC_init_pair(short pair, short fg, short bg)
{
xc_atrtab[pair * 2] = fg;
xc_atrtab[pair * 2 + 1] = bg;
}
int PDC_pair_content(short pair, short *fg, short *bg)
{
*fg = xc_atrtab[pair * 2];
*bg = xc_atrtab[pair * 2 + 1];
return OK;
}
bool PDC_can_change_color(void)
{
return TRUE;
}
int PDC_color_content(short color, short *red, short *green, short *blue)
{
XColor *tmp = (XColor *)(Xcurscr + XCURSCR_XCOLOR_OFF);
tmp->pixel = color;
XCursesInstructAndWait(CURSES_GET_COLOR);
*red = ((double)(tmp->red) * 1000 / 65535) + 0.5;
*green = ((double)(tmp->green) * 1000 / 65535) + 0.5;
*blue = ((double)(tmp->blue) * 1000 / 65535) + 0.5;
return OK;
}
int PDC_init_color(short color, short red, short green, short blue)
{
XColor *tmp = (XColor *)(Xcurscr + XCURSCR_XCOLOR_OFF);
tmp->pixel = color;
tmp->red = ((double)red * 65535 / 1000) + 0.5;
tmp->green = ((double)green * 65535 / 1000) + 0.5;
tmp->blue = ((double)blue * 65535 / 1000) + 0.5;
XCursesInstructAndWait(CURSES_SET_COLOR);
return OK;
}

View File

@@ -0,0 +1,74 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcsetsc.c,v 1.33 2008/07/14 04:24:52 wmcbrine Exp $")
#include <string.h>
/*man-start**************************************************************
Name: pdcsetsc
Synopsis:
int PDC_set_blink(bool blinkon);
void PDC_set_title(const char *title);
Description:
PDC_set_blink() toggles whether the A_BLINK attribute sets an
actual blink mode (TRUE), or sets the background color to high
intensity (FALSE). The default is platform-dependent (FALSE in
most cases). It returns OK if it could set the state to match
the given parameter, ERR otherwise. Current platforms also
adjust the value of COLORS according to this function -- 16 for
FALSE, and 8 for TRUE.
PDC_set_title() sets the title of the window in which the curses
program is running. This function may not do anything on some
platforms. (Currently it only works in Win32 and X11.)
Portability X/Open BSD SYS V
PDC_set_blink - - -
PDC_set_title - - -
**man-end****************************************************************/
int PDC_curs_set(int visibility)
{
int ret_vis = SP->visibility;
PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility));
if (visibility != -1)
SP->visibility = visibility;
PDC_display_cursor(SP->cursrow, SP->curscol, SP->cursrow,
SP->curscol, visibility);
return ret_vis;
}
void PDC_set_title(const char *title)
{
int len;
PDC_LOG(("PDC_set_title() - called:<%s>\n", title));
len = strlen(title) + 1; /* write nul character */
XCursesInstruct(CURSES_TITLE);
if (XC_write_display_socket_int(len) >= 0)
if (XC_write_socket(xc_display_sock, title, len) >= 0)
return;
XCursesExitCursesProcess(1, "exiting from PDC_set_title");
}
int PDC_set_blink(bool blinkon)
{
if (pdc_color_started)
COLORS = 16;
return blinkon ? ERR : OK;
}

View File

@@ -0,0 +1,39 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcutil.c,v 1.10 2008/07/14 04:24:52 wmcbrine Exp $")
#if defined(HAVE_POLL) && !defined(HAVE_USLEEP)
# include <poll.h>
#endif
void PDC_beep(void)
{
PDC_LOG(("PDC_beep() - called\n"));
XCursesInstruct(CURSES_BELL);
}
void PDC_napms(int ms)
{
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
#if defined(HAVE_USLEEP)
usleep(1000 * ms);
#elif defined(HAVE_POLL)
{
struct pollfd fd;
fd.fd = -1;
fd.events = 0;
poll(&fd, 1, ms);
}
#endif
}
const char *PDC_sysname(void)
{
return "X11";
}

View File

@@ -0,0 +1,317 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: pdcx11.c,v 1.96 2008/07/14 04:24:52 wmcbrine Exp $")
#include <errno.h>
#include <stdlib.h>
/*** Functions that are called by both processes ***/
unsigned char *Xcurscr;
int XCursesProcess = 1;
int shmidSP;
int shmid_Xcurscr;
int shmkeySP;
int shmkey_Xcurscr;
int xc_otherpid;
int XCursesLINES = 24;
int XCursesCOLS = 80;
int xc_display_sock;
int xc_key_sock;
int xc_display_sockets[2];
int xc_key_sockets[2];
int xc_exit_sock;
fd_set xc_readfds;
static void _dummy_function(void)
{
}
void XC_get_line_lock(int row)
{
/* loop until we can write to the line -- Patch by:
Georg Fuchs, georg.fuchs@rz.uni-regensburg.de */
while (*(Xcurscr + XCURSCR_FLAG_OFF + row))
_dummy_function();
*(Xcurscr + XCURSCR_FLAG_OFF + row) = 1;
}
void XC_release_line_lock(int row)
{
*(Xcurscr + XCURSCR_FLAG_OFF + row) = 0;
}
int XC_write_socket(int sock_num, const void *buf, int len)
{
int start = 0, rc;
PDC_LOG(("%s:XC_write_socket called: sock_num %d len %d\n",
XCLOGMSG, sock_num, len));
#ifdef MOUSE_DEBUG
if (sock_num == xc_key_sock)
printf("%s:XC_write_socket(key) len: %d\n", XCLOGMSG, len);
#endif
while (1)
{
rc = write(sock_num, buf + start, len);
if (rc < 0 || rc == len)
return rc;
len -= rc;
start = rc;
}
}
int XC_read_socket(int sock_num, void *buf, int len)
{
int start = 0, length = len, rc;
PDC_LOG(("%s:XC_read_socket called: sock_num %d len %d\n",
XCLOGMSG, sock_num, len));
while (1)
{
rc = read(sock_num, buf + start, length);
#ifdef MOUSE_DEBUG
if (sock_num == xc_key_sock)
printf("%s:XC_read_socket(key) rc %d errno %d "
"resized: %d\n", XCLOGMSG, rc, errno, SP->resized);
#endif
if (rc < 0 && sock_num == xc_key_sock && errno == EINTR
&& SP->resized != FALSE)
{
MOUSE_LOG(("%s:continuing\n", XCLOGMSG));
rc = 0;
if (SP->resized > 1)
SP->resized = TRUE;
else
SP->resized = FALSE;
memcpy(buf, &rc, sizeof(int));
return 0;
}
if (rc <= 0 || rc == length)
return rc;
length -= rc;
start = rc;
}
}
int XC_write_display_socket_int(int x)
{
return XC_write_socket(xc_display_sock, &x, sizeof(int));
}
#ifdef PDCDEBUG
void XC_say(const char *msg)
{
PDC_LOG(("%s:%s", XCLOGMSG, msg));
}
#endif
/*** Functions that are called by the "curses" process ***/
int XCursesInstruct(int flag)
{
PDC_LOG(("%s:XCursesInstruct() - called flag %d\n", XCLOGMSG, flag));
/* Send a request to X */
if (XC_write_display_socket_int(flag) < 0)
XCursesExitCursesProcess(4, "exiting from XCursesInstruct");
return OK;
}
int XCursesInstructAndWait(int flag)
{
int result;
XC_LOG(("XCursesInstructAndWait() - called\n"));
/* tell X we want to do something */
XCursesInstruct(flag);
/* wait for X to say the refresh has occurred*/
if (XC_read_socket(xc_display_sock, &result, sizeof(int)) < 0)
XCursesExitCursesProcess(5, "exiting from XCursesInstructAndWait");
if (result != CURSES_CONTINUE)
XCursesExitCursesProcess(6, "exiting from XCursesInstructAndWait"
" - synchronization error");
return OK;
}
static int _setup_curses(void)
{
int wait_value;
XC_LOG(("_setup_curses called\n"));
close(xc_display_sockets[1]);
close(xc_key_sockets[1]);
xc_display_sock = xc_display_sockets[0];
xc_key_sock = xc_key_sockets[0];
FD_ZERO(&xc_readfds);
XC_read_socket(xc_display_sock, &wait_value, sizeof(int));
if (wait_value != CURSES_CHILD)
return ERR;
/* Set LINES and COLS now so that the size of the shared memory
segment can be allocated */
if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700)) < 0)
{
perror("Cannot allocate shared memory for SCREEN");
kill(xc_otherpid, SIGKILL);
return ERR;
}
SP = (SCREEN*)shmat(shmidSP, 0, 0);
XCursesLINES = SP->lines;
LINES = XCursesLINES - SP->linesrippedoff - SP->slklines;
XCursesCOLS = COLS = SP->cols;
if ((shmid_Xcurscr = shmget(shmkey_Xcurscr,
SP->XcurscrSize + XCURSESSHMMIN, 0700)) < 0)
{
perror("Cannot allocate shared memory for curscr");
kill(xc_otherpid, SIGKILL);
return ERR;
}
PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d LINES %d COLS %d\n",
XCLOGMSG, shmid_Xcurscr, shmkey_Xcurscr, LINES, COLS));
Xcurscr = (unsigned char *)shmat(shmid_Xcurscr, 0, 0);
xc_atrtab = (short *)(Xcurscr + XCURSCR_ATRTAB_OFF);
XC_LOG(("cursesprocess exiting from Xinitscr\n"));
/* Always trap SIGWINCH if the C library supports SIGWINCH */
XCursesSetSignal(SIGWINCH, XCursesSigwinchHandler);
atexit(XCursesExit);
return OK;
}
int XCursesInitscr(int argc, char *argv[])
{
int pid, rc;
XC_LOG(("XCursesInitscr() - called\n"));
shmkeySP = getpid();
if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_display_sockets) < 0)
{
fprintf(stderr, "ERROR: cannot create display socketpair\n");
return ERR;
}
if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_key_sockets) < 0)
{
fprintf(stderr, "ERROR: cannot create key socketpair\n");
return ERR;
}
pid = fork();
switch(pid)
{
case -1:
fprintf(stderr, "ERROR: cannot fork()\n");
return ERR;
break;
case 0: /* child */
shmkey_Xcurscr = getpid();
#ifdef XISPARENT
XCursesProcess = 0;
rc = _setup_curses();
#else
XCursesProcess = 1;
xc_otherpid = getppid();
rc = XCursesSetupX(argc, argv);
#endif
break;
default: /* parent */
shmkey_Xcurscr = pid;
#ifdef XISPARENT
XCursesProcess = 1;
xc_otherpid = pid;
rc = XCursesSetupX(argc, argv);
#else
XCursesProcess = 0;
rc = _setup_curses();
#endif
}
return rc;
}
static void _cleanup_curses_process(int rc)
{
PDC_LOG(("%s:_cleanup_curses_process() - called: %d\n", XCLOGMSG, rc));
shutdown(xc_display_sock, 2);
close(xc_display_sock);
shutdown(xc_key_sock, 2);
close(xc_key_sock);
shmdt((char *)SP);
shmdt((char *)Xcurscr);
if (rc)
_exit(rc);
}
void XCursesExitCursesProcess(int rc, char *msg)
{
PDC_LOG(("%s:XCursesExitCursesProcess() - called: %d %s\n",
XCLOGMSG, rc, msg));
endwin();
_cleanup_curses_process(rc);
}
void XCursesExit(void)
{
static bool called = FALSE;
XC_LOG(("XCursesExit() - called\n"));
if (FALSE == called)
{
XCursesInstruct(CURSES_EXIT);
_cleanup_curses_process(0);
called = TRUE;
}
}

View File

@@ -0,0 +1,188 @@
/* Public Domain Curses */
/* $Id: pdcx11.h,v 1.64 2008/07/14 04:24:52 wmcbrine Exp $ */
#include <curspriv.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <signal.h>
#include <ctype.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h> /* AIX needs this for FD_ZERO etc macros */
#endif
#include <sys/ipc.h>
#include <sys/shm.h>
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include <Intrinsic.h>
#include <StringDefs.h>
#include <Shell.h>
#ifdef USE_XAW3D
# include <Xaw3d/Box.h>
# include <Xaw3d/Scrollbar.h>
#elif defined(USE_NEXTAW)
# include <neXtaw/Box.h>
# include <neXtaw/Scrollbar.h>
#else
# include <Xaw/Box.h>
# include <Xaw/Scrollbar.h>
#endif
#include "x11/ScrollBox.h"
#include "Xmu/StdSel.h"
#include "Xmu/Atoms.h"
#include <keysym.h>
#include <Xatom.h>
#define XCURSCR_Y_SIZE (XCursesLINES * XCursesCOLS * sizeof(chtype))
#define XCURSCR_FLAG_SIZE (XCursesLINES * sizeof(int))
#define XCURSCR_START_SIZE (XCursesLINES * sizeof(int))
#define XCURSCR_LENGTH_SIZE (XCursesLINES * sizeof(int))
#define XCURSCR_ATRTAB_SIZE (PDC_COLOR_PAIRS * 2 * sizeof(short))
#define XCURSCR_SIZE (XCURSCR_FLAG_SIZE + XCURSCR_START_SIZE + \
XCURSCR_LENGTH_SIZE + XCURSCR_Y_SIZE + XCURSCR_ATRTAB_SIZE + \
sizeof(XColor))
#define XCURSCR_Y_OFF(y) ((y) * XCursesCOLS * sizeof(chtype))
#define XCURSCR_FLAG_OFF (XCURSCR_Y_OFF(0) + XCURSCR_Y_SIZE)
#define XCURSCR_START_OFF (XCURSCR_FLAG_OFF + XCURSCR_FLAG_SIZE)
#define XCURSCR_LENGTH_OFF (XCURSCR_START_OFF + XCURSCR_START_SIZE)
#define XCURSCR_ATRTAB_OFF (XCURSCR_LENGTH_OFF + XCURSCR_LENGTH_SIZE)
#define XCURSCR_XCOLOR_OFF (XCURSCR_ATRTAB_OFF + XCURSCR_ATRTAB_SIZE)
typedef struct
{
int lines;
int cols;
Pixel cursorColor;
Pixel colorBlack;
Pixel colorRed;
Pixel colorGreen;
Pixel colorYellow;
Pixel colorBlue;
Pixel colorMagenta;
Pixel colorCyan;
Pixel colorWhite;
Pixel colorBoldBlack;
Pixel colorBoldRed;
Pixel colorBoldGreen;
Pixel colorBoldYellow;
Pixel colorBoldBlue;
Pixel colorBoldMagenta;
Pixel colorBoldCyan;
Pixel colorBoldWhite;
Pixel pointerForeColor;
Pixel pointerBackColor;
XFontStruct *normalFont;
XFontStruct *italicFont;
char *bitmap;
#ifdef HAVE_XPM_H
char *pixmap;
#endif
char *composeKey;
Cursor pointer;
int shmmin;
int borderWidth;
int borderColor;
int clickPeriod;
int doubleClickPeriod;
int scrollbarWidth;
int cursorBlinkRate;
char *textCursor;
} XCursesAppData;
extern XCursesAppData xc_app_data;
#define XCURSESSHMMIN xc_app_data.shmmin
#define XCLOGMSG (XCursesProcess ? " X" : "CURSES")
void XC_get_line_lock(int);
void XC_release_line_lock(int);
int PDC_display_cursor(int, int, int, int, int);
void XCursesExitCursesProcess(int, char *);
int XCursesInstruct(int);
int XCursesInstructAndWait(int);
int XCursesInitscr(int, char **);
int XC_write_socket(int, const void *, int);
int XC_read_socket(int, void *, int);
int XC_write_display_socket_int(int);
int XCursesSetupX(int argc, char *argv[]);
RETSIGTYPE XCursesSigwinchHandler(int signo);
#ifdef _HPUX_SOURCE
# define FD_SET_CAST int *
#else
# define FD_SET_CAST fd_set *
#endif
extern fd_set xc_readfds;
extern unsigned char *Xcurscr;
extern int XCursesProcess;
extern int shmidSP;
extern int shmid_Xcurscr;
extern int shmkeySP;
extern int shmkey_Xcurscr;
extern int xc_otherpid;
extern int XCursesLINES;
extern int XCursesCOLS;
extern int xc_display_sock;
extern int xc_key_sock;
extern int xc_display_sockets[2];
extern int xc_key_sockets[2];
extern int xc_exit_sock;
typedef RETSIGTYPE (*signal_handler)();
signal_handler XCursesSetSignal(int, signal_handler);
#ifdef PDCDEBUG
void XC_say(const char *msg);
# define XC_LOG(x) XC_say x
#else
# define XC_LOG(x)
#endif
#ifdef MOUSE_DEBUG
# define MOUSE_LOG(x) printf x
#else
# define MOUSE_LOG(x)
#endif
enum
{
CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION,
CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR,
CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR,
CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR,
CURSES_EXIT
};
extern short *xc_atrtab;

View File

@@ -0,0 +1,152 @@
/* Public Domain Curses */
#include "pdcx11.h"
RCSID("$Id: sb.c,v 1.27 2008/07/14 04:24:52 wmcbrine Exp $")
/*man-start**************************************************************
Name: sb
Synopsis:
int sb_init(void)
int sb_set_horz(int total, int viewport, int cur)
int sb_set_vert(int total, int viewport, int cur)
int sb_get_horz(int *total, int *viewport, int *cur)
int sb_get_vert(int *total, int *viewport, int *cur)
int sb_refresh(void);
Description:
These functions manipulate the scrollbar.
Return Value:
All functions return OK on success and ERR on error.
Portability X/Open BSD SYS V
sb_init - - -
sb_set_horz - - -
sb_set_vert - - -
sb_get_horz - - -
sb_get_vert - - -
sb_refresh - - -
**man-end****************************************************************/
bool sb_started = FALSE;
/* sb_init() is the sb initialization routine.
This must be called before initscr(). */
int sb_init(void)
{
PDC_LOG(("sb_init() - called\n"));
if (SP)
return ERR;
sb_started = TRUE;
return OK;
}
/* sb_set_horz() - Used to set horizontal scrollbar.
total = total number of columns
viewport = size of viewport in columns
cur = current column in total */
int sb_set_horz(int total, int viewport, int cur)
{
PDC_LOG(("sb_set_horz() - called: total %d viewport %d cur %d\n",
total, viewport, cur));
if (!SP)
return ERR;
SP->sb_total_x = total;
SP->sb_viewport_x = viewport;
SP->sb_cur_x = cur;
return OK;
}
/* sb_set_vert() - Used to set vertical scrollbar.
total = total number of columns on line
viewport = size of viewport in columns
cur = current column in total */
int sb_set_vert(int total, int viewport, int cur)
{
PDC_LOG(("sb_set_vert() - called: total %d viewport %d cur %d\n",
total, viewport, cur));
if (!SP)
return ERR;
SP->sb_total_y = total;
SP->sb_viewport_y = viewport;
SP->sb_cur_y = cur;
return OK;
}
/* sb_get_horz() - Used to get horizontal scrollbar.
total = total number of lines
viewport = size of viewport in lines
cur = current line in total */
int sb_get_horz(int *total, int *viewport, int *cur)
{
PDC_LOG(("sb_get_horz() - called\n"));
if (!SP)
return ERR;
if (total)
*total = SP->sb_total_x;
if (viewport)
*viewport = SP->sb_viewport_x;
if (cur)
*cur = SP->sb_cur_x;
return OK;
}
/* sb_get_vert() - Used to get vertical scrollbar.
total = total number of lines
viewport = size of viewport in lines
cur = current line in total */
int sb_get_vert(int *total, int *viewport, int *cur)
{
PDC_LOG(("sb_get_vert() - called\n"));
if (!SP)
return ERR;
if (total)
*total = SP->sb_total_y;
if (viewport)
*viewport = SP->sb_viewport_y;
if (cur)
*cur = SP->sb_cur_y;
return OK;
}
/* sb_refresh() - Used to draw the scrollbars. */
int sb_refresh(void)
{
PDC_LOG(("sb_refresh() - called\n"));
if (!SP)
return ERR;
XCursesInstruct(CURSES_REFRESH_SCROLLBAR);
return OK;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,76 @@
#! /bin/sh
#
# The idea to this kind of setup info script was stolen from numerous
# other packages, such as neon, libxml and gnome.
#
# $Id: xcurses-config.in,v 1.6 2007/11/07 23:33:07 wmcbrine Exp $
#
verdot=3.4
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@/xcurses
usage()
{
echo "Usage: xcurses-config [OPTION]"
echo ""
echo "Available values for OPTION include:"
echo ""
echo " --help display this help and exit"
echo " --cflags pre-processor and compiler flags"
echo " [-I$includedir]"
echo " --libs library linking information"
echo " [-L$prefix/lib -lXCurses @LDFLAGS@ @MH_XLIBS@ @MH_EXTRA_LIBS@"
echo " --prefix PDCurses install prefix"
echo " [$prefix]"
echo " --version output version information"
echo " [$verdot]"
exit $1
}
if test $# -eq 0; then
usage 1
fi
while test $# -gt 0; do
case "$1" in
# this deals with options in the style
# --option=value and extracts the value part
# [not currently used]
-*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) value= ;;
esac
case "$1" in
--prefix)
echo $prefix
;;
--version)
echo $verdot
exit 0
;;
--help)
usage 0
;;
--cflags)
echo -I$includedir
;;
--libs)
echo -L$prefix/lib -lXCurses @LDFLAGS@ @MH_XLIBS@ @MH_EXTRA_LIBS@
;;
*)
usage
exit 1
;;
esac
shift
done
exit 0