Revision: 1728
http://open-axiom.svn.sourceforge.net/open-axiom/?rev=1728&view=rev
Author: dos-reis
Date: 2010-07-29 19:52:43 +0000 (Thu, 29 Jul 2010)
Log Message:
-----------
* lib/XSpadFill.c: Tidy.
* lib/pixmap.c: Likewise.
* lib/spadcolors.c: Likewise.
* include/ReadBitmap.H1: Remove.
* include/all_hyper_proto.H1: Likewise.
* include/cond.H1: Likewise.
* include/cursor.H1: Likewise.
* include/dialog.H1: Likewise.
* include/display.H1: Likewise.
* include/event.H1: Likewise.
* include/extent1.H1: Likewise.
* include/extent2.H1: Likewise.
* include/form_ext.H1: Likewise.
* include/group.H1: Likewise.
* include/htinp.H1: Likewise.
* include/hyper.H1: Likewise.
* include/initx.H1: Likewise.
* include/input.H1: Likewise.
* include/item.H1: Likewise.
* include/keyin.H1: Likewise.
* include/macro.H1: Likewise.
* include/mem.H1: Likewise.
* include/parse.H1: Likewise.
* include/parse_aux.H1: Likewise.
* include/parse_input.H1: Likewise.
* include/parse_paste.H1: Likewise.
* include/parse_types.H1: Likewise.
* include/scrollbar.H1: Likewise.
* include/show_types.H1: Likewise.
* include/spadcolors.H1: Likewise.
* include/spadint.H1: Likewise.
* include/titlebar.H1: Likewise.
* hyper/Makefile.in: Compile and Link with a C++ compiler.
* hyper/ReadBitmap.c: Make it acceptable to a C++ compiler.
* hyper/cond.c: Likewise.
* hyper/dialog.c: Likewise.
* hyper/display.c: Likewise.
* hyper/display.h: Likewise.
* hyper/event.c: Likewise.
* hyper/event.h: Likewise.
* hyper/extent.h: Likewise.
* hyper/extent1.c: Likewise.
* hyper/extent2.c: Likewise.
* hyper/form-ext.c: Likewise.
* hyper/group.c: Likewise.
* hyper/group.h: Likewise.
* hyper/htadd.c: Likewise.
* hyper/htinp.c: Likewise.
* hyper/hyper.c: Likewise.
* hyper/hyper.h: Likewise.
* hyper/initx.c: Likewise.
* hyper/initx.h: Likewise.
* hyper/input.c: Likewise.
* hyper/item.c: Likewise.
* hyper/keyin.h: Likewise.
* hyper/keyin.c: Likewise.
* hyper/macro.c: Likewise.
* hyper/mem.c: Likewise.
* hyper/parse-aux.c: Likewise.
* hyper/parse-input.c: Likewise.
* hyper/parse-paste.c: Likewise.
* hyper/parse-paste.h: Likewise.
* hyper/parse-types.h: Likewise.
* hyper/parse-types.c: Likewise.
* hyper/parse.h: Likewise.
* hyper/parse.c: Likewise.
* hyper/scrollbar.c: Likewise.
* hyper/scrollbar.h: Likewise.
* hyper/show-types.c: Likewise.
* hyper/spadint.c: Likewise.
* hyper/titlebar.c: Likewise.
* hyper/titlebar.h: Likewise.
* graph/view3D/smoothShade3d.c: Include spadcolors.h
* graph/view3D/stuff3d.c: Likewise.
* graph/include/view.h (saymem): #undef before #define.
* graph/view2D/write2d.c: Include pixmap.h.
* graph/view3D/process3d.c: Likewise.
* graph/view3D/write3d.c: Likewise.
* graph/view3D/header.h: Remove macro definition for endColor and
colorStep.
* include/bsdsignal.h: Remove.
* include/edin.H1: Likewise.
* include/fnct_key.H1: Likewise.
* include/halloc.h: Likewise.
* include/hash.h: Likewise.
* include/prt.H1: Likewise.
* include/rgb.H1: Likewise.
* include/sockio.h: Likewise.
* include/util.h: Likewise.
* include/pixmap.h: Rename from pixmap.H1
Modified Paths:
--------------
trunk/configure
trunk/configure.ac
trunk/configure.ac.pamphlet
trunk/src/ChangeLog
trunk/src/graph/include/view.h
trunk/src/graph/view2D/write2d.c
trunk/src/graph/view3D/header.h
trunk/src/graph/view3D/process3d.c
trunk/src/graph/view3D/smoothShade3d.c
trunk/src/graph/view3D/stuff3d.c
trunk/src/graph/view3D/write3d.c
trunk/src/hyper/Makefile.in
trunk/src/hyper/ReadBitmap.c
trunk/src/hyper/cond.c
trunk/src/hyper/dialog.c
trunk/src/hyper/display.c
trunk/src/hyper/display.h
trunk/src/hyper/event.c
trunk/src/hyper/event.h
trunk/src/hyper/extent.h
trunk/src/hyper/extent1.c
trunk/src/hyper/extent2.c
trunk/src/hyper/form-ext.c
trunk/src/hyper/group.c
trunk/src/hyper/group.h
trunk/src/hyper/htadd.c
trunk/src/hyper/htinp.c
trunk/src/hyper/hyper.c
trunk/src/hyper/hyper.h
trunk/src/hyper/initx.c
trunk/src/hyper/initx.h
trunk/src/hyper/input.c
trunk/src/hyper/item.c
trunk/src/hyper/keyin.c
trunk/src/hyper/keyin.h
trunk/src/hyper/macro.c
trunk/src/hyper/mem.c
trunk/src/hyper/parse-aux.c
trunk/src/hyper/parse-input.c
trunk/src/hyper/parse-paste.c
trunk/src/hyper/parse-paste.h
trunk/src/hyper/parse-types.c
trunk/src/hyper/parse-types.h
trunk/src/hyper/parse.c
trunk/src/hyper/parse.h
trunk/src/hyper/scrollbar.c
trunk/src/hyper/scrollbar.h
trunk/src/hyper/show-types.c
trunk/src/hyper/spadint.c
trunk/src/hyper/titlebar.c
trunk/src/hyper/titlebar.h
trunk/src/include/bsdsignal.h
trunk/src/include/cursor.H1
trunk/src/include/edin.H1
trunk/src/include/fnct_key.H1
trunk/src/include/halloc.h
trunk/src/include/hash.h
trunk/src/include/prt.H1
trunk/src/include/rgb.h
trunk/src/include/sockio.h
trunk/src/include/spadcolors.h
trunk/src/include/util.H1
trunk/src/include/wct.H1
trunk/src/lib/XSpadFill.c
trunk/src/lib/pixmap.c
trunk/src/lib/spadcolors.c
Added Paths:
-----------
trunk/src/include/pixmap.h
Removed Paths:
-------------
trunk/src/include/ReadBitmap.H1
trunk/src/include/all_hyper_proto.H1
trunk/src/include/cond.H1
trunk/src/include/dialog.H1
trunk/src/include/display.H1
trunk/src/include/event.H1
trunk/src/include/extent1.H1
trunk/src/include/extent2.H1
trunk/src/include/form_ext.H1
trunk/src/include/group.H1
trunk/src/include/htinp.H1
trunk/src/include/hyper.H1
trunk/src/include/initx.H1
trunk/src/include/input.H1
trunk/src/include/item.H1
trunk/src/include/keyin.H1
trunk/src/include/macro.H1
trunk/src/include/mem.H1
trunk/src/include/parse.H1
trunk/src/include/parse_aux.H1
trunk/src/include/parse_input.H1
trunk/src/include/parse_paste.H1
trunk/src/include/parse_types.H1
trunk/src/include/pixmap.H1
trunk/src/include/scrollbar.H1
trunk/src/include/show_types.H1
trunk/src/include/spadcolors.H1
trunk/src/include/spadint.H1
trunk/src/include/titlebar.H1
Modified: trunk/configure
===================================================================
--- trunk/configure 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/configure 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2010-07-18.
+# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2010-07-29.
#
# Report bugs to <open-axiom-bugs@...>.
#
@@ -745,8 +745,8 @@
# Identity of this package.
PACKAGE_NAME='OpenAxiom'
PACKAGE_TARNAME='openaxiom'
-PACKAGE_VERSION='1.4.0-2010-07-18'
-PACKAGE_STRING='OpenAxiom 1.4.0-2010-07-18'
+PACKAGE_VERSION='1.4.0-2010-07-29'
+PACKAGE_STRING='OpenAxiom 1.4.0-2010-07-29'
PACKAGE_BUGREPORT='open-axiom-bugs@...'
ac_unique_file="src/Makefile.pamphlet"
@@ -1513,7 +1513,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures OpenAxiom 1.4.0-2010-07-18 to adapt to many kinds of systems.
+\`configure' configures OpenAxiom 1.4.0-2010-07-29 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1583,7 +1583,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2010-07-18:";;
+ short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2010-07-29:";;
esac
cat <<\_ACEOF
@@ -1691,7 +1691,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-OpenAxiom configure 1.4.0-2010-07-18
+OpenAxiom configure 1.4.0-2010-07-29
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1705,7 +1705,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by OpenAxiom $as_me 1.4.0-2010-07-18, which was
+It was created by OpenAxiom $as_me 1.4.0-2010-07-29, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -21182,7 +21182,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by OpenAxiom $as_me 1.4.0-2010-07-18, which was
+This file was extended by OpenAxiom $as_me 1.4.0-2010-07-29, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21245,7 +21245,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-OpenAxiom config.status 1.4.0-2010-07-18
+OpenAxiom config.status 1.4.0-2010-07-29
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/configure.ac 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,6 +1,6 @@
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.4.0-2010-07-18],
+AC_INIT([OpenAxiom], [1.4.0-2010-07-29],
[open-axiom-bugs@...])
AC_CONFIG_AUX_DIR(config)
Modified: trunk/configure.ac.pamphlet
===================================================================
--- trunk/configure.ac.pamphlet 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/configure.ac.pamphlet 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1210,7 +1210,7 @@
<<Autoconf init>>=
sinclude(config/open-axiom.m4)
sinclude(config/aclocal.m4)
-AC_INIT([OpenAxiom], [1.4.0-2010-07-18],
+AC_INIT([OpenAxiom], [1.4.0-2010-07-29],
[open-axiom-bugs@...])
@
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/ChangeLog 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,5 +1,98 @@
2010-07-29 Gabriel Dos Reis <gdr@...>
+ * lib/XSpadFill.c: Tidy.
+ * lib/pixmap.c: Likewise.
+ * lib/spadcolors.c: Likewise.
+ * include/ReadBitmap.H1: Remove.
+ * include/all_hyper_proto.H1: Likewise.
+ * include/cond.H1: Likewise.
+ * include/cursor.H1: Likewise.
+ * include/dialog.H1: Likewise.
+ * include/display.H1: Likewise.
+ * include/event.H1: Likewise.
+ * include/extent1.H1: Likewise.
+ * include/extent2.H1: Likewise.
+ * include/form_ext.H1: Likewise.
+ * include/group.H1: Likewise.
+ * include/htinp.H1: Likewise.
+ * include/hyper.H1: Likewise.
+ * include/initx.H1: Likewise.
+ * include/input.H1: Likewise.
+ * include/item.H1: Likewise.
+ * include/keyin.H1: Likewise.
+ * include/macro.H1: Likewise.
+ * include/mem.H1: Likewise.
+ * include/parse.H1: Likewise.
+ * include/parse_aux.H1: Likewise.
+ * include/parse_input.H1: Likewise.
+ * include/parse_paste.H1: Likewise.
+ * include/parse_types.H1: Likewise.
+ * include/scrollbar.H1: Likewise.
+ * include/show_types.H1: Likewise.
+ * include/spadcolors.H1: Likewise.
+ * include/spadint.H1: Likewise.
+ * include/titlebar.H1: Likewise.
+ * hyper/Makefile.in: Compile and Link with a C++ compiler.
+ * hyper/ReadBitmap.c: Make it acceptable to a C++ compiler.
+ * hyper/cond.c: Likewise.
+ * hyper/dialog.c: Likewise.
+ * hyper/display.c: Likewise.
+ * hyper/display.h: Likewise.
+ * hyper/event.c: Likewise.
+ * hyper/event.h: Likewise.
+ * hyper/extent.h: Likewise.
+ * hyper/extent1.c: Likewise.
+ * hyper/extent2.c: Likewise.
+ * hyper/form-ext.c: Likewise.
+ * hyper/group.c: Likewise.
+ * hyper/group.h: Likewise.
+ * hyper/htadd.c: Likewise.
+ * hyper/htinp.c: Likewise.
+ * hyper/hyper.c: Likewise.
+ * hyper/hyper.h: Likewise.
+ * hyper/initx.c: Likewise.
+ * hyper/initx.h: Likewise.
+ * hyper/input.c: Likewise.
+ * hyper/item.c: Likewise.
+ * hyper/keyin.h: Likewise.
+ * hyper/keyin.c: Likewise.
+ * hyper/macro.c: Likewise.
+ * hyper/mem.c: Likewise.
+ * hyper/parse-aux.c: Likewise.
+ * hyper/parse-input.c: Likewise.
+ * hyper/parse-paste.c: Likewise.
+ * hyper/parse-paste.h: Likewise.
+ * hyper/parse-types.h: Likewise.
+ * hyper/parse-types.c: Likewise.
+ * hyper/parse.h: Likewise.
+ * hyper/parse.c: Likewise.
+ * hyper/scrollbar.c: Likewise.
+ * hyper/scrollbar.h: Likewise.
+ * hyper/show-types.c: Likewise.
+ * hyper/spadint.c: Likewise.
+ * hyper/titlebar.c: Likewise.
+ * hyper/titlebar.h: Likewise.
+ * graph/view3D/smoothShade3d.c: Include spadcolors.h
+ * graph/view3D/stuff3d.c: Likewise.
+ * graph/include/view.h (saymem): #undef before #define.
+ * graph/view2D/write2d.c: Include pixmap.h.
+ * graph/view3D/process3d.c: Likewise.
+ * graph/view3D/write3d.c: Likewise.
+ * graph/view3D/header.h: Remove macro definition for endColor and
+ colorStep.
+ * include/bsdsignal.h: Remove.
+ * include/edin.H1: Likewise.
+ * include/fnct_key.H1: Likewise.
+ * include/halloc.h: Likewise.
+ * include/hash.h: Likewise.
+ * include/prt.H1: Likewise.
+ * include/rgb.H1: Likewise.
+ * include/sockio.h: Likewise.
+ * include/util.h: Likewise.
+ * include/pixmap.h: Rename from pixmap.H1
+
+2010-07-29 Gabriel Dos Reis <gdr@...>
+
* algebra/sf.spad.pamphlet (DoubleFloat): Use builtin
trigonometric functions.
* interp/g-opt.boot ($VMsideEffectFreeOperators): Include them.
Modified: trunk/src/graph/include/view.h
===================================================================
--- trunk/src/graph/include/view.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/include/view.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -34,6 +34,7 @@
/* This file is to be included by all the viewport files */
#define check(code) checker(code,__LINE__,"")
+#undef saymem
#define saymem(a,b,c) saymemWithLine(a,b,c,__LINE__)
#define exitWithAck(ACK,ACKsize,i) \
check(write(Socket,&(ACK),sizeof(ACKsize))); exit(i);
Modified: trunk/src/graph/view2D/write2d.c
===================================================================
--- trunk/src/graph/view2D/write2d.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/view2D/write2d.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#include "write.h"
#include "all_2d.H1"
-#include "pixmap.H1"
+#include "pixmap.h"
#include "Gfun.H1"
Modified: trunk/src/graph/view3D/header.h
===================================================================
--- trunk/src/graph/view3D/header.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/view3D/header.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -139,6 +139,8 @@
#define totalHuesConst 27
#define hueEnd 360
+
+#undef hueStep
#define hueStep (hueEnd/totalHuesConst)
#define black BlackPixel(dsply,scrn)
@@ -146,12 +148,9 @@
#define numPlanes 1
#define numColors 10
#define startColor 0
-#define endColor (startColor+numColors)
#define maxColors (DisplayCells(dsply,scrn)-1)
#define maxPlanes (DefaultVisual((dpy),(scr))->bits_per_rgb)
-#define colorStep ((maxColors+1)/numColors)
-
/**********************************/
/*** Screen and Window Sizes */
/**********************************/
Modified: trunk/src/graph/view3D/process3d.c
===================================================================
--- trunk/src/graph/view3D/process3d.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/view3D/process3d.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,7 @@
#include "util.H1"
#include "Gfun.H1"
-#include "pixmap.H1"
+#include "pixmap.h"
#include "XShade.H1"
#include "XSpadFill.H1"
#include "all_3d.H1"
Modified: trunk/src/graph/view3D/smoothShade3d.c
===================================================================
--- trunk/src/graph/view3D/smoothShade3d.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/view3D/smoothShade3d.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,7 @@
#include "volume.h"
#include "mode.h" /* for #define components */
-#include "spadcolors.H1"
+#include "spadcolors.h"
#include "Gfun.H1"
#include "util.H1"
#include "XSpadFill.H1"
Modified: trunk/src/graph/view3D/stuff3d.c
===================================================================
--- trunk/src/graph/view3D/stuff3d.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/view3D/stuff3d.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,7 @@
#include "Gfun.H1"
-#include "spadcolors.H1"
+#include "spadcolors.h"
#include "util.H1"
#include "all_3d.H1"
Modified: trunk/src/graph/view3D/write3d.c
===================================================================
--- trunk/src/graph/view3D/write3d.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/graph/view3D/write3d.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -44,7 +44,7 @@
#include "mode.h"
-#include "pixmap.H1"
+#include "pixmap.h"
#include "XShade.H1"
#include "Gfun.H1"
Modified: trunk/src/hyper/Makefile.in
===================================================================
--- trunk/src/hyper/Makefile.in 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/Makefile.in 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2009, Gabriel Dos Reis.
+# Copyright (C) 2007-2010, Gabriel Dos Reis.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -141,7 +141,7 @@
.PRECIOUS: %.lo %.$(OBJEXT)
%.$(OBJEXT) %.lo: %.c $(HEADERS)
- $(COMPILE) -o $@ $(CFLAGS) ${CCF} $(axiom_includes) $(AXIOM_X11_CFLAGS) -I. $<
+ $(CXXCOMPILE) -o $@ $(CFLAGS) ${CCF} $(axiom_includes) $(AXIOM_X11_CFLAGS) -I. $<
${HYPER}/pages/ht.db: all-hyper-pre $(srcdir)/pages/*.pht
@echo making ${HYPER}/pages from $(axiom_src_srcdir)/pages directory
@@ -169,17 +169,17 @@
cp -p $< $@ && chmod +x $@
${OUTLIB}/ex2ht$(EXEEXT): $(ex2ht_objects) $(ex2ht_DEPENDENCIES)
- ${LINK} -o $@ $(ex2ht_objects) $(ex2ht_LDADD)
+ ${CXXLINK} -o $@ $(ex2ht_objects) $(ex2ht_LDADD)
$(OUTLIB)/htadd$(EXEEXT): $(htadd_objects) $(htadd_DEPENDENCIES)
- ${LINK} -o $@ $(htadd_objects) $(htadd_LDADD)
+ ${CXXLINK} -o $@ $(htadd_objects) $(htadd_LDADD)
${OUTLIB}/hthits$(EXEEXT): $(hthits_objects) $(hthits_DEPENDENCIES)
- ${LINK} -o $@ $(hthits_objects) $(hthits_LDADD)
+ ${CXXLINK} -o $@ $(hthits_objects) $(hthits_LDADD)
$(OUTLIB)/hypertex$(EXEEXT): $(hypertex_objects) $(hypertex_DEPENDENCIES)
- ${LINK} -o $@ $(hypertex_objects) $(hypertex_LDADD)
+ ${CXXLINK} -o $@ $(hypertex_objects) $(hypertex_LDADD)
${OUTLIB}/spadbuf$(EXEEXT): $(spadbuf_objects) $(spadbuf_DEPENDENCIES)
- ${LINK} -o $@ $(spadbuf_objects) $(spadbuf_LDADD)
+ ${CXXLINK} -o $@ $(spadbuf_objects) $(spadbuf_LDADD)
Modified: trunk/src/hyper/ReadBitmap.c
===================================================================
--- trunk/src/hyper/ReadBitmap.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/ReadBitmap.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,17 +33,14 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _READBITMAP_C
-
#include "openaxiom-c-macros.h"
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
#include "hyper.h"
-#include "all_hyper_proto.H1"
-#include "pixmap.H1"
+static int read_hot(FILE * fd , char Line[] , int * x_hot , int * y_hot);
+static int read_w_and_h(FILE * fd , unsigned int * width , unsigned int * height);
#define MAXLINE 256
Modified: trunk/src/hyper/cond.c
===================================================================
--- trunk/src/hyper/cond.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/cond.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,19 +40,16 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _COND_C
-#include "openaxiom-c-macros.h"
+#include "openaxiom-c-macros.h"
#include "debug.h"
-
#include "sockio.h"
#include "halloc.h"
#include "lex.h"
#include "hyper.h"
-
-#include "all_hyper_proto.H1"
#include "sockio.h"
+static int check_memostack(TextNode * node);
void
insert_cond(char *label, char *cond)
Modified: trunk/src/hyper/dialog.c
===================================================================
--- trunk/src/hyper/dialog.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/dialog.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,8 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
+#include <X11/keysym.h>
+
#define _DIALOG_C
#include "openaxiom-c-macros.h"
@@ -50,14 +52,41 @@
#include "keyin.h"
#include "display.h"
#include "group.h"
+#include "event.h"
-#include <X11/keysym.h>
#define min(x,y) ( (x<y)?(x):(y))
-#include "all_hyper_proto.H1"
+static void back_over_char(InputItem * sym);
+static void back_over_eoln(InputItem * sym);
+static void clear_cursor(InputItem * sym);
+static void clear_cursorline(InputItem * sym);
+static void dec_line_numbers(LineStruct * line);
+static void decrease_line_numbers(LineStruct * line , int am);
+static void delete_char(InputItem * sym);
+static void delete_eoln(InputItem * sym);
+static int delete_one_char(InputItem * sym);
+static void delete_rest_of_line(InputItem * sym);
+static void draw_cursor(InputItem * sym);
+static void enter_new_line(InputItem * sym);
+static void inc_line_numbers(LineStruct * line);
+static void insert_buffer(char * buffer , InputItem * sym);
+static int move_back_one_char(InputItem * sym);
+static void move_cursor_backward(InputItem * sym);
+static void move_cursor_down(InputItem * sym);
+static void move_cursor_end(InputItem * sym);
+static void move_cursor_forward(InputItem * sym);
+static void move_cursor_home(InputItem * sym);
+static void move_cursor_up(InputItem * sym);
+static char move_rest_back(LineStruct * line , int size);
+static int move_sym_forward(LineStruct * line , int num , int size , InputItem * sym);
+static char * mystrncpy(char * buff1 , char * buff2 , int n);
+static void overwrite_buffer(char * buffer , InputItem * item);
+static void redraw_win(void);
+static void tough_enter(InputItem * sym);
+
static void
redraw_win()
{
Modified: trunk/src/hyper/display.c
===================================================================
--- trunk/src/hyper/display.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/display.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -63,10 +63,9 @@
#include "group.h"
#include "scrollbar.h"
#include "titlebar.h"
+#include "parse-types.h"
-#include "all_hyper_proto.H1"
-
extern ItemStack *gTopOfItemStack;
short int gDisplayRegion = 0;
int gRegionOffset = 0;
Modified: trunk/src/hyper/display.h
===================================================================
--- trunk/src/hyper/display.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/display.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,11 @@
#include "hyper.h"
+extern void expose_page(HyperDocPage * page);
+extern void paste_page(TextNode * node);
+extern void scroll_page(HyperDocPage * page);
+extern void show_page(HyperDocPage * page);
+
extern short int gDisplayRegion;
extern int gRegionOffset;
Modified: trunk/src/hyper/event.c
===================================================================
--- trunk/src/hyper/event.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/event.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,13 +34,9 @@
*/
#define _EVENT_C
+
#include "openaxiom-c-macros.h"
-#include "debug.h"
-
-#include "sockio.h"
-#include "hyper.h"
-
#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
@@ -49,6 +45,9 @@
#include <sys/types.h>
#include <sys/time.h>
+#include "debug.h"
+#include "sockio.h"
+#include "hyper.h"
#include "event.h"
#include "keyin.h"
#include "hyper.h"
@@ -59,8 +58,6 @@
#include "scrollbar.h"
#include "group.h"
#include "lex.h"
-
-#include "all_hyper_proto.H1"
#include "sockio.h"
jmp_buf env;
@@ -71,317 +68,197 @@
static HyperLink *gSavedInputAreaLink = NULL;
-
-/*
- * This is the main X loop. It keeps grabbing events. Since the only way the
- * window can die is through an event, it never actually end. One of the
- * subroutines it calls is responsible for killing everything
- */
-
-void
-mainEventLoop(void)
+static int
+HyperDocErrorHandler(Display *display, XErrorEvent *xe)
{
- XEvent event;
- int Xcon;
- fd_set rd, dum1, dum2;
- motion = 0;
- gActiveWindow = -1;
- set_error_handlers();
- Xcon = ConnectionNumber(gXDisplay);
+ if (xe->request_code != 15) {
+ char buf[1024];
- while (1) {
-/* fprintf(stderr,"event:mainEventLoop: loop top\n");*/
- while (gSessionHashTable.num_entries == 0)
- pause();
+ XGetErrorText(display, xe->error_code, buf, sizeof(buf));
- /* XFlush(gXDisplay); */
+ fprintf(stderr, "error code = %d\n", xe->error_code);
+ fprintf(stderr, "major op code = %d\n", xe->request_code);
+ fprintf(stderr, "minor op code = %d\n", xe->minor_code);
+ fprintf(stderr, "XID = %ld\n", xe->resourceid);
+ fprintf(stderr, "%s\n", buf);
- if (!motion)
- init_cursor_states();
- motion = 0;
-
- if (!spad_socket == 0) {
- FD_ZERO(&rd);
- FD_ZERO(&dum1);
- FD_ZERO(&dum2);
- FD_CLR(0, &dum1);
- FD_CLR(0, &dum2);
- FD_CLR(0, &rd);
- FD_SET(spad_socket->socket, &rd);
- FD_SET(Xcon, &rd);
- if (!session_server == 0) {
- FD_SET(session_server->socket, &rd);
- }
- if (XEventsQueued(gXDisplay, QueuedAlready)) {
- XNextEvent(gXDisplay, &event);
- handle_event(&event);
- }
- else {
- select(FD_SETSIZE,(void *)&rd,(void *)&dum1,(void *)&dum2,NULL);
- if (FD_ISSET(Xcon, &rd) ||
- XEventsQueued(gXDisplay, QueuedAfterFlush)) {
- XNextEvent(gXDisplay, &event);
- handle_event(&event);
- }
- else if (FD_ISSET(spad_socket->socket, &rd))
- /*
- * Axiom Socket do what handle_event does The 100 is
- * $SpadStuff in hypertex.boot
- */
- {
- if (100 == get_int(spad_socket)) {
- set_window(gParentWindow->fMainWindow);
- make_busy_cursors();
- get_new_window();
- }
- }
- /*
- * Session Socket Telling us about the death of a spadbuf
- * (plus maybe more later) service_session_socket in
- * spadint.c
- */
- else
- if (session_server && FD_ISSET(session_server->socket, &rd)) {
- service_session_socket();
- }
- }
- }
- else {
- XNextEvent(gXDisplay, &event);
- handle_event(&event);
- }
- }
+ if (xe->request_code != 15)
+ exit(-1);
+ }
+ return(0);
}
static void
-handle_event(XEvent * event)
+set_error_handlers(void)
{
- XWindowAttributes wa;
-/* fprintf(stderr,"event:handle_event entered\n");*/
- set_window(event->xany.window);
- if (event->type == MotionNotify) {
-/* fprintf(stderr,"event:handle_event type=MotionNotify\n");*/
- handle_motion_event((XMotionEvent *)event);
- motion = 1;
- return;
- }
- make_busy_cursors();
- switch (event->type) {
- case DestroyNotify:
-/* fprintf(stderr,"event:handle_event type=DestroyNotify\n");*/
- break;
- case Expose:
-/* fprintf(stderr,"event:handle_event type=Expose\n");*/
- XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
- if ((gWindow->width == 0 && gWindow->height == 0) ||
- (wa.width != gWindow->width || wa.height != gWindow->height)) {
- gWindow->width = wa.width;
- gWindow->height = wa.height;
- display_page(gWindow->page);
- gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
- }
- else /** just redraw the thing **/
- expose_page(gWindow->page);
- XFlush(gXDisplay);
- clear_exposures(gWindow->fMainWindow);
- clear_exposures(gWindow->fScrollWindow);
- break;
- case ButtonPress:
-/* fprintf(stderr,"event:handle_event type=ButtonPress\n");*/
- handle_button(event->xbutton.button, (XButtonEvent *)event);
- XFlush(gXDisplay);
- if (gWindow) {
- while (XCheckTypedWindowEvent(gXDisplay, gWindow->fMainWindow,
- Expose, event));
- while (XCheckTypedWindowEvent(gXDisplay, gWindow->fScrollWindow,
- Expose, event));
- }
- break;
- case KeyPress:
-/* fprintf(stderr,"event:handle_event type=KeyPress\n");*/
- handle_key(event);
- if (gWindow) {
- while (XCheckTypedWindowEvent(gXDisplay, gWindow->fMainWindow,
- Expose, event));
- while (XCheckTypedWindowEvent(gXDisplay, gWindow->fScrollWindow,
- Expose, event));
- }
- break;
- case MapNotify:
-/* fprintf(stderr,"event:handle_event type=MapNotify\n");*/
- create_window();
- break;
+ XSetErrorHandler(HyperDocErrorHandler);
+}
- case SelectionNotify:
-/* fprintf(stderr,"event:handle_event type=SelectionNotify\n");*/
- /* this is in response to a previous request in an input area */
- if ( gSavedInputAreaLink ) {
- XSelectionEvent *pSelEvent;
- Atom dataProperty;
- pSelEvent = (XSelectionEvent *) event;
- dataProperty = XInternAtom(gXDisplay, "PASTE_SELECTION", False);
- /* change the input focus */
+static int
+set_window(Window window)
+{
+ Window root, parent, *children, grandparent,myarg;
+ HDWindow *htw;
+ unsigned int nchildren;
+ int st;
- /* change_input_focus(gSavedInputAreaLink); */
+ myarg=window;
+ nchildren = 0;
+ htw = (HDWindow *) hash_find(&gSessionHashTable, (char *)&myarg);
+ if (htw != NULL) {
+ gWindow = htw;
+ return 1;
+ }
+ st = XQueryTree(gXDisplay, myarg, &root, &parent, &children, &nchildren);
+ if (st==0) goto ERROR;
+ if (nchildren > 0)
+ XFree(children);
+ htw = (HDWindow *) hash_find(&gSessionHashTable, (char *)&parent);
+ if (htw != NULL) {
+ gWindow = htw;
+ return 1;
- /* try to get the selection as a window property */
+ }
+ else {
+ /* check for a grandparent */
+ st = XQueryTree(gXDisplay, parent, &root, &grandparent, &children, &nchildren);
+ if (st==0) goto ERROR;
+ if (nchildren > 0)
+ XFree(children);
+ htw = (HDWindow *) hash_find(&gSessionHashTable, (char *)&grandparent);
+ if (htw != NULL) {
+ gWindow = htw;
+ return 1;
+ }
+ }
- if ( pSelEvent->requestor == gWindow->fMainWindow &&
- pSelEvent->selection == XA_PRIMARY &&
- /* pSelEvent->time == CurrentTime && */
- pSelEvent->target == XA_STRING &&
- pSelEvent->property == dataProperty )
- {
- Atom actual_type;
- int actual_format;
- unsigned long nitems, leftover;
- char *pSelection = NULL;
+ /*
+ * fprintf(stderr, "window(%d) and it's parent(%d) aren't in
+ * gSessionHashTable\n", window, parent);
+
+ we never found that window. this happens if (not iff) we exit from
+ an unfocused non-main window under certain wm's and click-to-type. the program returns here with
+ the window handle that was just destroyed. So let's set the global gWindow
+ to the main window.
+ */
- if (Success == XGetWindowProperty(gXDisplay,
- gWindow->fMainWindow,
- pSelEvent->property, 0L, 100000000L, True,
- AnyPropertyType, &actual_type, &actual_format,
- &nitems, &leftover, (unsigned char **) &pSelection) )
- {
- char *pBuffer;
- InputItem *item = gSavedInputAreaLink->reference.string;
+ERROR:
+ gWindow=gParentWindow;
+ return 0;
+}
- for (pBuffer = pSelection; *pBuffer; ++pBuffer)
- add_buffer_to_sym(pBuffer, item);
- XFree(pSelection);
- }
- }
+static HyperLink *
+findButtonInList(HDWindow * window, int x, int y)
+{
+ ButtonList *bl;
- /* clear the link info */
+ if (!window || window->page->type == UnloadedPageType)
+ return NULL;
+ for (bl = window->page->s_button_list; bl != NULL; bl = bl->next)
+ if (x >= bl->x0 && x <= bl->x1 && y >= bl->y0 && y <= bl->y1)
+ return bl->link;
+ for (bl = window->page->button_list; bl != NULL; bl = bl->next)
+ if (x >= bl->x0 && x <= bl->x1 && y >= bl->y0 && y <= bl->y1)
+ return bl->link;
+ return NULL;
+}
- gSavedInputAreaLink = NULL;
- }
- break;
-
- default:
-/* fprintf(stderr,"event:handle_event type=default\n");*/
- break;
- }
-
+static void
+set_cursor(HDWindow *window,Cursor state)
+{
+ if (state == gBusyCursor)
+ XDefineCursor(gXDisplay, window->fMainWindow, gBusyCursor);
+ else if (state == gActiveCursor)
+ XDefineCursor(gXDisplay, window->fMainWindow, gActiveCursor);
+ else
+ XDefineCursor(gXDisplay, window->fMainWindow, gNormalCursor);
+ XFlush(gXDisplay);
}
static void
-create_window(void)
+change_cursor(Cursor state, HDWindow *window)
{
- XWindowAttributes wa;
+ if (window->fDisplayedCursor == state)
+ return;
+ window->fDisplayedCursor = state;
+ set_cursor(window, state);
+}
- XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
- gWindow->width = wa.width;
- gWindow->height = wa.height;
- display_page(gWindow->page);
- gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
+static void
+make_busy_cursor(HDWindow *window)
+{
+ change_cursor(gBusyCursor, window);
+}
- /* then select for the events I normally would like to catch */
- XSelectInput(gXDisplay, gWindow->fMainWindow, ButtonPress | KeyPressMask |
- PointerMotionMask |
- ExposureMask /* | EnterWindowMask | LeaveWindowMask */ );
- XSelectInput(gXDisplay, gWindow->fScrollWindow, ExposureMask);
+static void
+make_busy_cursors(void)
+{
+ hash_map(&gSessionHashTable, (MappableFunction)make_busy_cursor);
+}
+static void
+handle_motion_event(XMotionEvent *event)
+{
+ if (!gWindow)
+ return;
+ if (findButtonInList(gWindow, event->x, event->y) != NULL)
+ change_cursor(gActiveCursor, gWindow);
+ else
+ change_cursor(gNormalCursor, gWindow);
}
+
/*
- * This routine is called when the quitbutton is hit. For the moment I am
- * just going to leave it all behind
+ * This procedure whips thru the stack and clears all expose events for the
+ * given routine
*/
+static void
+clear_exposures(Window w)
+{
+ XEvent report;
-void
-quitHyperDoc(void)
+ XFlush(gXDisplay);
+ while (XCheckTypedWindowEvent(gXDisplay, w, Expose, &report));
+}
+
+static HyperLink *
+get_hyper_link(XButtonEvent * event)
{
- HyperDocPage *page;
+ HyperLink *l1, *l2;
- if (gSessionHashTable.num_entries == 1 || gParentWindow == gWindow) {
- if (!strcmp(gWindow->page->name, "ProtectedQuitPage")){
- exitHyperDoc();
- }
- page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, "ProtectedQuitPage");
- if (page == NULL) {
- fprintf(stderr, "Unknown page name %s\n", "ProtectedQuitPage");
- exitHyperDoc();
- return;
- }
- if (gWindow->fDownLinkStackIndex == MaxDownlinkDepth)
- fprintf(stderr, "exceeded maximum link nesting level\n");
- else
- gWindow->fDownLinkStack[gWindow->fDownLinkStackIndex++] = gWindow->page;
- gWindow->page = page;
- display_page(gWindow->page);
- gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
- }
- else
- exitHyperDoc();
+ l1 = (HyperLink *) hash_find(gWindow->fWindowHashTable, (char *)&(event->window));
+ if (l1)
+ return l1;
+ l2 = findButtonInList(gWindow, event->x, event->y);
+ return l2;
}
-/*
- * find_page takes as an argument the HyperDoc for a page name and returns
- * the associated page
- */
-
static HyperDocPage *
-find_page(TextNode * node)
+paste_button(PasteNode * paste)
{
- char *page_name;
- HyperDocPage *page;
+ HyperDocPage *page = NULL;
+ int pastewhere=paste->where;
- /* try and find the page name */
- page_name = print_to_string(node);
- page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, page_name);
- if (page == NULL) {
- /* try to find the unknown page */
- page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, "UnknownPage");
- if (page == NULL) {
- /* Yikes, Even that could not be found */
- fprintf(stderr, "Unknown page name %s\n", page_name);
+ if ( paste->end_node ==NULL || paste->begin_node==NULL || paste->arg_node==NULL ){
+ BeepAtTheUser();
+ return NULL;
}
- else {
- if (page->type == UnloadedPageType)
- page->type = UlUnknownPage;
- else
- page->type = UnknownPage;
- }
- }
- return page;
-}
-/*
- * These are macros for taking care of the downlink stack, and the memolink
- * stack.
- */
+ page=parse_patch(paste);
+/* paste has changed after this call so use pastewhere*/
-#define NotSpecial(t) \
- ((t == openaxiom_Quitbutton_token || t == openaxiom_Returnbutton_token \
- || t == openaxiom_Upbutton_token || t == UnknownPage \
- || t == UlUnknownPage || t == ErrorPage) \
- ?(0):(1))
-
-/* pushes a page onto the down link stack */
-
-static void
-downlink(void)
-{
- if (gWindow->fDownLinkStackIndex == MaxDownlinkDepth)
- fprintf(stderr, "exceeded maximum link nesting level\n");
+ if (pastewhere && page ) {
+ if (0 == strcmp(page->name, "ErrorPage"))
+ page = NULL;
+ }
else
- gWindow->fDownLinkStack[gWindow->fDownLinkStackIndex++] = gWindow->page;
-}
+ BeepAtTheUser();
-static void
-memolink(void)
-{
- if (gWindow->fMemoStackIndex == MaxMemoDepth)
- fprintf(stderr, "exceeded maximum link nesting level\n");
- else {
- gWindow->fMemoStack[gWindow->fMemoStackIndex] = gWindow->page;
- gWindow->fDownLinkStackTop[gWindow->fMemoStackIndex++] = gWindow->fDownLinkStackIndex;
- }
+ return page;
}
static void
@@ -442,7 +319,61 @@
}
}
+/*
+ * find_page takes as an argument the HyperDoc for a page name and returns
+ * the associated page
+ */
+
+static HyperDocPage *
+find_page(TextNode * node)
+{
+ char *page_name;
+ HyperDocPage *page;
+
+ /* try and find the page name */
+ page_name = print_to_string(node);
+ page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, page_name);
+
+ if (page == NULL) {
+ /* try to find the unknown page */
+ page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, "UnknownPage");
+ if (page == NULL) {
+ /* Yikes, Even that could not be found */
+ fprintf(stderr, "Unknown page name %s\n", page_name);
+ }
+ else {
+ if (page->type == UnloadedPageType)
+ page->type = UlUnknownPage;
+ else
+ page->type = UnknownPage;
+ }
+ }
+ return page;
+}
+
+/* pushes a page onto the down link stack */
+
static void
+downlink(void)
+{
+ if (gWindow->fDownLinkStackIndex == MaxDownlinkDepth)
+ fprintf(stderr, "exceeded maximum link nesting level\n");
+ else
+ gWindow->fDownLinkStack[gWindow->fDownLinkStackIndex++] = gWindow->page;
+}
+
+static void
+memolink(void)
+{
+ if (gWindow->fMemoStackIndex == MaxMemoDepth)
+ fprintf(stderr, "exceeded maximum link nesting level\n");
+ else {
+ gWindow->fMemoStack[gWindow->fMemoStackIndex] = gWindow->page;
+ gWindow->fDownLinkStackTop[gWindow->fMemoStackIndex++] = gWindow->fDownLinkStackIndex;
+ }
+}
+
+static void
windowlink_handler(TextNode * node)
{
char *page_name;
@@ -456,14 +387,6 @@
/* gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;*/
}
-void
-make_window_link(char *name)
-{
- if (init_top_window(name) != -1)
-{}/* gWindow->fWindowHashTable = gWindow->page->fLinkHashTable; */
-}
-
-
static void
lispwindowlink_handler(HyperLink * link)
{
@@ -484,87 +407,37 @@
}
}
-static HyperDocPage *
-paste_button(PasteNode * paste)
+static void
+create_window(void)
{
- HyperDocPage *page = NULL;
- int pastewhere=paste->where;
+ XWindowAttributes wa;
+ XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
- if ( paste->end_node ==NULL || paste->begin_node==NULL || paste->arg_node==NULL ){
- BeepAtTheUser();
- return NULL;
- }
+ gWindow->width = wa.width;
+ gWindow->height = wa.height;
+ display_page(gWindow->page);
+ gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
- page=parse_patch(paste);
-/* paste has changed after this call so use pastewhere*/
+ /* then select for the events I normally would like to catch */
+ XSelectInput(gXDisplay, gWindow->fMainWindow, ButtonPress | KeyPressMask |
+ PointerMotionMask |
+ ExposureMask /* | EnterWindowMask | LeaveWindowMask */ );
+ XSelectInput(gXDisplay, gWindow->fScrollWindow, ExposureMask);
- if (pastewhere && page ) {
- if (0 == strcmp(page->name, "ErrorPage"))
- page = NULL;
- }
- else
- BeepAtTheUser();
-
- return page;
}
-void
-helpForHyperDoc(void)
-{
- HyperDocPage *page = NULL;
+/*
+ * These are macros for taking care of the downlink stack, and the memolink
+ * stack.
+ */
- /* do not do anything if we are already at the "no more help" page */
+#define NotSpecial(t) \
+ ((t == openaxiom_Quitbutton_token || t == openaxiom_Returnbutton_token \
+ || t == openaxiom_Upbutton_token || t == UnknownPage \
+ || t == UlUnknownPage || t == ErrorPage) \
+ ?(0):(1))
- if (0 == strcmp(gWindow->page->name, NoMoreHelpPage))
- return;
-
- /* if no help page recorded, use the standard "no more help" page */
-
- if (!gWindow->page->helppage)
- gWindow->page->helppage = alloc_string(NoMoreHelpPage);
-
- /* if we are on the main help page, use "no more help" page */
-
- if (0 == strcmp(gWindow->page->name, TopLevelHelpPage))
- gWindow->page->helppage = alloc_string(NoMoreHelpPage);
-
- page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, gWindow->page->helppage);
-
- if (page)
- make_window_link(gWindow->page->helppage);
- else
- BeepAtTheUser();
-}
-
-static HyperLink *
-findButtonInList(HDWindow * window, int x, int y)
-{
- ButtonList *bl;
-
- if (!window || window->page->type == UnloadedPageType)
- return NULL;
- for (bl = window->page->s_button_list; bl != NULL; bl = bl->next)
- if (x >= bl->x0 && x <= bl->x1 && y >= bl->y0 && y <= bl->y1)
- return bl->link;
- for (bl = window->page->button_list; bl != NULL; bl = bl->next)
- if (x >= bl->x0 && x <= bl->x1 && y >= bl->y0 && y <= bl->y1)
- return bl->link;
- return NULL;
-}
-
-static HyperLink *
-get_hyper_link(XButtonEvent * event)
-{
- HyperLink *l1, *l2;
-
- l1 = (HyperLink *) hash_find(gWindow->fWindowHashTable, (char *)&(event->window));
- if (l1)
- return l1;
- l2 = findButtonInList(gWindow, event->x, event->y);
- return l2;
-}
-
/*
* Handle a button pressed event. window is the subwindow in which the event
* occured, and button is the button which was pressed
@@ -736,7 +609,191 @@
}
+static void
+handle_event(XEvent * event)
+{
+ XWindowAttributes wa;
+/* fprintf(stderr,"event:handle_event entered\n");*/
+ set_window(event->xany.window);
+ if (event->type == MotionNotify) {
+/* fprintf(stderr,"event:handle_event type=MotionNotify\n");*/
+ handle_motion_event((XMotionEvent *)event);
+ motion = 1;
+ return;
+ }
+ make_busy_cursors();
+ switch (event->type) {
+ case DestroyNotify:
+/* fprintf(stderr,"event:handle_event type=DestroyNotify\n");*/
+ break;
+ case Expose:
+/* fprintf(stderr,"event:handle_event type=Expose\n");*/
+ XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
+ if ((gWindow->width == 0 && gWindow->height == 0) ||
+ (wa.width != gWindow->width || wa.height != gWindow->height)) {
+ gWindow->width = wa.width;
+ gWindow->height = wa.height;
+ display_page(gWindow->page);
+ gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
+ }
+ else /** just redraw the thing **/
+ expose_page(gWindow->page);
+ XFlush(gXDisplay);
+ clear_exposures(gWindow->fMainWindow);
+ clear_exposures(gWindow->fScrollWindow);
+ break;
+ case ButtonPress:
+/* fprintf(stderr,"event:handle_event type=ButtonPress\n");*/
+ handle_button(event->xbutton.button, (XButtonEvent *)event);
+ XFlush(gXDisplay);
+ if (gWindow) {
+ while (XCheckTypedWindowEvent(gXDisplay, gWindow->fMainWindow,
+ Expose, event));
+ while (XCheckTypedWindowEvent(gXDisplay, gWindow->fScrollWindow,
+ Expose, event));
+ }
+ break;
+ case KeyPress:
+/* fprintf(stderr,"event:handle_event type=KeyPress\n");*/
+ handle_key(event);
+ if (gWindow) {
+ while (XCheckTypedWindowEvent(gXDisplay, gWindow->fMainWindow,
+ Expose, event));
+ while (XCheckTypedWindowEvent(gXDisplay, gWindow->fScrollWindow,
+ Expose, event));
+ }
+ break;
+ case MapNotify:
+/* fprintf(stderr,"event:handle_event type=MapNotify\n");*/
+ create_window();
+ break;
+
+ case SelectionNotify:
+/* fprintf(stderr,"event:handle_event type=SelectionNotify\n");*/
+ /* this is in response to a previous request in an input area */
+ if ( gSavedInputAreaLink ) {
+ XSelectionEvent *pSelEvent;
+ Atom dataProperty;
+ pSelEvent = (XSelectionEvent *) event;
+ dataProperty = XInternAtom(gXDisplay, "PASTE_SELECTION", False);
+ /* change the input focus */
+
+ /* change_input_focus(gSavedInputAreaLink); */
+
+ /* try to get the selection as a window property */
+
+ if ( pSelEvent->requestor == gWindow->fMainWindow &&
+ pSelEvent->selection == XA_PRIMARY &&
+ /* pSelEvent->time == CurrentTime && */
+ pSelEvent->target == XA_STRING &&
+ pSelEvent->property == dataProperty )
+ {
+ Atom actual_type;
+ int actual_format;
+ unsigned long nitems, leftover;
+ char *pSelection = NULL;
+
+ if (Success == XGetWindowProperty(gXDisplay,
+ gWindow->fMainWindow,
+ pSelEvent->property, 0L, 100000000L, True,
+ AnyPropertyType, &actual_type, &actual_format,
+ &nitems, &leftover, (unsigned char **) &pSelection) )
+ {
+ char *pBuffer;
+ InputItem *item = gSavedInputAreaLink->reference.string;
+
+ for (pBuffer = pSelection; *pBuffer; ++pBuffer)
+ add_buffer_to_sym(pBuffer, item);
+
+ XFree(pSelection);
+ }
+ }
+
+ /* clear the link info */
+
+ gSavedInputAreaLink = NULL;
+ }
+ break;
+
+ default:
+/* fprintf(stderr,"event:handle_event type=default\n");*/
+ break;
+ }
+
+}
+
+/*
+ * This routine is called when the quitbutton is hit. For the moment I am
+ * just going to leave it all behind
+ */
+
void
+quitHyperDoc(void)
+{
+ HyperDocPage *page;
+
+ if (gSessionHashTable.num_entries == 1 || gParentWindow == gWindow) {
+ if (!strcmp(gWindow->page->name, "ProtectedQuitPage")){
+ exitHyperDoc();
+ }
+ page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, "ProtectedQuitPage");
+ if (page == NULL) {
+ fprintf(stderr, "Unknown page name %s\n", "ProtectedQuitPage");
+ exitHyperDoc();
+ return;
+ }
+ if (gWindow->fDownLinkStackIndex == MaxDownlinkDepth)
+ fprintf(stderr, "exceeded maximum link nesting level\n");
+ else
+ gWindow->fDownLinkStack[gWindow->fDownLinkStackIndex++] = gWindow->page;
+ gWindow->page = page;
+ display_page(gWindow->page);
+ gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
+ }
+ else
+ exitHyperDoc();
+}
+
+
+
+void
+make_window_link(char *name)
+{
+ if (init_top_window(name) != -1)
+{}/* gWindow->fWindowHashTable = gWindow->page->fLinkHashTable; */
+}
+
+
+void
+helpForHyperDoc(void)
+{
+ HyperDocPage *page = NULL;
+
+ /* do not do anything if we are already at the "no more help" page */
+
+ if (0 == strcmp(gWindow->page->name, NoMoreHelpPage))
+ return;
+
+ /* if no help page recorded, use the standard "no more help" page */
+
+ if (!gWindow->page->helppage)
+ gWindow->page->helppage = alloc_string(NoMoreHelpPage);
+
+ /* if we are on the main help page, use "no more help" page */
+
+ if (0 == strcmp(gWindow->page->name, TopLevelHelpPage))
+ gWindow->page->helppage = alloc_string(NoMoreHelpPage);
+
+ page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, gWindow->page->helppage);
+
+ if (page)
+ make_window_link(gWindow->page->helppage);
+ else
+ BeepAtTheUser();
+}
+
+
+void
exitHyperDoc(void)
{
XEvent event;
@@ -776,71 +833,6 @@
XFlush(gXDisplay);
}
-static int
-set_window(Window window)
-{
- Window root, parent, *children, grandparent,myarg;
- HDWindow *htw;
- unsigned int nchildren;
- int st;
-
- myarg=window;
- nchildren = 0;
- htw = (HDWindow *) hash_find(&gSessionHashTable, (char *)&myarg);
- if (htw != NULL) {
- gWindow = htw;
- return 1;
- }
- st = XQueryTree(gXDisplay, myarg, &root, &parent, &children, &nchildren);
- if (st==0) goto ERROR;
- if (nchildren > 0)
- XFree(children);
- htw = (HDWindow *) hash_find(&gSessionHashTable, (char *)&parent);
- if (htw != NULL) {
- gWindow = htw;
- return 1;
-
- }
- else {
- /* check for a grandparent */
- st = XQueryTree(gXDisplay, parent, &root, &grandparent, &children, &nchildren);
- if (st==0) goto ERROR;
- if (nchildren > 0)
- XFree(children);
- htw = (HDWindow *) hash_find(&gSessionHashTable, (char *)&grandparent);
- if (htw != NULL) {
- gWindow = htw;
- return 1;
- }
- }
-
- /*
- * fprintf(stderr, "window(%d) and it's parent(%d) aren't in
- * gSessionHashTable\n", window, parent);
-
- we never found that window. this happens if (not iff) we exit from
- an unfocused non-main window under certain wm's and click-to-type. the program returns here with
- the window handle that was just destroyed. So let's set the global gWindow
- to the main window.
- */
-
-ERROR:
- gWindow=gParentWindow;
- return 0;
-}
-
-/*
- * This procedure whips thru the stack and clears all expose events for the
- * given routine
- */
-static void
-clear_exposures(Window w)
-{
- XEvent report;
-
- XFlush(gXDisplay);
- while (XCheckTypedWindowEvent(gXDisplay, w, Expose, &report));
-}
void
get_new_window(void)
{
@@ -963,40 +955,9 @@
}
break;
}
- }
-static void
-set_cursor(HDWindow *window,Cursor state)
-{
- if (state == gBusyCursor)
- XDefineCursor(gXDisplay, window->fMainWindow, gBusyCursor);
- else if (state == gActiveCursor)
- XDefineCursor(gXDisplay, window->fMainWindow, gActiveCursor);
- else
- XDefineCursor(gXDisplay, window->fMainWindow, gNormalCursor);
- XFlush(gXDisplay);
}
static void
-change_cursor(Cursor state, HDWindow *window)
-{
- if (window->fDisplayedCursor == state)
- return;
- window->fDisplayedCursor = state;
- set_cursor(window, state);
-}
-
-static void
-handle_motion_event(XMotionEvent *event)
-{
- if (!gWindow)
- return;
- if (findButtonInList(gWindow, event->x, event->y) != NULL)
- change_cursor(gActiveCursor, gWindow);
- else
- change_cursor(gNormalCursor, gWindow);
-}
-
-static void
init_cursor_state(HDWindow *window)
{
if (window) {
@@ -1019,42 +980,83 @@
}
-static void
-make_busy_cursor(HDWindow *window)
-{
- change_cursor(gBusyCursor, window);
-}
+/*
+ * This is the main X loop. It keeps grabbing events. Since the only way the
+ * window can die is through an event, it never actually end. One of the
+ * subroutines it calls is responsible for killing everything
+ */
-static void
-make_busy_cursors(void)
+void
+mainEventLoop(void)
{
- hash_map(&gSessionHashTable, (MappableFunction)make_busy_cursor);
-}
+ XEvent event;
+ int Xcon;
+ fd_set rd, dum1, dum2;
+ motion = 0;
+ gActiveWindow = -1;
+ set_error_handlers();
+ Xcon = ConnectionNumber(gXDisplay);
-static int
-HyperDocErrorHandler(Display *display, XErrorEvent *xe)
-{
- if (xe->request_code != 15) {
- char buf[1024];
+ while (1) {
+/* fprintf(stderr,"event:mainEventLoop: loop top\n");*/
+ while (gSessionHashTable.num_entries == 0)
+ pause();
- XGetErrorText(display, xe->error_code, buf, sizeof(buf));
+ /* XFlush(gXDisplay); */
- fprintf(stderr, "error code = %d\n", xe->error_code);
- fprintf(stderr, "major op code = %d\n", xe->request_code);
- fprintf(stderr, "minor op code = %d\n", xe->minor_code);
- fprintf(stderr, "XID = %ld\n", xe->resourceid);
- fprintf(stderr, "%s\n", buf);
+ if (!motion)
+ init_cursor_states();
+ motion = 0;
- if (xe->request_code != 15)
- exit(-1);
- }
- return(0);
+ if (!spad_socket == 0) {
+ FD_ZERO(&rd);
+ FD_ZERO(&dum1);
+ FD_ZERO(&dum2);
+ FD_CLR(0, &dum1);
+ FD_CLR(0, &dum2);
+ FD_CLR(0, &rd);
+ FD_SET(spad_socket->socket, &rd);
+ FD_SET(Xcon, &rd);
+ if (!session_server == 0) {
+ FD_SET(session_server->socket, &rd);
+ }
+ if (XEventsQueued(gXDisplay, QueuedAlready)) {
+ XNextEvent(gXDisplay, &event);
+ handle_event(&event);
+ }
+ else {
+ select(FD_SETSIZE, &rd, &dum1, &dum2, NULL);
+ if (FD_ISSET(Xcon, &rd) ||
+ XEventsQueued(gXDisplay, QueuedAfterFlush)) {
+ XNextEvent(gXDisplay, &event);
+ handle_event(&event);
+ }
+ else if (FD_ISSET(spad_socket->socket, &rd))
+ /*
+ * Axiom Socket do what handle_event does The 100 is
+ * $SpadStuff in hypertex.boot
+ */
+ {
+ if (100 == get_int(spad_socket)) {
+ set_window(gParentWindow->fMainWindow);
+ make_busy_cursors();
+ get_new_window();
+ }
+ }
+ /*
+ * Session Socket Telling us about the death of a spadbuf
+ * (plus maybe more later) service_session_socket in
+ * spadint.c
+ */
+ else
+ if (session_server && FD_ISSET(session_server->socket, &rd)) {
+ service_session_socket();
+ }
+ }
+ }
+ else {
+ XNextEvent(gXDisplay, &event);
+ handle_event(&event);
+ }
+ }
}
-
-
-
-static void
-set_error_handlers(void)
-{
- XSetErrorHandler(HyperDocErrorHandler);
-}
Modified: trunk/src/hyper/event.h
===================================================================
--- trunk/src/hyper/event.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/event.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserbed.
Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,16 @@
#include "hyper.h"
+extern void sigusr2_handler(int sig);
+extern void sigcld_handler(int sig);
+extern void clean_socket(void);
+extern void init_page_structs(HDWindow * w);
+extern void helpForHyperDoc(void);
+extern void quitHyperDoc(void);
+extern void exitHyperDoc(void);
+extern void mainEventLoop(void);
+extern void make_window_link(char*);
+
extern Window gActiveWindow;
extern int gNeedIconName;
Modified: trunk/src/hyper/extent.h
===================================================================
--- trunk/src/hyper/extent.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/extent.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -68,6 +68,23 @@
#define dash_width 5
#define dash_y 4
+extern void compute_header_extent(HyperDocPage * page);
+extern void compute_footer_extent(HyperDocPage * page);
+extern void compute_scrolling_extent(HyperDocPage * page);
+extern void compute_title_extent(HyperDocPage * page);
+extern void compute_text_extent(TextNode * node);
+extern void init_extents(void );
+extern void init_text(void );
+extern void init_title_extents(HyperDocPage * page);
+extern void insert_bitmap_file(TextNode * node);
+extern void insert_pixmap_file(TextNode * node);
+extern int max_x(TextNode * node , int Ender);
+extern int plh(int height);
+extern void start_newline(int distance , TextNode * node);
+extern int text_height(TextNode * node , int Ender);
+extern int text_width(TextNode * node , int Ender);
+extern int total_width(TextNode * node , int Ender);
+extern int trailing_space(TextNode * node);
/* next two from display.h. Reorg! */
Modified: trunk/src/hyper/extent1.c
===================================================================
--- trunk/src/hyper/extent1.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/extent1.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,12 +40,9 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _EXTENT1_C
+
#include "openaxiom-c-macros.h"
-
#include "debug.h"
-
-
#include "sockio.h"
#include "extent.h"
#include "hyper.h"
@@ -53,9 +50,37 @@
#include "titlebar.h"
#include "scrollbar.h"
-#include "all_hyper_proto.H1"
+static void compute_begin_items_extent(TextNode * node);
+static void compute_bf_extent(TextNode * node);
+static void compute_box_extent(TextNode * node);
+static void compute_button_extent(TextNode * node);
+static void compute_center_extent(TextNode * node);
+static void compute_dash_extent(TextNode * node);
+static void compute_em_extent(TextNode * node);
+static void compute_ifcond_extent(TextNode * node);
+static void compute_image_extent(TextNode * node);
+static void compute_input_extent(TextNode * node);
+static void compute_ir_extent(TextNode * node);
+static void compute_it_extent(TextNode * node);
+static void compute_item_extent(TextNode * node);
+static void compute_mbox_extent(TextNode * node);
+static void compute_mitem_extent(TextNode * node);
+static void compute_paste_extent(TextNode * node);
+static void compute_pastebutton_extent(TextNode * node);
+static void compute_punctuation_extent(TextNode * node);
+static void compute_rm_extent(TextNode * node);
+static void compute_spadcommand_extent(TextNode * node);
+static void compute_spadsrc_extent(TextNode * node);
+static void compute_spadsrctxt_extent(TextNode * node);
+static void compute_table_extent(TextNode * * node);
+static void compute_verbatim_extent(TextNode * node);
+static void compute_word_extent(TextNode * node);
+static void end_spadcommand_extent(TextNode * node);
+static void end_spadsrc_extent(TextNode * node);
+static void endbutton_extent(TextNode * node);
+static void endif_extent(TextNode * node);
+static void endpastebutton_extent(TextNode * node);
-
/*
* Now we declare all the values which are shared among the extent routines
* and the showing routines
Modified: trunk/src/hyper/extent2.c
===================================================================
--- trunk/src/hyper/extent2.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/extent2.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -41,21 +41,23 @@
*
****************************************************************************/
-#define _EXTENT2_C
#include "openaxiom-c-macros.h"
-
#include "debug.h"
-
#include "halloc.h"
#include "sockio.h"
#include "extent.h"
#include "group.h"
#include "titlebar.h"
-
-#include "all_hyper_proto.H1"
-#include "pixmap.H1"
#include "cfuns.h"
+static void center_nodes(TextNode * begin_node , TextNode * end_node);
+static int input_string_width(TextNode * node);
+static int punctuation_width(TextNode * node);
+static int text_height1(TextNode * node , int Ender);
+static int verbatim_width(TextNode * node);
+static int width_of_dash(TextNode * node);
+static int word_width(TextNode * node);
+static int x_value(TextNode * node);
static int cur_height = 0;
static int max_x_value = 0;
Modified: trunk/src/hyper/form-ext.c
===================================================================
--- trunk/src/hyper/form-ext.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/form-ext.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,18 +33,18 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _FORM_EXT_C
#include "openaxiom-c-macros.h"
-
#include "debug.h"
-
#include "sockio.h"
#include "extent.h"
#include "group.h"
#include "scrollbar.h"
-#include "all_hyper_proto.H1"
+static int window_height(HyperDocPage * page);
+static void form_header_extent(HyperDocPage * page);
+static void form_footer_extent(HyperDocPage * page);
+static void form_scrolling_extent(HyperDocPage * page);
/*
Modified: trunk/src/hyper/group.c
===================================================================
--- trunk/src/hyper/group.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/group.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -41,17 +41,12 @@
*
****************************************************************************/
-#define _GROUP_C
-
#include "debug.h"
-
#include "halloc.h"
#include "sockio.h"
#include "group.h"
#include "initx.h"
-#include "all_hyper_proto.H1"
-
GroupItem *gTopOfGroupStack = NULL;
Modified: trunk/src/hyper/group.h
===================================================================
--- trunk/src/hyper/group.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/group.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,21 @@
#include "openaxiom-c-macros.h"
#include "hyper.h"
+extern void bf_top_group(void );
+extern GroupItem * copy_group_stack(void );
+extern void em_top_group(void );
+extern void free_group_stack(GroupItem * g);
+extern void init_group_stack(void );
+extern void init_top_group(void );
+extern void line_top_group(void );
+extern int pop_group_stack(void );
+extern void push_active_group(void );
+extern void push_group_stack(void );
+extern void push_spad_group(void );
+extern void rm_top_group(void );
+extern void tt_top_group(void );
+extern void center_top_group(void );
+
extern GroupItem *gTopOfGroupStack;
#endif
Modified: trunk/src/hyper/htadd.c
===================================================================
--- trunk/src/hyper/htadd.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/htadd.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2009, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -75,8 +75,6 @@
* in a file. This way someone can start
* including a line number counter into
* HyperDoc. */
-/* for compatibility with HyperDoc */
-openaxiom_sio *spad_socket = NULL;
int fresh = 0;
#define Delete 1
Modified: trunk/src/hyper/htinp.c
===================================================================
--- trunk/src/hyper/htinp.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/htinp.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,15 +33,12 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _HTINP_C
-#include "openaxiom-c-macros.h"
-
-#include "debug.h"
-
#include <sys/stat.h>
#include <sys/signal.h>
#include <setjmp.h>
+#include "openaxiom-c-macros.h"
+#include "debug.h"
#include "halloc.h"
#include "sockio.h"
#include "hyper.h"
@@ -49,8 +46,6 @@
#include "parse.h"
#include "bsdsignal.h"
#include "cfuns.h"
-
-#include "all_hyper_proto.H1"
#include "sockio.h"
extern char **input_file_list;
@@ -59,6 +54,15 @@
extern int kill_spad;
extern jmp_buf jmpbuf;
+static void make_input_file_list(void );
+static char * make_input_file_name(char * buf , char * filename);
+static char * make_paste_file_name(char * buf , char * filename);
+static void make_the_input_file(UnloadedPage * page);
+static void make_input_file_from_page(HyperDocPage * page);
+static int inListAndNewer(char * inputFile , char * htFile);
+static void print_paste(FILE * pfile , char * realcom , char * command , char * pagename , int com_type);
+static void print_graph_paste(FILE * pfile , char * realcom , char * command , char * pagename , int com_type);
+static void send_command(char * command , int com_type);
#define MaxInputFiles 256
char *active_file_list[MaxInputFiles];
Modified: trunk/src/hyper/hyper.c
===================================================================
--- trunk/src/hyper/hyper.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/hyper.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2009, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -43,14 +43,6 @@
/* Include all the needed include files */
-#define _HYPER_C
-
-#include "debug.h"
-
-#include "sockio.h"
-#include "hyper.h"
-#include "lex.h"
-
#include <sys/signal.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -59,15 +51,25 @@
#include <stdlib.h>
#include <locale.h>
+#include "debug.h"
+#include "sockio.h"
+#include "hyper.h"
+#include "lex.h"
#include "keyin.h"
#include "initx.h"
#include "event.h"
#include "hyper.h"
#include "bsdsignal.h"
-
-#include "all_hyper_proto.H1"
#include "sockio.h"
+#include "parse.h"
+static void init_hash(void);
+static void make_server_connections(void);
+static void check_arguments(void);
+static void init_hash(void);
+static void make_server_connections(void);
+static void check_arguments(void);
+
/*
* Here is a flag used to tell me whether I made a good connection to the
* menu server. Needed so I don't send spad commands when I should not
Modified: trunk/src/hyper/hyper.h
===================================================================
--- trunk/src/hyper/hyper.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/hyper.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
#include "token.h"
#include "hash.h"
#include "node.h"
+#include "pixmap.h"
#define boolean unsigned short int
@@ -57,6 +58,78 @@
#define FALSE ((boolean) 0x0)
#endif
+extern void sigusr2_handler(int sig);
+extern void sigcld_handler(int sig);
+extern void clean_socket(void);
+extern void init_page_structs(HDWindow * w);
+extern void push_item_stack(void);
+extern void clear_item_stack(void);
+extern void pop_item_stack(void);
+extern ItemStack * copy_item_stack(void);
+extern void free_item_stack(ItemStack * is);
+extern ButtonList * alloc_button_list(void);
+extern CondNode * alloc_condnode(void);
+extern HDWindow * alloc_hd_window(void);
+extern IfNode * alloc_ifnode(void);
+extern InputBox * alloc_inputbox(void);
+extern LineStruct * alloc_inputline(int size);
+extern TextNode * alloc_node(void);
+extern HyperDocPage * alloc_page(char * name);
+extern PasteNode * alloc_paste_node(char * name);
+extern RadioBoxes * alloc_rbs(void);
+extern void free_button_list(ButtonList * bl);
+extern void free_hd_window(HDWindow * w);
+extern void free_input_item(InputItem * sym , short des);
+extern void free_input_list(InputItem * il);
+extern void free_node(TextNode * node , short des);
+extern void free_page(HyperDocPage * page);
+extern void free_patch(PatchStore * p);
+extern void free_string(char * str);
+extern char * resizeBuffer(int size , char * oldBuf , int * oldSize);
+extern PatchStore * alloc_patchstore(void);
+extern InputItem * return_item(char * name);
+extern void fill_box(Window w , ImageStruct * image);
+extern void toggle_input_box(HyperLink * link);
+extern void toggle_radio_box(HyperLink * link);
+extern void change_input_focus(HyperLink * link);
+extern void next_input_focus(void);
+extern void prev_input_focus(void);
+extern int delete_item(char * name);
+extern XImage * HTReadBitmapFile(Display * display , int screen , char * filename , int * width , int * height);
+extern ImageStruct * insert_image_struct(char * filename);
+extern void compute_form_page(HyperDocPage * page);
+extern int window_width(int cols);
+extern void ht2_input(void );
+extern void make_record(void );
+extern void verify_record(void );
+extern char * strCopy(char * s);
+extern void print_paste_line(FILE * pfile , char * str);
+extern void get_spad_output(FILE * pfile , char * command , int com_type);
+extern void get_graph_output(char * command , char * pagename , int com_type);
+extern void add_buffer_to_sym(char * buffer , InputItem * sym);
+extern void dialog(XEvent * event , KeySym keysym , char * buffer);
+extern void draw_inputsymbol(InputItem * sym);
+extern void update_inputsymbol(InputItem * sym);
+extern HyperDocPage * issue_server_command(HyperLink * link);
+extern HyperDocPage * issue_unixlink(TextNode * node);
+extern char * print_to_string(TextNode * command);
+extern void issue_spadcommand(HyperDocPage * page , TextNode * command , int immediate , int type);
+extern openaxiom_sio * accept_menu_connection(openaxiom_sio * server_sock);
+extern char * print_to_string1(TextNode * command , int * sizeBuf);
+extern int issue_serverpaste(TextNode * command);
+extern void issue_unixcommand(TextNode * node);
+extern int issue_unixpaste(TextNode * node);
+extern void service_session_socket(void);
+extern void send_lisp_command(char * command);
+extern void escape_string(char * s);
+extern void unescape_string(char * s);
+extern char * print_source_to_string1(TextNode * command , int * sizeBuf);
+extern char * print_source_to_string(TextNode * command);
+extern void change_cond(char * label , char * newcond);
+extern int check_condition(TextNode * node);
+extern void insert_cond(char * label , char * cond);
+
+
#ifndef HTADD
extern int MenuServerOpened;
Modified: trunk/src/hyper/initx.c
===================================================================
--- trunk/src/hyper/initx.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/initx.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,6 @@
/* #define DEBUG 1 */
-#define _INITX_C
#include "openaxiom-c-macros.h"
#include <unistd.h>
@@ -67,18 +66,23 @@
#include "hyper.h"
#include "scrollbar.h"
#include "titlebar.h"
-
-#include "all_hyper_proto.H1"
#include "util.H1"
#include "cfuns.h"
-
#include "spadcolors.h"
-#include "spadcolors.H1"
-
#include "mouse11.bitmap"
#include "mouse11.mask"
+static void get_GCs(HDWindow * window);
+static int get_border_properties(void);
+static int get_color(char * , char * , int, Colormap*);
+static void ingItColors_and_fonts(void);
+static void load_font(XFontStruct * * font_info , char * fontname);
+static void mergeDatabases(void);
+static void open_form_window(void);
+static void open_window(Window w);
+static void set_name_and_icon(void);
+static void set_size_hints(Window w);
static GContext server_font;
unsigned long *spadColors;
@@ -893,7 +897,7 @@
*/
static int
-get_color(char *name, char *class, int def, Colormap *map)
+get_color(char *name, char *klass, int def, Colormap *map)
{
char fullname[256];
char fullclass[256];
@@ -911,7 +915,7 @@
strcpy(fullname, "OpenAxiom.hyperdoc.");
strcat(fullname, name);
strcpy(fullclass,"OpenAxiom.hyperdoc.");
- strcat(fullclass,class);
+ strcat(fullclass, klass);
if (XrmGetResource(rDB, fullname, fullclass, str_type, &value) == True) {
(void) strncpy(prop, value.addr, (int) value.size);
Modified: trunk/src/hyper/initx.h
===================================================================
--- trunk/src/hyper/initx.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/initx.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,12 @@
#include "hyper.h"
+extern void change_text(int color , XFontStruct * font);
+extern int init_form_window(char * name , int cols);
+extern int init_top_window(char * name);
+extern void initializeWindowSystem(void);
+extern int is_it_850(XFontStruct * fontarg);
+
extern int gBorderColor;
#endif
Modified: trunk/src/hyper/input.c
===================================================================
--- trunk/src/hyper/input.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/input.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,16 +33,13 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _INPUT_C
#include "openaxiom-c-macros.h"
-
#include "debug.h"
#include "sockio.h"
#include "hyper.h"
-#include "all_hyper_proto.H1"
+static void clear_rbs(InputBox * list);
-
void
fill_box(Window w,ImageStruct * image)
{
Modified: trunk/src/hyper/item.c
===================================================================
--- trunk/src/hyper/item.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/item.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -35,13 +35,10 @@
#include "openaxiom-c-macros.h"
#include "sockio.h"
-#define _ITEM_C
#include "debug.h"
#include "halloc.h"
#include "extent.h"
-#include "all_hyper_proto.H1"
-
/*
* Here are structures needed for manipulating the item stack
*/
@@ -92,25 +89,25 @@
ItemStack *
copy_item_stack(void)
{
- ItemStack *new = NULL;
+ ItemStack *stack = NULL;
ItemStack *prev = NULL;
ItemStack *trace = gTopOfItemStack;
ItemStack *first = NULL;
while (trace) {
- new = (ItemStack *) halloc(sizeof(ItemStack), "Item stack");
- new->indent = trace->indent;
- new->item_indent = trace->item_indent;
- new->in_item = gInItem;
+ stack = (ItemStack *) halloc(sizeof(ItemStack), "Item stack");
+ stack->indent = trace->indent;
+ stack->item_indent = trace->item_indent;
+ stack->in_item = gInItem;
if (!first)
- first = new;
+ first = stack;
else
- prev->next = new;
- prev = new;
+ prev->next = stack;
+ prev = stack;
trace = trace->next;
}
- if (new)
- new->next = NULL;
+ if (stack)
+ stack->next = NULL;
return first;
}
Modified: trunk/src/hyper/keyin.c
===================================================================
--- trunk/src/hyper/keyin.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/keyin.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,11 +40,10 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _KEYIN_C
-#include "openaxiom-c-macros.h"
+#include <X11/keysym.h>
+#include "openaxiom-c-macros.h"
#include "debug.h"
-
#include "halloc.h"
#include "sockio.h"
#include "hyper.h"
@@ -53,10 +52,7 @@
#include "parse.h"
#include "scrollbar.h"
-#include "all_hyper_proto.H1"
-#include <X11/keysym.h>
-
#define min(x,y) ( (x<y)?(x):(y))
int in_cursor_height;
Modified: trunk/src/hyper/keyin.h
===================================================================
--- trunk/src/hyper/keyin.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/keyin.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,9 @@
#ifndef _KEYIN_H_
#define _KEYIN_H_ 1
+extern void handle_key(XEvent * event);
+extern void init_keyin(void);
+
extern int in_cursor_height;
extern int in_cursor_width;
extern int out_cursor_height;
Modified: trunk/src/hyper/macro.c
===================================================================
--- trunk/src/hyper/macro.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/macro.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,9 +33,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _MACRO_C
#include "openaxiom-c-macros.h"
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
@@ -43,9 +41,9 @@
#include "hyper.h"
#include "lex.h"
-#include "all_hyper_proto.H1"
+static char * load_macro(MacroStore * macro);
+static void get_parameter_strings(int number , char * macro_name);
-
/* #define DEBUG 1 */
/*
@@ -178,35 +176,35 @@
ParameterList
init_parameter_elem(int number)
{
- ParameterList new;
+ ParameterList parms;
int count;
/** allocate the space neeeded **/
- new = (ParameterList) halloc(sizeof(struct parameter_list_type),
+ parms = (ParameterList) halloc(sizeof(struct parameter_list_type),
"ParameterList");
/** now allocate the memeory for the pointers to the parameters **/
if (number) {
- new->list = (char **) halloc(number * sizeof(char *), "Parameter List");
+ parms->list = (char **) halloc(number * sizeof(char *), "Parameter List");
/** initialize my pointers **/
for (count = 0; count < number; count++)
- (new->list)[count] = NULL;
+ (parms->list)[count] = NULL;
}
- new->number = number;
- return new;
+ parms->number = number;
+ return parms;
}
int
-push_parameters(ParameterList new)
+push_parameters(ParameterList parms)
{
- if (new == NULL) {
+ if (parms == NULL) {
fprintf(stderr, "Tried pushing a null list onto the parameter stack\n");
longjmp(jmpbuf, 1);
}
- new->next = parameters;
- parameters = new;
+ parms->next = parameters;
+ parameters = parms;
return 1;
}
int
@@ -291,13 +289,13 @@
int lbrace_counter;
char c;
int size;
- ParameterList new = init_parameter_elem(number);
+ ParameterList parms = init_parameter_elem(number);
int pnum;
char pnum_chars[5];
int pc;
if (!number) { /* nothing to be done */
- push_parameters(new);
+ push_parameters(parms);
return;
}
for (count = 0; count < number; count++) {
@@ -362,10 +360,10 @@
*buffer_pntr = '\0';
/*** Now add it to the current parameter list **/
size = strlen(buffer) + 1;
- new->list[count] = (char *) halloc(size, "Parameter Strings");
- strcpy(new->list[count], buffer);
+ parms->list[count] = (char *) halloc(size, "Parameter Strings");
+ strcpy(parms->list[count], buffer);
}
- push_parameters(new);
+ push_parameters(parms);
return ;
}
void
Modified: trunk/src/hyper/mem.c
===================================================================
--- trunk/src/hyper/mem.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/mem.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reversed.
Redistribution and use in source and binary forms, with or without
@@ -40,20 +40,27 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _MEM_C
#include "debug.h"
-
#include "halloc.h"
#include "sockio.h"
#include "hyper.h"
#include "group.h"
#include "event.h"
+#include "parse.h"
-#include "all_hyper_proto.H1"
+static void free_cond(CondNode * cond);
+static void free_depend(SpadcomDepend * sd);
+static void free_lines(LineStruct * lines);
+static void dont_free(void * link);
+static void free_if_non_NULL(void * p);
+static void free_input_box(InputBox * box);
+static void free_paste(PasteNode * paste , short des);
+static void free_pastearea(TextNode * node , short des);
+static void free_pastebutton(TextNode * node , short des);
+static void free_radio_boxes(RadioBoxes * radio);
-
extern HashTable init_page_hash;
extern HashTable init_macro_hash;
extern HashTable init_patch_hash;
Modified: trunk/src/hyper/parse-aux.c
===================================================================
--- trunk/src/hyper/parse-aux.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse-aux.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reverved.
Redistribution and use in source and binary forms, with or without
@@ -34,8 +34,6 @@
*/
#include "openaxiom-c-macros.h"
-#define _PARSE_AUX_C
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
@@ -44,9 +42,9 @@
#include "lex.h"
#include "hyper.h"
-#include "all_hyper_proto.H1"
+static void read_ht_file(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash , FILE * db_fp , char * db_file);
+static HyperDocPage * make_special_page(int type , char * name);
-
extern int make_input_file;
extern int gverify_dates;
Modified: trunk/src/hyper/parse-input.c
===================================================================
--- trunk/src/hyper/parse-input.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse-input.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,15 +34,12 @@
*/
#include "openaxiom-c-macros.h"
-#define _PARSE_INPUT_C
/***
Contains all the code needed to parse input items,
InputString
SimpleBox
RadioBox.
****/
-
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
@@ -50,7 +47,9 @@
#include "lex.h"
#include "hyper.h"
-#include "all_hyper_proto.H1"
+static void insert_item(InputItem * item);
+static void add_box_to_rb_list(char * name , InputBox * box);
+static int check_others(InputBox * list);
/* create an unmapped input window for getting strings * */
extern int make_input_file;
Modified: trunk/src/hyper/parse-paste.c
===================================================================
--- trunk/src/hyper/parse-paste.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse-paste.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,11 +40,9 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _PARSE_PASTE_C
-#include "openaxiom-c-macros.h"
+#include "openaxiom-c-macros.h"
#include "debug.h"
-
#include "halloc.h"
#include "sockio.h"
#include "parse.h"
@@ -53,9 +51,8 @@
#include "group.h"
#include "lex.h"
-#include "all_hyper_proto.H1"
+static void load_patch(PatchStore * patch);
-
short int gInPaste;
@@ -212,11 +209,11 @@
HyperDocPage *
parse_patch(PasteNode *paste)
{
- TextNode *new;
+ TextNode *new_paste;
TextNode *end_node;
TextNode *begin_node;
TextNode *arg_node;
- TextNode *throw;
+ TextNode *old;
TextNode *next_node;
InputItem *paste_item = paste->paste_item;
int where = paste->where;
@@ -231,7 +228,7 @@
next_node = end_node->next;
begin_node = paste->begin_node;
arg_node = paste->arg_node;
- throw = begin_node->next;
+ old = begin_node->next;
/* now read the new stuff and add it in between all this stuff */
@@ -289,7 +286,7 @@
end_node->next = 0;
- free_node(throw, 1);
+ free_node(old, 1);
init_parse_patch(gWindow->page);
init_paste_item(paste_item);
@@ -324,14 +321,14 @@
jump();
}
}
- new = alloc_node();
- curr_node = new;
+ new_paste = alloc_node();
+ curr_node = new_paste;
parse_HyperDoc();
/* Once I am back, I need only reallign all the text structures */
curr_node->type = openaxiom_Noop_token;
curr_node->next = next_node;
- begin_node->next = new;
+ begin_node->next = new_paste;
begin_node->type = openaxiom_Noop_token;
free(begin_node->data.text);
begin_node->data.text = 0;
Modified: trunk/src/hyper/parse-paste.h
===================================================================
--- trunk/src/hyper/parse-paste.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse-paste.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyirght (C) 2007-2008, Gabriel Dos Reis.
+ Copyirght (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,10 @@
#include "openaxiom-c-macros.h"
#include "hyper.h"
+extern void parse_paste(void);
+extern void parse_pastebutton(void);
+extern HyperDocPage * parse_patch(PasteNode * paste);
+
extern short int gInPaste;
#endif
Modified: trunk/src/hyper/parse-types.c
===================================================================
--- trunk/src/hyper/parse-types.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse-types.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,9 +40,8 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _PARSE_TYPES_C
+
#include "openaxiom-c-macros.h"
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
@@ -53,7 +52,8 @@
#include "extent.h"
#include "cfuns.h"
-#include "all_hyper_proto.H1"
+static void parse_condnode(void );
+static void parse_hasreturnto(void );
boolean gInButton = FALSE;
boolean gInIf = FALSE;
Modified: trunk/src/hyper/parse-types.h
===================================================================
--- trunk/src/hyper/parse-types.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse-types.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,29 @@
#include "hyper.h"
+extern void parse_begin_items(void );
+extern void parse_box(void );
+extern void parse_button(void );
+extern void parse_centerline(void );
+extern void parse_command(void );
+extern void parse_env(TextNode * node);
+extern void parse_free(void );
+extern void parse_help(void );
+extern void parse_ifcond(void );
+extern void parse_input_pix(void );
+extern void parse_item(void );
+extern void parse_mbox(void );
+extern void parse_mitem(void );
+extern void parse_newcond(void );
+extern void parse_setcond(void );
+extern void parse_spadcommand(TextNode * spad_node);
+extern void parse_spadsrc(TextNode * spad_node);
+extern void parse_table(void );
+extern void parse_value1(void );
+extern void parse_value2(void );
+extern void parse_verbatim(int type);
+extern void show_text(TextNode * node , int Ender);
+
extern boolean gInButton;
extern boolean gInIf;
extern boolean gInItems;
Modified: trunk/src/hyper/parse.c
===================================================================
--- trunk/src/hyper/parse.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,6 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#define _PARSE_C
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
@@ -50,10 +48,19 @@
#include "scrollbar.h"
#include "titlebar.h"
-#include "all_hyper_proto.H1"
+static void end_a_page(void );
+static HyperDocPage * format_page(UnloadedPage * ulpage);
+static void parse_page(HyperDocPage * page);
+static void parse_replacepage(void );
+static void start_footer(void );
+static void start_scrolling(void );
+static void Push_MR(void );
+static void Pop_MR(void );
+static void parse_title(HyperDocPage * page);
+static void parse_header(HyperDocPage * page);
+static void init_parse_page(HyperDocPage * page);
-
TextNode *curr_node; /* current node being parsed. It is to be the
* next one filled */
HashTable *gLinkHashTable; /* the hash table of active link windows */
Modified: trunk/src/hyper/parse.h
===================================================================
--- trunk/src/hyper/parse.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/parse.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,46 @@
#include <setjmp.h>
+extern void display_page(HyperDocPage * page);
+extern void init_parse_patch(HyperDocPage * page);
+extern void load_page(HyperDocPage * page);
+extern void parse_HyperDoc(void );
+extern void parse_from_string(char * str);
+extern HyperDocPage * parse_page_from_socket(void );
+extern HyperDocPage * parse_page_from_unixfd(void );
+extern HyperLink * make_input_window(InputItem * item);
+extern HyperLink * make_box_window(InputBox * box , int type);
+extern void initialize_default(InputItem * item , char * buff);
+extern void parse_inputstring(void);
+extern void parse_simplebox(void);
+extern void parse_radiobox(void);
+extern void init_paste_item(InputItem * item);
+extern void repaste_item(void);
+extern InputItem * current_item(void);
+extern int already_there(char * name);
+extern void parse_radioboxes(void);
+extern void add_dependencies(void );
+extern FILE * find_fp(FilePosition fp);
+extern char * get_input_string(void );
+extern HyperLink * make_link_window(TextNode * link_node , int type , int isSubWin);
+extern HyperLink * make_paste_window(PasteNode * paste);
+extern void make_special_pages(HashTable * pageHashTable);
+extern int window_code(Window * w , int size);
+extern int window_equal(Window * w1 , Window * w2);
+extern char * window_id(Window w);
+extern void read_ht_db(HashTable * page_hash , HashTable * macro_hash , HashTable * patch_hash);
+extern int get_filename(void);
+extern int is_number(char * str);
+extern void parser_error(char * str);
+extern int get_where(void);
+extern void scan_HyperDoc(void);
+extern int number(char * str);
+extern ParameterList init_parameter_elem(int number);
+extern int push_parameters(ParameterList);
+extern int pop_parameters(void);
+extern int parse_macro(void);
+extern void parse_parameters(void);
+
extern jmp_buf jmpbuf;
extern int vbuff;
Modified: trunk/src/hyper/scrollbar.c
===================================================================
--- trunk/src/hyper/scrollbar.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/scrollbar.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,9 +40,8 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _SCROLLBAR_C
+
#include "openaxiom-c-macros.h"
-
#include "debug.h"
#include "halloc.h"
#include "sockio.h"
@@ -53,8 +52,6 @@
#include "scrollbar.h"
#include "parse.h"
-#include "all_hyper_proto.H1"
-
/*************************************************************************
Scrollbar Comments 10/08/89
@@ -95,6 +92,10 @@
**************************************************************************/
+static int ch(int height);
+static void changeWindowBackgroundPixmap(Window window , Pixmap pixmap);
+static void drawScroller3DEffects(HDWindow * hdWindow , int x1 , int y1 , int x2 , int y2);
+
static int ch(int height);
static void changeWindowBackgroundPixmap(Window window, Pixmap pixmap);
Modified: trunk/src/hyper/scrollbar.h
===================================================================
--- trunk/src/hyper/scrollbar.h 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/scrollbar.h 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,21 @@
#include "hyper.h"
+extern void calculateScrollBarMeasures(void );
+extern void drawScrollLines(void );
+extern void hideScrollBars(HDWindow * hdWindow);
+extern void getScrollBarMinimumSize(int * width , int * height);
+extern void linkScrollBars(void );
+extern void makeScrollBarWindows(void );
+extern void moveScroller(HDWindow * hdWindow);
+extern void scrollDown(void );
+extern void scrollDownPage(void );
+extern void scrollScroller(XButtonEvent * event);
+extern void scrollToFirstPage(void );
+extern void scrollUp(void );
+extern void scrollUpPage(void );
+extern void showScrollBars(HDWindow * hdWindow);
+
extern int gScrollbarWidth;
#endif
Modified: trunk/src/hyper/show-types.c
===================================================================
--- trunk/src/hyper/show-types.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/show-types.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,21 +40,24 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _SHOW_TYPES_C
+
#include "openaxiom-c-macros.h"
-
#include "debug.h"
-
#include "sockio.h"
#include "hyper.h"
#include "display.h"
#include "extent.h"
#include "group.h"
-#include "all_hyper_proto.H1"
+static void show_image(TextNode * node , GC gc);
+static void show_input(TextNode * node);
+static void show_link(TextNode * node);
+static void show_paste(TextNode * node);
+static void show_pastebutton(TextNode * node);
+static void show_simple_box(TextNode * node);
+static void show_spadcommand(TextNode * node);
-
/*
* Display the page whose extent has been computed, using the actual size of
* the window, and y_off to determine clipped areas
Modified: trunk/src/hyper/spadint.c
===================================================================
--- trunk/src/hyper/spadint.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/spadint.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -36,22 +36,26 @@
/* Still a problem with close_client */
/* Communication interface for external OpenAxiom buffers */
-#define _SPADINT_C
#include "open-axiom.h"
#include "debug.h"
-
#include <signal.h>
#include "halloc.h"
#include "sockio.h"
#include "hyper.h"
#include "parse.h"
#include "bsdsignal.h"
-
-#include "all_hyper_proto.H1"
#include "sockio.h"
#include "cfuns.h"
+static void start_user_buffer(HyperDocPage * page);
+static void clear_execution_marks(HashTable * depend_hash);
+static void issue_dependent_commands(HyperDocPage * page , TextNode * command , int type);
+static void send_pile(openaxiom_sio * sock , char * str);
+static void mark_as_executed(HyperDocPage * page , TextNode * command , int type);
+static void accept_menu_server_connection(HyperDocPage * page);
+static void switch_frames(void );
+static void close_client(int pid);
typedef struct sock_list { /* linked list of openaxiom_sio */
openaxiom_sio Socket;
@@ -59,9 +63,7 @@
} Sock_List;
Sock_List *plSock = (Sock_List *) 0;
-openaxiom_sio *spad_socket = (openaxiom_sio *) 0; /* to_server socket for SpadServer */
-
/* connect to OpenAxiom , return 0 if succesful, 1 if not */
int
connect_spad(void)
Modified: trunk/src/hyper/titlebar.c
===================================================================
--- trunk/src/hyper/titlebar.c 2010-07-29 15:43:35 UTC (rev 1727)
+++ trunk/src/hyper/titlebar.c 2010-07-29 19:52:43 UTC (rev 1728)
@@ -1,7 +1,7 @@
/*
Copyright (C) 1991-2002, The Numerical Algorithms Group Ltd.
All rights reserved.
- Copyright (C) 2007-2008, Gabriel Dos Reis.
+ Copyright (C) 2007-2010, Gabriel Dos Reis.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -40,13 +40,10 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _TITLEBAR_C
-#include "openaxiom-c-macros.h"
-#include "debug.h"
-
#include <stdlib.h>
-
+#include "openaxiom-c-macros.h"
+#include "debug.h"
#include "halloc.h"
#include "sockio.h"
#include "titlebar.h"
@@ -55,8 +52,9 @@
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|