1 |
persson |
2170 |
/* |
2 |
schoenebeck |
3364 |
* Copyright (C) 2011-2017 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 |
schoenebeck |
3364 |
#ifdef GTKMM_HEADER_FILE |
21 |
|
|
# include GTKMM_HEADER_FILE(gtkmmconfig.h) |
22 |
|
|
#else |
23 |
|
|
# include <gtkmmconfig.h> |
24 |
|
|
#endif |
25 |
persson |
2170 |
|
26 |
|
|
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
27 |
persson |
2507 |
#include <gdkmm/window.h> |
28 |
persson |
2170 |
#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 |