1 |
persson |
2170 |
/* -*- c++ -*- |
2 |
persson |
2507 |
* Copyright (C) 2011-2014 Andreas Persson |
3 |
persson |
2170 |
* |
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 |
persson |
2507 |
// 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 |
persson |
2170 |
// 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 |
persson |
2579 |
#define ALIGN_END ALIGN_RIGHT |
73 |
persson |
2170 |
#endif |
74 |
|
|
|
75 |
|
|
|
76 |
persson |
2507 |
// 2.24 |
77 |
|
|
|
78 |
|
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 |
79 |
|
|
#define get_first_cell() get_first_cell_renderer() |
80 |
|
|
#endif |
81 |
|
|
|
82 |
|
|
|
83 |
persson |
2170 |
// 3.0 |
84 |
|
|
|
85 |
|
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
86 |
|
|
#include <cairomm/context.h> |
87 |
|
|
#include <gdkmm/color.h> |
88 |
|
|
|
89 |
|
|
namespace Gdk { |
90 |
|
|
typedef Color RGBA; |
91 |
|
|
|
92 |
|
|
namespace Cairo { |
93 |
|
|
void set_source_rgba(const ::Cairo::RefPtr< ::Cairo::Context >& context, |
94 |
|
|
const Gdk::RGBA& color); |
95 |
|
|
} |
96 |
|
|
} |
97 |
|
|
#endif |
98 |
|
|
|
99 |
persson |
2325 |
|
100 |
|
|
// glibmm 2.31.2 |
101 |
|
|
|
102 |
|
|
#if (GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION == 31 && GLIBMM_MICRO_VERSION < 2) || \ |
103 |
|
|
(GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION < 31) || GLIBMM_MAJOR_VERSION < 2 |
104 |
|
|
|
105 |
|
|
namespace Glib { |
106 |
|
|
namespace Threads { |
107 |
|
|
using Glib::Thread; |
108 |
|
|
using Glib::Mutex; |
109 |
|
|
using Glib::Cond; |
110 |
|
|
} |
111 |
|
|
} |
112 |
|
|
|
113 |
|
|
#define OLD_THREADS |
114 |
|
|
|
115 |
persson |
2170 |
#endif |
116 |
persson |
2325 |
|
117 |
|
|
#endif |