]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/ogl/src/basic.h
const added to GetBitmap it was my fault.
[wxWidgets.git] / utils / ogl / src / basic.h
index bc3bb5f356dc6ab36c737e42154fe48036f84a4b..52b78d16eda238af5b1bbf68ee85d5ecfa1ff1b0 100644 (file)
@@ -269,7 +269,9 @@ class wxShape: public wxShapeEvtHandler
   virtual bool HitTest(double x, double y, int *attachment, double *distance);
   inline void SetCentreResize(bool cr) { m_centreResize = cr; }
   inline bool GetCentreResize() const { return m_centreResize; }
-  inline wxList& GetLines() { return m_lines; }
+  inline void SetMaintainAspectRatio(bool ar) { m_maintainAspectRatio = ar; }
+  inline bool GetMaintainAspectRatio() const { return m_maintainAspectRatio; }
+  inline wxList& GetLines() const { return (wxList&) m_lines; }
   inline void SetDisableLabel(bool flag) { m_disableLabel = flag; }
   inline bool GetDisableLabel() const { return m_disableLabel; }
   inline void SetAttachmentMode(bool flag) { m_attachmentMode = flag; }
@@ -364,10 +366,9 @@ class wxShape: public wxShapeEvtHandler
   void RemoveLine(wxLineShape *line);
 
 #ifdef PROLOGIO
-  // Prolog database stuff
-  virtual char *GetFunctor();
-  virtual void WritePrologAttributes(wxExpr *clause);
-  virtual void ReadPrologAttributes(wxExpr *clause);
+  // I/O
+  virtual void WriteAttributes(wxExpr *clause);
+  virtual void ReadAttributes(wxExpr *clause);
 
   // In case the object has constraints it needs to read in in a different pass
   inline virtual void ReadConstraints(wxExpr *WXUNUSED(clause), wxExprDatabase *WXUNUSED(database)) { };
@@ -378,23 +379,23 @@ class wxShape: public wxShapeEvtHandler
   // Attachment code
   virtual bool GetAttachmentPosition(int attachment, double *x, double *y,
                                      int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
-  virtual int GetNumberOfAttachments();
-  virtual bool AttachmentIsValid(int attachment);
+  virtual int GetNumberOfAttachments() const;
+  virtual bool AttachmentIsValid(int attachment) const;
 
   // Assuming the attachment lies along a vertical or horizontal line,
   // calculate the position on that point.
-  wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
+  virtual wxRealPoint CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2,
     int nth, int noArcs, wxLineShape* line);
 
   // Returns TRUE if pt1 <= pt2 in the sense that one point comes before another on an
   // edge of the shape.
   // attachmentPoint is the attachment point (= side) in question.
-  bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
+  virtual bool AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2);
 
   virtual void EraseLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
   virtual void DrawLinks(wxDC& dc, int attachment = -1, bool recurse = FALSE);
 
-  virtual void MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
+  virtual bool MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move,
                                        double x, double y);
 
   // Reorders the lines coming into the node image at this attachment
@@ -446,7 +447,7 @@ class wxShape: public wxShapeEvtHandler
  protected:
   wxShapeEvtHandler*    m_eventHandler;
   bool                  m_formatted;
-  double                 m_xpos, m_ypos;
+  double                m_xpos, m_ypos;
   wxPen*                m_pen;
   wxBrush*              m_brush;
   wxFont*               m_font;
@@ -464,7 +465,7 @@ class wxShape: public wxShapeEvtHandler
   bool                  m_selected;
   bool                  m_highlighted;      // Different from selected: user-defined highlighting,
                                             // e.g. thick border.
-  double                 m_rotation;
+  double                m_rotation;
   int                   m_sensitivity;
   bool                  m_draggable;
   bool                  m_attachmentMode;   // TRUE if using attachments, FALSE otherwise
@@ -483,6 +484,7 @@ class wxShape: public wxShapeEvtHandler
   int                   m_textMarginX;    // Gap between text and border
   int                   m_textMarginY;
   wxString              m_regionName;
+  bool                  m_maintainAspectRatio;
 };
 
 class wxPolygonShape: public wxShape
@@ -533,12 +535,11 @@ class wxPolygonShape: public wxShape
   virtual void CalculatePolygonCentre();
 
 #ifdef PROLOGIO
-  // Prolog database stuff
-  void WritePrologAttributes(wxExpr *clause);
-  void ReadPrologAttributes(wxExpr *clause);
+  void WriteAttributes(wxExpr *clause);
+  void ReadAttributes(wxExpr *clause);
 #endif
 
-  int GetNumberOfAttachments();
+  int GetNumberOfAttachments() const;
   bool GetAttachmentPosition(int attachment, double *x, double *y,
                                      int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
   bool AttachmentIsValid(int attachment);
@@ -547,13 +548,16 @@ class wxPolygonShape: public wxShape
 
   inline wxList *GetPoints() { return m_points; }
 
+  // Rotate about the given axis by the given amount in radians
+  virtual void Rotate(double x, double y, double theta);
+
  private:
   wxList*       m_points;
   wxList*       m_originalPoints;
-  double         m_boundWidth;
-  double         m_boundHeight;
-  double         m_originalWidth;
-  double         m_originalHeight;
+  double        m_boundWidth;
+  double        m_boundHeight;
+  double        m_originalWidth;
+  double        m_originalHeight;
 };
 
 class wxRectangleShape: public wxShape
@@ -570,12 +574,11 @@ class wxRectangleShape: public wxShape
   void SetCornerRadius(double rad); // If > 0, rounded corners
 
 #ifdef PROLOGIO
-  // Prolog database stuff
-  void WritePrologAttributes(wxExpr *clause);
-  void ReadPrologAttributes(wxExpr *clause);
+  void WriteAttributes(wxExpr *clause);
+  void ReadAttributes(wxExpr *clause);
 #endif
 
-  int GetNumberOfAttachments();
+  int GetNumberOfAttachments() const;
   bool GetAttachmentPosition(int attachment, double *x, double *y,
                                      int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
   // Does the copying for this object
@@ -601,7 +604,7 @@ class wxTextShape: public wxRectangleShape
   void OnDraw(wxDC& dc);
 
 #ifdef PROLOGIO
-  void WritePrologAttributes(wxExpr *clause);
+  void WriteAttributes(wxExpr *clause);
 #endif
 
   // Does the copying for this object
@@ -623,12 +626,11 @@ class wxEllipseShape: public wxShape
   void SetSize(double x, double y, bool recursive = TRUE);
 
 #ifdef PROLOGIO
-  // Prolog database stuff
-  void WritePrologAttributes(wxExpr *clause);
-  void ReadPrologAttributes(wxExpr *clause);
+  void WriteAttributes(wxExpr *clause);
+  void ReadAttributes(wxExpr *clause);
 #endif
 
-  int GetNumberOfAttachments();
+  int GetNumberOfAttachments() const;
   bool GetAttachmentPosition(int attachment, double *x, double *y,
                                      int nth = 0, int no_arcs = 1, wxLineShape *line = NULL);
 
@@ -638,6 +640,9 @@ class wxEllipseShape: public wxShape
   inline double GetWidth() const { return m_width; }
   inline double GetHeight() const { return m_height; }
 
+  inline void SetWidth(double w) { m_width = w; }
+  inline void SetHeight(double h) { m_height = h; }
+
 protected:
   double m_width;
   double m_height;