home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtfm.mit.edu
/
2014.07.rtfm.mit.edu.tar
/
rtfm.mit.edu
/
pub
/
interviews-to-g++.diffs
< prev
next >
Wrap
Text File
|
1989-02-26
|
104KB
|
3,829 lines
diff -rc src/bin/idraw/drawing.c /mit/interviews/src/bin/idraw/drawing.c
*** src/bin/idraw/drawing.c Wed Sep 7 05:23:05 1988
--- /mit/interviews/src/bin/idraw/drawing.c Fri Feb 24 17:41:16 1989
***************
*** 23,39 ****
// Import system routines not declared in any standard header file.
extern int access(const char*, int);
extern int chdir(const char*);
extern char* getenv(const char*);
extern char* getwd(char*);
!
! // An Orientation specifies a page's orientation (upright or turned).
!
! enum Orientation {
! Portrait,
! Landscape,
! };
// Drawing creates the page, selection list, and clipboard filename.
// It should have gotten w < h, i.e., portrait dimensions.
--- 23,34 ----
// Import system routines not declared in any standard header file.
+ #ifndef __GNUG__
extern int access(const char*, int);
extern int chdir(const char*);
extern char* getenv(const char*);
extern char* getwd(char*);
! #endif
// Drawing creates the page, selection list, and clipboard filename.
// It should have gotten w < h, i.e., portrait dimensions.
diff -rc src/bin/idraw/drawing.h /mit/interviews/src/bin/idraw/drawing.h
*** src/bin/idraw/drawing.h Wed Sep 7 05:23:07 1988
--- /mit/interviews/src/bin/idraw/drawing.h Fri Feb 24 17:39:17 1989
***************
*** 21,27 ****
class IFontList;
class IPattern;
class IPatternList;
- enum Orientation;
class PageBoundary;
class PictSelection;
class Picture;
--- 21,26 ----
***************
*** 31,36 ****
--- 30,42 ----
class State;
class Transformer;
class booleanList;
+
+ // An Orientation specifies a page's orientation (upright or turned).
+
+ enum Orientation {
+ Portrait,
+ Landscape,
+ };
// A Drawing contains the user's picture and provides the interface
// through which editing operations modify it.
diff -rc src/bin/idraw/editor.c /mit/interviews/src/bin/idraw/editor.c
*** src/bin/idraw/editor.c Thu Sep 8 11:18:31 1988
--- /mit/interviews/src/bin/idraw/editor.c Sun Feb 26 15:42:29 1989
***************
*** 630,636 ****
void Editor::Checkpoint () {
if (state->GetModifStatus() == Modified) {
! char* path = tempnam("./", "idraw");
boolean successful = drawing->WriteUserPicture(path);
if (successful) {
fprintf(stderr, "saved drawing as \"%s\"\n", path);
--- 630,640 ----
void Editor::Checkpoint () {
if (state->GetModifStatus() == Modified) {
! char path[64];
! strcpy(path, "./idrawXXXXXX"); // want a writable string
! mktemp(path);
! // Vax 4.3 BSD doesn't seem to have a tempnam function?
! // char* path = tempnam("./", "idraw");
boolean successful = drawing->WriteUserPicture(path);
if (successful) {
fprintf(stderr, "saved drawing as \"%s\"\n", path);
***************
*** 637,643 ****
} else {
fprintf(stderr, "sorry, couldn't save drawing as \"%s\"\n", path);
}
! delete path;
} else {
fprintf(stderr, "drawing was unmodified, didn't save it\n");
}
--- 641,647 ----
} else {
fprintf(stderr, "sorry, couldn't save drawing as \"%s\"\n", path);
}
! // delete path;
} else {
fprintf(stderr, "drawing was unmodified, didn't save it\n");
}
diff -rc src/bin/idraw/errhandler.c /mit/interviews/src/bin/idraw/errhandler.c
*** src/bin/idraw/errhandler.c Wed Sep 7 05:23:17 1988
--- /mit/interviews/src/bin/idraw/errhandler.c Sun Feb 26 16:05:55 1989
***************
*** 8,15 ****
--- 8,17 ----
// Import external variable _new_handler which stores the handler for
// out of memory exceptions.
+ #ifndef __GNUG__
typedef void (*PFVV)();
extern PFVV _new_handler;
+ #endif
// Define local variable errhandler which stores the current instance
// of ErrHandler in the program.
***************
*** 32,40 ****
--- 34,44 ----
// memory exceptions if it was handling them.
ErrHandler::~ErrHandler () {
+ #ifndef __GNUG__
if (_new_handler == &outofmemory) {
_new_handler = nil;
}
+ #endif
if (errhandler == this) {
errhandler = nil;
}
***************
*** 51,57 ****
--- 55,63 ----
ReqErr* ErrHandler::Install () {
errhandler = this;
+ #ifndef __GNUG__
_new_handler = &outofmemory;
+ #endif
return ReqErr::Install();
}
diff -rc src/bin/idraw/genMakefile /mit/interviews/src/bin/idraw/genMakefile
*** src/bin/idraw/genMakefile Sat Sep 10 02:48:36 1988
--- /mit/interviews/src/bin/idraw/genMakefile Sun Feb 26 15:59:29 1989
***************
*** 15,21 ****
LD = "CC"
LDFLAGS =
LIBS = $L/$M/libgraphic.a $L/$M/libtext.a
! EXTLIBS = $L/$D/libInterViews.a -l$$X -lm
HP300-SYSLIBS = -lBSD
OBJS =\
--- 15,21 ----
LD = "CC"
LDFLAGS =
LIBS = $L/$M/libgraphic.a $L/$M/libtext.a
! EXTLIBS = $L/$D/libInterViews.a -l$$X -lm -lg++
HP300-SYSLIBS = -lBSD
OBJS =\
diff -rc src/bin/idraw/grid.c /mit/interviews/src/bin/idraw/grid.c
*** src/bin/idraw/grid.c Wed Sep 7 05:23:21 1988
--- /mit/interviews/src/bin/idraw/grid.c Thu Feb 23 21:47:08 1989
***************
*** 92,105 ****
}
// drawClipped grids the given area with points if visibility has been
! // enabled.
void Grid::drawClipped (Canvas* c, Coord l, Coord b, Coord r, Coord t,
Graphic* gs) {
if (visibility && gs->GetBrush()->Width() != NO_WIDTH) {
update(gs);
! int n = DefinePoints(l, b, r, t);
! pMultiPoint(c, x, y, n);
}
}
--- 92,113 ----
}
// drawClipped grids the given area with points if visibility has been
! // enabled. It sents the points in chunks of MAXCHUNK points each
! // because the MIT X11R3 Sun server will return a protocol error if
! // idraw sends more than 16381 points at a time.
void Grid::drawClipped (Canvas* c, Coord l, Coord b, Coord r, Coord t,
Graphic* gs) {
if (visibility && gs->GetBrush()->Width() != NO_WIDTH) {
update(gs);
! int ntotal = DefinePoints(l, b, r, t);
! int nsent = 0;
! while (nsent < ntotal) {
! const int MAXCHUNK = 2000;
! int nchunk = min(MAXCHUNK, ntotal - nsent);
! pMultiPoint(c, &x[nsent], &y[nsent], nchunk);
! nsent += nchunk;
! }
}
}
diff -rc src/bin/idraw/highlighter.c /mit/interviews/src/bin/idraw/highlighter.c
*** src/bin/idraw/highlighter.c Wed Sep 7 05:23:25 1988
--- /mit/interviews/src/bin/idraw/highlighter.c Fri Feb 24 18:04:06 1989
***************
*** 87,99 ****
Interactor::Reconfig();
if (output != highlight && output != normal) {
delete highlight;
! if (hparent != nil && hparent->output == output) {
! highlight = hparent->GetHighlightPainter();
! highlight->Reference();
! } else { // bite the bullet
highlight = new Painter(output);
highlight->SetColors(output->GetBgColor(), output->GetFgColor());
! }
normal = output;
}
output = highlighted ? highlight : normal;
--- 87,99 ----
Interactor::Reconfig();
if (output != highlight && output != normal) {
delete highlight;
! // if (hparent != nil && hparent->output == output) {
! // highlight = hparent->GetHighlightPainter();
! // highlight->Reference();
! // } else { // bite the bullet
highlight = new Painter(output);
highlight->SetColors(output->GetBgColor(), output->GetFgColor());
! // }
normal = output;
}
output = highlighted ? highlight : normal;
diff -rc src/bin/idraw/ipaint.c /mit/interviews/src/bin/idraw/ipaint.c
*** src/bin/idraw/ipaint.c Thu Sep 8 03:07:10 1988
--- /mit/interviews/src/bin/idraw/ipaint.c Fri Feb 24 18:14:15 1989
***************
*** 26,32 ****
int IBrush::Width () {
int width = PBrush::Width();
! if (value == single) {
width = 1;
}
return width;
--- 26,32 ----
int IBrush::Width () {
int width = PBrush::Width();
! if (value == psingle) {
width = 1;
}
return width;
diff -rc src/bin/idraw/listchange.h /mit/interviews/src/bin/idraw/listchange.h
*** src/bin/idraw/listchange.h Wed Sep 7 05:24:05 1988
--- /mit/interviews/src/bin/idraw/listchange.h Fri Feb 24 17:55:23 1989
***************
*** 5,11 ****
#define listchange_h
#include "list.h"
!
// Declare imported types.
class CenterList;
--- 5,12 ----
#define listchange_h
#include "list.h"
! #include <InterViews/rubband.h>
!
// Declare imported types.
class CenterList;
***************
*** 22,28 ****
class IPatternList;
class Selection;
class SelectionList;
- enum Side;
class State;
// ChangeNode stores a change to the Drawing in reversible form and
--- 23,28 ----
diff -rc src/bin/idraw/listibrush.h /mit/interviews/src/bin/idraw/listibrush.h
*** src/bin/idraw/listibrush.h Wed Sep 7 05:24:09 1988
--- /mit/interviews/src/bin/idraw/listibrush.h Fri Feb 24 17:35:21 1989
***************
*** 29,35 ****
inline IBrushNode::IBrushNode (IBrush* b) {
brush = b;
! valuep = &brush;
}
// Define inline access functions to get members' values.
--- 29,35 ----
inline IBrushNode::IBrushNode (IBrush* b) {
brush = b;
! valuep = (void**)&brush;
}
// Define inline access functions to get members' values.
diff -rc src/bin/idraw/listicolor.h /mit/interviews/src/bin/idraw/listicolor.h
*** src/bin/idraw/listicolor.h Wed Sep 7 05:24:11 1988
--- /mit/interviews/src/bin/idraw/listicolor.h Fri Feb 24 17:35:33 1989
***************
*** 29,35 ****
inline IColorNode::IColorNode (IColor* c) {
color = c;
! valuep = &color;
}
// Define inline access functions to get members' values.
--- 29,35 ----
inline IColorNode::IColorNode (IColor* c) {
color = c;
! valuep = (void**)&color;
}
// Define inline access functions to get members' values.
diff -rc src/bin/idraw/listifont.h /mit/interviews/src/bin/idraw/listifont.h
*** src/bin/idraw/listifont.h Wed Sep 7 05:24:13 1988
--- /mit/interviews/src/bin/idraw/listifont.h Fri Feb 24 17:35:51 1989
***************
*** 29,35 ****
inline IFontNode::IFontNode (IFont* f) {
font = f;
! valuep = &font;
}
// Define inline access functions to get members' values.
--- 29,35 ----
inline IFontNode::IFontNode (IFont* f) {
font = f;
! valuep = (void**)&font;
}
// Define inline access functions to get members' values.
diff -rc src/bin/idraw/listintrctr.h /mit/interviews/src/bin/idraw/listintrctr.h
*** src/bin/idraw/listintrctr.h Wed Sep 7 05:24:14 1988
--- /mit/interviews/src/bin/idraw/listintrctr.h Sat Feb 25 16:16:00 1989
***************
*** 29,35 ****
inline InteractorNode::InteractorNode (Interactor* i) {
interactor = i;
! valuep = &interactor;
}
// Define inline access functions to get members' values.
--- 29,35 ----
inline InteractorNode::InteractorNode (Interactor* i) {
interactor = i;
! valuep = (void**)&interactor;
}
// Define inline access functions to get members' values.
diff -rc src/bin/idraw/listipattern.h /mit/interviews/src/bin/idraw/listipattern.h
*** src/bin/idraw/listipattern.h Wed Sep 7 05:24:16 1988
--- /mit/interviews/src/bin/idraw/listipattern.h Fri Feb 24 17:36:06 1989
***************
*** 29,35 ****
inline IPatternNode::IPatternNode (IPattern* p) {
pattern = p;
! valuep = &pattern;
}
// Define inline access functions to get members' values.
--- 29,35 ----
inline IPatternNode::IPatternNode (IPattern* p) {
pattern = p;
! valuep = (void**)&pattern;
}
// Define inline access functions to get members' values.
diff -rc src/bin/idraw/listselectn.h /mit/interviews/src/bin/idraw/listselectn.h
*** src/bin/idraw/listselectn.h Wed Sep 7 05:24:18 1988
--- /mit/interviews/src/bin/idraw/listselectn.h Fri Feb 24 17:33:24 1989
***************
*** 29,35 ****
inline SelectionNode::SelectionNode (Selection* s) {
selection = s;
! valuep = &selection;
}
// Define inline access functions to get members' values.
--- 29,35 ----
inline SelectionNode::SelectionNode (Selection* s) {
selection = s;
! valuep = (void**)&selection;
}
// Define inline access functions to get members' values.
diff -rc src/bin/idraw/slpict.c /mit/interviews/src/bin/idraw/slpict.c
*** src/bin/idraw/slpict.c Thu Sep 8 03:41:26 1988
--- /mit/interviews/src/bin/idraw/slpict.c Sat Feb 25 16:47:26 1989
***************
*** 211,217 ****
to << "} def\n\n";
to << "/SetB {\n";
to << "dup type /nulltype eq {\n";
! to << "pop true /brushNone idef\n";
to << "} {\n";
to << "/brushDashOffset idef\n";
to << "/brushDashArray idef\n";
--- 211,220 ----
to << "} def\n\n";
to << "/SetB {\n";
to << "dup type /nulltype eq {\n";
! to << "pop\n";
! to << "false /brushRightArrow idef\n";
! to << "false /brushLeftArrow idef\n";
! to << "true /brushNone idef\n";
to << "} {\n";
to << "/brushDashOffset idef\n";
to << "/brushDashArray idef\n";
***************
*** 222,235 ****
to << "} ifelse\n";
to << "} def\n\n";
to << "/SetCFg {\n";
- to << "/fgred idef\n";
- to << "/fggreen idef\n";
to << "/fgblue idef\n";
to << "} def\n\n";
to << "/SetCBg {\n";
- to << "/bgred idef\n";
- to << "/bggreen idef\n";
to << "/bgblue idef\n";
to << "} def\n\n";
to << "/SetF {\n";
to << "/printSize idef\n";
--- 225,238 ----
to << "} ifelse\n";
to << "} def\n\n";
to << "/SetCFg {\n";
to << "/fgblue idef\n";
+ to << "/fggreen idef\n";
+ to << "/fgred idef\n";
to << "} def\n\n";
to << "/SetCBg {\n";
to << "/bgblue idef\n";
+ to << "/bggreen idef\n";
+ to << "/bgred idef\n";
to << "} def\n\n";
to << "/SetF {\n";
to << "/printSize idef\n";
***************
*** 408,418 ****
to << "/ishow {\n";
to << "0 begin\n";
to << "gsave\n";
- to << "0 2.5 originalCTM dtransform idtransform\n";
- to << "/yoff exch def\n";
- to << "/xoff exch def\n";
- to << "printFont /Courier ne printSize 10 ne and ";
- to << "{ xoff yoff translate } if\n";
to << "printFont findfont printSize scalefont setfont\n";
to << "fgred fggreen fgblue setrgbcolor\n";
to << "/vertoffset printSize neg def {\n";
--- 411,416 ----
diff -rc src/bin/idraw/string.h /mit/interviews/src/bin/idraw/string.h
*** src/bin/idraw/string.h Wed Sep 7 05:25:23 1988
--- /mit/interviews/src/bin/idraw/string.h Fri Feb 24 16:44:20 1989
***************
*** 4,10 ****
#ifndef string_h
#define string_h
! #include <CC/string.h>
// strdup allocates and returns a duplicate of the given string.
--- 4,10 ----
#ifndef string_h
#define string_h
! #include <std.h>
// strdup allocates and returns a duplicate of the given string.
diff -rc src/bin/squares/metaview.c /mit/interviews/src/bin/squares/metaview.c
*** src/bin/squares/metaview.c Sat Sep 10 02:39:47 1988
--- /mit/interviews/src/bin/squares/metaview.c Sun Feb 26 20:42:51 1989
***************
*** 125,135 ****
w->Remove(this);
if (status == 1) {
! typeButton->GetValue(type);
! sizeButton->GetValue(size);
rightButton->GetValue(right);
belowButton->GetValue(below);
! alignButton->GetValue(align);
vscrollButton->GetValue(vscroll);
hscrollButton->GetValue(hscroll);
return true;
--- 125,135 ----
w->Remove(this);
if (status == 1) {
! typeButton->GetValue((void*)type);
! sizeButton->GetValue((void*)size);
rightButton->GetValue(right);
belowButton->GetValue(below);
! alignButton->GetValue((void*)align);
vscrollButton->GetValue(vscroll);
hscrollButton->GetValue(hscroll);
return true;
diff -rc src/include/InterViews/brush.h /mit/interviews/src/include/InterViews/brush.h
*** src/include/InterViews/brush.h Tue Aug 16 12:54:52 1988
--- /mit/interviews/src/include/InterViews/brush.h Thu Feb 23 21:54:19 1989
***************
*** 22,27 ****
inline int Brush::Width () { return width; }
! extern Brush* single;
#endif
--- 22,27 ----
inline int Brush::Width () { return width; }
! extern Brush* Bsingle;
#endif
diff -rc src/include/InterViews/font.h /mit/interviews/src/include/InterViews/font.h
*** src/include/InterViews/font.h Tue Aug 16 12:55:03 1988
--- /mit/interviews/src/include/InterViews/font.h Thu Feb 23 21:54:21 1989
***************
*** 40,45 ****
--- 40,46 ----
int height;
~FontRep();
+ FontRep() {};
};
extern Font* stdfont;
diff -rc src/include/InterViews/interactor.h /mit/interviews/src/include/InterViews/interactor.h
*** src/include/InterViews/interactor.h Tue Sep 6 13:48:07 1988
--- /mit/interviews/src/include/InterViews/interactor.h Thu Feb 23 21:54:24 1989
***************
*** 77,88 ****
void SetIcon(Interactor*);
void SetName(const char*);
void SetCanvasType(CanvasType);
! protected:
Shape* shape; /* desired shape characteristics */
Canvas* canvas; /* actual display area */
Perspective* perspective; /* portion displayed */
- Coord xmax; /* canvas->Width() - 1 */
- Coord ymax; /* canvas->Height() - 1 */
Sensor* input; /* normal input event interest */
Painter* output; /* normal output parameters */
--- 77,89 ----
void SetIcon(Interactor*);
void SetName(const char*);
void SetCanvasType(CanvasType);
! Coord xmax; /* canvas->Width() - 1 */
! Coord ymax; /* canvas->Height() - 1 */
Shape* shape; /* desired shape characteristics */
+ virtual void Resize();
Canvas* canvas; /* actual display area */
+ protected:
Perspective* perspective; /* portion displayed */
Sensor* input; /* normal input event interest */
Painter* output; /* normal output parameters */
***************
*** 92,98 ****
boolean IsMapped();
virtual void Redraw(Coord left, Coord bottom, Coord right, Coord top);
virtual void RedrawList(int n, Coord[], Coord[], Coord[], Coord[]);
- virtual void Resize();
void RootConfig(const char*, const char*);
void SetClassName(const char*);
void SetInstance(const char*);
--- 93,98 ----
diff -rc src/include/InterViews/painter.h /mit/interviews/src/include/InterViews/painter.h
*** src/include/InterViews/painter.h Mon Aug 15 04:30:38 1988
--- /mit/interviews/src/include/InterViews/painter.h Thu Feb 23 21:54:27 1989
***************
*** 97,104 ****
void Copy(Painter*);
void Begin_xor();
void End_xor();
- void Map(Canvas*, Coord x, Coord y, Coord& mx, Coord& my);
void Map(Canvas*, Coord x, Coord y, short& sx, short& sy);
void MapList(Canvas*, Coord x[], Coord y[], int n, Coord mx[], Coord my[]);
void MultiLineNoMap(Canvas* c, Coord x[], Coord y[], int n);
void FillPolygonNoMap(Canvas* c, Coord x[], Coord y[], int n);
--- 97,104 ----
void Copy(Painter*);
void Begin_xor();
void End_xor();
void Map(Canvas*, Coord x, Coord y, short& sx, short& sy);
+ void Map(Canvas*, Coord x, Coord y, Coord& mx, Coord& my);
void MapList(Canvas*, Coord x[], Coord y[], int n, Coord mx[], Coord my[]);
void MultiLineNoMap(Canvas* c, Coord x[], Coord y[], int n);
void FillPolygonNoMap(Canvas* c, Coord x[], Coord y[], int n);
diff -rc src/include/InterViews/pattern.h /mit/interviews/src/include/InterViews/pattern.h
*** src/include/InterViews/pattern.h Tue Aug 16 12:55:07 1988
--- /mit/interviews/src/include/InterViews/pattern.h Fri Feb 24 17:18:00 1989
***************
*** 7,18 ****
#include <InterViews/resource.h>
! static const int patternHeight = 16;
static const int patternWidth = 16;
class Pattern : public Resource {
public:
! Pattern(int p[patternHeight]);
Pattern(int dither);
Pattern(class Bitmap*);
~Pattern();
--- 7,22 ----
#include <InterViews/resource.h>
! /*
! * static const int patternHeight = 16;
static const int patternWidth = 16;
+ */
+ #define patternHeight 16
+ #define patternWidth 16
class Pattern : public Resource {
public:
! Pattern(int *);
Pattern(int dither);
Pattern(class Bitmap*);
~Pattern();
diff -rc src/include/InterViews/propsheet.h /mit/interviews/src/include/InterViews/propsheet.h
*** src/include/InterViews/propsheet.h Tue Sep 6 13:48:19 1988
--- /mit/interviews/src/include/InterViews/propsheet.h Thu Feb 23 21:54:33 1989
***************
*** 70,95 ****
extern PropertySheet* properties;
inline void PropertySheet::Put (
! const char* path, const char* value, const char* type = nil
! ) {
DoPut(cur, path, value, type, true);
}
inline void PropertySheet::PutLower (
! const char* path, const char* value, const char* type = nil
! ) {
DoPut(cur, path, value, type, false);
}
inline void PropertySheet::PutLocal (
! PropDir* dir, const char* path, const char* value, const char* type = nil
! ) {
DoPut(dir, path, value, type, true);
}
inline void PropertySheet::PutLocalLower (
! PropDir* dir, const char* path, const char* value, const char* type = nil
! ) {
DoPut(dir, path, value, type, false);
}
--- 70,91 ----
extern PropertySheet* properties;
inline void PropertySheet::Put (
! const char* path, const char* value, const char* type) {
DoPut(cur, path, value, type, true);
}
inline void PropertySheet::PutLower (
! const char* path, const char* value, const char* type) {
DoPut(cur, path, value, type, false);
}
inline void PropertySheet::PutLocal (
! PropDir* dir, const char* path, const char* value, const char* type) {
DoPut(dir, path, value, type, true);
}
inline void PropertySheet::PutLocalLower (
! PropDir* dir, const char* path, const char* value, const char* type) {
DoPut(dir, path, value, type, false);
}
diff -rc src/include/InterViews/Graphic/base.h /mit/interviews/src/include/InterViews/Graphic/base.h
*** src/include/InterViews/Graphic/base.h Tue Aug 30 02:45:05 1988
--- /mit/interviews/src/include/InterViews/Graphic/base.h Sat Feb 25 17:06:26 1989
***************
*** 47,54 ****
void transform(Coord& x, Coord& y);
void transform(Coord x, Coord y, Coord& tx, Coord& ty);
void transform(float x, float y, float& tx, float& ty);
- void transformList(Coord x[], Coord y[], int n, Coord tx[], Coord ty[]);
- void transformRect(float,float,float,float,float&,float&,float&,float&);
void invTransform(Coord& tx, Coord& ty);
void invTransform(Coord tx, Coord ty, Coord& x, Coord& y);
void invTransform(float tx, float ty, float& x, float& y);
--- 47,52 ----
***************
*** 76,83 ****
/* provide painter-equivalent rendering functions so that users */
/* won't manipulate the painter directly */
! boolean read(File*);
! boolean write(File*);
virtual boolean extentCached();
virtual void uncacheExtent();
--- 74,81 ----
/* provide painter-equivalent rendering functions so that users */
/* won't manipulate the painter directly */
! boolean read(GFile*);
! boolean write(GFile*);
virtual boolean extentCached();
virtual void uncacheExtent();
***************
*** 115,120 ****
--- 113,120 ----
virtual void erase(Canvas*, Graphic*);
virtual void eraseClipped(Canvas*, Coord,Coord,Coord,Coord, Graphic* gs);
public:
+ void transformList(Coord x[], Coord y[], int n, Coord tx[], Coord ty[]);
+ void transformRect(float,float,float,float,float&,float&,float&,float&);
ClassId GetClassId();
boolean IsA(ClassId);
Persistent* GetCluster();
***************
*** 185,192 ****
Ref brush;
Ref font;
protected:
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 185,192 ----
Ref brush;
Ref font;
protected:
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
diff -rc src/include/InterViews/Graphic/ellipses.h /mit/interviews/src/include/InterViews/Graphic/ellipses.h
*** src/include/InterViews/Graphic/ellipses.h Mon Aug 29 20:06:57 1988
--- /mit/interviews/src/include/InterViews/Graphic/ellipses.h Sat Feb 25 16:56:54 1989
***************
*** 13,20 ****
Coord x0, y0;
int r1, r2;
! boolean read(File*);
! boolean write(File*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
--- 13,20 ----
Coord x0, y0;
int r1, r2;
! boolean read(GFile*);
! boolean write(GFile*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
diff -rc src/include/InterViews/Graphic/file.h /mit/interviews/src/include/InterViews/Graphic/file.h
*** src/include/InterViews/Graphic/file.h Fri Aug 12 14:22:36 1988
--- /mit/interviews/src/include/InterViews/Graphic/file.h Sat Feb 25 16:57:14 1989
***************
*** 1,20 ****
/*
! * File encapsulates standard file operations.
*/
! #ifndef file_h
! #define file_h
#include <stdio.h>
#include <InterViews/defs.h>
! class File {
protected:
char* name;
FILE* fd;
public:
! File(char* filename);
! ~File();
char* GetName();
boolean Exists();
--- 1,20 ----
/*
! * GFile encapsulates standard GGFile operations.
*/
! #ifndef GFile_h
! #define GFile_h
#include <stdio.h>
#include <InterViews/defs.h>
! class GFile {
protected:
char* name;
FILE* fd;
public:
! GFile(char* filename);
! ~GFile();
char* GetName();
boolean Exists();
***************
*** 40,46 ****
boolean Write(char* string);
boolean Write(char* string, int count);
! boolean SeekTo(long offset); /* offset bytes from beginning of file */
boolean SeekToBegin();
boolean SeekToEnd();
--- 40,46 ----
boolean Write(char* string);
boolean Write(char* string, int count);
! boolean SeekTo(long offset); /* offset bytes from beginning of GFile */
boolean SeekToBegin();
boolean SeekToEnd();
diff -rc src/include/InterViews/Graphic/geomobjs.h /mit/interviews/src/include/InterViews/Graphic/geomobjs.h
*** src/include/InterViews/Graphic/geomobjs.h Mon Aug 29 20:07:05 1988
--- /mit/interviews/src/include/InterViews/Graphic/geomobjs.h Sat Feb 25 16:57:23 1989
***************
*** 17,24 ****
class PointObj : public Persistent {
protected:
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 17,24 ----
class PointObj : public Persistent {
protected:
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
***************
*** 33,40 ****
class LineObj : public Persistent {
protected:
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 33,40 ----
class LineObj : public Persistent {
protected:
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
***************
*** 53,60 ****
class BoxObj : public Persistent {
protected:
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 53,60 ----
class BoxObj : public Persistent {
protected:
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
***************
*** 93,100 ****
);
void CreateMultiLine(Coord* cpx, Coord* cpy, int cpcount);
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 93,100 ----
);
void CreateMultiLine(Coord* cpx, Coord* cpy, int cpcount);
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
diff -rc src/include/InterViews/Graphic/instance.h /mit/interviews/src/include/InterViews/Graphic/instance.h
*** src/include/InterViews/Graphic/instance.h Mon Aug 29 20:07:08 1988
--- /mit/interviews/src/include/InterViews/Graphic/instance.h Sat Feb 25 16:57:31 1989
***************
*** 12,19 ****
Ref refGr;
Graphic* getGraphic() { return (Graphic*) refGr(); }
! boolean read(File*);
! boolean write(File*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
--- 12,19 ----
Ref refGr;
Graphic* getGraphic() { return (Graphic*) refGr(); }
! boolean read(GFile*);
! boolean write(GFile*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
diff -rc src/include/InterViews/Graphic/label.h /mit/interviews/src/include/InterViews/Graphic/label.h
*** src/include/InterViews/Graphic/label.h Mon Aug 29 20:07:01 1988
--- /mit/interviews/src/include/InterViews/Graphic/label.h Sat Feb 25 16:57:38 1989
***************
*** 12,19 ****
protected:
char* string;
int count;
! boolean read(File*);
! boolean write(File*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
--- 12,19 ----
protected:
char* string;
int count;
! boolean read(GFile*);
! boolean write(GFile*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
diff -rc src/include/InterViews/Graphic/lines.h /mit/interviews/src/include/InterViews/Graphic/lines.h
*** src/include/InterViews/Graphic/lines.h Mon Aug 29 20:07:11 1988
--- /mit/interviews/src/include/InterViews/Graphic/lines.h Sat Feb 25 17:28:59 1989
***************
*** 12,19 ****
protected:
Coord x, y;
! boolean read(File*);
! boolean write(File*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
--- 12,19 ----
protected:
Coord x, y;
! boolean read(GFile*);
! boolean write(GFile*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
***************
*** 38,45 ****
protected:
Coord x0, y0, x1, y1;
! boolean read(File*);
! boolean write(File*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
--- 38,45 ----
protected:
Coord x0, y0, x1, y1;
! boolean read(GFile*);
! boolean write(GFile*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
***************
*** 66,73 ****
Coord* x, *y;
int count;
! boolean read(File*);
! boolean write(File*);
boolean extentCached();
void cacheExtent(float, float, float, float, float);
--- 66,73 ----
Coord* x, *y;
int count;
! boolean read(GFile*);
! boolean write(GFile*);
boolean extentCached();
void cacheExtent(float, float, float, float, float);
diff -rc src/include/InterViews/Graphic/objman.h /mit/interviews/src/include/InterViews/Graphic/objman.h
*** src/include/InterViews/Graphic/objman.h Mon Aug 29 20:07:15 1988
--- /mit/interviews/src/include/InterViews/Graphic/objman.h Sat Feb 25 17:34:41 1989
***************
*** 9,15 ****
#include <InterViews/defs.h>
class Cache;
! class File;
class Ref;
class RefList;
--- 9,15 ----
#include <InterViews/defs.h>
class Cache;
! class GFile;
class Ref;
class RefList;
***************
*** 32,38 ****
char filename [NAMESIZE]; /* we'll gag if names get too big */
Cache* objCache;
! File* objMap, *objStore;
RefList* root;
--- 32,38 ----
char filename [NAMESIZE]; /* we'll gag if names get too big */
Cache* objCache;
! GFile* objMap, *objStore;
RefList* root;
***************
*** 39,46 ****
ObjOffset getOffset(UID uid) { return (uid >> 1) * sizeof(ObjOffset); }
boolean seek(UID uid); /* moves to proper position in objStore */
UID nextUID() { return lastuid += 2; }
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 39,46 ----
ObjOffset getOffset(UID uid) { return (uid >> 1) * sizeof(ObjOffset); }
boolean seek(UID uid); /* moves to proper position in objStore */
UID nextUID() { return lastuid += 2; }
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
diff -rc src/include/InterViews/Graphic/persistent.h /mit/interviews/src/include/InterViews/Graphic/persistent.h
*** src/include/InterViews/Graphic/persistent.h Mon Aug 29 20:07:22 1988
--- /mit/interviews/src/include/InterViews/Graphic/persistent.h Sat Feb 25 16:58:44 1989
***************
*** 14,20 ****
extern ObjectMan* TheManager; /* the well-known global object manager */
! class File;
typedef unsigned UID;
#define INVALIDUID 1
--- 14,20 ----
extern ObjectMan* TheManager; /* the well-known global object manager */
! class GFile;
typedef unsigned UID;
#define INVALIDUID 1
***************
*** 31,40 ****
void Panic(const char*);
void Fatal(const char*);
! virtual boolean write(File*);
! virtual boolean read(File*);
! virtual boolean writeObjects(File*);
! virtual boolean readObjects(File*);
virtual boolean initialize();
public:
virtual ClassId GetClassId();
--- 31,40 ----
void Panic(const char*);
void Fatal(const char*);
! virtual boolean write(GFile*);
! virtual boolean read(GFile*);
! virtual boolean writeObjects(GFile*);
! virtual boolean readObjects(GFile*);
virtual boolean initialize();
public:
virtual ClassId GetClassId();
diff -rc src/include/InterViews/Graphic/picture.h /mit/interviews/src/include/InterViews/Graphic/picture.h
*** src/include/InterViews/Graphic/picture.h Mon Aug 29 20:07:18 1988
--- /mit/interviews/src/include/InterViews/Graphic/picture.h Sat Feb 25 16:59:00 1989
***************
*** 15,24 ****
RefList* refList, *cur;
Graphic* getGraphic(RefList* r) { return (Graphic*) (*r)(); }
! boolean read(File*);
! boolean write(File*);
! boolean readObjects(File*);
! boolean writeObjects(File*);
boolean extentCached();
void cacheExtent(float, float, float, float, float);
--- 15,24 ----
RefList* refList, *cur;
Graphic* getGraphic(RefList* r) { return (Graphic*) (*r)(); }
! boolean read(GFile*);
! boolean write(GFile*);
! boolean readObjects(GFile*);
! boolean writeObjects(GFile*);
boolean extentCached();
void cacheExtent(float, float, float, float, float);
diff -rc src/include/InterViews/Graphic/polygons.h /mit/interviews/src/include/InterViews/Graphic/polygons.h
*** src/include/InterViews/Graphic/polygons.h Mon Aug 29 20:07:31 1988
--- /mit/interviews/src/include/InterViews/Graphic/polygons.h Sat Feb 25 16:59:11 1989
***************
*** 12,19 ****
Ref patbr;
Coord x0, y0, x1, y1;
! boolean read(File*);
! boolean write(File*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
--- 12,19 ----
Ref patbr;
Coord x0, y0, x1, y1;
! boolean read(GFile*);
! boolean write(GFile*);
void getExtent(float&, float&, float&, float&, float&, Graphic*);
boolean contains(PointObj&, Graphic*);
diff -rc src/include/InterViews/Graphic/ppaint.h /mit/interviews/src/include/InterViews/Graphic/ppaint.h
*** src/include/InterViews/Graphic/ppaint.h Mon Aug 29 20:07:26 1988
--- /mit/interviews/src/include/InterViews/Graphic/ppaint.h Sat Feb 25 16:59:20 1989
***************
*** 16,23 ****
class PColor : public Persistent {
protected:
Color* value;
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 16,23 ----
class PColor : public Persistent {
protected:
Color* value;
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
***************
*** 40,47 ****
protected:
int data [patternHeight];
Pattern* value;
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 40,47 ----
protected:
int data [patternHeight];
Pattern* value;
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
***************
*** 61,68 ****
protected:
int p;
Brush* value;
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 61,68 ----
protected:
int p;
Brush* value;
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
***************
*** 81,88 ****
char* name;
int count;
Font* value;
! boolean read(File*);
! boolean write(File*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
--- 81,88 ----
char* name;
int count;
Font* value;
! boolean read(GFile*);
! boolean write(GFile*);
public:
ClassId GetClassId();
boolean IsA(ClassId);
diff -rc src/include/InterViews/Graphic/ref.h /mit/interviews/src/include/InterViews/Graphic/ref.h
*** src/include/InterViews/Graphic/ref.h Fri Aug 12 14:22:57 1988
--- /mit/interviews/src/include/InterViews/Graphic/ref.h Sat Feb 25 16:59:44 1989
***************
*** 49,58 ****
boolean operator==(Ref r);
boolean operator!=(Ref r);
! boolean Write(File*); /* write uid + cluster bit */
! boolean Read(File*); /* read uid + cluster bit */
! boolean WriteObjects(File*); /* write object if not head of a cluster */
! boolean ReadObjects(File*); /* read object if not head of a cluster */
};
inline boolean Ref::inMemory () {
--- 49,58 ----
boolean operator==(Ref r);
boolean operator!=(Ref r);
! boolean Write(GFile*); /* write uid + cluster bit */
! boolean Read(GFile*); /* read uid + cluster bit */
! boolean WriteObjects(GFile*); /* write object if not head of a cluster */
! boolean ReadObjects(GFile*); /* read object if not head of a cluster */
};
inline boolean Ref::inMemory () {
***************
*** 105,120 ****
return ! (*this == r);
}
! inline boolean Ref::Write (File* f) {
unref();
return f->Write(uid);
}
! inline boolean Ref::Read (File* f) {
return f->Read(uid);
}
! inline boolean Ref::WriteObjects (File* f) {
if (isCluster()) {
return true; /* if it's the head of a cluster, we're not */
/* responsible for writing it out */
--- 105,120 ----
return ! (*this == r);
}
! inline boolean Ref::Write (GFile* f) {
unref();
return f->Write(uid);
}
! inline boolean Ref::Read (GFile* f) {
return f->Read(uid);
}
! inline boolean Ref::WriteObjects (GFile* f) {
if (isCluster()) {
return true; /* if it's the head of a cluster, we're not */
/* responsible for writing it out */
***************
*** 127,133 ****
return true;
}
! inline boolean Ref::ReadObjects (File*) {
if (!isCluster()) {
(void*) refObjects();
}
--- 127,133 ----
return true;
}
! inline boolean Ref::ReadObjects (GFile*) {
if (!isCluster()) {
(void*) refObjects();
}
diff -rc src/include/InterViews/Graphic/reflist.h /mit/interviews/src/include/InterViews/Graphic/reflist.h
*** src/include/InterViews/Graphic/reflist.h Fri Aug 12 14:22:59 1988
--- /mit/interviews/src/include/InterViews/Graphic/reflist.h Sat Feb 25 16:59:56 1989
***************
*** 33,42 ****
RefList* Next() { return next; }
RefList* Prev() { return prev; }
! boolean Write(File*);
! boolean Read(File*);
! boolean WriteObjects(File*);
! boolean ReadObjects(File*);
RefList* operator[](int count);
};
--- 33,42 ----
RefList* Next() { return next; }
RefList* Prev() { return prev; }
! boolean Write(GFile*);
! boolean Read(GFile*);
! boolean WriteObjects(GFile*);
! boolean ReadObjects(GFile*);
RefList* operator[](int count);
};
diff -rc src/include/InterViews/Graphic/util.h /mit/interviews/src/include/InterViews/Graphic/util.h
*** src/include/InterViews/Graphic/util.h Fri Aug 12 14:23:02 1988
--- /mit/interviews/src/include/InterViews/Graphic/util.h Fri Feb 24 15:48:31 1989
***************
*** 8,14 ****
#include <math.h>
#include <InterViews/defs.h>
! extern void bcopy(void*, void*, int);
inline float fmax(float a, float b) { return (a >= b) ? a : b; }
inline float fmin(float a, float b) { return (a >= b) ? b : a; }
--- 8,16 ----
#include <math.h>
#include <InterViews/defs.h>
! #ifndef __GNUG__
! extern "C" void bcopy(void*, void*, int);
! #endif
inline float fmax(float a, float b) { return (a >= b) ? a : b; }
inline float fmin(float a, float b) { return (a >= b) ? b : a; }
***************
*** 30,39 ****
return sqrt(float(square(x0 - x1) + square(y0 - y1)));
}
! inline void CopyArray (Coord* x, Coord* y, int n, Coord* newx, Coord* newy) {
bcopy(x, newx, n * sizeof(Coord));
bcopy(y, newy, n * sizeof(Coord));
}
inline void Midpoint (
double x0, double y0, double x1, double y1, double& mx, double& my
--- 32,44 ----
return sqrt(float(square(x0 - x1) + square(y0 - y1)));
}
! /*inline void CopyArray (Coord* x, Coord* y, int n, Coord* newx, Coord* newy) {
bcopy(x, newx, n * sizeof(Coord));
bcopy(y, newy, n * sizeof(Coord));
}
+ */
+
+ #define CopyArray(x,y,n,newx,newy) do {bcopy(x,newx,n*sizeof(Coord));bcopy(y,newy,n*sizeof(Coord));} while(0)
inline void Midpoint (
double x0, double y0, double x1, double y1, double& mx, double& my
diff -rc src/include/InterViews/Text/stringedit.h /mit/interviews/src/include/InterViews/Text/stringedit.h
*** src/include/InterViews/Text/stringedit.h Sat Sep 3 14:58:25 1988
--- /mit/interviews/src/include/InterViews/Text/stringedit.h Fri Feb 24 17:24:23 1989
***************
*** 18,24 ****
public:
StringEdit(const char* sample, int border = 3);
StringEdit(const char* name, const char* sample, int border = 3);
! StringEdit(const char* sample, Painter * = stdpaint, int border = 3);
void Extra(int);
void Flash(int);
--- 18,24 ----
public:
StringEdit(const char* sample, int border = 3);
StringEdit(const char* name, const char* sample, int border = 3);
! StringEdit(const char* sample, Painter *, int border = 3);
void Extra(int);
void Flash(int);
diff -rc src/include/InterViews/Text/text.h /mit/interviews/src/include/InterViews/Text/text.h
*** src/include/InterViews/Text/text.h Mon Jun 13 12:55:31 1988
--- /mit/interviews/src/include/InterViews/Text/text.h Thu Feb 23 21:57:32 1989
***************
*** 16,31 ****
class Text {
friend class Layout;
protected:
void * context;
Composition * parent;
Text * next;
- int size;
-
virtual boolean Overflows( Layout * );
virtual void Draw( Layout * ) { }
- virtual void Locate( Coord &x1, Coord &y1, Coord &x2, Coord &y2 );
- virtual void Undraw();
- public:
Text( void * context=SELF );
~Text();
virtual Text * Copy() { return nil; }
--- 16,30 ----
class Text {
friend class Layout;
protected:
+ virtual void Locate( Coord &x1, Coord &y1, Coord &x2, Coord &y2 );
+ virtual void Undraw();
+ public:
void * context;
+ int size;
Composition * parent;
Text * next;
virtual boolean Overflows( Layout * );
virtual void Draw( Layout * ) { }
Text( void * context=SELF );
~Text();
virtual Text * Copy() { return nil; }
diff -rc src/include/InterViews/X11/Xlib.h /mit/interviews/src/include/InterViews/X11/Xlib.h
*** src/include/InterViews/X11/Xlib.h Wed Jul 27 00:37:31 1988
--- /mit/interviews/src/include/InterViews/X11/Xlib.h Thu Feb 23 21:57:54 1989
***************
*** 203,208 ****
--- 203,211 ----
* Xlib operations.
*/
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
Display* XOpenDisplay(const char*);
char* XDisplayName(Display*);
void XCloseDisplay(Display*);
***************
*** 579,582 ****
--- 582,588 ----
Display*, KeySym, KeySym[], int, unsigned char*, int nbytes
);
+ #ifndef __GNUG__
+ } // extern "C"
+ #endif
#endif
diff -rc src/include/InterViews/X11/Xutil.h /mit/interviews/src/include/InterViews/X11/Xutil.h
*** src/include/InterViews/X11/Xutil.h Fri Jul 8 16:25:25 1988
--- /mit/interviews/src/include/InterViews/X11/Xutil.h Thu Feb 23 21:58:02 1989
***************
*** 37,42 ****
--- 37,45 ----
#undef delete
#undef virtual
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
void XGetSizeHints(Display*, Window, XSizeHints&, Atom);
void XSetSizeHints(Display*, Window, XSizeHints&, Atom);
***************
*** 66,69 ****
--- 69,75 ----
unsigned long, int format
);
+ #ifndef __GNUG__
+ } // extern "C"
+ #endif
#endif
diff -rc src/libInterViews/X11-graphics.c /mit/interviews/src/libInterViews/X11-graphics.c
*** src/libInterViews/X11-graphics.c Sat Sep 10 05:02:28 1988
--- /mit/interviews/src/libInterViews/X11-graphics.c Thu Feb 23 21:53:20 1989
***************
*** 56,72 ****
return (data[Index(x, y)] & Bit(x, y)) != 0;
}
! Bitmap::Bitmap (const char* filename) {
! extern int XReadBitmapFile(
Display*, Drawable, const char*,
! int& width, int& height, Pixmap&,
int* x_hot, int* y_hot
);
Init();
XReadBitmapFile(
_World_dpy, _World_root, filename, width, height,
! (Pixmap)pixmap, nil, nil
);
}
--- 56,78 ----
return (data[Index(x, y)] & Bit(x, y)) != 0;
}
! #ifndef __GNUG__
! extern "C" {
! #endif
! int XReadBitmapFile(
Display*, Drawable, const char*,
! int& width, int& height, Pixmap*,
int* x_hot, int* y_hot
);
+ #ifndef __GNUG__
+ }
+ #endif
+ Bitmap::Bitmap (const char* filename) {
Init();
XReadBitmapFile(
_World_dpy, _World_root, filename, width, height,
! (Pixmap)&pixmap, nil, nil
);
}
***************
*** 106,112 ****
* class Brush
*/
! static Pixmap MakeStipple(int[patternHeight]);
Brush::Brush (int p, int w) {
int r[patternHeight];
--- 112,118 ----
* class Brush
*/
! static Pixmap MakeStipple(int *);
Brush::Brush (int p, int w) {
int r[patternHeight];
***************
*** 184,190 ****
src++, dst++
) {
if (isupper(*src)) {
! *dst = _tolower(*src);
} else {
*dst = *src;
}
--- 190,196 ----
src++, dst++
) {
if (isupper(*src)) {
! *dst = tolower(*src);
} else {
*dst = *src;
}
***************
*** 197,203 ****
} else if (strcmp(colorname, "white") == 0) {
c.pixel = WhitePixel(_World_dpy, _World_screen);
XQueryColor(_World_dpy, _World_cmap, c);
! } else if (!XLookupColor(_World_dpy, _World_cmap, name, c, exact)) {
pixel = -1;
return;
}
--- 203,211 ----
} else if (strcmp(colorname, "white") == 0) {
c.pixel = WhitePixel(_World_dpy, _World_screen);
XQueryColor(_World_dpy, _World_cmap, c);
! } else if (XAllocNamedColor(_World_dpy, _World_cmap, name, c, exact)) {
! allocated = true;
! } else {
pixel = -1;
return;
}
***************
*** 614,619 ****
--- 622,634 ----
XSetPlaneMask(_World_dpy, rep->gc, m);
}
+ void Painter::Map (Canvas* c, Coord x, Coord y, short& sx, short& sy) {
+ Coord mx = sx, my = sy;
+
+ Map(c, x, y, mx, my);
+ sx = mx; sy = my;
+ }
+
void Painter::Map (Canvas* c, Coord x, Coord y, Coord& mx, Coord& my) {
if (matrix == nil) {
mx = x; my = y;
***************
*** 727,733 ****
v = AllocPts(n);
for (i = 0; i < n; i++) {
! Map(c, x[i], y[i], v[i].x, v[i].y);
}
XDrawPoints(_World_dpy, (Drawable)c->id, rep->gc, v, n, CoordModeOrigin);
FreePts(v);
--- 742,748 ----
v = AllocPts(n);
for (i = 0; i < n; i++) {
! Map(c, x[i], y[i], (short &) v[i].x, (short &) v[i].y);
}
XDrawPoints(_World_dpy, (Drawable)c->id, rep->gc, v, n, CoordModeOrigin);
FreePts(v);
***************
*** 738,744 ****
Map(c, x1, y1, mx1, my1);
Map(c, x2, y2, mx2, my2);
! rep->Prepare(PaintLines, br->info, single->info);
XDrawLine(_World_dpy, (Drawable)c->id, rep->gc, mx1, my1, mx2, my2);
}
--- 753,759 ----
Map(c, x1, y1, mx1, my1);
Map(c, x2, y2, mx2, my2);
! rep->Prepare(PaintLines, br->info, Bsingle->info);
XDrawLine(_World_dpy, (Drawable)c->id, rep->gc, mx1, my1, mx2, my2);
}
***************
*** 765,771 ****
}
w = right - left;
h = bottom - top;
! rep->Prepare(PaintLines, br->info, single->info);
XDrawRectangle(_World_dpy, (Drawable)c->id, rep->gc, left, top, w, h);
}
}
--- 780,786 ----
}
w = right - left;
h = bottom - top;
! rep->Prepare(PaintLines, br->info, Bsingle->info);
XDrawRectangle(_World_dpy, (Drawable)c->id, rep->gc, left, top, w, h);
}
}
***************
*** 815,821 ****
Map(c, x-r, y+r, left, top);
int d = r+r;
! rep->Prepare(PaintLines, br->info, single->info);
XDrawArc(
_World_dpy, (Drawable)c->id, rep->gc, left, top, d, d, 0, 360*64
);
--- 830,836 ----
Map(c, x-r, y+r, left, top);
int d = r+r;
! rep->Prepare(PaintLines, br->info, Bsingle->info);
XDrawArc(
_World_dpy, (Drawable)c->id, rep->gc, left, top, d, d, 0, 360*64
);
***************
*** 845,851 ****
for (i = 0; i < n; i++) {
Map(c, x[i], y[i], v[i].x, v[i].y);
}
! rep->Prepare(PaintLines, br->info, single->info);
XDrawLines(_World_dpy, (Drawable)c->id, rep->gc, v, n, CoordModeOrigin);
FreePts(v);
}
--- 860,866 ----
for (i = 0; i < n; i++) {
Map(c, x[i], y[i], v[i].x, v[i].y);
}
! rep->Prepare(PaintLines, br->info, Bsingle->info);
XDrawLines(_World_dpy, (Drawable)c->id, rep->gc, v, n, CoordModeOrigin);
FreePts(v);
}
***************
*** 859,865 ****
v[i].x = x[i];
v[i].y = y[i];
}
! rep->Prepare(PaintLines, br->info, single->info);
XDrawLines(_World_dpy, (Drawable)c->id, rep->gc, v, n, CoordModeOrigin);
FreePts(v);
}
--- 874,880 ----
v[i].x = x[i];
v[i].y = y[i];
}
! rep->Prepare(PaintLines, br->info, Bsingle->info);
XDrawLines(_World_dpy, (Drawable)c->id, rep->gc, v, n, CoordModeOrigin);
FreePts(v);
}
***************
*** 876,882 ****
v[i] = v[0];
++i;
}
! rep->Prepare(PaintLines, br->info, single->info);
XDrawLines(_World_dpy, (Drawable)c->id, rep->gc, v, i, CoordModeOrigin);
FreePts(v);
}
--- 891,897 ----
v[i] = v[0];
++i;
}
! rep->Prepare(PaintLines, br->info, Bsingle->info);
XDrawLines(_World_dpy, (Drawable)c->id, rep->gc, v, i, CoordModeOrigin);
FreePts(v);
}
***************
*** 985,991 ****
return XCreateBitmapFromData(_World_dpy, _World_root, data, 32, 32);
}
! Pattern::Pattern (int p[patternHeight]) {
info = (void*)MakeStipple(p);
}
--- 1000,1006 ----
return XCreateBitmapFromData(_World_dpy, _World_root, data, 32, 32);
}
! Pattern::Pattern (int *p) {
info = (void*)MakeStipple(p);
}
diff -rc src/libInterViews/X11-windows.c /mit/interviews/src/libInterViews/X11-windows.c
*** src/libInterViews/X11-windows.c Fri Sep 2 03:15:46 1988
--- /mit/interviews/src/libInterViews/X11-windows.c Thu Feb 23 21:53:27 1989
***************
*** 78,84 ****
case NoExpose:
return;
case Expose:
! if (assocTable->Find(i, xe.xexpose.window)) {
i->Redraw(
xe.xexpose.x,
height - xe.xexpose.y - xe.xexpose.height,
--- 78,84 ----
case NoExpose:
return;
case Expose:
! if (assocTable->Find((TableValue &)i, xe.xexpose.window)) {
i->Redraw(
xe.xexpose.x,
height - xe.xexpose.y - xe.xexpose.height,
***************
*** 88,94 ****
}
break;
case GraphicsExpose:
! if (assocTable->Find(i, xe.xgraphicsexpose.drawable)) {
i->Redraw(
xe.xgraphicsexpose.x,
height - xe.xgraphicsexpose.y -
--- 88,94 ----
}
break;
case GraphicsExpose:
! if (assocTable->Find((TableValue &)i, xe.xgraphicsexpose.drawable)) {
i->Redraw(
xe.xgraphicsexpose.x,
height - xe.xgraphicsexpose.y -
***************
*** 183,189 ****
XNextEvent(_World_dpy, xe);
switch (xe.type) {
case Expose:
! if (assocTable->Find(i, xe.xexpose.window)) {
i->SendRedraw(
xe.xexpose.x, xe.xexpose.y,
xe.xexpose.width, xe.xexpose.height, xe.xexpose.count
--- 183,189 ----
XNextEvent(_World_dpy, xe);
switch (xe.type) {
case Expose:
! if (assocTable->Find((TableValue &)i, xe.xexpose.window)) {
i->SendRedraw(
xe.xexpose.x, xe.xexpose.y,
xe.xexpose.width, xe.xexpose.height, xe.xexpose.count
***************
*** 191,197 ****
}
return false;
case ConfigureNotify:
! if (assocTable->Find(i, xe.xconfigure.window)) {
i->SendResize(
xe.xconfigure.x, xe.xconfigure.y,
xe.xconfigure.width, xe.xconfigure.height
--- 191,197 ----
}
return false;
case ConfigureNotify:
! if (assocTable->Find((TableValue &)i, xe.xconfigure.window)) {
i->SendResize(
xe.xconfigure.x, xe.xconfigure.y,
xe.xconfigure.width, xe.xconfigure.height
***************
*** 241,247 ****
return false;
}
/* only input events should get here */
! if (!assocTable->Find(i, w) ||
i->cursensor == nil || !i->cursensor->Interesting(&xe, e)
) {
return false;
--- 241,247 ----
return false;
}
/* only input events should get here */
! if (!assocTable->Find((TableValue &)i, w) ||
i->cursensor == nil || !i->cursensor->Interesting(&xe, e)
) {
return false;
***************
*** 354,360 ****
);
e.x = x;
e.y = ymax - y;
! if (!assocTable->Find(e.w, root)) {
e.w = nil;
}
e.wx = root_x;
--- 354,360 ----
);
e.x = x;
e.y = ymax - y;
! if (!assocTable->Find((TableValue &)e.w, root)) {
e.w = nil;
}
e.wx = root_x;
***************
*** 507,515 ****
/* default is to do nothing */
}
! static void DoXError (Display* errdisplay, XErrorEvent* e) {
! extern void XGetErrorText(Display*, int, char*, int);
register ReqErr* r = errhandler;
if (r != nil) {
r->msgid = e->serial;
--- 507,521 ----
/* default is to do nothing */
}
! #ifndef __GNUG__
! extern "C" {
! #endif
! void XGetErrorText(Display*, int, char*, int);
! #ifndef __GNUG__
! }
! #endif
+ static void DoXError (Display* errdisplay, XErrorEvent* e) {
register ReqErr* r = errhandler;
if (r != nil) {
r->msgid = e->serial;
***************
*** 522,531 ****
}
}
! ReqErr* ReqErr::Install () {
! typedef void XHandler(Display*, XErrorEvent*);
! extern void XSetErrorHandler(XHandler*);
if (errhandler == nil) {
XSetErrorHandler(DoXError);
}
--- 528,543 ----
}
}
! typedef void XHandler(Display*, XErrorEvent*);
! #ifndef __GNUG__
! extern "C" {
! #endif
! void XSetErrorHandler(XHandler*);
! #ifndef __GNUG__
! }
! #endif
+ ReqErr* ReqErr::Install () {
if (errhandler == nil) {
XSetErrorHandler(DoXError);
}
***************
*** 672,678 ****
wtype, CopyFromParent, m, &a
);
i->canvas = new Canvas((void*)w);
! assocTable->Insert(w, i);
c = i->GetCursor();
if (c != nil) {
XDefineCursor(_World_dpy, w, (XCursor)c->Id());
--- 684,690 ----
wtype, CopyFromParent, m, &a
);
i->canvas = new Canvas((void*)w);
! assocTable->Insert(w, (TableValue &)i);
c = i->GetCursor();
if (c != nil) {
XDefineCursor(_World_dpy, w, (XCursor)c->Id());
***************
*** 700,706 ****
return (
(xe.type == MapNotify && xe.xmap.window == x->w) ||
(xe.type == ConfigureNotify && xe.xconfigure.window == x->w) ||
! (xe.type == Expose && assocTable->Find(x->i, xe.xexpose.window))
);
}
--- 712,718 ----
return (
(xe.type == MapNotify && xe.xmap.window == x->w) ||
(xe.type == ConfigureNotify && xe.xconfigure.window == x->w) ||
! (xe.type == Expose && assocTable->Find((TableValue &)x->i, xe.xexpose.window))
);
}
***************
*** 803,809 ****
e.eventType = MotionEvent;
e.x = x->xmotion.x;
e.y = x->xmotion.y;
! if (!assocTable->Find(e.w, x->xmotion.root)) {
e.w = nil;
}
e.wx = x->xmotion.x_root;
--- 815,821 ----
e.eventType = MotionEvent;
e.x = x->xmotion.x;
e.y = x->xmotion.y;
! if (!assocTable->Find((TableValue &)e.w, x->xmotion.root)) {
e.w = nil;
}
e.wx = x->xmotion.x_root;
***************
*** 864,870 ****
timestamp = k->time;
x = k->x;
y = k->y;
! if (!assocTable->Find(w, k->root)) {
w = nil;
}
wx = k->x_root;
--- 876,882 ----
timestamp = k->time;
x = k->x;
y = k->y;
! if (!assocTable->Find((TableValue &)w, k->root)) {
w = nil;
}
wx = k->x_root;
***************
*** 937,943 ****
inches = inch;
point = 72.07/inch;
points = point;
! assocTable->Insert(rep->root, this);
xmax = canvas->width - 1;
ymax = canvas->height - 1;
--- 949,955 ----
inches = inch;
point = 72.07/inch;
points = point;
! assocTable->Insert((TableValue &)rep->root, this);
xmax = canvas->width - 1;
ymax = canvas->height - 1;
***************
*** 1077,1082 ****
--- 1089,1098 ----
ButtonPressMask|ButtonReleaseMask|OwnerGrabButtonMask|
PointerMotionMask|PointerMotionHintMask;
+ #ifndef __GNUG__
+ extern "C" int sleep(unsigned);
+ #endif
+
void WorldView::GrabMouse (Cursor* c) {
while (
XGrabPointer(
***************
*** 1196,1202 ****
RemoteInteractor i, Coord& x1, Coord& y1, Coord& x2, Coord& y2
) {
Window root;
! int x, y, w, h, bw, d;
XGetGeometry(_World_dpy, (Window)i, root, x, y, w, h, bw, d);
x1 = x;
--- 1212,1219 ----
RemoteInteractor i, Coord& x1, Coord& y1, Coord& x2, Coord& y2
) {
Window root;
! int x, y;
! unsigned int w, h, bw, d;
XGetGeometry(_World_dpy, (Window)i, root, x, y, w, h, bw, d);
x1 = x;
diff -rc src/libInterViews/deck.c /mit/interviews/src/libInterViews/deck.c
*** src/libInterViews/deck.c Wed Aug 10 12:20:14 1988
--- /mit/interviews/src/libInterViews/deck.c Thu Feb 23 21:28:40 1989
***************
*** 101,106 ****
--- 101,107 ----
cards->prev = c;
++perspective->width;
++perspective->height;
+ FixPerspective();
}
}
***************
*** 108,116 ****
--- 109,120 ----
Card* card = cards->next;
while (card != cards) {
if (card->i == i) {
+ card->prev->next = card->next;
+ card->next->prev = card->prev;
delete card;
--perspective->width;
--perspective->height;
+ FixPerspective();
break;
} else {
card = card->next;
diff -rc src/libInterViews/interactor.c /mit/interviews/src/libInterViews/interactor.c
*** src/libInterViews/interactor.c Fri Sep 9 13:16:50 1988
--- /mit/interviews/src/libInterViews/interactor.c Thu Feb 23 21:53:32 1989
***************
*** 122,133 ****
* if desired. Return true if the event is NOT an input event.
*/
boolean Interactor::Select (Event& e) {
#if defined(no_select)
/* systems that do not have select */
return false;
#else
- extern int select(int, int*, int, int, struct timeval*);
register Sensor* s;
unsigned d, dmask, m, rd;
struct timeval tv, * t;
--- 122,138 ----
* if desired. Return true if the event is NOT an input event.
*/
+ extern
+ #ifndef __GNUG__
+ "C"
+ #endif
+ int select(int, int*, int, int, struct timeval*);
+
boolean Interactor::Select (Event& e) {
#if defined(no_select)
/* systems that do not have select */
return false;
#else
register Sensor* s;
unsigned d, dmask, m, rd;
struct timeval tv, * t;
diff -rc src/libInterViews/menu.c /mit/interviews/src/libInterViews/menu.c
*** src/libInterViews/menu.c Fri Sep 9 16:41:11 1988
--- /mit/interviews/src/libInterViews/menu.c Thu Feb 23 21:53:37 1989
***************
*** 22,28 ****
Init();
}
! Menu::Menu (Sensor* in, Painter* out, boolean persist = true) : (in, out) {
persistent = persist;
Init();
}
--- 22,28 ----
Init();
}
! Menu::Menu (Sensor* in, Painter* out, boolean persist) : (in, out) {
persistent = persist;
Init();
}
diff -rc src/libInterViews/paint.c /mit/interviews/src/libInterViews/paint.c
*** src/libInterViews/paint.c Tue Aug 2 00:32:10 1988
--- /mit/interviews/src/libInterViews/paint.c Thu Feb 23 21:53:41 1989
***************
*** 18,24 ****
* class Brush
*/
! Brush* single;
/*
* class Color
--- 18,24 ----
* class Brush
*/
! Brush* Bsingle;
/*
* class Color
diff -rc src/libInterViews/painter.c /mit/interviews/src/libInterViews/painter.c
*** src/libInterViews/painter.c Mon Aug 8 14:06:03 1988
--- /mit/interviews/src/libInterViews/painter.c Thu Feb 23 21:53:45 1989
***************
*** 23,29 ****
lightgray = new Pattern(0x8020);
gray = new Pattern(0xa5a5);
darkgray = new Pattern(0xfafa);
! single = new Brush(0xffff, 0);
}
foreground = nil;
background = nil;
--- 23,29 ----
lightgray = new Pattern(0x8020);
gray = new Pattern(0xa5a5);
darkgray = new Pattern(0xfafa);
! Bsingle = new Brush(0xffff, 0);
}
foreground = nil;
background = nil;
***************
*** 34,40 ****
SetColors(black, white);
SetPattern(solid);
FillBg(true);
! SetBrush(single);
SetFont(stdfont);
SetOrigin(0, 0);
MoveTo(0, 0);
--- 34,40 ----
SetColors(black, white);
SetPattern(solid);
FillBg(true);
! SetBrush(Bsingle);
SetFont(stdfont);
SetOrigin(0, 0);
MoveTo(0, 0);
***************
*** 211,217 ****
static Coord* llx;
static Coord* lly;
! extern void bcopy(void*, void*, int);
static void GrowBufs (Coord*& b1, Coord*& b2, int& cur) {
Coord* newb1;
--- 211,219 ----
static Coord* llx;
static Coord* lly;
! #ifndef __GNUG__
! extern "C" void bcopy(void*, void*, int);
! #endif
static void GrowBufs (Coord*& b1, Coord*& b2, int& cur) {
Coord* newb1;
***************
*** 458,469 ****
CreateClosedLineList(bufx, bufy, count);
FillPolygonNoMap(c, llx, lly, llcount);
}
- }
-
- void Painter::Map (Canvas* c, Coord x, Coord y, short& sx, short& sy) {
- Coord cx, cy;
-
- Map(c, x, y, cx, cy);
- sx = short(cx);
- sy = short(cy);
}
--- 460,463 ----
diff -rc src/libInterViews/propsheet.c /mit/interviews/src/libInterViews/propsheet.c
*** src/libInterViews/propsheet.c Tue Sep 6 13:51:52 1988
--- /mit/interviews/src/libInterViews/propsheet.c Thu Feb 23 21:53:49 1989
***************
*** 67,75 ****
AttrList* vattrs;
DirList* vdirs;
PropDir();
~PropDir();
- PropDir* MakeDirs(const char*&);
};
static const int pathClusterSize = 20;
--- 67,76 ----
AttrList* vattrs;
DirList* vdirs;
+ PropDir* MakeDirs(const char*&);
+ public:
PropDir();
~PropDir();
};
static const int pathClusterSize = 20;
diff -rc src/libInterViews/rubband.c /mit/interviews/src/libInterViews/rubband.c
*** src/libInterViews/rubband.c Mon Jul 4 18:22:41 1988
--- /mit/interviews/src/libInterViews/rubband.c Thu Feb 23 21:53:51 1989
***************
*** 7,14 ****
--- 7,20 ----
float DEGS_PER_RAD = 180.0 / 3.1415927;
float RADS_PER_DEG = 3.1415927 / 180.0;
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
extern double atan(double);
extern double sqrt(double);
+ #ifndef __GNUG__
+ }
+ #endif
float Rubberband::Angle (Coord x0, Coord y0, Coord x1, Coord y1) {
float dx, dy, angle;
diff -rc src/libInterViews/rubcurve.c /mit/interviews/src/libInterViews/rubcurve.c
*** src/libInterViews/rubcurve.c Thu Aug 4 13:32:07 1988
--- /mit/interviews/src/libInterViews/rubcurve.c Thu Feb 23 21:53:54 1989
***************
*** 5,12 ****
--- 5,18 ----
#include <InterViews/rubcurve.h>
#include <InterViews/painter.h>
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
extern void bcopy(const void*, void*, int);
extern double sqrt(double);
+ #ifndef __GNUG__
+ }
+ #endif
inline int abs (int a) {
return a > 0 ? a : -a;
diff -rc src/libInterViews/rubline.c /mit/interviews/src/libInterViews/rubline.c
*** src/libInterViews/rubline.c Tue Jan 26 01:06:29 1988
--- /mit/interviews/src/libInterViews/rubline.c Thu Feb 23 21:53:56 1989
***************
*** 5,11 ****
--- 5,17 ----
#include <InterViews/rubline.h>
#include <InterViews/painter.h>
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
extern double sqrt(double);
+ #ifndef __GNUG__
+ }
+ #endif
inline int abs (int a) {
return a > 0 ? a : -a;
diff -rc src/libInterViews/rubrect.c /mit/interviews/src/libInterViews/rubrect.c
*** src/libInterViews/rubrect.c Fri Jun 17 19:57:46 1988
--- /mit/interviews/src/libInterViews/rubrect.c Thu Feb 23 21:53:59 1989
***************
*** 5,11 ****
--- 5,17 ----
#include <InterViews/painter.h>
#include <InterViews/rubrect.h>
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
extern double sqrt(double);
+ #ifndef __GNUG__
+ }
+ #endif
inline int abs (int a) {
return a > 0 ? a : -a;
***************
*** 130,138 ****
--- 136,150 ----
switch (side) {
case LeftSide:
case RightSide:
+ if (r == l) {
+ r++;
+ }
return float(nr - nl) / float(r - l);
case BottomSide:
case TopSide:
+ if (t == b) {
+ t++;
+ }
return float(nt - nb) / float(t - b);
}
}
diff -rc src/libInterViews/transformer.c /mit/interviews/src/libInterViews/transformer.c
*** src/libInterViews/transformer.c Wed Jul 27 00:33:35 1988
--- /mit/interviews/src/libInterViews/transformer.c Fri Feb 24 15:58:44 1989
***************
*** 134,185 ****
ty = x*mat01 + y*mat11 + mat21;
}
void Transformer::InvTransform (Coord& tx, Coord& ty) {
! float d = float(tx) - mat20;
! float fty = float(ty);
! fty = (mat00*(fty - mat21) - mat01*d) / Det(this);
! tx = round((d - fty*mat10) / mat00);
! ty = round(fty);
}
void Transformer::InvTransform (Coord tx, Coord ty, Coord& x, Coord& y) {
! float d = float(tx) - mat20;
! float fy = float(ty);
! fy = (mat00*(fy - mat21) - mat01*d) / Det(this);
! x = round((d - y*mat10) / mat00);
! y = round(fy);
}
void Transformer::InvTransform (float tx, float ty, float& x, float& y) {
! float d = tx - mat20;
! y = (mat00*(ty - mat21) - mat01*d) / Det(this);
! x = (d - y*mat10) / mat00;
! }
!
! void Transformer::TransformList (
! Coord x[], Coord y[], int n, Coord tx[], Coord ty[]
! ) {
! register Coord* ox, * oy, * nx, * ny;
! Coord* lim;
!
! lim = &x[n];
! for (ox = x, oy = y, nx = tx, ny = ty; ox < lim; ox++, oy++, nx++, ny++) {
! Transform(*ox, *oy, *nx, *ny);
! }
}
void Transformer::InvTransformList (
! Coord x[], Coord y[], int n, Coord tx[], Coord ty[]
) {
register Coord* ox, * oy, * nx, * ny;
Coord* lim;
lim = &x[n];
! for (ox = x, oy = y, nx = tx, ny = ty; ox < lim; ox++, oy++, nx++, ny++) {
! InvTransform(*ox, *oy, *nx, *ny);
}
}
--- 134,191 ----
ty = x*mat01 + y*mat11 + mat21;
}
+ /* Added by rfrench */
+
+ void Transformer::TransformList (Coord x[], Coord y[], int n,
+ Coord tx[], Coord ty[])
+ {
+ int i;
+
+ for (i=0; i<n; i++)
+ Transform(x[i], y[i], tx[i], tx[i]);
+ }
+
void Transformer::InvTransform (Coord& tx, Coord& ty) {
! float d = Det(this);
! float a = (float(tx) - mat20) / d;
! float b = (float(ty) - mat21) / d;
! tx = round(a*mat11 - b*mat10);
! ty = round(b*mat00 - a*mat01);
}
void Transformer::InvTransform (Coord tx, Coord ty, Coord& x, Coord& y) {
! float d = Det(this);
! float a = (float(tx) - mat20) / d;
! float b = (float(ty) - mat21) / d;
! x = round(a*mat11 - b*mat10);
! y = round(b*mat00 - a*mat01);
}
void Transformer::InvTransform (float tx, float ty, float& x, float& y) {
! float d = Det(this);
! float a = (tx - mat20) / d;
! float b = (ty - mat21) / d;
! x = a*mat11 - b*mat10;
! y = b*mat00 - a*mat01;
}
void Transformer::InvTransformList (
! Coord tx[], Coord ty[], int n, Coord x[], Coord y[]
) {
register Coord* ox, * oy, * nx, * ny;
Coord* lim;
+ float a, b, d = Det(this);
lim = &x[n];
! for (ox = tx, oy = ty, nx = x, ny = y; ox < lim; ox++, oy++, nx++, ny++) {
! a = (float(*ox) - mat20) / d;
! b = (float(*oy) - mat21) / d;
!
! *nx = round(a*mat11 - b*mat10);
! *ny = round(b*mat00 - a*mat01);
}
}
diff -rc src/libInterViews/tray.c /mit/interviews/src/libInterViews/tray.c
*** src/libInterViews/tray.c Sat Sep 10 02:41:38 1988
--- /mit/interviews/src/libInterViews/tray.c Thu Feb 23 21:38:44 1989
***************
*** 1398,1411 ****
hnodes->FindElements(tray, ltray, rtray);
vnodes->FindElements(tray, btray, ttray);
! ltray->combinable = rtray->combinable = false;
! btray->combinable = ttray->combinable = false;
Solve(hnodes, lmagic, rmagic, 0, s->width, s->hshrink, s->hstretch);
Solve(vnodes, bmagic, tmagic, 0, s->height, s->vshrink, s->vstretch);
! ltray->combinable = rtray->combinable = true;
! btray->combinable = ttray->combinable = true;
}
void TSolver::GetPlacement (
--- 1398,1415 ----
hnodes->FindElements(tray, ltray, rtray);
vnodes->FindElements(tray, btray, ttray);
! if (ltray != nil) {
! ltray->combinable = rtray->combinable = false;
! btray->combinable = ttray->combinable = false;
! }
Solve(hnodes, lmagic, rmagic, 0, s->width, s->hshrink, s->hstretch);
Solve(vnodes, bmagic, tmagic, 0, s->height, s->vshrink, s->vstretch);
! if (ltray != nil) {
! ltray->combinable = rtray->combinable = true;
! btray->combinable = ttray->combinable = true;
! }
}
void TSolver::GetPlacement (
diff -rc src/liballegro/connection.c /mit/interviews/src/liballegro/connection.c
*** src/liballegro/connection.c Wed May 25 18:42:05 1988
--- /mit/interviews/src/liballegro/connection.c Fri Feb 24 00:23:06 1989
***************
*** 12,17 ****
--- 12,18 ----
#include <fcntl.h>
#include <string.h>
+ #ifndef __GNUG__
extern int socket(int, int, int);
extern int bind(int, void*, int);
extern int connect(int, ...);
***************
*** 29,34 ****
--- 30,36 ----
extern void bzero(void*, int);
extern void perror(const char*);
extern void exit(int);
+ #endif
inline void fatal (const char* s) {
perror(s);
diff -rc src/libgraphic/base.c /mit/interviews/src/libgraphic/base.c
*** src/libgraphic/base.c Tue Aug 30 02:44:33 1988
--- /mit/interviews/src/libgraphic/base.c Sat Feb 25 16:49:49 1989
***************
*** 175,181 ****
}
}
! boolean Graphic::read (File* f) {
int test;
float a[6];
Ref dummy; /* dummy origin ref for backward compatibility */
--- 175,181 ----
}
}
! boolean Graphic::read (GFile* f) {
int test;
float a[6];
Ref dummy; /* dummy origin ref for backward compatibility */
***************
*** 192,198 ****
return ok;
}
! boolean Graphic::write (File* f) {
float a[6];
Ref dummy; /* dummy origin ref for backward compatibility */
boolean ok =
--- 192,198 ----
return ok;
}
! boolean Graphic::write (GFile* f) {
float a[6];
Ref dummy; /* dummy origin ref for backward compatibility */
boolean ok =
***************
*** 711,721 ****
}
}
! boolean FullGraphic::read (File* f) {
return Graphic::read(f) && pat.Read(f) && brush.Read(f) && font.Read(f);
}
! boolean FullGraphic::write (File* f) {
return Graphic::write(f) && pat.Write(f) && brush.Write(f) &&font.Write(f);
}
--- 711,721 ----
}
}
! boolean FullGraphic::read (GFile* f) {
return Graphic::read(f) && pat.Read(f) && brush.Read(f) && font.Read(f);
}
! boolean FullGraphic::write (GFile* f) {
return Graphic::write(f) && pat.Write(f) && brush.Write(f) &&font.Write(f);
}
diff -rc src/libgraphic/ellipses.c /mit/interviews/src/libgraphic/ellipses.c
*** src/libgraphic/ellipses.c Mon Aug 29 20:08:21 1988
--- /mit/interviews/src/libgraphic/ellipses.c Sat Feb 25 16:50:48 1989
***************
*** 9,20 ****
static const float axis = 0.42;
static const float seen = 1.025;
! boolean Ellipse::read (File* f) {
return Graphic::read(f) && patbr.Read(f) &&
f->Read(x0) && f->Read(y0) && f->Read(r1) && f->Read(r2);
}
! boolean Ellipse::write (File* f) {
return Graphic::write(f) && patbr.Write(f) &&
f->Write(x0) && f->Write(y0) && f->Write(r1) && f->Write(r2);
}
--- 9,20 ----
static const float axis = 0.42;
static const float seen = 1.025;
! boolean Ellipse::read (GFile* f) {
return Graphic::read(f) && patbr.Read(f) &&
f->Read(x0) && f->Read(y0) && f->Read(r1) && f->Read(r2);
}
! boolean Ellipse::write (GFile* f) {
return Graphic::write(f) && patbr.Write(f) &&
f->Write(x0) && f->Write(y0) && f->Write(r1) && f->Write(r2);
}
diff -rc src/libgraphic/file.c /mit/interviews/src/libgraphic/file.c
*** src/libgraphic/file.c Sun Jan 31 20:20:45 1988
--- /mit/interviews/src/libgraphic/file.c Sat Feb 25 21:56:30 1989
***************
*** 1,5 ****
/*
! * Implementation of File class.
*/
#include <string.h>
--- 1,5 ----
/*
! * Implementation of GFile class.
*/
#include <string.h>
***************
*** 12,18 ****
extern int unlink(const char*);
! File::File (char* filename) {
name = new char [strlen(filename) + 1];
strcpy(name, filename);
fd = fopen(name, "r+");
--- 12,18 ----
extern int unlink(const char*);
! GFile::GFile (char* filename) {
name = new char [strlen(filename) + 1];
strcpy(name, filename);
fd = fopen(name, "r+");
***************
*** 26,32 ****
}
}
! File::~File () {
if (fd != NULL) {
(void) fclose(fd);
}
--- 26,32 ----
}
}
! GFile::~GFile () {
if (fd != NULL) {
(void) fclose(fd);
}
***************
*** 33,51 ****
delete name;
}
! char* File::GetName () {
return name;
}
! boolean File::Exists () {
return fopen(name, "r") != NULL;
}
! boolean File::Exists (char* filename) {
return fopen(filename, "r") != NULL;
}
! boolean File::Read (short& i) {
int tmp;
boolean ok = fread((char*) &tmp, sizeof(int), 1, fd) == 1;
--- 33,51 ----
delete name;
}
! char* GFile::GetName () {
return name;
}
! boolean GFile::Exists () {
return fopen(name, "r") != NULL;
}
! boolean GFile::Exists (char* filename) {
return fopen(filename, "r") != NULL;
}
! boolean GFile::Read (short& i) {
int tmp;
boolean ok = fread((char*) &tmp, sizeof(int), 1, fd) == 1;
***************
*** 53,63 ****
return ok;
}
! boolean File::Read (int& i) {
return fread((char*) &i, sizeof(int), 1, fd) == 1;
}
! boolean File::Read (float& f) {
double tmp;
boolean ok = fread((char*) &tmp, sizeof(double), 1, fd) == 1;
--- 53,63 ----
return ok;
}
! boolean GFile::Read (int& i) {
return fread((char*) &i, sizeof(int), 1, fd) == 1;
}
! boolean GFile::Read (float& f) {
double tmp;
boolean ok = fread((char*) &tmp, sizeof(double), 1, fd) == 1;
***************
*** 65,71 ****
return ok;
}
! boolean File::Read (char& c) {
int tmp;
boolean ok = fread((char*) &tmp, sizeof(int), 1, fd) == 1;
--- 65,71 ----
return ok;
}
! boolean GFile::Read (char& c) {
int tmp;
boolean ok = fread((char*) &tmp, sizeof(int), 1, fd) == 1;
***************
*** 73,95 ****
return ok;
}
! boolean File::Read (short* i, int count) {
return fread((char*) i, sizeof(short), count, fd) == count;
}
! boolean File::Read (int* i, int count) {
return fread((char*) i, sizeof(int), count, fd) == count;
}
! boolean File::Read (long* i, int count) {
return fread((char*) i, sizeof(long), count, fd) == count;
}
! boolean File::Read (float* f, int count) {
return fread((char*) f, sizeof(float), count, fd) == count;
}
! boolean File::Read (char* string) {
// will read up to a NULL character or count characters
// assumes that there is room to read all count characters
// string will be NULL terminated iff NULL was read
--- 73,95 ----
return ok;
}
! boolean GFile::Read (short* i, int count) {
return fread((char*) i, sizeof(short), count, fd) == count;
}
! boolean GFile::Read (int* i, int count) {
return fread((char*) i, sizeof(int), count, fd) == count;
}
! boolean GFile::Read (long* i, int count) {
return fread((char*) i, sizeof(long), count, fd) == count;
}
! boolean GFile::Read (float* f, int count) {
return fread((char*) f, sizeof(float), count, fd) == count;
}
! boolean GFile::Read (char* string) {
// will read up to a NULL character or count characters
// assumes that there is room to read all count characters
// string will be NULL terminated iff NULL was read
***************
*** 105,140 ****
return false;
}
! boolean File::Read (char* string, int count) {
return fread((char*) string, sizeof(char), count, fd) == count;
}
! boolean File::Write (int i) {
return fwrite((char*) &i, sizeof(int), 1, fd) == 1;
}
! boolean File::Write (float f) {
double tmp = double(f);
return fwrite((char*) &tmp, sizeof(double), 1, fd) == 1;
}
! boolean File::Write (short* i, int count) {
return fwrite((char*) i, sizeof(short), count, fd) == count;
}
! boolean File::Write (int* i, int count) {
return fwrite((char*) i, sizeof(int), count, fd) == count;
}
! boolean File::Write (long* i, int count) {
return fwrite((char*) i, sizeof(long), count, fd) == count;
}
! boolean File::Write (float* f, int count) {
return fwrite((char*) f, sizeof(float), count, fd) == count;
}
! boolean File::Write (char* string) {
// write up to and including NULL character
// beware of non-terminated strings!
--- 105,140 ----
return false;
}
! boolean GFile::Read (char* string, int count) {
return fread((char*) string, sizeof(char), count, fd) == count;
}
! boolean GFile::Write (int i) {
return fwrite((char*) &i, sizeof(int), 1, fd) == 1;
}
! boolean GFile::Write (float f) {
double tmp = double(f);
return fwrite((char*) &tmp, sizeof(double), 1, fd) == 1;
}
! boolean GFile::Write (short* i, int count) {
return fwrite((char*) i, sizeof(short), count, fd) == count;
}
! boolean GFile::Write (int* i, int count) {
return fwrite((char*) i, sizeof(int), count, fd) == count;
}
! boolean GFile::Write (long* i, int count) {
return fwrite((char*) i, sizeof(long), count, fd) == count;
}
! boolean GFile::Write (float* f, int count) {
return fwrite((char*) f, sizeof(float), count, fd) == count;
}
! boolean GFile::Write (char* string) {
// write up to and including NULL character
// beware of non-terminated strings!
***************
*** 142,169 ****
return fwrite((char*) string, sizeof(char), len, fd) == len;
}
! boolean File::Write (char* string, int count) {
return fwrite((char*) string, sizeof(char), count, fd) == count;
}
! boolean File::SeekTo (long offset) {
return fseek(fd, offset, FROM_BEGINNING) >= 0;
}
! boolean File::SeekToBegin () {
return fseek(fd, 0, FROM_BEGINNING) >= 0;
}
! boolean File::SeekToEnd () {
return fseek(fd, 0, FROM_END) >= 0;
}
! long File::CurOffset () {
return ftell(fd);
}
! boolean File::IsEmpty () {
int dummy;
if (Read(dummy)) {
--- 142,169 ----
return fwrite((char*) string, sizeof(char), len, fd) == len;
}
! boolean GFile::Write (char* string, int count) {
return fwrite((char*) string, sizeof(char), count, fd) == count;
}
! boolean GFile::SeekTo (long offset) {
return fseek(fd, offset, FROM_BEGINNING) >= 0;
}
! boolean GFile::SeekToBegin () {
return fseek(fd, 0, FROM_BEGINNING) >= 0;
}
! boolean GFile::SeekToEnd () {
return fseek(fd, 0, FROM_END) >= 0;
}
! long GFile::CurOffset () {
return ftell(fd);
}
! boolean GFile::IsEmpty () {
int dummy;
if (Read(dummy)) {
***************
*** 174,180 ****
}
}
! boolean File::Erase () {
return
unlink(name) == 0 && fclose(fd) != EOF &&
(fd = fopen(name, "w+")) != NULL;
--- 174,180 ----
}
}
! boolean GFile::Erase () {
return
unlink(name) == 0 && fclose(fd) != EOF &&
(fd = fopen(name, "w+")) != NULL;
diff -rc src/libgraphic/geomobjs.c /mit/interviews/src/libgraphic/geomobjs.c
*** src/libgraphic/geomobjs.c Mon Aug 29 20:08:27 1988
--- /mit/interviews/src/libgraphic/geomobjs.c Sat Feb 25 16:51:24 1989
***************
*** 13,23 ****
extern void bcopy (void*, void*, int);
! boolean PointObj::read (File* f) {
return Persistent::read(f) && f->Read(x) && f->Read(y);
}
! boolean PointObj::write (File* f) {
return Persistent::write(f) && f->Write(x) && f->Write(y);
}
--- 13,23 ----
extern void bcopy (void*, void*, int);
! boolean PointObj::read (GFile* f) {
return Persistent::read(f) && f->Read(x) && f->Read(y);
}
! boolean PointObj::write (GFile* f) {
return Persistent::write(f) && f->Write(x) && f->Write(y);
}
***************
*** 29,40 ****
return POINTOBJ==id || Persistent::IsA(id);
}
! boolean LineObj::read (File* f) {
return Persistent::read(f) &&
f->Read(p1.x) && f->Read(p1.y) && f->Read(p2.x) && f->Read(p2.y);
}
! boolean LineObj::write (File* f) {
return Persistent::write(f) &&
f->Write(p1.x) && f->Write(p1.y) && f->Write(p2.x) && f->Write(p2.y);
}
--- 29,40 ----
return POINTOBJ==id || Persistent::IsA(id);
}
! boolean LineObj::read (GFile* f) {
return Persistent::read(f) &&
f->Read(p1.x) && f->Read(p1.y) && f->Read(p2.x) && f->Read(p2.y);
}
! boolean LineObj::write (GFile* f) {
return Persistent::write(f) &&
f->Write(p1.x) && f->Write(p1.y) && f->Write(p2.x) && f->Write(p2.y);
}
***************
*** 56,61 ****
--- 56,71 ----
((p.y - p1.y)*(p2.x - p1.x) - (p2.y - p1.y)*(p.x - p1.x)) == 0;
}
+ inline int signum (int a) {
+ if (a < 0) {
+ return -1;
+ } else if (a > 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
int LineObj::Same (PointObj& p1, PointObj& p2) {
Coord dx, dx1, dx2;
Coord dy, dy1, dy2;
***************
*** 66,72 ****
dy1 = p1.y - this->p1.y;
dx2 = p2.x - this->p2.x;
dy2 = p2.y - this->p2.y;
! return (dx*dy1 - dy*dx1) * (dx*dy2 - dy*dx2);
}
boolean LineObj::Intersects (LineObj& l) {
--- 76,82 ----
dy1 = p1.y - this->p1.y;
dx2 = p2.x - this->p2.x;
dy2 = p2.y - this->p2.y;
! return signum((dx*dy1 - dy*dx1)) * signum((dx*dy2 - dy*dx2));
}
boolean LineObj::Intersects (LineObj& l) {
***************
*** 76,87 ****
return b1.Intersects(b2) && Same(l.p1, l.p2) <= 0 && l.Same(p1, p2) <= 0;
}
! boolean BoxObj::read (File* f) {
return Persistent::read(f) &&
f->Read(left) && f->Read(bottom) && f->Read(right) && f->Read(top);
}
! boolean BoxObj::write (File* f) {
return Persistent::write(f) &&
f->Write(left) && f->Write(bottom) && f->Write(right) && f->Write(top);
}
--- 86,97 ----
return b1.Intersects(b2) && Same(l.p1, l.p2) <= 0 && l.Same(p1, p2) <= 0;
}
! boolean BoxObj::read (GFile* f) {
return Persistent::read(f) &&
f->Read(left) && f->Read(bottom) && f->Read(right) && f->Read(top);
}
! boolean BoxObj::write (GFile* f) {
return Persistent::write(f) &&
f->Write(left) && f->Write(bottom) && f->Write(right) && f->Write(top);
}
***************
*** 334,340 ****
}
}
! boolean MultiLineObj::read (File* f) {
boolean ok = Persistent::read(f) && f->Read(count);
if (ok) {
delete x;
--- 344,350 ----
}
}
! boolean MultiLineObj::read (GFile* f) {
boolean ok = Persistent::read(f) && f->Read(count);
if (ok) {
delete x;
***************
*** 346,352 ****
return ok;
}
! boolean MultiLineObj::write (File* f) {
return Persistent::write(f) &&
f->Write(count) && f->Write(x, count) && f->Write(y, count);
}
--- 356,362 ----
return ok;
}
! boolean MultiLineObj::write (GFile* f) {
return Persistent::write(f) &&
f->Write(count) && f->Write(x, count) && f->Write(y, count);
}
diff -rc src/libgraphic/instance.c /mit/interviews/src/libgraphic/instance.c
*** src/libgraphic/instance.c Mon Aug 29 20:08:35 1988
--- /mit/interviews/src/libgraphic/instance.c Sun Feb 26 17:17:15 1989
***************
*** 8,18 ****
#include <InterViews/Graphic/grclasses.h>
#include <InterViews/Graphic/instance.h>
! boolean Instance::read (File* f) {
return FullGraphic::read(f) && refGr.Read(f);
}
! boolean Instance::write (File* f) {
return FullGraphic::write(f) && refGr.Write(f);
}
--- 8,18 ----
#include <InterViews/Graphic/grclasses.h>
#include <InterViews/Graphic/instance.h>
! boolean Instance::read (GFile* f) {
return FullGraphic::read(f) && refGr.Read(f);
}
! boolean Instance::write (GFile* f) {
return FullGraphic::write(f) && refGr.Write(f);
}
diff -rc src/libgraphic/label.c /mit/interviews/src/libgraphic/label.c
*** src/libgraphic/label.c Mon Aug 29 20:08:31 1988
--- /mit/interviews/src/libgraphic/label.c Sat Feb 25 16:51:43 1989
***************
*** 64,70 ****
strncpy(string, this->string, count);
}
! boolean Label::read (File* f) {
boolean ok;
ok = Graphic::read(f) && font.Read(f) && f->Read(count);
if (ok) {
--- 64,70 ----
strncpy(string, this->string, count);
}
! boolean Label::read (GFile* f) {
boolean ok;
ok = Graphic::read(f) && font.Read(f) && f->Read(count);
if (ok) {
***************
*** 75,81 ****
return ok;
}
! boolean Label::write (File* f) {
return
Graphic::write(f) && font.Write(f) &&
f->Write(count) && f->Write(string, count);
--- 75,81 ----
return ok;
}
! boolean Label::write (GFile* f) {
return
Graphic::write(f) && font.Write(f) &&
f->Write(count) && f->Write(string, count);
diff -rc src/libgraphic/lines.c /mit/interviews/src/libgraphic/lines.c
*** src/libgraphic/lines.c Mon Aug 29 20:08:40 1988
--- /mit/interviews/src/libgraphic/lines.c Sat Feb 25 16:51:55 1989
***************
*** 8,18 ****
extern void bcopy (void*, void*, int);
! boolean Point::read (File* f) {
return Graphic::read(f) && brush.Read(f) && f->Read(x) && f->Read(y);
}
! boolean Point::write (File* f) {
return Graphic::write(f) && brush.Write(f) && f->Write(x) && f->Write(y);
}
--- 8,18 ----
extern void bcopy (void*, void*, int);
! boolean Point::read (GFile* f) {
return Graphic::read(f) && brush.Read(f) && f->Read(x) && f->Read(y);
}
! boolean Point::write (GFile* f) {
return Graphic::write(f) && brush.Write(f) && f->Write(x) && f->Write(y);
}
***************
*** 88,99 ****
return (PBrush*) brush();
}
! boolean Line::read (File* f) {
return Graphic::read(f) && brush.Read(f) &&
f->Read(x0) && f->Read(y0) && f->Read(x1) && f->Read(y1);
}
! boolean Line::write (File* f) {
return Graphic::write(f) && brush.Write(f) &&
f->Write(x0) && f->Write(y0) && f->Write(x1) && f->Write(y1);
}
--- 88,99 ----
return (PBrush*) brush();
}
! boolean Line::read (GFile* f) {
return Graphic::read(f) && brush.Read(f) &&
f->Read(x0) && f->Read(y0) && f->Read(x1) && f->Read(y1);
}
! boolean Line::write (GFile* f) {
return Graphic::write(f) && brush.Write(f) &&
f->Write(x0) && f->Write(y0) && f->Write(x1) && f->Write(y1);
}
***************
*** 219,225 ****
Graphic::Delete();
}
! boolean MultiLine::read (File* f) {
boolean ok = Graphic::read(f) && patbr.Read(f) && f->Read(count);
if (ok) {
delete x;
--- 219,225 ----
Graphic::Delete();
}
! boolean MultiLine::read (GFile* f) {
boolean ok = Graphic::read(f) && patbr.Read(f) && f->Read(count);
if (ok) {
delete x;
***************
*** 231,237 ****
return ok;
}
! boolean MultiLine::write (File* f) {
return Graphic::write(f) && patbr.Write(f) && f->Write(count) &&
f->Write(x, count) && f->Write(y, count);
}
--- 231,237 ----
return ok;
}
! boolean MultiLine::write (GFile* f) {
return Graphic::write(f) && patbr.Write(f) && f->Write(count) &&
f->Write(x, count) && f->Write(y, count);
}
diff -rc src/libgraphic/objman.c /mit/interviews/src/libgraphic/objman.c
*** src/libgraphic/objman.c Mon Aug 29 20:08:45 1988
--- /mit/interviews/src/libgraphic/objman.c Sat Feb 25 16:52:09 1989
***************
*** 19,26 ****
ObjectMan* TheManager = nil; // global object manager object
// (user initialized!)
- extern int sprintf(char*, const char* ...);
-
static Persistent* ObjectConstruct (ClassId id) {
switch (id) {
case PERSISTENT: return new Persistent;
--- 19,24 ----
***************
*** 53,59 ****
return false;
}
! boolean ObjectMan::read (File* f) {
char tmpfilename [NAMESIZE];
boolean ok = Persistent::read(f) &&
f->Read(tmpfilename) && root->Read(f) && f->Read(lastuid);
--- 51,57 ----
return false;
}
! boolean ObjectMan::read (GFile* f) {
char tmpfilename [NAMESIZE];
boolean ok = Persistent::read(f) &&
f->Read(tmpfilename) && root->Read(f) && f->Read(lastuid);
***************
*** 71,83 ****
strcpy(objStoreName, filename);
strcat(objStoreName, OBJSTORE_POSTFIX);
! objMap = new File (objMapName);
! objStore = new File (objStoreName);
}
return ok;
}
! boolean ObjectMan::write (File* f) {
boolean ok = Persistent::write(f) && f->Write(filename) && root->Write(f);
lastuidOffset = f->CurOffset();
ok = ok && f->Write(lastuid);
--- 69,81 ----
strcpy(objStoreName, filename);
strcat(objStoreName, OBJSTORE_POSTFIX);
! objMap = new GFile (objMapName);
! objStore = new GFile (objStoreName);
}
return ok;
}
! boolean ObjectMan::write (GFile* f) {
boolean ok = Persistent::write(f) && f->Write(filename) && root->Write(f);
lastuidOffset = f->CurOffset();
ok = ok && f->Write(lastuid);
***************
*** 105,112 ****
strcpy(objStoreName, filename);
strcat(objStoreName, OBJSTORE_POSTFIX);
! objMap = new File (objMapName);
! objStore = new File (objStoreName);
Ref uid (lastuid = OBJMANUID);
root = new RefList;
--- 103,110 ----
strcpy(objStoreName, filename);
strcat(objStoreName, OBJSTORE_POSTFIX);
! objMap = new GFile (objMapName);
! objStore = new GFile (objStoreName);
Ref uid (lastuid = OBJMANUID);
root = new RefList;
***************
*** 116,122 ****
(*userInitializer)(root); // initialize root object(s)
}
} else if (
! !(seek(OBJMANUID) && objStore->Read(id) && read(objStore))
) {
Panic( "can't read root object" );
}
--- 114,120 ----
(*userInitializer)(root); // initialize root object(s)
}
} else if (
! !(seek(OBJMANUID) && objStore->Read((int) id) && read(objStore))
) {
Panic( "can't read root object" );
}
***************
*** 208,214 ****
);
}
if (
! objStore->Read(id)
&& (ref->refto = Create(id)) != nil
&& ref->refto->read( objStore )
) {
--- 206,212 ----
);
}
if (
! objStore->Read((int) id)
&& (ref->refto = Create(id)) != nil
&& ref->refto->read( objStore )
) {
***************
*** 246,252 ****
return
objMap->SeekTo( getOffset( uid ) )
&& objMap->Write( int(currentOffset) )
! && objStore->Write( obj->GetClassId() );
}
--- 244,250 ----
return
objMap->SeekTo( getOffset( uid ) )
&& objMap->Write( int(currentOffset) )
! && objStore->Write( (int) obj->GetClassId() );
}
diff -rc src/libgraphic/persistent.c /mit/interviews/src/libgraphic/persistent.c
*** src/libgraphic/persistent.c Mon Aug 29 20:08:53 1988
--- /mit/interviews/src/libgraphic/persistent.c Sat Feb 25 16:52:22 1989
***************
*** 29,35 ****
return TheManager->GetUID( this );
}
! boolean Persistent::write (File*) {
if (TheManager->Update(this)) {
Clean();
return true;
--- 29,35 ----
return TheManager->GetUID( this );
}
! boolean Persistent::write (GFile*) {
if (TheManager->Update(this)) {
Clean();
return true;
***************
*** 38,48 ****
}
}
! boolean Persistent::read (File*) {
return true;
}
! boolean Persistent::readObjects (File*) {
return true;
}
--- 38,48 ----
}
}
! boolean Persistent::read (GFile*) {
return true;
}
! boolean Persistent::readObjects (GFile*) {
return true;
}
***************
*** 80,86 ****
return IsDirty() ? TheManager->Store(this) : true;
}
! boolean Persistent::writeObjects (File* f) {
return write(f);
}
--- 80,86 ----
return IsDirty() ? TheManager->Store(this) : true;
}
! boolean Persistent::writeObjects (GFile* f) {
return write(f);
}
diff -rc src/libgraphic/picture.c /mit/interviews/src/libgraphic/picture.c
*** src/libgraphic/picture.c Tue Aug 30 02:44:41 1988
--- /mit/interviews/src/libgraphic/picture.c Sun Feb 26 17:17:36 1989
***************
*** 31,49 ****
p->invalidateCaches();
}
! boolean Picture::read (File* f) {
return FullGraphic::read(f) && refList->Read(f);
}
! boolean Picture::readObjects (File* f) {
return FullGraphic::readObjects(f) && refList->ReadObjects(f);
}
! boolean Picture::write (File* f) {
return FullGraphic::write(f) && refList->Write(f);
}
! boolean Picture::writeObjects (File* f) {
return FullGraphic::writeObjects(f) && refList->WriteObjects(f);
}
--- 31,49 ----
p->invalidateCaches();
}
! boolean Picture::read (GFile* f) {
return FullGraphic::read(f) && refList->Read(f);
}
! boolean Picture::readObjects (GFile* f) {
return FullGraphic::readObjects(f) && refList->ReadObjects(f);
}
! boolean Picture::write (GFile* f) {
return FullGraphic::write(f) && refList->Write(f);
}
! boolean Picture::writeObjects (GFile* f) {
return FullGraphic::writeObjects(f) && refList->WriteObjects(f);
}
diff -rc src/libgraphic/polygons.c /mit/interviews/src/libgraphic/polygons.c
*** src/libgraphic/polygons.c Mon Aug 29 20:09:01 1988
--- /mit/interviews/src/libgraphic/polygons.c Sat Feb 25 16:52:54 1989
***************
*** 6,17 ****
#include <InterViews/Graphic/grclasses.h>
#include <InterViews/Graphic/polygons.h>
! boolean Rect::read (File* f) {
return Graphic::read(f) && patbr.Read(f) &&
f->Read(x0) && f->Read(y0) && f->Read(x1) && f->Read(y1);
}
! boolean Rect::write (File* f) {
return Graphic::write(f) && patbr.Write(f) &&
f->Write(x0) && f->Write(y0) && f->Write(x1) && f->Write(y1);
}
--- 6,17 ----
#include <InterViews/Graphic/grclasses.h>
#include <InterViews/Graphic/polygons.h>
! boolean Rect::read (GFile* f) {
return Graphic::read(f) && patbr.Read(f) &&
f->Read(x0) && f->Read(y0) && f->Read(x1) && f->Read(y1);
}
! boolean Rect::write (GFile* f) {
return Graphic::write(f) && patbr.Write(f) &&
f->Write(x0) && f->Write(y0) && f->Write(x1) && f->Write(y1);
}
diff -rc src/libgraphic/ppaint.c /mit/interviews/src/libgraphic/ppaint.c
*** src/libgraphic/ppaint.c Tue Sep 6 16:08:31 1988
--- /mit/interviews/src/libgraphic/ppaint.c Sat Feb 25 16:53:05 1989
***************
*** 14,22 ****
PBrush* pnone;
PFont* pstdfont;
! extern void bcopy (void*, void*, int);
! boolean PColor::read (File* f) {
int index, r, g, b;
boolean ok =
Persistent::read(f) &&
--- 14,24 ----
PBrush* pnone;
PFont* pstdfont;
! #ifndef __GNUG__
! extern "C" void bcopy (void*, void*, int);
! #endif
! boolean PColor::read (GFile* f) {
int index, r, g, b;
boolean ok =
Persistent::read(f) &&
***************
*** 28,34 ****
return ok;
}
! boolean PColor::write (File* f) {
int r, g, b;
value->Intensities(r, g, b);
return
--- 30,36 ----
return ok;
}
! boolean PColor::write (GFile* f) {
int r, g, b;
value->Intensities(r, g, b);
return
***************
*** 69,75 ****
Persistent::Delete();
}
! boolean PPattern::read (File* f) {
boolean ok = Persistent::read(f);
if (ok) {
--- 71,77 ----
Persistent::Delete();
}
! boolean PPattern::read (GFile* f) {
boolean ok = Persistent::read(f);
if (ok) {
***************
*** 82,88 ****
return ok;
}
! boolean PPattern::write (File* f) {
return Persistent::write(f) && f->Write(data, patternHeight);
}
--- 84,90 ----
return ok;
}
! boolean PPattern::write (GFile* f) {
return Persistent::write(f) && f->Write(data, patternHeight);
}
***************
*** 124,136 ****
Persistent::Delete();
}
! boolean PBrush::read (File* f) {
int w;
boolean ok = Persistent::read(f) && f->Read(w) && f->Read(p);
if (ok) {
if (w == 1 && p == 0xffff) {
! value = single; // new brushes don't work on GPX; this
value->Reference(); // gives us at least the default
} else if (w == NO_WIDTH) {
value = nil;
--- 126,138 ----
Persistent::Delete();
}
! boolean PBrush::read (GFile* f) {
int w;
boolean ok = Persistent::read(f) && f->Read(w) && f->Read(p);
if (ok) {
if (w == 1 && p == 0xffff) {
! value = Bsingle; // new brushes don't work on GPX; this
value->Reference(); // gives us at least the default
} else if (w == NO_WIDTH) {
value = nil;
***************
*** 141,147 ****
return ok;
}
! boolean PBrush::write (File* f) {
return Persistent::write(f) && f->Write(value->Width()) && f->Write(p);
}
--- 143,149 ----
return ok;
}
! boolean PBrush::write (GFile* f) {
return Persistent::write(f) && f->Write(value->Width()) && f->Write(p);
}
***************
*** 160,166 ****
PBrush::PBrush (int p, int w) {
this->p = p;
if (w == 1 && p == 0xffff) {
! value = single; // new brushes don't work on GPX; this
value->Reference(); // gives us at least the default
} else if (w == NO_WIDTH) {
value = nil;
--- 162,168 ----
PBrush::PBrush (int p, int w) {
this->p = p;
if (w == 1 && p == 0xffff) {
! value = Bsingle; // new brushes don't work on GPX; this
value->Reference(); // gives us at least the default
} else if (w == NO_WIDTH) {
value = nil;
***************
*** 174,180 ****
Persistent::Delete();
}
! boolean PFont::read (File* f) {
int count;
boolean ok = Persistent::read(f) && f->Read(count);
--- 176,182 ----
Persistent::Delete();
}
! boolean PFont::read (GFile* f) {
int count;
boolean ok = Persistent::read(f) && f->Read(count);
***************
*** 197,203 ****
return ok;
}
! boolean PFont::write (File* f) {
boolean ok = Persistent::write(f) && f->Write(count);
if (ok && count > 0) {
ok = f->Write(name);
--- 199,205 ----
return ok;
}
! boolean PFont::write (GFile* f) {
boolean ok = Persistent::write(f) && f->Write(count);
if (ok && count > 0) {
ok = f->Write(name);
diff -rc src/libgraphic/reflist.c /mit/interviews/src/libgraphic/reflist.c
*** src/libgraphic/reflist.c Sun Jan 31 20:21:46 1988
--- /mit/interviews/src/libgraphic/reflist.c Sat Feb 25 16:53:21 1989
***************
*** 16,22 ****
return nil;
}
! boolean RefList::Write (File* f) {
RefList* i;
int count = 0;
--- 16,22 ----
return nil;
}
! boolean RefList::Write (GFile* f) {
RefList* i;
int count = 0;
***************
*** 30,36 ****
return ok;
}
! boolean RefList::Read (File* f) {
int count;
RefList* i;
--- 30,36 ----
return ok;
}
! boolean RefList::Read (GFile* f) {
int count;
RefList* i;
***************
*** 43,49 ****
return ok;
}
! boolean RefList::WriteObjects (File* f) {
RefList* i;
boolean ok = true;
--- 43,49 ----
return ok;
}
! boolean RefList::WriteObjects (GFile* f) {
RefList* i;
boolean ok = true;
***************
*** 53,59 ****
return ok;
}
! boolean RefList::ReadObjects (File* f) {
RefList* i;
boolean ok = true;
--- 53,59 ----
return ok;
}
! boolean RefList::ReadObjects (GFile* f) {
RefList* i;
boolean ok = true;
diff -rc src/libtext/text.c /mit/interviews/src/libtext/text.c
*** src/libtext/text.c Sat Jan 30 03:21:08 1988
--- /mit/interviews/src/libtext/text.c Thu Feb 23 21:54:09 1989
***************
*** 6,12 ****
#include <InterViews/Text/layout.h>
#include <string.h>
! extern void bcopy(const char* source, char* dest, int count);
Text::Text (void* cont) {
if (cont == SELF) {
--- 6,14 ----
#include <InterViews/Text/layout.h>
#include <string.h>
! #ifndef __GNUG__
! extern "C" void bcopy(const char* source, char* dest, int count);
! #endif
Text::Text (void* cont) {
if (cont == SELF) {
diff -rc src/libtext/textblock.c /mit/interviews/src/libtext/textblock.c
*** src/libtext/textblock.c Wed Aug 10 13:28:01 1988
--- /mit/interviews/src/libtext/textblock.c Thu Feb 23 21:54:12 1989
***************
*** 16,23 ****
--- 16,29 ----
static const int STRETCH = 10;
static const float PAGEFRACT = 0.8;
+ #ifndef __GNUG__
+ extern "C" {
+ #endif
extern char* memcpy(char* dest, const char* source, int count);
extern char* memset(char* dest, int c, int count);
+ #ifndef __GNUG__
+ }
+ #endif
TextBlock::TextBlock (int w, int h, Interactor* hand) {
layout = nil;
diff -rc src/libtext/textviewer.c /mit/interviews/src/libtext/textviewer.c
*** src/libtext/textviewer.c Wed Jul 6 00:32:44 1988
--- /mit/interviews/src/libtext/textviewer.c Thu Feb 23 21:54:17 1989
***************
*** 11,18 ****
--- 11,22 ----
static const float pagefract = 0.8; // fraction of page to scroll
+ #ifndef __GNUG__
+ extern "C" {
extern void bzero(char* dest, int count);
extern void bcopy(const char* source, char* dest, int count);
+ }
+ #endif
void TPainter::StyledText (Canvas* c, const char* p, int len, StyleSet) {
// styles not implemented yet