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 = GtkSourceCompletionItem.html 27 * outPack = gsv 28 * outFile = SourceCompletionItem 29 * strct = GtkSourceCompletionItem 30 * realStrct= 31 * ctorStrct= 32 * clss = SourceCompletionItem 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * - SourceCompletionProposalIF 40 * prefixes: 41 * - gtk_source_completion_item_ 42 * omit structs: 43 * omit prefixes: 44 * omit code: 45 * - gtk_source_completion_item_new 46 * - gtk_source_completion_item_new_with_markup 47 * omit signals: 48 * imports: 49 * - glib.Str 50 * - gdk.Pixbuf 51 * - gsv.SourceCompletionProposalIF 52 * - gsv.SourceCompletionProposalT 53 * structWrap: 54 * - GdkPixbuf* -> Pixbuf 55 * module aliases: 56 * local aliases: 57 * overrides: 58 */ 59 60 module gsv.SourceCompletionItem; 61 62 public import gsvc.gsvtypes; 63 64 private import gsvc.gsv; 65 private import glib.ConstructionException; 66 private import gobject.ObjectG; 67 68 private import glib.Str; 69 private import gdk.Pixbuf; 70 private import gsv.SourceCompletionProposalIF; 71 private import gsv.SourceCompletionProposalT; 72 73 74 private import gobject.ObjectG; 75 76 /** 77 * The GtkSourceCompletionItem class is a simple implementation of the 78 * GtkSourceCompletionProposal interface. 79 */ 80 public class SourceCompletionItem : ObjectG, SourceCompletionProposalIF 81 { 82 83 /** the main Gtk struct */ 84 protected GtkSourceCompletionItem* gtkSourceCompletionItem; 85 86 87 /** Get the main Gtk struct */ 88 public GtkSourceCompletionItem* getSourceCompletionItemStruct() 89 { 90 return gtkSourceCompletionItem; 91 } 92 93 94 /** the main Gtk struct as a void* */ 95 protected override void* getStruct() 96 { 97 return cast(void*)gtkSourceCompletionItem; 98 } 99 100 /** 101 * Sets our main struct and passes it to the parent class 102 */ 103 public this (GtkSourceCompletionItem* gtkSourceCompletionItem) 104 { 105 super(cast(GObject*)gtkSourceCompletionItem); 106 this.gtkSourceCompletionItem = gtkSourceCompletionItem; 107 } 108 109 protected override void setStruct(GObject* obj) 110 { 111 super.setStruct(obj); 112 gtkSourceCompletionItem = cast(GtkSourceCompletionItem*)obj; 113 } 114 115 // add the SourceCompletionProposal capabilities 116 mixin SourceCompletionProposalT!(GtkSourceCompletionItem); 117 118 /** 119 * Create a new GtkSourceCompletionItem with label label, icon icon and 120 * extra information info. Both icon and info can be NULL in which case 121 * there will be no icon shown and no extra information available. 122 * Params: 123 * label = The item label. 124 * text = The item text. 125 * icon = The item icon. [allow-none] 126 * info = The item extra information. [allow-none] 127 * markup = If true label will be treated as markup. using gtk_source_completion_item_new_with_markup. 128 * Throws: ConstructionException GTK+ fails to create the object. 129 */ 130 public this (string label, string text, Pixbuf icon, string info, bool markup = false) 131 { 132 GtkSourceCompletionItem* p; 133 134 if ( markup ) 135 { 136 // GtkSourceCompletionItem * gtk_source_completion_item_new_with_markup (const gchar *markup, const gchar *text, GdkPixbuf *icon, const gchar *info); 137 p = gtk_source_completion_item_new_with_markup(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info)); 138 } 139 else 140 { 141 // GtkSourceCompletionItem * gtk_source_completion_item_new (const gchar *label, const gchar *text, GdkPixbuf *icon, const gchar *info); 142 p = gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info)); 143 144 } 145 146 if(p is null) 147 { 148 throw new ConstructionException("null returned by gtk_source_completion_item_new(Str.toStringz(label), Str.toStringz(text), (icon is null) ? null : icon.getPixbufStruct(), Str.toStringz(info))"); 149 } 150 this(cast(GtkSourceCompletionItem*) p); 151 } 152 153 /** 154 */ 155 156 /** 157 * Warning 158 * gtk_source_completion_item_new_from_stock has been deprecated since version 3.10 and should not be used in newly-written code. Use gtk_source_completion_item_new() instead. 159 * Creates a new GtkSourceCompletionItem from a stock item. If label is NULL, 160 * the stock label will be used. 161 * Params: 162 * label = The item label. [allow-none] 163 * text = The item text. 164 * stock = The stock icon. 165 * info = The item extra information. [allow-none] 166 * Throws: ConstructionException GTK+ fails to create the object. 167 */ 168 public this (string label, string text, string stock, string info) 169 { 170 // GtkSourceCompletionItem * gtk_source_completion_item_new_from_stock (const gchar *label, const gchar *text, const gchar *stock, const gchar *info); 171 auto p = gtk_source_completion_item_new_from_stock(Str.toStringz(label), Str.toStringz(text), Str.toStringz(stock), Str.toStringz(info)); 172 if(p is null) 173 { 174 throw new ConstructionException("null returned by gtk_source_completion_item_new_from_stock(Str.toStringz(label), Str.toStringz(text), Str.toStringz(stock), Str.toStringz(info))"); 175 } 176 this(cast(GtkSourceCompletionItem*) p); 177 } 178 }