finished bindings for GtkTextView
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Thu, 8 Oct 2009 19:44:58 +0000 (23:44 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Thu, 8 Oct 2009 19:44:58 +0000 (23:44 +0400)
api.ods
bugs/issue-5a278efa6750438ee40072f35e694cd312cf250c.yaml
generating.lisp
gtk/gtk.generated-classes.lisp
gtk/gtk.text.lisp

diff --git a/api.ods b/api.ods
index eb1e679..240c6b9 100644 (file)
Binary files a/api.ods and b/api.ods differ
index 99b4540..fb07b76 100644 (file)
@@ -5,8 +5,8 @@ type: :task
 component: cl-gtk2
 release: "0.1"
 reporter: Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
-status: :unstarted
-disposition: 
+status: :closed
+disposition: :fixed
 creation_time: 2009-10-01 19:48:56.995381 Z
 references: []
 
@@ -16,3 +16,7 @@ log_events:
   - Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
   - created
   - ""
+- - 2009-10-08 19:34:06.712291 Z
+  - Kalyanov Dmitry <Kalyanov.Dmitry@gmail.com>
+  - closed with disposition fixed
+  - ""
index 45d4723..84835b5 100644 (file)
          "gtk_scrolled_window_get_vscrollbar" nil))
        ("GtkBin"
         (:cffi gtk::child gtk::bin-child (g-object gtk::widget)
-         "gtk_bin_get_child" nil))))))
+         "gtk_bin_get_child" nil))
+       ("GtkTextChildAnchor"
+        (:cffi gtk::deleted-p gtk::text-child-anchor-deleted-p :boolean
+         "gtk_text_child_anchor_get_deleted" nil))))))
 
 (defun gtk-generate-child-properties (filename)
   (with-open-file (stream filename :direction :output :if-exists :supersede)
index daee837..d8791dc 100644 (file)
 (define-g-object-class "GtkTextChildAnchor" text-child-anchor
                        (:superclass g-object :export t :interfaces nil
                         :type-initializer "gtk_text_child_anchor_get_type")
-                       nil)
+                       ((:cffi deleted-p text-child-anchor-deleted-p :boolean
+                         "gtk_text_child_anchor_get_deleted" nil)))
 
 (define-g-object-class "GtkTextMark" text-mark
                        (:superclass g-object :export t :interfaces nil
index 2385066..b8b53cb 100644 (file)
 
 (export 'text-view-scroll-to-iter)
 
+(defcfun (text-view-scroll-mark-onscreen "gtk_text_view_scroll_mark_onscreen") :void
+  (text-view (g-object text-view))
+  (mark (g-object text-mark)))
+
+(export 'text-view-scroll-mark-onscreen)
+
 (defcfun (text-view-move-mark-onscreen "gtk_text_view_move_mark_onscreen") :boolean
   (text-view (g-object text-view))
   (mark (g-object text-mark)))
 
 (export 'text-view-iter-location)
 
+(defcfun gtk-text-view-get-line-at-y :void
+  (text-view (g-object text-view))
+  (target-iter (g-boxed-foreign text-iter))
+  (y :int)
+  (line-top (:pointer :int)))
 
-;; void                gtk_text_view_get_line_at_y         (GtkTextView *text_view,
-;;                                                          GtkTextIter *target_iter,
-;;                                                          gint y,
-;;                                                          gint *line_top);
-;; void                gtk_text_view_get_line_yrange       (GtkTextView *text_view,
-;;                                                          const GtkTextIter *iter,
-;;                                                          gint *y,
-;;                                                          gint *height);
+(defun text-view-get-line-at-y (text-view y)
+  (let ((iter (make-instance 'text-iter)))
+    (with-foreign-object (line-top :int)
+      (gtk-text-view-get-line-at-y text-view iter y line-top)
+      (values iter (mem-ref line-top :int)))))
+
+(export 'text-view-get-line-at-y)
+
+(defcfun gtk-text-view-get-line-yrange :void
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter))
+  (y (:pointer :int))
+  (height (:pointer :int)))
+
+(defun text-view-get-line-yrange (text-view iter)
+  (with-foreign-objects ((y :int) (height :int))
+    (gtk-text-view-get-line-yrange text-view iter y height)
+    (values (mem-ref y :int) (mem-ref height :int))))
+
+(export 'text-view-get-line-yrange)
 
 (defcfun gtk-text-view-get-iter-at-location :void
   (text-view (g-object text-view))
 
 (export 'text-view-get-iter-at-location)
 
-;; void                gtk_text_view_get_iter_at_position  (GtkTextView *text_view,
-;;                                                          GtkTextIter *iter,
-;;                                                          gint *trailing,
-;;                                                          gint x,
-;;                                                          gint y);
-;; void                gtk_text_view_buffer_to_window_coords
-;;                                                         (GtkTextView *text_view,
-;;                                                          GtkTextWindowType win,
-;;                                                          gint buffer_x,
-;;                                                          gint buffer_y,
-;;                                                          gint *window_x,
-;;                                                          gint *window_y);
+(defcfun gtk-text-view-get-iter-at-position :void
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter))
+  (trailing (:pointer :int))
+  (x :int)
+  (y :int))
+
+(defun text-view-get-iter-at-position (text-view x y)
+  (with-foreign-object (trailing :int)
+    (let ((iter (make-instance 'text-iter)))
+      (gtk-text-view-get-iter-at-position text-view iter trailing x y)
+      (values iter (mem-ref trailing :int)))))
+
+(export 'text-view-get-iter-at-position)
+
+(defcfun gtk-text-view-buffer-to-window-coords :void
+  (text-view (g-object text-view))
+  (win text-window-type)
+  (buffer-x :int)
+  (buffer-y :int)
+  (window-x (:pointer :int))
+  (window-y (:pointer :int)))
+
+(defun text-view-buffer-to-window-coords (text-view window-type buffer-x buffer-y)
+  (with-foreign-objects ((window-x :int) (window-y :int))
+    (gtk-text-view-buffer-to-window-coords text-view window-type buffer-x buffer-y window-x window-y)
+    (values (mem-ref window-x :int) (mem-ref window-y :int))))
+
+(export 'text-view-buffer-to-window-coords)
 
 (defcfun gtk-text-view-window-to-buffer-coords :void
   (text-view (g-object text-view))
 
 (export 'text-view-get-window)
 
-;; GtkTextWindowType   gtk_text_view_get_window_type       (GtkTextView *text_view,
-;;                                                          GdkWindow *window);
-;; void                gtk_text_view_set_border_window_size
-;;                                                         (GtkTextView *text_view,
-;;                                                          GtkTextWindowType type,
-;;                                                          gint size);
-;; gint                gtk_text_view_get_border_window_size
-;;                                                         (GtkTextView *text_view,
-;;                                                          GtkTextWindowType type);
-;; gboolean            gtk_text_view_forward_display_line  (GtkTextView *text_view,
-;;                                                          GtkTextIter *iter);
-;; gboolean            gtk_text_view_backward_display_line (GtkTextView *text_view,
-;;                                                          GtkTextIter *iter);
-;; gboolean            gtk_text_view_forward_display_line_end
-;;                                                         (GtkTextView *text_view,
-;;                                                          GtkTextIter *iter);
-;; gboolean            gtk_text_view_backward_display_line_start
-;;                                                         (GtkTextView *text_view,
-;;                                                          GtkTextIter *iter);
-;; gboolean            gtk_text_view_starts_display_line   (GtkTextView *text_view,
-;;                                                          const GtkTextIter *iter);
-;; gboolean            gtk_text_view_move_visually         (GtkTextView *text_view,
-;;                                                          GtkTextIter *iter,
-;;                                                          gint count);
-;; void                gtk_text_view_add_child_at_anchor   (GtkTextView *text_view,
-;;                                                          GtkWidget *child,
-;;                                                          GtkTextChildAnchor *anchor);
+(defcfun (text-view-get-window-type "gtk_text_view_get_window_type") text-window-type
+  (text-view (g-object text-view))
+  (window (g-object gdk-window)))
+
+(export 'text-view-get-window-type)
+
+(defcfun gtk-text-view-set-border-window-size :void
+  (text-view (g-object text-view))
+  (window-type text-window-type)
+  (size :int))
+
+(defcfun (text-view-border-window-size "gtk_text_view_get_border_window_size") :int
+  (text-view (g-object text-view))
+  (window-type text-window-type))
+
+(defun (setf text-view-border-window-size) (new-value text-view window-type)
+  (gtk-text-view-set-border-window-size text-view window-type new-value)
+  new-value)
+
+(export 'text-view-border-window-size)
+
+(defcfun (text-view-forward-display-line "gtk_text_view_forward_display_line") :boolean
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter)))
+
+(export 'text-view-forward-display-line)
+
+(defcfun (text-view-backward-display-line "gtk_text_view_backward_display_line") :boolean
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter)))
+
+(export 'text-view-backward-display-line)
+
+(defcfun (text-view-forward-display-line-end "gtk_text_view_forward_display_line_end") :boolean
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter)))
+
+(export 'text-view-forward-display-line-end)
+
+(defcfun (text-view-backward-display-line-start "gtk_text_view_backward_display_line_start") :boolean
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter)))
+
+(export 'text-view-backward-display-line-start)
+
+(defcfun (text-view-starts-display-line "gtk_text_view_starts_display_line") :boolean
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter)))
+
+(export 'text-view-starts-display-line)
+
+(defcfun (text-view-move-visually "gtk_text_view_move_visually") :boolean
+  (text-view (g-object text-view))
+  (iter (g-boxed-foreign text-iter))
+  (count :int))
+
+(export 'text-view-move-visually)
 
 (defcfun (text-view-add-child-at-anchor "gtk_text_view_add_child_at_anchor") :void
   (text-view g-object)
 
 (export 'text-view-add-child-at-anchor)
 
-;;                     GtkTextChildAnchor;
-;; GtkTextChildAnchor* gtk_text_child_anchor_new           (void);
-;; GList*              gtk_text_child_anchor_get_widgets   (GtkTextChildAnchor *anchor);
-;; gboolean            gtk_text_child_anchor_get_deleted   (GtkTextChildAnchor *anchor);
-;; void                gtk_text_view_add_child_in_window   (GtkTextView *text_view,
-;;                                                          GtkWidget *child,
-;;                                                          GtkTextWindowType which_window,
-;;                                                          gint xpos,
-;;                                                          gint ypos);
-;; void                gtk_text_view_move_child            (GtkTextView *text_view,
-;;                                                          GtkWidget *child,
-;;                                                          gint xpos,
-;;                                                          gint ypos);
+(defcfun (text-child-anchor-widgets "gtk_text_child_anchor_get_widgets") (glist (g-object widget) :free-from-foreign t)
+  (anchor (g-object text-child-anchor)))
+
+(export 'text-child-anchor-widgets)
+
+(defcfun (text-view-add-child-in-window "gtk_text_view_add_child_in_window") :void
+  (text-view (g-object text-view))
+  (child (g-object widget))
+  (which-window text-window-type)
+  (x-pos :int)
+  (y-pos :int))
+
+(export 'text-view-add-child-in-window)
+
+(defcfun (text-view-move-child "gtk_text_view_move_child") :void
+  (text-view (g-object text-view))
+  (child (g-object widget))
+  (x-pos :int)
+  (y-pos :int))
+
+(export 'text-view-move-child)