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 atk.Misc;
26 
27 private import gobject.ObjectG;
28 private import gtkc.atk;
29 public  import gtkc.atktypes;
30 
31 
32 /**
33  * A set of utility functions for thread locking. This interface and
34  * all his related methods are deprecated since 2.12.
35  */
36 public class Misc : ObjectG
37 {
38 	/** the main Gtk struct */
39 	protected AtkMisc* atkMisc;
40 
41 	/** Get the main Gtk struct */
42 	public AtkMisc* getMiscStruct(bool transferOwnership = false)
43 	{
44 		if (transferOwnership)
45 			ownedRef = false;
46 		return atkMisc;
47 	}
48 
49 	/** the main Gtk struct as a void* */
50 	protected override void* getStruct()
51 	{
52 		return cast(void*)atkMisc;
53 	}
54 
55 	protected override void setStruct(GObject* obj)
56 	{
57 		atkMisc = cast(AtkMisc*)obj;
58 		super.setStruct(obj);
59 	}
60 
61 	/**
62 	 * Sets our main struct and passes it to the parent class.
63 	 */
64 	public this (AtkMisc* atkMisc, bool ownedRef = false)
65 	{
66 		this.atkMisc = atkMisc;
67 		super(cast(GObject*)atkMisc, ownedRef);
68 	}
69 
70 
71 	/** */
72 	public static GType getType()
73 	{
74 		return atk_misc_get_type();
75 	}
76 
77 	/**
78 	 * Obtain the singleton instance of AtkMisc for this application.
79 	 *
80 	 * Deprecated: Since 2.12.
81 	 *
82 	 * Returns: The singleton instance of AtkMisc for this application.
83 	 *
84 	 * Since: 1.13
85 	 */
86 	public static Misc getInstance()
87 	{
88 		auto p = atk_misc_get_instance();
89 		
90 		if(p is null)
91 		{
92 			return null;
93 		}
94 		
95 		return ObjectG.getDObject!(Misc)(cast(AtkMisc*) p);
96 	}
97 
98 	/**
99 	 * Take the thread mutex for the GUI toolkit,
100 	 * if one exists.
101 	 * (This method is implemented by the toolkit ATK implementation layer;
102 	 * for instance, for GTK+, GAIL implements this via GDK_THREADS_ENTER).
103 	 *
104 	 * Deprecated: Since 2.12.
105 	 *
106 	 * Since: 1.13
107 	 */
108 	public void threadsEnter()
109 	{
110 		atk_misc_threads_enter(atkMisc);
111 	}
112 
113 	/**
114 	 * Release the thread mutex for the GUI toolkit,
115 	 * if one exists. This method, and atk_misc_threads_enter,
116 	 * are needed in some situations by threaded application code which
117 	 * services ATK requests, since fulfilling ATK requests often
118 	 * requires calling into the GUI toolkit.  If a long-running or
119 	 * potentially blocking call takes place inside such a block, it should
120 	 * be bracketed by atk_misc_threads_leave/atk_misc_threads_enter calls.
121 	 * (This method is implemented by the toolkit ATK implementation layer;
122 	 * for instance, for GTK+, GAIL implements this via GDK_THREADS_LEAVE).
123 	 *
124 	 * Deprecated: Since 2.12.
125 	 *
126 	 * Since: 1.13
127 	 */
128 	public void threadsLeave()
129 	{
130 		atk_misc_threads_leave(atkMisc);
131 	}
132 }