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