2 // "$Id: Fl_Cairo.cxx 8198 2011-01-06 10:24:58Z manolo $"
4 // Main header file for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2010 by Bill Spitzak and others.
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // Please report all bugs and problems on the following page:
25 // http://www.fltk.org/str.php
32 #include <FL/Fl_Window.H>
34 #include <Carbon/Carbon.h>
38 Creates transparently a cairo_surface_t object.
39 gc is an HDC context in WIN32, a CGContext* in Quartz, a display on X11
41 cairo_surface_t
* cairo_create_surface(void * gc
, Window w
, int W
, int H
) {
43 return cairo_xlib_surface_create(fl_display
, w
, fl_visual
->visual
, W
, H
);
45 return cairo_win32_surface_create((HDC
) gc
);
46 # elif defined(__APPLE_QUARTZ__)
47 return cairo_quartz_surface_create_for_cg_context((CGContext
*) gc
, W
, H
);
49 # error Cairo is not supported under this platform.
53 cairo_t
*fl_cairo_context
;
56 Fl::cairo_create_surface ( Window xid
, int W
, int H
)
58 return ::cairo_create_surface( fl_gc
, xid
, W
, H
);
62 Fl::cairo_make_current( cairo_t
*cc
)
64 fl_cairo_context
= cc
;
70 // End of "$Id: Fl_Cairo.cxx 8198 2011-01-06 10:24:58Z manolo $" .