CoreGTK 3.10.0 CoreGTK is an Objective-C language binding for the GTK+ widget toolkit

- Main Page
- Classes
- Files

- File List

All Classes Functions Variables
CGTKTextView.m
1 /*
2 * CGTKTextView.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2015 - Tyler Burton
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /*
23 * Modified by the CoreGTK Team, 2015. See the AUTHORS file for a
24 * list of people on the CoreGTK Team.
25 * See the ChangeLog files for a list of changes.
26 *
27 */
28
29 /*
30 * Objective-C imports
31 */
32 #import "CoreGTK/CGTKTextView.h"
33
34 @implementation CGTKTextView
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_text_view_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(id)initWithBuffer:(GtkTextBuffer*) buffer
49 {
50 self = [super initWithGObject:(GObject *)gtk_text_view_new_with_buffer(buffer)];
51
52 if(self)
53 {
54 //Do nothing
55 }
56
57 return self;
58 }
59
60 -(GtkTextView*)TEXTVIEW
61 {
62 return GTK_TEXT_VIEW([self GOBJECT]);
63 }
64
65 -(void)addChildAtAnchorWithChild:(CGTKWidget*) child andAnchor:(GtkTextChildAnchor*) anchor
66 {
67 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW([self GOBJECT]), [child WIDGET], anchor);
68 }
69
70 -(void)addChildInWindowWithChild:(CGTKWidget*) child andWhichWindow:(GtkTextWindowType) whichWindow andXpos:(gint) xpos andYpos:(gint) ypos
71 {
72 gtk_text_view_add_child_in_window(GTK_TEXT_VIEW([self GOBJECT]), [child WIDGET], whichWindow, xpos, ypos);
73 }
74
75 -(BOOL)backwardDisplayLine:(GtkTextIter*) iter
76 {
77 return (gtk_text_view_backward_display_line(GTK_TEXT_VIEW([self GOBJECT]), iter) ? YES : NO);
78 }
79
80 -(BOOL)backwardDisplayLineStart:(GtkTextIter*) iter
81 {
82 return (gtk_text_view_backward_display_line_start(GTK_TEXT_VIEW([self GOBJECT]), iter) ? YES : NO);
83 }
84
85 -(void)bufferToWindowCoordsWithWin:(GtkTextWindowType) win andBufferX:(gint) bufferX andBufferY:(gint) bufferY andWindowX:(gint*) windowX andWindowY:(gint*) windowY
86 {
87 gtk_text_view_buffer_to_window_coords(GTK_TEXT_VIEW([self GOBJECT]), win, bufferX, bufferY, windowX, windowY);
88 }
89
90 -(BOOL)forwardDisplayLine:(GtkTextIter*) iter
91 {
92 return (gtk_text_view_forward_display_line(GTK_TEXT_VIEW([self GOBJECT]), iter) ? YES : NO);
93 }
94
95 -(BOOL)forwardDisplayLineEnd:(GtkTextIter*) iter
96 {
97 return (gtk_text_view_forward_display_line_end(GTK_TEXT_VIEW([self GOBJECT]), iter) ? YES : NO);
98 }
99
100 -(BOOL)getAcceptsTab
101 {
102 return (gtk_text_view_get_accepts_tab(GTK_TEXT_VIEW([self GOBJECT])) ? YES : NO);
103 }
104
105 -(gint)getBorderWindowSize:(GtkTextWindowType) type
106 {
107 return gtk_text_view_get_border_window_size(GTK_TEXT_VIEW([self GOBJECT]), type);
108 }
109
110 -(GtkTextBuffer*)getBuffer
111 {
112 return gtk_text_view_get_buffer(GTK_TEXT_VIEW([self GOBJECT]));
113 }
114
115 -(void)getCursorLocationsWithIter:(const GtkTextIter*) iter andStrong:(GdkRectangle*) strong andWeak:(GdkRectangle*) weak
116 {
117 gtk_text_view_get_cursor_locations(GTK_TEXT_VIEW([self GOBJECT]), iter, strong, weak);
118 }
119
120 -(BOOL)getCursorVisible
121 {
122 return (gtk_text_view_get_cursor_visible(GTK_TEXT_VIEW([self GOBJECT])) ? YES : NO);
123 }
124
125 -(GtkTextAttributes*)getDefaultAttributes
126 {
127 return gtk_text_view_get_default_attributes(GTK_TEXT_VIEW([self GOBJECT]));
128 }
129
130 -(BOOL)getEditable
131 {
132 return (gtk_text_view_get_editable(GTK_TEXT_VIEW([self GOBJECT])) ? YES : NO);
133 }
134
135 -(GtkAdjustment*)getHadjustment
136 {
137 return gtk_text_view_get_hadjustment(GTK_TEXT_VIEW([self GOBJECT]));
138 }
139
140 -(gint)getIndent
141 {
142 return gtk_text_view_get_indent(GTK_TEXT_VIEW([self GOBJECT]));
143 }
144
145 -(GtkInputHints)getInputHints
146 {
147 return gtk_text_view_get_input_hints(GTK_TEXT_VIEW([self GOBJECT]));
148 }
149
150 -(GtkInputPurpose)getInputPurpose
151 {
152 return gtk_text_view_get_input_purpose(GTK_TEXT_VIEW([self GOBJECT]));
153 }
154
155 -(void)getIterAtLocationWithIter:(GtkTextIter*) iter andX:(gint) x andY:(gint) y
156 {
157 gtk_text_view_get_iter_at_location(GTK_TEXT_VIEW([self GOBJECT]), iter, x, y);
158 }
159
160 -(void)getIterAtPositionWithIter:(GtkTextIter*) iter andTrailing:(gint*) trailing andX:(gint) x andY:(gint) y
161 {
162 gtk_text_view_get_iter_at_position(GTK_TEXT_VIEW([self GOBJECT]), iter, trailing, x, y);
163 }
164
165 -(void)getIterLocationWithIter:(const GtkTextIter*) iter andLocation:(GdkRectangle*) location
166 {
167 gtk_text_view_get_iter_location(GTK_TEXT_VIEW([self GOBJECT]), iter, location);
168 }
169
170 -(GtkJustification)getJustification
171 {
172 return gtk_text_view_get_justification(GTK_TEXT_VIEW([self GOBJECT]));
173 }
174
175 -(gint)getLeftMargin
176 {
177 return gtk_text_view_get_left_margin(GTK_TEXT_VIEW([self GOBJECT]));
178 }
179
180 -(void)getLineAtYWithTargetIter:(GtkTextIter*) targetIter andY:(gint) y andLineTop:(gint*) lineTop
181 {
182 gtk_text_view_get_line_at_y(GTK_TEXT_VIEW([self GOBJECT]), targetIter, y, lineTop);
183 }
184
185 -(void)getLineYrangeWithIter:(const GtkTextIter*) iter andY:(gint*) y andHeight:(gint*) height
186 {
187 gtk_text_view_get_line_yrange(GTK_TEXT_VIEW([self GOBJECT]), iter, y, height);
188 }
189
190 -(BOOL)getOverwrite
191 {
192 return (gtk_text_view_get_overwrite(GTK_TEXT_VIEW([self GOBJECT])) ? YES : NO);
193 }
194
195 -(gint)getPixelsAboveLines
196 {
197 return gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW([self GOBJECT]));
198 }
199
200 -(gint)getPixelsBelowLines
201 {
202 return gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW([self GOBJECT]));
203 }
204
205 -(gint)getPixelsInsideWrap
206 {
207 return gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW([self GOBJECT]));
208 }
209
210 -(gint)getRightMargin
211 {
212 return gtk_text_view_get_right_margin(GTK_TEXT_VIEW([self GOBJECT]));
213 }
214
215 -(PangoTabArray*)getTabs
216 {
217 return gtk_text_view_get_tabs(GTK_TEXT_VIEW([self GOBJECT]));
218 }
219
220 -(GtkAdjustment*)getVadjustment
221 {
222 return gtk_text_view_get_vadjustment(GTK_TEXT_VIEW([self GOBJECT]));
223 }
224
225 -(void)getVisibleRect:(GdkRectangle*) visibleRect
226 {
227 gtk_text_view_get_visible_rect(GTK_TEXT_VIEW([self GOBJECT]), visibleRect);
228 }
229
230 -(GdkWindow*)getWindow:(GtkTextWindowType) win
231 {
232 return gtk_text_view_get_window(GTK_TEXT_VIEW([self GOBJECT]), win);
233 }
234
235 -(GtkTextWindowType)getWindowType:(GdkWindow*) window
236 {
237 return gtk_text_view_get_window_type(GTK_TEXT_VIEW([self GOBJECT]), window);
238 }
239
240 -(GtkWrapMode)getWrapMode
241 {
242 return gtk_text_view_get_wrap_mode(GTK_TEXT_VIEW([self GOBJECT]));
243 }
244
245 -(BOOL)imContextFilterKeypress:(GdkEventKey*) event
246 {
247 return (gtk_text_view_im_context_filter_keypress(GTK_TEXT_VIEW([self GOBJECT]), event) ? YES : NO);
248 }
249
250 -(void)moveChildWithChild:(CGTKWidget*) child andXpos:(gint) xpos andYpos:(gint) ypos
251 {
252 gtk_text_view_move_child(GTK_TEXT_VIEW([self GOBJECT]), [child WIDGET], xpos, ypos);
253 }
254
255 -(BOOL)moveMarkOnscreen:(GtkTextMark*) mark
256 {
257 return (gtk_text_view_move_mark_onscreen(GTK_TEXT_VIEW([self GOBJECT]), mark) ? YES : NO);
258 }
259
260 -(BOOL)moveVisuallyWithIter:(GtkTextIter*) iter andCount:(gint) count
261 {
262 return (gtk_text_view_move_visually(GTK_TEXT_VIEW([self GOBJECT]), iter, count) ? YES : NO);
263 }
264
265 -(BOOL)placeCursorOnscreen
266 {
267 return (gtk_text_view_place_cursor_onscreen(GTK_TEXT_VIEW([self GOBJECT])) ? YES : NO);
268 }
269
270 -(void)resetImContext
271 {
272 gtk_text_view_reset_im_context(GTK_TEXT_VIEW([self GOBJECT]));
273 }
274
275 -(void)scrollMarkOnscreen:(GtkTextMark*) mark
276 {
277 gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW([self GOBJECT]), mark);
278 }
279
280 -(BOOL)scrollToIterWithIter:(GtkTextIter*) iter andWithinMargin:(gdouble) withinMargin andUseAlign:(BOOL) useAlign andXalign:(gdouble) xalign andYalign:(gdouble) yalign
281 {
282 return (gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW([self GOBJECT]), iter, withinMargin, (useAlign ? TRUE : FALSE), xalign, yalign) ? YES : NO);
283 }
284
285 -(void)scrollToMarkWithMark:(GtkTextMark*) mark andWithinMargin:(gdouble) withinMargin andUseAlign:(BOOL) useAlign andXalign:(gdouble) xalign andYalign:(gdouble) yalign
286 {
287 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW([self GOBJECT]), mark, withinMargin, (useAlign ? TRUE : FALSE), xalign, yalign);
288 }
289
290 -(void)setAcceptsTab:(BOOL) acceptsTab
291 {
292 gtk_text_view_set_accepts_tab(GTK_TEXT_VIEW([self GOBJECT]), (acceptsTab ? TRUE : FALSE));
293 }
294
295 -(void)setBorderWindowSizeWithType:(GtkTextWindowType) type andSize:(gint) size
296 {
297 gtk_text_view_set_border_window_size(GTK_TEXT_VIEW([self GOBJECT]), type, size);
298 }
299
300 -(void)setBuffer:(GtkTextBuffer*) buffer
301 {
302 gtk_text_view_set_buffer(GTK_TEXT_VIEW([self GOBJECT]), buffer);
303 }
304
305 -(void)setCursorVisible:(BOOL) setting
306 {
307 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW([self GOBJECT]), (setting ? TRUE : FALSE));
308 }
309
310 -(void)setEditable:(BOOL) setting
311 {
312 gtk_text_view_set_editable(GTK_TEXT_VIEW([self GOBJECT]), (setting ? TRUE : FALSE));
313 }
314
315 -(void)setIndent:(gint) indent
316 {
317 gtk_text_view_set_indent(GTK_TEXT_VIEW([self GOBJECT]), indent);
318 }
319
320 -(void)setInputHints:(GtkInputHints) hints
321 {
322 gtk_text_view_set_input_hints(GTK_TEXT_VIEW([self GOBJECT]), hints);
323 }
324
325 -(void)setInputPurpose:(GtkInputPurpose) purpose
326 {
327 gtk_text_view_set_input_purpose(GTK_TEXT_VIEW([self GOBJECT]), purpose);
328 }
329
330 -(void)setJustification:(GtkJustification) justification
331 {
332 gtk_text_view_set_justification(GTK_TEXT_VIEW([self GOBJECT]), justification);
333 }
334
335 -(void)setLeftMargin:(gint) leftMargin
336 {
337 gtk_text_view_set_left_margin(GTK_TEXT_VIEW([self GOBJECT]), leftMargin);
338 }
339
340 -(void)setOverwrite:(BOOL) overwrite
341 {
342 gtk_text_view_set_overwrite(GTK_TEXT_VIEW([self GOBJECT]), (overwrite ? TRUE : FALSE));
343 }
344
345 -(void)setPixelsAboveLines:(gint) pixelsAboveLines
346 {
347 gtk_text_view_set_pixels_above_lines(GTK_TEXT_VIEW([self GOBJECT]), pixelsAboveLines);
348 }
349
350 -(void)setPixelsBelowLines:(gint) pixelsBelowLines
351 {
352 gtk_text_view_set_pixels_below_lines(GTK_TEXT_VIEW([self GOBJECT]), pixelsBelowLines);
353 }
354
355 -(void)setPixelsInsideWrap:(gint) pixelsInsideWrap
356 {
357 gtk_text_view_set_pixels_inside_wrap(GTK_TEXT_VIEW([self GOBJECT]), pixelsInsideWrap);
358 }
359
360 -(void)setRightMargin:(gint) rightMargin
361 {
362 gtk_text_view_set_right_margin(GTK_TEXT_VIEW([self GOBJECT]), rightMargin);
363 }
364
365 -(void)setTabs:(PangoTabArray*) tabs
366 {
367 gtk_text_view_set_tabs(GTK_TEXT_VIEW([self GOBJECT]), tabs);
368 }
369
370 -(void)setWrapMode:(GtkWrapMode) wrapMode
371 {
372 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW([self GOBJECT]), wrapMode);
373 }
374
375 -(BOOL)startsDisplayLine:(const GtkTextIter*) iter
376 {
377 return (gtk_text_view_starts_display_line(GTK_TEXT_VIEW([self GOBJECT]), iter) ? YES : NO);
378 }
379
380 -(void)windowToBufferCoordsWithWin:(GtkTextWindowType) win andWindowX:(gint) windowX andWindowY:(gint) windowY andBufferX:(gint*) bufferX andBufferY:(gint*) bufferY
381 {
382 gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW([self GOBJECT]), win, windowX, windowY, bufferX, bufferY);
383 }
384
385
386 @end
-[CGTKTextView getBuffer]
GtkTextBuffer * getBuffer()
Definition: CGTKTextView.m:110
CGTKTextView
Definition: CGTKTextView.h:34
-[CGTKTextView getPixelsAboveLines]
gint getPixelsAboveLines()
Definition: CGTKTextView.m:195
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKTextView getTabs]
PangoTabArray * getTabs()
Definition: CGTKTextView.m:215
-[CGTKTextView init]
id init()
Definition: CGTKTextView.m:36
-[CGTKTextView getInputHints]
GtkInputHints getInputHints()
Definition: CGTKTextView.m:145
-[CGTKTextView getLeftMargin]
gint getLeftMargin()
Definition: CGTKTextView.m:175
-[CGTKTextView getAcceptsTab]
BOOL getAcceptsTab()
Definition: CGTKTextView.m:100
-[CGTKTextView getJustification]
GtkJustification getJustification()
Definition: CGTKTextView.m:170
-[CGTKTextView TEXTVIEW]
GtkTextView * TEXTVIEW()
Definition: CGTKTextView.m:60
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKTextView getRightMargin]
gint getRightMargin()
Definition: CGTKTextView.m:210
-[CGTKWidget getWindow]
GdkWindow * getWindow()
Definition: CGTKWidget.m:671
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKTextView getVadjustment]
GtkAdjustment * getVadjustment()
Definition: CGTKTextView.m:220
-[CGTKTextView getDefaultAttributes]
GtkTextAttributes * getDefaultAttributes()
Definition: CGTKTextView.m:125
-[CGTKTextView getHadjustment]
GtkAdjustment * getHadjustment()
Definition: CGTKTextView.m:135
-[CGTKTextView getWrapMode]
GtkWrapMode getWrapMode()
Definition: CGTKTextView.m:240
-[CGTKTextView placeCursorOnscreen]
BOOL placeCursorOnscreen()
Definition: CGTKTextView.m:265
-[CGTKTextView getPixelsInsideWrap]
gint getPixelsInsideWrap()
Definition: CGTKTextView.m:205
-[CGTKTextView getOverwrite]
BOOL getOverwrite()
Definition: CGTKTextView.m:190
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKTextView getCursorVisible]
BOOL getCursorVisible()
Definition: CGTKTextView.m:120
-[CGTKTextView resetImContext]
void resetImContext()
Definition: CGTKTextView.m:270
-[CGTKTextView getIndent]
gint getIndent()
Definition: CGTKTextView.m:140
-[CGTKTextView getEditable]
BOOL getEditable()
Definition: CGTKTextView.m:130
-[CGTKTextView getPixelsBelowLines]
gint getPixelsBelowLines()
Definition: CGTKTextView.m:200
-[CGTKTextView getInputPurpose]
GtkInputPurpose getInputPurpose()
Definition: CGTKTextView.m:150