Initial revision
This commit is contained in:
parent
a59ea66fa9
commit
84b1cb73b3
31 changed files with 3409 additions and 0 deletions
6
src/libframe/Make.Darwin-PowerMacintosh
Normal file
6
src/libframe/Make.Darwin-PowerMacintosh
Normal file
|
|
@ -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
|
||||
7
src/libframe/Make.FreeBSD-386
Normal file
7
src/libframe/Make.FreeBSD-386
Normal file
|
|
@ -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
|
||||
6
src/libframe/Make.HP-UX-9000
Normal file
6
src/libframe/Make.HP-UX-9000
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
CC=cc
|
||||
CFLAGS=-O -c -Ae -I.
|
||||
O=o
|
||||
AR=ar
|
||||
ARFLAGS=rvc
|
||||
NAN=nan64.$O
|
||||
7
src/libframe/Make.Linux-386
Normal file
7
src/libframe/Make.Linux-386
Normal file
|
|
@ -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
|
||||
7
src/libframe/Make.NetBSD-386
Normal file
7
src/libframe/Make.NetBSD-386
Normal file
|
|
@ -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
|
||||
6
src/libframe/Make.OSF1-alpha
Normal file
6
src/libframe/Make.OSF1-alpha
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
CC=cc
|
||||
CFLAGS+=-g -c -I.
|
||||
O=o
|
||||
AR=ar
|
||||
ARFLAGS=rvc
|
||||
NAN=nan64.$O
|
||||
2
src/libframe/Make.SunOS-sun4u
Normal file
2
src/libframe/Make.SunOS-sun4u
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
include Make.SunOS-sun4u-$(CC)
|
||||
NAN=nan64.$O
|
||||
6
src/libframe/Make.SunOS-sun4u-cc
Normal file
6
src/libframe/Make.SunOS-sun4u-cc
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
CC=cc
|
||||
CFLAGS+=-g -c -I. -O
|
||||
O=o
|
||||
AR=ar
|
||||
ARFLAGS=rvc
|
||||
NAN=nan64.$O
|
||||
6
src/libframe/Make.SunOS-sun4u-gcc
Normal file
6
src/libframe/Make.SunOS-sun4u-gcc
Normal file
|
|
@ -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
|
||||
85
src/libframe/frame.h
Normal file
85
src/libframe/frame.h
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue