summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/2geom/elliptical-arc.cpp4
-rw-r--r--src/color-profile.cpp4
-rw-r--r--src/display/sp-canvas.cpp5
-rw-r--r--src/document-private.h57
-rw-r--r--src/document-undo.cpp298
-rw-r--r--src/document-undo.h4
-rw-r--r--src/document.cpp18
-rw-r--r--src/document.h2
-rw-r--r--src/gradient-chemistry.cpp4
-rw-r--r--src/gradient-drag.cpp4
-rw-r--r--src/layer-manager.cpp10
-rw-r--r--src/live_effects/effect.cpp4
-rw-r--r--src/live_effects/lpe-jointype.cpp2
-rw-r--r--src/live_effects/lpe-jointype.h2
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp330
-rw-r--r--src/live_effects/lpe-mirror_symmetry.h37
-rw-r--r--src/main-cmdlineact.cpp2
-rw-r--r--src/main-cmdlineact.h2
-rw-r--r--src/main.cpp85
-rw-r--r--src/profile-manager.cpp5
-rw-r--r--src/pure-transform.cpp38
-rw-r--r--src/pure-transform.h12
-rw-r--r--src/resource-manager.cpp8
-rw-r--r--src/sp-flowtext.h5
-rw-r--r--src/sp-guide.cpp2
-rw-r--r--src/splivarot.cpp13
-rw-r--r--src/ui/dialog/aboutbox.cpp906
-rw-r--r--src/ui/dialog/color-item.cpp2
-rw-r--r--src/ui/dialog/document-properties.cpp32
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp4
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp4
-rw-r--r--src/ui/dialog/object-properties.cpp2
-rw-r--r--src/ui/dialog/object-properties.h2
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp4
-rw-r--r--src/ui/dialog/swatches.cpp17
-rw-r--r--src/ui/interface.cpp4
-rw-r--r--src/ui/previewholder.cpp4
-rw-r--r--src/ui/tool/path-manipulator.cpp2
-rw-r--r--src/ui/tools/freehand-base.cpp5
-rw-r--r--src/ui/tools/node-tool.cpp5
-rw-r--r--src/ui/widget/color-icc-selector.cpp4
-rw-r--r--src/ui/widget/color-preview.cpp1
-rw-r--r--src/ui/widget/dock.cpp1
-rw-r--r--src/ui/widget/layer-selector.cpp2
-rw-r--r--src/ui/widget/panel.cpp6
-rw-r--r--src/ui/widget/selected-style.cpp1
-rw-r--r--src/ui/widget/style-swatch.cpp2
-rw-r--r--src/widgets/desktop-widget.cpp128
-rw-r--r--src/widgets/eraser-toolbar.cpp4
-rw-r--r--src/widgets/gradient-toolbar.cpp4
-rw-r--r--src/widgets/gradient-vector.cpp4
-rw-r--r--src/widgets/paint-selector.cpp4
-rw-r--r--src/widgets/ruler.cpp17
-rw-r--r--src/widgets/toolbox.cpp9
-rw-r--r--src/xml/rebase-hrefs.cpp4
55 files changed, 1426 insertions, 715 deletions
diff --git a/src/2geom/elliptical-arc.cpp b/src/2geom/elliptical-arc.cpp
index a0e379a21..ec62b4be2 100644
--- a/src/2geom/elliptical-arc.cpp
+++ b/src/2geom/elliptical-arc.cpp
@@ -570,13 +570,13 @@ void EllipticalArc::_filterIntersections(std::vector<ShapeIntersection> &xs, boo
std::vector<ShapeIntersection>::reverse_iterator i = xs.rbegin(), last = xs.rend();
while (i != last) {
Coord &t = is_first ? i->first : i->second;
- assert(are_near(_ellipse.pointAt(t), i->point(), 1e-6));
+ assert(are_near(_ellipse.pointAt(t), i->point(), 1e-5));
t = timeAtAngle(t);
if (!unit.contains(t)) {
xs.erase((++i).base());
continue;
} else {
- assert(are_near(pointAt(t), i->point(), 1e-6));
+ assert(are_near(pointAt(t), i->point(), 1e-5));
++i;
}
}
diff --git a/src/color-profile.cpp b/src/color-profile.cpp
index bcefe994a..523026aa5 100644
--- a/src/color-profile.cpp
+++ b/src/color-profile.cpp
@@ -489,8 +489,8 @@ static int getLcmsIntent( guint svgIntent )
static SPObject* bruteFind( SPDocument* document, gchar const* name )
{
SPObject* result = 0;
- std::set<SPObject *> current = document->getResourceList("iccprofile");
- for (std::set<SPObject *>::const_iterator it = current.begin(); (!result) && (it != current.end()); ++it) {
+ std::vector<SPObject *> current = document->getResourceList("iccprofile");
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); (!result) && (it != current.end()); ++it) {
if ( IS_COLORPROFILE(*it) ) {
ColorProfile* prof = COLORPROFILE(*it);
if ( prof ) {
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index decb14184..7d76fa043 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1159,8 +1159,11 @@ void SPCanvas::handle_size_allocate(GtkWidget *widget, GtkAllocation *allocation
allocation->width, allocation->height);
if (canvas->_backing_store) {
cairo_t *cr = cairo_create(new_backing_store);
- cairo_set_source_surface(cr, canvas->_backing_store, 0, 0);
+ cairo_translate(cr, -canvas->_x0, -canvas->_y0);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source(cr, canvas->_background);
+ cairo_paint(cr);
+ cairo_set_source_surface(cr, canvas->_backing_store, canvas->_x0, canvas->_y0);
cairo_paint(cr);
cairo_destroy(cr);
cairo_surface_destroy(canvas->_backing_store);
diff --git a/src/document-private.h b/src/document-private.h
index 6ec535b87..9cac8fac6 100644
--- a/src/document-private.h
+++ b/src/document-private.h
@@ -37,44 +37,43 @@ class Event;
}
struct SPDocumentPrivate {
- typedef std::map<GQuark, SPDocument::IDChangedSignal> IDChangedSignalMap;
- typedef std::map<GQuark, SPDocument::ResourcesChangedSignal> ResourcesChangedSignalMap;
+ typedef std::map<GQuark, SPDocument::IDChangedSignal> IDChangedSignalMap;
+ typedef std::map<GQuark, SPDocument::ResourcesChangedSignal> ResourcesChangedSignalMap;
- std::map<std::string, SPObject *> iddef;
- std::map<Inkscape::XML::Node *, SPObject *> reprdef;
+ std::map<std::string, SPObject *> iddef;
+ std::map<Inkscape::XML::Node *, SPObject *> reprdef;
- unsigned long serial;
+ unsigned long serial;
- /** Dictionary of signals for id changes */
- IDChangedSignalMap id_changed_signals;
+ /** Dictionary of signals for id changes */
+ IDChangedSignalMap id_changed_signals;
- /* Resources */
- std::map<std::string, std::set<SPObject *> > resources;
- ResourcesChangedSignalMap resources_changed_signals;
+ /* Resources */
+ std::map<std::string, std::vector<SPObject *> > resources;
+ ResourcesChangedSignalMap resources_changed_signals;
- sigc::signal<void> destroySignal;
- SPDocument::ModifiedSignal modified_signal;
- SPDocument::URISetSignal uri_set_signal;
- SPDocument::ResizedSignal resized_signal;
- SPDocument::ReconstructionStart _reconstruction_start_signal;
- SPDocument::ReconstructionFinish _reconstruction_finish_signal;
- SPDocument::CommitSignal commit_signal;
+ sigc::signal<void> destroySignal;
+ SPDocument::ModifiedSignal modified_signal;
+ SPDocument::URISetSignal uri_set_signal;
+ SPDocument::ResizedSignal resized_signal;
+ SPDocument::ReconstructionStart _reconstruction_start_signal;
+ SPDocument::ReconstructionFinish _reconstruction_finish_signal;
+ SPDocument::CommitSignal commit_signal;
- /* Undo/Redo state */
- bool sensitive; /* If we save actions to undo stack */
- bool join_undo; /* If we group actions to one undo stack */
- Inkscape::XML::Event * partial; /* partial undo log when interrupted */
- int history_size;
- std::vector<Inkscape::Event *> undo; /* Undo stack of reprs */
- std::vector<Inkscape::Event *> redo; /* Redo stack of reprs */
+ /* Undo/Redo state */
+ bool sensitive; /* If we save actions to undo stack */
+ Inkscape::XML::Event * partial; /* partial undo log when interrupted */
+ int history_size;
+ std::vector<Inkscape::Event *> undo; /* Undo stack of reprs */
+ std::vector<Inkscape::Event *> redo; /* Redo stack of reprs */
- /* Undo listener */
- Inkscape::CompositeUndoStackObserver undoStackObservers;
+ /* Undo listener */
+ Inkscape::CompositeUndoStackObserver undoStackObservers;
- // XXX only for testing!
- Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
+ // XXX only for testing!
+ Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
- bool seeking;
+ bool seeking;
sigc::connection selChangeConnection;
sigc::connection desktopActivatedConnection;
};
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 1707fb6fa..eb0ac7707 100644
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -62,22 +62,22 @@
void Inkscape::DocumentUndo::setUndoSensitive(SPDocument *doc, bool sensitive)
{
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
-
- if ( sensitive == doc->priv->sensitive )
- return;
-
- if (sensitive) {
- sp_repr_begin_transaction (doc->rdoc);
- } else {
- doc->priv->partial = sp_repr_coalesce_log (
- doc->priv->partial,
- sp_repr_commit_undoable (doc->rdoc)
- );
- }
-
- doc->priv->sensitive = sensitive;
+ g_assert (doc != NULL);
+ g_assert (doc->priv != NULL);
+
+ if ( sensitive == doc->priv->sensitive )
+ return;
+
+ if (sensitive) {
+ sp_repr_begin_transaction (doc->rdoc);
+ } else {
+ doc->priv->partial = sp_repr_coalesce_log (
+ doc->priv->partial,
+ sp_repr_commit_undoable (doc->rdoc)
+ );
+ }
+
+ doc->priv->sensitive = sensitive;
}
/*TODO: Throughout the inkscape code tree set/get_undo_sensitive are used for
@@ -88,49 +88,15 @@ void Inkscape::DocumentUndo::setUndoSensitive(SPDocument *doc, bool sensitive)
*/
bool Inkscape::DocumentUndo::getUndoSensitive(SPDocument const *document) {
- g_assert(document != NULL);
- g_assert(document->priv != NULL);
-
- return document->priv->sensitive;
-}
-
-void Inkscape::DocumentUndo::setUndoJoined(SPDocument *doc, bool join_undo)
-{
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
- if (join_undo) {
- doc->collectOrphans();
- doc->ensureUpToDate();
- DocumentUndo::clearRedo(doc);
- Inkscape::XML::Event *log = sp_repr_coalesce_log (doc->priv->partial, sp_repr_commit_undoable (doc->rdoc));
- doc->priv->partial = NULL;
- if (!log) {
- sp_repr_begin_transaction (doc->rdoc);
- doc->priv->join_undo = join_undo;
- return;
- }
- doc->virgin = FALSE;
- doc->setModifiedSinceSave();
- sp_repr_begin_transaction (doc->rdoc);
- doc->priv->commit_signal.emit();
- }
- doc->priv->join_undo = join_undo;
-}
+ g_assert(document != NULL);
+ g_assert(document->priv != NULL);
-bool Inkscape::DocumentUndo::getUndoJoined(SPDocument *doc)
-{
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
- return doc->priv->join_undo;
+ return document->priv->sensitive;
}
void Inkscape::DocumentUndo::done(SPDocument *doc, const unsigned int event_type, Glib::ustring const &event_description)
{
- if (!getUndoJoined(doc)) {
- maybeDone(doc, NULL, event_type, event_description);
- } else {
- sp_repr_commit_undoable (doc->rdoc);
- }
+ maybeDone(doc, NULL, event_type, event_description);
}
void Inkscape::DocumentUndo::resetKey( SPDocument *doc )
@@ -173,81 +139,82 @@ public:
void Inkscape::DocumentUndo::maybeDone(SPDocument *doc, const gchar *key, const unsigned int event_type,
Glib::ustring const &event_description)
{
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
- g_assert (doc->priv->sensitive);
- if ( key && !*key ) {
- g_warning("Blank undo key specified.");
- }
+ g_assert (doc != NULL);
+ g_assert (doc->priv != NULL);
+ g_assert (doc->priv->sensitive);
+ if ( key && !*key ) {
+ g_warning("Blank undo key specified.");
+ }
- Inkscape::Debug::EventTracker<CommitEvent> tracker(doc, key, event_type);
+ Inkscape::Debug::EventTracker<CommitEvent> tracker(doc, key, event_type);
- doc->collectOrphans();
+ doc->collectOrphans();
- doc->ensureUpToDate();
+ doc->ensureUpToDate();
- DocumentUndo::clearRedo(doc);
+ DocumentUndo::clearRedo(doc);
- Inkscape::XML::Event *log = sp_repr_coalesce_log (doc->priv->partial, sp_repr_commit_undoable (doc->rdoc));
- doc->priv->partial = NULL;
+ Inkscape::XML::Event *log = sp_repr_coalesce_log (doc->priv->partial, sp_repr_commit_undoable (doc->rdoc));
+ doc->priv->partial = NULL;
- if (!log) {
- sp_repr_begin_transaction (doc->rdoc);
- return;
- }
+ if (!log) {
+ sp_repr_begin_transaction (doc->rdoc);
+ return;
+ }
- if (key && !doc->actionkey.empty() && (doc->actionkey == key) && !doc->priv->undo.empty()) {
- (doc->priv->undo.back())->event = sp_repr_coalesce_log ((doc->priv->undo.back())->event, log);
- } else {
- Inkscape::Event *event = new Inkscape::Event(log, event_type, event_description);
- doc->priv->undo.push_back(event);
- doc->priv->history_size++;
- doc->priv->undoStackObservers.notifyUndoCommitEvent(event);
- }
+ if (key && !doc->actionkey.empty() && (doc->actionkey == key) && !doc->priv->undo.empty()) {
+ (doc->priv->undo.back())->event =
+ sp_repr_coalesce_log ((doc->priv->undo.back())->event, log);
+ } else {
+ Inkscape::Event *event = new Inkscape::Event(log, event_type, event_description);
+ doc->priv->undo.push_back(event);
+ doc->priv->history_size++;
+ doc->priv->undoStackObservers.notifyUndoCommitEvent(event);
+ }
- if ( key ) {
- doc->actionkey = key;
- } else {
- doc->actionkey.clear();
- }
+ if ( key ) {
+ doc->actionkey = key;
+ } else {
+ doc->actionkey.clear();
+ }
- doc->virgin = FALSE;
- doc->setModifiedSinceSave();
+ doc->virgin = FALSE;
+ doc->setModifiedSinceSave();
- sp_repr_begin_transaction (doc->rdoc);
+ sp_repr_begin_transaction (doc->rdoc);
- doc->priv->commit_signal.emit();
+ doc->priv->commit_signal.emit();
}
void Inkscape::DocumentUndo::cancel(SPDocument *doc)
{
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
- g_assert (doc->priv->sensitive);
+ g_assert (doc != NULL);
+ g_assert (doc->priv != NULL);
+ g_assert (doc->priv->sensitive);
- sp_repr_rollback (doc->rdoc);
+ sp_repr_rollback (doc->rdoc);
- if (doc->priv->partial) {
- sp_repr_undo_log (doc->priv->partial);
- sp_repr_free_log (doc->priv->partial);
- doc->priv->partial = NULL;
- }
+ if (doc->priv->partial) {
+ sp_repr_undo_log (doc->priv->partial);
+ sp_repr_free_log (doc->priv->partial);
+ doc->priv->partial = NULL;
+ }
- sp_repr_begin_transaction (doc->rdoc);
+ sp_repr_begin_transaction (doc->rdoc);
}
static void finish_incomplete_transaction(SPDocument &doc) {
- SPDocumentPrivate &priv=*doc.priv;
- Inkscape::XML::Event *log=sp_repr_commit_undoable(doc.rdoc);
- if (log || priv.partial) {
- g_warning ("Incomplete undo transaction:");
- priv.partial = sp_repr_coalesce_log(priv.partial, log);
- sp_repr_debug_print_log(priv.partial);
+ SPDocumentPrivate &priv=*doc.priv;
+ Inkscape::XML::Event *log=sp_repr_commit_undoable(doc.rdoc);
+ if (log || priv.partial) {
+ g_warning ("Incomplete undo transaction:");
+ priv.partial = sp_repr_coalesce_log(priv.partial, log);
+ sp_repr_debug_print_log(priv.partial);
Inkscape::Event *event = new Inkscape::Event(priv.partial);
- priv.undo.push_back(event);
+ priv.undo.push_back(event);
priv.undoStackObservers.notifyUndoCommitEvent(event);
- priv.partial = NULL;
- }
+ priv.partial = NULL;
+ }
}
static void perform_document_update(SPDocument &doc) {
@@ -271,101 +238,100 @@ static void perform_document_update(SPDocument &doc) {
gboolean Inkscape::DocumentUndo::undo(SPDocument *doc)
{
- using Inkscape::Debug::EventTracker;
- using Inkscape::Debug::SimpleEvent;
+ using Inkscape::Debug::EventTracker;
+ using Inkscape::Debug::SimpleEvent;
- gboolean ret;
+ gboolean ret;
- EventTracker<SimpleEvent<Inkscape::Debug::Event::DOCUMENT> > tracker("undo");
+ EventTracker<SimpleEvent<Inkscape::Debug::Event::DOCUMENT> > tracker("undo");
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
- g_assert (doc->priv->sensitive);
+ g_assert (doc != NULL);
+ g_assert (doc->priv != NULL);
+ g_assert (doc->priv->sensitive);
- doc->priv->sensitive = FALSE;
- doc->priv->seeking = true;
+ doc->priv->sensitive = FALSE;
+ doc->priv->seeking = true;
- doc->actionkey.clear();
+ doc->actionkey.clear();
- finish_incomplete_transaction(*doc);
+ finish_incomplete_transaction(*doc);
- if (! doc->priv->undo.empty()) {
- Inkscape::Event *log = doc->priv->undo.back();
- doc->priv->undo.pop_back();
- sp_repr_undo_log (log->event);
- perform_document_update(*doc);
+ if (! doc->priv->undo.empty()) {
+ Inkscape::Event *log = doc->priv->undo.back();
+ doc->priv->undo.pop_back();
+ sp_repr_undo_log (log->event);
+ perform_document_update(*doc);
- doc->priv->redo.push_back(log);
+ doc->priv->redo.push_back(log);
- doc->setModifiedSinceSave();
- doc->priv->undoStackObservers.notifyUndoEvent(log);
+ doc->setModifiedSinceSave();
+ doc->priv->undoStackObservers.notifyUndoEvent(log);
- ret = TRUE;
- } else {
- ret = FALSE;
- }
+ ret = TRUE;
+ } else {
+ ret = FALSE;
+ }
- sp_repr_begin_transaction (doc->rdoc);
+ sp_repr_begin_transaction (doc->rdoc);
- doc->priv->sensitive = TRUE;
- doc->priv->seeking = false;
+ doc->priv->sensitive = TRUE;
+ doc->priv->seeking = false;
- if (ret)
- INKSCAPE.external_change();
+ if (ret)
+ INKSCAPE.external_change();
- return ret;
+ return ret;
}
gboolean Inkscape::DocumentUndo::redo(SPDocument *doc)
{
- using Inkscape::Debug::EventTracker;
- using Inkscape::Debug::SimpleEvent;
+ using Inkscape::Debug::EventTracker;
+ using Inkscape::Debug::SimpleEvent;
- gboolean ret;
+ gboolean ret;
- EventTracker<SimpleEvent<Inkscape::Debug::Event::DOCUMENT> > tracker("redo");
+ EventTracker<SimpleEvent<Inkscape::Debug::Event::DOCUMENT> > tracker("redo");
- g_assert (doc != NULL);
- g_assert (doc->priv != NULL);
- g_assert (doc->priv->sensitive);
+ g_assert (doc != NULL);
+ g_assert (doc->priv != NULL);
+ g_assert (doc->priv->sensitive);
- doc->priv->sensitive = FALSE;
- doc->priv->seeking = true;
+ doc->priv->sensitive = FALSE;
+ doc->priv->seeking = true;
- doc->actionkey.clear();
+ doc->actionkey.clear();
- finish_incomplete_transaction(*doc);
+ finish_incomplete_transaction(*doc);
- if (! doc->priv->redo.empty()) {
- Inkscape::Event *log = doc->priv->redo.back();
- doc->priv->redo.pop_back();
- sp_repr_replay_log (log->event);
- doc->priv->undo.push_back(log);
+ if (! doc->priv->redo.empty()) {
+ Inkscape::Event *log = doc->priv->redo.back();
+ doc->priv->redo.pop_back();
+ sp_repr_replay_log (log->event);
+ doc->priv->undo.push_back(log);
- doc->setModifiedSinceSave();
- doc->priv->undoStackObservers.notifyRedoEvent(log);
+ doc->setModifiedSinceSave();
+ doc->priv->undoStackObservers.notifyRedoEvent(log);
- ret = TRUE;
- } else {
- ret = FALSE;
- }
+ ret = TRUE;
+ } else {
+ ret = FALSE;
+ }
- sp_repr_begin_transaction (doc->rdoc);
+ sp_repr_begin_transaction (doc->rdoc);
- doc->priv->sensitive = TRUE;
- doc->priv->seeking = false;
+ doc->priv->sensitive = TRUE;
+ doc->priv->seeking = false;
- if (ret)
- INKSCAPE.external_change();
+ if (ret)
+ INKSCAPE.external_change();
- return ret;
+ return ret;
}
void Inkscape::DocumentUndo::clearUndo(SPDocument *doc)
{
if (! doc->priv->undo.empty())
doc->priv->undoStackObservers.notifyClearUndoEvent();
-
while (! doc->priv->undo.empty()) {
Inkscape::Event *e = doc->priv->undo.back();
doc->priv->undo.pop_back();
@@ -376,8 +342,8 @@ void Inkscape::DocumentUndo::clearUndo(SPDocument *doc)
void Inkscape::DocumentUndo::clearRedo(SPDocument *doc)
{
- if (!doc->priv->redo.empty())
- doc->priv->undoStackObservers.notifyClearRedoEvent();
+ if (!doc->priv->redo.empty())
+ doc->priv->undoStackObservers.notifyClearRedoEvent();
while (! doc->priv->redo.empty()) {
Inkscape::Event *e = doc->priv->redo.back();
diff --git a/src/document-undo.h b/src/document-undo.h
index b80b176d3..85b44d562 100644
--- a/src/document-undo.h
+++ b/src/document-undo.h
@@ -33,10 +33,6 @@ public:
static bool getUndoSensitive(SPDocument const *document);
- static void setUndoJoined(SPDocument *doc, bool join_undo);
-
- static bool getUndoJoined(SPDocument *doc);
-
static void clearUndo(SPDocument *document);
static void clearRedo(SPDocument *document);
diff --git a/src/document.cpp b/src/document.cpp
index 87f13f749..2500a5cee 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -121,7 +121,6 @@ SPDocument::SPDocument() :
p->serial = next_serial++;
p->sensitive = false;
- p->join_undo = false;
p->partial = NULL;
p->history_size = 0;
p->seeking = false;
@@ -1542,9 +1541,9 @@ bool SPDocument::addResource(gchar const *key, SPObject *object)
bool result = false;
if ( !object->cloned ) {
- std::set<SPObject *> rlist = priv->resources[key];
- g_return_val_if_fail(rlist.find(object) == rlist.end(), false);
- priv->resources[key].insert(object);
+ std::vector<SPObject *> rlist = priv->resources[key];
+ g_return_val_if_fail(std::find(rlist.begin(),rlist.end(),object) == rlist.end(), false);
+ priv->resources[key].insert(priv->resources[key].begin(),object);
GQuark q = g_quark_from_string(key);
@@ -1573,10 +1572,11 @@ bool SPDocument::removeResource(gchar const *key, SPObject *object)
bool result = false;
if ( !object->cloned ) {
- std::set<SPObject *> rlist = priv->resources[key];
+ std::vector<SPObject *> rlist = priv->resources[key];
g_return_val_if_fail(!rlist.empty(), false);
- g_return_val_if_fail(rlist.find(object) != rlist.end(), false);
- priv->resources[key].erase(object);
+ std::vector<SPObject*>::iterator it = std::find(priv->resources[key].begin(),priv->resources[key].end(),object);
+ g_return_val_if_fail(it != rlist.end(), false);
+ priv->resources[key].erase(it);
GQuark q = g_quark_from_string(key);
priv->resources_changed_signals[q].emit();
@@ -1587,9 +1587,9 @@ bool SPDocument::removeResource(gchar const *key, SPObject *object)
return result;
}
-std::set<SPObject *> const SPDocument::getResourceList(gchar const *key) const
+std::vector<SPObject *> const SPDocument::getResourceList(gchar const *key) const
{
- std::set<SPObject *> emptyset;
+ std::vector<SPObject *> emptyset;
g_return_val_if_fail(key != NULL, emptyset);
g_return_val_if_fail(*key != '\0', emptyset);
diff --git a/src/document.h b/src/document.h
index 825049cd5..653e9d0db 100644
--- a/src/document.h
+++ b/src/document.h
@@ -260,7 +260,7 @@ public:
int ensureUpToDate();
bool addResource(char const *key, SPObject *object);
bool removeResource(char const *key, SPObject *object);
- const std::set<SPObject *> getResourceList(char const *key) const;
+ const std::vector<SPObject *> getResourceList(char const *key) const;
std::vector<SPItem*> getItemsInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const;
std::vector<SPItem*> getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box, bool into_groups = false) const;
SPItem *getItemAtPoint(unsigned int key, Geom::Point const &p, bool into_groups, SPItem *upto = NULL) const;
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 7b4c0ac20..edeb523d7 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -1612,8 +1612,8 @@ void sp_gradient_unset_swatch(SPDesktop *desktop, std::string id)
SPDocument *doc = desktop ? desktop->doc() : 0;
if (doc) {
- const std::set<SPObject *> gradients = doc->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator i = gradients.begin(); i != gradients.end(); ++i) {
+ const std::vector<SPObject *> gradients = doc->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator i = gradients.begin(); i != gradients.end(); ++i) {
SPGradient* grad = SP_GRADIENT(*i);
if ( id == grad->getId() ) {
grad->setSwatch(false);
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 8fd997121..613dc2fc1 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -208,8 +208,8 @@ Glib::ustring GrDrag::makeStopSafeColor( gchar const *str, bool &isNull )
Glib::ustring::size_type pos = colorStr.find("url(#");
if ( pos != Glib::ustring::npos ) {
Glib::ustring targetName = colorStr.substr(pos + 5, colorStr.length() - 6);
- std::set<SPObject *> gradients = desktop->doc()->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator it = gradients.begin(); it != gradients.end(); ++it) {
+ std::vector<SPObject *> gradients = desktop->doc()->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator it = gradients.begin(); it != gradients.end(); ++it) {
SPGradient* grad = SP_GRADIENT(*it);
if ( targetName == grad->getId() ) {
SPGradient *vect = grad->getVector();
diff --git a/src/layer-manager.cpp b/src/layer-manager.cpp
index c0fe95dd7..19c4b890c 100644
--- a/src/layer-manager.cpp
+++ b/src/layer-manager.cpp
@@ -191,10 +191,10 @@ Glib::ustring LayerManager::getNextLayerName( SPObject* obj, gchar const *label)
}
std::set<Glib::ustring> currentNames;
- std::set<SPObject *> layers = _document->getResourceList("layer");
+ std::vector<SPObject *> layers = _document->getResourceList("layer");
SPObject *root=_desktop->currentRoot();
if ( root ) {
- for (std::set<SPObject *>::const_iterator iter = layers.begin(); iter != layers.end(); ++iter) {
+ for (std::vector<SPObject *>::const_iterator iter = layers.begin(); iter != layers.end(); ++iter) {
if (*iter != obj)
currentNames.insert( (*iter)->label() ? Glib::ustring((*iter)->label()) : Glib::ustring() );
}
@@ -260,7 +260,7 @@ void LayerManager::_rebuild() {
if (!_document) // http://sourceforge.net/mailarchive/forum.php?thread_name=5747bce9a7ed077c1b4fc9f0f4f8a5e0%40localhost&forum_name=inkscape-devel
return;
- std::set<SPObject *> layers = _document->getResourceList("layer");
+ std::vector<SPObject *> layers = _document->getResourceList("layer");
SPObject *root=_desktop->currentRoot();
if ( root ) {
@@ -268,7 +268,7 @@ void LayerManager::_rebuild() {
std::set<SPGroup*> layersToAdd;
- for ( std::set<SPObject *>::const_iterator iter = layers.begin(); iter != layers.end(); ++iter ) {
+ for ( std::vector<SPObject *>::const_iterator iter = layers.begin(); iter != layers.end(); ++iter ) {
SPObject *layer = *iter;
// Debug::EventTracker<DebugLayerNote> tracker(Util::format("Examining %s", layer->label()));
bool needsAdd = false;
@@ -281,7 +281,7 @@ void LayerManager::_rebuild() {
SPGroup* group = SP_GROUP(curr);
if ( group->layerMode() == SPGroup::LAYER ) {
// If we have a layer-group as the one or a parent, ensure it is listed as a valid layer.
- needsAdd &= ( layers.find(curr) != layers.end() );
+ needsAdd &= ( std::find(layers.begin(),layers.end(),curr) != layers.end() );
// XML Tree being used here directly while it shouldn't be...
if ( (!(group->getRepr())) || (!(group->getRepr()->parent())) ) {
needsAdd = false;
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index c6ecba30a..732c67304 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -104,7 +104,6 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{EXTRUDE, N_("Extrude"), "extrude"},
{LATTICE, N_("Lattice Deformation"), "lattice"},
{LINE_SEGMENT, N_("Line Segment"), "line_segment"},
- {MIRROR_SYMMETRY, N_("Mirror symmetry"), "mirror_symmetry"},
{OFFSET, N_("Offset"), "offset"},
{PARALLEL, N_("Parallel"), "parallel"},
{PATH_LENGTH, N_("Path length"), "path_length"},
@@ -113,6 +112,7 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{RECURSIVE_SKELETON, N_("Recursive skeleton"), "recursive_skeleton"},
{TANGENT_TO_CURVE, N_("Tangent to curve"), "tangent_to_curve"},
{TEXT_LABEL, N_("Text label"), "text_label"},
+ {FILLET_CHAMFER, N_("Fillet/Chamfer"), "fillet-chamfer"},
#endif
/* 0.46 */
{BEND_PATH, N_("Bend"), "bend_path"},
@@ -136,7 +136,6 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{SIMPLIFY, N_("Simplify"), "simplify"},
{LATTICE2, N_("Lattice Deformation 2"), "lattice2"},
{PERSPECTIVE_ENVELOPE, N_("Perspective/Envelope"), "perspective-envelope"},
- {FILLET_CHAMFER, N_("Fillet/Chamfer"), "fillet-chamfer"},
{INTERPOLATE_POINTS, N_("Interpolate points"), "interpolate_points"},
{TRANSFORM_2PTS, N_("Transform by 2 points"), "transform_2pts"},
{SHOW_HANDLES, N_("Show handles"), "show_handles"},
@@ -144,6 +143,7 @@ const Util::EnumData<EffectType> LPETypeData[] = {
{BSPLINE, N_("BSpline"), "bspline"},
{JOIN_TYPE, N_("Join type"), "join_type"},
{TAPER_STROKE, N_("Taper stroke"), "taper_stroke"},
+ {MIRROR_SYMMETRY, N_("Mirror symmetry"), "mirror_symmetry"},
{COPY_ROTATE, N_("Rotate copies"), "copy_rotate"},
/* Ponyscape -> Inkscape 0.92*/
{ATTACH_PATH, N_("Attach path"), "attach_path"},
diff --git a/src/live_effects/lpe-jointype.cpp b/src/live_effects/lpe-jointype.cpp
index 2eef315dd..fe42932be 100644
--- a/src/live_effects/lpe-jointype.cpp
+++ b/src/live_effects/lpe-jointype.cpp
@@ -4,7 +4,7 @@
*
* Copyright (C) 2014 Authors
*
-* Released under GNU GPL v2, read the file 'COPYING' for more information
+* Released under GNU GPL v2+, read the file 'COPYING' for more information
*/
#include "live_effects/parameter/enum.h"
diff --git a/src/live_effects/lpe-jointype.h b/src/live_effects/lpe-jointype.h
index fddaeb619..ef7abdcc7 100644
--- a/src/live_effects/lpe-jointype.h
+++ b/src/live_effects/lpe-jointype.h
@@ -3,7 +3,7 @@
*
* Copyright (C) 2014 Authors
*
- * Released under GNU GPL v2, read the file COPYING for more information
+ * Released under GNU GPL v2+, read the file COPYING for more information
*/
#ifndef INKSCAPE_LPE_JOINTYPE_H
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index c13cffb6a..9f3070ff4 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -6,36 +6,84 @@
* Maximilian Albert
* Johan Engelen
* Abhishek Sharma
+ * Jabiertxof
*
* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
* Copyright (C) Maximilin Albert 2008 <maximilian.albert@gmail.com>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
+#include <gtkmm.h>
#include <glibmm/i18n.h>
#include "live_effects/lpe-mirror_symmetry.h"
#include <sp-path.h>
#include <display/curve.h>
#include <svg/path-string.h>
-
+#include "helper/geom.h"
#include <2geom/path.h>
+#include <2geom/path-intersection.h>
#include <2geom/transforms.h>
#include <2geom/affine.h>
+#include "knot-holder-entity.h"
+#include "knotholder.h"
+#include "inkscape.h"
namespace Inkscape {
namespace LivePathEffect {
+static const Util::EnumData<ModeType> ModeTypeData[MT_END] = {
+ { MT_V, N_("Vertical Page Center"), "Vertical Page Center, use select tool to move item instead line" },
+ { MT_H, N_("Horizontal Page Center"), "Horizontal Page Center, use select tool to move item instead line" },
+ { MT_FREE, N_("Free from reflection line"), "Free from path" },
+ { MT_X, N_("X from middle knot"), "X from middle knot" },
+ { MT_Y, N_("Y from middle knot"), "Y from middle knot" }
+};
+static const Util::EnumDataConverter<ModeType>
+MTConverter(ModeTypeData, MT_END);
+
+namespace MS {
+
+class KnotHolderEntityCenterMirrorSymmetry : public LPEKnotHolderEntity {
+public:
+ KnotHolderEntityCenterMirrorSymmetry(LPEMirrorSymmetry *effect) : LPEKnotHolderEntity(effect){};
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get() const;
+};
+
+class KnotHolderEntityStartMirrorSymmetry : public LPEKnotHolderEntity {
+public:
+ KnotHolderEntityStartMirrorSymmetry(LPEMirrorSymmetry *effect) : LPEKnotHolderEntity(effect){};
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get() const;
+};
+
+class KnotHolderEntityEndMirrorSymmetry : public LPEKnotHolderEntity {
+public:
+ KnotHolderEntityEndMirrorSymmetry(LPEMirrorSymmetry *effect) : LPEKnotHolderEntity(effect){};
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state);
+ virtual Geom::Point knot_get() const;
+};
+
+} // namespace MS
+
LPEMirrorSymmetry::LPEMirrorSymmetry(LivePathEffectObject *lpeobject) :
Effect(lpeobject),
+ mode(_("Mode"), _("Symmetry move mode"), "mode", MTConverter, &wr, this, MT_FREE),
discard_orig_path(_("Discard original path?"), _("Check this to only keep the mirrored part of the path"), "discard_orig_path", &wr, this, false),
- reflection_line(_("Reflection line:"), _("Line which serves as 'mirror' for the reflection"), "reflection_line", &wr, this, "M0,0 L100,100")
+ fuse_paths(_("Fuse paths"), _("Fuse original and the reflection into a single path"), "fuse_paths", &wr, this, false),
+ oposite_fuse(_("Opposite fuse"), _("Picks the other side of the mirror as the original"), "oposite_fuse", &wr, this, false),
+ start_point(_("Start mirror line"), _("Start mirror line"), "start_point", &wr, this, "Adjust the start of mirroring"),
+ end_point(_("End mirror line"), _("End mirror line"), "end_point", &wr, this, "Adjust end of mirroring")
{
show_orig_path = true;
+ registerParameter(&mode);
+ registerParameter( &discard_orig_path);
+ registerParameter( &fuse_paths);
+ registerParameter( &oposite_fuse);
+ registerParameter( &start_point);
+ registerParameter( &end_point);
apply_to_clippath_and_mask = true;
- registerParameter( dynamic_cast<Parameter *>(&discard_orig_path) );
- registerParameter( dynamic_cast<Parameter *>(&reflection_line) );
}
LPEMirrorSymmetry::~LPEMirrorSymmetry()
@@ -43,60 +91,276 @@ LPEMirrorSymmetry::~LPEMirrorSymmetry()
}
void
+
+LPEMirrorSymmetry::doBeforeEffect (SPLPEItem const* lpeitem)
+{
+ using namespace Geom;
+
+ Point point_a(boundingbox_X.max(), boundingbox_Y.min());
+ Point point_b(boundingbox_X.max(), boundingbox_Y.max());
+ Point point_c(boundingbox_X.max(), boundingbox_Y.middle());
+ if (mode == MT_Y) {
+ point_a = Geom::Point(boundingbox_X.min(),center_point[Y]);
+ point_b = Geom::Point(boundingbox_X.max(),center_point[Y]);
+ }
+ if (mode == MT_X) {
+ point_a = Geom::Point(center_point[X],boundingbox_Y.min());
+ point_b = Geom::Point(center_point[X],boundingbox_Y.max());
+ }
+ line_separation.setPoints(point_a, point_b);
+ if ( mode == MT_X || mode == MT_Y ) {
+ start_point.param_setValue(point_a);
+ end_point.param_setValue(point_b);
+ center_point = Geom::middle_point(point_a, point_b);
+ } else if ( mode == MT_FREE) {
+ if(!are_near(previous_center,center_point, 0.01)) {
+ Geom::Point trans = center_point - previous_center;
+ start_point.param_setValue(start_point * trans);
+ end_point.param_setValue(end_point * trans);
+ line_separation.setPoints(start_point, end_point);
+ } else {
+ center_point = Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
+ line_separation.setPoints(start_point, end_point);
+ }
+ } else if ( mode == MT_V){
+ if(SP_ACTIVE_DESKTOP){
+ SPDocument * doc = SP_ACTIVE_DESKTOP->getDocument();
+ Geom::Rect view_box_rect = doc->getViewBox();
+ Geom::Point sp = Geom::Point(view_box_rect.width()/2.0, 0);
+ sp *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
+ start_point.param_setValue(sp);
+ Geom::Point ep = Geom::Point(view_box_rect.width()/2.0, view_box_rect.height());
+ ep *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
+ end_point.param_setValue(ep);
+ center_point = Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
+ line_separation.setPoints(start_point, end_point);
+ }
+ } else { //horizontal page
+ if(SP_ACTIVE_DESKTOP){
+ SPDocument * doc = SP_ACTIVE_DESKTOP->getDocument();
+ Geom::Rect view_box_rect = doc->getViewBox();
+ Geom::Point sp = Geom::Point(0, view_box_rect.height()/2.0);
+ sp *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
+ start_point.param_setValue(sp);
+ Geom::Point ep = Geom::Point(view_box_rect.width(), view_box_rect.height()/2.0);
+ ep *= i2anc_affine(SP_OBJECT(lpeitem), SP_OBJECT(SP_ACTIVE_DESKTOP->currentLayer()->parent)) .inverse();
+ end_point.param_setValue(ep);
+ center_point = Geom::middle_point((Geom::Point)start_point, (Geom::Point)end_point);
+ line_separation.setPoints(start_point, end_point);
+ }
+ }
+ previous_center = center_point;
+}
+
+void
LPEMirrorSymmetry::doOnApply (SPLPEItem const* lpeitem)
{
using namespace Geom;
- // fixme: what happens if the bbox is empty?
- // fixme: this is probably wrong
- Geom::Affine t = lpeitem->i2dt_affine();
- Geom::Rect bbox = *lpeitem->desktopVisualBounds();
-
- Point A(bbox.left(), bbox.bottom());
- Point B(bbox.left(), bbox.top());
- A *= t;
- B *= t;
- Piecewise<D2<SBasis> > rline = Piecewise<D2<SBasis> >(D2<SBasis>(SBasis(A[X], B[X]), SBasis(A[Y], B[Y])));
- reflection_line.set_new_value(rline, true);
+ original_bbox(lpeitem);
+
+ Point point_a(boundingbox_X.max(), boundingbox_Y.min());
+ Point point_b(boundingbox_X.max(), boundingbox_Y.max());
+ Point point_c(boundingbox_X.max(), boundingbox_Y.middle());
+ start_point.param_setValue(point_a);
+ start_point.param_update_default(point_a);
+ end_point.param_setValue(point_b);
+ end_point.param_update_default(point_b);
+ center_point = point_c;
+ previous_center = center_point;
}
+
Geom::PathVector
LPEMirrorSymmetry::doEffect_path (Geom::PathVector const & path_in)
{
- // Don't allow empty path parameter:
- if ( reflection_line.get_pathvector().empty() ) {
- return path_in;
- }
-
+ Geom::PathVector const original_pathv = pathv_to_linear_and_cubic_beziers(path_in);
Geom::PathVector path_out;
- if (!discard_orig_path) {
- path_out = path_in;
+
+ if (!discard_orig_path && !fuse_paths) {
+ path_out = pathv_to_linear_and_cubic_beziers(path_in);
}
- Geom::PathVector mline(reflection_line.get_pathvector());
- Geom::Point A(mline.front().initialPoint());
- Geom::Point B(mline.back().finalPoint());
+ Geom::Point point_a(line_separation.initialPoint());
+ Geom::Point point_b(line_separation.finalPoint());
- Geom::Affine m1(1.0, 0.0, 0.0, 1.0, A[0], A[1]);
- double hyp = Geom::distance(A, B);
- double c = (B[0] - A[0]) / hyp; // cos(alpha)
- double s = (B[1] - A[1]) / hyp; // sin(alpha)
+ Geom::Translate m1(point_a[0], point_a[1]);
+ double hyp = Geom::distance(point_a, point_b);
+ double c = (point_b[0] - point_a[0]) / hyp; // cos(alpha)
+ double s = (point_b[1] - point_a[1]) / hyp; // sin(alpha)
Geom::Affine m2(c, -s, s, c, 0.0, 0.0);
- Geom::Affine sca(1.0, 0.0, 0.0, -1.0, 0.0, 0.0);
+ Geom::Scale sca(1.0, -1.0);
Geom::Affine m = m1.inverse() * m2;
m = m * sca;
m = m * m2.inverse();
m = m * m1;
- for (int i = 0; i < static_cast<int>(path_in.size()); ++i) {
- path_out.push_back(path_in[i] * m);
+ if (fuse_paths && !discard_orig_path) {
+ for (Geom::PathVector::const_iterator path_it = original_pathv.begin();
+ path_it != original_pathv.end(); ++path_it)
+ {
+ if (path_it->empty()) {
+ continue;
+ }
+ Geom::PathVector tmp_path;
+ double time_start = 0.0;
+ int position = 0;
+ bool end_open = false;
+ if (path_it->closed()) {
+ const Geom::Curve &closingline = path_it->back_closed();
+ if (!are_near(closingline.initialPoint(), closingline.finalPoint())) {
+ end_open = true;
+ }
+ }
+ Geom::Path original = *path_it;
+ if (end_open && path_it->closed()) {
+ original.close(false);
+ original.appendNew<Geom::LineSegment>( original.initialPoint() );
+ original.close(true);
+ }
+ Geom::Point s = start_point;
+ Geom::Point e = end_point;
+ double dir = line_separation.angle();
+ double diagonal = Geom::distance(Geom::Point(boundingbox_X.min(),boundingbox_Y.min()),Geom::Point(boundingbox_X.max(),boundingbox_Y.max()));
+ Geom::Rect bbox(Geom::Point(boundingbox_X.min(),boundingbox_Y.min()),Geom::Point(boundingbox_X.max(),boundingbox_Y.max()));
+ double size_divider = Geom::distance(center_point, bbox) + diagonal;
+ s = Geom::Point::polar(dir,size_divider) + center_point;
+ e = Geom::Point::polar(dir + Geom::rad_from_deg(180),size_divider) + center_point;
+ Geom::Path divider = Geom::Path(s);
+ divider.appendNew<Geom::LineSegment>(e);
+ Geom::Crossings cs = crossings(original, divider);
+ std::vector<double> crossed;
+ for(unsigned int i = 0; i < cs.size(); i++) {
+ crossed.push_back(cs[i].ta);
+ }
+ std::sort(crossed.begin(), crossed.end());
+ for (unsigned int i = 0; i < crossed.size(); i++) {
+ double time_end = crossed[i];
+ if (time_start != time_end && time_end - time_start > Geom::EPSILON) {
+ Geom::Path portion = original.portion(time_start, time_end);
+ if (!portion.empty()) {
+ Geom::Point middle = portion.pointAt((double)portion.size()/2.0);
+ position = Geom::sgn(Geom::cross(e - s, middle - s));
+ if (!oposite_fuse) {
+ position *= -1;
+ }
+ if (position == 1) {
+ Geom::Path mirror = portion.reversed() * m;
+ mirror.setInitial(portion.finalPoint());
+ portion.append(mirror);
+ if(i!=0) {
+ portion.setFinal(portion.initialPoint());
+ portion.close();
+ }
+ tmp_path.push_back(portion);
+ }
+ portion.clear();
+ }
+ }
+ time_start = time_end;
+ }
+ position = Geom::sgn(Geom::cross(e - s, original.finalPoint() - s));
+ if (!oposite_fuse) {
+ position *= -1;
+ }
+ if (cs.size()!=0 && position == 1) {
+ if (time_start != original.size() && original.size() - time_start > Geom::EPSILON) {
+ Geom::Path portion = original.portion(time_start, original.size());
+ if (!portion.empty()) {
+ portion = portion.reversed();
+ Geom::Path mirror = portion.reversed() * m;
+ mirror.setInitial(portion.finalPoint());
+ portion.append(mirror);
+ portion = portion.reversed();
+ if (!original.closed()) {
+ tmp_path.push_back(portion);
+ } else {
+ if (cs.size() > 1 && tmp_path.size() > 0 && tmp_path[0].size() > 0 ) {
+ portion.setFinal(tmp_path[0].initialPoint());
+ portion.setInitial(tmp_path[0].finalPoint());
+ tmp_path[0].append(portion);
+ } else {
+ tmp_path.push_back(portion);
+ }
+ tmp_path[0].close();
+ }
+ portion.clear();
+ }
+ }
+ }
+ if (cs.size() == 0 && position == 1) {
+ tmp_path.push_back(original);
+ tmp_path.push_back(original * m);
+ }
+ path_out.insert(path_out.end(), tmp_path.begin(), tmp_path.end());
+ tmp_path.clear();
+ }
+ }
+
+ if (!fuse_paths || discard_orig_path) {
+ for (int i = 0; i < static_cast<int>(path_in.size()); ++i) {
+ path_out.push_back(path_in[i] * m);
+ }
}
return path_out;
}
+void
+LPEMirrorSymmetry::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
+{
+ using namespace Geom;
+ hp_vec.clear();
+ Geom::Path path;
+ Geom::Point s = start_point;
+ Geom::Point e = end_point;
+ path.start( s );
+ path.appendNew<Geom::LineSegment>( e );
+ Geom::PathVector helper;
+ helper.push_back(path);
+ hp_vec.push_back(helper);
+}
+
+void
+LPEMirrorSymmetry::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item)
+{
+ SPKnotShapeType knot_shape = SP_KNOT_SHAPE_CIRCLE;
+ SPKnotModeType knot_mode = SP_KNOT_MODE_XOR;
+ guint32 knot_color = 0x0000ff00;
+ {
+ KnotHolderEntity *c = new MS::KnotHolderEntityCenterMirrorSymmetry(this);
+ c->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ _("Adjust the center"), knot_shape, knot_mode, knot_color );
+ knotholder->add(c);
+ }
+};
+
+namespace MS {
+
+using namespace Geom;
+
+void
+KnotHolderEntityCenterMirrorSymmetry::knot_set(Geom::Point const &p, Geom::Point const &origin, guint state)
+{
+ LPEMirrorSymmetry* lpe = dynamic_cast<LPEMirrorSymmetry *>(_effect);
+ Geom::Point const s = snap_knot_position(p, state);
+ lpe->center_point = s;
+
+ // FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating.
+ sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true);
+}
+
+Geom::Point
+KnotHolderEntityCenterMirrorSymmetry::knot_get() const
+{
+ LPEMirrorSymmetry const *lpe = dynamic_cast<LPEMirrorSymmetry const*>(_effect);
+ return lpe->center_point;
+}
+
+} // namespace CR
+
} //namespace LivePathEffect
} /* namespace Inkscape */
diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h
index 64a72d7b3..3a244cb7e 100644
--- a/src/live_effects/lpe-mirror_symmetry.h
+++ b/src/live_effects/lpe-mirror_symmetry.h
@@ -8,6 +8,7 @@
* Authors:
* Maximilian Albert
* Johan Engelen
+ * Jabiertxof
*
* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
* Copyright (C) Maximilin Albert 2008 <maximilian.albert@gmail.com>
@@ -19,22 +20,50 @@
#include "live_effects/parameter/parameter.h"
#include "live_effects/parameter/point.h"
#include "live_effects/parameter/path.h"
+#include "live_effects/parameter/enum.h"
+#include "live_effects/lpegroupbbox.h"
namespace Inkscape {
namespace LivePathEffect {
-class LPEMirrorSymmetry : public Effect {
+namespace MS {
+// we need a separate namespace to avoid clashes with LPEPerpBisector
+class KnotHolderEntityCenterMirrorSymmetry;
+}
+
+enum ModeType {
+ MT_V,
+ MT_H,
+ MT_FREE,
+ MT_X,
+ MT_Y,
+ MT_END
+};
+
+class LPEMirrorSymmetry : public Effect, GroupBBoxEffect {
public:
LPEMirrorSymmetry(LivePathEffectObject *lpeobject);
virtual ~LPEMirrorSymmetry();
-
virtual void doOnApply (SPLPEItem const* lpeitem);
-
+ virtual void doBeforeEffect (SPLPEItem const* lpeitem);
virtual Geom::PathVector doEffect_path (Geom::PathVector const & path_in);
+ /* the knotholder entity classes must be declared friends */
+ friend class MS::KnotHolderEntityCenterMirrorSymmetry;
+ void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item);
+
+protected:
+ virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector<Geom::PathVector> &hp_vec);
private:
+ EnumParam<ModeType> mode;
BoolParam discard_orig_path;
- PathParam reflection_line;
+ BoolParam fuse_paths;
+ BoolParam oposite_fuse;
+ PointParam start_point;
+ PointParam end_point;
+ Geom::Line line_separation;
+ Geom::Point previous_center;
+ Geom::Point center_point;
LPEMirrorSymmetry(const LPEMirrorSymmetry&);
LPEMirrorSymmetry& operator=(const LPEMirrorSymmetry&);
diff --git a/src/main-cmdlineact.cpp b/src/main-cmdlineact.cpp
index ade83dfda..496c16d5d 100644
--- a/src/main-cmdlineact.cpp
+++ b/src/main-cmdlineact.cpp
@@ -4,7 +4,7 @@
*
* Copyright (C) 2007 Authors
*
- * Released under GNU GPL v2, read the file 'COPYING' for more information
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information
*/
#include <ui/view/view.h>
diff --git a/src/main-cmdlineact.h b/src/main-cmdlineact.h
index c8ef64f10..b8ec4403b 100644
--- a/src/main-cmdlineact.h
+++ b/src/main-cmdlineact.h
@@ -12,7 +12,7 @@
*
* Copyright (C) 2007 Authors
*
- * Released under GNU GPL v2.x, read the file 'COPYING' for more information
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information
*/
namespace Inkscape {
diff --git a/src/main.cpp b/src/main.cpp
index 840643a90..8cf52127b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -52,6 +52,11 @@
#include <glib-object.h>
#include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(3,0,0)
+#include <gtkmm/cssprovider.h>
+#include <gdkmm/screen.h>
+#endif
+
#include "inkgc/gc-core.h"
#ifdef AND
@@ -488,7 +493,7 @@ struct poptOption options[] = {
POPT_ARG_NONE, &sp_vacuum_defs, SP_ARG_VACUUM_DEFS,
N_("Remove unused definitions from the defs section(s) of the document"),
NULL},
-
+
#ifdef WITH_DBUS
{"dbus-listen", 0,
POPT_ARG_NONE, &sp_dbus_listen, SP_ARG_DBUS_LISTEN,
@@ -546,7 +551,7 @@ static void _win32_set_inkscape_env(gchar const *exe)
gchar *perl = g_build_filename(exe, "python", NULL);
gchar *pythonlib = g_build_filename(exe, "python", "Lib", NULL);
gchar *pythondll = g_build_filename(exe, "python", "DLLs", NULL);
-
+
// Python 2.x needs short paths in PYTHONPATH.
// Otherwise it doesn't work when Inkscape is installed in Unicode directories.
// g_win32_locale_filename_from_utf8 is the GLib wrapper for GetShortPathName.
@@ -597,14 +602,14 @@ static void _win32_set_inkscape_env(gchar const *exe)
g_free(perl);
g_free(pythonlib);
g_free(pythondll);
-
+
g_free(python_s);
g_free(pythonlib_s);
g_free(pythondll_s);
g_free(new_path);
g_free(new_pythonpath);
-
+
g_free(localepath);
}
#endif
@@ -614,7 +619,7 @@ static void set_extensions_env()
gchar const *pythonpath = g_getenv("PYTHONPATH");
gchar *extdir;
gchar *new_pythonpath;
-
+
#ifdef WIN32
extdir = g_win32_locale_filename_from_utf8(INKSCAPE_EXTENSIONDIR);
#else
@@ -900,7 +905,7 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest )
if ( sp_global_printer )
sp_global_printer_utf8 = g_strdup( sp_global_printer );
}
-
+
#ifdef WITH_DBUS
// Before initializing extensions, we must set the DBus bus name if required
if (sp_dbus_name != NULL) {
@@ -1051,6 +1056,66 @@ sp_main_gui(int argc, char const **argv)
#endif
g_free(usericondir);
+
+#if GTK_CHECK_VERSION(3,0,0)
+ // Add style sheet (GTK3)
+ Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default();
+
+ Glib::ustring inkscape_style = INKSCAPE_UIDIR;
+ inkscape_style += "/style.css";
+ // std::cout << "CSS Stylesheet Inkscape: " << inkscape_style << std::endl;
+
+ if (g_file_test (inkscape_style.c_str(), G_FILE_TEST_EXISTS)) {
+ Glib::RefPtr<Gtk::CssProvider> provider = Gtk::CssProvider::create();
+
+ // From 3.16, throws an error which we must catch.
+ try {
+ provider->load_from_path (inkscape_style);
+ }
+#if GTK_CHECK_VERSION(3,16,0)
+ // Gtk::CssProviderError not defined until 3.16.
+ catch (const Gtk::CssProviderError& ex)
+ {
+ std::cerr << "CSSProviderError::load_from_path(): failed to load: " << inkscape_style
+ << "\n (" << ex.what() << ")" << std::endl;
+ }
+#else
+ catch (...)
+ {}
+#endif
+
+ Gtk::StyleContext::add_provider_for_screen (screen, provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ } else {
+ std::cerr << "sp_main_gui: Cannot find default style file:\n (" << inkscape_style
+ << ")" << std::endl;
+ }
+
+ Glib::ustring user_style = Inkscape::Application::profile_path("ui/style.css");
+ // std::cout << "CSS Stylesheet User: " << user_style << std::endl;
+
+ if (g_file_test (user_style.c_str(), G_FILE_TEST_EXISTS)) {
+ Glib::RefPtr<Gtk::CssProvider> provider2 = Gtk::CssProvider::create();
+
+ // From 3.16, throws an error which we must catch.
+ try {
+ provider2->load_from_path (user_style);
+ }
+#if GTK_CHECK_VERSION(3,16,0)
+ // Gtk::CssProviderError not defined until 3.16.
+ catch (const Gtk::CssProviderError& ex)
+ {
+ std::cerr << "CSSProviderError::load_from_path(): failed to load: " << user_style
+ << "\n (" << ex.what() << ")" << std::endl;
+ }
+#else
+ catch (...)
+ {}
+#endif
+
+ Gtk::StyleContext::add_provider_for_screen (screen, provider2, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
+#endif
+
gdk_event_handler_set((GdkEventFunc)snooper, NULL, NULL);
Inkscape::Debug::log_display_config();
@@ -1134,7 +1199,7 @@ static int sp_process_file_list(GSList *fl)
if (sp_vacuum_defs) {
doc->vacuumDocument();
}
-
+
// Execute command-line actions (selections and verbs) using our local models
bool has_performed_actions = Inkscape::CmdLineAction::doList(INKSCAPE.active_action_context());
@@ -1645,9 +1710,9 @@ static int sp_do_export_png(SPDocument *doc)
g_print("Background RRGGBBAA: %08x\n", bgcolor);
g_print("Area %g:%g:%g:%g exported to %lu x %lu pixels (%g dpi)\n", area[Geom::X][0], area[Geom::Y][0], area[Geom::X][1], area[Geom::Y][1], width, height, dpi);
-
+
reverse(items.begin(),items.end());
-
+
if ((width >= 1) && (height >= 1) && (width <= PNG_UINT_31_MAX) && (height <= PNG_UINT_31_MAX)) {
if( sp_export_png_file(doc, path.c_str(), area, width, height, dpi,
dpi, bgcolor, NULL, NULL, true, sp_export_id_only ? items : std::vector<SPItem*>()) == 1 ) {
@@ -1817,7 +1882,7 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime)
}
/**
- * Export a document to EMF or WMF
+ * Export a document to EMF or WMF
*
* \param doc Document to export.
* \param uri URI to export to.
diff --git a/src/profile-manager.cpp b/src/profile-manager.cpp
index 035aa6051..26e1cd72c 100644
--- a/src/profile-manager.cpp
+++ b/src/profile-manager.cpp
@@ -34,9 +34,8 @@ void ProfileManager::_resourcesChanged()
{
std::vector<SPObject*> newList;
if (_doc) {
- std::set<SPObject *> current = _doc->getResourceList( "iccprofile" );
- for (std::set<SPObject *>::const_iterator i = current.begin(); i != current.end(); ++i)
- newList.push_back(*i);
+ std::vector<SPObject *> current = _doc->getResourceList( "iccprofile" );
+ newList = current;
}
sort( newList.begin(), newList.end() );
diff --git a/src/pure-transform.cpp b/src/pure-transform.cpp
index 9c7054b9f..db4926258 100644
--- a/src/pure-transform.cpp
+++ b/src/pure-transform.cpp
@@ -63,9 +63,9 @@ void PureTransform::snap(::SnapManager *sm, std::vector<Inkscape::SnapCandidateP
(*j).setSourceNum(0);
first_free_snap = false;
}
+
Inkscape::SnappedPoint snapped_point = snap(sm, *j, (*i).getPoint(), bbox); // Calls the snap() method of the derived classes
- // std::cout << "dist = " << snapped_point.getSnapDistance() << std::endl;
snapped_point.setPointerDistance(Geom::L2(pointer - (*i).getPoint()));
/*Find the transformation that describes where the snapped point has
@@ -85,16 +85,22 @@ void PureTransform::snap(::SnapManager *sm, std::vector<Inkscape::SnapCandidateP
// We might still need to apply a constraint though, if we tried a constrained snap. And
// in case of a free snap we might have use for the transformed point, so let's return that
// point, whether it's constrained or not
- if (best_snapped_point.isOtherSnapBetter(snapped_point, true) || points.size() == 1) {
- // .. so we must keep track of the best non-snapped constrained point
+
+ if (best_snapped_point.isOtherSnapBetter(snapped_point, true) ) {
+ // .. so we must keep track of the best non-snapped constrained point.. but what
+ // is the best? There is no best, or is there? We cannot compare on snapped distance
+ // because neither has snapped, and both have their snapped distance set to infinity.
+ // There might be a difference in "constrainedness" though, 1D vs 2D snapping
store_best_snap = true;
}
}
}
- if (store_best_snap) {
+ if (store_best_snap || i == points.begin()) {
best_original_point = (*i);
- best_snapped_point = snapped_point;
+ best_snapped_point = snapped_point; // Can be a point that didn't snap, but then at least we
+ // return something meaningful; we might have use for the transformation. The default
+ // snapped_point, as initialized before this loop, is not very meaningful at all.
}
++j;
@@ -119,7 +125,7 @@ Geom::Point PureTranslate::getTransformedPoint(SnapCandidatePoint const &p) cons
return p.getPoint() + _vector;
}
-void PureTranslate::storeTransform(SnapCandidatePoint const original_point, SnappedPoint const snapped_point) {
+void PureTranslate::storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point) {
/* Consider the case in which a box is almost aligned with a grid in both
* horizontal and vertical directions. The distance to the intersection of
* the grid lines will always be larger then the distance to a single grid
@@ -156,7 +162,7 @@ Geom::Point PureScale::getTransformedPoint(SnapCandidatePoint const &p) const {
return (p.getPoint() - _origin) * _scale + _origin;
}
-void PureScale::storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point) {
+void PureScale::storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point) {
_scale_snapped = Geom::Scale(Geom::infinity(), Geom::infinity());
// If this point *i is horizontally or vertically aligned with
// the origin of the scaling, then it will scale purely in X or Y
@@ -174,6 +180,14 @@ void PureScale::storeTransform(SnapCandidatePoint const original_point, SnappedP
// we might have left result[1-index] = Geom::infinity() if scaling didn't occur in the other direction
}
}
+
+ if (_scale_snapped == Geom::Scale(Geom::infinity(), Geom::infinity())) {
+ // This point must have been at the origin, so we cannot possibly snap; it won't scale (i.e. won't move while dragging)
+ snapped_point.setSnapDistance(Geom::infinity());
+ snapped_point.setSecondSnapDistance(Geom::infinity());
+ return;
+ }
+
if (_uniform) {
// Lock the scaling the be uniform, but keep the sign such that we don't change which quadrant we have dragged into
if (fabs(_scale_snapped[0]) < fabs(_scale_snapped[1])) {
@@ -253,16 +267,16 @@ SnappedPoint PureStretchConstrained::snap(::SnapManager *sm, SnapCandidatePoint
return sm->constrainedSnap(p, dedicated_constraint, bbox_to_snap);
}
-void PureStretchConstrained::storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point) {
+void PureStretchConstrained::storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point) {
Geom::Point const a = snapped_point.getPoint() - _origin; // vector to snapped point
Geom::Point const b = original_point.getPoint() - _origin; // vector to original point (not the transformed point!)
_stretch_snapped = Geom::Scale(Geom::infinity(), Geom::infinity());
- if (fabs(b[_direction]) > 1e-6) { // if STRETCHING will occur for this point
+ if (fabs(b[_direction]) > 1e-4) { // if STRETCHING will occur for this point
_stretch_snapped[_direction] = a[_direction] / b[_direction];
_stretch_snapped[1-_direction] = _uniform ? _stretch_snapped[_direction] : 1;
} else { // STRETCHING might occur for this point, but only when the stretching is uniform
- if (_uniform && fabs(b[1-_direction]) > 1e-6) {
+ if (_uniform && fabs(b[1-_direction]) > 1e-4) {
_stretch_snapped[1-_direction] = a[1-_direction] / b[1-_direction];
_stretch_snapped[_direction] = _stretch_snapped[1-_direction];
}
@@ -304,7 +318,7 @@ SnappedPoint PureSkewConstrained::snap(::SnapManager *sm, SnapCandidatePoint con
return sm->constrainedSnap(p, Inkscape::Snapper::SnapConstraint(constraint_vector), bbox_to_snap);
}
-void PureSkewConstrained::storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point) {
+void PureSkewConstrained::storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point) {
Geom::Point const b = original_point.getPoint() - _origin; // vector to original point (not the transformed point!)
_skew_snapped = (snapped_point.getPoint()[_direction] - (original_point.getPoint())[_direction]) / b[1 - _direction]; // skew factor
@@ -335,7 +349,7 @@ SnappedPoint PureRotateConstrained::snap(::SnapManager *sm, SnapCandidatePoint c
return sm->constrainedSnap(p, dedicated_constraint, bbox_to_snap);
}
-void PureRotateConstrained::storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point) {
+void PureRotateConstrained::storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point) {
Geom::Point const a = snapped_point.getPoint() - _origin; // vector to snapped point
Geom::Point const b = (original_point.getPoint() - _origin); // vector to original point (not the transformed point!)
// a is vector to snapped point; b is vector to original point; now lets calculate angle between a and b
diff --git a/src/pure-transform.h b/src/pure-transform.h
index f973a95b1..98aa9772a 100644
--- a/src/pure-transform.h
+++ b/src/pure-transform.h
@@ -26,7 +26,7 @@ class PureTransform {
protected:
virtual SnappedPoint snap(::SnapManager *sm, SnapCandidatePoint const &p, Geom::Point pt_orig, Geom::OptRect const &bbox_to_snap) const = 0;
virtual Geom::Point getTransformedPoint(SnapCandidatePoint const &p) const = 0;
- virtual void storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point) = 0;
+ virtual void storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point) = 0;
public:
//PureTransform();
@@ -48,7 +48,7 @@ protected:
virtual SnappedPoint snap(::SnapManager *sm, SnapCandidatePoint const &p, Geom::Point pt_orig, Geom::OptRect const &bbox_to_snap) const;
virtual Geom::Point getTransformedPoint(SnapCandidatePoint const &p) const;
- virtual void storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point);
+ virtual void storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point);
public:
// PureTranslate(); // Default constructor
@@ -90,7 +90,7 @@ protected:
virtual SnappedPoint snap(::SnapManager *sm, SnapCandidatePoint const &p, Geom::Point pt_orig, Geom::OptRect const &bbox_to_snap) const;
virtual Geom::Point getTransformedPoint(SnapCandidatePoint const &p) const;
- virtual void storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point);
+ virtual void storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point);
public:
// PureScale(); // Default constructor
@@ -135,7 +135,7 @@ protected:
virtual SnappedPoint snap(::SnapManager *sm, SnapCandidatePoint const &p, Geom::Point pt_orig, Geom::OptRect const &bbox_to_snap) const;
virtual Geom::Point getTransformedPoint(SnapCandidatePoint const &p) const;
- virtual void storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point);
+ virtual void storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point);
public:
virtual ~PureStretchConstrained() {};
@@ -172,7 +172,7 @@ protected:
virtual SnappedPoint snap(::SnapManager *sm, SnapCandidatePoint const &p, Geom::Point pt_orig, Geom::OptRect const &bbox_to_snap) const;
Geom::Point getTransformedPoint(SnapCandidatePoint const &p) const;
- virtual void storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point);
+ virtual void storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point);
public:
virtual ~PureSkewConstrained() {};
@@ -203,7 +203,7 @@ protected:
virtual SnappedPoint snap(::SnapManager *sm, SnapCandidatePoint const &p, Geom::Point pt_orig, Geom::OptRect const &bbox_to_snap) const;
virtual Geom::Point getTransformedPoint(SnapCandidatePoint const &p) const;
- virtual void storeTransform(SnapCandidatePoint const original_point, SnappedPoint snapped_point);
+ virtual void storeTransform(SnapCandidatePoint const &original_point, SnappedPoint &snapped_point);
public:
// PureRotate(); // Default constructor
diff --git a/src/resource-manager.cpp b/src/resource-manager.cpp
index 18d7c6ba2..09b9364c6 100644
--- a/src/resource-manager.cpp
+++ b/src/resource-manager.cpp
@@ -179,8 +179,8 @@ std::vector<Glib::ustring> ResourceManagerImpl::findBrokenLinks( SPDocument *doc
std::set<Glib::ustring> uniques;
if ( doc ) {
- std::set<SPObject *> images = doc->getResourceList("image");
- for (std::set<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) {
+ std::vector<SPObject *> images = doc->getResourceList("image");
+ for (std::vector<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) {
Inkscape::XML::Node *ir = (*it)->getRepr();
gchar const *href = ir->attribute("xlink:href");
@@ -306,8 +306,8 @@ bool ResourceManagerImpl::fixupBrokenLinks(SPDocument *doc)
bool savedUndoState = DocumentUndo::getUndoSensitive(doc);
DocumentUndo::setUndoSensitive(doc, true);
- std::set<SPObject *> images = doc->getResourceList("image");
- for (std::set<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) {
+ std::vector<SPObject *> images = doc->getResourceList("image");
+ for (std::vector<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) {
Inkscape::XML::Node *ir = (*it)->getRepr();
gchar const *href = ir->attribute("xlink:href");
diff --git a/src/sp-flowtext.h b/src/sp-flowtext.h
index 9e6046469..9ee676893 100644
--- a/src/sp-flowtext.h
+++ b/src/sp-flowtext.h
@@ -49,6 +49,11 @@ public:
bool _optimizeScaledText;
+ /** Converts the text object to its component curves */
+ SPCurve *getNormalizedBpath() const {
+ return layout.convertToCurves();
+ }
+
/** Optimize scaled flow text on next set_transform. */
void optimizeScaledText()
{_optimizeScaledText = true;}
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 17a1a9ff1..c80fc7122 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -264,7 +264,7 @@ void sp_guide_create_guides_around_page(SPDesktop *dt)
void sp_guide_delete_all_guides(SPDesktop *dt)
{
SPDocument *doc=dt->getDocument();
- std::set<SPObject *> current = doc->getResourceList("guide");
+ std::vector<SPObject *> current = doc->getResourceList("guide");
while (!current.empty()){
SPGuide* guide = SP_GUIDE(*(current.begin()));
sp_guide_remove(guide);
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 461445ee0..1bc6da3e1 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -862,7 +862,7 @@ void sp_selected_path_outline_add_marker( SPObject *marker_object, Geom::Affine
if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {
tr = stroke_scale * tr;
}
-
+
// total marker transform
tr = marker_item->transform * marker->c2p * tr * transform;
@@ -1153,7 +1153,9 @@ sp_selected_path_outline(SPDesktop *desktop)
desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>stroked path(s)</b> to convert stroke to path."));
return;
}
-
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ bool scale_stroke = prefs->getBool("/options/transform/stroke", true);
+ prefs->setBool("/options/transform/stroke", true);
bool did = false;
std::vector<SPItem*> il(selection->itemList());
for (std::vector<SPItem*>::const_iterator l = il.begin(); l != il.end(); l++){
@@ -1503,7 +1505,7 @@ sp_selected_path_outline(SPDesktop *desktop)
delete res;
delete orig;
}
-
+ prefs->setBool("/options/transform/stroke", scale_stroke);
if (did) {
DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_OUTLINE,
_("Convert stroke to path"));
@@ -1774,11 +1776,14 @@ sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset)
SPItem *item = *l;
SPCurve *curve = NULL;
- if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item))
+ if (!SP_IS_SHAPE(item) && !SP_IS_TEXT(item) && !SP_IS_FLOWTEXT(item))
continue;
else if (SP_IS_SHAPE(item)) {
curve = SP_SHAPE(item)->getCurve();
}
+ else if (SP_IS_FLOWTEXT(item)) {
+ curve = SP_FLOWTEXT(item)->getNormalizedBpath();
+ }
else { // Item must be SP_TEXT
curve = SP_TEXT(item)->getNormalizedBpath();
}
diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp
index b653a630d..1a87a9718 100644
--- a/src/ui/dialog/aboutbox.cpp
+++ b/src/ui/dialog/aboutbox.cpp
@@ -618,288 +618,629 @@ void AboutBox::initStrings() {
* This text is copied from the COPYING file
*/
license_text =
- " GNU GENERAL PUBLIC LICENSE\n"
- " Version 2, June 1991\n"
+ " GNU GENERAL PUBLIC LICENSE\n"
+ " Version 3, 29 June 2007\n"
"\n"
- " Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n"
- " 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"
+ " Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n"
" Everyone is permitted to copy and distribute verbatim copies\n"
" of this license document, but changing it is not allowed.\n"
"\n"
- " Preamble\n"
+ " Preamble\n"
"\n"
- " The licenses for most software are designed to take away your\n"
- "freedom to share and change it. By contrast, the GNU General Public\n"
- "License is intended to guarantee your freedom to share and change free\n"
- "software--to make sure the software is free for all its users. This\n"
- "General Public License applies to most of the Free Software\n"
- "Foundation's software and to any other program whose authors commit to\n"
- "using it. (Some other Free Software Foundation software is covered by\n"
- "the GNU Library General Public License instead.) You can apply it to\n"
+ " The GNU General Public License is a free, copyleft license for\n"
+ "software and other kinds of works.\n"
+ "\n"
+ " The licenses for most software and other practical works are designed\n"
+ "to take away your freedom to share and change the works. By contrast,\n"
+ "the GNU General Public License is intended to guarantee your freedom to\n"
+ "share and change all versions of a program--to make sure it remains free\n"
+ "software for all its users. We, the Free Software Foundation, use the\n"
+ "GNU General Public License for most of our software; it applies also to\n"
+ "any other work released this way by its authors. You can apply it to\n"
"your programs, too.\n"
"\n"
" When we speak of free software, we are referring to freedom, not\n"
"price. Our General Public Licenses are designed to make sure that you\n"
"have the freedom to distribute copies of free software (and charge for\n"
- "this service if you wish), that you receive source code or can get it\n"
- "if you want it, that you can change the software or use pieces of it\n"
- "in new free programs; and that you know you can do these things.\n"
+ "them if you wish), that you receive source code or can get it if you\n"
+ "want it, that you can change the software or use pieces of it in new\n"
+ "free programs, and that you know you can do these things.\n"
"\n"
- " To protect your rights, we need to make restrictions that forbid\n"
- "anyone to deny you these rights or to ask you to surrender the rights.\n"
- "These restrictions translate to certain responsibilities for you if you\n"
- "distribute copies of the software, or if you modify it.\n"
+ " To protect your rights, we need to prevent others from denying you\n"
+ "these rights or asking you to surrender the rights. Therefore, you have\n"
+ "certain responsibilities if you distribute copies of the software, or if\n"
+ "you modify it: responsibilities to respect the freedom of others.\n"
"\n"
" For example, if you distribute copies of such a program, whether\n"
- "gratis or for a fee, you must give the recipients all the rights that\n"
- "you have. You must make sure that they, too, receive or can get the\n"
- "source code. And you must show them these terms so they know their\n"
- "rights.\n"
- "\n"
- " We protect your rights with two steps: (1) copyright the software, and\n"
- "(2) offer you this license which gives you legal permission to copy,\n"
- "distribute and/or modify the software.\n"
- "\n"
- " Also, for each author's protection and ours, we want to make certain\n"
- "that everyone understands that there is no warranty for this free\n"
- "software. If the software is modified by someone else and passed on, we\n"
- "want its recipients to know that what they have is not the original, so\n"
- "that any problems introduced by others will not reflect on the original\n"
- "authors' reputations.\n"
- "\n"
- " Finally, any free program is threatened constantly by software\n"
- "patents. We wish to avoid the danger that redistributors of a free\n"
- "program will individually obtain patent licenses, in effect making the\n"
- "program proprietary. To prevent this, we have made it clear that any\n"
- "patent must be licensed for everyone's free use or not licensed at all.\n"
+ "gratis or for a fee, you must pass on to the recipients the same\n"
+ "freedoms that you received. You must make sure that they, too, receive\n"
+ "or can get the source code. And you must show them these terms so they\n"
+ "know their rights.\n"
+ "\n"
+ " Developers that use the GNU GPL protect your rights with two steps:\n"
+ "(1) assert copyright on the software, and (2) offer you this License\n"
+ "giving you legal permission to copy, distribute and/or modify it.\n"
+ "\n"
+ " For the developers' and authors' protection, the GPL clearly explains\n"
+ "that there is no warranty for this free software. For both users' and\n"
+ "authors' sake, the GPL requires that modified versions be marked as\n"
+ "changed, so that their problems will not be attributed erroneously to\n"
+ "authors of previous versions.\n"
+ "\n"
+ " Some devices are designed to deny users access to install or run\n"
+ "modified versions of the software inside them, although the manufacturer\n"
+ "can do so. This is fundamentally incompatible with the aim of\n"
+ "protecting users' freedom to change the software. The systematic\n"
+ "pattern of such abuse occurs in the area of products for individuals to\n"
+ "use, which is precisely where it is most unacceptable. Therefore, we\n"
+ "have designed this version of the GPL to prohibit the practice for those\n"
+ "products. If such problems arise substantially in other domains, we\n"
+ "stand ready to extend this provision to those domains in future versions\n"
+ "of the GPL, as needed to protect the freedom of users.\n"
+ "\n"
+ " Finally, every program is threatened constantly by software patents.\n"
+ "States should not allow patents to restrict development and use of\n"
+ "software on general-purpose computers, but in those that do, we wish to\n"
+ "avoid the special danger that patents applied to a free program could\n"
+ "make it effectively proprietary. To prevent this, the GPL assures that\n"
+ "patents cannot be used to render the program non-free.\n"
"\n"
" The precise terms and conditions for copying, distribution and\n"
"modification follow.\n"
"\n"
- " GNU GENERAL PUBLIC LICENSE\n"
- " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n"
- "\n"
- " 0. This License applies to any program or other work which contains\n"
- "a notice placed by the copyright holder saying it may be distributed\n"
- "under the terms of this General Public License. The \"Program\", below,\n"
- "refers to any such program or work, and a \"work based on the Program\"\n"
- "means either the Program or any derivative work under copyright law:\n"
- "that is to say, a work containing the Program or a portion of it,\n"
- "either verbatim or with modifications and/or translated into another\n"
- "language. (Hereinafter, translation is included without limitation in\n"
- "the term \"modification\".) Each licensee is addressed as \"you\".\n"
- "\n"
- "Activities other than copying, distribution and modification are not\n"
- "covered by this License; they are outside its scope. The act of\n"
- "running the Program is not restricted, and the output from the Program\n"
- "is covered only if its contents constitute a work based on the\n"
- "Program (independent of having been made by running the Program).\n"
- "Whether that is true depends on what the Program does.\n"
- "\n"
- " 1. You may copy and distribute verbatim copies of the Program's\n"
- "source code as you receive it, in any medium, provided that you\n"
- "conspicuously and appropriately publish on each copy an appropriate\n"
- "copyright notice and disclaimer of warranty; keep intact all the\n"
- "notices that refer to this License and to the absence of any warranty;\n"
- "and give any other recipients of the Program a copy of this License\n"
- "along with the Program.\n"
- "\n"
- "You may charge a fee for the physical act of transferring a copy, and\n"
- "you may at your option offer warranty protection in exchange for a fee.\n"
- "\n"
- " 2. You may modify your copy or copies of the Program or any portion\n"
- "of it, thus forming a work based on the Program, and copy and\n"
- "distribute such modifications or work under the terms of Section 1\n"
- "above, provided that you also meet all of these conditions:\n"
- "\n"
- " a) You must cause the modified files to carry prominent notices\n"
- " stating that you changed the files and the date of any change.\n"
- "\n"
- " b) You must cause any work that you distribute or publish, that in\n"
- " whole or in part contains or is derived from the Program or any\n"
- " part thereof, to be licensed as a whole at no charge to all third\n"
- " parties under the terms of this License.\n"
- "\n"
- " c) If the modified program normally reads commands interactively\n"
- " when run, you must cause it, when started running for such\n"
- " interactive use in the most ordinary way, to print or display an\n"
- " announcement including an appropriate copyright notice and a\n"
- " notice that there is no warranty (or else, saying that you provide\n"
- " a warranty) and that users may redistribute the program under\n"
- " these conditions, and telling the user how to view a copy of this\n"
- " License. (Exception: if the Program itself is interactive but\n"
- " does not normally print such an announcement, your work based on\n"
- " the Program is not required to print an announcement.)\n"
- "\n"
- "These requirements apply to the modified work as a whole. If\n"
- "identifiable sections of that work are not derived from the Program,\n"
- "and can be reasonably considered independent and separate works in\n"
- "themselves, then this License, and its terms, do not apply to those\n"
- "sections when you distribute them as separate works. But when you\n"
- "distribute the same sections as part of a whole which is a work based\n"
- "on the Program, the distribution of the whole must be on the terms of\n"
- "this License, whose permissions for other licensees extend to the\n"
- "entire whole, and thus to each and every part regardless of who wrote it.\n"
- "\n"
- "Thus, it is not the intent of this section to claim rights or contest\n"
- "your rights to work written entirely by you; rather, the intent is to\n"
- "exercise the right to control the distribution of derivative or\n"
- "collective works based on the Program.\n"
- "\n"
- "In addition, mere aggregation of another work not based on the Program\n"
- "with the Program (or with a work based on the Program) on a volume of\n"
- "a storage or distribution medium does not bring the other work under\n"
- "the scope of this License.\n"
- "\n"
- " 3. You may copy and distribute the Program (or a work based on it,\n"
- "under Section 2) in object code or executable form under the terms of\n"
- "Sections 1 and 2 above provided that you also do one of the following:\n"
- "\n"
- " a) Accompany it with the complete corresponding machine-readable\n"
- " source code, which must be distributed under the terms of Sections\n"
- " 1 and 2 above on a medium customarily used for software interchange; or,\n"
- "\n"
- " b) Accompany it with a written offer, valid for at least three\n"
- " years, to give any third party, for a charge no more than your\n"
- " cost of physically performing source distribution, a complete\n"
- " machine-readable copy of the corresponding source code, to be\n"
- " distributed under the terms of Sections 1 and 2 above on a medium\n"
- " customarily used for software interchange; or,\n"
- "\n"
- " c) Accompany it with the information you received as to the offer\n"
- " to distribute corresponding source code. (This alternative is\n"
- " allowed only for noncommercial distribution and only if you\n"
- " received the program in object code or executable form with such\n"
- " an offer, in accord with Subsection b above.)\n"
- "\n"
- "The source code for a work means the preferred form of the work for\n"
- "making modifications to it. For an executable work, complete source\n"
- "code means all the source code for all modules it contains, plus any\n"
- "associated interface definition files, plus the scripts used to\n"
- "control compilation and installation of the executable. However, as a\n"
- "special exception, the source code distributed need not include\n"
- "anything that is normally distributed (in either source or binary\n"
- "form) with the major components (compiler, kernel, and so on) of the\n"
- "operating system on which the executable runs, unless that component\n"
- "itself accompanies the executable.\n"
- "\n"
- "If distribution of executable or object code is made by offering\n"
- "access to copy from a designated place, then offering equivalent\n"
- "access to copy the source code from the same place counts as\n"
- "distribution of the source code, even though third parties are not\n"
- "compelled to copy the source along with the object code.\n"
- "\n"
- " 4. You may not copy, modify, sublicense, or distribute the Program\n"
- "except as expressly provided under this License. Any attempt\n"
- "otherwise to copy, modify, sublicense or distribute the Program is\n"
- "void, and will automatically terminate your rights under this License.\n"
- "However, parties who have received copies, or rights, from you under\n"
- "this License will not have their licenses terminated so long as such\n"
- "parties remain in full compliance.\n"
- "\n"
- " 5. You are not required to accept this License, since you have not\n"
- "signed it. However, nothing else grants you permission to modify or\n"
- "distribute the Program or its derivative works. These actions are\n"
- "prohibited by law if you do not accept this License. Therefore, by\n"
- "modifying or distributing the Program (or any work based on the\n"
- "Program), you indicate your acceptance of this License to do so, and\n"
- "all its terms and conditions for copying, distributing or modifying\n"
- "the Program or works based on it.\n"
- "\n"
- " 6. Each time you redistribute the Program (or any work based on the\n"
- "Program), the recipient automatically receives a license from the\n"
- "original licensor to copy, distribute or modify the Program subject to\n"
- "these terms and conditions. You may not impose any further\n"
- "restrictions on the recipients' exercise of the rights granted herein.\n"
- "You are not responsible for enforcing compliance by third parties to\n"
+ " TERMS AND CONDITIONS\n"
+ "\n"
+ " 0. Definitions.\n"
+ "\n"
+ " \"This License\" refers to version 3 of the GNU General Public License.\n"
+ "\n"
+ " \"Copyright\" also means copyright-like laws that apply to other kinds of\n"
+ "works, such as semiconductor masks.\n"
+ "\n"
+ " \"The Program\" refers to any copyrightable work licensed under this\n"
+ "License. Each licensee is addressed as \"you\". \"Licensees\" and\n"
+ "\"recipients\" may be individuals or organizations.\n"
+ "\n"
+ " To \"modify\" a work means to copy from or adapt all or part of the work\n"
+ "in a fashion requiring copyright permission, other than the making of an\n"
+ "exact copy. The resulting work is called a \"modified version\" of the\n"
+ "earlier work or a work \"based on\" the earlier work.\n"
+ "\n"
+ " A \"covered work\" means either the unmodified Program or a work based\n"
+ "on the Program.\n"
+ "\n"
+ " To \"propagate\" a work means to do anything with it that, without\n"
+ "permission, would make you directly or secondarily liable for\n"
+ "infringement under applicable copyright law, except executing it on a\n"
+ "computer or modifying a private copy. Propagation includes copying,\n"
+ "distribution (with or without modification), making available to the\n"
+ "public, and in some countries other activities as well.\n"
+ "\n"
+ " To \"convey\" a work means any kind of propagation that enables other\n"
+ "parties to make or receive copies. Mere interaction with a user through\n"
+ "a computer network, with no transfer of a copy, is not conveying.\n"
+ "\n"
+ " An interactive user interface displays \"Appropriate Legal Notices\"\n"
+ "to the extent that it includes a convenient and prominently visible\n"
+ "feature that (1) displays an appropriate copyright notice, and (2)\n"
+ "tells the user that there is no warranty for the work (except to the\n"
+ "extent that warranties are provided), that licensees may convey the\n"
+ "work under this License, and how to view a copy of this License. If\n"
+ "the interface presents a list of user commands or options, such as a\n"
+ "menu, a prominent item in the list meets this criterion.\n"
+ "\n"
+ " 1. Source Code.\n"
+ "\n"
+ " The \"source code\" for a work means the preferred form of the work\n"
+ "for making modifications to it. \"Object code\" means any non-source\n"
+ "form of a work.\n"
+ "\n"
+ " A \"Standard Interface\" means an interface that either is an official\n"
+ "standard defined by a recognized standards body, or, in the case of\n"
+ "interfaces specified for a particular programming language, one that\n"
+ "is widely used among developers working in that language.\n"
+ "\n"
+ " The \"System Libraries\" of an executable work include anything, other\n"
+ "than the work as a whole, that (a) is included in the normal form of\n"
+ "packaging a Major Component, but which is not part of that Major\n"
+ "Component, and (b) serves only to enable use of the work with that\n"
+ "Major Component, or to implement a Standard Interface for which an\n"
+ "implementation is available to the public in source code form. A\n"
+ "\"Major Component\", in this context, means a major essential component\n"
+ "(kernel, window system, and so on) of the specific operating system\n"
+ "(if any) on which the executable work runs, or a compiler used to\n"
+ "produce the work, or an object code interpreter used to run it.\n"
+ "\n"
+ " The \"Corresponding Source\" for a work in object code form means all\n"
+ "the source code needed to generate, install, and (for an executable\n"
+ "work) run the object code and to modify the work, including scripts to\n"
+ "control those activities. However, it does not include the work's\n"
+ "System Libraries, or general-purpose tools or generally available free\n"
+ "programs which are used unmodified in performing those activities but\n"
+ "which are not part of the work. For example, Corresponding Source\n"
+ "includes interface definition files associated with source files for\n"
+ "the work, and the source code for shared libraries and dynamically\n"
+ "linked subprograms that the work is specifically designed to require,\n"
+ "such as by intimate data communication or control flow between those\n"
+ "subprograms and other parts of the work.\n"
+ "\n"
+ " The Corresponding Source need not include anything that users\n"
+ "can regenerate automatically from other parts of the Corresponding\n"
+ "Source.\n"
+ "\n"
+ " The Corresponding Source for a work in source code form is that\n"
+ "same work.\n"
+ "\n"
+ " 2. Basic Permissions.\n"
+ "\n"
+ " All rights granted under this License are granted for the term of\n"
+ "copyright on the Program, and are irrevocable provided the stated\n"
+ "conditions are met. This License explicitly affirms your unlimited\n"
+ "permission to run the unmodified Program. The output from running a\n"
+ "covered work is covered by this License only if the output, given its\n"
+ "content, constitutes a covered work. This License acknowledges your\n"
+ "rights of fair use or other equivalent, as provided by copyright law.\n"
+ "\n"
+ " You may make, run and propagate covered works that you do not\n"
+ "convey, without conditions so long as your license otherwise remains\n"
+ "in force. You may convey covered works to others for the sole purpose\n"
+ "of having them make modifications exclusively for you, or provide you\n"
+ "with facilities for running those works, provided that you comply with\n"
+ "the terms of this License in conveying all material for which you do\n"
+ "not control copyright. Those thus making or running the covered works\n"
+ "for you must do so exclusively on your behalf, under your direction\n"
+ "and control, on terms that prohibit them from making any copies of\n"
+ "your copyrighted material outside their relationship with you.\n"
+ "\n"
+ " Conveying under any other circumstances is permitted solely under\n"
+ "the conditions stated below. Sublicensing is not allowed; section 10\n"
+ "makes it unnecessary.\n"
+ "\n"
+ " 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n"
+ "\n"
+ " No covered work shall be deemed part of an effective technological\n"
+ "measure under any applicable law fulfilling obligations under article\n"
+ "11 of the WIPO copyright treaty adopted on 20 December 1996, or\n"
+ "similar laws prohibiting or restricting circumvention of such\n"
+ "measures.\n"
+ "\n"
+ " When you convey a covered work, you waive any legal power to forbid\n"
+ "circumvention of technological measures to the extent such circumvention\n"
+ "is effected by exercising rights under this License with respect to\n"
+ "the covered work, and you disclaim any intention to limit operation or\n"
+ "modification of the work as a means of enforcing, against the work's\n"
+ "users, your or third parties' legal rights to forbid circumvention of\n"
+ "technological measures.\n"
+ "\n"
+ " 4. Conveying Verbatim Copies.\n"
+ "\n"
+ " You may convey verbatim copies of the Program's source code as you\n"
+ "receive it, in any medium, provided that you conspicuously and\n"
+ "appropriately publish on each copy an appropriate copyright notice;\n"
+ "keep intact all notices stating that this License and any\n"
+ "non-permissive terms added in accord with section 7 apply to the code;\n"
+ "keep intact all notices of the absence of any warranty; and give all\n"
+ "recipients a copy of this License along with the Program.\n"
+ "\n"
+ " You may charge any price or no price for each copy that you convey,\n"
+ "and you may offer support or warranty protection for a fee.\n"
+ "\n"
+ " 5. Conveying Modified Source Versions.\n"
+ "\n"
+ " You may convey a work based on the Program, or the modifications to\n"
+ "produce it from the Program, in the form of source code under the\n"
+ "terms of section 4, provided that you also meet all of these conditions:\n"
+ "\n"
+ " a) The work must carry prominent notices stating that you modified\n"
+ " it, and giving a relevant date.\n"
+ "\n"
+ " b) The work must carry prominent notices stating that it is\n"
+ " released under this License and any conditions added under section\n"
+ " 7. This requirement modifies the requirement in section 4 to\n"
+ " \"keep intact all notices\".\n"
+ "\n"
+ " c) You must license the entire work, as a whole, under this\n"
+ " License to anyone who comes into possession of a copy. This\n"
+ " License will therefore apply, along with any applicable section 7\n"
+ " additional terms, to the whole of the work, and all its parts,\n"
+ " regardless of how they are packaged. This License gives no\n"
+ " permission to license the work in any other way, but it does not\n"
+ " invalidate such permission if you have separately received it.\n"
+ "\n"
+ " d) If the work has interactive user interfaces, each must display\n"
+ " Appropriate Legal Notices; however, if the Program has interactive\n"
+ " interfaces that do not display Appropriate Legal Notices, your\n"
+ " work need not make them do so.\n"
+ "\n"
+ " A compilation of a covered work with other separate and independent\n"
+ "works, which are not by their nature extensions of the covered work,\n"
+ "and which are not combined with it such as to form a larger program,\n"
+ "in or on a volume of a storage or distribution medium, is called an\n"
+ "\"aggregate\" if the compilation and its resulting copyright are not\n"
+ "used to limit the access or legal rights of the compilation's users\n"
+ "beyond what the individual works permit. Inclusion of a covered work\n"
+ "in an aggregate does not cause this License to apply to the other\n"
+ "parts of the aggregate.\n"
+ "\n"
+ " 6. Conveying Non-Source Forms.\n"
+ "\n"
+ " You may convey a covered work in object code form under the terms\n"
+ "of sections 4 and 5, provided that you also convey the\n"
+ "machine-readable Corresponding Source under the terms of this License,\n"
+ "in one of these ways:\n"
+ "\n"
+ " a) Convey the object code in, or embodied in, a physical product\n"
+ " (including a physical distribution medium), accompanied by the\n"
+ " Corresponding Source fixed on a durable physical medium\n"
+ " customarily used for software interchange.\n"
+ "\n"
+ " b) Convey the object code in, or embodied in, a physical product\n"
+ " (including a physical distribution medium), accompanied by a\n"
+ " written offer, valid for at least three years and valid for as\n"
+ " long as you offer spare parts or customer support for that product\n"
+ " model, to give anyone who possesses the object code either (1) a\n"
+ " copy of the Corresponding Source for all the software in the\n"
+ " product that is covered by this License, on a durable physical\n"
+ " medium customarily used for software interchange, for a price no\n"
+ " more than your reasonable cost of physically performing this\n"
+ " conveying of source, or (2) access to copy the\n"
+ " Corresponding Source from a network server at no charge.\n"
+ "\n"
+ " c) Convey individual copies of the object code with a copy of the\n"
+ " written offer to provide the Corresponding Source. This\n"
+ " alternative is allowed only occasionally and noncommercially, and\n"
+ " only if you received the object code with such an offer, in accord\n"
+ " with subsection 6b.\n"
+ "\n"
+ " d) Convey the object code by offering access from a designated\n"
+ " place (gratis or for a charge), and offer equivalent access to the\n"
+ " Corresponding Source in the same way through the same place at no\n"
+ " further charge. You need not require recipients to copy the\n"
+ " Corresponding Source along with the object code. If the place to\n"
+ " copy the object code is a network server, the Corresponding Source\n"
+ " may be on a different server (operated by you or a third party)\n"
+ " that supports equivalent copying facilities, provided you maintain\n"
+ " clear directions next to the object code saying where to find the\n"
+ " Corresponding Source. Regardless of what server hosts the\n"
+ " Corresponding Source, you remain obligated to ensure that it is\n"
+ " available for as long as needed to satisfy these requirements.\n"
+ "\n"
+ " e) Convey the object code using peer-to-peer transmission, provided\n"
+ " you inform other peers where the object code and Corresponding\n"
+ " Source of the work are being offered to the general public at no\n"
+ " charge under subsection 6d.\n"
+ "\n"
+ " A separable portion of the object code, whose source code is excluded\n"
+ "from the Corresponding Source as a System Library, need not be\n"
+ "included in conveying the object code work.\n"
+ "\n"
+ " A \"User Product\" is either (1) a \"consumer product\", which means any\n"
+ "tangible personal property which is normally used for personal, family,\n"
+ "or household purposes, or (2) anything designed or sold for incorporation\n"
+ "into a dwelling. In determining whether a product is a consumer product,\n"
+ "doubtful cases shall be resolved in favor of coverage. For a particular\n"
+ "product received by a particular user, \"normally used\" refers to a\n"
+ "typical or common use of that class of product, regardless of the status\n"
+ "of the particular user or of the way in which the particular user\n"
+ "actually uses, or expects or is expected to use, the product. A product\n"
+ "is a consumer product regardless of whether the product has substantial\n"
+ "commercial, industrial or non-consumer uses, unless such uses represent\n"
+ "the only significant mode of use of the product.\n"
+ "\n"
+ " \"Installation Information\" for a User Product means any methods,\n"
+ "procedures, authorization keys, or other information required to install\n"
+ "and execute modified versions of a covered work in that User Product from\n"
+ "a modified version of its Corresponding Source. The information must\n"
+ "suffice to ensure that the continued functioning of the modified object\n"
+ "code is in no case prevented or interfered with solely because\n"
+ "modification has been made.\n"
+ "\n"
+ " If you convey an object code work under this section in, or with, or\n"
+ "specifically for use in, a User Product, and the conveying occurs as\n"
+ "part of a transaction in which the right of possession and use of the\n"
+ "User Product is transferred to the recipient in perpetuity or for a\n"
+ "fixed term (regardless of how the transaction is characterized), the\n"
+ "Corresponding Source conveyed under this section must be accompanied\n"
+ "by the Installation Information. But this requirement does not apply\n"
+ "if neither you nor any third party retains the ability to install\n"
+ "modified object code on the User Product (for example, the work has\n"
+ "been installed in ROM).\n"
+ "\n"
+ " The requirement to provide Installation Information does not include a\n"
+ "requirement to continue to provide support service, warranty, or updates\n"
+ "for a work that has been modified or installed by the recipient, or for\n"
+ "the User Product in which it has been modified or installed. Access to a\n"
+ "network may be denied when the modification itself materially and\n"
+ "adversely affects the operation of the network or violates the rules and\n"
+ "protocols for communication across the network.\n"
+ "\n"
+ " Corresponding Source conveyed, and Installation Information provided,\n"
+ "in accord with this section must be in a format that is publicly\n"
+ "documented (and with an implementation available to the public in\n"
+ "source code form), and must require no special password or key for\n"
+ "unpacking, reading or copying.\n"
+ "\n"
+ " 7. Additional Terms.\n"
+ "\n"
+ " \"Additional permissions\" are terms that supplement the terms of this\n"
+ "License by making exceptions from one or more of its conditions.\n"
+ "Additional permissions that are applicable to the entire Program shall\n"
+ "be treated as though they were included in this License, to the extent\n"
+ "that they are valid under applicable law. If additional permissions\n"
+ "apply only to part of the Program, that part may be used separately\n"
+ "under those permissions, but the entire Program remains governed by\n"
+ "this License without regard to the additional permissions.\n"
+ "\n"
+ " When you convey a copy of a covered work, you may at your option\n"
+ "remove any additional permissions from that copy, or from any part of\n"
+ "it. (Additional permissions may be written to require their own\n"
+ "removal in certain cases when you modify the work.) You may place\n"
+ "additional permissions on material, added by you to a covered work,\n"
+ "for which you have or can give appropriate copyright permission.\n"
+ "\n"
+ " Notwithstanding any other provision of this License, for material you\n"
+ "add to a covered work, you may (if authorized by the copyright holders of\n"
+ "that material) supplement the terms of this License with terms:\n"
+ "\n"
+ " a) Disclaiming warranty or limiting liability differently from the\n"
+ " terms of sections 15 and 16 of this License; or\n"
+ "\n"
+ " b) Requiring preservation of specified reasonable legal notices or\n"
+ " author attributions in that material or in the Appropriate Legal\n"
+ " Notices displayed by works containing it; or\n"
+ "\n"
+ " c) Prohibiting misrepresentation of the origin of that material, or\n"
+ " requiring that modified versions of such material be marked in\n"
+ " reasonable ways as different from the original version; or\n"
+ "\n"
+ " d) Limiting the use for publicity purposes of names of licensors or\n"
+ " authors of the material; or\n"
+ "\n"
+ " e) Declining to grant rights under trademark law for use of some\n"
+ " trade names, trademarks, or service marks; or\n"
+ "\n"
+ " f) Requiring indemnification of licensors and authors of that\n"
+ " material by anyone who conveys the material (or modified versions of\n"
+ " it) with contractual assumptions of liability to the recipient, for\n"
+ " any liability that these contractual assumptions directly impose on\n"
+ " those licensors and authors.\n"
+ "\n"
+ " All other non-permissive additional terms are considered \"further\n"
+ "restrictions\" within the meaning of section 10. If the Program as you\n"
+ "received it, or any part of it, contains a notice stating that it is\n"
+ "governed by this License along with a term that is a further\n"
+ "restriction, you may remove that term. If a license document contains\n"
+ "a further restriction but permits relicensing or conveying under this\n"
+ "License, you may add to a covered work material governed by the terms\n"
+ "of that license document, provided that the further restriction does\n"
+ "not survive such relicensing or conveying.\n"
+ "\n"
+ " If you add terms to a covered work in accord with this section, you\n"
+ "must place, in the relevant source files, a statement of the\n"
+ "additional terms that apply to those files, or a notice indicating\n"
+ "where to find the applicable terms.\n"
+ "\n"
+ " Additional terms, permissive or non-permissive, may be stated in the\n"
+ "form of a separately written license, or stated as exceptions;\n"
+ "the above requirements apply either way.\n"
+ "\n"
+ " 8. Termination.\n"
+ "\n"
+ " You may not propagate or modify a covered work except as expressly\n"
+ "provided under this License. Any attempt otherwise to propagate or\n"
+ "modify it is void, and will automatically terminate your rights under\n"
+ "this License (including any patent licenses granted under the third\n"
+ "paragraph of section 11).\n"
+ "\n"
+ " However, if you cease all violation of this License, then your\n"
+ "license from a particular copyright holder is reinstated (a)\n"
+ "provisionally, unless and until the copyright holder explicitly and\n"
+ "finally terminates your license, and (b) permanently, if the copyright\n"
+ "holder fails to notify you of the violation by some reasonable means\n"
+ "prior to 60 days after the cessation.\n"
+ "\n"
+ " Moreover, your license from a particular copyright holder is\n"
+ "reinstated permanently if the copyright holder notifies you of the\n"
+ "violation by some reasonable means, this is the first time you have\n"
+ "received notice of violation of this License (for any work) from that\n"
+ "copyright holder, and you cure the violation prior to 30 days after\n"
+ "your receipt of the notice.\n"
+ "\n"
+ " Termination of your rights under this section does not terminate the\n"
+ "licenses of parties who have received copies or rights from you under\n"
+ "this License. If your rights have been terminated and not permanently\n"
+ "reinstated, you do not qualify to receive new licenses for the same\n"
+ "material under section 10.\n"
+ "\n"
+ " 9. Acceptance Not Required for Having Copies.\n"
+ "\n"
+ " You are not required to accept this License in order to receive or\n"
+ "run a copy of the Program. Ancillary propagation of a covered work\n"
+ "occurring solely as a consequence of using peer-to-peer transmission\n"
+ "to receive a copy likewise does not require acceptance. However,\n"
+ "nothing other than this License grants you permission to propagate or\n"
+ "modify any covered work. These actions infringe copyright if you do\n"
+ "not accept this License. Therefore, by modifying or propagating a\n"
+ "covered work, you indicate your acceptance of this License to do so.\n"
+ "\n"
+ " 10. Automatic Licensing of Downstream Recipients.\n"
+ "\n"
+ " Each time you convey a covered work, the recipient automatically\n"
+ "receives a license from the original licensors, to run, modify and\n"
+ "propagate that work, subject to this License. You are not responsible\n"
+ "for enforcing compliance by third parties with this License.\n"
+ "\n"
+ " An \"entity transaction\" is a transaction transferring control of an\n"
+ "organization, or substantially all assets of one, or subdividing an\n"
+ "organization, or merging organizations. If propagation of a covered\n"
+ "work results from an entity transaction, each party to that\n"
+ "transaction who receives a copy of the work also receives whatever\n"
+ "licenses to the work the party's predecessor in interest had or could\n"
+ "give under the previous paragraph, plus a right to possession of the\n"
+ "Corresponding Source of the work from the predecessor in interest, if\n"
+ "the predecessor has it or can get it with reasonable efforts.\n"
+ "\n"
+ " You may not impose any further restrictions on the exercise of the\n"
+ "rights granted or affirmed under this License. For example, you may\n"
+ "not impose a license fee, royalty, or other charge for exercise of\n"
+ "rights granted under this License, and you may not initiate litigation\n"
+ "(including a cross-claim or counterclaim in a lawsuit) alleging that\n"
+ "any patent claim is infringed by making, using, selling, offering for\n"
+ "sale, or importing the Program or any portion of it.\n"
+ "\n"
+ " 11. Patents.\n"
+ "\n"
+ " A \"contributor\" is a copyright holder who authorizes use under this\n"
+ "License of the Program or a work on which the Program is based. The\n"
+ "work thus licensed is called the contributor's \"contributor version\".\n"
+ "\n"
+ " A contributor's \"essential patent claims\" are all patent claims\n"
+ "owned or controlled by the contributor, whether already acquired or\n"
+ "hereafter acquired, that would be infringed by some manner, permitted\n"
+ "by this License, of making, using, or selling its contributor version,\n"
+ "but do not include claims that would be infringed only as a\n"
+ "consequence of further modification of the contributor version. For\n"
+ "purposes of this definition, \"control\" includes the right to grant\n"
+ "patent sublicenses in a manner consistent with the requirements of\n"
"this License.\n"
"\n"
- " 7. If, as a consequence of a court judgment or allegation of patent\n"
- "infringement or for any other reason (not limited to patent issues),\n"
- "conditions are imposed on you (whether by court order, agreement or\n"
+ " Each contributor grants you a non-exclusive, worldwide, royalty-free\n"
+ "patent license under the contributor's essential patent claims, to\n"
+ "make, use, sell, offer for sale, import and otherwise run, modify and\n"
+ "propagate the contents of its contributor version.\n"
+ "\n"
+ " In the following three paragraphs, a \"patent license\" is any express\n"
+ "agreement or commitment, however denominated, not to enforce a patent\n"
+ "(such as an express permission to practice a patent or covenant not to\n"
+ "sue for patent infringement). To \"grant\" such a patent license to a\n"
+ "party means to make such an agreement or commitment not to enforce a\n"
+ "patent against the party.\n"
+ "\n"
+ " If you convey a covered work, knowingly relying on a patent license,\n"
+ "and the Corresponding Source of the work is not available for anyone\n"
+ "to copy, free of charge and under the terms of this License, through a\n"
+ "publicly available network server or other readily accessible means,\n"
+ "then you must either (1) cause the Corresponding Source to be so\n"
+ "available, or (2) arrange to deprive yourself of the benefit of the\n"
+ "patent license for this particular work, or (3) arrange, in a manner\n"
+ "consistent with the requirements of this License, to extend the patent\n"
+ "license to downstream recipients. \"Knowingly relying\" means you have\n"
+ "actual knowledge that, but for the patent license, your conveying the\n"
+ "covered work in a country, or your recipient's use of the covered work\n"
+ "in a country, would infringe one or more identifiable patents in that\n"
+ "country that you have reason to believe are valid.\n"
+ "\n"
+ " If, pursuant to or in connection with a single transaction or\n"
+ "arrangement, you convey, or propagate by procuring conveyance of, a\n"
+ "covered work, and grant a patent license to some of the parties\n"
+ "receiving the covered work authorizing them to use, propagate, modify\n"
+ "or convey a specific copy of the covered work, then the patent license\n"
+ "you grant is automatically extended to all recipients of the covered\n"
+ "work and works based on it.\n"
+ "\n"
+ " A patent license is \"discriminatory\" if it does not include within\n"
+ "the scope of its coverage, prohibits the exercise of, or is\n"
+ "conditioned on the non-exercise of one or more of the rights that are\n"
+ "specifically granted under this License. You may not convey a covered\n"
+ "work if you are a party to an arrangement with a third party that is\n"
+ "in the business of distributing software, under which you make payment\n"
+ "to the third party based on the extent of your activity of conveying\n"
+ "the work, and under which the third party grants, to any of the\n"
+ "parties who would receive the covered work from you, a discriminatory\n"
+ "patent license (a) in connection with copies of the covered work\n"
+ "conveyed by you (or copies made from those copies), or (b) primarily\n"
+ "for and in connection with specific products or compilations that\n"
+ "contain the covered work, unless you entered into that arrangement,\n"
+ "or that patent license was granted, prior to 28 March 2007.\n"
+ "\n"
+ " Nothing in this License shall be construed as excluding or limiting\n"
+ "any implied license or other defenses to infringement that may\n"
+ "otherwise be available to you under applicable patent law.\n"
+ "\n"
+ " 12. No Surrender of Others' Freedom.\n"
+ "\n"
+ " If conditions are imposed on you (whether by court order, agreement or\n"
"otherwise) that contradict the conditions of this License, they do not\n"
- "excuse you from the conditions of this License. If you cannot\n"
- "distribute so as to satisfy simultaneously your obligations under this\n"
- "License and any other pertinent obligations, then as a consequence you\n"
- "may not distribute the Program at all. For example, if a patent\n"
- "license would not permit royalty-free redistribution of the Program by\n"
- "all those who receive copies directly or indirectly through you, then\n"
- "the only way you could satisfy both it and this License would be to\n"
- "refrain entirely from distribution of the Program.\n"
- "\n"
- "If any portion of this section is held invalid or unenforceable under\n"
- "any particular circumstance, the balance of the section is intended to\n"
- "apply and the section as a whole is intended to apply in other\n"
- "circumstances.\n"
- "\n"
- "It is not the purpose of this section to induce you to infringe any\n"
- "patents or other property right claims or to contest validity of any\n"
- "such claims; this section has the sole purpose of protecting the\n"
- "integrity of the free software distribution system, which is\n"
- "implemented by public license practices. Many people have made\n"
- "generous contributions to the wide range of software distributed\n"
- "through that system in reliance on consistent application of that\n"
- "system; it is up to the author/donor to decide if he or she is willing\n"
- "to distribute software through any other system and a licensee cannot\n"
- "impose that choice.\n"
- "\n"
- "This section is intended to make thoroughly clear what is believed to\n"
- "be a consequence of the rest of this License.\n"
- "\n"
- " 8. If the distribution and/or use of the Program is restricted in\n"
- "certain countries either by patents or by copyrighted interfaces, the\n"
- "original copyright holder who places the Program under this License\n"
- "may add an explicit geographical distribution limitation excluding\n"
- "those countries, so that distribution is permitted only in or among\n"
- "countries not thus excluded. In such case, this License incorporates\n"
- "the limitation as if written in the body of this License.\n"
- "\n"
- " 9. The Free Software Foundation may publish revised and/or new versions\n"
- "of the General Public License from time to time. Such new versions will\n"
+ "excuse you from the conditions of this License. If you cannot convey a\n"
+ "covered work so as to satisfy simultaneously your obligations under this\n"
+ "License and any other pertinent obligations, then as a consequence you may\n"
+ "not convey it at all. For example, if you agree to terms that obligate you\n"
+ "to collect a royalty for further conveying from those to whom you convey\n"
+ "the Program, the only way you could satisfy both those terms and this\n"
+ "License would be to refrain entirely from conveying the Program.\n"
+ "\n"
+ " 13. Use with the GNU Affero General Public License.\n"
+ "\n"
+ " Notwithstanding any other provision of this License, you have\n"
+ "permission to link or combine any covered work with a work licensed\n"
+ "under version 3 of the GNU Affero General Public License into a single\n"
+ "combined work, and to convey the resulting work. The terms of this\n"
+ "License will continue to apply to the part which is the covered work,\n"
+ "but the special requirements of the GNU Affero General Public License,\n"
+ "section 13, concerning interaction through a network will apply to the\n"
+ "combination as such.\n"
+ "\n"
+ " 14. Revised Versions of this License.\n"
+ "\n"
+ " The Free Software Foundation may publish revised and/or new versions of\n"
+ "the GNU General Public License from time to time. Such new versions will\n"
"be similar in spirit to the present version, but may differ in detail to\n"
"address new problems or concerns.\n"
"\n"
- "Each version is given a distinguishing version number. If the Program\n"
- "specifies a version number of this License which applies to it and \"any\n"
- "later version\", you have the option of following the terms and conditions\n"
- "either of that version or of any later version published by the Free\n"
- "Software Foundation. If the Program does not specify a version number of\n"
- "this License, you may choose any version ever published by the Free Software\n"
- "Foundation.\n"
- "\n"
- " 10. If you wish to incorporate parts of the Program into other free\n"
- "programs whose distribution conditions are different, write to the author\n"
- "to ask for permission. For software which is copyrighted by the Free\n"
- "Software Foundation, write to the Free Software Foundation; we sometimes\n"
- "make exceptions for this. Our decision will be guided by the two goals\n"
- "of preserving the free status of all derivatives of our free software and\n"
- "of promoting the sharing and reuse of software generally.\n"
- "\n"
- " NO WARRANTY\n"
- "\n"
- " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n"
- "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n"
- "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n"
- "PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n"
- "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"
- "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n"
- "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n"
- "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n"
- "REPAIR OR CORRECTION.\n"
- "\n"
- " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"
- "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n"
- "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n"
- "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n"
- "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n"
- "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n"
- "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n"
- "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n"
- "POSSIBILITY OF SUCH DAMAGES.\n"
- "\n"
- " END OF TERMS AND CONDITIONS\n"
- "\n"
- " How to Apply These Terms to Your New Programs\n"
+ " Each version is given a distinguishing version number. If the\n"
+ "Program specifies that a certain numbered version of the GNU General\n"
+ "Public License \"or any later version\" applies to it, you have the\n"
+ "option of following the terms and conditions either of that numbered\n"
+ "version or of any later version published by the Free Software\n"
+ "Foundation. If the Program does not specify a version number of the\n"
+ "GNU General Public License, you may choose any version ever published\n"
+ "by the Free Software Foundation.\n"
+ "\n"
+ " If the Program specifies that a proxy can decide which future\n"
+ "versions of the GNU General Public License can be used, that proxy's\n"
+ "public statement of acceptance of a version permanently authorizes you\n"
+ "to choose that version for the Program.\n"
+ "\n"
+ " Later license versions may give you additional or different\n"
+ "permissions. However, no additional obligations are imposed on any\n"
+ "author or copyright holder as a result of your choosing to follow a\n"
+ "later version.\n"
+ "\n"
+ " 15. Disclaimer of Warranty.\n"
+ "\n"
+ " THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\n"
+ "APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\n"
+ "HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\n"
+ "OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\n"
+ "THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n"
+ "PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\n"
+ "IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\n"
+ "ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n"
+ "\n"
+ " 16. Limitation of Liability.\n"
+ "\n"
+ " IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"
+ "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\n"
+ "THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\n"
+ "GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\n"
+ "USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\n"
+ "DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\n"
+ "PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\n"
+ "EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\n"
+ "SUCH DAMAGES.\n"
+ "\n"
+ " 17. Interpretation of Sections 15 and 16.\n"
+ "\n"
+ " If the disclaimer of warranty and limitation of liability provided\n"
+ "above cannot be given local legal effect according to their terms,\n"
+ "reviewing courts shall apply local law that most closely approximates\n"
+ "an absolute waiver of all civil liability in connection with the\n"
+ "Program, unless a warranty or assumption of liability accompanies a\n"
+ "copy of the Program in return for a fee.\n"
+ "\n"
+ " END OF TERMS AND CONDITIONS\n"
+ "\n"
+ " How to Apply These Terms to Your New Programs\n"
"\n"
" If you develop a new program, and you want it to be of the greatest\n"
"possible use to the public, the best way to achieve this is to make it\n"
@@ -907,15 +1248,15 @@ void AboutBox::initStrings() {
"\n"
" To do so, attach the following notices to the program. It is safest\n"
"to attach them to the start of each source file to most effectively\n"
- "convey the exclusion of warranty; and each file should have at least\n"
+ "state the exclusion of warranty; and each file should have at least\n"
"the \"copyright\" line and a pointer to where the full notice is found.\n"
"\n"
" <one line to give the program's name and a brief idea of what it does.>\n"
" Copyright (C) <year> <name of author>\n"
"\n"
- " This program is free software; you can redistribute it and/or modify\n"
+ " This program is free software: you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
- " the Free Software Foundation; either version 2 of the License, or\n"
+ " the Free Software Foundation, either version 3 of the License, or\n"
" (at your option) any later version.\n"
"\n"
" This program is distributed in the hope that it will be useful,\n"
@@ -924,40 +1265,33 @@ void AboutBox::initStrings() {
" GNU General Public License for more details.\n"
"\n"
" You should have received a copy of the GNU General Public License\n"
- " along with this program; if not, write to the Free Software\n"
- " Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"
- "\n"
+ " along with this program. If not, see <http://www.gnu.org/licenses/>.\n"
"\n"
"Also add information on how to contact you by electronic and paper mail.\n"
"\n"
- "If the program is interactive, make it output a short notice like this\n"
- "when it starts in an interactive mode:\n"
+ " If the program does terminal interaction, make it output a short\n"
+ "notice like this when it starts in an interactive mode:\n"
"\n"
- " Gnomovision version 69, Copyright (C) year name of author\n"
- " Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n"
+ " <program> Copyright (C) <year> <name of author>\n"
+ " This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n"
" This is free software, and you are welcome to redistribute it\n"
" under certain conditions; type `show c' for details.\n"
"\n"
"The hypothetical commands `show w' and `show c' should show the appropriate\n"
- "parts of the General Public License. Of course, the commands you use may\n"
- "be called something other than `show w' and `show c'; they could even be\n"
- "mouse-clicks or menu items--whatever suits your program.\n"
- "\n"
- "You should also get your employer (if you work as a programmer) or your\n"
- "school, if any, to sign a \"copyright disclaimer\" for the program, if\n"
- "necessary. Here is a sample; alter the names:\n"
- "\n"
- " Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n"
- " `Gnomovision' (which makes passes at compilers) written by James Hacker.\n"
+ "parts of the General Public License. Of course, your program's commands\n"
+ "might be different; for a GUI interface, you would use an \"about box\".\n"
"\n"
- " <signature of Ty Coon>, 1 April 1989\n"
- " Ty Coon, President of Vice\n"
+ " You should also get your employer (if you work as a programmer) or school,\n"
+ "if any, to sign a \"copyright disclaimer\" for the program, if necessary.\n"
+ "For more information on this, and how to apply and follow the GNU GPL, see\n"
+ "<http://www.gnu.org/licenses/>.\n"
"\n"
- "This General Public License does not permit incorporating your program into\n"
- "proprietary programs. If your program is a subroutine library, you may\n"
- "consider it more useful to permit linking proprietary applications with the\n"
- "library. If this is what you want to do, use the GNU Library General\n"
- "Public License instead of this License.\n"
+ " The GNU General Public License does not permit incorporating your program\n"
+ "into proprietary programs. If your program is a subroutine library, you\n"
+ "may consider it more useful to permit linking proprietary applications with\n"
+ "the library. If this is what you want to do, use the GNU Lesser General\n"
+ "Public License instead of this License. But first, please read\n"
+ "<http://www.gnu.org/philosophy/why-not-lgpl.html>."
;
}
diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp
index 6603d5c69..34cdb92e3 100644
--- a/src/ui/dialog/color-item.cpp
+++ b/src/ui/dialog/color-item.cpp
@@ -571,6 +571,8 @@ Gtk::Widget* ColorItem::getPreview(PreviewStyle style, ViewType view, ::PreviewS
widget = lbl;
} else {
GtkWidget* eekWidget = eek_preview_new();
+ gtk_widget_set_name( eekWidget, "ColorItemPreview" );
+
EekPreview * preview = EEK_PREVIEW(eekWidget);
Gtk::Widget* newBlot = Glib::wrap(eekWidget);
_regenPreview(preview);
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index c2c5c5005..12eaba72a 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -492,8 +492,8 @@ void DocumentProperties::linkSelectedProfile()
std::vector<std::pair<Glib::ustring, Glib::ustring> > pairs = ColorProfile::getProfileFilesWithNames();
Glib::ustring file = pairs[row].first;
Glib::ustring name = pairs[row].second;
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" );
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" );
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
if (!strcmp(prof->href, file.c_str()))
@@ -532,11 +532,11 @@ void DocumentProperties::linkSelectedProfile()
void DocumentProperties::populate_linked_profiles_box()
{
_LinkedProfilesListStore->clear();
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" );
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" );
if (! current.empty()) {
_emb_profiles_observer.set((*(current.begin()))->parent);
}
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
Gtk::TreeModel::Row row = *(_LinkedProfilesListStore->append());
@@ -614,8 +614,8 @@ void DocumentProperties::removeSelectedProfile(){
return;
}
}
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" );
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "iccprofile" );
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
if (!name.compare(prof->name)){
@@ -738,7 +738,7 @@ void DocumentProperties::build_cms()
_LinkedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::linked_profiles_list_button_release));
cms_create_popup_menu(_LinkedProfilesList, sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile));
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "defs" );
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "defs" );
if (!current.empty()) {
_emb_profiles_observer.set((*(current.begin()))->parent);
}
@@ -975,7 +975,7 @@ void DocumentProperties::build_scripting()
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
//TODO: review this observers code:
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
if (! current.empty()) {
_scripts_observer.set((*(current.begin()))->parent);
}
@@ -1190,8 +1190,8 @@ void DocumentProperties::removeExternalScript(){
}
}
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
if (obj) {
SPScript* script = dynamic_cast<SPScript *>(obj);
@@ -1268,8 +1268,8 @@ void DocumentProperties::changeEmbeddedScript(){
}
bool voidscript=true;
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
if (id == obj->getId()){
@@ -1313,8 +1313,8 @@ void DocumentProperties::editEmbeddedScript(){
}
Inkscape::XML::Document *xml_doc = SP_ACTIVE_DOCUMENT->getReprDoc();
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
if (id == obj->getId()){
@@ -1337,13 +1337,13 @@ void DocumentProperties::editEmbeddedScript(){
void DocumentProperties::populate_script_lists(){
_ExternalScriptsListStore->clear();
_EmbeddedScriptsListStore->clear();
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
if (!current.empty()) {
SPObject *obj = *(current.begin());
g_assert(obj != NULL);
_scripts_observer.set(obj->parent);
}
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject* obj = *it;
SPScript* script = dynamic_cast<SPScript *>(obj);
g_assert(script != NULL);
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index ce08ed1f7..d3ad5d1da 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1591,11 +1591,11 @@ void FilterEffectsDialog::FilterModifier::update_filters()
SPDesktop* desktop = _dialog.getDesktop();
SPDocument* document = desktop->getDocument();
- std::set<SPObject *> filters = document->getResourceList( "filter" );
+ std::vector<SPObject *> filters = document->getResourceList( "filter" );
_model->clear();
- for (std::set<SPObject *>::const_iterator it = filters.begin(); it != filters.end(); ++it) {
+ for (std::vector<SPObject *>::const_iterator it = filters.begin(); it != filters.end(); ++it) {
Gtk::TreeModel::Row row = *_model->append();
SPFilter* f = SP_FILTER(*it);
row[_columns.filter] = f;
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index c7a168dee..30bbd95c9 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -210,8 +210,8 @@ void InkscapePreferences::AddBaseSimplifySpinbutton(DialogPage &p, Glib::ustring
{
PrefSpinButton* sb = Gtk::manage( new PrefSpinButton);
sb->init ( prefs_path + "/base-simplify", 0.0, 100.0, 1.0, 10.0, def_value, false, false);
- p.add_line( false, _("Base simplify:"), *sb, _("on dinamic LPE simplify"),
- _("Base simplify of dinamic LPE based simplify"),
+ p.add_line( false, _("Base simplify:"), *sb, _("on dynamic LPE simplify"),
+ _("Base simplify of dynamic LPE based simplify"),
false );
}
diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp
index 75430ed44..be46129c4 100644
--- a/src/ui/dialog/object-properties.cpp
+++ b/src/ui/dialog/object-properties.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (C) 2012 Kris De Gussem <Kris.DeGussem@gmail.com>
- * c++ version based on former C-version (GPL v2) with authors:
+ * c++ version based on former C-version (GPL v2+) with authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
diff --git a/src/ui/dialog/object-properties.h b/src/ui/dialog/object-properties.h
index 093f273f6..dc28c0bad 100644
--- a/src/ui/dialog/object-properties.h
+++ b/src/ui/dialog/object-properties.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (C) 2012 Kris De Gussem <Kris.DeGussem@gmail.com>
- * c++version based on former C-version (GPL v2) with authors:
+ * c++version based on former C-version (GPL v2+) with authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Johan Engelen <goejendaagh@zonnet.nl>
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 46e045c14..790c0e5fb 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -266,10 +266,10 @@ void SvgFontsDialog::update_fonts()
{
SPDesktop* desktop = this->getDesktop();
SPDocument* document = desktop->getDocument();
- std::set<SPObject *> fonts = document->getResourceList( "fonts" );
+ std::vector<SPObject *> fonts = document->getResourceList( "fonts" );
_model->clear();
- for (std::set<SPObject *>::const_iterator it = fonts.begin(); it != fonts.end(); ++it) {
+ for (std::vector<SPObject *>::const_iterator it = fonts.begin(); it != fonts.end(); ++it) {
Gtk::TreeModel::Row row = *_model->append();
SPFont* f = SP_FONT(*it);
row[_columns.spfont] = f;
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 924ebe03d..6577c8d4e 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -171,8 +171,8 @@ static void editGradient( GtkMenuItem */*menuitem*/, gpointer /*user_data*/ )
SPDocument *doc = desktop ? desktop->doc() : 0;
if (doc) {
std::string targetName(bounceTarget->def.descr);
- std::set<SPObject *> gradients = doc->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
+ std::vector<SPObject *> gradients = doc->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
SPGradient* grad = SP_GRADIENT(*item);
if ( targetName == grad->getId() ) {
editGradientImpl( desktop, grad );
@@ -192,8 +192,8 @@ void SwatchesPanelHook::convertGradient( GtkMenuItem * /*menuitem*/, gpointer us
gint index = GPOINTER_TO_INT(userData);
if ( doc && (index >= 0) && (static_cast<guint>(index) < popupItems.size()) ) {
Glib::ustring targetName = popupItems[index];
- std::set<SPObject *> gradients = doc->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
+ std::vector<SPObject *> gradients = doc->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
SPGradient* grad = SP_GRADIENT(*item);
if ( targetName == grad->getId() ) {
@@ -326,9 +326,9 @@ gboolean colorItemHandleButtonPress( GtkWidget* widget, GdkEventButton* event, g
SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(wdgt);
if ( dtw && dtw->desktop ) {
// Pick up all gradients with vectors
- std::set<SPObject *> gradients = (dtw->desktop->doc())->getResourceList("gradient");
+ std::vector<SPObject *> gradients = (dtw->desktop->doc())->getResourceList("gradient");
gint index = 0;
- for (std::set<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
+ for (std::vector<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
SPGradient* grad = SP_GRADIENT(*item);
if ( grad->hasStops() && !grad->isSwatch() ) {
//gl = g_slist_prepend(gl, curr->data);
@@ -594,6 +594,7 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) :
_currentDesktop(0),
_currentDocument(0)
{
+ set_name( "SwatchesPanel" );
Gtk::RadioMenuItem* hotItem = 0;
_holder = new PreviewHolder();
_clear = new ColorItem( ege::PaintDef::CLEAR );
@@ -924,8 +925,8 @@ static void recalcSwatchContents(SPDocument* doc,
std::map<ColorItem*, SPGradient*> &gradMappings)
{
std::vector<SPGradient*> newList;
- std::set<SPObject *> gradients = doc->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
+ std::vector<SPObject *> gradients = doc->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
SPGradient* grad = SP_GRADIENT(*item);
if ( grad->isSwatch() ) {
newList.push_back(SP_GRADIENT(*item));
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 3e2a2004c..ab29471ed 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -1128,8 +1128,8 @@ sp_ui_drag_data_received(GtkWidget *widget,
unsigned int b = color.getB();
SPGradient* matches = 0;
- std::set<SPObject *> gradients = doc->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
+ std::vector<SPObject *> gradients = doc->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator item = gradients.begin(); item != gradients.end(); ++item) {
SPGradient* grad = SP_GRADIENT(*item);
if ( color.descr == grad->getId() ) {
if ( grad->hasStops() ) {
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index beb83f35c..5e75179a3 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -49,16 +49,20 @@ PreviewHolder::PreviewHolder() :
_wrap(false),
_border(BORDER_NONE)
{
+ set_name( "PreviewHolder" );
_scroller = Gtk::manage(new Gtk::ScrolledWindow());
+ _scroller->set_name( "PreviewHolderScroller" );
((Gtk::ScrolledWindow *)_scroller)->set_policy(Gtk::POLICY_AUTOMATIC,
Gtk::POLICY_AUTOMATIC);
#if WITH_GTKMM_3_0
_insides = Gtk::manage(new Gtk::Grid());
+ _insides->set_name( "PreviewHolderGrid" );
_insides->set_column_spacing(8);
// Add a container with the scroller and a spacer
Gtk::Grid* spaceHolder = Gtk::manage(new Gtk::Grid());
+ spaceHolder->set_name( "PreviewHolderSpaceHolder" );
_scroller->set_hexpand();
_scroller->set_vexpand();
diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp
index 3b25439f3..de071dad3 100644
--- a/src/ui/tool/path-manipulator.cpp
+++ b/src/ui/tool/path-manipulator.cpp
@@ -1292,7 +1292,7 @@ double PathManipulator::_bsplineHandlePosition(Handle *h, bool check_other)
line_inside_nodes->moveto(n->position());
line_inside_nodes->lineto(next_node->position());
if(!are_near(h->position(), n->position())){
- pos = Geom::nearest_time(Geom::Point(h->position()[X] - HANDLE_CUBIC_GAP, h->position()[Y] + HANDLE_CUBIC_GAP), *line_inside_nodes->first_segment());
+ pos = Geom::nearest_time(Geom::Point(h->position()[X] - HANDLE_CUBIC_GAP, h->position()[Y] - HANDLE_CUBIC_GAP), *line_inside_nodes->first_segment());
}
}
if (pos == NO_POWER && check_other){
diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp
index 613857626..c98ecb686 100644
--- a/src/ui/tools/freehand-base.cpp
+++ b/src/ui/tools/freehand-base.cpp
@@ -43,6 +43,7 @@
#include "snap.h"
#include "sp-path.h"
#include "sp-use.h"
+#include "sp-item-group.h"
#include "sp-namedview.h"
#include "live_effects/lpe-powerstroke.h"
#include "style.h"
@@ -432,7 +433,7 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
if(cm->paste(SP_ACTIVE_DESKTOP,true) == true){
gchar const *svgd = item->getRepr()->attribute("d");
bend_item = dc->selection->singleItem();
- if(bend_item){
+ if(bend_item && (SP_IS_SHAPE(bend_item) || SP_IS_GROUP(bend_item))){
bend_item->moveTo(item,false);
bend_item->transform.setTranslation(Geom::Point());
spdc_apply_bend_shape(svgd, dc, bend_item);
@@ -440,9 +441,11 @@ static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item,
shape = BEND_CLIPBOARD;
} else {
+ bend_item = NULL;
shape = NONE;
}
} else {
+ bend_item = NULL;
shape = NONE;
}
break;
diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp
index 4149403ea..23aaf6bb1 100644
--- a/src/ui/tools/node-tool.cpp
+++ b/src/ui/tools/node-tool.cpp
@@ -164,11 +164,6 @@ NodeTool::~NodeTool() {
if (this->helperpath_tmpitem) {
this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem);
}
-
- if (this->helperpath_tmpitem) {
- this->desktop->remove_temporary_canvasitem(this->helperpath_tmpitem);
- }
-
this->_selection_changed_connection.disconnect();
//this->_selection_modified_connection.disconnect();
this->_mouseover_changed_connection.disconnect();
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp
index ec2e69fb3..2e30a48b5 100644
--- a/src/ui/widget/color-icc-selector.cpp
+++ b/src/ui/widget/color-icc-selector.cpp
@@ -687,8 +687,8 @@ void ColorICCSelectorImpl::_profilesChanged(std::string const &name)
gtk_combo_box_set_active(combo, 0);
int index = 1;
- std::set<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList("iccprofile");
- for (std::set<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
+ std::vector<SPObject *> current = SP_ACTIVE_DOCUMENT->getResourceList("iccprofile");
+ for (std::vector<SPObject *>::const_iterator it = current.begin(); it != current.end(); ++it) {
SPObject *obj = *it;
Inkscape::ColorProfile *prof = reinterpret_cast<Inkscape::ColorProfile *>(obj);
diff --git a/src/ui/widget/color-preview.cpp b/src/ui/widget/color-preview.cpp
index 5bcd16528..62c7cca1d 100644
--- a/src/ui/widget/color-preview.cpp
+++ b/src/ui/widget/color-preview.cpp
@@ -23,6 +23,7 @@ ColorPreview::ColorPreview (guint32 rgba)
{
_rgba = rgba;
set_has_window(false);
+ set_name("ColorPreview");
}
void
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index c5e14d4f0..fda647182 100644
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
@@ -56,6 +56,7 @@ Dock::Dock(Gtk::Orientation orientation)
#endif
_scrolled_window (Gtk::manage(new Gtk::ScrolledWindow))
{
+ _scrolled_window->set_name("Dock");
#if WITH_GDL_3_6
gtk_orientable_set_orientation(GTK_ORIENTABLE(_gdl_dock_bar),
static_cast<GtkOrientation>(orientation));
diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp
index 2a1fa352b..1a9ce617f 100644
--- a/src/ui/widget/layer-selector.cpp
+++ b/src/ui/widget/layer-selector.cpp
@@ -45,6 +45,7 @@ public:
AlternateIcons(Inkscape::IconSize size, gchar const *a, gchar const *b)
: _a(NULL), _b(NULL)
{
+ set_name("AlternateIcons");
if (a) {
_a = Gtk::manage(sp_icon_get_icon(a, size));
_a->set_no_show_all(true);
@@ -94,6 +95,7 @@ private:
LayerSelector::LayerSelector(SPDesktop *desktop)
: _desktop(NULL), _layer(NULL)
{
+ set_name("LayerSelector");
AlternateIcons *label;
label = Gtk::manage(new AlternateIcons(Inkscape::ICON_SIZE_DECORATION,
diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp
index 5d4a25a68..ab13577d7 100644
--- a/src/ui/widget/panel.cpp
+++ b/src/ui/widget/panel.cpp
@@ -73,6 +73,7 @@ Panel::Panel(Glib::ustring const &label, gchar const *prefs_path,
_action_area(0),
_fillable(0)
{
+ set_name( "InkscapePanel" );
#if WITH_GTKMM_3_0
set_orientation( Gtk::ORIENTATION_VERTICAL );
#endif
@@ -284,7 +285,10 @@ void Panel::_init()
pack_start(_top_bar, false, false);
Gtk::HBox* boxy = Gtk::manage(new Gtk::HBox());
-
+ boxy->set_name( "PanelBoxY" );
+ _contents.set_name( "PanelContents" );
+ _right_bar.set_name( "PanelRightBar" );
+ _top_bar.set_name( "PanelTopBar" );
boxy->pack_start(_contents, true, true);
boxy->pack_start(_right_bar, false, true);
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 87cf0b8c4..f7fd63f51 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -155,6 +155,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
_unit_mis(NULL),
_sw_unit(NULL)
{
+ set_name("SelectedStyle");
_drop[0] = _drop[1] = 0;
_dropEnabled[0] = _dropEnabled[1] = false;
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index fa8543c46..188be705d 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -124,6 +124,8 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
#endif
_sw_unit(NULL)
{
+ set_name("StyleSwatch");
+
_label[SS_FILL].set_markup(_("Fill:"));
_label[SS_STROKE].set_markup(_("Stroke:"));
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index fe724a964..164a06910 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -249,7 +249,7 @@ SPDesktopWidget::setMessage (Inkscape::MessageType type, const gchar *message)
gdk_window_process_updates(gtk_widget_get_window(GTK_WIDGET(sb)), TRUE);
}
- gtk_widget_set_tooltip_text (this->select_status_eventbox, gtk_label_get_text (sb));
+ gtk_widget_set_tooltip_text (this->select_status, gtk_label_get_text (sb));
}
Geom::Point
@@ -346,6 +346,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
/* Main table */
#if GTK_CHECK_VERSION(3,0,0)
dtw->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_name(dtw->vbox, "DesktopMainTable");
#else
dtw->vbox = gtk_vbox_new (FALSE, 0);
#endif
@@ -353,6 +354,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#if GTK_CHECK_VERSION(3,0,0)
dtw->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_name(dtw->statusbar, "DesktopStatusBar");
#else
dtw->statusbar = gtk_hbox_new (FALSE, 0);
#endif
@@ -364,7 +366,6 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
dtw->panels = new SwatchesPanel("/embedded/swatches" /*false*/);
dtw->panels->setOrientation(SP_ANCHOR_SOUTH);
-
#if GTK_CHECK_VERSION(3,0,0)
dtw->panels->set_vexpand(false);
#endif
@@ -374,6 +375,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#if GTK_CHECK_VERSION(3,0,0)
dtw->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_name(dtw->hbox, "DesktopHbox");
#else
dtw->hbox = gtk_hbox_new(FALSE, 0);
#endif
@@ -404,6 +406,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
Glib::RefPtr<Gtk::CssProvider> guides_lock_style_provider = Gtk::CssProvider::create();
guides_lock_style_provider->load_from_data("GtkWidget { padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0; }");
Gtk::Widget * wnd = Glib::wrap(dtw->guides_lock);
+ wnd->set_name("LockGuides");
Glib::RefPtr<Gtk::StyleContext> context = wnd->get_style_context();
context->add_provider(guides_lock_style_provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
#endif
@@ -411,6 +414,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
/* Horizontal ruler */
GtkWidget *eventbox = gtk_event_box_new ();
dtw->hruler = sp_ruler_new(GTK_ORIENTATION_HORIZONTAL);
+ gtk_widget_set_name(dtw->hruler, "HorizontalRuler");
dtw->hruler_box = eventbox;
Inkscape::Util::Unit const *pt = unit_table.getUnit("pt");
sp_ruler_set_unit(SP_RULER(dtw->hruler), pt);
@@ -421,13 +425,15 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
g_signal_connect (G_OBJECT (eventbox), "motion_notify_event", G_CALLBACK (sp_dt_hruler_event), dtw);
#if GTK_CHECK_VERSION(3,0,0)
- GtkWidget *tbl = gtk_grid_new();
+ GtkWidget *tbl_wrapper = gtk_grid_new(); // Is this widget really needed?
+ gtk_widget_set_name(tbl_wrapper, "CanvasTableWrapper");
dtw->canvas_tbl = gtk_grid_new();
+ gtk_widget_set_name(dtw->canvas_tbl, "CanvasTable");
gtk_grid_attach(GTK_GRID(dtw->canvas_tbl), dtw->guides_lock, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(dtw->canvas_tbl), eventbox, 1, 0, 1, 1);
#else
- GtkWidget *tbl = gtk_table_new(2, 3, FALSE);
+ GtkWidget *tbl_wrapper = gtk_table_new(2, 3, FALSE);
dtw->canvas_tbl = gtk_table_new(3, 3, FALSE);
gtk_table_attach(GTK_TABLE(dtw->canvas_tbl),
@@ -442,11 +448,12 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
0, 0);
#endif
g_signal_connect (G_OBJECT (dtw->guides_lock), "toggled", G_CALLBACK (sp_update_guides_lock), dtw);
- gtk_box_pack_start( GTK_BOX(dtw->hbox), tbl, TRUE, TRUE, 1 );
+ gtk_box_pack_start( GTK_BOX(dtw->hbox), tbl_wrapper, TRUE, TRUE, 1 );
/* Vertical ruler */
eventbox = gtk_event_box_new ();
dtw->vruler = sp_ruler_new(GTK_ORIENTATION_VERTICAL);
+ gtk_widget_set_name(dtw->vruler, "VerticalRuler");
/* Vertical ruler */
dtw->vruler_box = eventbox;
@@ -471,11 +478,9 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
// Horizontal scrollbar
dtw->hadj = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0));
-
-
-
#if GTK_CHECK_VERSION(3,0,0)
dtw->hscrollbar = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (dtw->hadj));
+ gtk_widget_set_name(dtw->hscrollbar, "HorizontalScrollbar");
gtk_grid_attach(GTK_GRID(dtw->canvas_tbl), dtw->hscrollbar, 1, 2, 1, 1);
dtw->vscrollbar_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
#else
@@ -492,6 +497,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
NULL,
INKSCAPE_ICON("zoom-original"),
_("Zoom drawing if window size changes"));
+ gtk_widget_set_name(dtw->sticky_zoom, "StickyZoom");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dtw->sticky_zoom), prefs->getBool("/options/stickyzoom/value"));
gtk_box_pack_start (GTK_BOX (dtw->vscrollbar_box), dtw->sticky_zoom, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (dtw->sticky_zoom), "toggled", G_CALLBACK (sp_dtw_sticky_zoom_toggled), dtw);
@@ -501,6 +507,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#if GTK_CHECK_VERSION(3,0,0)
dtw->vscrollbar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT(dtw->vadj));
+ gtk_widget_set_name(dtw->vscrollbar, "VerticalScrollbar");
#else
dtw->vscrollbar = gtk_vscrollbar_new (GTK_ADJUSTMENT (dtw->vadj));
#endif
@@ -528,6 +535,8 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
NULL,
INKSCAPE_ICON("color-management"),
tip );
+ gtk_widget_set_name(dtw->cms_adjust, "CMS_Adjust");
+
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
{
Glib::ustring current = prefs->getString("/options/displayprofile/uri");
@@ -607,9 +616,9 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
if (create_dock) {
dtw->dock = new Inkscape::UI::Widget::Dock();
-
#if WITH_GTKMM_3_0
Gtk::Paned *paned = new Gtk::Paned();
+ paned->set_name("Canvas_and_Dock");
#else
Gtk::HPaned *paned = new Gtk::HPaned();
#endif
@@ -626,9 +635,9 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_hexpand(GTK_WIDGET(paned->gobj()), TRUE);
gtk_widget_set_vexpand(GTK_WIDGET(paned->gobj()), TRUE);
- gtk_grid_attach(GTK_GRID(tbl), GTK_WIDGET (paned->gobj()), 1, 1, 1, 1);
+ gtk_grid_attach(GTK_GRID(tbl_wrapper), GTK_WIDGET (paned->gobj()), 1, 1, 1, 1);
#else
- gtk_table_attach (GTK_TABLE (tbl), GTK_WIDGET (paned->gobj()), 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
+ gtk_table_attach (GTK_TABLE (tbl_wrapper), GTK_WIDGET (paned->gobj()), 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
#endif
@@ -636,17 +645,26 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_hexpand(GTK_WIDGET(dtw->canvas_tbl), TRUE);
gtk_widget_set_vexpand(GTK_WIDGET(dtw->canvas_tbl), TRUE);
- gtk_grid_attach(GTK_GRID(tbl), GTK_WIDGET (dtw->canvas_tbl), 1, 1, 1, 1);
+ gtk_grid_attach(GTK_GRID(tbl_wrapper), GTK_WIDGET (dtw->canvas_tbl), 1, 1, 1, 1);
#else
- gtk_table_attach (GTK_TABLE (tbl), GTK_WIDGET (dtw->canvas_tbl), 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
+ gtk_table_attach (GTK_TABLE (tbl_wrapper), GTK_WIDGET (dtw->canvas_tbl), 1, 2, 1, 2, (GtkAttachOptions)(GTK_EXPAND | GTK_FILL),
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
#endif
}
+ // connect scrollbar signals
+ g_signal_connect (G_OBJECT (dtw->hadj), "value-changed", G_CALLBACK (sp_desktop_widget_adjustment_value_changed), dtw);
+ g_signal_connect (G_OBJECT (dtw->vadj), "value-changed", G_CALLBACK (sp_desktop_widget_adjustment_value_changed), dtw);
+
+
+ // --------------- Status Tool Bar ------------------//
+
+ // Selected Style (Fill/Stroke/Opacity)
dtw->selected_style = new Inkscape::UI::Widget::SelectedStyle(true);
GtkHBox *ss_ = dtw->selected_style->gobj();
gtk_box_pack_start (GTK_BOX (dtw->statusbar), GTK_WIDGET(ss_), FALSE, FALSE, 0);
+ // Separator
gtk_box_pack_start(GTK_BOX(dtw->statusbar),
#if GTK_CHECK_VERSION(3,0,0)
gtk_separator_new(GTK_ORIENTATION_VERTICAL),
@@ -655,15 +673,39 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#endif
FALSE, FALSE, 0);
- // connect scrollbar signals
- g_signal_connect (G_OBJECT (dtw->hadj), "value-changed", G_CALLBACK (sp_desktop_widget_adjustment_value_changed), dtw);
- g_signal_connect (G_OBJECT (dtw->vadj), "value-changed", G_CALLBACK (sp_desktop_widget_adjustment_value_changed), dtw);
+ // Layer Selector
+ dtw->layer_selector = new Inkscape::Widgets::LayerSelector(NULL);
+ // FIXME: need to unreference on container destruction to avoid leak
+ dtw->layer_selector->reference();
+ //dtw->layer_selector->set_size_request(-1, SP_ICON_SIZE_BUTTON);
+ gtk_box_pack_start(GTK_BOX(dtw->statusbar), GTK_WIDGET(dtw->layer_selector->gobj()), FALSE, FALSE, 1);
+
+ // Select Status
+ dtw->select_status = gtk_label_new (NULL);
+ gtk_widget_set_name( dtw->select_status, "SelectStatus");
+ gtk_label_set_ellipsize (GTK_LABEL(dtw->select_status), PANGO_ELLIPSIZE_END);
+#if GTK_CHECK_VERSION(3,10,0)
+ gtk_label_set_line_wrap (GTK_LABEL(dtw->select_status), true);
+ gtk_label_set_lines (GTK_LABEL(dtw->select_status), 2);
+#endif
- GtkWidget *statusbar_tail=gtk_statusbar_new();
- gtk_box_pack_end (GTK_BOX (dtw->statusbar), statusbar_tail, FALSE, FALSE, 0);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(dtw->select_status, GTK_ALIGN_START);
+#else
+ gtk_misc_set_alignment (GTK_MISC (dtw->select_status), 0.0, 0.5);
+#endif
- // zoom status spinbutton
+ gtk_widget_set_size_request (dtw->select_status, 1, -1);
+
+ // Display the initial welcome message in the statusbar
+ gtk_label_set_markup (GTK_LABEL (dtw->select_status), _("<b>Welcome to Inkscape!</b> Use shape or freehand tools to create objects; use selector (arrow) to move or transform them."));
+
+ gtk_box_pack_start (GTK_BOX (dtw->statusbar), dtw->select_status, TRUE, TRUE, 0);
+
+
+ // Zoom status spinbutton
dtw->zoom_status = gtk_spin_button_new_with_range (log(SP_DESKTOP_ZOOM_MIN)/log(2), log(SP_DESKTOP_ZOOM_MAX)/log(2), 0.1);
+ gtk_widget_set_name(dtw->zoom_status, "ZoomStatus");
gtk_widget_set_tooltip_text (dtw->zoom_status, _("Zoom"));
gtk_widget_set_size_request (dtw->zoom_status, STATUS_ZOOM_WIDTH, -1);
gtk_entry_set_width_chars (GTK_ENTRY (dtw->zoom_status), 6);
@@ -677,12 +719,14 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
dtw->zoom_update = g_signal_connect (G_OBJECT (dtw->zoom_status), "value_changed", G_CALLBACK (sp_dtw_zoom_value_changed), dtw);
dtw->zoom_update = g_signal_connect (G_OBJECT (dtw->zoom_status), "populate_popup", G_CALLBACK (sp_dtw_zoom_populate_popup), dtw);
- // cursor coordinates
+ // Cursor coordinates
#if GTK_CHECK_VERSION(3,0,0)
dtw->coord_status = gtk_grid_new();
+ gtk_widget_set_name(dtw->coord_status, "CoordinateAndZStatus");
gtk_grid_set_row_spacing(GTK_GRID(dtw->coord_status), 0);
gtk_grid_set_column_spacing(GTK_GRID(dtw->coord_status), 2);
GtkWidget* sep = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
+ gtk_widget_set_name(sep, "CoordinateSeparator");
gtk_grid_attach(GTK_GRID(dtw->coord_status),
GTK_WIDGET(sep),
0, 0, 1, 2);
@@ -696,9 +740,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
GTK_FILL, GTK_FILL, 0, 0);
#endif
- eventbox = gtk_event_box_new ();
- gtk_container_add (GTK_CONTAINER (eventbox), dtw->coord_status);
- gtk_widget_set_tooltip_text (eventbox, _("Cursor coordinates"));
+ gtk_widget_set_tooltip_text (dtw->coord_status, _("Cursor coordinates"));
GtkWidget *label_x = gtk_label_new(_("X:"));
GtkWidget *label_y = gtk_label_new(_("Y:"));
@@ -720,6 +762,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
gtk_label_set_markup( GTK_LABEL(dtw->coord_status_y), "<tt> 0.00 </tt>" );
GtkWidget* label_z = gtk_label_new(_("Z:"));
+ gtk_widget_set_name(label_z, "ZLabel");
#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_halign(dtw->coord_status_x, GTK_ALIGN_END);
@@ -738,14 +781,10 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#endif
sp_set_font_size_smaller (dtw->coord_status);
- gtk_box_pack_end (GTK_BOX (statusbar_tail), eventbox, FALSE, FALSE, 1);
- dtw->layer_selector = new Inkscape::Widgets::LayerSelector(NULL);
- // FIXME: need to unreference on container destruction to avoid leak
- dtw->layer_selector->reference();
- //dtw->layer_selector->set_size_request(-1, SP_ICON_SIZE_BUTTON);
- gtk_box_pack_start(GTK_BOX(dtw->statusbar), GTK_WIDGET(dtw->layer_selector->gobj()), FALSE, FALSE, 1);
+ gtk_box_pack_end (GTK_BOX (dtw->statusbar), dtw->coord_status, FALSE, FALSE, 0);
+ // --------------- Color Management ---------------- //
dtw->_tracker = ege_color_prof_tracker_new(GTK_WIDGET(dtw->layer_selector->gobj()));
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
bool fromDisplay = prefs->getBool( "/options/displayprofile/from_display");
@@ -760,30 +799,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
g_signal_connect( G_OBJECT(dtw->_tracker), "changed", G_CALLBACK(sp_dtw_color_profile_event), dtw );
- dtw->select_status_eventbox = gtk_event_box_new ();
- dtw->select_status = gtk_label_new (NULL);
- gtk_label_set_ellipsize (GTK_LABEL(dtw->select_status), PANGO_ELLIPSIZE_END);
-
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_widget_set_halign(dtw->select_status, GTK_ALIGN_START);
-#else
- gtk_misc_set_alignment (GTK_MISC (dtw->select_status), 0.0, 0.5);
-#endif
-
- gtk_widget_set_size_request (dtw->select_status, 1, -1);
- // display the initial welcome message in the statusbar
- gtk_label_set_markup (GTK_LABEL (dtw->select_status), _("<b>Welcome to Inkscape!</b> Use shape or freehand tools to create objects; use selector (arrow) to move or transform them."));
- // space label 2 pixels from left edge
- gtk_container_add (GTK_CONTAINER (dtw->select_status_eventbox), dtw->select_status);
-#if GTK_CHECK_VERSION(3,0,0)
- gtk_box_pack_start(GTK_BOX(dtw->statusbar),
- gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0),
- FALSE, FALSE, 2);
-#else
- gtk_box_pack_start (GTK_BOX (dtw->statusbar), gtk_hbox_new(FALSE, 0), FALSE, FALSE, 2);
-#endif
- gtk_box_pack_start (GTK_BOX (dtw->statusbar), dtw->select_status_eventbox, TRUE, TRUE, 0);
-
+ // ------------------ Finish Up -------------------- //
gtk_widget_show_all (dtw->vbox);
gtk_widget_grab_focus (GTK_WIDGET(dtw->canvas));
@@ -1452,6 +1468,7 @@ bool SPDesktopWidget::showInfoDialog( Glib::ustring const &message )
GTK_MESSAGE_INFO,
GTK_BUTTONS_OK,
"%s", message.c_str());
+ gtk_widget_set_name(dialog, "InfoDialog");
gtk_window_set_title( GTK_WINDOW(dialog), _("Note:")); // probably want to take this as a parameter.
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -1764,6 +1781,7 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview)
dtw->layer_selector->setDesktop(dtw->desktop);
dtw->menubar = sp_ui_main_menubar (dtw->desktop);
+ gtk_widget_set_name(dtw->menubar, "MenuBar");
gtk_widget_show_all (dtw->menubar);
gtk_box_pack_start (GTK_BOX (dtw->vbox), dtw->menubar, FALSE, FALSE, 0);
@@ -1884,8 +1902,8 @@ bool SPDesktopWidget::onFocusInEvent(GdkEventFocus*)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
if (prefs->getBool("/options/bitmapautoreload/value", true)) {
- std::set<SPObject *> imageList = (desktop->doc())->getResourceList("image");
- for (std::set<SPObject *>::const_iterator it = imageList.begin(); it != imageList.end(); ++it) {
+ std::vector<SPObject *> imageList = (desktop->doc())->getResourceList("image");
+ for (std::vector<SPObject *>::const_iterator it = imageList.begin(); it != imageList.end(); ++it) {
SPImage* image = SP_IMAGE(*it);
sp_image_refresh_if_outdated( image );
}
diff --git a/src/widgets/eraser-toolbar.cpp b/src/widgets/eraser-toolbar.cpp
index 5b883905b..f69ac633f 100644
--- a/src/widgets/eraser-toolbar.cpp
+++ b/src/widgets/eraser-toolbar.cpp
@@ -191,8 +191,8 @@ void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb
/* Overlap */
{
InkToggleAction* act = ink_toggle_action_new( "EraserBreakAppart",
- _("Break appart cutted items"),
- _("Break appart cutted itemss"),
+ _("Break apart cut items"),
+ _("Break apart cut items"),
INKSCAPE_ICON("distribute-randomize"),
secondarySize );
gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/eraser/break_apart", false) );
diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp
index 858aa05db..a44e9962e 100644
--- a/src/widgets/gradient-toolbar.cpp
+++ b/src/widgets/gradient-toolbar.cpp
@@ -140,8 +140,8 @@ gboolean gr_vector_list(GtkWidget *combo_box, SPDesktop *desktop, bool selection
gtk_list_store_clear(store);
std::vector<SPObject *> gl;
- std::set<SPObject *> gradients = document->getResourceList( "gradient" );
- for (std::set<SPObject *>::const_iterator it = gradients.begin(); it != gradients.end(); ++it) {
+ std::vector<SPObject *> gradients = document->getResourceList( "gradient" );
+ for (std::vector<SPObject *>::const_iterator it = gradients.begin(); it != gradients.end(); ++it) {
SPGradient *grad = SP_GRADIENT(*it);
if ( grad->hasStops() && !grad->isSolid() ) {
gl.push_back(*it);
diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp
index 3aa44c90a..97e65141f 100644
--- a/src/widgets/gradient-vector.cpp
+++ b/src/widgets/gradient-vector.cpp
@@ -298,8 +298,8 @@ static void sp_gvs_rebuild_gui_full(SPGradientVectorSelector *gvs)
/* Pick up all gradients with vectors */
GSList *gl = NULL;
if (gvs->gr) {
- std::set<SPObject *> gradients = gvs->gr->document->getResourceList("gradient");
- for (std::set<SPObject *>::const_iterator it = gradients.begin(); it != gradients.end(); ++it) {
+ std::vector<SPObject *> gradients = gvs->gr->document->getResourceList("gradient");
+ for (std::vector<SPObject *>::const_iterator it = gradients.begin(); it != gradients.end(); ++it) {
SPGradient* grad = SP_GRADIENT(*it);
if ( grad->hasStops() && (grad->isSwatch() == gvs->swatched) ) {
gl = g_slist_prepend(gl, *it);
diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp
index 602cad3c3..aafa6bd1e 100644
--- a/src/widgets/paint-selector.cpp
+++ b/src/widgets/paint-selector.cpp
@@ -844,8 +844,8 @@ ink_pattern_list_get (SPDocument *source)
return NULL;
GSList *pl = NULL;
- std::set<SPObject *> patterns = source->getResourceList("pattern");
- for (std::set<SPObject *>::const_iterator it = patterns.begin(); it != patterns.end(); ++it) {
+ std::vector<SPObject *> patterns = source->getResourceList("pattern");
+ for (std::vector<SPObject *>::const_iterator it = patterns.begin(); it != patterns.end(); ++it) {
if (SP_PATTERN(*it) == SP_PATTERN(*it)->rootPattern()) { // only if this is a root pattern
pl = g_slist_prepend(pl, *it);
}
diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp
index fe851d592..deffd384a 100644
--- a/src/widgets/ruler.cpp
+++ b/src/widgets/ruler.cpp
@@ -168,6 +168,10 @@ sp_ruler_class_init (SPRulerClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+#if GTK_CHECK_VERSION(3,20,0)
+ gtk_widget_class_set_css_name (widget_class, "ruler-widget");
+#endif
+
object_class->dispose = sp_ruler_dispose;
object_class->set_property = sp_ruler_set_property;
object_class->get_property = sp_ruler_get_property;
@@ -282,19 +286,6 @@ sp_ruler_init (SPRuler *ruler)
priv->pos_redraw_idle_id = 0;
priv->font_scale = DEFAULT_RULER_FONT_SCALE;
-
-#if GTK_CHECK_VERSION(3,0,0)
- const gchar *str =
- "SPRuler {\n"
- " background-color: @bg_color;\n"
- "}\n";
- GtkCssProvider *css = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (css, str, -1, NULL);
- gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (ruler)),
- GTK_STYLE_PROVIDER (css),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
- g_object_unref (css);
-#endif
}
static void
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 0697ff0fb..f7b5e585f 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -999,6 +999,7 @@ static GtkWidget* toolboxNewCommon( GtkWidget* tb, BarId id, GtkPositionType /*h
gtk_widget_set_sensitive(tb, FALSE);
GtkWidget *hb = gtk_event_box_new(); // A simple, neutral container.
+ gtk_widget_set_name(hb, "ToolboxCommon");
gtk_container_add(GTK_CONTAINER(hb), tb);
gtk_widget_show(GTK_WIDGET(tb));
@@ -1016,6 +1017,7 @@ GtkWidget *ToolboxFactory::createToolToolbox()
{
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_name(tb, "ToolToolbox");
gtk_box_set_homogeneous(GTK_BOX(tb), FALSE);
#else
GtkWidget *tb = gtk_vbox_new(FALSE, 0);
@@ -1028,6 +1030,7 @@ GtkWidget *ToolboxFactory::createAuxToolbox()
{
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_name(tb, "AuxToolbox");
gtk_box_set_homogeneous(GTK_BOX(tb), FALSE);
#else
GtkWidget *tb = gtk_vbox_new(FALSE, 0);
@@ -1044,6 +1047,7 @@ GtkWidget *ToolboxFactory::createCommandsToolbox()
{
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_name(tb, "CommandsToolbox");
gtk_box_set_homogeneous(GTK_BOX(tb), FALSE);
#else
GtkWidget *tb = gtk_vbox_new(FALSE, 0);
@@ -1056,6 +1060,7 @@ GtkWidget *ToolboxFactory::createSnapToolbox()
{
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ gtk_widget_set_name(tb, "SnapToolbox");
gtk_box_set_homogeneous(GTK_BOX(tb), FALSE);
#else
GtkWidget *tb = gtk_vbox_new(FALSE, 0);
@@ -1406,6 +1411,7 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
// converted to GtkActions and UIManager
GtkWidget* kludge = gtk_toolbar_new();
+ gtk_widget_set_name( kludge, "Kludge" );
g_object_set_data( G_OBJECT(kludge), "dtw", desktop->canvas);
g_object_set_data( G_OBJECT(kludge), "desktop", desktop);
dataHolders[aux_toolboxes[i].type_name] = kludge;
@@ -1418,7 +1424,7 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
} else {
sub_toolbox = aux_toolboxes[i].create_func(desktop);
}
-
+ gtk_widget_set_name( sub_toolbox, "SubToolBox" );
gtk_size_group_add_widget( grouper, sub_toolbox );
gtk_container_add(GTK_CONTAINER(toolbox), sub_toolbox);
@@ -1436,6 +1442,7 @@ void setup_aux_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget* holder = gtk_grid_new();
+ gtk_widget_set_name( holder, "ToolbarHolder" );
gtk_grid_attach( GTK_GRID(holder), kludge, 2, 0, 1, 1);
#else
GtkWidget* holder = gtk_table_new( 1, 3, FALSE );
diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp
index 2bcae5d81..a8ac3b4cc 100644
--- a/src/xml/rebase-hrefs.cpp
+++ b/src/xml/rebase-hrefs.cpp
@@ -220,8 +220,8 @@ void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_b
*
* Note also that Inkscape only supports fragment hrefs (href="#pattern257") for many of these
* cases. */
- std::set<SPObject *> images = doc->getResourceList("image");
- for (std::set<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) {
+ std::vector<SPObject *> images = doc->getResourceList("image");
+ for (std::vector<SPObject *>::const_iterator it = images.begin(); it != images.end(); ++it) {
Inkscape::XML::Node *ir = (*it)->getRepr();
std::string uri;