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

- Main Page
- Classes
- Files

- File List

CGTKFlowBox.m
1 /*
2 * CGTKFlowBox.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/CGTKFlowBox.h"
33
34 @implementation CGTKFlowBox
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_flow_box_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(GtkFlowBox*)FLOWBOX
49 {
50 return GTK_FLOW_BOX([self GOBJECT]);
51 }
52
53 -(void)bindModelWithModel:(GListModel*) model andCreateWidgetFunc:(GtkFlowBoxCreateWidgetFunc) createWidgetFunc andUserData:(gpointer) userData andUserDataFreeFunc:(GDestroyNotify) userDataFreeFunc
54 {
55 gtk_flow_box_bind_model(GTK_FLOW_BOX([self GOBJECT]), model, createWidgetFunc, userData, userDataFreeFunc);
56 }
57
58 -(BOOL)getActivateOnSingleClick
59 {
60 return (gtk_flow_box_get_activate_on_single_click(GTK_FLOW_BOX([self GOBJECT])) ? YES : NO);
61 }
62
63 -(GtkFlowBoxChild*)getChildAtIndex:(gint) idx
64 {
65 return gtk_flow_box_get_child_at_index(GTK_FLOW_BOX([self GOBJECT]), idx);
66 }
67
68 -(guint)getColumnSpacing
69 {
70 return gtk_flow_box_get_column_spacing(GTK_FLOW_BOX([self GOBJECT]));
71 }
72
73 -(BOOL)getHomogeneous
74 {
75 return (gtk_flow_box_get_homogeneous(GTK_FLOW_BOX([self GOBJECT])) ? YES : NO);
76 }
77
78 -(guint)getMaxChildrenPerLine
79 {
80 return gtk_flow_box_get_max_children_per_line(GTK_FLOW_BOX([self GOBJECT]));
81 }
82
83 -(guint)getMinChildrenPerLine
84 {
85 return gtk_flow_box_get_min_children_per_line(GTK_FLOW_BOX([self GOBJECT]));
86 }
87
88 -(guint)getRowSpacing
89 {
90 return gtk_flow_box_get_row_spacing(GTK_FLOW_BOX([self GOBJECT]));
91 }
92
93 -(GList*)getSelectedChildren
94 {
95 return gtk_flow_box_get_selected_children(GTK_FLOW_BOX([self GOBJECT]));
96 }
97
98 -(GtkSelectionMode)getSelectionMode
99 {
100 return gtk_flow_box_get_selection_mode(GTK_FLOW_BOX([self GOBJECT]));
101 }
102
103 -(void)insertWithWidget:(CGTKWidget*) widget andPosition:(gint) position
104 {
105 gtk_flow_box_insert(GTK_FLOW_BOX([self GOBJECT]), [widget WIDGET], position);
106 }
107
108 -(void)invalidateFilter
109 {
110 gtk_flow_box_invalidate_filter(GTK_FLOW_BOX([self GOBJECT]));
111 }
112
113 -(void)invalidateSort
114 {
115 gtk_flow_box_invalidate_sort(GTK_FLOW_BOX([self GOBJECT]));
116 }
117
118 -(void)selectAll
119 {
120 gtk_flow_box_select_all(GTK_FLOW_BOX([self GOBJECT]));
121 }
122
123 -(void)selectChild:(GtkFlowBoxChild*) child
124 {
125 gtk_flow_box_select_child(GTK_FLOW_BOX([self GOBJECT]), child);
126 }
127
128 -(void)selectedForeachWithFunc:(GtkFlowBoxForeachFunc) func andData:(gpointer) data
129 {
130 gtk_flow_box_selected_foreach(GTK_FLOW_BOX([self GOBJECT]), func, data);
131 }
132
133 -(void)setActivateOnSingleClick:(BOOL) single
134 {
135 gtk_flow_box_set_activate_on_single_click(GTK_FLOW_BOX([self GOBJECT]), (single ? TRUE : FALSE));
136 }
137
138 -(void)setColumnSpacing:(guint) spacing
139 {
140 gtk_flow_box_set_column_spacing(GTK_FLOW_BOX([self GOBJECT]), spacing);
141 }
142
143 -(void)setFilterFuncWithFilterFunc:(GtkFlowBoxFilterFunc) filterFunc andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
144 {
145 gtk_flow_box_set_filter_func(GTK_FLOW_BOX([self GOBJECT]), filterFunc, userData, destroy);
146 }
147
148 -(void)setHadjustment:(GtkAdjustment*) adjustment
149 {
150 gtk_flow_box_set_hadjustment(GTK_FLOW_BOX([self GOBJECT]), adjustment);
151 }
152
153 -(void)setHomogeneous:(BOOL) homogeneous
154 {
155 gtk_flow_box_set_homogeneous(GTK_FLOW_BOX([self GOBJECT]), (homogeneous ? TRUE : FALSE));
156 }
157
158 -(void)setMaxChildrenPerLine:(guint) nchildren
159 {
160 gtk_flow_box_set_max_children_per_line(GTK_FLOW_BOX([self GOBJECT]), nchildren);
161 }
162
163 -(void)setMinChildrenPerLine:(guint) nchildren
164 {
165 gtk_flow_box_set_min_children_per_line(GTK_FLOW_BOX([self GOBJECT]), nchildren);
166 }
167
168 -(void)setRowSpacing:(guint) spacing
169 {
170 gtk_flow_box_set_row_spacing(GTK_FLOW_BOX([self GOBJECT]), spacing);
171 }
172
173 -(void)setSelectionMode:(GtkSelectionMode) mode
174 {
175 gtk_flow_box_set_selection_mode(GTK_FLOW_BOX([self GOBJECT]), mode);
176 }
177
178 -(void)setSortFuncWithSortFunc:(GtkFlowBoxSortFunc) sortFunc andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
179 {
180 gtk_flow_box_set_sort_func(GTK_FLOW_BOX([self GOBJECT]), sortFunc, userData, destroy);
181 }
182
183 -(void)setVadjustment:(GtkAdjustment*) adjustment
184 {
185 gtk_flow_box_set_vadjustment(GTK_FLOW_BOX([self GOBJECT]), adjustment);
186 }
187
188 -(void)unselectAll
189 {
190 gtk_flow_box_unselect_all(GTK_FLOW_BOX([self GOBJECT]));
191 }
192
193 -(void)unselectChild:(GtkFlowBoxChild*) child
194 {
195 gtk_flow_box_unselect_child(GTK_FLOW_BOX([self GOBJECT]), child);
196 }
197
198
199 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKFlowBox getRowSpacing]
guint getRowSpacing()
Definition: CGTKFlowBox.m:88
-[CGTKFlowBox invalidateSort]
void invalidateSort()
Definition: CGTKFlowBox.m:113
-[CGTKFlowBox getMinChildrenPerLine]
guint getMinChildrenPerLine()
Definition: CGTKFlowBox.m:83
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKFlowBox getActivateOnSingleClick]
BOOL getActivateOnSingleClick()
Definition: CGTKFlowBox.m:58
-[CGTKFlowBox FLOWBOX]
GtkFlowBox * FLOWBOX()
Definition: CGTKFlowBox.m:48
-[CGTKFlowBox selectAll]
void selectAll()
Definition: CGTKFlowBox.m:118
-[CGTKFlowBox getSelectionMode]
GtkSelectionMode getSelectionMode()
Definition: CGTKFlowBox.m:98
-[CGTKFlowBox getSelectedChildren]
GList * getSelectedChildren()
Definition: CGTKFlowBox.m:93
-[CGTKFlowBox getMaxChildrenPerLine]
guint getMaxChildrenPerLine()
Definition: CGTKFlowBox.m:78
-[CGTKFlowBox init]
id init()
Definition: CGTKFlowBox.m:36
-[CGTKWidget destroy]
void destroy()
Definition: CGTKWidget.m:131
-[CGTKFlowBox invalidateFilter]
void invalidateFilter()
Definition: CGTKFlowBox.m:108
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKFlowBox getColumnSpacing]
guint getColumnSpacing()
Definition: CGTKFlowBox.m:68
-[CGTKFlowBox unselectAll]
void unselectAll()
Definition: CGTKFlowBox.m:188
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKFlowBox getHomogeneous]
BOOL getHomogeneous()
Definition: CGTKFlowBox.m:73
CGTKFlowBox
Definition: CGTKFlowBox.h:34