summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-16 04:08:14 +0000
committerDavid Robillard <d@drobilla.net>2009-11-16 04:08:14 +0000
commit4ae2cca91a7482d23837f27b4c5130b0dbde98f3 (patch)
treebf5182fdae8d4dc0aefeb685371643acb8bb128a /src
parent720dc98574c6ec13f3d9c61d67a7144cb8200a2c (diff)
downloadingen-4ae2cca91a7482d23837f27b4c5130b0dbde98f3.tar.gz
ingen-4ae2cca91a7482d23837f27b4c5130b0dbde98f3.tar.bz2
ingen-4ae2cca91a7482d23837f27b4c5130b0dbde98f3.zip
Make all windows respond to ctrl+w.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2269 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/ConnectWindow.cpp2
-rw-r--r--src/gui/ConnectWindow.hpp3
-rw-r--r--src/gui/LoadPatchWindow.hpp1
-rw-r--r--src/gui/LoadPluginWindow.cpp2
-rw-r--r--src/gui/LoadPluginWindow.hpp3
-rw-r--r--src/gui/LoadRemotePatchWindow.cpp4
-rw-r--r--src/gui/LoadRemotePatchWindow.hpp3
-rw-r--r--src/gui/MessagesWindow.cpp2
-rw-r--r--src/gui/MessagesWindow.hpp7
-rw-r--r--src/gui/NewSubpatchWindow.cpp2
-rw-r--r--src/gui/NewSubpatchWindow.hpp6
-rw-r--r--src/gui/NodeControlWindow.hpp6
-rw-r--r--src/gui/NodePropertiesWindow.cpp2
-rw-r--r--src/gui/NodePropertiesWindow.hpp4
-rw-r--r--src/gui/PatchPropertiesWindow.cpp2
-rw-r--r--src/gui/PatchPropertiesWindow.hpp5
-rw-r--r--src/gui/PatchTreeWindow.cpp16
-rw-r--r--src/gui/PatchTreeWindow.hpp4
-rw-r--r--src/gui/PatchWindow.cpp2
-rw-r--r--src/gui/PatchWindow.hpp5
-rw-r--r--src/gui/PortPropertiesWindow.cpp2
-rw-r--r--src/gui/PortPropertiesWindow.hpp3
-rw-r--r--src/gui/RenameWindow.cpp2
-rw-r--r--src/gui/RenameWindow.hpp4
-rw-r--r--src/gui/UploadPatchWindow.cpp2
-rw-r--r--src/gui/UploadPatchWindow.hpp3
-rw-r--r--src/gui/Window.cpp37
-rw-r--r--src/gui/Window.hpp77
-rw-r--r--src/gui/WindowFactory.cpp3
-rw-r--r--src/gui/WindowFactory.hpp12
-rw-r--r--src/gui/wscript1
31 files changed, 170 insertions, 57 deletions
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 6bd0108e..69687b32 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -59,7 +59,7 @@ namespace GUI {
ConnectWindow::ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
- : Gtk::Dialog(cobject)
+ : Dialog(cobject)
, _xml(xml)
, _mode(CONNECT_REMOTE)
, _ping_id(-1)
diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp
index 2eab473c..42332813 100644
--- a/src/gui/ConnectWindow.hpp
+++ b/src/gui/ConnectWindow.hpp
@@ -29,6 +29,7 @@
#include <libglademm.h>
#include "raul/SharedPtr.hpp"
#include "client/ThreadedSigClientInterface.hpp"
+#include "Window.hpp"
using Ingen::Client::SigClientInterface;
namespace Ingen { class Engine; class QueuedEngineInterface; }
@@ -46,7 +47,7 @@ class App;
*
* \ingroup GUI
*/
-class ConnectWindow : public Gtk::Dialog
+class ConnectWindow : public Dialog
{
public:
ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml);
diff --git a/src/gui/LoadPatchWindow.hpp b/src/gui/LoadPatchWindow.hpp
index 3885cc20..df0c982d 100644
--- a/src/gui/LoadPatchWindow.hpp
+++ b/src/gui/LoadPatchWindow.hpp
@@ -22,6 +22,7 @@
#include <gtkmm.h>
#include "raul/SharedPtr.hpp"
#include "interface/GraphObject.hpp"
+#include "Window.hpp"
using namespace Ingen::Shared;
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 312d735b..f4336b7d 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -37,7 +37,7 @@ namespace Ingen {
namespace GUI {
LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
- : Gtk::Window(cobject)
+ : Window(cobject)
, _plugin_name_offset(0)
, _has_shown(false)
, _refresh_list(true)
diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp
index 37a1da83..7a3bd335 100644
--- a/src/gui/LoadPluginWindow.hpp
+++ b/src/gui/LoadPluginWindow.hpp
@@ -26,6 +26,7 @@
#include "raul/Table.hpp"
#include "interface/GraphObject.hpp"
#include "client/ClientStore.hpp"
+#include "Window.hpp"
using namespace Ingen::Shared;
@@ -44,7 +45,7 @@ namespace GUI {
*
* \ingroup GUI
*/
-class LoadPluginWindow : public Gtk::Window
+class LoadPluginWindow : public Window
{
public:
LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml);
diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp
index 149648c8..b992cdd5 100644
--- a/src/gui/LoadRemotePatchWindow.cpp
+++ b/src/gui/LoadRemotePatchWindow.cpp
@@ -36,8 +36,8 @@ namespace GUI {
LoadRemotePatchWindow::LoadRemotePatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
-: Gtk::Dialog(cobject),
- _replace(true)
+ : Dialog(cobject)
+ , _replace(true)
{
xml->get_widget("load_remote_patch_treeview", _treeview);
xml->get_widget("load_remote_patch_uri_entry", _uri_entry);
diff --git a/src/gui/LoadRemotePatchWindow.hpp b/src/gui/LoadRemotePatchWindow.hpp
index 13c6a6f1..3043db73 100644
--- a/src/gui/LoadRemotePatchWindow.hpp
+++ b/src/gui/LoadRemotePatchWindow.hpp
@@ -22,6 +22,7 @@
#include <gtkmm.h>
#include "raul/SharedPtr.hpp"
#include "interface/GraphObject.hpp"
+#include "Window.hpp"
using namespace Ingen::Shared;
namespace Ingen {
@@ -54,7 +55,7 @@ public:
*
* \ingroup GUI
*/
-class LoadRemotePatchWindow : public Gtk::Dialog
+class LoadRemotePatchWindow : public Dialog
{
public:
LoadRemotePatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml);
diff --git a/src/gui/MessagesWindow.cpp b/src/gui/MessagesWindow.cpp
index 0c8719fe..930eaa06 100644
--- a/src/gui/MessagesWindow.cpp
+++ b/src/gui/MessagesWindow.cpp
@@ -24,7 +24,7 @@ using std::string;
MessagesWindow::MessagesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml)
-: Gtk::Window(cobject)
+ : Window(cobject)
{
glade_xml->get_widget("messages_textview", _textview);
glade_xml->get_widget("messages_clear_button", _clear_button);
diff --git a/src/gui/MessagesWindow.hpp b/src/gui/MessagesWindow.hpp
index 95818e2b..4c5d3e1e 100644
--- a/src/gui/MessagesWindow.hpp
+++ b/src/gui/MessagesWindow.hpp
@@ -21,8 +21,7 @@
#include <string>
#include <gtkmm.h>
#include <libglademm/xml.h>
-using std::string;
-
+#include "Window.hpp"
namespace Ingen {
namespace GUI {
@@ -35,12 +34,12 @@ namespace GUI {
*
* \ingroup GUI
*/
-class MessagesWindow : public Gtk::Window
+class MessagesWindow : public Window
{
public:
MessagesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
- void post(const string& str);
+ void post(const std::string& str);
private:
void clear_clicked();
diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp
index 0442d57b..ac137857 100644
--- a/src/gui/NewSubpatchWindow.cpp
+++ b/src/gui/NewSubpatchWindow.cpp
@@ -30,7 +30,7 @@ namespace GUI {
NewSubpatchWindow::NewSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
-: Gtk::Window(cobject)
+ : Window(cobject)
{
xml->get_widget("new_subpatch_name_entry", _name_entry);
xml->get_widget("new_subpatch_message_label", _message_label);
diff --git a/src/gui/NewSubpatchWindow.hpp b/src/gui/NewSubpatchWindow.hpp
index 8def3104..5f493582 100644
--- a/src/gui/NewSubpatchWindow.hpp
+++ b/src/gui/NewSubpatchWindow.hpp
@@ -22,10 +22,12 @@
#include <gtkmm.h>
#include "raul/SharedPtr.hpp"
#include "interface/GraphObject.hpp"
-using namespace Ingen::Shared;
+#include "Window.hpp"
namespace Ingen {
+using namespace Shared;
+
namespace Client { class PatchModel; }
using Ingen::Client::PatchModel;
@@ -38,7 +40,7 @@ namespace GUI {
*
* \ingroup GUI
*/
-class NewSubpatchWindow : public Gtk::Window
+class NewSubpatchWindow : public Window
{
public:
NewSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml);
diff --git a/src/gui/NodeControlWindow.hpp b/src/gui/NodeControlWindow.hpp
index 9044abf2..e8c1c064 100644
--- a/src/gui/NodeControlWindow.hpp
+++ b/src/gui/NodeControlWindow.hpp
@@ -18,13 +18,11 @@
#ifndef NODECONTROLWINDOW_H
#define NODECONTROLWINDOW_H
-#include <vector>
-#include <string>
#include <gtkmm.h>
#include <libglademm.h>
#include <sigc++/sigc++.h>
#include "raul/SharedPtr.hpp"
-using std::string; using std::vector;
+#include "Window.hpp"
namespace Ingen { namespace Client {
class NodeModel;
@@ -42,7 +40,7 @@ class ControlPanel;
*
* \ingroup GUI
*/
-class NodeControlWindow : public Gtk::Window
+class NodeControlWindow : public Window
{
public:
NodeControlWindow(SharedPtr<NodeModel> node, uint32_t poly);
diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp
index 0ce607fb..39115bd2 100644
--- a/src/gui/NodePropertiesWindow.cpp
+++ b/src/gui/NodePropertiesWindow.cpp
@@ -29,7 +29,7 @@ namespace GUI {
NodePropertiesWindow::NodePropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml)
-: Gtk::Window(cobject)
+ : Window(cobject)
{
glade_xml->get_widget("node_properties_path_label", _node_path_label);
glade_xml->get_widget("node_properties_polyphonic_checkbutton", _node_polyphonic_toggle);
diff --git a/src/gui/NodePropertiesWindow.hpp b/src/gui/NodePropertiesWindow.hpp
index 3774ea9a..fb540816 100644
--- a/src/gui/NodePropertiesWindow.hpp
+++ b/src/gui/NodePropertiesWindow.hpp
@@ -22,6 +22,8 @@
#include <libglademm.h>
#include "raul/SharedPtr.hpp"
#include "client/NodeModel.hpp"
+#include "Window.hpp"
+
using namespace Ingen::Client;
namespace Ingen {
@@ -34,7 +36,7 @@ namespace GUI {
*
* \ingroup GUI
*/
-class NodePropertiesWindow : public Gtk::Window
+class NodePropertiesWindow : public Window
{
public:
NodePropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
diff --git a/src/gui/PatchPropertiesWindow.cpp b/src/gui/PatchPropertiesWindow.cpp
index ee0de379..0ece28f4 100644
--- a/src/gui/PatchPropertiesWindow.cpp
+++ b/src/gui/PatchPropertiesWindow.cpp
@@ -29,7 +29,7 @@ namespace GUI {
PatchPropertiesWindow::PatchPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml)
-: Gtk::Window(cobject)
+ : Window(cobject)
{
glade_xml->get_widget("properties_name_entry", _name_entry);
glade_xml->get_widget("properties_author_entry", _author_entry);
diff --git a/src/gui/PatchPropertiesWindow.hpp b/src/gui/PatchPropertiesWindow.hpp
index fad14c22..3683fdd0 100644
--- a/src/gui/PatchPropertiesWindow.hpp
+++ b/src/gui/PatchPropertiesWindow.hpp
@@ -18,11 +18,10 @@
#ifndef PATCHPROPERTIESWINDOW_H
#define PATCHPROPERTIESWINDOW_H
-#include <string>
#include <gtkmm.h>
#include <libglademm/xml.h>
#include "raul/SharedPtr.hpp"
-using std::string;
+#include "Window.hpp"
namespace Ingen { namespace Client { class PatchModel; } }
using Ingen::Client::PatchModel;
@@ -37,7 +36,7 @@ namespace GUI {
*
* \ingroup GUI
*/
-class PatchPropertiesWindow : public Gtk::Window
+class PatchPropertiesWindow : public Window
{
public:
PatchPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp
index a7fb4495..b3b0f682 100644
--- a/src/gui/PatchTreeWindow.cpp
+++ b/src/gui/PatchTreeWindow.cpp
@@ -33,7 +33,7 @@ namespace GUI {
PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gnome::Glade::Xml>& xml)
- : Gtk::Window(cobject)
+ : Window(cobject)
, _enable_signal(true)
{
xml->get_widget_derived("patches_treeview", _patches_treeview);
@@ -56,8 +56,6 @@ PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject,
_patch_tree_selection = _patches_treeview->get_selection();
- //m_patch_tree_selection->signal_changed().connect(
- // sigc::mem_fun(this, &PatchTreeWindow::event_patch_selected));
_patches_treeview->signal_row_activated().connect(
sigc::mem_fun(this, &PatchTreeWindow::event_patch_activated));
enabled_renderer->signal_toggled().connect(
@@ -146,18 +144,6 @@ PatchTreeWindow::find_patch(Gtk::TreeModel::Children root, const Path& path)
return root.end();
}
-/*
-void
-PatchTreeWindow::event_patch_selected()
-{
- Gtk::TreeModel::iterator active = _patch_tree_selection->get_selected();
- if (active) {
- Gtk::TreeModel::Row row = *active;
- SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col];
- }
-}
-*/
-
/** Show the context menu for the selected patch in the patches treeview.
*/
diff --git a/src/gui/PatchTreeWindow.hpp b/src/gui/PatchTreeWindow.hpp
index 0a71309c..bba3b1ac 100644
--- a/src/gui/PatchTreeWindow.hpp
+++ b/src/gui/PatchTreeWindow.hpp
@@ -20,6 +20,7 @@
#include <gtkmm.h>
#include <libglademm.h>
+#include "Window.hpp"
namespace Raul { class Path; }
@@ -37,7 +38,7 @@ class PatchTreeView;
*
* \ingroup GUI
*/
-class PatchTreeWindow : public Gtk::Window
+class PatchTreeWindow : public Window
{
public:
PatchTreeWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
@@ -54,7 +55,6 @@ public:
void show_patch_menu(GdkEventButton* ev);
protected:
- //void event_patch_selected();
void event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col);
void event_patch_enabled_toggled(const Glib::ustring& path_str);
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index 31aa11bf..a2992215 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -51,7 +51,7 @@ static const int STATUS_CONTEXT_PATCH = 1;
static const int STATUS_CONTEXT_HOVER = 2;
PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
- : Gtk::Window(cobject)
+ : Window(cobject)
, _enable_signal(true)
, _position_stored(false)
, _x(0)
diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp
index 0dbf1316..0d997ab7 100644
--- a/src/gui/PatchWindow.hpp
+++ b/src/gui/PatchWindow.hpp
@@ -18,12 +18,11 @@
#ifndef PATCHWINDOW_H
#define PATCHWINDOW_H
-#include <string>
-#include <list>
#include <gtkmm.h>
#include <libglademm/xml.h>
#include <libglademm.h>
#include "raul/SharedPtr.hpp"
+#include "Window.hpp"
namespace Raul { class Path; }
@@ -54,7 +53,7 @@ class PatchView;
*
* \ingroup GUI
*/
-class PatchWindow : public Gtk::Window
+class PatchWindow : public Window
{
public:
PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml);
diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp
index 79db728e..8b5af899 100644
--- a/src/gui/PortPropertiesWindow.cpp
+++ b/src/gui/PortPropertiesWindow.cpp
@@ -33,7 +33,7 @@ namespace GUI {
PortPropertiesWindow::PortPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
- : Gtk::Window(cobject)
+ : Window(cobject)
//, _enable_signal(false)
{
xml->get_widget("port_properties_min_spinner", _min_spinner);
diff --git a/src/gui/PortPropertiesWindow.hpp b/src/gui/PortPropertiesWindow.hpp
index a9bfbc33..b8e71209 100644
--- a/src/gui/PortPropertiesWindow.hpp
+++ b/src/gui/PortPropertiesWindow.hpp
@@ -22,6 +22,7 @@
#include <libglademm.h>
#include "raul/SharedPtr.hpp"
#include "client/PortModel.hpp"
+#include "Window.hpp"
namespace Ingen {
namespace GUI {
@@ -33,7 +34,7 @@ namespace GUI {
*
* \ingroup GUI
*/
-class PortPropertiesWindow : public Gtk::Window
+class PortPropertiesWindow : public Window
{
public:
PortPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp
index a13ffd48..b6c41e68 100644
--- a/src/gui/RenameWindow.cpp
+++ b/src/gui/RenameWindow.cpp
@@ -31,7 +31,7 @@ namespace GUI {
RenameWindow::RenameWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml)
-: Gtk::Window(cobject)
+ : Window(cobject)
{
glade_xml->get_widget("rename_name_entry", _name_entry);
glade_xml->get_widget("rename_message_label", _message_label);
diff --git a/src/gui/RenameWindow.hpp b/src/gui/RenameWindow.hpp
index 9146fb01..0e014534 100644
--- a/src/gui/RenameWindow.hpp
+++ b/src/gui/RenameWindow.hpp
@@ -22,6 +22,8 @@
#include <libglademm.h>
#include "raul/SharedPtr.hpp"
#include "client/ObjectModel.hpp"
+#include "Window.hpp"
+
using Ingen::Client::ObjectModel;
namespace Ingen {
@@ -32,7 +34,7 @@ namespace GUI {
*
* \ingroup GUI
*/
-class RenameWindow : public Gtk::Window
+class RenameWindow : public Window
{
public:
RenameWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
diff --git a/src/gui/UploadPatchWindow.cpp b/src/gui/UploadPatchWindow.cpp
index c24de34c..08e5b726 100644
--- a/src/gui/UploadPatchWindow.cpp
+++ b/src/gui/UploadPatchWindow.cpp
@@ -41,7 +41,7 @@ namespace GUI {
UploadPatchWindow::UploadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
- : Gtk::Dialog(cobject)
+ : Dialog(cobject)
, _thread(NULL)
, _progress_pct(0)
, _response(0)
diff --git a/src/gui/UploadPatchWindow.hpp b/src/gui/UploadPatchWindow.hpp
index 8170629a..2c2d8aa9 100644
--- a/src/gui/UploadPatchWindow.hpp
+++ b/src/gui/UploadPatchWindow.hpp
@@ -26,6 +26,7 @@
#include "raul/Thread.hpp"
#include "raul/AtomicInt.hpp"
#include "client/PluginModel.hpp"
+#include "Window.hpp"
namespace Ingen {
@@ -62,7 +63,7 @@ private:
*
* \ingroup GUI
*/
-class UploadPatchWindow : public Gtk::Dialog
+class UploadPatchWindow : public Dialog
{
public:
UploadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml);
diff --git a/src/gui/Window.cpp b/src/gui/Window.cpp
new file mode 100644
index 00000000..0dd8888e
--- /dev/null
+++ b/src/gui/Window.cpp
@@ -0,0 +1,37 @@
+/* This file is part of Ingen.
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
+ * Ingen 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.
+ *
+ * Ingen 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 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.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "Window.hpp"
+
+namespace Ingen {
+namespace GUI {
+
+
+bool
+Window::key_press_handler(Gtk::Window* win, GdkEventKey* event)
+{
+ if (event->keyval == GDK_w && event->state & GDK_CONTROL_MASK) {
+ win->hide();
+ return true;
+ }
+ return false;
+}
+
+
+} // namespace GUI
+} // namespace Ingen
+
diff --git a/src/gui/Window.hpp b/src/gui/Window.hpp
new file mode 100644
index 00000000..b8bc0047
--- /dev/null
+++ b/src/gui/Window.hpp
@@ -0,0 +1,77 @@
+/* This file is part of Ingen.
+ * Copyright (C) 2009 Dave Robillard <http://drobilla.net>
+ *
+ * Ingen 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.
+ *
+ * Ingen 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 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.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef WINDOW_HPP
+#define WINDOW_HPP
+
+#include <gtkmm.h>
+#include <libglademm.h>
+
+namespace Raul { class Path; }
+
+namespace Ingen {
+
+namespace Client { class ClientStore; }
+
+namespace GUI {
+
+class PatchWindow;
+class PatchTreeView;
+
+
+/** Ingen GUI Window
+ * \ingroup GUI
+ */
+class Window : public Gtk::Window
+{
+public:
+ Window() : Gtk::Window() {}
+ Window(BaseObjectType* cobject) : Gtk::Window(cobject) {}
+
+ bool on_key_press_event(GdkEventKey* event) {
+ if (Ingen::GUI::Window::key_press_handler(this, event))
+ return true;
+ else
+ return Gtk::Window::on_key_press_event(event);
+ }
+
+ static bool key_press_handler(Gtk::Window* win, GdkEventKey* event);
+};
+
+
+/** Ingen GUI Dialog
+ * \ingroup GUI
+ */
+class Dialog : public Gtk::Dialog
+{
+public:
+ Dialog() : Gtk::Dialog() {}
+ Dialog(BaseObjectType* cobject) : Gtk::Dialog(cobject) {}
+
+ bool on_key_press_event(GdkEventKey* event) {
+ if (Ingen::GUI::Window::key_press_handler(this, event))
+ return true;
+ else
+ return Gtk::Dialog::on_key_press_event(event);
+ }
+};
+
+
+} // namespace GUI
+} // namespace Ingen
+
+#endif // WINDOW_HPP
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index 3610b095..4a948a36 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -15,6 +15,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string>
#include "ingen-config.h"
#include "client/PatchModel.hpp"
#include "App.hpp"
@@ -36,6 +37,8 @@
#include "UploadPatchWindow.hpp"
#endif
+using namespace std;
+
namespace Ingen {
namespace GUI {
diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp
index 5f733b93..dce08c96 100644
--- a/src/gui/WindowFactory.hpp
+++ b/src/gui/WindowFactory.hpp
@@ -73,12 +73,14 @@ public:
void present_controls(SharedPtr<NodeModel> node);
- void present_load_plugin(SharedPtr<PatchModel> patch, GraphObject::Properties data=GraphObject::Properties());
- void present_load_patch(SharedPtr<PatchModel> patch, GraphObject::Properties data=GraphObject::Properties());
- void present_load_remote_patch(SharedPtr<PatchModel> patch, GraphObject::Properties data=GraphObject::Properties());
+ typedef GraphObject::Properties Properties;
+
+ void present_load_plugin(SharedPtr<PatchModel> patch, Properties data=Properties());
+ void present_load_patch(SharedPtr<PatchModel> patch, Properties data=Properties());
+ void present_load_remote_patch(SharedPtr<PatchModel> patch, Properties data=Properties());
void present_upload_patch(SharedPtr<PatchModel> patch);
- void present_new_subpatch(SharedPtr<PatchModel> patch, GraphObject::Properties data=GraphObject::Properties());
- void present_load_subpatch(SharedPtr<PatchModel> patch, GraphObject::Properties data=GraphObject::Properties());
+ void present_new_subpatch(SharedPtr<PatchModel> patch, Properties data=Properties());
+ void present_load_subpatch(SharedPtr<PatchModel> patch, Properties data=Properties());
void present_rename(SharedPtr<ObjectModel> object);
void present_properties(SharedPtr<ObjectModel> object);
diff --git a/src/gui/wscript b/src/gui/wscript
index 6ae349c2..ddcba166 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -34,6 +34,7 @@ def build(bld):
RenameWindow.cpp
SubpatchModule.cpp
ThreadedLoader.cpp
+ Window.cpp
WindowFactory.cpp
gui.cpp
'''