X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e5ed787e9f0f4eac35b9a55e97ea4a177e2fdda..2910dac85f655c9beae54b3d5c723237eda3e6f6:/utils/ogl/src/lines.cpp?ds=sidebyside diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp index b321ba3854..d03b2f401a 100644 --- a/utils/ogl/src/lines.cpp +++ b/utils/ogl/src/lines.cpp @@ -28,7 +28,7 @@ #include #endif -#if USE_IOSTREAMH +#if wxUSE_IOSTREAMH #include #else #include @@ -1065,7 +1065,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) // if (moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) // Only move control points if it's a self link. And only works if attachment mode is ON. - if ((m_from == m_to) && m_from->GetAttachmentMode() && moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) + if ((m_from == m_to) && (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) && moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) { wxNode *node = m_lineControlPoints->First(); while (node) @@ -1110,7 +1110,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d if (m_lineControlPoints->Number() > 2) { - if (m_from->GetAttachmentMode()) + if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_from, &nth, &no_arcs, FALSE); // Not incoming @@ -1121,7 +1121,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d (double)second_point->x, (double)second_point->y, &end_x, &end_y); - if (m_to->GetAttachmentMode()) + if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_to, &nth, &no_arcs, TRUE); // Incoming @@ -1139,7 +1139,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d double toX = m_to->GetX(); double toY = m_to->GetY(); - if (m_from->GetAttachmentMode()) + if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_from, &nth, &no_arcs, FALSE); @@ -1148,7 +1148,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d fromY = end_y; } - if (m_to->GetAttachmentMode()) + if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_to, &nth, &no_arcs, TRUE); @@ -1157,12 +1157,12 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d toY = other_end_y; } - if (!m_from->GetAttachmentMode()) + if (m_from->GetAttachmentMode() == ATTACHMENT_MODE_NONE) (void) m_from->GetPerimeterPoint(m_from->GetX(), m_from->GetY(), toX, toY, &end_x, &end_y); - if (!m_to->GetAttachmentMode()) + if (m_to->GetAttachmentMode() == ATTACHMENT_MODE_NONE) (void) m_to->GetPerimeterPoint(m_to->GetX(), m_to->GetY(), fromX, fromY, &other_end_x, &other_end_y); @@ -1296,14 +1296,6 @@ void wxLineShape::OnDrawContents(wxDC& dc) } } - -#ifdef PROLOGIO -char *wxLineShape::GetFunctor() -{ - return "arc_image"; -} -#endif - void wxLineShape::SetTo(wxShape *object) { m_to = object; @@ -1377,9 +1369,9 @@ void wxLineShape::ResetControlPoints() } #ifdef PROLOGIO -void wxLineShape::WritePrologAttributes(wxExpr *clause) +void wxLineShape::WriteAttributes(wxExpr *clause) { - wxShape::WritePrologAttributes(clause); + wxShape::WriteAttributes(clause); if (m_from) clause->AddAttributeValue("from", m_from->GetId()); @@ -1401,12 +1393,12 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause) clause->AddAttributeValue("keep_lines_straight", (long)m_maintainStraightLines); // Make a list of lists for the (sp)line controls - wxExpr *list = new wxExpr(PrologList); + wxExpr *list = new wxExpr(wxExprList); wxNode *node = m_lineControlPoints->First(); while (node) { wxRealPoint *point = (wxRealPoint *)node->Data(); - wxExpr *point_list = new wxExpr(PrologList); + wxExpr *point_list = new wxExpr(wxExprList); wxExpr *x_expr = new wxExpr((double) point->x); wxExpr *y_expr = new wxExpr((double) point->y); point_list->Append(x_expr); @@ -1422,17 +1414,17 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause) // (arrowType arrowEnd xOffset arrowSize) if (m_arcArrows.Number() > 0) { - wxExpr *arrow_list = new wxExpr(PrologList); + wxExpr *arrow_list = new wxExpr(wxExprList); node = m_arcArrows.First(); while (node) { wxArrowHead *head = (wxArrowHead *)node->Data(); - wxExpr *head_list = new wxExpr(PrologList); + wxExpr *head_list = new wxExpr(wxExprList); head_list->Append(new wxExpr((long)head->_GetType())); head_list->Append(new wxExpr((long)head->GetArrowEnd())); head_list->Append(new wxExpr(head->GetXOffset())); head_list->Append(new wxExpr(head->GetArrowSize())); - head_list->Append(new wxExpr(PrologString, (head->GetName() ? head->GetName() : ""))); + head_list->Append(new wxExpr(wxExprString, (head->GetName() ? head->GetName() : ""))); head_list->Append(new wxExpr(head->GetId())); // New members of wxArrowHead @@ -1447,9 +1439,9 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause) } } -void wxLineShape::ReadPrologAttributes(wxExpr *clause) +void wxLineShape::ReadAttributes(wxExpr *clause) { - wxShape::ReadPrologAttributes(clause); + wxShape::ReadAttributes(clause); int iVal = (int) m_isSpline; clause->AssignAttributeValue("is_spline", &iVal);