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 	/**
78 	 * Sets our main struct and passes it to the parent class.
79 	 */
80 	public this (GtkArrow* gtkArrow, bool ownedRef = false)
81 	{
82 		this.gtkArrow = gtkArrow;
83 		super(cast(GtkMisc*)gtkArrow, ownedRef);
84 	}
85 
86 
87 	/** */
88 	public static GType getType()
89 	{
90 		return gtk_arrow_get_type();
91 	}
92 
93 	/**
94 	 * Creates a new #GtkArrow widget.
95 	 *
96 	 * Deprecated: Use a #GtkImage with a suitable icon.
97 	 *
98 	 * Params:
99 	 *     arrowType = a valid #GtkArrowType.
100 	 *     shadowType = a valid #GtkShadowType.
101 	 *
102 	 * Returns: the new #GtkArrow widget.
103 	 *
104 	 * Throws: ConstructionException GTK+ fails to create the object.
105 	 */
106 	public this(GtkArrowType arrowType, GtkShadowType shadowType)
107 	{
108 		auto p = gtk_arrow_new(arrowType, shadowType);
109 
110 		if(p is null)
111 		{
112 			throw new ConstructionException("null returned by new");
113 		}
114 
115 		this(cast(GtkArrow*) p);
116 	}
117 
118 	/**
119 	 * Sets the direction and style of the #GtkArrow, @arrow.
120 	 *
121 	 * Deprecated: Use a #GtkImage with a suitable icon.
122 	 *
123 	 * Params:
124 	 *     arrowType = a valid #GtkArrowType.
125 	 *     shadowType = a valid #GtkShadowType.
126 	 */
127 	public void set(GtkArrowType arrowType, GtkShadowType shadowType)
128 	{
129 		gtk_arrow_set(gtkArrow, arrowType, shadowType);
130 	}
131 }