1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.ScrolledWindow;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gobject.Signals;
30 private import gtk.Adjustment;
31 private import gtk.Bin;
32 private import gtk.Widget;
33 public  import gtkc.gdktypes;
34 private import gtkc.gtk;
35 public  import gtkc.gtktypes;
36 
37 
38 /**
39  * GtkScrolledWindow is a #GtkBin subclass: it’s a container
40  * the accepts a single child widget. GtkScrolledWindow adds scrollbars
41  * to the child widget and optionally draws a beveled frame around the
42  * child widget.
43  * 
44  * The scrolled window can work in two ways. Some widgets have native
45  * scrolling support; these widgets implement the #GtkScrollable interface.
46  * Widgets with native scroll support include #GtkTreeView, #GtkTextView,
47  * and #GtkLayout.
48  * 
49  * For widgets that lack native scrolling support, the #GtkViewport
50  * widget acts as an adaptor class, implementing scrollability for child
51  * widgets that lack their own scrolling capabilities. Use #GtkViewport
52  * to scroll child widgets such as #GtkGrid, #GtkBox, and so on.
53  * 
54  * If a widget has native scrolling abilities, it can be added to the
55  * GtkScrolledWindow with gtk_container_add(). If a widget does not, you
56  * must first add the widget to a #GtkViewport, then add the #GtkViewport
57  * to the scrolled window. gtk_container_add() will do this for you for
58  * widgets that don’t implement #GtkScrollable natively, so you can
59  * ignore the presence of the viewport.
60  * 
61  * The position of the scrollbars is controlled by the scroll adjustments.
62  * See #GtkAdjustment for the fields in an adjustment — for
63  * #GtkScrollbar, used by GtkScrolledWindow, the “value” field
64  * represents the position of the scrollbar, which must be between the
65  * “lower” field and “upper - page_size.” The “page_size” field
66  * represents the size of the visible scrollable area. The
67  * “step_increment” and “page_increment” fields are used when the user
68  * asks to step down (using the small stepper arrows) or page down (using
69  * for example the PageDown key).
70  * 
71  * If a GtkScrolledWindow doesn’t behave quite as you would like, or
72  * doesn’t have exactly the right layout, it’s very possible to set up
73  * your own scrolling with #GtkScrollbar and for example a #GtkGrid.
74  * 
75  * # Touch support
76  * 
77  * GtkScrolledWindow has built-in support for touch devices. When a
78  * touchscreen is used, swiping will move the scrolled window, and will
79  * expose 'kinetic' behavior. This can be turned off with the
80  * #GtkScrolledWindow:kinetic-scrolling property if it is undesired.
81  * 
82  * GtkScrolledWindow also displays visual 'overshoot' indication when
83  * the content is pulled beyond the end, and this situation can be
84  * captured with the #GtkScrolledWindow::edge-overshot signal.
85  * 
86  * If no mouse device is present, the scrollbars will overlayed as
87  * narrow, auto-hiding indicators over the content. If traditional
88  * scrollbars are desired although no mouse is present, this behaviour
89  * can be turned off with the #GtkScrolledWindow:overlay-scrolling
90  * property.
91  */
92 public class ScrolledWindow : Bin
93 {
94 	/** the main Gtk struct */
95 	protected GtkScrolledWindow* gtkScrolledWindow;
96 
97 	/** Get the main Gtk struct */
98 	public GtkScrolledWindow* getScrolledWindowStruct()
99 	{
100 		return gtkScrolledWindow;
101 	}
102 
103 	/** the main Gtk struct as a void* */
104 	protected override void* getStruct()
105 	{
106 		return cast(void*)gtkScrolledWindow;
107 	}
108 
109 	protected override void setStruct(GObject* obj)
110 	{
111 		gtkScrolledWindow = cast(GtkScrolledWindow*)obj;
112 		super.setStruct(obj);
113 	}
114 
115 	/**
116 	 * Sets our main struct and passes it to the parent class.
117 	 */
118 	public this (GtkScrolledWindow* gtkScrolledWindow, bool ownedRef = false)
119 	{
120 		this.gtkScrolledWindow = gtkScrolledWindow;
121 		super(cast(GtkBin*)gtkScrolledWindow, ownedRef);
122 	}
123 
124 	/** */
125 	public this()
126 	{
127 		this(null, null);
128 	}
129 	
130 	/** */
131 	public this(Widget widget)
132 	{
133 		this();
134 		add(widget);
135 	}
136 	
137 	/**
138 	 * Creates a new Scrolled window and set the policy type
139 	 * Params:
140 	 *  hPolicy = the horizontal policy
141 	 *  vPolicy = the vertical policy
142 	 */
143 	this(PolicyType hPolicy, PolicyType vPolicy)
144 	{
145 		this();
146 		setPolicy(hPolicy, vPolicy);
147 	}
148 
149 	/**
150 	 */
151 
152 	/** */
153 	public static GType getType()
154 	{
155 		return gtk_scrolled_window_get_type();
156 	}
157 
158 	/**
159 	 * Creates a new scrolled window.
160 	 *
161 	 * The two arguments are the scrolled window’s adjustments; these will be
162 	 * shared with the scrollbars and the child widget to keep the bars in sync
163 	 * with the child. Usually you want to pass %NULL for the adjustments, which
164 	 * will cause the scrolled window to create them for you.
165 	 *
166 	 * Params:
167 	 *     hadjustment = horizontal adjustment
168 	 *     vadjustment = vertical adjustment
169 	 *
170 	 * Return: a new scrolled window
171 	 *
172 	 * Throws: ConstructionException GTK+ fails to create the object.
173 	 */
174 	public this(Adjustment hadjustment, Adjustment vadjustment)
175 	{
176 		auto p = gtk_scrolled_window_new((hadjustment is null) ? null : hadjustment.getAdjustmentStruct(), (vadjustment is null) ? null : vadjustment.getAdjustmentStruct());
177 		
178 		if(p is null)
179 		{
180 			throw new ConstructionException("null returned by new");
181 		}
182 		
183 		this(cast(GtkScrolledWindow*) p);
184 	}
185 
186 	/**
187 	 * Used to add children without native scrolling capabilities. This
188 	 * is simply a convenience function; it is equivalent to adding the
189 	 * unscrollable child to a viewport, then adding the viewport to the
190 	 * scrolled window. If a child has native scrolling, use
191 	 * gtk_container_add() instead of this function.
192 	 *
193 	 * The viewport scrolls the child by moving its #GdkWindow, and takes
194 	 * the size of the child to be the size of its toplevel #GdkWindow.
195 	 * This will be very wrong for most widgets that support native scrolling;
196 	 * for example, if you add a widget such as #GtkTreeView with a viewport,
197 	 * the whole widget will scroll, including the column headings. Thus,
198 	 * widgets with native scrolling support should not be used with the
199 	 * #GtkViewport proxy.
200 	 *
201 	 * A widget supports scrolling natively if it implements the
202 	 * #GtkScrollable interface.
203 	 *
204 	 * Deprecated: gtk_container_add() will automatically add
205 	 * a #GtkViewport if the child doesn’t implement #GtkScrollable.
206 	 *
207 	 * Params:
208 	 *     child = the widget you want to scroll
209 	 */
210 	public void addWithViewport(Widget child)
211 	{
212 		gtk_scrolled_window_add_with_viewport(gtkScrolledWindow, (child is null) ? null : child.getWidgetStruct());
213 	}
214 
215 	/**
216 	 * Return whether button presses are captured during kinetic
217 	 * scrolling. See gtk_scrolled_window_set_capture_button_press().
218 	 *
219 	 * Return: %TRUE if button presses are captured during kinetic scrolling
220 	 *
221 	 * Since: 3.4
222 	 */
223 	public bool getCaptureButtonPress()
224 	{
225 		return gtk_scrolled_window_get_capture_button_press(gtkScrolledWindow) != 0;
226 	}
227 
228 	/**
229 	 * Returns the horizontal scrollbar’s adjustment, used to connect the
230 	 * horizontal scrollbar to the child widget’s horizontal scroll
231 	 * functionality.
232 	 *
233 	 * Return: the horizontal #GtkAdjustment
234 	 */
235 	public Adjustment getHadjustment()
236 	{
237 		auto p = gtk_scrolled_window_get_hadjustment(gtkScrolledWindow);
238 		
239 		if(p is null)
240 		{
241 			return null;
242 		}
243 		
244 		return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p);
245 	}
246 
247 	/**
248 	 * Returns the horizontal scrollbar of @scrolled_window.
249 	 *
250 	 * Return: the horizontal scrollbar of the scrolled window.
251 	 *
252 	 * Since: 2.8
253 	 */
254 	public Widget getHscrollbar()
255 	{
256 		auto p = gtk_scrolled_window_get_hscrollbar(gtkScrolledWindow);
257 		
258 		if(p is null)
259 		{
260 			return null;
261 		}
262 		
263 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
264 	}
265 
266 	/**
267 	 * Returns the specified kinetic scrolling behavior.
268 	 *
269 	 * Return: the scrolling behavior flags.
270 	 *
271 	 * Since: 3.4
272 	 */
273 	public bool getKineticScrolling()
274 	{
275 		return gtk_scrolled_window_get_kinetic_scrolling(gtkScrolledWindow) != 0;
276 	}
277 
278 	/**
279 	 * Gets the minimal content height of @scrolled_window, or -1 if not set.
280 	 *
281 	 * Return: the minimal content height
282 	 *
283 	 * Since: 3.0
284 	 */
285 	public int getMinContentHeight()
286 	{
287 		return gtk_scrolled_window_get_min_content_height(gtkScrolledWindow);
288 	}
289 
290 	/**
291 	 * Gets the minimum content width of @scrolled_window, or -1 if not set.
292 	 *
293 	 * Return: the minimum content width
294 	 *
295 	 * Since: 3.0
296 	 */
297 	public int getMinContentWidth()
298 	{
299 		return gtk_scrolled_window_get_min_content_width(gtkScrolledWindow);
300 	}
301 
302 	/**
303 	 * Returns whether overlay scrolling is enabled for this scrolled window.
304 	 *
305 	 * Return: %TRUE if overlay scrolling is enabled
306 	 *
307 	 * Since: 3.16
308 	 */
309 	public bool getOverlayScrolling()
310 	{
311 		return gtk_scrolled_window_get_overlay_scrolling(gtkScrolledWindow) != 0;
312 	}
313 
314 	/**
315 	 * Gets the placement of the contents with respect to the scrollbars
316 	 * for the scrolled window. See gtk_scrolled_window_set_placement().
317 	 *
318 	 * Return: the current placement value.
319 	 *
320 	 *     See also gtk_scrolled_window_set_placement() and
321 	 *     gtk_scrolled_window_unset_placement().
322 	 */
323 	public GtkCornerType getPlacement()
324 	{
325 		return gtk_scrolled_window_get_placement(gtkScrolledWindow);
326 	}
327 
328 	/**
329 	 * Retrieves the current policy values for the horizontal and vertical
330 	 * scrollbars. See gtk_scrolled_window_set_policy().
331 	 *
332 	 * Params:
333 	 *     hscrollbarPolicy = location to store the policy
334 	 *         for the horizontal scrollbar, or %NULL
335 	 *     vscrollbarPolicy = location to store the policy
336 	 *         for the vertical scrollbar, or %NULL
337 	 */
338 	public void getPolicy(out GtkPolicyType hscrollbarPolicy, out GtkPolicyType vscrollbarPolicy)
339 	{
340 		gtk_scrolled_window_get_policy(gtkScrolledWindow, &hscrollbarPolicy, &vscrollbarPolicy);
341 	}
342 
343 	/**
344 	 * Gets the shadow type of the scrolled window. See
345 	 * gtk_scrolled_window_set_shadow_type().
346 	 *
347 	 * Return: the current shadow type
348 	 */
349 	public GtkShadowType getShadowType()
350 	{
351 		return gtk_scrolled_window_get_shadow_type(gtkScrolledWindow);
352 	}
353 
354 	/**
355 	 * Returns the vertical scrollbar’s adjustment, used to connect the
356 	 * vertical scrollbar to the child widget’s vertical scroll functionality.
357 	 *
358 	 * Return: the vertical #GtkAdjustment
359 	 */
360 	public Adjustment getVadjustment()
361 	{
362 		auto p = gtk_scrolled_window_get_vadjustment(gtkScrolledWindow);
363 		
364 		if(p is null)
365 		{
366 			return null;
367 		}
368 		
369 		return ObjectG.getDObject!(Adjustment)(cast(GtkAdjustment*) p);
370 	}
371 
372 	/**
373 	 * Returns the vertical scrollbar of @scrolled_window.
374 	 *
375 	 * Return: the vertical scrollbar of the scrolled window.
376 	 *
377 	 * Since: 2.8
378 	 */
379 	public Widget getVscrollbar()
380 	{
381 		auto p = gtk_scrolled_window_get_vscrollbar(gtkScrolledWindow);
382 		
383 		if(p is null)
384 		{
385 			return null;
386 		}
387 		
388 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
389 	}
390 
391 	/**
392 	 * Changes the behaviour of @scrolled_window wrt. to the initial
393 	 * event that possibly starts kinetic scrolling. When @capture_button_press
394 	 * is set to %TRUE, the event is captured by the scrolled window, and
395 	 * then later replayed if it is meant to go to the child widget.
396 	 *
397 	 * This should be enabled if any child widgets perform non-reversible
398 	 * actions on #GtkWidget::button-press-event. If they don't, and handle
399 	 * additionally handle #GtkWidget::grab-broken-event, it might be better
400 	 * to set @capture_button_press to %FALSE.
401 	 *
402 	 * This setting only has an effect if kinetic scrolling is enabled.
403 	 *
404 	 * Params:
405 	 *     captureButtonPress = %TRUE to capture button presses
406 	 *
407 	 * Since: 3.4
408 	 */
409 	public void setCaptureButtonPress(bool captureButtonPress)
410 	{
411 		gtk_scrolled_window_set_capture_button_press(gtkScrolledWindow, captureButtonPress);
412 	}
413 
414 	/**
415 	 * Sets the #GtkAdjustment for the horizontal scrollbar.
416 	 *
417 	 * Params:
418 	 *     hadjustment = horizontal scroll adjustment
419 	 */
420 	public void setHadjustment(Adjustment hadjustment)
421 	{
422 		gtk_scrolled_window_set_hadjustment(gtkScrolledWindow, (hadjustment is null) ? null : hadjustment.getAdjustmentStruct());
423 	}
424 
425 	/**
426 	 * Turns kinetic scrolling on or off.
427 	 * Kinetic scrolling only applies to devices with source
428 	 * %GDK_SOURCE_TOUCHSCREEN.
429 	 *
430 	 * Params:
431 	 *     kineticScrolling = %TRUE to enable kinetic scrolling
432 	 *
433 	 * Since: 3.4
434 	 */
435 	public void setKineticScrolling(bool kineticScrolling)
436 	{
437 		gtk_scrolled_window_set_kinetic_scrolling(gtkScrolledWindow, kineticScrolling);
438 	}
439 
440 	/**
441 	 * Sets the minimum height that @scrolled_window should keep visible.
442 	 * Note that this can and (usually will) be smaller than the minimum
443 	 * size of the content.
444 	 *
445 	 * Params:
446 	 *     height = the minimal content height
447 	 *
448 	 * Since: 3.0
449 	 */
450 	public void setMinContentHeight(int height)
451 	{
452 		gtk_scrolled_window_set_min_content_height(gtkScrolledWindow, height);
453 	}
454 
455 	/**
456 	 * Sets the minimum width that @scrolled_window should keep visible.
457 	 * Note that this can and (usually will) be smaller than the minimum
458 	 * size of the content.
459 	 *
460 	 * Params:
461 	 *     width = the minimal content width
462 	 *
463 	 * Since: 3.0
464 	 */
465 	public void setMinContentWidth(int width)
466 	{
467 		gtk_scrolled_window_set_min_content_width(gtkScrolledWindow, width);
468 	}
469 
470 	/**
471 	 * Enables or disables overlay scrolling for this scrolled window.
472 	 *
473 	 * Params:
474 	 *     overlayScrolling = whether to enable overlay scrolling
475 	 *
476 	 * Since: 3.16
477 	 */
478 	public void setOverlayScrolling(bool overlayScrolling)
479 	{
480 		gtk_scrolled_window_set_overlay_scrolling(gtkScrolledWindow, overlayScrolling);
481 	}
482 
483 	/**
484 	 * Sets the placement of the contents with respect to the scrollbars
485 	 * for the scrolled window.
486 	 *
487 	 * The default is %GTK_CORNER_TOP_LEFT, meaning the child is
488 	 * in the top left, with the scrollbars underneath and to the right.
489 	 * Other values in #GtkCornerType are %GTK_CORNER_TOP_RIGHT,
490 	 * %GTK_CORNER_BOTTOM_LEFT, and %GTK_CORNER_BOTTOM_RIGHT.
491 	 *
492 	 * See also gtk_scrolled_window_get_placement() and
493 	 * gtk_scrolled_window_unset_placement().
494 	 *
495 	 * Params:
496 	 *     windowPlacement = position of the child window
497 	 */
498 	public void setPlacement(GtkCornerType windowPlacement)
499 	{
500 		gtk_scrolled_window_set_placement(gtkScrolledWindow, windowPlacement);
501 	}
502 
503 	/**
504 	 * Sets the scrollbar policy for the horizontal and vertical scrollbars.
505 	 *
506 	 * The policy determines when the scrollbar should appear; it is a value
507 	 * from the #GtkPolicyType enumeration. If %GTK_POLICY_ALWAYS, the
508 	 * scrollbar is always present; if %GTK_POLICY_NEVER, the scrollbar is
509 	 * never present; if %GTK_POLICY_AUTOMATIC, the scrollbar is present only
510 	 * if needed (that is, if the slider part of the bar would be smaller
511 	 * than the trough — the display is larger than the page size).
512 	 *
513 	 * Params:
514 	 *     hscrollbarPolicy = policy for horizontal bar
515 	 *     vscrollbarPolicy = policy for vertical bar
516 	 */
517 	public void setPolicy(GtkPolicyType hscrollbarPolicy, GtkPolicyType vscrollbarPolicy)
518 	{
519 		gtk_scrolled_window_set_policy(gtkScrolledWindow, hscrollbarPolicy, vscrollbarPolicy);
520 	}
521 
522 	/**
523 	 * Changes the type of shadow drawn around the contents of
524 	 * @scrolled_window.
525 	 *
526 	 * Params:
527 	 *     type = kind of shadow to draw around scrolled window contents
528 	 */
529 	public void setShadowType(GtkShadowType type)
530 	{
531 		gtk_scrolled_window_set_shadow_type(gtkScrolledWindow, type);
532 	}
533 
534 	/**
535 	 * Sets the #GtkAdjustment for the vertical scrollbar.
536 	 *
537 	 * Params:
538 	 *     vadjustment = vertical scroll adjustment
539 	 */
540 	public void setVadjustment(Adjustment vadjustment)
541 	{
542 		gtk_scrolled_window_set_vadjustment(gtkScrolledWindow, (vadjustment is null) ? null : vadjustment.getAdjustmentStruct());
543 	}
544 
545 	/**
546 	 * Unsets the placement of the contents with respect to the scrollbars
547 	 * for the scrolled window. If no window placement is set for a scrolled
548 	 * window, it defaults to %GTK_CORNER_TOP_LEFT.
549 	 *
550 	 * See also gtk_scrolled_window_set_placement() and
551 	 * gtk_scrolled_window_get_placement().
552 	 *
553 	 * Since: 2.10
554 	 */
555 	public void unsetPlacement()
556 	{
557 		gtk_scrolled_window_unset_placement(gtkScrolledWindow);
558 	}
559 
560 	int[string] connectedSignals;
561 
562 	void delegate(GtkPositionType, ScrolledWindow)[] onEdgeOvershotListeners;
563 	/**
564 	 * The ::edge-overshot signal is emitted whenever user initiated scrolling
565 	 * makes the scrolledwindow firmly surpass (ie. with some edge resistance)
566 	 * the lower or upper limits defined by the adjustment in that orientation.
567 	 *
568 	 * A similar behavior without edge resistance is provided by the
569 	 * #GtkScrolledWindow::edge-reached signal.
570 	 *
571 	 * Note: The @pos argument is LTR/RTL aware, so callers should be aware too
572 	 * if intending to provide behavior on horizontal edges.
573 	 *
574 	 * Params:
575 	 *     pos = edge side that was hit
576 	 *
577 	 * Since: 3.16
578 	 */
579 	void addOnEdgeOvershot(void delegate(GtkPositionType, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
580 	{
581 		if ( "edge-overshot" !in connectedSignals )
582 		{
583 			Signals.connectData(
584 				this,
585 				"edge-overshot",
586 				cast(GCallback)&callBackEdgeOvershot,
587 				cast(void*)this,
588 				null,
589 				connectFlags);
590 			connectedSignals["edge-overshot"] = 1;
591 		}
592 		onEdgeOvershotListeners ~= dlg;
593 	}
594 	extern(C) static void callBackEdgeOvershot(GtkScrolledWindow* scrolledwindowStruct, GtkPositionType pos, ScrolledWindow _scrolledwindow)
595 	{
596 		foreach ( void delegate(GtkPositionType, ScrolledWindow) dlg; _scrolledwindow.onEdgeOvershotListeners )
597 		{
598 			dlg(pos, _scrolledwindow);
599 		}
600 	}
601 
602 	void delegate(GtkPositionType, ScrolledWindow)[] onEdgeReachedListeners;
603 	/**
604 	 * The ::edge-reached signal is emitted whenever user-initiated scrolling
605 	 * makes the scrolledwindow exactly reaches the lower or upper limits
606 	 * defined by the adjustment in that orientation.
607 	 *
608 	 * A similar behavior with edge resistance is provided by the
609 	 * #GtkScrolledWindow::edge-overshot signal.
610 	 *
611 	 * Note: The @pos argument is LTR/RTL aware, so callers should be aware too
612 	 * if intending to provide behavior on horizontal edges.
613 	 *
614 	 * Params:
615 	 *     pos = edge side that was reached
616 	 *
617 	 * Since: 3.16
618 	 */
619 	void addOnEdgeReached(void delegate(GtkPositionType, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
620 	{
621 		if ( "edge-reached" !in connectedSignals )
622 		{
623 			Signals.connectData(
624 				this,
625 				"edge-reached",
626 				cast(GCallback)&callBackEdgeReached,
627 				cast(void*)this,
628 				null,
629 				connectFlags);
630 			connectedSignals["edge-reached"] = 1;
631 		}
632 		onEdgeReachedListeners ~= dlg;
633 	}
634 	extern(C) static void callBackEdgeReached(GtkScrolledWindow* scrolledwindowStruct, GtkPositionType pos, ScrolledWindow _scrolledwindow)
635 	{
636 		foreach ( void delegate(GtkPositionType, ScrolledWindow) dlg; _scrolledwindow.onEdgeReachedListeners )
637 		{
638 			dlg(pos, _scrolledwindow);
639 		}
640 	}
641 
642 	void delegate(GtkDirectionType, ScrolledWindow)[] onMoveFocusOutListeners;
643 	/**
644 	 * The ::move-focus-out signal is a
645 	 * [keybinding signal][GtkBindingSignal] which gets
646 	 * emitted when focus is moved away from the scrolled window by a
647 	 * keybinding. The #GtkWidget::move-focus signal is emitted with
648 	 * @direction_type on this scrolled windows toplevel parent in the
649 	 * container hierarchy. The default bindings for this signal are
650 	 * `Tab + Ctrl` and `Tab + Ctrl + Shift`.
651 	 *
652 	 * Params:
653 	 *     directionType = either %GTK_DIR_TAB_FORWARD or
654 	 *         %GTK_DIR_TAB_BACKWARD
655 	 */
656 	void addOnMoveFocusOut(void delegate(GtkDirectionType, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
657 	{
658 		if ( "move-focus-out" !in connectedSignals )
659 		{
660 			Signals.connectData(
661 				this,
662 				"move-focus-out",
663 				cast(GCallback)&callBackMoveFocusOut,
664 				cast(void*)this,
665 				null,
666 				connectFlags);
667 			connectedSignals["move-focus-out"] = 1;
668 		}
669 		onMoveFocusOutListeners ~= dlg;
670 	}
671 	extern(C) static void callBackMoveFocusOut(GtkScrolledWindow* scrolledwindowStruct, GtkDirectionType directionType, ScrolledWindow _scrolledwindow)
672 	{
673 		foreach ( void delegate(GtkDirectionType, ScrolledWindow) dlg; _scrolledwindow.onMoveFocusOutListeners )
674 		{
675 			dlg(directionType, _scrolledwindow);
676 		}
677 	}
678 
679 	bool delegate(GtkScrollType, bool, ScrolledWindow)[] onScrollChildListeners;
680 	/**
681 	 * The ::scroll-child signal is a
682 	 * [keybinding signal][GtkBindingSignal]
683 	 * which gets emitted when a keybinding that scrolls is pressed.
684 	 * The horizontal or vertical adjustment is updated which triggers a
685 	 * signal that the scrolled windows child may listen to and scroll itself.
686 	 *
687 	 * Params:
688 	 *     scroll = a #GtkScrollType describing how much to scroll
689 	 *     horizontal = whether the keybinding scrolls the child
690 	 *         horizontally or not
691 	 */
692 	void addOnScrollChild(bool delegate(GtkScrollType, bool, ScrolledWindow) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
693 	{
694 		if ( "scroll-child" !in connectedSignals )
695 		{
696 			Signals.connectData(
697 				this,
698 				"scroll-child",
699 				cast(GCallback)&callBackScrollChild,
700 				cast(void*)this,
701 				null,
702 				connectFlags);
703 			connectedSignals["scroll-child"] = 1;
704 		}
705 		onScrollChildListeners ~= dlg;
706 	}
707 	extern(C) static int callBackScrollChild(GtkScrolledWindow* scrolledwindowStruct, GtkScrollType scroll, bool horizontal, ScrolledWindow _scrolledwindow)
708 	{
709 		foreach ( bool delegate(GtkScrollType, bool, ScrolledWindow) dlg; _scrolledwindow.onScrollChildListeners )
710 		{
711 			if ( dlg(scroll, horizontal, _scrolledwindow) )
712 			{
713 				return 1;
714 			}
715 		}
716 		
717 		return 0;
718 	}
719 }