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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3364 - (show annotations) (download)
Tue Nov 14 18:07:25 2017 UTC (6 years, 5 months ago) by schoenebeck
File size: 1542 byte(s)
* Added experimental support for upcoming GTK(MM)4
  (for now up to GTKMM 3.91.2 while still preserving backward compatibility
  down to GTKMM 2).
* Re-merged r2845 to compile now with and without Gtk "Stock ID" API
  (see also r3158).

1 /*
2 * Copyright (C) 2011-2017 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 #ifdef GTKMM_HEADER_FILE
21 # include GTKMM_HEADER_FILE(gtkmmconfig.h)
22 #else
23 # include <gtkmmconfig.h>
24 #endif
25
26 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2
27 #include <gdkmm/window.h>
28 #include <gdkmm/general.h>
29 #include <gdk/gdkcairo.h>
30 #include "compat.h"
31
32 namespace Gdk {
33 namespace Cairo {
34 void set_source_rgba(const ::Cairo::RefPtr< ::Cairo::Context >& context,
35 const Gdk::RGBA& color) {
36 #if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 10) || GTKMM_MAJOR_VERSION < 2
37 gdk_cairo_set_source_color(context->cobj(),
38 const_cast<GdkColor*>(color.gobj()));
39 #else
40 set_source_color(context, color);
41 #endif
42 }
43 }
44 }
45 #endif

  ViewVC Help
Powered by ViewVC