This file is indexed.

/usr/include/d/gtkd-3/gtk/Overlay.d is in libgtkd-3-dev 3.7.5-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/*
 * This file is part of gtkD.
 *
 * gtkD is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version, with
 * some exceptions, please read the COPYING file.
 *
 * gtkD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with gtkD; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */

// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage


module gtk.Overlay;

private import glib.ConstructionException;
private import gobject.ObjectG;
private import gobject.Signals;
private import gtk.Bin;
private import gtk.Widget;
private import gtk.c.functions;
public  import gtk.c.types;
public  import gtkc.gtktypes;
private import std.algorithm;


/**
 * GtkOverlay is a container which contains a single main child, on top
 * of which it can place “overlay” widgets. The position of each overlay
 * widget is determined by its #GtkWidget:halign and #GtkWidget:valign
 * properties. E.g. a widget with both alignments set to %GTK_ALIGN_START
 * will be placed at the top left corner of the GtkOverlay container,
 * whereas an overlay with halign set to %GTK_ALIGN_CENTER and valign set
 * to %GTK_ALIGN_END will be placed a the bottom edge of the GtkOverlay,
 * horizontally centered. The position can be adjusted by setting the margin
 * properties of the child to non-zero values.
 * 
 * More complicated placement of overlays is possible by connecting
 * to the #GtkOverlay::get-child-position signal.
 * 
 * # GtkOverlay as GtkBuildable
 * 
 * The GtkOverlay implementation of the GtkBuildable interface
 * supports placing a child as an overlay by specifying “overlay” as
 * the “type” attribute of a `<child>` element.
 * 
 * # CSS nodes
 * 
 * GtkOverlay has a single CSS node with the name “overlay”. Overlay children
 * whose alignments cause them to be positioned at an edge get the style classes
 * “.left”, “.right”, “.top”, and/or “.bottom” according to their position.
 */
public class Overlay : Bin
{
	/** the main Gtk struct */
	protected GtkOverlay* gtkOverlay;

	/** Get the main Gtk struct */
	public GtkOverlay* getOverlayStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return gtkOverlay;
	}

	/** the main Gtk struct as a void* */
	protected override void* getStruct()
	{
		return cast(void*)gtkOverlay;
	}

	protected override void setStruct(GObject* obj)
	{
		gtkOverlay = cast(GtkOverlay*)obj;
		super.setStruct(obj);
	}

	/**
	 * Sets our main struct and passes it to the parent class.
	 */
	public this (GtkOverlay* gtkOverlay, bool ownedRef = false)
	{
		this.gtkOverlay = gtkOverlay;
		super(cast(GtkBin*)gtkOverlay, ownedRef);
	}


	/** */
	public static GType getType()
	{
		return gtk_overlay_get_type();
	}

	/**
	 * Creates a new #GtkOverlay.
	 *
	 * Returns: a new #GtkOverlay object.
	 *
	 * Since: 3.2
	 *
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this()
	{
		auto p = gtk_overlay_new();

		if(p is null)
		{
			throw new ConstructionException("null returned by new");
		}

		this(cast(GtkOverlay*) p);
	}

	/**
	 * Adds @widget to @overlay.
	 *
	 * The widget will be stacked on top of the main widget
	 * added with gtk_container_add().
	 *
	 * The position at which @widget is placed is determined
	 * from its #GtkWidget:halign and #GtkWidget:valign properties.
	 *
	 * Params:
	 *     widget = a #GtkWidget to be added to the container
	 *
	 * Since: 3.2
	 */
	public void addOverlay(Widget widget)
	{
		gtk_overlay_add_overlay(gtkOverlay, (widget is null) ? null : widget.getWidgetStruct());
	}

	/**
	 * Convenience function to get the value of the #GtkOverlay:pass-through
	 * child property for @widget.
	 *
	 * Params:
	 *     widget = an overlay child of #GtkOverlay
	 *
	 * Returns: whether the widget is a pass through child.
	 *
	 * Since: 3.18
	 */
	public bool getOverlayPassThrough(Widget widget)
	{
		return gtk_overlay_get_overlay_pass_through(gtkOverlay, (widget is null) ? null : widget.getWidgetStruct()) != 0;
	}

	/**
	 * Moves @child to a new @index in the list of @overlay children.
	 * The list contains overlays in the order that these were
	 * added to @overlay.
	 *
	 * A widget’s index in the @overlay children list determines which order
	 * the children are drawn if they overlap. The first child is drawn at
	 * the bottom. It also affects the default focus chain order.
	 *
	 * Params:
	 *     child = the overlaid #GtkWidget to move
	 *     position = the new index for @child in the list of overlay children
	 *         of @overlay, starting from 0. If negative, indicates the end of
	 *         the list
	 *
	 * Since: 3.18
	 */
	public void reorderOverlay(Widget child, int position)
	{
		gtk_overlay_reorder_overlay(gtkOverlay, (child is null) ? null : child.getWidgetStruct(), position);
	}

	/**
	 * Convenience function to set the value of the #GtkOverlay:pass-through
	 * child property for @widget.
	 *
	 * Params:
	 *     widget = an overlay child of #GtkOverlay
	 *     passThrough = whether the child should pass the input through
	 *
	 * Since: 3.18
	 */
	public void setOverlayPassThrough(Widget widget, bool passThrough)
	{
		gtk_overlay_set_overlay_pass_through(gtkOverlay, (widget is null) ? null : widget.getWidgetStruct(), passThrough);
	}

	protected class OnGetChildPositionDelegateWrapper
	{
		bool delegate(Widget, GdkRectangle*, Overlay) dlg;
		gulong handlerId;

		this(bool delegate(Widget, GdkRectangle*, Overlay) dlg)
		{
			this.dlg = dlg;
			onGetChildPositionListeners ~= this;
		}

		void remove(OnGetChildPositionDelegateWrapper source)
		{
			foreach(index, wrapper; onGetChildPositionListeners)
			{
				if (wrapper.handlerId == source.handlerId)
				{
					onGetChildPositionListeners[index] = null;
					onGetChildPositionListeners = std.algorithm.remove(onGetChildPositionListeners, index);
					break;
				}
			}
		}
	}
	OnGetChildPositionDelegateWrapper[] onGetChildPositionListeners;

	/**
	 * The ::get-child-position signal is emitted to determine
	 * the position and size of any overlay child widgets. A
	 * handler for this signal should fill @allocation with
	 * the desired position and size for @widget, relative to
	 * the 'main' child of @overlay.
	 *
	 * The default handler for this signal uses the @widget's
	 * halign and valign properties to determine the position
	 * and gives the widget its natural size (except that an
	 * alignment of %GTK_ALIGN_FILL will cause the overlay to
	 * be full-width/height). If the main child is a
	 * #GtkScrolledWindow, the overlays are placed relative
	 * to its contents.
	 *
	 * Params:
	 *     widget = the child widget to position
	 *     allocation = return
	 *         location for the allocation
	 *
	 * Returns: %TRUE if the @allocation has been filled
	 */
	gulong addOnGetChildPosition(bool delegate(Widget, GdkRectangle*, Overlay) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
	{
		auto wrapper = new OnGetChildPositionDelegateWrapper(dlg);
		wrapper.handlerId = Signals.connectData(
			this,
			"get-child-position",
			cast(GCallback)&callBackGetChildPosition,
			cast(void*)wrapper,
			cast(GClosureNotify)&callBackGetChildPositionDestroy,
			connectFlags);
		return wrapper.handlerId;
	}

	extern(C) static int callBackGetChildPosition(GtkOverlay* overlayStruct, GtkWidget* widget, GdkRectangle* allocation, OnGetChildPositionDelegateWrapper wrapper)
	{
		return wrapper.dlg(ObjectG.getDObject!(Widget)(widget), allocation, wrapper.outer);
	}

	extern(C) static void callBackGetChildPositionDestroy(OnGetChildPositionDelegateWrapper wrapper, GClosure* closure)
	{
		wrapper.remove(wrapper);
	}
}