summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-05-29 11:46:10 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:45 -0400
commit4c60a925c02b34f02d757f459e1e5574c29d5169 (patch)
treea02b9eee6db51deb162593a7199b3d2d57c41d4d /gtk2_ardour/utils.cc
parente4cfa1d95553bc9911dc206d8d2e3ff2d40adba2 (diff)
the return of the theme selector, plus 3 new themes from cooltehno
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc34
1 files changed, 33 insertions, 1 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index ca6c0608ce..12c01fb7d0 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -36,11 +36,13 @@
#include <gtk/gtkpaned.h>
#include <boost/algorithm/string.hpp>
+#include "pbd/basename.h"
#include "pbd/file_utils.h"
#include <gtkmm2ext/utils.h>
#include "ardour/filesystem_paths.h"
+#include "ardour/search_paths.h"
#include "canvas/item.h"
#include "canvas/utils.h"
@@ -417,6 +419,36 @@ ARDOUR_UI_UTILS::get_xpm (std::string name)
}
vector<string>
+ARDOUR_UI_UTILS::get_color_themes ()
+{
+ Searchpath spath(ARDOUR::theme_search_path());
+ vector<string> r;
+
+ for (vector<string>::iterator s = spath.begin(); s != spath.end(); ++s) {
+
+ vector<string> entries;
+
+ find_files_matching_pattern (entries, *s, string ("*") + UIConfiguration::color_file_suffix);
+
+ for (vector<string>::iterator e = entries.begin(); e != entries.end(); ++e) {
+
+ XMLTree tree;
+
+ tree.read ((*e).c_str());
+ XMLNode* root = tree.root();
+
+ if (!root || root->name() != X_("Ardour")) {
+ continue;
+ }
+
+ r.push_back (Glib::filename_to_utf8 (basename_nosuffix(*e)));
+ }
+ }
+
+ return r;
+}
+
+vector<string>
ARDOUR_UI_UTILS::get_icon_sets ()
{
Searchpath spath(ARDOUR::ardour_data_search_path());
@@ -669,7 +701,7 @@ ARDOUR_UI_UTILS::escape_underscores (string const & s)
Gdk::Color
ARDOUR_UI_UTILS::unique_random_color (list<Gdk::Color>& used_colors)
{
- Gdk::Color newcolor;
+ Gdk::Color newcolor;
while (1) {