1 /* This file is part of Patchage
2 * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
4 * Patchage is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License as published by the Free
6 * Software Foundation, either version 3 of the License, or (at your option)
9 * Patchage is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with Patchage. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef PATCHAGE_WIDGET_HPP
19 #define PATCHAGE_WIDGET_HPP
22 #include <boost/utility.hpp>
25 class Widget
: public boost::noncopyable
{
27 Widget(Glib::RefPtr
<Gnome::Glade::Xml
> xml
, const std::string
& name
) {
36 void init(Glib::RefPtr
<Gnome::Glade::Xml
> xml
, const std::string
& name
)
38 xml
->get_widget(name
.c_str(), _me
);
41 void destroy() { delete _me
; }
43 W
* get() { return _me
; }
44 const W
* get() const { return _me
; }
45 W
* operator->() { return _me
; }
46 const W
* operator->() const { return _me
; }
47 W
& operator*() { return *_me
; }
48 const W
& operator*() const { return *_me
; }
55 #endif // PATCHAGE_WIDGET_HPP