This file is indexed.

/usr/include/d/gtkd-3/gtk/TreePath.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
/*
 * 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.TreePath;

private import glib.ConstructionException;
private import glib.Str;
private import gobject.ObjectG;
private import gtk.c.functions;
public  import gtk.c.types;
public  import gtkc.gtktypes;
private import gtkd.Loader;


/** */
public class TreePath
{
	/** the main Gtk struct */
	protected GtkTreePath* gtkTreePath;
	protected bool ownedRef;

	/** Get the main Gtk struct */
	public GtkTreePath* getTreePathStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return gtkTreePath;
	}

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

	/**
	 * Sets our main struct and passes it to the parent class.
	 */
	public this (GtkTreePath* gtkTreePath, bool ownedRef = false)
	{
		this.gtkTreePath = gtkTreePath;
		this.ownedRef = ownedRef;
	}

	~this ()
	{
		if ( Linker.isLoaded(LIBRARY_GTK) && ownedRef )
			gtk_tree_path_free(gtkTreePath);
	}

	/**
	 * Creates a new GtkTreePath. This structure refers to a row.
	 * Params:
	 * firstRow = if true this is the string representation of this path is "0"
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this (bool firstRow=false)
	{
		GtkTreePath* p;

		if ( firstRow )
		{
			// GtkTreePath* gtk_tree_path_new_first (void);
			p = cast(GtkTreePath*)gtk_tree_path_new_first();
		}
		else
		{
			// GtkTreePath* gtk_tree_path_new (void);
			p = cast(GtkTreePath*)gtk_tree_path_new();
		}

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

		this(p);
	}

	/**
	 * Creates a new path with "indices" as indices.
	 */
	this (int[] indices ... )
	{
		this(false);

		foreach( index; indices )
		appendIndex(index);
	}

	/**
	 */

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

	/**
	 * Creates a new #GtkTreePath-struct initialized to @path.
	 *
	 * @path is expected to be a colon separated list of numbers.
	 * For example, the string “10:4:0” would create a path of depth
	 * 3 pointing to the 11th child of the root node, the 5th
	 * child of that 11th child, and the 1st child of that 5th child.
	 * If an invalid path string is passed in, %NULL is returned.
	 *
	 * Params:
	 *     path = The string representation of a path
	 *
	 * Returns: A newly-created #GtkTreePath-struct, or %NULL
	 *
	 * Throws: ConstructionException GTK+ fails to create the object.
	 */
	public this(string path)
	{
		auto p = gtk_tree_path_new_from_string(Str.toStringz(path));

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

		this(cast(GtkTreePath*) p);
	}

	/**
	 * Appends a new index to a path.
	 *
	 * As a result, the depth of the path is increased.
	 *
	 * Params:
	 *     index = the index
	 */
	public void appendIndex(int index)
	{
		gtk_tree_path_append_index(gtkTreePath, index);
	}

	/**
	 * Compares two paths.
	 *
	 * If @a appears before @b in a tree, then -1 is returned.
	 * If @b appears before @a, then 1 is returned.
	 * If the two nodes are equal, then 0 is returned.
	 *
	 * Params:
	 *     b = a #GtkTreePath-struct to compare with
	 *
	 * Returns: the relative positions of @a and @b
	 */
	public int compare(TreePath b)
	{
		return gtk_tree_path_compare(gtkTreePath, (b is null) ? null : b.getTreePathStruct());
	}

	/**
	 * Creates a new #GtkTreePath-struct as a copy of @path.
	 *
	 * Returns: a new #GtkTreePath-struct
	 */
	public TreePath copy()
	{
		auto p = gtk_tree_path_copy(gtkTreePath);

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(TreePath)(cast(GtkTreePath*) p, true);
	}

	/**
	 * Moves @path to point to the first child of the current path.
	 */
	public void down()
	{
		gtk_tree_path_down(gtkTreePath);
	}

	/**
	 * Frees @path. If @path is %NULL, it simply returns.
	 */
	public void free()
	{
		gtk_tree_path_free(gtkTreePath);
		ownedRef = false;
	}

	/**
	 * Returns the current depth of @path.
	 *
	 * Returns: The depth of @path
	 */
	public int getDepth()
	{
		return gtk_tree_path_get_depth(gtkTreePath);
	}

	/**
	 * Returns the current indices of @path.
	 *
	 * This is an array of integers, each representing a node in a tree.
	 * It also returns the number of elements in the array.
	 * The array should not be freed.
	 *
	 * Returns: The current
	 *     indices, or %NULL
	 *
	 * Since: 3.0
	 */
	public int[] getIndices()
	{
		int depth;

		auto p = gtk_tree_path_get_indices_with_depth(gtkTreePath, &depth);

		return p[0 .. depth];
	}

	/**
	 * Returns %TRUE if @descendant is a descendant of @path.
	 *
	 * Params:
	 *     descendant = another #GtkTreePath-struct
	 *
	 * Returns: %TRUE if @descendant is contained inside @path
	 */
	public bool isAncestor(TreePath descendant)
	{
		return gtk_tree_path_is_ancestor(gtkTreePath, (descendant is null) ? null : descendant.getTreePathStruct()) != 0;
	}

	/**
	 * Returns %TRUE if @path is a descendant of @ancestor.
	 *
	 * Params:
	 *     ancestor = another #GtkTreePath-struct
	 *
	 * Returns: %TRUE if @ancestor contains @path somewhere below it
	 */
	public bool isDescendant(TreePath ancestor)
	{
		return gtk_tree_path_is_descendant(gtkTreePath, (ancestor is null) ? null : ancestor.getTreePathStruct()) != 0;
	}

	/**
	 * Moves the @path to point to the next node at the current depth.
	 */
	public void next()
	{
		gtk_tree_path_next(gtkTreePath);
	}

	/**
	 * Prepends a new index to a path.
	 *
	 * As a result, the depth of the path is increased.
	 *
	 * Params:
	 *     index = the index
	 */
	public void prependIndex(int index)
	{
		gtk_tree_path_prepend_index(gtkTreePath, index);
	}

	/**
	 * Moves the @path to point to the previous node at the
	 * current depth, if it exists.
	 *
	 * Returns: %TRUE if @path has a previous node, and
	 *     the move was made
	 */
	public bool prev()
	{
		return gtk_tree_path_prev(gtkTreePath) != 0;
	}

	/**
	 * Generates a string representation of the path.
	 *
	 * This string is a “:” separated list of numbers.
	 * For example, “4:10:0:3” would be an acceptable
	 * return value for this string.
	 *
	 * Returns: A newly-allocated string.
	 *     Must be freed with g_free().
	 */
	public override string toString()
	{
		auto retStr = gtk_tree_path_to_string(gtkTreePath);

		scope(exit) Str.freeString(retStr);
		return Str.toString(retStr);
	}

	/**
	 * Moves the @path to point to its parent node, if it has a parent.
	 *
	 * Returns: %TRUE if @path has a parent, and the move was made
	 */
	public bool up()
	{
		return gtk_tree_path_up(gtkTreePath) != 0;
	}
}