1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2011-2014 Andreas Persson |
* Copyright (C) 2011-2017 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
20 |
#ifndef GIGEDIT_COMPAT_H |
#ifndef GIGEDIT_COMPAT_H |
21 |
#define GIGEDIT_COMPAT_H |
#define GIGEDIT_COMPAT_H |
22 |
|
|
23 |
|
#ifdef GTK_HEADER_FILE |
24 |
|
# include GTK_HEADER_FILE(gtk.h) |
25 |
|
#else |
26 |
|
# include <gtk/gtk.h> |
27 |
|
#endif |
28 |
|
|
29 |
|
#ifdef GLIBMM_HEADER_FILE |
30 |
|
# include GLIBMM_HEADER_FILE(glibmmconfig.h) |
31 |
|
#else |
32 |
|
# include <glibmmconfig.h> |
33 |
|
#endif |
34 |
|
|
35 |
|
#ifdef PANGOMM_HEADER_FILE |
36 |
|
# include PANGOMM_HEADER_FILE(pangommconfig.h) |
37 |
|
#else |
38 |
|
# include <pangommconfig.h> |
39 |
|
#endif |
40 |
|
|
41 |
|
#ifdef CAIROMM_HEADER_FILE |
42 |
|
# include CAIROMM_HEADER_FILE(cairommconfig.h) |
43 |
|
#else |
44 |
|
# include <cairommconfig.h> |
45 |
|
#endif |
46 |
|
|
47 |
|
#ifdef GTKMM_HEADER_FILE |
48 |
|
# include GTKMM_HEADER_FILE(gtkmmconfig.h) |
49 |
|
#else |
50 |
|
# include <gtkmmconfig.h> |
51 |
|
#endif |
52 |
|
|
53 |
|
#ifndef HAS_PANGOMM_CPP11_ENUMS // pangomm > 2.40 : <- just a "guess" |
54 |
|
# if PANGOMM_MAJOR_VERSION > 2 || (PANGOMM_MAJOR_VERSION == 2 && PANGOMM_MINOR_VERSION > 40) |
55 |
|
# define HAS_PANGOMM_CPP11_ENUMS 1 |
56 |
|
# else |
57 |
|
# define HAS_PANGOMM_CPP11_ENUMS 0 |
58 |
|
# endif |
59 |
|
#endif |
60 |
|
|
61 |
|
// Gtk::UIManager had been replaced by Gtk::Builder in GTKMM 3 and removed in GTKMM 4 |
62 |
|
// Gtk::ActionGroup had been replaced by Gio::ActionGroup in GTKMM 3 and removed in GTKMM 4 |
63 |
|
#if !defined(USE_GTKMM_BUILDER) || !defined(USE_GLIB_ACTION) // gtkmm > 3.22 : |
64 |
|
# if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
65 |
|
# define USE_GTKMM_BUILDER 1 |
66 |
|
# define USE_GLIB_ACTION 1 |
67 |
|
# else |
68 |
|
# define USE_GTKMM_BUILDER 0 |
69 |
|
# define USE_GLIB_ACTION 0 |
70 |
|
# endif |
71 |
|
#endif |
72 |
|
|
73 |
|
#ifndef HAS_GDKMM_SEAT |
74 |
|
# if GTKMM_MAJOR_VERSION > 2 || (GTKMM_MAJOR_VERSION == 2 && (GTKMM_MINOR_VERSION > 99 || (GTKMM_MINOR_VERSION == 99 && GTKMM_MICRO_VERSION >= 1))) // GTKM >= 2.99.1 |
75 |
|
# define HAS_GDKMM_SEAT 1 |
76 |
|
# else |
77 |
|
# define HAS_GDKMM_SEAT 0 |
78 |
|
# endif |
79 |
|
#endif |
80 |
|
|
81 |
|
#ifndef HAS_GTKMM_CPP11_ENUMS // gtkmm > 3.22 |
82 |
|
# if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
83 |
|
# define HAS_GTKMM_CPP11_ENUMS 1 |
84 |
|
# else |
85 |
|
# define HAS_GTKMM_CPP11_ENUMS 0 |
86 |
|
# endif |
87 |
|
#endif |
88 |
|
|
89 |
|
// alignment.h had been removed in GTKMM 4 |
90 |
|
#ifndef HAS_GTKMM_ALIGNMENT // gtkmm > 3.22 : |
91 |
|
# if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
92 |
|
# define HAS_GTKMM_ALIGNMENT 0 |
93 |
|
# else |
94 |
|
# define HAS_GTKMM_ALIGNMENT 1 |
95 |
|
# endif |
96 |
|
#endif |
97 |
|
|
98 |
|
// Gtk::Table had been replaced by Gtk::Grid in GTKMM 3 and removed in GTKMM 4 |
99 |
|
// stock.h had been removed in GTKMM 4 |
100 |
|
// Gtk::VBox, Gtk::HBox and Gtk::HButtonBox had been replaced by Gtk::Box in GTKMM 3 and removed in GTKMM 4 |
101 |
|
#if !defined(USE_GTKMM_GRID) || !defined(HAS_GTKMM_STOCK) || !defined(USE_GTKMM_BOX) || !defined(USE_GTKMM_PANED) // gtkmm > 3.22 : |
102 |
|
# if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && GTKMM_MINOR_VERSION > 22) |
103 |
|
# define USE_GTKMM_GRID 1 |
104 |
|
# define HAS_GTKMM_STOCK 0 |
105 |
|
# define USE_GTKMM_BOX 1 |
106 |
|
# define USE_GTKMM_PANED 1 |
107 |
|
# else |
108 |
|
# define USE_GTKMM_GRID 0 |
109 |
|
# define HAS_GTKMM_STOCK 1 |
110 |
|
# define USE_GTKMM_BOX 0 |
111 |
|
# define USE_GTKMM_PANED 0 |
112 |
|
# endif |
113 |
|
#endif |
114 |
|
|
115 |
|
// Gtk::Widget::show_all_children() had been removed in GTKMM 3.89.4 |
116 |
|
#ifndef HAS_GTKMM_SHOW_ALL_CHILDREN |
117 |
|
# if GTKMM_MAJOR_VERSION > 3 || (GTKMM_MAJOR_VERSION == 3 && (GTKMM_MINOR_VERSION > 89 || (GTKMM_MINOR_VERSION == 89 && GTKMM_MICRO_VERSION >= 4))) |
118 |
|
# define HAS_GTKMM_SHOW_ALL_CHILDREN 0 |
119 |
|
# else |
120 |
|
# define HAS_GTKMM_SHOW_ALL_CHILDREN 1 |
121 |
|
# endif |
122 |
|
#endif |
123 |
|
|
124 |
|
// enums have been renamed in cairomm 1.15.4 |
125 |
|
#ifndef HAS_CAIROMM_CPP11_ENUMS // cairomm >= 1.15.4 : |
126 |
|
# if CAIROMM_MAJOR_VERSION > 1 || (CAIROMM_MAJOR_VERSION == 1 && (CAIROMM_MINOR_VERSION > 15 || (CAIROMM_MINOR_VERSION == 15 && CAIROMM_MICRO_VERSION >= 4))) |
127 |
|
# define HAS_CAIROMM_CPP11_ENUMS 1 |
128 |
|
# else |
129 |
|
# define HAS_CAIROMM_CPP11_ENUMS 0 |
130 |
|
# endif |
131 |
|
#endif |
132 |
|
|
133 |
|
#include <gtkmm/buttonbox.h> |
134 |
|
#include <gtkmm/scale.h> |
135 |
|
|
136 |
|
#if USE_GTKMM_BOX |
137 |
|
# include <gtkmm/box.h> |
138 |
|
class HBox : public Gtk::Box { |
139 |
|
public: |
140 |
|
HBox() : Gtk::Box(Gtk::Orientation::HORIZONTAL) {} |
141 |
|
}; |
142 |
|
|
143 |
|
class VBox : public Gtk::Box { |
144 |
|
public: |
145 |
|
VBox() : Gtk::Box(Gtk::Orientation::VERTICAL) {} |
146 |
|
}; |
147 |
|
|
148 |
|
class HButtonBox : public Gtk::ButtonBox { |
149 |
|
public: |
150 |
|
HButtonBox() : Gtk::ButtonBox(Gtk::Orientation::HORIZONTAL) {} |
151 |
|
}; |
152 |
|
|
153 |
|
class HScale : public Gtk::Scale { |
154 |
|
public: |
155 |
|
HScale() : Gtk::Scale(Gtk::Orientation::HORIZONTAL) {} |
156 |
|
HScale(const Glib::RefPtr<Gtk::Adjustment>& adjustment) : Gtk::Scale(adjustment, Gtk::Orientation::HORIZONTAL) {} |
157 |
|
}; |
158 |
|
#else |
159 |
|
# include <gtkmm/hvbox.h> |
160 |
|
typedef Gtk::HBox HBox; |
161 |
|
typedef Gtk::VBox VBox; |
162 |
|
typedef Gtk::HButtonBox HButtonBox; |
163 |
|
typedef Gtk::HScale HScale; |
164 |
|
#endif // USE_GTKMM_BOX |
165 |
|
|
166 |
|
#if USE_GTKMM_PANED |
167 |
|
# include <gtkmm/paned.h> |
168 |
|
namespace Gtk { |
169 |
|
class HPaned : public Paned { |
170 |
|
public: |
171 |
|
HPaned() : Paned(Orientation::HORIZONTAL) {} |
172 |
|
}; |
173 |
|
} |
174 |
|
#endif // USE_GTKMM_PANED |
175 |
|
|
176 |
|
#if USE_GLIB_ACTION |
177 |
|
# include <giomm/simpleactiongroup.h> |
178 |
|
# include <giomm/simpleaction.h> |
179 |
|
typedef Gio::SimpleActionGroup ActionGroup; |
180 |
|
typedef Gio::SimpleAction Action; |
181 |
|
#else |
182 |
|
# include <gtkmm/actiongroup.h> |
183 |
|
# include <gtkmm/action.h> |
184 |
|
typedef Gtk::ActionGroup ActionGroup; |
185 |
|
typedef Gtk::Action Action; |
186 |
|
#endif // USE_GLIB_ACTION |
187 |
|
|
188 |
|
#if HAS_PANGOMM_CPP11_ENUMS |
189 |
|
# include <pangomm/layout.h> |
190 |
|
namespace Pango { |
191 |
|
const Alignment ALIGN_LEFT = Alignment::LEFT; |
192 |
|
const Alignment ALIGN_CENTER = Alignment::CENTER; |
193 |
|
const Alignment ALIGN_RIGHT = Alignment::RIGHT; |
194 |
|
} |
195 |
|
#endif // HAS_PANGOMM_CPP11_ENUMS |
196 |
|
|
197 |
|
#if HAS_GTKMM_CPP11_ENUMS |
198 |
|
# include <gdkmm/types.h> |
199 |
|
# include <gdkmm/cursor.h> |
200 |
|
# include <gdkmm/pixbuf.h> |
201 |
|
# include <gtkmm/enums.h> |
202 |
|
# include <gtkmm/box.h> |
203 |
|
# include <gtkmm/icontheme.h> |
204 |
|
# include <gtkmm/messagedialog.h> |
205 |
|
# include <gtkmm/dialog.h> |
206 |
|
# include <gtkmm/textview.h> |
207 |
|
# include <gtkmm/filechooser.h> |
208 |
|
namespace Gdk { |
209 |
|
const Cursor::Type SB_H_DOUBLE_ARROW = Cursor::Type::SB_H_DOUBLE_ARROW; |
210 |
|
const Cursor::Type FLEUR = Cursor::Type::FLEUR; |
211 |
|
const InterpType INTERP_NEAREST = InterpType::NEAREST; |
212 |
|
const InterpType INTERP_TILES = InterpType::TILES; |
213 |
|
const InterpType INTERP_BILINEAR = InterpType::BILINEAR; |
214 |
|
const InterpType INTERP_HYPER = InterpType::HYPER; |
215 |
|
const ModifierType SHIFT_MASK = ModifierType::SHIFT_MASK; |
216 |
|
const ModifierType LOCK_MASK = ModifierType::LOCK_MASK; |
217 |
|
const ModifierType CONTROL_MASK = ModifierType::CONTROL_MASK; |
218 |
|
const ModifierType MOD1_MASK = ModifierType::MOD1_MASK; |
219 |
|
const ModifierType MOD2_MASK = ModifierType::MOD2_MASK; |
220 |
|
const ModifierType MOD3_MASK = ModifierType::MOD3_MASK; |
221 |
|
const ModifierType MOD4_MASK = ModifierType::MOD4_MASK; |
222 |
|
const ModifierType MOD5_MASK = ModifierType::MOD5_MASK; |
223 |
|
const ModifierType BUTTON1_MASK = ModifierType::BUTTON1_MASK; |
224 |
|
const ModifierType BUTTON2_MASK = ModifierType::BUTTON2_MASK; |
225 |
|
const ModifierType BUTTON3_MASK = ModifierType::BUTTON3_MASK; |
226 |
|
const ModifierType BUTTON4_MASK = ModifierType::BUTTON4_MASK; |
227 |
|
const ModifierType BUTTON5_MASK = ModifierType::BUTTON5_MASK; |
228 |
|
const ModifierType SUPER_MASK = ModifierType::SUPER_MASK; |
229 |
|
const ModifierType HYPER_MASK = ModifierType::HYPER_MASK; |
230 |
|
const ModifierType META_MASK = ModifierType::META_MASK; |
231 |
|
const ModifierType RELEASE_MASK = ModifierType::RELEASE_MASK; |
232 |
|
const ModifierType MODIFIER_MASK = ModifierType::MODIFIER_MASK; |
233 |
|
} |
234 |
|
namespace Gtk { |
235 |
|
const PackOptions SHRINK = PackOptions::SHRINK; |
236 |
|
const PackOptions PACK_SHRINK = PackOptions::SHRINK; |
237 |
|
const PackOptions PACK_EXPAND_PADDING = PackOptions::EXPAND_PADDING; |
238 |
|
const PackOptions PACK_EXPAND_WIDGET = PackOptions::EXPAND_WIDGET; |
239 |
|
const ButtonBoxStyle BUTTONBOX_SPREAD = ButtonBoxStyle::SPREAD; |
240 |
|
const ButtonBoxStyle BUTTONBOX_EDGE = ButtonBoxStyle::EDGE; |
241 |
|
const ButtonBoxStyle BUTTONBOX_START = ButtonBoxStyle::START; |
242 |
|
const ButtonBoxStyle BUTTONBOX_END = ButtonBoxStyle::END; |
243 |
|
const ButtonBoxStyle BUTTONBOX_CENTER = ButtonBoxStyle::CENTER; |
244 |
|
const ButtonBoxStyle BUTTONBOX_EXPAND = ButtonBoxStyle::EXPAND; |
245 |
|
const MessageType MESSAGE_INFO = MessageType::INFO; |
246 |
|
const MessageType MESSAGE_WARNING = MessageType::WARNING; |
247 |
|
const MessageType MESSAGE_QUESTION = MessageType::QUESTION; |
248 |
|
const MessageType MESSAGE_ERROR = MessageType::ERROR; |
249 |
|
const MessageType MESSAGE_OTHER = MessageType::OTHER; |
250 |
|
const ButtonsType BUTTONS_NONE = ButtonsType::NONE; |
251 |
|
const ButtonsType BUTTONS_OK = ButtonsType::OK; |
252 |
|
const ButtonsType BUTTONS_CLOSE = ButtonsType::CLOSE; |
253 |
|
const ButtonsType BUTTONS_CANCEL = ButtonsType::CANCEL; |
254 |
|
const ButtonsType BUTTONS_YES_NO = ButtonsType::YES_NO; |
255 |
|
const ButtonsType BUTTONS_OK_CANCEL = ButtonsType::OK_CANCEL; |
256 |
|
const ResponseType RESPONSE_NONE = ResponseType::NONE; |
257 |
|
const ResponseType RESPONSE_REJECT = ResponseType::REJECT; |
258 |
|
const ResponseType RESPONSE_ACCEPT = ResponseType::ACCEPT; |
259 |
|
const ResponseType RESPONSE_DELETE_EVENT = ResponseType::DELETE_EVENT; |
260 |
|
const ResponseType RESPONSE_OK = ResponseType::OK; |
261 |
|
const ResponseType RESPONSE_CANCEL = ResponseType::CANCEL; |
262 |
|
const ResponseType RESPONSE_CLOSE = ResponseType::CLOSE; |
263 |
|
const ResponseType RESPONSE_YES = ResponseType::YES; |
264 |
|
const ResponseType RESPONSE_NO = ResponseType::NO; |
265 |
|
const ResponseType RESPONSE_APPLY = ResponseType::APPLY; |
266 |
|
const ResponseType RESPONSE_HELP = ResponseType::HELP; |
267 |
|
const ShadowType SHADOW_NONE = ShadowType::NONE; |
268 |
|
const ShadowType SHADOW_IN = ShadowType::IN; |
269 |
|
const ShadowType SHADOW_OUT = ShadowType::OUT; |
270 |
|
const ShadowType SHADOW_ETCHED_IN = ShadowType::ETCHED_IN; |
271 |
|
const ShadowType SHADOW_ETCHED_OUT = ShadowType::ETCHED_OUT; |
272 |
|
const Align ALIGN_FILL = Align::FILL; |
273 |
|
const Align ALIGN_START = Align::START; |
274 |
|
const Align ALIGN_END = Align::END; |
275 |
|
const Align ALIGN_CENTER = Align::CENTER; |
276 |
|
const Align ALIGN_BASELINE = Align::BASELINE; |
277 |
|
const WindowPosition WIN_POS_NONE = WindowPosition::NONE; |
278 |
|
const WindowPosition WIN_POS_CENTER = WindowPosition::CENTER; |
279 |
|
const WindowPosition WIN_POS_MOUSE = WindowPosition::MOUSE; |
280 |
|
const WindowPosition WIN_POS_CENTER_ALWAYS = WindowPosition::CENTER_ALWAYS; |
281 |
|
const WindowPosition WIN_POS_CENTER_ON_PARENT = WindowPosition::CENTER_ON_PARENT; |
282 |
|
const PolicyType POLICY_ALWAYS = PolicyType::ALWAYS; |
283 |
|
const PolicyType POLICY_AUTOMATIC = PolicyType::AUTOMATIC; |
284 |
|
const PolicyType POLICY_NEVER = PolicyType::NEVER; |
285 |
|
const PolicyType POLICY_EXTERNAL = PolicyType::EXTERNAL; |
286 |
|
const ToolbarStyle TOOLBAR_ICONS = ToolbarStyle::ICONS; |
287 |
|
const ToolbarStyle TOOLBAR_TEXT = ToolbarStyle::TEXT; |
288 |
|
const ToolbarStyle TOOLBAR_BOTH = ToolbarStyle::BOTH; |
289 |
|
const ToolbarStyle TOOLBAR_BOTH_HORIZ = ToolbarStyle::BOTH_HORIZ; |
290 |
|
const DirectionType DIR_TAB_FORWARD = DirectionType::TAB_FORWARD; |
291 |
|
const DirectionType DIR_TAB_BACKWARD = DirectionType::TAB_BACKWARD; |
292 |
|
const DirectionType DIR_UP = DirectionType::UP; |
293 |
|
const DirectionType DIR_DOWN = DirectionType::DOWN; |
294 |
|
const DirectionType DIR_LEFT = DirectionType::LEFT; |
295 |
|
const DirectionType DIR_RIGHT = DirectionType::RIGHT; |
296 |
|
const SelectionMode SELECTION_NONE = SelectionMode::NONE; |
297 |
|
const SelectionMode SELECTION_SINGLE = SelectionMode::SINGLE; |
298 |
|
const SelectionMode SELECTION_BROWSE = SelectionMode::BROWSE; |
299 |
|
const SelectionMode SELECTION_MULTIPLE = SelectionMode::MULTIPLE; |
300 |
|
const BuiltinIconSize ICON_SIZE_INVALID = BuiltinIconSize::INVALID; |
301 |
|
const BuiltinIconSize ICON_SIZE_MENU = BuiltinIconSize::MENU; |
302 |
|
const BuiltinIconSize ICON_SIZE_SMALL_TOOLBAR = BuiltinIconSize::SMALL_TOOLBAR; |
303 |
|
const BuiltinIconSize ICON_SIZE_LARGE_TOOLBAR = BuiltinIconSize::LARGE_TOOLBAR; |
304 |
|
const BuiltinIconSize ICON_SIZE_BUTTON = BuiltinIconSize::BUTTON; |
305 |
|
const BuiltinIconSize ICON_SIZE_DND = BuiltinIconSize::DND; |
306 |
|
const BuiltinIconSize ICON_SIZE_DIALOG = BuiltinIconSize::DIALOG; |
307 |
|
const IconLookupFlags ICON_LOOKUP_NO_SVG = IconLookupFlags::NO_SVG; |
308 |
|
const IconLookupFlags ICON_LOOKUP_FORCE_SVG = IconLookupFlags::FORCE_SVG; |
309 |
|
const IconLookupFlags ICON_LOOKUP_USE_BUILTIN = IconLookupFlags::USE_BUILTIN; |
310 |
|
const IconLookupFlags ICON_LOOKUP_GENERIC_FALLBACK = IconLookupFlags::GENERIC_FALLBACK; |
311 |
|
const IconLookupFlags ICON_LOOKUP_FORCE_SIZE = IconLookupFlags::FORCE_SIZE; |
312 |
|
const IconLookupFlags ICON_LOOKUP_FORCE_REGULAR = IconLookupFlags::FORCE_REGULAR; |
313 |
|
const IconLookupFlags ICON_LOOKUP_FORCE_SYMBOLIC = IconLookupFlags::FORCE_SYMBOLIC; |
314 |
|
const IconLookupFlags ICON_LOOKUP_DIR_LTR = IconLookupFlags::DIR_LTR; |
315 |
|
const IconLookupFlags ICON_LOOKUP_DIR_RTL = IconLookupFlags::DIR_RTL; |
316 |
|
const TextWindowType TEXT_WINDOW_PRIVATE = TextWindowType::PRIVATE; |
317 |
|
const TextWindowType TEXT_WINDOW_WIDGET = TextWindowType::WIDGET; |
318 |
|
const TextWindowType TEXT_WINDOW_TEXT = TextWindowType::TEXT; |
319 |
|
const TextWindowType TEXT_WINDOW_LEFT = TextWindowType::LEFT; |
320 |
|
const TextWindowType TEXT_WINDOW_RIGHT = TextWindowType::RIGHT; |
321 |
|
const TextWindowType TEXT_WINDOW_TOP = TextWindowType::TOP; |
322 |
|
const TextWindowType TEXT_WINDOW_BOTTOM = TextWindowType::BOTTOM; |
323 |
|
const FileChooser::Action FILE_CHOOSER_ACTION_OPEN = FileChooser::Action::OPEN; |
324 |
|
const FileChooser::Action FILE_CHOOSER_ACTION_SAVE = FileChooser::Action::SAVE; |
325 |
|
const FileChooser::Action FILE_CHOOSER_ACTION_SELECT_FOLDER = FileChooser::Action::SELECT_FOLDER; |
326 |
|
const FileChooser::Action FILE_CHOOSER_ACTION_CREATE_FOLDER = FileChooser::Action::CREATE_FOLDER; |
327 |
|
} |
328 |
|
#endif // HAS_GTKMM_CPP11_ENUMS |
329 |
|
|
330 |
// 2.10 |
// 2.10 |
331 |
|
|
418 |
|
|
419 |
#define OLD_THREADS |
#define OLD_THREADS |
420 |
|
|
421 |
#endif |
#endif // glibmm 2.31.2 |
422 |
|
|
423 |
#endif |
#endif // GIGEDIT_COMPAT_H |