aboutsummaryrefslogtreecommitdiff
path: root/src/libframe
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-09-30 17:47:44 +0000
committerrsc <devnull@localhost>2003-09-30 17:47:44 +0000
commit84b1cb73b3f0837f5b959579818158fbb2b1b206 (patch)
tree7e27c119d2c2fe00a70a39985c3715b3d8ca363b /src/libframe
parenta59ea66fa99f7b6f03eac71dc0713c33f912b6ab (diff)
downloadplan9port-84b1cb73b3f0837f5b959579818158fbb2b1b206.tar.gz
plan9port-84b1cb73b3f0837f5b959579818158fbb2b1b206.tar.bz2
plan9port-84b1cb73b3f0837f5b959579818158fbb2b1b206.zip
Initial revision
Diffstat (limited to 'src/libframe')
-rw-r--r--src/libframe/Make.Darwin-PowerMacintosh6
-rw-r--r--src/libframe/Make.FreeBSD-3867
-rw-r--r--src/libframe/Make.HP-UX-90006
-rw-r--r--src/libframe/Make.Linux-3867
-rw-r--r--src/libframe/Make.NetBSD-3867
-rw-r--r--src/libframe/Make.OSF1-alpha6
-rw-r--r--src/libframe/Make.SunOS-sun4u2
-rw-r--r--src/libframe/Make.SunOS-sun4u-cc6
-rw-r--r--src/libframe/Make.SunOS-sun4u-gcc6
-rw-r--r--src/libframe/frame.h85
10 files changed, 138 insertions, 0 deletions
diff --git a/src/libframe/Make.Darwin-PowerMacintosh b/src/libframe/Make.Darwin-PowerMacintosh
new file mode 100644
index 00000000..14b8d4e7
--- /dev/null
+++ b/src/libframe/Make.Darwin-PowerMacintosh
@@ -0,0 +1,6 @@
+CC=gcc
+CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O
diff --git a/src/libframe/Make.FreeBSD-386 b/src/libframe/Make.FreeBSD-386
new file mode 100644
index 00000000..087ed3ab
--- /dev/null
+++ b/src/libframe/Make.FreeBSD-386
@@ -0,0 +1,7 @@
+CC=gcc
+CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME)
+NAN=nan64.$O
diff --git a/src/libframe/Make.HP-UX-9000 b/src/libframe/Make.HP-UX-9000
new file mode 100644
index 00000000..edbdc111
--- /dev/null
+++ b/src/libframe/Make.HP-UX-9000
@@ -0,0 +1,6 @@
+CC=cc
+CFLAGS=-O -c -Ae -I.
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O
diff --git a/src/libframe/Make.Linux-386 b/src/libframe/Make.Linux-386
new file mode 100644
index 00000000..74b0252c
--- /dev/null
+++ b/src/libframe/Make.Linux-386
@@ -0,0 +1,7 @@
+CC=gcc
+CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I.
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME)
+NAN=nan64.$O
diff --git a/src/libframe/Make.NetBSD-386 b/src/libframe/Make.NetBSD-386
new file mode 100644
index 00000000..087ed3ab
--- /dev/null
+++ b/src/libframe/Make.NetBSD-386
@@ -0,0 +1,7 @@
+CC=gcc
+CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME)
+NAN=nan64.$O
diff --git a/src/libframe/Make.OSF1-alpha b/src/libframe/Make.OSF1-alpha
new file mode 100644
index 00000000..3d45279b
--- /dev/null
+++ b/src/libframe/Make.OSF1-alpha
@@ -0,0 +1,6 @@
+CC=cc
+CFLAGS+=-g -c -I.
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O
diff --git a/src/libframe/Make.SunOS-sun4u b/src/libframe/Make.SunOS-sun4u
new file mode 100644
index 00000000..c5fe67b8
--- /dev/null
+++ b/src/libframe/Make.SunOS-sun4u
@@ -0,0 +1,2 @@
+include Make.SunOS-sun4u-$(CC)
+NAN=nan64.$O
diff --git a/src/libframe/Make.SunOS-sun4u-cc b/src/libframe/Make.SunOS-sun4u-cc
new file mode 100644
index 00000000..829301de
--- /dev/null
+++ b/src/libframe/Make.SunOS-sun4u-cc
@@ -0,0 +1,6 @@
+CC=cc
+CFLAGS+=-g -c -I. -O
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O
diff --git a/src/libframe/Make.SunOS-sun4u-gcc b/src/libframe/Make.SunOS-sun4u-gcc
new file mode 100644
index 00000000..5c415948
--- /dev/null
+++ b/src/libframe/Make.SunOS-sun4u-gcc
@@ -0,0 +1,6 @@
+CC=gcc
+CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c
+O=o
+AR=ar
+ARFLAGS=rvc
+NAN=nan64.$O
diff --git a/src/libframe/frame.h b/src/libframe/frame.h
new file mode 100644
index 00000000..9b8194b7
--- /dev/null
+++ b/src/libframe/frame.h
@@ -0,0 +1,85 @@
+typedef struct Frbox Frbox;
+typedef struct Frame Frame;
+
+enum{
+ BACK,
+ HIGH,
+ BORD,
+ TEXT,
+ HTEXT,
+ NCOL
+};
+
+#define FRTICKW 3
+
+struct Frbox
+{
+ long wid; /* in pixels */
+ long nrune; /* <0 ==> negate and treat as break char */
+ uchar *ptr;
+ short bc; /* break char */
+ short minwid;
+};
+
+struct Frame
+{
+ Font *font; /* of chars in the frame */
+ Display *display; /* on which frame appears */
+ Image *b; /* on which frame appears */
+ Image *cols[NCOL]; /* text and background colors */
+ Rectangle r; /* in which text appears */
+ Rectangle entire; /* of full frame */
+ void (*scroll)(Frame*, int); /* scroll function provided by application */
+ Frbox *box;
+ ulong p0, p1; /* selection */
+ ushort nbox, nalloc;
+ ushort maxtab; /* max size of tab, in pixels */
+ ushort nchars; /* # runes in frame */
+ ushort nlines; /* # lines with text */
+ ushort maxlines; /* total # lines in frame */
+ ushort lastlinefull; /* last line fills frame */
+ ushort modified; /* changed since frselect() */
+ Image *tick; /* typing tick */
+ Image *tickback; /* saved image under tick */
+ int ticked; /* flag: is tick onscreen? */
+};
+
+ulong frcharofpt(Frame*, Point);
+Point frptofchar(Frame*, ulong);
+int frdelete(Frame*, ulong, ulong);
+void frinsert(Frame*, Rune*, Rune*, ulong);
+void frselect(Frame*, Mousectl*);
+void frselectpaint(Frame*, Point, Point, Image*);
+void frdrawsel(Frame*, Point, ulong, ulong, int);
+void frdrawsel0(Frame*, Point, ulong, ulong, Image*, Image*);
+void frinit(Frame*, Rectangle, Font*, Image*, Image**);
+void frsetrects(Frame*, Rectangle, Image*);
+void frclear(Frame*, int);
+
+uchar *_frallocstr(Frame*, unsigned);
+void _frinsure(Frame*, int, unsigned);
+Point _frdraw(Frame*, Point);
+void _frgrowbox(Frame*, int);
+void _frfreebox(Frame*, int, int);
+void _frmergebox(Frame*, int);
+void _frdelbox(Frame*, int, int);
+void _frsplitbox(Frame*, int, int);
+int _frfindbox(Frame*, int, ulong, ulong);
+void _frclosebox(Frame*, int, int);
+int _frcanfit(Frame*, Point, Frbox*);
+void _frcklinewrap(Frame*, Point*, Frbox*);
+void _frcklinewrap0(Frame*, Point*, Frbox*);
+void _fradvance(Frame*, Point*, Frbox*);
+int _frnewwid(Frame*, Point, Frbox*);
+int _frnewwid0(Frame*, Point, Frbox*);
+void _frclean(Frame*, Point, int, int);
+void _frredraw(Frame*, Point);
+void _fraddbox(Frame*, int, int);
+Point _frptofcharptb(Frame*, ulong, Point, int);
+Point _frptofcharnb(Frame*, ulong, int);
+int _frstrlen(Frame*, int);
+void frtick(Frame*, Point, int);
+void frinittick(Frame*);
+
+#define NRUNE(b) ((b)->nrune<0? 1 : (b)->nrune)
+#define NBYTE(b) strlen((char*)(b)->ptr)