2 * Stefano Zacchiroli <zack@cs.unibo.it>
3 * Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
5 * This file is part of lablgtksourceview, the OCaml binding for the
6 * GtkSourceView widget.
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.
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.
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
23 * For details, send a mail to the authors.
28 #include <gtksourceview/gtksourceview.h>
29 #include <gtksourceview/gtksourcelanguagesmanager.h>
31 #include <caml/mlvalues.h>
32 #include <caml/alloc.h>
33 #include <caml/memory.h>
34 #include <caml/callback.h>
35 #include <caml/fail.h>
36 #include <caml/custom.h>
37 #include <caml/callback.h>
43 #include <ml_gobject.h>
44 #include <ml_gdkpixbuf.h>
51 CAMLprim value ml_gtk_source_language_init(value unit)
52 { /* Since these are declared const, must force gcc to call them! */
53 GType t = gtk_source_language_get_type();
57 CAMLprim value ml_gtk_source_languages_manager_init(value unit)
58 { /* Since these are declared const, must force gcc to call them! */
59 GType t = gtk_source_languages_manager_get_type();
63 CAMLprim value ml_gtk_source_buffer_init(value unit)
64 { /* Since these are declared const, must force gcc to call them! */
65 GType t = gtk_source_buffer_get_type();
69 CAMLprim value ml_gtk_source_view_init(value unit)
70 { /* Since these are declared const, must force gcc to call them! */
71 GType t = gtk_source_view_get_type();
75 #define GtkSourceLanguage_val(val) check_cast(GTK_SOURCE_LANGUAGE,val)
76 #define GtkSourceLanguagesManager_val(val)\
77 check_cast(GTK_SOURCE_LANGUAGES_MANAGER,val)
78 #define GtkSourceTagTable_val(val) check_cast(GTK_SOURCE_TAG_TABLE,val)
79 #define GtkSourceBuffer_val(val) check_cast(GTK_SOURCE_BUFFER,val)
80 #define GtkSourceView_val(val) check_cast(GTK_SOURCE_VIEW,val)
82 ML_1 (gtk_source_language_get_name, GtkSourceLanguage_val, Val_string)
83 ML_1 (gtk_source_language_get_section, GtkSourceLanguage_val, Val_string)
84 ML_1 (gtk_source_language_get_escape_char, GtkSourceLanguage_val, Val_int)
86 ML_0 (gtk_source_languages_manager_new, Val_GtkAny_sink)
87 ML_2 (gtk_source_languages_manager_get_language_from_mime_type,
88 GtkSourceLanguagesManager_val, String_val, Val_GtkAny)
90 /* ML_0 (gtk_source_buffer_new, GtkSourceTagTable_val, Val_GtkAny_sink) */
91 /* ML_1 (gtk_source_buffer_new_with_language, GtkSourceLanguage_val,
93 ML_1 (gtk_source_buffer_can_undo, GtkSourceBuffer_val, Bool_val)
94 ML_1 (gtk_source_buffer_can_redo, GtkSourceBuffer_val, Bool_val)
95 ML_1 (gtk_source_buffer_undo, GtkSourceBuffer_val, Unit)
96 ML_1 (gtk_source_buffer_redo, GtkSourceBuffer_val, Unit)
97 ML_1 (gtk_source_buffer_begin_not_undoable_action, GtkSourceBuffer_val, Unit)
98 ML_1 (gtk_source_buffer_end_not_undoable_action, GtkSourceBuffer_val, Unit)
100 ML_0 (gtk_source_view_new, Val_GtkWidget_sink)
101 ML_1 (gtk_source_view_new_with_buffer, GtkSourceBuffer_val, Val_GtkWidget_sink)