\input psbox.tex
\parindent 0pt
\parskip 11pt
-\title{Manual for Object Graphics Library 3.0}
+\title{Object Graphics Library 3.0}
\author{Julian Smart}
\date{September 1998}
\const [0] {{\bf const}}
\constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
\windowstyle [1] {{\bf #1}\index{#1}}
+
+;;
+;; These two are for generating MS HTML Help project, contents and index files.
+;;
+htmlWorkshopFiles = true
+htmlIndex = true
+\pythonnote [1] {{\bf \fcol{blue}{wxPython note:}} #1}
+%\pythonnote [1] {}
+
# File: makefile.vc
# Author: Julian Smart
# Created: 1993
-# Updated:
+# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
OGLDIR = $(WXDIR)\utils\ogl
OGLINC = $(OGLDIR)\src
-OGLLIB = $(WXDIR)\lib\ogl.lib
+OGLLIB = $(WXDIR)\lib\ogl$(LIBEXT).lib
PROGRAM=ogledit
# File: makefile.vc
# Author: Julian Smart
# Created: 1999
-# Updated:
+# Updated:
# Copyright: (c) Julian Smart
#
# "%W% %G%"
OGLDIR = $(WXDIR)\utils\ogl
OGLINC = $(OGLDIR)\src
-OGLLIB = $(WXDIR)\lib\ogl.lib
+OGLLIB = $(WXDIR)\lib\ogl$(LIBEXT).lib
!include $(WXDIR)\src\makevc.env
OBJECTS = $(PROGRAM).obj doc.obj shapes.obj symbols.obj view.obj cspalette.obj\
mainfrm.obj project.obj dialogs.obj csprint.obj
-all: wx ogl $(PROGRAM).exe
+all: ogl $(PROGRAM).exe
$(PROGRAM): $(PROGRAM).exe
wxNode *node = m_regions.Nth(i);
if (!node)
return;
-
+
wxShapeRegion *region = (wxShapeRegion *)node->Data();
region->SetText(s);
dc.SetFont(* region->GetFont());
{
if (!GetParent())
return this;
-
+
if (GetParent()->IsKindOf(CLASSINFO(wxDivisionShape)))
return this;
else return GetParent()->GetTopAncestor();
{
// This is a temporary store of all the lines.
wxList linesStore;
-
+
wxNode *node = m_lines.First();
while (node)
{
// This is a temporary store of all the lines at this attachment
// point. We'll tick them off as we've processed them.
wxList linesAtThisAttachment;
-
+
wxNode *node = m_lines.First();
while (node)
{
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
yy = y + DragOffsetY;
m_canvas->Snap(&xx, &yy);
// m_xpos = xx; m_ypos = yy;
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
Draw(dc);
dc.SetLogicalFunction(wxCOPY);
Draw(dc);
}
else if (brushColour != "WHITE")
clause->AddAttributeValueString("brush_colour", brushColour);
-
+
if (m_brush->GetStyle() != wxSOLID)
clause->AddAttributeValue("brush_style", (long)m_brush->GetStyle());
}
width = widthExpr->RealValue();
height = heightExpr->RealValue();
-
+
minWidth = minWidthExpr->RealValue();
minHeight = minHeightExpr->RealValue();
double left = (double)(- (widthMin / 2.0));
double right = (double)(widthMin / 2.0 + (maxX - minX));
- wxControlPoint *control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, top,
+ wxControlPoint *control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, top,
CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, top,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, top,
CONTROL_POINT_VERTICAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, top,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, top,
CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, 0,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, 0,
CONTROL_POINT_HORIZONTAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, bottom,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, bottom,
CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, bottom,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, bottom,
CONTROL_POINT_VERTICAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, bottom,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, bottom,
CONTROL_POINT_DIAGONAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
- control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, 0,
+ control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, 0,
CONTROL_POINT_HORIZONTAL);
m_canvas->AddShape(control);
m_controlPoints.Append(control);
{
if (!m_drawHandles)
return;
-
+
dc.SetBrush(* wxBLACK_BRUSH);
dc.SetPen(* wxBLACK_PEN);
return FALSE;
}
-bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
+bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y,
int nth, int no_arcs, wxLineShape *line)
{
if (m_attachmentMode == ATTACHMENT_MODE_NONE)
// Round up
#define WXROUND(x) ( (long) (x + 0.5) )
+
+// logical function to use when drawing rubberband boxes, etc.
+#define OGLRBLF wxINVERT
+
+
+
class wxShapeEvtHandler: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxShapeEvtHandler)
void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive)
{
SetAttachmentSize(new_width, new_height);
-
+
// Multiply all points by proportion of new size to old size
double x_proportion = (double)(fabs(new_width/m_originalWidth));
double y_proportion = (double)(fabs(new_height/m_originalHeight));
node = node->Next();
}
}
-
+
double *xpoints = new double[n];
double *ypoints = new double[n];
i ++;
}
- oglFindEndForPolyline(n, xpoints, ypoints,
+ oglFindEndForPolyline(n, xpoints, ypoints,
x1, y1, x2, y2, x3, y3);
delete[] xpoints;
{
if (!m_points)
return FALSE;
-
+
if ((attachment >= 0) && (attachment < m_points->Number()))
return TRUE;
double x2, double y2,
double *x3, double *y3)
{
- oglFindEndForCircle(m_width/2,
+ oglFindEndForCircle(m_width/2,
m_xpos, m_ypos, // Centre of circle
x2, y2, // Other end of line
x3, y3);
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
if (this->GetFixedWidth())
new_width = bound_x;
-
+
if (this->GetFixedHeight())
new_height = bound_y;
pt->sm_controlPointDragPosY = (double)(newY1 + (newHeight/2.0));
if (this->GetFixedWidth())
newWidth = bound_x;
-
+
if (this->GetFixedHeight())
newHeight = bound_y;
this->Erase(dc);
*/
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
double bound_x;
double bound_y;
if (this->GetFixedWidth())
new_width = bound_x;
-
+
if (this->GetFixedHeight())
new_height = bound_y;
if (!eraseIt)
theObject->Show(TRUE);
*/
-
+
// Recursively redraw links if we have a composite.
if (theObject->GetChildren().Number() > 0)
theObject->DrawLinks(dc, -1, TRUE);
-
+
double width, height;
theObject->GetBoundingBoxMax(&width, &height);
theObject->GetEventHandler()->OnEndSize(width, height);
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
this->Erase(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
double bound_x;
double bound_y;
/*
* Division control point
*/
-
+
class wxDivisionControlPoint: public wxControlPoint
{
DECLARE_DYNAMIC_CLASS(wxDivisionControlPoint)
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
Erase(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
double offsetY = yy - objectStartY;
Move(dc, GetX() + offsetX, GetY() + offsetY);
-
+
if (m_canvas && !m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc);
}
object->Show(FALSE);
object->Move(dc, newX, newY);
object->Show(TRUE);
-
+
// Now set the scaled size
object->GetBoundingBoxMin(&xBound, &yBound);
object->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound,
wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
if (newObject->GetId() == 0)
newObject->SetId(NewId());
-
+
newObject->SetParent(&compositeCopy);
compositeCopy.m_children.Append(newObject);
wxShape *constrainedObject = (wxShape *)node2->Data();
wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data());
newConstrainedList.Append(newConstrained);
- node2 = node2->Next();
+ node2 = node2->Next();
}
wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining,
m_constrainingObject = (wxShape *)objExpr1->GetClientData();
else
wxFatalError("Couldn't find constraining image of composite.", "Object graphics error");
-
+
int i = 0;
wxExpr *currentIdExpr = constrainedExpr->Nth(i);
while (currentIdExpr)
}
return;
}
-
+
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
double newYPos2 = (double)(y1 + (3.0*GetHeight()/4.0));
wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
newDivision->Show(TRUE);
-
+
Erase(dc);
// Anything adjoining the bottom of this division now adjoins the
// Division is now receiving mouse events _before_ the contained object,
// because it was added last (on top of all others)
- // Add after the image that visualizes the container
+ // Add after the image that visualizes the container
compositeParent->AddChild(newDivision, compositeParent->FindContainerImage());
m_handleSide = DIVISION_SIDE_BOTTOM;
double newYPos2 = GetY();
wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
newDivision->Show(TRUE);
-
+
Erase(dc);
// Anything adjoining the left of this division now adjoins the
GetCanvas()->PrepareDC(dc);
Move(dc, newX, GetY());
-
+
return TRUE;
}
GetCanvas()->PrepareDC(dc);
Move(dc, GetX(), newY);
-
+
return TRUE;
}
GetCanvas()->PrepareDC(dc);
Move(dc, newX, GetY());
-
+
return TRUE;
}
GetCanvas()->PrepareDC(dc);
Move(dc, GetX(), newY);
-
+
return TRUE;
}
originalY = division->GetY();
originalW = division->GetWidth();
originalH = division->GetHeight();
-
+
wxControlPoint::OnBeginDragLeft(x, y, keys, attachment);
}
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, FALSE);
-
+
break;
}
case DIVISION_SIDE_TOP:
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_TOP, y, FALSE);
-
+
break;
}
case DIVISION_SIDE_RIGHT:
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, FALSE);
-
+
break;
}
case DIVISION_SIDE_BOTTOM:
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, FALSE);
-
+
break;
}
}
}
node = node->Next();
}
-
+
return TRUE;
}
* Popup menu for editing divisions
*
*/
-
+
void oglGraphicsDivisionMenuProc(wxMenu& menu, wxCommandEvent& event)
{
wxDivisionShape *division = (wxDivisionShape *)menu.GetClientData();
GraphicsForm *form = new GraphicsForm("Containers");
int lineWidth = currentPen->GetWidth();
-
+
form->Add(wxMakeFormShort("Width", &lineWidth, wxFORM_DEFAULT, NULL, NULL, wxVERTICAL,
150));
form->Add(wxMakeFormString("Colour", pColour, wxFORM_CHOICE,
else if (strcmp(*pStyle, "Dot Dash") == 0)
lineStyle = wxDOT_DASH;
}
-
+
wxPen *newPen = wxThePenList->FindOrCreatePen(*pColour, lineWidth, lineStyle);
if (!pen)
pen = wxBLACK_PEN;
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, TRUE);
else
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, FALSE);
-
+
int x1, y1;
m_canvas->ViewStart(&x1, &y1);
{
if (GetRegions().Number() == 0)
return;
-
+
double defaultProportion = (double)(GetRegions().Number() > 0 ? (1.0/((double)(GetRegions().Number()))) : 0.0);
double currentY = (double)(m_ypos - (m_height / 2.0));
double maxY = (double)(m_ypos + (m_height / 2.0));
#if 0
if (GetRegions().Number() < 2)
return;
-
+
wxBeginBusyCursor();
GraphicsForm *form = new GraphicsForm("Divided nodes");
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
GetCanvas()->PrepareDC(dc);
wxDividedShape *dividedObject = (wxDividedShape *)m_shape;
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
wxNode *node = dividedObject->GetRegions().Nth(regionId);
if (!node)
return;
-
+
wxShapeRegion *thisRegion = (wxShapeRegion *)node->Data();
wxShapeRegion *nextRegion = NULL; // Region below this one
// Find the old top and bottom of this region,
// and calculate the new proportion for this region
// if legal.
-
+
double currentY = (double)(dividedObject->GetY() - (dividedObject->GetHeight() / 2.0));
double maxY = (double)(dividedObject->GetY() + (dividedObject->GetHeight() / 2.0));
newRegion = new wxShapeRegion;
newRegion->SetName("Start");
newRegion->SetSize(150, 50);
- m_regions.Append((wxObject *)newRegion);
+ m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
newRegion->SetName("End");
wxNode *node = m_regions.Nth(i);
if (!node)
return;
-
+
wxShapeRegion *region = (wxShapeRegion *)node->Data();
region->SetText(s);
dc.SetFont(* region->GetFont());
w = 100; h = 50;
region->SetSize(w, h);
}
-
+
wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode());
node = string_list->First();
while (node)
first_point->y = y1;
last_point->x = x2;
last_point->y = y2;
-
+
m_xpos = (double)((x1 + x2)/2.0);
m_ypos = (double)((y1 + y2)/2.0);
}
deltaX = x4 - positionOnLineX;
deltaY = y4 - positionOnLineY;
}
-
+
switch (arrow->_GetType())
{
case ARROW_ARROW:
| /
| /
| /theta
- | /(x1, y1)
+ | /(x1, y1)
|______________________
*/
double theta = 0.0;
{
xr = 0.0; yr = 0.0;
}
-
+
m_labelObjects[i]->Move(dc, xp+xr, yp+yr);
}
}
{
if (!m_from || !m_to)
return;
-
+
if (m_lineControlPoints->Number() > 2)
Initialise();
double other_end_x, other_end_y;
FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y);
-
+
wxNode *first = m_lineControlPoints->First();
wxRealPoint *first_point = (wxRealPoint *)first->Data();
wxNode *last = m_lineControlPoints->Last();
{
if (!m_from || !m_to)
return;
-
+
// Do each end - nothing in the middle. User has to move other points
// manually if necessary.
double end_x, end_y;
{
if (!m_drawHandles)
return;
-
+
// Draw temporary label rectangles if necessary
for (int i = 0; i < 3; i++)
{
wxRealPoint *first_point = (wxRealPoint *)first->Data();
wxRealPoint *last_point = (wxRealPoint *)last->Data();
- wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
+ wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
first_point->x, first_point->y,
CONTROL_POINT_ENDPOINT_FROM);
control->m_point = first_point;
{
wxRealPoint *point = (wxRealPoint *)node->Data();
- control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
+ control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
point->x, point->y,
CONTROL_POINT_LINE);
control->m_point = point;
node = node->Next();
}
- control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
+ control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE,
last_point->x, last_point->y,
CONTROL_POINT_ENDPOINT_TO);
control->m_point = last_point;
node = next;
}
}
-
+
newRegion = new wxShapeRegion;
newRegion->SetName("Start");
newRegion->SetSize(150, 50);
- m_regions.Append((wxObject *)newRegion);
+ m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
newRegion->SetName("End");
double arrowSize = 0.0;
wxString arrowName("");
long arrowId = -1;
-
+
wxExpr *type_expr = node->Nth(0);
wxExpr *end_expr = node->Nth(1);
wxExpr *dist_expr = node->Nth(2);
{
m_shape->GetEventHandler()->OnSizingBeginDragLeft(this, x, y, keys, attachment);
}
-
+
void wxLineControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment)
{
m_shape->GetEventHandler()->OnSizingEndDragLeft(this, x, y, keys, attachment);
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
lineShape->GetTo()->OnDrawContents(dc);
this->SetDisableLabel(TRUE);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
lpt->m_xpos = x; lpt->m_ypos = y;
lpt->m_point->x = x; lpt->m_point->y = y;
m_oldCursor = wxSTANDARD_CURSOR;
}
}
-
+
void wxLineControlPoint::OnEndDragRight(double x, double y, int keys, int attachment)
{
wxClientDC dc(GetCanvas());
* Finds an arrowhead at the given position (if -1, any position)
*
*/
-
+
wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name)
{
wxNode *node = m_arcArrows.First();
* Deletes an arrowhead at the given position (if -1, any position)
*
*/
-
+
bool wxLineShape::DeleteArrowHead(int position, const wxString& name)
{
wxNode *node = m_arcArrows.First();
{
double startX, startY, endX, endY;
GetEnds(&startX, &startY, &endX, &endY);
-
+
// Find distances from centre, start and end. The smallest wins.
double centreDistance = (double)(sqrt((x - m_xpos)*(x - m_xpos) + (y - m_ypos)*(y - m_ypos)));
double startDistance = (double)(sqrt((x - startX)*(x - startX) + (y - startY)*(y - startY)));
m_metaFile = NULL;
m_id = NewId();
}
-
+
wxArrowHead::~wxArrowHead()
{
if (m_metaFile) delete m_metaFile;
double oldWidth = m_metaFile->m_width;
if (oldWidth == 0.0)
return;
-
+
double scale = (double)(size/oldWidth);
if (scale != 1.0)
m_metaFile->Scale(scale, scale);
{
if (m_lineShape && !m_lineShape->GetDrawHandles())
return;
-
+
double x1 = (double)(m_xpos - m_width/2.0);
double y1 = (double)(m_ypos - m_height/2.0);
-#
+
# File: makefile.vc
# Author: Julian Smart
# Created: 1993
-# Updated:
+# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
+
# Set WXDIR for your system
WXDIR = $(WXWIN)
OBJECTSDIR = $(WXDIR)\utils\ogl
THISDIR = $(WXDIR)\utils\ogl\src
-EXTRALIBS=$(WXDIR)\lib\ogl.lib $(WXDIR)\lib\mfutils.lib
-EXTRAINC=/I$(WXDIR)\utils\mfutils\src /I$(WXDIR)\utils\prologio\src
+#EXTRALIBS=$(WXDIR)\lib\ogl.lib $(WXDIR)\lib\mfutils.lib
+#EXTRAINC=/I$(WXDIR)\utils\mfutils\src /I$(WXDIR)\utils\prologio\src
EXTRAFLAGS=/DPROLOGIO=1
DOCDIR=$(WXDIR)\docs
LOCALDOCDIR=$(WXDIR)\utils\ogl\docs
!include $(WXDIR)\src\makevc.env
PROGRAM=test
-
-OBJECTS = $(THISDIR)\basic.obj $(THISDIR)\basic2.obj $(THISDIR)\canvas.obj $(THISDIR)\ogldiag.obj $(THISDIR)\lines.obj $(THISDIR)\misc.obj $(THISDIR)\divided.obj $(THISDIR)\constrnt.obj\
- $(THISDIR)\composit.obj $(THISDIR)\drawn.obj $(THISDIR)\bmpshape.obj $(THISDIR)\mfutils.obj
-LIBTARGET=$(WXDIR)\lib\ogl.lib
+OBJECTS = $(D)\basic.obj $(D)\basic2.obj $(D)\canvas.obj $(D)\ogldiag.obj $(D)\lines.obj $(D)\misc.obj $(D)\divided.obj $(D)\constrnt.obj\
+ $(D)\composit.obj $(D)\drawn.obj $(D)\bmpshape.obj $(D)\mfutils.obj
-all: $(LIBTARGET)
+LIBTARGET=$(WXDIR)\lib\ogl$(LIBEXT).lib
+
+all: $(D) $(LIBTARGET)
$(PROGRAM): $(PROGRAM).exe
+$(D) :
+ mkdir $(D)
+
wx:
cd $(WXDIR)\src\msw
nmake -f makefile.vc FINAL=$(FINAL)
# NOTE: This causes a floating point stack error when optimized,
# so DON'T optimize!
-basic.obj: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h
+$(D)\basic.obj: basic.$(SRCSUFF) basic.h lines.h misc.h canvas.h
cl @<<
-$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /Od /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\basic2.obj: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h
+$(D)\basic2.obj: basic2.$(SRCSUFF) basic.h lines.h misc.h canvas.h
cl @<<
-$(CPPFLAGS) /Od /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /Od /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\canvas.obj: canvas.$(SRCSUFF) basic.h misc.h canvas.h
+$(D)\canvas.obj: canvas.$(SRCSUFF) basic.h misc.h canvas.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\ogldiag.obj: ogldiag.$(SRCSUFF) ogldiag.h canvas.h basic.h
+$(D)\ogldiag.obj: ogldiag.$(SRCSUFF) ogldiag.h canvas.h basic.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\lines.obj: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h basicp.h linesp.h
+$(D)\lines.obj: lines.$(SRCSUFF) basic.h misc.h canvas.h lines.h basicp.h linesp.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\misc.obj: misc.$(SRCSUFF) basic.h misc.h constrnt.h basicp.h
+$(D)\misc.obj: misc.$(SRCSUFF) basic.h misc.h constrnt.h basicp.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\divided.obj: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h basicp.h
+$(D)\divided.obj: divided.$(SRCSUFF) basic.h misc.h canvas.h divided.h basicp.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\constrnt.obj: constrnt.$(SRCSUFF) basic.h constrnt.h
+$(D)\constrnt.obj: constrnt.$(SRCSUFF) basic.h constrnt.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\composit.obj: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h basicp.h
+$(D)\composit.obj: composit.$(SRCSUFF) basic.h misc.h canvas.h constrnt.h composit.h basicp.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\drawn.obj: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h basicp.h
+$(D)\drawn.obj: drawn.$(SRCSUFF) basic.h misc.h canvas.h drawn.h drawnp.h basicp.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\bmpshape.obj: bmpshape.$(SRCSUFF) basic.h misc.h canvas.h bmpshape.h
+$(D)\bmpshape.obj: bmpshape.$(SRCSUFF) basic.h misc.h canvas.h bmpshape.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
-$(THISDIR)\mfutils.obj: mfutils.$(SRCSUFF) mfutils.h
+$(D)\mfutils.obj: mfutils.$(SRCSUFF) mfutils.h
cl @<<
-$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
+$(CPPFLAGS) /c /Fo$@ /Tp $(*B).$(SRCSUFF)
<<
clean:
- -erase *.obj
+ -erase $(D)\*.obj
-erase *.sbr
-erase *.exe
-erase *.res
$(LOCALDOCDIR)\topics.tex $(LOCALDOCDIR)\sample.tex
html: $(DOCDIR)\html\ogl\ogl.htm
+htmlhelp: $(DOCDIR)\html\ogl\ogl.chm
hlp: $(DOCDIR)\winhelp\ogl.hlp
pdfrtf: $(DOCDIR)\pdf\ogl.rtf
ps: $(DOCDIR)\ps\ogl.ps
+touchmanual:
+ touch $(LOCALDOCDIR)\ogl.tex
+
+
$(DOCDIR)\winhelp\ogl.hlp: $(LOCALDOCDIR)\ogl.rtf $(LOCALDOCDIR)\ogl.hpj
cd $(LOCALDOCDIR)
-erase ogl.ph
$(LOCALDOCDIR)\ogl.rtf: $(DOCSOURCES)
cd $(LOCALDOCDIR)
- -start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(LOCALDOCDIR)\ogl.rtf -twice -winhelp
+ -start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(LOCALDOCDIR)\ogl.rtf -twice -winhelp
cd $(THISDIR)
$(DOCDIR)\pdf\ogl.rtf: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-copy *.bmp $(DOCDIR)\pdf
- -start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\pdf\ogl.rtf -twice -rtf
+ -start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\pdf\ogl.rtf -twice -rtf
cd $(THISDIR)
$(DOCDIR)\html\ogl\ogl.htm: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-mkdir $(DOCDIR)\html\ogl
copy *.gif $(DOCDIR)\html\ogl
- -start /w tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html
+ -start $(WAITFLAG) tex2rtf $(LOCALDOCDIR)\ogl.tex $(DOCDIR)\html\ogl\ogl.htm -twice -html
-erase $(DOCDIR)\html\ogl\*.con
+ -erase *.con
-erase $(DOCDIR)\html\ogl\*.ref
cd $(THISDIR)
+
+$(DOCDIR)\html\ogl\ogl.chm: $(DOCDIR)\html\ogl\ogl.htm $(DOCDIR)\html\ogl\ogl.hhp
+ cd $(DOCDIR)\html\ogl
+ -hhc ogl.hhp
+ cd $(THISDIR)
+
+
$(LOCALDOCDIR)\ogl.dvi: $(DOCSOURCES)
cd $(LOCALDOCDIR)
-latex ogl