diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-02 09:45:23 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-02 09:50:17 +0000 |
| commit | c140c53e787b4fa24534bd4eab6b1cead0ef28ae (patch) | |
| tree | ffcc02426c65478537a17d89e542706333154498 /src/attributes.cpp | |
| parent | fixes for:update multiple objects, refersh strike on named colors and refersh... (diff) | |
| download | inkscape-c140c53e787b4fa24534bd4eab6b1cead0ef28ae.tar.gz inkscape-c140c53e787b4fa24534bd4eab6b1cead0ef28ae.zip | |
Add popup with CSS properties
Diffstat (limited to 'src/attributes.cpp')
| -rw-r--r-- | src/attributes.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/attributes.cpp b/src/attributes.cpp index d7081d4c9..575e40b5c 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -9,11 +9,13 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ +#include "attributes.h" #include <cstring> #include <map> +#include <algorithm> #include <glib.h> // g_assert() -#include "attributes.h" + struct SPStyleProp { SPAttributeEnum code; @@ -602,6 +604,28 @@ sp_attribute_name(SPAttributeEnum id) return props[id].name; } +std::vector<Glib::ustring> +sp_attribute_name_list(bool cssattr, bool attr) +{ + std::vector<Glib::ustring> result; + static AttributeLookupImpl const _instance; + bool add = attr; + for (auto prop : props) { + if (prop.code == SP_ATTR_D) { + if (cssattr) { + add = true; + } else if (attr) { + add = false; + } + } + if (add) { + result.push_back(Glib::ustring(prop.name)); + } + } + std::sort(result.begin(), result.end()); + return result; +} + /* Local Variables: |
