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