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