]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/ogl/src/drawn.cpp
const added to GetBitmap it was my fault.
[wxWidgets.git] / utils / ogl / src / drawn.cpp
index 2337312fb50c653f243ac9b201468c6b15e9fb9d..f6d8f33a98d1c0d630ab72266bc81d87753e4c13 100644 (file)
@@ -236,16 +236,11 @@ bool wxDrawnShape::GetPerimeterPoint(double x1, double y1,
 }
 
 #ifdef PROLOGIO
-// Prolog database stuff
-char *wxDrawnShape::GetFunctor()
+void wxDrawnShape::WriteAttributes(wxExpr *clause)
 {
-  return "node_image";
-}
-
-void wxDrawnShape::WritePrologAttributes(wxExpr *clause)
-{
-  wxRectangleShape::WritePrologAttributes(clause);
+  wxRectangleShape::WriteAttributes(clause);
 
+  clause->AddAttributeValue("current_angle", (long)m_currentAngle);
   clause->AddAttributeValue("save_metafile", (long)m_saveToFile);
   if (m_saveToFile)
   {
@@ -253,17 +248,18 @@ void wxDrawnShape::WritePrologAttributes(wxExpr *clause)
     for (i = 0; i < 4; i++)
     {
         if (m_metafiles[i].IsValid())
-            m_metafiles[i].WritePrologAttributes(clause, i);
+            m_metafiles[i].WriteAttributes(clause, i);
     }
   }
 }
 
-void wxDrawnShape::ReadPrologAttributes(wxExpr *clause)
+void wxDrawnShape::ReadAttributes(wxExpr *clause)
 {
-  wxRectangleShape::ReadPrologAttributes(clause);
+  wxRectangleShape::ReadAttributes(clause);
 
   int iVal = (int) m_saveToFile;
-  clause->AssignAttributeValue("save_metafile", &iVal);
+  clause->GetAttributeValue("save_metafile", iVal);
+  clause->GetAttributeValue("current_angle", m_currentAngle);
   m_saveToFile = (iVal != 0);
 
   if (m_saveToFile)
@@ -271,7 +267,7 @@ void wxDrawnShape::ReadPrologAttributes(wxExpr *clause)
     int i = 0;
     for (i = 0; i < 4; i++)
     {
-      m_metafiles[i].ReadPrologAttributes(clause, i);
+      m_metafiles[i].ReadAttributes(clause, i);
     }
   }
 }
@@ -376,32 +372,32 @@ void wxDrawnShape::DestroyClippingRect()
     m_metafiles[m_currentAngle].DestroyClippingRect();
 }
 
-void wxDrawnShape::SetPen(wxPen* pen, bool isOutline)
+void wxDrawnShape::SetDrawnPen(wxPen* pen, bool isOutline)
 {
     m_metafiles[m_currentAngle].SetPen(pen, isOutline);
 }
 
-void wxDrawnShape::SetBrush(wxBrush* brush, bool isFill)
+void wxDrawnShape::SetDrawnBrush(wxBrush* brush, bool isFill)
 {
     m_metafiles[m_currentAngle].SetBrush(brush, isFill);
 }
 
-void wxDrawnShape::SetFont(wxFont* font)
+void wxDrawnShape::SetDrawnFont(wxFont* font)
 {
     m_metafiles[m_currentAngle].SetFont(font);
 }
 
-void wxDrawnShape::SetTextColour(const wxColour& colour)
+void wxDrawnShape::SetDrawnTextColour(const wxColour& colour)
 {
     m_metafiles[m_currentAngle].SetTextColour(colour);
 }
 
-void wxDrawnShape::SetBackgroundColour(const wxColour& colour)
+void wxDrawnShape::SetDrawnBackgroundColour(const wxColour& colour)
 {
     m_metafiles[m_currentAngle].SetBackgroundColour(colour);
 }
 
-void wxDrawnShape::SetBackgroundMode(int mode)
+void wxDrawnShape::SetDrawnBackgroundMode(int mode)
 {
     m_metafiles[m_currentAngle].SetBackgroundMode(mode);
 }
@@ -527,7 +523,7 @@ wxDrawOp *wxOpSetGDI::Copy(wxPseudoMetaFile *newImage)
 
 wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *image)
 {
-  wxExpr *expr = new wxExpr(PrologList);
+  wxExpr *expr = new wxExpr(wxExprList);
   expr->Append(new wxExpr((long)m_op));
   switch (m_op)
   {
@@ -641,7 +637,7 @@ void wxOpSetClipping::Translate(double x, double y)
 
 wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *image)
 {
-  wxExpr *expr = new wxExpr(PrologList);
+  wxExpr *expr = new wxExpr(wxExprList);
   expr->Append(new wxExpr((long)m_op));
   switch (m_op)
   {
@@ -885,7 +881,7 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double
 
 wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image)
 {
-  wxExpr *expr = new wxExpr(PrologList);
+  wxExpr *expr = new wxExpr(wxExprList);
   expr->Append(new wxExpr((long)m_op));
   switch (m_op)
   {
@@ -918,7 +914,7 @@ wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image)
     {
       expr->Append(new wxExpr(m_x1));
       expr->Append(new wxExpr(m_y1));
-      expr->Append(new wxExpr(PrologString, m_textString));
+      expr->Append(new wxExpr(wxExprString, m_textString));
       break;
     }
     case DRAWOP_DRAW_ARC:
@@ -1109,7 +1105,7 @@ void wxOpPolyDraw::Rotate(double x, double y, double theta, double sinTheta, dou
 
 wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image)
 {
-  wxExpr *expr = new wxExpr(PrologList);
+  wxExpr *expr = new wxExpr(wxExprList);
   expr->Append(new wxExpr((long)m_op));
   expr->Append(new wxExpr((long)m_noPoints));
 
@@ -1146,7 +1142,7 @@ wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image)
       strcat(oglBuffer, buf3);
     }
   }
-  expr->Append(new wxExpr(PrologString, oglBuffer));
+  expr->Append(new wxExpr(wxExprString, oglBuffer));
   return expr;
 }
 
@@ -1452,7 +1448,7 @@ void wxPseudoMetaFile::Rotate(double x, double y, double theta)
 }
 
 #ifdef PROLOGIO
-void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
+void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle)
 {
   wxString widthStr;
   widthStr.Printf("meta_width%d", whichAngle);
@@ -1486,7 +1482,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
       if (obj->IsKindOf(CLASSINFO(wxPen)))
       {
         wxPen *thePen = (wxPen *)obj;
-        expr = new wxExpr(PrologList);
+        expr = new wxExpr(wxExprList);
         expr->Append(new wxExpr((long)gyTYPE_PEN));
         expr->Append(new wxExpr((long)thePen->GetWidth()));
         expr->Append(new wxExpr((long)thePen->GetStyle()));
@@ -1497,7 +1493,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
       else if (obj->IsKindOf(CLASSINFO(wxBrush)))
       {
         wxBrush *theBrush = (wxBrush *)obj;
-        expr = new wxExpr(PrologList);
+        expr = new wxExpr(wxExprList);
         expr->Append(new wxExpr((long)gyTYPE_BRUSH));
         expr->Append(new wxExpr((long)theBrush->GetStyle()));
         expr->Append(new wxExpr((long)theBrush->GetColour().Red()));
@@ -1507,7 +1503,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
       else if (obj->IsKindOf(CLASSINFO(wxFont)))
       {
         wxFont *theFont = (wxFont *)obj;
-        expr = new wxExpr(PrologList);
+        expr = new wxExpr(wxExprList);
         expr->Append(new wxExpr((long)gyTYPE_FONT));
         expr->Append(new wxExpr((long)theFont->GetPointSize()));
         expr->Append(new wxExpr((long)theFont->GetFamily()));
@@ -1519,7 +1515,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
     else
     {
       // If no recognised GDI object, append a place holder anyway.
-      expr = new wxExpr(PrologList);
+      expr = new wxExpr(wxExprList);
       expr->Append(new wxExpr((long)0));
     }
 
@@ -1550,7 +1546,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
   // Write outline and fill GDI op lists (if any)
   if (m_outlineColours.Number() > 0)
   {
-    wxExpr *outlineExpr = new wxExpr(PrologList);
+    wxExpr *outlineExpr = new wxExpr(wxExprList);
     node = m_outlineColours.First();
     while (node)
     {
@@ -1564,7 +1560,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
   }
   if (m_fillColours.Number() > 0)
   {
-    wxExpr *fillExpr = new wxExpr(PrologList);
+    wxExpr *fillExpr = new wxExpr(wxExprList);
     node = m_fillColours.First();
     while (node)
     {
@@ -1579,7 +1575,7 @@ void wxPseudoMetaFile::WritePrologAttributes(wxExpr *clause, int whichAngle)
     
 }
 
-void wxPseudoMetaFile::ReadPrologAttributes(wxExpr *clause, int whichAngle)
+void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle)
 {
   wxString widthStr;
   widthStr.Printf("meta_width%d", whichAngle);