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 gsk.InsetShadowNode; 26 27 private import gdk.RGBA; 28 private import glib.ConstructionException; 29 private import gobject.ObjectG; 30 private import gsk.RenderNode; 31 private import gsk.RoundedRect; 32 private import gsk.c.functions; 33 public import gsk.c.types; 34 35 36 /** 37 * A render node for an inset shadow. 38 */ 39 public class InsetShadowNode : RenderNode 40 { 41 /** the main Gtk struct */ 42 protected GskInsetShadowNode* gskInsetShadowNode; 43 44 /** Get the main Gtk struct */ 45 public GskInsetShadowNode* getInsetShadowNodeStruct(bool transferOwnership = false) 46 { 47 if (transferOwnership) 48 ownedRef = false; 49 return gskInsetShadowNode; 50 } 51 52 /** the main Gtk struct as a void* */ 53 protected override void* getStruct() 54 { 55 return cast(void*)gskInsetShadowNode; 56 } 57 58 /** 59 * Sets our main struct and passes it to the parent class. 60 */ 61 public this (GskInsetShadowNode* gskInsetShadowNode, bool ownedRef = false) 62 { 63 this.gskInsetShadowNode = gskInsetShadowNode; 64 super(cast(GskRenderNode*)gskInsetShadowNode, ownedRef); 65 } 66 67 68 /** */ 69 public static GType getType() 70 { 71 return gsk_inset_shadow_node_get_type(); 72 } 73 74 /** 75 * Creates a `GskRenderNode` that will render an inset shadow 76 * into the box given by @outline. 77 * 78 * Params: 79 * outline = outline of the region containing the shadow 80 * color = color of the shadow 81 * dx = horizontal offset of shadow 82 * dy = vertical offset of shadow 83 * spread = how far the shadow spreads towards the inside 84 * blurRadius = how much blur to apply to the shadow 85 * 86 * Returns: A new `GskRenderNode` 87 * 88 * Throws: ConstructionException GTK+ fails to create the object. 89 */ 90 public this(RoundedRect outline, RGBA color, float dx, float dy, float spread, float blurRadius) 91 { 92 auto __p = gsk_inset_shadow_node_new((outline is null) ? null : outline.getRoundedRectStruct(), (color is null) ? null : color.getRGBAStruct(), dx, dy, spread, blurRadius); 93 94 if(__p is null) 95 { 96 throw new ConstructionException("null returned by new"); 97 } 98 99 this(cast(GskInsetShadowNode*) __p); 100 } 101 102 /** 103 * Retrieves the blur radius to apply to the shadow. 104 * 105 * Returns: the blur radius, in pixels 106 */ 107 public float getBlurRadius() 108 { 109 return gsk_inset_shadow_node_get_blur_radius(cast(GskRenderNode*)gskInsetShadowNode); 110 } 111 112 /** 113 * Retrieves the color of the inset shadow. 114 * 115 * Returns: the color of the shadow 116 */ 117 public RGBA getColor() 118 { 119 auto __p = gsk_inset_shadow_node_get_color(cast(GskRenderNode*)gskInsetShadowNode); 120 121 if(__p is null) 122 { 123 return null; 124 } 125 126 return ObjectG.getDObject!(RGBA)(cast(GdkRGBA*) __p); 127 } 128 129 /** 130 * Retrieves the horizontal offset of the inset shadow. 131 * 132 * Returns: an offset, in pixels 133 */ 134 public float getDx() 135 { 136 return gsk_inset_shadow_node_get_dx(cast(GskRenderNode*)gskInsetShadowNode); 137 } 138 139 /** 140 * Retrieves the vertical offset of the inset shadow. 141 * 142 * Returns: an offset, in pixels 143 */ 144 public float getDy() 145 { 146 return gsk_inset_shadow_node_get_dy(cast(GskRenderNode*)gskInsetShadowNode); 147 } 148 149 /** 150 * Retrieves the outline rectangle of the inset shadow. 151 * 152 * Returns: a rounded rectangle 153 */ 154 public RoundedRect getOutline() 155 { 156 auto __p = gsk_inset_shadow_node_get_outline(cast(GskRenderNode*)gskInsetShadowNode); 157 158 if(__p is null) 159 { 160 return null; 161 } 162 163 return ObjectG.getDObject!(RoundedRect)(cast(GskRoundedRect*) __p); 164 } 165 166 /** 167 * Retrieves how much the shadow spreads inwards. 168 * 169 * Returns: the size of the shadow, in pixels 170 */ 171 public float getSpread() 172 { 173 return gsk_inset_shadow_node_get_spread(cast(GskRenderNode*)gskInsetShadowNode); 174 } 175 }