Changes needed to allow OGL to compile when wxUSE_PROLOGIO==0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-11-19 02:13:32 +00:00
parent 73a0aac054
commit 9dd12fa0af
16 changed files with 51 additions and 36 deletions

View File

@@ -22,11 +22,6 @@
#define DEFAULT_MOUSE_TOLERANCE 3
#endif
// Edit these lines if you positively don't want PROLOGIO support
#ifndef PROLOGIO
#define PROLOGIO
#endif
// Key identifiers
#define KEY_SHIFT 1
#define KEY_CTRL 2
@@ -110,7 +105,7 @@ class wxControlPoint;
class wxShapeRegion;
class wxShape;
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
class WXDLLEXPORT wxExpr;
class WXDLLEXPORT wxExprDatabase;
#endif
@@ -381,7 +376,7 @@ class wxShape: public wxShapeEvtHandler
virtual void ClearText(int regionId = 0);
void RemoveLine(wxLineShape *line);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
// I/O
virtual void WriteAttributes(wxExpr *clause);
virtual void ReadAttributes(wxExpr *clause);
@@ -613,7 +608,7 @@ class wxPolygonShape: public wxShape
// Recalculates the centre of the polygon
virtual void CalculatePolygonCentre();
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
#endif
@@ -652,7 +647,7 @@ class wxRectangleShape: public wxShape
void SetSize(double x, double y, bool recursive = TRUE);
void SetCornerRadius(double rad); // If > 0, rounded corners
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
#endif
@@ -682,8 +677,8 @@ class wxTextShape: public wxRectangleShape
void OnDraw(wxDC& dc);
#ifdef PROLOGIO
void WriteAttributes(wxExpr *clause);
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
#endif
// Does the copying for this object
@@ -704,7 +699,7 @@ class wxEllipseShape: public wxShape
void OnDraw(wxDC& dc);
void SetSize(double x, double y, bool recursive = TRUE);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
#endif

View File

@@ -27,7 +27,7 @@ class wxBitmapShape: public wxRectangleShape
void OnDraw(wxDC& dc);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
// I/O
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);

View File

@@ -77,7 +77,7 @@ public:
// Calculates size and position of composite object based on children
void CalculateSize();
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
// In case the object has constraints it needs to read in in a different pass
@@ -152,7 +152,7 @@ class wxDivisionShape: public wxCompositeShape
void MakeMandatoryControlPoints();
void ResetMandatoryControlPoints();
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
#endif

View File

@@ -46,7 +46,7 @@ class wxDividedShape: public wxRectangleShape
void MakeMandatoryControlPoints();
void ResetMandatoryControlPoints();
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
#endif

View File

@@ -32,7 +32,7 @@ class wxPseudoMetaFile: public wxObject
void Draw(wxDC& dc, double xoffset, double yoffset);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause, int whichAngle);
void ReadAttributes(wxExpr *clause, int whichAngle);
#endif
@@ -139,7 +139,7 @@ class wxDrawnShape: public wxRectangleShape
void OnDraw(wxDC& dc);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
// I/O
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);

View File

@@ -65,9 +65,10 @@ public:
inline virtual void Rotate(double x, double y, double theta, double sinTheta, double cosTheta) {};
virtual void Do(wxDC& dc, double xoffset, double yoffset) = 0;
virtual wxDrawOp *Copy(wxPseudoMetaFile *newImage) = 0;
#if wxUSE_PROLOGIO
virtual wxExpr *WriteExpr(wxPseudoMetaFile *image) = 0;
virtual void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) = 0;
#endif
inline int GetOp() const { return m_op; }
// Draw an outline using the current operation. By default, return FALSE (not drawn)
@@ -98,8 +99,10 @@ class wxOpSetGDI: public wxDrawOp
wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, int theMode = 0);
void Do(wxDC& dc, double xoffset, double yoffset);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
#if wxUSE_PROLOGIO
wxExpr *WriteExpr(wxPseudoMetaFile *image);
void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
#endif
public:
int m_mode;
@@ -123,8 +126,10 @@ public:
void Scale(double xScale, double yScale);
void Translate(double x, double y);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
#if wxUSE_PROLOGIO
wxExpr *WriteExpr(wxPseudoMetaFile *image);
void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
#endif
public:
double m_x1;
@@ -149,8 +154,10 @@ class wxOpDraw: public wxDrawOp
void Translate(double x, double y);
void Rotate(double x, double y, double theta, double sinTheta, double cosTheta);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
#if wxUSE_PROLOGIO
wxExpr *WriteExpr(wxPseudoMetaFile *image);
void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
#endif
public:
double m_x1;
@@ -179,8 +186,10 @@ public:
void Translate(double x, double y);
void Rotate(double x, double y, double theta, double sinTheta, double cosTheta);
wxDrawOp *Copy(wxPseudoMetaFile *newImage);
#if wxUSE_PROLOGIO
wxExpr *WriteExpr(wxPseudoMetaFile *image);
void ReadExpr(wxPseudoMetaFile *image, wxExpr *expr);
#endif
// Draw an outline using the current operation.
virtual bool OnDrawOutline(wxDC& dc, double x, double y, double w, double h,

View File

@@ -188,7 +188,7 @@ class wxLineShape: public wxShape
bool HitTest(double x, double y, int *attachment, double *distance);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
// I/O
virtual void WriteAttributes(wxExpr *clause);
virtual void ReadAttributes(wxExpr *clause);

View File

@@ -67,7 +67,7 @@ public:
// Make sure all text that should be centred, is centred.
void RecentreAll(wxDC& dc);
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
virtual bool SaveFile(const wxString& filename);
virtual bool LoadFile(const wxString& filename);

View File

@@ -1697,7 +1697,7 @@ void wxShape::RemoveLine(wxLineShape *line)
m_lines.DeleteObject(line);
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxShape::WriteAttributes(wxExpr *clause)
{
clause->AddAttributeValueString("type", GetClassInfo()->GetClassName());

View File

@@ -581,7 +581,7 @@ void wxPolygonShape::ResetControlPoints()
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxPolygonShape::WriteAttributes(wxExpr *clause)
{
wxShape::WriteAttributes(clause);
@@ -940,7 +940,7 @@ bool wxRectangleShape::GetPerimeterPoint(double x1, double y1,
return TRUE;
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxRectangleShape::WriteAttributes(wxExpr *clause)
{
wxShape::WriteAttributes(clause);
@@ -1013,7 +1013,7 @@ void wxTextShape::Copy(wxShape& copy)
wxRectangleShape::Copy(copy);
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxTextShape::WriteAttributes(wxExpr *clause)
{
wxRectangleShape::WriteAttributes(clause);
@@ -1080,7 +1080,7 @@ void wxEllipseShape::SetSize(double x, double y, bool recursive)
SetDefaultRegionSize();
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxEllipseShape::WriteAttributes(wxExpr *clause)
{
wxShape::WriteAttributes(clause);

View File

@@ -52,7 +52,7 @@ void wxBitmapShape::OnDraw(wxDC& dc)
{
if (!m_bitmap.Ok())
return;
wxMemoryDC tempDC;
tempDC.SelectObject(m_bitmap);
double x, y;
@@ -76,7 +76,7 @@ void wxBitmapShape::SetSize(double w, double h, bool recursive)
SetDefaultRegionSize();
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxBitmapShape::WriteAttributes(wxExpr *clause)
{
// Can't really save the bitmap; so instantiate the bitmap

View File

@@ -33,10 +33,11 @@
#include <wx/ogl/misc.h>
#include <wx/ogl/canvas.h>
#if wxUSE_PROLOGIO
// Sometimes, objects need to access the whole database to
// construct themselves.
wxExprDatabase *GlobalwxExprDatabase = NULL;
#endif
/*
* Division control point
@@ -598,7 +599,7 @@ bool wxCompositeShape::Constrain()
return changed;
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxCompositeShape::WriteAttributes(wxExpr *clause)
{
wxRectangleShape::WriteAttributes(clause);
@@ -984,7 +985,7 @@ void wxDivisionShape::Copy(wxShape& copy)
// Division geometry copying is handled at the wxCompositeShape level.
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxDivisionShape::WriteAttributes(wxExpr *clause)
{
wxCompositeShape::WriteAttributes(clause);

View File

@@ -415,7 +415,7 @@ void wxDividedShape::ResetMandatoryControlPoints()
}
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxDividedShape::WriteAttributes(wxExpr *clause)
{
wxRectangleShape::WriteAttributes(clause);

View File

@@ -35,6 +35,8 @@
#include <wx/ogl/drawnp.h>
#include <wx/ogl/misc.h>
#include <math.h>
static void IntToHex(unsigned int dec, char *buf);
static unsigned long HexToInt(char *buf);
extern char *oglBuffer;
@@ -234,7 +236,7 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1,
return wxRectangleShape::GetPerimeterPoint(x1, y1, x2, y2, x3, y3);
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxDrawnShape::WriteAttributes(wxExpr *clause)
{
wxRectangleShape::WriteAttributes(clause);
@@ -520,6 +522,7 @@ wxDrawOp *wxOpSetGDI::Copy(wxPseudoMetaFile *newImage)
return newOp;
}
#if wxUSE_PROLOGIO
wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(wxExprList);
@@ -580,6 +583,7 @@ void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
break;
}
}
#endif
/*
* Set/destroy clipping
@@ -634,6 +638,7 @@ void wxOpSetClipping::Translate(double x, double y)
m_y1 += y;
}
#if wxUSE_PROLOGIO
wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(wxExprList);
@@ -670,6 +675,7 @@ void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
break;
}
}
#endif
/*
* Draw line, rectangle, rounded rectangle, ellipse, point, arc, text
@@ -878,6 +884,7 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double
}
}
#if wxUSE_PROLOGIO
wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(wxExprList);
@@ -989,6 +996,7 @@ void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
}
}
}
#endif
/*
* Draw polygon, polyline, spline
@@ -1102,6 +1110,7 @@ void wxOpPolyDraw::Rotate(double x, double y, double theta, double sinTheta, dou
}
}
#if wxUSE_PROLOGIO
wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image)
{
wxExpr *expr = new wxExpr(wxExprList);
@@ -1190,6 +1199,7 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
i ++;
}
}
#endif
// Draw an outline using the current operation.
bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double h, double oldW, double oldH)
@@ -1446,7 +1456,7 @@ void wxPseudoMetaFile::Rotate(double x, double y, double theta)
m_currentRotation = theta;
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle)
{
wxString widthStr;

View File

@@ -1373,7 +1373,7 @@ void wxLineShape::ResetControlPoints()
}
}
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
void wxLineShape::WriteAttributes(wxExpr *clause)
{
wxShape::WriteAttributes(clause);

View File

@@ -225,7 +225,7 @@ void wxDiagram::RecentreAll(wxDC& dc)
}
// Input/output
#ifdef PROLOGIO
#if wxUSE_PROLOGIO
bool wxDiagram::SaveFile(const wxString& filename)
{
wxBeginBusyCursor();