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 71 private import glib.Str; 72 private import gtkc.paths; 73 private import gtkc.Loader; 74 75 76 77 78 /** 79 * The selection mechanism provides the basis for different types 80 * of communication between processes. In particular, drag and drop and 81 * GtkClipboard work via selections. You will very seldom or 82 * never need to use most of the functions in this section directly; 83 * GtkClipboard provides a nicer interface to the same functionality. 84 * 85 * Some of the datatypes defined this section are used in 86 * the GtkClipboard and drag-and-drop API's as well. The 87 * GtkTargetEntry structure and GtkTargetList objects represent 88 * lists of data types that are supported when sending or 89 * receiving data. The GtkSelectionData object is used to 90 * store a chunk of data along with the data type and other 91 * associated information. 92 */ 93 public class TargetEntry 94 { 95 96 /** the main Gtk struct */ 97 protected GtkTargetEntry* gtkTargetEntry; 98 99 100 public GtkTargetEntry* getTargetEntryStruct() 101 { 102 return gtkTargetEntry; 103 } 104 105 106 /** the main Gtk struct as a void* */ 107 protected void* getStruct() 108 { 109 return cast(void*)gtkTargetEntry; 110 } 111 112 /** 113 * Sets our main struct and passes it to the parent class 114 */ 115 public this (GtkTargetEntry* gtkTargetEntry) 116 { 117 this.gtkTargetEntry = gtkTargetEntry; 118 } 119 120 ~this () 121 { 122 if ( Linker.isLoaded(LIBRARY.GTK) && gtkTargetEntry !is null ) 123 { 124 gtk_target_entry_free(gtkTargetEntry); 125 } 126 } 127 128 /** 129 */ 130 131 /** 132 * Makes a new GtkTargetEntry structure. 133 * Params: 134 * target = String identifier for target 135 * flags = Set of flags, see GtkTargetFlags 136 * info = an ID that will be passed back to the application 137 * Throws: ConstructionException GTK+ fails to create the object. 138 */ 139 public this (string target, uint flags, uint info) 140 { 141 // GtkTargetEntry * gtk_target_entry_new (const gchar *target, guint flags, guint info); 142 auto p = gtk_target_entry_new(Str.toStringz(target), flags, info); 143 if(p is null) 144 { 145 throw new ConstructionException("null returned by gtk_target_entry_new(Str.toStringz(target), flags, info)"); 146 } 147 this(cast(GtkTargetEntry*) p); 148 } 149 150 /** 151 * Makes a copy of a GtkTargetEntry structure and its data. 152 * Returns: a pointer to a copy of data. Free with gtk_target_entry_free() 153 */ 154 public TargetEntry copy() 155 { 156 // GtkTargetEntry * gtk_target_entry_copy (GtkTargetEntry *data); 157 auto p = gtk_target_entry_copy(gtkTargetEntry); 158 159 if(p is null) 160 { 161 return null; 162 } 163 164 return ObjectG.getDObject!(TargetEntry)(cast(GtkTargetEntry*) p); 165 } 166 167 /** 168 * Frees a GtkTargetEntry structure returned from 169 * gtk_target_entry_new() or gtk_target_entry_copy(). 170 */ 171 public void free() 172 { 173 // void gtk_target_entry_free (GtkTargetEntry *data); 174 gtk_target_entry_free(gtkTargetEntry); 175 } 176 }