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.Arrow;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.Misc;
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  * GtkArrow should be used to draw simple arrows that need to point in
38  * one of the four cardinal directions (up, down, left, or right).  The
39  * style of the arrow can be one of shadow in, shadow out, etched in, or
40  * etched out.  Note that these directions and style types may be
41  * amended in versions of GTK+ to come.
42  * 
43  * GtkArrow will fill any space alloted to it, but since it is inherited
44  * from #GtkMisc, it can be padded and/or aligned, to fill exactly the
45  * space the programmer desires.
46  * 
47  * Arrows are created with a call to gtk_arrow_new().  The direction or
48  * style of an arrow can be changed after creation by using gtk_arrow_set().
49  * 
50  * GtkArrow has been deprecated; you can simply use a #GtkImage with a
51  * suitable icon name, such as “pan-down-symbolic“. When replacing
52  * GtkArrow by an image, pay attention to the fact that GtkArrow is
53  * doing automatic flipping between #GTK_ARROW_LEFT and #GTK_ARROW_RIGHT,
54  * depending on the text direction. To get the same effect with an image,
55  * use the icon names “pan-start-symbolic“ and “pan-end-symbolic“, which
56  * react to the text direction.
57  */
58 public class Arrow : Misc
59 {
60 	/** the main Gtk struct */
61 	protected GtkArrow* gtkArrow;
62 
63 	/** Get the main Gtk struct */
64 	public GtkArrow* getArrowStruct(bool transferOwnership = false)
65 	{
66 		if (transferOwnership)
67 			ownedRef = false;
68 		return gtkArrow;
69 	}
70 
71 	/** the main Gtk struct as a void* */
72 	protected override void* getStruct()
73 	{
74 		return cast(void*)gtkArrow;
75 	}
76 
77 	protected override void setStruct(GObject* obj)
78 	{
79 		gtkArrow = cast(GtkArrow*)obj;
80 		super.setStruct(obj);
81 	}
82 
83 	/**
84 	 * Sets our main struct and passes it to the parent class.
85 	 */
86 	public this (GtkArrow* gtkArrow, bool ownedRef = false)
87 	{
88 		this.gtkArrow = gtkArrow;
89 		super(cast(GtkMisc*)gtkArrow, ownedRef);
90 	}
91 
92 
93 	/** */
94 	public static GType getType()
95 	{
96 		return gtk_arrow_get_type();
97 	}
98 
99 	/**
100 	 * Creates a new #GtkArrow widget.
101 	 *
102 	 * Deprecated: Use a #GtkImage with a suitable icon.
103 	 *
104 	 * Params:
105 	 *     arrowType = a valid #GtkArrowType.
106 	 *     shadowType = a valid #GtkShadowType.
107 	 *
108 	 * Returns: the new #GtkArrow widget.
109 	 *
110 	 * Throws: ConstructionException GTK+ fails to create the object.
111 	 */
112 	public this(GtkArrowType arrowType, GtkShadowType shadowType)
113 	{
114 		auto p = gtk_arrow_new(arrowType, shadowType);
115 
116 		if(p is null)
117 		{
118 			throw new ConstructionException("null returned by new");
119 		}
120 
121 		this(cast(GtkArrow*) p);
122 	}
123 
124 	/**
125 	 * Sets the direction and style of the #GtkArrow, @arrow.
126 	 *
127 	 * Deprecated: Use a #GtkImage with a suitable icon.
128 	 *
129 	 * Params:
130 	 *     arrowType = a valid #GtkArrowType.
131 	 *     shadowType = a valid #GtkShadowType.
132 	 */
133 	public void set(GtkArrowType arrowType, GtkShadowType shadowType)
134 	{
135 		gtk_arrow_set(gtkArrow, arrowType, shadowType);
136 	}
137 }