Fix typos in GtkTreeModel
[cl-gtk2.git] / gtk / gtk.text.lisp
blob73a49853f532542f5eedad4e731c9016239f9c4c
1 (in-package :gtk)
3 ;; text iter
6 (define-foreign-type unichar ()
7 ()
8 (:actual-type :uint32)
9 (:simple-parser unichar))
11 (defmethod translate-from-foreign (value (type unichar))
12 (code-char value))
14 (defmethod translate-to-foreign (value (type unichar))
15 (char-code value))
17 (define-g-boxed-opaque text-iter "GtkTextIter"
18 :alloc (gtk-text-iter-alloc))
20 (define-boxed-opaque-accessor text-iter text-iter-buffer :reader "gtk_text_iter_get_buffer" :type (g-object text-buffer))
21 (define-boxed-opaque-accessor text-iter text-iter-offset :reader "gtk_text_iter_get_offset" :writer "gtk_text_iter_set_offset" :type :int)
22 (define-boxed-opaque-accessor text-iter text-iter-line :reader "gtk_text_iter_get_line" :writer "gtk_text_iter_set_line" :type :int)
23 (define-boxed-opaque-accessor text-iter text-iter-line-offset :reader "gtk_text_iter_get_line_offset" :writer "gtk_text_iter_set_line_offset" :type :int)
24 (define-boxed-opaque-accessor text-iter text-iter-visible-line-offset :reader "gtk_text_iter_get_visible_line_offset" :writer "gtk_text_iter_set_visible_line_offset" :type :int)
25 (define-boxed-opaque-accessor text-iter text-iter-char :reader "gtk_text_iter_get_char" :type unichar)
26 (define-boxed-opaque-accessor text-iter text-iter-pixbuf :reader "gtk_text_iter_get_pixbuf" :type (g-object pixbuf))
27 (define-boxed-opaque-accessor text-iter text-iter-marks :reader "gtk_text_iter_get_marks" :type (gslist (g-object text-mark) :free-from-foreign t))
28 (define-boxed-opaque-accessor text-iter text-iter-child-anchor :reader "gtk_text_iter_get_child_anchor" :type (g-object text-child-anchor))
29 (define-boxed-opaque-accessor text-iter text-iter-tags :reader "gtk_text_iter_get_tags" :type (gslist (g-object text-tag) :free-from-foreign t))
30 (define-boxed-opaque-accessor text-iter text-iter-chars-in-line :reader "gtk_text_iter_get_chars_in_line" :type :int)
31 (define-boxed-opaque-accessor text-iter text-iter-language :reader "gtk_text_iter_get_language" :type :pointer)
32 (define-boxed-opaque-accessor text-iter text-iter-is-end :reader "gtk_text_iter_is_end" :type :boolean)
33 (define-boxed-opaque-accessor text-iter text-iter-is-start :reader "gtk_text_iter_is_start" :type :boolean)
34 (define-boxed-opaque-accessor text-iter text-iter-starts-word :reader "gtk_text_iter_starts_word" :type :boolean)
35 (define-boxed-opaque-accessor text-iter text-iter-ends-word :reader "gtk_text_iter_ends_word" :type :boolean)
36 (define-boxed-opaque-accessor text-iter text-iter-inside-word :reader "gtk_text_iter_inside_word" :type :boolean)
37 (define-boxed-opaque-accessor text-iter text-iter-starts-line :reader "gtk_text_iter_starts_line" :type :boolean)
38 (define-boxed-opaque-accessor text-iter text-iter-ends-line :reader "gtk_text_iter_ends_line" :type :boolean)
39 (define-boxed-opaque-accessor text-iter text-iter-starts-sentence :reader "gtk_text_iter_starts_sentence" :type :boolean)
40 (define-boxed-opaque-accessor text-iter text-iter-ends-sentence :reader "gtk_text_iter_ends_sentence" :type :boolean)
41 (define-boxed-opaque-accessor text-iter text-iter-inside-sentence :reader "gtk_text_iter_inside_sentence" :type :boolean)
42 (define-boxed-opaque-accessor text-iter text-iter-is-cursor-position :reader "gtk_text_iter_is_cursor_position" :type :boolean)
44 (export (boxed-related-symbols 'text-iter))
45 (export '(text-iter-buffer text-iter-offset text-iter-line
46 text-iter-line-offset text-iter-visible-line-offset
47 text-iter-char text-iter-pixbuf text-iter-marks
48 text-iter-child-anchor text-iter-tags
49 text-iter-chars-in-line text-iter-language text-iter-is-end
50 text-iter-is-start text-iter-can-insert
51 text-iter-starts-word text-iter-ends-word
52 text-iter-inside-word text-iter-starts-line
53 text-iter-ends-line text-iter-starts-sentence
54 text-iter-ends-sentence text-iter-inside-sentence
55 text-iter-is-cursor-position ))
57 (defcstruct %text-iter
58 (dummy1 :pointer)
59 (dummy2 :pointer)
60 (dummy3 :int)
61 (dummy4 :int)
62 (dummy5 :int)
63 (dummy6 :int)
64 (dummy7 :int)
65 (dummy8 :int)
66 (dummy9 :pointer)
67 (dummy10 :pointer)
68 (dummy11 :int)
69 (dummy12 :int)
70 (dummy13 :int)
71 (dummy14 :pointer))
73 (defcfun gtk-text-iter-copy :pointer
74 (iter :pointer))
76 (defun gtk-text-iter-alloc ()
77 (with-foreign-object (iter '%text-iter)
78 (gtk-text-iter-copy iter)))
80 (defcfun (text-iter-slice "gtk_text_iter_get_slice") (g-string :free-from-foreign t)
81 (start (g-boxed-foreign text-iter))
82 (end (g-boxed-foreign text-iter)))
84 (export 'text-iter-slice)
86 (defcfun (text-iter-text "gtk_text_iter_get_text") (g-string :free-from-foreign t)
87 (start (g-boxed-foreign text-iter))
88 (end (g-boxed-foreign text-iter)))
90 (export 'text-iter-text)
92 (defcfun (text-iter-visible-slice "gtk_text_iter_get_visible_slice") (g-string :free-from-foreign t)
93 (start (g-boxed-foreign text-iter))
94 (end (g-boxed-foreign text-iter)))
96 (export 'text-iter-visible-slice)
98 (defcfun (text-iter-visible-text "gtk_text_iter_get_visible_text") (g-string :free-from-foreign t)
99 (start (g-boxed-foreign text-iter))
100 (end (g-boxed-foreign text-iter)))
102 (export 'text-iter-visible-text)
104 (defcfun (text-iter-toggled-tags "gtk_text_iter_get_toggled_tags") (gslist (g-object text-tag))
105 (iter (g-boxed-foreign text-iter))
106 (toggled-on :boolean))
108 (export 'text-iter-toggled-tags)
110 (defcfun (text-iter-begins-tag "gtk_text_iter_begins_tag") :boolean
111 (iter (g-boxed-foreign text-iter))
112 (tag (g-object text-tag)))
114 (export 'text-iter-begins-tag)
116 (defcfun (text-iter-ends-tag "gtk_text_iter_ends_tag") :boolean
117 (iter (g-boxed-foreign text-iter))
118 (tag (g-object text-tag)))
120 (export 'text-iter-ends-tag)
122 (defcfun (text-iter-toggles-tag "gtk_text_iter_toggles_tag") :boolean
123 (iter (g-boxed-foreign text-iter))
124 (tag (g-object text-tag)))
126 (export 'text-iter-toggles-tag)
128 (defcfun (text-iter-has-tag "gtk_text_iter_has_tag") :boolean
129 (iter (g-boxed-foreign text-iter))
130 (tag (g-object text-tag)))
132 (export 'text-iter-has-tag)
134 (defcfun (text-iter-editable "gtk_text_iter_editable") :boolean
135 (iter (g-boxed-foreign text-iter))
136 (default :boolean))
138 (export 'text-iter-editable)
140 (defcfun (text-iter-can-insert "gtk_text_iter_can_insert") :boolean
141 (iter (g-boxed-foreign text-iter))
142 (default-editable :boolean))
144 (export 'text-iter-can-insert)
146 (defcfun gtk-text-iter-get-attributes :boolean
147 (iter (g-boxed-foreign text-iter))
148 (values (g-object text-attributes)))
150 (defun text-iter-attributes (iter default-attributes)
151 (let ((changed-p (gtk-text-iter-get-attributes iter default-attributes)))
152 (values default-attributes changed-p)))
154 (export 'text-iter-attributes)
156 (defcfun gtk-text-iter-forward-chars :boolean
157 (iter (g-boxed-foreign text-iter))
158 (count :int))
160 (defcfun gtk-text-iter-forward-lines :boolean
161 (iter (g-boxed-foreign text-iter))
162 (count :int))
164 (defcfun gtk-text-iter-forward-word-ends :boolean
165 (iter (g-boxed-foreign text-iter))
166 (count :int))
168 (defcfun gtk-text-iter-backward-word-starts :boolean
169 (iter (g-boxed-foreign text-iter))
170 (count :int))
172 (defcfun gtk-text-iter-forward-cursor-positions :boolean
173 (iter (g-boxed-foreign text-iter))
174 (count :int))
176 (defcfun gtk-text-iter-forward-sentence-ends :boolean
177 (iter (g-boxed-foreign text-iter))
178 (count :int))
180 (defcfun gtk-text-iter-backward-sentence-starts :boolean
181 (iter (g-boxed-foreign text-iter))
182 (count :int))
184 (defcfun gtk-text-iter-forward-visible-word-ends :boolean
185 (iter (g-boxed-foreign text-iter))
186 (count :int))
188 (defcfun gtk-text-iter-backward-visible-word-starts :boolean
189 (iter (g-boxed-foreign text-iter))
190 (count :int))
192 (defcfun gtk-text-iter-forward-visible-cursor-positions :boolean
193 (iter (g-boxed-foreign text-iter))
194 (count :int))
196 (defcfun gtk-text-iter-forward-visible-lines :boolean
197 (iter (g-boxed-foreign text-iter))
198 (count :int))
200 (defun text-iter-move (iter &key (count 1) (by :char) (direction :forward))
201 (assert (typep by '(member :char :line :word :cursor-position :sentence :visible-word :visible-line :visible-cursor-position)))
202 (assert (typep direction '(member :forward :backward)))
203 (when (and (member by '(:char :ine :cursor-position :visible-line :visible-cursor-position)) (eq direction :backward))
204 (setf count (- count)))
205 (ecase by
206 (:char (gtk-text-iter-forward-chars iter count))
207 (:line (gtk-text-iter-forward-lines iter count))
208 (:word (if (eq direction :forward)
209 (gtk-text-iter-forward-word-ends iter count)
210 (gtk-text-iter-backward-word-starts iter count)))
211 (:cursor-position (gtk-text-iter-forward-cursor-positions iter count))
212 (:sentence (if (eq direction :forward)
213 (gtk-text-iter-forward-sentence-ends iter count)
214 (gtk-text-iter-backward-sentence-starts iter count)))
215 (:visible-word (if (eq direction :forward)
216 (gtk-text-iter-forward-visible-word-ends iter count)
217 (gtk-text-iter-backward-visible-word-starts iter count)))
218 (:visible-line (gtk-text-iter-forward-visible-lines iter count))
219 (:visible-cursor-position (gtk-text-iter-forward-visible-cursor-positions iter count))))
221 (export 'text-iter-move)
223 (defcfun (text-iter-forward-to-end "gtk_text_iter_forward_to_end") :void
224 (iter (g-boxed-foreign text-iter)))
226 (export 'text-iter-forward-to-end)
228 (defcfun (text-iter-forward-to-line-end "gtk_text_iter_forward_to_line_end") :boolean
229 (iter (g-boxed-foreign text-iter)))
231 (export 'text-iter-forward-to-line-end)
233 (defcfun (text-iter-forward-to-tag-toggle "gtk_text_iter_forward_to_tag_toggle") :boolean
234 (iter (g-boxed-foreign text-iter))
235 (tag (g-object text-tag)))
237 (defcfun (text-iter-backward-to-tag-toggle "gtk_text_iter_backward_to_tag_toggle") :boolean
238 (iter (g-boxed-foreign text-iter))
239 (tag (g-object text-tag)))
241 (export '(text-iter-forward-to-tag-toggle text-iter-backward-to-tag-toggle))
243 (defcallback gtk-text-char-predicate :boolean ((char unichar) (user-data :pointer))
244 (let ((function (get-stable-pointer-value user-data)))
245 (funcall function char)))
247 (defcfun gtk-text-iter-forward-find-char :boolean
248 (iter (g-boxed-foreign text-iter))
249 (pred :pointer)
250 (user-data :pointer)
251 (limit (g-boxed-foreign text-iter)))
253 (defcfun gtk-text-iter-backward-find-char :boolean
254 (iter (g-boxed-foreign text-iter))
255 (pred :pointer)
256 (user-data :pointer)
257 (limit (g-boxed-foreign text-iter)))
259 (defun text-iter-find-char (iter predicate &key limit (direction :forward))
260 (assert (typep direction '(member :forward :backward)))
261 (with-stable-pointer (ptr predicate)
262 (if (eq direction :forward)
263 (gtk-text-iter-forward-find-char iter (callback gtk-text-char-predicate) ptr limit)
264 (gtk-text-iter-backward-find-char iter (callback gtk-text-char-predicate) ptr limit))))
266 (export 'text-iter-find-char)
268 (defcfun gtk-text-iter-forward-search :boolean
269 (iter (g-boxed-foreign text-iter))
270 (str (:string :free-to-foreign t))
271 (flags text-search-flags)
272 (match-start (g-boxed-foreign text-iter))
273 (match-end (g-boxed-foreign text-iter))
274 (limit (g-boxed-foreign text-iter)))
276 (defcfun gtk-text-iter-backward-search :boolean
277 (iter (g-boxed-foreign text-iter))
278 (str (:string :free-to-foreign t))
279 (flags text-search-flags)
280 (match-start (g-boxed-foreign text-iter))
281 (match-end (g-boxed-foreign text-iter))
282 (limit (g-boxed-foreign text-iter)))
284 (defun text-iter-search (start-position string &key flags limit (direction :forward))
285 (assert (typep direction '(member :forward :backward)))
286 (let ((i1 (make-instance 'text-iter))
287 (i2 (make-instance 'text-iter)))
288 (if (if (eq direction :forward)
289 (gtk-text-iter-forward-search start-position string flags i1 i2 limit)
290 (gtk-text-iter-backward-search start-position string flags i1 i2 limit))
291 (values t i1 i2)
292 (values nil nil nil))))
294 (export 'text-iter-search)
296 (defcfun (text-iter-equal "gtk_text_iter_equal") :boolean
297 (iter-1 (g-boxed-foreign text-iter))
298 (iter-2 (g-boxed-foreign text-iter)))
300 (export 'text-iter-equal)
302 (defcfun (text-iter-compare "gtk_text_iter_compare") :int
303 (iter-1 (g-boxed-foreign text-iter))
304 (iter-2 (g-boxed-foreign text-iter)))
306 (export 'text-iter-compare)
308 (defcfun (text-iter-in-range "gtk_text_iter_in_range") :boolean
309 (iter (g-boxed-foreign text-iter))
310 (start (g-boxed-foreign text-iter))
311 (end (g-boxed-foreign text-iter)))
313 (export 'text-iter-in-range)
315 (defcfun (text-iter-order "gtk_text_iter_order") :void
316 (iter-1 (g-boxed-foreign text-iter))
317 (iter-2 (g-boxed-foreign text-iter)))
319 (export 'text-iter-order)
321 ;; text buffer
323 (defcfun (text-buffer-line-count "gtk_text_buffer_get_line_count") :int
324 (buffer (g-object text-buffer)))
326 (export 'text-buffer-line-count)
328 (defcfun (text-buffer-char-count "gtk_text_buffer_get_char_count") :int
329 (buffer (g-object text-buffer)))
331 (export 'text-buffer)
333 (defcfun gtk-text-buffer-insert :void
334 (buffer (g-object text-buffer))
335 (iter (g-boxed-foreign text-iter))
336 (text (:string :free-to-foreign t))
337 (len :int))
339 (defcfun gtk-text-buffer-insert-at-cursor :void
340 (buffer (g-object text-buffer))
341 (text (:string :free-to-foreign t))
342 (len :int))
344 (defcfun gtk-text-buffer-insert-interactive :boolean
345 (buffer (g-object text-buffer))
346 (iter (g-boxed-foreign text-iter))
347 (text (:string :free-to-foreign t))
348 (len :int)
349 (default-editable :boolean))
351 (defcfun gtk-text-buffer-insert-interactive-at-cursor :boolean
352 (buffer (g-object text-buffer))
353 (text (:string :free-to-foreign t))
354 (len :int)
355 (default-editable :boolean))
357 (defun text-buffer-insert (buffer text &key (position :cursor) (interactive nil) (default-editable t))
358 (assert (typep position '(or text-iter (member :cursor))))
359 (if interactive
360 (if (eq position :cursor)
361 (gtk-text-buffer-insert-interactive-at-cursor buffer text -1 default-editable)
362 (gtk-text-buffer-insert-interactive buffer position text -1 default-editable))
363 (progn (if (eq position :cursor)
364 (gtk-text-buffer-insert-at-cursor buffer text -1)
365 (gtk-text-buffer-insert buffer position text -1))
366 t)))
368 (export 'text-buffer-insert)
370 (defcfun gtk-text-buffer-insert-range :void
371 (buffer (g-object text-buffer))
372 (iter (g-boxed-foreign text-iter))
373 (range-start (g-boxed-foreign text-iter))
374 (range-end (g-boxed-foreign text-iter)))
376 (defcfun gtk-text-buffer-insert-range-interactive :boolean
377 (buffer (g-object text-buffer))
378 (iter (g-boxed-foreign text-iter))
379 (range-start (g-boxed-foreign text-iter))
380 (range-end (g-boxed-foreign text-iter))
381 (default-editable :boolean))
383 (defun text-buffer-insert-range (buffer position range-start range-end &key interactive default-editable)
384 (if interactive
385 (gtk-text-buffer-insert-range-interactive buffer position range-start range-end default-editable)
386 (progn (gtk-text-buffer-insert-range buffer position range-start range-end)
387 t)))
389 (export 'text-buffer-insert-range)
391 (defcfun gtk-text-buffer-delete :void
392 (buffer (g-object text-buffer))
393 (range-start (g-boxed-foreign text-iter))
394 (range-end (g-boxed-foreign text-iter)))
396 (defcfun gtk-text-buffer-delete-interactive :boolean
397 (buffer (g-object text-buffer))
398 (range-start (g-boxed-foreign text-iter))
399 (range-end (g-boxed-foreign text-iter))
400 (default-editable :boolean))
402 (defun text-buffer-delete (buffer range-start range-end &key interactive default-editable)
403 (if interactive
404 (gtk-text-buffer-delete-interactive buffer range-start range-end default-editable)
405 (progn (gtk-text-buffer-delete buffer range-start range-end)
406 t)))
408 (export 'text-buffer-delete)
410 (defcfun gtk-text-buffer-backspace :boolean
411 (buffer (g-object text-buffer))
412 (iter (g-boxed-foreign text-iter))
413 (interactive :boolean)
414 (default-editable :boolean))
416 (defun text-buffer-backspace (buffer position &key interactive default-editable)
417 (gtk-text-buffer-backspace buffer position interactive default-editable))
419 (export 'text-buffer-backspace)
421 (defcfun gtk-text-buffer-get-slice (:string :free-from-foreign t)
422 (buffer (g-object text-buffer))
423 (range-start (g-boxed-foreign text-iter))
424 (range-end (g-boxed-foreign text-iter))
425 (include-hidden-chars :boolean))
427 (defun text-buffer-slice (buffer range-start range-end &key include-hidden-chars)
428 (gtk-text-buffer-get-slice buffer range-start range-end include-hidden-chars))
430 (export 'text-buffer-slice)
432 (defcfun (text-buffer-insert-pixbuf "gtk_text_buffer_insert_pixbuf") :void
433 (buffer (g-object text-buffer))
434 (position (g-boxed-foreign text-iter))
435 (pixbuf (g-object pixbuf)))
437 (export 'text-buffer-insert-pixbuf)
439 (defcfun gtk-text-buffer-insert-child-anchor :void
440 (buffer (g-object text-buffer))
441 (iter (g-boxed-foreign text-iter))
442 (anchor (g-object text-child-anchor)))
444 (defcfun gtk-text-buffer-create-child-anchor (g-object text-child-anchor)
445 (buffer (g-object text-buffer))
446 (iter (g-boxed-foreign text-iter)))
448 (defun text-buffer-insert-child-anchor (buffer position &optional anchor)
449 (if anchor
450 (progn (gtk-text-buffer-insert-child-anchor buffer position anchor)
451 anchor)
452 (gtk-text-buffer-create-child-anchor buffer position)))
454 (export 'text-buffer-insert-child-anchor)
456 (defcfun gtk-text-buffer-create-mark (g-object text-mark)
457 (buffer (g-object text-buffer))
458 (name (:string :free-to-foreign t))
459 (position (g-boxed-foreign text-iter))
460 (left-gravity :boolean))
462 (defun text-buffer-create-mark (buffer name position &optional (left-gravity t))
463 (gtk-text-buffer-create-mark buffer name position left-gravity))
465 (export 'text-buffer-create-mark)
467 (defcfun gtk-text-buffer-move-mark :void
468 (buffer (g-object text-buffer))
469 (mark (g-object text-mark))
470 (position (g-boxed-foreign text-iter)))
472 (defcfun gtk-text-buffer-move-mark-by-name :void
473 (buffer (g-object text-buffer))
474 (name (:string :free-to-foreign t))
475 (position (g-boxed-foreign text-iter)))
477 (defun text-buffer-move-mark (buffer mark position)
478 (etypecase mark
479 (string (gtk-text-buffer-move-mark-by-name buffer mark position))
480 (text-mark (gtk-text-buffer-move-mark buffer mark position))))
482 (export 'text-buffer-move-mark)
484 (defcfun (text-buffer-add-mark "gtk_text_buffer_add_mark") :void
485 (buffer (g-object text-buffer))
486 (mark (g-object text-mark))
487 (position (g-boxed-foreign text-iter)))
489 (export 'text-buffer-add-mark)
491 (defcfun gtk-text-buffer-delete-mark :void
492 (buffer (g-object text-buffer))
493 (mark (g-object text-mark)))
495 (defcfun gtk-text-buffer-delete-mark-by-name :void
496 (buffer (g-object text-buffer))
497 (name (:string :free-to-foreign t)))
499 (defun text-buffer-delete-mark (buffer mark)
500 (etypecase mark
501 (string (gtk-text-buffer-delete-mark-by-name buffer mark))
502 (text-mark (gtk-text-buffer-delete-mark buffer mark))))
504 (export 'text-buffer-delete-mark)
506 (defcfun (text-buffer-get-mark "gtk_text_buffer_get_mark") (g-object text-mark)
507 (buffer (g-object text-buffer))
508 (name (:string :free-to-foreign t)))
510 (export 'text-buffer-get-mark)
512 (defcfun (text-buffer-insertion-mark "gtk_text_buffer_get_insert") (g-object text-mark)
513 (buffer (g-object text-buffer)))
515 (export 'text-buffer-insertion-mark)
517 (defcfun (text-buffer-selection-bound "gtk_text_buffer_get_selection_bound") (g-object text-mark)
518 (buffer (g-object text-buffer)))
520 (export 'text-buffer-selection-bound)
522 (defcfun (text-buffer-place-cursor "gtk_text_buffer_place_cursor") :void
523 (buffer (g-object text-buffer))
524 (position (g-boxed-foreign text-iter)))
526 (export 'text-buffer-place-cursor)
528 (defcfun (text-buffer-select-range "gtk_text_buffer_select_range") :void
529 (buffer (g-object text-buffer))
530 (insertion-point (g-boxed-foreign text-iter))
531 (selection-bound (g-boxed-foreign text-iter)))
533 (export 'text-buffer-select-range)
535 (defcfun gtk-text-buffer-apply-tag :void
536 (buffer (g-object text-buffer))
537 (tag (g-object text-tag))
538 (start (g-boxed-foreign text-iter))
539 (end (g-boxed-foreign text-iter)))
541 (defcfun gtk-text-buffer-apply-tag-by-name :void
542 (buffer (g-object text-buffer))
543 (name (:string :free-to-foreign t))
544 (start (g-boxed-foreign text-iter))
545 (end (g-boxed-foreign text-iter)))
547 (defun text-buffer-apply-tag (buffer tag start end)
548 (etypecase tag
549 (string (gtk-text-buffer-apply-tag-by-name buffer tag start end))
550 (text-tag (gtk-text-buffer-apply-tag buffer tag start end))))
552 (export 'text-buffer-apply-tag)
554 (defcfun gtk-text-buffer-remove-tag :void
555 (buffer (g-object text-buffer))
556 (tag (g-object text-tag))
557 (start (g-boxed-foreign text-iter))
558 (end (g-boxed-foreign text-iter)))
560 (defcfun gtk-text-buffer-remove-tag-by-name :void
561 (buffer (g-object text-buffer))
562 (name (:string :free-to-foreign t))
563 (start (g-boxed-foreign text-iter))
564 (end (g-boxed-foreign text-iter)))
566 (defun text-buffer-remove-tag (buffer tag start end)
567 (etypecase tag
568 (string (gtk-text-buffer-remove-tag-by-name buffer tag start end))
569 (text-tag (gtk-text-buffer-remove-tag buffer tag start end))))
571 (export 'text-buffer-remove-tag)
573 (defcfun (text-buffer-remove-all-tags "gtk_text_buffer_remove_all_tags") :void
574 (buffer (g-object text-buffer))
575 (start (g-boxed-foreign text-iter))
576 (end (g-boxed-foreign text-iter)))
578 (defcfun gtk-text-buffer-get-iter-at-line-offset :void
579 (buffer (g-object text-buffer))
580 (iter (g-boxed-foreign text-iter))
581 (line-number :int)
582 (char-offset :int))
584 (defun text-buffer-get-iter-at-line-offset (buffer line-number char-offset)
585 (let ((iter (make-instance 'text-iter)))
586 (gtk-text-buffer-get-iter-at-line-offset buffer iter line-number char-offset)
587 iter))
589 (export 'text-buffer-get-iter-at-line-offset)
591 (defcfun gtk-text-buffer-get-iter-at-offset :void
592 (buffer (g-object text-buffer))
593 (iter (g-boxed-foreign text-iter))
594 (char-offset :int))
596 (defun text-buffer-get-iter-at-offset (buffer offset)
597 (let ((iter (make-instance 'text-iter)))
598 (gtk-text-buffer-get-iter-at-offset buffer iter offset)
599 iter))
601 (export 'text-buffer-get-iter-at-offset)
603 (defcfun gtk-text-buffer-get-iter-at-line :void
604 (buffer (g-object text-buffer))
605 (iter (g-boxed-foreign text-iter))
606 (line-number :int))
608 (defun text-buffer-get-iter-at-line (buffer line-number)
609 (let ((iter (make-instance 'text-iter)))
610 (gtk-text-buffer-get-iter-at-line buffer iter line-number)
611 iter))
613 (export 'text-buffet-get-iter-at-line)
615 (defcfun gtk-text-buffer-get-iter-at-mark :void
616 (buffer (g-object text-buffer))
617 (iter (g-boxed-foreign text-iter))
618 (mark (g-object text-mark)))
620 (defun text-buffer-get-iter-at-mark (buffer mark)
621 (when (stringp mark)
622 (setf mark (text-buffer-get-mark buffer mark)))
623 (let ((iter (make-instance 'text-iter)))
624 (gtk-text-buffer-get-iter-at-mark buffer iter mark)
625 iter))
627 (export 'text-buffer-get-iter-at-mark)
629 (defcfun gtk-text-buffer-get-iter-at-child-anchor :void
630 (buffer (g-object text-buffer))
631 (iter (g-boxed-foreign text-iter))
632 (anchor (g-object text-child-anchor)))
634 (defun text-buffer-get-iter-at-child-anchor (buffer anchor)
635 (let ((iter (make-instance 'text-iter)))
636 (gtk-text-buffer-get-iter-at-child-anchor buffer iter anchor)
637 iter))
639 (export 'text-buffer-get-iter-at-child-anchor)
641 (defcfun gtk-text-buffer-get-start-iter :void
642 (buffer (g-object text-buffer))
643 (iter (g-boxed-foreign text-iter)))
645 (defun text-buffer-get-start-iter (buffer)
646 (let ((iter (make-instance 'text-iter)))
647 (gtk-text-buffer-get-start-iter buffer iter)
648 iter))
650 (export 'text-buffer-get-start-iter)
652 (defcfun gtk-text-buffer-get-end-iter :void
653 (buffer (g-object text-buffer))
654 (iter (g-boxed-foreign text-iter)))
656 (defun text-buffer-get-end-iter (buffer)
657 (let ((iter (make-instance 'text-iter)))
658 (gtk-text-buffer-get-end-iter buffer iter)
659 iter))
661 (export 'text-buffer-get-end-iter)
663 (defcfun gtk-text-buffer-get-bounds :void
664 (buffer (g-object text-buffer))
665 (start (g-boxed-foreign text-iter))
666 (end (g-boxed-foreign text-iter)))
668 (defun text-buffer-get-bounds (buffer)
669 (let ((start (make-instance 'text-iter))
670 (end (make-instance 'text-iter)))
671 (gtk-text-buffer-get-bounds buffer start end)
672 (values start end)))
674 (export 'text-buffer-get-bounds)
676 (defcfun gtk-text-buffer-delete-selection :boolean
677 (bufer (g-object text-buffer))
678 (interactive :boolean)
679 (default-editable :boolean))
681 (defun text-buffer-delete-selection (buffer &key interactive default-editable)
682 (gtk-text-buffer-delete-selection buffer interactive default-editable))
684 (export 'text-buffer-delete-selection)
686 (defcfun gtk-text-buffer-paste-clipboard :void
687 (buffer (g-object text-buffer))
688 (clipboard (g-object clipboard))
689 (override-location (g-boxed-foreign text-iter))
690 (default-editable :boolean))
692 (defun text-buffer-paste-clipboard (buffer clipboard &key position default-editable)
693 (gtk-text-buffer-paste-clipboard buffer clipboard position default-editable))
695 (export 'text-buffer-paste-clipboard)
697 (defcfun (text-buffer-copy-clipboard "gtk_text_buffer_copy_clipboard") :void
698 (buffer (g-object text-buffer))
699 (clipboard (g-object clipboard)))
701 (export 'text-buffer-copy-clipboard)
703 (defcfun (text-buffer-cut-clipboard "gtk_text_buffer_cut_clipboard") :void
704 (buffer (g-object text-buffer))
705 (clipboard (g-object clipboard))
706 (default-editable :boolean))
708 (export 'text-buffer-cut-clipboard)
710 (defcfun gtk-text-buffer-get-selection-bounds :boolean
711 (buffer (g-object text-buffer))
712 (start (g-boxed-foreign text-iter))
713 (end (g-boxed-foreign text-iter)))
715 (defun text-buffer-get-selection-bounds (buffer)
716 (let ((i1 (make-instance 'text-iter))
717 (i2 (make-instance 'text-iter)))
718 (if (gtk-text-buffer-get-selection-bounds buffer i1 i2)
719 (values i1 i2)
720 (values nil nil))))
722 (export 'text-buffer-get-selection-bounds)
724 (defcfun (text-buffer-begin-user-action "gtk_text_buffer_begin_user_action") :void
725 (buffer (g-object text-buffer)))
727 (export 'text-buffer-begin-user-action)
729 (defcfun (text-buffer-end-user-action "gtk_text_buffer_end_user_action") :void
730 (buffer (g-object text-buffer)))
732 (export 'text-buffer-end-user-action)
734 (defmacro with-text-buffer-user-action ((buffer) &body body)
735 (let ((g (gensym)))
736 `(let ((,g ,buffer))
737 (text-buffer-begin-user-action ,g)
738 (unwind-protect
739 (progn ,@body)
740 (text-buffer-end-user-action ,g)))))
742 (export 'with-text-buffer-user-action)
744 (defcfun (text-buffer-add-selection-clipboard "gtk_text_buffer_add_selection_clipboard") :void
745 (buffer (g-object text-buffer))
746 (clipboard (g-object clipboard)))
748 (defcfun (text-buffer-remove-selection-clipboard "gtk_text_buffer_remove_selection_clipboard") :void
749 (buffer (g-object text-buffer))
750 (clipboard (g-object clipboard)))
752 (export 'text-buffer-remove-selection-clipboard)
754 (defcfun gtk-text-buffer-deserialize :boolean
755 (register-buffer (g-object text-buffer))
756 (content-buffer (g-object text-buffer))
757 (format gdk-atom-as-string)
758 (iter (g-boxed-foreign text-iter))
759 (data :pointer)
760 (length gsize)
761 (error :pointer))
763 (defun text-buffer-deserialize (register-buffer content-buffer format iter data)
764 (let ((bytes (foreign-alloc :uint8 :count (length data))))
765 (iter (for i from 0 below (length data))
766 (setf (mem-aref bytes :uint8 i) (aref data i)))
767 (unwind-protect
768 (with-g-error (err)
769 (gtk-text-buffer-deserialize register-buffer content-buffer
770 format iter bytes (length data) err))
771 (foreign-free bytes))))
773 (export 'text-buffer-deserialize)
775 (defcfun (text-buffer-deserialize-can-create-tags "gtk_text_buffer_deserialize_get_can_create_tags") :boolean
776 (buffer (g-object text-buffer))
777 (format gdk-atom-as-string))
779 (defcfun gtk-text-buffer-deserialize-set-can-create-tags :void
780 (buffer (g-object text-buffer))
781 (format gdk-atom-as-string)
782 (can-create-tags :boolean))
784 (defun (setf text-buffer-deserialize-can-create-tags) (new-value buffer format)
785 (gtk-text-buffer-deserialize-set-can-create-tags buffer format new-value))
787 (export 'text-buffer-deserialize-can-create-tags)
789 (defcfun gtk-text-buffer-get-deserialize-formats (:pointer gdk-atom-as-string)
790 (text-buffer (g-object text-buffer))
791 (n-formats (:pointer :int)))
793 (defun text-buffer-get-deserialize-formats (text-buffer)
794 (with-foreign-object (n-formats :int)
795 (let ((atoms-ptr (gtk-text-buffer-get-deserialize-formats text-buffer n-formats)))
796 (iter (for i from 0 below (mem-ref n-formats :int))
797 (for atom = (mem-aref atoms-ptr 'gdk-atom-as-string i))
798 (collect atom)))))
800 (export 'text-buffer-get-deserialize-formats)
802 (defcfun gtk-text-buffer-get-serialize-formats (:pointer gdk-atom-as-string)
803 (text-buffer (g-object text-buffer))
804 (n-formats (:pointer :int)))
806 (defun text-buffer-get-serialize-formats (text-buffer)
807 (with-foreign-object (n-formats :int)
808 (let ((atoms-ptr (gtk-text-buffer-get-serialize-formats text-buffer n-formats)))
809 (iter (for i from 0 below (mem-ref n-formats :int))
810 (for atom = (mem-aref atoms-ptr 'gdk-atom-as-string i))
811 (collect atom)))))
813 (export 'text-buffer-get-serialize-formats)
815 (defcallback gtk-text-buffer-deserialize-cb :boolean
816 ((register-buffer (g-object text-buffer))
817 (content-buffer (g-object text-buffer))
818 (iter (g-boxed-foreign text-iter))
819 (data :pointer)
820 (length gsize)
821 (create-tags :boolean)
822 (user-data :pointer)
823 (error :pointer))
824 (with-catching-to-g-error (error)
825 (let ((fn (stable-pointer-value user-data)))
826 (restart-case
827 (let ((bytes (iter (with bytes = (make-array length :element-type '(unsigned-byte 8)))
828 (for i from 0 below length)
829 (setf (aref bytes i) (mem-ref data :uint8 i))
830 (finally (return bytes)))))
831 (progn (funcall fn register-buffer content-buffer iter bytes create-tags) t))
832 (return-from-text-buffer-deserialize-cb ()
833 (error 'g-error-condition
834 :domain "cl-gtk2"
835 :code 0
836 :message "'return-from-text-buffer-deserialize-cb' restart was called"))))))
838 (defcfun gtk-text-buffer-register-deserialize-format gdk-atom-as-string
839 (buffer (g-object text-buffer))
840 (mime-type :string)
841 (function :pointer)
842 (user-data :pointer)
843 (destroy-notify :pointer))
845 (defun text-buffer-register-deserialize-format (buffer mime-type function)
846 (gtk-text-buffer-register-deserialize-format buffer mime-type
847 (callback gtk-text-buffer-deserialize-cb)
848 (allocate-stable-pointer function)
849 (callback stable-pointer-free-destroy-notify-callback)))
851 (export 'text-buffer-register-deserialize-format)
853 (defcfun (text-buffer-register-deserialize-tagset "gtk_text_buffer_register_deserialize_tagset") gdk-atom-as-string
854 (buffer (g-object text-buffer))
855 (tagset-name :string))
857 (export 'text-buffer-register-deserialize-tagset)
859 (defcallback gtk-text-buffer-serialize-cb :pointer
860 ((register-buffer (g-object text-buffer))
861 (content-buffer (g-object text-buffer))
862 (start-iter (g-boxed-foreign text-iter))
863 (end-iter (g-boxed-foreign text-iter))
864 (length (:pointer gsize))
865 (user-data :pointer))
866 (let ((fn (stable-pointer-value user-data)))
867 (restart-case
868 (let* ((bytes (funcall fn register-buffer content-buffer start-iter end-iter))
869 (bytes-ptr (g-malloc (length bytes))))
870 (setf (mem-ref length 'gsize) (length bytes))
871 (iter (for i from 0 below (length bytes))
872 (setf (mem-aref bytes-ptr :uint8 i) (aref bytes i)))
873 bytes-ptr)
874 (return-from-text-buffer-serialize-cb () nil))))
876 (defcfun gtk-text-buffer-register-serialize-format gdk-atom-as-string
877 (buffer (g-object text-buffer))
878 (mime-type :string)
879 (function :pointer)
880 (user-data :pointer)
881 (destroy-notify :pointer))
883 (defun text-buffer-register-serialize-format (buffer mime-type function)
884 (gtk-text-buffer-register-serialize-format buffer mime-type
885 (callback gtk-text-buffer-serialize-cb)
886 (allocate-stable-pointer function)
887 (callback stable-pointer-free-destroy-notify-callback)))
889 (export 'text-buffer-register-serialize-format)
891 (defcfun (text-buffer-register-serialize-tagset "gtk_text_buffer_register_serialize_tagset") gdk-atom-as-string
892 (buffer (g-object text-buffer))
893 (tagset-name :string))
895 (export 'text-buffer-register-serialize-tagset)
897 (defcfun gtk-text-buffer-serialize :pointer
898 (register-buffer (g-object text-buffer))
899 (content-buffer (g-object text-buffer))
900 (format gdk-atom-as-string)
901 (start (g-boxed-foreign text-iter))
902 (end (g-boxed-foreign text-iter))
903 (length (:pointer gsize)))
905 (defun text-buffer-serialize (register-buffer content-buffer format start end)
906 (with-foreign-object (length 'gsize)
907 (let ((bytes (gtk-text-buffer-serialize register-buffer content-buffer format start end length)))
908 (iter (for i from 0 to (mem-ref length 'gsize))
909 (for byte = (mem-aref bytes :uint8 i))
910 (collect byte result-type vector)
911 (finally (g-free bytes))))))
913 (export 'text-buffer-serialize)
915 (defcfun (text-buffer-unregister-deserialize-format "gtk_text_buffer_unregister_deserialize_format") :void
916 (buffer (g-object text-buffer))
917 (format gdk-atom-as-string))
919 (export 'text-buffer-unregister-deserialize-format)
921 (defcfun (text-buffer-unregister-serialize-format "gtk_text_buffer_unregister_serialize_format") :void
922 (buffer (g-object text-buffer))
923 (format gdk-atom-as-string))
925 (export 'text-buffer-unregister-serialize-format)
927 ;; text tag
929 ;; text tag table
931 (defcallback gtk-text-tag-table-foreach-function :void ((tag (g-object text-tag)) (data :pointer))
932 (funcall (get-stable-pointer-value data) tag))
934 (defcfun (text-tag-table-add "gtk_text_tag_table_add") :void
935 (table (g-object text-tag-table))
936 (tag (g-object text-tag)))
938 (export 'text-tag-table-add)
940 (defcfun (text-tag-table-remove "gtk_text_tag_table_remove") :void
941 (table (g-object text-tag-table))
942 (tag (g-object text-tag)))
944 (export 'text-tag-table-remove)
946 (defcfun (text-tag-table-lookup "gtk_text_tag_table_lookup") (g-object text-tag)
947 (table (g-object text-tag-table))
948 (name (:string :free-to-foreign t)))
950 (export 'text-tag-table-lookup)
952 (defcfun gtk-text-tag-table-foreach :void
953 (table (g-object text-tag-table))
954 (function :pointer)
955 (data :pointer))
957 (defun text-tag-table-foreach (table function)
958 (with-stable-pointer (ptr function)
959 (gtk-text-tag-table-foreach table (callback gtk-text-tag-table-foreach-function) ptr)))
961 (export 'text-tag-table-foreach)
963 (defcfun (text-tag-table-size "gtk_text_tag_table_get_size") :int
964 (table (g-object text-tag-table)))
966 (export 'text-tag-table-size)
968 ;; text view
970 (defcfun gtk-text-view-scroll-to-mark :void
971 (text-view (g-object text-view))
972 (mark (g-object text-mark))
973 (within-margin :double)
974 (use-align :boolean)
975 (x-align :double)
976 (y-align :double))
978 (defun text-view-scroll-to-mark (text-view mark &key (within-margin 0.4) (x-align 0.0 x-align-supplied) (y-align 0.0 y-align-supplied))
979 (gtk-text-view-scroll-to-mark text-view mark (coerce within-margin 'double-float) (or x-align-supplied y-align-supplied) (coerce x-align 'double-float) (coerce y-align 'double-float)))
981 (export 'text-view-scroll-to-mark)
983 (defcfun gtk-text-view-scroll-to-iter :void
984 (text-view (g-object text-view))
985 (iter (g-boxed-foreign text-iter))
986 (within-margin :double)
987 (use-align :boolean)
988 (x-align :double)
989 (y-align :double))
991 (defun text-view-scroll-to-iter (text-view iter &key (within-margin 0.4) (x-align 0.0 x-align-supplied) (y-align 0.0 y-align-supplied))
992 (gtk-text-view-scroll-to-iter text-view iter (coerce within-margin 'double-float) (or x-align-supplied y-align-supplied) (coerce x-align 'double-float) (coerce y-align 'double-float)))
994 (export 'text-view-scroll-to-iter)
996 (defcfun (text-view-scroll-mark-onscreen "gtk_text_view_scroll_mark_onscreen") :void
997 (text-view (g-object text-view))
998 (mark (g-object text-mark)))
1000 (export 'text-view-scroll-mark-onscreen)
1002 (defcfun (text-view-move-mark-onscreen "gtk_text_view_move_mark_onscreen") :boolean
1003 (text-view (g-object text-view))
1004 (mark (g-object text-mark)))
1006 (export 'text-view-move-mark-onscreen)
1008 (defcfun (text-view-place-cursor-onscreen "gtk_text_view_place_cursor_onscreen") :boolean
1009 (text-view (g-object text-view)))
1011 (export 'text-view-place-cursor-onscreen)
1013 (defcfun gtk-text-view-get-visible-rect :void
1014 (text-view (g-object text-view))
1015 (visible-rect (g-boxed-foreign rectangle)))
1017 (defun text-view-visible-rect (text-view)
1018 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
1019 (gtk-text-view-get-visible-rect text-view rect)
1020 rect))
1022 (export 'text-view-visible-rect)
1024 (defcfun gtk-text-view-get-iter-location :void
1025 (text-view (g-object text-view))
1026 (iter (g-boxed-foreign text-iter))
1027 (location (g-boxed-foreign rectangle)))
1029 (defun text-view-iter-location (text-view iter)
1030 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
1031 (gtk-text-view-get-iter-location text-view iter rect)
1032 rect))
1034 (export 'text-view-iter-location)
1036 (defcfun gtk-text-view-get-line-at-y :void
1037 (text-view (g-object text-view))
1038 (target-iter (g-boxed-foreign text-iter))
1039 (y :int)
1040 (line-top (:pointer :int)))
1042 (defun text-view-get-line-at-y (text-view y)
1043 (let ((iter (make-instance 'text-iter)))
1044 (with-foreign-object (line-top :int)
1045 (gtk-text-view-get-line-at-y text-view iter y line-top)
1046 (values iter (mem-ref line-top :int)))))
1048 (export 'text-view-get-line-at-y)
1050 (defcfun gtk-text-view-get-line-yrange :void
1051 (text-view (g-object text-view))
1052 (iter (g-boxed-foreign text-iter))
1053 (y (:pointer :int))
1054 (height (:pointer :int)))
1056 (defun text-view-get-line-yrange (text-view iter)
1057 (with-foreign-objects ((y :int) (height :int))
1058 (gtk-text-view-get-line-yrange text-view iter y height)
1059 (values (mem-ref y :int) (mem-ref height :int))))
1061 (export 'text-view-get-line-yrange)
1063 (defcfun gtk-text-view-get-iter-at-location :void
1064 (text-view (g-object text-view))
1065 (iter (g-boxed-foreign text-iter))
1066 (x :int)
1067 (y :int))
1069 (defun text-view-get-iter-at-location (view x y)
1070 (let ((iter (make-instance 'text-iter)))
1071 (gtk-text-view-get-iter-at-location view iter x y)
1072 iter))
1074 (export 'text-view-get-iter-at-location)
1076 (defcfun gtk-text-view-get-iter-at-position :void
1077 (text-view (g-object text-view))
1078 (iter (g-boxed-foreign text-iter))
1079 (trailing (:pointer :int))
1080 (x :int)
1081 (y :int))
1083 (defun text-view-get-iter-at-position (text-view x y)
1084 (with-foreign-object (trailing :int)
1085 (let ((iter (make-instance 'text-iter)))
1086 (gtk-text-view-get-iter-at-position text-view iter trailing x y)
1087 (values iter (mem-ref trailing :int)))))
1089 (export 'text-view-get-iter-at-position)
1091 (defcfun gtk-text-view-buffer-to-window-coords :void
1092 (text-view (g-object text-view))
1093 (win text-window-type)
1094 (buffer-x :int)
1095 (buffer-y :int)
1096 (window-x (:pointer :int))
1097 (window-y (:pointer :int)))
1099 (defun text-view-buffer-to-window-coords (text-view window-type buffer-x buffer-y)
1100 (with-foreign-objects ((window-x :int) (window-y :int))
1101 (gtk-text-view-buffer-to-window-coords text-view window-type buffer-x buffer-y window-x window-y)
1102 (values (mem-ref window-x :int) (mem-ref window-y :int))))
1104 (export 'text-view-buffer-to-window-coords)
1106 (defcfun gtk-text-view-window-to-buffer-coords :void
1107 (text-view (g-object text-view))
1108 (win text-window-type)
1109 (window-x :int)
1110 (window-y :int)
1111 (buffer-x :pointer)
1112 (buffer-y :pointer))
1114 (defun text-view-window-to-buffer-coords (text-view win window-x window-y)
1115 (with-foreign-objects ((buffer-x :int) (buffer-y :int))
1116 (gtk-text-view-window-to-buffer-coords text-view win window-x window-y buffer-x buffer-y)
1117 (values (mem-ref buffer-x :int)
1118 (mem-ref buffer-y :int))))
1120 (export 'text-view-window-to-buffer-coords)
1122 (defcfun gtk-text-view-get-window (g-object gdk:gdk-window)
1123 (text-view (g-object text-view))
1124 (win text-window-type))
1126 (defun text-view-get-window (text-view win)
1127 (gtk-text-view-get-window text-view win))
1129 (export 'text-view-get-window)
1131 (defcfun (text-view-get-window-type "gtk_text_view_get_window_type") text-window-type
1132 (text-view (g-object text-view))
1133 (window (g-object gdk-window)))
1135 (export 'text-view-get-window-type)
1137 (defcfun gtk-text-view-set-border-window-size :void
1138 (text-view (g-object text-view))
1139 (window-type text-window-type)
1140 (size :int))
1142 (defcfun (text-view-border-window-size "gtk_text_view_get_border_window_size") :int
1143 (text-view (g-object text-view))
1144 (window-type text-window-type))
1146 (defun (setf text-view-border-window-size) (new-value text-view window-type)
1147 (gtk-text-view-set-border-window-size text-view window-type new-value)
1148 new-value)
1150 (export 'text-view-border-window-size)
1152 (defcfun (text-view-forward-display-line "gtk_text_view_forward_display_line") :boolean
1153 (text-view (g-object text-view))
1154 (iter (g-boxed-foreign text-iter)))
1156 (export 'text-view-forward-display-line)
1158 (defcfun (text-view-backward-display-line "gtk_text_view_backward_display_line") :boolean
1159 (text-view (g-object text-view))
1160 (iter (g-boxed-foreign text-iter)))
1162 (export 'text-view-backward-display-line)
1164 (defcfun (text-view-forward-display-line-end "gtk_text_view_forward_display_line_end") :boolean
1165 (text-view (g-object text-view))
1166 (iter (g-boxed-foreign text-iter)))
1168 (export 'text-view-forward-display-line-end)
1170 (defcfun (text-view-backward-display-line-start "gtk_text_view_backward_display_line_start") :boolean
1171 (text-view (g-object text-view))
1172 (iter (g-boxed-foreign text-iter)))
1174 (export 'text-view-backward-display-line-start)
1176 (defcfun (text-view-starts-display-line "gtk_text_view_starts_display_line") :boolean
1177 (text-view (g-object text-view))
1178 (iter (g-boxed-foreign text-iter)))
1180 (export 'text-view-starts-display-line)
1182 (defcfun (text-view-move-visually "gtk_text_view_move_visually") :boolean
1183 (text-view (g-object text-view))
1184 (iter (g-boxed-foreign text-iter))
1185 (count :int))
1187 (export 'text-view-move-visually)
1189 (defcfun (text-view-add-child-at-anchor "gtk_text_view_add_child_at_anchor") :void
1190 (text-view g-object)
1191 (child g-object)
1192 (anchor g-object))
1194 (export 'text-view-add-child-at-anchor)
1196 (defcfun (text-child-anchor-widgets "gtk_text_child_anchor_get_widgets") (glist (g-object widget) :free-from-foreign t)
1197 (anchor (g-object text-child-anchor)))
1199 (export 'text-child-anchor-widgets)
1201 (defcfun (text-view-add-child-in-window "gtk_text_view_add_child_in_window") :void
1202 (text-view (g-object text-view))
1203 (child (g-object widget))
1204 (which-window text-window-type)
1205 (x-pos :int)
1206 (y-pos :int))
1208 (export 'text-view-add-child-in-window)
1210 (defcfun (text-view-move-child "gtk_text_view_move_child") :void
1211 (text-view (g-object text-view))
1212 (child (g-object widget))
1213 (x-pos :int)
1214 (y-pos :int))
1216 (export 'text-view-move-child)