Commits

Daniel Poelzleithner committed 034d6f4

implement line_marker list python functions

  • Participants
  • Parent commits 7f54f10

Comments (0)

Files changed (2)

moo/moopython/pygtk/mooedit-pygtk.defs

   )
 )
 
-; (define-method get_line_marks_in_range
-;   (of-object "MooTextBuffer")
-;   (c-name "moo_text_buffer_get_line_marks_in_range")
-;   (return-type "GSList*")
-;   (parameters
-;     '("int" "first_line")
-;     '("int" "last_line")
-;   )
-; )
+(define-method get_line_marks_in_range
+  (of-object "MooTextBuffer")
+  (c-name "moo_text_buffer_get_line_marks_in_range")
+  (return-type "GSList*")
+  (parameters
+    '("int" "first_line")
+    '("int" "last_line")
+  )
+)
+
+(define-method get_line_marks_at_line
+  (of-object "MooTextBuffer")
+  (c-name "moo_text_buffer_get_line_marks_at_line")
+  (return-type "GSList*")
+  (parameters
+    '("int" "line")
+  )
+)
+
 
 (define-method add_fold
   (of-object "MooTextBuffer")
   )
 )
 
+(define-method get_fold_at_line
+  (of-object "MooTextBuffer")
+  (c-name "moo_text_buffer_get_fold_at_line")
+  (return-type "MooFold*")
+  (parameters
+    '("int" "line")
+  )
+)
+
+(define-method toggle_fold
+  (of-object "MooTextBuffer")
+  (c-name "moo_text_buffer_toggle_fold")
+  (return-type "none")
+  (parameters
+    '("MooFold*" "fold")
+  )
+)
+
+
 
 ;; From mootextiter.h
 

moo/moopython/pygtk/mooedit-pygtk.override

 #include "mooedit/mootextiter.h"
 #include "mooedit/mootextstylescheme.h"
 #include "mooedit/mootextview.h"
+#include "mooedit/moolinemark.h"
 #include "mooedit/mootextpopup.h"
 #include "mooedit/mootextcompletion.h"
 #include "mooedit/mooedit-enums.h"
     }
 }
 %%
+override moo_text_buffer_get_line_marks_at_line varargs
+static PyObject *
+_wrap_moo_text_buffer_get_line_marks_at_line (PyGObject *self, PyObject *args)
+{
+    GSList *list;
+    PyObject *result;
+    int line;
+
+    if (!PyArg_ParseTuple (args, "i", &line))
+        return NULL;
+
+    list = moo_text_buffer_get_line_marks_at_line (MOO_TEXT_BUFFER (pygobject_get (self)), line);
+    result = _moo_object_slist_to_pyobject (list);
+
+    g_slist_free (list);
+    return result;
+}
+%%
+override moo_text_buffer_get_line_marks_in_range varargs
+static PyObject *
+_wrap_moo_text_buffer_get_line_marks_in_range (PyGObject *self, PyObject *args)
+{
+    GSList *list;
+    PyObject *result;
+    int start, end;
+
+
+    if (!PyArg_ParseTuple (args, "ii", &start, &end))
+        return NULL;
+
+    list = moo_text_buffer_get_line_marks_in_range (MOO_TEXT_BUFFER (pygobject_get (self)), start, end);
+    result = _moo_object_slist_to_pyobject (list);
+
+    g_slist_free (list);
+    return result;
+}
+%%
 override moo_edit_class_add_action varargs
 static PyObject *
 _wrap_moo_edit_class_add_action (G_GNUC_UNUSED PyObject *self, PyObject *args)