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 harfbuzz.variation_t;
26 
27 private import glib.MemorySlice;
28 private import glib.Str;
29 private import gtkd.Loader;
30 private import harfbuzz.c.functions;
31 public  import harfbuzz.c.types;
32 
33 
34 /**
35  * Data type for holding variation data. Registered OpenType
36  * variation-axis tags are listed in
37  * [OpenType Axis Tag Registry](https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg).
38  *
39  * Since: 1.4.2
40  */
41 public final class variation_t
42 {
43 	/** the main Gtk struct */
44 	protected hb_variation_t* hb_variation;
45 	protected bool ownedRef;
46 
47 	/** Get the main Gtk struct */
48 	public hb_variation_t* getvariation_tStruct(bool transferOwnership = false)
49 	{
50 		if (transferOwnership)
51 			ownedRef = false;
52 		return hb_variation;
53 	}
54 
55 	/** the main Gtk struct as a void* */
56 	protected void* getStruct()
57 	{
58 		return cast(void*)hb_variation;
59 	}
60 
61 	/**
62 	 * Sets our main struct and passes it to the parent class.
63 	 */
64 	public this (hb_variation_t* hb_variation, bool ownedRef = false)
65 	{
66 		this.hb_variation = hb_variation;
67 		this.ownedRef = ownedRef;
68 	}
69 
70 	~this ()
71 	{
72 		if ( Linker.isLoaded(LIBRARY_HARFBUZZ) && ownedRef )
73 			sliceFree(hb_variation);
74 	}
75 
76 
77 	/**
78 	 * The #hb_tag_t tag of the variation-axis name
79 	 */
80 	public @property hb_tag_t tag()
81 	{
82 		return hb_variation.tag;
83 	}
84 
85 	/** Ditto */
86 	public @property void tag(hb_tag_t value)
87 	{
88 		hb_variation.tag = value;
89 	}
90 
91 	/**
92 	 * The value of the variation axis
93 	 */
94 	public @property float value()
95 	{
96 		return hb_variation.value;
97 	}
98 
99 	/** Ditto */
100 	public @property void value(float value)
101 	{
102 		hb_variation.value = value;
103 	}
104 
105 	/**
106 	 * Converts an #hb_variation_t into a %NULL-terminated string in the format
107 	 * understood by hb_variation_from_string(). The client in responsible for
108 	 * allocating big enough size for @buf, 128 bytes is more than enough.
109 	 *
110 	 * Params:
111 	 *     buf = output string
112 	 *
113 	 * Since: 1.4.2
114 	 */
115 	public void String(out char[] buf)
116 	{
117 		hb_variation_to_string(hb_variation, buf.ptr, cast(uint)buf.length);
118 	}
119 }