PLplot  5.15.0
plcairo_impl.c
Go to the documentation of this file.
1 //
2 // Copyright 2008 Hezekiah M. Carty
3 //
4 // This file is part of PLplot.
5 //
6 // PLplot is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU Lesser General Public License as published by
8 // the Free Software Foundation, either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // PLplot is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with PLplot. If not, see <http://www.gnu.org/licenses/>.
18 //
19 
20 #include <plplotP.h>
21 
22 // The "usual" OCaml includes
23 #include <caml/alloc.h>
24 #include <caml/callback.h>
25 #include <caml/fail.h>
26 #include <caml/memory.h>
27 #include <caml/misc.h>
28 #include <caml/mlvalues.h>
29 #include <caml/bigarray.h>
30 
31 #include <plplot.h>
32 
33 #include <cairo.h>
34 
35 //* OCaml Cairo integration.
36 // Get a Cairo context from OCaml. These #defines are from the
37 // OCaml Cairo bindings.
38 #define wPointer_val( t, val ) ( *( (t **) Data_custom_val( val ) ) )
39 #define cairo_t_val( v ) wPointer_val( cairo_t, v )
40 
42 {
43  CAMLparam1( context );
44  pl_cmd( PLESC_DEVINIT, cairo_t_val( context ) );
45  CAMLreturn( Val_unit );
46 }
47 
#define PLESC_DEVINIT
Definition: plplot.h:296
value ml_set_plplot_cairo_context(value context)
Definition: plcairo_impl.c:41
void pl_cmd(PLINT op, void *ptr)
Definition: plctrl.c:2118
static PLFLT value(double n1, double n2, double hue)
Definition: plctrl.c:1219
#define cairo_t_val(v)
Definition: plcairo_impl.c:39