aboutsummaryrefslogtreecommitdiff
path: root/src/hyper
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-07-29 19:52:43 +0000
committerdos-reis <gdr@axiomatics.org>2010-07-29 19:52:43 +0000
commit1b7a0340896d0fb7b2d99ba9c1358cac9f7b03d3 (patch)
treee0776cb40c64012874aee5767f27ee183d3ea537 /src/hyper
parent17004f202c892fd4d933b94c6b7441c45a06e80b (diff)
downloadopen-axiom-1b7a0340896d0fb7b2d99ba9c1358cac9f7b03d3.tar.gz
* 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
Diffstat (limited to 'src/hyper')
-rw-r--r--src/hyper/Makefile.in14
-rw-r--r--src/hyper/ReadBitmap.c9
-rw-r--r--src/hyper/cond.c9
-rw-r--r--src/hyper/dialog.c35
-rw-r--r--src/hyper/display.c5
-rw-r--r--src/hyper/display.h7
-rw-r--r--src/hyper/event.c968
-rw-r--r--src/hyper/event.h12
-rw-r--r--src/hyper/extent.h19
-rw-r--r--src/hyper/extent1.c39
-rw-r--r--src/hyper/extent2.c16
-rw-r--r--src/hyper/form-ext.c10
-rw-r--r--src/hyper/group.c7
-rw-r--r--src/hyper/group.h17
-rw-r--r--src/hyper/htadd.c4
-rw-r--r--src/hyper/htinp.c20
-rw-r--r--src/hyper/hyper.c24
-rw-r--r--src/hyper/hyper.h75
-rw-r--r--src/hyper/initx.c22
-rw-r--r--src/hyper/initx.h8
-rw-r--r--src/hyper/input.c7
-rw-r--r--src/hyper/item.c25
-rw-r--r--src/hyper/keyin.c10
-rw-r--r--src/hyper/keyin.h5
-rw-r--r--src/hyper/macro.c38
-rw-r--r--src/hyper/mem.c19
-rw-r--r--src/hyper/parse-aux.c8
-rw-r--r--src/hyper/parse-input.c9
-rw-r--r--src/hyper/parse-paste.c23
-rw-r--r--src/hyper/parse-paste.h6
-rw-r--r--src/hyper/parse-types.c8
-rw-r--r--src/hyper/parse-types.h25
-rw-r--r--src/hyper/parse.c17
-rw-r--r--src/hyper/parse.h42
-rw-r--r--src/hyper/scrollbar.c11
-rw-r--r--src/hyper/scrollbar.h17
-rw-r--r--src/hyper/show-types.c15
-rw-r--r--src/hyper/spadint.c16
-rw-r--r--src/hyper/titlebar.c12
-rw-r--r--src/hyper/titlebar.h7
40 files changed, 955 insertions, 685 deletions
diff --git a/src/hyper/Makefile.in b/src/hyper/Makefile.in
index 8b8dafa5..d690bf35 100644
--- a/src/hyper/Makefile.in
+++ b/src/hyper/Makefile.in
@@ -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 @@ distclean-local: clean-local
.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 @@ ${OUTLIB}/presea: presea
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)
diff --git a/src/hyper/ReadBitmap.c b/src/hyper/ReadBitmap.c
index 0046726f..d1ada58c 100644
--- a/src/hyper/ReadBitmap.c
+++ b/src/hyper/ReadBitmap.c
@@ -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
diff --git a/src/hyper/cond.c b/src/hyper/cond.c
index f1930a89..1771ca02 100644
--- a/src/hyper/cond.c
+++ b/src/hyper/cond.c
@@ -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)
diff --git a/src/hyper/dialog.c b/src/hyper/dialog.c
index 5d067a4a..36be2390 100644
--- a/src/hyper/dialog.c
+++ b/src/hyper/dialog.c
@@ -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()
{
diff --git a/src/hyper/display.c b/src/hyper/display.c
index e8ce034e..e7d493f6 100644
--- a/src/hyper/display.c
+++ b/src/hyper/display.c
@@ -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,8 +63,7 @@
#include "group.h"
#include "scrollbar.h"
#include "titlebar.h"
-
-#include "all_hyper_proto.H1"
+#include "parse-types.h"
extern ItemStack *gTopOfItemStack;
diff --git a/src/hyper/display.h b/src/hyper/display.h
index 39bcf2a7..ef630f18 100644
--- a/src/hyper/display.h
+++ b/src/hyper/display.h
@@ -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;
diff --git a/src/hyper/event.c b/src/hyper/event.c
index 80c907d3..0ba54a27 100644
--- a/src/hyper/event.c
+++ b/src/hyper/event.c
@@ -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,12 +34,8 @@
*/
#define _EVENT_C
-#include "openaxiom-c-macros.h"
-
-#include "debug.h"
-#include "sockio.h"
-#include "hyper.h"
+#include "openaxiom-c-macros.h"
#include <X11/X.h>
#include <X11/Xatom.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 @@ unsigned long bigmask= 0xffffffff;
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);
-
- while (1) {
-/* fprintf(stderr,"event:mainEventLoop: loop top\n");*/
- while (gSessionHashTable.num_entries == 0)
- pause();
+ if (xe->request_code != 15) {
+ char buf[1024];
- /* XFlush(gXDisplay); */
+ XGetErrorText(display, xe->error_code, buf, sizeof(buf));
- if (!motion)
- init_cursor_states();
- motion = 0;
+ 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 (!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;
-
- 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); */
+ XSetErrorHandler(HyperDocErrorHandler);
+}
- /* try to get the selection as a window property */
+static int
+set_window(Window window)
+{
+ Window root, parent, *children, grandparent,myarg;
+ HDWindow *htw;
+ unsigned int nchildren;
+ int st;
- 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;
+ 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;
- 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;
+ }
+ 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;
+ }
+ }
- for (pBuffer = pSelection; *pBuffer; ++pBuffer)
- add_buffer_to_sym(pBuffer, item);
+ /*
+ * 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.
+ */
- XFree(pSelection);
- }
- }
+ERROR:
+ gWindow=gParentWindow;
+ return 0;
+}
- /* clear the link info */
- gSavedInputAreaLink = NULL;
- }
- break;
+static HyperLink *
+findButtonInList(HDWindow * window, int x, int y)
+{
+ ButtonList *bl;
- default:
-/* fprintf(stderr,"event:handle_event type=default\n");*/
- break;
- }
+ 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 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
*/
-
-void
-quitHyperDoc(void)
+static void
+clear_exposures(Window w)
{
- HyperDocPage *page;
+ XEvent report;
- 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();
+ XFlush(gXDisplay);
+ while (XCheckTypedWindowEvent(gXDisplay, w, Expose, &report));
}
+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;
+}
-/*
- * 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);
- }
- else {
- if (page->type == UnloadedPageType)
- page->type = UlUnknownPage;
- else
- page->type = UnknownPage;
+ if ( paste->end_node ==NULL || paste->begin_node==NULL || paste->arg_node==NULL ){
+ BeepAtTheUser();
+ return NULL;
}
- }
- return page;
-}
-
-/*
- * These are macros for taking care of the downlink stack, and the memolink
- * stack.
- */
-
-#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 */
+ page=parse_patch(paste);
+/* paste has changed after this call so use pastewhere*/
-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,6 +319,60 @@ uplink(void)
}
}
+/*
+ * 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)
{
@@ -456,14 +387,6 @@ windowlink_handler(TextNode * node)
/* 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,86 +407,36 @@ lispwindowlink_handler(HyperLink * link)
}
}
-static HyperDocPage *
-paste_button(PasteNode * paste)
-{
- HyperDocPage *page = NULL;
- int pastewhere=paste->where;
-
-
- if ( paste->end_node ==NULL || paste->begin_node==NULL || paste->arg_node==NULL ){
- BeepAtTheUser();
- return NULL;
- }
-
- page=parse_patch(paste);
-/* paste has changed after this call so use pastewhere*/
-
- if (pastewhere && page ) {
- if (0 == strcmp(page->name, "ErrorPage"))
- page = NULL;
- }
- else
- BeepAtTheUser();
-
- return page;
-}
-
-void
-helpForHyperDoc(void)
+static void
+create_window(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);
+ XWindowAttributes wa;
- page = (HyperDocPage *) hash_find(gWindow->fPageHashTable, gWindow->page->helppage);
+ XGetWindowAttributes(gXDisplay, gWindow->fMainWindow, &wa);
- if (page)
- make_window_link(gWindow->page->helppage);
- else
- BeepAtTheUser();
-}
+ gWindow->width = wa.width;
+ gWindow->height = wa.height;
+ display_page(gWindow->page);
+ gWindow->fWindowHashTable = gWindow->page->fLinkHashTable;
-static HyperLink *
-findButtonInList(HDWindow * window, int x, int y)
-{
- ButtonList *bl;
+ /* 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 (!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;
+/*
+ * These are macros for taking care of the downlink stack, and the memolink
+ * stack.
+ */
- l1 = (HyperLink *) hash_find(gWindow->fWindowHashTable, (char *)&(event->window));
- if (l1)
- return l1;
- l2 = findButtonInList(gWindow, event->x, event->y);
- return l2;
-}
+#define NotSpecial(t) \
+ ((t == openaxiom_Quitbutton_token || t == openaxiom_Returnbutton_token \
+ || t == openaxiom_Upbutton_token || t == UnknownPage \
+ || t == UlUnknownPage || t == ErrorPage) \
+ ?(0):(1))
/*
* Handle a button pressed event. window is the subwindow in which the event
@@ -736,6 +609,190 @@ handle_button(int button, XButtonEvent * event)
}
+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)
{
@@ -776,71 +833,6 @@ exitHyperDoc(void)
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,37 +955,6 @@ get_new_window(void)
}
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
@@ -1019,42 +980,83 @@ init_cursor_states(void)
}
-static void
-make_busy_cursor(HDWindow *window)
-{
- change_cursor(gBusyCursor, window);
-}
-
-static void
-make_busy_cursors(void)
-{
- hash_map(&gSessionHashTable, (MappableFunction)make_busy_cursor);
-}
+/*
+ * 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 int
-HyperDocErrorHandler(Display *display, XErrorEvent *xe)
+void
+mainEventLoop(void)
{
- if (xe->request_code != 15) {
- char buf[1024];
-
- XGetErrorText(display, xe->error_code, buf, sizeof(buf));
-
- 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);
+ XEvent event;
+ int Xcon;
+ fd_set rd, dum1, dum2;
+ motion = 0;
+ gActiveWindow = -1;
+ set_error_handlers();
+ Xcon = ConnectionNumber(gXDisplay);
- if (xe->request_code != 15)
- exit(-1);
- }
- return(0);
-}
+ while (1) {
+/* fprintf(stderr,"event:mainEventLoop: loop top\n");*/
+ while (gSessionHashTable.num_entries == 0)
+ pause();
+ /* XFlush(gXDisplay); */
+ if (!motion)
+ init_cursor_states();
+ motion = 0;
-static void
-set_error_handlers(void)
-{
- XSetErrorHandler(HyperDocErrorHandler);
+ 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);
+ }
+ }
}
diff --git a/src/hyper/event.h b/src/hyper/event.h
index 517fc3ea..5a4971f0 100644
--- a/src/hyper/event.h
+++ b/src/hyper/event.h
@@ -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;
diff --git a/src/hyper/extent.h b/src/hyper/extent.h
index 5ef24361..efc9ece4 100644
--- a/src/hyper/extent.h
+++ b/src/hyper/extent.h
@@ -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! */
diff --git a/src/hyper/extent1.c b/src/hyper/extent1.c
index 0c92fbb4..0642957c 100644
--- a/src/hyper/extent1.c
+++ b/src/hyper/extent1.c
@@ -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 "openaxiom-c-macros.h"
#include "debug.h"
-
-
#include "sockio.h"
#include "extent.h"
#include "hyper.h"
@@ -53,8 +50,36 @@
#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
diff --git a/src/hyper/extent2.c b/src/hyper/extent2.c
index 4cac2fe8..56c37777 100644
--- a/src/hyper/extent2.c
+++ b/src/hyper/extent2.c
@@ -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;
diff --git a/src/hyper/form-ext.c b/src/hyper/form-ext.c
index edfffe9f..93d8d0b0 100644
--- a/src/hyper/form-ext.c
+++ b/src/hyper/form-ext.c
@@ -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);
/*
diff --git a/src/hyper/group.c b/src/hyper/group.c
index f1f69f84..c7a53240 100644
--- a/src/hyper/group.c
+++ b/src/hyper/group.c
@@ -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;
diff --git a/src/hyper/group.h b/src/hyper/group.h
index 4bf52264..7253cd83 100644
--- a/src/hyper/group.h
+++ b/src/hyper/group.h
@@ -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
diff --git a/src/hyper/htadd.c b/src/hyper/htadd.c
index d289fea0..2363c140 100644
--- a/src/hyper/htadd.c
+++ b/src/hyper/htadd.c
@@ -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 @@ extern int line_number; /* keeps track of which line a page starts on
* 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
diff --git a/src/hyper/htinp.c b/src/hyper/htinp.c
index c78d52bf..c4a62bd5 100644
--- a/src/hyper/htinp.c
+++ b/src/hyper/htinp.c
@@ -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 make_patch_files;
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];
diff --git a/src/hyper/hyper.c b/src/hyper/hyper.c
index 9c24c30f..5b22142d 100644
--- a/src/hyper/hyper.c
+++ b/src/hyper/hyper.c
@@ -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,14 +51,24 @@
#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
diff --git a/src/hyper/hyper.h b/src/hyper/hyper.h
index f71b45ae..de108ea4 100644
--- a/src/hyper/hyper.h
+++ b/src/hyper/hyper.h
@@ -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;
diff --git a/src/hyper/initx.c b/src/hyper/initx.c
index cff60806..45a9ff4d 100644
--- a/src/hyper/initx.c
+++ b/src/hyper/initx.c
@@ -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 @@ extern int gethostname(char *, int );
#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 @@ change_text(int color, XFontStruct *font)
*/
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 @@ get_color(char *name, char *class, int def, Colormap *map)
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);
diff --git a/src/hyper/initx.h b/src/hyper/initx.h
index 7533fe78..7005ba3b 100644
--- a/src/hyper/initx.h
+++ b/src/hyper/initx.h
@@ -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
diff --git a/src/hyper/input.c b/src/hyper/input.c
index c3a19958..dc6c0fbe 100644
--- a/src/hyper/input.c
+++ b/src/hyper/input.c
@@ -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 _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)
diff --git a/src/hyper/item.c b/src/hyper/item.c
index c6764ba6..93cceb82 100644
--- a/src/hyper/item.c
+++ b/src/hyper/item.c
@@ -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 @@ pop_item_stack(void)
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;
}
diff --git a/src/hyper/keyin.c b/src/hyper/keyin.c
index 7b0d310b..9e0f35e8 100644
--- a/src/hyper/keyin.c
+++ b/src/hyper/keyin.c
@@ -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,9 +52,6 @@
#include "parse.h"
#include "scrollbar.h"
-#include "all_hyper_proto.H1"
-#include <X11/keysym.h>
-
#define min(x,y) ( (x<y)?(x):(y))
diff --git a/src/hyper/keyin.h b/src/hyper/keyin.h
index 752150ff..aad41b1c 100644
--- a/src/hyper/keyin.h
+++ b/src/hyper/keyin.h
@@ -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;
diff --git a/src/hyper/macro.c b/src/hyper/macro.c
index dd1625b7..cdabf8f8 100644
--- a/src/hyper/macro.c
+++ b/src/hyper/macro.c
@@ -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,8 +41,8 @@
#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 parameters = NULL;
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 @@ get_parameter_strings(int number,char * macro_name)
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 @@ get_parameter_strings(int number,char * macro_name)
*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
diff --git a/src/hyper/mem.c b/src/hyper/mem.c
index e127ae3a..1617e21d 100644
--- a/src/hyper/mem.c
+++ b/src/hyper/mem.c
@@ -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,18 +40,25 @@
* 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 "all_hyper_proto.H1"
-
+#include "parse.h"
+
+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;
diff --git a/src/hyper/parse-aux.c b/src/hyper/parse-aux.c
index ac6008c7..27556058 100644
--- a/src/hyper/parse-aux.c
+++ b/src/hyper/parse-aux.c
@@ -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,8 +42,8 @@
#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;
diff --git a/src/hyper/parse-input.c b/src/hyper/parse-input.c
index 8eadc5ac..f927c64c 100644
--- a/src/hyper/parse-input.c
+++ b/src/hyper/parse-input.c
@@ -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;
diff --git a/src/hyper/parse-paste.c b/src/hyper/parse-paste.c
index 7789565b..c8d67c85 100644
--- a/src/hyper/parse-paste.c
+++ b/src/hyper/parse-paste.c
@@ -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,8 +51,7 @@
#include "group.h"
#include "lex.h"
-#include "all_hyper_proto.H1"
-
+static void load_patch(PatchStore * patch);
short int gInPaste;
@@ -212,11 +209,11 @@ parse_pastebutton(void)
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 @@ parse_patch(PasteNode *paste)
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 @@ parse_patch(PasteNode *paste)
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 @@ parse_patch(PasteNode *paste)
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;
diff --git a/src/hyper/parse-paste.h b/src/hyper/parse-paste.h
index d730b9bd..deb7f552 100644
--- a/src/hyper/parse-paste.h
+++ b/src/hyper/parse-paste.h
@@ -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
diff --git a/src/hyper/parse-types.c b/src/hyper/parse-types.c
index ec19f66f..67bbc252 100644
--- a/src/hyper/parse-types.c
+++ b/src/hyper/parse-types.c
@@ -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 "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;
diff --git a/src/hyper/parse-types.h b/src/hyper/parse-types.h
index c5bd3802..9e4fdcbf 100644
--- a/src/hyper/parse-types.h
+++ b/src/hyper/parse-types.h
@@ -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;
diff --git a/src/hyper/parse.c b/src/hyper/parse.c
index bd3ec318..5ef50baf 100644
--- a/src/hyper/parse.c
+++ b/src/hyper/parse.c
@@ -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,8 +48,17 @@
#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
diff --git a/src/hyper/parse.h b/src/hyper/parse.h
index 3de6024a..eaddd9bf 100644
--- a/src/hyper/parse.h
+++ b/src/hyper/parse.h
@@ -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;
diff --git a/src/hyper/scrollbar.c b/src/hyper/scrollbar.c
index ac7addf7..bc858325 100644
--- a/src/hyper/scrollbar.c
+++ b/src/hyper/scrollbar.c
@@ -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 "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);
diff --git a/src/hyper/scrollbar.h b/src/hyper/scrollbar.h
index c1721fe8..98054bb8 100644
--- a/src/hyper/scrollbar.h
+++ b/src/hyper/scrollbar.h
@@ -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
diff --git a/src/hyper/show-types.c b/src/hyper/show-types.c
index f55bd06c..1942901b 100644
--- a/src/hyper/show-types.c
+++ b/src/hyper/show-types.c
@@ -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,22 @@
* Copyright The Numerical Algorithms Group Limited 1991, 1992, 1993.
*
****************************************************************************/
-#define _SHOW_TYPES_C
-#include "openaxiom-c-macros.h"
+#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);
/*
diff --git a/src/hyper/spadint.c b/src/hyper/spadint.c
index fe8219a1..f872baf8 100644
--- a/src/hyper/spadint.c
+++ b/src/hyper/spadint.c
@@ -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,8 +63,6 @@ typedef struct sock_list { /* linked list of openaxiom_sio */
} 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
diff --git a/src/hyper/titlebar.c b/src/hyper/titlebar.c
index f1601345..90dfabf4 100644
--- a/src/hyper/titlebar.c
+++ b/src/hyper/titlebar.c
@@ -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 @@
#include "initx.h"
#include "parse.h"
#include "cfuns.h"
+#include "parse-types.h"
-#include "all_hyper_proto.H1"
+static void readTitleBarImages(void);
extern int y_off; /* y offset for scrolling regions */
diff --git a/src/hyper/titlebar.h b/src/hyper/titlebar.h
index 2bf66cbe..db7059a4 100644
--- a/src/hyper/titlebar.h
+++ b/src/hyper/titlebar.h
@@ -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 right reserved.
Redistribution and use in source and binary forms, with or without
@@ -38,6 +38,11 @@
#include "hyper.h"
+extern void getTitleBarMinimumSize(int * width , int * height);
+extern void linkTitleBarWindows(void);
+extern void makeTitleBarWindows(void);
+extern void showTitleBar(void);
+
extern int twwidth, twheight; /* the width and height for all windows in the */
/* title bar */