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 module gtk.TearoffMenuItem;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.MenuItem;
30 private import gtk.Widget;
31 private import gtkc.gtk;
32 public  import gtkc.gtktypes;
33 
34 
35 /**
36  * A #GtkTearoffMenuItem is a special #GtkMenuItem which is used to
37  * tear off and reattach its menu.
38  * 
39  * When its menu is shown normally, the #GtkTearoffMenuItem is drawn as a
40  * dotted line indicating that the menu can be torn off.  Activating it
41  * causes its menu to be torn off and displayed in its own window
42  * as a tearoff menu.
43  * 
44  * When its menu is shown as a tearoff menu, the #GtkTearoffMenuItem is drawn
45  * as a dotted line which has a left pointing arrow graphic indicating that
46  * the tearoff menu can be reattached.  Activating it will erase the tearoff
47  * menu window.
48  * 
49  * > #GtkTearoffMenuItem is deprecated and should not be used in newly
50  * > written code. Menus are not meant to be torn around.
51  */
52 public class TearoffMenuItem : MenuItem
53 {
54 	/** the main Gtk struct */
55 	protected GtkTearoffMenuItem* gtkTearoffMenuItem;
56 
57 	/** Get the main Gtk struct */
58 	public GtkTearoffMenuItem* getTearoffMenuItemStruct(bool transferOwnership = false)
59 	{
60 		if (transferOwnership)
61 			ownedRef = false;
62 		return gtkTearoffMenuItem;
63 	}
64 
65 	/** the main Gtk struct as a void* */
66 	protected override void* getStruct()
67 	{
68 		return cast(void*)gtkTearoffMenuItem;
69 	}
70 
71 	protected override void setStruct(GObject* obj)
72 	{
73 		gtkTearoffMenuItem = cast(GtkTearoffMenuItem*)obj;
74 		super.setStruct(obj);
75 	}
76 
77 	/**
78 	 * Sets our main struct and passes it to the parent class.
79 	 */
80 	public this (GtkTearoffMenuItem* gtkTearoffMenuItem, bool ownedRef = false)
81 	{
82 		this.gtkTearoffMenuItem = gtkTearoffMenuItem;
83 		super(cast(GtkMenuItem*)gtkTearoffMenuItem, ownedRef);
84 	}
85 
86 
87 	/** */
88 	public static GType getType()
89 	{
90 		return gtk_tearoff_menu_item_get_type();
91 	}
92 
93 	/**
94 	 * Creates a new #GtkTearoffMenuItem.
95 	 *
96 	 * Deprecated: #GtkTearoffMenuItem is deprecated and should not be
97 	 * used in newly written code.
98 	 *
99 	 * Returns: a new #GtkTearoffMenuItem.
100 	 *
101 	 * Throws: ConstructionException GTK+ fails to create the object.
102 	 */
103 	public this()
104 	{
105 		auto p = gtk_tearoff_menu_item_new();
106 		
107 		if(p is null)
108 		{
109 			throw new ConstructionException("null returned by new");
110 		}
111 		
112 		this(cast(GtkTearoffMenuItem*) p);
113 	}
114 }