2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkViewport.html
47 * - GtkAdjustment* -> Adjustment
58 import tango
.io
.Stdout
; // use the tango loging?
62 private import gtkc
.gtktypes
;
64 private import gtkc
.gtk
;
67 private import gtk
.Adjustment
;
75 private import gtk
.Bin
;
76 public class Viewport
: Bin
79 /** the main Gtk struct */
80 protected GtkViewport
* gtkViewport
;
83 public GtkViewport
* getViewportStruct()
89 /** the main Gtk struct as a void* */
90 protected void* getStruct()
92 return cast(void*)gtkViewport
;
96 * Sets our main struct and passes it to the parent class
98 public this (GtkViewport
* gtkViewport
)
102 if ( gtkViewport
is null )
107 Stdout("struct gtkViewport is null on constructor").newline
;
111 printf("struct gtkViewport is null on constructor");
118 assert(gtkViewport
!is null, "struct gtkViewport is null on constructor");
120 super(cast(GtkBin
*)gtkViewport
);
121 this.gtkViewport
= gtkViewport
;
127 // imports for the signal processing
128 private import gobject
.Signals
;
129 private import gtkc
.gdktypes
;
130 int[char[]] connectedSignals
;
132 void delegate(Adjustment
, Adjustment
, Viewport
)[] onSetScrollAdjustmentsListeners
;
133 void addOnSetScrollAdjustments(void delegate(Adjustment
, Adjustment
, Viewport
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
135 if ( !("set-scroll-adjustments" in connectedSignals
) )
139 "set-scroll-adjustments",
140 cast(GCallback
)&callBackSetScrollAdjustments
,
144 connectedSignals
["set-scroll-adjustments"] = 1;
146 onSetScrollAdjustmentsListeners
~= dlg
;
148 extern(C
) static void callBackSetScrollAdjustments(GtkViewport
* viewportStruct
, GtkAdjustment
* arg1
, GtkAdjustment
* arg2
, Viewport viewport
)
150 bool consumed
= false;
152 foreach ( void delegate(Adjustment
, Adjustment
, Viewport
) dlg
; viewport
.onSetScrollAdjustmentsListeners
)
154 dlg(new Adjustment(arg1
), new Adjustment(arg2
), viewport
);
163 * Creates a new GtkViewport with the given adjustments.
165 * horizontal adjustment.
167 * vertical adjustment.
171 public this (Adjustment hadjustment
, Adjustment vadjustment
)
173 // GtkWidget* gtk_viewport_new (GtkAdjustment *hadjustment, GtkAdjustment *vadjustment);
174 this(cast(GtkViewport
*)gtk_viewport_new((hadjustment
is null) ?
null : hadjustment
.getAdjustmentStruct(), (vadjustment
is null) ?
null : vadjustment
.getAdjustmentStruct()) );
178 * Returns the horizontal adjustment of the viewport.
182 * the horizontal adjustment of viewport.
184 public Adjustment
getHadjustment()
186 // GtkAdjustment* gtk_viewport_get_hadjustment (GtkViewport *viewport);
187 return new Adjustment( gtk_viewport_get_hadjustment(gtkViewport
) );
191 * Returns the vertical adjustment of the viewport.
195 * the vertical adjustment of viewport.
197 public Adjustment
getVadjustment()
199 // GtkAdjustment* gtk_viewport_get_vadjustment (GtkViewport *viewport);
200 return new Adjustment( gtk_viewport_get_vadjustment(gtkViewport
) );
204 * Sets the horizontal adjustment of the viewport.
210 public void setHadjustment(Adjustment adjustment
)
212 // void gtk_viewport_set_hadjustment (GtkViewport *viewport, GtkAdjustment *adjustment);
213 gtk_viewport_set_hadjustment(gtkViewport
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
217 * Sets the vertical adjustment of the viewport.
223 public void setVadjustment(Adjustment adjustment
)
225 // void gtk_viewport_set_vadjustment (GtkViewport *viewport, GtkAdjustment *adjustment);
226 gtk_viewport_set_vadjustment(gtkViewport
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
230 * Sets the shadow type of the viewport.
234 * the new shadow type.
236 public void setShadowType(GtkShadowType type
)
238 // void gtk_viewport_set_shadow_type (GtkViewport *viewport, GtkShadowType type);
239 gtk_viewport_set_shadow_type(gtkViewport
, type
);
243 * Gets the shadow type of the GtkViewport. See
244 * gtk_viewport_set_shadow_type().
250 * The "hadjustment" property
251 * "hadjustment" GtkAdjustment : Read / Write / Construct
252 * The GtkAdjustment that determines the values of the horizontal position for this viewport.
254 public GtkShadowType
getShadowType()
256 // GtkShadowType gtk_viewport_get_shadow_type (GtkViewport *viewport);
257 return gtk_viewport_get_shadow_type(gtkViewport
);