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