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

CGTKFlowBox.m
1 /*
2 * CGTKFlowBox.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2017 - 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, 2017. 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 -(GtkFlowBoxChild*)getChildAtPosWithX:(gint) x andY:(gint) y
69 {
70 return gtk_flow_box_get_child_at_pos(GTK_FLOW_BOX([self GOBJECT]), x, y);
71 }
72
73 -(guint)getColumnSpacing
74 {
75 return gtk_flow_box_get_column_spacing(GTK_FLOW_BOX([self GOBJECT]));
76 }
77
78 -(BOOL)getHomogeneous
79 {
80 return (gtk_flow_box_get_homogeneous(GTK_FLOW_BOX([self GOBJECT])) ? YES : NO);
81 }
82
83 -(guint)getMaxChildrenPerLine
84 {
85 return gtk_flow_box_get_max_children_per_line(GTK_FLOW_BOX([self GOBJECT]));
86 }
87
88 -(guint)getMinChildrenPerLine
89 {
90 return gtk_flow_box_get_min_children_per_line(GTK_FLOW_BOX([self GOBJECT]));
91 }
92
93 -(guint)getRowSpacing
94 {
95 return gtk_flow_box_get_row_spacing(GTK_FLOW_BOX([self GOBJECT]));
96 }
97
98 -(GList*)getSelectedChildren
99 {
100 return gtk_flow_box_get_selected_children(GTK_FLOW_BOX([self GOBJECT]));
101 }
102
103 -(GtkSelectionMode)getSelectionMode
104 {
105 return gtk_flow_box_get_selection_mode(GTK_FLOW_BOX([self GOBJECT]));
106 }
107
108 -(void)insertWithWidget:(CGTKWidget*) widget andPosition:(gint) position
109 {
110 gtk_flow_box_insert(GTK_FLOW_BOX([self GOBJECT]), [widget WIDGET], position);
111 }
112
113 -(void)invalidateFilter
114 {
115 gtk_flow_box_invalidate_filter(GTK_FLOW_BOX([self GOBJECT]));
116 }
117
118 -(void)invalidateSort
119 {
120 gtk_flow_box_invalidate_sort(GTK_FLOW_BOX([self GOBJECT]));
121 }
122
123 -(void)selectAll
124 {
125 gtk_flow_box_select_all(GTK_FLOW_BOX([self GOBJECT]));
126 }
127
128 -(void)selectChild:(GtkFlowBoxChild*) child
129 {
130 gtk_flow_box_select_child(GTK_FLOW_BOX([self GOBJECT]), child);
131 }
132
133 -(void)selectedForeachWithFunc:(GtkFlowBoxForeachFunc) func andData:(gpointer) data
134 {
135 gtk_flow_box_selected_foreach(GTK_FLOW_BOX([self GOBJECT]), func, data);
136 }
137
138 -(void)setActivateOnSingleClick:(BOOL) single
139 {
140 gtk_flow_box_set_activate_on_single_click(GTK_FLOW_BOX([self GOBJECT]), (single ? TRUE : FALSE));
141 }
142
143 -(void)setColumnSpacing:(guint) spacing
144 {
145 gtk_flow_box_set_column_spacing(GTK_FLOW_BOX([self GOBJECT]), spacing);
146 }
147
148 -(void)setFilterFuncWithFilterFunc:(GtkFlowBoxFilterFunc) filterFunc andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
149 {
150 gtk_flow_box_set_filter_func(GTK_FLOW_BOX([self GOBJECT]), filterFunc, userData, destroy);
151 }
152
153 -(void)setHadjustment:(GtkAdjustment*) adjustment
154 {
155 gtk_flow_box_set_hadjustment(GTK_FLOW_BOX([self GOBJECT]), adjustment);
156 }
157
158 -(void)setHomogeneous:(BOOL) homogeneous
159 {
160 gtk_flow_box_set_homogeneous(GTK_FLOW_BOX([self GOBJECT]), (homogeneous ? TRUE : FALSE));
161 }
162
163 -(void)setMaxChildrenPerLine:(guint) nchildren
164 {
165 gtk_flow_box_set_max_children_per_line(GTK_FLOW_BOX([self GOBJECT]), nchildren);
166 }
167
168 -(void)setMinChildrenPerLine:(guint) nchildren
169 {
170 gtk_flow_box_set_min_children_per_line(GTK_FLOW_BOX([self GOBJECT]), nchildren);
171 }
172
173 -(void)setRowSpacing:(guint) spacing
174 {
175 gtk_flow_box_set_row_spacing(GTK_FLOW_BOX([self GOBJECT]), spacing);
176 }
177
178 -(void)setSelectionMode:(GtkSelectionMode) mode
179 {
180 gtk_flow_box_set_selection_mode(GTK_FLOW_BOX([self GOBJECT]), mode);
181 }
182
183 -(void)setSortFuncWithSortFunc:(GtkFlowBoxSortFunc) sortFunc andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
184 {
185 gtk_flow_box_set_sort_func(GTK_FLOW_BOX([self GOBJECT]), sortFunc, userData, destroy);
186 }
187
188 -(void)setVadjustment:(GtkAdjustment*) adjustment
189 {
190 gtk_flow_box_set_vadjustment(GTK_FLOW_BOX([self GOBJECT]), adjustment);
191 }
192
193 -(void)unselectAll
194 {
195 gtk_flow_box_unselect_all(GTK_FLOW_BOX([self GOBJECT]));
196 }
197
198 -(void)unselectChild:(GtkFlowBoxChild*) child
199 {
200 gtk_flow_box_unselect_child(GTK_FLOW_BOX([self GOBJECT]), child);
201 }
202
203
204 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKFlowBox getRowSpacing]
guint getRowSpacing()
Definition: CGTKFlowBox.m:93
-[CGTKFlowBox invalidateSort]
void invalidateSort()
Definition: CGTKFlowBox.m:118
-[CGTKFlowBox getMinChildrenPerLine]
guint getMinChildrenPerLine()
Definition: CGTKFlowBox.m:88
-[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:123
-[CGTKFlowBox getSelectionMode]
GtkSelectionMode getSelectionMode()
Definition: CGTKFlowBox.m:103
-[CGTKFlowBox getSelectedChildren]
GList * getSelectedChildren()
Definition: CGTKFlowBox.m:98
-[CGTKFlowBox getMaxChildrenPerLine]
guint getMaxChildrenPerLine()
Definition: CGTKFlowBox.m:83
-[CGTKFlowBox init]
id init()
Definition: CGTKFlowBox.m:36
-[CGTKWidget destroy]
void destroy()
Definition: CGTKWidget.m:131
-[CGTKFlowBox invalidateFilter]
void invalidateFilter()
Definition: CGTKFlowBox.m:113
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKFlowBox getColumnSpacing]
guint getColumnSpacing()
Definition: CGTKFlowBox.m:73
-[CGTKFlowBox unselectAll]
void unselectAll()
Definition: CGTKFlowBox.m:193
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKFlowBox getHomogeneous]
BOOL getHomogeneous()
Definition: CGTKFlowBox.m:78
CGTKFlowBox
Definition: CGTKFlowBox.h:34