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 = GtkSourceCompletionInfo.html 27 * outPack = gsv 28 * outFile = SourceCompletionInfo 29 * strct = GtkSourceCompletionInfo 30 * realStrct= 31 * ctorStrct= 32 * clss = SourceCompletionInfo 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gtk_source_completion_info_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - gtk.TextIter 47 * - gtk.TextView 48 * - gtk.Widget 49 * structWrap: 50 * - GtkTextIter* -> TextIter 51 * - GtkTextView* -> TextView 52 * - GtkWidget* -> Widget 53 * module aliases: 54 * local aliases: 55 * overrides: 56 */ 57 58 module gsv.SourceCompletionInfo; 59 60 public import gsvc.gsvtypes; 61 62 private import gsvc.gsv; 63 private import glib.ConstructionException; 64 private import gobject.ObjectG; 65 66 private import gobject.Signals; 67 public import gtkc.gdktypes; 68 69 private import gtk.TextIter; 70 private import gtk.TextView; 71 private import gtk.Widget; 72 73 74 75 private import gtk.Window; 76 77 /** 78 * This object can be used to show a calltip or help for the 79 * current completion proposal. 80 * 81 * The info window has always the same size as the natural size of its child 82 * widget, added with gtk_container_add(). If you want a fixed size instead, a 83 * possibility is to use a scrolled window, as the following example 84 * demonstrates. 85 * 86 * $(DDOC_COMMENT example) 87 * 88 * If the calltip is displayed on top of a certain widget, say a GtkTextView, 89 * you should attach the calltip window to the GtkTextView with 90 * gtk_window_set_attached_to(). By doing this, the calltip will be hidden when 91 * the "focus-out-event" signal is emitted by the GtkTextView. You 92 * may also be interested by the "cursor-position" property (when 93 * its value is modified). If you use the GtkSourceCompletionInfo through the 94 * GtkSourceCompletion machinery, you don't need to worry about this. 95 */ 96 public class SourceCompletionInfo : Window 97 { 98 99 /** the main Gtk struct */ 100 protected GtkSourceCompletionInfo* gtkSourceCompletionInfo; 101 102 103 public GtkSourceCompletionInfo* getSourceCompletionInfoStruct() 104 { 105 return gtkSourceCompletionInfo; 106 } 107 108 109 /** the main Gtk struct as a void* */ 110 protected override void* getStruct() 111 { 112 return cast(void*)gtkSourceCompletionInfo; 113 } 114 115 /** 116 * Sets our main struct and passes it to the parent class 117 */ 118 public this (GtkSourceCompletionInfo* gtkSourceCompletionInfo) 119 { 120 super(cast(GtkWindow*)gtkSourceCompletionInfo); 121 this.gtkSourceCompletionInfo = gtkSourceCompletionInfo; 122 } 123 124 protected override void setStruct(GObject* obj) 125 { 126 super.setStruct(obj); 127 gtkSourceCompletionInfo = cast(GtkSourceCompletionInfo*)obj; 128 } 129 130 /** 131 */ 132 int[string] connectedSignals; 133 134 void delegate(SourceCompletionInfo)[] onBeforeShowListeners; 135 /** 136 * Warning 137 * GtkSourceCompletionInfo::before-show has been deprecated since version 3.10 and should not be used in newly-written code. This signal should not be used. 138 * This signal is emitted before any "show" management. You can connect 139 * to this signal if you want to change some properties or position 140 * before the real "show". 141 */ 142 void addOnBeforeShow(void delegate(SourceCompletionInfo) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 143 { 144 if ( !("before-show" in connectedSignals) ) 145 { 146 Signals.connectData( 147 getStruct(), 148 "before-show", 149 cast(GCallback)&callBackBeforeShow, 150 cast(void*)this, 151 null, 152 connectFlags); 153 connectedSignals["before-show"] = 1; 154 } 155 onBeforeShowListeners ~= dlg; 156 } 157 extern(C) static void callBackBeforeShow(GtkSourceCompletionInfo* infoStruct, SourceCompletionInfo _sourceCompletionInfo) 158 { 159 foreach ( void delegate(SourceCompletionInfo) dlg ; _sourceCompletionInfo.onBeforeShowListeners ) 160 { 161 dlg(_sourceCompletionInfo); 162 } 163 } 164 165 166 /** 167 * Throws: ConstructionException GTK+ fails to create the object. 168 */ 169 public this () 170 { 171 // GtkSourceCompletionInfo * gtk_source_completion_info_new (void); 172 auto p = gtk_source_completion_info_new(); 173 if(p is null) 174 { 175 throw new ConstructionException("null returned by gtk_source_completion_info_new()"); 176 } 177 this(cast(GtkSourceCompletionInfo*) p); 178 } 179 180 /** 181 * Moves the GtkSourceCompletionInfo to iter. If iter is NULL info is 182 * moved to the cursor position. Moving will respect the GdkGravity setting 183 * of the info window and will ensure the line at iter is not occluded by 184 * the window. 185 * Params: 186 * view = a GtkTextView on which the info window should be positioned. 187 * iter = a GtkTextIter. [allow-none] 188 */ 189 public void moveToIter(TextView view, TextIter iter) 190 { 191 // void gtk_source_completion_info_move_to_iter (GtkSourceCompletionInfo *info, GtkTextView *view, GtkTextIter *iter); 192 gtk_source_completion_info_move_to_iter(gtkSourceCompletionInfo, (view is null) ? null : view.getTextViewStruct(), (iter is null) ? null : iter.getTextIterStruct()); 193 } 194 195 /** 196 * Warning 197 * gtk_source_completion_info_set_widget has been deprecated since version 3.8 and should not be used in newly-written code. Use gtk_container_add() instead. If there is already a child 198 * widget, remove it with gtk_container_remove(). 199 * Sets the content widget of the info window. See that the previous widget will 200 * lose a reference and it can be destroyed, so if you do not want this to 201 * happen you must use g_object_ref() before calling this method. 202 * Params: 203 * widget = a GtkWidget. [allow-none] 204 */ 205 public void setWidget(Widget widget) 206 { 207 // void gtk_source_completion_info_set_widget (GtkSourceCompletionInfo *info, GtkWidget *widget); 208 gtk_source_completion_info_set_widget(gtkSourceCompletionInfo, (widget is null) ? null : widget.getWidgetStruct()); 209 } 210 211 /** 212 * Warning 213 * gtk_source_completion_info_get_widget has been deprecated since version 3.8 and should not be used in newly-written code. Use gtk_bin_get_child() instead. 214 * Get the current content widget. 215 * Returns: The current content widget. [transfer none] Signal Details The "before-show" signal void user_function (GtkSourceCompletionInfo *info, gpointer user_data) : Action Warning GtkSourceCompletionInfo::before-show has been deprecated since version 3.10 and should not be used in newly-written code. This signal should not be used. This signal is emitted before any "show" management. You can connect to this signal if you want to change some properties or position before the real "show". 216 */ 217 public Widget getWidget() 218 { 219 // GtkWidget * gtk_source_completion_info_get_widget (GtkSourceCompletionInfo *info); 220 auto p = gtk_source_completion_info_get_widget(gtkSourceCompletionInfo); 221 222 if(p is null) 223 { 224 return null; 225 } 226 227 return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p); 228 } 229 }