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

CGTKScrolledWindow.m
1 /*
2 * CGTKScrolledWindow.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/CGTKScrolledWindow.h"
33
34 @implementation CGTKScrolledWindow
35
36 -(id)initWithHadjustment:(GtkAdjustment*) hadjustment andVadjustment:(GtkAdjustment*) vadjustment
37 {
38 self = [super initWithGObject:(GObject *)gtk_scrolled_window_new(hadjustment, vadjustment)];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(GtkScrolledWindow*)SCROLLEDWINDOW
49 {
50 return GTK_SCROLLED_WINDOW([self GOBJECT]);
51 }
52
53 -(void)addWithViewport:(CGTKWidget*) child
54 {
55 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW([self GOBJECT]), [child WIDGET]);
56 }
57
58 -(BOOL)getCaptureButtonPress
59 {
60 return (gtk_scrolled_window_get_capture_button_press(GTK_SCROLLED_WINDOW([self GOBJECT])) ? YES : NO);
61 }
62
63 -(GtkAdjustment*)getHadjustment
64 {
65 return gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW([self GOBJECT]));
66 }
67
68 -(CGTKWidget*)getHscrollbar
69 {
70 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_scrolled_window_get_hscrollbar(GTK_SCROLLED_WINDOW([self GOBJECT]))];
71 }
72
73 -(BOOL)getKineticScrolling
74 {
75 return (gtk_scrolled_window_get_kinetic_scrolling(GTK_SCROLLED_WINDOW([self GOBJECT])) ? YES : NO);
76 }
77
78 -(gint)getMaxContentHeight
79 {
80 return gtk_scrolled_window_get_max_content_height(GTK_SCROLLED_WINDOW([self GOBJECT]));
81 }
82
83 -(gint)getMaxContentWidth
84 {
85 return gtk_scrolled_window_get_max_content_width(GTK_SCROLLED_WINDOW([self GOBJECT]));
86 }
87
88 -(gint)getMinContentHeight
89 {
90 return gtk_scrolled_window_get_min_content_height(GTK_SCROLLED_WINDOW([self GOBJECT]));
91 }
92
93 -(gint)getMinContentWidth
94 {
95 return gtk_scrolled_window_get_min_content_width(GTK_SCROLLED_WINDOW([self GOBJECT]));
96 }
97
98 -(BOOL)getOverlayScrolling
99 {
100 return (gtk_scrolled_window_get_overlay_scrolling(GTK_SCROLLED_WINDOW([self GOBJECT])) ? YES : NO);
101 }
102
103 -(GtkCornerType)getPlacement
104 {
105 return gtk_scrolled_window_get_placement(GTK_SCROLLED_WINDOW([self GOBJECT]));
106 }
107
108 -(void)getPolicyWithHscrollbarPolicy:(GtkPolicyType*) hscrollbarPolicy andVscrollbarPolicy:(GtkPolicyType*) vscrollbarPolicy
109 {
110 gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW([self GOBJECT]), hscrollbarPolicy, vscrollbarPolicy);
111 }
112
113 -(BOOL)getPropagateNaturalHeight
114 {
115 return (gtk_scrolled_window_get_propagate_natural_height(GTK_SCROLLED_WINDOW([self GOBJECT])) ? YES : NO);
116 }
117
118 -(BOOL)getPropagateNaturalWidth
119 {
120 return (gtk_scrolled_window_get_propagate_natural_width(GTK_SCROLLED_WINDOW([self GOBJECT])) ? YES : NO);
121 }
122
123 -(GtkShadowType)getShadowType
124 {
125 return gtk_scrolled_window_get_shadow_type(GTK_SCROLLED_WINDOW([self GOBJECT]));
126 }
127
128 -(GtkAdjustment*)getVadjustment
129 {
130 return gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW([self GOBJECT]));
131 }
132
133 -(CGTKWidget*)getVscrollbar
134 {
135 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_scrolled_window_get_vscrollbar(GTK_SCROLLED_WINDOW([self GOBJECT]))];
136 }
137
138 -(void)setCaptureButtonPress:(BOOL) captureButtonPress
139 {
140 gtk_scrolled_window_set_capture_button_press(GTK_SCROLLED_WINDOW([self GOBJECT]), (captureButtonPress ? TRUE : FALSE));
141 }
142
143 -(void)setHadjustment:(GtkAdjustment*) hadjustment
144 {
145 gtk_scrolled_window_set_hadjustment(GTK_SCROLLED_WINDOW([self GOBJECT]), hadjustment);
146 }
147
148 -(void)setKineticScrolling:(BOOL) kineticScrolling
149 {
150 gtk_scrolled_window_set_kinetic_scrolling(GTK_SCROLLED_WINDOW([self GOBJECT]), (kineticScrolling ? TRUE : FALSE));
151 }
152
153 -(void)setMaxContentHeight:(gint) height
154 {
155 gtk_scrolled_window_set_max_content_height(GTK_SCROLLED_WINDOW([self GOBJECT]), height);
156 }
157
158 -(void)setMaxContentWidth:(gint) width
159 {
160 gtk_scrolled_window_set_max_content_width(GTK_SCROLLED_WINDOW([self GOBJECT]), width);
161 }
162
163 -(void)setMinContentHeight:(gint) height
164 {
165 gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW([self GOBJECT]), height);
166 }
167
168 -(void)setMinContentWidth:(gint) width
169 {
170 gtk_scrolled_window_set_min_content_width(GTK_SCROLLED_WINDOW([self GOBJECT]), width);
171 }
172
173 -(void)setOverlayScrolling:(BOOL) overlayScrolling
174 {
175 gtk_scrolled_window_set_overlay_scrolling(GTK_SCROLLED_WINDOW([self GOBJECT]), (overlayScrolling ? TRUE : FALSE));
176 }
177
178 -(void)setPlacement:(GtkCornerType) windowPlacement
179 {
180 gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW([self GOBJECT]), windowPlacement);
181 }
182
183 -(void)setPolicyWithHscrollbarPolicy:(GtkPolicyType) hscrollbarPolicy andVscrollbarPolicy:(GtkPolicyType) vscrollbarPolicy
184 {
185 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW([self GOBJECT]), hscrollbarPolicy, vscrollbarPolicy);
186 }
187
188 -(void)setPropagateNaturalHeight:(BOOL) propagate
189 {
190 gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW([self GOBJECT]), (propagate ? TRUE : FALSE));
191 }
192
193 -(void)setPropagateNaturalWidth:(BOOL) propagate
194 {
195 gtk_scrolled_window_set_propagate_natural_width(GTK_SCROLLED_WINDOW([self GOBJECT]), (propagate ? TRUE : FALSE));
196 }
197
198 -(void)setShadowType:(GtkShadowType) type
199 {
200 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW([self GOBJECT]), type);
201 }
202
203 -(void)setVadjustment:(GtkAdjustment*) vadjustment
204 {
205 gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW([self GOBJECT]), vadjustment);
206 }
207
208 -(void)unsetPlacement
209 {
210 gtk_scrolled_window_unset_placement(GTK_SCROLLED_WINDOW([self GOBJECT]));
211 }
212
213
214 @end
-[CGTKScrolledWindow SCROLLEDWINDOW]
GtkScrolledWindow * SCROLLEDWINDOW()
Definition: CGTKScrolledWindow.m:48
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKScrolledWindow getKineticScrolling]
BOOL getKineticScrolling()
Definition: CGTKScrolledWindow.m:73
-[CGTKScrolledWindow getShadowType]
GtkShadowType getShadowType()
Definition: CGTKScrolledWindow.m:123
-[CGTKScrolledWindow getVscrollbar]
CGTKWidget * getVscrollbar()
Definition: CGTKScrolledWindow.m:133
-[CGTKScrolledWindow getMaxContentWidth]
gint getMaxContentWidth()
Definition: CGTKScrolledWindow.m:83
-[CGTKScrolledWindow getMaxContentHeight]
gint getMaxContentHeight()
Definition: CGTKScrolledWindow.m:78
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKScrolledWindow getHadjustment]
GtkAdjustment * getHadjustment()
Definition: CGTKScrolledWindow.m:63
CGTKScrolledWindow
Definition: CGTKScrolledWindow.h:34
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKScrolledWindow getOverlayScrolling]
BOOL getOverlayScrolling()
Definition: CGTKScrolledWindow.m:98
-[CGTKScrolledWindow getHscrollbar]
CGTKWidget * getHscrollbar()
Definition: CGTKScrolledWindow.m:68
-[CGTKScrolledWindow getPlacement]
GtkCornerType getPlacement()
Definition: CGTKScrolledWindow.m:103
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKScrolledWindow getVadjustment]
GtkAdjustment * getVadjustment()
Definition: CGTKScrolledWindow.m:128
-[CGTKScrolledWindow getPropagateNaturalWidth]
BOOL getPropagateNaturalWidth()
Definition: CGTKScrolledWindow.m:118
-[CGTKScrolledWindow getPropagateNaturalHeight]
BOOL getPropagateNaturalHeight()
Definition: CGTKScrolledWindow.m:113
-[CGTKScrolledWindow getCaptureButtonPress]
BOOL getCaptureButtonPress()
Definition: CGTKScrolledWindow.m:58
-[CGTKScrolledWindow unsetPlacement]
void unsetPlacement()
Definition: CGTKScrolledWindow.m:208
-[CGTKScrolledWindow getMinContentHeight]
gint getMinContentHeight()
Definition: CGTKScrolledWindow.m:88
-[CGTKScrolledWindow getMinContentWidth]
gint getMinContentWidth()
Definition: CGTKScrolledWindow.m:93