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

- Main Page
- Classes
- Files

- File List

CGTKLabel.m
1 /*
2 * CGTKLabel.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2016 - 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, 2016. 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/CGTKLabel.h"
33
34 @implementation CGTKLabel
35
36 -(id)init:(NSString*) str
37 {
38 self = [super initWithGObject:(GObject *)gtk_label_new([str UTF8String])];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(id)initWithMnemonic:(NSString*) str
49 {
50 self = [super initWithGObject:(GObject *)gtk_label_new_with_mnemonic([str UTF8String])];
51
52 if(self)
53 {
54 //Do nothing
55 }
56
57 return self;
58 }
59
60 -(GtkLabel*)LABEL
61 {
62 return GTK_LABEL([self GOBJECT]);
63 }
64
65 -(gdouble)getAngle
66 {
67 return gtk_label_get_angle(GTK_LABEL([self GOBJECT]));
68 }
69
70 -(PangoAttrList*)getAttributes
71 {
72 return gtk_label_get_attributes(GTK_LABEL([self GOBJECT]));
73 }
74
75 -(NSString*)getCurrentUri
76 {
77 return [NSString stringWithUTF8String:gtk_label_get_current_uri(GTK_LABEL([self GOBJECT]))];
78 }
79
80 -(PangoEllipsizeMode)getEllipsize
81 {
82 return gtk_label_get_ellipsize(GTK_LABEL([self GOBJECT]));
83 }
84
85 -(GtkJustification)getJustify
86 {
87 return gtk_label_get_justify(GTK_LABEL([self GOBJECT]));
88 }
89
90 -(NSString*)getLabel
91 {
92 return [NSString stringWithUTF8String:gtk_label_get_label(GTK_LABEL([self GOBJECT]))];
93 }
94
95 -(PangoLayout*)getLayout
96 {
97 return gtk_label_get_layout(GTK_LABEL([self GOBJECT]));
98 }
99
100 -(void)getLayoutOffsetsWithX:(gint*) x andY:(gint*) y
101 {
102 gtk_label_get_layout_offsets(GTK_LABEL([self GOBJECT]), x, y);
103 }
104
105 -(BOOL)getLineWrap
106 {
107 return (gtk_label_get_line_wrap(GTK_LABEL([self GOBJECT])) ? YES : NO);
108 }
109
110 -(PangoWrapMode)getLineWrapMode
111 {
112 return gtk_label_get_line_wrap_mode(GTK_LABEL([self GOBJECT]));
113 }
114
115 -(gint)getLines
116 {
117 return gtk_label_get_lines(GTK_LABEL([self GOBJECT]));
118 }
119
120 -(gint)getMaxWidthChars
121 {
122 return gtk_label_get_max_width_chars(GTK_LABEL([self GOBJECT]));
123 }
124
125 -(guint)getMnemonicKeyval
126 {
127 return gtk_label_get_mnemonic_keyval(GTK_LABEL([self GOBJECT]));
128 }
129
130 -(CGTKWidget*)getMnemonicWidget
131 {
132 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_label_get_mnemonic_widget(GTK_LABEL([self GOBJECT]))];
133 }
134
135 -(BOOL)getSelectable
136 {
137 return (gtk_label_get_selectable(GTK_LABEL([self GOBJECT])) ? YES : NO);
138 }
139
140 -(BOOL)getSelectionBoundsWithStart:(gint*) start andEnd:(gint*) end
141 {
142 return (gtk_label_get_selection_bounds(GTK_LABEL([self GOBJECT]), start, end) ? YES : NO);
143 }
144
145 -(BOOL)getSingleLineMode
146 {
147 return (gtk_label_get_single_line_mode(GTK_LABEL([self GOBJECT])) ? YES : NO);
148 }
149
150 -(NSString*)getText
151 {
152 return [NSString stringWithUTF8String:gtk_label_get_text(GTK_LABEL([self GOBJECT]))];
153 }
154
155 -(BOOL)getTrackVisitedLinks
156 {
157 return (gtk_label_get_track_visited_links(GTK_LABEL([self GOBJECT])) ? YES : NO);
158 }
159
160 -(BOOL)getUseMarkup
161 {
162 return (gtk_label_get_use_markup(GTK_LABEL([self GOBJECT])) ? YES : NO);
163 }
164
165 -(BOOL)getUseUnderline
166 {
167 return (gtk_label_get_use_underline(GTK_LABEL([self GOBJECT])) ? YES : NO);
168 }
169
170 -(gint)getWidthChars
171 {
172 return gtk_label_get_width_chars(GTK_LABEL([self GOBJECT]));
173 }
174
175 -(gfloat)getXalign
176 {
177 return gtk_label_get_xalign(GTK_LABEL([self GOBJECT]));
178 }
179
180 -(gfloat)getYalign
181 {
182 return gtk_label_get_yalign(GTK_LABEL([self GOBJECT]));
183 }
184
185 -(void)selectRegionWithStartOffset:(gint) startOffset andEndOffset:(gint) endOffset
186 {
187 gtk_label_select_region(GTK_LABEL([self GOBJECT]), startOffset, endOffset);
188 }
189
190 -(void)setAngle:(gdouble) angle
191 {
192 gtk_label_set_angle(GTK_LABEL([self GOBJECT]), angle);
193 }
194
195 -(void)setAttributes:(PangoAttrList*) attrs
196 {
197 gtk_label_set_attributes(GTK_LABEL([self GOBJECT]), attrs);
198 }
199
200 -(void)setEllipsize:(PangoEllipsizeMode) mode
201 {
202 gtk_label_set_ellipsize(GTK_LABEL([self GOBJECT]), mode);
203 }
204
205 -(void)setJustify:(GtkJustification) jtype
206 {
207 gtk_label_set_justify(GTK_LABEL([self GOBJECT]), jtype);
208 }
209
210 -(void)setLabel:(NSString*) str
211 {
212 gtk_label_set_label(GTK_LABEL([self GOBJECT]), [str UTF8String]);
213 }
214
215 -(void)setLineWrap:(BOOL) wrap
216 {
217 gtk_label_set_line_wrap(GTK_LABEL([self GOBJECT]), (wrap ? TRUE : FALSE));
218 }
219
220 -(void)setLineWrapMode:(PangoWrapMode) wrapMode
221 {
222 gtk_label_set_line_wrap_mode(GTK_LABEL([self GOBJECT]), wrapMode);
223 }
224
225 -(void)setLines:(gint) lines
226 {
227 gtk_label_set_lines(GTK_LABEL([self GOBJECT]), lines);
228 }
229
230 -(void)setMarkup:(NSString*) str
231 {
232 gtk_label_set_markup(GTK_LABEL([self GOBJECT]), [str UTF8String]);
233 }
234
235 -(void)setMarkupWithMnemonic:(NSString*) str
236 {
237 gtk_label_set_markup_with_mnemonic(GTK_LABEL([self GOBJECT]), [str UTF8String]);
238 }
239
240 -(void)setMaxWidthChars:(gint) nchars
241 {
242 gtk_label_set_max_width_chars(GTK_LABEL([self GOBJECT]), nchars);
243 }
244
245 -(void)setMnemonicWidget:(CGTKWidget*) widget
246 {
247 gtk_label_set_mnemonic_widget(GTK_LABEL([self GOBJECT]), [widget WIDGET]);
248 }
249
250 -(void)setPattern:(NSString*) pattern
251 {
252 gtk_label_set_pattern(GTK_LABEL([self GOBJECT]), [pattern UTF8String]);
253 }
254
255 -(void)setSelectable:(BOOL) setting
256 {
257 gtk_label_set_selectable(GTK_LABEL([self GOBJECT]), (setting ? TRUE : FALSE));
258 }
259
260 -(void)setSingleLineMode:(BOOL) singleLineMode
261 {
262 gtk_label_set_single_line_mode(GTK_LABEL([self GOBJECT]), (singleLineMode ? TRUE : FALSE));
263 }
264
265 -(void)setText:(NSString*) str
266 {
267 gtk_label_set_text(GTK_LABEL([self GOBJECT]), [str UTF8String]);
268 }
269
270 -(void)setTextWithMnemonic:(NSString*) str
271 {
272 gtk_label_set_text_with_mnemonic(GTK_LABEL([self GOBJECT]), [str UTF8String]);
273 }
274
275 -(void)setTrackVisitedLinks:(BOOL) trackLinks
276 {
277 gtk_label_set_track_visited_links(GTK_LABEL([self GOBJECT]), (trackLinks ? TRUE : FALSE));
278 }
279
280 -(void)setUseMarkup:(BOOL) setting
281 {
282 gtk_label_set_use_markup(GTK_LABEL([self GOBJECT]), (setting ? TRUE : FALSE));
283 }
284
285 -(void)setUseUnderline:(BOOL) setting
286 {
287 gtk_label_set_use_underline(GTK_LABEL([self GOBJECT]), (setting ? TRUE : FALSE));
288 }
289
290 -(void)setWidthChars:(gint) nchars
291 {
292 gtk_label_set_width_chars(GTK_LABEL([self GOBJECT]), nchars);
293 }
294
295 -(void)setXalign:(gfloat) xalign
296 {
297 gtk_label_set_xalign(GTK_LABEL([self GOBJECT]), xalign);
298 }
299
300 -(void)setYalign:(gfloat) yalign
301 {
302 gtk_label_set_yalign(GTK_LABEL([self GOBJECT]), yalign);
303 }
304
305
306 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKLabel getLines]
gint getLines()
Definition: CGTKLabel.m:115
-[CGTKLabel getSingleLineMode]
BOOL getSingleLineMode()
Definition: CGTKLabel.m:145
-[CGTKLabel getCurrentUri]
NSString * getCurrentUri()
Definition: CGTKLabel.m:75
-[CGTKLabel getYalign]
gfloat getYalign()
Definition: CGTKLabel.m:180
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKLabel getAngle]
gdouble getAngle()
Definition: CGTKLabel.m:65
-[CGTKLabel getLineWrapMode]
PangoWrapMode getLineWrapMode()
Definition: CGTKLabel.m:110
-[CGTKLabel getLineWrap]
BOOL getLineWrap()
Definition: CGTKLabel.m:105
-[CGTKLabel getTrackVisitedLinks]
BOOL getTrackVisitedLinks()
Definition: CGTKLabel.m:155
-[CGTKLabel getEllipsize]
PangoEllipsizeMode getEllipsize()
Definition: CGTKLabel.m:80
-[CGTKLabel getMnemonicKeyval]
guint getMnemonicKeyval()
Definition: CGTKLabel.m:125
-[CGTKLabel getText]
NSString * getText()
Definition: CGTKLabel.m:150
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKLabel getWidthChars]
gint getWidthChars()
Definition: CGTKLabel.m:170
-[CGTKLabel getJustify]
GtkJustification getJustify()
Definition: CGTKLabel.m:85
CGTKLabel
Definition: CGTKLabel.h:34
-[CGTKLabel getUseUnderline]
BOOL getUseUnderline()
Definition: CGTKLabel.m:165
-[CGTKLabel getMaxWidthChars]
gint getMaxWidthChars()
Definition: CGTKLabel.m:120
-[CGTKLabel getXalign]
gfloat getXalign()
Definition: CGTKLabel.m:175
-[CGTKLabel LABEL]
GtkLabel * LABEL()
Definition: CGTKLabel.m:60
-[CGTKLabel getLabel]
NSString * getLabel()
Definition: CGTKLabel.m:90
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKLabel getAttributes]
PangoAttrList * getAttributes()
Definition: CGTKLabel.m:70
-[CGTKLabel getLayout]
PangoLayout * getLayout()
Definition: CGTKLabel.m:95
-[CGTKLabel getMnemonicWidget]
CGTKWidget * getMnemonicWidget()
Definition: CGTKLabel.m:130
-[CGTKLabel getUseMarkup]
BOOL getUseMarkup()
Definition: CGTKLabel.m:160
-[CGTKLabel getSelectable]
BOOL getSelectable()
Definition: CGTKLabel.m:135