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 = GtkSourceCompletionWords.html 27 * outPack = gsv 28 * outFile = SourceCompletionWords 29 * strct = GtkSourceCompletionWords 30 * realStrct= 31 * ctorStrct= 32 * clss = SourceCompletionWords 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_source_completion_words_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - gdk.Pixbuf 48 * - gtk.TextBuffer 49 * structWrap: 50 * - GdkPixbuf* -> Pixbuf 51 * - GtkTextBuffer* -> TextBuffer 52 * module aliases: 53 * local aliases: 54 * overrides: 55 */ 56 57 module gsv.SourceCompletionWords; 58 59 public import gsvc.gsvtypes; 60 61 private import gsvc.gsv; 62 private import glib.ConstructionException; 63 private import gobject.ObjectG; 64 65 private import glib.Str; 66 private import gdk.Pixbuf; 67 private import gtk.TextBuffer; 68 69 70 private import gobject.ObjectG; 71 72 /** 73 * The GtkSourceCompletionWords is an example of an implementation of 74 * the GtkSourceCompletionProvider interface. The proposals are words 75 * appearing in the registered GtkTextBuffers. 76 */ 77 public class SourceCompletionWords : ObjectG 78 { 79 80 /** the main Gtk struct */ 81 protected GtkSourceCompletionWords* gtkSourceCompletionWords; 82 83 84 /** Get the main Gtk struct */ 85 public GtkSourceCompletionWords* getSourceCompletionWordsStruct() 86 { 87 return gtkSourceCompletionWords; 88 } 89 90 91 /** the main Gtk struct as a void* */ 92 protected override void* getStruct() 93 { 94 return cast(void*)gtkSourceCompletionWords; 95 } 96 97 /** 98 * Sets our main struct and passes it to the parent class 99 */ 100 public this (GtkSourceCompletionWords* gtkSourceCompletionWords) 101 { 102 super(cast(GObject*)gtkSourceCompletionWords); 103 this.gtkSourceCompletionWords = gtkSourceCompletionWords; 104 } 105 106 protected override void setStruct(GObject* obj) 107 { 108 super.setStruct(obj); 109 gtkSourceCompletionWords = cast(GtkSourceCompletionWords*)obj; 110 } 111 112 /** 113 */ 114 115 /** 116 * Params: 117 * name = The name for the provider. [allow-none] 118 * icon = A specific icon for the provider. [allow-none] 119 * Throws: ConstructionException GTK+ fails to create the object. 120 */ 121 public this (string name, Pixbuf icon) 122 { 123 // GtkSourceCompletionWords * gtk_source_completion_words_new (const gchar *name, GdkPixbuf *icon); 124 auto p = gtk_source_completion_words_new(Str.toStringz(name), (icon is null) ? null : icon.getPixbufStruct()); 125 if(p is null) 126 { 127 throw new ConstructionException("null returned by gtk_source_completion_words_new(Str.toStringz(name), (icon is null) ? null : icon.getPixbufStruct())"); 128 } 129 this(cast(GtkSourceCompletionWords*) p); 130 } 131 132 /** 133 * Registers buffer in the words provider. 134 * Params: 135 * buffer = a GtkTextBuffer 136 */ 137 public void register(TextBuffer buffer) 138 { 139 // void gtk_source_completion_words_register (GtkSourceCompletionWords *words, GtkTextBuffer *buffer); 140 gtk_source_completion_words_register(gtkSourceCompletionWords, (buffer is null) ? null : buffer.getTextBufferStruct()); 141 } 142 143 /** 144 * Unregisters buffer from the words provider. 145 * Params: 146 * buffer = a GtkTextBuffer 147 */ 148 public void unregister(TextBuffer buffer) 149 { 150 // void gtk_source_completion_words_unregister (GtkSourceCompletionWords *words, GtkTextBuffer *buffer); 151 gtk_source_completion_words_unregister(gtkSourceCompletionWords, (buffer is null) ? null : buffer.getTextBufferStruct()); 152 } 153 }