Refactor gtype-from-id, gtype-from-name
[cl-gtk2.git] / gtk / gtk.text.lisp
blob69c365c1888aeaf57c800e8baef5081a69b2ce27
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 (at-init () (foreign-funcall "gtk_text_iter_get_type" :int))
19 (define-g-boxed-opaque text-iter "GtkTextIter"
20 :alloc (gtk-text-iter-alloc))
22 (define-boxed-opaque-accessor text-iter text-iter-buffer :reader "gtk_text_iter_get_buffer" :type (g-object text-buffer))
23 (define-boxed-opaque-accessor text-iter text-iter-offset :reader "gtk_text_iter_get_offset" :writer "gtk_text_iter_set_offset" :type :int)
24 (define-boxed-opaque-accessor text-iter text-iter-line :reader "gtk_text_iter_get_line" :writer "gtk_text_iter_set_line" :type :int)
25 (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)
26 (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)
27 (define-boxed-opaque-accessor text-iter text-iter-char :reader "gtk_text_iter_get_char" :type unichar)
28 (define-boxed-opaque-accessor text-iter text-iter-pixbuf :reader "gtk_text_iter_get_pixbuf" :type (g-object pixbuf))
29 (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))
30 (define-boxed-opaque-accessor text-iter text-iter-child-anchor :reader "gtk_text_iter_get_child_anchor" :type (g-object text-child-anchor))
31 (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))
32 (define-boxed-opaque-accessor text-iter text-iter-chars-in-line :reader "gtk_text_iter_get_chars_in_line" :type :int)
33 (define-boxed-opaque-accessor text-iter text-iter-language :reader "gtk_text_iter_get_language" :type :pointer)
34 (define-boxed-opaque-accessor text-iter text-iter-is-end :reader "gtk_text_iter_is_end" :type :boolean)
35 (define-boxed-opaque-accessor text-iter text-iter-is-start :reader "gtk_text_iter_is_start" :type :boolean)
36 (define-boxed-opaque-accessor text-iter text-iter-starts-word :reader "gtk_text_iter_starts_word" :type :boolean)
37 (define-boxed-opaque-accessor text-iter text-iter-ends-word :reader "gtk_text_iter_ends_word" :type :boolean)
38 (define-boxed-opaque-accessor text-iter text-iter-inside-word :reader "gtk_text_iter_inside_word" :type :boolean)
39 (define-boxed-opaque-accessor text-iter text-iter-starts-line :reader "gtk_text_iter_starts_line" :type :boolean)
40 (define-boxed-opaque-accessor text-iter text-iter-ends-line :reader "gtk_text_iter_ends_line" :type :boolean)
41 (define-boxed-opaque-accessor text-iter text-iter-starts-sentence :reader "gtk_text_iter_starts_sentence" :type :boolean)
42 (define-boxed-opaque-accessor text-iter text-iter-ends-sentence :reader "gtk_text_iter_ends_sentence" :type :boolean)
43 (define-boxed-opaque-accessor text-iter text-iter-inside-sentence :reader "gtk_text_iter_inside_sentence" :type :boolean)
44 (define-boxed-opaque-accessor text-iter text-iter-is-cursor-position :reader "gtk_text_iter_is_cursor_position" :type :boolean)
46 (export (boxed-related-symbols 'text-iter))
47 (export '(text-iter-buffer text-iter-offset text-iter-line
48 text-iter-line-offset text-iter-visible-line-offset
49 text-iter-char text-iter-pixbuf text-iter-marks
50 text-iter-child-anchor text-iter-tags
51 text-iter-chars-in-line text-iter-language text-iter-is-end
52 text-iter-is-start text-iter-can-insert
53 text-iter-starts-word text-iter-ends-word
54 text-iter-inside-word text-iter-starts-line
55 text-iter-ends-line text-iter-starts-sentence
56 text-iter-ends-sentence text-iter-inside-sentence
57 text-iter-is-cursor-position ))
59 (defcstruct %text-iter
60 (dummy1 :pointer)
61 (dummy2 :pointer)
62 (dummy3 :int)
63 (dummy4 :int)
64 (dummy5 :int)
65 (dummy6 :int)
66 (dummy7 :int)
67 (dummy8 :int)
68 (dummy9 :pointer)
69 (dummy10 :pointer)
70 (dummy11 :int)
71 (dummy12 :int)
72 (dummy13 :int)
73 (dummy14 :pointer))
75 (defcfun gtk-text-iter-copy :pointer
76 (iter :pointer))
78 (defun gtk-text-iter-alloc ()
79 (with-foreign-object (iter '%text-iter)
80 (gtk-text-iter-copy iter)))
82 (defcfun (text-iter-slice "gtk_text_iter_get_slice") (g-string :free-from-foreign t)
83 (start (g-boxed-foreign text-iter))
84 (end (g-boxed-foreign text-iter)))
86 (export 'text-iter-slice)
88 (defcfun (text-iter-text "gtk_text_iter_get_text") (g-string :free-from-foreign t)
89 (start (g-boxed-foreign text-iter))
90 (end (g-boxed-foreign text-iter)))
92 (export 'text-iter-text)
94 (defcfun (text-iter-visible-slice "gtk_text_iter_get_visible_slice") (g-string :free-from-foreign t)
95 (start (g-boxed-foreign text-iter))
96 (end (g-boxed-foreign text-iter)))
98 (export 'text-iter-visible-slice)
100 (defcfun (text-iter-visible-text "gtk_text_iter_get_visible_text") (g-string :free-from-foreign t)
101 (start (g-boxed-foreign text-iter))
102 (end (g-boxed-foreign text-iter)))
104 (export 'text-iter-visible-text)
106 (defcfun (text-iter-toggled-tags "gtk_text_iter_get_toggled_tags") (gslist (g-object text-tag))
107 (iter (g-boxed-foreign text-iter))
108 (toggled-on :boolean))
110 (export 'text-iter-toggled-tags)
112 (defcfun (text-iter-begins-tag "gtk_text_iter_begins_tag") :boolean
113 (iter (g-boxed-foreign text-iter))
114 (tag (g-object text-tag)))
116 (export 'text-iter-begins-tag)
118 (defcfun (text-iter-ends-tag "gtk_text_iter_ends_tag") :boolean
119 (iter (g-boxed-foreign text-iter))
120 (tag (g-object text-tag)))
122 (export 'text-iter-ends-tag)
124 (defcfun (text-iter-toggles-tag "gtk_text_iter_toggles_tag") :boolean
125 (iter (g-boxed-foreign text-iter))
126 (tag (g-object text-tag)))
128 (export 'text-iter-toggles-tag)
130 (defcfun (text-iter-has-tag "gtk_text_iter_has_tag") :boolean
131 (iter (g-boxed-foreign text-iter))
132 (tag (g-object text-tag)))
134 (export 'text-iter-has-tag)
136 (defcfun (text-iter-editable "gtk_text_iter_editable") :boolean
137 (iter (g-boxed-foreign text-iter))
138 (default :boolean))
140 (export 'text-iter-editable)
142 (defcfun (text-iter-can-insert "gtk_text_iter_can_insert") :boolean
143 (iter (g-boxed-foreign text-iter))
144 (default-editable :boolean))
146 (export 'text-iter-can-insert)
148 (defcfun gtk-text-iter-get-attributes :boolean
149 (iter (g-boxed-foreign text-iter))
150 (values (g-object text-attributes)))
152 (defun text-iter-attributes (iter default-attributes)
153 (let ((changed-p (gtk-text-iter-get-attributes iter default-attributes)))
154 (values default-attributes changed-p)))
156 (export 'text-iter-attributes)
158 (defcfun gtk-text-iter-forward-chars :boolean
159 (iter (g-boxed-foreign text-iter))
160 (count :int))
162 (defcfun gtk-text-iter-forward-lines :boolean
163 (iter (g-boxed-foreign text-iter))
164 (count :int))
166 (defcfun gtk-text-iter-forward-word-ends :boolean
167 (iter (g-boxed-foreign text-iter))
168 (count :int))
170 (defcfun gtk-text-iter-backward-word-starts :boolean
171 (iter (g-boxed-foreign text-iter))
172 (count :int))
174 (defcfun gtk-text-iter-forward-cursor-positions :boolean
175 (iter (g-boxed-foreign text-iter))
176 (count :int))
178 (defcfun gtk-text-iter-forward-sentence-ends :boolean
179 (iter (g-boxed-foreign text-iter))
180 (count :int))
182 (defcfun gtk-text-iter-backward-sentence-starts :boolean
183 (iter (g-boxed-foreign text-iter))
184 (count :int))
186 (defcfun gtk-text-iter-forward-visible-word-ends :boolean
187 (iter (g-boxed-foreign text-iter))
188 (count :int))
190 (defcfun gtk-text-iter-backward-visible-word-starts :boolean
191 (iter (g-boxed-foreign text-iter))
192 (count :int))
194 (defcfun gtk-text-iter-forward-visible-cursor-positions :boolean
195 (iter (g-boxed-foreign text-iter))
196 (count :int))
198 (defcfun gtk-text-iter-forward-visible-lines :boolean
199 (iter (g-boxed-foreign text-iter))
200 (count :int))
202 (defun text-iter-move (iter &key (count 1) (by :char) (direction :forward))
203 (assert (typep by '(member :char :line :word :cursor-position :sentence :visible-word :visible-line :visible-cursor-position)))
204 (assert (typep direction '(member :forward :backward)))
205 (when (and (member by '(:char :ine :cursor-position :visible-line :visible-cursor-position)) (eq direction :backward))
206 (setf count (- count)))
207 (ecase by
208 (:char (gtk-text-iter-forward-chars iter count))
209 (:line (gtk-text-iter-forward-lines iter count))
210 (:word (if (eq direction :forward)
211 (gtk-text-iter-forward-word-ends iter count)
212 (gtk-text-iter-backward-word-starts iter count)))
213 (:cursor-position (gtk-text-iter-forward-cursor-positions iter count))
214 (:sentence (if (eq direction :forward)
215 (gtk-text-iter-forward-sentence-ends iter count)
216 (gtk-text-iter-backward-sentence-starts iter count)))
217 (:visible-word (if (eq direction :forward)
218 (gtk-text-iter-forward-visible-word-ends iter count)
219 (gtk-text-iter-backward-visible-word-starts iter count)))
220 (:visible-line (gtk-text-iter-forward-visible-lines iter count))
221 (:visible-cursor-position (gtk-text-iter-forward-visible-cursor-positions iter count))))
223 (export 'text-iter-move)
225 (defcfun (text-iter-forward-to-end "gtk_text_iter_forward_to_end") :void
226 (iter (g-boxed-foreign text-iter)))
228 (export 'text-iter-forward-to-end)
230 (defcfun (text-iter-forward-to-line-end "gtk_text_iter_forward_to_line_end") :boolean
231 (iter (g-boxed-foreign text-iter)))
233 (export 'text-iter-forward-to-line-end)
235 (defcfun (text-iter-forward-to-tag-toggle "gtk_text_iter_forward_to_tag_toggle") :boolean
236 (iter (g-boxed-foreign text-iter))
237 (tag (g-object text-tag)))
239 (defcfun (text-iter-backward-to-tag-toggle "gtk_text_iter_backward_to_tag_toggle") :boolean
240 (iter (g-boxed-foreign text-iter))
241 (tag (g-object text-tag)))
243 (export '(text-iter-forward-to-tag-toggle text-iter-backward-to-tag-toggle))
245 (defcallback gtk-text-char-predicate :boolean ((char unichar) (user-data :pointer))
246 (let ((function (get-stable-pointer-value user-data)))
247 (funcall function char)))
249 (defcfun gtk-text-iter-forward-find-char :boolean
250 (iter (g-boxed-foreign text-iter))
251 (pred :pointer)
252 (user-data :pointer)
253 (limit (g-boxed-foreign text-iter)))
255 (defcfun gtk-text-iter-backward-find-char :boolean
256 (iter (g-boxed-foreign text-iter))
257 (pred :pointer)
258 (user-data :pointer)
259 (limit (g-boxed-foreign text-iter)))
261 (defun text-iter-find-char (iter predicate &key limit (direction :forward))
262 (assert (typep direction '(member :forward :backward)))
263 (with-stable-pointer (ptr predicate)
264 (if (eq direction :forward)
265 (gtk-text-iter-forward-find-char iter (callback gtk-text-char-predicate) ptr limit)
266 (gtk-text-iter-backward-find-char iter (callback gtk-text-char-predicate) ptr limit))))
268 (export 'text-iter-find-char)
270 (defcfun gtk-text-iter-forward-search :boolean
271 (iter (g-boxed-foreign text-iter))
272 (str (:string :free-to-foreign t))
273 (flags text-search-flags)
274 (match-start (g-boxed-foreign text-iter))
275 (match-end (g-boxed-foreign text-iter))
276 (limit (g-boxed-foreign text-iter)))
278 (defcfun gtk-text-iter-backward-search :boolean
279 (iter (g-boxed-foreign text-iter))
280 (str (:string :free-to-foreign t))
281 (flags text-search-flags)
282 (match-start (g-boxed-foreign text-iter))
283 (match-end (g-boxed-foreign text-iter))
284 (limit (g-boxed-foreign text-iter)))
286 (defun text-iter-search (start-position string &key flags limit (direction :forward))
287 (assert (typep direction '(member :forward :backward)))
288 (let ((i1 (make-instance 'text-iter))
289 (i2 (make-instance 'text-iter)))
290 (if (if (eq direction :forward)
291 (gtk-text-iter-forward-search start-position string flags i1 i2 limit)
292 (gtk-text-iter-backward-search start-position string flags i1 i2 limit))
293 (values t i1 i2)
294 (values nil nil nil))))
296 (export 'text-iter-search)
298 (defcfun (text-iter-equal "gtk_text_iter_equal") :boolean
299 (iter-1 (g-boxed-foreign text-iter))
300 (iter-2 (g-boxed-foreign text-iter)))
302 (export 'text-iter-equal)
304 (defcfun (text-iter-compare "gtk_text_iter_compare") :int
305 (iter-1 (g-boxed-foreign text-iter))
306 (iter-2 (g-boxed-foreign text-iter)))
308 (export 'text-iter-compare)
310 (defcfun (text-iter-in-range "gtk_text_iter_in_range") :boolean
311 (iter (g-boxed-foreign text-iter))
312 (start (g-boxed-foreign text-iter))
313 (end (g-boxed-foreign text-iter)))
315 (export 'text-iter-in-range)
317 (defcfun (text-iter-order "gtk_text_iter_order") :void
318 (iter-1 (g-boxed-foreign text-iter))
319 (iter-2 (g-boxed-foreign text-iter)))
321 (export 'text-iter-order)
323 ;; text buffer
325 (defcfun (text-buffer-line-count "gtk_text_buffer_get_line_count") :int
326 (buffer (g-object text-buffer)))
328 (export 'text-buffer-line-count)
330 (defcfun (text-buffer-char-count "gtk_text_buffer_get_char_count") :int
331 (buffer (g-object text-buffer)))
333 (export 'text-buffer)
335 (defcfun gtk-text-buffer-insert :void
336 (buffer (g-object text-buffer))
337 (iter (g-boxed-foreign text-iter))
338 (text (:string :free-to-foreign t))
339 (len :int))
341 (defcfun gtk-text-buffer-insert-at-cursor :void
342 (buffer (g-object text-buffer))
343 (text (:string :free-to-foreign t))
344 (len :int))
346 (defcfun gtk-text-buffer-insert-interactive :boolean
347 (buffer (g-object text-buffer))
348 (iter (g-boxed-foreign text-iter))
349 (text (:string :free-to-foreign t))
350 (len :int)
351 (default-editable :boolean))
353 (defcfun gtk-text-buffer-insert-interactive-at-cursor :boolean
354 (buffer (g-object text-buffer))
355 (text (:string :free-to-foreign t))
356 (len :int)
357 (default-editable :boolean))
359 (defun text-buffer-insert (buffer text &key (position :cursor) (interactive nil) (default-editable t))
360 (assert (typep position '(or text-iter (member :cursor))))
361 (if interactive
362 (if (eq position :cursor)
363 (gtk-text-buffer-insert-interactive-at-cursor buffer text -1 default-editable)
364 (gtk-text-buffer-insert-interactive buffer position text -1 default-editable))
365 (progn (if (eq position :cursor)
366 (gtk-text-buffer-insert-at-cursor buffer text -1)
367 (gtk-text-buffer-insert buffer position text -1))
368 t)))
370 (export 'text-buffer-insert)
372 (defcfun gtk-text-buffer-insert-range :void
373 (buffer (g-object text-buffer))
374 (iter (g-boxed-foreign text-iter))
375 (range-start (g-boxed-foreign text-iter))
376 (range-end (g-boxed-foreign text-iter)))
378 (defcfun gtk-text-buffer-insert-range-interactive :boolean
379 (buffer (g-object text-buffer))
380 (iter (g-boxed-foreign text-iter))
381 (range-start (g-boxed-foreign text-iter))
382 (range-end (g-boxed-foreign text-iter))
383 (default-editable :boolean))
385 (defun text-buffer-insert-range (buffer position range-start range-end &key interactive default-editable)
386 (if interactive
387 (gtk-text-buffer-insert-range-interactive buffer position range-start range-end default-editable)
388 (progn (gtk-text-buffer-insert-range buffer position range-start range-end)
389 t)))
391 (export 'text-buffer-insert-range)
393 (defcfun gtk-text-buffer-delete :void
394 (buffer (g-object text-buffer))
395 (range-start (g-boxed-foreign text-iter))
396 (range-end (g-boxed-foreign text-iter)))
398 (defcfun gtk-text-buffer-delete-interactive :boolean
399 (buffer (g-object text-buffer))
400 (range-start (g-boxed-foreign text-iter))
401 (range-end (g-boxed-foreign text-iter))
402 (default-editable :boolean))
404 (defun text-buffer-delete (buffer range-start range-end &key interactive default-editable)
405 (if interactive
406 (gtk-text-buffer-delete-interactive buffer range-start range-end default-editable)
407 (progn (gtk-text-buffer-delete buffer range-start range-end)
408 t)))
410 (export 'text-buffer-delete)
412 (defcfun gtk-text-buffer-backspace :boolean
413 (buffer (g-object text-buffer))
414 (iter (g-boxed-foreign text-iter))
415 (interactive :boolean)
416 (default-editable :boolean))
418 (defun text-buffer-backspace (buffer position &key interactive default-editable)
419 (gtk-text-buffer-backspace buffer position interactive default-editable))
421 (export 'text-buffer-backspace)
423 (defcfun gtk-text-buffer-get-slice (:string :free-from-foreign t)
424 (buffer (g-object text-buffer))
425 (range-start (g-boxed-foreign text-iter))
426 (range-end (g-boxed-foreign text-iter))
427 (include-hidden-chars :boolean))
429 (defun text-buffer-slice (buffer range-start range-end &key include-hidden-chars)
430 (gtk-text-buffer-get-slice buffer range-start range-end include-hidden-chars))
432 (export 'text-buffer-slice)
434 (defcfun (text-buffer-insert-pixbuf "gtk_text_buffer_insert_pixbuf") :void
435 (buffer (g-object text-buffer))
436 (position (g-boxed-foreign text-iter))
437 (pixbuf (g-object pixbuf)))
439 (export 'text-buffer-insert-pixbuf)
441 (defcfun gtk-text-buffer-insert-child-anchor :void
442 (buffer (g-object text-buffer))
443 (iter (g-boxed-foreign text-iter))
444 (anchor (g-object text-child-anchor)))
446 (defcfun gtk-text-buffer-create-child-anchor (g-object text-child-anchor)
447 (buffer (g-object text-buffer))
448 (iter (g-boxed-foreign text-iter)))
450 (defun text-buffer-insert-child-anchor (buffer position &optional anchor)
451 (if anchor
452 (progn (gtk-text-buffer-insert-child-anchor buffer position anchor)
453 anchor)
454 (gtk-text-buffer-create-child-anchor buffer position)))
456 (export 'text-buffer-insert-child-anchor)
458 (defcfun gtk-text-buffer-create-mark (g-object text-mark)
459 (buffer (g-object text-buffer))
460 (name (:string :free-to-foreign t))
461 (position (g-boxed-foreign text-iter))
462 (left-gravity :boolean))
464 (defun text-buffer-create-mark (buffer name position &optional (left-gravity t))
465 (gtk-text-buffer-create-mark buffer name position left-gravity))
467 (export 'text-buffer-create-mark)
469 (defcfun gtk-text-buffer-move-mark :void
470 (buffer (g-object text-buffer))
471 (mark (g-object text-mark))
472 (position (g-boxed-foreign text-iter)))
474 (defcfun gtk-text-buffer-move-mark-by-name :void
475 (buffer (g-object text-buffer))
476 (name (:string :free-to-foreign t))
477 (position (g-boxed-foreign text-iter)))
479 (defun text-buffer-move-mark (buffer mark position)
480 (etypecase mark
481 (string (gtk-text-buffer-move-mark-by-name buffer mark position))
482 (text-mark (gtk-text-buffer-move-mark buffer mark position))))
484 (export 'text-buffer-move-mark)
486 (defcfun (text-buffer-add-mark "gtk_text_buffer_add_mark") :void
487 (buffer (g-object text-buffer))
488 (mark (g-object text-mark))
489 (position (g-boxed-foreign text-iter)))
491 (export 'text-buffer-add-mark)
493 (defcfun gtk-text-buffer-delete-mark :void
494 (buffer (g-object text-buffer))
495 (mark (g-object text-mark)))
497 (defcfun gtk-text-buffer-delete-mark-by-name :void
498 (buffer (g-object text-buffer))
499 (name (:string :free-to-foreign t)))
501 (defun text-buffer-delete-mark (buffer mark)
502 (etypecase mark
503 (string (gtk-text-buffer-delete-mark-by-name buffer mark))
504 (text-mark (gtk-text-buffer-delete-mark buffer mark))))
506 (export 'text-buffer-delete-mark)
508 (defcfun (text-buffer-get-mark "gtk_text_buffer_get_mark") (g-object text-mark)
509 (buffer (g-object text-buffer))
510 (name (:string :free-to-foreign t)))
512 (export 'text-buffer-get-mark)
514 (defcfun (text-buffer-insertion-mark "gtk_text_buffer_get_insert") (g-object text-mark)
515 (buffer (g-object text-buffer)))
517 (export 'text-buffer-insertion-mark)
519 (defcfun (text-buffer-selection-bound "gtk_text_buffer_get_selection_bound") (g-object text-mark)
520 (buffer (g-object text-buffer)))
522 (export 'text-buffer-selection-bound)
524 (defcfun (text-buffer-place-cursor "gtk_text_buffer_place_cursor") :void
525 (buffer (g-object text-buffer))
526 (position (g-boxed-foreign text-iter)))
528 (export 'text-buffer-place-cursor)
530 (defcfun (text-buffer-select-range "gtk_text_buffer_select_range") :void
531 (buffer (g-object text-buffer))
532 (insertion-point (g-boxed-foreign text-iter))
533 (selection-bound (g-boxed-foreign text-iter)))
535 (export 'text-buffer-select-range)
537 (defcfun gtk-text-buffer-apply-tag :void
538 (buffer (g-object text-buffer))
539 (tag (g-object text-tag))
540 (start (g-boxed-foreign text-iter))
541 (end (g-boxed-foreign text-iter)))
543 (defcfun gtk-text-buffer-apply-tag-by-name :void
544 (buffer (g-object text-buffer))
545 (name (:string :free-to-foreign t))
546 (start (g-boxed-foreign text-iter))
547 (end (g-boxed-foreign text-iter)))
549 (defun text-buffer-apply-tag (buffer tag start end)
550 (etypecase tag
551 (string (gtk-text-buffer-apply-tag-by-name buffer tag start end))
552 (text-tag (gtk-text-buffer-apply-tag buffer tag start end))))
554 (export 'text-buffer-apply-tag)
556 (defcfun gtk-text-buffer-remove-tag :void
557 (buffer (g-object text-buffer))
558 (tag (g-object text-tag))
559 (start (g-boxed-foreign text-iter))
560 (end (g-boxed-foreign text-iter)))
562 (defcfun gtk-text-buffer-remove-tag-by-name :void
563 (buffer (g-object text-buffer))
564 (name (:string :free-to-foreign t))
565 (start (g-boxed-foreign text-iter))
566 (end (g-boxed-foreign text-iter)))
568 (defun text-buffer-remove-tag (buffer tag start end)
569 (etypecase tag
570 (string (gtk-text-buffer-remove-tag-by-name buffer tag start end))
571 (text-tag (gtk-text-buffer-remove-tag buffer tag start end))))
573 (export 'text-buffer-remove-tag)
575 (defcfun (text-buffer-remove-all-tags "gtk_text_buffer_remove_all_tags") :void
576 (buffer (g-object text-buffer))
577 (start (g-boxed-foreign text-iter))
578 (end (g-boxed-foreign text-iter)))
580 (defcfun gtk-text-buffer-get-iter-at-line-offset :void
581 (buffer (g-object text-buffer))
582 (iter (g-boxed-foreign text-iter))
583 (line-number :int)
584 (char-offset :int))
586 (defun text-buffer-get-iter-at-line-offset (buffer line-number char-offset)
587 (let ((iter (make-instance 'text-iter)))
588 (gtk-text-buffer-get-iter-at-line-offset buffer iter line-number char-offset)
589 iter))
591 (export 'text-buffer-get-iter-at-line-offset)
593 (defcfun gtk-text-buffer-get-iter-at-offset :void
594 (buffer (g-object text-buffer))
595 (iter (g-boxed-foreign text-iter))
596 (char-offset :int))
598 (defun text-buffer-get-iter-at-offset (buffer offset)
599 (let ((iter (make-instance 'text-iter)))
600 (gtk-text-buffer-get-iter-at-offset buffer iter offset)
601 iter))
603 (export 'text-buffer-get-iter-at-offset)
605 (defcfun gtk-text-buffer-get-iter-at-line :void
606 (buffer (g-object text-buffer))
607 (iter (g-boxed-foreign text-iter))
608 (line-number :int))
610 (defun text-buffer-get-iter-at-line (buffer line-number)
611 (let ((iter (make-instance 'text-iter)))
612 (gtk-text-buffer-get-iter-at-line buffer iter line-number)
613 iter))
615 (export 'text-buffet-get-iter-at-line)
617 (defcfun gtk-text-buffer-get-iter-at-mark :void
618 (buffer (g-object text-buffer))
619 (iter (g-boxed-foreign text-iter))
620 (mark (g-object text-mark)))
622 (defun text-buffer-get-iter-at-mark (buffer mark)
623 (when (stringp mark)
624 (setf mark (text-buffer-get-mark buffer mark)))
625 (let ((iter (make-instance 'text-iter)))
626 (gtk-text-buffer-get-iter-at-mark buffer iter mark)
627 iter))
629 (export 'text-buffer-get-iter-at-mark)
631 (defcfun gtk-text-buffer-get-iter-at-child-anchor :void
632 (buffer (g-object text-buffer))
633 (iter (g-boxed-foreign text-iter))
634 (anchor (g-object text-child-anchor)))
636 (defun text-buffer-get-iter-at-child-anchor (buffer anchor)
637 (let ((iter (make-instance 'text-iter)))
638 (gtk-text-buffer-get-iter-at-child-anchor buffer iter anchor)
639 iter))
641 (export 'text-buffer-get-iter-at-child-anchor)
643 (defcfun gtk-text-buffer-get-start-iter :void
644 (buffer (g-object text-buffer))
645 (iter (g-boxed-foreign text-iter)))
647 (defun text-buffer-get-start-iter (buffer)
648 (let ((iter (make-instance 'text-iter)))
649 (gtk-text-buffer-get-start-iter buffer iter)
650 iter))
652 (export 'text-buffer-get-start-iter)
654 (defcfun gtk-text-buffer-get-end-iter :void
655 (buffer (g-object text-buffer))
656 (iter (g-boxed-foreign text-iter)))
658 (defun text-buffer-get-end-iter (buffer)
659 (let ((iter (make-instance 'text-iter)))
660 (gtk-text-buffer-get-end-iter buffer iter)
661 iter))
663 (export 'text-buffer-get-end-iter)
665 (defcfun gtk-text-buffer-get-bounds :void
666 (buffer (g-object text-buffer))
667 (start (g-boxed-foreign text-iter))
668 (end (g-boxed-foreign text-iter)))
670 (defun text-buffer-get-bounds (buffer)
671 (let ((start (make-instance 'text-iter))
672 (end (make-instance 'text-iter)))
673 (gtk-text-buffer-get-bounds buffer start end)
674 (values start end)))
676 (export 'text-buffer-get-bounds)
678 (defcfun gtk-text-buffer-delete-selection :boolean
679 (bufer (g-object text-buffer))
680 (interactive :boolean)
681 (default-editable :boolean))
683 (defun text-buffer-delete-selection (buffer &key interactive default-editable)
684 (gtk-text-buffer-delete-selection buffer interactive default-editable))
686 (export 'text-buffer-delete-selection)
688 (defcfun gtk-text-buffer-paste-clipboard :void
689 (buffer (g-object text-buffer))
690 (clipboard (g-object clipboard))
691 (override-location (g-boxed-foreign text-iter))
692 (default-editable :boolean))
694 (defun text-buffer-paste-clipboard (buffer clipboard &key position default-editable)
695 (gtk-text-buffer-paste-clipboard buffer clipboard position default-editable))
697 (export 'text-buffer-paste-clipboard)
699 (defcfun (text-buffer-copy-clipboard "gtk_text_buffer_copy_clipboard") :void
700 (buffer (g-object text-buffer))
701 (clipboard (g-object clipboard)))
703 (export 'text-buffer-copy-clipboard)
705 (defcfun (text-buffer-cut-clipboard "gtk_text_buffer_cut_clipboard") :void
706 (buffer (g-object text-buffer))
707 (clipboard (g-object clipboard))
708 (default-editable :boolean))
710 (export 'text-buffer-cut-clipboard)
712 (defcfun gtk-text-buffer-get-selection-bounds :boolean
713 (buffer (g-object text-buffer))
714 (start (g-boxed-foreign text-iter))
715 (end (g-boxed-foreign text-iter)))
717 (defun text-buffer-get-selection-bounds (buffer)
718 (let ((i1 (make-instance 'text-iter))
719 (i2 (make-instance 'text-iter)))
720 (if (gtk-text-buffer-get-selection-bounds buffer i1 i2)
721 (values i1 i2)
722 (values nil nil))))
724 (export 'text-buffer-get-selection-bounds)
726 (defcfun (text-buffer-begin-user-action "gtk_text_buffer_begin_user_action") :void
727 (buffer (g-object text-buffer)))
729 (export 'text-buffer-begin-user-action)
731 (defcfun (text-buffer-end-user-action "gtk_text_buffer_end_user_action") :void
732 (buffer (g-object text-buffer)))
734 (export 'text-buffer-end-user-action)
736 (defmacro with-text-buffer-user-action ((buffer) &body body)
737 (let ((g (gensym)))
738 `(let ((,g ,buffer))
739 (text-buffer-begin-user-action ,g)
740 (unwind-protect
741 (progn ,@body)
742 (text-buffer-end-user-action ,g)))))
744 (export 'with-text-buffer-user-action)
746 (defcfun (text-buffer-add-selection-clipboard "gtk_text_buffer_add_selection_clipboard") :void
747 (buffer (g-object text-buffer))
748 (clipboard (g-object clipboard)))
750 (defcfun (text-buffer-remove-selection-clipboard "gtk_text_buffer_remove_selection_clipboard") :void
751 (buffer (g-object text-buffer))
752 (clipboard (g-object clipboard)))
754 (export 'text-buffer-remove-selection-clipboard)
756 (defcfun gtk-text-buffer-deserialize :boolean
757 (register-buffer (g-object text-buffer))
758 (content-buffer (g-object text-buffer))
759 (format gdk-atom-as-string)
760 (iter (g-boxed-foreign text-iter))
761 (data :pointer)
762 (length gsize)
763 (error :pointer))
765 (defun text-buffer-deserialize (register-buffer content-buffer format iter data)
766 (let ((bytes (foreign-alloc :uint8 :count (length data))))
767 (iter (for i from 0 below (length data))
768 (setf (mem-aref bytes :uint8 i) (aref data i)))
769 (unwind-protect
770 (with-g-error (err)
771 (gtk-text-buffer-deserialize register-buffer content-buffer
772 format iter bytes (length data) err))
773 (foreign-free bytes))))
775 (export 'text-buffer-deserialize)
777 (defcfun (text-buffer-deserialize-can-create-tags "gtk_text_buffer_deserialize_get_can_create_tags") :boolean
778 (buffer (g-object text-buffer))
779 (format gdk-atom-as-string))
781 (defcfun gtk-text-buffer-deserialize-set-can-create-tags :void
782 (buffer (g-object text-buffer))
783 (format gdk-atom-as-string)
784 (can-create-tags :boolean))
786 (defun (setf text-buffer-deserialize-can-create-tags) (new-value buffer format)
787 (gtk-text-buffer-deserialize-set-can-create-tags buffer format new-value))
789 (export 'text-buffer-deserialize-can-create-tags)
791 (defcfun gtk-text-buffer-get-deserialize-formats (:pointer gdk-atom-as-string)
792 (text-buffer (g-object text-buffer))
793 (n-formats (:pointer :int)))
795 (defun text-buffer-get-deserialize-formats (text-buffer)
796 (with-foreign-object (n-formats :int)
797 (let ((atoms-ptr (gtk-text-buffer-get-deserialize-formats text-buffer n-formats)))
798 (iter (for i from 0 below (mem-ref n-formats :int))
799 (for atom = (mem-aref atoms-ptr 'gdk-atom-as-string i))
800 (collect atom)))))
802 (export 'text-buffer-get-deserialize-formats)
804 (defcfun gtk-text-buffer-get-serialize-formats (:pointer gdk-atom-as-string)
805 (text-buffer (g-object text-buffer))
806 (n-formats (:pointer :int)))
808 (defun text-buffer-get-serialize-formats (text-buffer)
809 (with-foreign-object (n-formats :int)
810 (let ((atoms-ptr (gtk-text-buffer-get-serialize-formats text-buffer n-formats)))
811 (iter (for i from 0 below (mem-ref n-formats :int))
812 (for atom = (mem-aref atoms-ptr 'gdk-atom-as-string i))
813 (collect atom)))))
815 (export 'text-buffer-get-serialize-formats)
817 (defcallback gtk-text-buffer-deserialize-cb :boolean
818 ((register-buffer (g-object text-buffer))
819 (content-buffer (g-object text-buffer))
820 (iter (g-boxed-foreign text-iter))
821 (data :pointer)
822 (length gsize)
823 (create-tags :boolean)
824 (user-data :pointer)
825 (error :pointer))
826 (with-catching-to-g-error (error)
827 (let ((fn (stable-pointer-value user-data)))
828 (restart-case
829 (let ((bytes (iter (with bytes = (make-array length :element-type '(unsigned-byte 8)))
830 (for i from 0 below length)
831 (setf (aref bytes i) (mem-ref data :uint8 i))
832 (finally (return bytes)))))
833 (progn (funcall fn register-buffer content-buffer iter bytes create-tags) t))
834 (return-from-text-buffer-deserialize-cb ()
835 (error 'g-error-condition
836 :domain "cl-gtk2"
837 :code 0
838 :message "'return-from-text-buffer-deserialize-cb' restart was called"))))))
840 (defcfun gtk-text-buffer-register-deserialize-format gdk-atom-as-string
841 (buffer (g-object text-buffer))
842 (mime-type :string)
843 (function :pointer)
844 (user-data :pointer)
845 (destroy-notify :pointer))
847 (defun text-buffer-register-deserialize-format (buffer mime-type function)
848 (gtk-text-buffer-register-deserialize-format buffer mime-type
849 (callback gtk-text-buffer-deserialize-cb)
850 (allocate-stable-pointer function)
851 (callback stable-pointer-free-destroy-notify-callback)))
853 (export 'text-buffer-register-deserialize-format)
855 (defcfun (text-buffer-register-deserialize-tagset "gtk_text_buffer_register_deserialize_tagset") gdk-atom-as-string
856 (buffer (g-object text-buffer))
857 (tagset-name :string))
859 (export 'text-buffer-register-deserialize-tagset)
861 (defcallback gtk-text-buffer-serialize-cb :pointer
862 ((register-buffer (g-object text-buffer))
863 (content-buffer (g-object text-buffer))
864 (start-iter (g-boxed-foreign text-iter))
865 (end-iter (g-boxed-foreign text-iter))
866 (length (:pointer gsize))
867 (user-data :pointer))
868 (let ((fn (stable-pointer-value user-data)))
869 (restart-case
870 (let* ((bytes (funcall fn register-buffer content-buffer start-iter end-iter))
871 (bytes-ptr (g-malloc (length bytes))))
872 (setf (mem-ref length 'gsize) (length bytes))
873 (iter (for i from 0 below (length bytes))
874 (setf (mem-aref bytes-ptr :uint8 i) (aref bytes i)))
875 bytes-ptr)
876 (return-from-text-buffer-serialize-cb () nil))))
878 (defcfun gtk-text-buffer-register-serialize-format gdk-atom-as-string
879 (buffer (g-object text-buffer))
880 (mime-type :string)
881 (function :pointer)
882 (user-data :pointer)
883 (destroy-notify :pointer))
885 (defun text-buffer-register-serialize-format (buffer mime-type function)
886 (gtk-text-buffer-register-serialize-format buffer mime-type
887 (callback gtk-text-buffer-serialize-cb)
888 (allocate-stable-pointer function)
889 (callback stable-pointer-free-destroy-notify-callback)))
891 (export 'text-buffer-register-serialize-format)
893 (defcfun (text-buffer-register-serialize-tagset "gtk_text_buffer_register_serialize_tagset") gdk-atom-as-string
894 (buffer (g-object text-buffer))
895 (tagset-name :string))
897 (export 'text-buffer-register-serialize-tagset)
899 (defcfun gtk-text-buffer-serialize :pointer
900 (register-buffer (g-object text-buffer))
901 (content-buffer (g-object text-buffer))
902 (format gdk-atom-as-string)
903 (start (g-boxed-foreign text-iter))
904 (end (g-boxed-foreign text-iter))
905 (length (:pointer gsize)))
907 (defun text-buffer-serialize (register-buffer content-buffer format start end)
908 (with-foreign-object (length 'gsize)
909 (let ((bytes (gtk-text-buffer-serialize register-buffer content-buffer format start end length)))
910 (iter (for i from 0 to (mem-ref length 'gsize))
911 (for byte = (mem-aref bytes :uint8 i))
912 (collect byte result-type vector)
913 (finally (g-free bytes))))))
915 (export 'text-buffer-serialize)
917 (defcfun (text-buffer-unregister-deserialize-format "gtk_text_buffer_unregister_deserialize_format") :void
918 (buffer (g-object text-buffer))
919 (format gdk-atom-as-string))
921 (export 'text-buffer-unregister-deserialize-format)
923 (defcfun (text-buffer-unregister-serialize-format "gtk_text_buffer_unregister_serialize_format") :void
924 (buffer (g-object text-buffer))
925 (format gdk-atom-as-string))
927 (export 'text-buffer-unregister-serialize-format)
929 ;; text tag
931 ;; text tag table
933 (defcallback gtk-text-tag-table-foreach-function :void ((tag (g-object text-tag)) (data :pointer))
934 (funcall (get-stable-pointer-value data) tag))
936 (defcfun (text-tag-table-add "gtk_text_tag_table_add") :void
937 (table (g-object text-tag-table))
938 (tag (g-object text-tag)))
940 (export 'text-tag-table-add)
942 (defcfun (text-tag-table-remove "gtk_text_tag_table_remove") :void
943 (table (g-object text-tag-table))
944 (tag (g-object text-tag)))
946 (export 'text-tag-table-remove)
948 (defcfun (text-tag-table-lookup "gtk_text_tag_table_lookup") (g-object text-tag)
949 (table (g-object text-tag-table))
950 (name (:string :free-to-foreign t)))
952 (export 'text-tag-table-lookup)
954 (defcfun gtk-text-tag-table-foreach :void
955 (table (g-object text-tag-table))
956 (function :pointer)
957 (data :pointer))
959 (defun text-tag-table-foreach (table function)
960 (with-stable-pointer (ptr function)
961 (gtk-text-tag-table-foreach table (callback gtk-text-tag-table-foreach-function) ptr)))
963 (export 'text-tag-table-foreach)
965 (defcfun (text-tag-table-size "gtk_text_tag_table_get_size") :int
966 (table (g-object text-tag-table)))
968 (export 'text-tag-table-size)
970 ;; text view
972 (defcfun gtk-text-view-scroll-to-mark :void
973 (text-view (g-object text-view))
974 (mark (g-object text-mark))
975 (within-margin :double)
976 (use-align :boolean)
977 (x-align :double)
978 (y-align :double))
980 (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))
981 (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)))
983 (export 'text-view-scroll-to-mark)
985 (defcfun gtk-text-view-scroll-to-iter :void
986 (text-view (g-object text-view))
987 (iter (g-boxed-foreign text-iter))
988 (within-margin :double)
989 (use-align :boolean)
990 (x-align :double)
991 (y-align :double))
993 (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))
994 (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)))
996 (export 'text-view-scroll-to-iter)
998 (defcfun (text-view-scroll-mark-onscreen "gtk_text_view_scroll_mark_onscreen") :void
999 (text-view (g-object text-view))
1000 (mark (g-object text-mark)))
1002 (export 'text-view-scroll-mark-onscreen)
1004 (defcfun (text-view-move-mark-onscreen "gtk_text_view_move_mark_onscreen") :boolean
1005 (text-view (g-object text-view))
1006 (mark (g-object text-mark)))
1008 (export 'text-view-move-mark-onscreen)
1010 (defcfun (text-view-place-cursor-onscreen "gtk_text_view_place_cursor_onscreen") :boolean
1011 (text-view (g-object text-view)))
1013 (export 'text-view-place-cursor-onscreen)
1015 (defcfun gtk-text-view-get-visible-rect :void
1016 (text-view (g-object text-view))
1017 (visible-rect (g-boxed-foreign rectangle)))
1019 (defun text-view-visible-rect (text-view)
1020 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
1021 (gtk-text-view-get-visible-rect text-view rect)
1022 rect))
1024 (export 'text-view-visible-rect)
1026 (defcfun gtk-text-view-get-iter-location :void
1027 (text-view (g-object text-view))
1028 (iter (g-boxed-foreign text-iter))
1029 (location (g-boxed-foreign rectangle)))
1031 (defun text-view-iter-location (text-view iter)
1032 (let ((rect (make-rectangle :x 0 :y 0 :width 0 :height 0)))
1033 (gtk-text-view-get-iter-location text-view iter rect)
1034 rect))
1036 (export 'text-view-iter-location)
1038 (defcfun gtk-text-view-get-line-at-y :void
1039 (text-view (g-object text-view))
1040 (target-iter (g-boxed-foreign text-iter))
1041 (y :int)
1042 (line-top (:pointer :int)))
1044 (defun text-view-get-line-at-y (text-view y)
1045 (let ((iter (make-instance 'text-iter)))
1046 (with-foreign-object (line-top :int)
1047 (gtk-text-view-get-line-at-y text-view iter y line-top)
1048 (values iter (mem-ref line-top :int)))))
1050 (export 'text-view-get-line-at-y)
1052 (defcfun gtk-text-view-get-line-yrange :void
1053 (text-view (g-object text-view))
1054 (iter (g-boxed-foreign text-iter))
1055 (y (:pointer :int))
1056 (height (:pointer :int)))
1058 (defun text-view-get-line-yrange (text-view iter)
1059 (with-foreign-objects ((y :int) (height :int))
1060 (gtk-text-view-get-line-yrange text-view iter y height)
1061 (values (mem-ref y :int) (mem-ref height :int))))
1063 (export 'text-view-get-line-yrange)
1065 (defcfun gtk-text-view-get-iter-at-location :void
1066 (text-view (g-object text-view))
1067 (iter (g-boxed-foreign text-iter))
1068 (x :int)
1069 (y :int))
1071 (defun text-view-get-iter-at-location (view x y)
1072 (let ((iter (make-instance 'text-iter)))
1073 (gtk-text-view-get-iter-at-location view iter x y)
1074 iter))
1076 (export 'text-view-get-iter-at-location)
1078 (defcfun gtk-text-view-get-iter-at-position :void
1079 (text-view (g-object text-view))
1080 (iter (g-boxed-foreign text-iter))
1081 (trailing (:pointer :int))
1082 (x :int)
1083 (y :int))
1085 (defun text-view-get-iter-at-position (text-view x y)
1086 (with-foreign-object (trailing :int)
1087 (let ((iter (make-instance 'text-iter)))
1088 (gtk-text-view-get-iter-at-position text-view iter trailing x y)
1089 (values iter (mem-ref trailing :int)))))
1091 (export 'text-view-get-iter-at-position)
1093 (defcfun gtk-text-view-buffer-to-window-coords :void
1094 (text-view (g-object text-view))
1095 (win text-window-type)
1096 (buffer-x :int)
1097 (buffer-y :int)
1098 (window-x (:pointer :int))
1099 (window-y (:pointer :int)))
1101 (defun text-view-buffer-to-window-coords (text-view window-type buffer-x buffer-y)
1102 (with-foreign-objects ((window-x :int) (window-y :int))
1103 (gtk-text-view-buffer-to-window-coords text-view window-type buffer-x buffer-y window-x window-y)
1104 (values (mem-ref window-x :int) (mem-ref window-y :int))))
1106 (export 'text-view-buffer-to-window-coords)
1108 (defcfun gtk-text-view-window-to-buffer-coords :void
1109 (text-view (g-object text-view))
1110 (win text-window-type)
1111 (window-x :int)
1112 (window-y :int)
1113 (buffer-x :pointer)
1114 (buffer-y :pointer))
1116 (defun text-view-window-to-buffer-coords (text-view win window-x window-y)
1117 (with-foreign-objects ((buffer-x :int) (buffer-y :int))
1118 (gtk-text-view-window-to-buffer-coords text-view win window-x window-y buffer-x buffer-y)
1119 (values (mem-ref buffer-x :int)
1120 (mem-ref buffer-y :int))))
1122 (export 'text-view-window-to-buffer-coords)
1124 (defcfun gtk-text-view-get-window (g-object gdk:gdk-window)
1125 (text-view (g-object text-view))
1126 (win text-window-type))
1128 (defun text-view-get-window (text-view win)
1129 (gtk-text-view-get-window text-view win))
1131 (export 'text-view-get-window)
1133 (defcfun (text-view-get-window-type "gtk_text_view_get_window_type") text-window-type
1134 (text-view (g-object text-view))
1135 (window (g-object gdk-window)))
1137 (export 'text-view-get-window-type)
1139 (defcfun gtk-text-view-set-border-window-size :void
1140 (text-view (g-object text-view))
1141 (window-type text-window-type)
1142 (size :int))
1144 (defcfun (text-view-border-window-size "gtk_text_view_get_border_window_size") :int
1145 (text-view (g-object text-view))
1146 (window-type text-window-type))
1148 (defun (setf text-view-border-window-size) (new-value text-view window-type)
1149 (gtk-text-view-set-border-window-size text-view window-type new-value)
1150 new-value)
1152 (export 'text-view-border-window-size)
1154 (defcfun (text-view-forward-display-line "gtk_text_view_forward_display_line") :boolean
1155 (text-view (g-object text-view))
1156 (iter (g-boxed-foreign text-iter)))
1158 (export 'text-view-forward-display-line)
1160 (defcfun (text-view-backward-display-line "gtk_text_view_backward_display_line") :boolean
1161 (text-view (g-object text-view))
1162 (iter (g-boxed-foreign text-iter)))
1164 (export 'text-view-backward-display-line)
1166 (defcfun (text-view-forward-display-line-end "gtk_text_view_forward_display_line_end") :boolean
1167 (text-view (g-object text-view))
1168 (iter (g-boxed-foreign text-iter)))
1170 (export 'text-view-forward-display-line-end)
1172 (defcfun (text-view-backward-display-line-start "gtk_text_view_backward_display_line_start") :boolean
1173 (text-view (g-object text-view))
1174 (iter (g-boxed-foreign text-iter)))
1176 (export 'text-view-backward-display-line-start)
1178 (defcfun (text-view-starts-display-line "gtk_text_view_starts_display_line") :boolean
1179 (text-view (g-object text-view))
1180 (iter (g-boxed-foreign text-iter)))
1182 (export 'text-view-starts-display-line)
1184 (defcfun (text-view-move-visually "gtk_text_view_move_visually") :boolean
1185 (text-view (g-object text-view))
1186 (iter (g-boxed-foreign text-iter))
1187 (count :int))
1189 (export 'text-view-move-visually)
1191 (defcfun (text-view-add-child-at-anchor "gtk_text_view_add_child_at_anchor") :void
1192 (text-view g-object)
1193 (child g-object)
1194 (anchor g-object))
1196 (export 'text-view-add-child-at-anchor)
1198 (defcfun (text-child-anchor-widgets "gtk_text_child_anchor_get_widgets") (glist (g-object widget) :free-from-foreign t)
1199 (anchor (g-object text-child-anchor)))
1201 (export 'text-child-anchor-widgets)
1203 (defcfun (text-view-add-child-in-window "gtk_text_view_add_child_in_window") :void
1204 (text-view (g-object text-view))
1205 (child (g-object widget))
1206 (which-window text-window-type)
1207 (x-pos :int)
1208 (y-pos :int))
1210 (export 'text-view-add-child-in-window)
1212 (defcfun (text-view-move-child "gtk_text_view_move_child") :void
1213 (text-view (g-object text-view))
1214 (child (g-object widget))
1215 (x-pos :int)
1216 (y-pos :int))
1218 (export 'text-view-move-child)