]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/lablgtksourceview/ml_gtk_sourceview.c
snaphot
[helm.git] / helm / DEVEL / lablgtksourceview / ml_gtk_sourceview.c
index eb0a69dc5dbd738c7399b0e4cea3922fb918febc..f9b92dc1c308de6634a15658df69317e1d52ba8c 100644 (file)
@@ -26,6 +26,7 @@
 #include <assert.h>
 
 #include <gtksourceview/gtksourceview.h>
+#include <gtksourceview/gtksourcelanguagesmanager.h>
 
 #include <caml/mlvalues.h>
 #include <caml/alloc.h>
 
 /* Init all */
 
-CAMLprim value ml_gtk_source_view_init(value unit)
+CAMLprim value ml_gtk_source_language_init(value unit)
 {      /* Since these are declared const, must force gcc to call them! */
-    GType t = gtk_source_view_get_type();
+    GType t = gtk_source_language_get_type();
+    return Val_GType(t);
+}
+
+CAMLprim value ml_gtk_source_languages_manager_init(value unit)
+{      /* Since these are declared const, must force gcc to call them! */
+    GType t = gtk_source_languages_manager_get_type();
     return Val_GType(t);
 }
 
@@ -59,32 +66,30 @@ CAMLprim value ml_gtk_source_buffer_init(value unit)
     return Val_GType(t);
 }
 
-#define GtkSourceView_val(val) check_cast(GTK_SOURCE_VIEW,val)
-#define GtkSourceBuffer_val(val) check_cast(GTK_SOURCE_BUFFER,val)
+CAMLprim value ml_gtk_source_view_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 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))); }
+#define GtkSourceLanguage_val(val) check_cast(GTK_SOURCE_LANGUAGE,val)
+#define GtkSourceLanguagesManager_val(val)\
+       check_cast(GTK_SOURCE_LANGUAGES_MANAGER,val)
+#define GtkSourceTagTable_val(val) check_cast(GTK_SOURCE_TAG_TABLE,val)
+#define GtkSourceBuffer_val(val) check_cast(GTK_SOURCE_BUFFER,val)
+#define GtkSourceView_val(val) check_cast(GTK_SOURCE_VIEW,val)
 
-/* 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_language_get_name, GtkSourceLanguage_val, Val_string)
+ML_1 (gtk_source_language_get_section, GtkSourceLanguage_val, Val_string)
+ML_1 (gtk_source_language_get_escape_char, GtkSourceLanguage_val, Val_int)
 
-/* 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) */
+ML_0 (gtk_source_languages_manager_new, Val_GtkAny_sink)
+ML_2 (gtk_source_languages_manager_get_language_from_mime_type,
+               GtkSourceLanguagesManager_val, String_val, Val_GtkAny)
 
+/* ML_0 (gtk_source_buffer_new, GtkSourceTagTable_val, Val_GtkAny_sink) */
+/* ML_1 (gtk_source_buffer_new_with_language, GtkSourceLanguage_val,
+               Val_GtkAny_sink) */
 ML_1 (gtk_source_buffer_can_undo, GtkSourceBuffer_val, Bool_val)
 ML_1 (gtk_source_buffer_can_redo, GtkSourceBuffer_val, Bool_val)
 ML_1 (gtk_source_buffer_undo, GtkSourceBuffer_val, Unit)
@@ -92,3 +97,6 @@ ML_1 (gtk_source_buffer_redo, GtkSourceBuffer_val, Unit)
 ML_1 (gtk_source_buffer_begin_not_undoable_action, GtkSourceBuffer_val, Unit)
 ML_1 (gtk_source_buffer_end_not_undoable_action, GtkSourceBuffer_val, Unit)
 
+ML_0 (gtk_source_view_new, Val_GtkWidget_sink)
+ML_1 (gtk_source_view_new_with_buffer, GtkSourceBuffer_val, Val_GtkWidget_sink)
+