]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/lablgtksourceview/ml_gtk_sourceview.c
lablgtksourceview: first checkin, almost nothing bound ...
[helm.git] / helm / DEVEL / lablgtksourceview / ml_gtk_sourceview.c
diff --git a/helm/DEVEL/lablgtksourceview/ml_gtk_sourceview.c b/helm/DEVEL/lablgtksourceview/ml_gtk_sourceview.c
new file mode 100644 (file)
index 0000000..935e96a
--- /dev/null
@@ -0,0 +1,83 @@
+/* Copyright (C) 2005:
+ *     Stefano Zacchiroli     <zack@cs.unibo.it>
+ *     Claudio Sacerdoti Coen <sacerdot@cs.unibo.it>
+ *
+ * This file is part of lablgtksourceview, the OCaml binding for the
+ * GtkSourceView widget.
+ * 
+ * lablgtksourceview is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * lablgtksourceview is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with lablgtksourceview; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ * 
+ * For details, send a mail to the authors.
+ */
+
+#include <assert.h>
+
+#include <gtksourceview/gtksourceview.h>
+
+#include <caml/mlvalues.h>
+#include <caml/alloc.h>
+#include <caml/memory.h>
+#include <caml/callback.h>
+#include <caml/fail.h>
+#include <caml/custom.h>
+#include <caml/callback.h>
+
+#include <wrappers.h>
+#include <ml_glib.h>
+#include <ml_gdk.h>
+#include <ml_gtk.h>
+#include <ml_gobject.h>
+#include <ml_gdkpixbuf.h>
+#include <ml_pango.h>
+#include <gtk_tags.h>
+#include <gdk_tags.h>
+
+/* Init all */
+
+CAMLprim value ml_gtk_sourceview_init(value unit)
+{
+    /* Since these are declared const, must force gcc to call them! */
+    GType t = gtk_source_view_get_type();
+    return Val_GType(t);
+}
+
+#define GtkSourceView_val(val) check_cast(GTK_SOURCE_VIEW,val)
+
+//#####################################
+//
+//#define FontManagerId_val(val) Int_val(val)
+//#define Val_FontManagerId(val) Val_int(val)
+//
+///* As ML_1, but the result is optional */
+//#define OML_1(cname, conv1, conv) \
+//value ml_##cname (value arg1) { return Val_option_ptr((cname (conv1 (arg1))),conv); }
+///* As ML_3, but the result is optional */
+//#define OML_3(cname, conv1, conv2, conv3, conv) \
+value ml_##cname (value arg1, value arg2, value arg3) { return Val_option_ptr((cname (conv1 (arg1), conv2 (arg2), conv3 (arg3))),conv); }
+///* As ML_2, but the second argument is optional */
+//#define ML_2O(cname, conv1, conv2, conv) \
+//value ml_##cname (value arg1, value arg2) \
+//{ return conv (cname (conv1(arg1), ptr_val_option(arg2,conv2))); }
+
+/* ML_1 (gtk_math_view_freeze, GtkMathView_val, Unit)
+ML_2 (gtk_math_view_load_uri, GtkMathView_val, String_val, Val_bool)
+ML_3 (gtk_math_view_set_top, GtkMathView_val, Int_val, Int_val, Unit) */
+
+ML_1 (gtk_source_view_get_show_line_numbers, GtkSourceView_val,
+               Val_bool)
+ML_2 (gtk_source_view_set_show_line_numbers, GtkSourceView_val,
+               Bool_val, Unit)
+