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