Ardour  9.0-pre0-582-g084a23a80d
main.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_MAIN_H
4 #define _GTKMM_MAIN_H
5 
6 
7 #include <glibmm/ustring.h>
8 #include <sigc++/sigc++.h>
9 
10 /* $Id: main.hg,v 1.9 2005/02/13 20:48:35 murrayc Exp $ */
11 
12 /* main.h
13  *
14  * Copyright (C) 1998-2003 The gtkmm Development Team
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free
28  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 
31 
32 #include <sigc++/sigc++.h>
33 #include <gdkmm/types.h> //For GdkEventKey
34 #include <glibmm/optioncontext.h>
35 
36 
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
38 extern "C"
39 {
40 typedef struct _GtkWidget GtkWidget;
41 }
42 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
43 
44 namespace Gtk
45 {
46 
47 class Widget;
48 class Window;
49 
50 //**********************************************************************
51 
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53 //Actually, I'd like to just keep these out of the alphabetical list. murrayc.
54 
55 #ifndef GTKMM_DISABLE_DEPRECATED
56 
57 /* Run Signal Class (internal)
58  * @deprecated This was removed in gtkmm-3.0 because it is not useful.
59  */
60 class RunSig
61 {
62 public:
63  typedef sigc::slot<void> SlotType;
64 
65  sigc::connection connect(const SlotType& slot);
66 
67 protected:
68  static gboolean gtk_callback(gpointer data);
69 };
70 
74 class QuitSig
75 {
76 public:
77  typedef sigc::slot<bool> SlotType;
78 
79  sigc::connection connect(const SlotType& slot, guint main_level = 0);
80 
81 protected:
82  static gboolean gtk_callback(gpointer data); //gtk+ calls this, which then calls our slot.
83 };
84 #endif // GTKMM_DISABLE_DEPRECATED
85 
86 
88 class KeySnooperSig
89 {
90 public:
91  typedef sigc::slot<int, Widget*, GdkEventKey*> SlotType;
92 
93  sigc::connection connect(const SlotType& slot);
94 
95 protected:
96  static int gtk_callback(GtkWidget* widget, GdkEventKey* event, gpointer data);
97 };
98 
99 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
100 
101 
102 //**********************************************************************
103 
127 class Main : public sigc::trackable
128 {
129 public:
130 
131  //This offers the same functionality as gtk_init_with_args():
150  Main(int& argc, char**& argv, Glib::OptionContext& option_context);
151 
160  Main(int* argc, char*** argv, bool set_locale = true);
161 
163  Main(int& argc, char**& argv, bool set_locale = true);
164 
165 
166  virtual ~Main();
167 
169  static Gtk::Main* instance();
170 
176  static void run();
177 
184  static void run(Window& window);
185 
188  static void quit();
189 
190  static guint level();
191 
192  //This attempts to provide the same functionality as gtk_get_option_group():
203  static void add_gtk_option_group(Glib::OptionContext& option_context, bool open_default_display = true);
204 
213  static bool iteration(bool blocking = true);
214 
228  static bool events_pending();
229 
230 #ifndef GTKMM_DISABLE_DEPRECATED
231 
235  static RunSig& signal_run();
236 
253  static QuitSig& signal_quit();
254 #endif // GTKMM_DISABLE_DEPRECATED
255 
256 
267  static KeySnooperSig& signal_key_snooper();
268 
269  // Initialize table of wrap_new functions.
270  // Doesn't need an instance of Gtk::Main.
271  static void init_gtkmm_internals();
272 
273 protected:
274  Main();
275 
276  void init(int* argc, char*** argv, bool set_locale);
277  // TODO: implement this to use the new Glib::OptionEntry argument parsing classes.
278  //void init(int* argc, char*** argv, const std::string& parameter_string, const Glib::ArrayHandle<const Glib::OptionEntry&>& entries, const std::string& translation_domain);
279 
280  virtual void run_impl();
281  virtual void quit_impl();
282  virtual guint level_impl();
283  virtual bool iteration_impl(bool blocking);
284  virtual bool events_pending_impl();
285 
286  // Signal handlers:
287  virtual void on_window_hide();
288 
289  // Signal proxies:
290 #ifndef GTKMM_DISABLE_DEPRECATED
291 
292  static RunSig signal_run_;
293  static QuitSig signal_quit_;
294 #endif // GTKMM_DISABLE_DEPRECATED
295 
296 
297  static KeySnooperSig signal_key_snooper_;
298 
299 private:
300  static Main* instance_;
301 };
302 
303 } // namespace Gtk
304 
305 
306 #endif /* _GTKMM_MAIN_H */
307 
static void add_gtk_option_group(Glib::OptionContext &option_context, bool open_default_display=true)
virtual void run_impl()
static bool events_pending()
Main(int &argc, char **&argv, bool set_locale=true)
See Main(int* argc, char*** argv, bool set_locale).
static RunSig signal_run_
Definition: main.h:292
virtual ~Main()
virtual bool events_pending_impl()
virtual bool iteration_impl(bool blocking)
static void run()
void init(int *argc, char ***argv, bool set_locale)
virtual void quit_impl()
static guint level()
virtual void on_window_hide()
static void quit()
static Gtk::Main * instance()
Access to the one global instance of Gtk::Main.
static KeySnooperSig signal_key_snooper_
Definition: main.h:297
static void run(Window &window)
static void init_gtkmm_internals()
virtual guint level_impl()
static KeySnooperSig & signal_key_snooper()
static bool iteration(bool blocking=true)
static QuitSig & signal_quit()
Main(int *argc, char ***argv, bool set_locale=true)
static RunSig & signal_run()
static QuitSig signal_quit_
Definition: main.h:293
static Main * instance_
Definition: main.h:300
Main(int &argc, char **&argv, Glib::OptionContext &option_context)
Definition: Window.h:41
Definition: ardour_ui.h:188