summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorAbhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom>2010-07-17 07:18:31 +0000
committerAbhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom>2010-07-17 07:18:31 +0000
commit150ac8ed3274e060e3349b5c0901ec8c7c7e3d4e (patch)
treee05bd4506842f0e70e80e4327bd438d715d8dd70 /src/desktop.cpp
parentSPShape c++ified to the extent it was possible and more changes done for XML ... (diff)
downloadinkscape-150ac8ed3274e060e3349b5c0901ec8c7c7e3d4e.tar.gz
inkscape-150ac8ed3274e060e3349b5c0901ec8c7c7e3d4e.zip
More in XML privatisation with new create3DBox function and other supplements to efficiently hide information.
(bzr r9546.1.8)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index d5e7974ea..3f9fc7806 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -90,6 +90,7 @@
#include "display/canvas-grid.h"
#include "widgets/desktop-widget.h"
#include "box3d-context.h"
+#include "desktop-style.h"
// TODO those includes are only for node tool quick zoom. Remove them after fixing it.
#include "ui/tool/node-tool.h"
@@ -961,6 +962,27 @@ SPDesktop::zoom_absolute_keep_point (double cx, double cy, double px, double py,
}
/**
+ * Apply the desktop's current style or the tool style to the object.
+ */
+void SPDesktop::applyCurrentOrToolStyle(SPObject *obj, Glib::ustring const &tool_path, bool with_text)
+{
+ SPCSSAttr *css_current = sp_desktop_get_style(this, with_text);
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+ if (prefs->getBool(tool_path + "/usecurrent") && css_current) {
+ sp_repr_css_set(obj->getRepr(), css_current, "style");
+ } else {
+ SPCSSAttr *css = prefs->getInheritedStyle(tool_path + "/style");
+ sp_repr_css_set(obj->getRepr(), css, "style");
+ sp_repr_css_attr_unref(css);
+ }
+ if (css_current) {
+ sp_repr_css_attr_unref(css_current);
+ }
+
+}
+
+/**
* Zoom to center with absolute zoom factor.
*/
void