]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtksourceview/ml_gtk_sourceview.c
lablgtksourceview: first checkin, almost nothing bound ...
[helm.git] / helm / DEVEL / lablgtksourceview / ml_gtk_sourceview.c
1 /* Copyright (C) 2005:
2  *      Stefano Zacchiroli     <zack@cs.unibo.it>
3  *      Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
4  *
5  * This file is part of lablgtksourceview, the OCaml binding for the
6  * GtkSourceView widget.
7  * 
8  * lablgtksourceview is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * lablgtksourceview 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  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with lablgtksourceview; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  * 02111-1307, USA.
22  * 
23  * For details, send a mail to the authors.
24  */
25
26 #include <assert.h>
27
28 #include <gtksourceview/gtksourceview.h>
29
30 #include <caml/mlvalues.h>
31 #include <caml/alloc.h>
32 #include <caml/memory.h>
33 #include <caml/callback.h>
34 #include <caml/fail.h>
35 #include <caml/custom.h>
36 #include <caml/callback.h>
37
38 #include <wrappers.h>
39 #include <ml_glib.h>
40 #include <ml_gdk.h>
41 #include <ml_gtk.h>
42 #include <ml_gobject.h>
43 #include <ml_gdkpixbuf.h>
44 #include <ml_pango.h>
45 #include <gtk_tags.h>
46 #include <gdk_tags.h>
47
48 /* Init all */
49
50 CAMLprim value ml_gtk_sourceview_init(value unit)
51 {
52     /* Since these are declared const, must force gcc to call them! */
53     GType t = gtk_source_view_get_type();
54     return Val_GType(t);
55 }
56
57 #define GtkSourceView_val(val) check_cast(GTK_SOURCE_VIEW,val)
58
59 //#####################################
60 //
61 //#define FontManagerId_val(val) Int_val(val)
62 //#define Val_FontManagerId(val) Val_int(val)
63 //
64 ///* As ML_1, but the result is optional */
65 //#define OML_1(cname, conv1, conv) \
66 //value ml_##cname (value arg1) { return Val_option_ptr((cname (conv1 (arg1))),conv); }
67 ///* As ML_3, but the result is optional */
68 //#define OML_3(cname, conv1, conv2, conv3, conv) \
69 value ml_##cname (value arg1, value arg2, value arg3) { return Val_option_ptr((cname (conv1 (arg1), conv2 (arg2), conv3 (arg3))),conv); }
70 ///* As ML_2, but the second argument is optional */
71 //#define ML_2O(cname, conv1, conv2, conv) \
72 //value ml_##cname (value arg1, value arg2) \
73 //{ return conv (cname (conv1(arg1), ptr_val_option(arg2,conv2))); }
74
75 /* ML_1 (gtk_math_view_freeze, GtkMathView_val, Unit)
76 ML_2 (gtk_math_view_load_uri, GtkMathView_val, String_val, Val_bool)
77 ML_3 (gtk_math_view_set_top, GtkMathView_val, Int_val, Int_val, Unit) */
78
79 ML_1 (gtk_source_view_get_show_line_numbers, GtkSourceView_val,
80                 Val_bool)
81 ML_2 (gtk_source_view_set_show_line_numbers, GtkSourceView_val,
82                 Bool_val, Unit)
83