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