From 738ecbd5fad2b46836bfd6a94aeebf165ae2bbca Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 4 Jan 2018 16:00:52 +0100 Subject: relocated source code to the root --- src/data/edge.cpp | 306 +++++ src/data/edge.h | 89 ++ src/data/graph.cpp | 172 +++ src/data/graph.h | 56 + src/data/graphelementdata.cpp | 170 +++ src/data/graphelementdata.h | 66 + src/data/graphelementproperty.cpp | 59 + src/data/graphelementproperty.h | 40 + src/data/node.cpp | 79 ++ src/data/node.h | 49 + src/data/nodestyle.cpp | 32 + src/data/nodestyle.h | 26 + src/data/tikzdocument.cpp | 82 ++ src/data/tikzdocument.h | 43 + src/data/tikzgraphassembler.cpp | 33 + src/data/tikzgraphassembler.h | 31 + src/data/tikzlexer.l | 181 +++ src/data/tikzlexer.lexer.cpp | 2535 +++++++++++++++++++++++++++++++++++++ src/data/tikzparser.parser.cpp | 1938 ++++++++++++++++++++++++++++ src/data/tikzparser.parser.hpp | 139 ++ src/data/tikzparser.y | 262 ++++ src/data/tikzparserdefs.h | 18 + src/gui/commands.cpp | 0 src/gui/commands.h | 4 + src/gui/edgeitem.cpp | 131 ++ src/gui/edgeitem.h | 36 + src/gui/mainmenu.cpp | 96 ++ src/gui/mainmenu.h | 43 + src/gui/mainmenu.ui | 187 +++ src/gui/mainwindow.cpp | 99 ++ src/gui/mainwindow.h | 48 + src/gui/mainwindow.ui | 199 +++ src/gui/nodeitem.cpp | 124 ++ src/gui/nodeitem.h | 32 + src/gui/propertypalette.cpp | 43 + src/gui/propertypalette.h | 28 + src/gui/propertypalette.ui | 30 + src/gui/tikzscene.cpp | 384 ++++++ src/gui/tikzscene.h | 62 + src/gui/tikzview.cpp | 84 ++ src/gui/tikzview.h | 32 + src/gui/toolpalette.cpp | 50 + src/gui/toolpalette.h | 34 + src/gui/undocommands.cpp | 162 +++ src/gui/undocommands.h | 80 ++ src/main.cpp | 14 + src/test/testmain.cpp | 22 + src/test/testparser.cpp | 163 +++ src/test/testparser.h | 18 + src/test/testtest.cpp | 10 + src/test/testtest.h | 17 + src/test/testtikzoutput.cpp | 97 ++ src/test/testtikzoutput.h | 17 + src/tikzit.cpp | 105 ++ src/tikzit.h | 70 + src/util.cpp | 48 + src/util.h | 24 + 57 files changed, 8999 insertions(+) create mode 100644 src/data/edge.cpp create mode 100644 src/data/edge.h create mode 100644 src/data/graph.cpp create mode 100644 src/data/graph.h create mode 100644 src/data/graphelementdata.cpp create mode 100644 src/data/graphelementdata.h create mode 100644 src/data/graphelementproperty.cpp create mode 100644 src/data/graphelementproperty.h create mode 100644 src/data/node.cpp create mode 100644 src/data/node.h create mode 100644 src/data/nodestyle.cpp create mode 100644 src/data/nodestyle.h create mode 100644 src/data/tikzdocument.cpp create mode 100644 src/data/tikzdocument.h create mode 100644 src/data/tikzgraphassembler.cpp create mode 100644 src/data/tikzgraphassembler.h create mode 100644 src/data/tikzlexer.l create mode 100644 src/data/tikzlexer.lexer.cpp create mode 100644 src/data/tikzparser.parser.cpp create mode 100644 src/data/tikzparser.parser.hpp create mode 100644 src/data/tikzparser.y create mode 100644 src/data/tikzparserdefs.h create mode 100644 src/gui/commands.cpp create mode 100644 src/gui/commands.h create mode 100644 src/gui/edgeitem.cpp create mode 100644 src/gui/edgeitem.h create mode 100644 src/gui/mainmenu.cpp create mode 100644 src/gui/mainmenu.h create mode 100644 src/gui/mainmenu.ui create mode 100644 src/gui/mainwindow.cpp create mode 100644 src/gui/mainwindow.h create mode 100644 src/gui/mainwindow.ui create mode 100644 src/gui/nodeitem.cpp create mode 100644 src/gui/nodeitem.h create mode 100644 src/gui/propertypalette.cpp create mode 100644 src/gui/propertypalette.h create mode 100644 src/gui/propertypalette.ui create mode 100644 src/gui/tikzscene.cpp create mode 100644 src/gui/tikzscene.h create mode 100644 src/gui/tikzview.cpp create mode 100644 src/gui/tikzview.h create mode 100644 src/gui/toolpalette.cpp create mode 100644 src/gui/toolpalette.h create mode 100644 src/gui/undocommands.cpp create mode 100644 src/gui/undocommands.h create mode 100644 src/main.cpp create mode 100644 src/test/testmain.cpp create mode 100644 src/test/testparser.cpp create mode 100644 src/test/testparser.h create mode 100644 src/test/testtest.cpp create mode 100644 src/test/testtest.h create mode 100644 src/test/testtikzoutput.cpp create mode 100644 src/test/testtikzoutput.h create mode 100644 src/tikzit.cpp create mode 100644 src/tikzit.h create mode 100644 src/util.cpp create mode 100644 src/util.h (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp new file mode 100644 index 0000000..6802b2d --- /dev/null +++ b/src/data/edge.cpp @@ -0,0 +1,306 @@ +#include "edge.h" +#include "tikzit.h" +#include "util.h" + +#include +#include + +Edge::Edge(Node *s, Node *t, QObject *parent) : + QObject(parent), _source(s), _target(t) +{ + _data = new GraphElementData(); + _edgeNode = 0; + _dirty = true; + _basicBendMode = true; + _bend = 0; + _inAngle = 0; + _outAngle = 0; + _weight = 0.4f; + updateControls(); +} + +Edge::~Edge() +{ + delete _data; + delete _edgeNode; +} + +Node *Edge::source() const +{ + return _source; +} + +Node *Edge::target() const +{ + return _target; +} + +bool Edge::isSelfLoop() +{ + return (_source == _target); +} + +bool Edge::isStraight() +{ + return (_basicBendMode && _bend == 0); +} + +GraphElementData *Edge::data() const +{ + return _data; +} + +void Edge::setData(GraphElementData *data) +{ + delete _data; + _data = data; + setAttributesFromData(); +} + +QString Edge::sourceAnchor() const +{ + return _sourceAnchor; +} + +void Edge::setSourceAnchor(const QString &sourceAnchor) +{ + _sourceAnchor = sourceAnchor; +} + +QString Edge::targetAnchor() const +{ + return _targetAnchor; +} + +void Edge::setTargetAnchor(const QString &targetAnchor) +{ + _targetAnchor = targetAnchor; +} + +Node *Edge::edgeNode() const +{ + return _edgeNode; +} + +void Edge::setEdgeNode(Node *edgeNode) +{ + if (_edgeNode != 0) delete _edgeNode; + _edgeNode = edgeNode; +} + +bool Edge::hasEdgeNode() +{ + return _edgeNode != 0; +} + +void Edge::updateControls() { + //if (_dirty) { + QPointF src = _source->point(); + QPointF targ = _target->point(); + + float dx = (targ.x() - src.x()); + float dy = (targ.y() - src.y()); + + float outAngleR = 0.0f; + float inAngleR = 0.0f; + + if (_basicBendMode) { + float angle = std::atan2(dy, dx); + float bnd = (float)_bend * (M_PI / 180.0f); + outAngleR = angle - bnd; + inAngleR = M_PI + angle + bnd; + _outAngle = outAngleR * (180.f / M_PI); + _inAngle = inAngleR * (180.f / M_PI); + } else { + outAngleR = (float)_outAngle * (M_PI / 180.0f); + inAngleR = (float)_inAngle * (M_PI / 180.0f); + } + + // TODO: calculate head and tail properly, not just for circles + if (_source->style()->isNone()) { + _tail = src; + } else { + _tail = QPointF(src.x() + std::cos(outAngleR) * 0.1, + src.y() + std::sin(outAngleR) * 0.1); + } + + if (_target->style()->isNone()) { + _head = targ; + } else { + _head = QPointF(targ.x() + std::cos(inAngleR) * 0.1, + targ.y() + std::sin(inAngleR) * 0.1); + } + + // give a default distance for self-loops + _cpDist = (dx==0.0f && dy==0.0f) ? _weight : std::sqrt(dx*dx + dy*dy) * _weight; + + _cp1 = QPointF(src.x() + (_cpDist * std::cos(outAngleR)), + src.y() + (_cpDist * std::sin(outAngleR))); + + _cp2 = QPointF(targ.x() + (_cpDist * std::cos(inAngleR)), + targ.y() + (_cpDist * std::sin(inAngleR))); + + _mid = bezierInterpolateFull (0.5f, _tail, _cp1, _cp2, _head); +// midTan = [self _findTanFor:mid usingSpanFrom:0.4f to:0.6f]; + +// tailTan = [self _findTanFor:tail usingSpanFrom:0.0f to:0.1f]; +// headTan = [self _findTanFor:head usingSpanFrom:1.0f to:0.9f]; + //_dirty = false; + //} +} + +void Edge::setAttributesFromData() +{ + _basicBendMode = true; + bool ok = true; + + if (_data->atom("bend left")) { + _bend = -30; + } else if (_data->atom("bend right")) { + _bend = 30; + } else if (_data->property("bend left") != 0) { + _bend = -_data->property("bend left").toInt(&ok); + if (!ok) _bend = -30; + } else if (_data->property("bend right") != 0) { + _bend = _data->property("bend right").toInt(&ok); + if (!ok) _bend = 30; + } else { + _bend = 0; + + if (_data->property("in") != 0 && _data->property("out") != 0) { + _basicBendMode = false; + _inAngle = _data->property("in").toInt(&ok); + if (!ok) _inAngle = 0; + _outAngle = _data->property("out").toInt(&ok); + if (!ok) _outAngle = 180; + } + } + + if (_data->property("looseness") != 0) { + _weight = _data->property("looseness").toFloat(&ok) / 2.5f; + if (!ok) _weight = 0.4f; + } else { + _weight = (isSelfLoop()) ? 1.0f : 0.4f; + } + + //qDebug() << "bend: " << _bend << " in: " << _inAngle << " out: " << _outAngle; + _dirty = true; +} + +void Edge::updateData() +{ + _data->unsetAtom("loop"); + _data->unsetProperty("in"); + _data->unsetProperty("out"); + _data->unsetAtom("bend left"); + _data->unsetAtom("bend right"); + _data->unsetProperty("bend left"); + _data->unsetProperty("bend right"); + _data->unsetProperty("looseness"); + + // TODO: style handling? + + if (_basicBendMode && _bend != 0) { + QString bendKey; + int b; + if (_bend < 0) { + bendKey = "bend left"; + b = -_bend; + } else { + bendKey = "bend right"; + b = _bend; + } + + if (b == 30) { + _data->setAtom(bendKey); + } else { + _data->setProperty(bendKey, QString::number(b)); + } + } else { + _data->setProperty("in", QString::number(_inAngle)); + _data->setProperty("out", QString::number(_outAngle)); + } + + if (_source == _target) _data->setAtom("loop"); + if (!isSelfLoop() && !isStraight() && _weight != 0.4f) + _data->setProperty("looseness", QString::number(_weight*2.5f, 'f', 2)); + +} + + +QPointF Edge::head() const +{ + return _head; +} + +QPointF Edge::tail() const +{ + return _tail; +} + +QPointF Edge::cp1() const +{ + return _cp1; +} + +QPointF Edge::cp2() const +{ + return _cp2; +} + +int Edge::bend() const +{ + return _bend; +} + +int Edge::inAngle() const +{ + return _inAngle; +} + +int Edge::outAngle() const +{ + return _outAngle; +} + +float Edge::weight() const +{ + return _weight; +} + +bool Edge::basicBendMode() const +{ + return _basicBendMode; +} + +float Edge::cpDist() const +{ + return _cpDist; +} + +void Edge::setBend(int bend) +{ + _bend = bend; +} + +void Edge::setInAngle(int inAngle) +{ + _inAngle = inAngle; +} + +void Edge::setOutAngle(int outAngle) +{ + _outAngle = outAngle; +} + +void Edge::setWeight(float weight) +{ + _weight = weight; +} + +QPointF Edge::mid() const +{ + return _mid; +} + + diff --git a/src/data/edge.h b/src/data/edge.h new file mode 100644 index 0000000..d2913b8 --- /dev/null +++ b/src/data/edge.h @@ -0,0 +1,89 @@ +#ifndef EDGE_H +#define EDGE_H + +#include "graphelementdata.h" +#include "node.h" + +#include +#include + +class Edge : public QObject +{ + Q_OBJECT +public: + explicit Edge(Node *s, Node *t, QObject *parent = 0); + ~Edge(); + + Node *source() const; + Node *target() const; + + bool isSelfLoop(); + bool isStraight(); + + GraphElementData *data() const; + void setData(GraphElementData *data); + + QString sourceAnchor() const; + void setSourceAnchor(const QString &sourceAnchor); + + QString targetAnchor() const; + void setTargetAnchor(const QString &targetAnchor); + + Node *edgeNode() const; + void setEdgeNode(Node *edgeNode); + bool hasEdgeNode(); + + void updateControls(); + void setAttributesFromData(); + void updateData(); + + QPointF head() const; + QPointF tail() const; + QPointF cp1() const; + QPointF cp2() const; + QPointF mid() const; + + int bend() const; + int inAngle() const; + int outAngle() const; + float weight() const; + bool basicBendMode() const; + float cpDist() const; + + void setBend(int bend); + void setInAngle(int inAngle); + void setOutAngle(int outAngle); + void setWeight(float weight); + +signals: + +public slots: + +private: + QString _sourceAnchor; + QString _targetAnchor; + + // owned + Node *_edgeNode; + GraphElementData *_data; + + // referenced + Node *_source; + Node *_target; + + bool _dirty; + bool _basicBendMode; + int _bend; + int _inAngle; + int _outAngle; + float _weight; + float _cpDist; + + QPointF _head; + QPointF _tail; + QPointF _cp1; + QPointF _cp2; + QPointF _mid; +}; + +#endif // EDGE_H diff --git a/src/data/graph.cpp b/src/data/graph.cpp new file mode 100644 index 0000000..ba9a4c6 --- /dev/null +++ b/src/data/graph.cpp @@ -0,0 +1,172 @@ +#include "graph.h" + +#include +#include +#include +#include +#include + +Graph::Graph(QObject *parent) : QObject(parent) +{ + _data = new GraphElementData(this); + _bbox = QRectF(0,0,0,0); +} + +Graph::~Graph() +{ +} + +// add a node. The graph claims ownership. +void Graph::addNode(Node *n) { + n->setParent(this); + _nodes << n; +} + +void Graph::addNode(Node *n, int index) +{ + n->setParent(this); + _nodes.insert(index, n); +} + +void Graph::removeNode(Node *n) { + // the node itself is not deleted, as it may still be referenced in an undo command. It will + // be deleted when graph is, via QObject memory management. + _nodes.removeOne(n); +} + + +void Graph::addEdge(Edge *e) +{ + e->setParent(this); + _edges << e; +} + +void Graph::addEdge(Edge *e, int index) +{ + e->setParent(this); + _edges.insert(index, e); +} + +void Graph::removeEdge(Edge *e) +{ + // the edge itself is not deleted, as it may still be referenced in an undo command. It will + // be deleted when graph is, via QObject memory management. + _edges.removeOne(e); +} + +GraphElementData *Graph::data() const +{ + return _data; +} + +void Graph::setData(GraphElementData *data) +{ + delete _data; + _data = data; +} + +const QVector &Graph::nodes() +{ + return _nodes; +} + +const QVector &Graph::edges() +{ + return _edges; +} + +QRectF Graph::bbox() const +{ + return _bbox; +} + +bool Graph::hasBbox() { + return !(_bbox == QRectF(0,0,0,0)); +} + +void Graph::clearBbox() { + _bbox = QRectF(0,0,0,0); +} + +QString Graph::tikz() +{ + QString str; + QTextStream code(&str); + + code << "\\begin{tikzpicture}" << _data->tikz() << "\n"; + if (hasBbox()) { + code << "\t\\path [use as bounding box] (" + << _bbox.topLeft().x() << "," << _bbox.topLeft().y() + << ") rectangle (" + << _bbox.bottomRight().x() << "," << _bbox.bottomRight().y() + << ");\n"; + } + + if (!_nodes.isEmpty()) + code << "\t\\begin{pgfonlayer}{nodelayer}\n"; + + Node *n; + foreach (n, _nodes) { + code << "\t\t\\node "; + + if (!n->data()->isEmpty()) + code << n->data()->tikz() << " "; + + code << "(" << n->name() << ") at (" + << n->point().x() << ", " << n->point().y() + << ") {" << n->label() << "};\n"; + } + + if (!_nodes.isEmpty()) + code << "\t\\end{pgfonlayer}\n"; + + if (!_edges.isEmpty()) + code << "\t\\begin{pgfonlayer}{edgelayer}\n"; + + + Edge *e; + foreach (e, _edges) { + code << "\t\t\\draw "; + + if (!e->data()->isEmpty()) + code << e->data()->tikz() << " "; + + code << "(" << e->source()->name(); + if (e->sourceAnchor() != "") + code << "." << e->sourceAnchor(); + code << ") to "; + + if (e->hasEdgeNode()) { + code << "node "; + if (!e->edgeNode()->data()->isEmpty()) + code << e->edgeNode()->data()->tikz() << " "; + code << "{" << e->edgeNode()->label() << "} "; + } + + if (e->source() == e->target()) { + code << "()"; + } else { + code << "(" << e->target()->name(); + if (e->targetAnchor() != "") + code << "." << e->targetAnchor(); + code << ")"; + } + + code << ";\n"; + } + + if (!_edges.isEmpty()) + code << "\t\\end{pgfonlayer}\n"; + + code << "\\end{tikzpicture}\n"; + + code.flush(); + return str; +} + +void Graph::setBbox(const QRectF &bbox) +{ + _bbox = bbox; +} + + diff --git a/src/data/graph.h b/src/data/graph.h new file mode 100644 index 0000000..8856e5c --- /dev/null +++ b/src/data/graph.h @@ -0,0 +1,56 @@ +/** + * A graph defined by tikz code. + */ + +#ifndef GRAPH_H +#define GRAPH_H + +#include "node.h" +#include "edge.h" +#include "graphelementdata.h" + +#include +#include +#include +#include +#include + +class Graph : public QObject +{ + Q_OBJECT +public: + explicit Graph(QObject *parent = 0); + ~Graph(); + void addNode(Node *n); + void addNode(Node *n, int index); + void removeNode(Node *n); + void addEdge(Edge *e); + void addEdge(Edge *e, int index); + void removeEdge(Edge *e); + + GraphElementData *data() const; + void setData(GraphElementData *data); + + const QVector &nodes(); + const QVector &edges(); + + QRectF bbox() const; + void setBbox(const QRectF &bbox); + bool hasBbox(); + void clearBbox(); + + QString tikz(); +signals: + +public slots: + +private: + QVector _nodes; + QVector _edges; + //QMultiHash inEdges; + //QMultiHash outEdges; + GraphElementData *_data; + QRectF _bbox; +}; + +#endif // GRAPH_H diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp new file mode 100644 index 0000000..3ce72c7 --- /dev/null +++ b/src/data/graphelementdata.cpp @@ -0,0 +1,170 @@ +#include "graphelementdata.h" + +#include +#include + +GraphElementData::GraphElementData(QObject *parent) : QAbstractItemModel(parent) +{ + root = new GraphElementProperty(); +} + +GraphElementData::~GraphElementData() +{ + delete root; +} + +void GraphElementData::setProperty(QString key, QString value) +{ + GraphElementProperty m(key, true); + int i = _properties.indexOf(m); + if (i != -1) { + _properties[i].setValue(value); + } else { + GraphElementProperty p(key, value); + _properties << p; + } +} + +void GraphElementData::unsetProperty(QString key) +{ + GraphElementProperty m(key, true); + int i = _properties.indexOf(m); + if (i != -1) + _properties.remove(i); +} + +void GraphElementData::add(GraphElementProperty p) +{ + _properties << p; +} + +void GraphElementData::operator <<(GraphElementProperty p) +{ + add(p); +} + +void GraphElementData::setAtom(QString atom) +{ + GraphElementProperty a(atom); + int i = _properties.indexOf(a); + if (i == -1) + _properties << a; +} + +void GraphElementData::unsetAtom(QString atom) +{ + GraphElementProperty a(atom); + int i = _properties.indexOf(a); + if (i != -1) + _properties.remove(i); +} + +QString GraphElementData::property(QString key) +{ + GraphElementProperty m(key, true); + int i = _properties.indexOf(m); + if (i != -1) { + return _properties[i].value(); + } else { + return 0; + } +} + +bool GraphElementData::atom(QString atom) +{ + GraphElementProperty a(atom); + return (_properties.indexOf(a) != -1); +} + +QVariant GraphElementData::data(const QModelIndex &index, int role) const +{ + if (role != Qt::DisplayRole) + return QVariant(); + + if (index.row() >= 0 && index.row() < _properties.length()) { + const GraphElementProperty &p = _properties[index.row()]; + QString s = (index.column() == 0) ? p.key() : p.value(); + return QVariant(s); + } +} + +QVariant GraphElementData::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { + if (section == 0) return QVariant("Key/Atom"); + else return QVariant("Value"); + } + + return QVariant(); +} + +QModelIndex GraphElementData::index(int row, int column, const QModelIndex &parent) const +{ + return createIndex(row, column, (void*)0); +} + +QModelIndex GraphElementData::parent(const QModelIndex &index) const +{ + GraphElementProperty *p = static_cast(index.internalPointer()); + if (p == root) return QModelIndex(); + else return createIndex(0,0,static_cast(root)); +} + +int GraphElementData::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) { + return 0; + } else { + return _properties.size(); + } +} + +int GraphElementData::columnCount(const QModelIndex &parent) const +{ + return 2; +} + +Qt::ItemFlags GraphElementData::flags(const QModelIndex &index) const +{ + return QAbstractItemModel::flags(index); +} + +//bool GraphElementData::setData(const QModelIndex &index, const QVariant &value, int role) +//{ + +//} + +//bool GraphElementData::insertRows(int position, int rows, const QModelIndex &parent) +//{ + +//} + +//bool GraphElementData::removeRows(int position, int rows, const QModelIndex &parent) +//{ + +//} + +QString GraphElementData::tikz() { + if (_properties.length() == 0) return ""; + QString str; + QTextStream code(&str); + code << "["; + + GraphElementProperty p; + bool first = true; + foreach(p, _properties) { + if (!first) code << ", "; + code << p.tikz(); + first = false; + } + + code << "]"; + + code.flush(); + return str; +} + +bool GraphElementData::isEmpty() +{ + return _properties.isEmpty(); +} diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h new file mode 100644 index 0000000..1139a00 --- /dev/null +++ b/src/data/graphelementdata.h @@ -0,0 +1,66 @@ +#ifndef GRAPHELEMENTDATA_H +#define GRAPHELEMENTDATA_H + +#include "graphelementproperty.h" + +#include +#include +#include +#include +#include + +class GraphElementData : public QAbstractItemModel +{ + Q_OBJECT +public: + explicit GraphElementData(QObject *parent = 0); + ~GraphElementData(); + void setProperty(QString key, QString value); + void unsetProperty(QString key); + void setAtom(QString atom); + void unsetAtom(QString atom); + QString property(QString key); + bool atom(QString atom); + + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; + + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + +// bool setData(const QModelIndex &index, const QVariant &value, +// int role = Qt::EditRole) Q_DECL_OVERRIDE; +// bool setHeaderData(int section, Qt::Orientation orientation, +// const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE; + +// bool insertColumns(int position, int columns, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; +// bool removeColumns(int position, int columns, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; +// bool insertRows(int position, int rows, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; +// bool removeRows(int position, int rows, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; + + void operator <<(GraphElementProperty p); + void add(GraphElementProperty p); + + QString tikz(); + bool isEmpty(); +signals: + +public slots: + +private: + QVector _properties; + GraphElementProperty *root; +}; + +#endif // GRAPHELEMENTDATA_H diff --git a/src/data/graphelementproperty.cpp b/src/data/graphelementproperty.cpp new file mode 100644 index 0000000..a50af58 --- /dev/null +++ b/src/data/graphelementproperty.cpp @@ -0,0 +1,59 @@ +#include "graphelementproperty.h" + +#include + +GraphElementProperty::GraphElementProperty (): + _key(""), _value(""), _atom(false), _keyMatch(false) +{} + +GraphElementProperty::GraphElementProperty(QString key, QString value, bool atom, bool keyMatch) : + _key(key), _value(value), _atom(atom), _keyMatch(keyMatch) +{} + +GraphElementProperty::GraphElementProperty(QString key, QString value) : + _key(key), _value(value), _atom(false), _keyMatch(false) +{} + +GraphElementProperty::GraphElementProperty(QString key, bool keyMatch) : + _key(key), _value(""), _atom(!keyMatch), _keyMatch(keyMatch) +{} + +QString GraphElementProperty::key() const +{ return _key; } + +QString GraphElementProperty::value() const +{ return _value; } + +void GraphElementProperty::setValue(const QString &value) +{ _value = value; } + +bool GraphElementProperty::atom() const +{ return _atom; } + +bool GraphElementProperty::keyMatch() const +{ return _keyMatch; } + +bool GraphElementProperty::matches(const GraphElementProperty &p) +{ + if (p.atom()) return _atom && _key == p.key(); + if (p.keyMatch()) return !_atom && _key == p.key(); + if (_keyMatch) return !p.atom() && _key == p.key(); + return !_atom && _key == p.key() && _value == p.value(); +} + +bool GraphElementProperty::operator==(const GraphElementProperty &p) +{ + return matches(p); +} + +QString GraphElementProperty::tikzEscape(QString str) +{ + QRegExp re("[0-9a-zA-Z<> \\-'.]*"); + if (re.exactMatch(str)) return str; + else return "{" + str + "}"; +} + +QString GraphElementProperty::tikz() { + if (_atom) return tikzEscape(_key); + return tikzEscape(_key) + "=" + tikzEscape(_value); +} diff --git a/src/data/graphelementproperty.h b/src/data/graphelementproperty.h new file mode 100644 index 0000000..01b6e5a --- /dev/null +++ b/src/data/graphelementproperty.h @@ -0,0 +1,40 @@ +#ifndef GRAPHELEMENTPROPERTY_H +#define GRAPHELEMENTPROPERTY_H + +#include + +class GraphElementProperty +{ +public: + GraphElementProperty(); + GraphElementProperty(QString key, QString value, bool atom, bool keyMatch); + + // construct a property + GraphElementProperty(QString key, QString value); + + // construct an atom or keymatch + GraphElementProperty(QString key, bool keyMatch = false); + + QString key() const; + QString value() const; + void setValue(const QString &value); + bool atom() const; + bool keyMatch() const; + + bool matches(const GraphElementProperty &p); + bool operator==(const GraphElementProperty &p); + + static QString tikzEscape(QString str); + QString tikz(); +signals: + +public slots: + +private: + QString _key; + QString _value; + bool _atom; + bool _keyMatch; +}; + +#endif // GRAPHELEMENTPROPERTY_H diff --git a/src/data/node.cpp b/src/data/node.cpp new file mode 100644 index 0000000..f94a3df --- /dev/null +++ b/src/data/node.cpp @@ -0,0 +1,79 @@ +#include "node.h" +#include "tikzit.h" + +#include + +Node::Node(QObject *parent) : QObject(parent) +{ + _data = new GraphElementData(); + _style = noneStyle; + _styleName = "none"; +} + +Node::~Node() +{ + delete _data; +} + +QPointF Node::point() const +{ + return _point; +} + +void Node::setPoint(const QPointF &point) +{ + _point = point; +} + +QString Node::name() const +{ + return _name; +} + +void Node::setName(const QString &name) +{ + _name = name; +} + +QString Node::label() const +{ + return _label; +} + +void Node::setLabel(const QString &label) +{ + _label = label; +} + +GraphElementData *Node::data() const +{ + return _data; +} + +void Node::setData(GraphElementData *data) +{ + delete _data; + _data = data; + if (_data->property("style") != 0) _styleName = _data->property("style"); +} + +QString Node::styleName() const +{ + return _styleName; +} + +void Node::setStyleName(const QString &styleName) +{ + _styleName = styleName; +} + +void Node::attachStyle() +{ + if (_styleName == "none") _style = noneStyle; + else _style = tikzit->nodeStyle(_styleName); +} + +NodeStyle *Node::style() const +{ + return _style; +} diff --git a/src/data/node.h b/src/data/node.h new file mode 100644 index 0000000..ee70835 --- /dev/null +++ b/src/data/node.h @@ -0,0 +1,49 @@ +#ifndef NODE_H +#define NODE_H + +#include "graphelementdata.h" +#include "nodestyle.h" + +#include +#include +#include + +class Node : public QObject +{ + Q_OBJECT +public: + explicit Node(QObject *parent = 0); + ~Node(); + + QPointF point() const; + void setPoint(const QPointF &point); + + QString name() const; + void setName(const QString &name); + + QString label() const; + void setLabel(const QString &label); + + GraphElementData *data() const; + void setData(GraphElementData *data); + + QString styleName() const; + void setStyleName(const QString &styleName); + + void attachStyle(); + NodeStyle *style() const; + +signals: + +public slots: + +private: + QPointF _point; + QString _name; + QString _label; + QString _styleName; + NodeStyle *_style; + GraphElementData *_data; +}; + +#endif // NODE_H diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp new file mode 100644 index 0000000..7eca791 --- /dev/null +++ b/src/data/nodestyle.cpp @@ -0,0 +1,32 @@ +#include "nodestyle.h" + +NodeStyle *noneStyle = new NodeStyle(); + +NodeStyle::NodeStyle() +{ + name = "none"; + shape = NodeShape::Circle; + fillColor = Qt::white; + strokeColor = Qt::black; + strokeThickness = 1; +} + +NodeStyle::NodeStyle(QString nm, NodeShape sh, QColor fillCol) +{ + name = nm; + shape = sh; + fillColor = fillCol; + strokeColor = Qt::black; + strokeThickness = 1; +} + +NodeStyle::NodeStyle(QString nm, NodeShape sh, QColor fillCol, QColor strokeCol, int strokeThick) +{ + name = nm; + shape = sh; + fillColor = fillCol; + strokeColor = strokeCol; + strokeThickness = strokeThick; +} + +bool NodeStyle::isNone() { return name == "none"; } diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h new file mode 100644 index 0000000..00d1b20 --- /dev/null +++ b/src/data/nodestyle.h @@ -0,0 +1,26 @@ +#ifndef NODESTYLE_H +#define NODESTYLE_H + +#include + +enum NodeShape { + Square, UpTriangle, DownTriangle, Circle +}; + +class NodeStyle +{ +public: + NodeStyle(); + NodeStyle(QString nm, NodeShape sh, QColor fillCol); + NodeStyle(QString nm, NodeShape sh, QColor fillCol, QColor strokeCol, int strokeThick); + bool isNone(); + QString name; + NodeShape shape; + QColor fillColor; + QColor strokeColor; + int strokeThickness; +}; + +extern NodeStyle *noneStyle; + +#endif // NODESTYLE_H diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp new file mode 100644 index 0000000..13d4c6e --- /dev/null +++ b/src/data/tikzdocument.cpp @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include + +#include "tikzdocument.h" +#include "tikzgraphassembler.h" + +TikzDocument::TikzDocument(QObject *parent) : QObject(parent) +{ + _graph = new Graph(this); + _parseSuccess = true; + _fileName = ""; + _shortName = ""; + _undoStack = new QUndoStack(); +} + +TikzDocument::~TikzDocument() +{ + delete _graph; + delete _undoStack; +} + +QUndoStack *TikzDocument::undoStack() const +{ + return _undoStack; +} + +Graph *TikzDocument::graph() const +{ + return _graph; +} + +QString TikzDocument::tikz() const +{ + return _tikz; +} + +void TikzDocument::open(QString fileName) +{ + _fileName = fileName; + QFile file(fileName); + QFileInfo fi(file); + _shortName = fi.fileName(); + QSettings settings("tikzit", "tikzit"); + settings.setValue("previous-file-path", fi.absolutePath()); + + if (!file.open(QIODevice::ReadOnly)) { +// QMessageBox::critical(this, tr("Error"), +// tr("Could not open file")); + _parseSuccess = false; + return; + } + + QTextStream in(&file); + _tikz = in.readAll(); + file.close(); + + Graph *newGraph = new Graph(this); + TikzGraphAssembler ass(newGraph); + if (ass.parse(_tikz)) { + delete _graph; + _graph = newGraph; + foreach (Node *n, _graph->nodes()) n->attachStyle(); + foreach (Edge *e, _graph->edges()) e->updateControls(); + _parseSuccess = true; + } else { + delete newGraph; + _parseSuccess = false; + } +} + +QString TikzDocument::shortName() const +{ + return _shortName; +} + +bool TikzDocument::parseSuccess() const +{ + return _parseSuccess; +} diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h new file mode 100644 index 0000000..f574f5c --- /dev/null +++ b/src/data/tikzdocument.h @@ -0,0 +1,43 @@ +/** + * This class contains a tikz Graph, source code, file info, and undo stack. It serves as the model + * in the MVC triple (TikzDocument, TikzView, TikzScene). + */ + +#ifndef TIKZDOCUMENT_H +#define TIKZDOCUMENT_H + +#include "graph.h" + +#include +#include + +class TikzDocument : public QObject +{ + Q_OBJECT +public: + explicit TikzDocument(QObject *parent = 0); + ~TikzDocument(); + + Graph *graph() const; + QString tikz() const; + QUndoStack *undoStack() const; + bool parseSuccess() const; + + void open(QString fileName); + + QString shortName() const; + +private: + Graph *_graph; + QString _tikz; + QString _fileName; + QString _shortName; + QUndoStack *_undoStack; + bool _parseSuccess; + +signals: + +public slots: +}; + +#endif // TIKZDOCUMENT_H diff --git a/src/data/tikzgraphassembler.cpp b/src/data/tikzgraphassembler.cpp new file mode 100644 index 0000000..c05a5c8 --- /dev/null +++ b/src/data/tikzgraphassembler.cpp @@ -0,0 +1,33 @@ +#include "tikzgraphassembler.h" + +#include "tikzparserdefs.h" +#include "tikzparser.parser.hpp" +#include "tikzlexer.h" + +int yyparse(void *scanner); + + +TikzGraphAssembler::TikzGraphAssembler(Graph *graph, QObject *parent) : + QObject(parent), _graph(graph) +{ + yylex_init(&scanner); + yyset_extra(this, scanner); +} + +void TikzGraphAssembler::addNodeToMap(Node *n) { _nodeMap.insert(n->name(), n); } +Node *TikzGraphAssembler::nodeWithName(QString name) { return _nodeMap[name]; } + +bool TikzGraphAssembler::parse(const QString &tikz) +{ + yy_scan_string(tikz.toLatin1().data(), scanner); + int result = yyparse(scanner); + + if (result == 0) return true; + else return false; +} + +Graph *TikzGraphAssembler::graph() const +{ + return _graph; +} + diff --git a/src/data/tikzgraphassembler.h b/src/data/tikzgraphassembler.h new file mode 100644 index 0000000..79b89b0 --- /dev/null +++ b/src/data/tikzgraphassembler.h @@ -0,0 +1,31 @@ +#ifndef TIKZGRAPHASSEMBLER_H +#define TIKZGRAPHASSEMBLER_H + +#include "node.h" +#include "graph.h" + +#include +#include + +class TikzGraphAssembler : public QObject +{ + Q_OBJECT +public: + explicit TikzGraphAssembler(Graph *graph, QObject *parent = 0); + void addNodeToMap(Node *n); + Node *nodeWithName(QString name); + bool parse(const QString &tikz); + + Graph *graph() const; + +signals: + +public slots: + +private: + QHash _nodeMap; + Graph *_graph; + void *scanner; +}; + +#endif // TIKZGRAPHASSEMBLER_H diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l new file mode 100644 index 0000000..8dd23c6 --- /dev/null +++ b/src/data/tikzlexer.l @@ -0,0 +1,181 @@ +%{ +/* + * Copyright 2010 Chris Heunen + * Copyright 2010-2013 Aleks Kissinger + * Copyright 2013 K. Johan Paulsson + * Copyright 2013 Alex Merry + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tikzparserdefs.h" +#include "tikzparser.parser.hpp" + +#include + + +#define YY_USER_ACTION \ + yylloc->first_line = yylloc->last_line; \ + yylloc->first_column = yylloc->last_column + 1; \ + yylloc->last_column = yylloc->first_column + yyleng - 1; + +%} + +%option reentrant bison-bridge bison-locations 8bit +%option nounput +%option yylineno +%option noyywrap +%option header-file="tikzlexer.h" +%option extra-type="TikzGraphAssembler *" + +%s props +%s xcoord +%s ycoord +%s noderef + +FLOAT \-?[0-9]*(\.[0-9]+)? + +%% + + /* whitespace is ignored, except for position counting; we don't + count formfeed and vtab as whitespace, because it's not obvious + how they should be dealt with and no-one actually uses them */ + + /* lex will take the longest-matching string */ +\r\n|\r|\n { + yylloc->first_line += 1; + yylloc->last_line = yylloc->first_line; + yylloc->first_column = yylloc->last_column = 0; +} +[\t ]+ { } + +\\begin\{tikzpicture\} { return BEGIN_TIKZPICTURE_CMD; } +\\end\{tikzpicture\} { return END_TIKZPICTURE_CMD; } +\\begin\{pgfonlayer\} { return BEGIN_PGFONLAYER_CMD; } +\\end\{pgfonlayer\} { return END_PGFONLAYER_CMD; } +\\draw { return DRAW_CMD; } +\\node { return NODE_CMD; } +\\path { return PATH_CMD; } +rectangle { return RECTANGLE; } +node { return NODE; } +at { return AT; } +to { return TO; } +; { return SEMICOLON; } + +\([ ]*{FLOAT}[ ]*,[ ]*{FLOAT}[ ]*\) { + yylloc->last_column = yylloc->first_column + 1; + yyless(1); + BEGIN(xcoord); +} +{FLOAT} { + yylval->pt = new QPointF(); + yylval->pt->setX(strtod(yytext,NULL)); + BEGIN(ycoord); +} +, { } +{FLOAT} { + yylval->pt->setY(strtod(yytext,NULL)); +} +\) { + BEGIN(INITIAL); + return COORD; +} + + /* when we see "[", change parsing mode */ +\[ /*syntaxhlfix]*/ { + BEGIN(props); + return LEFTBRACKET; +} += { return EQUALS; } +, { return COMMA; } + /* technically, it is possible to have newlines in the middle of + property names or values, but in practice this is unlikely and + screws up our line counting */ +[^=,\{\] \t\n]([^=,\{\]\n]*[^=,\{\] \t\n])? { + char *str = (char*)malloc(sizeof(char)*yyleng + 1); + strncpy(str, yytext, yyleng + 1); + yylval->str = str; + return PROPSTRING; +} +\] { + BEGIN(INITIAL); + return RIGHTBRACKET; +} + +\( { + BEGIN(noderef); + return LEFTPARENTHESIS; +} +\. { + return FULLSTOP; +} + /* we assume node names (and anchor names) never contain + newlines */ +[^\.\{\)\n]+ { + //qDebug() << "nodename: " << yytext << " size: " << strlen(yytext); + char *str = (char*)malloc(sizeof(char)*yyleng + 1); + strncpy(str, yytext, yyleng+1); + yylval->str = str; + return REFSTRING; +} +\) { + BEGIN(INITIAL); + return RIGHTPARENTHESIS; +} + +\{ { + std::stringstream buf; + unsigned int brace_depth = 1; + unsigned int escape = 0; + while (1) { + char c = yyinput(yyscanner); + // eof reached before closing brace + if (c == '\0' || c == EOF) { + return UNCLOSED_DELIM_STR; + } + + yylloc->last_column += 1; + yyleng += 1; + if (escape) { + escape = 0; + } else if (c == '\\') { + escape = 1; + } else if (c == '{') { + brace_depth++; + } else if (c == '}') { + brace_depth--; + if (brace_depth == 0) break; + } else if (c == '\n') { + yylloc->last_line += 1; + yylloc->last_column = 0; + } + buf << c; + } + + char *str = (char*)malloc(sizeof(char) * yyleng + 1); + strncpy(str, buf.str().c_str(), yyleng + 1); + //str[len] = 0; + yylval->str = str; + //qDebug() << "got delim string: " << str; + return DELIMITEDSTRING; +} + +\\begin { return UNKNOWN_BEGIN_CMD; } +\\end { return UNKNOWN_END_CMD; } +\\[a-zA-Z0-9]+ { return UNKNOWN_CMD; } +[a-zA-Z0-9]+ { return UNKNOWN_STR; } +. { return UNKNOWN_STR; } + + /* vi:ft=lex:noet:ts=4:sts=4:sw=4: + */ diff --git a/src/data/tikzlexer.lexer.cpp b/src/data/tikzlexer.lexer.cpp new file mode 100644 index 0000000..7ff1d18 --- /dev/null +++ b/src/data/tikzlexer.lexer.cpp @@ -0,0 +1,2535 @@ +#line 2 "../tikzit/src/data/tikzlexer.lexer.cpp" + +#line 4 "../tikzit/src/data/tikzlexer.lexer.cpp" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart(yyin ,yyscanner ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE yylex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-yylineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + yy_size_t yyl;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart (FILE *input_file ,yyscan_t yyscanner ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void yypop_buffer_state (yyscan_t yyscanner ); + +static void yyensure_buffer_stack (yyscan_t yyscanner ); +static void yy_load_buffer_state (yyscan_t yyscanner ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); + +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); + +void *yyalloc (yy_size_t ,yyscan_t yyscanner ); +void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); +void yyfree (void * ,yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +#define yywrap(n) 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); +static int yy_get_next_buffer (yyscan_t yyscanner ); +static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (yy_size_t) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 35 +#define YY_END_OF_BUFFER 36 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[259] = + { 0, + 0, 0, 0, 0, 16, 16, 18, 18, 0, 0, + 36, 34, 2, 1, 1, 25, 33, 14, 20, 34, + 33, 33, 33, 33, 29, 23, 1, 23, 22, 23, + 14, 21, 20, 23, 24, 23, 23, 23, 23, 16, + 34, 16, 19, 17, 18, 34, 18, 27, 2, 1, + 25, 28, 26, 27, 14, 20, 27, 27, 27, 27, + 27, 2, 1, 0, 0, 0, 0, 0, 33, 32, + 32, 32, 32, 32, 32, 12, 33, 33, 13, 23, + 0, 0, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 12, 23, 23, 13, 0, 16, 16, 16, + + 0, 18, 18, 18, 27, 2, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 12, 27, 27, + 13, 0, 15, 0, 0, 0, 0, 0, 32, 32, + 32, 32, 32, 33, 33, 0, 23, 23, 23, 23, + 23, 23, 23, 23, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 0, 0, 32, 32, 31, + 32, 32, 11, 33, 23, 23, 23, 23, 23, 11, + 23, 27, 27, 27, 27, 27, 27, 11, 27, 32, + 7, 0, 8, 9, 33, 23, 7, 8, 9, 23, + 27, 7, 8, 9, 27, 30, 0, 0, 33, 23, + + 23, 27, 27, 0, 0, 0, 33, 23, 27, 0, + 0, 0, 0, 33, 23, 27, 0, 0, 0, 0, + 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, + 0, 0, 0, 4, 5, 0, 3, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 5, 1, 1, 1, 1, 1, 1, 1, 6, + 7, 1, 1, 8, 9, 10, 1, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 1, 12, 1, + 13, 1, 1, 1, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 16, 17, 1, 1, 1, 18, 19, 20, 21, + + 22, 23, 24, 25, 26, 14, 27, 28, 14, 29, + 30, 31, 14, 32, 14, 33, 34, 14, 35, 14, + 36, 37, 38, 1, 39, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[40] = + { 0, + 1, 1, 2, 1, 1, 1, 3, 4, 1, 3, + 5, 1, 4, 5, 1, 1, 4, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 2, 1 + } ; + +static yyconst flex_int16_t yy_base[265] = + { 0, + 0, 0, 39, 0, 70, 73, 105, 137, 175, 0, + 694, 896, 83, 896, 688, 81, 0, 896, 896, 74, + 655, 656, 663, 653, 896, 92, 96, 213, 896, 224, + 102, 896, 104, 263, 896, 302, 87, 88, 89, 113, + 671, 115, 896, 896, 117, 670, 119, 0, 129, 675, + 127, 896, 896, 341, 0, 0, 380, 419, 109, 118, + 119, 148, 896, 149, 156, 163, 664, 227, 0, 0, + 651, 639, 641, 639, 650, 0, 646, 646, 0, 167, + 214, 457, 239, 240, 250, 630, 294, 300, 450, 305, + 464, 478, 627, 233, 67, 625, 645, 145, 643, 246, + + 642, 322, 639, 327, 0, 215, 354, 361, 368, 432, + 613, 425, 482, 495, 499, 512, 526, 609, 238, 319, + 607, 549, 896, 450, 628, 556, 238, 440, 614, 614, + 600, 599, 585, 586, 574, 468, 527, 549, 563, 543, + 567, 580, 318, 573, 605, 612, 619, 369, 612, 626, + 606, 630, 643, 322, 572, 157, 473, 578, 568, 562, + 575, 570, 0, 575, 658, 671, 688, 682, 708, 558, + 100, 323, 721, 734, 751, 693, 771, 557, 287, 558, + 0, 336, 0, 0, 554, 745, 756, 776, 782, 247, + 787, 793, 798, 804, 354, 541, 553, 550, 551, 817, + + 229, 837, 277, 408, 546, 526, 524, 405, 459, 527, + 524, 519, 509, 518, 396, 431, 516, 510, 507, 494, + 0, 490, 489, 489, 478, 484, 484, 479, 475, 487, + 482, 470, 465, 454, 456, 470, 457, 453, 440, 427, + 417, 417, 398, 404, 388, 351, 353, 329, 328, 896, + 309, 209, 205, 896, 896, 131, 896, 896, 136, 97, + 875, 880, 885, 890 + } ; + +static yyconst flex_int16_t yy_def[265] = + { 0, + 258, 1, 258, 3, 1, 1, 1, 1, 258, 9, + 258, 258, 258, 258, 258, 258, 259, 258, 258, 260, + 259, 259, 259, 259, 258, 261, 261, 261, 258, 262, + 261, 258, 261, 258, 258, 262, 36, 36, 36, 258, + 258, 259, 258, 258, 258, 258, 259, 263, 263, 263, + 263, 258, 258, 264, 263, 263, 258, 264, 58, 58, + 58, 258, 258, 258, 258, 258, 258, 258, 259, 260, + 260, 260, 260, 260, 260, 259, 259, 259, 259, 261, + 261, 261, 261, 261, 261, 36, 34, 34, 34, 34, + 34, 34, 36, 36, 36, 36, 258, 258, 258, 259, + + 258, 258, 258, 259, 263, 263, 263, 263, 263, 263, + 58, 57, 57, 57, 57, 57, 57, 58, 58, 58, + 58, 258, 258, 258, 258, 258, 258, 258, 260, 260, + 260, 260, 260, 259, 259, 261, 261, 34, 34, 34, + 34, 34, 36, 36, 263, 263, 263, 263, 57, 57, + 57, 57, 57, 58, 58, 258, 258, 260, 260, 260, + 260, 260, 259, 259, 34, 34, 34, 34, 34, 36, + 36, 263, 57, 57, 57, 57, 57, 58, 58, 260, + 260, 258, 260, 260, 259, 34, 34, 34, 34, 36, + 57, 57, 57, 57, 58, 260, 258, 258, 259, 34, + + 36, 57, 58, 258, 258, 258, 259, 36, 58, 258, + 258, 258, 258, 259, 36, 58, 258, 258, 258, 258, + 259, 36, 58, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 0, 258, 258, + 258, 258, 258, 258 + } ; + +static yyconst flex_int16_t yy_nxt[936] = + { 0, + 12, 13, 14, 15, 13, 16, 12, 12, 12, 12, + 17, 18, 12, 17, 19, 20, 12, 21, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 22, 17, + 17, 23, 24, 17, 17, 17, 17, 25, 12, 26, + 13, 14, 27, 13, 28, 26, 29, 26, 26, 30, + 31, 32, 30, 33, 34, 35, 36, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 37, 30, 30, + 38, 39, 30, 30, 30, 30, 25, 26, 40, 41, + 42, 40, 41, 42, 62, 64, 144, 62, 65, 66, + 67, 68, 71, 81, 72, 73, 81, 81, 63, 86, + + 81, 70, 74, 81, 75, 81, 81, 12, 81, 95, + 12, 43, 44, 45, 46, 47, 94, 190, 96, 86, + 86, 86, 97, 98, 97, 100, 101, 102, 101, 104, + 106, 107, 86, 106, 108, 109, 67, 110, 119, 120, + 69, 111, 12, 43, 44, 45, 46, 47, 121, 62, + 111, 111, 62, 64, 97, 98, 65, 66, 67, 68, + 122, 156, 123, 123, 124, 125, 126, 127, 81, 257, + 65, 81, 67, 68, 12, 48, 49, 14, 50, 49, + 51, 52, 48, 48, 53, 54, 55, 48, 54, 56, + 57, 48, 58, 54, 54, 54, 54, 54, 54, 54, + + 54, 54, 54, 59, 54, 54, 60, 61, 54, 54, + 54, 54, 12, 48, 81, 81, 106, 82, 81, 106, + 65, 83, 84, 85, 80, 81, 256, 80, 81, 80, + 80, 127, 80, 80, 65, 80, 67, 68, 80, 80, + 81, 81, 127, 136, 81, 65, 65, 255, 84, 85, + 137, 81, 208, 143, 136, 97, 100, 65, 154, 84, + 85, 86, 80, 80, 81, 86, 80, 81, 80, 80, + 111, 80, 80, 87, 80, 201, 87, 80, 80, 86, + 87, 88, 87, 89, 90, 87, 87, 87, 87, 87, + 87, 91, 87, 92, 87, 87, 87, 87, 87, 87, + + 209, 80, 80, 81, 195, 80, 81, 80, 80, 111, + 80, 80, 87, 80, 87, 87, 80, 80, 87, 111, + 87, 138, 87, 87, 87, 87, 87, 172, 87, 123, + 87, 101, 102, 140, 93, 87, 101, 104, 155, 170, + 80, 105, 105, 178, 105, 105, 105, 254, 105, 105, + 86, 111, 105, 105, 111, 105, 105, 105, 107, 253, + 252, 108, 109, 67, 110, 145, 197, 123, 198, 146, + 125, 147, 148, 148, 251, 108, 108, 67, 110, 105, + 105, 105, 203, 105, 105, 105, 111, 105, 105, 250, + 112, 105, 105, 112, 105, 105, 105, 112, 113, 112, + + 114, 115, 112, 112, 112, 112, 112, 112, 116, 112, + 117, 112, 112, 112, 112, 112, 112, 222, 105, 105, + 105, 249, 105, 105, 105, 248, 105, 105, 86, 247, + 105, 105, 215, 105, 105, 105, 148, 86, 210, 108, + 211, 67, 110, 112, 127, 112, 112, 65, 246, 245, + 128, 118, 223, 112, 156, 112, 123, 105, 81, 125, + 126, 82, 244, 111, 65, 83, 84, 85, 87, 81, + 87, 87, 136, 243, 242, 65, 241, 156, 87, 123, + 87, 139, 87, 157, 87, 87, 216, 240, 239, 238, + 237, 111, 87, 141, 87, 142, 87, 236, 87, 87, + + 112, 235, 112, 149, 234, 233, 87, 232, 87, 231, + 112, 230, 112, 112, 229, 112, 112, 112, 228, 112, + 112, 111, 86, 112, 227, 112, 150, 151, 81, 112, + 112, 136, 112, 112, 65, 226, 225, 137, 224, 221, + 112, 152, 112, 153, 112, 220, 112, 112, 219, 218, + 217, 214, 213, 122, 112, 123, 112, 124, 125, 126, + 156, 87, 123, 167, 87, 125, 126, 87, 212, 87, + 87, 87, 165, 87, 207, 206, 205, 87, 204, 87, + 166, 87, 199, 87, 87, 87, 196, 168, 87, 111, + 86, 87, 185, 87, 184, 87, 183, 87, 87, 182, + + 87, 87, 181, 180, 179, 171, 164, 163, 87, 145, + 87, 123, 169, 146, 125, 147, 172, 162, 123, 161, + 160, 125, 147, 172, 112, 123, 175, 112, 125, 147, + 112, 159, 112, 112, 112, 173, 112, 158, 157, 111, + 112, 111, 112, 174, 112, 111, 112, 112, 112, 103, + 176, 112, 103, 99, 112, 99, 112, 86, 112, 86, + 112, 112, 86, 112, 112, 135, 134, 133, 132, 131, + 130, 112, 129, 112, 128, 177, 87, 63, 87, 87, + 103, 99, 79, 186, 78, 77, 87, 76, 87, 87, + 63, 87, 87, 258, 258, 258, 258, 258, 258, 87, + + 87, 87, 87, 188, 258, 187, 87, 258, 87, 87, + 87, 112, 87, 112, 193, 258, 87, 258, 87, 258, + 258, 112, 258, 112, 258, 182, 87, 258, 87, 87, + 258, 258, 189, 258, 258, 258, 87, 258, 87, 112, + 258, 112, 112, 258, 258, 258, 191, 258, 258, 112, + 258, 112, 112, 258, 112, 112, 258, 258, 258, 258, + 258, 258, 112, 87, 112, 87, 87, 258, 192, 112, + 258, 112, 112, 200, 87, 87, 87, 87, 258, 112, + 258, 112, 258, 258, 87, 258, 87, 258, 182, 112, + 258, 112, 112, 258, 87, 194, 87, 87, 258, 112, + + 87, 112, 87, 87, 87, 112, 87, 112, 112, 258, + 87, 112, 87, 112, 112, 202, 112, 112, 112, 112, + 258, 112, 112, 112, 112, 112, 112, 258, 112, 258, + 258, 258, 112, 258, 112, 87, 258, 87, 87, 258, + 258, 258, 258, 258, 258, 87, 258, 87, 258, 258, + 258, 258, 258, 258, 204, 112, 258, 112, 112, 258, + 258, 258, 258, 258, 258, 112, 258, 112, 258, 258, + 258, 258, 258, 258, 204, 80, 258, 80, 258, 80, + 86, 258, 86, 258, 86, 105, 258, 258, 105, 105, + 111, 258, 258, 111, 111, 11, 258, 258, 258, 258, + + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258 + } ; + +static yyconst flex_int16_t yy_chk[936] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, + 5, 6, 6, 6, 13, 16, 95, 13, 16, 16, + 16, 16, 20, 26, 20, 20, 26, 27, 27, 95, + + 27, 260, 20, 31, 20, 33, 31, 5, 33, 38, + 6, 7, 7, 7, 7, 7, 37, 171, 39, 37, + 38, 39, 40, 40, 42, 42, 45, 45, 47, 47, + 49, 51, 171, 49, 51, 51, 51, 51, 59, 60, + 259, 59, 7, 8, 8, 8, 8, 8, 61, 62, + 60, 61, 62, 64, 98, 98, 64, 64, 64, 64, + 65, 156, 65, 156, 65, 65, 65, 66, 80, 256, + 66, 80, 66, 66, 8, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 28, 81, 106, 28, 81, 106, + 28, 28, 28, 28, 30, 30, 253, 30, 30, 30, + 30, 68, 30, 30, 68, 30, 68, 68, 30, 30, + 83, 84, 127, 83, 84, 127, 83, 252, 83, 83, + 84, 85, 201, 94, 85, 100, 100, 85, 119, 85, + 85, 201, 30, 34, 34, 94, 34, 34, 34, 34, + 119, 34, 34, 34, 34, 190, 34, 34, 34, 190, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + + 203, 34, 36, 36, 179, 36, 36, 36, 36, 203, + 36, 36, 87, 36, 87, 87, 36, 36, 88, 179, + 88, 88, 87, 90, 87, 90, 90, 172, 88, 172, + 88, 102, 102, 90, 36, 90, 104, 104, 120, 143, + 36, 54, 54, 154, 54, 54, 54, 251, 54, 54, + 143, 120, 54, 54, 154, 54, 54, 54, 107, 249, + 248, 107, 107, 107, 107, 108, 182, 108, 182, 108, + 108, 108, 109, 148, 247, 109, 148, 109, 109, 54, + 57, 57, 195, 57, 57, 57, 195, 57, 57, 246, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 215, 57, 58, + 58, 245, 58, 58, 58, 244, 58, 58, 215, 243, + 58, 58, 208, 58, 58, 58, 110, 208, 204, 110, + 204, 110, 110, 112, 128, 112, 112, 128, 242, 241, + 128, 58, 216, 112, 124, 112, 124, 58, 82, 124, + 124, 82, 240, 216, 82, 82, 82, 82, 89, 136, + 89, 89, 136, 239, 238, 136, 237, 157, 89, 157, + 89, 89, 91, 157, 91, 91, 209, 236, 235, 234, + 233, 209, 91, 91, 91, 92, 92, 232, 92, 92, + + 113, 231, 113, 113, 230, 229, 92, 228, 92, 227, + 113, 226, 113, 114, 225, 114, 114, 115, 224, 115, + 115, 223, 222, 114, 220, 114, 114, 115, 137, 115, + 116, 137, 116, 116, 137, 219, 218, 137, 217, 214, + 116, 116, 116, 117, 117, 213, 117, 117, 212, 211, + 210, 207, 206, 122, 117, 122, 117, 122, 122, 122, + 126, 140, 126, 140, 140, 126, 126, 138, 205, 138, + 138, 140, 138, 140, 199, 198, 197, 138, 196, 138, + 139, 139, 185, 139, 139, 141, 180, 141, 141, 178, + 170, 139, 164, 139, 162, 141, 161, 141, 142, 160, + + 142, 142, 159, 158, 155, 144, 135, 134, 142, 145, + 142, 145, 142, 145, 145, 145, 146, 133, 146, 132, + 131, 146, 146, 147, 151, 147, 151, 151, 147, 147, + 149, 130, 149, 149, 151, 149, 151, 129, 125, 121, + 149, 118, 149, 150, 150, 111, 150, 150, 152, 103, + 152, 152, 101, 99, 150, 97, 150, 96, 152, 93, + 152, 153, 86, 153, 153, 78, 77, 75, 74, 73, + 72, 153, 71, 153, 67, 153, 165, 50, 165, 165, + 46, 41, 24, 165, 23, 22, 165, 21, 165, 166, + 15, 166, 166, 11, 0, 0, 0, 0, 0, 166, + + 168, 166, 168, 168, 0, 166, 167, 0, 167, 167, + 168, 176, 168, 176, 176, 0, 167, 0, 167, 0, + 0, 176, 0, 176, 0, 167, 169, 0, 169, 169, + 0, 0, 169, 0, 0, 0, 169, 0, 169, 173, + 0, 173, 173, 0, 0, 0, 173, 0, 0, 173, + 0, 173, 174, 0, 174, 174, 0, 0, 0, 0, + 0, 0, 174, 186, 174, 186, 186, 0, 174, 175, + 0, 175, 175, 186, 187, 186, 187, 187, 0, 175, + 0, 175, 0, 0, 187, 0, 187, 0, 175, 177, + 0, 177, 177, 0, 188, 177, 188, 188, 0, 177, + + 189, 177, 189, 189, 188, 191, 188, 191, 191, 0, + 189, 192, 189, 192, 192, 191, 193, 191, 193, 193, + 0, 192, 194, 192, 194, 194, 193, 0, 193, 0, + 0, 0, 194, 0, 194, 200, 0, 200, 200, 0, + 0, 0, 0, 0, 0, 200, 0, 200, 0, 0, + 0, 0, 0, 0, 200, 202, 0, 202, 202, 0, + 0, 0, 0, 0, 0, 202, 0, 202, 0, 0, + 0, 0, 0, 0, 202, 261, 0, 261, 0, 261, + 262, 0, 262, 0, 262, 263, 0, 0, 263, 263, + 264, 0, 0, 264, 264, 258, 258, 258, 258, 258, + + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, + 258, 258, 258, 258, 258 + } ; + +/* Table of booleans, true if rule could match eol. */ +static yyconst flex_int32_t yy_rule_can_match_eol[36] = + { 0, +1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "../tikzit/src/data/tikzlexer.l" +#line 2 "../tikzit/src/data/tikzlexer.l" +/* + * Copyright 2010 Chris Heunen + * Copyright 2010-2013 Aleks Kissinger + * Copyright 2013 K. Johan Paulsson + * Copyright 2013 Alex Merry + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tikzparserdefs.h" +#include "tikzparser.parser.hpp" + +#include + + +#define YY_USER_ACTION \ + yylloc->first_line = yylloc->last_line; \ + yylloc->first_column = yylloc->last_column + 1; \ + yylloc->last_column = yylloc->first_column + yyleng - 1; + + + + + +#line 776 "../tikzit/src/data/tikzlexer.lexer.cpp" + +#define INITIAL 0 +#define props 1 +#define xcoord 2 +#define ycoord 3 +#define noderef 4 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#define YY_EXTRA_TYPE TikzGraphAssembler * + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + yy_size_t yy_n_chars; + yy_size_t yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + YYSTYPE * yylval_r; + + YYLTYPE * yylloc_r; + + }; /* end struct yyguts_t */ + +static int yy_init_globals (yyscan_t yyscanner ); + + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (yyscan_t yyscanner ); + +int yyget_debug (yyscan_t yyscanner ); + +void yyset_debug (int debug_flag ,yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + +FILE *yyget_in (yyscan_t yyscanner ); + +void yyset_in (FILE * in_str ,yyscan_t yyscanner ); + +FILE *yyget_out (yyscan_t yyscanner ); + +void yyset_out (FILE * out_str ,yyscan_t yyscanner ); + +yy_size_t yyget_leng (yyscan_t yyscanner ); + +char *yyget_text (yyscan_t yyscanner ); + +int yyget_lineno (yyscan_t yyscanner ); + +void yyset_lineno (int line_number ,yyscan_t yyscanner ); + +YYSTYPE * yyget_lval (yyscan_t yyscanner ); + +void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + + YYLTYPE *yyget_lloc (yyscan_t yyscanner ); + + void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap (yyscan_t yyscanner ); +#else +extern int yywrap (yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (yyscan_t yyscanner ); +#else +static int input (yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + yy_size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex \ + (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); + +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + +#line 49 "../tikzit/src/data/tikzlexer.l" + + + /* whitespace is ignored, except for position counting; we don't + count formfeed and vtab as whitespace, because it's not obvious + how they should be dealt with and no-one actually uses them */ + + /* lex will take the longest-matching string */ +#line 1025 "../tikzit/src/data/tikzlexer.lexer.cpp" + + yylval = yylval_param; + + yylloc = yylloc_param; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + yy_load_buffer_state(yyscanner ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 259 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 896 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + yy_size_t yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + do{ yylineno++; + yycolumn=0; + }while(0) +; + } + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP +#line 56 "../tikzit/src/data/tikzlexer.l" +{ + yylloc->first_line += 1; + yylloc->last_line = yylloc->first_line; + yylloc->first_column = yylloc->last_column = 0; +} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 61 "../tikzit/src/data/tikzlexer.l" +{ } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 63 "../tikzit/src/data/tikzlexer.l" +{ return BEGIN_TIKZPICTURE_CMD; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 64 "../tikzit/src/data/tikzlexer.l" +{ return END_TIKZPICTURE_CMD; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 65 "../tikzit/src/data/tikzlexer.l" +{ return BEGIN_PGFONLAYER_CMD; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 66 "../tikzit/src/data/tikzlexer.l" +{ return END_PGFONLAYER_CMD; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 67 "../tikzit/src/data/tikzlexer.l" +{ return DRAW_CMD; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 68 "../tikzit/src/data/tikzlexer.l" +{ return NODE_CMD; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 69 "../tikzit/src/data/tikzlexer.l" +{ return PATH_CMD; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 70 "../tikzit/src/data/tikzlexer.l" +{ return RECTANGLE; } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 71 "../tikzit/src/data/tikzlexer.l" +{ return NODE; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 72 "../tikzit/src/data/tikzlexer.l" +{ return AT; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 73 "../tikzit/src/data/tikzlexer.l" +{ return TO; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 74 "../tikzit/src/data/tikzlexer.l" +{ return SEMICOLON; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 76 "../tikzit/src/data/tikzlexer.l" +{ + yylloc->last_column = yylloc->first_column + 1; + yyless(1); + BEGIN(xcoord); +} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 81 "../tikzit/src/data/tikzlexer.l" +{ + yylval->pt = new QPointF(); + yylval->pt->setX(strtod(yytext,NULL)); + BEGIN(ycoord); +} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 86 "../tikzit/src/data/tikzlexer.l" +{ } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 87 "../tikzit/src/data/tikzlexer.l" +{ + yylval->pt->setY(strtod(yytext,NULL)); +} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 90 "../tikzit/src/data/tikzlexer.l" +{ + BEGIN(INITIAL); + return COORD; +} + YY_BREAK +/* when we see "[", change parsing mode */ +case 20: +YY_RULE_SETUP +#line 96 "../tikzit/src/data/tikzlexer.l" +/*syntaxhlfix]*/ { + BEGIN(props); + return LEFTBRACKET; +} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 100 "../tikzit/src/data/tikzlexer.l" +{ return EQUALS; } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 101 "../tikzit/src/data/tikzlexer.l" +{ return COMMA; } + YY_BREAK +/* technically, it is possible to have newlines in the middle of + property names or values, but in practice this is unlikely and + screws up our line counting */ +case 23: +YY_RULE_SETUP +#line 105 "../tikzit/src/data/tikzlexer.l" +{ + char *str = (char*)malloc(sizeof(char)*yyleng + 1); + strncpy(str, yytext, yyleng + 1); + yylval->str = str; + return PROPSTRING; +} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 111 "../tikzit/src/data/tikzlexer.l" +{ + BEGIN(INITIAL); + return RIGHTBRACKET; +} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 116 "../tikzit/src/data/tikzlexer.l" +{ + BEGIN(noderef); + return LEFTPARENTHESIS; +} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 120 "../tikzit/src/data/tikzlexer.l" +{ + return FULLSTOP; +} + YY_BREAK +/* we assume node names (and anchor names) never contain + newlines */ +case 27: +YY_RULE_SETUP +#line 125 "../tikzit/src/data/tikzlexer.l" +{ + //qDebug() << "nodename: " << yytext << " size: " << strlen(yytext); + char *str = (char*)malloc(sizeof(char)*yyleng + 1); + strncpy(str, yytext, yyleng+1); + yylval->str = str; + return REFSTRING; +} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 132 "../tikzit/src/data/tikzlexer.l" +{ + BEGIN(INITIAL); + return RIGHTPARENTHESIS; +} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 137 "../tikzit/src/data/tikzlexer.l" +{ + std::stringstream buf; + unsigned int brace_depth = 1; + unsigned int escape = 0; + while (1) { + char c = yyinput(yyscanner); + // eof reached before closing brace + if (c == '\0' || c == EOF) { + return UNCLOSED_DELIM_STR; + } + + yylloc->last_column += 1; + yyleng += 1; + if (escape) { + escape = 0; + } else if (c == '\\') { + escape = 1; + } else if (c == '{') { + brace_depth++; + } else if (c == '}') { + brace_depth--; + if (brace_depth == 0) break; + } else if (c == '\n') { + yylloc->last_line += 1; + yylloc->last_column = 0; + } + buf << c; + } + + char *str = (char*)malloc(sizeof(char) * yyleng + 1); + strncpy(str, buf.str().c_str(), yyleng + 1); + //str[len] = 0; + yylval->str = str; + //qDebug() << "got delim string: " << str; + return DELIMITEDSTRING; +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 174 "../tikzit/src/data/tikzlexer.l" +{ return UNKNOWN_BEGIN_CMD; } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 175 "../tikzit/src/data/tikzlexer.l" +{ return UNKNOWN_END_CMD; } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 176 "../tikzit/src/data/tikzlexer.l" +{ return UNKNOWN_CMD; } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 177 "../tikzit/src/data/tikzlexer.l" +{ return UNKNOWN_STR; } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 178 "../tikzit/src/data/tikzlexer.l" +{ return UNKNOWN_STR; } + YY_BREAK +/* vi:ft=lex:noet:ts=4:sts=4:sw=4: + */ +case 35: +YY_RULE_SETUP +#line 182 "../tikzit/src/data/tikzlexer.l" +ECHO; + YY_BREAK +#line 1385 "../tikzit/src/data/tikzlexer.lexer.cpp" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(props): +case YY_STATE_EOF(xcoord): +case YY_STATE_EOF(ycoord): +case YY_STATE_EOF(noderef): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap(yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = yyg->yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ,yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 259 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + register int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + register char *yy_cp = yyg->yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 259 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 258); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ,yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap(yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + if ( c == '\n' ) + + do{ yylineno++; + yycolumn=0; + }while(0) +; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); + yy_load_buffer_state(yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state(yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer(b,file ,yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ,yyscanner ); + + yyfree((void *) b ,yyscanner ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer(b ,yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state(yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ,yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n, i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ,yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ,yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +yy_size_t yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param line_number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); + + yylineno = line_number; +} + +/** Set the current column. + * @param line_number + * @param yyscanner The scanner object. + */ +void yyset_column (int column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "yyset_column called with no buffer" , yyscanner); + + yycolumn = column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = in_str ; +} + +void yyset_out (FILE * out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +YYSTYPE * yyget_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; +} + +void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; +} + +YYLTYPE *yyget_lloc (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylloc; +} + +void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylloc = yylloc_param; +} + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ + +int yylex_init(yyscan_t* ptr_yy_globals) + +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ + +int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) + +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = (char *) 0; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack ,yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree(yyg->yy_start_stack ,yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + return (void *) malloc( size ); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void yyfree (void * ptr , yyscan_t yyscanner) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 182 "../tikzit/src/data/tikzlexer.l" diff --git a/src/data/tikzparser.parser.cpp b/src/data/tikzparser.parser.cpp new file mode 100644 index 0000000..7d77d0c --- /dev/null +++ b/src/data/tikzparser.parser.cpp @@ -0,0 +1,1938 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Using locations. */ +#define YYLSP_NEEDED 1 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + BEGIN_TIKZPICTURE_CMD = 258, + END_TIKZPICTURE_CMD = 259, + BEGIN_PGFONLAYER_CMD = 260, + END_PGFONLAYER_CMD = 261, + DRAW_CMD = 262, + NODE_CMD = 263, + PATH_CMD = 264, + RECTANGLE = 265, + NODE = 266, + AT = 267, + TO = 268, + SEMICOLON = 269, + COMMA = 270, + LEFTPARENTHESIS = 271, + RIGHTPARENTHESIS = 272, + LEFTBRACKET = 273, + RIGHTBRACKET = 274, + FULLSTOP = 275, + EQUALS = 276, + COORD = 277, + PROPSTRING = 278, + REFSTRING = 279, + DELIMITEDSTRING = 280, + UNKNOWN_BEGIN_CMD = 281, + UNKNOWN_END_CMD = 282, + UNKNOWN_CMD = 283, + UNKNOWN_STR = 284, + UNCLOSED_DELIM_STR = 285 + }; +#endif +/* Tokens. */ +#define BEGIN_TIKZPICTURE_CMD 258 +#define END_TIKZPICTURE_CMD 259 +#define BEGIN_PGFONLAYER_CMD 260 +#define END_PGFONLAYER_CMD 261 +#define DRAW_CMD 262 +#define NODE_CMD 263 +#define PATH_CMD 264 +#define RECTANGLE 265 +#define NODE 266 +#define AT 267 +#define TO 268 +#define SEMICOLON 269 +#define COMMA 270 +#define LEFTPARENTHESIS 271 +#define RIGHTPARENTHESIS 272 +#define LEFTBRACKET 273 +#define RIGHTBRACKET 274 +#define FULLSTOP 275 +#define EQUALS 276 +#define COORD 277 +#define PROPSTRING 278 +#define REFSTRING 279 +#define DELIMITEDSTRING 280 +#define UNKNOWN_BEGIN_CMD 281 +#define UNKNOWN_END_CMD 282 +#define UNKNOWN_CMD 283 +#define UNKNOWN_STR 284 +#define UNCLOSED_DELIM_STR 285 + + + + +/* Copy the first part of user declarations. */ +#line 1 "../tikzit/src/data/tikzparser.y" + +/* + * Copyright 2010 Chris Heunen + * Copyright 2010-2013 Aleks Kissinger + * Copyright 2013 K. Johan Paulsson + * Copyright 2013 Alex Merry + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tikzparserdefs.h" + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 1 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 43 "../tikzit/src/data/tikzparser.y" +{ + char *str; + GraphElementProperty *prop; + GraphElementData *data; + Node *node; + QPointF *pt; + struct noderef noderef; +} +/* Line 193 of yacc.c. */ +#line 189 "../tikzit/src/data/tikzparser.parser.cpp" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +} YYLTYPE; +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + +/* Copy the second part of user declarations. */ +#line 52 "../tikzit/src/data/tikzparser.y" + +#include "node.h" +#include "edge.h" +#include "graphelementdata.h" +#include "graphelementproperty.h" + +#include "tikzlexer.h" +#import "tikzgraphassembler.h" +/* the assembler (used by this parser) is stored in the lexer + state as "extra" data */ +#define assembler yyget_extra(scanner) + +/* pass errors off to the assembler */ +void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { + // TODO: implement reportError() + //assembler->reportError(str, yylloc); + qDebug() << "parse error: " << str; +} + + +/* Line 216 of yacc.c. */ +#line 233 "../tikzit/src/data/tikzparser.parser.cpp" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + YYLTYPE yyls; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 5 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 52 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 31 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 21 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 36 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 70 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 285 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint8 yyprhs[] = +{ + 0, 0, 3, 8, 11, 12, 14, 16, 18, 20, + 23, 25, 28, 32, 33, 36, 40, 41, 45, 47, + 49, 51, 55, 63, 64, 67, 72, 74, 77, 78, + 82, 90, 92, 96, 99, 100, 104 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 32, 0, -1, 3, 36, 33, 4, -1, 33, 34, + -1, -1, 42, -1, 47, -1, 51, -1, 35, -1, + 5, 25, -1, 6, -1, 18, 19, -1, 18, 37, + 19, -1, -1, 38, 39, -1, 38, 39, 15, -1, + -1, 40, 21, 40, -1, 40, -1, 23, -1, 25, + -1, 16, 24, 17, -1, 8, 36, 41, 12, 22, + 25, 14, -1, -1, 20, 24, -1, 16, 24, 43, + 17, -1, 44, -1, 16, 17, -1, -1, 11, 36, + 25, -1, 7, 36, 44, 13, 46, 45, 14, -1, + 40, -1, 40, 21, 40, -1, 48, 49, -1, -1, + 18, 49, 19, -1, 9, 50, 22, 10, 22, 14, + -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint8 yyrline[] = +{ + 0, 124, 124, 130, 130, 131, 131, 131, 131, 133, + 133, 136, 138, 140, 141, 148, 154, 156, 163, 169, + 169, 171, 172, 192, 192, 193, 200, 201, 203, 204, + 212, 250, 250, 251, 251, 252, 254 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "\"\\\\begin{tikzpicture}\"", + "\"\\\\end{tikzpicture}\"", "\"\\\\begin{pgfonlayer}\"", + "\"\\\\end{pgfonlayer}\"", "\"\\\\draw\"", "\"\\\\node\"", + "\"\\\\path\"", "\"rectangle\"", "\"node\"", "\"at\"", "\"to\"", "\";\"", + "\",\"", "\"(\"", "\")\"", "\"[\"", "\"]\"", "\".\"", "\"=\"", + "\"co-ordinate\"", "\"key/value string\"", "\"string\"", + "\"{-delimited string\"", "\"unknown \\\\begin command\"", + "\"unknown \\\\end command\"", "\"unknown latex command\"", + "\"unknown string\"", "\"unclosed {-delimited string\"", "$accept", + "tikzpicture", "tikzcmds", "tikzcmd", "ignore", "optproperties", + "properties", "extraproperties", "property", "val", "nodename", "node", + "optanchor", "noderef", "optnoderef", "optedgenode", "edge", + "ignoreprop", "ignoreprops", "optignoreprops", "boundingbox", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 31, 32, 33, 33, 34, 34, 34, 34, 35, + 35, 36, 36, 36, 37, 38, 38, 39, 39, 40, + 40, 41, 42, 43, 43, 44, 45, 45, 46, 46, + 47, 48, 48, 49, 49, 50, 51 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 4, 2, 0, 1, 1, 1, 1, 2, + 1, 2, 3, 0, 2, 3, 0, 3, 1, 1, + 1, 3, 7, 0, 2, 4, 1, 2, 0, 3, + 7, 1, 3, 2, 0, 3, 6 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 13, 0, 16, 4, 1, 11, 0, 0, 0, + 12, 19, 20, 14, 18, 2, 0, 10, 13, 13, + 0, 3, 8, 5, 6, 7, 15, 0, 9, 0, + 0, 34, 0, 17, 0, 0, 0, 0, 31, 34, + 0, 0, 23, 28, 0, 0, 0, 33, 35, 0, + 0, 0, 13, 0, 21, 0, 32, 0, 24, 25, + 0, 0, 26, 0, 0, 36, 29, 27, 30, 22 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 2, 9, 21, 22, 4, 7, 8, 13, 38, + 37, 23, 51, 35, 63, 53, 24, 39, 40, 32, + 25 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -20 +static const yytype_int8 yypact[] = +{ + 9, -4, 15, -3, -20, -20, -20, -2, -12, 0, + -20, -20, -20, 3, -1, -20, 1, -20, -4, -4, + 4, -20, -20, -20, -20, -20, -20, -12, -20, 5, + 7, -12, 2, -20, 6, 12, 8, 16, 10, -12, + 14, 17, 19, 18, 20, 21, -12, -20, -20, 22, + 23, 24, -4, 26, -20, 11, -20, 31, -20, -20, + 25, -14, -20, 32, 34, -20, -20, -20, -20, -20 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -20, -20, -20, -20, -20, -17, -20, -20, -20, -8, + -20, -20, -20, -19, -20, -20, -20, -20, 13, -20, + -20 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_uint8 yytable[] = +{ + 14, 29, 30, 67, 15, 16, 17, 18, 19, 20, + 42, 11, 1, 12, 3, 5, 6, 10, 26, 33, + 27, 34, 31, 36, 41, 43, 28, 49, 45, 52, + 42, 46, 44, 48, 62, 60, 64, 54, 56, 50, + 0, 59, 61, 55, 57, 65, 68, 58, 69, 0, + 66, 0, 47 +}; + +static const yytype_int8 yycheck[] = +{ + 8, 18, 19, 17, 4, 5, 6, 7, 8, 9, + 24, 23, 3, 25, 18, 0, 19, 19, 15, 27, + 21, 16, 18, 16, 22, 13, 25, 10, 12, 11, + 24, 21, 24, 19, 53, 52, 25, 17, 46, 20, + -1, 17, 16, 22, 22, 14, 14, 24, 14, -1, + 25, -1, 39 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 32, 18, 36, 0, 19, 37, 38, 33, + 19, 23, 25, 39, 40, 4, 5, 6, 7, 8, + 9, 34, 35, 42, 47, 51, 15, 21, 25, 36, + 36, 18, 50, 40, 16, 44, 16, 41, 40, 48, + 49, 22, 24, 13, 24, 12, 21, 49, 19, 10, + 20, 43, 11, 46, 17, 22, 40, 22, 24, 17, + 36, 16, 44, 45, 25, 14, 25, 17, 14, 14 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval, &yylloc, scanner) +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, Location, scanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + YYLTYPE const * const yylocationp; + void *scanner; +#endif +{ + if (!yyvaluep) + return; + YYUSE (yylocationp); + YYUSE (scanner); +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + YYLTYPE const * const yylocationp; + void *scanner; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + YY_LOCATION_PRINT (yyoutput, *yylocationp); + YYFPRINTF (yyoutput, ": "); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner) +#else +static void +yy_reduce_print (yyvsp, yylsp, yyrule, scanner) + YYSTYPE *yyvsp; + YYLTYPE *yylsp; + int yyrule; + void *scanner; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , scanner); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, yylsp, Rule, scanner); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner) +#else +static void +yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; + YYLTYPE *yylocationp; + void *scanner; +#endif +{ + YYUSE (yyvaluep); + YYUSE (yylocationp); + YYUSE (scanner); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void *scanner); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *scanner) +#else +int +yyparse (scanner) + void *scanner; +#endif +#endif +{ + /* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; +/* Location data for the look-ahead symbol. */ +YYLTYPE yylloc; + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[2]; + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + yylsp = yyls; +#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL + /* Initialize the default location before parsing starts. */ + yylloc.first_line = yylloc.last_line = 1; + yylloc.first_column = yylloc.last_column = 0; +#endif + + + /* User initialization code. */ +#line 75 "../tikzit/src/data/tikzparser.y" +{ + yylloc.first_column = yylloc.last_column = 0; +} +/* Line 1078 of yacc.c. */ +#line 1337 "../tikzit/src/data/tikzparser.parser.cpp" + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + YYSTACK_RELOCATE (yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + *++yylsp = yylloc; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 125 "../tikzit/src/data/tikzparser.y" + { + if ((yyvsp[(2) - (4)].data)) { + assembler->graph()->setData((yyvsp[(2) - (4)].data)); + } + ;} + break; + + case 11: +#line 137 "../tikzit/src/data/tikzparser.y" + { (yyval.data) = 0; ;} + break; + + case 12: +#line 139 "../tikzit/src/data/tikzparser.y" + { (yyval.data) = (yyvsp[(2) - (3)].data); ;} + break; + + case 13: +#line 140 "../tikzit/src/data/tikzparser.y" + { (yyval.data) = 0; ;} + break; + + case 14: +#line 142 "../tikzit/src/data/tikzparser.y" + { + (yyvsp[(1) - (2)].data)->add(*(yyvsp[(2) - (2)].prop)); + delete (yyvsp[(2) - (2)].prop); + (yyval.data) = (yyvsp[(1) - (2)].data); + ;} + break; + + case 15: +#line 149 "../tikzit/src/data/tikzparser.y" + { + (yyvsp[(1) - (3)].data)->add(*(yyvsp[(2) - (3)].prop)); + delete (yyvsp[(2) - (3)].prop); + (yyval.data) = (yyvsp[(1) - (3)].data); + ;} + break; + + case 16: +#line 154 "../tikzit/src/data/tikzparser.y" + { (yyval.data) = new GraphElementData(); ;} + break; + + case 17: +#line 157 "../tikzit/src/data/tikzparser.y" + { + GraphElementProperty *p = new GraphElementProperty(QString((yyvsp[(1) - (3)].str)),QString((yyvsp[(3) - (3)].str))); + free((yyvsp[(1) - (3)].str)); + free((yyvsp[(3) - (3)].str)); + (yyval.prop) = p; + ;} + break; + + case 18: +#line 164 "../tikzit/src/data/tikzparser.y" + { + GraphElementProperty *a = new GraphElementProperty(QString((yyvsp[(1) - (1)].str))); + free((yyvsp[(1) - (1)].str)); + (yyval.prop) = a; + ;} + break; + + case 19: +#line 169 "../tikzit/src/data/tikzparser.y" + { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + break; + + case 20: +#line 169 "../tikzit/src/data/tikzparser.y" + { (yyval.str) = (yyvsp[(1) - (1)].str); ;} + break; + + case 21: +#line 171 "../tikzit/src/data/tikzparser.y" + { (yyval.str) = (yyvsp[(2) - (3)].str); ;} + break; + + case 22: +#line 173 "../tikzit/src/data/tikzparser.y" + { + Node *node = new Node(); + + if ((yyvsp[(2) - (7)].data)) { + node->setData((yyvsp[(2) - (7)].data)); + } + //qDebug() << "node name: " << $3; + node->setName(QString((yyvsp[(3) - (7)].str))); + node->setLabel(QString((yyvsp[(6) - (7)].str))); + free((yyvsp[(3) - (7)].str)); + free((yyvsp[(6) - (7)].str)); + + node->setPoint(*(yyvsp[(5) - (7)].pt)); + delete (yyvsp[(5) - (7)].pt); + + assembler->graph()->addNode(node); + assembler->addNodeToMap(node); + ;} + break; + + case 23: +#line 192 "../tikzit/src/data/tikzparser.y" + { (yyval.str) = 0; ;} + break; + + case 24: +#line 192 "../tikzit/src/data/tikzparser.y" + { (yyval.str) = (yyvsp[(2) - (2)].str); ;} + break; + + case 25: +#line 194 "../tikzit/src/data/tikzparser.y" + { + (yyval.noderef).node = assembler->nodeWithName(QString((yyvsp[(2) - (4)].str))); + free((yyvsp[(2) - (4)].str)); + (yyval.noderef).anchor = (yyvsp[(3) - (4)].str); + ;} + break; + + case 26: +#line 200 "../tikzit/src/data/tikzparser.y" + { (yyval.noderef) = (yyvsp[(1) - (1)].noderef); ;} + break; + + case 27: +#line 201 "../tikzit/src/data/tikzparser.y" + { (yyval.noderef).node = 0; (yyval.noderef).anchor = 0; ;} + break; + + case 28: +#line 203 "../tikzit/src/data/tikzparser.y" + { (yyval.node) = 0; ;} + break; + + case 29: +#line 205 "../tikzit/src/data/tikzparser.y" + { + (yyval.node) = new Node(); + if ((yyvsp[(2) - (3)].data)) + (yyval.node)->setData((yyvsp[(2) - (3)].data)); + (yyval.node)->setLabel(QString((yyvsp[(3) - (3)].str))); + free((yyvsp[(3) - (3)].str)); + ;} + break; + + case 30: +#line 213 "../tikzit/src/data/tikzparser.y" + { + Node *s; + Node *t; + + s = (yyvsp[(3) - (7)].noderef).node; + + if ((yyvsp[(6) - (7)].noderef).node) { + t = (yyvsp[(6) - (7)].noderef).node; + } else { + t = s; + } + + Edge *edge = new Edge(s, t); + if ((yyvsp[(2) - (7)].data)) { + edge->setData((yyvsp[(2) - (7)].data)); + edge->setAttributesFromData(); + } + + if ((yyvsp[(5) - (7)].node)) + edge->setEdgeNode((yyvsp[(5) - (7)].node)); + if ((yyvsp[(3) - (7)].noderef).anchor) { + edge->setSourceAnchor(QString((yyvsp[(3) - (7)].noderef).anchor)); + free((yyvsp[(3) - (7)].noderef).anchor); + } + + if ((yyvsp[(6) - (7)].noderef).node) { + if ((yyvsp[(6) - (7)].noderef).anchor) { + edge->setTargetAnchor(QString((yyvsp[(6) - (7)].noderef).anchor)); + free((yyvsp[(6) - (7)].noderef).anchor); + } + } else { + edge->setTargetAnchor(edge->sourceAnchor()); + } + + assembler->graph()->addEdge(edge); + ;} + break; + + case 36: +#line 255 "../tikzit/src/data/tikzparser.y" + { + assembler->graph()->setBbox(QRectF(*(yyvsp[(3) - (6)].pt), *(yyvsp[(5) - (6)].pt))); + delete (yyvsp[(3) - (6)].pt); + delete (yyvsp[(5) - (6)].pt); + ;} + break; + + +/* Line 1267 of yacc.c. */ +#line 1719 "../tikzit/src/data/tikzparser.parser.cpp" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (&yylloc, scanner, YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (&yylloc, scanner, yymsg); + } + else + { + yyerror (&yylloc, scanner, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + yyerror_range[0] = yylloc; + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, scanner); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + yyerror_range[0] = yylsp[1-yylen]; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + yyerror_range[0] = *yylsp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp, yylsp, scanner); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + yyerror_range[1] = yylloc; + /* Using YYLLOC is tempting, but would change the location of + the look-ahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + *++yylsp = yyloc; + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (&yylloc, scanner, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, scanner); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp, yylsp, scanner); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + diff --git a/src/data/tikzparser.parser.hpp b/src/data/tikzparser.parser.hpp new file mode 100644 index 0000000..aaf0e10 --- /dev/null +++ b/src/data/tikzparser.parser.hpp @@ -0,0 +1,139 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + BEGIN_TIKZPICTURE_CMD = 258, + END_TIKZPICTURE_CMD = 259, + BEGIN_PGFONLAYER_CMD = 260, + END_PGFONLAYER_CMD = 261, + DRAW_CMD = 262, + NODE_CMD = 263, + PATH_CMD = 264, + RECTANGLE = 265, + NODE = 266, + AT = 267, + TO = 268, + SEMICOLON = 269, + COMMA = 270, + LEFTPARENTHESIS = 271, + RIGHTPARENTHESIS = 272, + LEFTBRACKET = 273, + RIGHTBRACKET = 274, + FULLSTOP = 275, + EQUALS = 276, + COORD = 277, + PROPSTRING = 278, + REFSTRING = 279, + DELIMITEDSTRING = 280, + UNKNOWN_BEGIN_CMD = 281, + UNKNOWN_END_CMD = 282, + UNKNOWN_CMD = 283, + UNKNOWN_STR = 284, + UNCLOSED_DELIM_STR = 285 + }; +#endif +/* Tokens. */ +#define BEGIN_TIKZPICTURE_CMD 258 +#define END_TIKZPICTURE_CMD 259 +#define BEGIN_PGFONLAYER_CMD 260 +#define END_PGFONLAYER_CMD 261 +#define DRAW_CMD 262 +#define NODE_CMD 263 +#define PATH_CMD 264 +#define RECTANGLE 265 +#define NODE 266 +#define AT 267 +#define TO 268 +#define SEMICOLON 269 +#define COMMA 270 +#define LEFTPARENTHESIS 271 +#define RIGHTPARENTHESIS 272 +#define LEFTBRACKET 273 +#define RIGHTBRACKET 274 +#define FULLSTOP 275 +#define EQUALS 276 +#define COORD 277 +#define PROPSTRING 278 +#define REFSTRING 279 +#define DELIMITEDSTRING 280 +#define UNKNOWN_BEGIN_CMD 281 +#define UNKNOWN_END_CMD 282 +#define UNKNOWN_CMD 283 +#define UNKNOWN_STR 284 +#define UNCLOSED_DELIM_STR 285 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 43 "../tikzit/src/data/tikzparser.y" +{ + char *str; + GraphElementProperty *prop; + GraphElementData *data; + Node *node; + QPointF *pt; + struct noderef noderef; +} +/* Line 1529 of yacc.c. */ +#line 118 "../tikzit/src/data/tikzparser.parser.hpp" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +} YYLTYPE; +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y new file mode 100644 index 0000000..420b8a0 --- /dev/null +++ b/src/data/tikzparser.y @@ -0,0 +1,262 @@ +%{ +/* + * Copyright 2010 Chris Heunen + * Copyright 2010-2013 Aleks Kissinger + * Copyright 2013 K. Johan Paulsson + * Copyright 2013 Alex Merry + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "tikzparserdefs.h" +%} + +/* we use features added to bison 2.4 */ +%require "2.3" + +%error-verbose +/* enable maintaining locations for better error messages */ +%locations +/* the name of the header file */ +/*%defines "common/tikzparser.h"*/ +/* make it re-entrant (no global variables) */ +%pure-parser +/* We use a pure (re-entrant) lexer. This means yylex + will take a void* (opaque) type to maintain its state */ +%lex-param {void *scanner} +/* Since this parser is also pure, yyparse needs to take + that lexer state as an argument */ +%parse-param {void *scanner} + +/* possible data types for semantic values */ +%union { + char *str; + GraphElementProperty *prop; + GraphElementData *data; + Node *node; + QPointF *pt; + struct noderef noderef; +} + +%{ +#include "node.h" +#include "edge.h" +#include "graphelementdata.h" +#include "graphelementproperty.h" + +#include "tikzlexer.h" +#import "tikzgraphassembler.h" +/* the assembler (used by this parser) is stored in the lexer + state as "extra" data */ +#define assembler yyget_extra(scanner) + +/* pass errors off to the assembler */ +void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { + // TODO: implement reportError() + //assembler->reportError(str, yylloc); + qDebug() << "parse error: " << str; +} +%} + +/* yyloc is set up with first_column = last_column = 1 by default; + however, it makes more sense to think of us being "before the + start of the line" before we parse anything */ +%initial-action { + yylloc.first_column = yylloc.last_column = 0; +} + + +%token BEGIN_TIKZPICTURE_CMD "\\begin{tikzpicture}" +%token END_TIKZPICTURE_CMD "\\end{tikzpicture}" +%token BEGIN_PGFONLAYER_CMD "\\begin{pgfonlayer}" +%token END_PGFONLAYER_CMD "\\end{pgfonlayer}" +%token DRAW_CMD "\\draw" +%token NODE_CMD "\\node" +%token PATH_CMD "\\path" +%token RECTANGLE "rectangle" +%token NODE "node" +%token AT "at" +%token TO "to" +%token SEMICOLON ";" +%token COMMA "," + +%token LEFTPARENTHESIS "(" +%token RIGHTPARENTHESIS ")" +%token LEFTBRACKET "[" +%token RIGHTBRACKET "]" +%token FULLSTOP "." +%token EQUALS "=" +%token COORD "co-ordinate" +%token PROPSTRING "key/value string" +%token REFSTRING "string" +%token DELIMITEDSTRING "{-delimited string" + +%token UNKNOWN_BEGIN_CMD "unknown \\begin command" +%token UNKNOWN_END_CMD "unknown \\end command" +%token UNKNOWN_CMD "unknown latex command" +%token UNKNOWN_STR "unknown string" +%token UNCLOSED_DELIM_STR "unclosed {-delimited string" + +%type nodename +%type optanchor +%type val +%type property +%type extraproperties +%type properties +%type optproperties +%type optedgenode +%type noderef +%type optnoderef + +%% + +tikzpicture: "\\begin{tikzpicture}" optproperties tikzcmds "\\end{tikzpicture}" + { + if ($2) { + assembler->graph()->setData($2); + } + }; +tikzcmds: tikzcmds tikzcmd | ; +tikzcmd: node | edge | boundingbox | ignore; + +ignore: "\\begin{pgfonlayer}" DELIMITEDSTRING | "\\end{pgfonlayer}"; + +optproperties: + "[" "]" + { $$ = 0; } + | "[" properties "]" + { $$ = $2; } + | { $$ = 0; }; +properties: extraproperties property + { + $1->add(*$2); + delete $2; + $$ = $1; + }; +extraproperties: + extraproperties property "," + { + $1->add(*$2); + delete $2; + $$ = $1; + } + | { $$ = new GraphElementData(); }; +property: + val "=" val + { + GraphElementProperty *p = new GraphElementProperty(QString($1),QString($3)); + free($1); + free($3); + $$ = p; + } + | val + { + GraphElementProperty *a = new GraphElementProperty(QString($1)); + free($1); + $$ = a; + }; +val: PROPSTRING { $$ = $1; } | DELIMITEDSTRING { $$ = $1; }; + +nodename: "(" REFSTRING ")" { $$ = $2; }; +node: "\\node" optproperties nodename "at" COORD DELIMITEDSTRING ";" + { + Node *node = new Node(); + + if ($2) { + node->setData($2); + } + //qDebug() << "node name: " << $3; + node->setName(QString($3)); + node->setLabel(QString($6)); + free($3); + free($6); + + node->setPoint(*$5); + delete $5; + + assembler->graph()->addNode(node); + assembler->addNodeToMap(node); + }; + +optanchor: { $$ = 0; } | "." REFSTRING { $$ = $2; }; +noderef: "(" REFSTRING optanchor ")" + { + $$.node = assembler->nodeWithName(QString($2)); + free($2); + $$.anchor = $3; + }; +optnoderef: + noderef { $$ = $1; } + | "(" ")" { $$.node = 0; $$.anchor = 0; } +optedgenode: + { $$ = 0; } + | "node" optproperties DELIMITEDSTRING + { + $$ = new Node(); + if ($2) + $$->setData($2); + $$->setLabel(QString($3)); + free($3); + } +edge: "\\draw" optproperties noderef "to" optedgenode optnoderef ";" + { + Node *s; + Node *t; + + s = $3.node; + + if ($6.node) { + t = $6.node; + } else { + t = s; + } + + Edge *edge = new Edge(s, t); + if ($2) { + edge->setData($2); + edge->setAttributesFromData(); + } + + if ($5) + edge->setEdgeNode($5); + if ($3.anchor) { + edge->setSourceAnchor(QString($3.anchor)); + free($3.anchor); + } + + if ($6.node) { + if ($6.anchor) { + edge->setTargetAnchor(QString($6.anchor)); + free($6.anchor); + } + } else { + edge->setTargetAnchor(edge->sourceAnchor()); + } + + assembler->graph()->addEdge(edge); + }; + +ignoreprop: val | val "=" val; +ignoreprops: ignoreprop ignoreprops | ; +optignoreprops: "[" ignoreprops "]"; +boundingbox: + "\\path" optignoreprops COORD "rectangle" COORD ";" + { + assembler->graph()->setBbox(QRectF(*$3, *$5)); + delete $3; + delete $5; + }; + +/* vi:ft=yacc:noet:ts=4:sts=4:sw=4 +*/ diff --git a/src/data/tikzparserdefs.h b/src/data/tikzparserdefs.h new file mode 100644 index 0000000..9d4bfe8 --- /dev/null +++ b/src/data/tikzparserdefs.h @@ -0,0 +1,18 @@ +#ifndef TIKZPARSERDEFS_H +#define TIKZPARSERDEFS_H + +#include "graphelementproperty.h" +#include "graphelementdata.h" +#include "node.h" +#include "tikzgraphassembler.h" + +#include +#include +#include + +struct noderef { + Node *node; + char *anchor; +}; + +#endif // TIKZPARSERDEFS_H diff --git a/src/gui/commands.cpp b/src/gui/commands.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/gui/commands.h b/src/gui/commands.h new file mode 100644 index 0000000..73bfaa7 --- /dev/null +++ b/src/gui/commands.h @@ -0,0 +1,4 @@ +#ifndef COMMANDS_H +#define COMMANDS_H + +#endif // COMMANDS_H diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp new file mode 100644 index 0000000..497fa07 --- /dev/null +++ b/src/gui/edgeitem.cpp @@ -0,0 +1,131 @@ +#include "tikzit.h" +#include "edgeitem.h" + +#include +#include + +EdgeItem::EdgeItem(Edge *edge) +{ + _edge = edge; + setFlag(QGraphicsItem::ItemIsSelectable); + + QPen pen(Qt::black); + pen.setWidth(2); + setPen(pen); + _cp1Item = new QGraphicsEllipseItem(this); + _cp1Item->setParentItem(this); + _cp1Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), + GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + _cp1Item->setVisible(false); + + _cp2Item = new QGraphicsEllipseItem(this); + _cp2Item->setParentItem(this); + _cp2Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), + GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + _cp2Item->setVisible(false); + + readPos(); +} + +void EdgeItem::readPos() +{ + //_edge->setAttributesFromData(); + _edge->updateControls(); + QPainterPath path; + + path.moveTo (toScreen(_edge->tail())); + path.cubicTo(toScreen(_edge->cp1()), + toScreen(_edge->cp2()), + toScreen(_edge->head())); + setPath(path); + + _cp1Item->setPos(toScreen(_edge->cp1())); + _cp2Item->setPos(toScreen(_edge->cp2())); +} + +void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + //QGraphicsPathItem::paint(painter, option, widget); + painter->setPen(pen()); + painter->setBrush(Qt::NoBrush); + painter->drawPath(path()); + + if (isSelected()) { + QColor draw; + QColor draw1; + QColor fill; + + if (_edge->basicBendMode()) { + draw = Qt::blue; + draw1 = QColor(100,100,255,100); + fill = QColor(200,200,255,50); + } else { + draw = Qt::darkGreen; + draw1 = QColor(0, 150, 0, 50); + fill = QColor(200,255,200,150); + } + + painter->setPen(QPen(draw1)); + + float r = GLOBAL_SCALEF * _edge->cpDist(); + painter->drawEllipse(toScreen(_edge->source()->point()), r, r); + painter->drawEllipse(toScreen(_edge->target()->point()), r, r); + + painter->setPen(QPen(draw)); + painter->setBrush(QBrush(fill)); + + painter->drawLine(toScreen(_edge->tail()), toScreen(_edge->cp1())); + painter->drawLine(toScreen(_edge->head()), toScreen(_edge->cp2())); + + //painter->drawEllipse(toScreen(_edge->cp1()), r, r); + //painter->drawEllipse(toScreen(_edge->cp2()), r, r); + + _cp1Item->setPen(QPen(draw)); + _cp1Item->setBrush(QBrush(fill)); + _cp1Item->setVisible(true); + + _cp2Item->setPen(QPen(draw)); + _cp2Item->setBrush(QBrush(fill)); + _cp2Item->setVisible(true); + + r = GLOBAL_SCALEF * 0.05; + painter->setPen(QPen(Qt::black)); + painter->setBrush(QBrush(QColor(255,255,255,200))); + painter->drawEllipse(toScreen(_edge->mid()), r, r); + } else { + _cp1Item->setVisible(false); + _cp2Item->setVisible(false); + } +} + +QRectF EdgeItem::boundingRect() const +{ + float r = GLOBAL_SCALEF * (_edge->cpDist() + 0.2); + return shape().boundingRect().adjusted(-r,-r,r,r); +} + +QPainterPath EdgeItem::shape() const +{ + // get the shape of the edge, and expand a bit to make selection easier + QPainterPath oldShape = QGraphicsPathItem::shape(); + QPainterPathStroker stroker; + stroker.setWidth(5); + stroker.setJoinStyle(Qt::MiterJoin); + QPainterPath newShape = (stroker.createStroke(oldShape) + oldShape).simplified(); + return newShape; +} + +Edge *EdgeItem::edge() const +{ + return _edge; +} + +QGraphicsEllipseItem *EdgeItem::cp1Item() const +{ + return _cp1Item; +} + +QGraphicsEllipseItem *EdgeItem::cp2Item() const +{ + return _cp2Item; +} diff --git a/src/gui/edgeitem.h b/src/gui/edgeitem.h new file mode 100644 index 0000000..b017265 --- /dev/null +++ b/src/gui/edgeitem.h @@ -0,0 +1,36 @@ +/** + * A QGraphicsItem that handles drawing a single edge. + */ + +#ifndef EDGEITEM_H +#define EDGEITEM_H + +#include "edge.h" + +#include +#include +#include +#include +#include +#include + +class EdgeItem : public QGraphicsPathItem +{ +public: + EdgeItem(Edge *edge); + void readPos(); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, + QWidget *widget); + QRectF boundingRect() const; + QPainterPath shape() const; + Edge *edge() const; + QGraphicsEllipseItem *cp1Item() const; + QGraphicsEllipseItem *cp2Item() const; + +private: + Edge *_edge; + QGraphicsEllipseItem *_cp1Item; + QGraphicsEllipseItem *_cp2Item; +}; + +#endif // EDGEITEM_H diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp new file mode 100644 index 0000000..c9e83ba --- /dev/null +++ b/src/gui/mainmenu.cpp @@ -0,0 +1,96 @@ +#include "mainmenu.h" +#include "tikzit.h" + +MainMenu::MainMenu() +{ + ui.setupUi(this); +} + +// File +void MainMenu::on_actionNew_triggered() +{ + tikzit->newDoc(); +} + +void MainMenu::on_actionOpen_triggered() +{ + tikzit->open(); +} + +void MainMenu::on_actionClose_triggered() +{ + // TODO +} + +void MainMenu::on_actionSave_triggered() +{ + // TODO +} + +void MainMenu::on_actionSave_As_triggered() +{ + // TODO +} + + +// Edit +void MainMenu::on_actionUndo_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzDocument()->undoStack()->undo(); +} + +void MainMenu::on_actionRedo_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzDocument()->undoStack()->redo(); +} + +void MainMenu::on_actionCut_triggered() +{ + // TODO +} + +void MainMenu::on_actionCopy_triggered() +{ + // TODO +} + +void MainMenu::on_actionPaste_triggered() +{ + // TODO +} + +void MainMenu::on_actionDelete_triggered() +{ + // TODO +} + +void MainMenu::on_actionSelect_All_triggered() +{ + // TODO +} + +void MainMenu::on_actionDeselect_All_triggered() +{ + // TODO +} + + +// Tikz +void MainMenu::on_actionParse_triggered() +{ + // TODO +} + + +// View +void MainMenu::on_actionZoom_In_triggered() +{ + if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzView()->zoomIn(); +} + +void MainMenu::on_actionZoom_Out_triggered() +{ + if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzView()->zoomOut(); +} diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h new file mode 100644 index 0000000..d85e271 --- /dev/null +++ b/src/gui/mainmenu.h @@ -0,0 +1,43 @@ +#ifndef MAINMENU_H +#define MAINMENU_H + +#include "ui_mainmenu.h" + +#include + +class MainMenu : public QMenuBar +{ + Q_OBJECT +public: + MainMenu(); + +private: + Ui::MainMenu ui; + +public slots: + // File + void on_actionNew_triggered(); + void on_actionOpen_triggered(); + void on_actionClose_triggered(); + void on_actionSave_triggered(); + void on_actionSave_As_triggered(); + + // Edit + void on_actionUndo_triggered(); + void on_actionRedo_triggered(); + void on_actionCut_triggered(); + void on_actionCopy_triggered(); + void on_actionPaste_triggered(); + void on_actionDelete_triggered(); + void on_actionSelect_All_triggered(); + void on_actionDeselect_All_triggered(); + + // Tikz + void on_actionParse_triggered(); + + // View + void on_actionZoom_In_triggered(); + void on_actionZoom_Out_triggered(); +}; + +#endif // MAINMENU_H diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui new file mode 100644 index 0000000..c9b6f44 --- /dev/null +++ b/src/gui/mainmenu.ui @@ -0,0 +1,187 @@ + + + MainMenu + + + + 0 + 0 + 476 + 22 + + + + + File + + + + + + + + + + + Edit + + + + + + + + + + + + + + + Tikz + + + + + + View + + + + + + + New... + + + Ctrl+N + + + + + Open... + + + Ctrl+O + + + + + Close + + + Ctrl+W + + + + + Save + + + Ctrl+S + + + + + Save As... + + + Ctrl+Shift+S + + + + + Undo + + + Ctrl+Z + + + + + Redo + + + Ctrl+Shift+Z + + + + + Cut + + + Ctrl+X + + + + + Copy + + + Ctrl+C + + + + + Paste + + + Ctrl+V + + + + + Delete + + + Backspace + + + + + Select All + + + Ctrl+A + + + + + Deselect All + + + Ctrl+D + + + + + Parse + + + Ctrl+T + + + + + Zoom In + + + Ctrl+= + + + + + Zoom Out + + + Ctrl+- + + + + + + + + + + diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp new file mode 100644 index 0000000..19b6a59 --- /dev/null +++ b/src/gui/mainwindow.cpp @@ -0,0 +1,99 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "tikzgraphassembler.h" +#include "toolpalette.h" +#include "tikzit.h" + +#include +#include +#include +#include +#include +#include + +int MainWindow::_numWindows = 0; + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + _windowId = _numWindows; + _numWindows++; + ui->setupUi(this); + setAttribute(Qt::WA_DeleteOnClose, true); + _tikzDocument = new TikzDocument(this); + _tikzScene = new TikzScene(_tikzDocument, this); + ui->tikzView->setScene(_tikzScene); + _fileName = ""; + _pristine = true; + + // initially, the source view should be collapsed + QList sz = ui->splitter->sizes(); + sz[0] = sz[0] + sz[1]; + sz[1] = 0; + ui->splitter->setSizes(sz); +} + +MainWindow::~MainWindow() +{ + tikzit->removeWindow(this); + delete ui; +} + +void MainWindow::open(QString fileName) +{ + _pristine = false; + _tikzDocument->open(fileName); + ui->tikzSource->setText(_tikzDocument->tikz()); + + + if (_tikzDocument->parseSuccess()) { + statusBar()->showMessage("TiKZ parsed successfully", 2000); + setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); + _tikzScene->setTikzDocument(_tikzDocument); + } else { + statusBar()->showMessage("Cannot read TiKZ source"); + } + +} + +void MainWindow::closeEvent(QCloseEvent *event) +{ + //qDebug() << "got close event"; + QMainWindow::closeEvent(event); +} + +void MainWindow::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::ActivationChange && isActiveWindow()) { + tikzit->setActiveWindow(this); + } + QMainWindow::changeEvent(event); +} + +TikzDocument *MainWindow::tikzDocument() const +{ + return _tikzDocument; +} + +TikzScene *MainWindow::tikzScene() const +{ + return _tikzScene; +} + +int MainWindow::windowId() const +{ + return _windowId; +} + +TikzView *MainWindow::tikzView() const +{ + return ui->tikzView; +} + +bool MainWindow::pristine() const +{ + return _pristine; +} + + diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h new file mode 100644 index 0000000..f27677a --- /dev/null +++ b/src/gui/mainwindow.h @@ -0,0 +1,48 @@ +/** + * A top-level window, which contains a single TikzDocument. + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include "tikzscene.h" +#include "tikzview.h" +#include "graph.h" +#include "tikzdocument.h" + +#include +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + void open(QString fileName); + bool pristine() const; + int windowId() const; + TikzView *tikzView() const; + TikzScene *tikzScene() const; + TikzDocument *tikzDocument() const; + +protected: + void closeEvent(QCloseEvent *event); + void changeEvent(QEvent *event); +private: + TikzScene *_tikzScene; + TikzDocument *_tikzDocument; + Ui::MainWindow *ui; + QString _fileName; + bool _pristine; + int _windowId; + static int _numWindows; +}; + +#endif // MAINWINDOW_H diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui new file mode 100644 index 0000000..56a5c2d --- /dev/null +++ b/src/gui/mainwindow.ui @@ -0,0 +1,199 @@ + + + MainWindow + + + + 0 + 0 + 640 + 480 + + + + TikZiT - untitled + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Vertical + + + + + + Courier New + 10 + + + + QTextEdit::NoWrap + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Courier New'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.SF NS Text'; font-size:13pt;"><br /></p></body></html> + + + 20 + + + + + + + + + + New... + + + + + Open... + + + + + Close + + + + + Save + + + + + Save As... + + + + + Undo + + + + + Redo + + + + + Cut + + + + + Copy + + + + + Paste + + + + + Delete + + + + + Select All + + + + + Deselect All + + + + + Parse + + + Ctrl+T + + + + + Zoom In + + + Ctrl+= + + + + + Zoom Out + + + Ctrl+- + + + + + + + TikzView + QGraphicsView +
tikzview.h
+ + zoomIn() + zoomOut() + +
+
+ + + + actionZoom_In + triggered() + tikzView + zoomIn() + + + -1 + -1 + + + 237 + 103 + + + + + actionZoom_Out + triggered() + tikzView + zoomOut() + + + -1 + -1 + + + 237 + 103 + + + + +
diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp new file mode 100644 index 0000000..71226f3 --- /dev/null +++ b/src/gui/nodeitem.cpp @@ -0,0 +1,124 @@ +#include "tikzit.h" +#include "nodeitem.h" +#include "tikzscene.h" +#include + +#include +#include +#include +#include +#include +#include +#include + +NodeItem::NodeItem(Node *node) +{ + _node = node; + setFlag(QGraphicsItem::ItemIsSelectable); + setFlag(QGraphicsItem::ItemIsMovable); + setFlag(QGraphicsItem::ItemSendsGeometryChanges); + readPos(); +} + +void NodeItem::readPos() +{ + setPos(toScreen(_node->point())); +} + +void NodeItem::writePos() +{ + _node->setPoint(fromScreen(pos())); +} + +QRectF NodeItem::labelRect() const { + QString label = _node->label(); + //QFont f("Courier", 9); + QFontMetrics fm(Tikzit::LABEL_FONT); + + QRectF rect = fm.boundingRect(label); + //rect.adjust(-2,-2,2,2); + rect.moveCenter(QPointF(0,0)); + return rect; +} + +void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +{ + if (_node->style()->isNone()) { + QColor c(180,180,200); + painter->setPen(QPen(c)); + painter->setBrush(QBrush(c)); + painter->drawEllipse(QPointF(0,0), 1,1); + + QPen pen(QColor(180,180,220)); + QVector p; + p << 2.0 << 2.0; + pen.setDashPattern(p); + painter->setPen(pen); + painter->setBrush(Qt::NoBrush); + painter->drawPath(shape()); + } else { + QPen pen(_node->style()->strokeColor); + pen.setWidth(_node->style()->strokeThickness); + painter->setPen(pen); + painter->setBrush(QBrush(_node->style()->fillColor)); + painter->drawPath(shape()); + } + + if (_node->label() != "") { + QRectF rect = labelRect(); + QPen pen(QColor(200,0,0,120)); + QVector d; + d << 2.0 << 2.0; + pen.setDashPattern(d); + painter->setPen(pen); + painter->setBrush(QBrush(QColor(255,255,100,120))); + painter->drawRect(rect); + + painter->setPen(QPen(Qt::black)); + painter->setFont(Tikzit::LABEL_FONT); + painter->drawText(rect, Qt::AlignCenter, _node->label()); + } + + if (isSelected()) { + QPainterPath sh = shape(); + QPainterPathStroker stroker; + stroker.setWidth(4); + QPainterPath outline = (stroker.createStroke(sh) + sh).simplified(); + painter->setPen(Qt::NoPen); + painter->setBrush(QBrush(QColor(150,200,255,100))); + painter->drawPath(outline); + } + +} + +QPainterPath NodeItem::shape() const +{ + QPainterPath path; + path.addEllipse(QPointF(0,0), GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + return path; +} + +QRectF NodeItem::boundingRect() const +{ + QRectF r = labelRect(); + return r.united(shape().boundingRect()).adjusted(-4,-4,4,4); +} + +Node *NodeItem::node() const +{ + return _node; +} + +QVariant NodeItem::itemChange(GraphicsItemChange change, const QVariant &value) +{ + if (change == ItemPositionChange) { + QPointF newPos = value.toPointF(); + int gridSize = GLOBAL_SCALE / 8; + QPointF gridPos(round(newPos.x()/gridSize)*gridSize, round(newPos.y()/gridSize)*gridSize); + _node->setPoint(fromScreen(gridPos)); + + return gridPos; + } else { + return QGraphicsItem::itemChange(change, value); + } +} diff --git a/src/gui/nodeitem.h b/src/gui/nodeitem.h new file mode 100644 index 0000000..9a3edb0 --- /dev/null +++ b/src/gui/nodeitem.h @@ -0,0 +1,32 @@ +/** + * A QGraphicsItem that handles drawing a single node. + */ + +#ifndef NODEITEM_H +#define NODEITEM_H + +#include "node.h" + +#include +#include +#include +#include + +class NodeItem : public QGraphicsItem +{ +public: + NodeItem(Node *node); + void readPos(); + void writePos(); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); + QVariant itemChange(GraphicsItemChange change, const QVariant &value); + QPainterPath shape() const; + QRectF boundingRect() const; + Node *node() const; + +private: + Node *_node; + QRectF labelRect() const; +}; + +#endif // NODEITEM_H diff --git a/src/gui/propertypalette.cpp b/src/gui/propertypalette.cpp new file mode 100644 index 0000000..5fc763f --- /dev/null +++ b/src/gui/propertypalette.cpp @@ -0,0 +1,43 @@ +#include "propertypalette.h" +#include "graphelementdata.h" +#include "ui_propertypalette.h" + +#include +#include +#include +#include + +PropertyPalette::PropertyPalette(QWidget *parent) : + QDockWidget(parent), + ui(new Ui::PropertyPalette) +{ + setWindowFlags(Qt::Window + | Qt::CustomizeWindowHint + | Qt::WindowTitleHint); + //setFocusPolicy(Qt::NoFocus); + ui->setupUi(this); + GraphElementData *d = new GraphElementData(); + d->setProperty("key 1", "value 1"); + d->setAtom("atom 1"); + d->setProperty("key 2", "value 2"); + + QModelIndex i = d->index(0,0); + ui->treeView->setModel(d); + + QSettings settings("tikzit", "tikzit"); + QVariant geom = settings.value("property-palette-geometry"); + if (geom != QVariant()) { + restoreGeometry(geom.toByteArray()); + } +} + +PropertyPalette::~PropertyPalette() +{ + delete ui; +} + +void PropertyPalette::closeEvent(QCloseEvent *event) { + QSettings settings("tikzit", "tikzit"); + settings.setValue("property-palette-geometry", saveGeometry()); + QDockWidget::closeEvent(event); +} diff --git a/src/gui/propertypalette.h b/src/gui/propertypalette.h new file mode 100644 index 0000000..7910d70 --- /dev/null +++ b/src/gui/propertypalette.h @@ -0,0 +1,28 @@ +/** + * Enables the user to edit properties of the graph, as well as the selected node/edge. + */ + +#ifndef PROPERTYPALETTE_H +#define PROPERTYPALETTE_H + +#include + +namespace Ui { +class PropertyPalette; +} + +class PropertyPalette : public QDockWidget +{ + Q_OBJECT + +public: + explicit PropertyPalette(QWidget *parent = 0); + ~PropertyPalette(); + +protected: + void closeEvent(QCloseEvent *event); +private: + Ui::PropertyPalette *ui; +}; + +#endif // PROPERTYPALETTE_H diff --git a/src/gui/propertypalette.ui b/src/gui/propertypalette.ui new file mode 100644 index 0000000..83d586e --- /dev/null +++ b/src/gui/propertypalette.ui @@ -0,0 +1,30 @@ + + + PropertyPalette + + + + 0 + 0 + 194 + 341 + + + + Properties + + + + + + + 0 + + + + + + + + + diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp new file mode 100644 index 0000000..3431c0c --- /dev/null +++ b/src/gui/tikzscene.cpp @@ -0,0 +1,384 @@ +#include "tikzit.h" +#include "util.h" +#include "tikzscene.h" +#include "undocommands.h" + +#include +#include +#include + + +TikzScene::TikzScene(TikzDocument *tikzDocument, QObject *parent) : + QGraphicsScene(parent), _tikzDocument(tikzDocument) +{ + _modifyEdgeItem = 0; + _drawEdgeItem = new QGraphicsLineItem(); + setSceneRect(-310,-230,620,450); + + QPen pen; + pen.setColor(QColor::fromRgbF(0.5f, 0.0f, 0.5f)); + pen.setWidth(3); + _drawEdgeItem->setPen(pen); + _drawEdgeItem->setLine(0,0,0,0); + _drawEdgeItem->setVisible(false); + addItem(_drawEdgeItem); +} + +TikzScene::~TikzScene() { +} + +Graph *TikzScene::graph() +{ + return _tikzDocument->graph(); +} + +void TikzScene::graphReplaced() +{ + foreach (NodeItem *ni, _nodeItems) { + removeItem(ni); + delete ni; + } + _nodeItems.clear(); + + foreach (EdgeItem *ei, _edgeItems) { + removeItem(ei); + delete ei; + } + _edgeItems.clear(); + + foreach (Edge *e, graph()->edges()) { + EdgeItem *ei = new EdgeItem(e); + _edgeItems.insert(e, ei); + addItem(ei); + } + + foreach (Node *n, graph()->nodes()) { + NodeItem *ni = new NodeItem(n); + _nodeItems.insert(n, ni); + addItem(ni); + } +} + +void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + // current mouse position, in scene coordinates + QPointF mousePos = event->scenePos(); + + // disable rubber band drag, which will clear the selection. Only re-enable it + // for the SELECT tool, and when no control point has been clicked. + views()[0]->setDragMode(QGraphicsView::NoDrag); + + // radius of a control point for bezier edges, in scene coordinates + qreal cpR = GLOBAL_SCALEF * (0.05); + qreal cpR2 = cpR * cpR; + + switch (tikzit->toolPalette()->currentTool()) { + case ToolPalette::SELECT: + // check if we grabbed a control point of an edge + foreach (QGraphicsItem *gi, selectedItems()) { + if (EdgeItem *ei = dynamic_cast(gi)) { + qreal dx, dy; + + dx = ei->cp1Item()->pos().x() - mousePos.x(); + dy = ei->cp1Item()->pos().y() - mousePos.y(); + + if (dx*dx + dy*dy <= cpR2) { + _modifyEdgeItem = ei; + _firstControlPoint = true; + break; + } + + dx = ei->cp2Item()->pos().x() - mousePos.x(); + dy = ei->cp2Item()->pos().y() - mousePos.y(); + + if (dx*dx + dy*dy <= cpR2) { + _modifyEdgeItem = ei; + _firstControlPoint = false; + break; + } + } + } + + if (_modifyEdgeItem != 0) { + // store for undo purposes + Edge *e = _modifyEdgeItem->edge(); + _oldBend = e->bend(); + _oldInAngle = e->inAngle(); + _oldOutAngle = e->outAngle(); + _oldWeight = e->weight(); + } else { + // since we are not dragging a control point, process the click normally + views()[0]->setDragMode(QGraphicsView::RubberBandDrag); + QGraphicsScene::mousePressEvent(event); + + // save current node positions for undo support + _oldNodePositions.clear(); + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) { + _oldNodePositions.insert(ni->node(), ni->node()->point()); + } + } + } + + break; + case ToolPalette::VERTEX: + break; + case ToolPalette::EDGE: + break; + case ToolPalette::CROP: + break; + } +} + +void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) +{ + // current mouse position, in scene coordinates + QPointF mousePos = event->scenePos(); + + switch (tikzit->toolPalette()->currentTool()) { + case ToolPalette::SELECT: + if (_modifyEdgeItem != 0) { + Edge *e = _modifyEdgeItem->edge(); + + // dragging a control point + QPointF src = toScreen(e->source()->point()); + QPointF targ = toScreen(e->target()->point()); + float dx1 = targ.x() - src.x(); + float dy1 = targ.y() - src.y(); + float dx2, dy2; + if (_firstControlPoint) { + dx2 = mousePos.x() - src.x(); + dy2 = mousePos.y() - src.y(); + } else { + dx2 = mousePos.x() - targ.x(); + dy2 = mousePos.y() - targ.y(); + } + + float baseDist = sqrt(dx1*dx1 + dy1*dy1); + float handleDist = sqrt(dx2*dx2 + dy2*dy2); + float wcoarseness = 0.1f; + + if (!e->isSelfLoop()) { + if (baseDist != 0) { + e->setWeight(roundToNearest(wcoarseness, handleDist/baseDist)); + } else { + e->setWeight(roundToNearest(wcoarseness, handleDist/GLOBAL_SCALEF)); + } + } + + float control_angle = atan2(-dy2, dx2); + + int bcoarseness = 15; + + if(e->basicBendMode()) { + float bnd; + float base_angle = atan2(-dy1, dx1); + if (_firstControlPoint) { + bnd = base_angle - control_angle; + } else { + bnd = control_angle - base_angle + M_PI; + if (bnd > M_PI) bnd -= 2*M_PI; + } + + e->setBend(round(bnd * (180.0f / M_PI) * (1.0f / (float)bcoarseness)) * bcoarseness); + + } else { + int bnd = round(control_angle * (180.0f / M_PI) * + (1.0f / (float)bcoarseness)) * + bcoarseness; + if (_firstControlPoint) { + // TODO: enable moving both control points +// if ([theEvent modifierFlags] & NSAlternateKeyMask) { +// if ([modifyEdge isSelfLoop]) { +// [modifyEdge setInAngle:[modifyEdge inAngle] + +// (bnd - [modifyEdge outAngle])]; +// } else { +// [modifyEdge setInAngle:[modifyEdge inAngle] - +// (bnd - [modifyEdge outAngle])]; +// } +// } + + e->setOutAngle(bnd); + } else { +// if (theEvent.modifierFlags & NSAlternateKeyMask) { +// if ([modifyEdge isSelfLoop]) { +// [modifyEdge setOutAngle:[modifyEdge outAngle] + +// (bnd - [modifyEdge inAngle])]; +// } else { +// [modifyEdge setOutAngle:[modifyEdge outAngle] - +// (bnd - [modifyEdge inAngle])]; +// } +// } + + e->setInAngle(bnd); + } + } + + _modifyEdgeItem->readPos(); + + } else { + // otherwise, process mouse move normally + QGraphicsScene::mouseMoveEvent(event); + refreshAdjacentEdges(_oldNodePositions.keys()); + } + + break; + case ToolPalette::VERTEX: + break; + case ToolPalette::EDGE: + break; + case ToolPalette::CROP: + break; + } +} + +void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + // current mouse position, in scene coordinates + QPointF mousePos = event->scenePos(); + + switch (tikzit->toolPalette()->currentTool()) { + case ToolPalette::SELECT: + if (_modifyEdgeItem != 0) { + // finished dragging a control point + Edge *e = _modifyEdgeItem->edge(); + + if (_oldWeight != e->weight() || + _oldBend != e->bend() || + _oldInAngle != e->inAngle() || + _oldOutAngle != e->outAngle()) + { + EdgeBendCommand *cmd = new EdgeBendCommand(this, e, _oldWeight, _oldBend, _oldInAngle, _oldOutAngle); + _tikzDocument->undoStack()->push(cmd); + } + + _modifyEdgeItem = 0; + } else { + // otherwise, process mouse move normally + QGraphicsScene::mouseReleaseEvent(event); + + if (!_oldNodePositions.empty()) { + QMap newNodePositions; + + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) { + ni->writePos(); + newNodePositions.insert(ni->node(), ni->node()->point()); + } + } + + //qDebug() << _oldNodePositions; + //qDebug() << newNodePositions; + + _tikzDocument->undoStack()->push(new MoveCommand(this, _oldNodePositions, newNodePositions)); + _oldNodePositions.clear(); + } + } + + break; + case ToolPalette::VERTEX: + { + int gridSize = GLOBAL_SCALE / 8; + QPointF gridPos(round(mousePos.x()/gridSize)*gridSize, round(mousePos.y()/gridSize)*gridSize); + Node *n = new Node(); + n->setPoint(fromScreen(gridPos)); + + QRectF grow(gridPos.x() - GLOBAL_SCALEF, gridPos.y() - GLOBAL_SCALEF, 2 * GLOBAL_SCALEF, 2 * GLOBAL_SCALEF); + QRectF newBounds = sceneRect().united(grow); + qDebug() << grow; + qDebug() << newBounds; + + AddNodeCommand *cmd = new AddNodeCommand(this, n, newBounds); + _tikzDocument->undoStack()->push(cmd); + } + break; + case ToolPalette::EDGE: + break; + case ToolPalette::CROP: + break; + } +} + +void TikzScene::keyReleaseEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete) { + QSet selNodes; + QSet selEdges; + getSelection(selNodes, selEdges); + + QMap deleteNodes; + QMap deleteEdges; + + for (int i = 0; i < _tikzDocument->graph()->nodes().length(); ++i) { + Node *n = _tikzDocument->graph()->nodes()[i]; + if (selNodes.contains(n)) deleteNodes.insert(i, n); + } + + for (int i = 0; i < _tikzDocument->graph()->edges().length(); ++i) { + Edge *e = _tikzDocument->graph()->edges()[i]; + if (selEdges.contains(e) || + selNodes.contains(e->source()) || + selNodes.contains(e->target())) deleteEdges.insert(i, e); + } + + //qDebug() << "nodes:" << deleteNodes; + //qDebug() << "edges:" << deleteEdges; + DeleteCommand *cmd = new DeleteCommand(this, deleteNodes, deleteEdges, selEdges); + _tikzDocument->undoStack()->push(cmd); + } +} + +void TikzScene::getSelection(QSet &selNodes, QSet &selEdges) +{ + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) selNodes << ni->node(); + if (EdgeItem *ei = dynamic_cast(gi)) selEdges << ei->edge(); + } +} + + +TikzDocument *TikzScene::tikzDocument() const +{ + return _tikzDocument; +} + +void TikzScene::setTikzDocument(TikzDocument *tikzDocument) +{ + _tikzDocument = tikzDocument; + graphReplaced(); +} + +void TikzScene::refreshAdjacentEdges(QList nodes) +{ + if (nodes.empty()) return; + foreach (EdgeItem *ei, _edgeItems) { + if (nodes.contains(ei->edge()->source()) || nodes.contains(ei->edge()->target())) { + ei->edge()->updateControls(); + ei->readPos(); + } + } +} + +void TikzScene::setBounds(QRectF bounds) +{ + if (bounds != sceneRect()) { + if (!views().empty()) { + QGraphicsView *v = views().first(); + QPointF c = v->mapToScene(v->viewport()->rect().center()); + setSceneRect(bounds); + v->centerOn(c); + } else { + setSceneRect(bounds); + } + } +} + +QMap &TikzScene::nodeItems() +{ + return _nodeItems; +} + +QMap &TikzScene::edgeItems() +{ + return _edgeItems; +} diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h new file mode 100644 index 0000000..6817792 --- /dev/null +++ b/src/gui/tikzscene.h @@ -0,0 +1,62 @@ +/** + * Manage the scene, which contains a single Graph, and respond to user input. This serves as + * the controller for the MVC (TikzDocument, TikzView, TikzScene). + */ + +#ifndef TIKZSCENE_H +#define TIKZSCENE_H + +#include "graph.h" +#include "nodeitem.h" +#include "edgeitem.h" +#include "tikzdocument.h" + +#include +#include +#include +#include +#include +#include +#include + +class TikzScene : public QGraphicsScene +{ + Q_OBJECT +public: + TikzScene(TikzDocument *tikzDocument, QObject *parent); + ~TikzScene(); + Graph *graph(); + QMap &nodeItems(); + QMap &edgeItems(); + void refreshAdjacentEdges(QList nodes); + void setBounds(QRectF bounds); + + TikzDocument *tikzDocument() const; + void setTikzDocument(TikzDocument *tikzDocument); + +public slots: + void graphReplaced(); + +protected: + void mousePressEvent(QGraphicsSceneMouseEvent *event) override; + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; + void keyReleaseEvent(QKeyEvent *event) override; +private: + TikzDocument *_tikzDocument; + QMap _nodeItems; + QMap _edgeItems; + QGraphicsLineItem *_drawEdgeItem; + EdgeItem *_modifyEdgeItem; + bool _firstControlPoint; + + QMap _oldNodePositions; + float _oldWeight; + int _oldBend; + int _oldInAngle; + int _oldOutAngle; + + void getSelection(QSet &selNodes, QSet &selEdges); +}; + +#endif // TIKZSCENE_H diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp new file mode 100644 index 0000000..fe6c401 --- /dev/null +++ b/src/gui/tikzview.cpp @@ -0,0 +1,84 @@ +#include "tikzview.h" +#include "tikzit.h" + +#include + +TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) +{ + setRenderHint(QPainter::Antialiasing); + setDragMode(QGraphicsView::RubberBandDrag); + + _scale = 1.0f; +} + +void TikzView::zoomIn() +{ + _scale *= 1.6f; + scale(1.6,1.6); +} + +void TikzView::zoomOut() +{ + _scale *= 0.625f; + scale(0.625,0.625); +} + +void TikzView::drawBackground(QPainter *painter, const QRectF &rect) +{ + // draw the grid + int step = GLOBAL_SCALE / 8; + + QPen pen1; + pen1.setWidth(1); + pen1.setCosmetic(true); + pen1.setColor(QColor(230,230,230)); + + QPen pen2 = pen1; + pen2.setColor(QColor(200,200,200)); + + QPen pen3 = pen1; + pen3.setColor(QColor(160,160,160)); + + painter->setPen(pen1); + + if (_scale > 0.2f) { + for (int x = -step; x > rect.left(); x -= step) { + if (x % (step * 8) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); + } + + for (int x = step; x < rect.right(); x += step) { + if (x % (step * 8) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); + } + + for (int y = -step; y > rect.top(); y -= step) { + if (y % (step * 8) != 0) painter->drawLine(rect.left(), y, rect.right(), y); + } + + for (int y = step; y < rect.bottom(); y += step) { + if (y % (step * 8) != 0) painter->drawLine(rect.left(), y, rect.right(), y); + } + } + + painter->setPen(pen2); + + for (int x = -step*8; x > rect.left(); x -= step*8) { + painter->drawLine(x, rect.top(), x, rect.bottom()); + } + + for (int x = step*8; x < rect.right(); x += step*8) { + painter->drawLine(x, rect.top(), x, rect.bottom()); + } + + for (int y = -step*8; y > rect.top(); y -= step*8) { + painter->drawLine(rect.left(), y, rect.right(), y); + } + + for (int y = step*8; y < rect.bottom(); y += step*8) { + painter->drawLine(rect.left(), y, rect.right(), y); + } + + painter->setPen(pen3); + painter->drawLine(rect.left(), 0, rect.right(), 0); + painter->drawLine(0, rect.top(), 0, rect.bottom()); +} + diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h new file mode 100644 index 0000000..fc3cba4 --- /dev/null +++ b/src/gui/tikzview.h @@ -0,0 +1,32 @@ +/** + * Display a Graph, and manage any user input that purely changes the view (e.g. Zoom). This + * serves as the view in the MVC (TikzDocument, TikzView, TikzScene). + */ + +#ifndef TIKZVIEW_H +#define TIKZVIEW_H + +#include +#include +#include +#include +#include +#include +#include +#include + +class TikzView : public QGraphicsView +{ + Q_OBJECT +public: + explicit TikzView(QWidget *parent = 0); +public slots: + void zoomIn(); + void zoomOut(); +protected: + void drawBackground(QPainter *painter, const QRectF &rect); +private: + float _scale; +}; + +#endif // TIKZVIEW_H diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp new file mode 100644 index 0000000..3c08bce --- /dev/null +++ b/src/gui/toolpalette.cpp @@ -0,0 +1,50 @@ +#include "toolpalette.h" + +#include +#include +#include +#include + +ToolPalette::ToolPalette(QWidget *parent) : + QToolBar(parent) +{ + setWindowFlags(Qt::Window + | Qt::CustomizeWindowHint + | Qt::WindowDoesNotAcceptFocus); + setOrientation(Qt::Vertical); + setFocusPolicy(Qt::NoFocus); + setGeometry(100,200,30,195); + + tools = new QActionGroup(this); + + select = new QAction(QIcon(":/images/select-rectangular.png"), "Select"); + vertex = new QAction(QIcon(":/images/draw-ellipse.png"), "Add Vertex"); + edge = new QAction(QIcon(":/images/draw-path.png"), "Add Edge"); + crop = new QAction(QIcon(":/images/transform-crop-and-resize.png"), "Bounding Box"); + + tools->addAction(select); + tools->addAction(vertex); + tools->addAction(edge); + tools->addAction(crop); + + select->setCheckable(true); + vertex->setCheckable(true); + edge->setCheckable(true); + crop->setCheckable(true); + select->setChecked(true); + + addAction(select); + addAction(vertex); + addAction(edge); + addAction(crop); +} + +ToolPalette::Tool ToolPalette::currentTool() const +{ + QAction *a = tools->checkedAction(); + if (a == vertex) return VERTEX; + else if (a == edge) return EDGE; + else if (a == crop) return CROP; + else return SELECT; +} + diff --git a/src/gui/toolpalette.h b/src/gui/toolpalette.h new file mode 100644 index 0000000..ba6aed5 --- /dev/null +++ b/src/gui/toolpalette.h @@ -0,0 +1,34 @@ +/** + * A small window that lets the user select the current editing tool. + */ + +#ifndef TOOLPALETTE_H +#define TOOLPALETTE_H + +#include +#include +#include +#include + +class ToolPalette : public QToolBar +{ + Q_OBJECT +public: + ToolPalette(QWidget *parent = 0); + enum Tool { + SELECT, + VERTEX, + EDGE, + CROP + }; + + Tool currentTool() const; +private: + QActionGroup *tools; + QAction *select; + QAction *vertex; + QAction *edge; + QAction *crop; +}; + +#endif // TOOLPALETTE_H diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp new file mode 100644 index 0000000..736c258 --- /dev/null +++ b/src/gui/undocommands.cpp @@ -0,0 +1,162 @@ +#include "undocommands.h" +#include "nodeitem.h" +#include "edgeitem.h" + +#include + +MoveCommand::MoveCommand(TikzScene *scene, + QMap oldNodePositions, + QMap newNodePositions, + QUndoCommand *parent) : + QUndoCommand(parent), + _scene(scene), + _oldNodePositions(oldNodePositions), + _newNodePositions(newNodePositions) +{} + + +void MoveCommand::undo() +{ + foreach (NodeItem *ni, _scene->nodeItems()) { + if (_oldNodePositions.contains(ni->node())) { + ni->node()->setPoint(_oldNodePositions.value(ni->node())); + ni->readPos(); + } + } + + _scene->refreshAdjacentEdges(_oldNodePositions.keys()); +} + +void MoveCommand::redo() +{ + foreach (NodeItem *ni, _scene->nodeItems()) { + if (_newNodePositions.contains(ni->node())) { + ni->node()->setPoint(_newNodePositions.value(ni->node())); + ni->readPos(); + } + } + + _scene->refreshAdjacentEdges(_newNodePositions.keys()); +} + +EdgeBendCommand::EdgeBendCommand(TikzScene *scene, Edge *edge, + float oldWeight, int oldBend, + int oldInAngle, int oldOutAngle) : + _scene(scene), _edge(edge), + _oldWeight(oldWeight), _oldBend(oldBend), + _oldInAngle(oldInAngle), _oldOutAngle(oldOutAngle) +{ + _newWeight = edge->weight(); + _newBend = edge->bend(); + _newInAngle = edge->inAngle(); + _newOutAngle = edge->outAngle(); +} + +void EdgeBendCommand::undo() +{ + _edge->setWeight(_oldWeight); + _edge->setBend(_oldBend); + _edge->setInAngle(_oldInAngle); + _edge->setOutAngle(_oldOutAngle); + + foreach(EdgeItem *ei, _scene->edgeItems()) { + if (ei->edge() == _edge) { + ei->readPos(); + break; + } + } +} + +void EdgeBendCommand::redo() +{ + _edge->setWeight(_newWeight); + _edge->setBend(_newBend); + _edge->setInAngle(_newInAngle); + _edge->setOutAngle(_newOutAngle); + + foreach(EdgeItem *ei, _scene->edgeItems()) { + if (ei->edge() == _edge) { + ei->readPos(); + break; + } + } +} + +DeleteCommand::DeleteCommand(TikzScene *scene, + QMap deleteNodes, + QMap deleteEdges, + QSet selEdges) : + _scene(scene), _deleteNodes(deleteNodes), + _deleteEdges(deleteEdges), _selEdges(selEdges) +{} + +void DeleteCommand::undo() +{ + for (auto it = _deleteNodes.begin(); it != _deleteNodes.end(); ++it) { + Node *n = it.value(); + _scene->graph()->addNode(n, it.key()); + NodeItem *ni = new NodeItem(n); + _scene->nodeItems().insert(n, ni); + _scene->addItem(ni); + ni->setSelected(true); + } + + for (auto it = _deleteEdges.begin(); it != _deleteEdges.end(); ++it) { + Edge *e = it.value(); + _scene->graph()->addEdge(e, it.key()); + EdgeItem *ei = new EdgeItem(e); + _scene->edgeItems().insert(e, ei); + _scene->addItem(ei); + + if (_selEdges.contains(e)) ei->setSelected(true); + } +} + +void DeleteCommand::redo() +{ + foreach (Edge *e, _deleteEdges.values()) { + EdgeItem *ei = _scene->edgeItems()[e]; + _scene->edgeItems().remove(e); + _scene->removeItem(ei); + delete ei; + + _scene->graph()->removeEdge(e); + } + + foreach (Node *n, _deleteNodes.values()) { + NodeItem *ni = _scene->nodeItems()[n]; + _scene->nodeItems().remove(n); + _scene->removeItem(ni); + delete ni; + + _scene->graph()->removeNode(n); + } +} + +AddNodeCommand::AddNodeCommand(TikzScene *scene, Node *node, QRectF newBounds) : + _scene(scene), _node(node), _oldBounds(_scene->sceneRect()), _newBounds(newBounds) +{ +} + +void AddNodeCommand::undo() +{ + NodeItem *ni = _scene->nodeItems()[_node]; + _scene->removeItem(ni); + _scene->nodeItems().remove(_node); + delete ni; + + _scene->graph()->removeNode(_node); + + _scene->setBounds(_oldBounds); +} + +void AddNodeCommand::redo() +{ + // TODO: get the current style + _scene->graph()->addNode(_node); + NodeItem *ni = new NodeItem(_node); + _scene->nodeItems().insert(_node, ni); + _scene->addItem(ni); + + _scene->setBounds(_newBounds); +} diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h new file mode 100644 index 0000000..ffff876 --- /dev/null +++ b/src/gui/undocommands.h @@ -0,0 +1,80 @@ +/** + * All changes to a TikzDocument are done via subclasses of QUndoCommand. When a controller + * (e.g. TikzScene) gets input from the user to change the document, it will push one of + * these commands onto the TikzDocument's undo stack, which automatically calls the redo() + * method of the command. + */ + +#ifndef UNDOCOMMANDS_H +#define UNDOCOMMANDS_H + +#include "tikzscene.h" + +#include + +class MoveCommand : public QUndoCommand +{ +public: + explicit MoveCommand(TikzScene *scene, + QMap oldNodePositions, + QMap newNodePositions, + QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + TikzScene *_scene; + QMap _oldNodePositions; + QMap _newNodePositions; +}; + +class EdgeBendCommand : public QUndoCommand +{ +public: + explicit EdgeBendCommand(TikzScene *scene, Edge *edge, + float oldWeight, int oldBend, + int oldInAngle, int oldOutAngle); + void undo() override; + void redo() override; +private: + TikzScene *_scene; + Edge *_edge; + float _oldWeight; + int _oldBend; + int _oldInAngle; + int _oldOutAngle; + float _newWeight; + int _newBend; + int _newInAngle; + int _newOutAngle; +}; + +class DeleteCommand : public QUndoCommand +{ +public: + explicit DeleteCommand(TikzScene *scene, + QMap deleteNodes, + QMap deleteEdges, + QSet selEdges); + void undo() override; + void redo() override; +private: + TikzScene *_scene; + QMap _deleteNodes; + QMap _deleteEdges; + QSet _selEdges; +}; + +class AddNodeCommand : public QUndoCommand +{ +public: + explicit AddNodeCommand(TikzScene *scene, Node *node, QRectF newBounds); + void undo() override; + void redo() override; +private: + TikzScene *_scene; + Node *_node; + QRectF _oldBounds; + QRectF _newBounds; +}; + +#endif // UNDOCOMMANDS_H diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..b676211 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,14 @@ +#include "tikzit.h" + +#include +#include + + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + a.setQuitOnLastWindowClosed(false); + tikzit = new Tikzit(); + + return a.exec(); +} diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp new file mode 100644 index 0000000..56491ed --- /dev/null +++ b/src/test/testmain.cpp @@ -0,0 +1,22 @@ +#include "testtest.h" +#include "testparser.h" +#include "testtikzoutput.h" + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + TestTest test; + TestParser parser; + TestTikzOutput tikzOutput; + int r = QTest::qExec(&test, argc, argv) | + QTest::qExec(&parser, argc, argv) | + QTest::qExec(&tikzOutput, argc, argv); + + if (r == 0) std::cout << "***************** All tests passed! *****************\n"; + else std::cout << "***************** Some tests failed. *****************\n"; + + return r; +} diff --git a/src/test/testparser.cpp b/src/test/testparser.cpp new file mode 100644 index 0000000..e220e2e --- /dev/null +++ b/src/test/testparser.cpp @@ -0,0 +1,163 @@ +#include "testparser.h" +#include "graph.h" +#include "tikzgraphassembler.h" + +#include +#include + +//void TestParser::initTestCase() +//{ + +//} + +//void TestParser::cleanupTestCase() +//{ + +//} + +void TestParser::parseEmptyGraph() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + bool res = ga.parse("\\begin{tikzpicture}\n\\end{tikzpicture}"); + QVERIFY(res); + QVERIFY(g->nodes().size() == 0); + QVERIFY(g->edges().size() == 0); + delete g; +} + +void TestParser::parseNodeGraph() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + bool res = ga.parse( + "\\begin{tikzpicture}\n" + " \\node (node0) at (1.1, -2.2) {};\n" + " \\node (node1) at (3, 4) {test};\n" + "\\end{tikzpicture}"); + QVERIFY(res); + QVERIFY(g->nodes().size() == 2); + QVERIFY(g->edges().size() == 0); + QVERIFY(g->nodes()[0]->name() == "node0"); + QVERIFY(g->nodes()[0]->label() == ""); + QVERIFY(g->nodes()[0]->point() == QPointF(1.1,-2.2)); + QVERIFY(g->nodes()[1]->name() == "node1"); + QVERIFY(g->nodes()[1]->label() == "test"); + QVERIFY(g->nodes()[1]->point() == QPointF(3,4)); + delete g; +} + +void TestParser::parseEdgeGraph() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + bool res = ga.parse( + "\\begin{tikzpicture}\n" + " \\begin{pgfonlayer}{nodelayer}\n" + " \\node [style=x, {foo++}] (0) at (-1, -1) {};\n" + " \\node [style=y] (1) at (0, 1) {};\n" + " \\node [style=z] (2) at (1, -1) {};\n" + " \\end{pgfonlayer}\n" + " \\begin{pgfonlayer}{edgelayer}\n" + " \\draw [style=a] (1.center) to (2);\n" + " \\draw [style=b, foo] (2) to (0.west);\n" + " \\draw [style=c] (0) to (1);\n" + " \\end{pgfonlayer}\n" + "\\end{tikzpicture}\n"); + QVERIFY(res); + QVERIFY(g->nodes().size() == 3); + QVERIFY(g->edges().size() == 3); + QVERIFY(g->nodes()[0]->data()->atom("foo++")); + QVERIFY(g->edges()[0]->data()->property("style") == "a"); + QVERIFY(!g->edges()[0]->data()->atom("foo")); + QVERIFY(g->edges()[1]->data()->property("style") == "b"); + QVERIFY(g->edges()[1]->data()->atom("foo")); + QVERIFY(g->edges()[2]->data()->property("style") == "c"); + Node *en = g->edges()[0]->edgeNode(); + QVERIFY(en == 0); + delete g; +} + +void TestParser::parseEdgeNode() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + bool res = ga.parse( + "\\begin{tikzpicture}\n" + " \\begin{pgfonlayer}{nodelayer}\n" + " \\node [style=none] (0) at (-1, 0) {};\n" + " \\node [style=none] (1) at (1, 0) {};\n" + " \\end{pgfonlayer}\n" + " \\begin{pgfonlayer}{edgelayer}\n" + " \\draw [style=diredge] (0.center) to node[foo, bar=baz baz]{test} (1.center);\n" + " \\end{pgfonlayer}\n" + "\\end{tikzpicture}\n"); + QVERIFY(res); + QVERIFY(g->nodes().size() == 2); + QVERIFY(g->edges().size() == 1); + Node *en = g->edges()[0]->edgeNode(); + QVERIFY(en != 0); + QVERIFY(en->label() == "test"); + QVERIFY(en->data()->atom("foo")); + QVERIFY(en->data()->property("bar") == "baz baz"); + delete g; +} + +void TestParser::parseEdgeBends() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + bool res = ga.parse( + "\\begin{tikzpicture}\n" + " \\begin{pgfonlayer}{nodelayer}\n" + " \\node [style=white] (0) at (-1, 0) {};\n" + " \\node [style=black] (1) at (1, 0) {};\n" + " \\end{pgfonlayer}\n" + " \\begin{pgfonlayer}{edgelayer}\n" + " \\draw [style=diredge,bend left] (0) to (1);\n" + " \\draw [style=diredge,bend right] (0) to (1);\n" + " \\draw [style=diredge,bend left=20] (0) to (1);\n" + " \\draw [style=diredge,bend right=80] (0) to (1);\n" + " \\draw [style=diredge,in=10,out=150,looseness=2] (0) to (1);\n" + " \\end{pgfonlayer}\n" + "\\end{tikzpicture}\n"); + QVERIFY(res); + QVERIFY(g->nodes().size() == 2); + QVERIFY(g->edges().size() == 5); + QVERIFY(g->edges()[0]->bend() == -30); + QVERIFY(g->edges()[1]->bend() == 30); + QVERIFY(g->edges()[2]->bend() == -20); + QVERIFY(g->edges()[3]->bend() == 80); + QVERIFY(g->edges()[4]->inAngle() == 10); + QVERIFY(g->edges()[4]->outAngle() == 150); + QVERIFY(g->edges()[4]->weight() == 2.0f/2.5f); +} + +void TestParser::parseBbox() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + bool res = ga.parse( + "\\begin{tikzpicture}\n" + " \\path [use as bounding box] (-1.5,-1.5) rectangle (1.5,1.5);\n" + " \\begin{pgfonlayer}{nodelayer}\n" + " \\node [style=white dot] (0) at (-1, -1) {};\n" + " \\node [style=white dot] (1) at (0, 1) {};\n" + " \\node [style=white dot] (2) at (1, -1) {};\n" + " \\end{pgfonlayer}\n" + " \\begin{pgfonlayer}{edgelayer}\n" + " \\draw [style=diredge] (1) to (2);\n" + " \\draw [style=diredge] (2) to (0);\n" + " \\draw [style=diredge] (0) to (1);\n" + " \\end{pgfonlayer}\n" + "\\end{tikzpicture}\n"); + QVERIFY(res); + QVERIFY(g->nodes().size() == 3); + QVERIFY(g->edges().size() == 3); + QVERIFY(g->hasBbox()); + QVERIFY(g->bbox() == QRectF(QPointF(-1.5,-1.5), QPointF(1.5,1.5))); + + delete g; +} + + diff --git a/src/test/testparser.h b/src/test/testparser.h new file mode 100644 index 0000000..a40a58f --- /dev/null +++ b/src/test/testparser.h @@ -0,0 +1,18 @@ +#ifndef TESTPARSER_H +#define TESTPARSER_H + +#include + +class TestParser : public QObject +{ + Q_OBJECT +private slots: + void parseEmptyGraph(); + void parseNodeGraph(); + void parseEdgeGraph(); + void parseEdgeNode(); + void parseEdgeBends(); + void parseBbox(); +}; + +#endif // TESTPARSER_H diff --git a/src/test/testtest.cpp b/src/test/testtest.cpp new file mode 100644 index 0000000..59173c0 --- /dev/null +++ b/src/test/testtest.cpp @@ -0,0 +1,10 @@ +#include "testtest.h" + +#include +#include + +void TestTest::initTestCase() { qDebug("initialising test"); } +void TestTest::myFirstTest() { QVERIFY(1 == 1); } +void TestTest::mySecondTest() { QVERIFY(1 != 2); } +void TestTest::cleanupTestCase() { qDebug("cleaning up test"); } + diff --git a/src/test/testtest.h b/src/test/testtest.h new file mode 100644 index 0000000..69a0bc8 --- /dev/null +++ b/src/test/testtest.h @@ -0,0 +1,17 @@ +#ifndef TESTTEST_H +#define TESTTEST_H + +#include +#include + +class TestTest: public QObject +{ + Q_OBJECT +private slots: + void initTestCase(); + void myFirstTest(); + void mySecondTest(); + void cleanupTestCase(); +}; + +#endif // TESTTEST_H diff --git a/src/test/testtikzoutput.cpp b/src/test/testtikzoutput.cpp new file mode 100644 index 0000000..f086786 --- /dev/null +++ b/src/test/testtikzoutput.cpp @@ -0,0 +1,97 @@ +#include "testtikzoutput.h" +#include "graphelementproperty.h" +#include "graphelementdata.h" +#include "graph.h" +#include "tikzgraphassembler.h" + +#include +#include +#include + +void TestTikzOutput::escape() +{ + QVERIFY(GraphElementProperty::tikzEscape("foo") == "foo"); + QVERIFY(GraphElementProperty::tikzEscape("foo'") == "foo'"); + QVERIFY(GraphElementProperty::tikzEscape("foo bar") == "foo bar"); + QVERIFY(GraphElementProperty::tikzEscape("foo.bar") == "foo.bar"); + QVERIFY(GraphElementProperty::tikzEscape("foo-bar") == "foo-bar"); + QVERIFY(GraphElementProperty::tikzEscape("foo >") == "foo >"); + QVERIFY(GraphElementProperty::tikzEscape("foo <") == "foo <"); + QVERIFY(GraphElementProperty::tikzEscape("foo+") == "{foo+}"); + QVERIFY(GraphElementProperty::tikzEscape("foo{bar}") == "{foo{bar}}"); +} + +void TestTikzOutput::data() +{ + GraphElementData d; + QVERIFY(d.tikz() == ""); + d.setAtom("foo"); + QVERIFY(d.tikz() == "[foo]"); + d.setAtom("bar"); + QVERIFY(d.tikz() == "[foo, bar]"); + d.setProperty("foo","bar"); + QVERIFY(d.tikz() == "[foo, bar, foo=bar]"); + d.setAtom("foo+"); + QVERIFY(d.tikz() == "[foo, bar, foo=bar, {foo+}]"); + d.unsetAtom("foo"); + QVERIFY(d.tikz() == "[bar, foo=bar, {foo+}]"); + d.unsetProperty("foo"); + QVERIFY(d.tikz() == "[bar, {foo+}]"); + d.unsetAtom("foo+"); + QVERIFY(d.tikz() == "[bar]"); + d.unsetAtom("bar"); + QVERIFY(d.tikz() == ""); +} + +void TestTikzOutput::graphEmpty() +{ + Graph *g = new Graph(); + + QString tikz = + "\\begin{tikzpicture}\n" + "\\end{tikzpicture}\n"; + QVERIFY(g->tikz() == tikz); + + delete g; +} + +void TestTikzOutput::graphFromTikz() +{ + Graph *g = new Graph(); + TikzGraphAssembler ga(g); + + QString tikz = + "\\begin{tikzpicture}\n" + "\t\\path [use as bounding box] (-1.5,-1.5) rectangle (1.5,1.5);\n" + "\t\\begin{pgfonlayer}{nodelayer}\n" + "\t\t\\node [style=white dot] (0) at (-1, -1) {};\n" + "\t\t\\node [style=white dot] (1) at (0, 1) {};\n" + "\t\t\\node [style=white dot] (2) at (1, -1) {};\n" + "\t\\end{pgfonlayer}\n" + "\t\\begin{pgfonlayer}{edgelayer}\n" + "\t\t\\draw [style=diredge] (1) to (2);\n" + "\t\t\\draw [style=diredge] (2.center) to (0);\n" + "\t\t\\draw [style=diredge] (0) to ();\n" + "\t\\end{pgfonlayer}\n" + "\\end{tikzpicture}\n"; + bool res = ga.parse(tikz); + QVERIFY2(res, "parsed successfully"); + QVERIFY2(g->tikz() == tikz, "produced matching tikz"); + + delete g; +} + +void TestTikzOutput::graphBbox() +{ + Graph *g = new Graph(); + g->setBbox(QRectF(QPointF(-0.75, -0.5), QPointF(0.25, 1))); + + QString tikz = + "\\begin{tikzpicture}\n" + "\t\\path [use as bounding box] (-0.75,-0.5) rectangle (0.25,1);\n" + "\\end{tikzpicture}\n"; + QVERIFY(g->tikz() == tikz); + + + delete g; +} diff --git a/src/test/testtikzoutput.h b/src/test/testtikzoutput.h new file mode 100644 index 0000000..dff1db1 --- /dev/null +++ b/src/test/testtikzoutput.h @@ -0,0 +1,17 @@ +#ifndef TESTTIKZOUTPUT_H +#define TESTTIKZOUTPUT_H + +#include + +class TestTikzOutput : public QObject +{ + Q_OBJECT +private slots: + void escape(); + void data(); + void graphBbox(); + void graphEmpty(); + void graphFromTikz(); +}; + +#endif // TESTTIKZOUTPUT_H diff --git a/src/tikzit.cpp b/src/tikzit.cpp new file mode 100644 index 0000000..42d16e8 --- /dev/null +++ b/src/tikzit.cpp @@ -0,0 +1,105 @@ +#include "tikzit.h" + +#include +#include + +// application-level instance of Tikzit +Tikzit *tikzit; + +// font to use for node labels +QFont Tikzit::LABEL_FONT("Courrier", 9); + +Tikzit::Tikzit() +{ + _mainMenu = new MainMenu(); + + _activeWindow = 0; + QMainWindow *dummy = new QMainWindow(); + + _toolPalette = new ToolPalette(dummy); + _propertyPalette = new PropertyPalette(dummy); + + loadStyles(); + + _toolPalette->show(); + _propertyPalette->show(); + + _windows << new MainWindow(); + _windows[0]->show(); +} + +//QMenuBar *Tikzit::mainMenu() const +//{ +// return _mainMenu; +//} + +ToolPalette *Tikzit::toolPalette() const +{ + return _toolPalette; +} + +PropertyPalette *Tikzit::propertyPalette() const +{ + return _propertyPalette; +} + +void Tikzit::loadStyles() +{ + _nodeStyles << new NodeStyle("black dot", NodeShape::Circle, Qt::black, Qt::black, 1); + _nodeStyles << new NodeStyle("white dot", NodeShape::Circle, Qt::white, Qt::black, 1); + _nodeStyles << new NodeStyle("gray dot", NodeShape::Circle, Qt::gray, Qt::black, 1); +} + +void Tikzit::newDoc() +{ + MainWindow *w = new MainWindow(); + w->show(); + _windows << w; +} + +MainWindow *Tikzit::activeWindow() const +{ + return _activeWindow; +} + +void Tikzit::setActiveWindow(MainWindow *activeWindow) +{ + _activeWindow = activeWindow; +} + +void Tikzit::removeWindow(MainWindow *w) +{ + _windows.removeAll(w); + if (_activeWindow == w) { + if (_windows.isEmpty()) _activeWindow = 0; + else _activeWindow = _windows[0]; + } +} + +NodeStyle *Tikzit::nodeStyle(QString name) +{ + foreach (NodeStyle *s , _nodeStyles) + if (s->name == name) return s; + return noneStyle; //NodeStyle(name, NodeShape::Circle, Qt::white); +} + +void Tikzit::open() +{ + QSettings settings("tikzit", "tikzit"); + QString fileName = QFileDialog::getOpenFileName(0, + tr("Open File"), + settings.value("previous-file-path").toString(), + tr("TiKZ Files (*.tikz)")); + + if (!fileName.isEmpty()) { + if (_windows.size() == 1 && _windows[0]->pristine()) { + _windows[0]->open(fileName); + _windows[0]->show(); + } else { + MainWindow *w = new MainWindow(); + w->show(); + w->open(fileName); + _windows << w; + } + } +} diff --git a/src/tikzit.h b/src/tikzit.h new file mode 100644 index 0000000..deb683e --- /dev/null +++ b/src/tikzit.h @@ -0,0 +1,70 @@ +/** + * Tikzit is the top-level class which maintains the global application state. For convenience, + * it also inherits the main menu. + */ + +#ifndef TIKZIT_H +#define TIKZIT_H + +#include "mainwindow.h" +#include "mainmenu.h" +#include "ui_mainmenu.h" + +#include "toolpalette.h" +#include "propertypalette.h" +#include "nodestyle.h" + +#include +#include +#include +#include +#include +#include + +// Number of pixels between (0,0) and (1,0) at 100% zoom level. This should be +// divisible by 8 to avoid rounding errors with e.g. grid-snapping. +#define GLOBAL_SCALE 80 +#define GLOBAL_SCALEF 80.0f + +inline QPointF toScreen(QPointF src) +{ src.setY(-src.y()); src *= GLOBAL_SCALEF; return src; } + +inline QPointF fromScreen(QPointF src) +{ src.setY(-src.y()); src /= GLOBAL_SCALEF; return src; } + + +class Tikzit : public QObject { + Q_OBJECT +public: + Tikzit(); + ToolPalette *toolPalette() const; + PropertyPalette *propertyPalette() const; + + MainWindow *activeWindow() const; + void setActiveWindow(MainWindow *activeWindow); + void removeWindow(MainWindow *w); + NodeStyle *nodeStyle(QString name); + + static QFont LABEL_FONT; +// Ui::MainMenu *_mainMenuUi; +// QMenuBar *_mainMenu; + + void newDoc(); + void open(); + +private: +// void createMenu(); + void loadStyles(); + + MainMenu *_mainMenu; + ToolPalette *_toolPalette; + PropertyPalette *_propertyPalette; + QVector _windows; + MainWindow *_activeWindow; + QVector _nodeStyles; + +}; + +extern Tikzit *tikzit; + +#endif // TIKZIT_H diff --git a/src/util.cpp b/src/util.cpp new file mode 100644 index 0000000..64716d2 --- /dev/null +++ b/src/util.cpp @@ -0,0 +1,48 @@ +#include "util.h" + +float bezierInterpolate(float dist, float c0, float c1, float c2, float c3) { + float distp = 1 - dist; + return (distp*distp*distp) * c0 + + 3 * (distp*distp) * dist * c1 + + 3 * (dist*dist) * distp * c2 + + (dist*dist*dist) * c3; +} + +QPointF bezierInterpolateFull (float dist, QPointF c0, QPointF c1, QPointF c2, QPointF c3) { + return QPointF(bezierInterpolate (dist, c0.x(), c1.x(), c2.x(), c3.x()), + bezierInterpolate (dist, c0.y(), c1.y(), c2.y(), c3.y())); +} + + +float roundToNearest(float stepSize, float val) { + if (stepSize==0.0f) return val; + else return round(val/stepSize)*stepSize; +} + +float radiansToDegrees (float radians) { + return (radians * 180.0f) / M_PI; +} + +float degreesToRadians(float degrees) { + return (degrees * M_PI) / 180.0f; +} + +int normaliseAngleDeg (int degrees) { + while (degrees > 180) { + degrees -= 360; + } + while (degrees <= -180) { + degrees += 360; + } + return degrees; +} + +float normaliseAngleRad (float rads) { + while (rads > M_PI) { + rads -= 2 * M_PI; + } + while (rads <= -M_PI) { + rads += 2 * M_PI; + } + return rads; +} diff --git a/src/util.h b/src/util.h new file mode 100644 index 0000000..2952214 --- /dev/null +++ b/src/util.h @@ -0,0 +1,24 @@ +/** + * Various utility functions, mostly for mathematical calculation. + */ + +#ifndef UTIL_H +#define UTIL_H + +#include +#include + +// interpolate on a cubic bezier curve +float bezierInterpolate(float dist, float c0, float c1, float c2, float c3); +QPointF bezierInterpolateFull (float dist, QPointF c0, QPointF c1, QPointF c2, QPointF c3); + +// rounding +float roundToNearest(float stepSize, float val); +float radiansToDegrees (float radians); + +// angles +float degreesToRadians(float degrees); +int normaliseAngleDeg (int degrees); +float normaliseAngleRad (float rads); + +#endif // UTIL_H -- cgit v1.2.3 From c2e2f01df42ee690c136c577b37bb307b4e9d64c Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 4 Jan 2018 16:21:10 +0100 Subject: fixed a couple of warnings --- src/data/graphelementdata.cpp | 2 ++ src/gui/edgeitem.cpp | 2 +- src/gui/edgeitem.h | 3 +-- src/gui/propertypalette.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 3ce72c7..41fcbf0 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -86,6 +86,8 @@ QVariant GraphElementData::data(const QModelIndex &index, int role) const QString s = (index.column() == 0) ? p.key() : p.value(); return QVariant(s); } + + return QVariant(); } QVariant GraphElementData::headerData(int section, Qt::Orientation orientation, int role) const diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 497fa07..04ee7b6 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -43,7 +43,7 @@ void EdgeItem::readPos() _cp2Item->setPos(toScreen(_edge->cp2())); } -void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { //QGraphicsPathItem::paint(painter, option, widget); painter->setPen(pen()); diff --git a/src/gui/edgeitem.h b/src/gui/edgeitem.h index b017265..3701372 100644 --- a/src/gui/edgeitem.h +++ b/src/gui/edgeitem.h @@ -19,8 +19,7 @@ class EdgeItem : public QGraphicsPathItem public: EdgeItem(Edge *edge); void readPos(); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); QRectF boundingRect() const; QPainterPath shape() const; Edge *edge() const; diff --git a/src/gui/propertypalette.cpp b/src/gui/propertypalette.cpp index 5fc763f..b06e866 100644 --- a/src/gui/propertypalette.cpp +++ b/src/gui/propertypalette.cpp @@ -21,7 +21,7 @@ PropertyPalette::PropertyPalette(QWidget *parent) : d->setAtom("atom 1"); d->setProperty("key 2", "value 2"); - QModelIndex i = d->index(0,0); + //QModelIndex i = d->index(0,0); ui->treeView->setModel(d); QSettings settings("tikzit", "tikzit"); -- cgit v1.2.3 From ae3f1cfde0626a61c3968a8d797a22ed9fd16175 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 4 Jan 2018 16:24:44 +0100 Subject: removed some build artefacts from repo --- .gitignore | 3 + Makefile | 1139 ------------------ src/data/tikzlexer.lexer.cpp | 2535 ---------------------------------------- src/data/tikzparser.parser.cpp | 1938 ------------------------------ src/data/tikzparser.parser.hpp | 139 --- target_wrapper.sh | 6 - 6 files changed, 3 insertions(+), 5757 deletions(-) delete mode 100644 Makefile delete mode 100644 src/data/tikzlexer.lexer.cpp delete mode 100644 src/data/tikzparser.parser.cpp delete mode 100644 src/data/tikzparser.parser.hpp delete mode 100755 target_wrapper.sh (limited to 'src') diff --git a/.gitignore b/.gitignore index 6f9a00e..98bd6b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ +.qmake.stash build-tikzit-* *.pro.user +Makefile +tikzit.app diff --git a/Makefile b/Makefile deleted file mode 100644 index ff6108f..0000000 --- a/Makefile +++ /dev/null @@ -1,1139 +0,0 @@ -############################################################################# -# Makefile for building: tikzit.app/Contents/MacOS/tikzit -# Generated by qmake (3.0) (Qt 5.7.1) -# Project: tikzit.pro -# Template: app -# Command: /usr/local/bin/qmake -o Makefile tikzit.pro -############################################################################# - -MAKEFILE = Makefile - -####### Compiler, tools and options - -CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DEFINES = -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -CFLAGS = -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -O2 -Wall -W -fPIC $(DEFINES) -CXXFLAGS = -pipe -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -O2 -std=gnu++11 -Wall -W -fPIC $(DEFINES) -INCPATH = -I. -Isrc -Isrc/gui -Isrc/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -F/usr/local/Cellar/qt5/5.7.1_1/lib -QMAKE = /usr/local/bin/qmake -DEL_FILE = rm -f -CHK_DIR_EXISTS= test -d -MKDIR = mkdir -p -COPY = cp -f -COPY_FILE = cp -f -COPY_DIR = cp -f -R -INSTALL_FILE = install -m 644 -p -INSTALL_PROGRAM = install -m 755 -p -INSTALL_DIR = cp -f -R -DEL_FILE = rm -f -SYMLINK = ln -f -s -DEL_DIR = rmdir -MOVE = mv -f -TAR = tar -cf -COMPRESS = gzip -9f -DISTNAME = tikzit1.0.0 -DISTDIR = /Users/alek/git/tikzit/tikzit/.tmp/tikzit1.0.0 -LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -LFLAGS = -headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -LIBS = $(SUBLIBS) -F/usr/local/Cellar/qt5/5.7.1_1/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL -AR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cq -RANLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -s -SED = sed -STRIP = strip - -####### Output directory - -OBJECTS_DIR = ./ - -####### Files - -SOURCES = src/gui/mainwindow.cpp \ - src/gui/toolpalette.cpp \ - src/gui/tikzscene.cpp \ - src/data/graph.cpp \ - src/data/node.cpp \ - src/data/edge.cpp \ - src/data/tikzgraphassembler.cpp \ - src/data/graphelementdata.cpp \ - src/data/graphelementproperty.cpp \ - src/gui/propertypalette.cpp \ - src/main.cpp src/data/tikzlexer.lexer.cpp \ - src/data/tikzparser.parser.cpp \ - qrc_tikzit.cpp \ - moc_mainwindow.cpp \ - moc_toolpalette.cpp \ - moc_graph.cpp \ - moc_node.cpp \ - moc_edge.cpp \ - moc_tikzgraphassembler.cpp \ - moc_graphelementdata.cpp \ - moc_propertypalette.cpp -OBJECTS = mainwindow.o \ - toolpalette.o \ - tikzscene.o \ - graph.o \ - node.o \ - edge.o \ - tikzgraphassembler.o \ - graphelementdata.o \ - graphelementproperty.o \ - propertypalette.o \ - main.o \ - tikzlexer.lexer.o \ - tikzparser.parser.o \ - qrc_tikzit.o \ - moc_mainwindow.o \ - moc_toolpalette.o \ - moc_graph.o \ - moc_node.o \ - moc_edge.o \ - moc_tikzgraphassembler.o \ - moc_graphelementdata.o \ - moc_propertypalette.o -DIST = /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/spec_pre.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/qdevice.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/device_config.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/unix.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/mac.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/macx.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/sanitize.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/gcc-base.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/gcc-base-mac.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/clang.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/clang-mac.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/qconfig.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dcore.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dcore_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dextras.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dextras_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dinput.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dinput_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dlogic.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dlogic_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquick.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquick_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickextras.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickextras_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickinput.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickinput_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickrender.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickrender_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3drender.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3drender_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bluetooth.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bluetooth_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bootstrap_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_charts.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_charts_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_clucene_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_concurrent.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_concurrent_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_core.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_core_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_datavisualization.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_datavisualization_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designer.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designer_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designercomponents_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gamepad.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gamepad_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gui.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gui_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_help.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_help_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_location.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_location_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_macextras.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_macextras_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimedia.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimedia_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimediawidgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimediawidgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_network.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_network_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_nfc.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_nfc_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_opengl.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_opengl_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_openglextensions.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_openglextensions_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_packetprotocol_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_platformsupport_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_positioning.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_positioning_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_printsupport.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_printsupport_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_purchasing.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_purchasing_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qml.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qml_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmldebug_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmldevtools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmltest.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmltest_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quick.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quick_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickcontrols2.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickcontrols2_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickparticles_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quicktemplates2_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickwidgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickwidgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_script.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_script_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scripttools.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scripttools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scxml.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scxml_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sensors.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sensors_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialbus.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialbus_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialport.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialport_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sql.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sql_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_svg.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_svg_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_testlib.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_testlib_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uiplugin.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uitools.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uitools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webchannel.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webchannel_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webengine.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webengine_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecore.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecore_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginewidgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginewidgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_websockets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_websockets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webview.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webview_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_widgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_widgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xml.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xml_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xmlpatterns.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xmlpatterns_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt_functions.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt_config.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang/qmake.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/spec_post.prf \ - .qmake.stash \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/exclusive_builds.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/sdk.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/toolchain.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/toolchain.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/default_pre.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/default_pre.prf \ - flex.pri \ - bison.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resolve_config.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/default_post.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/default_post.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/objective_c.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resolve_target.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/testcase.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/warn_on.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resources.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/moc.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/unix/opengl.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/uic.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/unix/thread.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/file_copies.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/rez.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/asset_catalogs.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/testcase_targets.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/exceptions.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/yacc.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/lex.prf \ - tikzit.pro src/gui/mainwindow.h \ - src/gui/toolpalette.h \ - src/gui/tikzscene.h \ - src/data/graph.h \ - src/data/node.h \ - src/data/edge.h \ - src/data/tikzgraphassembler.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - src/gui/propertypalette.h \ - src/data/tikzparserdefs.h src/gui/mainwindow.cpp \ - src/gui/toolpalette.cpp \ - src/gui/tikzscene.cpp \ - src/data/graph.cpp \ - src/data/node.cpp \ - src/data/edge.cpp \ - src/data/tikzgraphassembler.cpp \ - src/data/graphelementdata.cpp \ - src/data/graphelementproperty.cpp \ - src/gui/propertypalette.cpp \ - src/main.cpp -QMAKE_TARGET = tikzit -DESTDIR = -TARGET = tikzit.app/Contents/MacOS/tikzit - - -first: all -####### Build rules - -$(TARGET): src/data/tikzlexer.lexer.cpp src/data/tikzparser.parser.cpp src/data/tikzparser.parser.hpp ui_mainwindow.h ui_propertypalette.h $(OBJECTS) - @test -d tikzit.app/Contents/MacOS/ || mkdir -p tikzit.app/Contents/MacOS/ - $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) - -Makefile: tikzit.pro /usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang/qmake.conf /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/spec_pre.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/qdevice.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/device_config.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/unix.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/mac.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/macx.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/sanitize.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/gcc-base.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/gcc-base-mac.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/clang.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/clang-mac.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/qconfig.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dcore.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dcore_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dextras.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dextras_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dinput.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dinput_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dlogic.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dlogic_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquick.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquick_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickextras.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickextras_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickinput.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickinput_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickrender.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickrender_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3drender.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3drender_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bluetooth.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bluetooth_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bootstrap_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_charts.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_charts_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_clucene_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_concurrent.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_concurrent_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_core.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_core_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_datavisualization.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_datavisualization_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designer.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designer_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designercomponents_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gamepad.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gamepad_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gui.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gui_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_help.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_help_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_location.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_location_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_macextras.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_macextras_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimedia.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimedia_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimediawidgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimediawidgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_network.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_network_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_nfc.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_nfc_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_opengl.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_opengl_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_openglextensions.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_openglextensions_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_packetprotocol_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_platformsupport_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_positioning.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_positioning_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_printsupport.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_printsupport_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_purchasing.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_purchasing_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qml.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qml_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmldebug_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmldevtools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmltest.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmltest_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quick.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quick_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickcontrols2.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickcontrols2_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickparticles_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quicktemplates2_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickwidgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickwidgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_script.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_script_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scripttools.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scripttools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scxml.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scxml_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sensors.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sensors_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialbus.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialbus_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialport.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialport_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sql.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sql_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_svg.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_svg_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_testlib.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_testlib_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uiplugin.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uitools.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uitools_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webchannel.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webchannel_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webengine.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webengine_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecore.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecore_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginewidgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginewidgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_websockets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_websockets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webview.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webview_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_widgets.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_widgets_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xml.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xml_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xmlpatterns.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xmlpatterns_private.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt_functions.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt_config.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang/qmake.conf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/spec_post.prf \ - .qmake.stash \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/exclusive_builds.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/sdk.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/toolchain.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/toolchain.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/default_pre.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/default_pre.prf \ - flex.pri \ - bison.pri \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resolve_config.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/default_post.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/default_post.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/objective_c.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resolve_target.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/testcase.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/warn_on.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resources.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/moc.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/unix/opengl.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/uic.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/unix/thread.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/file_copies.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/rez.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/asset_catalogs.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/testcase_targets.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/exceptions.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/yacc.prf \ - /usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/lex.prf \ - tikzit.pro \ - tikzit.qrc \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/QtWidgets.prl \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/QtGui.prl \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/QtCore.prl - $(QMAKE) -o Makefile tikzit.pro -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/spec_pre.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/qdevice.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/device_config.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/unix.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/mac.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/macx.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/sanitize.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/gcc-base.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/gcc-base-mac.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/clang.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/common/clang-mac.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/qconfig.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dcore.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dcore_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dextras.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dextras_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dinput.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dinput_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dlogic.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dlogic_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquick.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquick_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickextras.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickextras_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickinput.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickinput_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickrender.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3dquickrender_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3drender.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_3drender_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bluetooth.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bluetooth_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_bootstrap_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_charts.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_charts_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_clucene_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_concurrent.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_concurrent_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_core.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_core_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_datavisualization.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_datavisualization_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designer.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designer_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_designercomponents_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gamepad.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gamepad_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gui.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_gui_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_help.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_help_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_location.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_location_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_macextras.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_macextras_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimedia.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimedia_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimediawidgets.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_multimediawidgets_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_network.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_network_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_nfc.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_nfc_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_opengl.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_opengl_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_openglextensions.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_openglextensions_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_packetprotocol_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_platformsupport_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_positioning.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_positioning_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_printsupport.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_printsupport_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_purchasing.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_purchasing_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qml.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qml_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmldebug_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmldevtools_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmltest.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qmltest_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quick.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quick_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickcontrols2.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickcontrols2_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickparticles_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quicktemplates2_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickwidgets.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_quickwidgets_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_script.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_script_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scripttools.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scripttools_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scxml.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_scxml_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sensors.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sensors_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialbus.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialbus_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialport.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_serialport_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sql.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_sql_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_svg.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_svg_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_testlib.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_testlib_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uiplugin.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uitools.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_uitools_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webchannel.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webchannel_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webengine.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webengine_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecore.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecore_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginewidgets.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webenginewidgets_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_websockets.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_websockets_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webview.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_webview_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_widgets.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_widgets_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xml.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xml_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xmlpatterns.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/modules/qt_lib_xmlpatterns_private.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt_functions.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt_config.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang/qmake.conf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/spec_post.prf: -.qmake.stash: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/exclusive_builds.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/sdk.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/toolchain.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/toolchain.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/default_pre.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/default_pre.prf: -flex.pri: -bison.pri: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resolve_config.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/default_post.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/default_post.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/objective_c.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resolve_target.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/testcase.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/warn_on.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/qt.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/resources.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/moc.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/unix/opengl.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/uic.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/unix/thread.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/file_copies.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/rez.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/mac/asset_catalogs.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/testcase_targets.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/exceptions.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/yacc.prf: -/usr/local/Cellar/qt5/5.7.1_1/mkspecs/features/lex.prf: -tikzit.pro: -tikzit.qrc: -/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/QtWidgets.prl: -/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/QtGui.prl: -/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/QtCore.prl: -qmake: FORCE - @$(QMAKE) -o Makefile tikzit.pro - -qmake_all: FORCE - -tikzit.app/Contents/PkgInfo: - @test -d tikzit.app/Contents || mkdir -p tikzit.app/Contents - @$(DEL_FILE) tikzit.app/Contents/PkgInfo - @echo "APPL????" > tikzit.app/Contents/PkgInfo -tikzit.app/Contents/Resources/empty.lproj: - @test -d tikzit.app/Contents/Resources || mkdir -p tikzit.app/Contents/Resources - @touch tikzit.app/Contents/Resources/empty.lproj - -tikzit.app/Contents/Info.plist: - @test -d tikzit.app/Contents || mkdir -p tikzit.app/Contents - @$(DEL_FILE) tikzit.app/Contents/Info.plist - @sed -e "s,@SHORT_VERSION@,1.0,g" -e "s,@FULL_VERSION@,1.0.0,g" -e "s,@TYPEINFO@,????,g" -e "s,@BUNDLEIDENTIFIER@,com.yourcompany.tikzit,g" -e "s,@ICON@,,g" -e "s,@EXECUTABLE@,tikzit,g" -e "s,@LIBRARY@,tikzit,g" -e "s,@TYPEINFO@,????,g" /usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang/Info.plist.app >tikzit.app/Contents/Info.plist - -all: Makefile \ - tikzit.app/Contents/PkgInfo \ - tikzit.app/Contents/Resources/empty.lproj \ - tikzit.app/Contents/Info.plist $(TARGET) - -dist: distdir FORCE - (cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR) - -distdir: FORCE - @test -d $(DISTDIR) || mkdir -p $(DISTDIR) - $(COPY_FILE) --parents $(DIST) $(DISTDIR)/ - $(COPY_FILE) --parents src/data/tikzlexer.l $(DISTDIR)/ - $(COPY_FILE) --parents src/data/tikzparser.y $(DISTDIR)/ - $(COPY_FILE) --parents src/data/tikzparser.y $(DISTDIR)/ - $(COPY_FILE) --parents tikzit.qrc $(DISTDIR)/ - $(COPY_FILE) --parents src/gui/mainwindow.h src/gui/toolpalette.h src/gui/tikzscene.h src/data/graph.h src/data/node.h src/data/edge.h src/data/tikzgraphassembler.h src/data/graphelementdata.h src/data/graphelementproperty.h src/gui/propertypalette.h src/data/tikzparserdefs.h $(DISTDIR)/ - $(COPY_FILE) --parents src/gui/mainwindow.cpp src/gui/toolpalette.cpp src/gui/tikzscene.cpp src/data/graph.cpp src/data/node.cpp src/data/edge.cpp src/data/tikzgraphassembler.cpp src/data/graphelementdata.cpp src/data/graphelementproperty.cpp src/gui/propertypalette.cpp src/main.cpp $(DISTDIR)/ - $(COPY_FILE) --parents src/gui/mainwindow.ui src/gui/propertypalette.ui $(DISTDIR)/ - - -clean: compiler_clean - -$(DEL_FILE) $(OBJECTS) - -$(DEL_FILE) *~ core *.core - - -distclean: clean - -$(DEL_FILE) -r tikzit.app - -$(DEL_FILE) /Users/alek/git/tikzit/tikzit/target_wrapper.sh .qmake.stash - -$(DEL_FILE) Makefile - - -####### Sub-libraries - -check: first - /Users/alek/git/tikzit/tikzit/target_wrapper.sh $(TESTRUNNER) ./$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET) $(TESTARGS) - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -benchmark: first - -compiler_flex_make_all: src/data/tikzlexer.lexer.cpp -compiler_flex_clean: - -$(DEL_FILE) src/data/tikzlexer.lexer.cpp -src/data/tikzlexer.lexer.cpp: src/data/tikzlexer.l - flex --header-file -o src/data/tikzlexer.lexer.cpp src/data/tikzlexer.l - -compiler_bison_make_all: src/data/tikzparser.parser.cpp -compiler_bison_clean: - -$(DEL_FILE) src/data/tikzparser.parser.cpp -src/data/tikzparser.parser.cpp: src/data/tikzparser.y - bison -d -o src/data/tikzparser.parser.cpp src/data/tikzparser.y - -compiler_bison_header_make_all: src/data/tikzparser.parser.hpp -compiler_bison_header_clean: - -$(DEL_FILE) src/data/tikzparser.parser.hpp -src/data/tikzparser.parser.hpp: src/data/tikzparser.y - bison -d -o src/data/tikzparser.parser.cpp src/data/tikzparser.y - -compiler_rcc_make_all: qrc_tikzit.cpp -compiler_rcc_clean: - -$(DEL_FILE) qrc_tikzit.cpp -qrc_tikzit.cpp: tikzit.qrc \ - /usr/local/Cellar/qt5/5.7.1_1/bin/rcc \ - images/draw-ellipse.png \ - images/transform-crop-and-resize.png \ - images/draw-path.png \ - images/select-rectangular.png - /usr/local/Cellar/qt5/5.7.1_1/bin/rcc -name tikzit tikzit.qrc -o qrc_tikzit.cpp - -compiler_moc_header_make_all: moc_mainwindow.cpp moc_toolpalette.cpp moc_graph.cpp moc_node.cpp moc_edge.cpp moc_tikzgraphassembler.cpp moc_graphelementdata.cpp moc_propertypalette.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc_mainwindow.cpp moc_toolpalette.cpp moc_graph.cpp moc_node.cpp moc_edge.cpp moc_tikzgraphassembler.cpp moc_graphelementdata.cpp moc_propertypalette.cpp -moc_mainwindow.cpp: src/gui/tikzscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qwidget.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsScene \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QMainWindow \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qmainwindow.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsView \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsview.h \ - src/gui/mainwindow.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/gui/mainwindow.h -o moc_mainwindow.cpp - -moc_toolpalette.cpp: /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QToolBar \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qtoolbar.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QAction \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qaction.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QActionGroup \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qactiongroup.h \ - src/gui/toolpalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/gui/toolpalette.h -o moc_toolpalette.cpp - -moc_graph.cpp: src/data/node.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - src/data/edge.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QMultiHash \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qhash.h \ - src/data/graph.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/data/graph.h -o moc_graph.cpp - -moc_node.cpp: src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - src/data/node.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/data/node.h -o moc_node.cpp - -moc_edge.cpp: src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - src/data/edge.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/data/edge.h -o moc_edge.cpp - -moc_tikzgraphassembler.cpp: src/data/node.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - src/data/graph.h \ - src/data/edge.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QMultiHash \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qhash.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QHash \ - src/data/tikzgraphassembler.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/data/tikzgraphassembler.h -o moc_tikzgraphassembler.cpp - -moc_graphelementdata.cpp: src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - src/data/graphelementdata.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/data/graphelementdata.h -o moc_graphelementdata.cpp - -moc_propertypalette.cpp: /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QDockWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qdockwidget.h \ - src/gui/propertypalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/bin/moc - /usr/local/Cellar/qt5/5.7.1_1/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/usr/local/Cellar/qt5/5.7.1_1/mkspecs/macx-clang -I/Users/alek/git/tikzit/tikzit -I/Users/alek/git/tikzit/tikzit/src -I/Users/alek/git/tikzit/tikzit/src/gui -I/Users/alek/git/tikzit/tikzit/src/data -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers -I/usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/usr/local/Cellar/qt5/5.7.1_1/lib src/gui/propertypalette.h -o moc_propertypalette.cpp - -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: ui_mainwindow.h ui_propertypalette.h -compiler_uic_clean: - -$(DEL_FILE) ui_mainwindow.h ui_propertypalette.h -ui_mainwindow.h: src/gui/mainwindow.ui \ - /usr/local/Cellar/qt5/5.7.1_1/bin/uic - /usr/local/Cellar/qt5/5.7.1_1/bin/uic src/gui/mainwindow.ui -o ui_mainwindow.h - -ui_propertypalette.h: src/gui/propertypalette.ui \ - /usr/local/Cellar/qt5/5.7.1_1/bin/uic - /usr/local/Cellar/qt5/5.7.1_1/bin/uic src/gui/propertypalette.ui -o ui_propertypalette.h - -compiler_rez_source_make_all: -compiler_rez_source_clean: -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_flex_clean compiler_bison_clean compiler_bison_header_clean compiler_rcc_clean compiler_moc_header_clean compiler_uic_clean - -####### Compile - -mainwindow.o: src/gui/mainwindow.cpp src/gui/mainwindow.h \ - src/gui/tikzscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qwidget.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsScene \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QMainWindow \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qmainwindow.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsView \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsview.h \ - ui_mainwindow.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QDebug \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qdebug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o src/gui/mainwindow.cpp - -toolpalette.o: src/gui/toolpalette.cpp src/gui/toolpalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QToolBar \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qtoolbar.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QAction \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qaction.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QActionGroup \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qactiongroup.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QLayout \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qlayout.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QVBoxLayout \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qboxlayout.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o toolpalette.o src/gui/toolpalette.cpp - -tikzscene.o: src/gui/tikzscene.cpp src/gui/tikzscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qwidget.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsScene \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsscene.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tikzscene.o src/gui/tikzscene.cpp - -graph.o: src/data/graph.cpp src/data/graph.h \ - src/data/node.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - src/data/edge.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QMultiHash \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qhash.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o graph.o src/data/graph.cpp - -node.o: src/data/node.cpp src/data/node.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QDebug \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qdebug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o node.o src/data/node.cpp - -edge.o: src/data/edge.cpp src/data/edge.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o edge.o src/data/edge.cpp - -tikzgraphassembler.o: src/data/tikzgraphassembler.cpp src/data/tikzgraphassembler.h \ - src/data/node.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - src/data/graph.h \ - src/data/edge.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QMultiHash \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qhash.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QHash - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tikzgraphassembler.o src/data/tikzgraphassembler.cpp - -graphelementdata.o: src/data/graphelementdata.cpp src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QDebug \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qdebug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o graphelementdata.o src/data/graphelementdata.cpp - -graphelementproperty.o: src/data/graphelementproperty.cpp src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o graphelementproperty.o src/data/graphelementproperty.cpp - -propertypalette.o: src/gui/propertypalette.cpp src/gui/propertypalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QDockWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qdockwidget.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - ui_propertypalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QDebug \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qdebug.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers/QCloseEvent \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtGui.framework/Headers/qevent.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QSettings \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qsettings.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o propertypalette.o src/gui/propertypalette.cpp - -main.o: src/main.cpp src/gui/mainwindow.h \ - src/gui/tikzscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qwidget.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsScene \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsscene.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QMainWindow \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qmainwindow.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QGraphicsView \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qgraphicsview.h \ - src/gui/toolpalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QObject \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qobject.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QToolBar \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qtoolbar.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QAction \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qaction.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QActionGroup \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qactiongroup.h \ - src/gui/propertypalette.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QDockWidget \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qdockwidget.h \ - src/data/graph.h \ - src/data/node.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QAbstractItemModel \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qabstractitemmodel.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QString \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qstring.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVariant \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvariant.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QModelIndex \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QVector \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qvector.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QPointF \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qpoint.h \ - src/data/edge.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/QMultiHash \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtCore.framework/Headers/qhash.h \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/QApplication \ - /usr/local/Cellar/qt5/5.7.1_1/lib/QtWidgets.framework/Headers/qapplication.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o src/main.cpp - -tikzlexer.lexer.o: src/data/tikzlexer.lexer.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tikzlexer.lexer.o src/data/tikzlexer.lexer.cpp - -tikzparser.parser.o: src/data/tikzparser.parser.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tikzparser.parser.o src/data/tikzparser.parser.cpp - -qrc_tikzit.o: qrc_tikzit.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_tikzit.o qrc_tikzit.cpp - -moc_mainwindow.o: moc_mainwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp - -moc_toolpalette.o: moc_toolpalette.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_toolpalette.o moc_toolpalette.cpp - -moc_graph.o: moc_graph.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_graph.o moc_graph.cpp - -moc_node.o: moc_node.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_node.o moc_node.cpp - -moc_edge.o: moc_edge.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_edge.o moc_edge.cpp - -moc_tikzgraphassembler.o: moc_tikzgraphassembler.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_tikzgraphassembler.o moc_tikzgraphassembler.cpp - -moc_graphelementdata.o: moc_graphelementdata.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_graphelementdata.o moc_graphelementdata.cpp - -moc_propertypalette.o: moc_propertypalette.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_propertypalette.o moc_propertypalette.cpp - -####### Install - -install_target: first FORCE - @test -d $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit || mkdir -p $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit - $(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit/tikzit.app - - -$(INSTALL_DIR) tikzit.app $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit/tikzit.app - -$(STRIP) $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit/tikzit.app/Contents/MacOS/$(QMAKE_TARGET) - -uninstall_target: FORCE - -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit/tikzit.app - -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/Cellar/qt5/5.7.1_1/tests/tikzit/ - - -install: install_target FORCE - -uninstall: uninstall_target FORCE - -FORCE: - diff --git a/src/data/tikzlexer.lexer.cpp b/src/data/tikzlexer.lexer.cpp deleted file mode 100644 index 7ff1d18..0000000 --- a/src/data/tikzlexer.lexer.cpp +++ /dev/null @@ -1,2535 +0,0 @@ -#line 2 "../tikzit/src/data/tikzlexer.lexer.cpp" - -#line 4 "../tikzit/src/data/tikzlexer.lexer.cpp" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yyg->yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yyg->yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ,yyscanner ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - yy_size_t yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] - -void yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void yypop_buffer_state (yyscan_t yyscanner ); - -static void yyensure_buffer_stack (yyscan_t yyscanner ); -static void yy_load_buffer_state (yyscan_t yyscanner ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); - -void *yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void yyfree (void * ,yyscan_t yyscanner ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -#define yywrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -typedef int yy_state_type; - -#define yytext_ptr yytext_r - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yyg->yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 35 -#define YY_END_OF_BUFFER 36 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[259] = - { 0, - 0, 0, 0, 0, 16, 16, 18, 18, 0, 0, - 36, 34, 2, 1, 1, 25, 33, 14, 20, 34, - 33, 33, 33, 33, 29, 23, 1, 23, 22, 23, - 14, 21, 20, 23, 24, 23, 23, 23, 23, 16, - 34, 16, 19, 17, 18, 34, 18, 27, 2, 1, - 25, 28, 26, 27, 14, 20, 27, 27, 27, 27, - 27, 2, 1, 0, 0, 0, 0, 0, 33, 32, - 32, 32, 32, 32, 32, 12, 33, 33, 13, 23, - 0, 0, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 12, 23, 23, 13, 0, 16, 16, 16, - - 0, 18, 18, 18, 27, 2, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 12, 27, 27, - 13, 0, 15, 0, 0, 0, 0, 0, 32, 32, - 32, 32, 32, 33, 33, 0, 23, 23, 23, 23, - 23, 23, 23, 23, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 0, 0, 32, 32, 31, - 32, 32, 11, 33, 23, 23, 23, 23, 23, 11, - 23, 27, 27, 27, 27, 27, 27, 11, 27, 32, - 7, 0, 8, 9, 33, 23, 7, 8, 9, 23, - 27, 7, 8, 9, 27, 30, 0, 0, 33, 23, - - 23, 27, 27, 0, 0, 0, 33, 23, 27, 0, - 0, 0, 0, 33, 23, 27, 0, 0, 0, 0, - 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 4, 5, 0, 3, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 1, 1, 1, 1, 1, 1, 6, - 7, 1, 1, 8, 9, 10, 1, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 1, 12, 1, - 13, 1, 1, 1, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 15, 16, 17, 1, 1, 1, 18, 19, 20, 21, - - 22, 23, 24, 25, 26, 14, 27, 28, 14, 29, - 30, 31, 14, 32, 14, 33, 34, 14, 35, 14, - 36, 37, 38, 1, 39, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[40] = - { 0, - 1, 1, 2, 1, 1, 1, 3, 4, 1, 3, - 5, 1, 4, 5, 1, 1, 4, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 2, 1 - } ; - -static yyconst flex_int16_t yy_base[265] = - { 0, - 0, 0, 39, 0, 70, 73, 105, 137, 175, 0, - 694, 896, 83, 896, 688, 81, 0, 896, 896, 74, - 655, 656, 663, 653, 896, 92, 96, 213, 896, 224, - 102, 896, 104, 263, 896, 302, 87, 88, 89, 113, - 671, 115, 896, 896, 117, 670, 119, 0, 129, 675, - 127, 896, 896, 341, 0, 0, 380, 419, 109, 118, - 119, 148, 896, 149, 156, 163, 664, 227, 0, 0, - 651, 639, 641, 639, 650, 0, 646, 646, 0, 167, - 214, 457, 239, 240, 250, 630, 294, 300, 450, 305, - 464, 478, 627, 233, 67, 625, 645, 145, 643, 246, - - 642, 322, 639, 327, 0, 215, 354, 361, 368, 432, - 613, 425, 482, 495, 499, 512, 526, 609, 238, 319, - 607, 549, 896, 450, 628, 556, 238, 440, 614, 614, - 600, 599, 585, 586, 574, 468, 527, 549, 563, 543, - 567, 580, 318, 573, 605, 612, 619, 369, 612, 626, - 606, 630, 643, 322, 572, 157, 473, 578, 568, 562, - 575, 570, 0, 575, 658, 671, 688, 682, 708, 558, - 100, 323, 721, 734, 751, 693, 771, 557, 287, 558, - 0, 336, 0, 0, 554, 745, 756, 776, 782, 247, - 787, 793, 798, 804, 354, 541, 553, 550, 551, 817, - - 229, 837, 277, 408, 546, 526, 524, 405, 459, 527, - 524, 519, 509, 518, 396, 431, 516, 510, 507, 494, - 0, 490, 489, 489, 478, 484, 484, 479, 475, 487, - 482, 470, 465, 454, 456, 470, 457, 453, 440, 427, - 417, 417, 398, 404, 388, 351, 353, 329, 328, 896, - 309, 209, 205, 896, 896, 131, 896, 896, 136, 97, - 875, 880, 885, 890 - } ; - -static yyconst flex_int16_t yy_def[265] = - { 0, - 258, 1, 258, 3, 1, 1, 1, 1, 258, 9, - 258, 258, 258, 258, 258, 258, 259, 258, 258, 260, - 259, 259, 259, 259, 258, 261, 261, 261, 258, 262, - 261, 258, 261, 258, 258, 262, 36, 36, 36, 258, - 258, 259, 258, 258, 258, 258, 259, 263, 263, 263, - 263, 258, 258, 264, 263, 263, 258, 264, 58, 58, - 58, 258, 258, 258, 258, 258, 258, 258, 259, 260, - 260, 260, 260, 260, 260, 259, 259, 259, 259, 261, - 261, 261, 261, 261, 261, 36, 34, 34, 34, 34, - 34, 34, 36, 36, 36, 36, 258, 258, 258, 259, - - 258, 258, 258, 259, 263, 263, 263, 263, 263, 263, - 58, 57, 57, 57, 57, 57, 57, 58, 58, 58, - 58, 258, 258, 258, 258, 258, 258, 258, 260, 260, - 260, 260, 260, 259, 259, 261, 261, 34, 34, 34, - 34, 34, 36, 36, 263, 263, 263, 263, 57, 57, - 57, 57, 57, 58, 58, 258, 258, 260, 260, 260, - 260, 260, 259, 259, 34, 34, 34, 34, 34, 36, - 36, 263, 57, 57, 57, 57, 57, 58, 58, 260, - 260, 258, 260, 260, 259, 34, 34, 34, 34, 36, - 57, 57, 57, 57, 58, 260, 258, 258, 259, 34, - - 36, 57, 58, 258, 258, 258, 259, 36, 58, 258, - 258, 258, 258, 259, 36, 58, 258, 258, 258, 258, - 259, 36, 58, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 0, 258, 258, - 258, 258, 258, 258 - } ; - -static yyconst flex_int16_t yy_nxt[936] = - { 0, - 12, 13, 14, 15, 13, 16, 12, 12, 12, 12, - 17, 18, 12, 17, 19, 20, 12, 21, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 22, 17, - 17, 23, 24, 17, 17, 17, 17, 25, 12, 26, - 13, 14, 27, 13, 28, 26, 29, 26, 26, 30, - 31, 32, 30, 33, 34, 35, 36, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 37, 30, 30, - 38, 39, 30, 30, 30, 30, 25, 26, 40, 41, - 42, 40, 41, 42, 62, 64, 144, 62, 65, 66, - 67, 68, 71, 81, 72, 73, 81, 81, 63, 86, - - 81, 70, 74, 81, 75, 81, 81, 12, 81, 95, - 12, 43, 44, 45, 46, 47, 94, 190, 96, 86, - 86, 86, 97, 98, 97, 100, 101, 102, 101, 104, - 106, 107, 86, 106, 108, 109, 67, 110, 119, 120, - 69, 111, 12, 43, 44, 45, 46, 47, 121, 62, - 111, 111, 62, 64, 97, 98, 65, 66, 67, 68, - 122, 156, 123, 123, 124, 125, 126, 127, 81, 257, - 65, 81, 67, 68, 12, 48, 49, 14, 50, 49, - 51, 52, 48, 48, 53, 54, 55, 48, 54, 56, - 57, 48, 58, 54, 54, 54, 54, 54, 54, 54, - - 54, 54, 54, 59, 54, 54, 60, 61, 54, 54, - 54, 54, 12, 48, 81, 81, 106, 82, 81, 106, - 65, 83, 84, 85, 80, 81, 256, 80, 81, 80, - 80, 127, 80, 80, 65, 80, 67, 68, 80, 80, - 81, 81, 127, 136, 81, 65, 65, 255, 84, 85, - 137, 81, 208, 143, 136, 97, 100, 65, 154, 84, - 85, 86, 80, 80, 81, 86, 80, 81, 80, 80, - 111, 80, 80, 87, 80, 201, 87, 80, 80, 86, - 87, 88, 87, 89, 90, 87, 87, 87, 87, 87, - 87, 91, 87, 92, 87, 87, 87, 87, 87, 87, - - 209, 80, 80, 81, 195, 80, 81, 80, 80, 111, - 80, 80, 87, 80, 87, 87, 80, 80, 87, 111, - 87, 138, 87, 87, 87, 87, 87, 172, 87, 123, - 87, 101, 102, 140, 93, 87, 101, 104, 155, 170, - 80, 105, 105, 178, 105, 105, 105, 254, 105, 105, - 86, 111, 105, 105, 111, 105, 105, 105, 107, 253, - 252, 108, 109, 67, 110, 145, 197, 123, 198, 146, - 125, 147, 148, 148, 251, 108, 108, 67, 110, 105, - 105, 105, 203, 105, 105, 105, 111, 105, 105, 250, - 112, 105, 105, 112, 105, 105, 105, 112, 113, 112, - - 114, 115, 112, 112, 112, 112, 112, 112, 116, 112, - 117, 112, 112, 112, 112, 112, 112, 222, 105, 105, - 105, 249, 105, 105, 105, 248, 105, 105, 86, 247, - 105, 105, 215, 105, 105, 105, 148, 86, 210, 108, - 211, 67, 110, 112, 127, 112, 112, 65, 246, 245, - 128, 118, 223, 112, 156, 112, 123, 105, 81, 125, - 126, 82, 244, 111, 65, 83, 84, 85, 87, 81, - 87, 87, 136, 243, 242, 65, 241, 156, 87, 123, - 87, 139, 87, 157, 87, 87, 216, 240, 239, 238, - 237, 111, 87, 141, 87, 142, 87, 236, 87, 87, - - 112, 235, 112, 149, 234, 233, 87, 232, 87, 231, - 112, 230, 112, 112, 229, 112, 112, 112, 228, 112, - 112, 111, 86, 112, 227, 112, 150, 151, 81, 112, - 112, 136, 112, 112, 65, 226, 225, 137, 224, 221, - 112, 152, 112, 153, 112, 220, 112, 112, 219, 218, - 217, 214, 213, 122, 112, 123, 112, 124, 125, 126, - 156, 87, 123, 167, 87, 125, 126, 87, 212, 87, - 87, 87, 165, 87, 207, 206, 205, 87, 204, 87, - 166, 87, 199, 87, 87, 87, 196, 168, 87, 111, - 86, 87, 185, 87, 184, 87, 183, 87, 87, 182, - - 87, 87, 181, 180, 179, 171, 164, 163, 87, 145, - 87, 123, 169, 146, 125, 147, 172, 162, 123, 161, - 160, 125, 147, 172, 112, 123, 175, 112, 125, 147, - 112, 159, 112, 112, 112, 173, 112, 158, 157, 111, - 112, 111, 112, 174, 112, 111, 112, 112, 112, 103, - 176, 112, 103, 99, 112, 99, 112, 86, 112, 86, - 112, 112, 86, 112, 112, 135, 134, 133, 132, 131, - 130, 112, 129, 112, 128, 177, 87, 63, 87, 87, - 103, 99, 79, 186, 78, 77, 87, 76, 87, 87, - 63, 87, 87, 258, 258, 258, 258, 258, 258, 87, - - 87, 87, 87, 188, 258, 187, 87, 258, 87, 87, - 87, 112, 87, 112, 193, 258, 87, 258, 87, 258, - 258, 112, 258, 112, 258, 182, 87, 258, 87, 87, - 258, 258, 189, 258, 258, 258, 87, 258, 87, 112, - 258, 112, 112, 258, 258, 258, 191, 258, 258, 112, - 258, 112, 112, 258, 112, 112, 258, 258, 258, 258, - 258, 258, 112, 87, 112, 87, 87, 258, 192, 112, - 258, 112, 112, 200, 87, 87, 87, 87, 258, 112, - 258, 112, 258, 258, 87, 258, 87, 258, 182, 112, - 258, 112, 112, 258, 87, 194, 87, 87, 258, 112, - - 87, 112, 87, 87, 87, 112, 87, 112, 112, 258, - 87, 112, 87, 112, 112, 202, 112, 112, 112, 112, - 258, 112, 112, 112, 112, 112, 112, 258, 112, 258, - 258, 258, 112, 258, 112, 87, 258, 87, 87, 258, - 258, 258, 258, 258, 258, 87, 258, 87, 258, 258, - 258, 258, 258, 258, 204, 112, 258, 112, 112, 258, - 258, 258, 258, 258, 258, 112, 258, 112, 258, 258, - 258, 258, 258, 258, 204, 80, 258, 80, 258, 80, - 86, 258, 86, 258, 86, 105, 258, 258, 105, 105, - 111, 258, 258, 111, 111, 11, 258, 258, 258, 258, - - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258 - } ; - -static yyconst flex_int16_t yy_chk[936] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, - 5, 6, 6, 6, 13, 16, 95, 13, 16, 16, - 16, 16, 20, 26, 20, 20, 26, 27, 27, 95, - - 27, 260, 20, 31, 20, 33, 31, 5, 33, 38, - 6, 7, 7, 7, 7, 7, 37, 171, 39, 37, - 38, 39, 40, 40, 42, 42, 45, 45, 47, 47, - 49, 51, 171, 49, 51, 51, 51, 51, 59, 60, - 259, 59, 7, 8, 8, 8, 8, 8, 61, 62, - 60, 61, 62, 64, 98, 98, 64, 64, 64, 64, - 65, 156, 65, 156, 65, 65, 65, 66, 80, 256, - 66, 80, 66, 66, 8, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 28, 81, 106, 28, 81, 106, - 28, 28, 28, 28, 30, 30, 253, 30, 30, 30, - 30, 68, 30, 30, 68, 30, 68, 68, 30, 30, - 83, 84, 127, 83, 84, 127, 83, 252, 83, 83, - 84, 85, 201, 94, 85, 100, 100, 85, 119, 85, - 85, 201, 30, 34, 34, 94, 34, 34, 34, 34, - 119, 34, 34, 34, 34, 190, 34, 34, 34, 190, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - - 203, 34, 36, 36, 179, 36, 36, 36, 36, 203, - 36, 36, 87, 36, 87, 87, 36, 36, 88, 179, - 88, 88, 87, 90, 87, 90, 90, 172, 88, 172, - 88, 102, 102, 90, 36, 90, 104, 104, 120, 143, - 36, 54, 54, 154, 54, 54, 54, 251, 54, 54, - 143, 120, 54, 54, 154, 54, 54, 54, 107, 249, - 248, 107, 107, 107, 107, 108, 182, 108, 182, 108, - 108, 108, 109, 148, 247, 109, 148, 109, 109, 54, - 57, 57, 195, 57, 57, 57, 195, 57, 57, 246, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 215, 57, 58, - 58, 245, 58, 58, 58, 244, 58, 58, 215, 243, - 58, 58, 208, 58, 58, 58, 110, 208, 204, 110, - 204, 110, 110, 112, 128, 112, 112, 128, 242, 241, - 128, 58, 216, 112, 124, 112, 124, 58, 82, 124, - 124, 82, 240, 216, 82, 82, 82, 82, 89, 136, - 89, 89, 136, 239, 238, 136, 237, 157, 89, 157, - 89, 89, 91, 157, 91, 91, 209, 236, 235, 234, - 233, 209, 91, 91, 91, 92, 92, 232, 92, 92, - - 113, 231, 113, 113, 230, 229, 92, 228, 92, 227, - 113, 226, 113, 114, 225, 114, 114, 115, 224, 115, - 115, 223, 222, 114, 220, 114, 114, 115, 137, 115, - 116, 137, 116, 116, 137, 219, 218, 137, 217, 214, - 116, 116, 116, 117, 117, 213, 117, 117, 212, 211, - 210, 207, 206, 122, 117, 122, 117, 122, 122, 122, - 126, 140, 126, 140, 140, 126, 126, 138, 205, 138, - 138, 140, 138, 140, 199, 198, 197, 138, 196, 138, - 139, 139, 185, 139, 139, 141, 180, 141, 141, 178, - 170, 139, 164, 139, 162, 141, 161, 141, 142, 160, - - 142, 142, 159, 158, 155, 144, 135, 134, 142, 145, - 142, 145, 142, 145, 145, 145, 146, 133, 146, 132, - 131, 146, 146, 147, 151, 147, 151, 151, 147, 147, - 149, 130, 149, 149, 151, 149, 151, 129, 125, 121, - 149, 118, 149, 150, 150, 111, 150, 150, 152, 103, - 152, 152, 101, 99, 150, 97, 150, 96, 152, 93, - 152, 153, 86, 153, 153, 78, 77, 75, 74, 73, - 72, 153, 71, 153, 67, 153, 165, 50, 165, 165, - 46, 41, 24, 165, 23, 22, 165, 21, 165, 166, - 15, 166, 166, 11, 0, 0, 0, 0, 0, 166, - - 168, 166, 168, 168, 0, 166, 167, 0, 167, 167, - 168, 176, 168, 176, 176, 0, 167, 0, 167, 0, - 0, 176, 0, 176, 0, 167, 169, 0, 169, 169, - 0, 0, 169, 0, 0, 0, 169, 0, 169, 173, - 0, 173, 173, 0, 0, 0, 173, 0, 0, 173, - 0, 173, 174, 0, 174, 174, 0, 0, 0, 0, - 0, 0, 174, 186, 174, 186, 186, 0, 174, 175, - 0, 175, 175, 186, 187, 186, 187, 187, 0, 175, - 0, 175, 0, 0, 187, 0, 187, 0, 175, 177, - 0, 177, 177, 0, 188, 177, 188, 188, 0, 177, - - 189, 177, 189, 189, 188, 191, 188, 191, 191, 0, - 189, 192, 189, 192, 192, 191, 193, 191, 193, 193, - 0, 192, 194, 192, 194, 194, 193, 0, 193, 0, - 0, 0, 194, 0, 194, 200, 0, 200, 200, 0, - 0, 0, 0, 0, 0, 200, 0, 200, 0, 0, - 0, 0, 0, 0, 200, 202, 0, 202, 202, 0, - 0, 0, 0, 0, 0, 202, 0, 202, 0, 0, - 0, 0, 0, 0, 202, 261, 0, 261, 0, 261, - 262, 0, 262, 0, 262, 263, 0, 0, 263, 263, - 264, 0, 0, 264, 264, 258, 258, 258, 258, 258, - - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258 - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[36] = - { 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "../tikzit/src/data/tikzlexer.l" -#line 2 "../tikzit/src/data/tikzlexer.l" -/* - * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger - * Copyright 2013 K. Johan Paulsson - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "tikzparserdefs.h" -#include "tikzparser.parser.hpp" - -#include - - -#define YY_USER_ACTION \ - yylloc->first_line = yylloc->last_line; \ - yylloc->first_column = yylloc->last_column + 1; \ - yylloc->last_column = yylloc->first_column + yyleng - 1; - - - - - -#line 776 "../tikzit/src/data/tikzlexer.lexer.cpp" - -#define INITIAL 0 -#define props 1 -#define xcoord 2 -#define ycoord 3 -#define noderef 4 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#define YY_EXTRA_TYPE TikzGraphAssembler * - -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - YYLTYPE * yylloc_r; - - }; /* end struct yyguts_t */ - -static int yy_init_globals (yyscan_t yyscanner ); - - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - - # define yylloc yyg->yylloc_r - -int yylex_init (yyscan_t* scanner); - -int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy (yyscan_t yyscanner ); - -int yyget_debug (yyscan_t yyscanner ); - -void yyset_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *yyget_in (yyscan_t yyscanner ); - -void yyset_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *yyget_out (yyscan_t yyscanner ); - -void yyset_out (FILE * out_str ,yyscan_t yyscanner ); - -yy_size_t yyget_leng (yyscan_t yyscanner ); - -char *yyget_text (yyscan_t yyscanner ); - -int yyget_lineno (yyscan_t yyscanner ); - -void yyset_lineno (int line_number ,yyscan_t yyscanner ); - -YYSTYPE * yyget_lval (yyscan_t yyscanner ); - -void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - - YYLTYPE *yyget_lloc (yyscan_t yyscanner ); - - void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (yyscan_t yyscanner ); -#else -extern int yywrap (yyscan_t yyscanner ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); -#else -static int input (yyscan_t yyscanner ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - yy_size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); - -#define YY_DECL int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - -#line 49 "../tikzit/src/data/tikzlexer.l" - - - /* whitespace is ignored, except for position counting; we don't - count formfeed and vtab as whitespace, because it's not obvious - how they should be dealt with and no-one actually uses them */ - - /* lex will take the longest-matching string */ -#line 1025 "../tikzit/src/data/tikzlexer.lexer.cpp" - - yylval = yylval_param; - - yylloc = yylloc_param; - - if ( !yyg->yy_init ) - { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - yy_load_buffer_state(yyscanner ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yyg->yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 259 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 896 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - yy_size_t yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - - do{ yylineno++; - yycolumn=0; - }while(0) -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -#line 56 "../tikzit/src/data/tikzlexer.l" -{ - yylloc->first_line += 1; - yylloc->last_line = yylloc->first_line; - yylloc->first_column = yylloc->last_column = 0; -} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 61 "../tikzit/src/data/tikzlexer.l" -{ } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 63 "../tikzit/src/data/tikzlexer.l" -{ return BEGIN_TIKZPICTURE_CMD; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 64 "../tikzit/src/data/tikzlexer.l" -{ return END_TIKZPICTURE_CMD; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 65 "../tikzit/src/data/tikzlexer.l" -{ return BEGIN_PGFONLAYER_CMD; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 66 "../tikzit/src/data/tikzlexer.l" -{ return END_PGFONLAYER_CMD; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 67 "../tikzit/src/data/tikzlexer.l" -{ return DRAW_CMD; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 68 "../tikzit/src/data/tikzlexer.l" -{ return NODE_CMD; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 69 "../tikzit/src/data/tikzlexer.l" -{ return PATH_CMD; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 70 "../tikzit/src/data/tikzlexer.l" -{ return RECTANGLE; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 71 "../tikzit/src/data/tikzlexer.l" -{ return NODE; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 72 "../tikzit/src/data/tikzlexer.l" -{ return AT; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 73 "../tikzit/src/data/tikzlexer.l" -{ return TO; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 74 "../tikzit/src/data/tikzlexer.l" -{ return SEMICOLON; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 76 "../tikzit/src/data/tikzlexer.l" -{ - yylloc->last_column = yylloc->first_column + 1; - yyless(1); - BEGIN(xcoord); -} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 81 "../tikzit/src/data/tikzlexer.l" -{ - yylval->pt = new QPointF(); - yylval->pt->setX(strtod(yytext,NULL)); - BEGIN(ycoord); -} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 86 "../tikzit/src/data/tikzlexer.l" -{ } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 87 "../tikzit/src/data/tikzlexer.l" -{ - yylval->pt->setY(strtod(yytext,NULL)); -} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 90 "../tikzit/src/data/tikzlexer.l" -{ - BEGIN(INITIAL); - return COORD; -} - YY_BREAK -/* when we see "[", change parsing mode */ -case 20: -YY_RULE_SETUP -#line 96 "../tikzit/src/data/tikzlexer.l" -/*syntaxhlfix]*/ { - BEGIN(props); - return LEFTBRACKET; -} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 100 "../tikzit/src/data/tikzlexer.l" -{ return EQUALS; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 101 "../tikzit/src/data/tikzlexer.l" -{ return COMMA; } - YY_BREAK -/* technically, it is possible to have newlines in the middle of - property names or values, but in practice this is unlikely and - screws up our line counting */ -case 23: -YY_RULE_SETUP -#line 105 "../tikzit/src/data/tikzlexer.l" -{ - char *str = (char*)malloc(sizeof(char)*yyleng + 1); - strncpy(str, yytext, yyleng + 1); - yylval->str = str; - return PROPSTRING; -} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 111 "../tikzit/src/data/tikzlexer.l" -{ - BEGIN(INITIAL); - return RIGHTBRACKET; -} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 116 "../tikzit/src/data/tikzlexer.l" -{ - BEGIN(noderef); - return LEFTPARENTHESIS; -} - YY_BREAK -case 26: -YY_RULE_SETUP -#line 120 "../tikzit/src/data/tikzlexer.l" -{ - return FULLSTOP; -} - YY_BREAK -/* we assume node names (and anchor names) never contain - newlines */ -case 27: -YY_RULE_SETUP -#line 125 "../tikzit/src/data/tikzlexer.l" -{ - //qDebug() << "nodename: " << yytext << " size: " << strlen(yytext); - char *str = (char*)malloc(sizeof(char)*yyleng + 1); - strncpy(str, yytext, yyleng+1); - yylval->str = str; - return REFSTRING; -} - YY_BREAK -case 28: -YY_RULE_SETUP -#line 132 "../tikzit/src/data/tikzlexer.l" -{ - BEGIN(INITIAL); - return RIGHTPARENTHESIS; -} - YY_BREAK -case 29: -YY_RULE_SETUP -#line 137 "../tikzit/src/data/tikzlexer.l" -{ - std::stringstream buf; - unsigned int brace_depth = 1; - unsigned int escape = 0; - while (1) { - char c = yyinput(yyscanner); - // eof reached before closing brace - if (c == '\0' || c == EOF) { - return UNCLOSED_DELIM_STR; - } - - yylloc->last_column += 1; - yyleng += 1; - if (escape) { - escape = 0; - } else if (c == '\\') { - escape = 1; - } else if (c == '{') { - brace_depth++; - } else if (c == '}') { - brace_depth--; - if (brace_depth == 0) break; - } else if (c == '\n') { - yylloc->last_line += 1; - yylloc->last_column = 0; - } - buf << c; - } - - char *str = (char*)malloc(sizeof(char) * yyleng + 1); - strncpy(str, buf.str().c_str(), yyleng + 1); - //str[len] = 0; - yylval->str = str; - //qDebug() << "got delim string: " << str; - return DELIMITEDSTRING; -} - YY_BREAK -case 30: -YY_RULE_SETUP -#line 174 "../tikzit/src/data/tikzlexer.l" -{ return UNKNOWN_BEGIN_CMD; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 175 "../tikzit/src/data/tikzlexer.l" -{ return UNKNOWN_END_CMD; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 176 "../tikzit/src/data/tikzlexer.l" -{ return UNKNOWN_CMD; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 177 "../tikzit/src/data/tikzlexer.l" -{ return UNKNOWN_STR; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 178 "../tikzit/src/data/tikzlexer.l" -{ return UNKNOWN_STR; } - YY_BREAK -/* vi:ft=lex:noet:ts=4:sts=4:sw=4: - */ -case 35: -YY_RULE_SETUP -#line 182 "../tikzit/src/data/tikzlexer.l" -ECHO; - YY_BREAK -#line 1385 "../tikzit/src/data/tikzlexer.lexer.cpp" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(props): -case YY_STATE_EOF(xcoord): -case YY_STATE_EOF(ycoord): -case YY_STATE_EOF(noderef): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yyg->yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_END_OF_FILE: - { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( yywrap(yyscanner ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if ( yyg->yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ,yyscanner); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_current_state = yyg->yy_start; - - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 259 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) -{ - register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 259 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 258); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) -#else - static int input (yyscan_t yyscanner) -#endif - -{ - int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else - { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; - ++yyg->yy_c_buf_p; - - switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap(yyscanner ) ) - return 0; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(yyscanner); -#else - return input(yyscanner); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; - - if ( c == '\n' ) - - do{ yylineno++; - yycolumn=0; - }while(0) -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * @param yyscanner The scanner object. - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - yy_load_buffer_state(yyscanner ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * @param yyscanner The scanner object. - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (yyscanner); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(yyscanner ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; -} - -static void yy_load_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - yyg->yy_hold_char = *yyg->yy_c_buf_p; -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ,yyscanner); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * @param yyscanner The scanner object. - */ - void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ,yyscanner ); - - yyfree((void *) b ,yyscanner ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) - -{ - int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_flush_buffer(b ,yyscanner); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. - */ - void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state(yyscanner ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * @param yyscanner The scanner object. - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(yyscanner); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * @param yyscanner The scanner object. - */ -void yypop_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (yyscan_t yyscanner) -{ - yy_size_t num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (!yyg->yy_buffer_stack) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); - yyg->yy_buffer_stack_max = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ,yyscanner ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n, i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ,yyscanner ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ,yyscanner); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the user-defined data for this scanner. - * @param yyscanner The scanner object. - */ -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; -} - -/** Get the current line number. - * @param yyscanner The scanner object. - */ -int yyget_lineno (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; -} - -/** Get the current column number. - * @param yyscanner The scanner object. - */ -int yyget_column (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; -} - -/** Get the input stream. - * @param yyscanner The scanner object. - */ -FILE *yyget_in (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; -} - -/** Get the output stream. - * @param yyscanner The scanner object. - */ -FILE *yyget_out (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; -} - -/** Get the length of the current token. - * @param yyscanner The scanner object. - */ -yy_size_t yyget_leng (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; -} - -/** Get the current token. - * @param yyscanner The scanner object. - */ - -char *yyget_text (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; -} - -/** Set the user-defined data. This data is never touched by the scanner. - * @param user_defined The data to be associated with this scanner. - * @param yyscanner The scanner object. - */ -void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; -} - -/** Set the current line number. - * @param line_number - * @param yyscanner The scanner object. - */ -void yyset_lineno (int line_number , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; -} - -/** Set the current column. - * @param line_number - * @param yyscanner The scanner object. - */ -void yyset_column (int column_no , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "yyset_column called with no buffer" , yyscanner); - - yycolumn = column_no; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * @param yyscanner The scanner object. - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; -} - -void yyset_out (FILE * out_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; -} - -int yyget_debug (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; -} - -void yyset_debug (int bdebug , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; -} - -/* Accessor methods for yylval and yylloc */ - -YYSTYPE * yyget_lval (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; -} - -void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; -} - -YYLTYPE *yyget_lloc (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylloc; -} - -void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylloc = yylloc_param; -} - -/* User-visible API */ - -/* yylex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ - -int yylex_init(yyscan_t* ptr_yy_globals) - -{ - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* yylex_init_extra has the same functionality as yylex_init, but follows the - * convention of taking the scanner as the last argument. Note however, that - * this is a *pointer* to a scanner, as it will be allocated by this call (and - * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to yyalloc in - * the yyextra field. - */ - -int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - -{ - struct yyguts_t dummy_yyguts; - - yyset_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - yyset_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); -} - -static int yy_init_globals (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(yyscanner); - } - - /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack ,yyscanner); - yyg->yy_buffer_stack = NULL; - - /* Destroy the start condition stack. */ - yyfree(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( yyscanner); - - /* Destroy the main struct (reentrant only). */ - yyfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size , yyscan_t yyscanner) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr , yyscan_t yyscanner) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 182 "../tikzit/src/data/tikzlexer.l" diff --git a/src/data/tikzparser.parser.cpp b/src/data/tikzparser.parser.cpp deleted file mode 100644 index 7d77d0c..0000000 --- a/src/data/tikzparser.parser.cpp +++ /dev/null @@ -1,1938 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Using locations. */ -#define YYLSP_NEEDED 1 - - - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEGIN_TIKZPICTURE_CMD = 258, - END_TIKZPICTURE_CMD = 259, - BEGIN_PGFONLAYER_CMD = 260, - END_PGFONLAYER_CMD = 261, - DRAW_CMD = 262, - NODE_CMD = 263, - PATH_CMD = 264, - RECTANGLE = 265, - NODE = 266, - AT = 267, - TO = 268, - SEMICOLON = 269, - COMMA = 270, - LEFTPARENTHESIS = 271, - RIGHTPARENTHESIS = 272, - LEFTBRACKET = 273, - RIGHTBRACKET = 274, - FULLSTOP = 275, - EQUALS = 276, - COORD = 277, - PROPSTRING = 278, - REFSTRING = 279, - DELIMITEDSTRING = 280, - UNKNOWN_BEGIN_CMD = 281, - UNKNOWN_END_CMD = 282, - UNKNOWN_CMD = 283, - UNKNOWN_STR = 284, - UNCLOSED_DELIM_STR = 285 - }; -#endif -/* Tokens. */ -#define BEGIN_TIKZPICTURE_CMD 258 -#define END_TIKZPICTURE_CMD 259 -#define BEGIN_PGFONLAYER_CMD 260 -#define END_PGFONLAYER_CMD 261 -#define DRAW_CMD 262 -#define NODE_CMD 263 -#define PATH_CMD 264 -#define RECTANGLE 265 -#define NODE 266 -#define AT 267 -#define TO 268 -#define SEMICOLON 269 -#define COMMA 270 -#define LEFTPARENTHESIS 271 -#define RIGHTPARENTHESIS 272 -#define LEFTBRACKET 273 -#define RIGHTBRACKET 274 -#define FULLSTOP 275 -#define EQUALS 276 -#define COORD 277 -#define PROPSTRING 278 -#define REFSTRING 279 -#define DELIMITEDSTRING 280 -#define UNKNOWN_BEGIN_CMD 281 -#define UNKNOWN_END_CMD 282 -#define UNKNOWN_CMD 283 -#define UNKNOWN_STR 284 -#define UNCLOSED_DELIM_STR 285 - - - - -/* Copy the first part of user declarations. */ -#line 1 "../tikzit/src/data/tikzparser.y" - -/* - * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger - * Copyright 2013 K. Johan Paulsson - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "tikzparserdefs.h" - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 43 "../tikzit/src/data/tikzparser.y" -{ - char *str; - GraphElementProperty *prop; - GraphElementData *data; - Node *node; - QPointF *pt; - struct noderef noderef; -} -/* Line 193 of yacc.c. */ -#line 189 "../tikzit/src/data/tikzparser.parser.cpp" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - -/* Copy the second part of user declarations. */ -#line 52 "../tikzit/src/data/tikzparser.y" - -#include "node.h" -#include "edge.h" -#include "graphelementdata.h" -#include "graphelementproperty.h" - -#include "tikzlexer.h" -#import "tikzgraphassembler.h" -/* the assembler (used by this parser) is stored in the lexer - state as "extra" data */ -#define assembler yyget_extra(scanner) - -/* pass errors off to the assembler */ -void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { - // TODO: implement reportError() - //assembler->reportError(str, yylloc); - qDebug() << "parse error: " << str; -} - - -/* Line 216 of yacc.c. */ -#line 233 "../tikzit/src/data/tikzparser.parser.cpp" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - YYLTYPE yyls; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 5 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 52 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 31 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 21 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 36 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 70 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 285 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = -{ - 0, 0, 3, 8, 11, 12, 14, 16, 18, 20, - 23, 25, 28, 32, 33, 36, 40, 41, 45, 47, - 49, 51, 55, 63, 64, 67, 72, 74, 77, 78, - 82, 90, 92, 96, 99, 100, 104 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 32, 0, -1, 3, 36, 33, 4, -1, 33, 34, - -1, -1, 42, -1, 47, -1, 51, -1, 35, -1, - 5, 25, -1, 6, -1, 18, 19, -1, 18, 37, - 19, -1, -1, 38, 39, -1, 38, 39, 15, -1, - -1, 40, 21, 40, -1, 40, -1, 23, -1, 25, - -1, 16, 24, 17, -1, 8, 36, 41, 12, 22, - 25, 14, -1, -1, 20, 24, -1, 16, 24, 43, - 17, -1, 44, -1, 16, 17, -1, -1, 11, 36, - 25, -1, 7, 36, 44, 13, 46, 45, 14, -1, - 40, -1, 40, 21, 40, -1, 48, 49, -1, -1, - 18, 49, 19, -1, 9, 50, 22, 10, 22, 14, - -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 124, 124, 130, 130, 131, 131, 131, 131, 133, - 133, 136, 138, 140, 141, 148, 154, 156, 163, 169, - 169, 171, 172, 192, 192, 193, 200, 201, 203, 204, - 212, 250, 250, 251, 251, 252, 254 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "\"\\\\begin{tikzpicture}\"", - "\"\\\\end{tikzpicture}\"", "\"\\\\begin{pgfonlayer}\"", - "\"\\\\end{pgfonlayer}\"", "\"\\\\draw\"", "\"\\\\node\"", - "\"\\\\path\"", "\"rectangle\"", "\"node\"", "\"at\"", "\"to\"", "\";\"", - "\",\"", "\"(\"", "\")\"", "\"[\"", "\"]\"", "\".\"", "\"=\"", - "\"co-ordinate\"", "\"key/value string\"", "\"string\"", - "\"{-delimited string\"", "\"unknown \\\\begin command\"", - "\"unknown \\\\end command\"", "\"unknown latex command\"", - "\"unknown string\"", "\"unclosed {-delimited string\"", "$accept", - "tikzpicture", "tikzcmds", "tikzcmd", "ignore", "optproperties", - "properties", "extraproperties", "property", "val", "nodename", "node", - "optanchor", "noderef", "optnoderef", "optedgenode", "edge", - "ignoreprop", "ignoreprops", "optignoreprops", "boundingbox", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 31, 32, 33, 33, 34, 34, 34, 34, 35, - 35, 36, 36, 36, 37, 38, 38, 39, 39, 40, - 40, 41, 42, 43, 43, 44, 45, 45, 46, 46, - 47, 48, 48, 49, 49, 50, 51 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 4, 2, 0, 1, 1, 1, 1, 2, - 1, 2, 3, 0, 2, 3, 0, 3, 1, 1, - 1, 3, 7, 0, 2, 4, 1, 2, 0, 3, - 7, 1, 3, 2, 0, 3, 6 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 13, 0, 16, 4, 1, 11, 0, 0, 0, - 12, 19, 20, 14, 18, 2, 0, 10, 13, 13, - 0, 3, 8, 5, 6, 7, 15, 0, 9, 0, - 0, 34, 0, 17, 0, 0, 0, 0, 31, 34, - 0, 0, 23, 28, 0, 0, 0, 33, 35, 0, - 0, 0, 13, 0, 21, 0, 32, 0, 24, 25, - 0, 0, 26, 0, 0, 36, 29, 27, 30, 22 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 2, 9, 21, 22, 4, 7, 8, 13, 38, - 37, 23, 51, 35, 63, 53, 24, 39, 40, 32, - 25 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -20 -static const yytype_int8 yypact[] = -{ - 9, -4, 15, -3, -20, -20, -20, -2, -12, 0, - -20, -20, -20, 3, -1, -20, 1, -20, -4, -4, - 4, -20, -20, -20, -20, -20, -20, -12, -20, 5, - 7, -12, 2, -20, 6, 12, 8, 16, 10, -12, - 14, 17, 19, 18, 20, 21, -12, -20, -20, 22, - 23, 24, -4, 26, -20, 11, -20, 31, -20, -20, - 25, -14, -20, 32, 34, -20, -20, -20, -20, -20 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -20, -20, -20, -20, -20, -17, -20, -20, -20, -8, - -20, -20, -20, -19, -20, -20, -20, -20, 13, -20, - -20 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = -{ - 14, 29, 30, 67, 15, 16, 17, 18, 19, 20, - 42, 11, 1, 12, 3, 5, 6, 10, 26, 33, - 27, 34, 31, 36, 41, 43, 28, 49, 45, 52, - 42, 46, 44, 48, 62, 60, 64, 54, 56, 50, - 0, 59, 61, 55, 57, 65, 68, 58, 69, 0, - 66, 0, 47 -}; - -static const yytype_int8 yycheck[] = -{ - 8, 18, 19, 17, 4, 5, 6, 7, 8, 9, - 24, 23, 3, 25, 18, 0, 19, 19, 15, 27, - 21, 16, 18, 16, 22, 13, 25, 10, 12, 11, - 24, 21, 24, 19, 53, 52, 25, 17, 46, 20, - -1, 17, 16, 22, 22, 14, 14, 24, 14, -1, - 25, -1, 39 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 32, 18, 36, 0, 19, 37, 38, 33, - 19, 23, 25, 39, 40, 4, 5, 6, 7, 8, - 9, 34, 35, 42, 47, 51, 15, 21, 25, 36, - 36, 18, 50, 40, 16, 44, 16, 41, 40, 48, - 49, 22, 24, 13, 24, 12, 21, 49, 19, 10, - 20, 43, 11, 46, 17, 22, 40, 22, 24, 17, - 36, 16, 44, 45, 25, 14, 25, 17, 14, 14 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, scanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, scanner) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, scanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - void *scanner; -#endif -{ - if (!yyvaluep) - return; - YYUSE (yylocationp); - YYUSE (scanner); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, scanner) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - YYLTYPE const * const yylocationp; - void *scanner; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - YY_LOCATION_PRINT (yyoutput, *yylocationp); - YYFPRINTF (yyoutput, ": "); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule, scanner) - YYSTYPE *yyvsp; - YYLTYPE *yylsp; - int yyrule; - void *scanner; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , scanner); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, scanner); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, scanner) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; - void *scanner; -#endif -{ - YYUSE (yyvaluep); - YYUSE (yylocationp); - YYUSE (scanner); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void *scanner); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *scanner) -#else -int -yyparse (scanner) - void *scanner; -#endif -#endif -{ - /* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; -/* Location data for the look-ahead symbol. */ -YYLTYPE yylloc; - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss; - yyvsp = yyvs; - yylsp = yyls; -#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL - /* Initialize the default location before parsing starts. */ - yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 0; -#endif - - - /* User initialization code. */ -#line 75 "../tikzit/src/data/tikzparser.y" -{ - yylloc.first_column = yylloc.last_column = 0; -} -/* Line 1078 of yacc.c. */ -#line 1337 "../tikzit/src/data/tikzparser.parser.cpp" - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - YYSTACK_RELOCATE (yyls); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to look-ahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a look-ahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - if (yyn == YYFINAL) - YYACCEPT; - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - *++yylsp = yylloc; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 125 "../tikzit/src/data/tikzparser.y" - { - if ((yyvsp[(2) - (4)].data)) { - assembler->graph()->setData((yyvsp[(2) - (4)].data)); - } - ;} - break; - - case 11: -#line 137 "../tikzit/src/data/tikzparser.y" - { (yyval.data) = 0; ;} - break; - - case 12: -#line 139 "../tikzit/src/data/tikzparser.y" - { (yyval.data) = (yyvsp[(2) - (3)].data); ;} - break; - - case 13: -#line 140 "../tikzit/src/data/tikzparser.y" - { (yyval.data) = 0; ;} - break; - - case 14: -#line 142 "../tikzit/src/data/tikzparser.y" - { - (yyvsp[(1) - (2)].data)->add(*(yyvsp[(2) - (2)].prop)); - delete (yyvsp[(2) - (2)].prop); - (yyval.data) = (yyvsp[(1) - (2)].data); - ;} - break; - - case 15: -#line 149 "../tikzit/src/data/tikzparser.y" - { - (yyvsp[(1) - (3)].data)->add(*(yyvsp[(2) - (3)].prop)); - delete (yyvsp[(2) - (3)].prop); - (yyval.data) = (yyvsp[(1) - (3)].data); - ;} - break; - - case 16: -#line 154 "../tikzit/src/data/tikzparser.y" - { (yyval.data) = new GraphElementData(); ;} - break; - - case 17: -#line 157 "../tikzit/src/data/tikzparser.y" - { - GraphElementProperty *p = new GraphElementProperty(QString((yyvsp[(1) - (3)].str)),QString((yyvsp[(3) - (3)].str))); - free((yyvsp[(1) - (3)].str)); - free((yyvsp[(3) - (3)].str)); - (yyval.prop) = p; - ;} - break; - - case 18: -#line 164 "../tikzit/src/data/tikzparser.y" - { - GraphElementProperty *a = new GraphElementProperty(QString((yyvsp[(1) - (1)].str))); - free((yyvsp[(1) - (1)].str)); - (yyval.prop) = a; - ;} - break; - - case 19: -#line 169 "../tikzit/src/data/tikzparser.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} - break; - - case 20: -#line 169 "../tikzit/src/data/tikzparser.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); ;} - break; - - case 21: -#line 171 "../tikzit/src/data/tikzparser.y" - { (yyval.str) = (yyvsp[(2) - (3)].str); ;} - break; - - case 22: -#line 173 "../tikzit/src/data/tikzparser.y" - { - Node *node = new Node(); - - if ((yyvsp[(2) - (7)].data)) { - node->setData((yyvsp[(2) - (7)].data)); - } - //qDebug() << "node name: " << $3; - node->setName(QString((yyvsp[(3) - (7)].str))); - node->setLabel(QString((yyvsp[(6) - (7)].str))); - free((yyvsp[(3) - (7)].str)); - free((yyvsp[(6) - (7)].str)); - - node->setPoint(*(yyvsp[(5) - (7)].pt)); - delete (yyvsp[(5) - (7)].pt); - - assembler->graph()->addNode(node); - assembler->addNodeToMap(node); - ;} - break; - - case 23: -#line 192 "../tikzit/src/data/tikzparser.y" - { (yyval.str) = 0; ;} - break; - - case 24: -#line 192 "../tikzit/src/data/tikzparser.y" - { (yyval.str) = (yyvsp[(2) - (2)].str); ;} - break; - - case 25: -#line 194 "../tikzit/src/data/tikzparser.y" - { - (yyval.noderef).node = assembler->nodeWithName(QString((yyvsp[(2) - (4)].str))); - free((yyvsp[(2) - (4)].str)); - (yyval.noderef).anchor = (yyvsp[(3) - (4)].str); - ;} - break; - - case 26: -#line 200 "../tikzit/src/data/tikzparser.y" - { (yyval.noderef) = (yyvsp[(1) - (1)].noderef); ;} - break; - - case 27: -#line 201 "../tikzit/src/data/tikzparser.y" - { (yyval.noderef).node = 0; (yyval.noderef).anchor = 0; ;} - break; - - case 28: -#line 203 "../tikzit/src/data/tikzparser.y" - { (yyval.node) = 0; ;} - break; - - case 29: -#line 205 "../tikzit/src/data/tikzparser.y" - { - (yyval.node) = new Node(); - if ((yyvsp[(2) - (3)].data)) - (yyval.node)->setData((yyvsp[(2) - (3)].data)); - (yyval.node)->setLabel(QString((yyvsp[(3) - (3)].str))); - free((yyvsp[(3) - (3)].str)); - ;} - break; - - case 30: -#line 213 "../tikzit/src/data/tikzparser.y" - { - Node *s; - Node *t; - - s = (yyvsp[(3) - (7)].noderef).node; - - if ((yyvsp[(6) - (7)].noderef).node) { - t = (yyvsp[(6) - (7)].noderef).node; - } else { - t = s; - } - - Edge *edge = new Edge(s, t); - if ((yyvsp[(2) - (7)].data)) { - edge->setData((yyvsp[(2) - (7)].data)); - edge->setAttributesFromData(); - } - - if ((yyvsp[(5) - (7)].node)) - edge->setEdgeNode((yyvsp[(5) - (7)].node)); - if ((yyvsp[(3) - (7)].noderef).anchor) { - edge->setSourceAnchor(QString((yyvsp[(3) - (7)].noderef).anchor)); - free((yyvsp[(3) - (7)].noderef).anchor); - } - - if ((yyvsp[(6) - (7)].noderef).node) { - if ((yyvsp[(6) - (7)].noderef).anchor) { - edge->setTargetAnchor(QString((yyvsp[(6) - (7)].noderef).anchor)); - free((yyvsp[(6) - (7)].noderef).anchor); - } - } else { - edge->setTargetAnchor(edge->sourceAnchor()); - } - - assembler->graph()->addEdge(edge); - ;} - break; - - case 36: -#line 255 "../tikzit/src/data/tikzparser.y" - { - assembler->graph()->setBbox(QRectF(*(yyvsp[(3) - (6)].pt), *(yyvsp[(5) - (6)].pt))); - delete (yyvsp[(3) - (6)].pt); - delete (yyvsp[(5) - (6)].pt); - ;} - break; - - -/* Line 1267 of yacc.c. */ -#line 1719 "../tikzit/src/data/tikzparser.parser.cpp" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (&yylloc, scanner, YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (&yylloc, scanner, yymsg); - } - else - { - yyerror (&yylloc, scanner, YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - yyerror_range[0] = yylloc; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, scanner); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - yyerror_range[0] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yyerror_range[0] = *yylsp; - yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, scanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - if (yyn == YYFINAL) - YYACCEPT; - - *++yyvsp = yylval; - - yyerror_range[1] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the look-ahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); - *++yylsp = yyloc; - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (&yylloc, scanner, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, scanner); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, scanner); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - diff --git a/src/data/tikzparser.parser.hpp b/src/data/tikzparser.parser.hpp deleted file mode 100644 index aaf0e10..0000000 --- a/src/data/tikzparser.parser.hpp +++ /dev/null @@ -1,139 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - BEGIN_TIKZPICTURE_CMD = 258, - END_TIKZPICTURE_CMD = 259, - BEGIN_PGFONLAYER_CMD = 260, - END_PGFONLAYER_CMD = 261, - DRAW_CMD = 262, - NODE_CMD = 263, - PATH_CMD = 264, - RECTANGLE = 265, - NODE = 266, - AT = 267, - TO = 268, - SEMICOLON = 269, - COMMA = 270, - LEFTPARENTHESIS = 271, - RIGHTPARENTHESIS = 272, - LEFTBRACKET = 273, - RIGHTBRACKET = 274, - FULLSTOP = 275, - EQUALS = 276, - COORD = 277, - PROPSTRING = 278, - REFSTRING = 279, - DELIMITEDSTRING = 280, - UNKNOWN_BEGIN_CMD = 281, - UNKNOWN_END_CMD = 282, - UNKNOWN_CMD = 283, - UNKNOWN_STR = 284, - UNCLOSED_DELIM_STR = 285 - }; -#endif -/* Tokens. */ -#define BEGIN_TIKZPICTURE_CMD 258 -#define END_TIKZPICTURE_CMD 259 -#define BEGIN_PGFONLAYER_CMD 260 -#define END_PGFONLAYER_CMD 261 -#define DRAW_CMD 262 -#define NODE_CMD 263 -#define PATH_CMD 264 -#define RECTANGLE 265 -#define NODE 266 -#define AT 267 -#define TO 268 -#define SEMICOLON 269 -#define COMMA 270 -#define LEFTPARENTHESIS 271 -#define RIGHTPARENTHESIS 272 -#define LEFTBRACKET 273 -#define RIGHTBRACKET 274 -#define FULLSTOP 275 -#define EQUALS 276 -#define COORD 277 -#define PROPSTRING 278 -#define REFSTRING 279 -#define DELIMITEDSTRING 280 -#define UNKNOWN_BEGIN_CMD 281 -#define UNKNOWN_END_CMD 282 -#define UNKNOWN_CMD 283 -#define UNKNOWN_STR 284 -#define UNCLOSED_DELIM_STR 285 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 43 "../tikzit/src/data/tikzparser.y" -{ - char *str; - GraphElementProperty *prop; - GraphElementData *data; - Node *node; - QPointF *pt; - struct noderef noderef; -} -/* Line 1529 of yacc.c. */ -#line 118 "../tikzit/src/data/tikzparser.parser.hpp" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -} YYLTYPE; -# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - diff --git a/target_wrapper.sh b/target_wrapper.sh deleted file mode 100755 index 1793274..0000000 --- a/target_wrapper.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -DYLD_FRAMEWORK_PATH=/usr/local/Cellar/qt5/5.7.1_1/lib${DYLD_FRAMEWORK_PATH:+:$DYLD_FRAMEWORK_PATH} -export DYLD_FRAMEWORK_PATH -QT_PLUGIN_PATH=/usr/local/Cellar/qt5/5.7.1_1/plugins${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH} -export QT_PLUGIN_PATH -exec "$@" -- cgit v1.2.3 From c0bb77059e3c4afa47fe6bfebbf99e230a01992c Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Wed, 10 Jan 2018 09:40:41 +0100 Subject: added Doxyfile, Illustrator file for icon, and a 512x512 version --- Doxyfile | 2512 ++++++++++++++++++++++++++++++++++++++++++++++ images/tikzit.ai | 967 ++++++++++++++++++ images/tikzit48x48.png | Bin 2606 -> 2435 bytes images/tikzit512x512.png | Bin 0 -> 27019 bytes src/gui/tikzscene.cpp | 11 + 5 files changed, 3490 insertions(+) create mode 100644 Doxyfile create mode 100644 images/tikzit.ai create mode 100644 images/tikzit512x512.png (limited to 'src') diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..039ed89 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,2512 @@ +# Doxyfile 1.8.14 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = TikZiT + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 2.0 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "A GUI diagram editor for TikZ" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = images/tikzit48x48.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../tikzit.github.io/docs + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = /Users/alek/git/tikzit/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: 0. + +CLANG_COMPILATION_DATABASE_PATH= 0 + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , />stream +H‰ÜW˲7 Ý÷WøÚ×’üÜr¬HŠº‹°¿•„ÅL(‚ßÏ9î¶{¦¤*• u™‘Æ’õ:’üðË£{xóÜ‹—nù¸—DûßÊÿþúmùÕý þÃOOÁýñiyx} îå‡åíòê 6qÙÄßâ FoÚœÖìcPwŒ(¾ª8k>Tq‚ϵ¹l¾es’‹Ïâž—{ú²$ñ-D'É|?FŸJub ¤NR²k?1.ƒQ̇`®4ŸbrV}°ìD6 êy¹§/‹¤ìK”y¼&Ÿ‚Ó|¸£eoÅ\ ^»é'ÆeÑ} ÅÕ涫B’]­>5D·IÔórOCÚ¡Tæq.¶® ºbñZû]R¥ïOÅ×im¶ÒóÑ`‹_|Tñ!µA>/'Æe±½4›N¸‚AýN‰ q?1.“DÅHqd¿¥žG‰D4­=Í‚ôBÁ‰C !Y„xõQ¡®% <ϘB¼yðnã£XtQX¹Ó¨DÐøyR¿£!žµËÍóaÀ¨'ðºoѨáĹLŽ!‘58tZfLònà† ƒ†Ú…°]¬¸ iw+|ð)ÄZ‘æ;â8Ü ¿)ë°P¡f]—ïÜÃÓûà>½w¯Þ¹·½Õ|½W=<âêÇ'ú?÷ôøó"Á}vѽqÓ®NúÏ[%¤ÖFàSåmü麬ÉÓ:·¢ª¢%g’ HT~‚„ÇkL¨-uéiàâçDª/(ÁUP1OrÕ<ÂhjA© u Ü'½‚>v™Á5Ï­p¤~# +¢¤ NJ=ËýÊÚ{Újì¤poU½è«€H4ÕvæÄæ-l6N^SÄ_,"Q‰+þ‚ž¢“†¢Ä+Bx1ëm.#H­ðRóªü‚ ÐR»*½P“–ܻتˆ»OçT^ºGq2 &h-êí!†$m  «ám ÅPd%¤Í&v«UL{gïfô§ý&ÑþÁ€bËî}œQVEÛT˜™Éˆ­§ž BÝ…Ø"³¡>dªcŸRúWÑ7´ ±¬7¡{'u¤/P¦47öщ:ä|é¡€v#¥'°„©ë4‰áøŠ&a éà”Š†KpbR º²¾-¤a<îò¼ž—÷ËÓiÐc(JèxH&‘Á¡’Ô)*9"ñ¯_@R1;rÅ åìSÖÿ€dàõ¹1y©eWˆÉýsÿ`–ÑÈ82ÆI¬òƒýðN¬ýWÆz—ÞôNõ;Ixl×ïŒ0%· üïÑGáìg÷C9¶eû¦{ð¡ L¾æ‘ræ²N1ƒÑ8:kfëÇg$®ÌË\œ¿SS‘)½“ÝýûªÛV7$דêõнß=8aʉúq¼Ù²Ó·ð°¢q ²í^ Ò¢EîuÐe4 s–ƒÜ¸_rï4V²çrpÐñ°à‘3´ìœy G–×a‡qföiyæ\ºe\ò´qR7i ?ë·ÝûËð*À¬›·^¿fÙ—Ö©ƒ“70ÌpZTʘ/UAc +¡å)žVúš|âpÃR¬±Ëú¤pSãÔÁÍ‹‘9t Φ£ß å/îÕ“¿7[–²uâtÎ)oe |_VÇáB)P‡ïM³½Û”ÜmSÿ­WsÕÌÜ~¸Ë` }2õ2ù ™t½‡ŒÞ@F÷²/nHž¡2è™:9aÊþc§þÞݺéH|Á¼æÓ%}ÅÃ%ƒOØ“±<5>•°g`pwêË)@2‹þÌÁã²baBp +q’;K®¢‚ݤW*ÅD:°~ T`íç£JOèh\‰¢ãZSêÖB n7ìÒßQ}K'{I葤LM±÷Ž +íÀº»z +íDµo]îÌ¡/ôA/¹fÄ'Ñž…ïCt" õÓ¥øúJAke9s Ï¥Ü±£iB¿Ø²øP½OÓá`&µ^RÍÚ „óØ3Ñ…φØÐB$#µIDh]+Õ Ùž ×ÿôÂ’Az¾Wt|ôß»[è%Ud°Î¾‚ƒ±TòM™K,€Ä ” k:b|»ä¸9Ôúón@T"eeB˜oŒÜnaæP^¡œ£U€QhéÞJ¨9› uÜs #£™ÐŽÙ¡„ÏWb`ïjŒ0›^(ž¿´ÝÓgròO¾#Y½„Yl·ˆ?sh^JÜö.Á@+ÇòÞEÎI:c~ýЯ7¨Ç¤ÏV¬p‰‰\jJàOÔÛDýíKÍŽ—ZpI´ÿ­üo‡~7ÆhÌÃ뫸—ÆSïíò·…‰R endstream endobj 77 0 obj <> endobj 90 0 obj <>stream +8;ZD.gPs,o%!4_eHG&pt:\mXE#6aOKEBq.IT0"9n@!b"'E$!X((QH?s"5?G?K#P20 +O/d)\T,/P1'qS?i"`crJ?H8d*KjRXIZ+u6FTjS-):gaeT(>+?(!Z6FT)AEal%;;Q@ +kb3O4qsuY.N]*EB(@]Z27":::JI9hMb@0>:^nab-+NNs/JHE@q?G;3L!m9!^.::8g +iM>Jef*'=g%mLeUpPAmn5I8u&(:V"^JE7%&U-SUuQX1AZ47 +)b\i'orh[PJOC%+(N\UM53;RTZn-;X. +d$#BDrYE[.o3UD]5(MDElGJ=9>,`#5E]% +cN&-!^1@~> endstream endobj 92 0 obj [/Indexed/DeviceRGB 255 93 0 R] endobj 93 0 obj <>stream +8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0 +b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup` +E1r!/,*0[*9.aFIR2&b-C#soRZ7Dl%MLY\.?d>Mn +6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( +l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 88 0 obj <>/ExtGState<>>>/Subtype/Form>>stream +/CS0 cs 0 0 0 scn +/GS0 gs +507.579 6.422 -494.579 114.578 re +f + endstream endobj 89 0 obj <>/ExtGState<>>>/Subtype/Form>>stream +/CS0 cs 1 1 1 scn +/GS0 gs +q 1 0 0 1 536.5762 405.4023 cm +0 0 m +0 -88.638 -130.614 -160.492 -291.735 -160.492 c +-452.856 -160.492 -583.471 -88.638 -583.471 0 c +-583.471 88.637 -452.856 160.492 -291.735 160.492 c +-130.614 160.492 0 88.637 0 0 c +f +Q + endstream endobj 95 0 obj <> endobj 81 0 obj <> endobj 79 0 obj [/ICCBased 96 0 R] endobj 96 0 obj <>stream +H‰œ–yTSwÇoÉž•°Ãc [€°5la‘QIBHØADED„ª•2ÖmtFOE.®c­Ö}êÒõ0êè8´׎8GNg¦Óïï÷9÷wïïÝß½÷ó '¥ªµÕ0 Ö ÏJŒÅb¤  + 2y­.-;!à’ÆK°ZÜ ü‹ž^i½"LÊÀ0ðÿ‰-×é @8(”µrœ;q®ª7èLöœy¥•&†Qëñq¶4±jž½ç|æ9ÚÄ +V³)gB£0ñiœWו8#©8wÕ©•õ8_Å٥ʨQãüÜ«QÊj@é&»A)/ÇÙgº>'K‚óÈtÕ;\ú” Ó¥$ÕºF½ZUnÀÜå˜(4TŒ%)ë«”ƒ0C&¯”阤Z£“i˜¿óœ8¦Úbx‘ƒE¡ÁÁBÑ;…ú¯›¿P¦ÞÎӓ̹žAü om?çW= +€x¯Íú·¶Ò-Œ¯Àòæ[›Ëû0ñ¾¾øÎ}ø¦y)7ta¾¾õõõ>j¥ÜÇTÐ7úŸ¿@ï¼ÏÇtÜ›ò`qÊ2™±Ê€™ê&¯®ª6ê±ZL®Ä„?â_øóyxg)Ë”z¥ÈçL­UáíÖ*ÔuµSkÿSeØO4?׸¸c¯¯Ø°.òò· åÒR´ ßÞô-•’2ð5ßáÞüÜÏ ú÷Sá>Ó£V­š‹“då`r£¾n~ÏôY &à+`œ;ÂA4ˆÉ 䀰ÈA9Ð=¨- t°lÃ`;»Á~pŒƒÁ ðGp| ®[`Lƒ‡`<¯ "A ˆ YA+äùCb(Š‡R¡,¨*T2B-Ð +¨ꇆ¡Ðnè÷ÐQètº}MA ï —0Óal»Á¾°ŽSàx ¬‚kà&¸^Á£ð>ø0|>_ƒ'á‡ð,ÂG!"F$H:Rˆ”!z¤éF‘Qd?r 9‹\A&‘GÈ ”ˆrQ ¢áhš‹ÊÑ´íE‡Ñ]èaô4zBgÐ×Á–àE#H ‹*B=¡‹0HØIøˆp†p0MxJ$ùD1„˜D, V›‰½Ä­ÄÄãÄKÄ»ÄY‰dEò"EÒI2’ÔEÚBÚGúŒt™4MzN¦‘Èþär!YKî ’÷?%_&ß#¿¢°(®”0J:EAi¤ôQÆ(Ç()Ó”WT6U@ æP+¨íÔ!ê~êêmêæD ¥eÒÔ´å´!ÚïhŸÓ¦h/èº']B/¢éëèÒÓ¿¢?a0nŒhF!ÃÀXÇØÍ8ÅøšñÜŒkæc&5S˜µ™˜6»lö˜Iaº2c˜K™MÌAæ!æEæ#…åÆ’°d¬VÖë(ëk–Íe‹Øél »—½‡}Ž}ŸCâ¸qâ9 +N'çÎ)Î].ÂuæJ¸rî +î÷ wšGä xR^¯‡÷[ÞoÆœchžgÞ`>bþ‰ù$á»ñ¥ü*~ÿ ÿ:ÿ¥…EŒ…ÒbÅ~‹ËÏ,m,£-•–Ý–,¯Y¾´Â¬â­*­6X[ݱF­=­3­ë­·YŸ±~dó ·‘ÛtÛ´¹i ÛzÚfÙ6Û~`{ÁvÖÎÞ.ÑNg·Åî”Ý#{¾}´}…ý€ý§ö¸‘j‡‡ÏþŠ™c1X6„Æfm“Ž;'_9 œr:œ8Ýq¦:‹ËœœO:ϸ8¸¤¹´¸ìu¹éJq»–»nv=ëúÌMà–ï¶ÊmÜí¾ÀR 4 ö +n»3Ü£ÜkÜGݯz=Ä•[=¾ô„=ƒ<Ë=GTB(É/ÙSòƒ,]6*›-•–¾W:#—È7Ë*¢ŠÊe¿ò^YDYÙ}U„j£êAyTù`ù#µD=¬þ¶"©b{ųÊôÊ+¬Ê¯: !kJ4Gµm¥ötµ}uCõ%—®K7YV³©fFŸ¢ßY Õ.©=bàá?SŒîÆ•Æ©ºÈº‘ºçõyõ‡Ø Ú† žkï5%4ý¦m–7Ÿlqlio™Z³lG+ÔZÚz²Í¹­³mzyâò]íÔöÊö?uøuôw|¿"űN»ÎåwW&®ÜÛe֥ﺱ*|ÕöÕèjõê‰5k¶¬yÝ­èþ¢Ç¯g°ç‡^yïkEk‡Öþ¸®lÝD_p߶õÄõÚõ×7DmØÕÏîoê¿»1mãál {àûMśΠnßLÝlÜ<9”úO¤[þ˜¸™$™™üšhšÕ›B›¯œœ‰œ÷dÒž@ž®ŸŸ‹Ÿú i Ø¡G¡¶¢&¢–££v£æ¤V¤Ç¥8¥©¦¦‹¦ý§n§à¨R¨Ä©7©©ªª««u«é¬\¬Ð­D­¸®-®¡¯¯‹°°u°ê±`±Ö²K²Â³8³®´%´œµµŠ¶¶y¶ð·h·à¸Y¸Ñ¹J¹Âº;ºµ».»§¼!¼›½½¾ +¾„¾ÿ¿z¿õÀpÀìÁgÁãÂ_ÂÛÃXÃÔÄQÄÎÅKÅÈÆFÆÃÇAÇ¿È=ȼÉ:ɹÊ8Ê·Ë6˶Ì5̵Í5͵Î6ζÏ7ϸÐ9кÑ<ѾÒ?ÒÁÓDÓÆÔIÔËÕNÕÑÖUÖØ×\×àØdØèÙlÙñÚvÚûÛ€ÜÜŠÝÝ–ÞÞ¢ß)߯à6à½áDáÌâSâÛãcãëäsäüå„æ æ–çç©è2è¼éFéÐê[êåëpëûì†ííœî(î´ï@ïÌðXðåñrñÿòŒóó§ô4ôÂõPõÞömöû÷Šøø¨ù8ùÇúWúçûwüü˜ý)ýºþKþÜÿmÿÿ ÷„óû endstream endobj 94 0 obj <> endobj 84 0 obj <> endobj 85 0 obj <> endobj 86 0 obj <> endobj 87 0 obj <> endobj 98 0 obj <>stream + endstream endobj 97 0 obj <> endobj 99 0 obj <> endobj 100 0 obj <> endobj 71 0 obj <> endobj 72 0 obj <> endobj 73 0 obj <> endobj 74 0 obj <> endobj 107 0 obj [/View/Design] endobj 108 0 obj <>>> endobj 105 0 obj [/View/Design] endobj 106 0 obj <>>> endobj 103 0 obj [/View/Design] endobj 104 0 obj <>>> endobj 101 0 obj [/View/Design] endobj 102 0 obj <>>> endobj 80 0 obj <> endobj 82 0 obj <> endobj 83 0 obj <> endobj 110 0 obj <> endobj 111 0 obj [0.0] endobj 112 0 obj <>/XObject<>>>/Subtype/Form>>stream +0 g +/GS0 gs +-46.895 565.894 583.471 -320.984 re +f +q +0 Tc 0 Tw 0 Ts 100 Tz 0 Tr /Fm0 Do +Q + endstream endobj 113 0 obj <> endobj 114 0 obj <>/ExtGState<>/Shading<>>>/Subtype/Form>>stream +q +419.6 365.446 m +414.319 365.446 409.165 364.915 404.179 363.916 c +374.027 434.636 303.875 484.212 222.14 484.212 c +112.892 484.212 24.329 395.649 24.329 286.402 c +24.329 241.821 39.081 200.689 63.963 167.609 c +51.904 153.863 44.578 135.862 44.578 116.139 c +44.578 73.004 79.545 38.036 122.68 38.036 c +156.741 38.036 185.693 59.849 196.373 90.261 c +204.807 89.163 213.406 88.591 222.14 88.591 c +230.657 88.591 239.049 89.13 247.283 90.175 c +257.895 59.637 286.907 37.708 321.059 37.708 c +364.193 37.708 399.16 72.675 399.16 115.81 c +399.16 135.448 391.896 153.38 379.928 167.104 c +390 180.404 398.426 195.017 404.91 210.641 c +409.67 209.734 414.576 209.241 419.6 209.241 c +462.734 209.241 497.701 244.209 497.701 287.343 c +497.701 330.478 462.734 365.446 419.6 365.446 c +W n +q +0 g +/GS0 gs +-0.0000153 446.5039062 446.5039062 0.0000153 261.0146484 37.7080078 cm +BX /Sh0 sh EX Q +Q +/CS1 CS 0 0 0 SCN +10 w 4 M 0 j 0 J []0 d +/GS0 gs +q 1 0 0 1 419.5996 365.4458 cm +0 0 m +-5.28 0 -10.435 -0.531 -15.421 -1.53 c +-45.572 69.19 -115.725 118.767 -197.46 118.767 c +-306.708 118.767 -395.271 30.204 -395.271 -79.044 c +-395.271 -123.625 -380.519 -164.756 -355.636 -197.836 c +-367.696 -211.583 -375.022 -229.583 -375.022 -249.307 c +-375.022 -292.442 -340.055 -327.41 -296.92 -327.41 c +-262.858 -327.41 -233.907 -305.597 -223.227 -275.185 c +-214.792 -276.283 -206.193 -276.855 -197.46 -276.855 c +-188.942 -276.855 -180.55 -276.316 -172.316 -275.271 c +-161.705 -305.809 -132.692 -327.738 -98.541 -327.738 c +-55.406 -327.738 -20.439 -292.771 -20.439 -249.636 c +-20.439 -229.998 -27.704 -212.066 -39.672 -198.342 c +-29.6 -185.042 -21.174 -170.429 -14.689 -154.805 c +-9.93 -155.711 -5.023 -156.205 0 -156.205 c +43.135 -156.205 78.102 -121.237 78.102 -78.103 c +78.102 -34.968 43.135 0 0 0 c +h +S +Q + endstream endobj 115 0 obj <> endobj 116 0 obj <> endobj 118 0 obj <> endobj 119 0 obj <> endobj 120 0 obj <> endobj 121 0 obj <> endobj 117 0 obj [/ICCBased 96 0 R] endobj 109 0 obj <> endobj 122 0 obj [0.0] endobj 123 0 obj <>/XObject<>>>/Subtype/Form>>stream +0 g +/GS0 gs +13 121 494.579 -114.578 re +f +q +0 Tc 0 Tw 0 Ts 100 Tz 0 Tr /Fm0 Do +Q + endstream endobj 124 0 obj <> endobj 125 0 obj <>/XObject<>>>/Subtype/Form>>stream +q +/GS0 gs +0 Tc 0 Tw 0 Ts 100 Tz 0 Tr /Fm0 Do +Q + endstream endobj 126 0 obj <> endobj 128 0 obj <>/ExtGState<>/Shading<>>>/Subtype/Form>>stream +q +7.977 8.752 m +113.295 8.752 l +408.581 8.752 l +507.01 8.752 l +507.01 37.756 l +507.01 77.308 l +408.581 77.308 l +113.295 77.308 l +7.977 77.308 l +7.977 37.756 l +h +W n +q +0 g +/GS0 gs +1 0 0 -1 0 0 cm +BX /Sh0 sh EX Q +Q + endstream endobj 129 0 obj <> endobj 130 0 obj <>stream +þý €‰þý 1}þý Òpþý ÒpüÔ“4 Òpû—)I ÒpúY¿] 1}úY¿]€‰úY¿]úY¿]û—)IüÔ“4€‰üÔ“4 1}üÔ“4 1}û—)I€‰û—)I úY¿]€‰úY¿] 1}úY¿] ÒpúY¿] ÒpùUr Òp÷Þë‡ Òpö¡› 1}ö¡›€‰ö¡›ö¡›÷Þë‡ùUr€‰ùUr 1}ùUr 1}÷Þ뇀‰÷Þë‡  Òpþý bùþý ‚ó‚þý „ þý „ üÔ“4„ û—)I„ úY¿]‚ó‚úY¿]bùúY¿] ÒpúY¿] Òpû—)I ÒpüÔ“4bùüÔ“4‚ó‚üÔ“4‚ó‚û—)Ibùû—)I ÒpúY¿]bùúY¿]‚ó‚úY¿]„ úY¿]„ ùUr„ ÷Þ뇄 ö¡›‚ó‚ö¡›bùö¡› Òpö¡› Òp÷Þë‡ ÒpùUrbùùUr‚ó‚ùUr‚ó‚÷Þë‡bù÷Þë‡ ;;;ö¡›€‰ö¡› 1}ö¡› Òpö¡› Òpõd° Òpô&­Ä ÒpòéCÙ 1}òéCÙ€‰òéCÙòéCÙô&­Äõd°€‰õd° 1}õd° 1}ô&­Ä€‰ô&­Ä---òéCÙ€‰òéCÙ 1}òéCÙ ÒpòéCÙ Òpñ«Ùí Òpðnp Òpï1 1}ï1€‰ï1ï1ðnpñ«Ù퀉ñ«Ùí 1}ñ«Ùí 1}ðnp€‰ðnp---333 Òpö¡›bùö¡›‚ó‚ö¡›„ ö¡›„ õd°„ ô&­Ä„ òéCÙ‚ó‚òéCÙbùòéCÙ ÒpòéCÙ Òpô&­Ä Òpõd°bùõd°‚ó‚õd°‚ó‚ô&­Äbùô&­Ä;;;PPP--- ÒpòéCÙbùòéCÙ‚ó‚òéCÙ„ òéCÙ„ ñ«Ùí„ ðnp„ ï1‚ó‚ï1bùï1 Òpï1 Òpðnp Òpñ«Ùíbùñ«Ùí‚ó‚ñ«Ùí‚ó‚ðnpbùðnp---PPPXXX333„ þý „”þý $µˆþý (…V{þý (…V{üÔ“4(…V{û—)I(…V{úY¿]$µˆúY¿]„”úY¿]„ úY¿]„ û—)I„ üÔ“4„”üÔ“4$µˆüÔ“4$µˆû—)I„”û—)I---„ úY¿]„”úY¿]$µˆúY¿](…V{úY¿](…V{ùUr(…V{÷Þë‡(…V{ö¡›$µˆö¡›„”ö¡›„ ö¡›„ ÷Þ뇄 ùUr„”ùUr$µˆùUr$µˆ÷Þ뇄”÷Þë‡---PPP;;;(…V{þý -çþý 1†wþý 6þý 6üÔ“46û—)I6úY¿]1†wúY¿]-çúY¿](…V{úY¿](…V{û—)I(…V{üÔ“4-çüÔ“41†wüÔ“41†wû—)I-çû—)I333---(…V{úY¿]-çúY¿]1†wúY¿]6úY¿]6ùUr6÷Þë‡6ö¡›1†wö¡›-çö¡›(…V{ö¡›(…V{÷Þë‡(…V{ùUr-çùUr1†wùUr1†w÷Þë‡-ç÷Þë‡---333XXXPPP„ ö¡›„”ö¡›$µˆö¡›(…V{ö¡›(…V{õd°(…V{ô&­Ä(…V{òéCÙ$µˆòéCÙ„”òéCÙ„ òéCÙ„ ô&­Ä„ õd°„”õd°$µˆõd°$µˆô&­Ä„”ô&­Ä;;;PPPfffPPP„ òéCÙ„”òéCÙ$µˆòéCÙ(…V{òéCÙ(…V{ñ«Ùí(…V{ðnp(…V{ï1$µˆï1„”ï1„ ï1„ ðnp„ ñ«Ùí„”ñ«Ùí$µˆñ«Ùí$µˆðnp„”ðnpPPPfffnnnXXX(…V{ö¡›-çö¡›1†wö¡›6ö¡›6õd°6ô&­Ä6òéCÙ1†wòéCÙ-çòéCÙ(…V{òéCÙ(…V{ô&­Ä(…V{õd°-çõd°1†wõd°1†wô&­Ä-çô&­ÄPPPXXXnnnfff(…V{òéCÙ-çòéCÙ1†wòéCÙ6òéCÙ6ñ«Ùí6ðnp6ï11†wï1-çï1(…V{ï1(…V{ðnp(…V{ñ«Ùí-çñ«Ùí1†wñ«Ùí1†wðnp-çðnpfffnnnuuunnn6þý h…Fþý ›„ þý ÍÂþý ÍÂüÔ“4ÍÂû—)IÍÂúY¿]›„ úY¿]h…FúY¿]6úY¿]6û—)I6üÔ“4h…FüÔ“4›„ üÔ“4›„ û—)Ih…Fû—)I3333336úY¿]h…FúY¿]›„ úY¿]ÍÂúY¿]ÍÂùUrÍÂ÷Þë‡ÍÂö¡››„ ö¡›h…Fö¡›6ö¡›6÷Þë‡6ùUrh…FùUr›„ ùUr›„ ÷Þë‡h…F÷Þë‡333333XXXXXX6ö¡›h…Fö¡››„ ö¡›ÍÂö¡›ÍÂõd°ÍÂô&­ÄÍÂòéCÙ›„ òéCÙh…FòéCÙ6òéCÙ6ô&­Ä6õd°h…Fõd°›„ õd°›„ ô&­Äh…Fô&­ÄXXXXXXnnnnnn6òéCÙh…FòéCÙ›„ òéCÙÍÂòéCÙÍÂñ«ÙíÍÂðnpÍÂï1›„ ï1h…Fï16ï16ðnp6ñ«Ùíh…Fñ«Ù후 ñ«Ù후 ðnph…FðnpnnnnnnuuuuuuÍÂþý Ѷé¤þý ÕìDþý Ú!8äþý Ú!8äüÔ“4Ú!8äû—)IÚ!8äúY¿]ÕìDúY¿]Ѷé¤úY¿]ÍÂúY¿]ÍÂû—)IÍÂüÔ“4Ѷé¤üÔ“4ÕìDüÔ“4ÕìDû—)IѶé¤û—)I---333ÍÂúY¿]Ѷé¤úY¿]ÕìDúY¿]Ú!8äúY¿]Ú!8äùUrÚ!8ä÷Þë‡Ú!8äö¡›ÕìDö¡›Ñ¶é¤ö¡›ÍÂö¡›ÍÂ÷Þë‡ÍÂùUrѶé¤ùUrÕìDùUrÕìD÷Þë‡Ñ¶é¤÷Þë‡333---PPPXXXÚ!8äþý ÞVXþý ⋨øþý æÀИþý æÀИüÔ“4æÀИû—)IæÀИúY¿]⋨øúY¿]ÞVXúY¿]Ú!8äúY¿]Ú!8äû—)IÚ!8äüÔ“4ÞVXüÔ“4⋨øüÔ“4⋨øû—)IÞVXû—)I---Ú!8äúY¿]ÞVXúY¿]⋨øúY¿]æÀИúY¿]æÀИùUræÀИ÷Þë‡æÀИö¡›â‹¨øö¡›ÞVXö¡›Ú!8äö¡›Ú!8ä÷Þë‡Ú!8äùUrÞVXùUr⋨øùUr⋨ø÷Þë‡ÞVX÷Þë‡---;;;PPPÍÂö¡›Ñ¶é¤ö¡›ÕìDö¡›Ú!8äö¡›Ú!8äõd°Ú!8äô&­ÄÚ!8äòéCÙÕìDòéCÙѶé¤òéCÙÍÂòéCÙÍÂô&­ÄÍÂõd°Ñ¶é¤õd°ÕìDõd°ÕìDô&­ÄѶé¤ô&­ÄXXXPPPfffnnnÍÂòéCÙѶé¤òéCÙÕìDòéCÙÚ!8äòéCÙÚ!8äñ«ÙíÚ!8äðnpÚ!8äï1ÕìDï1Ѷé¤ï1ÍÂï1ÍÂðnpÍÂñ«ÙíѶé¤ñ«ÙíÕìDñ«ÙíÕìDðnpѶé¤ðnpnnnfffnnnuuuÚ!8äö¡›ÞVXö¡›â‹¨øö¡›æÀИö¡›æÀИõd°æÀИô&­ÄæÀИòéCÙ⋨øòéCÙÞVXòéCÙÚ!8äòéCÙÚ!8äô&­ÄÚ!8äõd°ÞVXõd°â‹¨øõd°â‹¨øô&­ÄÞVXô&­ÄPPP;;;PPPfffÚ!8äòéCÙÞVXòéCÙ⋨øòéCÙæÀИòéCÙæÀИñ«ÙíæÀИðnpæÀИï1⋨øï1ÞVXï1Ú!8äï1Ú!8äðnpÚ!8äñ«ÙíÞVXñ«Ùí⋨øñ«Ùí⋨øðnpÞVXðnpfffPPPXXXnnnæÀИþý êõø7þý ï+×þý ó`hKþý ó`hKüÔ“4ó`hKû—)Ió`hKúY¿]ï+×úY¿]êõø7úY¿]æÀИúY¿]æÀИû—)IæÀИüÔ“4êõø7üÔ“4ï+×üÔ“4ï+×û—)Iêõø7û—)I æÀИúY¿]êõø7úY¿]ï+×úY¿]ó`hKúY¿]ó`hKùUró`hK÷Þë‡ó`hKö¡›ï+×ö¡›êõø7ö¡›æÀИö¡›æÀИ÷Þë‡æÀИùUrêõø7ùUrï+×ùUrï+×÷Þë‡êõø7÷Þë‡ ;;;ó`hKþý ÷•ëþý ûÊ·‹þý ÿÿÿÿþý ÿÿÿÿüÔ“4ÿÿÿÿû—)IÿÿÿÿúY¿]ûÊ·‹úY¿]÷•ëúY¿]ó`hKúY¿]ó`hKû—)Ió`hKüÔ“4÷•ëüÔ“4ûÊ·‹üÔ“4ûÊ·‹û—)I÷•ëû—)I ó`hKúY¿]÷•ëúY¿]ûÊ·‹úY¿]ÿÿÿÿúY¿]ÿÿÿÿùUrÿÿÿÿ÷Þë‡ÿÿÿÿö¡›ûÊ·‹ö¡›÷•ëö¡›ó`hKö¡›ó`hK÷Þë‡ó`hKùUr÷•ëùUrûÊ·‹ùUrûÊ·‹÷Þë‡÷•ë÷Þë‡ æÀИö¡›êõø7ö¡›ï+×ö¡›ó`hKö¡›ó`hKõd°ó`hKô&­Äó`hKòéCÙï+×òéCÙêõø7òéCÙæÀИòéCÙæÀИô&­ÄæÀИõd°êõø7õd°ï+×õd°ï+×ô&­Äêõø7ô&­Ä;;;---PPPæÀИòéCÙêõø7òéCÙï+×òéCÙó`hKòéCÙó`hKñ«Ùíó`hKðnpó`hKï1ï+×ï1êõø7ï1æÀИï1æÀИðnpæÀИñ«Ùíêõø7ñ«Ùíï+×ñ«Ùíï+×ðnpêõø7ðnpPPP---333XXXó`hKö¡›÷•ëö¡›ûÊ·‹ö¡›ÿÿÿÿö¡›ÿÿÿÿõd°ÿÿÿÿô&­ÄÿÿÿÿòéCÙûÊ·‹òéCÙ÷•ëòéCÙó`hKòéCÙó`hKô&­Äó`hKõd°÷•ëõd°ûÊ·‹õd°ûÊ·‹ô&­Ä÷•ëô&­Ä---ó`hKòéCÙ÷•ëòéCÙûÊ·‹òéCÙÿÿÿÿòéCÙÿÿÿÿñ«Ùíÿÿÿÿðnpÿÿÿÿï1ûÊ·‹ï1÷•ëï1ó`hKï1ó`hKðnpó`hKñ«Ùí÷•ëñ«ÙíûÊ·‹ñ«ÙíûÊ·‹ðnp÷•ëðnp---333ï1€‰ï1 1}ï1 Òpï1 Òpí€/Õ ÒpëÏY” ÒpêƒS 1}êƒS€‰êƒSêƒSëÏY”í€/Õ€‰í€/Õ 1}í€/Õ 1}ëÏY”€‰ëÏY”333---êƒS€‰êƒS 1}êƒS ÒpêƒS Òpèm­ Òpæ¼ÖÑ Òpå 1}å €‰å å æ¼ÖÑèm­€‰èm­ 1}èm­ 1}æ¼ÖÑ€‰æ¼ÖÑ--- Òpï1bùï1‚ó‚ï1„ ï1„ í€/Õ„ ëÏY”„ êƒS‚ó‚êƒSbùêƒS ÒpêƒS ÒpëÏY” Òpí€/Õbùí€/Õ‚ó‚í€/Õ‚ó‚ëÏY”bùëÏY”333XXXPPP--- ÒpêƒSbùêƒS‚ó‚êƒS„ êƒS„ èm­„ æ¼ÖÑ„ å ‚ó‚å bùå Òpå Òpæ¼ÖÑ Òpèm­bùèm­‚ó‚èm­‚ó‚æ¼ÖÑbùæ¼ÖÑ---PPP;;;å €‰å 1}å Òpå Òpã[*O ÒpáªT Òpßù}Í 1}ßù}Í€‰ßù}Íßù}ÍáªTã[*O€‰ã[*O 1}ã[*O 1}áªT€‰áªT ßù}Í€‰ßù}Í 1}ßù}Í Òpßù}Í ÒpÞH§‹ ÒpÜ—°u ÒpÚæÚ4 1}ÚæÚ4€‰ÚæÚ4ÚæÚ4Ü—°uÞH§‹€‰ÞH§‹ 1}ÞH§‹ 1}Ü—°u€‰Ü—°u Òpå bùå ‚ó‚å „ å „ ã[*O„ áªT„ ßù}Í‚ó‚ßù}Íbùßù}Í Òpßù}Í ÒpáªT Òpã[*Obùã[*O‚ó‚ã[*O‚ó‚áªTbùáªT;;; Òpßù}Íbùßù}Í‚ó‚ßù}Í„ ßù}Í„ ÞH§‹„ Ü—°u„ ÚæÚ4‚ó‚ÚæÚ4bùÚæÚ4 ÒpÚæÚ4 ÒpÜ—°u ÒpÞH§‹bùÞH§‹‚ó‚ÞH§‹‚ó‚Ü—°ubùÜ—°u „ ï1„”ï1$µˆï1(…V{ï1(…V{í€/Õ(…V{ëÏY”(…V{êƒS$µˆêƒS„”êƒS„ êƒS„ ëÏY”„ í€/Õ„”í€/Õ$µˆí€/Õ$µˆëÏY”„”ëÏY”XXXnnnfffPPP„ êƒS„”êƒS$µˆêƒS(…V{êƒS(…V{èm­(…V{æ¼ÖÑ(…V{å $µˆå „”å „ å „ æ¼ÖÑ„ èm­„”èm­$µˆèm­$µˆæ¼ÖÑ„”æ¼ÖÑPPPfffPPP;;;(…V{ï1-çï11†wï16ï16í€/Õ6ëÏY”6êƒS1†wêƒS-çêƒS(…V{êƒS(…V{ëÏY”(…V{í€/Õ-çí€/Õ1†wí€/Õ1†wëÏY”-çëÏY”nnnuuunnnfff(…V{êƒS-çêƒS1†wêƒS6êƒS6èm­6æ¼ÖÑ6å 1†wå -çå (…V{å (…V{æ¼ÖÑ(…V{èm­-çèm­1†wèm­1†wæ¼ÖÑ-çæ¼ÖÑfffnnnXXXPPP„ å „”å $µˆå (…V{å (…V{ã[*O(…V{áªT(…V{ßù}Í$µˆßù}Í„”ßù}Í„ ßù}Í„ áªT„ ã[*O„”ã[*O$µˆã[*O$µˆáªT„”áªT;;;PPP---„ ßù}Í„”ßù}Í$µˆßù}Í(…V{ßù}Í(…V{ÞH§‹(…V{Ü—°u(…V{ÚæÚ4$µˆÚæÚ4„”ÚæÚ4„ ÚæÚ4„ Ü—°u„ ÞH§‹„”ÞH§‹$µˆÞH§‹$µˆÜ—°u„”Ü—°u---(…V{å -çå 1†wå 6å 6ã[*O6áªT6ßù}Í1†wßù}Í-çßù}Í(…V{ßù}Í(…V{áªT(…V{ã[*O-çã[*O1†wã[*O1†wáªT-çáªTPPPXXX333---(…V{ßù}Í-çßù}Í1†wßù}Í6ßù}Í6ÞH§‹6Ü—°u6ÚæÚ41†wÚæÚ4-çÚæÚ4(…V{ÚæÚ4(…V{Ü—°u(…V{ÞH§‹-çÞH§‹1†wÞH§‹1†wÜ—°u-çÜ—°u---3336ï1h…Fï1›„ ï1ÍÂï1ÍÂí€/ÕÍÂëÏY”ÍÂêƒS›„ êƒSh…FêƒS6êƒS6ëÏY”6í€/Õh…Fí€/Õ›„ í€/Õ›„ ëÏY”h…FëÏY”uuuuuunnnnnn6êƒSh…FêƒS›„ êƒSÍÂêƒSÍÂèm­ÍÂæ¼ÖÑÍÂå ›„ å h…Få 6å 6æ¼ÖÑ6èm­h…Fèm­›„ èm­›„ æ¼ÖÑh…Fæ¼ÖÑnnnnnnXXXXXX6å h…Få ›„ å ÍÂå ÍÂã[*OÍÂáªTÍÂßù}Í›„ ßù}Íh…Fßù}Í6ßù}Í6áªT6ã[*Oh…Fã[*O›„ ã[*O›„ áªTh…FáªTXXXXXX3333336ßù}Íh…Fßù}Í›„ ßù}ÍÍÂßù}ÍÍÂÞH§‹ÍÂÜ—°uÍÂÚæÚ4›„ ÚæÚ4h…FÚæÚ46ÚæÚ46Ü—°u6ÞH§‹h…FÞH§‹›„ ÞH§‹›„ Ü—°uh…FÜ—°u333333ÍÂï1Ѷé¤ï1ÕìDï1Ú!8äï1Ú!8äí€/ÕÚ!8äëÏY”Ú!8äêƒSÕìDêƒSѶé¤êƒSÍÂêƒSÍÂëÏY”ÍÂí€/ÕѶé¤í€/ÕÕìDí€/ÕÕìDëÏY”Ѷé¤ëÏY”uuunnnfffnnnÍÂêƒSѶé¤êƒSÕìDêƒSÚ!8äêƒSÚ!8äèm­Ú!8äæ¼ÖÑÚ!8äå ÕìDå Ѷé¤å ÍÂå ÍÂæ¼ÖÑÍÂèm­Ѷé¤èm­ÕìDèm­ÕìDæ¼ÖÑѶé¤æ¼ÖÑnnnfffPPPXXXÚ!8äï1ÞVXï1⋨øï1æÀИï1æÀИí€/ÕæÀИëÏY”æÀИêƒS⋨øêƒSÞVXêƒSÚ!8äêƒSÚ!8äëÏY”Ú!8äí€/ÕÞVXí€/Õ⋨øí€/Õ⋨øëÏY”ÞVXëÏY”nnnXXXPPPfffÚ!8äêƒSÞVXêƒS⋨øêƒSæÀИêƒSæÀИèm­æÀИæ¼ÖÑæÀИå ⋨øå ÞVXå Ú!8äå Ú!8äæ¼ÖÑÚ!8äèm­ÞVXèm­⋨øèm­⋨øæ¼ÖÑÞVXæ¼ÖÑfffPPP;;;PPPÍÂå Ѷé¤å ÕìDå Ú!8äå Ú!8äã[*OÚ!8äáªTÚ!8äßù}ÍÕìDßù}ÍѶé¤ßù}ÍÍÂßù}ÍÍÂáªTÍÂã[*OѶé¤ã[*OÕìDã[*OÕìDáªTѶé¤áªTXXXPPP---333ÍÂßù}ÍѶé¤ßù}ÍÕìDßù}ÍÚ!8äßù}ÍÚ!8äÞH§‹Ú!8äÜ—°uÚ!8äÚæÚ4ÕìDÚæÚ4Ѷé¤ÚæÚ4ÍÂÚæÚ4ÍÂÜ—°uÍÂÞH§‹Ñ¶é¤ÞH§‹ÕìDÞH§‹ÕìDÜ—°uѶé¤Ü—°u333---Ú!8äå ÞVXå ⋨øå æÀИå æÀИã[*OæÀИáªTæÀИßù}Í⋨øßù}ÍÞVXßù}ÍÚ!8äßù}ÍÚ!8äáªTÚ!8äã[*OÞVXã[*O⋨øã[*O⋨øáªTÞVXáªTPPP;;;---Ú!8äßù}ÍÞVXßù}Í⋨øßù}ÍæÀИßù}ÍæÀИÞH§‹æÀИܗ°uæÀИÚæÚ4⋨øÚæÚ4ÞVXÚæÚ4Ú!8äÚæÚ4Ú!8äÜ—°uÚ!8äÞH§‹ÞVXÞH§‹â‹¨øÞH§‹â‹¨øÜ—°uÞVXÜ—°u---æÀИï1êõø7ï1ï+×ï1ó`hKï1ó`hKí€/Õó`hKëÏY”ó`hKêƒSï+×êƒSêõø7êƒSæÀИêƒSæÀИëÏY”æÀИí€/Õêõø7í€/Õï+×í€/Õï+×ëÏY”êõø7ëÏY”XXX333---PPPæÀИêƒSêõø7êƒSï+×êƒSó`hKêƒSó`hKèm­ó`hKæ¼ÖÑó`hKå ï+×å êõø7å æÀИå æÀИæ¼ÖÑæÀИèm­êõø7èm­ï+×èm­ï+×æ¼ÖÑêõø7æ¼ÖÑPPP---;;;ó`hKï1÷•ëï1ûÊ·‹ï1ÿÿÿÿï1ÿÿÿÿí€/ÕÿÿÿÿëÏY”ÿÿÿÿêƒSûÊ·‹êƒS÷•ëêƒSó`hKêƒSó`hKëÏY”ó`hKí€/Õ÷•ëí€/ÕûÊ·‹í€/ÕûÊ·‹ëÏY”÷•ëëÏY”333---ó`hKêƒS÷•ëêƒSûÊ·‹êƒSÿÿÿÿêƒSÿÿÿÿèm­ÿÿÿÿæ¼ÖÑÿÿÿÿå ûÊ·‹å ÷•ëå ó`hKå ó`hKæ¼ÖÑó`hKèm­÷•ëèm­ûÊ·‹èm­ûÊ·‹æ¼ÖÑ÷•ëæ¼ÖÑ---æÀИå êõø7å ï+×å ó`hKå ó`hKã[*Oó`hKáªTó`hKßù}Íï+×ßù}Íêõø7ßù}ÍæÀИßù}ÍæÀИáªTæÀИã[*Oêõø7ã[*Oï+×ã[*Oï+×áªTêõø7áªT;;; æÀИßù}Íêõø7ßù}Íï+×ßù}Íó`hKßù}Íó`hKÞH§‹ó`hKÜ—°uó`hKÚæÚ4ï+×ÚæÚ4êõø7ÚæÚ4æÀИÚæÚ4æÀИܗ°uæÀИÞH§‹êõø7ÞH§‹ï+×ÞH§‹ï+×Ü—°uêõø7Ü—°u ó`hKå ÷•ëå ûÊ·‹å ÿÿÿÿå ÿÿÿÿã[*OÿÿÿÿáªTÿÿÿÿßù}ÍûÊ·‹ßù}Í÷•ëßù}Íó`hKßù}Íó`hKáªTó`hKã[*O÷•ëã[*OûÊ·‹ã[*OûÊ·‹áªT÷•ëáªT ó`hKßù}Í÷•ëßù}ÍûÊ·‹ßù}Íÿÿÿÿßù}ÍÿÿÿÿÞH§‹ÿÿÿÿÜ—°uÿÿÿÿÚæÚ4ûÊ·‹ÚæÚ4÷•ëÚæÚ4ó`hKÚæÚ4ó`hKÜ—°uó`hKÞH§‹÷•ëÞH§‹ûÊ·‹ÞH§‹ûÊ·‹Ü—°u÷•ëÜ—°u endstream endobj 127 0 obj <> endobj 78 0 obj <> endobj 131 0 obj <> endobj 132 0 obj <>stream +%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 15.0 %%AI8_CreatorVersion: 15.0.2 %%For: (Aleks Kissinger) () %%Title: (tikzit.ai) %%CreationDate: 10/01/2018 09:38 %%Canvassize: 16383 %%BoundingBox: -47 32 537 566 %%HiResBoundingBox: -46.8945 32.708 536.5762 565.894 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 11.0 %AI12_BuildNumber: 399 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([Registration]) %AI3_Cropmarks: 0 0 512 512 %AI3_TemplateBox: 256.5 255.5 256.5 255.5 %AI3_TileBox: -50 -140 562 652 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 6 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 4 %AI9_OpenToView: -745 843 0.5 979 715 18 0 0 73 134 0 0 0 1 1 0 1 1 0 1 %AI5_OpenViewLayers: 7772 %%PageOrigin:0 0 %AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 133 0 obj <>stream +%%BoundingBox: -47 32 537 566 %%HiResBoundingBox: -46.8945 32.708 536.5762 565.894 %AI7_Thumbnail: 128 120 8 %%BeginData: 14412 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FDFCFFFDFCFFFDFCFFFDFCFFFDFCFFFDFCFFFDFCFFFDFCFFFD5BFF %A8FD76FFA8A85252FD0427F827F8272752527D7DA8A8FD6AFF7D52FD13F8 %27277DA8FD63FFA85227FD07F827277D527D7DA87D7D52522727FD06F827 %7DA8FD5EFF7D52FD05F85252A8A8FD0FFFA87D2727FD04F827A8FD5AFF7D %27FD04F8527DFD0BFFA8FD0BFFA8A85227F8F8F8277DFD56FF7D27F8F8F8 %277DFD1DFFA97D27F8F8F827A8FD52FFA827F8F8F827A8FD04FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFFFF7D52F8F8 %F827A8FD4FFF7DF8F8F8277DFD26FFA827F8F8F852FD4CFFA827F8F8F87D %FFFFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFFFFF7D27F8F827FD4AFF7D27F8F827FD05FFA8FF %FFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFF %A8FFFFFFA8FFFFFFA852F8F8F8A8FD47FF52F8F8F852FFFFFFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFFF7DF8F8F87DFD45FF52F8F827A8FFFFFFCBFFFFFF %CBFFFFFFCBFFFFFFCBFFFFFFCBFFFFFFCBFFFFFFCBFFFFFFCBFFFFFFCBFF %FFFFCBFFFFFFCBFFFFFFA9FFFFA827F8F852FD43FF27F8F827A8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFFFF27F8F852FD41FF27F8F852 %A8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FF %FFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFF52F8F852 %FD3FFF52F8F852A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FF52F8F852FD3DFF7DF8F852FFFFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFFFFF52F8F87DFD3BFF7DF8F827A8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF27 %F8F87DFD39FFA8F8F827A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FF27F8F8A8FD37FFA827F8F87EFFA8A8A8 %FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8 %A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFFD04A8 %F8F8F8FD37FF7DF8F87DFFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFFA8F8F852FD35FFA8F8F852FFA8FF %A8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8 %A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FF %A8A8A8FFFF52F8F87DFD34FF27F8F8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA827F827FD33 %FF52F8F87DFD45A8FF7DF8F87DFD31FFA827F852A8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FF52F8F8FD31FF52F8F87DFFFD48A8F8F852FD30FFF8F852FFA8A8A8FF %A8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A9 %A8FFA8FFA8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FFA8A8A8FF %A8A8A8FFA8A8A8FFFF7DF8F8A8FD2EFF52F8F8FD22A8FFFD07A8FFFD1FA8 %AFA8F8F8527D7D527D7DA8A8FD27FF27F852A8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8FF7D7D2752275227522752 %7DA8A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8FF52FD08F827277DFD24FF7DF8F87DFD1CA8AFA87D27FD0CF8527D %FFFD1EA8F8F8F827F827FD05F82752FD22FF27F827FFA8A8A8A9A8A8A8A9 %A8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8A8A8FF7D27F827F827F827F827 %F827F827F827F82727FD04A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8 %A8A8A9A8A8A8FFA87D7DFD05A87D7D27FD04F8A8FD1FFFA8F8F87DFD1CA8 %27F8F827F827F827F827F827F827F827F827F8F8F87DFD23A8A9A8A87D52 %F8F8F852FD1EFF7DF827A8FFA8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8A8 %A8A9FD06A82727F827F827F827F827F827F827F827F827F827F827F87DA8 %FFA8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8A8A8A9A8 %A8A8A9A8A8A8FFA8A827F8F852FD1DFF27F827FD1BA827F8F827F827F827 %F827F827F827F827F827F827F827F827F87DFD28A827F8F852FD1CFF27F8 %7DFD1AA82727F827F827F827F827F827F827F827F827F827F827F827F827 %F87DFD1DA8FFFD09A8FF52F8F852FD1AFFA8F8F87DA8A8A87DA8A8A87DA8 %A8A87DA8A8A87DA8A8A87DA8A8A87DA852F8F827F827F827F827F827F827 %F827F827F827F827F827F827F827F8FD05A87DA8A8A87DA8A8A87DA8A8A8 %7DA8A8A87DFD05A87D7D7D7E7DFD05A87DA8A8A827F8F87DFD19FF7DF8F8 %FD18A8FF7D27F8272727F8272727F8272727F8272727F8272727F8272727 %F8FD0427FFFD16A87D522727F827F82752FD08A8FF27F8F8FD19FF52F827 %FD04A87DA8A8A87DA8A8A87DA8A8A87DA8A8A87DFD04A852F827F827F827 %F827F827F827F827F827F827F827F827F827F827F827F8F87DA8A8A87DA8 %A8A87DA8A8A87DA8A8A87DFD05A827F8F827F827F827F8F8F852A8A87DFD %04A87EF8F852FD18FF27F852FFFD17A87DF8272727F8272727F8272727F8 %272727F8272727F8272727F8272727F827F852FD14A82727F827F8272727 %F8272727F852FD07A852F827A8FD16FFA8F8F87DA8A87DA87DA87DA87DA8 %7DA87DA87DA87DA87DA87DA87DA827F8F827F827F827F827F827F827F827 %F827F827F827F827F827F827F827F827F87DA8A87DA87DA87DA87DA87DA8 %7DA87DA87DA827F8F827F827F827F827F827F827F852A8A87DA87DA87DF8 %F87DFD16FFA8F8F87DFD18A827F8272727F8272727F8272727F8272727F8 %272727F8272727F8272727F827272752FFFD0FA8FF5227F8272727F82727 %27F8272727F827F87DFD06A827F827FD16FF7DF8F8A8A8A87DA87EA87DA8 %7EA87DA87EA87DA87EA87DA87EA8A87DF827F827F827F827F827F827F827 %F827F827F827F827F827F827F827F827F827F8277DA87EA87DA87EA87DA8 %7EA87DA87EA87D27F827F827F827F827F827F827F827F82727A87DA87DA8 %847DF8F8A8FD15FFA8F8277DA8A8A884A8A8A884A8A8A884A8A8A884A8A8 %A884A8A8A852272727F8272727F8272727F8272727F8272727F8272727F8 %272727F8272727F827F85284A8A8A884A8A8A884A8A8A884A8A852F82727 %27F8272727F8272727F8272727F82759A87DA87DA87DF8F8A8FD15FF52F8 %F8A87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA8A852F827F827 %F827F827F827F827F827F827F827F827F827F827F827F827F827F827F827 %F82752A8A8A87DA8A8A87DFD05A82727F827F827F827F827F827F827F827 %F827F8527DA87DA87DA8F8F852FD15FF7DF8277EFD17A8FD2427F827277D %7DA87DA87DA87DA87D7DFD1527A87DA87DA87D27F87DFD15FF52F827A87D %A87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87D27F827F827F827F8 %27F827F827F827F827F827F827F827F827F827F827F827F827F827F827F8 %27F827F827F827F827F827F827F827F827F827F827F827F827F827F827F8 %F8F8277DA87DA87DA827F852FD15FF7DF8277DA87DA87EA87DA8A8A87DA8 %A8A87DA8A8A87DA8A8A87DA82727F8272727F8272727F8272727F8272727 %F8272727F8272727F8272727F8272727F8272727F8FD0427522752275227 %27F8272727F8272727F8FD0727FD05F8A87DA87DA8A852F852FD15FF52F8 %05A87D7D7DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87D52F827F827 %F827F827F827F827F827F827F827F827F827F827F827F827F827F827F827 %F827275252A87DA87DA87DA87DA87D52F827F827F827F827F827F827FD07 %F8277DA87D7D7DA827F852FD15FF7DF8277DA87DA87DA87DA87DA87DA8A8 %A87DA8A8A87DA8A8A87DA852FD232752FD05A884A8A8A87EFD04A852FD0A %27FD08F827A87DA87DA87D27F87DFD15FF7DF8F87E7D7D7DA87D7D7DA87D %7D7DA87DA87DA87DA87DA87DA87D7DF827F827F827F827F827F827F827F8 %27F827F827F827F827F827F827F827F827F82752A87DA87DA87DA87DA87D %A87DA87DA85227F827F827F827FD0BF8527DA8FD047DF8F87DFD15FFA8F8 %277DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DA87DFD2227A8 %7DA87DA87DA87DA87DA87DA87DA8A8A8FD0427FD0DF8277DA87DA87DA852 %F8F8FD16FF7DF8F8FD127DA87DA87DA87D7E2727F827F827F827F827F827 %F827F827F827F827F827F827F827F827F827F827F8527DA87DA87DA87DA8 %7DA87DA87DA87DA87D52FD10F852A8FD057D27F827FD17FFF8F852A87DA8 %7DA87DA87DA87DA87DA87DA87DA87DA87DA87DA8A87DFD20277DA87DA87D %A87DA87DA87DA87DA87DA87DA87D52FD0EF827A87DA87DA87D7DF8F852FD %16FFA827F852FD177DA87D27F827F8272727F8272727F8272727F8272727 %F8272727F8272727F8FD0427A87DA87DA87DA87DA8FD0B7D27FD0CF827FD %067DA852F8F8A8FD17FF27F827A87DA87D7D7DA87D7D7DA87D7D7DA87D7D %7DA87D7D7D847DA827F8F827F8FD1A277D7DA87DA87DA87D7D7DA87D7D7D %847D7D7DA87DA87D52FD09F82752A87D7D7DA87DA87D27F852FD18FF52F8 %27FD1A7DFD0DF827F827F827F827F827F827F827F8F8F852FD187D2727F8 %F8F827F852FD097D27F8F8A8FD18FF7DF8F87D7DA87D7D7DA87D7D7DA87D %7D7DA87D7D7DA87D7D7DA87D7D7D52FD1BF8277D7E7D847D7D7DA87D7D7D %A87D7D7DA87D7D7DA87D7D7D847DA8FD057DA87D847DA87D7D7DA87D52F8 %F852FD19FFA8F8F852FD1A7D27FD1AF8527EFD277D52F8F827FD1BFF27F8 %52FD1B7D27FD18F852A8FD257D7E7D52F8F8F8FD1CFF52F8F87D7D7D537D %7D7D537D7D7D537D7D7D537D7D7D537D7D7D537D7D7D52FD18F87D7D7D53 %7D7D7D537D7D7D537D7D7D537D7D7D537D7D7D537D7D7D537D7D7D537D7D %7D537D7D7D5227F8F8F8A8FD1CFFA8F8F852FD1B7DFD17F852FD237DA87D %7D5227F8F827FD1EFFA827F8527D7D597D7D7D597D7D7D597D7D7D597D7D %7D597D7D7D597D7D7D5327FD16F8277D7D7D597D7D7D597D7D7D597D7D7D %597D7D7D597D7D7D597D7D7D52FD077D5252FD04F852FD20FF52F8F8FD1B %7DFD17F852FD1B7D27F8FD0527FD05F852A8FD21FFA8F8F8527D527D527D %527D527D527D527D527D527D527D527D527D527D52FD05F8275252522727 %F827275252522827FD04F8277D527D527D527D527D527D527D527D527D52 %7D527D527D527D7D52FD09F82727A8FD24FF27F827FD197D52F8F8F8527D %7EFD0E7DF8F8F827FD1A7D27F8F87D5252277D7DA8FD27FF7DF8F8527D7D %527D537D527D537D527D537D527D537D527D537D527D27F8F8527D7D527D %537D527D537D527D537D527D7D7DF8F8F8527D7D537D527D537D527D537D %527D537D527D537D527D537D52F8F87DFD2FFF27F8277D7D7D537D7D7D53 %7D7D7D537D7D7D537D7D7D537D7D7D52F8F852FD047D537D7D7D537D7D7D %537D7D7D537D7D7DF8F8277D537D7D7D537D7D7D537D7D7D537D7D7D537D %7D7D537D7D27F827FD30FF7DF8F82E7D527D527D527D527D527D527D527D %527D527D527D7D27F8277D7D527D527D527D527D527D527D527D527D527D %7D52F8F8527D527D527D527D527D527D527D527D527D527D527D5252F8F8 %52FD31FF27F8277D7D537D7D7D537D7D7D537D7D7D537D7D7D537D7D7DF8 %27527D537D7D7D537D7D7D537D7D7D537D7D7D53FD047D52F827FD047D53 %7D7D7D537D7D7D537D7D7D53FD057D27F827FD32FF7DF8F8527D7D527D52 %7D527D527D527D527D527D527D527D05F8277D527D527D527D527D527D52 %7D527D527D527D527D527D5227F852527D527D527D527D527D527D527D52 %7D527D527D27F8F87DFD33FF52F8F87D7D7D527D537D527D537D527D537D %527D537D52F8F87D527D537D527D537D527D537D527D537D527D537D527D %537D27F8F87D527D537D527D537D527D537D527D537D527D52F8F852FD35 %FFF8F8F87D527D527D527D527D527D527D527D527D52F8F852527D527D52 %7D527D527D527D527D527D527D527D527D527D527DF8F8277D527D527D52 %7D527D527D527D527D527D5227F8F8A8FD35FFA8F8F8277D527D537D527D %537D527D7D7D527D7D27F8277D7D527D537D527D537D527D537D527D537D %527D537D527D537D7D52F8F8527D7D7D537D7D7D527D527D527D537D7D52 %F8F87DFD36FF52F8F852527D527D527D527D525227FD045227F8F8277D52 %7D527D527D527D527D527D527D527D527D527D527D527D527D5227F8F827 %7D52522752527D527D527D527D527D27F8F87DFD35FF7DF8F82E527D527D %527D7D522727FD09F87D527D527D527D527D527D527D527D527D527D527D %527D527D527D527D27FD04F827F8F8F8272752527D527D527D527D27F8F8 %A8FD34FF27F8275259527D527D5227FD0BF8005253527D5252527D525252 %7D5252527D5252527D5252527D5252527D5252FD0CF8277D5252527D5252 %F8F827FD33FFA8F8F8527D527D527D5227FD0DF852527D527D527D527D52 %7D527D527D527D527D527D527D527D527D527D27FD0DF8527D527D527D52 %52F8F87DFD32FF27F8F87D5252527D5227FD0FF852527D5252527D525252 %7D5252527D5252527D5252527D5252527D27FD0FF8527D527D52525227F8 %52FD31FFA8F8F852527D527D5252FD10F8277D527D527D527D527D527D52 %7D527D527D527D527D527D527D52FD10F827527D527D527D27F8F8FD31FF %7DF8F8FD0652FD12F827FD185227FD11F8FD0752F8F87DFD30FF52F8277D %527D527D27FD12F827527D527D527D527D527D527D527D527D527D527D52 %7D5252FD13F87D527D527D5227F852FD30FF27F827FD055227FD13F8FD16 %527D27FD13F8FD05525327F827FD30FFF8F8277D5252527D27FD13F85253 %527D5252527D5252527D5252527D5252527D52525227FD13F8FD04527D52 %52F827FD2FFFA8F8F8FD065227FD13F8FD1752FD14F827FD055227F8F8FD %30FFF8F8277D5252527D27FD12F827527D527D5252527D5252527D525252 %7D5252527D52525227FD13F8FD04527D5252F827FD2FFFA8F8F8FD065227 %FD13F8FD175227FD13F827FD055227F8F8FD30FFF8F827FD04525327FD12 %F827FD1852FD13F8FD0752F827FD30FF27F827525228525252FD12F82752 %28FD07522852525228FD0752285227FD12F827525228525252F8F827FD30 %FF52F8F8FD065227FD11F8FD0A527D52525259FD0A5227FD11F827FD0652 %27F87DFD30FF7DF8F828FD055227FD10F827FD0652FD05F827F827F827F8 %F8F827FD0652FD11F8FD0752F8F87DFD31FF27F8FD06525327FD0EF82752 %535252525952FD0EF8FD0752FD0FF8FD06527D27F8F8FD32FF27F8F8FD07 %5227FD0CF827FD075227F8F8527D525227FD04527DF8F827FD065227FD0D %F8FD0852F8F852FD32FFA8F8F8277D527D5259527D5227FD09F852527D52 %7D52595253F8F852FD0AFF52F827527D527D52595252FD0AF8277D525952 %7D52595252F8F8A8FD33FF52F8F8525252535252527D5228F827F8F8F827 %27525259525252535259F8F8F8A8FD0AFFA8F8F827525252535252525327 %27F827F8F8F8275253FD0852F8F827FD34FFA8F8F827527D527D527D527D %527D527D527D527D527D527D527D527D27F8F87DFD0CFF52F8F852537D52 %7D527D527D527D527D527D527D527D527D527D527D27F8F8FD36FF7DF8F8 %2752595259525252595252527D5252525952525259527D27F8F827FD0EFF %F8F8F8FD045259525252595252527D5252525952525259527D00F8F87DFD %37FF52F8F827527D527D527D527D527D527D527D527D527D537D5205F827 %A8FD0EFFA8F8F8F8527D7D527D527D527D527D527D527D527D527D7D7D27 %F8F852FD39FF27F8F827527D527D527D527D527D527D527D527D527D27F8 %F827A8FD10FFA8F8F8F852527D527D527D527D527D527D527D527D5259F8 %F8F852FD3BFF52F8F8F8277D7D7D527D537D527D537D527D7D52F8F8F827 %A8FD12FFA8F8F8F827527D7D7D527D537D527D597D537D5952F8F8F852FD %3DFF7DFD04F827527D527D597D527D52592727F8F8F852A8FD14FFA827F8 %F8F82752527D527D537D527D52522727F8F8F87DFD3FFFA852FD05F82827 %5227522727FD04F827A8FD18FF7D27F8F8F82727FD05522727FD04F827FD %43FFA85227FD0BF8277DFD1BFFA87DFD0DF8527DFD46FFA8A85252FD0527 %527DA8FD20FFA87D2727F827F827277D7DFD7AFFA8FD2EFFFF %%EndData endstream endobj 134 0 obj <>stream +%AI12_CompressedDataxœì=‰BIÓÿ ä•0Ó×ÌèzäD”kÁóó`ˆ„s¸«OÿWuwõL ˆ»gu¡ÒSÓU]wWOær[;K…ƒö^}‰ç½lfn®Ô©×zíÎý¬†fW›Í~·×AÐÂöbÖ—yVÃ];ðU½Óm´[÷õGyVñî…B³~ÒÍ>ot»ÖQ½³˜]X„Ï^4zÍ:|Úkœ|kôòµÆ"=p”k=øÌ÷–=™y~˜õ¢û<ĵ֗ ú†+r€ÛýÖ .¶ÿ¹Ÿ]A–³¬äAV*Ÿ>ml×»CCT>Œ„„qùÀ a¬ÊË@ÁMJâpS¹½ß?­·z[ö~½Û-µ›íN÷~¶ôµÖʮ׎à“Zöm½Ùlÿ-6kû'àƒÜ­6šu ù´ÖËú>r§°ê³Ýb¿Ñ<ØèŸîÕ<ŠÌw5Ê—]Àhñg»«§Ù©÷z0Yx rx{¥˜œõµðn»~ÔÐ  û°hÑvÚg§µÎI× “>ÿæ³õÓ³&0V3I þ•ú_÷³ „VI/»ä @ìQÒ"Š¹SÿÒ¨ÿ}?»ÑnÕ +ÞŽY!<Ïük>Ùî7ë—­F¦¦¬·êMïî¯6kG]¢Òÿ5^Ô:Gõ,i»Ùïii é ÀãµÚ×:.”0Ø<«·^´_é9.°â¡àYh‚(ø2‹’WÀ³>î‘~ü¯ÁŒx ¡‚Å{ Öj³Ó8j´îÛù»+ÆA¼~ˆæMB>Lü诙+ÝëÕ[– 7¥õ„xùõxb¥uPjŸ"ï»(ø -fûÈ|æ~ÖŸÀíý3C€þ}–i«Óh!Î̆þ$ÜÝjöᣕN»¶Ú:lgŒ²Ãl:õ¬ùVÿJÿ]=[¼ðîrýÔ ¾Ý@+­/õfû,ÖAj­ƒìëZçìrÔ[ÍZ«ÖÉj¸Ã¼ÖøŸÔ€´w ›)¬êY}¿§oÑC†pÁ€ÄG—?èE§¶ÜÏnî}‚[àn pJÙ|íì²i×zÇ`ê­ƒ®C`~dƒ]>»}ÁN¶Øéw³/Úí¦C;ø‘ÃnÁŠãÓñŒ-}Ck³e4ú$;`øI`|R÷}þàÃ4c/ÕšÍÆQ§vvÜØ÷€1Ÿ»'™Ï®"X_O÷ÚÍF÷4–§d«Öé5ö›õ¯Ý^ýô"lÈÃFëq§ßèÕãÙ¶OÏ0ŒÈî×Îêg︪Gî8„rÌpÒÐ.-eül±•0Ã+ÚA,8Ä>/[­Úiý {dAYî-fÆBÁ{ðlñ ó.óG&*ÃUŠŠp¢( +Á™‘Šd$àâ‹üÈ‹¼°VÂrXÒ‹a®( à T¡ E¡SÈB?ô‚j&¨å ƒBeÁÜ(aGéqz˜W~P2`pù§ªªWY•T®‚ŠT¨¥”Ì(¡¸bʇË3O0«öу8 Vˆ€kÌ„»<„ÛbGä‹ßSž¬ê'Š Î9㫲2+±"‹X“•L0Î|,«~Ù/ùE¿$0;é ŸûÌÇ?žWõ*^Ù+yE¸ +ä)\0Oé'Àã.“\ Æpqr±ð\´|Ì€ðœ,[NÆÜåAžZÍ7\äâúó"ô.æ.ž9 Z"2 ƒ"AÂT*”…*™)#FpýÍÚ+j.V«ÕJµ\-U‹ÕB5ª†Àa (ª¼Êª>x j¥R)WJ•b¥P‰*a%++¢Â+¬âƒª–+år¹T.– `% ¿*˲(ó2¡ôJÕR¥T.•JÅR¡•BXJU’%Qâ%VÕ+V‹•b¹X*‹06a1+‹¢È‹ ,„—)T •B¹P* …BqD2$ ¢À ¬à¼¨Ul@BሠFl(â‘¢ A2‰„%" Š(ª ïO¾¿4SPHq#¸èg ‚ø¡|Ì Är×æãu¸x.3åð‡ò‘eP $3C1qÌÇïâdð¼Ëxyè:’ÊJøŸçá;™¹ÝÑŠ]ÍD U>'ß1îC¸Ë¡ý ÆË./¡Ìã‚š<7WYk´êºðb“2•Q<“QžâŒíÕB¾0aIc[ +>5ãœ*ºTtªäRÝé 3=ßBÈ»Q¥¨q¡É dLl|nt\Ì$d +üx"ð‹ã{ +þƇJ‡f@„ :Ô1 vÄ»Š1ˆº\±ç üxA €î"Àt¯ o.àŸ¢VøFÿXí1WÙ^}Uñ*êÐ\¨t?$ðZÙÌPÀdB¦Ñ€i4ðÄ ™üŒ[f¥ƒÎÂáK‰p)±Ú‰l(sNÈ9fÙãðè¢uÏPjg–=±ð£KéØŸ¢ÿѵ×ëžqKŸ\øá¥/$Wü:áï9)„YËq)ĸàwp%Ç¿ùf†ˆËÖW2¹–æ¢$†¿¨ÄFI‘+C¯¸<ð¥µÍèÅÅå5Ùo8Ó ¯0­1­2­³Ur\ëLb±ãåÖ n—Ü(¼Qy­ô¿R~^®¬L&,L†Är¬ë0B[–á<öF#^Ì€ðU´àq-sÆI”ÑA€¬ í + _(]>È"¢2ˆ‚#A`°2Ra Å°KÏ`¹XÞbTÖJ+@GCÐÅ2XYB áM¡NùzAì~ ±ÿrø5|MÈfLRà +؃X†¨[–BÅ`9¬ª'ªÀ´2X•"¬u+ÀºK°9Â_x¼ +ƨ&©”ÛT) AVÈŒ)(úº¤X±EÅ‚-+*SX¼ IêÓ:åe~È*ÂÒf&_Cðbº<ü›¬å¿œ\B’þƒtÒ­fæ*iVs 9Ÿ™¤e×O°.Ƞؘ Ša¥(ƒ*I{aŠ±Hh/'@`Š¥ä2¥ +TÃð²ï.†W$/‘¸¤»”½ý—.Ï”uH¢Å·¼2úE-ÙÅï¾b áðÙ+tW ÿšKÅ—ÙùA/LM—eªöïÂfÚ¿kÏA›ùa¹Ÿ¹R˜^Ѓe@Ê•Þ^)CèƒFH]Ä/šPÏúy©=}Ö¢6§q•c,ŽÑwEgV˜Qñ ¨®]eŽ@©‹°ePò*AåAŠAùAôÚ›•§5/Ø5O¬uÆ.·—\l»Ò|`ÕÈDi®™1½'VÑ{b¡Þ~QvG,Þ +é0Ü¥Å~z$ùs×<ŠÀã(öüø5t•“]m5ƒÙŠ h½Œoþ0·Û \ÚevÄB›HG:!(ÚB mA@äks1Œ!Ëè” a¡ƒaLÍ09 ôÆTNÁ¹ddǤÞn¿Ó6¦ÃfHÞ2:£M Àeä˜É¡ºa6WÒ]Y‡QU³©¡ hi³>iÐ+‹1†¢Œ·”pL™ó=Óå‘Æ8×”q¾é»bQ甹,Ö€•£Íèhd;ÚìÖj?¼‚s¯ðÜ+Š¯Lòk\Æ]Ås¯¡?™O4sUÇ_k×Æ]þ9‹¯ä´‘v]™ávKÐ$ñ&W¶VØŠ ¦ô‘Në .µ/Ùô^Ûý eù.ÓŸë›l?™ñ‡‰ +O¢Ê“Êý+ZEÆçÿ¦ìWLý'.ýé +P¦P(‡Š~e*ú%J~hP‡…¾¤öSÆSAªšÑî*Ҹ̟’v\檠£K;2ãÌ’K\ -™¹„õ|tÉÁ릗=nBß–í¹+ ¢û¢o –öyä¥ÀŒf´[ŠRŶk ã@3ôjT7¥W?ôÏ¿„²<—Fbèëô’¿¢NMú§ ýƒäR¿Dâgó>™q‰¦}Eö &}Ì&}&åÄOê„O§{6×ÃL/ÐJ/°Œi^E;ÓÌ :QMT ÌA¨Ý&8LÅ¡Ÿ4[èK€#ˆåoÞX?©j[Ä*6ø,Ùv®¢1^ÚJ†¶± }´n“ÚU ÝÌ CÓF¦Ý6:lq(j^Ðf7ÔŽ<Ð{;R{sôçTñ‹+¹TÇ¥r­ñ˜øG{fíPM9ÊúYªëËøaôÈÆ;O>ÛxoãÉW7ŒãùM`c˜XÁÄ &Š0…‰/(Þþ'|þ˜‹\|äÉ+cc.5rc®pðʸúÞðUsÇ^¥ä•±?Œ/~TιªÉkLÿýûóãâ2ku,jUDEä:‡©ê¦¨³Ô<Ô;s$uÎèêš°yf¶Ú—Ñ©M 3f‹}”/tŽØìÀìBù. D€’›X#èc¦sÁ1ˆ¡ø€Ÿ D™ñA‚®ÒT]u†»HÁÄ +a¢CÅ[ˆÑ™m·ËîŠ lqŦà.Óu‡þÿ õ3ç'büÁð>ìã°žúE9¹ÊëCA|цïÉÐ]Ú BvÏÆê©ÇQº‹Ð36@Î+CQ9Åäc4ÎÇÄâ•L2×¾e0lñÍ泶4'mžpÅ;f‹y~Ò·êÐU¾Bç%û)“ÝZÉ^­ñM1ãÎ( £Iôj tkvÞQd˜àu|(26DL†ðÔri‚ø8Œ7ábÊÇyq@_ɸó ya“¾ÐÂ8XOŸøy©˜Ì†úñ<žÌÁ¦ç%}ì<úÏ éEú¸|À¤Àóòž!ÑbPùÀW"+Ã|&¦¯ƒDÏô D9ªP<í;`þ"BžÛ;E 1e<L}üüﻟŒÌòÑ÷¹{Dz<ŠobyÃB¤"ŠÍ W¼Ñ>-÷†t“ÍykVÙdwÄåc¯Ò± ?Õšƒ声¬?í(Ÿv”O;ʧåÓŽòiGù…§åÓŽòiGùíBžv”ÿ:kùÛu”OÒ)>i×ùwgPlLÅ5vAM«€Ó*à´ +˜’*àMµ§{2ÿâžÌ´ƒcÚÁq]ü(¦ÓŽiÇ íà˜ž_™ž_9ײOþ™ž_F8=¿2=¿2=¿2=¿2=¿2=¿’Žó+Ó·›Lßn2}»IJNßn2}»Éôí&7åí&ïþ•NÞÿ¸ùçõ\§¤ç<­ù?û¬ÂÄý#ßœä«qߧÐé{ʧ]åÓ®òiWù´«|ÚU~ ÂiWù´«|ÚU~c;‘§]å¿ÎZþv]å‰Þðˆå¹cºÆé“Á÷•s™‡ü2Ó‹NŸ\”Y~‹í…ß#ÎÍ'ö!Û<<ìÖ{ÙÏýZ§Þ¥¯B†dìœÌ·Õ˼„¾þèù0뾦Ô&ŒÙ7_õ¯ÏàÇOü;+²ëÙw¼ì†¿Ù¶|9Õÿ·X²kðÛ昧óìÿ[úçM´BìÑ!æÊdæŽò€I3¤ŒtN é½N®™/•†ètÿMíLæþÞéëÕ+›H‘'uöøœ6}S}^˜'2•‡ø–dÄJ?`,Ê ™ç!Æ…<Œî]ƒfåé 1˜5Ã"RÍõÃd>Œ<Å ´–q–‘2ôÒã`‰[5^raè §ãï÷€q3ß–£Ï÷%pƒÈ3„æYÖœ‡¶–€‰0Ï•o°Ð½ã`É{[D"I„œ\)XRéyJa}$ +1;ЫŽKK¢4U˜µ?ÙÕ ¸Ãg‘a <݃̂@k ÌB…‘4Ø;ÇÁ·Ž +¤'åë9b1W—»$äYMG$ð /}æ4þ/pÒfÊ X*< , Bi–`>*±8ÌGmŒî]ƒoP`EÇÌ) ¤ÉÐ<ŒcaŽ9ÐZ$ò‘ ¹å1Ë3ˆl´–)x‹?õã`‰[G„Ø«Å ±­-B\„Bs\W{½|ˆŠ#­žyÉ:úÿi6h=7fmÌ}#ÖPpì,ÚL! Ö<¬8RnakIÌ2Š™+sï8XâÞAùÂE…ˆ% <ò°º~j´•@k1H›ÄÀ²ÕÞ9–¼µ•#ÏÖPùaæÈh:GW„•l½wܶÅoÏ„6 ¾1d¦p>ķ‰gì¼9Ž!eÛКxyŽEyñ¡~,^è#^ [KÀÈB¯%îKÞ븉sAeµµÇãF¼(°Üy‚#¬š7J›4™›‹=jfI}˜ÜB°µ ¨‡Ó,Ý;–¼wT ð´ª K ŽÞÔç“K‚›46{(€9MÀ.Súù²€(^Bz€êKíýB2Ú:;ÐZ "Ÿ°–¸s,yë8£=ô„Ósn÷ˆ133ß8ÊÐáˆô³d–­u÷aQl-#·³–¸w,yïEz|iP9<™Ósâ&â¦×ФÇÀ’÷; 9·§³žÝÆCq´AD)&㸹g H¢ q­%@À0GÊLÑÞ9–¸gó2S1© äB6Mù®Ü(4Ÿ;ýî1áq{RŠYÐ"äzøûæïL?3òŒOxtº³q™Ïz +ª.%jã]XV01xmÌ0 58‰ä°CÒÊ Ø\;¤1Ø•ßØ!¤Ð3•1.ü0k†‰Ð(ÑÎLƒ\¢ sC¢¡6À `«‚CûðRæPsÆIæ ½å§ÄðCc†Ÿ<0ÛT,>3–s¥ Yg1Gº”4‚„\¢KæÓX.‰6©Ì@ d L +Øû#ˆÚ½ÐLÀ$²!”>„ÿ•é±¡a½y ˆ7èk\ØÉ2¥”‘ó¸JZöÊ€q ä¾oñJ à ^Ó¢ Xz;–1H+ •ËCE<‚(F ·À’Ù±¸ï@BF~h2ö~‘ÇZ¼13€1@æ-ÐW‚&à¿ Îm lË”e—|·Ð( &cÍ‹IÃq3 ”}ƒÀHºYI9‹ ’€ÖY`D‹ ¥s’¯'Ã<ó••£0²³á`$`ÎíýH¶²s„å!9M*@Á·÷[áB½Ýý&t0"ëÓý*2÷c ƤFÈxDW®(­ðAZæFIfe$(9-´)°¼™r@"i üÈZ1±OÀíã³(@¢€µ†Ûž´³å^Hx±ËÁè˜ 9 X…ž…Nq 0â$I¡ + âté°„/3‘º™/(¯Å AXVkÍ - ¥H0͹3Úf[ |;cí œ®ç‡ÊN!òh}i¤Fú"^IAô¢u …Û`Æ‚Ø ‘0Zj!©9‘€ÕƒÂ¡HÄXرôˆãhÜ-0 HÇTAÄÉЄÜL 4±¹¡f !=)"ÝG06¦ph¥&ÌãølS±@Ìž¢QИ?F>÷IŒ±W‘±91· ‚W‘Ì: +RÝ{„€ÖXÉ!àÜ9`T2ˆ±‰€t×± ÂHË)Ž]ð¹IìòiR@[|’¢À3¢n°FFŠÛIm P×',©B9æEcp ãÂyfìŒ ÀuY¾r¥%#@'ÈÈøaâZ"ô(aÜ%‚0Þ4Ûnç”Ì#EšÌ‰`답}(7£Äœ û)§ïsËH_°Å8ûÖŽ À瓧±xAå˜pZdÒ7´4æYà,Á:Zw¿Df xŸ@{PÒcåAäqÒyP=Vè¼DÀ„<äA`Å9‰ ã4ÈËͳ$æ<Ã,”°˜!O˜Bƒ©ˆ ½žÓmO) Þ€ÿ"Š¹ÐΚãI0D!MŒGqÆóÞÀE,>)âõIdÉßÊEÑqx@ä‡Â#ÇZv‡MÜÇ·cO8û`YÀ’’È1§Þfð! „ÍXlå'Ö˜À0ŠÄt-Ä Ë)œW¡õ»E`% ÅÊhüMÜÀÈùÞ(V9&S„0W‘ØãË,¬aH~•o211 ±FÚë…ä¾ü t÷ƒägE÷Ǯ݌fòIÞ'^L)¨÷€ùY ßN<²0p@%‚XĽ(°‘#€Eàq8f`!óy‚‰¨-¹@gMh¥çË¡¥‰tË"àÖ Â“ÀýP0å‡òÉNH[0â¾*PH†W{ä©°É q_Á„ÀØôP'rŠ¦e| +½BÇ!"Ë +suS)…s%!ôóL¿CŒ7 ¬÷€¶1£7ô"2õºŒdœÑ£8é €ñð‹XXÂWPH @)Ȧ)æÙU°ÈÙÈÐX`kÓ8é¢Aú¤ ¡Oñ;€u bÈTdǘ¬À# ¤ÄI‡@WâÑ» ÆÃ,EBg)80¾–ÇNŒÛ`„H¢l€‡X#Ò%(0ülhb(ÆZç-‡<îÂ0ß…÷ |³´>w@02â€L8Ìí÷š N–C»1 %!‘1‰StÀZåRF¢œY­Ð˜½Uš(páRˆ±6Z PF‘½§¬¸£¯#5œÝÄ99ë&·ùŠØP€LR$bK³‡eýˆ@õÂ76Xù´(N¨¯" ó \|.MtKBF9À°{ÀÜ(¦¾&è Ñ­I. g5FÅ‘h¨[ó“zd€2+6Ç Xš€P¾C \€+\Õ ÀÚÍp`¥80‹:¸ AÂJãö†Ã«ùlµÞò¨m[b@` µäªŒ¹º&B\B*/báô $³’d„.'Bᶦ܈ÈFÚL €Âi\PˆF‰2²â =,Ð <“²Ä6R#@°GvGç\è¹pÎêÂ|’ÄQ‹÷GäRÚdNñBψ=yDN#r¸¢"Gè` yÒv ®°YGEŠa… "¯ˆªm¾ UäFfÈid„‡Wέ¿0*9ÂÊâ6=zJòiè%Ìý ÌÝO- $y½D¡ß·OòÝýؤk£›'P0BFÎ-0°¥6DJ¡7Çp¡•Y³`È@É{WGáœ$–{Ò}WüÑ·´X$Y?À8¶ÑѨJ›ì ®µ°ô(Ôà0tbV¸™-TEÒ¥ëIG‰àÈ‘„ p1Œ²É"±ß‹„ˆÜT„¦šÓ¼°¶i±*²&zw…f@ñièSyVÏÀwBo +ˆ7 _lŽ@ŸæŠíÕÕa¥+zDhßA´vI(j•Š"®&RpÅ…-˜LÏ#¯ø‘R%ý …ãö¸S;IöÿXõ°ú¥\qÅ€À|GÖ«[±fÁÂÆÊT5 …T +^A"œÖ®“ð +—hHë\¨"Z)M$a‘Èã ™3°öîâif·7p4¹«„慉ʞ´I§0H¹tì4ëz²â¶…®’ðJÌíoy’cÀ9(J*[êÂG r7Ú%Ɖ9FJvÎ_E65Ó3p +)âû±Á|0r0 £8›B_Æ%¥Ð% QV• + +hβÈ…smvÍr +|¤ó6Q"7ŒlÞ @!5[AäL#¾Q…I=µX#*G6@ ‹´u|/’PD:¹i12Öq]À2¢š6­WärP[”`à¹Ø³º_9'!M@9/¬}£}§€Ü…ÞQ\®ÓFÏ +'@]˜§íŒÇ>×M6tq~‚…qÙ@‹!=LO1i@#<¶óÃ:µ3@ª *SêÑ[w6Fk%lÞŽÀ¸¡D ¶ì‘pÛ˜TƒU,ÞQdö0½¸Žè$ ùd&H ,²q¦Çlaɀɽj‘!´´É`5 ,£™¼T¤À¼†&‹‚G„iS‹##IŽAG31—mP8ˆ`RO[B•ë\j‹@JAlðL·G®@áøÊ]‰^™ºg‰|Š„4ØÆ'À,šé·Õ8 +Ó+³¿h`Ûq;âf6h×@aŠ¶¤]0eöó ”tZlËjiº+ìR[ZfX#0óôœ Ó‘¯*Êa…ÙðB ó©’AÊ¥¡®‚çÖ:ŠD™ýkuÚå/ F,Xhå˜mh \8=ŒÓe3!XçΖ±JÒXÆ,Ùu ÌΗYWÚÓC¯ŒLˆ@øÎqD„4ˆ\)†L4‚utïžµf¡ É@ooÀà‚eD†ß¤¬YX-ׄU9ípHC­áD ÷œ5õ# ð“^†H^ãSH¦DÑÖqäE Æêaƒ·Y\r+|KWduPÐr“Î3a…#r5‹!´{ &©€üÎI§¢z<©ækã3À×ÍfVlâ¿»=8eŠÑ˜ 5Å °Íjpbº Ákm´b¦Î„c#g#d`l„›ƒ>á ìÖœF (¹ä¦ø„@î 2H# ÏEˆ¶€P]d´¡EØ¡R +p³¯„@|t‚B@aª2:‹ÀVu”I PGuÖðØœYƒm¤à¢pûu0ƒˆ[XLíß#T«-¿#º]¯ò •[mEŒÄšËL¶Óöd¬¤H¬«)éë¹úTúw•{ý¸ˆ6cu#á… —ö̬MC¼´dv“õíŠöZtUéüÛ±¥ƒÂ0azoô@Ï%·"ž•ÞÏ10I·KgÏL‰À(¢Xƒùœî—Χ*[uǡʉ¦7xs±%î¸Òó#WTT$Òuã¸Â9§™ÆNQO pÉ­1ÿ8Öã¤]&«B`l „ a|ŒÓ(¾åžC@"hwŠô8ß'ÕääλOòÚG±€žOûO*¹˜C‘¶Awä£ÿ +ýÄ\ ù4-]:5”ÛôT´q¡±†Î˜žF`¡#ðƒˆ¼"·Ú¥°‹Ûº‚š@,ÊA˜¸zŠîµÛdC”œ‚næüºäóM=)ò·%¤òööÀôÄ‚in×ÅN²¶ÿ¡4'RÌtÉÑÛ½3òD‘0r(©ÇBQç#+ÕÒl j Ãâ+’‰0F§u¥5e +þÈIƒ^5zpQÜ¡ÌþmòÁ¶Ø… 8P±ñJÞÎ9= ¢] [QÑsb$ÍA¼èÇÉÒ£9X³Ð8JWä•°5CZªl"¯îYnSFƒ}êi L]K±…LOè6åѦ‘»?ô(O co Aƒ µs694~Ú®¼g$òJæs&Â)E~!¢¸ FëFËEë."Óh0÷ ^çíüÐÙ”-©¤Ç¹ þ”èUnbº½ÒRF +€ÛʧL^e€Êž´0ª¨x·B£u € ÂâÌÄÖäͳøP”çcj©0²ób^"L³=µçÛy±, äv!Uò~¦ˆ®À”ä(8¹ʬ©+ñ +Ê`˜—:»9§‘F$ê”Î(ÄŽœÈØú$ãðÙ¶”FÌ7{ñ6vUñ 9»²û8ÚS.¹ÅzÆv-vº!fl3>æë›­ÐTɽàØ€*åÌ…È]‡7íˆÜu8G¼!•"ÅAèS8e·Ûø2Œ—ÑÜÏ\M(±b,âèj«R]m@dâR¹2a¨*IAIOX m†Á¥í8Ö-™®IÚ‡IÒòÈ:=†]t”µº2‰Aà,•i= KËK:Žg8°¾$Hx¸Ê·©Ló™2ß¹¸Ð'qILº’"Ií–”k{´â|‘+å I"ñn®4M+z¶a4lʃD\m7Iµ+_ÑýTmt-èÓ6¿Þê5÷‡f;L=XàÚFelap QW‚!prh_œ9Hç "ןc÷ +ÍýXÔ#!àv‡µ…n_Ñj"…¢N‰¸ àx?šJNZàÇw‚ú]Oêš$#§.ÜÅæ<AjeÎ}ù‰˜ŠûÆÀfíú‘zPEn/š*w84¨M›ŽmèÁ®È kܺl7¨5P]ºÎ@hãÆ)ÏÚh†’š^#’áHAÝßaD±ÇþmêñUvƒ¢3:{£›Ò ¶œmû¸AÀÜY';Û5 Ž;ϸˆ +nÚÍX“SLB;kˆ`NçÈt=iÍ‚c9Ô…v-ÉöCázèM7au‰4ABkÞñJg£¨©Á¾¤“IÒV6(ÝI0kQqº>Ú這Fëz§l;.²&.ªÙ[BO[JX9²]ź`ë+¢‹ŸtÉ×V}¸+]aùÚžCõ¨^¬{),V·i)]àÁMž¹döe„TÄÄÈmøÙò77­nsÐÆ®ÜDꦪÈ\Ç 7[¨Kf‡Ô¶ q#ÀKzß5²\g;´™êÙÈ…›âíòR*Ê©ÇRo‡‚¡£Kh]í ÷”%ñQo½.éÝçXh(ÒÃ}jTD¸Sçî€GŒ@[‚ä´‰»òJY~Åf]70 æ‘m¯ \œgÏ`/ÙÆfiÕ=Ô¯@çj¸Ù·\³`Mº¥×îá#0´x)/ð컺='ì™°A7UÃ%Ý´벊‹ö78<{ ÕÜo3IO¸2.‹Û`éì!XÛ¯J­,Z3 Z»£À€Ñ|[  ²Áýã[]ïÚ"Ô7'ñ² BÌ%Ü4AÌå&X 4<Ñø3ˆÀNºÈÎé#’z½ p.VìV¦UÔ]oç¥3gí=/áX¬t˜®8Ò;æZÍ·uË)>À.Q¦ˆßöÚaÀHzàÎ7Gñ!ûÞ€5 öä5£ì ¦z17¯G0@È -‚¸‹‘»T–»ˆQüj}|ÚÂôj˜ç»–yl¢¤ž=é=ÜI‘ÞÁ0íÚ ¤N†èx‚#RŸˆ}×ÖÇw·À Hk_ã>tnZ£Lw;Uplê¦{ÛÖÀM"jà[†HgôΟmº—Ä»%¬n %µ¿i¼’ð¾=½¹3LÜôyÚœ¾{‡AˆGÙB5ýñÛ@‘ÛºåæyAèœòø¬J`Ž;v {I&gåštC‘P{áŽÑAdìY3ºxTI‘I÷ƒP¸óð¨ÿaDc# +ì¹ÒÄ()¬lu 3 ú¤#‚…X1 +Eb â³­xÞÊnFðøt’p¿<>®ƒa +^½Ómp×ÕÅíö¦>Ù%ÉS·wÈÝKJxÞ±G¨ÝI°á‚9Uop³ë¶¤OÝQÄ)ÖG 5Ò'´Oj¤º }Éœùµã6x[Òç£i%NbáÁs{ +Àf'@¿hÀö2w6WÅG™™9ä¡(X|ûNîŽT"Ð#2&è­ +t¸—›Ö„€yÎÄ™t„Åb(Ü[˜mñåqä¬ÑÚ¢1³}¨úe‰µì#Ðv”±ÄÁ |E`œ=£½Y|iu‡0ײ/#wŠŠ%Åeä"\æ Ð}]¥„Θ’ïÒﱩ<3ň5 “02³ÿA`æÑ:Ð;:èIšo`šH»,¨ñ•(ºÅMƒmƒ¯… ™ ¿l›²ñÕ8¶w‹%ŽYH/i©=sšZD®0Ũ‹ïáÑ{”–·äT„r%îN=c}Æ#·ÐÛâw-Yap×#ã2ôPŒ¼uè•~QDo + ]rvjÁ:T1ã=EE‰HÐ tmìHN/‚ˆe¬|Jó•{S ™M­F™yS¦“‘rÑhDO ,݉‘Уš,E(Ø.k¦†@I1^¼ÉlLeé¸~7r!PQ3¡çZ4X|^]¹BÓí(Ô5Q–ã_ï‰)kVù=Qi#éZ=QK,eÔ|ÿ–FÚ(ù¾¾¨býK½¹s\;hÿÊÃ07¯eh½Ý9;n7ÛG_Ó袮”⧫„ôÛt ]1>h4k)+“Ÿ—k“tó$o´Q³S;hô'íÑôóéz‘Mþj÷¯cÖÒu>âšf-eš25fi—·©1ûezR÷Ò±_·ç&UÄŒÙp™XßÓµ,£ +?qKíRÊZQ¯zPuzZÿß^’kŸÖßK™;™žÕ¿‰½„?ú¬~º„rä¬þ÷ù×”¹¥k8Øt-Ï¥•Êa·TntÏšµýúi½Õ[¯¥Ñ7]͆_² +þ éÉÄ?iS”ѦŸÉu>]26Tw¯ÐˆŸ.Zºã:ðÿ)×Z­zs§Þ¬ïO^¿ÙNe£D m[~‘…T9JÄ;R›íÎz ý“FGt…$锈HÏÚ\?=JW~]ך.Ãw4]ë2êŽô&Mæ¼,]Ù‘ýSE5Ñx%{÷¿Ò#ùðZ«qZKgëÿa£Ùœ¸U¯KWÊÌ~ÄÌöj‰[š×¾^¢.ÿ½­5 4ðë0&ÕëtQd§>¤‘öéì_6ª¬_Ö_×ÏÒµ4z⃴ôÚ7²ˆÓ$¤vpÐè5¾LFvêº8“*¢bIƒÌm½}0)iÍF«^KWxLÁТíï÷Oû—7$*î­”­Y‚‚!Úh膞üd‡¸&~…ÔMæ 1?õM{é2E×Í–R–c\#[J׺Œ)Þ]ýmé +F¦/hÛOׂL›aR¹,×i† SEÉ´æ×k†ÙO×~Ý´fÒX ]uÑßí› +¿ËæÍ1]ÃŦËjüöí0ûéÚåºf$š~=™¸&mŠrv˜”ÉØõÚaÒXOÛa¦í0Óv˜em®Ÿ ¥«$z]ך2#~4]ëò£Ûaüi;Ì͈¼Ó•¨^×<¤L©®aÒµ.ÓýŸékõ.4:“«hÊû»ÖþƯBÚ¶—ÏUHã›H®ß‹òc»Y~û·ú)#ézo3LÛ]ã šÒEÈ÷½Ì°Ôn7‹éëNŸ~Ïëô¥ÿ ¾Iß_ðë¾ìJïÓJW p·i]]‚'1ße½Ä»éâÈô5´S‹6µhW±h*U$¥Á¢¥‹#S‹6µhÿŽE«wÚ—E»‰-]ÉO5h\ái„6µgS{vsíYºÂ‘سt1ä¦Ú³´w’|Ǻ0®´ÇÿïèKrwÓÅ©Ú¤Fm‚T FÚÔ&]ܹ™jók¼I«S?m_öZšé›´~@ˆ9þMZWê ö³þæe} ÿzYøû~†ÿ?€²©¢6nþ•_6ù›¶ü”‘3æU[Ó7T¹×á;ªREÙô U¾–AÛ—YÔŸýzªAÏvV¯õÊ›’Fë ~Øh5R¶m— ã÷=û±—¶ï6ÿm¾¯tò×€¥m‰~ÈAtås×8RjŸžµ»t¦UW;F”lö/¹åfÙ„ô)Ð5ÞÆ棑3\qçè²ý‰ÛF¿½AH×Á½ëžM«¥»¾eHcès]»Pë4zǧõ^Ê ÞyÛÊ'—lñÄ£T‘ƒÓ"ä¥O+!þ!“êPº¬ÜɈâœ\ÒD”VBø}èôtõ5NW§Ök§ótéD{‘[êÍ­fíënÊXú»’%õÒÚiü•^V¦ËU%(˜n'ÿ@c9ÝNþ%·“µã†2ó¤O™§[ÈC1hÊÈ™n!_@ÚôKŽ¦[È?–Æéòt ù&‡Ó[G!iº…œ’®±…\nö»õ5|O1Mãk¦iܯ˜Æ}­7›í¿uêõÖ°MõàßGí_íf½÷ S?xÐîÔZGéZÏi~7”ߥÿÛx§ùÝ4¿ûköCó»¦ –öñ[ÒEè4É» ªOÙê­Ùw—¦.¸ª}kœö'i˜®b«›ý ÛëM˜Èr•.ªÓÿÑG.¯”Ó˜Œ$U¼ù º@'ÍçÓ¸HÀ qWqÊC‰Oªh¦c$]»Ê +¦«=b`þCyŽÑ¡R»¥Ýô$o„†+(;gõ}R;ÓºÓ´îô[Ôl•ÉÔlJ—Ÿ¦u§iÝéVxZwšÖRAÙ´î4­;¥¾î4q–Û¼ü[~zŽ;-¢M‹hç±¥kó«´2üõ ißQyòoNé‰äªòÏ “—.RFá㩼j&]¶h”ŠPF„<5UDŽÖ¯®ü:ÇåQ{ŸV²¦gåÇ'3©"è·‡F³ÑÛª5.s_7Ë"¤ù4ßoR¹©:}wÆ9t¥+̻ƻ3Òµ£xwg¤lE¾ÿÝ)#äªïÎøõ|gºTäšÎ3•Áuüfzóƒ©ï¼núÞ©´Ó÷NýË~óW|ïT:½õ/ñΩKÌÈOß¾sêüŽæÔ½¦æF¿sjúî„T'7é­«“ôïH—¾Æû6»õTö]IyÚš ´úAúdî×o³8ø:!-éúÎKœö!—„i%äŸizóŸ¥7)·6ä9¿âª¤}+òF&ž;ǵƒößÓ7ÿܬsššMS³ij6azªHš¦f)–¦©™£%L!×HÍRFÈ45›¦fÓÔlššMÎØãúåçã}vîÍ¥Š§4ûAYþ»q0ùáH‘2’ìä)šÔ¯.ù2]ÔŒxÖIkê(ùg$p»BQ#]›8Ó¢Fê‹/ú½~³ÞÚÿ¯£³éû‘þ=‘ümÞtØiŸNÚL™O×a3õ¡lpâ—z¤ÿA½öÄ “®o:À‰’2}ÝÑôuG?cÍ~èëŽöjÝzµSÿÜ_I”?}ÛÑO|ÛÑ•£3Ù‰˜sØ©í÷jÍv#eAÆï­Èï§+ñ_ïö½ýãæÄíµ­öŽ¾'UÄ 1Ha«º öebSö>“äü)»‚ùLmÈ9DÃwní§¬qbôlߤo`K™Ñ0Õ’+ÒS}vryJÙ*Lß»26¬JA¿wåêb;Q±µWKÛ©Ùi©uZj½–½¾BÑK’¹vt¥Š¢iq#»c~tá¥<øíBÖÔŠiÐú[­Wë­ñRÖˆòzkÒFÒµzkRFËwwÖ¤ŒŽï뫉ƒöÝK^3Mø¦ ß/šðýºûF©‹ä¦)ß„¦ë¬úNùÒEÝ4ãK˜f|ÓŒošñ¥‡¤iÆ—>:®ñ¥«î:ÍøRŸñM_ñßçF¿Ì‰ÍïêaJÝ"Z©ïxáEºÒŸé /R~ý×áÅÄö M—"jF,ÂôÍŠ?™«¾¾£Úl·/‹ÓoÅÒ÷Eß箉˜SGÐ8ïÿuâo©=D13_³y¯YÛ?y5 öYm¿Ñûz?m…QKܯSFiV®kÔ|S¾V¿té÷»l{W¿Ð£”>!¼ê)•²ùâÉ5û-ÊÿyM¦ÜÐ_M½f æ©3¹K„þê”–q÷µoÓþäe|ž®«›ý Qõ&Lä*ïëLשÆÄôô>Ô•â…4~í´têå“Oô;‡µýúÎ~mâ´"]6f€AâšÖI.M|:òþ>NÛÛ†É× u•L׉ãùÕƒŒ +•Ú-sÜHòFh¸R´·c¿.uîýp/U’1ö¦ÑÞäÑ^Z¿8ù×ø~é‰ÄªòÏY»UŸÜǦKIG©OåŽ$F‰øM¢Ýßr7àµ÷i%kÚ>Ž²ïü–F¾5=U«ò;õNlRYý»¶=¨u½ãÓzÚÞÖtÞîàÉ%í q§}ªÈÁirI$šÒˆ§=DȤú“²Qœ“KŽ¯§•>õiZkúÎTÒt·™Þô`ê:o„}û~×™2B¾ßu¦,ø~×™2B®ê:§_Òøý/H}å÷ÈÂ_•‡×ß™»ÂjNßDôo/êµßDô"/Õ¾èfn0þØ¥þ´×(äþÎZŸX¯Á n¸}?%"Ò³׶ì+0‘î彩0ìëNJÝÕh)GO`b#žõì5î'IÉDà•,Æ/õ¢’Ôf]?d£1}dé8›¾âã¦+Ñfº ×T¥ÔÒ5ªK¿c)]1ù5ÞŽ±”.cpå×cü:{ŽH êÊ‹´½ïôšúŸÎü:)·×ÓV¾_0ÐNZ‡tD¿¦yH­Ùû!¡¶Ÿ²ï¡½F°­=-˜xÑ©µº‡?áŸÕ~k;š|…*[¯¶—2O8®È¦gùê*å–MW~€‚«½p ¤le*e©”²|õ²é¢ëZrVœÊY:åÌ¿ÁæìßD߀÷¯6:éZù_8Mýmë!¦ ÿ«‰ZjUèúÓy4kZ™ö˜^¯›1ÅÆèGõ4~·¡Ö+\h6SÅ•ØDÿXÎ\íÛŸdʾ–ç|ûSÚHºÖ·?-ù)£æ»¿ÿ)u”|ß7@½n·Ž:µ”9Üé×?ÅCí×?ÍV}o·Ò:p_… ‰Ývk (Ò/fY2àbý¨ÑJ~Ù8Ó8„ùhçëé^» "Ðé´ÿ^ÌxÙü}ów¦¯//»™ñòaHó¼d2®7,/÷y?ÿdßÔ2qëØ›¯ðË3øá€þΊìzöÝ/{€è·3K2ÀÝ*ëçe¤²§1(È+%=‘]Ë0–ácx‚ç©+¹QKñ°FØF÷Žƒ%@ÃóXËfæva}{K8·»°„³À? m* ûûýÓívÏöçvav3/3Qva1ûæõÀOc1K+h°(| V½ÞimÃÒt{ô…•¹¹]6:ߥÔéÅC¼ìr±ÝnŽia c¥ß80¢dgH³ŠʈÂ÷HSh>ÙjöáßM­p Rí½z¶Øéw³ëµVí¨ÞÉnvêÅ‹?ËšKµf³qdÒ;ò¶œ•Ù³^>[mÖzËv(ðt³ÔøÅìRf!\:®uöÛµæòb6of +¤ ÌóÓ{δ®xÞ‹Øu)áBE‰ôöú¯f™äXbŠÄ­EÜWXξl¡=°c¶átÁÜó üLê˜/U¤"‚O³z|Ð|?Ïý¤ø›üôFæ m¿£¢›Y~ÞjÿÝÒ¿ ïØѯ—õݪ´=üR§Ï—u Ü„ûv=äG£•5ªöëõpÞËvˆN^5º P0D8Ša§WÛ?¹†b­ÛØOÞÞiŸÔ'¿Ÿéš›{ã+ÒÛ½íú~Tí?4Ã,²çZoß4ßzÈAƸ¤l&»ÀCÞ + î*»¼UëôÆPVj·úÞ$D%±\†æìºÂÝrqżÜÌÄíÔx]äGì2Ø¡Fö:+ÿ²[¯|©·6&äºÑþr§}–%mðϧvšqùZã 4Çè(Œ®[ZÀµü¢Ñ»œO>Mÿ¬Öè$k {Í–&„åÁ#/o×k0æ¸ÝùfiÖcö»ýűÌÎC”Â0LQAÑ‚þÁc ¬M>ò|%ˆó×Y†î~SÏ‚I3Ä/êžõ—zGg{¾çè Ö9A €y«æØeÿãðb›õÖÁ’]ìʆ æL|ÿ¹4e–+ÿÔ÷û8ýý>ÓA#ý µ~³÷!a§w§gMg§ÏѬíÉ% 0qœê[Ð'j“ÖÞÜSìk.uX[µfâ1=õ­½‰'»ð. ~XÔD¿ù–†g¶öG¹²ðZ¿9R6¹zÀZ‚Ó"Œù(âQj†ùnÈöJ1»]?°¨=åG¡vëùHI_„vñØ·õf =\±@Aœ@ø’ãV:uH¡Ì0éæ&°àQ䈣ѥ¯5B~ 0 Tä«äQ\ÄÄÎ f*Š<¤<Â=îf^‡´Õ«Ùñ¾Š€B¤.£y±€ |œ§¡¤ +~äKa–”÷ÊÀ¢|èG<»òGÙâC!‰mܪ4‹}Á„ÆÏW:áñ"¡?Bd8Uß‹BÇøÂÌ-­œŸÿB/FÈ|ÄÃE(BÄ>÷¤ABB†*Ë?d˜frB(q‚8áâCB!}nçÃý0SȸÔ0Ÿ¢if&†¬ãšwœV: "Ã0 ãZB w4œ œâ:_¯,cäÍ^äktš\j‡F¨!VÖBç€YžŒH`„‡„F8=Eø¡|éê¢À3©1ˆ +¢a —ñ‘¤0ÃAƒOê…}@RÅC©÷@˜#>Gf‚ŽçÌ L€A¤§%ÿŠøthõà\RKYhAaÊSÒ¬«ðmóQS’È<ä™$­@Õ¤™Ènæû´†Ž:#È Ž8ßwˆB!p2^ä…zVBR†g,0ÓR ½ZÕÈ´*«/²ZQ õd6°_!QÆ”"ƒÐ )Äl°#ª8+ÆH›Â@rÍÉ”c«):­JLÄç8‘0$nG ,F»¥0å."Í[ÏÕ)-~üâÅ´3S€Whú„™˜6×°^ _Zç„d£„i.’ÔsƒÑJ½z4ê8!•LOÌ„o•)2¢ÊXˆr"bë3ÄJ½‡J ‚3£…‘”z@9ÐŽ˜€Už!,0?dפYÒ¦€Ì¯/H›Àü :MTÀ<-¾úÚ&ƒ*/ÔKëx$¾ R9£áƒ¤Šˆi¯à…ÓòÀ­ÞÇì3ó#£Áˆ‘{ÜÍ5®‚'Hb?`Ì+<*@ñIº®×ùäåX¨Ósp¦í7¸Pa¼t@â¡ÐS ÿyÀMÚP˾ãXe¡•pr#½@‡– zÚ†+ÕC Ð8ÞKt}>Z;g¹Y8àvÜÀm£a`Ç"m·«"CΓ® +].ièR"€Lø)p?Ô¸À ÌÙ4» ÌØaƒ4Ä©jUÒ±Qƺ…<ÒœWàC#†hs\áüôãXbuЈ¤ÒjBF“û2’\ËŒÃÍÁ{iñ‰ÂÈÓ«b9 ŒYÁÙëR‹Å«P}írBFhãFþái´¡ðàgí!”¯›<'_k}GÒóhÇ㌇ J/—`®µ_ä óh©™`×ÝŽ•)p¹PDµßv‘¬×÷nÃZ}WS¤Ô1‚óŽV!A•bÖFÈÃXâ«c ðFÊ(aàkµT ÛšŒæê“ZyÆü¬š¯\[]£LŽ Ë.¬5ZõZbÔÚA¢C<Üñ¹iž#Ðãb13æ‹ÂÓâ1"Þ†!%¼âÑ;Ο&»ò4ÙdÓ¼ñèˆØäÉî|î×:õnÖªp™ë]ñ‡ìÙ¹·–l&ó³[8‹£ÌÂó„oò €Œmž™ßCú›ßú]˜ßý.Íï’~Wæwá|ŸùÝ…º¡ùÑïMˆ~×)îÆ1X†O[E—VRöx•è¤‡É„ÚU@GÒW=ò»¶‘¼ä6¢ù?·—4´±`><ÿ!vòåö~ÿD¥\ëÕp¿„~×[%ËC['‰Á¹Ý…Ù;ö’ýιÝKz^æv£ 6ÿô&ŽÙþžÁi½W;€‰_µÝ\0/µNw{vêzô§Oâ§Ïá¿äÂ9›Á£b{î./~to”–ûÝÀP%þã…˜¤Áã=—Osa¾ÕÝÝïw{íÓç NÌù¢ýøaˆ†ÑåÐÜÿ2y ‡Ý´‡4Ü›D¿S +€v× ÍËxµ×Ðí~úX•¤bTšíý“úe 60®ÕnÇ…ŸHÍþß”‚+Ø‚4+Ë„L¤½{ø÷Oó€Ýfcÿ—pšÓ¬»¸RIÓà”]³êÅó T—R2ÚL‰¼ÇͪÃtQÃêÅd)ÏŒRF–kX¦êë¥-ùŠc¡+m$}Ÿ\NŽPù0Šw°SBÍ?ã¨Ùk÷ >\«ö6;#ÝŸz1q®» %TðŽ¤}Ökœ6¾é½^ˆF0kþyù]¯Ö9ª÷~ú4¶6V˜¨¶;§µÿ2ÍüNÐÃw7œÕ:ö´7K„'?*¦‰y‚0ØKañÄG‰jµ×±¶X²ßÓy³œü(qÐݬíßÀ5KN}”°ÓÉ×la¶ªÿ¤/á8Z»+5ñ¯Oh@'°¶?W!£21è¯VË“ˆüÈô¦ù™ÿŠdþ(ßðÄÿ'pûâÉ'vCtLw¢žV·jX0¤Ýþ^·Þ«¶[½î6†—Ïë_™=0úõqcÿx«ÓF…s#]¸20t«\ÅfmÀ¹×h6z_U«°êûY··²Ý?Ë®ÕZGýÚQ=»Õ>ëŸFÃ'r +Þ^»Ö9÷rêd0eÈÞ*lˆÄ _Ýjƒ;Ù®7_´·MtŽ±â¾Ȟ¤?e4q¼mÒ›ü!άvi²v7ncÄØ”ݳfíëºmžÛ ° Bÿ?U?i»ß¬w“ »æôÍ´¡)hŽouêÝzçK=û¢þO/[9hôjC«Cƒwª¯³ætQöE;[ÚÙ¹h­q¡s×1 C¿=èé‹õµ,¸ìJ{­ñ¥NÂÓŠÐÇÝñ¢ü“û§‰Â…wÁð3:ÝÊéYïk©Þlv/¿eõs½v6î4Öù£×Úû‰ƒaâò)½ªwzýZsdíÆ<£µßì ›P…º?âi»ÓøêN¹p)^vëné/ä¨n‚pÁ—HÀmºÕÛ,yTùŸ±sKzÝh´ÿî^:nÝ4çõþtÀ4 Ï0 w§ö }ˆ1è×òõo$Þ„7eQ²þ8Ѿì&oœü]v“µbþ¤D™»¸-è]é&aç'®t—ü®»ÔwÝØ»®ÆÂpHŽ.ˆñ5ÄF,k_&OÞd·˜ Ž_â‹ïyïyVYxÅûØxÞ_zÿÎûΑ«Kï“Ãëv.ãÇkg³oÖ·ÆZe0‘ÆÞg!”:l7ñë¸q¥öÙ×l±¶rÔÁ] ü6ðÎdl:ˆ0;Î$¨/÷Ï€šZ/IO±~ ’™ÈÍP=ÀÊl\»2`ÓÇËð8os Ð¡pŒÛŽ‡du’ Þ£Ö#òTÌ——ß5\Ø?ÔÌ OºŽ£51ð–$CÔÄçɨÊË61aoÁ:µû½f£UÏvõyÈQ;¸±ØÅh÷›³ì~›@þÉvêG° #?ÒG‹a‚»Òiì&B+ér•áA6zIFz¾›à©z!Ïìy·%ÒÙÕÖAýŸj£Ó½äI÷ìÔ÷Ûäp‚H[9Å€:Ô餤„*˜leµ8^ki5†ñk;1Žóò‘á['Yàøñƒ+,ÎW«Wúß@l¹ÑíÅŽBœk‚‘ÉUÈ; ­£¦“ƒ%éy—N­î~ÑB5ŽÇç?SS5òÐs$Éq`¼ªà‘I„)Æ3,Mç[T}Ï€E½p–±5½Èðê¡ kŠ~G^4Ö™þ_æ½;°¢qí&¥„&ÊžÕÎ`}»Ó~3Q_äq‰mö{g Mô<=0!G<ܳ^ï_rÇ¥‚щ;J—o˜Z†áPÀô}g3>‹åÚªk¢,r ¦…Ñý€åx‡dùS{/O³Ž IÑðPàÔšMºe¨Z<<ØЉy†u /ëtëíN²Z0vd÷¤q¶~åd²IgÅ#ãðU[1Íܾܞ}ÖÞ[m¶³±…½òvM±A‹RØ)­®†²\ÇeÀs¹\¥m=+îæÞ>zÄËË›O£ÕÚ\çaqçp}v?ØÈå:¯½Ü¼xºýäþæ“^Ô¨®¿ÿn¾íWçWÖξ}û–Ë-þUÎåîÜžÉåžÍdæB¹VÙüÿ§äؓΟ«>üp«ƒ¿¾(ŽšðÃÜŸðÏL¸R|R_Ñó™?ÆÏå“W>/·oë_+í¯>Ã_è_‹<|ðÝ4ƒ_üoÿ>þº¯-„ò3øaaqÿQ·>ÂO‹ñ×™¹•ÛùÂ=øùšÙ^™;ÙàðÓ½ ¼»Rjt_,ã¯z¢²œß^êÂK¾þ´Zªw>ã¯/ñ×¥Ê_>/à5ø'’Ev¼×Ñ¿jZ"˜™’§ñçÕÒᇇßÔÿÔÙqeï…7Sý£Ü/äùÚã;¼¸¼´Uxñ¹;W­ï0àõ‡ÊÞ­ûïʇ·ŸÎ•Ÿ÷ùGÍ2ÍLž™ÓÌ¿[˜Í³ò*_gå[ïî{½ò·¿}›?»Õy¢Ô³Æ‘z±ôö¬’[*.Ÿ>ºKë‘™Ãõãâ½<´‹wçä˜øôVX3;ƒ|¾»«p7€Ÿ™·ŸðIƒÆÎÜÇÕÙÜ…OV·ãÙZZŠî<ùû¼¿R|û¿íÂöÁãùbeyVà|òGŸ?Þ-?:yX™o¿¹³R|¯þ*žÜ?¸÷äóÛF1!J1ÖM3Ä› ÿ`þäsá´}Ô¯þQ]ÝTêùþ«RãáÓûw+ëkþ“Ï÷ƒ»•µê†â·úûß¾-Ÿ<{ž»û¨× ,‡ZÏîvî=i•GQ§ïåËõîã ò¿ÃjñÉýO'ËÏïŠàôÿrh6ëV»O7+{Þ½~áùÛÙCXÉOw‹KÑŸïÊ««·3sÅæ“&/6åÜ^,wy¡³¿êß=‰> zÌüù ž¼Ö.ìôsÇw‹v¸Rð;KwŸ”nïÂ¥üLùpé=/×× /©YËoZ†¿åfý¥Üìòþinæàé§\®üZ€ÌvJ¹Üãg=œçŒ]«Å;fr‹o>çîÜîh×ë +#¬Æ.|Àßf« íÐû¦^/5ï>é.…øÑÊvn>73ÿá~nö^y#w‹ÝÝËÍ ºó7%ÈþíûÞJnáqó]n±²ÓÎÝyþ Ÿ»ûçL1wïÕÇW¹¥÷•O¹üÞÒbnù¨ñ0çný™ó»A=Çg{·r¼ÿRåäüÏrêÞìÇ\àïvrá“už‹ªâiîþËÜÇ܃}|]îáüë ÷èѳÍÜãWrOZþÝ\ñþr®ônv7W™ïÜÊU·>?É=;{Ÿ[Ý<›Í=_êrkµ¹ÝÜÆ㻋¹­yµšûs¯ÐÈí¬®‹ÜKïÍËÜ«þ§™Ü›ö½Jî»á)ïß¼ rÿl¾ÏýõBÞËí½ÚÞɼ9»•;Ìœm…«ð”Þí—jvf§skv^<>ž]l콞]ÚQOg}þ6œ•óüîlaÓì=8œ}²ýé³åg›³Ow¼êìÚ듇³[ïÿ³/>=\š};»x{öCt63[ƒX~¶~´s:û‰=ÿ”™›mm—Žg»ó…£[3›oݾW:ºu÷ãÊñ-ïÁóO·dîåé­èýîç[žŸån•Êþí[OyaéÖúÝ×òÖö½îÃ[¯ó÷Wn½_~µu«vöÝ­ÃõçÇ·NþêöoõVòs¹ý‡™¹¹ù7kswû·ßÏùµÖœêîÎý±1ÿh®èîÌ­ÿy<·þüáâÜN2÷v¦÷fîcóäóÜÁ§†šû´û×ÖÜÙáþé|î &æoŸü9ŸŸ?=›Á̃ùû[þ»ù'ÂBfn~E½z>¿þæ¤5ÿbþÞÃùÿý¹²7_óbþ¨.ßͷʯóóý¥Å׷绯—n/Õ—ßܯ>äo?øóÁûÛÅçmq{usçàöÖûGo¿n,œÝþØ?^¿}¨ÞÞ½}º¶º{»wòä1Ø¿Ûæò‡Ñ›©û ?…½…JõÁ›…u°Š /Z;ó ïß×öž­-4‹žZèŸÏ,Þ.Ö÷—Kw·ƒµµG‹?vó‹+ŸËÝÅ­üÉÁâ›g¥×‹µsÏ^ÀS?7Cyg®üùîüü»Ù;êCùóÇOÅɧüVýΟóíÚ·íúÇ;ܼ¿sÒøðîN¯½ûîîââч»,lïÞ}ðtfïnù/ïðîƽróîëõ7»µ™îÜÝOëaþnof;ÈÌÝ[Ø-ÞcÕÕ{,µßÝ«t«{›ûÝÙ{o?lñ{ûñʽӽ“×K3­'KKsî.÷— +K…ϯ—ž7ÛK¯ä{¾ô×û×ëK'ùíã¥þÑÿ¼üÝâ»õ¼šßk柟ÁSòÏ_-¼Î¿ZûãV¾öüåÓ|óY«¹<óŒÿ±¼´½½·ÌÊåRÿéÇåÍû=¾ü¿—Ï>.ƒ ÊåÏ[÷¼……Â9{â=–µª÷¬·5ë½:*¿ööþäÒkÁsý¹Õ…µÌœïo,.ûwýÕš·î¿lÌßóKm¿õtë›ûÜ(0öðö]ö¨]i²ç¥oÙ›;ùAnÀ>¯ÍÞæ‹åWbñ/^’½ä[AñÿÝzÂ?­…bæõ¦—™˽Ò]ñð`^<{{wF¼¹s«'êoouE—ßêÊ»'wz2zÌÈ•RiN¾\Þ\”ûKGžü|ïN îÜ)>V¡ÿ×SU-.ï¨Û;»j¯¹ÐTŸ£·óÁ÷BÑâAüÙÊÇço‚WØIpÐiß ºè[Ö7_‡<}z>/Eø¿G6ÂÆó'Ÿ¢ÙÍ',bõç[QqþÕYôgåøè¯ú-Ð÷ð{÷ï4Þþyÿ~u&6ëñÊý·õã³ûË™¹·ž7ÛDi¥ú \¾Ý}ð¢üaíÁÁëg·ôjÞë?¼…YùÇ“Ò§Æ[Çû«ÔÂ÷‹|>üß_—¿-=|tç`ñáFíxÿáî«[Ïž=“üѽ•çGË{m<¿³úh÷ë°úÎgó—–J'mt><Þ<[Ûz\«Þ+?îœÕ¢'Ë›+ËO +¿ýdga.÷äàôä¬ûøá¤Àkï…ÊÁÛ£Âë£×‡…O·kÇÅÛœ|*FöO‹ÏϼNñcqe¶xÖÙ¿›™+å7îðR­=*íôzÏJ‡{+¯Ê·ÞôÊÁæF·ül3Ÿ/x}\(Ÿýµ¾SYžÔ¨Ã;‹•—ïs…JãÎéÛêíןºÕËÇQu£~ò²º·Ùë®äî/>\‘KáÇ•ÕÅ xÊʇ¹ýõ•Ïw;O½èyéiy«sòôÍqåÑÓÓ;Í£Õ{/ž?Z-,.~Z}ùn¿´ú)Zé<[ì³gê³wŸí¼8þðìøUýÑó…ÍwÝçÿ÷ñÕsH#°—ÞÚBØy»öp—3sk;· wÖŽ_½û´¾èç^­?jKë/^6Øú§âƒÜÆÝàèx£ *ï6^ËÙÓ?Þ—7óëÕ›åÛ|7Ó¿·ù¹rr{‹ý?y﹞¼²$ +_÷` ˜ + 2&'c 8€‰“ÓÞ³æÇ\û©ne! Þß|Ï9³æõ©©ê®®®Ô]]㮥V¾ýÜ×:»ö®nþíëáÂòºþqØL¶úÈÍ8ŸþñtKÿ†ž^ÂþÛ§ùÃs¥áÞ<7Šþ§^£ýè\5Íןîf¸yoÖ¢ŽÇæÏnÔ{võ_,Ï™»èó{#UÞ4cÓ—`;A¾Ü“÷/£›üï«3Ó˜l¯éŸÑóë{Øvýº%óoLéë÷íÑ툽ýLïû-÷·5ÔÊ}=÷Z_TøÝ܌ޣãêí{Ó]¾ÏóÎê9Úº>îèŸöÇ ÝK~:}ógÖ6yÿüì­’_æ/ßÉö{ˆö¾žëêײ9 µ]ÆÒ~4¿Ú“ë¹ã{~ÎwÊ2Ôé¿ÝßÎ@yÿ]ÓïöǮߵ–{ŸÝÛÔËk÷=Ukt÷åZ½{ªÕz/ƒ—Zoãê=õû“­ßØ’ýå]¹;`ÝóßÕO91ÜÌÓ—\:4Ýþ®º³x¾žµöäp~ý6OÎSñÆ|Þ¦ +•…ݱ/òvòsÑ÷‰¥'äÛ-+%úu9î%ã+Šx´¬jÎ÷jé6WL¶uø;\¿–»×3ínR¾¯—MÇ*n¶Qä’‚s«HÈá+”{ýÝ ï÷³Ýd5¦å®þ‘pƒA‘:Û“Åt¶Ýùàh_w¶ëÏ6ÂABC­Ií‚´ñdÛŸÿ3UFÄ5A‹qæh?F›áz/¦|Žôd·é®¤ñ _è‚Áp±=}ëÏúkÝ_.ø+XmúhÃ`q”E/Ä"6¦|(H8Ú/ú†¦â¦;äâVí·[þÞÌãØd§×`2ÆŽ|kú¤Ö†˜—:‰y©S˜—R2¯> PJæ%$Wùjýäî¥Nâ^JνÔ1ІÁžÀ½äiÜKjp/‹êqt†Ù—<‰}É“Ø—<…}É“Ø—<…}I%ûêóyȾ¡#ìKžÂ¾äIìKÊÙW-`-mì ìKœÆ¾„ûâë…ã2Ì»ÄI¼KœÄ»Ä)¼KœÄ»Ä)¼K(yWŸˆCÞeÈcNà]â$Þ%ä¼{´a°ÞÕ±£úâYµc\GŸÆá´‡³7}Gf˜Åi9ÓòûKåÅô +]'ÙZÒÛ* +Ü>Þ|¸ã¯ {¬ûæ©Ð7ÞLjSœ£? s¥`ö8ìÙI×·µ2Ï¥ŸýçUuÐ|¡\Á ½w¹ß¯LàÝëIÏ—Õ-ø»±;ÉXö…\ÀúšùÙ_M¶Üˆ¨ôTYC‘Qè¥þñ™nf}/ÚH¥í¢_©ø´ð•Šn}swÎcÛÅÁÈdÃÄ*|w÷¹Ñ×kí¼EG™ñ.;½“2r|ßäúduŠßÚ_Y8Ðåm¶ýÓ^§›5ÚD0g¼á_kºáµ,Ø>¼u{“-òëp÷óý`Ý‘:±xÚF߸3žo´{ð\È÷®äKÅ2ŽõûÝ)ú4qçGÕ1‹™$üÝÐfbýŽNÚ•Aff»µ{7îÏ}ºÚ¸Y£þ;S±Ê˜6Ù˜ØËW*½èÛçîÄ}Ìš&&²Œ()@ìç*Û [È> ½ÒÄ :Éú»0¿ä}Âáõ 3³PmÎŽ Uµ¥²å¸å50/åÆ’ e—mwüeð¥z–/ 6¹°Á€’ŒË‚¦äƒyeê D§dfêd¼k¾ ªùe¹Ïù»ñ›‚Ùý¾AXô¢¡à&&Ñ».ðgw²ç>Å_ówló¬'ÿÍ£ZTX÷p'“y•»ýIpp^ñØà÷¡gRè0À{Ì9,Ð(S:ð%v€t$žP£a? š3¹&5Úk +0ïÌo?ÝÌýºs#ÿÝ:ßíÚ­¦÷\—rdº9îïÒ5kÿ>ݤh˜ýtè«eß Þóoß·{D,×ÊØ´=…g¾M‰Ÿ°Ö27j䘞¶ët'-±Wv†d“-ß!Ý/™À[¥ÚlÆÏèýë-ž¡pp²a`ò\wfi+I)¸”î<؉E L¶˜;±wr32CT‚QøS$&,œ$Ó[¦bÍÝuºYÙíI©˜I Ýù‰ۘѳ&ȱµo’VÒiÿ7+gvÌ<½ç{DÜ•n6bXKÄ„Ž°äˆQ-¦;s[Üû]@+õΗ+ÿ†ºìÚg'4ÜXÏïÒíÌ}!;ª„ ò®7(dóž*sPÌ̘ī›ÙUï™RÓ’PôÁdƒ^ sÅ©m¨êq¼ÇHŒ¢¯ËÃÞ*Ûõá“gW\]÷"w,ð  H¬¼]Ž²“í„AÒÒûQ£œ–rIUl½™ÃJ~r"öºw'*ïéÏ'È1ÞÚª®â®3˜§ß•œ’pX#{‰I7ï—?©—f¹[ȇëo&[ÜMä?r¬òžåU¸a¢o0çûH¾?]ßðð™uYÁ|óa¯‚xLØÓO³•KÚ®Þ-ø³BOc—/}×j,L6‰çßwRÍÐÍc¶ºn’2•áºÉÒö¶L< +§yŒ‡2w1„%ì)Þr³ÞOešFòk(Ñâ2ïiö@Åú+,ì7«;™`hü–Û‡žÔhhfÔ¤™»»+y ñ|Љߢ±ü¸lóæ}Ê–™Uš«q}†Â·W õÒó‡j¥û'²×~NÓ7fkžrZÛY²˜­¦Ð§$°8™ †½è-éqdo…gI“Mþ¶%~†¾fPÌââ¯L£JÕÑÛþµ€ ‹žeXP鸷 +zsOTç}•GMâ “Qsô ' Ê F" Â'‘:Ÿ~ÃMPoj¸K¸0€“f»‚†Éu +Q§‰žÅ00 ¡$ê²Rü•£‚Øÿ&†ÞâaÜŠ¤d£Î±T\üÄê ˜ž–¸d,âä%u§ÖðD(¦ÁdSLûD,6¦“œ <*ñ+%`.Š}0Ùäs™Tc9Ý)a»Œ? £b‘Š_YSe lW…Q‰¬¢äYv,šÄJ°#Å+‡'GB3jü¨FTÅJ5Ù&Ãh•ƒ¸•÷&+þ¿U åæE\wŽ‘ÍjRäZÜQ"­²TbBk‚ð`™”KÓƒ5JjItù“fÑQ€T€xhÂÒ< ñ„°‹ pŸ˜0é|ÄŸXò # 1/¾ð_šÓ{‘ô"ý4ú¹³òn¥PéæËÝ¢"É©ÉV´;@“ ƒ‘Ø&ûº-^èìš®TŒ¨™Ýù—·¯Ê¼V‰9!± +”^’´p2r XóT°[âš‘pXî2ŒL?燦7Š½W izj­`?@> 7vL¶ð²B„ò^Ï(»»]¤X2aúiÑxN7våyÞ]õ;äog…TĶâŠ'§è|±ÊÍuú1›©!†³®æ2€Š¬0ùH%ÆF(Ö~J‡>+O¹ÊÆõ­ ,}•Ów¯u°“¹ž=Û¦ÅíãpÙ~U&jûÓ'ø>}ßAßs@Öï; `¡Ðó×ð.7ªoþIíÌæü:ËÚÛ4uý¡ï iºB&›Ô9 õ°ßÒ…Üïk';ùeü±ÑÜöö­‹š$¿C¡§ÁuÎ+ÚGœÛ˜}‰ €“9`ÿ7yŒKˆ$s?^ç-‹ N'¿ÁP{´gÇîVÖ?I&¢Ü\Éé$óE¦Àö¾‚胓ÎA­„ÉHi +TYžç˜SÒ-§â&Éò¹¸j¥x¢ý/·þ%L‡wYÐÀ]øî$#¹b+4w˜Aß]fzïÓ¾6×lEZÚ™)•0‹/„@ÌgR"ˆÚïb´<>Ü™µ”¤Kwå«»o_ºkA3”ŠÝµ®Á}›å°Óâàæ%±¡RÏæž< Çž"–á ÇnÇÛ=žäH„*`iwDs›ï¬È^*öl÷I‚dTpvík¿éæs·¢3¢ð™¢¡7%¯ • “-2+,GZC +-›üê•3¸ziiDQý“¾ÉõÃÆÑÕ+éZ½?ÀÉgm+ä‚ï”;ÙúrB4àåKÀV%«7SíŒ1=a^’LeŸó= ¼ø̳ ¢šÌua‘åBƒÀ|ÞÕz9Éùßb)žžö¡Ã&‘0\„÷'ý·X4¹ûôS3µ>ä Ë6;IÜoSÑ‚­ËÜ2oÅìCöåV°N¿„â“þG®Üªe¯Ôî`âÛ3(¢^pTn«‘ÒgaÇÁÜ$ú€Ñî˜Ø5=ÊýX¾¡èÊ—shâAa« —ˆé>âN«­ƒ¸;žïùßWrË›íY¸ycm:–›ŒÏý™oÿîú8yHÏâ.ß˸&[ôÞM¤›Í³ŒYnËØ*¥âØ¢Ê +aþ맃”,…lú LÄTù äXÎÓ +1C¶·‘i:ßL‡"O?‘ÀwfƒÌšM"è"WÉé]xš‚y^XóåvšŠ'W¯(åbAܨ€f¦ö]%h]?—Ÿ»¡‘rfž ŠÃ÷‰°LËà~ä—ÒuǤ–HVpö¬_Ú.Â{D%Ã懂³UÛ¥ïZä@‚4q÷0È ætÏzæ)ÿ8ýå/+„—ßã d¥ +»¬Àu?,s£He–ë¹&¶Hõ{/¤g‹kUð Ì>ÚÊ‹>dýŸ¹»»¸Ÿ5Õ¨zÃ[È“#G!š~ºæ'ôÕ’¿ég…t2ÃØVÁ\¹;³ÈŸYÍ ´ùzB²Ô—»+_gAZÊPܳ¯µ +)b×9_ô +f—‡öý&BÁÊ¡¿aÞ†%`i—ÃÉ:—¡f¨Íï]¥lòÝ7Ž±‚£9n2w„A‚úò³Ìïo-•+ê»\Åá( mÐ2»o”žuçØ4ÊïnÊfseÖø¡ñZU³`93vc ¾ó¤ë®hÈþœ”ŠãÊ~G”?ŠqÅzàÆJ¿}h÷ö…ï65GxIw™tØSFo& + ¢Ey~r¸e‘ÆÎôÓw¥.Ú n‰‚Õ“d;U¿Î÷[ÃX÷lþYNòí·ñ3«ù¤#`3Ï¿,ß5«…Ol±1ò‘w±e¾Ï8ƒ™{§sZ”ëîÃHw,Åû‚½h+XßóÞVøLwÚ+™}aÁ1ë»îmâ37t€Ð‹“ʱp\‰X/:Mä¾&-‹„ÑÄ…‹Tˆÿ9)ï²€®gÇ©7Wže_ÓËôÈ!; Åi§L8]{÷,%ã—żttÁžïï¯'H#ó½f>(îÕË0¿‡ÁP) °ì]²!TxI½ÖÝ7*û(è_Ozqk®¾_Z Ÿ¹ŠyDH:ÇÁî´cåÇÒ}{îÁX†Qüú."V㌲ +ñƒŒ' øôJFÊD-_†Ž#wþÞUçöàÀÒûÉ{¾YY#Ïùkäçu=+«ÔfÏ@e¹(•eïêq…’I¶’4”P(BJ¯¾¶j¨]B%Y-“ÿÎjÃÍhÈ­“]B’WùZã +•øEñ]uöö烫@¤w= Ÿ<*o÷ ‚*û"°ìí! +°Ò{Ùß°÷‹ø_Ø3ÒåWãàNp—$6U/I”·iHo]IoQ4rÍ‚ s·ŽlþÒåâÉç710%ÁƒFpüƒôf»­KnYMjãV—ЧµxÎb)^Cy5Yàk2ÑUìÆ®ŠQ;¼ú™O}½Ùp8XŽF¾ývK-ƒ¾êÜüÒŸûø[1—»±Þ¥.’–âlµþІ4;ž} ßÕë°díî ÿŸŽÆëcíÓyõ/JÿÂŒ§¾évk?×;}¼l¶>¶^«ÓÈ=;¸}w±XŠœtxt7â¯ÝêP˜m(=ð¬Þd¸@—„ tyM§Óÿµ’v>@ –«ÁþHƒí1ý¥ö\@tã«~ö :{Ѭ..®¥ä–Ù FËŸB”`¡¥Ör£l)ECå}²‡ °b§_ò¡ˆy;‰DU6wÃÍPÞŒìã;àuív¸r«nEñv‹áOWvcœZ£>¯´†:.Þé«d´Øù¶ûžò +Me“Álµ-¥7÷j4¥‚jN–óîfºEÂ’-vg¸ùF¼Å×@ëÝre¸íl8RÞú«-⥽6Ð|#«2q¬µÐkme½V×Kø–µ^w£Çܨº%„ƒäz8ͦèN°Éb´<†y#‰ŽÒäóx(Õ´"Ün0!BR‘S뢴Þd7ï®”ÒæˆâÁ8à׻ɎWyF~Áª6QMjs‹ª]i#SCªSßß |Èr™uW¾l§C-Ôl7™ ·Lª*yh³í÷zÂm³š ù[êb–mÖ ù¾m7>6ÆÍÏq:@ŽšÂAMV\ýÿ­ÆËÍë·Zn©}d õgŸ`öØ„*½¶¼æ^-wz%´E¯ õ­ñŽÀ-»¤´™Dh*±ÕìS¡]«Ê¬‡{0ÜN~Ç(¹Zm|øL=6@ÆKÉmíÚÍþm¬ÙxxD¢³ÀDiåÈ G ¿W½®rÐé›#â~.)û¡T%#4Âå äZ”<Òø¨6ZÑDB;Q éôTJ3>Jˆ¦êjA“[KGžB£ÜŽínÆ5_­Ú¨Q3µÐÎdh‹–åLRÀÎÀÐ2nÑ­±íy†«vÄsA±¯+zÊòû=Ó|ciæ‘«T?ʳÙËÍÕùQ0êY-Wè7Ý$ĸÚz¾ +ÿK\$·ü÷bÛE­ˆ–ÚOï—‹e¼Y·âïï&‹6ò¿¬Á) æ’º‹¤‡å”^òdIó)É]z t""\û$Ý[þËÀ((iŒ\ˆ¦yP˜9†I2Ý"ª# †ö^c€ª™»Ñç(Ÿá6vÝÅ@(Cr¶ìr1ÀVEyX'£‰^„‡)ŽU'zW÷BÓjÊG˜ ,ëî†Íñ~Þ[t'³Ãà¬ügÆ.uVÿ-‹’­ŒR.6ü÷r3­ + +B£§GK✗Qðª€Ã‚ÆD _÷P"ÌPñC€’í®Øˆ¾oTP}‘°jˉayÕЇñ";¥ñ{ÝÉ+šb‡Œ—._µÅõ!f“¾Î ¡«¯Ãªó 1ì5›‹õCqùÐKÖ'á ‰SUrLɨÉ7ýÙÆÂJ>ÝGõQF×9ç›> P©O-k¬1€Z‹%’ ,<í¢QFVJÜý^wWíþ3Üè™ãra§u‘µ}:b·Ê7uMWYÓŒÄxÖ¿_‡PÂÏq•§0pŽ2¬žš“.cµ¡ÔrPÖÞÕÉð?in&sÄe¯ÓÞàJ~b£Mÿ<µŠùæ†[Â]¹±¨/¦ŠR&:šcàà+0G®vãágQ_mùR¥ÿW[¶^wq%5oñå€Ý-zœ,{Ã+@'Ôçðá:w; \ìŸåþjý +8hÈjŒš÷Ó,о”‘ç + ?]Ó^í–Dx5Á›XÝ«Y÷T ¤»b ü!îÜîûcÔ½ò"‡½i ‹m»‡Þ-G"úÉöj¿˜.€Z>ÃÒßLVçš™c`Í_6u£»š?“ˆ½Õ$á3é +Òw/ä:ã4»]näÊ|=”üÔ× Û˜c¨o¦ë—ԃ̎OóHH‘oÏ…¶”Ö8¡Ð‚5ײ‚o(tÝÊ=¨j5^þ»4ˆêN£Ù‚e9Ä%Ë¢Bà%{ˆB¹½,=_¡¶…QÖºXuüžKìÐIŽ¡3:‘N~1à†Žv ‡$ÙÉ€h\ ítþ O¶ô‰êHîdð;ä¾}éù ¿ûÞã¾ïhô‰ +ÄëQZxQ>á1ú¶¹ËäF‘â´dyJts#¢•ÞRîÄ36;éRÂìõÛŸL6³;9›ï³g~'éL˜3ïÌüßK‚Ïòˆo‰Rg˜5Ù6›d¢—ö¬*©»È6.Å_}…å{à%¿ù|'rï…V³H'ú¤+ZpXhkÝõºž_•Ñ.; ]XÑ Ye£êv³‰m›€ÄS&ü; ±gÛpa÷Bµ—ÓbpCbÌ"ØͱìðÞ,šoðÀñ¼ä¦>ÿ6\ „×±_øZœÁ¯[99ÒÏÍ×ýg]i1ÔFËmŸ*Ò¶õ¡j²)ЊH™É]ѦŽ4nvl¶¤m£Ž´F~®©¨KDj²‰h·vϽWipìèÚ[yu¤ç§;Ný¨ôºÐ˜l–çÕ¬ª6V¢¹Ki e,ÖÅÆ™Ð@Új…ÑCCDŠï ÐÍñ²Òiª"-–¨¦&y©÷dó#^ìååsú +œü¹OVZçá¬:ZôÇŒtÒÀò€•ªD†CZ³ÛHƒÁyg%"9™EÛÙ|M ¤©.*XIU¤íÛï'-¤%“ÍJ;bŸêc›¿¶–ñðIi=ëL®­óªRwlMŠHa^ä¬äº}O=ª# ´ZD!B<¨"½.ü„¬OsêQ ©ÉF¾¾ +ce,¶éâ>«…´K=ß/êH‹DÚ>t„Z©É¦$ðÎâ¹å¶¼o Ž¼ùÏiA†ô=NTC^!u)šlÛëÒpÉ|¼;ªH_ì‹M¤qý»‡‘šl‡cý(/w«¸:Ò*m{.¤â u¤«ÊµRÉíK§x½Ó ðÇ#ñz{—SGzŸÌwÚõ¯/U¤_Ó2FŠôËáX[ÁAAég˜øÚμêH~WóÇH˜V ,m§ì]hxck¸ÍH[ÏD~2¯¨" ?x¯Í©//È1@]+;êpH{´S±hœïÕ® #¥ìIGI>Ò*ñ튦Rˆ° ´öwÍ ýÄF‰t»¼IpHw·nÅHÍŸÝ'‹4Ó"ËrAèÙlŸ“fÀh}‡R©ìÅc¤ÙÝ(,]3,Ò[òΫ„žUàÕ4´5š½ÃH­u³éö)¡@ºÙ¤‡Kž+fÒmð7ÊišÛhݧ ïõrøÝ4qöðÛaä*=ß´—QÍ·­:9Ñz;&J߶½øö@òƒèÍÝhüæàÆåûõ; )Þ2a²ÓäÞn§áƒUÉ,Æ×ojïY¡X+G?5߆)×Ó·öÛq·m(vø>Mݼ÷5ßVÝ‹[Jûmïqß*(ÆX¯û½’Ưå›Rüy˾Ù×ÅoŸÝÞ8‘×ÑŠ=÷*…Ú{VÊåÜÓæÛW[ÏoÖ~û™‹&xŠ©¼ÿ¶µCVÍ·¿»Úª¤ùvúBeêâۊͧ…d[ë×Ð¥z,¨ù¶B’oÚ³õ½FUë×7æ›ò§Kóm>}ßj¾­P·×¤6ÅÒfÊêŒj¼ –ˆ|ÂÅ9êˆ)Þº›õí-÷6ë‹+We©ù]t¥Å÷mÀó$÷À²ÄÀþ‘åäÏ·m†Þ®8w´Ð ²¢'³Ü>°ŸdrŒÚY‘‡™5{+‘x˜¿MôLJžÌžÜSýyÅþ›à½±2‚Ã×}Êð’osMÙ5/'ÏÁÏ‘ÙcI m‡Væxm OG²"ü÷á…üØ·=ˆÖëÀ7Š ø,þI¢çétßì¿}^™¸Ý\›l"Zìéh e,ÈÏùPGh½k"%òK*ì1éX±§£‰©¼¾Òi >²mø!Ó ÜÜXD¤ØúÒ +ò"ë_iq&CêlaïUŠVFॉ[ÿHÁë¿-"…±ÈÆú¥‰¼ h#EÖ¿&R“ Ùÿcõ±ÆÍ>=¤U»&RlSˆHÑÚ—¡E6ES6«Ãâ&™}Ì´kïç éÚ×hÉXÖíüÛãÑvÁ1Çwœ´ÈÀ˜?Óœ´swŒèè×yÖ™WŸÝ¬9>“M!þ£9ƒüü5®ÏŸEŸ‹ã1µ"ãõY‡XÆço‰ù“õ, KéÊü4A™Œ°;O¬˜÷$ÎùJ¦‘YÎ*~®O§¼*ÝÁ¸yç8ùbÊS™÷HEŸî&mbÉEóPô´órÑCkŠÓ1ÖÍ–7R +]–ð†=ê´k£»uykôÇ“÷°8Ú‘ uÚµ¼fM±­µ*qvšjÉd;e~‹ˆ&¥Ó­'µµ?(Êå´ +±î—¢âÕéÒ©+Ÿ¸þ1é KÚ?u&›±/_×°8fóËfpaÓ5,N˜¿bm.‚b9ù`…~Áª4L®PNí¿ÃËké;1§ RjÕ]L±Îæ)&—h'ök%Ã|‡6Žë.¹=Ó:–í¿@JjΠ–A«ª ©ÌÛØ|DŽI lõU¹»½þ³U™y[[Os”Ùý؃™,¡-“ªH䉟NÖõQçC°-•ÔInµ|4Œ n–BAu½Ÿ¦äVßÅSt„ãä:¢°-ϣɑe/éë#»5TÔO …®?NðÉÙMIù!#álõµíù$møTF<Ÿ?FP,A³Ž £*>4HYßì0ÙNé”åL —–hÉ}ílújÙ¨(‹À¨¿¯=>»’›Œ]f+g(-y1Ö÷[F›z¯ÁT¹™ÿÚEÉ ; §êøhøäÀûcÚ(r;VzÄ2¾Ä5Ýì%±N\â2b Kÿ‚¶F¦~ù¯ ±È—¸ª×}<º\{m,B¢K¨(C²ÊÞè…d’yEnÁk8ÅÇC²04ÉBâfÿä0IK¸7Þ¼$eW*{¹Z>#¼|°¦ð€ðI•ƒÙ2>W +ª÷1Ùô¢tó +ÚÜm]÷Ad9ëSˆx ¢cˆ“%rSiXÉLéÔ^iJh9™lÀ˜FT¾SšÒ§ÐŽµÇplúý1_ oŸCvGH|±“áÂ>o½DëNý¡çó;Qù úåŒhôêN©÷´d²ép:ðŽ\é#nŸmAÓ‘97F˜Î‘ ½I¡ê´lY ŽBÑÓCR[–‹DÕ¡Í*»ôü<3 š«NÂÉYèï´˜÷á˜ßjÚN¾+jx €iÅ[Õ¢­¬g¡oEÀNX|êþ,“íâM + #åt"¥ÄüŒ®eZL)ѶSçDÛN•x$šj„$ „I­/•hÏ¢Dã½×S,x%°ãÍdp ;_¢ «²ø²ü‰³¦&ÑN^ûçt‰v»`á\.Ñ”Ë÷^1Ý OÆ!ìâøM65k@¦„^–z´tëPÝF xžäç-Áç9ˆ£g—nÀòúed_k‹!ƒ–YÖùãNm1³øÓÄ,{1Ÿ$dM6M1{æéùb~Á¾´Ì?Ç@YSjÒ’0Çá3í5¡à8 À¹ü†¢áP+vÞÑoº /«ì&``«fu!ŒÏ¬ ¹6„§ÞKì{ “v¯Ÿ¶{|o¯F£Y’Ø…¦6|=ɾ×Á"`—Û÷Ÿk5]xªC³vzHëP‹!8—Ø÷(‚.<_‹a8*ö½Á{Õ€cTêëB,a>×kC™.ì(÷‰1xú'Ç‘üQ=‡ÅéJÙá)ñ†¦-ÐÙèL‰””»ooo—Īq~véê–ôKem럵֡˜!s—ŸI„EË#‚¹ôZç:»§Y ç‹_'reà8¢KšÏö]^JÅ”õyÔRÖç7äWPLTæm yòÙ‡asJëW%8`4Òû‘“kûÓ¦N²Ç—SØ8›N1—Œ]å¹¢‚ŽwIþ_ŽQä{|zÀôÏaŽõËœ3<>Eäêp½'ºÿô.id>‰\éuI-e夤9C²&¯8 +"ží9-jwÒQöü˜êaÓÃÆZAc|3ØÅñª–×¢?4“Ád7ùIÈSƒ˜“aÎ/³ÉnZÛ6r/éX²›¶ª¿á ‘–yÝà 2×ô˜’Wd3È2…“Á"wlzÔúXæ£1™Õ-œäôâU©åööhí#”'¥˜âÜ·{ƒY‡Ç}{ –Ú^¶`†ÎŽ§á•"L¿}V=4{ÆŽUQÓìÒÌ“XJÊ<°£f—á<¾ý±3ð'äñõŽå¿XdA+íÔ4í$}Súð ¼=1¶hu*¥–¢©=GÏÀ>E0(Ê#˜ªóg4/¼9–£Ç òÓéØŸeˆnÄ­Ì”S€çxã“X/¤ØÑ4Qãƒ%ÚY“~©Ì[Ë+?èTR¬WÉä2fËÄ|Ý,a©?©Ç-õóå 4L¯åYÄ7Õ&ÑŸoÝÕ]2àì ßgï§dØÙÓ <£xˆcW£À< ·jK•;k†:Äqý›4êË¥¸2˜tCÒ(+MÉ;`{½9Ó‘4g[žx@úWž˜Ü+;2º=8ÊïÈí \²3¢ÅÉ¿åÓÂ;*®k)I;:ÚQ;Um~†=V6ºâÅõ®iý–O ïh§Ù)OM§ñ‘HƒIáJh³À‰Y—dùÈÐ)ê”ð‡N—ä‹ù¸Ó¡SÀh—ôO§OŠÓë’òîŸ"þ˦$ýED¦‚#2žRKØj "ÃíñIϱF}7—Dd$þ~åòˆ pèœî8! 휈ÌA¶à唆¦ˆÈhe¤ËÏ œ‘QóW ¤çKÎA)z°àŽs²±ã{¨T!7–ïDcYûܸc™¾}v[ 0ƒ~NâêîoN2 y‰ÖíÔ¡EGÎôIC;ó»T¿ 2íèÒ écGT³åÕ|höð„*Ϋ3x^O7¯N’:ª“)|<z§{I•dõJlKÝ£zµÃ»HÑ3ƒŠŽÏy×:˜ô7ùpË_œ©Óχ;ýþ±sòáÔNA×æwAžÅ ùpz'Tÿ.E­/\òáTnÕLâ:?NvŠÿý¯óá”÷Ž²qwô–€?ɇ“íX8jy^>œÒÓÚÖA™l—gÖ#÷gg"”üL¤–miäLäËÒЙÈck;¥/5²ø€ÄåÙèŽçØì„c$D +ka8Éup’Aç üq‰†’ë´b‡ç%µl4N<Û×®ƒÏöõ‘‰P,BÍhÏÛË%ËPL>’D.]†L÷Z59¦¹ [+£ËPÇGô>Í_Te´¿¹ Ã9mùhä#œ?I„Ìùi±£p´¯Ö¸MKë˜õá•ÀGoC“G¥·5:=‡1,”|¦±ÓQ‡ZÈH%¯Ï= "³ÖÅÂge¤v¯;’H f¤v¯{FBGRýþ$#õsý7©Î_d¤¢|±Ë3R”¿ÈHEpŒ]­p‰ÕÎõá¢}iêɇŒœ^nöåËðíâe¨H…S—c +‡Ïóëžèù‹T8ÕyùóT¸óã–rŠéûî'ø•¤ÂIï ÂÉpÿ‘T8•¨Â N=>fÐ?ké†RQ ½?Y/ñi¬yVÕÈðr{,ë;â=è…@ E 0í›íN´a.>usA’Þ2¸…£w;/ˆr5•'b9žÜ¬Ì«ûÔ¼G©ø訊z×/ªçQÃÇÍ.q™|g/ÝNÎ2Øç kª]h&kù”gÉ_hÞ†Z¸lxî=¿I¥KL³’ÍøúÙlƇŠ4V¼:²Íä]æ"Nò\,µ¬3ä%q9JÚygáz´&e/y²[¬ÿx/ >KÇ.[ܼÔÊ° ´Þô’Ý~M¤D¡™ÑË°³=Nî»ZH¿u½ Re.VÔ½•Dá”Én·qU¨L¨H»vè%»‘>Ry=¾Ø\+ÃŽ±XÖÌþS+ÙíC/ël®Ÿa·l65‘ÞT‡ãÒ¡~=¾ú›6ÒüÃGQ“¼Öëh!­Ë3ìð¬Â‚åF?q|5Ø.¦ÖŽ*ÈZ>«† œ5¶§:«ŒŠ!úÀ{IÉÂ~¦T¨z±cGnå¬{ÁŽE¶GT»YþMjÏñªÊ¨‰v«µ.IöÅt:uìpê±s¬÷ú—•äÔÊŽ¨Ü©b º¤WIî¤(ÜGÎðÉ#ÙøNÈÎõ+"§{®Ï8?)"§9>µºoÇŠßñZ†‰~¬Îˆâ.µ êÇ_/Å¡v!"Íã®F ÐéGzÏɦ;/sj6šÀ×âü»l:ƒ÷Ã\˜M§T®—˳éÔréÎÍ|ÔΦS‹Å«Ÿ´¿$›NFnͪÞ?vQ6¨#7„œ‘Mw¦F>1›NmŸFЕ–M§–K'õ÷ÿ&›N-—ÎàÙž²éÔbí|ö¿Ë¦S›]éýÓl:5ãFzvôo²éÔré4n›¿ ›î°Kc‹¶¥tn6šqj²ýu6Úü©œ†º0›N êhMá³²é´l˿ͦ3N±K²é ”{â”MwÅNΦÓͱú³l:õÜê¿Î¦SXþ8›Nm·Dqþ²éÔăÜ{ý‹lº#;#”Mw\¿üE61Dkü¯²éŽerýM6Z.f=¾Ë@¯èÊê‹tu“v¯Ã"•ÊÚŸÖG»Œø¥V-›óëÕti‡vyþº^¶uaŒN;·ý$:‰T’„D9™G ƒ, KPÐÈzÖꔢKFEêrò©³º„(:©ì²^—ÔRhJ:é”]Ö™H‹É=¢[²²UxD´5²:RØ\?2'TËÒ+twq™;É=WMòsÊÜiV—»3”«d°ÌV&—±D:C$ôÏ'‹…î.›«bke¤ÊŒn”ÊP™»£ED˜‹ËÜq6Œ~¡»‹Ëܱ¹oG +ÝÛ  Žž3| +€;Ñ­°˾?É|¼|+UÔ¹œ›}ƒp ÕvUƒ"9ÙÕø‹ˆ¡d²«f +ÏeÇÀ %ÖjÕ€P&Ö6‡‰µÅßÝ +ˆ€ýI!cÌcÐ[#ÂLª»4IÙT#åÑz¯zg¨]‡[º(ïðµ®'®u†z¸þIfŠpóñé–Ä!¨êþ¯*‹šö±áµÿ|R¡j­Ý7Txíbs‚…¢wªó8pK çÒjÕ,~ªÝpxÚYÕg‰ 'íð:Ý*ËðÅ@"ƒ¡üÅîøüJ­wg,C•ÃçÖ­>­Â^æãËg4®ÂÝŸTÊ;šOd¬RÞ¥ùDB¥¼Ë—¡N…;y^’‘üs*ÜéÕ{E5îN¯pgôVs”ýtybíçZ4s´¼Wɵ츙c2bè°µéÎK¬Uf>/¡üÂ{ÕtèÓî¹ÂpΛwD 8’ÏyOóÅŽÂÑÎ…U$1™Ž]3Ëå’ß®–Ä$ÝEÂs° £Ž#a ®Å×}3˜Æd$‰Éžh+=Q‰3’Æ$ä‘Ø©J˜Í4¦¨ÃP†º®Û.¬Ê¨ÃȪ4’ÄdO,”Æ÷¹~åÛIILZ'ˆPíDM{šaøÆåð^p+¿Â0T¹,ñ­ÅÖ€ø‹׬OûV1ä¿œZ‘î¤r˜”ÚöXëﮦjáÝ·?Êqmi^Muº ÓÛžTîñH¥<ÿ™9®’õ)Ã0õ|<Ǻd8ëY/Ç•‹¡‰¨†Ôññ¦Êx+%š¹)™Íø+¯9Ë°Ò0Ùr·îF3±üv3ð©XÃÙ}…·Ï€²'¯s¬âÁ¡]Iì˜û$KÂ{¸}’"•åÙl[ËK«& UÉë°E³-|8§vÞfÿ%å2Y‘†G¸´rÿ‹5ôäüÒJÂûÔD +c¹.¬hͱEËû³&R{¹çûѪÃæ‘ +™\"kAJ‚Tžš¶µ‡nÄ:‚´"ËÑé¸ý˜©!5Ù•5çdix]e¼wñšRÆb <ä¾Å¬2#®£ƒ´he´‘ë–w5¤¸î[¸$K­T"}Ò«#x÷¢4Ÿ.ÈNvZ+zï>qI˜{WÂ/Ÿ}vt–Ðl'ͯ$¾]Ñ´ˆîèr—Õ$Œ¹PÂf í‘+ϬNœXPtMQƒN¼$«bvüà¤Ý °ÊĦ£픤ãUš]Bœ¬Ý©¬‘Ô¦ã‰MÛ¿ªÌ‚ºG*³$åôViNÝAe@Ð8åš^ÖâæÉ ²ÒŽœÐd©d2ÆOŠM¯SÇ'D­QÞÝÉU5ºtpJK¹^ ý¤SZ&›^§´ãħu ¤¥ö9-®?gcâ*ÿ™tÉ7¯ó‡5SÎs%vÙÀÕ×Gb°íü_]ÞØòšÝph I7¼lt—§¿ä&Z1'ñàʸ³’ÝÔ·¬Oº×º?3²,¿Ee^z ­Ú]qšùbǼ–ûât õø˜üЈÊk·pR½m Sø3¹[PJ˜sw½Ù„;­uŒw¬Ž—¯“õLç?²Ãõø4£*õÁ‚ixsº=¢QûÉžxÓÞ<-‘ì žÅeÙô3™NʱŠœtϤKŠü—AQ/v|Ô—uIrTŸÛ­–¬ÚS§V©œÒ{®tR•4>2âÎû xòYY€]:È”îW²ý9ÕåEùŒWd»¤(Ÿd,ÿÁ¢|Q…ÿHQ¾cÙþ¦(›3¢o \^”ÏdS± +ÿ¼(ßa}äÿDQ>íúÈY”ÏPýÊKŠòI£ +¨SŒf§8K Ö®êwùÝP•¿¸Ê`]?CwC]\×O2´?¸J«®ßiç”έë§_Õכּ¡TêúéG…Ô=ñÓëú©3ŸîÝPgÔõ;ÎÉQ×Oÿdˆ¹º°®ß±L®? +èêVõ3ÙN +èjÖõÓš"vqv]?YGªúQDµ®Ÿþ€ÔN¨žS×O5QïVsã„1œ)«zôuýôoþöÄ/¬ë§«è²X‹ýA]?ý°ðI7PéÔõÓwuUOAŸQ×O-MR\z—Õãûƒœ÷“êúéCAqþ¿¨ë§¿¡b2 ç’ÄweFê¹uýTLMIU?iu₺~ŠeHÈ«úÉîì:9=…êúÍ{ý“º~úUýN¾°®ŸþkIFêEuýÄü-5^TÜsuv]?}b öêú鬵í”þ£z|.}(†ëñ)'g¸ßEuý(ªËçÔlŽƒº~:yGOÛO­ë§oÉ£þ¢®Ÿ–9ÜI±0ûû«½W +ÉÙW¤þìrxçN{f!J?iËzŸaÌŸÝ Ÿ¾S¶`8Vº¹\?×ÓÖ‡É +úýð}áÍwçÛ˜ƒÕbà;ó4}¾4î™×qsø\¿8†#ëkÚÈý^7Ÿî¦ÑYüm9¼u,ÖÐÚ¶I-˜óëíÝJ;ŠŒmôQ.;÷cËG`ù9Œrkçv&Ÿ›³ÏÝN™©Ÿõ‹;NÛSD!s—! +£~…(27O›Íwıن_Ë[K›émƒ½šiÙt'üÞW]\óio¿þÍös‰ŠÍE,lnõ¡ ‘å—ÆÞ«Hº__!‡Z(‰êIî¿I›+ªVÔˆ…‰ÃÝÝ y¡­fͱâŒFG×>¬Y^Þ›Iëbã/ÜPŸ½e60P&i…O5ï=«À:¯v¿À9‰æt¡Ù´Öáûûµ¥Üd_)– ­–•$͉ñVÉÐ@¬©Ñ!Éز{“-÷^¾ášÙ¯âÓó\§ü»x%åßb…ˆeZË¿¦è6m‘,Î^Þ>Ó%ÆÜ8/k,[>ÓAº§!”ÊØj§bUó*=_"NNß½¾vÜù—·ú®Í|(i×úõÉ`kƒ='¿s Ó+‰ýAŸÿD:pì(ZÀ× gý‚À)¯àkƒ%ŒÅZìc²>þ‡!O݇l‰pç<¶}ÁQ*—I}Üá;z甾ˆìºÂ ·ôEÕÝ7Ù„W^é«vh(¼ðK_¬²? Rò¢˜Y£ì‚—ôÙ³£‡ãÙðH_ý<œ®oH–¬)©+Yòhô‚I´œ’¥Û'ôµ.…Ýûq#ÊÖ=l“¾5öÅ@"öÊ}o‚Dü(oiNöoˈlul¿þŒÁ¢¤Ö¸QÛr‹±Z²RNoYÿM Y(çm*Æb‰¡ ï§ÌÌ÷ãJ×ú£jî®lnˆ,)l d厫Mîpf(g©Wƒœ|.Äz5!@Ìw5ë°øõþI7öÖIþ}P#ШH̽,'S_ûv*;éúIÂßjÓ<{5’¡çnC}~Â^½˜€T®žEðÕϳý+Àî}¡Úl¯$gî_9ëb‰>Ó§ "›3ðõƒØéã‰÷ó¿~'„OnCÇb'|oÞiüÂdã^å¦Ö|ºŽþéoË;W^“pZÃ5kØòžˆ6ñb•†j¾ÜŽ*; ñúNw$ƒ_>±?ôó‘õ þ´^è)|¢¤íîèY@¥7õÂ÷K+›s‡Kþþ%,µ8Už•šß ©¤Ú·»kj_н»³3þ0{ýö¤…s&›Ùš Ç9œœÞ¢W³g½zD/àkš˜=÷o%³kmÙHô5š+`Hÿ Z4~†îœˆzºØ5dO Ê’œd„%ŽŽwyQª2Aз¯ùn¡ãüÀ·£å\rà•Š¬>+¹XT(^Eå¼n,ñçÅK G»x|¦ÌÉm_‚´T÷0ƒeYku.DÁÇ)2à@§Ï}ÄÀáˆr‹"ÅÒÙvEÛÑ8ÿ4åÁOa˜OkøZöÁÞZ®w>¹È$r•ø’€&$Ö hÕµÙµÍN]1áñ÷›DBÏÍY}¬+¶}H =° „,®¢hÉ=ÀŸÐK)û=M¨ƒ-€x’À¦oŸÍ{}Îa÷ÄE74s·<=Rk-ßÂRyÚ!«®.»½sÛÖ Ï°*Ùæ7ýðÄÂÅÏÌ;ÇVQ;p}RzN l‹Üf“Xº¤F®˜÷ò·Íc€rDZ´h·²&ˆ-cÍñ ú7 2þ{ÁÌ)‘…·")ˈ"¾9²˜»ÑÉáäs2þ‰'šÄf ÿìeÍ?kmü“Ç…›¶Æãߘ»éÛ—‡;™uÆp¢K/"f±ª3ªnfïˆxà WQ{öü õp-`4 °è´äkklè™ÿtØÒ¨›‡×QpWpóÖ*ó¨^š¯±)ÜÝñÀ_QñCȬQ\P[: ê§.;×Ç–ªSé7ª ®,Å‚Èm‚±¬¸!Ä+§&ñÍ[¡ Š7@ÁníYŸ>Á¦ +•eµK߉z¿1R˜ô¢%NPL1·ÑÚරYQÒ-ܪ R¯®. ìV œïƒÀAä·œáËe½8±øš´C0/†AàÀÒY¤äö÷‰ÑsÔ¯ +ú°’p?˜Ã.lHz²6·ØN¬&¯ñ™d;Ï©/¼yšSmi;PZ=d©k_éz­e’CU,eDTˆNkI;°Æ|—~I·ü’Ùìƒâe¤_‡!é¼T é×vêV: û8$ýJ,ÂÒ}dä`ĤïÛ¡„ôëO")írõ:"ýúìˆJ¿¶}RPà>Ä¥³ô¢6¸RØàOHû]bª)é×Û§´äk¯m“v(We{mT¦E–1Eú‹F½E=ß_4ê-rvò™þ¢QoQÀr–¿hÔ[d3¹Îõz‹ˆÇÎ÷z‹\ öLѨ·hºÈ_4ê-šl—ø‹F½EÀr¿hÔ[„Uy¿hÔ[Ä7í/ʽEtoÄ0ãæ"j;Od]pbÌRvåt¯+NÌÉ|£—5âêÍç½õ ³ÿ _C,Ž°‰ï†’‰£F€[•È.Xs´ ¦¼øî/¤PÞaɽpñ±a-gPߪgm@ç|*ÉËž!A"̯"½Ü*‚ËËÊ,¼ŽAñøy‡¬àDômLg™Ùõ¢€ôìX¹rJ²êµóE‹)7âƒ{T¢§À-¼ˆNÎ),V§ðà¤S ÂŒµ—üOÒŠÐÁ«p ºò?ígÃÍãfò3Y\yL1“?]&ÉçÅ`YØ ‡ÍáírËþ~>\쮢Wþt#[.‡ƒ¹a9^á ãàwH°•=œ—Éí…K· d›ä¬È"ÅiÉò”èæFD+)ÙBÇ^›“.%P àÉdCAƒ¸Ù6$ïÌžño}-°–´0¨Ã¸õ7,0ÆeÉ 7™}Þ}_}Uˆ.ìˆg½ü:÷^¢U)E·&Ž?2ßT#t—ºõÀ×¾³43–íÐH"'…Büf3•b£ îúõƒÙÝ÷=¨‡B„X  +¡ÜìzreÉ' A¿Ö–X²˜Ø=0àO’]jlxzíÿœïÂáó³ l3÷éwˆ´eÉÉÅCìkÄä%7÷5ê@Ä(ñb­2,«¿Ë„ÈëD©»‹ðqŒS|!A2á–¼èZ³ þEÖ ó"¼¢2ïÏ·ü«²_º¢b?iþ…"ö¬¦bÂ%>“b.f=’P{[Š»Xö! åSçÓÍ.µ¯íï@ðWû üµ”»ƒOìÁ³6“\¢€DR)Œ âj„×#LmíÑD›¬­ðõƒu±“ã¯}ÐþûÆi¦[b°¡‚VÕ+ ýæ±`ŽŠåüÝøMôga.Äó_ÉN»†£„8¬6î"ÐÃEV„¨=ˆl"é(†è¬„ë‘p±²›¹ò aæVSë´<% ¶:g Ç^­n@zWÊ^½G,=œåÚ{öslß{#È^µì„O$§˜zm*)S0W½.Ú˜ä>7µÓ' Ñ‹O+À×7?÷ëéÁj‹ÜÖ£ì·Õ$כ逖¼h›éŒi¨ïûµ7æ –Yt&L‡cös”3…ÇÌ,l Kä!‰±dyeÆÿaÏó‡<ÀªóIÖKŸc–]› ‹dÊŸº$ÿi@‰í8²û ô&¸{)¸œÉXèÅ{}_ø¾·E„C$z¶bÔaás£&¾œë2#ä8ç°ŪAåù:¥0ã™ +ësw¢‘èDaãwìy 6Œ›möÒ ~jY3û{Ä·M bß«­qÄ™‹7¿S•ƒxs¢5âÍÏ8œ(°ÀçVM +"¸,(AÐåDƒHrg¤€"˜²¬”+tì”sž ¡Í´mPlÿÈ,qrO»k÷lzíÖ +Ü=QYÆbs\èPZÞàa8µ-;ÀqMÔÑk>ä)‰³:Üò 0ŒE= ì[òáÔÖ»N•ßYL¡ Ù–¢oì…¼žãa`À6\¬Påžjþ¢ƒ ;̾v?tg« +_ d3¤ÏŸ;{ů[|a\@ßë?ÞkƒÀ×n^Ð|™]Ñ­Ù }N¬jס±E`xHÈúyŠÉ@|)¸_Jt6thQö V¥¼¥8~ÝÍî£FÉn)—®ÈrD)×è ¨Š}VA³]jf„)i} .‹<?w´NrÕõ)ÞQ߇œçýõ}L¶K¼£¾ˆåïǨïƒlþó½£¾Âr¾÷cÔ÷1]äýõ}Xæ\ïǨïƒ(v¾÷cÔ÷‚zgy?F}“íïǨï#õ’N÷~Øí<Ü`>à(’h±²¸2í`¤¸x£±âu×^~7&à÷b„ ;ºmÄ‘›G謊Dµ–>vÆž2q~%ÚÛô`¡O}íãeÿämçcs&ž¨›Ú *òµ{CðÁyÑ‹gÎÙ%Ãp<¦\xƒd{VLÍ)ë^Èvmá<É®2¼À‰:±{Á®—L^˜déX|v ØÏ#»WÃNù ø¸ìcXS¼‹S|$Xé$ Ÿ)>x·ýŸ¤)#)“d'¿HÛ&› ž4†»ý +5v2ßɢÚýg¸1WäûýG_…"èÿ©`¾Ñ£jÏäÀM¯ΫêÂdëøÓ›]nÒßM–‹î柫(zôv_}.箢WlÛ´]9 3DZÃ+' +©vÈ+f¹œ¡7ÂëUþ¿VËÍîŠÿ2ÙNz³áUsy•m4Ž·—¶ƒwLäUþ½ýÆ”†ðž¬àÓ£‰ð…‚£ô1¡¦ñ‚¢(ø!H&Àÿ­k‰ñö|©À‡_xôï«ÀÕýÕÇq5@°ŸLA"ä †"äã Pd8|57‘´ð¥Š¾€±*6T|›Ž4ˆzßÝNñ§·üÕ!®~ð‹áv|õf†Ô•ÿe¸Ù¯®Þ,èU¶»Ù ·“îâÊßüg5dŸ~ÐWÔו¿1ùoî?×Ýu¹w0TxWã¿Áç'¾Ñð_“þ𩘹ògbkÌ/!_$Ä0Wa ,u }•ý"¼#þ‰\‘òAñs’¤}T$àÃ~s +û€:A¾ƒëVqÓýGÚ/_€‘Â¥Cð»`D×4¡ÂÐëPD¶îÈìW +O“l^EJi @“"Áµ0)óïƒÀ¼t$x>q„¤Cz$Ž*òÑDˆñß%M˜€¤hU¾àF&a¿ò?à)!ÀT!1)ggEªQXÁÐÈ¢hF`áC†Tél€û‚a’äWÿUdbš$|d¢Oäb? ‘„6*l||ÂE®†®Ç·¤Œo½2Šj :„«Ân‡]>ºð@äÑCjdRÏ@$‘K…6:\zÀì¬-_W)¯† *¬Â¬J> >:™õñTúŒôADÂܯ„¯"³BÐùH„:dÖC Âìð¿gYh£-_ rý!‹‹c×ãVê(·¢:€«Âx¹ì€H‘…é¦Gmž‡„_‰ì*´Ña׶?àqqü:ìê#’µ:°%&”`6ýÃ>¹zÀæÊá¼z{…OÏð/"|{sÃ0å6;…qW,¦Ãâav6Y­&‹ö1Á?ÎM¶]°ŠÇåÅ¿†`øp±éé ûIbþ‡ AÔÆͺšaml ¶S½Þ››¼bÿã„ ¶¶Y»ûÀæ¦N°¹©ÿ›[0µ ÁÔ¾z2Nå´•‰C2ƒò#h…2A_ Dw€ øh2B‹ÏDÄG2`¾gGÈbu`ñP8OhxÂ\eM4¬"‚ +Ñ`M| ÍÀ"$h_8¼ +„`/P )ÊGÒ€LxÒ7‘$å G`Tb+ÀN%KÖBD|@…Á¸'ÈüJx ,LS@G@–!™FQ P¿, &äc€’5I  ²9ýbhèi|´*é < $H: +Ãë›øG!°‘±“/€í“fûA¡é `HAÆ +”Ø& #‰P ²"¾p ð#ŒQÌU,)†Aç( h˜6B¤¦‘ª£a´ 9 U"DX¤ÿÈ@Ãhƒ!Jlƒè€©CP(Ð?T ä£Â4…0‘¡@a +†€â ê ÌSÓ5B„X© @hŠôÁ0Ãï›Ð¼C„ÔI$&|@ò€$”t~$<£…~f+ËÍ‚îÁ_„ +…ð4‘DŒî ƒJ!h^A‘RÀ‚$pð8Ëz’@Ö%’•â=ÄŸ ƒ† Bt p…x8&DO(4§ O`rŠm.¶Š Â +&žJ„A†€kàgü3èÁúàáˆ+æ`]õM™È(ÇóbÑW?›î`‚NIÑ„¯To„È/öoæÇä%€ñ¯7`|A˜]ø„ôI–÷VwIXFosî§4 ÷†AÁý‚Œîà U|þE¦Ï#&CW^X +>† +RÆ0gxÌ€ûÊ ƒ€õ¡÷SXÀoñ—'ô³du¸g¢®2u±*­ ´Ærüª¿œ¯–{P»Ûqœùùr0”ß“U t I…Õã;ä º†üßÔ5kÓþ±ÊæÇ°ž!8†B2V (áMSÀ0ùû°ÎLH€Ò +†‚âœ0ËC…ÄgdPÈiç! O|ð;á,Ú0MÀÔð°@ëPÄ'<ñÉ÷Jl%Œ†‡t8¾¬iĪ㫢 $r$ØêþÿIbl–á¸KU"k_Bá j =¨ZÊG#%Œ& 0HXÉá %>A:ä*TxFƒ" ÍÁÁá¿K( 'ןõïì$‘œ›ly·‹¡G;Ħ¹QäÝS°g•z,aØüG&yÝ,·¹ÒpX–¼ý­­Å¯ûPšym5ðž»+øäÝ´L¶Â·ã‹ÊÌR3o, lÛì¬R¿¾uúîõ{&™:ÆSî²Ã ’îÏ¢mZÜÅ +][% mS/õ[” ³zAŸBÀ/Öp! O`,ßLö%«øhÛüƒJmŠó1G!MFþ (Ñìæ|>ï†oWG;·;àëÏ×®ÀÞâC£·JÆòƒÖtŒ¨Üº©\Åmw¯g4A•^ÌéfzQ!¨~`“ ´¢VáòGÛÁ§Ÿz76l×Ë0ž š 6"ßó¿oL°–hGø¿ÿÏdSy(yj6›ËÉ\yðCb@¢ÀÉz¢×½ÝÞ%È›ô Jõüt=K¹Ñ ®|sàØ[zÏ?(_[¢Ãï›AM}ïx>5ž +NWÁBÄ“d%™õxCËÇûx!;p‡St*òJTR·ß<”GVdgc¡…òýNÅŽ¿Êi¯-^¼…¯¯ ZD!ü&ÁB¹—Cdù$Ìç¨^$/Ð9…bVõ1ÜÔ_Tjјú‹^9¯eØ{ΪÿfÚ­ª¾¸süÞ©¿ ?ÒÒ!j—Šcàì·žgr±(X+__ÀZRŸHH–ÂÍ/ºÍγDk¸ËlsýQM½öC¡;ë˜uè{&œÝ­ÉÁ÷æ‰rý¶ö@ÅU…ô8ÍodÆóJú\£g“¶Æc²ï»«‘Þù艨´ž_¨|¼_£íË䘸ÛôÝ°JŸš©¸·öƒÀÛUS¶€+6Ž–[}¼¯n⢛|”4½ i°Té¨d°T$¦ƒðLj;€­ŒÐÈv~+<›©À;4\{0”É„#8bÅ„È ¥Áà(°yáYï¸ðOÀI·0ñ¿;ÜÓktõFÎ ´ +…Id¿S`Ì0èI€ hÑAL‡`P|’5‰Ï" Ïf&ñ—ü3:2å´×rÐ÷,7Dò*g¢Q<(ˆÀcš›±WU°W%¿•ôèOP*»ˆ€.’A 5Å L`+dIFB>&Ÿ„õ„Þp?£fA!7Ô„ +ƒ»ÑÒd¹ÿ¤„„ɪwXø¥@Bz„'ˆ ^v'¡ëYfg@QÞÙAOz#É°`LYá° rÒd0Gà L%X‹Aq(“>¦]HÚˆ +}¸Yá ~Ä=F„#,%f;ZDÄ?Âò½ÚðæŽJÇ¿ù‡ÿ›®Íÿ—ΗÀ\yi"Èú9 ÿöÉÿNNŒ${Õ6*QHçn™T£NŽê¯)5'‡ú6G²Tg~¦3áå}3ù½ùÿ›“CåÍ/¹““¡\æRŒ3³N¬MÒ=M¥°Q˜m?¸^ÙÑß>ƒ(ÖRy\¿ì+ÎK3 Õ;ØÛŠyŸf”à Ñ‚'äbvÕÇçÔ:]ÙZ®æ8W*øØ“¬»dô±'Þ‹©Xsw ¶ä¦Ïìtèsg“ª£Âìë«èŠŸx¿±¸ƒD¥>„býç'„°JÆRr,,€êýCäO:ýÀ|ƒYÛ»é"Gì¡œŠ}µúj_žßR¢K?Q¿ÈÝÆ#åS ²ç¤,´!ø›ÊæidØ }äûÆJ~K F+ßD‘å,ª˜K@oKe“-¸"ÓBÇpF~7®ñÚ;÷í´ ?ïËæË»+i%0$„¸Ø¾`ß‚¹0psúöY!‰%iOÛÓ6Äœ]v5{ó1ó,WÚ5Oô¨ Çøîséá¶tá¬ÔQ/ŠšèÇîçLô£mYÅÞÒ67kV+´"JwuÝRæÐY÷Å+õ ^¯HŸx}ûâZ)hWCZº×iy<0»rT ÚÀ5,~ù¡öLžzF—ôÓó{–Ü=hèZ¹×ŽH‡ó´7ßØ9ÅÁàÀìN+'ìñ„ß/èå–DB1é¯uB('2§*¸ÕŒ‚ÃÌʘªÉÐ7xc>LG®Â/—Á±Âp/¸Vº×Sˆ!cØ‘L¸ý£Þ‘ŒRŒ¬Â€ tM7–8AˆüK\GŸp4CÏÏÐ4™Qx;U¹ëÆ¡o >¥»kšL™-á}Šqm7ž^&±ô  f€÷¨YaüD ÆH¸©†¦cZ8‡Fg‘á2Š0ÊÐto_›¾Jdë½Âl* +Σ†£q¸Cíø†pAkÝÈQHw>S¡s¨áªX6žëÁÐ#%˜‘ë§bPœª®³‹¤¬+ˆÛ”ÈfÀj˜Ð¤‰71 ¾2Îe#…èKBìèµ¹…Q¹`9§",Ì….(¼AÖU|‰ÄÀ$Ê׆ÿŽQ´H» Ê<†€}àc¦ohª’Ze€U›鸋ŞZöã,âyáuâq†¡€E|kü÷x{¬ê;8öß™‚ÿqìû÷âXqë±ù +ÇziVÌ\å$îŽ [ƒcèÑ‚…:ø‚4uÜÊŽíñßű£óýÁDJÇKÉÃhn›5ïv àÎÜíÃYÉC/ÛeZ¼7bûÃÚ =»ÚñÒˆBA6 ˜(‰oÜ÷‡Qù|±§£d¡Ïgè,ÌÓ—h;˜óçäÑ=Ûc³^øØÓdŽE-ó¼ß˜gÓa^<+:P©Š‡G{¯¾Œ³+wõ™×…AÄ胱ˆc°bÁ‘w¬r=:„=–|qlSèÆHïÖÑìjâC;øa¶W7$q6Û9§·ô,"—¶´÷tº’mÁ?9®@µI¶,mQ{Y¸ì|ÂÍ"âUÒ–Á¯à—ƒcXÙÙEúqž¿‘ÑtµÕ–0r¹OîS/Nøâ*ŸáÊAšµ£DÙRSPVû7žŸNtìg^ÜÞooc?µÕc^OÞûÖ¤ƒŠˆ$e^&qpø4鵤O+ø‹ÀX<ŸPÍî$¾ Š«E x×ΗgïýŠ,\ck§Ù¼ø9Ã*¤¬„iÄ×+ÒØs?‘õÎÒÙðŠR>/ž½PM®W9æ·*lÜ›»~Å´Øz¼}1ë¦fÁ öºRÎÞ+ç° YËîwWÃ`,ôIz¶ž7n(«vÖqóÇ3rœ¸ÐÏ’mÏŽÚBùô ¬:µ”X´z7|RÒ¶èàvï˜ÝÍà“Açe¥‹õ˜Cvìv¢}˜QKY?á)w+Ê2Äh].H;Z¬ëFÙüøO 2 ,ŽyÂ>[Áõ°=K­fcÆOÀiè^´€B: …2Llæ©U¸SEìÁ/ó=£*¦£s=À4Ši² +_!"ôüÀ •7¡/H4̾öØŠjÌMâõá¦Á·…¥V!Ó‰uåÏ¡UÇ’%ò­›¾ +eë¢ë $‰ÆF5˜`æu…ÓÖm…tçC³a}º‚ a +ĵd0ŠiÕ\0Ñ’Óš®õ€‰0AP¾½> endobj 6 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 42 0 obj [/View/Design] endobj 43 0 obj <>>> endobj 40 0 obj [/View/Design] endobj 41 0 obj <>>> endobj 38 0 obj [/View/Design] endobj 39 0 obj <>>> endobj 36 0 obj [/View/Design] endobj 37 0 obj <>>> endobj 75 0 obj [74 0 R 73 0 R 72 0 R 71 0 R] endobj 135 0 obj <> endobj xref 0 136 0000000004 65535 f +0000000016 00000 n +0000000242 00000 n +0000042777 00000 n +0000000000 00000 f +0000134069 00000 n +0000134139 00000 n +0000134209 00000 n +0000134279 00000 n +0000000000 00000 f +0000042829 00000 n +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000134702 00000 n +0000134733 00000 n +0000134586 00000 n +0000134617 00000 n +0000134470 00000 n +0000134501 00000 n +0000134354 00000 n +0000134385 00000 n +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000000000 00000 f +0000051735 00000 n +0000051808 00000 n +0000051881 00000 n +0000051954 00000 n +0000134818 00000 n +0000043361 00000 n +0000045264 00000 n +0000067864 00000 n +0000047535 00000 n +0000052504 00000 n +0000047422 00000 n +0000052620 00000 n +0000052733 00000 n +0000050281 00000 n +0000050424 00000 n +0000050615 00000 n +0000050807 00000 n +0000046632 00000 n +0000046900 00000 n +0000045326 00000 n +0000134034 00000 n +0000046071 00000 n +0000046119 00000 n +0000050218 00000 n +0000047359 00000 n +0000047570 00000 n +0000051390 00000 n +0000051000 00000 n +0000051509 00000 n +0000051614 00000 n +0000052386 00000 n +0000052418 00000 n +0000052268 00000 n +0000052300 00000 n +0000052150 00000 n +0000052182 00000 n +0000052032 00000 n +0000052064 00000 n +0000056072 00000 n +0000052859 00000 n +0000052925 00000 n +0000052948 00000 n +0000053249 00000 n +0000053327 00000 n +0000055354 00000 n +0000055428 00000 n +0000056036 00000 n +0000055573 00000 n +0000055718 00000 n +0000055809 00000 n +0000055915 00000 n +0000056138 00000 n +0000056161 00000 n +0000056448 00000 n +0000056526 00000 n +0000056781 00000 n +0000067740 00000 n +0000056855 00000 n +0000057304 00000 n +0000057368 00000 n +0000067939 00000 n +0000068117 00000 n +0000069113 00000 n +0000083726 00000 n +0000134864 00000 n +trailer <<779150255FD24E0494C6DDB168101D01>]>> startxref 135035 %%EOF \ No newline at end of file diff --git a/images/tikzit48x48.png b/images/tikzit48x48.png index 056d04b..802d504 100644 Binary files a/images/tikzit48x48.png and b/images/tikzit48x48.png differ diff --git a/images/tikzit512x512.png b/images/tikzit512x512.png new file mode 100644 index 0000000..89b17ec Binary files /dev/null and b/images/tikzit512x512.png differ diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 3431c0c..edc1af4 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -124,6 +124,11 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) case ToolPalette::VERTEX: break; case ToolPalette::EDGE: + { + QLineF line(mousePos,mousePos); + _drawEdgeItem->setLine(line); + _drawEdgeItem->setVisible(true); + } break; case ToolPalette::CROP: break; @@ -226,6 +231,11 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) case ToolPalette::VERTEX: break; case ToolPalette::EDGE: + if (_drawEdgeItem->isVisible()) { + QPointF p1 = _drawEdgeItem->line().p1(); + QLineF line(p1, mousePos); + _drawEdgeItem->setLine(line); + } break; case ToolPalette::CROP: break; @@ -293,6 +303,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } break; case ToolPalette::EDGE: + _drawEdgeItem->setVisible(false); break; case ToolPalette::CROP: break; -- cgit v1.2.3 From 7ba78eb787b925c99bfd5838543bb98e0d4743c8 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 11 Jan 2018 13:39:59 +0100 Subject: added more source code documentation --- Doxyfile | 6 ++++-- images/tikzit128x128.png | Bin 0 -> 6525 bytes src/data/graph.h | 2 +- src/data/tikzdocument.h | 2 +- src/data/tikzlexer.l | 5 +++++ src/data/tikzparser.y | 6 ++++++ src/gui/mainwindow.h | 2 +- src/gui/nodeitem.h | 2 +- src/gui/propertypalette.h | 2 +- src/gui/tikzscene.h | 2 +- src/gui/tikzview.h | 2 +- src/gui/toolpalette.h | 2 +- src/gui/undocommands.h | 4 +++- src/main.cpp | 6 ++++++ src/tikzit.h | 29 +++++++++++++++++++++++++---- src/util.h | 2 +- 16 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 images/tikzit128x128.png (limited to 'src') diff --git a/Doxyfile b/Doxyfile index 039ed89..56cedb0 100644 --- a/Doxyfile +++ b/Doxyfile @@ -51,7 +51,7 @@ PROJECT_BRIEF = "A GUI diagram editor for TikZ" # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = images/tikzit48x48.png +PROJECT_LOGO = /Users/alek/git/tikzit/images/tikzit128x128.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -859,7 +859,9 @@ FILE_PATTERNS = *.c \ *.vhd \ *.vhdl \ *.ucf \ - *.qsf + *.qsf \ + *.l \ + *.y # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. diff --git a/images/tikzit128x128.png b/images/tikzit128x128.png new file mode 100644 index 0000000..2b09b4e Binary files /dev/null and b/images/tikzit128x128.png differ diff --git a/src/data/graph.h b/src/data/graph.h index 8856e5c..c25d51b 100644 --- a/src/data/graph.h +++ b/src/data/graph.h @@ -1,4 +1,4 @@ -/** +/*! * A graph defined by tikz code. */ diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h index f574f5c..d3a18b1 100644 --- a/src/data/tikzdocument.h +++ b/src/data/tikzdocument.h @@ -1,4 +1,4 @@ -/** +/*! * This class contains a tikz Graph, source code, file info, and undo stack. It serves as the model * in the MVC triple (TikzDocument, TikzView, TikzScene). */ diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index 8dd23c6..800ef8e 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -1,4 +1,9 @@ %{ +/*! + * \file tikzlexer.l + * + * The lexer for tikz input. + */ /* * Copyright 2010 Chris Heunen * Copyright 2010-2013 Aleks Kissinger diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index 420b8a0..aa6ac76 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -1,4 +1,10 @@ %{ +/*! + * \file tikzparser.y + * + * The parser for tikz input. + */ + /* * Copyright 2010 Chris Heunen * Copyright 2010-2013 Aleks Kissinger diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index f27677a..8adf1bc 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -1,4 +1,4 @@ -/** +/*! * A top-level window, which contains a single TikzDocument. */ diff --git a/src/gui/nodeitem.h b/src/gui/nodeitem.h index 9a3edb0..eb3fbb3 100644 --- a/src/gui/nodeitem.h +++ b/src/gui/nodeitem.h @@ -1,4 +1,4 @@ -/** +/*! * A QGraphicsItem that handles drawing a single node. */ diff --git a/src/gui/propertypalette.h b/src/gui/propertypalette.h index 7910d70..80f2d88 100644 --- a/src/gui/propertypalette.h +++ b/src/gui/propertypalette.h @@ -1,4 +1,4 @@ -/** +/*! * Enables the user to edit properties of the graph, as well as the selected node/edge. */ diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 6817792..936d42e 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -1,4 +1,4 @@ -/** +/*! * Manage the scene, which contains a single Graph, and respond to user input. This serves as * the controller for the MVC (TikzDocument, TikzView, TikzScene). */ diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h index fc3cba4..f89729b 100644 --- a/src/gui/tikzview.h +++ b/src/gui/tikzview.h @@ -1,4 +1,4 @@ -/** +/*! * Display a Graph, and manage any user input that purely changes the view (e.g. Zoom). This * serves as the view in the MVC (TikzDocument, TikzView, TikzScene). */ diff --git a/src/gui/toolpalette.h b/src/gui/toolpalette.h index ba6aed5..c28b5a1 100644 --- a/src/gui/toolpalette.h +++ b/src/gui/toolpalette.h @@ -1,4 +1,4 @@ -/** +/*! * A small window that lets the user select the current editing tool. */ diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index ffff876..0a7dece 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -1,4 +1,6 @@ -/** +/*! + * \file undocommands.h + * * All changes to a TikzDocument are done via subclasses of QUndoCommand. When a controller * (e.g. TikzScene) gets input from the user to change the document, it will push one of * these commands onto the TikzDocument's undo stack, which automatically calls the redo() diff --git a/src/main.cpp b/src/main.cpp index b676211..6b14549 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,9 @@ +/** + * \file main.cpp + * + * The main entry point for the TikZiT executable. + */ + #include "tikzit.h" #include diff --git a/src/tikzit.h b/src/tikzit.h index deb683e..1846b15 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -1,7 +1,28 @@ -/** - * Tikzit is the top-level class which maintains the global application state. For convenience, - * it also inherits the main menu. - */ +/*! + * + * \mainpage TikZiT Documentation + * + * This is the source code documentation for TikZiT. The global entry point + * for the TikZiT executable is in main.cpp, whereas the class Tikzit maintains + * the global application state. + * + * The TikZ parser is implemented in flex/bison in the files tikzlexer.l and tikzparser.y. + * + * Most of the interesting code for handling user input is in the class TikzScene. Anything + * that makes a change to the tikz file should be implemented as a QUndoCommand. Currently, + * these are all in undocommands.h. + * + */ + +/*! + * + * \class Tikzit + * + * Tikzit is the top-level class which maintains the global application state. For convenience, + * it also holds an instance of the main menu for macOS (or Ubuntu unity) style GUIs which only + * have one, application-level menu. + * + */ #ifndef TIKZIT_H #define TIKZIT_H diff --git a/src/util.h b/src/util.h index 2952214..7622269 100644 --- a/src/util.h +++ b/src/util.h @@ -1,4 +1,4 @@ -/** +/*! * Various utility functions, mostly for mathematical calculation. */ -- cgit v1.2.3 From 1302198001ddba65c825d213476b2e049d376d08 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 11 Jan 2018 13:49:54 +0100 Subject: ... --- src/tikzit.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/tikzit.h b/src/tikzit.h index 1846b15..dc47a27 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -12,6 +12,9 @@ * that makes a change to the tikz file should be implemented as a QUndoCommand. Currently, * these are all in undocommands.h. * + * I've basically been adding documentation as I go. Other bits and pieces can be accessed + * by searching, or via the class list/class hierarchy links in the menu above. + * */ /*! -- cgit v1.2.3 From b7af46fb5b23890387628528c2cf6e310fc96c25 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 14 Jan 2018 18:50:34 +0100 Subject: add edge implementation 1/2 --- src/gui/tikzscene.cpp | 29 ++++++++++++++++++++++------- src/gui/tikzscene.h | 2 ++ 2 files changed, 24 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index edc1af4..1d7ebd0 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -12,6 +12,7 @@ TikzScene::TikzScene(TikzDocument *tikzDocument, QObject *parent) : QGraphicsScene(parent), _tikzDocument(tikzDocument) { _modifyEdgeItem = 0; + _edgeStartNodeItem = 0; _drawEdgeItem = new QGraphicsLineItem(); setSceneRect(-310,-230,620,450); @@ -124,10 +125,15 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) case ToolPalette::VERTEX: break; case ToolPalette::EDGE: - { - QLineF line(mousePos,mousePos); - _drawEdgeItem->setLine(line); - _drawEdgeItem->setVisible(true); + foreach (QGraphicsItem *gi, items(mousePos)) { + if (NodeItem *ni = dynamic_cast(gi)){ + _edgeStartNodeItem = ni; + _edgeEndNodeItem = ni; + QLineF line(toScreen(ni->node()->point()), mousePos); + _drawEdgeItem->setLine(line); + _drawEdgeItem->setVisible(true); + break; + } } break; case ToolPalette::CROP: @@ -232,8 +238,17 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) break; case ToolPalette::EDGE: if (_drawEdgeItem->isVisible()) { + _edgeEndNodeItem = 0; + foreach (QGraphicsItem *gi, items(mousePos)) { + if (NodeItem *ni = dynamic_cast(gi)){ + _edgeEndNodeItem = ni; + break; + } + } QPointF p1 = _drawEdgeItem->line().p1(); - QLineF line(p1, mousePos); + QPointF p2 = (_edgeEndNodeItem != 0) ? toScreen(_edgeEndNodeItem->node()->point()) : mousePos; + QLineF line(p1, p2); + _drawEdgeItem->setLine(line); } break; @@ -295,8 +310,8 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) QRectF grow(gridPos.x() - GLOBAL_SCALEF, gridPos.y() - GLOBAL_SCALEF, 2 * GLOBAL_SCALEF, 2 * GLOBAL_SCALEF); QRectF newBounds = sceneRect().united(grow); - qDebug() << grow; - qDebug() << newBounds; + //qDebug() << grow; + //qDebug() << newBounds; AddNodeCommand *cmd = new AddNodeCommand(this, n, newBounds); _tikzDocument->undoStack()->push(cmd); diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 936d42e..5e236d7 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -48,6 +48,8 @@ private: QMap _edgeItems; QGraphicsLineItem *_drawEdgeItem; EdgeItem *_modifyEdgeItem; + NodeItem *_edgeStartNodeItem; + NodeItem *_edgeEndNodeItem; bool _firstControlPoint; QMap _oldNodePositions; -- cgit v1.2.3 From 4c4ced442811452e0a56800125db1620b2718c91 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 14 Jan 2018 19:01:59 +0100 Subject: add edge implementation 2/2 --- src/gui/tikzscene.cpp | 9 ++++++++- src/gui/undocommands.cpp | 24 ++++++++++++++++++++++++ src/gui/undocommands.h | 11 +++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 1d7ebd0..746e9dc 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -305,7 +305,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { int gridSize = GLOBAL_SCALE / 8; QPointF gridPos(round(mousePos.x()/gridSize)*gridSize, round(mousePos.y()/gridSize)*gridSize); - Node *n = new Node(); + Node *n = new Node(_tikzDocument); n->setPoint(fromScreen(gridPos)); QRectF grow(gridPos.x() - GLOBAL_SCALEF, gridPos.y() - GLOBAL_SCALEF, 2 * GLOBAL_SCALEF, 2 * GLOBAL_SCALEF); @@ -318,6 +318,13 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } break; case ToolPalette::EDGE: + if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0) { + Edge *e = new Edge(_edgeStartNodeItem->node(), _edgeEndNodeItem->node(), _tikzDocument); + AddEdgeCommand *cmd = new AddEdgeCommand(this, e); + _tikzDocument->undoStack()->push(cmd); + } + _edgeStartNodeItem = 0; + _edgeEndNodeItem = 0; _drawEdgeItem->setVisible(false); break; case ToolPalette::CROP: diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 736c258..0fb235d 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -160,3 +160,27 @@ void AddNodeCommand::redo() _scene->setBounds(_newBounds); } + +AddEdgeCommand::AddEdgeCommand(TikzScene *scene, Edge *edge) : + _scene(scene), _edge(edge) +{ +} + +void AddEdgeCommand::undo() +{ + EdgeItem *ei = _scene->edgeItems()[_edge]; + _scene->removeItem(ei); + _scene->edgeItems().remove(_edge); + delete ei; + + _scene->graph()->removeEdge(_edge); +} + +void AddEdgeCommand::redo() +{ + // TODO: get the current style + _scene->graph()->addEdge(_edge); + EdgeItem *ei = new EdgeItem(_edge); + _scene->edgeItems().insert(_edge, ei); + _scene->addItem(ei); +} diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 0a7dece..9032274 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -79,4 +79,15 @@ private: QRectF _newBounds; }; +class AddEdgeCommand : public QUndoCommand +{ +public: + explicit AddEdgeCommand(TikzScene *scene, Edge *edge); + void undo() override; + void redo() override; +private: + TikzScene *_scene; + Edge *_edge; +}; + #endif // UNDOCOMMANDS_H -- cgit v1.2.3 From 768e097abd17d07dd2748894b4dc1b09471dd6da Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 26 Jan 2018 22:34:15 +0900 Subject: started implementing project loader --- src/data/project.cpp | 13 ++++++ src/data/project.h | 21 +++++++++ src/data/tikzassembler.cpp | 54 +++++++++++++++++++++++ src/data/tikzassembler.h | 42 ++++++++++++++++++ src/data/tikzdocument.cpp | 4 +- src/data/tikzgraphassembler.cpp | 33 -------------- src/data/tikzgraphassembler.h | 31 ------------- src/data/tikzlexer.l | 3 +- src/data/tikzparser.y | 15 ++++++- src/data/tikzparserdefs.h | 2 +- src/gui/mainwindow.cpp | 2 +- src/gui/propertypalette.ui | 3 ++ src/test/testparser.cpp | 14 +++--- src/test/testtikzoutput.cpp | 4 +- src/tikzit.cpp | 2 + src/tikzit.h | 2 + stylepalette.cpp | 7 +++ stylepalette.h | 3 ++ stylepalette.ui | 96 ++++++++++++++++++++++++++++++++++++++--- tikzit.pro | 16 ++++--- tikzlexer.h | 4 +- 21 files changed, 276 insertions(+), 95 deletions(-) create mode 100644 src/data/project.cpp create mode 100644 src/data/project.h create mode 100644 src/data/tikzassembler.cpp create mode 100644 src/data/tikzassembler.h delete mode 100644 src/data/tikzgraphassembler.cpp delete mode 100644 src/data/tikzgraphassembler.h (limited to 'src') diff --git a/src/data/project.cpp b/src/data/project.cpp new file mode 100644 index 0000000..b129dc0 --- /dev/null +++ b/src/data/project.cpp @@ -0,0 +1,13 @@ +#include "project.h" + +#include "QDebug" + +Project::Project(QObject *parent) : QObject(parent) +{ + +} + +void Project::addStyle(QString name, GraphElementData *properties) +{ + qDebug() << "got style {" << name << "} = [" << properties << "]"; +} diff --git a/src/data/project.h b/src/data/project.h new file mode 100644 index 0000000..cbc2cb9 --- /dev/null +++ b/src/data/project.h @@ -0,0 +1,21 @@ +#ifndef PROJECT_H +#define PROJECT_H + +#include "graphelementdata.h" + +#include +#include + +class Project : public QObject +{ + Q_OBJECT +public: + explicit Project(QObject *parent = 0); + void addStyle(QString name, GraphElementData *properties); + +signals: + +public slots: +}; + +#endif // PROJECT_H diff --git a/src/data/tikzassembler.cpp b/src/data/tikzassembler.cpp new file mode 100644 index 0000000..456464a --- /dev/null +++ b/src/data/tikzassembler.cpp @@ -0,0 +1,54 @@ +#include "tikzassembler.h" + +#include "tikzparserdefs.h" +#include "tikzparser.parser.hpp" +#include "tikzlexer.h" + +int yyparse(void *scanner); + +TikzAssembler::TikzAssembler(Graph *graph, QObject *parent) : + QObject(parent), _graph(graph), _project(0) +{ + yylex_init(&scanner); + yyset_extra(this, scanner); +} + +TikzAssembler::TikzAssembler(Project *project, QObject *parent) : + QObject(parent), _graph(0), _project(project) +{ + yylex_init(&scanner); + yyset_extra(this, scanner); +} + +void TikzAssembler::addNodeToMap(Node *n) { _nodeMap.insert(n->name(), n); } +Node *TikzAssembler::nodeWithName(QString name) { return _nodeMap[name]; } + +bool TikzAssembler::parse(const QString &tikz) +{ + yy_scan_string(tikz.toLatin1().data(), scanner); + int result = yyparse(scanner); + + if (result == 0) return true; + else return false; +} + +Graph *TikzAssembler::graph() const +{ + return _graph; +} + +Project *TikzAssembler::project() const +{ + return _project; +} + +bool TikzAssembler::isGraph() const +{ + return _graph != 0; +} + +bool TikzAssembler::isProject() const +{ + return _project != 0; +} + diff --git a/src/data/tikzassembler.h b/src/data/tikzassembler.h new file mode 100644 index 0000000..8dbbc9b --- /dev/null +++ b/src/data/tikzassembler.h @@ -0,0 +1,42 @@ +/** + * Convenience class to hold the parser state while loading tikz graphs or projects. + */ + +#ifndef TIKZASSEMBLER_H +#define TIKZASSEMBLER_H + +#include "node.h" +#include "graph.h" +#include "project.h" + +#include +#include + +class TikzAssembler : public QObject +{ + Q_OBJECT +public: + explicit TikzAssembler(Graph *graph, QObject *parent = 0); + explicit TikzAssembler(Project *project, QObject *parent = 0); + void addNodeToMap(Node *n); + Node *nodeWithName(QString name); + bool parse(const QString &tikz); + + Graph *graph() const; + Project *project() const; + bool isGraph() const; + bool isProject() const; + + +signals: + +public slots: + +private: + QHash _nodeMap; + Graph *_graph; + Project *_project; + void *scanner; +}; + +#endif // TIKZASSEMBLER_H diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index 13d4c6e..a3fa961 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -5,7 +5,7 @@ #include #include "tikzdocument.h" -#include "tikzgraphassembler.h" +#include "tikzassembler.h" TikzDocument::TikzDocument(QObject *parent) : QObject(parent) { @@ -58,7 +58,7 @@ void TikzDocument::open(QString fileName) file.close(); Graph *newGraph = new Graph(this); - TikzGraphAssembler ass(newGraph); + TikzAssembler ass(newGraph); if (ass.parse(_tikz)) { delete _graph; _graph = newGraph; diff --git a/src/data/tikzgraphassembler.cpp b/src/data/tikzgraphassembler.cpp deleted file mode 100644 index c05a5c8..0000000 --- a/src/data/tikzgraphassembler.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "tikzgraphassembler.h" - -#include "tikzparserdefs.h" -#include "tikzparser.parser.hpp" -#include "tikzlexer.h" - -int yyparse(void *scanner); - - -TikzGraphAssembler::TikzGraphAssembler(Graph *graph, QObject *parent) : - QObject(parent), _graph(graph) -{ - yylex_init(&scanner); - yyset_extra(this, scanner); -} - -void TikzGraphAssembler::addNodeToMap(Node *n) { _nodeMap.insert(n->name(), n); } -Node *TikzGraphAssembler::nodeWithName(QString name) { return _nodeMap[name]; } - -bool TikzGraphAssembler::parse(const QString &tikz) -{ - yy_scan_string(tikz.toLatin1().data(), scanner); - int result = yyparse(scanner); - - if (result == 0) return true; - else return false; -} - -Graph *TikzGraphAssembler::graph() const -{ - return _graph; -} - diff --git a/src/data/tikzgraphassembler.h b/src/data/tikzgraphassembler.h deleted file mode 100644 index 79b89b0..0000000 --- a/src/data/tikzgraphassembler.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef TIKZGRAPHASSEMBLER_H -#define TIKZGRAPHASSEMBLER_H - -#include "node.h" -#include "graph.h" - -#include -#include - -class TikzGraphAssembler : public QObject -{ - Q_OBJECT -public: - explicit TikzGraphAssembler(Graph *graph, QObject *parent = 0); - void addNodeToMap(Node *n); - Node *nodeWithName(QString name); - bool parse(const QString &tikz); - - Graph *graph() const; - -signals: - -public slots: - -private: - QHash _nodeMap; - Graph *_graph; - void *scanner; -}; - -#endif // TIKZGRAPHASSEMBLER_H diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index 800ef8e..faf0d43 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -38,11 +38,12 @@ %} %option reentrant bison-bridge bison-locations 8bit +%option bison-locations 8bit %option nounput %option yylineno %option noyywrap %option header-file="tikzlexer.h" -%option extra-type="TikzGraphAssembler *" +%option extra-type="TikzAssembler *" %s props %s xcoord diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index aa6ac76..a4db3dd 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -62,7 +62,7 @@ #include "graphelementproperty.h" #include "tikzlexer.h" -#import "tikzgraphassembler.h" +#import "tikzassembler.h" /* the assembler (used by this parser) is stored in the lexer state as "extra" data */ #define assembler yyget_extra(scanner) @@ -127,9 +127,20 @@ void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { %% + +tikz: tikzstyles | tikzpicture; + +tikzstyles: tikzstyles tikzstyle | ; +tikzstyle: "\\tikzstyle" DELIMITEDSTRING "=" "[" properties "]" + { + if (assembler->isProject()) { + assembler->project()->addStyle(QString($2), $5); + } + } + tikzpicture: "\\begin{tikzpicture}" optproperties tikzcmds "\\end{tikzpicture}" { - if ($2) { + if (assembler->isGraph() && $2) { assembler->graph()->setData($2); } }; diff --git a/src/data/tikzparserdefs.h b/src/data/tikzparserdefs.h index 9d4bfe8..b51a8c9 100644 --- a/src/data/tikzparserdefs.h +++ b/src/data/tikzparserdefs.h @@ -4,7 +4,7 @@ #include "graphelementproperty.h" #include "graphelementdata.h" #include "node.h" -#include "tikzgraphassembler.h" +#include "tikzassembler.h" #include #include diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 19b6a59..54474ae 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1,6 +1,6 @@ #include "mainwindow.h" #include "ui_mainwindow.h" -#include "tikzgraphassembler.h" +#include "tikzassembler.h" #include "toolpalette.h" #include "tikzit.h" diff --git a/src/gui/propertypalette.ui b/src/gui/propertypalette.ui index 83d586e..a8ba5d2 100644 --- a/src/gui/propertypalette.ui +++ b/src/gui/propertypalette.ui @@ -10,6 +10,9 @@ 341 + + false + Properties diff --git a/src/test/testparser.cpp b/src/test/testparser.cpp index e220e2e..284930e 100644 --- a/src/test/testparser.cpp +++ b/src/test/testparser.cpp @@ -1,6 +1,6 @@ #include "testparser.h" #include "graph.h" -#include "tikzgraphassembler.h" +#include "tikzassembler.h" #include #include @@ -18,7 +18,7 @@ void TestParser::parseEmptyGraph() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); bool res = ga.parse("\\begin{tikzpicture}\n\\end{tikzpicture}"); QVERIFY(res); QVERIFY(g->nodes().size() == 0); @@ -29,7 +29,7 @@ void TestParser::parseEmptyGraph() void TestParser::parseNodeGraph() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); bool res = ga.parse( "\\begin{tikzpicture}\n" " \\node (node0) at (1.1, -2.2) {};\n" @@ -50,7 +50,7 @@ void TestParser::parseNodeGraph() void TestParser::parseEdgeGraph() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); bool res = ga.parse( "\\begin{tikzpicture}\n" " \\begin{pgfonlayer}{nodelayer}\n" @@ -81,7 +81,7 @@ void TestParser::parseEdgeGraph() void TestParser::parseEdgeNode() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); bool res = ga.parse( "\\begin{tikzpicture}\n" " \\begin{pgfonlayer}{nodelayer}\n" @@ -106,7 +106,7 @@ void TestParser::parseEdgeNode() void TestParser::parseEdgeBends() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); bool res = ga.parse( "\\begin{tikzpicture}\n" " \\begin{pgfonlayer}{nodelayer}\n" @@ -136,7 +136,7 @@ void TestParser::parseEdgeBends() void TestParser::parseBbox() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); bool res = ga.parse( "\\begin{tikzpicture}\n" " \\path [use as bounding box] (-1.5,-1.5) rectangle (1.5,1.5);\n" diff --git a/src/test/testtikzoutput.cpp b/src/test/testtikzoutput.cpp index f086786..1c25439 100644 --- a/src/test/testtikzoutput.cpp +++ b/src/test/testtikzoutput.cpp @@ -2,7 +2,7 @@ #include "graphelementproperty.h" #include "graphelementdata.h" #include "graph.h" -#include "tikzgraphassembler.h" +#include "tikzassembler.h" #include #include @@ -58,7 +58,7 @@ void TestTikzOutput::graphEmpty() void TestTikzOutput::graphFromTikz() { Graph *g = new Graph(); - TikzGraphAssembler ga(g); + TikzAssembler ga(g); QString tikz = "\\begin{tikzpicture}\n" diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 42d16e8..a488b8a 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -18,11 +18,13 @@ Tikzit::Tikzit() _toolPalette = new ToolPalette(dummy); _propertyPalette = new PropertyPalette(dummy); + _stylePalette = new StylePalette(dummy); loadStyles(); _toolPalette->show(); _propertyPalette->show(); + _stylePalette->show(); _windows << new MainWindow(); _windows[0]->show(); diff --git a/src/tikzit.h b/src/tikzit.h index dc47a27..a241a78 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -36,6 +36,7 @@ #include "toolpalette.h" #include "propertypalette.h" +#include "stylepalette.h" #include "nodestyle.h" #include @@ -83,6 +84,7 @@ private: MainMenu *_mainMenu; ToolPalette *_toolPalette; PropertyPalette *_propertyPalette; + StylePalette *_stylePalette; QVector _windows; MainWindow *_activeWindow; QVector _nodeStyles; diff --git a/stylepalette.cpp b/stylepalette.cpp index ba0cd0d..2781a90 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -1,6 +1,8 @@ #include "stylepalette.h" #include "ui_stylepalette.h" +#include + StylePalette::StylePalette(QWidget *parent) : QDockWidget(parent), ui(new Ui::StylePalette) @@ -12,3 +14,8 @@ StylePalette::~StylePalette() { delete ui; } + +void StylePalette::on_buttonOpenProject_clicked() +{ + qDebug() << "got click"; +} diff --git a/stylepalette.h b/stylepalette.h index 8a90d95..99afe51 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -15,6 +15,9 @@ public: explicit StylePalette(QWidget *parent = 0); ~StylePalette(); +public slots: + void on_buttonOpenProject_clicked(); + private: Ui::StylePalette *ui; }; diff --git a/stylepalette.ui b/stylepalette.ui index dd4190e..941212b 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -1,18 +1,102 @@ - + StylePalette - + 0 0 - 400 - 300 + 250 + 350 + + + 250 + 350 + + - DockWidget + Styles - + + + + + 10 + 12 + 51 + 16 + + + + Project: + + + + + + 60 + 13 + 131 + 16 + + + + + Courier + 75 + true + + + + [default] + + + + + + 195 + 10 + 22 + 22 + + + + New Project + + + + + + + :/images/document-new.png:/images/document-new.png + + + + + + 220 + 10 + 22 + 22 + + + + New Project + + + + + + + :/images/document-open.png:/images/document-open.png + + + + + + + diff --git a/tikzit.pro b/tikzit.pro index 2e71e73..d3a9c62 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -35,7 +35,6 @@ SOURCES += src/gui/mainwindow.cpp \ src/data/graph.cpp \ src/data/node.cpp \ src/data/edge.cpp \ - src/data/tikzgraphassembler.cpp \ src/data/graphelementdata.cpp \ src/data/graphelementproperty.cpp \ src/gui/propertypalette.cpp \ @@ -49,7 +48,9 @@ SOURCES += src/gui/mainwindow.cpp \ src/gui/undocommands.cpp \ src/gui/mainmenu.cpp \ src/util.cpp \ - stylepalette.cpp + stylepalette.cpp \ + src/data/project.cpp \ + src/data/tikzassembler.cpp HEADERS += src/gui/mainwindow.h \ src/gui/toolpalette.h \ @@ -57,7 +58,6 @@ HEADERS += src/gui/mainwindow.h \ src/data/graph.h \ src/data/node.h \ src/data/edge.h \ - src/data/tikzgraphassembler.h \ src/data/graphelementdata.h \ src/data/graphelementproperty.h \ src/gui/propertypalette.h \ @@ -72,11 +72,13 @@ HEADERS += src/gui/mainwindow.h \ src/gui/undocommands.h \ src/gui/mainmenu.h \ src/util.h \ - stylepalette.h + stylepalette.h \ + src/data/project.h \ + src/data/tikzassembler.h -FORMS += src/gui/mainwindow.ui \ - src/gui/propertypalette.ui \ - src/gui/mainmenu.ui \ +FORMS += src/gui/mainwindow.ui \ + src/gui/propertypalette.ui \ + src/gui/mainmenu.ui \ stylepalette.ui INCLUDEPATH += src src/gui src/data diff --git a/tikzlexer.h b/tikzlexer.h index 6598601..73df7b6 100644 --- a/tikzlexer.h +++ b/tikzlexer.h @@ -234,7 +234,7 @@ void yyfree (void * ,yyscan_t yyscanner ); #include #endif -#define YY_EXTRA_TYPE TikzGraphAssembler * +#define YY_EXTRA_TYPE TikzAssembler * int yylex_init (yyscan_t* scanner); @@ -338,7 +338,7 @@ extern int yylex \ #undef YY_DECL #endif -#line 174 "src/data/tikzlexer.l" +#line 188 "src/data/tikzlexer.l" #line 344 "tikzlexer.h" #undef yyIN_HEADER -- cgit v1.2.3 From 09c331761648541de907c866c56fb6084c6f7a9b Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 15 Feb 2018 16:32:33 +0100 Subject: added support for changing edge mode, and started working on windows support --- images/Inkscape_icons_draw_calligraphic.svg | 201 ++++ images/Inkscape_icons_draw_ellipse.svg | 117 ++ images/Inkscape_icons_draw_path.svg | 177 +++ images/Inkscape_icons_draw_rectangle.svg | 95 ++ images/Inkscape_icons_edit_select_all.svg | 1513 ++++++++++++++++++++++++++ images/Inkscape_icons_node_segment_curve.svg | 50 + images/crop.svg | 47 + images/document-new.svg | 448 ++++++++ images/document-open.svg | 535 +++++++++ images/edge.svg | 64 ++ images/node.svg | 39 + images/select.svg | 90 ++ qt.conf | 2 + src/data/edge.cpp | 5 + src/data/edge.h | 1 + src/data/graphelementdata.h | 1 + src/gui/mainmenu.cpp | 5 + src/gui/mainmenu.h | 1 + src/gui/mainmenu.ui | 7 + src/gui/mainwindow.cpp | 17 +- src/gui/mainwindow.h | 4 + src/gui/mainwindow.ui | 8 +- src/gui/propertypalette.cpp | 2 +- src/gui/tikzscene.cpp | 24 +- src/gui/tikzscene.h | 5 +- src/gui/tikzview.cpp | 1 + src/gui/toolpalette.cpp | 10 +- src/gui/undocommands.cpp | 22 + src/gui/undocommands.h | 11 + src/main.cpp | 5 + src/tikzit.cpp | 17 +- src/tikzit.h | 1 + stylepalette.cpp | 14 + stylepalette.h | 3 + stylepalette.ui | 7 +- tikzit.qrc | 15 + 36 files changed, 3543 insertions(+), 21 deletions(-) create mode 100644 images/Inkscape_icons_draw_calligraphic.svg create mode 100644 images/Inkscape_icons_draw_ellipse.svg create mode 100644 images/Inkscape_icons_draw_path.svg create mode 100644 images/Inkscape_icons_draw_rectangle.svg create mode 100644 images/Inkscape_icons_edit_select_all.svg create mode 100644 images/Inkscape_icons_node_segment_curve.svg create mode 100644 images/crop.svg create mode 100644 images/document-new.svg create mode 100644 images/document-open.svg create mode 100644 images/edge.svg create mode 100644 images/node.svg create mode 100644 images/select.svg create mode 100644 qt.conf (limited to 'src') diff --git a/images/Inkscape_icons_draw_calligraphic.svg b/images/Inkscape_icons_draw_calligraphic.svg new file mode 100644 index 0000000..e1b3352 --- /dev/null +++ b/images/Inkscape_icons_draw_calligraphic.svg @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/images/Inkscape_icons_draw_ellipse.svg b/images/Inkscape_icons_draw_ellipse.svg new file mode 100644 index 0000000..26c4446 --- /dev/null +++ b/images/Inkscape_icons_draw_ellipse.svg @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/images/Inkscape_icons_draw_path.svg b/images/Inkscape_icons_draw_path.svg new file mode 100644 index 0000000..b7cb2db --- /dev/null +++ b/images/Inkscape_icons_draw_path.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/images/Inkscape_icons_draw_rectangle.svg b/images/Inkscape_icons_draw_rectangle.svg new file mode 100644 index 0000000..7504d56 --- /dev/null +++ b/images/Inkscape_icons_draw_rectangle.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/images/Inkscape_icons_edit_select_all.svg b/images/Inkscape_icons_edit_select_all.svg new file mode 100644 index 0000000..0da2e0b --- /dev/null +++ b/images/Inkscape_icons_edit_select_all.svg @@ -0,0 +1,1513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/Inkscape_icons_node_segment_curve.svg b/images/Inkscape_icons_node_segment_curve.svg new file mode 100644 index 0000000..fad6969 --- /dev/null +++ b/images/Inkscape_icons_node_segment_curve.svg @@ -0,0 +1,50 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/images/crop.svg b/images/crop.svg new file mode 100644 index 0000000..226faa8 --- /dev/null +++ b/images/crop.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/document-new.svg b/images/document-new.svg new file mode 100644 index 0000000..1bfdb16 --- /dev/null +++ b/images/document-new.svg @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + New Document + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/document-open.svg b/images/document-open.svg new file mode 100644 index 0000000..55e6177 --- /dev/null +++ b/images/document-open.svg @@ -0,0 +1,535 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Folder Icon Accept + 2005-01-31 + + + Jakub Steiner + + + + http://jimmac.musichall.cz + Active state - when files are being dragged to. + + + Novell, Inc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/edge.svg b/images/edge.svg new file mode 100644 index 0000000..f4a9716 --- /dev/null +++ b/images/edge.svg @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/node.svg b/images/node.svg new file mode 100644 index 0000000..c728086 --- /dev/null +++ b/images/node.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/select.svg b/images/select.svg new file mode 100644 index 0000000..7ffc893 --- /dev/null +++ b/images/select.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/qt.conf b/qt.conf new file mode 100644 index 0000000..81319bc --- /dev/null +++ b/qt.conf @@ -0,0 +1,2 @@ +[Platforms] +WindowsArguments = dpiawareness=1 diff --git a/src/data/edge.cpp b/src/data/edge.cpp index 6802b2d..e4d5d69 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -278,6 +278,11 @@ float Edge::cpDist() const return _cpDist; } +void Edge::setBasicBendMode(bool mode) +{ + _basicBendMode = mode; +} + void Edge::setBend(int bend) { _bend = bend; diff --git a/src/data/edge.h b/src/data/edge.h index d2913b8..595b094 100644 --- a/src/data/edge.h +++ b/src/data/edge.h @@ -50,6 +50,7 @@ public: bool basicBendMode() const; float cpDist() const; + void setBasicBendMode(bool mode); void setBend(int bend); void setInAngle(int inAngle); void setOutAngle(int outAngle); diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index 1139a00..0d43bb8 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -22,6 +22,7 @@ public: QString property(QString key); bool atom(QString atom); + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index c9e83ba..714ed34 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -32,6 +32,11 @@ void MainMenu::on_actionSave_As_triggered() // TODO } +void MainMenu::on_actionExit_triggered() +{ + tikzit->quit(); +} + // Edit void MainMenu::on_actionUndo_triggered() diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index d85e271..ee167e6 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -21,6 +21,7 @@ public slots: void on_actionClose_triggered(); void on_actionSave_triggered(); void on_actionSave_As_triggered(); + void on_actionExit_triggered(); // Edit void on_actionUndo_triggered(); diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui index c9b6f44..2f15d5a 100644 --- a/src/gui/mainmenu.ui +++ b/src/gui/mainmenu.ui @@ -20,6 +20,8 @@ + + @@ -177,6 +179,11 @@ Ctrl+- + + + Exit + + diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 54474ae..eac7c44 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1,5 +1,7 @@ #include "mainwindow.h" #include "ui_mainwindow.h" + +#include "mainmenu.h" #include "tikzassembler.h" #include "toolpalette.h" #include "tikzit.h" @@ -22,11 +24,22 @@ MainWindow::MainWindow(QWidget *parent) : ui->setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); _tikzDocument = new TikzDocument(this); - _tikzScene = new TikzScene(_tikzDocument, this); + + _tools = new ToolPalette(this); + addToolBar(_tools); + + _tikzScene = new TikzScene(_tikzDocument, _tools, this); ui->tikzView->setScene(_tikzScene); _fileName = ""; _pristine = true; + + // TODO: check if each window should have a menu + _menu = new MainMenu(); + _menu->setParent(this); + + setMenuBar(_menu); + // initially, the source view should be collapsed QList sz = ui->splitter->sizes(); sz[0] = sz[0] + sz[1]; @@ -59,7 +72,7 @@ void MainWindow::open(QString fileName) void MainWindow::closeEvent(QCloseEvent *event) { - //qDebug() << "got close event"; + qDebug() << "got close event"; QMainWindow::closeEvent(event); } diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 8adf1bc..ba680b0 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -9,6 +9,8 @@ #include "tikzview.h" #include "graph.h" #include "tikzdocument.h" +#include "mainmenu.h" +#include "toolpalette.h" #include #include @@ -38,6 +40,8 @@ protected: private: TikzScene *_tikzScene; TikzDocument *_tikzDocument; + MainMenu *_menu; + ToolPalette *_tools; Ui::MainWindow *ui; QString _fileName; bool _pristine; diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index 56a5c2d..137d6cf 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -7,13 +7,19 @@ 0 0 640 - 480 + 580 TikZiT - untitled + + + 0 + 0 + + 0 diff --git a/src/gui/propertypalette.cpp b/src/gui/propertypalette.cpp index b06e866..3e4ba88 100644 --- a/src/gui/propertypalette.cpp +++ b/src/gui/propertypalette.cpp @@ -22,7 +22,7 @@ PropertyPalette::PropertyPalette(QWidget *parent) : d->setProperty("key 2", "value 2"); //QModelIndex i = d->index(0,0); - ui->treeView->setModel(d); + //ui->treeView->setModel(d); QSettings settings("tikzit", "tikzit"); QVariant geom = settings.value("property-palette-geometry"); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 746e9dc..a3dd8ce 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -8,8 +8,8 @@ #include -TikzScene::TikzScene(TikzDocument *tikzDocument, QObject *parent) : - QGraphicsScene(parent), _tikzDocument(tikzDocument) +TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *parent) : + QGraphicsScene(parent), _tikzDocument(tikzDocument), _tools(tools) { _modifyEdgeItem = 0; _edgeStartNodeItem = 0; @@ -73,7 +73,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) qreal cpR = GLOBAL_SCALEF * (0.05); qreal cpR2 = cpR * cpR; - switch (tikzit->toolPalette()->currentTool()) { + switch (_tools->currentTool()) { case ToolPalette::SELECT: // check if we grabbed a control point of an edge foreach (QGraphicsItem *gi, selectedItems()) { @@ -145,8 +145,10 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { // current mouse position, in scene coordinates QPointF mousePos = event->scenePos(); + QRectF rb = views()[0]->rubberBandRect(); + invalidate(-800,-800,1600,1600); - switch (tikzit->toolPalette()->currentTool()) { + switch (_tools->currentTool()) { case ToolPalette::SELECT: if (_modifyEdgeItem != 0) { Edge *e = _modifyEdgeItem->edge(); @@ -262,7 +264,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) // current mouse position, in scene coordinates QPointF mousePos = event->scenePos(); - switch (tikzit->toolPalette()->currentTool()) { + switch (_tools->currentTool()) { case ToolPalette::SELECT: if (_modifyEdgeItem != 0) { // finished dragging a control point @@ -361,6 +363,18 @@ void TikzScene::keyReleaseEvent(QKeyEvent *event) } } +void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) +{ + QPointF mousePos = event->scenePos(); + foreach (QGraphicsItem *gi, items(mousePos)) { + if (EdgeItem *ei = dynamic_cast(gi)) { + ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge()); + _tikzDocument->undoStack()->push(cmd); + break; + } + } +} + void TikzScene::getSelection(QSet &selNodes, QSet &selEdges) { foreach (QGraphicsItem *gi, selectedItems()) { diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 5e236d7..cb684b2 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -10,6 +10,7 @@ #include "nodeitem.h" #include "edgeitem.h" #include "tikzdocument.h" +#include "toolpalette.h" #include #include @@ -23,7 +24,7 @@ class TikzScene : public QGraphicsScene { Q_OBJECT public: - TikzScene(TikzDocument *tikzDocument, QObject *parent); + TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *parent); ~TikzScene(); Graph *graph(); QMap &nodeItems(); @@ -42,8 +43,10 @@ protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; private: TikzDocument *_tikzDocument; + ToolPalette *_tools; QMap _nodeItems; QMap _edgeItems; QGraphicsLineItem *_drawEdgeItem; diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index fe6c401..b8ae1c0 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -2,6 +2,7 @@ #include "tikzit.h" #include +#include TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) { diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 3c08bce..430df3f 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -13,14 +13,14 @@ ToolPalette::ToolPalette(QWidget *parent) : | Qt::WindowDoesNotAcceptFocus); setOrientation(Qt::Vertical); setFocusPolicy(Qt::NoFocus); - setGeometry(100,200,30,195); + //setGeometry(100,200,30,195); tools = new QActionGroup(this); - select = new QAction(QIcon(":/images/select-rectangular.png"), "Select"); - vertex = new QAction(QIcon(":/images/draw-ellipse.png"), "Add Vertex"); - edge = new QAction(QIcon(":/images/draw-path.png"), "Add Edge"); - crop = new QAction(QIcon(":/images/transform-crop-and-resize.png"), "Bounding Box"); + select = new QAction(QIcon(":/images/Inkscape_icons_edit_select_all.svg"), "Select"); + vertex = new QAction(QIcon(":/images/Inkscape_icons_draw_ellipse.svg"), "Add Vertex"); + edge = new QAction(QIcon(":/images/Inkscape_icons_draw_path.svg"), "Add Edge"); + crop = new QAction(QIcon(":/images/Inkscape_icons_draw_rectangle.svg"), "Bounding Box"); tools->addAction(select); tools->addAction(vertex); diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 0fb235d..9c6a9c3 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -183,4 +183,26 @@ void AddEdgeCommand::redo() EdgeItem *ei = new EdgeItem(_edge); _scene->edgeItems().insert(_edge, ei); _scene->addItem(ei); + + // edges should always be stacked below nodes + if (!_scene->graph()->nodes().isEmpty()) { + ei->stackBefore(_scene->nodeItems()[_scene->graph()->nodes().first()]); + } +} + +ChangeEdgeModeCommand::ChangeEdgeModeCommand(TikzScene *scene, Edge *edge) : + _scene(scene), _edge(edge) +{ +} + +void ChangeEdgeModeCommand::undo() +{ + _edge->setBasicBendMode(!_edge->basicBendMode()); + _scene->edgeItems()[_edge]->readPos(); +} + +void ChangeEdgeModeCommand::redo() +{ + _edge->setBasicBendMode(!_edge->basicBendMode()); + _scene->edgeItems()[_edge]->readPos(); } diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 9032274..eea39ae 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -90,4 +90,15 @@ private: Edge *_edge; }; +class ChangeEdgeModeCommand : public QUndoCommand +{ +public: + explicit ChangeEdgeModeCommand(TikzScene *scene, Edge *edge); + void undo() override; + void redo() override; +private: + TikzScene *_scene; + Edge *_edge; +}; + #endif // UNDOCOMMANDS_H diff --git a/src/main.cpp b/src/main.cpp index 6b14549..96069ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,8 +10,13 @@ #include + + int main(int argc, char *argv[]) { + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + //QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index a488b8a..746268c 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -22,8 +22,8 @@ Tikzit::Tikzit() loadStyles(); - _toolPalette->show(); - _propertyPalette->show(); + //_toolPalette->show(); + //_propertyPalette->show(); _stylePalette->show(); _windows << new MainWindow(); @@ -73,8 +73,11 @@ void Tikzit::removeWindow(MainWindow *w) { _windows.removeAll(w); if (_activeWindow == w) { - if (_windows.isEmpty()) _activeWindow = 0; - else _activeWindow = _windows[0]; + if (_windows.isEmpty()) { + _activeWindow = 0; + // TODO: check if we should quit when last window closed + quit(); + } else _activeWindow = _windows[0]; } } @@ -105,3 +108,9 @@ void Tikzit::open() } } } + +void Tikzit::quit() +{ + _stylePalette->close(); + QApplication::quit(); +} diff --git a/src/tikzit.h b/src/tikzit.h index a241a78..07878aa 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -76,6 +76,7 @@ public: void newDoc(); void open(); + void quit(); private: // void createMenu(); diff --git a/stylepalette.cpp b/stylepalette.cpp index 2781a90..312f675 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -2,12 +2,19 @@ #include "ui_stylepalette.h" #include +#include StylePalette::StylePalette(QWidget *parent) : QDockWidget(parent), ui(new Ui::StylePalette) { ui->setupUi(this); + + QSettings settings("tikzit", "tikzit"); + QVariant geom = settings.value("style-palette-geometry"); + if (geom != QVariant()) { + restoreGeometry(geom.toByteArray()); + } } StylePalette::~StylePalette() @@ -19,3 +26,10 @@ void StylePalette::on_buttonOpenProject_clicked() { qDebug() << "got click"; } + +void StylePalette::closeEvent(QCloseEvent *event) +{ + QSettings settings("tikzit", "tikzit"); + settings.setValue("style-palette-geometry", saveGeometry()); + QDockWidget::closeEvent(event); +} diff --git a/stylepalette.h b/stylepalette.h index 99afe51..b5c16f1 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -20,6 +20,9 @@ public slots: private: Ui::StylePalette *ui; + +protected: + void closeEvent(QCloseEvent *event) override; }; #endif // STYLEPALETTE_H diff --git a/stylepalette.ui b/stylepalette.ui index 941212b..8068ea4 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -16,6 +16,9 @@ 350 + + true + Styles @@ -70,7 +73,7 @@ - :/images/document-new.png:/images/document-new.png + :/images/document-new.svg:/images/document-new.svg @@ -90,7 +93,7 @@ - :/images/document-open.png:/images/document-open.png + :/images/document-open.svg:/images/document-open.svg diff --git a/tikzit.qrc b/tikzit.qrc index 484b399..65cfcd9 100644 --- a/tikzit.qrc +++ b/tikzit.qrc @@ -6,5 +6,20 @@ images/transform-crop-and-resize.png images/document-new.png images/document-open.png + images/document-new.svg + images/document-open.svg + images/Inkscape_icons_draw_calligraphic.svg + images/Inkscape_icons_draw_ellipse.svg + images/Inkscape_icons_draw_path.svg + images/Inkscape_icons_draw_rectangle.svg + images/Inkscape_icons_node_segment_curve.svg + images/Inkscape_icons_edit_select_all.svg + images/crop.svg + images/edge.svg + images/node.svg + images/select.svg + + + qt.conf -- cgit v1.2.3 From 39c2c74c664a6c770639ead8f45322352cacb997 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 12 Mar 2018 21:44:49 +0100 Subject: style loading works --- images/crop.svg | 48 +--------- images/refresh.svg | 1 + src/data/graphelementdata.cpp | 2 +- src/data/node.cpp | 2 +- src/data/nodestyle.cpp | 119 +++++++++++++++++++++---- src/data/nodestyle.h | 32 +++++-- src/data/project.cpp | 13 --- src/data/project.h | 21 ----- src/data/tikzassembler.cpp | 14 +-- src/data/tikzassembler.h | 10 +-- src/data/tikzlexer.l | 2 + src/data/tikzparser.y | 7 +- src/data/tikzstyles.cpp | 36 ++++++++ src/data/tikzstyles.h | 29 +++++++ src/gui/nodeitem.cpp | 6 +- src/gui/toolpalette.cpp | 2 +- src/main.cpp | 1 + src/tikzit.cpp | 91 ++++++++++++++----- src/tikzit.h | 14 ++- stylepalette.cpp | 33 ++++++- stylepalette.h | 5 +- stylepalette.ui | 197 ++++++++++++++++++++++++++---------------- tikzit.pro | 8 +- tikzit.qrc | 1 + 24 files changed, 457 insertions(+), 237 deletions(-) create mode 100644 images/refresh.svg delete mode 100644 src/data/project.cpp delete mode 100644 src/data/project.h create mode 100644 src/data/tikzstyles.cpp create mode 100644 src/data/tikzstyles.h (limited to 'src') diff --git a/images/crop.svg b/images/crop.svg index 226faa8..d10e9ba 100644 --- a/images/crop.svg +++ b/images/crop.svg @@ -1,47 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/images/refresh.svg b/images/refresh.svg new file mode 100644 index 0000000..29dff8a --- /dev/null +++ b/images/refresh.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 41fcbf0..43f7516 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -66,7 +66,7 @@ QString GraphElementData::property(QString key) if (i != -1) { return _properties[i].value(); } else { - return 0; + return QString(); // null QString } } diff --git a/src/data/node.cpp b/src/data/node.cpp index f94a3df..c78f49c 100644 --- a/src/data/node.cpp +++ b/src/data/node.cpp @@ -70,7 +70,7 @@ void Node::setStyleName(const QString &styleName) void Node::attachStyle() { if (_styleName == "none") _style = noneStyle; - else _style = tikzit->nodeStyle(_styleName); + else _style = tikzit->styles()->nodeStyle(_styleName); } NodeStyle *Node::style() const diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 7eca791..e38d3a3 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -1,32 +1,113 @@ #include "nodestyle.h" +#include NodeStyle *noneStyle = new NodeStyle(); -NodeStyle::NodeStyle() +NodeStyle::NodeStyle() : _name("none"), _data(0) { - name = "none"; - shape = NodeShape::Circle; - fillColor = Qt::white; - strokeColor = Qt::black; - strokeThickness = 1; } -NodeStyle::NodeStyle(QString nm, NodeShape sh, QColor fillCol) + +NodeStyle::NodeStyle(QString name, GraphElementData *data): _name(name), _data(data) +{ +} + +bool NodeStyle::isNone() { return _data == 0; } + +GraphElementData *NodeStyle::data() const +{ + return _data; +} + +QString NodeStyle::name() const +{ + return _name; +} + +NodeShape NodeStyle::shape() const { - name = nm; - shape = sh; - fillColor = fillCol; - strokeColor = Qt::black; - strokeThickness = 1; + QString sh = _data->property("shape"); + if (sh.isNull()) return NodeShape::Circle; + else if (sh == "circle") return NodeShape::Circle; + else if (sh == "rectangle") return NodeShape::Rectangle; + else return NodeShape::Circle; } -NodeStyle::NodeStyle(QString nm, NodeShape sh, QColor fillCol, QColor strokeCol, int strokeThick) +QColor NodeStyle::fillColor() const { - name = nm; - shape = sh; - fillColor = fillCol; - strokeColor = strokeCol; - strokeThickness = strokeThick; + QString col = _data->property("fill"); + + if (col.isNull()) { + return QColor(Qt::white); + } else { + QColor namedColor(col); + if (namedColor.isValid()) { + return namedColor; + } else { + // TODO: read RGB colors + return QColor(Qt::white); + } + } +} + +QColor NodeStyle::strokeColor() const +{ + QString col = _data->property("draw"); + + if (col.isNull()) { + return QColor(Qt::black); + } else { + QColor namedColor(col); + if (namedColor.isValid()) { + return namedColor; + } else { + // TODO: read RGB colors + return QColor(Qt::white); + } + } +} + +int NodeStyle::strokeThickness() const +{ + return 1; +} + +QPen NodeStyle::pen() const +{ + QPen p(strokeColor()); + p.setWidthF((float)strokeThickness() * 3.0f); + return p; +} + +QBrush NodeStyle::brush() const +{ + return QBrush(fillColor()); +} + +QPainterPath NodeStyle::path() const +{ + QPainterPath pth; + pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f); + return pth; +} + +QPainterPath NodeStyle::palettePath() const +{ + return path(); +} + +QIcon NodeStyle::icon() const +{ + // draw an icon matching the style + QPixmap px(100,100); + px.fill(Qt::transparent); + QPainter painter(&px); + QPainterPath pth = path(); + painter.setPen(pen()); + painter.setBrush(brush()); + + pth.translate(50.0f, 50.0f); + painter.drawPath(pth); + return QIcon(px); } -bool NodeStyle::isNone() { return name == "none"; } diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index 00d1b20..58c0c12 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -1,24 +1,40 @@ #ifndef NODESTYLE_H #define NODESTYLE_H +#include "graphelementdata.h" + #include +#include +#include +#include +#include enum NodeShape { - Square, UpTriangle, DownTriangle, Circle + Rectangle, UpTriangle, DownTriangle, Circle }; class NodeStyle { public: NodeStyle(); - NodeStyle(QString nm, NodeShape sh, QColor fillCol); - NodeStyle(QString nm, NodeShape sh, QColor fillCol, QColor strokeCol, int strokeThick); + NodeStyle(QString name, GraphElementData *data); bool isNone(); - QString name; - NodeShape shape; - QColor fillColor; - QColor strokeColor; - int strokeThickness; + + GraphElementData *data() const; + QString name() const; + NodeShape shape() const; + QColor fillColor() const; + QColor strokeColor() const; + int strokeThickness() const; + + QPen pen() const; + QBrush brush() const; + QPainterPath path() const; + QPainterPath palettePath() const; + QIcon icon() const; +private: + QString _name; + GraphElementData *_data; }; extern NodeStyle *noneStyle; diff --git a/src/data/project.cpp b/src/data/project.cpp deleted file mode 100644 index b129dc0..0000000 --- a/src/data/project.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "project.h" - -#include "QDebug" - -Project::Project(QObject *parent) : QObject(parent) -{ - -} - -void Project::addStyle(QString name, GraphElementData *properties) -{ - qDebug() << "got style {" << name << "} = [" << properties << "]"; -} diff --git a/src/data/project.h b/src/data/project.h deleted file mode 100644 index cbc2cb9..0000000 --- a/src/data/project.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef PROJECT_H -#define PROJECT_H - -#include "graphelementdata.h" - -#include -#include - -class Project : public QObject -{ - Q_OBJECT -public: - explicit Project(QObject *parent = 0); - void addStyle(QString name, GraphElementData *properties); - -signals: - -public slots: -}; - -#endif // PROJECT_H diff --git a/src/data/tikzassembler.cpp b/src/data/tikzassembler.cpp index 456464a..e0197da 100644 --- a/src/data/tikzassembler.cpp +++ b/src/data/tikzassembler.cpp @@ -7,14 +7,14 @@ int yyparse(void *scanner); TikzAssembler::TikzAssembler(Graph *graph, QObject *parent) : - QObject(parent), _graph(graph), _project(0) + QObject(parent), _graph(graph), _tikzStyles(0) { yylex_init(&scanner); yyset_extra(this, scanner); } -TikzAssembler::TikzAssembler(Project *project, QObject *parent) : - QObject(parent), _graph(0), _project(project) +TikzAssembler::TikzAssembler(TikzStyles *tikzStyles, QObject *parent) : + QObject(parent), _graph(0), _tikzStyles(tikzStyles) { yylex_init(&scanner); yyset_extra(this, scanner); @@ -37,9 +37,9 @@ Graph *TikzAssembler::graph() const return _graph; } -Project *TikzAssembler::project() const +TikzStyles *TikzAssembler::tikzStyles() const { - return _project; + return _tikzStyles; } bool TikzAssembler::isGraph() const @@ -47,8 +47,8 @@ bool TikzAssembler::isGraph() const return _graph != 0; } -bool TikzAssembler::isProject() const +bool TikzAssembler::isTikzStyles() const { - return _project != 0; + return _tikzStyles != 0; } diff --git a/src/data/tikzassembler.h b/src/data/tikzassembler.h index 8dbbc9b..38d67a7 100644 --- a/src/data/tikzassembler.h +++ b/src/data/tikzassembler.h @@ -7,7 +7,7 @@ #include "node.h" #include "graph.h" -#include "project.h" +#include "tikzstyles.h" #include #include @@ -17,15 +17,15 @@ class TikzAssembler : public QObject Q_OBJECT public: explicit TikzAssembler(Graph *graph, QObject *parent = 0); - explicit TikzAssembler(Project *project, QObject *parent = 0); + explicit TikzAssembler(TikzStyles *tikzStyles, QObject *parent = 0); void addNodeToMap(Node *n); Node *nodeWithName(QString name); bool parse(const QString &tikz); Graph *graph() const; - Project *project() const; + TikzStyles *tikzStyles() const; bool isGraph() const; - bool isProject() const; + bool isTikzStyles() const; signals: @@ -35,7 +35,7 @@ public slots: private: QHash _nodeMap; Graph *_graph; - Project *_project; + TikzStyles *_tikzStyles; void *scanner; }; diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index faf0d43..0a7ff39 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -68,6 +68,7 @@ FLOAT \-?[0-9]*(\.[0-9]+)? \\begin\{tikzpicture\} { return BEGIN_TIKZPICTURE_CMD; } \\end\{tikzpicture\} { return END_TIKZPICTURE_CMD; } +\\tikzstyle { return TIKZSTYLE_CMD; } \\begin\{pgfonlayer\} { return BEGIN_PGFONLAYER_CMD; } \\end\{pgfonlayer\} { return END_PGFONLAYER_CMD; } \\draw { return DRAW_CMD; } @@ -78,6 +79,7 @@ node { return NODE; } at { return AT; } to { return TO; } ; { return SEMICOLON; } += { return EQUALS; } \([ ]*{FLOAT}[ ]*,[ ]*{FLOAT}[ ]*\) { yylloc->last_column = yylloc->first_column + 1; diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index a4db3dd..76674f1 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -7,7 +7,7 @@ /* * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger + * Copyright 2010-2017 Aleks Kissinger * Copyright 2013 K. Johan Paulsson * Copyright 2013 Alex Merry * @@ -85,6 +85,7 @@ void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { %token BEGIN_TIKZPICTURE_CMD "\\begin{tikzpicture}" %token END_TIKZPICTURE_CMD "\\end{tikzpicture}" +%token TIKZSTYLE_CMD "\\tikzstyle" %token BEGIN_PGFONLAYER_CMD "\\begin{pgfonlayer}" %token END_PGFONLAYER_CMD "\\end{pgfonlayer}" %token DRAW_CMD "\\draw" @@ -133,8 +134,8 @@ tikz: tikzstyles | tikzpicture; tikzstyles: tikzstyles tikzstyle | ; tikzstyle: "\\tikzstyle" DELIMITEDSTRING "=" "[" properties "]" { - if (assembler->isProject()) { - assembler->project()->addStyle(QString($2), $5); + if (assembler->isTikzStyles()) { + assembler->tikzStyles()->addStyle(QString($2), $5); } } diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp new file mode 100644 index 0000000..186e19b --- /dev/null +++ b/src/data/tikzstyles.cpp @@ -0,0 +1,36 @@ +#include "tikzstyles.h" +#include "nodestyle.h" + +#include + +TikzStyles::TikzStyles(QObject *parent) : QObject(parent) +{ + +} + +NodeStyle *TikzStyles::nodeStyle(QString name) const +{ + foreach (NodeStyle *s , _nodeStyles) + if (s->name() == name) return s; + return noneStyle; //NodeStyle(name, NodeShape::Circle, Qt::white); +} + +QVector TikzStyles::nodeStyles() const +{ + return _nodeStyles; +} + +void TikzStyles::clear() +{ + _nodeStyles.clear(); +} + +void TikzStyles::addStyle(QString name, GraphElementData *data) +{ + //qDebug() << "got style {" << name << "} = [" << data << "]"; + if (!data->property("fill").isNull()) { // node style + _nodeStyles << new NodeStyle(name, data); + } else { // edge style + // TODO: edge styles + } +} diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h new file mode 100644 index 0000000..eaf7e64 --- /dev/null +++ b/src/data/tikzstyles.h @@ -0,0 +1,29 @@ +#ifndef PROJECT_H +#define PROJECT_H + +#include "graphelementdata.h" +#include "nodestyle.h" + +#include +#include + +class TikzStyles : public QObject +{ + Q_OBJECT +public: + explicit TikzStyles(QObject *parent = 0); + void addStyle(QString name, GraphElementData *data); + + NodeStyle *nodeStyle(QString name) const; + QVector nodeStyles() const; + void clear(); + +signals: + +public slots: + +private: + QVector _nodeStyles; +}; + +#endif // PROJECT_H diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 71226f3..21cdf79 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -57,10 +57,10 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->setBrush(Qt::NoBrush); painter->drawPath(shape()); } else { - QPen pen(_node->style()->strokeColor); - pen.setWidth(_node->style()->strokeThickness); + QPen pen(_node->style()->strokeColor()); + pen.setWidth(_node->style()->strokeThickness()); painter->setPen(pen); - painter->setBrush(QBrush(_node->style()->fillColor)); + painter->setBrush(QBrush(_node->style()->fillColor())); painter->drawPath(shape()); } diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 430df3f..0a832a6 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -20,7 +20,7 @@ ToolPalette::ToolPalette(QWidget *parent) : select = new QAction(QIcon(":/images/Inkscape_icons_edit_select_all.svg"), "Select"); vertex = new QAction(QIcon(":/images/Inkscape_icons_draw_ellipse.svg"), "Add Vertex"); edge = new QAction(QIcon(":/images/Inkscape_icons_draw_path.svg"), "Add Edge"); - crop = new QAction(QIcon(":/images/Inkscape_icons_draw_rectangle.svg"), "Bounding Box"); + crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); tools->addAction(select); tools->addAction(vertex); diff --git a/src/main.cpp b/src/main.cpp index 96069ef..49b064d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); + tikzit->init(); return a.exec(); } diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 746268c..6ef86dd 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -1,7 +1,12 @@ #include "tikzit.h" +#include "tikzassembler.h" +#include "tikzstyles.h" +#include #include #include +#include +#include // application-level instance of Tikzit Tikzit *tikzit; @@ -9,25 +14,27 @@ Tikzit *tikzit; // font to use for node labels QFont Tikzit::LABEL_FONT("Courrier", 9); -Tikzit::Tikzit() +Tikzit::Tikzit() : _styleFile("[default]"), _activeWindow(0) { - _mainMenu = new MainMenu(); +} - _activeWindow = 0; +void Tikzit::init() +{ + QSettings settings("tikzit", "tikzit"); + _mainMenu = new MainMenu(); QMainWindow *dummy = new QMainWindow(); _toolPalette = new ToolPalette(dummy); _propertyPalette = new PropertyPalette(dummy); _stylePalette = new StylePalette(dummy); + _styles = new TikzStyles(this); - loadStyles(); - - //_toolPalette->show(); - //_propertyPalette->show(); _stylePalette->show(); - _windows << new MainWindow(); _windows[0]->show(); + + QString styleFile = settings.value("previous-tikzstyles-file").toString(); + if (!styleFile.isEmpty()) loadStyles(styleFile); } //QMenuBar *Tikzit::mainMenu() const @@ -45,13 +52,6 @@ PropertyPalette *Tikzit::propertyPalette() const return _propertyPalette; } -void Tikzit::loadStyles() -{ - _nodeStyles << new NodeStyle("black dot", NodeShape::Circle, Qt::black, Qt::black, 1); - _nodeStyles << new NodeStyle("white dot", NodeShape::Circle, Qt::white, Qt::black, 1); - _nodeStyles << new NodeStyle("gray dot", NodeShape::Circle, Qt::gray, Qt::black, 1); -} - void Tikzit::newDoc() { MainWindow *w = new MainWindow(); @@ -81,13 +81,6 @@ void Tikzit::removeWindow(MainWindow *w) } } -NodeStyle *Tikzit::nodeStyle(QString name) -{ - foreach (NodeStyle *s , _nodeStyles) - if (s->name == name) return s; - return noneStyle; //NodeStyle(name, NodeShape::Circle, Qt::white); -} - void Tikzit::open() { QSettings settings("tikzit", "tikzit"); @@ -109,8 +102,62 @@ void Tikzit::open() } } +void Tikzit::openTikzStyles() { + QSettings settings("tikzit", "tikzit"); + QString fileName = QFileDialog::getOpenFileName(0, + tr("Open File"), + settings.value("previous-tikzstyles-path").toString(), + tr("TiKZ Style Files (*.tikzstyles)")); + + if (!fileName.isEmpty()) { + loadStyles(fileName); + } +} + +void Tikzit::loadStyles(QString fileName) +{ + QSettings settings("tikzit", "tikzit"); + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) { + QFileInfo fi(file); + settings.setValue("previous-tikzstyles-path", fi.absolutePath()); + settings.setValue("previous-tikzstyles-file", fileName); + _styleFile = fi.fileName(); + QTextStream in(&file); + QString styleTikz = in.readAll(); + file.close(); + + _styles->clear(); + TikzAssembler ass(_styles); + bool parseSuccess = ass.parse(styleTikz); + if (parseSuccess) { + qDebug() << "parse successful"; + } else { + qDebug() << "parse failed"; + } + _stylePalette->reloadStyles(); + + } else { + settings.setValue("previous-tikzstyles-file", ""); + QMessageBox::warning(0, "Style file not found.", "Could not open style file, reverting to default."); + } +} + +QString Tikzit::styleFile() const +{ + return _styleFile; +} + + +TikzStyles *Tikzit::styles() const +{ + return _styles; +} + void Tikzit::quit() { _stylePalette->close(); QApplication::quit(); } + + diff --git a/src/tikzit.h b/src/tikzit.h index 07878aa..802b3ab 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -38,6 +38,7 @@ #include "propertypalette.h" #include "stylepalette.h" #include "nodestyle.h" +#include "tikzstyles.h" #include #include @@ -68,7 +69,6 @@ public: MainWindow *activeWindow() const; void setActiveWindow(MainWindow *activeWindow); void removeWindow(MainWindow *w); - NodeStyle *nodeStyle(QString name); static QFont LABEL_FONT; // Ui::MainMenu *_mainMenuUi; @@ -77,10 +77,15 @@ public: void newDoc(); void open(); void quit(); + void init(); + + void openTikzStyles(); + TikzStyles *styles() const; + QString styleFile() const; private: -// void createMenu(); - void loadStyles(); + // void createMenu(); + void loadStyles(QString fileName); MainMenu *_mainMenu; ToolPalette *_toolPalette; @@ -88,7 +93,8 @@ private: StylePalette *_stylePalette; QVector _windows; MainWindow *_activeWindow; - QVector _nodeStyles; + TikzStyles *_styles; + QString _styleFile; }; diff --git a/stylepalette.cpp b/stylepalette.cpp index 312f675..8852eb7 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -1,8 +1,14 @@ #include "stylepalette.h" #include "ui_stylepalette.h" +#include "tikzit.h" #include +#include +#include #include +#include +#include +#include StylePalette::StylePalette(QWidget *parent) : QDockWidget(parent), @@ -15,6 +21,13 @@ StylePalette::StylePalette(QWidget *parent) : if (geom != QVariant()) { restoreGeometry(geom.toByteArray()); } + + _model = new QStandardItemModel(this); + ui->styleListView->setModel(_model); + ui->styleListView->setViewMode(QListView::IconMode); + ui->styleListView->setMovement(QListView::Static); + + ui->styleListView->setGridSize(QSize(75,60)); } StylePalette::~StylePalette() @@ -22,9 +35,25 @@ StylePalette::~StylePalette() delete ui; } -void StylePalette::on_buttonOpenProject_clicked() +void StylePalette::reloadStyles() +{ + _model->clear(); + QString f = tikzit->styleFile(); + // + ui->styleFile->setText(f); + + QStandardItem *it; + QSize sz(60,60); + + foreach(NodeStyle *ns, tikzit->styles()->nodeStyles()) { + it = new QStandardItem(ns->icon(), ns->name()); + _model->appendRow(it); + } +} + +void StylePalette::on_buttonOpenTikzstyles_clicked() { - qDebug() << "got click"; + tikzit->openTikzStyles(); } void StylePalette::closeEvent(QCloseEvent *event) diff --git a/stylepalette.h b/stylepalette.h index b5c16f1..99dde02 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -2,6 +2,7 @@ #define STYLEPALETTE_H #include +#include namespace Ui { class StylePalette; @@ -14,12 +15,14 @@ class StylePalette : public QDockWidget public: explicit StylePalette(QWidget *parent = 0); ~StylePalette(); + void reloadStyles(); public slots: - void on_buttonOpenProject_clicked(); + void on_buttonOpenTikzstyles_clicked(); private: Ui::StylePalette *ui; + QStandardItemModel *_model; protected: void closeEvent(QCloseEvent *event) override; diff --git a/stylepalette.ui b/stylepalette.ui index 8068ea4..a8c893f 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -7,13 +7,13 @@ 0 0 250 - 350 + 430 250 - 350 + 430 @@ -23,79 +23,126 @@ Styles - - - - 10 - 12 - 51 - 16 - - - - Project: - - - - - - 60 - 13 - 131 - 16 - - - - - Courier - 75 - true - - - - [default] - - - - - - 195 - 10 - 22 - 22 - - - - New Project - - - - - - - :/images/document-new.svg:/images/document-new.svg - - - - - - 220 - 10 - 22 - 22 - - - - New Project - - - - - - - :/images/document-open.svg:/images/document-open.svg - - + + + + + 2 + + + 0 + + + + + Styles: + + + + + + + + 0 + 0 + + + + + Courier + 75 + true + + + + [default] + + + + + + + New Project + + + + + + + :/images/document-open.svg:/images/document-open.svg + + + + + + + + + + + :/images/refresh.svg:/images/refresh.svg + + + + + + + + + + 8 + true + + + + + + + + 2 + + + + + + 25 + 25 + + + + + + + + + + + + + 25 + 25 + + + + - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + diff --git a/tikzit.pro b/tikzit.pro index d3a9c62..673730b 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -49,8 +49,8 @@ SOURCES += src/gui/mainwindow.cpp \ src/gui/mainmenu.cpp \ src/util.cpp \ stylepalette.cpp \ - src/data/project.cpp \ - src/data/tikzassembler.cpp + src/data/tikzassembler.cpp \ + src/data/tikzstyles.cpp HEADERS += src/gui/mainwindow.h \ src/gui/toolpalette.h \ @@ -73,8 +73,8 @@ HEADERS += src/gui/mainwindow.h \ src/gui/mainmenu.h \ src/util.h \ stylepalette.h \ - src/data/project.h \ - src/data/tikzassembler.h + src/data/tikzassembler.h \ + src/data/tikzstyles.h FORMS += src/gui/mainwindow.ui \ src/gui/propertypalette.ui \ diff --git a/tikzit.qrc b/tikzit.qrc index 65cfcd9..effe396 100644 --- a/tikzit.qrc +++ b/tikzit.qrc @@ -18,6 +18,7 @@ images/edge.svg images/node.svg images/select.svg + images/refresh.svg qt.conf -- cgit v1.2.3 From 3cea1514203a451c0a8806d276807863b463a78f Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 17 Mar 2018 19:01:02 -0400 Subject: added saving, style application, and copy and paste --- src/data/edge.cpp | 22 ++++++ src/data/edge.h | 1 + src/data/graph.cpp | 82 +++++++++++++++++++- src/data/graph.h | 25 ++++++ src/data/graphelementdata.cpp | 17 +++- src/data/graphelementdata.h | 6 +- src/data/node.cpp | 35 +++++++-- src/data/node.h | 7 +- src/data/nodestyle.cpp | 10 +-- src/data/nodestyle.h | 10 +-- src/data/tikzdocument.cpp | 45 +++++++++++ src/data/tikzdocument.h | 3 + src/gui/mainmenu.cpp | 21 +++-- src/gui/mainwindow.cpp | 23 +++++- src/gui/mainwindow.h | 8 +- src/gui/nodeitem.cpp | 4 +- src/gui/tikzscene.cpp | 176 ++++++++++++++++++++++++++++++++++-------- src/gui/tikzscene.h | 10 ++- src/gui/toolpalette.cpp | 18 +++++ src/gui/toolpalette.h | 1 + src/gui/undocommands.cpp | 147 +++++++++++++++++++++++++++++++---- src/gui/undocommands.h | 63 +++++++++++---- src/main.cpp | 3 +- src/tikzit.cpp | 25 +++++- src/tikzit.h | 7 +- stylepalette.cpp | 27 ++++++- stylepalette.h | 4 + stylepalette.ui | 19 +---- 28 files changed, 691 insertions(+), 128 deletions(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index e4d5d69..d3396e8 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -25,6 +25,28 @@ Edge::~Edge() delete _edgeNode; } +/*! + * @brief Edge::copy makes a deep copy of an edge. + * @param nodeTable is an optional pointer to a table mapping the old source/target + * node pointers to their new, copied versions. This is used when making a copy of + * an entire (sub)graph. + * @return a copy of the edge + */ +Edge *Edge::copy(QMap *nodeTable) +{ + Edge *e; + if (nodeTable == 0) e = new Edge(_source, _target); + else e = new Edge(nodeTable->value(_source), nodeTable->value(_target)); + e->setData(_data->copy()); + e->setBasicBendMode(_basicBendMode); + e->setBend(_bend); + e->setInAngle(_inAngle); + e->setOutAngle(_outAngle); + e->setWeight(_weight); + e->updateControls(); + return e; +} + Node *Edge::source() const { return _source; diff --git a/src/data/edge.h b/src/data/edge.h index 595b094..f010acd 100644 --- a/src/data/edge.h +++ b/src/data/edge.h @@ -13,6 +13,7 @@ class Edge : public QObject public: explicit Edge(Node *s, Node *t, QObject *parent = 0); ~Edge(); + Edge *copy(QMap *nodeTable = 0); Node *source() const; Node *target() const; diff --git a/src/data/graph.cpp b/src/data/graph.cpp index ba9a4c6..7a5fedc 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -54,6 +54,32 @@ void Graph::removeEdge(Edge *e) _edges.removeOne(e); } +int Graph::maxIntName() +{ + int max = -1; + int i; + bool ok; + foreach (Node *n, _nodes) { + i = n->name().toInt(&ok); + if (ok && i > max) max = i; + } + return max; +} + +QString Graph::freshNodeName() +{ + return QString::number(maxIntName() + 1); +} + +void Graph::renameApart(Graph *graph) +{ + int i = graph->maxIntName() + 1; + foreach (Node *n, _nodes) { + n->setName(QString::number(i)); + i++; + } +} + GraphElementData *Graph::data() const { return _data; @@ -92,21 +118,27 @@ QString Graph::tikz() { QString str; QTextStream code(&str); + int line = 0; code << "\\begin{tikzpicture}" << _data->tikz() << "\n"; + line++; if (hasBbox()) { code << "\t\\path [use as bounding box] (" << _bbox.topLeft().x() << "," << _bbox.topLeft().y() << ") rectangle (" << _bbox.bottomRight().x() << "," << _bbox.bottomRight().y() << ");\n"; + line++; } - if (!_nodes.isEmpty()) + if (!_nodes.isEmpty()) { code << "\t\\begin{pgfonlayer}{nodelayer}\n"; + line++; + } Node *n; foreach (n, _nodes) { + n->setTikzLine(line); code << "\t\t\\node "; if (!n->data()->isEmpty()) @@ -115,17 +147,23 @@ QString Graph::tikz() code << "(" << n->name() << ") at (" << n->point().x() << ", " << n->point().y() << ") {" << n->label() << "};\n"; + line++; } - if (!_nodes.isEmpty()) + if (!_nodes.isEmpty()) { code << "\t\\end{pgfonlayer}\n"; + line++; + } - if (!_edges.isEmpty()) + if (!_edges.isEmpty()) { code << "\t\\begin{pgfonlayer}{edgelayer}\n"; + line++; + } Edge *e; foreach (e, _edges) { + e->updateData(); code << "\t\t\\draw "; if (!e->data()->isEmpty()) @@ -153,17 +191,53 @@ QString Graph::tikz() } code << ";\n"; + line++; } - if (!_edges.isEmpty()) + if (!_edges.isEmpty()) { code << "\t\\end{pgfonlayer}\n"; + line++; + } code << "\\end{tikzpicture}\n"; + line++; code.flush(); return str; } +Graph *Graph::copyOfSubgraphWithNodes(QSet nds) +{ + Graph *g = new Graph(); + g->setData(_data->copy()); + QMap nodeTable; + foreach (Node *n, nds) { + Node *n1 = n->copy(); + nodeTable.insert(n, n1); + g->addNode(n1); + } + foreach (Edge *e, edges()) { + if (nds.contains(e->source()) || nds.contains(e->target())) { + g->addEdge(e->copy(&nodeTable)); + } + } + + return g; +} + +void Graph::insertGraph(Graph *graph) +{ + QMap nodeTable; + foreach (Node *n, graph->nodes()) { + Node *n1 = n->copy(); + nodeTable.insert(n, n1); + addNode(n1); + } + foreach (Edge *e, graph->edges()) { + addEdge(e->copy(&nodeTable)); + } +} + void Graph::setBbox(const QRectF &bbox) { _bbox = bbox; diff --git a/src/data/graph.h b/src/data/graph.h index c25d51b..4d575e4 100644 --- a/src/data/graph.h +++ b/src/data/graph.h @@ -27,6 +27,15 @@ public: void addEdge(Edge *e); void addEdge(Edge *e, int index); void removeEdge(Edge *e); + int maxIntName(); + QString freshNodeName(); + + /*! + * \brief renameApart assigns fresh names to all of the nodes in "this", + * with respect to the given graph + * \param graph + */ + void renameApart(Graph *graph); GraphElementData *data() const; void setData(GraphElementData *data); @@ -40,6 +49,22 @@ public: void clearBbox(); QString tikz(); + + /*! + * \brief copyOfSubgraphWithNodes produces a copy of the full subgraph + * with the given nodes. Used for cutting and copying to clipboard. + * \param nds + * \return + */ + Graph *copyOfSubgraphWithNodes(QSet nds); + + /*! + * \brief insertGraph inserts a copy of the given graph. Prior to calling this + * method, the node names in the given graph should be made fresh via + * "renameApart". + * \param graph + */ + void insertGraph(Graph *graph); signals: public slots: diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 43f7516..63c8cea 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -3,9 +3,14 @@ #include #include -GraphElementData::GraphElementData(QObject *parent) : QAbstractItemModel(parent) +GraphElementData::GraphElementData(QVector init, QObject *parent) : QAbstractItemModel(parent) { root = new GraphElementProperty(); + _properties = init; +} + +GraphElementData::GraphElementData(QObject *parent) : QAbstractItemModel(parent) { + root = new GraphElementProperty(); } GraphElementData::~GraphElementData() @@ -13,6 +18,11 @@ GraphElementData::~GraphElementData() delete root; } +GraphElementData *GraphElementData::copy() +{ + return new GraphElementData(_properties); +} + void GraphElementData::setProperty(QString key, QString value) { GraphElementProperty m(key, true); @@ -170,3 +180,8 @@ bool GraphElementData::isEmpty() { return _properties.isEmpty(); } + +QVector GraphElementData::properties() const +{ + return _properties; +} diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index 0d43bb8..319edf7 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -13,8 +13,11 @@ class GraphElementData : public QAbstractItemModel { Q_OBJECT public: + explicit GraphElementData(QVector init, + QObject *parent = 0); explicit GraphElementData(QObject *parent = 0); ~GraphElementData(); + GraphElementData *copy(); void setProperty(QString key, QString value); void unsetProperty(QString key); void setAtom(QString atom); @@ -22,7 +25,6 @@ public: QString property(QString key); bool atom(QString atom); - QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; @@ -55,6 +57,8 @@ public: QString tikz(); bool isEmpty(); + QVector properties() const; + signals: public slots: diff --git a/src/data/node.cpp b/src/data/node.cpp index c78f49c..085bdf5 100644 --- a/src/data/node.cpp +++ b/src/data/node.cpp @@ -3,11 +3,11 @@ #include -Node::Node(QObject *parent) : QObject(parent) +Node::Node(QObject *parent) : QObject(parent), _tikzLine(-1) { _data = new GraphElementData(); _style = noneStyle; - _styleName = "none"; + _data->setProperty("style", "none"); } Node::~Node() @@ -15,6 +15,17 @@ Node::~Node() delete _data; } +Node *Node::copy() { + Node *n1 = new Node(); + n1->setName(name()); + n1->setData(data()->copy()); + n1->setPoint(point()); + n1->setLabel(label()); + n1->attachStyle(); + n1->setTikzLine(tikzLine()); + return n1; +} + QPointF Node::point() const { return _point; @@ -54,26 +65,36 @@ void Node::setData(GraphElementData *data) { delete _data; _data = data; - if (_data->property("style") != 0) _styleName = _data->property("style"); } QString Node::styleName() const { - return _styleName; + return _data->property("style"); } void Node::setStyleName(const QString &styleName) { - _styleName = styleName; + _data->setProperty("style", styleName); } void Node::attachStyle() { - if (_styleName == "none") _style = noneStyle; - else _style = tikzit->styles()->nodeStyle(_styleName); + QString nm = styleName(); + if (nm == "none") _style = noneStyle; + else _style = tikzit->styles()->nodeStyle(nm); } NodeStyle *Node::style() const { return _style; } + +int Node::tikzLine() const +{ + return _tikzLine; +} + +void Node::setTikzLine(int tikzLine) +{ + _tikzLine = tikzLine; +} diff --git a/src/data/node.h b/src/data/node.h index ee70835..241d1ca 100644 --- a/src/data/node.h +++ b/src/data/node.h @@ -15,6 +15,8 @@ public: explicit Node(QObject *parent = 0); ~Node(); + Node *copy(); + QPointF point() const; void setPoint(const QPointF &point); @@ -33,6 +35,9 @@ public: void attachStyle(); NodeStyle *style() const; + int tikzLine() const; + void setTikzLine(int tikzLine); + signals: public slots: @@ -41,9 +46,9 @@ private: QPointF _point; QString _name; QString _label; - QString _styleName; NodeStyle *_style; GraphElementData *_data; + int _tikzLine; }; #endif // NODE_H diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index e38d3a3..302ab84 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -24,13 +24,13 @@ QString NodeStyle::name() const return _name; } -NodeShape NodeStyle::shape() const +NodeStyle::Shape NodeStyle::shape() const { QString sh = _data->property("shape"); - if (sh.isNull()) return NodeShape::Circle; - else if (sh == "circle") return NodeShape::Circle; - else if (sh == "rectangle") return NodeShape::Rectangle; - else return NodeShape::Circle; + if (sh.isNull()) return NodeStyle::Circle; + else if (sh == "circle") return NodeStyle::Circle; + else if (sh == "rectangle") return NodeStyle::Rectangle; + else return NodeStyle::Circle; } QColor NodeStyle::fillColor() const diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index 58c0c12..0b9f282 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -9,20 +9,20 @@ #include #include -enum NodeShape { - Rectangle, UpTriangle, DownTriangle, Circle -}; - class NodeStyle { public: + enum Shape { + Rectangle, UpTriangle, DownTriangle, Circle + }; + NodeStyle(); NodeStyle(QString name, GraphElementData *data); bool isNone(); GraphElementData *data() const; QString name() const; - NodeShape shape() const; + Shape shape() const; QColor fillColor() const; QColor strokeColor() const; int strokeThickness() const; diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index a3fa961..eeb4e14 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -3,9 +3,12 @@ #include #include #include +#include +#include "tikzit.h" #include "tikzdocument.h" #include "tikzassembler.h" +#include "mainwindow.h" TikzDocument::TikzDocument(QObject *parent) : QObject(parent) { @@ -71,6 +74,41 @@ void TikzDocument::open(QString fileName) } } +void TikzDocument::save() { + if (_fileName == "") { + saveAs(); + } else { + refreshTikz(); + QFile file(_fileName); + QFileInfo fi(file); + _shortName = fi.fileName(); + QSettings settings("tikzit", "tikzit"); + settings.setValue("previous-file-path", fi.absolutePath()); + + if (file.open(QIODevice::ReadWrite)) { + QTextStream stream(&file); + stream << _tikz; + file.close(); + tikzit->activeWindow()->updateFileName(); + } else { + QMessageBox::warning(0, "Save Failed", "Could not open file: '" + _fileName + "' for writing."); + } + } +} + +void TikzDocument::saveAs() { + QSettings settings("tikzit", "tikzit"); + QString fileName = QFileDialog::getSaveFileName(tikzit->activeWindow(), + tr("Save File As"), + settings.value("previous-file-path").toString(), + tr("TiKZ Files (*.tikz)")); + + if (!fileName.isEmpty()) { + _fileName = fileName; + save(); + } +} + QString TikzDocument::shortName() const { return _shortName; @@ -80,3 +118,10 @@ bool TikzDocument::parseSuccess() const { return _parseSuccess; } + +void TikzDocument::refreshTikz() +{ + _tikz = _graph->tikz(); + if (MainWindow *w = dynamic_cast(parent())) + w->refreshTikz(); +} diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h index d3a18b1..edb1beb 100644 --- a/src/data/tikzdocument.h +++ b/src/data/tikzdocument.h @@ -22,11 +22,14 @@ public: QString tikz() const; QUndoStack *undoStack() const; bool parseSuccess() const; + void refreshTikz(); void open(QString fileName); QString shortName() const; + void saveAs(); + void save(); private: Graph *_graph; QString _tikz; diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index 714ed34..dfb447f 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -19,17 +19,20 @@ void MainMenu::on_actionOpen_triggered() void MainMenu::on_actionClose_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->close(); } void MainMenu::on_actionSave_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzDocument()->save(); } void MainMenu::on_actionSave_As_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzDocument()->saveAs(); } void MainMenu::on_actionExit_triggered() @@ -53,22 +56,26 @@ void MainMenu::on_actionRedo_triggered() void MainMenu::on_actionCut_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->cutToClipboard(); } void MainMenu::on_actionCopy_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->copyToClipboard(); } void MainMenu::on_actionPaste_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->pasteFromClipboard(); } void MainMenu::on_actionDelete_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->deleteSelectedItems(); } void MainMenu::on_actionSelect_All_triggered() diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index eac7c44..26e19b6 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -25,12 +25,11 @@ MainWindow::MainWindow(QWidget *parent) : setAttribute(Qt::WA_DeleteOnClose, true); _tikzDocument = new TikzDocument(this); - _tools = new ToolPalette(this); - addToolBar(_tools); + _toolPalette = new ToolPalette(this); + addToolBar(_toolPalette); - _tikzScene = new TikzScene(_tikzDocument, _tools, this); + _tikzScene = new TikzScene(_tikzDocument, _toolPalette, this); ui->tikzView->setScene(_tikzScene); - _fileName = ""; _pristine = true; @@ -80,10 +79,26 @@ void MainWindow::changeEvent(QEvent *event) { if (event->type() == QEvent::ActivationChange && isActiveWindow()) { tikzit->setActiveWindow(this); + tikzit->stylePalette()->raise(); } QMainWindow::changeEvent(event); } +void MainWindow::updateFileName() +{ + setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); +} + +void MainWindow::refreshTikz() +{ + ui->tikzSource->setText(_tikzDocument->tikz()); +} + +ToolPalette *MainWindow::toolPalette() const +{ + return _toolPalette; +} + TikzDocument *MainWindow::tikzDocument() const { return _tikzDocument; diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index ba680b0..613bfcb 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -33,17 +33,19 @@ public: TikzView *tikzView() const; TikzScene *tikzScene() const; TikzDocument *tikzDocument() const; - + ToolPalette *toolPalette() const; + void updateFileName(); + void refreshTikz(); protected: void closeEvent(QCloseEvent *event); void changeEvent(QEvent *event); + private: TikzScene *_tikzScene; TikzDocument *_tikzDocument; MainMenu *_menu; - ToolPalette *_tools; + ToolPalette *_toolPalette; Ui::MainWindow *ui; - QString _fileName; bool _pristine; int _windowId; static int _numWindows; diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 21cdf79..36d488c 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -15,8 +15,8 @@ NodeItem::NodeItem(Node *node) { _node = node; setFlag(QGraphicsItem::ItemIsSelectable); - setFlag(QGraphicsItem::ItemIsMovable); - setFlag(QGraphicsItem::ItemSendsGeometryChanges); + //setFlag(QGraphicsItem::ItemIsMovable); + //setFlag(QGraphicsItem::ItemSendsGeometryChanges); readPos(); } diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index a3dd8ce..2ee3c50 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -2,10 +2,12 @@ #include "util.h" #include "tikzscene.h" #include "undocommands.h" +#include "tikzassembler.h" #include #include #include +#include TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *parent) : @@ -63,7 +65,9 @@ void TikzScene::graphReplaced() void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { // current mouse position, in scene coordinates - QPointF mousePos = event->scenePos(); + _mouseDownPos = event->scenePos(); + + _draggingNodes = false; // disable rubber band drag, which will clear the selection. Only re-enable it // for the SELECT tool, and when no control point has been clicked. @@ -80,8 +84,8 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) if (EdgeItem *ei = dynamic_cast(gi)) { qreal dx, dy; - dx = ei->cp1Item()->pos().x() - mousePos.x(); - dy = ei->cp1Item()->pos().y() - mousePos.y(); + dx = ei->cp1Item()->pos().x() - _mouseDownPos.x(); + dy = ei->cp1Item()->pos().y() - _mouseDownPos.y(); if (dx*dx + dy*dy <= cpR2) { _modifyEdgeItem = ei; @@ -89,8 +93,8 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) break; } - dx = ei->cp2Item()->pos().x() - mousePos.x(); - dy = ei->cp2Item()->pos().y() - mousePos.y(); + dx = ei->cp2Item()->pos().x() - _mouseDownPos.x(); + dy = ei->cp2Item()->pos().y() - _mouseDownPos.y(); if (dx*dx + dy*dy <= cpR2) { _modifyEdgeItem = ei; @@ -119,17 +123,21 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) _oldNodePositions.insert(ni->node(), ni->node()->point()); } } + + auto its = items(_mouseDownPos); + if (!its.isEmpty() && dynamic_cast(its[0])) + _draggingNodes = true; } break; case ToolPalette::VERTEX: break; case ToolPalette::EDGE: - foreach (QGraphicsItem *gi, items(mousePos)) { + foreach (QGraphicsItem *gi, items(_mouseDownPos)) { if (NodeItem *ni = dynamic_cast(gi)){ _edgeStartNodeItem = ni; _edgeEndNodeItem = ni; - QLineF line(toScreen(ni->node()->point()), mousePos); + QLineF line(toScreen(ni->node()->point()), _mouseDownPos); _drawEdgeItem->setLine(line); _drawEdgeItem->setVisible(true); break; @@ -145,8 +153,9 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { // current mouse position, in scene coordinates QPointF mousePos = event->scenePos(); - QRectF rb = views()[0]->rubberBandRect(); - invalidate(-800,-800,1600,1600); + //QRectF rb = views()[0]->rubberBandRect(); + //invalidate(-800,-800,1600,1600); + invalidate(QRectF(), QGraphicsScene::BackgroundLayer); switch (_tools->currentTool()) { case ToolPalette::SELECT: @@ -229,10 +238,25 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) _modifyEdgeItem->readPos(); + } else if (_draggingNodes) { // nodes being dragged + QGraphicsScene::mouseMoveEvent(event); + + // apply the same offset to all nodes, otherwise we get odd rounding behaviour with + // multiple selection. + QPointF shift = mousePos - _mouseDownPos; + int gridSize = GLOBAL_SCALE / 8; + shift = QPointF(round(shift.x()/gridSize)*gridSize, round(shift.y()/gridSize)*gridSize); + + foreach (Node *n, _oldNodePositions.keys()) { + NodeItem *ni = _nodeItems[n]; + ni->setPos(toScreen(_oldNodePositions[n]) + shift); + ni->writePos(); + } + + refreshAdjacentEdges(_oldNodePositions.keys()); } else { // otherwise, process mouse move normally QGraphicsScene::mouseMoveEvent(event); - refreshAdjacentEdges(_oldNodePositions.keys()); } break; @@ -308,7 +332,9 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) int gridSize = GLOBAL_SCALE / 8; QPointF gridPos(round(mousePos.x()/gridSize)*gridSize, round(mousePos.y()/gridSize)*gridSize); Node *n = new Node(_tikzDocument); + n->setName(graph()->freshNodeName()); n->setPoint(fromScreen(gridPos)); + n->setStyleName(tikzit->stylePalette()->activeNodeStyleName()); QRectF grow(gridPos.x() - GLOBAL_SCALEF, gridPos.y() - GLOBAL_SCALEF, 2 * GLOBAL_SCALEF, 2 * GLOBAL_SCALEF); QRectF newBounds = sceneRect().united(grow); @@ -332,34 +358,31 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) case ToolPalette::CROP: break; } + + // clear artefacts from rubber band selection + invalidate(QRect(), QGraphicsScene::BackgroundLayer); } void TikzScene::keyReleaseEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete) { - QSet selNodes; - QSet selEdges; - getSelection(selNodes, selEdges); - - QMap deleteNodes; - QMap deleteEdges; - - for (int i = 0; i < _tikzDocument->graph()->nodes().length(); ++i) { - Node *n = _tikzDocument->graph()->nodes()[i]; - if (selNodes.contains(n)) deleteNodes.insert(i, n); - } - - for (int i = 0; i < _tikzDocument->graph()->edges().length(); ++i) { - Edge *e = _tikzDocument->graph()->edges()[i]; - if (selEdges.contains(e) || - selNodes.contains(e->source()) || - selNodes.contains(e->target())) deleteEdges.insert(i, e); + deleteSelectedItems(); + } else if (event->modifiers() == Qt::NoModifier) { + switch(event->key()) { + case Qt::Key_S: + tikzit->activeWindow()->toolPalette()->setCurrentTool(ToolPalette::SELECT); + break; + case Qt::Key_V: + case Qt::Key_N: + tikzit->activeWindow()->toolPalette()->setCurrentTool(ToolPalette::VERTEX); + break; + case Qt::Key_E: + tikzit->activeWindow()->toolPalette()->setCurrentTool(ToolPalette::EDGE); + break; + case Qt::Key_B: + tikzit->activeWindow()->toolPalette()->setCurrentTool(ToolPalette::CROP); + break; } - - //qDebug() << "nodes:" << deleteNodes; - //qDebug() << "edges:" << deleteEdges; - DeleteCommand *cmd = new DeleteCommand(this, deleteNodes, deleteEdges, selEdges); - _tikzDocument->undoStack()->push(cmd); } } @@ -375,6 +398,78 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) } } +void TikzScene::applyActiveStyleToNodes() { + ApplyStyleToNodesCommand *cmd = new ApplyStyleToNodesCommand(this, tikzit->stylePalette()->activeNodeStyleName()); + _tikzDocument->undoStack()->push(cmd); +} + +void TikzScene::deleteSelectedItems() +{ + QSet selNodes; + QSet selEdges; + getSelection(selNodes, selEdges); + + QMap deleteNodes; + QMap deleteEdges; + + for (int i = 0; i < _tikzDocument->graph()->nodes().length(); ++i) { + Node *n = _tikzDocument->graph()->nodes()[i]; + if (selNodes.contains(n)) deleteNodes.insert(i, n); + } + + for (int i = 0; i < _tikzDocument->graph()->edges().length(); ++i) { + Edge *e = _tikzDocument->graph()->edges()[i]; + if (selEdges.contains(e) || + selNodes.contains(e->source()) || + selNodes.contains(e->target())) deleteEdges.insert(i, e); + } + + //qDebug() << "nodes:" << deleteNodes; + //qDebug() << "edges:" << deleteEdges; + DeleteCommand *cmd = new DeleteCommand(this, deleteNodes, deleteEdges, selEdges); + _tikzDocument->undoStack()->push(cmd); +} + +void TikzScene::copyToClipboard() +{ + Graph *g = graph()->copyOfSubgraphWithNodes(getSelectedNodes()); + QGuiApplication::clipboard()->setText(g->tikz()); + delete g; +} + +void TikzScene::cutToClipboard() +{ + copyToClipboard(); + deleteSelectedItems(); +} + + +void TikzScene::pasteFromClipboard() +{ + QString tikz = QGuiApplication::clipboard()->text(); + Graph *g = new Graph(); + TikzAssembler ass(g); + + // attempt to parse whatever's on the clipboard, if we get a + // non-empty tikz graph, insert it. + if (ass.parse(tikz) && !g->nodes().isEmpty()) { + // make sure names in the new subgraph are fresh + g->renameApart(graph()); + + // shift g to the right until there is some free space + QPointF p0 = toScreen(g->nodes()[0]->point()); + QPointF p = p0; + while (!items(p).isEmpty()) p.setX(p.x()+GLOBAL_SCALEF); + QPointF shift(roundf((p.x() - p0.x())/GLOBAL_SCALEF), 0.0f); + foreach (Node *n, g->nodes()) { + n->setPoint(n->point() + shift); + } + + PasteCommand *cmd = new PasteCommand(this, g); + _tikzDocument->undoStack()->push(cmd); + } +} + void TikzScene::getSelection(QSet &selNodes, QSet &selEdges) { foreach (QGraphicsItem *gi, selectedItems()) { @@ -383,6 +478,15 @@ void TikzScene::getSelection(QSet &selNodes, QSet &selEdges) } } +QSet TikzScene::getSelectedNodes() +{ + QSet selNodes; + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) selNodes << ni->node(); + } + return selNodes; +} + TikzDocument *TikzScene::tikzDocument() const { @@ -395,6 +499,14 @@ void TikzScene::setTikzDocument(TikzDocument *tikzDocument) graphReplaced(); } +void TikzScene::reloadStyles() +{ + foreach (NodeItem *ni, _nodeItems) { + ni->node()->attachStyle(); + ni->readPos(); // trigger a repaint + } +} + void TikzScene::refreshAdjacentEdges(QList nodes) { if (nodes.empty()) return; diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index cb684b2..5d3eec2 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -34,7 +34,12 @@ public: TikzDocument *tikzDocument() const; void setTikzDocument(TikzDocument *tikzDocument); - + void reloadStyles(); + void applyActiveStyleToNodes(); + void deleteSelectedItems(); + void copyToClipboard(); + void cutToClipboard(); + void pasteFromClipboard(); public slots: void graphReplaced(); @@ -54,6 +59,8 @@ private: NodeItem *_edgeStartNodeItem; NodeItem *_edgeEndNodeItem; bool _firstControlPoint; + QPointF _mouseDownPos; + bool _draggingNodes; QMap _oldNodePositions; float _oldWeight; @@ -62,6 +69,7 @@ private: int _oldOutAngle; void getSelection(QSet &selNodes, QSet &selEdges); + QSet getSelectedNodes(); }; #endif // TIKZSCENE_H diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 0a832a6..0d0bd30 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -48,3 +48,21 @@ ToolPalette::Tool ToolPalette::currentTool() const else return SELECT; } +void ToolPalette::setCurrentTool(ToolPalette::Tool tool) +{ + switch(tool) { + case SELECT: + select->setChecked(true); + break; + case VERTEX: + vertex->setChecked(true); + break; + case EDGE: + edge->setChecked(true); + break; + case CROP: + crop->setChecked(true); + break; + } +} + diff --git a/src/gui/toolpalette.h b/src/gui/toolpalette.h index c28b5a1..1876043 100644 --- a/src/gui/toolpalette.h +++ b/src/gui/toolpalette.h @@ -23,6 +23,7 @@ public: }; Tool currentTool() const; + void setCurrentTool(Tool tool); private: QActionGroup *tools; QAction *select; diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 9c6a9c3..0ebfd21 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -4,12 +4,28 @@ #include +GraphUpdateCommand::GraphUpdateCommand(TikzScene *scene, QUndoCommand *parent) : QUndoCommand(parent), _scene(scene) +{ +} + +void GraphUpdateCommand::undo() +{ + _scene->tikzDocument()->refreshTikz(); + _scene->invalidate(); +} + +void GraphUpdateCommand::redo() +{ + _scene->tikzDocument()->refreshTikz(); + _scene->invalidate(); +} + + MoveCommand::MoveCommand(TikzScene *scene, QMap oldNodePositions, QMap newNodePositions, QUndoCommand *parent) : - QUndoCommand(parent), - _scene(scene), + GraphUpdateCommand(scene, parent), _oldNodePositions(oldNodePositions), _newNodePositions(newNodePositions) {} @@ -25,6 +41,7 @@ void MoveCommand::undo() } _scene->refreshAdjacentEdges(_oldNodePositions.keys()); + GraphUpdateCommand::undo(); } void MoveCommand::redo() @@ -37,12 +54,14 @@ void MoveCommand::redo() } _scene->refreshAdjacentEdges(_newNodePositions.keys()); + GraphUpdateCommand::redo(); } EdgeBendCommand::EdgeBendCommand(TikzScene *scene, Edge *edge, float oldWeight, int oldBend, - int oldInAngle, int oldOutAngle) : - _scene(scene), _edge(edge), + int oldInAngle, int oldOutAngle, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), + _edge(edge), _oldWeight(oldWeight), _oldBend(oldBend), _oldInAngle(oldInAngle), _oldOutAngle(oldOutAngle) { @@ -65,6 +84,7 @@ void EdgeBendCommand::undo() break; } } + GraphUpdateCommand::undo(); } void EdgeBendCommand::redo() @@ -80,20 +100,23 @@ void EdgeBendCommand::redo() break; } } + + GraphUpdateCommand::redo(); } DeleteCommand::DeleteCommand(TikzScene *scene, QMap deleteNodes, QMap deleteEdges, - QSet selEdges) : - _scene(scene), _deleteNodes(deleteNodes), - _deleteEdges(deleteEdges), _selEdges(selEdges) + QSet selEdges, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), + _deleteNodes(deleteNodes), _deleteEdges(deleteEdges), _selEdges(selEdges) {} void DeleteCommand::undo() { for (auto it = _deleteNodes.begin(); it != _deleteNodes.end(); ++it) { Node *n = it.value(); + n->attachStyle(); // in case styles have changed _scene->graph()->addNode(n, it.key()); NodeItem *ni = new NodeItem(n); _scene->nodeItems().insert(n, ni); @@ -110,6 +133,8 @@ void DeleteCommand::undo() if (_selEdges.contains(e)) ei->setSelected(true); } + + GraphUpdateCommand::undo(); } void DeleteCommand::redo() @@ -131,10 +156,12 @@ void DeleteCommand::redo() _scene->graph()->removeNode(n); } + + GraphUpdateCommand::redo(); } -AddNodeCommand::AddNodeCommand(TikzScene *scene, Node *node, QRectF newBounds) : - _scene(scene), _node(node), _oldBounds(_scene->sceneRect()), _newBounds(newBounds) +AddNodeCommand::AddNodeCommand(TikzScene *scene, Node *node, QRectF newBounds, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _node(node), _oldBounds(_scene->sceneRect()), _newBounds(newBounds) { } @@ -148,21 +175,24 @@ void AddNodeCommand::undo() _scene->graph()->removeNode(_node); _scene->setBounds(_oldBounds); + + GraphUpdateCommand::undo(); } void AddNodeCommand::redo() { - // TODO: get the current style + _node->attachStyle(); // in case styles have changed _scene->graph()->addNode(_node); NodeItem *ni = new NodeItem(_node); _scene->nodeItems().insert(_node, ni); _scene->addItem(ni); _scene->setBounds(_newBounds); + GraphUpdateCommand::redo(); } -AddEdgeCommand::AddEdgeCommand(TikzScene *scene, Edge *edge) : - _scene(scene), _edge(edge) +AddEdgeCommand::AddEdgeCommand(TikzScene *scene, Edge *edge, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _edge(edge) { } @@ -174,6 +204,7 @@ void AddEdgeCommand::undo() delete ei; _scene->graph()->removeEdge(_edge); + GraphUpdateCommand::undo(); } void AddEdgeCommand::redo() @@ -188,10 +219,12 @@ void AddEdgeCommand::redo() if (!_scene->graph()->nodes().isEmpty()) { ei->stackBefore(_scene->nodeItems()[_scene->graph()->nodes().first()]); } + + GraphUpdateCommand::redo(); } -ChangeEdgeModeCommand::ChangeEdgeModeCommand(TikzScene *scene, Edge *edge) : - _scene(scene), _edge(edge) +ChangeEdgeModeCommand::ChangeEdgeModeCommand(TikzScene *scene, Edge *edge, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _edge(edge) { } @@ -199,10 +232,96 @@ void ChangeEdgeModeCommand::undo() { _edge->setBasicBendMode(!_edge->basicBendMode()); _scene->edgeItems()[_edge]->readPos(); + GraphUpdateCommand::undo(); } void ChangeEdgeModeCommand::redo() { _edge->setBasicBendMode(!_edge->basicBendMode()); _scene->edgeItems()[_edge]->readPos(); + GraphUpdateCommand::redo(); +} + +ApplyStyleToNodesCommand::ApplyStyleToNodesCommand(TikzScene *scene, QString style, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _style(style), _oldStyles() +{ + foreach (QGraphicsItem *it, scene->selectedItems()) { + if (NodeItem *ni = dynamic_cast(it)) { + _oldStyles.insert(ni->node(), ni->node()->styleName()); + } + } +} + +void ApplyStyleToNodesCommand::undo() +{ + foreach (Node *n, _oldStyles.keys()) { + n->setStyleName(_oldStyles[n]); + n->attachStyle(); + } + + GraphUpdateCommand::undo(); +} + +void ApplyStyleToNodesCommand::redo() +{ + foreach (Node *n, _oldStyles.keys()) { + n->setStyleName(_style); + n->attachStyle(); + } + GraphUpdateCommand::redo(); +} + +PasteCommand::PasteCommand(TikzScene *scene, Graph *graph, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _graph(graph) +{ + _oldSelection = scene->selectedItems(); +} + +void PasteCommand::undo() +{ + _scene->clearSelection(); + + foreach (Edge *e, _graph->edges()) { + EdgeItem *ei = _scene->edgeItems()[e]; + _scene->edgeItems().remove(e); + _scene->removeItem(ei); + delete ei; + + _scene->graph()->removeEdge(e); + } + + foreach (Node *n, _graph->nodes()) { + NodeItem *ni = _scene->nodeItems()[n]; + _scene->nodeItems().remove(n); + _scene->removeItem(ni); + delete ni; + + _scene->graph()->removeNode(n); + } + + foreach (auto it, _oldSelection) it->setSelected(true); + + GraphUpdateCommand::undo(); +} + +void PasteCommand::redo() +{ + _scene->clearSelection(); + _scene->graph()->insertGraph(_graph); + + foreach (Node *n, _graph->nodes()) { + n->attachStyle(); // in case styles have changed + NodeItem *ni = new NodeItem(n); + _scene->nodeItems().insert(n, ni); + _scene->addItem(ni); + ni->setSelected(true); + } + + foreach (Edge *e, _graph->edges()) { + EdgeItem *ei = new EdgeItem(e); + _scene->edgeItems().insert(e, ei); + _scene->addItem(ei); + } + + GraphUpdateCommand::redo(); } diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index eea39ae..354e455 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -14,7 +14,17 @@ #include -class MoveCommand : public QUndoCommand +class GraphUpdateCommand : public QUndoCommand { +public: + explicit GraphUpdateCommand(TikzScene *scene, + QUndoCommand *parent = 0); + void undo() override; + void redo() override; +protected: + TikzScene *_scene; +}; + +class MoveCommand : public GraphUpdateCommand { public: explicit MoveCommand(TikzScene *scene, @@ -24,21 +34,20 @@ public: void undo() override; void redo() override; private: - TikzScene *_scene; QMap _oldNodePositions; QMap _newNodePositions; }; -class EdgeBendCommand : public QUndoCommand +class EdgeBendCommand : public GraphUpdateCommand { public: explicit EdgeBendCommand(TikzScene *scene, Edge *edge, float oldWeight, int oldBend, - int oldInAngle, int oldOutAngle); + int oldInAngle, int oldOutAngle, + QUndoCommand *parent = 0); void undo() override; void redo() override; private: - TikzScene *_scene; Edge *_edge; float _oldWeight; int _oldBend; @@ -50,55 +59,75 @@ private: int _newOutAngle; }; -class DeleteCommand : public QUndoCommand +class DeleteCommand : public GraphUpdateCommand { public: explicit DeleteCommand(TikzScene *scene, QMap deleteNodes, QMap deleteEdges, - QSet selEdges); + QSet selEdges, + QUndoCommand *parent = 0); void undo() override; void redo() override; private: - TikzScene *_scene; QMap _deleteNodes; QMap _deleteEdges; QSet _selEdges; }; -class AddNodeCommand : public QUndoCommand +class AddNodeCommand : public GraphUpdateCommand { public: - explicit AddNodeCommand(TikzScene *scene, Node *node, QRectF newBounds); + explicit AddNodeCommand(TikzScene *scene, Node *node, QRectF newBounds, + QUndoCommand *parent = 0); void undo() override; void redo() override; private: - TikzScene *_scene; Node *_node; QRectF _oldBounds; QRectF _newBounds; }; -class AddEdgeCommand : public QUndoCommand +class AddEdgeCommand : public GraphUpdateCommand { public: - explicit AddEdgeCommand(TikzScene *scene, Edge *edge); + explicit AddEdgeCommand(TikzScene *scene, Edge *edge, QUndoCommand *parent = 0); void undo() override; void redo() override; private: - TikzScene *_scene; Edge *_edge; }; -class ChangeEdgeModeCommand : public QUndoCommand +class ChangeEdgeModeCommand : public GraphUpdateCommand { public: - explicit ChangeEdgeModeCommand(TikzScene *scene, Edge *edge); + explicit ChangeEdgeModeCommand(TikzScene *scene, Edge *edge, QUndoCommand *parent = 0); void undo() override; void redo() override; private: - TikzScene *_scene; Edge *_edge; }; +class ApplyStyleToNodesCommand : public GraphUpdateCommand +{ +public: + explicit ApplyStyleToNodesCommand(TikzScene *scene, QString style, QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + QString _style; + QMap _oldStyles; +}; + +class PasteCommand : public GraphUpdateCommand +{ +public: + explicit PasteCommand(TikzScene *scene, Graph *graph, QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + Graph *_graph; + QList _oldSelection; +}; + #endif // UNDOCOMMANDS_H diff --git a/src/main.cpp b/src/main.cpp index 49b064d..4433f58 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,7 +11,6 @@ - int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); @@ -20,7 +19,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); - tikzit->init(); + tikzit->init(&a); return a.exec(); } diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 6ef86dd..53e83b6 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -18,7 +18,7 @@ Tikzit::Tikzit() : _styleFile("[default]"), _activeWindow(0) { } -void Tikzit::init() +void Tikzit::init(QApplication *app) { QSettings settings("tikzit", "tikzit"); _mainMenu = new MainMenu(); @@ -35,6 +35,8 @@ void Tikzit::init() QString styleFile = settings.value("previous-tikzstyles-file").toString(); if (!styleFile.isEmpty()) loadStyles(styleFile); + + connect(app, &QApplication::focusChanged, this, &focusChanged); } //QMenuBar *Tikzit::mainMenu() const @@ -137,9 +139,13 @@ void Tikzit::loadStyles(QString fileName) } _stylePalette->reloadStyles(); + foreach (MainWindow *w, _windows) { + w->tikzScene()->reloadStyles(); + } + } else { settings.setValue("previous-tikzstyles-file", ""); - QMessageBox::warning(0, "Style file not found.", "Could not open style file, reverting to default."); + QMessageBox::warning(0, "Style file not found.", "Could not open style file: '" + fileName + "', reverting to default."); } } @@ -148,6 +154,21 @@ QString Tikzit::styleFile() const return _styleFile; } +void Tikzit::focusChanged(QWidget *old, QWidget *nw) +{ +// foreach (MainWindow *w, _windows) { +// if (w->isActiveWindow()) { +// _stylePalette->raise(); +// break; +// } +// } +} + +StylePalette *Tikzit::stylePalette() const +{ + return _stylePalette; +} + TikzStyles *Tikzit::styles() const { diff --git a/src/tikzit.h b/src/tikzit.h index 802b3ab..51aea20 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -77,15 +77,18 @@ public: void newDoc(); void open(); void quit(); - void init(); + void init(QApplication *app); void openTikzStyles(); + void loadStyles(QString fileName); TikzStyles *styles() const; QString styleFile() const; + StylePalette *stylePalette() const; +public slots: + void focusChanged(QWidget *old, QWidget *nw); private: // void createMenu(); - void loadStyles(QString fileName); MainMenu *_mainMenu; ToolPalette *_toolPalette; diff --git a/stylepalette.cpp b/stylepalette.cpp index 8852eb7..c2ddc21 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -26,8 +26,7 @@ StylePalette::StylePalette(QWidget *parent) : ui->styleListView->setModel(_model); ui->styleListView->setViewMode(QListView::IconMode); ui->styleListView->setMovement(QListView::Static); - - ui->styleListView->setGridSize(QSize(75,60)); + ui->styleListView->setGridSize(QSize(70,60)); } StylePalette::~StylePalette() @@ -47,15 +46,39 @@ void StylePalette::reloadStyles() foreach(NodeStyle *ns, tikzit->styles()->nodeStyles()) { it = new QStandardItem(ns->icon(), ns->name()); + it->setData(ns->name()); _model->appendRow(it); } } +QString StylePalette::activeNodeStyleName() +{ + const QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); + + if (i.isEmpty()) { + return "none"; + } else { + return i[0].data().toString(); + } +} + void StylePalette::on_buttonOpenTikzstyles_clicked() { tikzit->openTikzStyles(); } +void StylePalette::on_buttonRefreshTikzstyles_clicked() +{ + QSettings settings("tikzit", "tikzit"); + QString path = settings.value("previous-tikzstyles-file").toString(); + if (!path.isEmpty()) tikzit->loadStyles(path); +} + +void StylePalette::on_buttonApplyNodeStyle_clicked() +{ + if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); +} + void StylePalette::closeEvent(QCloseEvent *event) { QSettings settings("tikzit", "tikzit"); diff --git a/stylepalette.h b/stylepalette.h index 99dde02..3861008 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -16,9 +16,13 @@ public: explicit StylePalette(QWidget *parent = 0); ~StylePalette(); void reloadStyles(); + QString activeNodeStyleName(); + public slots: void on_buttonOpenTikzstyles_clicked(); + void on_buttonRefreshTikzstyles_clicked(); + void on_buttonApplyNodeStyle_clicked(); private: Ui::StylePalette *ui; diff --git a/stylepalette.ui b/stylepalette.ui index a8c893f..dab1b32 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -74,7 +74,7 @@ - + @@ -102,7 +102,7 @@ 2 - + 25 @@ -110,20 +110,7 @@ - + - - - - - - - - 25 - 25 - - - - - + Apply -- cgit v1.2.3 From 8b8ea9395bdda4bb1404497ff654b82098084822 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 18 Mar 2018 11:58:33 -0400 Subject: finally got bboxes working...i think --- src/data/graph.cpp | 23 +++++++++++------- src/data/graph.h | 14 +++++++++-- src/gui/tikzscene.cpp | 62 ++++++++++++++++++++++++++++++++---------------- src/gui/tikzscene.h | 3 ++- src/gui/undocommands.cpp | 7 ++++-- src/tikzit.h | 16 +++++++++++-- 6 files changed, 90 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/data/graph.cpp b/src/data/graph.cpp index 7a5fedc..208cd00 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -66,6 +66,19 @@ int Graph::maxIntName() return max; } +QRectF Graph::realBbox() +{ + float maxX = 0.0f; + QRectF rect = bbox(); + foreach (Node *n, _nodes) { + rect = rect.united(QRectF(n->point().x()-0.5f, + n->point().y()-0.5f, + 1.0f, 1.0f)); + } + + return rect; +} + QString Graph::freshNodeName() { return QString::number(maxIntName() + 1); @@ -228,14 +241,8 @@ Graph *Graph::copyOfSubgraphWithNodes(QSet nds) void Graph::insertGraph(Graph *graph) { QMap nodeTable; - foreach (Node *n, graph->nodes()) { - Node *n1 = n->copy(); - nodeTable.insert(n, n1); - addNode(n1); - } - foreach (Edge *e, graph->edges()) { - addEdge(e->copy(&nodeTable)); - } + foreach (Node *n, graph->nodes()) addNode(n); + foreach (Edge *e, graph->edges()) addEdge(e); } void Graph::setBbox(const QRectF &bbox) diff --git a/src/data/graph.h b/src/data/graph.h index 4d575e4..d00d2b2 100644 --- a/src/data/graph.h +++ b/src/data/graph.h @@ -48,6 +48,15 @@ public: bool hasBbox(); void clearBbox(); + /*! + * \brief realBbox computes the union of the user-defined + * bounding box, and the bounding boxes of the graph's + * contents. + * + * \return + */ + QRectF realBbox(); + QString tikz(); /*! @@ -59,9 +68,10 @@ public: Graph *copyOfSubgraphWithNodes(QSet nds); /*! - * \brief insertGraph inserts a copy of the given graph. Prior to calling this + * \brief insertGraph inserts the given graph into "this". Prior to calling this * method, the node names in the given graph should be made fresh via - * "renameApart". + * "renameApart". Note that the parameter "graph" relinquishes ownership of its + * nodes and edges, so it should be not be allowed to exist longer than "this". * \param graph */ void insertGraph(Graph *graph); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 2ee3c50..59faa65 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -456,13 +456,15 @@ void TikzScene::pasteFromClipboard() // make sure names in the new subgraph are fresh g->renameApart(graph()); - // shift g to the right until there is some free space - QPointF p0 = toScreen(g->nodes()[0]->point()); - QPointF p = p0; - while (!items(p).isEmpty()) p.setX(p.x()+GLOBAL_SCALEF); - QPointF shift(roundf((p.x() - p0.x())/GLOBAL_SCALEF), 0.0f); - foreach (Node *n, g->nodes()) { - n->setPoint(n->point() + shift); + QRectF srcRect = g->realBbox(); + QRectF tgtRect = graph()->realBbox(); + QPointF shift(tgtRect.right() - srcRect.left(), 0.0f); + + // shift g to the right until it is in free space + if (shift.x() > 0) { + foreach (Node *n, g->nodes()) { + n->setPoint(n->point() + shift); + } } PasteCommand *cmd = new PasteCommand(this, g); @@ -507,6 +509,26 @@ void TikzScene::reloadStyles() } } +void TikzScene::refreshSceneBounds() +{ + if (!views().empty()) { + QGraphicsView *v = views().first(); + QRectF viewB = v->mapToScene(v->viewport()->rect()).boundingRect(); + //QPointF tl = v->mapToScene(viewB.topLeft()); + //viewB.setTopLeft(tl); + + QRectF bounds = viewB.united(rectToScreen(graph()->realBbox().adjusted(-1.0f, -1.0f, 1.0f, 1.0f))); + qDebug() << viewB; + + if (bounds != sceneRect()) { + QPointF c = viewB.center(); + setSceneRect(bounds); + v->centerOn(c); + } + } + //setBounds(graphB); +} + void TikzScene::refreshAdjacentEdges(QList nodes) { if (nodes.empty()) return; @@ -518,19 +540,19 @@ void TikzScene::refreshAdjacentEdges(QList nodes) } } -void TikzScene::setBounds(QRectF bounds) -{ - if (bounds != sceneRect()) { - if (!views().empty()) { - QGraphicsView *v = views().first(); - QPointF c = v->mapToScene(v->viewport()->rect().center()); - setSceneRect(bounds); - v->centerOn(c); - } else { - setSceneRect(bounds); - } - } -} +//void TikzScene::setBounds(QRectF bounds) +//{ +// if (bounds != sceneRect()) { +// if (!views().empty()) { +// QGraphicsView *v = views().first(); +// QPointF c = v->mapToScene(v->viewport()->rect().center()); +// setSceneRect(bounds); +// v->centerOn(c); +// } else { +// setSceneRect(bounds); +// } +// } +//} QMap &TikzScene::nodeItems() { diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 5d3eec2..b551abd 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -30,11 +30,12 @@ public: QMap &nodeItems(); QMap &edgeItems(); void refreshAdjacentEdges(QList nodes); - void setBounds(QRectF bounds); +// void setBounds(QRectF bounds); TikzDocument *tikzDocument() const; void setTikzDocument(TikzDocument *tikzDocument); void reloadStyles(); + void refreshSceneBounds(); void applyActiveStyleToNodes(); void deleteSelectedItems(); void copyToClipboard(); diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 0ebfd21..c9ca041 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -11,12 +11,14 @@ GraphUpdateCommand::GraphUpdateCommand(TikzScene *scene, QUndoCommand *parent) : void GraphUpdateCommand::undo() { _scene->tikzDocument()->refreshTikz(); + _scene->refreshSceneBounds(); _scene->invalidate(); } void GraphUpdateCommand::redo() { _scene->tikzDocument()->refreshTikz(); + _scene->refreshSceneBounds(); _scene->invalidate(); } @@ -174,7 +176,7 @@ void AddNodeCommand::undo() _scene->graph()->removeNode(_node); - _scene->setBounds(_oldBounds); + //_scene->setBounds(_oldBounds); GraphUpdateCommand::undo(); } @@ -187,7 +189,8 @@ void AddNodeCommand::redo() _scene->nodeItems().insert(_node, ni); _scene->addItem(ni); - _scene->setBounds(_newBounds); + //_scene->setBounds(_newBounds); + GraphUpdateCommand::redo(); } diff --git a/src/tikzit.h b/src/tikzit.h index 51aea20..5b23083 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -51,13 +51,25 @@ // divisible by 8 to avoid rounding errors with e.g. grid-snapping. #define GLOBAL_SCALE 80 #define GLOBAL_SCALEF 80.0f +#define GLOBAL_SCALEF_INV 0.0125f inline QPointF toScreen(QPointF src) { src.setY(-src.y()); src *= GLOBAL_SCALEF; return src; } inline QPointF fromScreen(QPointF src) -{ src.setY(-src.y()); src /= GLOBAL_SCALEF; return src; } - +{ src.setY(-src.y()); src *= GLOBAL_SCALEF_INV; return src; } + +inline QRectF rectToScreen(QRectF src) +{ return QRectF(src.x() * GLOBAL_SCALEF, + -(src.y()+src.height()) * GLOBAL_SCALEF, + src.width() * GLOBAL_SCALEF, + src.height() * GLOBAL_SCALEF); } + +inline QRectF rectFromScreen(QRectF src) +{ return QRectF(src.x() * GLOBAL_SCALEF_INV, + -(src.y()+src.height()) * GLOBAL_SCALEF_INV, + src.width() * GLOBAL_SCALEF_INV, + src.height() * GLOBAL_SCALEF_INV); } class Tikzit : public QObject { Q_OBJECT -- cgit v1.2.3 From 1a71fd8efa0350d1e121f6792e8fad67e82b25c1 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 5 Apr 2018 13:20:20 +0200 Subject: fixed name conflict, now builds in MSVC --- src/data/edge.cpp | 32 +++++++------- src/data/graph.cpp | 7 ++- src/data/tikzdocument.cpp | 2 +- src/data/tikzparser.y | 52 +++++++++++----------- src/data/tikzparserdefs.h | 4 ++ src/gui/mainmenu.cpp | 6 ++- src/gui/nodeitem.cpp | 2 +- src/gui/tikzscene.cpp | 107 +++++++++++++++++++++++++++++++++++----------- src/gui/tikzscene.h | 3 ++ src/gui/tikzview.cpp | 33 ++++++++------ src/gui/tikzview.h | 1 + src/gui/undocommands.cpp | 12 +++--- src/main.cpp | 1 - src/tikzit.cpp | 2 +- src/tikzit.h | 9 ++-- src/util.cpp | 6 +++ src/util.h | 6 +++ stylepalette.ui | 34 ++++++++++++++- 18 files changed, 223 insertions(+), 96 deletions(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index d3396e8..bcf127f 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -222,21 +222,23 @@ void Edge::updateData() // TODO: style handling? - if (_basicBendMode && _bend != 0) { - QString bendKey; - int b; - if (_bend < 0) { - bendKey = "bend left"; - b = -_bend; - } else { - bendKey = "bend right"; - b = _bend; - } - - if (b == 30) { - _data->setAtom(bendKey); - } else { - _data->setProperty(bendKey, QString::number(b)); + if (_basicBendMode) { + if (_bend != 0) { + QString bendKey; + int b; + if (_bend < 0) { + bendKey = "bend left"; + b = -_bend; + } else { + bendKey = "bend right"; + b = _bend; + } + + if (b == 30) { + _data->setAtom(bendKey); + } else { + _data->setProperty(bendKey, QString::number(b)); + } } } else { _data->setProperty("in", QString::number(_inAngle)); diff --git a/src/data/graph.cpp b/src/data/graph.cpp index 208cd00..33af93d 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -1,4 +1,5 @@ #include "graph.h" +#include "util.h" #include #include @@ -158,7 +159,9 @@ QString Graph::tikz() code << n->data()->tikz() << " "; code << "(" << n->name() << ") at (" - << n->point().x() << ", " << n->point().y() + << floatToString(n->point().x()) + << ", " + << floatToString(n->point().y()) << ") {" << n->label() << "};\n"; line++; } @@ -230,7 +233,7 @@ Graph *Graph::copyOfSubgraphWithNodes(QSet nds) g->addNode(n1); } foreach (Edge *e, edges()) { - if (nds.contains(e->source()) || nds.contains(e->target())) { + if (nds.contains(e->source()) && nds.contains(e->target())) { g->addEdge(e->copy(&nodeTable)); } } diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index eeb4e14..4a813ad 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -85,7 +85,7 @@ void TikzDocument::save() { QSettings settings("tikzit", "tikzit"); settings.setValue("previous-file-path", fi.absolutePath()); - if (file.open(QIODevice::ReadWrite)) { + if (file.open(QIODevice::WriteOnly)) { QTextStream stream(&file); stream << _tikz; file.close(); diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index 76674f1..6e708a3 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -25,6 +25,7 @@ * along with this program. If not, see . */ + #include "tikzparserdefs.h" %} @@ -62,7 +63,7 @@ #include "graphelementproperty.h" #include "tikzlexer.h" -#import "tikzassembler.h" +#include "tikzassembler.h" /* the assembler (used by this parser) is stored in the lexer state as "extra" data */ #define assembler yyget_extra(scanner) @@ -71,7 +72,7 @@ void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { // TODO: implement reportError() //assembler->reportError(str, yylloc); - qDebug() << "parse error: " << str; + qDebug() << "\nparse error: " << str << " line:" << yylloc->first_line; } %} @@ -104,7 +105,7 @@ void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { %token RIGHTBRACKET "]" %token FULLSTOP "." %token EQUALS "=" -%token COORD "co-ordinate" +%token TCOORD "coordinate" %token PROPSTRING "key/value string" %token REFSTRING "string" %token DELIMITEDSTRING "{-delimited string" @@ -187,7 +188,7 @@ property: val: PROPSTRING { $$ = $1; } | DELIMITEDSTRING { $$ = $1; }; nodename: "(" REFSTRING ")" { $$ = $2; }; -node: "\\node" optproperties nodename "at" COORD DELIMITEDSTRING ";" +node: "\\node" optproperties nodename "at" TCOORD DELIMITEDSTRING ";" { Node *node = new Node(); @@ -240,36 +241,39 @@ edge: "\\draw" optproperties noderef "to" optedgenode optnoderef ";" t = s; } - Edge *edge = new Edge(s, t); - if ($2) { - edge->setData($2); - edge->setAttributesFromData(); - } + // if the source or the target of the edge doesn't exist, quietly ignore it. + if (s != 0 && t != 0) { + Edge *edge = new Edge(s, t); + if ($2) { + edge->setData($2); + edge->setAttributesFromData(); + } - if ($5) - edge->setEdgeNode($5); - if ($3.anchor) { - edge->setSourceAnchor(QString($3.anchor)); - free($3.anchor); - } + if ($5) + edge->setEdgeNode($5); + if ($3.anchor) { + edge->setSourceAnchor(QString($3.anchor)); + free($3.anchor); + } - if ($6.node) { - if ($6.anchor) { - edge->setTargetAnchor(QString($6.anchor)); - free($6.anchor); + if ($6.node) { + if ($6.anchor) { + edge->setTargetAnchor(QString($6.anchor)); + free($6.anchor); + } + } else { + edge->setTargetAnchor(edge->sourceAnchor()); } - } else { - edge->setTargetAnchor(edge->sourceAnchor()); - } - assembler->graph()->addEdge(edge); + assembler->graph()->addEdge(edge); + } }; ignoreprop: val | val "=" val; ignoreprops: ignoreprop ignoreprops | ; optignoreprops: "[" ignoreprops "]"; boundingbox: - "\\path" optignoreprops COORD "rectangle" COORD ";" + "\\path" optignoreprops TCOORD "rectangle" TCOORD ";" { assembler->graph()->setBbox(QRectF(*$3, *$5)); delete $3; diff --git a/src/data/tikzparserdefs.h b/src/data/tikzparserdefs.h index b51a8c9..1625136 100644 --- a/src/data/tikzparserdefs.h +++ b/src/data/tikzparserdefs.h @@ -1,6 +1,8 @@ #ifndef TIKZPARSERDEFS_H #define TIKZPARSERDEFS_H +#define YY_NO_UNISTD_H 1 + #include "graphelementproperty.h" #include "graphelementdata.h" #include "node.h" @@ -15,4 +17,6 @@ struct noderef { char *anchor; }; +inline int isatty(void*) { return 0; } + #endif // TIKZPARSERDEFS_H diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index dfb447f..0166caf 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -80,12 +80,14 @@ void MainMenu::on_actionDelete_triggered() void MainMenu::on_actionSelect_All_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->selectAllNodes(); } void MainMenu::on_actionDeselect_All_triggered() { - // TODO + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->deselectAll(); } diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 36d488c..06b46ff 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -94,7 +94,7 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge QPainterPath NodeItem::shape() const { QPainterPath path; - path.addEllipse(QPointF(0,0), GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + path.addEllipse(QPointF(0,0), GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); return path; } diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 59faa65..24f4ad1 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -8,6 +8,7 @@ #include #include #include +#include TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *parent) : @@ -16,15 +17,28 @@ TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *pa _modifyEdgeItem = 0; _edgeStartNodeItem = 0; _drawEdgeItem = new QGraphicsLineItem(); - setSceneRect(-310,-230,620,450); + _rubberBandItem = new QGraphicsRectItem(); + //setSceneRect(-310,-230,620,450); + setSceneRect(-1000,-1000,2000,2000); QPen pen; pen.setColor(QColor::fromRgbF(0.5f, 0.0f, 0.5f)); pen.setWidth(3); + pen.setCosmetic(true); _drawEdgeItem->setPen(pen); _drawEdgeItem->setLine(0,0,0,0); _drawEdgeItem->setVisible(false); addItem(_drawEdgeItem); + + pen.setColor(QColor::fromRgbF(0.6f, 0.6f, 0.8f)); + pen.setWidth(3); + QVector dash; + dash << 4.0 << 4.0; + pen.setDashPattern(dash); + _rubberBandItem->setPen(pen); + + _rubberBandItem->setVisible(false); + addItem(_rubberBandItem); } TikzScene::~TikzScene() { @@ -71,7 +85,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) // disable rubber band drag, which will clear the selection. Only re-enable it // for the SELECT tool, and when no control point has been clicked. - views()[0]->setDragMode(QGraphicsView::NoDrag); + //views()[0]->setDragMode(QGraphicsView::NoDrag); // radius of a control point for bezier edges, in scene coordinates qreal cpR = GLOBAL_SCALEF * (0.05); @@ -113,9 +127,23 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) _oldWeight = e->weight(); } else { // since we are not dragging a control point, process the click normally - views()[0]->setDragMode(QGraphicsView::RubberBandDrag); + //views()[0]->setDragMode(QGraphicsView::RubberBandDrag); QGraphicsScene::mousePressEvent(event); + if (items(_mouseDownPos).isEmpty()) { + _rubberBandItem->setRect(QRectF(_mouseDownPos,_mouseDownPos)); + _rubberBandItem->setVisible(true); + qDebug() << "starting rubber band drag"; + } + +// foreach (QGraphicsItem *gi, items()) { +// if (EdgeItem *ei = dynamic_cast(gi)) { +// //qDebug() << "got an edge item: " << ei; +// ei->setFlag(QGraphicsItem::ItemIsSelectable, false); +// //ei->setSelected(true); +// } +// } + // save current node positions for undo support _oldNodePositions.clear(); foreach (QGraphicsItem *gi, selectedItems()) { @@ -155,7 +183,7 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QPointF mousePos = event->scenePos(); //QRectF rb = views()[0]->rubberBandRect(); //invalidate(-800,-800,1600,1600); - invalidate(QRectF(), QGraphicsScene::BackgroundLayer); + //invalidate(QRectF(), QGraphicsScene::BackgroundLayer); switch (_tools->currentTool()) { case ToolPalette::SELECT: @@ -244,8 +272,7 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) // apply the same offset to all nodes, otherwise we get odd rounding behaviour with // multiple selection. QPointF shift = mousePos - _mouseDownPos; - int gridSize = GLOBAL_SCALE / 8; - shift = QPointF(round(shift.x()/gridSize)*gridSize, round(shift.y()/gridSize)*gridSize); + shift = QPointF(round(shift.x()/GRID_SEP)*GRID_SEP, round(shift.y()/GRID_SEP)*GRID_SEP); foreach (Node *n, _oldNodePositions.keys()) { NodeItem *ni = _nodeItems[n]; @@ -257,6 +284,15 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) } else { // otherwise, process mouse move normally QGraphicsScene::mouseMoveEvent(event); + + if (_rubberBandItem->isVisible()) { + qreal left = std::min(_mouseDownPos.x(), mousePos.x()); + qreal top = std::min(_mouseDownPos.y(), mousePos.y()); + qreal w = std::abs(_mouseDownPos.x() - mousePos.x()); + qreal h = std::abs(_mouseDownPos.y() - mousePos.y()); + + _rubberBandItem->setRect(QRectF(left, top, w, h)); + } } break; @@ -308,6 +344,19 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) // otherwise, process mouse move normally QGraphicsScene::mouseReleaseEvent(event); + if (_rubberBandItem->isVisible()) { + QPainterPath sel; + sel.addRect(_rubberBandItem->rect()); + foreach (QGraphicsItem *gi, items()) { + if (NodeItem *ni = dynamic_cast(gi)) { + if (sel.contains(toScreen(ni->node()->point()))) ni->setSelected(true); + } + } + //setSelectionArea(sel); + } + + _rubberBandItem->setVisible(false); + if (!_oldNodePositions.empty()) { QMap newNodePositions; @@ -329,8 +378,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) break; case ToolPalette::VERTEX: { - int gridSize = GLOBAL_SCALE / 8; - QPointF gridPos(round(mousePos.x()/gridSize)*gridSize, round(mousePos.y()/gridSize)*gridSize); + QPointF gridPos(round(mousePos.x()/GRID_SEP)*GRID_SEP, round(mousePos.y()/GRID_SEP)*GRID_SEP); Node *n = new Node(_tikzDocument); n->setName(graph()->freshNodeName()); n->setPoint(fromScreen(gridPos)); @@ -460,7 +508,6 @@ void TikzScene::pasteFromClipboard() QRectF tgtRect = graph()->realBbox(); QPointF shift(tgtRect.right() - srcRect.left(), 0.0f); - // shift g to the right until it is in free space if (shift.x() > 0) { foreach (Node *n, g->nodes()) { n->setPoint(n->point() + shift); @@ -472,6 +519,18 @@ void TikzScene::pasteFromClipboard() } } +void TikzScene::selectAllNodes() +{ + foreach (NodeItem *ni, _nodeItems.values()) { + ni->setSelected(true); + } +} + +void TikzScene::deselectAll() +{ + selectedItems().clear(); +} + void TikzScene::getSelection(QSet &selNodes, QSet &selEdges) { foreach (QGraphicsItem *gi, selectedItems()) { @@ -511,21 +570,21 @@ void TikzScene::reloadStyles() void TikzScene::refreshSceneBounds() { - if (!views().empty()) { - QGraphicsView *v = views().first(); - QRectF viewB = v->mapToScene(v->viewport()->rect()).boundingRect(); - //QPointF tl = v->mapToScene(viewB.topLeft()); - //viewB.setTopLeft(tl); - - QRectF bounds = viewB.united(rectToScreen(graph()->realBbox().adjusted(-1.0f, -1.0f, 1.0f, 1.0f))); - qDebug() << viewB; - - if (bounds != sceneRect()) { - QPointF c = viewB.center(); - setSceneRect(bounds); - v->centerOn(c); - } - } +// if (!views().empty()) { +// QGraphicsView *v = views().first(); +// QRectF viewB = v->mapToScene(v->viewport()->rect()).boundingRect(); +// //QPointF tl = v->mapToScene(viewB.topLeft()); +// //viewB.setTopLeft(tl); + +// QRectF bounds = viewB.united(rectToScreen(graph()->realBbox().adjusted(-1.0f, -1.0f, 1.0f, 1.0f))); +// //qDebug() << viewB; + +// if (bounds != sceneRect()) { +// QPointF c = viewB.center(); +// setSceneRect(bounds); +// v->centerOn(c); +// } +// } //setBounds(graphB); } diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index b551abd..f7735ee 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -41,6 +41,8 @@ public: void copyToClipboard(); void cutToClipboard(); void pasteFromClipboard(); + void selectAllNodes(); + void deselectAll(); public slots: void graphReplaced(); @@ -56,6 +58,7 @@ private: QMap _nodeItems; QMap _edgeItems; QGraphicsLineItem *_drawEdgeItem; + QGraphicsRectItem *_rubberBandItem; EdgeItem *_modifyEdgeItem; NodeItem *_edgeStartNodeItem; NodeItem *_edgeEndNodeItem; diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index b8ae1c0..60dc2bc 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -7,7 +7,7 @@ TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) { setRenderHint(QPainter::Antialiasing); - setDragMode(QGraphicsView::RubberBandDrag); + //setDragMode(QGraphicsView::RubberBandDrag); _scale = 1.0f; } @@ -24,10 +24,15 @@ void TikzView::zoomOut() scale(0.625,0.625); } +void TikzView::setScene(QGraphicsScene *scene) +{ + QGraphicsView::setScene(scene); + centerOn(QPointF(0.0f,-230.0f)); +} + void TikzView::drawBackground(QPainter *painter, const QRectF &rect) { // draw the grid - int step = GLOBAL_SCALE / 8; QPen pen1; pen1.setWidth(1); @@ -43,38 +48,38 @@ void TikzView::drawBackground(QPainter *painter, const QRectF &rect) painter->setPen(pen1); if (_scale > 0.2f) { - for (int x = -step; x > rect.left(); x -= step) { - if (x % (step * 8) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); + for (int x = -GRID_SEP; x > rect.left(); x -= GRID_SEP) { + if (x % (GRID_SEP * GRID_N) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); } - for (int x = step; x < rect.right(); x += step) { - if (x % (step * 8) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); + for (int x = GRID_SEP; x < rect.right(); x += GRID_SEP) { + if (x % (GRID_SEP * GRID_N) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); } - for (int y = -step; y > rect.top(); y -= step) { - if (y % (step * 8) != 0) painter->drawLine(rect.left(), y, rect.right(), y); + for (int y = -GRID_SEP; y > rect.top(); y -= GRID_SEP) { + if (y % (GRID_SEP * GRID_N) != 0) painter->drawLine(rect.left(), y, rect.right(), y); } - for (int y = step; y < rect.bottom(); y += step) { - if (y % (step * 8) != 0) painter->drawLine(rect.left(), y, rect.right(), y); + for (int y = GRID_SEP; y < rect.bottom(); y += GRID_SEP) { + if (y % (GRID_SEP * GRID_N) != 0) painter->drawLine(rect.left(), y, rect.right(), y); } } painter->setPen(pen2); - for (int x = -step*8; x > rect.left(); x -= step*8) { + for (int x = -GRID_SEP*GRID_N; x > rect.left(); x -= GRID_SEP*GRID_N) { painter->drawLine(x, rect.top(), x, rect.bottom()); } - for (int x = step*8; x < rect.right(); x += step*8) { + for (int x = GRID_SEP*GRID_N; x < rect.right(); x += GRID_SEP*GRID_N) { painter->drawLine(x, rect.top(), x, rect.bottom()); } - for (int y = -step*8; y > rect.top(); y -= step*8) { + for (int y = -GRID_SEP*GRID_N; y > rect.top(); y -= GRID_SEP*GRID_N) { painter->drawLine(rect.left(), y, rect.right(), y); } - for (int y = step*8; y < rect.bottom(); y += step*8) { + for (int y = GRID_SEP*GRID_N; y < rect.bottom(); y += GRID_SEP*GRID_N) { painter->drawLine(rect.left(), y, rect.right(), y); } diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h index f89729b..cb41fd4 100644 --- a/src/gui/tikzview.h +++ b/src/gui/tikzview.h @@ -23,6 +23,7 @@ public: public slots: void zoomIn(); void zoomOut(); + void setScene(QGraphicsScene *scene); protected: void drawBackground(QPainter *painter, const QRectF &rect); private: diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index c9ca041..f64b1db 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -312,6 +312,12 @@ void PasteCommand::redo() _scene->clearSelection(); _scene->graph()->insertGraph(_graph); + foreach (Edge *e, _graph->edges()) { + EdgeItem *ei = new EdgeItem(e); + _scene->edgeItems().insert(e, ei); + _scene->addItem(ei); + } + foreach (Node *n, _graph->nodes()) { n->attachStyle(); // in case styles have changed NodeItem *ni = new NodeItem(n); @@ -320,11 +326,5 @@ void PasteCommand::redo() ni->setSelected(true); } - foreach (Edge *e, _graph->edges()) { - EdgeItem *ei = new EdgeItem(e); - _scene->edgeItems().insert(e, ei); - _scene->addItem(ei); - } - GraphUpdateCommand::redo(); } diff --git a/src/main.cpp b/src/main.cpp index 4433f58..b15840d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,6 +20,5 @@ int main(int argc, char *argv[]) a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); tikzit->init(&a); - return a.exec(); } diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 53e83b6..78cb7a1 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -36,7 +36,7 @@ void Tikzit::init(QApplication *app) QString styleFile = settings.value("previous-tikzstyles-file").toString(); if (!styleFile.isEmpty()) loadStyles(styleFile); - connect(app, &QApplication::focusChanged, this, &focusChanged); + //connect(app, &QApplication::focusChanged, this, &focusChanged); } //QMenuBar *Tikzit::mainMenu() const diff --git a/src/tikzit.h b/src/tikzit.h index 5b23083..39aa9e4 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -49,9 +49,12 @@ // Number of pixels between (0,0) and (1,0) at 100% zoom level. This should be // divisible by 8 to avoid rounding errors with e.g. grid-snapping. -#define GLOBAL_SCALE 80 -#define GLOBAL_SCALEF 80.0f -#define GLOBAL_SCALEF_INV 0.0125f +#define GLOBAL_SCALE 40 +#define GLOBAL_SCALEF 40.0f +#define GLOBAL_SCALEF_INV 0.025f +#define GRID_N 4 +#define GRID_SEP 10 +#define GRID_SEPF 10.0f inline QPointF toScreen(QPointF src) { src.setY(-src.y()); src *= GLOBAL_SCALEF; return src; } diff --git a/src/util.cpp b/src/util.cpp index 64716d2..5e56cd9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -46,3 +46,9 @@ float normaliseAngleRad (float rads) { } return rads; } + +// convert float to string, squashing very small floats to zero +QString floatToString(float f) { + if (f >= -0.000001 && f <= 0.000001) return "0"; + else return QString::number(f); +} diff --git a/src/util.h b/src/util.h index 7622269..706928d 100644 --- a/src/util.h +++ b/src/util.h @@ -6,8 +6,13 @@ #define UTIL_H #include +#include #include +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 +#endif + // interpolate on a cubic bezier curve float bezierInterpolate(float dist, float c0, float c1, float c2, float c3); QPointF bezierInterpolateFull (float dist, QPointF c0, QPointF c1, QPointF c2, QPointF c3); @@ -15,6 +20,7 @@ QPointF bezierInterpolateFull (float dist, QPointF c0, QPointF c1, QPointF c2, Q // rounding float roundToNearest(float stepSize, float val); float radiansToDegrees (float radians); +QString floatToString(float f); // angles float degreesToRadians(float degrees); diff --git a/stylepalette.ui b/stylepalette.ui index dab1b32..5e370b6 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -105,8 +105,8 @@ - 25 - 25 + 0 + 0 @@ -129,6 +129,36 @@ + + + + + + + 2 + + + + + Apply + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + -- cgit v1.2.3 From e57923c7d767f5a532bc35571d74a5470eb76314 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 5 Apr 2018 14:21:24 +0200 Subject: built-in style palette --- src/data/nodestyle.cpp | 32 ++++++++++-- src/gui/mainwindow.cpp | 13 ++++- src/gui/mainwindow.h | 7 ++- src/gui/tikzscene.cpp | 10 ++-- src/gui/tikzscene.h | 4 +- src/tikzit.cpp | 16 +++--- src/tikzit.h | 4 +- stylepalette.cpp | 35 +++++++++----- stylepalette.h | 3 +- stylepalette.ui | 129 +++++++++++++++---------------------------------- 10 files changed, 130 insertions(+), 123 deletions(-) (limited to 'src') diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 302ab84..b3d72fb 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -26,6 +26,8 @@ QString NodeStyle::name() const NodeStyle::Shape NodeStyle::shape() const { + if (_data == 0) return NodeStyle::Circle; + QString sh = _data->property("shape"); if (sh.isNull()) return NodeStyle::Circle; else if (sh == "circle") return NodeStyle::Circle; @@ -35,6 +37,8 @@ NodeStyle::Shape NodeStyle::shape() const QColor NodeStyle::fillColor() const { + if (_data == 0) return Qt::white; + QString col = _data->property("fill"); if (col.isNull()) { @@ -52,6 +56,8 @@ QColor NodeStyle::fillColor() const QColor NodeStyle::strokeColor() const { + if (_data == 0) return Qt::black; + QString col = _data->property("draw"); if (col.isNull()) { @@ -103,11 +109,29 @@ QIcon NodeStyle::icon() const px.fill(Qt::transparent); QPainter painter(&px); QPainterPath pth = path(); - painter.setPen(pen()); - painter.setBrush(brush()); - pth.translate(50.0f, 50.0f); - painter.drawPath(pth); + + if (_data == 0) { + QColor c(180,180,200); + painter.setPen(QPen(c)); + painter.setBrush(QBrush(c)); + painter.drawEllipse(QPointF(50.0f,50.0f), 3,3); + + QPen pen(QColor(180,180,220)); + pen.setWidth(3); + QVector p; + p << 2.0 << 2.0; + pen.setDashPattern(p); + painter.setPen(pen); + painter.setBrush(Qt::NoBrush); + painter.drawPath(pth); + } else { + painter.setPen(pen()); + painter.setBrush(brush()); + painter.drawPath(pth); + } + + return QIcon(px); } diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 26e19b6..9ce340a 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -28,7 +28,11 @@ MainWindow::MainWindow(QWidget *parent) : _toolPalette = new ToolPalette(this); addToolBar(_toolPalette); - _tikzScene = new TikzScene(_tikzDocument, _toolPalette, this); + _stylePalette = new StylePalette(this); + addDockWidget(Qt::RightDockWidgetArea, _stylePalette); + + + _tikzScene = new TikzScene(_tikzDocument, _toolPalette, _stylePalette, this); ui->tikzView->setScene(_tikzScene); _pristine = true; @@ -79,11 +83,16 @@ void MainWindow::changeEvent(QEvent *event) { if (event->type() == QEvent::ActivationChange && isActiveWindow()) { tikzit->setActiveWindow(this); - tikzit->stylePalette()->raise(); + //tikzit->stylePalette()->raise(); } QMainWindow::changeEvent(event); } +StylePalette *MainWindow::stylePalette() const +{ + return _stylePalette; +} + void MainWindow::updateFileName() { setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 613bfcb..facce2b 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -11,6 +11,7 @@ #include "tikzdocument.h" #include "mainmenu.h" #include "toolpalette.h" +#include "stylepalette.h" #include #include @@ -33,9 +34,12 @@ public: TikzView *tikzView() const; TikzScene *tikzScene() const; TikzDocument *tikzDocument() const; - ToolPalette *toolPalette() const; + ToolPalette *toolPalette() const; + StylePalette *stylePalette() const; + void updateFileName(); void refreshTikz(); + protected: void closeEvent(QCloseEvent *event); void changeEvent(QEvent *event); @@ -45,6 +49,7 @@ private: TikzDocument *_tikzDocument; MainMenu *_menu; ToolPalette *_toolPalette; + StylePalette *_stylePalette; Ui::MainWindow *ui; bool _pristine; int _windowId; diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 24f4ad1..8378f5e 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -11,8 +11,9 @@ #include -TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *parent) : - QGraphicsScene(parent), _tikzDocument(tikzDocument), _tools(tools) +TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, + StylePalette *styles, QObject *parent) : + QGraphicsScene(parent), _tikzDocument(tikzDocument), _tools(tools), _styles(styles) { _modifyEdgeItem = 0; _edgeStartNodeItem = 0; @@ -382,7 +383,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Node *n = new Node(_tikzDocument); n->setName(graph()->freshNodeName()); n->setPoint(fromScreen(gridPos)); - n->setStyleName(tikzit->stylePalette()->activeNodeStyleName()); + n->setStyleName(_styles->activeNodeStyleName()); QRectF grow(gridPos.x() - GLOBAL_SCALEF, gridPos.y() - GLOBAL_SCALEF, 2 * GLOBAL_SCALEF, 2 * GLOBAL_SCALEF); QRectF newBounds = sceneRect().united(grow); @@ -447,7 +448,7 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) } void TikzScene::applyActiveStyleToNodes() { - ApplyStyleToNodesCommand *cmd = new ApplyStyleToNodesCommand(this, tikzit->stylePalette()->activeNodeStyleName()); + ApplyStyleToNodesCommand *cmd = new ApplyStyleToNodesCommand(this, _styles->activeNodeStyleName()); _tikzDocument->undoStack()->push(cmd); } @@ -562,6 +563,7 @@ void TikzScene::setTikzDocument(TikzDocument *tikzDocument) void TikzScene::reloadStyles() { + _styles->reloadStyles(); foreach (NodeItem *ni, _nodeItems) { ni->node()->attachStyle(); ni->readPos(); // trigger a repaint diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index f7735ee..7061143 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -11,6 +11,7 @@ #include "edgeitem.h" #include "tikzdocument.h" #include "toolpalette.h" +#include "stylepalette.h" #include #include @@ -24,7 +25,7 @@ class TikzScene : public QGraphicsScene { Q_OBJECT public: - TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QObject *parent); + TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, StylePalette *styles, QObject *parent); ~TikzScene(); Graph *graph(); QMap &nodeItems(); @@ -55,6 +56,7 @@ protected: private: TikzDocument *_tikzDocument; ToolPalette *_tools; + StylePalette *_styles; QMap _nodeItems; QMap _edgeItems; QGraphicsLineItem *_drawEdgeItem; diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 78cb7a1..e91976c 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -26,10 +26,10 @@ void Tikzit::init(QApplication *app) _toolPalette = new ToolPalette(dummy); _propertyPalette = new PropertyPalette(dummy); - _stylePalette = new StylePalette(dummy); + //_stylePalette = new StylePalette(dummy); _styles = new TikzStyles(this); - _stylePalette->show(); + //_stylePalette->show(); _windows << new MainWindow(); _windows[0]->show(); @@ -137,7 +137,7 @@ void Tikzit::loadStyles(QString fileName) } else { qDebug() << "parse failed"; } - _stylePalette->reloadStyles(); + //_stylePalette->reloadStyles(); foreach (MainWindow *w, _windows) { w->tikzScene()->reloadStyles(); @@ -164,10 +164,10 @@ void Tikzit::focusChanged(QWidget *old, QWidget *nw) // } } -StylePalette *Tikzit::stylePalette() const -{ - return _stylePalette; -} +//StylePalette *Tikzit::stylePalette() const +//{ +// return _stylePalette; +//} TikzStyles *Tikzit::styles() const @@ -177,7 +177,7 @@ TikzStyles *Tikzit::styles() const void Tikzit::quit() { - _stylePalette->close(); + //_stylePalette->close(); QApplication::quit(); } diff --git a/src/tikzit.h b/src/tikzit.h index 39aa9e4..6a191b5 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -98,7 +98,7 @@ public: void loadStyles(QString fileName); TikzStyles *styles() const; QString styleFile() const; - StylePalette *stylePalette() const; + //StylePalette *stylePalette() const; public slots: void focusChanged(QWidget *old, QWidget *nw); @@ -108,7 +108,7 @@ private: MainMenu *_mainMenu; ToolPalette *_toolPalette; PropertyPalette *_propertyPalette; - StylePalette *_stylePalette; + //StylePalette *_stylePalette; QVector _windows; MainWindow *_activeWindow; TikzStyles *_styles; diff --git a/stylepalette.cpp b/stylepalette.cpp index c2ddc21..bd82e30 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -16,17 +16,19 @@ StylePalette::StylePalette(QWidget *parent) : { ui->setupUi(this); - QSettings settings("tikzit", "tikzit"); - QVariant geom = settings.value("style-palette-geometry"); - if (geom != QVariant()) { - restoreGeometry(geom.toByteArray()); - } +// QSettings settings("tikzit", "tikzit"); +// QVariant geom = settings.value("style-palette-geometry"); +// if (geom != QVariant()) { +// restoreGeometry(geom.toByteArray()); +// } _model = new QStandardItemModel(this); ui->styleListView->setModel(_model); ui->styleListView->setViewMode(QListView::IconMode); ui->styleListView->setMovement(QListView::Static); - ui->styleListView->setGridSize(QSize(70,60)); + ui->styleListView->setGridSize(QSize(70,40)); + + connect(ui->styleListView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT( itemDoubleClicked(const QModelIndex&)) ); } StylePalette::~StylePalette() @@ -42,10 +44,16 @@ void StylePalette::reloadStyles() ui->styleFile->setText(f); QStandardItem *it; - QSize sz(60,60); + //QSize sz(60,60); + + it = new QStandardItem(noneStyle->icon(), noneStyle->name()); + it->setEditable(false); + it->setData(noneStyle->name()); + _model->appendRow(it); foreach(NodeStyle *ns, tikzit->styles()->nodeStyles()) { it = new QStandardItem(ns->icon(), ns->name()); + it->setEditable(false); it->setData(ns->name()); _model->appendRow(it); } @@ -62,6 +70,11 @@ QString StylePalette::activeNodeStyleName() } } +void StylePalette::itemDoubleClicked(const QModelIndex &index) +{ + tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); +} + void StylePalette::on_buttonOpenTikzstyles_clicked() { tikzit->openTikzStyles(); @@ -74,10 +87,10 @@ void StylePalette::on_buttonRefreshTikzstyles_clicked() if (!path.isEmpty()) tikzit->loadStyles(path); } -void StylePalette::on_buttonApplyNodeStyle_clicked() -{ - if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); -} +//void StylePalette::on_buttonApplyNodeStyle_clicked() +//{ +// if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); +//} void StylePalette::closeEvent(QCloseEvent *event) { diff --git a/stylepalette.h b/stylepalette.h index 3861008..8d2187e 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -20,9 +20,10 @@ public: public slots: + void itemDoubleClicked(const QModelIndex &index); void on_buttonOpenTikzstyles_clicked(); void on_buttonRefreshTikzstyles_clicked(); - void on_buttonApplyNodeStyle_clicked(); + //void on_buttonApplyNodeStyle_clicked(); private: Ui::StylePalette *ui; diff --git a/stylepalette.ui b/stylepalette.ui index 5e370b6..3362ce2 100644 --- a/stylepalette.ui +++ b/stylepalette.ui @@ -6,21 +6,33 @@ 0 0 - 250 - 430 + 88 + 518 + + + 0 + 0 + + - 250 - 430 + 88 + 0 + + + + + 88 + 524287 - true + false - Styles + @@ -33,31 +45,17 @@ 0 - - - Styles: - - - - - - - - 0 - 0 - - - - - Courier - 75 - true - + + + Qt::Horizontal - - [default] + + + 40 + 20 + - + @@ -86,6 +84,19 @@ + + + + + 0 + 0 + + + + [default] + + + @@ -96,69 +107,9 @@ - - - - 2 - - - - - - 0 - 0 - - - - Apply - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 2 - - - - - Apply - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - -- cgit v1.2.3 From 9e2116497660509afd417cc3b952ea80bbb72ce5 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 5 Apr 2018 15:07:57 +0200 Subject: can now edit node labels --- src/data/edge.cpp | 2 ++ src/gui/tikzscene.cpp | 15 +++++++++++++++ src/gui/tikzview.cpp | 2 +- src/gui/undocommands.cpp | 23 +++++++++++++++++++++++ src/gui/undocommands.h | 16 ++++++++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index bcf127f..5c49aba 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -248,6 +248,8 @@ void Edge::updateData() if (_source == _target) _data->setAtom("loop"); if (!isSelfLoop() && !isStraight() && _weight != 0.4f) _data->setProperty("looseness", QString::number(_weight*2.5f, 'f', 2)); + if (_source->style()->isNone()) _sourceAnchor = "center"; + if (_target->style()->isNone()) _targetAnchor = "center"; } diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 8378f5e..ffc111c 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include @@ -444,6 +445,20 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) _tikzDocument->undoStack()->push(cmd); break; } + + if (NodeItem *ni = dynamic_cast(gi)) { + bool ok; + QString newLabel = QInputDialog::getText(views()[0], tr("Node label"), + tr("Label:"), QLineEdit::Normal, + ni->node()->label(), &ok); + if (ok && !newLabel.isEmpty()) { + QMap oldLabels; + oldLabels.insert(ni->node(), ni->node()->label()); + ChangeLabelCommand *cmd = new ChangeLabelCommand(this, graph(), oldLabels, newLabel); + _tikzDocument->undoStack()->push(cmd); + } + break; + } } } diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 60dc2bc..60db665 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -6,7 +6,7 @@ TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) { - setRenderHint(QPainter::Antialiasing); + //setRenderHint(QPainter::Antialiasing); //setDragMode(QGraphicsView::RubberBandDrag); _scale = 1.0f; diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index f64b1db..32fafbe 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -328,3 +328,26 @@ void PasteCommand::redo() GraphUpdateCommand::redo(); } + +ChangeLabelCommand::ChangeLabelCommand(TikzScene *scene, Graph *graph, QMap oldLabels, QString newLabel, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _oldLabels(oldLabels), _newLabel(newLabel) +{ +} + +void ChangeLabelCommand::undo() +{ + foreach (Node *n, _oldLabels.keys()) { + n->setLabel(_oldLabels[n]); + } + + GraphUpdateCommand::undo(); +} + +void ChangeLabelCommand::redo() +{ + foreach (Node *n, _oldLabels.keys()) { + n->setLabel(_newLabel); + } + + GraphUpdateCommand::redo(); +} diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 354e455..e716458 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -130,4 +130,20 @@ private: QList _oldSelection; }; +class ChangeLabelCommand : public GraphUpdateCommand +{ +public: + explicit ChangeLabelCommand(TikzScene *scene, + Graph *graph, + QMap oldLabels, + QString newLabel, + QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + Graph *_graph; + QMap _oldLabels; + QString _newLabel; +}; + #endif // UNDOCOMMANDS_H -- cgit v1.2.3 From e840508c39b8e85328875477bfdbe0417c4e0eb0 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 6 Apr 2018 08:36:18 +0200 Subject: parse tikz feature --- src/data/tikzdocument.cpp | 6 ++++++ src/data/tikzdocument.h | 2 ++ src/gui/mainmenu.cpp | 14 +++++++++++++- src/gui/mainmenu.h | 1 + src/gui/mainmenu.ui | 8 +++++++- src/gui/mainwindow.cpp | 17 +++++++++++++++++ src/gui/mainwindow.h | 3 +++ src/gui/tikzscene.cpp | 33 +++++++++++++++++++++++++++++++++ src/gui/tikzscene.h | 5 +++++ src/gui/tikzview.cpp | 4 ++++ src/gui/tikzview.h | 1 + src/gui/undocommands.cpp | 17 +++++++++++++++++ src/gui/undocommands.h | 14 ++++++++++++++ stylepalette.cpp | 2 ++ 14 files changed, 125 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index 4a813ad..bf39f67 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -96,6 +96,12 @@ void TikzDocument::save() { } } +void TikzDocument::setGraph(Graph *graph) +{ + _graph = graph; + refreshTikz(); +} + void TikzDocument::saveAs() { QSettings settings("tikzit", "tikzit"); QString fileName = QFileDialog::getSaveFileName(tikzit->activeWindow(), diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h index edb1beb..9b6893a 100644 --- a/src/data/tikzdocument.h +++ b/src/data/tikzdocument.h @@ -19,6 +19,7 @@ public: ~TikzDocument(); Graph *graph() const; + void setGraph(Graph *graph); QString tikz() const; QUndoStack *undoStack() const; bool parseSuccess() const; @@ -30,6 +31,7 @@ public: void saveAs(); void save(); + private: Graph *_graph; QString _tikz; diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index 0166caf..7ebb6af 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -94,7 +94,19 @@ void MainMenu::on_actionDeselect_All_triggered() // Tikz void MainMenu::on_actionParse_triggered() { - // TODO + MainWindow *win = tikzit->activeWindow(); + if (win != 0) { + win->tikzScene()->parseTikz(win->tikzSource()); + } +} + +void MainMenu::on_actionRevert_triggered() +{ + MainWindow *win = tikzit->activeWindow(); + if (win != 0) { + win->tikzDocument()->refreshTikz(); + win->tikzScene()->setEnabled(true); + } } diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index ee167e6..103a74a 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -35,6 +35,7 @@ public slots: // Tikz void on_actionParse_triggered(); + void on_actionRevert_triggered(); // View void on_actionZoom_In_triggered(); diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui index 2f15d5a..ccd6c38 100644 --- a/src/gui/mainmenu.ui +++ b/src/gui/mainmenu.ui @@ -43,6 +43,7 @@ Tikz + @@ -157,7 +158,7 @@ - Parse + Parse Tikz Ctrl+T @@ -184,6 +185,11 @@ Exit + + + Revert Tikz + + diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 9ce340a..9436eb3 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -12,6 +12,7 @@ #include #include #include +#include int MainWindow::_numWindows = 0; @@ -32,8 +33,11 @@ MainWindow::MainWindow(QWidget *parent) : addDockWidget(Qt::RightDockWidgetArea, _stylePalette); + _tikzScene = new TikzScene(_tikzDocument, _toolPalette, _stylePalette, this); ui->tikzView->setScene(_tikzScene); + + _pristine = true; @@ -93,6 +97,11 @@ StylePalette *MainWindow::stylePalette() const return _stylePalette; } +QString MainWindow::tikzSource() +{ + return ui->tikzSource->toPlainText(); +} + void MainWindow::updateFileName() { setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); @@ -100,7 +109,10 @@ void MainWindow::updateFileName() void MainWindow::refreshTikz() { + // don't emit textChanged() when we update the tikz + ui->tikzSource->blockSignals(true); ui->tikzSource->setText(_tikzDocument->tikz()); + ui->tikzSource->blockSignals(false); } ToolPalette *MainWindow::toolPalette() const @@ -133,4 +145,9 @@ bool MainWindow::pristine() const return _pristine; } +void MainWindow::on_tikzSource_textChanged() +{ + if (_tikzScene->enabled()) _tikzScene->setEnabled(false); +} + diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index facce2b..dc69fbc 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -36,10 +36,13 @@ public: TikzDocument *tikzDocument() const; ToolPalette *toolPalette() const; StylePalette *stylePalette() const; + QString tikzSource(); void updateFileName(); void refreshTikz(); +public slots: + void on_tikzSource_textChanged(); protected: void closeEvent(QCloseEvent *event); void changeEvent(QEvent *event); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index ffc111c..a650961 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -80,6 +80,8 @@ void TikzScene::graphReplaced() void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { + if (!_enabled) return; + // current mouse position, in scene coordinates _mouseDownPos = event->scenePos(); @@ -181,6 +183,8 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { + if (!_enabled) return; + // current mouse position, in scene coordinates QPointF mousePos = event->scenePos(); //QRectF rb = views()[0]->rubberBandRect(); @@ -323,6 +327,8 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { + if (!_enabled) return; + // current mouse position, in scene coordinates QPointF mousePos = event->scenePos(); @@ -415,6 +421,8 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void TikzScene::keyReleaseEvent(QKeyEvent *event) { + if (!_enabled) return; + if (event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete) { deleteSelectedItems(); } else if (event->modifiers() == Qt::NoModifier) { @@ -438,6 +446,8 @@ void TikzScene::keyReleaseEvent(QKeyEvent *event) void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { + if (!_enabled) return; + QPointF mousePos = event->scenePos(); foreach (QGraphicsItem *gi, items(mousePos)) { if (EdgeItem *ei = dynamic_cast(gi)) { @@ -462,6 +472,18 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) } } +bool TikzScene::enabled() const +{ + return _enabled; +} + +void TikzScene::setEnabled(bool enabled) +{ + _enabled = enabled; + update(); +} + + void TikzScene::applyActiveStyleToNodes() { ApplyStyleToNodesCommand *cmd = new ApplyStyleToNodesCommand(this, _styles->activeNodeStyleName()); _tikzDocument->undoStack()->push(cmd); @@ -547,6 +569,17 @@ void TikzScene::deselectAll() selectedItems().clear(); } +void TikzScene::parseTikz(QString tikz) +{ + Graph *newGraph = new Graph(this); + TikzAssembler ass(newGraph); + if (ass.parse(tikz)) { + ReplaceGraphCommand *cmd = new ReplaceGraphCommand(this, graph(), newGraph); + tikzDocument()->undoStack()->push(cmd); + setEnabled(true); + } +} + void TikzScene::getSelection(QSet &selNodes, QSet &selEdges) { foreach (QGraphicsItem *gi, selectedItems()) { diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 7061143..3cc2e87 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -44,6 +44,10 @@ public: void pasteFromClipboard(); void selectAllNodes(); void deselectAll(); + void parseTikz(QString tikz); + bool enabled() const; + void setEnabled(bool enabled); + public slots: void graphReplaced(); @@ -73,6 +77,7 @@ private: int _oldBend; int _oldInAngle; int _oldOutAngle; + bool _enabled; void getSelection(QSet &selNodes, QSet &selEdges); QSet getSelectedNodes(); diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 60db665..047ef50 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -32,6 +32,10 @@ void TikzView::setScene(QGraphicsScene *scene) void TikzView::drawBackground(QPainter *painter, const QRectF &rect) { + // draw a gray background if disabled + TikzScene *sc = static_cast(scene()); + if (!sc->enabled()) painter->fillRect(rect, QBrush(QColor(240,240,240))); + // draw the grid QPen pen1; diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h index cb41fd4..b2006c8 100644 --- a/src/gui/tikzview.h +++ b/src/gui/tikzview.h @@ -20,6 +20,7 @@ class TikzView : public QGraphicsView Q_OBJECT public: explicit TikzView(QWidget *parent = 0); + public slots: void zoomIn(); void zoomOut(); diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 32fafbe..4c5d0dc 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -351,3 +351,20 @@ void ChangeLabelCommand::redo() GraphUpdateCommand::redo(); } + +ReplaceGraphCommand::ReplaceGraphCommand(TikzScene *scene, Graph *oldGraph, Graph *newGraph, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _oldGraph(oldGraph), _newGraph(newGraph) +{ +} + +void ReplaceGraphCommand::undo() +{ + _scene->tikzDocument()->setGraph(_oldGraph); + _scene->graphReplaced(); +} + +void ReplaceGraphCommand::redo() +{ + _scene->tikzDocument()->setGraph(_newGraph); + _scene->graphReplaced(); +} diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index e716458..a0abb26 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -146,4 +146,18 @@ private: QString _newLabel; }; +class ReplaceGraphCommand : public GraphUpdateCommand +{ +public: + explicit ReplaceGraphCommand(TikzScene *scene, + Graph *oldGraph, + Graph *newGraph, + QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + Graph *_oldGraph; + Graph *_newGraph; +}; + #endif // UNDOCOMMANDS_H diff --git a/stylepalette.cpp b/stylepalette.cpp index bd82e30..1416cc3 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -28,6 +28,8 @@ StylePalette::StylePalette(QWidget *parent) : ui->styleListView->setMovement(QListView::Static); ui->styleListView->setGridSize(QSize(70,40)); + reloadStyles(); + connect(ui->styleListView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT( itemDoubleClicked(const QModelIndex&)) ); } -- cgit v1.2.3 From ba8e3d516afefbb4a43227525ddb6525547a650e Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 9 Apr 2018 11:40:54 +0200 Subject: added support for tikz editing/parsing --- src/data/edge.cpp | 10 ++ src/data/edge.h | 5 + src/data/graph.cpp | 1 + src/data/tikzdocument.cpp | 42 ++++++- src/data/tikzdocument.h | 3 + src/data/tikzlexer.l | 2 +- src/data/tikzparserdefs.h | 2 +- src/gui/edgeitem.cpp | 13 +- src/gui/mainmenu.cpp | 11 ++ src/gui/mainmenu.h | 1 + src/gui/mainmenu.ui | 9 ++ src/gui/mainwindow.cpp | 37 +++--- src/gui/mainwindow.h | 8 +- src/gui/tikzscene.cpp | 34 +++-- src/gui/tikzscene.h | 1 + src/tikzit.cpp | 5 +- tikzlexer.h | 308 ++++++++++++++++++++++++++++++++++++---------- 17 files changed, 392 insertions(+), 100 deletions(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index 5c49aba..d0f0deb 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -329,6 +329,16 @@ void Edge::setWeight(float weight) _weight = weight; } +int Edge::tikzLine() const +{ + return _tikzLine; +} + +void Edge::setTikzLine(int tikzLine) +{ + _tikzLine = tikzLine; +} + QPointF Edge::mid() const { return _mid; diff --git a/src/data/edge.h b/src/data/edge.h index f010acd..7df899f 100644 --- a/src/data/edge.h +++ b/src/data/edge.h @@ -57,6 +57,9 @@ public: void setOutAngle(int outAngle); void setWeight(float weight); + int tikzLine() const; + void setTikzLine(int tikzLine); + signals: public slots: @@ -86,6 +89,8 @@ private: QPointF _cp1; QPointF _cp2; QPointF _mid; + + int _tikzLine; }; #endif // EDGE_H diff --git a/src/data/graph.cpp b/src/data/graph.cpp index 33af93d..dec992f 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -179,6 +179,7 @@ QString Graph::tikz() Edge *e; foreach (e, _edges) { + e->setTikzLine(line); e->updateData(); code << "\t\t\\draw "; diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index bf39f67..206ec5b 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -17,6 +17,7 @@ TikzDocument::TikzDocument(QObject *parent) : QObject(parent) _fileName = ""; _shortName = ""; _undoStack = new QUndoStack(); + _undoStack->setClean(); } TikzDocument::~TikzDocument() @@ -68,6 +69,8 @@ void TikzDocument::open(QString fileName) foreach (Node *n, _graph->nodes()) n->attachStyle(); foreach (Edge *e, _graph->edges()) e->updateControls(); _parseSuccess = true; + refreshTikz(); + setClean(); } else { delete newGraph; _parseSuccess = false; @@ -78,6 +81,18 @@ void TikzDocument::save() { if (_fileName == "") { saveAs(); } else { + MainWindow *win = tikzit->activeWindow(); + if (win != 0 && !win->tikzScene()->enabled()) { + win->tikzScene()->parseTikz(win->tikzSource()); + if (!win->tikzScene()->enabled()) { + auto resp = QMessageBox::question(0, + tr("Tikz failed to parse"), + tr("Cannot save file with invalid TiKZ source. Revert changes and save?")); + if (resp == QMessageBox::Yes) win->tikzScene()->setEnabled(true); + else return; // ABORT the save + } + } + refreshTikz(); QFile file(_fileName); QFileInfo fi(file); @@ -89,13 +104,23 @@ void TikzDocument::save() { QTextStream stream(&file); stream << _tikz; file.close(); - tikzit->activeWindow()->updateFileName(); + setClean(); } else { QMessageBox::warning(0, "Save Failed", "Could not open file: '" + _fileName + "' for writing."); } } } +bool TikzDocument::isClean() const +{ + return _undoStack->isClean(); +} + +void TikzDocument::setClean() +{ + _undoStack->setClean(); +} + void TikzDocument::setGraph(Graph *graph) { _graph = graph; @@ -103,6 +128,18 @@ void TikzDocument::setGraph(Graph *graph) } void TikzDocument::saveAs() { + MainWindow *win = tikzit->activeWindow(); + if (win != 0 && !win->tikzScene()->enabled()) { + win->tikzScene()->parseTikz(win->tikzSource()); + if (!win->tikzScene()->enabled()) { + auto resp = QMessageBox::question(0, + tr("Tikz failed to parse"), + tr("Cannot save file with invalid TiKZ source. Revert changes and save?")); + if (resp == QMessageBox::Yes) win->tikzScene()->setEnabled(true); + else return; // ABORT the save + } + } + QSettings settings("tikzit", "tikzit"); QString fileName = QFileDialog::getSaveFileName(tikzit->activeWindow(), tr("Save File As"), @@ -112,6 +149,9 @@ void TikzDocument::saveAs() { if (!fileName.isEmpty()) { _fileName = fileName; save(); + + // clean state might not change, so update title bar manually + tikzit->activeWindow()->updateFileName(); } } diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h index 9b6893a..8f16a53 100644 --- a/src/data/tikzdocument.h +++ b/src/data/tikzdocument.h @@ -32,6 +32,9 @@ public: void saveAs(); void save(); + bool isClean() const; + void setClean(); + private: Graph *_graph; QString _tikz; diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index 0a7ff39..d90ad4b 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -97,7 +97,7 @@ to { return TO; } } \) { BEGIN(INITIAL); - return COORD; + return TCOORD; } /* when we see "[", change parsing mode */ diff --git a/src/data/tikzparserdefs.h b/src/data/tikzparserdefs.h index 1625136..5865739 100644 --- a/src/data/tikzparserdefs.h +++ b/src/data/tikzparserdefs.h @@ -17,6 +17,6 @@ struct noderef { char *anchor; }; -inline int isatty(void*) { return 0; } +inline int isatty(int) { return 0; } #endif // TIKZPARSERDEFS_H diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 04ee7b6..f174186 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -34,9 +34,16 @@ void EdgeItem::readPos() QPainterPath path; path.moveTo (toScreen(_edge->tail())); - path.cubicTo(toScreen(_edge->cp1()), - toScreen(_edge->cp2()), - toScreen(_edge->head())); + + if (_edge->bend() != 0 || !_edge->basicBendMode()) { + path.cubicTo(toScreen(_edge->cp1()), + toScreen(_edge->cp2()), + toScreen(_edge->head())); + } + else { + path.lineTo(toScreen(_edge->head())); + } + setPath(path); _cp1Item->setPos(toScreen(_edge->cp1())); diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index 7ebb6af..7e2584c 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -1,6 +1,8 @@ #include "mainmenu.h" #include "tikzit.h" +#include + MainMenu::MainMenu() { ui.setupUi(this); @@ -109,6 +111,15 @@ void MainMenu::on_actionRevert_triggered() } } +void MainMenu::on_actionJump_to_Selection_triggered() +{ + MainWindow *win = tikzit->activeWindow(); + if (win != 0) { + qDebug() << "jump to selection on line:" << win->tikzScene()->lineNumberForSelection(); + win->setSourceLine(win->tikzScene()->lineNumberForSelection()); + } +} + // View void MainMenu::on_actionZoom_In_triggered() diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index 103a74a..bceb69d 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -36,6 +36,7 @@ public slots: // Tikz void on_actionParse_triggered(); void on_actionRevert_triggered(); + void on_actionJump_to_Selection_triggered(); // View void on_actionZoom_In_triggered(); diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui index ccd6c38..6a2511e 100644 --- a/src/gui/mainmenu.ui +++ b/src/gui/mainmenu.ui @@ -44,6 +44,7 @@ + @@ -190,6 +191,14 @@ Revert Tikz + + + Jump to Selection + + + Ctrl+J + + diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 9436eb3..15b6943 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -13,6 +13,7 @@ #include #include #include +#include int MainWindow::_numWindows = 0; @@ -32,15 +33,9 @@ MainWindow::MainWindow(QWidget *parent) : _stylePalette = new StylePalette(this); addDockWidget(Qt::RightDockWidgetArea, _stylePalette); - - _tikzScene = new TikzScene(_tikzDocument, _toolPalette, _stylePalette, this); ui->tikzView->setScene(_tikzScene); - - _pristine = true; - - // TODO: check if each window should have a menu _menu = new MainMenu(); _menu->setParent(this); @@ -52,6 +47,10 @@ MainWindow::MainWindow(QWidget *parent) : sz[0] = sz[0] + sz[1]; sz[1] = 0; ui->splitter->setSizes(sz); + + _tikzDocument->refreshTikz(); + + connect(_tikzDocument->undoStack(), SIGNAL(cleanChanged(bool)), this, SLOT(updateFileName())); } MainWindow::~MainWindow() @@ -62,15 +61,16 @@ MainWindow::~MainWindow() void MainWindow::open(QString fileName) { - _pristine = false; _tikzDocument->open(fileName); - ui->tikzSource->setText(_tikzDocument->tikz()); + + //ui->tikzSource->setText(_tikzDocument->tikz()); if (_tikzDocument->parseSuccess()) { statusBar()->showMessage("TiKZ parsed successfully", 2000); - setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); + //setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); _tikzScene->setTikzDocument(_tikzDocument); + updateFileName(); } else { statusBar()->showMessage("Cannot read TiKZ source"); } @@ -102,9 +102,21 @@ QString MainWindow::tikzSource() return ui->tikzSource->toPlainText(); } +void MainWindow::setSourceLine(int line) +{ + QTextCursor cursor(ui->tikzSource->document()->findBlockByLineNumber(line)); + cursor.movePosition(QTextCursor::EndOfLine); + //ui->tikzSource->moveCursor(QTextCursor::End); + ui->tikzSource->setTextCursor(cursor); + ui->tikzSource->setFocus(); +} + void MainWindow::updateFileName() { - setWindowTitle("TiKZiT - " + _tikzDocument->shortName()); + QString nm = _tikzDocument->shortName(); + if (nm.isEmpty()) nm = "untitled"; + if (!_tikzDocument->isClean()) nm += "*"; + setWindowTitle("TiKZiT - " + nm); } void MainWindow::refreshTikz() @@ -140,11 +152,6 @@ TikzView *MainWindow::tikzView() const return ui->tikzView; } -bool MainWindow::pristine() const -{ - return _pristine; -} - void MainWindow::on_tikzSource_textChanged() { if (_tikzScene->enabled()) _tikzScene->setEnabled(false); diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index dc69fbc..1e05239 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -29,7 +29,6 @@ public: ~MainWindow(); void open(QString fileName); - bool pristine() const; int windowId() const; TikzView *tikzView() const; TikzScene *tikzScene() const; @@ -37,12 +36,12 @@ public: ToolPalette *toolPalette() const; StylePalette *stylePalette() const; QString tikzSource(); - - void updateFileName(); - void refreshTikz(); + void setSourceLine(int line); public slots: void on_tikzSource_textChanged(); + void updateFileName(); + void refreshTikz(); protected: void closeEvent(QCloseEvent *event); void changeEvent(QEvent *event); @@ -54,7 +53,6 @@ private: ToolPalette *_toolPalette; StylePalette *_stylePalette; Ui::MainWindow *ui; - bool _pristine; int _windowId; static int _numWindows; }; diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index a650961..b26c4ba 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -20,6 +20,7 @@ TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, _edgeStartNodeItem = 0; _drawEdgeItem = new QGraphicsLineItem(); _rubberBandItem = new QGraphicsRectItem(); + _enabled = true; //setSceneRect(-310,-230,620,450); setSceneRect(-1000,-1000,2000,2000); @@ -72,6 +73,7 @@ void TikzScene::graphReplaced() } foreach (Node *n, graph()->nodes()) { + n->attachStyle(); NodeItem *ni = new NodeItem(n); _nodeItems.insert(n, ni); addItem(ni); @@ -366,19 +368,25 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) _rubberBandItem->setVisible(false); if (!_oldNodePositions.empty()) { - QMap newNodePositions; + QPointF shift = mousePos - _mouseDownPos; + shift = QPointF(round(shift.x()/GRID_SEP)*GRID_SEP, round(shift.y()/GRID_SEP)*GRID_SEP); - foreach (QGraphicsItem *gi, selectedItems()) { - if (NodeItem *ni = dynamic_cast(gi)) { - ni->writePos(); - newNodePositions.insert(ni->node(), ni->node()->point()); + if (shift.x() != 0 || shift.y() != 0) { + QMap newNodePositions; + + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) { + ni->writePos(); + newNodePositions.insert(ni->node(), ni->node()->point()); + } } - } - //qDebug() << _oldNodePositions; - //qDebug() << newNodePositions; + //qDebug() << _oldNodePositions; + //qDebug() << newNodePositions; + + _tikzDocument->undoStack()->push(new MoveCommand(this, _oldNodePositions, newNodePositions)); + } - _tikzDocument->undoStack()->push(new MoveCommand(this, _oldNodePositions, newNodePositions)); _oldNodePositions.clear(); } } @@ -483,6 +491,14 @@ void TikzScene::setEnabled(bool enabled) update(); } +int TikzScene::lineNumberForSelection() +{ + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) return ni->node()->tikzLine(); + if (EdgeItem *ei = dynamic_cast(gi)) return ei->edge()->tikzLine(); + } +} + void TikzScene::applyActiveStyleToNodes() { ApplyStyleToNodesCommand *cmd = new ApplyStyleToNodesCommand(this, _styles->activeNodeStyleName()); diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 3cc2e87..3b4a1e1 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -47,6 +47,7 @@ public: void parseTikz(QString tikz); bool enabled() const; void setEnabled(bool enabled); + int lineNumberForSelection(); public slots: void graphReplaced(); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index e91976c..a55473e 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -92,7 +92,10 @@ void Tikzit::open() tr("TiKZ Files (*.tikz)")); if (!fileName.isEmpty()) { - if (_windows.size() == 1 && _windows[0]->pristine()) { + if (_windows.size() == 1 && + _windows[0]->tikzDocument()->isClean() && + _windows[0]->tikzDocument()->shortName().isEmpty()) + { _windows[0]->open(fileName); _windows[0]->show(); } else { diff --git a/tikzlexer.h b/tikzlexer.h index 73df7b6..0275165 100644 --- a/tikzlexer.h +++ b/tikzlexer.h @@ -2,9 +2,9 @@ #define yyHEADER_H 1 #define yyIN_HEADER 1 -#line 6 "tikzlexer.h" +#line 5 "tikzlexer.h" -#line 8 "tikzlexer.h" +#line 7 "tikzlexer.h" #define YY_INT_ALIGNED short int @@ -12,12 +12,36 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yyget_lval +#define yyget_lval_ALREADY_DEFINED +#else +#define yyget_lval yyget_lval +#endif + +#ifdef yyset_lval +#define yyset_lval_ALREADY_DEFINED +#else +#define yyset_lval yyset_lval +#endif + +#ifdef yyget_lloc +#define yyget_lloc_ALREADY_DEFINED +#else +#define yyget_lloc yyget_lloc +#endif + +#ifdef yyset_lloc +#define yyset_lloc_ALREADY_DEFINED +#else +#define yyset_lloc yyset_lloc +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -51,7 +75,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -59,7 +82,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -90,27 +112,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) +#endif /* ! C99 */ -#define YY_USE_CONST +#endif /* ! FLEXINT_H */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -132,7 +150,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE @@ -157,12 +183,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -185,7 +211,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -196,23 +222,23 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void yypop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void yyfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); -#define yywrap(n) 1 +#define yywrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -233,49 +259,53 @@ void yyfree (void * ,yyscan_t yyscanner ); */ #include #endif - + #define YY_EXTRA_TYPE TikzAssembler * int yylex_init (yyscan_t* scanner); -int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -int yyget_debug (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_in (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -FILE *yyget_out (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -void yyset_out (FILE * out_str ,yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -yy_size_t yyget_leng (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -char *yyget_text (yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int yyget_lineno (yyscan_t yyscanner ); +int yyget_column ( yyscan_t yyscanner ); -void yyset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_column ( int _column_no , yyscan_t yyscanner ); -YYSTYPE * yyget_lval (yyscan_t yyscanner ); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); -void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - YYLTYPE *yyget_lloc (yyscan_t yyscanner ); + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); - void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -283,18 +313,18 @@ void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -303,7 +333,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ @@ -318,7 +353,7 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 extern int yylex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); #define YY_DECL int yylex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) @@ -338,8 +373,153 @@ extern int yylex \ #undef YY_DECL #endif -#line 188 "src/data/tikzlexer.l" +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 191 "src\\data\\tikzlexer.l" -#line 344 "tikzlexer.h" +#line 523 "tikzlexer.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ -- cgit v1.2.3 From 72433d3354ce4cdfad8c88f993364a76b192e3e5 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 9 Apr 2018 13:22:47 +0200 Subject: major speed boost --- src/gui/edgeitem.cpp | 40 +++++++++++++++++++++++++++------------- src/gui/edgeitem.h | 9 ++++++++- src/gui/tikzscene.cpp | 1 + 3 files changed, 36 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index f174186..ec87815 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -9,9 +9,6 @@ EdgeItem::EdgeItem(Edge *edge) _edge = edge; setFlag(QGraphicsItem::ItemIsSelectable); - QPen pen(Qt::black); - pen.setWidth(2); - setPen(pen); _cp1Item = new QGraphicsEllipseItem(this); _cp1Item->setParentItem(this); _cp1Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), @@ -53,7 +50,9 @@ void EdgeItem::readPos() void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { //QGraphicsPathItem::paint(painter, option, widget); - painter->setPen(pen()); + QPen pen(Qt::black); + pen.setWidth(2); + painter->setPen(pen); painter->setBrush(Qt::NoBrush); painter->drawPath(path()); @@ -107,19 +106,12 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge QRectF EdgeItem::boundingRect() const { - float r = GLOBAL_SCALEF * (_edge->cpDist() + 0.2); - return shape().boundingRect().adjusted(-r,-r,r,r); + return _boundingRect; } QPainterPath EdgeItem::shape() const { - // get the shape of the edge, and expand a bit to make selection easier - QPainterPath oldShape = QGraphicsPathItem::shape(); - QPainterPathStroker stroker; - stroker.setWidth(5); - stroker.setJoinStyle(Qt::MiterJoin); - QPainterPath newShape = (stroker.createStroke(oldShape) + oldShape).simplified(); - return newShape; + return _expPath; } Edge *EdgeItem::edge() const @@ -136,3 +128,25 @@ QGraphicsEllipseItem *EdgeItem::cp2Item() const { return _cp2Item; } + +QPainterPath EdgeItem::path() const +{ + return _path; +} + +void EdgeItem::setPath(const QPainterPath &path) +{ + _path = path; + + // get the shape of the edge, and expand a bit to make selection easier + QPainterPathStroker stroker; + stroker.setWidth(5); + stroker.setJoinStyle(Qt::MiterJoin); + _expPath = (stroker.createStroke(_path) + _path).simplified(); + + float r = GLOBAL_SCALEF * (_edge->cpDist() + 0.2); + _boundingRect = _path.boundingRect().adjusted(-r,-r,r,r); + + prepareGeometryChange(); + update(); +} diff --git a/src/gui/edgeitem.h b/src/gui/edgeitem.h index 3701372..5641912 100644 --- a/src/gui/edgeitem.h +++ b/src/gui/edgeitem.h @@ -14,7 +14,7 @@ #include #include -class EdgeItem : public QGraphicsPathItem +class EdgeItem : public QGraphicsItem { public: EdgeItem(Edge *edge); @@ -26,8 +26,15 @@ public: QGraphicsEllipseItem *cp1Item() const; QGraphicsEllipseItem *cp2Item() const; + + QPainterPath path() const; + void setPath(const QPainterPath &path); + private: Edge *_edge; + QPainterPath _path; + QPainterPath _expPath; + QRectF _boundingRect; QGraphicsEllipseItem *_cp1Item; QGraphicsEllipseItem *_cp2Item; }; diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index b26c4ba..927809e 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -84,6 +84,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (!_enabled) return; + // current mouse position, in scene coordinates _mouseDownPos = event->scenePos(); -- cgit v1.2.3 From 075a94d502020a7056dfa8fa1a4ba500378efe31 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 9 Apr 2018 13:24:12 +0200 Subject: bigger bezier handles --- src/gui/edgeitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index ec87815..08a5ad1 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -11,14 +11,14 @@ EdgeItem::EdgeItem(Edge *edge) _cp1Item = new QGraphicsEllipseItem(this); _cp1Item->setParentItem(this); - _cp1Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), - GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + _cp1Item->setRect(GLOBAL_SCALEF * (-0.1), GLOBAL_SCALEF * (-0.1), + GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); _cp1Item->setVisible(false); _cp2Item = new QGraphicsEllipseItem(this); _cp2Item->setParentItem(this); - _cp2Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), - GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + _cp2Item->setRect(GLOBAL_SCALEF * (-0.1), GLOBAL_SCALEF * (-0.1), + GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); _cp2Item->setVisible(false); readPos(); -- cgit v1.2.3 From 90061e2996b1f573a85edade35a995d25f0e660d Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Mon, 9 Apr 2018 14:50:22 +0200 Subject: comment out unused variable --- src/data/graph.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/data/graph.cpp b/src/data/graph.cpp index dec992f..4153bc0 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -69,7 +69,7 @@ int Graph::maxIntName() QRectF Graph::realBbox() { - float maxX = 0.0f; + //float maxX = 0.0f; QRectF rect = bbox(); foreach (Node *n, _nodes) { rect = rect.united(QRectF(n->point().x()-0.5f, @@ -253,5 +253,3 @@ void Graph::setBbox(const QRectF &bbox) { _bbox = bbox; } - - -- cgit v1.2.3 From 16890898289e32d4d0ba4641c55a5cae32eae6f2 Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Mon, 9 Apr 2018 14:51:00 +0200 Subject: Add default return --- src/gui/tikzscene.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 927809e..a8ff199 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -84,7 +84,6 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (!_enabled) return; - // current mouse position, in scene coordinates _mouseDownPos = event->scenePos(); @@ -498,6 +497,7 @@ int TikzScene::lineNumberForSelection() if (NodeItem *ni = dynamic_cast(gi)) return ni->node()->tikzLine(); if (EdgeItem *ei = dynamic_cast(gi)) return ei->edge()->tikzLine(); } + return 0; } -- cgit v1.2.3 From f144fbf42b9e8ff82b237a1be1fb0b906186795d Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Mon, 9 Apr 2018 15:23:46 +0200 Subject: Revert "bigger bezier handles" This reverts commit 075a94d502020a7056dfa8fa1a4ba500378efe31. --- src/gui/edgeitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 08a5ad1..ec87815 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -11,14 +11,14 @@ EdgeItem::EdgeItem(Edge *edge) _cp1Item = new QGraphicsEllipseItem(this); _cp1Item->setParentItem(this); - _cp1Item->setRect(GLOBAL_SCALEF * (-0.1), GLOBAL_SCALEF * (-0.1), - GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); + _cp1Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), + GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); _cp1Item->setVisible(false); _cp2Item = new QGraphicsEllipseItem(this); _cp2Item->setParentItem(this); - _cp2Item->setRect(GLOBAL_SCALEF * (-0.1), GLOBAL_SCALEF * (-0.1), - GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); + _cp2Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), + GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); _cp2Item->setVisible(false); readPos(); -- cgit v1.2.3 From 83a91bf9cc7fe3a379d8b0e5b63c653214851768 Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Mon, 9 Apr 2018 16:13:39 +0200 Subject: Remove calls to refreshSceneBounds --- src/gui/undocommands.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 4c5d0dc..6d3162c 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -11,14 +11,16 @@ GraphUpdateCommand::GraphUpdateCommand(TikzScene *scene, QUndoCommand *parent) : void GraphUpdateCommand::undo() { _scene->tikzDocument()->refreshTikz(); - _scene->refreshSceneBounds(); + //refreshSceneBounds does nothing + //_scene->refreshSceneBounds(); _scene->invalidate(); } void GraphUpdateCommand::redo() { _scene->tikzDocument()->refreshTikz(); - _scene->refreshSceneBounds(); + //refreshSceneBounds does nothing + //_scene->refreshSceneBounds(); _scene->invalidate(); } -- cgit v1.2.3 From 8b9fa72d80cde6dc54ea2105aa9295af733b643f Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Mon, 9 Apr 2018 16:14:17 +0200 Subject: Remove calls to refreshSceneBounds --- src/gui/tikzscene.cpp | 38 +++++++++++++++++++------------------- src/gui/tikzscene.h | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index a8ff199..f303fab 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -635,25 +635,25 @@ void TikzScene::reloadStyles() } } -void TikzScene::refreshSceneBounds() -{ -// if (!views().empty()) { -// QGraphicsView *v = views().first(); -// QRectF viewB = v->mapToScene(v->viewport()->rect()).boundingRect(); -// //QPointF tl = v->mapToScene(viewB.topLeft()); -// //viewB.setTopLeft(tl); - -// QRectF bounds = viewB.united(rectToScreen(graph()->realBbox().adjusted(-1.0f, -1.0f, 1.0f, 1.0f))); -// //qDebug() << viewB; - -// if (bounds != sceneRect()) { -// QPointF c = viewB.center(); -// setSceneRect(bounds); -// v->centerOn(c); -// } -// } - //setBounds(graphB); -} +// void TikzScene::refreshSceneBounds() +// { +// // if (!views().empty()) { +// // QGraphicsView *v = views().first(); +// // QRectF viewB = v->mapToScene(v->viewport()->rect()).boundingRect(); +// // //QPointF tl = v->mapToScene(viewB.topLeft()); +// // //viewB.setTopLeft(tl); +// +// // QRectF bounds = viewB.united(rectToScreen(graph()->realBbox().adjusted(-1.0f, -1.0f, 1.0f, 1.0f))); +// // //qDebug() << viewB; +// +// // if (bounds != sceneRect()) { +// // QPointF c = viewB.center(); +// // setSceneRect(bounds); +// // v->centerOn(c); +// // } +// // } +// //setBounds(graphB); +// } void TikzScene::refreshAdjacentEdges(QList nodes) { diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 3b4a1e1..fe1f784 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -36,7 +36,7 @@ public: TikzDocument *tikzDocument() const; void setTikzDocument(TikzDocument *tikzDocument); void reloadStyles(); - void refreshSceneBounds(); + //void refreshSceneBounds(); void applyActiveStyleToNodes(); void deleteSelectedItems(); void copyToClipboard(); -- cgit v1.2.3 From 86641371a35086e94e89d3ccc389a75c073a9312 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 10 Apr 2018 08:00:02 +0200 Subject: nudging --- src/data/graphelementdata.cpp | 2 +- src/data/graphelementdata.h | 2 +- src/gui/tikzscene.cpp | 66 ++++++++++++++++++++++++++++++++++++++----- src/gui/tikzscene.h | 1 + stylepalette.cpp | 24 ++++++++++++++++ stylepalette.h | 4 +++ 6 files changed, 90 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 63c8cea..01736b8 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -131,7 +131,7 @@ int GraphElementData::rowCount(const QModelIndex &parent) const } } -int GraphElementData::columnCount(const QModelIndex &parent) const +int GraphElementData::columnCount(const QModelIndex &) const { return 2; } diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index 319edf7..740d4dc 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -34,7 +34,7 @@ public: QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; - int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &) const Q_DECL_OVERRIDE; Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index f303fab..2a9b2fb 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -40,6 +40,9 @@ TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, pen.setDashPattern(dash); _rubberBandItem->setPen(pen); + QBrush brush(QColor::fromRgbF(0.6,0.6,0.8,0.2)); + _rubberBandItem->setBrush(brush); + _rubberBandItem->setVisible(false); addItem(_rubberBandItem); } @@ -427,6 +430,8 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) invalidate(QRect(), QGraphicsScene::BackgroundLayer); } + + void TikzScene::keyReleaseEvent(QKeyEvent *event) { if (!_enabled) return; @@ -452,19 +457,67 @@ void TikzScene::keyReleaseEvent(QKeyEvent *event) } } +void TikzScene::keyPressEvent(QKeyEvent *event) +{ + bool capture = false; + + if (event->key() == Qt::Key_QuoteLeft) { + capture = true; + _styles->nextStyle(); + } + + if (event->modifiers() & Qt::ControlModifier) { + QPointF delta(0,0); + float shift = (event->modifiers() & Qt::ShiftModifier) ? 1.0f : 10.0f; + switch(event->key()) { + case Qt::Key_Left: + delta.setX(-0.025f * shift); + break; + case Qt::Key_Right: + delta.setX(0.025f * shift); + break; + case Qt::Key_Up: + delta.setY(0.025f * shift); + break; + case Qt::Key_Down: + delta.setY(-0.025f * shift); + break; + } + + if (!delta.isNull()) { + capture = true; + QMap oldNodePositions; + QMap newNodePositions; + QPointF pos; + + foreach (QGraphicsItem *gi, selectedItems()) { + if (NodeItem *ni = dynamic_cast(gi)) { + pos = ni->node()->point(); + oldNodePositions.insert(ni->node(), pos); + newNodePositions.insert(ni->node(), pos + delta); + } + } + + MoveCommand *cmd = new MoveCommand(this, oldNodePositions, newNodePositions); + _tikzDocument->undoStack()->push(cmd); + } + } + + if (!capture) QGraphicsScene::keyPressEvent(event); +} + void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { if (!_enabled) return; QPointF mousePos = event->scenePos(); - foreach (QGraphicsItem *gi, items(mousePos)) { - if (EdgeItem *ei = dynamic_cast(gi)) { + auto sel = items(mousePos); + + if (!sel.isEmpty()) { + if (EdgeItem *ei = dynamic_cast(sel[0])) { ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge()); _tikzDocument->undoStack()->push(cmd); - break; - } - - if (NodeItem *ni = dynamic_cast(gi)) { + } else if (NodeItem *ni = dynamic_cast(sel[0])) { bool ok; QString newLabel = QInputDialog::getText(views()[0], tr("Node label"), tr("Label:"), QLineEdit::Normal, @@ -475,7 +528,6 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) ChangeLabelCommand *cmd = new ChangeLabelCommand(this, graph(), oldLabels, newLabel); _tikzDocument->undoStack()->push(cmd); } - break; } } } diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index fe1f784..634a848 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -57,6 +57,7 @@ protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; void keyReleaseEvent(QKeyEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; private: TikzDocument *_tikzDocument; diff --git a/stylepalette.cpp b/stylepalette.cpp index 1416cc3..c599750 100644 --- a/stylepalette.cpp +++ b/stylepalette.cpp @@ -61,6 +61,30 @@ void StylePalette::reloadStyles() } } +void StylePalette::changeStyle(int increment) +{ + QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); + int row = 0; + if (!i.isEmpty()) { + int row = (i[0].row()+increment)%_model->rowCount(); + if (row < 0) row += _model->rowCount(); + } + + QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); + ui->styleListView->selectionModel()->select(i1, QItemSelectionModel::ClearAndSelect); + ui->styleListView->scrollTo(i1); +} + +void StylePalette::nextStyle() +{ + changeStyle(1); +} + +void StylePalette::previousStyle() +{ + changeStyle(-1); +} + QString StylePalette::activeNodeStyleName() { const QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); diff --git a/stylepalette.h b/stylepalette.h index 8d2187e..a465034 100644 --- a/stylepalette.h +++ b/stylepalette.h @@ -16,6 +16,8 @@ public: explicit StylePalette(QWidget *parent = 0); ~StylePalette(); void reloadStyles(); + void nextStyle(); + void previousStyle(); QString activeNodeStyleName(); @@ -26,6 +28,8 @@ public slots: //void on_buttonApplyNodeStyle_clicked(); private: + void changeStyle(int increment); + Ui::StylePalette *ui; QStandardItemModel *_model; -- cgit v1.2.3 From 716db4a4951a4c6259ba6a1fa06e8228970e37b7 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 10 Apr 2018 08:00:28 +0200 Subject: Revert "Revert "bigger bezier handles"" This reverts commit f144fbf42b9e8ff82b237a1be1fb0b906186795d. --- src/gui/edgeitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index ec87815..08a5ad1 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -11,14 +11,14 @@ EdgeItem::EdgeItem(Edge *edge) _cp1Item = new QGraphicsEllipseItem(this); _cp1Item->setParentItem(this); - _cp1Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), - GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + _cp1Item->setRect(GLOBAL_SCALEF * (-0.1), GLOBAL_SCALEF * (-0.1), + GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); _cp1Item->setVisible(false); _cp2Item = new QGraphicsEllipseItem(this); _cp2Item->setParentItem(this); - _cp2Item->setRect(GLOBAL_SCALEF * (-0.05), GLOBAL_SCALEF * (-0.05), - GLOBAL_SCALEF * 0.1, GLOBAL_SCALEF * 0.1); + _cp2Item->setRect(GLOBAL_SCALEF * (-0.1), GLOBAL_SCALEF * (-0.1), + GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); _cp2Item->setVisible(false); readPos(); -- cgit v1.2.3 From eac7dee2d8ba86001afbc61c4e9d7baae7341cb8 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 10 Apr 2018 16:07:44 +0200 Subject: added edgestyles, but cant apply to nodes yet --- src/data/edgestyle.cpp | 109 ++++++++++++++++++++++++++++++++++ src/data/edgestyle.h | 38 ++++++++++++ src/data/nodestyle.cpp | 80 +++++-------------------- src/data/nodestyle.h | 21 ++----- src/data/style.cpp | 60 +++++++++++++++++++ src/data/style.h | 36 ++++++++++++ src/data/tikzlexer.l | 9 +-- src/data/tikzstyles.cpp | 27 +++++++-- src/data/tikzstyles.h | 4 ++ src/gui/stylepalette.cpp | 149 +++++++++++++++++++++++++++++++++++++++++++++++ src/gui/stylepalette.h | 42 +++++++++++++ src/gui/stylepalette.ui | 120 ++++++++++++++++++++++++++++++++++++++ src/gui/tikzscene.cpp | 2 +- src/gui/tikzview.cpp | 2 +- stylepalette.cpp | 126 --------------------------------------- stylepalette.h | 40 ------------- stylepalette.ui | 120 -------------------------------------- tikzit.pro | 18 +++--- 18 files changed, 619 insertions(+), 384 deletions(-) create mode 100644 src/data/edgestyle.cpp create mode 100644 src/data/edgestyle.h create mode 100644 src/data/style.cpp create mode 100644 src/data/style.h create mode 100644 src/gui/stylepalette.cpp create mode 100644 src/gui/stylepalette.h create mode 100644 src/gui/stylepalette.ui delete mode 100644 stylepalette.cpp delete mode 100644 stylepalette.h delete mode 100644 stylepalette.ui (limited to 'src') diff --git a/src/data/edgestyle.cpp b/src/data/edgestyle.cpp new file mode 100644 index 0000000..d366946 --- /dev/null +++ b/src/data/edgestyle.cpp @@ -0,0 +1,109 @@ +#include "edgestyle.h" + +#include +#include + +EdgeStyle *noneEdgeStyle = new EdgeStyle(); + +EdgeStyle::EdgeStyle() : Style() +{ +} + +EdgeStyle::EdgeStyle(QString name, GraphElementData *data) : Style(name, data) +{ +} + +EdgeStyle::ArrowTipStyle EdgeStyle::arrowHead() const +{ + if (_data == 0) return NoTip; + + if (_data->atom("->") || _data->atom("<->") || _data->atom("|->")) return Pointer; + if (_data->atom("-|") || _data->atom("<-|") || _data->atom("|-|")) return Flat; + return NoTip; +} + +EdgeStyle::ArrowTipStyle EdgeStyle::arrowTail() const +{ + if (_data == 0) return NoTip; + if (_data->atom("<-") || _data->atom("<->") || _data->atom("<-|")) return Pointer; + if (_data->atom("|-") || _data->atom("|->") || _data->atom("|-|")) return Flat; + return NoTip; +} + +EdgeStyle::DrawStyle EdgeStyle::drawStyle() const +{ + if (_data == 0) return Solid; + if (_data->atom("dashed")) return Dashed; + if (_data->atom("dotted")) return Dotted; + return Solid; +} + +QPen EdgeStyle::pen() const +{ + QPen p(strokeColor()); + p.setWidthF((float)strokeThickness() * 3.0f); + + QVector pat; + switch (drawStyle()) { + case Dashed: + pat << 3.0 << 3.0; + p.setDashPattern(pat); + break; + case Dotted: + pat << 1.0 << 1.0; + p.setDashPattern(pat); + break; + } + + return p; +} + +QPainterPath EdgeStyle::path() const +{ + return QPainterPath(); +} + +QPainterPath EdgeStyle::palettePath() const +{ + return QPainterPath(); +} + +QIcon EdgeStyle::icon() const +{ + // draw an icon matching the style + QPixmap px(100,100); + px.fill(Qt::transparent); + QPainter painter(&px); + + if (_data == 0) { + QPen pen(Qt::black); + pen.setWidth(3); + } else { + painter.setPen(pen()); + } + + painter.drawLine(10, 50, 90, 50); + + switch (arrowHead()) { + case Pointer: + painter.drawLine(90,50,80,40); + painter.drawLine(90,50,80,60); + break; + case Flat: + painter.drawLine(90,40,90,60); + break; + } + + switch (arrowTail()) { + case Pointer: + painter.drawLine(10,50,20,40); + painter.drawLine(10,50,20,60); + break; + case Flat: + painter.drawLine(10,40,10,60); + break; + } + + + return QIcon(px); +} diff --git a/src/data/edgestyle.h b/src/data/edgestyle.h new file mode 100644 index 0000000..6b0c3bb --- /dev/null +++ b/src/data/edgestyle.h @@ -0,0 +1,38 @@ +#ifndef EDGESTYLE_H +#define EDGESTYLE_H + +#include "style.h" + +#include +#include +#include +#include +#include + +class EdgeStyle : public Style +{ +public: + EdgeStyle(); + EdgeStyle(QString name, GraphElementData *data); + + enum ArrowTipStyle { + Flat, Pointer, NoTip + }; + + enum DrawStyle { + Solid, Dotted, Dashed + }; + + ArrowTipStyle arrowHead() const; + ArrowTipStyle arrowTail() const; + DrawStyle drawStyle() const; + + QPen pen() const; + QPainterPath path() const override; + QPainterPath palettePath() const override; + QIcon icon() const override; +}; + +extern EdgeStyle *noneEdgeStyle; + +#endif // EDGESTYLE_H diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index b3d72fb..3f2c921 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -3,91 +3,43 @@ NodeStyle *noneStyle = new NodeStyle(); -NodeStyle::NodeStyle() : _name("none"), _data(0) +NodeStyle::NodeStyle() : Style() { } -NodeStyle::NodeStyle(QString name, GraphElementData *data): _name(name), _data(data) +NodeStyle::NodeStyle(QString name, GraphElementData *data): Style(name, data) { } -bool NodeStyle::isNone() { return _data == 0; } - -GraphElementData *NodeStyle::data() const -{ - return _data; -} - -QString NodeStyle::name() const -{ - return _name; -} - -NodeStyle::Shape NodeStyle::shape() const -{ - if (_data == 0) return NodeStyle::Circle; - - QString sh = _data->property("shape"); - if (sh.isNull()) return NodeStyle::Circle; - else if (sh == "circle") return NodeStyle::Circle; - else if (sh == "rectangle") return NodeStyle::Rectangle; - else return NodeStyle::Circle; -} - QColor NodeStyle::fillColor() const { if (_data == 0) return Qt::white; - QString col = _data->property("fill"); - - if (col.isNull()) { - return QColor(Qt::white); - } else { - QColor namedColor(col); - if (namedColor.isValid()) { - return namedColor; - } else { - // TODO: read RGB colors - return QColor(Qt::white); - } - } -} - -QColor NodeStyle::strokeColor() const -{ - if (_data == 0) return Qt::black; + QString col = propertyWithDefault("fill", "white"); - QString col = _data->property("draw"); - - if (col.isNull()) { - return QColor(Qt::black); + QColor namedColor(col); + if (namedColor.isValid()) { + return namedColor; } else { - QColor namedColor(col); - if (namedColor.isValid()) { - return namedColor; - } else { - // TODO: read RGB colors - return QColor(Qt::white); - } + // TODO: read RGB colors + return QColor(Qt::white); } } -int NodeStyle::strokeThickness() const +QBrush NodeStyle::brush() const { - return 1; + return QBrush(fillColor()); } -QPen NodeStyle::pen() const +NodeStyle::Shape NodeStyle::shape() const { - QPen p(strokeColor()); - p.setWidthF((float)strokeThickness() * 3.0f); - return p; -} + if (_data == 0) return NodeStyle::Circle; -QBrush NodeStyle::brush() const -{ - return QBrush(fillColor()); + QString sh = propertyWithDefault("shape", "circle"); + if (sh == "circle") return NodeStyle::Circle; + else if (sh == "rectangle") return NodeStyle::Rectangle; + else return NodeStyle::Circle; } QPainterPath NodeStyle::path() const diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index 0b9f282..4b48bb3 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -1,7 +1,7 @@ #ifndef NODESTYLE_H #define NODESTYLE_H -#include "graphelementdata.h" +#include "style.h" #include #include @@ -9,7 +9,7 @@ #include #include -class NodeStyle +class NodeStyle : public Style { public: enum Shape { @@ -18,23 +18,14 @@ public: NodeStyle(); NodeStyle(QString name, GraphElementData *data); - bool isNone(); - GraphElementData *data() const; - QString name() const; - Shape shape() const; QColor fillColor() const; - QColor strokeColor() const; - int strokeThickness() const; - - QPen pen() const; QBrush brush() const; QPainterPath path() const; - QPainterPath palettePath() const; - QIcon icon() const; -private: - QString _name; - GraphElementData *_data; + Shape shape() const; + + QPainterPath palettePath() const override; + QIcon icon() const override; }; extern NodeStyle *noneStyle; diff --git a/src/data/style.cpp b/src/data/style.cpp new file mode 100644 index 0000000..927271c --- /dev/null +++ b/src/data/style.cpp @@ -0,0 +1,60 @@ +#include "style.h" + +Style::Style() : _name("none"), _data(0) +{ +} + +Style::Style(QString name, GraphElementData *data) : _name(name), _data(data) +{ +} + +bool Style::isNone() +{ + return _data == 0; +} + +GraphElementData *Style::data() const +{ + return _data; +} + +QString Style::name() const +{ + return _name; +} + +QColor Style::strokeColor() const +{ + if (_data == 0) return Qt::black; + + QString col = propertyWithDefault("draw", "black"); + + QColor namedColor(col); + if (namedColor.isValid()) { + return namedColor; + } else { + // TODO: read RGB colors + return QColor(Qt::black); + } +} + +// TODO +int Style::strokeThickness() const +{ + return 1; +} + +QPen Style::pen() const +{ + QPen p(strokeColor()); + p.setWidthF((float)strokeThickness() * 3.0f); + return p; +} + +QString Style::propertyWithDefault(QString prop, QString def) const +{ + QString val = _data->property("tikzit " + prop); + if (val.isNull()) val = _data->property(prop); + if (val.isNull()) val = def; + return val; +} diff --git a/src/data/style.h b/src/data/style.h new file mode 100644 index 0000000..9d58ebe --- /dev/null +++ b/src/data/style.h @@ -0,0 +1,36 @@ +#ifndef STYLE_H +#define STYLE_H + + +#include "graphelementdata.h" + +#include +#include +#include +#include +#include + +class Style +{ +public: + Style(); + Style(QString name, GraphElementData *data); + bool isNone(); + + // properties that both edges and nodes have + GraphElementData *data() const; + QString name() const; + QColor strokeColor() const; + int strokeThickness() const; + + // methods that are implemented differently for edges and nodes + virtual QPen pen() const; + virtual QPainterPath path() const = 0; + virtual QPainterPath palettePath() const = 0; + virtual QIcon icon() const = 0; +protected: + QString propertyWithDefault(QString prop, QString def) const; + QString _name; + GraphElementData *_data; +}; +#endif // STYLE_H diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index d90ad4b..45494d2 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -65,6 +65,7 @@ FLOAT \-?[0-9]*(\.[0-9]+)? yylloc->first_column = yylloc->last_column = 0; } [\t ]+ { } +%.*$ { } \\begin\{tikzpicture\} { return BEGIN_TIKZPICTURE_CMD; } \\end\{tikzpicture\} { return END_TIKZPICTURE_CMD; } @@ -74,12 +75,12 @@ FLOAT \-?[0-9]*(\.[0-9]+)? \\draw { return DRAW_CMD; } \\node { return NODE_CMD; } \\path { return PATH_CMD; } -rectangle { return RECTANGLE; } -node { return NODE; } -at { return AT; } -to { return TO; } ; { return SEMICOLON; } = { return EQUALS; } +rectangle { return RECTANGLE; } +node { return NODE; } +at { return AT; } +to { return TO; } \([ ]*{FLOAT}[ ]*,[ ]*{FLOAT}[ ]*\) { yylloc->last_column = yylloc->first_column + 1; diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp index 186e19b..c198412 100644 --- a/src/data/tikzstyles.cpp +++ b/src/data/tikzstyles.cpp @@ -12,7 +12,14 @@ NodeStyle *TikzStyles::nodeStyle(QString name) const { foreach (NodeStyle *s , _nodeStyles) if (s->name() == name) return s; - return noneStyle; //NodeStyle(name, NodeShape::Circle, Qt::white); + return noneStyle; +} + +EdgeStyle *TikzStyles::edgeStyle(QString name) const +{ + foreach (EdgeStyle *s , _edgeStyles) + if (s->name() == name) return s; + return noneEdgeStyle; } QVector TikzStyles::nodeStyles() const @@ -23,14 +30,24 @@ QVector TikzStyles::nodeStyles() const void TikzStyles::clear() { _nodeStyles.clear(); + _edgeStyles.clear(); +} + +QVector TikzStyles::edgeStyles() const +{ + return _edgeStyles; } void TikzStyles::addStyle(QString name, GraphElementData *data) { - //qDebug() << "got style {" << name << "} = [" << data << "]"; - if (!data->property("fill").isNull()) { // node style + if (data->atom("-") || data->atom("->") || data->atom("-|") || + data->atom("<-") || data->atom("<->") || data->atom("<-|") || + data->atom("|-") || data->atom("|->") || data->atom("|-|")) + { // edge style + qDebug() << "got edge style" << name; + _edgeStyles << new EdgeStyle(name, data); + } else { // node style + qDebug() << "got node style" << name; _nodeStyles << new NodeStyle(name, data); - } else { // edge style - // TODO: edge styles } } diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h index eaf7e64..4cd7d6e 100644 --- a/src/data/tikzstyles.h +++ b/src/data/tikzstyles.h @@ -3,6 +3,7 @@ #include "graphelementdata.h" #include "nodestyle.h" +#include "edgestyle.h" #include #include @@ -15,7 +16,9 @@ public: void addStyle(QString name, GraphElementData *data); NodeStyle *nodeStyle(QString name) const; + EdgeStyle *edgeStyle(QString name) const; QVector nodeStyles() const; + QVector edgeStyles() const; void clear(); signals: @@ -24,6 +27,7 @@ public slots: private: QVector _nodeStyles; + QVector _edgeStyles; }; #endif // PROJECT_H diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp new file mode 100644 index 0000000..f7c17c0 --- /dev/null +++ b/src/gui/stylepalette.cpp @@ -0,0 +1,149 @@ +#include "stylepalette.h" +#include "ui_stylepalette.h" +#include "tikzit.h" + +#include +#include +#include +#include +#include +#include +#include + +StylePalette::StylePalette(QWidget *parent) : + QDockWidget(parent), + ui(new Ui::StylePalette) +{ + ui->setupUi(this); + +// QSettings settings("tikzit", "tikzit"); +// QVariant geom = settings.value("style-palette-geometry"); +// if (geom != QVariant()) { +// restoreGeometry(geom.toByteArray()); +// } + + _nodeModel = new QStandardItemModel(this); + _edgeModel = new QStandardItemModel(this); + + ui->styleListView->setModel(_nodeModel); + ui->styleListView->setViewMode(QListView::IconMode); + ui->styleListView->setMovement(QListView::Static); + ui->styleListView->setGridSize(QSize(70,40)); + + ui->edgeStyleListView->setModel(_edgeModel); + ui->edgeStyleListView->setViewMode(QListView::IconMode); + ui->edgeStyleListView->setMovement(QListView::Static); + ui->edgeStyleListView->setGridSize(QSize(70,40)); + + reloadStyles(); + + connect(ui->styleListView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT( nodeStyleDoubleClicked(const QModelIndex&)) ); +} + +StylePalette::~StylePalette() +{ + delete ui; +} + +void StylePalette::reloadStyles() +{ + _nodeModel->clear(); + _edgeModel->clear(); + QString f = tikzit->styleFile(); + ui->styleFile->setText(f); + + QStandardItem *it; + + it = new QStandardItem(noneStyle->icon(), noneStyle->name()); + it->setEditable(false); + it->setData(noneStyle->name()); + _nodeModel->appendRow(it); + + foreach(NodeStyle *ns, tikzit->styles()->nodeStyles()) { + it = new QStandardItem(ns->icon(), ns->name()); + it->setEditable(false); + it->setData(ns->name()); + _nodeModel->appendRow(it); + } + + it = new QStandardItem(noneEdgeStyle->icon(), noneEdgeStyle->name()); + it->setEditable(false); + it->setData(noneEdgeStyle->name()); + _edgeModel->appendRow(it); + + foreach(EdgeStyle *es, tikzit->styles()->edgeStyles()) { + it = new QStandardItem(es->icon(), es->name()); + it->setEditable(false); + it->setData(es->name()); + _edgeModel->appendRow(it); + } +} + +void StylePalette::changeNodeStyle(int increment) +{ + QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); + int row = 0; + if (!i.isEmpty()) { + int row = (i[0].row()+increment)%_nodeModel->rowCount(); + if (row < 0) row += _nodeModel->rowCount(); + } + + QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); + ui->styleListView->selectionModel()->select(i1, QItemSelectionModel::ClearAndSelect); + ui->styleListView->scrollTo(i1); +} + +void StylePalette::nextNodeStyle() +{ + changeNodeStyle(1); +} + +void StylePalette::previousNodeStyle() +{ + changeNodeStyle(-1); +} + +QString StylePalette::activeNodeStyleName() +{ + const QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); + + if (i.isEmpty()) { + return "none"; + } else { + return i[0].data().toString(); + } +} + +void StylePalette::nodeStyleDoubleClicked(const QModelIndex &index) +{ + tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); +} + +void StylePalette::edgeStyleDoubleClicked(const QModelIndex &index) +{ + // TODO +} + +void StylePalette::on_buttonOpenTikzstyles_clicked() +{ + tikzit->openTikzStyles(); +} + +void StylePalette::on_buttonRefreshTikzstyles_clicked() +{ + QSettings settings("tikzit", "tikzit"); + QString path = settings.value("previous-tikzstyles-file").toString(); + if (!path.isEmpty()) tikzit->loadStyles(path); +} + +//void StylePalette::on_buttonApplyNodeStyle_clicked() +//{ +// if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); +//} + +void StylePalette::closeEvent(QCloseEvent *event) +{ + QSettings settings("tikzit", "tikzit"); + settings.setValue("style-palette-geometry", saveGeometry()); + QDockWidget::closeEvent(event); +} diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h new file mode 100644 index 0000000..8663cc4 --- /dev/null +++ b/src/gui/stylepalette.h @@ -0,0 +1,42 @@ +#ifndef STYLEPALETTE_H +#define STYLEPALETTE_H + +#include +#include + +namespace Ui { +class StylePalette; +} + +class StylePalette : public QDockWidget +{ + Q_OBJECT + +public: + explicit StylePalette(QWidget *parent = 0); + ~StylePalette(); + void reloadStyles(); + void nextNodeStyle(); + void previousNodeStyle(); + QString activeNodeStyleName(); + + +public slots: + void nodeStyleDoubleClicked(const QModelIndex &index); + void edgeStyleDoubleClicked(const QModelIndex &index); + void on_buttonOpenTikzstyles_clicked(); + void on_buttonRefreshTikzstyles_clicked(); + //void on_buttonApplyNodeStyle_clicked(); + +private: + void changeNodeStyle(int increment); + + Ui::StylePalette *ui; + QStandardItemModel *_nodeModel; + QStandardItemModel *_edgeModel; + +protected: + void closeEvent(QCloseEvent *event) override; +}; + +#endif // STYLEPALETTE_H diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui new file mode 100644 index 0000000..4f5b58d --- /dev/null +++ b/src/gui/stylepalette.ui @@ -0,0 +1,120 @@ + + + StylePalette + + + + 0 + 0 + 88 + 518 + + + + + 0 + 0 + + + + + 88 + 191 + + + + + 88 + 524287 + + + + false + + + + + + + + + + 2 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + New Project + + + + + + + :/images/document-open.svg:/images/document-open.svg + + + + + + + + + + + :/images/refresh.svg:/images/refresh.svg + + + + + + + + + + 0 + 0 + + + + [default] + + + + + + + + 8 + true + + + + + + + + + + + + + + + diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 2a9b2fb..9b6c2d6 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -463,7 +463,7 @@ void TikzScene::keyPressEvent(QKeyEvent *event) if (event->key() == Qt::Key_QuoteLeft) { capture = true; - _styles->nextStyle(); + _styles->nextNodeStyle(); } if (event->modifiers() & Qt::ControlModifier) { diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 047ef50..9997106 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -6,7 +6,7 @@ TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) { - //setRenderHint(QPainter::Antialiasing); + setRenderHint(QPainter::Antialiasing); //setDragMode(QGraphicsView::RubberBandDrag); _scale = 1.0f; diff --git a/stylepalette.cpp b/stylepalette.cpp deleted file mode 100644 index c599750..0000000 --- a/stylepalette.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include "stylepalette.h" -#include "ui_stylepalette.h" -#include "tikzit.h" - -#include -#include -#include -#include -#include -#include -#include - -StylePalette::StylePalette(QWidget *parent) : - QDockWidget(parent), - ui(new Ui::StylePalette) -{ - ui->setupUi(this); - -// QSettings settings("tikzit", "tikzit"); -// QVariant geom = settings.value("style-palette-geometry"); -// if (geom != QVariant()) { -// restoreGeometry(geom.toByteArray()); -// } - - _model = new QStandardItemModel(this); - ui->styleListView->setModel(_model); - ui->styleListView->setViewMode(QListView::IconMode); - ui->styleListView->setMovement(QListView::Static); - ui->styleListView->setGridSize(QSize(70,40)); - - reloadStyles(); - - connect(ui->styleListView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT( itemDoubleClicked(const QModelIndex&)) ); -} - -StylePalette::~StylePalette() -{ - delete ui; -} - -void StylePalette::reloadStyles() -{ - _model->clear(); - QString f = tikzit->styleFile(); - // - ui->styleFile->setText(f); - - QStandardItem *it; - //QSize sz(60,60); - - it = new QStandardItem(noneStyle->icon(), noneStyle->name()); - it->setEditable(false); - it->setData(noneStyle->name()); - _model->appendRow(it); - - foreach(NodeStyle *ns, tikzit->styles()->nodeStyles()) { - it = new QStandardItem(ns->icon(), ns->name()); - it->setEditable(false); - it->setData(ns->name()); - _model->appendRow(it); - } -} - -void StylePalette::changeStyle(int increment) -{ - QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); - int row = 0; - if (!i.isEmpty()) { - int row = (i[0].row()+increment)%_model->rowCount(); - if (row < 0) row += _model->rowCount(); - } - - QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); - ui->styleListView->selectionModel()->select(i1, QItemSelectionModel::ClearAndSelect); - ui->styleListView->scrollTo(i1); -} - -void StylePalette::nextStyle() -{ - changeStyle(1); -} - -void StylePalette::previousStyle() -{ - changeStyle(-1); -} - -QString StylePalette::activeNodeStyleName() -{ - const QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); - - if (i.isEmpty()) { - return "none"; - } else { - return i[0].data().toString(); - } -} - -void StylePalette::itemDoubleClicked(const QModelIndex &index) -{ - tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); -} - -void StylePalette::on_buttonOpenTikzstyles_clicked() -{ - tikzit->openTikzStyles(); -} - -void StylePalette::on_buttonRefreshTikzstyles_clicked() -{ - QSettings settings("tikzit", "tikzit"); - QString path = settings.value("previous-tikzstyles-file").toString(); - if (!path.isEmpty()) tikzit->loadStyles(path); -} - -//void StylePalette::on_buttonApplyNodeStyle_clicked() -//{ -// if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); -//} - -void StylePalette::closeEvent(QCloseEvent *event) -{ - QSettings settings("tikzit", "tikzit"); - settings.setValue("style-palette-geometry", saveGeometry()); - QDockWidget::closeEvent(event); -} diff --git a/stylepalette.h b/stylepalette.h deleted file mode 100644 index a465034..0000000 --- a/stylepalette.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef STYLEPALETTE_H -#define STYLEPALETTE_H - -#include -#include - -namespace Ui { -class StylePalette; -} - -class StylePalette : public QDockWidget -{ - Q_OBJECT - -public: - explicit StylePalette(QWidget *parent = 0); - ~StylePalette(); - void reloadStyles(); - void nextStyle(); - void previousStyle(); - QString activeNodeStyleName(); - - -public slots: - void itemDoubleClicked(const QModelIndex &index); - void on_buttonOpenTikzstyles_clicked(); - void on_buttonRefreshTikzstyles_clicked(); - //void on_buttonApplyNodeStyle_clicked(); - -private: - void changeStyle(int increment); - - Ui::StylePalette *ui; - QStandardItemModel *_model; - -protected: - void closeEvent(QCloseEvent *event) override; -}; - -#endif // STYLEPALETTE_H diff --git a/stylepalette.ui b/stylepalette.ui deleted file mode 100644 index 3362ce2..0000000 --- a/stylepalette.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - StylePalette - - - - 0 - 0 - 88 - 518 - - - - - 0 - 0 - - - - - 88 - 0 - - - - - 88 - 524287 - - - - false - - - - - - - - - - 2 - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - New Project - - - - - - - :/images/document-open.svg:/images/document-open.svg - - - - - - - - - - - :/images/refresh.svg:/images/refresh.svg - - - - - - - - - - 0 - 0 - - - - [default] - - - - - - - - 8 - true - - - - - - - - - - - - - - - diff --git a/tikzit.pro b/tikzit.pro index 673730b..33a9ef3 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -4,11 +4,9 @@ # #------------------------------------------------- -QT += core gui +QT += core gui widgets CONFIG += testcase -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - TARGET = tikzit TEMPLATE = app @@ -48,9 +46,11 @@ SOURCES += src/gui/mainwindow.cpp \ src/gui/undocommands.cpp \ src/gui/mainmenu.cpp \ src/util.cpp \ - stylepalette.cpp \ + src/gui/stylepalette.cpp \ src/data/tikzassembler.cpp \ - src/data/tikzstyles.cpp + src/data/tikzstyles.cpp \ + src/data/edgestyle.cpp \ + src/data/style.cpp HEADERS += src/gui/mainwindow.h \ src/gui/toolpalette.h \ @@ -72,14 +72,16 @@ HEADERS += src/gui/mainwindow.h \ src/gui/undocommands.h \ src/gui/mainmenu.h \ src/util.h \ - stylepalette.h \ + src/gui/stylepalette.h \ src/data/tikzassembler.h \ - src/data/tikzstyles.h + src/data/tikzstyles.h \ + src/data/edgestyle.h \ + src/data/style.h FORMS += src/gui/mainwindow.ui \ src/gui/propertypalette.ui \ src/gui/mainmenu.ui \ - stylepalette.ui + src/gui/stylepalette.ui INCLUDEPATH += src src/gui src/data -- cgit v1.2.3 From 10d739ce2ac904501a6f78b127f91c944a774a18 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 15 Apr 2018 11:19:38 +0300 Subject: added icon and fixed edge handle bug --- images/logo.ico | Bin 0 -> 14347 bytes src/gui/tikzscene.cpp | 11 ++++++----- tikzit.pro | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 images/logo.ico (limited to 'src') diff --git a/images/logo.ico b/images/logo.ico new file mode 100644 index 0000000..ef92c90 Binary files /dev/null and b/images/logo.ico differ diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 9b6c2d6..345d02c 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -97,7 +97,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) //views()[0]->setDragMode(QGraphicsView::NoDrag); // radius of a control point for bezier edges, in scene coordinates - qreal cpR = GLOBAL_SCALEF * (0.05); + qreal cpR = GLOBAL_SCALEF * (0.1); qreal cpR2 = cpR * cpR; switch (_tools->currentTool()) { @@ -511,13 +511,13 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) if (!_enabled) return; QPointF mousePos = event->scenePos(); - auto sel = items(mousePos); - if (!sel.isEmpty()) { - if (EdgeItem *ei = dynamic_cast(sel[0])) { + foreach (QGraphicsItem *it, items(mousePos)) { + if (EdgeItem *ei = dynamic_cast(it)) { ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge()); _tikzDocument->undoStack()->push(cmd); - } else if (NodeItem *ni = dynamic_cast(sel[0])) { + break; + } else if (NodeItem *ni = dynamic_cast(it)) { bool ok; QString newLabel = QInputDialog::getText(views()[0], tr("Node label"), tr("Label:"), QLineEdit::Normal, @@ -528,6 +528,7 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) ChangeLabelCommand *cmd = new ChangeLabelCommand(this, graph(), oldLabels, newLabel); _tikzDocument->undoStack()->push(cmd); } + break; } } } diff --git a/tikzit.pro b/tikzit.pro index 33a9ef3..c30d173 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -10,6 +10,8 @@ CONFIG += testcase TARGET = tikzit TEMPLATE = app +win32:RC_ICONS += images/logo.ico + # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the -- cgit v1.2.3 From 34b60b77d3f9830ddb6a0107bd65aa3c79701305 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 15 Apr 2018 12:11:19 +0300 Subject: fixed crash on paste --- src/gui/tikzscene.h | 7 ++++--- src/gui/undocommands.cpp | 5 +++-- src/gui/undocommands.h | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 634a848..9d90c4f 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -49,6 +49,10 @@ public: void setEnabled(bool enabled); int lineNumberForSelection(); + + void getSelection(QSet &selNodes, QSet &selEdges); + QSet getSelectedNodes(); + public slots: void graphReplaced(); @@ -80,9 +84,6 @@ private: int _oldInAngle; int _oldOutAngle; bool _enabled; - - void getSelection(QSet &selNodes, QSet &selEdges); - QSet getSelectedNodes(); }; #endif // TIKZSCENE_H diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 6d3162c..daa2fee 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -279,7 +279,7 @@ void ApplyStyleToNodesCommand::redo() PasteCommand::PasteCommand(TikzScene *scene, Graph *graph, QUndoCommand *parent) : GraphUpdateCommand(scene, parent), _graph(graph) { - _oldSelection = scene->selectedItems(); + scene->getSelection(_oldSelectedNodes, _oldSelectedEdges); } void PasteCommand::undo() @@ -304,7 +304,8 @@ void PasteCommand::undo() _scene->graph()->removeNode(n); } - foreach (auto it, _oldSelection) it->setSelected(true); + foreach(Node *n, _oldSelectedNodes) _scene->nodeItems()[n]->setSelected(true); + foreach(Edge *e, _oldSelectedEdges) _scene->edgeItems()[e]->setSelected(true); GraphUpdateCommand::undo(); } diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index a0abb26..3f74afb 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -13,6 +13,7 @@ #include "tikzscene.h" #include +#include class GraphUpdateCommand : public QUndoCommand { public: @@ -127,7 +128,8 @@ public: void redo() override; private: Graph *_graph; - QList _oldSelection; + QSet _oldSelectedNodes; + QSet _oldSelectedEdges; }; class ChangeLabelCommand : public GraphUpdateCommand -- cgit v1.2.3 From 8ac7248513189d82fe5bdf90c0d7fc15f2e718ce Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 17 Apr 2018 11:03:24 +0300 Subject: fixed bounding box bug --- images/tikzdoc.ico | Bin 0 -> 310308 bytes images/tikzit.ico | Bin 0 -> 322831 bytes src/gui/edgeitem.cpp | 5 +++-- src/gui/nodeitem.cpp | 46 +++++++++++++++++++++++++++++++--------------- src/gui/nodeitem.h | 7 ++++--- src/gui/tikzscene.cpp | 30 ++++++++++++++++++++---------- src/gui/undocommands.cpp | 4 ++++ src/main.cpp | 5 +++++ src/tikzit.cpp | 34 ++++++++++++++++++++-------------- src/tikzit.h | 1 + tikzit.pro | 3 ++- 11 files changed, 90 insertions(+), 45 deletions(-) create mode 100644 images/tikzdoc.ico create mode 100644 images/tikzit.ico (limited to 'src') diff --git a/images/tikzdoc.ico b/images/tikzdoc.ico new file mode 100644 index 0000000..ccb1666 Binary files /dev/null and b/images/tikzdoc.ico differ diff --git a/images/tikzit.ico b/images/tikzit.ico new file mode 100644 index 0000000..e49d469 Binary files /dev/null and b/images/tikzit.ico differ diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 08a5ad1..88a4e85 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -136,7 +136,9 @@ QPainterPath EdgeItem::path() const void EdgeItem::setPath(const QPainterPath &path) { - _path = path; + prepareGeometryChange(); + + _path = path; // get the shape of the edge, and expand a bit to make selection easier QPainterPathStroker stroker; @@ -147,6 +149,5 @@ void EdgeItem::setPath(const QPainterPath &path) float r = GLOBAL_SCALEF * (_edge->cpDist() + 0.2); _boundingRect = _path.boundingRect().adjusted(-r,-r,r,r); - prepareGeometryChange(); update(); } diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 06b46ff..b0b7ea6 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -18,6 +18,7 @@ NodeItem::NodeItem(Node *node) //setFlag(QGraphicsItem::ItemIsMovable); //setFlag(QGraphicsItem::ItemSendsGeometryChanges); readPos(); + updateBounds(); } void NodeItem::readPos() @@ -98,27 +99,42 @@ QPainterPath NodeItem::shape() const return path; } +// TODO: nodeitem should sync boundingRect()-relevant stuff (label etc) explicitly, +// to allow prepareGeometryChange() QRectF NodeItem::boundingRect() const { - QRectF r = labelRect(); - return r.united(shape().boundingRect()).adjusted(-4,-4,4,4); + return _boundingRect; } -Node *NodeItem::node() const +void NodeItem::updateBounds() { - return _node; + prepareGeometryChange(); + QString label = _node->label(); + if (label != "") { + QFontMetrics fm(Tikzit::LABEL_FONT); + QRectF labelRect = fm.boundingRect(label); + labelRect.moveCenter(QPointF(0, 0)); + _boundingRect = labelRect.united(shape().boundingRect()).adjusted(-4, -4, 4, 4); + } else { + _boundingRect = shape().boundingRect().adjusted(-4, -4, 4, 4); + } } -QVariant NodeItem::itemChange(GraphicsItemChange change, const QVariant &value) +Node *NodeItem::node() const { - if (change == ItemPositionChange) { - QPointF newPos = value.toPointF(); - int gridSize = GLOBAL_SCALE / 8; - QPointF gridPos(round(newPos.x()/gridSize)*gridSize, round(newPos.y()/gridSize)*gridSize); - _node->setPoint(fromScreen(gridPos)); - - return gridPos; - } else { - return QGraphicsItem::itemChange(change, value); - } + return _node; } + +//QVariant NodeItem::itemChange(GraphicsItemChange change, const QVariant &value) +//{ +// if (change == ItemPositionChange) { +// QPointF newPos = value.toPointF(); +// int gridSize = GLOBAL_SCALE / 8; +// QPointF gridPos(round(newPos.x()/gridSize)*gridSize, round(newPos.y()/gridSize)*gridSize); +// _node->setPoint(fromScreen(gridPos)); +// +// return gridPos; +// } else { +// return QGraphicsItem::itemChange(change, value); +// } +//} diff --git a/src/gui/nodeitem.h b/src/gui/nodeitem.h index eb3fbb3..91b3f63 100644 --- a/src/gui/nodeitem.h +++ b/src/gui/nodeitem.h @@ -19,14 +19,15 @@ public: void readPos(); void writePos(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); - QVariant itemChange(GraphicsItemChange change, const QVariant &value); - QPainterPath shape() const; - QRectF boundingRect() const; + QPainterPath shape() const override; + QRectF boundingRect() const override; + void updateBounds(); Node *node() const; private: Node *_node; QRectF labelRect() const; + QRectF _boundingRect; }; #endif // NODEITEM_H diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 345d02c..40d56e7 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -57,15 +57,16 @@ Graph *TikzScene::graph() void TikzScene::graphReplaced() { - foreach (NodeItem *ni, _nodeItems) { + + foreach (NodeItem *ni, _nodeItems) { removeItem(ni); - delete ni; + //delete ni; } _nodeItems.clear(); foreach (EdgeItem *ei, _edgeItems) { removeItem(ei); - delete ei; + //delete ei; } _edgeItems.clear(); @@ -287,8 +288,12 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) foreach (Node *n, _oldNodePositions.keys()) { NodeItem *ni = _nodeItems[n]; - ni->setPos(toScreen(_oldNodePositions[n]) + shift); - ni->writePos(); + + // in (rare) cases, the graph can change while we are dragging + if (ni != 0) { + ni->setPos(toScreen(_oldNodePositions[n]) + shift); + ni->writePos(); + } } refreshAdjacentEdges(_oldNodePositions.keys()); @@ -711,11 +716,16 @@ void TikzScene::reloadStyles() void TikzScene::refreshAdjacentEdges(QList nodes) { if (nodes.empty()) return; - foreach (EdgeItem *ei, _edgeItems) { - if (nodes.contains(ei->edge()->source()) || nodes.contains(ei->edge()->target())) { - ei->edge()->updateControls(); - ei->readPos(); - } + foreach (Edge *e, _edgeItems.keys()) { + EdgeItem *ei = _edgeItems[e]; + + // the list "nodes" can be out of date, e.g. if the graph changes while dragging + if (ei != 0) { + if (nodes.contains(ei->edge()->source()) || nodes.contains(ei->edge()->target())) { + ei->edge()->updateControls(); + ei->readPos(); + } + } } } diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index daa2fee..baa8c0e 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -341,6 +341,8 @@ void ChangeLabelCommand::undo() { foreach (Node *n, _oldLabels.keys()) { n->setLabel(_oldLabels[n]); + NodeItem *ni = _scene->nodeItems()[n]; + if (ni != 0) ni->updateBounds(); } GraphUpdateCommand::undo(); @@ -350,6 +352,8 @@ void ChangeLabelCommand::redo() { foreach (Node *n, _oldLabels.keys()) { n->setLabel(_newLabel); + NodeItem *ni = _scene->nodeItems()[n]; + if (ni != 0) ni->updateBounds(); } GraphUpdateCommand::redo(); diff --git a/src/main.cpp b/src/main.cpp index b15840d..3532888 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,5 +20,10 @@ int main(int argc, char *argv[]) a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); tikzit->init(&a); + + if (a.arguments().length() > 1) { + tikzit->open(a.arguments()[1]); + } + return a.exec(); } diff --git a/src/tikzit.cpp b/src/tikzit.cpp index a55473e..dca6d95 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -91,20 +91,26 @@ void Tikzit::open() settings.value("previous-file-path").toString(), tr("TiKZ Files (*.tikz)")); - if (!fileName.isEmpty()) { - if (_windows.size() == 1 && - _windows[0]->tikzDocument()->isClean() && - _windows[0]->tikzDocument()->shortName().isEmpty()) - { - _windows[0]->open(fileName); - _windows[0]->show(); - } else { - MainWindow *w = new MainWindow(); - w->show(); - w->open(fileName); - _windows << w; - } - } + open(fileName); +} + +void Tikzit::open(QString fileName) +{ + if (!fileName.isEmpty()) { + if (_windows.size() == 1 && + _windows[0]->tikzDocument()->isClean() && + _windows[0]->tikzDocument()->shortName().isEmpty()) + { + _windows[0]->open(fileName); + _windows[0]->show(); + } + else { + MainWindow *w = new MainWindow(); + w->show(); + w->open(fileName); + _windows << w; + } + } } void Tikzit::openTikzStyles() { diff --git a/src/tikzit.h b/src/tikzit.h index 6a191b5..5ae9490 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -91,6 +91,7 @@ public: void newDoc(); void open(); + void open(QString fileName); void quit(); void init(QApplication *app); diff --git a/tikzit.pro b/tikzit.pro index c30d173..f933af7 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -10,7 +10,8 @@ CONFIG += testcase TARGET = tikzit TEMPLATE = app -win32:RC_ICONS += images/logo.ico +win32:RC_ICONS += images/tikzit.ico +win32:RC_ICONS += images/tikzdoc.ico # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked as deprecated (the exact warnings -- cgit v1.2.3 From a791a440354845621108b999556ff671016c5886 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 17 Apr 2018 18:17:28 +0200 Subject: cleaning up node/edge items again --- src/gui/tikzscene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 40d56e7..bc55ada 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -60,13 +60,13 @@ void TikzScene::graphReplaced() foreach (NodeItem *ni, _nodeItems) { removeItem(ni); - //delete ni; + delete ni; } _nodeItems.clear(); foreach (EdgeItem *ei, _edgeItems) { removeItem(ei); - //delete ei; + delete ei; } _edgeItems.clear(); -- cgit v1.2.3 From b00c5250d7a56b6d20980d89cf331a114fdfdee0 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 21 Apr 2018 22:53:05 +0200 Subject: edge styles 90 percent --- src/data/edge.cpp | 68 +++++++++-- src/data/edge.h | 16 +++ src/data/edgestyle.cpp | 6 +- src/gui/edgeitem.cpp | 56 ++++++++- src/gui/edgeitem.h | 2 + src/gui/stylepalette.cpp | 11 ++ src/gui/stylepalette.h | 1 + src/gui/tikzscene.cpp | 7 ++ src/gui/undocommands.cpp | 39 +++++- src/gui/undocommands.h | 11 ++ tikzlexer.h | 308 +++++++++++++++++++++++++++++++++++++---------- 11 files changed, 444 insertions(+), 81 deletions(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index d0f0deb..a18c8ea 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -16,6 +16,7 @@ Edge::Edge(Node *s, Node *t, QObject *parent) : _inAngle = 0; _outAngle = 0; _weight = 0.4f; + _style = noneEdgeStyle; updateControls(); } @@ -43,6 +44,7 @@ Edge *Edge::copy(QMap *nodeTable) e->setInAngle(_inAngle); e->setOutAngle(_outAngle); e->setWeight(_weight); + e->attachStyle(); e->updateControls(); return e; } @@ -79,6 +81,19 @@ void Edge::setData(GraphElementData *data) setAttributesFromData(); } +QString Edge::styleName() const +{ + QString nm = _data->property("style"); + if (nm.isNull()) return "none"; + else return nm; +} + +void Edge::setStyleName(const QString &styleName) +{ + if (!styleName.isNull() && styleName != "none") _data->setProperty("style", styleName); + else _data->unsetProperty("style"); +} + QString Edge::sourceAnchor() const { return _sourceAnchor; @@ -142,15 +157,15 @@ void Edge::updateControls() { if (_source->style()->isNone()) { _tail = src; } else { - _tail = QPointF(src.x() + std::cos(outAngleR) * 0.1, - src.y() + std::sin(outAngleR) * 0.1); + _tail = QPointF(src.x() + std::cos(outAngleR) * 0.2, + src.y() + std::sin(outAngleR) * 0.2); } if (_target->style()->isNone()) { _head = targ; } else { - _head = QPointF(targ.x() + std::cos(inAngleR) * 0.1, - targ.y() + std::sin(inAngleR) * 0.1); + _head = QPointF(targ.x() + std::cos(inAngleR) * 0.2, + targ.y() + std::sin(inAngleR) * 0.2); } // give a default distance for self-loops @@ -163,12 +178,8 @@ void Edge::updateControls() { targ.y() + (_cpDist * std::sin(inAngleR))); _mid = bezierInterpolateFull (0.5f, _tail, _cp1, _cp2, _head); -// midTan = [self _findTanFor:mid usingSpanFrom:0.4f to:0.6f]; - -// tailTan = [self _findTanFor:tail usingSpanFrom:0.0f to:0.1f]; -// headTan = [self _findTanFor:head usingSpanFrom:1.0f to:0.9f]; - //_dirty = false; - //} + _tailTangent = bezierTangent(0.0f, 0.1f); + _headTangent = bezierTangent(1.0f, 0.9f); } void Edge::setAttributesFromData() @@ -344,4 +355,41 @@ QPointF Edge::mid() const return _mid; } +QPointF Edge::headTangent() const +{ + return _headTangent; +} + +QPointF Edge::tailTangent() const +{ + return _tailTangent; +} + +void Edge::attachStyle() +{ + QString nm = styleName(); + if (nm.isNull()) _style = noneEdgeStyle; + else _style = tikzit->styles()->edgeStyle(nm); +} +EdgeStyle * Edge::style() const +{ + return _style; +} + +QPointF Edge::bezierTangent(float start, float end) const +{ + float dx = bezierInterpolate(end, _tail.x(), _cp1.x(), _cp2.x(), _head.x()) - + bezierInterpolate(start, _tail.x(), _cp1.x(), _cp2.x(), _head.x()); + float dy = bezierInterpolate(end, _tail.y(), _cp1.y(), _cp2.y(), _head.y()) - + bezierInterpolate(start, _tail.y(), _cp1.y(), _cp2.y(), _head.y()); + + // normalise + float len = sqrt(dx*dx + dy * dy); + if (len != 0) { + dx = (dx / len) * 0.1f; + dy = (dy / len) * 0.1f; + } + + return QPointF(dx, dy); +} diff --git a/src/data/edge.h b/src/data/edge.h index 7df899f..3dc0211 100644 --- a/src/data/edge.h +++ b/src/data/edge.h @@ -3,6 +3,7 @@ #include "graphelementdata.h" #include "node.h" +#include "edgestyle.h" #include #include @@ -43,6 +44,8 @@ public: QPointF cp1() const; QPointF cp2() const; QPointF mid() const; + QPointF headTangent() const; + QPointF tailTangent() const; int bend() const; int inAngle() const; @@ -60,11 +63,18 @@ public: int tikzLine() const; void setTikzLine(int tikzLine); + + void attachStyle(); + QString styleName() const; + void setStyleName(const QString & styleName); + EdgeStyle *style() const; + signals: public slots: private: + QPointF bezierTangent(float start, float end) const; QString _sourceAnchor; QString _targetAnchor; @@ -76,6 +86,9 @@ private: Node *_source; Node *_target; + + EdgeStyle *_style; + bool _dirty; bool _basicBendMode; int _bend; @@ -90,6 +103,9 @@ private: QPointF _cp2; QPointF _mid; + QPointF _headTangent; + QPointF _tailTangent; + int _tikzLine; }; diff --git a/src/data/edgestyle.cpp b/src/data/edgestyle.cpp index d366946..9fb2638 100644 --- a/src/data/edgestyle.cpp +++ b/src/data/edgestyle.cpp @@ -41,7 +41,7 @@ EdgeStyle::DrawStyle EdgeStyle::drawStyle() const QPen EdgeStyle::pen() const { QPen p(strokeColor()); - p.setWidthF((float)strokeThickness() * 3.0f); + p.setWidthF((float)strokeThickness() * 2.0f); QVector pat; switch (drawStyle()) { @@ -84,6 +84,10 @@ QIcon EdgeStyle::icon() const painter.drawLine(10, 50, 90, 50); + QPen pn = pen(); + pn.setStyle(Qt::SolidLine); + painter.setPen(pn); + switch (arrowHead()) { case Pointer: painter.drawLine(90,50,80,40); diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 88a4e85..de51db3 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -50,12 +50,61 @@ void EdgeItem::readPos() void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { //QGraphicsPathItem::paint(painter, option, widget); - QPen pen(Qt::black); - pen.setWidth(2); - painter->setPen(pen); + QPen pen = _edge->style()->pen(); + painter->setPen(pen); painter->setBrush(Qt::NoBrush); painter->drawPath(path()); + QPointF ht = _edge->headTangent(); + QPointF hLeft(-ht.y(), ht.x()); + QPointF hRight(ht.y(), -ht.x()); + QPointF tt = _edge->tailTangent(); + QPointF tLeft(-ht.y(), ht.x()); + QPointF tRight(ht.y(), -ht.x()); + + pen.setStyle(Qt::SolidLine); + painter->setPen(pen); + + + + switch (_edge->style()->arrowHead()) { + case EdgeStyle::Flat: + { + painter->drawLine( + toScreen(_edge->head() + hLeft), + toScreen(_edge->head() + hRight)); + break; + } + case EdgeStyle::Pointer: + { + QPainterPath pth; + pth.moveTo(toScreen(_edge->head() + ht + hLeft)); + pth.lineTo(toScreen(_edge->head())); + pth.lineTo(toScreen(_edge->head() + ht + hRight)); + painter->drawPath(pth); + break; + } + } + + switch (_edge->style()->arrowTail()) { + case EdgeStyle::Flat: + { + painter->drawLine( + toScreen(_edge->tail() + tLeft), + toScreen(_edge->tail() + tRight)); + break; + } + case EdgeStyle::Pointer: + { + QPainterPath pth; + pth.moveTo(toScreen(_edge->tail() + tt + tLeft)); + pth.lineTo(toScreen(_edge->tail())); + pth.lineTo(toScreen(_edge->tail() + tt + tRight)); + painter->drawPath(pth); + break; + } + } + if (isSelected()) { QColor draw; QColor draw1; @@ -151,3 +200,4 @@ void EdgeItem::setPath(const QPainterPath &path) update(); } + diff --git a/src/gui/edgeitem.h b/src/gui/edgeitem.h index 5641912..948f137 100644 --- a/src/gui/edgeitem.h +++ b/src/gui/edgeitem.h @@ -13,6 +13,7 @@ #include #include #include +#include class EdgeItem : public QGraphicsItem { @@ -30,6 +31,7 @@ public: QPainterPath path() const; void setPath(const QPainterPath &path); + private: Edge *_edge; QPainterPath _path; diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index f7c17c0..f1462df 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -114,6 +114,17 @@ QString StylePalette::activeNodeStyleName() } } +QString StylePalette::activeEdgeStyleName() +{ + const QModelIndexList i = ui->edgeStyleListView->selectionModel()->selectedIndexes(); + + if (i.isEmpty()) { + return "none"; + } else { + return i[0].data().toString(); + } +} + void StylePalette::nodeStyleDoubleClicked(const QModelIndex &index) { tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index 8663cc4..cc8fb73 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -19,6 +19,7 @@ public: void nextNodeStyle(); void previousNodeStyle(); QString activeNodeStyleName(); + QString activeEdgeStyleName(); public slots: diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index bc55ada..3c8fb71 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -71,6 +71,7 @@ void TikzScene::graphReplaced() _edgeItems.clear(); foreach (Edge *e, graph()->edges()) { + e->attachStyle(); EdgeItem *ei = new EdgeItem(e); _edgeItems.insert(e, ei); addItem(ei); @@ -420,6 +421,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) case ToolPalette::EDGE: if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0) { Edge *e = new Edge(_edgeStartNodeItem->node(), _edgeEndNodeItem->node(), _tikzDocument); + e->setStyleName(_styles->activeEdgeStyleName()); AddEdgeCommand *cmd = new AddEdgeCommand(this, e); _tikzDocument->undoStack()->push(cmd); } @@ -687,6 +689,11 @@ void TikzScene::setTikzDocument(TikzDocument *tikzDocument) void TikzScene::reloadStyles() { _styles->reloadStyles(); + foreach(EdgeItem *ei, _edgeItems) { + ei->edge()->attachStyle(); + ei->readPos(); // trigger a repaint + } + foreach (NodeItem *ni, _nodeItems) { ni->node()->attachStyle(); ni->readPos(); // trigger a repaint diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index baa8c0e..5ce6941 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -130,6 +130,7 @@ void DeleteCommand::undo() for (auto it = _deleteEdges.begin(); it != _deleteEdges.end(); ++it) { Edge *e = it.value(); + e->attachStyle(); _scene->graph()->addEdge(e, it.key()); EdgeItem *ei = new EdgeItem(e); _scene->edgeItems().insert(e, ei); @@ -185,7 +186,7 @@ void AddNodeCommand::undo() void AddNodeCommand::redo() { - _node->attachStyle(); // in case styles have changed + _node->attachStyle(); // do for every redo, in case styles have changed _scene->graph()->addNode(_node); NodeItem *ni = new NodeItem(_node); _scene->nodeItems().insert(_node, ni); @@ -214,12 +215,13 @@ void AddEdgeCommand::undo() void AddEdgeCommand::redo() { - // TODO: get the current style + _edge->attachStyle(); // do for every redo, in case styles have changed _scene->graph()->addEdge(_edge); EdgeItem *ei = new EdgeItem(_edge); _scene->edgeItems().insert(_edge, ei); _scene->addItem(ei); + // TODO: deal consistently with stacking order // edges should always be stacked below nodes if (!_scene->graph()->nodes().isEmpty()) { ei->stackBefore(_scene->nodeItems()[_scene->graph()->nodes().first()]); @@ -235,7 +237,8 @@ ChangeEdgeModeCommand::ChangeEdgeModeCommand(TikzScene *scene, Edge *edge, QUndo void ChangeEdgeModeCommand::undo() { - _edge->setBasicBendMode(!_edge->basicBendMode()); + // FIXME: this act strangely sometimes + _edge->setBasicBendMode(!_edge->basicBendMode()); _scene->edgeItems()[_edge]->readPos(); GraphUpdateCommand::undo(); } @@ -276,6 +279,35 @@ void ApplyStyleToNodesCommand::redo() GraphUpdateCommand::redo(); } +ApplyStyleToEdgesCommand::ApplyStyleToEdgesCommand(TikzScene *scene, QString style, QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), _style(style), _oldStyles() +{ + foreach(QGraphicsItem *it, scene->selectedItems()) { + if (EdgeItem *ei = dynamic_cast(it)) { + _oldStyles.insert(ei->edge(), ei->edge()->styleName()); + } + } +} + +void ApplyStyleToEdgesCommand::undo() +{ + foreach(Edge *e, _oldStyles.keys()) { + e->setStyleName(_oldStyles[e]); + e->attachStyle(); + } + + GraphUpdateCommand::undo(); +} + +void ApplyStyleToEdgesCommand::redo() +{ + foreach(Edge *e, _oldStyles.keys()) { + e->setStyleName(_style); + e->attachStyle(); + } + GraphUpdateCommand::redo(); +} + PasteCommand::PasteCommand(TikzScene *scene, Graph *graph, QUndoCommand *parent) : GraphUpdateCommand(scene, parent), _graph(graph) { @@ -316,6 +348,7 @@ void PasteCommand::redo() _scene->graph()->insertGraph(_graph); foreach (Edge *e, _graph->edges()) { + e->attachStyle(); // in case styles have changed EdgeItem *ei = new EdgeItem(e); _scene->edgeItems().insert(e, ei); _scene->addItem(ei); diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 3f74afb..ad76479 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -120,6 +120,17 @@ private: QMap _oldStyles; }; +class ApplyStyleToEdgesCommand : public GraphUpdateCommand +{ +public: + explicit ApplyStyleToEdgesCommand(TikzScene *scene, QString style, QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + QString _style; + QMap _oldStyles; +}; + class PasteCommand : public GraphUpdateCommand { public: diff --git a/tikzlexer.h b/tikzlexer.h index dea6836..d461581 100644 --- a/tikzlexer.h +++ b/tikzlexer.h @@ -2,9 +2,9 @@ #define yyHEADER_H 1 #define yyIN_HEADER 1 -#line 6 "tikzlexer.h" +#line 5 "tikzlexer.h" -#line 8 "tikzlexer.h" +#line 7 "tikzlexer.h" #define YY_INT_ALIGNED short int @@ -12,12 +12,36 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif +#ifdef yyget_lval +#define yyget_lval_ALREADY_DEFINED +#else +#define yyget_lval yyget_lval +#endif + +#ifdef yyset_lval +#define yyset_lval_ALREADY_DEFINED +#else +#define yyset_lval yyset_lval +#endif + +#ifdef yyget_lloc +#define yyget_lloc_ALREADY_DEFINED +#else +#define yyget_lloc yyget_lloc +#endif + +#ifdef yyset_lloc +#define yyset_lloc_ALREADY_DEFINED +#else +#define yyset_lloc yyset_lloc +#endif + /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ @@ -51,7 +75,6 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -59,7 +82,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -90,27 +112,23 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) +#endif /* ! C99 */ -#define YY_USE_CONST +#endif /* ! FLEXINT_H */ -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +/* begin standard C++ headers. */ -#ifdef YY_USE_CONST +/* TODO: this is always defined, so inline it */ #define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) #else -#define yyconst +#define yynoreturn #endif /* An opaque pointer. */ @@ -132,7 +150,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE @@ -157,12 +183,12 @@ struct yy_buffer_state /* Size of input buffer in bytes, not including room for EOB * characters. */ - yy_size_t yy_buf_size; + int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -185,7 +211,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -196,23 +222,23 @@ struct yy_buffer_state }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ -void yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void yypop_buffer_state (yyscan_t yyscanner ); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); -void *yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void yyfree (void * ,yyscan_t yyscanner ); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); -#define yywrap(n) 1 +#define yywrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define yytext_ptr yytext_r @@ -233,49 +259,53 @@ void yyfree (void * ,yyscan_t yyscanner ); */ #include #endif - + #define YY_EXTRA_TYPE TikzAssembler * int yylex_init (yyscan_t* scanner); -int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy (yyscan_t yyscanner ); +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -int yyget_debug (yyscan_t yyscanner ); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_debug (int debug_flag ,yyscan_t yyscanner ); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_in (yyscan_t yyscanner ); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_in (FILE * in_str ,yyscan_t yyscanner ); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -FILE *yyget_out (yyscan_t yyscanner ); + int yyget_leng ( yyscan_t yyscanner ); -void yyset_out (FILE * out_str ,yyscan_t yyscanner ); +char *yyget_text ( yyscan_t yyscanner ); -yy_size_t yyget_leng (yyscan_t yyscanner ); +int yyget_lineno ( yyscan_t yyscanner ); -char *yyget_text (yyscan_t yyscanner ); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int yyget_lineno (yyscan_t yyscanner ); +int yyget_column ( yyscan_t yyscanner ); -void yyset_lineno (int line_number ,yyscan_t yyscanner ); +void yyset_column ( int _column_no , yyscan_t yyscanner ); -YYSTYPE * yyget_lval (yyscan_t yyscanner ); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); -void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - YYLTYPE *yyget_lloc (yyscan_t yyscanner ); + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); - void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -283,18 +313,18 @@ void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (yyscan_t yyscanner ); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap (yyscan_t yyscanner ); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -303,7 +333,12 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ @@ -318,7 +353,7 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 extern int yylex \ - (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); #define YY_DECL int yylex \ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) @@ -338,8 +373,153 @@ extern int yylex \ #undef YY_DECL #endif -#line 190 "src/data/tikzlexer.l" +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 192 "src\\data\\tikzlexer.l" -#line 344 "tikzlexer.h" +#line 523 "tikzlexer.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ -- cgit v1.2.3 From f83ee82a6170845e6207aad19d6bd096db89f4c7 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 22 Apr 2018 10:53:39 +0200 Subject: edge styles done --- src/gui/stylepalette.cpp | 4 +++- src/gui/tikzscene.cpp | 5 +++++ src/gui/tikzscene.h | 1 + src/gui/undocommands.cpp | 6 +++++- src/main.cpp | 4 ++-- 5 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 6d6599b..04d0ba6 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -56,6 +56,7 @@ StylePalette::StylePalette(QWidget *parent) : reloadStyles(); connect(ui->styleListView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT( nodeStyleDoubleClicked(const QModelIndex&)) ); + connect(ui->edgeStyleListView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(edgeStyleDoubleClicked(const QModelIndex&))); } StylePalette::~StylePalette() @@ -150,7 +151,8 @@ void StylePalette::nodeStyleDoubleClicked(const QModelIndex &index) void StylePalette::edgeStyleDoubleClicked(const QModelIndex &index) { - // TODO + qDebug() << "got double click"; + tikzit->activeWindow()->tikzScene()->applyActiveStyleToEdges(); } void StylePalette::on_buttonOpenTikzstyles_clicked() diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 772c67b..f25ebe1 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -584,6 +584,11 @@ void TikzScene::applyActiveStyleToNodes() { _tikzDocument->undoStack()->push(cmd); } +void TikzScene::applyActiveStyleToEdges() { + ApplyStyleToEdgesCommand *cmd = new ApplyStyleToEdgesCommand(this, _styles->activeEdgeStyleName()); + _tikzDocument->undoStack()->push(cmd); +} + void TikzScene::deleteSelectedItems() { QSet selNodes; diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 4ac56c7..b6b2560 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -56,6 +56,7 @@ public: void reloadStyles(); //void refreshSceneBounds(); void applyActiveStyleToNodes(); + void applyActiveStyleToEdges(); void deleteSelectedItems(); void copyToClipboard(); void cutToClipboard(); diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 5525cb7..c8221fe 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -284,6 +284,7 @@ void ApplyStyleToNodesCommand::undo() n->setStyleName(_oldStyles[n]); n->attachStyle(); } + _scene->refreshAdjacentEdges(_oldStyles.keys()); GraphUpdateCommand::undo(); } @@ -294,10 +295,13 @@ void ApplyStyleToNodesCommand::redo() n->setStyleName(_style); n->attachStyle(); } + _scene->refreshAdjacentEdges(_oldStyles.keys()); + GraphUpdateCommand::redo(); } -ApplyStyleToEdgesCommand::ApplyStyleToEdgesCommand(TikzScene *scene, QString style, QUndoCommand *parent) : + +ApplyStyleToEdgesCommand::ApplyStyleToEdgesCommand(TikzScene * scene, QString style, QUndoCommand * parent) : GraphUpdateCommand(scene, parent), _style(style), _oldStyles() { foreach(QGraphicsItem *it, scene->selectedItems()) { diff --git a/src/main.cpp b/src/main.cpp index 4d6f9a7..699fbb0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,8 +41,8 @@ int main(int argc, char *argv[]) tikzit->init(&a); if (a.arguments().length() > 1) { - tikzit->open(a.arguments()[1]); - } + tikzit->open(a.arguments()[1]); + } return a.exec(); } -- cgit v1.2.3 From d7f0b3e19fddc89fd22692847e9d840023d2b7f3 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 7 May 2018 13:21:59 +0200 Subject: GPLed --- COPYING | 674 + src/data/edge.cpp | 18 + src/data/edge.h | 18 + src/data/edgestyle.cpp | 18 + src/data/edgestyle.h | 18 + src/data/graph.cpp | 18 + src/data/graph.h | 18 + src/data/graphelementdata.cpp | 18 + src/data/graphelementdata.h | 18 + src/data/graphelementproperty.cpp | 18 + src/data/graphelementproperty.h | 18 + src/data/node.cpp | 18 + src/data/node.h | 18 + src/data/nodestyle.cpp | 18 + src/data/nodestyle.h | 18 + src/data/style.cpp | 18 + src/data/style.h | 18 + src/data/tikzassembler.cpp | 18 + src/data/tikzassembler.h | 20 +- src/data/tikzdocument.cpp | 18 + src/data/tikzdocument.h | 18 + src/data/tikzlexer.l | 39 +- src/data/tikzparserdefs.h | 18 + src/data/tikzstyles.cpp | 18 + src/data/tikzstyles.h | 18 + src/gui/edgeitem.cpp | 18 + src/gui/edgeitem.h | 20 +- src/gui/mainmenu.cpp | 18 + src/gui/mainmenu.h | 18 + src/gui/nodeitem.cpp | 18 + src/gui/nodeitem.h | 18 + src/gui/propertypalette.cpp | 18 + src/gui/propertypalette.h | 18 + src/gui/stylepalette.cpp | 18 + src/gui/stylepalette.h | 18 + src/gui/tikzscene.cpp | 18 + src/gui/tikzscene.h | 18 + src/gui/tikzview.cpp | 18 + src/gui/tikzview.h | 18 + src/gui/toolpalette.cpp | 18 + src/gui/toolpalette.h | 18 + src/gui/undocommands.cpp | 18 + src/gui/undocommands.h | 18 + src/main.cpp | 21 +- src/tikzit.cpp | 18 + src/tikzit.h | 19 + src/util.cpp | 18 + src/util.h | 18 + tikzit-old/.gitignore | 235 - tikzit-old/AH_latex_head.png | Bin 6334 -> 0 bytes tikzit-old/AH_latex_tail.png | Bin 6324 -> 0 bytes tikzit-old/AH_none.png | Bin 6183 -> 0 bytes tikzit-old/AH_plain_head.png | Bin 6298 -> 0 bytes tikzit-old/AH_plain_tail.png | Bin 6320 -> 0 bytes tikzit-old/COPYING | 340 - tikzit-old/DESIGN-GTK | 23 - tikzit-old/ED_arrow.png | Bin 6357 -> 0 bytes tikzit-old/ED_none.png | Bin 6190 -> 0 bytes tikzit-old/ED_tick.png | Bin 6258 -> 0 bytes tikzit-old/English.lproj/Credits.rtf | 18 - tikzit-old/English.lproj/CustomNodes.xib | 256 - tikzit-old/English.lproj/InfoPlist.strings | 2 - tikzit-old/English.lproj/MainMenu.xib | 453 - tikzit-old/English.lproj/Preamble.xib | 235 - tikzit-old/English.lproj/Preview.xib | 70 - tikzit-old/English.lproj/PropertyInspector.xib | 769 - tikzit-old/English.lproj/StylePalette.xib | 631 - tikzit-old/English.lproj/TikzDocument.xib | 161 - tikzit-old/English.lproj/UserDefaults.plist | 10 - .../Frameworks/SFBInspectors.framework/Headers | 1 - .../Frameworks/SFBInspectors.framework/Resources | 1 - .../SFBInspectors.framework/SFBInspectors | 1 - .../Versions/A/Headers/SFBInspectorPane.h | 31 - .../Versions/A/Headers/SFBInspectorPaneBody.h | 16 - .../Versions/A/Headers/SFBInspectorPaneHeader.h | 24 - .../Versions/A/Headers/SFBInspectorView.h | 17 - .../Versions/A/Headers/SFBViewSelector.h | 22 - .../Versions/A/Headers/SFBViewSelectorBar.h | 29 - .../Versions/A/Headers/SFBViewSelectorBarItem.h | 28 - .../A/Resources/English.lproj/InfoPlist.strings | Bin 92 -> 0 bytes .../Versions/A/Resources/Info.plist | 24 - .../Versions/A/SFBInspectors | Bin 280648 -> 0 bytes .../SFBInspectors.framework/Versions/Current | 1 - tikzit-old/Frameworks/Sparkle.framework/Headers | 1 - tikzit-old/Frameworks/Sparkle.framework/Resources | 1 - tikzit-old/Frameworks/Sparkle.framework/Sparkle | 1 - .../Versions/A/Headers/SUAppcast.h | 33 - .../Versions/A/Headers/SUAppcastItem.h | 47 - .../Versions/A/Headers/SUUpdater.h | 118 - .../A/Headers/SUVersionComparisonProtocol.h | 27 - .../Sparkle.framework/Versions/A/Headers/Sparkle.h | 21 - .../Versions/A/Resources/Info.plist | 24 - .../Versions/A/Resources/License.txt | 7 - .../Versions/A/Resources/SUModelTranslation.plist | 174 - .../Versions/A/Resources/SUStatus.nib/classes.nib | 56 - .../Versions/A/Resources/SUStatus.nib/info.nib | 20 - .../A/Resources/SUStatus.nib/keyedobjects.nib | Bin 7344 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../de.lproj/SUAutomaticUpdateAlert.nib/info.nib | 20 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7278 -> 0 bytes .../de.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/de.lproj/SUUpdateAlert.nib/info.nib | 20 - .../de.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10493 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../de.lproj/SUUpdatePermissionPrompt.nib/info.nib | 20 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 13189 -> 0 bytes .../Versions/A/Resources/de.lproj/Sparkle.strings | Bin 9806 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../en.lproj/SUAutomaticUpdateAlert.nib/info.nib | 20 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7148 -> 0 bytes .../en.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/en.lproj/SUUpdateAlert.nib/info.nib | 20 - .../en.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10623 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../en.lproj/SUUpdatePermissionPrompt.nib/info.nib | 21 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 13263 -> 0 bytes .../Versions/A/Resources/en.lproj/Sparkle.strings | Bin 8216 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../es.lproj/SUAutomaticUpdateAlert.nib/info.nib | 20 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7273 -> 0 bytes .../es.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/es.lproj/SUUpdateAlert.nib/info.nib | 20 - .../es.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10668 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../es.lproj/SUUpdatePermissionPrompt.nib/info.nib | 20 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 13404 -> 0 bytes .../Versions/A/Resources/es.lproj/Sparkle.strings | Bin 8020 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../fr.lproj/SUAutomaticUpdateAlert.nib/info.nib | 16 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7245 -> 0 bytes .../fr.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/fr.lproj/SUUpdateAlert.nib/info.nib | 16 - .../fr.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10338 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../fr.lproj/SUUpdatePermissionPrompt.nib/info.nib | 16 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 13156 -> 0 bytes .../Versions/A/Resources/fr.lproj/Sparkle.strings | Bin 8554 -> 0 bytes .../Versions/A/Resources/fr_CA.lproj | 1 - .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../it.lproj/SUAutomaticUpdateAlert.nib/info.nib | 20 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7161 -> 0 bytes .../it.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/it.lproj/SUUpdateAlert.nib/info.nib | 20 - .../it.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10360 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../it.lproj/SUUpdatePermissionPrompt.nib/info.nib | 20 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 12659 -> 0 bytes .../Versions/A/Resources/it.lproj/Sparkle.strings | Bin 8914 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../nl.lproj/SUAutomaticUpdateAlert.nib/info.nib | 18 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7234 -> 0 bytes .../nl.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/nl.lproj/SUUpdateAlert.nib/info.nib | 16 - .../nl.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10220 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../nl.lproj/SUUpdatePermissionPrompt.nib/info.nib | 16 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 12535 -> 0 bytes .../Versions/A/Resources/nl.lproj/Sparkle.strings | Bin 8514 -> 0 bytes .../Versions/A/Resources/relaunch | Bin 58924 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../ru.lproj/SUAutomaticUpdateAlert.nib/info.nib | 20 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7675 -> 0 bytes .../ru.lproj/SUUpdateAlert.nib/classes.nib | 67 - .../Resources/ru.lproj/SUUpdateAlert.nib/info.nib | 20 - .../ru.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10895 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../ru.lproj/SUUpdatePermissionPrompt.nib/info.nib | 18 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 12898 -> 0 bytes .../Versions/A/Resources/ru.lproj/Sparkle.strings | Bin 8364 -> 0 bytes .../SUAutomaticUpdateAlert.nib/classes.nib | 50 - .../sv.lproj/SUAutomaticUpdateAlert.nib/info.nib | 20 - .../SUAutomaticUpdateAlert.nib/keyedobjects.nib | Bin 7474 -> 0 bytes .../sv.lproj/SUUpdateAlert.nib/classes.nib | 39 - .../Resources/sv.lproj/SUUpdateAlert.nib/info.nib | 18 - .../sv.lproj/SUUpdateAlert.nib/keyedobjects.nib | Bin 10180 -> 0 bytes .../SUUpdatePermissionPrompt.nib/classes.nib | 59 - .../sv.lproj/SUUpdatePermissionPrompt.nib/info.nib | 20 - .../SUUpdatePermissionPrompt.nib/keyedobjects.nib | Bin 13483 -> 0 bytes .../Versions/A/Resources/sv.lproj/Sparkle.strings | Bin 8142 -> 0 bytes .../Sparkle.framework/Versions/A/Sparkle | Bin 463812 -> 0 bytes .../Frameworks/Sparkle.framework/Versions/Current | 1 - tikzit-old/INSTALL | 34 - tikzit-old/Makefile.am | 3 - tikzit-old/NEWS | 75 - tikzit-old/README | 7 - tikzit-old/README.release | 98 - tikzit-old/TODO | 15 - tikzit-old/TikZiT-Info.plist | 61 - tikzit-old/TikZiT.xcodeproj/project.pbxproj | 1322 - .../project.xcworkspace/contents.xcworkspacedata | 7 - .../xcshareddata/TikZiT.xccheckout | 37 - .../UserInterfaceState.xcuserstate | 24539 ------------------- .../aleks.xcuserdatad/WorkspaceSettings.xcsettings | 22 - .../xcdebugger/Breakpoints.xcbkptlist | 123 - .../aleks.xcuserdatad/xcschemes/TikZiT.xcscheme | 72 - .../aleks.xcuserdatad/xcschemes/tests.xcscheme | 72 - .../xcschemes/xcschememanagement.plist | 32 - tikzit-old/TikZiT_Prefix.pch | 30 - tikzit-old/autogen.sh | 1578 -- tikzit-old/build/DEBIAN/control | 11 - tikzit-old/configure.ac | 141 - tikzit-old/customshape.png | Bin 1281 -> 0 bytes tikzit-old/docs/Doxyfile | 1600 -- tikzit-old/draw-ellipse.png | Bin 3493 -> 0 bytes tikzit-old/draw-path.png | Bin 920 -> 0 bytes tikzit-old/emblem-important.png | Bin 717 -> 0 bytes tikzit-old/emblem-unreadable-grey.png | Bin 3554 -> 0 bytes tikzit-old/engine.png | Bin 1546 -> 0 bytes tikzit-old/format-indent-less.png | Bin 767 -> 0 bytes tikzit-old/m4/objc.m4 | 135 - tikzit-old/preamble.png | Bin 851 -> 0 bytes tikzit-old/scripts/generate_keys.rb | 13 - tikzit-old/scripts/prepare_release.sh | 40 - tikzit-old/scripts/sign_update.rb | 7 - tikzit-old/select-rectangular.png | Bin 499 -> 0 bytes tikzit-old/shapes/cap.tikz | 13 - tikzit-old/shapes/copants.tikz | 19 - tikzit-old/shapes/cup.tikz | 13 - tikzit-old/shapes/oval.tikz | 11 - tikzit-old/shapes/pants.tikz | 19 - tikzit-old/share/Makefile.am | 10 - tikzit-old/share/applications/tikzit.desktop | 11 - .../share/icons/hicolor/128x128/apps/tikzit.png | Bin 9098 -> 0 bytes .../hicolor/128x128/mimetypes/text-x-tikz.png | Bin 7316 -> 0 bytes .../share/icons/hicolor/16x16/apps/tikzit.png | Bin 882 -> 0 bytes .../icons/hicolor/16x16/mimetypes/text-x-tikz.png | Bin 564 -> 0 bytes .../share/icons/hicolor/22x22/apps/tikzit.png | Bin 1273 -> 0 bytes .../icons/hicolor/22x22/mimetypes/text-x-tikz.png | Bin 866 -> 0 bytes .../share/icons/hicolor/24x24/apps/tikzit.png | Bin 1406 -> 0 bytes .../share/icons/hicolor/32x32/apps/tikzit.png | Bin 1987 -> 0 bytes .../icons/hicolor/32x32/mimetypes/text-x-tikz.png | Bin 1352 -> 0 bytes .../share/icons/hicolor/48x48/apps/tikzit.png | Bin 3132 -> 0 bytes .../icons/hicolor/48x48/mimetypes/text-x-tikz.png | Bin 2445 -> 0 bytes .../share/icons/hicolor/64x64/apps/tikzit.png | Bin 4315 -> 0 bytes .../icons/hicolor/64x64/mimetypes/text-x-tikz.png | Bin 3532 -> 0 bytes .../share/icons/hicolor/scalable/apps/tikzit.svg | 79 - .../hicolor/scalable/mimetypes/text-x-tikz.svg | 488 - tikzit-old/share/mime/packages/tikzit.xml | 10 - tikzit-old/share/tikzit | 1 - tikzit-old/src/Makefile.am | 178 - tikzit-old/src/common/CircleShape.h | 33 - tikzit-old/src/common/CircleShape.m | 57 - tikzit-old/src/common/ColorRGB.h | 64 - tikzit-old/src/common/ColorRGB.m | 353 - tikzit-old/src/common/DiamondShape.h | 34 - tikzit-old/src/common/DiamondShape.m | 63 - tikzit-old/src/common/Edge.h | 401 - tikzit-old/src/common/Edge.m | 757 - tikzit-old/src/common/EdgeStyle.h | 71 - tikzit-old/src/common/EdgeStyle.m | 222 - tikzit-old/src/common/Graph.h | 401 - tikzit-old/src/common/Graph.m | 922 - tikzit-old/src/common/GraphChange.h | 344 - tikzit-old/src/common/GraphChange.m | 369 - tikzit-old/src/common/GraphElementData.h | 94 - tikzit-old/src/common/GraphElementData.m | 188 - tikzit-old/src/common/GraphElementProperty.h | 88 - tikzit-old/src/common/GraphElementProperty.m | 164 - tikzit-old/src/common/Grid.h | 110 - tikzit-old/src/common/Grid.m | 186 - tikzit-old/src/common/NSError+Tikzit.h | 44 - tikzit-old/src/common/NSError+Tikzit.m | 64 - tikzit-old/src/common/NSFileManager+Utils.h | 29 - tikzit-old/src/common/NSFileManager+Utils.m | 46 - tikzit-old/src/common/NSString+LatexConstants.h | 33 - tikzit-old/src/common/NSString+LatexConstants.m | 212 - tikzit-old/src/common/NSString+Tikz.h | 26 - tikzit-old/src/common/NSString+Tikz.m | 72 - tikzit-old/src/common/NSString+Util.h | 27 - tikzit-old/src/common/NSString+Util.m | 66 - tikzit-old/src/common/Node.h | 181 - tikzit-old/src/common/Node.m | 214 - tikzit-old/src/common/NodeStyle.h | 125 - tikzit-old/src/common/NodeStyle.m | 246 - tikzit-old/src/common/PickSupport.h | 164 - tikzit-old/src/common/PickSupport.m | 232 - tikzit-old/src/common/Preambles.h | 73 - tikzit-old/src/common/Preambles.m | 320 - tikzit-old/src/common/PropertyHolder.h | 36 - tikzit-old/src/common/PropertyHolder.m | 74 - tikzit-old/src/common/RColor.h | 50 - tikzit-old/src/common/RColor.m | 33 - tikzit-old/src/common/RectangleShape.h | 33 - tikzit-old/src/common/RectangleShape.m | 57 - tikzit-old/src/common/RegularPolyShape.h | 50 - tikzit-old/src/common/RegularPolyShape.m | 76 - tikzit-old/src/common/RenderContext.h | 156 - tikzit-old/src/common/Shape.h | 49 - tikzit-old/src/common/Shape.m | 171 - tikzit-old/src/common/ShapeNames.h | 27 - tikzit-old/src/common/StyleManager.h | 49 - tikzit-old/src/common/StyleManager.m | 378 - tikzit-old/src/common/SupportDir.h | 36 - tikzit-old/src/common/SupportDir.m | 65 - tikzit-old/src/common/TikzGraphAssembler+Parser.h | 36 - tikzit-old/src/common/TikzGraphAssembler.h | 115 - tikzit-old/src/common/TikzGraphAssembler.m | 310 - tikzit-old/src/common/TikzShape.h | 37 - tikzit-old/src/common/TikzShape.m | 70 - tikzit-old/src/common/Transformer.h | 154 - tikzit-old/src/common/Transformer.m | 231 - tikzit-old/src/common/test/Makefile | 14 - tikzit-old/src/common/test/color.m | 80 - tikzit-old/src/common/test/common.m | 34 - tikzit-old/src/common/test/maths.m | 562 - tikzit-old/src/common/test/parser.m | 86 - tikzit-old/src/common/test/test.h | 57 - tikzit-old/src/common/test/test.m | 175 - tikzit-old/src/common/tikzlexer.lm | 170 - tikzit-old/src/common/tikzparser.ym | 224 - tikzit-old/src/common/tikzparserdefs.h | 49 - tikzit-old/src/common/util.h | 201 - tikzit-old/src/common/util.m | 403 - tikzit-old/src/gtk/Application.h | 155 - tikzit-old/src/gtk/Application.m | 377 - tikzit-old/src/gtk/BoundingBoxTool.h | 45 - tikzit-old/src/gtk/BoundingBoxTool.m | 353 - tikzit-old/src/gtk/CairoRenderContext.h | 59 - tikzit-old/src/gtk/CairoRenderContext.m | 344 - tikzit-old/src/gtk/ColorRGB+Gtk.h | 30 - tikzit-old/src/gtk/ColorRGB+Gtk.m | 46 - tikzit-old/src/gtk/ColorRGB+IntegerListStorage.h | 32 - tikzit-old/src/gtk/ColorRGB+IntegerListStorage.m | 57 - tikzit-old/src/gtk/Configuration.h | 447 - tikzit-old/src/gtk/Configuration.m | 450 - tikzit-old/src/gtk/ContextWindow.h | 53 - tikzit-old/src/gtk/ContextWindow.m | 169 - tikzit-old/src/gtk/CreateEdgeTool.h | 45 - tikzit-old/src/gtk/CreateEdgeTool.m | 226 - tikzit-old/src/gtk/CreateNodeTool.h | 42 - tikzit-old/src/gtk/CreateNodeTool.m | 169 - tikzit-old/src/gtk/DocumentContext.h | 27 - tikzit-old/src/gtk/Edge+Render.h | 34 - tikzit-old/src/gtk/Edge+Render.m | 267 - tikzit-old/src/gtk/EdgeStyle+Gtk.h | 29 - tikzit-old/src/gtk/EdgeStyle+Gtk.m | 33 - tikzit-old/src/gtk/EdgeStyle+Storage.h | 29 - tikzit-old/src/gtk/EdgeStyle+Storage.m | 55 - tikzit-old/src/gtk/EdgeStyleEditor.h | 45 - tikzit-old/src/gtk/EdgeStyleEditor.m | 499 - tikzit-old/src/gtk/EdgeStyleSelector.h | 61 - tikzit-old/src/gtk/EdgeStyleSelector.m | 143 - tikzit-old/src/gtk/EdgeStylesModel.h | 62 - tikzit-old/src/gtk/EdgeStylesModel.m | 367 - tikzit-old/src/gtk/EdgeStylesPalette.h | 43 - tikzit-old/src/gtk/EdgeStylesPalette.m | 198 - tikzit-old/src/gtk/FileChooserDialog.h | 56 - tikzit-old/src/gtk/FileChooserDialog.m | 152 - tikzit-old/src/gtk/GraphEditorPanel.h | 53 - tikzit-old/src/gtk/GraphEditorPanel.m | 240 - tikzit-old/src/gtk/GraphRenderer.h | 84 - tikzit-old/src/gtk/GraphRenderer.m | 476 - tikzit-old/src/gtk/HandTool.h | 33 - tikzit-old/src/gtk/HandTool.m | 75 - tikzit-old/src/gtk/InputDelegate.h | 77 - tikzit-old/src/gtk/Menu.h | 86 - tikzit-old/src/gtk/Menu.m | 737 - tikzit-old/src/gtk/NSError+Glib.h | 28 - tikzit-old/src/gtk/NSError+Glib.m | 50 - tikzit-old/src/gtk/NSFileManager+Glib.h | 31 - tikzit-old/src/gtk/NSFileManager+Glib.m | 55 - tikzit-old/src/gtk/NSString+Glib.h | 50 - tikzit-old/src/gtk/NSString+Glib.m | 96 - tikzit-old/src/gtk/Node+Render.h | 44 - tikzit-old/src/gtk/Node+Render.m | 188 - tikzit-old/src/gtk/NodeStyle+Gtk.h | 31 - tikzit-old/src/gtk/NodeStyle+Gtk.m | 41 - tikzit-old/src/gtk/NodeStyle+Render.h | 30 - tikzit-old/src/gtk/NodeStyle+Storage.h | 29 - tikzit-old/src/gtk/NodeStyle+Storage.m | 62 - tikzit-old/src/gtk/NodeStyleEditor.h | 45 - tikzit-old/src/gtk/NodeStyleEditor.m | 477 - tikzit-old/src/gtk/NodeStyleSelector.h | 61 - tikzit-old/src/gtk/NodeStyleSelector.m | 135 - tikzit-old/src/gtk/NodeStylesModel.h | 62 - tikzit-old/src/gtk/NodeStylesModel.m | 381 - tikzit-old/src/gtk/NodeStylesPalette.h | 43 - tikzit-old/src/gtk/NodeStylesPalette.m | 197 - tikzit-old/src/gtk/PreambleEditor.h | 51 - tikzit-old/src/gtk/PreambleEditor.m | 568 - tikzit-old/src/gtk/Preambles+Storage.h | 29 - tikzit-old/src/gtk/Preambles+Storage.m | 84 - tikzit-old/src/gtk/PreviewRenderer.h | 48 - tikzit-old/src/gtk/PreviewRenderer.m | 250 - tikzit-old/src/gtk/PreviewWindow.h | 51 - tikzit-old/src/gtk/PreviewWindow.m | 195 - tikzit-old/src/gtk/PropertiesPane.h | 69 - tikzit-old/src/gtk/PropertiesPane.m | 763 - tikzit-old/src/gtk/PropertyListEditor.h | 65 - tikzit-old/src/gtk/PropertyListEditor.m | 501 - tikzit-old/src/gtk/RecentManager.h | 30 - tikzit-old/src/gtk/RecentManager.m | 74 - tikzit-old/src/gtk/SelectTool.h | 63 - tikzit-old/src/gtk/SelectTool.m | 590 - tikzit-old/src/gtk/SelectionPane.h | 56 - tikzit-old/src/gtk/SelectionPane.m | 432 - tikzit-old/src/gtk/SettingsDialog.h | 54 - tikzit-old/src/gtk/SettingsDialog.m | 328 - tikzit-old/src/gtk/Shape+Render.h | 29 - tikzit-old/src/gtk/Shape+Render.m | 57 - tikzit-old/src/gtk/StyleManager+Storage.h | 26 - tikzit-old/src/gtk/StyleManager+Storage.m | 82 - tikzit-old/src/gtk/Surface.h | 107 - tikzit-old/src/gtk/TZFoundation.h | 30 - tikzit-old/src/gtk/TikzDocument.h | 149 - tikzit-old/src/gtk/TikzDocument.m | 911 - tikzit-old/src/gtk/Tool.h | 41 - tikzit-old/src/gtk/ToolBox.h | 45 - tikzit-old/src/gtk/ToolBox.m | 280 - tikzit-old/src/gtk/WidgetSurface.h | 54 - tikzit-old/src/gtk/WidgetSurface.m | 630 - tikzit-old/src/gtk/Window.h | 182 - tikzit-old/src/gtk/Window.m | 991 - tikzit-old/src/gtk/cairo_helpers.h | 25 - tikzit-old/src/gtk/cairo_helpers.m | 28 - tikzit-old/src/gtk/clipboard.h | 41 - tikzit-old/src/gtk/clipboard.m | 57 - tikzit-old/src/gtk/gtkhelpers.h | 60 - tikzit-old/src/gtk/gtkhelpers.m | 275 - tikzit-old/src/gtk/logo.h | 32 - tikzit-old/src/gtk/logo.m | 64 - tikzit-old/src/gtk/main.m | 111 - tikzit-old/src/gtk/mkdtemp.h | 32 - tikzit-old/src/gtk/mkdtemp.m | 180 - tikzit-old/src/gtk/stat.h | 25 - tikzit-old/src/gtk/test/gtk.m | 27 - tikzit-old/src/gtk/test/main.m | 50 - tikzit-old/src/gtk/tzstockitems.h | 26 - tikzit-old/src/gtk/tzstockitems.m | 64 - tikzit-old/src/gtk/tztoolpalette.h | 56 - tikzit-old/src/gtk/tztoolpalette.m | 158 - tikzit-old/src/osx/AppDelegate.h | 57 - tikzit-old/src/osx/AppDelegate.m | 124 - tikzit-old/src/osx/CALayer+DrawLabel.h | 21 - tikzit-old/src/osx/CALayer+DrawLabel.m | 84 - tikzit-old/src/osx/CoreGraphicsRenderContext.h | 44 - tikzit-old/src/osx/CoreGraphicsRenderContext.m | 234 - tikzit-old/src/osx/CustomNodeCellView.h | 23 - tikzit-old/src/osx/CustomNodeCellView.m | 83 - tikzit-old/src/osx/CustomNodeController.h | 35 - tikzit-old/src/osx/CustomNodeController.m | 58 - tikzit-old/src/osx/CustomNodes.xib | 249 - tikzit-old/src/osx/DraggablePDFView.h | 28 - tikzit-old/src/osx/DraggablePDFView.m | 60 - tikzit-old/src/osx/EdgeControlLayer.h | 44 - tikzit-old/src/osx/EdgeControlLayer.m | 150 - tikzit-old/src/osx/EdgeStyle+Coder.h | 30 - tikzit-old/src/osx/EdgeStyle+Coder.m | 50 - tikzit-old/src/osx/Graph+Coder.h | 17 - tikzit-old/src/osx/Graph+Coder.m | 24 - tikzit-old/src/osx/GraphicsView.h | 129 - tikzit-old/src/osx/GraphicsView.m | 1216 - tikzit-old/src/osx/Grid.h | 48 - tikzit-old/src/osx/Grid.m | 152 - tikzit-old/src/osx/MultiCombo.h | 18 - tikzit-old/src/osx/MultiCombo.m | 38 - tikzit-old/src/osx/MultiField.h | 18 - tikzit-old/src/osx/MultiField.m | 53 - tikzit-old/src/osx/NilToEmptyStringTransformer.h | 28 - tikzit-old/src/osx/NilToEmptyStringTransformer.m | 53 - tikzit-old/src/osx/NodeLayer.h | 62 - tikzit-old/src/osx/NodeLayer.m | 238 - tikzit-old/src/osx/NodeSelectionLayer.h | 45 - tikzit-old/src/osx/NodeSelectionLayer.m | 93 - tikzit-old/src/osx/NodeStyle+Coder.h | 36 - tikzit-old/src/osx/NodeStyle+Coder.m | 91 - tikzit-old/src/osx/ParseErrorView.h | 13 - tikzit-old/src/osx/ParseErrorView.m | 40 - tikzit-old/src/osx/PreambleController.h | 57 - tikzit-old/src/osx/PreambleController.m | 168 - tikzit-old/src/osx/Preambles+Coder.h | 32 - tikzit-old/src/osx/Preambles+Coder.m | 41 - tikzit-old/src/osx/PreferenceController.h | 49 - tikzit-old/src/osx/PreferenceController.m | 133 - tikzit-old/src/osx/Preferences.xib | 1165 - tikzit-old/src/osx/PreviewController.h | 52 - tikzit-old/src/osx/PreviewController.m | 147 - tikzit-old/src/osx/PropertyInspectorController.h | 83 - tikzit-old/src/osx/PropertyInspectorController.m | 280 - tikzit-old/src/osx/SelectBoxLayer.h | 22 - tikzit-old/src/osx/SelectBoxLayer.m | 48 - tikzit-old/src/osx/SelectableCollectionViewItem.h | 33 - tikzit-old/src/osx/SelectableCollectionViewItem.m | 54 - tikzit-old/src/osx/SelectableNodeView.h | 38 - tikzit-old/src/osx/SelectableNodeView.m | 96 - tikzit-old/src/osx/StylePaletteController.h | 80 - tikzit-old/src/osx/StylePaletteController.m | 252 - tikzit-old/src/osx/TikzDocument.h | 37 - tikzit-old/src/osx/TikzDocument.m | 84 - tikzit-old/src/osx/TikzFormatter.h | 29 - tikzit-old/src/osx/TikzFormatter.m | 91 - tikzit-old/src/osx/TikzSourceController.h | 71 - tikzit-old/src/osx/TikzSourceController.m | 241 - tikzit-old/src/osx/TikzWindowController.h | 31 - tikzit-old/src/osx/TikzWindowController.m | 66 - tikzit-old/src/osx/ToolPaletteController.h | 42 - tikzit-old/src/osx/ToolPaletteController.m | 58 - tikzit-old/src/osx/UpdatePreferenceController.h | 34 - tikzit-old/src/osx/UpdatePreferenceController.m | 49 - tikzit-old/src/osx/UpdatePreferencePanel.xib | 95 - tikzit-old/src/osx/main.m | 26 - tikzit-old/src/osx/test/main.m | 56 - tikzit-old/src/osx/test/osx.m | 64 - tikzit-old/src/tikzit.rc | 24 - tikzit-old/text-x-generic.png | Bin 744 -> 0 bytes tikzit-old/text-x-script.png | Bin 1416 -> 0 bytes tikzit-old/tikzit.icns | Bin 166599 -> 0 bytes tikzit-old/tikzit.ico | Bin 34494 -> 0 bytes tikzit-old/tikzit.spec | 98 - tikzit-old/tikzit48x48.png | Bin 2606 -> 0 bytes tikzit-old/tikzit_dsa_pub.pem | 20 - tikzit-old/tikzitdoc.icns | Bin 154929 -> 0 bytes tikzit-old/transform-crop-and-resize.png | Bin 1132 -> 0 bytes tikzit-old/transform-move.png | Bin 638 -> 0 bytes tikzit-old/updates.png | Bin 1953 -> 0 bytes 515 files changed, 1527 insertions(+), 74410 deletions(-) create mode 100644 COPYING delete mode 100644 tikzit-old/.gitignore delete mode 100644 tikzit-old/AH_latex_head.png delete mode 100644 tikzit-old/AH_latex_tail.png delete mode 100644 tikzit-old/AH_none.png delete mode 100644 tikzit-old/AH_plain_head.png delete mode 100644 tikzit-old/AH_plain_tail.png delete mode 100644 tikzit-old/COPYING delete mode 100644 tikzit-old/DESIGN-GTK delete mode 100644 tikzit-old/ED_arrow.png delete mode 100644 tikzit-old/ED_none.png delete mode 100644 tikzit-old/ED_tick.png delete mode 100644 tikzit-old/English.lproj/Credits.rtf delete mode 100644 tikzit-old/English.lproj/CustomNodes.xib delete mode 100644 tikzit-old/English.lproj/InfoPlist.strings delete mode 100644 tikzit-old/English.lproj/MainMenu.xib delete mode 100644 tikzit-old/English.lproj/Preamble.xib delete mode 100644 tikzit-old/English.lproj/Preview.xib delete mode 100644 tikzit-old/English.lproj/PropertyInspector.xib delete mode 100644 tikzit-old/English.lproj/StylePalette.xib delete mode 100644 tikzit-old/English.lproj/TikzDocument.xib delete mode 100644 tikzit-old/English.lproj/UserDefaults.plist delete mode 120000 tikzit-old/Frameworks/SFBInspectors.framework/Headers delete mode 120000 tikzit-old/Frameworks/SFBInspectors.framework/Resources delete mode 120000 tikzit-old/Frameworks/SFBInspectors.framework/SFBInspectors delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPane.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneBody.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneHeader.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorView.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelector.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBar.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBarItem.h delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/English.lproj/InfoPlist.strings delete mode 100644 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/Info.plist delete mode 100755 tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/SFBInspectors delete mode 120000 tikzit-old/Frameworks/SFBInspectors.framework/Versions/Current delete mode 120000 tikzit-old/Frameworks/Sparkle.framework/Headers delete mode 120000 tikzit-old/Frameworks/Sparkle.framework/Resources delete mode 120000 tikzit-old/Frameworks/Sparkle.framework/Sparkle delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcast.h delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/Sparkle.h delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings delete mode 120000 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr_CA.lproj delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings delete mode 100755 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/relaunch delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/classes.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/info.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib delete mode 100644 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings delete mode 100755 tikzit-old/Frameworks/Sparkle.framework/Versions/A/Sparkle delete mode 120000 tikzit-old/Frameworks/Sparkle.framework/Versions/Current delete mode 100644 tikzit-old/INSTALL delete mode 100644 tikzit-old/Makefile.am delete mode 100644 tikzit-old/NEWS delete mode 100644 tikzit-old/README delete mode 100644 tikzit-old/README.release delete mode 100644 tikzit-old/TODO delete mode 100644 tikzit-old/TikZiT-Info.plist delete mode 100644 tikzit-old/TikZiT.xcodeproj/project.pbxproj delete mode 100644 tikzit-old/TikZiT.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcshareddata/TikZiT.xccheckout delete mode 100644 tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/WorkspaceSettings.xcsettings delete mode 100644 tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist delete mode 100644 tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/TikZiT.xcscheme delete mode 100644 tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/tests.xcscheme delete mode 100644 tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 tikzit-old/TikZiT_Prefix.pch delete mode 100755 tikzit-old/autogen.sh delete mode 100644 tikzit-old/build/DEBIAN/control delete mode 100644 tikzit-old/configure.ac delete mode 100755 tikzit-old/customshape.png delete mode 100644 tikzit-old/docs/Doxyfile delete mode 100644 tikzit-old/draw-ellipse.png delete mode 100644 tikzit-old/draw-path.png delete mode 100644 tikzit-old/emblem-important.png delete mode 100644 tikzit-old/emblem-unreadable-grey.png delete mode 100755 tikzit-old/engine.png delete mode 100644 tikzit-old/format-indent-less.png delete mode 100644 tikzit-old/m4/objc.m4 delete mode 100755 tikzit-old/preamble.png delete mode 100755 tikzit-old/scripts/generate_keys.rb delete mode 100755 tikzit-old/scripts/prepare_release.sh delete mode 100755 tikzit-old/scripts/sign_update.rb delete mode 100644 tikzit-old/select-rectangular.png delete mode 100644 tikzit-old/shapes/cap.tikz delete mode 100644 tikzit-old/shapes/copants.tikz delete mode 100644 tikzit-old/shapes/cup.tikz delete mode 100644 tikzit-old/shapes/oval.tikz delete mode 100644 tikzit-old/shapes/pants.tikz delete mode 100644 tikzit-old/share/Makefile.am delete mode 100644 tikzit-old/share/applications/tikzit.desktop delete mode 100644 tikzit-old/share/icons/hicolor/128x128/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/128x128/mimetypes/text-x-tikz.png delete mode 100644 tikzit-old/share/icons/hicolor/16x16/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/16x16/mimetypes/text-x-tikz.png delete mode 100644 tikzit-old/share/icons/hicolor/22x22/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/22x22/mimetypes/text-x-tikz.png delete mode 100644 tikzit-old/share/icons/hicolor/24x24/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/32x32/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/32x32/mimetypes/text-x-tikz.png delete mode 100644 tikzit-old/share/icons/hicolor/48x48/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/48x48/mimetypes/text-x-tikz.png delete mode 100644 tikzit-old/share/icons/hicolor/64x64/apps/tikzit.png delete mode 100644 tikzit-old/share/icons/hicolor/64x64/mimetypes/text-x-tikz.png delete mode 100644 tikzit-old/share/icons/hicolor/scalable/apps/tikzit.svg delete mode 100644 tikzit-old/share/icons/hicolor/scalable/mimetypes/text-x-tikz.svg delete mode 100644 tikzit-old/share/mime/packages/tikzit.xml delete mode 120000 tikzit-old/share/tikzit delete mode 100644 tikzit-old/src/Makefile.am delete mode 100644 tikzit-old/src/common/CircleShape.h delete mode 100644 tikzit-old/src/common/CircleShape.m delete mode 100644 tikzit-old/src/common/ColorRGB.h delete mode 100644 tikzit-old/src/common/ColorRGB.m delete mode 100644 tikzit-old/src/common/DiamondShape.h delete mode 100644 tikzit-old/src/common/DiamondShape.m delete mode 100644 tikzit-old/src/common/Edge.h delete mode 100644 tikzit-old/src/common/Edge.m delete mode 100644 tikzit-old/src/common/EdgeStyle.h delete mode 100644 tikzit-old/src/common/EdgeStyle.m delete mode 100644 tikzit-old/src/common/Graph.h delete mode 100644 tikzit-old/src/common/Graph.m delete mode 100644 tikzit-old/src/common/GraphChange.h delete mode 100644 tikzit-old/src/common/GraphChange.m delete mode 100644 tikzit-old/src/common/GraphElementData.h delete mode 100644 tikzit-old/src/common/GraphElementData.m delete mode 100644 tikzit-old/src/common/GraphElementProperty.h delete mode 100644 tikzit-old/src/common/GraphElementProperty.m delete mode 100644 tikzit-old/src/common/Grid.h delete mode 100644 tikzit-old/src/common/Grid.m delete mode 100644 tikzit-old/src/common/NSError+Tikzit.h delete mode 100644 tikzit-old/src/common/NSError+Tikzit.m delete mode 100644 tikzit-old/src/common/NSFileManager+Utils.h delete mode 100644 tikzit-old/src/common/NSFileManager+Utils.m delete mode 100644 tikzit-old/src/common/NSString+LatexConstants.h delete mode 100644 tikzit-old/src/common/NSString+LatexConstants.m delete mode 100644 tikzit-old/src/common/NSString+Tikz.h delete mode 100644 tikzit-old/src/common/NSString+Tikz.m delete mode 100644 tikzit-old/src/common/NSString+Util.h delete mode 100644 tikzit-old/src/common/NSString+Util.m delete mode 100644 tikzit-old/src/common/Node.h delete mode 100644 tikzit-old/src/common/Node.m delete mode 100644 tikzit-old/src/common/NodeStyle.h delete mode 100644 tikzit-old/src/common/NodeStyle.m delete mode 100644 tikzit-old/src/common/PickSupport.h delete mode 100644 tikzit-old/src/common/PickSupport.m delete mode 100644 tikzit-old/src/common/Preambles.h delete mode 100644 tikzit-old/src/common/Preambles.m delete mode 100644 tikzit-old/src/common/PropertyHolder.h delete mode 100644 tikzit-old/src/common/PropertyHolder.m delete mode 100644 tikzit-old/src/common/RColor.h delete mode 100644 tikzit-old/src/common/RColor.m delete mode 100644 tikzit-old/src/common/RectangleShape.h delete mode 100644 tikzit-old/src/common/RectangleShape.m delete mode 100644 tikzit-old/src/common/RegularPolyShape.h delete mode 100644 tikzit-old/src/common/RegularPolyShape.m delete mode 100644 tikzit-old/src/common/RenderContext.h delete mode 100644 tikzit-old/src/common/Shape.h delete mode 100644 tikzit-old/src/common/Shape.m delete mode 100644 tikzit-old/src/common/ShapeNames.h delete mode 100644 tikzit-old/src/common/StyleManager.h delete mode 100644 tikzit-old/src/common/StyleManager.m delete mode 100644 tikzit-old/src/common/SupportDir.h delete mode 100644 tikzit-old/src/common/SupportDir.m delete mode 100644 tikzit-old/src/common/TikzGraphAssembler+Parser.h delete mode 100644 tikzit-old/src/common/TikzGraphAssembler.h delete mode 100644 tikzit-old/src/common/TikzGraphAssembler.m delete mode 100644 tikzit-old/src/common/TikzShape.h delete mode 100644 tikzit-old/src/common/TikzShape.m delete mode 100644 tikzit-old/src/common/Transformer.h delete mode 100644 tikzit-old/src/common/Transformer.m delete mode 100644 tikzit-old/src/common/test/Makefile delete mode 100644 tikzit-old/src/common/test/color.m delete mode 100644 tikzit-old/src/common/test/common.m delete mode 100644 tikzit-old/src/common/test/maths.m delete mode 100644 tikzit-old/src/common/test/parser.m delete mode 100644 tikzit-old/src/common/test/test.h delete mode 100644 tikzit-old/src/common/test/test.m delete mode 100644 tikzit-old/src/common/tikzlexer.lm delete mode 100644 tikzit-old/src/common/tikzparser.ym delete mode 100644 tikzit-old/src/common/tikzparserdefs.h delete mode 100644 tikzit-old/src/common/util.h delete mode 100644 tikzit-old/src/common/util.m delete mode 100644 tikzit-old/src/gtk/Application.h delete mode 100644 tikzit-old/src/gtk/Application.m delete mode 100644 tikzit-old/src/gtk/BoundingBoxTool.h delete mode 100644 tikzit-old/src/gtk/BoundingBoxTool.m delete mode 100644 tikzit-old/src/gtk/CairoRenderContext.h delete mode 100644 tikzit-old/src/gtk/CairoRenderContext.m delete mode 100644 tikzit-old/src/gtk/ColorRGB+Gtk.h delete mode 100644 tikzit-old/src/gtk/ColorRGB+Gtk.m delete mode 100644 tikzit-old/src/gtk/ColorRGB+IntegerListStorage.h delete mode 100644 tikzit-old/src/gtk/ColorRGB+IntegerListStorage.m delete mode 100644 tikzit-old/src/gtk/Configuration.h delete mode 100644 tikzit-old/src/gtk/Configuration.m delete mode 100644 tikzit-old/src/gtk/ContextWindow.h delete mode 100644 tikzit-old/src/gtk/ContextWindow.m delete mode 100644 tikzit-old/src/gtk/CreateEdgeTool.h delete mode 100644 tikzit-old/src/gtk/CreateEdgeTool.m delete mode 100644 tikzit-old/src/gtk/CreateNodeTool.h delete mode 100644 tikzit-old/src/gtk/CreateNodeTool.m delete mode 100644 tikzit-old/src/gtk/DocumentContext.h delete mode 100644 tikzit-old/src/gtk/Edge+Render.h delete mode 100644 tikzit-old/src/gtk/Edge+Render.m delete mode 100644 tikzit-old/src/gtk/EdgeStyle+Gtk.h delete mode 100644 tikzit-old/src/gtk/EdgeStyle+Gtk.m delete mode 100644 tikzit-old/src/gtk/EdgeStyle+Storage.h delete mode 100644 tikzit-old/src/gtk/EdgeStyle+Storage.m delete mode 100644 tikzit-old/src/gtk/EdgeStyleEditor.h delete mode 100644 tikzit-old/src/gtk/EdgeStyleEditor.m delete mode 100644 tikzit-old/src/gtk/EdgeStyleSelector.h delete mode 100644 tikzit-old/src/gtk/EdgeStyleSelector.m delete mode 100644 tikzit-old/src/gtk/EdgeStylesModel.h delete mode 100644 tikzit-old/src/gtk/EdgeStylesModel.m delete mode 100644 tikzit-old/src/gtk/EdgeStylesPalette.h delete mode 100644 tikzit-old/src/gtk/EdgeStylesPalette.m delete mode 100644 tikzit-old/src/gtk/FileChooserDialog.h delete mode 100644 tikzit-old/src/gtk/FileChooserDialog.m delete mode 100644 tikzit-old/src/gtk/GraphEditorPanel.h delete mode 100644 tikzit-old/src/gtk/GraphEditorPanel.m delete mode 100644 tikzit-old/src/gtk/GraphRenderer.h delete mode 100644 tikzit-old/src/gtk/GraphRenderer.m delete mode 100644 tikzit-old/src/gtk/HandTool.h delete mode 100644 tikzit-old/src/gtk/HandTool.m delete mode 100644 tikzit-old/src/gtk/InputDelegate.h delete mode 100644 tikzit-old/src/gtk/Menu.h delete mode 100644 tikzit-old/src/gtk/Menu.m delete mode 100644 tikzit-old/src/gtk/NSError+Glib.h delete mode 100644 tikzit-old/src/gtk/NSError+Glib.m delete mode 100644 tikzit-old/src/gtk/NSFileManager+Glib.h delete mode 100644 tikzit-old/src/gtk/NSFileManager+Glib.m delete mode 100644 tikzit-old/src/gtk/NSString+Glib.h delete mode 100644 tikzit-old/src/gtk/NSString+Glib.m delete mode 100644 tikzit-old/src/gtk/Node+Render.h delete mode 100644 tikzit-old/src/gtk/Node+Render.m delete mode 100644 tikzit-old/src/gtk/NodeStyle+Gtk.h delete mode 100644 tikzit-old/src/gtk/NodeStyle+Gtk.m delete mode 100644 tikzit-old/src/gtk/NodeStyle+Render.h delete mode 100644 tikzit-old/src/gtk/NodeStyle+Storage.h delete mode 100644 tikzit-old/src/gtk/NodeStyle+Storage.m delete mode 100644 tikzit-old/src/gtk/NodeStyleEditor.h delete mode 100644 tikzit-old/src/gtk/NodeStyleEditor.m delete mode 100644 tikzit-old/src/gtk/NodeStyleSelector.h delete mode 100644 tikzit-old/src/gtk/NodeStyleSelector.m delete mode 100644 tikzit-old/src/gtk/NodeStylesModel.h delete mode 100644 tikzit-old/src/gtk/NodeStylesModel.m delete mode 100644 tikzit-old/src/gtk/NodeStylesPalette.h delete mode 100644 tikzit-old/src/gtk/NodeStylesPalette.m delete mode 100644 tikzit-old/src/gtk/PreambleEditor.h delete mode 100644 tikzit-old/src/gtk/PreambleEditor.m delete mode 100644 tikzit-old/src/gtk/Preambles+Storage.h delete mode 100644 tikzit-old/src/gtk/Preambles+Storage.m delete mode 100644 tikzit-old/src/gtk/PreviewRenderer.h delete mode 100644 tikzit-old/src/gtk/PreviewRenderer.m delete mode 100644 tikzit-old/src/gtk/PreviewWindow.h delete mode 100644 tikzit-old/src/gtk/PreviewWindow.m delete mode 100644 tikzit-old/src/gtk/PropertiesPane.h delete mode 100644 tikzit-old/src/gtk/PropertiesPane.m delete mode 100644 tikzit-old/src/gtk/PropertyListEditor.h delete mode 100644 tikzit-old/src/gtk/PropertyListEditor.m delete mode 100644 tikzit-old/src/gtk/RecentManager.h delete mode 100644 tikzit-old/src/gtk/RecentManager.m delete mode 100644 tikzit-old/src/gtk/SelectTool.h delete mode 100644 tikzit-old/src/gtk/SelectTool.m delete mode 100644 tikzit-old/src/gtk/SelectionPane.h delete mode 100644 tikzit-old/src/gtk/SelectionPane.m delete mode 100644 tikzit-old/src/gtk/SettingsDialog.h delete mode 100644 tikzit-old/src/gtk/SettingsDialog.m delete mode 100644 tikzit-old/src/gtk/Shape+Render.h delete mode 100644 tikzit-old/src/gtk/Shape+Render.m delete mode 100644 tikzit-old/src/gtk/StyleManager+Storage.h delete mode 100644 tikzit-old/src/gtk/StyleManager+Storage.m delete mode 100644 tikzit-old/src/gtk/Surface.h delete mode 100644 tikzit-old/src/gtk/TZFoundation.h delete mode 100644 tikzit-old/src/gtk/TikzDocument.h delete mode 100644 tikzit-old/src/gtk/TikzDocument.m delete mode 100644 tikzit-old/src/gtk/Tool.h delete mode 100644 tikzit-old/src/gtk/ToolBox.h delete mode 100644 tikzit-old/src/gtk/ToolBox.m delete mode 100644 tikzit-old/src/gtk/WidgetSurface.h delete mode 100644 tikzit-old/src/gtk/WidgetSurface.m delete mode 100644 tikzit-old/src/gtk/Window.h delete mode 100644 tikzit-old/src/gtk/Window.m delete mode 100644 tikzit-old/src/gtk/cairo_helpers.h delete mode 100644 tikzit-old/src/gtk/cairo_helpers.m delete mode 100644 tikzit-old/src/gtk/clipboard.h delete mode 100644 tikzit-old/src/gtk/clipboard.m delete mode 100644 tikzit-old/src/gtk/gtkhelpers.h delete mode 100644 tikzit-old/src/gtk/gtkhelpers.m delete mode 100644 tikzit-old/src/gtk/logo.h delete mode 100644 tikzit-old/src/gtk/logo.m delete mode 100644 tikzit-old/src/gtk/main.m delete mode 100644 tikzit-old/src/gtk/mkdtemp.h delete mode 100644 tikzit-old/src/gtk/mkdtemp.m delete mode 100644 tikzit-old/src/gtk/stat.h delete mode 100644 tikzit-old/src/gtk/test/gtk.m delete mode 100644 tikzit-old/src/gtk/test/main.m delete mode 100644 tikzit-old/src/gtk/tzstockitems.h delete mode 100644 tikzit-old/src/gtk/tzstockitems.m delete mode 100644 tikzit-old/src/gtk/tztoolpalette.h delete mode 100644 tikzit-old/src/gtk/tztoolpalette.m delete mode 100644 tikzit-old/src/osx/AppDelegate.h delete mode 100644 tikzit-old/src/osx/AppDelegate.m delete mode 100644 tikzit-old/src/osx/CALayer+DrawLabel.h delete mode 100644 tikzit-old/src/osx/CALayer+DrawLabel.m delete mode 100644 tikzit-old/src/osx/CoreGraphicsRenderContext.h delete mode 100644 tikzit-old/src/osx/CoreGraphicsRenderContext.m delete mode 100644 tikzit-old/src/osx/CustomNodeCellView.h delete mode 100644 tikzit-old/src/osx/CustomNodeCellView.m delete mode 100644 tikzit-old/src/osx/CustomNodeController.h delete mode 100644 tikzit-old/src/osx/CustomNodeController.m delete mode 100644 tikzit-old/src/osx/CustomNodes.xib delete mode 100644 tikzit-old/src/osx/DraggablePDFView.h delete mode 100644 tikzit-old/src/osx/DraggablePDFView.m delete mode 100644 tikzit-old/src/osx/EdgeControlLayer.h delete mode 100644 tikzit-old/src/osx/EdgeControlLayer.m delete mode 100644 tikzit-old/src/osx/EdgeStyle+Coder.h delete mode 100644 tikzit-old/src/osx/EdgeStyle+Coder.m delete mode 100644 tikzit-old/src/osx/Graph+Coder.h delete mode 100644 tikzit-old/src/osx/Graph+Coder.m delete mode 100644 tikzit-old/src/osx/GraphicsView.h delete mode 100644 tikzit-old/src/osx/GraphicsView.m delete mode 100644 tikzit-old/src/osx/Grid.h delete mode 100644 tikzit-old/src/osx/Grid.m delete mode 100644 tikzit-old/src/osx/MultiCombo.h delete mode 100644 tikzit-old/src/osx/MultiCombo.m delete mode 100644 tikzit-old/src/osx/MultiField.h delete mode 100644 tikzit-old/src/osx/MultiField.m delete mode 100644 tikzit-old/src/osx/NilToEmptyStringTransformer.h delete mode 100644 tikzit-old/src/osx/NilToEmptyStringTransformer.m delete mode 100644 tikzit-old/src/osx/NodeLayer.h delete mode 100644 tikzit-old/src/osx/NodeLayer.m delete mode 100644 tikzit-old/src/osx/NodeSelectionLayer.h delete mode 100644 tikzit-old/src/osx/NodeSelectionLayer.m delete mode 100644 tikzit-old/src/osx/NodeStyle+Coder.h delete mode 100644 tikzit-old/src/osx/NodeStyle+Coder.m delete mode 100644 tikzit-old/src/osx/ParseErrorView.h delete mode 100644 tikzit-old/src/osx/ParseErrorView.m delete mode 100644 tikzit-old/src/osx/PreambleController.h delete mode 100644 tikzit-old/src/osx/PreambleController.m delete mode 100644 tikzit-old/src/osx/Preambles+Coder.h delete mode 100644 tikzit-old/src/osx/Preambles+Coder.m delete mode 100644 tikzit-old/src/osx/PreferenceController.h delete mode 100644 tikzit-old/src/osx/PreferenceController.m delete mode 100644 tikzit-old/src/osx/Preferences.xib delete mode 100644 tikzit-old/src/osx/PreviewController.h delete mode 100644 tikzit-old/src/osx/PreviewController.m delete mode 100644 tikzit-old/src/osx/PropertyInspectorController.h delete mode 100644 tikzit-old/src/osx/PropertyInspectorController.m delete mode 100644 tikzit-old/src/osx/SelectBoxLayer.h delete mode 100644 tikzit-old/src/osx/SelectBoxLayer.m delete mode 100644 tikzit-old/src/osx/SelectableCollectionViewItem.h delete mode 100644 tikzit-old/src/osx/SelectableCollectionViewItem.m delete mode 100644 tikzit-old/src/osx/SelectableNodeView.h delete mode 100644 tikzit-old/src/osx/SelectableNodeView.m delete mode 100644 tikzit-old/src/osx/StylePaletteController.h delete mode 100644 tikzit-old/src/osx/StylePaletteController.m delete mode 100644 tikzit-old/src/osx/TikzDocument.h delete mode 100644 tikzit-old/src/osx/TikzDocument.m delete mode 100644 tikzit-old/src/osx/TikzFormatter.h delete mode 100644 tikzit-old/src/osx/TikzFormatter.m delete mode 100644 tikzit-old/src/osx/TikzSourceController.h delete mode 100644 tikzit-old/src/osx/TikzSourceController.m delete mode 100644 tikzit-old/src/osx/TikzWindowController.h delete mode 100644 tikzit-old/src/osx/TikzWindowController.m delete mode 100644 tikzit-old/src/osx/ToolPaletteController.h delete mode 100644 tikzit-old/src/osx/ToolPaletteController.m delete mode 100644 tikzit-old/src/osx/UpdatePreferenceController.h delete mode 100644 tikzit-old/src/osx/UpdatePreferenceController.m delete mode 100644 tikzit-old/src/osx/UpdatePreferencePanel.xib delete mode 100644 tikzit-old/src/osx/main.m delete mode 100644 tikzit-old/src/osx/test/main.m delete mode 100644 tikzit-old/src/osx/test/osx.m delete mode 100644 tikzit-old/src/tikzit.rc delete mode 100644 tikzit-old/text-x-generic.png delete mode 100644 tikzit-old/text-x-script.png delete mode 100644 tikzit-old/tikzit.icns delete mode 100644 tikzit-old/tikzit.ico delete mode 100644 tikzit-old/tikzit.spec delete mode 100644 tikzit-old/tikzit48x48.png delete mode 100644 tikzit-old/tikzit_dsa_pub.pem delete mode 100644 tikzit-old/tikzitdoc.icns delete mode 100644 tikzit-old/transform-crop-and-resize.png delete mode 100644 tikzit-old/transform-move.png delete mode 100755 tikzit-old/updates.png (limited to 'src') diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/data/edge.cpp b/src/data/edge.cpp index a18c8ea..d741c56 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "edge.h" #include "tikzit.h" #include "util.h" diff --git a/src/data/edge.h b/src/data/edge.h index 3dc0211..dd09469 100644 --- a/src/data/edge.h +++ b/src/data/edge.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef EDGE_H #define EDGE_H diff --git a/src/data/edgestyle.cpp b/src/data/edgestyle.cpp index 9fb2638..079d4f5 100644 --- a/src/data/edgestyle.cpp +++ b/src/data/edgestyle.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "edgestyle.h" #include diff --git a/src/data/edgestyle.h b/src/data/edgestyle.h index 6b0c3bb..cf55d06 100644 --- a/src/data/edgestyle.h +++ b/src/data/edgestyle.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef EDGESTYLE_H #define EDGESTYLE_H diff --git a/src/data/graph.cpp b/src/data/graph.cpp index 4153bc0..00b2dce 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "graph.h" #include "util.h" diff --git a/src/data/graph.h b/src/data/graph.h index d00d2b2..77af253 100644 --- a/src/data/graph.h +++ b/src/data/graph.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * A graph defined by tikz code. */ diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 01736b8..5b35f63 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "graphelementdata.h" #include diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index 740d4dc..58e57a0 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef GRAPHELEMENTDATA_H #define GRAPHELEMENTDATA_H diff --git a/src/data/graphelementproperty.cpp b/src/data/graphelementproperty.cpp index a50af58..0717952 100644 --- a/src/data/graphelementproperty.cpp +++ b/src/data/graphelementproperty.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "graphelementproperty.h" #include diff --git a/src/data/graphelementproperty.h b/src/data/graphelementproperty.h index 01b6e5a..d37f69e 100644 --- a/src/data/graphelementproperty.h +++ b/src/data/graphelementproperty.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef GRAPHELEMENTPROPERTY_H #define GRAPHELEMENTPROPERTY_H diff --git a/src/data/node.cpp b/src/data/node.cpp index 085bdf5..ce4286f 100644 --- a/src/data/node.cpp +++ b/src/data/node.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "node.h" #include "tikzit.h" diff --git a/src/data/node.h b/src/data/node.h index 241d1ca..4d4beee 100644 --- a/src/data/node.h +++ b/src/data/node.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef NODE_H #define NODE_H diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 3f2c921..b22105c 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "nodestyle.h" #include diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index 4b48bb3..db38a0a 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef NODESTYLE_H #define NODESTYLE_H diff --git a/src/data/style.cpp b/src/data/style.cpp index 927271c..2811612 100644 --- a/src/data/style.cpp +++ b/src/data/style.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "style.h" Style::Style() : _name("none"), _data(0) diff --git a/src/data/style.h b/src/data/style.h index 9d58ebe..ac7e606 100644 --- a/src/data/style.h +++ b/src/data/style.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef STYLE_H #define STYLE_H diff --git a/src/data/tikzassembler.cpp b/src/data/tikzassembler.cpp index e0197da..fed3c39 100644 --- a/src/data/tikzassembler.cpp +++ b/src/data/tikzassembler.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzassembler.h" #include "tikzparserdefs.h" diff --git a/src/data/tikzassembler.h b/src/data/tikzassembler.h index 38d67a7..f5b580c 100644 --- a/src/data/tikzassembler.h +++ b/src/data/tikzassembler.h @@ -1,4 +1,22 @@ -/** +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/*! * Convenience class to hold the parser state while loading tikz graphs or projects. */ diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index 206ec5b..f685656 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include #include #include diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h index 8f16a53..0d6b48c 100644 --- a/src/data/tikzdocument.h +++ b/src/data/tikzdocument.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * This class contains a tikz Graph, source code, file info, and undo stack. It serves as the model * in the MVC triple (TikzDocument, TikzView, TikzScene). diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index 45494d2..7d7e990 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -1,28 +1,29 @@ %{ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger, Chris Heunen, + K. Johan Paulsson, Alex Merry + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + /*! * \file tikzlexer.l * * The lexer for tikz input. */ -/* - * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger - * Copyright 2013 K. Johan Paulsson - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ #include "tikzparserdefs.h" #include "tikzparser.parser.hpp" diff --git a/src/data/tikzparserdefs.h b/src/data/tikzparserdefs.h index 5865739..a5e77be 100644 --- a/src/data/tikzparserdefs.h +++ b/src/data/tikzparserdefs.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef TIKZPARSERDEFS_H #define TIKZPARSERDEFS_H diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp index c198412..a924c01 100644 --- a/src/data/tikzstyles.cpp +++ b/src/data/tikzstyles.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzstyles.h" #include "nodestyle.h" diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h index 4cd7d6e..0f7cce1 100644 --- a/src/data/tikzstyles.h +++ b/src/data/tikzstyles.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef PROJECT_H #define PROJECT_H diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index de51db3..f469506 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzit.h" #include "edgeitem.h" diff --git a/src/gui/edgeitem.h b/src/gui/edgeitem.h index 948f137..3d4758a 100644 --- a/src/gui/edgeitem.h +++ b/src/gui/edgeitem.h @@ -1,4 +1,22 @@ -/** +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/*! * A QGraphicsItem that handles drawing a single edge. */ diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index 7e2584c..3625338 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "mainmenu.h" #include "tikzit.h" diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index bceb69d..aa5c727 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef MAINMENU_H #define MAINMENU_H diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index b0b7ea6..922747d 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzit.h" #include "nodeitem.h" #include "tikzscene.h" diff --git a/src/gui/nodeitem.h b/src/gui/nodeitem.h index 91b3f63..678a7e8 100644 --- a/src/gui/nodeitem.h +++ b/src/gui/nodeitem.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * A QGraphicsItem that handles drawing a single node. */ diff --git a/src/gui/propertypalette.cpp b/src/gui/propertypalette.cpp index 3e4ba88..c27b8b2 100644 --- a/src/gui/propertypalette.cpp +++ b/src/gui/propertypalette.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "propertypalette.h" #include "graphelementdata.h" #include "ui_propertypalette.h" diff --git a/src/gui/propertypalette.h b/src/gui/propertypalette.h index 80f2d88..29fb0af 100644 --- a/src/gui/propertypalette.h +++ b/src/gui/propertypalette.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * Enables the user to edit properties of the graph, as well as the selected node/edge. */ diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index f1462df..6d6599b 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "stylepalette.h" #include "ui_stylepalette.h" #include "tikzit.h" diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index cc8fb73..45dc8da 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef STYLEPALETTE_H #define STYLEPALETTE_H diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 3c8fb71..772c67b 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzit.h" #include "util.h" #include "tikzscene.h" diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 9d90c4f..4ac56c7 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * Manage the scene, which contains a single Graph, and respond to user input. This serves as * the controller for the MVC (TikzDocument, TikzView, TikzScene). diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 9997106..700cf29 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzview.h" #include "tikzit.h" diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h index b2006c8..4ec9f3d 100644 --- a/src/gui/tikzview.h +++ b/src/gui/tikzview.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * Display a Graph, and manage any user input that purely changes the view (e.g. Zoom). This * serves as the view in the MVC (TikzDocument, TikzView, TikzScene). diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 0d0bd30..43a4a49 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "toolpalette.h" #include diff --git a/src/gui/toolpalette.h b/src/gui/toolpalette.h index 1876043..a001055 100644 --- a/src/gui/toolpalette.h +++ b/src/gui/toolpalette.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * A small window that lets the user select the current editing tool. */ diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 5ce6941..5525cb7 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "undocommands.h" #include "nodeitem.h" #include "edgeitem.h" diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index ad76479..292632e 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * \file undocommands.h * diff --git a/src/main.cpp b/src/main.cpp index 3532888..4d6f9a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,23 @@ -/** +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +/*! * \file main.cpp * * The main entry point for the TikZiT executable. diff --git a/src/tikzit.cpp b/src/tikzit.cpp index dca6d95..9a4e166 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "tikzit.h" #include "tikzassembler.h" #include "tikzstyles.h" diff --git a/src/tikzit.h b/src/tikzit.h index 5ae9490..232a4aa 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -1,3 +1,22 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + /*! * * \mainpage TikZiT Documentation diff --git a/src/util.cpp b/src/util.cpp index 5e56cd9..9c699f5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "util.h" float bezierInterpolate(float dist, float c0, float c1, float c2, float c3) { diff --git a/src/util.h b/src/util.h index 706928d..aff0587 100644 --- a/src/util.h +++ b/src/util.h @@ -1,3 +1,21 @@ +/* + TikZiT - a GUI diagram editor for TikZ + Copyright (C) 2018 Aleks Kissinger + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + /*! * Various utility functions, mostly for mathematical calculation. */ diff --git a/tikzit-old/.gitignore b/tikzit-old/.gitignore deleted file mode 100644 index fc1d580..0000000 --- a/tikzit-old/.gitignore +++ /dev/null @@ -1,235 +0,0 @@ -# Previous gitignore items - -*~ -*.swp -*.o -.deps -.dirstamp -Makefile -Makefile.in -/aclocal.m4 -/autom4te.cache -/config.guess -/config.log -/config.status -/config.sub -/configure -/depcomp -/install-sh -/missing -/src/tikzit -/src/tikzit.res -/src/common/tikzlexer.h -/src/common/tikzlexer.m -/src/common/tikzparser.m -/src/common/tikzparser.h -/src/gtk/icondata.m -/src/gtk/logodata.m -/src/gtk/edgedecdata.m -/tikzit-*.tar.gz -/tikzit-*.tar.bz2 -xbuild - -######################### -# .gitignore file for Xcode4 and Xcode5 Source projects -# -# Apple bugs, waiting for Apple to fix/respond: -# -# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? -# -# Version 2.3 -# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects -# -# 2014 updates: -# - appended non-standard items DISABLED by default (uncomment if you use those tools) -# - removed the edit that an SO.com moderator made without bothering to ask me -# - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker -# 2013 updates: -# - fixed the broken "save personal Schemes" -# - added line-by-line explanations for EVERYTHING (some were missing) -# -# NB: if you are storing "built" products, this WILL NOT WORK, -# and you should use a different .gitignore (or none at all) -# This file is for SOURCE projects, where there are many extra -# files that we want to exclude -# -######################### - -##### -# OS X temporary files that should never be committed -# -# c.f. http://www.westwind.com/reference/os-x/invisibles.html - -.DS_Store -.Trashes -*.swp - -# -# *.lock - this is used and abused by many editors for many different things. -# For the main ones I use (e.g. Eclipse), it should be excluded -# from source-control, but YMMV. -# (lock files are usually local-only file-synchronization on the local FS that should NOT go in git) -# c.f. the "OPTIONAL" section at bottom though, for tool-specific variations! - -*.lock - - -# -# profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?) -#profile - - -#### -# Xcode temporary files that should never be committed -# -# NB: NIB/XIB files still exist even on Storyboard projects, so we want this... - -*~.nib - - -#### -# Xcode build files - -# -# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" - -DerivedData/ - -# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" - -build/ - - -##### -# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) -# -# This is complicated: -# -# SOMETIMES you need to put this file in version control. -# Apple designed it poorly - if you use "custom executables", they are -# saved in this file. -# 99% of projects do NOT use those, so they do NOT want to version control this file. -# ..but if you're in the 1%, comment out the line "*.pbxuser" - -# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html - -*.pbxuser - -# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html - -*.mode1v3 - -# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html - -*.mode2v3 - -# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file - -*.perspectivev3 - -# NB: also, whitelist the default ones, some projects need to use these -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - - -#### -# Xcode 4 - semi-personal settings -# -# -# OPTION 1: --------------------------------- -# throw away ALL personal settings (including custom schemes! -# - unless they are "shared") -# -# NB: this is exclusive with OPTION 2 below -xcuserdata - -# OPTION 2: --------------------------------- -# get rid of ALL personal settings, but KEEP SOME OF THEM -# - NB: you must manually uncomment the bits you want to keep -# -# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X, -# or manually install git over the top of the OS X version -# NB: this is exclusive with OPTION 1 above -# -#xcuserdata/**/* - -# (requires option 2 above): Personal Schemes -# -#!xcuserdata/**/xcschemes/* - -#### -# XCode 4 workspaces - more detailed -# -# Workspaces are important! They are a core feature of Xcode - don't exclude them :) -# -# Workspace layout is quite spammy. For reference: -# -# /(root)/ -# /(project-name).xcodeproj/ -# project.pbxproj -# /project.xcworkspace/ -# contents.xcworkspacedata -# /xcuserdata/ -# /(your name)/xcuserdatad/ -# UserInterfaceState.xcuserstate -# /xcsshareddata/ -# /xcschemes/ -# (shared scheme name).xcscheme -# /xcuserdata/ -# /(your name)/xcuserdatad/ -# (private scheme).xcscheme -# xcschememanagement.plist -# -# - -#### -# Xcode 4 - Deprecated classes -# -# Allegedly, if you manually "deprecate" your classes, they get moved here. -# -# We're using source-control, so this is a "feature" that we do not want! - -*.moved-aside - -#### -# OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development -# -# NB: I'd rather not include these here, but gitignore's design is weak and doesn't allow -# modular gitignore: you have to put EVERYTHING in one file. -# -# COCOAPODS: -# -# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock -# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -#!Podfile.lock -# -# RUBY: -# -# c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/ -# -#!Gemfile.lock -# -# IDEA: -# -#.idea -# -# TEXTMATE: -# -# -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422 -# -#tm_build_errors - -#### -# UNKNOWN: recommended by others, but I can't discover what these files are -# -# Community suggestions (unverified, no evidence available - DISABLED by default) -# -# 1. Xcode 5 - VCS file -# -# "The data in this file not represent state of your project. -# If you'll leave this file in git - you will have merge conflicts during -# pull your cahnges to other's repo" -# -#*.xccheckout \ No newline at end of file diff --git a/tikzit-old/AH_latex_head.png b/tikzit-old/AH_latex_head.png deleted file mode 100644 index b25cf6d..0000000 Binary files a/tikzit-old/AH_latex_head.png and /dev/null differ diff --git a/tikzit-old/AH_latex_tail.png b/tikzit-old/AH_latex_tail.png deleted file mode 100644 index 0825cda..0000000 Binary files a/tikzit-old/AH_latex_tail.png and /dev/null differ diff --git a/tikzit-old/AH_none.png b/tikzit-old/AH_none.png deleted file mode 100644 index 6322374..0000000 Binary files a/tikzit-old/AH_none.png and /dev/null differ diff --git a/tikzit-old/AH_plain_head.png b/tikzit-old/AH_plain_head.png deleted file mode 100644 index 8a398fa..0000000 Binary files a/tikzit-old/AH_plain_head.png and /dev/null differ diff --git a/tikzit-old/AH_plain_tail.png b/tikzit-old/AH_plain_tail.png deleted file mode 100644 index 45b1876..0000000 Binary files a/tikzit-old/AH_plain_tail.png and /dev/null differ diff --git a/tikzit-old/COPYING b/tikzit-old/COPYING deleted file mode 100644 index 1f963da..0000000 --- a/tikzit-old/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - diff --git a/tikzit-old/DESIGN-GTK b/tikzit-old/DESIGN-GTK deleted file mode 100644 index 7952a34..0000000 --- a/tikzit-old/DESIGN-GTK +++ /dev/null @@ -1,23 +0,0 @@ -Some documentation on how the GTK+ port is designed. - -State classes: - -StyleManager keeps track of what user-defined styles the application -knows about, and which one is currently "active". The active style -is used when creating new nodes. - -Preambles keeps track of the preambles used for previews. - - -GUI classes: - -MainWindow is the core class that manages the application as a whole. -It manages the main GtkWindow and is generally responsible for loading -the various UI elements. It also keeps track of the main application -configuration file, the user-defined styles (via StyleManager) and the -custom preambles (via Preambles). - -The Menu class manages the menu and toolbar for MainWindow. It uses -GtkUiManager to load these from an XML description, and deals with the -GTK+ callbacks for the various actions. - diff --git a/tikzit-old/ED_arrow.png b/tikzit-old/ED_arrow.png deleted file mode 100644 index 153d2e1..0000000 Binary files a/tikzit-old/ED_arrow.png and /dev/null differ diff --git a/tikzit-old/ED_none.png b/tikzit-old/ED_none.png deleted file mode 100644 index f95140c..0000000 Binary files a/tikzit-old/ED_none.png and /dev/null differ diff --git a/tikzit-old/ED_tick.png b/tikzit-old/ED_tick.png deleted file mode 100644 index a3882fe..0000000 Binary files a/tikzit-old/ED_tick.png and /dev/null differ diff --git a/tikzit-old/English.lproj/Credits.rtf b/tikzit-old/English.lproj/Credits.rtf deleted file mode 100644 index 708d138..0000000 --- a/tikzit-old/English.lproj/Credits.rtf +++ /dev/null @@ -1,18 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf250 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaSans-Typewriter;} -{\colortbl;\red255\green255\blue255;\red0\green0\blue0;} -\vieww9000\viewh8400\viewkind0 -\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural - -\f0\b\fs24 \cf0 TikZiT\ -\ -Copyright 2010 Aleks Kissinger. All rights reserved.\ - -\b0 \ -\pard\tx560\pardeftab560\ql\qnatural\pardirnatural - -\f1\fs22 \cf2 \CocoaLigature0 TikZiT is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\ -\ -TikZiT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\ -\ -You should have received a copy of the GNU General Public License along with TikZiT. If not, see .} \ No newline at end of file diff --git a/tikzit-old/English.lproj/CustomNodes.xib b/tikzit-old/English.lproj/CustomNodes.xib deleted file mode 100644 index 33f6e3a..0000000 --- a/tikzit-old/English.lproj/CustomNodes.xib +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - - name - strokeThickness - strokeColor - fillColor - strokeColorIsKnown - fillColorIsKnown - representedObject.name - shapeName - scale - @distinctUnionOfObjects.category - category - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \begin{tikzpicture} - -\end{tikzpicture} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/English.lproj/InfoPlist.strings b/tikzit-old/English.lproj/InfoPlist.strings deleted file mode 100644 index 477b28f..0000000 --- a/tikzit-old/English.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/tikzit-old/English.lproj/MainMenu.xib b/tikzit-old/English.lproj/MainMenu.xib deleted file mode 100644 index c7f22d7..0000000 --- a/tikzit-old/English.lproj/MainMenu.xib +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -CA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tikzit-old/English.lproj/Preamble.xib b/tikzit-old/English.lproj/Preamble.xib deleted file mode 100644 index 54a4125..0000000 --- a/tikzit-old/English.lproj/Preamble.xib +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - key - - - default - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tikzit-old/English.lproj/Preview.xib b/tikzit-old/English.lproj/Preview.xib deleted file mode 100644 index cb1e82c..0000000 --- a/tikzit-old/English.lproj/Preview.xib +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tikzit-old/English.lproj/PropertyInspector.xib b/tikzit-old/English.lproj/PropertyInspector.xib deleted file mode 100644 index 9f19b5c..0000000 --- a/tikzit-old/English.lproj/PropertyInspector.xib +++ /dev/null @@ -1,769 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Multiple Values - NilToEmptyStringTransformer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NilToEmptyStringTransformer - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NilToEmptyStringTransformer - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NilToEmptyStringTransformer - - - - - - - - - - - - - - - - - - - - - - - NSNegateBoolean - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NilToEmptyStringTransformer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - key - value - isAtom - - - - - key - value - isAtom - - - - - key - value - isAtom - - - - - key - value - isAtom - - - - - label - - - - - - - - edgeNode - - - - - - - - - - - - - - - - - - - - - - - - - - - NilToEmptyStringTransformer - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/English.lproj/StylePalette.xib b/tikzit-old/English.lproj/StylePalette.xib deleted file mode 100644 index 6385ba8..0000000 --- a/tikzit-old/English.lproj/StylePalette.xib +++ /dev/null @@ -1,631 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uncategorized - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uncategorized - - - - - - - - - name - strokeThickness - strokeColor - fillColor - strokeColorIsKnown - fillColorIsKnown - representedObject.name - shapeName - scale - @distinctUnionOfObjects.category - category - - - - - - - - @distinctUnionOfObjects.category - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uncategorized - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - uncategorized - - - - - - - - - - - name - headStyle - tailStyle - decorationStyle - category - - - - - - - - name - headStyle - tailStyle - decorationStyle - category - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tikzit-old/English.lproj/TikzDocument.xib b/tikzit-old/English.lproj/TikzDocument.xib deleted file mode 100644 index 842b810..0000000 --- a/tikzit-old/English.lproj/TikzDocument.xib +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \begin{tikzpicture} - -\end{tikzpicture} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tikzit-old/English.lproj/UserDefaults.plist b/tikzit-old/English.lproj/UserDefaults.plist deleted file mode 100644 index cdd5c8f..0000000 --- a/tikzit-old/English.lproj/UserDefaults.plist +++ /dev/null @@ -1,10 +0,0 @@ - - - - - net.sourceforge.tikzit.pdflatexpath - /usr/texbin/pdflatex - net.sourceforge.tikzit.previewfocus - - - diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Headers b/tikzit-old/Frameworks/SFBInspectors.framework/Headers deleted file mode 120000 index a177d2a..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Resources b/tikzit-old/Frameworks/SFBInspectors.framework/Resources deleted file mode 120000 index 953ee36..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/SFBInspectors b/tikzit-old/Frameworks/SFBInspectors.framework/SFBInspectors deleted file mode 120000 index d0c5a0b..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/SFBInspectors +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/SFBInspectors \ No newline at end of file diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPane.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPane.h deleted file mode 100644 index b50c12d..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPane.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -#define INSPECTOR_PANE_HEADER_HEIGHT 17 - -@class SFBInspectorPaneHeader, SFBInspectorPaneBody; - -@interface SFBInspectorPane : NSView -{ -@private - BOOL _collapsed; - SFBInspectorPaneHeader *_headerView; - SFBInspectorPaneBody *_bodyView; -} - -@property (readonly, assign, getter=isCollapsed) BOOL collapsed; - -- (NSString *) title; -- (void) setTitle:(NSString *)title; - -- (IBAction) toggleCollapsed:(id)sender; -- (void) setCollapsed:(BOOL)collapsed animate:(BOOL)animate; - -- (SFBInspectorPaneHeader *) headerView; -- (SFBInspectorPaneBody *) bodyView; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneBody.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneBody.h deleted file mode 100644 index 250f9e6..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneBody.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -@interface SFBInspectorPaneBody : NSView -{ -@private - CGFloat _normalHeight; -} - -@property (readonly, assign) CGFloat normalHeight; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneHeader.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneHeader.h deleted file mode 100644 index 3512d75..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorPaneHeader.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -@class SFBInspectorPane; - -@interface SFBInspectorPaneHeader : NSView -{ -@private - BOOL _pressed; - NSButton *_disclosureButton; - NSTextField *_titleTextField; -} - -- (NSString *) title; -- (void) setTitle:(NSString *)title; - -- (NSButton *) disclosureButton; -- (NSTextField *) titleTextField; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorView.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorView.h deleted file mode 100644 index e7f4b53..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBInspectorView.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -@interface SFBInspectorView : NSView -{ -@private - NSSize _initialWindowSize; -} - -- (void) addInspectorPaneController:(NSViewController *)paneController; -- (void) addInspectorPane:(NSView *)paneBody title:(NSString *)title; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelector.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelector.h deleted file mode 100644 index 8645914..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelector.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -#define VIEW_SELECTOR_BAR_HEIGHT 25 - -@class SFBViewSelectorBar; - -@interface SFBViewSelector : NSView -{ -@private - NSSize _initialWindowSize; - SFBViewSelectorBar *_selectorBar; - NSView *_bodyView; -} - -- (SFBViewSelectorBar *) selectorBar; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBar.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBar.h deleted file mode 100644 index d0c8c30..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBar.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -@class SFBViewSelectorBarItem; - -@interface SFBViewSelectorBar : NSView -{ -@private - NSInteger _selectedIndex; - NSInteger _pressedIndex; - NSMutableArray *_items; -} - -@property (assign) NSInteger selectedIndex; -@property (readonly) SFBViewSelectorBarItem * selectedItem; - -- (void) addItem:(SFBViewSelectorBarItem *)item; - -- (BOOL) selectItem:(SFBViewSelectorBarItem *)item; -- (BOOL) selectItemWithIdentifer:(NSString *)itemIdentifier; - -- (SFBViewSelectorBarItem *) itemAtIndex:(NSInteger)itemIndex; -- (SFBViewSelectorBarItem *) itemWithIdentifier:(NSString *)itemIdentifier; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBarItem.h b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBarItem.h deleted file mode 100644 index c18cfb3..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Headers/SFBViewSelectorBarItem.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2009 Stephen F. Booth - * All Rights Reserved - */ - -#import - -@interface SFBViewSelectorBarItem : NSObject -{ -@private - NSString *_identifier; - NSString *_label; - NSString *_tooltip; - NSImage *_image; - NSView *_view; -} - -@property (copy) NSString * identifier; -@property (copy) NSString * label; -@property (copy) NSString * tooltip; -@property (copy) NSImage * image; -@property (retain) NSView * view; - -+ (id) itemWithIdentifier:(NSString *)identifier label:(NSString *)label tooltip:(NSString *)tooltip image:(NSImage *)image view:(NSView *)view; - -- (id) initWithIdentifier:(NSString *)identifier label:(NSString *)label tooltip:(NSString *)tooltip image:(NSImage *)image view:(NSView *)view; - -@end diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/English.lproj/InfoPlist.strings b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/English.lproj/InfoPlist.strings deleted file mode 100644 index dea12de..0000000 Binary files a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/Info.plist b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index d3e80f3..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - SFBInspectors - CFBundleIdentifier - org.sbooth.Inspectors - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - SFBInspectors - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/SFBInspectors b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/SFBInspectors deleted file mode 100755 index 6174fbb..0000000 Binary files a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/A/SFBInspectors and /dev/null differ diff --git a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/Current b/tikzit-old/Frameworks/SFBInspectors.framework/Versions/Current deleted file mode 120000 index 8c7e5a6..0000000 --- a/tikzit-old/Frameworks/SFBInspectors.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Headers b/tikzit-old/Frameworks/Sparkle.framework/Headers deleted file mode 120000 index a177d2a..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Resources b/tikzit-old/Frameworks/Sparkle.framework/Resources deleted file mode 120000 index 953ee36..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Sparkle b/tikzit-old/Frameworks/Sparkle.framework/Sparkle deleted file mode 120000 index b2c5273..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Sparkle +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Sparkle \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcast.h b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcast.h deleted file mode 100644 index 171148a..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcast.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// SUAppcast.h -// Sparkle -// -// Created by Andy Matuschak on 3/12/06. -// Copyright 2006 Andy Matuschak. All rights reserved. -// - -#ifndef SUAPPCAST_H -#define SUAPPCAST_H - -@class SUAppcastItem; -@interface SUAppcast : NSObject { - NSArray *items; - NSString *userAgentString; - id delegate; - NSMutableData *incrementalData; -} - -- (void)fetchAppcastFromURL:(NSURL *)url; -- (void)setDelegate:delegate; -- (void)setUserAgentString:(NSString *)userAgentString; - -- (NSArray *)items; - -@end - -@interface NSObject (SUAppcastDelegate) -- (void)appcastDidFinishLoading:(SUAppcast *)appcast; -- (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error; -@end - -#endif diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h deleted file mode 100644 index 7f1ca65..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// SUAppcastItem.h -// Sparkle -// -// Created by Andy Matuschak on 3/12/06. -// Copyright 2006 Andy Matuschak. All rights reserved. -// - -#ifndef SUAPPCASTITEM_H -#define SUAPPCASTITEM_H - -@interface SUAppcastItem : NSObject { - NSString *title; - NSDate *date; - NSString *itemDescription; - - NSURL *releaseNotesURL; - - NSString *DSASignature; - NSString *minimumSystemVersion; - - NSURL *fileURL; - NSString *versionString; - NSString *displayVersionString; - - NSDictionary *propertiesDictionary; -} - -// Initializes with data from a dictionary provided by the RSS class. -- initWithDictionary:(NSDictionary *)dict; - -- (NSString *)title; -- (NSString *)versionString; -- (NSString *)displayVersionString; -- (NSDate *)date; -- (NSString *)itemDescription; -- (NSURL *)releaseNotesURL; -- (NSURL *)fileURL; -- (NSString *)DSASignature; -- (NSString *)minimumSystemVersion; - -// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions. -- (NSDictionary *)propertiesDictionary; - -@end - -#endif diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h deleted file mode 100644 index e78c4d3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h +++ /dev/null @@ -1,118 +0,0 @@ -// -// SUUpdater.h -// Sparkle -// -// Created by Andy Matuschak on 1/4/06. -// Copyright 2006 Andy Matuschak. All rights reserved. -// - -#ifndef SUUPDATER_H -#define SUUPDATER_H - -#import - -@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast; -@interface SUUpdater : NSObject { - NSTimer *checkTimer; - SUUpdateDriver *driver; - - SUHost *host; - IBOutlet id delegate; -} - -+ (SUUpdater *)sharedUpdater; -+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle; -- (NSBundle *)hostBundle; - -- (void)setDelegate:(id)delegate; -- delegate; - -- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks; -- (BOOL)automaticallyChecksForUpdates; - -- (void)setUpdateCheckInterval:(NSTimeInterval)interval; -- (NSTimeInterval)updateCheckInterval; - -- (void)setFeedURL:(NSURL *)feedURL; -- (NSURL *)feedURL; - -- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile; -- (BOOL)sendsSystemProfile; - -- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates; -- (BOOL)automaticallyDownloadsUpdates; - -// This IBAction is meant for a main menu item. Hook up any menu item to this action, -// and Sparkle will check for updates and report back its findings verbosely. -- (IBAction)checkForUpdates:sender; - -// This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update, -// in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an -// update is found, it will be downloaded and prepped for installation. -- (void)checkForUpdatesInBackground; - -// Date of last update check. Returns null if no check has been performed. -- (NSDate*)lastUpdateCheckDate; - -// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though, -// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI. -- (void)checkForUpdateInformation; - -// Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer. -- (void)resetUpdateCycle; - -- (BOOL)updateInProgress; -@end - -@interface NSObject (SUUpdaterDelegateInformalProtocol) -// This method allows you to add extra parameters to the appcast URL, potentially based on whether or not Sparkle will also be sending along the system profile. This method should return an array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user. -- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; - -// Use this to override the default behavior for Sparkle prompting the user about automatic update checks. -- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle; - -// Implement this if you want to do some special handling with the appcast once it finishes loading. -- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast; - -// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding -// a valid update, if any, in the given appcast. -- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle; - -// Sent when a valid update is found by the update driver. -- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update; - -// Sent when a valid update is not found. -- (void)updaterDidNotFindUpdate:(SUUpdater *)update; - -// Sent immediately before installing the specified update. -- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update; - -// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue. -- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation; - -// Called immediately before relaunching. -- (void)updaterWillRelaunchApplication:(SUUpdater *)updater; - -// This method allows you to provide a custom version comparator. -// If you don't implement this method or return nil, the standard version comparator will be used. -- (id )versionComparatorForUpdater:(SUUpdater *)updater; - -// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle. -- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater; - -@end - -// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds. -#ifdef DEBUG -#define SU_MIN_CHECK_INTERVAL 60 -#else -#define SU_MIN_CHECK_INTERVAL 60*60 -#endif - -#ifdef DEBUG -#define SU_DEFAULT_CHECK_INTERVAL 60 -#else -#define SU_DEFAULT_CHECK_INTERVAL 60*60*24 -#endif - -#endif diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h deleted file mode 100644 index 3d11ae8..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// SUVersionComparisonProtocol.h -// Sparkle -// -// Created by Andy Matuschak on 12/21/07. -// Copyright 2007 Andy Matuschak. All rights reserved. -// - -#ifndef SUVERSIONCOMPARISONPROTOCOL_H -#define SUVERSIONCOMPARISONPROTOCOL_H - -/*! - @protocol - @abstract Implement this protocol to provide version comparison facilities for Sparkle. -*/ -@protocol SUVersionComparison - -/*! - @method - @abstract An abstract method to compare two version strings. - @discussion Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, and NSOrderedSame if they are equivalent. -*/ -- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; - -@end - -#endif diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/Sparkle.h b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/Sparkle.h deleted file mode 100644 index 08dd577..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Headers/Sparkle.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// Sparkle.h -// Sparkle -// -// Created by Andy Matuschak on 3/16/06. (Modified by CDHW on 23/12/07) -// Copyright 2006 Andy Matuschak. All rights reserved. -// - -#ifndef SPARKLE_H -#define SPARKLE_H - -// This list should include the shared headers. It doesn't matter if some of them aren't shared (unless -// there are name-space collisions) so we can list all of them to start with: - -#import - -#import -#import -#import - -#endif diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index c7f277d..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - Sparkle - CFBundleIdentifier - org.andymatuschak.Sparkle - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Sparkle - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.5 Beta 6 - CFBundleSignature - ???? - CFBundleVersion - 313 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt deleted file mode 100644 index 20466c4..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/License.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2006 Andy Matuschak - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist deleted file mode 100644 index 92ef947..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUModelTranslation.plist +++ /dev/null @@ -1,174 +0,0 @@ - - - - - ADP2,1 - Developer Transition Kit - MacBook1,1 - MacBook (Core Duo) - MacBook2,1 - MacBook (Core 2 Duo) - MacBook4,1 - MacBook (Core 2 Duo Feb 2008) - MacBookAir1,1 - MacBook Air (January 2008) - MacBookPro1,1 - MacBook Pro Core Duo (15-inch) - MacBookPro1,2 - MacBook Pro Core Duo (17-inch) - MacBookPro2,1 - MacBook Pro Core 2 Duo (17-inch) - MacBookPro2,2 - MacBook Pro Core 2 Duo (15-inch) - MacBookPro3,1 - MacBook Pro Core 2 Duo (15-inch LED, Core 2 Duo) - MacBookPro3,2 - MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo) - MacBookPro4,1 - MacBook Pro (Core 2 Duo Feb 2008) - MacPro1,1 - Mac Pro (four-core) - MacPro2,1 - Mac Pro (eight-core) - MacPro3,1 - Mac Pro (January 2008 4- or 8- core "Harpertown") - Macmini1,1 - Mac Mini (Core Solo/Duo) - PowerBook1,1 - PowerBook G3 - PowerBook2,1 - iBook G3 - PowerBook2,2 - iBook G3 (FireWire) - PowerBook2,3 - iBook G3 - PowerBook2,4 - iBook G3 - PowerBook3,1 - PowerBook G3 (FireWire) - PowerBook3,2 - PowerBook G4 - PowerBook3,3 - PowerBook G4 (Gigabit Ethernet) - PowerBook3,4 - PowerBook G4 (DVI) - PowerBook3,5 - PowerBook G4 (1GHz / 867MHz) - PowerBook4,1 - iBook G3 (Dual USB, Late 2001) - PowerBook4,2 - iBook G3 (16MB VRAM) - PowerBook4,3 - iBook G3 Opaque 16MB VRAM, 32MB VRAM, Early 2003) - PowerBook5,1 - PowerBook G4 (17 inch) - PowerBook5,2 - PowerBook G4 (15 inch FW 800) - PowerBook5,3 - PowerBook G4 (17-inch 1.33GHz) - PowerBook5,4 - PowerBook G4 (15 inch 1.5/1.33GHz) - PowerBook5,5 - PowerBook G4 (17-inch 1.5GHz) - PowerBook5,6 - PowerBook G4 (15 inch 1.67GHz/1.5GHz) - PowerBook5,7 - PowerBook G4 (17-inch 1.67GHz) - PowerBook5,8 - PowerBook G4 (Double layer SD, 15 inch) - PowerBook5,9 - PowerBook G4 (Double layer SD, 17 inch) - PowerBook6,1 - PowerBook G4 (12 inch) - PowerBook6,2 - PowerBook G4 (12 inch, DVI) - PowerBook6,3 - iBook G4 - PowerBook6,4 - PowerBook G4 (12 inch 1.33GHz) - PowerBook6,5 - iBook G4 (Early-Late 2004) - PowerBook6,7 - iBook G4 (Mid 2005) - PowerBook6,8 - PowerBook G4 (12 inch 1.5GHz) - PowerMac1,1 - Power Macintosh G3 (Blue & White) - PowerMac1,2 - Power Macintosh G4 (PCI Graphics) - PowerMac10,1 - Mac Mini G4 - PowerMac10,2 - Mac Mini (Late 2005) - PowerMac11,2 - Power Macintosh G5 (Late 2005) - PowerMac12,1 - iMac G5 (iSight) - PowerMac2,1 - iMac G3 (Slot-loading CD-ROM) - PowerMac2,2 - iMac G3 (Summer 2000) - PowerMac3,1 - Power Macintosh G4 (AGP Graphics) - PowerMac3,2 - Power Macintosh G4 (AGP Graphics) - PowerMac3,3 - Power Macintosh G4 (Gigabit Ethernet) - PowerMac3,4 - Power Macintosh G4 (Digital Audio) - PowerMac3,5 - Power Macintosh G4 (Quick Silver) - PowerMac3,6 - Power Macintosh G4 (Mirrored Drive Door) - PowerMac4,1 - iMac G3 (Early/Summer 2001) - PowerMac4,2 - iMac G4 (Flat Panel) - PowerMac4,4 - eMac - PowerMac4,5 - iMac G4 (17-inch Flat Panel) - PowerMac5,1 - Power Macintosh G4 Cube - PowerMac6,1 - iMac G4 (USB 2.0) - PowerMac6,3 - iMac G4 (20-inch Flat Panel) - PowerMac6,4 - eMac (USB 2.0, 2005) - PowerMac7,2 - Power Macintosh G5 - PowerMac7,3 - Power Macintosh G5 - PowerMac8,1 - iMac G5 - PowerMac8,2 - iMac G5 (Ambient Light Sensor) - PowerMac9,1 - Power Macintosh G5 (Late 2005) - RackMac1,1 - Xserve G4 - RackMac1,2 - Xserve G4 (slot-loading, cluster node) - RackMac3,1 - Xserve G5 - Xserve1,1 - Xserve (Intel Xeon) - Xserve2,1 - Xserve (January 2008 quad-core) - iMac1,1 - iMac G3 (Rev A-D) - iMac4,1 - iMac (Core Duo) - iMac4,2 - iMac for Education (17-inch, Core Duo) - iMac5,1 - iMac (Core 2 Duo, 17 or 20 inch, SuperDrive) - iMac5,2 - iMac (Core 2 Duo, 17 inch, Combo Drive) - iMac6,1 - iMac (Core 2 Duo, 24 inch, SuperDrive) - iMac8,1 - iMac (April 2008) - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/classes.nib deleted file mode 100644 index 22f13f8..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/classes.nib +++ /dev/null @@ -1,56 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - CLASS - SUStatusController - LANGUAGE - ObjC - OUTLETS - - actionButton - NSButton - progressBar - NSProgressIndicator - - SUPERCLASS - SUWindowController - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/info.nib deleted file mode 100644 index a9ac867..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 10A96 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib deleted file mode 100644 index 4f1d598..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/SUStatus.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 6b92630..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index b4353d2..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index b403a3e..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings deleted file mode 100644 index b31f928..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/de.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index ab36d31..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 658 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9C7010 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 7630390..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index 2fb8a83..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 18 - - IBSystem Version - 10A96 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index e7e7497..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index b1cd28e..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - 41 - - IBSystem Version - 10A96 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index e8dc5b8..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings deleted file mode 100644 index 16e0787..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/en.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 6b2f938..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index c9b1e7d..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index 3eb7f81..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index 8c54c21..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings deleted file mode 100644 index f83ea23..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/es.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index 33a6020..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBFramework Version - 629 - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 4cd529a..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index d2586ea..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBFramework Version - 629 - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 65dfc95..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index d2586ea..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBFramework Version - 629 - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index 4b7cc90..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings deleted file mode 100644 index ea175ae..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr_CA.lproj b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr_CA.lproj deleted file mode 120000 index 61a7d4e..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/fr_CA.lproj +++ /dev/null @@ -1 +0,0 @@ -/Users/andym/Development/Build Products/Release (GC dual-mode; 10.5-only)/Sparkle.framework/Resources/fr.lproj \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 15ba8f4..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index 2e04cfa..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 2984064..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index c493485..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 667 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 5 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index 55cc2c2..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings deleted file mode 100644 index 5c410d0..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/it.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index 3f09790..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - IBFramework Version - 629 - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index aa38f86..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index d2586ea..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBFramework Version - 629 - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index c82d358..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index d2586ea..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBFramework Version - 629 - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index ac298ce..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings deleted file mode 100644 index 67cf535..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/nl.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/relaunch b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/relaunch deleted file mode 100755 index e7b96d6..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/relaunch and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index 2b3d425..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 1d4655c..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 994d4c3..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - CLASS - NSApplication - LANGUAGE - ObjC - SUPERCLASS - NSResponder - - - ACTIONS - - installUpdate - id - remindMeLater - id - skipThisVersion - id - - CLASS - SUUpdateAlert - LANGUAGE - ObjC - OUTLETS - - delegate - id - description - NSTextField - releaseNotesView - WebView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index 2b3d425..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 103b1cf..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 0f776c8..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - NSObject - LANGUAGE - ObjC - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index 5132e29..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9E17 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index c09d9e7..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings deleted file mode 100644 index f3ff9d8..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/ru.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/classes.nib deleted file mode 100644 index 4b1ab30..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,50 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - doNotInstall - id - installLater - id - installNow - id - - CLASS - SUAutomaticUpdateAlert - LANGUAGE - ObjC - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/info.nib deleted file mode 100644 index c5a067e..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 10A96 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 53cb91a..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUAutomaticUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/classes.nib deleted file mode 100644 index 018710a..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/classes.nib +++ /dev/null @@ -1,39 +0,0 @@ -{ - IBClasses = ( - { - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - CLASS = NSApplication; - LANGUAGE = ObjC; - SUPERCLASS = NSResponder; - }, - { - CLASS = NSObject; - LANGUAGE = ObjC; - }, - { - ACTIONS = { - installUpdate = id; - remindMeLater = id; - skipThisVersion = id; - }; - CLASS = SUUpdateAlert; - LANGUAGE = ObjC; - OUTLETS = { - delegate = id; - description = NSTextField; - releaseNotesView = WebView; - }; - SUPERCLASS = SUWindowController; - }, - { - CLASS = SUWindowController; - LANGUAGE = ObjC; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/info.nib deleted file mode 100644 index 6b787d4..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/info.nib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - IBDocumentLocation - 69 14 356 240 0 0 1280 778 - IBFramework Version - 489.0 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBSystem Version - 9D34 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib deleted file mode 100644 index 7e6d490..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdateAlert.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/classes.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/classes.nib deleted file mode 100644 index 5220a22..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/classes.nib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - IBClasses - - - CLASS - SUWindowController - LANGUAGE - ObjC - SUPERCLASS - NSWindowController - - - ACTIONS - - finishPrompt - id - toggleMoreInfo - id - - CLASS - SUUpdatePermissionPrompt - LANGUAGE - ObjC - OUTLETS - - delegate - id - descriptionTextField - NSTextField - moreInfoButton - NSButton - moreInfoView - NSView - - SUPERCLASS - SUWindowController - - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - CLASS - NSObject - LANGUAGE - ObjC - - - IBVersion - 1 - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/info.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/info.nib deleted file mode 100644 index c5a067e..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/info.nib +++ /dev/null @@ -1,20 +0,0 @@ - - - - - IBFramework Version - 670 - IBLastKnownRelativeProjectPath - ../Sparkle.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - 6 - - IBSystem Version - 10A96 - targetFramework - IBCocoaFramework - - diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib deleted file mode 100644 index 64babac..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/SUUpdatePermissionPrompt.nib/keyedobjects.nib and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings deleted file mode 100644 index b676a4f..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Resources/sv.lproj/Sparkle.strings and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Sparkle b/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Sparkle deleted file mode 100755 index 2d9bb2a..0000000 Binary files a/tikzit-old/Frameworks/Sparkle.framework/Versions/A/Sparkle and /dev/null differ diff --git a/tikzit-old/Frameworks/Sparkle.framework/Versions/Current b/tikzit-old/Frameworks/Sparkle.framework/Versions/Current deleted file mode 120000 index 8c7e5a6..0000000 --- a/tikzit-old/Frameworks/Sparkle.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/tikzit-old/INSTALL b/tikzit-old/INSTALL deleted file mode 100644 index b938f14..0000000 --- a/tikzit-old/INSTALL +++ /dev/null @@ -1,34 +0,0 @@ -For building on systems other than MacOS/X: - -Dependencies: - GNUstep (core libraries) >= 1.18.0 - gtk+-2.0 >= 2.18.0 - gdk-pixbuf >= 2.16.0 - poppler >= 0.10 - including glib bindings, which may be in - a separate poppler-glib package - Objective C compiler (eg: gcc with ObjC support) with - support for properties, optional protocols and - fast enumeration (eg: gcc 4.6 or clang). - pkg-config - build-time dependency only - -To install, just run: - - ./configure - make - make install - - - -To build from subversion (and for development) you will additionally need: - flex >= 2.5.34 - bison >= 2.3 - autoconf >= 2.60 - automake >= 1.10 - -and you will need to prepare the source tree by running - ./autogen.sh - - - diff --git a/tikzit-old/Makefile.am b/tikzit-old/Makefile.am deleted file mode 100644 index d9793a4..0000000 --- a/tikzit-old/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = src share -appdir = $(datarootdir)/tikzit -nobase_dist_app_DATA = shapes/*.tikz diff --git a/tikzit-old/NEWS b/tikzit-old/NEWS deleted file mode 100644 index 827abe7..0000000 --- a/tikzit-old/NEWS +++ /dev/null @@ -1,75 +0,0 @@ -tikzit 1.1 (2015-07-22) : - * Fix bug where copy-and-paste would lose edge anchors - * Allow tikzit-specific preview code to be omitted from preambles - * Holding down CTRL allows you to drag the graph - * Fix parsing bug where property lists would be reversed - * Better error messages when files can't be opened - -tikzit 1.0 (2013-05-07): - * GIMP-like user interface (multiple documents, separate toolboxes) - * Preferences now called Configuration, and includes node and edge styles - * Error-highlighting in the code pane - * Single-key-shortcuts for tool selection, and to update the preview - * Edge anchor support - * Option for drag-select to select nodes, edges or both - * Memory leak fixes - * Should now be impossible to use the UI to create a graph that cannot be parsed - -tikzit 0.9 (2012-08-24): - * Compilers without basic Objective C 2 support cannot be - used to compile TikZiT any more - * Add support for scale to node styles - * Add support for editing edge styles - * Add support for multiple custom preambles - * The path to pdflatex is now configurable - * Make everything look a bit better - * Edges now start from the edge of a node, not the centre, - which is what tikz does - * Edges can now have arrow heads and arrow tails - * Nodes and edges have consistent ordering, and this can be - changed with Edge->Arrange - * Edges now have colours - * Edges can now be reversed easily - * Fix various crashes - -tikzit 0.7 (2011-12-06): - * Add bounding box support - * Add support for different node shapes - * Improved error reporting - * Add scrolling support (CTRL+mouse wheel) - * Add a pan tool to move around the graph - * Add edge and graph property palettes - -tikzit 0.6 (2011-02-08): - * Fix the displaying of colours in the styles editor - * Cut, copy and paste support - * More useful buttons on the toolbar - * Improve how previewing works - * Allow custom preambles for preview generation - -tikzit 0.5 (2010-12-01): - * Hide font size commands (\small etc) in node labels - * Always output the "style" node property first - * Provide a list of recent files - * Remember the folder for Open and Save As dialogs - * Remember window dimensions - * Remember the styles list - * Add a "Node properties" pane - * Bring the separate windows into the main application window - * Improve graphics rendering / remove flicker - * Shorten the window title to something useful - -tikzit 0.4 (2010-09-19): - * Support for bounding boxes, variable-precision tikz output - * Fixed stroke width display - * Updated tikz output to handle separate edge/node layers - * Using [Graph tikz] for tikz output, attaching style after parse - * All platforms now use the same lex-based parser - * Added a menu item for showing node styles if closed - * Pre-amble support - * Added test suite - * Added preview and node labels to GTK version - -tikzit 0.3b (2010-05-11): - * Various build-system fixes on Linux - diff --git a/tikzit-old/README b/tikzit-old/README deleted file mode 100644 index 9b83327..0000000 --- a/tikzit-old/README +++ /dev/null @@ -1,7 +0,0 @@ -TikZit is a cross-platform application that allows the creation and modification of TeX diagrams written using the pgf/TikZ macro library. It is especially geared toward rapidly creating "dot"-diagrams for use in academic papers. - -For more info, see http://tikzit.sf.net - -On OS/X, the Cocoa framework is used. - -On other platforms, GTK+ and GNUstep are used. \ No newline at end of file diff --git a/tikzit-old/README.release b/tikzit-old/README.release deleted file mode 100644 index a6f1642..0000000 --- a/tikzit-old/README.release +++ /dev/null @@ -1,98 +0,0 @@ -Notes on how to make a release -============================== - -Updating doc files ------------------- - -Put all the user-visible changes since the last release into NEWS. - -Make sure the dependency requirements in INSTALL are correct. - - - -Making the source tarballs --------------------------- - -The version should be set in configure.ac (in AC_INIT) -and the package should be re-configured -(run ./configure). - -Then run `make dist` to create the source tarball in tar.gz format, and -`make dist-bzip2` to get it in tar.bz2 format. - - - -Uploading the source --------------------- - -Update /www/sourceforge/README.mkd - -Log into sourceforge.net, go to -https://sourceforge.net/projects/tikzit/files/ - -Create a folder called tikzit-[version]. - -Upload README.mkd. - -Upload the tar.bz2 and tar.gz files. - -Set the tar.bz2 file as default for everything except windows and mac -(click the (i) symbol on the right for that file to do this). - - - -Updating the website --------------------- - -Edit /www/htdocs/link.php, and update the versions. - -sftp to - [sf-username],tikzit@web.sourceforge.net - -Upload link.php into htdocs. - - - -Updating the packages ---------------------- - -Contact Gard Spreemann about the new version by sending him a message -on Launchpad (https://launchpad.net/~gspreemann). - -Update tikzit.spec (the version, the changelog and the dependencies). - -Test the spec file: -- if you don't have ~/rpmbuild, run rpmdev-setuptree -- copy the tar.bz2 file into ~/rpmbuild/SOURCES -- copy tikzit.spec into ~/rpmbuild/SPECS -- cd into ~/rpmbuild/SPECS -- run `rpmbuild -ba tikzit.spec` -- run `rpmlint ..` and check the warnings (there will be some that are - not important) - -Update the OBS packages: -- https://build.opensuse.org/package/show?package=tikzit&project=home%3Arandomguy3 -- Upload the tar.bz2 file and the tikzit.spec file. -- Wait for the build to finish - -Update the AUR package: -- http://aur.archlinux.org/packages.php?ID=37119 - - -TODO: find out how the Debian build system works - - -Publishing an OSX Update ------------------------------------------ -In OSX, the steps to publish an update are as follows. Firstly all updates are signed, so you need the private key 'tikzit_dsa_priv.pem' in the root of your working directory. This is not in the repository (for obvious reasons), so ask Aleks for a copy. Also, make sure you have ruby in your $PATH to do the actual signing. - -1. Update the SVN and note the revision number -2. In TikZiT-Info.plist, set the Bundle Version key to (MAJOR).(MINOR).(SVN REVISION + 1) -3. In the TikZiT working directory, run scripts/prepare_release.sh -4. Copy and paste the XML output into docs/web/appcast/tikzit.xml -5. Update the release notes in docs/web/appcast/rnotes.html -6. Use SFTP to upload the changed files into htdocs/appcast -7. Commit the SVN - - - diff --git a/tikzit-old/TODO b/tikzit-old/TODO deleted file mode 100644 index ca1a1b9..0000000 --- a/tikzit-old/TODO +++ /dev/null @@ -1,15 +0,0 @@ -GTK port: - - Use GooCanvas for the graph display - - -OSX port: - - node properties toolbox - - support for more than one custom preamble - - -General: - - push more code up into common (make use of RenderContext) - - vi-like mode lines in tikz files - - use mode lines for preamble knowledge - - per-document preamble selection? - diff --git a/tikzit-old/TikZiT-Info.plist b/tikzit-old/TikZiT-Info.plist deleted file mode 100644 index a495c5b..0000000 --- a/tikzit-old/TikZiT-Info.plist +++ /dev/null @@ -1,61 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - tikz - - CFBundleTypeIconFile - tikzitdoc.icns - CFBundleTypeMIMETypes - - text/plain - - CFBundleTypeName - DocumentType - CFBundleTypeOSTypes - - ???? - - CFBundleTypeRole - Editor - NSDocumentClass - TikzDocument - - - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - tikzit.icns - CFBundleIdentifier - net.sourceforge.tikzit.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 0.8 - CFBundleSignature - ???? - CFBundleVersion - 0.8.398 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - SUFeedURL - http://tikzit.sourceforge.net/appcast/tikzit.xml - SUPublicDSAKeyFile - tikzit_dsa_pub.pem - - diff --git a/tikzit-old/TikZiT.xcodeproj/project.pbxproj b/tikzit-old/TikZiT.xcodeproj/project.pbxproj deleted file mode 100644 index 04a7f3f..0000000 --- a/tikzit-old/TikZiT.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1322 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1DDD582C0DA1D0D100B32029 /* TikzDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58280DA1D0D100B32029 /* TikzDocument.xib */; }; - 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; }; - 5504C82E11D23595002A1478 /* common.m in Sources */ = {isa = PBXBuildFile; fileRef = 5504C82A11D23595002A1478 /* common.m */; }; - 5504C82F11D23595002A1478 /* parser.m in Sources */ = {isa = PBXBuildFile; fileRef = 5504C82B11D23595002A1478 /* parser.m */; }; - 5504C83011D23595002A1478 /* test.m in Sources */ = {isa = PBXBuildFile; fileRef = 5504C82D11D23595002A1478 /* test.m */; }; - 5504C83211D23685002A1478 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5504C83111D23685002A1478 /* main.m */; }; - 5504C84F11D23945002A1478 /* ColorRGB.m in Sources */ = {isa = PBXBuildFile; fileRef = 559EFB6711CB88E300D020F4 /* ColorRGB.m */; }; - 5504C93F11D39422002A1478 /* osx.m in Sources */ = {isa = PBXBuildFile; fileRef = 5504C93E11D39422002A1478 /* osx.m */; }; - 552202C4135F15FD007EA086 /* MultiField.m in Sources */ = {isa = PBXBuildFile; fileRef = 552202C3135F15FD007EA086 /* MultiField.m */; }; - 552202C5135F15FD007EA086 /* MultiField.m in Sources */ = {isa = PBXBuildFile; fileRef = 552202C3135F15FD007EA086 /* MultiField.m */; }; - 55391AF613D324FE007DBE71 /* Preview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55391AF513D324FE007DBE71 /* Preview.xib */; }; - 55391AF813D3250F007DBE71 /* Preamble.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55391AF713D3250F007DBE71 /* Preamble.xib */; }; - 55391B0213D32608007DBE71 /* PropertyInspector.xib in Resources */ = {isa = PBXBuildFile; fileRef = 55391B0013D32608007DBE71 /* PropertyInspector.xib */; }; - 55391B0A13D32765007DBE71 /* PropertyInspectorController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55391B0913D32765007DBE71 /* PropertyInspectorController.m */; }; - 55397C7914498C22006942FB /* EdgeStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 55397C7814498C22006942FB /* EdgeStyle.m */; }; - 55397C7C144990EA006942FB /* EdgeStyle+Coder.m in Sources */ = {isa = PBXBuildFile; fileRef = 55397C7B144990EA006942FB /* EdgeStyle+Coder.m */; }; - 55397C7F144999C4006942FB /* PropertyHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 55397C7E144999C4006942FB /* PropertyHolder.m */; }; - 55397C811449A877006942FB /* ED_arrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C801449A877006942FB /* ED_arrow.png */; }; - 55397C831449A8F1006942FB /* ED_tick.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C821449A8F1006942FB /* ED_tick.png */; }; - 55397C851449A9BF006942FB /* ED_none.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C841449A9BF006942FB /* ED_none.png */; }; - 55397C8A1449AB91006942FB /* AH_none.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C871449AB91006942FB /* AH_none.png */; }; - 55397C8B1449AB91006942FB /* AH_plain_tail.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C881449AB91006942FB /* AH_plain_tail.png */; }; - 55397C8D1449ABFC006942FB /* AH_latex_tail.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C8C1449ABFC006942FB /* AH_latex_tail.png */; }; - 55397C901449AC7C006942FB /* AH_latex_head.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C8E1449AC7C006942FB /* AH_latex_head.png */; }; - 55397C911449AC7C006942FB /* AH_plain_head.png in Resources */ = {isa = PBXBuildFile; fileRef = 55397C8F1449AC7C006942FB /* AH_plain_head.png */; }; - 553A4C5A144ED3D500AA6FAC /* NilToEmptyStringTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 553A4C59144ED3D500AA6FAC /* NilToEmptyStringTransformer.m */; }; - 55432E061444BF2D00401BB3 /* GraphElementProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 55432E051444BF2D00401BB3 /* GraphElementProperty.m */; }; - 55598E351635372E0023450A /* DiamondShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55598E341635372E0023450A /* DiamondShape.m */; }; - 555B30F911D8BE3300CAECF5 /* emblem-important.png in Resources */ = {isa = PBXBuildFile; fileRef = 555B30F811D8BE3300CAECF5 /* emblem-important.png */; }; - 555B313511D8C6DA00CAECF5 /* color.m in Sources */ = {isa = PBXBuildFile; fileRef = 555B313411D8C6DA00CAECF5 /* color.m */; }; - 555ECE9B1378A3AA0052DB71 /* CALayer+DrawLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 555ECE9A1378A3AA0052DB71 /* CALayer+DrawLabel.m */; }; - 55652DF913E1F2030023F4C6 /* SupportDir.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652DF813E1F2030023F4C6 /* SupportDir.m */; }; - 55652E3B13E1FAEE0023F4C6 /* CircleShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3413E1FAED0023F4C6 /* CircleShape.m */; }; - 55652E3C13E1FAEE0023F4C6 /* RectangleShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3613E1FAED0023F4C6 /* RectangleShape.m */; }; - 55652E3D13E1FAEE0023F4C6 /* RegularPolyShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3813E1FAED0023F4C6 /* RegularPolyShape.m */; }; - 55652E3E13E1FAEE0023F4C6 /* TikzShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3A13E1FAEE0023F4C6 /* TikzShape.m */; }; - 55652E4113E1FB0A0023F4C6 /* Shape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E4013E1FB0A0023F4C6 /* Shape.m */; }; - 55652E5613E1FC660023F4C6 /* cap.tikz in Copy Shapes */ = {isa = PBXBuildFile; fileRef = 55652E5113E1FC660023F4C6 /* cap.tikz */; }; - 55652E5713E1FC660023F4C6 /* copants.tikz in Copy Shapes */ = {isa = PBXBuildFile; fileRef = 55652E5213E1FC660023F4C6 /* copants.tikz */; }; - 55652E5813E1FC660023F4C6 /* cup.tikz in Copy Shapes */ = {isa = PBXBuildFile; fileRef = 55652E5313E1FC660023F4C6 /* cup.tikz */; }; - 55652E5913E1FC660023F4C6 /* oval.tikz in Copy Shapes */ = {isa = PBXBuildFile; fileRef = 55652E5413E1FC660023F4C6 /* oval.tikz */; }; - 55652E5A13E1FC660023F4C6 /* pants.tikz in Copy Shapes */ = {isa = PBXBuildFile; fileRef = 55652E5513E1FC660023F4C6 /* pants.tikz */; }; - 556979431168747B007E5703 /* StylePalette.xib in Resources */ = {isa = PBXBuildFile; fileRef = 556979421168747B007E5703 /* StylePalette.xib */; }; - 5573B8BA11D9FC8D00B5DC5D /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5573B8B911D9FC8D00B5DC5D /* Quartz.framework */; }; - 5573B8C211D9FD3200B5DC5D /* PreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5573B8C111D9FD3200B5DC5D /* PreviewController.m */; }; - 5573B90F11DA231A00B5DC5D /* PreambleController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5573B90E11DA231A00B5DC5D /* PreambleController.m */; }; - 5573B92111DA259C00B5DC5D /* text-x-generic.png in Resources */ = {isa = PBXBuildFile; fileRef = 5573B92011DA259C00B5DC5D /* text-x-generic.png */; }; - 5573B92511DA273400B5DC5D /* format-indent-less.png in Resources */ = {isa = PBXBuildFile; fileRef = 5573B92411DA273400B5DC5D /* format-indent-less.png */; }; - 5573B92911DA292F00B5DC5D /* Preambles.m in Sources */ = {isa = PBXBuildFile; fileRef = 5573B92811DA292F00B5DC5D /* Preambles.m */; }; - 5573B98811DA377C00B5DC5D /* text-x-script.png in Resources */ = {isa = PBXBuildFile; fileRef = 5573B98711DA377C00B5DC5D /* text-x-script.png */; }; - 5573BDCB11DB4D2600B5DC5D /* Preambles+Coder.m in Sources */ = {isa = PBXBuildFile; fileRef = 5573BDCA11DB4D2600B5DC5D /* Preambles+Coder.m */; }; - 5585E5C2117F681800124513 /* NodeStyle+Coder.m in Sources */ = {isa = PBXBuildFile; fileRef = 5585E5C1117F681800124513 /* NodeStyle+Coder.m */; }; - 5589A9FF11C51E780064D310 /* TikzGraphAssembler.m in Sources */ = {isa = PBXBuildFile; fileRef = 5589A9FE11C51E780064D310 /* TikzGraphAssembler.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - 5589AA6C11C542D30064D310 /* TikzGraphAssembler.m in Sources */ = {isa = PBXBuildFile; fileRef = 5589A9FE11C51E780064D310 /* TikzGraphAssembler.m */; }; - 5589AA6D11C542D30064D310 /* tikzlexer.lm in Sources */ = {isa = PBXBuildFile; fileRef = 5589A9AA11C500060064D310 /* tikzlexer.lm */; }; - 5589AA6E11C542D30064D310 /* tikzparser.ym in Sources */ = {isa = PBXBuildFile; fileRef = 5589A9AB11C500060064D310 /* tikzparser.ym */; }; - 5589AA7211C542E60064D310 /* Edge.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18BA117B031C009863B2 /* Edge.m */; }; - 5589AA7611C542E60064D310 /* Graph.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18BC117B031C009863B2 /* Graph.m */; }; - 5589AA7811C542E60064D310 /* GraphChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18BE117B031C009863B2 /* GraphChange.m */; }; - 5589AA7A11C542E60064D310 /* GraphElementData.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18C0117B031C009863B2 /* GraphElementData.m */; }; - 5589AA7C11C542E60064D310 /* Node.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18C2117B031C009863B2 /* Node.m */; }; - 5589AA8011C542E60064D310 /* NodeStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18C4117B031C009863B2 /* NodeStyle.m */; }; - 5589AA8511C543500064D310 /* util.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18CD117B03DD009863B2 /* util.m */; }; - 5589AD4411C633EE0064D310 /* SelectBoxLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5589AD4311C633EE0064D310 /* SelectBoxLayer.m */; }; - 558F18C5117B031C009863B2 /* Edge.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18BA117B031C009863B2 /* Edge.m */; }; - 558F18C6117B031C009863B2 /* Graph.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18BC117B031C009863B2 /* Graph.m */; }; - 558F18C7117B031C009863B2 /* GraphChange.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18BE117B031C009863B2 /* GraphChange.m */; }; - 558F18C8117B031C009863B2 /* GraphElementData.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18C0117B031C009863B2 /* GraphElementData.m */; }; - 558F18C9117B031C009863B2 /* Node.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18C2117B031C009863B2 /* Node.m */; }; - 558F18CA117B031C009863B2 /* NodeStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18C4117B031C009863B2 /* NodeStyle.m */; }; - 558F18CE117B03DD009863B2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18CB117B03DD009863B2 /* main.m */; }; - 558F18CF117B03DD009863B2 /* util.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18CD117B03DD009863B2 /* util.m */; }; - 558F18F7117B043C009863B2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18DA117B043B009863B2 /* AppDelegate.m */; }; - 558F18F9117B043C009863B2 /* EdgeControlLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18DE117B043B009863B2 /* EdgeControlLayer.m */; }; - 558F18FA117B043C009863B2 /* GraphicsView.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18E0117B043B009863B2 /* GraphicsView.m */; }; - 558F18FB117B043C009863B2 /* Grid.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18E2117B043B009863B2 /* Grid.m */; }; - 558F18FC117B043C009863B2 /* NodeLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18E4117B043B009863B2 /* NodeLayer.m */; }; - 558F18FD117B043C009863B2 /* NodeSelectionLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18E6117B043B009863B2 /* NodeSelectionLayer.m */; }; - 558F18FF117B043C009863B2 /* SelectableCollectionViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18EA117B043B009863B2 /* SelectableCollectionViewItem.m */; }; - 558F1900117B043C009863B2 /* SelectableNodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18EC117B043B009863B2 /* SelectableNodeView.m */; }; - 558F1901117B043C009863B2 /* StylePaletteController.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18EE117B043B009863B2 /* StylePaletteController.m */; }; - 558F1902117B043C009863B2 /* TikzDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18F0117B043B009863B2 /* TikzDocument.m */; }; - 558F1903117B043C009863B2 /* TikzSourceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18F2117B043B009863B2 /* TikzSourceController.m */; }; - 558F1904117B043C009863B2 /* ToolPaletteController.m in Sources */ = {isa = PBXBuildFile; fileRef = 558F18F4117B043B009863B2 /* ToolPaletteController.m */; }; - 55900AA1135FA918002DD28E /* MultiCombo.m in Sources */ = {isa = PBXBuildFile; fileRef = 55900AA0135FA918002DD28E /* MultiCombo.m */; }; - 55900AA2135FA918002DD28E /* MultiCombo.m in Sources */ = {isa = PBXBuildFile; fileRef = 55900AA0135FA918002DD28E /* MultiCombo.m */; }; - 55900AE3135FB305002DD28E /* emblem-unreadable-grey.png in Resources */ = {isa = PBXBuildFile; fileRef = 55900AE2135FB305002DD28E /* emblem-unreadable-grey.png */; }; - 559EFA4811C7D49800D020F4 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 559EFA4711C7D49800D020F4 /* Sparkle.framework */; }; - 559EFA4E11C7D4BD00D020F4 /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 559EFA4711C7D49800D020F4 /* Sparkle.framework */; }; - 559EFA5711C7D95F00D020F4 /* tikzit_dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 559EFA5611C7D95F00D020F4 /* tikzit_dsa_pub.pem */; }; - 559EFB6811CB88E300D020F4 /* ColorRGB.m in Sources */ = {isa = PBXBuildFile; fileRef = 559EFB6711CB88E300D020F4 /* ColorRGB.m */; }; - 55CA98D512EF8FCE008F0368 /* SFBInspectors.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */; }; - 55CA98DA12EF9098008F0368 /* SFBInspectors.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */; }; - 55CA98DD12EF910F008F0368 /* SFBInspectors.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */; }; - 55CA997212F08281008F0368 /* TikzWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 55CA997112F08281008F0368 /* TikzWindowController.m */; }; - 55CA9AC912F831E5008F0368 /* RColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 55CA9AC812F831E5008F0368 /* RColor.m */; }; - 55CA9ACA12F831E5008F0368 /* RColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 55CA9AC812F831E5008F0368 /* RColor.m */; }; - 55D2E0B21186ED950060B4EC /* Graph+Coder.m in Sources */ = {isa = PBXBuildFile; fileRef = 55D2E0B11186ED950060B4EC /* Graph+Coder.m */; }; - 55D945721165904F0044178C /* tikzitdoc.icns in Resources */ = {isa = PBXBuildFile; fileRef = 55D945701165904F0044178C /* tikzitdoc.icns */; }; - 55D945731165904F0044178C /* tikzit.icns in Resources */ = {isa = PBXBuildFile; fileRef = 55D945711165904F0044178C /* tikzit.icns */; }; - 55D949141165D8870044178C /* draw-ellipse.png in Resources */ = {isa = PBXBuildFile; fileRef = 55D949111165D8870044178C /* draw-ellipse.png */; }; - 55D949151165D8870044178C /* draw-path.png in Resources */ = {isa = PBXBuildFile; fileRef = 55D949121165D8870044178C /* draw-path.png */; }; - 55D949161165D8870044178C /* select-rectangular.png in Resources */ = {isa = PBXBuildFile; fileRef = 55D949131165D8870044178C /* select-rectangular.png */; }; - 55E5E99E1215C8E300256F69 /* transform-crop-and-resize.png in Resources */ = {isa = PBXBuildFile; fileRef = 55E5E99D1215C8E300256F69 /* transform-crop-and-resize.png */; }; - 55F9585C1181B09600F99434 /* PickSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 55F958591181B09600F99434 /* PickSupport.m */; }; - 55F9585D1181B09600F99434 /* Transformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 55F9585B1181B09600F99434 /* Transformer.m */; }; - 55F9E04511FF54F000F5659E /* NSString+LatexConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 55F9E04411FF54F000F5659E /* NSString+LatexConstants.m */; }; - 7F18A321184C577000BC3081 /* UpdatePreferenceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F18A320184C577000BC3081 /* UpdatePreferenceController.m */; }; - 7F18A323184C599100BC3081 /* UpdatePreferencePanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7F18A322184C599100BC3081 /* UpdatePreferencePanel.xib */; }; - 7F6E2C7D16B007F000BFE20D /* EdgeStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 55397C7814498C22006942FB /* EdgeStyle.m */; }; - 7F6E2C7E16B0080400BFE20D /* GraphElementProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 55432E051444BF2D00401BB3 /* GraphElementProperty.m */; }; - 7F6E2C7F16B0081D00BFE20D /* PropertyHolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 55397C7E144999C4006942FB /* PropertyHolder.m */; }; - 7F6E2C8016B0083300BFE20D /* Shape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E4013E1FB0A0023F4C6 /* Shape.m */; }; - 7F6E2C8116B0084600BFE20D /* Transformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 55F9585B1181B09600F99434 /* Transformer.m */; }; - 7F6E2C8216B008B000BFE20D /* DiamondShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55598E341635372E0023450A /* DiamondShape.m */; }; - 7F6E2C8316B008B000BFE20D /* CircleShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3413E1FAED0023F4C6 /* CircleShape.m */; }; - 7F6E2C8416B008B000BFE20D /* RectangleShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3613E1FAED0023F4C6 /* RectangleShape.m */; }; - 7F6E2C8516B008B000BFE20D /* RegularPolyShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3813E1FAED0023F4C6 /* RegularPolyShape.m */; }; - 7F6E2C8616B008B000BFE20D /* TikzShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652E3A13E1FAEE0023F4C6 /* TikzShape.m */; }; - 7F6E2C8916B0091300BFE20D /* maths.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F6E2C8716B0091300BFE20D /* maths.m */; }; - 7F6E2C8A16B0096000BFE20D /* SupportDir.m in Sources */ = {isa = PBXBuildFile; fileRef = 55652DF813E1F2030023F4C6 /* SupportDir.m */; }; - 7F6E2C8C16B00ABA00BFE20D /* SFBInspectors.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */; }; - 7F73438A184AC559002897D0 /* DraggablePDFView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F734389184AC559002897D0 /* DraggablePDFView.m */; }; - 7F781C1A16B5DE1400239826 /* ParseErrorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F781C1916B5DE1400239826 /* ParseErrorView.m */; }; - 7F7B6DED18DE0C9E004F6CA8 /* tikzlexer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7B6DEA18DE0C9E004F6CA8 /* tikzlexer.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - 7F7B6DEE18DE0C9E004F6CA8 /* tikzparser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7B6DEC18DE0C9E004F6CA8 /* tikzparser.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - 7F7B6DF418DE0D7A004F6CA8 /* CustomNodeCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7B6DF118DE0D7A004F6CA8 /* CustomNodeCellView.m */; }; - 7F7B6DF518DE0D7A004F6CA8 /* CustomNodeController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F7B6DF318DE0D7A004F6CA8 /* CustomNodeController.m */; }; - 7F90E88616DD29600069EBCD /* NSString+Tikz.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F90E88516DD29600069EBCD /* NSString+Tikz.m */; }; - 7F90E88D16DD47540069EBCD /* PreferenceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F90E88B16DD47540069EBCD /* PreferenceController.m */; }; - 7F90E88E16DD47540069EBCD /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7F90E88C16DD47540069EBCD /* Preferences.xib */; }; - 7F90E89116DD54440069EBCD /* UserDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7F90E88F16DD54440069EBCD /* UserDefaults.plist */; }; - 7F93852E184D176E00FAED38 /* updates.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F93852D184D176E00FAED38 /* updates.png */; }; - 7F938530184D178B00FAED38 /* engine.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F93852F184D178B00FAED38 /* engine.png */; }; - 7F938532184D184700FAED38 /* preamble.png in Resources */ = {isa = PBXBuildFile; fileRef = 7F938531184D184700FAED38 /* preamble.png */; }; - 7FB9BFEE16B57C2E00773146 /* TikzFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FB9BFED16B57C2E00773146 /* TikzFormatter.m */; }; - 7FD5D44B18E1CB5300E2A930 /* CustomNodes.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7FD5D44918E1CB5300E2A930 /* CustomNodes.xib */; }; - 7FD5D44D18E1CC0B00E2A930 /* customshape.png in Resources */ = {isa = PBXBuildFile; fileRef = 7FD5D44C18E1CC0B00E2A930 /* customshape.png */; }; - 7FEED45716B1A7C500B056CB /* StyleManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FEED45616B1A7C500B056CB /* StyleManager.m */; }; - 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; }; - 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; - 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 5504C91A11D36CD5002A1478 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 2A37F4A9FDCFA73011CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8D15AC270486D014006FF6A4; - remoteInfo = TikZiT; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 55652E6613E1FD080023F4C6 /* Copy Shapes */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = shapes; - dstSubfolderSpec = 7; - files = ( - 55652E5613E1FC660023F4C6 /* cap.tikz in Copy Shapes */, - 55652E5713E1FC660023F4C6 /* copants.tikz in Copy Shapes */, - 55652E5813E1FC660023F4C6 /* cup.tikz in Copy Shapes */, - 55652E5913E1FC660023F4C6 /* oval.tikz in Copy Shapes */, - 55652E5A13E1FC660023F4C6 /* pants.tikz in Copy Shapes */, - ); - name = "Copy Shapes"; - runOnlyForDeploymentPostprocessing = 0; - }; - 559EFA5511C7D4DD00D020F4 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 55CA98DA12EF9098008F0368 /* SFBInspectors.framework in Copy Frameworks */, - 559EFA4E11C7D4BD00D020F4 /* Sparkle.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; - 7F6E2C8B16B00A9200BFE20D /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 7F6E2C8C16B00ABA00BFE20D /* SFBInspectors.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TikzDocument.xib; sourceTree = ""; }; - 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; - 2564AD2C0F5327BB00F57823 /* TikZiT_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TikZiT_Prefix.pch; sourceTree = ""; }; - 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; - 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 5504C82A11D23595002A1478 /* common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = common.m; path = src/common/test/common.m; sourceTree = ""; }; - 5504C82B11D23595002A1478 /* parser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = parser.m; path = src/common/test/parser.m; sourceTree = ""; }; - 5504C82C11D23595002A1478 /* test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test.h; path = src/common/test/test.h; sourceTree = ""; }; - 5504C82D11D23595002A1478 /* test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = test.m; path = src/common/test/test.m; sourceTree = ""; }; - 5504C83111D23685002A1478 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/osx/test/main.m; sourceTree = ""; }; - 5504C83711D237F5002A1478 /* tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tests; sourceTree = BUILT_PRODUCTS_DIR; }; - 5504C93E11D39422002A1478 /* osx.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = osx.m; path = src/osx/test/osx.m; sourceTree = ""; }; - 552202C2135F15FD007EA086 /* MultiField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiField.h; path = src/osx/MultiField.h; sourceTree = ""; }; - 552202C3135F15FD007EA086 /* MultiField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MultiField.m; path = src/osx/MultiField.m; sourceTree = ""; }; - 55391B0113D32608007DBE71 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/PropertyInspector.xib; sourceTree = ""; }; - 55391B0813D32765007DBE71 /* PropertyInspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PropertyInspectorController.h; path = src/osx/PropertyInspectorController.h; sourceTree = ""; }; - 55391B0913D32765007DBE71 /* PropertyInspectorController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PropertyInspectorController.m; path = src/osx/PropertyInspectorController.m; sourceTree = ""; }; - 55397C7714498C21006942FB /* EdgeStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EdgeStyle.h; path = src/common/EdgeStyle.h; sourceTree = ""; }; - 55397C7814498C22006942FB /* EdgeStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EdgeStyle.m; path = src/common/EdgeStyle.m; sourceTree = ""; }; - 55397C7A144990EA006942FB /* EdgeStyle+Coder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "EdgeStyle+Coder.h"; path = "src/osx/EdgeStyle+Coder.h"; sourceTree = ""; }; - 55397C7B144990EA006942FB /* EdgeStyle+Coder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "EdgeStyle+Coder.m"; path = "src/osx/EdgeStyle+Coder.m"; sourceTree = ""; }; - 55397C7D144999C4006942FB /* PropertyHolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PropertyHolder.h; path = src/common/PropertyHolder.h; sourceTree = ""; }; - 55397C7E144999C4006942FB /* PropertyHolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PropertyHolder.m; path = src/common/PropertyHolder.m; sourceTree = ""; }; - 55397C801449A877006942FB /* ED_arrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ED_arrow.png; sourceTree = ""; }; - 55397C821449A8F1006942FB /* ED_tick.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ED_tick.png; sourceTree = ""; }; - 55397C841449A9BF006942FB /* ED_none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ED_none.png; sourceTree = ""; }; - 55397C871449AB91006942FB /* AH_none.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AH_none.png; sourceTree = ""; }; - 55397C881449AB91006942FB /* AH_plain_tail.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AH_plain_tail.png; sourceTree = ""; }; - 55397C8C1449ABFC006942FB /* AH_latex_tail.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AH_latex_tail.png; sourceTree = ""; }; - 55397C8E1449AC7C006942FB /* AH_latex_head.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AH_latex_head.png; sourceTree = ""; }; - 55397C8F1449AC7C006942FB /* AH_plain_head.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = AH_plain_head.png; sourceTree = ""; }; - 553A4C58144ED3D500AA6FAC /* NilToEmptyStringTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NilToEmptyStringTransformer.h; path = src/osx/NilToEmptyStringTransformer.h; sourceTree = ""; }; - 553A4C59144ED3D500AA6FAC /* NilToEmptyStringTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NilToEmptyStringTransformer.m; path = src/osx/NilToEmptyStringTransformer.m; sourceTree = ""; }; - 55432E041444BF2D00401BB3 /* GraphElementProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GraphElementProperty.h; path = src/common/GraphElementProperty.h; sourceTree = ""; }; - 55432E051444BF2D00401BB3 /* GraphElementProperty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GraphElementProperty.m; path = src/common/GraphElementProperty.m; sourceTree = ""; }; - 55598E331635372E0023450A /* DiamondShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DiamondShape.h; path = src/common/DiamondShape.h; sourceTree = ""; }; - 55598E341635372E0023450A /* DiamondShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DiamondShape.m; path = src/common/DiamondShape.m; sourceTree = ""; }; - 555B30F811D8BE3300CAECF5 /* emblem-important.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "emblem-important.png"; sourceTree = ""; }; - 555B313411D8C6DA00CAECF5 /* color.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = color.m; path = src/common/test/color.m; sourceTree = ""; }; - 555ECE991378A3AA0052DB71 /* CALayer+DrawLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CALayer+DrawLabel.h"; path = "src/osx/CALayer+DrawLabel.h"; sourceTree = ""; }; - 555ECE9A1378A3AA0052DB71 /* CALayer+DrawLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CALayer+DrawLabel.m"; path = "src/osx/CALayer+DrawLabel.m"; sourceTree = ""; }; - 555ECF361379E9F80052DB71 /* ShapeNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShapeNames.h; path = src/common/ShapeNames.h; sourceTree = ""; }; - 55652DF713E1F2030023F4C6 /* SupportDir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SupportDir.h; path = src/common/SupportDir.h; sourceTree = ""; }; - 55652DF813E1F2030023F4C6 /* SupportDir.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SupportDir.m; path = src/common/SupportDir.m; sourceTree = ""; }; - 55652E3313E1FAED0023F4C6 /* CircleShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CircleShape.h; path = src/common/CircleShape.h; sourceTree = ""; }; - 55652E3413E1FAED0023F4C6 /* CircleShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CircleShape.m; path = src/common/CircleShape.m; sourceTree = ""; }; - 55652E3513E1FAED0023F4C6 /* RectangleShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RectangleShape.h; path = src/common/RectangleShape.h; sourceTree = ""; }; - 55652E3613E1FAED0023F4C6 /* RectangleShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RectangleShape.m; path = src/common/RectangleShape.m; sourceTree = ""; }; - 55652E3713E1FAED0023F4C6 /* RegularPolyShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegularPolyShape.h; path = src/common/RegularPolyShape.h; sourceTree = ""; }; - 55652E3813E1FAED0023F4C6 /* RegularPolyShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RegularPolyShape.m; path = src/common/RegularPolyShape.m; sourceTree = ""; }; - 55652E3913E1FAEE0023F4C6 /* TikzShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzShape.h; path = src/common/TikzShape.h; sourceTree = ""; }; - 55652E3A13E1FAEE0023F4C6 /* TikzShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzShape.m; path = src/common/TikzShape.m; sourceTree = ""; }; - 55652E3F13E1FB0A0023F4C6 /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Shape.h; path = src/common/Shape.h; sourceTree = ""; }; - 55652E4013E1FB0A0023F4C6 /* Shape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Shape.m; path = src/common/Shape.m; sourceTree = ""; }; - 55652E5113E1FC660023F4C6 /* cap.tikz */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cap.tikz; sourceTree = ""; }; - 55652E5213E1FC660023F4C6 /* copants.tikz */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = copants.tikz; sourceTree = ""; }; - 55652E5313E1FC660023F4C6 /* cup.tikz */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cup.tikz; sourceTree = ""; }; - 55652E5413E1FC660023F4C6 /* oval.tikz */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = oval.tikz; sourceTree = ""; }; - 55652E5513E1FC660023F4C6 /* pants.tikz */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pants.tikz; sourceTree = ""; }; - 5573B8B911D9FC8D00B5DC5D /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; - 5573B8BD11D9FCD400B5DC5D /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preview.xib; sourceTree = ""; }; - 5573B8C011D9FD3200B5DC5D /* PreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreviewController.h; path = src/osx/PreviewController.h; sourceTree = ""; }; - 5573B8C111D9FD3200B5DC5D /* PreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreviewController.m; path = src/osx/PreviewController.m; sourceTree = ""; }; - 5573B90D11DA231A00B5DC5D /* PreambleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreambleController.h; path = src/osx/PreambleController.h; sourceTree = ""; }; - 5573B90E11DA231A00B5DC5D /* PreambleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreambleController.m; path = src/osx/PreambleController.m; sourceTree = ""; }; - 5573B91011DA233E00B5DC5D /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Preamble.xib; sourceTree = ""; }; - 5573B92011DA259C00B5DC5D /* text-x-generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "text-x-generic.png"; sourceTree = ""; }; - 5573B92411DA273400B5DC5D /* format-indent-less.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "format-indent-less.png"; sourceTree = ""; }; - 5573B92711DA292F00B5DC5D /* Preambles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Preambles.h; path = src/common/Preambles.h; sourceTree = ""; }; - 5573B92811DA292F00B5DC5D /* Preambles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Preambles.m; path = src/common/Preambles.m; sourceTree = ""; }; - 5573B98711DA377C00B5DC5D /* text-x-script.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "text-x-script.png"; sourceTree = ""; }; - 5573BDC911DB4D2600B5DC5D /* Preambles+Coder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Preambles+Coder.h"; path = "src/osx/Preambles+Coder.h"; sourceTree = ""; }; - 5573BDCA11DB4D2600B5DC5D /* Preambles+Coder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "Preambles+Coder.m"; path = "src/osx/Preambles+Coder.m"; sourceTree = ""; }; - 5585E5C0117F681800124513 /* NodeStyle+Coder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NodeStyle+Coder.h"; path = "src/osx/NodeStyle+Coder.h"; sourceTree = ""; }; - 5585E5C1117F681800124513 /* NodeStyle+Coder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NodeStyle+Coder.m"; path = "src/osx/NodeStyle+Coder.m"; sourceTree = ""; }; - 5589A9AA11C500060064D310 /* tikzlexer.lm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = tikzlexer.lm; path = src/common/tikzlexer.lm; sourceTree = ""; }; - 5589A9AB11C500060064D310 /* tikzparser.ym */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = tikzparser.ym; path = src/common/tikzparser.ym; sourceTree = ""; }; - 5589A9FD11C51E780064D310 /* TikzGraphAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzGraphAssembler.h; path = src/common/TikzGraphAssembler.h; sourceTree = ""; }; - 5589A9FE11C51E780064D310 /* TikzGraphAssembler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzGraphAssembler.m; path = src/common/TikzGraphAssembler.m; sourceTree = ""; }; - 5589AD4211C633EE0064D310 /* SelectBoxLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectBoxLayer.h; path = src/osx/SelectBoxLayer.h; sourceTree = ""; }; - 5589AD4311C633EE0064D310 /* SelectBoxLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SelectBoxLayer.m; path = src/osx/SelectBoxLayer.m; sourceTree = ""; }; - 558F18B9117B031C009863B2 /* Edge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Edge.h; path = src/common/Edge.h; sourceTree = ""; }; - 558F18BA117B031C009863B2 /* Edge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Edge.m; path = src/common/Edge.m; sourceTree = ""; }; - 558F18BB117B031C009863B2 /* Graph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Graph.h; path = src/common/Graph.h; sourceTree = ""; }; - 558F18BC117B031C009863B2 /* Graph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Graph.m; path = src/common/Graph.m; sourceTree = ""; }; - 558F18BD117B031C009863B2 /* GraphChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GraphChange.h; path = src/common/GraphChange.h; sourceTree = ""; }; - 558F18BE117B031C009863B2 /* GraphChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GraphChange.m; path = src/common/GraphChange.m; sourceTree = ""; }; - 558F18BF117B031C009863B2 /* GraphElementData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GraphElementData.h; path = src/common/GraphElementData.h; sourceTree = ""; }; - 558F18C0117B031C009863B2 /* GraphElementData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GraphElementData.m; path = src/common/GraphElementData.m; sourceTree = ""; }; - 558F18C1117B031C009863B2 /* Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Node.h; path = src/common/Node.h; sourceTree = ""; }; - 558F18C2117B031C009863B2 /* Node.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Node.m; path = src/common/Node.m; sourceTree = ""; }; - 558F18C3117B031C009863B2 /* NodeStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NodeStyle.h; path = src/common/NodeStyle.h; sourceTree = ""; }; - 558F18C4117B031C009863B2 /* NodeStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NodeStyle.m; path = src/common/NodeStyle.m; sourceTree = ""; }; - 558F18CB117B03DD009863B2 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/osx/main.m; sourceTree = ""; }; - 558F18CC117B03DD009863B2 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = util.h; path = src/common/util.h; sourceTree = ""; }; - 558F18CD117B03DD009863B2 /* util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = util.m; path = src/common/util.m; sourceTree = ""; }; - 558F18D9117B043B009863B2 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/osx/AppDelegate.h; sourceTree = ""; }; - 558F18DA117B043B009863B2 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = src/osx/AppDelegate.m; sourceTree = ""; }; - 558F18DD117B043B009863B2 /* EdgeControlLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EdgeControlLayer.h; path = src/osx/EdgeControlLayer.h; sourceTree = ""; }; - 558F18DE117B043B009863B2 /* EdgeControlLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EdgeControlLayer.m; path = src/osx/EdgeControlLayer.m; sourceTree = ""; }; - 558F18DF117B043B009863B2 /* GraphicsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GraphicsView.h; path = src/osx/GraphicsView.h; sourceTree = ""; }; - 558F18E0117B043B009863B2 /* GraphicsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GraphicsView.m; path = src/osx/GraphicsView.m; sourceTree = ""; }; - 558F18E1117B043B009863B2 /* Grid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Grid.h; path = src/osx/Grid.h; sourceTree = ""; }; - 558F18E2117B043B009863B2 /* Grid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Grid.m; path = src/osx/Grid.m; sourceTree = ""; }; - 558F18E3117B043B009863B2 /* NodeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NodeLayer.h; path = src/osx/NodeLayer.h; sourceTree = ""; }; - 558F18E4117B043B009863B2 /* NodeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NodeLayer.m; path = src/osx/NodeLayer.m; sourceTree = ""; }; - 558F18E5117B043B009863B2 /* NodeSelectionLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NodeSelectionLayer.h; path = src/osx/NodeSelectionLayer.h; sourceTree = ""; }; - 558F18E6117B043B009863B2 /* NodeSelectionLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NodeSelectionLayer.m; path = src/osx/NodeSelectionLayer.m; sourceTree = ""; }; - 558F18E9117B043B009863B2 /* SelectableCollectionViewItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectableCollectionViewItem.h; path = src/osx/SelectableCollectionViewItem.h; sourceTree = ""; }; - 558F18EA117B043B009863B2 /* SelectableCollectionViewItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SelectableCollectionViewItem.m; path = src/osx/SelectableCollectionViewItem.m; sourceTree = ""; }; - 558F18EB117B043B009863B2 /* SelectableNodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectableNodeView.h; path = src/osx/SelectableNodeView.h; sourceTree = ""; }; - 558F18EC117B043B009863B2 /* SelectableNodeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SelectableNodeView.m; path = src/osx/SelectableNodeView.m; sourceTree = ""; }; - 558F18ED117B043B009863B2 /* StylePaletteController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StylePaletteController.h; path = src/osx/StylePaletteController.h; sourceTree = ""; }; - 558F18EE117B043B009863B2 /* StylePaletteController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StylePaletteController.m; path = src/osx/StylePaletteController.m; sourceTree = ""; }; - 558F18EF117B043B009863B2 /* TikzDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzDocument.h; path = src/osx/TikzDocument.h; sourceTree = ""; }; - 558F18F0117B043B009863B2 /* TikzDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzDocument.m; path = src/osx/TikzDocument.m; sourceTree = ""; }; - 558F18F1117B043B009863B2 /* TikzSourceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzSourceController.h; path = src/osx/TikzSourceController.h; sourceTree = ""; }; - 558F18F2117B043B009863B2 /* TikzSourceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzSourceController.m; path = src/osx/TikzSourceController.m; sourceTree = ""; }; - 558F18F3117B043B009863B2 /* ToolPaletteController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolPaletteController.h; path = src/osx/ToolPaletteController.h; sourceTree = ""; }; - 558F18F4117B043B009863B2 /* ToolPaletteController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ToolPaletteController.m; path = src/osx/ToolPaletteController.m; sourceTree = ""; }; - 55900A9F135FA918002DD28E /* MultiCombo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiCombo.h; path = src/osx/MultiCombo.h; sourceTree = ""; }; - 55900AA0135FA918002DD28E /* MultiCombo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MultiCombo.m; path = src/osx/MultiCombo.m; sourceTree = ""; }; - 55900AE2135FB305002DD28E /* emblem-unreadable-grey.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "emblem-unreadable-grey.png"; sourceTree = ""; }; - 559EFA4711C7D49800D020F4 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Frameworks/Sparkle.framework; sourceTree = ""; }; - 559EFA5611C7D95F00D020F4 /* tikzit_dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tikzit_dsa_pub.pem; sourceTree = ""; }; - 559EFB6611CB88E300D020F4 /* ColorRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColorRGB.h; path = src/common/ColorRGB.h; sourceTree = ""; }; - 559EFB6711CB88E300D020F4 /* ColorRGB.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ColorRGB.m; path = src/common/ColorRGB.m; sourceTree = ""; }; - 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SFBInspectors.framework; path = Frameworks/SFBInspectors.framework; sourceTree = ""; }; - 55CA997012F08281008F0368 /* TikzWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzWindowController.h; path = src/osx/TikzWindowController.h; sourceTree = ""; }; - 55CA997112F08281008F0368 /* TikzWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzWindowController.m; path = src/osx/TikzWindowController.m; sourceTree = ""; }; - 55CA9AC712F831E5008F0368 /* RColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RColor.h; path = src/common/RColor.h; sourceTree = ""; }; - 55CA9AC812F831E5008F0368 /* RColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RColor.m; path = src/common/RColor.m; sourceTree = ""; }; - 55D2E0B01186ED950060B4EC /* Graph+Coder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Graph+Coder.h"; path = "src/osx/Graph+Coder.h"; sourceTree = ""; }; - 55D2E0B11186ED950060B4EC /* Graph+Coder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "Graph+Coder.m"; path = "src/osx/Graph+Coder.m"; sourceTree = ""; }; - 55D945701165904F0044178C /* tikzitdoc.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = tikzitdoc.icns; sourceTree = ""; }; - 55D945711165904F0044178C /* tikzit.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = tikzit.icns; sourceTree = ""; }; - 55D947301165A5D40044178C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/StylePalette.xib; sourceTree = ""; }; - 55D949111165D8870044178C /* draw-ellipse.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "draw-ellipse.png"; sourceTree = ""; }; - 55D949121165D8870044178C /* draw-path.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "draw-path.png"; sourceTree = ""; }; - 55D949131165D8870044178C /* select-rectangular.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "select-rectangular.png"; sourceTree = ""; }; - 55E5E99D1215C8E300256F69 /* transform-crop-and-resize.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "transform-crop-and-resize.png"; sourceTree = ""; }; - 55F958581181B09600F99434 /* PickSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PickSupport.h; path = src/common/PickSupport.h; sourceTree = ""; }; - 55F958591181B09600F99434 /* PickSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PickSupport.m; path = src/common/PickSupport.m; sourceTree = ""; }; - 55F9585A1181B09600F99434 /* Transformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Transformer.h; path = src/common/Transformer.h; sourceTree = ""; }; - 55F9585B1181B09600F99434 /* Transformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Transformer.m; path = src/common/Transformer.m; sourceTree = ""; }; - 55F9E04311FF54F000F5659E /* NSString+LatexConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+LatexConstants.h"; path = "src/common/NSString+LatexConstants.h"; sourceTree = ""; }; - 55F9E04411FF54F000F5659E /* NSString+LatexConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+LatexConstants.m"; path = "src/common/NSString+LatexConstants.m"; sourceTree = ""; }; - 55FF4E64116A401B000C22B4 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; }; - 7F18A31F184C577000BC3081 /* UpdatePreferenceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePreferenceController.h; path = src/osx/UpdatePreferenceController.h; sourceTree = ""; }; - 7F18A320184C577000BC3081 /* UpdatePreferenceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UpdatePreferenceController.m; path = src/osx/UpdatePreferenceController.m; sourceTree = ""; }; - 7F18A322184C599100BC3081 /* UpdatePreferencePanel.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = UpdatePreferencePanel.xib; path = src/osx/UpdatePreferencePanel.xib; sourceTree = ""; }; - 7F6E2C8716B0091300BFE20D /* maths.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = maths.m; path = src/common/test/maths.m; sourceTree = ""; }; - 7F734388184AC559002897D0 /* DraggablePDFView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DraggablePDFView.h; path = src/osx/DraggablePDFView.h; sourceTree = ""; }; - 7F734389184AC559002897D0 /* DraggablePDFView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DraggablePDFView.m; path = src/osx/DraggablePDFView.m; sourceTree = ""; }; - 7F781C1816B5DE1400239826 /* ParseErrorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ParseErrorView.h; path = src/osx/ParseErrorView.h; sourceTree = ""; }; - 7F781C1916B5DE1400239826 /* ParseErrorView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ParseErrorView.m; path = src/osx/ParseErrorView.m; sourceTree = ""; }; - 7F7B6DE918DE0C9E004F6CA8 /* tikzlexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tikzlexer.h; path = xbuild/TikZiT.build/Debug/TikZiT.build/DerivedSources/tikzlexer.h; sourceTree = ""; }; - 7F7B6DEA18DE0C9E004F6CA8 /* tikzlexer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = tikzlexer.m; path = xbuild/TikZiT.build/Debug/TikZiT.build/DerivedSources/tikzlexer.m; sourceTree = ""; }; - 7F7B6DEB18DE0C9E004F6CA8 /* tikzparser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tikzparser.h; path = xbuild/TikZiT.build/Debug/TikZiT.build/DerivedSources/tikzparser.h; sourceTree = ""; }; - 7F7B6DEC18DE0C9E004F6CA8 /* tikzparser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = tikzparser.m; path = xbuild/TikZiT.build/Debug/TikZiT.build/DerivedSources/tikzparser.m; sourceTree = ""; }; - 7F7B6DF018DE0D7A004F6CA8 /* CustomNodeCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomNodeCellView.h; path = src/osx/CustomNodeCellView.h; sourceTree = ""; }; - 7F7B6DF118DE0D7A004F6CA8 /* CustomNodeCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomNodeCellView.m; path = src/osx/CustomNodeCellView.m; sourceTree = ""; }; - 7F7B6DF218DE0D7A004F6CA8 /* CustomNodeController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomNodeController.h; path = src/osx/CustomNodeController.h; sourceTree = ""; }; - 7F7B6DF318DE0D7A004F6CA8 /* CustomNodeController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomNodeController.m; path = src/osx/CustomNodeController.m; sourceTree = ""; }; - 7F90E88416DD29600069EBCD /* NSString+Tikz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSString+Tikz.h"; path = "src/common/NSString+Tikz.h"; sourceTree = ""; }; - 7F90E88516DD29600069EBCD /* NSString+Tikz.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+Tikz.m"; path = "src/common/NSString+Tikz.m"; sourceTree = ""; }; - 7F90E88A16DD47540069EBCD /* PreferenceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PreferenceController.h; path = src/osx/PreferenceController.h; sourceTree = ""; }; - 7F90E88B16DD47540069EBCD /* PreferenceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PreferenceController.m; path = src/osx/PreferenceController.m; sourceTree = ""; }; - 7F90E88C16DD47540069EBCD /* Preferences.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = Preferences.xib; path = src/osx/Preferences.xib; sourceTree = ""; }; - 7F90E89016DD54440069EBCD /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = English; path = English.lproj/UserDefaults.plist; sourceTree = ""; }; - 7F93852D184D176E00FAED38 /* updates.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = updates.png; sourceTree = ""; }; - 7F93852F184D178B00FAED38 /* engine.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = engine.png; sourceTree = ""; }; - 7F938531184D184700FAED38 /* preamble.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = preamble.png; sourceTree = ""; }; - 7FB9BFEC16B57C2E00773146 /* TikzFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TikzFormatter.h; path = src/osx/TikzFormatter.h; sourceTree = ""; }; - 7FB9BFED16B57C2E00773146 /* TikzFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TikzFormatter.m; path = src/osx/TikzFormatter.m; sourceTree = ""; }; - 7FD5D44A18E1CB5300E2A930 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/CustomNodes.xib; sourceTree = ""; }; - 7FD5D44C18E1CC0B00E2A930 /* customshape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = customshape.png; sourceTree = ""; }; - 7FEED45516B1A7C400B056CB /* StyleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleManager.h; path = src/common/StyleManager.h; sourceTree = ""; }; - 7FEED45616B1A7C500B056CB /* StyleManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = StyleManager.m; path = src/common/StyleManager.m; sourceTree = ""; }; - 8D15AC360486D014006FF6A4 /* TikZiT-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TikZiT-Info.plist"; sourceTree = ""; }; - 8D15AC370486D014006FF6A4 /* TikZiT.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TikZiT.app; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 5589AA6311C5429C0064D310 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 55CA98DD12EF910F008F0368 /* SFBInspectors.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D15AC330486D014006FF6A4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, - 559EFA4811C7D49800D020F4 /* Sparkle.framework in Frameworks */, - 5573B8BA11D9FC8D00B5DC5D /* Quartz.framework in Frameworks */, - 55CA98D512EF8FCE008F0368 /* SFBInspectors.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */, - 55FF4E64116A401B000C22B4 /* libicucore.dylib */, - 559EFA4711C7D49800D020F4 /* Sparkle.framework */, - 55CA98D412EF8FCE008F0368 /* SFBInspectors.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */, - 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */, - 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */, - 5573B8B911D9FC8D00B5DC5D /* Quartz.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FB0FE9D524F11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D15AC370486D014006FF6A4 /* TikZiT.app */, - 5504C83711D237F5002A1478 /* tests */, - ); - name = Products; - sourceTree = ""; - }; - 2A37F4AAFDCFA73011CA2CEA /* TikZiT */ = { - isa = PBXGroup; - children = ( - 2A37F4ABFDCFA73011CA2CEA /* TikZiT */, - 2A37F4AFFDCFA73011CA2CEA /* Other Sources */, - 2A37F4B8FDCFA73011CA2CEA /* Resources */, - 2A37F4C3FDCFA73011CA2CEA /* Frameworks */, - 19C28FB0FE9D524F11CA2CBB /* Products */, - ); - name = TikZiT; - sourceTree = ""; - }; - 2A37F4ABFDCFA73011CA2CEA /* TikZiT */ = { - isa = PBXGroup; - children = ( - 5504C82611D23477002A1478 /* Test */, - 55D946141165924F0044178C /* Graph */, - 55D946071165922F0044178C /* Parser */, - 55D9467311659F5E0044178C /* Gui */, - 558F18D9117B043B009863B2 /* AppDelegate.h */, - 558F18DA117B043B009863B2 /* AppDelegate.m */, - 55F9E04311FF54F000F5659E /* NSString+LatexConstants.h */, - 55F9E04411FF54F000F5659E /* NSString+LatexConstants.m */, - ); - name = TikZiT; - sourceTree = ""; - }; - 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 55CA9AC712F831E5008F0368 /* RColor.h */, - 55CA9AC812F831E5008F0368 /* RColor.m */, - 558F18CB117B03DD009863B2 /* main.m */, - 558F18CC117B03DD009863B2 /* util.h */, - 558F18CD117B03DD009863B2 /* util.m */, - 2564AD2C0F5327BB00F57823 /* TikZiT_Prefix.pch */, - 55652DF713E1F2030023F4C6 /* SupportDir.h */, - 55652DF813E1F2030023F4C6 /* SupportDir.m */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 2A37F4B8FDCFA73011CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 55397C8E1449AC7C006942FB /* AH_latex_head.png */, - 55397C8F1449AC7C006942FB /* AH_plain_head.png */, - 55397C8C1449ABFC006942FB /* AH_latex_tail.png */, - 55397C871449AB91006942FB /* AH_none.png */, - 55397C881449AB91006942FB /* AH_plain_tail.png */, - 55397C841449A9BF006942FB /* ED_none.png */, - 55397C821449A8F1006942FB /* ED_tick.png */, - 55397C801449A877006942FB /* ED_arrow.png */, - 7F93852C184D175400FAED38 /* Icons */, - 55652E5013E1FC660023F4C6 /* shapes */, - 55900AE2135FB305002DD28E /* emblem-unreadable-grey.png */, - 55E5E99D1215C8E300256F69 /* transform-crop-and-resize.png */, - 5573B98711DA377C00B5DC5D /* text-x-script.png */, - 8D15AC360486D014006FF6A4 /* TikZiT-Info.plist */, - 7F90E88F16DD54440069EBCD /* UserDefaults.plist */, - 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, - 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, - 55D949111165D8870044178C /* draw-ellipse.png */, - 55D949121165D8870044178C /* draw-path.png */, - 555B30F811D8BE3300CAECF5 /* emblem-important.png */, - 5573B92411DA273400B5DC5D /* format-indent-less.png */, - 55D949131165D8870044178C /* select-rectangular.png */, - 5573B92011DA259C00B5DC5D /* text-x-generic.png */, - 559EFA5611C7D95F00D020F4 /* tikzit_dsa_pub.pem */, - 55D945701165904F0044178C /* tikzitdoc.icns */, - 55D945711165904F0044178C /* tikzit.icns */, - 7F90E88C16DD47540069EBCD /* Preferences.xib */, - 7FD5D44918E1CB5300E2A930 /* CustomNodes.xib */, - 7F18A322184C599100BC3081 /* UpdatePreferencePanel.xib */, - 55391AF713D3250F007DBE71 /* Preamble.xib */, - 55391AF513D324FE007DBE71 /* Preview.xib */, - 55391B0013D32608007DBE71 /* PropertyInspector.xib */, - 556979421168747B007E5703 /* StylePalette.xib */, - 1DDD58280DA1D0D100B32029 /* TikzDocument.xib */, - 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, - ); - name = Resources; - sourceTree = ""; - }; - 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */, - 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 5504C82611D23477002A1478 /* Test */ = { - isa = PBXGroup; - children = ( - 555B313411D8C6DA00CAECF5 /* color.m */, - 5504C93E11D39422002A1478 /* osx.m */, - 5504C82A11D23595002A1478 /* common.m */, - 5504C83111D23685002A1478 /* main.m */, - 5504C82B11D23595002A1478 /* parser.m */, - 5504C82C11D23595002A1478 /* test.h */, - 5504C82D11D23595002A1478 /* test.m */, - 7F6E2C8716B0091300BFE20D /* maths.m */, - ); - name = Test; - sourceTree = ""; - }; - 55391B0713D326E5007DBE71 /* PropertyInspector */ = { - isa = PBXGroup; - children = ( - 552202C2135F15FD007EA086 /* MultiField.h */, - 552202C3135F15FD007EA086 /* MultiField.m */, - 55900A9F135FA918002DD28E /* MultiCombo.h */, - 55900AA0135FA918002DD28E /* MultiCombo.m */, - 55391B0813D32765007DBE71 /* PropertyInspectorController.h */, - 55391B0913D32765007DBE71 /* PropertyInspectorController.m */, - ); - name = PropertyInspector; - sourceTree = ""; - }; - 55652E5013E1FC660023F4C6 /* shapes */ = { - isa = PBXGroup; - children = ( - 55652E5113E1FC660023F4C6 /* cap.tikz */, - 55652E5213E1FC660023F4C6 /* copants.tikz */, - 55652E5313E1FC660023F4C6 /* cup.tikz */, - 55652E5413E1FC660023F4C6 /* oval.tikz */, - 55652E5513E1FC660023F4C6 /* pants.tikz */, - ); - path = shapes; - sourceTree = ""; - }; - 5573B8BF11D9FD1800B5DC5D /* Preview */ = { - isa = PBXGroup; - children = ( - 7F734388184AC559002897D0 /* DraggablePDFView.h */, - 7F734389184AC559002897D0 /* DraggablePDFView.m */, - 5573B8C011D9FD3200B5DC5D /* PreviewController.h */, - 5573B8C111D9FD3200B5DC5D /* PreviewController.m */, - ); - name = Preview; - sourceTree = ""; - }; - 5573B90C11DA22E500B5DC5D /* Preamble */ = { - isa = PBXGroup; - children = ( - 5573B92711DA292F00B5DC5D /* Preambles.h */, - 5573B92811DA292F00B5DC5D /* Preambles.m */, - 5573BDC911DB4D2600B5DC5D /* Preambles+Coder.h */, - 5573BDCA11DB4D2600B5DC5D /* Preambles+Coder.m */, - ); - name = Preamble; - sourceTree = ""; - }; - 55900AFC13605498002DD28E /* Shapes */ = { - isa = PBXGroup; - children = ( - 55598E331635372E0023450A /* DiamondShape.h */, - 55598E341635372E0023450A /* DiamondShape.m */, - 55652E3F13E1FB0A0023F4C6 /* Shape.h */, - 55652E4013E1FB0A0023F4C6 /* Shape.m */, - 55652E3313E1FAED0023F4C6 /* CircleShape.h */, - 55652E3413E1FAED0023F4C6 /* CircleShape.m */, - 55652E3513E1FAED0023F4C6 /* RectangleShape.h */, - 55652E3613E1FAED0023F4C6 /* RectangleShape.m */, - 55652E3713E1FAED0023F4C6 /* RegularPolyShape.h */, - 55652E3813E1FAED0023F4C6 /* RegularPolyShape.m */, - 55652E3913E1FAEE0023F4C6 /* TikzShape.h */, - 55652E3A13E1FAEE0023F4C6 /* TikzShape.m */, - 555ECF361379E9F80052DB71 /* ShapeNames.h */, - ); - name = Shapes; - sourceTree = ""; - }; - 55D946071165922F0044178C /* Parser */ = { - isa = PBXGroup; - children = ( - 7F7B6DE218DE0BE1004F6CA8 /* Generated sources */, - 5589A9AA11C500060064D310 /* tikzlexer.lm */, - 5589A9AB11C500060064D310 /* tikzparser.ym */, - 5589A9FD11C51E780064D310 /* TikzGraphAssembler.h */, - 5589A9FE11C51E780064D310 /* TikzGraphAssembler.m */, - ); - name = Parser; - sourceTree = ""; - }; - 55D946141165924F0044178C /* Graph */ = { - isa = PBXGroup; - children = ( - 55432E041444BF2D00401BB3 /* GraphElementProperty.h */, - 55432E051444BF2D00401BB3 /* GraphElementProperty.m */, - 559EFB6611CB88E300D020F4 /* ColorRGB.h */, - 559EFB6711CB88E300D020F4 /* ColorRGB.m */, - 558F18B9117B031C009863B2 /* Edge.h */, - 558F18BA117B031C009863B2 /* Edge.m */, - 558F18BB117B031C009863B2 /* Graph.h */, - 558F18BC117B031C009863B2 /* Graph.m */, - 55D2E0B01186ED950060B4EC /* Graph+Coder.h */, - 55D2E0B11186ED950060B4EC /* Graph+Coder.m */, - 558F18BD117B031C009863B2 /* GraphChange.h */, - 558F18BE117B031C009863B2 /* GraphChange.m */, - 7FEED45516B1A7C400B056CB /* StyleManager.h */, - 7FEED45616B1A7C500B056CB /* StyleManager.m */, - 558F18BF117B031C009863B2 /* GraphElementData.h */, - 558F18C0117B031C009863B2 /* GraphElementData.m */, - 558F18C1117B031C009863B2 /* Node.h */, - 558F18C2117B031C009863B2 /* Node.m */, - 7F90E88416DD29600069EBCD /* NSString+Tikz.h */, - 7F90E88516DD29600069EBCD /* NSString+Tikz.m */, - 558F18C3117B031C009863B2 /* NodeStyle.h */, - 558F18C4117B031C009863B2 /* NodeStyle.m */, - 5585E5C0117F681800124513 /* NodeStyle+Coder.h */, - 5585E5C1117F681800124513 /* NodeStyle+Coder.m */, - 55397C7714498C21006942FB /* EdgeStyle.h */, - 55397C7814498C22006942FB /* EdgeStyle.m */, - 55397C7A144990EA006942FB /* EdgeStyle+Coder.h */, - 55397C7B144990EA006942FB /* EdgeStyle+Coder.m */, - 55397C7D144999C4006942FB /* PropertyHolder.h */, - 55397C7E144999C4006942FB /* PropertyHolder.m */, - ); - name = Graph; - sourceTree = ""; - }; - 55D9467311659F5E0044178C /* Gui */ = { - isa = PBXGroup; - children = ( - 7FB9BFE616B54BE300773146 /* Formatter */, - 55D9468011659FD50044178C /* GraphicsView */, - 5573B90C11DA22E500B5DC5D /* Preamble */, - 5573B8BF11D9FD1800B5DC5D /* Preview */, - 55391B0713D326E5007DBE71 /* PropertyInspector */, - 55D9468D11659FF00044178C /* StylePalette */, - 558F18EF117B043B009863B2 /* TikzDocument.h */, - 7F781C1816B5DE1400239826 /* ParseErrorView.h */, - 7F781C1916B5DE1400239826 /* ParseErrorView.m */, - 558F18F0117B043B009863B2 /* TikzDocument.m */, - 558F18F1117B043B009863B2 /* TikzSourceController.h */, - 558F18F2117B043B009863B2 /* TikzSourceController.m */, - 558F18F3117B043B009863B2 /* ToolPaletteController.h */, - 558F18F4117B043B009863B2 /* ToolPaletteController.m */, - 55CA997012F08281008F0368 /* TikzWindowController.h */, - 55CA997112F08281008F0368 /* TikzWindowController.m */, - 553A4C58144ED3D500AA6FAC /* NilToEmptyStringTransformer.h */, - 553A4C59144ED3D500AA6FAC /* NilToEmptyStringTransformer.m */, - 7F18A31E184C563800BC3081 /* Preferences */, - ); - name = Gui; - sourceTree = ""; - }; - 55D9468011659FD50044178C /* GraphicsView */ = { - isa = PBXGroup; - children = ( - 55900AFC13605498002DD28E /* Shapes */, - 558F18DD117B043B009863B2 /* EdgeControlLayer.h */, - 558F18DE117B043B009863B2 /* EdgeControlLayer.m */, - 558F18DF117B043B009863B2 /* GraphicsView.h */, - 558F18E0117B043B009863B2 /* GraphicsView.m */, - 558F18E1117B043B009863B2 /* Grid.h */, - 558F18E2117B043B009863B2 /* Grid.m */, - 558F18E3117B043B009863B2 /* NodeLayer.h */, - 558F18E4117B043B009863B2 /* NodeLayer.m */, - 558F18E5117B043B009863B2 /* NodeSelectionLayer.h */, - 558F18E6117B043B009863B2 /* NodeSelectionLayer.m */, - 55F958581181B09600F99434 /* PickSupport.h */, - 55F958591181B09600F99434 /* PickSupport.m */, - 55F9585A1181B09600F99434 /* Transformer.h */, - 55F9585B1181B09600F99434 /* Transformer.m */, - 5589AD4211C633EE0064D310 /* SelectBoxLayer.h */, - 5589AD4311C633EE0064D310 /* SelectBoxLayer.m */, - 555ECE991378A3AA0052DB71 /* CALayer+DrawLabel.h */, - 555ECE9A1378A3AA0052DB71 /* CALayer+DrawLabel.m */, - ); - name = GraphicsView; - sourceTree = ""; - }; - 55D9468D11659FF00044178C /* StylePalette */ = { - isa = PBXGroup; - children = ( - 558F18E9117B043B009863B2 /* SelectableCollectionViewItem.h */, - 558F18EA117B043B009863B2 /* SelectableCollectionViewItem.m */, - 558F18EB117B043B009863B2 /* SelectableNodeView.h */, - 558F18EC117B043B009863B2 /* SelectableNodeView.m */, - 558F18ED117B043B009863B2 /* StylePaletteController.h */, - 558F18EE117B043B009863B2 /* StylePaletteController.m */, - ); - name = StylePalette; - sourceTree = ""; - }; - 7F18A31E184C563800BC3081 /* Preferences */ = { - isa = PBXGroup; - children = ( - 7F7B6DEF18DE0D70004F6CA8 /* CustomNode */, - 5573B90D11DA231A00B5DC5D /* PreambleController.h */, - 5573B90E11DA231A00B5DC5D /* PreambleController.m */, - 7F90E88A16DD47540069EBCD /* PreferenceController.h */, - 7F90E88B16DD47540069EBCD /* PreferenceController.m */, - 7F18A31F184C577000BC3081 /* UpdatePreferenceController.h */, - 7F18A320184C577000BC3081 /* UpdatePreferenceController.m */, - ); - name = Preferences; - sourceTree = ""; - }; - 7F7B6DE218DE0BE1004F6CA8 /* Generated sources */ = { - isa = PBXGroup; - children = ( - 7F7B6DE918DE0C9E004F6CA8 /* tikzlexer.h */, - 7F7B6DEA18DE0C9E004F6CA8 /* tikzlexer.m */, - 7F7B6DEB18DE0C9E004F6CA8 /* tikzparser.h */, - 7F7B6DEC18DE0C9E004F6CA8 /* tikzparser.m */, - ); - name = "Generated sources"; - sourceTree = ""; - }; - 7F7B6DEF18DE0D70004F6CA8 /* CustomNode */ = { - isa = PBXGroup; - children = ( - 7F7B6DF018DE0D7A004F6CA8 /* CustomNodeCellView.h */, - 7F7B6DF118DE0D7A004F6CA8 /* CustomNodeCellView.m */, - 7F7B6DF218DE0D7A004F6CA8 /* CustomNodeController.h */, - 7F7B6DF318DE0D7A004F6CA8 /* CustomNodeController.m */, - ); - name = CustomNode; - sourceTree = ""; - }; - 7F93852C184D175400FAED38 /* Icons */ = { - isa = PBXGroup; - children = ( - 7F93852F184D178B00FAED38 /* engine.png */, - 7F938531184D184700FAED38 /* preamble.png */, - 7FD5D44C18E1CC0B00E2A930 /* customshape.png */, - 7F93852D184D176E00FAED38 /* updates.png */, - ); - name = Icons; - sourceTree = ""; - }; - 7FB9BFE616B54BE300773146 /* Formatter */ = { - isa = PBXGroup; - children = ( - 7FB9BFEC16B57C2E00773146 /* TikzFormatter.h */, - 7FB9BFED16B57C2E00773146 /* TikzFormatter.m */, - ); - name = Formatter; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 5589AA6411C5429C0064D310 /* tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5589AA8311C543240064D310 /* Build configuration list for PBXNativeTarget "tests" */; - buildPhases = ( - 5589AA6211C5429C0064D310 /* Sources */, - 5589AA6311C5429C0064D310 /* Frameworks */, - 7F6E2C8B16B00A9200BFE20D /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 5504C91B11D36CD5002A1478 /* PBXTargetDependency */, - ); - name = tests; - productName = testparser; - productReference = 5504C83711D237F5002A1478 /* tests */; - productType = "com.apple.product-type.tool"; - }; - 8D15AC270486D014006FF6A4 /* TikZiT */ = { - isa = PBXNativeTarget; - buildConfigurationList = C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "TikZiT" */; - buildPhases = ( - 559EFA5511C7D4DD00D020F4 /* Copy Frameworks */, - 8D15AC2B0486D014006FF6A4 /* Resources */, - 55652E6613E1FD080023F4C6 /* Copy Shapes */, - 7F7B6DE018DE02AC004F6CA8 /* Run Flex */, - 7F7B6DE118DE0A6E004F6CA8 /* Run Bison */, - 8D15AC300486D014006FF6A4 /* Sources */, - 8D15AC330486D014006FF6A4 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TikZiT; - productInstallPath = "$(HOME)/Applications"; - productName = TikZiT; - productReference = 8D15AC370486D014006FF6A4 /* TikZiT.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0410; - ORGANIZATIONNAME = "Aleks Kissinger"; - }; - buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "TikZiT" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 2A37F4AAFDCFA73011CA2CEA /* TikZiT */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D15AC270486D014006FF6A4 /* TikZiT */, - 5589AA6411C5429C0064D310 /* tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D15AC2B0486D014006FF6A4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */, - 8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */, - 7F938532184D184700FAED38 /* preamble.png in Resources */, - 1DDD582C0DA1D0D100B32029 /* TikzDocument.xib in Resources */, - 7F938530184D178B00FAED38 /* engine.png in Resources */, - 1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */, - 7FD5D44D18E1CC0B00E2A930 /* customshape.png in Resources */, - 55D945721165904F0044178C /* tikzitdoc.icns in Resources */, - 55D945731165904F0044178C /* tikzit.icns in Resources */, - 556979431168747B007E5703 /* StylePalette.xib in Resources */, - 55D949141165D8870044178C /* draw-ellipse.png in Resources */, - 55D949151165D8870044178C /* draw-path.png in Resources */, - 55D949161165D8870044178C /* select-rectangular.png in Resources */, - 559EFA5711C7D95F00D020F4 /* tikzit_dsa_pub.pem in Resources */, - 7F93852E184D176E00FAED38 /* updates.png in Resources */, - 555B30F911D8BE3300CAECF5 /* emblem-important.png in Resources */, - 55391AF613D324FE007DBE71 /* Preview.xib in Resources */, - 55391AF813D3250F007DBE71 /* Preamble.xib in Resources */, - 5573B92111DA259C00B5DC5D /* text-x-generic.png in Resources */, - 5573B92511DA273400B5DC5D /* format-indent-less.png in Resources */, - 5573B98811DA377C00B5DC5D /* text-x-script.png in Resources */, - 55E5E99E1215C8E300256F69 /* transform-crop-and-resize.png in Resources */, - 55900AE3135FB305002DD28E /* emblem-unreadable-grey.png in Resources */, - 55391B0213D32608007DBE71 /* PropertyInspector.xib in Resources */, - 55397C811449A877006942FB /* ED_arrow.png in Resources */, - 55397C831449A8F1006942FB /* ED_tick.png in Resources */, - 55397C851449A9BF006942FB /* ED_none.png in Resources */, - 55397C8A1449AB91006942FB /* AH_none.png in Resources */, - 55397C8B1449AB91006942FB /* AH_plain_tail.png in Resources */, - 55397C8D1449ABFC006942FB /* AH_latex_tail.png in Resources */, - 7FD5D44B18E1CB5300E2A930 /* CustomNodes.xib in Resources */, - 55397C901449AC7C006942FB /* AH_latex_head.png in Resources */, - 55397C911449AC7C006942FB /* AH_plain_head.png in Resources */, - 7F18A323184C599100BC3081 /* UpdatePreferencePanel.xib in Resources */, - 7F90E88E16DD47540069EBCD /* Preferences.xib in Resources */, - 7F90E89116DD54440069EBCD /* UserDefaults.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 7F7B6DE018DE02AC004F6CA8 /* Run Flex */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/src/common/tikzlexer.lm", - ); - name = "Run Flex"; - outputPaths = ( - "$(DERIVED_SOURCES_DIR)/tikzlexer.m", - "$(DERIVED_SOURCES_DIR)/tikzlexer.h", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cd ${SRCROOT}/src/\nexport INPUT_FILE_BASE=`basename \"${SCRIPT_INPUT_FILE_0}\" .lm`\nflex -o common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.lm\nmv common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.h ${DERIVED_SOURCES_DIR}\n"; - }; - 7F7B6DE118DE0A6E004F6CA8 /* Run Bison */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/src/common/tikzparser.ym", - ); - name = "Run Bison"; - outputPaths = ( - "$(DERIVED_SOURCES_DIR)/tikzparser.m", - "$(DERIVED_SOURCES_DIR)/tikzparser.h", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cd ${SRCROOT}/src/\nexport INPUT_FILE_BASE=`basename \"${SCRIPT_INPUT_FILE_0}\" .ym`\nbison --defines=common/${INPUT_FILE_BASE}.h --output=common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.ym\nmv common/${INPUT_FILE_BASE}.m common/${INPUT_FILE_BASE}.h ${DERIVED_SOURCES_DIR}"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 5589AA6211C5429C0064D310 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5504C84F11D23945002A1478 /* ColorRGB.m in Sources */, - 5589AA8511C543500064D310 /* util.m in Sources */, - 5589AA7211C542E60064D310 /* Edge.m in Sources */, - 5589AA7611C542E60064D310 /* Graph.m in Sources */, - 5589AA7811C542E60064D310 /* GraphChange.m in Sources */, - 5589AA7A11C542E60064D310 /* GraphElementData.m in Sources */, - 5589AA7C11C542E60064D310 /* Node.m in Sources */, - 5589AA8011C542E60064D310 /* NodeStyle.m in Sources */, - 5589AA6C11C542D30064D310 /* TikzGraphAssembler.m in Sources */, - 5589AA6D11C542D30064D310 /* tikzlexer.lm in Sources */, - 7F6E2C8216B008B000BFE20D /* DiamondShape.m in Sources */, - 7F6E2C8316B008B000BFE20D /* CircleShape.m in Sources */, - 7F6E2C8A16B0096000BFE20D /* SupportDir.m in Sources */, - 7F6E2C8416B008B000BFE20D /* RectangleShape.m in Sources */, - 7F6E2C8516B008B000BFE20D /* RegularPolyShape.m in Sources */, - 7F6E2C8616B008B000BFE20D /* TikzShape.m in Sources */, - 7F6E2C8016B0083300BFE20D /* Shape.m in Sources */, - 7F6E2C8116B0084600BFE20D /* Transformer.m in Sources */, - 5589AA6E11C542D30064D310 /* tikzparser.ym in Sources */, - 5504C82E11D23595002A1478 /* common.m in Sources */, - 5504C82F11D23595002A1478 /* parser.m in Sources */, - 5504C83011D23595002A1478 /* test.m in Sources */, - 7F6E2C7F16B0081D00BFE20D /* PropertyHolder.m in Sources */, - 5504C83211D23685002A1478 /* main.m in Sources */, - 5504C93F11D39422002A1478 /* osx.m in Sources */, - 555B313511D8C6DA00CAECF5 /* color.m in Sources */, - 7F6E2C7E16B0080400BFE20D /* GraphElementProperty.m in Sources */, - 7F6E2C7D16B007F000BFE20D /* EdgeStyle.m in Sources */, - 55CA9ACA12F831E5008F0368 /* RColor.m in Sources */, - 552202C4135F15FD007EA086 /* MultiField.m in Sources */, - 55900AA1135FA918002DD28E /* MultiCombo.m in Sources */, - 7F6E2C8916B0091300BFE20D /* maths.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D15AC300486D014006FF6A4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7F7B6DEE18DE0C9E004F6CA8 /* tikzparser.m in Sources */, - 7F7B6DED18DE0C9E004F6CA8 /* tikzlexer.m in Sources */, - 558F18C5117B031C009863B2 /* Edge.m in Sources */, - 558F18C6117B031C009863B2 /* Graph.m in Sources */, - 558F18C7117B031C009863B2 /* GraphChange.m in Sources */, - 7F7B6DF418DE0D7A004F6CA8 /* CustomNodeCellView.m in Sources */, - 558F18C8117B031C009863B2 /* GraphElementData.m in Sources */, - 558F18C9117B031C009863B2 /* Node.m in Sources */, - 558F18CA117B031C009863B2 /* NodeStyle.m in Sources */, - 558F18CE117B03DD009863B2 /* main.m in Sources */, - 558F18CF117B03DD009863B2 /* util.m in Sources */, - 558F18F7117B043C009863B2 /* AppDelegate.m in Sources */, - 558F18F9117B043C009863B2 /* EdgeControlLayer.m in Sources */, - 558F18FA117B043C009863B2 /* GraphicsView.m in Sources */, - 7F73438A184AC559002897D0 /* DraggablePDFView.m in Sources */, - 558F18FB117B043C009863B2 /* Grid.m in Sources */, - 558F18FC117B043C009863B2 /* NodeLayer.m in Sources */, - 558F18FD117B043C009863B2 /* NodeSelectionLayer.m in Sources */, - 558F18FF117B043C009863B2 /* SelectableCollectionViewItem.m in Sources */, - 558F1900117B043C009863B2 /* SelectableNodeView.m in Sources */, - 558F1901117B043C009863B2 /* StylePaletteController.m in Sources */, - 558F1902117B043C009863B2 /* TikzDocument.m in Sources */, - 558F1903117B043C009863B2 /* TikzSourceController.m in Sources */, - 558F1904117B043C009863B2 /* ToolPaletteController.m in Sources */, - 5585E5C2117F681800124513 /* NodeStyle+Coder.m in Sources */, - 55F9585C1181B09600F99434 /* PickSupport.m in Sources */, - 55F9585D1181B09600F99434 /* Transformer.m in Sources */, - 55D2E0B21186ED950060B4EC /* Graph+Coder.m in Sources */, - 5589A9FF11C51E780064D310 /* TikzGraphAssembler.m in Sources */, - 7F7B6DF518DE0D7A004F6CA8 /* CustomNodeController.m in Sources */, - 5589AD4411C633EE0064D310 /* SelectBoxLayer.m in Sources */, - 559EFB6811CB88E300D020F4 /* ColorRGB.m in Sources */, - 5573B8C211D9FD3200B5DC5D /* PreviewController.m in Sources */, - 5573B90F11DA231A00B5DC5D /* PreambleController.m in Sources */, - 5573B92911DA292F00B5DC5D /* Preambles.m in Sources */, - 5573BDCB11DB4D2600B5DC5D /* Preambles+Coder.m in Sources */, - 55F9E04511FF54F000F5659E /* NSString+LatexConstants.m in Sources */, - 55CA997212F08281008F0368 /* TikzWindowController.m in Sources */, - 55CA9AC912F831E5008F0368 /* RColor.m in Sources */, - 552202C5135F15FD007EA086 /* MultiField.m in Sources */, - 55900AA2135FA918002DD28E /* MultiCombo.m in Sources */, - 555ECE9B1378A3AA0052DB71 /* CALayer+DrawLabel.m in Sources */, - 55391B0A13D32765007DBE71 /* PropertyInspectorController.m in Sources */, - 55652DF913E1F2030023F4C6 /* SupportDir.m in Sources */, - 55652E3B13E1FAEE0023F4C6 /* CircleShape.m in Sources */, - 55652E3C13E1FAEE0023F4C6 /* RectangleShape.m in Sources */, - 55652E3D13E1FAEE0023F4C6 /* RegularPolyShape.m in Sources */, - 55652E3E13E1FAEE0023F4C6 /* TikzShape.m in Sources */, - 55652E4113E1FB0A0023F4C6 /* Shape.m in Sources */, - 55432E061444BF2D00401BB3 /* GraphElementProperty.m in Sources */, - 55397C7914498C22006942FB /* EdgeStyle.m in Sources */, - 55397C7C144990EA006942FB /* EdgeStyle+Coder.m in Sources */, - 55397C7F144999C4006942FB /* PropertyHolder.m in Sources */, - 553A4C5A144ED3D500AA6FAC /* NilToEmptyStringTransformer.m in Sources */, - 55598E351635372E0023450A /* DiamondShape.m in Sources */, - 7FEED45716B1A7C500B056CB /* StyleManager.m in Sources */, - 7FB9BFEE16B57C2E00773146 /* TikzFormatter.m in Sources */, - 7F781C1A16B5DE1400239826 /* ParseErrorView.m in Sources */, - 7F90E88616DD29600069EBCD /* NSString+Tikz.m in Sources */, - 7F90E88D16DD47540069EBCD /* PreferenceController.m in Sources */, - 7F18A321184C577000BC3081 /* UpdatePreferenceController.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 5504C91B11D36CD5002A1478 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8D15AC270486D014006FF6A4 /* TikZiT */; - targetProxy = 5504C91A11D36CD5002A1478 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C1660FE840EACC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 1DDD58280DA1D0D100B32029 /* TikzDocument.xib */ = { - isa = PBXVariantGroup; - children = ( - 1DDD58290DA1D0D100B32029 /* English */, - ); - name = TikzDocument.xib; - sourceTree = ""; - }; - 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 1DDD582B0DA1D0D100B32029 /* English */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; - 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = { - isa = PBXVariantGroup; - children = ( - 2A37F4BAFDCFA73011CA2CEA /* English */, - ); - name = Credits.rtf; - sourceTree = ""; - }; - 55391AF513D324FE007DBE71 /* Preview.xib */ = { - isa = PBXVariantGroup; - children = ( - 5573B8BD11D9FCD400B5DC5D /* English */, - ); - name = Preview.xib; - sourceTree = ""; - }; - 55391AF713D3250F007DBE71 /* Preamble.xib */ = { - isa = PBXVariantGroup; - children = ( - 5573B91011DA233E00B5DC5D /* English */, - ); - name = Preamble.xib; - sourceTree = ""; - }; - 55391B0013D32608007DBE71 /* PropertyInspector.xib */ = { - isa = PBXVariantGroup; - children = ( - 55391B0113D32608007DBE71 /* English */, - ); - name = PropertyInspector.xib; - sourceTree = ""; - }; - 556979421168747B007E5703 /* StylePalette.xib */ = { - isa = PBXVariantGroup; - children = ( - 55D947301165A5D40044178C /* English */, - ); - name = StylePalette.xib; - sourceTree = ""; - }; - 7F90E88F16DD54440069EBCD /* UserDefaults.plist */ = { - isa = PBXVariantGroup; - children = ( - 7F90E89016DD54440069EBCD /* English */, - ); - name = UserDefaults.plist; - sourceTree = ""; - }; - 7FD5D44918E1CB5300E2A930 /* CustomNodes.xib */ = { - isa = PBXVariantGroup; - children = ( - 7FD5D44A18E1CB5300E2A930 /* English */, - ); - name = CustomNodes.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 5589AA6711C5429E0064D310 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/Frameworks\"", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PRODUCT_NAME = tests; - SDKROOT = macosx; - }; - name = Debug; - }; - 5589AA6811C5429E0064D310 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/Frameworks\"", - ); - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - INSTALL_PATH = /usr/local/bin; - OTHER_LDFLAGS = ( - "-framework", - Foundation, - "-framework", - AppKit, - ); - PRODUCT_NAME = tests; - SDKROOT = macosx; - ZERO_LINK = NO; - }; - name = Release; - }; - C05733C808A9546B00998B17 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_ENABLE_OBJC_ARC = YES; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - "\"$(SRCROOT)/Frameworks\"", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = TikZiT_Prefix.pch; - INFOPLIST_FILE = "TikZiT-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; - PRODUCT_NAME = TikZiT; - SDKROOT = macosx; - }; - name = Debug; - }; - C05733C908A9546B00998B17 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_ENABLE_OBJC_ARC = YES; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)\"", - "\"$(SRCROOT)/Frameworks\"", - ); - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = TikZiT_Prefix.pch; - INFOPLIST_FILE = "TikZiT-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; - PRODUCT_NAME = TikZiT; - SDKROOT = macosx; - }; - name = Release; - }; - C05733CC08A9546B00998B17 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.5; - ONLY_ACTIVE_ARCH = YES; - PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; - SDKROOT = macosx; - SYMROOT = xbuild; - USER_HEADER_SEARCH_PATHS = "src/osx src/common"; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - C05733CD08A9546B00998B17 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.5; - ONLY_ACTIVE_ARCH = NO; - PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO; - SDKROOT = macosx; - SYMROOT = xbuild; - USER_HEADER_SEARCH_PATHS = "src/osx src/common"; - VALID_ARCHS = "i386 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 5589AA8311C543240064D310 /* Build configuration list for PBXNativeTarget "tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 5589AA6711C5429E0064D310 /* Debug */, - 5589AA6811C5429E0064D310 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "TikZiT" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C05733C808A9546B00998B17 /* Debug */, - C05733C908A9546B00998B17 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "TikZiT" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C05733CC08A9546B00998B17 /* Debug */, - C05733CD08A9546B00998B17 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */; -} diff --git a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 82f3c48..0000000 --- a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcshareddata/TikZiT.xccheckout b/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcshareddata/TikZiT.xccheckout deleted file mode 100644 index c3ec4fe..0000000 --- a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcshareddata/TikZiT.xccheckout +++ /dev/null @@ -1,37 +0,0 @@ - - - - - IDESourceControlProjectFavoriteDictionaryKey - - IDESourceControlProjectIdentifier - 26857C1F-E0FE-4FFB-BDAC-44158C649772 - IDESourceControlProjectOriginsDictionary - - F6FA2C351D428A0F1026539971510A626DEEFF59 - https://github.com/tikzit/tikzit.git - - IDESourceControlProjectRelativeInstallPathDictionary - - F6FA2C351D428A0F1026539971510A626DEEFF59 - TikZiT/ - - IDESourceControlProjectURL - https://github.com/tikzit/tikzit.git - IDESourceControlProjectVersion - 111 - IDESourceControlProjectWCCIdentifier - F6FA2C351D428A0F1026539971510A626DEEFF59 - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - F6FA2C351D428A0F1026539971510A626DEEFF59 - IDESourceControlWCCName - TikZiT - - - - diff --git a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/UserInterfaceState.xcuserstate b/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 99a5997..0000000 --- a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/UserInterfaceState.xcuserstate +++ /dev/null @@ -1,24539 +0,0 @@ - - - - - $archiver - NSKeyedArchiver - $objects - - $null - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 2 - - - CF$UID - 3 - - - CF$UID - 4 - - - CF$UID - 5 - - - NS.objects - - - CF$UID - 6 - - - CF$UID - 194 - - - CF$UID - 441 - - - CF$UID - 533 - - - - 5D4A1A9F-B7F3-4B80-B1F2-42874F168C6C - FCF6616B-37CA-49A5-B7DD-7EC65F973E7D - E8D758DD-8E38-40E4-B712-F6B0919F77C9 - IDEWorkspaceDocument - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 7 - - - CF$UID - 8 - - - CF$UID - 9 - - - CF$UID - 10 - - - CF$UID - 11 - - - CF$UID - 12 - - - CF$UID - 13 - - - CF$UID - 14 - - - NS.objects - - - CF$UID - 15 - - - CF$UID - 192 - - - CF$UID - 193 - - - CF$UID - 25 - - - CF$UID - 2 - - - CF$UID - 7 - - - CF$UID - 25 - - - CF$UID - 25 - - - - IDEWorkspaceTabController_255C042C-F813-417B-AD8A-811609B9E1F2 - IDEWindowFrame - IDEOrderedWorkspaceTabControllers - IDEWindowInFullscreenMode - IDEWorkspaceWindowControllerUniqueIdentifier - IDEActiveWorkspaceTabController - IDEWindowToolbarIsVisible - IDEWindowTabBarIsVisible - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 16 - - - CF$UID - 17 - - - CF$UID - 18 - - - CF$UID - 19 - - - CF$UID - 20 - - - CF$UID - 21 - - - CF$UID - 22 - - - CF$UID - 23 - - - NS.objects - - - CF$UID - 24 - - - CF$UID - 25 - - - CF$UID - 26 - - - CF$UID - 27 - - - CF$UID - 40 - - - CF$UID - 78 - - - CF$UID - 25 - - - CF$UID - 87 - - - - IDETabLabel - IDEShowNavigator - AssistantEditorsLayout - IDEWorkspaceTabControllerUtilityAreaSplitView - IDENavigatorArea - IDEWorkspaceTabControllerDesignAreaSplitView - IDEShowUtilities - IDEEditorArea - Graph.m - - 0 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 29 - - - - DVTSplitViewItems - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 30 - - - CF$UID - 36 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 33 - - - CF$UID - 34 - - - - DVTIdentifier - DVTViewMagnitude - - 127 - - $classes - - NSDictionary - NSObject - - $classname - NSDictionary - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 33 - - - CF$UID - 37 - - - - 473 - - $classes - - NSMutableArray - NSArray - NSObject - - $classname - NSMutableArray - - - $classes - - NSMutableDictionary - NSDictionary - NSObject - - $classname - NSMutableDictionary - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 41 - - - CF$UID - 42 - - - NS.objects - - - CF$UID - 42 - - - CF$UID - 43 - - - - SelectedNavigator - Xcode.IDEKit.Navigator.Structure - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 44 - - - CF$UID - 45 - - - CF$UID - 46 - - - CF$UID - 47 - - - CF$UID - 48 - - - CF$UID - 49 - - - CF$UID - 50 - - - NS.objects - - - CF$UID - 51 - - - CF$UID - 25 - - - CF$UID - 52 - - - CF$UID - 25 - - - CF$UID - 25 - - - CF$UID - 54 - - - CF$UID - 61 - - - - IDEVisibleRect - IDEUnsavedDocumentFilteringEnabled - IDENavigatorExpandedItemsBeforeFilteringSet - IDERecentDocumentFilteringEnabled - IDESCMStatusFilteringEnabled - IDESelectedObjects - IDEExpandedItemsSet - {{0, 0}, {0, 0}} - - $class - - CF$UID - 53 - - NS.objects - - - - $classes - - NSSet - NSObject - - $classname - NSSet - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 55 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 57 - - - CF$UID - 58 - - - CF$UID - 59 - - - - TikZiT - TikZiT - Graph - Graph.m - - $classes - - NSArray - NSObject - - $classname - NSArray - - - $class - - CF$UID - 53 - - NS.objects - - - CF$UID - 62 - - - CF$UID - 63 - - - CF$UID - 65 - - - CF$UID - 66 - - - CF$UID - 68 - - - CF$UID - 72 - - - CF$UID - 73 - - - CF$UID - 75 - - - CF$UID - 76 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 64 - - - - Resources - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 57 - - - CF$UID - 58 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 57 - - - CF$UID - 67 - - - - Parser - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 69 - - - CF$UID - 70 - - - CF$UID - 71 - - - - Frameworks - Linked Frameworks - SFBInspectors.framework - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 69 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 64 - - - CF$UID - 74 - - - - shapes - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 69 - - - CF$UID - 70 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 56 - - - CF$UID - 77 - - - - Other Sources - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 79 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 80 - - - CF$UID - 82 - - - CF$UID - 84 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 20 - - - CF$UID - 81 - - - - 225 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 23 - - - CF$UID - 83 - - - - 815 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 85 - - - CF$UID - 86 - - - - IDEUtilitiesArea - 260 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 88 - - - CF$UID - 89 - - - CF$UID - 90 - - - CF$UID - 91 - - - CF$UID - 92 - - - CF$UID - 93 - - - CF$UID - 94 - - - CF$UID - 95 - - - NS.objects - - - CF$UID - 96 - - - CF$UID - 116 - - - CF$UID - 156 - - - CF$UID - 182 - - - CF$UID - 26 - - - CF$UID - 183 - - - CF$UID - 191 - - - CF$UID - 25 - - - - layoutTree - IDEEditorMode_Standard - IDEEDitorArea_DebugArea - IDEShowEditor - EditorMode - DebuggerSplitView - DefaultPersistentRepresentations - ShowDebuggerArea - - $class - - CF$UID - 115 - - geniusEditorContextNode - - CF$UID - 0 - - primaryEditorContextNode - - CF$UID - 97 - - rootLayoutTreeNode - - CF$UID - 112 - - - - $class - - CF$UID - 114 - - children - - CF$UID - 0 - - contentType - 1 - documentArchivableRepresentation - - CF$UID - 98 - - orientation - 0 - parent - - CF$UID - 112 - - - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 107 - - DomainIdentifier - - CF$UID - 99 - - IdentifierPath - - CF$UID - 100 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - Xcode.IDENavigableItemDomain.WorkspaceStructure - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 101 - - - CF$UID - 103 - - - CF$UID - 104 - - - CF$UID - 105 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 59 - - - - $classes - - IDEArchivableStringIndexPair - NSObject - - $classname - IDEArchivableStringIndexPair - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 58 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 57 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 106 - - - TikZiT - - $class - - CF$UID - 110 - - documentURL - - CF$UID - 108 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Graph.m - - - $classes - - NSMutableString - NSString - NSObject - - $classname - NSMutableString - - - $classes - - DVTDocumentLocation - NSObject - - $classname - DVTDocumentLocation - - - $classes - - IDENavigableItemArchivableRepresentation - NSObject - - $classname - IDENavigableItemArchivableRepresentation - - - $class - - CF$UID - 114 - - children - - CF$UID - 113 - - contentType - 0 - documentArchivableRepresentation - - CF$UID - 0 - - orientation - 0 - parent - - CF$UID - 0 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 97 - - - - - $classes - - IDEWorkspaceTabControllerLayoutTreeNode - NSObject - - $classname - IDEWorkspaceTabControllerLayoutTreeNode - - - $classes - - IDEWorkspaceTabControllerLayoutTree - NSObject - - $classname - IDEWorkspaceTabControllerLayoutTree - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 117 - - - NS.objects - - - CF$UID - 118 - - - - EditorLayout_PersistentRepresentation - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 119 - - - NS.objects - - - CF$UID - 120 - - - - Main - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 121 - - - CF$UID - 122 - - - CF$UID - 123 - - - NS.objects - - - CF$UID - 124 - - - CF$UID - 26 - - - CF$UID - 154 - - - - EditorLayout_StateSavingStateDictionaries - EditorLayout_Selected - EditorLayout_Geometry - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 125 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 126 - - - CF$UID - 127 - - - CF$UID - 128 - - - CF$UID - 129 - - - CF$UID - 130 - - - CF$UID - 131 - - - CF$UID - 132 - - - NS.objects - - - CF$UID - 133 - - - CF$UID - 134 - - - CF$UID - 141 - - - CF$UID - 149 - - - CF$UID - 59 - - - CF$UID - 150 - - - CF$UID - 151 - - - - FileDataType - ArchivableRepresentation - EditorState - NavigableItemName - DocumentNavigableItemName - DocumentExtensionIdentifier - DocumentURL - public.objective-c-source - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 107 - - DomainIdentifier - - CF$UID - 99 - - IdentifierPath - - CF$UID - 135 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 136 - - - CF$UID - 137 - - - CF$UID - 138 - - - CF$UID - 139 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 59 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 58 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 57 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 140 - - - TikZiT - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 146 - - - CF$UID - 147 - - - CF$UID - 25 - - - CF$UID - 148 - - - - PrimaryDocumentTimestamp - PrimaryDocumentVisibleCharacterRange - HideAllIssues - PrimaryDocumentSelectedCharacterRange - 381083683.77450001 - {18089, 1176} - {19467, 0} - -tikz - Xcode.IDEKit.EditorDocument.SourceCode - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 152 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Graph.m - - $classes - - NSURL - NSObject - - $classname - NSURL - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 155 - - - - {{0, 0}, {600, 600}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 157 - - - CF$UID - 158 - - - CF$UID - 159 - - - CF$UID - 160 - - - CF$UID - 161 - - - CF$UID - 162 - - - NS.objects - - - CF$UID - 163 - - - CF$UID - 164 - - - CF$UID - 166 - - - CF$UID - 163 - - - CF$UID - 168 - - - CF$UID - 176 - - - - LayoutFocusMode - console - variables - LayoutMode - IDEDebugArea_SplitView - IDEDebuggerAreaSplitView - 1 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 165 - - - NS.objects - - - CF$UID - 26 - - - - ConsoleFilterMode - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 167 - - - NS.objects - - - CF$UID - 163 - - - - VariablesViewSelectedScope - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 169 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 170 - - - CF$UID - 173 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 171 - - - CF$UID - 172 - - - - VariablesView - 301 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 174 - - - CF$UID - 175 - - - - ConsoleArea - 298 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 177 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 178 - - - CF$UID - 180 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 171 - - - CF$UID - 179 - - - - 301 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 174 - - - CF$UID - 181 - - - - 298 - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 184 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 185 - - - CF$UID - 188 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 186 - - - CF$UID - 187 - - - - IDEEditor - 203 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 189 - - - CF$UID - 190 - - - - IDEDebuggerArea - 115 - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - {{264, 446}, {600, 624}} - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 7 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 8 - - - CF$UID - 9 - - - CF$UID - 195 - - - CF$UID - 10 - - - CF$UID - 196 - - - CF$UID - 12 - - - CF$UID - 13 - - - CF$UID - 14 - - - NS.objects - - - CF$UID - 197 - - - CF$UID - 198 - - - CF$UID - 199 - - - CF$UID - 25 - - - CF$UID - 3 - - - CF$UID - 195 - - - CF$UID - 182 - - - CF$UID - 25 - - - - IDEWorkspaceTabController_9038AF6D-AD9C-4682-ADF8-6CB1A302CFE7 - IDEWorkspaceWindowControllerUniqueIdentifier - {{447, 347}, {1300, 786}} - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 195 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 18 - - - CF$UID - 17 - - - CF$UID - 16 - - - CF$UID - 19 - - - CF$UID - 20 - - - CF$UID - 21 - - - CF$UID - 22 - - - CF$UID - 23 - - - NS.objects - - - CF$UID - 26 - - - CF$UID - 182 - - - CF$UID - 200 - - - CF$UID - 201 - - - CF$UID - 207 - - - CF$UID - 281 - - - CF$UID - 182 - - - CF$UID - 289 - - - - Graph.m - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 202 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 203 - - - CF$UID - 205 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 33 - - - CF$UID - 204 - - - - 403 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 33 - - - CF$UID - 206 - - - - 307 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 208 - - - CF$UID - 41 - - - CF$UID - 209 - - - CF$UID - 210 - - - CF$UID - 211 - - - CF$UID - 42 - - - CF$UID - 212 - - - NS.objects - - - CF$UID - 213 - - - CF$UID - 42 - - - CF$UID - 224 - - - CF$UID - 241 - - - CF$UID - 247 - - - CF$UID - 258 - - - CF$UID - 273 - - - - Xcode.IDEKit.Navigator.Symbol - Xcode.IDEKit.Navigator.Issues - Xcode.IDEKit.Navigator.Debug - Xcode.IDEKit.Navigator.Breakpoints - Xcode.IDEKit.Navigator.Logs - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 214 - - - CF$UID - 215 - - - CF$UID - 216 - - - CF$UID - 217 - - - CF$UID - 218 - - - CF$UID - 219 - - - CF$UID - 220 - - - NS.objects - - - CF$UID - 182 - - - CF$UID - 182 - - - CF$UID - 25 - - - CF$UID - 182 - - - CF$UID - 221 - - - CF$UID - 222 - - - CF$UID - 223 - - - - IDESymbolNavigatorShowWorkspaceOnly - IDESymbolNavigatorShowHierarchy - IDESymbolNavigatorShowContainersOnly - IDESymbolNavigatorShowClassesOnly - IDESymbolNamePatternString - IDESymbolNavigatorSelectedSymbols - IDEExpandedItems - - - $class - - CF$UID - 38 - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 225 - - - CF$UID - 226 - - - CF$UID - 227 - - - CF$UID - 228 - - - CF$UID - 229 - - - CF$UID - 230 - - - CF$UID - 231 - - - CF$UID - 232 - - - CF$UID - 233 - - - NS.objects - - - CF$UID - 25 - - - CF$UID - 234 - - - CF$UID - 235 - - - CF$UID - 237 - - - CF$UID - 238 - - - CF$UID - 25 - - - CF$UID - 239 - - - CF$UID - 25 - - - CF$UID - 240 - - - - IDEErrorFilteringEnabled - IDEVisibleRect - IDECollapsedFiles - IDEExpandedIssues - IDESelectedNavigables - IDEShowsByType - IDECollapsedTypes - IDERecentFilteringEnabled - IDECollapsedGroups - {{0, 0}, {209, 644}} - - $class - - CF$UID - 236 - - NS.objects - - - - $classes - - NSMutableSet - NSSet - NSObject - - $classname - NSMutableSet - - - $class - - CF$UID - 236 - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - - $class - - CF$UID - 236 - - NS.objects - - - - $class - - CF$UID - 236 - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 242 - - - CF$UID - 243 - - - CF$UID - 244 - - - NS.objects - - - CF$UID - 245 - - - CF$UID - 246 - - - CF$UID - 25 - - - - IDEStackCompressionValue - IDEThreadOrQueueMode - IDEShowOnlyInterestingContent - 2 - 0 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 248 - - - CF$UID - 249 - - - CF$UID - 250 - - - CF$UID - 251 - - - NS.objects - - - CF$UID - 52 - - - CF$UID - 25 - - - CF$UID - 252 - - - CF$UID - 257 - - - - IDECollapsedtemsSet - IDEBreakpointNavigatorFilterOnEnabled - IDESelectedObjects - IDEVisibleRect - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 253 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 254 - - - CF$UID - 255 - - - CF$UID - 256 - - - - TikZiT - SelectableNodeView.m - -setNodeStyle: - {{0, 0}, {224, 686}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 44 - - - CF$UID - 45 - - - CF$UID - 46 - - - CF$UID - 47 - - - CF$UID - 48 - - - CF$UID - 49 - - - CF$UID - 50 - - - NS.objects - - - CF$UID - 259 - - - CF$UID - 25 - - - CF$UID - 52 - - - CF$UID - 25 - - - CF$UID - 25 - - - CF$UID - 260 - - - CF$UID - 263 - - - - {{0, 0}, {209, 666}} - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 261 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 57 - - - CF$UID - 58 - - - CF$UID - 59 - - - - TikZiT - - $class - - CF$UID - 53 - - NS.objects - - - CF$UID - 264 - - - CF$UID - 265 - - - CF$UID - 266 - - - CF$UID - 267 - - - CF$UID - 268 - - - CF$UID - 269 - - - CF$UID - 270 - - - CF$UID - 271 - - - CF$UID - 272 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 64 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 57 - - - CF$UID - 67 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 69 - - - CF$UID - 70 - - - CF$UID - 71 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 64 - - - CF$UID - 74 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 69 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 77 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 57 - - - CF$UID - 58 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 262 - - - CF$UID - 69 - - - CF$UID - 70 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 274 - - - CF$UID - 275 - - - CF$UID - 276 - - - CF$UID - 277 - - - NS.objects - - - CF$UID - 278 - - - CF$UID - 279 - - - CF$UID - 25 - - - CF$UID - 280 - - - - IDELogNavigatorExpandedItemsStateKey - IDELogNavigatorSelectedObjectsStateKey - IDELogNavigatorRecentFilterStateKey - IDELogNavigatorVisibleRectStateKey - - $class - - CF$UID - 38 - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - {{0, 0}, {464, 738}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 282 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 283 - - - CF$UID - 285 - - - CF$UID - 287 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 20 - - - CF$UID - 284 - - - - 225 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 23 - - - CF$UID - 286 - - - - 815 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 85 - - - CF$UID - 288 - - - - 260 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 95 - - - CF$UID - 89 - - - CF$UID - 90 - - - CF$UID - 91 - - - CF$UID - 92 - - - CF$UID - 290 - - - CF$UID - 93 - - - CF$UID - 94 - - - CF$UID - 291 - - - CF$UID - 88 - - - NS.objects - - - CF$UID - 182 - - - CF$UID - 292 - - - CF$UID - 314 - - - CF$UID - 182 - - - CF$UID - 26 - - - CF$UID - 329 - - - CF$UID - 368 - - - CF$UID - 374 - - - CF$UID - 375 - - - CF$UID - 430 - - - - IDEEditorMode_Version - IDEEditorMode_Genius - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 117 - - - NS.objects - - - CF$UID - 293 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 119 - - - NS.objects - - - CF$UID - 294 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 121 - - - CF$UID - 122 - - - CF$UID - 123 - - - NS.objects - - - CF$UID - 295 - - - CF$UID - 26 - - - CF$UID - 312 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 296 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 126 - - - CF$UID - 127 - - - CF$UID - 128 - - - CF$UID - 129 - - - CF$UID - 130 - - - CF$UID - 131 - - - CF$UID - 132 - - - NS.objects - - - CF$UID - 133 - - - CF$UID - 297 - - - CF$UID - 306 - - - CF$UID - 149 - - - CF$UID - 59 - - - CF$UID - 150 - - - CF$UID - 310 - - - - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 305 - - DomainIdentifier - - CF$UID - 298 - - IdentifierPath - - CF$UID - 299 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - Xcode.IDENavigableItemDomain.WorkspaceStructure - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 300 - - - CF$UID - 301 - - - CF$UID - 302 - - - CF$UID - 303 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 59 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 58 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 57 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 304 - - - TikZiT - - $class - - CF$UID - 110 - - documentURL - - CF$UID - 108 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 307 - - - CF$UID - 308 - - - CF$UID - 25 - - - CF$UID - 309 - - - - 381083686.29558802 - {18344, 1251} - {19467, 0} - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 311 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Graph.m - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 313 - - - - {{0, 0}, {815, 588}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 157 - - - CF$UID - 158 - - - CF$UID - 161 - - - CF$UID - 160 - - - CF$UID - 162 - - - CF$UID - 159 - - - NS.objects - - - CF$UID - 163 - - - CF$UID - 315 - - - CF$UID - 316 - - - CF$UID - 163 - - - CF$UID - 322 - - - CF$UID - 328 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 165 - - - NS.objects - - - CF$UID - 26 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 317 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 318 - - - CF$UID - 320 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 171 - - - CF$UID - 319 - - - - 389 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 174 - - - CF$UID - 321 - - - - 425 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 323 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 324 - - - CF$UID - 326 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 171 - - - CF$UID - 325 - - - - 389 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 174 - - - CF$UID - 327 - - - - 425 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 167 - - - NS.objects - - - CF$UID - 26 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 330 - - - CF$UID - 331 - - - NS.objects - - - CF$UID - 246 - - - CF$UID - 332 - - - - VersionsEditorSubmode - EditorLayout_PersistentRepresentation - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 333 - - - NS.objects - - - CF$UID - 334 - - - - Main - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 335 - - - CF$UID - 336 - - - CF$UID - 337 - - - NS.objects - - - CF$UID - 338 - - - CF$UID - 246 - - - CF$UID - 366 - - - - EditorLayout_StateSavingStateDictionaries - EditorLayout_Selected - EditorLayout_Geometry - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 339 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 340 - - - CF$UID - 341 - - - CF$UID - 342 - - - CF$UID - 343 - - - CF$UID - 344 - - - CF$UID - 345 - - - CF$UID - 346 - - - NS.objects - - - CF$UID - 347 - - - CF$UID - 348 - - - CF$UID - 356 - - - CF$UID - 351 - - - CF$UID - 351 - - - CF$UID - 363 - - - CF$UID - 364 - - - - FileDataType - ArchivableRepresentation - EditorState - NavigableItemName - DocumentNavigableItemName - DocumentExtensionIdentifier - DocumentURL - com.apple.xml-property-list - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 354 - - DomainIdentifier - - CF$UID - 298 - - IdentifierPath - - CF$UID - 349 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 350 - - - CF$UID - 352 - - - CF$UID - 353 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 351 - - - TikZiT-Info.plist - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 64 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 254 - - - - $class - - CF$UID - 110 - - documentURL - - CF$UID - 355 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT-Info.plist - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 357 - - - CF$UID - 358 - - - CF$UID - 359 - - - NS.objects - - - CF$UID - 360 - - - CF$UID - 361 - - - CF$UID - 362 - - - - PrimaryDocumentSelectedCharacterRange - PrimaryDocumentVisibleCharacterRange - PrimaryDocumentTimestamp - {0, 0} - {0, 1053} - 348502952.18491101 - Xcode.IDEKit.EditorDocument.SourceCode-from-Plist - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 365 - - - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT-Info.plist - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 367 - - - - {{0, 0}, {815, 602}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 369 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 370 - - - CF$UID - 372 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 186 - - - CF$UID - 371 - - - - 610 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 189 - - - CF$UID - 373 - - - - 100 - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 376 - - - CF$UID - 331 - - - NS.objects - - - CF$UID - 377 - - - CF$UID - 378 - - - - SplitPosition - 0.4993864893913269 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 379 - - - CF$UID - 333 - - - NS.objects - - - CF$UID - 380 - - - CF$UID - 409 - - - - Alternate - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 335 - - - CF$UID - 336 - - - CF$UID - 337 - - - NS.objects - - - CF$UID - 381 - - - CF$UID - 246 - - - CF$UID - 407 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 382 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 340 - - - CF$UID - 341 - - - CF$UID - 342 - - - CF$UID - 343 - - - CF$UID - 344 - - - CF$UID - 345 - - - CF$UID - 346 - - - NS.objects - - - CF$UID - 383 - - - CF$UID - 384 - - - CF$UID - 399 - - - CF$UID - 387 - - - CF$UID - 387 - - - CF$UID - 404 - - - CF$UID - 405 - - - - public.c-header - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 397 - - DomainIdentifier - - CF$UID - 0 - - IdentifierPath - - CF$UID - 385 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 386 - - - CF$UID - 388 - - - CF$UID - 390 - - - CF$UID - 391 - - - CF$UID - 394 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 387 - - - Graph.h - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 389 - - - Graph - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 254 - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 392 - - - CF$UID - 393 - - - NS.objects - - - CF$UID - 298 - - - CF$UID - 254 - - - - manualDomainIdentifier - navigableItem_name - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 395 - - - NS.objects - - - CF$UID - 396 - - - - identifier - Xcode.IDEKit.GeniusCategory.Manual - - $class - - CF$UID - 110 - - documentURL - - CF$UID - 398 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Graph.h - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 401 - - - CF$UID - 402 - - - CF$UID - 25 - - - CF$UID - 403 - - - - HideAllIssues - 348502936.56562501 - {1735, 943} - {998, 0} - Xcode.IDEKit.EditorDocument.SourceCode - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 406 - - - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Graph.h - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 408 - - - - {{0, 0}, {407, 602}} - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 335 - - - CF$UID - 336 - - - CF$UID - 337 - - - NS.objects - - - CF$UID - 410 - - - CF$UID - 246 - - - CF$UID - 429 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 411 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 340 - - - CF$UID - 341 - - - CF$UID - 342 - - - CF$UID - 343 - - - CF$UID - 344 - - - CF$UID - 345 - - - CF$UID - 346 - - - NS.objects - - - CF$UID - 347 - - - CF$UID - 412 - - - CF$UID - 419 - - - CF$UID - 351 - - - CF$UID - 351 - - - CF$UID - 427 - - - CF$UID - 428 - - - - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 417 - - DomainIdentifier - - CF$UID - 298 - - IdentifierPath - - CF$UID - 413 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 414 - - - CF$UID - 415 - - - CF$UID - 416 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 351 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 64 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 254 - - - - $class - - CF$UID - 110 - - documentURL - - CF$UID - 418 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT-Info.plist - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 420 - - - CF$UID - 421 - - - CF$UID - 422 - - - NS.objects - - - CF$UID - 423 - - - CF$UID - 425 - - - CF$UID - 426 - - - - IDE_PLIST_EDITOR_SELECTION_KEY - IDE_PLIST_EDITOR_EXPANSION_KEY - IDE_PLIST_EDITOR_VISIBLERECT_KEY - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 424 - - - - CFBundleVersion - - $class - - CF$UID - 236 - - NS.objects - - - {{0, 0}, {407, 563}} - Xcode.IDEKit.EditorDocument.PlistEditor - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 365 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 367 - - - - - $class - - CF$UID - 115 - - geniusEditorContextNode - - CF$UID - 0 - - primaryEditorContextNode - - CF$UID - 431 - - rootLayoutTreeNode - - CF$UID - 439 - - - - $class - - CF$UID - 114 - - children - - CF$UID - 0 - - contentType - 1 - documentArchivableRepresentation - - CF$UID - 432 - - orientation - 0 - parent - - CF$UID - 439 - - - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 305 - - DomainIdentifier - - CF$UID - 298 - - IdentifierPath - - CF$UID - 433 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 434 - - - CF$UID - 435 - - - CF$UID - 436 - - - CF$UID - 437 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 59 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 58 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 57 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 438 - - - TikZiT - - $class - - CF$UID - 114 - - children - - CF$UID - 440 - - contentType - 0 - documentArchivableRepresentation - - CF$UID - 0 - - orientation - 0 - parent - - CF$UID - 0 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 431 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 8 - - - CF$UID - 9 - - - CF$UID - 442 - - - CF$UID - 10 - - - CF$UID - 11 - - - CF$UID - 12 - - - CF$UID - 13 - - - CF$UID - 14 - - - NS.objects - - - CF$UID - 443 - - - CF$UID - 444 - - - CF$UID - 445 - - - CF$UID - 25 - - - CF$UID - 4 - - - CF$UID - 442 - - - CF$UID - 25 - - - CF$UID - 25 - - - - IDEWorkspaceTabController_5BA15B20-6E8C-4183-8118-E8E43B2873EF - {{264, 446}, {600, 624}} - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 442 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 16 - - - CF$UID - 17 - - - CF$UID - 18 - - - CF$UID - 19 - - - CF$UID - 20 - - - CF$UID - 21 - - - CF$UID - 22 - - - CF$UID - 23 - - - NS.objects - - - CF$UID - 446 - - - CF$UID - 25 - - - CF$UID - 26 - - - CF$UID - 447 - - - CF$UID - 453 - - - CF$UID - 469 - - - CF$UID - 25 - - - CF$UID - 477 - - - - tikzparser.ym - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 448 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 449 - - - CF$UID - 451 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 33 - - - CF$UID - 450 - - - - 127 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 33 - - - CF$UID - 452 - - - - 473 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 41 - - - CF$UID - 42 - - - NS.objects - - - CF$UID - 42 - - - CF$UID - 454 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 44 - - - CF$UID - 45 - - - CF$UID - 46 - - - CF$UID - 47 - - - CF$UID - 48 - - - CF$UID - 49 - - - CF$UID - 50 - - - NS.objects - - - CF$UID - 455 - - - CF$UID - 25 - - - CF$UID - 52 - - - CF$UID - 25 - - - CF$UID - 25 - - - CF$UID - 456 - - - CF$UID - 460 - - - - {{0, 0}, {0, 0}} - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 457 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 57 - - - CF$UID - 67 - - - CF$UID - 459 - - - - TikZiT - tikzparser.ym - - $class - - CF$UID - 53 - - NS.objects - - - CF$UID - 461 - - - CF$UID - 462 - - - CF$UID - 463 - - - CF$UID - 464 - - - CF$UID - 465 - - - CF$UID - 466 - - - CF$UID - 467 - - - CF$UID - 468 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 64 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 57 - - - CF$UID - 67 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 77 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 69 - - - CF$UID - 70 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 69 - - - CF$UID - 70 - - - CF$UID - 71 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 69 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 458 - - - CF$UID - 64 - - - CF$UID - 74 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 470 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 471 - - - CF$UID - 473 - - - CF$UID - 475 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 20 - - - CF$UID - 472 - - - - 225 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 23 - - - CF$UID - 474 - - - - 815 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 85 - - - CF$UID - 476 - - - - 260 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 88 - - - CF$UID - 89 - - - CF$UID - 90 - - - CF$UID - 91 - - - CF$UID - 92 - - - CF$UID - 93 - - - CF$UID - 94 - - - CF$UID - 95 - - - NS.objects - - - CF$UID - 478 - - - CF$UID - 491 - - - CF$UID - 511 - - - CF$UID - 182 - - - CF$UID - 26 - - - CF$UID - 526 - - - CF$UID - 532 - - - CF$UID - 25 - - - - - $class - - CF$UID - 115 - - geniusEditorContextNode - - CF$UID - 0 - - primaryEditorContextNode - - CF$UID - 479 - - rootLayoutTreeNode - - CF$UID - 489 - - - - $class - - CF$UID - 114 - - children - - CF$UID - 0 - - contentType - 1 - documentArchivableRepresentation - - CF$UID - 480 - - orientation - 0 - parent - - CF$UID - 489 - - - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 487 - - DomainIdentifier - - CF$UID - 99 - - IdentifierPath - - CF$UID - 481 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 482 - - - CF$UID - 483 - - - CF$UID - 484 - - - CF$UID - 485 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 459 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 67 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 57 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 486 - - - TikZiT - - $class - - CF$UID - 110 - - documentURL - - CF$UID - 488 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/tikzparser.ym - - - $class - - CF$UID - 114 - - children - - CF$UID - 490 - - contentType - 0 - documentArchivableRepresentation - - CF$UID - 0 - - orientation - 0 - parent - - CF$UID - 0 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 479 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 117 - - - NS.objects - - - CF$UID - 492 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 119 - - - NS.objects - - - CF$UID - 493 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 121 - - - CF$UID - 122 - - - CF$UID - 123 - - - NS.objects - - - CF$UID - 494 - - - CF$UID - 26 - - - CF$UID - 509 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 495 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 126 - - - CF$UID - 127 - - - CF$UID - 128 - - - CF$UID - 129 - - - CF$UID - 130 - - - CF$UID - 131 - - - CF$UID - 132 - - - NS.objects - - - CF$UID - 496 - - - CF$UID - 497 - - - CF$UID - 504 - - - CF$UID - 459 - - - CF$UID - 459 - - - CF$UID - 150 - - - CF$UID - 507 - - - - public.yacc-source - - $class - - CF$UID - 111 - - DocumentLocation - - CF$UID - 487 - - DomainIdentifier - - CF$UID - 99 - - IdentifierPath - - CF$UID - 498 - - IndexOfDocumentIdentifier - - CF$UID - 26 - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 499 - - - CF$UID - 500 - - - CF$UID - 501 - - - CF$UID - 502 - - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 459 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 67 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 57 - - - - $class - - CF$UID - 102 - - Identifier - - CF$UID - 503 - - - TikZiT - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 505 - - - CF$UID - 506 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 381079264.11013299 - {1063, 652} - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 508 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/tikzparser.ym - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 510 - - - - {{0, 0}, {600, 600}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 157 - - - CF$UID - 158 - - - CF$UID - 159 - - - CF$UID - 160 - - - CF$UID - 161 - - - CF$UID - 162 - - - NS.objects - - - CF$UID - 163 - - - CF$UID - 512 - - - CF$UID - 513 - - - CF$UID - 163 - - - CF$UID - 514 - - - CF$UID - 520 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 165 - - - NS.objects - - - CF$UID - 26 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 167 - - - NS.objects - - - CF$UID - 163 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 515 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 516 - - - CF$UID - 518 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 171 - - - CF$UID - 517 - - - - 301 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 174 - - - CF$UID - 519 - - - - 298 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 521 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 522 - - - CF$UID - 524 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 171 - - - CF$UID - 523 - - - - 301 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 174 - - - CF$UID - 525 - - - - 298 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 28 - - - NS.objects - - - CF$UID - 527 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 528 - - - CF$UID - 530 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 186 - - - CF$UID - 529 - - - - 203 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 31 - - - CF$UID - 32 - - - NS.objects - - - CF$UID - 189 - - - CF$UID - 531 - - - - 115 - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 534 - - - CF$UID - 535 - - - CF$UID - 536 - - - CF$UID - 537 - - - CF$UID - 538 - - - CF$UID - 539 - - - CF$UID - 540 - - - CF$UID - 541 - - - CF$UID - 542 - - - CF$UID - 543 - - - CF$UID - 544 - - - NS.objects - - - CF$UID - 182 - - - CF$UID - 545 - - - CF$UID - 26 - - - CF$UID - 1624 - - - CF$UID - 1629 - - - CF$UID - 1632 - - - CF$UID - 1662 - - - CF$UID - 1663 - - - CF$UID - 1758 - - - CF$UID - 25 - - - CF$UID - 25 - - - - BreakpointsActivated - DefaultEditorStatesForURLs - DebuggingWindowBehavior - ActiveRunDestination - ActiveScheme - LastCompletedPersistentSchemeBasedActivityReport - DocumentWindows - DefaultEditorFrameSizeForURLs - RecentEditorDocumentURLs - AppFocusInMiniDebugging - MiniDebuggingConsole - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 546 - - - CF$UID - 427 - - - CF$UID - 547 - - - CF$UID - 404 - - - CF$UID - 548 - - - CF$UID - 549 - - - CF$UID - 363 - - - CF$UID - 550 - - - CF$UID - 551 - - - NS.objects - - - CF$UID - 552 - - - CF$UID - 576 - - - CF$UID - 596 - - - CF$UID - 713 - - - CF$UID - 1449 - - - CF$UID - 1466 - - - CF$UID - 1472 - - - CF$UID - 1475 - - - CF$UID - 1585 - - - - IDEQuickLookEditor.Editor - Xcode.IDEKit.CocoaIntegration.EditorDocument.Cocoa - Xcode.IDEKit.EditorDocument.SourceCodeComparisonEditor - Xcode.IDEKit.EditorDocument.SourceCode-from-NIB - Xcode.Xcode3ProjectSupport.EditorDocument.Xcode3Project - Xcode.IDEKit.EditorDocument.LogDocument - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 553 - - - CF$UID - 555 - - - CF$UID - 557 - - - NS.objects - - - CF$UID - 559 - - - CF$UID - 566 - - - CF$UID - 571 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 554 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/AH_latex_tail - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 556 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/AH_latex_head.png - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 558 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/ED_none.png - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 561 - - - - SelectedDocumentLocations - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 562 - - - - - $class - - CF$UID - 565 - - IDEQuickLookPageNumber - - CF$UID - 26 - - documentURL - - CF$UID - 563 - - timestamp - - CF$UID - 564 - - - file://localhost/Users/aleks/svn/tikzit/AH_latex_tail - 340372422.96159899 - - $classes - - IDEQuickLookDocumentLocation - DVTDocumentLocation - NSObject - - $classname - IDEQuickLookDocumentLocation - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 567 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 568 - - - - - $class - - CF$UID - 565 - - IDEQuickLookPageNumber - - CF$UID - 26 - - documentURL - - CF$UID - 569 - - timestamp - - CF$UID - 570 - - - file://localhost/Users/aleks/svn/tikzit/AH_latex_head.png - 340372923.18815899 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 572 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 573 - - - - - $class - - CF$UID - 565 - - IDEQuickLookPageNumber - - CF$UID - 26 - - documentURL - - CF$UID - 574 - - timestamp - - CF$UID - 575 - - - file://localhost/Users/aleks/svn/tikzit/ED_none.png - 340371928.114389 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 577 - - - CF$UID - 579 - - - CF$UID - 581 - - - NS.objects - - - CF$UID - 583 - - - CF$UID - 587 - - - CF$UID - 592 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 578 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/TikZiT-Info.plist - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 580 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT-Info.plist - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 582 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/TikZiT-Info.plist - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 420 - - - CF$UID - 421 - - - CF$UID - 422 - - - NS.objects - - - CF$UID - 584 - - - CF$UID - 585 - - - CF$UID - 586 - - - - - $class - - CF$UID - 60 - - NS.objects - - - - $class - - CF$UID - 236 - - NS.objects - - - {{0, 0}, {743, 502}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 420 - - - CF$UID - 422 - - - CF$UID - 421 - - - NS.objects - - - CF$UID - 588 - - - CF$UID - 590 - - - CF$UID - 591 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 589 - - - - CFBundleIconFile - {{0, 0}, {815, 552}} - - $class - - CF$UID - 236 - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 420 - - - CF$UID - 421 - - - CF$UID - 422 - - - NS.objects - - - CF$UID - 593 - - - CF$UID - 594 - - - CF$UID - 595 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 589 - - - - - $class - - CF$UID - 236 - - NS.objects - - - {{0, 0}, {815, 550}} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 597 - - - CF$UID - 599 - - - CF$UID - 601 - - - CF$UID - 603 - - - CF$UID - 605 - - - CF$UID - 607 - - - CF$UID - 609 - - - CF$UID - 611 - - - CF$UID - 613 - - - CF$UID - 615 - - - NS.objects - - - CF$UID - 617 - - - CF$UID - 638 - - - CF$UID - 650 - - - CF$UID - 657 - - - CF$UID - 668 - - - CF$UID - 677 - - - CF$UID - 685 - - - CF$UID - 693 - - - CF$UID - 699 - - - CF$UID - 705 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 598 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/English.lproj/PropertyInspector.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 600 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/English.lproj/StylePalette.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 602 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/English.lproj/PropertyInspector.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 604 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/English.lproj/StylePalette.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 606 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/English.lproj/TikzDocument.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 608 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/English.lproj/Preview.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 610 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/English.lproj/MainMenu.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 612 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/English.lproj/Preamble.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 614 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/English.lproj/MainMenu.xib - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 616 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/English.lproj/Preamble.xib - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 622 - - - CF$UID - 584 - - - CF$UID - 621 - - - CF$UID - 625 - - - - IBDockViewController - SelectedObjectIDs - SelectionProvider - IBCanvasViewController - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 624 - - - - LastKnownOutlineViewWidth - 224 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 628 - - - CF$UID - 637 - - - - ObjectIDToLastKnownCanvasPositionMap - EditedTopLevelObjectIDs - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 629 - - - CF$UID - 630 - - - CF$UID - 631 - - - CF$UID - 632 - - - NS.objects - - - CF$UID - 633 - - - CF$UID - 634 - - - CF$UID - 635 - - - CF$UID - 636 - - - - 301 - 185 - 461 - 361 - {46, 13} - {46, 189} - {318, 118} - {46, 385} - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 629 - - - CF$UID - 632 - - - CF$UID - 630 - - - CF$UID - 631 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 639 - - - CF$UID - 641 - - - CF$UID - 643 - - - CF$UID - 644 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 640 - - - - 224 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 642 - - - - -2 - IBStructureViewController - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 645 - - - CF$UID - 646 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 647 - - - CF$UID - 648 - - - CF$UID - 649 - - - - 3 - 649 - 181 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 651 - - - CF$UID - 653 - - - CF$UID - 621 - - - CF$UID - 654 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 652 - - - - 224 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 631 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 655 - - - CF$UID - 656 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 631 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 658 - - - CF$UID - 584 - - - CF$UID - 621 - - - CF$UID - 660 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 659 - - - - 224 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 661 - - - CF$UID - 667 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 647 - - - CF$UID - 649 - - - CF$UID - 662 - - - CF$UID - 648 - - - NS.objects - - - CF$UID - 663 - - - CF$UID - 664 - - - CF$UID - 665 - - - CF$UID - 666 - - - - 524 - {306, -2} - {71, 17} - {118, 105} - {71, 359} - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 648 - - - CF$UID - 647 - - - CF$UID - 649 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 669 - - - CF$UID - 671 - - - CF$UID - 643 - - - CF$UID - 673 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 670 - - - - 224 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 672 - - - - 100024 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 674 - - - CF$UID - 675 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 676 - - - - 5 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 678 - - - CF$UID - 680 - - - CF$UID - 621 - - - CF$UID - 682 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 679 - - - - 224 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 681 - - - - 11 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 683 - - - CF$UID - 684 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 163 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 686 - - - CF$UID - 584 - - - CF$UID - 621 - - - CF$UID - 688 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 687 - - - - 200 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 689 - - - CF$UID - 690 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 691 - - - CF$UID - 692 - - - - 535 - 29 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 694 - - - CF$UID - 584 - - - CF$UID - 621 - - - CF$UID - 696 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 695 - - - - 224 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 697 - - - CF$UID - 698 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 163 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 700 - - - CF$UID - 584 - - - CF$UID - 621 - - - CF$UID - 702 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 701 - - - - 224 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 703 - - - CF$UID - 704 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 692 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 618 - - - CF$UID - 619 - - - CF$UID - 620 - - - CF$UID - 621 - - - NS.objects - - - CF$UID - 706 - - - CF$UID - 708 - - - CF$UID - 621 - - - CF$UID - 710 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 623 - - - NS.objects - - - CF$UID - 707 - - - - 200 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 709 - - - - 27 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 626 - - - CF$UID - 627 - - - NS.objects - - - CF$UID - 711 - - - CF$UID - 712 - - - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 163 - - - CF$UID - 647 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 714 - - - CF$UID - 716 - - - CF$UID - 718 - - - CF$UID - 720 - - - CF$UID - 722 - - - CF$UID - 724 - - - CF$UID - 726 - - - CF$UID - 728 - - - CF$UID - 730 - - - CF$UID - 732 - - - CF$UID - 734 - - - CF$UID - 736 - - - CF$UID - 738 - - - CF$UID - 740 - - - CF$UID - 742 - - - CF$UID - 744 - - - CF$UID - 746 - - - CF$UID - 748 - - - CF$UID - 750 - - - CF$UID - 752 - - - CF$UID - 754 - - - CF$UID - 756 - - - CF$UID - 758 - - - CF$UID - 760 - - - CF$UID - 762 - - - CF$UID - 764 - - - CF$UID - 766 - - - CF$UID - 768 - - - CF$UID - 770 - - - CF$UID - 772 - - - CF$UID - 774 - - - CF$UID - 776 - - - CF$UID - 778 - - - CF$UID - 780 - - - CF$UID - 782 - - - CF$UID - 784 - - - CF$UID - 785 - - - CF$UID - 787 - - - CF$UID - 789 - - - CF$UID - 791 - - - CF$UID - 793 - - - CF$UID - 795 - - - CF$UID - 797 - - - CF$UID - 799 - - - CF$UID - 801 - - - CF$UID - 803 - - - CF$UID - 805 - - - CF$UID - 807 - - - CF$UID - 809 - - - CF$UID - 811 - - - CF$UID - 813 - - - CF$UID - 815 - - - CF$UID - 817 - - - CF$UID - 819 - - - CF$UID - 821 - - - CF$UID - 823 - - - CF$UID - 825 - - - CF$UID - 827 - - - CF$UID - 829 - - - CF$UID - 831 - - - CF$UID - 833 - - - CF$UID - 835 - - - CF$UID - 837 - - - CF$UID - 839 - - - CF$UID - 841 - - - CF$UID - 843 - - - CF$UID - 845 - - - CF$UID - 847 - - - CF$UID - 849 - - - CF$UID - 851 - - - CF$UID - 853 - - - CF$UID - 855 - - - CF$UID - 857 - - - CF$UID - 859 - - - CF$UID - 861 - - - CF$UID - 863 - - - CF$UID - 865 - - - CF$UID - 867 - - - CF$UID - 869 - - - CF$UID - 871 - - - CF$UID - 873 - - - CF$UID - 875 - - - CF$UID - 877 - - - CF$UID - 879 - - - CF$UID - 881 - - - CF$UID - 883 - - - CF$UID - 885 - - - CF$UID - 887 - - - CF$UID - 889 - - - CF$UID - 891 - - - CF$UID - 893 - - - CF$UID - 895 - - - CF$UID - 897 - - - CF$UID - 899 - - - CF$UID - 901 - - - CF$UID - 903 - - - CF$UID - 905 - - - CF$UID - 907 - - - CF$UID - 908 - - - CF$UID - 910 - - - CF$UID - 912 - - - CF$UID - 914 - - - CF$UID - 916 - - - CF$UID - 918 - - - CF$UID - 920 - - - CF$UID - 922 - - - CF$UID - 924 - - - CF$UID - 926 - - - CF$UID - 928 - - - CF$UID - 930 - - - CF$UID - 932 - - - CF$UID - 934 - - - CF$UID - 936 - - - CF$UID - 938 - - - CF$UID - 940 - - - CF$UID - 942 - - - CF$UID - 944 - - - CF$UID - 946 - - - CF$UID - 948 - - - CF$UID - 950 - - - CF$UID - 952 - - - CF$UID - 954 - - - CF$UID - 956 - - - CF$UID - 958 - - - CF$UID - 960 - - - CF$UID - 962 - - - CF$UID - 964 - - - CF$UID - 966 - - - NS.objects - - - CF$UID - 968 - - - CF$UID - 972 - - - CF$UID - 976 - - - CF$UID - 980 - - - CF$UID - 984 - - - CF$UID - 988 - - - CF$UID - 992 - - - CF$UID - 996 - - - CF$UID - 1000 - - - CF$UID - 1003 - - - CF$UID - 1007 - - - CF$UID - 1011 - - - CF$UID - 1015 - - - CF$UID - 1019 - - - CF$UID - 1022 - - - CF$UID - 1025 - - - CF$UID - 1029 - - - CF$UID - 1033 - - - CF$UID - 1037 - - - CF$UID - 1041 - - - CF$UID - 1045 - - - CF$UID - 1049 - - - CF$UID - 1053 - - - CF$UID - 1057 - - - CF$UID - 1061 - - - CF$UID - 1065 - - - CF$UID - 1069 - - - CF$UID - 1073 - - - CF$UID - 1077 - - - CF$UID - 1081 - - - CF$UID - 1085 - - - CF$UID - 1089 - - - CF$UID - 1093 - - - CF$UID - 1097 - - - CF$UID - 1101 - - - CF$UID - 1105 - - - CF$UID - 1109 - - - CF$UID - 1113 - - - CF$UID - 1117 - - - CF$UID - 1120 - - - CF$UID - 1124 - - - CF$UID - 1128 - - - CF$UID - 1132 - - - CF$UID - 1136 - - - CF$UID - 1140 - - - CF$UID - 1143 - - - CF$UID - 1147 - - - CF$UID - 1151 - - - CF$UID - 1155 - - - CF$UID - 1158 - - - CF$UID - 1162 - - - CF$UID - 1165 - - - CF$UID - 1168 - - - CF$UID - 1171 - - - CF$UID - 1175 - - - CF$UID - 1178 - - - CF$UID - 1181 - - - CF$UID - 1185 - - - CF$UID - 1189 - - - CF$UID - 1193 - - - CF$UID - 1197 - - - CF$UID - 1200 - - - CF$UID - 1204 - - - CF$UID - 1208 - - - CF$UID - 1212 - - - CF$UID - 1215 - - - CF$UID - 1218 - - - CF$UID - 1221 - - - CF$UID - 1225 - - - CF$UID - 1229 - - - CF$UID - 1233 - - - CF$UID - 1236 - - - CF$UID - 1239 - - - CF$UID - 1243 - - - CF$UID - 1247 - - - CF$UID - 1251 - - - CF$UID - 1254 - - - CF$UID - 1257 - - - CF$UID - 1261 - - - CF$UID - 1264 - - - CF$UID - 1268 - - - CF$UID - 1272 - - - CF$UID - 1276 - - - CF$UID - 1280 - - - CF$UID - 1284 - - - CF$UID - 1288 - - - CF$UID - 1292 - - - CF$UID - 1296 - - - CF$UID - 1300 - - - CF$UID - 1304 - - - CF$UID - 1308 - - - CF$UID - 1312 - - - CF$UID - 1316 - - - CF$UID - 1320 - - - CF$UID - 1324 - - - CF$UID - 1327 - - - CF$UID - 1330 - - - CF$UID - 1334 - - - CF$UID - 1338 - - - CF$UID - 1342 - - - CF$UID - 1346 - - - CF$UID - 1350 - - - CF$UID - 1354 - - - CF$UID - 1358 - - - CF$UID - 1362 - - - CF$UID - 1366 - - - CF$UID - 1370 - - - CF$UID - 1373 - - - CF$UID - 1376 - - - CF$UID - 1380 - - - CF$UID - 1384 - - - CF$UID - 1388 - - - CF$UID - 1392 - - - CF$UID - 1396 - - - CF$UID - 1400 - - - CF$UID - 1404 - - - CF$UID - 1408 - - - CF$UID - 1412 - - - CF$UID - 1415 - - - CF$UID - 1418 - - - CF$UID - 1421 - - - CF$UID - 1425 - - - CF$UID - 1429 - - - CF$UID - 1432 - - - CF$UID - 1436 - - - CF$UID - 1439 - - - CF$UID - 1443 - - - CF$UID - 1446 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 715 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/GraphicsView.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 717 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/GraphicsView.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 719 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/Grid.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 721 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/osx/Grid.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 723 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/SelectBoxLayer.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 725 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/TikzSourceController.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 727 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/EdgeControlLayer.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 729 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Edge.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 731 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Edge.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 733 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/EdgeStyle+Coder.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 735 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/TikzShape.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 737 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/BasicMapTable.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 739 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/GraphChange.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 741 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/-%5BNSWindowController%20window%5D_disassembly_0x00007fff93905981.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 743 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/_objc_empty_vtable_disassembly_0x00007fff760e2f60.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 745 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/SupportDir.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 747 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/AppDelegate.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 749 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/PickSupport.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 751 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeLayer.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 753 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/PropertyInspectorController.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 755 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/TikzDocument.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 757 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/EdgeStyle.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 759 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/EdgeStyle.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 761 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/NodeStyle.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 763 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/NSString+UnicharUtilities.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 765 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/Grid.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 767 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/DiffMatchPatch.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 769 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/CALayer+DrawLabel.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 771 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/NSString+UnicharUtilities.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 773 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/GraphDiff.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 775 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/contrib/DiffMatchPatch/NSString+DiffMatchPatchUtils.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 777 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Graph.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 779 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/EdgeStyle.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 781 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/EdgeStyle.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 783 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Graph.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 108 - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 786 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/SelectableNodeView.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 788 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/StylePaletteController.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 790 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/PreviewController.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 792 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Transformer.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 794 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 796 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/DiffMatchPatchCFUtilities.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 798 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/GraphChange.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 800 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/GraphChange.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 802 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/-%5BNSObject%20performSelector:%5D_disassembly_0x00007fff8ce162e1.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 804 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/DiffMatchPatchCFUtilities.c - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 806 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/PreambleController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 808 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/PreambleController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 810 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/CGContextAddPath_disassembly_0x00007fff910e972e.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 812 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/contrib/DiffMatchPatch/NSString+DiffMatchPatchUtils.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 814 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/-%5BNSCustomView%20nibInstantiateWithObjectInstantiator:%5D_disassembly_0x00007fff96b86f29.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 816 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/COPYING.DiffMatchPatch - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 818 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/__cxa_throw_disassembly_0x00007fff933e00e9.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 820 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/AppDelegate.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 822 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/AppDelegate.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 824 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/SelectBoxLayer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 826 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/PropertyHolder.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 828 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/DiffMatchPatch.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 830 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/NSString+JavaSubstring.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 832 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Transformer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 834 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Node.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 836 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/EdgeStyle+Coder.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 838 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/NSMutableDictionary+DMPExtensions.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 840 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/GraphElementProperty.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 842 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/Graph+Coder.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 844 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/test/test.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 846 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/SelectableNodeView.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 848 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGColor.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 850 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NilToEmptyStringTransformer.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 852 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeSelectionLayer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 854 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/auto_fatal_disassembly_0x00007fff894d9f6f.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 856 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/GraphElementData.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 858 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/TikzWindowController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 860 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/objc/TestDiff/contrib/DiffMatchPatch/NSString+UriCompatibility.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 862 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/NodeStyle.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 864 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/CABackingStoreUpdate__disassembly_0x00007fff8d778b05.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 866 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/test/common.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 868 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/test/main.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 870 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/main.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 872 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/scratch/SFBInspectors/SFBInspectorView.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 874 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/ToolPaletteController.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 876 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/GraphicsView.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 878 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/GraphicsView.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 880 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/osx/GraphicsView.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 882 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT-Info.plist - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 884 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/TikzGraphAssembler.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 886 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/SelectableCollectionViewItem.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 888 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/SelectableCollectionViewItem.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 890 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/TikzSourceController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 892 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Node.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 894 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/tikzlexer.lm - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 896 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/PickSupport.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 898 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/PickSupport.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 900 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NilToEmptyStringTransformer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 902 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/CFRelease_disassembly_0x00007fff8cc2b07b.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 904 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/GraphElementData.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 906 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeStyle+Coder.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 488 - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 909 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/EdgeControlLayer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 911 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeStyle+Coder.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 913 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Edge.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 915 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Edge.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 917 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Edge.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 919 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/TikzDocument.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 921 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/PropertyHolder.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 923 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/TikzGraphAssembler.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 925 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/StylePaletteController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 927 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/StylePaletteController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 929 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/TikzGraphAssembler.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 931 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/PropertyInspectorController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 933 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/PropertyInspectorController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 935 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/PreviewController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 937 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/PreviewController.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 939 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Graph.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 941 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Graph.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 943 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/Graph+Coder.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 945 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/util.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 947 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/-%5BNSCollectionView%20newItemForRepresentedObject:%5D_disassembly_0x00007fff8fa0a94e.s - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 949 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/Shape.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 951 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/common/Shape.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 953 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFString.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 955 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/TikzWindowController.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 957 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/GraphDiff.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 959 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeSelectionLayer.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 961 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/GraphElementProperty.h - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 963 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeLayer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 965 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/NodeLayer.m - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 967 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/src/common/ColorRGB.m - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 969 - - - CF$UID - 970 - - - CF$UID - 25 - - - CF$UID - 971 - - - - 345762860.65236199 - {2200, 1151} - {2909, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 973 - - - CF$UID - 974 - - - CF$UID - 25 - - - CF$UID - 975 - - - - 348421987.42822403 - {2200, 1157} - {3223, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 977 - - - CF$UID - 978 - - - CF$UID - 25 - - - CF$UID - 979 - - - - 345403783.61108297 - {842, 693} - {1356, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 981 - - - CF$UID - 982 - - - CF$UID - 25 - - - CF$UID - 983 - - - - 380738928.58536297 - {2001, 1508} - {2090, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 985 - - - CF$UID - 986 - - - CF$UID - 25 - - - CF$UID - 987 - - - - 345416623.559434 - {0, 379} - {276, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 989 - - - CF$UID - 990 - - - CF$UID - 25 - - - CF$UID - 991 - - - - 345403324.869367 - {881, 944} - {1433, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 993 - - - CF$UID - 994 - - - CF$UID - 25 - - - CF$UID - 995 - - - - 345571191.17329699 - {104, 1058} - {1155, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 997 - - - CF$UID - 998 - - - CF$UID - 25 - - - CF$UID - 999 - - - - 345403538.85177398 - {943, 1136} - {9769, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1001 - - - CF$UID - 1002 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348682214.50559098 - {1692, 820} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1004 - - - CF$UID - 1005 - - - CF$UID - 25 - - - CF$UID - 1006 - - - - 340459449.14873803 - {0, 953} - {898, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1008 - - - CF$UID - 1009 - - - CF$UID - 25 - - - CF$UID - 1010 - - - - 345404849.21465802 - {1684, 1007} - {2065, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1012 - - - CF$UID - 1013 - - - CF$UID - 25 - - - CF$UID - 1014 - - - - 345994252.86864501 - {1109, 746} - {790, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1016 - - - CF$UID - 1017 - - - CF$UID - 25 - - - CF$UID - 1018 - - - - 340625465.61212498 - {6290, 1393} - {7112, 58} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1020 - - - CF$UID - 1021 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348348273.15865397 - {0, 2528} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1023 - - - CF$UID - 1024 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345409605.10440803 - {0, 2496} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1026 - - - CF$UID - 1027 - - - CF$UID - 25 - - - CF$UID - 1028 - - - - 348328967.72804999 - {831, 996} - {1464, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1030 - - - CF$UID - 1031 - - - CF$UID - 25 - - - CF$UID - 1032 - - - - 345487190.58582902 - {592, 1437} - {1769, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1034 - - - CF$UID - 1035 - - - CF$UID - 25 - - - CF$UID - 1036 - - - - 348348232.74814701 - {2312, 1269} - {3305, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1038 - - - CF$UID - 1039 - - - CF$UID - 25 - - - CF$UID - 1040 - - - - 345416712.81625599 - {812, 967} - {1608, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1042 - - - CF$UID - 1043 - - - CF$UID - 25 - - - CF$UID - 1044 - - - - 345404437.01901197 - {960, 1373} - {1257, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1046 - - - CF$UID - 1047 - - - CF$UID - 25 - - - CF$UID - 1048 - - - - 340624392.15628898 - {0, 1080} - {928, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1050 - - - CF$UID - 1051 - - - CF$UID - 25 - - - CF$UID - 1052 - - - - 340473820.49560201 - {1062, 1380} - {19, 768} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1054 - - - CF$UID - 1055 - - - CF$UID - 25 - - - CF$UID - 1056 - - - - 348682101.30419898 - {0, 1156} - {811, 26} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1058 - - - CF$UID - 1059 - - - CF$UID - 25 - - - CF$UID - 1060 - - - - 345763213.21294802 - {1210, 686} - {1261, 115} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1062 - - - CF$UID - 1063 - - - CF$UID - 25 - - - CF$UID - 1064 - - - - 340632134.97458899 - {30, 1204} - {902, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1066 - - - CF$UID - 1067 - - - CF$UID - 25 - - - CF$UID - 1068 - - - - 340501555.21261299 - {97, 1322} - {976, 23} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1070 - - - CF$UID - 1071 - - - CF$UID - 25 - - - CF$UID - 1072 - - - - 340631784.15413302 - {4723, 1844} - {5843, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1074 - - - CF$UID - 1075 - - - CF$UID - 25 - - - CF$UID - 1076 - - - - 340706474.47886401 - {298, 1417} - {624, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1078 - - - CF$UID - 1079 - - - CF$UID - 25 - - - CF$UID - 1080 - - - - 340631841.98603201 - {0, 968} - {841, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1082 - - - CF$UID - 1083 - - - CF$UID - 25 - - - CF$UID - 1084 - - - - 340622423.14766902 - {0, 1050} - {947, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1086 - - - CF$UID - 1087 - - - CF$UID - 25 - - - CF$UID - 1088 - - - - 340631322.39264601 - {52, 1607} - {270, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1090 - - - CF$UID - 1091 - - - CF$UID - 25 - - - CF$UID - 1092 - - - - 340925457.76799399 - {2611, 845} - {3012, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1094 - - - CF$UID - 1095 - - - CF$UID - 25 - - - CF$UID - 1096 - - - - 340410882.75886202 - {933, 1045} - {1918, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1098 - - - CF$UID - 1099 - - - CF$UID - 25 - - - CF$UID - 1100 - - - - 348682102.890167 - {0, 1214} - {964, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1102 - - - CF$UID - 1103 - - - CF$UID - 25 - - - CF$UID - 1104 - - - - 348502930.726179 - {13299, 942} - {13697, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 1106 - - - CF$UID - 1107 - - - CF$UID - 25 - - - CF$UID - 1108 - - - - 381083509.44221699 - {18344, 1253} - {19467, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1110 - - - CF$UID - 1111 - - - CF$UID - 25 - - - CF$UID - 1112 - - - - 345488697.68925297 - {0, 1055} - {907, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1114 - - - CF$UID - 1115 - - - CF$UID - 25 - - - CF$UID - 1116 - - - - 345487787.078866 - {403, 1549} - {1655, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1118 - - - CF$UID - 1119 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348489963.85380399 - {288, 1153} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1121 - - - CF$UID - 1122 - - - CF$UID - 25 - - - CF$UID - 1123 - - - - 340978354.92465001 - {969, 1145} - {1174, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1125 - - - CF$UID - 1126 - - - CF$UID - 25 - - - CF$UID - 1127 - - - - 340709461.72300398 - {0, 1410} - {369, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1129 - - - CF$UID - 1130 - - - CF$UID - 25 - - - CF$UID - 1131 - - - - 340632182.87597102 - {300, 1742} - {1087, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1133 - - - CF$UID - 1134 - - - CF$UID - 25 - - - CF$UID - 1135 - - - - 340625462.37954402 - {2270, 728} - {1004, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1137 - - - CF$UID - 1138 - - - CF$UID - 25 - - - CF$UID - 1139 - - - - 348419924.36261398 - {3536, 958} - {353, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1141 - - - CF$UID - 1142 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348347980.23595798 - {0, 1071} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1144 - - - CF$UID - 1145 - - - CF$UID - 25 - - - CF$UID - 1146 - - - - 340632849.17894697 - {0, 1631} - {914, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1148 - - - CF$UID - 1149 - - - CF$UID - 25 - - - CF$UID - 1150 - - - - 345404279.50111699 - {1864, 1059} - {2502, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1152 - - - CF$UID - 1153 - - - CF$UID - 25 - - - CF$UID - 1154 - - - - 348491190.94514698 - {3485, 1369} - {4064, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1156 - - - CF$UID - 1157 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340734505.19957298 - {0, 1949} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1159 - - - CF$UID - 1160 - - - CF$UID - 25 - - - CF$UID - 1161 - - - - 340630944.19481701 - {0, 254} - {227, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1163 - - - CF$UID - 1164 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340715007.520365 - {3185, 2419} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1166 - - - CF$UID - 1167 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340634798.489407 - {0, 1840} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1169 - - - CF$UID - 1170 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340645018.90256602 - {0, 1609} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1172 - - - CF$UID - 1173 - - - CF$UID - 25 - - - CF$UID - 1174 - - - - 345487388.13644803 - {912, 1366} - {1795, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1176 - - - CF$UID - 1177 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348348274.649975 - {784, 1230} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1179 - - - CF$UID - 1180 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345416620.55954498 - {175, 713} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1182 - - - CF$UID - 1183 - - - CF$UID - 25 - - - CF$UID - 1184 - - - - 340588857.98394001 - {0, 1072} - {24, 767} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1186 - - - CF$UID - 1187 - - - CF$UID - 25 - - - CF$UID - 1188 - - - - 340631785.03849697 - {28409, 1632} - {29398, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1190 - - - CF$UID - 1191 - - - CF$UID - 25 - - - CF$UID - 1192 - - - - 340632146.36382198 - {0, 1162} - {1153, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1194 - - - CF$UID - 1195 - - - CF$UID - 25 - - - CF$UID - 1196 - - - - 340978419.60591 - {392, 1123} - {5521, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1198 - - - CF$UID - 1199 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345763164.73803198 - {1306, 858} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1201 - - - CF$UID - 1202 - - - CF$UID - 25 - - - CF$UID - 1203 - - - - 340459404.56984299 - {0, 1634} - {1293, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1205 - - - CF$UID - 1206 - - - CF$UID - 25 - - - CF$UID - 1207 - - - - 340632182.02007103 - {2123, 1102} - {358, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1209 - - - CF$UID - 1210 - - - CF$UID - 25 - - - CF$UID - 1211 - - - - 345407440.14106703 - {980, 563} - {1308, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1213 - - - CF$UID - 1214 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345570963.43227798 - {0, 307} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1216 - - - CF$UID - 1217 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348493987.74653798 - {1400, 772} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1219 - - - CF$UID - 1220 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345762938.27138197 - {1967, 722} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1222 - - - CF$UID - 1223 - - - CF$UID - 25 - - - CF$UID - 1224 - - - - 340715018.37839699 - {732, 1720} - {1614, 68} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1226 - - - CF$UID - 1227 - - - CF$UID - 25 - - - CF$UID - 1228 - - - - 340710896.240381 - {0, 907} - {71, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1230 - - - CF$UID - 1231 - - - CF$UID - 25 - - - CF$UID - 1232 - - - - 340978941.82531101 - {1271, 874} - {1724, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1234 - - - CF$UID - 1235 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340743258.14034998 - {332, 2129} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1237 - - - CF$UID - 1238 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345570916.35617101 - {1868, 787} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1240 - - - CF$UID - 1241 - - - CF$UID - 25 - - - CF$UID - 1242 - - - - 340624895.44772601 - {0, 956} - {1590, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1244 - - - CF$UID - 1245 - - - CF$UID - 25 - - - CF$UID - 1246 - - - - 340632090.00535399 - {855, 1347} - {2165, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1248 - - - CF$UID - 1249 - - - CF$UID - 25 - - - CF$UID - 1250 - - - - 345763208.75864798 - {2157, 874} - {2538, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1252 - - - CF$UID - 1253 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340734675.59256703 - {2612, 2357} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1255 - - - CF$UID - 1256 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348493972.20554298 - {0, 948} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1258 - - - CF$UID - 1259 - - - CF$UID - 25 - - - CF$UID - 1260 - - - - 348494575.91981101 - {202, 1322} - {1013, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1262 - - - CF$UID - 1263 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340643026.22692502 - {0, 760} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1265 - - - CF$UID - 1266 - - - CF$UID - 25 - - - CF$UID - 1267 - - - - 345993841.814812 - {4603, 1030} - {5559, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1269 - - - CF$UID - 1270 - - - CF$UID - 25 - - - CF$UID - 1271 - - - - 345403242.32928503 - {47, 1110} - {798, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1273 - - - CF$UID - 1274 - - - CF$UID - 25 - - - CF$UID - 1275 - - - - 345994942.28171802 - {0, 1189} - {176, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1277 - - - CF$UID - 1278 - - - CF$UID - 25 - - - CF$UID - 1279 - - - - 348769524.87817502 - {27280, 1795} - {28593, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1281 - - - CF$UID - 1282 - - - CF$UID - 25 - - - CF$UID - 1283 - - - - 376240707.96911001 - {2531, 1228} - {23808, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1285 - - - CF$UID - 1286 - - - CF$UID - 25 - - - CF$UID - 1287 - - - - 348605533.47624701 - {0, 1341} - {605, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1289 - - - CF$UID - 1290 - - - CF$UID - 25 - - - CF$UID - 1291 - - - - 340567695.969051 - {0, 1207} - {830, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1293 - - - CF$UID - 1294 - - - CF$UID - 25 - - - CF$UID - 1295 - - - - 345489807.49887401 - {0, 1229} - {1146, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1297 - - - CF$UID - 1298 - - - CF$UID - 25 - - - CF$UID - 1299 - - - - 345489863.78087598 - {476, 1185} - {1510, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1301 - - - CF$UID - 1302 - - - CF$UID - 25 - - - CF$UID - 1303 - - - - 345404020.64375901 - {4401, 1141} - {5428, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1305 - - - CF$UID - 1306 - - - CF$UID - 25 - - - CF$UID - 1307 - - - - 345489170.70111698 - {709, 717} - {1130, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 1309 - - - CF$UID - 1310 - - - CF$UID - 25 - - - CF$UID - 1311 - - - - 381079266.26616299 - {1088, 2047} - {2268, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1313 - - - CF$UID - 1314 - - - CF$UID - 25 - - - CF$UID - 1315 - - - - 340715684.42909598 - {3334, 813} - {3831, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1317 - - - CF$UID - 1318 - - - CF$UID - 25 - - - CF$UID - 1319 - - - - 348348259.35793602 - {592, 833} - {3224, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1321 - - - CF$UID - 1322 - - - CF$UID - 25 - - - CF$UID - 1323 - - - - 340710918.149167 - {413, 867} - {1123, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1325 - - - CF$UID - 1326 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340979058.26628602 - {0, 2158} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1328 - - - CF$UID - 1329 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345763100.69483101 - {1412, 1093} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1331 - - - CF$UID - 1332 - - - CF$UID - 25 - - - CF$UID - 1333 - - - - 345401288.84783798 - {0, 1034} - {948, 79} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 1335 - - - CF$UID - 1336 - - - CF$UID - 25 - - - CF$UID - 1337 - - - - 381083143.218243 - {1711, 1286} - {2266, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1339 - - - CF$UID - 1340 - - - CF$UID - 25 - - - CF$UID - 1341 - - - - 345571135.33805102 - {3644, 993} - {4607, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1343 - - - CF$UID - 1344 - - - CF$UID - 25 - - - CF$UID - 1345 - - - - 345763340.54909998 - {1782, 1377} - {1408, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1347 - - - CF$UID - 1348 - - - CF$UID - 25 - - - CF$UID - 1349 - - - - 345403635.98861599 - {9317, 1036} - {9522, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1351 - - - CF$UID - 1352 - - - CF$UID - 25 - - - CF$UID - 1353 - - - - 348682251.432365 - {5303, 1025} - {5439, 6} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 1355 - - - CF$UID - 1356 - - - CF$UID - 25 - - - CF$UID - 1357 - - - - 381083685.054461 - {1472, 1140} - {1127, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1359 - - - CF$UID - 1360 - - - CF$UID - 25 - - - CF$UID - 1361 - - - - 345403910.70446801 - {898, 1274} - {1480, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1363 - - - CF$UID - 1364 - - - CF$UID - 25 - - - CF$UID - 1365 - - - - 340408281.394584 - {0, 1070} - {818, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1367 - - - CF$UID - 1368 - - - CF$UID - 25 - - - CF$UID - 1369 - - - - 340567709.72924697 - {111, 1169} - {2498, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1371 - - - CF$UID - 1372 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345993841.44873297 - {6640, 969} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1374 - - - CF$UID - 1375 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348492100.48254102 - {984, 1424} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 142 - - - CF$UID - 143 - - - CF$UID - 144 - - - CF$UID - 145 - - - NS.objects - - - CF$UID - 1377 - - - CF$UID - 1378 - - - CF$UID - 25 - - - CF$UID - 1379 - - - - 381079265.50655103 - {0, 1180} - {652, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1381 - - - CF$UID - 1382 - - - CF$UID - 25 - - - CF$UID - 1383 - - - - 345996220.58187401 - {4812, 1832} - {5468, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1385 - - - CF$UID - 1386 - - - CF$UID - 25 - - - CF$UID - 1387 - - - - 348328941.80720401 - {4812, 1747} - {5015, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1389 - - - CF$UID - 1390 - - - CF$UID - 25 - - - CF$UID - 1391 - - - - 345404215.00799 - {2896, 1165} - {3929, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1393 - - - CF$UID - 1394 - - - CF$UID - 25 - - - CF$UID - 1395 - - - - 352300514.86549997 - {1565, 1736} - {2412, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1397 - - - CF$UID - 1398 - - - CF$UID - 25 - - - CF$UID - 1399 - - - - 340724015.08366603 - {2833, 942} - {6706, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1401 - - - CF$UID - 1402 - - - CF$UID - 25 - - - CF$UID - 1403 - - - - 348425521.71969801 - {5676, 932} - {6233, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1405 - - - CF$UID - 1406 - - - CF$UID - 25 - - - CF$UID - 1407 - - - - 345570983.01814902 - {0, 528} - {521, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1409 - - - CF$UID - 1410 - - - CF$UID - 25 - - - CF$UID - 1411 - - - - 340497412.20933402 - {1831, 988} - {2427, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1413 - - - CF$UID - 1414 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345407318.56900901 - {0, 2329} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1416 - - - CF$UID - 1417 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345406868.72379202 - {2708, 1368} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1419 - - - CF$UID - 1420 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348682639.65947402 - {2316, 1465} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1422 - - - CF$UID - 1423 - - - CF$UID - 25 - - - CF$UID - 1424 - - - - 340629051.56177503 - {10183, 1616} - {10616, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1426 - - - CF$UID - 1427 - - - CF$UID - 25 - - - CF$UID - 1428 - - - - 345403358.18671203 - {0, 778} - {177, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1430 - - - CF$UID - 1431 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340628546.57123297 - {644, 1063} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1433 - - - CF$UID - 1434 - - - CF$UID - 25 - - - CF$UID - 1435 - - - - 345403253.67140001 - {106, 1057} - {1029, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1437 - - - CF$UID - 1438 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 345407415.72300202 - {798, 781} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1440 - - - CF$UID - 1441 - - - CF$UID - 25 - - - CF$UID - 1442 - - - - 345488818.74460101 - {35, 1246} - {1367, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1444 - - - CF$UID - 1445 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348682657.38014698 - {3283, 1343} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1447 - - - CF$UID - 1448 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 340411515.847987 - {0, 1981} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 948 - - - CF$UID - 787 - - - CF$UID - 924 - - - CF$UID - 1450 - - - CF$UID - 950 - - - NS.objects - - - CF$UID - 1452 - - - CF$UID - 1456 - - - CF$UID - 1458 - - - CF$UID - 1461 - - - CF$UID - 1464 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1451 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/TikZiT.xcodeproj/aleks.mode1v3 - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1453 - - - CF$UID - 1454 - - - CF$UID - 25 - - - CF$UID - 1455 - - - - 340366198.37379301 - {1726, 1368} - {1954, 0} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 357 - - - CF$UID - 359 - - - CF$UID - 358 - - - NS.objects - - - CF$UID - 360 - - - CF$UID - 1457 - - - CF$UID - 360 - - - - 340393968.41070002 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 357 - - - CF$UID - 359 - - - CF$UID - 358 - - - NS.objects - - - CF$UID - 360 - - - CF$UID - 1459 - - - CF$UID - 1460 - - - - 340394097.732535 - {4237, 1279} - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 357 - - - CF$UID - 358 - - - CF$UID - 359 - - - NS.objects - - - CF$UID - 360 - - - CF$UID - 1462 - - - CF$UID - 1463 - - - - {0, 1026} - 340539479.94429201 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 359 - - - CF$UID - 358 - - - CF$UID - 400 - - - CF$UID - 357 - - - NS.objects - - - CF$UID - 1465 - - - CF$UID - 360 - - - CF$UID - 25 - - - CF$UID - 360 - - - - 348502939.40997303 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1467 - - - NS.objects - - - CF$UID - 1469 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1468 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/var/folders/y0/_h88tzh153vdf2wysdw2tjjr0000gp/T/StylePalette-fPGoyqLn.xib - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 357 - - - CF$UID - 358 - - - CF$UID - 359 - - - NS.objects - - - CF$UID - 360 - - - CF$UID - 1470 - - - CF$UID - 1471 - - - - {89564, 1173} - 340370036.79549003 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 881 - - - NS.objects - - - CF$UID - 1473 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 357 - - - CF$UID - 358 - - - CF$UID - 359 - - - NS.objects - - - CF$UID - 360 - - - CF$UID - 361 - - - CF$UID - 1474 - - - - 348502941.57143199 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1476 - - - CF$UID - 1478 - - - CF$UID - 1480 - - - NS.objects - - - CF$UID - 1482 - - - CF$UID - 1506 - - - CF$UID - 1551 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1477 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/git/tikzit/tikzit/TikZiT.xcodeproj/ - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1479 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/TikZiT.xcodeproj - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1481 - - - - $class - - CF$UID - 109 - - NS.string - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT.xcodeproj/ - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1483 - - - CF$UID - 1484 - - - CF$UID - 1485 - - - CF$UID - 1486 - - - NS.objects - - - CF$UID - 1487 - - - CF$UID - 1496 - - - CF$UID - 1497 - - - CF$UID - 1505 - - - - Xcode3ProjectEditor.sourceList.splitview - Xcode3ProjectEditorPreviousTargetEditorClass - Xcode3ProjectEditorSelectedDocumentLocations - Xcode3ProjectEditor_Xcode3TargetEditor - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1488 - - - NS.objects - - - CF$UID - 1489 - - - - DVTSplitViewItems - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1490 - - - CF$UID - 1494 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1491 - - - CF$UID - 1492 - - - NS.objects - - - CF$UID - 221 - - - CF$UID - 1493 - - - - DVTIdentifier - DVTViewMagnitude - 170 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1491 - - - CF$UID - 1492 - - - NS.objects - - - CF$UID - 221 - - - CF$UID - 1495 - - - - 645 - Xcode3TargetEditor - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1498 - - - - - $class - - CF$UID - 1504 - - documentURL - - CF$UID - 1499 - - selection - - CF$UID - 1501 - - timestamp - - CF$UID - 1500 - - - file://localhost/Users/aleks/git/tikzit/tikzit/TikZiT.xcodeproj/ - 380738961.54778898 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1502 - - - CF$UID - 1503 - - - NS.objects - - - CF$UID - 1496 - - - CF$UID - 254 - - - - Editor - Target - - $classes - - Xcode3ProjectDocumentLocation - DVTDocumentLocation - NSObject - - $classname - Xcode3ProjectDocumentLocation - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1507 - - - CF$UID - 1483 - - - CF$UID - 1484 - - - CF$UID - 1485 - - - CF$UID - 1508 - - - NS.objects - - - CF$UID - 1509 - - - CF$UID - 1510 - - - CF$UID - 1509 - - - CF$UID - 1516 - - - CF$UID - 1550 - - - - Xcode3ProjectEditorPreviousProjectEditorClass - Xcode3ProjectEditor_Xcode3BuildSettingsEditor - Xcode3BuildSettingsEditor - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1488 - - - NS.objects - - - CF$UID - 1511 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1512 - - - CF$UID - 1514 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1491 - - - CF$UID - 1492 - - - NS.objects - - - CF$UID - 221 - - - CF$UID - 1513 - - - - 170 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1491 - - - CF$UID - 1492 - - - NS.objects - - - CF$UID - 221 - - - CF$UID - 1515 - - - - 645 - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1517 - - - - - $class - - CF$UID - 1504 - - documentURL - - CF$UID - 1518 - - selection - - CF$UID - 1520 - - timestamp - - CF$UID - 1519 - - - file://localhost/Users/aleks/svn/tikzit/TikZiT.xcodeproj/ - 345993840.88442099 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1521 - - - CF$UID - 1502 - - - CF$UID - 1522 - - - NS.objects - - - CF$UID - 254 - - - CF$UID - 1509 - - - CF$UID - 1523 - - - - Project - Xcode3BuildSettingsEditorLocations - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1524 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1525 - - - CF$UID - 1526 - - - CF$UID - 1527 - - - CF$UID - 1528 - - - CF$UID - 1529 - - - CF$UID - 1530 - - - NS.objects - - - CF$UID - 1531 - - - CF$UID - 1548 - - - CF$UID - 246 - - - CF$UID - 246 - - - CF$UID - 163 - - - CF$UID - 163 - - - - Collapsed Build Property Categories - Selected Build Properties - Xcode3BuildSettingsEditorDisplayMode - Xcode3BuildPropertyValueDisplayMode - Xcode3BuildSettingsEditorMode - Xcode3BuildPropertyNameDisplayMode - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1532 - - - CF$UID - 1533 - - - CF$UID - 1534 - - - CF$UID - 1535 - - - CF$UID - 1536 - - - CF$UID - 1537 - - - CF$UID - 1538 - - - CF$UID - 1539 - - - CF$UID - 1540 - - - CF$UID - 1541 - - - CF$UID - 1542 - - - CF$UID - 1543 - - - CF$UID - 1544 - - - CF$UID - 1545 - - - CF$UID - 1546 - - - CF$UID - 1547 - - - - - $class - - CF$UID - 109 - - NS.string - Architectures||ARCHS - - - $class - - CF$UID - 109 - - NS.string - Architectures||SDKROOT - - - $class - - CF$UID - 109 - - NS.string - Architectures||VALID_ARCHS - - - $class - - CF$UID - 109 - - NS.string - Build Locations||SYMROOT - - - $class - - CF$UID - 109 - - NS.string - Build Options||PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR - - - $class - - CF$UID - 109 - - NS.string - Deployment||INSTALL_PATH - - - $class - - CF$UID - 109 - - NS.string - Deployment||MACOSX_DEPLOYMENT_TARGET - - - $class - - CF$UID - 109 - - NS.string - Deployment||STRIP_INSTALLED_PRODUCT - - - $class - - CF$UID - 109 - - NS.string - Packaging||INFOPLIST_FILE - - - $class - - CF$UID - 109 - - NS.string - Packaging||PRODUCT_NAME - - - $class - - CF$UID - 109 - - NS.string - Search Paths||HEADER_SEARCH_PATHS - - - $class - - CF$UID - 109 - - NS.string - Search Paths||USER_HEADER_SEARCH_PATHS - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Code Generation||GCC_ENABLE_OBJC_GC - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Language||GCC_C_LANGUAGE_STANDARD - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Warnings||GCC_WARN_ABOUT_RETURN_TYPE - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Warnings||GCC_WARN_UNUSED_VARIABLE - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1549 - - - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Code Generation||GCC_ENABLE_OBJC_GC - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1507 - - - CF$UID - 1483 - - - CF$UID - 1484 - - - CF$UID - 1485 - - - CF$UID - 1508 - - - NS.objects - - - CF$UID - 1509 - - - CF$UID - 1552 - - - CF$UID - 1509 - - - CF$UID - 1558 - - - CF$UID - 1584 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1488 - - - NS.objects - - - CF$UID - 1553 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1554 - - - CF$UID - 1556 - - - - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1491 - - - CF$UID - 1492 - - - NS.objects - - - CF$UID - 221 - - - CF$UID - 1555 - - - - 170 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1491 - - - CF$UID - 1492 - - - NS.objects - - - CF$UID - 221 - - - CF$UID - 1557 - - - - 645 - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1559 - - - - - $class - - CF$UID - 1504 - - documentURL - - CF$UID - 1560 - - selection - - CF$UID - 1562 - - timestamp - - CF$UID - 1561 - - - file://localhost/Users/aleks/svn/tikzit/tikzit/TikZiT.xcodeproj/ - 348348307.809012 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1521 - - - CF$UID - 1502 - - - CF$UID - 1522 - - - NS.objects - - - CF$UID - 254 - - - CF$UID - 1509 - - - CF$UID - 1563 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1564 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1530 - - - CF$UID - 1526 - - - CF$UID - 1527 - - - CF$UID - 1528 - - - CF$UID - 1529 - - - CF$UID - 1525 - - - NS.objects - - - CF$UID - 163 - - - CF$UID - 1565 - - - CF$UID - 246 - - - CF$UID - 246 - - - CF$UID - 163 - - - CF$UID - 1567 - - - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1566 - - - - - $class - - CF$UID - 109 - - NS.string - Architectures||VALID_ARCHS - - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1568 - - - CF$UID - 1569 - - - CF$UID - 1570 - - - CF$UID - 1571 - - - CF$UID - 1572 - - - CF$UID - 1573 - - - CF$UID - 1574 - - - CF$UID - 1575 - - - CF$UID - 1576 - - - CF$UID - 1577 - - - CF$UID - 1578 - - - CF$UID - 1579 - - - CF$UID - 1580 - - - CF$UID - 1581 - - - CF$UID - 1582 - - - CF$UID - 1583 - - - - - $class - - CF$UID - 109 - - NS.string - Architectures||ARCHS - - - $class - - CF$UID - 109 - - NS.string - Architectures||SDKROOT - - - $class - - CF$UID - 109 - - NS.string - Architectures||VALID_ARCHS - - - $class - - CF$UID - 109 - - NS.string - Build Locations||SYMROOT - - - $class - - CF$UID - 109 - - NS.string - Build Options||PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR - - - $class - - CF$UID - 109 - - NS.string - Deployment||INSTALL_PATH - - - $class - - CF$UID - 109 - - NS.string - Deployment||MACOSX_DEPLOYMENT_TARGET - - - $class - - CF$UID - 109 - - NS.string - Deployment||STRIP_INSTALLED_PRODUCT - - - $class - - CF$UID - 109 - - NS.string - Packaging||INFOPLIST_FILE - - - $class - - CF$UID - 109 - - NS.string - Packaging||PRODUCT_NAME - - - $class - - CF$UID - 109 - - NS.string - Search Paths||HEADER_SEARCH_PATHS - - - $class - - CF$UID - 109 - - NS.string - Search Paths||USER_HEADER_SEARCH_PATHS - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Code Generation||GCC_ENABLE_OBJC_GC - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Language||GCC_C_LANGUAGE_STANDARD - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Warnings||GCC_WARN_ABOUT_RETURN_TYPE - - - $class - - CF$UID - 109 - - NS.string - LLVM GCC 4.2 - Warnings||GCC_WARN_UNUSED_VARIABLE - - - $class - - CF$UID - 39 - - NS.keys - - NS.objects - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1586 - - - CF$UID - 1588 - - - CF$UID - 1590 - - - CF$UID - 1592 - - - CF$UID - 1594 - - - NS.objects - - - CF$UID - 1596 - - - CF$UID - 1604 - - - CF$UID - 1609 - - - CF$UID - 1614 - - - CF$UID - 1619 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1587 - - - x-xcode-log://93BF0A7E-9B8F-4127-9E53-6FD4359563C8 - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1589 - - - x-xcode-log://E16FA7B2-DE55-4431-89C7-43D8A6C6BE2B - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1591 - - - x-xcode-log://541A0579-23A7-4735-AC53-0CA54C1CC926 - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1593 - - - x-xcode-log://4E6ECE08-C292-42A5-9EB8-F1D770002C74 - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1595 - - - x-xcode-log://56055AA1-9319-4181-AD73-7A2BA288B024 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 1597 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1598 - - - - - $class - - CF$UID - 1603 - - documentURL - - CF$UID - 1587 - - expandTranscript - - indexPath - - CF$UID - 1599 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 1602 - - NSIndexPathData - - CF$UID - 1600 - - NSIndexPathLength - 2 - - - $class - - CF$UID - 1601 - - NS.data - - AEc= - - - - $classes - - NSMutableData - NSData - NSObject - - $classname - NSMutableData - - - $classes - - NSIndexPath - NSObject - - $classname - NSIndexPath - - - $classes - - IDELogDocumentLocation - DVTDocumentLocation - NSObject - - $classname - IDELogDocumentLocation - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 1605 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1606 - - - - - $class - - CF$UID - 1603 - - documentURL - - CF$UID - 1589 - - expandTranscript - - indexPath - - CF$UID - 1607 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 1602 - - NSIndexPathData - - CF$UID - 1608 - - NSIndexPathLength - 2 - - - $class - - CF$UID - 1601 - - NS.data - - AEc= - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 1610 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1611 - - - - - $class - - CF$UID - 1603 - - documentURL - - CF$UID - 1591 - - expandTranscript - - indexPath - - CF$UID - 1612 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 1602 - - NSIndexPathData - - CF$UID - 1613 - - NSIndexPathLength - 2 - - - $class - - CF$UID - 1601 - - NS.data - - AEc= - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 1615 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1616 - - - - - $class - - CF$UID - 1603 - - documentURL - - CF$UID - 1593 - - expandTranscript - - indexPath - - CF$UID - 1617 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 1602 - - NSIndexPathData - - CF$UID - 1618 - - NSIndexPathLength - 2 - - - $class - - CF$UID - 1601 - - NS.data - - AEc= - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 560 - - - NS.objects - - - CF$UID - 1620 - - - - - $class - - CF$UID - 60 - - NS.objects - - - CF$UID - 1621 - - - - - $class - - CF$UID - 1603 - - documentURL - - CF$UID - 1595 - - expandTranscript - - indexPath - - CF$UID - 1622 - - timestamp - - CF$UID - 0 - - - - $class - - CF$UID - 1602 - - NSIndexPathData - - CF$UID - 1623 - - NSIndexPathLength - 2 - - - $class - - CF$UID - 1601 - - NS.data - - AEg= - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1625 - - - CF$UID - 1626 - - - NS.objects - - - CF$UID - 1627 - - - CF$UID - 1628 - - - - IDEDeviceLocation - IDEDeviceArchitecture - dvtdevice-local-computer:localhost - i386 - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1630 - - - NS.objects - - - CF$UID - 1631 - - - - IDENameString - TikZiT - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1633 - - - CF$UID - 1634 - - - CF$UID - 1635 - - - NS.objects - - - CF$UID - 1636 - - - CF$UID - 1661 - - - CF$UID - 57 - - - - IDEActivityReportCompletionSummaryStringSegments - IDEActivityReportOptions - IDEActivityReportTitle - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1637 - - - CF$UID - 1644 - - - CF$UID - 1648 - - - CF$UID - 1652 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1638 - - - CF$UID - 1639 - - - CF$UID - 1640 - - - NS.objects - - - CF$UID - 1641 - - - CF$UID - 1642 - - - CF$UID - 1643 - - - - IDEActivityReportStringSegmentPriority - IDEActivityReportStringSegmentBackSeparator - IDEActivityReportStringSegmentStringValue - 2 - - Build - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1638 - - - CF$UID - 1639 - - - CF$UID - 1640 - - - NS.objects - - - CF$UID - 1645 - - - CF$UID - 1646 - - - CF$UID - 1647 - - - - 4 - : - TikZiT - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1638 - - - CF$UID - 1639 - - - CF$UID - 1640 - - - NS.objects - - - CF$UID - 1649 - - - CF$UID - 1650 - - - CF$UID - 1651 - - - - 1 - │ - - $class - - CF$UID - 1601 - - NS.data - - YnBsaXN0MDDUAQIDBAUGOzxYJHZlcnNpb25YJG9iamVjdHNZJGFy - Y2hpdmVyVCR0b3ASAAGGoK0HCA8QGhscJCUrMTQ3VSRudWxs0wkK - CwwNDlxOU0F0dHJpYnV0ZXNWJGNsYXNzWE5TU3RyaW5ngAOADIAC - WVN1Y2NlZWRlZNMKERITFBdXTlMua2V5c1pOUy5vYmplY3RzgAui - FRaABIAFohgZgAaACVZOU0ZvbnRXTlNDb2xvctQKHR4fICEiI1ZO - U05hbWVWTlNTaXplWE5TZkZsYWdzgAiAByNAJgAAAAAAABENEF8Q - EUx1Y2lkYUdyYW5kZS1Cb2xk0iYnKClaJGNsYXNzbmFtZVgkY2xh - c3Nlc1ZOU0ZvbnSiKCpYTlNPYmplY3TTCiwtLi8wXE5TQ29sb3JT - cGFjZVdOU1doaXRlgAoQA0IwANImJzIzV05TQ29sb3KiMirSJic1 - NlxOU0RpY3Rpb25hcnmiNSrSJic4OV8QEk5TQXR0cmlidXRlZFN0 - cmluZ6I6Kl8QEk5TQXR0cmlidXRlZFN0cmluZ18QD05TS2V5ZWRB - cmNoaXZlctE9PlRyb290gAEACAARABoAIwAtADIANwBFAEsAUgBf - AGYAbwBxAHMAdQB/AIYAjgCZAJsAngCgAKIApQCnAKkAsAC4AMEA - yADPANgA2gDcAOUA6AD8AQEBDAEVARwBHwEoAS8BPAFEAUYBSAFL - AVABWAFbAWABbQFwAXUBigGNAaIBtAG3AbwAAAAAAAACAQAAAAAA - AAA/AAAAAAAAAAAAAAAAAAABvg== - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1638 - - - CF$UID - 1653 - - - CF$UID - 1654 - - - CF$UID - 1640 - - - CF$UID - 1655 - - - CF$UID - 1656 - - - NS.objects - - - CF$UID - 1657 - - - CF$UID - 163 - - - CF$UID - 1658 - - - CF$UID - 1660 - - - CF$UID - 163 - - - CF$UID - 163 - - - - IDEActivityReportStringSegmentType - IDEActivityReportStringSegmentDate - IDEActivityReportStringSegmentDateStyle - IDEActivityReportStringSegmentTimeStyle - 3 - - $class - - CF$UID - 1659 - - NS.time - 381083546.00637001 - - - $classes - - NSDate - NSObject - - $classname - NSDate - - Today at 16:32 - 234 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 3 - - - - - $class - - CF$UID - 39 - - NS.keys - - - CF$UID - 1664 - - - CF$UID - 1666 - - - CF$UID - 1668 - - - CF$UID - 1670 - - - CF$UID - 1672 - - - CF$UID - 1674 - - - CF$UID - 1676 - - - CF$UID - 1678 - - - CF$UID - 1680 - - - CF$UID - 1682 - - - CF$UID - 784 - - - CF$UID - 1684 - - - CF$UID - 1685 - - - CF$UID - 1687 - - - CF$UID - 1689 - - - CF$UID - 1691 - - - CF$UID - 1693 - - - CF$UID - 1695 - - - CF$UID - 907 - - - NS.objects - - - CF$UID - 1697 - - - CF$UID - 1702 - - - CF$UID - 1705 - - - CF$UID - 1708 - - - CF$UID - 1711 - - - CF$UID - 1714 - - - CF$UID - 1717 - - - CF$UID - 1720 - - - CF$UID - 1723 - - - CF$UID - 1726 - - - CF$UID - 1729 - - - CF$UID - 1734 - - - CF$UID - 1737 - - - CF$UID - 1740 - - - CF$UID - 1743 - - - CF$UID - 1746 - - - CF$UID - 1749 - - - CF$UID - 1752 - - - CF$UID - 1755 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1665 - - - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/GraphicsView.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1667 - - - file://localhost/Users/aleks/svn/tikzit/src/common/NodeStyle.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1669 - - - file://localhost/Users/aleks/svn/tikzit/English.lproj/TikzDocument.xib - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1671 - - - file://localhost/Users/aleks/svn/tikzit/src/common/Node.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1673 - - - file://localhost/Users/aleks/svn/tikzit/src/osx/PropertyInspectorController.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1675 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/osx/GraphicsView.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1677 - - - file://localhost/Users/aleks/svn/tikzit/English.lproj/StylePalette.xib - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1679 - - - file://localhost/Users/aleks/svn/tikzit/src/osx/StylePaletteController.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1681 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Edge.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1683 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/osx/Grid.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1518 - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1686 - - - file://localhost/Users/aleks/svn/tikzit/English.lproj/PropertyInspector.xib - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1688 - - - file://localhost/Users/aleks/svn/tikzit/tikzit/src/osx/PreviewController.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1690 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/TikzGraphAssembler.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1692 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/tikzlexer.lm - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1694 - - - file://localhost/Users/aleks/svn/tikzit/src/osx/NodeLayer.h - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1696 - - - file://localhost/Users/aleks/svn/tikzit/English.lproj/Preview.xib - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1700 - - - CF$UID - 1701 - - - - width - height - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1703 - - - CF$UID - 1704 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1706 - - - CF$UID - 1707 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1709 - - - CF$UID - 1710 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1712 - - - CF$UID - 1713 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1715 - - - CF$UID - 1716 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1718 - - - CF$UID - 1719 - - - - 1133 - 763 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1721 - - - CF$UID - 1722 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1724 - - - CF$UID - 1725 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1727 - - - CF$UID - 1728 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1730 - - - CF$UID - 1731 - - - NS.objects - - - CF$UID - 1732 - - - CF$UID - 1733 - - - - width - height - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1735 - - - CF$UID - 1736 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1738 - - - CF$UID - 1739 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1741 - - - CF$UID - 1742 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1744 - - - CF$UID - 1745 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1747 - - - CF$UID - 1748 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1750 - - - CF$UID - 1751 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1698 - - - CF$UID - 1699 - - - NS.objects - - - CF$UID - 1753 - - - CF$UID - 1754 - - - - 600 - 600 - - $class - - CF$UID - 35 - - NS.keys - - - CF$UID - 1730 - - - CF$UID - 1731 - - - NS.objects - - - CF$UID - 1756 - - - CF$UID - 1757 - - - - 600 - 600 - - $class - - CF$UID - 38 - - NS.objects - - - CF$UID - 1759 - - - CF$UID - 1761 - - - CF$UID - 1763 - - - CF$UID - 1765 - - - CF$UID - 1767 - - - CF$UID - 1769 - - - CF$UID - 1771 - - - CF$UID - 1772 - - - CF$UID - 1773 - - - CF$UID - 1774 - - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1760 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Graph.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1762 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/Edge.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1764 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/tikzparser.ym - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1766 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/tikzlexer.lm - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1768 - - - file://localhost/Users/aleks/git/tikzit/tikzit/src/common/TikzGraphAssembler.m - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1770 - - - file://localhost/Users/aleks/git/tikzit/tikzit/TikZiT-Info.plist - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1499 - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1683 - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 1675 - - - - $class - - CF$UID - 153 - - NS.base - - CF$UID - 0 - - NS.relative - - CF$UID - 365 - - - - $top - - State - - CF$UID - 1 - - - $version - 100000 - - diff --git a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/WorkspaceSettings.xcsettings b/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/WorkspaceSettings.xcsettings deleted file mode 100644 index c1034ce..0000000 --- a/tikzit-old/TikZiT.xcodeproj/project.xcworkspace/xcuserdata/aleks.xcuserdatad/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,22 +0,0 @@ - - - - - IDEWorkspaceUserSettings_BuildLocationStyle - 2 - IDEWorkspaceUserSettings_BuildSubfolderNameStyle - 0 - IDEWorkspaceUserSettings_DerivedDataLocationStyle - 0 - IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges - - IDEWorkspaceUserSettings_IssueFilterStyle - 0 - IDEWorkspaceUserSettings_LiveSourceIssuesEnabled - - IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges - - IDEWorkspaceUserSettings_SnapshotLocationStyle - 0 - - diff --git a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist deleted file mode 100644 index 5a56e60..0000000 --- a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/TikZiT.xcscheme b/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/TikZiT.xcscheme deleted file mode 100644 index 86e70a8..0000000 --- a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/TikZiT.xcscheme +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/tests.xcscheme b/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/tests.xcscheme deleted file mode 100644 index 9e1a430..0000000 --- a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/tests.xcscheme +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/xcschememanagement.plist b/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 3291a35..0000000 --- a/tikzit-old/TikZiT.xcodeproj/xcuserdata/aleks.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - SchemeUserState - - TikZiT.xcscheme - - orderHint - 1 - - tests.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 5589AA6411C5429C0064D310 - - primary - - - 8D15AC270486D014006FF6A4 - - primary - - - - - diff --git a/tikzit-old/TikZiT_Prefix.pch b/tikzit-old/TikZiT_Prefix.pch deleted file mode 100644 index 78e4d0f..0000000 --- a/tikzit-old/TikZiT_Prefix.pch +++ /dev/null @@ -1,30 +0,0 @@ -// -// TikZiT_Prefix.pch -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -// -// Prefix header for all source files of the 'TikZiT' target in the 'TikZiT' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/tikzit-old/autogen.sh b/tikzit-old/autogen.sh deleted file mode 100755 index 132ecd0..0000000 --- a/tikzit-old/autogen.sh +++ /dev/null @@ -1,1578 +0,0 @@ -#!/bin/sh -# a u t o g e n . s h -# -# Copyright (c) 2005-2009 United States Government as represented by -# the U.S. Army Research Laboratory. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# 3. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -### -# -# Script for automatically preparing the sources for compilation by -# performing the myriad of necessary steps. The script attempts to -# detect proper version support, and outputs warnings about particular -# systems that have autotool peculiarities. -# -# Basically, if everything is set up and installed correctly, the -# script will validate that minimum versions of the GNU Build System -# tools are installed, account for several common configuration -# issues, and then simply run autoreconf for you. -# -# If autoreconf fails, which can happen for many valid configurations, -# this script proceeds to run manual preparation steps effectively -# providing a POSIX shell script (mostly complete) reimplementation of -# autoreconf. -# -# The AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER -# environment variables and corresponding _OPTIONS variables (e.g. -# AUTORECONF_OPTIONS) may be used to override the default automatic -# detection behaviors. Similarly the _VERSION variables will override -# the minimum required version numbers. -# -# Examples: -# -# To obtain help on usage: -# ./autogen.sh --help -# -# To obtain verbose output: -# ./autogen.sh --verbose -# -# To skip autoreconf and prepare manually: -# AUTORECONF=false ./autogen.sh -# -# To verbosely try running with an older (unsupported) autoconf: -# AUTOCONF_VERSION=2.50 ./autogen.sh --verbose -# -# Author: -# Christopher Sean Morrison -# -# Patches: -# Sebastian Pipping -# -###################################################################### - -# set to minimum acceptable version of autoconf -if [ "x$AUTOCONF_VERSION" = "x" ] ; then - AUTOCONF_VERSION=2.60 -fi -# set to minimum acceptable version of automake -if [ "x$AUTOMAKE_VERSION" = "x" ] ; then - AUTOMAKE_VERSION=1.6.0 -fi -# set to minimum acceptable version of libtool -if [ "x$LIBTOOL_VERSION" = "x" ] ; then - LIBTOOL_VERSION=1.4.2 -fi - - -################## -# ident function # -################## -ident ( ) { - # extract copyright from header - __copyright="`grep Copyright $AUTOGEN_SH | head -${HEAD_N}1 | awk '{print $4}'`" - if [ "x$__copyright" = "x" ] ; then - __copyright="`date +%Y`" - fi - - # extract version from CVS Id string - __id="$Id: autogen.sh 33925 2009-03-01 23:27:06Z brlcad $" - __version="`echo $__id | sed 's/.*\([0-9][0-9][0-9][0-9]\)[-\/]\([0-9][0-9]\)[-\/]\([0-9][0-9]\).*/\1\2\3/'`" - if [ "x$__version" = "x" ] ; then - __version="" - fi - - echo "autogen.sh build preparation script by Christopher Sean Morrison" - echo " + config.guess download patch by Sebastian Pipping (2008-12-03)" - echo "revised 3-clause BSD-style license, copyright (c) $__copyright" - echo "script version $__version, ISO/IEC 9945 POSIX shell script" -} - - -################## -# USAGE FUNCTION # -################## -usage ( ) { - echo "Usage: $AUTOGEN_SH [-h|--help] [-v|--verbose] [-q|--quiet] [-d|--download] [--version]" - echo " --help Help on $NAME_OF_AUTOGEN usage" - echo " --verbose Verbose progress output" - echo " --quiet Quiet suppressed progress output" - echo " --download Download the latest config.guess from gnulib" - echo " --version Only perform GNU Build System version checks" - echo - echo "Description: This script will validate that minimum versions of the" - echo "GNU Build System tools are installed and then run autoreconf for you." - echo "Should autoreconf fail, manual preparation steps will be run" - echo "potentially accounting for several common preparation issues. The" - - echo "AUTORECONF, AUTOCONF, AUTOMAKE, LIBTOOLIZE, ACLOCAL, AUTOHEADER," - echo "PROJECT, & CONFIGURE environment variables and corresponding _OPTIONS" - echo "variables (e.g. AUTORECONF_OPTIONS) may be used to override the" - echo "default automatic detection behavior." - echo - - ident - - return 0 -} - - -########################## -# VERSION_ERROR FUNCTION # -########################## -version_error ( ) { - if [ "x$1" = "x" ] ; then - echo "INTERNAL ERROR: version_error was not provided a version" - exit 1 - fi - if [ "x$2" = "x" ] ; then - echo "INTERNAL ERROR: version_error was not provided an application name" - exit 1 - fi - $ECHO - $ECHO "ERROR: To prepare the ${PROJECT} build system from scratch," - $ECHO " at least version $1 of $2 must be installed." - $ECHO - $ECHO "$NAME_OF_AUTOGEN does not need to be run on the same machine that will" - $ECHO "run configure or make. Either the GNU Autotools will need to be installed" - $ECHO "or upgraded on this system, or $NAME_OF_AUTOGEN must be run on the source" - $ECHO "code on another system and then transferred to here. -- Cheers!" - $ECHO -} - -########################## -# VERSION_CHECK FUNCTION # -########################## -version_check ( ) { - if [ "x$1" = "x" ] ; then - echo "INTERNAL ERROR: version_check was not provided a minimum version" - exit 1 - fi - _min="$1" - if [ "x$2" = "x" ] ; then - echo "INTERNAL ERROR: version check was not provided a comparison version" - exit 1 - fi - _cur="$2" - - # needed to handle versions like 1.10 and 1.4-p6 - _min="`echo ${_min}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`" - _cur="`echo ${_cur}. | sed 's/[^0-9]/./g' | sed 's/\.\././g'`" - - _min_major="`echo $_min | cut -d. -f1`" - _min_minor="`echo $_min | cut -d. -f2`" - _min_patch="`echo $_min | cut -d. -f3`" - - _cur_major="`echo $_cur | cut -d. -f1`" - _cur_minor="`echo $_cur | cut -d. -f2`" - _cur_patch="`echo $_cur | cut -d. -f3`" - - if [ "x$_min_major" = "x" ] ; then - _min_major=0 - fi - if [ "x$_min_minor" = "x" ] ; then - _min_minor=0 - fi - if [ "x$_min_patch" = "x" ] ; then - _min_patch=0 - fi - if [ "x$_cur_minor" = "x" ] ; then - _cur_major=0 - fi - if [ "x$_cur_minor" = "x" ] ; then - _cur_minor=0 - fi - if [ "x$_cur_patch" = "x" ] ; then - _cur_patch=0 - fi - - $VERBOSE_ECHO "Checking if ${_cur_major}.${_cur_minor}.${_cur_patch} is greater than ${_min_major}.${_min_minor}.${_min_patch}" - - if [ $_min_major -lt $_cur_major ] ; then - return 0 - elif [ $_min_major -eq $_cur_major ] ; then - if [ $_min_minor -lt $_cur_minor ] ; then - return 0 - elif [ $_min_minor -eq $_cur_minor ] ; then - if [ $_min_patch -lt $_cur_patch ] ; then - return 0 - elif [ $_min_patch -eq $_cur_patch ] ; then - return 0 - fi - fi - fi - return 1 -} - - -###################################### -# LOCATE_CONFIGURE_TEMPLATE FUNCTION # -###################################### -locate_configure_template ( ) { - _pwd="`pwd`" - if test -f "./configure.ac" ; then - echo "./configure.ac" - elif test -f "./configure.in" ; then - echo "./configure.in" - elif test -f "$_pwd/configure.ac" ; then - echo "$_pwd/configure.ac" - elif test -f "$_pwd/configure.in" ; then - echo "$_pwd/configure.in" - elif test -f "$PATH_TO_AUTOGEN/configure.ac" ; then - echo "$PATH_TO_AUTOGEN/configure.ac" - elif test -f "$PATH_TO_AUTOGEN/configure.in" ; then - echo "$PATH_TO_AUTOGEN/configure.in" - fi -} - - -################## -# argument check # -################## -ARGS="$*" -PATH_TO_AUTOGEN="`dirname $0`" -NAME_OF_AUTOGEN="`basename $0`" -AUTOGEN_SH="$PATH_TO_AUTOGEN/$NAME_OF_AUTOGEN" - -LIBTOOL_M4="${PATH_TO_AUTOGEN}/misc/libtool.m4" - -if [ "x$HELP" = "x" ] ; then - HELP=no -fi -if [ "x$QUIET" = "x" ] ; then - QUIET=no -fi -if [ "x$VERBOSE" = "x" ] ; then - VERBOSE=no -fi -if [ "x$VERSION_ONLY" = "x" ] ; then - VERSION_ONLY=no -fi -if [ "x$DOWNLOAD" = "x" ] ; then - DOWNLOAD=no -fi -if [ "x$AUTORECONF_OPTIONS" = "x" ] ; then - AUTORECONF_OPTIONS="-i -f" -fi -if [ "x$AUTOCONF_OPTIONS" = "x" ] ; then - AUTOCONF_OPTIONS="-f" -fi -if [ "x$AUTOMAKE_OPTIONS" = "x" ] ; then - AUTOMAKE_OPTIONS="-a -c -f" -fi -ALT_AUTOMAKE_OPTIONS="-a -c" -if [ "x$LIBTOOLIZE_OPTIONS" = "x" ] ; then - LIBTOOLIZE_OPTIONS="--automake -c -f" -fi -ALT_LIBTOOLIZE_OPTIONS="--automake --copy --force" -if [ "x$ACLOCAL_OPTIONS" = "x" ] ; then - ACLOCAL_OPTIONS="" -fi -if [ "x$AUTOHEADER_OPTIONS" = "x" ] ; then - AUTOHEADER_OPTIONS="" -fi -if [ "x$CONFIG_GUESS_URL" = "x" ] ; then - CONFIG_GUESS_URL="http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/config.guess;hb=HEAD" -fi -for arg in $ARGS ; do - case "x$arg" in - x--help) HELP=yes ;; - x-[hH]) HELP=yes ;; - x--quiet) QUIET=yes ;; - x-[qQ]) QUIET=yes ;; - x--verbose) VERBOSE=yes ;; - x-[dD]) DOWNLOAD=yes ;; - x--download) DOWNLOAD=yes ;; - x-[vV]) VERBOSE=yes ;; - x--version) VERSION_ONLY=yes ;; - *) - echo "Unknown option: $arg" - echo - usage - exit 1 - ;; - esac -done - - -##################### -# environment check # -##################### - -# sanity check before recursions potentially begin -if [ ! -f "$AUTOGEN_SH" ] ; then - echo "INTERNAL ERROR: $AUTOGEN_SH does not exist" - if [ ! "x$0" = "x$AUTOGEN_SH" ] ; then - echo "INTERNAL ERROR: dirname/basename inconsistency: $0 != $AUTOGEN_SH" - fi - exit 1 -fi - -# force locale setting to C so things like date output as expected -LC_ALL=C - -# commands that this script expects -for __cmd in echo head tail pwd ; do - echo "test" | $__cmd > /dev/null 2>&1 - if [ $? != 0 ] ; then - echo "INTERNAL ERROR: '${__cmd}' command is required" - exit 2 - fi -done -echo "test" | grep "test" > /dev/null 2>&1 -if test ! x$? = x0 ; then - echo "INTERNAL ERROR: grep command is required" - exit 1 -fi -echo "test" | sed "s/test/test/" > /dev/null 2>&1 -if test ! x$? = x0 ; then - echo "INTERNAL ERROR: sed command is required" - exit 1 -fi - - -# determine the behavior of echo -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac - -# determine the behavior of head -case "x`echo 'head' | head -n 1 2>&1`" in - *xhead*) HEAD_N="n " ;; - *) HEAD_N="" ;; -esac - -# determine the behavior of tail -case "x`echo 'tail' | tail -n 1 2>&1`" in - *xtail*) TAIL_N="n " ;; - *) TAIL_N="" ;; -esac - -VERBOSE_ECHO=: -ECHO=: -if [ "x$QUIET" = "xyes" ] ; then - if [ "x$VERBOSE" = "xyes" ] ; then - echo "Verbose output quelled by quiet option. Further output disabled." - fi -else - ECHO=echo - if [ "x$VERBOSE" = "xyes" ] ; then - echo "Verbose output enabled" - VERBOSE_ECHO=echo - fi -fi - - -# allow a recursive run to disable further recursions -if [ "x$RUN_RECURSIVE" = "x" ] ; then - RUN_RECURSIVE=yes -fi - - -################################################ -# check for help arg and bypass version checks # -################################################ -if [ "x`echo $ARGS | sed 's/.*[hH][eE][lL][pP].*/help/'`" = "xhelp" ] ; then - HELP=yes -fi -if [ "x$HELP" = "xyes" ] ; then - usage - $ECHO "---" - $ECHO "Help was requested. No preparation or configuration will be performed." - exit 0 -fi - - -####################### -# set up signal traps # -####################### -untrap_abnormal ( ) { - for sig in 1 2 13 15; do - trap - $sig - done -} - -# do this cleanup whenever we exit. -trap ' - # start from the root - if test -d "$START_PATH" ; then - cd "$START_PATH" - fi - - # restore/delete backup files - if test "x$PFC_INIT" = "x1" ; then - recursive_restore - fi -' 0 - -# trap SIGHUP (1), SIGINT (2), SIGPIPE (13), SIGTERM (15) -for sig in 1 2 13 15; do - trap ' - $ECHO "" - $ECHO "Aborting $NAME_OF_AUTOGEN: caught signal '$sig'" - - # start from the root - if test -d "$START_PATH" ; then - cd "$START_PATH" - fi - - # clean up on abnormal exit - $VERBOSE_ECHO "rm -rf autom4te.cache" - rm -rf autom4te.cache - - if test -f "acinclude.m4.$$.backup" ; then - $VERBOSE_ECHO "cat acinclude.m4.$$.backup > acinclude.m4" - chmod u+w acinclude.m4 - cat acinclude.m4.$$.backup > acinclude.m4 - - $VERBOSE_ECHO "rm -f acinclude.m4.$$.backup" - rm -f acinclude.m4.$$.backup - fi - - { (exit 1); exit 1; } -' $sig -done - - -############################# -# look for a configure file # -############################# -if [ "x$CONFIGURE" = "x" ] ; then - CONFIGURE="`locate_configure_template`" - if [ ! "x$CONFIGURE" = "x" ] ; then - $VERBOSE_ECHO "Found a configure template: $CONFIGURE" - fi -else - $ECHO "Using CONFIGURE environment variable override: $CONFIGURE" -fi -if [ "x$CONFIGURE" = "x" ] ; then - if [ "x$VERSION_ONLY" = "xyes" ] ; then - CONFIGURE=/dev/null - else - $ECHO - $ECHO "A configure.ac or configure.in file could not be located implying" - $ECHO "that the GNU Build System is at least not used in this directory. In" - $ECHO "any case, there is nothing to do here without one of those files." - $ECHO - $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`" - exit 1 - fi -fi - -#################### -# get project name # -#################### -if [ "x$PROJECT" = "x" ] ; then - PROJECT="`grep AC_INIT $CONFIGURE | grep -v '.*#.*AC_INIT' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_INIT(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - if [ "x$PROJECT" = "xAC_INIT" ] ; then - # projects might be using the older/deprecated arg-less AC_INIT .. look for AM_INIT_AUTOMAKE instead - PROJECT="`grep AM_INIT_AUTOMAKE $CONFIGURE | grep -v '.*#.*AM_INIT_AUTOMAKE' | tail -${TAIL_N}1 | sed 's/^[ ]*AM_INIT_AUTOMAKE(\([^,)]*\).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - fi - if [ "x$PROJECT" = "xAM_INIT_AUTOMAKE" ] ; then - PROJECT="project" - fi - if [ "x$PROJECT" = "x" ] ; then - PROJECT="project" - fi -else - $ECHO "Using PROJECT environment variable override: $PROJECT" -fi -$ECHO "Preparing the $PROJECT build system...please wait" -$ECHO - - -######################## -# check for autoreconf # -######################## -HAVE_AUTORECONF=no -if [ "x$AUTORECONF" = "x" ] ; then - for AUTORECONF in autoreconf ; do - $VERBOSE_ECHO "Checking autoreconf version: $AUTORECONF --version" - $AUTORECONF --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - HAVE_AUTORECONF=yes - break - fi - done -else - HAVE_AUTORECONF=yes - $ECHO "Using AUTORECONF environment variable override: $AUTORECONF" -fi - - -########################## -# autoconf version check # -########################## -_acfound=no -if [ "x$AUTOCONF" = "x" ] ; then - for AUTOCONF in autoconf ; do - $VERBOSE_ECHO "Checking autoconf version: $AUTOCONF --version" - $AUTOCONF --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - _acfound=yes - break - fi - done -else - _acfound=yes - $ECHO "Using AUTOCONF environment variable override: $AUTOCONF" -fi - -_report_error=no -if [ ! "x$_acfound" = "xyes" ] ; then - $ECHO "ERROR: Unable to locate GNU Autoconf." - _report_error=yes -else - _version="`$AUTOCONF --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`" - if [ "x$_version" = "x" ] ; then - _version="0.0.0" - fi - $ECHO "Found GNU Autoconf version $_version" - version_check "$AUTOCONF_VERSION" "$_version" - if [ $? -ne 0 ] ; then - _report_error=yes - fi -fi -if [ "x$_report_error" = "xyes" ] ; then - version_error "$AUTOCONF_VERSION" "GNU Autoconf" - exit 1 -fi - - -########################## -# automake version check # -########################## -_amfound=no -if [ "x$AUTOMAKE" = "x" ] ; then - for AUTOMAKE in automake ; do - $VERBOSE_ECHO "Checking automake version: $AUTOMAKE --version" - $AUTOMAKE --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - _amfound=yes - break - fi - done -else - _amfound=yes - $ECHO "Using AUTOMAKE environment variable override: $AUTOMAKE" -fi - - -_report_error=no -if [ ! "x$_amfound" = "xyes" ] ; then - $ECHO - $ECHO "ERROR: Unable to locate GNU Automake." - _report_error=yes -else - _version="`$AUTOMAKE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`" - if [ "x$_version" = "x" ] ; then - _version="0.0.0" - fi - $ECHO "Found GNU Automake version $_version" - version_check "$AUTOMAKE_VERSION" "$_version" - if [ $? -ne 0 ] ; then - _report_error=yes - fi -fi -if [ "x$_report_error" = "xyes" ] ; then - version_error "$AUTOMAKE_VERSION" "GNU Automake" - exit 1 -fi - - -######################## -# check for libtoolize # -######################## -HAVE_LIBTOOLIZE=yes -HAVE_ALT_LIBTOOLIZE=no -_ltfound=no -if [ "x$LIBTOOLIZE" = "x" ] ; then - LIBTOOLIZE=libtoolize - $VERBOSE_ECHO "Checking libtoolize version: $LIBTOOLIZE --version" - $LIBTOOLIZE --version > /dev/null 2>&1 - if [ ! $? = 0 ] ; then - HAVE_LIBTOOLIZE=no - $ECHO - if [ "x$HAVE_AUTORECONF" = "xno" ] ; then - $ECHO "Warning: libtoolize does not appear to be available." - else - $ECHO "Warning: libtoolize does not appear to be available. This means that" - $ECHO "the automatic build preparation via autoreconf will probably not work." - $ECHO "Preparing the build by running each step individually, however, should" - $ECHO "work and will be done automatically for you if autoreconf fails." - fi - - # look for some alternates - for tool in glibtoolize libtoolize15 libtoolize14 libtoolize13 ; do - $VERBOSE_ECHO "Checking libtoolize alternate: $tool --version" - _glibtoolize="`$tool --version > /dev/null 2>&1`" - if [ $? = 0 ] ; then - $VERBOSE_ECHO "Found $tool --version" - _glti="`which $tool`" - if [ "x$_glti" = "x" ] ; then - $VERBOSE_ECHO "Cannot find $tool with which" - continue; - fi - if test ! -f "$_glti" ; then - $VERBOSE_ECHO "Cannot use $tool, $_glti is not a file" - continue; - fi - _gltidir="`dirname $_glti`" - if [ "x$_gltidir" = "x" ] ; then - $VERBOSE_ECHO "Cannot find $tool path with dirname of $_glti" - continue; - fi - if test ! -d "$_gltidir" ; then - $VERBOSE_ECHO "Cannot use $tool, $_gltidir is not a directory" - continue; - fi - HAVE_ALT_LIBTOOLIZE=yes - LIBTOOLIZE="$tool" - $ECHO - $ECHO "Fortunately, $tool was found which means that your system may simply" - $ECHO "have a non-standard or incomplete GNU Autotools install. If you have" - $ECHO "sufficient system access, it may be possible to quell this warning by" - $ECHO "running:" - $ECHO - sudo -V > /dev/null 2>&1 - if [ $? = 0 ] ; then - $ECHO " sudo ln -s $_glti $_gltidir/libtoolize" - $ECHO - else - $ECHO " ln -s $_glti $_gltidir/libtoolize" - $ECHO - $ECHO "Run that as root or with proper permissions to the $_gltidir directory" - $ECHO - fi - _ltfound=yes - break - fi - done - else - _ltfound=yes - fi -else - _ltfound=yes - $ECHO "Using LIBTOOLIZE environment variable override: $LIBTOOLIZE" -fi - - -############################ -# libtoolize version check # -############################ -_report_error=no -if [ ! "x$_ltfound" = "xyes" ] ; then - $ECHO - $ECHO "ERROR: Unable to locate GNU Libtool." - _report_error=yes -else - _version="`$LIBTOOLIZE --version | head -${HEAD_N}1 | sed 's/[^0-9]*\([0-9\.][0-9\.]*\)/\1/'`" - if [ "x$_version" = "x" ] ; then - _version="0.0.0" - fi - $ECHO "Found GNU Libtool version $_version" - version_check "$LIBTOOL_VERSION" "$_version" - if [ $? -ne 0 ] ; then - _report_error=yes - fi -fi -if [ "x$_report_error" = "xyes" ] ; then - version_error "$LIBTOOL_VERSION" "GNU Libtool" - exit 1 -fi - - -##################### -# check for aclocal # -##################### -if [ "x$ACLOCAL" = "x" ] ; then - for ACLOCAL in aclocal ; do - $VERBOSE_ECHO "Checking aclocal version: $ACLOCAL --version" - $ACLOCAL --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - break - fi - done -else - $ECHO "Using ACLOCAL environment variable override: $ACLOCAL" -fi - - -######################## -# check for autoheader # -######################## -if [ "x$AUTOHEADER" = "x" ] ; then - for AUTOHEADER in autoheader ; do - $VERBOSE_ECHO "Checking autoheader version: $AUTOHEADER --version" - $AUTOHEADER --version > /dev/null 2>&1 - if [ $? = 0 ] ; then - break - fi - done -else - $ECHO "Using AUTOHEADER environment variable override: $AUTOHEADER" -fi - - -######################### -# check if version only # -######################### -$VERBOSE_ECHO "Checking whether to only output version information" -if [ "x$VERSION_ONLY" = "xyes" ] ; then - $ECHO - ident - $ECHO "---" - $ECHO "Version requested. No preparation or configuration will be performed." - exit 0 -fi - - -################################# -# PROTECT_FROM_CLOBBER FUNCTION # -################################# -protect_from_clobber ( ) { - PFC_INIT=1 - - # protect COPYING & INSTALL from overwrite by automake. the - # automake force option will (inappropriately) ignore the existing - # contents of a COPYING and/or INSTALL files (depending on the - # version) instead of just forcing *missing* files like it does - # for AUTHORS, NEWS, and README. this is broken but extremely - # prevalent behavior, so we protect against it by keeping a backup - # of the file that can later be restored. - - for file in COPYING INSTALL ; do - if test -f ${file} ; then - if test -f ${file}.$$.protect_from_automake.backup ; then - $VERBOSE_ECHO "Already backed up ${file} in `pwd`" - else - $VERBOSE_ECHO "Backing up ${file} in `pwd`" - $VERBOSE_ECHO "cp -p ${file} ${file}.$$.protect_from_automake.backup" - cp -p ${file} ${file}.$$.protect_from_automake.backup - fi - fi - done -} - - -############################## -# RECURSIVE_PROTECT FUNCTION # -############################## -recursive_protect ( ) { - - # for projects using recursive configure, run the build - # preparation steps for the subdirectories. this function assumes - # START_PATH was set to pwd before recursion begins so that - # relative paths work. - - # git 'r done, protect COPYING and INSTALL from being clobbered - protect_from_clobber - - if test -d autom4te.cache ; then - $VERBOSE_ECHO "Found an autom4te.cache directory, deleting it" - $VERBOSE_ECHO "rm -rf autom4te.cache" - rm -rf autom4te.cache - fi - - # find configure template - _configure="`locate_configure_template`" - if [ "x$_configure" = "x" ] ; then - return - fi - # $VERBOSE_ECHO "Looking for configure template found `pwd`/$_configure" - - # look for subdirs - # $VERBOSE_ECHO "Looking for subdirs in `pwd`" - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - CHECK_DIRS="" - for dir in $_det_config_subdirs ; do - if test -d "`pwd`/$dir" ; then - CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\"" - fi - done - - # process subdirs - if [ ! "x$CHECK_DIRS" = "x" ] ; then - $VERBOSE_ECHO "Recursively scanning the following directories:" - $VERBOSE_ECHO " $CHECK_DIRS" - for dir in $CHECK_DIRS ; do - $VERBOSE_ECHO "Protecting files from automake in $dir" - cd "$START_PATH" - eval "cd $dir" - - # recursively git 'r done - recursive_protect - done - fi -} # end of recursive_protect - - -############################# -# RESTORE_CLOBBERED FUNCION # -############################# -restore_clobbered ( ) { - - # The automake (and autoreconf by extension) -f/--force-missing - # option may overwrite COPYING and INSTALL even if they do exist. - # Here we restore the files if necessary. - - spacer=no - - for file in COPYING INSTALL ; do - if test -f ${file}.$$.protect_from_automake.backup ; then - if test -f ${file} ; then - # compare entire content, restore if needed - if test "x`cat ${file}`" != "x`cat ${file}.$$.protect_from_automake.backup`" ; then - if test "x$spacer" = "xno" ; then - $VERBOSE_ECHO - spacer=yes - fi - # restore the backup - $VERBOSE_ECHO "Restoring ${file} from backup (automake -f likely clobbered it)" - $VERBOSE_ECHO "rm -f ${file}" - rm -f ${file} - $VERBOSE_ECHO "mv ${file}.$$.protect_from_automake.backup ${file}" - mv ${file}.$$.protect_from_automake.backup ${file} - fi # check contents - elif test -f ${file}.$$.protect_from_automake.backup ; then - $VERBOSE_ECHO "mv ${file}.$$.protect_from_automake.backup ${file}" - mv ${file}.$$.protect_from_automake.backup ${file} - fi # -f ${file} - - # just in case - $VERBOSE_ECHO "rm -f ${file}.$$.protect_from_automake.backup" - rm -f ${file}.$$.protect_from_automake.backup - fi # -f ${file}.$$.protect_from_automake.backup - done - - CONFIGURE="`locate_configure_template`" - if [ "x$CONFIGURE" = "x" ] ; then - return - fi - - _aux_dir="`grep AC_CONFIG_AUX_DIR $CONFIGURE | grep -v '.*#.*AC_CONFIG_AUX_DIR' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_CONFIG_AUX_DIR(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - if test ! -d "$_aux_dir" ; then - _aux_dir=. - fi - - for file in config.guess config.sub ltmain.sh ; do - if test -f "${_aux_dir}/${file}" ; then - $VERBOSE_ECHO "rm -f \"${_aux_dir}/${file}.backup\"" - rm -f "${_aux_dir}/${file}.backup" - fi - done -} # end of restore_clobbered - - -############################## -# RECURSIVE_RESTORE FUNCTION # -############################## -recursive_restore ( ) { - - # restore COPYING and INSTALL from backup if they were clobbered - # for each directory recursively. - - # git 'r undone - restore_clobbered - - # find configure template - _configure="`locate_configure_template`" - if [ "x$_configure" = "x" ] ; then - return - fi - - # look for subdirs - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $_configure | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - CHECK_DIRS="" - for dir in $_det_config_subdirs ; do - if test -d "`pwd`/$dir" ; then - CHECK_DIRS="$CHECK_DIRS \"`pwd`/$dir\"" - fi - done - - # process subdirs - if [ ! "x$CHECK_DIRS" = "x" ] ; then - $VERBOSE_ECHO "Recursively scanning the following directories:" - $VERBOSE_ECHO " $CHECK_DIRS" - for dir in $CHECK_DIRS ; do - $VERBOSE_ECHO "Checking files for automake damage in $dir" - cd "$START_PATH" - eval "cd $dir" - - # recursively git 'r undone - recursive_restore - done - fi -} # end of recursive_restore - - -####################### -# INITIALIZE FUNCTION # -####################### -initialize ( ) { - - # this routine performs a variety of directory-specific - # initializations. some are sanity checks, some are preventive, - # and some are necessary setup detection. - # - # this function sets: - # CONFIGURE - # SEARCH_DIRS - # CONFIG_SUBDIRS - - ################################## - # check for a configure template # - ################################## - CONFIGURE="`locate_configure_template`" - if [ "x$CONFIGURE" = "x" ] ; then - $ECHO - $ECHO "A configure.ac or configure.in file could not be located implying" - $ECHO "that the GNU Build System is at least not used in this directory. In" - $ECHO "any case, there is nothing to do here without one of those files." - $ECHO - $ECHO "ERROR: No configure.in or configure.ac file found in `pwd`" - exit 1 - fi - - ##################### - # detect an aux dir # - ##################### - _aux_dir="`grep AC_CONFIG_AUX_DIR $CONFIGURE | grep -v '.*#.*AC_CONFIG_AUX_DIR' | tail -${TAIL_N}1 | sed 's/^[ ]*AC_CONFIG_AUX_DIR(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - if test ! -d "$_aux_dir" ; then - _aux_dir=. - else - $VERBOSE_ECHO "Detected auxillary directory: $_aux_dir" - fi - - ################################ - # detect a recursive configure # - ################################ - CONFIG_SUBDIRS="" - _det_config_subdirs="`grep AC_CONFIG_SUBDIRS $CONFIGURE | grep -v '.*#.*AC_CONFIG_SUBDIRS' | sed 's/^[ ]*AC_CONFIG_SUBDIRS(\(.*\)).*/\1/' | sed 's/.*\[\(.*\)\].*/\1/'`" - for dir in $_det_config_subdirs ; do - if test -d "`pwd`/$dir" ; then - $VERBOSE_ECHO "Detected recursive configure directory: `pwd`/$dir" - CONFIG_SUBDIRS="$CONFIG_SUBDIRS `pwd`/$dir" - fi - done - - ########################################################### - # make sure certain required files exist for GNU projects # - ########################################################### - _marker_found="" - _marker_found_message_intro='Detected non-GNU marker "' - _marker_found_message_mid='" in ' - for marker in foreign cygnus ; do - _marker_found_message=${_marker_found_message_intro}${marker}${_marker_found_message_mid} - _marker_found="`grep 'AM_INIT_AUTOMAKE.*'${marker} $CONFIGURE`" - if [ ! "x$_marker_found" = "x" ] ; then - $VERBOSE_ECHO "${_marker_found_message}`basename \"$CONFIGURE\"`" - break - fi - if test -f "`dirname \"$CONFIGURE\"/Makefile.am`" ; then - _marker_found="`grep 'AUTOMAKE_OPTIONS.*'${marker} Makefile.am`" - if [ ! "x$_marker_found" = "x" ] ; then - $VERBOSE_ECHO "${_marker_found_message}Makefile.am" - break - fi - fi - done - if [ "x${_marker_found}" = "x" ] ; then - _suggest_foreign=no - for file in AUTHORS COPYING ChangeLog INSTALL NEWS README ; do - if [ ! -f $file ] ; then - $VERBOSE_ECHO "Touching ${file} since it does not exist" - _suggest_foreign=yes - touch $file - fi - done - - if [ "x${_suggest_foreign}" = "xyes" ] ; then - $ECHO - $ECHO "Warning: Several files expected of projects that conform to the GNU" - $ECHO "coding standards were not found. The files were automatically added" - $ECHO "for you since you do not have a 'foreign' declaration specified." - $ECHO - $ECHO "Considered adding 'foreign' to AM_INIT_AUTOMAKE in `basename \"$CONFIGURE\"`" - if test -f "`dirname \"$CONFIGURE\"/Makefile.am`" ; then - $ECHO "or to AUTOMAKE_OPTIONS in your top-level Makefile.am file." - fi - $ECHO - fi - fi - - ################################################## - # make sure certain generated files do not exist # - ################################################## - for file in config.guess config.sub ltmain.sh ; do - if test -f "${_aux_dir}/${file}" ; then - $VERBOSE_ECHO "mv -f \"${_aux_dir}/${file}\" \"${_aux_dir}/${file}.backup\"" - mv -f "${_aux_dir}/${file}" "${_aux_dir}/${file}.backup" - fi - done - - ############################ - # search alternate m4 dirs # - ############################ - SEARCH_DIRS="" - for dir in m4 ; do - if [ -d $dir ] ; then - $VERBOSE_ECHO "Found extra aclocal search directory: $dir" - SEARCH_DIRS="$SEARCH_DIRS -I $dir" - fi - done - - ###################################### - # remove any previous build products # - ###################################### - if test -d autom4te.cache ; then - $VERBOSE_ECHO "Found an autom4te.cache directory, deleting it" - $VERBOSE_ECHO "rm -rf autom4te.cache" - rm -rf autom4te.cache - fi -# tcl/tk (and probably others) have a customized aclocal.m4, so can't delete it -# if test -f aclocal.m4 ; then -# $VERBOSE_ECHO "Found an aclocal.m4 file, deleting it" -# $VERBOSE_ECHO "rm -f aclocal.m4" -# rm -f aclocal.m4 -# fi - -} # end of initialize() - - -############## -# initialize # -############## - -# stash path -START_PATH="`pwd`" - -# Before running autoreconf or manual steps, some prep detection work -# is necessary or useful. Only needs to occur once per directory, but -# does need to traverse the entire subconfigure hierarchy to protect -# files from being clobbered even by autoreconf. -recursive_protect - -# start from where we started -cd "$START_PATH" - -# get ready to process -initialize - - -######################################### -# DOWNLOAD_GNULIB_CONFIG_GUESS FUNCTION # -######################################### - -# TODO - should make sure wget/curl exist and/or work before trying to -# use them. - -download_gnulib_config_guess () { - # abuse gitweb to download gnulib's latest config.guess via HTTP - config_guess_temp="config.guess.$$.download" - ret=1 - for __cmd in wget curl fetch ; do - $VERBOSE_ECHO "Checking for command ${__cmd}" - ${__cmd} --version > /dev/null 2>&1 - ret=$? - if [ ! $ret = 0 ] ; then - continue - fi - - __cmd_version=`${__cmd} --version | head -n 1 | sed -e 's/^[^0-9]\+//' -e 's/ .*//'` - $VERBOSE_ECHO "Found ${__cmd} ${__cmd_version}" - - opts="" - case ${__cmd} in - wget) - opts="-O" - ;; - curl) - opts="-o" - ;; - fetch) - opts="-t 5 -f" - ;; - esac - - $VERBOSE_ECHO "Running $__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\"" - eval "$__cmd \"${CONFIG_GUESS_URL}\" $opts \"${config_guess_temp}\"" > /dev/null 2>&1 - if [ $? = 0 ] ; then - mv -f "${config_guess_temp}" ${_aux_dir}/config.guess - ret=0 - break - fi - done - - if [ ! $ret = 0 ] ; then - $ECHO "Warning: config.guess download failed from: $CONFIG_GUESS_URL" - rm -f "${config_guess_temp}" - fi -} - - -############################## -# LIBTOOLIZE_NEEDED FUNCTION # -############################## -libtoolize_needed () { - ret=1 # means no, don't need libtoolize - for feature in AC_PROG_LIBTOOL AM_PROG_LIBTOOL LT_INIT ; do - $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" - found="`grep \"^$feature.*\" $CONFIGURE`" - if [ ! "x$found" = "x" ] ; then - ret=0 # means yes, need to run libtoolize - break - fi - done - return ${ret} -} - - - -############################################ -# prepare build via autoreconf or manually # -############################################ -reconfigure_manually=no -if [ "x$HAVE_AUTORECONF" = "xyes" ] ; then - $ECHO - $ECHO $ECHO_N "Automatically preparing build ... $ECHO_C" - - $VERBOSE_ECHO "$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS" - autoreconf_output="`$AUTORECONF $SEARCH_DIRS $AUTORECONF_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$autoreconf_output" - - if [ ! $ret = 0 ] ; then - if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then - if [ ! "x`echo \"$autoreconf_output\" | grep libtoolize | grep \"No such file or directory\"`" = "x" ] ; then - $ECHO - $ECHO "Warning: autoreconf failed but due to what is usually a common libtool" - $ECHO "misconfiguration issue. This problem is encountered on systems that" - $ECHO "have installed libtoolize under a different name without providing a" - $ECHO "symbolic link or without setting the LIBTOOLIZE environment variable." - $ECHO - $ECHO "Restarting the preparation steps with LIBTOOLIZE set to $LIBTOOLIZE" - - export LIBTOOLIZE - RUN_RECURSIVE=no - export RUN_RECURSIVE - untrap_abnormal - - $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - exit $? - fi - fi - - $ECHO "Warning: $AUTORECONF failed" - - if test -f ltmain.sh ; then - $ECHO "libtoolize being run by autoreconf is not creating ltmain.sh in the auxillary directory like it should" - fi - - $ECHO "Attempting to run the preparation steps individually" - reconfigure_manually=yes - else - if [ "x$DOWNLOAD" = "xyes" ] ; then - if libtoolize_needed ; then - download_gnulib_config_guess - fi - fi - fi -else - reconfigure_manually=yes -fi - - -############################ -# LIBTOOL_FAILURE FUNCTION # -############################ -libtool_failure ( ) { - - # libtool is rather error-prone in comparison to the other - # autotools and this routine attempts to compensate for some - # common failures. the output after a libtoolize failure is - # parsed for an error related to AC_PROG_LIBTOOL and if found, we - # attempt to inject a project-provided libtool.m4 file. - - _autoconf_output="$1" - - if [ "x$RUN_RECURSIVE" = "xno" ] ; then - # we already tried the libtool.m4, don't try again - return 1 - fi - - if test -f "$LIBTOOL_M4" ; then - found_libtool="`$ECHO $_autoconf_output | grep AC_PROG_LIBTOOL`" - if test ! "x$found_libtool" = "x" ; then - if test -f acinclude.m4 ; then - rm -f acinclude.m4.$$.backup - $VERBOSE_ECHO "cat acinclude.m4 > acinclude.m4.$$.backup" - cat acinclude.m4 > acinclude.m4.$$.backup - fi - $VERBOSE_ECHO "cat \"$LIBTOOL_M4\" >> acinclude.m4" - chmod u+w acinclude.m4 - cat "$LIBTOOL_M4" >> acinclude.m4 - - # don't keep doing this - RUN_RECURSIVE=no - export RUN_RECURSIVE - untrap_abnormal - - $ECHO - $ECHO "Restarting the preparation steps with libtool macros in acinclude.m4" - $VERBOSE_ECHO sh $AUTOGEN_SH "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - sh "$AUTOGEN_SH" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" - exit $? - fi - fi -} - - -########################### -# MANUAL_AUTOGEN FUNCTION # -########################### -manual_autogen ( ) { - - ################################################## - # Manual preparation steps taken are as follows: # - # aclocal [-I m4] # - # libtoolize --automake -c -f # - # aclocal [-I m4] # - # autoconf -f # - # autoheader # - # automake -a -c -f # - ################################################## - - ########### - # aclocal # - ########### - $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS" - aclocal_output="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$aclocal_output" - if [ ! $ret = 0 ] ; then $ECHO "ERROR: $ACLOCAL failed" && exit 2 ; fi - - ############## - # libtoolize # - ############## - if libtoolize_needed ; then - if [ "x$HAVE_LIBTOOLIZE" = "xyes" ] ; then - $VERBOSE_ECHO "$LIBTOOLIZE $LIBTOOLIZE_OPTIONS" - libtoolize_output="`$LIBTOOLIZE $LIBTOOLIZE_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$libtoolize_output" - - if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi - else - if [ "x$HAVE_ALT_LIBTOOLIZE" = "xyes" ] ; then - $VERBOSE_ECHO "$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS" - libtoolize_output="`$LIBTOOLIZE $ALT_LIBTOOLIZE_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$libtoolize_output" - - if [ ! $ret = 0 ] ; then $ECHO "ERROR: $LIBTOOLIZE failed" && exit 2 ; fi - fi - fi - - ########### - # aclocal # - ########### - # re-run again as instructed by libtoolize - $VERBOSE_ECHO "$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS" - aclocal_output="`$ACLOCAL $SEARCH_DIRS $ACLOCAL_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$aclocal_output" - - # libtoolize might put ltmain.sh in the wrong place - if test -f ltmain.sh ; then - if test ! -f "${_aux_dir}/ltmain.sh" ; then - $ECHO - $ECHO "Warning: $LIBTOOLIZE is creating ltmain.sh in the wrong directory" - $ECHO - $ECHO "Fortunately, the problem can be worked around by simply copying the" - $ECHO "file to the appropriate location (${_aux_dir}/). This has been done for you." - $ECHO - $VERBOSE_ECHO "cp -p ltmain.sh \"${_aux_dir}/ltmain.sh\"" - cp -p ltmain.sh "${_aux_dir}/ltmain.sh" - $ECHO $ECHO_N "Continuing build preparation ... $ECHO_C" - fi - fi # ltmain.sh - - if [ "x$DOWNLOAD" = "xyes" ] ; then - download_gnulib_config_guess - fi - fi # libtoolize_needed - - ############ - # autoconf # - ############ - $VERBOSE_ECHO - $VERBOSE_ECHO "$AUTOCONF $AUTOCONF_OPTIONS" - autoconf_output="`$AUTOCONF $AUTOCONF_OPTIONS 2>&1`" - ret=$? - $VERBOSE_ECHO "$autoconf_output" - - if [ ! $ret = 0 ] ; then - # retry without the -f and check for usage of macros that are too new - ac2_59_macros="AC_C_RESTRICT AC_INCLUDES_DEFAULT AC_LANG_ASSERT AC_LANG_WERROR AS_SET_CATFILE" - ac2_55_macros="AC_COMPILER_IFELSE AC_FUNC_MBRTOWC AC_HEADER_STDBOOL AC_LANG_CONFTEST AC_LANG_SOURCE AC_LANG_PROGRAM AC_LANG_CALL AC_LANG_FUNC_TRY_LINK AC_MSG_FAILURE AC_PREPROC_IFELSE" - ac2_54_macros="AC_C_BACKSLASH_A AC_CONFIG_LIBOBJ_DIR AC_GNU_SOURCE AC_PROG_EGREP AC_PROG_FGREP AC_REPLACE_FNMATCH AC_FUNC_FNMATCH_GNU AC_FUNC_REALLOC AC_TYPE_MBSTATE_T" - - macros_to_search="" - ac_major="`echo ${AUTOCONF_VERSION}. | cut -d. -f1 | sed 's/[^0-9]//g'`" - ac_minor="`echo ${AUTOCONF_VERSION}. | cut -d. -f2 | sed 's/[^0-9]//g'`" - - if [ $ac_major -lt 2 ] ; then - macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros" - else - if [ $ac_minor -lt 54 ] ; then - macros_to_search="$ac2_59_macros $ac2_55_macros $ac2_54_macros" - elif [ $ac_minor -lt 55 ] ; then - macros_to_search="$ac2_59_macros $ac2_55_macros" - elif [ $ac_minor -lt 59 ] ; then - macros_to_search="$ac2_59_macros" - fi - fi - - configure_ac_macros=__none__ - for feature in $macros_to_search ; do - $VERBOSE_ECHO "Searching for $feature in $CONFIGURE" - found="`grep \"^$feature.*\" $CONFIGURE`" - if [ ! "x$found" = "x" ] ; then - if [ "x$configure_ac_macros" = "x__none__" ] ; then - configure_ac_macros="$feature" - else - configure_ac_macros="$feature $configure_ac_macros" - fi - fi - done - if [ ! "x$configure_ac_macros" = "x__none__" ] ; then - $ECHO - $ECHO "Warning: Unsupported macros were found in $CONFIGURE" - $ECHO - $ECHO "The `basename \"$CONFIGURE\"` file was scanned in order to determine if any" - $ECHO "unsupported macros are used that exceed the minimum version" - $ECHO "settings specified within this file. As such, the following macros" - $ECHO "should be removed from configure.ac or the version numbers in this" - $ECHO "file should be increased:" - $ECHO - $ECHO "$configure_ac_macros" - $ECHO - $ECHO $ECHO_N "Ignorantly continuing build preparation ... $ECHO_C" - fi - - ################### - # autoconf, retry # - ################### - $VERBOSE_ECHO - $VERBOSE_ECHO "$AUTOCONF" - autoconf_output="`$AUTOCONF 2>&1`" - ret=$? - $VERBOSE_ECHO "$autoconf_output" - - if [ ! $ret = 0 ] ; then - # test if libtool is busted - libtool_failure "$autoconf_output" - - # let the user know what went wrong - cat < -Provides: tikzit -Description: TikZiT is a GTK+ application that allows the creation and modification of TeX diagrams written using the pgf/TikZ macro library. It is especially geared toward rapidly creating "dot"-diagrams for use in academic papers. diff --git a/tikzit-old/configure.ac b/tikzit-old/configure.ac deleted file mode 100644 index a86156b..0000000 --- a/tikzit-old/configure.ac +++ /dev/null @@ -1,141 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.60]) -AC_INIT([TikZiT], [1.1], - [http://sourceforge.net/apps/trac/tikzit], - [tikzit], - [http://tikzit.sourceforge.net]) -AM_INIT_AUTOMAKE([1.10 foreign subdir-objects -Wall -Werror]) -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -AC_OUTPUT(Makefile - src/Makefile - share/Makefile -) -AC_CONFIG_SRCDIR([src/gtk/main.m]) - -m4_include([m4/objc.m4]) - -# Checks for programs. -AC_PROG_OBJC([gcc clang objc objcc]) -AC_LANG([Objective C]) - -AC_CHECK_PROGS([FLEX], [flex lex], [flex]) -AS_IF([$FLEX --version 2>/dev/null | grep "^flex" >/dev/null 2>/dev/null],[], - [ - AC_MSG_WARN([flex not found; this may cause problems for developers]) - # in case a lex that wasn't flex was found - FLEX=flex - ]) -AM_MISSING_PROG([LEX], [$FLEX]) - -AC_CHECK_PROGS([BISON], [bison yacc], [bison]) -AS_IF([$BISON --version 2>/dev/null | grep "^bison" >/dev/null 2>/dev/null],[], - [ - AC_MSG_WARN([bison not found; this may cause problems for developers]) - # in case a yacc that wasn't bison was found - BISON=bison - ]) -AM_MISSING_PROG([YACC], [$BISON]) - -# Checks for libraries. -FOUNDATION_OBJCFLAGS=`eval "gnustep-config --objc-flags"` -AS_IF([test "x$FOUNDATION_OBJCFLAGS" = "x"], - [AC_MSG_ERROR([GNUstep not found])]) -FOUNDATION_LIBS=`eval "gnustep-config --base-libs"` -AS_IF([test "x$FOUNDATION_LIBS" = "x"], - [AC_MSG_ERROR([GNUstep not found])]) -AC_SUBST([FOUNDATION_OBJCFLAGS]) -AC_SUBST([FOUNDATION_LIBS]) - -TZ_TEST_OBJCFLAGS="$FOUNDATION_OBJCFLAGS" -TZ_TEST_LDFLAGS="$FOUNDATION_LIBS" - -TZ_OBJC_FOUNDATION -AS_IF([test "x$tz_cv_objc_foundation" != "xyes"], - [AC_MSG_ERROR([Objective C Foundation not found -- missing gnustep-base(-devel)?])]) - -AC_ARG_WITH([poppler], AS_HELP_STRING([--without-poppler], [Ignore presence of poppler, disabling preview support])) - -AS_IF([test "x$with_poppler" != "xno"], - [ - AC_MSG_CHECKING([for poppler-glib]) - PKG_CHECK_EXISTS([poppler-glib >= 0.10], - [have_poppler=yes], - [have_poppler=no]) - AS_IF([test "x$have_poppler" = "xyes"], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_POPPLER, 1) - ], - [ - AC_MSG_RESULT([no]) - AS_IF([test "x$with_poppler" = "xyes"], - [AC_MSG_ERROR([poppler requested but not found (note that poppler-glib is required)])] - ) - ]) - ], - [have_poppler=no]) -AM_CONDITIONAL([HAVE_POPPLER],[test "x$have_poppler" = "xyes"]) - -# Test all the pkg-config stuff together, so that -# dependencies and duplicate flags are correctly handled -AS_IF([test "x$have_poppler" = "xyes"], - [PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.18.0 gdk-pixbuf-2.0 >= 2.16.0 pango >= 1.16 cairo >= 1.4 poppler-glib >= 0.10])], - [PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.18.0 gdk-pixbuf-2.0 >= 2.16.0 pango >= 1.16 cairo >= 1.4])]) - -# Checks for header files. -AC_FUNC_ALLOCA -AC_CHECK_HEADERS([inttypes.h libintl.h limits.h malloc.h stddef.h stdint.h stdlib.h string.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT8_T -AC_TYPE_SIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_UINT8_T -AC_HEADER_STDBOOL -AC_HEADER_STAT -AC_CHECK_HEADERS([stdint.h inttypes.h unistd.h sys/time.h time.h]) - -# Checks for library functions. -AC_FUNC_MALLOC -AC_FUNC_REALLOC -AC_CHECK_FUNCS([floor gettimeofday memset mkdtemp sqrt strdup]) - -TZ_OBJC2_FEATURES -AS_IF([test "x$tz_cv_objc_properties$tz_cv_objc_fast_enumeration$tz_cv_objc_optional_keyword" != "xyesyesyes"], - [AC_MSG_ERROR([Your Objective C compiler does not support the required Objective C 2 features])]) - -dnl ---------------------------------------------------------------------------- -dnl -dnl platform-specific stuff. - -AC_CANONICAL_HOST -have_msw="no" -case $host_os in - - *mingw32*) - have_msw="yes" - OBJCFLAGS="$OBJCFLAGS -mwindows" - AC_SUBST([WINDOWS]) - AC_SUBST([WIN32]) - AC_SUBST([_WIN32]) - ;; - -esac - -AM_CONDITIONAL([WINDOWS],[test "x$have_msw" = "xyes"]) - -AS_IF([test "x$with_poppler" != "xno"], - [AS_IF([test "x$have_poppler" != "xyes"], - AC_MSG_WARN([poppler-glib was not found; preview support will be disabled]) - )] - ) - -AC_OUTPUT - -# vi:sts=2:sw=2:et diff --git a/tikzit-old/customshape.png b/tikzit-old/customshape.png deleted file mode 100755 index cff8275..0000000 Binary files a/tikzit-old/customshape.png and /dev/null differ diff --git a/tikzit-old/docs/Doxyfile b/tikzit-old/docs/Doxyfile deleted file mode 100644 index 70a27f7..0000000 --- a/tikzit-old/docs/Doxyfile +++ /dev/null @@ -1,1600 +0,0 @@ -# Doxyfile 1.6.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = TikZiT - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.3 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doxygen - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = /Applications/ - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it parses. -# With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this tag. -# The format is ext=language, where ext is a file extension, and language is one of -# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, -# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat -# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. Note that for custom extensions you also need to set -# FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = YES - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by -# doxygen. The layout file controls the global structure of the generated output files -# in an output format independent way. The create the layout file that represents -# doxygen's defaults, run doxygen with the -l option. You can optionally specify a -# file name after the option, if omitted DoxygenLayout.xml will be used as the name -# of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.vhd \ - *.vhdl - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = ../src/ParseKit - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER -# are set, an additional index file will be generated that can be used as input for -# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated -# HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. -# For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's -# filter section matches. -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = YES - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = __APPLE__ - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = /Applications/Doxygen.app/Contents/Resources/ - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = /Applications/Doxygen.app/Contents/Resources/ - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 1000 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/tikzit-old/draw-ellipse.png b/tikzit-old/draw-ellipse.png deleted file mode 100644 index d8e3e6f..0000000 Binary files a/tikzit-old/draw-ellipse.png and /dev/null differ diff --git a/tikzit-old/draw-path.png b/tikzit-old/draw-path.png deleted file mode 100644 index ec5e691..0000000 Binary files a/tikzit-old/draw-path.png and /dev/null differ diff --git a/tikzit-old/emblem-important.png b/tikzit-old/emblem-important.png deleted file mode 100644 index 81e9ed2..0000000 Binary files a/tikzit-old/emblem-important.png and /dev/null differ diff --git a/tikzit-old/emblem-unreadable-grey.png b/tikzit-old/emblem-unreadable-grey.png deleted file mode 100644 index 09572ab..0000000 Binary files a/tikzit-old/emblem-unreadable-grey.png and /dev/null differ diff --git a/tikzit-old/engine.png b/tikzit-old/engine.png deleted file mode 100755 index 1e45370..0000000 Binary files a/tikzit-old/engine.png and /dev/null differ diff --git a/tikzit-old/format-indent-less.png b/tikzit-old/format-indent-less.png deleted file mode 100644 index 7ced16f..0000000 Binary files a/tikzit-old/format-indent-less.png and /dev/null differ diff --git a/tikzit-old/m4/objc.m4 b/tikzit-old/m4/objc.m4 deleted file mode 100644 index 8c7cc78..0000000 --- a/tikzit-old/m4/objc.m4 +++ /dev/null @@ -1,135 +0,0 @@ -# Checks for a working Foundation -# tz_cv_objc_foundation -# to either "yes" or "no" -# -AC_DEFUN([TZ_OBJC_FOUNDATION], -[ -AC_LANG_ASSERT([Objective C]) -tz_old_objcflags="$OBJCFLAGS" -OBJCFLAGS="$OBJCFLAGS $TZ_TEST_OBJCFLAGS" - -AC_CACHE_CHECK([for Objective C Foundation], - [tz_cv_objc_foundation], -[AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ -#import - -@interface TestObj : NSObject { - int intVar; - NSObject *objVar; - NSString *strVar; -} --(id)init; -@end - -@implementation TestObj --(id)init { - self = [super init]; - intVar = 0; - objVar = nil; - strVar = @"Foo"; - return self; -} -@end - -int main(void) { - TestObj *obj = [[TestObj alloc] init]; - [obj release]; - return 0; -} - ]])], - [tz_cv_objc_foundation=yes], - [tz_cv_objc_foundation=no])]) - -OBJCFLAGS="$tz_old_objcflags" -]) - - -# Checks for Objective C 2 feature support -# and sets the shell variables -# tz_cv_objc_properties -# tz_cv_objc_fast_enumeration -# tz_cv_objc_optional_keyword -# to either "yes" or "no" -# -AC_DEFUN([TZ_OBJC2_FEATURES], -[ -AC_LANG_ASSERT([Objective C]) -tz_old_objcflags="$OBJCFLAGS" -OBJCFLAGS="$OBJCFLAGS $TZ_TEST_OBJCFLAGS" - -AC_CACHE_CHECK([for Objective C 2 @property support], - [tz_cv_objc_properties], -[AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ -#import - -@interface TestObj : NSObject { - int intProp1; - NSObject *copyObjProp; - NSObject *fooProp; -} -@property (assign,nonatomic) int intProp; -@property (retain,readonly) NSObject *retainObjProp; -@property (copy,readwrite) NSObject *copyObjProp; -@property (retain,getter=foo,setter=foo1:) NSObject *fooProp; -@end - -@implementation TestObj -@synthesize intProp=intProp1; -@dynamic retainObjProp; -- (NSObject*) retainObjProp { return nil; } -@synthesize copyObjProp; -@synthesize fooProp; -@end - -int main(void) { - TestObj *obj = [[TestObj alloc] init]; - obj.intProp = 4; - NSObject *result = obj.retainObjProp; - return 0; -} - ]])], - [tz_cv_objc_properties=yes], - [tz_cv_objc_properties=no])]) - - -AC_CACHE_CHECK([for Objective C 2 fast enumeration support], - [tz_cv_objc_fast_enumeration], -[AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ -#import - -int main(void) { - NSArray *array = [NSArray arrayWithObjects: @"One", @"Two", @"Three", @"Four", nil]; - for (NSString *element in array) { - NSLog(@"element: %@", element); - } - return 0; -} - ]])], - [tz_cv_objc_fast_enumeration=yes], - [tz_cv_objc_fast_enumeration=no])]) - -AC_CACHE_CHECK([for Objective C 2 @optional support], - [tz_cv_objc_optional_keyword], -[AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([[ -#import - -@protocol Foo -@optional -- (void) foo; -@required -- (void) bar; -@end - -int main(void) { - return 0; -} - ]])], - [tz_cv_objc_optional_keyword=yes], - [tz_cv_objc_optional_keyword=no])]) - -OBJCFLAGS="$tz_old_objcflags" -]) diff --git a/tikzit-old/preamble.png b/tikzit-old/preamble.png deleted file mode 100755 index d940d24..0000000 Binary files a/tikzit-old/preamble.png and /dev/null differ diff --git a/tikzit-old/scripts/generate_keys.rb b/tikzit-old/scripts/generate_keys.rb deleted file mode 100755 index b22439c..0000000 --- a/tikzit-old/scripts/generate_keys.rb +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/ruby -["dsaparam.pem", "dsa_priv.pem", "dsa_pub.pem"].each do |file| - if File.exist? file - puts "There's already a #{file} here! Move it aside or be more careful!" - end -end -`openssl dsaparam 2048 < /dev/urandom > dsaparam.pem` -`openssl gendsa dsaparam.pem -out dsa_priv.pem` -`openssl dsa -in dsa_priv.pem -pubout -out dsa_pub.pem` -`rm dsaparam.pem` -puts "\nGenerated private and public keys: dsa_priv.pem and dsa_pub.pem.\n -BACK UP YOUR PRIVATE KEY AND KEEP IT SAFE!\n -If you lose it, your users will be unable to upgrade!\n" \ No newline at end of file diff --git a/tikzit-old/scripts/prepare_release.sh b/tikzit-old/scripts/prepare_release.sh deleted file mode 100755 index 5f5edfc..0000000 --- a/tikzit-old/scripts/prepare_release.sh +++ /dev/null @@ -1,40 +0,0 @@ -set -o errexit - -PROJECT_NAME=TikZiT -APP_BUNDLE=xbuild/Release/$PROJECT_NAME.app - -VERSION=$(defaults read "$(pwd)/$APP_BUNDLE/Contents/Info" CFBundleVersion) -DOWNLOAD_BASE_URL="http://tikzit.sourceforge.net/appcast" -RELEASENOTES_URL="$DOWNLOAD_BASE_URL/rnotes.html" - -ARCHIVE_FILENAME="$PROJECT_NAME $VERSION.tar.bz2" -ARCHIVE_PATH="../www/htdocs/appcast/files/$ARCHIVE_FILENAME" -DOWNLOAD_URL="$DOWNLOAD_BASE_URL/files/$ARCHIVE_FILENAME" - -if [ -e "$ARCHIVE_PATH" ]; then - echo 'Archive already exists. Either remove this archive or increment version.' - exit 1 -fi - -tar cjf "$ARCHIVE_PATH" "$APP_BUNDLE" - -SIZE=$(stat -f %z "$ARCHIVE_PATH") -PUBDATE=$(LC_TIME=en_US date +"%a, %d %b %G %T %z") -SIGNATURE=$(scripts/sign_update.rb "$ARCHIVE_PATH" tikzit_dsa_priv.pem) - -cat < - Version $VERSION - - $RELEASENOTES_URL - - $PUBDATE - - -EOF diff --git a/tikzit-old/scripts/sign_update.rb b/tikzit-old/scripts/sign_update.rb deleted file mode 100755 index 6d03e2e..0000000 --- a/tikzit-old/scripts/sign_update.rb +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/ruby -if ARGV.length < 2 - puts "Usage: ruby sign_update.rb update_archive private_key" - exit -end - -puts `openssl dgst -sha1 -binary < "#{ARGV[0]}" | openssl dgst -dss1 -sign "#{ARGV[1]}" | openssl enc -base64` \ No newline at end of file diff --git a/tikzit-old/select-rectangular.png b/tikzit-old/select-rectangular.png deleted file mode 100644 index 866b602..0000000 Binary files a/tikzit-old/select-rectangular.png and /dev/null differ diff --git a/tikzit-old/shapes/cap.tikz b/tikzit-old/shapes/cap.tikz deleted file mode 100644 index a98ff39..0000000 --- a/tikzit-old/shapes/cap.tikz +++ /dev/null @@ -1,13 +0,0 @@ -\begin{tikzpicture} - \path [use as bounding box] (-2,-2) rectangle (2,2); - \begin{pgfonlayer}{nodelayer} - \node [style=none] (0) at (0, 0.75) {}; - \node [style=none] (1) at (-0.5, 0) {}; - \node [style=none] (2) at (0.5, 0) {}; - \end{pgfonlayer} - \begin{pgfonlayer}{edgelayer} - \draw [in=0, out=90] (2.center) to (0.center); - \draw [in=270, out=-90, looseness=0.75] (1.center) to (2.center); - \draw [in=90, out=180] (0.center) to (1.center); - \end{pgfonlayer} -\end{tikzpicture} \ No newline at end of file diff --git a/tikzit-old/shapes/copants.tikz b/tikzit-old/shapes/copants.tikz deleted file mode 100644 index d2b8e3c..0000000 --- a/tikzit-old/shapes/copants.tikz +++ /dev/null @@ -1,19 +0,0 @@ -\begin{tikzpicture} - \path [use as bounding box] (-2,-2) rectangle (2,2); - \begin{pgfonlayer}{nodelayer} - \node [style=none] (0) at (-1.5, 1) {}; - \node [style=none] (1) at (-0.5, 1) {}; - \node [style=none] (2) at (0.5, 1) {}; - \node [style=none] (3) at (1.5, 1) {}; - \node [style=none] (4) at (-0.5, -1) {}; - \node [style=none] (5) at (0.5, -1) {}; - \end{pgfonlayer} - \begin{pgfonlayer}{edgelayer} - \draw [in=-90, out=90, looseness=0.75] (5.center) to (3.center); - \draw [in=90, out=90, looseness=0.75] (4.center) to (5.center); - \draw [in=270, out=-90, looseness=0.75] (1.center) to (0.center); - \draw [in=270, out=-90, looseness=0.75] (3.center) to (2.center); - \draw [in=-270, out=-90, looseness=0.75] (0.center) to (4.center); - \draw [in=-90, out=-90, looseness=1.75] (2.center) to (1.center); - \end{pgfonlayer} -\end{tikzpicture} \ No newline at end of file diff --git a/tikzit-old/shapes/cup.tikz b/tikzit-old/shapes/cup.tikz deleted file mode 100644 index 1dc1faa..0000000 --- a/tikzit-old/shapes/cup.tikz +++ /dev/null @@ -1,13 +0,0 @@ -\begin{tikzpicture} - \path [use as bounding box] (-2,-2) rectangle (2,2); - \begin{pgfonlayer}{nodelayer} - \node [style=none] (0) at (-0.5, 0) {}; - \node [style=none] (1) at (0.5, 0) {}; - \node [style=none] (2) at (0, -0.75) {}; - \end{pgfonlayer} - \begin{pgfonlayer}{edgelayer} - \draw [in=0, out=-90] (1.center) to (2.center); - \draw [in=-270, out=90, looseness=0.75] (0.center) to (1.center); - \draw [in=-90, out=-180] (2.center) to (0.center); - \end{pgfonlayer} -\end{tikzpicture} \ No newline at end of file diff --git a/tikzit-old/shapes/oval.tikz b/tikzit-old/shapes/oval.tikz deleted file mode 100644 index b5d2891..0000000 --- a/tikzit-old/shapes/oval.tikz +++ /dev/null @@ -1,11 +0,0 @@ -\begin{tikzpicture} - \path [use as bounding box] (-2,-2) rectangle (2,2); - \begin{pgfonlayer}{nodelayer} - \node [style=none] (0) at (-0.5, 0) {}; - \node [style=none] (1) at (0.5, 0) {}; - \end{pgfonlayer} - \begin{pgfonlayer}{edgelayer} - \draw [in=90, out=90, looseness=0.75] (0.center) to (1.center); - \draw [in=-90, out=270, looseness=0.75] (1.center) to (0.center); - \end{pgfonlayer} -\end{tikzpicture} \ No newline at end of file diff --git a/tikzit-old/shapes/pants.tikz b/tikzit-old/shapes/pants.tikz deleted file mode 100644 index c2c15c2..0000000 --- a/tikzit-old/shapes/pants.tikz +++ /dev/null @@ -1,19 +0,0 @@ -\begin{tikzpicture} - \path [use as bounding box] (-2,-2) rectangle (2,2); - \begin{pgfonlayer}{nodelayer} - \node [style=none] (0) at (-0.5, 1) {}; - \node [style=none] (1) at (0.5, 1) {}; - \node [style=none] (2) at (-1.5, -1) {}; - \node [style=none] (3) at (-0.5, -1) {}; - \node [style=none] (4) at (0.5, -1) {}; - \node [style=none] (5) at (1.5, -1) {}; - \end{pgfonlayer} - \begin{pgfonlayer}{edgelayer} - \draw [in=90, out=90, looseness=1.75] (4.center) to (3.center); - \draw [in=270, out=90, looseness=0.75] (2.center) to (0.center); - \draw [in=-90, out=-90, looseness=0.75] (0.center) to (1.center); - \draw [in=90, out=-90, looseness=0.75] (1.center) to (5.center); - \draw [in=-270, out=90, looseness=0.75] (5.center) to (4.center); - \draw [in=-270, out=90, looseness=0.75] (3.center) to (2.center); - \end{pgfonlayer} -\end{tikzpicture} \ No newline at end of file diff --git a/tikzit-old/share/Makefile.am b/tikzit-old/share/Makefile.am deleted file mode 100644 index 658b4d9..0000000 --- a/tikzit-old/share/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -if WINDOWS -else -sharedir = $(datarootdir) -nobase_dist_share_DATA = \ - applications/tikzit.desktop \ - mime/packages/tikzit.xml \ - icons/hicolor/*/*/*.png \ - icons/hicolor/scalable/*/*.svg -endif - diff --git a/tikzit-old/share/applications/tikzit.desktop b/tikzit-old/share/applications/tikzit.desktop deleted file mode 100644 index 12b6fa5..0000000 --- a/tikzit-old/share/applications/tikzit.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=TikZit -Comment=Editor for PGF/TikZ-based node-and-edge graphs for LaTeX documents -GenericName=TikZ Graph Editor -MimeType=text/x-tikz -Exec=tikzit -Icon=tikzit -Categories=GTK;Graphics;Education;Science; -StartupNotify=false diff --git a/tikzit-old/share/icons/hicolor/128x128/apps/tikzit.png b/tikzit-old/share/icons/hicolor/128x128/apps/tikzit.png deleted file mode 100644 index e8ee92b..0000000 Binary files a/tikzit-old/share/icons/hicolor/128x128/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/128x128/mimetypes/text-x-tikz.png b/tikzit-old/share/icons/hicolor/128x128/mimetypes/text-x-tikz.png deleted file mode 100644 index 6b3bbe6..0000000 Binary files a/tikzit-old/share/icons/hicolor/128x128/mimetypes/text-x-tikz.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/16x16/apps/tikzit.png b/tikzit-old/share/icons/hicolor/16x16/apps/tikzit.png deleted file mode 100644 index 9b7a377..0000000 Binary files a/tikzit-old/share/icons/hicolor/16x16/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/16x16/mimetypes/text-x-tikz.png b/tikzit-old/share/icons/hicolor/16x16/mimetypes/text-x-tikz.png deleted file mode 100644 index 364e831..0000000 Binary files a/tikzit-old/share/icons/hicolor/16x16/mimetypes/text-x-tikz.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/22x22/apps/tikzit.png b/tikzit-old/share/icons/hicolor/22x22/apps/tikzit.png deleted file mode 100644 index be803da..0000000 Binary files a/tikzit-old/share/icons/hicolor/22x22/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/22x22/mimetypes/text-x-tikz.png b/tikzit-old/share/icons/hicolor/22x22/mimetypes/text-x-tikz.png deleted file mode 100644 index 6436a9e..0000000 Binary files a/tikzit-old/share/icons/hicolor/22x22/mimetypes/text-x-tikz.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/24x24/apps/tikzit.png b/tikzit-old/share/icons/hicolor/24x24/apps/tikzit.png deleted file mode 100644 index 478aeab..0000000 Binary files a/tikzit-old/share/icons/hicolor/24x24/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/32x32/apps/tikzit.png b/tikzit-old/share/icons/hicolor/32x32/apps/tikzit.png deleted file mode 100644 index 75174e1..0000000 Binary files a/tikzit-old/share/icons/hicolor/32x32/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/32x32/mimetypes/text-x-tikz.png b/tikzit-old/share/icons/hicolor/32x32/mimetypes/text-x-tikz.png deleted file mode 100644 index 7faaded..0000000 Binary files a/tikzit-old/share/icons/hicolor/32x32/mimetypes/text-x-tikz.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/48x48/apps/tikzit.png b/tikzit-old/share/icons/hicolor/48x48/apps/tikzit.png deleted file mode 100644 index 7186458..0000000 Binary files a/tikzit-old/share/icons/hicolor/48x48/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/48x48/mimetypes/text-x-tikz.png b/tikzit-old/share/icons/hicolor/48x48/mimetypes/text-x-tikz.png deleted file mode 100644 index d061ed9..0000000 Binary files a/tikzit-old/share/icons/hicolor/48x48/mimetypes/text-x-tikz.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/64x64/apps/tikzit.png b/tikzit-old/share/icons/hicolor/64x64/apps/tikzit.png deleted file mode 100644 index 1641e85..0000000 Binary files a/tikzit-old/share/icons/hicolor/64x64/apps/tikzit.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/64x64/mimetypes/text-x-tikz.png b/tikzit-old/share/icons/hicolor/64x64/mimetypes/text-x-tikz.png deleted file mode 100644 index 2197553..0000000 Binary files a/tikzit-old/share/icons/hicolor/64x64/mimetypes/text-x-tikz.png and /dev/null differ diff --git a/tikzit-old/share/icons/hicolor/scalable/apps/tikzit.svg b/tikzit-old/share/icons/hicolor/scalable/apps/tikzit.svg deleted file mode 100644 index dc5cc84..0000000 --- a/tikzit-old/share/icons/hicolor/scalable/apps/tikzit.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/tikzit-old/share/icons/hicolor/scalable/mimetypes/text-x-tikz.svg b/tikzit-old/share/icons/hicolor/scalable/mimetypes/text-x-tikz.svg deleted file mode 100644 index 1642e87..0000000 --- a/tikzit-old/share/icons/hicolor/scalable/mimetypes/text-x-tikz.svg +++ /dev/null @@ -1,488 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - text - plaintext - regular - script - shell - bash - python - perl - php - ruby - - - - - - Jakub Steiner - - - http://jimmac.musichall.cz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/share/mime/packages/tikzit.xml b/tikzit-old/share/mime/packages/tikzit.xml deleted file mode 100644 index c6e7c0c..0000000 --- a/tikzit-old/share/mime/packages/tikzit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tikzit-old/share/tikzit b/tikzit-old/share/tikzit deleted file mode 120000 index a96aa0e..0000000 --- a/tikzit-old/share/tikzit +++ /dev/null @@ -1 +0,0 @@ -.. \ No newline at end of file diff --git a/tikzit-old/src/Makefile.am b/tikzit-old/src/Makefile.am deleted file mode 100644 index 5108e9c..0000000 --- a/tikzit-old/src/Makefile.am +++ /dev/null @@ -1,178 +0,0 @@ -if WINDOWS -sharedir = ../ -else -sharedir = @datarootdir@/tikzit -endif - -AM_OBJCFLAGS = @FOUNDATION_OBJCFLAGS@ \ - @GTK_CFLAGS@ \ - -I common \ - -I gtk \ - -DTIKZITSHAREDIR=\"$(sharedir)\" \ - -std=c99 \ - -D_GNU_SOURCE -LIBS = @FOUNDATION_LIBS@ \ - @GTK_LIBS@ -AM_YFLAGS = -d -PARSERFILES = common/tikzlexer.m common/tikzlexer.h common/tikzparser.m common/tikzparser.h -ICONFILES = ../draw-ellipse.png \ - ../draw-path.png \ - ../select-rectangular.png \ - ../transform-crop-and-resize.png \ - ../transform-move.png -EDGEDECFILES = ../AH_*.png ../ED_*.png - -bin_PROGRAMS = tikzit -BUILT_SOURCES = $(PARSERFILES) -tikzit_SOURCES = gtk/Application.m \ - gtk/BoundingBoxTool.m \ - gtk/CairoRenderContext.m \ - gtk/ColorRGB+IntegerListStorage.m \ - gtk/ColorRGB+Gtk.m \ - gtk/Configuration.m \ - gtk/ContextWindow.m \ - gtk/CreateEdgeTool.m \ - gtk/CreateNodeTool.m \ - gtk/Edge+Render.m \ - gtk/EdgeStyle+Gtk.m \ - gtk/EdgeStyle+Storage.m \ - gtk/EdgeStyleEditor.m \ - gtk/EdgeStyleSelector.m \ - gtk/EdgeStylesModel.m \ - gtk/EdgeStylesPalette.m \ - gtk/FileChooserDialog.m \ - gtk/HandTool.m \ - gtk/GraphEditorPanel.m \ - gtk/GraphRenderer.m \ - gtk/Menu.m \ - gtk/Node+Render.m \ - gtk/NodeStyle+Gtk.m \ - gtk/NodeStyle+Storage.m \ - gtk/NodeStyleEditor.m \ - gtk/NodeStylesModel.m \ - gtk/NodeStyleSelector.m \ - gtk/NodeStylesPalette.m \ - gtk/NSError+Glib.m \ - gtk/NSFileManager+Glib.m \ - gtk/NSString+Glib.m \ - gtk/PropertiesPane.m \ - gtk/PropertyListEditor.m \ - gtk/RecentManager.m \ - gtk/SelectTool.m \ - gtk/SelectionPane.m \ - gtk/SettingsDialog.m \ - gtk/Shape+Render.m \ - gtk/StyleManager+Storage.m \ - gtk/TikzDocument.m \ - gtk/ToolBox.m \ - gtk/WidgetSurface.m \ - gtk/Window.m \ - gtk/cairo_helpers.m \ - gtk/clipboard.m \ - gtk/gtkhelpers.m \ - gtk/logo.m \ - gtk/mkdtemp.m \ - gtk/main.m \ - gtk/tzstockitems.m \ - gtk/tztoolpalette.m \ - common/CircleShape.m \ - common/ColorRGB.m \ - common/DiamondShape.m \ - common/Edge.m \ - common/EdgeStyle.m \ - common/GraphChange.m \ - common/GraphElementData.m \ - common/Graph.m \ - common/Grid.m \ - common/Node.m \ - common/NodeStyle.m \ - common/NSError+Tikzit.m \ - common/NSFileManager+Utils.m \ - common/NSString+LatexConstants.m \ - common/NSString+Tikz.m \ - common/NSString+Util.m \ - common/PickSupport.m \ - common/PropertyHolder.m \ - common/GraphElementProperty.m \ - common/RColor.m \ - common/RectangleShape.m \ - common/RegularPolyShape.m \ - common/Shape.m \ - common/StyleManager.m \ - common/SupportDir.m \ - common/TikzGraphAssembler.m \ - common/TikzShape.m \ - common/Transformer.m \ - common/tikzparser.m \ - common/tikzlexer.m \ - common/util.m - -if HAVE_POPPLER -tikzit_SOURCES += \ - common/Preambles.m \ - gtk/PreambleEditor.m \ - gtk/Preambles+Storage.m \ - gtk/PreviewRenderer.m \ - gtk/PreviewWindow.m -endif - -if WINDOWS -tikzit.res: tikzit.rc - $(AM_V_GEN)windres $^ -O coff -o $@ - -tikzit_LDADD = tikzit.res -CLEANFILES = tikzit.res -endif - -common/tikzlexer.m common/tikzlexer.h: common/tikzlexer.lm - $(AM_V_GEN)$(LEX) -o common/tikzlexer.m $^ -# ordering hack for parallel builds -common/tikzlexer.h: common/tikzlexer.m - -common/tikzparser.m common/tikzparser.h: common/tikzparser.ym - $(AM_V_GEN)$(YACC) --defines=common/tikzparser.h --output=common/tikzparser.m $^ -# ordering hack for parallel builds -common/tikzparser.h: common/tikzparser.m - -gtk/icondata.m: $(ICONFILES) - $(AM_V_GEN)gdk-pixbuf-csource --struct --static --raw --build-list \ - draw_ellipse ../draw-ellipse.png \ - draw_path ../draw-path.png \ - select_rectangular ../select-rectangular.png \ - transform_crop_and_resize ../transform-crop-and-resize.png \ - transform_move ../transform-move.png \ - > $@ - -gtk/logodata.m: ../share/icons/hicolor/*/apps/tikzit.png - $(AM_V_GEN)gdk-pixbuf-csource --struct --static --raw --build-list \ - logo16 ../share/icons/hicolor/16x16/apps/tikzit.png \ - logo24 ../share/icons/hicolor/24x24/apps/tikzit.png \ - logo32 ../share/icons/hicolor/32x32/apps/tikzit.png \ - logo48 ../share/icons/hicolor/48x48/apps/tikzit.png \ - logo64 ../share/icons/hicolor/64x64/apps/tikzit.png \ - logo128 ../share/icons/hicolor/128x128/apps/tikzit.png \ - > $@ - -gtk/edgedecdata.m: $(EDGEDECFILES) - $(AM_V_GEN)gdk-pixbuf-csource --struct --static --raw --build-list \ - AH_none_pixdata ../AH_none.png \ - AH_latex_head_pixdata ../AH_latex_head.png \ - AH_latex_tail_pixdata ../AH_latex_tail.png \ - AH_plain_head_pixdata ../AH_plain_head.png \ - AH_plain_tail_pixdata ../AH_plain_tail.png \ - ED_none_pixdata ../ED_none.png \ - ED_arrow_pixdata ../ED_arrow.png \ - ED_tick_pixdata ../ED_tick.png \ - > $@ - -gtk/Menu.m: gtk/icondata.m -gtk/logo.m: gtk/logodata.m -gtk/EdgeStyleEditor.m: gtk/edgedecdata.m - -EXTRA_DIST = gtk/*.h common/*.h \ - $(PARSERFILES) common/tikzlexer.lm common/tikzparser.ym \ - $(ICONFILES) gtk/icondata.m \ - gtk/logodata.m \ - $(EDGEDECFILES) gtk/edgedecdata.m \ - tikzit.rc ../tikzit.ico -MAINTAINERCLEANFILES = $(PARSERFILES) gtk/icondata.m gtk/logodata.m gtk/edgedecdata.m diff --git a/tikzit-old/src/common/CircleShape.h b/tikzit-old/src/common/CircleShape.h deleted file mode 100644 index 8215b92..0000000 --- a/tikzit-old/src/common/CircleShape.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// CircleShape.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Shape.h" - -@interface CircleShape : Shape { -} - - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/CircleShape.m b/tikzit-old/src/common/CircleShape.m deleted file mode 100644 index f2d1d52..0000000 --- a/tikzit-old/src/common/CircleShape.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// CircleShape.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "CircleShape.h" -#import "Node.h" -#import "Edge.h" - -@implementation CircleShape - -- (id)init { - self = [super init]; - if (self) { - Node *n0,*n1,*n2,*n3; - - n0 = [Node nodeWithPoint:NSMakePoint( 0.0f, 0.2f)]; - n1 = [Node nodeWithPoint:NSMakePoint( 0.2f, 0.0f)]; - n2 = [Node nodeWithPoint:NSMakePoint( 0.0f, -0.2f)]; - n3 = [Node nodeWithPoint:NSMakePoint(-0.2f, 0.0f)]; - - Edge *e0,*e1,*e2,*e3; - - e0 = [Edge edgeWithSource:n0 andTarget:n1]; [e0 setBend:-45]; - e1 = [Edge edgeWithSource:n1 andTarget:n2]; [e1 setBend:-45]; - e2 = [Edge edgeWithSource:n2 andTarget:n3]; [e2 setBend:-45]; - e3 = [Edge edgeWithSource:n3 andTarget:n0]; [e3 setBend:-45]; - - paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil]; - - styleTikz = @"circle"; - } - return self; -} - - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/ColorRGB.h b/tikzit-old/src/common/ColorRGB.h deleted file mode 100644 index 607ba64..0000000 --- a/tikzit-old/src/common/ColorRGB.h +++ /dev/null @@ -1,64 +0,0 @@ -// -// ColorRGB.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "RColor.h" - -@interface ColorRGB : NSObject { - unsigned short red, green, blue; -} - -@property (assign) unsigned short red; -@property (assign) unsigned short green; -@property (assign) unsigned short blue; - -@property (assign) float redFloat; -@property (assign) float greenFloat; -@property (assign) float blueFloat; - -@property (readonly) NSString *name; - -- (RColor)rColor; -- (RColor)rColorWithAlpha:(CGFloat)alpha; - -- (NSString*)hexName; -- (BOOL)isEqual:(id)col; -- (float)distanceFromColor:(ColorRGB*)col; -- (int)hash; - -- (id)initWithRed:(unsigned short)r green:(unsigned short)g blue:(unsigned short)b; -- (id)initWithFloatRed:(float)r green:(float)g blue:(float)b; -- (id)initWithRColor:(RColor)color; - -- (void)setToClosestHashed; - -+ (ColorRGB*)colorWithRed:(unsigned short)r green:(unsigned short)g blue:(unsigned short)b; -+ (ColorRGB*)colorWithFloatRed:(float)r green:(float)g blue:(float)b; -+ (ColorRGB*)colorWithRColor:(RColor)color; - -+ (void)makeColorHash; -+ (void)releaseColorHash; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/ColorRGB.m b/tikzit-old/src/common/ColorRGB.m deleted file mode 100644 index 840d716..0000000 --- a/tikzit-old/src/common/ColorRGB.m +++ /dev/null @@ -1,353 +0,0 @@ -// -// ColorRGB.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "ColorRGB.h" -#import "util.h" - -typedef struct { -#if __has_feature(objc_arc) - __unsafe_unretained NSString *name; -#else - NSString *name; -#endif - unsigned short r, g, b; -} ColorRGBEntry; - -static const ColorRGBEntry kColors[147] = { - { @"AliceBlue", 240, 248, 255 }, - { @"AntiqueWhite", 250, 235, 215 }, - { @"Aqua", 0, 255, 255 }, - { @"Aquamarine", 127, 255, 212 }, - { @"Azure", 240, 255, 255 }, - { @"Beige", 245, 245, 220 }, - { @"Bisque", 255, 228, 196 }, - { @"Black", 0, 0, 0 }, - { @"BlanchedAlmond", 255, 235, 205 }, - { @"Blue", 0, 0, 255 }, - { @"BlueViolet", 138, 43, 226 }, - { @"Brown", 165, 42, 42 }, - { @"BurlyWood", 222, 184, 135 }, - { @"CadetBlue", 95, 158, 160 }, - { @"Chartreuse", 127, 255, 0 }, - { @"Chocolate", 210, 105, 30 }, - { @"Coral", 255, 127, 80 }, - { @"CornflowerBlue", 100, 149, 237 }, - { @"Cornsilk", 255, 248, 220 }, - { @"Crimson", 220, 20, 60 }, - { @"Cyan", 0, 255, 255 }, - { @"DarkBlue", 0, 0, 139 }, - { @"DarkCyan", 0, 139, 139 }, - { @"DarkGoldenrod", 184, 134, 11 }, - { @"DarkGray", 169, 169, 169 }, - { @"DarkGreen", 0, 100, 0 }, - { @"DarkGrey", 169, 169, 169 }, - { @"DarkKhaki", 189, 183, 107 }, - { @"DarkMagenta", 139, 0, 139 }, - { @"DarkOliveGreen", 85, 107, 47 }, - { @"DarkOrange", 255, 140, 0 }, - { @"DarkOrchid", 153, 50, 204 }, - { @"DarkRed", 139, 0, 0 }, - { @"DarkSalmon", 233, 150, 122 }, - { @"DarkSeaGreen", 143, 188, 143 }, - { @"DarkSlateBlue", 72, 61, 139 }, - { @"DarkSlateGray", 47, 79, 79 }, - { @"DarkSlateGrey", 47, 79, 79 }, - { @"DarkTurquoise", 0, 206, 209 }, - { @"DarkViolet", 148, 0, 211 }, - { @"DeepPink", 255, 20, 147 }, - { @"DeepSkyBlue", 0, 191, 255 }, - { @"DimGray", 105, 105, 105 }, - { @"DimGrey", 105, 105, 105 }, - { @"DodgerBlue", 30, 144, 255 }, - { @"FireBrick", 178, 34, 34 }, - { @"FloralWhite", 255, 250, 240 }, - { @"ForestGreen", 34, 139, 34 }, - { @"Fuchsia", 255, 0, 255 }, - { @"Gainsboro", 220, 220, 220 }, - { @"GhostWhite", 248, 248, 255 }, - { @"Gold", 255, 215, 0 }, - { @"Goldenrod", 218, 165, 32 }, - { @"Gray", 128, 128, 128 }, - { @"Grey", 128, 128, 128 }, - { @"Green", 0, 128, 0 }, - { @"GreenYellow", 173, 255, 47 }, - { @"Honeydew", 240, 255, 240 }, - { @"HotPink", 255, 105, 180 }, - { @"IndianRed", 205, 92, 92 }, - { @"Indigo", 75, 0, 130 }, - { @"Ivory", 255, 255, 240 }, - { @"Khaki", 240, 230, 140 }, - { @"Lavender", 230, 230, 250 }, - { @"LavenderBlush", 255, 240, 245 }, - { @"LawnGreen", 124, 252, 0 }, - { @"LemonChiffon", 255, 250, 205 }, - { @"LightBlue", 173, 216, 230 }, - { @"LightCoral", 240, 128, 128 }, - { @"LightCyan", 224, 255, 255 }, - { @"LightGoldenrodYellow", 250, 250, 210 }, - { @"LightGray", 211, 211, 211 }, - { @"LightGreen", 144, 238, 144 }, - { @"LightGrey", 211, 211, 211 }, - { @"LightPink", 255, 182, 193 }, - { @"LightSalmon", 255, 160, 122 }, - { @"LightSeaGreen", 32, 178, 170 }, - { @"LightSkyBlue", 135, 206, 250 }, - { @"LightSlateGray", 119, 136, 153 }, - { @"LightSlateGrey", 119, 136, 153 }, - { @"LightSteelBlue", 176, 196, 222 }, - { @"LightYellow", 255, 255, 224 }, - { @"Lime", 0, 255, 0 }, - { @"LimeGreen", 50, 205, 50 }, - { @"Linen", 250, 240, 230 }, - { @"Magenta", 255, 0, 255 }, - { @"Maroon", 128, 0, 0 }, - { @"MediumAquamarine", 102, 205, 170 }, - { @"MediumBlue", 0, 0, 205 }, - { @"MediumOrchid", 186, 85, 211 }, - { @"MediumPurple", 147, 112, 219 }, - { @"MediumSeaGreen", 60, 179, 113 }, - { @"MediumSlateBlue", 123, 104, 238 }, - { @"MediumSpringGreen", 0, 250, 154 }, - { @"MediumTurquoise", 72, 209, 204 }, - { @"MediumVioletRed", 199, 21, 133 }, - { @"MidnightBlue", 25, 25, 112 }, - { @"MintCream", 245, 255, 250 }, - { @"MistyRose", 255, 228, 225 }, - { @"Moccasin", 255, 228, 181 }, - { @"NavajoWhite", 255, 222, 173 }, - { @"Navy", 0, 0, 128 }, - { @"OldLace", 253, 245, 230 }, - { @"Olive", 128, 128, 0 }, - { @"OliveDrab", 107, 142, 35 }, - { @"Orange", 255, 165, 0 }, - { @"OrangeRed", 255, 69, 0 }, - { @"Orchid", 218, 112, 214 }, - { @"PaleGoldenrod", 238, 232, 170 }, - { @"PaleGreen", 152, 251, 152 }, - { @"PaleTurquoise", 175, 238, 238 }, - { @"PaleVioletRed", 219, 112, 147 }, - { @"PapayaWhip", 255, 239, 213 }, - { @"PeachPuff", 255, 218, 185 }, - { @"Peru", 205, 133, 63 }, - { @"Pink", 255, 192, 203 }, - { @"Plum", 221, 160, 221 }, - { @"PowderBlue", 176, 224, 230 }, - { @"Purple", 128, 0, 128 }, - { @"Red", 255, 0, 0 }, - { @"RosyBrown", 188, 143, 143 }, - { @"RoyalBlue", 65, 105, 225 }, - { @"SaddleBrown", 139, 69, 19 }, - { @"Salmon", 250, 128, 114 }, - { @"SandyBrown", 244, 164, 96 }, - { @"SeaGreen", 46, 139, 87 }, - { @"Seashell", 255, 245, 238 }, - { @"Sienna", 160, 82, 45 }, - { @"Silver", 192, 192, 192 }, - { @"SkyBlue", 135, 206, 235 }, - { @"SlateBlue", 106, 90, 205 }, - { @"SlateGray", 112, 128, 144 }, - { @"SlateGrey", 112, 128, 144 }, - { @"Snow", 255, 250, 250 }, - { @"SpringGreen", 0, 255, 127 }, - { @"SteelBlue", 70, 130, 180 }, - { @"Tan", 210, 180, 140 }, - { @"Teal", 0, 128, 128 }, - { @"Thistle", 216, 191, 216 }, - { @"Tomato", 255, 99, 71 }, - { @"Turquoise", 64, 224, 208 }, - { @"Violet", 238, 130, 238 }, - { @"Wheat", 245, 222, 179 }, - { @"White", 255, 255, 255 }, - { @"WhiteSmoke", 245, 245, 245 }, - { @"Yellow", 255, 255, 0 }, - { @"YellowGreen", 154, 205, 50 } -}; - -static NSMapTable *colorHash = nil; - -@implementation ColorRGB - -+ (void)initialize { - [self setKeys:[NSArray arrayWithObject:@"red"] triggerChangeNotificationsForDependentKey:@"redFloat"]; - [self setKeys:[NSArray arrayWithObject:@"green"] triggerChangeNotificationsForDependentKey:@"greenFloat"]; - [self setKeys:[NSArray arrayWithObject:@"blue"] triggerChangeNotificationsForDependentKey:@"blueFloat"]; - [self setKeys:[NSArray arrayWithObjects:@"red", @"green", @"blue", nil] - triggerChangeNotificationsForDependentKey:@"name"]; -} - -@synthesize red, green, blue; - -- (float)redFloat { return ((float)red)/255.0f; } -- (void)setRedFloat:(float)r { [self setRed:round(r*255.0f)]; } -- (float)greenFloat { return ((float)green)/255.0f; } -- (void)setGreenFloat:(float)g { [self setGreen:round(g*255.0f)]; } -- (float)blueFloat { return ((float)blue)/255.0f; } -- (void)setBlueFloat:(float)b { [self setBlue:round(b*255.0f)]; } - -- (int)hash { - return (red<<4) + (green<<2) + blue; -} - -- (id)initWithRed:(unsigned short)r green:(unsigned short)g blue:(unsigned short)b { - self = [super init]; - if (self) { - red = r; - green = g; - blue = b; - } - return self; -} - -- (id)initWithFloatRed:(float)r green:(float)g blue:(float)b { - self = [super init]; - if (self) { - red = round(r*255.0f); - green = round(g*255.0f); - blue = round(b*255.0f); - } - return self; -} - -- (id) initWithRColor:(RColor)color { - return [self initWithFloatRed:color.red green:color.green blue:color.blue]; -} - -- (RColor) rColor { - return MakeSolidRColor ([self redFloat], [self greenFloat], [self blueFloat]); -} - -- (RColor) rColorWithAlpha:(CGFloat)alpha { - return MakeRColor ([self redFloat], [self greenFloat], [self blueFloat], alpha); -} - -- (NSString*)name { - if (colorHash == nil) - [ColorRGB makeColorHash]; - return [colorHash objectForKey:self]; -} - -- (NSString*)hexName { - return [NSString stringWithFormat:@"hexcolor0x%.2x%.2x%.2x", red, green, blue]; -} - -- (NSComparisonResult)compare:(ColorRGB*)col { - if (red > [col red]) return NSOrderedDescending; - else if (red < [col red]) return NSOrderedAscending; - else { - if (green > [col green]) return NSOrderedDescending; - else if (green < [col green]) return NSOrderedAscending; - else { - if (blue > [col blue]) return NSOrderedDescending; - else if (blue < [col blue]) return NSOrderedAscending; - else return NSOrderedSame; - } - } -} - -- (BOOL)isEqual:(id)col { - return [self compare:col] == NSOrderedSame; -} - -- (float)distanceFromColor:(ColorRGB *)col { - float dr = (float)(red - [col red]); - float dg = (float)(green - [col green]); - float db = (float)(blue - [col blue]); - return dr*dr + dg*dg + db*db; -} - -- (id)copyWithZone:(NSZone*)zone { - ColorRGB *col = [[ColorRGB allocWithZone:zone] initWithRed:red green:green blue:blue]; - return col; -} - -+ (ColorRGB*)colorWithRed:(unsigned short)r green:(unsigned short)g blue:(unsigned short)b { - ColorRGB *col = [[ColorRGB alloc] initWithRed:r green:g blue:b]; -#if __has_feature(objc_arc) - return col; -#else - return [col autorelease]; -#endif -} - - -+ (ColorRGB*)colorWithFloatRed:(float)r green:(float)g blue:(float)b { - ColorRGB *col = [[ColorRGB alloc] initWithFloatRed:r green:g blue:b]; -#if __has_feature(objc_arc) - return col; -#else - return [col autorelease]; -#endif -} - -+ (ColorRGB*) colorWithRColor:(RColor)color { -#if __has_feature(objc_arc) - return [[self alloc] initWithRColor:color]; -#else - return [[[self alloc] initWithRColor:color] autorelease]; -#endif -} - -+ (void)makeColorHash { - NSMapTable *h = [[NSMapTable alloc] init]; - int i; - for (i = 0; i < 147; ++i) { - ColorRGB *col = [[ColorRGB alloc] initWithRed:kColors[i].r - green:kColors[i].g - blue:kColors[i].b]; - [h setObject:kColors[i].name forKey:col]; - //NSLog(@"adding color %@ (%d)", kColors[i].name, [col hash]); -#if ! __has_feature(objc_arc) - [col release]; -#endif - } - colorHash = h; -} - -+ (void)releaseColorHash { -#if ! __has_feature(objc_arc) - [colorHash release]; -#endif -} - -- (void)setToClosestHashed { - if (colorHash == nil) - [ColorRGB makeColorHash]; - float bestDist = -1; - ColorRGB *bestColor = nil; - NSEnumerator *enumerator = [colorHash keyEnumerator]; - ColorRGB *tryColor; - while ((tryColor = [enumerator nextObject]) != nil) { - float dist = [self distanceFromColor:tryColor]; - if (bestDist<0 || dist. -// - -#import -#import "Shape.h" - -@interface DiamondShape : Shape { -} - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 - diff --git a/tikzit-old/src/common/DiamondShape.m b/tikzit-old/src/common/DiamondShape.m deleted file mode 100644 index 1a578b8..0000000 --- a/tikzit-old/src/common/DiamondShape.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// DiamondShape.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger -// Copyright 2012 Alex Merry -// All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "DiamondShape.h" - -#import "Node.h" -#import "Edge.h" - -@implementation DiamondShape - -- (id)init { - self = [super init]; - - if (!self) - return nil; - - Node *n0,*n1,*n2,*n3; - float sz = 0.25f; - - n0 = [Node nodeWithPoint:NSMakePoint(0, sz)]; - n1 = [Node nodeWithPoint:NSMakePoint(sz, 0)]; - n2 = [Node nodeWithPoint:NSMakePoint(0,-sz)]; - n3 = [Node nodeWithPoint:NSMakePoint(-sz,0)]; - - Edge *e0,*e1,*e2,*e3; - - e0 = [Edge edgeWithSource:n0 andTarget:n1]; - e1 = [Edge edgeWithSource:n1 andTarget:n2]; - e2 = [Edge edgeWithSource:n2 andTarget:n3]; - e3 = [Edge edgeWithSource:n3 andTarget:n0]; - - paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil]; - - styleTikz = @"shape=diamond"; - - return self; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/Edge.h b/tikzit-old/src/common/Edge.h deleted file mode 100644 index accf38c..0000000 --- a/tikzit-old/src/common/Edge.h +++ /dev/null @@ -1,401 +0,0 @@ -// -// Edge.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -// Edge : store the data associated with an edge. Also, lazily compute -// bezier curve control points based on bend and the coordinates of -// the endpoints. - -#import "Node.h" -#import "EdgeStyle.h" - -/*! - @typedef enum EdgeBendMode - @brief Indicates the type of edge bend. - @var EdgeBendModeBasic A basic, one-angle bend. Positive values will be interpreted - as bend left, negative as bend right. - @var EdgeBendModeInOut A two-angle bend mode, using inAngle and outAngle. - */ -typedef enum { - EdgeBendModeBasic, - EdgeBendModeInOut -} EdgeBendMode; - -/*! - @class Edge - @brief A graph edge, with associated bend and style data. - @details A graph edge, with associated bend and style data. This class - also contains methods for computing the bezier control points - and the midpoint of the curve. - */ -@interface Edge : NSObject { - Node *source; - Node *target; - Node *edgeNode; - int bend; - int inAngle, outAngle; - EdgeBendMode bendMode; - float weight; - EdgeStyle *style; - GraphElementData *data; - NSString *sourceAnchor; - NSString *targetAnchor; - - // When set to YES, lazily create the edge node, and keep it around when set - // to NO (at least until saved/loaded). - BOOL hasEdgeNode; - BOOL dirty; - - // these are all cached values computed from the above - NSPoint src; - NSPoint targ; - NSPoint head; - NSPoint tail; - NSPoint cp1; - NSPoint cp2; - NSPoint mid; - NSPoint midTan; - NSPoint headTan; - NSPoint tailTan; -} - -/*! - @property data - @brief Associated edge data. - */ -@property (copy) GraphElementData *data; - -// KVC methods -- (void) insertObject:(GraphElementProperty*)gep - inDataAtIndex:(NSUInteger)index; -- (void) removeObjectFromDataAtIndex:(NSUInteger)index; -- (void) replaceObjectInDataAtIndex:(NSUInteger)index - withObject:(GraphElementProperty*)gep; - -/*! - @property style - @brief Edge style. - */ -@property (retain) EdgeStyle *style; - -/*! - @property source - @brief Source node. - */ -@property (retain) Node *source; - -/*! - @property target - @brief Target node. - */ -@property (retain) Node *target; - -/*! - @property edgeNode - @brief A node attached to this edge, as in a label or tick. - */ -@property (retain) Node *edgeNode; - -/*! - @property sourceAnchor - @brief The source node anchor point, as in north or center. - */ -@property (copy) NSString *sourceAnchor; - -/*! - @property targetAnchor - @brief The target node anchor point, as in north or center. - */ -@property (copy) NSString *targetAnchor; - -/*! - @property hasEdgeNode - @brief A read/write property. When set to true, a new edge node is actually constructed. -*/ -@property (assign) BOOL hasEdgeNode; - -/*! - @property bend - @brief The degrees by which the edge bends. - */ -@property (assign) int bend; - -/*! - @property weight - @brief How close the edge will pass to control points. - */ -@property (assign) float weight; - -/*! - @property inAngle - @brief The angle by which the edge enters its target. - */ -@property (assign) int inAngle; - -/*! - @property outAngle - @brief The angle by which the edge leaves its target. - */ -@property (assign) int outAngle; - -/*! - @property bendMode - @brief The mode of the edge bend. Either simple bend in in/out style. - */ -@property (assign) EdgeBendMode bendMode; - -/*! - @property head - @brief The starting point of the edge. - @detail This value is computed based on the source, target and - either bend or in/out angles. It is where the edge - makes contact with the source node. - */ -@property (readonly) NSPoint head; - -/*! - @property tail - @brief The ending point of the edge. - @detail This value is computed based on the source, target and - either bend or in/out angles. It is where the edge - makes contact with the target node. - */ -@property (readonly) NSPoint tail; - -/*! - @property cp1 - @brief The first control point of the edge. - @detail This value is computed based on the source, target and - either bend or in/out angles. - */ -@property (readonly) NSPoint cp1; - -/*! - @property cp2 - @brief The second control point of the edge. - @detail This value is computed based on the source, target and - either bend or in/out angles. - */ -@property (readonly) NSPoint cp2; - -/*! - @property mid - @brief The midpoint of the curve. Computed from the source, target, and control points. - */ -@property (readonly) NSPoint mid; - -/*! - @property mid_tan - @brief The second point of a line tangent to the midpoint. (The first is the midpoint itself.) - */ -@property (readonly) NSPoint midTan; - -/*! - @property left_normal - @brief The second point in a line perp. to the edge coming from mid-point. (left side) - */ -@property (readonly) NSPoint leftNormal; - -/*! - @property left_normal - @brief The second point in a line perp. to the edge coming from mid-point. (right side) - */ -@property (readonly) NSPoint rightNormal; - -@property (readonly) NSPoint headTan; - -/*! - @property leftHeadNormal - */ -@property (readonly) NSPoint leftHeadNormal; - -/*! - @property rightHeadNormal - */ -@property (readonly) NSPoint rightHeadNormal; - -@property (readonly) NSPoint tailTan; - -/*! - @property leftTailNormal - */ -@property (readonly) NSPoint leftTailNormal; - -/*! - @property rightTailNormal - */ -@property (readonly) NSPoint rightTailNormal; - -/*! - @property isSelfLoop - @brief Returns YES if this edge is a self loop. - */ -@property (readonly) BOOL isSelfLoop; - -/*! - @property isStraight - @brief Returns YES if this edge can be drawn as a straight line (as opposed to a bezier curve). - */ -@property (readonly) BOOL isStraight; - - -/*! - @brief Construct a blank edge. - @result An edge. - */ -- (id)init; - -/*! - @brief Construct an edge with the given source and target. - @param s the source node. - @param t the target node. - @result An edge. - */ -- (id)initWithSource:(Node*)s andTarget:(Node*)t; - -/*! - @brief Force the recalculation of the derived properties. - */ -- (void)recalculateProperties; - -/*! - @brief Recompute the control points and midpoint. - */ -- (void)updateControls; - -/*! - @brief Push edge properties back into its GraphElementData. - */ -- (void)updateData; - -/*! - @brief Set edge properties from fields in GraphElementData. - */ -- (void)setAttributesFromData; - -/*! - @brief Use data.style to find and attach the EdgeStyle object from the given array. - */ -- (BOOL)attachStyleFromTable:(NSArray*)styles; - -/*! - @brief Convert the bend angle to an inAngle and outAngle. - */ -- (void)convertBendToAngles; - -/*! - @brief Set the bend angle to the average of the in and out angles. - */ -- (void)convertAnglesToBend; - -/*! - @brief Update this edge to look just like the given edge. - @param e an edge to mimic. - */ -- (void)setPropertiesFromEdge:(Edge *)e; - -/*! - @brief Get a bounding rect for this edge. - @detail Note that this may not be a tight bound. - */ -- (NSRect)boundingRect; - -/*! - @brief Moves the first control point, updating edge properties as necessary - @detail This will move a control point and adjust the weight and - bend (or outAngle) to fit. - - A courseness can be specified for both the weight and the - bend, allowing them to be constrained to certain values. For - example, passing 10 as the bend courseness will force the bend - to be a multiple of 5. Passing 0 for either of these will - cause the relevant value to be unconstrained. - @param point the new position of the control point - @param wc force the weight to be a multiple of this value (unless 0) - @param bc force the bend (or outAngle) to be a multiple of this value (unless 0) - @param link when in EdgeBendModeInOut, change both the in and out angles at once - */ -- (void) moveCp1To:(NSPoint)point withWeightCourseness:(float)wc andBendCourseness:(int)bc forceLinkControlPoints:(BOOL)link; - -/*! - @brief Moves the first control point, updating edge properties as necessary - @detail This will move a control point and adjust the weight and - bend (or outAngle) to fit. - - The same as moveCp1To:point withWeightCourseness:0.0f andBendCourseness:0 forceLinkControlPoints:No - @param point the new position of the control point - @param wc force the weight to be a multiple of this value (unless 0) - @param bc force the bend (or outAngle) to be a multiple of this value (unless 0) - @param link when in EdgeBendModeInOut, change both the in and out angles at once - */ -- (void) moveCp1To:(NSPoint)point; - -/*! - @brief Moves the first control point, updating edge properties as necessary - @detail This will move a control point and adjust the weight and - bend (or inAngle) to fit. - - A courseness can be specified for both the weight and the - bend, allowing them to be constrained to certain values. For - example, passing 10 as the bend courseness will force the bend - to be a multiple of 5. Passing 0 for either of these will - cause the relevant value to be unconstrained. - @param point the new position of the control point - @param wc force the weight to be a multiple of this value (unless 0) - @param bc force the bend (or inAngle) to be a multiple of this value (unless 0) - @param link when in EdgeBendModeInOut, change both the in and out angles at once - */ -- (void) moveCp2To:(NSPoint)point withWeightCourseness:(float)wc andBendCourseness:(int)bc forceLinkControlPoints:(BOOL)link; - -/*! - @brief Moves the first control point, updating edge properties as necessary - @detail This will move a control point and adjust the weight and - bend (or inAngle) to fit. - - The same as moveCp2To:point withWeightCourseness:0.0f andBendCourseness:0 forceLinkControlPoints:No - @param point the new position of the control point - */ -- (void) moveCp2To:(NSPoint)point; - -/*! - @brief Reverse edge direction, updating bend/inAngle/outAngle/etc - */ -- (void)reverse; - -/*! - @brief Factory method to make a blank edge. - @result An edge. - */ -+ (Edge*)edge; - -/*! - @brief Factory method to make an edge with the given source and target. - @param s a source node. - @param t a target node. - @result An edge. - */ -+ (Edge*)edgeWithSource:(Node*)s andTarget:(Node*)t; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Edge.m b/tikzit-old/src/common/Edge.m deleted file mode 100644 index 0c88e9d..0000000 --- a/tikzit-old/src/common/Edge.m +++ /dev/null @@ -1,757 +0,0 @@ -// -// Edge.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Edge.h" -#import "Shape.h" -#import "util.h" - -@implementation Edge - -- (id)init { - self = [super init]; - if (self) { - data = [[GraphElementData alloc] init]; - bend = 0; - inAngle = 135; - outAngle = 45; - bendMode = EdgeBendModeBasic; - weight = 0.4f; - dirty = YES; - source = nil; - target = nil; - edgeNode = nil; - sourceAnchor = @""; - targetAnchor = @""; - } - return self; -} - -- (id)initWithSource:(Node*)s andTarget:(Node*)t { - self = [self init]; - if (self) { - [self setSource:s]; - [self setTarget:t]; - edgeNode = nil; - - dirty = YES; - } - return self; -} - -- (BOOL)attachStyleFromTable:(NSArray*)styles { - NSString *style_name = [data propertyForKey:@"style"]; - - [self setStyle:nil]; - if (style_name == nil) return YES; - - for (EdgeStyle *s in styles) { - if ([[s name] compare:style_name]==NSOrderedSame) { - [self setStyle:s]; - return YES; - } - } - - // if we didn't find a style, fill in a default one -#if __has_feature(objc_arc) - style = [EdgeStyle defaultEdgeStyleWithName:style_name]; -#else - style = [[EdgeStyle defaultEdgeStyleWithName:style_name] retain]; -#endif - return NO; -} - -- (NSPoint) _findContactPointOn:(Node*)node at:(float)angle { - NSPoint rayStart = [node point]; - Shape *shape = [node shape]; - if (shape == nil) { - return rayStart; - } - - Transformer *shapeTrans = [node shapeTransformer]; - // rounding errors are a pain - NSRect searchArea = NSInsetRect([node boundsUsingShapeTransform:shapeTrans],-0.01,-0.01); - if (!NSPointInRect(rayStart, searchArea)) { - return rayStart; - } - - NSPoint rayEnd = findExitPointOfRay (rayStart, angle, searchArea); - - for (NSArray *path in [shape paths]) { - for (Edge *curve in path) { - NSPoint intersect; - [curve updateControls]; - if (lineSegmentIntersectsBezier (rayStart, rayEnd, - [shapeTrans toScreen:curve->tail], - [shapeTrans toScreen:curve->cp1], - [shapeTrans toScreen:curve->cp2], - [shapeTrans toScreen:curve->head], - &intersect)) { - // we just keep shortening the line - rayStart = intersect; - } - } - } - - return rayStart; -} - -- (NSPoint) _findTanFor:(NSPoint)pt usingSpanFrom:(float)t1 to:(float)t2 { - float dx = bezierInterpolate(t2, tail.x, cp1.x, cp2.x, head.x) - - bezierInterpolate(t1, tail.x, cp1.x, cp2.x, head.x); - float dy = bezierInterpolate(t2, tail.y, cp1.y, cp2.y, head.y) - - bezierInterpolate(t1, tail.y, cp1.y, cp2.y, head.y); - - // normalise - float len = sqrt(dx*dx+dy*dy); - if (len != 0) { - dx = (dx/len) * 0.1f; - dy = (dy/len) * 0.1f; - } - - return NSMakePoint (pt.x + dx, pt.y + dy); -} - -- (void)recalculateProperties { - dirty = YES; -} - -- (void)updateControls { - // check for external modification to the node locations - if (src.x != [source point].x || src.y != [source point].y || - targ.x != [target point].x || targ.y != [target point].y) - { - dirty = YES; - } - - if (dirty) { - src = [source point]; - targ = [target point]; - - float dx = (targ.x - src.x); - float dy = (targ.y - src.y); - - float angleSrc = 0.0f; - float angleTarg = 0.0f; - - if (bendMode == EdgeBendModeBasic) { - float angle = good_atan(dx, dy); - float bnd = (float)bend * (M_PI / 180.0f); - angleSrc = angle - bnd; - angleTarg = M_PI + angle + bnd; - } else if (bendMode == EdgeBendModeInOut) { - angleSrc = (float)outAngle * (M_PI / 180.0f); - angleTarg = (float)inAngle * (M_PI / 180.0f); - } - - tail = [self _findContactPointOn:source at:angleSrc]; - head = [self _findContactPointOn:target at:angleTarg]; - - // give a default distance for self-loops - float cdist = (dx==0.0f && dy==0.0f) ? weight : sqrt(dx*dx + dy*dy) * weight; - - cp1 = NSMakePoint(src.x + (cdist * cos(angleSrc)), - src.y + (cdist * sin(angleSrc))); - - cp2 = NSMakePoint(targ.x + (cdist * cos(angleTarg)), - targ.y + (cdist * sin(angleTarg))); - - mid = bezierInterpolateFull (0.5f, tail, cp1, cp2, head); - midTan = [self _findTanFor:mid usingSpanFrom:0.4f to:0.6f]; - - tailTan = [self _findTanFor:tail usingSpanFrom:0.0f to:0.1f]; - headTan = [self _findTanFor:head usingSpanFrom:1.0f to:0.9f]; - } - dirty = NO; -} - -- (void)convertBendToAngles { - float dx = (targ.x - src.x); - float dy = (targ.y - src.y); - float angle = good_atan(dx, dy); - float bnd = (float)bend * (M_PI / 180.0f); - - [self setOutAngle:round((angle - bnd) * (180.0f/M_PI))]; - [self setInAngle:round((M_PI + angle + bnd) * (180.0f/M_PI))]; - dirty = YES; -} - -- (void)convertAnglesToBend { - float dx = (targ.x - src.x); - float dy = (targ.y - src.y); - int angle = round((180.0f/M_PI) * good_atan(dx, dy)); - - // compute bend1 and bend2 to match inAngle and outAngle, resp. - int bend1, bend2; - - bend1 = outAngle - angle; - bend2 = angle - inAngle; - - [self setBend:(bend1 + bend2) / 2]; -} - -- (BOOL)isSelfLoop { - return (source == target); -} - -- (BOOL)isStraight { - return (bendMode == EdgeBendModeBasic && bend == 0); -} - -- (NSPoint)mid { - [self updateControls]; - return mid; -} - -- (NSPoint)midTan { - [self updateControls]; - return midTan; -} - -- (NSPoint)leftNormal { - [self updateControls]; - return NSMakePoint(mid.x + (mid.y - midTan.y), mid.y - (mid.x - midTan.x)); -} - -- (NSPoint)rightNormal { - [self updateControls]; - return NSMakePoint(mid.x - (mid.y - midTan.y), mid.y + (mid.x - midTan.x)); -} - -- (NSPoint)headTan { - [self updateControls]; - return headTan; -} - -- (NSPoint)leftHeadNormal { - [self updateControls]; - return NSMakePoint(headTan.x + (head.y - headTan.y), headTan.y - (head.x - headTan.x)); -} - -- (NSPoint)rightHeadNormal { - [self updateControls]; - return NSMakePoint(headTan.x - (head.y - headTan.y), headTan.y + (head.x - headTan.x)); -} - -- (NSPoint)tailTan { - [self updateControls]; - return tailTan; -} - -- (NSPoint)leftTailNormal { - [self updateControls]; - return NSMakePoint(tailTan.x + (tail.y - tailTan.y), tailTan.y - (tail.x - tailTan.x)); -} - -- (NSPoint)rightTailNormal { - [self updateControls]; - return NSMakePoint(tailTan.x - (tail.y - tailTan.y), tailTan.y + (tail.x - tailTan.x)); -} - -- (NSPoint) head { - [self updateControls]; - return head; -} - -- (NSPoint) tail { - [self updateControls]; - return tail; -} - -- (NSPoint)cp1 { - [self updateControls]; - return cp1; -} - -- (NSPoint)cp2 { - [self updateControls]; - return cp2; -} - -- (int)inAngle {return inAngle;} -- (void)setInAngle:(int)a { - inAngle = normaliseAngleDeg (a); - dirty = YES; -} - -- (int)outAngle {return outAngle;} -- (void)setOutAngle:(int)a { - outAngle = normaliseAngleDeg (a); - dirty = YES; -} - -- (EdgeBendMode)bendMode {return bendMode;} -- (void)setBendMode:(EdgeBendMode)mode { - bendMode = mode; - dirty = YES; -} - -- (int)bend {return bend;} -- (void)setBend:(int)b { - bend = normaliseAngleDeg (b); - dirty = YES; -} - -- (float)weight {return weight;} -- (void)setWeight:(float)w { -// if (source == target) weight = 1.0f; -// else weight = w; - weight = w; - dirty = YES; -} - -- (EdgeStyle*)style {return style;} -- (void)setStyle:(EdgeStyle*)s { - if (style != s) { -#if __has_feature(objc_arc) - style = s; -#else - [style release]; - style = [s retain]; -#endif - } -} - -- (Node*)source {return source;} -- (void)setSource:(Node *)s { - if (source != s) { - [source removeObserver:self - forKeyPath:@"style"]; - - if ([s style] == nil) { - [self setSourceAnchor:@"center"]; - } else if ([sourceAnchor isEqual:@"center"]) { - [self setSourceAnchor:@""]; - } - -#if __has_feature(objc_arc) - source = s; -#else - [source release]; - source = [s retain]; -#endif - - if (source==target) { - bendMode = EdgeBendModeInOut; - weight = 1.0f; - } - - [source addObserver:self - forKeyPath:@"style" - options:NSKeyValueObservingOptionNew - | NSKeyValueObservingOptionOld - context:NULL]; - - dirty = YES; - } -} - -- (Node*)target {return target;} -- (void)setTarget:(Node *)t { - if (target != t) { - [target removeObserver:self - forKeyPath:@"style"]; - - if ([t style] == nil) { - [self setTargetAnchor:@"center"]; - } else if ([targetAnchor isEqual:@"center"]) { - [self setTargetAnchor:@""]; - } - -#if __has_feature(objc_arc) - target = t; -#else - [target release]; - target = [t retain]; -#endif - - if (source==target) { - bendMode = EdgeBendModeInOut; - weight = 1.0f; - } - - [target addObserver:self - forKeyPath:@"style" - options:NSKeyValueObservingOptionNew - | NSKeyValueObservingOptionOld - context:NULL]; - - dirty = YES; - } -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context - -{ - if ([keyPath isEqual:@"style"]) { - id oldStyle = [change objectForKey:NSKeyValueChangeOldKey]; - id newStyle = [change objectForKey:NSKeyValueChangeNewKey]; - id none = [NSNull null]; - if (object == source) { - if (oldStyle != none && newStyle == none) { - [self setSourceAnchor:@"center"]; - } else if (oldStyle == none && newStyle != none && - [sourceAnchor isEqual:@"center"]) { - [self setSourceAnchor:@""]; - } - } - if (object == target) { - if (oldStyle != none && newStyle == none) { - [self setTargetAnchor:@"center"]; - } else if (oldStyle == none && newStyle != none && - [targetAnchor isEqual:@"center"]) { - [self setTargetAnchor:@""]; - } - } - } - dirty = YES; -} - - -// edgeNode and hasEdgeNode use a bit of key-value observing to help the mac GUI keep up - -- (Node*)edgeNode {return edgeNode;} -- (void)setEdgeNode:(Node *)n { - [self willChangeValueForKey:@"edgeNode"]; - [self willChangeValueForKey:@"hasEdgeNode"]; - if (edgeNode != n) { - hasEdgeNode = (n != nil); -#if __has_feature(objc_arc) - edgeNode = n; -#else - [edgeNode release]; - edgeNode = [n retain]; -#endif - // don't set dirty bit, because control points don't need update - } - [self didChangeValueForKey:@"edgeNode"]; - [self didChangeValueForKey:@"hasEdgeNode"]; -} - -- (BOOL)hasEdgeNode { return hasEdgeNode; } -- (void)setHasEdgeNode:(BOOL)b { - [self willChangeValueForKey:@"edgeNode"]; - [self willChangeValueForKey:@"hasEdgeNode"]; - hasEdgeNode = b; - if (hasEdgeNode && edgeNode == nil) { - edgeNode = [[Node alloc] init]; - } - [self didChangeValueForKey:@"edgeNode"]; - [self didChangeValueForKey:@"hasEdgeNode"]; -} - -- (NSString*) sourceAnchor { return sourceAnchor; } -- (void)setSourceAnchor:(NSString *)_sourceAnchor{ - NSString *oldSourceAnchor = sourceAnchor; - if(_sourceAnchor != nil){ - sourceAnchor = [_sourceAnchor copy]; - }else{ - sourceAnchor = @""; - } -#if ! __has_feature(objc_arc) - [oldSourceAnchor release]; -#endif -} - -- (NSString*) targetAnchor { return targetAnchor; } -- (void)setTargetAnchor:(NSString *)_targetAnchor{ - NSString *oldTargetAnchor = targetAnchor; - if(_targetAnchor != nil){ - targetAnchor = [_targetAnchor copy]; - }else{ - targetAnchor = @""; - } -#if ! __has_feature(objc_arc) - [oldTargetAnchor release]; -#endif -} - -@synthesize data; -- (void) insertObject:(GraphElementProperty*)gep - inDataAtIndex:(NSUInteger)index { - [data insertObject:gep atIndex:index]; -} -- (void) removeObjectFromDataAtIndex:(NSUInteger)index { - [data removeObjectAtIndex:index]; -} -- (void) replaceObjectInDataAtIndex:(NSUInteger)index - withObject:(GraphElementProperty*)gep { - [data replaceObjectAtIndex:index withObject:gep]; -} - -- (void)updateData { - // unset everything to avoid redundant defs - [data unsetAtom:@"loop"]; - [data unsetProperty:@"in"]; - [data unsetProperty:@"out"]; - [data unsetAtom:@"bend left"]; - [data unsetAtom:@"bend right"]; - [data unsetProperty:@"bend left"]; - [data unsetProperty:@"bend right"]; - [data unsetProperty:@"looseness"]; - - if (style == nil) { - [data unsetProperty:@"style"]; - } else { - [data setProperty:[style name] forKey:@"style"]; - } - - if (bendMode == EdgeBendModeBasic && bend != 0) { - NSString *bendkey = @"bend right"; - int b = [self bend]; - if (b < 0) { - bendkey = @"bend left"; - b = -b; - } - - if (b == 30) { - [data setAtom:bendkey]; - } else { - [data setProperty:[NSString stringWithFormat:@"%d",b] forKey:bendkey]; - } - - } else if (bendMode == EdgeBendModeInOut) { - [data setProperty:[NSString stringWithFormat:@"%d",inAngle] - forKey:@"in"]; - [data setProperty:[NSString stringWithFormat:@"%d",outAngle] - forKey:@"out"]; - } - - // loop needs to come after in/out - if (source == target) [data setAtom:@"loop"]; - - if (![self isSelfLoop] && ![self isStraight]) - { - [data setProperty:[NSString stringWithFormat:@"%.2f",weight*2.5f] - forKey:@"looseness"]; - } -} - -- (void)setAttributesFromData { - bendMode = EdgeBendModeBasic; - - if ([data isAtomSet:@"bend left"]) { - [self setBend:-30]; - } else if ([data isAtomSet:@"bend right"]) { - [self setBend:30]; - } else if ([data propertyForKey:@"bend left"] != nil) { - NSString *bnd = [data propertyForKey:@"bend left"]; - [self setBend:-[bnd intValue]]; - } else if ([data propertyForKey:@"bend right"] != nil) { - NSString *bnd = [data propertyForKey:@"bend right"]; - [self setBend:[bnd intValue]]; - } else { - [self setBend:0]; - - if ([data propertyForKey:@"in"] != nil && [data propertyForKey:@"out"] != nil) { - bendMode = EdgeBendModeInOut; - [self setInAngle:[[data propertyForKey:@"in"] intValue]]; - [self setOutAngle:[[data propertyForKey:@"out"] intValue]]; - } - } - - if ([data propertyForKey:@"looseness"] != nil) { - weight = [[data propertyForKey:@"looseness"] floatValue] / 2.5f; - } else { - weight = ([self isSelfLoop]) ? 1.0f : 0.4f; - } -} - -- (void)setPropertiesFromEdge:(Edge*)e { - Node *en = [[e edgeNode] copy]; - [self setEdgeNode:en]; -#if ! __has_feature(objc_arc) - [en release]; -#endif - - GraphElementData *d = [[e data] copy]; - [self setData:d]; -#if ! __has_feature(objc_arc) - [d release]; -#endif - - [self setStyle:[e style]]; - [self setBend:[e bend]]; - [self setInAngle:[e inAngle]]; - [self setOutAngle:[e outAngle]]; - [self setBendMode:[e bendMode]]; - [self setWeight:[e weight]]; - - dirty = YES; // cached data will be recomputed lazily, rather than copied -} - -- (NSRect)boundingRect { - [self updateControls]; - NSRect bound = NSRectAround4Points(head, tail, cp1, cp2); - if ([self style] != nil) { - switch ([[self style] decorationStyle]) { - case ED_Arrow: - bound = NSRectWithPoint(bound, [self midTan]); - case ED_Tick: - bound = NSRectWithPoint(bound, [self leftNormal]); - bound = NSRectWithPoint(bound, [self rightNormal]); - case ED_None: - break; - } - if ([[self style] headStyle] != AH_None) { - bound = NSRectWithPoint(bound, [self leftHeadNormal]); - bound = NSRectWithPoint(bound, [self rightHeadNormal]); - } - if ([[self style] tailStyle] != AH_None) { - bound = NSRectWithPoint(bound, [self leftTailNormal]); - bound = NSRectWithPoint(bound, [self rightTailNormal]); - } - } - return bound; -} - -- (void) adjustWeight:(float)handle_dist withCourseness:(float)wcourseness { - float base_dist = NSDistanceBetweenPoints (src, targ); - if (base_dist == 0.0f) { - base_dist = 1.0f; - } - - [self setWeight:roundToNearest(wcourseness, handle_dist / base_dist)]; -} - -- (float) angleOf:(NSPoint)point relativeTo:(NSPoint)base { - float dx = point.x - base.x; - float dy = point.y - base.y; - return radiansToDegrees (good_atan(dx, dy)); -} - -- (void) moveCp1To:(NSPoint)point withWeightCourseness:(float)wc andBendCourseness:(int)bc forceLinkControlPoints:(BOOL)link { - [self updateControls]; - [self adjustWeight:NSDistanceBetweenPoints (point, src) withCourseness:wc]; - - float control_angle = [self angleOf:point relativeTo:src]; - if (bendMode == EdgeBendModeBasic) { - float base_angle = [self angleOf:targ relativeTo:src]; - int b = (int)roundToNearest (bc, base_angle - control_angle); - [self setBend:b]; - } else { - int angle = (int)roundToNearest (bc, control_angle); - if (link) { - [self setInAngle:(inAngle + angle - outAngle)]; - } - [self setOutAngle:angle]; - } -} - -- (void) moveCp1To:(NSPoint)point { - [self moveCp1To:point withWeightCourseness:0.0f andBendCourseness:0 forceLinkControlPoints:NO]; -} - -- (void) moveCp2To:(NSPoint)point withWeightCourseness:(float)wc andBendCourseness:(int)bc forceLinkControlPoints:(BOOL)link { - [self updateControls]; - - if (![self isSelfLoop]) { - [self adjustWeight:NSDistanceBetweenPoints (point, targ) withCourseness:wc]; - } - - float control_angle = [self angleOf:point relativeTo:targ]; - if (bendMode == EdgeBendModeBasic) { - float base_angle = [self angleOf:src relativeTo:targ]; - int b = (int)roundToNearest (bc, control_angle - base_angle); - [self setBend:b]; - } else { - int angle = (int)roundToNearest (bc, control_angle); - if (link) { - [self setOutAngle:(outAngle + angle - inAngle)]; - } - [self setInAngle: angle]; - } -} - -- (void) moveCp2To:(NSPoint)point { - [self moveCp2To:point withWeightCourseness:0.0f andBendCourseness:0 forceLinkControlPoints:NO]; -} - -- (void)reverse { - Node *n; - float f; - NSString *a; - - n = source; - source = target; - target = n; - - f = inAngle; - inAngle = outAngle; - outAngle = f; - - a = sourceAnchor; - sourceAnchor = targetAnchor; - targetAnchor = a; - - [self setBend:-bend]; - - dirty = YES; -} - -- (void)dealloc { - [source removeObserver:self - forKeyPath:@"style"]; - [target removeObserver:self - forKeyPath:@"style"]; -#if ! __has_feature(objc_arc) - [source release]; - [target release]; - [data release]; - [sourceAnchor release]; - [targetAnchor release]; - [super dealloc]; -#endif -} - -- (id)copyWithZone:(NSZone*)zone { - Edge *cp = [[Edge allocWithZone:zone] init]; - [cp setSource:[self source]]; - [cp setTarget:[self target]]; - [cp setSourceAnchor:[self sourceAnchor]]; - [cp setTargetAnchor:[self targetAnchor]]; - [cp setPropertiesFromEdge:self]; - return cp; -} - -+ (Edge*)edge { -#if __has_feature(objc_arc) - return [[Edge alloc] init]; -#else - return [[[Edge alloc] init] autorelease]; -#endif -} - -+ (Edge*)edgeWithSource:(Node*)s andTarget:(Node*)t { -#if __has_feature(objc_arc) - return [[Edge alloc] initWithSource:s andTarget:t]; -#else - return [[[Edge alloc] initWithSource:s andTarget:t] autorelease]; -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/EdgeStyle.h b/tikzit-old/src/common/EdgeStyle.h deleted file mode 100644 index a51f129..0000000 --- a/tikzit-old/src/common/EdgeStyle.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// EdgeStyle.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "PropertyHolder.h" -#import "ColorRGB.h" - -typedef enum { - AH_None = 0, - AH_Plain = 1, - AH_Latex = 2 -} ArrowHeadStyle; - -typedef enum { - ED_None = 0, - ED_Arrow = 1, - ED_Tick = 2 -} EdgeDectorationStyle; - -@interface EdgeStyle : PropertyHolder { - ArrowHeadStyle headStyle, tailStyle; - EdgeDectorationStyle decorationStyle; - float thickness; - ColorRGB *colorRGB; - NSString *name; - NSString *category; -} - -/*! - @property colorRGB - @brief The color to render the line in - */ -@property (copy) ColorRGB *colorRGB; - -@property (copy) NSString *name; -@property (copy) NSString *category; -@property (assign) ArrowHeadStyle headStyle; -@property (assign) ArrowHeadStyle tailStyle; -@property (assign) EdgeDectorationStyle decorationStyle; -@property (assign) float thickness; - -@property (readonly) NSString *tikz; - -- (id)init; -- (id)initWithName:(NSString*)nm; -+ (EdgeStyle*)defaultEdgeStyleWithName:(NSString*)nm; -- (void) updateFromStyle:(EdgeStyle*)style; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/EdgeStyle.m b/tikzit-old/src/common/EdgeStyle.m deleted file mode 100644 index c61e94a..0000000 --- a/tikzit-old/src/common/EdgeStyle.m +++ /dev/null @@ -1,222 +0,0 @@ -// -// EdgeStyle.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "EdgeStyle.h" - -@implementation EdgeStyle - -+ (void)initialize { - [self setKeys:[NSArray arrayWithObjects: - @"tailStyle", - @"headStyle", - @"decorationStyle", - @"thickness", - @"colorRGB.red", - @"colorRGB.blue", - @"colorRGB.green", - @"name", - nil] - triggerChangeNotificationsForDependentKey:@"tikz"]; - [self setKeys:[NSArray arrayWithObjects: - @"colorRGB.name", - nil] - triggerChangeNotificationsForDependentKey:@"colorIsKnown"]; -} - -- (id)initWithName:(NSString*)nm { - self = [super initWithNotificationName:@"EdgeStylePropertyChanged"]; - - if (self != nil) { - headStyle = AH_None; - tailStyle = AH_None; - decorationStyle = ED_None; - colorRGB = [[ColorRGB alloc] initWithRed:0 green:0 blue:0]; - name = nm; - category = nil; - thickness = 1.0f; - } - - return self; -} - -- (id)init { - self = [self initWithName:@"new"]; - return self; -} - -- (id)copyWithZone:(NSZone*)zone { - EdgeStyle *style = [[EdgeStyle allocWithZone:zone] init]; - [style setName:[self name]]; - [style setCategory:[self category]]; - [style setHeadStyle:[self headStyle]]; - [style setTailStyle:[self tailStyle]]; - [style setDecorationStyle:[self decorationStyle]]; - [style setThickness:[self thickness]]; - [style setColorRGB:[self colorRGB]]; - return style; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [name release]; - [category release]; - [colorRGB release]; - [super dealloc]; -#endif -} - -- (NSString*) description { - return [NSString stringWithFormat:@"Edge style \"%@\"", name]; -} - -- (void) updateFromStyle:(EdgeStyle*)style { - [self setName:[style name]]; - [self setCategory:[style category]]; - [self setHeadStyle:[style headStyle]]; - [self setTailStyle:[style tailStyle]]; - [self setDecorationStyle:[style decorationStyle]]; - [self setThickness:[style thickness]]; - [self setColorRGB:[style colorRGB]]; -} - -+ (EdgeStyle*)defaultEdgeStyleWithName:(NSString*)nm { -#if __has_feature(objc_arc) - return [[EdgeStyle alloc] initWithName:nm]; -#else - return [[[EdgeStyle alloc] initWithName:nm] autorelease]; -#endif -} - -- (NSString*)name { return name; } -- (void)setName:(NSString *)s { - if (name != s) { - NSString *oldValue = name; - name = [s copy]; - [self postPropertyChanged:@"name" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (ArrowHeadStyle)headStyle { return headStyle; } -- (void)setHeadStyle:(ArrowHeadStyle)s { - ArrowHeadStyle oldValue = headStyle; - headStyle = s; - [self postPropertyChanged:@"headStyle" oldValue:[NSNumber numberWithInt:oldValue]]; -} - -- (ArrowHeadStyle)tailStyle { return tailStyle; } -- (void)setTailStyle:(ArrowHeadStyle)s { - ArrowHeadStyle oldValue = tailStyle; - tailStyle = s; - [self postPropertyChanged:@"tailStyle" oldValue:[NSNumber numberWithInt:oldValue]]; -} - -- (EdgeDectorationStyle)decorationStyle { return decorationStyle; } -- (void)setDecorationStyle:(EdgeDectorationStyle)s { - EdgeDectorationStyle oldValue = decorationStyle; - decorationStyle = s; - [self postPropertyChanged:@"decorationStyle" oldValue:[NSNumber numberWithInt:oldValue]]; -} -- (float)thickness { return thickness; } -- (void)setThickness:(float)s { - float oldValue = thickness; - thickness = s; - [self postPropertyChanged:@"thickness" oldValue:[NSNumber numberWithFloat:oldValue]]; -} - -- (NSString*)category { - return category; -} - -- (void)setCategory:(NSString *)s { - if (category != s) { - NSString *oldValue = category; - category = [s copy]; - [self postPropertyChanged:@"category" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (ColorRGB*)colorRGB { - return colorRGB; -} - -- (void)setColorRGB:(ColorRGB*)c { - if (colorRGB != c) { - ColorRGB *oldValue = colorRGB; - colorRGB = [c copy]; - [self postPropertyChanged:@"colorRGB" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (NSString*)tikz { - NSMutableString *buf = [NSMutableString stringWithFormat:@"\\tikzstyle{%@}=[", name]; - - NSString *colorName = [colorRGB name]; - if (colorName == nil) - colorName = [colorRGB hexName]; - - if (tailStyle == AH_Plain) - [buf appendString:@"<"]; - else if (tailStyle == AH_Latex) - [buf appendString:@"latex"]; - - [buf appendString:@"-"]; - - if (headStyle == AH_Plain) - [buf appendString:@">"]; - else if (headStyle == AH_Latex) - [buf appendString:@"latex"]; - - if(colorName != nil){ - [buf appendString:@",draw="]; - [buf appendString:colorName]; - } - - if (decorationStyle != ED_None) { - [buf appendString:@",postaction={decorate},decoration={markings,mark="]; - if (decorationStyle == ED_Arrow) - [buf appendString:@"at position .5 with {\\arrow{>}}"]; - else if (decorationStyle == ED_Tick) - [buf appendString:@"at position .5 with {\\draw (0,-0.1) -- (0,0.1);}"]; - [buf appendString:@"}"]; - } - - if (thickness != 1.0f) { - [buf appendFormat:@",line width=%.3f", thickness]; - } - - [buf appendString:@"]"]; - return buf; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/Graph.h b/tikzit-old/src/common/Graph.h deleted file mode 100644 index 1f98858..0000000 --- a/tikzit-old/src/common/Graph.h +++ /dev/null @@ -1,401 +0,0 @@ -// -// Graph.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -/*! - - @mainpage TikZiT - TikZiT is a GUI application for drawing, editing, and parsing TikZ - diagrams. Common code is in src/common, and plaform-specific code is - in src/{osx,linux}. - - */ - - -#import "Node.h" -#import "Edge.h" -#import "GraphChange.h" -#import "Transformer.h" - -/*! - @class Graph - @brief Store a graph, output to TikZ. - @details All of the methods that change a graph return an object of type GraphChange. - Graph changes can be re-done by calling applyGraphChange. They can be undone - by calling applyGraphChange on [change inverse]. - */ -@interface Graph : NSObject { - NSRecursiveLock *graphLock; - BOOL dirty; // keep track of when inEdges and outEdges need an update - NSMutableArray *nodes; - NSMutableArray *edges; - - NSMapTable *inEdges; - NSMapTable *outEdges; - - GraphElementData *data; - NSRect boundingBox; -} - -/*! - @property data - @brief Data associated with the graph. - */ -@property (copy) GraphElementData *data; - -// KVC methods -- (void) insertObject:(GraphElementProperty*)gep - inDataAtIndex:(NSUInteger)index; -- (void) removeObjectFromDataAtIndex:(NSUInteger)index; -- (void) replaceObjectInDataAtIndex:(NSUInteger)index - withObject:(GraphElementProperty*)gep; - -/*! - @property nodes - @brief The set of nodes. - @details The node set is cached internally, so no need to lock - the graph when enumerating. - */ -@property (readonly) NSArray *nodes; - -/*! - @property edges - @brief The set of edges. - @details The edge set is cached internally, so no need to lock - the graph when enumerating. - */ -@property (readonly) NSArray *edges; - -/*! - @property boundingBox - @brief The bounding box of a graph - @details Optional data containing the bounding box, set with - \path [use as bounding box] .... - */ -@property (assign) NSRect boundingBox; - -/*! - @property hasBoundingBox - @brief Returns true if this graph has a bounding box. - */ -@property (readonly) BOOL hasBoundingBox; - - -/*! - @brief Computes graph bounds. - @result Graph bounds. - */ -- (NSRect)bounds; - -/*! - @brief Returns the set of edges incident to the given node set. - @param nds a set of nodes. - @result A set of incident edges. - */ -- (NSSet*)incidentEdgesForNodes:(NSSet*)nds; - -/*! - @brief Returns the set of in-edges for this node. - @param nd a node. - @result A set of edges. -*/ -- (NSSet*)inEdgesForNode:(Node*)nd; - -/*! - @brief Returns the set of out-edges for this node. - @param nd a node. - @result A set of edges. -*/ -- (NSSet*)outEdgesForNode:(Node*)nd; - -/*! - @brief Gives a copy of the full subgraph with the given nodes. - @param nds a set of nodes. - @result A subgraph. - */ -- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds; - -/*! - @brief Gives a copy of the full subgraph with the given nodes. - @param nds a set of nodes. - @param zone an allocation zone - @result A subgraph. - */ -- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds zone:(NSZone*)zone; - -/*! - @brief Gives a set of edge-arrays that partition all of the edges in the graph. - @result An NSet of NSArrays of edges. - */ -- (NSSet*)pathCover; - -/*! - @brief Adds a node. - @param node - @result A GraphChange recording this action. - */ -- (GraphChange*)addNode:(Node*)node; - -/*! - @brief Removes a node. - @param node - @result A GraphChange recording this action. - */ -- (GraphChange*)removeNode:(Node*)node; - -/*! - @brief Removes a set of nodes. - @param nds a set of nodes - @result A GraphChange recording this action. - */ -- (GraphChange*)removeNodes:(NSSet *)nds; - -/*! - @brief Adds an edge. - @param edge - @result A GraphChange recording this action. - */ -- (GraphChange*)addEdge:(Edge*)edge; - -/*! - @brief Removed an edge. - @param edge - @result A GraphChange recording this action. - */ -- (GraphChange*)removeEdge:(Edge*)edge; - -/*! - @brief Removes a set of edges. - @param es a set of edges. - @result A GraphChange recording this action. - */ -- (GraphChange*)removeEdges:(NSSet *)es; - -/*! - @brief Convenience function, intializes an edge with the given - source and target and adds it. - @param source the source of the edge. - @param target the target of the edge. - @result A GraphChange recording this action. - */ -- (GraphChange*)addEdgeFrom:(Node*)source to:(Node*)target; - -/*! - @brief Return the z-index for a given node (lower is farther back). - @param node a node in the graph - @result An int - */ -- (int)indexOfNode:(Node*)node; - -/*! - @brief Set the z-index for a given node (lower is farther back). - @param idx a new z-index - @param node a node in the graph - */ -- (void)setIndex:(int)idx ofNode:(Node*)node; - -/*! - @brief Bring set of nodes forward by one. - @param nodeSet a set of nodes - */ -- (GraphChange*)bringNodesForward:(NSSet*)nodeSet; - -/*! - @brief Bring set of nodes to the front. - @param nodeSet a set of nodes - */ -- (GraphChange*)bringNodesToFront:(NSSet*)nodeSet; - -/*! - @brief Bring set of edges to the front. - @param edgeSet a set of edges - */ -- (GraphChange*)bringEdgesToFront:(NSSet*)edgeSet; - -/*! - @brief Bring set of edges forward by one. - @param edgeSet a set of edges - */ -- (GraphChange*)bringEdgesForward:(NSSet*)edgeSet; - -/*! - @brief Send set of nodes backward by one. - @param nodeSet a set of nodes - */ -- (GraphChange*)sendNodesBackward:(NSSet*)nodeSet; - -/*! - @brief Send set of edges backward by one. - @param edgeSet a set of edges - */ -- (GraphChange*)sendEdgesBackward:(NSSet*)edgeSet; - -/*! - @brief Send set of nodes to back. - @param nodeSet a set of nodes - */ -- (GraphChange*)sendNodesToBack:(NSSet*)nodeSet; - -/*! - @brief Send set of edges to back. - @param edgeSet a set of edges - */ -- (GraphChange*)sendEdgesToBack:(NSSet*)edgeSet; - - -/*! - @brief Transform every node in the graph to screen space. - @param t a transformer - */ -- (void)applyTransformer:(Transformer*)t; - -/*! - @brief Shift nodes by a given distance. - @param ns a set of nodes. - @param p an x and y distance, given as an NSPoint. - @result A GraphChange recording this action. - */ -- (GraphChange*)shiftNodes:(id)ns byPoint:(NSPoint)p; - -/*! - @brief Reverse the given edges - @param es the edges to reverse - @result A GraphChange recording this action. - */ -- (GraphChange*)reverseEdges:(NSSet *)es; - -/*! - @brief Insert the given graph into this one. Used for copy - and paste. - @param g a graph. - @result A GraphChange recording this action. - */ -- (GraphChange*)insertGraph:(Graph*)g; - -/*! - @brief Flip the subgraph defined by the given node set - horizontally. - @param nds a set of nodes. - @result A GraphChange recording this action. - */ -- (GraphChange*)flipHorizontalNodes:(NSSet*)nds; - -/*! - @brief Flip the subgraph defined by the given node set - vertically. - @param nds a set of nodes. - @result A GraphChange recording this action. - */ -- (GraphChange*)flipVerticalNodes:(NSSet*)nds; - -/*! - @brief Apply a graph change. - @details An undo manager should maintain a stack of GraphChange - objects returned. To undo a GraphChange, call this method - with [change inverse] as is argument. - @param ch a graph change. - */ -- (void)applyGraphChange:(GraphChange*)ch; - -/*! - @brief The TikZ representation of this graph. - @details The TikZ representation of this graph. The TikZ code should - contain enough data to totally reconstruct the graph. - @result A string containing TikZ code. - */ -- (NSString*)tikz; - - -/*! - @brief Copy the node set and return a table of copies, whose - keys are the original nodes. This is used to save the state - of a set of nodes in a GraphChange. - @param nds a set of nodes. - @result A NSMapTable of node copies. - */ -+ (NSMapTable*)nodeTableForNodes:(NSSet*)nds; - -+ (NSMapTable*)nodeTableForNodes:(NSSet*)nds withZone:(NSZone*)zone; - -/*! - @brief Copy the edge set and return a table of copies, whose - keys are the original edges. This is used to save the state - of a set of edges in a GraphChange. - @param es a set of edges. - @result A NSMapTable of edge copies. - */ -+ (NSMapTable*)edgeTableForEdges:(NSSet*)es; - -+ (NSMapTable*)edgeTableForEdges:(NSSet*)es withZone:(NSZone*)zone; - -/*! - @brief Compute the bounds for a set of nodes. - @param nds an enumerable collection of nodes. - @result The bounds. - */ -+ (NSRect)boundsForNodes:(id)nds; - -/*! - @brief Factory method for constructing graphs. - @result An empty graph. - */ -+ (Graph*)graph; - -/** - * Initialize an empty graph - */ -- (id)init; - -/** - * Constructs a graph from the given tikz code - * - * See TikzGraphAssembler for more information about the error argument. - */ -+ (Graph*)graphFromTikz:(NSString*)tikz error:(NSError**)e; - -/** - * Constructs a graph from the given tikz code - */ -+ (Graph*)graphFromTikz:(NSString*)tikz; - -/** - * Initialize an empty graph from the given tikz code - * - * Note that this may not return the same object it was called on, - * and will return nil if parsing failed. - * - * See TikzGraphAssembler for more information about the error argument. - */ -- (id)initFromTikz:(NSString*)tikz error:(NSError**)e; - -/** - * Initialize an empty graph from the given tikz code - * - * Note that this may not return the same object it was called on, - * and will return nil if parsing failed. - */ -- (id)initFromTikz:(NSString*)tikz; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Graph.m b/tikzit-old/src/common/Graph.m deleted file mode 100644 index cf09a69..0000000 --- a/tikzit-old/src/common/Graph.m +++ /dev/null @@ -1,922 +0,0 @@ -// -// Graph.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Graph.h" -#import "TikzGraphAssembler.h" -#import "Shape.h" - -@interface Graph (Private) -- (void) shapeDictionaryReplaced:(NSNotification*)notification; -@end - -@implementation Graph - -- (id)init { - self = [super init]; - if (self != nil) { - data = [[GraphElementData alloc] init]; - boundingBox = NSMakeRect(0, 0, 0, 0); - graphLock = [[NSRecursiveLock alloc] init]; - nodes = [[NSMutableArray alloc] initWithCapacity:10]; - edges = [[NSMutableArray alloc] initWithCapacity:10]; - inEdges = nil; - outEdges = nil; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(shapeDictionaryReplaced:) - name:@"ShapeDictionaryReplaced" - object:[Shape class]]; - } - return self; -} - -- (id)initFromTikz:(NSString*)tikz error:(NSError**)e { -#if __has_feature(objc_arc) - return [TikzGraphAssembler parseTikz:tikz error:e]; -#else - [self release]; - return [[TikzGraphAssembler parseTikz:tikz error:e] retain]; -#endif -} - -- (id)initFromTikz:(NSString*)tikz { - return [self initFromTikz:tikz error:NULL]; -} - -- (id) copyWithZone:(NSZone*)zone { - Graph *newGraph = [self copyOfSubgraphWithNodes:[NSSet setWithArray:nodes] zone:zone]; - [newGraph setData:[self data]]; - return newGraph; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [graphLock lock]; -#if ! __has_feature(objc_arc) - [inEdges release]; - [outEdges release]; - [edges release]; - [nodes release]; - [data release]; - [graphLock unlock]; - [graphLock release]; - - [super dealloc]; -#endif -} - -- (void)sync { - [graphLock lock]; - if (dirty) { -#if ! __has_feature(objc_arc) - [inEdges release]; - [outEdges release]; -#endif - inEdges = [[NSMapTable alloc] initWithKeyOptions:NSMapTableStrongMemory valueOptions:NSMapTableStrongMemory capacity:10]; - outEdges = [[NSMapTable alloc] initWithKeyOptions:NSMapTableStrongMemory valueOptions:NSMapTableStrongMemory capacity:10]; - -#if ! __has_feature(objc_arc) - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -#endif - - for (Edge *e in edges) { - NSMutableSet *ie = [inEdges objectForKey:[e target]]; - NSMutableSet *oe = [outEdges objectForKey:[e source]]; - - if (ie == nil) { - ie = [NSMutableSet setWithCapacity:4]; - [inEdges setObject:ie forKey:[e target]]; - } - - if (oe == nil) { - oe = [NSMutableSet setWithCapacity:4]; - [outEdges setObject:oe forKey:[e source]]; - } - - [ie addObject:e]; - [oe addObject:e]; - } - -#if ! __has_feature(objc_arc) - [pool drain]; -#endif - - dirty = NO; - } - [graphLock unlock]; -} - -@synthesize nodes; -@synthesize edges; - -@synthesize data; -- (void) insertObject:(GraphElementProperty*)gep - inDataAtIndex:(NSUInteger)index { - [data insertObject:gep atIndex:index]; -} -- (void) removeObjectFromDataAtIndex:(NSUInteger)index { - [data removeObjectAtIndex:index]; -} -- (void) replaceObjectInDataAtIndex:(NSUInteger)index - withObject:(GraphElementProperty*)gep { - [data replaceObjectAtIndex:index withObject:gep]; -} - -@synthesize boundingBox; - -- (NSRect)bounds { - [graphLock lock]; - NSRect b = [Graph boundsForNodes:nodes]; - [graphLock unlock]; - return b; -} - -- (BOOL)hasBoundingBox { - return !( - boundingBox.size.width == 0 && - boundingBox.size.height == 0 - ); -} - -- (NSSet*)inEdgesForNode:(Node*)nd { - [self sync]; -#if __has_feature(objc_arc) - return [inEdges objectForKey:nd]; -#else - return [[[inEdges objectForKey:nd] retain] autorelease]; -#endif -} - -- (NSSet*)outEdgesForNode:(Node*)nd { - [self sync]; -#if __has_feature(objc_arc) - return [outEdges objectForKey:nd]; -#else - return [[[outEdges objectForKey:nd] retain] autorelease]; -#endif -} - -- (NSSet*)incidentEdgesForNodes:(NSSet*)nds { - [self sync]; - - NSMutableSet *mset = [NSMutableSet setWithCapacity:10]; - for (Node *n in nds) { - [mset unionSet:[self inEdgesForNode:n]]; - [mset unionSet:[self outEdgesForNode:n]]; - } - - return mset; -} - -- (void)applyTransformer:(Transformer *)t { - [graphLock lock]; - for (Node *n in nodes) { - [n setPoint:[t toScreen:[n point]]]; - } - [graphLock unlock]; -} - -- (GraphChange*)addNode:(Node *)node{ - [graphLock lock]; - NSSet *addedNode; - - // addNode is a no-op if graph already contains node - if (![nodes containsObject:node]) { - [nodes addObject:node]; - dirty = YES; - addedNode = [NSSet setWithObject:node]; - } else { - addedNode = [NSSet set]; - } - [graphLock unlock]; - - return [GraphChange graphAdditionWithNodes:addedNode - edges:[NSSet set]]; -} - -- (GraphChange*)removeNode:(Node*)node { - [graphLock lock]; - NSMutableSet *affectedEdges = [NSMutableSet set]; - for (Edge *e in edges) { - if ([e source] == node || [e target] == node) { - [affectedEdges addObject:e]; - } - } - for (Edge *e in affectedEdges) { - [edges removeObject:e]; - } - [nodes removeObject:node]; - dirty = YES; - [graphLock unlock]; - - return [GraphChange graphDeletionWithNodes:[NSSet setWithObject:node] - edges:affectedEdges]; -} - -- (GraphChange*)removeNodes:(NSSet *)nds { - [graphLock lock]; - - Node *n; - Edge *e; - - NSMutableSet *affectedEdges = [NSMutableSet set]; - NSEnumerator *en = [edges objectEnumerator]; - while ((e = [en nextObject])) { - if ([nds containsObject:[e source]] || [nds containsObject:[e target]]) { - [affectedEdges addObject:e]; - } - } - - en = [affectedEdges objectEnumerator]; - while ((e = [en nextObject])) [edges removeObject:e]; - - en = [nds objectEnumerator]; - while ((n = [en nextObject])) [nodes removeObject:n]; - - dirty = YES; - [graphLock unlock]; - - return [GraphChange graphDeletionWithNodes:nds edges:affectedEdges]; -} - -- (GraphChange*)addEdge:(Edge*)edge { - [graphLock lock]; - NSSet *addedEdge; - - // addEdge is a no-op if graph already contains edge - if (![edges containsObject:edge]) { - [edges addObject:edge]; - dirty = YES; - addedEdge = [NSSet setWithObject:edge]; - } else { - addedEdge = [NSSet set]; - } - [graphLock unlock]; - - return [GraphChange graphAdditionWithNodes:[NSSet set] - edges:addedEdge]; -} - -- (GraphChange*)removeEdge:(Edge *)edge { - [graphLock lock]; - [edges removeObject:edge]; - dirty = YES; - [graphLock unlock]; - return [GraphChange graphDeletionWithNodes:[NSSet set] - edges:[NSSet setWithObject:edge]]; -} - -- (GraphChange*)removeEdges:(NSSet *)es { - [graphLock lock]; - - for (Edge *e in es) { - [edges removeObject:e]; - } - dirty = YES; - [graphLock unlock]; - return [GraphChange graphDeletionWithNodes:[NSSet set] edges:es]; -} - -- (GraphChange*)addEdgeFrom:(Node *)source to:(Node *)target { - return [self addEdge:[Edge edgeWithSource:source andTarget:target]]; -} - -- (GraphChange*)shiftNodes:(id)ns byPoint:(NSPoint)p { - NSPoint newLoc; - NSMutableSet *nodeSet = [NSMutableSet setWithCapacity:5]; - for (Node *n in ns) { - newLoc = NSMakePoint([n point].x + p.x, [n point].y + p.y); - [n setPoint:newLoc]; - [nodeSet addObject:n]; - } - return [GraphChange shiftNodes:nodeSet byPoint:p]; -} - -- (GraphChange*)reverseEdges:(NSSet *)es { - [graphLock lock]; - for (Edge *e in es) { - [e reverse]; - } - dirty = YES; - [graphLock unlock]; - return [GraphChange reverseEdges:es]; -} - -- (int)indexOfNode:(Node *)node { - return [nodes indexOfObject:node]; -} - -- (void)setIndex:(int)idx ofNode:(Node *)node { - [graphLock lock]; - - if ([nodes containsObject:node]) { - [nodes removeObject:node]; - [nodes insertObject:node atIndex:idx]; - } - - [graphLock unlock]; -} - -- (int)indexOfEdge:(Edge *)edge { - return [edges indexOfObject:edge]; -} - -- (void)setIndex:(int)idx ofEdge:(Edge *)edge { - [graphLock lock]; - - if ([edges containsObject:edge]) { - [edges removeObject:edge]; - [edges insertObject:edge atIndex:idx]; - } - - [graphLock unlock]; -} - -- (GraphChange*)bringNodesForward:(NSSet*)nodeSet { - NSArray *oldOrder = [nodes copy]; - [graphLock lock]; - // start at the top of the array and work backwards - for (int i = [nodes count]-2; i >= 0; --i) { - if ( [nodeSet containsObject:[nodes objectAtIndex:i]] && - ![nodeSet containsObject:[nodes objectAtIndex:i+1]]) - { - [self setIndex:(i+1) ofNode:[nodes objectAtIndex:i]]; - } - } - GraphChange *change = [GraphChange nodeOrderChangeFrom:oldOrder to:nodes moved:nodeSet]; - [graphLock unlock]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)bringNodesToFront:(NSSet*)nodeSet { - NSArray *oldOrder = [nodes copy]; - int i = 0, top = [nodes count]-1; - - while (i <= top) { - if ([nodeSet containsObject:[nodes objectAtIndex:i]]) { - [self setIndex:([nodes count]-1) ofNode:[nodes objectAtIndex:i]]; - --top; - } else { - ++i; - } - } - GraphChange *change = [GraphChange nodeOrderChangeFrom:oldOrder to:nodes moved:nodeSet]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)bringEdgesForward:(NSSet*)edgeSet { - [graphLock lock]; - NSArray *oldOrder = [edges copy]; - // start at the top of the array and work backwards - for (int i = [edges count]-2; i >= 0; --i) { - if ( [edgeSet containsObject:[edges objectAtIndex:i]] && - ![edgeSet containsObject:[edges objectAtIndex:i+1]]) - { - [self setIndex:(i+1) ofEdge:[edges objectAtIndex:i]]; - } - } - GraphChange *change = [GraphChange edgeOrderChangeFrom:oldOrder to:edges moved:edgeSet]; - [graphLock unlock]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)bringEdgesToFront:(NSSet*)edgeSet { - NSArray *oldOrder = [edges copy]; - int i = 0, top = [edges count]-1; - - while (i <= top) { - if ([edgeSet containsObject:[edges objectAtIndex:i]]) { - [self setIndex:([edges count]-1) ofEdge:[edges objectAtIndex:i]]; - --top; - } else { - ++i; - } - } - GraphChange *change = [GraphChange edgeOrderChangeFrom:oldOrder to:edges moved:edgeSet]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)sendNodesBackward:(NSSet*)nodeSet { - [graphLock lock]; - NSArray *oldOrder = [nodes copy]; - // start at the top of the array and work backwards - for (int i = 1; i < [nodes count]; ++i) { - if ( [nodeSet containsObject:[nodes objectAtIndex:i]] && - ![nodeSet containsObject:[nodes objectAtIndex:i-1]]) - { - [self setIndex:(i-1) ofNode:[nodes objectAtIndex:i]]; - } - } - GraphChange *change = [GraphChange nodeOrderChangeFrom:oldOrder to:nodes moved:nodeSet]; - [graphLock unlock]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)sendEdgesBackward:(NSSet*)edgeSet { - [graphLock lock]; - NSArray *oldOrder = [edges copy]; - // start at the top of the array and work backwards - for (int i = 1; i < [edges count]; ++i) { - if ( [edgeSet containsObject:[edges objectAtIndex:i]] && - ![edgeSet containsObject:[edges objectAtIndex:i-1]]) - { - [self setIndex:(i-1) ofEdge:[edges objectAtIndex:i]]; - } - } - GraphChange *change = [GraphChange edgeOrderChangeFrom:oldOrder to:edges moved:edgeSet]; - [graphLock unlock]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)sendNodesToBack:(NSSet*)nodeSet { - NSArray *oldOrder = [nodes copy]; - int i = [nodes count]-1, bot = 0; - - while (i >= bot) { - if ([nodeSet containsObject:[nodes objectAtIndex:i]]) { - [self setIndex:0 ofNode:[nodes objectAtIndex:i]]; - ++bot; - } else { - --i; - } - } - GraphChange *change = [GraphChange nodeOrderChangeFrom:oldOrder to:nodes moved:nodeSet]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)sendEdgesToBack:(NSSet*)edgeSet { - NSArray *oldOrder = [edges copy]; - int i = [edges count]-1, bot = 0; - - while (i >= bot) { - if ([edgeSet containsObject:[edges objectAtIndex:i]]) { - [self setIndex:0 ofEdge:[edges objectAtIndex:i]]; - ++bot; - } else { - --i; - } - } - GraphChange *change = [GraphChange edgeOrderChangeFrom:oldOrder to:edges moved:edgeSet]; - -#if ! __has_feature(objc_arc) - [oldOrder release]; -#endif - - return change; -} - -- (GraphChange*)insertGraph:(Graph*)g { - [graphLock lock]; - - for (Node *n in [g nodes]) { - [self addNode:n]; - } - - for (Edge *e in [g edges]) { - [self addEdge:e]; - } - - dirty = YES; - - [graphLock unlock]; - - - return [GraphChange graphAdditionWithNodes:[NSSet setWithArray:[g nodes]] edges:[NSSet setWithArray:[g edges]]]; -} - -- (void)flipNodes:(NSSet*)nds horizontal:(BOOL)horiz { - [graphLock lock]; - - NSRect bds = [Graph boundsForNodes:nds]; - float ctr; - if (horiz) ctr = bds.origin.x + (bds.size.width/2); - else ctr = bds.origin.y + (bds.size.height/2); - - Node *n; - NSPoint p; - NSEnumerator *en = [nds objectEnumerator]; - while ((n = [en nextObject])) { - p = [n point]; - if (horiz) p.x = 2 * ctr - p.x; - else p.y = 2 * ctr - p.y; - [n setPoint:p]; - } - - Edge *e; - en = [edges objectEnumerator]; - while ((e = [en nextObject])) { - if ([nds containsObject:[e source]] && - [nds containsObject:[e target]]) - { - if ([e bendMode] == EdgeBendModeInOut) { - if (horiz) { - if ([e inAngle] < 0) [e setInAngle:(-180 - [e inAngle])]; - else [e setInAngle:180 - [e inAngle]]; - - if ([e outAngle] < 0) [e setOutAngle:(-180 - [e outAngle])]; - else [e setOutAngle:180 - [e outAngle]]; - } else { - [e setInAngle:-[e inAngle]]; - [e setOutAngle:-[e outAngle]]; - } - } else { - [e setBend:-[e bend]]; - } - } - } - - [graphLock unlock]; -} - -- (GraphChange*)flipHorizontalNodes:(NSSet*)nds { - [self flipNodes:nds horizontal:YES]; - return [GraphChange flipNodes:nds horizontal:YES]; -} - -- (GraphChange*)flipVerticalNodes:(NSSet*)nds { - [self flipNodes:nds horizontal:NO]; - return [GraphChange flipNodes:nds horizontal:NO]; -} - -- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds { - return [self copyOfSubgraphWithNodes:nds zone:NSDefaultMallocZone()]; -} - -- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds zone:(NSZone*)zone { - [graphLock lock]; - - NSMapTable *newNds = [Graph nodeTableForNodes:nds withZone:zone]; - Graph* newGraph = [[Graph allocWithZone:zone] init]; - - for (Node *nd in [newNds objectEnumerator]) { - [newGraph addNode:nd]; - } - - for (Edge *e in edges) { - if ([nds containsObject:[e source]] && [nds containsObject:[e target]]) { - Edge *e1 = [e copyWithZone:zone]; - [e1 setSource:[newNds objectForKey:[e source]]]; - [e1 setTarget:[newNds objectForKey:[e target]]]; - [newGraph addEdge:e1]; -#if ! __has_feature(objc_arc) - [e1 release]; // e1 belongs to newGraph -#endif - } - } - - [graphLock unlock]; - - return newGraph; -} - -- (NSSet*)pathCover { - [self sync]; - - NSMutableSet *cover = [NSMutableSet set]; -#if ! __has_feature(objc_arc) - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -#endif - NSMutableSet *remainingEdges = [NSMutableSet setWithArray:edges]; - - while ([remainingEdges count] != 0) { - NSMutableArray *path = [[NSMutableArray alloc] init]; - NSSet *succs; - Edge *succ; - NSEnumerator *en; - - Edge *e = [remainingEdges anyObject]; - - while (e!=nil) { - [path addObject:e]; - [remainingEdges removeObject:e]; - - succs = [self outEdgesForNode:[e target]]; - en = [succs objectEnumerator]; - e = nil; - - while ((succ = [en nextObject])) { - if ([remainingEdges containsObject:succ]) e = succ; - } - } - - [cover addObject:path]; -#if ! __has_feature(objc_arc) - [path release]; -#endif - } - -#if ! __has_feature(objc_arc) - [pool drain]; -#endif - return cover; -} - -- (void)applyGraphChange:(GraphChange*)ch { - [graphLock lock]; - switch ([ch changeType]) { - case GraphAddition: - for (Node *n in [[ch affectedNodes] objectEnumerator]) { - [nodes addObject:n]; - } - - for (Edge *e in [[ch affectedEdges] objectEnumerator]) { - [edges addObject:e]; - } - - break; - case GraphDeletion: - for (Edge *e in [[ch affectedEdges] objectEnumerator]) { - [edges removeObject:e]; - } - - for (Node *n in [[ch affectedNodes] objectEnumerator]) { - [nodes removeObject:n]; - } - - break; - case NodePropertyChange: - [[ch nodeRef] setPropertiesFromNode:[ch nwNode]]; - break; - case NodesPropertyChange: - for (Node *key in [[ch nwNodeTable] keyEnumerator]) { - [key setPropertiesFromNode:[[ch nwNodeTable] objectForKey:key]]; - } - break; - case EdgePropertyChange: - [[ch edgeRef] setPropertiesFromEdge:[ch nwEdge]]; - break; - case EdgesPropertyChange: - for (Edge *key in [[ch nwEdgeTable] keyEnumerator]) { - [key setPropertiesFromEdge:[[ch nwEdgeTable] objectForKey:key]]; - } - break; - case NodesShift: - for (Node *n in [[ch affectedNodes] objectEnumerator]) { - [n setPoint:NSMakePoint([n point].x + [ch shiftPoint].x, - [n point].y + [ch shiftPoint].y)]; - } - break; - case NodesFlip: - [self flipNodes:[ch affectedNodes] horizontal:[ch horizontal]]; - break; - case EdgesReverse: - for (Edge *e in [[ch affectedEdges] objectEnumerator]) { - [e reverse]; - } - break; - case BoundingBoxChange: - [self setBoundingBox:[ch nwBoundingBox]]; - break; - case GraphPropertyChange: - [data setArray:[ch nwGraphData]]; - break; - case NodeOrderChange: - [nodes setArray:[ch nwNodeOrder]]; - break; - case EdgeOrderChange: - [edges setArray:[ch nwEdgeOrder]]; - break; - } - - dirty = YES; - [graphLock unlock]; -} - -//- (void)undoGraphChange:(GraphChange*)ch { -// [self applyGraphChange:[GraphChange inverseGraphChange:ch]]; -//} - -- (NSString*)tikz { - [graphLock lock]; - - NSMutableString *code = [NSMutableString - stringWithFormat:@"\\begin{tikzpicture}%@\n", - [[self data] tikzList]]; - - if ([self hasBoundingBox]) { - [code appendFormat:@"\t\\path [use as bounding box] (%@,%@) rectangle (%@,%@);\n", - [NSNumber numberWithFloat:boundingBox.origin.x], - [NSNumber numberWithFloat:boundingBox.origin.y], - [NSNumber numberWithFloat:boundingBox.origin.x + boundingBox.size.width], - [NSNumber numberWithFloat:boundingBox.origin.y + boundingBox.size.height]]; - } - -// NSArray *sortedNodeList = [[nodes allObjects] -// sortedArrayUsingSelector:@selector(compareTo:)]; - //NSMutableDictionary *nodeNames = [NSMutableDictionary dictionary]; - - if ([nodes count] > 0) [code appendFormat:@"\t\\begin{pgfonlayer}{nodelayer}\n"]; - - int i = 0; - for (Node *n in nodes) { - [n updateData]; - [n setName:[NSString stringWithFormat:@"%d", i]]; - [code appendFormat:@"\t\t\\node %@ (%d) at (%@, %@) {%@};\n", - [[n data] tikzList], - i, - formatFloat([n point].x, 4), - formatFloat([n point].y, 4), - [n label] - ]; - i++; - } - - if ([nodes count] > 0) [code appendFormat:@"\t\\end{pgfonlayer}\n"]; - if ([edges count] > 0) [code appendFormat:@"\t\\begin{pgfonlayer}{edgelayer}\n"]; - - NSString *nodeStr; - for (Edge *e in edges) { - [e updateData]; - - if ([e hasEdgeNode]) { - nodeStr = [NSString stringWithFormat:@"node%@{%@} ", - [[[e edgeNode] data] tikzList], - [[e edgeNode] label] - ]; - } else { - nodeStr = @""; - } - - NSString *edata = [[e data] tikzList]; - - NSString *srcAnchor; - NSString *tgtAnchor; - - if ([[e sourceAnchor] isEqual:@""]) { - srcAnchor = @""; - } else { - srcAnchor = [NSString stringWithFormat:@".%@", [e sourceAnchor]]; - } - - if ([[e targetAnchor] isEqual:@""]) { - tgtAnchor = @""; - } else { - tgtAnchor = [NSString stringWithFormat:@".%@", [e targetAnchor]]; - } - - [code appendFormat:@"\t\t\\draw%@ (%@%@) to %@(%@%@);\n", - ([edata isEqual:@""]) ? @"" : [NSString stringWithFormat:@" %@", edata], - [[e source] name], - srcAnchor, - nodeStr, - ([e source] == [e target]) ? @"" : [[e target] name], - tgtAnchor - ]; - } - - if ([edges count] > 0) [code appendFormat:@"\t\\end{pgfonlayer}\n"]; - - [code appendString:@"\\end{tikzpicture}"]; - - [graphLock unlock]; - - return code; -} - -+ (Graph*)graph { -#if __has_feature(objc_arc) - return [[self alloc] init]; -#else - return [[[self alloc] init] autorelease]; -#endif -} - -+ (Graph*)graphFromTikz:(NSString*)tikz error:(NSError**)e { - return [TikzGraphAssembler parseTikz:tikz error:e]; -} - -+ (Graph*)graphFromTikz:(NSString*)tikz { - return [self graphFromTikz:tikz error:NULL]; -} - -+ (NSMapTable*)nodeTableForNodes:(NSSet*)nds { - return [self nodeTableForNodes:nds withZone:NSDefaultMallocZone()]; -} - -+ (NSMapTable*)nodeTableForNodes:(NSSet*)nds withZone:(NSZone*)zone { - NSMapTable *tab = [[NSMapTable allocWithZone:zone] - initWithKeyOptions:NSMapTableStrongMemory - valueOptions:NSMapTableStrongMemory - capacity:[nds count]]; - for (Node *n in nds) { - Node *ncopy = [n copyWithZone:zone]; - [tab setObject:ncopy forKey:n]; -#if ! __has_feature(objc_arc) - [ncopy release]; // tab should still retain ncopy. -#endif - } -#if __has_feature(objc_arc) - return tab; -#else - return [tab autorelease]; -#endif -} - -+ (NSMapTable*)edgeTableForEdges:(NSSet*)es { - return [self edgeTableForEdges:es withZone:NSDefaultMallocZone()]; -} - -+ (NSMapTable*)edgeTableForEdges:(NSSet*)es withZone:(NSZone*)zone { - NSMapTable *tab = [[NSMapTable allocWithZone:zone] - initWithKeyOptions:NSMapTableStrongMemory - valueOptions:NSMapTableStrongMemory - capacity:[es count]]; - for (Edge *e in es) { - Edge *ecopy = [e copyWithZone:zone]; - [tab setObject:ecopy forKey:e]; -#if ! __has_feature(objc_arc) - [ecopy release]; // tab should still retain ecopy. -#endif - } - return tab; -} - - -+ (NSRect)boundsForNodes:(id)nds { - NSPoint tl, br; - NSPoint p; - BOOL hasPoints = NO; - for (Node *n in nds) { - p = [n point]; - if (!hasPoints) { - tl = p; - br = p; - hasPoints = YES; - } else { - if (p.x < tl.x) tl.x = p.x; - if (p.y > tl.y) tl.y = p.y; - if (p.x > br.x) br.x = p.x; - if (p.y < br.y) br.y = p.y; - } - } - - return (hasPoints) ? NSRectAroundPoints(tl, br) : NSMakeRect(0, 0, 0, 0); -} - -@end - -@implementation Graph (Private) -- (void) shapeDictionaryReplaced:(NSNotification*)notification { - for (Edge *e in edges) { - [e recalculateProperties]; - } -} -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/GraphChange.h b/tikzit-old/src/common/GraphChange.h deleted file mode 100644 index 0e71a90..0000000 --- a/tikzit-old/src/common/GraphChange.h +++ /dev/null @@ -1,344 +0,0 @@ -// -// GraphChange.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Node.h" -#import "Edge.h" - -typedef enum { - GraphAddition, - GraphDeletion, - NodePropertyChange, - EdgePropertyChange, - NodesPropertyChange, - EdgesPropertyChange, - NodesShift, - NodesFlip, - EdgesReverse, - BoundingBoxChange, - GraphPropertyChange, - NodeOrderChange, - EdgeOrderChange -} ChangeType; - -/*! - @class GraphChange - @brief Store the data associated with a graph change. - @details All of the methods that change a graph return an object of type GraphChange. - Graph changes can be re-done by calling [graph applyGraphChange:]. They can be undone - by calling applyGraphChange on [change inverse]. This class has no public initializer, - so everything should be constructed by factory methods. - */ -@interface GraphChange : NSObject { - ChangeType changeType; - - // for addition, deletion, and shifts - NSSet *affectedNodes; - NSSet *affectedEdges; - NSPoint shiftPoint; - - // for flip - BOOL horizontal; - - // for property changes - Node *nodeRef; - Edge *edgeRef; - - Node *oldNode, *nwNode; - Edge *oldEdge, *nwEdge; - NSMapTable *oldNodeTable, *nwNodeTable; - NSMapTable *oldEdgeTable, *nwEdgeTable; - NSRect oldBoundingBox, nwBoundingBox; - GraphElementData *oldGraphData, *nwGraphData; - - NSArray *oldNodeOrder, *nwNodeOrder; - NSArray *oldEdgeOrder, *nwEdgeOrder; -} - -/*! - @property changeType - @brief Type of GraphChange. - */ -@property (assign) ChangeType changeType; - -/*! - @property shiftPoint - @brief A point storing a shifted distance. - */ -@property (assign) NSPoint shiftPoint; - -/*! - @property horizontal - @brief Flags whether nodes were flipped horizontally - */ -@property (assign) BOOL horizontal; - -/*! - @property affectedNodes - @brief A set of nodes affected by this change, may be undefined. - */ -@property (copy) NSSet *affectedNodes; - -/*! - @property affectedEdges - @brief A set of edges affected by this change, may be undefined. - */ -@property (copy) NSSet *affectedEdges; - -/*! - @property nodeRef - @brief A reference to a single node affected by this change, may be undefined. - */ -@property (retain) Node *nodeRef; - -/*! - @property oldNode - @brief A copy of the node pre-change. - */ -@property (copy) Node *oldNode; - -/*! - @property nwNode - @brief A copy of the node post-change. - */ -@property (copy) Node *nwNode; - -/*! - @property edgeRef - @brief A reference to a single edge affected by this change, may be undefined. - */ -@property (retain) Edge *edgeRef; - -/*! - @property oldEdge - @brief A copy of the edge pre-change. - */ -@property (copy) Edge *oldEdge; - -/*! - @property nwEdge - @brief A copy of the edge post-change. - */ -@property (copy) Edge *nwEdge; - -/*! - @property oldNodeTable - @brief A a table containing copies of a set of nodes pre-change. - */ -@property (retain) NSMapTable *oldNodeTable; - -/*! - @property nwNodeTable - @brief A a table containing copies of a set of nodes post-change. - */ -@property (retain) NSMapTable *nwNodeTable; - -/*! - @property oldEdgeTable - @brief A a table containing copies of a set of edges pre-change. - */ -@property (retain) NSMapTable *oldEdgeTable; - -/*! - @property nwEdgeTable - @brief A a table containing copies of a set of edges post-change. - */ -@property (retain) NSMapTable *nwEdgeTable; - -/*! - @property oldBoundingBox - @brief The old bounding box. - */ -@property (assign) NSRect oldBoundingBox; - -/*! - @property nwBoundingBox - @brief The new bounding box. - */ -@property (assign) NSRect nwBoundingBox; - -/*! - @property oldGraphData - @brief The old graph data. - */ -@property (copy) GraphElementData *oldGraphData; - -/*! - @property nwGraphData - @brief The new graph data. - */ -@property (copy) GraphElementData *nwGraphData; - -/*! - @property oldNodeOrder - @brief The old node list. - */ -@property (copy) NSArray *oldNodeOrder; - -/*! - @property nwNodeOrder - @brief The new node list. - */ -@property (copy) NSArray *nwNodeOrder; - -/*! - @property oldEdgeOrder - @brief The old edge list. - */ -@property (copy) NSArray *oldEdgeOrder; - -/*! - @property nwEdgeOrder - @brief The new edge list. - */ -@property (copy) NSArray *nwEdgeOrder; - -/*! - @brief Invert a GraphChange. - @details Invert a GraphChange. Calling [graph applyGraphChange:[[graph msg:...] invert]] - should leave the graph unchanged for any method of Graph that returns a - GraphChange. - @result The inverse of the current Graph Change. - */ -- (GraphChange*)invert; - -/*! - @brief Construct a graph addition. affectedNodes are the added nodes, - affectedEdges are the added edges. - @param ns a set of nodes. - @param es a set of edges. - @result A graph addition. - */ -+ (GraphChange*)graphAdditionWithNodes:(NSSet*)ns edges:(NSSet*)es; - -/*! - @brief Construct a graph deletion. affectedNodes are the deleted nodes, - affectedEdges are the deleted edges. - @param ns a set of nodes. - @param es a set of edges. - @result A graph deletion. - */ -+ (GraphChange*)graphDeletionWithNodes:(NSSet*)ns edges:(NSSet*)es; - -/*! - @brief Construct a property change of a single node. - @param nd the affected node. - @param old a copy of the node pre-change - @param nw a copy of the node post-change - @result A property change of a single node. - */ -+ (GraphChange*)propertyChangeOfNode:(Node*)nd fromOld:(Node*)old toNew:(Node*)nw; - -/*! - @brief Construct a property change of a single edge. - @param e the affected edge. - @param old a copy of the edge pre-change - @param nw a copy of the edge post-change - @result A property change of a single node. - */ -+ (GraphChange*)propertyChangeOfEdge:(Edge*)e fromOld:(Edge *)old toNew:(Edge *)nw; - -/*! - @brief Construct a property change of set of nodes. - @details Construct a property change of set of nodes. oldC and newC should be - constructed using the class method [Graph nodeTableForNodes:] before - and after the property change, respectively. The affected nodes are - keys(oldC) = keys(newC). - @param oldC a table of copies of nodes pre-change - @param newC a table of copies of nodes post-change - @result A property change of a set of nodes. - */ -+ (GraphChange*)propertyChangeOfNodesFromOldCopies:(NSMapTable*)oldC - toNewCopies:(NSMapTable*)newC; - -/*! - @brief Construct a property change of set of edges. - @details Construct a property change of set of edges. oldC and newC should be - constructed using the class method [Graph edgeTableForEdges:] before - and after the property change, respectively. The affected edges are - keys(oldC) = keys(newC). - @param oldC a table of copies of edges pre-change - @param newC a table of copies of edges post-change - @result A property change of a set of edges. - */ -+ (GraphChange*)propertyChangeOfEdgesFromOldCopies:(NSMapTable*)oldC - toNewCopies:(NSMapTable*)newC; - - -/*! - @brief Construct a shift of a set of nodes by a given point. - @param ns the affected nodes. - @param p a point storing (dx,dy) - @result A shift of a set of nodes. - */ -+ (GraphChange*)shiftNodes:(NSSet*)ns byPoint:(NSPoint)p; - -/*! - @brief Construct a horizontal or vertical flip of a set of nodes. - @param ns the affected nodes. - @param b flag for whether to flip horizontally - @result A flip of a set of nodes. - */ -+ (GraphChange*)flipNodes:(NSSet*)ns horizontal:(BOOL)b; - -/*! - @brief Construct a reversal of a set of edges. - @param es the affected edges. - @result A reverse of a set of edges. - */ -+ (GraphChange*)reverseEdges:(NSSet*)es; - -/*! - @brief Construct a bounding box change - @param oldBB the old bounding box - @param newBB the new bounding box - @result A bounding box change. - */ -+ (GraphChange*)changeBoundingBoxFrom:(NSRect)oldBB to:(NSRect)newBB; - -/*! - @brief Construct a graph property change - @param oldData the old graph data - @param newData the new graph data - @result A graph property change. - */ -+ (GraphChange*)propertyChangeOfGraphFrom:(GraphElementData*)oldData to:(GraphElementData*)newData; - -/*! - @brief Construct a node order change - @param old The old ordering - @param new The new ordering - @result A node order change - */ -+ (GraphChange*)nodeOrderChangeFrom:(NSArray*)old to:(NSArray*)new moved:(NSSet*)affected; - -/*! - @brief Construct an edge order change - @param old The old ordering - @param new The new ordering - @result A edge order change - */ -+ (GraphChange*)edgeOrderChangeFrom:(NSArray*)old to:(NSArray*)new moved:(NSSet*)affected; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/GraphChange.m b/tikzit-old/src/common/GraphChange.m deleted file mode 100644 index 29a3939..0000000 --- a/tikzit-old/src/common/GraphChange.m +++ /dev/null @@ -1,369 +0,0 @@ -// -// GraphChange.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -// GraphChange : store the data associated to a single, undo-able change -// to a graph. An undo manager should maintain a stack of such changes -// and undo/redo them on request using [graph applyGraphChange:...]. - -#import "GraphChange.h" - - -@implementation GraphChange - -- (id)init { - return [super init]; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [affectedNodes release]; - [affectedEdges release]; - [nodeRef release]; - [edgeRef release]; - [oldNode release]; - [nwNode release]; - [oldEdge release]; - [nwEdge release]; - [oldNodeTable release]; - [nwNodeTable release]; - [oldEdgeTable release]; - [nwEdgeTable release]; - [oldGraphData release]; - [nwGraphData release]; - [oldNodeOrder release]; - [nwNodeOrder release]; - [oldEdgeOrder release]; - [nwEdgeOrder release]; - - [super dealloc]; -#endif -} - -@synthesize changeType; -@synthesize shiftPoint, horizontal; -@synthesize affectedEdges, affectedNodes; -@synthesize edgeRef, nodeRef; -@synthesize nwNode, oldNode; -@synthesize nwEdge, oldEdge; -@synthesize oldNodeTable, nwNodeTable; -@synthesize oldEdgeTable, nwEdgeTable; -@synthesize oldBoundingBox, nwBoundingBox; -@synthesize oldGraphData, nwGraphData; -@synthesize oldNodeOrder, nwNodeOrder; -@synthesize oldEdgeOrder, nwEdgeOrder; - -- (GraphChange*)invert { - GraphChange *inverse = [[GraphChange alloc] init]; - [inverse setChangeType:[self changeType]]; - switch ([self changeType]) { - case GraphAddition: - [inverse setChangeType:GraphDeletion]; -#if __has_feature(objc_arc) - inverse->affectedNodes = affectedNodes; - inverse->affectedEdges = affectedEdges; -#else - inverse->affectedNodes = [affectedNodes retain]; - inverse->affectedEdges = [affectedEdges retain]; -#endif - break; - case GraphDeletion: - [inverse setChangeType:GraphAddition]; -#if __has_feature(objc_arc) - inverse->affectedNodes = affectedNodes; - inverse->affectedEdges = affectedEdges; -#else - inverse->affectedNodes = [affectedNodes retain]; - inverse->affectedEdges = [affectedEdges retain]; -#endif - break; - case NodePropertyChange: -#if __has_feature(objc_arc) - inverse->nodeRef = nodeRef; - inverse->oldNode = nwNode; - inverse->nwNode = oldNode; -#else - inverse->nodeRef = [nodeRef retain]; - inverse->oldNode = [nwNode retain]; - inverse->nwNode = [oldNode retain]; -#endif - break; - case NodesPropertyChange: -#if __has_feature(objc_arc) - -#else - inverse->oldNodeTable = [nwNodeTable retain]; - inverse->nwNodeTable = [oldNodeTable retain]; -#endif - break; - case EdgePropertyChange: -#if __has_feature(objc_arc) - inverse->edgeRef = edgeRef; - inverse->oldEdge = nwEdge; - inverse->nwEdge = oldEdge; -#else - inverse->edgeRef = [edgeRef retain]; - inverse->oldEdge = [nwEdge retain]; - inverse->nwEdge = [oldEdge retain]; -#endif - break; - case EdgesPropertyChange: -#if __has_feature(objc_arc) - inverse->oldEdgeTable = nwEdgeTable; - inverse->nwEdgeTable = oldEdgeTable; -#else - inverse->oldEdgeTable = [nwEdgeTable retain]; - inverse->nwEdgeTable = [oldEdgeTable retain]; -#endif - break; - case NodesShift: -#if __has_feature(objc_arc) - inverse->affectedNodes = affectedNodes; -#else - inverse->affectedNodes = [affectedNodes retain]; -#endif - [inverse setShiftPoint:NSMakePoint(-[self shiftPoint].x, - -[self shiftPoint].y)]; - break; - case NodesFlip: -#if __has_feature(objc_arc) - inverse->affectedNodes = affectedNodes; -#else - inverse->affectedNodes = [affectedNodes retain]; -#endif - [inverse setHorizontal:[self horizontal]]; - break; - case EdgesReverse: -#if __has_feature(objc_arc) - inverse->affectedEdges = affectedEdges; -#else - inverse->affectedEdges = [affectedEdges retain]; -#endif - break; - case BoundingBoxChange: - inverse->oldBoundingBox = nwBoundingBox; - inverse->nwBoundingBox = oldBoundingBox; - break; - case GraphPropertyChange: -#if __has_feature(objc_arc) - inverse->oldGraphData = nwGraphData; - inverse->nwGraphData = oldGraphData; -#else - inverse->oldGraphData = [nwGraphData retain]; - inverse->nwGraphData = [oldGraphData retain]; -#endif - break; - case NodeOrderChange: -#if __has_feature(objc_arc) - inverse->affectedNodes = affectedNodes; - inverse->oldNodeOrder = nwNodeOrder; - inverse->nwNodeOrder = oldNodeOrder; -#else - inverse->affectedNodes = [affectedNodes retain]; - inverse->oldNodeOrder = [nwNodeOrder retain]; - inverse->nwNodeOrder = [oldNodeOrder retain]; -#endif - break; - case EdgeOrderChange: -#if __has_feature(objc_arc) - inverse->affectedEdges = affectedEdges; - inverse->oldEdgeOrder = nwEdgeOrder; - inverse->nwEdgeOrder = oldEdgeOrder; -#else - inverse->affectedEdges = [affectedEdges retain]; - inverse->oldEdgeOrder = [nwEdgeOrder retain]; - inverse->nwEdgeOrder = [oldEdgeOrder retain]; -#endif - break; - } -#if __has_feature(objc_arc) - return inverse; -#else - return [inverse autorelease]; -#endif -} - -+ (GraphChange*)graphAdditionWithNodes:(NSSet *)ns edges:(NSSet *)es { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:GraphAddition]; - [gc setAffectedNodes:ns]; - [gc setAffectedEdges:es]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)graphDeletionWithNodes:(NSSet *)ns edges:(NSSet *)es { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:GraphDeletion]; - [gc setAffectedNodes:ns]; - [gc setAffectedEdges:es]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)propertyChangeOfNode:(Node*)nd fromOld:(Node*)old toNew:(Node*)nw { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:NodePropertyChange]; - [gc setNodeRef:nd]; - [gc setOldNode:old]; - [gc setNwNode:nw]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)propertyChangeOfNodesFromOldCopies:(NSMapTable*)oldC - toNewCopies:(NSMapTable*)newC { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:NodesPropertyChange]; - [gc setOldNodeTable:oldC]; - [gc setNwNodeTable:newC]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)propertyChangeOfEdge:(Edge*)e fromOld:(Edge *)old toNew:(Edge *)nw { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:EdgePropertyChange]; - [gc setEdgeRef:e]; - [gc setOldEdge:old]; - [gc setNwEdge:nw]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)propertyChangeOfEdgesFromOldCopies:(NSMapTable*)oldC - toNewCopies:(NSMapTable*)newC { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:EdgesPropertyChange]; - [gc setOldEdgeTable:oldC]; - [gc setNwEdgeTable:newC]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)shiftNodes:(NSSet*)ns byPoint:(NSPoint)p { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:NodesShift]; - [gc setAffectedNodes:ns]; - [gc setShiftPoint:p]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)flipNodes:(NSSet*)ns horizontal:(BOOL)b { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:NodesFlip]; - [gc setAffectedNodes:ns]; - [gc setHorizontal:b]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)reverseEdges:(NSSet*)es { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:EdgesReverse]; - [gc setAffectedEdges:es]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)changeBoundingBoxFrom:(NSRect)oldBB to:(NSRect)newBB { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:BoundingBoxChange]; - [gc setOldBoundingBox:oldBB]; - [gc setNwBoundingBox:newBB]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)propertyChangeOfGraphFrom:(GraphElementData*)oldData to:(GraphElementData*)newData { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:GraphPropertyChange]; - [gc setOldGraphData:oldData]; - [gc setNwGraphData:newData]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)nodeOrderChangeFrom:(NSArray*)old to:(NSArray*)new moved:(NSSet*)affected { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:NodeOrderChange]; - [gc setAffectedNodes:affected]; - [gc setOldNodeOrder:old]; - [gc setNwNodeOrder:new]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -+ (GraphChange*)edgeOrderChangeFrom:(NSArray*)old to:(NSArray*)new moved:(NSSet*)affected { - GraphChange *gc = [[GraphChange alloc] init]; - [gc setChangeType:EdgeOrderChange]; - [gc setAffectedEdges:affected]; - [gc setOldEdgeOrder:old]; - [gc setNwEdgeOrder:new]; -#if __has_feature(objc_arc) - return gc; -#else - return [gc autorelease]; -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/GraphElementData.h b/tikzit-old/src/common/GraphElementData.h deleted file mode 100644 index a65e6df..0000000 --- a/tikzit-old/src/common/GraphElementData.h +++ /dev/null @@ -1,94 +0,0 @@ -// -// GraphElementData.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -#import - -/*! - @class GraphElementData - @brief Store extra data associated with a graph, node, or edge. - @details Store the extra (style, ...) data associated with - a graph, node, or edge. This data is stored as a mutable - array of properties. It also implements hash-like accessors, - but care should be taken using these, as the list can contain - multiple occurrences of the same key. - - Convention: Getters and setters act on the *first* occurrence - of the key. 'Unsetters' remove *all* occurrences. - */ -@interface GraphElementData : NSMutableArray { - NSMutableArray *properties; -} - -- (id)init; -+ (id)data; - -/*! - @brief Set the given value for the *first* property matching this key. Add a - new property if it doesn't already exist. - @param val the value to set - @param key the key for this property - */ -- (void)setProperty:(NSString*)val forKey:(NSString*)key; - -/*! - @brief Remove *all* occurences of the property with the given key. - @param key - */ -- (void)unsetProperty:(NSString*)key; - -/*! - @brief Return the value of the *first* occurrence of the given key. - @param key - */ -- (NSString*)propertyForKey:(NSString*)key; - -/*! - @brief Add the given atom to the list, if it's not already present. - @param atom - */ -- (void)setAtom:(NSString*)atom; - -/*! - @brief Remove *all* occurrences of the given atom. - @param atom - */ -- (void)unsetAtom:(NSString*)atom; - -/*! - @brief Returns YES if the list contains at least one occurrence of - the given atom. - @param atom - @result A boolean value. - */ -- (BOOL)isAtomSet:(NSString*)atom; - -/*! - @brief Returns a TikZ-friendly string containing all of the properties. - @result A string. - */ -- (NSString*)tikzList; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/GraphElementData.m b/tikzit-old/src/common/GraphElementData.m deleted file mode 100644 index 41dc9aa..0000000 --- a/tikzit-old/src/common/GraphElementData.m +++ /dev/null @@ -1,188 +0,0 @@ -// -// GraphElementData.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "GraphElementData.h" -#import "GraphElementProperty.h" - - -@implementation GraphElementData - -+ (id)data { -#if __has_feature(objc_arc) - return [[self alloc] init]; -#else - return [[[self alloc] init] autorelease]; -#endif -} - -- (id)init { - self = [super init]; - if (self) { - properties = [[NSMutableArray alloc] init]; - } - return self; -} - -// all of the array messages delegate to 'properties' - -- (NSUInteger)count { return [properties count]; } -- (id)objectAtIndex:(NSUInteger)index { - return [properties objectAtIndex:index]; -} -- (NSArray*)objectsAtIndexes:(NSIndexSet*)indexes { - return [properties objectsAtIndexes:indexes]; -} - -#if __has_feature(objc_arc) -- (void) getObjects:(__unsafe_unretained id*)buffer range:(NSRange)range { -#else -- (void) getObjects:(id*)buffer range:(NSRange)range { -#endif - [properties getObjects:buffer range:range]; -} - -- (void)insertObject:(id)anObject atIndex:(NSUInteger)index { - [properties insertObject:anObject atIndex:index]; -} -- (void)removeObjectAtIndex:(NSUInteger)index { - [properties removeObjectAtIndex:index]; -} -- (void)addObject:(id)anObject { - [properties addObject:anObject]; -} -- (void)removeLastObject { - [properties removeLastObject]; -} -- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject { - [properties replaceObjectAtIndex:index withObject:anObject]; -} - -#if __has_feature(objc_arc) -- (NSUInteger) countByEnumeratingWithState:(NSFastEnumerationState *)state - objects:(__unsafe_unretained id [])stackbuf - count:(NSUInteger)len { -#else -- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state - objects:(id *)stackbuf - count:(NSUInteger)len { -#endif - return [properties countByEnumeratingWithState:state objects:stackbuf count:len]; -} - -- (void)setProperty:(NSString*)val forKey:(NSString*)key { - GraphElementProperty *m = [[GraphElementProperty alloc] initWithKeyMatching:key]; - NSInteger idx = [properties indexOfObject:m]; -#if !__has_feature(objc_arc) - [m release]; -#endif - - GraphElementProperty *p; - if (idx == NSNotFound) { - p = [[GraphElementProperty alloc] initWithPropertyValue:val forKey:key]; - [properties addObject:p]; -#if !__has_feature(objc_arc) - [p release]; -#endif - } else { - p = [properties objectAtIndex:idx]; - [p setValue:val]; - } -} - -- (void)unsetProperty:(NSString*)key { - GraphElementProperty *m = [[GraphElementProperty alloc] initWithKeyMatching:key]; - [properties removeObject:m]; -#if !__has_feature(objc_arc) - [m release]; -#endif - -} - -- (NSString*)propertyForKey:(NSString*)key { - GraphElementProperty *m = [[GraphElementProperty alloc] initWithKeyMatching:key]; - NSInteger idx = [properties indexOfObject:m]; -#if !__has_feature(objc_arc) - [m release]; -#endif - - - if (idx == NSNotFound) { - return nil; - }else { - GraphElementProperty *p = [properties objectAtIndex:idx]; - return [p value]; - } -} - -- (void)setAtom:(NSString*)atom { - GraphElementProperty *a = [[GraphElementProperty alloc] initWithAtomName:atom]; - if (![properties containsObject:a]) [properties addObject:a]; -#if !__has_feature(objc_arc) - [a release]; -#endif -} - -- (void)unsetAtom:(NSString*)atom { - GraphElementProperty *a = [[GraphElementProperty alloc] initWithAtomName:atom]; - [properties removeObject:a]; -#if !__has_feature(objc_arc) - [a release]; -#endif -} - -- (BOOL)isAtomSet:(NSString*)atom { - GraphElementProperty *a = [[GraphElementProperty alloc] initWithAtomName:atom]; - BOOL set = [properties containsObject:a]; -#if !__has_feature(objc_arc) - [a release]; -#endif - return set; -} - -- (NSString*)tikzList { - NSString *s = [properties componentsJoinedByString:@", "]; - return ([s isEqualToString:@""]) ? @"" : [NSString stringWithFormat:@"[%@]", s]; -} - -- (id)copyWithZone:(NSZone *)zone { - GraphElementData *cp = [[GraphElementData allocWithZone:zone] init]; - for (GraphElementProperty *p in properties) { - GraphElementProperty *p2 = [p copy]; - [cp addObject:p2]; -#if !__has_feature(objc_arc) - [p2 release]; -#endif - } - return cp; -} - -- (void)dealloc { -#if !__has_feature(objc_arc) - [properties release]; - [super dealloc]; -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/GraphElementProperty.h b/tikzit-old/src/common/GraphElementProperty.h deleted file mode 100644 index 057cdbb..0000000 --- a/tikzit-old/src/common/GraphElementProperty.h +++ /dev/null @@ -1,88 +0,0 @@ -// -// GraphElementProperty.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -/*! - @class GraphElementProperty - @brief A property. I.e. a single entry in a node's/edge's/graph's - GraphElementData table. - */ -@interface GraphElementProperty : NSObject { - NSString *key; - NSString *value; - BOOL isAtom; - BOOL isKeyMatch; -} - -@property (copy) NSString *key; -@property (copy) NSString *value; -@property (readonly) BOOL isAtom; -@property (readonly) BOOL isKeyMatch; - -/*! - @brief Initialize a new key-matching object. - @param k a key to match - @result A key-matching object. - */ -- (id)initWithKeyMatching:(NSString*)k; -+ (id)keyMatching:(NSString*)k; - -/*! - @brief Initialize a new atomic property. - @param n the atom's name - @result An atom. - */ -- (id)initWithAtomName:(NSString*)n; -+ (id)atom:(NSString*)n; - -/*! - @brief Initialize a new property. - @param v the property's value - @param k the associated key - @result A property. - */ -- (id)initWithPropertyValue:(NSString*)v forKey:(NSString*)k; -+ (id)property:(NSString*)k withValue:(NSString*)v; - -/*! - @brief A matching function for properties. - @details Two properties match iff their keys match and one of the following: - (a) they are both atomic, (b) one is a key-matching and one is a non-atomic - property, or (c) they are both non-atomic and their values match. - @param object another GraphElementProperty - @result A boolean. - */ -- (BOOL)matches:(GraphElementProperty*)object; - -/*! - @brief An alias for matches:. This allows one to use built-in methods that - filter on isEqual: for NSObjects. - @param object another GraphElementProperty - @result A boolean. - */ -- (BOOL)isEqual:(id)object; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/GraphElementProperty.m b/tikzit-old/src/common/GraphElementProperty.m deleted file mode 100644 index 25e1b15..0000000 --- a/tikzit-old/src/common/GraphElementProperty.m +++ /dev/null @@ -1,164 +0,0 @@ -// -// -// GraphElementProperty.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "GraphElementProperty.h" -#import "NSString+Tikz.h" - -@implementation GraphElementProperty - -+ (id)atom:(NSString*)n { -#if __has_feature(objc_arc) - return [[self alloc] initWithAtomName:n]; -#else - return [[[self alloc] initWithAtomName:n] autorelease]; -#endif -} -+ (id)property:(NSString*)k withValue:(NSString*)v { -#if __has_feature(objc_arc) - return [[self alloc] initWithPropertyValue:v forKey:k]; -#else - return [[[self alloc] initWithPropertyValue:v forKey:k] autorelease]; -#endif -} -+ (id)keyMatching:(NSString*)k { -#if __has_feature(objc_arc) - return [[self alloc] initWithKeyMatching:k]; -#else - return [[[self alloc] initWithKeyMatching:k] autorelease]; -#endif -} - -- (id)initWithAtomName:(NSString*)n { - self = [super init]; - if (self) { - [self setKey:n]; - isAtom = YES; - } - return self; -} - -- (id)initWithPropertyValue:(NSString*)v forKey:(NSString*)k { - self = [super init]; - if (self) { - [self setKey:k]; - [self setValue:v]; - } - return self; -} - -- (id)initWithKeyMatching:(NSString*)k { - self = [super init]; - if (self) { - [self setKey:k]; - isKeyMatch = YES; - } - return self; -} - -- (void) dealloc { -#if ! __has_feature(objc_arc) - [key release]; - [value release]; - [super dealloc]; -#endif -} - -- (void)setValue:(NSString *)v { - if (value != v) { -#if ! __has_feature(objc_arc) - [value release]; -#endif - value = [v copy]; - } -} - -- (NSString*)value { - if (isAtom) { - return @"(atom)"; - } else { - return value; - } -} - - -- (void)setKey:(NSString *)k { - if (key != k) { -#if ! __has_feature(objc_arc) - [key release]; -#endif - key = [k copy]; - } - if (key == nil) - key = @""; // don't allow nil keys -} - -- (NSString*)key { - return key; -} - -- (BOOL)isAtom { return isAtom; } -- (BOOL)isKeyMatch { return isKeyMatch; } - -- (BOOL)matches:(GraphElementProperty*)object { - // properties and atoms are taken to be incomparable - if ([self isAtom] != [object isAtom]) return NO; - - // only compare keys if (a) we are both atoms, (b) i am a key match, or (c) object is a key match - if (([self isAtom] && [object isAtom]) || [self isKeyMatch] || [object isKeyMatch]) { - return [[self key] isEqual:[object key]]; - } - - // otherwise compare key and value - return [[self key] isEqual:[object key]] && [[self value] isEqual:[object value]]; -} - -- (BOOL)isEqual:(id)object { - return [self matches:object]; -} - -- (id)copyWithZone:(NSZone*)zone { - if (isAtom) { - return [[GraphElementProperty allocWithZone:zone] initWithAtomName:[self key]]; - } else if (isKeyMatch) { - return [[GraphElementProperty allocWithZone:zone] initWithKeyMatching:[self key]]; - } else { - return [[GraphElementProperty allocWithZone:zone] initWithPropertyValue:[self value] forKey:[self key]]; - } -} - -- (NSString*)description { - if ([self isAtom]) { - return [[self key] tikzEscapedString]; - } else if ([self isKeyMatch]) { - return [NSString stringWithFormat:@"%@=*", [[self key] tikzEscapedString]]; - } else { - return [NSString stringWithFormat:@"%@=%@", - [[self key] tikzEscapedString], - [[self value] tikzEscapedString]]; - } -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/Grid.h b/tikzit-old/src/common/Grid.h deleted file mode 100644 index b267536..0000000 --- a/tikzit-old/src/common/Grid.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "RenderContext.h" -#import "Transformer.h" - -/*! - * Provides a grid, which can be use for snapping points - * - * The grid is divided into cells, and each cell is further subdivided. - * These subdivisions are the snap points for the grid. - */ -@interface Grid: NSObject { - Transformer *transformer; - float spacing; - int cellSubdivisions; -} - -/*! - * The number of times to subdivide the edge of each cell - * - * Each cell will be divided into cellSubdivisions^2 squares. - */ -@property (assign) int cellSubdivisions; - -/*! - * The cell spacing - * - * Each cell will be @p cellSpacing wide and @p cellSpacing high. - */ -@property (assign) float cellSpacing; - - -/*! - * Create a new grid object. - * - * @param sp the cell spacing - this will be the width and height of each cell - * @param subs the number of cell subdivisions; the cell will end up being - * divided into subs*subs squares that are each sp/subs wide and high - * @param t the transformer to be used when snapping screen points - */ -+ (Grid*) gridWithSpacing:(float)sp subdivisions:(int)subs transformer:(Transformer*)t; -/*! - * Initialize a grid object. - * - * @param sp the cell spacing - this will be the width and height of each cell - * @param subs the number of cell subdivisions; each cell will end up being - * divided into subs*subs squares that are each sp/subs wide and high - * @param t the transformer to be used when snapping screen points - */ -- (id) initWithSpacing:(float)sp subdivisions:(int)subs transformer:(Transformer*)t; - -/*! - * Snap a point in screen co-ordinates - * - * @param p the point to snap, in screen co-ordinates - * @result @p p aligned to the nearest corner of a cell subdivision - */ -- (NSPoint) snapScreenPoint:(NSPoint)p; -/*! - * Snap a point in base co-ordinates - * - * @param p the point to snap - * @result @p p aligned to the nearest corner of a cell subdivision - */ -- (NSPoint) snapPoint:(NSPoint)p; - -/** - * Renders the grid - * - * The grid is rendered across the entire surface (subject to the context's - * clip). - * - * The internal transformer is used to convert between graph co-ordinates - * and graphics co-ordinates. - * - * @param cr the context to render in - */ -- (void) renderGridInContext:(id)cr; - -/** - * Renders the grid - * - * The grid is rendered across the entire surface (subject to the context's - * clip). - * - * @param cr the context to render in - * @param t a transformer that will be used to map graph co-ordinates - * to graphics co-ordinates - */ -- (void) renderGridInContext:(id)cr transformer:(Transformer*)t; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Grid.m b/tikzit-old/src/common/Grid.m deleted file mode 100644 index f597a4a..0000000 --- a/tikzit-old/src/common/Grid.m +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Grid.h" -#import "util.h" - -@implementation Grid - -+ (Grid*) gridWithSpacing:(float)sp subdivisions:(int)subs transformer:(Transformer*)t { - return [[[self alloc] initWithSpacing:sp subdivisions:subs transformer:t] autorelease]; -} - -- (id) initWithSpacing:(float)sp subdivisions:(int)subs transformer:(Transformer*)t { - self = [super init]; - - if (self) { - transformer = [t retain]; - spacing = sp; - cellSubdivisions = subs; - } - - return self; -} - -- (id) copyWithZone:(NSZone*)zone { - return [[Grid allocWithZone:zone] - initWithSpacing:spacing - subdivisions:cellSubdivisions - transformer:transformer]; -} - -- (void) dealloc { - [transformer release]; - [super dealloc]; -} - -- (int) cellSubdivisions { - return cellSubdivisions; -} - -- (void) setCellSubdivisions:(int)count { - cellSubdivisions = count; -} - -- (float) cellSpacing { - return spacing; -} - -- (void) setCellSpacing:(float)sp { - spacing = sp; -} - -- (NSPoint) snapScreenPoint:(NSPoint)point { - NSPoint gridPoint = [transformer fromScreen:point]; - return [transformer toScreen:[self snapPoint:gridPoint]]; -} - -- (NSPoint) snapPoint:(NSPoint)p { - const float snapDistance = spacing/(float)cellSubdivisions; - p.x = roundToNearest (snapDistance, p.x); - p.y = roundToNearest (snapDistance, p.y); - return p; -} - -- (void) _setupLinesForContext:(id)context withSpacing:(float)offset omittingEvery:(int)omitEvery origin:(NSPoint)origin { - NSRect clip = [context clipBoundingBox]; - float clipx1 = clip.origin.x; - float clipx2 = clipx1 + clip.size.width; - float clipy1 = clip.origin.y; - float clipy2 = clipy1 + clip.size.height; - - // left of the Y axis, moving outwards - unsigned int count = 1; - float x = origin.x - offset; - while (x >= clipx1) { - if (omitEvery == 0 || (count % omitEvery != 0)) { - [context moveTo:NSMakePoint(x, clipy1)]; - [context lineTo:NSMakePoint(x, clipy2)]; - } - - x -= offset; - ++count; - } - // right of the Y axis, moving outwards - count = 1; - x = origin.x + offset; - while (x <= clipx2) { - if (omitEvery == 0 || (count % omitEvery != 0)) { - [context moveTo:NSMakePoint(x, clipy1)]; - [context lineTo:NSMakePoint(x, clipy2)]; - } - - x += offset; - ++count; - } - - // above the Y axis, moving outwards - count = 1; - float y = origin.y - offset; - while (y >= clipy1) { - if (omitEvery == 0 || (count % omitEvery != 0)) { - [context moveTo:NSMakePoint(clipx1, y)]; - [context lineTo:NSMakePoint(clipx2, y)]; - } - - y -= offset; - ++count; - } - // below the Y axis, moving outwards - count = 1; - y = origin.y + offset; - while (y <= clipy2) { - if (omitEvery == 0 || (count % omitEvery != 0)) { - [context moveTo:NSMakePoint(clipx1, y)]; - [context lineTo:NSMakePoint(clipx2, y)]; - } - - y += offset; - ++count; - } -} - -- (void) _renderSubdivisionsWithContext:(id)context origin:(NSPoint)origin cellSize:(float)cellSize { - const float offset = cellSize / cellSubdivisions; - - [self _setupLinesForContext:context withSpacing:offset omittingEvery:cellSubdivisions origin:origin]; - - [context strokePathWithColor:MakeSolidRColor (0.9, 0.9, 1.0)]; -} - -- (void) _renderCellsWithContext:(id)context origin:(NSPoint)origin cellSize:(float)cellSize { - [self _setupLinesForContext:context withSpacing:cellSize omittingEvery:0 origin:origin]; - - [context strokePathWithColor:MakeSolidRColor (0.8, 0.8, 0.9)]; -} - -- (void) _renderAxesWithContext:(id)context origin:(NSPoint)origin { - NSRect clip = [context clipBoundingBox]; - - [context moveTo:NSMakePoint(origin.x, clip.origin.y)]; - [context lineTo:NSMakePoint(origin.x, clip.origin.y + clip.size.height)]; - [context moveTo:NSMakePoint(clip.origin.x, origin.y)]; - [context lineTo:NSMakePoint(clip.origin.x + clip.size.width, origin.y)]; - - [context strokePathWithColor:MakeSolidRColor (0.6, 0.6, 0.7)]; -} - -- (void) renderGridInContext:(id)cr { - [self renderGridInContext:cr transformer:transformer]; -} - -- (void) renderGridInContext:(id)context transformer:(Transformer*)t { - const NSPoint origin = [t toScreen:NSZeroPoint]; - const float cellSize = [t scaleToScreen:spacing]; - - [context saveState]; - - // common line settings - [context setLineWidth:1.0]; - [context setAntialiasMode:AntialiasDisabled]; - - [self _renderSubdivisionsWithContext:context origin:origin cellSize:cellSize]; - [self _renderCellsWithContext:context origin:origin cellSize:cellSize]; - [self _renderAxesWithContext:context origin:origin]; - - [context restoreState]; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSError+Tikzit.h b/tikzit-old/src/common/NSError+Tikzit.h deleted file mode 100644 index 0f45fba..0000000 --- a/tikzit-old/src/common/NSError+Tikzit.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import - -NSString* const TZErrorDomain; - -enum { - TZ_ERR_OTHER = 1, - TZ_ERR_BADSTATE, - TZ_ERR_BADFORMAT, - TZ_ERR_IO, - TZ_ERR_TOOL_FAILED, - TZ_ERR_NOTDIRECTORY, - TZ_ERR_PARSE -}; - -NSString* const TZToolOutputErrorKey; - -@interface NSError(Tikzit) -+ (NSString*)tikzitErrorDomain; -+ (id) errorWithMessage:(NSString*)message code:(NSInteger)code cause:(NSError*)cause; -+ (id) errorWithMessage:(NSString*)message code:(NSInteger)code; -+ (id) errorWithLibcError:(NSInteger)errnum; -- (NSString*)toolOutput; -@end - -void logError (NSError *error, NSString *message); - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSError+Tikzit.m b/tikzit-old/src/common/NSError+Tikzit.m deleted file mode 100644 index 6b9404b..0000000 --- a/tikzit-old/src/common/NSError+Tikzit.m +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NSError+Tikzit.h" - -NSString* const TZErrorDomain = @"tikzit"; - -NSString* const TZToolOutputErrorKey = @"tool-output"; - -@implementation NSError(Tikzit) -+ (NSString*)tikzitErrorDomain { - return TZErrorDomain; -} - -+ (id) errorWithMessage:(NSString*)message code:(NSInteger)code cause:(NSError*)cause { - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionaryWithCapacity:2]; - [errorDetail setValue:message forKey:NSLocalizedDescriptionKey]; - if (cause) - [errorDetail setValue:cause forKey:NSUnderlyingErrorKey]; - return [self errorWithDomain:TZErrorDomain code:code userInfo:errorDetail]; -} - -+ (id) errorWithMessage:(NSString*)message code:(NSInteger)code { - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionaryWithObject:message - forKey:NSLocalizedDescriptionKey]; - return [self errorWithDomain:TZErrorDomain code:code userInfo:errorDetail]; -} - -+ (id) errorWithLibcError:(NSInteger)errnum { - NSString *message = [NSString stringWithUTF8String:strerror(errnum)]; - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionaryWithObject:message - forKey:NSLocalizedDescriptionKey]; - return [self errorWithDomain:NSPOSIXErrorDomain code:errnum userInfo:errorDetail]; -} - -- (NSString*)toolOutput { - return [[self userInfo] objectForKey:TZToolOutputErrorKey]; -} - -@end - -void logError (NSError *error, NSString *message) { - if (message == nil) { - NSLog (@"%@", [error localizedDescription]); - } else { - NSLog (@"%@: %@", message, [error localizedDescription]); - } -} - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSFileManager+Utils.h b/tikzit-old/src/common/NSFileManager+Utils.h deleted file mode 100644 index 1349919..0000000 --- a/tikzit-old/src/common/NSFileManager+Utils.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// NSFileManager+Utils.h -// TikZiT -// -// Copyright 2010 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -@interface NSFileManager(Utils) -- (BOOL) ensureDirectoryExists:(NSString*)path error:(NSError**)error; -@end - -// vi:ft=objc:sts=4:sw=4:ts=4:noet diff --git a/tikzit-old/src/common/NSFileManager+Utils.m b/tikzit-old/src/common/NSFileManager+Utils.m deleted file mode 100644 index 87ede95..0000000 --- a/tikzit-old/src/common/NSFileManager+Utils.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// NSFileManager+Utils.h -// TikZiT -// -// Copyright 2010 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "NSError+Tikzit.h" - -@implementation NSFileManager(Utils) -- (BOOL) ensureDirectoryExists:(NSString*)directory error:(NSError**)error { - BOOL isDirectory = NO; - if (![self fileExistsAtPath:directory isDirectory:&isDirectory]) { - if (![self createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:error]) { - return NO; - } - } else if (!isDirectory) { - if (error) { - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionary]; - [errorDetail setValue:@"Directory is a file" forKey:NSLocalizedDescriptionKey]; - [errorDetail setValue:directory forKey:NSFilePathErrorKey]; - *error = [NSError errorWithDomain:TZErrorDomain code:TZ_ERR_NOTDIRECTORY userInfo:errorDetail]; - } - return NO; - } - return YES; -} -@end - -// vi:ft=objc:sts=4:sw=4:ts=4:noet diff --git a/tikzit-old/src/common/NSString+LatexConstants.h b/tikzit-old/src/common/NSString+LatexConstants.h deleted file mode 100644 index f4b5236..0000000 --- a/tikzit-old/src/common/NSString+LatexConstants.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// NSString+LatexConstants.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - - -@interface NSString(LatexConstants) - -- (NSString*)stringByExpandingLatexConstants; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSString+LatexConstants.m b/tikzit-old/src/common/NSString+LatexConstants.m deleted file mode 100644 index 634c189..0000000 --- a/tikzit-old/src/common/NSString+LatexConstants.m +++ /dev/null @@ -1,212 +0,0 @@ -// -// NSString+LatexConstants.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "NSString+LatexConstants.h" - -// can't use sizeof() in non-fragile ABI (eg: clang) -#define texConstantCount 63 -static NSString *texConstantNames[texConstantCount] = { - @"alpha", - @"beta", - @"gamma", - @"delta", - @"epsilon", - @"zeta", - @"eta", - @"theta", - @"iota", - @"kappa", - @"lambda", - @"mu", - @"nu", - @"xi", - @"pi", - @"rho", - @"sigma", - @"tau", - @"upsilon", - @"phi", - @"chi", - @"psi", - @"omega", - @"Gamma", - @"Delta", - @"Theta", - @"Lambda", - @"Xi", - @"Pi", - @"Sigma", - @"Upsilon", - @"Phi", - @"Psi", - @"Omega", - - @"pm", - @"to", - @"Rightarrow", - @"Leftrightarrow", - @"forall", - @"partial", - @"exists", - @"emptyset", - @"nabla", - @"in", - @"notin", - @"prod", - @"sum", - @"surd", - @"infty", - @"wedge", - @"vee", - @"cap", - @"cup", - @"int", - @"approx", - @"neq", - @"equiv", - @"leq", - @"geq", - @"subset", - @"supset", - @"cdot", - @"ldots" -}; - -static char * texConstantCodes[texConstantCount] = { - "\u03b1","\u03b2","\u03b3","\u03b4","\u03b5","\u03b6","\u03b7", - "\u03b8","\u03b9","\u03ba","\u03bb","\u03bc","\u03bd","\u03be", - "\u03c0","\u03c1","\u03c3","\u03c4","\u03c5","\u03c6","\u03c7", - "\u03c8","\u03c9","\u0393","\u0394","\u0398","\u039b","\u039e", - "\u03a0","\u03a3","\u03a5","\u03a6","\u03a8","\u03a9", - - "\u00b1","\u2192","\u21d2","\u21d4","\u2200","\u2202","\u2203", - "\u2205","\u2207","\u2208","\u2209","\u220f","\u2211","\u221a", - "\u221e","\u2227","\u2228","\u2229","\u222a","\u222b","\u2248", - "\u2260","\u2261","\u2264","\u2265","\u2282","\u2283","\u22c5", - "\u2026" -}; - -#define texModifierCount 10 -static NSString *texModifierNames[texModifierCount] = { - @"tiny", - @"scriptsize", - @"footnotesize", - @"small", - @"normalsize", - @"large", - @"Large", - @"LARGE", - @"huge", - @"Huge" -}; - -static NSDictionary *texConstants = nil; -static NSSet *texModifiers = nil; - -@implementation NSString(LatexConstants) - -- (NSString*)stringByExpandingLatexConstants { - - if (texConstants == nil) { - NSMutableDictionary *constants = [[NSMutableDictionary alloc] initWithCapacity:texConstantCount]; - for (int i = 0; i < texConstantCount; ++i) { - [constants setObject:[NSString stringWithUTF8String:texConstantCodes[i]] forKey:texConstantNames[i]]; - } - texConstants = constants; - } - if (texModifiers == nil) { - texModifiers = [[NSSet alloc] initWithObjects:texModifierNames count:texModifierCount]; - } - - NSMutableString *buf = [[NSMutableString alloc] initWithCapacity:[self length]]; - NSMutableString *wordBuf = [[NSMutableString alloc] initWithCapacity:10]; - - unichar c_a = [@"a" characterAtIndex:0]; - unichar c_z = [@"z" characterAtIndex:0]; - unichar c_A = [@"A" characterAtIndex:0]; - unichar c_Z = [@"Z" characterAtIndex:0]; - - int state = 0; - // a tiny little DFA to replace \\([\w*]) with unicode of $1 - unichar c; - NSString *code; - int i; - for (i = 0; i<[self length]; ++i) { - c = [self characterAtIndex:i]; - switch (state) { - case 0: - if (c=='\\') { - state = 1; - } else if (c!='$') { - [buf appendFormat:@"%C", c]; - } - break; - case 1: - if ((c>=c_a && c<=c_z) || (c>=c_A && c<=c_Z)) { - [wordBuf appendFormat:@"%C", c]; - } else { - code = [texConstants objectForKey:wordBuf]; - if (code != nil) { - [buf appendString:code]; - } else if (![texModifiers containsObject:wordBuf]) { - [buf appendFormat:@"\\%@", wordBuf]; - } - - [wordBuf setString:@""]; - if (c=='\\') { - state = 1; - } else { - if (c!='$') { - [buf appendFormat:@"%C", c]; - } - state = 0; - } - - } - break; - } - } - - if (state == 1) { - code = [texConstants objectForKey:wordBuf]; - if (code != nil) { - [buf appendString:code]; - } else if (![texModifiers containsObject:wordBuf]) { - [buf appendFormat:@"\\%@", wordBuf]; - } - } - - NSString *ret = [buf copy]; -#if __has_feature(objc_arc) - return ret; -#else - [buf release]; - [wordBuf release]; - - return [ret autorelease]; -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSString+Tikz.h b/tikzit-old/src/common/NSString+Tikz.h deleted file mode 100644 index ea6ea40..0000000 --- a/tikzit-old/src/common/NSString+Tikz.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import - -@interface NSString (Tikz) - - (NSString*) tikzEscapedString; - - (BOOL) isValidTikzPropertyNameOrValue; - - (BOOL) isValidAnchor; -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSString+Tikz.m b/tikzit-old/src/common/NSString+Tikz.m deleted file mode 100644 index 1e3073b..0000000 --- a/tikzit-old/src/common/NSString+Tikz.m +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NSString+Tikz.h" -#import "TikzGraphAssembler.h" - -@implementation NSString (Tikz) - -- (NSString*) tikzEscapedString { - static NSCharacterSet *avoid = nil; - if (avoid == nil) -#if __has_feature(objc_arc) - avoid = [[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>-'0123456789. "] invertedSet]; -#else - avoid = [[[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ<>-'0123456789. "] invertedSet] retain]; -#endif - - - if ([self rangeOfCharacterFromSet:avoid].length > 0) { - return [NSString stringWithFormat:@"{%@}", self]; - } else { -#if __has_feature(objc_arc) - return self; -#else - return [[self retain] autorelease]; -#endif - } -} - -- (BOOL) isValidTikzPropertyNameOrValue { - NSUInteger length = [self length]; - unsigned int brace_depth = 0; - unsigned int escape = 0; - for (NSUInteger i = 0; i < length; ++i) { - unichar c = [self characterAtIndex:i]; - - if (escape) { - escape = 0; - } else if (c == '\\') { - escape = 1; - } else if (c == '{') { - brace_depth++; - } else if (c == '}') { - if (brace_depth == 0) - return NO; - brace_depth--; - } - } - return !escape && brace_depth == 0; -} - -- (BOOL) isValidAnchor { - return [TikzGraphAssembler validateTikzEdgeAnchor:self]; -} - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSString+Util.h b/tikzit-old/src/common/NSString+Util.h deleted file mode 100644 index 548edb3..0000000 --- a/tikzit-old/src/common/NSString+Util.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import - -@interface NSString (Util) - + (NSString*) stringWithContentsOfFile:(NSString*)path - error:(NSError**)error; - - (id) initWithContentsOfFile:(NSString*)path - error:(NSError**)error; -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/NSString+Util.m b/tikzit-old/src/common/NSString+Util.m deleted file mode 100644 index b18f397..0000000 --- a/tikzit-old/src/common/NSString+Util.m +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "NSString+Util.h" -#import "NSError+Tikzit.h" - -@implementation NSString (Util) -+ (NSString*) stringWithContentsOfFile:(NSString*)path - error:(NSError**)error -{ - return [[[self alloc] initWithContentsOfFile:path error:error] autorelease]; -} -- (id) initWithContentsOfFile:(NSString*)path - error:(NSError**)error -{ - // Fun fact: on GNUstep, at least, - // [stringWithContentsOfFile:usedEncoding:error:] only - // sets error objects if the decoding fails, not if file - // access fails. - // Fun fact 2: on GNUstep, trying to read a directory using - // [stringWithContentsOfFile:] causes an out-of-memory error; - // hence we do these checks *before* trying to read the file. - NSFileManager *fm = [NSFileManager defaultManager]; - BOOL isDir = NO; - NSString *msg = nil; - if (![fm fileExistsAtPath:path isDirectory:&isDir]) { - msg = [NSString stringWithFormat:@"\"%@\" does not exist", path]; - } else if (isDir) { - msg = [NSString stringWithFormat:@"\"%@\" is a directory", path]; - } else if (![fm isReadableFileAtPath:path]) { - msg = [NSString stringWithFormat:@"\"%@\" is not readable", path]; - } - if (msg != nil) { - if (error) { - *error = [NSError errorWithMessage:msg - code:TZ_ERR_IO]; - } - return nil; - } - self = [self initWithContentsOfFile:path]; - if (self == nil) { - if (error) { - *error = [NSError errorWithMessage:@"unknown error" - code:TZ_ERR_IO]; - } - } - return self; -} -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Node.h b/tikzit-old/src/common/Node.h deleted file mode 100644 index 1e580ce..0000000 --- a/tikzit-old/src/common/Node.h +++ /dev/null @@ -1,181 +0,0 @@ -// -// Node.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -// Node : store the data associated with a node. - -#import - -#import "NodeStyle.h" -#import "GraphElementData.h" - -@class GraphElementProperty; -@class Shape; -@class Transformer; - -/*! - @class Node - @brief A graph node, with associated location and style data. - */ -@interface Node : NSObject { - NSPoint point; - NodeStyle *style; - NSString *name; - NSString *label; - GraphElementData *data; -} - -/*! - @property shape - @brief The shape to use - @detail This is a convenience property that resolves the shape name - from the style, and uses a circle if there is no style. - - This property is NOT KVO-compliant - */ -@property (readonly) Shape *shape; - -/*! - @property point - @brief The point where this node is located. - */ -@property (assign) NSPoint point; - -/*! - @property style - @brief The style of this node. - */ -@property (retain) NodeStyle *style; - -/*! - @property name - @brief The name of this node. This is a temporary name and may change between - successive TikZ outputs. - */ -@property (copy) NSString *name; - -/*! - @property label - @brief The latex label that appears on this node. - */ -@property (copy) NSString *label; - -/*! - @property data - @brief Associated extra data. - */ -@property (copy) GraphElementData *data; - -// KVC methods -- (void) insertObject:(GraphElementProperty*)gep - inDataAtIndex:(NSUInteger)index; -- (void) removeObjectFromDataAtIndex:(NSUInteger)index; -- (void) replaceObjectInDataAtIndex:(NSUInteger)index - withObject:(GraphElementProperty*)gep; - -/*! - @brief Initialize a new node with the given point. - @param p a point. - @result A node. - */ -- (id)initWithPoint:(NSPoint)p; - -/*! - @brief Initialize a new node at (0,0). - @result A node. - */ -- (id)init; - -/*! - @brief Composes the shape transformer with another transformer - @param t The transform to apply before the shape transform - @result A transformer that first maps according to t, then according - to -shapeTransformer. - */ -- (Transformer*) shapeTransformerFromTransformer:(Transformer*)t; - -/*! - @brief A transformer that may be used to convert the shape to the - right position and scale - */ -- (Transformer*) shapeTransformer; - -/*! - @brief The bounding rect in the given co-ordinate system - @detail This is the bounding rect of the shape (after being - suitably translated and scaled). The label is not - considered. - @param shapeTrans The mapping from graph co-ordinates to the required - co-ordinates - @result The bounding rectangle - */ -- (NSRect) boundsUsingShapeTransform:(Transformer*)shapeTrans; - -/*! - @brief The bounding rect in graph co-ordinates - @detail This is the bounding rect of the shape (after being suitably - translated and scaled). The label is not considered. - */ -- (NSRect) boundingRect; - -/*! - @brief Try to attach a style of the correct name from the given style list. - @param styles an array of styles. - @result YES if successfully attached, NO otherwise. - */ -- (BOOL)attachStyleFromTable:(NSArray*)styles; - -/*! - @brief Set node properties from GraphElementData. - */ -- (void)updateData; - -/*! - @brief Set properties of this node to match the given node. - @param nd a node to mimic. - */ -- (void)setPropertiesFromNode:(Node *)nd; - -/*! - @brief Compare a node to another node using a lex ordering on coordinates. - @param nd another node. - @result A comparison result. - */ -- (NSComparisonResult)compareTo:(id)nd; - -/*! - @brief Factory method to construct a node with the given point. - @param p a point. - @result A node. - */ -+ (Node*)nodeWithPoint:(NSPoint)p; - -/*! - @brief Factory method to construct a node at (0,0). - @result A node. - */ -+ (Node*)node; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Node.m b/tikzit-old/src/common/Node.m deleted file mode 100644 index c5b11d1..0000000 --- a/tikzit-old/src/common/Node.m +++ /dev/null @@ -1,214 +0,0 @@ -// -// Node.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Node.h" - -#import "Shape.h" - - -@implementation Node - -- (id)initWithPoint:(NSPoint)p { - self = [super init]; - if (self) { - data = [[GraphElementData alloc] init]; - style = nil; - label = @""; - point = p; - } - return self; -} - -- (id)init { - return [self initWithPoint:NSMakePoint(0.0f, 0.0f)]; -} - -- (id)copyWithZone:(NSZone*)z { - Node *cp = [[Node allocWithZone:z] init]; - [cp setPropertiesFromNode:self]; - return cp; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [name release]; - [style release]; - [data release]; - [label release]; - [super dealloc]; -#endif -} - -- (Shape*) shape { - if (style) { - return [Shape shapeForName:[style shapeName]]; - } else { - return nil; - } -} - -- (Transformer*) shapeTransformerFromTransformer:(Transformer*)t { - // we take a copy to keep the reflection attributes -#if ! __has_feature(objc_arc) - Transformer *transformer = [[t copy] autorelease]; -#else - Transformer *transformer = [t copy]; -#endif - NSPoint screenPos = [t toScreen:point]; - [transformer setOrigin:screenPos]; - float scale = [t scale]; - if (style) { - scale *= [style scale]; - } - [transformer setScale:scale]; - return transformer; -} - -- (Transformer*) shapeTransformer { - float scale = 1.0f; - if (style) { - scale = [style scale]; - } - return [Transformer transformerWithOrigin:point andScale:scale]; -} - -- (NSRect) boundsUsingShapeTransform:(Transformer*)shapeTrans { - //if (style) { - return [shapeTrans rectToScreen:[[self shape] boundingRect]]; - /*} else { - NSRect r = NSZeroRect; - r.origin = [shapeTrans toScreen:[self point]]; - return r; - }*/ -} - -- (NSRect) boundingRect { - return [self boundsUsingShapeTransform:[self shapeTransformer]]; -} - -- (BOOL)attachStyleFromTable:(NSArray*)styles { -#if __has_feature(objc_arc) - NSString *style_name = [data propertyForKey:@"style"]; -#else - NSString *style_name = [[[data propertyForKey:@"style"] retain] autorelease]; -#endif - - [self setStyle:nil]; - - // 'none' is a reserved style - if (style_name == nil || [style_name isEqualToString:@"none"]) return YES; - - for (NodeStyle *s in styles) { - if ([[s name] compare:style_name]==NSOrderedSame) { - [self setStyle:s]; - return YES; - } - } - - // if we didn't find a style, fill in a default one - [self setStyle:[NodeStyle defaultNodeStyleWithName:style_name]]; - return NO; -} - -- (void)updateData { - if (style == nil) { - [data setProperty:@"none" forKey:@"style"]; - } else { - [data setProperty:[style name] forKey:@"style"]; - } -} - -- (void)setPropertiesFromNode:(Node*)nd { - [self setPoint:[nd point]]; - [self setStyle:[nd style]]; - [self setName:[nd name]]; - [self setData:[nd data]]; - [self setLabel:[nd label]]; -} - -+ (Node*)nodeWithPoint:(NSPoint)p { -#if __has_feature(objc_arc) - return [[Node alloc] initWithPoint:p]; -#else - return [[[Node alloc] initWithPoint:p] autorelease]; -#endif -} - -+ (Node*)node { -#if __has_feature(objc_arc) - return [[Node alloc] init]; -#else - return [[[Node alloc] init] autorelease]; -#endif -} - - -// perform a lexicographic ordering (-y, x) on coordinates. -- (NSComparisonResult)compareTo:(id)nd { - Node *node = (Node*)nd; - if (point.y > [node point].y) return NSOrderedAscending; - else if (point.y < [node point].y) return NSOrderedDescending; - else { - if (point.x < [node point].x) return NSOrderedAscending; - else if (point.x > [node point].x) return NSOrderedDescending; - else return NSOrderedSame; - } -} - -@synthesize name; -@synthesize label; -@synthesize point; - -@synthesize data; -- (void) insertObject:(GraphElementProperty*)gep - inDataAtIndex:(NSUInteger)index { - [data insertObject:gep atIndex:index]; -} -- (void) removeObjectFromDataAtIndex:(NSUInteger)index { - [data removeObjectAtIndex:index]; -} -- (void) replaceObjectInDataAtIndex:(NSUInteger)index - withObject:(GraphElementProperty*)gep { - [data replaceObjectAtIndex:index withObject:gep]; -} - -- (NodeStyle*)style { - return style; -} - -- (void)setStyle:(NodeStyle *)st { - if (style != st) { -#if __has_feature(objc_arc) - style = st; -#else - NodeStyle *oldStyle = style; - style = [st retain]; - [oldStyle release]; -#endif - } - [self updateData]; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/NodeStyle.h b/tikzit-old/src/common/NodeStyle.h deleted file mode 100644 index 034f95d..0000000 --- a/tikzit-old/src/common/NodeStyle.h +++ /dev/null @@ -1,125 +0,0 @@ -// -// NodeStyle.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "util.h" -#import "ColorRGB.h" -#import "PropertyHolder.h" - -/*! - @class NodeStyle - @brief Store node style information. - @details Store node style information. These properties affect how a node - is displayed in TikZiT. Colors are stored in the ColorRGB struct - to avoid any Cocoa dependency. These styles should be persistant, - which should be implemented in a platform-specific category. For - OS X, this is NodeStyle+Coder. - */ -@interface NodeStyle : PropertyHolder { - int strokeThickness; - float scale; - ColorRGB *strokeColorRGB; - ColorRGB *fillColorRGB; - NSString *name; - NSString *shapeName; - NSString *category; -} - -/*! - @property strokeThickness - @brief Thickness of the stroke. - */ -@property (assign) int strokeThickness; - -/*! - @property scale - @brief Overall scale of the shape. Defaults to 1.0. - */ -@property (assign) float scale; - - -/*! - @property strokeColorRGB - @brief The stroke color used to render the node - */ -@property (copy) ColorRGB *strokeColorRGB; - -/*! - @property fillColorRGB - @brief The fill color used to render the node - */ -@property (copy) ColorRGB *fillColorRGB; - -/*! - @property name - @brief Style name. - @details Style name. This is the only thing that affects how the node - will look when the latex code is rendered. - */ -@property (copy) NSString *name; - -/*! - @property shapeName - @brief The name of the shape that will be drawn in TikZiT. - */ -@property (copy) NSString *shapeName; - -/*! - @property category - @brief ??? - */ -@property (copy) NSString *category; - -@property (readonly) NSString *tikz; -@property (readonly) BOOL strokeColorIsKnown; -@property (readonly) BOOL fillColorIsKnown; - -+ (int) defaultStrokeThickness; - -/*! - @brief Designated initializer. Construct a blank style with name 'new'. - @result A default style. - */ -- (id)init; - -/*! - @brief Create a named style. - @param nm the style name. - @result A NodeStyle with the given name. - */ -- (id)initWithName:(NSString *)nm; - -/*! - @brief Factory method for initWithName: - @param nm the style name. - @result A NodeStyle with the given name. - */ -+ (NodeStyle*)defaultNodeStyleWithName:(NSString *)nm; - -/*! - * Make this style the same as the given one - */ -- (void) updateFromStyle:(NodeStyle*)style; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/NodeStyle.m b/tikzit-old/src/common/NodeStyle.m deleted file mode 100644 index 193d44d..0000000 --- a/tikzit-old/src/common/NodeStyle.m +++ /dev/null @@ -1,246 +0,0 @@ -// -// NodeStyle.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "NodeStyle.h" -#import "Shape.h" -#import "ShapeNames.h" - -@implementation NodeStyle - -+ (void)initialize { - [self setKeys:[NSArray arrayWithObjects: - @"fillColorRGB.red", - @"fillColorRGB.blue", - @"fillColorRGB.green", - @"strokeColorRGB.red", - @"strokeColorRGB.blue", - @"strokeColorRGB.green", - @"strokeThickness", - @"shapeName", - @"name", - nil] - triggerChangeNotificationsForDependentKey:@"tikz"]; - [self setKeys:[NSArray arrayWithObjects: - @"fillColorRGB.name", - nil] - triggerChangeNotificationsForDependentKey:@"fillColorIsKnown"]; - [self setKeys:[NSArray arrayWithObjects: - @"strokeColorRGB.name", - nil] - triggerChangeNotificationsForDependentKey:@"strokeColorIsKnown"]; -} - -+ (int) defaultStrokeThickness { return 1; } - -- (id)initWithName:(NSString*)nm { - self = [super initWithNotificationName:@"NodeStylePropertyChanged"]; - if (self != nil) { - strokeThickness = [NodeStyle defaultStrokeThickness]; - scale = 1.0f; - strokeColorRGB = [[ColorRGB alloc] initWithRed:0 green:0 blue:0]; - fillColorRGB = [[ColorRGB alloc] initWithRed:255 green:255 blue:255]; - - name = nm; - category = nil; - shapeName = SHAPE_CIRCLE; - } - return self; -} - -- (id)init { - self = [self initWithName:@"new"]; - return self; -} - -- (id)copyWithZone:(NSZone*)zone { - NodeStyle *style = [[NodeStyle allocWithZone:zone] init]; - - [style setStrokeThickness:[self strokeThickness]]; - [style setScale:[self scale]]; - [style setStrokeColorRGB:[self strokeColorRGB]]; - [style setFillColorRGB:[self fillColorRGB]]; - [style setName:[self name]]; - [style setShapeName:[self shapeName]]; - [style setCategory:[self category]]; - - return style; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [name release]; - [category release]; - [shapeName release]; - [strokeColorRGB release]; - [fillColorRGB release]; - [super dealloc]; -#endif -} - -- (NSString*) description { - return [NSString stringWithFormat:@"Node style \"%@\"", name]; -} - -- (void) updateFromStyle:(NodeStyle*)style { - [self setStrokeThickness:[style strokeThickness]]; - [self setScale:[style scale]]; - [self setStrokeColorRGB:[style strokeColorRGB]]; - [self setFillColorRGB:[style fillColorRGB]]; - [self setName:[style name]]; - [self setShapeName:[style shapeName]]; - [self setCategory:[style category]]; -} - -+ (NodeStyle*)defaultNodeStyleWithName:(NSString*)nm { -#if __has_feature(objc_arc) - return [[NodeStyle alloc] initWithName:nm]; -#else - return [[[NodeStyle alloc] initWithName:nm] autorelease]; -#endif -} - -- (NSString*)name { - return name; -} - -- (void)setName:(NSString *)s { - if (name != s) { - NSString *oldValue = name; - name = [s copy]; - [self postPropertyChanged:@"name" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (NSString*)shapeName { - return shapeName; -} - -- (void)setShapeName:(NSString *)s { - if (shapeName != s) { - NSString *oldValue = shapeName; - shapeName = [s copy]; - [self postPropertyChanged:@"shapeName" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (NSString*)category { - return category; -} - -- (void)setCategory:(NSString *)s { - if (category != s) { - NSString *oldValue = category; - category = [s copy]; - [self postPropertyChanged:@"category" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (int)strokeThickness { return strokeThickness; } -- (void)setStrokeThickness:(int)i { - int oldValue = strokeThickness; - strokeThickness = i; - [self postPropertyChanged:@"strokeThickness" oldValue:[NSNumber numberWithInt:oldValue]]; -} - -- (float)scale { return scale; } -- (void)setScale:(float)s { - float oldValue = scale; - scale = s; - [self postPropertyChanged:@"scale" oldValue:[NSNumber numberWithFloat:oldValue]]; -} - -- (ColorRGB*)strokeColorRGB { - return strokeColorRGB; -} - -- (void)setStrokeColorRGB:(ColorRGB*)c { - if (strokeColorRGB != c) { - ColorRGB *oldValue = strokeColorRGB; - strokeColorRGB = [c copy]; - [self postPropertyChanged:@"strokeColorRGB" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (ColorRGB*)fillColorRGB { - return fillColorRGB; -} - -- (void)setFillColorRGB:(ColorRGB*)c { - if (fillColorRGB != c) { - ColorRGB *oldValue = fillColorRGB; - fillColorRGB = [c copy]; - [self postPropertyChanged:@"fillColorRGB" oldValue:oldValue]; -#if ! __has_feature(objc_arc) - [oldValue release]; -#endif - } -} - -- (NSString*)tikz { - NSString *fillName = [fillColorRGB name]; - NSString *strokeName = [strokeColorRGB name]; - NSString *stroke = @""; - if (strokeThickness != 1) { - stroke = [NSString stringWithFormat:@",line width=%@ pt", - [NSNumber numberWithFloat:(float)strokeThickness * 0.4f]]; - } - - // If the colors are unknown, fall back on hexnames. These should be defined as colors - // in the Preambles class. - if (fillName == nil) fillName = [fillColorRGB hexName]; - if (strokeName == nil) strokeName = [strokeColorRGB hexName]; - - NSString *shapeDesc = [[Shape shapeForName:shapeName] styleTikz]; - if (shapeDesc == nil) shapeDesc = shapeName; - - return [NSString stringWithFormat:@"\\tikzstyle{%@}=[%@,fill=%@,draw=%@%@]", - name, - shapeDesc, - fillName, - strokeName, - stroke]; -} - -- (BOOL)strokeColorIsKnown { - return ([strokeColorRGB name] != nil); -} - -- (BOOL)fillColorIsKnown { - return ([fillColorRGB name] != nil); -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/PickSupport.h b/tikzit-old/src/common/PickSupport.h deleted file mode 100644 index 0749649..0000000 --- a/tikzit-old/src/common/PickSupport.h +++ /dev/null @@ -1,164 +0,0 @@ -// -// PickSupport.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -#import -#import "Node.h" -#import "Edge.h" - -/*! - @class PickSupport - @brief Maintain the selection state of nodes and edges. - @detail In addition to the notifications listed for specific methods, - whenever the node selection changes, a "NodeSelectionChanged" - signal is emitted, and whenever the edge selection changes, - an "EdgeSelectionChanged" signal is emitted. - */ -@interface PickSupport : NSObject { - NSMutableSet *selectedNodes; - NSMutableSet *selectedEdges; -} - -/*! - @property selectedNodes - @brief A set of selected nodes. - */ -@property (readonly) NSSet *selectedNodes; - -// KVC methods -- (void)addSelectedNodesObject:(Node*)node; -- (void)addSelectedNodes:(NSSet*)nodes; -- (void)removeSelectedNodesObject:(Node*)node; -- (void)removeSelectedNodes:(NSSet*)nodes; - -/*! - @property selectedEdges - @brief A set of selected edges. - */ -@property (readonly) NSSet *selectedEdges; - -// KVC methods -- (void)addSelectedEdgesObject:(Edge*)edge; -- (void)addSelectedEdges:(NSSet*)edges; -- (void)removeSelectedEdgesObject:(Edge*)edge; -- (void)removeSelectedEdges:(NSSet*)edges; - -/*! - @brief Check if a node is selected. - @param nd a node. - @result YES if nd is selected. - */ -- (BOOL)isNodeSelected:(Node*)nd; - -/*! - @brief Check if an edge is selected. - @param e an edge. - @result YES if e is selected. - */ -- (BOOL)isEdgeSelected:(Edge*)e; - -/*! - @brief Select a node. - @details Sends the "NodeSelected" notification if the node was not - already selected, with @p nd as "node" in the userInfo - @param nd a node. - */ -- (void)selectNode:(Node*)nd; - -/*! - @brief Deselect a node. - @details Sends the "NodeDeselected" notification if the node was - selected, with @p nd as "node" in the userInfo - @param nd a node. - */ -- (void)deselectNode:(Node*)nd; - -/*! - @brief Select an edge. - @details Sends the "EdgeSelected" notification if the node was not - already selected, with @p e as "edge" in the userInfo - @param e an edge. - */ -- (void)selectEdge:(Edge*)e; - -/*! - @brief Deselect an edge. - @details Sends the "EdgeDeselected" notification if the node was - selected, with @p e as "edge" in the userInfo - @param e an edge. - */ -- (void)deselectEdge:(Edge*)e; - -/*! - @brief Toggle the selected state of the given node. - @details Sends the "NodeSelected" or "NodeDeselected" notification as - appropriate, with @p nd as "node" in the userInfo - @param nd a node. - */ -- (void)toggleNodeSelected:(Node*)nd; - -/*! - @brief Select all nodes in the given set. - @details Sends the "NodeSelectionReplaced" notification if this - caused the selection to change. - - Equivalent to selectAllNodes:nodes replacingSelection:YES - @param nodes a set of nodes. - */ -- (void)selectAllNodes:(NSSet*)nodes; - -/*! - @brief Select all nodes in the given set. - @details Sends the "NodeSelectionReplaced" notification if this - caused the selection to change. - - If replace is NO, @p nodes will be added to the existing - selection, otherwise it will replace the existing selection. - @param nodes a set of nodes. - @param replace whether to replace the existing selection - */ -- (void)selectAllNodes:(NSSet*)nodes replacingSelection:(BOOL)replace; - -/*! - @brief Deselect all nodes. - @details Sends the "NodeSelectionReplaced" notification if there - were any nodes previously selected - */ -- (void)deselectAllNodes; - -/*! - @brief Deselect all edges. - @details Sends the "EdgeSelectionReplaced" notification if there - were any edges previously selected - */ -- (void)deselectAllEdges; - -/*! - @brief Factory method for getting a new PickSupport object. - @result An empty PickSupport. - */ -+ (PickSupport*)pickSupport; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/PickSupport.m b/tikzit-old/src/common/PickSupport.m deleted file mode 100644 index 560fc2c..0000000 --- a/tikzit-old/src/common/PickSupport.m +++ /dev/null @@ -1,232 +0,0 @@ -// -// PickSupport.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "PickSupport.h" - - -@implementation PickSupport - -- (void) postNodeSelectionChanged { - [[NSNotificationCenter defaultCenter] - postNotificationName:@"NodeSelectionChanged" - object:self]; -} - -- (void) postEdgeSelectionChanged { - [[NSNotificationCenter defaultCenter] - postNotificationName:@"EdgeSelectionChanged" - object:self]; -} - -- (id) init { - self = [super init]; - - if (self) { -#if __has_feature(objc_arc) - selectedNodes = [NSMutableSet set]; - selectedEdges = [NSMutableSet set]; -#else - selectedNodes = [[NSMutableSet set] retain]; - selectedEdges = [[NSMutableSet set] retain]; -#endif - } - - return self; -} - -+ (PickSupport*)pickSupport { -#if __has_feature(objc_arc) - return [[PickSupport alloc] init]; -#else - return [[[PickSupport alloc] init] autorelease]; -#endif -} - -@synthesize selectedNodes; -- (void)addSelectedNodesObject:(Node*)node { - return [self selectNode:node]; -} -- (void)addSelectedNodes:(NSSet*)nodes { - return [self selectAllNodes:nodes replacingSelection:NO]; -} -- (void)removeSelectedNodesObject:(Node*)node { - return [self deselectNode:node]; -} -- (void)removeSelectedNodes:(NSSet*)nodes { - if ([selectedNodes count] > 0) { - [selectedNodes minusSet:nodes]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"NodeSelectionReplaced" - object:self]; - [self postNodeSelectionChanged]; - } -} - -@synthesize selectedEdges; -- (void)addSelectedEdgesObject:(Edge*)edge { - return [self selectEdge:edge]; -} -- (void)addSelectedEdges:(NSSet*)edges { - if (selectedEdges == edges) { - return; - } - if ([edges count] == 0) { - return; - } - - [selectedEdges unionSet:edges]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"EdgeSelectionReplaced" - object:self]; - [self postEdgeSelectionChanged]; -} -- (void)removeSelectedEdgesObject:(Edge*)edge { - return [self deselectEdge:edge]; -} -- (void)removeSelectedEdges:(NSSet*)edges { - if ([selectedEdges count] > 0 && [edges count] > 0) { - [selectedEdges minusSet:edges]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"EdgeSelectionReplaced" - object:self]; - [self postEdgeSelectionChanged]; - } -} - -- (BOOL)isNodeSelected:(Node*)nd { - return [selectedNodes containsObject:nd]; -} - -- (BOOL)isEdgeSelected:(Edge*)e { - return [selectedEdges containsObject:e]; -} - -- (void)selectNode:(Node*)nd { - if (nd != nil && ![selectedNodes member:nd]) { - [selectedNodes addObject:nd]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"NodeSelected" - object:self - userInfo:[NSDictionary dictionaryWithObject:nd forKey:@"node"]]; - [self postNodeSelectionChanged]; - } -} - -- (void)deselectNode:(Node*)nd { - if (nd != nil && [selectedNodes member:nd]) { - [selectedNodes removeObject:nd]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"NodeDeselected" - object:self - userInfo:[NSDictionary dictionaryWithObject:nd forKey:@"node"]]; - [self postNodeSelectionChanged]; - } -} - -- (void)selectEdge:(Edge*)e { - if (e != nil && ![selectedEdges member:e]) { - [selectedEdges addObject:e]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"EdgeSelected" - object:self - userInfo:[NSDictionary dictionaryWithObject:e forKey:@"edge"]]; - [self postEdgeSelectionChanged]; - } -} - -- (void)deselectEdge:(Edge*)e { - if (e != nil && [selectedEdges member:e]) { - [selectedEdges removeObject:e]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"EdgeDeselected" - object:self - userInfo:[NSDictionary dictionaryWithObject:e forKey:@"edge"]]; - [self postEdgeSelectionChanged]; - } -} - -- (void)toggleNodeSelected:(Node*)nd { - if ([self isNodeSelected:nd]) - [self deselectNode:nd]; - else - [self selectNode:nd]; -} - -- (void)selectAllNodes:(NSSet*)nodes { - [self selectAllNodes:nodes replacingSelection:YES]; -} - -- (void)selectAllNodes:(NSSet*)nodes replacingSelection:(BOOL)replace { - if (selectedNodes == nodes) { - return; - } - if (!replace && [nodes count] == 0) { - return; - } - - if (replace) { -#if ! __has_feature(objc_arc) - [selectedNodes release]; -#endif - selectedNodes = [nodes mutableCopy]; - } else { - [selectedNodes unionSet:nodes]; - } - [[NSNotificationCenter defaultCenter] - postNotificationName:@"NodeSelectionReplaced" - object:self]; - [self postNodeSelectionChanged]; -} - -- (void)deselectAllNodes { - if ([selectedNodes count] > 0) { - [selectedNodes removeAllObjects]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"NodeSelectionReplaced" - object:self]; - [self postNodeSelectionChanged]; - } -} - -- (void)deselectAllEdges { - if ([selectedEdges count] > 0) { - [selectedEdges removeAllObjects]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"EdgeSelectionReplaced" - object:self]; - [self postEdgeSelectionChanged]; - } -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [selectedNodes release]; - [selectedEdges release]; - - [super dealloc]; -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/Preambles.h b/tikzit-old/src/common/Preambles.h deleted file mode 100644 index 2fb084a..0000000 --- a/tikzit-old/src/common/Preambles.h +++ /dev/null @@ -1,73 +0,0 @@ -// -// Preambles.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// Copyright 2011 Alex Merry. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "StyleManager.h" - -@class Graph; - -@interface Preambles : NSObject { - NSMutableDictionary *preambleDict; - NSString *selectedPreambleName; - NSArray *styles; - NSArray *edges; - StyleManager *styleManager; -} - -@property (copy) NSString *selectedPreambleName; -@property (retain) NSString *currentPreamble; -@property (retain) StyleManager *styleManager; -@property (readonly) NSMutableDictionary *preambleDict; - -+ (Preambles*)preambles; -- (id)init; -- (void)setStyles:(NSArray*)sty; -- (void)setEdges:(NSArray*)edg; - -- (NSString*)preambleForName:(NSString*)name; -- (BOOL)setPreamble:(NSString*)content forName:(NSString*)name; - -- (NSString*)addPreamble; -- (NSString*)addPreambleWithNameBase:(NSString*)name; - -- (BOOL)renamePreambleFrom:(NSString*)old to:(NSString*)new; -- (BOOL)removePreamble:(NSString*)name; - -- (NSEnumerator*)customPreambleNameEnumerator; - -- (void)removeAllPreambles; - -- (BOOL)selectedPreambleIsDefault; - -- (NSString*)styleDefinitions; -- (NSString*)defaultPreamble; -- (NSString*)defaultPreambleName; -- (NSString*)currentPostamble; - -- (NSString*)buildDocumentForTikz:(NSString*)tikz; -- (NSString*)buildDocumentForGraph:(Graph*)g; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Preambles.m b/tikzit-old/src/common/Preambles.m deleted file mode 100644 index 922fc30..0000000 --- a/tikzit-old/src/common/Preambles.m +++ /dev/null @@ -1,320 +0,0 @@ -// -// Preambles.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Preambles.h" -#import "NodeStyle.h" -#import "EdgeStyle.h" -#import "Graph.h" - -static NSString *DEF_PREAMBLE_START = -@"\\usepackage[svgnames]{xcolor}\n" -@"\\usepackage{tikz}\n" -@"\\usetikzlibrary{decorations.markings}\n" -@"\\usetikzlibrary{shapes.geometric}\n" -@"\n" -@"\\pgfdeclarelayer{edgelayer}\n" -@"\\pgfdeclarelayer{nodelayer}\n" -@"\\pgfsetlayers{edgelayer,nodelayer,main}\n" -@"\n" -@"\\tikzstyle{none}=[inner sep=0pt]\n"; - -static NSString *PREAMBLE_TAIL = -@"\n" -@"\\pagestyle{empty}\n" -@"\\usepackage[graphics,tightpage,active]{preview}\n" -@"\\PreviewEnvironment{tikzpicture}\n" -@"\\newlength{\\imagewidth}\n" -@"\\newlength{\\imagescale}\n" -@"\n" -@"\\begin{document}\n"; - -static NSString *POSTAMBLE = -@"\n" -@"\\end{document}\n"; - -@implementation Preambles - -+ (Preambles*)preambles { -#if __has_feature(objc_arc) - return [[self alloc] init]; -#else - return [[[self alloc] init] autorelease]; -#endif -} - -- (id)init { - self = [super init]; - if (self) { - selectedPreambleName = @"default"; - preambleDict = [[NSMutableDictionary alloc] initWithCapacity:1]; - [preambleDict setObject:[self defaultPreamble] forKey:@"custom"]; - styles = nil; - edges = nil; - styleManager = nil; - } - return self; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [selectedPreambleName release]; - [styles release]; - [styleManager release]; - [super dealloc]; -#endif -} - -- (NSString*)preambleForName:(NSString*)name { - if ([name isEqualToString:@"default"]) - return [self defaultPreamble]; - else - return [preambleDict objectForKey:name]; -} - -- (BOOL)setPreamble:(NSString*)content forName:(NSString*)name { - if ([name isEqualToString:@"default"]) - return NO; - [preambleDict setObject:content forKey:name]; - return YES; -} - -- (void)removeAllPreambles { - [preambleDict removeAllObjects]; -} - -- (NSEnumerator*)customPreambleNameEnumerator { - return [preambleDict keyEnumerator]; -} - -- (void)setStyles:(NSArray*)sty { -#if ! __has_feature(objc_arc) - [sty retain]; - [styles release]; -#endif - styles = sty; -} - -- (void)setEdges:(NSArray*)edg { -#if ! __has_feature(objc_arc) - [edg retain]; - [edges release]; -#endif - edges = edg; -} - -- (NSString*)styleDefinitions { - if (styleManager != nil) { - [self setStyles:[styleManager nodeStyles]]; - } -#if ! __has_feature(objc_arc) - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -#endif - NSMutableString *buf = [NSMutableString string]; - NSMutableString *colbuf = [NSMutableString string]; - NSMutableSet *colors = [NSMutableSet setWithCapacity:2*[styles count]]; - for (NodeStyle *st in styles) { - [buf appendFormat:@"%@\n", [st tikz]]; - ColorRGB *fill = [st fillColorRGB]; - ColorRGB *stroke = [st strokeColorRGB]; - if ([fill name] == nil && ![colors containsObject:fill]) { - [colors addObject:fill]; - [colbuf appendFormat:@"\\definecolor{%@}{rgb}{%.3f,%.3f,%.3f}\n", - [fill hexName], [fill redFloat], [fill greenFloat], [fill blueFloat]]; - } - - if ([stroke name] == nil && ![colors containsObject:stroke]) { - [colors addObject:stroke]; - [colbuf appendFormat:@"\\definecolor{%@}{rgb}{%.3f,%.3f,%.3f}\n", - [stroke hexName], [stroke redFloat], [stroke greenFloat], [stroke blueFloat]]; - } - } - - if (styleManager != nil) { - [self setEdges:[styleManager edgeStyles]]; - } - - [buf appendString:@"\n"]; - for (EdgeStyle *st in edges) { - [buf appendFormat:@"%@\n", [st tikz]]; - ColorRGB *color = [st colorRGB]; - if (color != nil && [color name] == nil && ![colors containsObject:color]) { - [colors addObject:color]; - [colbuf appendFormat:@"\\definecolor{%@}{rgb}{%.3f,%.3f,%.3f}\n", - [color hexName], [color redFloat], [color greenFloat], [color blueFloat]]; - } - } - - NSString *defs = [[NSString alloc] initWithFormat:@"%@\n%@", colbuf, buf]; - -#if __has_feature(objc_arc) - return defs; -#else - [pool drain]; - return [defs autorelease]; -#endif -} - -- (NSString*)defaultPreamble { - return [NSString stringWithFormat:@"%@%@", - DEF_PREAMBLE_START, [self styleDefinitions]]; -} - -- (BOOL)selectedPreambleIsDefault { - return [selectedPreambleName isEqualToString:@"default"]; -} - -- (NSString*)selectedPreambleName { return selectedPreambleName; } -- (void)setSelectedPreambleName:(NSString *)sel { - if (sel != selectedPreambleName) { -#if ! __has_feature(objc_arc) - [selectedPreambleName release]; -#endif - selectedPreambleName = [sel copy]; - } -} - -- (NSString*)currentPreamble { - NSString *pre = [self preambleForName:selectedPreambleName]; - return (pre == nil) ? [self defaultPreamble] : pre; -} - -- (void)setCurrentPreamble:(NSString*)str { - if (![selectedPreambleName isEqualToString:@"default"]) - [preambleDict setObject:str forKey:selectedPreambleName]; -} - -- (StyleManager*)styleManager { - return styleManager; -} - -- (void)setStyleManager:(StyleManager *)manager { -#if ! __has_feature(objc_arc) - [manager retain]; - [styleManager release]; -#endif - styleManager = manager; -} - -- (NSString*)currentPostamble { - return POSTAMBLE; -} - -- (NSMutableDictionary*)preambleDict { - return preambleDict; -} - -- (NSString*)defaultPreambleName { - return @"default"; -} - -- (NSString*)addPreamble { - return [self addPreambleWithNameBase:@"new preamble"]; -} - -- (NSString*)addPreambleWithNameBase:(NSString*)base { - if ([preambleDict objectForKey:base] == nil) { - [self setPreamble:[self defaultPreamble] forName:base]; - return base; - } - int i = 0; - NSString *tryName = nil; - do { - ++i; - tryName = [NSString stringWithFormat:@"%@ %d", base, i]; - } while ([preambleDict objectForKey:tryName] != nil); - - [self setPreamble:[self defaultPreamble] forName:tryName]; - return tryName; -} - -- (BOOL)renamePreambleFrom:(NSString*)old to:(NSString*)new { - if ([old isEqualToString:@"default"]) - return NO; - if ([new isEqualToString:@"default"]) - return NO; - if ([old isEqualToString:new]) - return YES; - BOOL isSelected = NO; - if ([old isEqualToString:selectedPreambleName]) { - [self setSelectedPreambleName:nil]; - isSelected = YES; - } - NSString *preamble = [preambleDict objectForKey:old]; -#if ! __has_feature(objc_arc) - [preamble retain]; -#endif - [preambleDict removeObjectForKey:old]; - [preambleDict setObject:preamble forKey:new]; -#if ! __has_feature(objc_arc) - [preamble release]; -#endif - if (isSelected) { - [self setSelectedPreambleName:new]; - } - return YES; -} - -- (BOOL)removePreamble:(NSString*)name { - if ([name isEqualToString:@"default"]) - return NO; - // "name" may be held only by being the selected preamble... -#if ! __has_feature(objc_arc) - [name retain]; -#endif - if ([name isEqualToString:selectedPreambleName]) - [self setSelectedPreambleName:nil]; - [preambleDict removeObjectForKey:name]; -#if ! __has_feature(objc_arc) - [name release]; -#endif - return YES; -} - -- (NSString*)buildDocumentForTikz:(NSString*)tikz -{ - NSString *preamble = [self currentPreamble]; - NSString *doc_head = @""; - if (![preamble hasPrefix:@"\\documentclass"]) { - doc_head = @"\\documentclass{article}\n"; - } - NSString *preamble_suffix = @""; - if ([preamble rangeOfString:@"\\begin{document}" - options:NSBackwardsSearch].length == 0) { - preamble_suffix = PREAMBLE_TAIL; - } - return [NSString stringWithFormat:@"%@%@%@%@%@", - doc_head, - [self currentPreamble], - preamble_suffix, - tikz, - POSTAMBLE]; -} - -- (NSString*)buildDocumentForGraph:(Graph*)g -{ - return [self buildDocumentForTikz:[g tikz]]; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/PropertyHolder.h b/tikzit-old/src/common/PropertyHolder.h deleted file mode 100644 index ba1d825..0000000 --- a/tikzit-old/src/common/PropertyHolder.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// PropertyHolder.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -@interface PropertyHolder : NSObject { - NSString *notificationName; -} - -- (id)initWithNotificationName:(NSString*)name; -- (void) postPropertyChanged:(NSString*)property oldValue:(id)value; -- (void) postPropertyChanged:(NSString*)property; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/PropertyHolder.m b/tikzit-old/src/common/PropertyHolder.m deleted file mode 100644 index 6aaf125..0000000 --- a/tikzit-old/src/common/PropertyHolder.m +++ /dev/null @@ -1,74 +0,0 @@ -// -// PropertyHolder.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "PropertyHolder.h" - -@implementation PropertyHolder - - -- (id)init { - self = [super init]; - if (self) { - notificationName = @"UnknownPropertyChanged"; - } - return self; -} - -- (id)initWithNotificationName:(NSString*)n { - self = [super init]; - if (self) { - notificationName = [n copy]; - } - return self; -} - -- (void)postPropertyChanged:(NSString*)property oldValue:(id)value { - NSDictionary *userInfo; - if (value != nil) { - userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - property, @"propertyName", - value, @"oldValue", - nil]; - } else { - userInfo = [NSDictionary dictionaryWithObject:property - forKey:@"propertyName"]; - } - [[NSNotificationCenter defaultCenter] postNotificationName:notificationName - object:self - userInfo:userInfo]; -} - -- (void)postPropertyChanged:(NSString*)property { - [self postPropertyChanged:property oldValue:nil]; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [notificationName release]; - [super dealloc]; -#endif -} - -@end - -// vi:ft=objc:ts=4:et:sts=4:sw=4 diff --git a/tikzit-old/src/common/RColor.h b/tikzit-old/src/common/RColor.h deleted file mode 100644 index 7f22547..0000000 --- a/tikzit-old/src/common/RColor.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import - -#ifndef CGFloat -#define CGFloat float -#endif - -/** - * A lightweight color structure used by RenderContext - * - * This is mainly to avoid the overhead of ColorRGB when - * rendering things not based on a NodeStyle - * - * All values range from 0.0f to 1.0f. - */ -typedef struct { - CGFloat red; - CGFloat green; - CGFloat blue; - CGFloat alpha; -} -RColor; - -/** Solid white */ -static const RColor WhiteRColor __attribute__((unused)) = {1.0, 1.0, 1.0, 1.0}; -/** Solid black */ -static const RColor BlackRColor __attribute__((unused)) = {0.0, 0.0, 0.0, 1.0}; - -/** Create a color with alpha set to 1.0 */ -RColor MakeSolidRColor (CGFloat red, CGFloat green, CGFloat blue); -/** Create a color */ -RColor MakeRColor (CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha); - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/RColor.m b/tikzit-old/src/common/RColor.m deleted file mode 100644 index 49914fe..0000000 --- a/tikzit-old/src/common/RColor.m +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "RColor.h" - -RColor MakeSolidRColor (CGFloat red, CGFloat green, CGFloat blue) { - return MakeRColor (red, green, blue, 1.0); -} - -RColor MakeRColor (CGFloat red, CGFloat green, CGFloat blue, CGFloat alpha) { - RColor color; - color.red = red; - color.green = green; - color.blue = blue; - color.alpha = alpha; - return color; -} - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/RectangleShape.h b/tikzit-old/src/common/RectangleShape.h deleted file mode 100644 index 3fa0f31..0000000 --- a/tikzit-old/src/common/RectangleShape.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// RectangleShape.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Shape.h" - - -@interface RectangleShape : Shape { -} - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/RectangleShape.m b/tikzit-old/src/common/RectangleShape.m deleted file mode 100644 index db9c803..0000000 --- a/tikzit-old/src/common/RectangleShape.m +++ /dev/null @@ -1,57 +0,0 @@ -// -// RectangleShape.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "RectangleShape.h" -#import "Node.h" -#import "Edge.h" - -@implementation RectangleShape - -- (id)init { - self = [super init]; - if (self) { - Node *n0,*n1,*n2,*n3; - float sz = 0.2f; - - n0 = [Node nodeWithPoint:NSMakePoint(-sz, sz)]; - n1 = [Node nodeWithPoint:NSMakePoint( sz, sz)]; - n2 = [Node nodeWithPoint:NSMakePoint( sz,-sz)]; - n3 = [Node nodeWithPoint:NSMakePoint(-sz,-sz)]; - - Edge *e0,*e1,*e2,*e3; - - e0 = [Edge edgeWithSource:n0 andTarget:n1]; - e1 = [Edge edgeWithSource:n1 andTarget:n2]; - e2 = [Edge edgeWithSource:n2 andTarget:n3]; - e3 = [Edge edgeWithSource:n3 andTarget:n0]; - - paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil]; - - styleTikz = @"rectangle"; - } - return self; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/RegularPolyShape.h b/tikzit-old/src/common/RegularPolyShape.h deleted file mode 100644 index 1fd8f1e..0000000 --- a/tikzit-old/src/common/RegularPolyShape.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// RegularPolyShape.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Shape.h" - -/** - * A regular polygon - * - * Matches the "regular polygon" shape in the shapes.geometric - * PGF/TikZ library. - */ -@interface RegularPolyShape : Shape { -} - -/** - * Initialise a regular polygon - * - * A rotation of 0 will produce a polygon with one - * edge flat along the bottom (just like PGF/TikZ - * does it). - * - * @param sides the number of sides the polygon should have - * @param rotation the rotation of the polygon, in degrees - */ -- (id)initWithSides:(int)sides rotation:(int)rotation; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/RegularPolyShape.m b/tikzit-old/src/common/RegularPolyShape.m deleted file mode 100644 index 3555115..0000000 --- a/tikzit-old/src/common/RegularPolyShape.m +++ /dev/null @@ -1,76 +0,0 @@ -// -// RegularPolyShape.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger -// Copyright 2012 Alex Merry -// All rights reserved. -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "RegularPolyShape.h" -#import "Node.h" -#import "Edge.h" -#import "util.h" - -@implementation RegularPolyShape - -- (id)initWithSides:(int)sides rotation:(int)rotation { - self = [super init]; - if (self == nil) - return nil; - - // TikZ draws regular polygons using a radius inscribed - // _inside_ the shape (touching middles of edges), not - // outside (touching points) - const float innerRadius = 0.2f; - - NSMutableArray *nodes = [NSMutableArray arrayWithCapacity:sides]; - NSMutableArray *edges = [NSMutableArray arrayWithCapacity:sides]; - - float dtheta = (M_PI * 2.0f) / ((float)sides); - float theta = (dtheta/2.0f) - (M_PI / 2.0f); - theta += degreesToRadians(rotation); - // radius of the outer circle - float radius = ABS(innerRadius / cos(dtheta)); - - for (int i = 0; i < sides; ++i) { - NSPoint p; - p.x = radius * cos(theta); - p.y = radius * sin(theta); - - [nodes addObject:[Node nodeWithPoint:p]]; - theta += dtheta; - } - - for (int i = 0; i < sides; ++i) { - [edges addObject:[Edge edgeWithSource:[nodes objectAtIndex:i] - andTarget:[nodes objectAtIndex:(i+1)%sides]]]; - } - - paths = [[NSSet alloc] initWithObjects:edges,nil]; - - styleTikz = [[NSString alloc] initWithFormat: - @"regular polygon,regular polygon sides=%d,shape border rotate=%d", - sides, rotation]; - - return self; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/RenderContext.h b/tikzit-old/src/common/RenderContext.h deleted file mode 100644 index 8633944..0000000 --- a/tikzit-old/src/common/RenderContext.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "RColor.h" - -typedef enum { - AntialiasDisabled, - AntialiasDefault -} AntialiasMode; - -// encapsulates a CTLine on OSX and -// a PangoLayout in GTK+ -@protocol TextLayout -@property (readonly) NSSize size; -@property (readonly) NSString *text; -- (void) showTextAt:(NSPoint)topLeft withColor:(RColor)color; -@end - -@protocol RenderContext -- (void) saveState; -- (void) restoreState; - -- (NSRect) clipBoundingBox; -- (BOOL) strokeIncludesPoint:(NSPoint)p; -- (BOOL) fillIncludesPoint:(NSPoint)p; -- (id) layoutText:(NSString*)text withSize:(CGFloat)fontSize; - -// this may not affect text rendering -- (void) setAntialiasMode:(AntialiasMode)mode; -- (void) setLineWidth:(CGFloat)width; -// setting to 0 will unset the dash -- (void) setLineDash:(CGFloat)dashLength; - -/** - * Clear the current path, including all subpaths - */ -- (void) startPath; -/** - * Close the current subpath - */ -- (void) closeSubPath; -/** - * Start a new subpath, and set the current point. - * - * The point will be the current point and the starting point - * for the subpath. - */ -- (void) moveTo:(NSPoint)p; -/** - * Add a cubic bezier curve to the current subpath. - * - * The curve will start at the current point, terminate at end and - * be defined by cp1 and cp2. - */ -- (void) curveTo:(NSPoint)end withCp1:(NSPoint)cp1 andCp2:(NSPoint)cp2; -/** - * Add a straight line to the current subpath. - * - * The line will start at the current point, and terminate at end. - */ -- (void) lineTo:(NSPoint)end; -/** - * Add a new rectangular subpath. - * - * The current point is undefined after this call. - */ -- (void) rect:(NSRect)rect; -/** - * Add a new circular subpath. - * - * The current point is undefined after this call. - */ -- (void) circleAt:(NSPoint)c withRadius:(CGFloat)r; - -/** - * Paint along the current path. - * - * The current line width and dash style will be used, - * and the colour is given by color. - * - * The path will be cleared by this call, as though - * startPath had been called. - */ -- (void) strokePathWithColor:(RColor)color; -/** - * Paint inside the current path. - * - * The fill colour is given by color. - * - * The path will be cleared by this call, as though - * startPath had been called. - */ -- (void) fillPathWithColor:(RColor)color; -/** - * Paint along and inside the current path. - * - * The current line width and dash style will be used, - * and the colour is given by color. - * - * The path will be cleared by this call, as though - * startPath had been called. - * - * Note that the fill and stroke may overlap, although - * the stroke is always painted on top, so this is only - * relevant when the stroke colour has an alpha channel - * other than 1.0f. - */ -- (void) strokePathWithColor:(RColor)scolor - andFillWithColor:(RColor)fcolor; -/** - * Paint along and inside the current path using an alpha channel. - * - * The current line width and dash style will be used, - * and the colour is given by color. - * - * The path will be cleared by this call, as though - * startPath had been called. - * - * Note that the fill and stroke may overlap, although - * the stroke is always painted on top, so this is only - * relevant when the stroke colour has an alpha channel - * other than 1.0f. - */ -- (void) strokePathWithColor:(RColor)scolor - andFillWithColor:(RColor)fcolor - usingAlpha:(CGFloat)alpha; -/** - * Set the clip to the current path. - * - * The path will be cleared by this call, as though - * startPath had been called. - */ -- (void) clipToPath; - -/** - * Paint everywhere within the clip. - */ -- (void) paintWithColor:(RColor)color; -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Shape.h b/tikzit-old/src/common/Shape.h deleted file mode 100644 index b401a87..0000000 --- a/tikzit-old/src/common/Shape.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// Shape.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Transformer.h" - -@interface Shape : NSObject { - NSSet *paths; - NSRect boundingRect; // cache - NSString *styleTikz; -} - -@property (retain) NSSet *paths; -@property (readonly) NSRect boundingRect; -/** - * The tikz code to use in style properties for this shape - * - * This can return nil, in which case the shape name should be used - */ -@property (retain) NSString *styleTikz; - -- (id)init; -+ (void)refreshShapeDictionary; -+ (NSDictionary*)shapeDictionary; -+ (Shape*)shapeForName:(NSString*)shapeName; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Shape.m b/tikzit-old/src/common/Shape.m deleted file mode 100644 index e887688..0000000 --- a/tikzit-old/src/common/Shape.m +++ /dev/null @@ -1,171 +0,0 @@ -// -// Shape.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Shape.h" - -#import "Edge.h" -#import "SupportDir.h" -#import "ShapeNames.h" - -#import "CircleShape.h" -#import "DiamondShape.h" -#import "RectangleShape.h" -#import "RegularPolyShape.h" -#import "TikzShape.h" - -#import "util.h" - -@implementation Shape - -- (void)calcBoundingRect { - boundingRect = NSZeroRect; - - if (paths == nil) - return; - - for (NSArray *arr in paths) { - for (Edge *e in arr) { - boundingRect = NSUnionRect(boundingRect, [e boundingRect]); - } - } -} - -- (id)init { - self = [super init]; - if (self) { - paths = nil; - } - return self; -} - -- (NSSet*)paths {return paths;} -- (void)setPaths:(NSSet *)p { - if (paths != p) { -#if __has_feature(objc_arc) - paths = p; -#else - [paths release]; - paths = [p retain]; -#endif - [self calcBoundingRect]; - } -} - -- (NSRect)boundingRect { return boundingRect; } - -@synthesize styleTikz; - -- (id)copyWithZone:(NSZone*)zone { - Shape *cp = [[[self class] allocWithZone:zone] init]; - [cp setPaths:paths]; - [cp setStyleTikz:styleTikz]; - return cp; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [paths release]; - [styleTikz release]; - [super dealloc]; -#endif -} - -NSDictionary *shapeDictionary = nil; - -+ (void)addShapesInDir:(NSString*)shapeDir to:(NSMutableDictionary*)shapeDict { - NSFileManager *fileManager = [NSFileManager defaultManager]; - NSError *err = nil; - NSArray *files = [fileManager contentsOfDirectoryAtPath:shapeDir error:&err]; - - if (files != nil) { - NSString *nm; - for (NSString *f in files) { - if ([f hasSuffix:@".tikz"]) { - nm = [f substringToIndex:[f length]-5]; - TikzShape *sh = - [[TikzShape alloc] initWithTikzFile: - [shapeDir stringByAppendingPathComponent:f]]; - if (sh != nil) { - [shapeDict setObject:sh forKey:nm]; -#if ! __has_feature(objc_arc) - [sh release]; -#endif - } - } - } - } -} - -+ (void)refreshShapeDictionary { - Shape *shapes[5] = { - [[CircleShape alloc] init], - [[RectangleShape alloc] init], - [[DiamondShape alloc] init], - [[RegularPolyShape alloc] initWithSides:3 rotation:0], - [[RegularPolyShape alloc] initWithSides:3 rotation:180]}; - NSMutableDictionary *shapeDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys: - shapes[0], SHAPE_CIRCLE, - shapes[1], SHAPE_RECTANGLE, - shapes[2], SHAPE_DIAMOND, - shapes[3], SHAPE_UP_TRIANGLE, - shapes[4], SHAPE_DOWN_TRIANGLE, - nil]; -#if ! __has_feature(objc_arc) - for (int i = 0; i<5; ++i) [shapes[i] release]; -#endif - - NSString *systemShapeDir = [[SupportDir systemSupportDir] stringByAppendingPathComponent:@"shapes"]; - NSString *userShapeDir = [[SupportDir userSupportDir] stringByAppendingPathComponent:@"shapes"]; - - [Shape addShapesInDir:systemShapeDir to:shapeDict]; - [Shape addShapesInDir:userShapeDir to:shapeDict]; - - NSDictionary *oldShapeDictionary = shapeDictionary; - shapeDictionary = shapeDict; - - [[NSNotificationCenter defaultCenter] - postNotificationName:@"ShapeDictionaryReplaced" - object:self]; - -#if ! __has_feature(objc_arc) - [oldShapeDictionary release]; -#endif -} - -+ (NSDictionary*)shapeDictionary { - if (shapeDictionary == nil) [Shape refreshShapeDictionary]; - return shapeDictionary; -} - -+ (Shape*)shapeForName:(NSString*)shapeName { - Shape *s = [[[self shapeDictionary] objectForKey:shapeName] copy]; -#if __has_feature(objc_arc) - return s; -#else - return [s autorelease]; -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/ShapeNames.h b/tikzit-old/src/common/ShapeNames.h deleted file mode 100644 index 66ecfb1..0000000 --- a/tikzit-old/src/common/ShapeNames.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// ShapeNames.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// - -#define SHAPE_CIRCLE @"circle" -#define SHAPE_RECTANGLE @"rectangle" -#define SHAPE_UP_TRIANGLE @"up triangle" -#define SHAPE_DOWN_TRIANGLE @"down triangle" -#define SHAPE_DIAMOND @"diamond" - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/StyleManager.h b/tikzit-old/src/common/StyleManager.h deleted file mode 100644 index bc920e7..0000000 --- a/tikzit-old/src/common/StyleManager.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "NodeStyle.h" -#import "EdgeStyle.h" - -@interface StyleManager: NSObject { - NSMutableArray *nodeStyles; - NSMutableArray *edgeStyles; -} - -+ (StyleManager*) manager; -- (id) init; - -@property (readonly) NSArray *nodeStyles; -@property (readonly) NSArray *edgeStyles; - -// only for use by loading code -- (void) _setNodeStyles:(NSMutableArray*)styles; -- (void) _setEdgeStyles:(NSMutableArray*)styles; - -- (NodeStyle*) nodeStyleForName:(NSString*)name; -- (EdgeStyle*) edgeStyleForName:(NSString*)name; - -- (void) addNodeStyle:(NodeStyle*)style; -- (void) removeNodeStyle:(NodeStyle*)style; -- (void) addEdgeStyle:(EdgeStyle*)style; -- (void) removeEdgeStyle:(EdgeStyle*)style; - -- (void) updateFromManager:(StyleManager*)manager; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/StyleManager.m b/tikzit-old/src/common/StyleManager.m deleted file mode 100644 index 05c6c86..0000000 --- a/tikzit-old/src/common/StyleManager.m +++ /dev/null @@ -1,378 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "StyleManager.h" - -@implementation StyleManager - -- (void) nodeStylePropertyChanged:(NSNotification*)n { - if ([[[n userInfo] objectForKey:@"propertyName"] isEqual:@"name"]) { - NSDictionary *userInfo; - userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [n object], @"style", - [[n userInfo] objectForKey:@"oldValue"], @"oldName", - nil]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"NodeStyleRenamed" - object:self - userInfo:userInfo]; - } -} - -- (void) ignoreAllNodeStyles { - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"NodeStylePropertyChanged" - object:nil]; -} - -- (void) ignoreNodeStyle:(NodeStyle*)style { - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"NodeStylePropertyChanged" - object:style]; -} - -- (void) listenToNodeStyle:(NodeStyle*)style { - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(nodeStylePropertyChanged:) - name:@"NodeStylePropertyChanged" - object:style]; -} - -- (void) edgeStylePropertyChanged:(NSNotification*)n { - if ([[[n userInfo] objectForKey:@"propertyName"] isEqual:@"name"]) { - NSDictionary *userInfo; - userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [n object], @"style", - [[n userInfo] objectForKey:@"oldValue"], @"oldName", - nil]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"EdgeStyleRenamed" - object:self - userInfo:userInfo]; - } -} - -- (void) ignoreAllEdgeStyles { - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"EdgeStylePropertyChanged" - object:nil]; -} - -- (void) ignoreEdgeStyle:(EdgeStyle*)style { - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:@"EdgeStylePropertyChanged" - object:style]; -} - -- (void) listenToEdgeStyle:(EdgeStyle*)style { - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(edgeStylePropertyChanged:) - name:@"EdgeStylePropertyChanged" - object:style]; -} - -+ (StyleManager*) manager { -#if __has_feature(objc_arc) - return [[self alloc] init]; -#else - return [[[self alloc] init] autorelease]; -#endif -} - -- (id) init { - self = [super init]; - - if (self) { - // we lazily load the default styles, since they may not be needed - nodeStyles = nil; - edgeStyles = nil; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -#if ! __has_feature(objc_arc) - [nodeStyles release]; - [edgeStyles release]; - - [super dealloc]; -#endif -} - -- (void) loadDefaultEdgeStyles { -#if ! __has_feature(objc_arc) - [edgeStyles release]; -#endif - edgeStyles = [[NSMutableArray alloc] initWithCapacity:3]; - - EdgeStyle *simple = [EdgeStyle defaultEdgeStyleWithName:@"simple"]; - [simple setThickness:2.0f]; - [self listenToEdgeStyle:simple]; - - EdgeStyle *arrow = [EdgeStyle defaultEdgeStyleWithName:@"arrow"]; - [arrow setThickness:2.0f]; - [arrow setDecorationStyle:ED_Arrow]; - [self listenToEdgeStyle:arrow]; - - EdgeStyle *tick = [EdgeStyle defaultEdgeStyleWithName:@"tick"]; - [tick setThickness:2.0f]; - [tick setDecorationStyle:ED_Tick]; - [self listenToEdgeStyle:tick]; - - [edgeStyles addObject:simple]; - [edgeStyles addObject:arrow]; - [edgeStyles addObject:tick]; -} - -- (void) loadDefaultNodeStyles { -#if ! __has_feature(objc_arc) - [nodeStyles release]; -#endif - nodeStyles = [[NSMutableArray alloc] initWithCapacity:3]; - - NodeStyle *rn = [NodeStyle defaultNodeStyleWithName:@"rn"]; - [rn setStrokeThickness:2]; - [rn setStrokeColorRGB:[ColorRGB colorWithFloatRed:0 green:0 blue:0]]; - [rn setFillColorRGB:[ColorRGB colorWithFloatRed:1 green:0 blue:0]]; - [self listenToNodeStyle:rn]; - - NodeStyle *gn = [NodeStyle defaultNodeStyleWithName:@"gn"]; - [gn setStrokeThickness:2]; - [gn setStrokeColorRGB:[ColorRGB colorWithFloatRed:0 green:0 blue:0]]; - [gn setFillColorRGB:[ColorRGB colorWithFloatRed:0 green:1 blue:0]]; - [self listenToNodeStyle:gn]; - - NodeStyle *yn = [NodeStyle defaultNodeStyleWithName:@"yn"]; - [yn setStrokeThickness:2]; - [yn setStrokeColorRGB:[ColorRGB colorWithFloatRed:0 green:0 blue:0]]; - [yn setFillColorRGB:[ColorRGB colorWithFloatRed:1 green:1 blue:0]]; - [self listenToNodeStyle:yn]; - - [nodeStyles addObject:rn]; - [nodeStyles addObject:gn]; - [nodeStyles addObject:yn]; -} - -- (void) postNodeStyleAdded:(NodeStyle*)style { - [[NSNotificationCenter defaultCenter] postNotificationName:@"NodeStyleAdded" - object:self - userInfo:[NSDictionary dictionaryWithObject:style forKey:@"style"]]; -} - -- (void) postNodeStyleRemoved:(NodeStyle*)style { - [[NSNotificationCenter defaultCenter] postNotificationName:@"NodeStyleRemoved" - object:self - userInfo:[NSDictionary dictionaryWithObject:style forKey:@"style"]]; -} - -- (void) postEdgeStyleAdded:(EdgeStyle*)style { - [[NSNotificationCenter defaultCenter] postNotificationName:@"EdgeStyleAdded" - object:self - userInfo:[NSDictionary dictionaryWithObject:style forKey:@"style"]]; -} - -- (void) postEdgeStyleRemoved:(EdgeStyle*)style { - [[NSNotificationCenter defaultCenter] postNotificationName:@"EdgeStyleRemoved" - object:self - userInfo:[NSDictionary dictionaryWithObject:style forKey:@"style"]]; -} - -- (void) postNodeStylesReplaced { - [[NSNotificationCenter defaultCenter] postNotificationName:@"NodeStylesReplaced" object:self]; -} - -- (void) postEdgeStylesReplaced { - [[NSNotificationCenter defaultCenter] postNotificationName:@"EdgeStylesReplaced" object:self]; -} - -- (NSArray*) nodeStyles { - if (nodeStyles == nil) { - [self loadDefaultNodeStyles]; - } - return nodeStyles; -} - -- (NSArray*) edgeStyles { - if (edgeStyles == nil) { - [self loadDefaultEdgeStyles]; - } - return edgeStyles; -} - -- (void) _setNodeStyles:(NSMutableArray*)styles { - [self ignoreAllNodeStyles]; -#if ! __has_feature(objc_arc) - [nodeStyles release]; - [styles retain]; -#endif - nodeStyles = styles; - for (NodeStyle *style in styles) { - [self listenToNodeStyle:style]; - } - [self postNodeStylesReplaced]; -} - -- (void) _setEdgeStyles:(NSMutableArray*)styles { - [self ignoreAllEdgeStyles]; -#if ! __has_feature(objc_arc) - [edgeStyles release]; - [styles retain]; -#endif - edgeStyles = styles; - for (EdgeStyle *style in styles) { - [self listenToEdgeStyle:style]; - } - [self postEdgeStylesReplaced]; -} - -- (NodeStyle*) nodeStyleForName:(NSString*)name { - for (NodeStyle *s in nodeStyles) { - if ([[s name] isEqualToString:name]) { - return s; - } - } - - return nil; -} - -- (void) addNodeStyle:(NodeStyle*)style { - if (nodeStyles == nil) { - [self loadDefaultNodeStyles]; - } - [nodeStyles addObject:style]; - [self listenToNodeStyle:style]; - [self postNodeStyleAdded:style]; -} - -- (void) removeNodeStyle:(NodeStyle*)style { - if (nodeStyles == nil) { - [self loadDefaultNodeStyles]; - } - - [self ignoreNodeStyle:style]; -#if ! __has_feature(objc_arc) - [style retain]; -#endif - [nodeStyles removeObject:style]; - [self postNodeStyleRemoved:style]; -#if ! __has_feature(objc_arc) - [style release]; -#endif -} - -- (EdgeStyle*) edgeStyleForName:(NSString*)name { - for (EdgeStyle *s in edgeStyles) { - if ([[s name] isEqualToString:name]) { - return s; - } - } - - return nil; -} - -- (void) addEdgeStyle:(EdgeStyle*)style { - if (edgeStyles == nil) { - [self loadDefaultEdgeStyles]; - } - [edgeStyles addObject:style]; - [self listenToEdgeStyle:style]; - [self postEdgeStyleAdded:style]; -} - -- (void) removeEdgeStyle:(EdgeStyle*)style { - if (edgeStyles == nil) { - [self loadDefaultEdgeStyles]; - } - - [self ignoreEdgeStyle:style]; -#if ! __has_feature(objc_arc) - [style retain]; -#endif - [edgeStyles removeObject:style]; - [self postEdgeStyleRemoved:style]; -#if ! __has_feature(objc_arc) - [style release]; -#endif -} - -- (void) updateFromManager:(StyleManager*)m { - NSMutableArray *ns = [NSMutableArray arrayWithCapacity:[[m nodeStyles] count]]; - for (NodeStyle *style in [m nodeStyles]) { - NodeStyle *currentStyle = [self nodeStyleForName:[style name]]; - if (currentStyle != nil) { - [currentStyle updateFromStyle:style]; - [ns addObject:currentStyle]; - } else { -#if __has_feature(objc_arc) - [ns addObject:[style copy]]; -#else - [ns addObject:[[style copy] autorelease]]; -#endif - } - } - NSMutableArray *es = [NSMutableArray arrayWithCapacity:[[m edgeStyles] count]]; - for (EdgeStyle *style in [m edgeStyles]) { - EdgeStyle *currentStyle = [self edgeStyleForName:[style name]]; - if (currentStyle != nil) { - [currentStyle updateFromStyle:style]; - [es addObject:currentStyle]; - } else { -#if __has_feature(objc_arc) - [es addObject:[style copy]]; -#else - [es addObject:[[style copy] autorelease]]; -#endif - } - } - [self _setNodeStyles:ns]; - [self _setEdgeStyles:es]; -} - -- (id) copyWithZone:(NSZone*)zone { - StyleManager *m = [[StyleManager allocWithZone:zone] init]; - - NSMutableArray *ns = [NSMutableArray arrayWithCapacity:[nodeStyles count]]; - for (NodeStyle *style in nodeStyles) { -#if __has_feature(objc_arc) - [ns addObject:[style copyWithZone:zone]]; -#else - [ns addObject:[[style copyWithZone:zone] autorelease]]; -#endif - } - NSMutableArray *es = [NSMutableArray arrayWithCapacity:[edgeStyles count]]; - for (EdgeStyle *style in edgeStyles) { -#if __has_feature(objc_arc) - [es addObject:[style copyWithZone:zone]]; -#else - [es addObject:[[style copyWithZone:zone] autorelease]]; -#endif - } - [m _setNodeStyles:ns]; - [m _setEdgeStyles:es]; - - return m; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/SupportDir.h b/tikzit-old/src/common/SupportDir.h deleted file mode 100644 index 30ccbcb..0000000 --- a/tikzit-old/src/common/SupportDir.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// SupportDir.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - - -@interface SupportDir : NSObject { -} - -+ (void)createUserSupportDir; -+ (NSString*)userSupportDir; -+ (NSString*)systemSupportDir; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/SupportDir.m b/tikzit-old/src/common/SupportDir.m deleted file mode 100644 index 22fed1b..0000000 --- a/tikzit-old/src/common/SupportDir.m +++ /dev/null @@ -1,65 +0,0 @@ -// -// SupportDir.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "SupportDir.h" - -#ifndef __APPLE__ -#import -#import "stat.h" -#endif - -@implementation SupportDir - -+ (NSString*)userSupportDir { -#ifdef __APPLE__ - return [[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,NSUserDomainMask,YES) - objectAtIndex:0] stringByAppendingPathComponent:@"TikZiT"]; -#else - return [NSString stringWithFormat:@"%s/tikzit", g_get_user_config_dir ()]; -#endif -} - -+ (NSString*)systemSupportDir { -#ifdef __APPLE__ - return [[NSBundle mainBundle] resourcePath]; -#else - return @TIKZITSHAREDIR; -#endif -} - -+ (void)createUserSupportDir { -#ifdef __APPLE__ - NSFileManager *fileManager = [NSFileManager defaultManager]; - [fileManager createDirectoryAtPath:[SupportDir userSupportDir] - withIntermediateDirectories:YES - attributes:nil - error:NULL]; -#else - // NSFileManager is slightly dodgy on Windows - g_mkdir_with_parents ([[SupportDir userSupportDir] UTF8String], S_IRUSR | S_IWUSR | S_IXUSR); -#endif -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/TikzGraphAssembler+Parser.h b/tikzit-old/src/common/TikzGraphAssembler+Parser.h deleted file mode 100644 index c9391a9..0000000 --- a/tikzit-old/src/common/TikzGraphAssembler+Parser.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * TikzGraphAssember+Parser.h - * - * This file exposes some TikzGraphAssembler functions - * that are only of use to the parser. - */ - -#import "TikzGraphAssembler.h" - -@interface TikzGraphAssembler (Parser) -- (Graph*) graph; -/** Store a node so that it can be looked up by name later */ -- (void) addNodeToMap:(Node*)n; -/** Get a previously-stored node by name */ -- (Node*) nodeWithName:(NSString*)name; -- (void) reportError:(const char *)message atLocation:(YYLTYPE*)yylloc; -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/TikzGraphAssembler.h b/tikzit-old/src/common/TikzGraphAssembler.h deleted file mode 100644 index 3403969..0000000 --- a/tikzit-old/src/common/TikzGraphAssembler.h +++ /dev/null @@ -1,115 +0,0 @@ -// -// TikzGraphAssembler.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Graph.h" - -/** - * Parses (a subset of) tikz code and produces the corresponding Graph - * - * A note on errors: - * If parsing fails and a non-NULL error argument is given, it will be - * populated with an error with domain TZErrorDomain and code TZ_ERR_PARSE - * (see NSError+Tikzit.h). - * - * This will have a description set, typically something like - * "syntax error, unexpected [, expecting (" - * It may also have the following keys (it will have all or none of these), - * where numbers are stored using NSNumber: - * - startLine: the line (starting at 1) containing the first character - * of the bad token - * - startColumn: the column (starting at 1; tabs count for 1) of the first - * character of the bad token - * - endLine: the line (starting at 1) containing the last character - * of the bad token - * - endColumn: the column (starting at 1; tabs count for 1) of the last - * character of the bad token - * - syntaxString: an excerpt of the input string (typically the contents - * from startLine to endLine) providing some context - * - tokenOffset: the character offset (starting at 0) of the bad token - * within syntaxString - * - tokenLength: the character length (including newlines) of the bad token - * within syntaxString - */ -@interface TikzGraphAssembler : NSObject { - const char *tikzStr; - Graph *graph; - void *scanner; - NSMutableDictionary *nodeMap; - NSError *lastError; -} - -/** - * Parse tikz and place the result in gr - * - * Note that the graph must be empty; this might be used from an init - * method, for example, although don't forget that you can return a - * different object in init methods, providing you get the allocation - * right. - * - * @param tikz the tikz string to parse - * @param gr the graph to store the result in (must be empty, non-nil) - * @param e a location to store an error if parsing fails (may be NULL) - * @return YES if parsing succeeded, NO otherwise - */ -+ (BOOL) parseTikz:(NSString*)tikz forGraph:(Graph*)gr error:(NSError**)e; -/** - * Overload for -[parseTikz:forGraph:error:] with the error set to NULL - */ -+ (BOOL) parseTikz:(NSString*)tikz forGraph:(Graph*)gr; -/** - * Parse tikz - * - * @param tikz the tikz string to parse - * @param e a location to store an error if parsing fails (may be NULL) - * @return a Graph object if parsing succeeded, nil otherwise - */ -+ (Graph*) parseTikz:(NSString*)tikz error:(NSError**)e; -/** - * Overload for -[parseTikz:error:] with the error set to NULL - */ -+ (Graph*) parseTikz:(NSString*)tikz; -/** - * Validate a property string or value - * - * Wraps the string in "{" and "}" and checks it lexes completely; in other - * words, makes sure that "{" and "}" are balanced (ignoring escaped versions). - * @param tikz the string to validate - * @return YES if the string can be used as a property name or value, NO - * otherwise - */ -+ (BOOL)validateTikzPropertyNameOrValue:(NSString*)tikz; - -/** - * Validate an edge anchor - * - * Checks that the given string will successfully lex if used as an anchor for - * and edge - * @param tikz the string to validate - * @return YES if the string can be used as an edge anchor, NO otherwise - */ -+ (BOOL)validateTikzEdgeAnchor:(NSString*)tikz; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/TikzGraphAssembler.m b/tikzit-old/src/common/TikzGraphAssembler.m deleted file mode 100644 index c5d2811..0000000 --- a/tikzit-old/src/common/TikzGraphAssembler.m +++ /dev/null @@ -1,310 +0,0 @@ -// -// TikzGraphAssembler.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TikzGraphAssembler.h" -#import "tikzparserdefs.h" -#import "tikzparser.h" -#import "TikzGraphAssembler+Parser.h" -#import "tikzlexer.h" -#import "NSError+Tikzit.h" - -@implementation TikzGraphAssembler - -- (id)init { -#if ! __has_feature(objc_arc) - [self release]; -#endif - return nil; -} - -- (id)initWithGraph:(Graph*)g { - self = [super init]; - if (self) { -#if __has_feature(objc_arc) - graph = g; -#else - graph = [g retain]; -#endif - nodeMap = [[NSMutableDictionary alloc] init]; - yylex_init (&scanner); - yyset_extra(self, scanner); - } - return self; -} - -- (void)dealloc { -#if ! __has_feature(objc_arc) - [graph release]; - [nodeMap release]; - [lastError release]; - yylex_destroy (scanner); - [super dealloc]; -#endif -} - -- (BOOL) parseTikz:(NSString*)t error:(NSError**)error { -#if ! __has_feature(objc_arc) - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -#endif - - tikzStr = [t UTF8String]; - yy_scan_string(tikzStr, scanner); - int result = yyparse(scanner); - tikzStr = NULL; - -#if ! __has_feature(objc_arc) - [pool drain]; -#endif - - if (result == 0) { - return YES; - } else { - if (error) { - if (lastError) { -#if __has_feature(objc_arc) - *error = lastError; -#else - *error = [[lastError retain] autorelease]; -#endif - } else if (result == 1) { - *error = [NSError errorWithMessage:@"Syntax error" - code:TZ_ERR_PARSE]; - } else if (result == 2) { - *error = [NSError errorWithMessage:@"Insufficient memory" - code:TZ_ERR_PARSE]; - } else { - *error = [NSError errorWithMessage:@"Unknown error" - code:TZ_ERR_PARSE]; - } - } - return NO; - } -} - -+ (BOOL) parseTikz:(NSString*)tikz forGraph:(Graph*)gr { - return [self parseTikz:tikz forGraph:gr error:NULL]; -} -+ (Graph*) parseTikz:(NSString*)tikz error:(NSError**)e { - Graph *gr = [[Graph alloc] init]; - if ([self parseTikz:tikz forGraph:gr error:e]) { -#if __has_feature(objc_arc) - return gr; -#else - return [gr autorelease]; -#endif - } else { -#if ! __has_feature(objc_arc) - [gr release]; -#endif - return nil; - } -} -+ (Graph*) parseTikz:(NSString*)tikz { - return [self parseTikz:tikz error:NULL]; -} - -+ (BOOL) parseTikz:(NSString*)tikz forGraph:(Graph*)gr error:(NSError**)error { - if([tikz length] == 0) { - // empty string -> empty graph - return YES; - } - - TikzGraphAssembler *assembler = [[self alloc] initWithGraph:gr]; - BOOL success = [assembler parseTikz:tikz error:error]; -#if ! __has_feature(objc_arc) - [assembler release]; -#endif - return success; -} - -+ (BOOL)validateTikzPropertyNameOrValue:(NSString*)tikz { - BOOL valid; - - NSString * testTikz = [NSString stringWithFormat: @"{%@}", tikz]; - - void *scanner; - yylex_init (&scanner); - yyset_extra(nil, scanner); - yy_scan_string([testTikz UTF8String], scanner); - YYSTYPE lval; - YYLTYPE lloc; - int result = yylex(&lval, &lloc, scanner); - valid = (result == DELIMITEDSTRING) && - (yyget_leng(scanner) == [testTikz length]); - yylex_destroy(scanner); - - return valid; -} - -+ (BOOL)validateTikzEdgeAnchor:(NSString*)tikz { - if ([tikz length] == 0) - return YES; - - BOOL valid = YES; - - NSString * testTikz = [NSString stringWithFormat: @"(1.%@)", tikz]; - - void *scanner; - yylex_init (&scanner); - yyset_extra(nil, scanner); - yy_scan_string([testTikz UTF8String], scanner); - YYSTYPE lval; - YYLTYPE lloc; - valid = valid && (yylex(&lval, &lloc, scanner) == LEFTPARENTHESIS); - valid = valid && (yylex(&lval, &lloc, scanner) == REFSTRING); - valid = valid && (yylex(&lval, &lloc, scanner) == FULLSTOP); - valid = valid && (yylex(&lval, &lloc, scanner) == REFSTRING); - valid = valid && (yylex(&lval, &lloc, scanner) == RIGHTPARENTHESIS); - valid = valid && (lloc.last_column == [testTikz length]); - yylex_destroy(scanner); - - return valid; -} - -@end - -@implementation TikzGraphAssembler (Parser) -- (Graph*)graph { return graph; } - -- (void)addNodeToMap:(Node*)n { - [nodeMap setObject:n forKey:[n name]]; -} - -- (Node*)nodeWithName:(NSString*)name { - return [nodeMap objectForKey:name]; -} - -- (void) setLastError:(NSError*)error { -#if ! __has_feature(objc_arc) - [error retain]; - [lastError release]; -#endif - lastError = error; -} - -- (void) reportError:(const char *)message atLocation:(YYLTYPE*)yylloc { - NSString *nsmsg = [NSString stringWithUTF8String:message]; - - const char *first_line_start = find_start_of_nth_line ( - tikzStr, yylloc->first_line - 1); - const char *last_line_start = find_start_of_nth_line ( - first_line_start, yylloc->last_line - yylloc->first_line); - const char *last_line_end = last_line_start; - while (*last_line_end && *last_line_end != '\n') { - // points to just after end of last line - ++last_line_end; - } - - size_t context_len = last_line_end - first_line_start; - size_t token_offset = yylloc->first_column - 1; - size_t token_len = ((last_line_start - first_line_start) + yylloc->last_column) - token_offset; - - if (token_offset + token_len > context_len) { - // error position state is corrupted - NSLog(@"Got bad error state for error \"%s\": start(%i,%i), end(%i,%i)", - message, - yylloc->first_line, - yylloc->first_column, - yylloc->last_line, - yylloc->last_column); - [self setLastError:[NSError errorWithMessage:nsmsg - code:TZ_ERR_PARSE]]; - } else { - char *context = malloc (context_len + 1); - strncpy (context, first_line_start, context_len); - *(context + context_len) = '\0'; - - NSDictionary *userInfo = - [NSDictionary dictionaryWithObjectsAndKeys: - nsmsg, - NSLocalizedDescriptionKey, - [NSNumber numberWithInt:yylloc->first_line], - @"startLine", - [NSNumber numberWithInt:yylloc->first_column], - @"startColumn", - [NSNumber numberWithInt:yylloc->last_line], - @"endLine", - [NSNumber numberWithInt:yylloc->last_column], - @"endColumn", - [NSString stringWithUTF8String:context], - @"syntaxString", - [NSNumber numberWithInt:token_offset], - @"tokenStart", - [NSNumber numberWithInt:token_len], - @"tokenLength", - nil]; - [self setLastError: - [NSError errorWithDomain:TZErrorDomain - code:TZ_ERR_PARSE - userInfo:userInfo]]; - - // we can now freely edit context string - // we only bother printing out the first line - if (yylloc->last_line > yylloc->first_line) { - char *nlp = strchr(context, '\n'); - if (nlp) { - *nlp = '\0'; - context_len = nlp - context; - NSAssert2(token_offset < context_len, @"token_offset (%lu) < context_len (%lu)", token_offset, context_len); - if (token_offset + token_len > context_len) { - token_len = context_len - token_offset; - } - } else { - NSLog(@"Didn't find any newlines in context string!"); - } - } - size_t token_col_offset = 0; - size_t token_col_len = 0; - for (int i = 0; i < token_offset; ++i) { - if (*(context + i) == '\t') - token_col_offset += 8; - else - ++token_col_offset; - } - for (int i = token_offset; i < token_offset + token_len; ++i) { - if (*(context + i) == '\t') - token_col_len += 8; - else - ++token_col_len; - } - NSString *pointerLinePadding = - [@"" stringByPaddingToLength:token_col_offset - withString:@" " - startingAtIndex:0]; - NSString *pointerLineCarets = - [@"" stringByPaddingToLength:token_col_len - withString:@"^" - startingAtIndex:0]; - NSLog(@"Parse error on line %i, starting at %i: %s\n%s\n%@%@", - yylloc->first_line, - yylloc->first_column, - message, - context, - pointerLinePadding, - pointerLineCarets); - free (context); - } -} -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/TikzShape.h b/tikzit-old/src/common/TikzShape.h deleted file mode 100644 index 6a91f91..0000000 --- a/tikzit-old/src/common/TikzShape.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// TikzShape.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Shape.h" - -@interface TikzShape : Shape { - NSString *tikzSrc; -} - -@property (copy) NSString *tikzSrc; - -- (id)initWithTikzFile:(NSString*)file; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/TikzShape.m b/tikzit-old/src/common/TikzShape.m deleted file mode 100644 index 555a7df..0000000 --- a/tikzit-old/src/common/TikzShape.m +++ /dev/null @@ -1,70 +0,0 @@ -// -// TikzShape.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TikzShape.h" -#import "Graph.h" - -@implementation TikzShape - -@synthesize tikzSrc; - -- (id)initWithTikzFile:(NSString*)file { - self = [super init]; - if (self) { - NSString *tikz = [NSString stringWithContentsOfFile:file - encoding:NSUTF8StringEncoding - error:NULL]; - if (tikz == nil) return nil; - - tikzSrc = [tikz copy]; - - Graph *graph = [Graph graphFromTikz:tikz]; - if (graph == nil) return nil; - - NSRect graphBounds = ([graph hasBoundingBox]) ? [graph boundingBox] : [graph bounds]; - - float sz = 0.5f; - - // the "screen" coordinate space fits in the shape bounds - Transformer *t = [Transformer transformer]; - float width_ratio = (2*sz) / graphBounds.size.width; - float height_ratio = (2*sz) / graphBounds.size.height; - [t setScale:MIN(width_ratio, height_ratio)]; - NSRect bds = [t rectToScreen:graphBounds]; - NSPoint shift = NSMakePoint(-NSMidX(bds), - -NSMidY(bds)); - [t setOrigin:shift]; - [graph applyTransformer:t]; -#if __has_feature(objc_arc) - paths = [graph pathCover]; -#else - paths = [[graph pathCover] retain]; -#endif - } - return self; -} - - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/Transformer.h b/tikzit-old/src/common/Transformer.h deleted file mode 100644 index 1b0108a..0000000 --- a/tikzit-old/src/common/Transformer.h +++ /dev/null @@ -1,154 +0,0 @@ -// -// Transformer.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -#import - -extern float const PIXELS_PER_UNIT; - -/*! - @class Transformer - @brief Do affine coordinate transforms between an abstract co-ordinate - space (such as the graph's) and the screen's. - - This currently allows zooming and panning. - */ -@interface Transformer : NSObject { - NSPoint origin; - float x_scale; - float y_scale; -} - -/*! - @brief The screen co-ordinate of the abstract space origin. - */ -@property (assign) NSPoint origin; - -/*! - @brief The scale (from abstract space to screen space) - @detail This is the size of a single unit (a distance of 1.0) - of the abstract space on the screen. - - Around 50 is a reasonable value. - */ -@property (assign) float scale; - -/*! - @brief Whether co-ordinates are flipped about the X axis - @detail TikZ considers X co-ordinates to run left to right, - which is not necessarily how the screen views - them. - */ -@property (assign,getter=isFlippedAboutXAxis) BOOL flippedAboutXAxis; - -/*! - @brief Whether co-ordinates are flipped about the Y axis - @detail TikZ considers Y co-ordinates to run up the page, - which is not necessarily how the screen views - them. - */ -@property (assign,getter=isFlippedAboutYAxis) BOOL flippedAboutYAxis; - -/*! - @brief Transform a point from screen space to abstract space. - @param p a point in screen space. - @result A point in abstract space. - */ -- (NSPoint)fromScreen:(NSPoint)p; - -/*! - @brief Transform a point from abstract space to screen space. - @param p a point in abstract space. - @result A point in screen space. - */ -- (NSPoint)toScreen:(NSPoint)p; - -/*! - @brief Scale a distance from screen space to abstract space. - @param dist a distance in screen space. - @result A distance in abstract space. - */ -- (float)scaleFromScreen:(float)dist; - -/*! - @brief Scale a distance from abstract space to screen space. - @param dist a distance in abstract space. - @result A distance in screen space. - */ -- (float)scaleToScreen:(float)dist; - -/*! - @brief Scale a rectangle from screen space to abstract space. - @param r a rectangle in screen space. - @result A rectangle in abstract space. - */ -- (NSRect)rectFromScreen:(NSRect)r; - -/*! - @brief Scale a rectangle from abstract space to screen space. - @param r a rectangle in abstract space. - @result A rectangle in screen space. - */ -- (NSRect)rectToScreen:(NSRect)r; - -/*! - @brief Factory method to get an identity transformer. - @result A transformer. - */ -+ (Transformer*)transformer; - -/*! - @brief Factory method to get a transformer identical to another - @result A transformer. - */ -+ (Transformer*)transformerWithTransformer:(Transformer*)t; - -/*! - @brief Factory method to get a transformer. - @param o The screen co-ordinate of the abstract space origin - @param scale The scale (from abstract space to screen space) - @result A transformer. - */ -+ (Transformer*)transformerWithOrigin:(NSPoint)o andScale:(float)scale; - -/*! - @brief Get a global 'actual size' transformer. - @result A transformer. - */ -+ (Transformer*)defaultTransformer; - -/*! - @brief A transformer set up from two bounding rects. - - graphRect is made as large as possible while still fitting into screenRect. - @result A transformer. - */ -+ (Transformer*)transformerToFit:(NSRect)graphRect intoScreenRect:(NSRect)screenRect flippedAboutXAxis:(BOOL)flipX flippedAboutYAxis:(BOOL)flipY; - -+ (Transformer*)transformerToFit:(NSRect)graphRect intoScreenRect:(NSRect)screenRect flippedAboutXAxis:(BOOL)flipX; -+ (Transformer*)transformerToFit:(NSRect)graphRect intoScreenRect:(NSRect)screenRect flippedAboutYAxis:(BOOL)flipY; -+ (Transformer*)transformerToFit:(NSRect)graphRect intoScreenRect:(NSRect)screenRect; - -@end - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/Transformer.m b/tikzit-old/src/common/Transformer.m deleted file mode 100644 index 2b56813..0000000 --- a/tikzit-old/src/common/Transformer.m +++ /dev/null @@ -1,231 +0,0 @@ -// -// Transformer.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Transformer.h" - -float const PIXELS_PER_UNIT = 50; - -@implementation Transformer - -+ (Transformer*)transformer { -#if __has_feature(objc_arc) - return [[Transformer alloc] init]; -#else - return [[[Transformer alloc] init] autorelease]; -#endif -} - -+ (Transformer*)transformerWithTransformer:(Transformer*)t { -#if __has_feature(objc_arc) - return [t copy]; -#else - return [[t copy] autorelease]; -#endif -} - -+ (Transformer*)transformerWithOrigin:(NSPoint)o andScale:(float)scale { - Transformer *trans = [self transformer]; - [trans setOrigin:o]; - [trans setScale:scale]; - return trans; -} - -+ (Transformer*)transformerToFit:(NSRect)graphRect - intoScreenRect:(NSRect)screenRect { - return [self transformerToFit:graphRect - intoScreenRect:screenRect - flippedAboutXAxis:NO - flippedAboutYAxis:NO]; -} - -+ (Transformer*)transformerToFit:(NSRect)graphRect - intoScreenRect:(NSRect)screenRect - flippedAboutXAxis:(BOOL)flipX { - return [self transformerToFit:graphRect - intoScreenRect:screenRect - flippedAboutXAxis:flipX - flippedAboutYAxis:NO]; -} - -+ (Transformer*)transformerToFit:(NSRect)graphRect - intoScreenRect:(NSRect)screenRect - flippedAboutYAxis:(BOOL)flipY { - return [self transformerToFit:graphRect - intoScreenRect:screenRect - flippedAboutXAxis:NO - flippedAboutYAxis:flipY]; -} - -+ (Transformer*)transformerToFit:(NSRect)graphRect - intoScreenRect:(NSRect)screenRect - flippedAboutXAxis:(BOOL)flipAboutXAxis - flippedAboutYAxis:(BOOL)flipAboutYAxis { - - const float wscale = screenRect.size.width / graphRect.size.width; - const float hscale = screenRect.size.height / graphRect.size.height; - const float scale = (wscale < hscale) ? wscale : hscale; - const float xpad = (screenRect.size.width - (graphRect.size.width * scale)) / 2.0; - const float ypad = (screenRect.size.height - (graphRect.size.height * scale)) / 2.0; - - // if we are flipping, we need to calculate the origin from the opposite edge - const float gx = flipAboutYAxis ? -(graphRect.size.width + graphRect.origin.x) - : graphRect.origin.x; - const float gy = flipAboutXAxis ? -(graphRect.size.height + graphRect.origin.y) - : graphRect.origin.y; - const float origin_x = screenRect.origin.x - (gx * scale) + xpad; - const float origin_y = screenRect.origin.y - (gy * scale) + ypad; - - Transformer *trans = [self transformer]; - [trans setOrigin:NSMakePoint(origin_x, origin_y)]; - [trans setScale:scale]; - [trans setFlippedAboutXAxis:flipAboutXAxis]; - [trans setFlippedAboutYAxis:flipAboutYAxis]; - return trans; -} - -- (id) init { - self = [super init]; - - if (self) { - origin = NSZeroPoint; - x_scale = 1.0f; - y_scale = 1.0f; - } - - return self; -} - -- (id)copyWithZone:(NSZone *)zone { - Transformer *cp = [[[self class] allocWithZone:zone] init]; - if (cp) { - cp->origin = origin; - cp->x_scale = x_scale; - cp->y_scale = y_scale; - } - return cp; -} - -- (NSPoint)origin { return origin; } -- (void)setOrigin:(NSPoint)o { - origin = o; -} - -- (float)scale { return ABS(x_scale); } -- (void)setScale:(float)s { - x_scale = (x_scale < 0.0) ? -s : s; - y_scale = (y_scale < 0.0) ? -s : s; -} - -- (BOOL)isFlippedAboutXAxis { - return y_scale < 0.0; -} - -- (void)setFlippedAboutXAxis:(BOOL)flip { - if (flip != [self isFlippedAboutXAxis]) { - y_scale *= -1; - } -} - -- (BOOL)isFlippedAboutYAxis { - return x_scale < 0.0; -} - -- (void)setFlippedAboutYAxis:(BOOL)flip { - if (flip != [self isFlippedAboutYAxis]) { - x_scale *= -1; - } -} - -- (NSPoint)fromScreen:(NSPoint)p { - NSPoint trans; - trans.x = (p.x - origin.x) / x_scale; - trans.y = (p.y - origin.y) / y_scale; - return trans; -} - -- (NSPoint)toScreen:(NSPoint)p { - NSPoint trans; - trans.x = (p.x * x_scale) + origin.x; - trans.y = (p.y * y_scale) + origin.y; - return trans; -} - -- (float)scaleFromScreen:(float)dist { - return dist / ABS(x_scale); -} - -- (float)scaleToScreen:(float)dist { - return dist * ABS(x_scale); -} - -- (NSRect)rectFromScreen:(NSRect)r { - NSRect r1; - r1.origin = [self fromScreen:r.origin]; - r1.size.width = [self scaleFromScreen:r.size.width]; - r1.size.height = [self scaleFromScreen:r.size.height]; - // if we're flipped, the origin will be at a different corner - if ([self isFlippedAboutYAxis]) { - r1.origin.x -= r1.size.width; - } - if ([self isFlippedAboutXAxis]) { - r1.origin.y -= r1.size.height; - } - return r1; -} - -- (NSRect)rectToScreen:(NSRect)r { - NSPoint o = r.origin; - // if we're flipped, the origin will be at a different corner - if ([self isFlippedAboutYAxis]) { - o.x = NSMaxX(r); - } - if ([self isFlippedAboutXAxis]) { - o.y = NSMaxY(r); - } - NSRect r1; - r1.origin = [self toScreen:o]; - r1.size.width = [self scaleToScreen:r.size.width]; - r1.size.height = [self scaleToScreen:r.size.height]; - return r1; -} - -- (BOOL)isEqual:(id)object { - Transformer *t = (Transformer*)object; - return ([t origin].x == [self origin].x && - [t origin].y == [self origin].y && - [t scale] == [self scale]); -} - -Transformer *defaultTransformer = nil; - -+ (Transformer*)defaultTransformer { - if (defaultTransformer == nil) { - defaultTransformer = [[Transformer alloc] init]; - [defaultTransformer setScale:PIXELS_PER_UNIT]; - } - return defaultTransformer; -} - -@end - -// vi:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/common/test/Makefile b/tikzit-old/src/common/test/Makefile deleted file mode 100644 index d158d16..0000000 --- a/tikzit-old/src/common/test/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -OBJC = gcc -MMD -MP -DSTAND_ALONE -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -O0 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fgnu-runtime -fconstant-string-class=NSConstantString -I. -I.. -I/users/alemer/GNUstep/Library/Headers -std=c99 -D_GNU_SOURCE -rdynamic -fgnu-runtime -L/users/alemer/GNUstep/Library/Libraries -L/usr/local/lib64 -L/usr/lib64 -lgnustep-base -lpthread -lobjc -lm - -maths_test_objects = test.m maths.m ../util.m -color_test_objects = test.m color.m ../ColorRGB.m ../util.m ../BasicMapTable.m ../RColor.m - -test: maths-test color-test - ./maths-test - ./color-test - -maths-test: $(maths_test_objects) - $(OBJC) $(maths_test_objects) -o $@ - -color-test: $(color_test_objects) - $(OBJC) $(color_test_objects) -o $@ diff --git a/tikzit-old/src/common/test/color.m b/tikzit-old/src/common/test/color.m deleted file mode 100644 index 48a6ff4..0000000 --- a/tikzit-old/src/common/test/color.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// color.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" -#import "ColorRGB.h" - -#ifdef STAND_ALONE -void runTests() { -#else -void testColor() { -#endif - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"color"); - - ColorRGB *red = [ColorRGB colorWithRed:255 green:0 blue:0]; - ColorRGB *lime = [ColorRGB colorWithRed:0 green:255 blue:0]; - ColorRGB *green = [ColorRGB colorWithRed:0 green:128 blue:0]; - TEST(@"Recognised red", - [red name] != nil && - [[red name] isEqualToString:@"Red"]); - TEST(@"Recognised lime", - [lime name] != nil && - [[lime name] isEqualToString:@"Lime"]); - TEST(@"Recognised green", - [green name] != nil && - [[green name] isEqualToString:@"Green"]); - - ColorRGB *floatRed = [ColorRGB colorWithFloatRed:1.0f green:0.0f blue:0.0f]; - ColorRGB *floatLime = [ColorRGB colorWithFloatRed:0.0f green:1.0f blue:0.0f]; - ColorRGB *floatGreen = [ColorRGB colorWithFloatRed:0.0f green:0.5f blue:0.0f]; - - TEST(@"Float red equal to int red", [floatRed isEqual:red]); - TEST(@"Float lime equal to int lime", [floatLime isEqual:lime]); - TEST(@"Float green equal to int green", [floatGreen isEqual:green]); - - TEST(@"Recognised float red", - [floatRed name] != nil && - [[floatRed name] isEqualToString:@"Red"]); - - TEST(@"Recognised float lime", - [floatLime name] != nil && - [[floatLime name] isEqualToString:@"Lime"]); - - TEST(@"Recognised float green", - [floatGreen name] != nil && - [[floatGreen name] isEqualToString:@"Green"]); - - [floatRed setRedFloat:0.99f]; - TEST(@"Nudged red, not recognised now", [floatRed name] == nil); - [floatRed setToClosestHashed]; - TEST(@"Set to closest hashed, reconised again", - [floatRed name] != nil && - [[floatRed name] isEqualToString:@"Red"]); - - TEST(@"Red has correct hex (ff0000)", [[red hexName] isEqualToString:@"hexcolor0xff0000"]); - TEST(@"Lime has correct hex (00ff00)", [[lime hexName] isEqualToString:@"hexcolor0x00ff00"]); - TEST(@"Green has correct hex (008000)", [[green hexName] isEqualToString:@"hexcolor0x008000"]); - - endTestBlock(@"color"); - [pool drain]; -} diff --git a/tikzit-old/src/common/test/common.m b/tikzit-old/src/common/test/common.m deleted file mode 100644 index c9ac980..0000000 --- a/tikzit-old/src/common/test/common.m +++ /dev/null @@ -1,34 +0,0 @@ -// -// common.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" -void testParser(); -void testColor(); -void testMaths(); - -void testCommon() { - startTestBlock(@"common"); - testParser(); - testColor(); - testMaths(); - endTestBlock(@"common"); -} diff --git a/tikzit-old/src/common/test/maths.m b/tikzit-old/src/common/test/maths.m deleted file mode 100644 index a11e58e..0000000 --- a/tikzit-old/src/common/test/maths.m +++ /dev/null @@ -1,562 +0,0 @@ -// -// TikZiT -// -// Copyright 2011 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "../util.h" - -#import "test.h" - -void testRectAroundPoints() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"NSRectAroundPoints"); - - NSRect rect = NSRectAroundPoints (NSZeroPoint, NSZeroPoint); - assertRectsEqual (@"(0,0) and (0,0)", rect, NSZeroRect); - - rect = NSRectAroundPoints (NSZeroPoint, NSMakePoint (1.0f, 1.0f)); - assertRectsEqual (@"(0,0) and (1,1)", rect, NSMakeRect (0.0f, 0.0f, 1.0f, 1.0f)); - - rect = NSRectAroundPoints (NSMakePoint (-1.0f, 1.0f), NSMakePoint (1.0f, -1.0f)); - assertRectsEqual (@"(-1,1) and (1,-1)", rect, NSMakeRect (-1.0f, -1.0f, 2.0f, 2.0f)); - - endTestBlock(@"NSRectAroundPoints"); - [pool drain]; -} - -void testRectAroundPointsWithPadding() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"NSRectAroundPointsWithPadding"); - - NSRect rect = NSRectAroundPointsWithPadding (NSZeroPoint, NSZeroPoint, 0.0f); - assertRectsEqual (@"(0,0) and (0,0); 0 padding", rect, NSZeroRect); - - rect = NSRectAroundPointsWithPadding (NSZeroPoint, NSZeroPoint, 0.2f); - assertRectsEqual (@"(0,0) and (0,0); 0.2 padding", rect, NSMakeRect (-0.2f, -0.2f, 0.4f, 0.4f)); - - rect = NSRectAroundPointsWithPadding (NSZeroPoint, NSMakePoint (1.0f, 1.0f), -0.2f); - assertRectsEqual (@"(0,0) and (1,1); -0.2 padding", rect, NSMakeRect (0.2f, 0.2f, 0.6f, 0.6f)); - - endTestBlock(@"NSRectAroundPointsWithPadding"); - [pool drain]; -} - -void testGoodAtan() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"good_atan"); - - assertFloatsEqual (@"0.0, 0.0", good_atan (0.0f, 0.0f), 0.0f); - assertFloatsEqual (@"0.0, 1.0", good_atan (0.0f, 1.0f), 0.5f * M_PI); - assertFloatsEqual (@"0.0, -1.0", good_atan (0.0f, -1.0f), 1.5f * M_PI); - assertFloatsEqual (@"1.0, 0.0", good_atan (1.0f, 0.0f), 0.0f); - assertFloatsEqual (@"1.0, 0.1", good_atan (1.0f, 0.1f), 0.0996687f); - - endTestBlock(@"good_atan"); - [pool drain]; -} - -void testBezierInterpolate() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"bezierInterpolate"); - - assertFloatsEqual (@"0.0, (0.0, 0.1, 0.2, 0.3)", bezierInterpolate (0.0f, 0.0f, 0.1f, 0.2f, 0.3f), 0.0f); - assertFloatsEqual (@"1.0, (0.0, 0.1, 0.2, 0.3)", bezierInterpolate (1.0f, 0.0f, 0.1f, 0.2f, 0.3f), 0.3f); - assertFloatsEqual (@"0.5, (0.0, 0.1, 0.2, 0.3)", bezierInterpolate (0.5f, 0.0f, 0.1f, 0.2f, 0.3f), 0.15f); - // FIXME: other tests - - endTestBlock(@"bezierInterpolate"); - [pool drain]; -} - -void testLineSegmentsIntersect() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"lineSegmentsIntersect"); - - BOOL result = NO; - NSPoint intersection = NSMakePoint (-1.0f, -1.0f); - - result = lineSegmentsIntersect (NSMakePoint (-1.0f, -1.0f), NSMakePoint (1.0f, 1.0f), - NSMakePoint (-1.0f, 1.0f), NSMakePoint (1.0f, -1.0f), - &intersection); - TEST (@"Cross at zero: has intersection", result); - assertPointsEqual (@"Cross at zero: intersection value", intersection, NSZeroPoint); - - result = lineSegmentsIntersect (NSMakePoint (-1.0f, -1.0f), NSMakePoint (-0.5f, -0.5f), - NSMakePoint (-1.0f, 1.0f), NSMakePoint (1.0f, -1.0f), - &intersection); - TEST (@"Fail to cross at zero", !result); - - result = lineSegmentsIntersect (NSMakePoint (1.0f, 1.0f), NSMakePoint (1.0f, -1.0f), - NSMakePoint (0.0f, 0.0f), NSMakePoint (1.0f, 0.0f), - &intersection); - TEST (@"Touch at one: has intersection", result); - assertPointsEqual (@"Touch at one: intersection value", intersection, NSMakePoint (1.0f, 0.0f)); - - endTestBlock(@"lineSegmentsIntersect"); - [pool drain]; -} - -void testLineSegmentIntersectsRect() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"lineSegmentIntersectsRect"); - - BOOL result = NO; - - result = lineSegmentIntersectsRect ( - NSMakePoint (-1.0f, -1.0f), - NSMakePoint (0.0f, 0.0f), - NSZeroRect); - TEST (@"Zero rect; line touches zero", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (-1.0f, -1.0f), - NSMakePoint (-0.1f, -0.1f), - NSZeroRect); - TEST (@"Zero rect; line short of zero", !result); - - NSRect rect = NSMakeRect (1.0f, 1.0f, 1.0f, 1.0f); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 0.0f), - NSMakePoint (3.0f, 1.0f), - rect); - TEST (@"Line underneath", !result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 0.0f), - NSMakePoint (1.0f, 3.0f), - rect); - TEST (@"Line to left", !result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 2.0f), - NSMakePoint (3.0f, 3.0f), - rect); - TEST (@"Line above", !result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (2.0f, 0.0f), - NSMakePoint (3.0f, 3.0f), - rect); - TEST (@"Line to right", !result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 0.0f), - NSMakePoint (0.9f, 0.9f), - rect); - TEST (@"Line short", !result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (1.1f, 1.1f), - NSMakePoint (1.9f, 1.9f), - rect); - TEST (@"Line inside", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 1.5f), - NSMakePoint (3.0f, 1.5f), - rect); - TEST (@"Horizontal line through", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (1.5f, 0.0f), - NSMakePoint (1.5f, 3.0f), - rect); - TEST (@"Vertical line through", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.5f, 1.0f), - NSMakePoint (2.0f, 2.5f), - rect); - TEST (@"Cut top and left", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (2.0f, 0.5f), - NSMakePoint (0.5f, 2.0f), - rect); - TEST (@"Cut bottom and left", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (1.0f, 0.5f), - NSMakePoint (2.5f, 2.0f), - rect); - TEST (@"Cut bottom and right", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 1.0f), - NSMakePoint (2.0f, 3.0f), - rect); - TEST (@"Touch top left", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (1.0f, 0.0f), - NSMakePoint (3.0f, 2.0f), - rect); - TEST (@"Touch bottom right", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (1.0f, 0.0f), - NSMakePoint (1.0f, 3.0f), - rect); - TEST (@"Along left side", result); - - result = lineSegmentIntersectsRect ( - NSMakePoint (0.0f, 1.0f), - NSMakePoint (3.0f, 1.0f), - rect); - TEST (@"Along bottom side", result); - - endTestBlock(@"lineSegmentIntersectsRect"); - [pool drain]; -} - -struct line_bezier_test { - NSString *msg; - NSPoint lstart; - NSPoint lend; - NSPoint c0; - NSPoint c1; - NSPoint c2; - NSPoint c3; - BOOL expectedResult; - float expectedT; - NSPoint expectedIntersect; -}; - -static struct line_bezier_test line_bezier_tests[] = { - { - @"Outside box", - {0.0f, 0.0f}, - {1.0f, 0.0f}, - {0.0f, 1.0f}, - {0.0f, 2.0f}, - {1.0f, 2.0f}, - {1.0f, 1.0f}, - NO, - -1.0f, - {0.0f, 0.0f} - }, - { - @"Single intersect", - {100.0f, 20.0f}, - {195.0f, 255.0f}, - {93.0f, 163.0f}, - {40.0f, 30.0f}, - {270.0f, 115.0f}, - {219.0f, 178.0f}, - YES, - -0.4f, - {129.391693f, 92.705772f} - }, - { - @"Double intersect", - {100.0f, 20.0f}, - {195.0f, 255.0f}, - {93.0f, 163.0f}, - {40.0f, 30.0f}, - {270.0f, 115.0f}, - {154.0f, 212.0f}, - YES, - -0.909f, - {170.740646f,194.990021f} - }, - { - @"Near miss", - {100.0f, 20.0f}, - {195.0f, 255.0f}, - {93.0f, 163.0f}, - {40.0f, 30.0f}, - {176.0f, 100.0f}, - {154.0f, 212.0f}, - NO, - -1.0f, - {0.0f,0.0f} - } -}; -static unsigned int n_line_bezier_tests = sizeof (line_bezier_tests) / sizeof (line_bezier_tests[0]); - -void testLineSegmentIntersectsBezier() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"lineSegmentIntersectsBezier"); - - for (unsigned int i = 0; i < n_line_bezier_tests; ++i) { - NSPoint intersect; - BOOL result = lineSegmentIntersectsBezier ( - line_bezier_tests[i].lstart, - line_bezier_tests[i].lend, - line_bezier_tests[i].c0, - line_bezier_tests[i].c1, - line_bezier_tests[i].c2, - line_bezier_tests[i].c3, - &intersect); - if (result) { - if (line_bezier_tests[i].expectedT < 0.0f) { - assertPointsEqual (line_bezier_tests[i].msg, intersect, line_bezier_tests[i].expectedIntersect); - } else { - assertPointsEqual (line_bezier_tests[i].msg, intersect, - bezierInterpolateFull (line_bezier_tests[i].expectedT, line_bezier_tests[i].c0, line_bezier_tests[i].c1, line_bezier_tests[i].c2, line_bezier_tests[i].c3)); - } - } else { - if (line_bezier_tests[i].expectedResult) - fail (line_bezier_tests[i].msg); - else - pass (line_bezier_tests[i].msg); - } - } - -BOOL lineSegmentIntersectsBezier (NSPoint lstart, NSPoint lend, NSPoint c0, NSPoint c1, NSPoint c2, NSPoint c3, NSPoint *result); - endTestBlock(@"lineSegmentIntersectsBezier"); - [pool drain]; -} - -struct exit_point_test { - NSString *msg; - NSPoint rayStart; - float angle; - NSRect rect; - NSPoint expected; -}; - -static struct exit_point_test exit_point_tests[] = { - { - @"0.0 rads", - {0.0f, 0.0f}, - 0.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {1.0f, 0.0f} - }, - { - @"pi/2 rads", - {0.0f, 0.0f}, - M_PI / 2.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {0.0f, 1.0f} - }, - { - @"-pi/2 rads", - {0.0f, 0.0f}, - -M_PI / 2.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {0.0f, -1.0f} - }, - { - @"pi rads", - {0.0f, 0.0f}, - M_PI, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {-1.0f, 0.0f} - }, - { - @"-pi rads", - {0.0f, 0.0f}, - -M_PI, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {-1.0f, 0.0f} - }, - { - @"pi/4 rads", - {0.0f, 0.0f}, - M_PI / 4.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {1.0f, 1.0f} - }, - { - @"3pi/4 rads", - {0.0f, 0.0f}, - (3.0f * M_PI) / 4.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {-1.0f, 1.0f} - }, - { - @"-pi/4 rads", - {0.0f, 0.0f}, - -M_PI / 4.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {1.0f, -1.0f} - }, - { - @"-3pi/4 rads", - {0.0f, 0.0f}, - (-3.0f * M_PI) / 4.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {-1.0f, -1.0f} - }, - { - @"pi/8 rads", - {0.0f, 0.0f}, - M_PI / 8.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {1.0f, 0.414213562373095f} - }, - { - @"3pi/8 rads", - {0.0f, 0.0f}, - 3.0f * M_PI / 8.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {0.414213562373095f, 1.0f} - }, - { - @"-5pi/8 rads", - {0.0f, 0.0f}, - -5.0f * M_PI / 8.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {-0.414213562373095f, -1.0f} - }, - { - @"-7pi/8 rads", - {0.0f, 0.0f}, - -7.0f * M_PI / 8.0f, - {{-1.0f, -1.0f}, {2.0f, 2.0f}}, - {-1.0f, -0.414213562373095f} - }, - { - @"pi/8 rads; origin (1,1)", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{0.0f, 0.0f}, {2.0f, 2.0f}}, - {2.0f, 1.414213562373095f} - }, - { - @"7pi/8 rads; origin (-2,2)", - {-2.0f, 2.0f}, - 7.0f * M_PI / 8.0f, - {{-3.0f, 1.0f}, {2.0f, 2.0f}}, - {-3.0f, 2.414213562373095f} - }, - { - @"pi/8 rads; origin (1,1); SW of box", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{1.0f, 1.0f}, {1.0f, 1.0f}}, - {2.0f, 1.414213562373095f} - }, - { - @"pi/8 rads; origin (1,1); SE of box", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{0.0f, 1.0f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"pi/8 rads; origin (1,1); NE of box", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{0.0f, 1.0f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"pi/8 rads; origin (1,1); NW of box", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{1.0f, 0.0f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"pi/8 rads; origin (1,1); N of box", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{0.5f, 0.0f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"7pi/8 rads; origin (1,1); N of box", - {1.0f, 1.0f}, - 7.0f * M_PI / 8.0f, - {{0.5f, 0.0f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"-pi/8 rads; origin (1,1); S of box", - {1.0f, 1.0f}, - -M_PI / 8.0f, - {{0.5f, 1.0f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"-pi/8 rads; origin (1,1); E of box", - {1.0f, 1.0f}, - -M_PI / 8.0f, - {{0.0f, 0.5f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"-7pi/8 rads; origin (1,1); W of box", - {1.0f, 1.0f}, - -7.0f * M_PI / 8.0f, - {{1.0f, 0.5f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"7pi/8 rads; origin (1,1); W of box", - {1.0f, 1.0f}, - 7.0f * M_PI / 8.0f, - {{1.0f, 0.5f}, {1.0f, 1.0f}}, - {1.0f, 1.0f} - }, - { - @"pi/8 rads; origin (1,1); leave through top", - {1.0f, 1.0f}, - M_PI / 8.0f, - {{0.9f, 0.1f}, {1.0f, 1.0f}}, - {1.2414213562373f, 1.1f} - }, - { - @"0 rads; origin (1,1); N of box", - {1.0f, 1.0f}, - 0.0f, - {{0.5f, 0.0f}, {1.0f, 1.0f}}, - {1.5f, 1.0f} - } -}; -static unsigned int n_exit_point_tests = sizeof (exit_point_tests) / sizeof (exit_point_tests[0]); - -void testFindExitPointOfRay() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"findExitPointOfRay"); - - for (unsigned int i = 0; i < n_exit_point_tests; ++i) { - NSPoint exitPoint = findExitPointOfRay ( - exit_point_tests[i].rayStart, - exit_point_tests[i].angle, - exit_point_tests[i].rect); - assertPointsEqual (exit_point_tests[i].msg, exitPoint, exit_point_tests[i].expected); - } - - endTestBlock(@"findExitPointOfRay"); - [pool drain]; -} - -#ifdef STAND_ALONE -void runTests() { -#else -void testMaths() { -#endif - startTestBlock(@"maths"); - testRectAroundPoints(); - testRectAroundPointsWithPadding(); - testGoodAtan(); - testBezierInterpolate(); - testLineSegmentsIntersect(); - testLineSegmentIntersectsRect(); - testFindExitPointOfRay(); - testLineSegmentIntersectsBezier(); - endTestBlock(@"maths"); -} - -// vim:ft=objc:ts=4:sts=4:sw=4:noet diff --git a/tikzit-old/src/common/test/parser.m b/tikzit-old/src/common/test/parser.m deleted file mode 100644 index 3346acd..0000000 --- a/tikzit-old/src/common/test/parser.m +++ /dev/null @@ -1,86 +0,0 @@ -// -// parser.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" -#import "TikzGraphAssembler.h" - - -#ifdef STAND_ALONE -void runTests() { -#else -void testParser() { -#endif - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - startTestBlock(@"parser"); - - [TikzGraphAssembler setup]; - - NodeStyle *rn = [NodeStyle defaultNodeStyleWithName:@"rn"]; - NSArray *styles = [NSArray arrayWithObject:rn]; - - NSString *tikz = - @"\\begin{tikzpicture}[dotpic]" - @" \\begin{pgfonlayer}{foo}" //ignored - @" \\node [style=rn] (0) at (-2,3.4) {stuff{$\\alpha$ in here}};" - @" \\node (b) at (1,1) {};" - @" \\end{pgfonlayer}" //ignored - @" \\draw [bend right=20] (0) to node[tick]{-} (b.center);" - @"\\end{tikzpicture}"; - - TikzGraphAssembler *ga = [[TikzGraphAssembler alloc] init]; - TEST(@"Parsing TikZ", [ga parseTikz:tikz]); - - Graph *g = [ga graph]; - TEST(@"Graph is non-nil", g != nil); - TEST(@"Graph has correct number of nodes", [[g nodes] count]==2); - TEST(@"Graph has correct number of edges", [[g edges] count]==1); - - NSEnumerator *en = [[g nodes] objectEnumerator]; - Node *n; - Node *n1, *n2; - while ((n=[en nextObject])) { - [n attachStyleFromTable:styles]; - if ([n style] == rn) n1 = n; - else if ([n style] == nil) n2 = n; - } - - TEST(@"Styles attached correctly", n1!=nil && n2!=nil); - - TEST(@"Nodes labeled correctly", - [[n1 label] isEqualToString:@"stuff{$\\alpha$ in here}"] && - [[n2 label] isEqualToString:@""] - ); - - Edge *e1 = [[[g edges] objectEnumerator] nextObject]; - - TEST(@"Edge has edge node", [e1 edgeNode]!=nil); - TEST(@"Edge node labeled correctly", [[[e1 edgeNode] label] isEqualToString:@"-"]); -// NSString *sty = [[[[[e1 edgeNode] data] atoms] objectEnumerator] nextObject]; -// TEST(@"Edge node styled correctly", sty!=nil && [sty isEqualToString:@"tick"]); - - PUTS(@"Source anchor: %@",[e1 sourceAnchor]); - PUTS(@"Target anchor: %@",[e1 targetAnchor]); - - endTestBlock(@"parser"); - - [pool drain]; -} diff --git a/tikzit-old/src/common/test/test.h b/tikzit-old/src/common/test/test.h deleted file mode 100644 index 59dcdd4..0000000 --- a/tikzit-old/src/common/test/test.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// test.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import - -@interface Allocator : NSObject -{} -@end - -BOOL fuzzyCompare (float f1, float f2); -BOOL fuzzyComparePoints (NSPoint p1, NSPoint p2); - -void setColorEnabled(BOOL b); - -void pass(NSString *msg); -void fail(NSString *msg); -void TEST(NSString *msg, BOOL test); -void assertRectsEqual (NSString *msg, NSRect val, NSRect exp); -void assertPointsEqual (NSString *msg, NSPoint val, NSPoint exp); -void assertFloatsEqual (NSString *msg, float val, float exp); - -void startTests(); -void endTests(); - -void startTestBlock(NSString *name); -void endTestBlock(NSString *name); - -#define PUTS(fmt, ...) { \ - NSString *_str = [[NSString alloc] initWithFormat:fmt, ##__VA_ARGS__]; \ - printf("%s\n", [_str UTF8String]); \ - [_str release]; } - -#define failFmt(fmt, ...) { \ - NSString *_fstr = [[NSString alloc] initWithFormat:fmt, ##__VA_ARGS__]; \ - fail(_fstr); \ - [_fstr release]; } - -// vim:ft=objc:ts=4:sts=4:sw=4:noet diff --git a/tikzit-old/src/common/test/test.m b/tikzit-old/src/common/test/test.m deleted file mode 100644 index 9afcd67..0000000 --- a/tikzit-old/src/common/test/test.m +++ /dev/null @@ -1,175 +0,0 @@ -// -// test.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" - -static int PASSES; -static int FAILS; - -static int ALLOC_INSTANCES = 0; - -static BOOL colorEnabled = YES; -static int depth = 0; - -static NSString *RED, *GREEN, *BLUE, *OFF; - -static NSString *indents[6] = - {@"", @" ", @" ", @" ", - @" ", @" "}; - -#define INDENT ((depth >= 6) ? indents[5] : indents[depth]) - - -@implementation Allocator - -+ (id)alloc { - ++ALLOC_INSTANCES; - return [super alloc]; -} - -- (void)dealloc { - --ALLOC_INSTANCES; - [super dealloc]; -} - -+ (Allocator*)allocator { - return [[[Allocator alloc] init] autorelease]; -} - -@end - -BOOL fuzzyCompare(float f1, float f2) { - return (ABS(f1 - f2) <= 0.00001f * MAX(1.0f,MIN(ABS(f1), ABS(f2)))); -} - -BOOL fuzzyComparePoints (NSPoint p1, NSPoint p2) { - return fuzzyCompare (p1.x, p2.x) && fuzzyCompare (p1.y, p2.y); -} - -void pass(NSString *msg) { - PUTS(@"%@[%@PASS%@] %@", INDENT, GREEN, OFF, msg); - ++PASSES; -} - -void fail(NSString *msg) { - PUTS(@"%@[%@FAIL%@] %@", INDENT, RED, OFF, msg); - ++FAILS; -} - -void TEST(NSString *msg, BOOL test) { - if (test) { - pass (msg); - } else { - fail (msg); - } -} - -void assertRectsEqual (NSString *msg, NSRect r1, NSRect r2) { - BOOL equal = fuzzyCompare (r1.origin.x, r2.origin.x) && - fuzzyCompare (r1.origin.y, r2.origin.y) && - fuzzyCompare (r1.size.width, r2.size.width) && - fuzzyCompare (r1.size.height, r2.size.height); - if (equal) { - pass (msg); - } else { - failFmt(@"%@ (expected (%f,%f:%fx%f) but got (%f,%f:%fx%f))", - msg, - r2.origin.x, r2.origin.y, r2.size.width, r2.size.height, - r1.origin.x, r1.origin.y, r1.size.width, r1.size.height); - } -} - -void assertPointsEqual (NSString *msg, NSPoint p1, NSPoint p2) { - BOOL equal = fuzzyCompare (p1.x, p2.x) && fuzzyCompare (p1.y, p2.y); - if (equal) { - pass (msg); - } else { - failFmt(@"%@ (expected (%f,%f) but got (%f,%f)", - msg, - p2.x, p2.y, - p1.x, p1.y); - } -} - -void assertFloatsEqual (NSString *msg, float f1, float f2) { - if (fuzzyCompare (f1, f2)) { - pass (msg); - } else { - failFmt(@"%@ (expected %f but got %f", msg, f2, f1); - } -} - -void startTests() { - PASSES = 0; - FAILS = 0; -} - -void endTests() { - PUTS(@"Done testing. %@%d%@ passed, %@%d%@ failed.", - GREEN, PASSES, OFF, - RED, FAILS, OFF); -} - -void startTestBlock(NSString *name) { - PUTS(@"%@Starting %@%@%@ tests.", INDENT, BLUE, name, OFF); - ++depth; -} - -void endTestBlock(NSString *name) { - --depth; - PUTS(@"%@Done with %@%@%@ tests.", INDENT, BLUE, name, OFF); -} - -void setColorEnabled(BOOL b) { - colorEnabled = b; - if (b) { - RED = @"\033[31;1m"; - GREEN = @"\033[32;1m"; - BLUE = @"\033[36;1m"; - OFF = @"\033[0m"; - } else { - RED = @""; - GREEN = @""; - BLUE = @""; - OFF = @""; - } -} - -#ifdef STAND_ALONE -void runTests(); - -int main() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - setColorEnabled (NO); - startTests(); - - runTests(); - - endTests(); - - [pool drain]; - return 0; -} -#endif - -// vim:ft=objc:ts=4:sts=4:sw=4:noet diff --git a/tikzit-old/src/common/tikzlexer.lm b/tikzit-old/src/common/tikzlexer.lm deleted file mode 100644 index 1e92f73..0000000 --- a/tikzit-old/src/common/tikzlexer.lm +++ /dev/null @@ -1,170 +0,0 @@ -%{ -/* - * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger - * Copyright 2013 K. Johan Paulsson - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "tikzparserdefs.h" -#import "tikzparser.h" - -#define YY_USER_ACTION \ - yylloc->first_line = yylloc->last_line; \ - yylloc->first_column = yylloc->last_column + 1; \ - yylloc->last_column = yylloc->first_column + yyleng - 1; - -%} - -%option reentrant bison-bridge bison-locations 8bit -%option nounput -%option yylineno -%option noyywrap -%option header-file="common/tikzlexer.h" -%option extra-type="TikzGraphAssembler *" - - -%s props -%s xcoord -%s ycoord -%s noderef - -FLOAT \-?[0-9]*(\.[0-9]+)? - -%% - - /* whitespace is ignored, except for position counting; we don't - count formfeed and vtab as whitespace, because it's not obvious - how they should be dealt with and no-one actually uses them */ - - /* lex will take the longest-matching string */ -\r\n|\r|\n { - yylloc->first_line += 1; - yylloc->last_line = yylloc->first_line; - yylloc->first_column = yylloc->last_column = 0; -} -[\t ]+ { } - -\\begin\{tikzpicture\} { return BEGIN_TIKZPICTURE_CMD; } -\\end\{tikzpicture\} { return END_TIKZPICTURE_CMD; } -\\begin\{pgfonlayer\} { return BEGIN_PGFONLAYER_CMD; } -\\end\{pgfonlayer\} { return END_PGFONLAYER_CMD; } -\\draw { return DRAW_CMD; } -\\node { return NODE_CMD; } -\\path { return PATH_CMD; } -rectangle { return RECTANGLE; } -node { return NODE; } -at { return AT; } -to { return TO; } -; { return SEMICOLON; } - -\([ ]*{FLOAT}[ ]*,[ ]*{FLOAT}[ ]*\) { - yylloc->last_column = yylloc->first_column + 1; - yyless(1); - BEGIN(xcoord); -} -{FLOAT} { - yylval->pt.x=(float)strtod(yytext,NULL); - BEGIN(ycoord); -} -, { } -{FLOAT} { - yylval->pt.y=(float)strtod(yytext,NULL); -} -\) { - BEGIN(INITIAL); - return COORD; -} - - /* when we see "[", change parsing mode */ -\[ /*syntaxhlfix]*/ { - BEGIN(props); - return LEFTBRACKET; -} -= { return EQUALS; } -, { return COMMA; } - /* technically, it is possible to have newlines in the middle of - property names or values, but in practice this is unlikely and - screws up our line counting */ -[^=,\{\] \t\n]([^=,\{\]\n]*[^=,\{\] \t\n])? { - yylval->nsstr=[NSString stringWithUTF8String:yytext]; - return PROPSTRING; -} -\] { - BEGIN(INITIAL); - return RIGHTBRACKET; -} - -\( { - BEGIN(noderef); - return LEFTPARENTHESIS; -} -\. { - return FULLSTOP; -} - /* we assume node names (and anchor names) never contain - newlines */ -[^\.\{\)\n]+ { - yylval->nsstr=[NSString stringWithUTF8String:yytext]; - return REFSTRING; -} -\) { - BEGIN(INITIAL); - return RIGHTPARENTHESIS; -} - -\{ { - NSMutableString *buf = [NSMutableString string]; - unsigned int brace_depth = 1; - unsigned int escape = 0; - while (1) { - char c = input(yyscanner); - // eof reached before closing brace - if (c == '\0' || c == EOF) { - return UNCLOSED_DELIM_STR; - } - - yylloc->last_column += 1; - yyleng += 1; - if (escape) { - escape = 0; - } else if (c == '\\') { - escape = 1; - } else if (c == '{') { - brace_depth++; - } else if (c == '}') { - brace_depth--; - if (brace_depth == 0) break; - } else if (c == '\n') { - yylloc->last_line += 1; - yylloc->last_column = 0; - } - [buf appendFormat:@"%c", c]; - } - - yylval->nsstr = buf; - return DELIMITEDSTRING; -} - -\\begin { return UNKNOWN_BEGIN_CMD; } -\\end { return UNKNOWN_END_CMD; } -\\[a-zA-Z0-9]+ { return UNKNOWN_CMD; } -[a-zA-Z0-9]+ { return UNKNOWN_STR; } -. { return UNKNOWN_STR; } - - /* vi:ft=lex:noet:ts=4:sts=4:sw=4: - */ diff --git a/tikzit-old/src/common/tikzparser.ym b/tikzit-old/src/common/tikzparser.ym deleted file mode 100644 index 344e969..0000000 --- a/tikzit-old/src/common/tikzparser.ym +++ /dev/null @@ -1,224 +0,0 @@ -%{ -/* - * Copyright 2010 Chris Heunen - * Copyright 2010-2013 Aleks Kissinger - * Copyright 2013 K. Johan Paulsson - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "tikzparserdefs.h" -%} - -/* we use features added to bison 2.4 */ -%require "2.3" - -%error-verbose -/* enable maintaining locations for better error messages */ -%locations -/* the name of the header file */ -/*%defines "common/tikzparser.h"*/ -/* make it re-entrant (no global variables) */ -%pure-parser -/* We use a pure (re-entrant) lexer. This means yylex - will take a void* (opaque) type to maintain its state */ -%lex-param {void *scanner} -/* Since this parser is also pure, yyparse needs to take - that lexer state as an argument */ -%parse-param {void *scanner} - -/* possible data types for semantic values */ -%union { - NSString *nsstr; - GraphElementProperty *prop; - GraphElementData *data; - Node *node; - NSPoint pt; - struct noderef noderef; -} - -%{ -#import "GraphElementData.h" -#import "GraphElementProperty.h" -#import "Node.h" -#import "Edge.h" - -#import "tikzlexer.h" -#import "TikzGraphAssembler+Parser.h" -/* the assembler (used by this parser) is stored in the lexer - state as "extra" data */ -#define assembler yyget_extra(scanner) - -/* pass errors off to the assembler */ -void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { - [assembler reportError:str atLocation:yylloc]; -} -%} - -/* yyloc is set up with first_column = last_column = 1 by default; - however, it makes more sense to think of us being "before the - start of the line" before we parse anything */ -%initial-action { - yylloc.first_column = yylloc.last_column = 0; -} - - -%token BEGIN_TIKZPICTURE_CMD "\\begin{tikzpicture}" -%token END_TIKZPICTURE_CMD "\\end{tikzpicture}" -%token BEGIN_PGFONLAYER_CMD "\\begin{pgfonlayer}" -%token END_PGFONLAYER_CMD "\\end{pgfonlayer}" -%token DRAW_CMD "\\draw" -%token NODE_CMD "\\node" -%token PATH_CMD "\\path" -%token RECTANGLE "rectangle" -%token NODE "node" -%token AT "at" -%token TO "to" -%token SEMICOLON ";" -%token COMMA "," - -%token LEFTPARENTHESIS "(" -%token RIGHTPARENTHESIS ")" -%token LEFTBRACKET "[" -%token RIGHTBRACKET "]" -%token FULLSTOP "." -%token EQUALS "=" -%token COORD "co-ordinate" -%token PROPSTRING "key/value string" -%token REFSTRING "string" -%token DELIMITEDSTRING "{-delimited string" - -%token UNKNOWN_BEGIN_CMD "unknown \\begin command" -%token UNKNOWN_END_CMD "unknown \\end command" -%token UNKNOWN_CMD "unknown latex command" -%token UNKNOWN_STR "unknown string" -%token UNCLOSED_DELIM_STR "unclosed {-delimited string" - -%type nodename -%type optanchor -%type val -%type property -%type extraproperties -%type properties -%type optproperties -%type optedgenode -%type noderef -%type optnoderef - -%% - -tikzpicture: "\\begin{tikzpicture}" optproperties tikzcmds "\\end{tikzpicture}" - { - if ($2) { - [[assembler graph] setData:$2]; - } - }; -tikzcmds: tikzcmds tikzcmd | ; -tikzcmd: node | edge | boundingbox | ignore; - -ignore: "\\begin{pgfonlayer}" DELIMITEDSTRING | "\\end{pgfonlayer}"; - -optproperties: - "[" "]" - { $$ = nil; } - | "[" properties "]" - { $$ = $2; } - | { $$ = nil; }; -properties: extraproperties property - { - [$1 addObject:$2]; - $$ = $1; - }; -extraproperties: - extraproperties property "," - { - [$1 addObject:$2]; - $$ = $1; - } - | { $$ = [GraphElementData data]; }; -property: - val "=" val - { $$ = [GraphElementProperty property:$1 withValue:$3]; } - | val - { $$ = [GraphElementProperty atom:$1]; }; -val: PROPSTRING { $$ = $1; } | DELIMITEDSTRING { $$ = $1; }; - -nodename: "(" REFSTRING ")" { $$ = $2; }; -node: "\\node" optproperties nodename "at" COORD DELIMITEDSTRING ";" - { - Node *node = [[Node alloc] init]; - if ($2) - [node setData:$2]; - [node setName:$3]; - [node setPoint:$5]; - [node setLabel:$6]; - [assembler addNodeToMap:node]; - [[assembler graph] addNode:node]; -#if ! __has_feature(objc_arc) - [node release]; -#endif - }; - -optanchor: { $$ = nil; } | "." REFSTRING { $$ = $2; }; -noderef: "(" REFSTRING optanchor ")" - { - $$.node = [assembler nodeWithName:$2]; - $$.anchor = $3; - }; -optnoderef: - noderef { $$ = $1; } - | "(" ")" { $$.node = nil; $$.anchor = nil; } -optedgenode: - { $$ = nil; } - | "node" optproperties DELIMITEDSTRING - { - $$ = [Node node]; - if ($2) - [$$ setData:$2]; - [$$ setLabel:$3]; - } -edge: "\\draw" optproperties noderef "to" optedgenode optnoderef ";" - { - Edge *edge = [[Edge alloc] init]; - if ($2) - [edge setData:$2]; - [edge setSource:$3.node]; - [edge setSourceAnchor:$3.anchor]; - [edge setEdgeNode:$5]; - if ($6.node) { - [edge setTarget:$6.node]; - [edge setTargetAnchor:$6.anchor]; - } else { - [edge setTarget:$3.node]; - [edge setTargetAnchor:$3.anchor]; - } - [edge setAttributesFromData]; - [[assembler graph] addEdge:edge]; -#if ! __has_feature(objc_arc) - [edge release]; -#endif - }; - -ignoreprop: val | val "=" val; -ignoreprops: ignoreprop ignoreprops | ; -optignoreprops: "[" ignoreprops "]"; -boundingbox: - "\\path" optignoreprops COORD "rectangle" COORD ";" - { - [[assembler graph] setBoundingBox:NSRectAroundPoints($3, $5)]; - }; - -/* vi:ft=yacc:noet:ts=4:sts=4:sw=4 -*/ diff --git a/tikzit-old/src/common/tikzparserdefs.h b/tikzit-old/src/common/tikzparserdefs.h deleted file mode 100644 index cde3345..0000000 --- a/tikzit-old/src/common/tikzparserdefs.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2013 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* - * This file sets up some defs (particularly struct noderef) needed for - * the tikz parser and its users. - * - * It is needed because we wish to support bison 2.3, which is the - * version shipped with OSX. bison 2.4 onwards allows us to put this - * stuff in a "%code requires" block, where it will be put in the - * generated header file by bison. - * - * All the types used by the %union directive in tikzparser.ym should - * be declared, defined or imported here. - */ - -// Foundation has NSPoint and NSString -#import - -@class TikzGraphAssembler; -@class GraphElementData; -@class GraphElementProperty; -@class Node; - -struct noderef { -#if __has_feature(objc_arc) - __unsafe_unretained Node *node; - __unsafe_unretained NSString *anchor; -#else - Node *node; - NSString *anchor; -#endif -}; - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/common/util.h b/tikzit-old/src/common/util.h deleted file mode 100644 index b34f25d..0000000 --- a/tikzit-old/src/common/util.h +++ /dev/null @@ -1,201 +0,0 @@ -// -// util.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// - -#import - -#include - -#ifndef M_PI -#define M_PI 3.141592654 -#endif - -#ifndef MAX -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef MIN -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -/*! - @brief Compute a bounding rectangle for two given points. - @param p1 a point. - @param p2 another point. - @result A bounding rectangle for p1 and p2. - */ -NSRect NSRectAroundPoints(NSPoint p1, NSPoint p2); - -/*! - @brief Compute a bounding rectangle for two given points. - @param rect the base rectangle - @param the point to ensure is included - @result A rectangle containing rect and p - */ -NSRect NSRectWithPoint(NSRect rect, NSPoint p); - -/*! - @brief Compute a bounding rectangle for two given points with a given padding. - @param p1 a point. - @param p2 another point. - @param padding a padding. - @result A bounding rectangle for p1 and p2 with padding. - */ -NSRect NSRectAroundPointsWithPadding(NSPoint p1, NSPoint p2, float padding); - -/*! - @brief Compute a bounding rectangle for four given points. - @result A bounding rectangle for p1, p2, p3 and p4. - */ -NSRect NSRectAround4Points(NSPoint p1, NSPoint p2, NSPoint p3, NSPoint p4); - -/*! - @brief Compute a bounding rectangle for four given points. - @param padding the amount to pad the rectangle - @result A bounding rectangle for p1, p2, p3 and p4 with padding - */ -NSRect NSRectAround4PointsWithPadding(NSPoint p1, NSPoint p2, NSPoint p3, NSPoint p4, float padding); - -/*! - @brief Find the distance between two points - @param p1 The first point - @param p2 The second point - @result The distance between p1 and p2 - */ -float NSDistanceBetweenPoints(NSPoint p1, NSPoint p2); - -/*! - @brief Compute the 'real' arctan for two points. Always succeeds and gives a good angle, - regardless of sign, zeroes, etc. - @param dx the x distance between points. - @param dy the y distance between points. - @result An angle in radians. - */ -float good_atan(float dx, float dy); - -/*! - @brief Interpolate along a bezier curve to the given distance. To find the x coord, - use the relavant x coordinates for c0-c3, and for y use the y's. - @param dist a distance from 0 to 1 spanning the whole curve. - @param c0 the x (resp. y) coordinate of the start point. - @param c1 the x (resp. y) coordinate of the first control point. - @param c2 the x (resp. y) coordinate of the second control point. - @param c3 the x (resp. y) coordinate of the end point. - @result The x (resp. y) coordinate of the point at 'dist'. - */ -float bezierInterpolate (float dist, float c0, float c1, float c2, float c3); - -/*! - @brief Interpolate along a bezier curve to the given distance. - @param dist a distance from 0 to 1 spanning the whole curve. - @param c0 the x start point. - @param c1 the x first control point. - @param c2 the x second control point. - @param c3 the x end point. - @result The point at 'dist'. - */ -NSPoint bezierInterpolateFull (float dist, NSPoint c0, NSPoint c1, NSPoint c2, NSPoint c3); - -/*! - * @brief Find whether two line segments intersect - * @param l1start The starting point of line segment 1 - * @param l1end The ending point of line segment 1 - * @param l2start The starting point of line segment 2 - * @param l2end The ending point of line segment 2 - * @param result A location to store the intersection point - * @result YES if they intersect, NO if they do not - */ -BOOL lineSegmentsIntersect (NSPoint l1start, NSPoint l1end, NSPoint l2start, NSPoint l2end, NSPoint *result); - -/*! - * @brief Find whether a line segment intersects a bezier curve - * @detail Always finds the intersection furthest along the line segment - * @param lstart The starting point of the line segment - * @param lend The ending point of the line segment - * @param c0 The starting point of the bezier curve - * @param c1 The first control point of the bezier curve - * @param c2 The second control point of the bezier curve - * @param c3 The ending point of the bezier curve - * @param result A location to store the intersection point - * @result YES if they intersect, NO if they do not - */ -BOOL lineSegmentIntersectsBezier (NSPoint lstart, NSPoint lend, NSPoint c0, NSPoint c1, NSPoint c2, NSPoint c3, NSPoint *result); - -/*! - * @brief Find whether a line segment enters a rectangle - * @param lineStart The starting point of the line segment - * @param lineEnd The ending point of the line segment - * @param rect The rectangle - * @result YES if they intersect, NO if they do not - */ -BOOL lineSegmentIntersectsRect (NSPoint lineStart, NSPoint lineEnd, NSRect rect); - -/*! - * @brief Find where a ray exits a rectangle - * @param rayStart The starting point of the ray; must be contained in rect - * @param angle_rads The angle of the ray, in radians - * @param rect The rectangle - * @result The point at which the ray leaves the rect - */ -NSPoint findExitPointOfRay (NSPoint rayStart, float angle_rads, NSRect rect); - -/*! - @brief Round val to nearest stepSize - @param stepSize the courseness - @param val a value to round - */ -float roundToNearest(float stepSize, float val); - -/*! - @brief Convert radians into degrees - */ -float radiansToDegrees(float radians); - -/*! - @brief Convert degrees into radians - */ -float degreesToRadians(float degrees); - -/*! - @brief Normalises an angle (in degrees) to fall between -179 and 180 - */ -int normaliseAngleDeg (int degrees); - -/*! - @brief Normalises an angle (in radians) to fall in the range (-pi,pi] - */ -float normaliseAngleRad (float rads); - -/*! - @brief Express a byte as alpha-only hex, with digits (0..16) -> (a..jA..F) - @param sh A number 0-255 - @result A string 'aa'-'FF' - */ -NSString *alphaHex(unsigned short sh); - -const char *find_start_of_nth_line (const char * string, int line); - -/*! - @brief Formats a CGFloat as a string, removing trailing zeros - @detail Unlike formatting an NSNumber, or using %g, it will never - produce scientific notation (like "2.00e2"). Unlike %f, - it will not include unnecessary trailing zeros. - */ -NSString *formatFloat(CGFloat f, int maxdps); - diff --git a/tikzit-old/src/common/util.m b/tikzit-old/src/common/util.m deleted file mode 100644 index e9b8899..0000000 --- a/tikzit-old/src/common/util.m +++ /dev/null @@ -1,403 +0,0 @@ -// -// util.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// - -#import "util.h" -#import "math.h" - -static BOOL fuzzyCompare(float f1, float f2) { - return (ABS(f1 - f2) <= 0.00001f * MIN(ABS(f1), ABS(f2))); -} - -NSRect NSRectWithPoint(NSRect rect, NSPoint p) { - CGFloat minX = NSMinX(rect); - CGFloat maxX = NSMaxX(rect); - CGFloat minY = NSMinY(rect); - CGFloat maxY = NSMaxY(rect); - if (p.x < minX) { - minX = p.x; - } else if (p.x > maxX) { - maxX = p.x; - } - if (p.y < minY) { - minY = p.y; - } else if (p.y > maxY) { - maxY = p.y; - } - return NSMakeRect(minX, minY, maxX - minX, maxY - minY); -} - -NSRect NSRectAroundPointsWithPadding(NSPoint p1, NSPoint p2, float padding) { - return NSMakeRect(MIN(p1.x,p2.x)-padding, - MIN(p1.y,p2.y)-padding, - ABS(p2.x-p1.x)+(2.0f*padding), - ABS(p2.y-p1.y)+(2.0f*padding)); -} - -NSRect NSRectAroundPoints(NSPoint p1, NSPoint p2) { - return NSRectAroundPointsWithPadding(p1, p2, 0.0f); -} - -NSRect NSRectAround4PointsWithPadding(NSPoint p1, NSPoint p2, NSPoint p3, NSPoint p4, float padding) { - float leftMost = MIN(p1.x, p2.x); - leftMost = MIN(leftMost, p3.x); - leftMost = MIN(leftMost, p4.x); - float rightMost = MAX(p1.x, p2.x); - rightMost = MAX(rightMost, p3.x); - rightMost = MAX(rightMost, p4.x); - float topMost = MIN(p1.y, p2.y); - topMost = MIN(topMost, p3.y); - topMost = MIN(topMost, p4.y); - float bottomMost = MAX(p1.y, p2.y); - bottomMost = MAX(bottomMost, p3.y); - bottomMost = MAX(bottomMost, p4.y); - return NSMakeRect(leftMost-padding, - topMost-padding, - (rightMost - leftMost)+(2.0f*padding), - (bottomMost - topMost)+(2.0f*padding)); -} - -NSRect NSRectAround4Points(NSPoint p1, NSPoint p2, NSPoint p3, NSPoint p4) { - return NSRectAround4PointsWithPadding(p1, p2, p3, p4, 0.0f); -} - -float NSDistanceBetweenPoints(NSPoint p1, NSPoint p2) { - float dx = p2.x - p1.x; - float dy = p2.y - p1.y; - return sqrt(dx * dx + dy * dy); -} - -float good_atan(float dx, float dy) { - if (dx > 0) { - return atan(dy/dx); - } else if (dx < 0) { - return M_PI + atan(dy/dx); - } else { - if (dy > 0) return 0.5 * M_PI; - else if (dy < 0) return 1.5 * M_PI; - else return 0; - } -} - -// interpolate on a cubic bezier curve -float bezierInterpolate(float dist, float c0, float c1, float c2, float c3) { - float distp = 1 - dist; - return (distp*distp*distp) * c0 + - 3 * (distp*distp) * dist * c1 + - 3 * (dist*dist) * distp * c2 + - (dist*dist*dist) * c3; -} - -NSPoint bezierInterpolateFull (float dist, NSPoint c0, NSPoint c1, NSPoint c2, NSPoint c3) { - return NSMakePoint (bezierInterpolate (dist, c0.x, c1.x, c2.x, c3.x), - bezierInterpolate (dist, c0.y, c1.y, c2.y, c3.y)); -} - -static void lineCoeffsFromPoints(NSPoint p1, NSPoint p2, float *A, float *B, float *C) { - *A = p2.y - p1.y; - *B = p1.x - p2.x; - *C = (*A) * p1.x + (*B) * p1.y; -} - -static void lineCoeffsFromPointAndAngle(NSPoint p, float angle, float *A, float *B, float *C) { - *A = sin (angle); - *B = -cos (angle); - *C = (*A) * p.x + (*B) * p.y; -} - -static BOOL lineSegmentContainsPoint(NSPoint l1, NSPoint l2, float x, float y) { - float minX = MIN(l1.x, l2.x); - float maxX = MAX(l1.x, l2.x); - float minY = MIN(l1.y, l2.y); - float maxY = MAX(l1.y, l2.y); - return (x >= minX || fuzzyCompare (x, minX)) && - (x <= maxX || fuzzyCompare (x, maxX)) && - (y >= minY || fuzzyCompare (y, minY)) && - (y <= maxY || fuzzyCompare (y, maxY)); -} - -BOOL lineSegmentsIntersect(NSPoint l1start, NSPoint l1end, NSPoint l2start, NSPoint l2end, NSPoint *result) { - // Ax + By = C - float A1, B1, C1; - lineCoeffsFromPoints(l1start, l1end, &A1, &B1, &C1); - float A2, B2, C2; - lineCoeffsFromPoints(l2start, l2end, &A2, &B2, &C2); - - float det = A1*B2 - A2*B1; - if (det == 0.0f) { - // parallel - return NO; - } else { - float x = (B2*C1 - B1*C2)/det; - float y = (A1*C2 - A2*C1)/det; - - if (lineSegmentContainsPoint(l1start, l1end, x, y) && - lineSegmentContainsPoint(l2start, l2end, x, y)) { - if (result) { - (*result).x = x; - (*result).y = y; - } - return YES; - } - } - return NO; -} - -BOOL lineSegmentIntersectsBezier (NSPoint lstart, NSPoint lend, NSPoint c0, NSPoint c1, NSPoint c2, NSPoint c3, NSPoint *result) { - NSRect curveBounds = NSRectAround4Points(c0, c1, c2, c3); - if (!lineSegmentIntersectsRect(lstart, lend, curveBounds)) - return NO; - - const int divisions = 20; - const float chunkSize = 1.0f/(float)divisions; - float chunkStart = 0.0f; - BOOL found = NO; - - for (int i = 0; i < divisions; ++i) { - float chunkEnd = chunkStart + chunkSize; - - NSPoint p1 = bezierInterpolateFull (chunkStart, c0, c1, c2, c3); - NSPoint p2 = bezierInterpolateFull (chunkEnd, c0, c1, c2, c3); - - NSPoint p; - if (lineSegmentsIntersect (lstart, lend, p1, p2, &p)) { - lstart = p; - found = YES; - } - - chunkStart = chunkEnd; - } - if (found && result) { - *result = lstart; - } - return found; -} - -BOOL lineSegmentIntersectsRect(NSPoint lineStart, NSPoint lineEnd, NSRect rect) { - const float rectMaxX = NSMaxX(rect); - const float rectMinX = NSMinX(rect); - const float rectMaxY = NSMaxY(rect); - const float rectMinY = NSMinY(rect); - - // check if the segment is entirely to one side of the rect - if (lineStart.x > rectMaxX && lineEnd.x > rectMaxX) { - return NO; - } - if (lineStart.x < rectMinX && lineEnd.x < rectMinX) { - return NO; - } - if (lineStart.y > rectMaxY && lineEnd.y > rectMaxY) { - return NO; - } - if (lineStart.y < rectMinY && lineEnd.y < rectMinY) { - return NO; - } - - // Now check whether the (infinite) line intersects the rect - // (if it does, so does the segment, due to above checks) - - // Ax + By = C - float A, B, C; - lineCoeffsFromPoints(lineStart, lineEnd, &A, &B, &C); - - const float tlVal = A * rectMinX + B * rectMaxY - C; - const float trVal = A * rectMaxX + B * rectMaxY - C; - const float blVal = A * rectMinX + B * rectMinY - C; - const float brVal = A * rectMaxX + B * rectMinY - C; - - if (tlVal < 0 && trVal < 0 && blVal < 0 && brVal < 0) { - // rect below line - return NO; - } - if (tlVal > 0 && trVal > 0 && blVal > 0 && brVal > 0) { - // rect above line - return NO; - } - - return YES; -} - -NSPoint findExitPointOfRay (NSPoint p, float angle_rads, NSRect rect) { - const float rectMinX = NSMinX (rect); - const float rectMaxX = NSMaxX (rect); - const float rectMinY = NSMinY (rect); - const float rectMaxY = NSMaxY (rect); - - const float angle = normaliseAngleRad (angle_rads); - - // special case the edges - if (p.y == rectMaxY && angle > 0 && angle < M_PI) { - // along the top of the box - return p; - } - if (p.y == rectMinY && angle < 0 && angle > -M_PI) { - // along the bottom of the box - return p; - } - if (p.x == rectMaxX && angle > -M_PI/2.0f && angle < M_PI/2.0f) { - // along the right of the box - return p; - } - if (p.x == rectMinX && (angle > M_PI/2.0f || angle < -M_PI/2.0f)) { - // along the left of the box - return p; - } - - float A1, B1, C1; - lineCoeffsFromPointAndAngle(p, angle, &A1, &B1, &C1); - //NSLog(@"Ray is %fx + %fy = %f", A1, B1, C1); - - const float tlAngle = normaliseAngleRad (good_atan (rectMinX - p.x, rectMaxY - p.y)); - const float trAngle = normaliseAngleRad (good_atan (rectMaxX - p.x, rectMaxY - p.y)); - if (angle <= tlAngle && angle >= trAngle) { - // exit top - float A2, B2, C2; - lineCoeffsFromPoints(NSMakePoint (rectMinX, rectMaxY), - NSMakePoint (rectMaxX, rectMaxY), - &A2, &B2, &C2); - float det = A1*B2 - A2*B1; - NSCAssert(det != 0.0f, @"Parallel lines?"); - NSPoint intersect = NSMakePoint ((B2*C1 - B1*C2)/det, - (A1*C2 - A2*C1)/det); - return intersect; - } - - const float brAngle = normaliseAngleRad (good_atan (rectMaxX - p.x, rectMinY - p.y)); - if (angle <= trAngle && angle >= brAngle) { - // exit right - float A2, B2, C2; - lineCoeffsFromPoints(NSMakePoint (rectMaxX, rectMaxY), - NSMakePoint (rectMaxX, rectMinY), - &A2, &B2, &C2); - //NSLog(@"Edge is %fx + %fy = %f", A2, B2, C2); - float det = A1*B2 - A2*B1; - NSCAssert(det != 0.0f, @"Parallel lines?"); - NSPoint intersect = NSMakePoint ((B2*C1 - B1*C2)/det, - (A1*C2 - A2*C1)/det); - return intersect; - } - - const float blAngle = normaliseAngleRad (good_atan (rectMinX - p.x, rectMinY - p.y)); - if (angle <= brAngle && angle >= blAngle) { - // exit bottom - float A2, B2, C2; - lineCoeffsFromPoints(NSMakePoint (rectMaxX, rectMinY), - NSMakePoint (rectMinX, rectMinY), - &A2, &B2, &C2); - float det = A1*B2 - A2*B1; - NSCAssert(det != 0.0f, @"Parallel lines?"); - NSPoint intersect = NSMakePoint ((B2*C1 - B1*C2)/det, - (A1*C2 - A2*C1)/det); - return intersect; - } else { - // exit left - float A2, B2, C2; - lineCoeffsFromPoints(NSMakePoint (rectMinX, rectMaxY), - NSMakePoint (rectMinX, rectMinY), - &A2, &B2, &C2); - float det = A1*B2 - A2*B1; - NSCAssert(det != 0.0f, @"Parallel lines?"); - NSPoint intersect = NSMakePoint ((B2*C1 - B1*C2)/det, - (A1*C2 - A2*C1)/det); - return intersect; - } -} - -float roundToNearest(float stepSize, float val) { - if (stepSize==0.0f) return val; - else return round(val/stepSize)*stepSize; -} - -float radiansToDegrees (float radians) { - return (radians * 180.0f) / M_PI; -} - -float degreesToRadians(float degrees) { - return (degrees * M_PI) / 180.0f; -} - -int normaliseAngleDeg (int degrees) { - while (degrees > 180) { - degrees -= 360; - } - while (degrees <= -180) { - degrees += 360; - } - return degrees; -} - -float normaliseAngleRad (float rads) { - while (rads > M_PI) { - rads -= 2 * M_PI; - } - while (rads <= -M_PI) { - rads += 2 * M_PI; - } - return rads; -} - -static char ahex[] = -{'a','b','c','d','e','f','g','h','i','j', - 'A','B','C','D','E','F'}; - -NSString *alphaHex(unsigned short sh) { - if (sh > 255) return @"!!"; - return [NSString stringWithFormat:@"%c%c", ahex[sh/16], ahex[sh%16]]; -} - -const char *find_start_of_nth_line (const char * string, int line) { - int l = 0; - const char *lineStart = string; - while (*lineStart && l < line) { - while (*lineStart && *lineStart != '\n') { - ++lineStart; - } - if (*lineStart) { - ++l; - ++lineStart; - } - } - return lineStart; -} - -NSString *formatFloat(CGFloat f, int maxdps) { - NSMutableString *result = [NSMutableString - stringWithFormat:@"%.*f", maxdps, f]; - // delete trailing zeros - NSUInteger lastPos = [result length] - 1; - NSUInteger firstDigit = ([result characterAtIndex:0] == '-') ? 1 : 0; - while (lastPos > firstDigit) { - if ([result characterAtIndex:lastPos] == '0') { - [result deleteCharactersInRange:NSMakeRange(lastPos, 1)]; - lastPos -= 1; - } else { - break; - } - } - if ([result characterAtIndex:lastPos] == '.') { - [result deleteCharactersInRange:NSMakeRange(lastPos, 1)]; - lastPos -= 1; - } - if ([@"-0" isEqualToString:result]) - return @"0"; - else - return result; -} - -// vi:ft=objc:noet:ts=4:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Application.h b/tikzit-old/src/gtk/Application.h deleted file mode 100644 index 1b48a79..0000000 --- a/tikzit-old/src/gtk/Application.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "InputDelegate.h" - -@class Application; -@class Configuration; -@class ContextWindow; -@class Preambles; -@class PreambleEditor; -@class PreviewWindow; -@class SettingsDialog; -@class StyleManager; -@class TikzDocument; -@class ToolBox; -@class Window; -@protocol Tool; - -extern Application* app; - -/** - * Manages the main application window - */ -@interface Application: NSObject { - // the main application configuration - Configuration *configFile; - // maintains the known (user-defined) styles - StyleManager *styleManager; - // maintains the preambles used for previews - Preambles *preambles; - // the last-accessed folders (for open and save dialogs) - NSString *lastOpenFolder; - NSString *lastSaveAsFolder; - - ToolBox *toolBox; - PreambleEditor *preambleWindow; - ContextWindow *contextWindow; - SettingsDialog *settingsDialog; - - // the open windows (array of Window*) - NSMutableArray *openWindows; - - // tools - id activeTool; - NSArray *tools; -} - -/** - * The main application configuration file - */ -@property (readonly) Configuration *mainConfiguration; - -/** - * The app-wide style manager instance - */ -@property (readonly) StyleManager *styleManager; - -/** - * The app-wide preambles registry - */ -@property (readonly) Preambles *preambles; - -/** - * The tools - */ -@property (readonly) NSArray *tools; - -/** - * The currently-selected tool - */ -@property (assign) id activeTool; - -/** - * The folder last actively chosen by a user for opening a file - */ -@property (copy) NSString *lastOpenFolder; - -/** - * The folder last actively chosen by a user for saving a file - */ -@property (copy) NSString *lastSaveAsFolder; - -/** - * The application instance. - */ -+ (Application*) app; - -/** - * Starts the application with a single window containing an empty file - */ -- (id) init; -/** - * Starts the application with the given files open - */ -- (id) initWithFiles:(NSArray*)files; - -/** - * Loads a new, empty document in a new window - */ -- (void) newWindow; -/** - * Loads an existing document from a file in a new window - * - * @param doc the document the new window should show - */ -- (void) newWindowWithDocument:(TikzDocument*)doc; -/** - * Quit the application, confirming with the user if there are - * changes to any open documents. - */ -- (void) quit; - -/** - * Show the dialog for editing preambles. - */ -- (void) presentPreamblesEditor; -/** - * Show the context-aware window - */ -- (void) presentContextWindow; -/** - * Show the settings dialog. - */ -- (void) presentSettingsDialog; - -/** - * Save the application configuration to permanent storage - * - * Should be called just before the application exits - */ -- (void) saveConfiguration; - -/** - * @result YES if key event was processed, NO otherwise - */ -- (BOOL) activateToolForKey:(unsigned int)keyVal withMask:(InputMask)mask; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Application.m b/tikzit-old/src/gtk/Application.m deleted file mode 100644 index e9935bd..0000000 --- a/tikzit-old/src/gtk/Application.m +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Application.h" - -#import "Configuration.h" -#import "EdgeStylesModel.h" -#import "NodeStylesModel.h" -#import "PreambleEditor.h" -#import "ContextWindow.h" -#import "Shape.h" -#import "SettingsDialog.h" -#import "StyleManager.h" -#import "StyleManager+Storage.h" -#import "SupportDir.h" -#import "TikzDocument.h" -#import "ToolBox.h" -#import "Window.h" - -#ifdef HAVE_POPPLER -#import "Preambles.h" -#import "Preambles+Storage.h" -#endif - -#import "BoundingBoxTool.h" -#import "CreateNodeTool.h" -#import "CreateEdgeTool.h" -#import "HandTool.h" -#import "SelectTool.h" - -// used for args to g_mkdir_with_parents -#import "stat.h" - -Application* app = nil; - -@interface Application (Notifications) -- (void) windowClosed:(NSNotification*)notification; -- (void) windowGainedFocus:(NSNotification*)notification; -- (void) selectedToolChanged:(NSNotification*)notification; -- (void) windowDocumentChanged:(NSNotification*)n; -@end - -@interface Application (Private) -- (void) setActiveWindow:(Window*)window; -@end - -@implementation Application - -@synthesize mainConfiguration=configFile; -@synthesize styleManager, preambles; -@synthesize lastOpenFolder, lastSaveAsFolder; -@synthesize tools; - -+ (Application*) app { - if (app == nil) { - [[[self alloc] init] release]; - } - return app; -} - -- (id) _initCommon { - if (app != nil) { - [self release]; - self = app; - return self; - } - self = [super init]; - - if (self) { - NSError *error = nil; - configFile = [[Configuration alloc] initWithName:@"tikzit" loadError:&error]; - if (error != nil) { - logError (error, @"WARNING: Failed to load configuration"); - } - - styleManager = [[StyleManager alloc] init]; - [styleManager loadStylesUsingConfigurationName:@"styles"]; // FIXME: error message? - NodeStylesModel *nsm = [NodeStylesModel modelWithStyleManager:styleManager]; - EdgeStylesModel *esm = [EdgeStylesModel modelWithStyleManager:styleManager]; - -#ifdef HAVE_POPPLER - NSString *preamblesDir = [[SupportDir userSupportDir] stringByAppendingPathComponent:@"preambles"]; - preambles = [[Preambles alloc] initFromDirectory:preamblesDir]; // FIXME: error message? - [preambles setStyleManager:styleManager]; - NSString *selectedPreamble = [configFile stringEntry:@"selectedPreamble" inGroup:@"Preambles"]; - if (selectedPreamble != nil) { - [preambles setSelectedPreambleName:selectedPreamble]; - } -#endif - - lastOpenFolder = [[configFile stringEntry:@"lastOpenFolder" inGroup:@"Paths"] retain]; - if (lastOpenFolder == nil) - lastOpenFolder = [[configFile stringEntry:@"lastFolder" inGroup:@"Paths"] retain]; - lastSaveAsFolder = [[configFile stringEntry:@"lastSaveAsFolder" inGroup:@"Paths"] retain]; - if (lastSaveAsFolder == nil) - lastSaveAsFolder = [[configFile stringEntry:@"lastFolder" inGroup:@"Paths"] retain]; - - openWindows = [[NSMutableArray alloc] init]; - - tools = [[NSArray alloc] initWithObjects: - [SelectTool tool], - [CreateNodeTool toolWithNodeStylesModel:nsm], - [CreateEdgeTool toolWithEdgeStylesModel:esm], - [BoundingBoxTool tool], - [HandTool tool], - nil]; - activeTool = [tools objectAtIndex:0]; - for (id tool in tools) { - [tool loadConfiguration:configFile]; - } - - toolBox = [[ToolBox alloc] initWithTools:tools]; - [toolBox loadConfiguration:configFile]; - [toolBox setSelectedTool:activeTool]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(selectedToolChanged:) - name:@"ToolSelectionChanged" - object:toolBox]; - [toolBox show]; - - contextWindow = [[ContextWindow alloc] initWithNodeStylesModel:nsm - andEdgeStylesModel:esm]; - [contextWindow loadConfiguration:configFile]; - - app = [self retain]; - } - - return self; -} - -- (id) init { - self = [self _initCommon]; - - if (self) { - [self newWindow]; - } - - return self; -} - -- (id) initWithFiles:(NSArray*)files { - self = [self _initCommon]; - - if (self) { - int fileOpenCount = 0; - for (NSString *file in files) { - NSError *error = nil; - TikzDocument *doc = [TikzDocument documentFromFile:file styleManager:styleManager error:&error]; - if (doc != nil) { - [self newWindowWithDocument:doc]; - ++fileOpenCount; - } else { - logError(error, @"WARNING: failed to open file"); - } - } - if (fileOpenCount == 0) { - [self newWindow]; - } - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [configFile release]; - [styleManager release]; - [preambles release]; - [lastOpenFolder release]; - [lastSaveAsFolder release]; - [preambleWindow release]; - [settingsDialog release]; - [openWindows release]; - [tools release]; - [activeTool release]; - [toolBox release]; - [contextWindow release]; - - [super dealloc]; -} - -- (id) activeTool { return activeTool; } -- (void) setActiveTool:(id)tool { - if (activeTool == tool) - return; - - activeTool = tool; - [toolBox setSelectedTool:tool]; - for (Window* window in openWindows) { - [window setActiveTool:tool]; - } -} - -- (BOOL) activateToolForKey:(unsigned int)keyVal withMask:(InputMask)mask { - // FIXME: cache the accel info, rather than reparsing it every time? - for (id tool in tools) { - guint toolKey = 0; - GdkModifierType toolMod = 0; - gtk_accelerator_parse ([[tool shortcut] UTF8String], &toolKey, &toolMod); - if (toolKey != 0 && toolKey == keyVal && (int)mask == (int)toolMod) { - [self setActiveTool:tool]; - return YES; - } - } - return NO; -} - -- (void) _addWindow:(Window*)window { - [window setActiveTool:activeTool]; - [openWindows addObject:window]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowClosed:) - name:@"WindowClosed" - object:window]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(windowGainedFocus:) - name:@"WindowGainedFocus" - object:window]; - if ([window hasFocus]) { - [self setActiveWindow:window]; - } -} - -- (void) newWindow { - [self _addWindow:[Window window]]; -} - -- (void) newWindowWithDocument:(TikzDocument*)doc { - [self _addWindow:[Window windowWithDocument:doc]]; -} - -- (void) quit { - NSMutableArray *unsavedDocs = [NSMutableArray arrayWithCapacity:[openWindows count]]; - for (Window *window in openWindows) { - TikzDocument *doc = [window document]; - if ([doc hasUnsavedChanges]) { - [unsavedDocs addObject:doc]; - } - } - if ([unsavedDocs count] > 0) { - // FIXME: show a dialog - return; - } - gtk_main_quit(); -} - -- (void) presentPreamblesEditor { -#ifdef HAVE_POPPLER - if (preambleWindow == nil) { - preambleWindow = [[PreambleEditor alloc] initWithPreambles:preambles]; - //[preambleWindow setParentWindow:mainWindow]; - } - [preambleWindow present]; -#endif -} - -- (void) presentContextWindow { - [contextWindow present]; -} - -- (void) presentSettingsDialog { - if (settingsDialog == nil) { - settingsDialog = [[SettingsDialog alloc] initWithConfiguration:configFile - andStyleManager:styleManager]; - //[settingsDialog setParentWindow:mainWindow]; - } - [settingsDialog present]; -} - -- (Configuration*) mainConfiguration { - return configFile; -} - -- (void) saveConfiguration { - NSError *error = nil; - -#ifdef HAVE_POPPLER - if (preambles != nil) { - NSString *preamblesDir = [[SupportDir userSupportDir] stringByAppendingPathComponent:@"preambles"]; - // NSFileManager is slightly dodgy on Windows - g_mkdir_with_parents ([preamblesDir UTF8String], S_IRUSR | S_IWUSR | S_IXUSR); - [preambles storeToDirectory:preamblesDir]; - [configFile setStringEntry:@"selectedPreamble" inGroup:@"Preambles" value:[preambles selectedPreambleName]]; - } -#endif - - [styleManager saveStylesUsingConfigurationName:@"styles"]; - - for (id tool in tools) { - [tool saveConfiguration:configFile]; - } - [toolBox saveConfiguration:configFile]; - - [contextWindow saveConfiguration:configFile]; - - if (lastOpenFolder != nil) { - [configFile setStringEntry:@"lastOpenFolder" inGroup:@"Paths" value:lastOpenFolder]; - } - if (lastSaveAsFolder != nil) { - [configFile setStringEntry:@"lastSaveAsFolder" inGroup:@"Paths" value:lastSaveAsFolder]; - } - - if (![configFile writeToStoreWithError:&error]) { - logError (error, @"Could not write config file"); - } -} - -@end - -@implementation Application (Notifications) -- (void) windowClosed:(NSNotification*)notification { - Window *window = [notification object]; - [openWindows removeObjectIdenticalTo:window]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:nil - object:window]; - if ([openWindows count] == 0) { - gtk_main_quit(); - } else { - [self setActiveWindow:[openWindows objectAtIndex:0]]; - } -} - -- (void) windowGainedFocus:(NSNotification*)notification { - Window *window = [notification object]; - [self setActiveWindow:window]; -} - -- (void) selectedToolChanged:(NSNotification*)n { - id tool = [[n userInfo] objectForKey:@"tool"]; - if (tool != nil) - [self setActiveTool:tool]; - else - NSLog(@"nil tool!"); -} - -- (void) windowDocumentChanged:(NSNotification*)n { - [contextWindow setDocument:[[n userInfo] objectForKey:@"document"]]; -} -@end - -@implementation Application (Private) -- (void) setActiveWindow:(Window*)window { - [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"DocumentChanged" - object:nil]; - - [contextWindow setDocument:[window document]]; - - [contextWindow attachToWindow:window]; - [toolBox attachToWindow:window]; - - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(windowDocumentChanged:) - name:@"DocumentChanged" - object:window]; -} -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/BoundingBoxTool.h b/tikzit-old/src/gtk/BoundingBoxTool.h deleted file mode 100644 index f6498b0..0000000 --- a/tikzit-old/src/gtk/BoundingBoxTool.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Tool.h" - -typedef enum { - NoHandle, - EastHandle, - SouthEastHandle, - SouthHandle, - SouthWestHandle, - WestHandle, - NorthWestHandle, - NorthHandle, - NorthEastHandle -} ResizeHandle; - -@interface BoundingBoxTool : NSObject { - GraphRenderer *renderer; - NSPoint dragOrigin; - ResizeHandle currentResizeHandle; - BOOL drawingNewBox; -} - -+ (id) tool; -- (id) init; -@end - - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/BoundingBoxTool.m b/tikzit-old/src/gtk/BoundingBoxTool.m deleted file mode 100644 index 483705e..0000000 --- a/tikzit-old/src/gtk/BoundingBoxTool.m +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "BoundingBoxTool.h" - -#import "GraphRenderer.h" -#import "TikzDocument.h" -#import "tzstockitems.h" - -static const float handle_size = 8.0; -float sideHandleTop(NSRect bbox) { - return (NSMinY(bbox) + NSMaxY(bbox) - handle_size)/2.0f; -} -float tbHandleLeft(NSRect bbox) { - return (NSMinX(bbox) + NSMaxX(bbox) - handle_size)/2.0f; -} - -@interface BoundingBoxTool (Private) -- (NSRect) screenBoundingBox; -- (ResizeHandle) boundingBoxResizeHandleAt:(NSPoint)p; -- (NSRect) boundingBoxResizeHandleRect:(ResizeHandle)handle; -- (void) setResizeCursorForHandle:(ResizeHandle)handle; -@end - -@implementation BoundingBoxTool -- (NSString*) name { return @"Bounding Box"; } -- (const gchar*) stockId { return TIKZIT_STOCK_BOUNDING_BOX; } -- (NSString*) helpText { return @"Set the bounding box"; } -- (NSString*) shortcut { return @"b"; } - -+ (id) tool { - return [[[self alloc] init] autorelease]; -} - -- (id) init { - self = [super init]; - - if (self) { - currentResizeHandle = NoHandle; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [renderer release]; - - [super dealloc]; -} - -- (GraphRenderer*) activeRenderer { return renderer; } -- (void) setActiveRenderer:(GraphRenderer*)r { - if (r == renderer) - return; - - [[renderer surface] setCursor:NormalCursor]; - - [r retain]; - [renderer release]; - renderer = r; -} - -- (GtkWidget*) configurationWidget { return NULL; } - -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - dragOrigin = pos; - currentResizeHandle = [self boundingBoxResizeHandleAt:pos]; - [[renderer document] startChangeBoundingBox]; - if (currentResizeHandle == NoHandle) { - drawingNewBox = YES; - [[[renderer document] graph] setBoundingBox:NSZeroRect]; - } else { - drawingNewBox = NO; - } - [renderer invalidateGraph]; -} - -- (void) mouseMoveTo:(NSPoint)pos withButtons:(MouseButton)buttons andMask:(InputMask)mask { - if (!(buttons & LeftButton)) { - ResizeHandle handle = [self boundingBoxResizeHandleAt:pos]; - [self setResizeCursorForHandle:handle]; - return; - } - - Transformer *transformer = [renderer transformer]; - Grid *grid = [renderer grid]; - Graph *graph = [[renderer document] graph]; - - if (currentResizeHandle == NoHandle) { - NSRect bbox = NSRectAroundPoints( - [grid snapScreenPoint:dragOrigin], - [grid snapScreenPoint:pos] - ); - [graph setBoundingBox:[transformer rectFromScreen:bbox]]; - } else { - NSRect bbox = [transformer rectToScreen:[graph boundingBox]]; - NSPoint p2 = [grid snapScreenPoint:pos]; - - if (currentResizeHandle == NorthWestHandle || - currentResizeHandle == NorthHandle || - currentResizeHandle == NorthEastHandle) { - - float dy = p2.y - NSMinY(bbox); - if (dy < bbox.size.height) { - bbox.origin.y += dy; - bbox.size.height -= dy; - } else { - bbox.origin.y = NSMaxY(bbox); - bbox.size.height = 0; - } - - } else if (currentResizeHandle == SouthWestHandle || - currentResizeHandle == SouthHandle || - currentResizeHandle == SouthEastHandle) { - - float dy = p2.y - NSMaxY(bbox); - if (-dy < bbox.size.height) { - bbox.size.height += dy; - } else { - bbox.size.height = 0; - } - } - - if (currentResizeHandle == NorthWestHandle || - currentResizeHandle == WestHandle || - currentResizeHandle == SouthWestHandle) { - - float dx = p2.x - NSMinX(bbox); - if (dx < bbox.size.width) { - bbox.origin.x += dx; - bbox.size.width -= dx; - } else { - bbox.origin.x = NSMaxX(bbox); - bbox.size.width = 0; - } - - } else if (currentResizeHandle == NorthEastHandle || - currentResizeHandle == EastHandle || - currentResizeHandle == SouthEastHandle) { - - float dx = p2.x - NSMaxX(bbox); - if (-dx < bbox.size.width) { - bbox.size.width += dx; - } else { - bbox.size.width = 0; - } - } - [graph setBoundingBox:[transformer rectFromScreen:bbox]]; - } - [[renderer document] changeBoundingBoxCheckPoint]; - [renderer invalidateGraph]; -} - -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - [[renderer document] endChangeBoundingBox]; - drawingNewBox = NO; - [renderer invalidateGraph]; -} - -- (void) renderWithContext:(id)context onSurface:(id)surface { - if (!drawingNewBox && [[[renderer document] graph] hasBoundingBox]) { - [context saveState]; - - [context setAntialiasMode:AntialiasDisabled]; - [context setLineWidth:1.0]; - - [context startPath]; - [context rect:[self boundingBoxResizeHandleRect:EastHandle]]; - [context rect:[self boundingBoxResizeHandleRect:SouthEastHandle]]; - [context rect:[self boundingBoxResizeHandleRect:SouthHandle]]; - [context rect:[self boundingBoxResizeHandleRect:SouthWestHandle]]; - [context rect:[self boundingBoxResizeHandleRect:WestHandle]]; - [context rect:[self boundingBoxResizeHandleRect:NorthWestHandle]]; - [context rect:[self boundingBoxResizeHandleRect:NorthHandle]]; - [context rect:[self boundingBoxResizeHandleRect:NorthEastHandle]]; - [context strokePathWithColor:MakeSolidRColor (0.5, 0.5, 0.5)]; - - [context restoreState]; - } -} -- (void) loadConfiguration:(Configuration*)config {} -- (void) saveConfiguration:(Configuration*)config {} -@end - -@implementation BoundingBoxTool (Private) -- (NSRect) screenBoundingBox { - Transformer *transformer = [[renderer surface] transformer]; - Graph *graph = [[renderer document] graph]; - return [transformer rectToScreen:[graph boundingBox]]; -} - -- (ResizeHandle) boundingBoxResizeHandleAt:(NSPoint)p { - NSRect bbox = [self screenBoundingBox]; - if (p.x >= NSMaxX(bbox)) { - if (p.x <= NSMaxX(bbox) + handle_size) { - if (p.y >= NSMaxY(bbox)) { - if (p.y <= NSMaxY(bbox) + handle_size) { - return SouthEastHandle; - } - } else if (p.y <= NSMinY(bbox)) { - if (p.y >= NSMinY(bbox) - handle_size) { - return NorthEastHandle; - } - } else { - float eastHandleTop = sideHandleTop(bbox); - if (p.y >= eastHandleTop && p.y <= (eastHandleTop + handle_size)) { - return EastHandle; - } - } - } - } else if (p.x <= NSMinX(bbox)) { - if (p.x >= NSMinX(bbox) - handle_size) { - if (p.y >= NSMaxY(bbox)) { - if (p.y <= NSMaxY(bbox) + handle_size) { - return SouthWestHandle; - } - } else if (p.y <= NSMinY(bbox)) { - if (p.y >= NSMinY(bbox) - handle_size) { - return NorthWestHandle; - } - } else { - float westHandleTop = sideHandleTop(bbox); - if (p.y >= westHandleTop && p.y <= (westHandleTop + handle_size)) { - return WestHandle; - } - } - } - } else if (p.y >= NSMaxY(bbox)) { - if (p.y <= NSMaxY(bbox) + handle_size) { - float southHandleLeft = tbHandleLeft(bbox); - if (p.x >= southHandleLeft && p.x <= (southHandleLeft + handle_size)) { - return SouthHandle; - } - } - } else if (p.y <= NSMinY(bbox)) { - if (p.y >= NSMinY(bbox) - handle_size) { - float northHandleLeft = tbHandleLeft(bbox); - if (p.x >= northHandleLeft && p.x <= (northHandleLeft + handle_size)) { - return NorthHandle; - } - } - } - return NoHandle; -} - -- (NSRect) boundingBoxResizeHandleRect:(ResizeHandle)handle { - Graph *graph = [[renderer document] graph]; - if (![graph hasBoundingBox]) { - return NSZeroRect; - } - NSRect bbox = [self screenBoundingBox]; - float x; - float y; - switch (handle) { - case NorthEastHandle: - case EastHandle: - case SouthEastHandle: - x = NSMaxX(bbox); - break; - case NorthWestHandle: - case WestHandle: - case SouthWestHandle: - x = NSMinX(bbox) - handle_size; - break; - case SouthHandle: - case NorthHandle: - x = tbHandleLeft(bbox); - break; - default: - return NSZeroRect; - } - switch (handle) { - case EastHandle: - case WestHandle: - y = sideHandleTop(bbox); - break; - case SouthEastHandle: - case SouthHandle: - case SouthWestHandle: - y = NSMaxY(bbox); - break; - case NorthEastHandle: - case NorthHandle: - case NorthWestHandle: - y = NSMinY(bbox) - handle_size; - break; - default: - return NSZeroRect; - } - return NSMakeRect(x, y, handle_size, handle_size); -} - -- (void) setResizeCursorForHandle:(ResizeHandle)handle { - if (handle != currentResizeHandle) { - currentResizeHandle = handle; - Cursor c = NormalCursor; - switch (handle) { - case EastHandle: - c = ResizeRightCursor; - break; - case SouthEastHandle: - c = ResizeBottomRightCursor; - break; - case SouthHandle: - c = ResizeBottomCursor; - break; - case SouthWestHandle: - c = ResizeBottomLeftCursor; - break; - case WestHandle: - c = ResizeLeftCursor; - break; - case NorthWestHandle: - c = ResizeTopLeftCursor; - break; - case NorthHandle: - c = ResizeTopCursor; - break; - case NorthEastHandle: - c = ResizeTopRightCursor; - break; - default: - c = NormalCursor; - break; - } - [[renderer surface] setCursor:c]; - } -} -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/CairoRenderContext.h b/tikzit-old/src/gtk/CairoRenderContext.h deleted file mode 100644 index ac9c5ee..0000000 --- a/tikzit-old/src/gtk/CairoRenderContext.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "RenderContext.h" -#import "Transformer.h" -#import -#import -#import - -@interface PangoTextLayout: NSObject { - PangoLayout *layout; - cairo_t *context; -} - -+ (PangoTextLayout*) layoutForContext:(cairo_t*)cr withFontSize:(CGFloat)fontSize; -- (id) initWithContext:(cairo_t*)cr fontSize:(CGFloat)fontSize; -- (void) setText:(NSString*)text; - -@end - -@interface CairoRenderContext: NSObject { - cairo_t *context; -} - -+ (CairoRenderContext*) contextForSurface:(cairo_surface_t*)surface; -- (id) initForSurface:(cairo_surface_t*)surface; - -+ (CairoRenderContext*) contextForWidget:(GtkWidget*)widget; -- (id) initForWidget:(GtkWidget*)widget; - -+ (CairoRenderContext*) contextForDrawable:(GdkDrawable*)d; -- (id) initForDrawable:(GdkDrawable*)d; - -+ (CairoRenderContext*) contextForPixbuf:(GdkPixbuf*)buf; -- (id) initForPixbuf:(GdkPixbuf*)buf; - -- (cairo_t*) cairoContext; -- (void) applyTransform:(Transformer*)transformer; - -- (void) clearSurface; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/CairoRenderContext.m b/tikzit-old/src/gtk/CairoRenderContext.m deleted file mode 100644 index 77e10b5..0000000 --- a/tikzit-old/src/gtk/CairoRenderContext.m +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "CairoRenderContext.h" - -#import "cairo_helpers.h" -#import "util.h" - -#import - -@implementation PangoTextLayout - -- (id) init { - [self release]; - return nil; -} - -+ (PangoTextLayout*) layoutForContext:(cairo_t*)cr withFontSize:(CGFloat)fontSize { - return [[[self alloc] initWithContext:cr fontSize:fontSize] autorelease]; -} - -- (id) initWithContext:(cairo_t*)cr fontSize:(CGFloat)fontSize { - self = [super init]; - - if (self) { - cairo_reference (cr); - context = cr; - layout = pango_cairo_create_layout (cr); - - PangoFontDescription *font_desc = pango_font_description_new (); - pango_font_description_set_family_static (font_desc, "Sans"); - pango_font_description_set_size (font_desc, pango_units_from_double (fontSize)); - pango_layout_set_font_description (layout, font_desc); - pango_font_description_free (font_desc); - } - - return self; -} - -- (void) setText:(NSString*)text { - pango_layout_set_text (layout, [text UTF8String], -1); -} - -- (NSSize) size { - int width, height; - pango_layout_get_size (layout, &width, &height); - return NSMakeSize (pango_units_to_double (width), pango_units_to_double (height)); -} - -- (NSString*) text { - return [NSString stringWithUTF8String:pango_layout_get_text (layout)]; -} - -- (void) showTextAt:(NSPoint)topLeft withColor:(RColor)color { - cairo_save (context); - - cairo_move_to(context, topLeft.x, topLeft.y); - cairo_set_source_rcolor (context, color); - pango_cairo_show_layout (context, layout); - - cairo_restore (context); -} - -- (void) dealloc { - if (layout) - g_object_unref (G_OBJECT (layout)); - if (context) - cairo_destroy (context); - - [super dealloc]; -} - -@end - -@implementation CairoRenderContext - -- (id) init { - [self release]; - return nil; -} - -+ (CairoRenderContext*) contextForSurface:(cairo_surface_t*)surface { - return [[[self alloc] initForSurface:surface] autorelease]; -} - -- (id) initForSurface:(cairo_surface_t*)surface { - self = [super init]; - - if (self) { - context = cairo_create (surface); - } - - return self; -} - -+ (CairoRenderContext*) contextForWidget:(GtkWidget*)widget { - return [[[self alloc] initForWidget:widget] autorelease]; -} - -- (id) initForWidget:(GtkWidget*)widget { - self = [super init]; - - if (self) { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - context = gdk_cairo_create (window); - } else { - [self release]; - self = nil; - } - } - - return self; -} - -+ (CairoRenderContext*) contextForDrawable:(GdkDrawable*)d { - return [[[self alloc] initForDrawable:d] autorelease]; -} - -- (id) initForDrawable:(GdkDrawable*)d { - self = [super init]; - - if (self) { - context = gdk_cairo_create (d); - } - - return self; -} - -+ (CairoRenderContext*) contextForPixbuf:(GdkPixbuf*)pixbuf { - return [[[self alloc] initForPixbuf:pixbuf] autorelease]; -} - -- (id) initForPixbuf:(GdkPixbuf*)pixbuf { - self = [super init]; - - if (self) { - cairo_format_t format = -1; - - if (gdk_pixbuf_get_colorspace (pixbuf) != GDK_COLORSPACE_RGB) { - NSLog(@"Unsupported colorspace (must be RGB)"); - [self release]; - return nil; - } - if (gdk_pixbuf_get_bits_per_sample (pixbuf) != 8) { - NSLog(@"Unsupported bits per sample (must be 8)"); - [self release]; - return nil; - } - if (gdk_pixbuf_get_has_alpha (pixbuf)) { - if (gdk_pixbuf_get_n_channels (pixbuf) != 4) { - NSLog(@"Unsupported bits per sample (must be 4 for an image with alpha)"); - [self release]; - return nil; - } - format = CAIRO_FORMAT_ARGB32; - } else { - if (gdk_pixbuf_get_n_channels (pixbuf) != 3) { - NSLog(@"Unsupported bits per sample (must be 3 for an image without alpha)"); - [self release]; - return nil; - } - format = CAIRO_FORMAT_RGB24; - } - - cairo_surface_t *surface = cairo_image_surface_create_for_data( - gdk_pixbuf_get_pixels(pixbuf), - format, - gdk_pixbuf_get_width(pixbuf), - gdk_pixbuf_get_height(pixbuf), - gdk_pixbuf_get_rowstride(pixbuf)); - context = cairo_create (surface); - cairo_surface_destroy (surface); - } - - return self; -} - -- (cairo_t*) cairoContext { - return context; -} - -- (void) applyTransform:(Transformer*)transformer { - NSPoint origin = [transformer toScreen:NSZeroPoint]; - cairo_translate (context, origin.x, origin.y); - NSPoint scale = [transformer toScreen:NSMakePoint (1.0f, 1.0f)]; - scale.x -= origin.x; - scale.y -= origin.y; - cairo_scale (context, scale.x, scale.y); -} - -- (void) saveState { - cairo_save (context); -} - -- (void) restoreState { - cairo_restore (context); -} - -- (NSRect) clipBoundingBox { - double clipx1, clipx2, clipy1, clipy2; - cairo_clip_extents (context, &clipx1, &clipy1, &clipx2, &clipy2); - return NSMakeRect (clipx1, clipy1, clipx2-clipx1, clipy2-clipy1); -} - -- (BOOL) strokeIncludesPoint:(NSPoint)p { - return cairo_in_stroke (context, p.x, p.y); -} - -- (BOOL) fillIncludesPoint:(NSPoint)p { - return cairo_in_fill (context, p.x, p.y); -} - -- (id) layoutText:(NSString*)text withSize:(CGFloat)fontSize { - PangoTextLayout *layout = [PangoTextLayout layoutForContext:context withFontSize:fontSize]; - [layout setText:text]; - return layout; -} - -- (void) setAntialiasMode:(AntialiasMode)mode { - if (mode == AntialiasDisabled) { - cairo_set_antialias (context, CAIRO_ANTIALIAS_NONE); - } else { - cairo_set_antialias (context, CAIRO_ANTIALIAS_DEFAULT); - } -} - -- (void) setLineWidth:(CGFloat)width { - cairo_set_line_width (context, width); -} - -- (void) setLineDash:(CGFloat)dashLength { - if (dashLength <= 0.0) { - cairo_set_dash (context, NULL, 0, 0); - } else { - double dashes[] = { dashLength }; - cairo_set_dash (context, dashes, 1, 0); - } -} - -// paths -- (void) startPath { - cairo_new_path (context); -} - -- (void) closeSubPath { - cairo_close_path (context); -} - -- (void) moveTo:(NSPoint)p { - cairo_move_to(context, p.x, p.y); -} - -- (void) curveTo:(NSPoint)end withCp1:(NSPoint)cp1 andCp2:(NSPoint)cp2 { - cairo_curve_to (context, cp1.x, cp1.y, cp2.x, cp2.y, end.x, end.y); -} - -- (void) lineTo:(NSPoint)end { - cairo_line_to (context, end.x, end.y); -} - -- (void) rect:(NSRect)rect { - cairo_rectangle (context, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); -} - -- (void) circleAt:(NSPoint)c withRadius:(CGFloat)r { - cairo_new_sub_path (context); - cairo_arc (context, c.x, c.y, r, 0, 2 * M_PI); -} - -- (void) strokePathWithColor:(RColor)color { - cairo_set_source_rcolor (context, color); - cairo_stroke (context); -} - -- (void) fillPathWithColor:(RColor)color { - cairo_set_source_rcolor (context, color); - cairo_fill (context); -} - -- (void) strokePathWithColor:(RColor)scolor - andFillWithColor:(RColor)fcolor { - cairo_set_source_rcolor (context, fcolor); - cairo_fill_preserve (context); - cairo_set_source_rcolor (context, scolor); - cairo_stroke (context); -} - -- (void) strokePathWithColor:(RColor)scolor - andFillWithColor:(RColor)fcolor - usingAlpha:(CGFloat)alpha { - cairo_push_group (context); - cairo_set_source_rcolor (context, fcolor); - cairo_fill_preserve (context); - cairo_set_source_rcolor (context, scolor); - cairo_stroke (context); - cairo_pop_group_to_source (context); - cairo_paint_with_alpha (context, alpha); -} - -- (void) clipToPath { - cairo_clip (context); -} - -- (void) paintWithColor:(RColor)color { - cairo_set_source_rcolor (context, color); - cairo_paint (context); -} - -- (void) clearSurface { - cairo_operator_t old_op = cairo_get_operator (context); - - cairo_set_operator (context, CAIRO_OPERATOR_SOURCE); - cairo_set_source_rgba (context, 0.0, 0.0, 0.0, 0.0); - cairo_paint (context); - - cairo_set_operator (context, old_op); -} - -- (void) dealloc { - if (context) { - cairo_destroy (context); - } - - [super dealloc]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/ColorRGB+Gtk.h b/tikzit-old/src/gtk/ColorRGB+Gtk.h deleted file mode 100644 index 5cfb4d7..0000000 --- a/tikzit-old/src/gtk/ColorRGB+Gtk.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "ColorRGB.h" -#import - -@interface ColorRGB (Gtk) - -+ (ColorRGB*) colorWithGdkColor:(GdkColor)color; -- (id) initWithGdkColor:(GdkColor)color; -- (GdkColor) gdkColor; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/ColorRGB+Gtk.m b/tikzit-old/src/gtk/ColorRGB+Gtk.m deleted file mode 100644 index be5dd56..0000000 --- a/tikzit-old/src/gtk/ColorRGB+Gtk.m +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "ColorRGB+Gtk.h" - -// 257 = 65535/255 -// GdkColor values run from 0 to 65535, not from 0 to 255 -#define GDK_FACTOR 257 - -@implementation ColorRGB (Gtk) - -+ (ColorRGB*) colorWithGdkColor:(GdkColor)color { - return [ColorRGB colorWithRed:color.red/GDK_FACTOR green:color.green/GDK_FACTOR blue:color.blue/GDK_FACTOR]; -} - -- (id) initWithGdkColor:(GdkColor)color { - return [self initWithRed:color.red/GDK_FACTOR green:color.green/GDK_FACTOR blue:color.blue/GDK_FACTOR]; -} - -- (GdkColor) gdkColor { - GdkColor color; - color.pixel = 0; - color.red = GDK_FACTOR * [self red]; - color.green = GDK_FACTOR * [self green]; - color.blue = GDK_FACTOR * [self blue]; - return color; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/ColorRGB+IntegerListStorage.h b/tikzit-old/src/gtk/ColorRGB+IntegerListStorage.h deleted file mode 100644 index 118eaee..0000000 --- a/tikzit-old/src/gtk/ColorRGB+IntegerListStorage.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "ColorRGB.h" - -/** - * Stores a ColorRGB as a list of short integers - */ -@interface ColorRGB (IntegerListStorage) - -+ (ColorRGB*) colorFromValueList:(NSArray*)values; -- (id) initFromValueList:(NSArray*)values; -- (NSArray*) valueList; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/ColorRGB+IntegerListStorage.m b/tikzit-old/src/gtk/ColorRGB+IntegerListStorage.m deleted file mode 100644 index 0103a3c..0000000 --- a/tikzit-old/src/gtk/ColorRGB+IntegerListStorage.m +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "ColorRGB+IntegerListStorage.h" - -@implementation ColorRGB (IntegerListStorage) - -+ (ColorRGB*) colorFromValueList:(NSArray*)values { - if ([values count] != 3) { - return nil; - } - - unsigned short redValue = [[values objectAtIndex:0] intValue]; - unsigned short greenValue = [[values objectAtIndex:1] intValue]; - unsigned short blueValue = [[values objectAtIndex:2] intValue]; - return [ColorRGB colorWithRed:redValue green:greenValue blue:blueValue]; -} - -- (id) initFromValueList:(NSArray*)values { - if ([values count] != 3) { - [self release]; - return nil; - } - - unsigned short redValue = [[values objectAtIndex:0] intValue]; - unsigned short greenValue = [[values objectAtIndex:1] intValue]; - unsigned short blueValue = [[values objectAtIndex:2] intValue]; - - return [self initWithRed:redValue green:greenValue blue:blueValue]; -} - -- (NSArray*) valueList { - NSMutableArray *array = [NSMutableArray arrayWithCapacity:3]; - [array addObject:[NSNumber numberWithInt:[self red]]]; - [array addObject:[NSNumber numberWithInt:[self green]]]; - [array addObject:[NSNumber numberWithInt:[self blue]]]; - return array; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Configuration.h b/tikzit-old/src/gtk/Configuration.h deleted file mode 100644 index 6c68681..0000000 --- a/tikzit-old/src/gtk/Configuration.h +++ /dev/null @@ -1,447 +0,0 @@ -// -// Configuration.h -// TikZiT -// -// Copyright 2010 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TZFoundation.h" - -/** - * Manages configuration information in a grouped key-value format. - */ -@interface Configuration : NSObject { - NSString *name; - GKeyFile *file; -} - -/** - * Check whether there is any existing configuration. - */ -+ (BOOL) configurationExistsWithName:(NSString*)name; -/** - * Create a blank configuration with the given name, without loading - * any existing configuration information. - * - * @param name the name of the configuration - */ -+ (Configuration*) emptyConfigurationWithName:(NSString*)name; -/** - * Load an existing configuration for the given name. - * - * If there was no existing configuration, or it could not be opened, - * an empty configuration will be returned. - * - * @param name the name of the configuration - */ -+ (Configuration*) configurationWithName:(NSString*)name; -/** - * Load an existing configuration for the given name. - * - * If there was no existing configuration, or it could not be opened, - * an empty configuration will be returned. - * - * @param name the name of the configuration - * @param error this will be set if the configuration exists, but could - * not be opened. - */ -+ (Configuration*) configurationWithName:(NSString*)name loadError:(NSError**)error; - -/** - * Initialise the configuration to be empty - * - * Does not attempt to load any existing configuration data. - * - * @param name the name of the configuration - */ -- (id) initEmptyWithName:(NSString*)name; -/** - * Initialise a configuration, loading it if it had previously been stored. - * - * If there was no existing configuration, or it could not be opened, - * an empty configuration will be returned. - * - * @param name the name of the configuration - */ -- (id) initWithName:(NSString*)name; -/** - * Initialise a configuration, loading it if it had previously been stored. - * - * If there was no existing configuration, or it could not be opened, - * an empty configuration will be returned. - * - * @param name the name of the configuration - * @param error this will be set if the configuration exists, but could - * not be opened. - */ -- (id) initWithName:(NSString*)name loadError:(NSError**)error; - -/** - * The name of the configuration. - * - * Configurations with different names are stored independently. - */ -- (NSString*) name; -/** - * Set the name of the configuration. - * - * This will affect the behaviour of [-writeToStore] - * - * Configurations with different names are stored independently. - */ -- (void) setName:(NSString*)name; - -/** - * Writes the configuration to the backing store. - * - * The location the configuration is written to is determined by the - * [-name] property. - * - * @result YES if the configuration was successfully written, NO otherwise - */ -- (BOOL) writeToStore; -/** - * Writes the configuration to the backing store. - * - * The location the configuration is written to is determined by the - * [-name] property. - * - * @param error this will be set if the configuration could not be written - * to the backing store - * @result YES if the configuration was successfully written, NO otherwise - */ -- (BOOL) writeToStoreWithError:(NSError**)error; - -/** - * Check whether a particular key exists within a group - * - * @param key the key to check for - * @param group the name of the group to look in - * @result YES if the key exists, NO otherwise - */ -- (BOOL) hasKey:(NSString*)key inGroup:(NSString*)group; -/** - * Check whether a particular group exists - * - * @param group the name of the group to check for - * @result YES if the group exists, NO otherwise - */ -- (BOOL) hasGroup:(NSString*)group; -/** - * List the groups in the configuration. - * - * @result a list of group names - */ -- (NSArray*) groups; - -/** - * Get the value associated with a key as a string - * - * This is only guaranteed to work if the value was stored as a string. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a string, or nil - * if no string value was associated with key - */ -- (NSString*) stringEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a string - * - * This is only guaranteed to work if the value was stored as a string. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no string value was associated with key - * @result the value associated with key as a string, or default - */ -- (NSString*) stringEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSString*)def; -/** - * Get the value associated with a key as a boolean - * - * This is only guaranteed to work if the value was stored as a boolean. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a boolean, or NO - * if no boolean value was associated with key - */ -- (BOOL) booleanEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a boolean - * - * This is only guaranteed to work if the value was stored as a boolean. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no boolean value was associated with key - * @result the value associated with key as a boolean, or def - */ -- (BOOL) booleanEntry:(NSString*)key inGroup:(NSString*)group withDefault:(BOOL)def; -/** - * Get the value associated with a key as a integer - * - * This is only guaranteed to work if the value was stored as a integer. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a integer, or 0 - * if no integer value was associated with key - */ -- (int) integerEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a integer - * - * This is only guaranteed to work if the value was stored as a integer. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no integer value was associated with key - * @result the value associated with key as a integer, or def - */ -- (int) integerEntry:(NSString*)key inGroup:(NSString*)group withDefault:(int)def; -/** - * Get the value associated with a key as a double - * - * This is only guaranteed to work if the value was stored as a double. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a double, or 0 - * if no double value was associated with key - */ -- (double) doubleEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a double - * - * This is only guaranteed to work if the value was stored as a double. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no double value was associated with key - * @result the value associated with key as a double, or def - */ -- (double) doubleEntry:(NSString*)key inGroup:(NSString*)group withDefault:(double)def; - -/** - * Get the value associated with a key as a list of strings - * - * This is only guaranteed to work if the value was stored as a - * list of strings. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a list of strings, - * or nil if no list of strings was associated with key - */ -- (NSArray*) stringListEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a list of strings - * - * This is only guaranteed to work if the value was stored as a - * list of strings. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no string list value was associated with key - * @result the value associated with key as a list of strings, or def - */ -- (NSArray*) stringListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def; -/** - * Get the value associated with a key as a list of booleans - * - * This is only guaranteed to work if the value was stored as a - * list of booleans. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a list of NSNumber - * objects, containing boolean values, or nil - */ -- (NSArray*) booleanListEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a list of booleans - * - * This is only guaranteed to work if the value was stored as a - * list of booleans. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no boolean list value was associated with key - * @result the value associated with key as a list of NSNumber - * objects, containing boolean values, or def - */ -- (NSArray*) booleanListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def; -/** - * Get the value associated with a key as a list of integers - * - * This is only guaranteed to work if the value was stored as a - * list of integers. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a list of NSNumber - * objects, containing integer values, or nil - */ -- (NSArray*) integerListEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a list of integers - * - * This is only guaranteed to work if the value was stored as a - * list of integers. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no integer list value was associated with key - * @result the value associated with key as a list of NSNumber - * objects, containing integer values, or def - */ -- (NSArray*) integerListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def; -/** - * Get the value associated with a key as a list of doubles - * - * This is only guaranteed to work if the value was stored as a - * list of doubles. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @result the value associated with key as a list of NSNumber - * objects, containing double values, or nil - */ -- (NSArray*) doubleListEntry:(NSString*)key inGroup:(NSString*)group; -/** - * Get the value associated with a key as a list of doubles - * - * This is only guaranteed to work if the value was stored as a - * list of doubles. - * - * @param key the key to fetch the data for - * @param group the name of the group to look in - * @param def the value to return if no double list value was associated with key - * @result the value associated with key as a list of NSNumber - * objects, containing double values, or def - */ -- (NSArray*) doubleListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def; - -/** - * Associate a string value with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the value with - * @param group the group to store the association in - * @param value the value to store - */ -- (void) setStringEntry:(NSString*)key inGroup:(NSString*)group value:(NSString*)value; -/** - * Associate a boolean value with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the value with - * @param group the group to store the association in - * @param value the value to store - */ -- (void) setBooleanEntry:(NSString*)key inGroup:(NSString*)group value:(BOOL)value; -/** - * Associate a integer value with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the value with - * @param group the group to store the association in - * @param value the value to store - */ -- (void) setIntegerEntry:(NSString*)key inGroup:(NSString*)group value:(int)value; -/** - * Associate a double value with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the value with - * @param group the group to store the association in - * @param value the value to store - */ -- (void) setDoubleEntry:(NSString*)key inGroup:(NSString*)group value:(double)value; - -/** - * Associate a list of string values with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the list with - * @param group the group to store the association in - * @param value the list to store, as an array of strings - */ -- (void) setStringListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; -/** - * Associate a list of boolean values with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the list with - * @param group the group to store the association in - * @param value the list to store, as an array of NSNumber objects - */ -- (void) setBooleanListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; -/** - * Associate a list of integer values with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the list with - * @param group the group to store the association in - * @param value the list to store, as an array of NSNumber objects - */ -- (void) setIntegerListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; -/** - * Associate a list of double values with a key. - * - * Any previous value (of any type) with the same key and group will - * be overwritten. - * - * @param key the key to associate the list with - * @param group the group to store the association in - * @param value the list to store, as an array of NSNumber objects - */ -- (void) setDoubleListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; - -/** - * Remove a group from the configuration - * - * This will remove all the groups key-value associations. - */ -- (void) removeGroup:(NSString*)group; -/** - * Remove a key from the configuration - * - * @param key the key to remove - * @param group the group to remove it from - */ -- (void) removeKey:(NSString*)key inGroup:(NSString*)group; - -@end - -// vim:ft=objc:sts=4:sw=4:et diff --git a/tikzit-old/src/gtk/Configuration.m b/tikzit-old/src/gtk/Configuration.m deleted file mode 100644 index 4a3ed79..0000000 --- a/tikzit-old/src/gtk/Configuration.m +++ /dev/null @@ -1,450 +0,0 @@ -// -// Configuration.h -// TikZiT -// -// Copyright 2010 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Configuration.h" -#import "SupportDir.h" - -@implementation Configuration - -+ (NSString*) _pathFromName:(NSString*)name { - return [NSString stringWithFormat:@"%@/%@.conf", [SupportDir userSupportDir], name]; -} - -+ (BOOL) configurationExistsWithName:(NSString*)name { - BOOL isDir; - BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:[self _pathFromName:name] isDirectory:&isDir]; - return exists && !isDir; -} - -+ (Configuration*) emptyConfigurationWithName:(NSString*)name - { return [[[self alloc] initEmptyWithName:name] autorelease]; } -+ (Configuration*) configurationWithName:(NSString*)name - { return [[[self alloc] initWithName:name] autorelease]; } -+ (Configuration*) configurationWithName:(NSString*)name loadError:(NSError**)error - { return [[[self alloc] initWithName:name loadError:error] autorelease]; } - -- (id) init -{ - [self release]; - return nil; -} - -- (id) initEmptyWithName:(NSString*)n -{ - self = [super init]; - if (self) { - name = [n retain]; - file = g_key_file_new (); - } - - return self; -} - -- (id) _initFromFile:(NSString*)path error:(NSError**)error -{ - self = [super init]; - if (self) { - file = g_key_file_new (); - - NSFileManager *manager = [NSFileManager defaultManager]; - if ([manager fileExistsAtPath:path]) { - gchar *filename = [path glibFilename]; - - GError *gerror = NULL; - g_key_file_load_from_file (file, - filename, - G_KEY_FILE_NONE, - &gerror); - g_free (filename); - - if (gerror) { - GErrorToNSError (gerror, error); - g_error_free (gerror); - } - } - } - - return self; -} - -- (id) initWithName:(NSString*)n { - return [self initWithName:n loadError:NULL]; -} - -- (id) initWithName:(NSString*)n loadError:(NSError**)error { - self = [self _initFromFile:[Configuration _pathFromName:n] error:error]; - - if (self) { - name = [n retain]; - } - - return self; -} - -- (BOOL) _ensureParentExists:(NSString*)path error:(NSError**)error { - NSString *directory = [path stringByDeletingLastPathComponent]; - return [[NSFileManager defaultManager] ensureDirectoryExists:directory error:error]; -} - -- (BOOL) _writeFileTo:(NSString*)path error:(NSError**)error -{ - if (![self _ensureParentExists:path error:error]) { - return NO; - } - - BOOL success = NO; - gsize length; - gchar *data = g_key_file_to_data (file, &length, NULL); // never reports an error - if (data && length) { - GError *gerror = NULL; - gchar* nativePath = [path glibFilename]; - success = g_file_set_contents (nativePath, data, length, &gerror) ? YES : NO; - g_free (data); - g_free (nativePath); - if (gerror) { - g_warning ("Failed to write file: %s\n", gerror->message); - GErrorToNSError (gerror, error); - g_error_free (gerror); - } - } else { - [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; - success = YES; - } - - return success; -} - -- (NSString*) name { - return name; -} - -- (void) setName:(NSString*)n { - [n retain]; - [name release]; - name = n; -} - -- (BOOL) writeToStore { - return [self writeToStoreWithError:NULL]; -} - -- (BOOL) writeToStoreWithError:(NSError**)error { - return [self _writeFileTo:[Configuration _pathFromName:name] error:error]; -} - -- (BOOL) hasKey:(NSString*)key inGroup:(NSString*)group -{ - gboolean result = g_key_file_has_key (file, [group UTF8String], [key UTF8String], NULL); - return result ? YES : NO; -} - -- (BOOL) hasGroup:(NSString*)group -{ - gboolean result = g_key_file_has_group (file, [group UTF8String]); - return result ? YES : NO; -} - -- (NSArray*) keys:(NSString*)group -{ - gsize length; - gchar **keys = g_key_file_get_keys (file, [group UTF8String], &length, NULL); - if (!keys) - length = 0; - - NSMutableArray *array = [NSMutableArray arrayWithCapacity:length]; - for (int i = 0; i < length; ++i) { - [array addObject:[NSString stringWithUTF8String:keys[i]]]; - } - g_strfreev (keys); - return array; -} - -- (NSArray*) groups -{ - gsize length; - gchar **groups = g_key_file_get_groups (file, &length); - NSMutableArray *array = [NSMutableArray arrayWithCapacity:length]; - for (int i = 0; i < length; ++i) { - [array addObject:[NSString stringWithUTF8String:groups[i]]]; - } - g_strfreev (groups); - return array; -} - -- (NSString*) stringEntry:(NSString*)key inGroup:(NSString*)group -{ - return [self stringEntry:key inGroup:group withDefault:nil]; -} - -- (NSString*) stringEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSString*)def -{ - NSString *result = def; - gchar *entry = g_key_file_get_string (file, [group UTF8String], [key UTF8String], NULL); - if (entry) { - result = [NSString stringWithUTF8String:entry]; - g_free (entry); - } - return result; -} - -- (BOOL) booleanEntry:(NSString*)key inGroup:(NSString*)group withDefault:(BOOL)def -{ - GError *error = NULL; - gboolean result = g_key_file_get_boolean (file, [group UTF8String], [key UTF8String], &error); - if (error != NULL) { - g_error_free (error); - return def; - } else { - return result ? YES : NO; - } -} - -- (BOOL) booleanEntry:(NSString*)key inGroup:(NSString*)group -{ - gboolean result = g_key_file_get_boolean (file, [group UTF8String], [key UTF8String], NULL); - return result ? YES : NO; -} - -- (int) integerEntry:(NSString*)key inGroup:(NSString*)group withDefault:(int)def -{ - GError *error = NULL; - int result = g_key_file_get_integer (file, [group UTF8String], [key UTF8String], &error); - if (error != NULL) { - g_error_free (error); - return def; - } else { - return result; - } -} - -- (int) integerEntry:(NSString*)key inGroup:(NSString*)group -{ - return g_key_file_get_integer (file, [group UTF8String], [key UTF8String], NULL); -} - -- (double) doubleEntry:(NSString*)key inGroup:(NSString*)group withDefault:(double)def -{ - GError *error = NULL; - double result = g_key_file_get_double (file, [group UTF8String], [key UTF8String], &error); - if (error != NULL) { - g_error_free (error); - return def; - } else { - return result; - } -} - -- (double) doubleEntry:(NSString*)key inGroup:(NSString*)group -{ - return g_key_file_get_double (file, [group UTF8String], [key UTF8String], NULL); -} - -- (NSArray*) stringListEntry:(NSString*)key inGroup:(NSString*)group -{ - return [self stringListEntry:key inGroup:group withDefault:nil]; -} - -- (NSArray*) stringListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def -{ - gsize length; - gchar **list = g_key_file_get_string_list (file, [group UTF8String], [key UTF8String], &length, NULL); - if (list) { - NSMutableArray *result = [NSMutableArray arrayWithCapacity:length]; - for (int i = 0; i < length; ++i) { - [result addObject:[NSString stringWithUTF8String:list[i]]]; - } - g_strfreev (list); - return result; - } else { - return def; - } -} - -- (NSArray*) booleanListEntry:(NSString*)key inGroup:(NSString*)group -{ - return [self booleanListEntry:key inGroup:group withDefault:nil]; -} - -- (NSArray*) booleanListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def -{ - gsize length; - gboolean *list = g_key_file_get_boolean_list (file, [group UTF8String], [key UTF8String], &length, NULL); - if (list) { - NSMutableArray *result = [NSMutableArray arrayWithCapacity:length]; - for (int i = 0; i < length; ++i) { - [result addObject:[NSNumber numberWithBool:list[i]]]; - } - g_free (list); - return result; - } else { - return def; - } -} - -- (NSArray*) integerListEntry:(NSString*)key inGroup:(NSString*)group -{ - return [self integerListEntry:key inGroup:group withDefault:nil]; -} - -- (NSArray*) integerListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def -{ - gsize length; - gint *list = g_key_file_get_integer_list (file, [group UTF8String], [key UTF8String], &length, NULL); - if (list) { - NSMutableArray *result = [NSMutableArray arrayWithCapacity:length]; - for (int i = 0; i < length; ++i) { - [result addObject:[NSNumber numberWithInt:list[i]]]; - } - g_free (list); - return result; - } else { - return def; - } -} - -- (NSArray*) doubleListEntry:(NSString*)key inGroup:(NSString*)group -{ - return [self doubleListEntry:key inGroup:group withDefault:nil]; -} - -- (NSArray*) doubleListEntry:(NSString*)key inGroup:(NSString*)group withDefault:(NSArray*)def -{ - gsize length; - double *list = g_key_file_get_double_list (file, [group UTF8String], [key UTF8String], &length, NULL); - if (list) { - NSMutableArray *result = [NSMutableArray arrayWithCapacity:length]; - for (int i = 0; i < length; ++i) { - [result addObject:[NSNumber numberWithDouble:list[i]]]; - } - g_free (list); - return result; - } else { - return def; - } -} - -- (void) setStringEntry:(NSString*)key inGroup:(NSString*)group value:(NSString*)value -{ - if (value == nil) { - [self removeKey:key inGroup:group]; - return; - } - g_key_file_set_string (file, [group UTF8String], [key UTF8String], [value UTF8String]); -} - -- (void) setBooleanEntry:(NSString*)key inGroup:(NSString*)group value:(BOOL)value; -{ - g_key_file_set_boolean (file, [group UTF8String], [key UTF8String], value); -} - -- (void) setIntegerEntry:(NSString*)key inGroup:(NSString*)group value:(int)value; -{ - g_key_file_set_integer (file, [group UTF8String], [key UTF8String], value); -} - -- (void) setDoubleEntry:(NSString*)key inGroup:(NSString*)group value:(double)value; -{ - g_key_file_set_double (file, [group UTF8String], [key UTF8String], value); -} - - -- (void) setStringListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value -{ - if (value == nil) { - [self removeKey:key inGroup:group]; - return; - } - gsize length = [value count]; - const gchar * *list = g_new (const gchar *, length); - for (int i = 0; i < length; ++i) { - list[i] = [[value objectAtIndex:i] UTF8String]; - } - g_key_file_set_string_list (file, [group UTF8String], [key UTF8String], list, length); - g_free (list); -} - -- (void) setBooleanListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; -{ - if (value == nil) { - [self removeKey:key inGroup:group]; - return; - } - gsize length = [value count]; - gboolean *list = g_new (gboolean, length); - for (int i = 0; i < length; ++i) { - list[i] = [[value objectAtIndex:i] boolValue]; - } - g_key_file_set_boolean_list (file, [group UTF8String], [key UTF8String], list, length); - g_free (list); -} - -- (void) setIntegerListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; -{ - if (value == nil) { - [self removeKey:key inGroup:group]; - return; - } - gsize length = [value count]; - gint *list = g_new (gint, length); - for (int i = 0; i < length; ++i) { - list[i] = [[value objectAtIndex:i] intValue]; - } - g_key_file_set_integer_list (file, [group UTF8String], [key UTF8String], list, length); - g_free (list); -} - -- (void) setDoubleListEntry:(NSString*)key inGroup:(NSString*)group value:(NSArray*)value; -{ - if (value == nil) { - [self removeKey:key inGroup:group]; - return; - } - gsize length = [value count]; - gdouble *list = g_new (gdouble, length); - for (int i = 0; i < length; ++i) { - list[i] = [[value objectAtIndex:i] doubleValue]; - } - g_key_file_set_double_list (file, [group UTF8String], [key UTF8String], list, length); - g_free (list); -} - -- (void) removeGroup:(NSString*)group -{ - g_key_file_remove_group (file, [group UTF8String], NULL); -} - -- (void) removeKey:(NSString*)key inGroup:(NSString*)group; -{ - g_key_file_remove_key (file, [group UTF8String], [key UTF8String], NULL); -} - -- (void) dealloc -{ - [name release]; - g_key_file_free (file); - file = NULL; - [super dealloc]; -} - -@end - -// vim:ft=objc:sts=4:sw=4:et diff --git a/tikzit-old/src/gtk/ContextWindow.h b/tikzit-old/src/gtk/ContextWindow.h deleted file mode 100644 index fcad9df..0000000 --- a/tikzit-old/src/gtk/ContextWindow.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Configuration; -@class EdgeStylesModel; -@class NodeStylesModel; -@class PropertiesPane; -@class SelectionPane; -@class StyleManager; -@class TikzDocument; -@class Window; - -@interface ContextWindow: NSObject { - PropertiesPane *propsPane; - SelectionPane *selPane; - - GtkWidget *window; - GtkWidget *layout; -} - -@property (retain) TikzDocument *document; -@property (assign) BOOL visible; - -- (id) initWithStyleManager:(StyleManager*)mgr; -- (id) initWithNodeStylesModel:(NodeStylesModel*)nsm - andEdgeStylesModel:(EdgeStylesModel*)esm; - -- (void) present; -- (void) attachToWindow:(Window*)parent; - -- (void) loadConfiguration:(Configuration*)config; -- (void) saveConfiguration:(Configuration*)config; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/ContextWindow.m b/tikzit-old/src/gtk/ContextWindow.m deleted file mode 100644 index d8e9d20..0000000 --- a/tikzit-old/src/gtk/ContextWindow.m +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "ContextWindow.h" - -#import "Configuration.h" -#import "EdgeStylesModel.h" -#import "NodeStylesModel.h" -#import "PropertiesPane.h" -#import "SelectionPane.h" -#import "StyleManager.h" -#import "Window.h" - -#import "gtkhelpers.h" - -static gboolean props_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, ContextWindow *window); - -@implementation ContextWindow - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)sm { - return [self initWithNodeStylesModel:[NodeStylesModel modelWithStyleManager:sm] - andEdgeStylesModel:[EdgeStylesModel modelWithStyleManager:sm]]; -} - -- (id) initWithNodeStylesModel:(NodeStylesModel*)nsm - andEdgeStylesModel:(EdgeStylesModel*)esm { - self = [super init]; - - if (self) { - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_object_ref_sink (window); - gtk_window_set_title (GTK_WINDOW (window), "Context"); - gtk_window_set_role (GTK_WINDOW (window), "context"); - gtk_window_set_type_hint (GTK_WINDOW (window), - GDK_WINDOW_TYPE_HINT_UTILITY); - gtk_window_set_default_size (GTK_WINDOW (window), 200, 500); - g_signal_connect (G_OBJECT (window), - "delete-event", - G_CALLBACK (props_window_delete_event_cb), - self); - - layout = gtk_vbox_new (FALSE, 3); - g_object_ref_sink (layout); - gtk_widget_show (layout); - gtk_container_set_border_width (GTK_CONTAINER (layout), 6); - - gtk_container_add (GTK_CONTAINER (window), layout); - - propsPane = [[PropertiesPane alloc] init]; - gtk_box_pack_start (GTK_BOX (layout), [propsPane gtkWidget], - TRUE, TRUE, 0); - - GtkWidget *sep = gtk_hseparator_new (); - gtk_widget_show (sep); - gtk_box_pack_start (GTK_BOX (layout), sep, - FALSE, FALSE, 0); - - selPane = [[SelectionPane alloc] initWithNodeStylesModel:nsm - andEdgeStylesModel:esm]; - gtk_box_pack_start (GTK_BOX (layout), [selPane gtkWidget], - FALSE, FALSE, 0); - - // hack to position the context window somewhere sensible - // (upper right) - gtk_window_parse_geometry (GTK_WINDOW (window), "-0+0"); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (layout); - g_object_unref (window); - - [propsPane release]; - - [super dealloc]; -} - -- (TikzDocument*) document { - return [propsPane document]; -} - -- (void) setDocument:(TikzDocument*)doc { - [propsPane setDocument:doc]; - [selPane setDocument:doc]; -} - -- (BOOL) visible { - return gtk_widget_get_visible (window); -} - -- (void) setVisible:(BOOL)visible { - gtk_widget_set_visible (window, visible); -} - -- (void) present { - gtk_window_present (GTK_WINDOW (window)); -} - -- (void) attachToWindow:(Window*)parent { - utility_window_attach (GTK_WINDOW (window), [parent gtkWindow]); -} - -- (void) loadConfiguration:(Configuration*)config { - [propsPane loadConfiguration:config]; - [selPane loadConfiguration:config]; - - if ([config hasGroup:@"ContextWindow"]) { - tz_restore_window (GTK_WINDOW (window), - [config integerEntry:@"x" inGroup:@"ContextWindow"], - [config integerEntry:@"y" inGroup:@"ContextWindow"], - [config integerEntry:@"w" inGroup:@"ContextWindow"], - [config integerEntry:@"h" inGroup:@"ContextWindow"]); - } - [self setVisible:[config booleanEntry:@"visible" - inGroup:@"ContextWindow" - withDefault:YES]]; -} - -- (void) saveConfiguration:(Configuration*)config { - gint x, y, w, h; - - gtk_window_get_position (GTK_WINDOW (window), &x, &y); - gtk_window_get_size (GTK_WINDOW (window), &w, &h); - - [config setIntegerEntry:@"x" inGroup:@"ContextWindow" value:x]; - [config setIntegerEntry:@"y" inGroup:@"ContextWindow" value:y]; - [config setIntegerEntry:@"w" inGroup:@"ContextWindow" value:w]; - [config setIntegerEntry:@"h" inGroup:@"ContextWindow" value:h]; - [config setBooleanEntry:@"visible" - inGroup:@"ContextWindow" - value:[self visible]]; - - [propsPane saveConfiguration:config]; - [selPane saveConfiguration:config]; -} - -@end - -static gboolean props_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, ContextWindow *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window setVisible:NO]; - [pool drain]; - return TRUE; -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/CreateEdgeTool.h b/tikzit-old/src/gtk/CreateEdgeTool.h deleted file mode 100644 index d33efce..0000000 --- a/tikzit-old/src/gtk/CreateEdgeTool.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Tool.h" - -@class EdgeStyle; -@class EdgeStylesModel; -@class EdgeStyleSelector; -@class Node; -@class StyleManager; - -@interface CreateEdgeTool : NSObject { - GraphRenderer *renderer; - EdgeStyleSelector *stylePicker; - GtkWidget *configWidget; - Node *sourceNode; - NSPoint sourceNodeScreenPoint; - NSPoint halfEdgeEnd; -} - -@property (retain) EdgeStyle *activeStyle; - -+ (id) toolWithStyleManager:(StyleManager*)sm; -- (id) initWithStyleManager:(StyleManager*)sm; -+ (id) toolWithEdgeStylesModel:(EdgeStylesModel*)esm; -- (id) initWithEdgeStylesModel:(EdgeStylesModel*)esm; -@end - - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/CreateEdgeTool.m b/tikzit-old/src/gtk/CreateEdgeTool.m deleted file mode 100644 index f3fb2c0..0000000 --- a/tikzit-old/src/gtk/CreateEdgeTool.m +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "CreateEdgeTool.h" - -#import "Configuration.h" -#import "EdgeStyleSelector.h" -#import "EdgeStylesModel.h" -#import "GraphRenderer.h" -#import "TikzDocument.h" -#import "tzstockitems.h" - -static void clear_style_button_cb (GtkButton *widget, - EdgeStyleSelector *selector); - -@implementation CreateEdgeTool -- (NSString*) name { return @"Create Edge"; } -- (const gchar*) stockId { return TIKZIT_STOCK_CREATE_EDGE; } -- (NSString*) helpText { return @"Create new edges"; } -- (NSString*) shortcut { return @"e"; } -@synthesize activeRenderer=renderer; -@synthesize configurationWidget=configWidget; - -+ (id) toolWithStyleManager:(StyleManager*)sm { - return [[[self alloc] initWithStyleManager:sm] autorelease]; -} - -+ (id) toolWithEdgeStylesModel:(EdgeStylesModel*)esm { - return [[[self alloc] initWithEdgeStylesModel:esm] autorelease]; -} - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)sm { - return [self initWithEdgeStylesModel:[EdgeStylesModel modelWithStyleManager:sm]]; -} - -- (id) initWithEdgeStylesModel:(EdgeStylesModel*)esm { - self = [super init]; - - if (self) { - stylePicker = [[EdgeStyleSelector alloc] initWithModel:esm]; - - configWidget = gtk_vbox_new (FALSE, 0); - g_object_ref_sink (configWidget); - - GtkWidget *label = gtk_label_new ("Edge style:"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (configWidget), - label, - FALSE, - FALSE, - 0); - - GtkWidget *selWindow = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (selWindow); - gtk_container_add (GTK_CONTAINER (selWindow), - [stylePicker widget]); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selWindow), - GTK_POLICY_NEVER, - GTK_POLICY_AUTOMATIC); - gtk_widget_show ([stylePicker widget]); - - GtkWidget *selectorFrame = gtk_frame_new (NULL); - gtk_widget_show (selectorFrame); - gtk_box_pack_start (GTK_BOX (configWidget), - selectorFrame, - TRUE, - TRUE, - 0); - gtk_container_add (GTK_CONTAINER (selectorFrame), - selWindow); - - GtkWidget *button = gtk_button_new_with_label ("No style"); - gtk_widget_show (button); - gtk_box_pack_start (GTK_BOX (configWidget), - button, - FALSE, - FALSE, - 0); - g_signal_connect (G_OBJECT (button), - "clicked", - G_CALLBACK (clear_style_button_cb), - stylePicker); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [renderer release]; - [stylePicker release]; - [sourceNode release]; - - g_object_unref (G_OBJECT (configWidget)); - - [super dealloc]; -} - -- (EdgeStyle*) activeStyle { - return [stylePicker selectedStyle]; -} - -- (void) setActiveStyle:(EdgeStyle*)style { - return [stylePicker setSelectedStyle:style]; -} - -- (void) invalidateHalfEdge { - NSRect invRect = NSRectAroundPoints(sourceNodeScreenPoint, halfEdgeEnd); - [renderer invalidateRect:NSInsetRect (invRect, -2.0f, -2.0f)]; -} - -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - sourceNode = [renderer anyNodeAt:pos]; - if (sourceNode != nil) { - Transformer *transformer = [[renderer surface] transformer]; - sourceNodeScreenPoint = [transformer toScreen:[sourceNode point]]; - halfEdgeEnd = pos; - [renderer setNode:sourceNode highlighted:YES]; - } -} - -- (void) mouseMoveTo:(NSPoint)pos withButtons:(MouseButton)buttons andMask:(InputMask)mask { - if (!(buttons & LeftButton)) - return; - if (sourceNode == nil) - return; - - [self invalidateHalfEdge]; - - [renderer clearHighlightedNodes]; - [renderer setNode:sourceNode highlighted:YES]; - halfEdgeEnd = pos; - Node *targ = [renderer anyNodeAt:pos]; - if (targ != nil) { - [renderer setNode:targ highlighted:YES]; - } - - [self invalidateHalfEdge]; -} - -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - if (sourceNode == nil) - return; - - [renderer clearHighlightedNodes]; - [self invalidateHalfEdge]; - - Node *targ = [renderer anyNodeAt:pos]; - if (targ != nil) { - Edge *edge = [Edge edgeWithSource:sourceNode andTarget:targ]; - [edge setStyle:[self activeStyle]]; - [[renderer document] addEdge:edge]; - [renderer invalidateEdge:edge]; - } - - sourceNode = nil; -} - -- (void) renderWithContext:(id)context onSurface:(id)surface { - if (sourceNode == nil) { - return; - } - [context saveState]; - - [context setLineWidth:1.0]; - [context startPath]; - [context moveTo:sourceNodeScreenPoint]; - [context lineTo:halfEdgeEnd]; - [context strokePathWithColor:MakeRColor (0, 0, 0, 0.5)]; - - [context restoreState]; -} - -- (StyleManager*) styleManager { - return [[stylePicker model] styleManager]; -} - -- (void) loadConfiguration:(Configuration*)config { - NSString *styleName = [config stringEntry:@"ActiveStyle" - inGroup:@"CreateEdgeTool" - withDefault:nil]; - [self setActiveStyle:[[self styleManager] edgeStyleForName:styleName]]; -} - -- (void) saveConfiguration:(Configuration*)config { - [config setStringEntry:@"ActiveStyle" - inGroup:@"CreateEdgeTool" - value:[[self activeStyle] name]]; -} -@end - -static void clear_style_button_cb (GtkButton *widget, - EdgeStyleSelector *selector) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [selector setSelectedStyle:nil]; - [pool drain]; -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/CreateNodeTool.h b/tikzit-old/src/gtk/CreateNodeTool.h deleted file mode 100644 index 94d6b31..0000000 --- a/tikzit-old/src/gtk/CreateNodeTool.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import -#import "Tool.h" - -@class NodeStyle; -@class NodeStyleSelector; -@class NodeStylesModel; -@class StyleManager; - -@interface CreateNodeTool : NSObject { - GraphRenderer *renderer; - NodeStyleSelector *stylePicker; - GtkWidget *configWidget; -} - -@property (retain) NodeStyle *activeStyle; - -+ (id) toolWithStyleManager:(StyleManager*)sm; -- (id) initWithStyleManager:(StyleManager*)sm; -+ (id) toolWithNodeStylesModel:(NodeStylesModel*)nsm; -- (id) initWithNodeStylesModel:(NodeStylesModel*)nsm; -@end - - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/CreateNodeTool.m b/tikzit-old/src/gtk/CreateNodeTool.m deleted file mode 100644 index 77b24f0..0000000 --- a/tikzit-old/src/gtk/CreateNodeTool.m +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "CreateNodeTool.h" - -#import "Configuration.h" -#import "GraphRenderer.h" -#import "NodeStyleSelector.h" -#import "NodeStylesModel.h" -#import "TikzDocument.h" -#import "tzstockitems.h" - -static void clear_style_button_cb (GtkButton *widget, - NodeStyleSelector *selector); - -@implementation CreateNodeTool -- (NSString*) name { return @"Create Node"; } -- (const gchar*) stockId { return TIKZIT_STOCK_CREATE_NODE; } -- (NSString*) helpText { return @"Create new nodes"; } -- (NSString*) shortcut { return @"n"; } -@synthesize activeRenderer=renderer; -@synthesize configurationWidget=configWidget; - -+ (id) toolWithStyleManager:(StyleManager*)sm { - return [[[self alloc] initWithStyleManager:sm] autorelease]; -} - -+ (id) toolWithNodeStylesModel:(NodeStylesModel*)nsm { - return [[[self alloc] initWithNodeStylesModel:nsm] autorelease]; -} - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)sm { - return [self initWithNodeStylesModel:[NodeStylesModel modelWithStyleManager:sm]]; -} - -- (id) initWithNodeStylesModel:(NodeStylesModel*)nsm { - self = [super init]; - - if (self) { - stylePicker = [[NodeStyleSelector alloc] initWithModel:nsm]; - - configWidget = gtk_vbox_new (FALSE, 0); - g_object_ref_sink (configWidget); - - GtkWidget *label = gtk_label_new ("Node style:"); - gtk_widget_show (label); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (configWidget), - label, - FALSE, - FALSE, - 0); - - GtkWidget *selWindow = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (selWindow); - gtk_container_add (GTK_CONTAINER (selWindow), - [stylePicker widget]); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selWindow), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_widget_show ([stylePicker widget]); - - GtkWidget *selectorFrame = gtk_frame_new (NULL); - gtk_widget_show (selectorFrame); - gtk_box_pack_start (GTK_BOX (configWidget), - selectorFrame, - TRUE, - TRUE, - 0); - gtk_container_add (GTK_CONTAINER (selectorFrame), - selWindow); - - GtkWidget *button = gtk_button_new_with_label ("No style"); - gtk_widget_show (button); - gtk_box_pack_start (GTK_BOX (configWidget), - button, - FALSE, - FALSE, - 0); - g_signal_connect (G_OBJECT (button), - "clicked", - G_CALLBACK (clear_style_button_cb), - stylePicker); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [renderer release]; - [stylePicker release]; - - g_object_unref (G_OBJECT (configWidget)); - - [super dealloc]; -} - -- (NodeStyle*) activeStyle { - return [stylePicker selectedStyle]; -} - -- (void) setActiveStyle:(NodeStyle*)style { - return [stylePicker setSelectedStyle:style]; -} - -// FIXME: create node on press, and drag it around? -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask {} - -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - Transformer *transformer = [renderer transformer]; - NSPoint nodePoint = [transformer fromScreen:[[renderer grid] snapScreenPoint:pos]]; - Node *node = [Node nodeWithPoint:nodePoint]; - [node setStyle:[self activeStyle]]; - [[renderer document] addNode:node]; -} - -- (void) renderWithContext:(id)context onSurface:(id)surface {} - -- (StyleManager*) styleManager { - return [[stylePicker model] styleManager]; -} - -- (void) loadConfiguration:(Configuration*)config { - NSString *styleName = [config stringEntry:@"ActiveStyle" - inGroup:@"CreateNodeTool" - withDefault:nil]; - [self setActiveStyle:[[self styleManager] nodeStyleForName:styleName]]; -} - -- (void) saveConfiguration:(Configuration*)config { - [config setStringEntry:@"ActiveStyle" - inGroup:@"CreateNodeTool" - value:[[self activeStyle] name]]; -} -@end - -static void clear_style_button_cb (GtkButton *widget, - NodeStyleSelector *selector) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [selector setSelectedStyle:nil]; - [pool drain]; -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/DocumentContext.h b/tikzit-old/src/gtk/DocumentContext.h deleted file mode 100644 index e4c1065..0000000 --- a/tikzit-old/src/gtk/DocumentContext.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" - -@class TikzDocument; - -@interface DocumentContext { - TikzDocument *document; - GraphRenderer *renderSurface; -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Edge+Render.h b/tikzit-old/src/gtk/Edge+Render.h deleted file mode 100644 index e88b28a..0000000 --- a/tikzit-old/src/gtk/Edge+Render.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Edge.h" -#import "RenderContext.h" -#import "Surface.h" - -@interface Edge (Render) - -+ (float) controlPointRadius; -- (void) renderControlsInContext:(id)context withTransformer:(Transformer*)transformer; -- (void) renderBasicEdgeInContext:(id)context withTransformer:(Transformer*)t selected:(BOOL)selected; -- (void) renderToSurface:(id)surface withContext:(id)context selected:(BOOL)selected; -- (NSRect) renderedBoundsWithTransformer:(Transformer*)t whenSelected:(BOOL)selected; -- (BOOL) hitByPoint:(NSPoint)p onSurface:(id)surface withFuzz:(float)fuzz; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Edge+Render.m b/tikzit-old/src/gtk/Edge+Render.m deleted file mode 100644 index 3cc2a14..0000000 --- a/tikzit-old/src/gtk/Edge+Render.m +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Edge+Render.h" -#import "Node+Render.h" -#import "../common/util.h" - -static const float edgeWidth = 2.0; -static const float cpRadius = 3.0; -static const float cpLineWidth = 1.0; - -@implementation Edge (Render) - -+ (float) controlPointRadius { - return cpRadius; -} - -- (float) controlDistance { - const float dx = (targ.x - src.x); - const float dy = (targ.y - src.y); - if (dx == 0 && dy == 0) { - return weight; - } else { - return NSDistanceBetweenPoints(src, targ) * weight; - } -} - -- (void) renderControlsInContext:(id)context withTransformer:(Transformer*)transformer { - [context saveState]; - - [self updateControls]; - - NSPoint c_source = [transformer toScreen:src]; - NSPoint c_target = [transformer toScreen:targ]; - NSPoint c_mid = [transformer toScreen:mid]; - - const float dx = (c_target.x - c_source.x); - const float dy = (c_target.y - c_source.y); - - [context setLineWidth:cpLineWidth]; - RColor fillColor = MakeRColor (1.0, 1.0, 1.0, 0.5); - - // draw a circle at the mid point - [context startPath]; - [context circleAt:c_mid withRadius:cpRadius]; - [context strokePathWithColor:MakeSolidRColor(0, 0, 1) andFillWithColor:fillColor]; - - //[context setAntialiasMode:AntialiasDisabled]; - - // size of control circles - float c_dist = 0.0f; - if (dx == 0 && dy == 0) { - c_dist = [transformer scaleToScreen:weight]; - } else { - c_dist = NSDistanceBetweenPoints(c_source, c_target) * weight; - } - - // basic bend is blue, in-out is green - RColor controlTrackColor; - if ([self bendMode] == EdgeBendModeBasic) { - controlTrackColor = MakeRColor (0.0, 0.0, 1.0, 0.4); - } else { - controlTrackColor = MakeRColor (0.0, 0.7, 0.0, 0.4); - } - - [context startPath]; - [context circleAt:c_source withRadius:c_dist]; - if (dx != 0 || dy != 0) { - [context circleAt:c_target withRadius:c_dist]; - } - [context strokePathWithColor:controlTrackColor]; - - RColor handleColor = MakeRColor (1.0, 0.0, 1.0, 0.6); - if ([self bendMode] == EdgeBendModeBasic) { - if (bend % 45 != 0) { - handleColor = MakeRColor (0.0, 0.0, 0.1, 0.4); - } - } else if ([self bendMode] == EdgeBendModeInOut) { - if (outAngle % 45 != 0) { - handleColor = MakeRColor (0.0, 0.7, 0.0, 0.4); - } - } - - NSPoint c_cp1 = [transformer toScreen:cp1]; - [context moveTo:c_source]; - [context lineTo:c_cp1]; - [context circleAt:c_cp1 withRadius:cpRadius]; - [context strokePathWithColor:handleColor]; - - if ([self bendMode] == EdgeBendModeInOut) { - // recalculate color based on inAngle - if (inAngle % 45 == 0) { - handleColor = MakeRColor (1.0, 0.0, 1.0, 0.6); - } else { - handleColor = MakeRColor (0.0, 0.7, 0.0, 0.4); - } - } - - NSPoint c_cp2 = [transformer toScreen:cp2]; - [context moveTo:c_target]; - [context lineTo:c_cp2]; - [context circleAt:c_cp2 withRadius:cpRadius]; - [context strokePathWithColor:handleColor]; - - [context restoreState]; -} - -- (void) renderArrowStrokePathInContext:(id)context withTransformer:(Transformer*)transformer color:(RColor)color { - - if ([self style] != nil) { - switch ([[self style] headStyle]) { - case AH_None: - break; - case AH_Plain: - [context startPath]; - [context moveTo:[transformer toScreen:[self leftHeadNormal]]]; - [context lineTo:[transformer toScreen:head]]; - [context lineTo:[transformer toScreen:[self rightHeadNormal]]]; - [context strokePathWithColor:color]; - break; - case AH_Latex: - [context startPath]; - [context moveTo:[transformer toScreen:[self leftHeadNormal]]]; - [context lineTo:[transformer toScreen:head]]; - [context lineTo:[transformer toScreen:[self rightHeadNormal]]]; - [context closeSubPath]; - [context strokePathWithColor:color andFillWithColor:color]; - break; - } - switch ([[self style] tailStyle]) { - case AH_None: - break; - case AH_Plain: - [context startPath]; - [context moveTo:[transformer toScreen:[self leftTailNormal]]]; - [context lineTo:[transformer toScreen:tail]]; - [context lineTo:[transformer toScreen:[self rightTailNormal]]]; - [context strokePathWithColor:color]; - break; - case AH_Latex: - [context startPath]; - [context moveTo:[transformer toScreen:[self leftTailNormal]]]; - [context lineTo:[transformer toScreen:tail]]; - [context lineTo:[transformer toScreen:[self rightTailNormal]]]; - [context closeSubPath]; - [context strokePathWithColor:color andFillWithColor:color]; - break; - } - } -} - -- (void) createStrokePathInContext:(id)context withTransformer:(Transformer*)transformer { - NSPoint c_tail = [transformer toScreen:tail]; - NSPoint c_cp1 = [transformer toScreen:cp1]; - NSPoint c_cp2 = [transformer toScreen:cp2]; - NSPoint c_head = [transformer toScreen:head]; - - [context startPath]; - [context moveTo:c_tail]; - [context curveTo:c_head withCp1:c_cp1 andCp2:c_cp2]; - - if ([self style] != nil) { - // draw edge decoration - switch ([[self style] decorationStyle]) { - case ED_None: - break; - case ED_Tick: - [context moveTo:[transformer toScreen:[self leftNormal]]]; - [context lineTo:[transformer toScreen:[self rightNormal]]]; - break; - case ED_Arrow: - [context moveTo:[transformer toScreen:[self leftNormal]]]; - [context lineTo:[transformer toScreen:[self midTan]]]; - [context lineTo:[transformer toScreen:[self rightNormal]]]; - break; - } - - } -} - -- (RColor) color { - if (style) { - return [[style colorRGB] rColor]; - } else { - return BlackRColor; - } -} - -- (void) renderBasicEdgeInContext:(id)context withTransformer:(Transformer*)t selected:(BOOL)selected { - [self updateControls]; - [context saveState]; - - const CGFloat lineWidth = style ? [style thickness] : edgeWidth; - [context setLineWidth:lineWidth]; - RColor color = [self color]; - if (selected) { - color.alpha = 0.5; - } - - [self createStrokePathInContext:context withTransformer:t]; - [context strokePathWithColor:color]; - - [self renderArrowStrokePathInContext:context withTransformer:t color:color]; - - [context restoreState]; -} - -- (void) renderToSurface:(id )surface withContext:(id)context selected:(BOOL)selected { - [self renderBasicEdgeInContext:context withTransformer:[surface transformer] selected:selected]; - - if (selected) { - [self renderControlsInContext:context withTransformer:[surface transformer]]; - } - - if ([self hasEdgeNode]) { - NSPoint labelPt = [[surface transformer] toScreen:[self mid]]; - [[self edgeNode] renderLabelAt:labelPt - withContext:context]; - } -} - -- (NSRect) renderedBoundsWithTransformer:(Transformer*)t whenSelected:(BOOL)selected { - if (selected) { - float c_dist = [self controlDistance] + cpRadius; // include handle - NSRect cp1circ = NSMakeRect (head.x - c_dist, head.y - c_dist, 2*c_dist, 2*c_dist); - NSRect cp2circ = NSMakeRect (tail.x - c_dist, tail.y - c_dist, 2*c_dist, 2*c_dist); - NSRect rect = NSUnionRect ([self boundingRect], NSUnionRect (cp1circ, cp2circ)); - return [t rectToScreen:rect]; - } else { - return [t rectToScreen:[self boundingRect]]; - } -} - -- (BOOL) hitByPoint:(NSPoint)p onSurface:(id)surface withFuzz:(float)fuzz { - [self updateControls]; - - NSRect boundingRect = [[surface transformer] rectToScreen:[self boundingRect]]; - if (!NSPointInRect(p, NSInsetRect(boundingRect, -fuzz, -fuzz))) { - return NO; - } - - id cr = [surface createRenderContext]; - - [cr setLineWidth:edgeWidth + 2 * fuzz]; - [self createStrokePathInContext:cr withTransformer:[surface transformer]]; - - return [cr strokeIncludesPoint:p]; -} - -@end - -// vim:ft=objc:ts=4:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/EdgeStyle+Gtk.h b/tikzit-old/src/gtk/EdgeStyle+Gtk.h deleted file mode 100644 index 4323593..0000000 --- a/tikzit-old/src/gtk/EdgeStyle+Gtk.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "EdgeStyle.h" -#import - -@interface EdgeStyle (Gtk) - -- (GdkColor) color; -- (void) setColor:(GdkColor)color; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/EdgeStyle+Gtk.m b/tikzit-old/src/gtk/EdgeStyle+Gtk.m deleted file mode 100644 index 886329e..0000000 --- a/tikzit-old/src/gtk/EdgeStyle+Gtk.m +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "EdgeStyle+Gtk.h" -#import "ColorRGB+Gtk.h" - -@implementation EdgeStyle (Gtk) - -- (GdkColor) color { - return [[self colorRGB] gdkColor]; -} - -- (void) setColor:(GdkColor)color { - [self setColorRGB:[ColorRGB colorWithGdkColor:color]]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/EdgeStyle+Storage.h b/tikzit-old/src/gtk/EdgeStyle+Storage.h deleted file mode 100644 index 74881f3..0000000 --- a/tikzit-old/src/gtk/EdgeStyle+Storage.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "EdgeStyle.h" -#import "Configuration.h" - -@interface EdgeStyle (Storage) - -- (id) initFromConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile; -- (void) storeToConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/EdgeStyle+Storage.m b/tikzit-old/src/gtk/EdgeStyle+Storage.m deleted file mode 100644 index 45e2a20..0000000 --- a/tikzit-old/src/gtk/EdgeStyle+Storage.m +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "EdgeStyle+Storage.h" -#import "ColorRGB+IntegerListStorage.h" - -@implementation EdgeStyle (Storage) - -- (id) initFromConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile { - self = [self init]; - - if (self) { - [self setName:[configFile stringEntry:@"Name" inGroup:groupName withDefault:name]]; - [self setCategory:[configFile stringEntry:@"Category" inGroup:groupName withDefault:category]]; - headStyle = [configFile integerEntry:@"HeadStyle" inGroup:groupName withDefault:headStyle]; - tailStyle = [configFile integerEntry:@"TailStyle" inGroup:groupName withDefault:tailStyle]; - decorationStyle = [configFile integerEntry:@"DecorationStyle" inGroup:groupName withDefault:decorationStyle]; - thickness = [configFile doubleEntry:@"Thickness" inGroup:groupName withDefault:thickness]; - [self setColorRGB: - [ColorRGB colorFromValueList: - [configFile integerListEntry:@"Color" - inGroup:groupName - withDefault:[colorRGB valueList]]]]; - } - - return self; -} - -- (void) storeToConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile { - [configFile setStringEntry:@"Name" inGroup:groupName value:name]; - [configFile setStringEntry:@"Category" inGroup:groupName value:category]; - [configFile setIntegerEntry:@"HeadStyle" inGroup:groupName value:headStyle]; - [configFile setIntegerEntry:@"TailStyle" inGroup:groupName value:tailStyle]; - [configFile setIntegerEntry:@"DecorationStyle" inGroup:groupName value:decorationStyle]; - [configFile setDoubleEntry:@"Thickness" inGroup:groupName value:thickness]; - [configFile setIntegerListEntry:@"Color" inGroup:groupName value:[[self colorRGB] valueList]]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/EdgeStyleEditor.h b/tikzit-old/src/gtk/EdgeStyleEditor.h deleted file mode 100644 index 2224bbb..0000000 --- a/tikzit-old/src/gtk/EdgeStyleEditor.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class EdgeStyle; - -@interface EdgeStyleEditor: NSObject { - EdgeStyle *style; - GtkTable *table; - GtkEntry *nameEdit; - GtkComboBox *decorationCombo; - GtkComboBox *headArrowCombo; - GtkComboBox *tailArrowCombo; - GtkColorButton *colorButton; - GtkWidget *makeColorTexSafeButton; - GtkAdjustment *thicknessAdj; - BOOL blockSignals; -} - -@property (retain) EdgeStyle *style; -@property (readonly) GtkWidget *widget; - -- (id) init; - -- (void) selectNameField; - -@end - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/EdgeStyleEditor.m b/tikzit-old/src/gtk/EdgeStyleEditor.m deleted file mode 100644 index c7ca8bd..0000000 --- a/tikzit-old/src/gtk/EdgeStyleEditor.m +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "EdgeStyleEditor.h" - -#import "EdgeStyle.h" -#import "EdgeStyle+Gtk.h" -#import "Shape.h" - -#include - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-sign" -#import "edgedecdata.m" -#pragma GCC diagnostic pop - -// {{{ Data Types -enum { - DEC_NAME_COL = 0, - DEC_PREVIEW_COL, - DEC_VALUE_COL, - DEC_N_COLS -}; - -struct dec_info { - const gchar *name; - const GdkPixdata *pixdata; - int value; -}; -static struct dec_info ed_entries[] = { - { "None", &ED_none_pixdata, ED_None }, - { "Arrow", &ED_arrow_pixdata, ED_Arrow }, - { "Tick", &ED_tick_pixdata, ED_Tick } -}; -static guint n_ed_entries = G_N_ELEMENTS (ed_entries); -static struct dec_info ah_head_entries[] = { - { "None", &AH_none_pixdata, AH_None }, - { "Plain", &AH_plain_head_pixdata, AH_Plain }, - { "Latex", &AH_latex_head_pixdata, AH_Latex } -}; -static guint n_ah_head_entries = G_N_ELEMENTS (ah_head_entries); -static struct dec_info ah_tail_entries[] = { - { "None", &AH_none_pixdata, AH_None }, - { "Plain", &AH_plain_tail_pixdata, AH_Plain }, - { "Latex", &AH_latex_tail_pixdata, AH_Latex } -}; -static guint n_ah_tail_entries = G_N_ELEMENTS (ah_tail_entries); - -static const guint row_count = 6; - -// }}} -// {{{ Internal interfaces -// {{{ GTK+ Callbacks -static void style_name_edit_changed_cb (GtkEditable *widget, EdgeStyleEditor *editor); -static void decoration_combo_changed_cb (GtkComboBox *widget, EdgeStyleEditor *editor); -static void head_arrow_combo_changed_cb (GtkComboBox *widget, EdgeStyleEditor *editor); -static void tail_arrow_combo_changed_cb (GtkComboBox *widget, EdgeStyleEditor *editor); -static void thickness_adjustment_changed_cb (GtkAdjustment *widget, EdgeStyleEditor *editor); -static void color_changed_cb (GtkColorButton *widget, EdgeStyleEditor *editor); -static void make_color_safe_button_clicked_cb (GtkButton *widget, EdgeStyleEditor *editor); -// }}} -// {{{ Notifications - -@interface EdgeStyleEditor (Notifications) -- (void) nameChangedTo:(NSString*)value; -- (void) edgeDecorationChangedTo:(EdgeDectorationStyle)value; -- (void) headArrowChangedTo:(ArrowHeadStyle)value; -- (void) tailArrowChangedTo:(ArrowHeadStyle)value; -- (void) thicknessChangedTo:(double)value; -- (void) makeColorTexSafe; -- (void) colorChangedTo:(GdkColor)value; -@end - -// }}} -// {{{ Private - -@interface EdgeStyleEditor (Private) -- (void) load:(guint)count decorationStylesFrom:(struct dec_info*)info into:(GtkListStore*)list; -- (void) clearDecCombo:(GtkComboBox*)combo; -- (void) setDecCombo:(GtkComboBox*)combo toValue:(int)value; -@end - -// }}} -// }}} -// {{{ API - -@implementation EdgeStyleEditor - -- (void) _addWidget:(GtkWidget*)w withLabel:(gchar *)label atRow:(guint)row { - NSAssert(row < row_count, @"row_count is wrong!"); - - GtkWidget *l = gtk_label_new (label); - gtk_misc_set_alignment (GTK_MISC (l), 0, 0.5); - gtk_widget_show (l); - gtk_widget_show (w); - - gtk_table_attach (table, l, - 0, 1, row, row+1, // l, r, t, b - GTK_FILL, // x opts - GTK_FILL | GTK_EXPAND, // y opts - 5, // x padding - 0); // y padding - - gtk_table_attach (table, w, - 1, 2, row, row+1, // l, r, t, b - GTK_FILL | GTK_EXPAND, // x opts - GTK_FILL | GTK_EXPAND, // y opts - 0, // x padding - 0); // y padding -} - -- (GtkComboBox*) _createDecComboWithEntries:(struct dec_info*)entries count:(guint)n { - GtkListStore *store = gtk_list_store_new (DEC_N_COLS, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT); - [self load:n decorationStylesFrom:entries into:store]; - - GtkComboBox *combo = GTK_COMBO_BOX (gtk_combo_box_new_with_model (GTK_TREE_MODEL (store))); - g_object_unref (store); - GtkCellRenderer *cellRend = gtk_cell_renderer_pixbuf_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), - cellRend, - TRUE); - gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), cellRend, "pixbuf", DEC_PREVIEW_COL); - g_object_ref_sink (combo); - - return combo; -} - -- (GtkWidget*) _createMakeColorTexSafeButton { - GtkWidget *b = gtk_button_new (); - GtkWidget *icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON); - gtk_widget_show (icon); - gtk_container_add (GTK_CONTAINER (b), icon); - NSString *ttip = @"The colour is not a predefined TeX colour.\nClick here to choose the nearest TeX-safe colour."; - gtk_widget_set_tooltip_text (b, [ttip UTF8String]); - return b; -} - -- (id) init { - self = [super init]; - - if (self != nil) { - style = nil; - table = GTK_TABLE (gtk_table_new (row_count, 2, FALSE)); - gtk_table_set_col_spacings (table, 6); - gtk_table_set_row_spacings (table, 6); - gtk_widget_set_sensitive (GTK_WIDGET (table), FALSE); - blockSignals = NO; - - /** - * Name - */ - nameEdit = GTK_ENTRY (gtk_entry_new ()); - g_object_ref_sink (nameEdit); - [self _addWidget:GTK_WIDGET (nameEdit) - withLabel:"Name" - atRow:0]; - g_signal_connect (G_OBJECT (nameEdit), - "changed", - G_CALLBACK (style_name_edit_changed_cb), - self); - - - /** - * Edge decoration style - */ - decorationCombo = [self _createDecComboWithEntries:ed_entries count:n_ed_entries]; - [self _addWidget:GTK_WIDGET (decorationCombo) - withLabel:"Decoration" - atRow:1]; - g_signal_connect (G_OBJECT (decorationCombo), - "changed", - G_CALLBACK (decoration_combo_changed_cb), - self); - - - /** - * Head arrow style - */ - headArrowCombo = [self _createDecComboWithEntries:ah_head_entries count:n_ah_head_entries]; - [self _addWidget:GTK_WIDGET (headArrowCombo) - withLabel:"Arrow head" - atRow:2]; - g_signal_connect (G_OBJECT (headArrowCombo), - "changed", - G_CALLBACK (head_arrow_combo_changed_cb), - self); - - - /** - * Tail arrow style - */ - tailArrowCombo = [self _createDecComboWithEntries:ah_tail_entries count:n_ah_tail_entries]; - [self _addWidget:GTK_WIDGET (tailArrowCombo) - withLabel:"Arrow tail" - atRow:3]; - g_signal_connect (G_OBJECT (tailArrowCombo), - "changed", - G_CALLBACK (tail_arrow_combo_changed_cb), - self); - - - /** - * Colour - */ - GtkWidget *colorBox = gtk_hbox_new (FALSE, 0); - [self _addWidget:colorBox - withLabel:"Colour" - atRow:4]; - colorButton = GTK_COLOR_BUTTON (gtk_color_button_new ()); - g_object_ref_sink (colorButton); - gtk_widget_show (GTK_WIDGET (colorButton)); - gtk_box_pack_start (GTK_BOX (colorBox), GTK_WIDGET (colorButton), - FALSE, FALSE, 0); - makeColorTexSafeButton = [self _createMakeColorTexSafeButton]; - g_object_ref_sink (makeColorTexSafeButton); - gtk_box_pack_start (GTK_BOX (colorBox), makeColorTexSafeButton, - FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (colorButton), - "color-set", - G_CALLBACK (color_changed_cb), - self); - g_signal_connect (G_OBJECT (makeColorTexSafeButton), - "clicked", - G_CALLBACK (make_color_safe_button_clicked_cb), - self); - - - /** - * Thickness - */ - thicknessAdj = GTK_ADJUSTMENT (gtk_adjustment_new ( - 1.0, // value - 0.0, // lower - 50.0, // upper - 0.20, // step - 1.0, // page - 0.0)); // (irrelevant) - g_object_ref_sink (thicknessAdj); - GtkWidget *scaleSpin = gtk_spin_button_new (thicknessAdj, 0.0, 2); - [self _addWidget:scaleSpin - withLabel:"Thickness" - atRow:5]; - g_signal_connect (G_OBJECT (thicknessAdj), - "value-changed", - G_CALLBACK (thickness_adjustment_changed_cb), - self); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (nameEdit); - g_object_unref (decorationCombo); - g_object_unref (colorButton); - g_object_unref (makeColorTexSafeButton); - g_object_unref (thicknessAdj); - g_object_unref (table); - [style release]; - - [super dealloc]; -} - -- (EdgeStyle*) style { - return style; -} - -- (void) setStyle:(EdgeStyle*)s { - blockSignals = YES; - EdgeStyle *oldStyle = style; - style = [s retain]; - - if (style != nil) { - gtk_widget_set_sensitive (GTK_WIDGET (table), TRUE); - - gtk_entry_set_text(nameEdit, [[style name] UTF8String]); - - [self setDecCombo:decorationCombo toValue:[style decorationStyle]]; - [self setDecCombo:headArrowCombo toValue:[style headStyle]]; - [self setDecCombo:tailArrowCombo toValue:[style tailStyle]]; - - GdkColor c = [style color]; - gtk_color_button_set_color(colorButton, &c); - gtk_widget_set_visible (makeColorTexSafeButton, ([[style colorRGB] name] == nil)); - - gtk_adjustment_set_value(thicknessAdj, [style thickness]); - } else { - gtk_entry_set_text(nameEdit, ""); - [self clearDecCombo:decorationCombo]; - [self clearDecCombo:headArrowCombo]; - [self clearDecCombo:tailArrowCombo]; - gtk_widget_set_visible (makeColorTexSafeButton, FALSE); - gtk_adjustment_set_value(thicknessAdj, 1.0); - gtk_widget_set_sensitive (GTK_WIDGET (table), FALSE); - } - - [oldStyle release]; - blockSignals = NO; -} - -- (GtkWidget*) widget { - return GTK_WIDGET (table); -} - -- (void) selectNameField { - gtk_widget_grab_focus (GTK_WIDGET (nameEdit)); - gtk_editable_select_region (GTK_EDITABLE (nameEdit), 0, -1); -} - -@end - -// }}} -// {{{ Notifications - -@implementation EdgeStyleEditor (Notifications) -- (void) nameChangedTo:(NSString*)value { - [style setName:value]; -} - -- (void) edgeDecorationChangedTo:(EdgeDectorationStyle)value { - [style setDecorationStyle:value]; -} - -- (void) headArrowChangedTo:(ArrowHeadStyle)value { - [style setHeadStyle:value]; -} - -- (void) tailArrowChangedTo:(ArrowHeadStyle)value { - [style setTailStyle:value]; -} - -- (void) thicknessChangedTo:(double)value { - [style setThickness:(float)value]; -} - -- (void) colorChangedTo:(GdkColor)value { - [style setColor:value]; - gtk_widget_set_visible (makeColorTexSafeButton, - [[style colorRGB] name] == nil); -} - -- (void) makeColorTexSafe { - if (style != nil) { - [[style colorRGB] setToClosestHashed]; - GdkColor color = [style color]; - gtk_color_button_set_color(colorButton, &color); - gtk_widget_set_visible (makeColorTexSafeButton, FALSE); - } -} -@end - -// }}} -// {{{ Private - -@implementation EdgeStyleEditor (Private) -- (BOOL) signalsBlocked { return blockSignals; } - -- (void) load:(guint)count decorationStylesFrom:(struct dec_info*)info into:(GtkListStore*)list { - GtkTreeIter iter; - - for (guint i = 0; i < count; ++i) { - GdkPixbuf *buf = gdk_pixbuf_from_pixdata (info[i].pixdata, FALSE, NULL); - gtk_list_store_append (list, &iter); - gtk_list_store_set (list, &iter, - DEC_NAME_COL, info[i].name, - DEC_PREVIEW_COL, buf, - DEC_VALUE_COL, info[i].value, - -1); - g_object_unref (buf); - } -} - -- (void) clearDecCombo:(GtkComboBox*)combo { - gtk_combo_box_set_active (combo, -1); -} - -- (void) setDecCombo:(GtkComboBox*)combo toValue:(int)value { - GtkTreeModel *model = gtk_combo_box_get_model (combo); - GtkTreeIter iter; - if (gtk_tree_model_get_iter_first (model, &iter)) { - do { - int rowValue; - gtk_tree_model_get (model, &iter, DEC_VALUE_COL, &rowValue, -1); - if (rowValue == value) { - gtk_combo_box_set_active_iter (combo, &iter); - return; - } - } while (gtk_tree_model_iter_next (model, &iter)); - } -} -@end - -// }}} -// {{{ GTK+ callbacks - -static void style_name_edit_changed_cb (GtkEditable *widget, EdgeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - const gchar *contents = gtk_entry_get_text (GTK_ENTRY (widget)); - [editor nameChangedTo:[NSString stringWithUTF8String:contents]]; - - [pool drain]; -} - -static void decoration_combo_changed_cb (GtkComboBox *widget, EdgeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GtkTreeIter iter; - gtk_combo_box_get_active_iter (widget, &iter); - EdgeDectorationStyle dec = ED_None; - gtk_tree_model_get (gtk_combo_box_get_model (widget), &iter, DEC_VALUE_COL, &dec, -1); - [editor edgeDecorationChangedTo:dec]; - - [pool drain]; -} - -static void head_arrow_combo_changed_cb (GtkComboBox *widget, EdgeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GtkTreeIter iter; - gtk_combo_box_get_active_iter (widget, &iter); - ArrowHeadStyle dec = AH_None; - gtk_tree_model_get (gtk_combo_box_get_model (widget), &iter, DEC_VALUE_COL, &dec, -1); - [editor headArrowChangedTo:dec]; - - [pool drain]; -} - -static void tail_arrow_combo_changed_cb (GtkComboBox *widget, EdgeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GtkTreeIter iter; - gtk_combo_box_get_active_iter (widget, &iter); - ArrowHeadStyle dec = AH_None; - gtk_tree_model_get (gtk_combo_box_get_model (widget), &iter, DEC_VALUE_COL, &dec, -1); - [editor tailArrowChangedTo:dec]; - - [pool drain]; -} - -static void thickness_adjustment_changed_cb (GtkAdjustment *adj, EdgeStyleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor thicknessChangedTo:gtk_adjustment_get_value (adj)]; - [pool drain]; -} - -static void color_changed_cb (GtkColorButton *widget, EdgeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GdkColor color; - gtk_color_button_get_color (widget, &color); - [editor colorChangedTo:color]; - - [pool drain]; -} - -static void make_color_safe_button_clicked_cb (GtkButton *widget, EdgeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor makeColorTexSafe]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/EdgeStyleSelector.h b/tikzit-old/src/gtk/EdgeStyleSelector.h deleted file mode 100644 index 904bd93..0000000 --- a/tikzit-old/src/gtk/EdgeStyleSelector.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class EdgeStyle; -@class EdgeStylesModel; -@class StyleManager; - -@interface EdgeStyleSelector: NSObject { - EdgeStylesModel *model; - GtkTreeView *view; -} - -/*! - @property widget - @brief The GTK widget - */ -@property (readonly) GtkWidget *widget; - -/*! - @property model - @brief The model to use. - */ -@property (retain) EdgeStylesModel *model; - -/*! - @property selectedStyle - @brief The selected style. - - When this changes, a SelectedStyleChanged notification will be posted - */ -@property (assign) EdgeStyle *selectedStyle; - -/*! - * Initialise with a new model for the given style manager - */ -- (id) initWithStyleManager:(StyleManager*)m; -/*! - * Initialise with the given model - */ -- (id) initWithModel:(EdgeStylesModel*)model; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/EdgeStyleSelector.m b/tikzit-old/src/gtk/EdgeStyleSelector.m deleted file mode 100644 index 6a9db33..0000000 --- a/tikzit-old/src/gtk/EdgeStyleSelector.m +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "EdgeStyleSelector.h" - -#import "EdgeStylesModel.h" - -// {{{ Internal interfaces -static void selection_changed_cb (GtkTreeSelection *sel, EdgeStyleSelector *mgr); -// }}} -// {{{ API - -@implementation EdgeStyleSelector - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)m { - return [self initWithModel:[EdgeStylesModel modelWithStyleManager:m]]; -} -- (id) initWithModel:(EdgeStylesModel*)m { - self = [super init]; - - if (self) { - model = [m retain]; - - view = GTK_TREE_VIEW (gtk_tree_view_new_with_model ([m model])); - gtk_tree_view_set_headers_visible (view, FALSE); - g_object_ref (view); - - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - renderer = gtk_cell_renderer_pixbuf_new (); - column = gtk_tree_view_column_new_with_attributes ( - "Preview", - renderer, - "pixbuf", EDGE_STYLES_ICON_COL, - NULL); - gtk_tree_view_append_column (view, column); - gtk_tree_view_set_tooltip_column (view, EDGE_STYLES_NAME_COL); - - GtkTreeSelection *sel = gtk_tree_view_get_selection (view); - gtk_tree_selection_set_mode (sel, GTK_SELECTION_SINGLE); - - g_signal_connect (G_OBJECT (sel), - "changed", - G_CALLBACK (selection_changed_cb), - self); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (view); - [model release]; - - [super dealloc]; -} - -- (EdgeStylesModel*) model { - return model; -} - -- (void) setModel:(EdgeStylesModel*)m { - if (m == model) - return; - - EdgeStylesModel *oldModel = model; - model = [m retain]; - gtk_tree_view_set_model (view, [model model]); - [oldModel release]; -} - -- (GtkWidget*) widget { - return GTK_WIDGET (view); -} - -- (EdgeStyle*) selectedStyle { - GtkTreeSelection *sel = gtk_tree_view_get_selection (view); - GtkTreeIter iter; - - if (!gtk_tree_selection_get_selected (sel, NULL, &iter)) { - return nil; - } - - EdgeStyle *style = nil; - gtk_tree_model_get ([model model], &iter, EDGE_STYLES_PTR_COL, &style, -1); - - return style; -} - -- (void) setSelectedStyle:(EdgeStyle*)style { - GtkTreeSelection *sel = gtk_tree_view_get_selection (view); - - if (style == nil) { - gtk_tree_selection_unselect_all (sel); - return; - } - - GtkTreePath *path = [model pathFromStyle:style]; - if (path) { - gtk_tree_selection_unselect_all (sel); - gtk_tree_selection_select_path (sel, path); - gtk_tree_path_free (path); - } -} -@end - -// }}} -// {{{ GTK+ callbacks - -static void selection_changed_cb (GtkTreeSelection *sel, EdgeStyleSelector *mgr) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [[NSNotificationCenter defaultCenter] - postNotificationName:@"SelectedStyleChanged" - object:mgr]; - - [pool drain]; -} -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker - diff --git a/tikzit-old/src/gtk/EdgeStylesModel.h b/tikzit-old/src/gtk/EdgeStylesModel.h deleted file mode 100644 index 1166f92..0000000 --- a/tikzit-old/src/gtk/EdgeStylesModel.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class EdgeStyle; -@class StyleManager; - -enum { - EDGE_STYLES_NAME_COL = 0, - EDGE_STYLES_ICON_COL, - EDGE_STYLES_PTR_COL, - EDGE_STYLES_N_COLS -}; - -@interface EdgeStylesModel: NSObject { - GtkListStore *store; - StyleManager *styleManager; -} - -/*! - @property model - @brief The GTK+ tree model - */ -@property (readonly) GtkTreeModel *model; - -/*! - @property manager - @brief The StyleManager to use. - */ -@property (retain) StyleManager *styleManager; - -/*! - * Initialise with the given style manager - */ -- (id) initWithStyleManager:(StyleManager*)m; - -+ (id) modelWithStyleManager:(StyleManager*)m; - -- (EdgeStyle*) styleFromPath:(GtkTreePath*)path; -- (GtkTreePath*) pathFromStyle:(EdgeStyle*)style; -- (EdgeStyle*) styleFromIter:(GtkTreeIter*)iter; -- (GtkTreeIter*) iterFromStyle:(EdgeStyle*)style; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/EdgeStylesModel.m b/tikzit-old/src/gtk/EdgeStylesModel.m deleted file mode 100644 index 2de57ed..0000000 --- a/tikzit-old/src/gtk/EdgeStylesModel.m +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "EdgeStylesModel.h" - -#import "CairoRenderContext.h" -#import "Edge.h" -#import "Edge+Render.h" -#import "EdgeStyle.h" -#import "Node.h" -#import "StyleManager.h" - -#import "gtkhelpers.h" - -#import - -// {{{ Internal interfaces - -@interface EdgeStylesModel (Notifications) -- (void) edgeStylesReplaced:(NSNotification*)notification; -- (void) edgeStyleAdded:(NSNotification*)notification; -- (void) edgeStyleRemoved:(NSNotification*)notification; -- (void) observeValueForKeyPath:(NSString*)keyPath - ofObject:(id)object - change:(NSDictionary*)change - context:(void*)context; -@end - -@interface EdgeStylesModel (Private) -- (cairo_surface_t*) createEdgeIconSurface; -- (GdkPixbuf*) pixbufOfEdgeInStyle:(EdgeStyle*)style; -- (GdkPixbuf*) pixbufOfEdgeInStyle:(EdgeStyle*)style usingSurface:(cairo_surface_t*)surface; -- (void) addEdgeStyle:(EdgeStyle*)style; -- (void) addEdgeStyle:(EdgeStyle*)style usingSurface:(cairo_surface_t*)surface; -- (void) observeEdgeStyle:(EdgeStyle*)style; -- (void) stopObservingEdgeStyle:(EdgeStyle*)style; -- (void) clearEdgeStylesModel; -- (void) reloadEdgeStyles; -@end - -// }}} -// {{{ API - -@implementation EdgeStylesModel - -+ (id) modelWithStyleManager:(StyleManager*)m { - return [[[self alloc] initWithStyleManager:m] autorelease]; -} - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)m { - self = [super init]; - - if (self) { - store = gtk_list_store_new (EDGE_STYLES_N_COLS, - G_TYPE_STRING, - GDK_TYPE_PIXBUF, - G_TYPE_POINTER); - g_object_ref_sink (store); - - [self setStyleManager:m]; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [self clearEdgeStylesModel]; - g_object_unref (store); - [styleManager release]; - - [super dealloc]; -} - -- (GtkTreeModel*) model { - return GTK_TREE_MODEL (store); -} - -- (StyleManager*) styleManager { - return styleManager; -} - -- (void) setStyleManager:(StyleManager*)m { - if (m == nil) { - [NSException raise:NSInvalidArgumentException format:@"Style manager cannot be nil"]; - } - [m retain]; - - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:styleManager]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeStylesReplaced:) - name:@"EdgeStylesReplaced" - object:m]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeStyleAdded:) - name:@"EdgeStyleAdded" - object:m]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeStyleRemoved:) - name:@"EdgeStyleRemoved" - object:m]; - - [styleManager release]; - styleManager = m; - - [self reloadEdgeStyles]; -} - -- (EdgeStyle*) styleFromPath:(GtkTreePath*)path { - GtkTreeIter iter; - gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path); - EdgeStyle *style = nil; - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, EDGE_STYLES_PTR_COL, &style, -1); - return style; -} - -- (GtkTreePath*) pathFromStyle:(EdgeStyle*)style { - GtkTreeModel *m = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (m, &row)) { - do { - EdgeStyle *rowStyle; - gtk_tree_model_get (m, &row, EDGE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - return gtk_tree_model_get_path (m, &row); - } - } while (gtk_tree_model_iter_next (m, &row)); - } - return NULL; -} - -- (EdgeStyle*) styleFromIter:(GtkTreeIter*)iter { - EdgeStyle *style = nil; - gtk_tree_model_get (GTK_TREE_MODEL (store), iter, EDGE_STYLES_PTR_COL, &style, -1); - return style; -} - -- (GtkTreeIter*) iterFromStyle:(EdgeStyle*)style { - GtkTreeModel *m = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (m, &row)) { - do { - EdgeStyle *rowStyle; - gtk_tree_model_get (m, &row, EDGE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - return gtk_tree_iter_copy (&row); - } - } while (gtk_tree_model_iter_next (m, &row)); - } - return NULL; -} -@end - -// }}} -// {{{ Notifications - -@implementation EdgeStylesModel (Notifications) - -- (void) edgeStylesReplaced:(NSNotification*)notification { - [self reloadEdgeStyles]; -} - -- (void) edgeStyleAdded:(NSNotification*)notification { - [self addEdgeStyle:[[notification userInfo] objectForKey:@"style"]]; -} - -- (void) edgeStyleRemoved:(NSNotification*)notification { - EdgeStyle *style = [[notification userInfo] objectForKey:@"style"]; - - GtkTreeModel *model = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (model, &row)) { - do { - EdgeStyle *rowStyle; - gtk_tree_model_get (model, &row, EDGE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - gtk_list_store_remove (store, &row); - [self stopObservingEdgeStyle:rowStyle]; - [rowStyle release]; - return; - } - } while (gtk_tree_model_iter_next (model, &row)); - } -} - -- (void) observeValueForKeyPath:(NSString*)keyPath - ofObject:(id)object - change:(NSDictionary*)change - context:(void*)context -{ - if ([object class] != [EdgeStyle class]) - return; - - EdgeStyle *style = object; - - GtkTreeModel *model = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (model, &row)) { - do { - EdgeStyle *rowStyle; - gtk_tree_model_get (model, &row, EDGE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - if ([@"name" isEqual:keyPath]) { - gtk_list_store_set (store, &row, EDGE_STYLES_NAME_COL, [[style name] UTF8String], -1); - } else { - GdkPixbuf *pixbuf = [self pixbufOfEdgeInStyle:style]; - gtk_list_store_set (store, &row, EDGE_STYLES_ICON_COL, pixbuf, -1); - g_object_unref (pixbuf); - } - } - } while (gtk_tree_model_iter_next (model, &row)); - } -} -@end - -// }}} -// {{{ Private - -@implementation EdgeStylesModel (Private) -- (cairo_surface_t*) createEdgeIconSurface { - return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 48, 18); -} - -- (GdkPixbuf*) pixbufOfEdgeInStyle:(EdgeStyle*)style { - cairo_surface_t *surface = [self createEdgeIconSurface]; - GdkPixbuf *pixbuf = [self pixbufOfEdgeInStyle:style usingSurface:surface]; - cairo_surface_destroy (surface); - return pixbuf; -} - -- (GdkPixbuf*) pixbufOfEdgeInStyle:(EdgeStyle*)style usingSurface:(cairo_surface_t*)surface { - Transformer *transformer = [Transformer defaultTransformer]; - [transformer setFlippedAboutXAxis:YES]; - - int width = cairo_image_surface_get_width (surface); - int height = cairo_image_surface_get_height (surface); - NSRect pixbufBounds = NSMakeRect(0.0, 0.0, width, height); - NSRect graphBounds = [transformer rectFromScreen:pixbufBounds]; - - NSPoint start = NSMakePoint (NSMinX (graphBounds) + 0.1f, NSMidY (graphBounds)); - NSPoint end = NSMakePoint (NSMaxX (graphBounds) - 0.1f, NSMidY (graphBounds)); - Node *src = [Node nodeWithPoint:start]; - Node *tgt = [Node nodeWithPoint:end]; - Edge *e = [Edge edgeWithSource:src andTarget:tgt]; - [e setStyle:style]; - - CairoRenderContext *context = [[CairoRenderContext alloc] initForSurface:surface]; - [context clearSurface]; - [e renderBasicEdgeInContext:context withTransformer:transformer selected:NO]; - [context release]; - - return pixbuf_get_from_surface (surface); -} - -- (void) addEdgeStyle:(EdgeStyle*)style usingSurface:(cairo_surface_t*)surface { - GtkTreeIter iter; - gtk_list_store_append (store, &iter); - - GdkPixbuf *pixbuf = [self pixbufOfEdgeInStyle:style usingSurface:surface]; - gtk_list_store_set (store, &iter, - EDGE_STYLES_NAME_COL, [[style name] UTF8String], - EDGE_STYLES_ICON_COL, pixbuf, - EDGE_STYLES_PTR_COL, (gpointer)[style retain], - -1); - g_object_unref (pixbuf); - [self observeEdgeStyle:style]; -} - -- (void) addEdgeStyle:(EdgeStyle*)style { - cairo_surface_t *surface = [self createEdgeIconSurface]; - [self addEdgeStyle:style usingSurface:surface]; - cairo_surface_destroy (surface); -} - -- (void) observeEdgeStyle:(EdgeStyle*)style { - [style addObserver:self - forKeyPath:@"name" - options:NSKeyValueObservingOptionNew - context:NULL]; - [style addObserver:self - forKeyPath:@"thickness" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"headStyle" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"tailStyle" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"decorationStyle" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"colorRGB.red" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"colorRGB.green" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"colorRGB.blue" - options:0 - context:NULL]; -} - -- (void) stopObservingEdgeStyle:(EdgeStyle*)style { - [style removeObserver:self forKeyPath:@"name"]; - [style removeObserver:self forKeyPath:@"thickness"]; - [style removeObserver:self forKeyPath:@"headStyle"]; - [style removeObserver:self forKeyPath:@"tailStyle"]; - [style removeObserver:self forKeyPath:@"decorationStyle"]; - [style removeObserver:self forKeyPath:@"colorRGB.red"]; - [style removeObserver:self forKeyPath:@"colorRGB.green"]; - [style removeObserver:self forKeyPath:@"colorRGB.blue"]; -} - -- (void) clearEdgeStylesModel { - GtkTreeModel *model = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (model, &row)) { - do { - EdgeStyle *rowStyle; - gtk_tree_model_get (model, &row, EDGE_STYLES_PTR_COL, &rowStyle, -1); - [self stopObservingEdgeStyle:rowStyle]; - [rowStyle release]; - } while (gtk_tree_model_iter_next (model, &row)); - } - gtk_list_store_clear (store); -} - -- (void) reloadEdgeStyles { - [self clearEdgeStylesModel]; - cairo_surface_t *surface = [self createEdgeIconSurface]; - for (EdgeStyle *style in [styleManager edgeStyles]) { - [self addEdgeStyle:style usingSurface:surface]; - } - cairo_surface_destroy (surface); -} -@end - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/EdgeStylesPalette.h b/tikzit-old/src/gtk/EdgeStylesPalette.h deleted file mode 100644 index c0c6c4b..0000000 --- a/tikzit-old/src/gtk/EdgeStylesPalette.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class StyleManager; -@class EdgeStyleSelector; -@class EdgeStyleEditor; - -@interface EdgeStylesPalette: NSObject { - EdgeStyleSelector *selector; - EdgeStyleEditor *editor; - - GtkWidget *palette; - - GtkWidget *removeStyleButton; - GtkWidget *applyStyleButton; - GtkWidget *clearStyleButton; -} - -@property (retain) StyleManager *styleManager; -@property (readonly) GtkWidget *widget; - -- (id) initWithManager:(StyleManager*)m; - -@end - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/EdgeStylesPalette.m b/tikzit-old/src/gtk/EdgeStylesPalette.m deleted file mode 100644 index 33264cf..0000000 --- a/tikzit-old/src/gtk/EdgeStylesPalette.m +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "EdgeStylesPalette.h" - -#import "EdgeStylesModel.h" -#import "EdgeStyleSelector.h" -#import "EdgeStyleEditor.h" -#import "StyleManager.h" - -// {{{ Internal interfaces -// {{{ GTK+ Callbacks -static void add_style_button_cb (GtkButton *widget, EdgeStylesPalette *palette); -static void remove_style_button_cb (GtkButton *widget, EdgeStylesPalette *palette); -// }}} -// {{{ Notifications - -@interface EdgeStylesPalette (Notifications) -- (void) selectedStyleChanged:(NSNotification*)notification; -@end - -// }}} -// {{{ Private - -@interface EdgeStylesPalette (Private) -- (void) updateButtonState; -- (void) removeSelectedStyle; -- (void) addStyle; -@end - -// }}} -// }}} -// {{{ API - -@implementation EdgeStylesPalette - -@synthesize widget=palette; - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithManager:(StyleManager*)m { - self = [super init]; - - if (self) { - selector = [[EdgeStyleSelector alloc] initWithStyleManager:m]; - editor = [[EdgeStyleEditor alloc] init]; - - palette = gtk_vbox_new (FALSE, 6); - gtk_container_set_border_width (GTK_CONTAINER (palette), 6); - g_object_ref_sink (palette); - - GtkWidget *mainBox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (palette), mainBox, FALSE, FALSE, 0); - gtk_widget_show (mainBox); - - GtkWidget *selectorScroller = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selectorScroller), - GTK_POLICY_NEVER, - GTK_POLICY_AUTOMATIC); - GtkWidget *selectorFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (selectorScroller), [selector widget]); - gtk_container_add (GTK_CONTAINER (selectorFrame), selectorScroller); - gtk_box_pack_start (GTK_BOX (mainBox), selectorFrame, TRUE, TRUE, 0); - gtk_widget_show (selectorScroller); - gtk_widget_show (selectorFrame); - gtk_widget_show ([selector widget]); - - gtk_box_pack_start (GTK_BOX (mainBox), [editor widget], TRUE, TRUE, 0); - gtk_widget_show ([editor widget]); - - GtkBox *buttonBox = GTK_BOX (gtk_hbox_new(FALSE, 0)); - gtk_box_pack_start (GTK_BOX (palette), GTK_WIDGET (buttonBox), FALSE, FALSE, 0); - - GtkWidget *addStyleButton = gtk_button_new (); - gtk_widget_set_tooltip_text (addStyleButton, "Add a new style"); - GtkWidget *addIcon = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (addStyleButton), addIcon); - gtk_box_pack_start (buttonBox, addStyleButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (addStyleButton), - "clicked", - G_CALLBACK (add_style_button_cb), - self); - - removeStyleButton = gtk_button_new (); - g_object_ref_sink (removeStyleButton); - gtk_widget_set_tooltip_text (removeStyleButton, "Delete selected style"); - GtkWidget *removeIcon = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (removeStyleButton), removeIcon); - gtk_box_pack_start (buttonBox, removeStyleButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (removeStyleButton), - "clicked", - G_CALLBACK (remove_style_button_cb), - self); - - gtk_widget_show_all (GTK_WIDGET (buttonBox)); - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(selectedStyleChanged:) - name:@"SelectedStyleChanged" - object:selector]; - - [self updateButtonState]; - } - - return self; -} - -- (StyleManager*) styleManager { - return [[selector model] styleManager]; -} - -- (void) setStyleManager:(StyleManager*)m { - [[selector model] setStyleManager:m]; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [editor release]; - [selector release]; - - g_object_unref (palette); - g_object_unref (removeStyleButton); - - [super dealloc]; -} - -@end - -// }}} -// {{{ Notifications - -@implementation EdgeStylesPalette (Notifications) -- (void) selectedStyleChanged:(NSNotification*)notification { - [editor setStyle:[selector selectedStyle]]; - [self updateButtonState]; -} -@end - -// }}} -// {{{ Private - -@implementation EdgeStylesPalette (Private) -- (void) updateButtonState { - gboolean hasStyleSelection = [selector selectedStyle] != nil; - gtk_widget_set_sensitive (removeStyleButton, hasStyleSelection); -} - -- (void) removeSelectedStyle { - EdgeStyle *style = [selector selectedStyle]; - if (style) - [[[selector model] styleManager] removeEdgeStyle:style]; -} - -- (void) addStyle { - EdgeStyle *newStyle = [EdgeStyle defaultEdgeStyleWithName:@"newstyle"]; - [[self styleManager] addEdgeStyle:newStyle]; - [selector setSelectedStyle:newStyle]; - [editor selectNameField]; -} - -@end - -// }}} -// {{{ GTK+ callbacks - -static void add_style_button_cb (GtkButton *widget, EdgeStylesPalette *palette) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [palette addStyle]; - [pool drain]; -} - -static void remove_style_button_cb (GtkButton *widget, EdgeStylesPalette *palette) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [palette removeSelectedStyle]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/FileChooserDialog.h b/tikzit-old/src/gtk/FileChooserDialog.h deleted file mode 100644 index 80b03f5..0000000 --- a/tikzit-old/src/gtk/FileChooserDialog.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@interface FileChooserDialog: NSObject { - GtkFileChooser *dialog; -} - -+ (FileChooserDialog*) saveDialog; -+ (FileChooserDialog*) saveDialogWithParent:(GtkWindow*)parent; -+ (FileChooserDialog*) saveDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent; -+ (FileChooserDialog*) openDialog; -+ (FileChooserDialog*) openDialogWithParent:(GtkWindow*)parent; -+ (FileChooserDialog*) openDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent; - -- (id) initSaveDialog; -- (id) initSaveDialogWithParent:(GtkWindow*)parent; -- (id) initSaveDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent; -- (id) initOpenDialog; -- (id) initOpenDialogWithParent:(GtkWindow*)parent; -- (id) initOpenDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent; - -- (void) addStandardFilters; -- (void) addFileFilter:(NSString*)filterName withPattern:(NSString*)filePattern; -- (void) addFileFilter:(NSString*)filterName withPattern:(NSString*)filePattern setSelected:(BOOL)selected; - -- (void) setCurrentFolder:(NSString*)path; -- (NSString*) currentFolder; - -- (void) setSuggestedName:(NSString*)fileName; - -- (NSString*) filePath; - -- (BOOL) showDialog; - -- (void) destroy; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/FileChooserDialog.m b/tikzit-old/src/gtk/FileChooserDialog.m deleted file mode 100644 index 9498e4c..0000000 --- a/tikzit-old/src/gtk/FileChooserDialog.m +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "FileChooserDialog.h" - -@implementation FileChooserDialog: NSObject - -+ (FileChooserDialog*) saveDialog { return [[[self alloc] initSaveDialog] autorelease]; } -+ (FileChooserDialog*) saveDialogWithParent:(GtkWindow*)parent - { return [[[self alloc] initSaveDialogWithParent:parent] autorelease]; } -+ (FileChooserDialog*) saveDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent - { return [[[self alloc] initSaveDialogWithTitle:title parent:parent] autorelease]; } -+ (FileChooserDialog*) openDialog { return [[[self alloc] initOpenDialog] autorelease]; } -+ (FileChooserDialog*) openDialogWithParent:(GtkWindow*)parent - { return [[[self alloc] initOpenDialogWithParent:parent] autorelease]; } -+ (FileChooserDialog*) openDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent - { return [[[self alloc] initOpenDialogWithTitle:title parent:parent] autorelease]; } - -- (id) initSaveDialog { return [self initSaveDialogWithParent:NULL]; } -- (id) initSaveDialogWithParent:(GtkWindow*)parent - { return [self initSaveDialogWithTitle:@"Save file" parent:parent]; } -- (id) initSaveDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent { - self = [super init]; - - if (self) { - dialog = GTK_FILE_CHOOSER (gtk_file_chooser_dialog_new ( - [title UTF8String], - parent, - GTK_FILE_CHOOSER_ACTION_SAVE, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, - NULL)); - gtk_file_chooser_set_do_overwrite_confirmation (dialog, TRUE); - } - - return self; -} - -- (id) initOpenDialog { return [self initOpenDialogWithParent:NULL]; } -- (id) initOpenDialogWithParent:(GtkWindow*)parent - { return [self initOpenDialogWithTitle:@"Open file" parent:parent]; } -- (id) initOpenDialogWithTitle:(NSString*)title parent:(GtkWindow*)parent { - self = [super init]; - - if (self) { - dialog = GTK_FILE_CHOOSER (gtk_file_chooser_dialog_new ( - [title UTF8String], - parent, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL)); - } - - return self; -} - -- (void) addStandardFilters { - GtkFileFilter *tikzfilter = gtk_file_filter_new(); - gtk_file_filter_set_name(tikzfilter, ".tikz files"); - gtk_file_filter_add_pattern(tikzfilter, "*.tikz"); - gtk_file_chooser_add_filter(dialog, tikzfilter); - GtkFileFilter *allfilter = gtk_file_filter_new(); - gtk_file_filter_set_name(allfilter, "all files"); - gtk_file_filter_add_pattern(allfilter, "*"); - gtk_file_chooser_add_filter(dialog, allfilter); - gtk_file_chooser_set_filter(dialog, tikzfilter); -} - -- (void) addFileFilter:(NSString*)filterName withPattern:(NSString*)filePattern { - [self addFileFilter:filterName withPattern:filePattern setSelected:NO]; -} - -- (void) addFileFilter:(NSString*)filterName withPattern:(NSString*)filePattern setSelected:(BOOL)selected { - GtkFileFilter *oldFilter = selected ? NULL : gtk_file_chooser_get_filter (dialog); - GtkFileFilter *filter = gtk_file_filter_new(); - gtk_file_filter_set_name(filter, [filterName UTF8String]); - gtk_file_filter_add_pattern(filter, [filePattern UTF8String]); - gtk_file_chooser_add_filter(dialog, filter); - if (selected) { - gtk_file_chooser_set_filter (dialog, filter); - } else if (oldFilter) { - gtk_file_chooser_set_filter (dialog, oldFilter); - } -} - -- (void) setCurrentFolder:(NSString*)path { - gchar *folder = [path glibFilename]; - if (folder) { - gtk_file_chooser_set_current_folder(dialog, folder); - g_free (folder); - } -} - -- (NSString*) currentFolder { - NSString *path = nil; - gchar *folder = gtk_file_chooser_get_current_folder(dialog); - if (folder) { - path = [NSString stringWithGlibFilename:folder]; - g_free (folder); - } - return path; -} - -- (void) setSuggestedName:(NSString*)fileName { - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), [fileName UTF8String]); -} - -- (NSString*) filePath { - NSString *path = nil; - gchar *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - if (filename) { - path = [NSString stringWithGlibFilename:filename]; - g_free (filename); - } - return path; -} - -- (BOOL) showDialog { - return (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) ? YES : NO; -} - -- (void) destroy { - gtk_widget_destroy (GTK_WIDGET (dialog)); - dialog = NULL; -} - -- (void) dealloc { - if (dialog) { - g_warning ("Failed to destroy file chooser dialog!\n"); - gtk_widget_destroy (GTK_WIDGET (dialog)); - } - [super dealloc]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/GraphEditorPanel.h b/tikzit-old/src/gtk/GraphEditorPanel.h deleted file mode 100644 index 2b93259..0000000 --- a/tikzit-old/src/gtk/GraphEditorPanel.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Tool.h" -#import - -@class GraphInputHandler; -@class GraphRenderer; -@class TikzDocument; -@class WidgetSurface; - -@protocol PreviewHandler -- (void) showPreview; -@end -@interface GraphEditorPanel : NSObject { - GraphRenderer *renderer; - WidgetSurface *surface; - GraphInputHandler *inputHandler; - id previewHandler; - id tool; -} -@property (retain) TikzDocument *document; -@property (readonly) GtkWidget *widget; -@property (retain) id activeTool; -@property (assign) id previewHandler; - -- (id) init; -- (id) initWithDocument:(TikzDocument*)document; -- (void) grabTool; -- (void) zoomInAboutPoint:(NSPoint)pos; -- (void) zoomOutAboutPoint:(NSPoint)pos; -- (void) zoomIn; -- (void) zoomOut; -- (void) zoomReset; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/GraphEditorPanel.m b/tikzit-old/src/gtk/GraphEditorPanel.m deleted file mode 100644 index dac52a0..0000000 --- a/tikzit-old/src/gtk/GraphEditorPanel.m +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "GraphEditorPanel.h" - -#import "Application.h" -#import "GraphRenderer.h" -#import "HandTool.h" -#import "InputDelegate.h" -#import "TikzDocument.h" -#import "WidgetSurface.h" - -#import - -@class GraphRenderer; -@class WidgetSurface; - -static const InputMask zoomPanMask = ControlMask; - -/** - * Mostly just a multiplexer, but also handles zoom and pan - * when ctrl is held - */ -@interface GraphInputHandler : NSObject { - GraphEditorPanel *panel; - NSPoint dragOrigin; - NSPoint oldGraphOrigin; - BOOL zoomPanActive; -} -- (id) initForPanel:(GraphEditorPanel*)p; -@end - -@implementation GraphEditorPanel - -@synthesize previewHandler; - -- (id) init { - return [self initWithDocument:nil]; -} -- (id) initWithDocument:(TikzDocument*)document { - self = [super init]; - if (self) { - surface = [[WidgetSurface alloc] init]; - [surface setDefaultScale:50.0f]; - [surface setKeepCentered:YES]; - [surface setCanFocus:YES]; - renderer = [[GraphRenderer alloc] initWithSurface:surface document:document]; - - inputHandler = [[GraphInputHandler alloc] initForPanel:self]; - [surface setInputDelegate:inputHandler]; - } - return self; -} - -- (void) dealloc { - [renderer release]; - [surface release]; - [inputHandler release]; - - [super dealloc]; -} - -- (GraphRenderer*) renderer { - return renderer; -} -- (TikzDocument*) document { - return [renderer document]; -} -- (void) setDocument:(TikzDocument*)doc { - [renderer setDocument:doc]; -} -- (GtkWidget*) widget { - return [surface widget]; -} -- (id) activeTool { - return tool; -} -- (void) setActiveTool:(id)t { - if (t == tool) - return; - - [[[renderer document] pickSupport] deselectAllNodes]; - [[[renderer document] pickSupport] deselectAllEdges]; - - id oldTool = tool; - BOOL weHadTool = ([oldTool activeRenderer] == renderer); - if (weHadTool) { - [oldTool setActiveRenderer:nil]; - } - - tool = [t retain]; - [oldTool release]; - - if (weHadTool) { - [self grabTool]; - } -} - -- (BOOL) hasTool { - return [tool activeRenderer] == renderer; -} - -- (void) grabTool { - if ([tool activeRenderer] != renderer) { - [[tool activeRenderer] setPostRenderer:nil]; - [tool setActiveRenderer:renderer]; - } - [renderer setPostRenderer:tool]; -} - -- (void) zoomInAboutPoint:(NSPoint)pos { [surface zoomInAboutPoint:pos]; } -- (void) zoomOutAboutPoint:(NSPoint)pos { [surface zoomOutAboutPoint:pos]; } -- (void) zoomIn { [surface zoomIn]; } -- (void) zoomOut { [surface zoomOut]; } -- (void) zoomReset { [surface zoomReset]; } - -@end - -@implementation GraphInputHandler -- (id) initForPanel:(GraphEditorPanel*)p { - self = [super init]; - if (self) { - // NB: no retention! - panel = p; - } - return self; -} -- (id) init { - [self release]; - return nil; -} -- (void) dealloc { - [super dealloc]; -} - -// FIXME: share code with HandTool? -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (mask == zoomPanMask && button == LeftButton) { - dragOrigin = pos; - oldGraphOrigin = [[[panel renderer] transformer] origin]; - zoomPanActive = YES; - } else { - zoomPanActive = NO; - [panel grabTool]; - id tool = [panel activeTool]; - if ([tool respondsToSelector:@selector(mousePressAt:withButton:andMask:)]) { - [tool mousePressAt:pos withButton:button andMask:mask]; - } - } -} - -- (void) mouseDoubleClickAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - [panel grabTool]; - id tool = [panel activeTool]; - if ([tool respondsToSelector:@selector(mouseDoubleClickAt:withButton:andMask:)]) { - [tool mouseDoubleClickAt:pos withButton:button andMask:mask]; - } -} - -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (zoomPanActive && button == LeftButton) { - zoomPanActive = NO; - } else if ([panel hasTool]) { - id tool = [panel activeTool]; - if ([tool respondsToSelector:@selector(mouseReleaseAt:withButton:andMask:)]) { - [tool mouseReleaseAt:pos withButton:button andMask:mask]; - } - } -} - -- (void) mouseMoveTo:(NSPoint)pos withButtons:(MouseButton)buttons andMask:(InputMask)mask { - if (zoomPanActive && (buttons & LeftButton)) { - NSPoint newGraphOrigin = oldGraphOrigin; - newGraphOrigin.x += pos.x - dragOrigin.x; - newGraphOrigin.y += pos.y - dragOrigin.y; - [[[panel renderer] transformer] setOrigin:newGraphOrigin]; - [[panel renderer] invalidateGraph]; - } else if ([panel hasTool]) { - id tool = [panel activeTool]; - if ([tool respondsToSelector:@selector(mouseMoveTo:withButtons:andMask:)]) { - [tool mouseMoveTo:pos withButtons:buttons andMask:mask]; - } - } -} - -- (void) mouseScrolledAt:(NSPoint)pos inDirection:(ScrollDirection)dir withMask:(InputMask)mask { - if (mask == zoomPanMask) { - if (dir == ScrollUp) { - [panel zoomInAboutPoint:pos]; - } else if (dir == ScrollDown) { - [panel zoomOutAboutPoint:pos]; - } - } else { - id tool = [panel activeTool]; - if ([panel hasTool] && [tool respondsToSelector:@selector(mouseScrolledAt:inDirection:withMask:)]) { - [tool mouseScrolledAt:pos inDirection:dir withMask:mask]; - } - } -} - -- (void) keyPressed:(unsigned int)keyVal withMask:(InputMask)mask { - if (keyVal == GDK_KEY_space && !mask) { - return; - } - if (![app activateToolForKey:keyVal withMask:mask]) { - id tool = [panel activeTool]; - if ([panel hasTool] && [tool respondsToSelector:@selector(keyPressed:withMask:)]) { - [tool keyPressed:keyVal withMask:mask]; - } - } -} - -- (void) keyReleased:(unsigned int)keyVal withMask:(InputMask)mask { - if (keyVal == GDK_KEY_space && !mask) { - [[panel previewHandler] showPreview]; - } - if (![app activateToolForKey:keyVal withMask:mask]) { - id tool = [panel activeTool]; - if ([panel hasTool] && [tool respondsToSelector:@selector(keyReleased:withMask:)]) { - [tool keyReleased:keyVal withMask:mask]; - } - } -} -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/GraphRenderer.h b/tikzit-old/src/gtk/GraphRenderer.h deleted file mode 100644 index 730d606..0000000 --- a/tikzit-old/src/gtk/GraphRenderer.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -// classes -#import "Graph.h" -#import "Grid.h" -#import "PickSupport.h" -#import "TikzDocument.h" - -// protocols -#import "Surface.h" - -@interface GraphRenderer: NSObject { - TikzDocument *doc; - NSObject *surface; - Grid *grid; - NSMutableSet *highlightedNodes; - id postRenderer; -} - -@property (retain) id postRenderer; - -- (id) initWithSurface:(NSObject *)surface; -- (id) initWithSurface:(NSObject *)surface document:(TikzDocument*)document; -- (void) renderWithContext:(id)context; -- (void) invalidateRect:(NSRect)rect; -- (void) invalidateGraph; -- (void) invalidateNode:(Node*)node; -- (void) invalidateEdge:(Edge*)edge; -- (void) invalidateNodesHitBy:(NSPoint)point; -- (BOOL) point:(NSPoint)p hitsNode:(Node*)node; -- (BOOL) point:(NSPoint)p hitsEdge:(Edge*)edge withFuzz:(float)fuzz; -/** - * Finds a node at the given screen location. - * - * If there is more than one node at this point (because they overlap), - * an arbitrary one is returned. - */ -- (Node*) anyNodeAt:(NSPoint)p; -/** - * Finds an edge at the given screen location. - * - * If there is more than one edge at this point (because they overlap), - * an arbitrary one is returned. - * - * @param fuzz the fuzz for detecting edges: this will pick up - * edges that are close to the point - */ -- (Edge*) anyEdgeAt:(NSPoint)p withFuzz:(float)fuzz; - -- (id) surface; -- (Transformer*) transformer; -- (Grid*) grid; -- (PickSupport*) pickSupport; - -- (Graph*) graph; - -- (TikzDocument*) document; -- (void) setDocument:(TikzDocument*)document; - -- (BOOL) isNodeHighlighted:(Node*)node; -- (void) setNode:(Node*)node highlighted:(BOOL)h; -- (void) clearHighlightedNodes; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/GraphRenderer.m b/tikzit-old/src/gtk/GraphRenderer.m deleted file mode 100644 index b413d3e..0000000 --- a/tikzit-old/src/gtk/GraphRenderer.m +++ /dev/null @@ -1,476 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "GraphRenderer.h" -#import "Edge+Render.h" -#import "Node+Render.h" -#import "Shape.h" - -void graph_renderer_expose_event(GtkWidget *widget, GdkEventExpose *event); - -@interface GraphRenderer (Private) -- (enum NodeState) nodeState:(Node*)node; -- (void) renderBoundingBoxWithContext:(id)context; -- (void) nodeNeedsRefreshing:(NSNotification*)notification; -- (void) edgeNeedsRefreshing:(NSNotification*)notification; -- (void) graphNeedsRefreshing:(NSNotification*)notification; -- (void) graphChanged:(NSNotification*)notification; -- (void) nodeStylePropertyChanged:(NSNotification*)notification; -- (void) edgeStylePropertyChanged:(NSNotification*)notification; -- (void) shapeDictionaryReplaced:(NSNotification*)notification; -@end - -@implementation GraphRenderer - -- (id) initWithSurface:(NSObject *)s { - self = [super init]; - - if (self) { - surface = [s retain]; - grid = [[Grid alloc] initWithSpacing:1.0f subdivisions:4 transformer:[s transformer]]; - highlightedNodes = [[NSMutableSet alloc] initWithCapacity:10]; - [surface setRenderDelegate:self]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeStylePropertyChanged:) - name:@"NodeStylePropertyChanged" - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeStylePropertyChanged:) - name:@"EdgeStylePropertyChanged" - object:nil]; - } - - return self; -} - -- (id) initWithSurface:(NSObject *)s document:(TikzDocument*)document { - self = [self initWithSurface:s]; - - if (self) { - [self setDocument:document]; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [doc release]; - [grid release]; - [highlightedNodes release]; - [surface release]; - - [super dealloc]; -} - -- (id) postRenderer { - return postRenderer; -} -- (void) setPostRenderer:(id)r { - if (r == postRenderer) - return; - - [r retain]; - [postRenderer release]; - postRenderer = r; - - [self invalidateGraph]; -} - -- (void) renderWithContext:(id)context onSurface:(id)s { - [self renderWithContext:context]; - if ([s hasFocus]) { - [s renderFocus]; - } -} - -- (void) renderWithContext:(id)context { - // blank surface - [context paintWithColor:WhiteRColor]; - - // draw grid - [grid renderGridInContext:context]; - - // draw edges - NSEnumerator *enumerator = [doc edgeEnumerator]; - Edge *edge; - while ((edge = [enumerator nextObject]) != nil) { - [edge renderToSurface:surface withContext:context selected:[doc isEdgeSelected:edge]]; - } - - // draw nodes - enumerator = [doc nodeEnumerator]; - Node *node; - while ((node = [enumerator nextObject]) != nil) { - [node renderToSurface:surface withContext:context state:[self nodeState:node]]; - } - - [self renderBoundingBoxWithContext:context]; - [postRenderer renderWithContext:context onSurface:surface]; -} - -- (void) invalidateGraph { - [surface invalidate]; -} - -- (void) invalidateRect:(NSRect)rect { - [surface invalidateRect:rect]; -} - -- (void) invalidateNodes:(NSSet*)nodes { - for (Node *node in nodes) { - [self invalidateNode:node]; - } -} - -- (void) invalidateEdges:(NSSet*)edges { - for (Edge *edge in edges) { - [self invalidateEdge:edge]; - } -} - -- (void) invalidateNode:(Node*)node { - if (node == nil) { - return; - } - NSRect nodeRect = [node renderBoundsWithLabelForSurface:surface]; - nodeRect = NSInsetRect (nodeRect, -2.0f, -2.0f); - [surface invalidateRect:nodeRect]; -} - -- (void) invalidateEdge:(Edge*)edge { - if (edge == nil) { - return; - } - BOOL selected = [doc isEdgeSelected:edge]; - NSRect edgeRect = [edge renderedBoundsWithTransformer:[surface transformer] whenSelected:selected]; - edgeRect = NSInsetRect (edgeRect, -2.0f, -2.0f); - [surface invalidateRect:edgeRect]; -} - -- (void) invalidateNodesHitBy:(NSPoint)point { - NSEnumerator *enumerator = [doc nodeEnumerator]; - Node *node = nil; - while ((node = [enumerator nextObject]) != nil) { - if ([self point:point hitsNode:node]) { - [self invalidateNode:node]; - } - } -} - -- (BOOL) point:(NSPoint)p hitsNode:(Node*)node { - return [node hitByPoint:p onSurface:surface]; -} - -- (BOOL) point:(NSPoint)p fuzzyHitsNode:(Node*)node { - NSRect bounds = [node renderBoundsForSurface:surface]; - return NSPointInRect(p, bounds); -} - -- (BOOL) point:(NSPoint)p hitsEdge:(Edge*)edge withFuzz:(float)fuzz { - return [edge hitByPoint:p onSurface:surface withFuzz:fuzz]; -} - -- (Node*) anyNodeAt:(NSPoint)p { - NSEnumerator *enumerator = [doc nodeEnumerator]; - Node *node; - while ((node = [enumerator nextObject]) != nil) { - if ([self point:p hitsNode:node]) { - return node; - } - } - return nil; -} - -- (Edge*) anyEdgeAt:(NSPoint)p withFuzz:(float)fuzz { - // FIXME: is there an efficient way to find the "nearest" edge - // if the fuzz is the reason we hit more than one? - NSEnumerator *enumerator = [doc edgeEnumerator]; - Edge *edge; - while ((edge = [enumerator nextObject]) != nil) { - if ([self point:p hitsEdge:edge withFuzz:fuzz]) { - return edge; - } - } - return nil; -} - -- (id) surface { - return surface; -} - -- (Transformer*) transformer { - return [surface transformer]; -} - -- (Grid*) grid { - return grid; -} - -- (PickSupport*) pickSupport { - return [doc pickSupport]; -} - -- (Graph*) graph { - return [doc graph]; -} - -- (TikzDocument*) document { - return doc; -} - -- (void) setDocument:(TikzDocument*)document { - if (doc == document) { - return; - } - - if (doc != nil) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:doc]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:[doc pickSupport]]; - } - - [document retain]; - [doc release]; - doc = document; - - if (doc != nil) { - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(graphNeedsRefreshing:) - name:@"GraphReplaced" object:doc]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(graphChanged:) - name:@"GraphChanged" object:doc]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(graphChanged:) - name:@"GraphBeingChanged" object:doc]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(graphChanged:) - name:@"GraphChangeCancelled" object:doc]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(nodeNeedsRefreshing:) - name:@"NodeSelected" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(nodeNeedsRefreshing:) - name:@"NodeDeselected" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(graphNeedsRefreshing:) - name:@"NodeSelectionReplaced" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(edgeNeedsRefreshing:) - name:@"EdgeSelected" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(edgeNeedsRefreshing:) - name:@"EdgeDeselected" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(graphNeedsRefreshing:) - name:@"EdgeSelectionReplaced" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(shapeDictionaryReplaced:) - name:@"ShapeDictionaryReplaced" - object:[Shape class]]; - } - [surface invalidate]; -} - -- (BOOL) isNodeHighlighted:(Node*)node { - return [highlightedNodes containsObject:node]; -} -- (void) setNode:(Node*)node highlighted:(BOOL)h { - if (h) { - if (![highlightedNodes containsObject:node]) { - [highlightedNodes addObject:node]; - [self invalidateNode:node]; - } - } else { - if ([highlightedNodes containsObject:node]) { - [highlightedNodes removeObject:node]; - [self invalidateNode:node]; - } - } -} -- (void) clearHighlightedNodes { - [self invalidateNodes:highlightedNodes]; - [highlightedNodes removeAllObjects]; -} - -@end - -@implementation GraphRenderer (Private) -- (enum NodeState) nodeState:(Node*)node { - if ([doc isNodeSelected:node]) { - return NodeSelected; - } else if ([self isNodeHighlighted:node]) { - return NodeHighlighted; - } else { - return NodeNormal; - } -} - -- (void) renderBoundingBoxWithContext:(id)context { - if ([[self graph] hasBoundingBox]) { - [context saveState]; - - NSRect bbox = [[surface transformer] rectToScreen:[[self graph] boundingBox]]; - - [context setAntialiasMode:AntialiasDisabled]; - [context setLineWidth:1.0]; - [context startPath]; - [context rect:bbox]; - [context strokePathWithColor:MakeSolidRColor (1.0, 0.7, 0.5)]; - - [context restoreState]; - } -} - -- (void) nodeNeedsRefreshing:(NSNotification*)notification { - [self invalidateNode:[[notification userInfo] objectForKey:@"node"]]; -} - -- (void) edgeNeedsRefreshing:(NSNotification*)notification { - Edge *edge = [[notification userInfo] objectForKey:@"edge"]; - NSRect edgeRect = [edge renderedBoundsWithTransformer:[surface transformer] whenSelected:YES]; - edgeRect = NSInsetRect (edgeRect, -2, -2); - [surface invalidateRect:edgeRect]; -} - -- (void) graphNeedsRefreshing:(NSNotification*)notification { - [self invalidateGraph]; -} - -- (void) invalidateBentIncidentEdgesForNode:(Node*)nd { - for (Edge *e in [[self graph] inEdgesForNode:nd]) { - if (![e isStraight]) { - [self invalidateEdge:e]; - } - } - for (Edge *e in [[self graph] outEdgesForNode:nd]) { - if (![e isStraight]) { - [self invalidateEdge:e]; - } - } -} - -- (void) graphChanged:(NSNotification*)notification { - GraphChange *change = [[notification userInfo] objectForKey:@"change"]; - switch ([change changeType]) { - case GraphAddition: - case GraphDeletion: - [self invalidateNodes:[change affectedNodes]]; - [self invalidateEdges:[change affectedEdges]]; - break; - case NodePropertyChange: - if (!NSEqualPoints ([[change oldNode] point], [[change nwNode] point])) { - // if the node has moved, it may be affecting edges - [surface invalidate]; - } else if ([[change oldNode] style] != [[change nwNode] style]) { - // change in style means that edges may touch at a different point, - // but this only matters for bent edges - [self invalidateBentIncidentEdgesForNode:[change nodeRef]]; - // invalide both old and new (old node may be larger) - [self invalidateNode:[change oldNode]]; - [self invalidateNode:[change nwNode]]; - } else { - // invalide both old and new (old node may be larger) - [self invalidateNode:[change oldNode]]; - [self invalidateNode:[change nwNode]]; - } - break; - case EdgePropertyChange: - // invalide both old and new (old bend may increase bounds) - [self invalidateEdge:[change oldEdge]]; - [self invalidateEdge:[change nwEdge]]; - [self invalidateEdge:[change edgeRef]]; - break; - case NodesPropertyChange: - { - NSEnumerator *enumerator = [[change oldNodeTable] keyEnumerator]; - Node *node = nil; - while ((node = [enumerator nextObject]) != nil) { - NSPoint oldPos = [[[change oldNodeTable] objectForKey:node] point]; - NSPoint newPos = [[[change nwNodeTable] objectForKey:node] point]; - NodeStyle *oldStyle = [[[change oldNodeTable] objectForKey:node] style]; - NodeStyle *newStyle = [[[change nwNodeTable] objectForKey:node] style]; - if (!NSEqualPoints (oldPos, newPos)) { - [surface invalidate]; - break; - } else if (oldStyle != newStyle) { - [self invalidateBentIncidentEdgesForNode:node]; - [self invalidateNode:[[change oldNodeTable] objectForKey:node]]; - [self invalidateNode:[[change nwNodeTable] objectForKey:node]]; - } else { - [self invalidateNode:[[change oldNodeTable] objectForKey:node]]; - [self invalidateNode:[[change nwNodeTable] objectForKey:node]]; - } - } - } - break; - case NodesShift: - case NodesFlip: - case BoundingBoxChange: - [surface invalidate]; - break; - default: - // unknown change - [surface invalidate]; - break; - }; -} - -- (void) nodeStylePropertyChanged:(NSNotification*)notification { - if (![@"name" isEqual:[[notification userInfo] objectForKey:@"propertyName"]]) { - BOOL affected = NO; - for (Node *node in [[self graph] nodes]) { - if ([node style] == [notification object]) - affected = YES; - } - if (affected) - [surface invalidate]; - } -} - -- (void) edgeStylePropertyChanged:(NSNotification*)notification { - if (![@"name" isEqual:[[notification userInfo] objectForKey:@"propertyName"]]) { - BOOL affected = NO; - for (Edge *edge in [[self graph] edges]) { - if ([edge style] == [notification object]) - affected = YES; - } - if (affected) - [surface invalidate]; - } -} - -- (void) shapeDictionaryReplaced:(NSNotification*)notification { - [surface invalidate]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/HandTool.h b/tikzit-old/src/gtk/HandTool.h deleted file mode 100644 index c96de36..0000000 --- a/tikzit-old/src/gtk/HandTool.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Tool.h" - -@interface HandTool : NSObject { - GraphRenderer *renderer; - NSPoint dragOrigin; - NSPoint oldGraphOrigin; -} - - -+ (id) tool; -- (id) init; -@end - - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/HandTool.m b/tikzit-old/src/gtk/HandTool.m deleted file mode 100644 index c3a0fb4..0000000 --- a/tikzit-old/src/gtk/HandTool.m +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "HandTool.h" - -#import "GraphRenderer.h" -#import "TikzDocument.h" -#import "tzstockitems.h" - -@implementation HandTool -- (NSString*) name { return @"Drag"; } -- (const gchar*) stockId { return TIKZIT_STOCK_DRAG; } -- (NSString*) helpText { return @"Move the diagram to view different parts"; } -- (NSString*) shortcut { return @"m"; } -@synthesize activeRenderer=renderer; - -+ (id) tool { - return [[[self alloc] init] autorelease]; -} - -- (id) init { - return [super init]; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [renderer release]; - - [super dealloc]; -} - -- (GtkWidget*) configurationWidget { return NULL; } - -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - dragOrigin = pos; - oldGraphOrigin = [[renderer transformer] origin]; -} - -- (void) mouseMoveTo:(NSPoint)pos withButtons:(MouseButton)buttons andMask:(InputMask)mask { - if (!(buttons & LeftButton)) - return; - - NSPoint newGraphOrigin = oldGraphOrigin; - newGraphOrigin.x += pos.x - dragOrigin.x; - newGraphOrigin.y += pos.y - dragOrigin.y; - [[renderer transformer] setOrigin:newGraphOrigin]; - [renderer invalidateGraph]; -} - -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask {} - -- (void) renderWithContext:(id)context onSurface:(id)surface {} -- (void) loadConfiguration:(Configuration*)config {} -- (void) saveConfiguration:(Configuration*)config {} -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/InputDelegate.h b/tikzit-old/src/gtk/InputDelegate.h deleted file mode 100644 index 9f9b426..0000000 --- a/tikzit-old/src/gtk/InputDelegate.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" - -typedef enum { - LeftButton = 1, - MiddleButton = 2, - RightButton = 3, - Button4 = 4, - Button5 = 5 -} MouseButton; - -typedef enum { - ShiftMask = 1, - ControlMask = 2, - MetaMask = 4 -} InputMask; - -typedef enum { - ScrollUp = 1, - ScrollDown = 2, - ScrollLeft = 3, - ScrollRight = 4, -} ScrollDirection; - -@protocol InputDelegate -@optional -/** - * A mouse button was pressed. - */ -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask; -/** - * A mouse button was released. - */ -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask; -/** - * A mouse button was double-clicked. - * - * Note that mouseDown and mouseUp events will still be delivered. - * This will be triggered between the second mouseDown and the second - * mouseUp. - */ -- (void) mouseDoubleClickAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask; -/** - * The mouse was moved - */ -- (void) mouseMoveTo:(NSPoint)pos withButtons:(MouseButton)button andMask:(InputMask)mask; -/** - * The mouse was scrolled - */ -- (void) mouseScrolledAt:(NSPoint)pos inDirection:(ScrollDirection)dir withMask:(InputMask)mask; -/** - * A key was pressed - */ -- (void) keyPressed:(unsigned int)keyVal withMask:(InputMask)mask; -/** - * A key was released - */ -- (void) keyReleased:(unsigned int)keyVal withMask:(InputMask)mask; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Menu.h b/tikzit-old/src/gtk/Menu.h deleted file mode 100644 index e0f78d4..0000000 --- a/tikzit-old/src/gtk/Menu.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Window; -@class PickSupport; - -/** - * Manages the menu - */ -@interface Menu: NSObject { - GtkWidget *menubar; - GtkActionGroup *appActions; - GtkActionGroup *windowActions; - GtkAction *undoAction; // no ref - GtkAction *redoAction; // no ref - GtkAction *pasteAction; // no ref - GtkAction **nodeSelBasedActions; - guint nodeSelBasedActionCount; - GtkAction **edgeSelBasedActions; - guint edgeSelBasedActionCount; - GtkAction **selBasedActions; - guint selBasedActionCount; -} - -/** - * The menubar widget, to be inserted into the window - */ -@property (readonly) GtkWidget *menubar; - -/** - * Constructs the menu for @p window - * - * @param window the window that will be acted upon - */ -- (id) initForWindow:(Window*)window; - -/** - * Enables or disables the undo action - */ -- (void) setUndoActionEnabled:(BOOL)enabled; -/** - * Sets the text that describes what action will be undone - * - * @param detail a text description of the action, or nil - */ -- (void) setUndoActionDetail:(NSString*)detail; -/** - * Enables or disables the redo action - */ -- (void) setRedoActionEnabled:(BOOL)enabled; -/** - * Sets the text that describes what action will be redone - * - * @param detail a text description of the action, or nil - */ -- (void) setRedoActionDetail:(NSString*)detail; - -/** - * Gets the paste action - */ -- (GtkAction*) pasteAction; - -/** - * Enables or disables the actions that act on a selection - */ -- (void) notifySelectionChanged:(PickSupport*)pickSupport; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Menu.m b/tikzit-old/src/gtk/Menu.m deleted file mode 100644 index 04c9c31..0000000 --- a/tikzit-old/src/gtk/Menu.m +++ /dev/null @@ -1,737 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * Stuff stolen from glade-window.c in Glade: - * Copyright (C) 2001 Ximian, Inc. - * Copyright (C) 2007 Vincent Geddes. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Menu.h" - -#import "Application.h" -#import "Window.h" -#import "Configuration.h" -#import "PickSupport.h" -#import "Shape.h" -#import "Tool.h" -#import "TikzDocument.h" - -#import -#ifdef _ -#undef _ -#endif -#import -#import - -#import "gtkhelpers.h" - -#import "logo.h" - -// {{{ Application actions -static void new_cb (GtkAction *action, Application *appl) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [appl newWindow]; - [pool drain]; -} - -static void refresh_shapes_cb (GtkAction *action, Application *appl) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [Shape refreshShapeDictionary]; - [pool drain]; -} - -static void show_preferences_cb (GtkAction *action, Application *appl) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [appl presentSettingsDialog]; - [pool drain]; -} - -#ifdef HAVE_POPPLER -static void show_preamble_cb (GtkAction *action, Application *appl) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [appl presentPreamblesEditor]; - [pool drain]; -} -#endif - -static void show_context_window_cb (GtkAction *action, Application *appl) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [appl presentContextWindow]; - [pool drain]; -} - -static void quit_cb (GtkAction *action, Application *appl) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [appl quit]; - [pool drain]; -} - -static void help_cb (GtkAction *action, Application *appl) { - GError *gerror = NULL; - gtk_show_uri (NULL, "http://tikzit.sourceforge.net/manual.html", GDK_CURRENT_TIME, &gerror); - if (gerror != NULL) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - logGError (gerror, @"Could not show help"); - [pool drain]; - } -} - -static void about_cb (GtkAction *action, Application *appl) { - static const gchar * const authors[] = - { "Aleks Kissinger ", - "Chris Heunen ", - "Alex Merry ", - NULL }; - - static const gchar license[] = - N_("TikZiT is free software; you can redistribute it and/or modify " - "it under the terms of the GNU General Public License as " - "published by the Free Software Foundation; either version 2 of the " - "License, or (at your option) any later version." - "\n\n" - "TikZiT is distributed in the hope that it will be useful, " - "but WITHOUT ANY WARRANTY; without even the implied warranty of " - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " - "GNU General Public License for more details." - "\n\n" - "You should have received a copy of the GNU General Public License " - "along with TikZiT; if not, write to the Free Software " - "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, " - "MA 02110-1301, USA."); - - static const gchar copyright[] = - "Copyright \xc2\xa9 2010-2011 Aleks Kissinger, Chris Heunen and Alex Merry."; - - GdkPixbuf *logo = get_logo (LOGO_SIZE_128); - gtk_show_about_dialog (NULL, - "program-name", PACKAGE_NAME, - "logo", logo, - "authors", authors, - "translator-credits", _("translator-credits"), - "comments", _("A graph manipulation program for pgf/tikz graphs"), - "license", _(license), - "wrap-license", TRUE, - "copyright", copyright, - "version", PACKAGE_VERSION, - "website", "http://tikzit.sourceforge.net", - NULL); - g_object_unref (logo); -} - -static GtkActionEntry app_action_entries[] = { - /* - Fields: - * action name - * stock id or name of icon for action - * label for action (mark for translation with N_) - * accelerator (as understood by gtk_accelerator_parse()) - * tooltip (mark for translation with N_) - * callback - */ - { "New", GTK_STOCK_NEW, NULL, "N", - N_("Create a new graph"), G_CALLBACK (new_cb) }, - - { "RefreshShapes", NULL, N_("_Refresh shapes"), NULL, - N_(""), G_CALLBACK (refresh_shapes_cb) }, - - { "Quit", GTK_STOCK_QUIT, NULL, "Q", - N_("Quit the program"), G_CALLBACK (quit_cb) }, - - { "Tool", NULL, N_("_Tool") }, - - { "ShowPreferences", GTK_STOCK_PREFERENCES, N_("Configure TikZiT..."), NULL, - N_("Edit the TikZiT configuration"), G_CALLBACK (show_preferences_cb) }, - -#ifdef HAVE_POPPLER - { "ShowPreamble", NULL, N_("_Edit Preambles..."), NULL, - N_("Edit the preambles used to generate the preview"), G_CALLBACK (show_preamble_cb) }, -#endif - - { "ShowContextWindow", NULL, N_("_Context Window"), NULL, - N_("Show the contextual tools window"), G_CALLBACK (show_context_window_cb) }, - - /* HelpMenu */ - { "HelpManual", GTK_STOCK_HELP, N_("_Online manual"), "F1", - N_("TikZiT manual (online)"), G_CALLBACK (help_cb) }, - - { "About", GTK_STOCK_ABOUT, NULL, NULL, - N_("About this application"), G_CALLBACK (about_cb) }, -}; -static guint n_app_action_entries = G_N_ELEMENTS (app_action_entries); -// }}} -// {{{ Window actions - -static void open_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window openFile]; - [pool drain]; -} - -static void close_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window close]; - [pool drain]; -} - -static void save_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window saveActiveDocument]; - [pool drain]; -} - -static void save_as_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window saveActiveDocumentAs]; - [pool drain]; -} - -static void save_as_shape_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window saveActiveDocumentAsShape]; - [pool drain]; -} - -static void undo_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - TikzDocument *document = [window document]; - if ([document canUndo]) { - [document undo]; - } else { - g_warning ("Can't undo!\n"); - gtk_action_set_sensitive (action, FALSE); - } - - [pool drain]; -} - -static void redo_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - TikzDocument *document = [window document]; - if ([document canRedo]) { - [document redo]; - } else { - g_warning ("Can't redo!\n"); - gtk_action_set_sensitive (action, FALSE); - } - - [pool drain]; -} - -static void cut_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window selectionCutToClipboard]; - [pool drain]; -} - -static void copy_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window selectionCopyToClipboard]; - [pool drain]; -} - -static void paste_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window pasteFromClipboard]; - [pool drain]; -} - -static void delete_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] removeSelected]; - [pool drain]; -} - -static void select_all_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - TikzDocument *document = [window document]; - [[document pickSupport] selectAllNodes:[NSSet setWithArray:[[document graph] nodes]]]; - [pool drain]; -} - -static void deselect_all_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - TikzDocument *document = [window document]; - [[document pickSupport] deselectAllNodes]; - [[document pickSupport] deselectAllEdges]; - [pool drain]; -} - -static void flip_horiz_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] flipSelectedNodesHorizontally]; - [pool drain]; -} - -static void flip_vert_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] flipSelectedNodesVertically]; - [pool drain]; -} - -static void reverse_edges_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] reverseSelectedEdges]; - [pool drain]; -} - -static void bring_forward_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] bringSelectionForward]; - [pool drain]; -} - -static void send_backward_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] sendSelectionBackward]; - [pool drain]; -} - -static void bring_to_front_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] bringSelectionToFront]; - [pool drain]; -} - -static void send_to_back_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[window document] sendSelectionToBack]; - [pool drain]; -} - -#ifdef HAVE_POPPLER -static void show_preview_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window presentPreview]; - [pool drain]; -} -#endif - -static void zoom_in_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window zoomIn]; - [pool drain]; -} - -static void zoom_out_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window zoomOut]; - [pool drain]; -} - -static void zoom_reset_cb (GtkAction *action, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window zoomReset]; - [pool drain]; -} - -static void recent_chooser_item_activated_cb (GtkRecentChooser *chooser, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - gchar *uri, *path; - GError *error = NULL; - - uri = gtk_recent_chooser_get_current_uri (chooser); - - path = g_filename_from_uri (uri, NULL, NULL); - if (error) { - g_warning ("Could not convert uri \"%s\" to a local path: %s", uri, error->message); - g_error_free (error); - return; - } - - [window openFileAtPath:[NSString stringWithGlibFilename:path]]; - - g_free (uri); - g_free (path); - - [pool drain]; -} - - -static GtkActionEntry window_action_entries[] = { - /* - Fields: - * action name - * stock id or name of icon for action - * label for action (mark for translation with N_) - * accelerator (as understood by gtk_accelerator_parse()) - * tooltip (mark for translation with N_) - * callback - */ - { "FileMenu", NULL, N_("_File") }, - { "EditMenu", NULL, N_("_Edit") }, - { "ViewMenu", NULL, N_("_View") }, - { "HelpMenu", NULL, N_("_Help") }, - - { "Arrange", NULL, N_("_Arrange") }, - { "Zoom", NULL, N_("_Zoom") }, - - { "Open", GTK_STOCK_OPEN, N_("_Open\342\200\246") ,"O", - N_("Open a graph"), G_CALLBACK (open_cb) }, - - { "Close", GTK_STOCK_CLOSE, NULL, "W", - N_("Close the current graph"), G_CALLBACK (close_cb) }, - - { "ZoomIn", GTK_STOCK_ZOOM_IN, NULL, "plus", - NULL, G_CALLBACK (zoom_in_cb) }, - - { "ZoomOut", GTK_STOCK_ZOOM_OUT, NULL, "minus", - NULL, G_CALLBACK (zoom_out_cb) }, - - { "ZoomReset", GTK_STOCK_ZOOM_100, N_("_Reset zoom"), "0", - NULL, G_CALLBACK (zoom_reset_cb) }, - - { "Save", GTK_STOCK_SAVE, NULL, "S", - N_("Save the current graph"), G_CALLBACK (save_cb) }, - - { "SaveAs", GTK_STOCK_SAVE_AS, N_("Save _As\342\200\246"), NULL, - N_("Save the current graph with a different name"), G_CALLBACK (save_as_cb) }, - - { "SaveAsShape", NULL, N_("Save As S_hape\342\200\246"), NULL, - N_("Save the current graph as a shape for use in styles"), G_CALLBACK (save_as_shape_cb) }, - - { "Undo", GTK_STOCK_UNDO, NULL, "Z", - N_("Undo the last action"), G_CALLBACK (undo_cb) }, - - { "Redo", GTK_STOCK_REDO, NULL, "Z", - N_("Redo the last action"), G_CALLBACK (redo_cb) }, - - { "Cut", GTK_STOCK_CUT, NULL, NULL, - N_("Cut the selection"), G_CALLBACK (cut_cb) }, - - { "Copy", GTK_STOCK_COPY, NULL, NULL, - N_("Copy the selection"), G_CALLBACK (copy_cb) }, - - { "Paste", GTK_STOCK_PASTE, NULL, NULL, - N_("Paste the clipboard"), G_CALLBACK (paste_cb) }, - - { "Delete", GTK_STOCK_DELETE, NULL, "Delete", - N_("Delete the selection"), G_CALLBACK (delete_cb) }, - - { "SelectAll", GTK_STOCK_SELECT_ALL, NULL, "A", - N_("Select all nodes on the graph"), G_CALLBACK (select_all_cb) }, - - { "DeselectAll", NULL, N_("D_eselect all"), "A", - N_("Deselect everything"), G_CALLBACK (deselect_all_cb) }, - - { "FlipHoriz", NULL, N_("Flip nodes _horizonally"), NULL, - N_("Flip the selected nodes horizontally"), G_CALLBACK (flip_horiz_cb) }, - - { "FlipVert", NULL, N_("Flip nodes _vertically"), NULL, - N_("Flip the selected nodes vertically"), G_CALLBACK (flip_vert_cb) }, - - { "ReverseEdges", NULL, N_("Rever_se edges"), NULL, - N_("Reverse the selected edges"), G_CALLBACK (reverse_edges_cb) }, - - { "SendToBack", NULL, N_("Send to _back"), NULL, - N_("Send the selected nodes and edges to the back of the graph"), G_CALLBACK (send_to_back_cb) }, - - { "SendBackward", NULL, N_("Send b_ackward"), NULL, - N_("Send the selected nodes and edges backward"), G_CALLBACK (send_backward_cb) }, - - { "BringForward", NULL, N_("Bring f_orward"), NULL, - N_("Bring the selected nodes and edges forward"), G_CALLBACK (bring_forward_cb) }, - - { "BringToFront", NULL, N_("Bring to _front"), NULL, - N_("Bring the selected nodes and edges to the front of the graph"), G_CALLBACK (bring_to_front_cb) }, - - /* ViewMenu */ -#ifdef HAVE_POPPLER - { "ShowPreview", NULL, N_("_Preview"), "L", - N_("See the graph as it will look when rendered in LaTeX"), G_CALLBACK (show_preview_cb) }, -#endif -}; -static guint n_window_action_entries = G_N_ELEMENTS (window_action_entries); - -// }}} -// {{{ UI XML - -static const gchar ui_info[] = -"" -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -#ifdef HAVE_POPPLER -" " -" " -#endif -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -/* -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -" " -*/ -""; - - - -// }}} -// {{{ Helper methods - -static void configure_recent_chooser (GtkRecentChooser *chooser) -{ - gtk_recent_chooser_set_local_only (chooser, TRUE); - gtk_recent_chooser_set_show_icons (chooser, FALSE); - gtk_recent_chooser_set_sort_type (chooser, GTK_RECENT_SORT_MRU); - - GtkRecentFilter *filter = gtk_recent_filter_new (); - gtk_recent_filter_add_application (filter, g_get_application_name()); - gtk_recent_chooser_set_filter (chooser, filter); -} - -static void tool_cb (GtkAction *action, id tool) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [app setActiveTool:tool]; - [pool drain]; -} - - - -// }}} -// {{{ API - -@implementation Menu - -- (id) init { - [self release]; - return nil; -} - -- (id) initForWindow:(Window*)window { - self = [super init]; - if (!self) { - return nil; - } - - GError *error = NULL; - - appActions = gtk_action_group_new ("TZApp"); - //gtk_action_group_set_translation_domain (actions, GETTEXT_PACKAGE); - gtk_action_group_add_actions (appActions, - app_action_entries, - n_app_action_entries, - app); - for (id tool in [app tools]) { - NSString *tooltip = [NSString stringWithFormat: - @"%@: %@ (%@)", [tool name], [tool helpText], [tool shortcut]]; - GtkAction *action = gtk_action_new ( - [[tool name] UTF8String], - [[tool name] UTF8String], - [tooltip UTF8String], - [tool stockId]); - gtk_action_group_add_action_with_accel ( - appActions, - action, - NULL); - g_signal_connect ( - G_OBJECT (action), - "activate", - G_CALLBACK (tool_cb), - tool); - g_object_unref (action); - } - - windowActions = gtk_action_group_new ("TZWindow"); - //gtk_action_group_set_translation_domain (windowActions, GETTEXT_PACKAGE); - - gtk_action_group_add_actions (windowActions, - window_action_entries, - n_window_action_entries, - window); - - GtkAction *action = gtk_recent_action_new ("OpenRecent", N_("Open _Recent"), NULL, NULL); - g_signal_connect (G_OBJECT (action), - "item-activated", - G_CALLBACK (recent_chooser_item_activated_cb), - window); - configure_recent_chooser (GTK_RECENT_CHOOSER (action)); - gtk_action_group_add_action_with_accel (windowActions, action, NULL); - g_object_unref (action); - - /* Save refs to actions that will need to be updated */ - undoAction = gtk_action_group_get_action (windowActions, "Undo"); - redoAction = gtk_action_group_get_action (windowActions, "Redo"); - pasteAction = gtk_action_group_get_action (windowActions, "Paste"); - - nodeSelBasedActionCount = 4; - nodeSelBasedActions = g_new (GtkAction*, nodeSelBasedActionCount); - nodeSelBasedActions[0] = gtk_action_group_get_action (windowActions, "Cut"); - nodeSelBasedActions[1] = gtk_action_group_get_action (windowActions, "Copy"); - nodeSelBasedActions[2] = gtk_action_group_get_action (windowActions, "FlipHoriz"); - nodeSelBasedActions[3] = gtk_action_group_get_action (windowActions, "FlipVert"); - edgeSelBasedActionCount = 1; - edgeSelBasedActions = g_new (GtkAction*, edgeSelBasedActionCount); - edgeSelBasedActions[0] = gtk_action_group_get_action (windowActions, "ReverseEdges"); - selBasedActionCount = 2; - selBasedActions = g_new (GtkAction*, selBasedActionCount); - selBasedActions[0] = gtk_action_group_get_action (windowActions, "Delete"); - selBasedActions[1] = gtk_action_group_get_action (windowActions, "DeselectAll"); - - - GtkUIManager *ui = gtk_ui_manager_new (); - gtk_ui_manager_insert_action_group (ui, windowActions, 0); - gtk_ui_manager_insert_action_group (ui, appActions, 1); - gtk_window_add_accel_group ([window gtkWindow], gtk_ui_manager_get_accel_group (ui)); - if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, -1, &error)) - { - g_message ("Building menus failed: %s", error->message); - g_error_free (error); - g_object_unref (ui); - [self release]; - return nil; - } - guint tool_merge_id = gtk_ui_manager_new_merge_id (ui); - for (id tool in [app tools]) { - gtk_ui_manager_add_ui (ui, - tool_merge_id, - "/ui/MenuBar/EditMenu/Tool", - [[tool name] UTF8String], - [[tool name] UTF8String], - GTK_UI_MANAGER_AUTO, - FALSE); - } - menubar = gtk_ui_manager_get_widget (ui, "/MenuBar"); - g_object_ref_sink (menubar); - g_object_unref (ui); - - return self; -} - -- (void) dealloc { - g_free (nodeSelBasedActions); - g_free (edgeSelBasedActions); - g_free (selBasedActions); - g_object_unref (menubar); - g_object_unref (appActions); - g_object_unref (windowActions); - - [super dealloc]; -} - -@synthesize menubar; - -- (void) setUndoActionEnabled:(BOOL)enabled { - gtk_action_set_sensitive (undoAction, enabled); -} - -- (void) setUndoActionDetail:(NSString*)detail { - gtk_action_set_detailed_label (undoAction, "_Undo", [detail UTF8String]); -} - -- (void) setRedoActionEnabled:(BOOL)enabled { - gtk_action_set_sensitive (redoAction, enabled); -} - -- (void) setRedoActionDetail:(NSString*)detail { - gtk_action_set_detailed_label (redoAction, "_Redo", [detail UTF8String]); -} - -- (GtkAction*) pasteAction { - return pasteAction; -} - -- (void) notifySelectionChanged:(PickSupport*)pickSupport { - BOOL hasSelectedNodes = [[pickSupport selectedNodes] count] > 0; - BOOL hasSelectedEdges = [[pickSupport selectedEdges] count] > 0; - for (int i = 0; i < nodeSelBasedActionCount; ++i) { - if (nodeSelBasedActions[i]) { - gtk_action_set_sensitive (nodeSelBasedActions[i], hasSelectedNodes); - } - } - for (int i = 0; i < edgeSelBasedActionCount; ++i) { - if (edgeSelBasedActions[i]) { - gtk_action_set_sensitive (edgeSelBasedActions[i], hasSelectedEdges); - } - } - for (int i = 0; i < selBasedActionCount; ++i) { - if (selBasedActions[i]) { - gtk_action_set_sensitive (selBasedActions[i], hasSelectedNodes || hasSelectedEdges); - } - } -} - -@end - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/NSError+Glib.h b/tikzit-old/src/gtk/NSError+Glib.h deleted file mode 100644 index 137977e..0000000 --- a/tikzit-old/src/gtk/NSError+Glib.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import - -@interface NSError(Glib) -+ (id) errorWithGError:(GError*)gerror; -@end - -void GErrorToNSError(GError *errorIn, NSError **errorOut); -void logGError (GError *error, NSString *message); - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NSError+Glib.m b/tikzit-old/src/gtk/NSError+Glib.m deleted file mode 100644 index f466d9e..0000000 --- a/tikzit-old/src/gtk/NSError+Glib.m +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NSError+Glib.h" -#import "TZFoundation.h" - -@implementation NSError(Glib) -+ (id) errorWithGError:(GError*)gerror { - if (!gerror) - return nil; - - NSString *message = [NSString stringWithUTF8String:gerror->message]; - NSString *domain = [NSString stringWithUTF8String:g_quark_to_string(gerror->domain)]; - - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionaryWithObject:message - forKey:NSLocalizedDescriptionKey]; - return [self errorWithDomain:domain code:gerror->code userInfo:errorDetail]; -} -@end - -void GErrorToNSError(GError *errorIn, NSError **errorOut) -{ - if (errorOut && errorIn) { - *errorOut = [NSError errorWithGError:errorIn]; - } -} - -void logGError (GError *error, NSString *message) { - if (message == nil) { - NSLog (@"%s", error->message); - } else { - NSLog (@"%@: %s", message, error->message); - } -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NSFileManager+Glib.h b/tikzit-old/src/gtk/NSFileManager+Glib.h deleted file mode 100644 index cb49fcb..0000000 --- a/tikzit-old/src/gtk/NSFileManager+Glib.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import - -@interface NSFileManager(Glib) -/** - * Creates a directory in the system temp directory - */ -- (NSString*) createTempDirectoryWithError:(NSError**)error; -/** - * Creates a directory in the system temp directory - */ -- (NSString*) createTempDirectory; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NSFileManager+Glib.m b/tikzit-old/src/gtk/NSFileManager+Glib.m deleted file mode 100644 index b3e9de6..0000000 --- a/tikzit-old/src/gtk/NSFileManager+Glib.m +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NSFileManager+Glib.h" -#import "TZFoundation.h" -#import "mkdtemp.h" - -@implementation NSFileManager(Glib) - -- (NSString*) createTempDirectoryWithError:(NSError**)error { - NSString *result = nil; -#if GLIB_CHECK_VERSION (2, 30, 0) - GError *gerror = NULL; - gchar *dir = g_dir_make_tmp ("tikzitXXXXXX", &gerror); - GErrorToNSError (gerror, error); - if (dir) - result = [NSString stringWithGlibFilename:dir]; - g_free (dir); -#else -//#if (!GLIB_CHECK_VERSION (2, 26, 0)) -#define g_mkdtemp mkdtemp -//#endif - gchar *dir = g_build_filename (g_get_tmp_dir(), "tikzitXXXXXX", NULL); - gchar *rdir = g_mkdtemp (dir); - if (rdir) { - result = [NSString stringWithGlibFilename:dir]; - } else if (error) { - *error = [NSError errorWithLibcError:errno]; - } - g_free (dir); -#endif - return result; -} - -- (NSString*) createTempDirectory { - return [self createTempDirectoryWithError:NULL]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NSString+Glib.h b/tikzit-old/src/gtk/NSString+Glib.h deleted file mode 100644 index ac59833..0000000 --- a/tikzit-old/src/gtk/NSString+Glib.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import - -@interface NSString(Glib) -/** - * Initialise a string with a string in the GLib filename encoding - */ -- (id) initWithGlibFilename:(const gchar *)filename; -/** - * Create a string from a string in the GLib filename encoding - */ -+ (id) stringWithGlibFilename:(const gchar *)filename; -/** - * Get a copy of the string in GLib filename encoding. - * - * This will need to be freed with g_free. - */ -- (gchar*)glibFilename; -/** - * Get a copy of the string as a GLib URI - * - * This will need to be freed with g_free. - */ -- (gchar*)glibUriWithError:(NSError**)error; -/** - * Get a copy of the string as a GLib URI - * - * This will need to be freed with g_free. - */ -- (gchar*)glibUri; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NSString+Glib.m b/tikzit-old/src/gtk/NSString+Glib.m deleted file mode 100644 index b6dc765..0000000 --- a/tikzit-old/src/gtk/NSString+Glib.m +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NSString+Glib.h" -#import "TZFoundation.h" - -@implementation NSString(Glib) -+ (id) stringWithGlibFilename:(const gchar *)filename { - return [[[self alloc] initWithGlibFilename:filename] autorelease]; -} - -- (id) initWithGlibFilename:(const gchar *)filename { - if (self == nil) { - return nil; - } - - if (filename == NULL) { - [self release]; - return nil; - } - - GError *error = NULL; - gchar *utf8file = g_filename_to_utf8 (filename, -1, NULL, NULL, &error); - if (utf8file == NULL) { - if (error) - logGError (error, @"Failed to convert a GLib filename to UTF8"); - [self release]; - return nil; - } - - self = [self initWithUTF8String:utf8file]; - g_free (utf8file); - - return self; -} - -- (gchar*)glibFilenameWithError:(NSError**)error { - GError *gerror = NULL; - gchar *result = g_filename_from_utf8 ([self UTF8String], -1, NULL, NULL, &gerror); - GErrorToNSError (gerror, error); - if (gerror) { - logGError (gerror, @"Failed to convert a UTF8 string to a GLib filename"); - } - return result; -} - -- (gchar*)glibFilename { - return [self glibFilenameWithError:NULL]; -} - -- (gchar*)glibUriWithError:(NSError**)error { - gchar *filepath; - gchar *uri; - NSError *cause = nil; - - filepath = [self glibFilenameWithError:&cause]; - if (!filepath) { - if (error) { - NSString *message = [NSString stringWithFormat:@"Could not convert \"%@\" to the GLib filename encoding", self]; - *error = [NSError errorWithMessage:message code:TZ_ERR_OTHER cause:cause]; - } - return NULL; - } - - GError *gerror = NULL; - GError **gerrorptr = error ? &gerror : NULL; - uri = g_filename_to_uri (filepath, NULL, gerrorptr); - if (!uri && error) { - NSString *message = [NSString stringWithFormat:@"Could not convert \"%@\" to a GLib URI", self]; - *error = [NSError errorWithMessage:message code:TZ_ERR_BADFORMAT cause:[NSError errorWithGError:gerror]]; - } - g_free (filepath); - return uri; -} - -- (gchar*)glibUri { - return [self glibUriWithError:NULL]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Node+Render.h b/tikzit-old/src/gtk/Node+Render.h deleted file mode 100644 index 60d2573..0000000 --- a/tikzit-old/src/gtk/Node+Render.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Node.h" -#import "RenderContext.h" -#import "Surface.h" - -enum NodeState { - NodeNormal, - NodeSelected, - NodeHighlighted -}; - -@interface Node(Render) - -- (Transformer*) shapeTransformerForSurface:(id)surface; -// the total rendered bounds, excluding label -- (NSRect) renderBoundsForSurface:(id)surface; -- (NSRect) renderBoundsWithLabelForSurface:(id)surface; -- (NSString*) renderedLabel; -- (NSSize) renderedLabelSizeInContext:(id)context; -- (void) renderLabelToSurface:(id)surface withContext:(id)context; -- (void) renderLabelAt:(NSPoint)point withContext:(id)context; -- (void) renderToSurface:(id)surface withContext:(id)context state:(enum NodeState)state; -- (BOOL) hitByPoint:(NSPoint)p onSurface:(id)surface; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Node+Render.m b/tikzit-old/src/gtk/Node+Render.m deleted file mode 100644 index 907d818..0000000 --- a/tikzit-old/src/gtk/Node+Render.m +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Node+Render.h" -#import "Shape.h" -#import "Shape+Render.h" -#import "ShapeNames.h" - -#define MAX_LABEL_LENGTH 10 -#define LABEL_PADDING_X 2 -#define LABEL_PADDING_Y 2 - -@implementation Node (Render) - -- (Shape*) shapeToRender { - if (style) { - return [Shape shapeForName:[style shapeName]]; - } else { - return [Shape shapeForName:SHAPE_CIRCLE]; - } -} - -- (Transformer*) shapeTransformerForSurface:(id)surface { - return [self shapeTransformerFromTransformer:[surface transformer]]; -} - -- (NSRect) renderBoundsUsingShapeTransform:(Transformer*)shapeTrans { - float strokeThickness = style ? [style strokeThickness] : [NodeStyle defaultStrokeThickness]; - NSRect screenBounds = [shapeTrans rectToScreen:[[self shapeToRender] boundingRect]]; - screenBounds = NSInsetRect(screenBounds, -strokeThickness, -strokeThickness); - return screenBounds; -} - -- (NSRect) renderBoundsForSurface:(id)surface { - return [self renderBoundsUsingShapeTransform:[self shapeTransformerForSurface:surface]]; -} - -- (NSRect) renderBoundsWithLabelForSurface:(id)surface { - NSRect nodeBounds = [self renderBoundsForSurface:surface]; - NSRect labelRect = NSZeroRect; - if (![label isEqual:@""]) { - id cr = [surface createRenderContext]; - labelRect.size = [self renderedLabelSizeInContext:cr]; - NSPoint nodePos = [[surface transformer] toScreen:point]; - labelRect.origin.x = nodePos.x - (labelRect.size.width / 2); - labelRect.origin.y = nodePos.y - (labelRect.size.height / 2); - } - return NSUnionRect(nodeBounds, labelRect); -} - -- (RColor) strokeColor { - if (style) { - return [[style strokeColorRGB] rColor]; - } else { - return MakeRColor (0.4, 0.4, 0.7, 0.8); - } -} - -- (RColor) fillColor { - if (style) { - return [[style fillColorRGB] rColor]; - } else { - return MakeRColor (0.4, 0.4, 0.7, 0.3); - } -} - -- (NSString*) renderedLabel { - NSString *r_label = [label stringByExpandingLatexConstants]; - if ([r_label length] > MAX_LABEL_LENGTH) { - r_label = [[[r_label substringToIndex:MAX_LABEL_LENGTH-1] stringByTrimmingSpaces] stringByAppendingString:@"..."]; - } else { - r_label = [r_label stringByTrimmingSpaces]; - } - return r_label; -} - -- (NSSize) renderedLabelSizeInContext:(id)context { - NSSize result = {0, 0}; - if (![label isEqual:@""]) { - NSString *r_label = [self renderedLabel]; - - id layout = [context layoutText:r_label withSize:9]; - - result = [layout size]; - result.width += LABEL_PADDING_X; - result.height += LABEL_PADDING_Y; - } - return result; -} - -- (void) renderLabelToSurface:(id )surface withContext:(id)context { - [self renderLabelAt:[[surface transformer] toScreen:point] withContext:context]; -} - -- (void) renderLabelAt:(NSPoint)p withContext:(id)context { - // draw latex code overlayed on node - if (![label isEqual:@""]) { - [context saveState]; - - NSString *r_label = [self renderedLabel]; - id layout = [context layoutText:r_label withSize:9]; - - NSSize labelSize = [layout size]; - - NSRect textBounds = NSMakeRect (p.x - labelSize.width/2, - p.y - labelSize.height/2, - labelSize.width, - labelSize.height); - NSRect backRect = NSInsetRect (textBounds, -LABEL_PADDING_X, -LABEL_PADDING_Y); - - [context startPath]; - [context setLineWidth:1.0]; - [context rect:backRect]; - RColor fColor = MakeRColor (1.0, 1.0, 0.5, 0.7); - RColor sColor = MakeRColor (0.5, 0.0, 0.0, 0.7); - [context strokePathWithColor:sColor andFillWithColor:fColor]; - - [layout showTextAt:textBounds.origin withColor:BlackRColor]; - - [context restoreState]; - } -} - -- (void) renderToSurface:(id )surface withContext:(id)context state:(enum NodeState)state { - Transformer *shapeTrans = [self shapeTransformerForSurface:surface]; - float strokeThickness = style ? [style strokeThickness] : [NodeStyle defaultStrokeThickness]; - - [context saveState]; - - [[self shapeToRender] drawPathWithTransform:shapeTrans andContext:context]; - - [context setLineWidth:strokeThickness]; - if (!style) { - [context setLineDash:3.0]; - } - [context strokePathWithColor:[self strokeColor] andFillWithColor:[self fillColor]]; - - if (state != NodeNormal) { - [context setLineWidth:strokeThickness + 4.0]; - [context setLineDash:0.0]; - float alpha = 0.0f; - if (state == NodeSelected) - alpha = 0.5f; - else if (state == NodeHighlighted) - alpha = 0.25f; - RColor selectionColor = MakeSolidRColor(0.61f, 0.735f, 1.0f); - - [[self shapeToRender] drawPathWithTransform:shapeTrans andContext:context]; - [context strokePathWithColor:selectionColor andFillWithColor:selectionColor usingAlpha:alpha]; - } - - [context restoreState]; - [self renderLabelToSurface:surface withContext:context]; -} - -- (BOOL) hitByPoint:(NSPoint)p onSurface:(id)surface { - Transformer *shapeTrans = [self shapeTransformerForSurface:surface]; - - NSRect screenBounds = [self renderBoundsUsingShapeTransform:shapeTrans]; - if (!NSPointInRect(p, screenBounds)) { - return NO; - } - - float strokeThickness = style ? [style strokeThickness] : [NodeStyle defaultStrokeThickness]; - id ctx = [surface createRenderContext]; - [ctx setLineWidth:strokeThickness]; - [[self shapeToRender] drawPathWithTransform:shapeTrans andContext:ctx]; - return [ctx strokeIncludesPoint:p] || [ctx fillIncludesPoint:p]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyle+Gtk.h b/tikzit-old/src/gtk/NodeStyle+Gtk.h deleted file mode 100644 index 4fa5edd..0000000 --- a/tikzit-old/src/gtk/NodeStyle+Gtk.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "NodeStyle.h" -#import - -@interface NodeStyle (Gtk) - -- (GdkColor) strokeColor; -- (void) setStrokeColor:(GdkColor)color; -- (GdkColor) fillColor; -- (void) setFillColor:(GdkColor)color; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyle+Gtk.m b/tikzit-old/src/gtk/NodeStyle+Gtk.m deleted file mode 100644 index 1954def..0000000 --- a/tikzit-old/src/gtk/NodeStyle+Gtk.m +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NodeStyle+Gtk.h" -#import "ColorRGB+Gtk.h" - -@implementation NodeStyle (Gtk) - -- (GdkColor) strokeColor { - return [[self strokeColorRGB] gdkColor]; -} - -- (void) setStrokeColor:(GdkColor)color { - [self setStrokeColorRGB:[ColorRGB colorWithGdkColor:color]]; -} - -- (GdkColor) fillColor { - return [[self fillColorRGB] gdkColor]; -} - -- (void) setFillColor:(GdkColor)color { - [self setFillColorRGB:[ColorRGB colorWithGdkColor:color]]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyle+Render.h b/tikzit-old/src/gtk/NodeStyle+Render.h deleted file mode 100644 index 00edd27..0000000 --- a/tikzit-old/src/gtk/NodeStyle+Render.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "NodeStyle.h" -#import "RenderContext.h" -#import "Surface.h" - -@interface NodeStyle (Render) - -- (void) renderToSurface:(id)surface withContext:(id)context at:(NSPoint)p; -- (BOOL) hitByPoint:(NSPoint)p onSurface:(id)surface; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyle+Storage.h b/tikzit-old/src/gtk/NodeStyle+Storage.h deleted file mode 100644 index 7649414..0000000 --- a/tikzit-old/src/gtk/NodeStyle+Storage.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "NodeStyle.h" -#import "Configuration.h" - -@interface NodeStyle (Storage) - -- (id) initFromConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile; -- (void) storeToConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyle+Storage.m b/tikzit-old/src/gtk/NodeStyle+Storage.m deleted file mode 100644 index 088b062..0000000 --- a/tikzit-old/src/gtk/NodeStyle+Storage.m +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * Copyright 2010 Chris Heunen - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NodeStyle+Storage.h" -#import "ColorRGB+IntegerListStorage.h" - -@implementation NodeStyle (Storage) - -- (id) initFromConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile { - self = [self init]; - - if (self) { - [self setName:[configFile stringEntry:@"Name" inGroup:groupName withDefault:name]]; - [self setCategory:[configFile stringEntry:@"Category" inGroup:groupName withDefault:category]]; - [self setShapeName:[configFile stringEntry:@"ShapeName" inGroup:groupName withDefault:shapeName]]; - [self setScale:[configFile doubleEntry:@"Scale" inGroup:groupName withDefault:scale]]; - [self setStrokeThickness:[configFile integerEntry:@"StrokeThickness" - inGroup:groupName - withDefault:strokeThickness]]; - [self setStrokeColorRGB: - [ColorRGB colorFromValueList: - [configFile integerListEntry:@"StrokeColor" - inGroup:groupName - withDefault:[strokeColorRGB valueList]]]]; - [self setFillColorRGB: - [ColorRGB colorFromValueList: - [configFile integerListEntry:@"FillColor" - inGroup:groupName - withDefault:[fillColorRGB valueList]]]]; - } - - return self; -} - -- (void) storeToConfigurationGroup:(NSString*)groupName config:(Configuration*)configFile { - [configFile setStringEntry:@"Name" inGroup:groupName value:[self name]]; - [configFile setStringEntry:@"Category" inGroup:groupName value:[self category]]; - [configFile setStringEntry:@"ShapeName" inGroup:groupName value:[self shapeName]]; - [configFile setDoubleEntry:@"Scale" inGroup:groupName value:[self scale]]; - [configFile setIntegerEntry:@"StrokeThickness" inGroup:groupName value:[self strokeThickness]]; - [configFile setIntegerListEntry:@"StrokeColor" inGroup:groupName value:[[self strokeColorRGB] valueList]]; - [configFile setIntegerListEntry:@"FillColor" inGroup:groupName value:[[self fillColorRGB] valueList]]; -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyleEditor.h b/tikzit-old/src/gtk/NodeStyleEditor.h deleted file mode 100644 index b45c992..0000000 --- a/tikzit-old/src/gtk/NodeStyleEditor.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class NodeStyle; - -@interface NodeStyleEditor: NSObject { - NodeStyle *style; - GtkTable *table; - GtkEntry *nameEdit; - GtkComboBox *shapeNameCombo; - GtkColorButton *strokeColorButton; - GtkWidget *makeStrokeTexSafeButton; - GtkColorButton *fillColorButton; - GtkWidget *makeFillTexSafeButton; - GtkAdjustment *scaleAdj; - BOOL blockSignals; -} - -@property (retain) NodeStyle *style; -@property (readonly) GtkWidget *widget; - -- (id) init; - -- (void) selectNameField; - -@end - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/NodeStyleEditor.m b/tikzit-old/src/gtk/NodeStyleEditor.m deleted file mode 100644 index fcf4147..0000000 --- a/tikzit-old/src/gtk/NodeStyleEditor.m +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NodeStyleEditor.h" -#import "NodeStyle.h" -#import "NodeStyle+Gtk.h" -#import "Shape.h" - -static const guint row_count = 5; - -// {{{ Internal interfaces -// {{{ GTK+ Callbacks -static void style_name_edit_changed_cb (GtkEditable *widget, NodeStyleEditor *editor); -static void style_shape_combo_changed_cb (GtkComboBox *widget, NodeStyleEditor *editor); -static void stroke_color_changed_cb (GtkColorButton *widget, NodeStyleEditor *editor); -static void fill_color_changed_cb (GtkColorButton *widget, NodeStyleEditor *editor); -static void make_stroke_safe_button_clicked_cb (GtkButton *widget, NodeStyleEditor *editor); -static void make_fill_safe_button_clicked_cb (GtkButton *widget, NodeStyleEditor *editor); -static void scale_adjustment_changed_cb (GtkAdjustment *widget, NodeStyleEditor *editor); -// }}} -// {{{ Notifications - -@interface NodeStyleEditor (Notifications) -- (void) shapeDictionaryReplaced:(NSNotification*)n; -- (void) nameChangedTo:(NSString*)value; -- (void) shapeNameChangedTo:(NSString*)value; -- (void) strokeColorChangedTo:(GdkColor)value; -- (void) makeStrokeColorTexSafe; -- (void) fillColorChangedTo:(GdkColor)value; -- (void) makeFillColorTexSafe; -- (void) scaleChangedTo:(double)value; -@end - -// }}} -// {{{ Private - -@interface NodeStyleEditor (Private) -- (void) loadShapeNames; -- (void) setActiveShapeName:(NSString*)name; -@end - -// }}} -// }}} -// {{{ API - -@implementation NodeStyleEditor - -- (void) _addWidget:(GtkWidget*)w withLabel:(gchar *)label atRow:(guint)row { - NSAssert(row < row_count, @"row_count is wrong!"); - - GtkWidget *l = gtk_label_new (label); - gtk_misc_set_alignment (GTK_MISC (l), 0, 0.5); - gtk_widget_show (l); - gtk_widget_show (w); - - gtk_table_attach (table, l, - 0, 1, row, row+1, // l, r, t, b - GTK_FILL, // x opts - GTK_FILL | GTK_EXPAND, // y opts - 5, // x padding - 0); // y padding - - gtk_table_attach (table, w, - 1, 2, row, row+1, // l, r, t, b - GTK_FILL | GTK_EXPAND, // x opts - GTK_FILL | GTK_EXPAND, // y opts - 0, // x padding - 0); // y padding -} - -- (GtkWidget*) _createMakeColorTexSafeButton:(NSString*)type { - GtkWidget *b = gtk_button_new (); - GtkWidget *icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON); - gtk_widget_show (icon); - gtk_container_add (GTK_CONTAINER (b), icon); - NSString *ttip = [NSString stringWithFormat:@"The %@ colour is not a predefined TeX colour.\nClick here to choose the nearest TeX-safe colour.", type]; - gtk_widget_set_tooltip_text (b, [ttip UTF8String]); - return b; -} - -- (id) init { - self = [super init]; - - if (self != nil) { - style = nil; - table = GTK_TABLE (gtk_table_new (row_count, 2, FALSE)); - gtk_table_set_col_spacings (table, 6); - gtk_table_set_row_spacings (table, 6); - gtk_widget_set_sensitive (GTK_WIDGET (table), FALSE); - blockSignals = NO; - - /** - * Name - */ - nameEdit = GTK_ENTRY (gtk_entry_new ()); - g_object_ref_sink (nameEdit); - [self _addWidget:GTK_WIDGET (nameEdit) - withLabel:"Name" - atRow:0]; - g_signal_connect (G_OBJECT (nameEdit), - "changed", - G_CALLBACK (style_name_edit_changed_cb), - self); - - - /** - * Shape - */ - GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING); - shapeNameCombo = GTK_COMBO_BOX (gtk_combo_box_new_with_model (GTK_TREE_MODEL (store))); - GtkCellRenderer *cellRend = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (shapeNameCombo), - cellRend, - TRUE); - gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (shapeNameCombo), cellRend, "text", 0); - g_object_ref_sink (shapeNameCombo); - [self _addWidget:GTK_WIDGET (shapeNameCombo) - withLabel:"Shape" - atRow:1]; - g_signal_connect (G_OBJECT (shapeNameCombo), - "changed", - G_CALLBACK (style_shape_combo_changed_cb), - self); - - - /** - * Stroke colour - */ - GtkWidget *strokeBox = gtk_hbox_new (FALSE, 0); - [self _addWidget:strokeBox - withLabel:"Stroke colour" - atRow:2]; - strokeColorButton = GTK_COLOR_BUTTON (gtk_color_button_new ()); - g_object_ref_sink (strokeColorButton); - gtk_widget_show (GTK_WIDGET (strokeColorButton)); - gtk_box_pack_start (GTK_BOX (strokeBox), GTK_WIDGET (strokeColorButton), - FALSE, FALSE, 0); - makeStrokeTexSafeButton = [self _createMakeColorTexSafeButton:@"stroke"]; - g_object_ref_sink (makeStrokeTexSafeButton); - gtk_box_pack_start (GTK_BOX (strokeBox), makeStrokeTexSafeButton, - FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (strokeColorButton), - "color-set", - G_CALLBACK (stroke_color_changed_cb), - self); - g_signal_connect (G_OBJECT (makeStrokeTexSafeButton), - "clicked", - G_CALLBACK (make_stroke_safe_button_clicked_cb), - self); - - - /** - * Fill colour - */ - GtkWidget *fillBox = gtk_hbox_new (FALSE, 0); - [self _addWidget:fillBox - withLabel:"Fill colour" - atRow:3]; - fillColorButton = GTK_COLOR_BUTTON (gtk_color_button_new ()); - g_object_ref_sink (fillColorButton); - gtk_widget_show (GTK_WIDGET (fillColorButton)); - gtk_box_pack_start (GTK_BOX (fillBox), GTK_WIDGET (fillColorButton), - FALSE, FALSE, 0); - makeFillTexSafeButton = [self _createMakeColorTexSafeButton:@"fill"]; - g_object_ref_sink (makeFillTexSafeButton); - gtk_box_pack_start (GTK_BOX (fillBox), makeFillTexSafeButton, - FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (fillColorButton), - "color-set", - G_CALLBACK (fill_color_changed_cb), - self); - g_signal_connect (G_OBJECT (makeFillTexSafeButton), - "clicked", - G_CALLBACK (make_fill_safe_button_clicked_cb), - self); - - - /** - * Scale - */ - scaleAdj = GTK_ADJUSTMENT (gtk_adjustment_new ( - 1.0, // value - 0.0, // lower - 50.0, // upper - 0.20, // step - 1.0, // page - 0.0)); // (irrelevant) - g_object_ref_sink (scaleAdj); - GtkWidget *scaleSpin = gtk_spin_button_new (scaleAdj, 0.0, 2); - [self _addWidget:scaleSpin - withLabel:"Scale" - atRow:4]; - g_signal_connect (G_OBJECT (scaleAdj), - "value-changed", - G_CALLBACK (scale_adjustment_changed_cb), - self); - - [self loadShapeNames]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(shapeDictionaryReplaced:) - name:@"ShapeDictionaryReplaced" - object:[Shape class]]; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (nameEdit); - g_object_unref (shapeNameCombo); - g_object_unref (strokeColorButton); - g_object_unref (makeStrokeTexSafeButton); - g_object_unref (fillColorButton); - g_object_unref (makeFillTexSafeButton); - g_object_unref (scaleAdj); - g_object_unref (table); - [style release]; - - [super dealloc]; -} - -- (NodeStyle*) style { - return style; -} - -- (void) setStyle:(NodeStyle*)s { - blockSignals = YES; - NodeStyle *oldStyle = style; - style = [s retain]; - - if (style != nil) { - gtk_widget_set_sensitive (GTK_WIDGET (table), TRUE); - - gtk_entry_set_text(nameEdit, [[style name] UTF8String]); - - [self setActiveShapeName:[style shapeName]]; - - GdkColor c = [style strokeColor]; - gtk_color_button_set_color(strokeColorButton, &c); - - gtk_widget_set_visible (makeStrokeTexSafeButton, ([[style strokeColorRGB] name] == nil)); - - c = [style fillColor]; - gtk_color_button_set_color(fillColorButton, &c); - - gtk_widget_set_visible (makeFillTexSafeButton, ([[style fillColorRGB] name] == nil)); - - gtk_adjustment_set_value(scaleAdj, [style scale]); - } else { - gtk_entry_set_text(nameEdit, ""); - [self setActiveShapeName:nil]; - gtk_widget_set_visible (makeStrokeTexSafeButton, FALSE); - gtk_widget_set_visible (makeFillTexSafeButton, FALSE); - gtk_adjustment_set_value(scaleAdj, 1.0); - gtk_widget_set_sensitive (GTK_WIDGET (table), FALSE); - } - - [oldStyle release]; - blockSignals = NO; -} - -- (GtkWidget*) widget { - return GTK_WIDGET (table); -} - -- (void) selectNameField { - gtk_widget_grab_focus (GTK_WIDGET (nameEdit)); - gtk_editable_select_region (GTK_EDITABLE (nameEdit), 0, -1); -} - -@end - -// }}} -// {{{ Notifications - -@implementation NodeStyleEditor (Notifications) -- (void) shapeDictionaryReplaced:(NSNotification*)n { - blockSignals = YES; - - [self loadShapeNames]; - [self setActiveShapeName:[style shapeName]]; - - blockSignals = NO; -} - -- (void) nameChangedTo:(NSString*)value { - [style setName:value]; -} - -- (void) shapeNameChangedTo:(NSString*)value { - [style setShapeName:value]; -} - -- (void) strokeColorChangedTo:(GdkColor)value { - [style setStrokeColor:value]; - gtk_widget_set_visible (makeStrokeTexSafeButton, - [[style strokeColorRGB] name] == nil); -} - -- (void) makeStrokeColorTexSafe { - if (style != nil) { - [[style strokeColorRGB] setToClosestHashed]; - GdkColor color = [style strokeColor]; - gtk_color_button_set_color(strokeColorButton, &color); - gtk_widget_set_visible (makeStrokeTexSafeButton, FALSE); - } -} - -- (void) fillColorChangedTo:(GdkColor)value { - [style setFillColor:value]; - gtk_widget_set_visible (makeFillTexSafeButton, - [[style fillColorRGB] name] == nil); -} - -- (void) makeFillColorTexSafe { - if (style != nil) { - [[style fillColorRGB] setToClosestHashed]; - GdkColor color = [style fillColor]; - gtk_color_button_set_color(fillColorButton, &color); - gtk_widget_set_visible (makeFillTexSafeButton, FALSE); - } -} - -- (void) scaleChangedTo:(double)value { - [style setScale:value]; -} -@end - -// }}} -// {{{ Private - -@implementation NodeStyleEditor (Private) -- (BOOL) signalsBlocked { return blockSignals; } - -- (void) loadShapeNames { - blockSignals = YES; - - gtk_combo_box_set_active (shapeNameCombo, -1); - - GtkListStore *list = GTK_LIST_STORE (gtk_combo_box_get_model (shapeNameCombo)); - gtk_list_store_clear (list); - - NSEnumerator *en = [[Shape shapeDictionary] keyEnumerator]; - NSString *shapeName; - GtkTreeIter iter; - while ((shapeName = [en nextObject]) != nil) { - gtk_list_store_append (list, &iter); - gtk_list_store_set (list, &iter, 0, [shapeName UTF8String], -1); - } - - blockSignals = NO; -} - -- (void) setActiveShapeName:(NSString*)name { - if (name == nil) { - gtk_combo_box_set_active (shapeNameCombo, -1); - return; - } - const gchar *shapeName = [name UTF8String]; - - GtkTreeModel *model = gtk_combo_box_get_model (shapeNameCombo); - GtkTreeIter iter; - if (gtk_tree_model_get_iter_first (model, &iter)) { - do { - gchar *rowShapeName; - gtk_tree_model_get (model, &iter, 0, &rowShapeName, -1); - if (g_strcmp0 (shapeName, rowShapeName) == 0) { - gtk_combo_box_set_active_iter (shapeNameCombo, &iter); - g_free (rowShapeName); - return; - } - g_free (rowShapeName); - } while (gtk_tree_model_iter_next (model, &iter)); - } -} -@end - -// }}} -// {{{ GTK+ callbacks - -static void style_name_edit_changed_cb (GtkEditable *widget, NodeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - const gchar *contents = gtk_entry_get_text (GTK_ENTRY (widget)); - [editor nameChangedTo:[NSString stringWithUTF8String:contents]]; - - [pool drain]; -} - -static void style_shape_combo_changed_cb (GtkComboBox *widget, NodeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GtkTreeIter iter; - gtk_combo_box_get_active_iter (widget, &iter); - gchar *shapeName = NULL; - gtk_tree_model_get (gtk_combo_box_get_model (widget), &iter, 0, &shapeName, -1); - [editor shapeNameChangedTo:[NSString stringWithUTF8String:shapeName]]; - g_free (shapeName); - - [pool drain]; -} - -static void stroke_color_changed_cb (GtkColorButton *widget, NodeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GdkColor color; - gtk_color_button_get_color (widget, &color); - [editor strokeColorChangedTo:color]; - - [pool drain]; -} - -static void fill_color_changed_cb (GtkColorButton *widget, NodeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - GdkColor color; - gtk_color_button_get_color (widget, &color); - [editor fillColorChangedTo:color]; - - [pool drain]; -} - -static void make_stroke_safe_button_clicked_cb (GtkButton *widget, NodeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor makeStrokeColorTexSafe]; - [pool drain]; -} - -static void make_fill_safe_button_clicked_cb (GtkButton *widget, NodeStyleEditor *editor) { - if ([editor signalsBlocked]) - return; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor makeFillColorTexSafe]; - [pool drain]; -} - -static void scale_adjustment_changed_cb (GtkAdjustment *adj, NodeStyleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor scaleChangedTo:gtk_adjustment_get_value (adj)]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/NodeStyleSelector.h b/tikzit-old/src/gtk/NodeStyleSelector.h deleted file mode 100644 index a699dc8..0000000 --- a/tikzit-old/src/gtk/NodeStyleSelector.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class NodeStyle; -@class NodeStylesModel; -@class StyleManager; - -@interface NodeStyleSelector: NSObject { - NodeStylesModel *model; - GtkIconView *view; -} - -/*! - @property widget - @brief The GTK widget - */ -@property (readonly) GtkWidget *widget; - -/*! - @property model - @brief The model to use. - */ -@property (retain) NodeStylesModel *model; - -/*! - @property selectedStyle - @brief The selected style. - - When this changes, a SelectedStyleChanged notification will be posted - */ -@property (assign) NodeStyle *selectedStyle; - -/*! - * Initialise with a new model for the given style manager - */ -- (id) initWithStyleManager:(StyleManager*)manager; -/*! - * Initialise with the given model - */ -- (id) initWithModel:(NodeStylesModel*)model; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStyleSelector.m b/tikzit-old/src/gtk/NodeStyleSelector.m deleted file mode 100644 index 14cdc75..0000000 --- a/tikzit-old/src/gtk/NodeStyleSelector.m +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NodeStyleSelector.h" - -#import "NodeStylesModel.h" - -// {{{ Internal interfaces -static void selection_changed_cb (GtkIconView *widget, NodeStyleSelector *mgr); -// }}} -// {{{ API - -@implementation NodeStyleSelector - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)m { - return [self initWithModel:[NodeStylesModel modelWithStyleManager:m]]; -} -- (id) initWithModel:(NodeStylesModel*)m { - self = [super init]; - - if (self) { - model = [m retain]; - - view = GTK_ICON_VIEW (gtk_icon_view_new ()); - g_object_ref_sink (view); - - gtk_icon_view_set_model (view, [model model]); - gtk_icon_view_set_pixbuf_column (view, NODE_STYLES_ICON_COL); - gtk_icon_view_set_tooltip_column (view, NODE_STYLES_NAME_COL); - gtk_icon_view_set_selection_mode (view, GTK_SELECTION_SINGLE); - - g_signal_connect (G_OBJECT (view), - "selection-changed", - G_CALLBACK (selection_changed_cb), - self); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (view); - [model release]; - - [super dealloc]; -} - -- (NodeStylesModel*) model { - return model; -} - -- (void) setModel:(NodeStylesModel*)m { - if (m == model) - return; - - NodeStylesModel *oldModel = model; - model = [m retain]; - gtk_icon_view_set_model (view, [model model]); - [oldModel release]; -} - -- (GtkWidget*) widget { - return GTK_WIDGET (view); -} - -- (NodeStyle*) selectedStyle { - GList *list = gtk_icon_view_get_selected_items (view); - if (!list) { - return nil; - } - if (list->next != NULL) { - NSLog(@"Multiple selected items in NodeStyleSelector!"); - } - - GtkTreePath *path = (GtkTreePath*) list->data; - NodeStyle *style = [model styleFromPath:path]; - - g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL); - g_list_free (list); - - return style; -} - -- (void) setSelectedStyle:(NodeStyle*)style { - if (style == nil) { - gtk_icon_view_unselect_all (view); - return; - } - - GtkTreePath *path = [model pathFromStyle:style]; - if (path) { - gtk_icon_view_unselect_all (view); - gtk_icon_view_select_path (view, path); - gtk_tree_path_free (path); - } -} - -@end - -// }}} -// {{{ GTK+ callbacks - -static void selection_changed_cb (GtkIconView *view, NodeStyleSelector *mgr) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - [[NSNotificationCenter defaultCenter] - postNotificationName:@"SelectedStyleChanged" - object:mgr]; - - [pool drain]; -} -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/NodeStylesModel.h b/tikzit-old/src/gtk/NodeStylesModel.h deleted file mode 100644 index a048560..0000000 --- a/tikzit-old/src/gtk/NodeStylesModel.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class NodeStyle; -@class StyleManager; - -enum { - NODE_STYLES_NAME_COL = 0, - NODE_STYLES_ICON_COL, - NODE_STYLES_PTR_COL, - NODE_STYLES_N_COLS -}; - -@interface NodeStylesModel: NSObject { - GtkListStore *store; - StyleManager *styleManager; -} - -/*! - @property model - @brief The GTK+ tree model - */ -@property (readonly) GtkTreeModel *model; - -/*! - @property manager - @brief The StyleManager to use. - */ -@property (retain) StyleManager *styleManager; - -/*! - * Initialise with the given style manager - */ -- (id) initWithStyleManager:(StyleManager*)m; - -+ (id) modelWithStyleManager:(StyleManager*)m; - -- (NodeStyle*) styleFromPath:(GtkTreePath*)path; -- (GtkTreePath*) pathFromStyle:(NodeStyle*)style; -- (NodeStyle*) styleFromIter:(GtkTreeIter*)iter; -- (GtkTreeIter*) iterFromStyle:(NodeStyle*)style; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/NodeStylesModel.m b/tikzit-old/src/gtk/NodeStylesModel.m deleted file mode 100644 index 3cc5771..0000000 --- a/tikzit-old/src/gtk/NodeStylesModel.m +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NodeStylesModel.h" - -#import "CairoRenderContext.h" -#import "NodeStyle.h" -#import "Shape.h" -#import "Shape+Render.h" -#import "ShapeNames.h" -#import "StyleManager.h" - -#import "gtkhelpers.h" - -#import - -// {{{ Internal interfaces - -@interface NodeStylesModel (Notifications) -- (void) nodeStylesReplaced:(NSNotification*)notification; -- (void) nodeStyleAdded:(NSNotification*)notification; -- (void) nodeStyleRemoved:(NSNotification*)notification; -- (void) shapeDictionaryReplaced:(NSNotification*)n; -- (void) observeValueForKeyPath:(NSString*)keyPath - ofObject:(id)object - change:(NSDictionary*)change - context:(void*)context; -@end - -@interface NodeStylesModel (Private) -- (cairo_surface_t*) createNodeIconSurface; -- (GdkPixbuf*) pixbufOfNodeInStyle:(NodeStyle*)style; -- (GdkPixbuf*) pixbufOfNodeInStyle:(NodeStyle*)style usingSurface:(cairo_surface_t*)surface; -- (void) addNodeStyle:(NodeStyle*)style; -- (void) addNodeStyle:(NodeStyle*)style usingSurface:(cairo_surface_t*)surface; -- (void) observeNodeStyle:(NodeStyle*)style; -- (void) stopObservingNodeStyle:(NodeStyle*)style; -- (void) clearNodeStylesModel; -- (void) reloadNodeStyles; -@end - -// }}} -// {{{ API - -@implementation NodeStylesModel - -+ (id) modelWithStyleManager:(StyleManager*)m { - return [[[self alloc] initWithStyleManager:m] autorelease]; -} - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)m { - self = [super init]; - - if (self) { - store = gtk_list_store_new (NODE_STYLES_N_COLS, - G_TYPE_STRING, - GDK_TYPE_PIXBUF, - G_TYPE_POINTER); - g_object_ref_sink (store); - - [self setStyleManager:m]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(shapeDictionaryReplaced:) - name:@"ShapeDictionaryReplaced" - object:[Shape class]]; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [self clearNodeStylesModel]; - g_object_unref (store); - [styleManager release]; - - [super dealloc]; -} - -- (StyleManager*) styleManager { - return styleManager; -} - -- (void) setStyleManager:(StyleManager*)m { - if (m == nil) { - [NSException raise:NSInvalidArgumentException format:@"Style manager cannot be nil"]; - } - [m retain]; - - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:styleManager]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeStylesReplaced:) - name:@"NodeStylesReplaced" - object:m]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeStyleAdded:) - name:@"NodeStyleAdded" - object:m]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeStyleRemoved:) - name:@"NodeStyleRemoved" - object:m]; - - [styleManager release]; - styleManager = m; - - [self reloadNodeStyles]; -} - -- (GtkTreeModel*) model { - return GTK_TREE_MODEL (store); -} - -- (NodeStyle*) styleFromPath:(GtkTreePath*)path { - GtkTreeIter iter; - gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, path); - NodeStyle *style = nil; - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, NODE_STYLES_PTR_COL, &style, -1); - return style; -} - -- (GtkTreePath*) pathFromStyle:(NodeStyle*)style { - GtkTreeModel *m = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (m, &row)) { - do { - NodeStyle *rowStyle; - gtk_tree_model_get (m, &row, NODE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - return gtk_tree_model_get_path (m, &row); - } - } while (gtk_tree_model_iter_next (m, &row)); - } - return NULL; -} - -- (NodeStyle*) styleFromIter:(GtkTreeIter*)iter { - NodeStyle *style = nil; - gtk_tree_model_get (GTK_TREE_MODEL (store), iter, NODE_STYLES_PTR_COL, &style, -1); - return style; -} - -- (GtkTreeIter*) iterFromStyle:(NodeStyle*)style { - GtkTreeModel *m = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (m, &row)) { - do { - NodeStyle *rowStyle; - gtk_tree_model_get (m, &row, NODE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - return gtk_tree_iter_copy (&row); - } - } while (gtk_tree_model_iter_next (m, &row)); - } - return NULL; -} -@end - -// }}} -// {{{ Notifications - -@implementation NodeStylesModel (Notifications) - -- (void) nodeStylesReplaced:(NSNotification*)notification { - [self reloadNodeStyles]; -} - -- (void) nodeStyleAdded:(NSNotification*)notification { - [self addNodeStyle:[[notification userInfo] objectForKey:@"style"]]; -} - -- (void) nodeStyleRemoved:(NSNotification*)notification { - NodeStyle *style = [[notification userInfo] objectForKey:@"style"]; - - GtkTreeModel *model = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (model, &row)) { - do { - NodeStyle *rowStyle; - gtk_tree_model_get (model, &row, NODE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - gtk_list_store_remove (store, &row); - [self stopObservingNodeStyle:rowStyle]; - [rowStyle release]; - return; - } - } while (gtk_tree_model_iter_next (model, &row)); - } -} - -- (void) observeValueForKeyPath:(NSString*)keyPath - ofObject:(id)object - change:(NSDictionary*)change - context:(void*)context -{ - if ([object class] == [NodeStyle class]) { - NodeStyle *style = object; - - GtkTreeModel *model = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (model, &row)) { - do { - NodeStyle *rowStyle; - gtk_tree_model_get (model, &row, NODE_STYLES_PTR_COL, &rowStyle, -1); - if (style == rowStyle) { - if ([@"name" isEqual:keyPath]) { - gtk_list_store_set (store, &row, NODE_STYLES_NAME_COL, [[style name] UTF8String], -1); - } else { - GdkPixbuf *pixbuf = [self pixbufOfNodeInStyle:style]; - gtk_list_store_set (store, &row, NODE_STYLES_ICON_COL, pixbuf, -1); - g_object_unref (pixbuf); - } - } - } while (gtk_tree_model_iter_next (model, &row)); - } - } -} - -- (void) shapeDictionaryReplaced:(NSNotification*)n { - [self reloadNodeStyles]; -} -@end - -// }}} -// {{{ Private - -@implementation NodeStylesModel (Private) -- (cairo_surface_t*) createNodeIconSurface { - return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 24, 24); -} - -- (GdkPixbuf*) pixbufOfNodeInStyle:(NodeStyle*)style { - cairo_surface_t *surface = [self createNodeIconSurface]; - GdkPixbuf *pixbuf = [self pixbufOfNodeInStyle:style usingSurface:surface]; - cairo_surface_destroy (surface); - return pixbuf; -} - -- (GdkPixbuf*) pixbufOfNodeInStyle:(NodeStyle*)style usingSurface:(cairo_surface_t*)surface { - Shape *shape = [Shape shapeForName:[style shapeName]]; - - int width = cairo_image_surface_get_width (surface); - int height = cairo_image_surface_get_height (surface); - NSRect pixbufBounds = NSMakeRect(0.0, 0.0, width, height); - const CGFloat lineWidth = [style strokeThickness]; - Transformer *shapeTrans = [Transformer transformerToFit:[shape boundingRect] - intoScreenRect:NSInsetRect(pixbufBounds, lineWidth, lineWidth) - flippedAboutXAxis:YES]; - if ([style scale] < 1.0) - [shapeTrans setScale:[style scale] * [shapeTrans scale]]; - - CairoRenderContext *context = [[CairoRenderContext alloc] initForSurface:surface]; - [context clearSurface]; - [shape drawPathWithTransform:shapeTrans andContext:context]; - [context setLineWidth:lineWidth]; - [context strokePathWithColor:[[style strokeColorRGB] rColor] - andFillWithColor:[[style fillColorRGB] rColor]]; - [context release]; - - return pixbuf_get_from_surface (surface); -} - -- (void) addNodeStyle:(NodeStyle*)style usingSurface:(cairo_surface_t*)surface { - GtkTreeIter iter; - gtk_list_store_append (store, &iter); - - GdkPixbuf *pixbuf = [self pixbufOfNodeInStyle:style usingSurface:surface]; - gtk_list_store_set (store, &iter, - NODE_STYLES_NAME_COL, [[style name] UTF8String], - NODE_STYLES_ICON_COL, pixbuf, - NODE_STYLES_PTR_COL, (gpointer)[style retain], - -1); - g_object_unref (pixbuf); - [self observeNodeStyle:style]; -} - -- (void) addNodeStyle:(NodeStyle*)style { - cairo_surface_t *surface = [self createNodeIconSurface]; - [self addNodeStyle:style usingSurface:surface]; - cairo_surface_destroy (surface); -} - -- (void) observeNodeStyle:(NodeStyle*)style { - [style addObserver:self - forKeyPath:@"name" - options:NSKeyValueObservingOptionNew - context:NULL]; - [style addObserver:self - forKeyPath:@"strokeThickness" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"strokeColorRGB.red" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"strokeColorRGB.green" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"strokeColorRGB.blue" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"fillColorRGB.red" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"fillColorRGB.green" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"fillColorRGB.blue" - options:0 - context:NULL]; - [style addObserver:self - forKeyPath:@"shapeName" - options:0 - context:NULL]; -} - -- (void) stopObservingNodeStyle:(NodeStyle*)style { - [style removeObserver:self forKeyPath:@"name"]; - [style removeObserver:self forKeyPath:@"strokeThickness"]; - [style removeObserver:self forKeyPath:@"strokeColorRGB.red"]; - [style removeObserver:self forKeyPath:@"strokeColorRGB.green"]; - [style removeObserver:self forKeyPath:@"strokeColorRGB.blue"]; - [style removeObserver:self forKeyPath:@"fillColorRGB.red"]; - [style removeObserver:self forKeyPath:@"fillColorRGB.green"]; - [style removeObserver:self forKeyPath:@"fillColorRGB.blue"]; - [style removeObserver:self forKeyPath:@"shapeName"]; -} - -- (void) clearNodeStylesModel { - GtkTreeModel *model = GTK_TREE_MODEL (store); - GtkTreeIter row; - if (gtk_tree_model_get_iter_first (model, &row)) { - do { - NodeStyle *rowStyle; - gtk_tree_model_get (model, &row, NODE_STYLES_PTR_COL, &rowStyle, -1); - [self stopObservingNodeStyle:rowStyle]; - [rowStyle release]; - } while (gtk_tree_model_iter_next (model, &row)); - } - gtk_list_store_clear (store); -} - -- (void) reloadNodeStyles { - [self clearNodeStylesModel]; - cairo_surface_t *surface = [self createNodeIconSurface]; - for (NodeStyle *style in [styleManager nodeStyles]) { - [self addNodeStyle:style usingSurface:surface]; - } - cairo_surface_destroy (surface); -} -@end - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/NodeStylesPalette.h b/tikzit-old/src/gtk/NodeStylesPalette.h deleted file mode 100644 index ac712ea..0000000 --- a/tikzit-old/src/gtk/NodeStylesPalette.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class StyleManager; -@class NodeStyleSelector; -@class NodeStyleEditor; - -@interface NodeStylesPalette: NSObject { - NodeStyleSelector *selector; - NodeStyleEditor *editor; - - GtkWidget *palette; - - GtkWidget *removeStyleButton; - GtkWidget *applyStyleButton; - GtkWidget *clearStyleButton; -} - -@property (retain) StyleManager *styleManager; -@property (readonly) GtkWidget *widget; - -- (id) initWithManager:(StyleManager*)m; - -@end - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/NodeStylesPalette.m b/tikzit-old/src/gtk/NodeStylesPalette.m deleted file mode 100644 index e28edbb..0000000 --- a/tikzit-old/src/gtk/NodeStylesPalette.m +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "NodeStylesPalette.h" - -#import "NodeStyleSelector.h" -#import "NodeStyleEditor.h" -#import "NodeStylesModel.h" -#import "StyleManager.h" - -// {{{ Internal interfaces -// {{{ GTK+ Callbacks -static void add_style_button_cb (GtkButton *widget, NodeStylesPalette *palette); -static void remove_style_button_cb (GtkButton *widget, NodeStylesPalette *palette); -// }}} -// {{{ Notifications - -@interface NodeStylesPalette (Notifications) -- (void) selectedStyleChanged:(NSNotification*)notification; -@end - -// }}} -// {{{ Private - -@interface NodeStylesPalette (Private) -- (void) updateButtonState; -- (void) removeSelectedStyle; -- (void) addStyle; -@end - -// }}} -// }}} -// {{{ API - -@implementation NodeStylesPalette - -@synthesize widget=palette; - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithManager:(StyleManager*)m { - self = [super init]; - - if (self) { - selector = [[NodeStyleSelector alloc] initWithStyleManager:m]; - editor = [[NodeStyleEditor alloc] init]; - - palette = gtk_vbox_new (FALSE, 6); - gtk_container_set_border_width (GTK_CONTAINER (palette), 6); - g_object_ref_sink (palette); - - GtkWidget *mainBox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (palette), mainBox, FALSE, FALSE, 0); - gtk_widget_show (mainBox); - - GtkWidget *selectorScroller = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selectorScroller), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - GtkWidget *selectorFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (selectorScroller), [selector widget]); - gtk_container_add (GTK_CONTAINER (selectorFrame), selectorScroller); - gtk_box_pack_start (GTK_BOX (mainBox), selectorFrame, TRUE, TRUE, 0); - gtk_widget_show (selectorScroller); - gtk_widget_show (selectorFrame); - gtk_widget_show ([selector widget]); - - gtk_box_pack_start (GTK_BOX (mainBox), [editor widget], TRUE, TRUE, 0); - gtk_widget_show ([editor widget]); - - GtkBox *buttonBox = GTK_BOX (gtk_hbox_new(FALSE, 0)); - gtk_box_pack_start (GTK_BOX (palette), GTK_WIDGET (buttonBox), FALSE, FALSE, 0); - - GtkWidget *addStyleButton = gtk_button_new (); - gtk_widget_set_tooltip_text (addStyleButton, "Add a new style"); - GtkWidget *addIcon = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (addStyleButton), addIcon); - gtk_box_pack_start (buttonBox, addStyleButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (addStyleButton), - "clicked", - G_CALLBACK (add_style_button_cb), - self); - - removeStyleButton = gtk_button_new (); - g_object_ref_sink (removeStyleButton); - gtk_widget_set_tooltip_text (removeStyleButton, "Delete selected style"); - GtkWidget *removeIcon = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (removeStyleButton), removeIcon); - gtk_box_pack_start (buttonBox, removeStyleButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (removeStyleButton), - "clicked", - G_CALLBACK (remove_style_button_cb), - self); - - gtk_widget_show_all (GTK_WIDGET (buttonBox)); - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(selectedStyleChanged:) - name:@"SelectedStyleChanged" - object:selector]; - - [self updateButtonState]; - } - - return self; -} - -- (StyleManager*) styleManager { - return [[selector model] styleManager]; -} - -- (void) setStyleManager:(StyleManager*)m { - [[selector model] setStyleManager:m]; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [editor release]; - [selector release]; - g_object_unref (palette); - g_object_unref (removeStyleButton); - - [super dealloc]; -} - -@end - -// }}} -// {{{ Notifications - -@implementation NodeStylesPalette (Notifications) -- (void) selectedStyleChanged:(NSNotification*)notification { - [editor setStyle:[selector selectedStyle]]; - [self updateButtonState]; -} -@end - -// }}} -// {{{ Private - -@implementation NodeStylesPalette (Private) -- (void) updateButtonState { - gboolean hasStyleSelection = [selector selectedStyle] != nil; - - gtk_widget_set_sensitive (removeStyleButton, hasStyleSelection); -} - -- (void) removeSelectedStyle { - NodeStyle *style = [selector selectedStyle]; - if (style) - [[[selector model] styleManager] removeNodeStyle:style]; -} - -- (void) addStyle { - NodeStyle *newStyle = [NodeStyle defaultNodeStyleWithName:@"newstyle"]; - [[self styleManager] addNodeStyle:newStyle]; - [selector setSelectedStyle:newStyle]; - [editor selectNameField]; -} - -@end - -// }}} -// {{{ GTK+ callbacks - -static void add_style_button_cb (GtkButton *widget, NodeStylesPalette *palette) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [palette addStyle]; - [pool drain]; -} - -static void remove_style_button_cb (GtkButton *widget, NodeStylesPalette *palette) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [palette removeSelectedStyle]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/PreambleEditor.h b/tikzit-old/src/gtk/PreambleEditor.h deleted file mode 100644 index f181446..0000000 --- a/tikzit-old/src/gtk/PreambleEditor.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Preambles; - -@interface PreambleEditor: NSObject { - Preambles *preambles; - - // we don't keep any refs, as we control - // the top window - GtkWindow *parentWindow; - GtkWindow *window; - GtkListStore *preambleListStore; - GtkTreeView *preambleSelector; - GtkTextView *preambleView; - BOOL blockSignals; - BOOL adding; -} - -- (id) initWithPreambles:(Preambles*)p; - -- (void) setParentWindow:(GtkWindow*)parent; - -- (Preambles*) preambles; - -- (void) present; -- (void) show; -- (void) hide; -- (BOOL) isVisible; -- (void) setVisible:(BOOL)visible; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/PreambleEditor.m b/tikzit-old/src/gtk/PreambleEditor.m deleted file mode 100644 index d1f72ee..0000000 --- a/tikzit-old/src/gtk/PreambleEditor.m +++ /dev/null @@ -1,568 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "PreambleEditor.h" - -#import "Application.h" -#import "Preambles.h" -#import - -enum { - NAME_COLUMN, - IS_CUSTOM_COLUMN, - N_COLUMNS -}; - -// {{{ Internal interfaces -// {{{ Signals -static gboolean window_delete_event_cb (GtkWidget *widget, - GdkEvent *event, - PreambleEditor *editor); -static gboolean window_focus_out_event_cb (GtkWidget *widget, - GdkEvent *event, - PreambleEditor *editor); -static void close_button_clicked_cb (GtkButton *widget, PreambleEditor *editor); -static void add_button_clicked_cb (GtkButton *widget, PreambleEditor *editor); -static void remove_button_clicked_cb (GtkButton *widget, PreambleEditor *editor); -/* -static void undo_button_clicked_cb (GtkButton *widget, PreambleEditor *editor); -static void redo_button_clicked_cb (GtkButton *widget, PreambleEditor *editor); -*/ -static void preamble_name_edited_cb (GtkCellRendererText *renderer, - gchar *path, - gchar *new_text, - PreambleEditor *editor); -static void preamble_selection_changed_cb (GtkTreeSelection *treeselection, - PreambleEditor *editor); -// }}} - -@interface PreambleEditor (Private) -- (void) loadUi; -- (void) save; -- (void) revert; -- (void) update; -- (void) fillListStore; -- (BOOL) isDefaultPreambleSelected; -- (NSString*) selectedPreambleName; -- (void) addPreamble; -- (void) deletePreamble; -- (void) renamePreambleAtPath:(gchar*)path to:(gchar*)newValue; -- (void) nodeStylePropertyChanged:(NSNotification*)notification; -- (void) edgeStylePropertyChanged:(NSNotification*)notification; -@end - -// }}} -// {{{ API - -@implementation PreambleEditor - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithPreambles:(Preambles*)p { - self = [super init]; - - if (self) { - preambles = [p retain]; - parentWindow = NULL; - window = NULL; - preambleView = NULL; - preambleSelector = NULL; - blockSignals = NO; - adding = NO; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeStylePropertyChanged:) - name:@"NodeStylePropertyChanged" - object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeStylePropertyChanged:) - name:@"EdgeStylePropertyChanged" - object:nil]; - } - - return self; -} - -- (Preambles*) preambles { - return preambles; -} - -- (void) setParentWindow:(GtkWindow*)parent { - GtkWindow *oldParent = parentWindow; - - if (parentWindow) - g_object_ref (parentWindow); - parentWindow = parent; - if (oldParent) - g_object_unref (oldParent); - - if (window) { - gtk_window_set_transient_for (window, parentWindow); - } -} - -- (void) present { - [self loadUi]; - gtk_window_present (GTK_WINDOW (window)); - [self revert]; -} - -- (void) show { - [self loadUi]; - gtk_widget_show (GTK_WIDGET (window)); - [self revert]; -} - -- (void) hide { - if (!window) { - return; - } - [self save]; - gtk_widget_hide (GTK_WIDGET (window)); -} - -- (BOOL) isVisible { - if (!window) { - return NO; - } - gboolean visible; - g_object_get (G_OBJECT (window), "visible", &visible, NULL); - return visible ? YES : NO; -} - -- (void) setVisible:(BOOL)visible { - if (visible) { - [self show]; - } else { - [self hide]; - } -} - -- (void) dealloc { - [preambles release]; - preambles = nil; - if (window) { - gtk_widget_destroy (GTK_WIDGET (window)); - window = NULL; - } - if (parentWindow) { - g_object_ref (parentWindow); - } - - [super dealloc]; -} - -@end - -// }}} -// {{{ Private - -@implementation PreambleEditor (Private) -- (GtkWidget*) createPreambleList { - preambleListStore = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_BOOLEAN); - preambleSelector = GTK_TREE_VIEW (gtk_tree_view_new_with_model ( - GTK_TREE_MODEL (preambleListStore))); - gtk_widget_set_size_request (GTK_WIDGET (preambleSelector), 150, -1); - gtk_tree_view_set_headers_visible (preambleSelector, FALSE); - - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - - renderer = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("Preamble", - renderer, - "text", NAME_COLUMN, - "editable", IS_CUSTOM_COLUMN, - NULL); - gtk_tree_view_append_column (preambleSelector, column); - g_signal_connect (G_OBJECT (renderer), - "edited", - G_CALLBACK (preamble_name_edited_cb), - self); - - GtkWidget *listScroller = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (listScroller), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_container_add (GTK_CONTAINER (listScroller), - GTK_WIDGET (preambleSelector)); - - [self fillListStore]; - - GtkTreeSelection *sel = gtk_tree_view_get_selection (preambleSelector); - gtk_tree_selection_set_mode (sel, GTK_SELECTION_BROWSE); - g_signal_connect (G_OBJECT (sel), - "changed", - G_CALLBACK (preamble_selection_changed_cb), - self); - - return listScroller; -} - -- (void) loadUi { - if (window) { - return; - } - - window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - gtk_window_set_title (window, "Preamble editor"); - gtk_window_set_position (window, GTK_WIN_POS_CENTER_ON_PARENT); - gtk_window_set_default_size (window, 600, 400); - gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DIALOG); - if (parentWindow) { - gtk_window_set_transient_for (window, parentWindow); - } - GdkEventMask mask; - g_object_get (G_OBJECT (window), "events", &mask, NULL); - mask |= GDK_FOCUS_CHANGE_MASK; - g_object_set (G_OBJECT (window), "events", mask, NULL); - g_signal_connect (window, - "delete-event", - G_CALLBACK (window_delete_event_cb), - self); - g_signal_connect (window, - "focus-out-event", - G_CALLBACK (window_focus_out_event_cb), - self); - - GtkWidget *mainBox = gtk_vbox_new (FALSE, 18); - gtk_container_set_border_width (GTK_CONTAINER (mainBox), 12); - gtk_container_add (GTK_CONTAINER (window), mainBox); - - GtkPaned *paned = GTK_PANED (gtk_hpaned_new ()); - gtk_box_pack_start (GTK_BOX (mainBox), - GTK_WIDGET (paned), - TRUE, TRUE, 0); - - GtkWidget *listWidget = [self createPreambleList]; - GtkWidget *listFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (listFrame), listWidget); - - GtkBox *listBox = GTK_BOX (gtk_vbox_new (FALSE, 6)); - gtk_box_pack_start (listBox, listFrame, TRUE, TRUE, 0); - - GtkContainer *listButtonBox = GTK_CONTAINER (gtk_hbox_new (FALSE, 6)); - gtk_box_pack_start (listBox, GTK_WIDGET (listButtonBox), FALSE, TRUE, 0); - GtkWidget *addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); - g_signal_connect (addButton, - "clicked", - G_CALLBACK (add_button_clicked_cb), - self); - gtk_container_add (listButtonBox, addButton); - GtkWidget *removeButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); - g_signal_connect (removeButton, - "clicked", - G_CALLBACK (remove_button_clicked_cb), - self); - gtk_container_add (listButtonBox, removeButton); - - gtk_paned_pack1 (paned, GTK_WIDGET (listBox), FALSE, TRUE); - - preambleView = GTK_TEXT_VIEW (gtk_text_view_new ()); - gtk_text_view_set_left_margin (preambleView, 3); - gtk_text_view_set_right_margin (preambleView, 3); - GtkWidget *scroller = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroller), - GTK_POLICY_AUTOMATIC, // horiz - GTK_POLICY_ALWAYS); // vert - gtk_container_add (GTK_CONTAINER (scroller), GTK_WIDGET (preambleView)); - GtkWidget *editorFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (editorFrame), scroller); - gtk_paned_pack2 (paned, editorFrame, TRUE, TRUE); - - GtkContainer *buttonBox = GTK_CONTAINER (gtk_hbutton_box_new ()); - gtk_box_set_spacing (GTK_BOX (buttonBox), 6); - gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonBox), GTK_BUTTONBOX_END); - gtk_box_pack_start (GTK_BOX (mainBox), - GTK_WIDGET (buttonBox), - FALSE, TRUE, 0); - GtkWidget *closeButton = gtk_button_new_from_stock (GTK_STOCK_CLOSE); - gtk_container_add (buttonBox, closeButton); - g_signal_connect (closeButton, - "clicked", - G_CALLBACK (close_button_clicked_cb), - self); - /* - GtkWidget *undoButton = gtk_button_new_from_stock (GTK_STOCK_UNDO); - gtk_container_add (buttonBox, undoButton); - gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (buttonBox), - undoButton, - TRUE); - g_signal_connect (undoButton, - "clicked", - G_CALLBACK (undo_button_clicked_cb), - self); - GtkWidget *redoButton = gtk_button_new_from_stock (GTK_STOCK_REDO); - gtk_container_add (buttonBox, redoButton); - gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (buttonBox), - redoButton, - TRUE); - g_signal_connect (redoButton, - "clicked", - G_CALLBACK (redo_button_clicked_cb), - self); - */ - [self revert]; - - gtk_widget_show_all (mainBox); -} - -- (void) save { - if (!preambleView) - return; - if ([self isDefaultPreambleSelected]) - return; - GtkTextIter start,end; - GtkTextBuffer *preambleBuffer = gtk_text_view_get_buffer (preambleView); - gtk_text_buffer_get_bounds(preambleBuffer, &start, &end); - gchar *text = gtk_text_buffer_get_text(preambleBuffer, &start, &end, FALSE); - NSString *preamble = [NSString stringWithUTF8String:text]; - g_free (text); - [preambles setCurrentPreamble:preamble]; - [app saveConfiguration]; -} - -- (void) revert { - if (!preambleView) - return; - GtkTextBuffer *preambleBuffer = gtk_text_view_get_buffer (preambleView); - gtk_text_buffer_set_text (preambleBuffer, [[preambles currentPreamble] UTF8String], -1); - gtk_text_view_set_editable (preambleView, ![self isDefaultPreambleSelected]); -} - -- (void) update { - if (!blockSignals) { - [self save]; - } - GtkTreeSelection *sel = gtk_tree_view_get_selection (preambleSelector); - GtkTreeIter row; - GtkTreeModel *model; - if (gtk_tree_selection_get_selected (sel, &model, &row)) { - gchar *name; - gtk_tree_model_get (model, &row, NAME_COLUMN, &name, -1); - NSString *preambleName = [NSString stringWithUTF8String:name]; - [preambles setSelectedPreambleName:preambleName]; - g_free (name); - } - [self revert]; -} - -- (void) fillListStore { - blockSignals = YES; - - GtkTreeIter row; - gtk_list_store_clear (preambleListStore); - - gtk_list_store_append (preambleListStore, &row); - gtk_list_store_set (preambleListStore, &row, - NAME_COLUMN, [[preambles defaultPreambleName] UTF8String], - IS_CUSTOM_COLUMN, FALSE, - -1); - GtkTreeSelection *sel = gtk_tree_view_get_selection (preambleSelector); - if ([self isDefaultPreambleSelected]) { - gtk_tree_selection_select_iter (sel, &row); - } - - NSEnumerator *en = [preambles customPreambleNameEnumerator]; - NSString *preambleName; - while ((preambleName = [en nextObject])) { - gtk_list_store_append (preambleListStore, &row); - gtk_list_store_set (preambleListStore, &row, - NAME_COLUMN, [preambleName UTF8String], - IS_CUSTOM_COLUMN, TRUE, - -1); - if ([preambleName isEqualToString:[self selectedPreambleName]]) { - gtk_tree_selection_select_iter (sel, &row); - } - } - - blockSignals = NO; -} - -- (BOOL) isDefaultPreambleSelected { - return [preambles selectedPreambleIsDefault]; -} - -- (NSString*) selectedPreambleName { - return [preambles selectedPreambleName]; -} - -- (void) addPreamble { - NSString *newName = [preambles addPreamble]; - - GtkTreeIter row; - gtk_list_store_append (preambleListStore, &row); - gtk_list_store_set (preambleListStore, &row, - NAME_COLUMN, [newName UTF8String], - IS_CUSTOM_COLUMN, TRUE, - -1); - - GtkTreeSelection *sel = gtk_tree_view_get_selection (preambleSelector); - gtk_tree_selection_select_iter (sel, &row); -} - -- (void) deletePreamble { - if ([self isDefaultPreambleSelected]) - return; - - NSString *name = [self selectedPreambleName]; - - GtkTreeIter row; - GtkTreeModel *model = GTK_TREE_MODEL (preambleListStore); - - gtk_tree_model_get_iter_first (model, &row); - // ignore first; it is the default one - gboolean found = FALSE; - while (!found && gtk_tree_model_iter_next (model, &row)) { - gchar *candidate; - gtk_tree_model_get (model, &row, NAME_COLUMN, &candidate, -1); - if (g_strcmp0 (candidate, [name UTF8String]) == 0) { - found = TRUE; - } - g_free (candidate); - } - - if (!found) - return; - - if (![preambles removePreamble:name]) - return; - - blockSignals = YES; - - gboolean had_next = gtk_list_store_remove (preambleListStore, &row); - if (!had_next) { - // select the last item - gint length = gtk_tree_model_iter_n_children (model, NULL); - gtk_tree_model_iter_nth_child (model, &row, NULL, length - 1); - } - - GtkTreeSelection *sel = gtk_tree_view_get_selection (preambleSelector); - gtk_tree_selection_select_iter (sel, &row); - - [self revert]; - - blockSignals = NO; -} - -- (void) renamePreambleAtPath:(gchar*)path to:(gchar*)newValue { - NSString *newName = [NSString stringWithUTF8String:newValue]; - - GtkTreeIter row; - GtkTreeModel *model = GTK_TREE_MODEL (preambleListStore); - - if (!gtk_tree_model_get_iter_from_string (model, &row, path)) - return; - - gchar *oldValue; - gtk_tree_model_get (model, &row, NAME_COLUMN, &oldValue, -1); - - NSString* oldName = [NSString stringWithUTF8String:oldValue]; - if ([preambles renamePreambleFrom:oldName to:newName]) { - gtk_list_store_set (preambleListStore, &row, - NAME_COLUMN, newValue, - -1); - } -} - -- (void) nodeStylePropertyChanged:(NSNotification*)notification { - if ([self isDefaultPreambleSelected]) { - [self revert]; - } -} - -- (void) edgeStylePropertyChanged:(NSNotification*)notification { - if ([self isDefaultPreambleSelected]) { - [self revert]; - } -} -@end - -// }}} -// {{{ GTK+ callbacks - -static gboolean window_delete_event_cb (GtkWidget *widget, - GdkEvent *event, - PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor hide]; - [pool drain]; - return TRUE; // we dealt with this event -} - -static gboolean window_focus_out_event_cb (GtkWidget *widget, - GdkEvent *event, - PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor save]; - [pool drain]; - return FALSE; -} - -static void close_button_clicked_cb (GtkButton *widget, PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor hide]; - [pool drain]; -} - -static void add_button_clicked_cb (GtkButton *widget, PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor addPreamble]; - [pool drain]; -} - -static void remove_button_clicked_cb (GtkButton *widget, PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor deletePreamble]; - [pool drain]; -} - -/* -static void undo_button_clicked_cb (GtkButton *widget, PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSLog(@"Undo"); - [pool drain]; -} - -static void redo_button_clicked_cb (GtkButton *widget, PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSLog(@"Redo"); - [pool drain]; -} -*/ - -static void preamble_name_edited_cb (GtkCellRendererText *renderer, - gchar *path, - gchar *new_text, - PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor renamePreambleAtPath:path to:new_text]; - [pool drain]; -} - -static void preamble_selection_changed_cb (GtkTreeSelection *treeselection, - PreambleEditor *editor) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor update]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/Preambles+Storage.h b/tikzit-old/src/gtk/Preambles+Storage.h deleted file mode 100644 index 76f56cc..0000000 --- a/tikzit-old/src/gtk/Preambles+Storage.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Preambles.h" - -@interface Preambles (Storage) - -+ (Preambles*) preamblesFromDirectory:(NSString*)directory; -- (id) initFromDirectory:(NSString*)directory; -- (void) loadFromDirectory:(NSString*)directory; -- (void) storeToDirectory:(NSString*)directory; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Preambles+Storage.m b/tikzit-old/src/gtk/Preambles+Storage.m deleted file mode 100644 index bd3ea03..0000000 --- a/tikzit-old/src/gtk/Preambles+Storage.m +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Preambles+Storage.h" - -static NSString *ext = @"preamble"; - -@implementation Preambles (Storage) - -+ (Preambles*) preamblesFromDirectory:(NSString*)directory { - return [[[self alloc] initFromDirectory:directory] autorelease]; -} - -- (id) initFromDirectory:(NSString*)directory { - BOOL isDir = NO; - if ([[NSFileManager defaultManager] fileExistsAtPath:directory isDirectory:&isDir] && isDir) { - self = [super init]; - - if (self) { - selectedPreambleName = @"default"; - preambleDict = nil; - [self loadFromDirectory:directory]; - } - } else { - self = [self init]; - } - - return self; -} - -- (void) loadFromDirectory:(NSString*)directory { - preambleDict = [[NSMutableDictionary alloc] initWithCapacity:1]; - NSDirectoryEnumerator *en = [[NSFileManager defaultManager] enumeratorAtPath:directory]; - NSString *filename; - while ((filename = [en nextObject]) != nil) { - if ([filename hasSuffix:ext] && [[en fileAttributes] fileType] == NSFileTypeRegular) { - NSString *path = [directory stringByAppendingPathComponent:filename]; - NSString *contents = [NSString stringWithContentsOfFile:path]; - if (contents) { - [preambleDict setObject:contents forKey:[filename stringByDeletingPathExtension]]; - } - } - } -} - -- (void) storeToDirectory:(NSString*)directory { - NSDirectoryEnumerator *den = [[NSFileManager defaultManager] enumeratorAtPath:directory]; - NSString *filename; - while ((filename = [den nextObject]) != nil) { - if ([filename hasSuffix:ext] && [[den fileAttributes] fileType] == NSFileTypeRegular) { - NSString *path = [directory stringByAppendingPathComponent:filename]; - NSString *entry = [filename stringByDeletingPathExtension]; - if ([preambleDict objectForKey:entry] == nil) { - [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; - } - } - } - - NSEnumerator *en = [self customPreambleNameEnumerator]; - NSString *entry; - while ((entry = [en nextObject]) != nil) { - NSString *path = [directory stringByAppendingPathComponent:[entry stringByAppendingPathExtension:ext]]; - NSString *contents = [preambleDict objectForKey:entry]; - [contents writeToFile:path atomically:YES]; - } -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/PreviewRenderer.h b/tikzit-old/src/gtk/PreviewRenderer.h deleted file mode 100644 index d691722..0000000 --- a/tikzit-old/src/gtk/PreviewRenderer.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -#import "Surface.h" - -@class Configuration; -@class Preambles; -@class TikzDocument; - -@interface PreviewRenderer: NSObject { - Configuration *config; - Preambles *preambles; - TikzDocument *document; - PopplerDocument *pdfDocument; - PopplerPage *pdfPage; -} - -@property (readonly) Preambles *preambles; -@property (retain) TikzDocument *document; -@property (readonly) double height; -@property (readonly) double width; - -- (id) initWithPreambles:(Preambles*)p config:(Configuration*)c; - -- (BOOL) updateWithError:(NSError**)error; -- (BOOL) update; -- (BOOL) isValid; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/PreviewRenderer.m b/tikzit-old/src/gtk/PreviewRenderer.m deleted file mode 100644 index 28113d6..0000000 --- a/tikzit-old/src/gtk/PreviewRenderer.m +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "PreviewRenderer.h" - -#import "CairoRenderContext.h" -#import "Configuration.h" -#import "Preambles.h" -#import "TikzDocument.h" - -@implementation PreviewRenderer - -@synthesize preambles, document; - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithPreambles:(Preambles*)p config:(Configuration*)c { - self = [super init]; - - if (self) { - document = nil; - config = [c retain]; - preambles = [p retain]; - pdfDocument = NULL; - pdfPage = NULL; - } - - return self; -} - -- (void) dealloc { - [document release]; - [config release]; - [preambles release]; - - if (pdfDocument) { - g_object_unref (pdfDocument); - pdfDocument = NULL; - } - if (pdfPage) { - g_object_unref (pdfPage); - pdfPage = NULL; - } - - [super dealloc]; -} - -- (BOOL) update { - NSError *error = nil; - BOOL result = [self updateWithError:&error]; - if (error) { - logError (error, @"Could not update preview"); - if ([error code] == TZ_ERR_TOOL_FAILED) { - NSLog (@"Output: %@", [[error userInfo] objectForKey:TZToolOutputErrorKey]); - } - } - return result; -} - -- (BOOL) updateWithError:(NSError**)error { - if (document == nil) { - if (error) { - *error = [NSError errorWithMessage:@"No document given" code:TZ_ERR_BADSTATE]; - } - if (pdfDocument) { - g_object_unref (pdfDocument); - pdfDocument = NULL; - } - if (pdfPage) { - g_object_unref (pdfPage); - pdfPage = NULL; - } - return NO; - } - - NSString *tex = [preambles buildDocumentForTikz:[document tikz]]; - - NSString *tempDir = [[NSFileManager defaultManager] createTempDirectoryWithError:error]; - if (!tempDir) { - if (error) { - *error = [NSError errorWithMessage:@"Could not create temporary directory" code:TZ_ERR_IO cause:*error]; - } - return NO; - } - - // write tex code to temporary file - NSString *texFile = [NSString stringWithFormat:@"%@/tikzit.tex", tempDir]; - NSString *pdfFile = [NSString stringWithFormat:@"file://%@/tikzit.pdf", tempDir]; - [tex writeToFile:texFile atomically:YES]; - - NSTask *latexTask = [[NSTask alloc] init]; - [latexTask setCurrentDirectoryPath:tempDir]; - - // GNUStep is clever enough to use PATH - NSString *path = [config stringEntry:@"pdflatex" - inGroup:@"Previews" - withDefault:@"pdflatex"]; - [latexTask setLaunchPath:path]; - - NSArray *args = [NSArray arrayWithObjects: - @"-fmt=latex", - @"-output-format=pdf", - @"-interaction=nonstopmode", - @"-halt-on-error", - texFile, - nil]; - [latexTask setArguments:args]; - - NSPipe *pout = [NSPipe pipe]; - [latexTask setStandardOutput:pout]; - - NSFileHandle *latexOut = [pout fileHandleForReading]; - - BOOL success = NO; - - NS_DURING { - [latexTask launch]; - [latexTask waitUntilExit]; - } NS_HANDLER { - NSLog(@"Failed to run '%@'; error was: %@", path, [localException reason]); - (void)localException; - if (error) { - NSString *desc = [NSString stringWithFormat:@"Failed to run '%@'", path]; - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionaryWithCapacity:2]; - [errorDetail setValue:desc forKey:NSLocalizedDescriptionKey]; - *error = [NSError errorWithDomain:TZErrorDomain code:TZ_ERR_IO userInfo:errorDetail]; - } - - // remove all temporary files - [[NSFileManager defaultManager] removeFileAtPath:tempDir handler:NULL]; - [latexTask release]; - - return NO; - } NS_ENDHANDLER - - if ([latexTask terminationStatus] != 0) { - if (error) { - NSData *data = [latexOut readDataToEndOfFile]; - NSString *str = [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]; - NSMutableDictionary *errorDetail = [NSMutableDictionary dictionaryWithCapacity:2]; - [errorDetail setValue:@"Generating a PDF file with pdflatex failed" forKey:NSLocalizedDescriptionKey]; - [errorDetail setValue:str forKey:TZToolOutputErrorKey]; - *error = [NSError errorWithDomain:TZErrorDomain code:TZ_ERR_TOOL_FAILED userInfo:errorDetail]; - [str release]; - } - } else { - // load pdf document - GError* gerror = NULL; - pdfDocument = poppler_document_new_from_file([pdfFile UTF8String], NULL, &gerror); - if (!pdfDocument) { - if (error) { - *error = [NSError errorWithMessage:[NSString stringWithFormat:@"Could not load PDF document", pdfFile] - code:TZ_ERR_IO - cause:[NSError errorWithGError:gerror]]; - } - g_error_free(gerror); - } else { - pdfPage = poppler_document_get_page(pdfDocument, 0); - if(!pdfPage) { - if (error) { - *error = [NSError errorWithMessage:@"Could not open first page of PDF document" - code:TZ_ERR_OTHER]; - } - g_object_unref(pdfDocument); - } else { - success = YES; - } - } - } - - // remove all temporary files - [[NSFileManager defaultManager] removeFileAtPath:tempDir handler:NULL]; - [latexTask release]; - - return success; -} - -- (BOOL) isValid { - return pdfPage ? YES : NO; -} - -- (double) width { - double w = 0.0; - if (pdfPage) - poppler_page_get_size(pdfPage, &w, NULL); - return w; -} - -- (double) height { - double h = 0.0; - if (pdfPage) - poppler_page_get_size(pdfPage, NULL, &h); - return h; -} - -- (void) renderWithContext:(id)c onSurface:(id)surface { - if (document != nil && pdfPage) { - CairoRenderContext *context = (CairoRenderContext*)c; - - double w = 0.0; - double h = 0.0; - poppler_page_get_size(pdfPage, &w, &h); - if (w==0) w = 1.0; - if (h==0) h = 1.0; - - double scale = ([surface height] / h) * 0.95; - if (w * scale > [surface width]) scale = [surface width] / w; - [[surface transformer] setScale:scale]; - - NSPoint origin; - w *= scale; - h *= scale; - origin.x = ([surface width] - w) / 2; - origin.y = ([surface height] - h) / 2; - - [[surface transformer] setOrigin:origin]; - - [context saveState]; - [context applyTransform:[surface transformer]]; - - // white-out - [context paintWithColor:WhiteRColor]; - - poppler_page_render (pdfPage, [context cairoContext]); - - [context restoreState]; - } -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/PreviewWindow.h b/tikzit-old/src/gtk/PreviewWindow.h deleted file mode 100644 index 8bcd3e5..0000000 --- a/tikzit-old/src/gtk/PreviewWindow.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Configuration; -@class Preambles; -@class PreviewRenderer; -@class TikzDocument; -@class WidgetSurface; - -@interface PreviewWindow: NSObject { - PreviewRenderer *previewer; - GtkWindow *window; - WidgetSurface *surface; - GtkWindow *parent; -} - -- (id) initWithPreambles:(Preambles*)p config:(Configuration*)c; - -- (void) setParentWindow:(GtkWindow*)parent; - -- (TikzDocument*) document; -- (void) setDocument:(TikzDocument*)doc; - -- (BOOL) update; - -- (void) present; -- (void) show; -- (void) hide; -- (BOOL) isVisible; -- (void) setVisible:(BOOL)visible; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/PreviewWindow.m b/tikzit-old/src/gtk/PreviewWindow.m deleted file mode 100644 index fc0e7a3..0000000 --- a/tikzit-old/src/gtk/PreviewWindow.m +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "PreviewWindow.h" - -#import "Preambles.h" -#import "PreviewRenderer.h" -#import "TikzDocument.h" -#import "WidgetSurface.h" - -#import "gtkhelpers.h" - -@interface PreviewWindow (Private) -- (BOOL) updateOrShowError; -- (void) updateDefaultSize; -@end - -// {{{ API - -@implementation PreviewWindow - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithPreambles:(Preambles*)p config:(Configuration*)c { - self = [super init]; - - if (self) { - parent = NULL; - previewer = [[PreviewRenderer alloc] initWithPreambles:p config:c]; - - window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - gtk_window_set_title (window, "Preview"); - gtk_window_set_resizable (window, TRUE); - gtk_window_set_default_size (window, 150.0, 150.0); - g_signal_connect (G_OBJECT (window), - "delete-event", - G_CALLBACK (gtk_widget_hide_on_delete), - NULL); - - GtkWidget *pdfArea = gtk_drawing_area_new (); - gtk_container_add (GTK_CONTAINER (window), pdfArea); - gtk_widget_show (pdfArea); - surface = [[WidgetSurface alloc] initWithWidget:pdfArea]; - [surface setRenderDelegate:previewer]; - Transformer *t = [surface transformer]; - [t setFlippedAboutXAxis:![t isFlippedAboutXAxis]]; - } - - return self; -} - -- (void) setParentWindow:(GtkWindow*)p { - parent = p; - gtk_window_set_transient_for (window, p); - if (p != NULL) { - gtk_window_set_position (window, GTK_WIN_POS_CENTER_ON_PARENT); - } -} - -- (TikzDocument*) document { - return [previewer document]; -} - -- (void) setDocument:(TikzDocument*)doc { - [previewer setDocument:doc]; -} - -- (void) present { - if ([self updateOrShowError]) { - [self updateDefaultSize]; - gtk_window_present (GTK_WINDOW (window)); - [surface invalidate]; - } -} - -- (BOOL) update { - if ([self updateOrShowError]) { - [self updateDefaultSize]; - return YES; - } - - return NO; -} - -- (void) show { - if ([self updateOrShowError]) { - [self updateDefaultSize]; - gtk_widget_show (GTK_WIDGET (window)); - [surface invalidate]; - } -} - -- (void) hide { - gtk_widget_hide (GTK_WIDGET (window)); -} - -- (BOOL) isVisible { - gboolean visible; - g_object_get (G_OBJECT (window), "visible", &visible, NULL); - return visible ? YES : NO; -} - -- (void) setVisible:(BOOL)visible { - if (visible) { - [self show]; - } else { - [self hide]; - } -} - -- (void) dealloc { - gtk_widget_destroy (GTK_WIDGET (window)); - [previewer release]; - [surface release]; - - [super dealloc]; -} - -@end -// }}} - -@implementation PreviewWindow (Private) -- (BOOL) updateOrShowError { - NSError *error = nil; - if (![previewer updateWithError:&error]) { - GtkWindow *dparent = gtk_widget_get_visible (GTK_WIDGET (window)) - ? window - : parent; - GtkWidget *dialog = gtk_message_dialog_new (dparent, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "Failed to generate the preview: %s", - [[error localizedDescription] UTF8String]); -#if GTK_CHECK_VERSION(2,22,0) - if ([error code] == TZ_ERR_TOOL_FAILED) { - GtkBox *box = GTK_BOX (gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog))); - GtkWidget *label = gtk_label_new ("pdflatex said:"); - gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5f); - gtk_widget_show (label); - gtk_box_pack_start (box, label, FALSE, TRUE, 0); - - GtkWidget *view = gtk_text_view_new (); - GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); - gtk_text_buffer_set_text (buffer, [[error toolOutput] UTF8String], -1); - gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE); - gtk_widget_show (view); - GtkWidget *scrolledView = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledView), - GTK_POLICY_NEVER, // horiz - GTK_POLICY_ALWAYS); // vert - gtk_widget_set_size_request (scrolledView, -1, 120); - gtk_container_add (GTK_CONTAINER (scrolledView), view); - gtk_widget_show (scrolledView); - gtk_box_pack_start (box, scrolledView, TRUE, TRUE, 0); - } -#endif // GTK+ 2.22.0 - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - return NO; - } - return YES; -} - -- (void) updateDefaultSize { - double width = 150; - double height = 150; - if ([previewer isValid]) { - double pWidth = [previewer width]; - double pHeight = [previewer height]; - width = (width < pWidth + 4) ? pWidth + 4 : width; - height = (height < pHeight + 4) ? pHeight + 4 : height; - } - gtk_window_set_default_size (window, width, height); -} -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/PropertiesPane.h b/tikzit-old/src/gtk/PropertiesPane.h deleted file mode 100644 index c76efae..0000000 --- a/tikzit-old/src/gtk/PropertiesPane.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Configuration; -@class EdgePropertyDelegate; -@class EdgeStylesModel; -@class GraphPropertyDelegate; -@class NodePropertyDelegate; -@class NodeStylesModel; -@class PropertyListEditor; -@class StyleManager; -@class TikzDocument; - -@interface PropertiesPane: NSObject { - TikzDocument *document; - BOOL blockUpdates; - - PropertyListEditor *graphProps; - PropertyListEditor *nodeProps; - PropertyListEditor *edgeProps; - PropertyListEditor *edgeNodeProps; - - GraphPropertyDelegate *graphPropDelegate; - NodePropertyDelegate *nodePropDelegate; - EdgePropertyDelegate *edgePropDelegate; - - GtkWidget *layout; - - GtkWidget *currentPropsWidget; // no ref! - - GtkWidget *graphPropsWidget; - GtkWidget *nodePropsWidget; - GtkWidget *edgePropsWidget; - - GtkEntry *nodeLabelEntry; - GtkToggleButton *edgeNodeToggle; - GtkWidget *edgeNodePropsWidget; - GtkEntry *edgeNodeLabelEntry; - GtkEntry *edgeSourceAnchorEntry; - GtkEntry *edgeTargetAnchorEntry; -} - -@property (retain) TikzDocument *document; -@property (assign) BOOL visible; -@property (readonly) GtkWidget *gtkWidget; - -- (void) loadConfiguration:(Configuration*)config; -- (void) saveConfiguration:(Configuration*)config; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/PropertiesPane.m b/tikzit-old/src/gtk/PropertiesPane.m deleted file mode 100644 index ba43298..0000000 --- a/tikzit-old/src/gtk/PropertiesPane.m +++ /dev/null @@ -1,763 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "PropertiesPane.h" - -#import "GraphElementProperty.h" -#import "PropertyListEditor.h" -#import "TikzDocument.h" - -#import "gtkhelpers.h" - -// {{{ Internal interfaces -// {{{ GTK+ helpers -static GtkWidget *createLabelledEntry (const gchar *labelText, GtkEntry **entry); -static GtkWidget *createPropsPaneWithLabelEntry (PropertyListEditor *props, GtkEntry **labelEntry); -static GtkWidget *createBoldLabel (const gchar *text); -// }}} -// {{{ GTK+ callbacks -static void node_label_changed_cb (GtkEditable *widget, PropertiesPane *pane); -static void edge_node_label_changed_cb (GtkEditable *widget, PropertiesPane *pane); -static void edge_node_toggled_cb (GtkToggleButton *widget, PropertiesPane *pane); -static void edge_source_anchor_changed_cb (GtkEditable *widget, PropertiesPane *pane); -static void edge_target_anchor_changed_cb (GtkEditable *widget, PropertiesPane *pane); -// }}} - -@interface PropertiesPane (Notifications) -- (void) nodeSelectionChanged:(NSNotification*)n; -- (void) edgeSelectionChanged:(NSNotification*)n; -- (void) graphChanged:(NSNotification*)n; -- (void) nodeLabelEdited:(NSString*)newValue; -- (void) edgeNodeLabelEdited:(NSString*)newValue; -- (void) edgeNodeToggled:(BOOL)newValue; -- (BOOL) edgeSourceAnchorEdited:(NSString*)newValue; -- (BOOL) edgeTargetAnchorEdited:(NSString*)newValue; -@end - -@interface PropertiesPane (Private) -- (void) _updatePane; -- (void) _setDisplayedWidget:(GtkWidget*)widget; -@end - -// {{{ Delegates - -@interface GraphPropertyDelegate : NSObject { - TikzDocument *doc; -} -- (void) setDocument:(TikzDocument*)d; -@end - -@interface NodePropertyDelegate : NSObject { - TikzDocument *doc; - Node *node; -} -- (void) setDocument:(TikzDocument*)d; -- (void) setNode:(Node*)n; -@end - -@interface EdgePropertyDelegate : NSObject { - TikzDocument *doc; - Edge *edge; -} -- (void) setDocument:(TikzDocument*)d; -- (void) setEdge:(Edge*)e; -@end - -// }}} - -// }}} -// {{{ API - -@implementation PropertiesPane - -- (id) init { - self = [super init]; - - if (self) { - document = nil; - blockUpdates = NO; - - graphProps = [[PropertyListEditor alloc] init]; - graphPropDelegate = [[GraphPropertyDelegate alloc] init]; - [graphProps setDelegate:graphPropDelegate]; - - nodeProps = [[PropertyListEditor alloc] init]; - nodePropDelegate = [[NodePropertyDelegate alloc] init]; - [nodeProps setDelegate:nodePropDelegate]; - - edgeProps = [[PropertyListEditor alloc] init]; - edgePropDelegate = [[EdgePropertyDelegate alloc] init]; - [edgeProps setDelegate:edgePropDelegate]; - - edgeNodeProps = [[PropertyListEditor alloc] init]; - [edgeNodeProps setDelegate:edgePropDelegate]; - - layout = gtk_vbox_new (FALSE, 0); - g_object_ref_sink (layout); - gtk_widget_show (layout); - - /* - * Graph properties - */ - graphPropsWidget = gtk_vbox_new (FALSE, 6); - g_object_ref_sink (graphPropsWidget); - gtk_widget_show (graphPropsWidget); - - GtkWidget *label = createBoldLabel ("Graph properties"); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (graphPropsWidget), - label, - FALSE, FALSE, 0); - - gtk_widget_show ([graphProps widget]); - gtk_box_pack_start (GTK_BOX (graphPropsWidget), - [graphProps widget], - TRUE, TRUE, 0); - - gtk_box_pack_start (GTK_BOX (layout), - graphPropsWidget, - TRUE, TRUE, 0); - - - /* - * Node properties - */ - nodePropsWidget = gtk_vbox_new (FALSE, 6); - g_object_ref_sink (nodePropsWidget); - gtk_box_pack_start (GTK_BOX (layout), - nodePropsWidget, - TRUE, TRUE, 0); - - label = createBoldLabel ("Node properties"); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (nodePropsWidget), - label, - FALSE, FALSE, 0); - - GtkWidget *labelWidget = createLabelledEntry ("Label", &nodeLabelEntry); - gtk_widget_show (labelWidget); - gtk_box_pack_start (GTK_BOX (nodePropsWidget), - labelWidget, - FALSE, FALSE, 0); - - gtk_widget_show ([nodeProps widget]); - gtk_box_pack_start (GTK_BOX (nodePropsWidget), - [nodeProps widget], - TRUE, TRUE, 0); - - g_signal_connect (G_OBJECT (nodeLabelEntry), - "changed", - G_CALLBACK (node_label_changed_cb), - self); - - /* - * Edge properties - */ - edgePropsWidget = gtk_vbox_new (FALSE, 6); - g_object_ref_sink (edgePropsWidget); - gtk_box_pack_start (GTK_BOX (layout), - edgePropsWidget, - TRUE, TRUE, 0); - - label = createBoldLabel ("Edge properties"); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - label, - FALSE, FALSE, 0); - - gtk_widget_show ([edgeProps widget]); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - [edgeProps widget], - TRUE, TRUE, 0); - - GtkWidget *split = gtk_hseparator_new (); - gtk_widget_show (split); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - split, - FALSE, FALSE, 0); - - GtkWidget *anchorTable = gtk_table_new (2, 2, FALSE); - - label = gtk_label_new ("Source anchor:"); - gtk_table_attach_defaults (GTK_TABLE (anchorTable), label, - 0, 1, 0, 1); - edgeSourceAnchorEntry = GTK_ENTRY (gtk_entry_new ()); - g_object_ref_sink (edgeSourceAnchorEntry); - gtk_table_attach_defaults (GTK_TABLE (anchorTable), - GTK_WIDGET (edgeSourceAnchorEntry), - 1, 2, 0, 1); - g_signal_connect (G_OBJECT (edgeSourceAnchorEntry), - "changed", - G_CALLBACK (edge_source_anchor_changed_cb), - self); - - label = gtk_label_new ("Target anchor:"); - gtk_table_attach_defaults (GTK_TABLE (anchorTable), label, - 0, 1, 1, 2); - edgeTargetAnchorEntry = GTK_ENTRY (gtk_entry_new ()); - g_object_ref_sink (edgeTargetAnchorEntry); - gtk_table_attach_defaults (GTK_TABLE (anchorTable), - GTK_WIDGET (edgeTargetAnchorEntry), - 1, 2, 1, 2); - g_signal_connect (G_OBJECT (edgeTargetAnchorEntry), - "changed", - G_CALLBACK (edge_target_anchor_changed_cb), - self); - - gtk_widget_show_all (anchorTable); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - anchorTable, - FALSE, FALSE, 0); - - split = gtk_hseparator_new (); - gtk_widget_show (split); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - split, - FALSE, FALSE, 0); - - edgeNodeToggle = GTK_TOGGLE_BUTTON (gtk_check_button_new_with_label ("Child node")); - g_object_ref_sink (edgeNodeToggle); - gtk_widget_show (GTK_WIDGET (edgeNodeToggle)); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - GTK_WIDGET (edgeNodeToggle), - FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (GTK_WIDGET (edgeNodeToggle)), - "toggled", - G_CALLBACK (edge_node_toggled_cb), - self); - - edgeNodePropsWidget = createPropsPaneWithLabelEntry(edgeNodeProps, &edgeNodeLabelEntry); - g_object_ref_sink (edgeNodePropsWidget); - g_object_ref_sink (edgeNodeLabelEntry); - gtk_box_pack_start (GTK_BOX (edgePropsWidget), - edgeNodePropsWidget, - TRUE, TRUE, 0); - g_signal_connect (G_OBJECT (edgeNodeLabelEntry), - "changed", - G_CALLBACK (edge_node_label_changed_cb), - self); - - /* - * Misc setup - */ - - [self _setDisplayedWidget:graphPropsWidget]; - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (graphPropsWidget); - g_object_unref (nodePropsWidget); - g_object_unref (edgePropsWidget); - - g_object_unref (nodeLabelEntry); - g_object_unref (edgeNodeToggle); - g_object_unref (edgeNodePropsWidget); - g_object_unref (edgeNodeLabelEntry); - g_object_unref (edgeSourceAnchorEntry); - g_object_unref (edgeTargetAnchorEntry); - - g_object_unref (layout); - - [graphProps release]; - [nodeProps release]; - [edgeProps release]; - [edgeNodeProps release]; - - [graphPropDelegate release]; - [nodePropDelegate release]; - [edgePropDelegate release]; - - [document release]; - - [super dealloc]; -} - -- (TikzDocument*) document { - return document; -} - -- (void) setDocument:(TikzDocument*)doc { - if (document != nil) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:document]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:[document pickSupport]]; - } - - [doc retain]; - [document release]; - document = doc; - - [graphPropDelegate setDocument:doc]; - [nodePropDelegate setDocument:doc]; - [edgePropDelegate setDocument:doc]; - - if (doc != nil) { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeSelectionChanged:) - name:@"NodeSelectionChanged" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeSelectionChanged:) - name:@"EdgeSelectionChanged" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(graphChanged:) - name:@"TikzChanged" object:doc]; - } - - [self _updatePane]; -} - -- (BOOL) visible { - return gtk_widget_get_visible (layout); -} - -- (void) setVisible:(BOOL)visible { - gtk_widget_set_visible (layout, visible); -} - -- (GtkWidget*) gtkWidget { - return layout; -} - -- (void) loadConfiguration:(Configuration*)config { -} - -- (void) saveConfiguration:(Configuration*)config { -} - -@end -// }}} -// {{{ Notifications - -@implementation PropertiesPane (Notifications) - -- (void) nodeSelectionChanged:(NSNotification*)n { - [self _updatePane]; -} - -- (void) edgeSelectionChanged:(NSNotification*)n { - [self _updatePane]; -} - -- (void) graphChanged:(NSNotification*)n { - [self _updatePane]; -} - -- (void) nodeLabelEdited:(NSString*)newValue { - if (blockUpdates) - return; - - NSSet *sel = [[document pickSupport] selectedNodes]; - if ([sel count] != 1) { - NSLog(@"Expected single node selected; got %lu", [sel count]); - return; - } - - if ([newValue isValidTikzPropertyNameOrValue]) { - Node *node = [sel anyObject]; - [document startModifyNode:node]; - [node setLabel:newValue]; - [document endModifyNode]; - } else { - widget_set_error (GTK_WIDGET (nodeLabelEntry)); - } -} - -- (void) edgeNodeLabelEdited:(NSString*)newValue { - if (blockUpdates) - return; - - NSSet *sel = [[document pickSupport] selectedEdges]; - if ([sel count] != 1) { - NSLog(@"Expected single edge selected; got %lu", [sel count]); - return; - } - - Edge *edge = [sel anyObject]; - if (![edge hasEdgeNode]) { - NSLog(@"Expected edge with edge node"); - return; - } - - if ([newValue isValidTikzPropertyNameOrValue]) { - [document startModifyEdge:edge]; - [[edge edgeNode] setLabel:newValue]; - [document endModifyEdge]; - } else { - widget_set_error (GTK_WIDGET (edgeNodeLabelEntry)); - } -} - -- (void) edgeNodeToggled:(BOOL)newValue { - if (blockUpdates) - return; - - NSSet *sel = [[document pickSupport] selectedEdges]; - if ([sel count] != 1) { - NSLog(@"Expected single edge selected; got %lu", [sel count]); - return; - } - - Edge *edge = [sel anyObject]; - - [document startModifyEdge:edge]; - [edge setHasEdgeNode:newValue]; - [document endModifyEdge]; -} - -- (BOOL) edgeSourceAnchorEdited:(NSString*)newValue { - if (blockUpdates) - return YES; - - NSSet *sel = [[document pickSupport] selectedEdges]; - if ([sel count] != 1) { - NSLog(@"Expected single edge selected; got %lu", [sel count]); - return YES; - } - - Edge *edge = [sel anyObject]; - if ([newValue isValidAnchor]) { - [document startModifyEdge:edge]; - [edge setSourceAnchor:newValue]; - [document endModifyEdge]; - return YES; - } else { - return NO; - } -} - -- (BOOL) edgeTargetAnchorEdited:(NSString*)newValue { - if (blockUpdates) - return YES; - - NSSet *sel = [[document pickSupport] selectedEdges]; - if ([sel count] != 1) { - NSLog(@"Expected single edge selected; got %lu", [sel count]); - return YES; - } - - Edge *edge = [sel anyObject]; - if ([newValue isValidAnchor]) { - [document startModifyEdge:edge]; - [edge setTargetAnchor:newValue]; - [document endModifyEdge]; - return YES; - } else { - return NO; - } -} - -@end -// }}} -// {{{ Private - -@implementation PropertiesPane (Private) - -- (void) _setDisplayedWidget:(GtkWidget*)widget { - if (currentPropsWidget != widget) { - if (currentPropsWidget) - gtk_widget_hide (currentPropsWidget); - currentPropsWidget = widget; - if (widget) - gtk_widget_show (widget); - } -} - -- (void) _updatePane { - blockUpdates = YES; - - BOOL editGraphProps = YES; - GraphElementData *data = [[document graph] data]; - [graphProps setData:data]; - - NSSet *nodeSel = [[document pickSupport] selectedNodes]; - if ([nodeSel count] == 1) { - Node *n = [nodeSel anyObject]; - [nodePropDelegate setNode:n]; - [nodeProps setData:[n data]]; - gtk_entry_set_text (nodeLabelEntry, [[n label] UTF8String]); - widget_clear_error (GTK_WIDGET (nodeLabelEntry)); - [self _setDisplayedWidget:nodePropsWidget]; - editGraphProps = NO; - } else { - [nodePropDelegate setNode:nil]; - [nodeProps setData:nil]; - gtk_entry_set_text (nodeLabelEntry, ""); - - NSSet *edgeSel = [[document pickSupport] selectedEdges]; - if ([edgeSel count] == 1) { - Edge *e = [edgeSel anyObject]; - [edgePropDelegate setEdge:e]; - [edgeProps setData:[e data]]; - gtk_entry_set_text (edgeSourceAnchorEntry, - [[e sourceAnchor] UTF8String]); - gtk_entry_set_text (edgeTargetAnchorEntry, - [[e targetAnchor] UTF8String]); - widget_clear_error (GTK_WIDGET (edgeSourceAnchorEntry)); - widget_clear_error (GTK_WIDGET (edgeTargetAnchorEntry)); - widget_clear_error (GTK_WIDGET (edgeNodeLabelEntry)); - if ([e hasEdgeNode]) { - gtk_toggle_button_set_active (edgeNodeToggle, TRUE); - gtk_widget_show (edgeNodePropsWidget); - gtk_entry_set_text (edgeNodeLabelEntry, [[[e edgeNode] label] UTF8String]); - [edgeNodeProps setData:[[e edgeNode] data]]; - gtk_widget_set_sensitive (edgeNodePropsWidget, TRUE); - } else { - gtk_toggle_button_set_active (edgeNodeToggle, FALSE); - gtk_widget_hide (edgeNodePropsWidget); - gtk_entry_set_text (edgeNodeLabelEntry, ""); - [edgeNodeProps setData:nil]; - gtk_widget_set_sensitive (edgeNodePropsWidget, FALSE); - } - [self _setDisplayedWidget:edgePropsWidget]; - editGraphProps = NO; - } else { - [edgePropDelegate setEdge:nil]; - [edgeProps setData:nil]; - [edgeNodeProps setData:nil]; - gtk_entry_set_text (edgeNodeLabelEntry, ""); - } - } - - if (editGraphProps) { - [self _setDisplayedWidget:graphPropsWidget]; - } - - blockUpdates = NO; -} - -@end - -// }}} -// {{{ Delegates - -@implementation GraphPropertyDelegate -- (id) init { - self = [super init]; - if (self) { - doc = nil; - } - return self; -} -- (void) dealloc { - // doc is not retained - [super dealloc]; -} -- (void) setDocument:(TikzDocument*)d { - doc = d; -} -- (BOOL)startEdit { - if ([doc graph] != nil) { - [doc startChangeGraphProperties]; - return YES; - } - return NO; -} -- (void)endEdit { - [doc endChangeGraphProperties]; -} -- (void)cancelEdit { - [doc cancelChangeGraphProperties]; -} -@end - -@implementation NodePropertyDelegate -- (id) init { - self = [super init]; - if (self) { - doc = nil; - node = nil; - } - return self; -} -- (void) dealloc { - // doc,node not retained - [super dealloc]; -} -- (void) setDocument:(TikzDocument*)d { - doc = d; - node = nil; -} -- (void) setNode:(Node*)n { - node = n; -} -- (BOOL)startEdit { - if (node != nil) { - [doc startModifyNode:node]; - return YES; - } - return NO; -} -- (void)endEdit { - [doc endModifyNode]; -} -- (void)cancelEdit { - [doc cancelModifyNode]; -} -@end - -@implementation EdgePropertyDelegate -- (id) init { - self = [super init]; - if (self) { - doc = nil; - edge = nil; - } - return self; -} -- (void) dealloc { - // doc,edge not retained - [super dealloc]; -} -- (void) setDocument:(TikzDocument*)d { - doc = d; - edge = nil; -} -- (void) setEdge:(Edge*)e { - edge = e; -} -- (BOOL)startEdit { - if (edge != nil) { - [doc startModifyEdge:edge]; - return YES; - } - return NO; -} -- (void)endEdit { - [doc endModifyEdge]; -} -- (void)cancelEdit { - [doc cancelModifyEdge]; -} -@end - -// }}} -// {{{ GTK+ helpers - -static GtkWidget *createLabelledEntry (const gchar *labelText, GtkEntry **entry) { - GtkBox *box = GTK_BOX (gtk_hbox_new (FALSE, 0)); - GtkWidget *label = gtk_label_new (labelText); - gtk_widget_show (label); - GtkWidget *entryWidget = gtk_entry_new (); - gtk_widget_show (entryWidget); - // container widget expand fill pad - gtk_box_pack_start (box, label, FALSE, TRUE, 5); - gtk_box_pack_start (box, entryWidget, TRUE, TRUE, 0); - if (entry) - *entry = GTK_ENTRY (entryWidget); - return GTK_WIDGET (box); -} - -static GtkWidget *createPropsPaneWithLabelEntry (PropertyListEditor *props, GtkEntry **labelEntry) { - GtkBox *box = GTK_BOX (gtk_vbox_new (FALSE, 6)); - - GtkWidget *labelWidget = createLabelledEntry ("Label", labelEntry); - gtk_widget_show (labelWidget); - // box widget expand fill pad - gtk_box_pack_start (box, labelWidget, FALSE, FALSE, 0); - gtk_box_pack_start (box, [props widget], TRUE, TRUE, 0); - gtk_widget_show ([props widget]); - return GTK_WIDGET (box); -} - -static GtkWidget *createBoldLabel (const gchar *text) { - GtkWidget *label = gtk_label_new (text); - label_set_bold (GTK_LABEL (label)); - return label; -} - -// }}} -// {{{ GTK+ callbacks - -static void node_label_changed_cb (GtkEditable *editable, PropertiesPane *pane) { - if (!gtk_widget_is_sensitive (GTK_WIDGET (editable))) { - // clearly wasn't the user editing - return; - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString *newValue = gtk_editable_get_string (editable, 0, -1); - [pane nodeLabelEdited:newValue]; - - [pool drain]; -} - -static void edge_node_label_changed_cb (GtkEditable *editable, PropertiesPane *pane) { - if (!gtk_widget_is_sensitive (GTK_WIDGET (editable))) { - // clearly wasn't the user editing - return; - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString *newValue = gtk_editable_get_string (editable, 0, -1); - [pane edgeNodeLabelEdited:newValue]; - - [pool drain]; -} - -static void edge_node_toggled_cb (GtkToggleButton *toggle, PropertiesPane *pane) { - if (!gtk_widget_is_sensitive (GTK_WIDGET (toggle))) { - // clearly wasn't the user editing - return; - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - gboolean newValue = gtk_toggle_button_get_active (toggle); - [pane edgeNodeToggled:newValue]; - - [pool drain]; -} - -static void edge_source_anchor_changed_cb (GtkEditable *editable, PropertiesPane *pane) { - if (!gtk_widget_is_sensitive (GTK_WIDGET (editable))) { - // clearly wasn't the user editing - return; - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString *newValue = gtk_editable_get_string (editable, 0, -1); - if (![pane edgeSourceAnchorEdited:newValue]) - widget_set_error (GTK_WIDGET (editable)); - - [pool drain]; -} - -static void edge_target_anchor_changed_cb (GtkEditable *editable, PropertiesPane *pane) { - if (!gtk_widget_is_sensitive (GTK_WIDGET (editable))) { - // clearly wasn't the user editing - return; - } - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString *newValue = gtk_editable_get_string (editable, 0, -1); - if (![pane edgeTargetAnchorEdited:newValue]) - widget_set_error (GTK_WIDGET (editable)); - - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/PropertyListEditor.h b/tikzit-old/src/gtk/PropertyListEditor.h deleted file mode 100644 index 2d3166a..0000000 --- a/tikzit-old/src/gtk/PropertyListEditor.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import -#import "GraphElementData.h" -#import "GraphElementProperty.h" - -@protocol PropertyChangeDelegate -@optional -- (BOOL)startEdit; -- (void)endEdit; -- (void)cancelEdit; -@end - -@interface PropertyListEditor: NSObject { - GraphElementData *data; - NSObject *delegate; - - GtkListStore *list; - GtkWidget *view; - GtkWidget *widget; - GtkWidget *removeButton; -} - -/*! - @property widget - @brief The widget displaying the editable list - */ -@property (readonly) GtkWidget *widget; - -/*! - @property data - @brief The GraphElementData that should be reflected in the list - */ -@property (retain) GraphElementData *data; - -/*! - @property delegate - @brief A delegate for dealing with property changes - */ -@property (retain) NSObject *delegate; - -/*! - * Reload the properties from the data store - */ -- (void) reloadProperties; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/PropertyListEditor.m b/tikzit-old/src/gtk/PropertyListEditor.m deleted file mode 100644 index 9760618..0000000 --- a/tikzit-old/src/gtk/PropertyListEditor.m +++ /dev/null @@ -1,501 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "PropertyListEditor.h" -#import "gtkhelpers.h" - -// {{{ Constants - -enum { - PLM_NAME_COL = 0, - PLM_VALUE_COL, - PLM_IS_PROPERTY_COL, - PLM_PROPERTY_COL, - PLM_N_COLS -}; - -// }}} -// {{{ Internal interfaces -// {{{ Signals - -static void value_edited_cb (GtkCellRendererText *renderer, - gchar *path, - gchar *new_text, - PropertyListEditor *editor); -static void name_edited_cb (GtkCellRendererText *renderer, - gchar *path, - gchar *new_text, - PropertyListEditor *editor); -static void add_prop_clicked_cb (GtkButton *button, - PropertyListEditor *editor); -static void add_atom_clicked_cb (GtkButton *button, - PropertyListEditor *editor); -static void remove_clicked_cb (GtkButton *button, - PropertyListEditor *editor); -static void text_editing_started (GtkCellRenderer *cell, - GtkCellEditable *editable, - const gchar *path, - PropertyListEditor *editor); -static void text_changed_cb (GtkEditable *editable, - PropertyListEditor *pane); -static void selection_changed_cb (GtkTreeSelection *selection, - PropertyListEditor *pane); - -// }}} -// {{{ Private - -@interface PropertyListEditor (Private) -- (void) updatePath:(gchar*)path withValue:(NSString*)newText; -- (void) updatePath:(gchar*)path withName:(NSString*)newText; -- (void) addProperty; -- (void) addAtom; -- (void) removeSelected; -- (void) selectionCountChanged:(int)newSelectionCount; -- (void) clearStore; -@end - -// }}} -// }}} -// {{{ API - -@implementation PropertyListEditor - -- (id) init { - self = [super init]; - - if (self) { - list = gtk_list_store_new (PLM_N_COLS, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_BOOLEAN, - G_TYPE_POINTER); - g_object_ref_sink (G_OBJECT (list)); - view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list)); - g_object_ref_sink (G_OBJECT (view)); - GtkWidget *scrolledview = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledview), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_container_add (GTK_CONTAINER (scrolledview), view); - gtk_widget_set_size_request (view, -1, 150); - data = nil; - delegate = nil; - - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - - renderer = gtk_cell_renderer_text_new (); - g_object_set (G_OBJECT (renderer), - "editable", TRUE, - NULL); - column = gtk_tree_view_column_new_with_attributes ("Key/Atom", - renderer, - "text", PLM_NAME_COL, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (view), column); - g_signal_connect (G_OBJECT (renderer), - "editing-started", - G_CALLBACK (text_editing_started), - self); - g_signal_connect (G_OBJECT (renderer), - "edited", - G_CALLBACK (name_edited_cb), - self); - - renderer = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("Value", - renderer, - "text", PLM_VALUE_COL, - "editable", PLM_IS_PROPERTY_COL, - "sensitive", PLM_IS_PROPERTY_COL, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (view), column); - g_signal_connect (G_OBJECT (renderer), - "edited", - G_CALLBACK (value_edited_cb), - self); - - widget = gtk_vbox_new (FALSE, 0); - gtk_box_set_spacing (GTK_BOX (widget), 6); - g_object_ref_sink (G_OBJECT (widget)); - - GtkWidget *listFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (listFrame), scrolledview); - gtk_widget_show (listFrame); - gtk_container_add (GTK_CONTAINER (widget), listFrame); - - GtkBox *buttonBox = GTK_BOX (gtk_hbox_new(FALSE, 0)); - gtk_box_pack_start (GTK_BOX (widget), GTK_WIDGET (buttonBox), FALSE, FALSE, 0); - - GtkWidget *addPropButton = gtk_button_new (); - //gtk_widget_set_size_request (addPropButton, 27, 27); - gtk_widget_set_tooltip_text (addPropButton, "Add property"); - GtkWidget *addPropContents = gtk_hbox_new(FALSE, 0); - GtkWidget *addPropIcon = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (addPropContents), addPropIcon); - gtk_container_add (GTK_CONTAINER (addPropContents), gtk_label_new ("P")); - gtk_container_add (GTK_CONTAINER (addPropButton), addPropContents); - gtk_box_pack_start (buttonBox, addPropButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (addPropButton), - "clicked", - G_CALLBACK (add_prop_clicked_cb), - self); - - GtkWidget *addAtomButton = gtk_button_new (); - //gtk_widget_set_size_request (addAtomButton, 27, 27); - gtk_widget_set_tooltip_text (addAtomButton, "Add atom"); - GtkWidget *addAtomContents = gtk_hbox_new(FALSE, 0); - GtkWidget *addAtomIcon = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (addAtomContents), addAtomIcon); - gtk_container_add (GTK_CONTAINER (addAtomContents), gtk_label_new ("A")); - gtk_container_add (GTK_CONTAINER (addAtomButton), addAtomContents); - gtk_box_pack_start (buttonBox, addAtomButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (addAtomButton), - "clicked", - G_CALLBACK (add_atom_clicked_cb), - self); - - removeButton = gtk_button_new (); - g_object_ref_sink (G_OBJECT (removeButton)); - gtk_widget_set_sensitive (removeButton, FALSE); - //gtk_widget_set_size_request (removeButton, 27, 27); - gtk_widget_set_tooltip_text (removeButton, "Remove selected"); - GtkWidget *removeIcon = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON); - gtk_container_add (GTK_CONTAINER (removeButton), removeIcon); - gtk_box_pack_start (buttonBox, removeButton, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (removeButton), - "clicked", - G_CALLBACK (remove_clicked_cb), - self); - - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); - g_signal_connect (G_OBJECT (selection), - "changed", - G_CALLBACK (selection_changed_cb), - self); - - gtk_widget_show_all (GTK_WIDGET (buttonBox)); - gtk_widget_show_all (scrolledview); - - gtk_widget_set_sensitive (widget, FALSE); - } - - return self; -} - -- (void) dealloc { - [self clearStore]; - - [data release]; - [delegate release]; - - g_object_unref (list); - g_object_unref (view); - g_object_unref (widget); - g_object_unref (removeButton); - - [super dealloc]; -} - -@synthesize widget, delegate; - -- (GraphElementData*) data { return data; } -- (void) setData:(GraphElementData*)d { - [d retain]; - [data release]; - data = d; - [self reloadProperties]; - gtk_widget_set_sensitive (widget, data != nil); -} - -- (void) reloadProperties { - [self clearStore]; - int pos = 0; - for (GraphElementProperty *p in data) { - GtkTreeIter iter; - [p retain]; - gtk_list_store_insert_with_values (list, &iter, pos, - PLM_NAME_COL, [[p key] UTF8String], - PLM_VALUE_COL, [[p value] UTF8String], - PLM_IS_PROPERTY_COL, ![p isAtom], - PLM_PROPERTY_COL, (void *)p, - -1); - ++pos; - } -} - -@end - -// }}} -// {{{ Private - -@implementation PropertyListEditor (Private) -- (void) updatePath:(gchar*)pathStr withValue:(NSString*)newText { - if (![newText isValidTikzPropertyNameOrValue]) - return; - - GtkTreeIter iter; - GtkTreePath *path = gtk_tree_path_new_from_string (pathStr); - - if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (list), &iter, path)) { - gtk_tree_path_free (path); - return; - } - - void *propPtr; - gtk_tree_model_get (GTK_TREE_MODEL (list), &iter, - PLM_PROPERTY_COL, &propPtr, - -1); - GraphElementProperty *prop = (GraphElementProperty*)propPtr; - - if (![prop isAtom]) { - if (![delegate respondsToSelector:@selector(startEdit)] || [delegate startEdit]) { - [prop setValue:newText]; - gtk_list_store_set (list, &iter, - PLM_VALUE_COL, [newText UTF8String], - -1); - [delegate endEdit]; - } - } - - gtk_tree_path_free (path); -} - -- (void) updatePath:(gchar*)pathStr withName:(NSString*)newText { - if (![newText isValidTikzPropertyNameOrValue]) - return; - - GtkTreeIter iter; - GtkTreePath *path = gtk_tree_path_new_from_string (pathStr); - - if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (list), &iter, path)) { - gtk_tree_path_free (path); - return; - } - - void *propPtr; - gtk_tree_model_get (GTK_TREE_MODEL (list), &iter, - PLM_PROPERTY_COL, &propPtr, - -1); - GraphElementProperty *prop = (GraphElementProperty*)propPtr; - - if (![delegate respondsToSelector:@selector(startEdit)] || [delegate startEdit]) { - if ([newText isEqualToString:@""]) { - [data removeObjectIdenticalTo:prop]; - gtk_list_store_remove (list, &iter); - [prop release]; - } else { - [prop setKey:newText]; - gtk_list_store_set (list, &iter, - PLM_NAME_COL, [newText UTF8String], - -1); - } - [delegate endEdit]; - } - - gtk_tree_path_free (path); -} - -- (void) addProperty { - GtkTreeIter iter; - GraphElementProperty *p = [[GraphElementProperty alloc] initWithPropertyValue:@"" forKey:@"new property"]; - if (![delegate respondsToSelector:@selector(startEdit)] || [delegate startEdit]) { - [data addObject:p]; - gint pos = [data count] - 1; - gtk_list_store_insert_with_values (list, &iter, pos, - PLM_NAME_COL, "new property", - PLM_VALUE_COL, "", - PLM_IS_PROPERTY_COL, TRUE, - PLM_PROPERTY_COL, (void *)p, - -1); - [delegate endEdit]; - } else { - [p release]; - } -} - -- (void) addAtom { - GtkTreeIter iter; - GraphElementProperty *p = [[GraphElementProperty alloc] initWithAtomName:@"new atom"]; - if (![delegate respondsToSelector:@selector(startEdit)] || [delegate startEdit]) { - [data addObject:p]; - gint pos = [data count] - 1; - gtk_list_store_insert_with_values (list, &iter, pos, - PLM_NAME_COL, "new atom", - PLM_VALUE_COL, [[p value] UTF8String], - PLM_IS_PROPERTY_COL, FALSE, - PLM_PROPERTY_COL, (void *)p, - -1); - [delegate endEdit]; - } else { - [p release]; - } -} - -- (void) removeSelected { - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); - GList *selPaths = gtk_tree_selection_get_selected_rows (selection, NULL); - GList *selIters = NULL; - - // Convert to iters, as GtkListStore has persistent iters - GList *curr = selPaths; - while (curr != NULL) { - GtkTreeIter iter; - gtk_tree_model_get_iter (GTK_TREE_MODEL (list), - &iter, - (GtkTreePath*)curr->data); - selIters = g_list_prepend (selIters, gtk_tree_iter_copy (&iter)); - curr = g_list_next (curr); - } - - // remove all iters - curr = selIters; - while (curr != NULL) { - GtkTreeIter *iter = (GtkTreeIter*)curr->data; - void *propPtr; - gtk_tree_model_get (GTK_TREE_MODEL (list), iter, - PLM_PROPERTY_COL, &propPtr, - -1); - GraphElementProperty *prop = (GraphElementProperty*)propPtr; - if (![delegate respondsToSelector:@selector(startEdit)] || [delegate startEdit]) { - [data removeObjectIdenticalTo:prop]; - gtk_list_store_remove (list, iter); - [prop release]; - [delegate endEdit]; - } - curr = g_list_next (curr); - } - - g_list_foreach (selIters, (GFunc) gtk_tree_iter_free, NULL); - g_list_free (selIters); - g_list_foreach (selPaths, (GFunc) gtk_tree_path_free, NULL); - g_list_free (selPaths); -} - -- (void) selectionCountChanged:(int)count { - gtk_widget_set_sensitive (removeButton, count > 0); -} - -- (void) clearStore { - GtkTreeIter iter; - if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list), &iter)) { - do { - void *prop; - gtk_tree_model_get (GTK_TREE_MODEL (list), &iter, - PLM_PROPERTY_COL, &prop, - -1); - [(id)prop release]; - } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (list), &iter)); - gtk_list_store_clear (list); - } -} -@end - -// }}} -// {{{ GTK+ callbacks - -static void value_edited_cb (GtkCellRendererText *renderer, - gchar *path, - gchar *new_text, - PropertyListEditor *editor) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor updatePath:path withValue:[NSString stringWithUTF8String:new_text]]; - [pool drain]; -} - -static void name_edited_cb (GtkCellRendererText *renderer, - gchar *path, - gchar *new_text, - PropertyListEditor *editor) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor updatePath:path withName:[NSString stringWithUTF8String:new_text]]; - [pool drain]; -} - -static void add_prop_clicked_cb (GtkButton *button, - PropertyListEditor *editor) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor addProperty]; - [pool drain]; -} - -static void add_atom_clicked_cb (GtkButton *button, - PropertyListEditor *editor) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor addAtom]; - [pool drain]; -} - -static void remove_clicked_cb (GtkButton *button, - PropertyListEditor *editor) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [editor removeSelected]; - [pool drain]; -} - -static void text_editing_started (GtkCellRenderer *cell, - GtkCellEditable *editable, - const gchar *path, - PropertyListEditor *editor) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - if (GTK_IS_EDITABLE (editable) && GTK_IS_WIDGET (editable)) { - g_signal_handlers_disconnect_by_func (G_OBJECT (editable), - G_CALLBACK (text_changed_cb), - editor); - widget_clear_error (GTK_WIDGET (editable)); - g_signal_connect (G_OBJECT (editable), - "changed", - G_CALLBACK (text_changed_cb), - editor); - } - - [pool drain]; -} - -static void text_changed_cb (GtkEditable *editable, PropertyListEditor *pane) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - NSString *newValue = gtk_editable_get_string (editable, 0, -1); - if (![newValue isValidTikzPropertyNameOrValue]) { - widget_set_error (GTK_WIDGET (editable)); - } else { - widget_clear_error (GTK_WIDGET (editable)); - } - - [pool drain]; -} - -static void selection_changed_cb (GtkTreeSelection *selection, - PropertyListEditor *pane) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - int selcount = gtk_tree_selection_count_selected_rows (selection); - [pane selectionCountChanged:selcount]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/RecentManager.h b/tikzit-old/src/gtk/RecentManager.h deleted file mode 100644 index e2c2793..0000000 --- a/tikzit-old/src/gtk/RecentManager.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" - -@interface RecentManager: NSObject { -} - -+ (RecentManager*) defaultManager; - -- (void)addRecentFile:(NSString*)path; -- (void)removeRecentFile:(NSString*)path; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/RecentManager.m b/tikzit-old/src/gtk/RecentManager.m deleted file mode 100644 index c6074c6..0000000 --- a/tikzit-old/src/gtk/RecentManager.m +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "RecentManager.h" -#import - -static RecentManager *defMan = nil; - -@implementation RecentManager -- (id) init { - self = [super init]; - return self; -} - -+ (RecentManager*) defaultManager { - if (defMan == nil) { - defMan = [[self alloc] init]; - } - return defMan; -} - -- (void)addRecentFile:(NSString*)path { - NSError *error = nil; - gchar *uri = [path glibUriWithError:&error]; - if (error) { - logError (error, @"Could not add recent file"); - return; - } - - GtkRecentData recent_data; - recent_data.display_name = NULL; - recent_data.description = NULL; - recent_data.mime_type = "text/x-tikz"; - recent_data.app_name = (gchar *) g_get_application_name (); - recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL); - recent_data.groups = NULL; - recent_data.is_private = FALSE; - - gtk_recent_manager_add_full (gtk_recent_manager_get_default(), uri, &recent_data); - - g_free (uri); - g_free (recent_data.app_exec); -} - -- (void)removeRecentFile:(NSString*)path { - NSError *error = nil; - gchar *uri = [path glibUriWithError:&error]; - if (error) { - logError (error, @"Could not remove recent file"); - return; - } - - gtk_recent_manager_remove_item (gtk_recent_manager_get_default(), uri, NULL); - - g_free (uri); -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/SelectTool.h b/tikzit-old/src/gtk/SelectTool.h deleted file mode 100644 index 65f511a..0000000 --- a/tikzit-old/src/gtk/SelectTool.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Tool.h" - -@class Edge; -@class Node; - -// FIXME: replace this with delegates -typedef enum { - QuietState, - SelectBoxState, - ToggleSelectState, - MoveSelectedNodesState, - DragEdgeControlPoint1, - DragEdgeControlPoint2 -} SelectToolState; - -typedef enum { - DragSelectsNodes = 1, - DragSelectsEdges = 2, - DragSelectsBoth = DragSelectsNodes | DragSelectsEdges -} DragSelectMode; - -@interface SelectTool : NSObject { - GraphRenderer *renderer; - SelectToolState state; - float edgeFuzz; - DragSelectMode dragSelectMode; - NSPoint dragOrigin; - Node *leaderNode; - NSPoint oldLeaderPos; - Edge *modifyEdge; - NSRect selectionBox; - NSMutableSet *selectionBoxContents; - - GtkWidget *configWidget; - GSList *dragSelectModeButtons; -} - -@property (assign) float edgeFuzz; -@property (assign) DragSelectMode dragSelectMode; - -- (id) init; -+ (id) tool; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/SelectTool.m b/tikzit-old/src/gtk/SelectTool.m deleted file mode 100644 index b3121ae..0000000 --- a/tikzit-old/src/gtk/SelectTool.m +++ /dev/null @@ -1,590 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "SelectTool.h" - -#import "Configuration.h" -#import "Edge+Render.h" -#import "GraphRenderer.h" -#import "TikzDocument.h" -#import "tzstockitems.h" - -#import - -#define DRAG_SELECT_MODE_KEY "tikzit-drag-select-mode" - -static const InputMask unionSelectMask = ShiftMask; - -static void drag_select_mode_cb (GtkToggleButton *button, SelectTool *tool); - -@interface SelectTool (Private) -- (TikzDocument*) doc; -- (void) shiftNodesByMovingLeader:(Node*)leader to:(NSPoint)to; -- (void) deselectAllNodes; -- (void) deselectAllEdges; -- (void) deselectAll; -- (BOOL) circleWithCenter:(NSPoint)c andRadius:(float)r containsPoint:(NSPoint)p; -- (void) lookForControlPointAt:(NSPoint)pos; -- (void) setSelectionBox:(NSRect)box; -- (void) clearSelectionBox; -- (BOOL) selectionBoxContainsNode:(Node*)node; -@end - -@implementation SelectTool -- (NSString*) name { return @"Select"; } -- (const gchar*) stockId { return TIKZIT_STOCK_SELECT; } -- (NSString*) helpText { return @"Select, move and edit nodes and edges"; } -- (NSString*) shortcut { return @"s"; } -@synthesize configurationWidget=configWidget; -@synthesize edgeFuzz; - -+ (id) tool { - return [[[self alloc] init] autorelease]; -} - -- (id) init { - self = [super init]; - - if (self) { - state = QuietState; - edgeFuzz = 3.0f; - dragSelectMode = DragSelectsNodes; - - configWidget = gtk_vbox_new (FALSE, 0); - g_object_ref_sink (configWidget); - - GtkWidget *label = gtk_label_new ("Drag selects:"); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_box_pack_start (GTK_BOX (configWidget), - label, - FALSE, - FALSE, - 0); - - GtkWidget *nodeOpt = gtk_radio_button_new_with_label (NULL, "nodes (N)"); - g_object_set_data (G_OBJECT (nodeOpt), - DRAG_SELECT_MODE_KEY, - (gpointer)DragSelectsNodes); - gtk_box_pack_start (GTK_BOX (configWidget), - nodeOpt, - FALSE, - FALSE, - 0); - g_signal_connect (G_OBJECT (nodeOpt), - "toggled", - G_CALLBACK (drag_select_mode_cb), - self); - - GtkWidget *edgeOpt = gtk_radio_button_new_with_label ( - gtk_radio_button_get_group (GTK_RADIO_BUTTON (nodeOpt)), - "edges (E)"); - g_object_set_data (G_OBJECT (edgeOpt), - DRAG_SELECT_MODE_KEY, - (gpointer)DragSelectsEdges); - gtk_box_pack_start (GTK_BOX (configWidget), - edgeOpt, - FALSE, - FALSE, - 0); - g_signal_connect (G_OBJECT (edgeOpt), - "toggled", - G_CALLBACK (drag_select_mode_cb), - self); - - GtkWidget *bothOpt = gtk_radio_button_new_with_label ( - gtk_radio_button_get_group (GTK_RADIO_BUTTON (edgeOpt)), - "both (B)"); - g_object_set_data (G_OBJECT (bothOpt), - DRAG_SELECT_MODE_KEY, - (gpointer)DragSelectsBoth); - gtk_box_pack_start (GTK_BOX (configWidget), - bothOpt, - FALSE, - FALSE, - 0); - g_signal_connect (G_OBJECT (bothOpt), - "toggled", - G_CALLBACK (drag_select_mode_cb), - self); - dragSelectModeButtons = gtk_radio_button_get_group (GTK_RADIO_BUTTON (bothOpt)); - - gtk_widget_show_all (configWidget); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [renderer release]; - [leaderNode release]; - [modifyEdge release]; - - g_object_unref (G_OBJECT (configWidget)); - - [super dealloc]; -} - -- (DragSelectMode) dragSelectMode { - return dragSelectMode; -} - -- (void) setDragSelectMode:(DragSelectMode)mode { - if (dragSelectMode == mode) - return; - - dragSelectMode = mode; - - GSList *entry = dragSelectModeButtons; - while (entry) { - GtkToggleButton *button = GTK_TOGGLE_BUTTON (entry->data); - DragSelectMode buttonMode = - (DragSelectMode) g_object_get_data ( - G_OBJECT (button), - DRAG_SELECT_MODE_KEY); - if (buttonMode == dragSelectMode) { - gtk_toggle_button_set_active (button, TRUE); - break; - } - - entry = g_slist_next (entry); - } -} - -- (GraphRenderer*) activeRenderer { return renderer; } -- (void) setActiveRenderer:(GraphRenderer*)r { - if (r == renderer) - return; - - [r retain]; - [renderer release]; - renderer = r; - - state = QuietState; -} - -- (void) mousePressAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - dragOrigin = pos; - - // we should already be in a quiet state, but no harm in making sure - state = QuietState; - - modifyEdge = nil; - [self lookForControlPointAt:pos]; - - if (modifyEdge == nil) { - // we didn't find a control point - - BOOL unionSelect = (mask & unionSelectMask); - - leaderNode = [renderer anyNodeAt:pos]; - // if we hit a node, deselect other nodes (if Shift is up) and go to move mode - if (leaderNode != nil) { - BOOL alreadySelected = [[self doc] isNodeSelected:leaderNode]; - if (!unionSelect && !alreadySelected) { - [self deselectAll]; - } - if (unionSelect && alreadySelected) { - state = ToggleSelectState; - } else { - [[[self doc] pickSupport] selectNode:leaderNode]; - state = MoveSelectedNodesState; - oldLeaderPos = [leaderNode point]; - [[self doc] startShiftNodes:[[[self doc] pickSupport] selectedNodes]]; - } - } - - // if mouse did not hit a node, check if mouse hit an edge - if (leaderNode == nil) { - Edge *edge = [renderer anyEdgeAt:pos withFuzz:edgeFuzz]; - if (edge != nil) { - BOOL alreadySelected = [[self doc] isEdgeSelected:edge]; - if (!unionSelect) { - [self deselectAll]; - } - if (unionSelect && alreadySelected) { - [[[self doc] pickSupport] deselectEdge:edge]; - } else { - [[[self doc] pickSupport] selectEdge:edge]; - } - } else { - // if mouse did not hit anything, put us in box mode - if (!unionSelect) { - [self deselectAll]; - } - [renderer clearHighlightedNodes]; - state = SelectBoxState; - } - } - } -} - -- (void) mouseMoveTo:(NSPoint)pos withButtons:(MouseButton)buttons andMask:(InputMask)mask { - if (!(buttons & LeftButton)) - return; - - Transformer *transformer = [renderer transformer]; - - if (state == ToggleSelectState) { - state = MoveSelectedNodesState; - oldLeaderPos = [leaderNode point]; - [[self doc] startShiftNodes:[[[self doc] pickSupport] selectedNodes]]; - } - - if (state == SelectBoxState) { - [self setSelectionBox:NSRectAroundPoints(dragOrigin, pos)]; - - NSEnumerator *enumerator = [[self doc] nodeEnumerator]; - Node *node; - while ((node = [enumerator nextObject]) != nil) { - NSPoint nodePos = [transformer toScreen:[node point]]; - if (NSPointInRect(nodePos, selectionBox)) { - [renderer setNode:node highlighted:YES]; - } else { - [renderer setNode:node highlighted:NO]; - } - } - } else if (state == MoveSelectedNodesState) { - if (leaderNode != nil) { - [self shiftNodesByMovingLeader:leaderNode to:pos]; - NSPoint shiftSoFar; - shiftSoFar.x = [leaderNode point].x - oldLeaderPos.x; - shiftSoFar.y = [leaderNode point].y - oldLeaderPos.y; - [[self doc] shiftNodesUpdate:shiftSoFar]; - } - } else if (state == DragEdgeControlPoint1 || state == DragEdgeControlPoint2) { - // invalidate once before we start changing it: we may be shrinking - // the control circles - [[self doc] modifyEdgeCheckPoint]; - if (state == DragEdgeControlPoint1) { - [modifyEdge moveCp1To:[transformer fromScreen:pos] - withWeightCourseness:0.1f - andBendCourseness:15 - forceLinkControlPoints:(mask & ControlMask)]; - } else { - [modifyEdge moveCp2To:[transformer fromScreen:pos] - withWeightCourseness:0.1f - andBendCourseness:15 - forceLinkControlPoints:(mask & ControlMask)]; - } - [[self doc] modifyEdgeCheckPoint]; - } -} - -- (void) mouseReleaseAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - if (state == SelectBoxState) { - PickSupport *ps = [[self doc] pickSupport]; - Transformer *transformer = [renderer transformer]; - - if (!(mask & unionSelectMask)) { - [ps deselectAllNodes]; - [ps deselectAllEdges]; - } - - Graph *graph = [[self doc] graph]; - if (dragSelectMode & DragSelectsNodes) { - for (Node *node in [graph nodes]) { - NSPoint nodePos = [transformer toScreen:[node point]]; - if (NSPointInRect(nodePos, selectionBox)) { - [ps selectNode:node]; - } - } - } - if (dragSelectMode & DragSelectsEdges) { - for (Edge *edge in [graph edges]) { - NSPoint edgePos = [transformer toScreen:[edge mid]]; - if (NSPointInRect(edgePos, selectionBox)) { - [ps selectEdge:edge]; - } - } - } - - [self clearSelectionBox]; - } else if (state == ToggleSelectState) { - [[[self doc] pickSupport] deselectNode:leaderNode]; - leaderNode = nil; - } else if (state == MoveSelectedNodesState) { - if (NSEqualPoints (oldLeaderPos, [leaderNode point])) { - [[self doc] cancelShiftNodes]; - } else { - [[self doc] endShiftNodes]; - } - leaderNode = nil; - } else if (state == DragEdgeControlPoint1 || state == DragEdgeControlPoint2) { - // FIXME: check if there was any real change - [[self doc] endModifyEdge]; - } - - state = QuietState; -} - -- (void) mouseDoubleClickAt:(NSPoint)pos withButton:(MouseButton)button andMask:(InputMask)mask { - if (button != LeftButton) - return; - - if (state != QuietState) { - return; - } - // convert bend mode on edge under mouse cursor - Edge *edge = [renderer anyEdgeAt:pos withFuzz:edgeFuzz]; - if (edge != nil) { - [[self doc] startModifyEdge:edge]; - if ([edge bendMode]==EdgeBendModeBasic) { - [edge convertBendToAngles]; - [edge setBendMode:EdgeBendModeInOut]; - } else { - [edge setBendMode:EdgeBendModeBasic]; - } - [[self doc] endModifyEdge]; - - [self deselectAllEdges]; - [[[self doc] pickSupport] selectEdge:edge]; - } -} - -- (void) keyPressed:(unsigned int)keyVal withMask:(InputMask)mask { - if (keyVal == GDK_KEY_N && mask == ShiftMask) { - [self setDragSelectMode:DragSelectsNodes]; - } else if (keyVal == GDK_KEY_E && mask == ShiftMask) { - [self setDragSelectMode:DragSelectsEdges]; - } else if (keyVal == GDK_KEY_B && mask == ShiftMask) { - [self setDragSelectMode:DragSelectsBoth]; - } else if (keyVal == GDK_KEY_D && (!mask || mask == ShiftMask)) { - PickSupport *ps = [[self doc] pickSupport]; - for (Node* node in [ps selectedNodes]) { - NSRect b = [node boundingRect]; - NSLog(@"%@ @ (%f,%f) {style=%@, label=%@, data=%@, bounds=(%f,%f),(%fx%f)}", - [node name], - [node point].x, - [node point].y, - [[node style] name], - [node label], - [[node data] tikzList], - b.origin.x, b.origin.y, b.size.width, b.size.height); - } - for (Edge* edge in [ps selectedEdges]) { - NSRect b = [edge boundingRect]; - NSLog(@"%@:%@->%@:%@ {\n" - @" style=%@, data=%@,\n" - @" bend=%d, weight=%f, inAngle=%d, outAngle=%d, bendMode=%d,\n" - @" head=(%f,%f), headTan=(%f,%f) leftHeadNormal=(%f,%f), rightHeadNormal=(%f,%f),\n" - @" cp1=(%f,%f),\n" - @" mid=(%f,%f), midTan=(%f,%f), leftNormal=(%f,%f), rightNormal=(%f,%f)\n" - @" cp2=(%f,%f),\n" - @" tail=(%f,%f), tailTan=(%f,%f), leftTailNormal=(%f,%f), rightTailNormal=(%f,%f),\n" - @" isSelfLoop=%s, isStraight=%s,\n" - @" bounds=(%f,%f),(%fx%f)\n" - @"}", - [[edge source] name], - [edge sourceAnchor], - [[edge target] name], - [edge targetAnchor], - [[edge style] name], - [[edge data] tikzList], - [edge bend], - [edge weight], - [edge inAngle], - [edge outAngle], - [edge bendMode], - [edge head].x, - [edge head].y, - [edge headTan].x, - [edge headTan].y, - [edge leftHeadNormal].x, - [edge leftHeadNormal].y, - [edge rightHeadNormal].x, - [edge rightHeadNormal].y, - [edge cp1].x, - [edge cp1].y, - [edge mid].x, - [edge mid].y, - [edge midTan].x, - [edge midTan].y, - [edge leftNormal].x, - [edge leftNormal].y, - [edge rightNormal].x, - [edge rightNormal].y, - [edge cp2].x, - [edge cp2].y, - [edge tail].x, - [edge tail].y, - [edge tailTan].x, - [edge tailTan].y, - [edge leftTailNormal].x, - [edge leftTailNormal].y, - [edge rightTailNormal].x, - [edge rightTailNormal].y, - [edge isSelfLoop] ? "yes" : "no", - [edge isStraight] ? "yes" : "no", - b.origin.x, b.origin.y, b.size.width, b.size.height); - } - } -} - -- (void) renderWithContext:(id)context onSurface:(id)surface { - if (!NSIsEmptyRect (selectionBox)) { - [context saveState]; - - [context setAntialiasMode:AntialiasDisabled]; - [context setLineWidth:1.0]; - [context startPath]; - [context rect:selectionBox]; - RColor fColor = MakeRColor (0.8, 0.8, 0.8, 0.2); - RColor sColor = MakeSolidRColor (0.6, 0.6, 0.6); - [context strokePathWithColor:sColor andFillWithColor:fColor]; - - [context restoreState]; - } -} - -- (void) loadConfiguration:(Configuration*)config { - NSString *mode = [config stringEntry:@"Drag select mode" - inGroup:@"SelectTool"]; - if ([mode isEqualToString:@"nodes"]) { - [self setDragSelectMode:DragSelectsNodes]; - } else if ([mode isEqualToString:@"edges"]) { - [self setDragSelectMode:DragSelectsEdges]; - } else if ([mode isEqualToString:@"both"]) { - [self setDragSelectMode:DragSelectsBoth]; - } -} - -- (void) saveConfiguration:(Configuration*)config { - switch (dragSelectMode) { - case DragSelectsNodes: - [config setStringEntry:@"Drag select mode" - inGroup:@"SelectTool" - value:@"nodes"]; - break; - case DragSelectsEdges: - [config setStringEntry:@"Drag select mode" - inGroup:@"SelectTool" - value:@"edges"]; - break; - case DragSelectsBoth: - [config setStringEntry:@"Drag select mode" - inGroup:@"SelectTool" - value:@"both"]; - break; - } -} - -@end - -@implementation SelectTool (Private) -- (TikzDocument*) doc { - return [renderer document]; -} - -- (void) shiftNodesByMovingLeader:(Node*)leader to:(NSPoint)to { - Transformer *transformer = [renderer transformer]; - - NSPoint from = [transformer toScreen:[leader point]]; - to = [[renderer grid] snapScreenPoint:to]; - float dx = to.x - from.x; - float dy = to.y - from.y; - - for (Node *node in [[[self doc] pickSupport] selectedNodes]) { - NSPoint p = [transformer toScreen:[node point]]; - p.x += dx; - p.y += dy; - [node setPoint:[transformer fromScreen:p]]; - } -} - -- (void) deselectAllNodes { - [[[self doc] pickSupport] deselectAllNodes]; -} - -- (void) deselectAllEdges { - [[[self doc] pickSupport] deselectAllEdges]; -} - -- (void) deselectAll { - [[[self doc] pickSupport] deselectAllNodes]; - [[[self doc] pickSupport] deselectAllEdges]; -} - -- (BOOL) circleWithCenter:(NSPoint)c andRadius:(float)r containsPoint:(NSPoint)p { - return (NSDistanceBetweenPoints(c, p) <= r); -} - -- (void) lookForControlPointAt:(NSPoint)pos { - const float cpr = [Edge controlPointRadius]; - for (Edge *e in [[[self doc] pickSupport] selectedEdges]) { - NSPoint cp1 = [[renderer transformer] toScreen:[e cp1]]; - if ([self circleWithCenter:cp1 andRadius:cpr containsPoint:pos]) { - state = DragEdgeControlPoint1; - modifyEdge = e; - [[self doc] startModifyEdge:e]; - return; - } - NSPoint cp2 = [[renderer transformer] toScreen:[e cp2]]; - if ([self circleWithCenter:cp2 andRadius:cpr containsPoint:pos]) { - state = DragEdgeControlPoint2; - modifyEdge = e; - [[self doc] startModifyEdge:e]; - return; - } - } -} - -- (void) setSelectionBox:(NSRect)box { - NSRect invRect = NSUnionRect (selectionBox, box); - selectionBox = box; - [renderer invalidateRect:NSInsetRect (invRect, -2, -2)]; -} - -- (void) clearSelectionBox { - NSRect oldRect = selectionBox; - - selectionBox = NSZeroRect; - - [renderer invalidateRect:NSInsetRect (oldRect, -2, -2)]; - [renderer clearHighlightedNodes]; -} - -- (BOOL) selectionBoxContainsNode:(Node*)node { - if (!NSIsEmptyRect (selectionBox)) - return NO; - - Transformer *transf = [[renderer surface] transformer]; - NSPoint screenPt = [transf toScreen:[node point]]; - return NSPointInRect(screenPt, selectionBox); -} -@end - -static void drag_select_mode_cb (GtkToggleButton *button, SelectTool *tool) { - if (gtk_toggle_button_get_active (button)) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - DragSelectMode buttonMode = - (DragSelectMode) g_object_get_data ( - G_OBJECT (button), - DRAG_SELECT_MODE_KEY); - [tool setDragSelectMode:buttonMode]; - [pool drain]; - } -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/SelectionPane.h b/tikzit-old/src/gtk/SelectionPane.h deleted file mode 100644 index 57a766a..0000000 --- a/tikzit-old/src/gtk/SelectionPane.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Configuration; -@class EdgeStylesModel; -@class NodeStylesModel; -@class StyleManager; -@class TikzDocument; - -@interface SelectionPane: NSObject { - TikzDocument *document; - - NodeStylesModel *nodeStylesModel; - EdgeStylesModel *edgeStylesModel; - - GtkWidget *layout; - - GtkWidget *nodeStyleCombo; - GtkWidget *applyNodeStyleButton; - GtkWidget *clearNodeStyleButton; - GtkWidget *edgeStyleCombo; - GtkWidget *applyEdgeStyleButton; - GtkWidget *clearEdgeStyleButton; -} - -@property (retain) TikzDocument *document; -@property (assign) BOOL visible; -@property (readonly) GtkWidget *gtkWidget; - -- (id) initWithStyleManager:(StyleManager*)mgr; -- (id) initWithNodeStylesModel:(NodeStylesModel*)nsm - andEdgeStylesModel:(EdgeStylesModel*)esm; - -- (void) loadConfiguration:(Configuration*)config; -- (void) saveConfiguration:(Configuration*)config; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/SelectionPane.m b/tikzit-old/src/gtk/SelectionPane.m deleted file mode 100644 index 2931258..0000000 --- a/tikzit-old/src/gtk/SelectionPane.m +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "SelectionPane.h" - -#import "Configuration.h" -#import "EdgeStylesModel.h" -#import "NodeStylesModel.h" -#import "TikzDocument.h" - -#import "gtkhelpers.h" - -// {{{ Internal interfaces - -static void node_style_changed_cb (GtkComboBox *widget, SelectionPane *pane); -static void apply_node_style_button_cb (GtkButton *widget, SelectionPane *pane); -static void clear_node_style_button_cb (GtkButton *widget, SelectionPane *pane); -static void edge_style_changed_cb (GtkComboBox *widget, SelectionPane *pane); -static void apply_edge_style_button_cb (GtkButton *widget, SelectionPane *pane); -static void clear_edge_style_button_cb (GtkButton *widget, SelectionPane *pane); - -static void setup_style_cell_layout (GtkCellLayout *cell_layout, gint pixbuf_col, gint name_col); - -@interface SelectionPane (Notifications) -- (void) nodeSelectionChanged:(NSNotification*)n; -- (void) edgeSelectionChanged:(NSNotification*)n; -@end - -@interface SelectionPane (Private) -- (void) _updateNodeStyleButtons; -- (void) _updateEdgeStyleButtons; -- (NodeStyle*) _selectedNodeStyle; -- (EdgeStyle*) _selectedEdgeStyle; -- (void) _applyNodeStyle; -- (void) _clearNodeStyle; -- (void) _applyEdgeStyle; -- (void) _clearEdgeStyle; -@end - -// }}} -// {{{ API - -@implementation SelectionPane - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithStyleManager:(StyleManager*)sm { - return [self initWithNodeStylesModel:[NodeStylesModel modelWithStyleManager:sm] - andEdgeStylesModel:[EdgeStylesModel modelWithStyleManager:sm]]; -} - -- (id) initWithNodeStylesModel:(NodeStylesModel*)nsm - andEdgeStylesModel:(EdgeStylesModel*)esm { - self = [super init]; - - if (self) { - nodeStylesModel = [nsm retain]; - edgeStylesModel = [esm retain]; - - layout = gtk_vbox_new (FALSE, 0); - g_object_ref_sink (layout); - gtk_widget_show (layout); - - GtkWidget *label = gtk_label_new ("Selection"); - label_set_bold (GTK_LABEL (label)); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (layout), label, - FALSE, FALSE, 0); - - GtkWidget *lvl1_box = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (layout), lvl1_box, - FALSE, FALSE, 3); - - nodeStyleCombo = gtk_combo_box_new_with_model ([nodeStylesModel model]); - g_object_ref_sink (nodeStyleCombo); - setup_style_cell_layout (GTK_CELL_LAYOUT (nodeStyleCombo), - NODE_STYLES_ICON_COL, - NODE_STYLES_NAME_COL); - g_signal_connect (G_OBJECT (nodeStyleCombo), - "changed", - G_CALLBACK (node_style_changed_cb), - self); - gtk_box_pack_start (GTK_BOX (lvl1_box), nodeStyleCombo, - FALSE, FALSE, 0); - - GtkWidget *lvl2_box = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (lvl1_box), lvl2_box, - FALSE, FALSE, 0); - - applyNodeStyleButton = gtk_button_new_with_label ("Apply"); - g_object_ref_sink (applyNodeStyleButton); - gtk_widget_set_tooltip_text (applyNodeStyleButton, "Apply style to selected nodes"); - gtk_widget_set_sensitive (applyNodeStyleButton, FALSE); - g_signal_connect (G_OBJECT (applyNodeStyleButton), - "clicked", - G_CALLBACK (apply_node_style_button_cb), - self); - gtk_box_pack_start (GTK_BOX (lvl2_box), applyNodeStyleButton, - FALSE, FALSE, 0); - - clearNodeStyleButton = gtk_button_new_with_label ("Clear"); - g_object_ref_sink (clearNodeStyleButton); - gtk_widget_set_tooltip_text (clearNodeStyleButton, "Clear style from selected nodes"); - gtk_widget_set_sensitive (clearNodeStyleButton, FALSE); - g_signal_connect (G_OBJECT (clearNodeStyleButton), - "clicked", - G_CALLBACK (clear_node_style_button_cb), - self); - gtk_box_pack_start (GTK_BOX (lvl2_box), clearNodeStyleButton, - FALSE, FALSE, 0); - - lvl1_box = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (layout), lvl1_box, - FALSE, FALSE, 3); - - edgeStyleCombo = gtk_combo_box_new_with_model ([edgeStylesModel model]); - g_object_ref_sink (edgeStyleCombo); - setup_style_cell_layout (GTK_CELL_LAYOUT (edgeStyleCombo), - EDGE_STYLES_ICON_COL, - EDGE_STYLES_NAME_COL); - g_signal_connect (G_OBJECT (edgeStyleCombo), - "changed", - G_CALLBACK (edge_style_changed_cb), - self); - gtk_box_pack_start (GTK_BOX (lvl1_box), edgeStyleCombo, - FALSE, FALSE, 0); - - lvl2_box = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (lvl1_box), lvl2_box, - FALSE, FALSE, 0); - - applyEdgeStyleButton = gtk_button_new_with_label ("Apply"); - g_object_ref_sink (applyEdgeStyleButton); - gtk_widget_set_tooltip_text (applyEdgeStyleButton, "Apply style to selected edges"); - gtk_widget_set_sensitive (applyEdgeStyleButton, FALSE); - g_signal_connect (G_OBJECT (applyEdgeStyleButton), - "clicked", - G_CALLBACK (apply_edge_style_button_cb), - self); - gtk_box_pack_start (GTK_BOX (lvl2_box), applyEdgeStyleButton, - FALSE, FALSE, 0); - - clearEdgeStyleButton = gtk_button_new_with_label ("Clear"); - g_object_ref_sink (clearEdgeStyleButton); - gtk_widget_set_tooltip_text (clearEdgeStyleButton, "Clear style from selected edges"); - gtk_widget_set_sensitive (clearEdgeStyleButton, FALSE); - g_signal_connect (G_OBJECT (clearEdgeStyleButton), - "clicked", - G_CALLBACK (clear_edge_style_button_cb), - self); - gtk_box_pack_start (GTK_BOX (lvl2_box), clearEdgeStyleButton, - FALSE, FALSE, 0); - - gtk_widget_show_all (layout); - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - g_object_unref (nodeStyleCombo); - g_object_unref (applyNodeStyleButton); - g_object_unref (clearNodeStyleButton); - g_object_unref (edgeStyleCombo); - g_object_unref (applyEdgeStyleButton); - g_object_unref (clearEdgeStyleButton); - - g_object_unref (layout); - - [nodeStylesModel release]; - [edgeStylesModel release]; - - [document release]; - - [super dealloc]; -} - -- (TikzDocument*) document { - return document; -} - -- (void) setDocument:(TikzDocument*)doc { - if (document != nil) { - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:nil - object:[document pickSupport]]; - } - - [doc retain]; - [document release]; - document = doc; - - if (doc != nil) { - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeSelectionChanged:) - name:@"NodeSelectionChanged" object:[doc pickSupport]]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeSelectionChanged:) - name:@"EdgeSelectionChanged" object:[doc pickSupport]]; - } - - [self _updateNodeStyleButtons]; - [self _updateEdgeStyleButtons]; -} - -- (BOOL) visible { - return gtk_widget_get_visible (layout); -} - -- (void) setVisible:(BOOL)visible { - gtk_widget_set_visible (layout, visible); -} - -- (GtkWidget*) gtkWidget { - return layout; -} - -- (void) loadConfiguration:(Configuration*)config { - NSString *nodeStyleName = [config stringEntry:@"SelectedNodeStyle" - inGroup:@"SelectionPane" - withDefault:nil]; - NodeStyle *nodeStyle = [[nodeStylesModel styleManager] nodeStyleForName:nodeStyleName]; - if (nodeStyle == nil) { - gtk_combo_box_set_active (GTK_COMBO_BOX (nodeStyleCombo), -1); - } else { - GtkTreeIter *iter = [nodeStylesModel iterFromStyle:nodeStyle]; - if (iter) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (nodeStyleCombo), iter); - gtk_tree_iter_free (iter); - } - } - - NSString *edgeStyleName = [config stringEntry:@"SelectedEdgeStyle" - inGroup:@"SelectionPane" - withDefault:nil]; - EdgeStyle *edgeStyle = [[edgeStylesModel styleManager] edgeStyleForName:edgeStyleName]; - if (edgeStyle == nil) { - gtk_combo_box_set_active (GTK_COMBO_BOX (edgeStyleCombo), -1); - } else { - GtkTreeIter *iter = [edgeStylesModel iterFromStyle:edgeStyle]; - if (iter) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (edgeStyleCombo), iter); - gtk_tree_iter_free (iter); - } - } -} - -- (void) saveConfiguration:(Configuration*)config { - [config setStringEntry:@"SelectedNodeStyle" - inGroup:@"SelectionPane" - value:[[self _selectedNodeStyle] name]]; - [config setStringEntry:@"SelectedEdgeStyle" - inGroup:@"SelectionPane" - value:[[self _selectedEdgeStyle] name]]; -} - -@end - -// }}} -// {{{ Notifications - -@implementation SelectionPane (Notifications) -- (void) nodeSelectionChanged:(NSNotification*)n { - [self _updateNodeStyleButtons]; -} - -- (void) edgeSelectionChanged:(NSNotification*)n { - [self _updateEdgeStyleButtons]; -} -@end - -// }}} -// {{{ Private - -@implementation SelectionPane (Private) -- (void) _updateNodeStyleButtons { - gboolean hasNodeSelection = [[[document pickSupport] selectedNodes] count] > 0; - - gtk_widget_set_sensitive (applyNodeStyleButton, - hasNodeSelection && [self _selectedNodeStyle] != nil); - gtk_widget_set_sensitive (clearNodeStyleButton, hasNodeSelection); -} - -- (void) _updateEdgeStyleButtons { - gboolean hasEdgeSelection = [[[document pickSupport] selectedEdges] count] > 0; - - gtk_widget_set_sensitive (applyEdgeStyleButton, - hasEdgeSelection && [self _selectedEdgeStyle] != nil); - gtk_widget_set_sensitive (clearEdgeStyleButton, hasEdgeSelection); -} - -- (NodeStyle*) _selectedNodeStyle { - GtkTreeIter iter; - if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (nodeStyleCombo), &iter)) { - return [nodeStylesModel styleFromIter:&iter]; - } else { - return nil; - } -} - -- (EdgeStyle*) _selectedEdgeStyle { - GtkTreeIter iter; - if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (edgeStyleCombo), &iter)) { - return [edgeStylesModel styleFromIter:&iter]; - } else { - return nil; - } -} - -- (void) _applyNodeStyle { - [document startModifyNodes:[[document pickSupport] selectedNodes]]; - - NodeStyle *style = [self _selectedNodeStyle]; - for (Node *node in [[document pickSupport] selectedNodes]) { - [node setStyle:style]; - } - - [document endModifyNodes]; -} - -- (void) _clearNodeStyle { - [document startModifyNodes:[[document pickSupport] selectedNodes]]; - - for (Node *node in [[document pickSupport] selectedNodes]) { - [node setStyle:nil]; - } - - [document endModifyNodes]; -} - -- (void) _applyEdgeStyle { - [document startModifyEdges:[[document pickSupport] selectedEdges]]; - - EdgeStyle *style = [self _selectedEdgeStyle]; - for (Edge *edge in [[document pickSupport] selectedEdges]) { - [edge setStyle:style]; - } - - [document endModifyEdges]; -} - -- (void) _clearEdgeStyle { - [document startModifyEdges:[[document pickSupport] selectedEdges]]; - - for (Edge *edge in [[document pickSupport] selectedEdges]) { - [edge setStyle:nil]; - } - - [document endModifyEdges]; -} -@end - -// }}} -// {{{ GTK+ callbacks - -static void node_style_changed_cb (GtkComboBox *widget, SelectionPane *pane) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pane _updateNodeStyleButtons]; - [pool drain]; -} - -static void apply_node_style_button_cb (GtkButton *widget, SelectionPane *pane) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pane _applyNodeStyle]; - [pool drain]; -} - -static void clear_node_style_button_cb (GtkButton *widget, SelectionPane *pane) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pane _clearNodeStyle]; - [pool drain]; -} - -static void edge_style_changed_cb (GtkComboBox *widget, SelectionPane *pane) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pane _updateEdgeStyleButtons]; - [pool drain]; -} - -static void apply_edge_style_button_cb (GtkButton *widget, SelectionPane *pane) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pane _applyEdgeStyle]; - [pool drain]; -} - -static void clear_edge_style_button_cb (GtkButton *widget, SelectionPane *pane) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [pane _clearEdgeStyle]; - [pool drain]; -} - -// }}} -// -static void setup_style_cell_layout (GtkCellLayout *cell_layout, gint pixbuf_col, gint name_col) { - gtk_cell_layout_clear (cell_layout); - GtkCellRenderer *pixbuf_renderer = gtk_cell_renderer_pixbuf_new (); - gtk_cell_layout_pack_start (cell_layout, pixbuf_renderer, FALSE); - gtk_cell_layout_set_attributes ( - cell_layout, - pixbuf_renderer, - "pixbuf", pixbuf_col, - NULL); - GtkCellRenderer *text_renderer = gtk_cell_renderer_text_new (); - gtk_cell_layout_pack_start (cell_layout, text_renderer, FALSE); - gtk_cell_layout_set_attributes ( - cell_layout, - text_renderer, - "text", name_col, - NULL); -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/SettingsDialog.h b/tikzit-old/src/gtk/SettingsDialog.h deleted file mode 100644 index 0f687b3..0000000 --- a/tikzit-old/src/gtk/SettingsDialog.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Configuration; -@class EdgeStylesPalette; -@class NodeStylesPalette; -@class StyleManager; - -@interface SettingsDialog: NSObject { - Configuration *configuration; - StyleManager *styleManager; - StyleManager *tempStyleManager; - NodeStylesPalette *nodePalette; - EdgeStylesPalette *edgePalette; - - GtkWindow *parentWindow; - GtkWindow *window; - - // we don't keep any refs, as we control - // the top window - GtkEntry *pdflatexPathEntry; -} - -@property (retain) Configuration *configuration; -@property (retain) StyleManager *styleManager; -@property (assign) GtkWindow *parentWindow; -@property (assign,getter=isVisible) BOOL visible; - -- (id) initWithConfiguration:(Configuration*)c andStyleManager:(StyleManager*)m; - -- (void) present; -- (void) show; -- (void) hide; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/SettingsDialog.m b/tikzit-old/src/gtk/SettingsDialog.m deleted file mode 100644 index bdb5db6..0000000 --- a/tikzit-old/src/gtk/SettingsDialog.m +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "SettingsDialog.h" - -#import "Application.h" -#import "Configuration.h" -#import "EdgeStylesPalette.h" -#import "NodeStylesPalette.h" -#import "StyleManager.h" - -// {{{ Internal interfaces -// {{{ Signals -static gboolean window_delete_event_cb (GtkWidget *widget, - GdkEvent *event, - SettingsDialog *dialog); -static void ok_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog); -static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog); -// }}} - -@interface SettingsDialog (Private) -- (void) loadUi; -- (void) save; -- (void) revert; -@end - -// }}} -// {{{ API - -@implementation SettingsDialog - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithConfiguration:(Configuration*)c andStyleManager:(StyleManager*)m { - self = [super init]; - - if (self) { - configuration = [c retain]; - styleManager = [m retain]; - tempStyleManager = [m copy]; - } - - return self; -} - -- (void) dealloc { - if (window) { - gtk_widget_destroy (GTK_WIDGET (window)); - } - if (parentWindow) { - g_object_unref (parentWindow); - } - - [configuration release]; - [tempStyleManager release]; - [styleManager release]; - [nodePalette release]; - [edgePalette release]; - - [super dealloc]; -} - -- (Configuration*) configuration { - return configuration; -} - -- (void) setConfiguration:(Configuration*)c { - [c retain]; - [configuration release]; - configuration = c; - [self revert]; -} - -- (StyleManager*) styleManager { - return styleManager; -} - -- (void) setStyleManager:(StyleManager*)m { - [m retain]; - [styleManager release]; - styleManager = m; -} - -- (GtkWindow*) parentWindow { - return parentWindow; -} - -- (void) setParentWindow:(GtkWindow*)parent { - GtkWindow *oldParent = parentWindow; - - if (parent) - g_object_ref (parent); - parentWindow = parent; - if (oldParent) - g_object_unref (oldParent); - - if (window) { - gtk_window_set_transient_for (window, parentWindow); - } -} - -- (void) present { - [self loadUi]; - [self revert]; - gtk_window_present (GTK_WINDOW (window)); -} - -- (void) show { - [self loadUi]; - [self revert]; - gtk_widget_show (GTK_WIDGET (window)); -} - -- (void) hide { - if (!window) { - return; - } - gtk_widget_hide (GTK_WIDGET (window)); -} - -- (BOOL) isVisible { - if (!window) { - return NO; - } - gboolean visible; - g_object_get (G_OBJECT (window), "visible", &visible, NULL); - return visible ? YES : NO; -} - -- (void) setVisible:(BOOL)visible { - if (visible) { - [self show]; - } else { - [self hide]; - } -} - -@end - -// }}} -// {{{ Private - -@implementation SettingsDialog (Private) -- (void) loadUi { - if (window) { - return; - } - - nodePalette = [[NodeStylesPalette alloc] initWithManager:tempStyleManager]; - edgePalette = [[EdgeStylesPalette alloc] initWithManager:tempStyleManager]; - - window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - gtk_window_set_default_size (window, 570, -1); - gtk_window_set_title (window, "TikZiT Configuration"); - gtk_window_set_modal (window, TRUE); - gtk_window_set_position (window, GTK_WIN_POS_CENTER_ON_PARENT); - gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DIALOG); - if (parentWindow) { - gtk_window_set_transient_for (window, parentWindow); - } - g_signal_connect (window, - "delete-event", - G_CALLBACK (window_delete_event_cb), - self); - - GtkWidget *mainBox = gtk_vbox_new (FALSE, 18); - gtk_container_set_border_width (GTK_CONTAINER (mainBox), 12); - gtk_container_add (GTK_CONTAINER (window), mainBox); - gtk_widget_show (mainBox); - -#ifdef HAVE_POPPLER - /* - * Path for pdflatex - */ - - GtkWidget *pdflatexFrame = gtk_frame_new ("Previews"); - gtk_box_pack_start (GTK_BOX (mainBox), pdflatexFrame, TRUE, TRUE, 0); - - GtkBox *pdflatexBox = GTK_BOX (gtk_hbox_new (FALSE, 6)); - gtk_container_add (GTK_CONTAINER (pdflatexFrame), GTK_WIDGET (pdflatexBox)); - gtk_container_set_border_width (GTK_CONTAINER (pdflatexBox), 6); - - GtkWidget *pdflatexLabel = gtk_label_new ("Path to pdflatex:"); - gtk_misc_set_alignment (GTK_MISC (pdflatexLabel), 0, 0.5); - gtk_box_pack_start (pdflatexBox, - pdflatexLabel, - FALSE, TRUE, 0); - - pdflatexPathEntry = GTK_ENTRY (gtk_entry_new ()); - gtk_box_pack_start (pdflatexBox, - GTK_WIDGET (pdflatexPathEntry), - TRUE, TRUE, 0); - - gtk_widget_show_all (pdflatexFrame); -#else - pdflatexPathEntry = NULL; -#endif - - /* - * Node styles - */ - GtkWidget *nodeStylesFrame = gtk_frame_new ("Node Styles"); - gtk_widget_show (nodeStylesFrame); - gtk_box_pack_start (GTK_BOX (mainBox), nodeStylesFrame, TRUE, TRUE, 0); - gtk_container_add (GTK_CONTAINER (nodeStylesFrame), - GTK_WIDGET ([nodePalette widget])); - gtk_widget_show ([nodePalette widget]); - - - /* - * Edge styles - */ - GtkWidget *edgeStylesFrame = gtk_frame_new ("Edge Styles"); - gtk_widget_show (edgeStylesFrame); - gtk_box_pack_start (GTK_BOX (mainBox), edgeStylesFrame, TRUE, TRUE, 0); - gtk_container_add (GTK_CONTAINER (edgeStylesFrame), - GTK_WIDGET ([edgePalette widget])); - gtk_widget_show ([edgePalette widget]); - - - /* - * Bottom buttons - */ - - GtkContainer *buttonBox = GTK_CONTAINER (gtk_hbutton_box_new ()); - gtk_box_set_spacing (GTK_BOX (buttonBox), 6); - gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonBox), GTK_BUTTONBOX_END); - gtk_box_pack_start (GTK_BOX (mainBox), - GTK_WIDGET (buttonBox), - FALSE, TRUE, 0); - - GtkWidget *okButton = gtk_button_new_from_stock (GTK_STOCK_OK); - gtk_container_add (buttonBox, okButton); - g_signal_connect (okButton, - "clicked", - G_CALLBACK (ok_button_clicked_cb), - self); - - GtkWidget *cancelButton = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - gtk_container_add (buttonBox, cancelButton); - g_signal_connect (cancelButton, - "clicked", - G_CALLBACK (cancel_button_clicked_cb), - self); - - gtk_widget_show_all (GTK_WIDGET (buttonBox)); - - [self revert]; -} - -- (void) save { - if (!window) - return; - -#ifdef HAVE_POPPLER - const gchar *path = gtk_entry_get_text (pdflatexPathEntry); - if (path && *path) { - [configuration setStringEntry:@"pdflatex" - inGroup:@"Previews" - value:[NSString stringWithUTF8String:path]]; - } -#endif - - [styleManager updateFromManager:tempStyleManager]; - - [app saveConfiguration]; -} - -- (void) revert { - if (!window) - return; - -#ifdef HAVE_POPPLER - NSString *path = [configuration stringEntry:@"pdflatex" - inGroup:@"Previews" - withDefault:@"pdflatex"]; - gtk_entry_set_text (pdflatexPathEntry, [path UTF8String]); -#endif - - [tempStyleManager updateFromManager:styleManager]; -} -@end - -// }}} -// {{{ GTK+ callbacks - -static gboolean window_delete_event_cb (GtkWidget *widget, - GdkEvent *event, - SettingsDialog *dialog) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [dialog hide]; - [pool drain]; - return TRUE; // we dealt with this event -} - -static void ok_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [dialog save]; - [dialog hide]; - [pool drain]; -} - -static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [dialog hide]; - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=4:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/Shape+Render.h b/tikzit-old/src/gtk/Shape+Render.h deleted file mode 100644 index a744c77..0000000 --- a/tikzit-old/src/gtk/Shape+Render.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "Shape.h" -#import "RenderContext.h" -#import "Surface.h" - -@interface Shape (Render) - -- (void) drawPathWithTransform:(Transformer*)transform andContext:(id)context; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Shape+Render.m b/tikzit-old/src/gtk/Shape+Render.m deleted file mode 100644 index 924bb24..0000000 --- a/tikzit-old/src/gtk/Shape+Render.m +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Shape+Render.h" - -#import "Edge.h" - -// we use cairo for finding the bounding box etc. -#import - -@implementation Shape (Render) - -- (void) drawPathWithTransform:(Transformer*)transform andContext:(id)context { - [context startPath]; - - for (NSArray *arr in [self paths]) { - BOOL fst = YES; - NSPoint p, cp1, cp2; - - for (Edge *e in arr) { - if (fst) { - fst = NO; - p = [transform toScreen:[[e source] point]]; - [context moveTo:p]; - } - - p = [transform toScreen:[[e target] point]]; - if ([e isStraight]) { - [context lineTo:p]; - } else { - cp1 = [transform toScreen:[e cp1]]; - cp2 = [transform toScreen:[e cp2]]; - [context curveTo:p withCp1:cp1 andCp2:cp2]; - } - } - - [context closeSubPath]; - } -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/StyleManager+Storage.h b/tikzit-old/src/gtk/StyleManager+Storage.h deleted file mode 100644 index 1727786..0000000 --- a/tikzit-old/src/gtk/StyleManager+Storage.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "StyleManager.h" - -@interface StyleManager (Storage) -- (void) loadStylesUsingConfigurationName:(NSString*)name; -- (void) saveStylesUsingConfigurationName:(NSString*)name; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/StyleManager+Storage.m b/tikzit-old/src/gtk/StyleManager+Storage.m deleted file mode 100644 index f4c8232..0000000 --- a/tikzit-old/src/gtk/StyleManager+Storage.m +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "StyleManager+Storage.h" -#import "Configuration.h" -#import "NodeStyle+Storage.h" -#import "EdgeStyle+Storage.h" - -static NSString *nodeStyleGroupPrefix = @"Style "; -static NSString *edgeStyleGroupPrefix = @"EdgeStyle "; - -@implementation StyleManager (Storage) - -- (void) loadStylesUsingConfigurationName:(NSString*)name { - if (![Configuration configurationExistsWithName:name]) { - NSLog(@"No styles config found"); - return; - } - NSError *error = nil; - Configuration *stylesConfig = [Configuration configurationWithName:name loadError:&error]; - if (error != nil) { - logError (error, @"Could not load styles configuration"); - // stick with the default config - return; - } - NSArray *groups = [stylesConfig groups]; - NSMutableArray *ns = [NSMutableArray arrayWithCapacity:[groups count]]; - NSMutableArray *es = [NSMutableArray arrayWithCapacity:[groups count]]; - - for (NSString *groupName in groups) { - if ([groupName hasPrefix:nodeStyleGroupPrefix]) { - NodeStyle *style = [[NodeStyle alloc] initFromConfigurationGroup:groupName config:stylesConfig]; - [ns addObject:style]; - } else if ([groupName hasPrefix:edgeStyleGroupPrefix]) { - EdgeStyle *style = [[EdgeStyle alloc] initFromConfigurationGroup:groupName config:stylesConfig]; - [es addObject:style]; - } - } - - [self _setNodeStyles:ns]; - [self _setEdgeStyles:es]; -} - -- (void) saveStylesUsingConfigurationName:(NSString*)name { - NSError *error = nil; - Configuration *stylesConfig = [Configuration emptyConfigurationWithName:name]; - NSArray *ns = [self nodeStyles]; - NSArray *es = [self edgeStyles]; - NSUInteger length = [ns count]; - for (int i = 0; i < length; ++i) { - NodeStyle *style = [ns objectAtIndex:i]; - NSString *groupName = [NSString stringWithFormat:@"%@%d", nodeStyleGroupPrefix, i]; - [style storeToConfigurationGroup:groupName config:stylesConfig]; - } - length = [es count]; - for (int i = 0; i < length; ++i) { - EdgeStyle *style = [es objectAtIndex:i]; - NSString *groupName = [NSString stringWithFormat:@"%@%d", edgeStyleGroupPrefix, i]; - [style storeToConfigurationGroup:groupName config:stylesConfig]; - } - if (![stylesConfig writeToStoreWithError:&error]) { - logError (error, @"Could not write styles configuration"); - } -} - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Surface.h b/tikzit-old/src/gtk/Surface.h deleted file mode 100644 index db4288e..0000000 --- a/tikzit-old/src/gtk/Surface.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "RenderContext.h" -#import "Transformer.h" - -typedef enum { - NormalCursor, - ResizeRightCursor, - ResizeBottomRightCursor, - ResizeBottomCursor, - ResizeBottomLeftCursor, - ResizeLeftCursor, - ResizeTopLeftCursor, - ResizeTopCursor, - ResizeTopRightCursor -} Cursor; - -@protocol Surface; - -@protocol RenderDelegate -- (void) renderWithContext:(id)context onSurface:(id)surface; -@end - -/** - * Represents a surface that can be rendered to - * - * This protocol should be implemented by drawing surfaces. It - * provides geometry information and methods to invalidate - * regions of the surface, triggering a redraw. - * - * The surface should send a "SurfaceSizeChanged" notification - * when the width or height changes. - */ -@protocol Surface - -/** - * The width of the surface, in surface units - * - * The surface should send a "SurfaceSizeChanged" notification - * when this property changes. - */ -@property (readonly) int width; -/** - * The height of the surface, in surface units - * - * The surface should send a "SurfaceSizeChanged" notification - * when this property changes. - */ -@property (readonly) int height; -/** - * The transformer that converts between graph units and surface units - */ -@property (readonly) Transformer *transformer; -/** - * The render delegate. - * - * This will be used to redraw (parts of) the surface when necessary. - */ -@property (assign) id renderDelegate; - -/** - * Create a render context for the surface. - */ -- (id) createRenderContext; -/** - * Invalidate a portion of the surface. - * - * This will request that part of the surface be redrawn. - */ -- (void) invalidateRect:(NSRect)rect; -/** - * Invalidate the whole surface. - * - * This will request that the whole surface be redrawn. - */ -- (void) invalidate; - -- (void) zoomIn; -- (void) zoomOut; -- (void) zoomReset; -- (void) zoomInAboutPoint:(NSPoint)p; -- (void) zoomOutAboutPoint:(NSPoint)p; -- (void) zoomResetAboutPoint:(NSPoint)p; - -- (void) setCursor:(Cursor)c; - -- (BOOL) hasFocus; -- (void) renderFocus; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/TZFoundation.h b/tikzit-old/src/gtk/TZFoundation.h deleted file mode 100644 index 2ff20ca..0000000 --- a/tikzit-old/src/gtk/TZFoundation.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import - -#import "NSError+Glib.h" -#import "NSError+Tikzit.h" -#import "NSFileManager+Glib.h" -#import "NSFileManager+Utils.h" -#import "NSString+Glib.h" -#import "NSString+LatexConstants.h" -#import "NSString+Tikz.h" -#import "NSString+Util.h" - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/TikzDocument.h b/tikzit-old/src/gtk/TikzDocument.h deleted file mode 100644 index 5d15d13..0000000 --- a/tikzit-old/src/gtk/TikzDocument.h +++ /dev/null @@ -1,149 +0,0 @@ -// -// TikzDocument.h -// TikZiT -// -// Copyright 2010 Chris Heunen -// Copyright 2010 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TZFoundation.h" -#import -#import "PickSupport.h" -#import "StyleManager.h" - -@interface TikzDocument : NSObject { - StyleManager *styleManager; - Graph *graph; - PickSupport *pickSupport; - NSUndoManager *undoManager; - NSString *tikz; - NSString *path; - NSSet *nodesetBeingModified; - NSMapTable *nodesetBeingModifiedOldCopy; - NSSet *edgesetBeingModified; - NSMapTable *edgesetBeingModifiedOldCopy; - NSPoint currentNodeShift; - Node *nodeBeingModified; - Node *nodeBeingModifiedOldCopy; - Edge *edgeBeingModified; - Edge *edgeBeingModifiedOldCopy; - NSRect oldGraphBounds; - GraphElementData *oldGraphData; - BOOL hasChanges; -} - -+ (TikzDocument*) documentWithStyleManager:(StyleManager*)manager; -+ (TikzDocument*) documentWithGraph:(Graph*)g styleManager:(StyleManager*)manager; -+ (TikzDocument*) documentWithTikz:(NSString*)t styleManager:(StyleManager*)manager error:(NSError**)error; -+ (TikzDocument*) documentFromFile:(NSString*)path styleManager:(StyleManager*)manager error:(NSError**)error; - -- (id) initWithStyleManager:(StyleManager*)manager; -- (id) initWithGraph:(Graph*)g styleManager:(StyleManager*)manager; -- (id) initWithTikz:(NSString*)t styleManager:(StyleManager*)manager error:(NSError**)error; -- (id) initFromFile:(NSString*)path styleManager:(StyleManager*)manager error:(NSError**)error; - -@property (readonly) Graph *graph; -@property (readonly) PickSupport *pickSupport; -@property (readonly) NSString *path; -@property (readonly) NSString *name; -@property (readonly) NSString *suggestedFileName; -@property (readonly) BOOL hasUnsavedChanges; -@property (retain) StyleManager *styleManager; -@property (readonly) NSString *tikz; -@property (readonly) BOOL canUndo; -@property (readonly) BOOL canRedo; -@property (readonly) NSString *undoName; -@property (readonly) NSString *redoName; - -- (BOOL) updateTikz:(NSString*)t error:(NSError**)error; - -- (Graph*) selectionCut; -- (Graph*) selectionCopy; -- (void) paste:(Graph*)graph; -- (void) pasteFromTikz:(NSString*)tikz; - -// some convenience methods: -- (BOOL) isNodeSelected:(Node*)node; -- (BOOL) isEdgeSelected:(Edge*)edge; -- (NSEnumerator*) nodeEnumerator; -- (NSEnumerator*) edgeEnumerator; - -- (void) undo; -- (void) redo; - -- (void) startUndoGroup; -- (void) nameAndEndUndoGroup:(NSString*)nm; -- (void) endUndoGroup; - -- (void) startModifyNode:(Node*)node; -- (void) modifyNodeCheckPoint; -- (void) endModifyNode; -- (void) cancelModifyNode; - -- (void) startModifyNodes:(NSSet*)nodes; -- (void) modifyNodesCheckPoint; -- (void) endModifyNodes; -- (void) cancelModifyNodes; - -- (void) startShiftNodes:(NSSet*)nodes; -- (void) shiftNodesUpdate:(NSPoint)shiftChange; -- (void) endShiftNodes; -- (void) cancelShiftNodes; - -- (void) startModifyEdge:(Edge*)edge; -- (void) modifyEdgeCheckPoint; -- (void) endModifyEdge; -- (void) cancelModifyEdge; - -- (void) startModifyEdges:(NSSet*)edges; -- (void) modifyEdgesCheckPoint; -- (void) endModifyEdges; -- (void) cancelModifyEdges; - -- (void) startChangeBoundingBox; -- (void) changeBoundingBoxCheckPoint; -- (void) endChangeBoundingBox; -- (void) cancelChangeBoundingBox; - -- (void) startChangeGraphProperties; -- (void) changeGraphPropertiesCheckPoint; -- (void) endChangeGraphProperties; -- (void) cancelChangeGraphProperties; - -- (void) removeSelected; -- (void) addNode:(Node*)node; -- (void) removeNode:(Node*)node; -- (void) addEdge:(Edge*)edge; -- (void) removeEdge:(Edge*)edge; -- (void) shiftSelectedNodesByPoint:(NSPoint)offset; -- (void) insertGraph:(Graph*)g; -- (void) flipSelectedNodesHorizontally; -- (void) flipSelectedNodesVertically; -- (void) reverseSelectedEdges; -- (void) bringSelectionForward; -- (void) bringSelectionToFront; -- (void) sendSelectionBackward; -- (void) sendSelectionToBack; - -- (BOOL) saveCopyToPath: (NSString*)path error: (NSError**)error; -- (BOOL) saveToPath: (NSString*)path error: (NSError**)error; -- (BOOL) save: (NSError**)error; - -@end - -// vim:ft=objc:sts=4:sw=4:et diff --git a/tikzit-old/src/gtk/TikzDocument.m b/tikzit-old/src/gtk/TikzDocument.m deleted file mode 100644 index bff5a2e..0000000 --- a/tikzit-old/src/gtk/TikzDocument.m +++ /dev/null @@ -1,911 +0,0 @@ -// -// TikzDocument.h -// TikZiT -// -// Copyright 2010 Chris Heunen -// Copyright 2010 Alex Merry -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TikzDocument.h" - -@interface TikzDocument (Private) -- (void) styleRenamed:(NSNotification*)n; - -- (void) setPath:(NSString*)path; -- (void) setGraph:(Graph*)g; - -- (void) registerUndoForChange:(GraphChange*)change; -- (void) registerUndoGroupForChange:(GraphChange*)change withName:(NSString*)name; -- (void) undoGraphChange:(GraphChange*)change; -- (void) completedGraphChange:(GraphChange*)change withName:(NSString*)name; -- (void) attachStylesToGraph:(Graph*)g; - -- (void) regenerateTikz; -@end - -@implementation TikzDocument - -+ (TikzDocument*) documentWithStyleManager:(StyleManager*)manager -{ - return [[[TikzDocument alloc] initWithStyleManager:manager] autorelease]; -} - -+ (TikzDocument*) documentWithGraph:(Graph*)g - styleManager:(StyleManager*)manager -{ - return [[[TikzDocument alloc] initWithGraph:g - styleManager:manager] autorelease]; -} - -+ (TikzDocument*) documentWithTikz:(NSString*)t - styleManager:(StyleManager*)manager - error:(NSError**)error -{ - return [[[TikzDocument alloc] initWithTikz:t - styleManager:manager - error:error] autorelease]; -} - -+ (TikzDocument*) documentFromFile:(NSString*)pth - styleManager:(StyleManager*)manager - error:(NSError**)error -{ - return [[[TikzDocument alloc] initFromFile:pth - styleManager:manager - error:error] autorelease]; -} - - -- (id) initWithStyleManager:(StyleManager*)manager { - self = [self initWithGraph:[Graph graph] styleManager:manager]; - return self; -} - -- (id) initWithGraph:(Graph*)g styleManager:(StyleManager*)manager { - self = [super init]; - - if (self) { - graph = nil; - styleManager = [manager retain]; - pickSupport = [[PickSupport alloc] init]; - undoManager = [[NSUndoManager alloc] init]; - [undoManager setGroupsByEvent:NO]; - tikz = nil; - path = nil; - nodesetBeingModified = nil; - nodesetBeingModifiedOldCopy = nil; - nodeBeingModified = nil; - nodeBeingModifiedOldCopy = nil; - edgeBeingModified = nil; - edgeBeingModifiedOldCopy = nil; - - [undoManager disableUndoRegistration]; - [self setGraph:g]; - [undoManager enableUndoRegistration]; - - hasChanges = NO; - - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(styleRenamed:) - name:@"NodeStyleRenamed" - object:styleManager]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(styleRenamed:) - name:@"EdgeStyleRenamed" - object:styleManager]; - } - - return self; -} - -- (id) initWithTikz:(NSString*)t - styleManager:(StyleManager*)manager - error:(NSError**)error -{ - self = [self initWithStyleManager:manager]; - - if (self) { - [undoManager disableUndoRegistration]; - BOOL success = [self updateTikz:t error:error]; - if (!success) { - [self release]; - return nil; - } - [undoManager enableUndoRegistration]; - hasChanges = NO; - } - - return self; -} - -- (id) initFromFile:(NSString*)pth - styleManager:(StyleManager*)manager - error:(NSError**)error -{ - NSString *t = [NSString stringWithContentsOfFile:pth error:error]; - if (t == nil) { - [self release]; - return nil; - } - - self = [self initWithTikz:t styleManager:manager error:error]; - - if (self) { - [self setPath:pth]; - } - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [styleManager release]; - [graph release]; - [pickSupport release]; - [undoManager release]; - [tikz release]; - [path release]; - [nodesetBeingModified release]; - [nodesetBeingModifiedOldCopy release]; - [nodeBeingModified release]; - [nodeBeingModifiedOldCopy release]; - [edgeBeingModified release]; - [edgeBeingModifiedOldCopy release]; - [oldGraphData release]; - [super dealloc]; -} - -@synthesize graph, pickSupport, path; - -- (NSString*) name { - if (path) { - return [[NSFileManager defaultManager] displayNameAtPath: path]; - } else { - return @"Untitled"; - } -} - -- (NSString*) suggestedFileName { - if (path) { - return [path lastPathComponent]; - } else { - return @"untitled.tikz"; - } -} - -- (BOOL) hasUnsavedChanges { - return hasChanges; -} - -- (StyleManager*) styleManager { - return styleManager; -} - -- (void) setStyleManager:(StyleManager*)manager { - StyleManager *oldManager = styleManager; - [[NSNotificationCenter defaultCenter] - removeObserver:self - name:nil - object:oldManager]; - - styleManager = [manager retain]; - - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(styleRenamed:) - name:@"NodeStyleRenamed" - object:styleManager]; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(styleRenamed:) - name:@"EdgeStyleRenamed" - object:styleManager]; - - [self attachStylesToGraph:graph]; - [oldManager release]; -} - -- (void) postGraphReplaced { - [[NSNotificationCenter defaultCenter] postNotificationName:@"GraphReplaced" object:self]; -} - -- (void) postGraphChange:(GraphChange*)change { - NSDictionary *info = [NSDictionary dictionaryWithObject:change forKey:@"change"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"GraphChanged" object:self userInfo:info]; -} - -- (void) postIncompleteGraphChange:(GraphChange*)change { - NSDictionary *info = [NSDictionary dictionaryWithObject:change forKey:@"change"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"GraphBeingChanged" object:self userInfo:info]; -} - -- (void) postCancelledGraphChange:(GraphChange*)change { - NSDictionary *info = [NSDictionary dictionaryWithObject:change forKey:@"change"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"GraphChangeCancelled" object:self userInfo:info]; -} - -- (void) postTikzChanged { - [[NSNotificationCenter defaultCenter] postNotificationName:@"TikzChanged" object:self]; -} - -- (void) postUndoStackChanged { - [[NSNotificationCenter defaultCenter] postNotificationName:@"UndoStackChanged" object:self]; -} - -- (NSString*) tikz { - return tikz; -} - -- (BOOL) updateTikz:(NSString*)t error:(NSError**)error { - if (t == nil) { - t = [NSString string]; - } - if (t == tikz || [t isEqual:tikz]) { - return YES; - } - - Graph *g = [Graph graphFromTikz:t error:error]; - if (g) { - // updateTikz actually generates a graph from the tikz, - // and generates the final tikz from that - [self startUndoGroup]; - [self setGraph:g]; - [self nameAndEndUndoGroup:@"Update tikz"]; - return YES; - } - - return NO; -} - -- (Graph*) selectionCut { - Graph *selection = [self selectionCopy]; - [self startUndoGroup]; - [self removeSelected]; - [self nameAndEndUndoGroup:@"Cut"]; - return selection; -} - -- (Graph*) selectionCopy { - return [[graph copyOfSubgraphWithNodes:[pickSupport selectedNodes]] autorelease]; -} - -- (void) paste:(Graph*)g { - if (g == nil || [[g nodes] count] == 0) { - // nothing to paste - return; - } - - // place to the right of the existing graph - NSRect bounds = [graph bounds]; - NSRect gBounds = [g bounds]; - float dx = NSMaxX (bounds) - gBounds.origin.x + 0.5f; - [g shiftNodes:[g nodes] byPoint:NSMakePoint (dx, 0)]; - - GraphChange *change = [graph insertGraph:g]; - [self completedGraphChange:change withName:@"Paste"]; - - // select everything from the clipboard - [pickSupport deselectAllEdges]; - [pickSupport selectAllNodes:[NSSet setWithArray:[g nodes]] replacingSelection:YES]; -} - -- (void) pasteFromTikz:(NSString*)t { - Graph *clipboard = [Graph graphFromTikz:t]; - if (clipboard) { - [self attachStylesToGraph:clipboard]; - [self paste:clipboard]; - } -} - -- (BOOL) isNodeSelected:(Node*)node { - return [pickSupport isNodeSelected:node]; -} - -- (BOOL) isEdgeSelected:(Edge*)edge { - return [pickSupport isEdgeSelected:edge]; -} - -- (NSEnumerator*) nodeEnumerator { - return [[graph nodes] objectEnumerator]; -} - -- (NSEnumerator*) edgeEnumerator { - return [[graph edges] objectEnumerator]; -} - -- (BOOL) canUndo { - return [undoManager canUndo]; -} - -- (void) undo { - [undoManager undo]; - [self postUndoStackChanged]; -} - -- (BOOL) canRedo { - return [undoManager canRedo]; -} - -- (void) redo { - [undoManager redo]; - [self postUndoStackChanged]; -} - -- (NSString*) undoName { - return [undoManager undoActionName]; -} - -- (NSString*) redoName { - return [undoManager redoActionName]; -} - -- (void) startUndoGroup { - [undoManager beginUndoGrouping]; -} - -- (void) nameAndEndUndoGroup:(NSString*)nm { - [undoManager setActionName:nm]; - [undoManager endUndoGrouping]; - [self postUndoStackChanged]; -} - -- (void) endUndoGroup { - [undoManager endUndoGrouping]; - [self postUndoStackChanged]; -} - -- (void) startModifyNode:(Node*)node { - if (nodeBeingModified != nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Already modifying a node"]; - } - nodeBeingModified = [node retain]; - nodeBeingModifiedOldCopy = [node copy]; -} - -- (void) modifyNodeCheckPoint { - [self regenerateTikz]; - GraphChange *change = [GraphChange propertyChangeOfNode:nodeBeingModified - fromOld:nodeBeingModifiedOldCopy - toNew:[[nodeBeingModified copy] autorelease]]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishModifySequence:(GraphChange*)change withName:(NSString*)chName cancelled:(BOOL)cancelled { - if (cancelled) { - change = [change invert]; - [graph applyGraphChange:change]; - [self regenerateTikz]; - [self postCancelledGraphChange:change]; - } else { - [self registerUndoGroupForChange:change withName:chName]; - [self regenerateTikz]; - [self postGraphChange:change]; - } -} - -- (void) _finishModifyNodeCancelled:(BOOL)cancelled { - if (nodeBeingModified == nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Not modifying a node"]; - } - - GraphChange *change = [GraphChange propertyChangeOfNode:nodeBeingModified - fromOld:nodeBeingModifiedOldCopy - toNew:[[nodeBeingModified copy] autorelease]]; - [self _finishModifySequence:change withName:@"Modify node" cancelled:cancelled]; - - [nodeBeingModified release]; - nodeBeingModified = nil; - [nodeBeingModifiedOldCopy release]; - nodeBeingModifiedOldCopy = nil; -} - -- (void) endModifyNode { [self _finishModifyNodeCancelled:NO]; } -- (void) cancelModifyNode { [self _finishModifyNodeCancelled:YES]; } - -- (void) startModifyNodes:(NSSet*)nodes { - if (nodesetBeingModified != nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Already modifying a node set"]; - } - - nodesetBeingModified = [nodes copy]; - nodesetBeingModifiedOldCopy = [[Graph nodeTableForNodes:nodes] retain]; -} - -- (void) modifyNodesCheckPoint { - [self regenerateTikz]; - GraphChange *change = [GraphChange propertyChangeOfNodesFromOldCopies:nodesetBeingModifiedOldCopy - toNewCopies:[Graph nodeTableForNodes:nodesetBeingModified]]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishModifyNodes:(BOOL)cancelled { - if (nodesetBeingModified == nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Not modifying a node set"]; - } - - GraphChange *change = [GraphChange propertyChangeOfNodesFromOldCopies:nodesetBeingModifiedOldCopy - toNewCopies:[Graph nodeTableForNodes:nodesetBeingModified]]; - [self _finishModifySequence:change withName:@"Modify nodes" cancelled:cancelled]; - - [nodesetBeingModified release]; - nodesetBeingModified = nil; - [nodesetBeingModifiedOldCopy release]; - nodesetBeingModifiedOldCopy = nil; -} - -- (void) endModifyNodes { [self _finishModifyNodes:NO]; } -- (void) cancelModifyNodes { [self _finishModifyNodes:YES]; } - -- (void) startShiftNodes:(NSSet*)nodes { - if (nodesetBeingModified != nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Already modifying a node set"]; - } - - nodesetBeingModified = [nodes copy]; - currentNodeShift = NSZeroPoint; -} - -- (void) shiftNodesUpdate:(NSPoint)currentShift { - if (nodesetBeingModified == nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Not modifying a node set"]; - } - - currentNodeShift = currentShift; - [self regenerateTikz]; - GraphChange *change = [GraphChange shiftNodes:nodesetBeingModified - byPoint:currentNodeShift]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishShiftNodesCancelled:(BOOL)cancelled { - if (nodesetBeingModified == nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Not modifying a node set"]; - } - - if (!NSEqualPoints (currentNodeShift, NSZeroPoint)) { - GraphChange *change = [GraphChange shiftNodes:nodesetBeingModified - byPoint:currentNodeShift]; - [self _finishModifySequence:change withName:@"Move nodes" cancelled:cancelled]; - } - - [nodesetBeingModified release]; - nodesetBeingModified = nil; -} - -- (void) endShiftNodes { [self _finishShiftNodesCancelled:NO]; } -- (void) cancelShiftNodes { [self _finishShiftNodesCancelled:YES]; } - -- (void) startModifyEdge:(Edge*)edge { - if (edgeBeingModified != nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Already modifying an edge"]; - } - edgeBeingModified = [edge retain]; - edgeBeingModifiedOldCopy = [edge copy]; -} - -- (void) modifyEdgeCheckPoint { - [self regenerateTikz]; - GraphChange *change = [GraphChange propertyChangeOfEdge:edgeBeingModified - fromOld:edgeBeingModifiedOldCopy - toNew:[[edgeBeingModified copy] autorelease]]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishModifyEdgeCancelled:(BOOL)cancelled { - if (edgeBeingModified == nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Not modifying an edge"]; - } - - GraphChange *change = [GraphChange propertyChangeOfEdge:edgeBeingModified - fromOld:edgeBeingModifiedOldCopy - toNew:[[edgeBeingModified copy] autorelease]]; - [self _finishModifySequence:change withName:@"Modify edge" cancelled:cancelled]; - - [edgeBeingModified release]; - edgeBeingModified = nil; - [edgeBeingModifiedOldCopy release]; - edgeBeingModifiedOldCopy = nil; -} - -- (void) endModifyEdge { [self _finishModifyEdgeCancelled:NO]; } -- (void) cancelModifyEdge { [self _finishModifyEdgeCancelled:YES]; } - -- (void) startModifyEdges:(NSSet*)edges { - if (edgesetBeingModified != nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Already modifying an edge set"]; - } - - edgesetBeingModified = [edges copy]; - edgesetBeingModifiedOldCopy = [[Graph edgeTableForEdges:edges] retain]; -} - -- (void) modifyEdgesCheckPoint { - [self regenerateTikz]; - GraphChange *change = [GraphChange propertyChangeOfEdgesFromOldCopies:edgesetBeingModifiedOldCopy - toNewCopies:[Graph edgeTableForEdges:edgesetBeingModified]]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishModifyEdgesCancelled:(BOOL)cancelled { - if (edgesetBeingModified == nil) { - [NSException raise:@"NSInternalInconsistencyException" format:@"Not modifying an edge"]; - } - - GraphChange *change = [GraphChange propertyChangeOfEdgesFromOldCopies:edgesetBeingModifiedOldCopy - toNewCopies:[Graph edgeTableForEdges:edgesetBeingModified]]; - [self _finishModifySequence:change withName:@"Modify edges" cancelled:cancelled]; - - [edgesetBeingModified release]; - edgesetBeingModified = nil; - [edgesetBeingModifiedOldCopy release]; - edgesetBeingModifiedOldCopy = nil; -} - -- (void) endModifyEdges { [self _finishModifyEdgesCancelled:NO]; } -- (void) cancelModifyEdges { [self _finishModifyEdgesCancelled:YES]; } - -- (void) startChangeBoundingBox { - oldGraphBounds = [graph boundingBox]; -} - -- (void) changeBoundingBoxCheckPoint { - [self regenerateTikz]; - GraphChange *change = [GraphChange changeBoundingBoxFrom:oldGraphBounds - to:[graph boundingBox]]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishChangeBoundingBoxCancelled:(BOOL)cancelled { - GraphChange *change = [GraphChange changeBoundingBoxFrom:oldGraphBounds - to:[graph boundingBox]]; - [self _finishModifySequence:change withName:@"Set bounding box" cancelled:cancelled]; -} -- (void) endChangeBoundingBox { [self _finishChangeBoundingBoxCancelled:NO]; } -- (void) cancelChangeBoundingBox { [self _finishChangeBoundingBoxCancelled:YES]; } - -- (void) startChangeGraphProperties { - oldGraphData = [[graph data] copy]; -} - -- (void) changeGraphPropertiesCheckPoint { - [self regenerateTikz]; - GraphChange *change = [GraphChange propertyChangeOfGraphFrom:oldGraphData - to:[graph data]]; - [self postIncompleteGraphChange:change]; -} - -- (void) _finishChangeGraphPropertiesCancelled:(BOOL)cancelled { - GraphChange *change = [GraphChange propertyChangeOfGraphFrom:oldGraphData - to:[graph data]]; - [self _finishModifySequence:change withName:@"Change graph properties" cancelled:cancelled]; - [oldGraphData release]; - oldGraphData = nil; -} -- (void) endChangeGraphProperties { [self _finishChangeGraphPropertiesCancelled:NO]; } -- (void) cancelChangeGraphProperties { [self _finishChangeGraphPropertiesCancelled:YES]; } - -- (void) removeSelected { - NSUInteger selEdges = [[pickSupport selectedEdges] count]; - NSUInteger selNodes = [[pickSupport selectedNodes] count]; - - if (selEdges == 0 && selNodes == 0) { - return; - } - - NSString *actionName = @"Remove selection"; - - [self startUndoGroup]; - if (selEdges > 0) { - GraphChange *change = [graph removeEdges:[pickSupport selectedEdges]]; - [self registerUndoForChange:change]; - [pickSupport deselectAllEdges]; - [self postGraphChange:change]; - } else { - actionName = (selNodes == 1 ? @"Remove node" : @"Remove nodes"); - } - if (selNodes > 0) { - GraphChange *change = [graph removeNodes:[pickSupport selectedNodes]]; - [self registerUndoForChange:change]; - [pickSupport deselectAllNodes]; - [self postGraphChange:change]; - } else { - actionName = (selEdges == 1 ? @"Remove edge" : @"Remove edges"); - } - [self nameAndEndUndoGroup:actionName]; - [self regenerateTikz]; -} - -- (void) addNode:(Node*)node { - GraphChange *change = [graph addNode:node]; - [self completedGraphChange:change withName:@"Add node"]; -} - -- (void) removeNode:(Node*)node { - [pickSupport deselectNode:node]; - GraphChange *change = [graph removeNode:node]; - [self completedGraphChange:change withName:@"Remove node"]; -} - -- (void) addEdge:(Edge*)edge { - GraphChange *change = [graph addEdge:edge]; - [self completedGraphChange:change withName:@"Add edge"]; -} - -- (void) removeEdge:(Edge*)edge { - [pickSupport deselectEdge:edge]; - GraphChange *change = [graph removeEdge:edge]; - [self completedGraphChange:change withName:@"Remove edge"]; -} - -- (void) shiftSelectedNodesByPoint:(NSPoint)offset { - if ([[pickSupport selectedNodes] count] > 0) { - GraphChange *change = [graph shiftNodes:[pickSupport selectedNodes] byPoint:offset]; - [self completedGraphChange:change withName:@"Move nodes"]; - } -} - -- (void) insertGraph:(Graph*)g { - GraphChange *change = [graph insertGraph:g]; - [self completedGraphChange:change withName:@"Insert graph"]; -} - -- (void) flipSelectedNodesHorizontally { - if ([[pickSupport selectedNodes] count] > 0) { - GraphChange *change = [graph flipHorizontalNodes:[pickSupport selectedNodes]]; - [self completedGraphChange:change withName:@"Flip nodes horizontally"]; - } -} - -- (void) flipSelectedNodesVertically { - if ([[pickSupport selectedNodes] count] > 0) { - GraphChange *change = [graph flipVerticalNodes:[pickSupport selectedNodes]]; - [self completedGraphChange:change withName:@"Flip nodes vertically"]; - } -} - -- (void) reverseSelectedEdges { - if ([[pickSupport selectedEdges] count] > 0) { - GraphChange *change = [graph reverseEdges:[pickSupport selectedEdges]]; - [self completedGraphChange:change withName:@"Reverse edges"]; - } -} - -- (void) bringSelectionForward { - BOOL hasNodeSelection = [[pickSupport selectedNodes] count] > 0; - BOOL hasEdgeSelection = [[pickSupport selectedEdges] count] > 0; - if (!hasNodeSelection && !hasEdgeSelection) - return; - - [self startUndoGroup]; - GraphChange *nodeChange; - GraphChange *edgeChange; - if (hasNodeSelection) { - nodeChange = [graph bringNodesForward:[pickSupport selectedNodes]]; - [self registerUndoForChange:nodeChange]; - } - if (hasEdgeSelection) { - edgeChange = [graph bringEdgesForward:[pickSupport selectedEdges]]; - [self registerUndoForChange:edgeChange]; - } - [self nameAndEndUndoGroup:@"Bring forward"]; - [self regenerateTikz]; - if (hasNodeSelection) - [self postGraphChange:nodeChange]; - if (hasEdgeSelection) - [self postGraphChange:edgeChange]; -} - -- (void) bringSelectionToFront { - BOOL hasNodeSelection = [[pickSupport selectedNodes] count] > 0; - BOOL hasEdgeSelection = [[pickSupport selectedEdges] count] > 0; - if (!hasNodeSelection && !hasEdgeSelection) - return; - - [self startUndoGroup]; - GraphChange *nodeChange; - GraphChange *edgeChange; - if (hasNodeSelection) { - nodeChange = [graph bringNodesToFront:[pickSupport selectedNodes]]; - [self registerUndoForChange:nodeChange]; - } - if (hasEdgeSelection) { - edgeChange = [graph bringEdgesToFront:[pickSupport selectedEdges]]; - [self registerUndoForChange:edgeChange]; - } - [self nameAndEndUndoGroup:@"Bring to front"]; - [self regenerateTikz]; - if (hasNodeSelection) - [self postGraphChange:nodeChange]; - if (hasEdgeSelection) - [self postGraphChange:edgeChange]; -} - -- (void) sendSelectionBackward { - BOOL hasNodeSelection = [[pickSupport selectedNodes] count] > 0; - BOOL hasEdgeSelection = [[pickSupport selectedEdges] count] > 0; - if (!hasNodeSelection && !hasEdgeSelection) - return; - - [self startUndoGroup]; - GraphChange *nodeChange; - GraphChange *edgeChange; - if (hasNodeSelection) { - nodeChange = [graph sendNodesBackward:[pickSupport selectedNodes]]; - [self registerUndoForChange:nodeChange]; - } - if (hasEdgeSelection) { - edgeChange = [graph sendNodesBackward:[pickSupport selectedEdges]]; - [self registerUndoForChange:edgeChange]; - } - [self nameAndEndUndoGroup:@"Send backward"]; - [self regenerateTikz]; - if (hasNodeSelection) - [self postGraphChange:nodeChange]; - if (hasEdgeSelection) - [self postGraphChange:edgeChange]; -} - -- (void) sendSelectionToBack { - BOOL hasNodeSelection = [[pickSupport selectedNodes] count] > 0; - BOOL hasEdgeSelection = [[pickSupport selectedEdges] count] > 0; - if (!hasNodeSelection && !hasEdgeSelection) - return; - - [self startUndoGroup]; - GraphChange *nodeChange; - GraphChange *edgeChange; - if (hasNodeSelection) { - nodeChange = [graph sendNodesToBack:[pickSupport selectedNodes]]; - [self registerUndoForChange:nodeChange]; - } - if (hasEdgeSelection) { - edgeChange = [graph sendNodesToBack:[pickSupport selectedEdges]]; - [self registerUndoForChange:edgeChange]; - } - [self nameAndEndUndoGroup:@"Send to back"]; - [self regenerateTikz]; - if (hasNodeSelection) - [self postGraphChange:nodeChange]; - if (hasEdgeSelection) - [self postGraphChange:edgeChange]; -} - -- (BOOL) saveCopyToPath: (NSString*)p error: (NSError**)error { - if (!p) { - [NSException raise:@"No document path" format:@"No path given"]; - } - // we use glib for writing the file, because GNUStep sucks in this regard - // (older versions don't have -[NSString writeToFile:atomically:encoding:error:]) - GError *gerror = NULL; - gchar *filename = [p glibFilename]; - BOOL success = g_file_set_contents (filename, [tikz UTF8String], -1, &gerror) ? YES : NO; - if (gerror) { - GErrorToNSError (gerror, error); - g_error_free (gerror); - } - g_free (filename); - return success; -} - -- (BOOL) saveToPath: (NSString*)p error: (NSError**)error { - BOOL success = [self saveCopyToPath:p error:error]; - if (success) { - [self setPath:p]; - hasChanges = NO; - } - return success; -} - -- (BOOL) save: (NSError**)error { - if (!path) { - [NSException raise:@"No document path" format:@"Tried to save a document when there was no path"]; - } - return [self saveToPath:path error:error]; -} - -@end - -@implementation TikzDocument (Private) -- (void) styleRenamed:(NSNotification*)n { - [self regenerateTikz]; -} - -- (void) setPath:(NSString*)p { - [p retain]; - [path release]; - path = p; -} - -- (void) setGraph:(Graph*)g { - if (g == nil) { - g = [Graph graph]; - } - if (g == graph) { - return; - } - - [pickSupport deselectAllNodes]; - [pickSupport deselectAllEdges]; - - [self startUndoGroup]; - [undoManager registerUndoWithTarget:self selector:@selector(setGraph:) object:graph]; - [g retain]; - [graph release]; - graph = g; - - [self attachStylesToGraph:graph]; - - [self regenerateTikz]; - [self postGraphReplaced]; - [self nameAndEndUndoGroup:@"Replace graph"]; -} - -- (void) registerUndoForChange:(GraphChange*)change { - [undoManager registerUndoWithTarget:self - selector:@selector(undoGraphChange:) - object:change]; -} - -- (void) registerUndoGroupForChange:(GraphChange*)change withName:(NSString*)nm { - [self startUndoGroup]; - [self registerUndoForChange:change]; - [self nameAndEndUndoGroup:nm]; -} - -- (void) undoGraphChange:(GraphChange*)change { - GraphChange *inverse = [change invert]; - [graph applyGraphChange:inverse]; - [self startUndoGroup]; - [undoManager registerUndoWithTarget:self - selector:@selector(undoGraphChange:) - object:inverse]; - [self endUndoGroup]; - [self regenerateTikz]; - [self postGraphChange:change]; -} - -- (void) completedGraphChange:(GraphChange*)change withName:(NSString*)name { - if (change == nil) { - NSLog(@"No graph change given for change %@", name); - return; - } - [self registerUndoGroupForChange:change withName:name]; - [self regenerateTikz]; - [self postGraphChange:change]; -} - -- (void) attachStylesToGraph:(Graph*)g { - for (Node *n in [g nodes]) { - [n attachStyleFromTable:[styleManager nodeStyles]]; - } - for (Edge *e in [g edges]) { - [e attachStyleFromTable:[styleManager edgeStyles]]; - } -} - -- (void) regenerateTikz { - [tikz release]; - tikz = [[graph tikz] retain]; - hasChanges = YES; - [self postTikzChanged]; -} -@end - -// vim:ft=objc:sts=4:sw=4:et diff --git a/tikzit-old/src/gtk/Tool.h b/tikzit-old/src/gtk/Tool.h deleted file mode 100644 index 22c983e..0000000 --- a/tikzit-old/src/gtk/Tool.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "InputDelegate.h" -#import "Surface.h" - -#import -#import - -@class Configuration; -@class GraphRenderer; -@protocol InputDelegate; -@protocol RenderDelegate; - -@protocol Tool -@property (readonly) NSString *name; -@property (readonly) const gchar *stockId; -@property (readonly) NSString *helpText; -@property (readonly) NSString *shortcut; -@property (retain) GraphRenderer *activeRenderer; -@property (readonly) GtkWidget *configurationWidget; -- (void) loadConfiguration:(Configuration*)config; -- (void) saveConfiguration:(Configuration*)config; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/ToolBox.h b/tikzit-old/src/gtk/ToolBox.h deleted file mode 100644 index 60074c1..0000000 --- a/tikzit-old/src/gtk/ToolBox.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class Configuration; -@class Window; -@protocol Tool; - -@interface ToolBox : NSObject { - GtkWidget *window; - GtkToolItemGroup *toolGroup; - GtkWidget *titleLabel; - GtkWidget *configWidgetContainer; - GtkWidget *configWidget; -} - -@property (assign) id selectedTool; - -- (id) initWithTools:(NSArray*)tools; - -- (void) show; -- (void) present; -- (void) attachToWindow:(Window*)parent; - -- (void) loadConfiguration:(Configuration*)config; -- (void) saveConfiguration:(Configuration*)config; -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/ToolBox.m b/tikzit-old/src/gtk/ToolBox.m deleted file mode 100644 index c6d2ccf..0000000 --- a/tikzit-old/src/gtk/ToolBox.m +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "ToolBox.h" - -#import "Application.h" -#import "Configuration.h" -#import "Tool.h" -#import "Window.h" - -#import "gtkhelpers.h" -#import "tztoolpalette.h" - -static void tool_button_toggled_cb (GtkWidget *widget, ToolBox *toolBox); - -#define TOOL_DATA_KEY "tikzit-tool" - -@implementation ToolBox - -- (id) init { - [self release]; - return nil; -} - -- (id) initWithTools:(NSArray*)tools { - self = [super init]; - - if (self) { - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_object_ref_sink (window); - gtk_window_set_title (GTK_WINDOW (window), "Toolbox"); - gtk_window_set_role (GTK_WINDOW (window), "toolbox"); - gtk_window_set_type_hint (GTK_WINDOW (window), - GDK_WINDOW_TYPE_HINT_UTILITY); - gtk_window_set_deletable (GTK_WINDOW (window), FALSE); - - GtkWidget *mainLayout = gtk_vbox_new (FALSE, 5); - gtk_widget_show (mainLayout); - gtk_container_add (GTK_CONTAINER (window), mainLayout); - - GtkWidget *toolPalette = tz_tool_palette_new (); - gtk_widget_show (toolPalette); - gtk_box_pack_start (GTK_BOX (mainLayout), - toolPalette, - FALSE, - FALSE, - 0); - gtk_tool_palette_set_style (GTK_TOOL_PALETTE (toolPalette), - GTK_TOOLBAR_ICONS); - - toolGroup = GTK_TOOL_ITEM_GROUP (gtk_tool_item_group_new ("Tools")); - g_object_ref_sink (G_OBJECT (toolGroup)); - gtk_tool_item_group_set_label_widget ( - toolGroup, - NULL); - gtk_container_add (GTK_CONTAINER (toolPalette), GTK_WIDGET (toolGroup)); - gtk_widget_show (GTK_WIDGET (toolGroup)); - - GSList *item_group = NULL; - for (id tool in tools) { - NSString *tooltip = [NSString stringWithFormat: - @"%@: %@ (%@)", - [tool name], [tool helpText], [tool shortcut]]; - GtkToolItem *item = gtk_radio_tool_button_new_from_stock ( - item_group, - [tool stockId]); - gtk_tool_item_set_tooltip_text (item, [tooltip UTF8String]); - item_group = gtk_radio_tool_button_get_group ( - GTK_RADIO_TOOL_BUTTON (item)); - gtk_tool_item_group_insert ( - toolGroup, - item, - -1); - gtk_widget_show (GTK_WIDGET (item)); - g_object_set_data_full ( - G_OBJECT(item), - TOOL_DATA_KEY, - [tool retain], - release_obj); - - g_signal_connect (item, "toggled", - G_CALLBACK (tool_button_toggled_cb), - self); - } - - GtkWidget *sep = gtk_hseparator_new (); - gtk_widget_show (sep); - gtk_box_pack_start (GTK_BOX (mainLayout), - sep, - FALSE, - FALSE, - 0); - - titleLabel = gtk_label_new (""); - g_object_ref_sink (titleLabel); - gtk_widget_show (titleLabel); - - PangoAttrList *attrs = pango_attr_list_new (); - pango_attr_list_insert (attrs, - pango_attr_weight_new (PANGO_WEIGHT_SEMIBOLD)); - gtk_label_set_attributes (GTK_LABEL (titleLabel), attrs); - pango_attr_list_unref (attrs); - - gtk_box_pack_start (GTK_BOX (mainLayout), - titleLabel, - FALSE, - FALSE, - 0); - - configWidgetContainer = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); - g_object_ref_sink (configWidgetContainer); - gtk_widget_show (configWidgetContainer); - gtk_box_pack_start (GTK_BOX (mainLayout), - configWidgetContainer, - TRUE, - TRUE, - 0); - gtk_alignment_set_padding (GTK_ALIGNMENT (configWidgetContainer), - 5, 5, 5, 5); - - gint button_width; - gint button_height; - - if (tz_tool_palette_get_button_size (TZ_TOOL_PALETTE (toolPalette), - &button_width, &button_height)) - { - GdkGeometry geometry; - - geometry.min_width = 2 * button_width; - geometry.min_height = -1; - geometry.base_width = button_width; - geometry.base_height = 0; - geometry.width_inc = button_width; - geometry.height_inc = 1; - - gtk_window_set_geometry_hints (GTK_WINDOW (window), - NULL, - &geometry, - GDK_HINT_MIN_SIZE | - GDK_HINT_BASE_SIZE | - GDK_HINT_RESIZE_INC | - GDK_HINT_USER_POS); - } - gtk_window_set_default_size (GTK_WINDOW (window), button_width * 5, 500); - - // hack to position the toolbox window somewhere sensible - // (upper left) - gtk_window_parse_geometry (GTK_WINDOW (window), "+0+0"); - } - - return self; -} - -- (void) dealloc { - if (window) { - g_object_unref (G_OBJECT (toolGroup)); - g_object_unref (G_OBJECT (titleLabel)); - g_object_unref (G_OBJECT (configWidgetContainer)); - if (configWidget) - g_object_unref (G_OBJECT (configWidget)); - gtk_widget_destroy (window); - g_object_unref (G_OBJECT (window)); - } - - [super dealloc]; -} - -- (id) selectedTool { - guint count = gtk_tool_item_group_get_n_items (toolGroup); - for (guint i = 0; i < count; ++i) { - GtkToolItem *item = gtk_tool_item_group_get_nth_item (toolGroup, i); - if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (item))) { - return (id)g_object_get_data (G_OBJECT (item), TOOL_DATA_KEY); - } - } - return nil; -} - -- (void) _setToolWidget:(GtkWidget*)widget { - if (configWidget) { - gtk_widget_hide (configWidget); - gtk_container_remove (GTK_CONTAINER (configWidgetContainer), - configWidget); - g_object_unref (configWidget); - } - configWidget = widget; - if (configWidget) { - g_object_ref (configWidget); - gtk_container_add (GTK_CONTAINER (configWidgetContainer), - configWidget); - gtk_widget_show (configWidget); - } -} - -- (void) setSelectedTool:(id)tool { - guint count = gtk_tool_item_group_get_n_items (toolGroup); - for (guint i = 0; i < count; ++i) { - GtkToolItem *item = gtk_tool_item_group_get_nth_item (toolGroup, i); - id data = (id)g_object_get_data (G_OBJECT (item), TOOL_DATA_KEY); - if (data == tool) { - gtk_toggle_tool_button_set_active ( - GTK_TOGGLE_TOOL_BUTTON (item), - TRUE); - break; - } - } - gtk_label_set_label (GTK_LABEL (titleLabel), - [[tool name] UTF8String]); - [self _setToolWidget:[tool configurationWidget]]; -} - -- (void) show { - gtk_widget_show (window); -} - -- (void) present { - gtk_window_present (GTK_WINDOW (window)); -} - -- (void) attachToWindow:(Window*)parent { - utility_window_attach (GTK_WINDOW (window), [parent gtkWindow]); -} - -- (void) loadConfiguration:(Configuration*)config { - if ([config hasGroup:@"ToolBox"]) { - tz_restore_window (GTK_WINDOW (window), - [config integerEntry:@"x" inGroup:@"ToolBox"], - [config integerEntry:@"y" inGroup:@"ToolBox"], - [config integerEntry:@"w" inGroup:@"ToolBox"], - [config integerEntry:@"h" inGroup:@"ToolBox"]); - } -} - -- (void) saveConfiguration:(Configuration*)config { - gint x, y, w, h; - - gtk_window_get_position (GTK_WINDOW (window), &x, &y); - gtk_window_get_size (GTK_WINDOW (window), &w, &h); - - [config setIntegerEntry:@"x" inGroup:@"ToolBox" value:x]; - [config setIntegerEntry:@"y" inGroup:@"ToolBox" value:y]; - [config setIntegerEntry:@"w" inGroup:@"ToolBox" value:w]; - [config setIntegerEntry:@"h" inGroup:@"ToolBox" value:h]; -} - -@end - -static void tool_button_toggled_cb (GtkWidget *widget, ToolBox *toolBox) { - if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (widget))) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - id tool = (id)g_object_get_data (G_OBJECT(widget), TOOL_DATA_KEY); - [app setActiveTool:tool]; - NSDictionary *userInfo = [NSDictionary - dictionaryWithObject:tool - forKey:@"tool"]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"ToolSelectionChanged" - object:toolBox - userInfo:userInfo]; - - [pool drain]; - } -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/WidgetSurface.h b/tikzit-old/src/gtk/WidgetSurface.h deleted file mode 100644 index 667749f..0000000 --- a/tikzit-old/src/gtk/WidgetSurface.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import -#import -#import - -/** - * Provides a surface for rendering to a widget. - */ -@interface WidgetSurface: NSObject { - GtkWidget *widget; - Transformer *transformer; - id renderDelegate; - id inputDelegate; - BOOL keepCentered; - BOOL buttonPressesRequired; - CGFloat defaultScale; - NSSize lastKnownSize; -} - -@property (assign) BOOL canFocus; -@property (assign) BOOL keepCentered; -@property (assign) CGFloat defaultScale; - -- (id) initWithWidget:(GtkWidget*)widget; -- (GtkWidget*) widget; - -- (id) inputDelegate; -- (void) setInputDelegate:(id)delegate; - -/** - * Set the minimum size that this widget wants - */ -- (void) setSizeRequestWidth:(double)width height:(double)height; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/WidgetSurface.m b/tikzit-old/src/gtk/WidgetSurface.m deleted file mode 100644 index 004e722..0000000 --- a/tikzit-old/src/gtk/WidgetSurface.m +++ /dev/null @@ -1,630 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "WidgetSurface.h" -#import "gtkhelpers.h" -#import "InputDelegate.h" -#import "CairoRenderContext.h" - -// {{{ Internal interfaces -// {{{ GTK+ callbacks -static gboolean configure_event_cb (GtkWidget *widget, GdkEventConfigure *event, WidgetSurface *surface); -static void realize_cb (GtkWidget *widget, WidgetSurface *surface); -static gboolean expose_event_cb (GtkWidget *widget, GdkEventExpose *event, WidgetSurface *surface); -static gboolean button_press_event_cb (GtkWidget *widget, GdkEventButton *event, WidgetSurface *surface); -static gboolean button_release_event_cb (GtkWidget *widget, GdkEventButton *event, WidgetSurface *surface); -static gboolean motion_notify_event_cb (GtkWidget *widget, GdkEventMotion *event, WidgetSurface *surface); -static gboolean key_press_event_cb (GtkWidget *widget, GdkEventKey *event, WidgetSurface *surface); -static gboolean key_release_event_cb (GtkWidget *widget, GdkEventKey *event, WidgetSurface *surface); -static gboolean scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, WidgetSurface *surface); -static void set_cursor (GtkWidget *widget, GdkCursor *cursor); -static void unref_cursor (gpointer cursor, GClosure *closure); -// }}} - -@interface WidgetSurface (Private) -- (void) updateTransformer; -- (void) widgetSizeChanged:(NSNotification*)notification; -- (void) handleExposeEvent:(GdkEventExpose*)event; -- (void) updateLastKnownSize; -- (void) zoomTo:(CGFloat)scale aboutPoint:(NSPoint)p; -- (void) zoomTo:(CGFloat)scale; -- (void) addToEventMask:(GdkEventMask)values; -- (void) removeFromEventMask:(GdkEventMask)values; -@end -// }}} -// {{{ API -@implementation WidgetSurface - -- (id) init { - return [self initWithWidget:gtk_drawing_area_new ()]; -} - -- (id) initWithWidget:(GtkWidget*)w { - self = [super init]; - - if (self) { - widget = w; - g_object_ref_sink (G_OBJECT (widget)); - defaultScale = 1.0f; - transformer = [[Transformer alloc] init]; - [transformer setFlippedAboutXAxis:YES]; - [self updateLastKnownSize]; - g_object_set (G_OBJECT (widget), "events", GDK_STRUCTURE_MASK, NULL); - g_signal_connect (widget, "expose-event", G_CALLBACK (expose_event_cb), self); - g_signal_connect (widget, "configure-event", G_CALLBACK (configure_event_cb), self); - g_signal_connect (widget, "realize", G_CALLBACK (realize_cb), self); - g_signal_connect (widget, "button-press-event", G_CALLBACK (button_press_event_cb), self); - g_signal_connect (widget, "button-release-event", G_CALLBACK (button_release_event_cb), self); - g_signal_connect (widget, "motion-notify-event", G_CALLBACK (motion_notify_event_cb), self); - g_signal_connect (widget, "key-press-event", G_CALLBACK (key_press_event_cb), self); - g_signal_connect (widget, "key-release-event", G_CALLBACK (key_release_event_cb), self); - g_signal_connect (widget, "scroll-event", G_CALLBACK (scroll_event_cb), self); - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(widgetSizeChanged:) - name:@"SurfaceSizeChanged" - object:self]; - if ([self canFocus]) { - [self addToEventMask:GDK_BUTTON_PRESS_MASK]; - } else { - [self removeFromEventMask:GDK_BUTTON_PRESS_MASK]; - } - } - - return self; -} - -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [transformer release]; - g_object_unref (G_OBJECT (widget)); - - [super dealloc]; -} - -- (void) invalidateRect:(NSRect)rect { - if (!NSIsEmptyRect (rect)) { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - GdkRectangle g_rect = gdk_rectangle_from_ns_rect (rect); - gdk_window_invalidate_rect (window, &g_rect, TRUE); - } - } -} - -- (void) invalidate { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - GdkRegion *visible = gdk_drawable_get_visible_region (GDK_DRAWABLE (window)); - gdk_window_invalidate_region (window, visible, TRUE); - gdk_region_destroy (visible); - } -} - -- (id) createRenderContext { - return [CairoRenderContext contextForWidget:widget]; -} - -- (int) width { - int width = 0; - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - gdk_drawable_get_size (window, &width, NULL); - } - return width; -} - -- (int) height { - int height = 0; - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - gdk_drawable_get_size (window, NULL, &height); - } - return height; -} - -- (void) setSizeRequestWidth:(double)width height:(double)height { - gtk_widget_set_size_request (widget, width, height); -} - -- (Transformer*) transformer { - return transformer; -} - -- (GtkWidget*) widget { - return widget; -} - -- (void) setRenderDelegate:(id )delegate { - // NB: no retention! - renderDelegate = delegate; - if (renderDelegate == nil) { - [self removeFromEventMask:GDK_EXPOSURE_MASK]; - } else { - [self addToEventMask:GDK_EXPOSURE_MASK]; - } -} - -- (id) inputDelegate { - return inputDelegate; -} - -- (void) setInputDelegate:(id)delegate { - if (delegate == inputDelegate) { - return; - } - buttonPressesRequired = NO; - if (inputDelegate != nil) { - [self removeFromEventMask:GDK_POINTER_MOTION_MASK - | GDK_BUTTON_PRESS_MASK - | GDK_BUTTON_RELEASE_MASK - | GDK_KEY_PRESS_MASK - | GDK_KEY_RELEASE_MASK]; - } - inputDelegate = delegate; - if (delegate != nil) { - GdkEventMask mask = 0; - if ([delegate respondsToSelector:@selector(mousePressAt:withButton:andMask:)]) { - buttonPressesRequired = YES; - mask |= GDK_BUTTON_PRESS_MASK; - } - if ([delegate respondsToSelector:@selector(mouseReleaseAt:withButton:andMask:)]) { - mask |= GDK_BUTTON_RELEASE_MASK; - } - if ([delegate respondsToSelector:@selector(mouseDoubleClickAt:withButton:andMask:)]) { - buttonPressesRequired = YES; - mask |= GDK_BUTTON_PRESS_MASK; - } - if ([delegate respondsToSelector:@selector(mouseMoveTo:withButtons:andMask:)]) { - mask |= GDK_POINTER_MOTION_MASK; - } - if ([delegate respondsToSelector:@selector(keyPressed:withMask:)]) { - mask |= GDK_KEY_PRESS_MASK; - } - if ([delegate respondsToSelector:@selector(keyReleased:withMask:)]) { - mask |= GDK_KEY_RELEASE_MASK; - } - [self addToEventMask:mask]; - } -} - -- (id ) renderDelegate { - return renderDelegate; -} - -- (void) setKeepCentered:(BOOL)centered { - keepCentered = centered; - [self updateTransformer]; -} - -- (BOOL) keepCentered { - return keepCentered; -} - -- (BOOL) canFocus { - return gtk_widget_get_can_focus (widget); -} - -- (void) setCanFocus:(BOOL)focus { - gtk_widget_set_can_focus (widget, focus); - if (focus) { - [self addToEventMask:GDK_BUTTON_PRESS_MASK]; - } else if (!buttonPressesRequired) { - [self removeFromEventMask:GDK_BUTTON_PRESS_MASK]; - } -} - -- (BOOL) hasFocus { - return gtk_widget_has_focus (widget); -} - -- (void) renderFocus { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - int width = 0; - int height = 0; - gdk_drawable_get_size (window, &width, &height); - gtk_paint_focus (gtk_widget_get_style (widget), - window, - GTK_STATE_NORMAL, - NULL, - widget, - NULL, - 0, - 0, - width, - height - ); - } -} - -- (CGFloat) defaultScale { - return defaultScale; -} - -- (void) setDefaultScale:(CGFloat)newDefault { - if (defaultScale != newDefault) { - CGFloat oldDefault = defaultScale; - defaultScale = newDefault; - - CGFloat scale = [transformer scale]; - scale *= (newDefault / oldDefault); - [transformer setScale:scale]; - [self invalidate]; - } -} - -- (void) zoomIn { - CGFloat scale = [transformer scale]; - scale *= 1.2f; - [self zoomTo:scale]; -} - -- (void) zoomOut { - CGFloat scale = [transformer scale]; - scale /= 1.2f; - [self zoomTo:scale]; -} - -- (void) zoomReset { - [self zoomTo:defaultScale]; -} - -- (void) zoomInAboutPoint:(NSPoint)p { - CGFloat scale = [transformer scale]; - scale *= 1.2f; - [self zoomTo:scale aboutPoint:p]; -} - -- (void) zoomOutAboutPoint:(NSPoint)p { - CGFloat scale = [transformer scale]; - scale /= 1.2f; - [self zoomTo:scale aboutPoint:p]; -} - -- (void) zoomResetAboutPoint:(NSPoint)p { - [self zoomTo:defaultScale aboutPoint:p]; -} - -- (void) setCursor:(Cursor)c { - GdkCursor *cursor = NULL; - switch (c) { - case ResizeRightCursor: - cursor = gdk_cursor_new (GDK_RIGHT_SIDE); - break; - case ResizeBottomRightCursor: - cursor = gdk_cursor_new (GDK_BOTTOM_RIGHT_CORNER); - break; - case ResizeBottomCursor: - cursor = gdk_cursor_new (GDK_BOTTOM_SIDE); - break; - case ResizeBottomLeftCursor: - cursor = gdk_cursor_new (GDK_BOTTOM_LEFT_CORNER); - break; - case ResizeLeftCursor: - cursor = gdk_cursor_new (GDK_LEFT_SIDE); - break; - case ResizeTopLeftCursor: - cursor = gdk_cursor_new (GDK_TOP_LEFT_CORNER); - break; - case ResizeTopCursor: - cursor = gdk_cursor_new (GDK_TOP_SIDE); - break; - case ResizeTopRightCursor: - cursor = gdk_cursor_new (GDK_TOP_RIGHT_CORNER); - break; - default: break; - } - GdkWindow *window = gtk_widget_get_window (widget); - g_signal_handlers_disconnect_matched (window, - G_SIGNAL_MATCH_FUNC, 0, 0, NULL, - G_CALLBACK (set_cursor), NULL); - if (window) { - gdk_window_set_cursor (window, cursor); - if (cursor != NULL) { - gdk_cursor_unref (cursor); - } - } else { - g_signal_connect_data (widget, - "realize", G_CALLBACK (set_cursor), cursor, - unref_cursor, 0); - } -} - -@end -// }}} -// {{{ Private -@implementation WidgetSurface (Private) -- (void) widgetSizeChanged:(NSNotification*)notification { - [self updateTransformer]; - [self updateLastKnownSize]; -} - -- (void) updateTransformer { - if (keepCentered) { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - int width = 0; - int height = 0; - gdk_drawable_get_size (window, &width, &height); - NSPoint origin; - if (lastKnownSize.width < 1 || lastKnownSize.height < 1) { - origin.x = (float)width / 2.0f; - origin.y = (float)height / 2.0f; - } else { - origin = [transformer origin]; - origin.x += ((float)width - lastKnownSize.width) / 2.0f; - origin.y += ((float)height - lastKnownSize.height) / 2.0f; - } - [transformer setOrigin:origin]; - } - } -} - -- (void) handleExposeEvent:(GdkEventExpose*)event { - if (renderDelegate != nil) { - NSRect area = gdk_rectangle_to_ns_rect (event->area); - - id context = [CairoRenderContext contextForWidget:widget]; - [context rect:area]; - [context clipToPath]; - [renderDelegate renderWithContext:context onSurface:self]; - } -} - -- (void) updateLastKnownSize { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - int width = 0; - int height = 0; - gdk_drawable_get_size (window, &width, &height); - lastKnownSize.width = (float)width; - lastKnownSize.height = (float)height; - } else { - lastKnownSize = NSZeroSize; - } -} - -- (void) zoomTo:(CGFloat)scale aboutPoint:(NSPoint)p { - NSPoint graphP = [transformer fromScreen:p]; - - [transformer setScale:scale]; - - NSPoint newP = [transformer toScreen:graphP]; - NSPoint origin = [transformer origin]; - origin.x += p.x - newP.x; - origin.y += p.y - newP.y; - [transformer setOrigin:origin]; - - [self invalidate]; -} - -- (void) zoomTo:(CGFloat)scale { - NSPoint centre = NSMakePoint (lastKnownSize.width/2.0f, lastKnownSize.height/2.0f); - [self zoomTo:scale aboutPoint:centre]; -} - -- (void) addToEventMask:(GdkEventMask)values { - GdkEventMask mask; - g_object_get (G_OBJECT (widget), "events", &mask, NULL); - mask |= values; - g_object_set (G_OBJECT (widget), "events", mask, NULL); -} - -- (void) removeFromEventMask:(GdkEventMask)values { - GdkEventMask mask; - g_object_get (G_OBJECT (widget), "events", &mask, NULL); - mask ^= values; - if (buttonPressesRequired || [self canFocus]) { - mask |= GDK_BUTTON_PRESS_MASK; - } - g_object_set (G_OBJECT (widget), "events", mask, NULL); -} - -@end -// }}} -// {{{ GTK+ callbacks -static gboolean configure_event_cb(GtkWidget *widget, GdkEventConfigure *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"SurfaceSizeChanged" object:surface]; - [pool drain]; - return FALSE; -} - -static void realize_cb (GtkWidget *widget, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [surface updateTransformer]; - [pool drain]; -} - -static gboolean expose_event_cb(GtkWidget *widget, GdkEventExpose *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [surface handleExposeEvent:event]; - [pool drain]; - return FALSE; -} - -InputMask mask_from_gdk_modifier_state (GdkModifierType state) { - InputMask mask = 0; - if (state & GDK_SHIFT_MASK) { - mask |= ShiftMask; - } - if (state & GDK_CONTROL_MASK) { - mask |= ControlMask; - } - if (state & GDK_META_MASK) { - mask |= MetaMask; - } - return mask; -} - -ScrollDirection scroll_dir_from_gdk_scroll_dir (GdkScrollDirection dir) { - switch (dir) { - case GDK_SCROLL_UP: return ScrollUp; - case GDK_SCROLL_DOWN: return ScrollDown; - case GDK_SCROLL_LEFT: return ScrollLeft; - case GDK_SCROLL_RIGHT: return ScrollRight; - default: NSLog(@"Invalid scroll direction %i", (int)dir); return ScrollDown; - } -} - -MouseButton buttons_from_gdk_modifier_state (GdkModifierType state) { - MouseButton buttons = 0; - if (state & GDK_BUTTON1_MASK) { - buttons |= LeftButton; - } - if (state & GDK_BUTTON2_MASK) { - buttons |= MiddleButton; - } - if (state & GDK_BUTTON3_MASK) { - buttons |= RightButton; - } - if (state & GDK_BUTTON4_MASK) { - buttons |= Button4; - } - if (state & GDK_BUTTON5_MASK) { - buttons |= Button5; - } - return buttons; -} - -static gboolean button_press_event_cb(GtkWidget *widget, GdkEventButton *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - if ([surface canFocus]) { - if (!gtk_widget_has_focus (widget)) { - gtk_widget_grab_focus (widget); - } - } - - id delegate = [surface inputDelegate]; - if (delegate != nil) { - NSPoint pos = NSMakePoint (event->x, event->y); - MouseButton button = (MouseButton)event->button; - InputMask mask = mask_from_gdk_modifier_state (event->state); - if (event->type == GDK_BUTTON_PRESS && [delegate respondsToSelector:@selector(mousePressAt:withButton:andMask:)]) { - [delegate mousePressAt:pos withButton:button andMask:mask]; - } - if (event->type == GDK_2BUTTON_PRESS && [delegate respondsToSelector:@selector(mouseDoubleClickAt:withButton:andMask:)]) { - [delegate mouseDoubleClickAt:pos withButton:button andMask:mask]; - } - } - - [pool drain]; - return FALSE; -} - -static gboolean button_release_event_cb(GtkWidget *widget, GdkEventButton *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - id delegate = [surface inputDelegate]; - if (delegate != nil) { - if ([delegate respondsToSelector:@selector(mouseReleaseAt:withButton:andMask:)]) { - NSPoint pos = NSMakePoint (event->x, event->y); - MouseButton button = (MouseButton)event->button; - InputMask mask = mask_from_gdk_modifier_state (event->state); - [delegate mouseReleaseAt:pos withButton:button andMask:mask]; - } - } - - [pool drain]; - return FALSE; -} - -static gboolean motion_notify_event_cb(GtkWidget *widget, GdkEventMotion *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - id delegate = [surface inputDelegate]; - if (delegate != nil) { - if ([delegate respondsToSelector:@selector(mouseMoveTo:withButtons:andMask:)]) { - NSPoint pos = NSMakePoint (event->x, event->y); - MouseButton buttons = buttons_from_gdk_modifier_state (event->state); - InputMask mask = mask_from_gdk_modifier_state (event->state); - [delegate mouseMoveTo:pos withButtons:buttons andMask:mask]; - } - } - - [pool drain]; - return FALSE; -} - -static gboolean key_press_event_cb(GtkWidget *widget, GdkEventKey *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - id delegate = [surface inputDelegate]; - if (delegate != nil) { - if ([delegate respondsToSelector:@selector(keyPressed:withMask:)]) { - InputMask mask = mask_from_gdk_modifier_state (event->state); - [delegate keyPressed:event->keyval withMask:mask]; - } - } - - [pool drain]; - return FALSE; -} - -static gboolean key_release_event_cb(GtkWidget *widget, GdkEventKey *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - id delegate = [surface inputDelegate]; - if (delegate != nil) { - if ([delegate respondsToSelector:@selector(keyReleased:withMask:)]) { - InputMask mask = mask_from_gdk_modifier_state (event->state); - [delegate keyReleased:event->keyval withMask:mask]; - } - } - - [pool drain]; - return FALSE; -} - -static gboolean scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, WidgetSurface *surface) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - id delegate = [surface inputDelegate]; - if (delegate != nil) { - if ([delegate respondsToSelector:@selector(mouseScrolledAt:inDirection:withMask:)]) { - NSPoint pos = NSMakePoint (event->x, event->y); - InputMask mask = mask_from_gdk_modifier_state (event->state); - ScrollDirection dir = scroll_dir_from_gdk_scroll_dir (event->direction); - [delegate mouseScrolledAt:pos - inDirection:dir - withMask:mask]; - } - } - - [pool drain]; - return FALSE; -} - -static void unref_cursor (gpointer cursor, GClosure *closure) { - if (cursor != NULL) { - gdk_cursor_unref ((GdkCursor*)cursor); - } -} - -static void set_cursor (GtkWidget *widget, GdkCursor *cursor) { - GdkWindow *window = gtk_widget_get_window (widget); - if (window) { - gdk_window_set_cursor (window, cursor); - if (cursor != NULL) { - gdk_cursor_unref (cursor); - } - } -} -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/Window.h b/tikzit-old/src/gtk/Window.h deleted file mode 100644 index a3ce8a4..0000000 --- a/tikzit-old/src/gtk/Window.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import - -@class GraphEditorPanel; -@class Menu; -@class PropertyPane; -@class Preambles; -@class PreambleEditor; -@class PreviewWindow; -@class SettingsDialog; -@class StyleManager; -@class StylesPane; -@class TikzDocument; -@protocol Tool; - -/** - * Manages a document window - */ -@interface Window: NSObject { - // GTK+ widgets - GtkWindow *window; - GtkTextBuffer *tikzBuffer; - GtkStatusbar *statusBar; - GtkPaned *tikzPaneSplitter; - GtkWidget *tikzPane; - - gulong clipboard_handler_id; - GtkTextTag *errorHighlightTag; // owned by tikzBuffer - - // Classes that manage parts of the window - Menu *menu; - GraphEditorPanel *graphPanel; - - PreviewWindow *previewWindow; - - // state variables - BOOL suppressTikzUpdates; - BOOL hasParseError; - - // the document displayed by the window - TikzDocument *document; -} - -/** - * The document displayed by the window - */ -@property (retain) TikzDocument *document; -@property (readonly) BOOL hasFocus; -@property (readonly) GtkWindow *gtkWindow; - -/** - * Create a window with an empty document - */ -- (id) init; -+ (id) window; - -/** - * Create a window with the given document - */ -- (id) initWithDocument:(TikzDocument*)doc; -+ (id) windowWithDocument:(TikzDocument*)doc; - -/** - * Present the window to the user - */ -- (void) present; - -/** - * Open a file, asking the user which file to open - */ -- (void) openFile; -/** - * Open a file - */ -- (BOOL) openFileAtPath:(NSString*)path; -/** - * Save the active document to the path it was opened from - * or last saved to, or ask the user where to save it. - */ -- (BOOL) saveActiveDocument; -/** - * Save the active document, asking the user where to save it. - */ -- (BOOL) saveActiveDocumentAs; -/** - * Save the active document as a shape, asking the user what to name it. - */ -- (void) saveActiveDocumentAsShape; - -/** - * Close the window. - * - * May terminate the application if this is the last window. - * - * Will ask for user confirmation if the document is not saved. - */ -- (void) close; - -/** - * Cut the current selection to the clipboard. - */ -- (void) selectionCutToClipboard; -/** - * Copy the current selection to the clipboard. - */ -- (void) selectionCopyToClipboard; -/** - * Paste from the clipboard to the appropriate place. - */ -- (void) pasteFromClipboard; - -/** - * The GTK+ window that this class manages. - */ -- (GtkWindow*) gtkWindow; -/** - * The menu for the window. - */ -- (Menu*) menu; - -/** - * Present an error to the user - * - * @param error the error to present - */ -- (void) presentError:(NSError*)error; -/** - * Present an error to the user - * - * @param error the error to present - * @param message a message to display with the error - */ -- (void) presentError:(NSError*)error withMessage:(NSString*)message; -/** - * Present an error to the user - * - * @param error the error to present - */ -- (void) presentGError:(GError*)error; -/** - * Present an error to the user - * - * @param error the error to present - * @param message a message to display with the error - */ -- (void) presentGError:(GError*)error withMessage:(NSString*)message; - -- (void) setActiveTool:(id)tool; - -- (void) zoomIn; -- (void) zoomOut; -- (void) zoomReset; - -/** - * Show or update the preview window. - */ -- (void) presentPreview; -/** - * Show or update the preview window without it grabbing focus - */ -- (void) updatePreview; - -@end - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/Window.m b/tikzit-old/src/gtk/Window.m deleted file mode 100644 index 2d9e63a..0000000 --- a/tikzit-old/src/gtk/Window.m +++ /dev/null @@ -1,991 +0,0 @@ -/* - * Copyright 2011-2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "Window.h" - -#import -#import "gtkhelpers.h" -#import "clipboard.h" - -#import "Application.h" -#import "Configuration.h" -#import "FileChooserDialog.h" -#import "GraphEditorPanel.h" -#import "Menu.h" -#import "RecentManager.h" -#import "Shape.h" -#import "SupportDir.h" -#import "TikzDocument.h" - -#ifdef HAVE_POPPLER -#import "PreviewWindow.h" -#endif - -enum { - GraphInfoStatus, - ParseStatus -}; - -// {{{ Internal interfaces -// {{{ Clipboard support - -static void clipboard_provide_data (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - guint info, - gpointer clipboard_graph_data); -static void clipboard_release_data (GtkClipboard *clipboard, gpointer clipboard_graph_data); -static void clipboard_check_targets (GtkClipboard *clipboard, - GdkAtom *atoms, - gint n_atoms, - gpointer action); -static void clipboard_paste_contents (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - gpointer document); - -// }}} -// {{{ Signals - -static void window_toplevel_focus_changed_cb (GObject *gobject, GParamSpec *pspec, Window *window); -static void graph_divider_position_changed_cb (GObject *gobject, GParamSpec *pspec, Window *window); -static void tikz_buffer_changed_cb (GtkTextBuffer *buffer, Window *window); -static gboolean main_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, Window *window); -static void main_window_destroy_cb (GtkWidget *widget, Window *window); -static gboolean main_window_configure_event_cb (GtkWidget *widget, GdkEventConfigure *event, Window *window); -static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAction *action); - -// }}} - -@interface Window (Notifications) -- (void) tikzBufferChanged; -- (void) windowSizeChangedWidth:(int)width height:(int)height; -- (void) documentTikzChanged:(NSNotification*)notification; -- (void) documentSelectionChanged:(NSNotification*)notification; -- (void) undoStackChanged:(NSNotification*)notification; -@end - -@interface Window (InitHelpers) -- (void) _loadUi; -- (void) _restoreUiState; -- (void) _connectSignals; -@end - -@interface Window (Private) -- (BOOL) _askCanClose; -/** Open a document, dealing with errors as necessary */ -- (TikzDocument*) _openDocument:(NSString*)path; -- (void) _placeGraphOnClipboard:(Graph*)graph; -- (void) _clearParseError; -- (void) _setParseError:(NSError*)error; -/** Update the window title. */ -- (void) _updateTitle; -/** Update the window status bar default text. */ -- (void) _updateStatus; -/** Update the displayed tikz code to match the active document. */ -- (void) _updateTikz; -/** Update the undo and redo actions to match the active document's - * undo stack. */ -- (void) _updateUndoActions; -- (void) showPreview; -@end - -// }}} -// {{{ API - -@implementation Window - -@synthesize gtkWindow=window; - -- (id) init { - return [self initWithDocument:[TikzDocument documentWithStyleManager:[app styleManager]]]; -} -+ (id) window { - return [[[self alloc] init] autorelease]; -} -- (id) initWithDocument:(TikzDocument*)doc { - self = [super init]; - - if (self) { - [self _loadUi]; - [self _restoreUiState]; - [self _connectSignals]; - - [self setDocument:doc]; - - gtk_widget_show (GTK_WIDGET (window)); - } - - return self; -} -+ (id) windowWithDocument:(TikzDocument*)doc { - return [[[self alloc] initWithDocument:doc] autorelease]; -} - -- (void) dealloc { - // The GTK+ window has already been destroyed at this point - - [[NSNotificationCenter defaultCenter] removeObserver:self]; - g_signal_handler_disconnect ( - gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), - clipboard_handler_id); - - [previewWindow release]; - [menu release]; - [graphPanel release]; - [document release]; - - g_object_unref (tikzBuffer); - g_object_unref (tikzPane); - g_object_unref (tikzPaneSplitter); - g_object_unref (statusBar); - g_object_unref (window); - - [super dealloc]; -} - -- (TikzDocument*) document { - return document; -} -- (void) setDocument:(TikzDocument*)newDoc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:[document pickSupport]]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:document]; - - TikzDocument *oldDoc = document; - document = [newDoc retain]; - - [graphPanel setDocument:document]; - [previewWindow setDocument:document]; - [self _updateTikz]; - [self _updateTitle]; - [self _updateStatus]; - [self _updateUndoActions]; - [menu notifySelectionChanged:[document pickSupport]]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(documentTikzChanged:) - name:@"TikzChanged" object:document]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(undoStackChanged:) - name:@"UndoStackChanged" object:document]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(documentSelectionChanged:) - name:@"NodeSelectionChanged" object:[document pickSupport]]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(documentSelectionChanged:) - name:@"EdgeSelectionChanged" object:[document pickSupport]]; - - if ([document path] != nil) { - [[RecentManager defaultManager] addRecentFile:[document path]]; - } - - NSDictionary *userInfo; - userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - document, @"document", - oldDoc, @"oldDocument", - nil]; - [[NSNotificationCenter defaultCenter] - postNotificationName:@"DocumentChanged" - object:self - userInfo:userInfo]; - [oldDoc release]; -} - -- (BOOL) hasFocus { - return gtk_window_has_toplevel_focus (GTK_WINDOW (window)); -} - -- (void) present { - gtk_window_present (GTK_WINDOW (window)); -} - -- (void) openFile { - FileChooserDialog *dialog = [FileChooserDialog openDialogWithParent:window]; - [dialog addStandardFilters]; - if ([document path]) { - [dialog setCurrentFolder:[[document path] stringByDeletingLastPathComponent]]; - } else if ([app lastOpenFolder]) { - [dialog setCurrentFolder:[app lastOpenFolder]]; - } - - if ([dialog showDialog]) { - if ([self openFileAtPath:[dialog filePath]]) { - [app setLastOpenFolder:[dialog currentFolder]]; - } - } - [dialog destroy]; -} - -- (BOOL) openFileAtPath:(NSString*)path { - TikzDocument *doc = [self _openDocument:path]; - if (doc != nil) { - if (![document hasUnsavedChanges] && [document path] == nil) { - // we just have a fresh, untitled document - replace it - [self setDocument:doc]; - } else { - [app newWindowWithDocument:doc]; - } - return YES; - } - return NO; -} - -- (BOOL) saveActiveDocument { - if ([document path] == nil) { - return [self saveActiveDocumentAs]; - } else { - NSError *error = nil; - if (![document save:&error]) { - [self presentError:error]; - return NO; - } else { - [self _updateTitle]; - return YES; - } - } -} - -- (BOOL) saveActiveDocumentAs { - FileChooserDialog *dialog = [FileChooserDialog saveDialogWithParent:window]; - [dialog addStandardFilters]; - if ([document path] != nil) { - [dialog setCurrentFolder:[[document path] stringByDeletingLastPathComponent]]; - } else if ([app lastSaveAsFolder] != nil) { - [dialog setCurrentFolder:[app lastSaveAsFolder]]; - } - [dialog setSuggestedName:[document suggestedFileName]]; - - BOOL saved = NO; - if ([dialog showDialog]) { - NSString *nfile = [dialog filePath]; - - NSError *error = nil; - if (![document saveToPath:nfile error:&error]) { - [self presentError:error]; - } else { - [self _updateTitle]; - [[RecentManager defaultManager] addRecentFile:nfile]; - [app setLastSaveAsFolder:[dialog currentFolder]]; - saved = YES; - } - } - [dialog destroy]; - return saved; -} - -- (void) saveActiveDocumentAsShape { - GtkWidget *dialog = gtk_dialog_new_with_buttons ( - "Save as shape", - window, - GTK_DIALOG_MODAL, - GTK_STOCK_OK, - GTK_RESPONSE_ACCEPT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_REJECT, - NULL); - GtkBox *content = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))); - GtkWidget *label1 = gtk_label_new ("Please choose a name for the shape"); - GtkWidget *label2 = gtk_label_new ("Name:"); - GtkWidget *input = gtk_entry_new (); - GtkBox *hbox = GTK_BOX (gtk_hbox_new (FALSE, 5)); - gtk_box_pack_start (hbox, label2, FALSE, TRUE, 0); - gtk_box_pack_start (hbox, input, TRUE, TRUE, 0); - gtk_box_pack_start (content, label1, TRUE, TRUE, 5); - gtk_box_pack_start (content, GTK_WIDGET (hbox), TRUE, TRUE, 5); - gtk_widget_show_all (GTK_WIDGET (content)); - gint response = gtk_dialog_run (GTK_DIALOG (dialog)); - while (response == GTK_RESPONSE_ACCEPT) { - response = GTK_RESPONSE_NONE; - NSDictionary *shapeDict = [Shape shapeDictionary]; - const gchar *dialogInput = gtk_entry_get_text (GTK_ENTRY (input)); - NSString *shapeName = [NSString stringWithUTF8String:dialogInput]; - BOOL doSave = NO; - if ([shapeName isEqual:@""]) { - GtkWidget *emptyStrDialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "You must specify a shape name"); - gtk_dialog_run (GTK_DIALOG (emptyStrDialog)); - gtk_widget_destroy (emptyStrDialog); - response = gtk_dialog_run (GTK_DIALOG (dialog)); - } else if ([shapeDict objectForKey:shapeName] != nil) { - GtkWidget *overwriteDialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_YES_NO, - "Do you want to replace the existing shape named '%s'?", - dialogInput); - gint overwriteResp = gtk_dialog_run (GTK_DIALOG (overwriteDialog)); - gtk_widget_destroy (overwriteDialog); - - if (overwriteResp == GTK_RESPONSE_YES) { - doSave = YES; - } else { - response = gtk_dialog_run (GTK_DIALOG (dialog)); - } - } else { - doSave = YES; - } - if (doSave) { - NSError *error = nil; - NSString *userShapeDir = [[SupportDir userSupportDir] stringByAppendingPathComponent:@"shapes"]; - NSString *file = [NSString stringWithFormat:@"%@/%@.tikz", userShapeDir, shapeName]; - if (![[NSFileManager defaultManager] ensureDirectoryExists:userShapeDir error:&error]) { - [self presentError:error withMessage:@"Could not create user shape directory"]; - } else { - if (![document saveCopyToPath:file error:&error]) { - [self presentError:error withMessage:@"Could not save shape file"]; - } else { - [Shape refreshShapeDictionary]; - } - } - } - } - gtk_widget_destroy (dialog); -} - -- (void) close { - if ([self _askCanClose]) { - gtk_widget_destroy (GTK_WIDGET (window)); - } -} - -- (void) selectionCutToClipboard { - if ([[[document pickSupport] selectedNodes] count] > 0) { - [self _placeGraphOnClipboard:[document selectionCut]]; - } -} - -- (void) selectionCopyToClipboard { - if ([[[document pickSupport] selectedNodes] count] > 0) { - [self _placeGraphOnClipboard:[document selectionCopy]]; - } -} - -- (void) pasteFromClipboard { - gtk_clipboard_request_contents (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), - tikzit_picture_atom, - clipboard_paste_contents, - document); -} - -- (GtkWindow*) gtkWindow { - return window; -} - -- (Configuration*) mainConfiguration { - return [app mainConfiguration]; -} - -- (Menu*) menu { - return menu; -} - -- (void) presentError:(NSError*)error { - const gchar *errorDesc = "unknown error"; - if (error && [error localizedDescription]) { - errorDesc = [[error localizedDescription] UTF8String]; - } - GtkWidget *dialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s", - errorDesc); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -- (void) presentError:(NSError*)error withMessage:(NSString*)message { - const gchar *errorDesc = "unknown error"; - if (error && [error localizedDescription]) { - errorDesc = [[error localizedDescription] UTF8String]; - } - GtkWidget *dialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s: %s", - [message UTF8String], - errorDesc); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -- (void) presentGError:(GError*)error { - const gchar *errorDesc = "unknown error"; - if (error && error->message) { - errorDesc = error->message; - } - GtkWidget *dialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s", - errorDesc); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -- (void) presentGError:(GError*)error withMessage:(NSString*)message { - const gchar *errorDesc = "unknown error"; - if (error && error->message) { - errorDesc = error->message; - } - GtkWidget *dialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s: %s", - [message UTF8String], - errorDesc); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -- (void) setActiveTool:(id)tool { - [graphPanel setActiveTool:tool]; - gboolean hasfocus; - g_object_get (G_OBJECT (window), "has-toplevel-focus", &hasfocus, NULL); - if (hasfocus) { - [graphPanel grabTool]; - } -} - -- (void) zoomIn { - [graphPanel zoomIn]; -} - -- (void) zoomOut { - [graphPanel zoomOut]; -} - -- (void) zoomReset { - [graphPanel zoomReset]; -} - -- (void) presentPreview { -#ifdef HAVE_POPPLER - if (previewWindow == nil) { - previewWindow = [[PreviewWindow alloc] initWithPreambles:[app preambles] - config:[app mainConfiguration]]; - //[previewWindow setParentWindow:self]; - [previewWindow setDocument:document]; - } - [previewWindow present]; -#endif -} - -- (void) updatePreview { -#ifdef HAVE_POPPLER - if (previewWindow == nil) { - previewWindow = [[PreviewWindow alloc] initWithPreambles:[app preambles] - config:[app mainConfiguration]]; - //[previewWindow setParentWindow:self]; - [previewWindow setDocument:document]; - } - [previewWindow show]; -#endif -} - -@end - -// }}} -// {{{ Notifications - -@implementation Window (Notifications) -- (void) graphHeightChanged:(int)newHeight { - [[app mainConfiguration] setIntegerEntry:@"graphHeight" - inGroup:@"window" - value:newHeight]; -} - -- (void) tikzBufferChanged { - if (!suppressTikzUpdates) { - suppressTikzUpdates = TRUE; - - GtkTextIter start, end; - gtk_text_buffer_get_bounds (tikzBuffer, &start, &end); - gchar *text = gtk_text_buffer_get_text (tikzBuffer, &start, &end, FALSE); - - NSError *error = nil; - BOOL success = [document updateTikz:[NSString stringWithUTF8String:text] error:&error]; - if (success) - [self _clearParseError]; - else - [self _setParseError:error]; - - g_free (text); - - suppressTikzUpdates = FALSE; - } -} - -- (void) windowSizeChangedWidth:(int)width height:(int)height { - if (width > 0 && height > 0) { - NSNumber *w = [NSNumber numberWithInt:width]; - NSNumber *h = [NSNumber numberWithInt:height]; - NSMutableArray *size = [NSMutableArray arrayWithCapacity:2]; - [size addObject:w]; - [size addObject:h]; - [[app mainConfiguration] setIntegerListEntry:@"windowSize" - inGroup:@"window" - value:size]; - } -} - -- (void) documentTikzChanged:(NSNotification*)notification { - [self _updateTitle]; - [self _updateTikz]; -} - -- (void) documentSelectionChanged:(NSNotification*)notification { - [self _updateStatus]; - [menu notifySelectionChanged:[document pickSupport]]; -} - -- (void) undoStackChanged:(NSNotification*)notification { - [self _updateUndoActions]; -} -@end - -// }}} -// {{{ InitHelpers - -@implementation Window (InitHelpers) - -- (void) _loadUi { - window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - g_object_ref_sink (window); - gtk_window_set_title (window, "TikZiT"); - gtk_window_set_default_size (window, 700, 400); - - GtkBox *mainLayout = GTK_BOX (gtk_vbox_new (FALSE, 0)); - gtk_widget_show (GTK_WIDGET (mainLayout)); - gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (mainLayout)); - - menu = [[Menu alloc] initForWindow:self]; - - GtkWidget *menubar = [menu menubar]; - gtk_box_pack_start (mainLayout, menubar, FALSE, TRUE, 0); - gtk_box_reorder_child (mainLayout, menubar, 0); - gtk_widget_show (menubar); - - tikzPaneSplitter = GTK_PANED (gtk_vpaned_new ()); - g_object_ref_sink (tikzPaneSplitter); - gtk_widget_show (GTK_WIDGET (tikzPaneSplitter)); - gtk_box_pack_start (mainLayout, GTK_WIDGET (tikzPaneSplitter), TRUE, TRUE, 0); - - graphPanel = [[GraphEditorPanel alloc] initWithDocument:document]; - [graphPanel setPreviewHandler:self]; - GtkWidget *graphEditorWidget = [graphPanel widget]; - gtk_widget_show (graphEditorWidget); - GtkWidget *graphFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (graphFrame), graphEditorWidget); - gtk_widget_show (graphFrame); - gtk_paned_pack1 (tikzPaneSplitter, graphFrame, TRUE, TRUE); - - tikzBuffer = gtk_text_buffer_new (NULL); - g_object_ref_sink (tikzBuffer); - errorHighlightTag = gtk_text_buffer_create_tag ( - tikzBuffer, NULL, - "foreground", "#d40000", - "foreground-set", TRUE, - "weight", PANGO_WEIGHT_SEMIBOLD, - "weight-set", TRUE, - NULL); - GtkWidget *tikzScroller = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (tikzScroller); - - tikzPane = gtk_text_view_new_with_buffer (tikzBuffer); - gtk_text_view_set_left_margin (GTK_TEXT_VIEW (tikzPane), 3); - gtk_text_view_set_right_margin (GTK_TEXT_VIEW (tikzPane), 3); - g_object_ref_sink (tikzPane); - gtk_widget_show (tikzPane); - gtk_container_add (GTK_CONTAINER (tikzScroller), tikzPane); - GtkWidget *tikzFrame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (tikzFrame), tikzScroller); - gtk_widget_show (tikzFrame); - gtk_paned_pack2 (tikzPaneSplitter, tikzFrame, FALSE, TRUE); - - statusBar = GTK_STATUSBAR (gtk_statusbar_new ()); - g_object_ref_sink (statusBar); - gtk_widget_show (GTK_WIDGET (statusBar)); - gtk_box_pack_start (mainLayout, GTK_WIDGET (statusBar), FALSE, TRUE, 0); - - GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); - update_paste_action (clipboard, NULL, [menu pasteAction]); -} - -- (void) _restoreUiState { - Configuration *config = [app mainConfiguration]; - NSArray *windowSize = [config integerListEntry:@"windowSize" - inGroup:@"window"]; - if (windowSize && [windowSize count] == 2) { - gint width = [[windowSize objectAtIndex:0] intValue]; - gint height = [[windowSize objectAtIndex:1] intValue]; - if (width > 0 && height > 0) { - gtk_window_set_default_size (window, width, height); - } - } - int panePos = [config integerEntry:@"graphHeight" - inGroup:@"window"]; - if (panePos > 0) { - gtk_paned_set_position (tikzPaneSplitter, panePos); - } -} - -- (void) _connectSignals { - GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); - clipboard_handler_id = - g_signal_connect (G_OBJECT (clipboard), - "owner-change", - G_CALLBACK (update_paste_action), - [menu pasteAction]); - g_signal_connect (G_OBJECT (window), - "key-press-event", - G_CALLBACK (tz_hijack_key_press), - NULL); - g_signal_connect (G_OBJECT (window), - "notify::has-toplevel-focus", - G_CALLBACK (window_toplevel_focus_changed_cb), - self); - g_signal_connect (G_OBJECT (tikzPaneSplitter), - "notify::position", - G_CALLBACK (graph_divider_position_changed_cb), - self); - g_signal_connect (G_OBJECT (tikzBuffer), - "changed", - G_CALLBACK (tikz_buffer_changed_cb), - self); - g_signal_connect (G_OBJECT (window), - "delete-event", - G_CALLBACK (main_window_delete_event_cb), - self); - g_signal_connect (G_OBJECT (window), - "destroy", - G_CALLBACK (main_window_destroy_cb), - self); - g_signal_connect (G_OBJECT (window), - "configure-event", - G_CALLBACK (main_window_configure_event_cb), - self); -} -@end - -// }}} -// {{{ Private - -@implementation Window (Private) - -- (BOOL) _askCanClose { - if ([document hasUnsavedChanges]) { - GtkWidget *dialog = gtk_message_dialog_new (window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - "Save changes to the document \"%s\" before closing?", - [[document name] UTF8String]); - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - "Save", GTK_RESPONSE_YES, - "Don't save", GTK_RESPONSE_NO, - "Cancel", GTK_RESPONSE_CANCEL, - NULL); - gint result = gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - if (result == GTK_RESPONSE_YES) { - return [self saveActiveDocument]; - } else { - return result == GTK_RESPONSE_NO; - } - } else { - return YES; - } -} - -- (TikzDocument*) _openDocument:(NSString*)path { - NSError *error = nil; - TikzDocument *d = [TikzDocument documentFromFile:path - styleManager:[app styleManager] - error:&error]; - if (d != nil) { - return d; - } else { - if ([error code] == TZ_ERR_PARSE) { - [self presentError:error withMessage:@"Invalid file"]; - } else { - [self presentError:error withMessage:@"Could not open file"]; - } - [[RecentManager defaultManager] removeRecentFile:path]; - return nil; - } -} - -- (void) _placeGraphOnClipboard:(Graph*)graph { - GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); - - static const GtkTargetEntry targets[] = { - { "TIKZITPICTURE", 0, TARGET_TIKZIT_PICTURE }, - { "UTF8_STRING", 0, TARGET_UTF8_STRING } }; - - gtk_clipboard_set_with_data (clipboard, - targets, G_N_ELEMENTS (targets), - clipboard_provide_data, - clipboard_release_data, - clipboard_graph_data_new (graph)); -} - -- (void) _clearParseError { - if (!hasParseError) - return; - gtk_statusbar_pop (statusBar, ParseStatus); - text_buffer_clear_tag (tikzBuffer, errorHighlightTag); - widget_clear_error (tikzPane); - hasParseError = NO; -} - -- (void) _setParseError:(NSError*)error { - if (!hasParseError) { - widget_set_error (tikzPane); - hasParseError = YES; - } - NSString *message = [NSString stringWithFormat:@"Parse error: %@", [error localizedDescription]]; - gtk_statusbar_pop (statusBar, ParseStatus); - gtk_statusbar_push (statusBar, ParseStatus, [message UTF8String]); - - text_buffer_clear_tag (tikzBuffer, errorHighlightTag); - - NSDictionary *errorInfo = [error userInfo]; - if ([errorInfo objectForKey:@"startLine"] != nil) { - GtkTextIter symbolStart; - GtkTextIter symbolEnd; - gtk_text_buffer_get_iter_at_line_index (tikzBuffer, &symbolStart, - [[errorInfo objectForKey:@"startLine"] intValue] - 1, - [[errorInfo objectForKey:@"startColumn"] intValue] - 1); - gtk_text_buffer_get_iter_at_line_index (tikzBuffer, &symbolEnd, - [[errorInfo objectForKey:@"endLine"] intValue] - 1, - [[errorInfo objectForKey:@"endColumn"] intValue]); - gtk_text_buffer_apply_tag (tikzBuffer, errorHighlightTag, - &symbolStart, &symbolEnd); - } -} - -- (void) _updateUndoActions { - [menu setUndoActionEnabled:[document canUndo]]; - [menu setUndoActionDetail:[document undoName]]; - - [menu setRedoActionEnabled:[document canRedo]]; - [menu setRedoActionDetail:[document redoName]]; -} - -- (void) _updateTitle { - NSString *title = [NSString stringWithFormat:@"TikZiT - %@%s", - [document name], - ([document hasUnsavedChanges] ? "*" : "")]; - gtk_window_set_title(window, [title UTF8String]); -} - -- (void) _updateStatus { - // FIXME: show tooltips or something instead - GString *buffer = g_string_sized_new (30); - gchar *nextNode = 0; - - for (Node *n in [[document pickSupport] selectedNodes]) { - if (nextNode) { - if (buffer->len == 0) { - g_string_printf(buffer, "Nodes %s", nextNode); - } else { - g_string_append_printf(buffer, ", %s", nextNode); - } - } - nextNode = (gchar *)[[n name] UTF8String]; - } - if (nextNode) { - if (buffer->len == 0) { - g_string_printf(buffer, "Node %s is selected", nextNode); - } else { - g_string_append_printf(buffer, " and %s are selected", nextNode); - } - } - - if (buffer->len == 0) { - int nrNodes = [[[document graph] nodes] count]; - int nrEdges = [[[document graph] edges] count]; - g_string_printf(buffer, "Graph has %d node%s and %d edge%s", - nrNodes, - nrNodes!=1 ? "s" : "", - nrEdges, - nrEdges!=1 ? "s" : ""); - } - gtk_statusbar_pop(statusBar, GraphInfoStatus); - gtk_statusbar_push(statusBar, GraphInfoStatus, buffer->str); - - g_string_free (buffer, TRUE); -} - -- (void) _updateTikz { - if (document != nil && !suppressTikzUpdates) { - suppressTikzUpdates = TRUE; - - if (document != nil) { - const char *tikzString = [[document tikz] UTF8String]; - gtk_text_buffer_set_text (tikzBuffer, tikzString, -1); - } else { - gtk_text_buffer_set_text (tikzBuffer, "", -1); - } - [self _clearParseError]; - - suppressTikzUpdates = FALSE; - } -} - -- (GraphEditorPanel*) _graphPanel { - return graphPanel; -} - -- (void) showPreview { - [self updatePreview]; -} - -@end - -// }}} -// {{{ GTK+ callbacks - -static void window_toplevel_focus_changed_cb (GObject *gobject, GParamSpec *pspec, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - gboolean hasfocus; - g_object_get (gobject, "has-toplevel-focus", &hasfocus, NULL); - if (hasfocus) { - [[NSNotificationCenter defaultCenter] - postNotificationName:@"WindowGainedFocus" - object:window]; - [[window _graphPanel] grabTool]; - } else { - [[NSNotificationCenter defaultCenter] - postNotificationName:@"WindowLostFocus" - object:window]; - } - [pool drain]; -} - -static void graph_divider_position_changed_cb (GObject *gobject, GParamSpec *pspec, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - gint position; - g_object_get (gobject, "position", &position, NULL); - [window graphHeightChanged:position]; - [pool drain]; -} - -static void tikz_buffer_changed_cb (GtkTextBuffer *buffer, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window tikzBufferChanged]; - [pool drain]; -} - -static gboolean main_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window close]; - [pool drain]; - return TRUE; -} - -static void main_window_destroy_cb (GtkWidget *widget, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"WindowClosed" - object:window]; - [pool drain]; -} - -static gboolean main_window_configure_event_cb (GtkWidget *widget, GdkEventConfigure *event, Window *window) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [window windowSizeChangedWidth:event->width height:event->height]; - [pool drain]; - return FALSE; -} - -static void clipboard_provide_data (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - guint info, - gpointer clipboard_graph_data) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - ClipboardGraphData *data = (ClipboardGraphData*)clipboard_graph_data; - if (info == TARGET_UTF8_STRING || info == TARGET_TIKZIT_PICTURE) { - clipboard_graph_data_convert (data); - GdkAtom target = (info == TARGET_UTF8_STRING) ? utf8_atom : tikzit_picture_atom; - gtk_selection_data_set (selection_data, - target, - 8*sizeof(gchar), - (guchar*)data->tikz, - data->tikz_length); - } - - [pool drain]; -} - -static void clipboard_release_data (GtkClipboard *clipboard, gpointer data) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - clipboard_graph_data_free ((ClipboardGraphData*)data); - [pool drain]; -} - -static void clipboard_check_targets (GtkClipboard *clipboard, - GdkAtom *atoms, - gint n_atoms, - gpointer action) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - gboolean found = FALSE; - for (gint i = 0; i < n_atoms; ++i) { - if (atoms[i] == tikzit_picture_atom) { - found = TRUE; - break; - } - } - gtk_action_set_sensitive (GTK_ACTION (action), found); - - [pool drain]; -} - -static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAction *action) { - gtk_action_set_sensitive (action, FALSE); - gtk_clipboard_request_targets (clipboard, clipboard_check_targets, action); -} - -static void clipboard_paste_contents (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - gpointer document) { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - - TikzDocument *doc = (TikzDocument*)document; - gint length = gtk_selection_data_get_length (selection_data); - if (length >= 0) { - const guchar *raw_data = gtk_selection_data_get_data (selection_data); - gchar *data = g_new (gchar, length+1); - g_strlcpy (data, (const gchar *)raw_data, length+1); - NSString *tikz = [NSString stringWithUTF8String:data]; - if (tikz != nil) { - [doc pasteFromTikz:tikz]; - } - g_free (data); - } - - [pool drain]; -} - -// }}} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/cairo_helpers.h b/tikzit-old/src/gtk/cairo_helpers.h deleted file mode 100644 index e95357b..0000000 --- a/tikzit-old/src/gtk/cairo_helpers.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import "RColor.h" -#import - -void cairo_ns_rectangle (cairo_t* cr, NSRect rect); -void cairo_set_source_rcolor (cairo_t* cr, RColor color); - -// vim:ft=objc:sts=4:sw=4:et diff --git a/tikzit-old/src/gtk/cairo_helpers.m b/tikzit-old/src/gtk/cairo_helpers.m deleted file mode 100644 index 104e686..0000000 --- a/tikzit-old/src/gtk/cairo_helpers.m +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "cairo_helpers.h" - -void cairo_ns_rectangle (cairo_t* cr, NSRect rect) { - cairo_rectangle (cr, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); -} - -void cairo_set_source_rcolor (cairo_t* cr, RColor color) { - cairo_set_source_rgba (cr, color.red, color.green, color.blue, color.alpha); -} - -// vim:ft=objc:sts=4:sw=4:et diff --git a/tikzit-old/src/gtk/clipboard.h b/tikzit-old/src/gtk/clipboard.h deleted file mode 100644 index 568fc50..0000000 --- a/tikzit-old/src/gtk/clipboard.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "TZFoundation.h" -#import -#import - -enum { - TARGET_UTF8_STRING, - TARGET_TIKZIT_PICTURE -}; -typedef struct -{ - Graph *graph; - gchar *tikz; - gint tikz_length; -} ClipboardGraphData; - -extern GdkAtom utf8_atom; -extern GdkAtom tikzit_picture_atom; - -void clipboard_init (); -ClipboardGraphData *clipboard_graph_data_new (Graph *graph); -void clipboard_graph_data_free (ClipboardGraphData *data); -void clipboard_graph_data_convert (ClipboardGraphData *data); - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/clipboard.m b/tikzit-old/src/gtk/clipboard.m deleted file mode 100644 index 7001717..0000000 --- a/tikzit-old/src/gtk/clipboard.m +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "clipboard.h" - -GdkAtom utf8_atom; -GdkAtom tikzit_picture_atom; - -void clipboard_init () { - if (utf8_atom == GDK_NONE) { - utf8_atom = gdk_atom_intern ("UTF8_STRING", FALSE); - } - if (tikzit_picture_atom == GDK_NONE) { - tikzit_picture_atom = gdk_atom_intern ("TIKZITPICTURE", FALSE); - } -} - -ClipboardGraphData *clipboard_graph_data_new (Graph *graph) { - ClipboardGraphData *data = g_new (ClipboardGraphData, 1); - data->graph = [graph retain]; - data->tikz = NULL; - data->tikz_length = 0; - return data; -} - -void clipboard_graph_data_free (ClipboardGraphData *data) { - [data->graph release]; - if (data->tikz) { - g_free (data->tikz); - } - g_free (data); -} - -void clipboard_graph_data_convert (ClipboardGraphData *data) { - if (data->graph != nil && !data->tikz) { - data->tikz = g_strdup ([[data->graph tikz] UTF8String]); - data->tikz_length = strlen (data->tikz); - [data->graph release]; - data->graph = nil; - } -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/gtkhelpers.h b/tikzit-old/src/gtk/gtkhelpers.h deleted file mode 100644 index e4b79b8..0000000 --- a/tikzit-old/src/gtk/gtkhelpers.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// gtkhelpers.h -// TikZiT -// -// Copyright 2010 Alex Merry. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "TZFoundation.h" -#include -#import - -/** - * Releases the Objective-C object pointed to by data - * - * Intended for use as a cleanup function in Glib/GObject-based - * code. - */ -void release_obj (gpointer data); - -NSString * gtk_editable_get_string (GtkEditable *editable, gint start, gint end); - -GdkRectangle gdk_rectangle_from_ns_rect (NSRect rect); -NSRect gdk_rectangle_to_ns_rect (GdkRectangle rect); - -void gtk_action_set_detailed_label (GtkAction *action, const gchar *baseLabel, const gchar *actionName); - -gint tz_hijack_key_press (GtkWindow *win, - GdkEventKey *event, - gpointer user_data); - -// Equivalent of GTK+3's gdk_pixbuf_get_from_surface() -GdkPixbuf * pixbuf_get_from_surface(cairo_surface_t *surface); - -void tz_restore_window (GtkWindow *window, gint x, gint y, gint w, gint h); - -void label_set_bold (GtkLabel *label); - -void widget_set_error (GtkWidget *widget); -void widget_clear_error (GtkWidget *widget); - -void text_buffer_clear_tag (GtkTextBuffer *buffer, GtkTextTag *tag); - -void utility_window_attach (GtkWindow *util_win, GtkWindow *parent_win); - -// vim:ft=objc:sts=2:sw=2:et diff --git a/tikzit-old/src/gtk/gtkhelpers.m b/tikzit-old/src/gtk/gtkhelpers.m deleted file mode 100644 index 9d26af5..0000000 --- a/tikzit-old/src/gtk/gtkhelpers.m +++ /dev/null @@ -1,275 +0,0 @@ -// -// gtkhelpers.h -// TikZiT -// -// Copyright 2010 Alex Merry. All rights reserved. -// -// Some code from Glade: -// Copyright 2001 Ximian, Inc. -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "gtkhelpers.h" -#import - -void release_obj (gpointer data) { - id obj = (id)data; - [obj release]; -} - -NSString * gtk_editable_get_string (GtkEditable *editable, gint start, gint end) -{ - gchar *text = gtk_editable_get_chars (editable, start, end); - NSString *string = [NSString stringWithUTF8String:text]; - g_free (text); - return string; -} - -GdkRectangle gdk_rectangle_from_ns_rect (NSRect box) { - GdkRectangle rect; - rect.x = box.origin.x; - rect.y = box.origin.y; - rect.width = box.size.width; - rect.height = box.size.height; - return rect; -} - -NSRect gdk_rectangle_to_ns_rect (GdkRectangle rect) { - NSRect result; - result.origin.x = rect.x; - result.origin.y = rect.y; - result.size.width = rect.width; - result.size.height = rect.height; - return result; -} - -void gtk_action_set_detailed_label (GtkAction *action, const gchar *baseLabel, const gchar *actionName) { - if (actionName == NULL || *actionName == '\0') { - gtk_action_set_label (action, baseLabel); - } else { - GString *label = g_string_sized_new (30); - g_string_printf(label, "%s: %s", baseLabel, actionName); - gtk_action_set_label (action, label->str); - g_string_free (label, TRUE); - } -} - -/** - * tz_hijack_key_press: - * @win: a #GtkWindow - * event: the GdkEventKey - * user_data: unused - * - * This function is meant to be attached to key-press-event of a toplevel, - * it simply allows the window contents to treat key events /before/ - * accelerator keys come into play (this way widgets dont get deleted - * when cutting text in an entry etc.). - * - * Returns: whether the event was handled - */ -gint -tz_hijack_key_press (GtkWindow *win, - GdkEventKey *event, - gpointer user_data) -{ - GtkWidget *focus_widget; - - focus_widget = gtk_window_get_focus (win); - if (focus_widget && - (event->keyval == GDK_Delete || /* Filter Delete from accelerator keys */ - ((event->state & GDK_CONTROL_MASK) && /* CTRL keys... */ - ((event->keyval == GDK_c || event->keyval == GDK_C) || /* CTRL-C (copy) */ - (event->keyval == GDK_x || event->keyval == GDK_X) || /* CTRL-X (cut) */ - (event->keyval == GDK_v || event->keyval == GDK_V) || /* CTRL-V (paste) */ - (event->keyval == GDK_a || event->keyval == GDK_A) || /* CTRL-A (select-all) */ - (event->keyval == GDK_n || event->keyval == GDK_N))))) /* CTRL-N (new document) ?? */ - { - return gtk_widget_event (focus_widget, - (GdkEvent *)event); - } - return FALSE; -} - -GdkPixbuf * pixbuf_get_from_surface(cairo_surface_t *surface) { - cairo_surface_flush (surface); - - int width = cairo_image_surface_get_width (surface); - int height = cairo_image_surface_get_height (surface); - int stride = cairo_image_surface_get_stride (surface); - unsigned char *data = cairo_image_surface_get_data (surface); - - GdkPixbuf *pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, - TRUE, - 8, - width, - height); - unsigned char *pbdata = gdk_pixbuf_get_pixels (pixbuf); - int pbstride = gdk_pixbuf_get_rowstride (pixbuf); - - for (int y = 0; y < height; ++y) { - uint32_t *line = (uint32_t*)(data + y*stride); - unsigned char *pbline = pbdata + (y*pbstride); - for (int x = 0; x < width; ++x) { - uint32_t pixel = *(line + x); - unsigned char *pbpixel = pbline + (x*4); - // NB: We should un-pre-mult the alpha here. - // However, in our world, alpha is always - // on or off, so it doesn't really matter - pbpixel[3] = ((pixel & 0xff000000) >> 24); - pbpixel[0] = ((pixel & 0x00ff0000) >> 16); - pbpixel[1] = ((pixel & 0x0000ff00) >> 8); - pbpixel[2] = (pixel & 0x000000ff); - } - } - - return pixbuf; -} - -/* This function mostly lifted from - * gtk+/gdk/gdkscreen.c:gdk_screen_get_monitor_at_window() - */ -static gint -get_appropriate_monitor (GdkScreen *screen, - gint x, - gint y, - gint w, - gint h) -{ - GdkRectangle rect; - gint area = 0; - gint monitor = -1; - gint num_monitors; - gint i; - - rect.x = x; - rect.y = y; - rect.width = w; - rect.height = h; - - num_monitors = gdk_screen_get_n_monitors (screen); - - for (i = 0; i < num_monitors; i++) - { - GdkRectangle geometry; - - gdk_screen_get_monitor_geometry (screen, i, &geometry); - - if (gdk_rectangle_intersect (&rect, &geometry, &geometry) && - geometry.width * geometry.height > area) - { - area = geometry.width * geometry.height; - monitor = i; - } - } - - if (monitor >= 0) - return monitor; - else - return gdk_screen_get_monitor_at_point (screen, - rect.x + rect.width / 2, - rect.y + rect.height / 2); -} - -/* This function mostly lifted from gimp_session_info_apply_geometry - * in gimp-2.6/app/widgets/gimpsessioninfo.c - */ -void tz_restore_window (GtkWindow *window, gint x, gint y, gint w, gint h) -{ - gint forced_w = w; - gint forced_h = h; - if (w <= 0 || h <= 0) { - gtk_window_get_default_size (window, &w, &h); - } - if (w <= 0 || h <= 0) { - gtk_window_get_size (window, &w, &h); - } - - GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (window)); - - gint monitor = 0; - if (w > 0 && h > 0) { - monitor = get_appropriate_monitor (screen, x, y, w, h); - } else { - monitor = gdk_screen_get_monitor_at_point (screen, x, y); - } - - GdkRectangle rect; - gdk_screen_get_monitor_geometry (screen, monitor, &rect); - - x = CLAMP (x, - rect.x, - rect.x + rect.width - (w > 0 ? w : 128)); - y = CLAMP (y, - rect.y, - rect.y + rect.height - (h > 0 ? h : 128)); - - gchar geom[32]; - g_snprintf (geom, sizeof (geom), "%+d%+d", x, y); - - gtk_window_parse_geometry (window, geom); - - if (forced_w > 0 && forced_h > 0) { - gtk_window_set_default_size (window, forced_w, forced_h); - } -} - -void label_set_bold (GtkLabel *label) { - PangoAttrList *attrs = pango_attr_list_new (); - pango_attr_list_insert (attrs, - pango_attr_weight_new (PANGO_WEIGHT_SEMIBOLD)); - gtk_label_set_attributes (label, attrs); - pango_attr_list_unref (attrs); -} - -void widget_set_error (GtkWidget *widget) { - GdkColor color = {0, 65535, 61184, 61184}; - gtk_widget_modify_base (widget, GTK_STATE_NORMAL, &color); -} - -void widget_clear_error (GtkWidget *widget) { - gtk_widget_modify_base (widget, GTK_STATE_NORMAL, NULL); -} - -void text_buffer_clear_tag (GtkTextBuffer *buffer, GtkTextTag *tag) { - GtkTextIter start; - GtkTextIter end; - gtk_text_buffer_get_start_iter (buffer, &start); - gtk_text_buffer_get_end_iter (buffer, &end); - gtk_text_buffer_remove_tag (buffer, tag, &start, &end); -} - -void utility_window_attach (GtkWindow *util_win, GtkWindow *parent_win) { - if (parent_win == gtk_window_get_transient_for (util_win)) - return; - - // HACK: X window managers tend to move windows around when they are - // unmapped and mapped again, so we save the position - gint x, y; - gtk_window_get_position (util_win, &x, &y); - - // HACK: Altering WM_TRANSIENT_FOR on a non-hidden but unmapped window - // (eg: when you have minimised the original parent window) can - // cause the window to be lost forever, so we hide it first - gtk_widget_hide (GTK_WIDGET (util_win)); - gtk_window_set_focus_on_map (util_win, FALSE); - gtk_window_set_transient_for (util_win, parent_win); - gtk_widget_show (GTK_WIDGET (util_win)); - - // HACK: see above - gtk_window_move (util_win, x, y); -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/logo.h b/tikzit-old/src/gtk/logo.h deleted file mode 100644 index e778da9..0000000 --- a/tikzit-old/src/gtk/logo.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -typedef enum { - LOGO_SIZE_16, - LOGO_SIZE_24, - LOGO_SIZE_32, - LOGO_SIZE_48, - LOGO_SIZE_64, - LOGO_SIZE_128, - LOGO_SIZE_COUNT -} LogoSize; - -GdkPixbuf *get_logo (LogoSize size); - -// vim:ft=objc:ts=8:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/logo.m b/tikzit-old/src/gtk/logo.m deleted file mode 100644 index 57533c7..0000000 --- a/tikzit-old/src/gtk/logo.m +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import "logo.h" -#include - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-sign" -#import "logodata.m" -#pragma GCC diagnostic pop - -static GdkPixbuf *pixbufCache[LOGO_SIZE_COUNT]; - -GdkPixbuf *get_logo (LogoSize size) { - const GdkPixdata *data = NULL; - switch (size) { - case LOGO_SIZE_16: - data = &logo16; - break; - case LOGO_SIZE_24: - data = &logo24; - break; - case LOGO_SIZE_32: - data = &logo32; - break; - case LOGO_SIZE_48: - data = &logo48; - break; - case LOGO_SIZE_64: - data = &logo64; - break; - case LOGO_SIZE_128: - data = &logo128; - break; - default: - return NULL; - }; - if (pixbufCache[size]) { - g_object_ref (pixbufCache[size]); - return pixbufCache[size]; - } else { - GdkPixbuf *buf = gdk_pixbuf_from_pixdata (data, FALSE, NULL); - pixbufCache[size] = buf; - g_object_add_weak_pointer (G_OBJECT (buf), (void**)(&(pixbufCache[size]))); - return buf; - } -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4 - diff --git a/tikzit-old/src/gtk/main.m b/tikzit-old/src/gtk/main.m deleted file mode 100644 index 5d9f4a4..0000000 --- a/tikzit-old/src/gtk/main.m +++ /dev/null @@ -1,111 +0,0 @@ -// -// main.m -// TikZiT -// -// Copyright 2010 Chris Heunen. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TZFoundation.h" -#import -#import "clipboard.h" -#import "logo.h" -#import "tzstockitems.h" - -#import "Application.h" - -static GOptionEntry entries[] = -{ - //{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL }, - { NULL } -}; - -void onUncaughtException(NSException* exception) -{ - NSString *joinStr = @"\n "; - NSLog(@"uncaught exception: %@\n backtrace: %@", - [exception description], - [[exception callStackSymbols] componentsJoinedByString:joinStr]); -} - -int main (int argc, char *argv[]) { - NSSetUncaughtExceptionHandler(&onUncaughtException); - - [[NSAutoreleasePool alloc] init]; - - GError *error = NULL; - GOptionContext *context; - context = g_option_context_new ("[FILES] - PGF/TikZ-based graph editor"); - g_option_context_add_main_entries (context, entries, NULL); - g_option_context_add_group (context, gtk_get_option_group (TRUE)); - if (!g_option_context_parse (context, &argc, &argv, &error)) - { - if (error->domain == G_OPTION_ERROR) { - g_print ("%s\nUse --help to see available options\n", error->message); - } else { - g_print ("Unexpected error parsing options: %s\n", error->message); - } - exit (1); - } - g_option_context_free (context); - -#ifndef WINDOWS - GList *icon_list = NULL; - icon_list = g_list_prepend (icon_list, get_logo(LOGO_SIZE_128)); - icon_list = g_list_prepend (icon_list, get_logo(LOGO_SIZE_64)); - icon_list = g_list_prepend (icon_list, get_logo(LOGO_SIZE_48)); - icon_list = g_list_prepend (icon_list, get_logo(LOGO_SIZE_32)); - icon_list = g_list_prepend (icon_list, get_logo(LOGO_SIZE_24)); - icon_list = g_list_prepend (icon_list, get_logo(LOGO_SIZE_16)); - gtk_window_set_default_icon_list (icon_list); - GList *list_head = icon_list; - while (list_head) { - g_object_unref ((GObject*)list_head->data); - list_head = list_head->next; - } -#endif - - NSAutoreleasePool *initPool = [[NSAutoreleasePool alloc] init]; - - tz_register_stock_items(); - clipboard_init(); - - Application *app = nil; - if (argc > 1) { - NSMutableArray *files = [NSMutableArray arrayWithCapacity:argc-1]; - for (int i = 1; i < argc; ++i) { - [files insertObject:[NSString stringWithGlibFilename:argv[i]] - atIndex:i-1]; - } - NSLog(@"Files: %@", files); - app = [[Application alloc] initWithFiles:files]; - } else { - app = [[Application alloc] init]; - } - - [initPool drain]; - - gtk_main (); - - [app saveConfiguration]; - [app release]; - - return 0; -} - -// vim:ft=objc:et:sts=4:sw=4 diff --git a/tikzit-old/src/gtk/mkdtemp.h b/tikzit-old/src/gtk/mkdtemp.h deleted file mode 100644 index 65ee99e..0000000 --- a/tikzit-old/src/gtk/mkdtemp.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Creating a private temporary directory. - Copyright (C) 2001-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#if HAVE_MKDTEMP - -/* Get mkdtemp() declaration. */ -#include - -#else - -/* Create a unique temporary directory from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the directory name unique. - Returns TEMPLATE, or a null pointer if it cannot get a unique name. - The directory is created mode 700. */ -extern char * mkdtemp (char *template); - -#endif diff --git a/tikzit-old/src/gtk/mkdtemp.m b/tikzit-old/src/gtk/mkdtemp.m deleted file mode 100644 index ee3cd7c..0000000 --- a/tikzit-old/src/gtk/mkdtemp.m +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (C) 1999, 2001-2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - see . - */ - -/* Extracted from misc/mkdtemp.c and sysdeps/posix/tempname.c. */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -/* Specification. */ -#include "mkdtemp.h" - -#include -#ifndef __set_errno -# define __set_errno(Val) errno = (Val) -#endif - -#include -#include -#include - -#include -#ifndef TMP_MAX -# define TMP_MAX 238328 -#endif - -#if HAVE_STDINT_H || _LIBC -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif - -#if HAVE_UNISTD_H || _LIBC -# include -#endif - -#if HAVE_GETTIMEOFDAY || _LIBC -# if HAVE_SYS_TIME_H || _LIBC -# include -# endif -#else -# if HAVE_TIME_H || _LIBC -# include -# endif -#endif - -#include "stat.h" - -#ifdef __MINGW32__ -/* mingw's mkdir() function has 1 argument, but we pass 2 arguments. - Therefore we have to disable the argument count checking. */ -# define mkdir ((int (*)()) mkdir) -#endif - -#if !_LIBC -# define __getpid getpid -# define __gettimeofday gettimeofday -# define __mkdir mkdir -#endif - -/* Use the widest available unsigned type if uint64_t is not - available. The algorithm below extracts a number less than 62**6 - (approximately 2**35.725) from uint64_t, so ancient hosts where - uintmax_t is only 32 bits lose about 3.725 bits of randomness, - which is better than not having mkstemp at all. */ -#if !defined UINT64_MAX && !defined uint64_t -# define uint64_t uintmax_t -#endif - -/* These are the characters used in temporary filenames. */ -static const char letters[] = -"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - -/* Generate a temporary file name based on TMPL. TMPL must match the - rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed - does not exist at the time of the call to __gen_tempname. TMPL is - overwritten with the result. - - KIND is: - __GT_DIR: create a directory, which will be mode 0700. - - We use a clever algorithm to get hard-to-predict names. */ -static int -gen_tempname (char *tmpl) -{ - int len; - char *XXXXXX; - static uint64_t value; - uint64_t random_time_bits; - int count, fd = -1; - int save_errno = errno; - - len = strlen (tmpl); - if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) - { - __set_errno (EINVAL); - return -1; - } - - /* This is where the Xs start. */ - XXXXXX = &tmpl[len - 6]; - - /* Get some more or less random data. */ -#ifdef RANDOM_BITS - RANDOM_BITS (random_time_bits); -#else -# if HAVE_GETTIMEOFDAY || _LIBC - { - struct timeval tv; - __gettimeofday (&tv, NULL); - random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; - } -# else - random_time_bits = time (NULL); -# endif -#endif - value += random_time_bits ^ __getpid (); - - for (count = 0; count < TMP_MAX; value += 7777, ++count) - { - uint64_t v = value; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; - XXXXXX[5] = letters[v % 62]; - - fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR); - - if (fd >= 0) - { - __set_errno (save_errno); - return fd; - } - else if (errno != EEXIST) - return -1; - } - - /* We got out of the loop because we ran out of combinations to try. */ - __set_errno (EEXIST); - return -1; -} - -/* Generate a unique temporary directory from TEMPLATE. - The last six characters of TEMPLATE must be "XXXXXX"; - they are replaced with a string that makes the filename unique. - The directory is created, mode 700, and its name is returned. - (This function comes from OpenBSD.) */ -char * -mkdtemp (char *template) -{ - if (gen_tempname (template)) - return NULL; - else - return template; -} diff --git a/tikzit-old/src/gtk/stat.h b/tikzit-old/src/gtk/stat.h deleted file mode 100644 index a9829ae..0000000 --- a/tikzit-old/src/gtk/stat.h +++ /dev/null @@ -1,25 +0,0 @@ -#include -#if STAT_MACROS_BROKEN -# undef S_ISDIR -#endif -#if !defined S_ISDIR && defined S_IFDIR -# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) -#endif -#if !S_IRUSR && S_IREAD -# define S_IRUSR S_IREAD -#endif -#if !S_IRUSR -# define S_IRUSR 00400 -#endif -#if !S_IWUSR && S_IWRITE -# define S_IWUSR S_IWRITE -#endif -#if !S_IWUSR -# define S_IWUSR 00200 -#endif -#if !S_IXUSR && S_IEXEC -# define S_IXUSR S_IEXEC -#endif -#if !S_IXUSR -# define S_IXUSR 00100 -#endif diff --git a/tikzit-old/src/gtk/test/gtk.m b/tikzit-old/src/gtk/test/gtk.m deleted file mode 100644 index aabb0f2..0000000 --- a/tikzit-old/src/gtk/test/gtk.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// linux.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" - -void testGtk() { - -} diff --git a/tikzit-old/src/gtk/test/main.m b/tikzit-old/src/gtk/test/main.m deleted file mode 100644 index 639a335..0000000 --- a/tikzit-old/src/gtk/test/main.m +++ /dev/null @@ -1,50 +0,0 @@ -// -// main.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#include "config.h" -#import "test/test.h" -#include -void testCommon(); - -int main(int argc, char **argv) { - if (argc == 2 && strcmp(argv[1], "--disable-color")==0) { - setColorEnabled(NO); - } else { - setColorEnabled(YES); - } - - PUTS(@""); - PUTS(@"**********************************************"); - PUTS(@"TikZiT TESTS, LINUX VERSION %@", VERSION); - PUTS(@"**********************************************"); - PUTS(@""); - - startTests(); - testCommon(); - testLinux(); - - PUTS(@""); - PUTS(@"**********************************************"); - endTests(); - PUTS(@"**********************************************"); - PUTS(@""); -} diff --git a/tikzit-old/src/gtk/tzstockitems.h b/tikzit-old/src/gtk/tzstockitems.h deleted file mode 100644 index 5ad0da9..0000000 --- a/tikzit-old/src/gtk/tzstockitems.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#define TIKZIT_STOCK_SELECT "tikzit-select" -#define TIKZIT_STOCK_CREATE_NODE "tikzit-create-node" -#define TIKZIT_STOCK_CREATE_EDGE "tikzit-create-edge" -#define TIKZIT_STOCK_BOUNDING_BOX "tikzit-bounding-box" -#define TIKZIT_STOCK_DRAG "tikzit-drag" - -void tz_register_stock_items(); - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/tzstockitems.m b/tikzit-old/src/gtk/tzstockitems.m deleted file mode 100644 index 5eba912..0000000 --- a/tikzit-old/src/gtk/tzstockitems.m +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2012 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "tzstockitems.h" -#include -#include - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-sign" -#import "icondata.m" -#pragma GCC diagnostic pop - -static GtkStockItem stock_items[] = { - // gchar *stock_id; - // gchar *label; - // GdkModifierType modifier; - // guint keyval; - // gchar *translation_domain; - { TIKZIT_STOCK_SELECT, "Select", 0, 0, NULL }, - { TIKZIT_STOCK_CREATE_NODE, "Create Node", 0, 0, NULL }, - { TIKZIT_STOCK_CREATE_EDGE, "Create Edge", 0, 0, NULL }, - { TIKZIT_STOCK_BOUNDING_BOX, "Bounding Box", 0, 0, NULL }, - { TIKZIT_STOCK_DRAG, "Drag", 0, 0, NULL }, -}; -static guint n_stock_items = G_N_ELEMENTS (stock_items); - -static void icon_factory_add_pixdata (GtkIconFactory *factory, - const gchar *stock_id, - const GdkPixdata *image_data) { - - GdkPixbuf *buf = gdk_pixbuf_from_pixdata (image_data, FALSE, NULL); - GtkIconSet *icon_set = gtk_icon_set_new_from_pixbuf (buf); - gtk_icon_factory_add (factory, stock_id, icon_set); - gtk_icon_set_unref (icon_set); - g_object_unref (G_OBJECT (buf)); -} - -void tz_register_stock_items() { - gtk_stock_add_static (stock_items, n_stock_items); - - GtkIconFactory *factory = gtk_icon_factory_new (); - icon_factory_add_pixdata (factory, TIKZIT_STOCK_SELECT, &select_rectangular); - icon_factory_add_pixdata (factory, TIKZIT_STOCK_CREATE_NODE, &draw_ellipse); - icon_factory_add_pixdata (factory, TIKZIT_STOCK_CREATE_EDGE, &draw_path); - icon_factory_add_pixdata (factory, TIKZIT_STOCK_BOUNDING_BOX, &transform_crop_and_resize); - icon_factory_add_pixdata (factory, TIKZIT_STOCK_DRAG, &transform_move); - gtk_icon_factory_add_default (factory); -} - -// vim:ft=objc:ts=8:et:sts=4:sw=4:foldmethod=marker diff --git a/tikzit-old/src/gtk/tztoolpalette.h b/tikzit-old/src/gtk/tztoolpalette.h deleted file mode 100644 index 45ec2ac..0000000 --- a/tikzit-old/src/gtk/tztoolpalette.h +++ /dev/null @@ -1,56 +0,0 @@ -/* GIMP - The GNU Image Manipulation Program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * tztoolpalette.h, based on gimptoolpalette.h - * Copyright (C) 2010 Michael Natterer - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef __TZ_TOOL_PALETTE_H__ -#define __TZ_TOOL_PALETTE_H__ - - -#define TZ_TYPE_TOOL_PALETTE (tz_tool_palette_get_type ()) -#define TZ_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TZ_TYPE_TOOL_PALETTE, TzToolPalette)) -#define TZ_TOOL_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TZ_TYPE_TOOL_PALETTE, TzToolPaletteClass)) -#define TZ_IS_TOOL_PALETTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TZ_TYPE_TOOL_PALETTE)) -#define TZ_IS_TOOL_PALETTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TZ_TYPE_TOOL_PALETTE)) -#define TZ_TOOL_PALETTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TZ_TYPE_TOOL_PALETTE, TzToolPaletteClass)) - - -typedef struct _TzToolPaletteClass TzToolPaletteClass; -typedef struct _TzToolPalette TzToolPalette; - -struct _TzToolPalette -{ - GtkToolPalette parent_instance; -}; - -struct _TzToolPaletteClass -{ - GtkToolPaletteClass parent_class; -}; - - -GType tz_tool_palette_get_type (void) G_GNUC_CONST; - -GtkWidget * tz_tool_palette_new (void); - -gboolean tz_tool_palette_get_button_size (TzToolPalette *widget, - gint *width, - gint *height); - - -#endif /* __TZ_TOOL_PALETTE_H__ */ diff --git a/tikzit-old/src/gtk/tztoolpalette.m b/tikzit-old/src/gtk/tztoolpalette.m deleted file mode 100644 index a948127..0000000 --- a/tikzit-old/src/gtk/tztoolpalette.m +++ /dev/null @@ -1,158 +0,0 @@ -/* GIMP - The GNU Image Manipulation Program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * tztoolpalette.c, based on gimptoolpalette.c - * Copyright (C) 2010 Michael Natterer - * Copyright (C) 2012 Alex Merry - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -#include "tztoolpalette.h" - - -#define DEFAULT_TOOL_ICON_SIZE GTK_ICON_SIZE_BUTTON -#define DEFAULT_BUTTON_RELIEF GTK_RELIEF_NONE - -#define TOOL_BUTTON_DATA_KEY "tz-tool-palette-item" -#define TOOL_INFO_DATA_KEY "tz-tool-info" - - -typedef struct _TzToolPalettePrivate TzToolPalettePrivate; - -struct _TzToolPalettePrivate -{ - gint tool_rows; - gint tool_columns; -}; - -#define GET_PRIVATE(p) G_TYPE_INSTANCE_GET_PRIVATE (p, \ - TZ_TYPE_TOOL_PALETTE, \ - TzToolPalettePrivate) - - -static void tz_tool_palette_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); - - -G_DEFINE_TYPE (TzToolPalette, tz_tool_palette, GTK_TYPE_TOOL_PALETTE) - -#define parent_class tz_tool_palette_parent_class - - -static void -tz_tool_palette_class_init (TzToolPaletteClass *klass) -{ - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - - widget_class->size_allocate = tz_tool_palette_size_allocate; - - g_type_class_add_private (klass, sizeof (TzToolPalettePrivate)); -} - -static void -tz_tool_palette_init (TzToolPalette *palette) -{ -} - -static GtkToolItemGroup * -tz_tool_palette_tool_group (TzToolPalette *palette) -{ - GList *children; - GtkToolItemGroup *group; - - children = gtk_container_get_children (GTK_CONTAINER (palette)); - g_return_val_if_fail (children, NULL); - group = GTK_TOOL_ITEM_GROUP (children->data); - g_list_free (children); - - return group; -} - -gboolean -tz_tool_palette_get_button_size (TzToolPalette *palette, - gint *width, - gint *height) -{ - g_return_val_if_fail (width || height, FALSE); - - GtkToolItemGroup *group = tz_tool_palette_tool_group (palette); - g_return_val_if_fail (group, FALSE); - - guint tool_count = gtk_tool_item_group_get_n_items (group); - if (tool_count > 0) - { - GtkWidget *tool_button; - GtkRequisition button_requisition; - - tool_button = GTK_WIDGET (gtk_tool_item_group_get_nth_item (group, 0)); - gtk_widget_size_request (tool_button, &button_requisition); - if (width) - *width = button_requisition.width; - if (height) - *height = button_requisition.height; - return TRUE; - } - return FALSE; -} - -static void -tz_tool_palette_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - TzToolPalettePrivate *private = GET_PRIVATE (widget); - GtkToolItemGroup *group = tz_tool_palette_tool_group (TZ_TOOL_PALETTE (widget)); - - g_return_if_fail (group); - - GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation); - - guint tool_count = gtk_tool_item_group_get_n_items (group); - if (tool_count > 0) - { - GtkWidget *tool_button; - GtkRequisition button_requisition; - gint tool_rows; - gint tool_columns; - - tool_button = GTK_WIDGET (gtk_tool_item_group_get_nth_item (group, 0)); - gtk_widget_size_request (tool_button, &button_requisition); - - tool_columns = MAX (1, (allocation->width / button_requisition.width)); - tool_rows = tool_count / tool_columns; - - if (tool_count % tool_columns) - tool_rows++; - - if (private->tool_rows != tool_rows || - private->tool_columns != tool_columns) - { - private->tool_rows = tool_rows; - private->tool_columns = tool_columns; - - gtk_widget_set_size_request (widget, -1, - tool_rows * button_requisition.height); - } - } -} - -GtkWidget * -tz_tool_palette_new (void) -{ - return g_object_new (TZ_TYPE_TOOL_PALETTE, NULL); -} - -// vim:ft=objc:ts=8:et:sts=2:sw=2:foldmethod=marker diff --git a/tikzit-old/src/osx/AppDelegate.h b/tikzit-old/src/osx/AppDelegate.h deleted file mode 100644 index 92d9add..0000000 --- a/tikzit-old/src/osx/AppDelegate.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// AppDelegate.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "StylePaletteController.h" -#import "ToolPaletteController.h" -#import "PropertyInspectorController.h" -#import "PreambleController.h" -#import "PreviewController.h" -#import "GraphicsView.h" -#import "PreferenceController.h" - -@interface AppDelegate : NSObject { - NSMapTable *table; - StylePaletteController *stylePaletteController; - PropertyInspectorController *propertyInspectorController; - PreambleController *preambleController; - PreviewController *previewController; - PreferenceController *preferenceController; - ToolPaletteController *toolPaletteController; - IBOutlet GraphicsView *graphicsView; - NSString *tempDir; -} - -@property IBOutlet StylePaletteController *stylePaletteController; -@property (strong) IBOutlet ToolPaletteController *toolPaletteController; - -- (void)awakeFromNib; -+ (void)setDefaults; -- (void)applicationWillTerminate:(NSNotification *)notification; -- (IBAction)toggleStyleInspector:(id)sender; -- (IBAction)togglePropertyInspector:(id)sender; -- (IBAction)togglePreamble:(id)sender; -- (IBAction)togglePreferences:(id)sender; -- (IBAction)refreshShapes:(id)sender; - -@end diff --git a/tikzit-old/src/osx/AppDelegate.m b/tikzit-old/src/osx/AppDelegate.m deleted file mode 100644 index 94f5507..0000000 --- a/tikzit-old/src/osx/AppDelegate.m +++ /dev/null @@ -1,124 +0,0 @@ -// -// AppDelegate.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "AppDelegate.h" -#import "TikzDocument.h" -#import "Shape.h" -#import "SupportDir.h" - -@implementation AppDelegate - -@synthesize stylePaletteController, toolPaletteController; - -+(void)initialize{ - [self setDefaults]; -} - -- (void)awakeFromNib { - [SupportDir createUserSupportDir]; - NSString *supportDir = [SupportDir userSupportDir]; - //NSLog(stylePlist); - stylePaletteController = - [[StylePaletteController alloc] initWithWindowNibName:@"StylePalette" - supportDir:supportDir]; - - propertyInspectorController = - [[PropertyInspectorController alloc] initWithWindowNibName:@"PropertyInspector"]; - - [propertyInspectorController setStylePaletteController:stylePaletteController]; - - NSString *preamblePlist = [supportDir stringByAppendingPathComponent:@"preambles.plist"]; - preambleController = - [[PreambleController alloc] initWithNibName:@"Preamble" - plist:preamblePlist - styles:[stylePaletteController nodeStyles] - edges:[stylePaletteController edgeStyles]]; - - - char template[] = "/tmp/tikzit_tmp_XXXXXXX"; - char *dir = mkdtemp(template); - tempDir = [NSString stringWithUTF8String:dir]; - - NSLog(@"created temp dir: %@", tempDir); - NSLog(@"system support dir: %@", [SupportDir systemSupportDir]); - - previewController = - [[PreviewController alloc] initWithWindowNibName:@"Preview" - preambleController:preambleController - tempDir:tempDir]; - - preferenceController = [[PreferenceController alloc] initWithWindowNibName:@"Preferences" preambleController:preambleController]; - - // each application has one global preview controller - [PreviewController setDefaultPreviewController:previewController]; -} - -+ (void)setDefaults{ - NSString *userDefaultsValuesPath; - NSDictionary *userDefaultsValuesDict; - - userDefaultsValuesPath=[[NSBundle mainBundle] pathForResource:@"UserDefaults" - ofType:@"plist"]; - userDefaultsValuesDict=[NSDictionary dictionaryWithContentsOfFile:userDefaultsValuesPath]; - - [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaultsValuesDict]; -} - -- (void)applicationWillTerminate:(NSNotification *)notification { - NSString *supportDir = [SupportDir userSupportDir]; - [stylePaletteController saveStyles:supportDir]; - [preambleController savePreambles:[supportDir stringByAppendingPathComponent:@"preambles.plist"]]; - - NSLog(@"wiping temp dir: %@", tempDir); - [[NSFileManager defaultManager] removeItemAtPath:tempDir error:NULL]; -} - -- (void)toggleController:(NSWindowController*)c { - if ([[c window] isVisible]) { - [c close]; - } else { - [c showWindow:self]; - } -} - -- (IBAction)toggleStyleInspector:(id)sender { - [self toggleController:stylePaletteController]; -} - -- (IBAction)togglePropertyInspector:(id)sender { - [self toggleController:propertyInspectorController]; -} - -- (IBAction)togglePreamble:(id)sender { - [self toggleController:(NSWindowController *) preambleController]; -} - -- (IBAction)togglePreferences:(id)sender { - [self toggleController:preferenceController]; -} - -- (IBAction)refreshShapes:(id)sender { - [Shape refreshShapeDictionary]; -} - -@end diff --git a/tikzit-old/src/osx/CALayer+DrawLabel.h b/tikzit-old/src/osx/CALayer+DrawLabel.h deleted file mode 100644 index 32282d9..0000000 --- a/tikzit-old/src/osx/CALayer+DrawLabel.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// CALayer+DrawLabel.h -// TikZiT -// -// Created by Aleks Kissinger on 09/05/2011. -// Copyright 2011 Aleks Kissinger. All rights reserved. -// - -#import -#import - -@class Transformer; - -@interface CALayer(DrawLabel) - -- (void)drawLabel:(NSString*)label - atPoint:(NSPoint)pt - inContext:(CGContextRef)context - usingTrans:(Transformer*)t; - -@end diff --git a/tikzit-old/src/osx/CALayer+DrawLabel.m b/tikzit-old/src/osx/CALayer+DrawLabel.m deleted file mode 100644 index 4860a3c..0000000 --- a/tikzit-old/src/osx/CALayer+DrawLabel.m +++ /dev/null @@ -1,84 +0,0 @@ -// -// CALayer+DrawLabel.m -// TikZiT -// -// Created by Aleks Kissinger on 09/05/2011. -// Copyright 2011 Aleks Kissinger. All rights reserved. -// - -#import "CALayer+DrawLabel.h" -#import "Transformer.h" - -@implementation CALayer(DrawLabel) - -- (void)drawLabel:(NSString*)label - atPoint:(NSPoint)pt - inContext:(CGContextRef)context - usingTrans:(Transformer*)t { - - CGContextSaveGState(context); - - if ([label length] > 15) { - label = [[label substringToIndex:12] stringByAppendingString:@"..."]; - } - - float fontSize = [t scaleToScreen:0.18f]; // size 9 @ 100% - if (fontSize > 18.0f) fontSize = 18.0f; - - // Prepare font - CTFontRef font = CTFontCreateWithName(CFSTR("Monaco"), fontSize, NULL); - - // Create an attributed string - CFStringRef keys[] = { kCTFontAttributeName }; - CFTypeRef values[] = { font }; - CFDictionaryRef attr = CFDictionaryCreate(NULL, - (const void **)&keys, - (const void **)&values, - sizeof(keys) / sizeof(keys[0]), - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - CFAttributedStringRef attrString = - CFAttributedStringCreate(NULL, (CFStringRef)label, attr); - CFRelease(attr); - - // Draw the string - CTLineRef line = CTLineCreateWithAttributedString(attrString); - CGContextSetTextMatrix(context, CGAffineTransformIdentity); - CGContextSetTextPosition(context, 0, 0); - - CGRect labelBounds = CGRectIntegral(CTLineGetImageBounds(line, context)); - //int shiftx = round(labelBounds.size.width / 2); - - CGContextSetTextPosition(context, - round(pt.x - (labelBounds.size.width/2)), - round(pt.y - (0.9*labelBounds.size.height/2))); - - labelBounds = CGRectIntegral(CTLineGetImageBounds(line, context)); - labelBounds.origin.x -= 2; - labelBounds.origin.y -= 2; - labelBounds.size.width += 4; - labelBounds.size.height += 4; - - CGContextSetShouldAntialias(context, NO); - - CGContextSetRGBFillColor(context, 1.0f, 1.0f, 0.5f, 0.7f); - CGContextSetRGBStrokeColor(context, 0.5f, 0.0f, 0.0f, 0.7f); - - CGContextFillRect(context, labelBounds); - CGContextStrokeRect(context, labelBounds); - - CGContextSetShouldAntialias(context, YES); - - CGContextSetRGBFillColor(context, 0.3f, 0.3f, 0.3f, 0.7f); - - CTLineDraw(line, context); - - // Clean up - CFRelease(line); - CFRelease(attrString); - CFRelease(font); - - CGContextRestoreGState(context); -} - -@end diff --git a/tikzit-old/src/osx/CoreGraphicsRenderContext.h b/tikzit-old/src/osx/CoreGraphicsRenderContext.h deleted file mode 100644 index 7b00484..0000000 --- a/tikzit-old/src/osx/CoreGraphicsRenderContext.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "RenderContext.h" - -@interface CoreTextLayout: NSObject { - CFAttributedStringRef attrString; - CTFontRef font; - CTLineRef line; - CGContextRef ctx; -} - -+ (CoreTextLayout*) layoutForContext:(CGContextRef)c withString:(NSString*)string fontSize:(CGFloat)fontSize; -- (id) initWithContext:(CGContextRef)cr withString:(NSString*)string fontSize:(CGFloat)fontSize; - -@end - -@interface CoreGraphicsRenderContext: NSObject { - CGContextRef ctx; -} - -+ (CoreGraphicsRenderContext*) contextWithCGContext:(CGContextRef)c; -+ (id) initWithCGContext:(CGContextRef)c; - -- (CGContextRef) ctx; - -@end - -// vim:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/osx/CoreGraphicsRenderContext.m b/tikzit-old/src/osx/CoreGraphicsRenderContext.m deleted file mode 100644 index 1cb0daf..0000000 --- a/tikzit-old/src/osx/CoreGraphicsRenderContext.m +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright 2011 Alex Merry - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#import -#import "RenderContext.h" - -@implementation CoreTextLayout - -+ (CoreTextLayout*) layoutForContext:(CGContextRef)c withString:(NSString*)string fontSize:(CGFloat)fontSize { - return [[[self alloc] initWithContext:c withString:string fontSize:fontSize] autorelease]; -} - -- (id) initWithContext:(CGContextRef)cr withString:(NSString*)string fontSize:(CGFloat)fontSize { - self = [super init]; - - if (self == nil) { - return nil; - } - - CGContextRetain (cr); - ctx = cr; - font = CTFontCreateWithName(CFSTR("Monaco"), fontSize, NULL); - - // Create an attributed string - CFStringRef keys[] = { kCTFontAttributeName }; - CFTypeRef values[] = { font }; - CFDictionaryRef attr = CFDictionaryCreate(NULL, - (const void **)&keys, - (const void **)&values, - sizeof(keys) / sizeof(keys[0]), - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); - attrString = CFAttributedStringCreate(NULL, (CFStringRef)lab, attr); - CFRelease(attr); - line = CTLineCreateWithAttributedString(attrString); - - return self; -} - -- (NSSize) size { - CGRect labelBounds = CGRectIntegral(CTLineGetImageBounds(line, ctx)); - return labelBounds.size; -} - -- (NSString*) text { - return CFAttributedStringGetString (attrString); -} - -- (void) showTextAt:(NSPoint)topLeft withColor:(RColor)color { - CGContextSaveGState(ctx); - - CGContextSetRGBFillColor(ctx, color.red, color.green, color.blue, color.alpha); - CGContextSetRGBStrokeColor(ctx, color.red, color.green, color.blue, color.alpha); - CGContextSetShouldAntialias(ctx, YES); - - CGContextSetTextMatrix(ctx, CGAffineTransformIdentity); - CGContextSetTextPosition(ctx, 0, 0); - CGRect bounds = CGRectIntegral(CTLineGetImageBounds(line, ctx)); - CGContextSetTextPosition(ctx, topLeft.x - bounds.x, topLeft.y - bounds.y); - - CTLineDraw(line, ctx); - - CGContextRestoreGState(ctx); -} - -- (void) dealloc { - CFRelease(line); - CFRelease(attrString); - CFRelease(font); - CGContextRelease (ctx); - - [super dealloc]; -} - -@end - -@implementation CoreGraphicsRenderContext - -+ (CoreGraphicsRenderContext*) contextWithCGContext:(CGContextRef)c { - return [[[self alloc] initWithCGContext:c] autorelease]; -} - -+ (id) initWithCGContext:(CGContextRef)c { - self = [super init]; - - if (self) { - ctx = c; - CGContextRetain (ctx); - } - - return self; -} - -- (void) dealloc { - CGContextRelease (ctx); - - [super dealloc]; -} - -- (CGContextRef) ctx { - return ctx; -} - -- (void) saveState { - CGContextSaveGState(ctx); -} - -- (void) restoreState { - CGContextRestoreGState(ctx); -} - -- (NSRect) clipBoundingBox { - return CGContextGetClipBoundingBox (ctx); -} - -- (BOOL) strokeIncludesPoint:(NSPoint)p { - return CGContextPathContainsPoint(ctx, NSPointToCGPoint(p), kCGPathStroke); -} - -- (BOOL) fillIncludesPoint:(NSPoint)p { - return CGContextPathContainsPoint(ctx, NSPointToCGPoint(p), kCGPathFill); -} - -- (id) layoutText:(NSString*)text withSize:(CGFloat)fontSize { - return [CoreTextLayout layoutForContext:ctx withString:text fontSize:fontSize]; -} - -// this may not affect text rendering -- (void) setAntialiasMode:(AntialiasMode)mode { - CGContextSetShouldAntialias(ctx, mode != AntialiasDisabled); -} - -- (void) setLineWidth:(CGFloat)width { - CGContextSetLineWidth(ctx, width); -} - -// setting to 0 will unset the dash -- (void) setLineDash:(CGFloat)dashLength { - if (dashLength <= 0.0f) { - CGContextSetLineDash(ctx, 0.0f, NULL, 0); - } else { - const CGFloat dash[] = {dashLength, dashLength}; - CGContextSetLineDash(ctx, 0.0f, dash, 2); - } -} - -// paths -- (void) startPath { - CGContextBeginPath (ctx); -} - -- (void) closeSubPath { - CGContextClosePath (ctx); -} - -- (void) moveTo:(NSPoint)p { - CGContextMoveToPoint (ctx, p.x, p.y); -} - -- (void) curveTo:(NSPoint)end withCp1:(NSPoint)cp1 andCp2:(NSPoint)cp2 { - CGContextAddCurveToPoint(ctx, cp1.x, cp1.y, cp2.x, cp2.y, end.x, end.y); -} - -- (void) lineTo:(NSPoint)end { - CGContextAddLineToPoint(ctx, end.x, end.y); -} - -- (void) rect:(NSRect)rect { - CGContextAddRect (ctx, rect); -} - -- (void) circleAt:(NSPoint)c withRadius:(CGFloat)r { - CGContextMoveToPoint (ctx, c.x + r, c.y); - CGContextAddArc (ctx, c.x, c.y, r, 0.0f, M_PI, 1); -} - -// these methods clear the path -- (void) strokePathWithColor:(RColor)color { - CGContextSetRGBStrokeColor(ctx, color.red, color.green, color.blue, color.alpha); - CGContextDrawPath (ctx, kCGPathStroke); -} - -- (void) fillPathWithColor:(RColor)color { - CGContextSetRGBFillColor(ctx, color.red, color.green, color.blue, color.alpha); - CGContextDrawPath (ctx, kCGPathFill); -} - -- (void) strokePathWithColor:(RColor)scolor - andFillWithColor:(RColor)fcolor { - CGContextSetRGBFillColor(ctx, color.red, color.green, color.blue, color.alpha); - CGContextSetRGBStrokeColor(ctx, color.red, color.green, color.blue, color.alpha); - CGContextDrawPath (ctx, kCGPathFillStroke); -} - -- (void) strokePathWithColor:(RColor)scolor - andFillWithColor:(RColor)fcolor - usingAlpha:(CGFloat)alpha { - CGContextSetRGBFillColor(ctx, color.red, color.green, color.blue, color.alpha * alpha); - CGContextSetRGBStrokeColor(ctx, color.red, color.green, color.blue, color.alpha * alpha); - CGContextDrawPath (ctx, kCGPathFillStroke); -} - -- (void) clipToPath { - CGContextClip (ctx); -} - -// paint everywhere within the clip -- (void) paintWithColor:(RColor)color { - CGContextSetRGBFillColor(ctx, color.red, color.green, color.blue, color.alpha); - CGRect r = CGContextGetClipBoundingBox (ctx); - r.origin.x -= 1; - r.origin.y -= 1; - r.size.width += 2; - r.size.height += 2; - CGContextFillRect(context, r); -} - -@end - -// vim:ft=objc:ts=4:noet:sts=4:sw=4 diff --git a/tikzit-old/src/osx/CustomNodeCellView.h b/tikzit-old/src/osx/CustomNodeCellView.h deleted file mode 100644 index 22606d7..0000000 --- a/tikzit-old/src/osx/CustomNodeCellView.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// CustomNodeCellView.h -// TikZiT -// -// Created by Johan Paulsson on 12/12/13. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// - -#import - -#import "NodeLayer.h" -#import "NodeStyle.h" -#import "NodeStyle+Coder.h" - -@interface CustomNodeCellView : NSTableCellView{ - NodeLayer *nodeLayer; - NodeStyle *nodeStyle; - BOOL selected; -} - -@property (strong) id objectValue; - -@end diff --git a/tikzit-old/src/osx/CustomNodeCellView.m b/tikzit-old/src/osx/CustomNodeCellView.m deleted file mode 100644 index 612394b..0000000 --- a/tikzit-old/src/osx/CustomNodeCellView.m +++ /dev/null @@ -1,83 +0,0 @@ -// -// CustomNodeCellView.m -// TikZiT -// -// Created by Johan Paulsson on 12/12/13. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// - -#import "CustomNodeCellView.h" - -@implementation CustomNodeCellView - -- (id)initWithFrame:(NSRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - // Initialization code here. - } - return self; -} - -- (void)drawRect:(NSRect)dirtyRect -{ - [super drawRect:dirtyRect]; - - // Drawing code here. -} - -- (id) objectValue{ - return [super objectValue]; -} - --(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { - if (nodeLayer!=nil) { - if (![[[self layer] sublayers] containsObject:nodeLayer]) { - [[self layer] addSublayer:nodeLayer]; - NSPoint c = NSMakePoint((CGRectGetMinX([[self layer] frame])+CGRectGetWidth([nodeLayer bounds])/2), - CGRectGetMidY([[self layer] frame])); - //c = NSMakePoint(-16.5,-16.5); - [nodeLayer setCenter:c andAnimateWhen:NO]; - [[self textField] setFrame:NSMakeRect(CGRectGetWidth([nodeLayer bounds]), CGRectGetMidY([[self layer] frame]), CGRectGetWidth([[self textField] frame]), CGRectGetHeight([[self textField] frame]))]; - } - - if (selected){ - [nodeStyle setStrokeColor:[NSColor whiteColor]]; - [[nodeLayer node] setStyle:nodeStyle]; - }else{ - [nodeStyle setStrokeColor:[NSColor blackColor]]; - [[nodeLayer node] setStyle:nodeStyle]; - } - - [nodeLayer updateFrame]; - } -} - -- (void) setObjectValue:(id)objectValue{ - if(objectValue == nil) - return; - - nodeStyle = (NodeStyle *)objectValue; - [[self textField] setStringValue:[nodeStyle shapeName]]; - - if (nodeLayer == nil) { - nodeLayer = [[NodeLayer alloc] initWithNode:[Node node] - transformer:[Transformer defaultTransformer]]; - [nodeLayer setRescale:NO]; - } - [nodeStyle setName:[nodeStyle shapeName]]; - - [[nodeLayer node] setStyle:nodeStyle]; - [nodeLayer updateFrame]; - - NSLog(@"asd"); -} - -- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle { - [super setBackgroundStyle:backgroundStyle]; - - selected = (backgroundStyle == NSBackgroundStyleDark); - [self setNeedsDisplay:YES]; -} - -@end diff --git a/tikzit-old/src/osx/CustomNodeController.h b/tikzit-old/src/osx/CustomNodeController.h deleted file mode 100644 index 67adf0b..0000000 --- a/tikzit-old/src/osx/CustomNodeController.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// CustomNodeController.h -// TikZiT -// -// Created by Johan Paulsson on 12/4/13. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// - -#import -#import "Shape.h" -#import "TikzShape.h" - -#import "GraphicsView.h" -#import "TikzSourceController.h" - -#import "SupportDir.h" - -@interface CustomNodeController : NSViewController { - NSDictionary *nodeStyles; - NSMutableArray* customNodeStyles; - - GraphicsView *__weak graphicsView; - TikzSourceController *__weak tikzSourceController; - NSTableView *customNodeTable; -} - -@property NSDictionary *nodeStyles; -@property NSMutableArray* customNodeStyles; - -@property IBOutlet NSTableView *customNodeTable; - -@property (weak) IBOutlet GraphicsView *graphicsView; -@property (weak) IBOutlet TikzSourceController *tikzSourceController; - -@end diff --git a/tikzit-old/src/osx/CustomNodeController.m b/tikzit-old/src/osx/CustomNodeController.m deleted file mode 100644 index 4f46acc..0000000 --- a/tikzit-old/src/osx/CustomNodeController.m +++ /dev/null @@ -1,58 +0,0 @@ -// -// CustomNodeController.m -// TikZiT -// -// Created by Johan Paulsson on 12/4/13. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// - -#import "CustomNodeController.h" -#import "NodeStyle.h" - -@interface CustomNodeController () - -@end - -@implementation CustomNodeController - -@synthesize nodeStyles, customNodeStyles; -@synthesize graphicsView, tikzSourceController; -@synthesize customNodeTable; - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { - nodeStyles = [Shape shapeDictionary]; - customNodeStyles = [NSMutableArray array]; - - for(id key in nodeStyles) { - Shape *value = [nodeStyles objectForKey:key]; - - if([value isKindOfClass:[TikzShape class]]){ - NodeStyle *newNodeStyle = [[NodeStyle alloc] init]; - [newNodeStyle setShapeName:key]; - - [customNodeStyles addObject:newNodeStyle]; - } - } - } - - return self; -} - -- (void)tableViewSelectionDidChange:(NSNotification *)aNotification{ - NSInteger selectedRow = [customNodeTable selectedRow]; - - NodeStyle* selectedNodeStyle = [customNodeStyles objectAtIndex:selectedRow]; - TikzShape *tikzshape = (TikzShape *) [nodeStyles objectForKey:[selectedNodeStyle shapeName]]; - - [[tikzSourceController graphicsView] setEnabled:NO]; - [tikzSourceController setTikz:[tikzshape tikzSrc]]; - [tikzSourceController parseTikz:self]; -} - -- (id)valueForUndefinedKey:(NSString *)key{ - return nil; -} - -@end diff --git a/tikzit-old/src/osx/CustomNodes.xib b/tikzit-old/src/osx/CustomNodes.xib deleted file mode 100644 index 1cc8db2..0000000 --- a/tikzit-old/src/osx/CustomNodes.xib +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - - - - - - - - - - name - strokeThickness - strokeColor - fillColor - strokeColorIsKnown - fillColorIsKnown - representedObject.name - shapeName - scale - @distinctUnionOfObjects.category - category - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \begin{tikzpicture} - -\end{tikzpicture} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tikzit-old/src/osx/DraggablePDFView.h b/tikzit-old/src/osx/DraggablePDFView.h deleted file mode 100644 index 9e53c44..0000000 --- a/tikzit-old/src/osx/DraggablePDFView.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// PreviewController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -@interface DraggablePDFView : PDFView - -@end diff --git a/tikzit-old/src/osx/DraggablePDFView.m b/tikzit-old/src/osx/DraggablePDFView.m deleted file mode 100644 index ce393c7..0000000 --- a/tikzit-old/src/osx/DraggablePDFView.m +++ /dev/null @@ -1,60 +0,0 @@ -// -// PreviewController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "DraggablePDFView.h" - -@implementation DraggablePDFView - -- (id)initWithFrame:(NSRect)frame -{ - self = [super initWithFrame:frame]; - return self; -} - -- (void)drawRect:(NSRect)dirtyRect -{ - [super drawRect:dirtyRect]; -} - -- (void)mouseDown:(NSEvent *)theEvent -{ - NSRect pageBox = [[[self document] pageAtIndex:0] boundsForBox:kPDFDisplayBoxMediaBox]; - NSRect pageRect= [self convertRect:pageBox fromPage:[[self document] pageAtIndex:0]]; - - NSArray *fileList = [NSArray arrayWithObjects:[[[self document] documentURL] path], nil]; - NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; - [pboard setPropertyList:fileList forType:NSFilenamesPboardType]; - - [self dragImage:[[NSImage alloc] initWithData:[[self document] dataRepresentation]] - at:pageRect.origin - offset:pageRect.size - event:theEvent - pasteboard:pboard - source:self - slideBack:YES]; - - return; -} - -@end diff --git a/tikzit-old/src/osx/EdgeControlLayer.h b/tikzit-old/src/osx/EdgeControlLayer.h deleted file mode 100644 index 4cdf8bc..0000000 --- a/tikzit-old/src/osx/EdgeControlLayer.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// EdgeControlLayer.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import -#import "Edge.h" -#import "Transformer.h" - - -@interface EdgeControlLayer : CALayer { - Edge *edge; - Transformer *transformer; - BOOL selected; -} - -- (id)initWithEdge:(Edge*)e andTransformer:(Transformer*)t; -- (void)highlight; -- (void)unhighlight; -- (void)select; -- (void)deselect; - -+ (float)handleRadius; - -@end diff --git a/tikzit-old/src/osx/EdgeControlLayer.m b/tikzit-old/src/osx/EdgeControlLayer.m deleted file mode 100644 index facdd84..0000000 --- a/tikzit-old/src/osx/EdgeControlLayer.m +++ /dev/null @@ -1,150 +0,0 @@ -// -// EdgeControlLayer.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "EdgeControlLayer.h" -#import "util.h" - - -@implementation EdgeControlLayer - - -- (id)initWithEdge:(Edge*)e andTransformer:(Transformer*)t { - if (!(self = [super init])) return nil; - transformer = t; - edge = e; - self.opacity = 0.0f; - return self; -} - -- (void)select { - selected = YES; - self.opacity = 1.0f; -} - -- (void)deselect { - selected = NO; - self.opacity = 0.0f; -} - -- (void)highlight { - if (!selected) { - self.opacity = 0.5f; - } -} - -- (void)unhighlight { - if (!selected) { - self.opacity = 0.0f; - } -} - -- (void)drawInContext:(CGContextRef)ctx { - CGContextSaveGState(ctx); - - [edge updateControls]; - CGPoint source = NSPointToCGPoint([transformer toScreen:[[edge source] point]]); - CGPoint target = NSPointToCGPoint([transformer toScreen:[[edge target] point]]); - CGPoint mid = NSPointToCGPoint([transformer toScreen:[edge mid]]); - CGPoint cp1 = NSPointToCGPoint([transformer toScreen:[edge cp1]]); - CGPoint cp2 = NSPointToCGPoint([transformer toScreen:[edge cp2]]); - - float dx = (target.x - source.x); - float dy = (target.y - source.y); - - // draw a circle at the midpoint - CGRect mid_rect = CGRectMake(mid.x-3.0f, mid.y-3.0f, 6.0f, 6.0f); - CGContextAddEllipseInRect(ctx, mid_rect); - CGContextSetLineWidth(ctx, 1.0f); - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 0.5f); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 1.0f, 0.5f); - CGContextDrawPath(ctx, kCGPathFillStroke); - - - CGContextSetShouldAntialias(ctx, YES); - - // compute size of control circles - float cdist; - if (dx == 0 && dy == 0) cdist = [transformer scaleToScreen:edge.weight]; - else cdist = sqrt(dx*dx + dy*dy) * edge.weight; - - // if basic bend, draw blue, if inout, draw green - if ([edge bendMode] == EdgeBendModeBasic) CGContextSetRGBStrokeColor(ctx, 0, 0, 1, 0.4f); - else CGContextSetRGBStrokeColor(ctx, 0, 0.7f, 0, 0.4f); - - // draw source control circle - CGRect ellipse1 = CGRectMake(source.x-cdist, source.y-cdist, cdist*2.0f, cdist*2.0f); - CGContextAddEllipseInRect(ctx, ellipse1); - if (dx!=0 || dy!=0) { - CGRect ellipse2 = CGRectMake(target.x-cdist, target.y-cdist, cdist*2.0f, cdist*2.0f); - CGContextAddEllipseInRect(ctx, ellipse2); - } - - CGContextStrokePath(ctx); - - float handleRad = [EdgeControlLayer handleRadius]; - - // handles - CGRect ctrl1 = CGRectMake(cp1.x-handleRad, cp1.y-handleRad, 2*handleRad, 2*handleRad); - CGRect ctrl2 = CGRectMake(cp2.x-handleRad, cp2.y-handleRad, 2*handleRad, 2*handleRad); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 0.8f); - - // draw a line from source vertex to first handle - if ([edge bendMode] == EdgeBendModeInOut) { - if ([edge outAngle] % 45 == 0) CGContextSetRGBStrokeColor(ctx, 1, 0, 1, 0.6f); - else CGContextSetRGBStrokeColor(ctx, 0, 0.7f, 0, 0.4f); - } else { - if ([edge bend] % 45 == 0) CGContextSetRGBStrokeColor(ctx, 1, 0, 1, 0.6f); - else CGContextSetRGBStrokeColor(ctx, 0, 0, 1, 0.4f); - } - - CGContextMoveToPoint(ctx, source.x, source.y); - CGContextAddLineToPoint(ctx, cp1.x, cp1.y); - CGContextStrokePath(ctx); - - CGContextAddEllipseInRect(ctx, ctrl1); - CGContextDrawPath(ctx, kCGPathFillStroke); - - - // draw a line from target vertex to second handle - if ([edge bendMode] == EdgeBendModeInOut) { - if ([edge inAngle] % 45 == 0) CGContextSetRGBStrokeColor(ctx, 1, 0, 1, 0.6f); - else CGContextSetRGBStrokeColor(ctx, 0, 0.7f, 0, 0.4f); - } else { - if ([edge bend] % 45 == 0) CGContextSetRGBStrokeColor(ctx, 1, 0, 1, 0.6f); - else CGContextSetRGBStrokeColor(ctx, 0, 0, 1, 0.4f); - } - - CGContextMoveToPoint(ctx, target.x, target.y); - CGContextAddLineToPoint(ctx, cp2.x, cp2.y); - CGContextStrokePath(ctx); - - CGContextAddEllipseInRect(ctx, ctrl2); - CGContextDrawPath(ctx, kCGPathFillStroke); - - CGContextRestoreGState(ctx); -} - -+ (float)handleRadius { return 4.0f; } - -@end diff --git a/tikzit-old/src/osx/EdgeStyle+Coder.h b/tikzit-old/src/osx/EdgeStyle+Coder.h deleted file mode 100644 index e35c18f..0000000 --- a/tikzit-old/src/osx/EdgeStyle+Coder.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// EdgeStyle+Coder.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "EdgeStyle.h" - -@interface EdgeStyle (Coder) -- (id)initWithCoder:(NSCoder*)coder; -- (void)encodeWithCoder:(NSCoder*)coder; -@end diff --git a/tikzit-old/src/osx/EdgeStyle+Coder.m b/tikzit-old/src/osx/EdgeStyle+Coder.m deleted file mode 100644 index 039344d..0000000 --- a/tikzit-old/src/osx/EdgeStyle+Coder.m +++ /dev/null @@ -1,50 +0,0 @@ -// -// EdgeStyle+Coder.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "EdgeStyle+Coder.h" - -@implementation EdgeStyle (Coder) - -- (id)initWithCoder:(NSCoder*)coder { - if (!(self = [super init])) return nil; - - name = [coder decodeObjectForKey:@"name"]; - category = [coder decodeObjectForKey:@"category"]; - headStyle = [coder decodeIntForKey:@"headStyle"]; - tailStyle = [coder decodeIntForKey:@"tailStyle"]; - decorationStyle = [coder decodeIntForKey:@"decorationStyle"]; - thickness = [coder decodeFloatForKey:@"thickness"]; - - return self; -} - -- (void)encodeWithCoder:(NSCoder*)coder { - [coder encodeObject:name forKey:@"name"]; - [coder encodeObject:category forKey:@"category"]; - [coder encodeInt:headStyle forKey:@"headStyle"]; - [coder encodeInt:tailStyle forKey:@"tailStyle"]; - [coder encodeInt:decorationStyle forKey:@"decorationStyle"]; - [coder encodeFloat:thickness forKey:@"thickness"]; -} - -@end diff --git a/tikzit-old/src/osx/Graph+Coder.h b/tikzit-old/src/osx/Graph+Coder.h deleted file mode 100644 index 1404fc2..0000000 --- a/tikzit-old/src/osx/Graph+Coder.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// Graph+Coder.h -// TikZiT -// -// Created by Aleks Kissinger on 27/04/2010. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import -#import "Graph.h" - -@interface Graph (Coder) - -- (id)initWithCoder:(NSCoder*)coder; -- (void)encodeWithCoder:(NSCoder*)coder; - -@end diff --git a/tikzit-old/src/osx/Graph+Coder.m b/tikzit-old/src/osx/Graph+Coder.m deleted file mode 100644 index 7d3787e..0000000 --- a/tikzit-old/src/osx/Graph+Coder.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// Graph+Coder.m -// TikZiT -// -// Created by Aleks Kissinger on 27/04/2010. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import "Graph+Coder.h" -#import "TikzGraphAssembler.h" - -@implementation Graph(Coder) - -- (id)initWithCoder:(NSCoder*)coder { - NSString *tikz = [coder decodeObject]; - [TikzGraphAssembler parseTikz:tikz forGraph:self]; - return self; -} - -- (void)encodeWithCoder:(NSCoder*)coder { - [coder encodeObject:[self tikz]]; -} - -@end diff --git a/tikzit-old/src/osx/GraphicsView.h b/tikzit-old/src/osx/GraphicsView.h deleted file mode 100644 index 329b1e5..0000000 --- a/tikzit-old/src/osx/GraphicsView.h +++ /dev/null @@ -1,129 +0,0 @@ -// -// GraphicsView.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import -#import "PickSupport.h" -#import "Grid.h" -#import "Transformer.h" -#import "Graph.h" -#import "NodeStyle.h" -#import "StylePaletteController.h" -#import "ToolPaletteController.h" -#import "SelectBoxLayer.h" - -// mouse modes, corresponding to different tools. format: (tool)[sub-mode]Mode -typedef enum { - SelectMode = 0x10, - SelectBoxMode = 0x11, - SelectMoveMode = 0x12, - SelectEdgeBendMode = 0x14, - - NodeMode = 0x20, - - EdgeMode = 0x40, - EdgeDragMode = 0x41, - - CropMode = 0x80, - CropDragMode = 0x81 -} MouseMode; - -@class TikzSourceController; - -@interface GraphicsView : NSView { - BOOL enabled; - - IBOutlet NSApplication *application; - StylePaletteController *stylePaletteController; - ToolPaletteController *toolPaletteController; - - BOOL frameMoveMode; - - Graph *graph; - NSString *graphTikzOnMouseDown; - PickSupport *pickSupport; - //NSMapTable *nodeSelectionLayers; - NSMapTable *edgeControlLayers; - NSMapTable *nodeLayers; - NSPoint dragOrigin; - NSPoint dragTarget; - NSPoint oldTransformerOrigin; - NSPoint oldMainOrigin; - NSRect oldBounds; - //NSRect selectionBox; - Transformer *transformer; - - CALayer *mainLayer; - CALayer *gridLayer; - CALayer *graphLayer; - CALayer *hudLayer; - SelectBoxLayer *selectionLayer; - - MouseMode mouseMode; - Node *leaderNode; - Grid *grid; - - Edge *modifyEdge; - BOOL firstControlPoint; - - int bboxLeftRight; - int bboxBottomTop; - - NSUndoManager *documentUndoManager; - NSPoint startPoint; - - TikzSourceController *tikzSourceController; -} - -@property BOOL enabled; -@property (weak) Graph *graph; -@property IBOutlet TikzSourceController *tikzSourceController; -@property (readonly) Transformer *transformer; -@property (readonly) PickSupport *pickSupport; - -- (void)setDocumentUndoManager:(NSUndoManager*)um; -- (void)applyStyleToSelectedNodes:(NodeStyle*)style; -- (void)applyStyleToSelectedEdges:(EdgeStyle*)style; - -- (void)updateMouseMode; -- (void)refreshLayers; - -//- (void)registerUndo:(GraphChange *)change withActionName:(NSString*)name; -- (void)registerUndo:(NSString*)oldTikz withActionName:(NSString*)name; -//- (void)undoGraphChange:(GraphChange *)change; -- (void)undoGraphChange:(NSString*)oldTikz; -- (void)postGraphChange; -- (void)postSelectionChange; - -- (void)deselectAll:(id)sender; -- (void)selectAll:(id)sender; -- (void)cut:(id)sender; -- (void)copy:(id)sender; -- (void)paste:(id)sender; -- (void)delete:(id)sender; -- (void)bringForward:(id)sender; -- (void)flipHorizonal:(id)sender; -- (void)flipVertical:(id)sender; -- (void)reverseEdgeDirection:(id)sender; - -@end diff --git a/tikzit-old/src/osx/GraphicsView.m b/tikzit-old/src/osx/GraphicsView.m deleted file mode 100644 index efa7ecb..0000000 --- a/tikzit-old/src/osx/GraphicsView.m +++ /dev/null @@ -1,1216 +0,0 @@ -// -// GraphicsView.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "GraphicsView.h" -#import "util.h" -#import "CALayer+DrawLabel.h" - -#import "NodeSelectionLayer.h" -#import "NodeLayer.h" -#import "EdgeControlLayer.h" -#import "AppDelegate.h" -#import "TikzGraphAssembler.h" -#import "TikzSourceController.h" - -@interface GraphicsView (Private) -- (void)setupLayers; -- (void)addNodeLayers:(Node*)n; -- (void)addEdgeLayers:(Edge*)e; -- (void)removeNodeLayers:(Node*)n; -- (void)resetMainOrigin; -- (void)setMainOrigin:(NSPoint)o; -@end - -static CGColorRef cgGrayColor, cgWhiteColor, cgClearColor = nil; - - -@implementation GraphicsView - -@synthesize enabled, transformer, pickSupport, tikzSourceController; - -- (void)postGraphChange { - [[NSNotificationCenter defaultCenter] postNotificationName:@"GraphChanged" - object:self]; - [self postSelectionChange]; -} - -- (void)postSelectionChange { - [[NSNotificationCenter defaultCenter] postNotificationName:@"SelectionChanged" - object:self]; -} - -- (id)initWithFrame:(NSRect)frame { - self = [super initWithFrame:frame]; - if (self) { - if (cgClearColor == nil) { - cgClearColor = CGColorGetConstantColor(kCGColorClear); - cgGrayColor = CGColorCreateGenericGray(0.5f, 0.5f); - cgWhiteColor = CGColorCreateGenericRGB(1, 1, 1, 1); - } - - transformer = [[Transformer alloc] init]; - mouseMode = SelectMode; - grid = [Grid gridWithSpacing:1.0f - subdivisions:4 - transformer:transformer]; - [grid setSize:NSSizeFromCGSize([gridLayer bounds].size)]; - [transformer setScale:PIXELS_PER_UNIT]; - - [self setupLayers]; - - leaderNode = nil; - pickSupport = [[PickSupport alloc] init]; - frameMoveMode = NO; - - enabled = YES; - [self setGraph:[Graph graph]]; - } - return self; -} - -- (void)awakeFromNib { - AppDelegate *del = [application delegate]; - stylePaletteController = [del stylePaletteController]; - toolPaletteController = [del toolPaletteController]; - [self refreshLayers]; - [self postGraphChange]; -} - -- (void)setupLayers { - mainLayer = [CALayer layer]; - [mainLayer setBackgroundColor:cgWhiteColor]; - [mainLayer setFrame:CGRectIntegral(NSRectToCGRect([self bounds]))]; - [mainLayer setOpacity:1.0f]; - [self setLayer:mainLayer]; - [self resetMainOrigin]; - - gridLayer = [CALayer layer]; - [gridLayer setDelegate:grid]; - [gridLayer setOpacity:0.3f]; - [mainLayer addSublayer:gridLayer]; - - graphLayer = [CALayer layer]; - [graphLayer setDelegate:self]; - [mainLayer addSublayer:graphLayer]; - - hudLayer = [CALayer layer]; - [mainLayer addSublayer:hudLayer]; - - selectionLayer = [SelectBoxLayer layer]; - [mainLayer addSublayer:selectionLayer]; - - [transformer setOrigin:NSMakePoint(NSMidX([self bounds]),NSMidY([self bounds]))]; - oldBounds = [self bounds]; - [self refreshLayers]; -} - -// Lion resume feature -//- (void)encodeRestorableStateWithCoder:(NSCoder*)coder { -// NSLog(@"got encode request"); -//} -//- (void)restoreStateWithCoder:(NSCoder*)coder { -// NSLog(@"got decode request"); -//} - -- (void)registerUndo:(NSString*)oldTikz withActionName:(NSString*)nm { - [documentUndoManager registerUndoWithTarget:self - selector:@selector(undoGraphChange:) - object:oldTikz]; - [documentUndoManager setActionName:nm]; -} - -- (void)revertToTikz:(NSString*)tikz { - [tikzSourceController setTikz:tikz]; - [tikzSourceController tryParseTikz]; - [self refreshLayers]; - [self postGraphChange]; -} - - -- (void)undoGraphChange:(NSString*)oldTikz { - NSString *currentTikz = [graph tikz]; - [self revertToTikz:oldTikz]; - [documentUndoManager registerUndoWithTarget:self - selector:@selector(undoGraphChange:) - object:currentTikz]; -} - -- (void)setGraph:(Graph*)gr { - graph = gr; - - NSEnumerator *e; - CALayer *layer; - - e = [edgeControlLayers objectEnumerator]; - while (layer = [e nextObject]) [layer removeFromSuperlayer]; - edgeControlLayers = [NSMapTable mapTableWithStrongToStrongObjects]; - - - e = [nodeLayers objectEnumerator]; - while (layer = [e nextObject]) [layer removeFromSuperlayer]; - nodeLayers = [NSMapTable mapTableWithStrongToStrongObjects]; - - for (Node *n in [graph nodes]) { - [n attachStyleFromTable:[stylePaletteController nodeStyles]]; - [self addNodeLayers:n]; - } - - for (Edge *e in [graph edges]) { - [e setAttributesFromData]; - [e attachStyleFromTable:[stylePaletteController edgeStyles]]; - [self addEdgeLayers:e]; - } -} - -- (Graph*)graph { return graph; } - -- (void)setMainOrigin:(NSPoint)o { - o.x = round(o.x); - o.y = round(o.y); - CGRect rect = [mainLayer frame]; - rect.origin = NSPointToCGPoint(o); - [mainLayer setFrame:rect]; -} - -- (void)resetMainOrigin { - NSRect bds = [self bounds]; - bds.origin.x -= bds.size.width; - bds.origin.y -= bds.size.height; - bds.size.width *= 3; - bds.size.height *= 3; - [mainLayer setFrame:NSRectToCGRect([self bounds])]; -} - -- (void)refreshLayers { - [gridLayer setFrame:[mainLayer frame]]; - [graphLayer setFrame:[mainLayer frame]]; - [hudLayer setFrame:[mainLayer frame]]; - [selectionLayer setFrame:[mainLayer frame]]; - - if (enabled) { - [hudLayer setBackgroundColor:cgClearColor]; - } else { - [hudLayer setBackgroundColor:cgGrayColor]; - } - - [grid setSize:NSSizeFromCGSize([gridLayer bounds].size)]; - [gridLayer setNeedsDisplay]; - [graphLayer setNeedsDisplay]; - [hudLayer setNeedsDisplay]; - - NSEnumerator *e = [edgeControlLayers objectEnumerator]; - CALayer *layer; - while (layer = [e nextObject]) { - [layer setFrame:[graphLayer frame]]; - [layer setNeedsDisplay]; - } -} - - -- (void)viewDidEndLiveResize { - [super viewDidEndLiveResize]; - NSPoint o = [transformer origin]; - o.x += round(([self bounds].size.width - oldBounds.size.width)/2.0f); - o.y += round(([self bounds].size.height - oldBounds.size.height)/2.0f); - [transformer setOrigin:o]; - oldBounds = [self bounds]; - [self refreshLayers]; -} - -- (void)applyStyleToSelectedNodes:(NodeStyle*)style { - NSString *oldTikz = [graph tikz]; - - for (Node *n in [pickSupport selectedNodes]) { - [n setStyle:style]; - [[nodeLayers objectForKey:n] setNeedsDisplay]; - } - - [self registerUndo:oldTikz withActionName:@"Apply Style to Nodes"]; - [self refreshLayers]; - [self postGraphChange]; -} - -- (void)applyStyleToSelectedEdges:(EdgeStyle*)style { - NSString *oldTikz = [graph tikz]; - - for (Edge *e in [pickSupport selectedEdges]) { - [e setStyle:style]; - } - - [self registerUndo:oldTikz withActionName:@"Apply Style to Edges"]; - [self refreshLayers]; - [self postGraphChange]; -} - -- (void)addNodeLayers:(Node*)n { - // add a node to the graph - [graph addNode:n]; - - NSPoint pt = [transformer toScreen:[n point]]; - - // add a node layer - NodeLayer *nl = [[NodeLayer alloc] initWithNode:n transformer:transformer]; - [nl setCenter:pt]; - [nodeLayers setObject:nl forKey:n]; - [graphLayer addSublayer:nl]; - [nl setNeedsDisplay]; -} - -- (void)removeNodeLayers:(Node*)n { - [[nodeLayers objectForKey:n] removeFromSuperlayer]; - [nodeLayers removeObjectForKey:n]; -} - -- (void)addEdgeLayers:(Edge *)e { - [graph addEdge:e]; - EdgeControlLayer *ecl = [[EdgeControlLayer alloc] initWithEdge:e andTransformer:transformer]; - [edgeControlLayers setObject:ecl forKey:e]; - [ecl setFrame:CGRectMake(10, 10, 100, 100)]; - [hudLayer addSublayer:ecl]; - [ecl setNeedsDisplay]; -} - -- (void)removeEdgeLayers:(Edge*)e { - [[edgeControlLayers objectForKey:e] removeFromSuperlayer]; - [edgeControlLayers removeObjectForKey:e]; - [self refreshLayers]; -} - -- (BOOL)circleWithCenter:(NSPoint)center andRadius:(float)radius containsPoint:(NSPoint)p { - float dx = center.x - p.x; - float dy = center.y - p.y; - return (dx*dx + dy*dy) <= radius*radius; -} - -- (BOOL)node:(Node*)node containsPoint:(NSPoint)p { - NodeLayer *nl = [nodeLayers objectForKey:node]; - return [nl nodeContainsPoint:p]; -} - -- (BOOL)edge:(Edge*)edge containsPoint:(NSPoint)p { -// NSPoint center = [transformer toScreen:edge.mid]; -// float dx = center.x - p.x; -// float dy = center.y - p.y; -// float radius = 5.0f; // tolerence for clicks -// return (dx*dx + dy*dy) <= radius*radius; - - CGContextRef ctx = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - - // Save the graphics state before doing the hit detection. - CGContextSaveGState(ctx); - - NSPoint src = [transformer toScreen:[edge tail]]; - NSPoint targ = [transformer toScreen:[edge head]]; - NSPoint cp1 = [transformer toScreen:[edge cp1]]; - NSPoint cp2 = [transformer toScreen:[edge cp2]]; - - CGContextSetLineWidth(ctx, 8.0f); - - CGContextMoveToPoint(ctx, src.x, src.y); - CGContextAddCurveToPoint(ctx, cp1.x, cp1.y, cp2.x, cp2.y, targ.x, targ.y); - - BOOL containsPoint = CGContextPathContainsPoint(ctx, NSPointToCGPoint(p), kCGPathStroke); - - CGContextSetRGBStrokeColor(ctx, 0, 0, 0, 0); - - CGContextStrokePath(ctx); - //CGContextFlush(ctx); - CGContextRestoreGState(ctx); - - return containsPoint; -} - -- (void)shiftNodes:(NSSet*)set from:(NSPoint)source to:(NSPoint)dest { - float dx = dest.x - source.x; - float dy = dest.y - source.y; - - for (Node *n in set) { - NSPoint p = [transformer toScreen:[n point]]; - p = [grid snapScreenPoint:NSMakePoint(p.x+dx, p.y+dy)]; - [n setPoint:[transformer fromScreen:p]]; - } -} - - -- (void)mouseDown:(NSEvent*)theEvent { - if (!enabled) return; - - [self updateMouseMode]; - - dragOrigin = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - dragTarget = dragOrigin; - - graphTikzOnMouseDown = [graph tikz]; - - if ([theEvent modifierFlags] & NSCommandKeyMask) { - oldTransformerOrigin = [transformer origin]; - oldMainOrigin = [self frame].origin; - frameMoveMode = YES; - return; - } - - if (mouseMode == SelectMode) { - [selectionLayer setActive:YES]; - [selectionLayer setSelectBox:NSRectAroundPoints(dragOrigin, dragOrigin)]; - [selectionLayer setNeedsDisplay]; - - modifyEdge = nil; - NSPoint cp1, cp2; - for (Edge *e in [pickSupport selectedEdges]) { - cp1 = [transformer toScreen:[e cp1]]; - cp2 = [transformer toScreen:[e cp2]]; - if ([self circleWithCenter:cp1 - andRadius:[EdgeControlLayer handleRadius] - containsPoint:dragOrigin]) - { - mouseMode = SelectEdgeBendMode; - modifyEdge = e; - firstControlPoint = YES; - break; - } else if ([self circleWithCenter:cp2 - andRadius:[EdgeControlLayer handleRadius] - containsPoint:dragOrigin]) - { - mouseMode = SelectEdgeBendMode; - modifyEdge = e; - firstControlPoint = NO; - break; - } - } - - if (modifyEdge == nil) { // skip all the rest if we're modifying an edge - - leaderNode = nil; - - // in first pass, try to find a leader node, under the mouse - for (Node* n in [graph nodes]) { - if ([self node:n containsPoint:dragOrigin]) { - leaderNode = n; - [gridLayer setOpacity:1.0f]; - break; - } - } - - // if we found one, deselect the others (if appropriate) and go to move mode - if (leaderNode != nil) { - startPoint = [leaderNode point]; - - // if we select a node, we should always deselect all edges: - for (Edge *e in [graph edges]) [[edgeControlLayers objectForKey:e] deselect]; - [pickSupport deselectAllEdges]; - - BOOL shouldDeselect = - !([theEvent modifierFlags] & NSShiftKeyMask) - && ![pickSupport isNodeSelected:leaderNode]; - for (Node *n in [graph nodes]) { - if (n != leaderNode && shouldDeselect) { - [pickSupport deselectNode:n]; - [[[nodeLayers objectForKey:n] selection] deselect]; - } - } - - // ensure the leader node is actually selected - if (![pickSupport isNodeSelected:leaderNode]) { - [pickSupport selectNode:leaderNode]; - [[[nodeLayers objectForKey:leaderNode] selection] select]; - } - - - // put us in move mode - mouseMode = SelectMoveMode; - } else { - mouseMode = SelectBoxMode; - - // if we didn't select a node, start hunting for an edge to select - BOOL shouldDeselect = !([theEvent modifierFlags] & NSShiftKeyMask); - - if (shouldDeselect) { - [pickSupport deselectAllEdges]; - for (Edge *e in graph.edges) [[edgeControlLayers objectForKey:e] deselect]; - } - - for (Edge* e in [graph edges]) { - // find the first node under the pointer, select it, show its controls - // and deselect all others if shift isn't down - if ([self edge:e containsPoint:dragOrigin]) { - for (Node *n in [pickSupport selectedNodes]) [[[nodeLayers objectForKey:n] selection] deselect]; - - [pickSupport deselectAllNodes]; - [pickSupport selectEdge:e]; - [[edgeControlLayers objectForKey:e] select]; - break; - } - } // end for e in [graph edges] - } // end if leaderNode == nil - } // end if modifyEdge == nil - - } else if (mouseMode == NodeMode) { - // do nothing... - } else if (mouseMode == EdgeMode) { - for (Node *n in [graph nodes]) { - if ([self node:n containsPoint:dragOrigin]) { - [[[nodeLayers objectForKey:n] selection] highlight]; - } - } - mouseMode = EdgeDragMode; - } else if (mouseMode == CropMode) { - if ([graph hasBoundingBox]) { - float fudge = 3; - - NSRect bb = [graph boundingBox]; - NSPoint bl = [transformer toScreen:bb.origin]; - NSPoint tr = [transformer - toScreen:NSMakePoint(bb.origin.x+bb.size.width, - bb.origin.y+bb.size.height)]; - if (dragOrigin.x > bl.x-fudge && dragOrigin.x < tr.x+fudge && - dragOrigin.y > tr.y-fudge && dragOrigin.y < tr.y+fudge) - { - bboxBottomTop = 1; - } else if (dragOrigin.x > bl.x-fudge && dragOrigin.x < tr.x+fudge && - dragOrigin.y > bl.y-fudge && dragOrigin.y < bl.y+fudge) - { - bboxBottomTop = -1; - } else { - bboxBottomTop = 0; - } - - if (dragOrigin.y > bl.y-fudge && dragOrigin.y < tr.y+fudge && - dragOrigin.x > tr.x-fudge && dragOrigin.x < tr.x+fudge) - { - bboxLeftRight = 1; - } else if (dragOrigin.y > bl.y-fudge && dragOrigin.y < tr.y+fudge && - dragOrigin.x > bl.x-fudge && dragOrigin.x < bl.x+fudge) - { - bboxLeftRight = -1; - } else { - bboxLeftRight = 0; - } - - if (bboxBottomTop != 0 || bboxLeftRight != 0) { - mouseMode = CropDragMode; - } - } - } else { - printf("WARNING: MOUSE DOWN IN INVALID MODE.\n"); - } - - [self refreshLayers]; -} - -- (void)mouseDragged:(NSEvent *)theEvent { - if (!enabled) return; - dragTarget = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - - if (frameMoveMode) { - NSPoint newTransOrigin, newMainOrigin; - NSPoint diff = NSMakePoint(dragTarget.x - dragOrigin.x, dragTarget.y - dragOrigin.y); - newTransOrigin.x = oldTransformerOrigin.x + diff.x; - newTransOrigin.y = oldTransformerOrigin.y + diff.y; - newMainOrigin.x = oldMainOrigin.x + diff.x; - newMainOrigin.y = oldMainOrigin.y + diff.y; - - [CATransaction begin]; - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; - [self setMainOrigin:newMainOrigin]; - [CATransaction commit]; - - [transformer setOrigin:newTransOrigin]; - return; - } - - if (mouseMode == SelectBoxMode) { - [selectionLayer setSelectBox:NSRectAroundPoints(dragOrigin, dragTarget)]; - [selectionLayer setNeedsDisplay]; - - for (Node* n in [graph nodes]) { - if (NSPointInRect([transformer toScreen:[n point]], [selectionLayer selectBox])) { - [[[nodeLayers objectForKey:n] selection] highlight]; - } else if (!([theEvent modifierFlags] & NSShiftKeyMask)) { - [[[nodeLayers objectForKey:n] selection] unhighlight]; - } - } - } else if (mouseMode == SelectMoveMode) { - if (leaderNode != nil) { - [self shiftNodes:[pickSupport selectedNodes] - from:[transformer toScreen:[leaderNode point]] - to:dragTarget]; - } else { - printf("WARNING: LEADER NODE SHOULD NOT BE NIL.\n"); - } - - [self refreshLayers]; - } else if (mouseMode == SelectEdgeBendMode) { - NSPoint src = [transformer toScreen:[[modifyEdge source] point]]; - NSPoint targ = [transformer toScreen:[[modifyEdge target] point]]; - float dx1 = targ.x - src.x; - float dy1 = targ.y - src.y; - float dx2, dy2; - if (firstControlPoint) { - dx2 = dragTarget.x - src.x; - dy2 = dragTarget.y - src.y; - } else { - dx2 = dragTarget.x - targ.x; - dy2 = dragTarget.y - targ.y; - } - float base_dist = sqrt(dx1*dx1 + dy1*dy1); - float handle_dist = sqrt(dx2*dx2 + dy2*dy2); - float wcourseness = 0.1f; - - if (![modifyEdge isSelfLoop]) { - if (base_dist != 0) { - [modifyEdge setWeight:roundToNearest(wcourseness, handle_dist/base_dist)]; - //round(handle_dist / (base_dist*wcourseness)) * wcourseness; - } else { - [modifyEdge setWeight: - roundToNearest(wcourseness, [transformer scaleFromScreen:handle_dist])]; - } - } - - - float control_angle = good_atan(dx2, dy2); - - int bcourseness = 15; - - if ([modifyEdge bendMode] == EdgeBendModeBasic) { - float bnd; - float base_angle = good_atan(dx1, dy1); - if (firstControlPoint) { - bnd = base_angle - control_angle; - } else { - bnd = control_angle - base_angle + pi; - if (bnd > pi) bnd -= 2*pi; - } - - [modifyEdge setBend:round(bnd * (180.0f / pi) * - (1.0f / (float)bcourseness)) * - bcourseness]; - } else { - int bnd = round(control_angle * (180.0f / pi) * - (1.0f / (float)bcourseness)) * - bcourseness; - if (firstControlPoint) { - if ([theEvent modifierFlags] & NSAlternateKeyMask) { - if ([modifyEdge isSelfLoop]) { - [modifyEdge setInAngle:[modifyEdge inAngle] + - (bnd - [modifyEdge outAngle])]; - } else { - [modifyEdge setInAngle:[modifyEdge inAngle] - - (bnd - [modifyEdge outAngle])]; - } - } - - [modifyEdge setOutAngle:bnd]; - } else { - if (theEvent.modifierFlags & NSAlternateKeyMask) { - if ([modifyEdge isSelfLoop]) { - [modifyEdge setOutAngle:[modifyEdge outAngle] + - (bnd - [modifyEdge inAngle])]; - } else { - [modifyEdge setOutAngle:[modifyEdge outAngle] - - (bnd - [modifyEdge inAngle])]; - } - } - - [modifyEdge setInAngle:bnd]; - } - } - - [self refreshLayers]; - } else if (mouseMode == NodeMode) { - // do nothing... - } else if (mouseMode == EdgeDragMode) { - for (Node *n in [graph nodes]) { - if ([self node:n containsPoint:dragOrigin] || - [self node:n containsPoint:dragTarget]) - { - [[[nodeLayers objectForKey:n] selection] highlight]; - } else { - [[[nodeLayers objectForKey:n] selection] unhighlight]; - } - } - - [self refreshLayers]; - } else if (mouseMode == CropMode || mouseMode == CropDragMode) { - NSPoint p1 = [transformer fromScreen:[grid snapScreenPoint:dragOrigin]]; - NSPoint p2 = [transformer fromScreen:[grid snapScreenPoint:dragTarget]]; - - NSRect bbox; - if (mouseMode == CropDragMode) { - bbox = [graph boundingBox]; - if (bboxBottomTop == -1) { - float dy = p2.y - bbox.origin.y; - bbox.origin.y += dy; - bbox.size.height -= dy; - } else if (bboxBottomTop == 1) { - float dy = p2.y - (bbox.origin.y + bbox.size.height); - bbox.size.height += dy; - } - - if (bboxLeftRight == -1) { - float dx = p2.x - bbox.origin.x; - bbox.origin.x += dx; - bbox.size.width -= dx; - } else if (bboxLeftRight == 1) { - float dx = p2.x - (bbox.origin.x + bbox.size.width); - bbox.size.width += dx; - } - } else { - bbox = NSRectAroundPoints(p1, p2); - } - - [graph setBoundingBox:bbox]; - [self postGraphChange]; - [self refreshLayers]; - } else { - printf("WARNING: MOUSE DRAGGED IN INVALID MODE.\n"); - } -} - -- (void)mouseUp:(NSEvent*)theEvent { - if (!enabled) return; - - if (frameMoveMode) { - [CATransaction begin]; - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; - [self resetMainOrigin]; - [self refreshLayers]; - [CATransaction commit]; - frameMoveMode = NO; - return; - } - - dragTarget = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - - if ((mouseMode & SelectMode) == SelectMode && [theEvent clickCount] == 2) { - for (Edge *e in [graph edges]) { - if ([self edge:e containsPoint:dragTarget]) { - if ([e bendMode] == EdgeBendModeBasic) { - [e convertBendToAngles]; - [e setBendMode:EdgeBendModeInOut]; - } else { - [e convertAnglesToBend]; - [e setBendMode:EdgeBendModeBasic]; - } - - [self registerUndo:graphTikzOnMouseDown withActionName:@"Change Edge Mode"]; - [self postGraphChange]; - break; - } - } - } - - if (mouseMode == SelectBoxMode) { - for (Node* n in [graph nodes]) { - if (NSPointInRect([transformer toScreen:[n point]], [selectionLayer selectBox])) { - [pickSupport selectNode:n]; - [[[nodeLayers objectForKey:n] selection] select]; - } else if (!([theEvent modifierFlags] & NSShiftKeyMask)) { - [pickSupport deselectNode:n]; - [[[nodeLayers objectForKey:n] selection] deselect]; - } - } - - [selectionLayer setActive:NO]; - [selectionLayer setNeedsDisplay]; - [self postSelectionChange]; - - mouseMode = SelectMode; - } else if (mouseMode == SelectMoveMode) { - [gridLayer setOpacity:0.3f]; - - if (dragTarget.x != dragOrigin.x || dragTarget.y != dragOrigin.y) { - [self registerUndo:graphTikzOnMouseDown withActionName:@"Shift Nodes"]; - } - - leaderNode = nil; - - [self postGraphChange]; - mouseMode = SelectMode; - } else if (mouseMode == SelectEdgeBendMode) { - [self registerUndo:graphTikzOnMouseDown withActionName:@"Adjust Edge"]; - [self postGraphChange]; - mouseMode = SelectMode; - modifyEdge = nil; - } else if (mouseMode == NodeMode) { - NSPoint coords = [transformer fromScreen:[grid snapScreenPoint:dragTarget]]; - Node *n = [Node nodeWithPoint:coords]; - [n setStyle:[stylePaletteController activeNodeStyle]]; - [graph addNode:n]; - - [self registerUndo:graphTikzOnMouseDown withActionName:@"Add Node"]; - - [self addNodeLayers:n]; - [self postGraphChange]; - } else if (mouseMode == EdgeDragMode) { - Node *src = nil; - Node *targ = nil; - BOOL found = NO; // don't break the loop until everything is unhighlighted - for (Node *n in [graph nodes]) { - [[[nodeLayers objectForKey:n] selection] unhighlight]; - if (!found) { - if ([self node:n containsPoint:dragOrigin]) src = n; - if ([self node:n containsPoint:dragTarget]) targ = n; - if (src != nil && targ != nil) { - Edge *e = [Edge edgeWithSource:src andTarget:targ]; - [e setStyle:[stylePaletteController activeEdgeStyle]]; - [graph addEdge:e]; - [self registerUndo:graphTikzOnMouseDown withActionName:@"Add Edge"]; - [self addEdgeLayers:e]; - found = YES; - } - } - } - - [self postGraphChange]; - mouseMode = EdgeMode; - } else if (mouseMode == CropMode || mouseMode == CropDragMode) { - if (dragOrigin.x == dragTarget.x && dragOrigin.y == dragTarget.y) { - [graph setBoundingBox:NSMakeRect(0, 0, 0, 0)]; - [self registerUndo:graphTikzOnMouseDown withActionName:@"Clear Bounding Box"]; - [self postGraphChange]; - } else { - [self registerUndo:graphTikzOnMouseDown withActionName:@"Change Bounding Box"]; - } - - mouseMode = CropMode; - } else { - if (! ([theEvent modifierFlags] & NSCommandKeyMask)) - printf("WARNING: MOUSE UP IN INVALID MODE.\n"); - } - - [self refreshLayers]; -} - -- (void)drawNode:(Node*)nd onLayer:(CALayer*)layer inContext:(CGContextRef)context { - NSPoint pt = [transformer toScreen:[nd point]]; - - NodeLayer *nl = [nodeLayers objectForKey:nd]; - //[nl setStrokeWidth:2.0f]; - [nl setCenter:pt andAnimateWhen:(mouseMode != SelectMoveMode)]; -} - -- (void)drawEdge:(Edge*)e onLayer:(CALayer*)layer inContext:(CGContextRef)context { - CGContextSaveGState(context); - NSPoint src = [transformer toScreen:[e tail]]; - NSPoint targ = [transformer toScreen:[e head]]; - NSPoint cp1 = [transformer toScreen:[e cp1]]; - NSPoint cp2 = [transformer toScreen:[e cp2]]; - - // all nodes have the same radius. this will need to be fixed - float sradius = 0;//(slayer.ghost) ? 0 : slayer.radius; - float tradius = 0;//(tlayer.ghost) ? 0 : tlayer.radius; - - float sdx = cp1.x - src.x; - float sdy = cp1.y - src.y; - float sdist = sqrt(sdx*sdx + sdy*sdy); - float sshortx = (sdist==0) ? 0 : sdx/sdist * sradius; - float sshorty = (sdist==0) ? 0 : sdy/sdist * sradius; - - float tdx = cp2.x - targ.x; - float tdy = cp2.y - targ.y; - float tdist = sqrt(tdx*tdx + tdy*tdy); - float tshortx = (tdist==0) ? 0 : tdx/tdist * tradius; - float tshorty = (tdist==0) ? 0 : tdy/tdist * tradius; - - CGContextMoveToPoint(context, src.x+sshortx, src.y+sshorty); - CGContextAddCurveToPoint(context, cp1.x, cp1.y, cp2.x, cp2.y, targ.x+tshortx, targ.y+tshorty); - - - float lineWidth = [transformer scaleToScreen:0.04f]; - - CGContextSetLineWidth(context, lineWidth); - CGContextSetRGBStrokeColor(context, 0, 0, 0, 1); - CGContextSetRGBFillColor(context, 0, 0, 0, 1); - CGContextStrokePath(context); - - if ([e style] != nil) { - NSPoint p1,p2,p3; - - // draw edge decoration - switch ([[e style] decorationStyle]) { - case ED_None: - break; - case ED_Tick: - p1 = [transformer toScreen:[e leftNormal]]; - p2 = [transformer toScreen:[e rightNormal]]; - CGContextMoveToPoint(context, p1.x, p1.y); - CGContextAddLineToPoint(context, p2.x, p2.y); - CGContextStrokePath(context); - break; - case ED_Arrow: - p1 = [transformer toScreen:[e leftNormal]]; - p2 = [transformer toScreen:[e midTan]]; - p3 = [transformer toScreen:[e rightNormal]]; - CGContextMoveToPoint(context, p1.x, p1.y); - CGContextAddLineToPoint(context, p2.x, p2.y); - CGContextAddLineToPoint(context, p3.x, p3.y); - CGContextStrokePath(context); - break; - } - - // draw arrow head - switch ([[e style] headStyle]) { - case AH_None: - break; - case AH_Plain: - p1 = [transformer toScreen:[e leftHeadNormal]]; - p2 = [transformer toScreen:[e head]]; - p3 = [transformer toScreen:[e rightHeadNormal]]; - CGContextMoveToPoint(context, p1.x, p1.y); - CGContextAddLineToPoint(context, p2.x, p2.y); - CGContextAddLineToPoint(context, p3.x, p3.y); - CGContextStrokePath(context); - break; - case AH_Latex: - p1 = [transformer toScreen:[e leftHeadNormal]]; - p2 = [transformer toScreen:[e head]]; - p3 = [transformer toScreen:[e rightHeadNormal]]; - CGContextMoveToPoint(context, p1.x, p1.y); - CGContextAddLineToPoint(context, p2.x, p2.y); - CGContextAddLineToPoint(context, p3.x, p3.y); - CGContextClosePath(context); - CGContextFillPath(context); - break; - } - - // draw arrow tail - switch ([[e style] tailStyle]) { - case AH_None: - break; - case AH_Plain: - p1 = [transformer toScreen:[e leftTailNormal]]; - p2 = [transformer toScreen:[e tail]]; - p3 = [transformer toScreen:[e rightTailNormal]]; - CGContextMoveToPoint(context, p1.x, p1.y); - CGContextAddLineToPoint(context, p2.x, p2.y); - CGContextAddLineToPoint(context, p3.x, p3.y); - CGContextStrokePath(context); - break; - case AH_Latex: - p1 = [transformer toScreen:[e leftTailNormal]]; - p2 = [transformer toScreen:[e tail]]; - p3 = [transformer toScreen:[e rightTailNormal]]; - CGContextMoveToPoint(context, p1.x, p1.y); - CGContextAddLineToPoint(context, p2.x, p2.y); - CGContextAddLineToPoint(context, p3.x, p3.y); - CGContextClosePath(context); - CGContextFillPath(context); - break; - } - } - - - CGContextRestoreGState(context); - - if ([e hasEdgeNode]) { - Node *en = [e edgeNode]; - NSPoint mid = [transformer toScreen:[e mid]]; - if (![[en label] isEqual:@""]) { - [layer drawLabel:[en label] - atPoint:mid - inContext:context - usingTrans:transformer]; - } - } - - EdgeControlLayer *ecl = [edgeControlLayers objectForKey:e]; - [ecl setNeedsDisplay]; -} - - -// draw the graph layer --(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { - for (Edge* e in [graph edges]) [self drawEdge:e onLayer:layer inContext:context]; - - for (Node* n in [graph nodes]) [self drawNode:n onLayer:layer inContext:context]; - - if ([graph hasBoundingBox]) { - CGRect bbox = NSRectToCGRect(NSIntegralRect( - [transformer rectToScreen:[graph boundingBox]])); - CGContextSetRGBStrokeColor(context, 1.0f, 0.7f, 0.5f, 1.0f); - CGContextSetLineWidth(context, 1.0f); - CGContextSetShouldAntialias(context, NO); - CGContextStrokeRect(context, bbox); - CGContextSetShouldAntialias(context, YES); - } - - if (mouseMode == EdgeDragMode) { - CGContextMoveToPoint(context, dragOrigin.x, dragOrigin.y); - CGContextAddLineToPoint(context, dragTarget.x, dragTarget.y); - CGContextSetLineWidth(context, 2); - CGContextSetRGBStrokeColor(context, 0, 0, 1, 1); - CGContextStrokePath(context); - } -} - -// if enabled, suppress the default "bonk" behaviour on key presses -- (void)keyDown:(NSEvent *)theEvent { - if (!enabled) [super keyDown:theEvent]; -} - -- (void)delete:(id)sender { - BOOL didDelete = NO; - NSString *oldTikz = [graph tikz]; - - if ([[pickSupport selectedNodes] count] != 0) { - GraphChange *change = [graph removeNodes:[pickSupport selectedNodes]]; - for (Node *n in [change affectedNodes]) [self removeNodeLayers:n]; - for (Edge *e in [change affectedEdges]) [self removeEdgeLayers:e]; - - [self refreshLayers]; - [self postGraphChange]; - didDelete = YES; - } - - if ([[pickSupport selectedEdges] count] != 0) { - [graph removeEdges:[pickSupport selectedEdges]]; - for (Edge *e in [pickSupport selectedEdges]) [self removeEdgeLayers:e]; - [self refreshLayers]; - [self postGraphChange]; - didDelete = YES; - } - - [pickSupport deselectAllNodes]; - [pickSupport deselectAllEdges]; - - if (didDelete) [self registerUndo:oldTikz withActionName:@"Delete Nodes or Edges"]; -} - -- (void)keyUp:(NSEvent *)theEvent { - if (!enabled) return; - - id sender = self; - switch ([theEvent keyCode]) { - case 51: // delete - [self delete:sender]; // "self" is the sender - break; - case 1: // S - [toolPaletteController setSelectedTool:TikzToolSelect]; - break; - case 45: // N - case 9: // V - [toolPaletteController setSelectedTool:TikzToolNode]; - break; - case 14: // E - [toolPaletteController setSelectedTool:TikzToolEdge]; - //[self updateMouseMode]; - break; - case 40: // K - [toolPaletteController setSelectedTool:TikzToolCrop]; - break; - } - [self refreshLayers]; -} - - -- (void)deselectAll:(id)sender { - [pickSupport deselectAllNodes]; - [pickSupport deselectAllEdges]; - - for (Node *n in [graph nodes]) { - [[[nodeLayers objectForKey:n] selection] deselect]; - } - - for (Edge *e in [graph edges]) { - [[edgeControlLayers objectForKey:e] deselect]; - } - - [self postSelectionChange]; -} - -- (void)selectAll:(id)sender { - [pickSupport selectAllNodes:[NSSet setWithArray:[graph nodes]]]; - - for (Node *n in [graph nodes]) { - [[[nodeLayers objectForKey:n] selection] select]; - } - - [self postSelectionChange]; -} - - -- (void)updateMouseMode { - switch (toolPaletteController.selectedTool) { - case TikzToolSelect: - mouseMode = SelectMode; - break; - case TikzToolNode: - mouseMode = NodeMode; - break; - case TikzToolEdge: - mouseMode = EdgeMode; - break; - case TikzToolCrop: - mouseMode = CropMode; - break; - } -} - -- (void)setDocumentUndoManager:(NSUndoManager *)um { - documentUndoManager = um; -} - -- (void)copy:(id)sender { - if ([[pickSupport selectedNodes] count] != 0) { - Graph *clip = [graph copyOfSubgraphWithNodes:[pickSupport selectedNodes]]; - NSString *tikz = [clip tikz]; - NSData *data = [tikz dataUsingEncoding:NSUTF8StringEncoding]; - //NSLog(@"about to copy: %@", tikz); - NSPasteboard *cb = [NSPasteboard generalPasteboard]; - [cb declareTypes:[NSArray arrayWithObject:@"tikzpicture"] owner:self]; - [cb setData:data forType:@"tikzpicture"]; - } -} - -- (void)cut:(id)sender { - if ([[pickSupport selectedNodes] count] != 0) { - [self copy:sender]; - [self delete:sender]; - - // otherwise, menu will say "Undo Delete Graph" - [documentUndoManager setActionName:@"Cut Graph"]; - } -} - -- (void)paste:(id)sender { - NSPasteboard *cb = [NSPasteboard generalPasteboard]; - NSString *type = [cb availableTypeFromArray:[NSArray arrayWithObject:@"tikzpicture"]]; - if (type) { - NSData *data = [cb dataForType:type]; - NSString *tikz = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - //NSLog(@"pasting tikz:\n%@",tikz); - Graph *clip = [TikzGraphAssembler parseTikz:tikz]; - if (clip) { - //NSLog(@"tikz pasted:\n%@",tikz); - NSRect graphBounds = [graph bounds]; - NSRect clipBounds = [clip bounds]; - float dx = graphBounds.origin.x + - graphBounds.size.width - - clipBounds.origin.x + 0.5f; - [clip shiftNodes:[clip nodes] byPoint:NSMakePoint(dx, 0)]; - - if ([[clip nodes] count] != 0) { - NSString *oldTikz = [graph tikz]; - [self deselectAll:self]; - - // select everything from the clipboard - for (Node *n in [clip nodes]) { - [n attachStyleFromTable:[stylePaletteController nodeStyles]]; - [self addNodeLayers:n]; - [pickSupport selectNode:n]; - [[[nodeLayers objectForKey:n] selection] select]; - } - - for (Edge *e in [clip edges]) { - [e attachStyleFromTable:[stylePaletteController edgeStyles]]; - [self addEdgeLayers:e]; - } - - [graph insertGraph:clip]; - - [self registerUndo:oldTikz withActionName:@"Paste Graph"]; - [self refreshLayers]; - [self postGraphChange]; - } - } else { - NSLog(@"Error: couldn't parse tikz picture from clipboard."); - } - - } -} - -- (void)bringForward:(id)sender { - NSString *oldTikz = [graph tikz]; - [graph bringNodesForward:[pickSupport selectedNodes]]; - [graph bringEdgesForward:[pickSupport selectedEdges]]; - [self registerUndo:oldTikz withActionName:@"Bring Forward"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (void)sendBackward:(id)sender { - NSString *oldTikz = [graph tikz]; - [graph sendNodesBackward:[pickSupport selectedNodes]]; - [graph sendEdgesBackward:[pickSupport selectedEdges]]; - [self registerUndo:oldTikz withActionName:@"Send Backward"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (void)bringToFront:(id)sender { - NSString *oldTikz = [graph tikz]; - [graph bringNodesToFront:[pickSupport selectedNodes]]; - [graph bringEdgesToFront:[pickSupport selectedEdges]]; - [self registerUndo:oldTikz withActionName:@"Bring to Front"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (void)sendToBack:(id)sender { - NSString *oldTikz = [graph tikz]; - [graph sendNodesToBack:[pickSupport selectedNodes]]; - [graph sendEdgesToBack:[pickSupport selectedEdges]]; - [self registerUndo:oldTikz withActionName:@"Send to Back"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (void)flipHorizonal:(id)sender { - NSString *oldTikz = [graph tikz]; - [graph flipHorizontalNodes:[pickSupport selectedNodes]]; - [self registerUndo:oldTikz withActionName:@"Flip Horizontal"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (void)flipVertical:(id)sender { - NSString *oldTikz = [graph tikz]; - [graph flipVerticalNodes:[pickSupport selectedNodes]]; - [self registerUndo:oldTikz withActionName:@"Flip Vertical"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (void)reverseEdgeDirection:(id)sender { - NSString *oldTikz = [graph tikz]; - - NSSet *es; - if ([[pickSupport selectedEdges] count] != 0) { - es = [pickSupport selectedEdges]; - } else { - es = [graph incidentEdgesForNodes:[pickSupport selectedNodes]]; - } - - for (Edge *e in es) [e reverse]; - - [self registerUndo:oldTikz withActionName:@"Flip Edge Direction"]; - [self postGraphChange]; - [self refreshLayers]; -} - -- (BOOL)acceptsFirstResponder { return YES; } -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { return YES; } -- (BOOL)canBecomeKeyView { return YES; } - - -@end diff --git a/tikzit-old/src/osx/Grid.h b/tikzit-old/src/osx/Grid.h deleted file mode 100644 index 76826e2..0000000 --- a/tikzit-old/src/osx/Grid.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// Grid.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Transformer.h" - -@interface Grid : NSObject { - float gridX, gridY; - //float gridCellX, gridCellY; - int subdivisions; - Transformer *transformer; - NSSize size; -} - -@property NSSize size; - -- (id)initWithSpacing:(float)spacing subdivisions:(int)subs transformer:(Transformer*)t; -+ (Grid*)gridWithSpacing:(float)spacing subdivisions:(int)subs transformer:(Transformer*)t; -- (NSPoint)snapScreenPoint:(NSPoint)p; -- (float)gridX; -- (float)gridY; -- (int)subdivisions; -- (void)setSubdivisions:(int)subs; - -// Grid can also draw itself on a layer -- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx; - -@end diff --git a/tikzit-old/src/osx/Grid.m b/tikzit-old/src/osx/Grid.m deleted file mode 100644 index aa35c1f..0000000 --- a/tikzit-old/src/osx/Grid.m +++ /dev/null @@ -1,152 +0,0 @@ -// -// Grid.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Grid.h" - - -@implementation Grid - -@synthesize size; - -- (id)initWithSpacing:(float)spacing - subdivisions:(int)subs - transformer:(Transformer*)t -{ - if (!(self = [super init])) return nil; - gridX = spacing; - gridY = spacing; - subdivisions = subs; - size.width = 0; - size.height = 0; - transformer = t; - return self; -} - -+ (Grid*)gridWithSpacing:(float)spacing - subdivisions:(int)subs - transformer:(Transformer*)t -{ - return [[Grid alloc] initWithSpacing:spacing - subdivisions:subs - transformer:t]; -} - -- (float)gridX { - return gridX; -} - -- (float)gridY { - return gridY; -} - -- (int)subdivisions { - return subdivisions; -} - -- (void)setSubdivisions:(int)subs { - subdivisions = subs; -} - -- (NSPoint)snapScreenPoint:(NSPoint)p { - NSPoint snap; - - float gridCellX = [transformer scaleToScreen:gridX] / (float)subdivisions; - float gridCellY = [transformer scaleToScreen:gridY] / (float)subdivisions; - - // snap along grid lines, relative to the origin - snap.x = floor(((p.x-[transformer origin].x)/gridCellX)+0.5)*gridCellX + [transformer origin].x; - snap.y = floor(((p.y-[transformer origin].y)/gridCellY)+0.5)*gridCellY + [transformer origin].y; - return snap; -} - --(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context -{ - CGContextSaveGState(context); - - CGContextSetShouldAntialias(context, NO); - - float x,y; - float grX = [transformer scaleToScreen:gridX]; - float grY = [transformer scaleToScreen:gridY]; - - float gridCellX = grX / (float)subdivisions; - float gridCellY = grY / (float)subdivisions; - - for (x = [transformer origin].x + gridCellX; x < size.width; x += gridCellX) { - CGContextMoveToPoint(context, x, 0); - CGContextAddLineToPoint(context, x, size.height); - } - - for (x = [transformer origin].x - gridCellX; x > 0; x -= gridCellX) { - CGContextMoveToPoint(context, x, 0); - CGContextAddLineToPoint(context, x, size.height); - } - - for (y = [transformer origin].y + gridCellY; y < size.height; y += gridCellY) { - CGContextMoveToPoint(context, 0, y); - CGContextAddLineToPoint(context, size.width, y); - } - - for (y = [transformer origin].y - gridCellY; y > 0; y -= gridCellY) { - CGContextMoveToPoint(context, 0, y); - CGContextAddLineToPoint(context, size.width, y); - } - - CGContextSetRGBStrokeColor(context, 0.9, 0.9, 1, 1); - CGContextStrokePath(context); - - for (x = [transformer origin].x + grX; x < size.width; x += grX) { - CGContextMoveToPoint(context, x, 0); - CGContextAddLineToPoint(context, x, size.height); - } - - for (x = [transformer origin].x - grX; x > 0; x -= grX) { - CGContextMoveToPoint(context, x, 0); - CGContextAddLineToPoint(context, x, size.height); - } - - for (y = [transformer origin].y + grY; y < size.height; y += grY) { - CGContextMoveToPoint(context, 0, y); - CGContextAddLineToPoint(context, size.width, y); - } - - for (y = [transformer origin].y + grY; y > 0; y -= grY) { - CGContextMoveToPoint(context, 0, y); - CGContextAddLineToPoint(context, size.width, y); - } - - CGContextSetRGBStrokeColor(context, 0.8, 0.8, 0.9, 1); - CGContextStrokePath(context); - - CGContextMoveToPoint(context, [transformer origin].x, 0); - CGContextAddLineToPoint(context, [transformer origin].x, size.height); - CGContextMoveToPoint(context, 0, [transformer origin].y); - CGContextAddLineToPoint(context, size.width, [transformer origin].y); - - CGContextSetRGBStrokeColor(context, 0.6, 0.6, 0.7, 1); - CGContextStrokePath(context); - - CGContextRestoreGState(context); -} - -@end diff --git a/tikzit-old/src/osx/MultiCombo.h b/tikzit-old/src/osx/MultiCombo.h deleted file mode 100644 index c8ec769..0000000 --- a/tikzit-old/src/osx/MultiCombo.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// MultiCombo.h -// TikZiT -// -// Created by Aleks Kissinger on 21/04/2011. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import - - -@interface MultiCombo : NSComboBox { - BOOL multi; -} - -@property (readwrite,assign) BOOL multi; - -@end diff --git a/tikzit-old/src/osx/MultiCombo.m b/tikzit-old/src/osx/MultiCombo.m deleted file mode 100644 index 8930460..0000000 --- a/tikzit-old/src/osx/MultiCombo.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// MultiCombo.m -// TikZiT -// -// Created by Aleks Kissinger on 21/04/2011. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import "MultiCombo.h" - - -@implementation MultiCombo - -- (void)textDidChange:(NSNotification *)notification { - [super textDidChange:notification]; - [self setMulti:NO]; -} - -- (void)setMulti:(BOOL)m { - multi = m; - if (multi) { - [self setTextColor:[NSColor grayColor]]; - [self setStringValue:@"multiple values"]; - } -} - -- (BOOL)multi { return multi; } - -- (BOOL)becomeFirstResponder { - [super becomeFirstResponder]; - if ([self multi]) { - [self setTextColor:[NSColor blackColor]]; - [self setStringValue:@""]; - } - return YES; -} - -@end diff --git a/tikzit-old/src/osx/MultiField.h b/tikzit-old/src/osx/MultiField.h deleted file mode 100644 index 39eeefa..0000000 --- a/tikzit-old/src/osx/MultiField.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// LabelField.h -// TikZiT -// -// Created by Aleks Kissinger on 20/04/2011. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import - - -@interface MultiField : NSTextField { - BOOL multi; -} - -@property (readwrite,assign) BOOL multi; - -@end diff --git a/tikzit-old/src/osx/MultiField.m b/tikzit-old/src/osx/MultiField.m deleted file mode 100644 index 7c5aac3..0000000 --- a/tikzit-old/src/osx/MultiField.m +++ /dev/null @@ -1,53 +0,0 @@ -// -// LabelField.m -// TikZiT -// -// Created by Aleks Kissinger on 20/04/2011. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import "MultiField.h" - - -@implementation MultiField - -- (void)textDidChange:(NSNotification *)notification { - [super textDidChange:notification]; - [self setMulti:NO]; -} - -- (void)setMulti:(BOOL)m { - multi = m; - if (multi) { - [self setTextColor:[NSColor grayColor]]; - [self setStringValue:@"multiple values"]; - } -} - -- (BOOL)multi { return multi; } - -- (BOOL)becomeFirstResponder { - [super becomeFirstResponder]; - if ([self multi]) { - [self setTextColor:[NSColor blackColor]]; - [self setStringValue:@""]; - } - return YES; -} - -//- (BOOL)textShouldBeginEditing:(NSText *)textObject { -// [super textShouldBeginEditing:textObject]; -// NSLog(@"about to type"); -// return YES; -//} - -//- (void)textDidEndEditing:(NSNotification *)obj { -// [super textDidEndEditing:obj]; -// -// NSLog(@"focus lost"); -// if ([self multi]) { -// [self setMulti:YES]; -// } -//} - -@end diff --git a/tikzit-old/src/osx/NilToEmptyStringTransformer.h b/tikzit-old/src/osx/NilToEmptyStringTransformer.h deleted file mode 100644 index 1445a94..0000000 --- a/tikzit-old/src/osx/NilToEmptyStringTransformer.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// NilToEmptyStringTransformer.h -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -@interface NilToEmptyStringTransformer : NSValueTransformer - -@end diff --git a/tikzit-old/src/osx/NilToEmptyStringTransformer.m b/tikzit-old/src/osx/NilToEmptyStringTransformer.m deleted file mode 100644 index 413f404..0000000 --- a/tikzit-old/src/osx/NilToEmptyStringTransformer.m +++ /dev/null @@ -1,53 +0,0 @@ -// -// NilToEmptyStringTransformer.m -// TikZiT -// -// Copyright 2011 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "NilToEmptyStringTransformer.h" - -@implementation NilToEmptyStringTransformer - -- (id)init { - if (!(self = [super init])) return nil; - return self; -} - -+ (Class)transformedValueClass { - return [NSString class]; -} - -+ (BOOL)allowsReverseTransformation { - return YES; -} - -- (id)transformedValue:(id)value { - if (value == nil) { - return @""; - } else { - return value; - } -} - -- (id)reverseTransformedValue:(id)value { - return [self transformedValue:value]; -} - -@end diff --git a/tikzit-old/src/osx/NodeLayer.h b/tikzit-old/src/osx/NodeLayer.h deleted file mode 100644 index dbcdac5..0000000 --- a/tikzit-old/src/osx/NodeLayer.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// NodeLayer.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import -#import "Transformer.h" -#import "Shape.h" -#import "Node.h" -#import "NodeStyle+Coder.h" -#import "NodeSelectionLayer.h" - -@interface NodeLayer : CALayer { - Node *node; - Shape *shape; - CGMutablePathRef path; - float textwidth; - NSPoint center; - Transformer *transformer; - Transformer *localTrans; - NodeSelectionLayer *selection; - BOOL rescale; - BOOL dirty; // need to rebuild CGBezierPath of the shape -} - -@property (strong) Node *node; -@property (assign) NSPoint center; -@property (assign) BOOL rescale; -@property (strong) NodeSelectionLayer *selection; -@property (readonly) CGMutablePathRef path; - -- (id)initWithNode:(Node*)n transformer:(Transformer*)t; -- (NSColor*)strokeColor; -- (NSColor*)fillColor; -- (float)strokeWidth; - -- (void)setCenter:(NSPoint)ctr andAnimateWhen:(BOOL)anim; -- (void)updateFrame; -- (BOOL)nodeContainsPoint:(NSPoint)p; - -- (void)drawInContext:(CGContextRef)context; - -@end diff --git a/tikzit-old/src/osx/NodeLayer.m b/tikzit-old/src/osx/NodeLayer.m deleted file mode 100644 index 5d15585..0000000 --- a/tikzit-old/src/osx/NodeLayer.m +++ /dev/null @@ -1,238 +0,0 @@ -// -// NodeLayer.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "NodeLayer.h" -#import "CALayer+DrawLabel.h" -#import "NSString+LatexConstants.h" -#import "Shape.h" -#import "ShapeNames.h" -#import "Node.h" -#import "Edge.h" - -@implementation NodeLayer - -@synthesize node, selection, rescale; - -- (id)initWithNode:(Node *)n transformer:(Transformer*)t { - if (!(self = [super init])) return nil; - node = n; - selection = [[NodeSelectionLayer alloc] init]; - [selection setNodeLayer:self]; - localTrans = [[Transformer alloc] init]; - - [self addSublayer:selection]; - textwidth = 0.0f; - center = NSMakePoint(0.0f, 0.0f); - transformer = t; - - path = NULL; - rescale = YES; - dirty = YES; - - [self updateFrame]; - return self; -} - -- (NSColor*)strokeColor { - if ([node style] != nil) { - return [[[node style] strokeColor] colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; - } else { - return nil; - } -} - -- (NSColor*)fillColor { - if ([node style] != nil) { - return [[[node style] fillColor] colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; - } else { - return nil; - } -} - -- (float)strokeWidth { - if ([node style] != nil) { - return [node.style strokeThickness]; - } else { - return [NodeStyle defaultStrokeThickness]; - } -} - -- (NSPoint)center { return center; } - -- (void)setCenter:(NSPoint)ctr { - center.x = round(ctr.x); - center.y = round(ctr.y); - [self updateFrame]; -} - -- (void)setCenter:(NSPoint)ctr andAnimateWhen:(BOOL)anim { - [CATransaction begin]; - if (!anim) { - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; - } - [self setCenter:ctr]; - [CATransaction commit]; -} - -- (void)updateShape { - Shape *s = ([node style] != nil) ? - [Shape shapeForName:[[node style] shapeName]] : - [Shape shapeForName:SHAPE_CIRCLE]; - if (s != shape) { // straight pointer comparison - shape = s; - dirty = YES; - } -} - -- (void)updateLocalTrans { - float scale = ([node style] != nil) ? [[node style] scale] : 1.0f; - - Transformer *t = [Transformer transformer]; - float rad = ([transformer scaleToScreen:scale] / 2.0f) + 8.0f; - [t setOrigin:NSMakePoint(rad, rad)]; - [t setScale:[transformer scale]*((rescale)?scale:0.8f)]; - - if (![localTrans isEqual:t]) { - dirty = YES; - localTrans = t; - } -} - -- (void)updateFrame { - [self updateLocalTrans]; - [self updateShape]; - float rad = [localTrans origin].x; - [self setFrame:CGRectIntegral(CGRectMake(center.x - rad, center.y - rad, 2*rad, 2*rad))]; - NSRect bds = NSMakeRect(0, 0, 2*rad, 2*rad); - [selection setFrame:NSRectToCGRect(bds)]; - - [self setNeedsDisplay]; - [selection setNeedsDisplay]; -} - -- (CGMutablePathRef)path { - if (dirty) { - CGMutablePathRef pth = CGPathCreateMutable(); - NSPoint p, cp1, cp2; - for (NSArray *arr in [shape paths]) { - BOOL fst = YES; - for (Edge *e in arr) { - if (fst) { - fst = NO; - p = [localTrans toScreen:[[e source] point]]; - CGPathMoveToPoint(pth, nil, p.x, p.y); - } - - p = [localTrans toScreen:[[e target] point]]; - if ([e isStraight]) { - CGPathAddLineToPoint(pth, nil, p.x, p.y); - } else { - cp1 = [localTrans toScreen:[e cp1]]; - cp2 = [localTrans toScreen:[e cp2]]; - CGPathAddCurveToPoint(pth, nil, cp1.x, cp1.y, cp2.x, cp2.y, p.x, p.y); - } - } - - CGPathCloseSubpath(pth); - } - - if (path != NULL) CFRelease(path); - path = pth; - dirty = NO; - } - - - return path; -} - -- (BOOL)nodeContainsPoint:(NSPoint)p { - CGPoint p1 = CGPointMake(p.x - [self frame].origin.x, p.y - [self frame].origin.y); - return CGPathContainsPoint([self path],nil,p1,NO); -} - - -- (void)drawInContext:(CGContextRef)context { - CGContextSaveGState(context); - - - if ([node style] == nil) { - CGContextSetRGBStrokeColor(context, 0.4f, 0.4f, 0.7f, 1.0f); - CGContextSetRGBFillColor(context, 0.4f, 0.4f, 0.7f, 1.0f); - //CGRect fr = [self frame]; - CGRect bds = NSRectToCGRect([localTrans rectToScreen:NSMakeRect(-0.5, -0.5, 1, 1)]); - CGRect pt = CGRectMake(CGRectGetMidX(bds)-1.0f, CGRectGetMidY(bds)-1.0f, 2.0f, 2.0f); - CGContextSetLineWidth(context, 0); - CGContextAddEllipseInRect(context, pt); - CGContextFillPath(context); - - // HACK: for some reason, CGFloat isn't getting typedef'ed properly - -#ifdef __x86_64__ - const double dash[2] = {2.0,2.0}; -#else - const float dash[2] = {2.0,2.0}; -#endif - CGContextSetLineDash(context, 0.0, dash, 2); - CGContextSetLineWidth(context, 1); - CGContextAddPath(context, [self path]); - CGContextStrokePath(context); - } else { - NSColor *stroke = [self strokeColor]; - NSColor *fill = [self fillColor]; - - CGContextSetRGBStrokeColor(context, - [stroke redComponent], - [stroke greenComponent], - [stroke blueComponent], - [stroke alphaComponent]); - - CGContextSetLineWidth(context, [self strokeWidth]); - - CGContextSetRGBFillColor(context, - [fill redComponent], - [fill greenComponent], - [fill blueComponent], - [fill alphaComponent]); - - - CGContextSetLineWidth(context, [self strokeWidth]); - CGContextAddPath(context, [self path]); - CGContextDrawPath(context, kCGPathFillStroke); - } - - if (!([node label] == nil || [[node label] isEqual:@""])) { - NSPoint labelPt = NSMakePoint([self frame].size.width/2, [self frame].size.height/2); - [self drawLabel:[[node label] stringByExpandingLatexConstants] - atPoint:labelPt - inContext:context - usingTrans:transformer]; - } - - CGContextRestoreGState(context); -} - -- (void)dealloc { - if (path != NULL) CFRelease(path); -} - -@end diff --git a/tikzit-old/src/osx/NodeSelectionLayer.h b/tikzit-old/src/osx/NodeSelectionLayer.h deleted file mode 100644 index 99ee75f..0000000 --- a/tikzit-old/src/osx/NodeSelectionLayer.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// NodeSelectionLayer.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import -#import "Shape.h" - -@class NodeLayer; - -@interface NodeSelectionLayer : CALayer { - BOOL selected; - CGMutablePathRef path; - NSLock *drawLock; - NodeLayer *nodeLayer; -} - -@property NodeLayer *nodeLayer; - -- (id)init; -- (void)select; -- (void)deselect; -- (void)highlight; -- (void)unhighlight; - -@end diff --git a/tikzit-old/src/osx/NodeSelectionLayer.m b/tikzit-old/src/osx/NodeSelectionLayer.m deleted file mode 100644 index 02b8ac2..0000000 --- a/tikzit-old/src/osx/NodeSelectionLayer.m +++ /dev/null @@ -1,93 +0,0 @@ -// -// NodeSelectionLayer.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "NodeSelectionLayer.h" -#import "NodeLayer.h" -#import "CircleShape.h" - -@implementation NodeSelectionLayer - -@synthesize nodeLayer; - -- (id)init { - if (!(self = [super init])) return nil; - selected = NO; - drawLock = [[NSLock alloc] init]; - nodeLayer = nil; - [self setOpacity:0.0f]; - return self; -} - - -- (void)select { - selected = YES; - [self setOpacity:0.5f]; -} - -- (void)deselect { - selected = NO; - [self setOpacity:0.0f]; -} - -- (void)highlight { - if (!selected) { - [self setOpacity:0.25f]; - } -} - -- (void)unhighlight { - if (!selected) { - [self setOpacity:0.0f]; - } -} - -//- (CGMutablePathRef)path { -// return path; -//} -// -//- (void)setPath:(CGMutablePathRef)p { -// path = CGPathCreateMutableCopy(p); -// CFMakeCollectable(path); -//} - -- (void)drawInContext:(CGContextRef)context { - [drawLock lock]; - CGContextSaveGState(context); - - //CGContextSetRGBStrokeColor(context, 0.61f, 0.735f, 1.0f, 1.0f); - CGContextSetRGBStrokeColor(context, 0.61f, 0.735f, 1.0f, 1.0f); - CGContextSetRGBFillColor(context, 0.61f, 0.735f, 1.0f, 1.0f); - CGContextSetLineWidth(context, 6.0f); - - if (nodeLayer != nil) { - CGContextAddPath(context, [nodeLayer path]); - } else { - NSLog(@"WARNING: attempting to draw selection with path = nil."); - } - CGContextDrawPath(context, kCGPathFillStroke); - - CGContextRestoreGState(context); - [drawLock unlock]; -} - -@end diff --git a/tikzit-old/src/osx/NodeStyle+Coder.h b/tikzit-old/src/osx/NodeStyle+Coder.h deleted file mode 100644 index b6443af..0000000 --- a/tikzit-old/src/osx/NodeStyle+Coder.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// NodeStyle+Coder.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "NodeStyle.h" - - -@interface NodeStyle(Coder) - -@property (copy) NSColor *fillColor; -@property (copy) NSColor *strokeColor; - -- (id)initWithCoder:(NSCoder *)coder; -- (void)encodeWithCoder:(NSCoder *)coder; - -@end diff --git a/tikzit-old/src/osx/NodeStyle+Coder.m b/tikzit-old/src/osx/NodeStyle+Coder.m deleted file mode 100644 index d3623f5..0000000 --- a/tikzit-old/src/osx/NodeStyle+Coder.m +++ /dev/null @@ -1,91 +0,0 @@ -// -// NodeStyle+Coder.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "NodeStyle+Coder.h" -#import "ShapeNames.h" - -@implementation NodeStyle(Coder) - -- (NSColor*)fillColor { - return [NSColor colorWithDeviceRed:fillColorRGB.redFloat - green:fillColorRGB.greenFloat - blue:fillColorRGB.blueFloat - alpha:1.0f]; -} - -- (void)setFillColor:(NSColor*)c { - NSColor *c1 = [c colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - [self willChangeValueForKey:@"fillColorIsKnown"]; - fillColorRGB = [ColorRGB colorWithFloatRed:c1.redComponent - green:c1.greenComponent - blue:c1.blueComponent]; - [self didChangeValueForKey:@"fillColorIsKnown"]; -} - -- (NSColor*)strokeColor { - return [NSColor colorWithDeviceRed:strokeColorRGB.redFloat - green:strokeColorRGB.greenFloat - blue:strokeColorRGB.blueFloat - alpha:1.0f]; -} - -- (void)setStrokeColor:(NSColor*)c { - NSColor *c1 = [c colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - [self willChangeValueForKey:@"strokeColorIsKnown"]; - strokeColorRGB = [ColorRGB colorWithFloatRed:c1.redComponent - green:c1.greenComponent - blue:c1.blueComponent]; - [self didChangeValueForKey:@"strokeColorIsKnown"]; -} - -- (id)initWithCoder:(NSCoder *)coder { - if (!(self = [super init])) return nil; - - // decode keys - name = [coder decodeObjectForKey:@"name"]; - [self setStrokeColor:[coder decodeObjectForKey:@"strokeColor"]]; - [self setFillColor:[coder decodeObjectForKey:@"fillColor"]]; - strokeThickness = [coder decodeIntForKey:@"strokeThickness"]; - shapeName = [coder decodeObjectForKey:@"shapeName"]; - category = [coder decodeObjectForKey:@"category"]; - scale = [coder decodeFloatForKey:@"scale"]; - - // apply defaults - if (scale == 0.0f) scale = 1.0f; - if (shapeName == nil) shapeName = SHAPE_CIRCLE; - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [coder encodeObject:name forKey:@"name"]; - [coder encodeObject:[self strokeColor] forKey:@"strokeColor"]; - [coder encodeObject:[self fillColor] forKey:@"fillColor"]; - [coder encodeInt:strokeThickness forKey:@"strokeThickness"]; - [coder encodeObject:shapeName forKey:@"shapeName"]; - [coder encodeObject:category forKey:@"category"]; - [coder encodeFloat:scale forKey:@"scale"]; -} - - -@end diff --git a/tikzit-old/src/osx/ParseErrorView.h b/tikzit-old/src/osx/ParseErrorView.h deleted file mode 100644 index bb6141f..0000000 --- a/tikzit-old/src/osx/ParseErrorView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ParseErrorView.h -// TikZiT -// -// Created by Karl Johan Paulsson on 27/01/2013. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// - -#import - -@interface ParseErrorView : NSView - -@end diff --git a/tikzit-old/src/osx/ParseErrorView.m b/tikzit-old/src/osx/ParseErrorView.m deleted file mode 100644 index 83383f0..0000000 --- a/tikzit-old/src/osx/ParseErrorView.m +++ /dev/null @@ -1,40 +0,0 @@ -// -// ParseErrorView.m -// TikZiT -// -// Created by Karl Johan Paulsson on 27/01/2013. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// - -#import "ParseErrorView.h" - -@implementation ParseErrorView - -- (id)initWithFrame:(NSRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - // Initialization code here. - } - - return self; -} - -- (void)drawRect:(NSRect)dirtyRect -{ - // Drawing code here. -} - -- (void)awakeFromNib{ - self.layer = [CALayer layer]; - self.wantsLayer = YES; - CALayer *newLayer = [CALayer layer]; - self.layer.backgroundColor = [[NSColor controlColor] CGColor]; - //CGColorCreate(CGColorSpaceCreateDeviceRGB(), (CGFloat[]){ 1, .9, .64, 1 }); -// newLayer.backgroundColor = [NSColor redColor].CGColor; - newLayer.frame = CGRectMake(100,100,100,100);//NSMakeRect(0,0,image.size.width,image.size.height); - newLayer.position = CGPointMake(20,20); - //[self.layer addSublayer:newLayer]; -} - -@end diff --git a/tikzit-old/src/osx/PreambleController.h b/tikzit-old/src/osx/PreambleController.h deleted file mode 100644 index 5b0931d..0000000 --- a/tikzit-old/src/osx/PreambleController.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// PreambleController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "Preambles.h" -#import "Preambles+Coder.h" - -@interface PreambleController : NSViewController { - Preambles *preambles; - IBOutlet NSTextView *textView; - IBOutlet NSDictionaryController *preambleDictionaryController; - - NSDictionary *textAttrs; - NSAttributedString *preambleText; - NSColor *ghostColor; - NSIndexSet *selectionIndexes; -} - -@property (readonly) BOOL useDefaultPreamble; -@property (readonly) Preambles *preambles; -@property (strong) NSAttributedString *preambleText; -@property (strong) NSIndexSet *selectionIndexes; - -- (id)initWithNibName:(NSString *)nibName plist:(NSString*)plist styles:(NSArray*)sty edges:(NSArray*)edg; -- (void)savePreambles:(NSString*)plist; -- (NSString*)currentPreamble; -- (NSString*)currentPostamble; -- (NSString*)buildDocumentForTikz:(NSString*)tikz; - -- (IBAction)setPreambleToDefault:(id)sender; -- (IBAction)setPreamble:(id)sender; -- (IBAction)insertDefaultStyles:(id)sender; - -- (IBAction)addPreamble:(id)sender; -- (IBAction)duplicatePreamble:(id)sender; - -@end diff --git a/tikzit-old/src/osx/PreambleController.m b/tikzit-old/src/osx/PreambleController.m deleted file mode 100644 index 206bb30..0000000 --- a/tikzit-old/src/osx/PreambleController.m +++ /dev/null @@ -1,168 +0,0 @@ -// -// PreambleController.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "PreambleController.h" - - -@implementation PreambleController - -@synthesize preambleText, preambles; - -- (id)initWithNibName:(NSString *)nibName plist:(NSString*)plist styles:(NSArray*)sty edges:(NSArray*)edg { - if (!(self = [super initWithNibName:nibName bundle:Nil])) return nil; - - preambles = (Preambles*)[NSKeyedUnarchiver unarchiveObjectWithFile:plist]; - [preambles setStyles:sty]; - [preambles setEdges:edg]; - if (preambles == nil) preambles = [[Preambles alloc] init]; - - preambleText = nil; - - NSFont *font = [NSFont userFixedPitchFontOfSize:11.0f]; - textAttrs = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName]; - ghostColor = [NSColor colorWithDeviceRed:0.9f green:0.9f blue:0.9f alpha:1.0f]; - - - - return self; -} - -- (void)awakeFromNib { - NSArray *arr = [preambleDictionaryController arrangedObjects]; - NSString *current = [preambles selectedPreambleName]; - - if (current != nil && ![current isEqual:@"default"]) { - for (int i = 0; i < [arr count]; ++i) { - if ([[[arr objectAtIndex:i] key] isEqual:current]) { - [self setSelectionIndexes:[NSIndexSet indexSetWithIndex:i]]; - break; - } - } - } -} - -- (BOOL)useDefaultPreamble { - return [[preambles selectedPreambleName] isEqualToString:@"default"]; -} - -- (void)flushText { - if (preambleText != nil && ![self useDefaultPreamble]) { - [preambles setCurrentPreamble:[preambleText string]]; - } -} - -- (void)setCurrentPreamble:(NSString*)current { - [self flushText]; - - [self willChangeValueForKey:@"useDefaultPreamble"]; - [preambles setSelectedPreambleName:current]; - [self didChangeValueForKey:@"useDefaultPreamble"]; - - [self setPreambleText: - [[NSAttributedString alloc] initWithString:[preambles currentPreamble] - attributes:textAttrs]]; -} - -- (void)savePreambles:(NSString*)plist { - [self flushText]; - [NSKeyedArchiver archiveRootObject:preambles toFile:plist]; -} - -- (NSString*)currentPreamble { - [self flushText]; - return [preambles currentPreamble]; -} - -- (NSString*)currentPostamble { - return [preambles currentPostamble]; -} - -- (NSString*)buildDocumentForTikz:(NSString*)tikz { - [self flushText]; - return [preambles buildDocumentForTikz:tikz]; -} - -- (void)setSelectionIndexes:(NSIndexSet *)idx { - [self willChangeValueForKey:@"selectionIndexes"]; - selectionIndexes = idx; - [self didChangeValueForKey:@"selectionIndexes"]; - - [self setPreamble:self]; -} - -- (NSIndexSet*)selectionIndexes { - return selectionIndexes; -} - -- (IBAction)setPreambleToDefault:(id)sender{ - [self setCurrentPreamble:@"default"]; - [textView setBackgroundColor:ghostColor]; -} - -- (IBAction)setPreamble:(id)sender { - //if ([[toolbar selectedItemIdentifier] isEqualToString:[defaultToolbarItem itemIdentifier]]) { - // [self setCurrentPreamble:@"default"]; - // [textView setBackgroundColor:ghostColor]; - //} else if ([[toolbar selectedItemIdentifier] isEqualToString:[customToolbarItem itemIdentifier]]) { - NSString *key = nil; - if ([selectionIndexes count]==1) { - int i = [selectionIndexes firstIndex]; - key = [[[preambleDictionaryController arrangedObjects] objectAtIndex:i] key]; - } - if (key != nil) { - [self setCurrentPreamble:key]; - //NSLog(@"preamble set to %@", key); - } else { - [self setCurrentPreamble:@"custom"]; - //NSLog(@"preamble set to custom"); - } - [textView setBackgroundColor:[NSColor whiteColor]]; - //} -} - -- (IBAction)insertDefaultStyles:(id)sender { - [textView insertText:[preambles styleDefinitions]]; -} - -- (IBAction)addPreamble:(id)sender { - [preambleDictionaryController setInitialKey:@"new preamble"]; - [preambleDictionaryController setInitialValue:[preambles defaultPreamble]]; - [preambleDictionaryController add:sender]; -} - -- (void)controlTextDidEndEditing:(NSNotification *)obj { - //NSLog(@"got a text change"); - [self setPreamble:[obj object]]; -} - - -// NOT IMPLEMENTED -- (IBAction)duplicatePreamble:(id)sender { -// NSLog(@"set text to: %@", [preambles currentPreamble]); -// [preambleDictionaryController setInitialKey:[preambles selectedPreambleName]]; -// [preambleDictionaryController setInitialValue:[preambles currentPreamble]]; -// [preambleDictionaryController add:sender]; -} - - -@end diff --git a/tikzit-old/src/osx/Preambles+Coder.h b/tikzit-old/src/osx/Preambles+Coder.h deleted file mode 100644 index 5a270c5..0000000 --- a/tikzit-old/src/osx/Preambles+Coder.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// Preambles+Coder.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Preambles.h" -#import - -@interface Preambles (Coder) - -- (id)initWithCoder:(NSCoder *)coder; -- (void)encodeWithCoder:(NSCoder *)coder; - -@end diff --git a/tikzit-old/src/osx/Preambles+Coder.m b/tikzit-old/src/osx/Preambles+Coder.m deleted file mode 100644 index 5e468b2..0000000 --- a/tikzit-old/src/osx/Preambles+Coder.m +++ /dev/null @@ -1,41 +0,0 @@ -// -// Preambles+Coder.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "Preambles+Coder.h" - - -@implementation Preambles (Coder) - -- (id)initWithCoder:(NSCoder *)coder { - if (!(self = [super init])) return nil; - selectedPreambleName = [coder decodeObjectForKey:@"selectedPreamble"]; - preambleDict = [coder decodeObjectForKey:@"preambles"]; - return self; -} - -- (void)encodeWithCoder:(NSCoder *)coder { - [coder encodeObject:selectedPreambleName forKey:@"selectedPreamble"]; - [coder encodeObject:preambleDict forKey:@"preambles"]; -} - -@end diff --git a/tikzit-old/src/osx/PreferenceController.h b/tikzit-old/src/osx/PreferenceController.h deleted file mode 100644 index b2b23f3..0000000 --- a/tikzit-old/src/osx/PreferenceController.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// PreferenceController.h -// TikZiT -// -// Created by Karl Johan Paulsson on 26/02/2013. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "UpdatePreferenceController.h" -#import "PreambleController.h" -#import "CustomNodeController.h" - -@interface PreferenceController : NSWindowController{ - - IBOutlet NSView *engineView; - IBOutlet NSView *generalView; - IBOutlet NSView *updateView; - IBOutlet NSView *preambleView; - IBOutlet NSView *customNodeView; - - UpdatePreferenceController *updateController; - PreambleController *preambleController; - CustomNodeController *customNodeController; - - int currentViewTag; -} - -- (id)initWithWindowNibName:(NSString *)windowNibName preambleController:(PreambleController *)pc; - -- (IBAction)switchView:(id)sender; - -@end diff --git a/tikzit-old/src/osx/PreferenceController.m b/tikzit-old/src/osx/PreferenceController.m deleted file mode 100644 index e785358..0000000 --- a/tikzit-old/src/osx/PreferenceController.m +++ /dev/null @@ -1,133 +0,0 @@ -// -// PreferenceController.m -// TikZiT -// -// Created by Karl Johan Paulsson on 26/02/2013. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "PreferenceController.h" - -@interface PreferenceController () - -@end - -@implementation PreferenceController - -- (id)initWithWindowNibName:(NSString *)windowNibName preambleController:(PreambleController *)pc{ - if (!(self = [super initWithWindowNibName:windowNibName])) return nil; - - preambleController = pc; - - return self; -} - -- (NSRect)newFrameForNewContentView:(NSView*)view { - NSWindow *window = [self window]; - NSRect newFrameRect = [window frameRectForContentRect:[view frame]]; - NSRect oldFrameRect = [window frame]; - NSSize newSize = newFrameRect.size; - NSSize oldSize = oldFrameRect.size; - - NSRect frame = [window frame]; - frame.size = newSize; - frame.origin.y -= (newSize.height - oldSize.height); - - return frame; -} - -- (NSView *)viewForTag:(int)tag { - - NSView *view = nil; - switch (tag) { - default: - case 0: - view = generalView; - break; - case 1: - view = engineView; - break; - case 2: - view = updateView; - break; - case 3: - view = preambleView; - break; - case 4: - view = customNodeView; - break; - } - - return view; -} - -- (BOOL)validateToolbarItem:(NSToolbarItem *)item { - - if ([item tag] == currentViewTag) return NO; - else return YES; - -} - -- (void)awakeFromNib { - - [[self window] setContentSize:[generalView frame].size]; - [[[self window] contentView] addSubview:generalView]; - [[[self window] contentView] setWantsLayer:YES]; - - updateController = [[UpdatePreferenceController alloc] initWithNibName:@"UpdatePreferencePanel" bundle:nil]; - [[updateController view] setFrame:[updateView frame]]; - [[[self window] contentView] replaceSubview:updateView with:[updateController view]]; - updateView = [updateController view]; - - [[preambleController view] setFrame:[preambleView frame]]; - [[[self window] contentView] replaceSubview:preambleView with:[preambleController view]]; - preambleView = [preambleController view]; - - customNodeController = [[CustomNodeController alloc] initWithNibName:@"CustomNodes" bundle:nil]; - [[customNodeController view] setFrame:[customNodeView frame]]; - [[[self window] contentView] replaceSubview:customNodeView with:[customNodeController view]]; - customNodeView = [customNodeController view]; - - [[self window] setContentSize:[engineView frame].size]; - [[[self window] contentView] addSubview:engineView]; - currentViewTag = 1; -} - -- (IBAction)switchView:(id)sender { - - int tag = [sender tag]; - NSView *view = [self viewForTag:tag]; - NSView *previousView = [self viewForTag:currentViewTag]; - currentViewTag = tag; - - NSRect newFrame = [self newFrameForNewContentView:view]; - - [NSAnimationContext beginGrouping]; - - if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask) - [[NSAnimationContext currentContext] setDuration:1.0]; - - [[[[self window] contentView] animator] replaceSubview:previousView with:view]; - [[[self window] animator] setFrame:newFrame display:YES]; - - [NSAnimationContext endGrouping]; - -} - -@end diff --git a/tikzit-old/src/osx/Preferences.xib b/tikzit-old/src/osx/Preferences.xib deleted file mode 100644 index 1be3f9f..0000000 --- a/tikzit-old/src/osx/Preferences.xib +++ /dev/null @@ -1,1165 +0,0 @@ - - - - 1070 - 13C64 - 5053 - 1265.19 - 697.40 - - com.apple.InterfaceBuilder.CocoaPlugin - 5053 - - - IBNSLayoutConstraint - NSButton - NSButtonCell - NSCustomObject - NSCustomView - NSTextField - NSTextFieldCell - NSToolbar - NSToolbarItem - NSUserDefaultsController - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - PreferenceController - - - FirstResponder - - - NSApplication - - - 7 - 2 - {{196, 240}, {480, 270}} - 544736256 - Preferences - NSWindow - - - C1747407-DC9A-4297-9C1C-0A5010984E6C - - - YES - YES - NO - NO - 1 - 1 - - - - 197F9408-AFB0-404B-B2B6-4DB1250B0A80 - - Updates - Updates - - - - NSImage - updates - - - - {0, 0} - {0, 0} - YES - YES - 2 - YES - 0 - - - - A3DDD070-5637-444B-92C6-905084CAC389 - - General - General - - - - NSImage - NSPreferencesGeneral - - - - {0, 0} - {0, 0} - YES - YES - 1 - YES - 0 - - - - A96DC4D4-2171-4D05-8C08-8D01B3829158 - - Preamble - Preamble - - - - NSImage - preamble - - - - {0, 0} - {0, 0} - YES - YES - 3 - YES - 0 - - - - CBA2626C-DD4C-4ADD-BD5D-26D21216D9A8 - - Custom Nodes - Custom Nodes - - - - NSImage - customshape - - - - {0, 0} - {0, 0} - YES - YES - 4 - YES - 0 - - - - F85FE7C2-9847-4E58-8BF6-BE334E918CA7 - - Engine - Engine - - - - NSImage - engine - - - - {0, 0} - {0, 0} - YES - YES - 1 - YES - 0 - - - - - - - - - - - - - - - - - - - - - {480, 270} - - - - - {{0, 0}, {1680, 1028}} - {10000000000000, 10000000000000} - YES - - - - 268 - - - - 268 - {{18, 106}, {219, 18}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Keep inspector windows on top - - .LucidaGrandeUI - 13 - 1044 - - _NS:9 - - 1211912448 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - NO - - - - 268 - {{18, 126}, {168, 18}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Autocomplete brackets - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{18, 18}, {214, 18}} - - - - _NS:9 - YES - - -2080374784 - 268435456 - Bring preview window to focus - - _NS:9 - - 1211912448 - 2 - - - - - 200 - 25 - - NO - - - - 268 - {{20, 42}, {440, 22}} - - - - _NS:9 - YES - - -1804599231 - 272630784 - - - _NS:9 - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - 3 - MAA - - - - NO - 1 - - - - 268 - {{18, 72}, {140, 17}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - pdfLaTeX source path - - _NS:1535 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - NO - 1 - - - {480, 162} - - - - _NS:9 - NSView - - - - 268 - - {480, 96} - - - - _NS:9 - NSView - - - - 12 - - {480, 115} - - - - _NS:9 - NSView - - - - 12 - - {557, 354} - - - - _NS:9 - NSView - - - - 12 - - {557, 354} - - - - _NS:9 - NSView - - - YES - - - - - - - window - - - - 3 - - - - engineView - - - - 23 - - - - generalView - - - - 25 - - - - switchView: - - - - 26 - - - - switchView: - - - - 27 - - - - switchView: - - - - 116 - - - - updateView - - - - 117 - - - - switchView: - - - - 120 - - - - preambleView - - - - 121 - - - - customNodeView - - - - 123 - - - - switchView: - - - - 125 - - - - delegate - - - - 4 - - - - value: values.net.sourceforge.tikzit.pdflatexpath - - - - - - value: values.net.sourceforge.tikzit.pdflatexpath - value - values.net.sourceforge.tikzit.pdflatexpath - 2 - - - 54 - - - - value: values.net.sourceforge.tikzit.previewfocus - - - - - - value: values.net.sourceforge.tikzit.previewfocus - value - values.net.sourceforge.tikzit.previewfocus - 2 - - - 62 - - - - value: values.net.sourceforge.tikzit.autocomplete - - - - - - value: values.net.sourceforge.tikzit.autocomplete - value - values.net.sourceforge.tikzit.autocomplete - 2 - - - 149 - - - - value: values.net.sourceforge.tikzit.inspectorsontop - - - - - - value: values.net.sourceforge.tikzit.inspectorsontop - value - values.net.sourceforge.tikzit.inspectorsontop - 2 - - - 150 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - - 2 - - - - - 5 - - - - - - - - - - - - 11 - - - - - 12 - - - - - 13 - - - - - 4 - 0 - - 4 - 1 - 1 - - 20 - - 1000 - - 8 - 23 - 3 - NO - - - - 3 - 0 - - 4 - 1 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - NO - - - - 5 - 0 - - 5 - 1 - 1 - - 20 - - 1000 - - 0 - 29 - 3 - NO - - - - 6 - 0 - - 6 - 1 - 1 - - 20 - - 1000 - - 0 - 29 - 3 - NO - - - - 3 - 0 - - 4 - 1 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - NO - - - - 5 - 0 - - 5 - 1 - 1 - - 20 - - 1000 - - 0 - 29 - 3 - NO - - - - 5 - 0 - - 5 - 1 - 1 - - 20 - - 1000 - - 0 - 29 - 3 - NO - - - - 5 - 0 - - 5 - 1 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - NO - - - - 3 - 0 - - 4 - 1 - 1 - - 6 - - 1000 - - 6 - 24 - 3 - NO - - - - 5 - 0 - - 5 - 1 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - NO - - - - 3 - 0 - - 3 - 1 - 1 - - 20 - - 1000 - - 8 - 23 - 3 - NO - - - - - - - - - - - 14 - - - - - - 15 - - - - - - - - 16 - - - - - 30 - - - - - 32 - - - - - - - - 33 - - - - - 36 - - - - - 39 - - - - - 55 - - - - - 56 - - - - - 57 - - - - - - - - 58 - - - - - 59 - - - - - 60 - - - - - 64 - - - - - - 115 - - - - - 118 - - - - - 119 - - - - - 122 - - - - - 124 - - - - - 126 - - - - - 127 - - - - - - - - 128 - - - - - 130 - - - - - 131 - - - - - - - - 132 - - - - - 134 - - - - - 135 - - - - - 153 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 153 - - - - - PreferenceController - NSWindowController - - switchView: - id - - - switchView: - - switchView: - id - - - - NSView - NSView - NSView - NSView - NSView - - - - customNodeView - NSView - - - engineView - NSView - - - generalView - NSView - - - preambleView - NSView - - - updateView - NSView - - - - IBProjectSource - ./Classes/PreferenceController.h - - - - - 0 - IBCocoaFramework - YES - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - {32, 32} - {15, 15} - {32, 32} - {32, 32} - {32, 32} - {32, 32} - - YES - - diff --git a/tikzit-old/src/osx/PreviewController.h b/tikzit-old/src/osx/PreviewController.h deleted file mode 100644 index 6c51a23..0000000 --- a/tikzit-old/src/osx/PreviewController.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// PreviewController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - - -#import -#import "DraggablePDFView.h" - -@class PDFView; -@class PreambleController; - -@interface PreviewController : NSWindowController { - IBOutlet DraggablePDFView *pdfView; - IBOutlet NSProgressIndicator *progressIndicator; - IBOutlet NSScrollView *errorTextView; - IBOutlet NSTextView *errorText; - PreambleController *preambleController; - NSString *tempDir; - NSLock *latexLock; - int typesetCount; -} - - -- (id)initWithWindowNibName:(NSString*)nib - preambleController:(PreambleController*)pc - tempDir:(NSString*)dir; - -- (void)buildTikz:(NSString*)tikz; - -+ (void)setDefaultPreviewController:(PreviewController*)pc; -+ (PreviewController*)defaultPreviewController; - -@end diff --git a/tikzit-old/src/osx/PreviewController.m b/tikzit-old/src/osx/PreviewController.m deleted file mode 100644 index cf069b1..0000000 --- a/tikzit-old/src/osx/PreviewController.m +++ /dev/null @@ -1,147 +0,0 @@ -// -// PreviewController.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "PreviewController.h" -#import "AppDelegate.h" -#import "PreambleController.h" -#import - -@implementation PreviewController - -static PreviewController *preview = nil; - -- (id)initWithWindowNibName:(NSString*)nib - preambleController:(PreambleController*)pc - tempDir:(NSString*)dir { - if (!(self = [super initWithWindowNibName:nib])) return nil; - tempDir = [dir copy]; - typesetCount = 0; - preambleController = pc; - latexLock = [[NSLock alloc] init]; - return self; -} - -- (void)runLatex:(id)tikz { - // Only build one tex file at a time, so we don't get funky results. - //[latexLock lock]; - [progressIndicator startAnimation:self]; - - if([[NSUserDefaults standardUserDefaults] boolForKey:@"net.sourceforge.tikzit.previewfocus"]){ - [[preview window] makeKeyAndOrderFront:self]; - } - - int fnum = typesetCount++; - - NSString *tex = [preambleController buildDocumentForTikz:tikz]; - - NSString *texFile = [NSString stringWithFormat:@"%@/tikzit_%d.tex", tempDir, fnum]; - NSString *pdfFile = [NSString stringWithFormat:@"%@/tikzit_%d.pdf", tempDir, fnum]; - - [tex writeToFile:texFile atomically:NO encoding:NSUTF8StringEncoding error:NULL]; - - NSString *pdflatexPath = [[NSUserDefaults standardUserDefaults] stringForKey:@"net.sourceforge.tikzit.pdflatexpath"]; - - // We run pdflatex in a bash shell to have easy access to the setup from unix-land - NSTask *latexTask = [[NSTask alloc] init]; - [latexTask setCurrentDirectoryPath:tempDir]; - [latexTask setLaunchPath:@"/bin/bash"]; - - // This assumes the user has $PATH set up to find pdflatex in either .profile - // or .bashrc. This should be improved to take other path setups into account - // and to be customisable. - NSString *latexCmd = - [NSString stringWithFormat: - @"if [ -e ~/.profile ]; then source ~/.profile; fi\n" - @"if [ -e ~/.bashrc ]; then source ~/.bashrc; fi\n" - @"%@ -interaction=nonstopmode -output-format=pdf -halt-on-error '%@'\n", pdflatexPath, texFile]; - - NSLog(@"Telling bash: %@", latexCmd); - - NSPipe *pout = [NSPipe pipe]; - NSPipe *pin = [NSPipe pipe]; - [latexTask setStandardOutput:pout]; - [latexTask setStandardInput:pin]; - - NSFileHandle *latexIn = [pin fileHandleForWriting]; - NSFileHandle *latexOut = [pout fileHandleForReading]; - - [latexTask launch]; - [latexIn writeData:[latexCmd dataUsingEncoding:NSUTF8StringEncoding]]; - [latexIn closeFile]; - - - NSData *data = [latexOut readDataToEndOfFile]; - NSString *str = [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]; - - [latexTask waitUntilExit]; - if ([latexTask terminationStatus] != 0) { - if ([latexTask terminationStatus] == 127) { - [errorTextView setHidden:YES]; - [errorText setString:@"\nCouldn't find pdflatex, change settings and try again."]; - [errorTextView setHidden:NO]; - }else{ - [errorTextView setHidden:YES]; - [errorText setString:[@"\nAN ERROR HAS OCCURRED, PDFLATEX SAID:\n\n" stringByAppendingString:str]]; - [errorTextView setHidden:NO]; - } - } else { - [errorText setString:@""]; - [errorTextView setHidden:YES]; - - PDFDocument *doc = [[PDFDocument alloc] initWithURL:[[NSURL alloc] initFileURLWithPath:pdfFile]]; - - // pad the PDF by a couple of pixels - if ([doc pageCount] >= 1) { - PDFPage *page = [doc pageAtIndex:0]; - NSRect box = [page boundsForBox:kPDFDisplayBoxCropBox]; - box.origin.x -= 2.0f; - box.origin.y -= 2.0f; - box.size.width += 4.0f; - box.size.height += 4.0f; - [page setBounds:box forBox:kPDFDisplayBoxCropBox]; - [page setBounds:box forBox:kPDFDisplayBoxMediaBox]; - } - - [pdfView setDocument:doc]; - } - - [progressIndicator stopAnimation:self]; - //[latexLock unlock]; -} - -- (void)buildTikz:(NSString*)tikz { - // Build on a separate thread to keep the interface responsive. - [NSThread detachNewThreadSelector:@selector(runLatex:) toTarget:self withObject:tikz]; -} - -+ (void)setDefaultPreviewController:(PreviewController*)pc { - preview = pc; -} - -+ (PreviewController*)defaultPreviewController { - return preview; -} - - -@end diff --git a/tikzit-old/src/osx/PropertyInspectorController.h b/tikzit-old/src/osx/PropertyInspectorController.h deleted file mode 100644 index 663ee4a..0000000 --- a/tikzit-old/src/osx/PropertyInspectorController.h +++ /dev/null @@ -1,83 +0,0 @@ -// -// PropertyInspectorController.h -// TikZiT -// -// Created by Aleks Kissinger on 17/07/2011. -// Copyright 2011 Aleks Kissinger. All rights reserved. -// - -#import -#import "NodeStyle.h" -#import "GraphElementData.h" - -@class SFBInspectorView; -@class StylePaletteController; - -@interface PropertyInspectorController : NSWindowController { - IBOutlet SFBInspectorView *propertyInspectorView; - IBOutlet NSView *nodePropertiesView; - IBOutlet NSView *graphPropertiesView; - IBOutlet NSView *edgePropertiesView; - IBOutlet NSComboBox *sourceAnchorComboBox; - IBOutlet NSComboBox *targetAnchorComboBox; - IBOutlet NSTextField *edgeNodeLabelField; - IBOutlet NSButton *edgeNodeCheckbox; - IBOutlet NSArrayController *nodeDataArrayController; - IBOutlet NSArrayController *graphDataArrayController; - IBOutlet NSArrayController *edgeDataArrayController; - IBOutlet NSArrayController *edgeNodeDataArrayController; - - NSMutableArray *sourceAnchorNames; - IBOutlet NSArrayController *sourceAnchorNamesArrayController; - - NSMutableArray *targetAnchorNames; - IBOutlet NSArrayController *targetAnchorNamesArrayController; - - NSMutableArray *selectedNodes; - IBOutlet NSArrayController *selectedNodesArrayController; - - NSMutableArray *selectedEdges; - IBOutlet NSArrayController *selectedEdgesArrayController; - - // this data lists exists solely for displaying messages in disabled data tables - GraphElementData *noSelection; - GraphElementData *multipleSelection; - GraphElementData *noEdgeNode; - GraphElementData *noGraph; - - - // used to get access to the global style table - StylePaletteController *stylePaletteController; -} - -//@property (readonly) BOOL enableNodeDataControls; -//@property (readonly) BOOL enableEdgeDataControls; -@property (strong) NSMutableArray *selectedNodes; -@property (strong) NSMutableArray *selectedEdges; -@property (strong) NSMutableArray *sourceAnchorNames; -@property (strong) NSMutableArray *targetAnchorNames; -@property (strong) StylePaletteController *stylePaletteController; - -- (id)initWithWindowNibName:(NSString *)windowNibName; -- (void)graphSelectionChanged:(NSNotification*)notification; - -- (IBAction)addNodeProperty:(id)sender; -- (IBAction)addNodeAtom:(id)sender; -- (IBAction)removeNodeProperty:(id)sender; - -- (IBAction)addGraphProperty:(id)sender; -- (IBAction)addGraphAtom:(id)sender; -- (IBAction)removeGraphProperty:(id)sender; - -- (IBAction)addEdgeProperty:(id)sender; -- (IBAction)addEdgeAtom:(id)sender; -- (IBAction)removeEdgeProperty:(id)sender; - -- (IBAction)addEdgeNodeProperty:(id)sender; -- (IBAction)addEdgeNodeAtom:(id)sender; -- (IBAction)removeEdgeNodeProperty:(id)sender; - -//- (IBAction)addRemoveChildNode:(id)sender; -- (IBAction)refreshDocument:(id)sender; - -@end diff --git a/tikzit-old/src/osx/PropertyInspectorController.m b/tikzit-old/src/osx/PropertyInspectorController.m deleted file mode 100644 index 039a30f..0000000 --- a/tikzit-old/src/osx/PropertyInspectorController.m +++ /dev/null @@ -1,280 +0,0 @@ -// -// PropertyInspectorController.m -// TikZiT -// -// Created by Aleks Kissinger on 17/07/2011. -// Copyright 2011 Aleks Kissinger. All rights reserved. -// - -#import "PropertyInspectorController.h" -#import "StylePaletteController.h" -#import "TikzDocument.h" -#import "SFBInspectors/SFBInspectorView.h" -#import "PickSupport.h" -#import "Node.h" -#import "Edge.h" -#import "NodeStyle.h" -#import "GraphicsView.h" -#import "GraphElementProperty.h" -#import "Shape.h" - -@implementation PropertyInspectorController - -@synthesize stylePaletteController; -@synthesize selectedNodes, selectedEdges; -@synthesize sourceAnchorNames, targetAnchorNames; - -- (id)initWithWindowNibName:(NSString *)windowNibName { - if (!(self = [super initWithWindowNibName:windowNibName])) return nil; - - noSelection = [[GraphElementData alloc] init]; - [noSelection setProperty:@"" forKey:@"No Selection"]; - multipleSelection = [[GraphElementData alloc] init]; - [multipleSelection setProperty:@"" forKey:@"Mult. Selection"]; - noEdgeNode = [[GraphElementData alloc] init]; - [noEdgeNode setProperty:@"" forKey:@"No Child"]; - noGraph = [[GraphElementData alloc] init]; - [noGraph setProperty:@"" forKey:@"No Graph"]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(graphSelectionChanged:) - name:@"SelectionChanged" - object:nil]; - -// [[NSDocumentController sharedDocumentController] addObserver:self -// forKeyPath:@"currentDocument" -// options:NSKeyValueObservingOptionNew -// context:NULL]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(graphSelectionChanged:) - name:@"NSWindowDidBecomeMainNotification" - object:nil]; - - [self setSourceAnchorNames: [[NSMutableArray alloc] initWithArray: [@"north south west east" componentsSeparatedByString:@" "]]]; - - [self setTargetAnchorNames: [[NSMutableArray alloc] initWithArray:[@"north south west east" componentsSeparatedByString:@" "]]]; - - - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"net.sourceforge.tikzit.inspectorsontop"] == YES) { - [[self window] setLevel:NSFloatingWindowLevel]; - } else { - [[self window] setLevel:NSNormalWindowLevel]; - } - - [self showWindow:self]; - return self; -} - -- (void)observeValueForKeyPath:(NSString*)keyPath - ofObject:(id)object - change:(NSDictionary*)change - context:(void*)context { - [self graphSelectionChanged:nil]; -} - -//- (void)willChangeValueForKey:(NSString *)key { -// [super willChangeValueForKey:key]; -// NSLog(@"will: %@",key); -//} -// -//- (void)didChangeValueForKey:(NSString *)key { -// [super didChangeValueForKey:key]; -// NSLog(@"did: %@",key); -//} - -- (void)windowDidLoad { - [[self window] setMovableByWindowBackground:YES]; - - [propertyInspectorView addInspectorPane:graphPropertiesView - title:@"Graph Properties"]; - [propertyInspectorView addInspectorPane:nodePropertiesView - title:@"Node Properties"]; - [propertyInspectorView addInspectorPane:edgePropertiesView - title:@"Edge Properties"]; - [super windowDidLoad]; -} - -- (IBAction)refreshDocument:(id)sender { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - - if (doc != nil) { - [[doc graphicsView] postGraphChange]; - [[doc graphicsView] refreshLayers]; - } -} - - -- (void)updateGraphFields { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - - if (doc != nil) { - [graphDataArrayController setContent:[[[doc graphicsView] graph] data]]; - [graphDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [graphDataArrayController setEditable:YES]; - } else { - [graphDataArrayController setContent:noGraph]; - [graphDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [graphDataArrayController setEditable:NO]; - } -} - -- (void)updateNodeFields { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - if (doc != nil) { - NSSet *sel = [[[doc graphicsView] pickSupport] selectedNodes]; - [self setSelectedNodes:[[sel allObjects] mutableCopy]]; - [selectedNodesArrayController setSelectedObjects:selectedNodes]; - if ([sel count] == 1) { - Node *n = [sel anyObject]; - [nodeDataArrayController setContent:[n data]]; - [nodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [nodeDataArrayController setEditable:YES]; - } else if ([sel count] == 0) { - [nodeDataArrayController setContent:noSelection]; - [nodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [nodeDataArrayController setEditable:NO]; - } else { - [nodeDataArrayController setContent:multipleSelection]; - [nodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [nodeDataArrayController setEditable:NO]; - } - } else { - [nodeDataArrayController setContent:noGraph]; - [nodeDataArrayController setEditable:NO]; - } -} - -- (void)updateEdgeFields { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - - if (doc != nil) { - NSSet *sel = [[[doc graphicsView] pickSupport] selectedEdges]; - [self setSelectedEdges:[[sel allObjects] mutableCopy]]; - [selectedEdgesArrayController setSelectedObjects:selectedEdges]; - if ([sel count] == 1) { - Edge *e = [sel anyObject]; - [edgeDataArrayController setContent:[e data]]; - [edgeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeDataArrayController setEditable:YES]; - if ([e hasEdgeNode]) { - Node *n = [e edgeNode]; - [edgeNodeDataArrayController setContent:[n data]]; - [edgeNodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeNodeDataArrayController setEditable:YES]; - } else { - [edgeNodeDataArrayController setContent:noEdgeNode]; - [edgeNodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeNodeDataArrayController setEditable:NO]; - } - } else if ([sel count] == 0) { - [edgeDataArrayController setContent:noSelection]; - [edgeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeDataArrayController setEditable:NO]; - [edgeNodeDataArrayController setContent:noSelection]; - [edgeNodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeNodeDataArrayController setEditable:NO]; - } else { - [edgeDataArrayController setContent:multipleSelection]; - [edgeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeDataArrayController setEditable:NO]; - [edgeNodeDataArrayController setContent:multipleSelection]; - [edgeNodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeNodeDataArrayController setEditable:NO]; - } - } else { - [edgeDataArrayController setContent:noGraph]; - [edgeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeDataArrayController setEditable:NO]; - [edgeNodeDataArrayController setContent:noGraph]; - [edgeNodeDataArrayController setSelectionIndexes:[NSIndexSet indexSet]]; - [edgeNodeDataArrayController setEditable:NO]; - } -} - -- (void)graphSelectionChanged:(NSNotification*)notification { - [self updateNodeFields]; - [self updateEdgeFields]; - [self updateGraphFields]; -} - -- (void)controlTextDidEndEditing:(NSNotification*)notification { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - if (doc != nil) { - PickSupport *pick = [[doc graphicsView] pickSupport]; - for (Node *n in [pick selectedNodes]) { - [n attachStyleFromTable:[stylePaletteController nodeStyles]]; - } - - for (Edge *e in [pick selectedEdges]) { - [e attachStyleFromTable:[stylePaletteController edgeStyles]]; - } - } - - [self refreshDocument:[notification object]]; -} - -- (void)addPropertyToAC:(NSArrayController*)ac { - [ac addObject:[[GraphElementProperty alloc] initWithPropertyValue:@"val" forKey:@"new_property"]]; - [self refreshDocument:nil]; -} - -- (void)addAtomToAC:(NSArrayController*)ac { - [ac addObject:[[GraphElementProperty alloc] initWithAtomName:@"new_atom"]]; - [self refreshDocument:nil]; -} - -- (void)removeFromAC:(NSArrayController*)ac { - [ac remove:nil]; - [self refreshDocument:nil]; -} - -- (IBAction)addNodeProperty:(id)sender { [self addPropertyToAC:nodeDataArrayController]; } -- (IBAction)addNodeAtom:(id)sender { [self addAtomToAC:nodeDataArrayController]; } -- (IBAction)removeNodeProperty:(id)sender { [self removeFromAC:nodeDataArrayController]; } - -- (IBAction)addGraphProperty:(id)sender { [self addPropertyToAC:graphDataArrayController]; } -- (IBAction)addGraphAtom:(id)sender { [self addAtomToAC:graphDataArrayController]; } -- (IBAction)removeGraphProperty:(id)sender { [self removeFromAC:graphDataArrayController]; } - -- (IBAction)addEdgeProperty:(id)sender { [self addPropertyToAC:edgeDataArrayController]; } -- (IBAction)addEdgeAtom:(id)sender { [self addAtomToAC:edgeDataArrayController]; } -- (IBAction)removeEdgeProperty:(id)sender { [self removeFromAC:edgeDataArrayController]; } - -- (IBAction)addEdgeNodeProperty:(id)sender { [self addPropertyToAC:edgeNodeDataArrayController]; } -- (IBAction)addEdgeNodeAtom:(id)sender { [self addAtomToAC:edgeNodeDataArrayController]; } -- (IBAction)removeEdgeNodeProperty:(id)sender { [self removeFromAC:edgeNodeDataArrayController]; } - -//- (BOOL)enableEdgeDataControls { -// NSDocumentController *dc = [NSDocumentController sharedDocumentController]; -// TikzDocument *doc = (TikzDocument*)[dc currentDocument]; -// -// if (doc != nil) { -// return ([[[[doc graphicsView] pickSupport] selectedEdges] count] == 1); -// } else { -// return NO; -// } -//} -// -//- (BOOL)enableEdgeNodeDataControls { -// NSDocumentController *dc = [NSDocumentController sharedDocumentController]; -// TikzDocument *doc = (TikzDocument*)[dc currentDocument]; -// -// if (doc != nil) { -// PickSupport *pick = [[doc graphicsView] pickSupport]; -// if ([[pick selectedEdges] count] == 1) { -// return ([[[pick selectedEdges] anyObject] hasEdgeNode]); -// } else { -// return NO; -// } -// } else { -// return NO; -// } -//} - -@end diff --git a/tikzit-old/src/osx/SelectBoxLayer.h b/tikzit-old/src/osx/SelectBoxLayer.h deleted file mode 100644 index 45b43c7..0000000 --- a/tikzit-old/src/osx/SelectBoxLayer.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// SelectBoxLayer.h -// TikZiT -// -// Created by Aleks Kissinger on 14/06/2010. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import -#import - -@interface SelectBoxLayer : CALayer { - BOOL active; - CGRect box; -} - -@property (assign) BOOL active; -@property (assign) NSRect selectBox; - -+ (SelectBoxLayer*)layer; - -@end diff --git a/tikzit-old/src/osx/SelectBoxLayer.m b/tikzit-old/src/osx/SelectBoxLayer.m deleted file mode 100644 index a7abe33..0000000 --- a/tikzit-old/src/osx/SelectBoxLayer.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// SelectBoxLayer.m -// TikZiT -// -// Created by Aleks Kissinger on 14/06/2010. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import "SelectBoxLayer.h" - - -@implementation SelectBoxLayer - -@synthesize active; - -- (id)init { - if (!(self = [super init])) return nil; - box = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - active = NO; - return self; -} - -- (void)setSelectBox:(NSRect)r { - box = NSRectToCGRect(r); -} - -- (NSRect)selectBox { - return NSRectFromCGRect(box); -} - -- (void)drawInContext:(CGContextRef)context { - if (active) { - CGContextAddRect(context, box); - - CGContextSetRGBStrokeColor(context, 0.6, 0.6, 0.6, 1); - CGContextSetRGBFillColor(context, 0.8, 0.8, 0.8, 0.2); - CGContextSetLineWidth(context, 1); - - CGContextSetShouldAntialias(context, NO); - CGContextDrawPath(context, kCGPathFillStroke); - } -} - -+ (SelectBoxLayer*)layer { - return [[SelectBoxLayer alloc] init]; -} - -@end diff --git a/tikzit-old/src/osx/SelectableCollectionViewItem.h b/tikzit-old/src/osx/SelectableCollectionViewItem.h deleted file mode 100644 index 4a2c571..0000000 --- a/tikzit-old/src/osx/SelectableCollectionViewItem.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// SelectableCollectionViewItem.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "StylePaletteController.h" - -@interface SelectableCollectionViewItem : NSCollectionViewItem { - IBOutlet StylePaletteController *stylePaletteController; -} - -- (void)setStylePaletteController:(StylePaletteController*)spc; - -@end diff --git a/tikzit-old/src/osx/SelectableCollectionViewItem.m b/tikzit-old/src/osx/SelectableCollectionViewItem.m deleted file mode 100644 index 880c37b..0000000 --- a/tikzit-old/src/osx/SelectableCollectionViewItem.m +++ /dev/null @@ -1,54 +0,0 @@ -// -// SelectableCollectionViewItem.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "SelectableCollectionViewItem.h" -#import "SelectableNodeView.h" - -@implementation SelectableCollectionViewItem - -- (id)copyWithZone:(NSZone *)zone { - SelectableCollectionViewItem *item = [super copyWithZone:zone]; - [item setStylePaletteController:stylePaletteController]; - return (id)item; -} - -- (void)setSelected:(BOOL)flag { - [super setSelected:flag]; - [(SelectableNodeView*)[self view] setSelected:flag]; - - // only fire this event from the view that lost selection - //if (flag == NO) [stylePaletteController selectionDidChange]; - - [[self view] setNeedsDisplay:YES]; -} - -- (void)setRepresentedObject:(id)object { - [super setRepresentedObject:object]; - [(SelectableNodeView*)[self view] setNodeStyle:(NodeStyle*)object]; -} - -- (void)setStylePaletteController:(StylePaletteController*)spc { - stylePaletteController = spc; -} - -@end diff --git a/tikzit-old/src/osx/SelectableNodeView.h b/tikzit-old/src/osx/SelectableNodeView.h deleted file mode 100644 index 6b0841d..0000000 --- a/tikzit-old/src/osx/SelectableNodeView.h +++ /dev/null @@ -1,38 +0,0 @@ -// -// SelectableView.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "NodeLayer.h" -#import "NodeStyle.h" -#import "NodeStyle+Coder.h" - -@interface SelectableNodeView : NSView { - BOOL selected; - NodeLayer *nodeLayer; -} - -@property (assign) BOOL selected; -@property (strong) NodeStyle *nodeStyle; - - -@end diff --git a/tikzit-old/src/osx/SelectableNodeView.m b/tikzit-old/src/osx/SelectableNodeView.m deleted file mode 100644 index 797a137..0000000 --- a/tikzit-old/src/osx/SelectableNodeView.m +++ /dev/null @@ -1,96 +0,0 @@ -// -// SelectableView.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "SelectableNodeView.h" -#import "Shape.h" -#import "Transformer.h" - -@implementation SelectableNodeView - -@synthesize selected; - -- (id)initWithFrame:(NSRect)frameRect { - if (!(self = [super initWithFrame:frameRect])) return nil; - nodeLayer = nil; - return self; -} - --(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { -// NSLog(@"got draw"); -// CGContextSaveGState(context); -// -// if (selected) { -// CGContextSetRGBStrokeColor(context, 0.61f, 0.735f, 1.0f, 1.0f); -// CGContextSetRGBFillColor(context, 0.61f, 0.735f, 1.0f, 0.5f); -// CGContextSetLineWidth(context, 1.0f); -// -// CGRect box = CGRectMake([layer frame].origin.x + 2, -// [layer frame].origin.y + 2, -// [layer frame].size.width - 4, -// [layer frame].size.height - 4); -// -// //CGContextAddRect(context, box); -// CGContextDrawPath(context, kCGPathFillStroke); -// } -// -// CGContextRestoreGState(context); - - if (nodeLayer!=nil) { - if (![[[self layer] sublayers] containsObject:nodeLayer]) { - [[self layer] addSublayer:nodeLayer]; - NSPoint c = NSMakePoint(CGRectGetMidX([[self layer] frame]), - CGRectGetMidY([[self layer] frame])); - [nodeLayer setCenter:c andAnimateWhen:NO]; - } - - if (selected) [[nodeLayer selection] select]; - else [[nodeLayer selection] deselect]; - - [nodeLayer updateFrame]; - } -} - -- (void)drawRect:(NSRect)rect { - [super drawRect:rect]; -} - -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { return YES; } - -- (void)setNodeStyle:(NodeStyle *)sty { - if (nodeLayer == nil) { - nodeLayer = [[NodeLayer alloc] initWithNode:[Node node] - transformer:[Transformer defaultTransformer]]; - [nodeLayer setRescale:NO]; - } - - [[nodeLayer node] setStyle:sty]; - [nodeLayer updateFrame]; -} - -- (NodeStyle*)nodeStyle { - if (nodeLayer != nil) return [[nodeLayer node] style]; - else return nil; -} - - -@end diff --git a/tikzit-old/src/osx/StylePaletteController.h b/tikzit-old/src/osx/StylePaletteController.h deleted file mode 100644 index 05f0684..0000000 --- a/tikzit-old/src/osx/StylePaletteController.h +++ /dev/null @@ -1,80 +0,0 @@ -// -// StylePaletteController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "NodeStyle.h" -#import "EdgeStyle.h" - -@class SFBInspectorView; - -@interface StylePaletteController : NSWindowController { - NSMutableArray *nodeStyles; - NSMutableArray *edgeStyles; - IBOutlet NSArrayController *nodeStyleArrayController; - IBOutlet NSArrayController *filteredNodeStyleArrayController; - IBOutlet NSArrayController *edgeStyleArrayController; - IBOutlet NSArrayController *filteredEdgeStyleArrayController; - IBOutlet NSCollectionView *collectionView; - IBOutlet SFBInspectorView *nodeStyleInspectorView; - IBOutlet NSView *nodeStyleView; - IBOutlet NSView *edgeStyleView; - IBOutlet NSPopUpButton *shapeDropdown; - NSString *displayedNodeStyleCategory; - NSString *displayedEdgeStyleCategory; -} - -@property (strong) NSMutableArray *nodeStyles; -@property (strong) NSMutableArray *edgeStyles; -@property (readonly) BOOL documentActive; -@property (strong) NodeStyle *activeNodeStyle; -@property (strong) EdgeStyle *activeEdgeStyle; -@property (copy) NSString *displayedNodeStyleCategory; -@property (copy) NSString *displayedEdgeStyleCategory; -@property (readonly) NSPredicate *displayedNodeStylePredicate; -@property (readonly) NSPredicate *displayedEdgeStylePredicate; - -//@property NSString *nodeLabel; - -- (id)initWithWindowNibName:(NSString *)windowNibName - supportDir:(NSString*)supportDir; -- (void)saveStyles:(NSString *)plist; - -- (IBAction)refreshCollection:(id)sender; - -- (IBAction)applyActiveNodeStyle:(id)sender; -- (IBAction)clearActiveNodeStyle:(id)sender; -- (IBAction)addNodeStyle:(id)sender; - -- (IBAction)appleActiveEdgeStyle:(id)sender; -- (IBAction)clearActiveEdgeStyle:(id)sender; -- (IBAction)addEdgeStyle:(id)sender; -- (void)setActiveEdgeStyle:(EdgeStyle*)style; - -- (IBAction)setFillToClosestHashed:(id)sender; -- (IBAction)setStrokeToClosestHashed:(id)sender; - - -//- (IBAction)changeShape:(id)sender; - - -@end diff --git a/tikzit-old/src/osx/StylePaletteController.m b/tikzit-old/src/osx/StylePaletteController.m deleted file mode 100644 index 4fe46be..0000000 --- a/tikzit-old/src/osx/StylePaletteController.m +++ /dev/null @@ -1,252 +0,0 @@ -// -// StylePaletteController.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "StylePaletteController.h" -#import "TikzDocument.h" -#import "SFBInspectors/SFBInspectorView.h" -#import "PickSupport.h" -#import "Node.h" -#import "Edge.h" -#import "NodeStyle.h" -#import "GraphicsView.h" -#import "GraphElementProperty.h" -#import "Shape.h" - -@implementation StylePaletteController - -@synthesize nodeStyles, edgeStyles; - -- (id)initWithWindowNibName:(NSString *)windowNibName - supportDir:(NSString*)supportDir -{ - if (self = [super initWithWindowNibName:windowNibName]) { - NSString *ns = [supportDir stringByAppendingPathComponent:@"nodeStyles.plist"]; - NSString *es = [supportDir stringByAppendingPathComponent:@"edgeStyles.plist"]; - nodeStyles = (NSMutableArray*)[NSKeyedUnarchiver - unarchiveObjectWithFile:ns]; - edgeStyles = (NSMutableArray*)[NSKeyedUnarchiver - unarchiveObjectWithFile:es]; - - if (nodeStyles == nil) nodeStyles = [NSMutableArray array]; - if (edgeStyles == nil) edgeStyles = [NSMutableArray array]; - - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"net.sourceforge.tikzit.inspectorsontop"] == YES) { - [[self window] setLevel:NSFloatingWindowLevel]; - } else { - [[self window] setLevel:NSNormalWindowLevel]; - } - - [self showWindow:self]; - } - - return self; -} - -- (void)windowDidLoad { - [[self window] setMovableByWindowBackground:YES]; - [shapeDropdown addItemsWithTitles:[[Shape shapeDictionary] allKeys]]; - if ([self activeNodeStyle] != nil) { - [shapeDropdown setTitle:[[self activeNodeStyle] shapeName]]; - } - - [nodeStyleInspectorView addInspectorPane:nodeStyleView - title:@"Node Styles"]; - - [nodeStyleInspectorView addInspectorPane:edgeStyleView - title:@"Edge Styles"]; - - [super windowDidLoad]; -} - -- (void)saveStyles:(NSString*)supportDir { - NSString *ns = [supportDir stringByAppendingPathComponent:@"nodeStyles.plist"]; - NSString *es = [supportDir stringByAppendingPathComponent:@"edgeStyles.plist"]; - [NSKeyedArchiver archiveRootObject:nodeStyles toFile:ns]; - [NSKeyedArchiver archiveRootObject:edgeStyles toFile:es]; -} - -- (IBAction)refreshCollection:(id)sender { - [collectionView setNeedsDisplay:YES]; -} - - -- (BOOL)documentActive { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - return dc.currentDocument != nil; -} - --(BOOL)collectionView:(NSCollectionView*)collectionView canDragItemsAtIndexes:(NSIndexSet*)indexes withEvent:(NSEvent*)event { - return YES; -} - - -//=========================== -//= setting SVG-safe colors = -//=========================== -- (IBAction)setFillToClosestHashed:(id)sender { - NSArray *sel = [nodeStyleArrayController selectedObjects]; - if ([sel count] != 0) { - NodeStyle *sty = [sel objectAtIndex:0]; - [sty willChangeValueForKey:@"fillColor"]; - [sty willChangeValueForKey:@"fillColorIsKnown"]; - [sty.fillColorRGB setToClosestHashed]; - [sty didChangeValueForKey:@"fillColor"]; - [sty didChangeValueForKey:@"fillColorIsKnown"]; - } -} - -- (IBAction)setStrokeToClosestHashed:(id)sender { - NSArray *sel = [nodeStyleArrayController selectedObjects]; - if ([sel count] != 0) { - NodeStyle *sty = [sel objectAtIndex:0]; - [sty willChangeValueForKey:@"strokeColor"]; - [sty willChangeValueForKey:@"strokeColorIsKnown"]; - [sty.strokeColorRGB setToClosestHashed]; - [sty didChangeValueForKey:@"strokeColor"]; - [sty didChangeValueForKey:@"strokeColorIsKnown"]; - } -} - -//================================================= -//= setting filter predicates for nodes and edges = -//================================================= -- (NSString*)displayedNodeStyleCategory { - return displayedNodeStyleCategory; -} - -- (void)setDisplayedNodeStyleCategory:(NSString *)cat { - [self willChangeValueForKey:@"displayedNodeStylePredicate"]; - displayedNodeStyleCategory = cat; - [self didChangeValueForKey:@"displayedNodeStylePredicate"]; -} - -- (NSString*)displayedEdgeStyleCategory { - return displayedEdgeStyleCategory; -} - -- (void)setDisplayedEdgeStyleCategory:(NSString *)cat { - [self willChangeValueForKey:@"displayedEdgeStylePredicate"]; - displayedEdgeStyleCategory = cat; - [self didChangeValueForKey:@"displayedEdgeStylePredicate"]; -} - -- (NSPredicate*)displayedNodeStylePredicate { - return [NSPredicate predicateWithFormat:@"category == %@", displayedNodeStyleCategory]; -} - -- (NSPredicate*)displayedEdgeStylePredicate { - return [NSPredicate predicateWithFormat:@"category == %@", displayedEdgeStyleCategory]; -} - - -//============================== -//= getting and setting styles = -//============================== - -- (IBAction)applyActiveNodeStyle:(id)sender { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - - if (doc != nil) { - [[doc graphicsView] applyStyleToSelectedNodes:[self activeNodeStyle]]; - } - - [[doc graphicsView] postSelectionChange]; -} - -- (IBAction)clearActiveNodeStyle:(id)sender { - [self setActiveNodeStyle:nil]; - - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - - if (doc != nil) { - [[doc graphicsView] applyStyleToSelectedNodes:nil]; - } - - [[doc graphicsView] postSelectionChange]; -} - -- (NodeStyle*)activeNodeStyle { - NSArray *sel = [filteredNodeStyleArrayController selectedObjects]; - if ([sel count] == 0) return nil; - else return [sel objectAtIndex:0]; -} - -- (void)setActiveNodeStyle:(NodeStyle*)style { - if ([nodeStyles containsObject:style]) { - [filteredNodeStyleArrayController setSelectedObjects:[NSArray arrayWithObject:style]]; - } else { - [filteredNodeStyleArrayController setSelectedObjects:[NSArray array]]; - } -} - -- (IBAction)appleActiveEdgeStyle:(id)sender { - NSDocumentController *dc = [NSDocumentController sharedDocumentController]; - TikzDocument *doc = (TikzDocument*)[dc currentDocument]; - - if (doc != nil) { - [[doc graphicsView] applyStyleToSelectedEdges:[self activeEdgeStyle]]; - } -} - -- (IBAction)clearActiveEdgeStyle:(id)sender { - [self setActiveEdgeStyle:nil]; - [self appleActiveEdgeStyle:sender]; -} - -- (EdgeStyle*)activeEdgeStyle { - NSArray *sel = [filteredEdgeStyleArrayController selectedObjects]; - if ([sel count] == 0) return nil; - else return [sel objectAtIndex:0]; -} - -- (void)setActiveEdgeStyle:(EdgeStyle*)style { - if ([edgeStyles containsObject:style]) { - [filteredEdgeStyleArrayController setSelectedObjects:[NSArray arrayWithObject:style]]; - } else { - [filteredEdgeStyleArrayController setSelectedObjects:[NSArray array]]; - } -} - - -//================= -//= adding styles = -//================= - -- (IBAction)addEdgeStyle:(id)sender { - EdgeStyle *sty = [[EdgeStyle alloc] init]; - [sty setCategory:displayedEdgeStyleCategory]; - [edgeStyleArrayController addObject:sty]; - [self setActiveEdgeStyle:sty]; -} - -- (IBAction)addNodeStyle:(id)sender { - NodeStyle *sty = [[NodeStyle alloc] init]; - [sty setCategory:displayedNodeStyleCategory]; - [nodeStyleArrayController addObject:sty]; - [self setActiveNodeStyle:sty]; -} - - -@end diff --git a/tikzit-old/src/osx/TikzDocument.h b/tikzit-old/src/osx/TikzDocument.h deleted file mode 100644 index 1881994..0000000 --- a/tikzit-old/src/osx/TikzDocument.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// TikzDocument.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import "GraphicsView.h" -#import "TikzSourceController.h" -#import "PreviewController.h" -#import "GraphicsView.h" - -@interface TikzDocument : NSDocument { - NSString *tikz; -} - -@property (readonly) NSString *tikz; -@property (weak, readonly) GraphicsView *graphicsView; - -@end diff --git a/tikzit-old/src/osx/TikzDocument.m b/tikzit-old/src/osx/TikzDocument.m deleted file mode 100644 index ef5908d..0000000 --- a/tikzit-old/src/osx/TikzDocument.m +++ /dev/null @@ -1,84 +0,0 @@ -// -// TikzDocument.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TikzDocument.h" -#import "TikzWindowController.h" - -@implementation TikzDocument - -@synthesize tikz; - -- (id)init { - self = [super init]; - if (self) { - tikz = nil; - } - return self; -} - -//- (NSString *)windowNibName { -// // Override returning the nib file name of the document -// // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. -// return @"TikzDocument"; -//} - -- (void)makeWindowControllers { - TikzWindowController *wc = [[TikzWindowController alloc] initWithDocument:self]; - [self addWindowController:wc]; -} - -- (void)windowControllerDidLoadNib:(NSWindowController *) aController { - [super windowControllerDidLoadNib:aController]; - [[self graphicsView] refreshLayers]; - // Add any code here that needs to be executed once the windowController has loaded the document's window. -} - -- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { - TikzWindowController *wc = - (TikzWindowController*)[[self windowControllers] objectAtIndex:0]; - NSData *outData = [[[wc tikzSourceController] tikz] dataUsingEncoding:NSUTF8StringEncoding]; - - if ( outError != NULL ) { - *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; - } - return outData; -} - -- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { - tikz = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - - if ( outError != NULL ) { - *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; - } - - return YES; -} - -- (GraphicsView*)graphicsView { - TikzWindowController *wc = - (TikzWindowController*)[[self windowControllers] objectAtIndex:0]; - return [wc graphicsView]; -} - - -@end diff --git a/tikzit-old/src/osx/TikzFormatter.h b/tikzit-old/src/osx/TikzFormatter.h deleted file mode 100644 index 4d9ec04..0000000 --- a/tikzit-old/src/osx/TikzFormatter.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// NSTikzFormatter.h -// TikZiT -// -// Created by Karl Johan Paulsson on 27/01/2013. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -@interface TikzFormatter : NSFormatter - -@end diff --git a/tikzit-old/src/osx/TikzFormatter.m b/tikzit-old/src/osx/TikzFormatter.m deleted file mode 100644 index cb0865d..0000000 --- a/tikzit-old/src/osx/TikzFormatter.m +++ /dev/null @@ -1,91 +0,0 @@ -// -// NSTikzFormatter.m -// TikZiT -// -// Created by Karl Johan Paulsson on 27/01/2013. -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TikzFormatter.h" -#import "TikzGraphAssembler.h" - -@implementation TikzFormatter - -- (NSString *)stringForObjectValue:(id)obj{ - if (![obj isKindOfClass:[NSString class]]) { - return @""; - } - - return [NSString stringWithString:obj]; -} - -- (BOOL)getObjectValue:(out id *)obj forString:(NSString *)string errorDescription:(out NSString **)error{ - *obj = [NSString stringWithString:string]; - - BOOL r = [TikzGraphAssembler validateTikzPropertyNameOrValue:string]; - - if (!r && error) - *error = NSLocalizedString(@"Invalid input, couldn't parse value.", @"tikz user input error"); - - return r; -} - -- (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error{ - NSRange addedRange; - NSString *addedString; - - if(![[NSUserDefaults standardUserDefaults] boolForKey:@"net.sourceforge.tikzit.autocomplete"]){ - return YES; - } - - addedRange = NSMakeRange(origSelRange.location, proposedSelRangePtr->location - origSelRange.location); - addedString = [*partialStringPtr substringWithRange: addedRange]; - - if([addedString isEqualToString:@"{"]){ - NSString *s = [[NSString stringWithString:*partialStringPtr] stringByAppendingString:@"}"]; - *partialStringPtr = s; - - return NO; - } - - if([addedString isEqualToString:@"}"]){ - NSScanner *scanner = [NSScanner scannerWithString:*partialStringPtr]; - - NSCharacterSet *cs = [NSCharacterSet characterSetWithCharactersInString:@"{}"]; - NSMutableString *strippedString = [NSMutableString stringWithCapacity:[*partialStringPtr length]]; - - while ([scanner isAtEnd] == NO) { - NSString *buffer; - if ([scanner scanCharactersFromSet:cs intoString:&buffer]) { - [strippedString appendString:buffer]; - - } else { - [scanner setScanLocation:([scanner scanLocation] + 1)]; - } - } - - if([strippedString length] % 2 == 1){ - return NO; - } - } - - return YES; -} - -@end diff --git a/tikzit-old/src/osx/TikzSourceController.h b/tikzit-old/src/osx/TikzSourceController.h deleted file mode 100644 index 84d36da..0000000 --- a/tikzit-old/src/osx/TikzSourceController.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// TikzSourceController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import - -#import "GraphicsView.h" -#import "ParseErrorView.h" - -@interface TikzSourceController : NSObject { - GraphicsView *__weak graphicsView; - NSTextView *__unsafe_unretained sourceView; - NSAttributedString *source; - NSTextField *__weak status; - NSDictionary *textAttrs; - NSColor *successColor; - NSColor *failedColor; - NSTextField *__weak errorMessage; - ParseErrorView *__weak errorNotification; - - NSUndoManager *__weak documentUndoManager; - - BOOL tikzChanged; - BOOL justUndid; - - NSError *lastError; -} - -@property BOOL tikzChanged; -@property (weak) IBOutlet GraphicsView *graphicsView; -@property (unsafe_unretained) IBOutlet NSTextView *sourceView; -@property (weak) IBOutlet NSTextField *status; -@property (weak) NSUndoManager *documentUndoManager; -@property (copy) NSAttributedString *source; -@property (copy) NSString *tikz; -@property (weak) IBOutlet ParseErrorView *errorNotification; -@property (weak) IBOutlet NSTextField *errorMessage; - -- (void)updateTikzFromGraph; -- (void)graphChanged:(NSNotification*)n; - -- (IBAction)closeParseError:(id)pId; - -// called by code, these do not register an undo -- (BOOL)tryParseTikz; -- (void)doRevertTikz; - -// called by user, these do register an undo -- (void)parseTikz:(id)sender; -- (void)revertTikz:(id)sender; - -@end diff --git a/tikzit-old/src/osx/TikzSourceController.m b/tikzit-old/src/osx/TikzSourceController.m deleted file mode 100644 index 84eb3a5..0000000 --- a/tikzit-old/src/osx/TikzSourceController.m +++ /dev/null @@ -1,241 +0,0 @@ -// -// TikzSourceController.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "TikzSourceController.h" -#import "TikzGraphAssembler.h" -#import "Graph.h" - -@implementation TikzSourceController - -@synthesize graphicsView, sourceView, source, status; -@synthesize documentUndoManager, tikzChanged; -@synthesize errorMessage, errorNotification; - -- (void)endEditing { - NSResponder *res = [[sourceView window] firstResponder]; - [[sourceView window] makeFirstResponder:nil]; - [[sourceView window] makeFirstResponder:res]; -} - -- (void)undoParseTikz:(Graph *)oldGraph { - [graphicsView setGraph:oldGraph]; - [graphicsView setEnabled:NO]; - [graphicsView postGraphChange]; - [graphicsView refreshLayers]; - - [documentUndoManager registerUndoWithTarget:self - selector:@selector(parseTikz:) - object:self]; - [documentUndoManager setActionName:@"Parse Tikz"]; -} - -- (void)undoRevertTikz:(NSString*)oldTikz { - [self setTikz:oldTikz]; - [graphicsView setEnabled:NO]; - [graphicsView refreshLayers]; - - [documentUndoManager registerUndoWithTarget:self - selector:@selector(revertTikz:) - object:self]; - [documentUndoManager setActionName:@"Revert Tikz"]; -} - -- (void)undoTikzChange:(id)ignore { - [graphicsView setEnabled:YES]; - [graphicsView refreshLayers]; - [self endEditing]; - [self updateTikzFromGraph]; - [documentUndoManager registerUndoWithTarget:self - selector:@selector(redoTikzChange:) - object:nil]; - [documentUndoManager setActionName:@"Tikz Change"]; -} - -- (void)redoTikzChange:(id)ignore { - [graphicsView setEnabled:NO]; - [graphicsView refreshLayers]; - [documentUndoManager registerUndoWithTarget:self - selector:@selector(undoTikzChange:) - object:nil]; - [documentUndoManager setActionName:@"Tikz Change"]; -} - - -- (void)awakeFromNib { - justUndid = NO; - successColor = [NSColor colorWithCalibratedRed:0.0f - green:0.5f - blue:0.0f - alpha:1.0f]; - failedColor = [NSColor redColor]; - - NSFont *font = [NSFont userFixedPitchFontOfSize:11.0f]; - - if (font != nil) { - textAttrs = [NSDictionary dictionaryWithObject:font - forKey:NSFontAttributeName]; - } else { - NSLog(@"WARNING: couldn't find monospaced font."); - textAttrs = [NSDictionary dictionary]; - } - - - [self graphChanged:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(graphChanged:) - name:@"GraphChanged" - object:graphicsView]; -} - -- (void)setTikz:(NSString *)str { - [self willChangeValueForKey:@"source"]; - source = [[NSAttributedString alloc] initWithString:str attributes:textAttrs]; - [self didChangeValueForKey:@"source"]; -} - -- (NSString*)tikz { - return [source string]; -} - -- (void)updateTikzFromGraph { - [self setTikz:[[graphicsView graph] tikz]]; - [errorNotification setHidden:TRUE]; -} - -- (void)graphChanged:(NSNotification*)n { - if ([graphicsView enabled]) [self updateTikzFromGraph]; -} - -- (IBAction)closeParseError:(id)pId{ - [errorNotification setHidden:TRUE]; -} - -- (void)textDidBeginEditing:(NSNotification *)notification { - if ([graphicsView enabled]){ - [graphicsView setEnabled:NO]; - [graphicsView refreshLayers]; - [documentUndoManager registerUndoWithTarget:self - selector:@selector(undoTikzChange:) - object:nil]; - [documentUndoManager setActionName:@"Tikz Change"]; - } -} - -- (BOOL)tryParseTikz { - NSError *thisError; - - Graph *g = [TikzGraphAssembler parseTikz:[self tikz] - error:&thisError]; - - lastError = thisError; - - if (g) { - [graphicsView deselectAll:self]; - [graphicsView setGraph:g]; - [graphicsView refreshLayers]; - [self doRevertTikz]; - return YES; - } else { - return NO; - } -} - -- (void)doRevertTikz { - [self updateTikzFromGraph]; - [self endEditing]; - [graphicsView setEnabled:YES]; - [graphicsView refreshLayers]; - [status setStringValue:@""]; -} - -- (void)parseTikz:(id)sender { - if (![graphicsView enabled]) { - Graph *oldGraph = [graphicsView graph]; - if ([self tryParseTikz]) { - [self endEditing]; - [documentUndoManager registerUndoWithTarget:self - selector:@selector(undoParseTikz:) - object:oldGraph]; - [documentUndoManager setActionName:@"Parse Tikz"]; - - [status setStringValue:@"success"]; - [status setTextColor:successColor]; - - [errorNotification setHidden:TRUE]; - } else { - [status setStringValue:@"parse error"]; - [status setTextColor:failedColor]; - - NSDictionary *d = [lastError userInfo]; - - NSString *ts = [NSString stringWithFormat: @"Parse error on line %@: %@\n", [d valueForKey:@"startLine"], [d valueForKey:NSLocalizedDescriptionKey]]; - NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat: @"Parse error on line %@: %@\n%@\n", [d valueForKey:@"startLine"], [d valueForKey:NSLocalizedDescriptionKey], [[d valueForKey:@"syntaxString"] stringByReplacingOccurrencesOfString:@"\t" withString:@""]]]; - - NSInteger tokenLength = [[d valueForKey:@"tokenLength"] integerValue]; - // Bit of a mess, offset around to find correct position and correct for 4 characters for every one character of \t - NSInteger addedTokenStart = [[d valueForKey:@"tokenStart"] integerValue] + [ts length] - ([[[d valueForKey:@"syntaxString"] componentsSeparatedByString:@"\t"] count]-1)*4 - tokenLength; - - // Can't see if the error is a start paranthesis as only that will be underlined, underline the entire paranthesis instead - if(tokenLength == 1 && [[as string] characterAtIndex:addedTokenStart] == '('){ - tokenLength += [[[as string] substringFromIndex:addedTokenStart+1] rangeOfString:@")"].location + 1; - } - - // Same if unexpected endparanthesis - if(tokenLength == 1 && [[as string] characterAtIndex:addedTokenStart] == ')'){ - NSInteger d = addedTokenStart - [[[as string] substringToIndex:addedTokenStart] rangeOfString:@"(" options:NSBackwardsSearch].location; - - tokenLength += d; - addedTokenStart -= d; - } - - [as beginEditing]; - [as addAttributes:[NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithInt:NSUnderlineStyleSingle | NSUnderlinePatternDot], NSUnderlineStyleAttributeName, - [NSColor redColor], NSUnderlineColorAttributeName, - nil] - range:NSMakeRange(addedTokenStart, tokenLength)]; - [as endEditing]; - - [errorMessage setAttributedStringValue:as]; - [errorNotification setHidden:FALSE]; - } - } -} - -- (void)revertTikz:(id)sender { - if (![graphicsView enabled]) { - NSString *oldTikz = [[self tikz] copy]; - [self doRevertTikz]; - - [documentUndoManager registerUndoWithTarget:self - selector:@selector(undoRevertTikz:) - object:oldTikz]; - [documentUndoManager setActionName:@"Revert Tikz"]; - } -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -@end diff --git a/tikzit-old/src/osx/TikzWindowController.h b/tikzit-old/src/osx/TikzWindowController.h deleted file mode 100644 index eab427c..0000000 --- a/tikzit-old/src/osx/TikzWindowController.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// TikzWindowController.h -// TikZiT -// -// Created by Aleks Kissinger on 26/01/2011. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import - -@class TikzDocument, GraphicsView, TikzSourceController; - -@interface TikzWindowController : NSWindowController { - GraphicsView *__weak graphicsView; - TikzSourceController *__weak tikzSourceController; - TikzDocument *document; -} - -@property (weak) IBOutlet GraphicsView *graphicsView; -@property (weak) IBOutlet TikzSourceController *tikzSourceController; - -- (id)initWithDocument:(TikzDocument*)doc; - -// pass these straight to the tikz source controller -- (void)parseTikz:(id)sender; -- (void)revertTikz:(id)sender; -- (void)zoomIn:(id)sender; -- (void)zoomOut:(id)sender; -- (void)zoomToActualSize:(id)sender; - -@end diff --git a/tikzit-old/src/osx/TikzWindowController.m b/tikzit-old/src/osx/TikzWindowController.m deleted file mode 100644 index bfacbfb..0000000 --- a/tikzit-old/src/osx/TikzWindowController.m +++ /dev/null @@ -1,66 +0,0 @@ -// -// TikzWindowController.m -// TikZiT -// -// Created by Aleks Kissinger on 26/01/2011. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import "TikzWindowController.h" -#import "TikzDocument.h" -#import "GraphicsView.h" -#import "TikzSourceController.h" - -@implementation TikzWindowController - -@synthesize graphicsView, tikzSourceController; - -- (id)initWithDocument:(TikzDocument*)doc { - if (!(self = [super initWithWindowNibName:@"TikzDocument"])) return nil; - document = doc; - return self; -} - -- (void)awakeFromNib { - if ([document tikz] != nil) { - [graphicsView setEnabled:NO]; - [tikzSourceController setTikz:[document tikz]]; - [tikzSourceController parseTikz:self]; - } - - [graphicsView setDocumentUndoManager:[document undoManager]]; - [tikzSourceController setDocumentUndoManager:[document undoManager]]; -} - -- (void)parseTikz:(id)sender { - [tikzSourceController parseTikz:sender]; -} - -- (void)revertTikz:(id)sender { - [tikzSourceController revertTikz:sender]; -} - -- (void)previewTikz:(id)sender { - PreviewController *pc = [PreviewController defaultPreviewController]; - if (![[pc window] isVisible]) [pc showWindow:sender]; - [pc buildTikz:[tikzSourceController tikz]]; -} - -- (void)zoomIn:(id)sender { - float scale = [[graphicsView transformer] scale] * 1.25f; - [[graphicsView transformer] setScale:scale]; - [graphicsView refreshLayers]; -} - -- (void)zoomOut:(id)sender { - float scale = [[graphicsView transformer] scale] * 0.8f; - [[graphicsView transformer] setScale:scale]; - [graphicsView refreshLayers]; -} - -- (void)zoomToActualSize:(id)sender { - [[graphicsView transformer] setScale:50.0f]; - [graphicsView refreshLayers]; -} - -@end diff --git a/tikzit-old/src/osx/ToolPaletteController.h b/tikzit-old/src/osx/ToolPaletteController.h deleted file mode 100644 index 6301c6b..0000000 --- a/tikzit-old/src/osx/ToolPaletteController.h +++ /dev/null @@ -1,42 +0,0 @@ -// -// ToolPaletteController.h -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import - -typedef enum { - TikzToolSelect, - TikzToolNode, - TikzToolEdge, - TikzToolCrop -} TikzTool; - -@interface ToolPaletteController : NSObject { - NSPanel *__weak toolPalette; - NSMatrix *__weak toolMatrix; -} - -@property TikzTool selectedTool; -@property (weak) IBOutlet NSPanel *toolPalette; -@property (weak) IBOutlet NSMatrix *toolMatrix; - - -@end diff --git a/tikzit-old/src/osx/ToolPaletteController.m b/tikzit-old/src/osx/ToolPaletteController.m deleted file mode 100644 index 000287d..0000000 --- a/tikzit-old/src/osx/ToolPaletteController.m +++ /dev/null @@ -1,58 +0,0 @@ -// -// ToolPaletteController.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "ToolPaletteController.h" - - -@implementation ToolPaletteController - -@synthesize toolPalette, toolMatrix; - -- (TikzTool)selectedTool { - switch (toolMatrix.selectedRow) { - case 0: return TikzToolSelect; - case 1: return TikzToolNode; - case 2: return TikzToolEdge; - case 3: return TikzToolCrop; - } - return TikzToolSelect; -} - -- (void)setSelectedTool:(TikzTool)tool { - switch (tool) { - case TikzToolSelect: - [toolMatrix selectCellAtRow:0 column:0]; - break; - case TikzToolNode: - [toolMatrix selectCellAtRow:1 column:0]; - break; - case TikzToolEdge: - [toolMatrix selectCellAtRow:2 column:0]; - break; - case TikzToolCrop: - [toolMatrix selectCellAtRow:3 column:0]; - break; - } -} - -@end diff --git a/tikzit-old/src/osx/UpdatePreferenceController.h b/tikzit-old/src/osx/UpdatePreferenceController.h deleted file mode 100644 index 816322f..0000000 --- a/tikzit-old/src/osx/UpdatePreferenceController.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// UpdatePreferenceController.h -// TikZiT -// -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import -#import - -@interface UpdatePreferenceController : NSViewController{ - IBOutlet SUUpdater *sharedUpdater; - IBOutlet NSDate *lastUpdate; -} - -- (IBAction)checkForUpdates:(id)sender; - -@end diff --git a/tikzit-old/src/osx/UpdatePreferenceController.m b/tikzit-old/src/osx/UpdatePreferenceController.m deleted file mode 100644 index 2ff270f..0000000 --- a/tikzit-old/src/osx/UpdatePreferenceController.m +++ /dev/null @@ -1,49 +0,0 @@ -// -// UpdatePreferenceController.h -// TikZiT -// -// Copyright (c) 2013 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "UpdatePreferenceController.h" - -@interface UpdatePreferenceController () - -@end - -@implementation UpdatePreferenceController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - sharedUpdater = [SUUpdater sharedUpdater]; - } - return self; -} - -- (IBAction)checkForUpdates:(id)sender{ - [sharedUpdater checkForUpdates:sender]; -} - -- (NSDate*)getLastUpdate{ - return [sharedUpdater lastUpdateCheckDate]; -} - -@end diff --git a/tikzit-old/src/osx/UpdatePreferencePanel.xib b/tikzit-old/src/osx/UpdatePreferencePanel.xib deleted file mode 100644 index a9f57bd..0000000 --- a/tikzit-old/src/osx/UpdatePreferencePanel.xib +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tikzit-old/src/osx/main.m b/tikzit-old/src/osx/main.m deleted file mode 100644 index e6b4499..0000000 --- a/tikzit-old/src/osx/main.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// main.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// - -#import - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **) argv); -} diff --git a/tikzit-old/src/osx/test/main.m b/tikzit-old/src/osx/test/main.m deleted file mode 100644 index ad0c1f7..0000000 --- a/tikzit-old/src/osx/test/main.m +++ /dev/null @@ -1,56 +0,0 @@ -// -// main.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// - -#import "test/test.h" -#include - -void testCommon(); -void testOSX(); - -int main(int argc, char **argv) { - if (argc == 2 && strcmp(argv[1], "--disable-color")==0) { - setColorEnabled(NO); - } else { - setColorEnabled(YES); - } - - NSBundle *bund = [NSBundle bundleWithPath:@"TikZiT.app"]; - - - PUTS(@""); - PUTS(@"**********************************************"); - PUTS(@"TikZiT TESTS, OS X BUNDLE VERSION %@", - [bund objectForInfoDictionaryKey:@"CFBundleVersion"]); - PUTS(@"**********************************************"); - PUTS(@""); - - startTests(); - testCommon(); - testOSX(); - - PUTS(@""); - PUTS(@"**********************************************"); - endTests(); - PUTS(@"**********************************************"); - PUTS(@""); -} \ No newline at end of file diff --git a/tikzit-old/src/osx/test/osx.m b/tikzit-old/src/osx/test/osx.m deleted file mode 100644 index f9565ab..0000000 --- a/tikzit-old/src/osx/test/osx.m +++ /dev/null @@ -1,64 +0,0 @@ -// -// osx.m -// TikZiT -// -// Copyright 2010 Aleks Kissinger. All rights reserved. -// -// -// This file is part of TikZiT. -// -// TikZiT is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// TikZiT is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with TikZiT. If not, see . -// -#import "test/test.h" - -#import - -void testOSX() { -// char template[] = "/tmp/tikzit_test_tmp_XXXXXXX"; -// char *dir = mkdtemp(template); -// NSString *tempDir = [NSString stringWithUTF8String:dir]; -// -// NSString *testLatex = -// @"\\documentclass{article}\n" -// @"\\begin{document}\n" -// @"test document\n" -// @"\\end{document}\n"; -// -// NSString *texFile = [NSString stringWithFormat:@"%@/test.tex", tempDir]; -// NSString *pdfFile = [NSString stringWithFormat:@"%@/test.pdf", tempDir]; -// -// [testLatex writeToFile:texFile atomically:NO encoding:NSUTF8StringEncoding error:NULL]; -// -// NSTask *task = [[NSTask alloc] init]; -// [task setLaunchPath:@"/bin/bash"]; -// NSPipe *inpt = [NSPipe pipe]; -// NSPipe *outpt = [NSPipe pipe]; -// [task setStandardInput:inpt]; -// [task setStandardOutput:outpt]; -// -// [task launch]; -// -// NSFileHandle *wr = [inpt fileHandleForWriting]; -// NSString *cmd = -// [NSString stringWithFormat: -// @"if [ -e ~/.profile ]; then source ~/.profile; fi" -// @"if [ -e ~/.profile ]; then source ~/.profile; fi"; -// [wr writeData:[cmd dataUsingEncoding:NSUTF8StringEncoding]]; -// [wr closeFile]; -// -// NSFileHandle *rd = [outpt fileHandleForReading]; -// NSString *res = [[NSString alloc] initWithData:[rd readDataToEndOfFile] -// encoding:NSUTF8StringEncoding]; -// NSLog(@"got:\n %@", res); -} diff --git a/tikzit-old/src/tikzit.rc b/tikzit-old/src/tikzit.rc deleted file mode 100644 index 072f825..0000000 --- a/tikzit-old/src/tikzit.rc +++ /dev/null @@ -1,24 +0,0 @@ -1 VERSIONINFO -FILEVERSION 0,7,0,0 -PRODUCTVERSION 0,7,0,0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "080904E4" - BEGIN - VALUE "FileDescription", "A graph editor for LaTeX" - VALUE "FileVersion", "1.0" - VALUE "InternalName", "tikzit" - VALUE "LegalCopyright", "Aleks Kissinger, Alex Merry, Chris Heunen" - VALUE "OriginalFilename", "tikzit.exe" - VALUE "ProductName", "TikZiT" - VALUE "ProductVersion", "0.7" - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1252 - END -END -id ICON "../tikzit.ico" diff --git a/tikzit-old/text-x-generic.png b/tikzit-old/text-x-generic.png deleted file mode 100644 index 928a679..0000000 Binary files a/tikzit-old/text-x-generic.png and /dev/null differ diff --git a/tikzit-old/text-x-script.png b/tikzit-old/text-x-script.png deleted file mode 100644 index 801dcd6..0000000 Binary files a/tikzit-old/text-x-script.png and /dev/null differ diff --git a/tikzit-old/tikzit.icns b/tikzit-old/tikzit.icns deleted file mode 100644 index dc66f7f..0000000 Binary files a/tikzit-old/tikzit.icns and /dev/null differ diff --git a/tikzit-old/tikzit.ico b/tikzit-old/tikzit.ico deleted file mode 100644 index 3132b4c..0000000 Binary files a/tikzit-old/tikzit.ico and /dev/null differ diff --git a/tikzit-old/tikzit.spec b/tikzit-old/tikzit.spec deleted file mode 100644 index 237c543..0000000 --- a/tikzit-old/tikzit.spec +++ /dev/null @@ -1,98 +0,0 @@ -Name: tikzit -Version: 1.0 -Release: 1%{?dist} -Summary: Tool for creating and modifying PGF/TikZ-based node-and-edge graphs for LaTeX documents - -# try to choose a sensible group for this distro -%if 0%{?suse_version} -Group: Productivity/Graphics/Visualization/Graph -%else -%if 0%{?mdkversion} -Group: Sciences/Other -%else -Group: Applications/Productivity -%endif -%endif - -%if 0%{?suse_version} -License: GPL-2.0+ -%else -License: GPLv2+ -%endif -URL: http://tikzit.sourceforge.net -Source0: http://switch.dl.sourceforge.net/project/%{name}/%{name}-%{version}/%{name}-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build - -BuildRequires: gcc-objc >= 4.6.0 -BuildRequires: gnustep-base-devel >= 1.18.0 -BuildRequires: gtk2-devel >= 2.18.0 -BuildRequires: pango-devel >= 1.16 -BuildRequires: cairo-devel >= 1.4 -%if 0%{?suse_version}%{?mdkversion} -BuildRequires: libpoppler-glib-devel >= 0.10 -%else -BuildRequires: poppler-glib-devel >= 0.10 -%endif -%if 0%{?suse_version} -BuildRequires: update-desktop-files -%endif - -%description -TikZiT is a GTK+ application that allows the creation and modification of TeX -diagrams written using the pgf/TikZ macro library. It is especially geared -toward rapidly creating "dot"-diagrams for use in academic papers. - - -%prep -%setup -q - - -%build -%configure -make %{?_smp_mflags} - - -%install -rm -rf %{buildroot} -make install DESTDIR=%{buildroot} -%if 0%{?suse_version} -# SuSE is particularly fussy about desktop file categories -%suse_update_desktop_file %{name} -r Graphics 2DGraphics -%endif - - -%clean -rm -rf %{buildroot} - - -%files -%defattr(-,root,root,-) -%doc -%{_bindir}/tikzit -%{_datadir}/tikzit/ -%{_datadir}/applications/tikzit.desktop -%{_datadir}/icons/hicolor/* - - -%changelog -* Fri May 17 2013 Alex Merry 1.0-2 --Fixed license on openSUSE - -* Tue May 7 2013 Alex Merry 1.0-1 --Bumped version - -* Fri Aug 24 2012 Alex Merry 0.9-1 --Bumped version --Bumped requirements - -* Tue Dec 06 2011 Alex Merry 0.7-1 --Bumped version - -* Tue Feb 08 2011 Alex Merry 0.6-1 --Bumped version --Added Pango and Cairo to BuildRequires --Set minimum version for GNUStep-base - -* Thu Dec 02 2010 Alex Merry 0.5-1 --Rewrote spec file - diff --git a/tikzit-old/tikzit48x48.png b/tikzit-old/tikzit48x48.png deleted file mode 100644 index 056d04b..0000000 Binary files a/tikzit-old/tikzit48x48.png and /dev/null differ diff --git a/tikzit-old/tikzit_dsa_pub.pem b/tikzit-old/tikzit_dsa_pub.pem deleted file mode 100644 index c97cc04..0000000 --- a/tikzit-old/tikzit_dsa_pub.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQDAdRlqLgJYjdAKkDsKtZDXgVlhqwyl -OXWCILHuE/MLh24I/mAaro4hucdhj92V5td9KNdM/R19904yZ3XcLj2/SodDVD7I -lEHPGwC/y+mJd9CaMNI/ARgFbLwJ+3+l/Ia3sraa/ASGAzardJPzYdkkRbZ/1DJn -wtHh2HgmPBdOMZZrbDmw3g4lj69Vacj4Wdz+YDG7750FjAUd+IcOvaDip28B8ogj -ogVirSXGe5YLoYbw078gx92PzSw6vfOZ3b7Gqk7zilYGB0bUJXUPSLOkxa5TMSx1 -Lr2UdW+vXrudI76rBhW52B32i7f801N4/W/qUfg8tw4tUGi/Uw8n2/S5AhUA0F82 -Qxit1jmqP0mZSLAn+qIVPuUCggEAEkSBjRxMo4KRvHOSppZphdaV2RWmQ6w9mxMj -3Z4AGDNU/buQ+TWJEYGVsIXpykI7DYCfgp8XO9uhj1hporfDsU4QGNZd0rG7SLK3 -DHwSf9QTgXY+D5IRQvkBtocxYRgNpuW+mfwl886SPmrRcT3QvsiFaI7/Iw787Tr6 -Yip4D7GjqTvj+epJH6kZq1xbdnrfBEA4dKs5IrZupF75npU8d1EjcdLlTyuzxuoZ -5a3SQWoBvT4l0xvbtR4yv+Af++MB+uxdxBSYMIgtQPgoIjFWtTDRZCwFAig1RWxz -fHEI5Fk4mqGhLAVbROL/pebYYZ5UxTKt9AMjmgmuM10/L5TXbwOCAQUAAoIBAA7t -W96VBoZgbbO2EfSxt5az4EnAJmuua6DNjZzESpcb67/DR7nLd5yveZEPL+9x6c1S -FtduIk8allplryOJtwysf8KkxrPVej83XiVJ9PDLMktsYjtnVksGIk9CS3v98OgT -c3g+xgJpRbwB6dROa5ZMxvoCU100ngfI3F/RUqeYYh7PP5kEL6SfqEHG5udIf1K7 -jUmOycNzI5Fsi+IDh8qtzxoOVTjoMPlN2F4T27xuWXA0BEd/NZqtgGLIFsbww5oD -8VPQIeo9UwQkYo/Qz1/uuaXi1u2PbTbbx2FTUL+zJuqrAv3oqmG2Ktyi0RXZaUAJ -4+P+kdS46Ip2NybQbkE= ------END PUBLIC KEY----- diff --git a/tikzit-old/tikzitdoc.icns b/tikzit-old/tikzitdoc.icns deleted file mode 100644 index 2f8bbcd..0000000 Binary files a/tikzit-old/tikzitdoc.icns and /dev/null differ diff --git a/tikzit-old/transform-crop-and-resize.png b/tikzit-old/transform-crop-and-resize.png deleted file mode 100644 index 4dedd93..0000000 Binary files a/tikzit-old/transform-crop-and-resize.png and /dev/null differ diff --git a/tikzit-old/transform-move.png b/tikzit-old/transform-move.png deleted file mode 100644 index ae4201b..0000000 Binary files a/tikzit-old/transform-move.png and /dev/null differ diff --git a/tikzit-old/updates.png b/tikzit-old/updates.png deleted file mode 100755 index 469ae30..0000000 Binary files a/tikzit-old/updates.png and /dev/null differ -- cgit v1.2.3 From 7c4faa67f4b45671884bdccd99d83f92ca655366 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 20 Jul 2018 11:00:29 +0200 Subject: ... --- src/gui/nodeitem.cpp | 3 ++- src/gui/stylepalette.cpp | 5 +++-- src/gui/tikzscene.cpp | 11 ++++++----- src/gui/tikzview.cpp | 40 ++++++++++++++++++++++++++++------------ 4 files changed, 39 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 922747d..b452848 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -70,8 +70,9 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge QPen pen(QColor(180,180,220)); QVector p; - p << 2.0 << 2.0; + p << 1.0 << 2.0; pen.setDashPattern(p); + pen.setWidthF(2.0f); painter->setPen(pen); painter->setBrush(Qt::NoBrush); painter->drawPath(shape()); diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 6d6599b..e3fea0b 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -46,12 +46,13 @@ StylePalette::StylePalette(QWidget *parent) : ui->styleListView->setModel(_nodeModel); ui->styleListView->setViewMode(QListView::IconMode); ui->styleListView->setMovement(QListView::Static); - ui->styleListView->setGridSize(QSize(70,40)); + ui->styleListView->setGridSize(QSize(48,48)); + ui->edgeStyleListView->setModel(_edgeModel); ui->edgeStyleListView->setViewMode(QListView::IconMode); ui->edgeStyleListView->setMovement(QListView::Static); - ui->edgeStyleListView->setGridSize(QSize(70,40)); + ui->edgeStyleListView->setGridSize(QSize(48,48)); reloadStyles(); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 772c67b..47464fe 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -44,7 +44,7 @@ TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, QPen pen; pen.setColor(QColor::fromRgbF(0.5f, 0.0f, 0.5f)); - pen.setWidth(3); + //pen.setWidth(3.0f); pen.setCosmetic(true); _drawEdgeItem->setPen(pen); _drawEdgeItem->setLine(0,0,0,0); @@ -52,10 +52,11 @@ TikzScene::TikzScene(TikzDocument *tikzDocument, ToolPalette *tools, addItem(_drawEdgeItem); pen.setColor(QColor::fromRgbF(0.6f, 0.6f, 0.8f)); - pen.setWidth(3); - QVector dash; - dash << 4.0 << 4.0; - pen.setDashPattern(dash); + //pen.setWidth(3.0f); + //QVector dash; + //dash << 4.0 << 4.0; + pen.setStyle(Qt::DashLine); + //pen.setDashPattern(dash); _rubberBandItem->setPen(pen); QBrush brush(QColor::fromRgbF(0.6,0.6,0.8,0.2)); diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 700cf29..6cdb17c 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -57,52 +57,68 @@ void TikzView::drawBackground(QPainter *painter, const QRectF &rect) // draw the grid QPen pen1; - pen1.setWidth(1); + //pen1.setWidthF(0.5); pen1.setCosmetic(true); - pen1.setColor(QColor(230,230,230)); + pen1.setColor(QColor(250,250,255)); QPen pen2 = pen1; - pen2.setColor(QColor(200,200,200)); + pen2.setColor(QColor(240,240,250)); QPen pen3 = pen1; - pen3.setColor(QColor(160,160,160)); + pen3.setColor(QColor(220,220,240)); painter->setPen(pen1); if (_scale > 0.2f) { for (int x = -GRID_SEP; x > rect.left(); x -= GRID_SEP) { - if (x % (GRID_SEP * GRID_N) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); + if (x % (GRID_SEP * GRID_N) != 0) { + qreal xf = (qreal)x; + painter->drawLine(xf, rect.top(), xf, rect.bottom()); + } } for (int x = GRID_SEP; x < rect.right(); x += GRID_SEP) { - if (x % (GRID_SEP * GRID_N) != 0) painter->drawLine(x, rect.top(), x, rect.bottom()); + if (x % (GRID_SEP * GRID_N) != 0) { + qreal xf = (qreal)x; + painter->drawLine(xf, rect.top(), xf, rect.bottom()); + } } for (int y = -GRID_SEP; y > rect.top(); y -= GRID_SEP) { - if (y % (GRID_SEP * GRID_N) != 0) painter->drawLine(rect.left(), y, rect.right(), y); + if (y % (GRID_SEP * GRID_N) != 0) { + qreal yf = (qreal)y; + painter->drawLine(rect.left(), yf, rect.right(), yf); + } } for (int y = GRID_SEP; y < rect.bottom(); y += GRID_SEP) { - if (y % (GRID_SEP * GRID_N) != 0) painter->drawLine(rect.left(), y, rect.right(), y); + if (y % (GRID_SEP * GRID_N) != 0) { + qreal yf = (qreal)y; + painter->drawLine(rect.left(), yf, rect.right(), yf); + } } } painter->setPen(pen2); for (int x = -GRID_SEP*GRID_N; x > rect.left(); x -= GRID_SEP*GRID_N) { - painter->drawLine(x, rect.top(), x, rect.bottom()); + qreal xf = (qreal)x; + painter->drawLine(xf, rect.top(), xf, rect.bottom()); } for (int x = GRID_SEP*GRID_N; x < rect.right(); x += GRID_SEP*GRID_N) { - painter->drawLine(x, rect.top(), x, rect.bottom()); + qreal xf = (qreal)x; + painter->drawLine(xf, rect.top(), xf, rect.bottom()); } for (int y = -GRID_SEP*GRID_N; y > rect.top(); y -= GRID_SEP*GRID_N) { - painter->drawLine(rect.left(), y, rect.right(), y); + qreal yf = (qreal)y; + painter->drawLine(rect.left(), yf, rect.right(), yf); } for (int y = GRID_SEP*GRID_N; y < rect.bottom(); y += GRID_SEP*GRID_N) { - painter->drawLine(rect.left(), y, rect.right(), y); + qreal yf = (qreal)y; + painter->drawLine(rect.left(), yf, rect.right(), yf); } painter->setPen(pen3); -- cgit v1.2.3 From 59eee652c5fea36945a4a8ce2936843bd90d0e1b Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 20 Jul 2018 11:01:34 +0200 Subject: ... --- .gitignore | 40 +- COPYING | 1348 +++++----- Doxyfile | 5028 ++++++++++++++++++------------------- README.md | 100 +- bison.pri | 28 +- flex.pri | 16 +- images/edge.svg | 128 +- images/node.svg | 78 +- images/select.svg | 180 +- qt.conf | 4 +- src/data/edge.cpp | 826 +++--- src/data/edge.h | 260 +- src/data/edgestyle.cpp | 262 +- src/data/edgestyle.h | 112 +- src/data/graph.cpp | 546 ++-- src/data/graph.h | 218 +- src/data/graphelementdata.cpp | 410 +-- src/data/graphelementdata.h | 178 +- src/data/graphelementproperty.cpp | 154 +- src/data/graphelementproperty.h | 116 +- src/data/node.cpp | 236 +- src/data/node.h | 144 +- src/data/nodestyle.cpp | 214 +- src/data/nodestyle.h | 102 +- src/data/style.cpp | 156 +- src/data/style.h | 108 +- src/data/tikzassembler.cpp | 144 +- src/data/tikzassembler.h | 120 +- src/data/tikzdocument.cpp | 382 +-- src/data/tikzdocument.h | 138 +- src/data/tikzlexer.l | 382 +-- src/data/tikzparser.y | 568 ++--- src/data/tikzparserdefs.h | 80 +- src/data/tikzstyles.cpp | 142 +- src/data/tikzstyles.h | 102 +- src/gui/commands.h | 8 +- src/gui/edgeitem.cpp | 442 ++-- src/gui/edgeitem.h | 124 +- src/gui/mainmenu.cpp | 302 +-- src/gui/mainmenu.h | 128 +- src/gui/mainmenu.ui | 418 +-- src/gui/mainwindow.cpp | 320 +-- src/gui/mainwindow.h | 120 +- src/gui/mainwindow.ui | 410 +-- src/gui/nodeitem.cpp | 318 +-- src/gui/nodeitem.h | 102 +- src/gui/propertypalette.cpp | 122 +- src/gui/propertypalette.h | 92 +- src/gui/propertypalette.ui | 66 +- src/gui/stylepalette.cpp | 358 +-- src/gui/stylepalette.h | 122 +- src/gui/stylepalette.ui | 240 +- src/gui/tikzscene.cpp | 1560 ++++++------ src/gui/tikzscene.h | 214 +- src/gui/tikzview.cpp | 256 +- src/gui/tikzview.h | 104 +- src/gui/toolpalette.cpp | 172 +- src/gui/toolpalette.h | 106 +- src/gui/undocommands.cpp | 856 +++---- src/gui/undocommands.h | 388 +-- src/main.cpp | 96 +- src/test/testmain.cpp | 44 +- src/test/testparser.cpp | 326 +-- src/test/testparser.h | 36 +- src/test/testtest.cpp | 20 +- src/test/testtest.h | 34 +- src/test/testtikzoutput.cpp | 194 +- src/test/testtikzoutput.h | 34 +- src/tikzit.cpp | 422 ++-- src/tikzit.h | 282 +-- src/util.cpp | 144 +- src/util.h | 96 +- tikzit.pro | 216 +- tikzit.qrc | 52 +- tikzlexer.h | 700 +++--- 75 files changed, 11547 insertions(+), 11547 deletions(-) (limited to 'src') diff --git a/.gitignore b/.gitignore index 8734edf..8bbf502 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,20 @@ -GeneratedFiles -.vs -debug -release -*.vcxproj* -*.sln -*.rc -x64 -target_wrapper.bat -.qmake.stash -build-tikzit-* -*.pro.user -*.autosave -Makefile -tikzit.app -target_wrapper.sh -src/data/tikzlexer.lexer.cpp -src/data/tikzparser.parser.cpp -src/data/tikzparser.parser.hpp -*.o +GeneratedFiles +.vs +debug +release +*.vcxproj* +*.sln +*.rc +x64 +target_wrapper.bat +.qmake.stash +build-tikzit-* +*.pro.user +*.autosave +Makefile +tikzit.app +target_wrapper.sh +src/data/tikzlexer.lexer.cpp +src/data/tikzparser.parser.cpp +src/data/tikzparser.parser.hpp +*.o diff --git a/COPYING b/COPYING index f288702..3877ae0 100644 --- a/COPYING +++ b/COPYING @@ -1,674 +1,674 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Doxyfile b/Doxyfile index 56cedb0..06516f9 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,2514 +1,2514 @@ -# Doxyfile 1.8.14 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = TikZiT - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = 2.0 - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "A GUI diagram editor for TikZ" - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = /Users/alek/git/tikzit/images/tikzit128x128.png - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = ../tikzit.github.io/docs - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 0 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = /Users/alek/git/tikzit/src - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.l \ - *.y - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -# If clang assisted parsing is enabled you can provide the clang parser with the -# path to the compilation database (see: -# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files -# were built. This is equivalent to specifying the "-p" option to a clang tool, -# such as clang-check. These options will then be passed to the parser. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: 0. - -CLANG_COMPILATION_DATABASE_PATH= 0 - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via Javascript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have Javascript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , / + + Qt::ScrollBarAlwaysOn + + + Qt::ScrollBarAlwaysOff + -- cgit v1.2.3 From 5708cb51035cfd40692afd308fb2bf326528b885 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 11 Sep 2018 10:40:21 +0200 Subject: nodeitem respects shape --- src/gui/nodeitem.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index b452848..18ff43c 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -114,7 +114,12 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge QPainterPath NodeItem::shape() const { QPainterPath path; - path.addEllipse(QPointF(0,0), GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); + + if (_node->style()->shape() == "rectangle") { + path.addRect(-0.2 * GLOBAL_SCALEF, -0.2 * GLOBAL_SCALEF, 0.4 * GLOBAL_SCALEF, 0.4 * GLOBAL_SCALEF); + } else { + path.addEllipse(QPointF(0, 0), GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); + } return path; } -- cgit v1.2.3 From afcf3dba0753d71b801fb035277b2ec857f19de9 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 20 Sep 2018 22:23:39 +0200 Subject: restructured menu --- src/gui/mainmenu.ui | 38 ++++++++++++++++++++++++++++++++++---- src/gui/toolpalette.cpp | 2 +- src/main.cpp | 1 - 3 files changed, 35 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui index 80a7c81..1517fb1 100644 --- a/src/gui/mainmenu.ui +++ b/src/gui/mainmenu.ui @@ -36,6 +36,22 @@ + + + Reorder + + + + + + + Transform + + + + + + @@ -48,10 +64,8 @@ - - - - + + @@ -278,6 +292,22 @@ Shift+Down + + + Bring to Front + + + Ctrl+] + + + + + Send to Back + + + Ctrl+[ + + diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 044e8d0..c0e2a22 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -43,7 +43,7 @@ ToolPalette::ToolPalette(QWidget *parent) : select = new QAction(QIcon(":/images/select-ak.svg"), "Select"); vertex = new QAction(QIcon(":/images/node-ak.svg"), "Add Vertex"); edge = new QAction(QIcon(":/images/edge-ak.svg"), "Add Edge"); - crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); + //crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); tools->addAction(select); diff --git a/src/main.cpp b/src/main.cpp index 1fcefc0..97dbe4d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,7 +32,6 @@ // #include // #endif - int main(int argc, char *argv[]) { // #ifdef Q_OS_WIN -- cgit v1.2.3 From 5e5a98b97871ebaa3899e2f1bf08534e32f1f983 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 21 Sep 2018 08:48:43 +0200 Subject: fixed bug with edge styles --- src/data/nodestyle.cpp | 1 + src/data/tikzdocument.cpp | 5 ++++- src/gui/undocommands.cpp | 12 +++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 9c38dfd..20245d9 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -22,6 +22,7 @@ #include NodeStyle *noneStyle = new NodeStyle(); +NodeStyle *unknownStyle = new NodeStyle("unknown", new GraphElementData({GraphElementProperty("tikzit fill", "red")})); NodeStyle::NodeStyle() : Style() { diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index 5ddec90..fd70e92 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -85,7 +85,10 @@ void TikzDocument::open(QString fileName) delete _graph; _graph = newGraph; foreach (Node *n, _graph->nodes()) n->attachStyle(); - foreach (Edge *e, _graph->edges()) e->updateControls(); + foreach (Edge *e, _graph->edges()) { + e->attachStyle(); + e->updateControls(); + } _parseSuccess = true; refreshTikz(); setClean(); diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 0cfa0bd..2ed5034 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -422,7 +422,10 @@ ReplaceGraphCommand::ReplaceGraphCommand(TikzScene *scene, Graph *oldGraph, Grap void ReplaceGraphCommand::undo() { foreach (Node *n, _oldGraph->nodes()) n->attachStyle(); - foreach (Edge *e, _oldGraph->edges()) e->updateControls(); + foreach (Edge *e, _oldGraph->edges()) { + e->attachStyle(); + e->updateControls(); + } _scene->tikzDocument()->setGraph(_oldGraph); _scene->graphReplaced(); } @@ -430,7 +433,10 @@ void ReplaceGraphCommand::undo() void ReplaceGraphCommand::redo() { foreach (Node *n, _newGraph->nodes()) n->attachStyle(); - foreach (Edge *e, _newGraph->edges()) e->updateControls(); + foreach (Edge *e, _newGraph->edges()) { + e->attachStyle(); + e->updateControls(); + } _scene->tikzDocument()->setGraph(_newGraph); _scene->graphReplaced(); } @@ -496,4 +502,4 @@ void RotateNodesCommand::redo() _scene->refreshAdjacentEdges(_nodes.toList()); GraphUpdateCommand::redo(); -} \ No newline at end of file +} -- cgit v1.2.3 From 1f57600e248bc4171dbf72e211b3b061045ebeb4 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 21 Sep 2018 09:19:21 +0200 Subject: fixed edge selection bug --- src/gui/edgeitem.cpp | 11 ++++++++--- src/gui/tikzscene.cpp | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index f469506..146b4e0 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -102,7 +102,12 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } - } + } + + //QPen outline = QPen(Qt::red); + //painter->setPen(outline); + //painter->drawPath(_expPath); + //painter->setPen(pen); switch (_edge->style()->arrowTail()) { case EdgeStyle::Flat: @@ -209,9 +214,9 @@ void EdgeItem::setPath(const QPainterPath &path) // get the shape of the edge, and expand a bit to make selection easier QPainterPathStroker stroker; - stroker.setWidth(5); + stroker.setWidth(8); stroker.setJoinStyle(Qt::MiterJoin); - _expPath = (stroker.createStroke(_path) + _path).simplified(); + _expPath = stroker.createStroke(_path).simplified(); float r = GLOBAL_SCALEF * (_edge->cpDist() + 0.2); _boundingRect = _path.boundingRect().adjusted(-r,-r,r,r); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 8950325..2a37014 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -164,7 +164,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) if (items(_mouseDownPos).isEmpty()) { _rubberBandItem->setRect(QRectF(_mouseDownPos,_mouseDownPos)); _rubberBandItem->setVisible(true); - qDebug() << "starting rubber band drag"; + //qDebug() << "starting rubber band drag"; } // foreach (QGraphicsItem *gi, items()) { -- cgit v1.2.3 From 331c5d069e79b387eb8964c546dde8109ccf4798 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 21 Sep 2018 18:35:24 +0200 Subject: fixed bug with fractional coordinates on linux --- src/data/graph.cpp | 10 ++++++---- src/data/tikzlexer.l | 6 ++++-- src/gui/tikzscene.cpp | 4 ++++ 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/data/graph.cpp b/src/data/graph.cpp index 7d71ceb..2c9a84e 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -269,10 +269,12 @@ Graph *Graph::copyOfSubgraphWithNodes(QSet nds) Graph *g = new Graph(); g->setData(_data->copy()); QMap nodeTable; - foreach (Node *n, nds) { - Node *n1 = n->copy(); - nodeTable.insert(n, n1); - g->addNode(n1); + foreach (Node *n, nodes()) { + if (nds.contains(n)) { + Node *n1 = n->copy(); + nodeTable.insert(n, n1); + g->addNode(n1); + } } foreach (Edge *e, edges()) { if (nds.contains(e->source()) && nds.contains(e->target())) { diff --git a/src/data/tikzlexer.l b/src/data/tikzlexer.l index 0a67d1d..0d80467 100644 --- a/src/data/tikzlexer.l +++ b/src/data/tikzlexer.l @@ -90,12 +90,14 @@ FLOAT \-?[0-9]*(\.[0-9]+)? } {FLOAT} { yylval->pt = new QPointF(); - yylval->pt->setX(strtod(yytext,NULL)); + QString s(yytext); + yylval->pt->setX(s.toDouble()); BEGIN(ycoord); } , { } {FLOAT} { - yylval->pt->setY(strtod(yytext,NULL)); + QString s(yytext); + yylval->pt->setY(s.toDouble()); } \) { BEGIN(INITIAL); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 2a37014..1c6f0bb 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -621,6 +621,7 @@ void TikzScene::deleteSelectedItems() void TikzScene::copyToClipboard() { Graph *g = graph()->copyOfSubgraphWithNodes(getSelectedNodes()); + //qDebug() << g->tikz(); QGuiApplication::clipboard()->setText(g->tikz()); delete g; } @@ -641,8 +642,11 @@ void TikzScene::pasteFromClipboard() // attempt to parse whatever's on the clipboard, if we get a // non-empty tikz graph, insert it. if (ass.parse(tikz) && !g->nodes().isEmpty()) { + qDebug() << "CLIPBOARD:" << tikz; + qDebug() << "PARSED:" << g->tikz(); // make sure names in the new subgraph are fresh g->renameApart(graph()); + qDebug() << "FRESH:" << g->tikz(); QRectF srcRect = g->realBbox(); QRectF tgtRect = graph()->realBbox(); -- cgit v1.2.3 From 93cf29d4f47ac20cc0b1162284304b2e75bb777c Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 22 Sep 2018 11:55:12 +0200 Subject: setting the window icon --- src/gui/mainwindow.cpp | 5 +++++ tikzit.qrc | 1 + 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 537a612..4525aef 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include int MainWindow::_numWindows = 0; @@ -24,6 +26,9 @@ MainWindow::MainWindow(QWidget *parent) : _windowId = _numWindows; _numWindows++; ui->setupUi(this); + + setWindowIcon(QIcon(":/images/logo.png")); + setAttribute(Qt::WA_DeleteOnClose, true); _tikzDocument = new TikzDocument(this); diff --git a/tikzit.qrc b/tikzit.qrc index ed033b6..b3852aa 100644 --- a/tikzit.qrc +++ b/tikzit.qrc @@ -12,6 +12,7 @@ images/node-ak.svg images/select-ak.svg images/refresh.svg + images/logo.png qt.conf -- cgit v1.2.3 From 82e1e16580b4832e1241ceb9e38906e660baec85 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 22 Sep 2018 14:05:32 +0200 Subject: extend selection --- src/gui/mainmenu.cpp | 24 +++++++++++++++++ src/gui/mainmenu.h | 4 +++ src/gui/mainmenu.ui | 12 ++++----- src/gui/tikzscene.cpp | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--- src/gui/tikzscene.h | 4 +++ 5 files changed, 110 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index 6bbc95a..ca837fa 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -132,6 +132,30 @@ void MainMenu::on_actionRotateCCW_triggered() { tikzit->activeWindow()->tikzScene()->rotateNodes(false); } +void MainMenu::on_actionExtendUp_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->extendSelectionUp(); +} + +void MainMenu::on_actionExtendDown_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->extendSelectionDown(); +} + +void MainMenu::on_actionExtendLeft_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->extendSelectionLeft(); +} + +void MainMenu::on_actionExtendRight_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->extendSelectionRight(); +} + // Tikz void MainMenu::on_actionParse_triggered() diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index b561eab..7132dde 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -54,6 +54,10 @@ public slots: void on_actionReflectVertical_triggered(); void on_actionRotateCW_triggered(); void on_actionRotateCCW_triggered(); + void on_actionExtendUp_triggered(); + void on_actionExtendDown_triggered(); + void on_actionExtendLeft_triggered(); + void on_actionExtendRight_triggered(); // Tikz void on_actionParse_triggered(); diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui index 1517fb1..d144fce 100644 --- a/src/gui/mainmenu.ui +++ b/src/gui/mainmenu.ui @@ -33,8 +33,8 @@ - - + + @@ -276,17 +276,17 @@ Shift+Right - + - Above + Upward Shift+Up - + - Below + Downward Shift+Down diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 1c6f0bb..947620f 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -105,6 +105,78 @@ void TikzScene::graphReplaced() } } +void TikzScene::extendSelectionUp() +{ + bool found = false; + float m = 0.0f; + foreach (Node *n, getSelectedNodes()) { + if (!found) { + m = n->point().y(); + found = true; + } else { + if (n->point().y() > m) m = n->point().y(); + } + } + + foreach (NodeItem *ni, nodeItems().values()) { + if (ni->node()->point().y() >= m) ni->setSelected(true); + } +} + +void TikzScene::extendSelectionDown() +{ + bool found = false; + float m = 0.0f; + foreach (Node *n, getSelectedNodes()) { + if (!found) { + m = n->point().y(); + found = true; + } else { + if (n->point().y() < m) m = n->point().y(); + } + } + + foreach (NodeItem *ni, nodeItems().values()) { + if (ni->node()->point().y() <= m) ni->setSelected(true); + } +} + +void TikzScene::extendSelectionLeft() +{ + bool found = false; + float m = 0.0f; + foreach (Node *n, getSelectedNodes()) { + if (!found) { + m = n->point().x(); + found = true; + } else { + if (n->point().x() < m) m = n->point().x(); + } + } + + foreach (NodeItem *ni, nodeItems().values()) { + if (ni->node()->point().x() <= m) ni->setSelected(true); + } +} + +void TikzScene::extendSelectionRight() +{ + bool found = false; + float m = 0.0f; + foreach (Node *n, getSelectedNodes()) { + if (!found) { + m = n->point().x(); + found = true; + } else { + if (n->point().x() < m) m = n->point().x(); + } + } + + foreach (NodeItem *ni, nodeItems().values()) { + if (ni->node()->point().x() >= m) ni->setSelected(true); + } +} + void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (!_enabled) return; @@ -642,11 +714,8 @@ void TikzScene::pasteFromClipboard() // attempt to parse whatever's on the clipboard, if we get a // non-empty tikz graph, insert it. if (ass.parse(tikz) && !g->nodes().isEmpty()) { - qDebug() << "CLIPBOARD:" << tikz; - qDebug() << "PARSED:" << g->tikz(); // make sure names in the new subgraph are fresh g->renameApart(graph()); - qDebug() << "FRESH:" << g->tikz(); QRectF srcRect = g->realBbox(); QRectF tgtRect = graph()->realBbox(); diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 91f606f..16af125 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -76,6 +76,10 @@ public: public slots: void graphReplaced(); + void extendSelectionUp(); + void extendSelectionDown(); + void extendSelectionLeft(); + void extendSelectionRight(); protected: void mousePressEvent(QGraphicsSceneMouseEvent *event) override; -- cgit v1.2.3 From 1ca36f064da2a3619f0f8058f48e9f9dc6d07436 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 23 Sep 2018 09:52:35 +0200 Subject: more consistent z-ordering --- src/gui/tikzscene.cpp | 16 ++++++++++++++++ src/gui/tikzscene.h | 1 + src/gui/undocommands.cpp | 10 ++++++++++ 3 files changed, 27 insertions(+) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 947620f..39f8b76 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -103,6 +103,8 @@ void TikzScene::graphReplaced() _nodeItems.insert(n, ni); addItem(ni); } + + refreshZIndices(); } void TikzScene::extendSelectionUp() @@ -177,6 +179,20 @@ void TikzScene::extendSelectionRight() } } +void TikzScene::refreshZIndices() +{ + qreal z = 0.0; + foreach (Edge *e, graph()->edges()) { + edgeItems()[e]->setZValue(z); + z += 1.0; + } + + foreach (Node *n, graph()->nodes()) { + nodeItems()[n]->setZValue(z); + z += 1.0; + } +} + void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (!_enabled) return; diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index 16af125..b7beca9 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -80,6 +80,7 @@ public slots: void extendSelectionDown(); void extendSelectionLeft(); void extendSelectionRight(); + void refreshZIndices(); protected: void mousePressEvent(QGraphicsSceneMouseEvent *event) override; diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 2ed5034..7b254d1 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -157,6 +157,7 @@ void DeleteCommand::undo() if (_selEdges.contains(e)) ei->setSelected(true); } + _scene->refreshZIndices(); GraphUpdateCommand::undo(); } @@ -180,6 +181,7 @@ void DeleteCommand::redo() _scene->graph()->removeNode(n); } + _scene->refreshZIndices(); GraphUpdateCommand::redo(); } @@ -199,6 +201,7 @@ void AddNodeCommand::undo() //_scene->setBounds(_oldBounds); + _scene->refreshZIndices(); GraphUpdateCommand::undo(); } @@ -212,6 +215,7 @@ void AddNodeCommand::redo() //_scene->setBounds(_newBounds); + _scene->refreshZIndices(); GraphUpdateCommand::redo(); } @@ -228,6 +232,7 @@ void AddEdgeCommand::undo() delete ei; _scene->graph()->removeEdge(_edge); + _scene->refreshZIndices(); GraphUpdateCommand::undo(); } @@ -245,6 +250,7 @@ void AddEdgeCommand::redo() ei->stackBefore(_scene->nodeItems()[_scene->graph()->nodes().first()]); } + _scene->refreshZIndices(); GraphUpdateCommand::redo(); } @@ -361,6 +367,7 @@ void PasteCommand::undo() foreach(Node *n, _oldSelectedNodes) _scene->nodeItems()[n]->setSelected(true); foreach(Edge *e, _oldSelectedEdges) _scene->edgeItems()[e]->setSelected(true); + _scene->refreshZIndices(); GraphUpdateCommand::undo(); } @@ -384,6 +391,7 @@ void PasteCommand::redo() ni->setSelected(true); } + _scene->refreshZIndices(); GraphUpdateCommand::redo(); } @@ -428,6 +436,7 @@ void ReplaceGraphCommand::undo() } _scene->tikzDocument()->setGraph(_oldGraph); _scene->graphReplaced(); + GraphUpdateCommand::undo(); } void ReplaceGraphCommand::redo() @@ -439,6 +448,7 @@ void ReplaceGraphCommand::redo() } _scene->tikzDocument()->setGraph(_newGraph); _scene->graphReplaced(); + GraphUpdateCommand::redo(); } ReflectNodesCommand::ReflectNodesCommand(TikzScene *scene, QSet nodes, bool horizontal, QUndoCommand *parent) : -- cgit v1.2.3 From fa3d7da179b25d2ece40b56f5f9adddb3831906e Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 23 Sep 2018 12:30:08 +0200 Subject: added reordering of nodes and edges --- src/data/graph.cpp | 10 ++++++++++ src/data/graph.h | 3 +++ src/gui/mainmenu.cpp | 12 ++++++++++++ src/gui/mainmenu.h | 2 ++ src/gui/tikzscene.cpp | 29 +++++++++++++++++++++++++++++ src/gui/tikzscene.h | 11 +++++++---- src/gui/undocommands.cpp | 28 ++++++++++++++++++++++++++++ src/gui/undocommands.h | 18 ++++++++++++++++++ 8 files changed, 109 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/data/graph.cpp b/src/data/graph.cpp index 2c9a84e..b63289b 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -85,6 +85,16 @@ int Graph::maxIntName() return max; } +void Graph::reorderNodes(const QVector &newOrder) +{ + _nodes = newOrder; +} + +void Graph::reorderEdges(const QVector &newOrder) +{ + _edges = newOrder; +} + QRectF Graph::realBbox() { //float maxX = 0.0f; diff --git a/src/data/graph.h b/src/data/graph.h index 404fd8c..286ccdc 100644 --- a/src/data/graph.h +++ b/src/data/graph.h @@ -32,6 +32,7 @@ #include #include #include +#include class Graph : public QObject { @@ -46,6 +47,8 @@ public: void addEdge(Edge *e, int index); void removeEdge(Edge *e); int maxIntName(); + void reorderNodes(const QVector &newOrder); + void reorderEdges(const QVector &newOrder); QRectF boundsForNodes(QSet ns); QString freshNodeName(); diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index ca837fa..c159981 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -132,6 +132,18 @@ void MainMenu::on_actionRotateCCW_triggered() { tikzit->activeWindow()->tikzScene()->rotateNodes(false); } +void MainMenu::on_actionBring_to_Front_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->reorderSelection(true); +} + +void MainMenu::on_actionSend_to_Back_triggered() +{ + if (tikzit->activeWindow() != 0) + tikzit->activeWindow()->tikzScene()->reorderSelection(false); +} + void MainMenu::on_actionExtendUp_triggered() { if (tikzit->activeWindow() != 0) diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index 7132dde..c4079bf 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -54,6 +54,8 @@ public slots: void on_actionReflectVertical_triggered(); void on_actionRotateCW_triggered(); void on_actionRotateCCW_triggered(); + void on_actionBring_to_Front_triggered(); + void on_actionSend_to_Back_triggered(); void on_actionExtendUp_triggered(); void on_actionExtendDown_triggered(); void on_actionExtendLeft_triggered(); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 39f8b76..b9afe4a 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -179,6 +179,35 @@ void TikzScene::extendSelectionRight() } } +void TikzScene::reorderSelection(bool toFront) +{ + QVector nodeOrd, nodeOrd1; + QVector edgeOrd, edgeOrd1; + QSet selNodes; + QSet selEdges; + getSelection(selNodes, selEdges); + foreach (Node *n, graph()->nodes()) { + if (selNodes.contains(n)) nodeOrd1 << n; + else nodeOrd << n; + } + + foreach (Edge *e, graph()->edges()) { + if (selEdges.contains(e)) edgeOrd1 << e; + else edgeOrd << e; + } + + if (toFront) { + nodeOrd += nodeOrd1; + edgeOrd += edgeOrd1; + } else { + nodeOrd = nodeOrd1 + nodeOrd; + edgeOrd = edgeOrd1 + edgeOrd; + } + + ReorderCommand *cmd = new ReorderCommand(this, graph()->nodes(), nodeOrd, graph()->edges(), edgeOrd); + _tikzDocument->undoStack()->push(cmd); +} + void TikzScene::refreshZIndices() { qreal z = 0.0; diff --git a/src/gui/tikzscene.h b/src/gui/tikzscene.h index b7beca9..2a3e988 100644 --- a/src/gui/tikzscene.h +++ b/src/gui/tikzscene.h @@ -70,16 +70,19 @@ public: void setEnabled(bool enabled); int lineNumberForSelection(); + void extendSelectionUp(); + void extendSelectionDown(); + void extendSelectionLeft(); + void extendSelectionRight(); + + void reorderSelection(bool toFront); + void getSelection(QSet &selNodes, QSet &selEdges); QSet getSelectedNodes(); public slots: void graphReplaced(); - void extendSelectionUp(); - void extendSelectionDown(); - void extendSelectionLeft(); - void extendSelectionRight(); void refreshZIndices(); protected: diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 7b254d1..50b81a4 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -513,3 +513,31 @@ void RotateNodesCommand::redo() _scene->refreshAdjacentEdges(_nodes.toList()); GraphUpdateCommand::redo(); } + +ReorderCommand::ReorderCommand(TikzScene *scene, + const QVector &oldNodeOrder, + const QVector &newNodeOrder, + const QVector &oldEdgeOrder, + const QVector &newEdgeOrder, + QUndoCommand *parent) : + GraphUpdateCommand(scene, parent), + _oldNodeOrder(oldNodeOrder), _newNodeOrder(newNodeOrder), + _oldEdgeOrder(oldEdgeOrder), _newEdgeOrder(newEdgeOrder) +{ +} + +void ReorderCommand::undo() +{ + _scene->graph()->reorderNodes(_oldNodeOrder); + _scene->graph()->reorderEdges(_oldEdgeOrder); + _scene->refreshZIndices(); + GraphUpdateCommand::undo(); +} + +void ReorderCommand::redo() +{ + _scene->graph()->reorderNodes(_newNodeOrder); + _scene->graph()->reorderEdges(_newEdgeOrder); + _scene->refreshZIndices(); + GraphUpdateCommand::redo(); +} diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 688c2ba..1836892 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -219,4 +219,22 @@ private: bool _clockwise; }; +class ReorderCommand : public GraphUpdateCommand +{ +public: + explicit ReorderCommand(TikzScene *scene, + const QVector &oldNodeOrder, + const QVector &newNodeOrder, + const QVector &oldEdgeOrder, + const QVector &newEdgeOrder, + QUndoCommand *parent = 0); + void undo() override; + void redo() override; +private: + QVector _oldNodeOrder; + QVector _newNodeOrder; + QVector _oldEdgeOrder; + QVector _newEdgeOrder; +}; + #endif // UNDOCOMMANDS_H -- cgit v1.2.3 From 6e40278f58e63adcf6459242219f3a8d282fdebc Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 20 Sep 2018 22:16:53 +0200 Subject: made doc resizable --- src/gui/mainwindow.cpp | 1 + src/gui/stylepalette.ui | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 4525aef..f9743a1 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -37,6 +37,7 @@ MainWindow::MainWindow(QWidget *parent) : _stylePalette = new StylePalette(this); addDockWidget(Qt::RightDockWidgetArea, _stylePalette); + resizeDocks({_stylePalette}, {130}, Qt::Horizontal); _tikzScene = new TikzScene(_tikzDocument, _toolPalette, _stylePalette, this); ui->tikzView->setScene(_tikzScene); diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui index 10e7392..681d83e 100644 --- a/src/gui/stylepalette.ui +++ b/src/gui/stylepalette.ui @@ -24,7 +24,7 @@ - 130 + 400 524287 -- cgit v1.2.3 From f448114bc7eaa9b99780c108d5172f649c626a88 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 1 Oct 2018 15:08:42 +0200 Subject: adjusted font sized --- src/data/edge.cpp | 6 +- src/data/node.cpp | 5 ++ src/data/node.h | 2 + src/data/nodestyle.cpp | 11 ++-- src/data/nodestyle.h | 1 + src/data/tikzstyles.cpp | 2 +- src/gui/styleeditor.ui | 168 +++++++++++++++++++++++++++++++++++++++++++++--- src/gui/stylepalette.ui | 11 +++- src/gui/tikzview.cpp | 8 +++ src/gui/tikzview.h | 1 + 10 files changed, 197 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index 8b2a851..b4c7ec1 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -277,8 +277,10 @@ void Edge::updateData() if (_source == _target) _data->setAtom("loop"); if (!isSelfLoop() && !isStraight() && _weight != 0.4f) _data->setProperty("looseness", QString::number(_weight*2.5f, 'f', 2)); - if (_source->style()->isNone()) _sourceAnchor = "center"; - if (_target->style()->isNone()) _targetAnchor = "center"; + if (_source->isBlankNode()) _sourceAnchor = "center"; + else _sourceAnchor = ""; + if (_target->isBlankNode()) _targetAnchor = "center"; + else _targetAnchor = ""; } diff --git a/src/data/node.cpp b/src/data/node.cpp index 44e3c77..a4ee39b 100644 --- a/src/data/node.cpp +++ b/src/data/node.cpp @@ -107,6 +107,11 @@ NodeStyle *Node::style() const return _style; } +bool Node::isBlankNode() +{ + return styleName() == "none"; +} + int Node::tikzLine() const { return _tikzLine; diff --git a/src/data/node.h b/src/data/node.h index 2a6627e..111bf19 100644 --- a/src/data/node.h +++ b/src/data/node.h @@ -53,6 +53,8 @@ public: void attachStyle(); NodeStyle *style() const; + bool isBlankNode(); + int tikzLine() const; void setTikzLine(int tikzLine); diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 20245d9..8bdb763 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -20,9 +20,10 @@ #include "tikzit.h" #include +#include NodeStyle *noneStyle = new NodeStyle(); -NodeStyle *unknownStyle = new NodeStyle("unknown", new GraphElementData({GraphElementProperty("tikzit fill", "red")})); +NodeStyle *unknownStyle = new NodeStyle("unknown", new GraphElementData({GraphElementProperty("tikzit fill", "blue")})); NodeStyle::NodeStyle() : Style() { @@ -72,9 +73,12 @@ QPainterPath NodeStyle::palettePath() const QIcon NodeStyle::icon() const { // draw an icon matching the style - QPixmap px(100,100); + QImage px(100,100,QImage::Format_ARGB32_Premultiplied); px.fill(Qt::transparent); + + QPainter painter(&px); + painter.setRenderHint(QPainter::Antialiasing); QPainterPath pth = path(); pth.translate(50.0f, 50.0f); @@ -98,7 +102,6 @@ QIcon NodeStyle::icon() const painter.drawPath(pth); } - - return QIcon(px); + return QIcon(QPixmap::fromImage(px)); } diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index 67219db..a3842ff 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -43,5 +43,6 @@ public: }; extern NodeStyle *noneStyle; +extern NodeStyle *unknownStyle; #endif // NODESTYLE_H diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp index 68b3dcd..a827db5 100644 --- a/src/data/tikzstyles.cpp +++ b/src/data/tikzstyles.cpp @@ -33,7 +33,7 @@ NodeStyle *TikzStyles::nodeStyle(QString name) const { foreach (NodeStyle *s , _nodeStyles) if (s->name() == name) return s; - return noneStyle; + return unknownStyle; } EdgeStyle *TikzStyles::edgeStyle(QString name) const diff --git a/src/gui/styleeditor.ui b/src/gui/styleeditor.ui index 697a084..f2c2437 100644 --- a/src/gui/styleeditor.ui +++ b/src/gui/styleeditor.ui @@ -33,6 +33,11 @@ 20 + + + 9 + + Name @@ -52,6 +57,11 @@ 20 + + + 9 + + Category @@ -71,6 +81,11 @@ 20 + + + 9 + + Fill Color @@ -90,6 +105,11 @@ 20 + + + 9 + + Draw Color @@ -109,6 +129,11 @@ 20 + + + 9 + + @@ -119,6 +144,11 @@ 22 + + + 9 + + true @@ -172,12 +202,13 @@ 390 110 - 61 + 71 17 + 9 false @@ -190,12 +221,13 @@ 390 140 - 61 + 71 17 + 9 false @@ -206,7 +238,7 @@ - 450 + 460 110 31 18 @@ -225,7 +257,7 @@ - 450 + 460 140 31 18 @@ -250,6 +282,11 @@ 20 + + + 9 + + Shape @@ -269,6 +306,11 @@ 22 + + + 9 + + true @@ -293,12 +335,13 @@ 290 200 - 61 + 71 17 + 9 false @@ -309,12 +352,17 @@ - 350 + 370 200 - 131 + 111 22 + + + 9 + + @@ -340,6 +388,11 @@ 20 + + + 9 + + Arrowhead @@ -359,6 +412,11 @@ 22 + + + 9 + + false @@ -405,6 +463,11 @@ 22 + + + 9 + + false @@ -433,6 +496,11 @@ 20 + + + 9 + + Properties @@ -452,6 +520,11 @@ 18 + + + 9 + + + @@ -465,6 +538,11 @@ 18 + + + 9 + + +a @@ -478,6 +556,11 @@ 18 + + + 9 + + - @@ -491,6 +574,11 @@ 18 + + + 9 + + ^ @@ -504,6 +592,11 @@ 18 + + + 9 + + v @@ -517,6 +610,12 @@ 251 + + + 8 + true + + @@ -527,6 +626,12 @@ 151 + + + 8 + true + + @@ -537,6 +642,11 @@ 18 + + + 9 + + + @@ -550,6 +660,11 @@ 18 + + + 9 + + - @@ -563,6 +678,11 @@ 18 + + + 9 + + ^ @@ -576,6 +696,11 @@ 18 + + + 9 + + v @@ -589,6 +714,11 @@ 18 + + + 9 + + - @@ -602,6 +732,11 @@ 18 + + + 9 + + + @@ -615,6 +750,11 @@ 18 + + + 9 + + ^ @@ -628,6 +768,11 @@ 18 + + + 9 + + v @@ -635,12 +780,17 @@ - 489 + 479 490 - 81 + 91 20 + + + 9 + + Save and Close diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui index 681d83e..abba648 100644 --- a/src/gui/stylepalette.ui +++ b/src/gui/stylepalette.ui @@ -19,7 +19,7 @@ 130 - 218 + 268 @@ -134,7 +134,14 @@ - + + + + 8 + true + + + diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 6cdb17c..0f1dc30 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -126,3 +126,11 @@ void TikzView::drawBackground(QPainter *painter, const QRectF &rect) painter->drawLine(0, rect.top(), 0, rect.bottom()); } +void TikzView::wheelEvent(QWheelEvent *event) +{ + if (event->modifiers() & Qt::ShiftModifier) { + event->setModifiers(Qt::NoModifier); + QGraphicsView::wheelEvent(event); + } +} + diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h index 4ec9f3d..e13fe72 100644 --- a/src/gui/tikzview.h +++ b/src/gui/tikzview.h @@ -45,6 +45,7 @@ public slots: void setScene(QGraphicsScene *scene); protected: void drawBackground(QPainter *painter, const QRectF &rect); + void wheelEvent(QWheelEvent *event) override; private: float _scale; }; -- cgit v1.2.3 From e7a10091b64ddeb1d3e21e3f36abbf412021c815 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 1 Oct 2018 16:19:21 +0200 Subject: fixed many warnings --- src/data/edgestyle.cpp | 6 + src/data/graph.cpp | 2 +- src/data/graphelementdata.cpp | 8 +- src/data/graphelementdata.h | 5 +- src/data/tikzparser.y | 2 +- src/gui/edgeitem.cpp | 4 + src/gui/mainwindow.ui | 4 +- src/gui/stylepalette.cpp | 7 +- src/gui/stylepalette.h | 4 +- src/gui/tikzscene.cpp | 2 +- src/gui/undocommands.cpp | 2 +- src/gui/undocommands.h | 2 - src/main.cpp | 2 +- src/tikzit.cpp | 12 +- src/tikzit.h | 8 +- tikzlexer.h | 1050 ++++++++++++++++++++--------------------- 16 files changed, 559 insertions(+), 561 deletions(-) (limited to 'src') diff --git a/src/data/edgestyle.cpp b/src/data/edgestyle.cpp index 275393e..8f3008f 100644 --- a/src/data/edgestyle.cpp +++ b/src/data/edgestyle.cpp @@ -71,6 +71,8 @@ QPen EdgeStyle::pen() const pat << 1.0 << 1.0; p.setDashPattern(pat); break; + case Solid: + break; } return p; @@ -114,6 +116,8 @@ QIcon EdgeStyle::icon() const case Flat: painter.drawLine(90,40,90,60); break; + case NoTip: + break; } switch (arrowTail()) { @@ -124,6 +128,8 @@ QIcon EdgeStyle::icon() const case Flat: painter.drawLine(10,40,10,60); break; + case NoTip: + break; } diff --git a/src/data/graph.cpp b/src/data/graph.cpp index b63289b..bba2061 100644 --- a/src/data/graph.cpp +++ b/src/data/graph.cpp @@ -341,7 +341,7 @@ void Graph::reflectNodes(QSet nds, bool horizontal) void Graph::rotateNodes(QSet nds, bool clockwise) { - QRectF bds = boundsForNodes(nds); + //QRectF bds = boundsForNodes(nds); // QPointF ctr = bds.center(); // ctr.setX((float)floor(ctr.x() * 4.0f) / 4.0f); // ctr.setY((float)floor(ctr.y() * 4.0f) / 4.0f); diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 66ef16f..25ba08e 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -118,9 +118,9 @@ QVariant GraphElementData::data(const QModelIndex &index, int role) const QString s = (index.column() == 0) ? p.key() : p.value(); return QVariant(s); } - } else { - return QVariant(); } + + return QVariant(); } QVariant GraphElementData::headerData(int section, Qt::Orientation orientation, int role) const @@ -133,12 +133,12 @@ QVariant GraphElementData::headerData(int section, Qt::Orientation orientation, return QVariant(); } -QModelIndex GraphElementData::index(int row, int column, const QModelIndex &parent) const +QModelIndex GraphElementData::index(int row, int column, const QModelIndex &) const { return createIndex(row, column, (void*)0); } -QModelIndex GraphElementData::parent(const QModelIndex &index) const +QModelIndex GraphElementData::parent(const QModelIndex &) const { // there is no nesting, so always return an invalid index return QModelIndex(); diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index e57cf49..acaada7 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -48,9 +48,8 @@ public: QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const override; - QModelIndex parent(const QModelIndex &index) const override; + QModelIndex index(int row, int column, const QModelIndex &) const override; + QModelIndex parent(const QModelIndex &) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &) const override; diff --git a/src/data/tikzparser.y b/src/data/tikzparser.y index 3dfb66f..4473107 100644 --- a/src/data/tikzparser.y +++ b/src/data/tikzparser.y @@ -69,7 +69,7 @@ #define assembler yyget_extra(scanner) /* pass errors off to the assembler */ -void yyerror(YYLTYPE *yylloc, void *scanner, const char *str) { +void yyerror(YYLTYPE *yylloc, void * /*scanner*/, const char *str) { // TODO: implement reportError() //assembler->reportError(str, yylloc); qDebug() << "\nparse error: " << str << " line:" << yylloc->first_line; diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 146b4e0..2f5b15c 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -102,6 +102,8 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } + case EdgeStyle::NoTip: + break; } //QPen outline = QPen(Qt::red); @@ -126,6 +128,8 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } + case EdgeStyle::NoTip: + break; } if (isSelected()) { diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index cae5735..8eff5ee 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -62,8 +62,8 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Courier New'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.SF NS Text'; font-size:13pt;"><br /></p></body></html> - - 20 + + 20.000000000000000 diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 447e7a4..7423f29 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -89,7 +89,8 @@ void StylePalette::changeNodeStyle(int increment) if (row < 0) row += _nodeModel->rowCount(); } - QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); + //QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); + QModelIndex i1 = _nodeModel->index(row,0); ui->styleListView->selectionModel()->select(i1, QItemSelectionModel::ClearAndSelect); ui->styleListView->scrollTo(i1); } @@ -126,12 +127,12 @@ QString StylePalette::activeEdgeStyleName() } } -void StylePalette::nodeStyleDoubleClicked(const QModelIndex &index) +void StylePalette::nodeStyleDoubleClicked(const QModelIndex &) { tikzit->activeWindow()->tikzScene()->applyActiveStyleToNodes(); } -void StylePalette::edgeStyleDoubleClicked(const QModelIndex &index) +void StylePalette::edgeStyleDoubleClicked(const QModelIndex &) { qDebug() << "got double click"; tikzit->activeWindow()->tikzScene()->applyActiveStyleToEdges(); diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index 5943e52..fc4e253 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -41,8 +41,8 @@ public: public slots: - void nodeStyleDoubleClicked(const QModelIndex &index); - void edgeStyleDoubleClicked(const QModelIndex &index); + void nodeStyleDoubleClicked(const QModelIndex &); + void edgeStyleDoubleClicked(const QModelIndex &); void on_buttonOpenTikzstyles_clicked(); void on_buttonEditTikzstyles_clicked(); void on_buttonRefreshTikzstyles_clicked(); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index b9afe4a..b2c5fd7 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -669,7 +669,7 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) if (ok) { QMap oldLabels; oldLabels.insert(ni->node(), ni->node()->label()); - ChangeLabelCommand *cmd = new ChangeLabelCommand(this, graph(), oldLabels, newLabel); + ChangeLabelCommand *cmd = new ChangeLabelCommand(this, oldLabels, newLabel); _tikzDocument->undoStack()->push(cmd); } break; diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 50b81a4..f713582 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -395,7 +395,7 @@ void PasteCommand::redo() GraphUpdateCommand::redo(); } -ChangeLabelCommand::ChangeLabelCommand(TikzScene *scene, Graph *graph, QMap oldLabels, QString newLabel, QUndoCommand *parent) : +ChangeLabelCommand::ChangeLabelCommand(TikzScene *scene, QMap oldLabels, QString newLabel, QUndoCommand *parent) : GraphUpdateCommand(scene, parent), _oldLabels(oldLabels), _newLabel(newLabel) { } diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 1836892..dc60549 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -165,14 +165,12 @@ class ChangeLabelCommand : public GraphUpdateCommand { public: explicit ChangeLabelCommand(TikzScene *scene, - Graph *graph, QMap oldLabels, QString newLabel, QUndoCommand *parent = 0); void undo() override; void redo() override; private: - Graph *_graph; QMap _oldLabels; QString _newLabel; }; diff --git a/src/main.cpp b/src/main.cpp index 97dbe4d..9ad40ae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); tikzit = new Tikzit(); - tikzit->init(&a); + tikzit->init(); if (a.arguments().length() > 1) { tikzit->open(a.arguments()[1]); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index a327f9f..967d76e 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -36,7 +36,7 @@ Tikzit::Tikzit() : _styleFile("[default]"), _activeWindow(0) { } -void Tikzit::init(QApplication *app) +void Tikzit::init() { QSettings settings("tikzit", "tikzit"); @@ -263,16 +263,6 @@ QString Tikzit::styleFile() const return _styleFile; } -void Tikzit::focusChanged(QWidget *old, QWidget *nw) -{ -// foreach (MainWindow *w, _windows) { -// if (w->isActiveWindow()) { -// _stylePalette->raise(); -// break; -// } -// } -} - QString Tikzit::styleFilePath() const { return _styleFilePath; diff --git a/src/tikzit.h b/src/tikzit.h index 35b19de..525696d 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -115,7 +115,7 @@ public: void open(); void open(QString fileName); void quit(); - void init(QApplication *app); + void init(); // convenience functions for named colors QColor colorByIndex(int i); @@ -132,7 +132,7 @@ public: QString styleFilePath() const; public slots: - void focusChanged(QWidget *old, QWidget *nw); + //void focusChanged(QWidget *old, QWidget *nw); private: // void createMenu(); @@ -140,11 +140,11 @@ private: ToolPalette *_toolPalette; PropertyPalette *_propertyPalette; //StylePalette *_stylePalette; - QVector _windows; - MainWindow *_activeWindow; TikzStyles *_styles; QString _styleFile; QString _styleFilePath; + QVector _windows; + MainWindow *_activeWindow; StyleEditor *_styleEditor; QStringList _colNames; QVector _cols; diff --git a/tikzlexer.h b/tikzlexer.h index 9345d23..438947f 100644 --- a/tikzlexer.h +++ b/tikzlexer.h @@ -1,525 +1,525 @@ -#ifndef yyHEADER_H -#define yyHEADER_H 1 -#define yyIN_HEADER 1 - -#line 5 "tikzlexer.h" - -#line 7 "tikzlexer.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yyget_lval -#define yyget_lval_ALREADY_DEFINED -#else -#define yyget_lval yyget_lval -#endif - -#ifdef yyset_lval -#define yyset_lval_ALREADY_DEFINED -#else -#define yyset_lval yyset_lval -#endif - -#ifdef yyget_lloc -#define yyget_lloc_ALREADY_DEFINED -#else -#define yyget_lloc yyget_lloc -#endif - -#ifdef yyset_lloc -#define yyset_lloc_ALREADY_DEFINED -#else -#define yyset_lloc yyset_lloc -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void yyrestart ( FILE *input_file , yyscan_t yyscanner ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); -void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); -void yypop_buffer_state ( yyscan_t yyscanner ); - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); - -void *yyalloc ( yy_size_t , yyscan_t yyscanner ); -void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); -void yyfree ( void * , yyscan_t yyscanner ); - -#define yywrap(yyscanner) (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -#define yytext_ptr yytext_r - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 -#define props 1 -#define xcoord 2 -#define ycoord 3 -#define noderef 4 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#define YY_EXTRA_TYPE TikzAssembler * - -int yylex_init (yyscan_t* scanner); - -int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( yyscan_t yyscanner ); - -int yyget_debug ( yyscan_t yyscanner ); - -void yyset_debug ( int debug_flag , yyscan_t yyscanner ); - -YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); - -FILE *yyget_in ( yyscan_t yyscanner ); - -void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); - -FILE *yyget_out ( yyscan_t yyscanner ); - -void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); - - int yyget_leng ( yyscan_t yyscanner ); - -char *yyget_text ( yyscan_t yyscanner ); - -int yyget_lineno ( yyscan_t yyscanner ); - -void yyset_lineno ( int _line_number , yyscan_t yyscanner ); - -int yyget_column ( yyscan_t yyscanner ); - -void yyset_column ( int _column_no , yyscan_t yyscanner ); - -YYSTYPE * yyget_lval ( yyscan_t yyscanner ); - -void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - - YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); - - void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( yyscan_t yyscanner ); -#else -extern int yywrap ( yyscan_t yyscanner ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * , yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); - -#define YY_DECL int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#ifndef yy_create_buffer_ALREADY_DEFINED -#undef yy_create_buffer -#endif -#ifndef yy_delete_buffer_ALREADY_DEFINED -#undef yy_delete_buffer -#endif -#ifndef yy_scan_buffer_ALREADY_DEFINED -#undef yy_scan_buffer -#endif -#ifndef yy_scan_string_ALREADY_DEFINED -#undef yy_scan_string -#endif -#ifndef yy_scan_bytes_ALREADY_DEFINED -#undef yy_scan_bytes -#endif -#ifndef yy_init_buffer_ALREADY_DEFINED -#undef yy_init_buffer -#endif -#ifndef yy_flush_buffer_ALREADY_DEFINED -#undef yy_flush_buffer -#endif -#ifndef yy_load_buffer_state_ALREADY_DEFINED -#undef yy_load_buffer_state -#endif -#ifndef yy_switch_to_buffer_ALREADY_DEFINED -#undef yy_switch_to_buffer -#endif -#ifndef yypush_buffer_state_ALREADY_DEFINED -#undef yypush_buffer_state -#endif -#ifndef yypop_buffer_state_ALREADY_DEFINED -#undef yypop_buffer_state -#endif -#ifndef yyensure_buffer_stack_ALREADY_DEFINED -#undef yyensure_buffer_stack -#endif -#ifndef yylex_ALREADY_DEFINED -#undef yylex -#endif -#ifndef yyrestart_ALREADY_DEFINED -#undef yyrestart -#endif -#ifndef yylex_init_ALREADY_DEFINED -#undef yylex_init -#endif -#ifndef yylex_init_extra_ALREADY_DEFINED -#undef yylex_init_extra -#endif -#ifndef yylex_destroy_ALREADY_DEFINED -#undef yylex_destroy -#endif -#ifndef yyget_debug_ALREADY_DEFINED -#undef yyget_debug -#endif -#ifndef yyset_debug_ALREADY_DEFINED -#undef yyset_debug -#endif -#ifndef yyget_extra_ALREADY_DEFINED -#undef yyget_extra -#endif -#ifndef yyset_extra_ALREADY_DEFINED -#undef yyset_extra -#endif -#ifndef yyget_in_ALREADY_DEFINED -#undef yyget_in -#endif -#ifndef yyset_in_ALREADY_DEFINED -#undef yyset_in -#endif -#ifndef yyget_out_ALREADY_DEFINED -#undef yyget_out -#endif -#ifndef yyset_out_ALREADY_DEFINED -#undef yyset_out -#endif -#ifndef yyget_leng_ALREADY_DEFINED -#undef yyget_leng -#endif -#ifndef yyget_text_ALREADY_DEFINED -#undef yyget_text -#endif -#ifndef yyget_lineno_ALREADY_DEFINED -#undef yyget_lineno -#endif -#ifndef yyset_lineno_ALREADY_DEFINED -#undef yyset_lineno -#endif -#ifndef yyget_column_ALREADY_DEFINED -#undef yyget_column -#endif -#ifndef yyset_column_ALREADY_DEFINED -#undef yyset_column -#endif -#ifndef yywrap_ALREADY_DEFINED -#undef yywrap -#endif -#ifndef yyget_lval_ALREADY_DEFINED -#undef yyget_lval -#endif -#ifndef yyset_lval_ALREADY_DEFINED -#undef yyset_lval -#endif -#ifndef yyget_lloc_ALREADY_DEFINED -#undef yyget_lloc -#endif -#ifndef yyset_lloc_ALREADY_DEFINED -#undef yyset_lloc -#endif -#ifndef yyalloc_ALREADY_DEFINED -#undef yyalloc -#endif -#ifndef yyrealloc_ALREADY_DEFINED -#undef yyrealloc -#endif -#ifndef yyfree_ALREADY_DEFINED -#undef yyfree -#endif -#ifndef yytext_ALREADY_DEFINED -#undef yytext -#endif -#ifndef yyleng_ALREADY_DEFINED -#undef yyleng -#endif -#ifndef yyin_ALREADY_DEFINED -#undef yyin -#endif -#ifndef yyout_ALREADY_DEFINED -#undef yyout -#endif -#ifndef yy_flex_debug_ALREADY_DEFINED -#undef yy_flex_debug -#endif -#ifndef yylineno_ALREADY_DEFINED -#undef yylineno -#endif -#ifndef yytables_fload_ALREADY_DEFINED -#undef yytables_fload -#endif -#ifndef yytables_destroy_ALREADY_DEFINED -#undef yytables_destroy -#endif -#ifndef yyTABLES_NAME_ALREADY_DEFINED -#undef yyTABLES_NAME -#endif - -#line 193 "src\\data\\tikzlexer.l" - -#line 523 "tikzlexer.h" -#undef yyIN_HEADER -#endif /* yyHEADER_H */ +#ifndef yyHEADER_H +#define yyHEADER_H 1 +#define yyIN_HEADER 1 + +#line 6 "tikzlexer.h" + +#line 8 "tikzlexer.h" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yyget_lval +#define yyget_lval_ALREADY_DEFINED +#else +#define yyget_lval yyget_lval +#endif + +#ifdef yyset_lval +#define yyset_lval_ALREADY_DEFINED +#else +#define yyset_lval yyset_lval +#endif + +#ifdef yyget_lloc +#define yyget_lloc_ALREADY_DEFINED +#else +#define yyget_lloc yyget_lloc +#endif + +#ifdef yyset_lloc +#define yyset_lloc_ALREADY_DEFINED +#else +#define yyset_lloc yyset_lloc +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yywrap(yyscanner) (/*CONSTCOND*/1) +#define YY_SKIP_YYWRAP + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define props 1 +#define xcoord 2 +#define ycoord 3 +#define noderef 4 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#define YY_EXTRA_TYPE TikzAssembler * + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); + +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); + +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 195 "src/data/tikzlexer.l" + +#line 524 "tikzlexer.h" +#undef yyIN_HEADER +#endif /* yyHEADER_H */ -- cgit v1.2.3 From f085393232f29237e7d6bfb1469d77a78e4a511a Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 1 Oct 2018 17:46:11 +0200 Subject: moving properties up and down --- .gitignore | 5 +++++ src/data/graphelementdata.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/data/graphelementdata.h | 5 +++++ src/gui/styleeditor.cpp | 35 ++++++++++++++++++++++++++++++++--- 4 files changed, 78 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/.gitignore b/.gitignore index e86ac94..8485ec0 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,8 @@ src/data/tikzlexer.lexer.cpp src/data/tikzparser.parser.cpp src/data/tikzparser.parser.hpp *.o +moc_*.cpp +moc_*.h +ui_*.h +qrc_*.cpp +tikzit diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index 25ba08e..b478842 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -110,6 +110,42 @@ int GraphElementData::indexOfKey(QString key) return -1; } +bool GraphElementData::removeRows(int row, int /*count*/, const QModelIndex &parent) +{ + if (row >= 0 && row < _properties.length()) { + beginRemoveRows(parent, row, row+1); + _properties.remove(row); + endRemoveRows(); + return true; + } else { + return false; + } +} + +bool GraphElementData::moveRows(const QModelIndex &sourceParent, + int sourceRow, + int /*count*/, + const QModelIndex &destinationParent, + int destinationRow) +{ + if (sourceRow >= 0 && sourceRow < _properties.length() && + destinationRow >= 0 && destinationRow <= _properties.length()) + { + beginMoveRows(sourceParent, sourceRow, sourceRow, destinationParent, destinationRow); + GraphElementProperty p = _properties[sourceRow]; + _properties.remove(sourceRow); + if (sourceRow < destinationRow) { + _properties.insert(destinationRow - 1, p); + } else { + _properties.insert(destinationRow, p); + } + endMoveRows(); + return true; + } else { + return false; + } +} + QVariant GraphElementData::data(const QModelIndex &index, int role) const { if (role == Qt::DisplayRole || role == Qt::EditRole) { diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index acaada7..f48f228 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -43,6 +43,11 @@ public: QString property(QString key); bool atom(QString atom); int indexOfKey(QString key); + bool removeRows(int row, int count, const QModelIndex &parent) override; + bool moveRows(const QModelIndex &sourceParent, + int sourceRow, int, + const QModelIndex &destinationParent, + int destinationRow) override; QVariant data(const QModelIndex &index, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index fbf73a9..f6e3f48 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -447,17 +447,46 @@ void StyleEditor::on_addAtom_clicked() void StyleEditor::on_removeProperty_clicked() { - + Style *s = activeStyle(); + if (s != 0) { + QModelIndexList sel = ui->properties->selectionModel()->selectedRows(); + if (!sel.isEmpty()) { + s->data()->removeRows(sel[0].row(), 1, sel[0].parent()); + _dirty = true; + } + } } void StyleEditor::on_propertyUp_clicked() { - + Style *s = activeStyle(); + if (s != 0) { + QModelIndexList sel = ui->properties->selectionModel()->selectedRows(); + if (!sel.isEmpty()) { + s->data()->moveRows( + sel[0].parent(), + sel[0].row(), 1, + sel[0].parent(), + sel[0].row() - 1); + _dirty = true; + } + } } void StyleEditor::on_propertyDown_clicked() { - + Style *s = activeStyle(); + if (s != 0) { + QModelIndexList sel = ui->properties->selectionModel()->selectedRows(); + if (!sel.isEmpty()) { + s->data()->moveRows( + sel[0].parent(), + sel[0].row(), 1, + sel[0].parent(), + sel[0].row() + 2); + _dirty = true; + } + } } void StyleEditor::on_save_clicked() -- cgit v1.2.3 From 52f2d4b7f3df910db6592ae16b1eec825b70c4d6 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 2 Oct 2018 17:18:56 +0200 Subject: disabled self-loops (for now at least) --- src/gui/tikzscene.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index b2c5fd7..119d0d1 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -556,7 +556,8 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } break; case ToolPalette::EDGE: - if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0) { + // add an edge. Currently, self-loops are not supported (since they aren't drawn properly) + if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0 && _edgeStartNodeItem != _edgeEndNodeItem) { Edge *e = new Edge(_edgeStartNodeItem->node(), _edgeEndNodeItem->node(), _tikzDocument); e->setStyleName(_styles->activeEdgeStyleName()); AddEdgeCommand *cmd = new AddEdgeCommand(this, e); -- cgit v1.2.3 From e61fb864ec68a58abdb9cc9df047b4b75801c5e7 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 2 Oct 2018 17:46:03 +0200 Subject: fixed self-loop support --- src/data/edge.cpp | 21 +++++++++++++++------ src/gui/tikzscene.cpp | 10 ++++++---- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index b4c7ec1..ca63954 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -29,11 +29,20 @@ Edge::Edge(Node *s, Node *t, QObject *parent) : _data = new GraphElementData(); _edgeNode = 0; _dirty = true; - _basicBendMode = true; - _bend = 0; - _inAngle = 0; - _outAngle = 0; - _weight = 0.4f; + + if (s != t) { + _basicBendMode = true; + _bend = 0; + _inAngle = 0; + _outAngle = 0; + _weight = 0.4f; + } else { + _basicBendMode = false; + _bend = 0; + _inAngle = 135; + _outAngle = 45; + _weight = 1.0f; + } _style = noneEdgeStyle; updateControls(); } @@ -227,7 +236,7 @@ void Edge::setAttributesFromData() } } - if (_data->property("looseness") != 0) { + if (!_data->property("looseness").isNull()) { _weight = _data->property("looseness").toFloat(&ok) / 2.5f; if (!ok) _weight = 0.4f; } else { diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 119d0d1..c061221 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -556,8 +556,8 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } break; case ToolPalette::EDGE: - // add an edge. Currently, self-loops are not supported (since they aren't drawn properly) - if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0 && _edgeStartNodeItem != _edgeEndNodeItem) { + // add an edge + if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0) { Edge *e = new Edge(_edgeStartNodeItem->node(), _edgeEndNodeItem->node(), _tikzDocument); e->setStyleName(_styles->activeEdgeStyleName()); AddEdgeCommand *cmd = new AddEdgeCommand(this, e); @@ -659,8 +659,10 @@ void TikzScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) foreach (QGraphicsItem *it, items(mousePos)) { if (EdgeItem *ei = dynamic_cast(it)) { - ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge()); - _tikzDocument->undoStack()->push(cmd); + if (!ei->edge()->isSelfLoop()) { + ChangeEdgeModeCommand *cmd = new ChangeEdgeModeCommand(this, ei->edge()); + _tikzDocument->undoStack()->push(cmd); + } break; } else if (NodeItem *ni = dynamic_cast(it)) { bool ok; -- cgit v1.2.3 From 6359b28b155355e0be67961cc21eccdbd2c61cc2 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 6 Oct 2018 15:49:50 +0200 Subject: unified node and edge syles --- src/data/edgestyle.cpp | 210 +++++++++++++++++++++--------------------- src/data/edgestyle.h | 32 +++---- src/data/nodestyle.cpp | 145 +++++++++++++++-------------- src/data/nodestyle.h | 13 +-- src/data/nodestylelist.cpp | 113 +++++++++++++++++++++++ src/data/nodestylelist.h | 40 ++++++++ src/data/style.cpp | 182 ++++++++++++++++++++++++++++++++++-- src/data/style.h | 39 ++++++-- src/data/tikzstyles.cpp | 34 ++++--- src/data/tikzstyles.h | 6 +- tikzit.pro | 224 +++++++++++++++++++++++---------------------- 11 files changed, 689 insertions(+), 349 deletions(-) create mode 100644 src/data/nodestylelist.cpp create mode 100644 src/data/nodestylelist.h (limited to 'src') diff --git a/src/data/edgestyle.cpp b/src/data/edgestyle.cpp index 8f3008f..7897c6f 100644 --- a/src/data/edgestyle.cpp +++ b/src/data/edgestyle.cpp @@ -21,7 +21,7 @@ #include #include -EdgeStyle *noneEdgeStyle = new EdgeStyle(); +EdgeStyle *noneEdgeStyle = new EdgeStyle("none", new GraphElementData({GraphElementProperty("-")})); EdgeStyle::EdgeStyle() : Style() { @@ -31,107 +31,107 @@ EdgeStyle::EdgeStyle(QString name, GraphElementData *data) : Style(name, data) { } -EdgeStyle::ArrowTipStyle EdgeStyle::arrowHead() const -{ - if (_data == 0) return NoTip; - - if (_data->atom("->") || _data->atom("<->") || _data->atom("|->")) return Pointer; - if (_data->atom("-|") || _data->atom("<-|") || _data->atom("|-|")) return Flat; - return NoTip; -} - -EdgeStyle::ArrowTipStyle EdgeStyle::arrowTail() const -{ - if (_data == 0) return NoTip; - if (_data->atom("<-") || _data->atom("<->") || _data->atom("<-|")) return Pointer; - if (_data->atom("|-") || _data->atom("|->") || _data->atom("|-|")) return Flat; - return NoTip; -} - -EdgeStyle::DrawStyle EdgeStyle::drawStyle() const -{ - if (_data == 0) return Solid; - if (_data->atom("dashed")) return Dashed; - if (_data->atom("dotted")) return Dotted; - return Solid; -} - -QPen EdgeStyle::pen() const -{ - QPen p(strokeColor()); - p.setWidthF((float)strokeThickness() * 2.0f); - - QVector pat; - switch (drawStyle()) { - case Dashed: - pat << 3.0 << 3.0; - p.setDashPattern(pat); - break; - case Dotted: - pat << 1.0 << 1.0; - p.setDashPattern(pat); - break; - case Solid: - break; - } - - return p; -} - -QPainterPath EdgeStyle::path() const -{ - return QPainterPath(); -} - -QPainterPath EdgeStyle::palettePath() const -{ - return QPainterPath(); -} - -QIcon EdgeStyle::icon() const -{ - // draw an icon matching the style - QPixmap px(100,100); - px.fill(Qt::transparent); - QPainter painter(&px); - - if (_data == 0) { - QPen pen(Qt::black); - pen.setWidth(3); - } else { - painter.setPen(pen()); - } - - painter.drawLine(10, 50, 90, 50); - - QPen pn = pen(); - pn.setStyle(Qt::SolidLine); - painter.setPen(pn); - - switch (arrowHead()) { - case Pointer: - painter.drawLine(90,50,80,40); - painter.drawLine(90,50,80,60); - break; - case Flat: - painter.drawLine(90,40,90,60); - break; - case NoTip: - break; - } - - switch (arrowTail()) { - case Pointer: - painter.drawLine(10,50,20,40); - painter.drawLine(10,50,20,60); - break; - case Flat: - painter.drawLine(10,40,10,60); - break; - case NoTip: - break; - } - - - return QIcon(px); -} +//EdgeStyle::ArrowTipStyle EdgeStyle::arrowHead() const +//{ +// if (_data == 0) return NoTip; + +// if (_data->atom("->") || _data->atom("<->") || _data->atom("|->")) return Pointer; +// if (_data->atom("-|") || _data->atom("<-|") || _data->atom("|-|")) return Flat; +// return NoTip; +//} + +//EdgeStyle::ArrowTipStyle EdgeStyle::arrowTail() const +//{ +// if (_data == 0) return NoTip; +// if (_data->atom("<-") || _data->atom("<->") || _data->atom("<-|")) return Pointer; +// if (_data->atom("|-") || _data->atom("|->") || _data->atom("|-|")) return Flat; +// return NoTip; +//} + +//EdgeStyle::DrawStyle EdgeStyle::drawStyle() const +//{ +// if (_data == 0) return Solid; +// if (_data->atom("dashed")) return Dashed; +// if (_data->atom("dotted")) return Dotted; +// return Solid; +//} + +//QPen EdgeStyle::pen() const +//{ +// QPen p(strokeColor()); +// p.setWidthF((float)strokeThickness() * 2.0f); + +// QVector pat; +// switch (drawStyle()) { +// case Dashed: +// pat << 3.0 << 3.0; +// p.setDashPattern(pat); +// break; +// case Dotted: +// pat << 1.0 << 1.0; +// p.setDashPattern(pat); +// break; +// case Solid: +// break; +// } + +// return p; +//} + +//QPainterPath EdgeStyle::path() const +//{ +// return QPainterPath(); +//} + +//QPainterPath EdgeStyle::palettePath() const +//{ +// return QPainterPath(); +//} + +//QIcon EdgeStyle::icon() const +//{ +// // draw an icon matching the style +// QPixmap px(100,100); +// px.fill(Qt::transparent); +// QPainter painter(&px); + +// if (_data == 0) { +// QPen pen(Qt::black); +// pen.setWidth(3); +// } else { +// painter.setPen(pen()); +// } + +// painter.drawLine(10, 50, 90, 50); + +// QPen pn = pen(); +// pn.setStyle(Qt::SolidLine); +// painter.setPen(pn); + +// switch (arrowHead()) { +// case Pointer: +// painter.drawLine(90,50,80,40); +// painter.drawLine(90,50,80,60); +// break; +// case Flat: +// painter.drawLine(90,40,90,60); +// break; +// case NoTip: +// break; +// } + +// switch (arrowTail()) { +// case Pointer: +// painter.drawLine(10,50,20,40); +// painter.drawLine(10,50,20,60); +// break; +// case Flat: +// painter.drawLine(10,40,10,60); +// break; +// case NoTip: +// break; +// } + + +// return QIcon(px); +//} diff --git a/src/data/edgestyle.h b/src/data/edgestyle.h index eac060a..0e7b554 100644 --- a/src/data/edgestyle.h +++ b/src/data/edgestyle.h @@ -33,22 +33,22 @@ public: EdgeStyle(); EdgeStyle(QString name, GraphElementData *data); - enum ArrowTipStyle { - Flat, Pointer, NoTip - }; - - enum DrawStyle { - Solid, Dotted, Dashed - }; - - ArrowTipStyle arrowHead() const; - ArrowTipStyle arrowTail() const; - DrawStyle drawStyle() const; - - QPen pen() const override; - QPainterPath path() const override; - QPainterPath palettePath() const override; - QIcon icon() const override; +// enum ArrowTipStyle { +// Flat, Pointer, NoTip +// }; + +// enum DrawStyle { +// Solid, Dotted, Dashed +// }; + +// ArrowTipStyle arrowHead() const; +// ArrowTipStyle arrowTail() const; +// DrawStyle drawStyle() const; + +// QPen pen() const override; +// QPainterPath path() const override; +// QPainterPath palettePath() const override; +// QIcon icon() const override; }; extern EdgeStyle *noneEdgeStyle; diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 8bdb763..b379565 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -34,74 +34,79 @@ NodeStyle::NodeStyle(QString name, GraphElementData *data): Style(name, data) { } -QColor NodeStyle::fillColor(bool tikzitOverride) const -{ - if (_data == 0) return Qt::white; - - QString col = propertyWithDefault("fill", "white", tikzitOverride); - return tikzit->colorByName(col); -} - -QBrush NodeStyle::brush() const -{ - return QBrush(fillColor()); -} - -QString NodeStyle::shape(bool tikzitOverride) const -{ - return propertyWithDefault("shape", "circle", tikzitOverride); -} - -QPainterPath NodeStyle::path() const -{ - QPainterPath pth; - QString sh = shape(); - - if (sh == "rectangle") { - pth.addRect(-30.0f, -30.0f, 60.0f, 60.0f); - } else { // default is 'circle' - pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f); - } - return pth; -} - -QPainterPath NodeStyle::palettePath() const -{ - return path(); -} - -QIcon NodeStyle::icon() const -{ - // draw an icon matching the style - QImage px(100,100,QImage::Format_ARGB32_Premultiplied); - px.fill(Qt::transparent); - - - QPainter painter(&px); - painter.setRenderHint(QPainter::Antialiasing); - QPainterPath pth = path(); - pth.translate(50.0f, 50.0f); - - if (_data == 0) { - QColor c(180,180,200); - painter.setPen(QPen(c)); - painter.setBrush(QBrush(c)); - painter.drawEllipse(QPointF(50.0f,50.0f), 3,3); - - QPen pen(QColor(180,180,220)); - pen.setWidth(3); - QVector p; - p << 2.0 << 2.0; - pen.setDashPattern(p); - painter.setPen(pen); - painter.setBrush(Qt::NoBrush); - painter.drawPath(pth); - } else { - painter.setPen(pen()); - painter.setBrush(brush()); - painter.drawPath(pth); - } - - return QIcon(QPixmap::fromImage(px)); -} +//QColor NodeStyle::fillColor(bool tikzitOverride) const +//{ +// if (_data == 0) return Qt::white; + +// QString col = propertyWithDefault("fill", "white", tikzitOverride); +// return tikzit->colorByName(col); +//} + +//QBrush NodeStyle::brush() const +//{ +// return QBrush(fillColor()); +//} + +//QString NodeStyle::shape(bool tikzitOverride) const +//{ +// return propertyWithDefault("shape", "circle", tikzitOverride); +//} + +//QPainterPath NodeStyle::path() const +//{ +// QPainterPath pth; +// QString sh = shape(); + +// if (sh == "rectangle") { +// pth.addRect(-30.0f, -30.0f, 60.0f, 60.0f); +// } else { // default is 'circle' +// pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f); +// } +// return pth; +//} + +//QPainterPath NodeStyle::palettePath() const +//{ +// return path(); +//} + +//QIcon NodeStyle::icon() const +//{ +// // draw an icon matching the style +// QImage px(100,100,QImage::Format_ARGB32_Premultiplied); +// px.fill(Qt::transparent); + + +// QPainter painter(&px); +// painter.setRenderHint(QPainter::Antialiasing); +// QPainterPath pth = path(); +// pth.translate(50.0f, 50.0f); + +// if (_data == 0) { +// QColor c(180,180,200); +// painter.setPen(QPen(c)); +// painter.setBrush(QBrush(c)); +// painter.drawEllipse(QPointF(50.0f,50.0f), 3,3); + +// QPen pen(QColor(180,180,220)); +// pen.setWidth(3); +// QVector p; +// p << 2.0 << 2.0; +// pen.setDashPattern(p); +// painter.setPen(pen); +// painter.setBrush(Qt::NoBrush); +// painter.drawPath(pth); +// } else { +// painter.setPen(pen()); +// painter.setBrush(brush()); +// painter.drawPath(pth); +// } + +// return QIcon(QPixmap::fromImage(px)); +//} + +//QString NodeStyle::category() +//{ +// return propertyWithDefault("tikzit category", "", false); +//} diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h index a3842ff..36bd5d5 100644 --- a/src/data/nodestyle.h +++ b/src/data/nodestyle.h @@ -33,13 +33,14 @@ public: NodeStyle(); NodeStyle(QString name, GraphElementData *data); - QColor fillColor(bool tikzitOverride=true) const; - QBrush brush() const; - QPainterPath path() const override; - QString shape(bool tikzitOverride=true) const; +// QColor fillColor(bool tikzitOverride=true) const; +// QBrush brush() const; +// QPainterPath path() const override; +// QString shape(bool tikzitOverride=true) const; + +// QPainterPath palettePath() const override; +// QIcon icon() const override; - QPainterPath palettePath() const override; - QIcon icon() const override; }; extern NodeStyle *noneStyle; diff --git a/src/data/nodestylelist.cpp b/src/data/nodestylelist.cpp new file mode 100644 index 0000000..41749db --- /dev/null +++ b/src/data/nodestylelist.cpp @@ -0,0 +1,113 @@ +#include "nodestylelist.h" + +#include + +NodeStyleList::NodeStyleList(QObject *parent) : QAbstractListModel(parent) +{ +} + +NodeStyle *NodeStyleList::style(QString name) +{ + foreach (NodeStyle *s, _styles) + if (s->name() == name) return s; + return nullptr; +} + +NodeStyle *NodeStyleList::style(int i) +{ + return _styles[i]; +} + +int NodeStyleList::length() const +{ + return _styles.length(); +} + +void NodeStyleList::addStyle(NodeStyle *s) +{ + if (s->category() == _category) { + int n = numInCategory(); + beginInsertRows(QModelIndex(), n, n); + _styles << s; + endInsertRows(); + } else { + _styles << s; + } +} + +void NodeStyleList::clear() +{ + int n = numInCategory(); + if (n > 0) { + beginRemoveRows(QModelIndex(), 0, n - 1); + _styles.clear(); + endRemoveRows(); + } else { + _styles.clear(); + } + + _category = ""; +} + +QString NodeStyleList::tikz() +{ + QString str; + QTextStream code(&str); + foreach (NodeStyle *s, _styles) code << s->tikz() << "\n"; + code.flush(); + return str; +} + +int NodeStyleList::numInCategory() const +{ + int c = 0; + foreach (NodeStyle *s, _styles) { + if (_category == "" || s->category() == _category) { + ++c; + } + } + return c; +} + +int NodeStyleList::nthInCategory(int n) const +{ + int c = 0; + for (int j = 0; j < _styles.length(); ++j) { + if (_category == "" || _styles[j]->category() == _category) { + if (c == n) return j; + else ++c; + } + } + return -1; +} + +NodeStyle *NodeStyleList::styleInCategory(int n) const +{ + return _styles[nthInCategory(n)]; +} + +QVariant NodeStyleList::data(const QModelIndex &index, int role) const +{ + if (role == Qt::DisplayRole) { + return QVariant(styleInCategory(index.row())->name()); + } else if (role == Qt::DecorationRole) { + return QVariant(styleInCategory(index.row())->icon()); + } else { + return QVariant(); + } +} + +int NodeStyleList::rowCount(const QModelIndex &/*parent*/) const +{ + return numInCategory(); +} + +QString NodeStyleList::category() const +{ + return _category; +} + +void NodeStyleList::setCategory(const QString &category) +{ + _category = category; +} diff --git a/src/data/nodestylelist.h b/src/data/nodestylelist.h new file mode 100644 index 0000000..03f7ed5 --- /dev/null +++ b/src/data/nodestylelist.h @@ -0,0 +1,40 @@ +#ifndef NODESTYLELIST_H +#define NODESTYLELIST_H + +#include "nodestyle.h" + +#include + +class NodeStyleList : public QAbstractListModel +{ + Q_OBJECT +public: + explicit NodeStyleList(QObject *parent = nullptr); + NodeStyle *style(QString name); + NodeStyle *style(int i); + int length() const; + void addStyle(NodeStyle *s); + void clear(); + QString tikz(); + + int numInCategory() const; + int nthInCategory(int n) const; + NodeStyle *styleInCategory(int n) const; + + QVariant data(const QModelIndex &index, int role) const override; + int rowCount(const QModelIndex &/*parent*/) const override; + + + QString category() const; + void setCategory(const QString &category); + +signals: + +public slots: + +private: + QVector _styles; + QString _category; +}; + +#endif // NODESTYLELIST_H diff --git a/src/data/style.cpp b/src/data/style.cpp index 63747ec..39314cb 100644 --- a/src/data/style.cpp +++ b/src/data/style.cpp @@ -19,17 +19,19 @@ #include "style.h" #include "tikzit.h" -Style::Style() : _name("none"), _data(0) +Style::Style() : _name("none") { + _data = new GraphElementData(this); } Style::Style(QString name, GraphElementData *data) : _name(name), _data(data) { + _data->setParent(this); } -bool Style::isNone() +bool Style::isNone() const { - return _data == 0; + return _name == "none"; } GraphElementData *Style::data() const @@ -44,25 +46,43 @@ QString Style::name() const QColor Style::strokeColor(bool tikzitOverride) const { - if (_data == 0) return QColor(Qt::black); - QString col = propertyWithDefault("draw", "black", tikzitOverride); return tikzit->colorByName(col); } +QColor Style::fillColor(bool tikzitOverride) const +{ + QString col = propertyWithDefault("fill", "white", tikzitOverride); + return tikzit->colorByName(col); +} + +QBrush Style::brush() const +{ + return QBrush(fillColor()); +} + +QString Style::shape(bool tikzitOverride) const +{ + return propertyWithDefault("shape", "circle", tikzitOverride); +} + + // TODO int Style::strokeThickness() const { return 1; } -QPen Style::pen() const +bool Style::isEdgeStyle() const { - QPen p(strokeColor()); - p.setWidthF((float)strokeThickness() * 3.0f); - return p; + if (_data->atom("-") || _data->atom("->") || _data->atom("-|") || + _data->atom("<-") || _data->atom("<->") || _data->atom("<-|") || + _data->atom("|-") || _data->atom("|->") || _data->atom("|-|")) return true; + else return false; } + + QString Style::propertyWithDefault(QString prop, QString def, bool tikzitOverride) const { if (_data == 0) return def; @@ -86,3 +106,147 @@ void Style::setName(const QString &name) { _name = name; } + +Style::ArrowTipStyle Style::arrowHead() const +{ + if (_data->atom("->") || _data->atom("<->") || _data->atom("|->")) return Pointer; + if (_data->atom("-|") || _data->atom("<-|") || _data->atom("|-|")) return Flat; + return NoTip; +} + +Style::ArrowTipStyle Style::arrowTail() const +{ + if (_data->atom("<-") || _data->atom("<->") || _data->atom("<-|")) return Pointer; + if (_data->atom("|-") || _data->atom("|->") || _data->atom("|-|")) return Flat; + return NoTip; +} + +Style::DrawStyle Style::drawStyle() const +{ + if (_data->atom("dashed")) return Dashed; + if (_data->atom("dotted")) return Dotted; + return Solid; +} + + +QPen Style::pen() const +{ + QPen p(strokeColor()); + p.setWidthF((float)strokeThickness() * 2.0f); + + QVector pat; + switch (drawStyle()) { + case Dashed: + pat << 3.0 << 3.0; + p.setDashPattern(pat); + break; + case Dotted: + pat << 1.0 << 1.0; + p.setDashPattern(pat); + break; + case Solid: + break; + } + + return p; +} + +QPainterPath Style::path() const +{ + QPainterPath pth; + QString sh = shape(); + + if (sh == "rectangle") { + pth.addRect(-30.0f, -30.0f, 60.0f, 60.0f); + } else { // default is 'circle' + pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f); + } + return pth; +} + +QIcon Style::icon() const +{ + if (!isEdgeStyle()) { + // draw an icon matching the style + QImage px(100,100,QImage::Format_ARGB32_Premultiplied); + px.fill(Qt::transparent); + + + QPainter painter(&px); + painter.setRenderHint(QPainter::Antialiasing); + QPainterPath pth = path(); + pth.translate(50.0f, 50.0f); + + if (isNone()) { + QColor c(180,180,200); + painter.setPen(QPen(c)); + painter.setBrush(QBrush(c)); + painter.drawEllipse(QPointF(50.0f,50.0f), 3,3); + + QPen pen(QColor(180,180,220)); + pen.setWidth(3); + QVector p; + p << 2.0 << 2.0; + pen.setDashPattern(p); + painter.setPen(pen); + painter.setBrush(Qt::NoBrush); + painter.drawPath(pth); + } else { + painter.setPen(pen()); + painter.setBrush(brush()); + painter.drawPath(pth); + } + + return QIcon(QPixmap::fromImage(px)); + } else { + // draw an icon matching the style + QPixmap px(100,100); + px.fill(Qt::transparent); + QPainter painter(&px); + + if (_data == 0) { + QPen pen(Qt::black); + pen.setWidth(3); + } else { + painter.setPen(pen()); + } + + painter.drawLine(10, 50, 90, 50); + + QPen pn = pen(); + pn.setStyle(Qt::SolidLine); + painter.setPen(pn); + + switch (arrowHead()) { + case Pointer: + painter.drawLine(90,50,80,40); + painter.drawLine(90,50,80,60); + break; + case Flat: + painter.drawLine(90,40,90,60); + break; + case NoTip: + break; + } + + switch (arrowTail()) { + case Pointer: + painter.drawLine(10,50,20,40); + painter.drawLine(10,50,20,60); + break; + case Flat: + painter.drawLine(10,40,10,60); + break; + case NoTip: + break; + } + + + return QIcon(px); + } +} + +QString Style::category() const +{ + return propertyWithDefault("tikzit category", "", false); +} diff --git a/src/data/style.h b/src/data/style.h index cef7c7b..ca2e604 100644 --- a/src/data/style.h +++ b/src/data/style.h @@ -22,34 +22,53 @@ #include "graphelementdata.h" +#include #include #include #include #include #include -class Style +class Style : public QObject { + Q_OBJECT public: + enum ArrowTipStyle { + Flat, Pointer, NoTip + }; + + enum DrawStyle { + Solid, Dotted, Dashed + }; + Style(); Style(QString name, GraphElementData *data); - bool isNone(); + bool isNone() const; + bool isEdgeStyle() const; - // properties that both edges and nodes have + // for node and edge styles GraphElementData *data() const; QString name() const; QColor strokeColor(bool tikzitOverride=true) const; int strokeThickness() const; - - // methods that are implemented differently for edges and nodes - virtual QPen pen() const; - virtual QPainterPath path() const = 0; - virtual QPainterPath palettePath() const = 0; - virtual QIcon icon() const = 0; + QPen pen() const; + QPainterPath path() const; + QIcon icon() const; void setName(const QString &name); QString propertyWithDefault(QString prop, QString def, bool tikzitOverride=true) const; - QString tikz() const; + + // only relevant for node styles + QColor fillColor(bool tikzitOverride=true) const; + QBrush brush() const; + QString shape(bool tikzitOverride=true) const; + + // only relevant for edge styles + Style::ArrowTipStyle arrowHead() const; + Style::ArrowTipStyle arrowTail() const; + Style::DrawStyle drawStyle() const; + QString category() const; + protected: QString _name; GraphElementData *_data; diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp index a827db5..e3a735c 100644 --- a/src/data/tikzstyles.cpp +++ b/src/data/tikzstyles.cpp @@ -27,13 +27,14 @@ TikzStyles::TikzStyles(QObject *parent) : QObject(parent) { + _nodeStyles = new NodeStyleList(this); } NodeStyle *TikzStyles::nodeStyle(QString name) const { - foreach (NodeStyle *s , _nodeStyles) - if (s->name() == name) return s; - return unknownStyle; + NodeStyle *s = _nodeStyles->style(name); + + return (s == nullptr) ? unknownStyle : s; } EdgeStyle *TikzStyles::edgeStyle(QString name) const @@ -43,14 +44,10 @@ EdgeStyle *TikzStyles::edgeStyle(QString name) const return noneEdgeStyle; } -QVector TikzStyles::nodeStyles() const -{ - return _nodeStyles; -} void TikzStyles::clear() { - _nodeStyles.clear(); + _nodeStyles->clear(); _edgeStyles.clear(); } @@ -102,7 +99,9 @@ void TikzStyles::refreshModels(QStandardItemModel *nodeModel, QStandardItemModel it->setSizeHint(QSize(48,48)); } - foreach(NodeStyle *ns, _nodeStyles) { + NodeStyle *ns; + for (int i = 0; i < _nodeStyles->length(); ++i) { + ns = _nodeStyles->style(i); if (category == "" || category == ns->propertyWithDefault("tikzit category", "", false)) { it = new QStandardItem(ns->icon(), ns->name()); @@ -131,16 +130,15 @@ void TikzStyles::refreshModels(QStandardItemModel *nodeModel, QStandardItemModel } } -QVector TikzStyles::edgeStyles() const -{ - return _edgeStyles; -} - QStringList TikzStyles::categories() const { QMap cats; // use a QMap to keep keys sorted cats.insert("", true); - foreach (NodeStyle *s, _nodeStyles) cats.insert(s->propertyWithDefault("tikzit category", "", false), true); + NodeStyle *ns; + for (int i = 0; i < _nodeStyles->length(); ++i) { + ns = _nodeStyles->style(i); + cats.insert(ns->propertyWithDefault("tikzit category", "", false), true); + } //foreach (EdgeStyle *s, _edgeStyles) cats << s->propertyWithDefault("tikzit category", "", false); return QStringList(cats.keys()); } @@ -156,10 +154,10 @@ QString TikzStyles::tikz() const code << "% \\tikzstyle{NAME}=[PROPERTY LIST]\n\n"; code << "% Node styles\n"; - foreach (NodeStyle *s, nodeStyles()) code << s->tikz() << "\n"; + code << _nodeStyles->tikz(); code << "\n% Edge styles\n"; - foreach (EdgeStyle *s, edgeStyles()) code << s->tikz() << "\n"; + foreach (EdgeStyle *s, _edgeStyles) code << s->tikz() << "\n"; code.flush(); return str; @@ -173,7 +171,7 @@ void TikzStyles::addStyle(QString name, GraphElementData *data) { // edge style _edgeStyles << new EdgeStyle(name, data); } else { // node style - _nodeStyles << new NodeStyle(name, data); + _nodeStyles->addStyle(new NodeStyle(name, data)); } } diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h index 558901e..68bd9ce 100644 --- a/src/data/tikzstyles.h +++ b/src/data/tikzstyles.h @@ -20,7 +20,7 @@ #define PROJECT_H #include "graphelementdata.h" -#include "nodestyle.h" +#include "nodestylelist.h" #include "edgestyle.h" #include @@ -37,8 +37,6 @@ public: NodeStyle *nodeStyle(QString name) const; EdgeStyle *edgeStyle(QString name) const; - QVector nodeStyles() const; - QVector edgeStyles() const; QStringList categories() const; QString tikz() const; void clear(); @@ -55,7 +53,7 @@ signals: public slots: private: - QVector _nodeStyles; + NodeStyleList *_nodeStyles; QVector _edgeStyles; QStringList _colNames; QVector _cols; diff --git a/tikzit.pro b/tikzit.pro index 0cb4c9c..79cb6c6 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -1,111 +1,113 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2017-01-11T17:30:16 -# -#------------------------------------------------- - -QT += core gui widgets -CONFIG += testcase - -TARGET = tikzit -TEMPLATE = app - -win32:RC_ICONS += images/tikzit.ico -win32:RC_ICONS += images/tikzdoc.ico - -# The following define makes your compiler emit warnings if you use -# any feature of Qt which as been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -FLEXSOURCES = src/data/tikzlexer.l -BISONSOURCES = src/data/tikzparser.y - -include(flex.pri) -include(bison.pri) - -SOURCES += src/gui/mainwindow.cpp \ - src/gui/toolpalette.cpp \ - src/gui/tikzscene.cpp \ - src/data/graph.cpp \ - src/data/node.cpp \ - src/data/edge.cpp \ - src/data/graphelementdata.cpp \ - src/data/graphelementproperty.cpp \ - src/gui/propertypalette.cpp \ - src/gui/tikzview.cpp \ - src/gui/nodeitem.cpp \ - src/gui/edgeitem.cpp \ - src/tikzit.cpp \ - src/data/nodestyle.cpp \ - src/gui/commands.cpp \ - src/data/tikzdocument.cpp \ - src/gui/undocommands.cpp \ - src/gui/mainmenu.cpp \ - src/util.cpp \ - src/gui/stylepalette.cpp \ - src/data/tikzassembler.cpp \ - src/data/tikzstyles.cpp \ - src/data/edgestyle.cpp \ - src/data/style.cpp \ - src/gui/styleeditor.cpp - -HEADERS += src/gui/mainwindow.h \ - src/gui/toolpalette.h \ - src/gui/tikzscene.h \ - src/data/graph.h \ - src/data/node.h \ - src/data/edge.h \ - src/data/graphelementdata.h \ - src/data/graphelementproperty.h \ - src/gui/propertypalette.h \ - src/data/tikzparserdefs.h \ - src/gui/tikzview.h \ - src/gui/nodeitem.h \ - src/tikzit.h \ - src/gui/edgeitem.h \ - src/data/nodestyle.h \ - src/gui/commands.h \ - src/data/tikzdocument.h \ - src/gui/undocommands.h \ - src/gui/mainmenu.h \ - src/util.h \ - src/gui/stylepalette.h \ - src/data/tikzassembler.h \ - src/data/tikzstyles.h \ - src/data/edgestyle.h \ - src/data/style.h \ - src/gui/styleeditor.h - -FORMS += src/gui/mainwindow.ui \ - src/gui/propertypalette.ui \ - src/gui/mainmenu.ui \ - src/gui/stylepalette.ui \ - src/gui/styleeditor.ui - -INCLUDEPATH += src src/gui src/data - -DISTFILES += - -RESOURCES += tikzit.qrc - -test { - QT += testlib - TARGET = UnitTests - SOURCES -= src/main.cpp - HEADERS += src/test/testtest.h \ - src/test/testparser.h \ - src/test/testtikzoutput.h - SOURCES += src/test/testmain.cpp \ - src/test/testtest.cpp \ - src/test/testparser.cpp \ - src/test/testtikzoutput.cpp -} else { - SOURCES += src/main.cpp -} +#------------------------------------------------- +# +# Project created by QtCreator 2017-01-11T17:30:16 +# +#------------------------------------------------- + +QT += core gui widgets +CONFIG += testcase + +TARGET = tikzit +TEMPLATE = app + +win32:RC_ICONS += images/tikzit.ico +win32:RC_ICONS += images/tikzdoc.ico + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which as been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +FLEXSOURCES = src/data/tikzlexer.l +BISONSOURCES = src/data/tikzparser.y + +include(flex.pri) +include(bison.pri) + +SOURCES += src/gui/mainwindow.cpp \ + src/gui/toolpalette.cpp \ + src/gui/tikzscene.cpp \ + src/data/graph.cpp \ + src/data/node.cpp \ + src/data/edge.cpp \ + src/data/graphelementdata.cpp \ + src/data/graphelementproperty.cpp \ + src/gui/propertypalette.cpp \ + src/gui/tikzview.cpp \ + src/gui/nodeitem.cpp \ + src/gui/edgeitem.cpp \ + src/tikzit.cpp \ + src/data/nodestyle.cpp \ + src/gui/commands.cpp \ + src/data/tikzdocument.cpp \ + src/gui/undocommands.cpp \ + src/gui/mainmenu.cpp \ + src/util.cpp \ + src/gui/stylepalette.cpp \ + src/data/tikzassembler.cpp \ + src/data/tikzstyles.cpp \ + src/data/edgestyle.cpp \ + src/data/style.cpp \ + src/gui/styleeditor.cpp \ + src/data/nodestylelist.cpp + +HEADERS += src/gui/mainwindow.h \ + src/gui/toolpalette.h \ + src/gui/tikzscene.h \ + src/data/graph.h \ + src/data/node.h \ + src/data/edge.h \ + src/data/graphelementdata.h \ + src/data/graphelementproperty.h \ + src/gui/propertypalette.h \ + src/data/tikzparserdefs.h \ + src/gui/tikzview.h \ + src/gui/nodeitem.h \ + src/tikzit.h \ + src/gui/edgeitem.h \ + src/data/nodestyle.h \ + src/gui/commands.h \ + src/data/tikzdocument.h \ + src/gui/undocommands.h \ + src/gui/mainmenu.h \ + src/util.h \ + src/gui/stylepalette.h \ + src/data/tikzassembler.h \ + src/data/tikzstyles.h \ + src/data/edgestyle.h \ + src/data/style.h \ + src/gui/styleeditor.h \ + src/data/nodestylelist.h + +FORMS += src/gui/mainwindow.ui \ + src/gui/propertypalette.ui \ + src/gui/mainmenu.ui \ + src/gui/stylepalette.ui \ + src/gui/styleeditor.ui + +INCLUDEPATH += src src/gui src/data + +DISTFILES += + +RESOURCES += tikzit.qrc + +test { + QT += testlib + TARGET = UnitTests + SOURCES -= src/main.cpp + HEADERS += src/test/testtest.h \ + src/test/testparser.h \ + src/test/testtikzoutput.h + SOURCES += src/test/testmain.cpp \ + src/test/testtest.cpp \ + src/test/testparser.cpp \ + src/test/testtikzoutput.cpp +} else { + SOURCES += src/main.cpp +} -- cgit v1.2.3 From c0b8dea3d3b93fd4b87e5311b6c6422a7ccdb723 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 6 Oct 2018 16:06:06 +0200 Subject: removed EdgeStyle and NodeStyle classes --- src/data/edge.cpp | 2 +- src/data/edge.h | 6 +- src/data/edgestyle.cpp | 137 --------------------------------------------- src/data/edgestyle.h | 56 ------------------ src/data/node.cpp | 2 +- src/data/node.h | 6 +- src/data/nodestyle.cpp | 112 ------------------------------------ src/data/nodestyle.h | 49 ---------------- src/data/nodestylelist.cpp | 15 ++--- src/data/nodestylelist.h | 12 ++-- src/data/style.cpp | 4 ++ src/data/style.h | 5 ++ src/data/tikzstyles.cpp | 26 ++++----- src/data/tikzstyles.h | 8 +-- src/gui/edgeitem.cpp | 12 ++-- src/gui/styleeditor.cpp | 12 ++-- src/gui/styleeditor.h | 7 +-- src/tikzit.h | 1 - tikzit.pro | 4 -- 19 files changed, 62 insertions(+), 414 deletions(-) delete mode 100644 src/data/edgestyle.cpp delete mode 100644 src/data/edgestyle.h delete mode 100644 src/data/nodestyle.cpp delete mode 100644 src/data/nodestyle.h (limited to 'src') diff --git a/src/data/edge.cpp b/src/data/edge.cpp index ca63954..0ae566b 100644 --- a/src/data/edge.cpp +++ b/src/data/edge.cpp @@ -401,7 +401,7 @@ void Edge::attachStyle() else _style = tikzit->styles()->edgeStyle(nm); } -EdgeStyle * Edge::style() const +Style *Edge::style() const { return _style; } diff --git a/src/data/edge.h b/src/data/edge.h index 85959bb..ad71364 100644 --- a/src/data/edge.h +++ b/src/data/edge.h @@ -21,7 +21,7 @@ #include "graphelementdata.h" #include "node.h" -#include "edgestyle.h" +#include "style.h" #include #include @@ -85,7 +85,7 @@ public: void attachStyle(); QString styleName() const; void setStyleName(const QString & styleName); - EdgeStyle *style() const; + Style *style() const; signals: @@ -105,7 +105,7 @@ private: Node *_target; - EdgeStyle *_style; + Style *_style; bool _dirty; bool _basicBendMode; diff --git a/src/data/edgestyle.cpp b/src/data/edgestyle.cpp deleted file mode 100644 index 7897c6f..0000000 --- a/src/data/edgestyle.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - TikZiT - a GUI diagram editor for TikZ - Copyright (C) 2018 Aleks Kissinger - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "edgestyle.h" - -#include -#include - -EdgeStyle *noneEdgeStyle = new EdgeStyle("none", new GraphElementData({GraphElementProperty("-")})); - -EdgeStyle::EdgeStyle() : Style() -{ -} - -EdgeStyle::EdgeStyle(QString name, GraphElementData *data) : Style(name, data) -{ -} - -//EdgeStyle::ArrowTipStyle EdgeStyle::arrowHead() const -//{ -// if (_data == 0) return NoTip; - -// if (_data->atom("->") || _data->atom("<->") || _data->atom("|->")) return Pointer; -// if (_data->atom("-|") || _data->atom("<-|") || _data->atom("|-|")) return Flat; -// return NoTip; -//} - -//EdgeStyle::ArrowTipStyle EdgeStyle::arrowTail() const -//{ -// if (_data == 0) return NoTip; -// if (_data->atom("<-") || _data->atom("<->") || _data->atom("<-|")) return Pointer; -// if (_data->atom("|-") || _data->atom("|->") || _data->atom("|-|")) return Flat; -// return NoTip; -//} - -//EdgeStyle::DrawStyle EdgeStyle::drawStyle() const -//{ -// if (_data == 0) return Solid; -// if (_data->atom("dashed")) return Dashed; -// if (_data->atom("dotted")) return Dotted; -// return Solid; -//} - -//QPen EdgeStyle::pen() const -//{ -// QPen p(strokeColor()); -// p.setWidthF((float)strokeThickness() * 2.0f); - -// QVector pat; -// switch (drawStyle()) { -// case Dashed: -// pat << 3.0 << 3.0; -// p.setDashPattern(pat); -// break; -// case Dotted: -// pat << 1.0 << 1.0; -// p.setDashPattern(pat); -// break; -// case Solid: -// break; -// } - -// return p; -//} - -//QPainterPath EdgeStyle::path() const -//{ -// return QPainterPath(); -//} - -//QPainterPath EdgeStyle::palettePath() const -//{ -// return QPainterPath(); -//} - -//QIcon EdgeStyle::icon() const -//{ -// // draw an icon matching the style -// QPixmap px(100,100); -// px.fill(Qt::transparent); -// QPainter painter(&px); - -// if (_data == 0) { -// QPen pen(Qt::black); -// pen.setWidth(3); -// } else { -// painter.setPen(pen()); -// } - -// painter.drawLine(10, 50, 90, 50); - -// QPen pn = pen(); -// pn.setStyle(Qt::SolidLine); -// painter.setPen(pn); - -// switch (arrowHead()) { -// case Pointer: -// painter.drawLine(90,50,80,40); -// painter.drawLine(90,50,80,60); -// break; -// case Flat: -// painter.drawLine(90,40,90,60); -// break; -// case NoTip: -// break; -// } - -// switch (arrowTail()) { -// case Pointer: -// painter.drawLine(10,50,20,40); -// painter.drawLine(10,50,20,60); -// break; -// case Flat: -// painter.drawLine(10,40,10,60); -// break; -// case NoTip: -// break; -// } - - -// return QIcon(px); -//} diff --git a/src/data/edgestyle.h b/src/data/edgestyle.h deleted file mode 100644 index 0e7b554..0000000 --- a/src/data/edgestyle.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - TikZiT - a GUI diagram editor for TikZ - Copyright (C) 2018 Aleks Kissinger - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef EDGESTYLE_H -#define EDGESTYLE_H - -#include "style.h" - -#include -#include -#include -#include -#include - -class EdgeStyle : public Style -{ -public: - EdgeStyle(); - EdgeStyle(QString name, GraphElementData *data); - -// enum ArrowTipStyle { -// Flat, Pointer, NoTip -// }; - -// enum DrawStyle { -// Solid, Dotted, Dashed -// }; - -// ArrowTipStyle arrowHead() const; -// ArrowTipStyle arrowTail() const; -// DrawStyle drawStyle() const; - -// QPen pen() const override; -// QPainterPath path() const override; -// QPainterPath palettePath() const override; -// QIcon icon() const override; -}; - -extern EdgeStyle *noneEdgeStyle; - -#endif // EDGESTYLE_H diff --git a/src/data/node.cpp b/src/data/node.cpp index a4ee39b..75acd00 100644 --- a/src/data/node.cpp +++ b/src/data/node.cpp @@ -102,7 +102,7 @@ void Node::attachStyle() else _style = tikzit->styles()->nodeStyle(nm); } -NodeStyle *Node::style() const +Style *Node::style() const { return _style; } diff --git a/src/data/node.h b/src/data/node.h index 111bf19..490393d 100644 --- a/src/data/node.h +++ b/src/data/node.h @@ -20,7 +20,7 @@ #define NODE_H #include "graphelementdata.h" -#include "nodestyle.h" +#include "style.h" #include #include @@ -51,7 +51,7 @@ public: void setStyleName(const QString &styleName); void attachStyle(); - NodeStyle *style() const; + Style *style() const; bool isBlankNode(); @@ -66,7 +66,7 @@ private: QPointF _point; QString _name; QString _label; - NodeStyle *_style; + Style *_style; GraphElementData *_data; int _tikzLine; }; diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp deleted file mode 100644 index b379565..0000000 --- a/src/data/nodestyle.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - TikZiT - a GUI diagram editor for TikZ - Copyright (C) 2018 Aleks Kissinger - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "nodestyle.h" -#include "tikzit.h" - -#include -#include - -NodeStyle *noneStyle = new NodeStyle(); -NodeStyle *unknownStyle = new NodeStyle("unknown", new GraphElementData({GraphElementProperty("tikzit fill", "blue")})); - -NodeStyle::NodeStyle() : Style() -{ -} - - -NodeStyle::NodeStyle(QString name, GraphElementData *data): Style(name, data) -{ -} - -//QColor NodeStyle::fillColor(bool tikzitOverride) const -//{ -// if (_data == 0) return Qt::white; - -// QString col = propertyWithDefault("fill", "white", tikzitOverride); -// return tikzit->colorByName(col); -//} - -//QBrush NodeStyle::brush() const -//{ -// return QBrush(fillColor()); -//} - -//QString NodeStyle::shape(bool tikzitOverride) const -//{ -// return propertyWithDefault("shape", "circle", tikzitOverride); -//} - -//QPainterPath NodeStyle::path() const -//{ -// QPainterPath pth; -// QString sh = shape(); - -// if (sh == "rectangle") { -// pth.addRect(-30.0f, -30.0f, 60.0f, 60.0f); -// } else { // default is 'circle' -// pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f); -// } -// return pth; -//} - -//QPainterPath NodeStyle::palettePath() const -//{ -// return path(); -//} - -//QIcon NodeStyle::icon() const -//{ -// // draw an icon matching the style -// QImage px(100,100,QImage::Format_ARGB32_Premultiplied); -// px.fill(Qt::transparent); - - -// QPainter painter(&px); -// painter.setRenderHint(QPainter::Antialiasing); -// QPainterPath pth = path(); -// pth.translate(50.0f, 50.0f); - -// if (_data == 0) { -// QColor c(180,180,200); -// painter.setPen(QPen(c)); -// painter.setBrush(QBrush(c)); -// painter.drawEllipse(QPointF(50.0f,50.0f), 3,3); - -// QPen pen(QColor(180,180,220)); -// pen.setWidth(3); -// QVector p; -// p << 2.0 << 2.0; -// pen.setDashPattern(p); -// painter.setPen(pen); -// painter.setBrush(Qt::NoBrush); -// painter.drawPath(pth); -// } else { -// painter.setPen(pen()); -// painter.setBrush(brush()); -// painter.drawPath(pth); -// } - -// return QIcon(QPixmap::fromImage(px)); -//} - -//QString NodeStyle::category() -//{ -// return propertyWithDefault("tikzit category", "", false); -//} - diff --git a/src/data/nodestyle.h b/src/data/nodestyle.h deleted file mode 100644 index 36bd5d5..0000000 --- a/src/data/nodestyle.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - TikZiT - a GUI diagram editor for TikZ - Copyright (C) 2018 Aleks Kissinger - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef NODESTYLE_H -#define NODESTYLE_H - -#include "style.h" - -#include -#include -#include -#include -#include - -class NodeStyle : public Style -{ -public: - NodeStyle(); - NodeStyle(QString name, GraphElementData *data); - -// QColor fillColor(bool tikzitOverride=true) const; -// QBrush brush() const; -// QPainterPath path() const override; -// QString shape(bool tikzitOverride=true) const; - -// QPainterPath palettePath() const override; -// QIcon icon() const override; - -}; - -extern NodeStyle *noneStyle; -extern NodeStyle *unknownStyle; - -#endif // NODESTYLE_H diff --git a/src/data/nodestylelist.cpp b/src/data/nodestylelist.cpp index 41749db..7f17ff0 100644 --- a/src/data/nodestylelist.cpp +++ b/src/data/nodestylelist.cpp @@ -6,14 +6,14 @@ NodeStyleList::NodeStyleList(QObject *parent) : QAbstractListModel(parent) { } -NodeStyle *NodeStyleList::style(QString name) +Style *NodeStyleList::style(QString name) { - foreach (NodeStyle *s, _styles) + foreach (Style *s, _styles) if (s->name() == name) return s; return nullptr; } -NodeStyle *NodeStyleList::style(int i) +Style *NodeStyleList::style(int i) { return _styles[i]; } @@ -23,8 +23,9 @@ int NodeStyleList::length() const return _styles.length(); } -void NodeStyleList::addStyle(NodeStyle *s) +void NodeStyleList::addStyle(Style *s) { + s->setParent(this); if (s->category() == _category) { int n = numInCategory(); beginInsertRows(QModelIndex(), n, n); @@ -53,7 +54,7 @@ QString NodeStyleList::tikz() { QString str; QTextStream code(&str); - foreach (NodeStyle *s, _styles) code << s->tikz() << "\n"; + foreach (Style *s, _styles) code << s->tikz() << "\n"; code.flush(); return str; } @@ -61,7 +62,7 @@ QString NodeStyleList::tikz() int NodeStyleList::numInCategory() const { int c = 0; - foreach (NodeStyle *s, _styles) { + foreach (Style *s, _styles) { if (_category == "" || s->category() == _category) { ++c; } @@ -81,7 +82,7 @@ int NodeStyleList::nthInCategory(int n) const return -1; } -NodeStyle *NodeStyleList::styleInCategory(int n) const +Style *NodeStyleList::styleInCategory(int n) const { return _styles[nthInCategory(n)]; } diff --git a/src/data/nodestylelist.h b/src/data/nodestylelist.h index 03f7ed5..5a53721 100644 --- a/src/data/nodestylelist.h +++ b/src/data/nodestylelist.h @@ -1,7 +1,7 @@ #ifndef NODESTYLELIST_H #define NODESTYLELIST_H -#include "nodestyle.h" +#include "style.h" #include @@ -10,16 +10,16 @@ class NodeStyleList : public QAbstractListModel Q_OBJECT public: explicit NodeStyleList(QObject *parent = nullptr); - NodeStyle *style(QString name); - NodeStyle *style(int i); + Style *style(QString name); + Style *style(int i); int length() const; - void addStyle(NodeStyle *s); + void addStyle(Style *s); void clear(); QString tikz(); int numInCategory() const; int nthInCategory(int n) const; - NodeStyle *styleInCategory(int n) const; + Style *styleInCategory(int n) const; QVariant data(const QModelIndex &index, int role) const override; int rowCount(const QModelIndex &/*parent*/) const override; @@ -33,7 +33,7 @@ signals: public slots: private: - QVector _styles; + QVector _styles; QString _category; }; diff --git a/src/data/style.cpp b/src/data/style.cpp index 39314cb..7af95ca 100644 --- a/src/data/style.cpp +++ b/src/data/style.cpp @@ -19,6 +19,10 @@ #include "style.h" #include "tikzit.h" +Style *noneStyle = new Style("none", new GraphElementData()); +Style *unknownStyle = new Style("unknown", new GraphElementData({GraphElementProperty("tikzit fill", "blue")})); +Style *noneEdgeStyle = new Style("none", new GraphElementData({GraphElementProperty("-")})); + Style::Style() : _name("none") { _data = new GraphElementData(this); diff --git a/src/data/style.h b/src/data/style.h index ca2e604..476af77 100644 --- a/src/data/style.h +++ b/src/data/style.h @@ -73,4 +73,9 @@ protected: QString _name; GraphElementData *_data; }; + +extern Style *noneStyle; +extern Style *unknownStyle; +extern Style *noneEdgeStyle; + #endif // STYLE_H diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp index e3a735c..0645a72 100644 --- a/src/data/tikzstyles.cpp +++ b/src/data/tikzstyles.cpp @@ -17,7 +17,6 @@ */ #include "tikzstyles.h" -#include "nodestyle.h" #include "tikzassembler.h" #include @@ -30,16 +29,16 @@ TikzStyles::TikzStyles(QObject *parent) : QObject(parent) _nodeStyles = new NodeStyleList(this); } -NodeStyle *TikzStyles::nodeStyle(QString name) const +Style *TikzStyles::nodeStyle(QString name) const { - NodeStyle *s = _nodeStyles->style(name); + Style *s = _nodeStyles->style(name); return (s == nullptr) ? unknownStyle : s; } -EdgeStyle *TikzStyles::edgeStyle(QString name) const +Style *TikzStyles::edgeStyle(QString name) const { - foreach (EdgeStyle *s , _edgeStyles) + foreach (Style *s , _edgeStyles) if (s->name() == name) return s; return noneEdgeStyle; } @@ -99,7 +98,7 @@ void TikzStyles::refreshModels(QStandardItemModel *nodeModel, QStandardItemModel it->setSizeHint(QSize(48,48)); } - NodeStyle *ns; + Style *ns; for (int i = 0; i < _nodeStyles->length(); ++i) { ns = _nodeStyles->style(i); if (category == "" || category == ns->propertyWithDefault("tikzit category", "", false)) @@ -119,7 +118,7 @@ void TikzStyles::refreshModels(QStandardItemModel *nodeModel, QStandardItemModel edgeModel->appendRow(it); } - foreach(EdgeStyle *es, _edgeStyles) { + foreach(Style *es, _edgeStyles) { //if (category == "" || category == es->propertyWithDefault("tikzit category", "", false)) //{ it = new QStandardItem(es->icon(), es->name()); @@ -134,7 +133,7 @@ QStringList TikzStyles::categories() const { QMap cats; // use a QMap to keep keys sorted cats.insert("", true); - NodeStyle *ns; + Style *ns; for (int i = 0; i < _nodeStyles->length(); ++i) { ns = _nodeStyles->style(i); cats.insert(ns->propertyWithDefault("tikzit category", "", false), true); @@ -157,7 +156,7 @@ QString TikzStyles::tikz() const code << _nodeStyles->tikz(); code << "\n% Edge styles\n"; - foreach (EdgeStyle *s, _edgeStyles) code << s->tikz() << "\n"; + foreach (Style *s, _edgeStyles) code << s->tikz() << "\n"; code.flush(); return str; @@ -165,13 +164,12 @@ QString TikzStyles::tikz() const void TikzStyles::addStyle(QString name, GraphElementData *data) { - if (data->atom("-") || data->atom("->") || data->atom("-|") || - data->atom("<-") || data->atom("<->") || data->atom("<-|") || - data->atom("|-") || data->atom("|->") || data->atom("|-|")) + Style *s = new Style(name, data); + if (s->isEdgeStyle()) { // edge style - _edgeStyles << new EdgeStyle(name, data); + _edgeStyles << s; } else { // node style - _nodeStyles->addStyle(new NodeStyle(name, data)); + _nodeStyles->addStyle(new Style(name, data)); } } diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h index 68bd9ce..fbb12ff 100644 --- a/src/data/tikzstyles.h +++ b/src/data/tikzstyles.h @@ -21,7 +21,7 @@ #include "graphelementdata.h" #include "nodestylelist.h" -#include "edgestyle.h" +#include "style.h" #include #include @@ -35,8 +35,8 @@ public: explicit TikzStyles(QObject *parent = 0); void addStyle(QString name, GraphElementData *data); - NodeStyle *nodeStyle(QString name) const; - EdgeStyle *edgeStyle(QString name) const; + Style *nodeStyle(QString name) const; + Style *edgeStyle(QString name) const; QStringList categories() const; QString tikz() const; void clear(); @@ -54,7 +54,7 @@ public slots: private: NodeStyleList *_nodeStyles; - QVector _edgeStyles; + QVector _edgeStyles; QStringList _colNames; QVector _cols; }; diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index 2f5b15c..48f321e 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -86,14 +86,14 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge switch (_edge->style()->arrowHead()) { - case EdgeStyle::Flat: + case Style::Flat: { painter->drawLine( toScreen(_edge->head() + hLeft), toScreen(_edge->head() + hRight)); break; } - case EdgeStyle::Pointer: + case Style::Pointer: { QPainterPath pth; pth.moveTo(toScreen(_edge->head() + ht + hLeft)); @@ -102,7 +102,7 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } - case EdgeStyle::NoTip: + case Style::NoTip: break; } @@ -112,14 +112,14 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge //painter->setPen(pen); switch (_edge->style()->arrowTail()) { - case EdgeStyle::Flat: + case Style::Flat: { painter->drawLine( toScreen(_edge->tail() + tLeft), toScreen(_edge->tail() + tRight)); break; } - case EdgeStyle::Pointer: + case Style::Pointer: { QPainterPath pth; pth.moveTo(toScreen(_edge->tail() + tt + tLeft)); @@ -128,7 +128,7 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } - case EdgeStyle::NoTip: + case Style::NoTip: break; } diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index f6e3f48..46df095 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -368,26 +368,26 @@ void StyleEditor::refreshDisplay() ui->leftArrow->setEnabled(true); switch (_activeEdgeStyle->arrowTail()) { - case EdgeStyle::NoTip: + case Style::NoTip: ui->leftArrow->setCurrentText(""); break; - case EdgeStyle::Pointer: + case Style::Pointer: ui->leftArrow->setCurrentText("<"); break; - case EdgeStyle::Flat: + case Style::Flat: ui->leftArrow->setCurrentText("|"); break; } ui->rightArrow->setEnabled(true); switch (_activeEdgeStyle->arrowHead()) { - case EdgeStyle::NoTip: + case Style::NoTip: ui->rightArrow->setCurrentText(""); break; - case EdgeStyle::Pointer: + case Style::Pointer: ui->rightArrow->setCurrentText(">"); break; - case EdgeStyle::Flat: + case Style::Flat: ui->rightArrow->setCurrentText("|"); break; } diff --git a/src/gui/styleeditor.h b/src/gui/styleeditor.h index f5df025..e40facd 100644 --- a/src/gui/styleeditor.h +++ b/src/gui/styleeditor.h @@ -1,8 +1,7 @@ #ifndef STYLEEDITOR_H #define STYLEEDITOR_H -#include "nodestyle.h" -#include "edgestyle.h" +#include "style.h" #include "tikzstyles.h" #include @@ -62,8 +61,8 @@ private: QStandardItemModel *_nodeModel; QStandardItemModel *_edgeModel; QStandardItem *_activeItem; - NodeStyle *_activeNodeStyle; - EdgeStyle *_activeEdgeStyle; + Style *_activeNodeStyle; + Style *_activeEdgeStyle; //QString _activeCategory; Style *activeStyle(); TikzStyles *_styles; diff --git a/src/tikzit.h b/src/tikzit.h index 525696d..6612ff1 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -57,7 +57,6 @@ #include "toolpalette.h" #include "propertypalette.h" #include "stylepalette.h" -#include "nodestyle.h" #include "tikzstyles.h" #include diff --git a/tikzit.pro b/tikzit.pro index 79cb6c6..bd25e7d 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -43,7 +43,6 @@ SOURCES += src/gui/mainwindow.cpp \ src/gui/nodeitem.cpp \ src/gui/edgeitem.cpp \ src/tikzit.cpp \ - src/data/nodestyle.cpp \ src/gui/commands.cpp \ src/data/tikzdocument.cpp \ src/gui/undocommands.cpp \ @@ -52,7 +51,6 @@ SOURCES += src/gui/mainwindow.cpp \ src/gui/stylepalette.cpp \ src/data/tikzassembler.cpp \ src/data/tikzstyles.cpp \ - src/data/edgestyle.cpp \ src/data/style.cpp \ src/gui/styleeditor.cpp \ src/data/nodestylelist.cpp @@ -71,7 +69,6 @@ HEADERS += src/gui/mainwindow.h \ src/gui/nodeitem.h \ src/tikzit.h \ src/gui/edgeitem.h \ - src/data/nodestyle.h \ src/gui/commands.h \ src/data/tikzdocument.h \ src/gui/undocommands.h \ @@ -80,7 +77,6 @@ HEADERS += src/gui/mainwindow.h \ src/gui/stylepalette.h \ src/data/tikzassembler.h \ src/data/tikzstyles.h \ - src/data/edgestyle.h \ src/data/style.h \ src/gui/styleeditor.h \ src/data/nodestylelist.h -- cgit v1.2.3 From 263678a6d295d492351698db50a57c9db3bfe8ae Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 6 Oct 2018 19:55:55 +0200 Subject: switched to custom style model --- src/data/nodestylelist.cpp | 114 ---------------------------------------- src/data/nodestylelist.h | 40 -------------- src/data/stylelist.cpp | 127 +++++++++++++++++++++++++++++++++++++++++++++ src/data/stylelist.h | 41 +++++++++++++++ src/data/tikzstyles.cpp | 55 +++++++++++--------- src/data/tikzstyles.h | 9 ++-- src/gui/stylepalette.cpp | 21 ++++---- src/gui/stylepalette.h | 2 - tikzit.pro | 4 +- 9 files changed, 218 insertions(+), 195 deletions(-) delete mode 100644 src/data/nodestylelist.cpp delete mode 100644 src/data/nodestylelist.h create mode 100644 src/data/stylelist.cpp create mode 100644 src/data/stylelist.h (limited to 'src') diff --git a/src/data/nodestylelist.cpp b/src/data/nodestylelist.cpp deleted file mode 100644 index 7f17ff0..0000000 --- a/src/data/nodestylelist.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#include "nodestylelist.h" - -#include - -NodeStyleList::NodeStyleList(QObject *parent) : QAbstractListModel(parent) -{ -} - -Style *NodeStyleList::style(QString name) -{ - foreach (Style *s, _styles) - if (s->name() == name) return s; - return nullptr; -} - -Style *NodeStyleList::style(int i) -{ - return _styles[i]; -} - -int NodeStyleList::length() const -{ - return _styles.length(); -} - -void NodeStyleList::addStyle(Style *s) -{ - s->setParent(this); - if (s->category() == _category) { - int n = numInCategory(); - beginInsertRows(QModelIndex(), n, n); - _styles << s; - endInsertRows(); - } else { - _styles << s; - } -} - -void NodeStyleList::clear() -{ - int n = numInCategory(); - if (n > 0) { - beginRemoveRows(QModelIndex(), 0, n - 1); - _styles.clear(); - endRemoveRows(); - } else { - _styles.clear(); - } - - _category = ""; -} - -QString NodeStyleList::tikz() -{ - QString str; - QTextStream code(&str); - foreach (Style *s, _styles) code << s->tikz() << "\n"; - code.flush(); - return str; -} - -int NodeStyleList::numInCategory() const -{ - int c = 0; - foreach (Style *s, _styles) { - if (_category == "" || s->category() == _category) { - ++c; - } - } - return c; -} - -int NodeStyleList::nthInCategory(int n) const -{ - int c = 0; - for (int j = 0; j < _styles.length(); ++j) { - if (_category == "" || _styles[j]->category() == _category) { - if (c == n) return j; - else ++c; - } - } - return -1; -} - -Style *NodeStyleList::styleInCategory(int n) const -{ - return _styles[nthInCategory(n)]; -} - -QVariant NodeStyleList::data(const QModelIndex &index, int role) const -{ - if (role == Qt::DisplayRole) { - return QVariant(styleInCategory(index.row())->name()); - } else if (role == Qt::DecorationRole) { - return QVariant(styleInCategory(index.row())->icon()); - } else { - return QVariant(); - } -} - -int NodeStyleList::rowCount(const QModelIndex &/*parent*/) const -{ - return numInCategory(); -} - -QString NodeStyleList::category() const -{ - return _category; -} - -void NodeStyleList::setCategory(const QString &category) -{ - _category = category; -} diff --git a/src/data/nodestylelist.h b/src/data/nodestylelist.h deleted file mode 100644 index 5a53721..0000000 --- a/src/data/nodestylelist.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef NODESTYLELIST_H -#define NODESTYLELIST_H - -#include "style.h" - -#include - -class NodeStyleList : public QAbstractListModel -{ - Q_OBJECT -public: - explicit NodeStyleList(QObject *parent = nullptr); - Style *style(QString name); - Style *style(int i); - int length() const; - void addStyle(Style *s); - void clear(); - QString tikz(); - - int numInCategory() const; - int nthInCategory(int n) const; - Style *styleInCategory(int n) const; - - QVariant data(const QModelIndex &index, int role) const override; - int rowCount(const QModelIndex &/*parent*/) const override; - - - QString category() const; - void setCategory(const QString &category); - -signals: - -public slots: - -private: - QVector _styles; - QString _category; -}; - -#endif // NODESTYLELIST_H diff --git a/src/data/stylelist.cpp b/src/data/stylelist.cpp new file mode 100644 index 0000000..2c79d10 --- /dev/null +++ b/src/data/stylelist.cpp @@ -0,0 +1,127 @@ +#include "stylelist.h" + +#include + +StyleList::StyleList(bool edgeStyles, QObject *parent) : QAbstractListModel(parent), _edgeStyles(edgeStyles) +{ + if (edgeStyles) { + _styles << noneEdgeStyle; + } else { + _styles << noneStyle; + } +} + +Style *StyleList::style(QString name) +{ + foreach (Style *s, _styles) + if (s->name() == name) return s; + return nullptr; +} + +Style *StyleList::style(int i) +{ + return _styles[i]; +} + +int StyleList::length() const +{ + return _styles.length(); +} + +void StyleList::addStyle(Style *s) +{ + s->setParent(this); + if (s->category() == _category) { + int n = numInCategory(); + beginInsertRows(QModelIndex(), n, n); + _styles << s; + endInsertRows(); + } else { + _styles << s; + } +} + +void StyleList::clear() +{ + int n = numInCategory(); + if (n > 0) { + beginRemoveRows(QModelIndex(), 1, n - 1); + _styles.clear(); + if (_edgeStyles) _styles << noneEdgeStyle; + else _styles << noneStyle; + endRemoveRows(); + } else { + _styles.clear(); + if (_edgeStyles) _styles << noneEdgeStyle; + else _styles << noneStyle; + } + + _category = ""; +} + +QString StyleList::tikz() +{ + QString str; + QTextStream code(&str); + foreach (Style *s, _styles) code << s->tikz() << "\n"; + code.flush(); + return str; +} + +int StyleList::numInCategory() const +{ + int c = 0; + foreach (Style *s, _styles) { + if (_category == "" || s->isNone() || s->category() == _category) { + ++c; + } + } + return c; +} + +int StyleList::nthInCategory(int n) const +{ + int c = 0; + for (int j = 0; j < _styles.length(); ++j) { + if (_category == "" || _styles[j]->isNone() || _styles[j]->category() == _category) { + if (c == n) return j; + else ++c; + } + } + return -1; +} + +Style *StyleList::styleInCategory(int n) const +{ + return _styles[nthInCategory(n)]; +} + +QVariant StyleList::data(const QModelIndex &index, int role) const +{ + if (role == Qt::DisplayRole) { + return QVariant(styleInCategory(index.row())->name()); + } else if (role == Qt::DecorationRole) { + return QVariant(styleInCategory(index.row())->icon()); + } else { + return QVariant(); + } +} + +int StyleList::rowCount(const QModelIndex &/*parent*/) const +{ + return numInCategory(); +} + +QString StyleList::category() const +{ + return _category; +} + +void StyleList::setCategory(const QString &category) +{ + if (category != _category) { + beginResetModel(); + _category = category; + endResetModel(); + } +} diff --git a/src/data/stylelist.h b/src/data/stylelist.h new file mode 100644 index 0000000..f698761 --- /dev/null +++ b/src/data/stylelist.h @@ -0,0 +1,41 @@ +#ifndef NODESTYLELIST_H +#define NODESTYLELIST_H + +#include "style.h" + +#include + +class StyleList : public QAbstractListModel +{ + Q_OBJECT +public: + explicit StyleList(bool edgeStyles = false, QObject *parent = nullptr); + Style *style(QString name); + Style *style(int i); + int length() const; + void addStyle(Style *s); + void clear(); + QString tikz(); + + int numInCategory() const; + int nthInCategory(int n) const; + Style *styleInCategory(int n) const; + + QVariant data(const QModelIndex &index, int role) const override; + int rowCount(const QModelIndex &/*parent*/) const override; + + + QString category() const; + void setCategory(const QString &category); + +signals: + +public slots: + +private: + QVector _styles; + QString _category; + bool _edgeStyles; +}; + +#endif // NODESTYLELIST_H diff --git a/src/data/tikzstyles.cpp b/src/data/tikzstyles.cpp index 0645a72..522b3f5 100644 --- a/src/data/tikzstyles.cpp +++ b/src/data/tikzstyles.cpp @@ -26,7 +26,8 @@ TikzStyles::TikzStyles(QObject *parent) : QObject(parent) { - _nodeStyles = new NodeStyleList(this); + _nodeStyles = new StyleList(false, this); + _edgeStyles = new StyleList(true, this); } Style *TikzStyles::nodeStyle(QString name) const @@ -38,16 +39,15 @@ Style *TikzStyles::nodeStyle(QString name) const Style *TikzStyles::edgeStyle(QString name) const { - foreach (Style *s , _edgeStyles) - if (s->name() == name) return s; - return noneEdgeStyle; + Style *s = _edgeStyles->style(name); + return (s == nullptr) ? noneEdgeStyle : s; } void TikzStyles::clear() { _nodeStyles->clear(); - _edgeStyles.clear(); + _edgeStyles->clear(); } bool TikzStyles::loadStyles(QString fileName) @@ -98,14 +98,14 @@ void TikzStyles::refreshModels(QStandardItemModel *nodeModel, QStandardItemModel it->setSizeHint(QSize(48,48)); } - Style *ns; + Style *s; for (int i = 0; i < _nodeStyles->length(); ++i) { - ns = _nodeStyles->style(i); - if (category == "" || category == ns->propertyWithDefault("tikzit category", "", false)) + s = _nodeStyles->style(i); + if (category == "" || category == s->propertyWithDefault("tikzit category", "", false)) { - it = new QStandardItem(ns->icon(), ns->name()); + it = new QStandardItem(s->icon(), s->name()); it->setEditable(false); - it->setData(ns->name()); + it->setData(s->name()); it->setSizeHint(QSize(48,48)); nodeModel->appendRow(it); } @@ -118,17 +118,26 @@ void TikzStyles::refreshModels(QStandardItemModel *nodeModel, QStandardItemModel edgeModel->appendRow(it); } - foreach(Style *es, _edgeStyles) { - //if (category == "" || category == es->propertyWithDefault("tikzit category", "", false)) - //{ - it = new QStandardItem(es->icon(), es->name()); - it->setEditable(false); - it->setData(es->name()); - edgeModel->appendRow(it); - //} + for (int i = 0; i < _edgeStyles->length(); ++i) { + s = _edgeStyles->style(i); + it = new QStandardItem(s->icon(), s->name()); + it->setEditable(false); + it->setData(s->name()); + it->setSizeHint(QSize(48,48)); + edgeModel->appendRow(it); } } +StyleList *TikzStyles::nodeStyles() const +{ + return _nodeStyles; +} + +StyleList *TikzStyles::edgeStyles() const +{ + return _edgeStyles; +} + QStringList TikzStyles::categories() const { QMap cats; // use a QMap to keep keys sorted @@ -156,7 +165,7 @@ QString TikzStyles::tikz() const code << _nodeStyles->tikz(); code << "\n% Edge styles\n"; - foreach (Style *s, _edgeStyles) code << s->tikz() << "\n"; + code << _edgeStyles->tikz(); code.flush(); return str; @@ -165,12 +174,8 @@ QString TikzStyles::tikz() const void TikzStyles::addStyle(QString name, GraphElementData *data) { Style *s = new Style(name, data); - if (s->isEdgeStyle()) - { // edge style - _edgeStyles << s; - } else { // node style - _nodeStyles->addStyle(new Style(name, data)); - } + if (s->isEdgeStyle()) _edgeStyles->addStyle(s); + else _nodeStyles->addStyle(s); } diff --git a/src/data/tikzstyles.h b/src/data/tikzstyles.h index fbb12ff..5f372ab 100644 --- a/src/data/tikzstyles.h +++ b/src/data/tikzstyles.h @@ -20,7 +20,7 @@ #define PROJECT_H #include "graphelementdata.h" -#include "nodestylelist.h" +#include "stylelist.h" #include "style.h" #include @@ -48,13 +48,16 @@ public: QString category="", bool includeNone=true); + StyleList *nodeStyles() const; + StyleList *edgeStyles() const; + signals: public slots: private: - NodeStyleList *_nodeStyles; - QVector _edgeStyles; + StyleList *_nodeStyles; + StyleList* _edgeStyles; QStringList _colNames; QVector _cols; }; diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 7423f29..953d9d5 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -40,16 +40,16 @@ StylePalette::StylePalette(QWidget *parent) : // restoreGeometry(geom.toByteArray()); // } - _nodeModel = new QStandardItemModel(this); - _edgeModel = new QStandardItemModel(this); +// _nodeModel = new QStandardItemModel(this); +// _edgeModel = new QStandardItemModel(this); - ui->styleListView->setModel(_nodeModel); + ui->styleListView->setModel(tikzit->styles()->nodeStyles()); ui->styleListView->setViewMode(QListView::IconMode); ui->styleListView->setMovement(QListView::Static); ui->styleListView->setGridSize(QSize(48,48)); - ui->edgeStyleListView->setModel(_edgeModel); + ui->edgeStyleListView->setModel(tikzit->styles()->edgeStyles()); ui->edgeStyleListView->setViewMode(QListView::IconMode); ui->edgeStyleListView->setMovement(QListView::Static); ui->edgeStyleListView->setGridSize(QSize(48,48)); @@ -70,6 +70,9 @@ void StylePalette::reloadStyles() QString f = tikzit->styleFile(); ui->styleFile->setText(f); + ui->styleListView->setModel(tikzit->styles()->nodeStyles()); + ui->edgeStyleListView->setModel(tikzit->styles()->edgeStyles()); + QString cat = ui->currentCategory->currentText(); ui->currentCategory->clear(); @@ -85,12 +88,12 @@ void StylePalette::changeNodeStyle(int increment) QModelIndexList i = ui->styleListView->selectionModel()->selectedIndexes(); int row = 0; if (!i.isEmpty()) { - int row = (i[0].row()+increment)%_nodeModel->rowCount(); - if (row < 0) row += _nodeModel->rowCount(); + int row = (i[0].row()+increment)% tikzit->styles()->nodeStyles()->numInCategory(); + if (row < 0) row += tikzit->styles()->nodeStyles()->numInCategory(); } //QModelIndex i1 = ui->styleListView->rootIndex().child(row, 0); - QModelIndex i1 = _nodeModel->index(row,0); + QModelIndex i1 =tikzit->styles()->nodeStyles()->index(row,0); ui->styleListView->selectionModel()->select(i1, QItemSelectionModel::ClearAndSelect); ui->styleListView->scrollTo(i1); } @@ -134,7 +137,6 @@ void StylePalette::nodeStyleDoubleClicked(const QModelIndex &) void StylePalette::edgeStyleDoubleClicked(const QModelIndex &) { - qDebug() << "got double click"; tikzit->activeWindow()->tikzScene()->applyActiveStyleToEdges(); } @@ -157,7 +159,8 @@ void StylePalette::on_buttonRefreshTikzstyles_clicked() void StylePalette::on_currentCategory_currentTextChanged(const QString &cat) { - tikzit->styles()->refreshModels(_nodeModel, _edgeModel, cat); + //tikzit->styles()->refreshModels(_nodeModel, _edgeModel, cat); + tikzit->styles()->nodeStyles()->setCategory(cat); } //void StylePalette::on_buttonApplyNodeStyle_clicked() diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index fc4e253..7cdef0c 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -53,8 +53,6 @@ private: void changeNodeStyle(int increment); Ui::StylePalette *ui; - QStandardItemModel *_nodeModel; - QStandardItemModel *_edgeModel; protected: void closeEvent(QCloseEvent *event) override; diff --git a/tikzit.pro b/tikzit.pro index bd25e7d..5ff61fa 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -53,7 +53,7 @@ SOURCES += src/gui/mainwindow.cpp \ src/data/tikzstyles.cpp \ src/data/style.cpp \ src/gui/styleeditor.cpp \ - src/data/nodestylelist.cpp + src/data/stylelist.cpp HEADERS += src/gui/mainwindow.h \ src/gui/toolpalette.h \ @@ -79,7 +79,7 @@ HEADERS += src/gui/mainwindow.h \ src/data/tikzstyles.h \ src/data/style.h \ src/gui/styleeditor.h \ - src/data/nodestylelist.h + src/data/stylelist.h FORMS += src/gui/mainwindow.ui \ src/gui/propertypalette.ui \ -- cgit v1.2.3 From 07c9d67859248840bba0a178aab0dff4306c01c4 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 7 Oct 2018 16:51:00 +0200 Subject: style editor uses custom models --- src/gui/styleeditor.cpp | 331 ++++++++++++++++++++---------------------------- src/gui/styleeditor.h | 9 +- 2 files changed, 138 insertions(+), 202 deletions(-) (limited to 'src') diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index 46df095..e3f8ace 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -18,27 +18,16 @@ StyleEditor::StyleEditor(QWidget *parent) : ui->leftArrow << ui->rightArrow << ui->properties; - _styles = 0; + _styles = nullptr; - _nodeModel = new QStandardItemModel(this); - _edgeModel = new QStandardItemModel(this); - - ui->styleListView->setModel(_nodeModel); ui->styleListView->setViewMode(QListView::IconMode); ui->styleListView->setMovement(QListView::Static); ui->styleListView->setGridSize(QSize(48,48)); - ui->edgeStyleListView->setModel(_edgeModel); ui->edgeStyleListView->setViewMode(QListView::IconMode); ui->edgeStyleListView->setMovement(QListView::Static); ui->edgeStyleListView->setGridSize(QSize(48,48)); - connect(ui->styleListView->selectionModel(), - SIGNAL(currentChanged(QModelIndex,QModelIndex)), - this, SLOT(nodeItemChanged(QModelIndex))); - connect(ui->edgeStyleListView->selectionModel(), - SIGNAL(currentChanged(QModelIndex,QModelIndex)), - this, SLOT(edgeItemChanged(QModelIndex))); connect(ui->category->lineEdit(), SIGNAL(editingFinished()), this, SLOT(categoryChanged())); @@ -80,9 +69,6 @@ StyleEditor::StyleEditor(QWidget *parent) : pos += 1; } - _activeNodeStyle = 0; - _activeEdgeStyle = 0; - _activeItem = 0; refreshDisplay(); } @@ -92,16 +78,19 @@ StyleEditor::~StyleEditor() } void StyleEditor::open() { - if (_styles != 0) delete _styles; + if (_styles != nullptr) delete _styles; _styles = new TikzStyles; - _activeNodeStyle = 0; - _activeEdgeStyle = 0; - _activeItem = 0; - ui->styleListView->selectionModel()->clear(); - ui->edgeStyleListView->selectionModel()->clear(); + ui->styleListView->setModel(_styles->nodeStyles()); + ui->edgeStyleListView->setModel(_styles->edgeStyles()); + connect(ui->styleListView->selectionModel(), + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(nodeItemChanged(QModelIndex))); + connect(ui->edgeStyleListView->selectionModel(), + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(edgeItemChanged(QModelIndex))); + if (_styles->loadStyles(tikzit->styleFilePath())) { _dirty = false; - _styles->refreshModels(_nodeModel, _edgeModel, "", false); refreshCategories(); refreshDisplay(); show(); @@ -136,42 +125,22 @@ void StyleEditor::closeEvent(QCloseEvent *event) void StyleEditor::nodeItemChanged(QModelIndex sel) { - //ui->edgeStyleListView->blockSignals(true); - ui->edgeStyleListView->selectionModel()->clear(); - //ui->edgeStyleListView->blockSignals(false); - //qDebug() << "got node item change"; - - _activeNodeStyle = 0; - _activeEdgeStyle = 0; - _activeItem = 0; - QString sty; if (sel.isValid()) { - _activeItem = _nodeModel->itemFromIndex(sel); - sty = _activeItem->text(); - if (sty != "none") - _activeNodeStyle = _styles->nodeStyle(sty); + ui->edgeStyleListView->selectionModel()->clear(); + qDebug() << "active style:" << ((activeStyle() == nullptr) ? "null" : activeStyle()->tikz()); + qDebug() << "style from index:" << _styles->nodeStyles()->styleInCategory(sel.row())->tikz(); } + _nodeStyleIndex = sel; refreshDisplay(); } void StyleEditor::edgeItemChanged(QModelIndex sel) { - //ui->styleListView->blockSignals(true); - ui->styleListView->selectionModel()->clear(); - //ui->styleListView->blockSignals(false); - //qDebug() << "got edge item change"; - - _activeNodeStyle = 0; - _activeEdgeStyle = 0; - _activeItem = 0; - - QString sty; if (sel.isValid()) { - _activeItem = _edgeModel->itemFromIndex(sel); - sty = _activeItem->text(); - if (sty != "none") - _activeEdgeStyle = _styles->edgeStyle(sty); + ui->styleListView->selectionModel()->clear(); + //_nodeStyleIndex = QModelIndex(); } + _edgeStyleIndex = sel; refreshDisplay(); } @@ -192,37 +161,6 @@ void StyleEditor::categoryChanged() void StyleEditor::currentCategoryChanged() { - qDebug() << "refreshing models on category change"; - _styles->refreshModels(_nodeModel, _edgeModel, ui->currentCategory->currentText(), false); - _activeItem = 0; - - // try to keep the selection as is, or clear the current style - if (_activeNodeStyle != 0) { - ui->styleListView->selectionModel()->clear(); - for (int i = 0; i < _nodeModel->rowCount(); ++i) { - if (_activeNodeStyle->name() == _nodeModel->item(i)->data()) { - _activeItem = _nodeModel->item(i); - ui->styleListView->selectionModel()->select( - _nodeModel->index(i,0), - QItemSelectionModel::SelectCurrent); - } - } - } else if (_activeEdgeStyle != 0) { - ui->edgeStyleListView->selectionModel()->clear(); - for (int i = 0; i < _edgeModel->rowCount(); ++i) { - if (_activeEdgeStyle->name() == _edgeModel->item(i)->data()) { - _activeItem = _edgeModel->item(i); - ui->edgeStyleListView->selectionModel()->select( - _edgeModel->index(i,0), - QItemSelectionModel::SelectCurrent); - } - } - } - - if (_activeItem == 0) { - _activeNodeStyle = 0; - _activeEdgeStyle = 0; - } } void StyleEditor::refreshCategories() @@ -234,7 +172,7 @@ void StyleEditor::refreshCategories() ui->currentCategory->clear(); ui->category->clear(); - if (_styles != 0) { + if (_styles != nullptr) { foreach(QString c, _styles->categories()) { ui->category->addItem(c); ui->currentCategory->addItem(c); @@ -249,11 +187,13 @@ void StyleEditor::refreshCategories() void StyleEditor::propertyChanged() { - if (_activeNodeStyle != 0) { - _activeItem->setIcon(_activeNodeStyle->icon()); + QModelIndexList nSel = ui->styleListView->selectionModel()->selectedRows(); + QModelIndexList eSel = ui->edgeStyleListView->selectionModel()->selectedRows(); + if (!nSel.isEmpty()) { + emit _styles->nodeStyles()->dataChanged(nSel[0], nSel[0]); refreshCategories(); - } else if (_activeEdgeStyle != 0) { - _activeItem->setIcon(_activeEdgeStyle->icon()); + } else if (!eSel.isEmpty()) { + emit _styles->edgeStyles()->dataChanged(eSel[0], eSel[0]); } _dirty = true; refreshDisplay(); @@ -285,115 +225,98 @@ void StyleEditor::refreshDisplay() ui->rightArrow->setCurrentText(""); ui->properties->setModel(0); - if (_activeNodeStyle != 0) { - //_activeItem->setText(_activeNodeStyle->name()); - //_activeItem->setIcon(_activeNodeStyle->icon()); + Style *s = activeStyle(); + if (s != nullptr && !s->isNone()) { + // name ui->name->setEnabled(true); - ui->name->setText(_activeNodeStyle->name()); - - ui->category->setEnabled(true); - ui->category->setCurrentText( - _activeNodeStyle->propertyWithDefault("tikzit category", "", false)); - - // passing 'false' to these methods prevents 'tikzit foo' from overriding property 'foo' - QColor realFill = _activeNodeStyle->fillColor(false); - QColor fill = _activeNodeStyle->fillColor(); - bool fillOverride = realFill != fill; - QColor realDraw = _activeNodeStyle->strokeColor(false); - QColor draw = _activeNodeStyle->strokeColor(); - bool drawOverride = realDraw != draw; + ui->name->setText(s->name()); - ui->fillColor->setEnabled(true); - setColor(ui->fillColor, realFill); + // property list + ui->properties->setEnabled(true); + setPropertyModel(s->data()); + // draw + QColor realDraw = s->strokeColor(false); + QColor draw = s->strokeColor(); ui->drawColor->setEnabled(true); setColor(ui->drawColor, realDraw); - - ui->hasTikzitFillColor->setEnabled(true); - ui->hasTikzitFillColor->setChecked(fillOverride); - - ui->tikzitFillColor->setEnabled(fillOverride); - if (fillOverride) setColor(ui->tikzitFillColor, fill); - + // tikzit draw + bool drawOverride = realDraw != draw; ui->hasTikzitDrawColor->setEnabled(true); ui->hasTikzitDrawColor->setChecked(drawOverride); ui->tikzitDrawColor->setEnabled(drawOverride); if (drawOverride) setColor(ui->tikzitDrawColor, draw); - QString realShape = _activeNodeStyle->propertyWithDefault("shape", "", false); - QString shape = _activeNodeStyle->propertyWithDefault("tikzit shape", "", false); - bool shapeOverride = shape != realShape; - ui->shape->setEnabled(true); - ui->shape->setCurrentText(realShape); - - ui->hasTikzitShape->setEnabled(true); - ui->tikzitShape->setEnabled(shapeOverride); - if (shapeOverride) ui->tikzitShape->setCurrentText(shape); - - ui->properties->setEnabled(true); - setPropertyModel(_activeNodeStyle->data()); - qDebug() << _activeNodeStyle->data()->tikz(); - } else if (_activeEdgeStyle != 0) { - //_activeItem->setText(_activeEdgeStyle->name()); - //_activeItem->setIcon(_activeEdgeStyle->icon()); - ui->name->setEnabled(true); - ui->name->setText(_activeEdgeStyle->name()); - - //ui->category->setEnabled(true); - //ui->category->setCurrentText( - // _activeEdgeStyle->propertyWithDefault("tikzit category", "", false)); - - setColor(ui->fillColor, QColor(Qt::gray)); - setColor(ui->tikzitFillColor, QColor(Qt::gray)); - ui->hasTikzitFillColor->setChecked(false); - - - // passing 'false' to these methods prevents 'tikzit foo' from overriding property 'foo' - QColor realDraw = _activeEdgeStyle->strokeColor(false); - QColor draw = _activeEdgeStyle->strokeColor(); - bool drawOverride = realDraw != draw; - - ui->drawColor->setEnabled(true); - setColor(ui->drawColor, realDraw); - - ui->hasTikzitDrawColor->setEnabled(true); - ui->hasTikzitDrawColor->setChecked(drawOverride); - - ui->tikzitDrawColor->setEnabled(drawOverride); - setColor(ui->tikzitDrawColor, draw); - - ui->leftArrow->setEnabled(true); - - switch (_activeEdgeStyle->arrowTail()) { - case Style::NoTip: - ui->leftArrow->setCurrentText(""); - break; - case Style::Pointer: - ui->leftArrow->setCurrentText("<"); - break; - case Style::Flat: - ui->leftArrow->setCurrentText("|"); - break; - } + if (!s->isEdgeStyle()) { + // category + ui->category->setEnabled(true); + ui->category->setCurrentText( + s->propertyWithDefault("tikzit category", "", false)); + + // fill + QColor realFill = s->fillColor(false); + QColor fill = s->fillColor(); + ui->fillColor->setEnabled(true); + setColor(ui->fillColor, realFill); + + // tikzit fill + bool fillOverride = realFill != fill; + ui->hasTikzitFillColor->setEnabled(true); + ui->hasTikzitFillColor->setChecked(fillOverride); + ui->tikzitFillColor->setEnabled(fillOverride); + if (fillOverride) setColor(ui->tikzitFillColor, fill); + + // shape + QString realShape = s->propertyWithDefault("shape", "", false); + QString shape = s->propertyWithDefault("tikzit shape", "", false); + ui->shape->setEnabled(true); + ui->shape->setCurrentText(realShape); + + // tikzit shape + bool shapeOverride = shape != realShape; + ui->hasTikzitShape->setEnabled(true); + ui->tikzitShape->setEnabled(shapeOverride); + if (shapeOverride) ui->tikzitShape->setCurrentText(shape); + } else { + // set fill to gray (disabled) + setColor(ui->fillColor, QColor(Qt::gray)); + setColor(ui->tikzitFillColor, QColor(Qt::gray)); + ui->hasTikzitFillColor->setChecked(false); + + + // arrow tail + ui->leftArrow->setEnabled(true); + + switch (s->arrowTail()) { + case Style::NoTip: + ui->leftArrow->setCurrentText(""); + break; + case Style::Pointer: + ui->leftArrow->setCurrentText("<"); + break; + case Style::Flat: + ui->leftArrow->setCurrentText("|"); + break; + } - ui->rightArrow->setEnabled(true); - switch (_activeEdgeStyle->arrowHead()) { - case Style::NoTip: - ui->rightArrow->setCurrentText(""); - break; - case Style::Pointer: - ui->rightArrow->setCurrentText(">"); - break; - case Style::Flat: - ui->rightArrow->setCurrentText("|"); - break; + // arrow head + ui->rightArrow->setEnabled(true); + switch (s->arrowHead()) { + case Style::NoTip: + ui->rightArrow->setCurrentText(""); + break; + case Style::Pointer: + ui->rightArrow->setCurrentText(">"); + break; + case Style::Flat: + ui->rightArrow->setCurrentText("|"); + break; + } } - ui->properties->setEnabled(true); - setPropertyModel(_activeEdgeStyle->data()); } else { setColor(ui->fillColor, QColor(Qt::gray)); setColor(ui->drawColor, QColor(Qt::gray)); @@ -529,18 +452,19 @@ void StyleEditor::on_name_editingFinished() if (s != 0) { s->setName(ui->name->text()); - _activeItem->setText(ui->name->text()); - refreshDisplay(); + refreshActiveStyle(); +// refreshDisplay(); _dirty = true; } } void StyleEditor::on_shape_currentTextChanged() { - if (_activeNodeStyle != 0) { - _activeNodeStyle->data()->setProperty("shape", ui->shape->currentText()); - _activeItem->setIcon(_activeNodeStyle->icon()); - refreshDisplay(); + Style *s = activeStyle(); + if (s != 0) { + s->data()->setProperty("shape", ui->shape->currentText()); + refreshActiveStyle(); +// refreshDisplay(); _dirty = true; } } @@ -572,8 +496,26 @@ QColor StyleEditor::color(QPushButton *btn) Style *StyleEditor::activeStyle() { - if (_activeNodeStyle != 0) return _activeNodeStyle; - else return _activeEdgeStyle; + if (_styles != nullptr) { + if (_nodeStyleIndex.isValid()) + return _styles->nodeStyles()->styleInCategory(_nodeStyleIndex.row()); + + if (_edgeStyleIndex.isValid()) + return _styles->edgeStyles()->styleInCategory(_edgeStyleIndex.row()); + } + + return nullptr; +} + +void StyleEditor::refreshActiveStyle() +{ + if (_styles != nullptr) { + if (_nodeStyleIndex.isValid()) + emit _styles->nodeStyles()->dataChanged(_nodeStyleIndex, _nodeStyleIndex); + + if (_edgeStyleIndex.isValid()) + emit _styles->edgeStyles()->dataChanged(_edgeStyleIndex, _edgeStyleIndex); + } } void StyleEditor::updateColor(QPushButton *btn, QString name, QString propName) @@ -583,17 +525,12 @@ void StyleEditor::updateColor(QPushButton *btn, QString name, QString propName) this, name, QColorDialog::DontUseNativeDialog); - if (col.isValid()) { - setColor(btn, col); - if (_activeNodeStyle != 0) { - _activeNodeStyle->data()->setProperty(propName, tikzit->nameForColor(col)); - _activeItem->setIcon(_activeNodeStyle->icon()); - } else if (_activeEdgeStyle != 0) { - _activeEdgeStyle->data()->setProperty(propName, tikzit->nameForColor(col)); - _activeItem->setIcon(_activeEdgeStyle->icon()); - } - - refreshDisplay(); + setColor(btn, col); + Style *s = activeStyle(); + if (s != nullptr) { + s->data()->setProperty(propName, tikzit->nameForColor(col)); + refreshActiveStyle(); +// refreshDisplay(); _dirty = true; } } diff --git a/src/gui/styleeditor.h b/src/gui/styleeditor.h index e40facd..fed2908 100644 --- a/src/gui/styleeditor.h +++ b/src/gui/styleeditor.h @@ -58,17 +58,16 @@ private: void setColor(QPushButton *btn, QColor col); void setPropertyModel(GraphElementData *d); QColor color(QPushButton *btn); - QStandardItemModel *_nodeModel; - QStandardItemModel *_edgeModel; - QStandardItem *_activeItem; - Style *_activeNodeStyle; - Style *_activeEdgeStyle; //QString _activeCategory; Style *activeStyle(); + void refreshActiveStyle(); TikzStyles *_styles; void updateColor(QPushButton *btn, QString name, QString propName); QVector _formWidgets; bool _dirty; + + QModelIndex _nodeStyleIndex; + QModelIndex _edgeStyleIndex; }; #endif // STYLEEDITOR_H -- cgit v1.2.3 From e0f973435c6cf24f4eefc9f767b8b6a957daf8ac Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 8 Oct 2018 08:51:13 +0200 Subject: fixed tikzstyles output --- src/data/stylelist.cpp | 3 ++- src/gui/styleeditor.cpp | 68 +++++++++++++++++++++++++++++++++++-------------- src/gui/styleeditor.h | 1 + 3 files changed, 52 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/data/stylelist.cpp b/src/data/stylelist.cpp index 2c79d10..c8baf3f 100644 --- a/src/data/stylelist.cpp +++ b/src/data/stylelist.cpp @@ -63,7 +63,8 @@ QString StyleList::tikz() { QString str; QTextStream code(&str); - foreach (Style *s, _styles) code << s->tikz() << "\n"; + for (int i = 1; i < _styles.length(); ++i) + code << _styles[i]->tikz() << "\n"; code.flush(); return str; } diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index e3f8ace..06bb718 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -19,6 +19,7 @@ StyleEditor::StyleEditor(QWidget *parent) : ui->properties; _styles = nullptr; + _activeStyle = nullptr; ui->styleListView->setViewMode(QListView::IconMode); ui->styleListView->setMovement(QListView::Static); @@ -80,6 +81,7 @@ StyleEditor::~StyleEditor() void StyleEditor::open() { if (_styles != nullptr) delete _styles; _styles = new TikzStyles; + _activeStyle = nullptr; ui->styleListView->setModel(_styles->nodeStyles()); ui->edgeStyleListView->setModel(_styles->edgeStyles()); connect(ui->styleListView->selectionModel(), @@ -127,8 +129,7 @@ void StyleEditor::nodeItemChanged(QModelIndex sel) { if (sel.isValid()) { ui->edgeStyleListView->selectionModel()->clear(); - qDebug() << "active style:" << ((activeStyle() == nullptr) ? "null" : activeStyle()->tikz()); - qDebug() << "style from index:" << _styles->nodeStyles()->styleInCategory(sel.row())->tikz(); + _activeStyle = _styles->nodeStyles()->styleInCategory(sel.row()); } _nodeStyleIndex = sel; refreshDisplay(); @@ -138,7 +139,7 @@ void StyleEditor::edgeItemChanged(QModelIndex sel) { if (sel.isValid()) { ui->styleListView->selectionModel()->clear(); - //_nodeStyleIndex = QModelIndex(); + _activeStyle = _styles->edgeStyles()->styleInCategory(sel.row()); } _edgeStyleIndex = sel; refreshDisplay(); @@ -150,17 +151,43 @@ void StyleEditor::categoryChanged() QString cat = ui->category->currentText(); //qDebug() << "got category: " << cat; - if (s != 0 && s->data()->property("tikzit category") != cat) { + if (s != nullptr && s->data()->property("tikzit category") != cat) { if (cat.isEmpty()) s->data()->unsetProperty("tikzit category"); else s->data()->setProperty("tikzit category", cat); _dirty = true; refreshCategories(); - refreshDisplay(); + + if (_styles->nodeStyles()->category() != "") { + ui->currentCategory->setCurrentText(cat); + //qDebug() << "after cat change, cat reports:" << _styles->nodeStyles()->category(); + } + //refreshDisplay(); } } void StyleEditor::currentCategoryChanged() { + if (_styles != nullptr) { + QString cat = ui->currentCategory->currentText(); + qDebug() << "got category:" << cat; + qDebug() << "node style category:" << _styles->nodeStyles()->category(); + if (cat != _styles->nodeStyles()->category()) { + ui->styleListView->selectionModel()->clear(); + _styles->nodeStyles()->setCategory(cat); + + if (_activeStyle != nullptr && !_activeStyle->isEdgeStyle()) { + for (int i = 0; i < _styles->nodeStyles()->numInCategory(); ++i) { + if (_styles->nodeStyles()->styleInCategory(i) == _activeStyle) { + ui->styleListView->selectionModel()->setCurrentIndex( + _styles->nodeStyles()->index(i), + QItemSelectionModel::ClearAndSelect); + break; + } + } + if (!_nodeStyleIndex.isValid()) _activeStyle = nullptr; + } + } + } } void StyleEditor::refreshCategories() @@ -187,13 +214,16 @@ void StyleEditor::refreshCategories() void StyleEditor::propertyChanged() { - QModelIndexList nSel = ui->styleListView->selectionModel()->selectedRows(); - QModelIndexList eSel = ui->edgeStyleListView->selectionModel()->selectedRows(); - if (!nSel.isEmpty()) { - emit _styles->nodeStyles()->dataChanged(nSel[0], nSel[0]); - refreshCategories(); - } else if (!eSel.isEmpty()) { - emit _styles->edgeStyles()->dataChanged(eSel[0], eSel[0]); + if (_nodeStyleIndex.isValid()) { + emit _styles->nodeStyles()->dataChanged(_nodeStyleIndex, _nodeStyleIndex); + + if (_activeStyle->category() != _styles->nodeStyles()->category()) { + refreshCategories(); + if (_styles->nodeStyles()->category() != "") + ui->currentCategory->setCurrentText(_activeStyle->category()); + } + } else if (_edgeStyleIndex.isValid()) { + emit _styles->edgeStyles()->dataChanged(_edgeStyleIndex, _edgeStyleIndex); } _dirty = true; refreshDisplay(); @@ -496,15 +526,15 @@ QColor StyleEditor::color(QPushButton *btn) Style *StyleEditor::activeStyle() { - if (_styles != nullptr) { - if (_nodeStyleIndex.isValid()) - return _styles->nodeStyles()->styleInCategory(_nodeStyleIndex.row()); +// if (_styles != nullptr) { +// if (_nodeStyleIndex.isValid()) +// return _styles->nodeStyles()->styleInCategory(_nodeStyleIndex.row()); - if (_edgeStyleIndex.isValid()) - return _styles->edgeStyles()->styleInCategory(_edgeStyleIndex.row()); - } +// if (_edgeStyleIndex.isValid()) +// return _styles->edgeStyles()->styleInCategory(_edgeStyleIndex.row()); +// } - return nullptr; + return _activeStyle; } void StyleEditor::refreshActiveStyle() diff --git a/src/gui/styleeditor.h b/src/gui/styleeditor.h index fed2908..f9caf9c 100644 --- a/src/gui/styleeditor.h +++ b/src/gui/styleeditor.h @@ -68,6 +68,7 @@ private: QModelIndex _nodeStyleIndex; QModelIndex _edgeStyleIndex; + Style *_activeStyle; }; #endif // STYLEEDITOR_H -- cgit v1.2.3 From 59f92c45fd751aeb7811ca68d76d3af4ee72a9c4 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 8 Oct 2018 14:14:54 +0200 Subject: anchor to center --- src/gui/mainwindow.cpp | 22 +++++++++++++++-- src/gui/styleeditor.cpp | 45 +++++++++++++++++++++++++++++++++-- src/gui/styleeditor.h | 2 ++ src/gui/stylepalette.cpp | 7 ++++++ src/gui/stylepalette.h | 1 + src/gui/stylepalette.ui | 62 +++++++++++++++++++++++++++--------------------- src/gui/tikzview.cpp | 3 ++- src/gui/toolpalette.cpp | 1 + 8 files changed, 111 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index f9743a1..cdf7bea 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -23,6 +23,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + QSettings settings("tikzit", "tikzit"); _windowId = _numWindows; _numWindows++; ui->setupUi(this); @@ -36,8 +37,6 @@ MainWindow::MainWindow(QWidget *parent) : addToolBar(_toolPalette); _stylePalette = new StylePalette(this); - addDockWidget(Qt::RightDockWidgetArea, _stylePalette); - resizeDocks({_stylePalette}, {130}, Qt::Horizontal); _tikzScene = new TikzScene(_tikzDocument, _toolPalette, _stylePalette, this); ui->tikzView->setScene(_tikzScene); @@ -48,6 +47,20 @@ MainWindow::MainWindow(QWidget *parent) : setMenuBar(_menu); + QVariant geom = settings.value("geometry-main"); + QVariant state = settings.value("windowState-main"); + + if (geom.isValid()) { + restoreGeometry(geom.toByteArray()); + } + + if (state.isValid()) { + restoreState(state.toByteArray(), 2); + } else { + addDockWidget(Qt::RightDockWidgetArea, _stylePalette); + resizeDocks({_stylePalette}, {130}, Qt::Horizontal); + } + // initially, the source view should be collapsed QList sz = ui->splitter->sizes(); sz[0] = sz[0] + sz[1]; @@ -90,6 +103,11 @@ QSplitter *MainWindow::splitter() const { void MainWindow::closeEvent(QCloseEvent *event) { qDebug() << "got close event"; + + QSettings settings("tikzit", "tikzit"); + settings.setValue("geometry-main", saveGeometry()); + settings.setValue("windowState-main", saveState(2)); + QMainWindow::closeEvent(event); } diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index 06bb718..36ae93a 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -442,6 +442,39 @@ void StyleEditor::on_propertyDown_clicked() } } +void StyleEditor::on_addStyle_clicked() +{ + int i = 0; + + // get a fresh name + QString name; + while (true) { + name = QString("new style ") + QString::number(i); + if (_styles->nodeStyles()->style(name) == nullptr) break; + ++i; + } + + // add the style to the current category + Style *s; + if (_styles->nodeStyles()->category() == "") { + s = new Style(name, new GraphElementData()); + } else { + s = new Style(name, + new GraphElementData({ + GraphElementProperty("category",_styles->nodeStyles()->category()) + })); + } + _styles->nodeStyles()->addStyle(s); + + // set dirty flag and select the newly-added style + _dirty = true; +// ui->styleListView->selectionModel()->clear(); +// ui->edgeStyleListView->selectionModel()->clear(); + ui->styleListView->selectionModel()->setCurrentIndex( + _styles->nodeStyles()->index(_styles->nodeStyles()->numInCategory()-1), + QItemSelectionModel::ClearAndSelect); +} + void StyleEditor::on_save_clicked() { save(); @@ -540,11 +573,19 @@ Style *StyleEditor::activeStyle() void StyleEditor::refreshActiveStyle() { if (_styles != nullptr) { - if (_nodeStyleIndex.isValid()) + if (_nodeStyleIndex.isValid()) { emit _styles->nodeStyles()->dataChanged(_nodeStyleIndex, _nodeStyleIndex); - if (_edgeStyleIndex.isValid()) + // force a re-layout + ui->styleListView->setGridSize(QSize(48,48)); + } + + if (_edgeStyleIndex.isValid()) { emit _styles->edgeStyles()->dataChanged(_edgeStyleIndex, _edgeStyleIndex); + + // force a re-layout + ui->edgeStyleListView->setGridSize(QSize(48,48)); + } } } diff --git a/src/gui/styleeditor.h b/src/gui/styleeditor.h index f9caf9c..bc548f0 100644 --- a/src/gui/styleeditor.h +++ b/src/gui/styleeditor.h @@ -48,6 +48,8 @@ public slots: void on_propertyUp_clicked(); void on_propertyDown_clicked(); + void on_addStyle_clicked(); + void on_save_clicked(); void on_currentCategory_currentIndexChanged(int); diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 953d9d5..5e6de43 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -174,3 +174,10 @@ void StylePalette::closeEvent(QCloseEvent *event) settings.setValue("style-palette-geometry", saveGeometry()); QDockWidget::closeEvent(event); } + +void StylePalette::resizeEvent(QResizeEvent *event) +{ + QDockWidget::resizeEvent(event); + ui->styleListView->setGridSize(QSize(48,48)); + ui->edgeStyleListView->setGridSize(QSize(48,48)); +} diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index 7cdef0c..b76aa03 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -56,6 +56,7 @@ private: protected: void closeEvent(QCloseEvent *event) override; + void resizeEvent(QResizeEvent *event) override; }; #endif // STYLEPALETTE_H diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui index abba648..39e796b 100644 --- a/src/gui/stylepalette.ui +++ b/src/gui/stylepalette.ui @@ -32,10 +32,28 @@ false - + Styles + + + + + 0 + 0 + + + + + true + + + + [default] + + + @@ -44,19 +62,6 @@ 0 - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -99,21 +104,21 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - - 0 - 0 - - - - [default] - - - @@ -131,6 +136,9 @@ Qt::ScrollBarAlwaysOff + + QListView::Adjust + diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 0f1dc30..3f107be 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -25,6 +25,7 @@ TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) { setRenderHint(QPainter::Antialiasing); + setResizeAnchor(QGraphicsView::AnchorViewCenter); //setDragMode(QGraphicsView::RubberBandDrag); _scale = 1.0f; @@ -45,7 +46,7 @@ void TikzView::zoomOut() void TikzView::setScene(QGraphicsScene *scene) { QGraphicsView::setScene(scene); - centerOn(QPointF(0.0f,-230.0f)); + centerOn(QPointF(0.0f,0.0f)); } void TikzView::drawBackground(QPainter *painter, const QRectF &rect) diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index c0e2a22..2452bda 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -31,6 +31,7 @@ ToolPalette::ToolPalette(QWidget *parent) : | Qt::WindowDoesNotAcceptFocus); setOrientation(Qt::Vertical); setFocusPolicy(Qt::NoFocus); + setWindowTitle("Tools"); //setGeometry(100,200,30,195); tools = new QActionGroup(this); -- cgit v1.2.3 From 38582ebd4b974150cbe446ac92c9a4a7024f5f09 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 9 Oct 2018 10:33:08 +0200 Subject: style editor is finished --- src/data/stylelist.cpp | 35 ++++++++++ src/data/stylelist.h | 6 ++ src/gui/styleeditor.cpp | 182 ++++++++++++++++++++++++++++++++++++++++++------ src/gui/styleeditor.h | 14 ++++ 4 files changed, 217 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/data/stylelist.cpp b/src/data/stylelist.cpp index c8baf3f..14302c7 100644 --- a/src/data/stylelist.cpp +++ b/src/data/stylelist.cpp @@ -41,6 +41,13 @@ void StyleList::addStyle(Style *s) } } +void StyleList::removeNthStyle(int n) +{ + beginRemoveRows(QModelIndex(), n, n); + _styles.remove(nthInCategory(n)); + endRemoveRows(); +} + void StyleList::clear() { int n = numInCategory(); @@ -113,6 +120,34 @@ int StyleList::rowCount(const QModelIndex &/*parent*/) const return numInCategory(); } +bool StyleList::moveRows(const QModelIndex &sourceParent, + int sourceRow, + int /*count*/, + const QModelIndex &destinationParent, + int destinationRow) +{ + if (sourceRow >= 1 && sourceRow < numInCategory() && + destinationRow >= 1 && destinationRow <= numInCategory()) + { + beginMoveRows(sourceParent, sourceRow, sourceRow, destinationParent, destinationRow); + int sourceIndex = nthInCategory(sourceRow); + int destinationIndex = nthInCategory(destinationRow); + if (destinationIndex == -1) + destinationIndex = _styles.length(); + Style *s = _styles[sourceIndex]; + _styles.remove(sourceIndex); + if (sourceIndex < destinationIndex) { + _styles.insert(destinationIndex - 1, s); + } else { + _styles.insert(destinationIndex, s); + } + endMoveRows(); + return true; + } else { + return false; + } +} + QString StyleList::category() const { return _category; diff --git a/src/data/stylelist.h b/src/data/stylelist.h index f698761..eb1c43a 100644 --- a/src/data/stylelist.h +++ b/src/data/stylelist.h @@ -14,6 +14,7 @@ public: Style *style(int i); int length() const; void addStyle(Style *s); + void removeNthStyle(int n); void clear(); QString tikz(); @@ -23,6 +24,11 @@ public: QVariant data(const QModelIndex &index, int role) const override; int rowCount(const QModelIndex &/*parent*/) const override; + bool moveRows(const QModelIndex &sourceParent, + int sourceRow, + int /*count*/, + const QModelIndex &destinationParent, + int destinationChild); QString category() const; diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index 36ae93a..63d347b 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -18,6 +18,7 @@ StyleEditor::StyleEditor(QWidget *parent) : ui->leftArrow << ui->rightArrow << ui->properties; + setWindowIcon(QIcon(":/images/logo.png")); _styles = nullptr; _activeStyle = nullptr; @@ -92,7 +93,7 @@ void StyleEditor::open() { this, SLOT(edgeItemChanged(QModelIndex))); if (_styles->loadStyles(tikzit->styleFilePath())) { - _dirty = false; + setDirty(false); refreshCategories(); refreshDisplay(); show(); @@ -105,7 +106,7 @@ void StyleEditor::open() { void StyleEditor::closeEvent(QCloseEvent *event) { - if (_dirty) { + if (dirty()) { QMessageBox::StandardButton resBtn = QMessageBox::question( this, "Save Changes", "Do you wish to save changes to " + tikzit->styleFile() + "?", @@ -113,7 +114,7 @@ void StyleEditor::closeEvent(QCloseEvent *event) QMessageBox::Yes); if (resBtn == QMessageBox::Yes) { - // TODO save here + save(); event->accept(); } else if (resBtn == QMessageBox::No) { event->accept(); @@ -127,6 +128,7 @@ void StyleEditor::closeEvent(QCloseEvent *event) void StyleEditor::nodeItemChanged(QModelIndex sel) { + qDebug() << "nodeItemChanged, new index:" << sel.row(); if (sel.isValid()) { ui->edgeStyleListView->selectionModel()->clear(); _activeStyle = _styles->nodeStyles()->styleInCategory(sel.row()); @@ -154,7 +156,7 @@ void StyleEditor::categoryChanged() if (s != nullptr && s->data()->property("tikzit category") != cat) { if (cat.isEmpty()) s->data()->unsetProperty("tikzit category"); else s->data()->setProperty("tikzit category", cat); - _dirty = true; + setDirty(true); refreshCategories(); if (_styles->nodeStyles()->category() != "") { @@ -225,7 +227,7 @@ void StyleEditor::propertyChanged() } else if (_edgeStyleIndex.isValid()) { emit _styles->edgeStyles()->dataChanged(_edgeStyleIndex, _edgeStyleIndex); } - _dirty = true; + setDirty(true); refreshDisplay(); } @@ -385,7 +387,7 @@ void StyleEditor::on_addProperty_clicked() Style *s = activeStyle(); if (s != 0) { s->data()->add(GraphElementProperty("new property", "")); - _dirty = true; + setDirty(true); } } @@ -394,7 +396,7 @@ void StyleEditor::on_addAtom_clicked() Style *s = activeStyle(); if (s != 0) { s->data()->add(GraphElementProperty("new atom")); - _dirty = true; + setDirty(true); } } @@ -405,7 +407,7 @@ void StyleEditor::on_removeProperty_clicked() QModelIndexList sel = ui->properties->selectionModel()->selectedRows(); if (!sel.isEmpty()) { s->data()->removeRows(sel[0].row(), 1, sel[0].parent()); - _dirty = true; + setDirty(true); } } } @@ -421,7 +423,7 @@ void StyleEditor::on_propertyUp_clicked() sel[0].row(), 1, sel[0].parent(), sel[0].row() - 1); - _dirty = true; + setDirty(true); } } } @@ -437,7 +439,7 @@ void StyleEditor::on_propertyDown_clicked() sel[0].row(), 1, sel[0].parent(), sel[0].row() + 2); - _dirty = true; + setDirty(true); } } } @@ -467,12 +469,123 @@ void StyleEditor::on_addStyle_clicked() _styles->nodeStyles()->addStyle(s); // set dirty flag and select the newly-added style - _dirty = true; -// ui->styleListView->selectionModel()->clear(); -// ui->edgeStyleListView->selectionModel()->clear(); - ui->styleListView->selectionModel()->setCurrentIndex( - _styles->nodeStyles()->index(_styles->nodeStyles()->numInCategory()-1), - QItemSelectionModel::ClearAndSelect); + setDirty(true); + selectNodeStyle(_styles->nodeStyles()->numInCategory()-1); +} + +void StyleEditor::on_removeStyle_clicked() +{ + if (_nodeStyleIndex.isValid()) { + int i = _nodeStyleIndex.row(); + if (i > 0) { + ui->styleListView->selectionModel()->clear(); + _styles->nodeStyles()->removeNthStyle(i); + setDirty(true); + if (i < _styles->nodeStyles()->numInCategory()) { + selectNodeStyle(i); + } + } + } +} + +void StyleEditor::on_styleUp_clicked() +{ + if (_nodeStyleIndex.isValid()) { + int r = _nodeStyleIndex.row(); + if (_styles->nodeStyles()->moveRows( + _nodeStyleIndex.parent(), + r, 1, + _nodeStyleIndex.parent(), + r - 1)) + { + setDirty(true); + nodeItemChanged(_styles->nodeStyles()->index(r - 1)); + } + } +} + +void StyleEditor::on_styleDown_clicked() +{ + if (_nodeStyleIndex.isValid()) { + int r = _nodeStyleIndex.row(); + if (_styles->nodeStyles()->moveRows( + _nodeStyleIndex.parent(), + r, 1, + _nodeStyleIndex.parent(), + r + 2)) + { + setDirty(true); + nodeItemChanged(_styles->nodeStyles()->index(r + 1)); + } + } +} + +void StyleEditor::on_addEdgeStyle_clicked() +{ + int i = 0; + + // get a fresh name + QString name; + while (true) { + name = QString("new edge style ") + QString::number(i); + if (_styles->edgeStyles()->style(name) == nullptr) break; + ++i; + } + + // add the style (edge styles only have one category: "") + Style *s = new Style(name, new GraphElementData({GraphElementProperty("-")})); + _styles->edgeStyles()->addStyle(s); + + // set dirty flag and select the newly-added style + setDirty(true); + selectEdgeStyle(_styles->edgeStyles()->numInCategory()-1); +} + +void StyleEditor::on_removeEdgeStyle_clicked() +{ + if (_edgeStyleIndex.isValid()) { + int i = _edgeStyleIndex.row(); + if (i > 0) { + ui->edgeStyleListView->selectionModel()->clear(); + _styles->edgeStyles()->removeNthStyle(i); + setDirty(true); + if (i < _styles->edgeStyles()->numInCategory()) { + selectEdgeStyle(i); + } + } + } +} + +void StyleEditor::on_edgeStyleUp_clicked() +{ + if (_edgeStyleIndex.isValid()) { + int r = _edgeStyleIndex.row(); + if (_styles->edgeStyles()->moveRows( + _edgeStyleIndex.parent(), + r, 1, + _edgeStyleIndex.parent(), + r - 1)) + { + setDirty(true); + edgeItemChanged(_styles->edgeStyles()->index(r - 1)); + } + } +} + +void StyleEditor::on_edgeStyleDown_clicked() +{ + if (_edgeStyleIndex.isValid()) { + int r = _edgeStyleIndex.row(); + if (_styles->edgeStyles()->moveRows( + _edgeStyleIndex.parent(), + r, 1, + _edgeStyleIndex.parent(), + r + 2)) + { + setDirty(true); + edgeItemChanged(_styles->edgeStyles()->index(r + 1)); + } + } } void StyleEditor::on_save_clicked() @@ -492,7 +605,7 @@ void StyleEditor::save() QString p = tikzit->styleFilePath(); if (_styles->saveStyles(p)) { - _dirty = false; + setDirty(false); tikzit->loadStyles(p); } else { QMessageBox::warning(0, @@ -517,7 +630,7 @@ void StyleEditor::on_name_editingFinished() s->setName(ui->name->text()); refreshActiveStyle(); // refreshDisplay(); - _dirty = true; + setDirty(true); } } @@ -528,7 +641,7 @@ void StyleEditor::on_shape_currentTextChanged() s->data()->setProperty("shape", ui->shape->currentText()); refreshActiveStyle(); // refreshDisplay(); - _dirty = true; + setDirty(true); } } @@ -602,6 +715,35 @@ void StyleEditor::updateColor(QPushButton *btn, QString name, QString propName) s->data()->setProperty(propName, tikzit->nameForColor(col)); refreshActiveStyle(); // refreshDisplay(); - _dirty = true; + setDirty(true); + } +} + +void StyleEditor::selectNodeStyle(int i) +{ + ui->styleListView->selectionModel()->setCurrentIndex( + _styles->nodeStyles()->index(i), + QItemSelectionModel::ClearAndSelect); +} + +void StyleEditor::selectEdgeStyle(int i) +{ + ui->edgeStyleListView->selectionModel()->setCurrentIndex( + _styles->edgeStyles()->index(i), + QItemSelectionModel::ClearAndSelect); +} + +bool StyleEditor::dirty() const +{ + return _dirty; +} + +void StyleEditor::setDirty(bool dirty) +{ + _dirty = dirty; + if (dirty) { + setWindowTitle("Style Editor* - TikZiT"); + } else { + setWindowTitle("Style Editor - TikZiT"); } } diff --git a/src/gui/styleeditor.h b/src/gui/styleeditor.h index bc548f0..b8bf646 100644 --- a/src/gui/styleeditor.h +++ b/src/gui/styleeditor.h @@ -24,6 +24,9 @@ public: void save(); void closeEvent(QCloseEvent *event) override; + bool dirty() const; + void setDirty(bool dirty); + public slots: void refreshDisplay(); void nodeItemChanged(QModelIndex sel); @@ -49,6 +52,14 @@ public slots: void on_propertyDown_clicked(); void on_addStyle_clicked(); + void on_removeStyle_clicked(); + void on_styleUp_clicked(); + void on_styleDown_clicked(); + + void on_addEdgeStyle_clicked(); + void on_removeEdgeStyle_clicked(); + void on_edgeStyleUp_clicked(); + void on_edgeStyleDown_clicked(); void on_save_clicked(); @@ -65,6 +76,9 @@ private: void refreshActiveStyle(); TikzStyles *_styles; void updateColor(QPushButton *btn, QString name, QString propName); + void selectNodeStyle(int i); + void selectEdgeStyle(int i); + QVector _formWidgets; bool _dirty; -- cgit v1.2.3 From 6ead01f547f14604e9cf999c146d0cbb59386735 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 9 Oct 2018 16:19:48 +0200 Subject: fixed bug when there are no styles --- src/data/stylelist.cpp | 2 +- tikzlexer.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/data/stylelist.cpp b/src/data/stylelist.cpp index 14302c7..bc2ef37 100644 --- a/src/data/stylelist.cpp +++ b/src/data/stylelist.cpp @@ -51,7 +51,7 @@ void StyleList::removeNthStyle(int n) void StyleList::clear() { int n = numInCategory(); - if (n > 0) { + if (n > 1) { beginRemoveRows(QModelIndex(), 1, n - 1); _styles.clear(); if (_edgeStyles) _styles << noneEdgeStyle; diff --git a/tikzlexer.h b/tikzlexer.h index 438947f..8169c03 100644 --- a/tikzlexer.h +++ b/tikzlexer.h @@ -2,9 +2,9 @@ #define yyHEADER_H 1 #define yyIN_HEADER 1 -#line 6 "tikzlexer.h" +#line 5 "tikzlexer.h" -#line 8 "tikzlexer.h" +#line 7 "tikzlexer.h" #define YY_INT_ALIGNED short int @@ -259,7 +259,7 @@ void yyfree ( void * , yyscan_t yyscanner ); */ #include #endif - + #define YY_EXTRA_TYPE TikzAssembler * int yylex_init (yyscan_t* scanner); @@ -518,8 +518,8 @@ extern int yylex \ #undef yyTABLES_NAME #endif -#line 195 "src/data/tikzlexer.l" +#line 195 "src\\data\\tikzlexer.l" -#line 524 "tikzlexer.h" +#line 523 "tikzlexer.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ -- cgit v1.2.3 From f70f809b9f8fc940edcdfedb4f3bdf21fd82773b Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Wed, 10 Oct 2018 07:51:10 +0200 Subject: fixed edit icon --- images/Inkscape_icons_draw_calligraphic.svg | 201 ---- images/Inkscape_icons_draw_ellipse.svg | 117 -- images/Inkscape_icons_draw_path.svg | 177 --- images/Inkscape_icons_draw_rectangle.svg | 95 -- images/Inkscape_icons_edit_select_all.svg | 1513 -------------------------- images/Inkscape_icons_node_segment_curve.svg | 50 - images/text-x-generic_with_pencil.svg | 531 +++++++++ src/gui/stylepalette.ui | 20 +- tikzit.qrc | 7 +- 9 files changed, 551 insertions(+), 2160 deletions(-) delete mode 100644 images/Inkscape_icons_draw_calligraphic.svg delete mode 100644 images/Inkscape_icons_draw_ellipse.svg delete mode 100644 images/Inkscape_icons_draw_path.svg delete mode 100644 images/Inkscape_icons_draw_rectangle.svg delete mode 100644 images/Inkscape_icons_edit_select_all.svg delete mode 100644 images/Inkscape_icons_node_segment_curve.svg create mode 100644 images/text-x-generic_with_pencil.svg (limited to 'src') diff --git a/images/Inkscape_icons_draw_calligraphic.svg b/images/Inkscape_icons_draw_calligraphic.svg deleted file mode 100644 index e1b3352..0000000 --- a/images/Inkscape_icons_draw_calligraphic.svg +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/images/Inkscape_icons_draw_ellipse.svg b/images/Inkscape_icons_draw_ellipse.svg deleted file mode 100644 index 26c4446..0000000 --- a/images/Inkscape_icons_draw_ellipse.svg +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/images/Inkscape_icons_draw_path.svg b/images/Inkscape_icons_draw_path.svg deleted file mode 100644 index b7cb2db..0000000 --- a/images/Inkscape_icons_draw_path.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/images/Inkscape_icons_draw_rectangle.svg b/images/Inkscape_icons_draw_rectangle.svg deleted file mode 100644 index 7504d56..0000000 --- a/images/Inkscape_icons_draw_rectangle.svg +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff --git a/images/Inkscape_icons_edit_select_all.svg b/images/Inkscape_icons_edit_select_all.svg deleted file mode 100644 index 0da2e0b..0000000 --- a/images/Inkscape_icons_edit_select_all.svg +++ /dev/null @@ -1,1513 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/images/Inkscape_icons_node_segment_curve.svg b/images/Inkscape_icons_node_segment_curve.svg deleted file mode 100644 index fad6969..0000000 --- a/images/Inkscape_icons_node_segment_curve.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/images/text-x-generic_with_pencil.svg b/images/text-x-generic_with_pencil.svg new file mode 100644 index 0000000..558adf6 --- /dev/null +++ b/images/text-x-generic_with_pencil.svg @@ -0,0 +1,531 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui index 39e796b..14a4d36 100644 --- a/src/gui/stylepalette.ui +++ b/src/gui/stylepalette.ui @@ -74,6 +74,12 @@ :/images/document-open.svg:/images/document-open.svg + + + 16 + 16 + + @@ -86,7 +92,13 @@ - :/images/document-new.svg:/images/document-new.svg + :/images/text-x-generic_with_pencil.svg:/images/text-x-generic_with_pencil.svg + + + + 16 + 16 + @@ -102,6 +114,12 @@ :/images/refresh.svg:/images/refresh.svg + + + 16 + 16 + + diff --git a/tikzit.qrc b/tikzit.qrc index b3852aa..cf212fe 100644 --- a/tikzit.qrc +++ b/tikzit.qrc @@ -1,11 +1,5 @@ - images/draw-ellipse.png - images/draw-path.png - images/select-rectangular.png - images/transform-crop-and-resize.png - images/document-new.png - images/document-open.png images/document-new.svg images/document-open.svg images/edge-ak.svg @@ -13,6 +7,7 @@ images/select-ak.svg images/refresh.svg images/logo.png + images/text-x-generic_with_pencil.svg qt.conf -- cgit v1.2.3 From dd59a5c4b8b0eadf223a7e4b3fa0cc8bd99375f9 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Wed, 10 Oct 2018 08:10:35 +0200 Subject: wrong edge --- images/edge-ak.svg | 36 ++++++++++++++++++++++++++++ images/edge.svg | 64 ------------------------------------------------- src/gui/mainwindow.cpp | 2 +- src/gui/toolpalette.cpp | 1 + 4 files changed, 38 insertions(+), 65 deletions(-) create mode 100644 images/edge-ak.svg delete mode 100644 images/edge.svg (limited to 'src') diff --git a/images/edge-ak.svg b/images/edge-ak.svg new file mode 100644 index 0000000..eafc423 --- /dev/null +++ b/images/edge-ak.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/edge.svg b/images/edge.svg deleted file mode 100644 index 43280f8..0000000 --- a/images/edge.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index cdf7bea..b0ffdc6 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -102,7 +102,7 @@ QSplitter *MainWindow::splitter() const { void MainWindow::closeEvent(QCloseEvent *event) { - qDebug() << "got close event"; + //qDebug() << "got close event"; QSettings settings("tikzit", "tikzit"); settings.setValue("geometry-main", saveGeometry()); diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 2452bda..3d65369 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -32,6 +32,7 @@ ToolPalette::ToolPalette(QWidget *parent) : setOrientation(Qt::Vertical); setFocusPolicy(Qt::NoFocus); setWindowTitle("Tools"); + setObjectName("toolPalette"); //setGeometry(100,200,30,195); tools = new QActionGroup(this); -- cgit v1.2.3 From 1ecc46ee977805418faae3d1c57aefc828203d95 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Wed, 10 Oct 2018 11:03:49 +0200 Subject: maybe a fix for DPI --- src/data/tikzdocument.cpp | 39 +++++++++++++++++++++++++++++---------- src/data/tikzdocument.h | 4 ++-- src/gui/mainwindow.cpp | 22 ++++++++++++++++++++-- src/gui/mainwindow.ui | 2 +- src/main.cpp | 24 ++++++++++++++++++++++-- src/tikzit.cpp | 8 ++++++-- 6 files changed, 80 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index fd70e92..2554c21 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -98,9 +98,9 @@ void TikzDocument::open(QString fileName) } } -void TikzDocument::save() { +bool TikzDocument::save() { if (_fileName == "") { - saveAs(); + return saveAs(); } else { MainWindow *win = tikzit->activeWindow(); if (win != 0 && !win->tikzScene()->enabled()) { @@ -110,7 +110,7 @@ void TikzDocument::save() { tr("Tikz failed to parse"), tr("Cannot save file with invalid TiKZ source. Revert changes and save?")); if (resp == QMessageBox::Yes) win->tikzScene()->setEnabled(true); - else return; // ABORT the save + else return false; // ABORT the save } } @@ -126,10 +126,13 @@ void TikzDocument::save() { stream << _tikz; file.close(); setClean(); + return true; } else { QMessageBox::warning(0, "Save Failed", "Could not open file: '" + _fileName + "' for writing."); } } + + return false; } bool TikzDocument::isClean() const @@ -148,7 +151,7 @@ void TikzDocument::setGraph(Graph *graph) refreshTikz(); } -void TikzDocument::saveAs() { +bool TikzDocument::saveAs() { MainWindow *win = tikzit->activeWindow(); if (win != 0 && !win->tikzScene()->enabled()) { win->tikzScene()->parseTikz(win->tikzSource()); @@ -157,23 +160,39 @@ void TikzDocument::saveAs() { tr("Tikz failed to parse"), tr("Cannot save file with invalid TiKZ source. Revert changes and save?")); if (resp == QMessageBox::Yes) win->tikzScene()->setEnabled(true); - else return; // ABORT the save + else return false; // ABORT the save } } QSettings settings("tikzit", "tikzit"); + +// QFileDialog dialog; +// dialog.setDefaultSuffix("tikz"); +// dialog.setWindowTitle(tr("Save File As")); +// dialog.setAcceptMode(QFileDialog::AcceptSave); +// dialog.setNameFilter(tr("TiKZ Files (*.tikz)")); +// dialog.setFileMode(QFileDialog::AnyFile); +// dialog.setDirectory(settings.value("previous-file-path").toString()); +// dialog.setOption(QFileDialog::DontUseNativeDialog); + QString fileName = QFileDialog::getSaveFileName(tikzit->activeWindow(), tr("Save File As"), settings.value("previous-file-path").toString(), - tr("TiKZ Files (*.tikz)")); + tr("TiKZ Files (*.tikz)"), + nullptr, + QFileDialog::DontUseNativeDialog); if (!fileName.isEmpty()) { +// QString fileName = dialog.selectedFiles()[0]; _fileName = fileName; - save(); - - // clean state might not change, so update title bar manually - tikzit->activeWindow()->updateFileName(); + if (save()) { + // clean state might not change, so update title bar manually + tikzit->activeWindow()->updateFileName(); + return true; + } } + + return false; } QString TikzDocument::shortName() const diff --git a/src/data/tikzdocument.h b/src/data/tikzdocument.h index 773f369..fca5434 100644 --- a/src/data/tikzdocument.h +++ b/src/data/tikzdocument.h @@ -47,8 +47,8 @@ public: QString shortName() const; - void saveAs(); - void save(); + bool saveAs(); + bool save(); bool isClean() const; void setClean(); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index b0ffdc6..479d8ed 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -108,7 +108,25 @@ void MainWindow::closeEvent(QCloseEvent *event) settings.setValue("geometry-main", saveGeometry()); settings.setValue("windowState-main", saveState(2)); - QMainWindow::closeEvent(event); + if (!_tikzDocument->isClean()) { + QString nm = _tikzDocument->shortName(); + if (nm.isEmpty()) nm = "untitled"; + QMessageBox::StandardButton resBtn = QMessageBox::question( + this, "Save Changes", + "Do you wish to save changes to " + nm + "?", + QMessageBox::Cancel | QMessageBox::No | QMessageBox::Yes, + QMessageBox::Yes); + + if (resBtn == QMessageBox::Yes && _tikzDocument->save()) { + event->accept(); + } else if (resBtn == QMessageBox::No) { + event->accept(); + } else { + event->ignore(); + } + } else { + event->accept(); + } } void MainWindow::changeEvent(QEvent *event) @@ -144,7 +162,7 @@ void MainWindow::updateFileName() QString nm = _tikzDocument->shortName(); if (nm.isEmpty()) nm = "untitled"; if (!_tikzDocument->isClean()) nm += "*"; - setWindowTitle("TiKZiT - " + nm); + setWindowTitle(nm + " - TikZiT"); } void MainWindow::refreshTikz() diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index 8eff5ee..27e0127 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -17,7 +17,7 @@ - TikZiT - untitled + untitled - TikZiT diff --git a/src/main.cpp b/src/main.cpp index 9ad40ae..ac8ab13 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,6 +27,9 @@ #include #include +#include +#include +#include // #ifdef Q_OS_WIN // #include @@ -37,13 +40,30 @@ int main(int argc, char *argv[]) // #ifdef Q_OS_WIN // SetProcessDPIAware(); // #endif - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - //QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + + // dummy application for detecting DPI + QApplication *a0 = new QApplication(argc, argv); + qDebug() << "physical DPI" << QApplication::screens()[0]->physicalDotsPerInch(); + + if (QApplication::screens()[0]->physicalDotsPerInch() >= 100) { + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + } else { + QApplication::setAttribute(Qt::AA_DisableHighDpiScaling); + } + + delete a0; + QApplication a(argc, argv); a.setQuitOnLastWindowClosed(false); + + + tikzit = new Tikzit(); tikzit->init(); + + if (a.arguments().length() > 1) { tikzit->open(a.arguments()[1]); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 967d76e..c649969 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -181,7 +181,9 @@ void Tikzit::open() QString fileName = QFileDialog::getOpenFileName(0, tr("Open File"), settings.value("previous-file-path").toString(), - tr("TiKZ Files (*.tikz)")); + tr("TiKZ Files (*.tikz)"), + nullptr, + QFileDialog::DontUseNativeDialog); open(fileName); } @@ -210,7 +212,9 @@ void Tikzit::openTikzStyles() { QString fileName = QFileDialog::getOpenFileName(0, tr("Open File"), settings.value("previous-tikzstyles-path").toString(), - tr("TiKZ Style Files (*.tikzstyles)")); + tr("TiKZ Style Files (*.tikzstyles)"), + nullptr, + QFileDialog::DontUseNativeDialog); if (!fileName.isEmpty()) { QFileInfo fi(fileName); -- cgit v1.2.3 From 23fa72f5f7ce1f19c0698bfe888bfd872703e9f2 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Wed, 10 Oct 2018 22:35:42 +0200 Subject: tikz extension for save as --- src/data/tikzdocument.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index 2554c21..24a793b 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -166,24 +166,24 @@ bool TikzDocument::saveAs() { QSettings settings("tikzit", "tikzit"); -// QFileDialog dialog; -// dialog.setDefaultSuffix("tikz"); -// dialog.setWindowTitle(tr("Save File As")); -// dialog.setAcceptMode(QFileDialog::AcceptSave); -// dialog.setNameFilter(tr("TiKZ Files (*.tikz)")); -// dialog.setFileMode(QFileDialog::AnyFile); -// dialog.setDirectory(settings.value("previous-file-path").toString()); -// dialog.setOption(QFileDialog::DontUseNativeDialog); - - QString fileName = QFileDialog::getSaveFileName(tikzit->activeWindow(), - tr("Save File As"), - settings.value("previous-file-path").toString(), - tr("TiKZ Files (*.tikz)"), - nullptr, - QFileDialog::DontUseNativeDialog); - - if (!fileName.isEmpty()) { -// QString fileName = dialog.selectedFiles()[0]; + QFileDialog dialog; + dialog.setDefaultSuffix("tikz"); + dialog.setWindowTitle(tr("Save File As")); + dialog.setAcceptMode(QFileDialog::AcceptSave); + dialog.setNameFilter(tr("TiKZ Files (*.tikz)")); + dialog.setFileMode(QFileDialog::AnyFile); + dialog.setDirectory(settings.value("previous-file-path").toString()); + dialog.setOption(QFileDialog::DontUseNativeDialog); + +// QString fileName = QFileDialog::getSaveFileName(tikzit->activeWindow(), +// tr("Save File As"), +// settings.value("previous-file-path").toString(), +// tr("TiKZ Files (*.tikz)"), +// nullptr, +// QFileDialog::DontUseNativeDialog); + + if (dialog.exec() && !dialog.selectedFiles().isEmpty()) { + QString fileName = dialog.selectedFiles()[0]; _fileName = fileName; if (save()) { // clean state might not change, so update title bar manually -- cgit v1.2.3 From 4eb599dfd4e8c510ede62be3ef766af9d9b5121a Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 11 Oct 2018 08:19:26 +0200 Subject: removed unused icons --- images/node.svg | 39 --------------------- images/select.svg | 90 ------------------------------------------------- src/gui/stylepalette.ui | 19 ++++++++++- 3 files changed, 18 insertions(+), 130 deletions(-) delete mode 100644 images/node.svg delete mode 100644 images/select.svg (limited to 'src') diff --git a/images/node.svg b/images/node.svg deleted file mode 100644 index 0a34687..0000000 --- a/images/node.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/images/select.svg b/images/select.svg deleted file mode 100644 index 80b7757..0000000 --- a/images/select.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui index 14a4d36..eb97474 100644 --- a/src/gui/stylepalette.ui +++ b/src/gui/stylepalette.ui @@ -50,7 +50,7 @@ - [default] + [no style file] @@ -62,6 +62,23 @@ 0 + + + + + + + + :/images/document-new.svg:/images/document-new.svg + + + + 16 + 16 + + + + -- cgit v1.2.3 From 68921d37da4f2268af5006c0aed68d70ee7b6dff Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 11 Oct 2018 08:33:30 +0200 Subject: icons renamed for clarity --- images/edge-ak.svg | 36 ------ images/logo.ico | Bin 14347 -> 0 bytes images/logo.pdf | Bin 1991 -> 0 bytes images/logo.png | Bin 17595 -> 0 bytes images/logo.svg | 268 ------------------------------------------ images/node-ak.svg | 14 --- images/select-ak.svg | 9 -- images/tikzit-tool-edge.svg | 36 ++++++ images/tikzit-tool-node.svg | 14 +++ images/tikzit-tool-select.svg | 9 ++ images/tikzit.pdf | Bin 0 -> 1991 bytes images/tikzit.png | Bin 0 -> 17595 bytes images/tikzit.svg | 268 ++++++++++++++++++++++++++++++++++++++++++ src/gui/mainwindow.cpp | 2 +- src/gui/styleeditor.cpp | 2 +- src/gui/toolpalette.cpp | 6 +- tikzit.qrc | 8 +- 17 files changed, 336 insertions(+), 336 deletions(-) delete mode 100644 images/edge-ak.svg delete mode 100644 images/logo.ico delete mode 100644 images/logo.pdf delete mode 100644 images/logo.png delete mode 100644 images/logo.svg delete mode 100644 images/node-ak.svg delete mode 100644 images/select-ak.svg create mode 100644 images/tikzit-tool-edge.svg create mode 100644 images/tikzit-tool-node.svg create mode 100644 images/tikzit-tool-select.svg create mode 100644 images/tikzit.pdf create mode 100644 images/tikzit.png create mode 100644 images/tikzit.svg (limited to 'src') diff --git a/images/edge-ak.svg b/images/edge-ak.svg deleted file mode 100644 index eafc423..0000000 --- a/images/edge-ak.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/images/logo.ico b/images/logo.ico deleted file mode 100644 index ef92c90..0000000 Binary files a/images/logo.ico and /dev/null differ diff --git a/images/logo.pdf b/images/logo.pdf deleted file mode 100644 index 1fe8a28..0000000 Binary files a/images/logo.pdf and /dev/null differ diff --git a/images/logo.png b/images/logo.png deleted file mode 100644 index 000d172..0000000 Binary files a/images/logo.png and /dev/null differ diff --git a/images/logo.svg b/images/logo.svg deleted file mode 100644 index 5fb38c6..0000000 --- a/images/logo.svg +++ /dev/null @@ -1,268 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/images/node-ak.svg b/images/node-ak.svg deleted file mode 100644 index 3bad649..0000000 --- a/images/node-ak.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/images/select-ak.svg b/images/select-ak.svg deleted file mode 100644 index 0f95547..0000000 --- a/images/select-ak.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/images/tikzit-tool-edge.svg b/images/tikzit-tool-edge.svg new file mode 100644 index 0000000..eafc423 --- /dev/null +++ b/images/tikzit-tool-edge.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/tikzit-tool-node.svg b/images/tikzit-tool-node.svg new file mode 100644 index 0000000..3bad649 --- /dev/null +++ b/images/tikzit-tool-node.svg @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/images/tikzit-tool-select.svg b/images/tikzit-tool-select.svg new file mode 100644 index 0000000..0f95547 --- /dev/null +++ b/images/tikzit-tool-select.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/images/tikzit.pdf b/images/tikzit.pdf new file mode 100644 index 0000000..1fe8a28 Binary files /dev/null and b/images/tikzit.pdf differ diff --git a/images/tikzit.png b/images/tikzit.png new file mode 100644 index 0000000..000d172 Binary files /dev/null and b/images/tikzit.png differ diff --git a/images/tikzit.svg b/images/tikzit.svg new file mode 100644 index 0000000..5fb38c6 --- /dev/null +++ b/images/tikzit.svg @@ -0,0 +1,268 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 479d8ed..806d634 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -28,7 +28,7 @@ MainWindow::MainWindow(QWidget *parent) : _numWindows++; ui->setupUi(this); - setWindowIcon(QIcon(":/images/logo.png")); + setWindowIcon(QIcon(":/images/tikzit.png")); setAttribute(Qt::WA_DeleteOnClose, true); _tikzDocument = new TikzDocument(this); diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index 63d347b..40706ff 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -18,7 +18,7 @@ StyleEditor::StyleEditor(QWidget *parent) : ui->leftArrow << ui->rightArrow << ui->properties; - setWindowIcon(QIcon(":/images/logo.png")); + setWindowIcon(QIcon(":/images/tikzit.png")); _styles = nullptr; _activeStyle = nullptr; diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 3d65369..5e93963 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -42,9 +42,9 @@ ToolPalette::ToolPalette(QWidget *parent) : // edge = new QAction(QIcon(":/images/Inkscape_icons_draw_path.svg"), "Add Edge"); // crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); - select = new QAction(QIcon(":/images/select-ak.svg"), "Select"); - vertex = new QAction(QIcon(":/images/node-ak.svg"), "Add Vertex"); - edge = new QAction(QIcon(":/images/edge-ak.svg"), "Add Edge"); + select = new QAction(QIcon(":/images/tikzit-tool-select.svg"), "Select"); + vertex = new QAction(QIcon(":/images/tikzit-tool-node.svg"), "Add Vertex"); + edge = new QAction(QIcon(":/images/tikzit-tool-edge.svg"), "Add Edge"); //crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); diff --git a/tikzit.qrc b/tikzit.qrc index cf212fe..0484c2d 100644 --- a/tikzit.qrc +++ b/tikzit.qrc @@ -2,11 +2,11 @@ images/document-new.svg images/document-open.svg - images/edge-ak.svg - images/node-ak.svg - images/select-ak.svg + images/tikzit-tool-edge.svg + images/tikzit-tool-node.svg + images/tikzit-tool-select.svg images/refresh.svg - images/logo.png + images/tikzit.png images/text-x-generic_with_pencil.svg -- cgit v1.2.3 From d83ee761d8f93def60199932462baee818c2c1eb Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 11 Oct 2018 13:34:08 +0200 Subject: can now create new tikzstyles --- src/gui/stylepalette.cpp | 7 ++++++- src/gui/stylepalette.h | 1 + src/tikzit.cpp | 37 +++++++++++++++++++++++++++++++++++-- src/tikzit.h | 1 + 4 files changed, 43 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 5e6de43..1fad721 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -137,7 +137,12 @@ void StylePalette::nodeStyleDoubleClicked(const QModelIndex &) void StylePalette::edgeStyleDoubleClicked(const QModelIndex &) { - tikzit->activeWindow()->tikzScene()->applyActiveStyleToEdges(); + tikzit->activeWindow()->tikzScene()->applyActiveStyleToEdges(); +} + +void StylePalette::on_buttonNewTikzstyles_clicked() +{ + tikzit->newTikzStyles(); } void StylePalette::on_buttonOpenTikzstyles_clicked() diff --git a/src/gui/stylepalette.h b/src/gui/stylepalette.h index b76aa03..e83f961 100644 --- a/src/gui/stylepalette.h +++ b/src/gui/stylepalette.h @@ -43,6 +43,7 @@ public: public slots: void nodeStyleDoubleClicked(const QModelIndex &); void edgeStyleDoubleClicked(const QModelIndex &); + void on_buttonNewTikzstyles_clicked(); void on_buttonOpenTikzstyles_clicked(); void on_buttonEditTikzstyles_clicked(); void on_buttonRefreshTikzstyles_clicked(); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index c649969..2210f3a 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -136,6 +136,41 @@ QString Tikzit::nameForColor(QColor col) "; blue," + QString::number(col.blue()); } +void Tikzit::newTikzStyles() +{ + QSettings settings("tikzit", "tikzit"); + QFileDialog dialog; + dialog.setDefaultSuffix("tikzstyles"); + dialog.setWindowTitle(tr("Create TikZ Style File")); + dialog.setAcceptMode(QFileDialog::AcceptSave); + dialog.setLabelText(QFileDialog::Accept, "Create"); + dialog.setNameFilter(tr("TiKZ Style File (*.tikzstyles)")); + dialog.setFileMode(QFileDialog::AnyFile); + dialog.setDirectory(settings.value("previous-file-path").toString()); + dialog.setOption(QFileDialog::DontUseNativeDialog); + + if (dialog.exec() && !dialog.selectedFiles().isEmpty()) { + QString fileName = dialog.selectedFiles()[0]; + TikzStyles *st = new TikzStyles; + + if (st->saveStyles(fileName)) { + QFileInfo fi(fileName); + _styleFile = fi.fileName(); + _styleFilePath = fi.absoluteFilePath(); + delete _styles; + _styles = st; + + foreach (MainWindow *w, _windows) { + w->tikzScene()->reloadStyles(); + } + } else { + QMessageBox::warning(0, + "Could not write to style file.", + "Could not write to: '" + fileName + "'. Check file permissions or choose a new location."); + } + } +} + ToolPalette *Tikzit::toolPalette() const { return _toolPalette; @@ -222,8 +257,6 @@ void Tikzit::openTikzStyles() { QSettings settings("tikzit", "tikzit"); settings.setValue("previous-tikzstyles-path", fi.absolutePath()); settings.setValue("previous-tikzstyles-file", fileName); - } else { - // BAD STYLE FILE } } } diff --git a/src/tikzit.h b/src/tikzit.h index 6612ff1..8980f17 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -121,6 +121,7 @@ public: QColor colorByName(QString name); QString nameForColor(QColor col); + void newTikzStyles(); void openTikzStyles(); bool loadStyles(QString fileName); void showStyleEditor(); -- cgit v1.2.3 From 0a0dd87c4b740a47bcb8c91fd3c711b9ddebfe8a Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 12 Oct 2018 15:36:31 +0200 Subject: added some override decls --- src/data/stylelist.h | 2 +- src/gui/edgeitem.h | 6 +++--- src/gui/mainwindow.h | 4 ++-- src/gui/nodeitem.h | 2 +- src/gui/propertypalette.h | 2 +- src/gui/stylepalette.cpp | 11 +++++++++-- src/gui/stylepalette.ui | 9 ++++++--- src/gui/tikzview.cpp | 6 ++++++ src/gui/tikzview.h | 2 +- src/gui/toolpalette.cpp | 6 +++--- src/tikzit.cpp | 2 +- tex/sample/sample.tex | 4 ++-- tikzit.pro | 1 + 13 files changed, 37 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/data/stylelist.h b/src/data/stylelist.h index eb1c43a..cf86c06 100644 --- a/src/data/stylelist.h +++ b/src/data/stylelist.h @@ -28,7 +28,7 @@ public: int sourceRow, int /*count*/, const QModelIndex &destinationParent, - int destinationChild); + int destinationChild) override; QString category() const; diff --git a/src/gui/edgeitem.h b/src/gui/edgeitem.h index 3d4758a..c03edd6 100644 --- a/src/gui/edgeitem.h +++ b/src/gui/edgeitem.h @@ -38,9 +38,9 @@ class EdgeItem : public QGraphicsItem public: EdgeItem(Edge *edge); void readPos(); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); - QRectF boundingRect() const; - QPainterPath shape() const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override; + QRectF boundingRect() const override; + QPainterPath shape() const override; Edge *edge() const; QGraphicsEllipseItem *cp1Item() const; QGraphicsEllipseItem *cp2Item() const; diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 10695b7..a000784 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -45,8 +45,8 @@ public slots: void updateFileName(); void refreshTikz(); protected: - void closeEvent(QCloseEvent *event); - void changeEvent(QEvent *event); + void closeEvent(QCloseEvent *event) override; + void changeEvent(QEvent *event) override; private: TikzScene *_tikzScene; diff --git a/src/gui/nodeitem.h b/src/gui/nodeitem.h index 678a7e8..5be4f3e 100644 --- a/src/gui/nodeitem.h +++ b/src/gui/nodeitem.h @@ -36,7 +36,7 @@ public: NodeItem(Node *node); void readPos(); void writePos(); - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override; QPainterPath shape() const override; QRectF boundingRect() const override; void updateBounds(); diff --git a/src/gui/propertypalette.h b/src/gui/propertypalette.h index 29fb0af..69f4515 100644 --- a/src/gui/propertypalette.h +++ b/src/gui/propertypalette.h @@ -38,7 +38,7 @@ public: ~PropertyPalette(); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event) override; private: Ui::PropertyPalette *ui; }; diff --git a/src/gui/stylepalette.cpp b/src/gui/stylepalette.cpp index 1fad721..af096c7 100644 --- a/src/gui/stylepalette.cpp +++ b/src/gui/stylepalette.cpp @@ -27,6 +27,7 @@ #include #include #include +#include StylePalette::StylePalette(QWidget *parent) : QDockWidget(parent), @@ -77,7 +78,7 @@ void StylePalette::reloadStyles() ui->currentCategory->clear(); // TODO: styleFile() should return invalid string if no style file loaded - if (f != "[default]") { + if (f != "[no styles]") { ui->currentCategory->addItems(tikzit->styles()->categories()); ui->currentCategory->setCurrentText(cat); } @@ -152,7 +153,13 @@ void StylePalette::on_buttonOpenTikzstyles_clicked() void StylePalette::on_buttonEditTikzstyles_clicked() { - tikzit->showStyleEditor(); + if (tikzit->styleFile() != "[no styles]") { + tikzit->showStyleEditor(); + } else { + QMessageBox::warning(0, + "No style file", + "You cannot edit styles until a style file is loaded. Either create a new style file or load an existing one."); + } } void StylePalette::on_buttonRefreshTikzstyles_clicked() diff --git a/src/gui/stylepalette.ui b/src/gui/stylepalette.ui index eb97474..94e8a7c 100644 --- a/src/gui/stylepalette.ui +++ b/src/gui/stylepalette.ui @@ -64,6 +64,9 @@ + + New Style File + @@ -82,7 +85,7 @@ - Load Styles + Load Style File @@ -102,7 +105,7 @@ - Edit styles + Edit Styles @@ -122,7 +125,7 @@ - Refresh styles + Refresh Styles diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 3f107be..6235993 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -132,6 +132,12 @@ void TikzView::wheelEvent(QWheelEvent *event) if (event->modifiers() & Qt::ShiftModifier) { event->setModifiers(Qt::NoModifier); QGraphicsView::wheelEvent(event); + } else if (event->modifiers() & Qt::ControlModifier) { + if (event->angleDelta().y() > 0) { + zoomIn(); + } else if (event->angleDelta().y() < 0) { + zoomOut(); + } } } diff --git a/src/gui/tikzview.h b/src/gui/tikzview.h index e13fe72..60c5841 100644 --- a/src/gui/tikzview.h +++ b/src/gui/tikzview.h @@ -44,7 +44,7 @@ public slots: void zoomOut(); void setScene(QGraphicsScene *scene); protected: - void drawBackground(QPainter *painter, const QRectF &rect); + void drawBackground(QPainter *painter, const QRectF &rect) override; void wheelEvent(QWheelEvent *event) override; private: float _scale; diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 5e93963..82b8ba0 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -42,9 +42,9 @@ ToolPalette::ToolPalette(QWidget *parent) : // edge = new QAction(QIcon(":/images/Inkscape_icons_draw_path.svg"), "Add Edge"); // crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); - select = new QAction(QIcon(":/images/tikzit-tool-select.svg"), "Select"); - vertex = new QAction(QIcon(":/images/tikzit-tool-node.svg"), "Add Vertex"); - edge = new QAction(QIcon(":/images/tikzit-tool-edge.svg"), "Add Edge"); + select = new QAction(QIcon(":/images/tikzit-tool-select.svg"), "Select (s)"); + vertex = new QAction(QIcon(":/images/tikzit-tool-node.svg"), "Add Vertex (v)"); + edge = new QAction(QIcon(":/images/tikzit-tool-edge.svg"), "Add Edge (e)"); //crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 2210f3a..76f9234 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -32,7 +32,7 @@ Tikzit *tikzit; // font to use for node labels QFont Tikzit::LABEL_FONT("Courrier", 9); -Tikzit::Tikzit() : _styleFile("[default]"), _activeWindow(0) +Tikzit::Tikzit() : _styleFile("[no styles]"), _activeWindow(0) { } diff --git a/tex/sample/sample.tex b/tex/sample/sample.tex index e957b1e..57ba88c 100644 --- a/tex/sample/sample.tex +++ b/tex/sample/sample.tex @@ -9,10 +9,10 @@ A centered tikz picture: \ctikzfig{fig} A tikz picture as part of mathematics: -\[ +\begin{equation} \tikzfig{fig} \ =\ \tikzfig{fig} -\] +\end{equation} \end{document} diff --git a/tikzit.pro b/tikzit.pro index e1d30ea..10e3706 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -6,6 +6,7 @@ QT += core gui widgets CONFIG += testcase +QMAKE_CXXFLAGS += -Wsuggest-override TARGET = tikzit TEMPLATE = app -- cgit v1.2.3 From b1cffdb16ca56905a2115aae715ef772f653992c Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 12 Oct 2018 17:57:51 +0200 Subject: fixed many glitches in style editor --- src/data/graphelementdata.cpp | 5 ++ src/data/graphelementdata.h | 1 + src/data/graphelementproperty.h | 1 - src/data/style.cpp | 17 ++++ src/data/style.h | 1 + src/gui/styleeditor.cpp | 169 +++++++++++++++++++++++++++++++--------- src/gui/styleeditor.h | 10 ++- src/main.cpp | 2 +- 8 files changed, 165 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/data/graphelementdata.cpp b/src/data/graphelementdata.cpp index b478842..810ebd6 100644 --- a/src/data/graphelementdata.cpp +++ b/src/data/graphelementdata.cpp @@ -96,6 +96,11 @@ QString GraphElementData::property(QString key) } } +bool GraphElementData::hasProperty(QString key) +{ + return (indexOfKey(key) != -1); +} + bool GraphElementData::atom(QString atom) { return (indexOfKey(atom) != -1); diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h index f48f228..23f0466 100644 --- a/src/data/graphelementdata.h +++ b/src/data/graphelementdata.h @@ -41,6 +41,7 @@ public: void setAtom(QString atom); void unsetAtom(QString atom); QString property(QString key); + bool hasProperty(QString key); bool atom(QString atom); int indexOfKey(QString key); bool removeRows(int row, int count, const QModelIndex &parent) override; diff --git a/src/data/graphelementproperty.h b/src/data/graphelementproperty.h index e9f82d0..4ebe104 100644 --- a/src/data/graphelementproperty.h +++ b/src/data/graphelementproperty.h @@ -53,7 +53,6 @@ private: QString _key; QString _value; bool _atom; - bool _keyMatch; }; #endif // GRAPHELEMENTPROPERTY_H diff --git a/src/data/style.cpp b/src/data/style.cpp index 7af95ca..d0f011d 100644 --- a/src/data/style.cpp +++ b/src/data/style.cpp @@ -106,6 +106,23 @@ QString Style::tikz() const return "\\tikzstyle{" + _name + "}=" + _data->tikz(); } +void Style::setArrowAtom(QString atom) +{ + _data->unsetAtom("-"); + _data->unsetAtom("->"); + _data->unsetAtom("-|"); + + _data->unsetAtom("<-"); + _data->unsetAtom("<->"); + _data->unsetAtom("<-|"); + + _data->unsetAtom("|-"); + _data->unsetAtom("|->"); + _data->unsetAtom("|-|"); + + _data->setAtom(atom); +} + void Style::setName(const QString &name) { _name = name; diff --git a/src/data/style.h b/src/data/style.h index 476af77..78e11dc 100644 --- a/src/data/style.h +++ b/src/data/style.h @@ -57,6 +57,7 @@ public: void setName(const QString &name); QString propertyWithDefault(QString prop, QString def, bool tikzitOverride=true) const; QString tikz() const; + void setArrowAtom(QString atom); // only relevant for node styles QColor fillColor(bool tikzitOverride=true) const; diff --git a/src/gui/styleeditor.cpp b/src/gui/styleeditor.cpp index 40706ff..29192d6 100644 --- a/src/gui/styleeditor.cpp +++ b/src/gui/styleeditor.cpp @@ -37,6 +37,13 @@ StyleEditor::StyleEditor(QWidget *parent) : SIGNAL(currentIndexChanged(int)), this, SLOT(categoryChanged())); + connect(ui->shape->lineEdit(), + SIGNAL(editingFinished()), + this, SLOT(shapeChanged())); + connect(ui->shape, + SIGNAL(currentIndexChanged(int)), + this, SLOT(shapeChanged())); + // setup the color dialog to display only the named colors that tikzit/xcolor knows // about as "standard colors". for (int i = 0; i < 48; ++i) { @@ -128,7 +135,7 @@ void StyleEditor::closeEvent(QCloseEvent *event) void StyleEditor::nodeItemChanged(QModelIndex sel) { - qDebug() << "nodeItemChanged, new index:" << sel.row(); + //qDebug() << "nodeItemChanged, new index:" << sel.row(); if (sel.isValid()) { ui->edgeStyleListView->selectionModel()->clear(); _activeStyle = _styles->nodeStyles()->styleInCategory(sel.row()); @@ -171,8 +178,6 @@ void StyleEditor::currentCategoryChanged() { if (_styles != nullptr) { QString cat = ui->currentCategory->currentText(); - qDebug() << "got category:" << cat; - qDebug() << "node style category:" << _styles->nodeStyles()->category(); if (cat != _styles->nodeStyles()->category()) { ui->styleListView->selectionModel()->clear(); _styles->nodeStyles()->setCategory(cat); @@ -192,6 +197,17 @@ void StyleEditor::currentCategoryChanged() } } +void StyleEditor::shapeChanged() +{ + Style *s = activeStyle(); + if (s != 0) { + s->data()->setProperty("shape", ui->shape->currentText()); + refreshActiveStyle(); + refreshDisplay(); + setDirty(true); + } +} + void StyleEditor::refreshCategories() { ui->currentCategory->blockSignals(true); @@ -233,9 +249,8 @@ void StyleEditor::propertyChanged() void StyleEditor::refreshDisplay() { - // disable all fields and block signals while we set their values + // enable all fields and block signals while we set their values foreach (QWidget *w, _formWidgets) { - w->setEnabled(false); w->blockSignals(true); } @@ -259,7 +274,10 @@ void StyleEditor::refreshDisplay() Style *s = activeStyle(); +// qDebug() << "style" << s; if (s != nullptr && !s->isNone()) { +// qDebug() << "non-null style update"; + // name ui->name->setEnabled(true); ui->name->setText(s->name()); @@ -275,7 +293,7 @@ void StyleEditor::refreshDisplay() setColor(ui->drawColor, realDraw); // tikzit draw - bool drawOverride = realDraw != draw; + bool drawOverride = s->data()->hasProperty("tikzit draw"); ui->hasTikzitDrawColor->setEnabled(true); ui->hasTikzitDrawColor->setChecked(drawOverride); @@ -283,6 +301,7 @@ void StyleEditor::refreshDisplay() if (drawOverride) setColor(ui->tikzitDrawColor, draw); if (!s->isEdgeStyle()) { +// qDebug() << "node style update"; // category ui->category->setEnabled(true); ui->category->setCurrentText( @@ -295,7 +314,7 @@ void StyleEditor::refreshDisplay() setColor(ui->fillColor, realFill); // tikzit fill - bool fillOverride = realFill != fill; + bool fillOverride = s->data()->hasProperty("tikzit fill"); ui->hasTikzitFillColor->setEnabled(true); ui->hasTikzitFillColor->setChecked(fillOverride); ui->tikzitFillColor->setEnabled(fillOverride); @@ -308,15 +327,22 @@ void StyleEditor::refreshDisplay() ui->shape->setCurrentText(realShape); // tikzit shape - bool shapeOverride = shape != realShape; + bool shapeOverride = s->data()->hasProperty("tikzit shape"); ui->hasTikzitShape->setEnabled(true); + ui->hasTikzitShape->setChecked(shapeOverride); ui->tikzitShape->setEnabled(shapeOverride); if (shapeOverride) ui->tikzitShape->setCurrentText(shape); } else { +// qDebug() << "edge style update"; + // set fill to gray (disabled) - setColor(ui->fillColor, QColor(Qt::gray)); - setColor(ui->tikzitFillColor, QColor(Qt::gray)); - ui->hasTikzitFillColor->setChecked(false); + ui->fillColor->setEnabled(false); + ui->tikzitFillColor->setEnabled(false); + ui->hasTikzitFillColor->setEnabled(false); + + ui->shape->setEnabled(false); + ui->tikzitShape->setEnabled(false); + ui->hasTikzitShape->setEnabled(false); // arrow tail @@ -350,10 +376,11 @@ void StyleEditor::refreshDisplay() } } else { - setColor(ui->fillColor, QColor(Qt::gray)); - setColor(ui->drawColor, QColor(Qt::gray)); - setColor(ui->tikzitDrawColor, QColor(Qt::gray)); - setColor(ui->tikzitFillColor, QColor(Qt::gray)); +// qDebug() << "null style update"; + + foreach (QWidget *w, _formWidgets) { + w->setEnabled(false); + } } // unblock signals so we are ready for user input @@ -382,10 +409,78 @@ void StyleEditor::on_tikzitDrawColor_clicked() updateColor(ui->tikzitDrawColor, "TikZiT Draw Color", "tikzit draw"); } +void StyleEditor::on_hasTikzitFillColor_stateChanged(int state) +{ + Style *s = activeStyle(); + if (s != nullptr) { + if (state == Qt::Checked) s->data()->setProperty("tikzit fill", s->data()->property("fill")); + else s->data()->unsetProperty("tikzit fill"); + refreshDisplay(); + setDirty(true); + } +} + +void StyleEditor::on_hasTikzitDrawColor_stateChanged(int state) +{ + Style *s = activeStyle(); + if (s != nullptr) { + if (state == Qt::Checked) s->data()->setProperty("tikzit draw", s->data()->property("draw")); + else s->data()->unsetProperty("tikzit draw"); + refreshDisplay(); + setDirty(true); + } +} + +void StyleEditor::on_hasTikzitShape_stateChanged(int state) +{ + Style *s = activeStyle(); + if (s != nullptr) { + if (state == Qt::Checked) s->data()->setProperty("tikzit shape", s->data()->property("shape")); + else s->data()->unsetProperty("tikzit shape"); + refreshDisplay(); + setDirty(true); + } +} + +void StyleEditor::on_tikzitShape_currentIndexChanged(int) +{ + Style *s = activeStyle(); + if (s != nullptr) { + s->data()->setProperty("tikzit shape", ui->tikzitShape->currentText()); + refreshActiveStyle(); + refreshDisplay(); + setDirty(true); + } +} + +void StyleEditor::on_leftArrow_currentIndexChanged(int) +{ + Style *s = activeStyle(); + if (s != nullptr) { + s->setArrowAtom(ui->leftArrow->currentText() + "-" + + ui->rightArrow->currentText()); + refreshActiveStyle(); + refreshDisplay(); + setDirty(true); + } +} + +void StyleEditor::on_rightArrow_currentIndexChanged(int) +{ + Style *s = activeStyle(); + if (s != nullptr) { + s->setArrowAtom(ui->leftArrow->currentText() + "-" + + ui->rightArrow->currentText()); + refreshActiveStyle(); + refreshDisplay(); + setDirty(true); + } +} + void StyleEditor::on_addProperty_clicked() { Style *s = activeStyle(); - if (s != 0) { + if (s != nullptr) { s->data()->add(GraphElementProperty("new property", "")); setDirty(true); } @@ -459,12 +554,18 @@ void StyleEditor::on_addStyle_clicked() // add the style to the current category Style *s; if (_styles->nodeStyles()->category() == "") { - s = new Style(name, new GraphElementData()); + s = new Style(name, new GraphElementData({ + GraphElementProperty("fill", "white"), + GraphElementProperty("draw", "black"), + GraphElementProperty("shape", "circle") + })); } else { - s = new Style(name, - new GraphElementData({ - GraphElementProperty("category",_styles->nodeStyles()->category()) - })); + s = new Style(name, new GraphElementData({ + GraphElementProperty("fill", "white"), + GraphElementProperty("draw", "black"), + GraphElementProperty("shape", "circle"), + GraphElementProperty("category", _styles->nodeStyles()->category()), + })); } _styles->nodeStyles()->addStyle(s); @@ -634,16 +735,6 @@ void StyleEditor::on_name_editingFinished() } } -void StyleEditor::on_shape_currentTextChanged() -{ - Style *s = activeStyle(); - if (s != 0) { - s->data()->setProperty("shape", ui->shape->currentText()); - refreshActiveStyle(); -// refreshDisplay(); - setDirty(true); - } -} void StyleEditor::setColor(QPushButton *btn, QColor col) { @@ -709,13 +800,15 @@ void StyleEditor::updateColor(QPushButton *btn, QString name, QString propName) this, name, QColorDialog::DontUseNativeDialog); - setColor(btn, col); - Style *s = activeStyle(); - if (s != nullptr) { - s->data()->setProperty(propName, tikzit->nameForColor(col)); - refreshActiveStyle(); -// refreshDisplay(); - setDirty(true); + if (col.isValid()) { + setColor(btn, col); + Style *s = activeStyle(); + if (s != nullptr) { + s->data()->setProperty(propName, tikzit->nameForColor(col)); + refreshActiveStyle(); + refreshDisplay(); + setDirty(true); + } } } diff --git a/src/gui/styleeditor.h b/src/gui/styleeditor.h index b8bf646..4bae7db 100644 --- a/src/gui/styleeditor.h +++ b/src/gui/styleeditor.h @@ -33,17 +33,25 @@ public slots: void edgeItemChanged(QModelIndex sel); void categoryChanged(); void currentCategoryChanged(); + void shapeChanged(); void refreshCategories(); void propertyChanged(); void on_styleListView_clicked(); void on_edgeStyleListView_clicked(); void on_name_editingFinished(); - void on_shape_currentTextChanged(); void on_fillColor_clicked(); void on_drawColor_clicked(); void on_tikzitFillColor_clicked(); void on_tikzitDrawColor_clicked(); + void on_hasTikzitFillColor_stateChanged(int state); + void on_hasTikzitDrawColor_stateChanged(int state); + + void on_hasTikzitShape_stateChanged(int state); + void on_tikzitShape_currentIndexChanged(int); + + void on_leftArrow_currentIndexChanged(int); + void on_rightArrow_currentIndexChanged(int); void on_addProperty_clicked(); void on_addAtom_clicked(); diff --git a/src/main.cpp b/src/main.cpp index ac8ab13..2fa81d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) // dummy application for detecting DPI QApplication *a0 = new QApplication(argc, argv); - qDebug() << "physical DPI" << QApplication::screens()[0]->physicalDotsPerInch(); +// qDebug() << "physical DPI" << QApplication::screens()[0]->physicalDotsPerInch(); if (QApplication::screens()[0]->physicalDotsPerInch() >= 100) { QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -- cgit v1.2.3 From fd1205804345dbc3871723a7209c060b895ce4d0 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 13 Oct 2018 10:57:21 +0200 Subject: fixed tikzit not remembering style file location --- src/tikzit.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 76f9234..791aa83 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -157,6 +157,8 @@ void Tikzit::newTikzStyles() QFileInfo fi(fileName); _styleFile = fi.fileName(); _styleFilePath = fi.absoluteFilePath(); + settings.setValue("previous-tikzstyles-file", fileName); + settings.setValue("previous-tikzstyles-path", fi.absolutePath()); delete _styles; _styles = st; -- cgit v1.2.3 From c858c52819f0382c9996c95c8e135964f3e19d55 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 15 Oct 2018 14:18:19 +0200 Subject: explicit background colour --- src/gui/tikzview.cpp | 3 +++ src/main.cpp | 1 + 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/gui/tikzview.cpp b/src/gui/tikzview.cpp index 6235993..52a32cf 100644 --- a/src/gui/tikzview.cpp +++ b/src/gui/tikzview.cpp @@ -28,6 +28,8 @@ TikzView::TikzView(QWidget *parent) : QGraphicsView(parent) setResizeAnchor(QGraphicsView::AnchorViewCenter); //setDragMode(QGraphicsView::RubberBandDrag); + setBackgroundBrush(QBrush(Qt::white)); + _scale = 1.0f; } @@ -51,6 +53,7 @@ void TikzView::setScene(QGraphicsScene *scene) void TikzView::drawBackground(QPainter *painter, const QRectF &rect) { + QGraphicsView::drawBackground(painter, rect); // draw a gray background if disabled TikzScene *sc = static_cast(scene()); if (!sc->enabled()) painter->fillRect(rect, QBrush(QColor(240,240,240))); diff --git a/src/main.cpp b/src/main.cpp index 2fa81d1..99d23e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -63,6 +63,7 @@ int main(int argc, char *argv[]) tikzit = new Tikzit(); tikzit->init(); + qDebug() << a.arguments().length(); if (a.arguments().length() > 1) { -- cgit v1.2.3 From aa4cc700bd4380a6b22ec600d67b5cdbcd1d6ec1 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 15 Oct 2018 15:14:08 +0200 Subject: increased GUI spacing to accommodate larger font sizes (fixes #23) --- src/gui/styleeditor.ui | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/gui/styleeditor.ui b/src/gui/styleeditor.ui index f2c2437..9c06894 100644 --- a/src/gui/styleeditor.ui +++ b/src/gui/styleeditor.ui @@ -6,7 +6,7 @@ 0 0 - 580 + 608 517 @@ -29,7 +29,7 @@ 200 50 - 61 + 91 20 @@ -53,7 +53,7 @@ 200 80 - 61 + 91 20 @@ -77,7 +77,7 @@ 200 110 - 61 + 91 20 @@ -101,7 +101,7 @@ 200 140 - 61 + 91 20 @@ -123,7 +123,7 @@ - 270 + 300 50 301 20 @@ -138,7 +138,7 @@ - 270 + 300 80 301 22 @@ -156,7 +156,7 @@ - 270 + 300 110 31 18 @@ -178,7 +178,7 @@ - 270 + 300 140 31 18 @@ -200,9 +200,9 @@ - 390 + 420 110 - 71 + 91 17 @@ -219,9 +219,9 @@ - 390 + 420 140 - 71 + 91 17 @@ -238,7 +238,7 @@ - 460 + 510 110 31 18 @@ -257,7 +257,7 @@ - 460 + 510 140 31 18 @@ -278,7 +278,7 @@ 200 170 - 61 + 91 20 @@ -300,9 +300,9 @@ - 270 + 300 170 - 211 + 231 22 @@ -333,9 +333,9 @@ - 290 + 320 200 - 71 + 91 17 @@ -352,7 +352,7 @@ - 370 + 420 200 111 22 @@ -384,7 +384,7 @@ 200 230 - 61 + 91 20 @@ -406,7 +406,7 @@ - 270 + 300 230 41 22 @@ -439,7 +439,7 @@ - 320 + 350 230 16 21 @@ -457,7 +457,7 @@ - 340 + 370 230 41 22 @@ -492,7 +492,7 @@ 200 270 - 61 + 91 20 @@ -514,7 +514,7 @@ - 270 + 300 460 23 18 @@ -532,7 +532,7 @@ - 300 + 330 460 23 18 @@ -550,7 +550,7 @@ - 330 + 360 460 23 18 @@ -568,7 +568,7 @@ - 360 + 390 460 23 18 @@ -586,7 +586,7 @@ - 390 + 420 460 23 18 @@ -782,7 +782,7 @@ 479 490 - 91 + 121 20 @@ -798,7 +798,7 @@ - 270 + 300 270 301 181 -- cgit v1.2.3 From 882824e9a14dad61c8570ec9922b8389c6ab611b Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 16 Oct 2018 07:15:15 +0200 Subject: fixed colors --- src/tikzit.cpp | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 791aa83..5433577 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -43,31 +43,55 @@ void Tikzit::init() // 19 standard xcolor colours _colNames << "black" << - "gray" << - "darkgray" << + "darkgray" << + "gray" << "lightgray" << "white" << "red" << "orange" << "yellow" << - "lime" << + "green" << "blue" << "purple" << "brown" << "olive" << - "green" << - "teal" << - "cyan" << + "lime" << + "cyan" << + "teal" << "magenta" << "violet" << "pink"; - for (int i = 0; i < _colNames.length(); ++i) { - _cols << QColor(_colNames[i]); - } + _cols << + QColor::fromRgbF(0,0,0) << + QColor::fromRgbF(0.25,0.25,0.25) << + QColor::fromRgbF(0.5,0.5,0.5) << + QColor::fromRgbF(0.75,0.75,0.75) << + QColor::fromRgbF(1,1,1) << + + QColor::fromRgbF(1,0,0) << + QColor::fromRgbF(1,0.5,0) << + QColor::fromRgbF(1,1,0) << + QColor::fromRgbF(0,1,0) << + QColor::fromRgbF(0,0,1) << + QColor::fromRgbF(0.75,0,0.25) << + + QColor::fromRgbF(0.75,0.5,0.25) << + QColor::fromRgbF(0.5,0.5,0) << + QColor::fromRgbF(0.75,1,0) << + QColor::fromRgbF(0,1,1) << + QColor::fromRgbF(0,0.5,0.5) << + + QColor::fromRgbF(1,0,1) << + QColor::fromRgbF(0.5,0,0.5) << + QColor::fromRgbF(1,0.75,0.75); + +// for (int i = 0; i < _colNames.length(); ++i) { +// _cols << QColor(_colNames[i]); +// } _mainMenu = new MainMenu(); QMainWindow *dummy = new QMainWindow(); -- cgit v1.2.3 From 6e713caf5f8e96575650a0d4e1558488a910be7d Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 16 Oct 2018 07:16:14 +0200 Subject: fixed #19 --- src/tikzit.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 5433577..585e906 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -89,10 +89,6 @@ void Tikzit::init() QColor::fromRgbF(0.5,0,0.5) << QColor::fromRgbF(1,0.75,0.75); -// for (int i = 0; i < _colNames.length(); ++i) { -// _cols << QColor(_colNames[i]); -// } - _mainMenu = new MainMenu(); QMainWindow *dummy = new QMainWindow(); -- cgit v1.2.3 From 375621b09d85ee3430659c8278c8ebb56d9a4507 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 18 Oct 2018 11:27:52 +0200 Subject: added docks to View menu (closes #29) --- src/gui/mainmenu.cpp | 8 ++++++++ src/gui/mainmenu.h | 1 + src/gui/mainwindow.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index c159981..7d74fbe 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -26,6 +26,14 @@ MainMenu::MainMenu() ui.setupUi(this); } +void MainMenu::addDocks(QMenu *m) +{ + ui.menuView->addSeparator(); + foreach (QAction *a, m->actions()) { + if (!a->isSeparator()) ui.menuView->addAction(a); + } +} + // File void MainMenu::on_actionNew_triggered() { diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index c4079bf..82c447e 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -28,6 +28,7 @@ class MainMenu : public QMenuBar Q_OBJECT public: MainMenu(); + void addDocks(QMenu *m); private: Ui::MainMenu ui; diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 806d634..acbad69 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -44,7 +44,6 @@ MainWindow::MainWindow(QWidget *parent) : // TODO: check if each window should have a menu _menu = new MainMenu(); _menu->setParent(this); - setMenuBar(_menu); QVariant geom = settings.value("geometry-main"); @@ -70,6 +69,7 @@ MainWindow::MainWindow(QWidget *parent) : _tikzDocument->refreshTikz(); connect(_tikzDocument->undoStack(), SIGNAL(cleanChanged(bool)), this, SLOT(updateFileName())); + _menu->addDocks(createPopupMenu()); } MainWindow::~MainWindow() -- cgit v1.2.3 From 56b21f3107fb36edeed15544a30238e4f57b977c Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 20 Oct 2018 10:59:37 +0200 Subject: added mac target for qt 5.6 --- .travis.yml | 32 ++++-- src/gui/mainwindow.cpp | 6 ++ src/gui/mainwindow.ui | 3 - tikzit.pro | 7 +- tikzlexer.h | 257 ++++++++++++++++++++++++++++++++++--------------- 5 files changed, 209 insertions(+), 96 deletions(-) (limited to 'src') diff --git a/.travis.yml b/.travis.yml index 91e7272..98be8d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,21 +9,33 @@ matrix: compiler: clang env: - FILE=tikzit-osx.dmg - - os: linux - dist: trusty + - QTVER=511 + - os: osx + compiler: clang env: - - FILE=tikzit-linux.tar.gz - - PPA=beineri/opt-qt-5.10.1-trusty + - FILE=tikzit-osx-mountain.dmg + - QTVER=56 + # - os: linux + # dist: trusty + # env: + # - FILE=tikzit-linux.tar.gz + # - PPA=beineri/opt-qt-5.10.1-trusty before_install: - - '[[ "$TRAVIS_OS_NAME" != linux || -z "$PPA" ]] || sudo add-apt-repository -y ppa:$PPA' - - '[[ "$TRAVIS_OS_NAME" != linux ]] || sudo apt-get -qy update' + # - '[[ "$TRAVIS_OS_NAME" != linux || -z "$PPA" ]] || sudo add-apt-repository -y ppa:$PPA' + # - '[[ "$TRAVIS_OS_NAME" != linux ]] || sudo apt-get -qy update' + - '[[ "$TRAVIS_OS_NAME" != osx || "$QTVER" != 56 ]] || curl https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci > macports-ci' + - '[[ "$TRAVIS_OS_NAME" != osx || "$QTVER" != 56 ]] || source macports-ci install' + + install: - - '[[ "$TRAVIS_OS_NAME" != osx ]] || brew install qt5' - - '[[ "$TRAVIS_OS_NAME" != osx ]] || brew link --force qt5' - - '[[ "$TRAVIS_OS_NAME" != linux ]] || sudo apt-get -qy install qt510base qt510xmlpatterns' - - '[[ "$TRAVIS_OS_NAME" != linux ]] || . /opt/qt510/bin/qt510-env.sh' + - '[[ "$TRAVIS_OS_NAME" != osx || "$QTVER" != 511 ]] || brew install qt5' + - '[[ "$TRAVIS_OS_NAME" != osx || "$QTVER" != 511 ]] || brew link --force qt5' + - '[[ "$TRAVIS_OS_NAME" != osx || "$QTVER" != 56 ]] || sudo port -N -k install qt56' + - '[[ "$TRAVIS_OS_NAME" != osx || "$QTVER" != 56 ]] || export PATH=/opt/local/libexec/qt5/bin:$PATH' + # - '[[ "$TRAVIS_OS_NAME" != linux ]] || sudo apt-get -qy install qt510base qt510xmlpatterns' + # - '[[ "$TRAVIS_OS_NAME" != linux ]] || . /opt/qt510/bin/qt510-env.sh' script: - qmake -v diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index acbad69..d4d13b5 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -70,6 +70,12 @@ MainWindow::MainWindow(QWidget *parent) : connect(_tikzDocument->undoStack(), SIGNAL(cleanChanged(bool)), this, SLOT(updateFileName())); _menu->addDocks(createPopupMenu()); + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + ui->tikzSource->setTabStopDistance(20.0); +#else + ui->tikzSource->setTabStopWidth(20); +#endif } MainWindow::~MainWindow() diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index 27e0127..bedc695 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -62,9 +62,6 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Courier New'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.SF NS Text'; font-size:13pt;"><br /></p></body></html> - - 20.000000000000000 - diff --git a/tikzit.pro b/tikzit.pro index c0d8729..c4b8f84 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -31,9 +31,10 @@ win32:RC_ICONS += images/tikzdoc.ico macx:ICON = images/tikzit.icns # linux-g++:QMAKE_CXXFLAGS += -Wsuggest-override -#!versionAtLeast(QT_VERSION, 5.7.0) { -# macx:QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 -#} +# Qt 5.8 and above drop support for Mountain Lion +contains(QT_VERSION, ^5\\.[5-7].*) { + macx:QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 +} # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked as deprecated (the exact warnings diff --git a/tikzlexer.h b/tikzlexer.h index 5f18d12..438947f 100644 --- a/tikzlexer.h +++ b/tikzlexer.h @@ -2,9 +2,9 @@ #define yyHEADER_H 1 #define yyIN_HEADER 1 -#line 5 "tikzlexer.h" +#line 6 "tikzlexer.h" -#line 7 "tikzlexer.h" +#line 8 "tikzlexer.h" #define YY_INT_ALIGNED short int @@ -13,88 +13,34 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 3 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif - #define yy_create_buffer yy_create_buffer - - #define yy_delete_buffer yy_delete_buffer - - #define yy_scan_buffer yy_scan_buffer - - #define yy_scan_string yy_scan_string - - #define yy_scan_bytes yy_scan_bytes - - #define yy_init_buffer yy_init_buffer - - #define yy_flush_buffer yy_flush_buffer - - #define yy_load_buffer_state yy_load_buffer_state - - #define yy_switch_to_buffer yy_switch_to_buffer - - #define yypush_buffer_state yypush_buffer_state - - #define yypop_buffer_state yypop_buffer_state - - #define yyensure_buffer_stack yyensure_buffer_stack - - #define yylex yylex - - #define yyrestart yyrestart - - #define yylex_init yylex_init - - #define yylex_init_extra yylex_init_extra - - #define yylex_destroy yylex_destroy - - #define yyget_debug yyget_debug - - #define yyset_debug yyset_debug - - #define yyget_extra yyget_extra - - #define yyset_extra yyset_extra - - #define yyget_in yyget_in - - #define yyset_in yyset_in - - #define yyget_out yyget_out - - #define yyset_out yyset_out - - #define yyget_leng yyget_leng - - #define yyget_text yyget_text - - #define yyget_lineno yyget_lineno - - #define yyset_lineno yyset_lineno - - #define yyget_column yyget_column - - #define yyset_column yyset_column - - #define yywrap yywrap - - #define yyget_lval yyget_lval - - #define yyset_lval yyset_lval - - #define yyget_lloc yyget_lloc - - #define yyset_lloc yyset_lloc +#ifdef yyget_lval +#define yyget_lval_ALREADY_DEFINED +#else +#define yyget_lval yyget_lval +#endif - #define yyalloc yyalloc +#ifdef yyset_lval +#define yyset_lval_ALREADY_DEFINED +#else +#define yyset_lval yyset_lval +#endif - #define yyrealloc yyrealloc +#ifdef yyget_lloc +#define yyget_lloc_ALREADY_DEFINED +#else +#define yyget_lloc yyget_lloc +#endif - #define yyfree yyfree +#ifdef yyset_lloc +#define yyset_lloc_ALREADY_DEFINED +#else +#define yyset_lloc yyset_lloc +#endif /* First, we deal with platform-specific or compiler-specific issues. */ @@ -166,10 +112,16 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ +/* begin standard C++ headers. */ + /* TODO: this is always defined, so inline it */ #define yyconst const @@ -307,7 +259,7 @@ void yyfree ( void * , yyscan_t yyscanner ); */ #include #endif - + #define YY_EXTRA_TYPE TikzAssembler * int yylex_init (yyscan_t* scanner); @@ -421,8 +373,153 @@ extern int yylex \ #undef YY_DECL #endif -#line 195 "src\\data\\tikzlexer.l" +#ifndef yy_create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef yy_delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef yy_scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef yy_scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef yy_scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef yy_init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef yy_flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef yy_load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef yy_switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef yypush_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef yypop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef yyensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef yylex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef yyrestart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef yylex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef yylex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef yylex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef yyget_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef yyset_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef yyget_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef yyset_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef yyget_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef yyset_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef yyget_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef yyset_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef yyget_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef yyget_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef yyget_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef yyset_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef yyget_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef yyset_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef yywrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef yyget_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef yyset_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef yyget_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef yyset_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef yyalloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef yyrealloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef yyfree_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef yytext_ALREADY_DEFINED +#undef yytext +#endif +#ifndef yyleng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef yyin_ALREADY_DEFINED +#undef yyin +#endif +#ifndef yyout_ALREADY_DEFINED +#undef yyout +#endif +#ifndef yy_flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef yylineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef yytables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef yytables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef yyTABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 195 "src/data/tikzlexer.l" -#line 426 "tikzlexer.h" +#line 524 "tikzlexer.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ -- cgit v1.2.3 From 3f8e544a9062ebe956ba21e12ea8878ba3afb4ba Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 20 Oct 2018 11:38:07 +0200 Subject: removed new-style QAction constructors --- src/gui/toolpalette.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/toolpalette.cpp b/src/gui/toolpalette.cpp index 82b8ba0..d9ea05b 100644 --- a/src/gui/toolpalette.cpp +++ b/src/gui/toolpalette.cpp @@ -42,10 +42,12 @@ ToolPalette::ToolPalette(QWidget *parent) : // edge = new QAction(QIcon(":/images/Inkscape_icons_draw_path.svg"), "Add Edge"); // crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); - select = new QAction(QIcon(":/images/tikzit-tool-select.svg"), "Select (s)"); - vertex = new QAction(QIcon(":/images/tikzit-tool-node.svg"), "Add Vertex (v)"); - edge = new QAction(QIcon(":/images/tikzit-tool-edge.svg"), "Add Edge (e)"); - //crop = new QAction(QIcon(":/images/crop.svg"), "Bounding Box"); + select = new QAction("Select (s)", this); + select->setIcon(QIcon(":/images/tikzit-tool-select.svg")); + vertex = new QAction("Add Vertex (v)", this); + vertex->setIcon(QIcon(":/images/tikzit-tool-node.svg")); + edge = new QAction("Add Edge (e)", this); + edge->setIcon(QIcon(":/images/tikzit-tool-edge.svg")); tools->addAction(select); -- cgit v1.2.3 From c2fcad0f3fdaba6690258ad8d059f36c9eba95cb Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sat, 20 Oct 2018 14:46:45 +0200 Subject: added about box --- src/gui/mainmenu.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/gui/mainmenu.h | 6 ++++++ src/gui/mainmenu.ui | 28 ++++++++++++++++++++++++++++ src/gui/mainwindow.cpp | 5 +++++ src/gui/mainwindow.h | 2 ++ src/tikzit.cpp | 35 ++++++++++++++++++++++++++++++++++- src/tikzit.h | 10 +++++++--- tikzit.pro | 2 +- 8 files changed, 120 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index 7d74fbe..b530f58 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -20,10 +20,19 @@ #include "tikzit.h" #include +#include +#include MainMenu::MainMenu() { + QSettings settings("tikzit", "tikzit"); ui.setupUi(this); + + if (!settings.value("check-for-updates").isNull()) { + ui.actionCheck_for_updates_automatically->blockSignals(true); + ui.actionCheck_for_updates_automatically->setChecked(settings.value("check-for-updates").toBool()); + ui.actionCheck_for_updates_automatically->blockSignals(false); + } } void MainMenu::addDocks(QMenu *m) @@ -34,6 +43,11 @@ void MainMenu::addDocks(QMenu *m) } } +QAction *MainMenu::updatesAction() +{ + return ui.actionCheck_for_updates_automatically; +} + // File void MainMenu::on_actionNew_triggered() { @@ -225,3 +239,26 @@ void MainMenu::on_actionZoom_Out_triggered() { if (tikzit->activeWindow() != 0) tikzit->activeWindow()->tikzView()->zoomOut(); } + +void MainMenu::on_actionAbout_triggered() +{ + QMessageBox::about(this, + "TikZiT", + "

TikZiT

" + "

version " TIKZIT_VERSION "

" + "

TikZiT is a GUI diagram editor for PGF/TikZ. It is licensed under the " + "GNU General " + "Public License, version 3.0.

" + "

For more info and updates, visit: " + "tikzit.github.io

"); +} + +void MainMenu::on_actionCheck_for_updates_automatically_triggered() +{ + qDebug() << "check automatically:" << ui.actionCheck_for_updates_automatically->isChecked(); +} + +void MainMenu::on_actionCheck_now_triggered() +{ + qDebug() << "check now"; +} diff --git a/src/gui/mainmenu.h b/src/gui/mainmenu.h index 82c447e..c14a284 100644 --- a/src/gui/mainmenu.h +++ b/src/gui/mainmenu.h @@ -29,6 +29,7 @@ class MainMenu : public QMenuBar public: MainMenu(); void addDocks(QMenu *m); + QAction *updatesAction(); private: Ui::MainMenu ui; @@ -70,6 +71,11 @@ public slots: // View void on_actionZoom_In_triggered(); void on_actionZoom_Out_triggered(); + + // Help + void on_actionAbout_triggered(); + void on_actionCheck_for_updates_automatically_triggered(); + void on_actionCheck_now_triggered(); }; #endif // MAINMENU_H diff --git a/src/gui/mainmenu.ui b/src/gui/mainmenu.ui index d144fce..0481c1d 100644 --- a/src/gui/mainmenu.ui +++ b/src/gui/mainmenu.ui @@ -82,6 +82,15 @@
+ + + Help + + + + + + New... @@ -308,10 +317,29 @@ Ctrl+[ + + + true + + + Check for updates automatically + + + + + Check now + + + + + About + + +
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index d4d13b5..c450b5b 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -144,6 +144,11 @@ void MainWindow::changeEvent(QEvent *event) QMainWindow::changeEvent(event); } +MainMenu *MainWindow::menu() const +{ + return _menu; +} + StylePalette *MainWindow::stylePalette() const { return _stylePalette; diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index a000784..21fbd5a 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -40,6 +40,8 @@ public: QString tikzSource(); void setSourceLine(int line); + MainMenu *menu() const; + public slots: void on_tikzSource_textChanged(); void updateFileName(); diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 585e906..fc81739 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -106,7 +106,19 @@ void Tikzit::init() QString styleFile = settings.value("previous-tikzstyles-file").toString(); if (!styleFile.isEmpty()) loadStyles(styleFile); - //connect(app, &QApplication::focusChanged, this, &focusChanged); + QVariant check = settings.value("check-for-updates"); + if (check.isNull()) { + int resp = QMessageBox::question(0, + tr("Check for updates"), + tr("Would you like TikZiT to check for updates automatically?" + " (You can always change this later in the Help menu.)"), + QMessageBox::Yes | QMessageBox::Default, + QMessageBox::No, + QMessageBox::NoButton); + check.setValue(resp == QMessageBox::Yes); + } + + setCheckForUpdates(check.toBool()); } //QMenuBar *Tikzit::mainMenu() const @@ -327,6 +339,27 @@ QString Tikzit::styleFilePath() const return _styleFilePath; } +void Tikzit::setCheckForUpdates(bool check) +{ + QSettings settings("tikzit", "tikzit"); + settings.setValue("check-for-updates", check); + foreach (MainWindow *w, _windows) { + w->menu()->updatesAction()->blockSignals(true); + w->menu()->updatesAction()->setChecked(check); + w->menu()->updatesAction()->blockSignals(false); + } +} + +void Tikzit::checkForUpdates() +{ + +} + +void Tikzit::updateReply(QNetworkReply *reply) +{ + +} + //StylePalette *Tikzit::stylePalette() const //{ // return _stylePalette; diff --git a/src/tikzit.h b/src/tikzit.h index 8980f17..87599e7 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -49,6 +49,8 @@ #ifndef TIKZIT_H #define TIKZIT_H +#define TIKZIT_VERSION "2.0-rc1" + #include "mainwindow.h" #include "mainmenu.h" #include "ui_mainmenu.h" @@ -67,6 +69,7 @@ #include #include #include +#include // Number of pixels between (0,0) and (1,0) at 100% zoom level. This should be // divisible by 8 to avoid rounding errors with e.g. grid-snapping. @@ -107,8 +110,6 @@ public: void removeWindow(MainWindow *w); static QFont LABEL_FONT; -// Ui::MainMenu *_mainMenuUi; -// QMenuBar *_mainMenu; void newDoc(); void open(); @@ -132,7 +133,10 @@ public: QString styleFilePath() const; public slots: - //void focusChanged(QWidget *old, QWidget *nw); + void setCheckForUpdates(bool check); + void checkForUpdates(); + void updateReply(QNetworkReply *reply); + private: // void createMenu(); diff --git a/tikzit.pro b/tikzit.pro index c4b8f84..0f3e24c 100644 --- a/tikzit.pro +++ b/tikzit.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += core gui widgets +QT += core gui widgets network test { CONFIG += testcase -- cgit v1.2.3 From 24fbb3b7aca8dd5b957397a046d3cb71a00b324c Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 21 Oct 2018 13:33:13 +0200 Subject: add automatic update checking (closes #33) --- src/gui/mainmenu.cpp | 4 ++-- src/tikzit.cpp | 41 ++++++++++++++++++++++++++++++++++++++++- src/tikzit.h | 4 ++-- 3 files changed, 44 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/mainmenu.cpp b/src/gui/mainmenu.cpp index b530f58..8166c59 100644 --- a/src/gui/mainmenu.cpp +++ b/src/gui/mainmenu.cpp @@ -255,10 +255,10 @@ void MainMenu::on_actionAbout_triggered() void MainMenu::on_actionCheck_for_updates_automatically_triggered() { - qDebug() << "check automatically:" << ui.actionCheck_for_updates_automatically->isChecked(); + tikzit->setCheckForUpdates(ui.actionCheck_for_updates_automatically->isChecked()); } void MainMenu::on_actionCheck_now_triggered() { - qDebug() << "check now"; + tikzit->checkForUpdates(); } diff --git a/src/tikzit.cpp b/src/tikzit.cpp index fc81739..5d1fef4 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -25,6 +25,9 @@ #include #include #include +#include +#include +#include // application-level instance of Tikzit Tikzit *tikzit; @@ -119,6 +122,10 @@ void Tikzit::init() } setCheckForUpdates(check.toBool()); + + if (check.toBool()) { + checkForUpdates(); + } } //QMenuBar *Tikzit::mainMenu() const @@ -352,12 +359,44 @@ void Tikzit::setCheckForUpdates(bool check) void Tikzit::checkForUpdates() { + QNetworkAccessManager *manager = new QNetworkAccessManager(this); + connect(manager, SIGNAL(finished(QNetworkReply*)), + this, SLOT(updateReply(QNetworkReply*))); + manager->get(QNetworkRequest(QUrl("http://tikzit.github.io/latest-version.txt"))); } void Tikzit::updateReply(QNetworkReply *reply) { - + if (!reply->isReadable()) return; + + QByteArray data = reply->read(200); + QString strLatest = QString::fromUtf8(data).simplified(); + qDebug() << "got response:" << strLatest; + + QVersionNumber current = QVersionNumber::fromString(TIKZIT_VERSION).normalized(); + QVersionNumber latest = QVersionNumber::fromString(strLatest).normalized(); + + // check for an optional RC suffix. Any non-RC versions are considered later than RC versions. + QRegularExpression re("-[rR][cC]([0-9]+)$"); + QRegularExpressionMatch m; + m = re.match(TIKZIT_VERSION); + int rcCurrent = (m.hasMatch()) ? m.captured(1).toInt() : 1000; + m = re.match(strLatest); + int rcLatest = (m.hasMatch()) ? m.captured(1).toInt() : 1000; + + //qDebug() << "latest" << latest << "rc" << rcLatest; + //qDebug() << "current" << current << "rc" << rcCurrent; + + if (latest > current || (latest == current && rcLatest > rcCurrent)) { + QMessageBox::information(0, + tr("Update available"), + "

A new version of TikZiT is available!

" + "

current version: " TIKZIT_VERSION "
" + "latest version: " + strLatest + "

" + "

Download it now from: " + "tikzit.github.io.

"); + } } //StylePalette *Tikzit::stylePalette() const diff --git a/src/tikzit.h b/src/tikzit.h index 87599e7..635ee5e 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -49,7 +49,7 @@ #ifndef TIKZIT_H #define TIKZIT_H -#define TIKZIT_VERSION "2.0-rc1" +#define TIKZIT_VERSION "2.0-rc3" #include "mainwindow.h" #include "mainmenu.h" @@ -69,7 +69,7 @@ #include #include #include -#include +#include // Number of pixels between (0,0) and (1,0) at 100% zoom level. This should be // divisible by 8 to avoid rounding errors with e.g. grid-snapping. -- cgit v1.2.3 From c9ad86390fe5519e97a0b0f26b01de1bbddcba41 Mon Sep 17 00:00:00 2001 From: Ingo Blechschmidt Date: Sun, 21 Oct 2018 16:11:24 +0200 Subject: Use https instead of http for improved security --- src/tikzit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 5d1fef4..fdbc9d8 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -363,7 +363,7 @@ void Tikzit::checkForUpdates() connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(updateReply(QNetworkReply*))); - manager->get(QNetworkRequest(QUrl("http://tikzit.github.io/latest-version.txt"))); + manager->get(QNetworkRequest(QUrl("https://tikzit.github.io/latest-version.txt"))); } void Tikzit::updateReply(QNetworkReply *reply) -- cgit v1.2.3 From f0c92dbae31b12799d0622b8219d7841ab10464f Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Mon, 22 Oct 2018 11:25:59 +0200 Subject: updated version in header and added deploy scripts --- .gitignore | 3 +++ deploy-linux.sh | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ deploy-osx.sh | 2 +- deploy-win.bat | 7 +++++ src/tikzit.cpp | 2 +- src/tikzit.h | 2 +- 6 files changed, 95 insertions(+), 3 deletions(-) create mode 100755 deploy-linux.sh create mode 100755 deploy-win.bat (limited to 'src') diff --git a/.gitignore b/.gitignore index 6894d5e..0fb2e43 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ moc_*.h ui_*.h qrc_*.cpp tikzit +tikzlexer.h +dist + diff --git a/deploy-linux.sh b/deploy-linux.sh new file mode 100755 index 0000000..4e92b95 --- /dev/null +++ b/deploy-linux.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +# directory where libQt5XXX.so files can be found +LIBDIR=/usr/lib/x86_64-linux-gnu + +# directory where Qt plugins can be found +PLUGINDIR=$LIBDIR/qt5/plugins + +mkdir -p dist/tikzit +cd dist/tikzit +mkdir -p opt +mkdir -p bin +mkdir -p lib +mkdir -p plugins + +# add README file +cat > README << 'EOF' +This is a portable version of TikZiT 2.0. To launch TikZiT, simply run +'bin/tikzit'. To install launcher and icons for the current user, make +sure the 'bin' sub-directory is in your $PATH and run: + +# ./install-local.sh + +inside the tikzit directory. + + +TikZiT is released under the GNU General Public License, Version 3. See: + +http://tikzit.github.io + +for full details and source code. +EOF + +# add helper scripts +cat > install-local.sh << 'EOF' +#!/bin/bash + +mkdir -p ~/.local +cp -r share ~/.local/ +update-mime-database ~/.local/share/mime +update-desktop-database ~/.local/share/applications +EOF +chmod +x install-local.sh + +cat > bin/tikzit << 'EOF' +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && cd .. && pwd )" +LD_LIBRARY_PATH=$DIR/lib:$LD_LIBRARY_PATH QT_PLUGIN_PATH=$DIR/plugins $DIR/opt/tikzit $@ +EOF +chmod +x bin/tikzit + +# add tikzit binary +cp ../../tikzit opt + +# add icons, desktop entry, and MIME data +cp -R ../../share . + +# add Qt libs. Keep shortened lib names as symlinks. +cp --no-dereference $LIBDIR/libQt5Core.so* lib +cp --no-dereference $LIBDIR/libQt5DBus.so* lib +cp --no-dereference $LIBDIR/libQt5Widgets.so* lib +cp --no-dereference $LIBDIR/libQt5Svg.so* lib +cp --no-dereference $LIBDIR/libQt5Network.so* lib +cp --no-dereference $LIBDIR/libQt5Gui.so* lib +cp --no-dereference $LIBDIR/libQt5XcbQpa.so* lib + +# add libicu, which is required by Qt5 for unicode support +cp --no-dereference $LIBDIR/libicuuc.so* lib +cp --no-dereference $LIBDIR/libicui18n.so* lib +cp --no-dereference $LIBDIR/libicudata.so* lib + +# add Qt plugins used by TikZiT +cp -R $PLUGINDIR/platforms plugins +cp -R $PLUGINDIR/imageformats plugins +cp -R $PLUGINDIR/platforminputcontexts plugins +cp -R $PLUGINDIR/xcbglintegrations plugins + +# create tar.gz +cd .. +tar czf tikzit.tar.gz tikzit + diff --git a/deploy-osx.sh b/deploy-osx.sh index a04f7f7..15d69f7 100755 --- a/deploy-osx.sh +++ b/deploy-osx.sh @@ -1,5 +1,5 @@ # deploy the Mac app bundle. Note the bin/ directory # of Qt should be in your PATH -macdeployqt tikzit.app +macdeployqt tikzit.app -dmg diff --git a/deploy-win.bat b/deploy-win.bat new file mode 100755 index 0000000..dbd6e9a --- /dev/null +++ b/deploy-win.bat @@ -0,0 +1,7 @@ +mkdir dist +cd dist +mkdir tikzit +cd tikzit +cp ..\..\tikzit.exe . + +windeployqt.exe --no-webkit2 --no-angle --no-opengl-sw --no-system-d3d-compiler --no-translations --no-quick-import .\tikzit.exe \ No newline at end of file diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 5d1fef4..4fd4227 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -372,7 +372,7 @@ void Tikzit::updateReply(QNetworkReply *reply) QByteArray data = reply->read(200); QString strLatest = QString::fromUtf8(data).simplified(); - qDebug() << "got response:" << strLatest; + //qDebug() << "got response:" << strLatest; QVersionNumber current = QVersionNumber::fromString(TIKZIT_VERSION).normalized(); QVersionNumber latest = QVersionNumber::fromString(strLatest).normalized(); diff --git a/src/tikzit.h b/src/tikzit.h index 635ee5e..69e9237 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -49,7 +49,7 @@ #ifndef TIKZIT_H #define TIKZIT_H -#define TIKZIT_VERSION "2.0-rc3" +#define TIKZIT_VERSION "2.0" #include "mainwindow.h" #include "mainmenu.h" -- cgit v1.2.3 From 52f57ffc613fc4510c94a8d5d1286eaed4ffba91 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 23 Oct 2018 08:06:19 +0200 Subject: added input validation on version response --- src/tikzit.cpp | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 58cb08e..02b8578 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -372,30 +372,40 @@ void Tikzit::updateReply(QNetworkReply *reply) QByteArray data = reply->read(200); QString strLatest = QString::fromUtf8(data).simplified(); - //qDebug() << "got response:" << strLatest; QVersionNumber current = QVersionNumber::fromString(TIKZIT_VERSION).normalized(); QVersionNumber latest = QVersionNumber::fromString(strLatest).normalized(); - // check for an optional RC suffix. Any non-RC versions are considered later than RC versions. - QRegularExpression re("-[rR][cC]([0-9]+)$"); + // check for valid version string and capture optional RC suffix + QRegularExpression re("^[1-9]+(\\.[0-9]+)*(-[rR][cC]([0-9]+))?$"); QRegularExpressionMatch m; m = re.match(TIKZIT_VERSION); - int rcCurrent = (m.hasMatch()) ? m.captured(1).toInt() : 1000; + + // any non-RC versions are considered later than RC versions. + int rcCurrent = (!m.captured(3).isEmpty()) ? m.captured(3).toInt() : 1000; + m = re.match(strLatest); - int rcLatest = (m.hasMatch()) ? m.captured(1).toInt() : 1000; - - //qDebug() << "latest" << latest << "rc" << rcLatest; - //qDebug() << "current" << current << "rc" << rcCurrent; - - if (latest > current || (latest == current && rcLatest > rcCurrent)) { - QMessageBox::information(0, - tr("Update available"), - "

A new version of TikZiT is available!

" - "

current version: " TIKZIT_VERSION "
" - "latest version: " + strLatest + "

" - "

Download it now from: " - "tikzit.github.io.

"); + + if (m.hasMatch()) { + int rcLatest = (!m.captured(3).isEmpty()) ? m.captured(3).toInt() : 1000; + + //qDebug() << "latest" << latest << "rc" << rcLatest; + //qDebug() << "current" << current << "rc" << rcCurrent; + + if (latest > current || (latest == current && rcLatest > rcCurrent)) { + QMessageBox::information(0, + tr("Update available"), + "

A new version of TikZiT is available!

" + "

current version: " TIKZIT_VERSION "
" + "latest version: " + strLatest + "

" + "

Download it now from: " + "tikzit.github.io.

"); + } + } else { + QMessageBox::warning(0, + tr("Invalid response"), + "

Got invalid version response from " + "tikzit.github.io.

"); } } -- cgit v1.2.3 From 0eb35874c48b3078782af671a21ede98f4f92093 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 23 Oct 2018 10:59:41 +0200 Subject: back to http, but with input validation --- src/tikzit.cpp | 16 +++++++++------- src/tikzit.h | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 02b8578..820b8ec 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -363,7 +363,7 @@ void Tikzit::checkForUpdates() connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(updateReply(QNetworkReply*))); - manager->get(QNetworkRequest(QUrl("https://tikzit.github.io/latest-version.txt"))); + manager->get(QNetworkRequest(QUrl("http://tikzit.github.io/latest-version.txt"))); } void Tikzit::updateReply(QNetworkReply *reply) @@ -373,9 +373,6 @@ void Tikzit::updateReply(QNetworkReply *reply) QByteArray data = reply->read(200); QString strLatest = QString::fromUtf8(data).simplified(); - QVersionNumber current = QVersionNumber::fromString(TIKZIT_VERSION).normalized(); - QVersionNumber latest = QVersionNumber::fromString(strLatest).normalized(); - // check for valid version string and capture optional RC suffix QRegularExpression re("^[1-9]+(\\.[0-9]+)*(-[rR][cC]([0-9]+))?$"); QRegularExpressionMatch m; @@ -387,12 +384,17 @@ void Tikzit::updateReply(QNetworkReply *reply) m = re.match(strLatest); if (m.hasMatch()) { - int rcLatest = (!m.captured(3).isEmpty()) ? m.captured(3).toInt() : 1000; + QVersionNumber current = QVersionNumber::fromString(TIKZIT_VERSION).normalized(); + QVersionNumber latest = QVersionNumber::fromString(strLatest).normalized(); - //qDebug() << "latest" << latest << "rc" << rcLatest; - //qDebug() << "current" << current << "rc" << rcCurrent; + int rcLatest = (!m.captured(3).isEmpty()) ? m.captured(3).toInt() : 1000; if (latest > current || (latest == current && rcLatest > rcCurrent)) { + // give the version string in standard format + strLatest = QString::number(latest.majorVersion()) + "." + + QString::number(latest.minorVersion()) + "." + + QString::number(latest.microVersion()); + if (rcLatest != 1000) strLatest += "-rc" + QString::number(rcLatest); QMessageBox::information(0, tr("Update available"), "

A new version of TikZiT is available!

" diff --git a/src/tikzit.h b/src/tikzit.h index 69e9237..d36a940 100644 --- a/src/tikzit.h +++ b/src/tikzit.h @@ -49,7 +49,7 @@ #ifndef TIKZIT_H #define TIKZIT_H -#define TIKZIT_VERSION "2.0" +#define TIKZIT_VERSION "2.0.0" #include "mainwindow.h" #include "mainmenu.h" -- cgit v1.2.3 From 43233c4f76c5a96c08dcb033372294fbafbaf663 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 23 Oct 2018 11:32:29 +0200 Subject: added https again, and including OpenSSL libs in dist --- deploy-win.bat | 2 ++ src/tikzit.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/deploy-win.bat b/deploy-win.bat index c06733f..1c19f40 100755 --- a/deploy-win.bat +++ b/deploy-win.bat @@ -9,6 +9,8 @@ copy ..\..\release\tikzit.exe . copy ..\..\images\tikzdoc.ico icons\ copy C:\Windows\System32\msvcp140.dll . copy C:\Windows\System32\vcruntime140.dll . +copy C:\OpenSSL-Win64\bin\libeay32.dll . +copy C:\OpenSSL-Win64\bin\ssleay32.dll . windeployqt.exe --no-compiler-runtime --no-webkit2 --no-angle --no-opengl-sw --no-system-d3d-compiler --no-translations --no-quick-import .\tikzit.exe diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 820b8ec..c9286c9 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -363,7 +363,7 @@ void Tikzit::checkForUpdates() connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(updateReply(QNetworkReply*))); - manager->get(QNetworkRequest(QUrl("http://tikzit.github.io/latest-version.txt"))); + manager->get(QNetworkRequest(QUrl("https://tikzit.github.io/latest-version.txt"))); } void Tikzit::updateReply(QNetworkReply *reply) -- cgit v1.2.3