summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2008-06-02 05:02:28 +0000
committerDoug McLain <doug@nostar.net>2008-06-02 05:02:28 +0000
commit9c0d7d72d70082a54f823cd44c0ccda5da64bb6f (patch)
tree96ec400b83b8c1c06852b1936f684b5fbcd47a79 /libs/pbd/pbd
parent2f3f697bb8e185eb43c2c50b4eefc2bcb937f269 (diff)
remove empty sigc++2 directory
git-svn-id: svn://localhost/ardour2/branches/3.0@3432 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd')
-rw-r--r--libs/pbd/pbd/.DS_Storebin6148 -> 0 bytes
-rw-r--r--libs/pbd/pbd/.cvsignore1
-rw-r--r--libs/pbd/pbd/abstract_ui.cc149
-rw-r--r--libs/pbd/pbd/abstract_ui.h78
-rw-r--r--libs/pbd/pbd/base_ui.h65
-rw-r--r--libs/pbd/pbd/basename.h32
-rw-r--r--libs/pbd/pbd/command.h49
-rw-r--r--libs/pbd/pbd/compose.h393
-rw-r--r--libs/pbd/pbd/controllable.h92
-rw-r--r--libs/pbd/pbd/convert.h54
-rw-r--r--libs/pbd/pbd/crossthread.h57
-rw-r--r--libs/pbd/pbd/destructible.h47
-rw-r--r--libs/pbd/pbd/enumwriter.h77
-rw-r--r--libs/pbd/pbd/error.h31
-rw-r--r--libs/pbd/pbd/failed_constructor.h30
-rw-r--r--libs/pbd/pbd/fastlog.h40
-rw-r--r--libs/pbd/pbd/file_utils.h99
-rw-r--r--libs/pbd/pbd/filesystem.h202
-rw-r--r--libs/pbd/pbd/filesystem_paths.h36
-rw-r--r--libs/pbd/pbd/forkexec.h28
-rw-r--r--libs/pbd/pbd/fpu.h31
-rw-r--r--libs/pbd/pbd/functor_command.h121
-rw-r--r--libs/pbd/pbd/id.h67
-rw-r--r--libs/pbd/pbd/mathfix.h33
-rw-r--r--libs/pbd/pbd/memento_command.h101
-rw-r--r--libs/pbd/pbd/mountpoint.h27
-rw-r--r--libs/pbd/pbd/pathscanner.h85
-rw-r--r--libs/pbd/pbd/pool.h74
-rw-r--r--libs/pbd/pbd/pthread_utils.h42
-rw-r--r--libs/pbd/pbd/rcu.h165
-rw-r--r--libs/pbd/pbd/receiver.h49
-rw-r--r--libs/pbd/pbd/replace_all.h27
-rw-r--r--libs/pbd/pbd/ringbuffer.h281
-rw-r--r--libs/pbd/pbd/ringbufferNPT.h274
-rw-r--r--libs/pbd/pbd/search_path.h183
-rw-r--r--libs/pbd/pbd/selectable.h101
-rw-r--r--libs/pbd/pbd/shiva.h138
-rw-r--r--libs/pbd/pbd/shortpath.h27
-rw-r--r--libs/pbd/pbd/stacktrace.h114
-rw-r--r--libs/pbd/pbd/stateful.h63
-rw-r--r--libs/pbd/pbd/statefuldestructible.h44
-rw-r--r--libs/pbd/pbd/stl_delete.h88
-rw-r--r--libs/pbd/pbd/stl_functors.h92
-rw-r--r--libs/pbd/pbd/strsplit.h30
-rw-r--r--libs/pbd/pbd/textreceiver.h43
-rw-r--r--libs/pbd/pbd/thrown_error.h38
-rw-r--r--libs/pbd/pbd/tokenizer.h90
-rw-r--r--libs/pbd/pbd/touchable.h88
-rw-r--r--libs/pbd/pbd/transmitter.h109
-rw-r--r--libs/pbd/pbd/undo.h108
-rw-r--r--libs/pbd/pbd/unknown_type.h11
-rw-r--r--libs/pbd/pbd/whitespace.h33
-rw-r--r--libs/pbd/pbd/xml++.h158
53 files changed, 0 insertions, 4495 deletions
diff --git a/libs/pbd/pbd/.DS_Store b/libs/pbd/pbd/.DS_Store
deleted file mode 100644
index 5008ddfcf5..0000000000
--- a/libs/pbd/pbd/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/libs/pbd/pbd/.cvsignore b/libs/pbd/pbd/.cvsignore
deleted file mode 100644
index 67020331ba..0000000000
--- a/libs/pbd/pbd/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-version.h
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc
deleted file mode 100644
index 97f19e1fe5..0000000000
--- a/libs/pbd/pbd/abstract_ui.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-#include <unistd.h>
-
-#include <pbd/abstract_ui.h>
-#include <pbd/pthread_utils.h>
-#include <pbd/failed_constructor.h>
-
-#include "i18n.h"
-
-using namespace std;
-
-template <typename RequestObject>
-AbstractUI<RequestObject>::AbstractUI (string name, bool with_signal_pipes)
- : BaseUI (name, with_signal_pipes)
-{
- if (pthread_key_create (&thread_request_buffer_key, 0)) {
- cerr << _("cannot create thread request buffer key") << endl;
- throw failed_constructor();
- }
-
- PBD::ThreadCreated.connect (mem_fun (*this, &AbstractUI<RequestObject>::register_thread));
- PBD::ThreadCreatedWithRequestSize.connect (mem_fun (*this, &AbstractUI<RequestObject>::register_thread_with_request_count));
-}
-
-template <typename RequestObject> void
-AbstractUI<RequestObject>::register_thread (pthread_t thread_id, string name)
-{
- register_thread_with_request_count (thread_id, name, 256);
-}
-
-template <typename RequestObject> void
-AbstractUI<RequestObject>::register_thread_with_request_count (pthread_t thread_id, string thread_name, uint32_t num_requests)
-{
- RequestBuffer* b = new RequestBuffer (num_requests);
-
- {
- Glib::Mutex::Lock lm (request_buffer_map_lock);
- request_buffers[thread_id] = b;
- }
-
- pthread_setspecific (thread_request_buffer_key, b);
-}
-
-template <typename RequestObject> RequestObject*
-AbstractUI<RequestObject>::get_request (RequestType rt)
-{
- RequestBuffer* rbuf = static_cast<RequestBuffer*>(pthread_getspecific (thread_request_buffer_key));
-
- if (rbuf == 0) {
- /* Cannot happen, but if it does we can't use the error reporting mechanism */
- cerr << _("programming error: ")
- << string_compose ("no %1-UI request buffer found for thread %2", name(), pthread_name())
- << endl;
- abort ();
- }
-
- RequestBufferVector vec;
- vec.buf[0] = 0;
- vec.buf[1] = 0;
-
- rbuf->get_write_vector (&vec);
-
- if (vec.len[0] == 0) {
- if (vec.len[1] == 0) {
- cerr << string_compose ("no space in %1-UI request buffer for thread %2", name(), pthread_name())
- << endl;
- return 0;
- } else {
- vec.buf[1]->type = rt;
- return vec.buf[1];
- }
- } else {
- vec.buf[0]->type = rt;
- return vec.buf[0];
- }
-}
-
-template <typename RequestObject> void
-AbstractUI<RequestObject>::handle_ui_requests ()
-{
- RequestBufferMapIterator i;
-
- request_buffer_map_lock.lock ();
-
- for (i = request_buffers.begin(); i != request_buffers.end(); ++i) {
-
- RequestBufferVector vec;
-
- while (true) {
-
- /* we must process requests 1 by 1 because
- the request may run a recursive main
- event loop that will itself call
- handle_ui_requests. when we return
- from the request handler, we cannot
- expect that the state of queued requests
- is even remotely consistent with
- the condition before we called it.
- */
-
- i->second->get_read_vector (&vec);
-
- if (vec.len[0] == 0) {
- break;
- } else {
- request_buffer_map_lock.unlock ();
- do_request (vec.buf[0]);
- request_buffer_map_lock.lock ();
- i->second->increment_read_ptr (1);
- }
- }
- }
-
- request_buffer_map_lock.unlock ();
-}
-
-template <typename RequestObject> void
-AbstractUI<RequestObject>::send_request (RequestObject *req)
-{
- if (base_instance() == 0) {
- return; /* XXX is this the right thing to do ? */
- }
-
- if (caller_is_ui_thread()) {
- // cerr << "GUI thread sent request " << req << " type = " << req->type << endl;
- do_request (req);
- } else {
- RequestBuffer* rbuf = static_cast<RequestBuffer*> (pthread_getspecific (thread_request_buffer_key));
-
- if (rbuf == 0) {
- /* can't use the error system to report this, because this
- thread isn't registered!
- */
- cerr << _("programming error: ")
- << string_compose ("AbstractUI::send_request() called from %1 (%2), but no request buffer exists for that thread", name(), pthread_name())
- << endl;
- abort ();
- }
-
- // cerr << "thread " << pthread_self() << " sent request " << req << " type = " << req->type << endl;
-
- rbuf->increment_write_ptr (1);
-
- if (signal_pipe[1] >= 0) {
- const char c = 0;
- write (signal_pipe[1], &c, 1);
- }
- }
-}
-
diff --git a/libs/pbd/pbd/abstract_ui.h b/libs/pbd/pbd/abstract_ui.h
deleted file mode 100644
index 88c27aa0bc..0000000000
--- a/libs/pbd/pbd/abstract_ui.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_abstract_ui_h__
-#define __pbd_abstract_ui_h__
-
-#include <map>
-#include <string>
-#include <pthread.h>
-
-#include <sigc++/sigc++.h>
-
-#include <glibmm/thread.h>
-
-#include <pbd/receiver.h>
-#include <pbd/ringbufferNPT.h>
-#include <pbd/base_ui.h>
-
-class Touchable;
-
-template <class RequestObject>
-class AbstractUI : public BaseUI
-{
- public:
- AbstractUI (std::string name, bool with_signal_pipe);
- virtual ~AbstractUI() {}
-
- virtual bool caller_is_ui_thread() = 0;
-
- void call_slot (sigc::slot<void> el_slot) {
- RequestObject *req = get_request (BaseUI::CallSlot);
-
- if (req == 0) {
- return;
- }
-
- req->slot = el_slot;
- send_request (req);
- }
-
- void register_thread (pthread_t, std::string);
- void register_thread_with_request_count (pthread_t, std::string, uint32_t num_requests);
-
- protected:
- typedef RingBufferNPT<RequestObject> RequestBuffer;
- typedef typename RequestBuffer::rw_vector RequestBufferVector;
- typedef typename std::map<pthread_t,RequestBuffer*>::iterator RequestBufferMapIterator;
-
- Glib::Mutex request_buffer_map_lock;
- typedef std::map<pthread_t,RequestBuffer*> RequestBufferMap;
- RequestBufferMap request_buffers;
- pthread_key_t thread_request_buffer_key;
- RequestObject* get_request (RequestType);
- void handle_ui_requests ();
- void send_request (RequestObject *);
-
- virtual void do_request (RequestObject *) = 0;
-};
-
-#endif /* __pbd_abstract_ui_h__ */
-
-
diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h
deleted file mode 100644
index 0928512841..0000000000
--- a/libs/pbd/pbd/base_ui.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_base_ui_h__
-#define __pbd_base_ui_h__
-
-#include <string>
-#include <stdint.h>
-
-#include <sigc++/slot.h>
-#include <sigc++/trackable.h>
-
-class BaseUI : virtual public sigc::trackable {
- public:
- BaseUI (std::string name, bool with_signal_pipes);
- virtual ~BaseUI();
-
- BaseUI* base_instance() { return base_ui_instance; }
-
- std::string name() const { return _name; }
-
- bool ok() const { return _ok; }
-
- enum RequestType {
- range_guarantee = ~0
- };
-
- struct BaseRequestObject {
- RequestType type;
- sigc::slot<void> the_slot;
- };
-
- static RequestType new_request_type();
- static RequestType CallSlot;
-
- protected:
- int signal_pipe[2];
- bool _ok;
-
- private:
- std::string _name;
- BaseUI* base_ui_instance;
-
- static uint32_t rt_bit;
-
- int setup_signal_pipe ();
-};
-
-#endif /* __pbd_base_ui_h__ */
diff --git a/libs/pbd/pbd/basename.h b/libs/pbd/pbd/basename.h
deleted file mode 100644
index f13c3840dc..0000000000
--- a/libs/pbd/pbd/basename.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __stupid_basename_h__
-#define __stupid_basename_h__
-
-#include <glibmm/ustring.h>
-
-namespace PBD
-{
-
-Glib::ustring basename_nosuffix (Glib::ustring);
-
-}
-
-#endif // __stupid_basename_h__
diff --git a/libs/pbd/pbd/command.h b/libs/pbd/pbd/command.h
deleted file mode 100644
index a66485bc0d..0000000000
--- a/libs/pbd/pbd/command.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright (C) 2006 Paul Davis
- Author: Hans Fugal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __lib_pbd_command_h__
-#define __lib_pbd_command_h__
-
-#include <pbd/statefuldestructible.h>
-
-class Command : public PBD::StatefulDestructible
-{
-public:
- virtual ~Command() {}
-
- virtual void operator() () = 0;
-
- void set_name (const std::string& str) { _name = str; }
- const std::string& name() const { return _name; }
-
- virtual void undo() = 0;
- virtual void redo() { (*this)(); }
-
- virtual XMLNode &get_state();
- virtual int set_state(const XMLNode&) { /* noop */ return 0; }
-
-protected:
- Command() {}
- Command(const std::string& name) : _name(name) {}
-
- std::string _name;
-};
-
-#endif // __lib_pbd_command_h_
diff --git a/libs/pbd/pbd/compose.h b/libs/pbd/pbd/compose.h
deleted file mode 100644
index 0df9519aaf..0000000000
--- a/libs/pbd/pbd/compose.h
+++ /dev/null
@@ -1,393 +0,0 @@
-/* Defines String::compose(fmt, arg...) for easy, i18n-friendly
- * composition of strings.
- *
- * Version 1.0.
- *
- * Copyright (c) 2002 Ole Laursen <olau@hardworking.dk>.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-//
-// Basic usage is like
-//
-// std::cout << String::compose("This is a %1x%2 matrix.", rows, cols);
-//
-// See http://www.cs.auc.dk/~olau/compose/ or the included README.compose for
-// more details.
-//
-
-#ifndef STRING_COMPOSE_H
-#define STRING_COMPOSE_H
-
-#include <sstream>
-#include <string>
-#include <list>
-#include <map> // for multimap
-
-namespace StringPrivate
-{
- // the actual composition class - using string::compose is cleaner, so we
- // hide it here
- class Composition
- {
- public:
- // initialize and prepare format string on the form "text %1 text %2 etc."
- explicit Composition(std::string fmt);
-
- // supply an replacement argument starting from %1
- template <typename T>
- Composition &arg(const T &obj);
-
- // compose and return string
- std::string str() const;
-
- private:
- std::ostringstream os;
- int arg_no;
-
- // we store the output as a list - when the output string is requested, the
- // list is concatenated to a string; this way we can keep iterators into
- // the list instead of into a string where they're possibly invalidated on
- // inserting a specification string
- typedef std::list<std::string> output_list;
- output_list output;
-
- // the initial parse of the format string fills in the specification map
- // with positions for each of the various %?s
- typedef std::multimap<int, output_list::iterator> specification_map;
- specification_map specs;
- };
-
- // helper for converting spec string numbers
- inline int char_to_int(char c)
- {
- switch (c) {
- case '0': return 0;
- case '1': return 1;
- case '2': return 2;
- case '3': return 3;
- case '4': return 4;
- case '5': return 5;
- case '6': return 6;
- case '7': return 7;
- case '8': return 8;
- case '9': return 9;
- default: return -1000;
- }
- }
-
- inline bool is_number(int n)
- {
- switch (n) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- return true;
-
- default:
- return false;
- }
- }
-
-
- // implementation of class Composition
- template <typename T>
- inline Composition &Composition::arg(const T &obj)
- {
- os << obj;
-
- std::string rep = os.str();
-
- if (!rep.empty()) { // manipulators don't produce output
- for (specification_map::const_iterator i = specs.lower_bound(arg_no),
- end = specs.upper_bound(arg_no); i != end; ++i) {
- output_list::iterator pos = i->second;
- ++pos;
-
- output.insert(pos, rep);
- }
-
- os.str(std::string());
- //os.clear();
- ++arg_no;
- }
-
- return *this;
- }
-
- inline Composition::Composition(std::string fmt)
- : arg_no(1)
- {
- std::string::size_type b = 0, i = 0;
-
- // fill in output with the strings between the %1 %2 %3 etc. and
- // fill in specs with the positions
- while (i < fmt.length()) {
- if (fmt[i] == '%' && i + 1 < fmt.length()) {
- if (fmt[i + 1] == '%') { // catch %%
- fmt.replace(i, 2, "%");
- ++i;
- }
- else if (is_number(fmt[i + 1])) { // aha! a spec!
- // save string
- output.push_back(fmt.substr(b, i - b));
-
- int n = 1; // number of digits
- int spec_no = 0;
-
- do {
- spec_no += char_to_int(fmt[i + n]);
- spec_no *= 10;
- ++n;
- } while (i + n < fmt.length() && is_number(fmt[i + n]));
-
- spec_no /= 10;
- output_list::iterator pos = output.end();
- --pos; // safe since we have just inserted a string>
-
- specs.insert(specification_map::value_type(spec_no, pos));
-
- // jump over spec string
- i += n;
- b = i;
- }
- else
- ++i;
- }
- else
- ++i;
- }
-
- if (i - b > 0) // add the rest of the string
- output.push_back(fmt.substr(b, i - b));
- }
-
- inline std::string Composition::str() const
- {
- // assemble string
- std::string str;
-
- for (output_list::const_iterator i = output.begin(), end = output.end();
- i != end; ++i)
- str += *i;
-
- return str;
- }
-}
-
-// now for the real thing(s)
-//namespace PBD
-//{
- // a series of functions which accept a format string on the form "text %1
- // more %2 less %3" and a number of templated parameters and spits out the
- // composited string
- template <typename T1>
- inline std::string string_compose(const std::string &fmt, const T1 &o1)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1);
- return c.str();
- }
-
- template <typename T1, typename T2>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12,
- const T13 &o13)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12).arg(o13);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12,
- const T13 &o13, const T14 &o14)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14,
- typename T15>
- inline std::string string_compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12,
- const T13 &o13, const T14 &o14, const T15 &o15)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14).arg(o15);
- return c.str();
- }
-//}
-
-
-#endif // STRING_COMPOSE_H
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
deleted file mode 100644
index dbb23fdff4..0000000000
--- a/libs/pbd/pbd/controllable.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_controllable_h__
-#define __pbd_controllable_h__
-
-#include <string>
-#include <set>
-
-#include <sigc++/trackable.h>
-#include <sigc++/signal.h>
-
-#include <pbd/statefuldestructible.h>
-
-class XMLNode;
-
-namespace PBD {
-
-class Controllable : public PBD::StatefulDestructible {
- public:
- Controllable (std::string name);
- virtual ~Controllable() { Destroyed (this); }
-
- virtual void set_value (float) = 0;
- virtual float get_value (void) const = 0;
-
- virtual bool can_send_feedback() const { return true; }
-
- sigc::signal<void> LearningFinished;
- static sigc::signal<void,PBD::Controllable*,int,int> CreateBinding;
- static sigc::signal<void,PBD::Controllable*> DeleteBinding;
-
- static sigc::signal<bool,PBD::Controllable*> StartLearning;
- static sigc::signal<void,PBD::Controllable*> StopLearning;
-
- static sigc::signal<void,Controllable*> Destroyed;
-
- sigc::signal<void> Changed;
-
- int set_state (const XMLNode&);
- XMLNode& get_state ();
-
- std::string name() const { return _name; }
-
- static Controllable* by_id (const PBD::ID&);
- static Controllable* by_name (const std::string&);
-
- private:
- std::string _name;
-
- void add ();
- void remove ();
-
- typedef std::set<PBD::Controllable*> Controllables;
- static Glib::Mutex* registry_lock;
- static Controllables registry;
-};
-
-/* a utility class for the occasions when you need but do not have
- a Controllable
-*/
-
-class IgnorableControllable : public Controllable
-{
- public:
- IgnorableControllable () : PBD::Controllable ("ignoreMe") {}
- ~IgnorableControllable () {}
-
- void set_value (float v){}
- float get_value () const { return 0.0; }
- bool can_send_feedback () const { return false; }
-};
-
-}
-
-#endif /* __pbd_controllable_h__ */
diff --git a/libs/pbd/pbd/convert.h b/libs/pbd/pbd/convert.h
deleted file mode 100644
index 83cd285098..0000000000
--- a/libs/pbd/pbd/convert.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright (C) 2002 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_convert_h__
-#define __pbd_convert_h__
-
-#include <string>
-#include <vector>
-#include <sstream>
-#include <iostream>
-#include <glibmm/ustring.h>
-
-namespace PBD {
-
-std::string short_version (std::string, std::string::size_type target_length);
-
-int atoi (const std::string&);
-double atof (const std::string&);
-void url_decode (std::string&);
-void url_decode (Glib::ustring&);
-
-// std::string length2string (const int32_t frames, const float sample_rate);
-std::string length2string (const int64_t frames, const double sample_rate);
-
-std::vector<std::string> internationalize (const char *, const char **);
-bool strings_equal_ignore_case (const std::string& a, const std::string& b);
-
-template <class T> std::string
-to_string (T t, std::ios_base & (*f)(std::ios_base&))
-{
- std::ostringstream oss;
- oss << f << t;
- return oss.str();
-}
-
-} //namespace PBD
-
-#endif /* __pbd_convert_h__ */
diff --git a/libs/pbd/pbd/crossthread.h b/libs/pbd/pbd/crossthread.h
deleted file mode 100644
index b815cfd319..0000000000
--- a/libs/pbd/pbd/crossthread.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd__crossthread_h__
-#define __pbd__crossthread_h__
-
-#include <pbd/abstract_ui.h>
-#include <sigc++/sigc++.h>
-#include <pthread.h>
-
-template<class RequestType>
-void
-call_slot_from_thread_or_dispatch_it (pthread_t thread_id, AbstractUI<RequestType>& ui, sigc::slot<void> theSlot)
-{
- /* when called, this function will determine whether the calling thread
- is the same as thread specified by the first argument. if it is,
- the we execute the slot. if not, we ask the interface given by the second
- argument to call the slot.
- */
-
- if (pthread_self() == thread_id) {
- theSlot ();
- } else {
- ui.call_slot (theSlot);
- }
-}
-
-template<class RequestType>
-sigc::slot<void>
-crossthread_safe (pthread_t thread_id, AbstractUI<RequestType>& ui, sigc::slot<void> theSlot)
-{
- /* this function returns a slot that will ensure that theSlot is either
- called by the specified thread or passed to the interface via
- AbstractUI::call_slot().
- */
-
- return sigc::bind (sigc::ptr_fun (call_slot_from_thread_or_dispatch_it<RequestType>),
- thread_id, ui, theSlot);
-}
-
-#endif /* __pbd__crossthread_h__ */
diff --git a/libs/pbd/pbd/destructible.h b/libs/pbd/pbd/destructible.h
deleted file mode 100644
index 827feb8fe5..0000000000
--- a/libs/pbd/pbd/destructible.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_destructible_h__
-#define __pbd_destructible_h__
-
-#include <sigc++/signal.h>
-
-namespace PBD {
-
-/* be very very careful using this class. it does not inherit from sigc::trackable and thus
- should only be used in multiple-inheritance situations involving another type
- that does inherit from sigc::trackable (or sigc::trackable itself)
-*/
-
-class ThingWithGoingAway {
- public:
- virtual ~ThingWithGoingAway () {}
- sigc::signal<void> GoingAway;
-};
-
-class Destructible : public sigc::trackable, public ThingWithGoingAway {
- public:
- virtual ~Destructible () {}
- void drop_references () const { GoingAway(); }
-
-};
-
-}
-
-#endif /* __pbd_destructible_h__ */
diff --git a/libs/pbd/pbd/enumwriter.h b/libs/pbd/pbd/enumwriter.h
deleted file mode 100644
index f53388f3cc..0000000000
--- a/libs/pbd/pbd/enumwriter.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- Copyright (C) 2006 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id$
-*/
-
-#include <map>
-#include <string>
-#include <vector>
-#include <exception>
-
-
-namespace PBD {
-
-class unknown_enumeration : public std::exception {
- public:
- virtual const char *what() const throw() { return "unknown enumerator in PBD::EnumWriter"; }
-};
-
-class EnumWriter {
- public:
- EnumWriter ();
- ~EnumWriter ();
-
- static EnumWriter& instance() { return *_instance; }
-
- void register_distinct (std::string type, std::vector<int>, std::vector<std::string>);
- void register_bits (std::string type, std::vector<int>, std::vector<std::string>);
-
- std::string write (std::string type, int value);
- int read (std::string type, std::string value);
-
- void add_to_hack_table (std::string str, std::string hacked_str);
-
- private:
- struct EnumRegistration {
- std::vector<int> values;
- std::vector<std::string> names;
- bool bitwise;
-
- EnumRegistration() {}
- EnumRegistration (std::vector<int>& v, std::vector<std::string>& s, bool b)
- : values (v), names (s), bitwise (b) {}
- };
-
- typedef std::map<std::string, EnumRegistration> Registry;
- Registry registry;
-
- std::string write_bits (EnumRegistration&, int value);
- std::string write_distinct (EnumRegistration&, int value);
-
- int read_bits (EnumRegistration&, std::string value);
- int read_distinct (EnumRegistration&, std::string value);
-
- static EnumWriter* _instance;
- static std::map<std::string,std::string> hack_table;
-};
-
-}
-
-#define enum_2_string(e) (PBD::EnumWriter::instance().write (typeid(e).name(), e))
-#define string_2_enum(str,e) (PBD::EnumWriter::instance().read (typeid(e).name(), (str)))
-
diff --git a/libs/pbd/pbd/error.h b/libs/pbd/pbd/error.h
deleted file mode 100644
index 58842d68eb..0000000000
--- a/libs/pbd/pbd/error.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Copyright (C) 1998-2006 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-#ifndef __libpbd_error_h__
-#define __libpbd_error_h__
-
-#include "transmitter.h"
-
-namespace PBD {
- extern Transmitter error;
- extern Transmitter info;
- extern Transmitter warning;
- extern Transmitter fatal;
-}
-
-#endif // __libpbd_error_h__
diff --git a/libs/pbd/pbd/failed_constructor.h b/libs/pbd/pbd/failed_constructor.h
deleted file mode 100644
index b13964e355..0000000000
--- a/libs/pbd/pbd/failed_constructor.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_failed_constructor_h__
-#define __pbd_failed_constructor_h__
-
-#include <exception>
-
-class failed_constructor : public std::exception {
- public:
- virtual const char *what() const throw() { return "failed constructor"; }
-};
-
-#endif /* __pbd_failed_constructor_h__ */
diff --git a/libs/pbd/pbd/fastlog.h b/libs/pbd/pbd/fastlog.h
deleted file mode 100644
index 4269705a44..0000000000
--- a/libs/pbd/pbd/fastlog.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright unknown. Code by Laurent de Soras <laurent@ohmforce.com>.
- */
-
-#ifndef __pbd_fastlog_h__
-#define __pbd_fastlog_h__
-
-#include <math.h> /* for HUGE_VAL */
-
-static inline float fast_log2 (float val)
-{
- /* don't use reinterpret_cast<> because that prevents this
- from being used by pure C code (for example, GnomeCanvasItems)
- */
- union {float f; int i;} t;
- t.f = val;
- int * const exp_ptr = &t.i;
- int x = *exp_ptr;
- const int log_2 = ((x >> 23) & 255) - 128;
- x &= ~(255 << 23);
- x += 127 << 23;
- *exp_ptr = x;
-
- val = ((-1.0f/3) * t.f + 2) * t.f - 2.0f/3;
-
- return (val + log_2);
-}
-
-static inline float fast_log (const float val)
-{
- return (fast_log2 (val) * 0.69314718f);
-}
-
-static inline float fast_log10 (const float val)
-{
- return fast_log2(val) / 3.312500f;
-}
-
-static inline float minus_infinity() { return -HUGE_VAL; }
-
-#endif /* __pbd_fastlog_h__ */
diff --git a/libs/pbd/pbd/file_utils.h b/libs/pbd/pbd/file_utils.h
deleted file mode 100644
index a9832ce720..0000000000
--- a/libs/pbd/pbd/file_utils.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- Copyright (C) 2007 Tim Mayberry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef PBD_FILE_UTILS_INCLUDED
-#define PBD_FILE_UTILS_INCLUDED
-
-#include <string>
-#include <vector>
-
-#include <glibmm/pattern.h>
-
-#include <pbd/search_path.h>
-
-namespace PBD {
-
-using std::string;
-using std::vector;
-
-/**
- * Get a list of files in a directory.
- * @note You must join path with result to get the absolute path
- * to the file.
- *
- * @param path An Absolute path to a directory
- * @param result A vector of filenames.
- */
-void
-get_files_in_directory (const sys::path& path,
- vector<string>& result);
-
-/**
- * Takes a directory path and returns all the files in the directory
- * matching a particular pattern.
- *
- * @param directory A directory path
- * @param pattern A Glib::PatternSpec used to match the files.
- * @param result A vector in which to place the resulting matches.
- */
-void
-find_matching_files_in_directory (const sys::path& directory,
- const Glib::PatternSpec& pattern,
- vector<sys::path>& result);
-
-/**
- * Takes a number of directory paths and returns all the files matching
- * a particular pattern.
- *
- * @param paths A vector containing the Absolute paths
- * @param pattern A Glib::PatternSpec used to match the files
- * @param result A vector in which to place the resulting matches.
- */
-void
-find_matching_files_in_directories (const vector<sys::path>& directory_paths,
- const Glib::PatternSpec& pattern,
- vector<sys::path>& result);
-
-/**
- * Takes a SearchPath and puts a list of all the files in the search path
- * that match pattern into the result vector.
- *
- * @param search_path A SearchPath
- * @param pattern A Glib::PatternSpec used to match the files
- * @param result A vector in which to place the resulting matches.
- */
-void
-find_matching_files_in_search_path (const SearchPath& search_path,
- const Glib::PatternSpec& pattern,
- vector<sys::path>& result);
-
-/**
- * Takes a search path and a file name and place the full path
- * to that file in result if it is found within the search path.
- *
- * @return true If file is found within the search path.
- */
-bool
-find_file_in_search_path (const SearchPath& search_path,
- const string& filename,
- sys::path& result);
-
-} // namespace PBD
-
-#endif
diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h
deleted file mode 100644
index 2d21a3fafc..0000000000
--- a/libs/pbd/pbd/filesystem.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- Copyright (C) 2007 Tim Mayberry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-/**
- * @namespace PBD::sys
- *
- * The API in this file is intended to be as close as possible to the
- * boost::filesystem API but implementing only the subset of it that is required
- * by ardour using the glib/glibmm file utility functions in the implementation.
- *
- * More information about boost::filesystem and the TR2 proposal at
- *
- * http://www.boost.org/libs/filesystem/doc/tr2_proposal.html
- *
- * Hopefully the boost::filesystem API will pass TR2 review etc and become part
- * of the C++ standard and this code can be removed, or we just end up using
- * the boost filesystem library when it matures a bit more.
- *
- * My reasons for writing this thin wrapper instead of using glib directly or
- * using boost::filesystem immediately are:
- *
- * - Using sys::path instead of strings and Glib::build_filename is more
- * convenient, terse and forces correct platform agnostic path building.
- *
- * - Using boost::filesystem on windows would mean converting between any UTF-8
- * encoded strings(such as when selecting a file/directory in the gtk file
- * chooser) and the native file encoding (UTF-16). It would take some time
- * and testing to find out when this is required and the glib functions already
- * do this if necessary.
- *
- * - Using exceptions to indicate errors is more likely to uncover situations
- * where error conditions are being silently ignored(I've already encounted
- * a few examples of this in the ardour code).
- *
- * - Many of the glib file utility functions are not wrapped by glibmm so this
- * also provides what I think is a better API.
- *
- * - Using boost::filesystem directly means another library dependence and would
- * require more testing on windows because of the character encoding issue.
- *
- * - The boost::filesystem API changes a bit as part of the TR2 review process etc.
- */
-
-#ifndef __filesystem_h__
-#define __filesystem_h__
-
-#include <stdexcept>
-#include <string>
-
-namespace PBD {
-
-namespace sys {
-
-using std::string;
-
-class path
-{
-public:
- path() : m_path("") { }
- path(const path & p) : m_path(p.m_path) { }
- path(const string & s) : m_path(s) { }
- path(const char* s) : m_path(s) { }
-
- path& operator=(const path& p) { m_path = p.m_path; return *this;}
- path& operator=(const string& s) { m_path = s; return *this; }
- path& operator=(const char* s) { m_path = s; return *this; }
-
- path& operator/=(const path& rhs);
- path& operator/=(const string& s);
- path& operator/=(const char* s);
-
- const string to_string() const { return m_path; }
-
- /**
- * @return the last component of the path, if the path refers to
- * a file then it will be the entire filename including any extension.
- */
- string leaf() const;
-
- /**
- * @returns the directory component of a path without any trailing
- * path separator or an empty string if the path has no directory
- * component(branch path).
- */
- path branch_path () const;
-
-private:
-
- string m_path;
-};
-
-class filesystem_error : public std::runtime_error
-{
- const int m_error_code;
-
-public:
- explicit filesystem_error(const std::string & what, int error_code=0)
- : std::runtime_error(what), m_error_code(error_code) { }
-
- int system_error() const { return m_error_code; }
-};
-
-inline path operator/ (const path& lhs, const path& rhs)
-{ return path(lhs) /= rhs; }
-
-/// @return true if path at p exists
-bool exists(const path & p);
-
-/// @return true if path at p is a directory.
-bool is_directory(const path & p);
-
-/**
- * Attempt to create a directory at p as if by the glib function g_mkdir
- * with a second argument of S_IRWXU|S_IRWXG|S_IRWXO
- *
- * @throw filesystem_error if mkdir fails for any other reason other than
- * the directory already exists.
- *
- * @return true If the directory p was created, otherwise false
- *
- * @post is_directory(p)
- */
-bool create_directory(const path & p);
-
-/**
- * Attempt to create a directory at p as if by the glib function
- * g_mkdir_with_parents with a second argument of S_IRWXU|S_IRWXG|S_IRWXO
- *
- * @throw filesystem_error if g_mkdir_with_parents fails for any other
- * reason other than the directory already exists.
- *
- * @return true If the directory at p was created, otherwise false
- *
- * @post is_directory(p)
- */
-bool create_directories(const path & p);
-
-/**
- * Attempt to delete the file at path p as if by the glib function
- * g_unlink.
- *
- * @return true if file existed prior to removing it, false if file
- * at p did not exist.
- *
- * @throw filesystem_error if removing the file failed for any other
- * reason other than the file did not exist.
- */
-bool remove(const path & p);
-
-/**
- * Renames from_path to to_path as if by the glib function g_rename.
- */
-void rename (const path& from_path, const path& to_path);
-
-/**
- * Attempt to copy the contents of the file from_path to a new file
- * at path to_path.
- *
- * @throw filesystem_error if from_path.empty() || to_path.empty() ||
- * !exists(from_path) || !is_regular(from_path) || exists(to_path)
- */
-void copy_file(const path & from_path, const path & to_path);
-
-/**
- * @return The substring of the filename component of the path, starting
- * at the beginning of the filename up to but not including the last dot.
- *
- * boost::filesystem::path::basename differs from g_path_get_basename and
- * ::basename and most other forms of basename in that it removes the
- * extension from the filename if the filename has one.
- */
-string basename (const path& p);
-
-/**
- * @return If the filename contains a dot, return a substring of the
- * filename starting the rightmost dot to the end of the string, otherwise
- * an empty string.
- *
- * @param p a file path.
- */
-string extension (const path& p);
-
-} // namespace sys
-
-} // namespace PBD
-
-#endif
diff --git a/libs/pbd/pbd/filesystem_paths.h b/libs/pbd/pbd/filesystem_paths.h
deleted file mode 100644
index 4e09c6ec4b..0000000000
--- a/libs/pbd/pbd/filesystem_paths.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Copyright (C) 2007 Tim Mayberry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#ifndef PBD_FILESYSTEM_PATHS_INCLUDED
-#define PBD_FILESYSTEM_PATHS_INCLUDED
-
-#include <vector>
-
-#include <pbd/filesystem.h>
-
-namespace PBD {
-
- using std::vector;
-
- vector<sys::path> system_data_directories ();
-
- vector<sys::path> system_config_directories ();
-
-} // namespace PBD
-
-#endif
diff --git a/libs/pbd/pbd/forkexec.h b/libs/pbd/pbd/forkexec.h
deleted file mode 100644
index 236cffa301..0000000000
--- a/libs/pbd/pbd/forkexec.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __forkexec_h__
-#define __forkexec_h__
-
-#include <unistd.h>
-
-pid_t forkexec(char **argv, char **envp, int outpipe[2], int inpipe[2]);
-pid_t forkexec_cmd(char *cmd, char **envp, int outpipe[2], int inpipe[2]);
-
-#endif // __forkexec_h__
diff --git a/libs/pbd/pbd/fpu.h b/libs/pbd/pbd/fpu.h
deleted file mode 100644
index 617dcdf3da..0000000000
--- a/libs/pbd/pbd/fpu.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __pbd_fpu_h__
-#define __pbd_fpu_h__
-
-namespace PBD {
-
-
-class FPU {
- private:
- enum Flags {
- HasFlushToZero = 0x1,
- HasDenormalsAreZero = 0x2,
- HasSSE = 0x4,
- HasSSE2 = 0x8
- };
-
- public:
- FPU ();
- ~FPU ();
-
- bool has_flush_to_zero () const { return _flags & HasFlushToZero; }
- bool has_denormals_are_zero () const { return _flags & HasDenormalsAreZero; }
- bool has_sse () const { return _flags & HasSSE; }
- bool has_sse2 () const { return _flags & HasSSE2; }
-
- private:
- Flags _flags;
-};
-
-}
-
-#endif /* __pbd_fpu_h__ */
diff --git a/libs/pbd/pbd/functor_command.h b/libs/pbd/pbd/functor_command.h
deleted file mode 100644
index e335f4418e..0000000000
--- a/libs/pbd/pbd/functor_command.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Copyright (C) 2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __lib_pbd_functor_command_h__
-#define __lib_pbd_functor_command_h__
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <map>
-
-#include <pbd/xml++.h>
-#include <pbd/shiva.h>
-#include <pbd/command.h>
-#include <pbd/failed_constructor.h>
-
-/** This command class is initialized
- */
-
-namespace PBD {
-
-template <class obj_type, class arg_type>
-class FunctorCommand : public Command
-{
- private:
- typedef void (obj_type::*functor_type)(arg_type);
- typedef std::map< std::string, functor_type > FunctorMap;
- typedef typename FunctorMap::iterator FunctorMapIterator;
-
- public:
- FunctorCommand(
- std::string functor,
- obj_type object,
- arg_type b,
- arg_type a
- ) : functor_name(functor),
- object(object),
- before(b),
- after(a)
- {
- method = find_functor(functor);
-
- /* catch destruction of the object */
- new PBD::Shiva< obj_type, FunctorCommand<obj_type, arg_type> > (object, *this);
- }
-
- ~FunctorCommand() {
- GoingAway();
- }
-
- void operator() () {
- (object.*method) (after);
- }
-
- void undo() {
- (object.*method) (before);
- }
-
- virtual XMLNode &get_state() {
- std::stringstream ss;
-
- XMLNode *node = new XMLNode("FunctorCommand");
- node->add_property("functor", functor_name);
- ss << before;
- node->add_property("before", ss.str());
- ss.clear ();
- ss << after;
- node->add_property("after", ss.str());
-
- return *node;
- }
-
- static void register_functor(std::string name, functor_type f) {
- functor_map[name] = f;
- }
-
- private:
- static functor_type find_functor(std::string name) {
- FunctorMapIterator iter;
-
- if((iter = functor_map.find(name)) == functor_map.end()) {
- throw failed_constructor();
- }
-
- return iter->second;
- }
-
- protected:
- std::string functor_name;
- obj_type &object;
- arg_type before;
- arg_type after;
- functor_type method;
- static FunctorMap functor_map;
-};
-
-// static initialization of functor_map...
-template <class obj_type, class arg_type>
-typename FunctorCommand<obj_type, arg_type>::FunctorMap
-FunctorCommand<obj_type, arg_type>::functor_map;
-
-};
-
-#endif // __lib_pbd_functor_command_h__
-
diff --git a/libs/pbd/pbd/id.h b/libs/pbd/pbd/id.h
deleted file mode 100644
index 3f87a65e0d..0000000000
--- a/libs/pbd/pbd/id.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_id_h__
-#define __pbd_id_h__
-
-#include <stdint.h>
-#include <string>
-
-#include <glibmm/thread.h>
-
-namespace PBD {
-
-class ID {
- public:
- ID ();
- ID (std::string);
-
- bool operator== (const ID& other) const {
- return _id == other._id;
- }
-
- bool operator!= (const ID& other) const {
- return _id != other._id;
- }
-
- ID& operator= (std::string);
-
- bool operator< (const ID& other) const {
- return _id < other._id;
- }
-
- void print (char* buf, uint32_t bufsize) const;
- std::string to_s() const;
-
- static uint64_t counter() { return _counter; }
- static void init_counter (uint64_t val) { _counter = val; }
- static void init ();
-
- private:
- uint64_t _id;
- int string_assign (std::string);
-
- static Glib::Mutex* counter_lock;
- static uint64_t _counter;
-};
-
-}
-std::ostream& operator<< (std::ostream& ostr, const PBD::ID&);
-
-#endif /* __pbd_id_h__ */
diff --git a/libs/pbd/pbd/mathfix.h b/libs/pbd/pbd/mathfix.h
deleted file mode 100644
index fd0468905f..0000000000
--- a/libs/pbd/pbd/mathfix.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2005 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_mathfix_h__
-#define __pbd_mathfix_h__
-
-/* this is necessary to support older releases of OSX where
- they moved around some of the standard math functions
-*/
-
-#ifdef __APPLE__
-#define powf pow
-#define sqrtf sqrt
-#endif
-
-
-#endif
diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h
deleted file mode 100644
index fdc7527dc6..0000000000
--- a/libs/pbd/pbd/memento_command.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Copyright (C) 2006 Paul Davis
- Author: Hans Fugal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __lib_pbd_memento_command_h__
-#define __lib_pbd_memento_command_h__
-
-#include <iostream>
-
-#include <pbd/command.h>
-#include <pbd/stacktrace.h>
-#include <pbd/xml++.h>
-#include <pbd/shiva.h>
-
-#include <sigc++/slot.h>
-#include <typeinfo>
-
-/** This command class is initialized with before and after mementos
- * (from Stateful::get_state()), so undo becomes restoring the before
- * memento, and redo is restoring the after memento.
- */
-template <class obj_T>
-class MementoCommand : public Command
-{
-public:
- MementoCommand(obj_T &object, XMLNode *before, XMLNode *after)
- : obj(object), before(before), after(after)
- {
- /* catch destruction of the object */
- new PBD::Shiva<obj_T,MementoCommand<obj_T> > (object, *this);
- }
-
- ~MementoCommand ()
- {
- GoingAway(); /* EMIT SIGNAL */
-
- if (before)
- delete before;
-
- if (after)
- delete after;
- }
-
- void operator() ()
- {
- if (after)
- obj.set_state(*after);
- }
-
- void undo()
- {
- if (before)
- obj.set_state(*before);
- }
-
- virtual XMLNode &get_state()
- {
- string name;
- if (before && after)
- name = "MementoCommand";
- else if (before)
- name = "MementoUndoCommand";
- else
- name = "MementoRedoCommand";
-
- XMLNode *node = new XMLNode(name);
-
- node->add_property("obj_id", obj.id().to_s());
- node->add_property("type_name", typeid(obj).name());
-
- if (before)
- node->add_child_copy(*before);
-
- if (after)
- node->add_child_copy(*after);
-
- return *node;
- }
-
-protected:
- obj_T &obj;
- XMLNode *before, *after;
-};
-
-#endif // __lib_pbd_memento_h__
diff --git a/libs/pbd/pbd/mountpoint.h b/libs/pbd/pbd/mountpoint.h
deleted file mode 100644
index e0ec1be7f9..0000000000
--- a/libs/pbd/pbd/mountpoint.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_mountpoint_h__
-#define __pbd_mountpoint_h__
-
-#include <string>
-
-std::string mountpoint (std::string path);
-
-#endif // __pbd_mountpoint_h__
diff --git a/libs/pbd/pbd/pathscanner.h b/libs/pbd/pbd/pathscanner.h
deleted file mode 100644
index 0a48d4d949..0000000000
--- a/libs/pbd/pbd/pathscanner.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __libmisc_pathscanner_h__
-#define __libmisc_pathscanner_h__
-
-#include <vector>
-#include <string>
-#include <regex.h>
-
-using std::string;
-using std::vector;
-
-class PathScanner
-
-{
- public:
- vector<string *> *operator() (const string &dirpath,
- bool (*filter)(const string &, void *arg),
- void *arg,
- bool match_fullpath = true,
- bool return_fullpath = true,
- long limit = -1) {
- return run_scan (dirpath,
- (bool (PathScanner::*)(const string &)) 0,
- filter,
- arg,
- match_fullpath,
- return_fullpath,
- limit);
- }
-
- vector<string *> *operator() (const string &dirpath,
- const string &regexp,
- bool match_fullpath = true,
- bool return_fullpath = true,
- long limit = -1);
-
-
- string *find_first (const string &dirpath,
- const string &regexp,
- bool match_fullpath = true,
- bool return_fullpath = true);
-
- string *find_first (const string &dirpath,
- bool (*filter)(const string &, void *),
- void *arg,
- bool match_fullpath = true,
- bool return_fullpath = true);
-
- private:
- regex_t compiled_pattern;
-
- bool regexp_filter (const string &str) {
- return regexec (&compiled_pattern, str.c_str(), 0, 0, 0) == 0;
- }
-
- vector<string *> *run_scan (const string &dirpath,
- bool (PathScanner::*mfilter) (const string &),
- bool (*filter)(const string &, void *),
- void *arg,
- bool match_fullpath,
- bool return_fullpath,
- long limit);
-
-
-};
-
-#endif // __libmisc_pathscanner_h__
diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h
deleted file mode 100644
index d604680ae2..0000000000
--- a/libs/pbd/pbd/pool.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __qm_pool_h__
-#define __qm_pool_h__
-
-#include <vector>
-#include <string>
-
-#include <glibmm/thread.h>
-
-#include <pbd/ringbuffer.h>
-
-class Pool
-{
- public:
- Pool (std::string name, unsigned long item_size, unsigned long nitems);
- virtual ~Pool ();
-
- virtual void *alloc ();
- virtual void release (void *);
-
- std::string name() const { return _name; }
-
- private:
- RingBuffer<void*>* free_list;
- std::string _name;
- void *block;
-};
-
-class SingleAllocMultiReleasePool : public Pool
-{
- public:
- SingleAllocMultiReleasePool (std::string name, unsigned long item_size, unsigned long nitems);
- ~SingleAllocMultiReleasePool ();
-
- virtual void *alloc ();
- virtual void release (void *);
-
- private:
- Glib::Mutex* m_lock;
-};
-
-
-class MultiAllocSingleReleasePool : public Pool
-{
- public:
- MultiAllocSingleReleasePool (std::string name, unsigned long item_size, unsigned long nitems);
- ~MultiAllocSingleReleasePool ();
-
- virtual void *alloc ();
- virtual void release (void *);
-
- private:
- Glib::Mutex* m_lock;
-};
-
-#endif // __qm_pool_h__
diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h
deleted file mode 100644
index 9fa6ba4ce4..0000000000
--- a/libs/pbd/pbd/pthread_utils.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_pthread_utils__
-#define __pbd_pthread_utils__
-
-#include <pthread.h>
-#include <signal.h>
-#include <string>
-#include <stdint.h>
-
-#include <sigc++/sigc++.h>
-
-int pthread_create_and_store (std::string name, pthread_t *thread, pthread_attr_t *attr, void * (*start_routine)(void *), void * arg);
-void pthread_cancel_one (pthread_t thread);
-void pthread_kill_all (int signum);
-void pthread_cancel_all ();
-void pthread_exit_pbd (void* status);
-std::string pthread_name ();
-
-namespace PBD {
- extern sigc::signal<void,pthread_t,std::string> ThreadCreated;
- extern sigc::signal<void,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize;
-}
-
-#endif /* __pbd_pthread_utils__ */
diff --git a/libs/pbd/pbd/rcu.h b/libs/pbd/pbd/rcu.h
deleted file mode 100644
index 8b8f693e7e..0000000000
--- a/libs/pbd/pbd/rcu.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_rcu_h__
-#define __pbd_rcu_h__
-
-#include "boost/shared_ptr.hpp"
-#include "glibmm/thread.h"
-
-#include <list>
-
-template<class T>
-class RCUManager
-{
- public:
-
- RCUManager (T* new_rcu_value) {
- x.m_rcu_value = new boost::shared_ptr<T> (new_rcu_value);
- }
-
- virtual ~RCUManager() { delete x.m_rcu_value; }
-
- boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (&x.gptr)); }
-
- virtual boost::shared_ptr<T> write_copy () = 0;
- virtual bool update (boost::shared_ptr<T> new_value) = 0;
-
- protected:
- union {
- boost::shared_ptr<T>* m_rcu_value;
- mutable volatile gpointer gptr;
- } x;
-};
-
-
-template<class T>
-class SerializedRCUManager : public RCUManager<T>
-{
-public:
-
- SerializedRCUManager(T* new_rcu_value)
- : RCUManager<T>(new_rcu_value)
- {
-
- }
-
- boost::shared_ptr<T> write_copy ()
- {
- m_lock.lock();
-
- // clean out any dead wood
-
- typename std::list<boost::shared_ptr<T> >::iterator i;
-
- for (i = m_dead_wood.begin(); i != m_dead_wood.end(); ) {
- if ((*i).use_count() == 1) {
- i = m_dead_wood.erase (i);
- } else {
- ++i;
- }
- }
-
- // store the current
-
- current_write_old = RCUManager<T>::x.m_rcu_value;
-
- boost::shared_ptr<T> new_copy (new T(**current_write_old));
-
- return new_copy;
- }
-
- bool update (boost::shared_ptr<T> new_value)
- {
- // we hold the lock at this point effectively blocking
- // other writers.
-
- boost::shared_ptr<T>* new_spp = new boost::shared_ptr<T> (new_value);
-
- // update, checking that nobody beat us to it
-
- bool ret = g_atomic_pointer_compare_and_exchange (&RCUManager<T>::x.gptr,
- (gpointer) current_write_old,
- (gpointer) new_spp);
-
- if (ret) {
-
- // successful update : put the old value into dead_wood,
-
- m_dead_wood.push_back (*current_write_old);
-
- // now delete it - this gets rid of the shared_ptr<T> but
- // because dead_wood contains another shared_ptr<T> that
- // references the same T, the underlying object lives on
-
- delete current_write_old;
- }
-
- m_lock.unlock();
-
- return ret;
- }
-
- void flush () {
- Glib::Mutex::Lock lm (m_lock);
- m_dead_wood.clear ();
- }
-
-private:
- Glib::Mutex m_lock;
- boost::shared_ptr<T>* current_write_old;
- std::list<boost::shared_ptr<T> > m_dead_wood;
-};
-
-template<class T>
-class RCUWriter
-{
-public:
-
- RCUWriter(RCUManager<T>& manager)
- : m_manager(manager)
- {
- m_copy = m_manager.write_copy();
- }
-
- ~RCUWriter()
- {
- // we can check here that the refcount of m_copy is 1
-
- if(m_copy.use_count() == 1) {
- m_manager.update(m_copy);
- } else {
-
- // critical error.
- }
-
- }
-
- // or operator boost::shared_ptr<T> ();
- boost::shared_ptr<T> get_copy() { return m_copy; }
-
-private:
-
- RCUManager<T>& m_manager;
-
- // preferably this holds a pointer to T
- boost::shared_ptr<T> m_copy;
-};
-
-#endif /* __pbd_rcu_h__ */
diff --git a/libs/pbd/pbd/receiver.h b/libs/pbd/pbd/receiver.h
deleted file mode 100644
index 93192ce787..0000000000
--- a/libs/pbd/pbd/receiver.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __libmisc_receiver_h__
-#define __libmisc_receiver_h__
-
-#include <vector>
-
-#include <sigc++/sigc++.h>
-
-#include "transmitter.h"
-
-using std::vector;
-
-class strstream;
-
-class Receiver : virtual public sigc::trackable
-{
- public:
- Receiver ();
- virtual ~Receiver ();
-
- void listen_to (Transmitter &);
- void hangup ();
-
- protected:
- virtual void receive (Transmitter::Channel, const char *) = 0;
-
- private:
- vector<sigc::connection *> connections;
-};
-
-#endif // __libmisc_receiver_h__
diff --git a/libs/pbd/pbd/replace_all.h b/libs/pbd/pbd/replace_all.h
deleted file mode 100644
index 3bc465d89f..0000000000
--- a/libs/pbd/pbd/replace_all.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_replace_all_h__
-#define __pbd_replace_all_h__
-
-#include <string>
-
-int replace_all (std::string& str, const std::string& target, const std::string& replacement);
-
-#endif // __pbd_replace_all_h__
diff --git a/libs/pbd/pbd/ringbuffer.h b/libs/pbd/pbd/ringbuffer.h
deleted file mode 100644
index 3502bed21b..0000000000
--- a/libs/pbd/pbd/ringbuffer.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis & Benno Senoner
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef ringbuffer_h
-#define ringbuffer_h
-
-#include <cstring>
-#include <glib.h>
-
-template<class T>
-class RingBuffer
-{
- public:
- RingBuffer (guint sz) {
-// size = ffs(sz); /* find first [bit] set is a single inlined assembly instruction. But it looks like the API rounds up so... */
- guint power_of_two;
- for (power_of_two = 1; 1U<<power_of_two < sz; power_of_two++);
- size = 1<<power_of_two;
- size_mask = size;
- size_mask -= 1;
- buf = new T[size];
- reset ();
-
- };
-
- virtual ~RingBuffer() {
- delete [] buf;
- }
-
- void reset () {
- /* !!! NOT THREAD SAFE !!! */
- g_atomic_int_set (&write_idx, 0);
- g_atomic_int_set (&read_idx, 0);
- }
-
- void set (guint r, guint w) {
- /* !!! NOT THREAD SAFE !!! */
- g_atomic_int_set (&write_idx, w);
- g_atomic_int_set (&read_idx, r);
- }
-
- guint read (T *dest, guint cnt);
- guint write (T *src, guint cnt);
-
- struct rw_vector {
- T *buf[2];
- guint len[2];
- };
-
- void get_read_vector (rw_vector *);
- void get_write_vector (rw_vector *);
-
- void decrement_read_idx (guint cnt) {
- g_atomic_int_set (&read_idx, (g_atomic_int_get(&read_idx) - cnt) & size_mask);
- }
-
- void increment_read_idx (guint cnt) {
- g_atomic_int_set (&read_idx, (g_atomic_int_get(&read_idx) + cnt) & size_mask);
- }
-
- void increment_write_idx (guint cnt) {
- g_atomic_int_set (&write_idx, (g_atomic_int_get(&write_idx) + cnt) & size_mask);
- }
-
- guint write_space () {
- guint w, r;
-
- w = g_atomic_int_get (&write_idx);
- r = g_atomic_int_get (&read_idx);
-
- if (w > r) {
- return ((r - w + size) & size_mask) - 1;
- } else if (w < r) {
- return (r - w) - 1;
- } else {
- return size - 1;
- }
- }
-
- guint read_space () {
- guint w, r;
-
- w = g_atomic_int_get (&write_idx);
- r = g_atomic_int_get (&read_idx);
-
- if (w > r) {
- return w - r;
- } else {
- return (w - r + size) & size_mask;
- }
- }
-
- T *buffer () { return buf; }
- guint get_write_idx () const { return g_atomic_int_get (&write_idx); }
- guint get_read_idx () const { return g_atomic_int_get (&read_idx); }
- guint bufsize () const { return size; }
-
- protected:
- T *buf;
- guint size;
- mutable gint write_idx;
- mutable gint read_idx;
- guint size_mask;
-};
-
-template<class T> guint
-RingBuffer<T>::read (T *dest, guint cnt)
-{
- guint free_cnt;
- guint cnt2;
- guint to_read;
- guint n1, n2;
- guint priv_read_idx;
-
- priv_read_idx=g_atomic_int_get(&read_idx);
-
- if ((free_cnt = read_space ()) == 0) {
- return 0;
- }
-
- to_read = cnt > free_cnt ? free_cnt : cnt;
-
- cnt2 = priv_read_idx + to_read;
-
- if (cnt2 > size) {
- n1 = size - priv_read_idx;
- n2 = cnt2 & size_mask;
- } else {
- n1 = to_read;
- n2 = 0;
- }
-
- memcpy (dest, &buf[priv_read_idx], n1 * sizeof (T));
- priv_read_idx = (priv_read_idx + n1) & size_mask;
-
- if (n2) {
- memcpy (dest+n1, buf, n2 * sizeof (T));
- priv_read_idx = n2;
- }
-
- g_atomic_int_set(&read_idx, priv_read_idx);
- return to_read;
-}
-
-template<class T> guint
-RingBuffer<T>::write (T *src, guint cnt)
-
-{
- guint free_cnt;
- guint cnt2;
- guint to_write;
- guint n1, n2;
- guint priv_write_idx;
-
- priv_write_idx=g_atomic_int_get(&write_idx);
-
- if ((free_cnt = write_space ()) == 0) {
- return 0;
- }
-
- to_write = cnt > free_cnt ? free_cnt : cnt;
-
- cnt2 = priv_write_idx + to_write;
-
- if (cnt2 > size) {
- n1 = size - priv_write_idx;
- n2 = cnt2 & size_mask;
- } else {
- n1 = to_write;
- n2 = 0;
- }
-
- memcpy (&buf[priv_write_idx], src, n1 * sizeof (T));
- priv_write_idx = (priv_write_idx + n1) & size_mask;
-
- if (n2) {
- memcpy (buf, src+n1, n2 * sizeof (T));
- priv_write_idx = n2;
- }
-
- g_atomic_int_set(&write_idx, priv_write_idx);
- return to_write;
-}
-
-template<class T> void
-RingBuffer<T>::get_read_vector (RingBuffer<T>::rw_vector *vec)
-
-{
- guint free_cnt;
- guint cnt2;
- guint w, r;
-
- w = g_atomic_int_get (&write_idx);
- r = g_atomic_int_get (&read_idx);
-
- if (w > r) {
- free_cnt = w - r;
- } else {
- free_cnt = (w - r + size) & size_mask;
- }
-
- cnt2 = r + free_cnt;
-
- if (cnt2 > size) {
- /* Two part vector: the rest of the buffer after the
- current write ptr, plus some from the start of
- the buffer.
- */
-
- vec->buf[0] = &buf[r];
- vec->len[0] = size - r;
- vec->buf[1] = buf;
- vec->len[1] = cnt2 & size_mask;
-
- } else {
-
- /* Single part vector: just the rest of the buffer */
-
- vec->buf[0] = &buf[r];
- vec->len[0] = free_cnt;
- vec->len[1] = 0;
- }
-}
-
-template<class T> void
-RingBuffer<T>::get_write_vector (RingBuffer<T>::rw_vector *vec)
-
-{
- guint free_cnt;
- guint cnt2;
- guint w, r;
-
- w = g_atomic_int_get (&write_idx);
- r = g_atomic_int_get (&read_idx);
-
- if (w > r) {
- free_cnt = ((r - w + size) & size_mask) - 1;
- } else if (w < r) {
- free_cnt = (r - w) - 1;
- } else {
- free_cnt = size - 1;
- }
-
- cnt2 = w + free_cnt;
-
- if (cnt2 > size) {
-
- /* Two part vector: the rest of the buffer after the
- current write ptr, plus some from the start of
- the buffer.
- */
-
- vec->buf[0] = &buf[w];
- vec->len[0] = size - w;
- vec->buf[1] = buf;
- vec->len[1] = cnt2 & size_mask;
- } else {
- vec->buf[0] = &buf[w];
- vec->len[0] = free_cnt;
- vec->len[1] = 0;
- }
-}
-
-
-#endif /* __ringbuffer_h__ */
diff --git a/libs/pbd/pbd/ringbufferNPT.h b/libs/pbd/pbd/ringbufferNPT.h
deleted file mode 100644
index 9db09098d6..0000000000
--- a/libs/pbd/pbd/ringbufferNPT.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis & Benno Senoner
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef ringbuffer_npt_h
-#define ringbuffer_npt_h
-
-//#include <sys/mman.h>
-
-#include <glib.h>
-
-/* ringbuffer class where the element size is not required to be a power of two */
-
-template<class T>
-class RingBufferNPT
-{
- public:
- RingBufferNPT (size_t sz) {
- size = sz;
- buf = new T[size];
- reset ();
-
- };
-
- virtual ~RingBufferNPT() {
- delete [] buf;
- }
-
- void reset () {
- /* !!! NOT THREAD SAFE !!! */
- g_atomic_int_set (&write_ptr, 0);
- g_atomic_int_set (&read_ptr, 0);
- }
-
- void set (size_t r, size_t w) {
- /* !!! NOT THREAD SAFE !!! */
- g_atomic_int_set (&write_ptr, w);
- g_atomic_int_set (&read_ptr, r);
- }
-
- size_t read (T *dest, size_t cnt);
- size_t write (T *src, size_t cnt);
-
- struct rw_vector {
- T *buf[2];
- size_t len[2];
- };
-
- void get_read_vector (rw_vector *);
- void get_write_vector (rw_vector *);
-
- void decrement_read_ptr (size_t cnt) {
- g_atomic_int_set (&read_ptr, (g_atomic_int_get(&read_ptr) - cnt) % size);
- }
-
- void increment_read_ptr (size_t cnt) {
- g_atomic_int_set (&read_ptr, (g_atomic_int_get(&read_ptr) + cnt) % size);
- }
-
- void increment_write_ptr (size_t cnt) {
- g_atomic_int_set (&write_ptr, (g_atomic_int_get(&write_ptr) + cnt) % size);
- }
-
- size_t write_space () {
- size_t w, r;
-
- w = g_atomic_int_get (&write_ptr);
- r = g_atomic_int_get (&read_ptr);
-
- if (w > r) {
- return ((r - w + size) % size) - 1;
- } else if (w < r) {
- return (r - w) - 1;
- } else {
- return size - 1;
- }
- }
-
- size_t read_space () {
- size_t w, r;
-
- w = g_atomic_int_get (&write_ptr);
- r = g_atomic_int_get (&read_ptr);
-
- if (w > r) {
- return w - r;
- } else {
- return (w - r + size) % size;
- }
- }
-
- T *buffer () { return buf; }
- size_t get_write_ptr () const { return g_atomic_int_get (&write_ptr); }
- size_t get_read_ptr () const { return g_atomic_int_get (&read_ptr); }
- size_t bufsize () const { return size; }
-
- protected:
- T *buf;
- size_t size;
- mutable gint write_ptr;
- mutable gint read_ptr;
-};
-
-template<class T> size_t
-RingBufferNPT<T>::read (T *dest, size_t cnt)
-{
- size_t free_cnt;
- size_t cnt2;
- size_t to_read;
- size_t n1, n2;
- size_t priv_read_ptr;
-
- priv_read_ptr=g_atomic_int_get(&read_ptr);
-
- if ((free_cnt = read_space ()) == 0) {
- return 0;
- }
-
- to_read = cnt > free_cnt ? free_cnt : cnt;
-
- cnt2 = priv_read_ptr + to_read;
-
- if (cnt2 > size) {
- n1 = size - priv_read_ptr;
- n2 = cnt2 % size;
- } else {
- n1 = to_read;
- n2 = 0;
- }
-
- memcpy (dest, &buf[priv_read_ptr], n1 * sizeof (T));
- priv_read_ptr = (priv_read_ptr + n1) % size;
-
- if (n2) {
- memcpy (dest+n1, buf, n2 * sizeof (T));
- priv_read_ptr = n2;
- }
-
- g_atomic_int_set(&read_ptr, priv_read_ptr);
- return to_read;
-}
-
-template<class T> size_t
-RingBufferNPT<T>::write (T *src, size_t cnt)
-{
- size_t free_cnt;
- size_t cnt2;
- size_t to_write;
- size_t n1, n2;
- size_t priv_write_ptr;
-
- priv_write_ptr=g_atomic_int_get(&write_ptr);
-
- if ((free_cnt = write_space ()) == 0) {
- return 0;
- }
-
- to_write = cnt > free_cnt ? free_cnt : cnt;
-
- cnt2 = priv_write_ptr + to_write;
-
- if (cnt2 > size) {
- n1 = size - priv_write_ptr;
- n2 = cnt2 % size;
- } else {
- n1 = to_write;
- n2 = 0;
- }
-
- memcpy (&buf[priv_write_ptr], src, n1 * sizeof (T));
- priv_write_ptr = (priv_write_ptr + n1) % size;
-
- if (n2) {
- memcpy (buf, src+n1, n2 * sizeof (T));
- priv_write_ptr = n2;
- }
-
- g_atomic_int_set(&write_ptr, priv_write_ptr);
- return to_write;
-}
-
-template<class T> void
-RingBufferNPT<T>::get_read_vector (RingBufferNPT<T>::rw_vector *vec)
-{
- size_t free_cnt;
- size_t cnt2;
- size_t w, r;
-
- w = g_atomic_int_get (&write_ptr);
- r = g_atomic_int_get (&read_ptr);
-
- if (w > r) {
- free_cnt = w - r;
- } else {
- free_cnt = (w - r + size) % size;
- }
-
- cnt2 = r + free_cnt;
-
- if (cnt2 > size) {
- /* Two part vector: the rest of the buffer after the
- current write ptr, plus some from the start of
- the buffer.
- */
-
- vec->buf[0] = &buf[r];
- vec->len[0] = size - r;
- vec->buf[1] = buf;
- vec->len[1] = cnt2 % size;
-
- } else {
-
- /* Single part vector: just the rest of the buffer */
-
- vec->buf[0] = &buf[r];
- vec->len[0] = free_cnt;
- vec->len[1] = 0;
- }
-}
-
-template<class T> void
-RingBufferNPT<T>::get_write_vector (RingBufferNPT<T>::rw_vector *vec)
-{
- size_t free_cnt;
- size_t cnt2;
- size_t w, r;
-
- w = g_atomic_int_get (&write_ptr);
- r = g_atomic_int_get (&read_ptr);
-
- if (w > r) {
- free_cnt = ((r - w + size) % size) - 1;
- } else if (w < r) {
- free_cnt = (r - w) - 1;
- } else {
- free_cnt = size - 1;
- }
-
- cnt2 = w + free_cnt;
-
- if (cnt2 > size) {
-
- /* Two part vector: the rest of the buffer after the
- current write ptr, plus some from the start of
- the buffer.
- */
-
- vec->buf[0] = &buf[w];
- vec->len[0] = size - w;
- vec->buf[1] = buf;
- vec->len[1] = cnt2 % size;
- } else {
- vec->buf[0] = &buf[w];
- vec->len[0] = free_cnt;
- vec->len[1] = 0;
- }
-}
-
-#endif /* __ringbuffer_npt_h__ */
diff --git a/libs/pbd/pbd/search_path.h b/libs/pbd/pbd/search_path.h
deleted file mode 100644
index 3b10d4a319..0000000000
--- a/libs/pbd/pbd/search_path.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- Copyright (C) 2007 Tim Mayberry
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef PBD_SEARCH_PATH_INCLUDED
-#define PBD_SEARCH_PATH_INCLUDED
-
-#include <string>
-#include <vector>
-
-#include <pbd/filesystem.h>
-
-namespace PBD {
-
-using std::string;
-using std::vector;
-
-/**
- * @class The SearchPath class is a helper class for getting a
- * vector of paths contained in a search path string where a
- * "search path string" contains absolute directory paths
- * separated by a colon(:) or a semi-colon(;) on windows.
- *
- * The SearchPath class does not test whether the paths exist
- * or are directories. It is basically just a container.
- */
-class SearchPath {
-public:
-
- typedef std::vector<sys::path>::iterator iterator;
- typedef std::vector<sys::path>::const_iterator const_iterator;
-
-public:
-
- /**
- * Create an empty SearchPath.
- */
- SearchPath ();
-
- /**
- * Initialize SearchPath from a string where the string contains
- * one or more absolute paths to directories which are delimited
- * by a path separation character. The path delimeter is a
- * colon(:) on unix and a semi-colon(;) on windows.
- *
- * Each path contained in the search path may or may not resolve to
- * an existing directory in the filesystem.
- *
- * @param search_path A path string.
- */
- SearchPath (const string& search_path);
-
- /**
- * Initialize SearchPath from a sys::path.
- *
- * @param directory_path A directory path.
- */
- SearchPath (const sys::path& directory_path);
-
- /**
- * Initialize SearchPath from a vector of paths that may or may
- * not exist.
- *
- * @param path A path.
- */
- SearchPath (const vector<sys::path>& paths);
-
- /**
- * The copy constructor does what you would expect and copies the
- * vector of paths contained by the SearchPath.
- */
- SearchPath (const SearchPath& search_path);
-
- /**
- * Indicate whether there are any directory paths in m_dirs.
- *
- * If SearchPath is initialized with an empty string as the
- * result of for instance the contents of an unset environment
- * variable.
- *
- * @return true if there are any paths in m_paths.
- */
- operator void* () const { return (void*)!m_dirs.empty(); }
-
- /**
- * @return a read/write iterator that points to the first
- * path in the SearchPath. Iteration is done in ordinary
- * element order.
- */
- iterator begin () { return m_dirs.begin(); }
-
- /**
- * @return A read-only (constant) iterator that points to the
- * first path in the SearchPath.
- */
- const_iterator begin () const { return m_dirs.begin(); }
-
- /**
- * @return A read/write iterator that points one past the last
- * path in the SearchPath.
- */
- iterator end () { return m_dirs.end(); }
-
- /**
- * @return A read-only (constant) iterator that points one past
- * the last path in the SearchPath.
- */
- const_iterator end () const { return m_dirs.end(); }
-
- /**
- * @return a search path string.
- *
- * The string that is returned contains the platform specific
- * path separator.
- */
- const string to_string () const;
-
- /**
- * Assignment of another SearchPath to this.
- */
- SearchPath& operator= (const SearchPath& spath);
-
- /**
- * Add all the directories in path to this.
- */
- SearchPath& operator+= (const SearchPath& spath);
-
- /**
- * Add another directory path to the search path.
- */
- SearchPath& operator+= (const sys::path& directory_path);
-
- /**
- * Concatenate another SearchPath onto this.
- */
- SearchPath& operator+ (const SearchPath& other);
-
- /**
- * Add another path to the search path.
- */
- SearchPath& operator+ (const sys::path& directory_path);
-
- /**
- * Add a sub-directory to each path in the search path.
- * @param subdir The directory name, it should not contain
- * any path separating tokens.
- */
- SearchPath& add_subdirectory_to_paths (const string& subdir);
-
- /**
- * Add a sub-directory to each path in the search path.
- * @see add_subdirectory_to_paths
- */
- SearchPath& operator/= (const string& subdir);
-
-protected:
-
- void add_directory (const sys::path& directory_path);
-
- void add_directories (const vector<sys::path>& paths);
-
- vector<sys::path> m_dirs;
-
-};
-
-} // namespace PBD
-
-#endif
diff --git a/libs/pbd/pbd/selectable.h b/libs/pbd/pbd/selectable.h
deleted file mode 100644
index 85f3e79ab0..0000000000
--- a/libs/pbd/pbd/selectable.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __selectable_h__
-#define __selectable_h__
-
-#include <list>
-#include <string>
-#include <stdio.h>
-
-#include <sigc++/sigc++.h>
-
-#include <sys/types.h>
-
-namespace Select {
- enum Condition {
- Readable = 0x1,
- Writable = 0x2,
- Exception = 0x4
- };
-
-class Selectable : public sigc::trackable
-
-{
- public:
- Selectable (int fd);
- Selectable (const std::string &, int flags, int mode = 0);
- Selectable (FILE *);
- ~Selectable ();
-
- sigc::signal<void,Selectable *,Select::Condition> readable;
- sigc::signal<void,Selectable *,Select::Condition> writable;
- sigc::signal<void,Selectable *,Select::Condition> exceptioned;
-
- int fd() { return _fd; }
- bool ok() { return _ok; }
-
- protected:
- void selected (unsigned int condition);
- int condition;
- int _fd;
-
- friend class Selector;
-
- private:
- enum {
- fromFD,
- fromPath,
- fromFILE
- };
-
- bool _ok;
- int _type;
- std::string path;
-};
-
-class Selector {
- private:
- int post_select (fd_set *, fd_set *, fd_set *);
- int _max_fd;
-
- typedef std::list<Selectable *> Selectables;
- Selectables selectables;
- pthread_mutex_t list_lock;
-
- static bool use_list_lock;
-
- public:
- Selector ();
-
- void multithreaded (bool yn) {
- use_list_lock = yn;
- }
-
- void add (int condition, Selectable *s);
- void remove (Selectable *);
- int select (unsigned long usecs);
-};
-
-
-
-} /* namespace */
-
-
-#endif // __selectable_h__
diff --git a/libs/pbd/pbd/shiva.h b/libs/pbd/pbd/shiva.h
deleted file mode 100644
index 2e53ff65f5..0000000000
--- a/libs/pbd/pbd/shiva.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_shiva_h__
-#define __pbd_shiva_h__
-
-#include <sigc++/sigc++.h>
-
-namespace PBD {
-
-/* named after the Hindu god Shiva, The Destroyer */
-
-template<typename ObjectWithGoingAway, typename ObjectToBeDestroyed>
-class Shiva {
- public:
- Shiva (ObjectWithGoingAway& emitter, ObjectToBeDestroyed& receiver) {
-
- /* if the emitter goes away, destroy the receiver */
-
- _connection = emitter.GoingAway.connect
- (sigc::bind (sigc::mem_fun
- (*this, &Shiva<ObjectWithGoingAway,ObjectToBeDestroyed>::destroy),
- &receiver));
- }
-
- ~Shiva() {
- forget ();
- }
-
- private:
- sigc::connection _connection;
-
- void destroy (ObjectToBeDestroyed* obj) {
- delete obj;
- forget ();
- }
-
- void forget () {
- _connection.disconnect ();
- }
-
-};
-
-template<typename ObjectWithGoingAway, typename ObjectToBeDestroyed>
-class ProxyShiva {
- public:
- ProxyShiva (ObjectWithGoingAway& emitter, ObjectToBeDestroyed& receiver, void (*callback)(ObjectToBeDestroyed*, ObjectWithGoingAway*)) {
-
- /* if the emitter goes away, destroy the receiver */
-
- _callback = callback;
- _callback_argument1 = &receiver;
- _callback_argument2 = &emitter;
-
- _connection = emitter.GoingAway.connect
- (sigc::bind (sigc::mem_fun
- (*this, &ProxyShiva<ObjectWithGoingAway,ObjectToBeDestroyed>::destroy),
- &receiver));
- }
-
- ~ProxyShiva() {
- forget ();
- }
-
- private:
- sigc::connection _connection;
- void (*_callback) (ObjectToBeDestroyed*, ObjectWithGoingAway*);
- ObjectToBeDestroyed* _callback_argument1;
- ObjectWithGoingAway* _callback_argument2;
-
- void destroy (ObjectToBeDestroyed* obj) {
- /* callback must destroy obj if appropriate, not done here */
- _callback (obj, _callback_argument2);
- forget ();
- }
-
- void forget () {
- _connection.disconnect ();
- }
-};
-
-template<typename ObjectWithGoingAway, typename ObjectToBeDestroyed>
-class PairedShiva {
- public:
- PairedShiva (ObjectWithGoingAway& emitter, ObjectToBeDestroyed& receiver) {
-
- /* if the emitter goes away, destroy the receiver */
-
- _connection1 = emitter.GoingAway.connect
- (sigc::bind (sigc::mem_fun
- (*this, &PairedShiva<ObjectWithGoingAway,ObjectToBeDestroyed>::destroy),
- &receiver));
-
- /* if the receiver goes away, forget all this nonsense */
-
- _connection2 = receiver.GoingAway.connect
- (sigc::mem_fun (*this, &PairedShiva<ObjectWithGoingAway,ObjectToBeDestroyed>::forget));
- }
-
- ~PairedShiva() {
- forget ();
- }
-
- private:
- sigc::connection _connection1;
- sigc::connection _connection2;
-
- void destroy (ObjectToBeDestroyed* obj) {
- delete obj;
- forget ();
- }
-
- void forget () {
- _connection1.disconnect ();
- _connection2.disconnect ();
- }
-
-};
-
-}
-
-#endif /* __pbd_shiva_h__ */
diff --git a/libs/pbd/pbd/shortpath.h b/libs/pbd/pbd/shortpath.h
deleted file mode 100644
index 55431bf34e..0000000000
--- a/libs/pbd/pbd/shortpath.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_shortpath_h__
-#define __pbd_shortpath_h__
-
-#include <glibmm/ustring.h>
-
-Glib::ustring short_path (const Glib::ustring& path, Glib::ustring::size_type target_characters);
-
-#endif /* __pbd_shortpath_h__ */
diff --git a/libs/pbd/pbd/stacktrace.h b/libs/pbd/pbd/stacktrace.h
deleted file mode 100644
index 0a349dcaeb..0000000000
--- a/libs/pbd/pbd/stacktrace.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __libpbd_stacktrace_h__
-#define __libpbd_stacktrace_h__
-
-#include <iostream>
-#include <ostream>
-#include <glibmm/thread.h>
-#include <list>
-
-namespace PBD {
- void stacktrace (std::ostream& out, int levels = 0);
- void trace_twb();
-
-#ifdef HAVE_EXECINFO
-#include <execinfo.h>
-#include <stdlib.h>
-#endif
-
-template<typename T>
-class thing_with_backtrace
-{
- public:
- thing_with_backtrace () {
- trace_twb();
-#ifdef HAVE_EXECINFO
- allocation_backtrace = new void*[50];
- allocation_backtrace_size = backtrace (allocation_backtrace, 50);
-#else
- allocation_backtrace_size = 0;
-#endif
- Glib::Mutex::Lock lm (all_mutex);
- all.push_back (this);
- }
-
- thing_with_backtrace (const thing_with_backtrace<T>& other) {
- trace_twb();
-#ifdef HAVE_EXECINFO
- allocation_backtrace = new void*[50];
- allocation_backtrace_size = backtrace (allocation_backtrace, 50);
-#else
- allocation_backtrace_size = 0;
-#endif
- Glib::Mutex::Lock lm (all_mutex);
- all.push_back (this);
- }
-
- ~thing_with_backtrace() {
- if (allocation_backtrace_size) {
- delete [] allocation_backtrace;
- }
- Glib::Mutex::Lock lm (all_mutex);
- all.remove (this);
- }
-
- thing_with_backtrace<T>& operator= (const thing_with_backtrace<T>& other) {
- /* no copyable members */
- return *this;
- }
-
- static void peek_a_boo (std::ostream& stream) {
-#ifdef HAVE_EXECINFO
- typename std::list<thing_with_backtrace<T>*>::iterator x;
- for (x = all.begin(); x != all.end(); ++x) {
- char **strings;
- size_t i;
-
- strings = backtrace_symbols ((*x)->allocation_backtrace, (*x)->allocation_backtrace_size);
-
- if (strings) {
- stream << "--- ALLOCATED SHARED_PTR @ " << (*x) << std::endl;
- for (i = 0; i < (*x)->allocation_backtrace_size && i < 50U; i++) {
- stream << strings[i] << std::endl;
- }
- free (strings);
- }
- }
-#else
- stream << "execinfo not defined for this platform" << std::endl;
-#endif
- }
-
-private:
- void** allocation_backtrace;
- int allocation_backtrace_size;
- static std::list<thing_with_backtrace<T>* > all;
- static Glib::StaticMutex all_mutex;
-};
-
-template<typename T> std::list<PBD::thing_with_backtrace<T> *> PBD::thing_with_backtrace<T>::all;
-template<typename T> Glib::StaticMutex PBD::thing_with_backtrace<T>::all_mutex = GLIBMM_STATIC_MUTEX_INIT;
-
-} // namespace PBD
-
-
-
-#endif /* __libpbd_stacktrace_h__ */
diff --git a/libs/pbd/pbd/stateful.h b/libs/pbd/pbd/stateful.h
deleted file mode 100644
index 8ea647475a..0000000000
--- a/libs/pbd/pbd/stateful.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- Copyright (C) 2000 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_stateful_h__
-#define __pbd_stateful_h__
-
-#include <string>
-#include <pbd/id.h>
-
-class XMLNode;
-
-namespace PBD {
-
-namespace sys {
- class path;
-}
-
-class Stateful {
- public:
- Stateful();
- virtual ~Stateful();
-
- virtual XMLNode& get_state (void) = 0;
-
- virtual int set_state (const XMLNode&) = 0;
-
- /* Extra XML nodes */
-
- void add_extra_xml (XMLNode&);
- XMLNode *extra_xml (const std::string& str);
-
- const PBD::ID& id() const { return _id; }
-
- protected:
-
- void add_instant_xml (XMLNode&, const sys::path& directory_path);
- XMLNode *instant_xml (const std::string& str, const sys::path& directory_path);
-
- XMLNode *_extra_xml;
- XMLNode *_instant_xml;
- PBD::ID _id;
-};
-
-} // namespace PBD
-
-#endif /* __pbd_stateful_h__ */
-
diff --git a/libs/pbd/pbd/statefuldestructible.h b/libs/pbd/pbd/statefuldestructible.h
deleted file mode 100644
index 83eff473d6..0000000000
--- a/libs/pbd/pbd/statefuldestructible.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_stateful_destructible_h__
-#define __pbd_stateful_destructible_h__
-
-#include <pbd/stateful.h>
-#include <pbd/destructible.h>
-
-namespace PBD {
-
-class StatefulDestructible : public Stateful, public Destructible
-{
-};
-
-/* be very very careful using this class. it does not inherit from sigc::trackable and thus
- should only be used in multiple-inheritance situations involving another type
- that does inherit from sigc::trackable (or sigc::trackable itself)
-*/
-
-class StatefulThingWithGoingAway : public Stateful, public ThingWithGoingAway
-{
-};
-
-}
-
-
-#endif /* __pbd_stateful_destructible_h__ */
diff --git a/libs/pbd/pbd/stl_delete.h b/libs/pbd/pbd/stl_delete.h
deleted file mode 100644
index 66fb027387..0000000000
--- a/libs/pbd/pbd/stl_delete.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __libmisc_stl_delete_h__
-#define __libmisc_stl_delete_h__
-
-/* To actually use any of these deletion functions, you need to
- first include the revelant container type header.
-*/
-#if defined(_CPP_VECTOR) || defined(_GLIBCXX_VECTOR) || defined(__SGI_STL_VECTOR)
-template<class T> void vector_delete (std::vector<T *> *vec)
-{
- typename std::vector<T *>::iterator i;
-
- for (i = vec->begin(); i != vec->end(); i++) {
- delete *i;
- }
- vec->clear ();
-}
-#endif // _CPP_VECTOR || _GLIBCXX_VECTOR || __SGI_STL_VECTOR
-
-#if defined(_CPP_MAP) || defined(_GLIBCXX_MAP) || defined(__SGI_STL_MAP)
-template<class K, class T> void map_delete (std::map<K, T *> *m)
-{
- typename std::map<K, T *>::iterator i;
-
- for (i = m->begin(); i != m->end(); i++) {
- delete (*i).second;
- }
- m->clear ();
-}
-#endif // _CPP_MAP || _GLIBCXX_MAP || __SGI_STL_MAP
-
-#if defined(_CPP_LIST) || defined(_GLIBCXX_LIST) || defined(__SGI_STL_LIST)
-template<class T> void list_delete (std::list<T *> *l)
-{
- typename std::list<T *>::iterator i;
-
- for (i = l->begin(); i != l->end(); i++) {
- delete (*i);
- }
-
- l->clear ();
-}
-#endif // _CPP_LIST || _GLIBCXX_LIST || __SGI_STL_LIST
-
-#if defined(_CPP_SLIST) || defined(_GLIBCXX_SLIST) || defined(__SGI_STL_SLIST)
-template<class T> void slist_delete (std::slist<T *> *l)
-{
- typename std::slist<T *>::iterator i;
-
- for (i = l->begin(); i != l->end(); i++) {
- delete (*i);
- }
-
- l->clear ();
-}
-#endif // _CPP_SLIST || _GLIBCXX_SLIST || __SGI_STL_SLIST
-
-#if defined(_CPP_SET) || defined(_GLIBCXX_SET) || defined(__SGI_STL_SET)
-template<class T> void set_delete (std::set<T *> *sset)
-{
- typename std::set<T *>::iterator i;
-
- for (i = sset->begin(); i != sset->end(); i++) {
- delete *i;
- }
- sset->erase (sset->begin(), sset->end());
-}
-#endif // _CPP_SET || _GLIBCXX_SET || __SGI_STL_SET
-
-#endif // __libmisc_stl_delete_h__
diff --git a/libs/pbd/pbd/stl_functors.h b/libs/pbd/pbd/stl_functors.h
deleted file mode 100644
index 3c83a1ae2f..0000000000
--- a/libs/pbd/pbd/stl_functors.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __stl_functors_h__
-#define __stl_functors_h__
-
-#include <string>
-
-#ifndef LESS_STRING_P
-struct less<std::string *> {
- bool operator()(std::string *s1, std::string *s2) const {
- return *s1 < *s2;
- }
-};
-#define LESS_STRING_P
-#endif // LESS_STRING_P
-
-#ifndef LESS_CONST_STRING_P
-struct less<const std::string *> {
- bool operator()(const std::string *s1, const std::string *s2) const {
- return *s1 < *s2;
- }
-};
-#define LESS_CONST_STRING_P
-#endif // LESS_CONST_STRING_P
-
-#ifndef LESS_CONST_CHAR_P
-struct less<const char *>
-{
- bool operator()(const char* s1, const char* s2) const {
- return strcmp(s1, s2) < 0;
- }
-};
-#define LESS_CONST_CHAR_P
-#endif // LESS_CONST_CHAR_P
-
-#ifndef LESS_CONST_FLOAT_P
-struct less<const float *>
-{
- bool operator()(const float *n1, const float *n2) const {
- return *n1 < *n2;
- }
-};
-#define LESS_CONST_FLOAT_P
-#endif // LESS_CONST_FLOAT_P
-
-#ifndef EQUAL_TO_CONST_CHAR_P
-struct equal_to<const char *>
-{
- bool operator()(const char *s1, const char *s2) const {
- return strcmp (s1, s2) == 0;
- }
-};
-#define EQUAL_TO_CONST_CHAR_P
-#endif // EQUAL_TO_CONST_CHAR_P
-
-#ifndef EQUAL_TO_STRING_P
-struct equal_to<std::string *>
-{
- bool operator()(const std::string *s1, const std::string *s2) const {
- return *s1 == *s2;
- }
-};
-#define EQUAL_TO_STRING_P
-#endif // EQUAL_TO_STRING_P
-
-#ifndef LESS_CONST_STRING_R
-struct less<const std::string &> {
- bool operator() (const std::string &s1, const std::string &s2) {
- return s1 < s2;
- }
-};
-#define LESS_CONST_STRING_R
-#endif // EQUAL_TO_STRING_P
-
-#endif // __stl_functors_h__
diff --git a/libs/pbd/pbd/strsplit.h b/libs/pbd/pbd/strsplit.h
deleted file mode 100644
index 25c4526b6a..0000000000
--- a/libs/pbd/pbd/strsplit.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_strplit_h__
-#define __pbd_strplit_h__
-
-#include <string>
-#include <vector>
-#include <glibmm/ustring.h>
-
-extern void split (std::string, std::vector<std::string>&, char);
-extern void split (Glib::ustring, std::vector<Glib::ustring>&, char);
-
-#endif // __pbd_strplit_h__
diff --git a/libs/pbd/pbd/textreceiver.h b/libs/pbd/pbd/textreceiver.h
deleted file mode 100644
index e5900fc652..0000000000
--- a/libs/pbd/pbd/textreceiver.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __libmisc_textreceiver_h__
-#define __libmisc_textreceiver_h__
-
-#include <string>
-
-#include "receiver.h"
-
-using std::string;
-using std::cout;
-using std::endl;
-
-class TextReceiver : public Receiver
-{
- public:
- TextReceiver (const string &n);
-
- protected:
- void receive (Transmitter::Channel, const char *);
-
- private:
- string name;
-};
-
-#endif //__libmisc_textreceiver_h__
diff --git a/libs/pbd/pbd/thrown_error.h b/libs/pbd/pbd/thrown_error.h
deleted file mode 100644
index 0a63085f11..0000000000
--- a/libs/pbd/pbd/thrown_error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-#ifndef __qm_thrown_error_h__
-#define __qm_thrown_error_h__
-
-#include "transmitter.h"
-
-#define SAFE_THROW(T) \
- T *sent = new T; \
- (*sent) << rdbuf(); \
- throw sent
-
-class ThrownError : public Transmitter {
- public:
- ThrownError () : Transmitter (Transmitter::Throw) {}
- protected:
- virtual void deliver () = 0;
-};
-
-#endif // __qm_thrown_error_h__
-
-
diff --git a/libs/pbd/pbd/tokenizer.h b/libs/pbd/pbd/tokenizer.h
deleted file mode 100644
index 9206d1b6fb..0000000000
--- a/libs/pbd/pbd/tokenizer.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef PBD_TOKENIZER
-#define PBD_TOKENIZER
-
-#include <iterator>
-#include <string>
-
-#include <pbd/whitespace.h>
-
-namespace PBD {
-
-/**
- Tokenize string, this should work for standard
- strings as well as Glib::ustring. This is a bit of a hack,
- there are much better string tokenizing patterns out there.
- If strip_whitespace is set to true, tokens will be checked to see
- that they still have a length after stripping. If no length, they
- are discarded.
-*/
-template<typename StringType, typename Iter>
-unsigned int
-tokenize(const StringType& str,
- const StringType& delims,
- Iter it,
- bool strip_whitespace=false)
-{
- typename StringType::size_type start_pos = 0;
- typename StringType::size_type end_pos = 0;
- unsigned int token_count = 0;
-
- do {
- start_pos = str.find_first_not_of(delims, start_pos);
- end_pos = str.find_first_of(delims, start_pos);
- if (start_pos != end_pos) {
- if (end_pos == str.npos) {
- end_pos = str.length();
- }
- if (strip_whitespace) {
- StringType stripped = str.substr(start_pos, end_pos - start_pos);
- strip_whitespace_edges (stripped);
- if (stripped.length()) {
- *it++ = stripped;
- }
- } else {
- *it++ = str.substr(start_pos, end_pos - start_pos);
- }
- ++token_count;
- start_pos = str.find_first_not_of(delims, end_pos + 1);
- }
- } while (start_pos != str.npos);
-
- if (start_pos != str.npos) {
- if (strip_whitespace) {
- StringType stripped = str.substr(start_pos, str.length() - start_pos);
- strip_whitespace_edges (stripped);
- if (stripped.length()) {
- *it++ = stripped;
- }
- } else {
- *it++ = str.substr(start_pos, str.length() - start_pos);
- }
- ++token_count;
- }
-
- return token_count;
-}
-
-} // namespace PBD
-
-#endif // PBD_TOKENIZER
-
-
diff --git a/libs/pbd/pbd/touchable.h b/libs/pbd/pbd/touchable.h
deleted file mode 100644
index 12f1c443fd..0000000000
--- a/libs/pbd/pbd/touchable.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (C) 1999 Paul Barton-Davis
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_touchable_h__
-#define __pbd_touchable_h__
-
-class Touchable
-{
- public:
- Touchable() : _delete_after_touch (false) {}
- virtual ~Touchable() {}
-
- void set_delete_after_touch (bool yn) { _delete_after_touch = yn; }
- bool delete_after_touch() const { return _delete_after_touch; }
-
- virtual void touch () = 0;
-
- protected:
- bool _delete_after_touch;
-};
-
-template<class T>
-class DynamicTouchable : public Touchable
-{
- public:
- DynamicTouchable (T& t, void (T::*m)(void))
- : object (t), method (m) { set_delete_after_touch (true); }
-
- void touch () {
- (object.*method)();
- }
-
- protected:
- T& object;
- void (T::*method)(void);
-};
-
-template<class T1, class T2>
-class DynamicTouchable1 : public Touchable
-{
- public:
- DynamicTouchable1 (T1& t, void (T1::*m)(T2), T2 a)
- : object (t), method (m), arg (a) { set_delete_after_touch (true); }
-
- void touch () {
- (object.*method)(arg);
- }
-
- protected:
- T1& object;
- void (T1::*method)(T2);
- T2 arg;
-};
-
-template<class T1, class T2, class T3>
-class DynamicTouchable2 : public Touchable
-{
- public:
- DynamicTouchable2 (T1& t, void (T1::*m)(T2, T3), T2 a1, T3 a2)
- : object (t), method (m), arg1 (a1), arg2 (a2) { set_delete_after_touch (true); }
-
- void touch () {
- (object.*method)(arg1, arg2);
- }
-
- protected:
- T1& object;
- void (T1::*method)(T2,T3);
- T2 arg1;
- T3 arg2;
-};
-
-#endif // __pbd_touchable_h__
diff --git a/libs/pbd/pbd/transmitter.h b/libs/pbd/pbd/transmitter.h
deleted file mode 100644
index 61ac9bd8d8..0000000000
--- a/libs/pbd/pbd/transmitter.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- Copyright (C) 1998-99 Paul Barton-Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __libmisc_transmitter_h__
-#define __libmisc_transmitter_h__
-
-#include <sstream>
-#include <iostream>
-
-#include <sigc++/sigc++.h>
-
-using std::cout;
-using std::cerr;
-using std::endl;
-
-class Transmitter : public std::stringstream
-
-{
- public:
- enum Channel {
- Info,
- Error,
- Warning,
- Fatal,
- Throw
- };
-
- Transmitter (Channel);
-
- sigc::signal<void,Channel, const char *> &sender() {
- return *send;
- }
-
- bool does_not_return ();
-
- protected:
- virtual void deliver ();
- friend std::ostream& endmsg (std::ostream &);
-
- private:
- Channel channel;
- sigc::signal<void, Channel, const char *> *send;
-
- sigc::signal<void, Channel, const char *> info;
- sigc::signal<void, Channel, const char *> warning;
- sigc::signal<void, Channel, const char *> error;
- sigc::signal<void, Channel, const char *> fatal;
-};
-
-/* for EGCS 2.91.66, if this function is not compiled within the same
- compilation unit as the one where a ThrownError is thrown, then
- nothing will catch the error. This is a pretty small function, so
- inlining it here seems like a reasonable workaround.
-*/
-
-inline std::ostream &
-endmsg (std::ostream &ostr)
-
-{
- Transmitter *t;
-
- /* There is a serious bug in the Cygnus/GCC libstdc++ library:
- cout is not actually an ostream, but a trick was played
- to make the compiler think that it is. This will cause
- the dynamic_cast<> to fail with SEGV. So, first check to
- see if ostr == cout, and handle it specially.
- */
-
- if (&ostr == &cout) {
- cout << endl;
- return ostr;
- } else if (&ostr == &cerr) {
- cerr << endl;
- return ostr;
- }
-
- if ((t = dynamic_cast<Transmitter *> (&ostr)) != 0) {
- t->deliver ();
- } else {
- /* hmm. not a Transmitter, so just put a newline on
- it and assume that that will be enough.
- */
-
- ostr << endl;
- }
-
- return ostr;
-}
-
-
-extern "C" { void pbd_c_error (const char *); }
-
-#endif // __libmisc_transmitter_h__
diff --git a/libs/pbd/pbd/undo.h b/libs/pbd/pbd/undo.h
deleted file mode 100644
index 8f1716d09f..0000000000
--- a/libs/pbd/pbd/undo.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- Copyright (C) 2002 Brett Viren & Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __lib_pbd_undo_h__
-#define __lib_pbd_undo_h__
-
-#include <string>
-#include <list>
-#include <map>
-#include <sigc++/slot.h>
-#include <sigc++/bind.h>
-#include <sys/time.h>
-#include <pbd/command.h>
-
-typedef sigc::slot<void> UndoAction;
-
-class UndoTransaction : public Command
-{
- public:
- UndoTransaction ();
- UndoTransaction (const UndoTransaction&);
- UndoTransaction& operator= (const UndoTransaction&);
- ~UndoTransaction ();
-
- void clear ();
- bool empty() const;
- bool clearing () const { return _clearing; }
-
- void add_command (Command* const);
- void remove_command (Command* const);
-
- void operator() ();
- void undo();
- void redo();
-
- XMLNode &get_state();
-
- void set_timestamp (struct timeval &t) {
- _timestamp = t;
- }
-
- const struct timeval& timestamp() const {
- return _timestamp;
- }
-
- private:
- std::list<Command*> actions;
- struct timeval _timestamp;
- bool _clearing;
-
- friend void command_death (UndoTransaction*, Command *);
-};
-
-class UndoHistory : public sigc::trackable
-{
- public:
- UndoHistory();
- ~UndoHistory() {}
-
- void add (UndoTransaction* ut);
- void undo (unsigned int n);
- void redo (unsigned int n);
-
- unsigned long undo_depth() const { return UndoList.size(); }
- unsigned long redo_depth() const { return RedoList.size(); }
-
- std::string next_undo() const { return (UndoList.empty() ? std::string() : UndoList.back()->name()); }
- std::string next_redo() const { return (RedoList.empty() ? std::string() : RedoList.back()->name()); }
-
- void clear ();
- void clear_undo ();
- void clear_redo ();
-
- XMLNode &get_state(int32_t depth = 0);
- void save_state();
-
- void set_depth (int32_t);
- int32_t get_depth() const { return _depth; }
-
- sigc::signal<void> Changed;
-
- private:
- bool _clearing;
- int32_t _depth;
- std::list<UndoTransaction*> UndoList;
- std::list<UndoTransaction*> RedoList;
-
- void remove (UndoTransaction*);
-};
-
-
-#endif /* __lib_pbd_undo_h__ */
diff --git a/libs/pbd/pbd/unknown_type.h b/libs/pbd/pbd/unknown_type.h
deleted file mode 100644
index fddc1aeddb..0000000000
--- a/libs/pbd/pbd/unknown_type.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __pbd_unknown_type_h__
-#define __pbd_unknown_type_h__
-
-#include <exception>
-
-class unknown_type : public std::exception {
- public:
- virtual const char *what() const throw() { return "unknown type"; }
-};
-
-#endif /* __pbd_unknown_type_h__ */
diff --git a/libs/pbd/pbd/whitespace.h b/libs/pbd/pbd/whitespace.h
deleted file mode 100644
index 444be112b0..0000000000
--- a/libs/pbd/pbd/whitespace.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (C) 2000-2007 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __pbd_whitespace_h__
-#define __pbd_whitespace_h__
-
-#include <string>
-
-namespace PBD {
-
-// returns the empty string if the entire string is whitespace
-// so check length after calling.
-extern void strip_whitespace_edges (std::string& str);
-
-} // namespace PBD
-
-#endif // __pbd_whitespace_h__
diff --git a/libs/pbd/pbd/xml++.h b/libs/pbd/pbd/xml++.h
deleted file mode 100644
index 290a449869..0000000000
--- a/libs/pbd/pbd/xml++.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* xml++.h
- * libxml++ and this file are copyright (C) 2000 by Ari Johnson, and
- * are covered by the GNU Lesser General Public License, which should be
- * included with libxml++ as the file COPYING.
- */
-
-#include <string>
-#include <list>
-#include <map>
-#include <cstdio>
-#include <cstdarg>
-
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <boost/shared_ptr.hpp>
-
-#ifndef __XML_H
-#define __XML_H
-
-using std::string;
-using std::map;
-using std::list;
-
-class XMLTree;
-class XMLNode;
-class XMLProperty;
-
-typedef list<XMLNode *> XMLNodeList;
-typedef list<boost::shared_ptr<XMLNode> > XMLSharedNodeList;
-typedef XMLNodeList::iterator XMLNodeIterator;
-typedef XMLNodeList::const_iterator XMLNodeConstIterator;
-typedef list<XMLProperty*> XMLPropertyList;
-typedef XMLPropertyList::iterator XMLPropertyIterator;
-typedef XMLPropertyList::const_iterator XMLPropertyConstIterator;
-typedef map<string, XMLProperty*> XMLPropertyMap;
-
-class XMLTree {
-private:
- string _filename;
- XMLNode *_root;
- int _compression;
- bool read_internal(bool validate);
-
-public:
- XMLTree();
- XMLTree(const string &fn, bool validate = false);
- XMLTree(const XMLTree *);
- ~XMLTree();
-
- XMLNode *root() const { return _root; };
- XMLNode *set_root(XMLNode *n) { return _root = n; };
-
- const string & filename() const { return _filename; };
- const string & set_filename(const string &fn) { return _filename = fn; };
-
- int compression() const { return _compression; };
- int set_compression(int);
-
- bool read() { return read_internal(false); };
- bool read(const string &fn) { set_filename(fn); return read_internal(false); };
- bool read_and_validate() { return read_internal(true); };
- bool read_and_validate(const string &fn) { set_filename(fn); return read_internal(true); };
- bool read_buffer(const string &);
-
- bool write() const;
- bool write(const string &fn) { set_filename(fn); return write(); };
-
- void debug (FILE*) const;
-
- const string & write_buffer() const;
-};
-
-class XMLNode {
-private:
- string _name;
- bool _is_content;
- string _content;
- XMLNodeList _children;
- XMLPropertyList _proplist;
- XMLPropertyMap _propmap;
-
-public:
- XMLNode(const string& name);
- XMLNode(const string& name, const string& content);
- XMLNode(const XMLNode& other);
- ~XMLNode();
-
- const string name() const { return _name; };
-
- bool is_content() const { return _is_content; };
- const string & content() const { return _content; };
- const string & set_content (const string &);
- XMLNode *add_content(const string & = string());
-
- const XMLNodeList & children (const string& str = string()) const;
- XMLNode *add_child (const char *);
- XMLNode *add_child_copy (const XMLNode&);
- XMLNode *child (const char*) const;
- void add_child_nocopy (XMLNode&);
-
- boost::shared_ptr<XMLSharedNodeList> find(const std::string xpath) const;
- std::string attribute_value();
-
- const XMLPropertyList & properties() const { return _proplist; };
- XMLProperty *property(const char * );
- XMLProperty *property(const std::string&);
- const XMLProperty *property(const char * n) const
- { return ((XMLNode *) this)->property(n); };
- const XMLProperty *property(const std::string& ns) const
- { return ((XMLNode *) this)->property(ns); };
- XMLProperty *add_property(const char *name, const string& value);
- XMLProperty *add_property(const char *name, const char *value = "");
- XMLProperty *add_property(const char *name, const long value);
-
- void remove_property(const string &);
-
- /** Remove all nodes with the name passed to remove_nodes */
- void remove_nodes(const string &);
- /** Remove and delete all nodes with the name passed to remove_nodes */
- void remove_nodes_and_delete(const string &);
- /** Remove and delete all nodes with property prop matching val */
- void remove_nodes_and_delete(const string& propname, const string& val);
-};
-
-class XMLProperty {
-private:
- string _name;
- string _value;
-
-public:
- XMLProperty(const string &n, const string &v = string());
- ~XMLProperty();
-
- const string & name() const { return _name; };
- const string & value() const { return _value; };
- const string & set_value(const string &v) { return _value = v; };
-};
-
-class XMLException: public std::exception
-{
-public:
- explicit XMLException(const string message)
- : message_(message)
- {
- }
-
- virtual ~XMLException() throw() {};
-
- virtual const char* what() const throw() { return message_.c_str(); }
- virtual void Raise() const { throw *this; }
- virtual exception * Clone() const { return new exception(*this); }
-
-private:
- string message_;
-};
-
-#endif /* __XML_H */
-