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
CGTKContainer.m
1 /*
2 * CGTKContainer.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/CGTKContainer.h"
33
34 @implementation CGTKContainer
35
36 -(void)addWidget:(CGTKWidget *)widget withProperties:(NSDictionary *)properties
37 {
38 CGTKTypeWrapper *wrapper;
39 for(NSString *propName in properties)
40 {
41 wrapper = [properties objectForKey:propName];
42
43 gtk_container_child_set_property([self CONTAINER], [widget WIDGET], [propName UTF8String], [wrapper asGValuePtr]);
44 }
45 }
46
47 -(GtkContainer*)CONTAINER
48 {
49 return GTK_CONTAINER([self GOBJECT]);
50 }
51
52 -(void)add:(CGTKWidget*) widget
53 {
54 gtk_container_add(GTK_CONTAINER([self GOBJECT]), [widget WIDGET]);
55 }
56
57 -(void)checkResize
58 {
59 gtk_container_check_resize(GTK_CONTAINER([self GOBJECT]));
60 }
61
62 -(void)childGetPropertyWithChild:(CGTKWidget*) child andPropertyName:(NSString*) propertyName andValue:(GValue*) value
63 {
64 gtk_container_child_get_property(GTK_CONTAINER([self GOBJECT]), [child WIDGET], [propertyName UTF8String], value);
65 }
66
67 -(void)childGetValistWithChild:(CGTKWidget*) child andFirstPropertyName:(NSString*) firstPropertyName andVarArgs:(va_list) varArgs
68 {
69 gtk_container_child_get_valist(GTK_CONTAINER([self GOBJECT]), [child WIDGET], [firstPropertyName UTF8String], varArgs);
70 }
71
72 -(void)childNotifyWithChild:(CGTKWidget*) child andChildProperty:(NSString*) childProperty
73 {
74 gtk_container_child_notify(GTK_CONTAINER([self GOBJECT]), [child WIDGET], [childProperty UTF8String]);
75 }
76
77 -(void)childSetPropertyWithChild:(CGTKWidget*) child andPropertyName:(NSString*) propertyName andValue:(const GValue*) value
78 {
79 gtk_container_child_set_property(GTK_CONTAINER([self GOBJECT]), [child WIDGET], [propertyName UTF8String], value);
80 }
81
82 -(void)childSetValistWithChild:(CGTKWidget*) child andFirstPropertyName:(NSString*) firstPropertyName andVarArgs:(va_list) varArgs
83 {
84 gtk_container_child_set_valist(GTK_CONTAINER([self GOBJECT]), [child WIDGET], [firstPropertyName UTF8String], varArgs);
85 }
86
87 -(GType)childType
88 {
89 return gtk_container_child_type(GTK_CONTAINER([self GOBJECT]));
90 }
91
92 -(void)forallWithCallback:(GtkCallback) callback andCallbackData:(gpointer) callbackData
93 {
94 gtk_container_forall(GTK_CONTAINER([self GOBJECT]), callback, callbackData);
95 }
96
97 -(void)foreachWithCallback:(GtkCallback) callback andCallbackData:(gpointer) callbackData
98 {
99 gtk_container_foreach(GTK_CONTAINER([self GOBJECT]), callback, callbackData);
100 }
101
102 -(guint)getBorderWidth
103 {
104 return gtk_container_get_border_width(GTK_CONTAINER([self GOBJECT]));
105 }
106
107 -(GList*)getChildren
108 {
109 return gtk_container_get_children(GTK_CONTAINER([self GOBJECT]));
110 }
111
112 -(BOOL)getFocusChain:(GList**) focusableWidgets
113 {
114 return (gtk_container_get_focus_chain(GTK_CONTAINER([self GOBJECT]), focusableWidgets) ? YES : NO);
115 }
116
117 -(CGTKWidget*)getFocusChild
118 {
119 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_container_get_focus_child(GTK_CONTAINER([self GOBJECT]))];
120 }
121
122 -(GtkAdjustment*)getFocusHadjustment
123 {
124 return gtk_container_get_focus_hadjustment(GTK_CONTAINER([self GOBJECT]));
125 }
126
127 -(GtkAdjustment*)getFocusVadjustment
128 {
129 return gtk_container_get_focus_vadjustment(GTK_CONTAINER([self GOBJECT]));
130 }
131
132 -(GtkWidgetPath*)getPathForChild:(CGTKWidget*) child
133 {
134 return gtk_container_get_path_for_child(GTK_CONTAINER([self GOBJECT]), [child WIDGET]);
135 }
136
137 -(GtkResizeMode)getResizeMode
138 {
139 return gtk_container_get_resize_mode(GTK_CONTAINER([self GOBJECT]));
140 }
141
142 -(void)propagateDrawWithChild:(CGTKWidget*) child andCr:(cairo_t*) cr
143 {
144 gtk_container_propagate_draw(GTK_CONTAINER([self GOBJECT]), [child WIDGET], cr);
145 }
146
147 -(void)remove:(CGTKWidget*) widget
148 {
149 gtk_container_remove(GTK_CONTAINER([self GOBJECT]), [widget WIDGET]);
150 }
151
152 -(void)resizeChildren
153 {
154 gtk_container_resize_children(GTK_CONTAINER([self GOBJECT]));
155 }
156
157 -(void)setBorderWidth:(guint) borderWidth
158 {
159 gtk_container_set_border_width(GTK_CONTAINER([self GOBJECT]), borderWidth);
160 }
161
162 -(void)setFocusChain:(GList*) focusableWidgets
163 {
164 gtk_container_set_focus_chain(GTK_CONTAINER([self GOBJECT]), focusableWidgets);
165 }
166
167 -(void)setFocusChild:(CGTKWidget*) child
168 {
169 gtk_container_set_focus_child(GTK_CONTAINER([self GOBJECT]), [child WIDGET]);
170 }
171
172 -(void)setFocusHadjustment:(GtkAdjustment*) adjustment
173 {
174 gtk_container_set_focus_hadjustment(GTK_CONTAINER([self GOBJECT]), adjustment);
175 }
176
177 -(void)setFocusVadjustment:(GtkAdjustment*) adjustment
178 {
179 gtk_container_set_focus_vadjustment(GTK_CONTAINER([self GOBJECT]), adjustment);
180 }
181
182 -(void)setReallocateRedraws:(BOOL) needsRedraws
183 {
184 gtk_container_set_reallocate_redraws(GTK_CONTAINER([self GOBJECT]), (needsRedraws ? TRUE : FALSE));
185 }
186
187 -(void)setResizeMode:(GtkResizeMode) resizeMode
188 {
189 gtk_container_set_resize_mode(GTK_CONTAINER([self GOBJECT]), resizeMode);
190 }
191
192 -(void)unsetFocusChain
193 {
194 gtk_container_unset_focus_chain(GTK_CONTAINER([self GOBJECT]));
195 }
196
197
198 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKContainer CONTAINER]
GtkContainer * CONTAINER()
Definition: CGTKContainer.m:47
-[CGTKContainer resizeChildren]
void resizeChildren()
Definition: CGTKContainer.m:152
CGTKTypeWrapper
Definition: CGTKTypeWrapper.h:38
-[CGTKContainer childType]
GType childType()
Definition: CGTKContainer.m:87
-[CGTKContainer getFocusHadjustment]
GtkAdjustment * getFocusHadjustment()
Definition: CGTKContainer.m:122
-[CGTKContainer unsetFocusChain]
void unsetFocusChain()
Definition: CGTKContainer.m:192
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKContainer getChildren]
GList * getChildren()
Definition: CGTKContainer.m:107
-[CGTKContainer getFocusVadjustment]
GtkAdjustment * getFocusVadjustment()
Definition: CGTKContainer.m:127
-[CGTKContainer getResizeMode]
GtkResizeMode getResizeMode()
Definition: CGTKContainer.m:137
CGTKContainer
Definition: CGTKContainer.h:34
-[CGTKContainer getBorderWidth]
guint getBorderWidth()
Definition: CGTKContainer.m:102
-[CGTKContainer getFocusChild]
CGTKWidget * getFocusChild()
Definition: CGTKContainer.m:117
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKContainer checkResize]
void checkResize()
Definition: CGTKContainer.m:57