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 gdk.DeviceTool;
26 
27 private import gobject.ObjectG;
28 private import gtkc.gdk;
29 public  import gtkc.gdktypes;
30 
31 
32 /** */
33 public class DeviceTool : ObjectG
34 {
35 	/** the main Gtk struct */
36 	protected GdkDeviceTool* gdkDeviceTool;
37 
38 	/** Get the main Gtk struct */
39 	public GdkDeviceTool* getDeviceToolStruct(bool transferOwnership = false)
40 	{
41 		if (transferOwnership)
42 			ownedRef = false;
43 		return gdkDeviceTool;
44 	}
45 
46 	/** the main Gtk struct as a void* */
47 	protected override void* getStruct()
48 	{
49 		return cast(void*)gdkDeviceTool;
50 	}
51 
52 	protected override void setStruct(GObject* obj)
53 	{
54 		gdkDeviceTool = cast(GdkDeviceTool*)obj;
55 		super.setStruct(obj);
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GdkDeviceTool* gdkDeviceTool, bool ownedRef = false)
62 	{
63 		this.gdkDeviceTool = gdkDeviceTool;
64 		super(cast(GObject*)gdkDeviceTool, ownedRef);
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gdk_device_tool_get_type();
72 	}
73 
74 	/**
75 	 * Gets the hardware ID of this tool, or 0 if it's not known. When
76 	 * non-zero, the identificator is unique for the given tool model,
77 	 * meaning that two identical tools will share the same @hardware_id,
78 	 * but will have different serial numbers (see gdk_device_tool_get_serial()).
79 	 *
80 	 * This is a more concrete (and device specific) method to identify
81 	 * a #GdkDeviceTool than gdk_device_tool_get_tool_type(), as a tablet
82 	 * may support multiple devices with the same #GdkDeviceToolType,
83 	 * but having different hardware identificators.
84 	 *
85 	 * Returns: The hardware identificator of this tool.
86 	 *
87 	 * Since: 3.22
88 	 */
89 	public ulong getHardwareId()
90 	{
91 		return gdk_device_tool_get_hardware_id(gdkDeviceTool);
92 	}
93 
94 	/**
95 	 * Gets the serial of this tool, this value can be used to identify a
96 	 * physical tool (eg. a tablet pen) across program executions.
97 	 *
98 	 * Returns: The serial ID for this tool
99 	 *
100 	 * Since: 3.22
101 	 */
102 	public ulong getSerial()
103 	{
104 		return gdk_device_tool_get_serial(gdkDeviceTool);
105 	}
106 
107 	/**
108 	 * Gets the #GdkDeviceToolType of the tool.
109 	 *
110 	 * Returns: The physical type for this tool. This can be used to figure out what
111 	 *     sort of pen is being used, such as an airbrush or a pencil.
112 	 *
113 	 * Since: 3.22
114 	 */
115 	public GdkDeviceToolType getToolType()
116 	{
117 		return gdk_device_tool_get_tool_type(gdkDeviceTool);
118 	}
119 }