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