/[svn]/gigedit/trunk/src/gigedit/compat.h
ViewVC logotype

Contents of /gigedit/trunk/src/gigedit/compat.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2507 - (show annotations) (download) (as text)
Sun Jan 12 19:37:55 2014 UTC (10 years, 2 months ago) by persson
File MIME type: text/x-c++hdr
File size: 3315 byte(s)
* added dialog for editing the CtrlTrigger and Legato midi rules

1 /* -*- c++ -*-
2 * Copyright (C) 2011-2014 Andreas Persson
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2, or (at
7 * your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with program; see the file COPYING. If not, write to the Free
16 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17 * 02110-1301 USA.
18 */
19
20 #ifndef GIGEDIT_COMPAT_H
21 #define GIGEDIT_COMPAT_H
22
23
24 // 2.10
25
26 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 10) || GTKMM_MAJOR_VERSION < 2
27 #define create_cairo_context() \
28 gobj() ? Cairo::RefPtr<Cairo::Context>( \
29 new Cairo::Context(gdk_cairo_create(get_window()->gobj()))) : \
30 Cairo::RefPtr<Cairo::Context>()
31 #endif
32
33
34 // 2.12
35
36 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 12) || GTKMM_MAJOR_VERSION < 2
37 #include <gtkmm/cellrenderertext.h>
38 namespace Gtk {
39 // this is not a real spin cell renderer, instead it's just text,
40 // extended with a property for storing an adjustment
41 class CellRendererSpin : public CellRendererText {
42 private:
43 Adjustment* adj;
44 struct Proxy {
45 Adjustment*& adj;
46 Proxy(Adjustment*& adj) : adj(adj) { }
47 const Adjustment* get_value() const { return adj; }
48 void operator=(Adjustment* x) { adj = x; }
49 };
50 public:
51 Proxy property_adjustment() const {
52 return const_cast<Adjustment*&>(adj);
53 }
54 };
55 }
56 #endif
57
58
59 // 2.18
60
61 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 18) || GTKMM_MAJOR_VERSION < 2
62 #define set_can_focus() set_flags(Gtk::CAN_FOCUS)
63 #define set_can_default() set_flags(Gtk::CAN_DEFAULT)
64 #endif
65
66
67 // 2.21.9
68
69 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION == 21 && GTKMM_MICRO_VERSION < 9) || \
70 (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 21) || GTKMM_MAJOR_VERSION < 2
71 #define ALIGN_START ALIGN_LEFT
72 #endif
73
74
75 // 2.24
76
77 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2
78 #define get_first_cell() get_first_cell_renderer()
79 #endif
80
81
82 // 3.0
83
84 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
85 #include <cairomm/context.h>
86 #include <gdkmm/color.h>
87
88 namespace Gdk {
89 typedef Color RGBA;
90
91 namespace Cairo {
92 void set_source_rgba(const ::Cairo::RefPtr< ::Cairo::Context >& context,
93 const Gdk::RGBA& color);
94 }
95 }
96 #endif
97
98
99 // glibmm 2.31.2
100
101 #if (GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION == 31 && GLIBMM_MICRO_VERSION < 2) || \
102 (GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION < 31) || GLIBMM_MAJOR_VERSION < 2
103
104 namespace Glib {
105 namespace Threads {
106 using Glib::Thread;
107 using Glib::Mutex;
108 using Glib::Cond;
109 }
110 }
111
112 #define OLD_THREADS
113
114 #endif
115
116 #endif

  ViewVC Help
Powered by ViewVC