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  * Conversion parameters:
26  * inFile  = gtk3-Selections.html
27  * outPack = gtk
28  * outFile = TargetEntry
29  * strct   = GtkTargetEntry
30  * realStrct=
31  * ctorStrct=
32  * clss    = TargetEntry
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_target_entry_
41  * 	- gtk_
42  * omit structs:
43  * 	- GtkTargetList
44  * omit prefixes:
45  * 	- gtk_target_table_
46  * 	- gtk_targets_
47  * 	- gtk_target_list_
48  * 	- gtk_selection_
49  * omit code:
50  * omit signals:
51  * imports:
52  * 	- glib.Str
53  * 	- gtkc.paths
54  * 	- gtkc.Loader
55  * structWrap:
56  * 	- GtkTargetEntry* -> TargetEntry
57  * module aliases:
58  * local aliases:
59  * overrides:
60  */
61 
62 module gtk.TargetEntry;
63 
64 public  import gtkc.gtktypes;
65 
66 private import gtkc.gtk;
67 private import glib.ConstructionException;
68 private import gobject.ObjectG;
69 
70 private import glib.Str;
71 private import gtkc.paths;
72 private import gtkc.Loader;
73 
74 
75 
76 /**
77  * The selection mechanism provides the basis for different types
78  * of communication between processes. In particular, drag and drop and
79  * GtkClipboard work via selections. You will very seldom or
80  * never need to use most of the functions in this section directly;
81  * GtkClipboard provides a nicer interface to the same functionality.
82  *
83  * Some of the datatypes defined this section are used in
84  * the GtkClipboard and drag-and-drop API's as well. The
85  * GtkTargetEntry structure and GtkTargetList objects represent
86  * lists of data types that are supported when sending or
87  * receiving data. The GtkSelectionData object is used to
88  * store a chunk of data along with the data type and other
89  * associated information.
90  */
91 public class TargetEntry
92 {
93 	
94 	/** the main Gtk struct */
95 	protected GtkTargetEntry* gtkTargetEntry;
96 	
97 	
98 	/** Get the main Gtk struct */
99 	public GtkTargetEntry* getTargetEntryStruct()
100 	{
101 		return gtkTargetEntry;
102 	}
103 	
104 	
105 	/** the main Gtk struct as a void* */
106 	protected void* getStruct()
107 	{
108 		return cast(void*)gtkTargetEntry;
109 	}
110 	
111 	/**
112 	 * Sets our main struct and passes it to the parent class
113 	 */
114 	public this (GtkTargetEntry* gtkTargetEntry)
115 	{
116 		this.gtkTargetEntry = gtkTargetEntry;
117 	}
118 	
119 	~this ()
120 	{
121 		if (  Linker.isLoaded(LIBRARY.GTK) && gtkTargetEntry !is null )
122 		{
123 			gtk_target_entry_free(gtkTargetEntry);
124 		}
125 	}
126 	
127 	/**
128 	 */
129 	
130 	/**
131 	 * Makes a new GtkTargetEntry structure.
132 	 * Params:
133 	 * target = String identifier for target
134 	 * flags = Set of flags, see GtkTargetFlags
135 	 * info = an ID that will be passed back to the application
136 	 * Throws: ConstructionException GTK+ fails to create the object.
137 	 */
138 	public this (string target, uint flags, uint info)
139 	{
140 		// GtkTargetEntry * gtk_target_entry_new (const gchar *target,  guint flags,  guint info);
141 		auto p = gtk_target_entry_new(Str.toStringz(target), flags, info);
142 		if(p is null)
143 		{
144 			throw new ConstructionException("null returned by gtk_target_entry_new(Str.toStringz(target), flags, info)");
145 		}
146 		this(cast(GtkTargetEntry*) p);
147 	}
148 	
149 	/**
150 	 * Makes a copy of a GtkTargetEntry structure and its data.
151 	 * Returns: a pointer to a copy of data. Free with gtk_target_entry_free()
152 	 */
153 	public TargetEntry copy()
154 	{
155 		// GtkTargetEntry * gtk_target_entry_copy (GtkTargetEntry *data);
156 		auto p = gtk_target_entry_copy(gtkTargetEntry);
157 		
158 		if(p is null)
159 		{
160 			return null;
161 		}
162 		
163 		return ObjectG.getDObject!(TargetEntry)(cast(GtkTargetEntry*) p);
164 	}
165 	
166 	/**
167 	 * Frees a GtkTargetEntry structure returned from
168 	 * gtk_target_entry_new() or gtk_target_entry_copy().
169 	 */
170 	public void free()
171 	{
172 		// void gtk_target_entry_free (GtkTargetEntry *data);
173 		gtk_target_entry_free(gtkTargetEntry);
174 	}
175 }