This file is indexed.

/usr/include/d/gtkd-3/pango/PgLayoutLine.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
/*
 * 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 pango.PgLayoutLine;

private import glib.ListSG;
private import glib.c.functions;
private import gobject.ObjectG;
public  import gtkc.pangotypes;
private import gtkd.Loader;
private import pango.PgLayout;
private import pango.c.functions;
public  import pango.c.types;


/**
 * The #PangoLayoutLine structure represents one of the lines resulting
 * from laying out a paragraph via #PangoLayout. #PangoLayoutLine
 * structures are obtained by calling pango_layout_get_line() and
 * are only valid until the text, attributes, or settings of the
 * parent #PangoLayout are modified.
 * 
 * Routines for rendering PangoLayout objects are provided in
 * code specific to each rendering system.
 */
public final class PgLayoutLine
{
	/** the main Gtk struct */
	protected PangoLayoutLine* pangoLayoutLine;
	protected bool ownedRef;

	/** Get the main Gtk struct */
	public PangoLayoutLine* getPgLayoutLineStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return pangoLayoutLine;
	}

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

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

	~this ()
	{
		if ( Linker.isLoaded(LIBRARY_PANGO) && ownedRef )
			pango_layout_line_unref(pangoLayoutLine);
	}


	/**
	 * the layout this line belongs to, might be %NULL
	 */
	public @property PgLayout layout()
	{
		return ObjectG.getDObject!(PgLayout)(pangoLayoutLine.layout, false);
	}

	/** Ditto */
	public @property void layout(PgLayout value)
	{
		pangoLayoutLine.layout = value.getPgLayoutStruct();
	}

	/**
	 * start of line as byte index into layout->text
	 */
	public @property int startIndex()
	{
		return pangoLayoutLine.startIndex;
	}

	/** Ditto */
	public @property void startIndex(int value)
	{
		pangoLayoutLine.startIndex = value;
	}

	/**
	 * length of line in bytes
	 */
	public @property int length()
	{
		return pangoLayoutLine.length;
	}

	/** Ditto */
	public @property void length(int value)
	{
		pangoLayoutLine.length = value;
	}

	/**
	 * list of runs in the
	 * line, from left to right
	 */
	public @property ListSG runs()
	{
		return new ListSG(pangoLayoutLine.runs, false);
	}

	/** Ditto */
	public @property void runs(ListSG value)
	{
		pangoLayoutLine.runs = value.getListSGStruct();
	}

	/**
	 * #TRUE if this is the first line of the paragraph
	 */
	public @property uint isParagraphStart()
	{
		return pangoLayoutLine.isParagraphStart;
	}

	/** Ditto */
	public @property void isParagraphStart(uint value)
	{
		pangoLayoutLine.isParagraphStart = value;
	}

	/**
	 * #Resolved PangoDirection of line
	 */
	public @property uint resolvedDir()
	{
		return pangoLayoutLine.resolvedDir;
	}

	/** Ditto */
	public @property void resolvedDir(uint value)
	{
		pangoLayoutLine.resolvedDir = value;
	}

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

	/**
	 * Computes the logical and ink extents of a layout line. See
	 * pango_font_get_glyph_extents() for details about the interpretation
	 * of the rectangles.
	 *
	 * Params:
	 *     inkRect = rectangle used to store the extents of
	 *         the glyph string as drawn, or %NULL
	 *     logicalRect = rectangle used to store the logical
	 *         extents of the glyph string, or %NULL
	 */
	public void getExtents(out PangoRectangle inkRect, out PangoRectangle logicalRect)
	{
		pango_layout_line_get_extents(pangoLayoutLine, &inkRect, &logicalRect);
	}

	/**
	 * Computes the logical and ink extents of @layout_line in device units.
	 * This function just calls pango_layout_line_get_extents() followed by
	 * two pango_extents_to_pixels() calls, rounding @ink_rect and @logical_rect
	 * such that the rounded rectangles fully contain the unrounded one (that is,
	 * passes them as first argument to pango_extents_to_pixels()).
	 *
	 * Params:
	 *     inkRect = rectangle used to store the extents of
	 *         the glyph string as drawn, or %NULL
	 *     logicalRect = rectangle used to store the logical
	 *         extents of the glyph string, or %NULL
	 */
	public void getPixelExtents(out PangoRectangle inkRect, out PangoRectangle logicalRect)
	{
		pango_layout_line_get_pixel_extents(pangoLayoutLine, &inkRect, &logicalRect);
	}

	/**
	 * Gets a list of visual ranges corresponding to a given logical range.
	 * This list is not necessarily minimal - there may be consecutive
	 * ranges which are adjacent. The ranges will be sorted from left to
	 * right. The ranges are with respect to the left edge of the entire
	 * layout, not with respect to the line.
	 *
	 * Params:
	 *     startIndex = Start byte index of the logical range. If this value
	 *         is less than the start index for the line, then
	 *         the first range will extend all the way to the leading
	 *         edge of the layout. Otherwise it will start at the
	 *         leading edge of the first character.
	 *     endIndex = Ending byte index of the logical range. If this value
	 *         is greater than the end index for the line, then
	 *         the last range will extend all the way to the trailing
	 *         edge of the layout. Otherwise, it will end at the
	 *         trailing edge of the last character.
	 *     ranges = location to store a pointer to an array of ranges.
	 *         The array will be of length <literal>2*n_ranges</literal>,
	 *         with each range starting at <literal>(*ranges)[2*n]</literal>
	 *         and of width <literal>(*ranges)[2*n + 1] - (*ranges)[2*n]</literal>.
	 *         This array must be freed with g_free(). The coordinates are relative
	 *         to the layout and are in Pango units.
	 */
	public void getXRanges(int startIndex, int endIndex, out int[] ranges)
	{
		int* outranges = null;
		int nRanges;

		pango_layout_line_get_x_ranges(pangoLayoutLine, startIndex, endIndex, &outranges, &nRanges);

		ranges = outranges[0 .. nRanges];
	}

	/**
	 * Converts an index within a line to a X position.
	 *
	 * Params:
	 *     index = byte offset of a grapheme within the layout
	 *     trailing = an integer indicating the edge of the grapheme to retrieve
	 *         the position of. If > 0, the trailing edge of the grapheme,
	 *         if 0, the leading of the grapheme.
	 *     xPos = location to store the x_offset (in Pango unit)
	 */
	public void indexToX(int index, bool trailing, out int xPos)
	{
		pango_layout_line_index_to_x(pangoLayoutLine, index, trailing, &xPos);
	}

	/**
	 * Increase the reference count of a #PangoLayoutLine by one.
	 *
	 * Returns: the line passed in.
	 *
	 * Since: 1.10
	 */
	public PgLayoutLine doref()
	{
		auto p = pango_layout_line_ref(pangoLayoutLine);

		if(p is null)
		{
			return null;
		}

		return ObjectG.getDObject!(PgLayoutLine)(cast(PangoLayoutLine*) p, true);
	}

	/**
	 * Decrease the reference count of a #PangoLayoutLine by one.
	 * If the result is zero, the line and all associated memory
	 * will be freed.
	 */
	public void unref()
	{
		pango_layout_line_unref(pangoLayoutLine);
	}

	/**
	 * Converts from x offset to the byte index of the corresponding
	 * character within the text of the layout. If @x_pos is outside the line,
	 * @index_ and @trailing will point to the very first or very last position
	 * in the line. This determination is based on the resolved direction
	 * of the paragraph; for example, if the resolved direction is
	 * right-to-left, then an X position to the right of the line (after it)
	 * results in 0 being stored in @index_ and @trailing. An X position to the
	 * left of the line results in @index_ pointing to the (logical) last
	 * grapheme in the line and @trailing being set to the number of characters
	 * in that grapheme. The reverse is true for a left-to-right line.
	 *
	 * Params:
	 *     xPos = the X offset (in Pango units)
	 *         from the left edge of the line.
	 *     index = location to store calculated byte index for
	 *         the grapheme in which the user clicked.
	 *     trailing = location to store an integer indicating where
	 *         in the grapheme the user clicked. It will either
	 *         be zero, or the number of characters in the
	 *         grapheme. 0 represents the leading edge of the grapheme.
	 *
	 * Returns: %FALSE if @x_pos was outside the line, %TRUE if inside
	 */
	public bool xToIndex(int xPos, out int index, out int trailing)
	{
		return pango_layout_line_x_to_index(pangoLayoutLine, xPos, &index, &trailing) != 0;
	}
}