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  = GtkComboBox.html
27  * outPack = gtk
28  * outFile = ComboBox
29  * strct   = GtkComboBox
30  * realStrct=
31  * ctorStrct=
32  * clss    = ComboBox
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- CellLayoutIF
40  * 	- CellEditableIF
41  * prefixes:
42  * 	- gtk_combo_box_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * 	- gtk_combo_box_new
47  * 	- gtk_combo_box_new_with_entry
48  * 	- gtk_combo_box_new_with_model
49  * 	- gtk_combo_box_new_with_model_and_entry
50  * 	- gtk_combo_box_new_with_area
51  * 	- gtk_combo_box_new_with_area_and_entry
52  * omit signals:
53  * imports:
54  * 	- atk.ObjectAtk
55  * 	- glib.Str
56  * 	- gdk.Device
57  * 	- gtk.CellArea
58  * 	- gtk.TreeIter
59  * 	- gtk.TreeModel
60  * 	- gtk.TreeModelIF
61  * 	- gtk.CellLayoutIF
62  * 	- gtk.CellLayoutT
63  * 	- gtk.CellEditableT
64  * 	- gtk.CellEditableIF
65  * structWrap:
66  * 	- AtkObject* -> ObjectAtk
67  * 	- GdkDevice* -> Device
68  * 	- GtkCellArea* -> CellArea
69  * 	- GtkTreeIter* -> TreeIter
70  * 	- GtkTreeModel* -> TreeModelIF
71  * module aliases:
72  * local aliases:
73  * overrides:
74  */
75 
76 module gtk.ComboBox;
77 
78 public  import gtkc.gtktypes;
79 
80 private import gtkc.gtk;
81 private import glib.ConstructionException;
82 private import gobject.ObjectG;
83 
84 private import gobject.Signals;
85 public  import gtkc.gdktypes;
86 private import atk.ObjectAtk;
87 private import glib.Str;
88 private import gdk.Device;
89 private import gtk.CellArea;
90 private import gtk.TreeIter;
91 private import gtk.TreeModel;
92 private import gtk.TreeModelIF;
93 private import gtk.CellLayoutIF;
94 private import gtk.CellLayoutT;
95 private import gtk.CellEditableT;
96 private import gtk.CellEditableIF;
97 
98 
99 private import gtk.Bin;
100 
101 /**
102  * A GtkComboBox is a widget that allows the user to choose from a list of
103  * valid choices. The GtkComboBox displays the selected choice. When
104  * activated, the GtkComboBox displays a popup which allows the user to
105  * make a new choice. The style in which the selected value is displayed,
106  * and the style of the popup is determined by the current theme. It may
107  * be similar to a Windows-style combo box.
108  *
109  * The GtkComboBox uses the model-view pattern; the list of valid choices
110  * is specified in the form of a tree model, and the display of the choices
111  * can be adapted to the data in the model by using cell renderers, as you
112  * would in a tree view. This is possible since GtkComboBox implements the
113  * GtkCellLayout interface. The tree model holding the valid choices is
114  * not restricted to a flat list, it can be a real tree, and the popup will
115  * reflect the tree structure.
116  *
117  * To allow the user to enter values not in the model, the 'has-entry'
118  * property allows the GtkComboBox to contain a GtkEntry. This entry
119  * can be accessed by calling gtk_bin_get_child() on the combo box.
120  *
121  * For a simple list of textual choices, the model-view API of GtkComboBox
122  * can be a bit overwhelming. In this case, GtkComboBoxText offers a
123  * simple alternative. Both GtkComboBox and GtkComboBoxText can contain
124  * an entry.
125  */
126 public class ComboBox : Bin, CellLayoutIF, CellEditableIF
127 {
128 	
129 	/** the main Gtk struct */
130 	protected GtkComboBox* gtkComboBox;
131 	
132 	
133 	/** Get the main Gtk struct */
134 	public GtkComboBox* getComboBoxStruct()
135 	{
136 		return gtkComboBox;
137 	}
138 	
139 	
140 	/** the main Gtk struct as a void* */
141 	protected override void* getStruct()
142 	{
143 		return cast(void*)gtkComboBox;
144 	}
145 	
146 	/**
147 	 * Sets our main struct and passes it to the parent class
148 	 */
149 	public this (GtkComboBox* gtkComboBox)
150 	{
151 		super(cast(GtkBin*)gtkComboBox);
152 		this.gtkComboBox = gtkComboBox;
153 	}
154 	
155 	protected override void setStruct(GObject* obj)
156 	{
157 		super.setStruct(obj);
158 		gtkComboBox = cast(GtkComboBox*)obj;
159 	}
160 	
161 	// add the CellLayout capabilities
162 	mixin CellLayoutT!(GtkComboBox);
163 	
164 	// add the CellEditable capabilities
165 	mixin CellEditableT!(GtkComboBox);
166 	
167 	/**
168 	 * Creates a new empty GtkComboBox.
169 	 * Params:
170 	 *   entry = If true, create an empty ComboBox with an entry.
171 	 * Throws: ConstructionException GTK+ fails to create the object.
172 	 */
173 	public this (bool entry=true)
174 	{
175 		GtkComboBox* p;
176 		if ( entry )
177 		{
178 			// GtkWidget* gtk_combo_box_new_text (void);
179 			p = cast(GtkComboBox*)gtk_combo_box_new_with_entry();
180 		}
181 		else
182 		{
183 			// GtkWidget* gtk_combo_box_new (void);
184 			p = cast(GtkComboBox*)gtk_combo_box_new();
185 		}
186 		
187 		if(p is null)
188 		{
189 			throw new ConstructionException("null returned by gtk_combo_box_new");
190 		}
191 		
192 		this(p);
193 	}
194 	
195 	/**
196 	 * Creates a new GtkComboBox with the model initialized to model.
197 	 * Params:
198 	 *   model = A GtkTreeModel.
199 	 *   entry = If true, create an empty ComboBox with an entry.
200 	 * Throws: ConstructionException GTK+ fails to create the object.
201 	 */
202 	public this (TreeModelIF model, bool entry=true)
203 	{
204 		GtkComboBox* p;
205 		if ( entry )
206 		{
207 			// GtkWidget* gtk_combo_box_new_with_model_and_entry (GtkTreeModel *model);
208 			p = cast(GtkComboBox*)gtk_combo_box_new_with_model_and_entry((model is null) ? null : model.getTreeModelTStruct());
209 		}
210 		else
211 		{
212 			// GtkWidget* gtk_combo_box_new_with_model (GtkTreeModel *model);
213 			p = cast(GtkComboBox*)gtk_combo_box_new_with_model((model is null) ? null : model.getTreeModelTStruct());
214 		}
215 		
216 		if(p is null)
217 		{
218 			throw new ConstructionException("null returned by gtk_combo_box_new");
219 		}
220 		
221 		this(p);
222 	}
223 	
224 	/**
225 	 * Creates a new empty GtkComboBox using area to layout cells.
226 	 * Params:
227 	 *   area = the GtkCellArea to use to layout cell renderers.
228 	 *   entry = If true, create an empty ComboBox with an entry.
229 	 * Throws: ConstructionException GTK+ fails to create the object.
230 	 */
231 	public this (CellArea area, bool entry=true)
232 	{
233 		GtkComboBox* p;
234 		if ( entry )
235 		{
236 			// GtkWidget* gtk_combo_box_new_with_area_and_entry (GtkCellArea *area);
237 			p = cast(GtkComboBox*)gtk_combo_box_new_with_area_and_entry((area is null) ? null : area.getCellAreaStruct());
238 		}
239 		else
240 		{
241 			// GtkWidget* gtk_combo_box_new_with_area (GtkCellArea* area);
242 			p = cast(GtkComboBox*)gtk_combo_box_new_with_area((area is null) ? null : area.getCellAreaStruct());
243 		}
244 		
245 		if(p is null)
246 		{
247 			throw new ConstructionException("null returned by gtk_combo_box_new");
248 		}
249 		
250 		this(p);
251 	}
252 	
253 	/**
254 	 */
255 	int[string] connectedSignals;
256 	
257 	void delegate(ComboBox)[] onChangedListeners;
258 	/**
259 	 * The changed signal is emitted when the active
260 	 * item is changed. The can be due to the user selecting
261 	 * a different item from the list, or due to a
262 	 * call to gtk_combo_box_set_active_iter().
263 	 * It will also be emitted while typing into the entry of a combo box
264 	 * with an entry.
265 	 * Since 2.4
266 	 */
267 	void addOnChanged(void delegate(ComboBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
268 	{
269 		if ( !("changed" in connectedSignals) )
270 		{
271 			Signals.connectData(
272 			getStruct(),
273 			"changed",
274 			cast(GCallback)&callBackChanged,
275 			cast(void*)this,
276 			null,
277 			connectFlags);
278 			connectedSignals["changed"] = 1;
279 		}
280 		onChangedListeners ~= dlg;
281 	}
282 	extern(C) static void callBackChanged(GtkComboBox* widgetStruct, ComboBox _comboBox)
283 	{
284 		foreach ( void delegate(ComboBox) dlg ; _comboBox.onChangedListeners )
285 		{
286 			dlg(_comboBox);
287 		}
288 	}
289 	
290 	string delegate(string, ComboBox)[] onFormatEntryTextListeners;
291 	/**
292 	 * For combo boxes that are created with an entry (See GtkComboBox:has-entry).
293 	 * A signal which allows you to change how the text displayed in a combo box's
294 	 * entry is displayed.
295 	 * Connect a signal handler which returns an allocated string representing
296 	 * path. That string will then be used to set the text in the combo box's entry.
297 	 * The default signal handler uses the text from the GtkComboBox::entry-text-column
298 	 * model column.
299 	 * Here's an example signal handler which fetches data from the model and
300 	 * displays it in the entry.
301 	 * $(DDOC_COMMENT example)
302 	 * Since 3.4
303 	 */
304 	void addOnFormatEntryText(string delegate(string, ComboBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
305 	{
306 		if ( !("format-entry-text" in connectedSignals) )
307 		{
308 			Signals.connectData(
309 			getStruct(),
310 			"format-entry-text",
311 			cast(GCallback)&callBackFormatEntryText,
312 			cast(void*)this,
313 			null,
314 			connectFlags);
315 			connectedSignals["format-entry-text"] = 1;
316 		}
317 		onFormatEntryTextListeners ~= dlg;
318 	}
319 	extern(C) static void callBackFormatEntryText(GtkComboBox* comboStruct, gchar* path, ComboBox _comboBox)
320 	{
321 		foreach ( string delegate(string, ComboBox) dlg ; _comboBox.onFormatEntryTextListeners )
322 		{
323 			dlg(Str.toString(path), _comboBox);
324 		}
325 	}
326 	
327 	void delegate(GtkScrollType, ComboBox)[] onMoveActiveListeners;
328 	/**
329 	 * The ::move-active signal is a
330 	 * keybinding signal
331 	 * which gets emitted to move the active selection.
332 	 * Since 2.12
333 	 */
334 	void addOnMoveActive(void delegate(GtkScrollType, ComboBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
335 	{
336 		if ( !("move-active" in connectedSignals) )
337 		{
338 			Signals.connectData(
339 			getStruct(),
340 			"move-active",
341 			cast(GCallback)&callBackMoveActive,
342 			cast(void*)this,
343 			null,
344 			connectFlags);
345 			connectedSignals["move-active"] = 1;
346 		}
347 		onMoveActiveListeners ~= dlg;
348 	}
349 	extern(C) static void callBackMoveActive(GtkComboBox* widgetStruct, GtkScrollType scrollType, ComboBox _comboBox)
350 	{
351 		foreach ( void delegate(GtkScrollType, ComboBox) dlg ; _comboBox.onMoveActiveListeners )
352 		{
353 			dlg(scrollType, _comboBox);
354 		}
355 	}
356 	
357 	bool delegate(ComboBox)[] onPopdownListeners;
358 	/**
359 	 * The ::popdown signal is a
360 	 * keybinding signal
361 	 * which gets emitted to popdown the combo box list.
362 	 * The default bindings for this signal are Alt+Up and Escape.
363 	 * Since 2.12
364 	 */
365 	void addOnPopdown(bool delegate(ComboBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
366 	{
367 		if ( !("popdown" in connectedSignals) )
368 		{
369 			Signals.connectData(
370 			getStruct(),
371 			"popdown",
372 			cast(GCallback)&callBackPopdown,
373 			cast(void*)this,
374 			null,
375 			connectFlags);
376 			connectedSignals["popdown"] = 1;
377 		}
378 		onPopdownListeners ~= dlg;
379 	}
380 	extern(C) static gboolean callBackPopdown(GtkComboBox* buttonStruct, ComboBox _comboBox)
381 	{
382 		foreach ( bool delegate(ComboBox) dlg ; _comboBox.onPopdownListeners )
383 		{
384 			if ( dlg(_comboBox) )
385 			{
386 				return 1;
387 			}
388 		}
389 		
390 		return 0;
391 	}
392 	
393 	void delegate(ComboBox)[] onPopupListeners;
394 	/**
395 	 * The ::popup signal is a
396 	 * keybinding signal
397 	 * which gets emitted to popup the combo box list.
398 	 * The default binding for this signal is Alt+Down.
399 	 * Since 2.12
400 	 * See Also
401 	 * GtkComboBoxText, GtkTreeModel, GtkCellRenderer
402 	 */
403 	void addOnPopup(void delegate(ComboBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
404 	{
405 		if ( !("popup" in connectedSignals) )
406 		{
407 			Signals.connectData(
408 			getStruct(),
409 			"popup",
410 			cast(GCallback)&callBackPopup,
411 			cast(void*)this,
412 			null,
413 			connectFlags);
414 			connectedSignals["popup"] = 1;
415 		}
416 		onPopupListeners ~= dlg;
417 	}
418 	extern(C) static void callBackPopup(GtkComboBox* widgetStruct, ComboBox _comboBox)
419 	{
420 		foreach ( void delegate(ComboBox) dlg ; _comboBox.onPopupListeners )
421 		{
422 			dlg(_comboBox);
423 		}
424 	}
425 	
426 	
427 	/**
428 	 * Returns the wrap width which is used to determine the number of columns
429 	 * for the popup menu. If the wrap width is larger than 1, the combo box
430 	 * is in table mode.
431 	 * Since 2.6
432 	 * Returns: the wrap width.
433 	 */
434 	public int getWrapWidth()
435 	{
436 		// gint gtk_combo_box_get_wrap_width (GtkComboBox *combo_box);
437 		return gtk_combo_box_get_wrap_width(gtkComboBox);
438 	}
439 	
440 	/**
441 	 * Sets the wrap width of combo_box to be width. The wrap width is basically
442 	 * the preferred number of columns when you want the popup to be layed out
443 	 * in a table.
444 	 * Since 2.4
445 	 * Params:
446 	 * width = Preferred number of columns
447 	 */
448 	public void setWrapWidth(int width)
449 	{
450 		// void gtk_combo_box_set_wrap_width (GtkComboBox *combo_box,  gint width);
451 		gtk_combo_box_set_wrap_width(gtkComboBox, width);
452 	}
453 	
454 	/**
455 	 * Returns the column with row span information for combo_box.
456 	 * Since 2.6
457 	 * Returns: the row span column.
458 	 */
459 	public int getRowSpanColumn()
460 	{
461 		// gint gtk_combo_box_get_row_span_column (GtkComboBox *combo_box);
462 		return gtk_combo_box_get_row_span_column(gtkComboBox);
463 	}
464 	
465 	/**
466 	 * Sets the column with row span information for combo_box to be row_span.
467 	 * The row span column contains integers which indicate how many rows
468 	 * an item should span.
469 	 * Since 2.4
470 	 * Params:
471 	 * rowSpan = A column in the model passed during construction.
472 	 */
473 	public void setRowSpanColumn(int rowSpan)
474 	{
475 		// void gtk_combo_box_set_row_span_column (GtkComboBox *combo_box,  gint row_span);
476 		gtk_combo_box_set_row_span_column(gtkComboBox, rowSpan);
477 	}
478 	
479 	/**
480 	 * Returns the column with column span information for combo_box.
481 	 * Since 2.6
482 	 * Returns: the column span column.
483 	 */
484 	public int getColumnSpanColumn()
485 	{
486 		// gint gtk_combo_box_get_column_span_column  (GtkComboBox *combo_box);
487 		return gtk_combo_box_get_column_span_column(gtkComboBox);
488 	}
489 	
490 	/**
491 	 * Sets the column with column span information for combo_box to be
492 	 * column_span. The column span column contains integers which indicate
493 	 * how many columns an item should span.
494 	 * Since 2.4
495 	 * Params:
496 	 * columnSpan = A column in the model passed during construction
497 	 */
498 	public void setColumnSpanColumn(int columnSpan)
499 	{
500 		// void gtk_combo_box_set_column_span_column  (GtkComboBox *combo_box,  gint column_span);
501 		gtk_combo_box_set_column_span_column(gtkComboBox, columnSpan);
502 	}
503 	
504 	/**
505 	 * Returns the index of the currently active item, or -1 if there's no
506 	 * active item. If the model is a non-flat treemodel, and the active item
507 	 * is not an immediate child of the root of the tree, this function returns
508 	 * gtk_tree_path_get_indices (path)[0], where
509 	 * path is the GtkTreePath of the active item.
510 	 * Since 2.4
511 	 * Returns: An integer which is the index of the currently active item, or -1 if there's no active item.
512 	 */
513 	public int getActive()
514 	{
515 		// gint gtk_combo_box_get_active (GtkComboBox *combo_box);
516 		return gtk_combo_box_get_active(gtkComboBox);
517 	}
518 	
519 	/**
520 	 * Sets the active item of combo_box to be the item at index.
521 	 * Since 2.4
522 	 * Params:
523 	 * index = An index in the model passed during construction, or -1 to have
524 	 * no active item
525 	 */
526 	public void setActive(int index)
527 	{
528 		// void gtk_combo_box_set_active (GtkComboBox *combo_box,  gint index_);
529 		gtk_combo_box_set_active(gtkComboBox, index);
530 	}
531 	
532 	/**
533 	 * Sets iter to point to the current active item, if it exists.
534 	 * Since 2.4
535 	 * Params:
536 	 * iter = The uninitialized GtkTreeIter. [out]
537 	 * Returns: TRUE, if iter was set
538 	 */
539 	public int getActiveIter(TreeIter iter)
540 	{
541 		// gboolean gtk_combo_box_get_active_iter (GtkComboBox *combo_box,  GtkTreeIter *iter);
542 		return gtk_combo_box_get_active_iter(gtkComboBox, (iter is null) ? null : iter.getTreeIterStruct());
543 	}
544 	
545 	/**
546 	 * Sets the current active item to be the one referenced by iter, or
547 	 * unsets the active item if iter is NULL.
548 	 * Since 2.4
549 	 * Params:
550 	 * iter = The GtkTreeIter, or NULL. [allow-none]
551 	 */
552 	public void setActiveIter(TreeIter iter)
553 	{
554 		// void gtk_combo_box_set_active_iter (GtkComboBox *combo_box,  GtkTreeIter *iter);
555 		gtk_combo_box_set_active_iter(gtkComboBox, (iter is null) ? null : iter.getTreeIterStruct());
556 	}
557 	
558 	/**
559 	 * Returns the column which combo_box is using to get string IDs
560 	 * for values from.
561 	 * Returns: A column in the data source model of combo_box. Since 3.0
562 	 */
563 	public int getIdColumn()
564 	{
565 		// gint gtk_combo_box_get_id_column (GtkComboBox *combo_box);
566 		return gtk_combo_box_get_id_column(gtkComboBox);
567 	}
568 	
569 	/**
570 	 * Sets the model column which combo_box should use to get string IDs
571 	 * for values from. The column id_column in the model of combo_box
572 	 * must be of type G_TYPE_STRING.
573 	 * Params:
574 	 * idColumn = A column in model to get string IDs for values from
575 	 * Since 3.0
576 	 */
577 	public void setIdColumn(int idColumn)
578 	{
579 		// void gtk_combo_box_set_id_column (GtkComboBox *combo_box,  gint id_column);
580 		gtk_combo_box_set_id_column(gtkComboBox, idColumn);
581 	}
582 	
583 	/**
584 	 * Returns the ID of the active row of combo_box. This value is taken
585 	 * from the active row and the column specified by the "id-column"
586 	 * property of combo_box (see gtk_combo_box_set_id_column()).
587 	 * The returned value is an interned string which means that you can
588 	 * compare the pointer by value to other interned strings and that you
589 	 * must not free it.
590 	 * If the "id-column" property of combo_box is not set, or if
591 	 * no row is active, or if the active row has a NULL ID value, then NULL
592 	 * is returned.
593 	 * Returns: the ID of the active row, or NULL Since 3.0
594 	 */
595 	public string getActiveId()
596 	{
597 		// const gchar * gtk_combo_box_get_active_id (GtkComboBox *combo_box);
598 		return Str.toString(gtk_combo_box_get_active_id(gtkComboBox));
599 	}
600 	
601 	/**
602 	 * Changes the active row of combo_box to the one that has an ID equal to
603 	 * active_id, or unsets the active row if active_id is NULL. Rows having
604 	 * a NULL ID string cannot be made active by this function.
605 	 * If the "id-column" property of combo_box is unset or if no
606 	 * row has the given ID then the function does nothing and returns FALSE.
607 	 * Params:
608 	 * activeId = the ID of the row to select, or NULL. [allow-none]
609 	 * Returns: TRUE if a row with a matching ID was found. If a NULL active_id was given to unset the active row, the function always returns TRUE. Since 3.0
610 	 */
611 	public int setActiveId(string activeId)
612 	{
613 		// gboolean gtk_combo_box_set_active_id (GtkComboBox *combo_box,  const gchar *active_id);
614 		return gtk_combo_box_set_active_id(gtkComboBox, Str.toStringz(activeId));
615 	}
616 	
617 	/**
618 	 * Returns the GtkTreeModel which is acting as data source for combo_box.
619 	 * Since 2.4
620 	 * Returns: A GtkTreeModel which was passed during construction. [transfer none]
621 	 */
622 	public TreeModelIF getModel()
623 	{
624 		// GtkTreeModel * gtk_combo_box_get_model (GtkComboBox *combo_box);
625 		auto p = gtk_combo_box_get_model(gtkComboBox);
626 		
627 		if(p is null)
628 		{
629 			return null;
630 		}
631 		
632 		return ObjectG.getDObject!(TreeModel, TreeModelIF)(cast(GtkTreeModel*) p);
633 	}
634 	
635 	/**
636 	 * Sets the model used by combo_box to be model. Will unset a previously set
637 	 * model (if applicable). If model is NULL, then it will unset the model.
638 	 * Note that this function does not clear the cell renderers, you have to
639 	 * call gtk_cell_layout_clear() yourself if you need to set up different
640 	 * cell renderers for the new model.
641 	 * Since 2.4
642 	 * Params:
643 	 * model = A GtkTreeModel. [allow-none]
644 	 */
645 	public void setModel(TreeModelIF model)
646 	{
647 		// void gtk_combo_box_set_model (GtkComboBox *combo_box,  GtkTreeModel *model);
648 		gtk_combo_box_set_model(gtkComboBox, (model is null) ? null : model.getTreeModelTStruct());
649 	}
650 	
651 	/**
652 	 * Pops up the menu or dropdown list of combo_box, the popup window
653 	 * will be grabbed so only device and its associated pointer/keyboard
654 	 * are the only GdkDevices able to send events to it.
655 	 * Params:
656 	 * device = a GdkDevice
657 	 * Since 3.0
658 	 */
659 	public void popupForDevice(Device device)
660 	{
661 		// void gtk_combo_box_popup_for_device (GtkComboBox *combo_box,  GdkDevice *device);
662 		gtk_combo_box_popup_for_device(gtkComboBox, (device is null) ? null : device.getDeviceStruct());
663 	}
664 	
665 	/**
666 	 * Pops up the menu or dropdown list of combo_box.
667 	 * This function is mostly intended for use by accessibility technologies;
668 	 * applications should have little use for it.
669 	 * Since 2.4
670 	 */
671 	public void popup()
672 	{
673 		// void gtk_combo_box_popup (GtkComboBox *combo_box);
674 		gtk_combo_box_popup(gtkComboBox);
675 	}
676 	
677 	/**
678 	 * Hides the menu or dropdown list of combo_box.
679 	 * This function is mostly intended for use by accessibility technologies;
680 	 * applications should have little use for it.
681 	 * Since 2.4
682 	 */
683 	public void popdown()
684 	{
685 		// void gtk_combo_box_popdown (GtkComboBox *combo_box);
686 		gtk_combo_box_popdown(gtkComboBox);
687 	}
688 	
689 	/**
690 	 * Gets the accessible object corresponding to the combo box's popup.
691 	 * This function is mostly intended for use by accessibility technologies;
692 	 * applications should have little use for it.
693 	 * Since 2.6
694 	 * Returns: the accessible object corresponding to the combo box's popup. [transfer none]
695 	 */
696 	public ObjectAtk getPopupAccessible()
697 	{
698 		// AtkObject * gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box);
699 		auto p = gtk_combo_box_get_popup_accessible(gtkComboBox);
700 		
701 		if(p is null)
702 		{
703 			return null;
704 		}
705 		
706 		return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p);
707 	}
708 	
709 	/**
710 	 * Returns the current row separator function.
711 	 * Since 2.6
712 	 * Returns: the current row separator function.
713 	 */
714 	public GtkTreeViewRowSeparatorFunc getRowSeparatorFunc()
715 	{
716 		// GtkTreeViewRowSeparatorFunc gtk_combo_box_get_row_separator_func  (GtkComboBox *combo_box);
717 		return gtk_combo_box_get_row_separator_func(gtkComboBox);
718 	}
719 	
720 	/**
721 	 * Sets the row separator function, which is used to determine
722 	 * whether a row should be drawn as a separator. If the row separator
723 	 * function is NULL, no separators are drawn. This is the default value.
724 	 * Since 2.6
725 	 * Params:
726 	 * func = a GtkTreeViewRowSeparatorFunc
727 	 * data = user data to pass to func, or NULL. [allow-none]
728 	 * destroy = destroy notifier for data, or NULL. [allow-none]
729 	 */
730 	public void setRowSeparatorFunc(GtkTreeViewRowSeparatorFunc func, void* data, GDestroyNotify destroy)
731 	{
732 		// void gtk_combo_box_set_row_separator_func  (GtkComboBox *combo_box,  GtkTreeViewRowSeparatorFunc func,  gpointer data,  GDestroyNotify destroy);
733 		gtk_combo_box_set_row_separator_func(gtkComboBox, func, data, destroy);
734 	}
735 	
736 	/**
737 	 * Warning
738 	 * gtk_combo_box_set_add_tearoffs is deprecated and should not be used in newly-written code. 3.10
739 	 * Sets whether the popup menu should have a tearoff
740 	 * menu item.
741 	 * Since 2.6
742 	 * Params:
743 	 * addTearoffs = TRUE to add tearoff menu items
744 	 */
745 	public void setAddTearoffs(int addTearoffs)
746 	{
747 		// void gtk_combo_box_set_add_tearoffs (GtkComboBox *combo_box,  gboolean add_tearoffs);
748 		gtk_combo_box_set_add_tearoffs(gtkComboBox, addTearoffs);
749 	}
750 	
751 	/**
752 	 * Warning
753 	 * gtk_combo_box_get_add_tearoffs is deprecated and should not be used in newly-written code. 3.10
754 	 * Gets the current value of the :add-tearoffs property.
755 	 * Returns: the current value of the :add-tearoffs property.
756 	 */
757 	public int getAddTearoffs()
758 	{
759 		// gboolean gtk_combo_box_get_add_tearoffs (GtkComboBox *combo_box);
760 		return gtk_combo_box_get_add_tearoffs(gtkComboBox);
761 	}
762 	
763 	/**
764 	 * Warning
765 	 * gtk_combo_box_set_title is deprecated and should not be used in newly-written code. 3.10
766 	 * Sets the menu's title in tearoff mode.
767 	 * Since 2.10
768 	 * Params:
769 	 * title = a title for the menu in tearoff mode
770 	 */
771 	public void setTitle(string title)
772 	{
773 		// void gtk_combo_box_set_title (GtkComboBox *combo_box,  const gchar *title);
774 		gtk_combo_box_set_title(gtkComboBox, Str.toStringz(title));
775 	}
776 	
777 	/**
778 	 * Warning
779 	 * gtk_combo_box_get_title is deprecated and should not be used in newly-written code. 3.10
780 	 * Gets the current title of the menu in tearoff mode. See
781 	 * gtk_combo_box_set_add_tearoffs().
782 	 * Since 2.10
783 	 * Returns: the menu's title in tearoff mode. This is an internal copy of the string which must not be freed.
784 	 */
785 	public string getTitle()
786 	{
787 		// const gchar * gtk_combo_box_get_title (GtkComboBox *combo_box);
788 		return Str.toString(gtk_combo_box_get_title(gtkComboBox));
789 	}
790 	
791 	/**
792 	 * Sets whether the combo box will grab focus when it is clicked with
793 	 * the mouse. Making mouse clicks not grab focus is useful in places
794 	 * like toolbars where you don't want the keyboard focus removed from
795 	 * the main area of the application.
796 	 * Since 2.6
797 	 * Params:
798 	 * focusOnClick = whether the combo box grabs focus when clicked
799 	 * with the mouse
800 	 */
801 	public void setFocusOnClick(int focusOnClick)
802 	{
803 		// void gtk_combo_box_set_focus_on_click (GtkComboBox *combo,  gboolean focus_on_click);
804 		gtk_combo_box_set_focus_on_click(gtkComboBox, focusOnClick);
805 	}
806 	
807 	/**
808 	 * Returns whether the combo box grabs focus when it is clicked
809 	 * with the mouse. See gtk_combo_box_set_focus_on_click().
810 	 * Since 2.6
811 	 * Returns: TRUE if the combo box grabs focus when it is clicked with the mouse.
812 	 */
813 	public int getFocusOnClick()
814 	{
815 		// gboolean gtk_combo_box_get_focus_on_click (GtkComboBox *combo);
816 		return gtk_combo_box_get_focus_on_click(gtkComboBox);
817 	}
818 	
819 	/**
820 	 * Sets whether the dropdown button of the combo box should be
821 	 * always sensitive (GTK_SENSITIVITY_ON), never sensitive (GTK_SENSITIVITY_OFF)
822 	 * or only if there is at least one item to display (GTK_SENSITIVITY_AUTO).
823 	 * Since 2.14
824 	 * Params:
825 	 * sensitivity = specify the sensitivity of the dropdown button
826 	 */
827 	public void setButtonSensitivity(GtkSensitivityType sensitivity)
828 	{
829 		// void gtk_combo_box_set_button_sensitivity  (GtkComboBox *combo_box,  GtkSensitivityType sensitivity);
830 		gtk_combo_box_set_button_sensitivity(gtkComboBox, sensitivity);
831 	}
832 	
833 	/**
834 	 * Returns whether the combo box sets the dropdown button
835 	 * sensitive or not when there are no items in the model.
836 	 * Since 2.14
837 	 * Returns: GTK_SENSITIVITY_ON if the dropdown button is sensitive when the model is empty, GTK_SENSITIVITY_OFF if the button is always insensitive or GTK_SENSITIVITY_AUTO if it is only sensitive as long as the model has one item to be selected.
838 	 */
839 	public GtkSensitivityType getButtonSensitivity()
840 	{
841 		// GtkSensitivityType gtk_combo_box_get_button_sensitivity  (GtkComboBox *combo_box);
842 		return gtk_combo_box_get_button_sensitivity(gtkComboBox);
843 	}
844 	
845 	/**
846 	 * Returns whether the combo box has an entry.
847 	 * Since 2.24
848 	 * Returns: whether there is an entry in combo_box.
849 	 */
850 	public int getHasEntry()
851 	{
852 		// gboolean gtk_combo_box_get_has_entry (GtkComboBox *combo_box);
853 		return gtk_combo_box_get_has_entry(gtkComboBox);
854 	}
855 	
856 	/**
857 	 * Sets the model column which combo_box should use to get strings from
858 	 * to be text_column. The column text_column in the model of combo_box
859 	 * must be of type G_TYPE_STRING.
860 	 * This is only relevant if combo_box has been created with
861 	 * "has-entry" as TRUE.
862 	 * Since 2.24
863 	 * Params:
864 	 * textColumn = A column in model to get the strings from for
865 	 * the internal entry
866 	 */
867 	public void setEntryTextColumn(int textColumn)
868 	{
869 		// void gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box,  gint text_column);
870 		gtk_combo_box_set_entry_text_column(gtkComboBox, textColumn);
871 	}
872 	
873 	/**
874 	 * Returns the column which combo_box is using to get the strings
875 	 * from to display in the internal entry.
876 	 * Since 2.24
877 	 * Returns: A column in the data source model of combo_box.
878 	 */
879 	public int getEntryTextColumn()
880 	{
881 		// gint gtk_combo_box_get_entry_text_column (GtkComboBox *combo_box);
882 		return gtk_combo_box_get_entry_text_column(gtkComboBox);
883 	}
884 	
885 	/**
886 	 * Specifies whether the popup's width should be a fixed width
887 	 * matching the allocated width of the combo box.
888 	 * Params:
889 	 * fixed = whether to use a fixed popup width
890 	 * Since 3.0
891 	 */
892 	public void setPopupFixedWidth(int fixed)
893 	{
894 		// void gtk_combo_box_set_popup_fixed_width (GtkComboBox *combo_box,  gboolean fixed);
895 		gtk_combo_box_set_popup_fixed_width(gtkComboBox, fixed);
896 	}
897 	
898 	/**
899 	 * Gets whether the popup uses a fixed width matching
900 	 * the allocated width of the combo box.
901 	 * Returns: TRUE if the popup uses a fixed width Since 3.0
902 	 */
903 	public int getPopupFixedWidth()
904 	{
905 		// gboolean gtk_combo_box_get_popup_fixed_width (GtkComboBox *combo_box);
906 		return gtk_combo_box_get_popup_fixed_width(gtkComboBox);
907 	}
908 }