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
CGTKLabel.m
1 /*
2 * CGTKLabel.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/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 -(void)selectRegionWithStartOffset:(gint) startOffset andEndOffset:(gint) endOffset
176 {
177 gtk_label_select_region(GTK_LABEL([self GOBJECT]), startOffset, endOffset);
178 }
179
180 -(void)setAngle:(gdouble) angle
181 {
182 gtk_label_set_angle(GTK_LABEL([self GOBJECT]), angle);
183 }
184
185 -(void)setAttributes:(PangoAttrList*) attrs
186 {
187 gtk_label_set_attributes(GTK_LABEL([self GOBJECT]), attrs);
188 }
189
190 -(void)setEllipsize:(PangoEllipsizeMode) mode
191 {
192 gtk_label_set_ellipsize(GTK_LABEL([self GOBJECT]), mode);
193 }
194
195 -(void)setJustify:(GtkJustification) jtype
196 {
197 gtk_label_set_justify(GTK_LABEL([self GOBJECT]), jtype);
198 }
199
200 -(void)setLabel:(NSString*) str
201 {
202 gtk_label_set_label(GTK_LABEL([self GOBJECT]), [str UTF8String]);
203 }
204
205 -(void)setLineWrap:(BOOL) wrap
206 {
207 gtk_label_set_line_wrap(GTK_LABEL([self GOBJECT]), (wrap ? TRUE : FALSE));
208 }
209
210 -(void)setLineWrapMode:(PangoWrapMode) wrapMode
211 {
212 gtk_label_set_line_wrap_mode(GTK_LABEL([self GOBJECT]), wrapMode);
213 }
214
215 -(void)setLines:(gint) lines
216 {
217 gtk_label_set_lines(GTK_LABEL([self GOBJECT]), lines);
218 }
219
220 -(void)setMarkup:(NSString*) str
221 {
222 gtk_label_set_markup(GTK_LABEL([self GOBJECT]), [str UTF8String]);
223 }
224
225 -(void)setMarkupWithMnemonic:(NSString*) str
226 {
227 gtk_label_set_markup_with_mnemonic(GTK_LABEL([self GOBJECT]), [str UTF8String]);
228 }
229
230 -(void)setMaxWidthChars:(gint) nchars
231 {
232 gtk_label_set_max_width_chars(GTK_LABEL([self GOBJECT]), nchars);
233 }
234
235 -(void)setMnemonicWidget:(CGTKWidget*) widget
236 {
237 gtk_label_set_mnemonic_widget(GTK_LABEL([self GOBJECT]), [widget WIDGET]);
238 }
239
240 -(void)setPattern:(NSString*) pattern
241 {
242 gtk_label_set_pattern(GTK_LABEL([self GOBJECT]), [pattern UTF8String]);
243 }
244
245 -(void)setSelectable:(BOOL) setting
246 {
247 gtk_label_set_selectable(GTK_LABEL([self GOBJECT]), (setting ? TRUE : FALSE));
248 }
249
250 -(void)setSingleLineMode:(BOOL) singleLineMode
251 {
252 gtk_label_set_single_line_mode(GTK_LABEL([self GOBJECT]), (singleLineMode ? TRUE : FALSE));
253 }
254
255 -(void)setText:(NSString*) str
256 {
257 gtk_label_set_text(GTK_LABEL([self GOBJECT]), [str UTF8String]);
258 }
259
260 -(void)setTextWithMnemonic:(NSString*) str
261 {
262 gtk_label_set_text_with_mnemonic(GTK_LABEL([self GOBJECT]), [str UTF8String]);
263 }
264
265 -(void)setTrackVisitedLinks:(BOOL) trackLinks
266 {
267 gtk_label_set_track_visited_links(GTK_LABEL([self GOBJECT]), (trackLinks ? TRUE : FALSE));
268 }
269
270 -(void)setUseMarkup:(BOOL) setting
271 {
272 gtk_label_set_use_markup(GTK_LABEL([self GOBJECT]), (setting ? TRUE : FALSE));
273 }
274
275 -(void)setUseUnderline:(BOOL) setting
276 {
277 gtk_label_set_use_underline(GTK_LABEL([self GOBJECT]), (setting ? TRUE : FALSE));
278 }
279
280 -(void)setWidthChars:(gint) nchars
281 {
282 gtk_label_set_width_chars(GTK_LABEL([self GOBJECT]), nchars);
283 }
284
285
286 @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
-[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 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