From 07115ad5e6fa4af82b4efd06ce1d3f60cc2d07bb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 20 Dec 2007 02:04:55 +0000 Subject: Use fancy Widget class for Glade widgets. Somewhat consistently rename glade widgets. Fix about dialog program name, icon (when run from source tree), and close button. git-svn-id: http://svn.drobilla.net/lad/patchage@989 a436a847-0d15-0410-975c-d299462d15a1 --- src/Widget.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/Widget.hpp (limited to 'src/Widget.hpp') diff --git a/src/Widget.hpp b/src/Widget.hpp new file mode 100644 index 0000000..ea8a218 --- /dev/null +++ b/src/Widget.hpp @@ -0,0 +1,42 @@ +/* This file is part of Patchage + * Copyright (C) 2007 Dave Robillard + * + * Patchage 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 3 of the License, or (at your option) + * any later version. + * + * Patchage 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 Patchage. If not, see . + */ + +#ifndef WIDGET_HPP +#define WIDGET_HPP + +#include +#include + +template +class Widget : public boost::noncopyable { +public: + Widget(Glib::RefPtr xml, const std::string& name) { + xml->get_widget(name.c_str(), _me); + } + + W* get() { return _me; } + const W* get() const { return _me; } + W* operator->() { return _me; } + const W* operator->() const { return _me; } + W& operator*() { return *_me; } + const W& operator*() const { return *_me; } + +private: + W* _me; +}; + +#endif // WIDGET_HPP -- cgit v1.2.1