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.OutsetShadowNode;
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 outset shadow.
38  */
39 public class OutsetShadowNode : RenderNode
40 {
41 	/** the main Gtk struct */
42 	protected GskOutsetShadowNode* gskOutsetShadowNode;
43 
44 	/** Get the main Gtk struct */
45 	public GskOutsetShadowNode* getOutsetShadowNodeStruct(bool transferOwnership = false)
46 	{
47 		if (transferOwnership)
48 			ownedRef = false;
49 		return gskOutsetShadowNode;
50 	}
51 
52 	/** the main Gtk struct as a void* */
53 	protected override void* getStruct()
54 	{
55 		return cast(void*)gskOutsetShadowNode;
56 	}
57 
58 	/**
59 	 * Sets our main struct and passes it to the parent class.
60 	 */
61 	public this (GskOutsetShadowNode* gskOutsetShadowNode, bool ownedRef = false)
62 	{
63 		this.gskOutsetShadowNode = gskOutsetShadowNode;
64 		super(cast(GskRenderNode*)gskOutsetShadowNode, ownedRef);
65 	}
66 
67 
68 	/** */
69 	public static GType getType()
70 	{
71 		return gsk_outset_shadow_node_get_type();
72 	}
73 
74 	/**
75 	 * Creates a `GskRenderNode` that will render an outset shadow
76 	 * around the box given by @outline.
77 	 *
78 	 * Params:
79 	 *     outline = outline of the region surrounded by 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_outset_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(GskOutsetShadowNode*) __p);
100 	}
101 
102 	/**
103 	 * Retrieves the blur radius of the shadow.
104 	 *
105 	 * Returns: the blur radius, in pixels
106 	 */
107 	public float getBlurRadius()
108 	{
109 		return gsk_outset_shadow_node_get_blur_radius(cast(GskRenderNode*)gskOutsetShadowNode);
110 	}
111 
112 	/**
113 	 * Retrieves the color of the outset shadow.
114 	 *
115 	 * Returns: a color
116 	 */
117 	public RGBA getColor()
118 	{
119 		auto __p = gsk_outset_shadow_node_get_color(cast(GskRenderNode*)gskOutsetShadowNode);
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 outset shadow.
131 	 *
132 	 * Returns: an offset, in pixels
133 	 */
134 	public float getDx()
135 	{
136 		return gsk_outset_shadow_node_get_dx(cast(GskRenderNode*)gskOutsetShadowNode);
137 	}
138 
139 	/**
140 	 * Retrieves the vertical offset of the outset shadow.
141 	 *
142 	 * Returns: an offset, in pixels
143 	 */
144 	public float getDy()
145 	{
146 		return gsk_outset_shadow_node_get_dy(cast(GskRenderNode*)gskOutsetShadowNode);
147 	}
148 
149 	/**
150 	 * Retrieves the outline rectangle of the outset shadow.
151 	 *
152 	 * Returns: a rounded rectangle
153 	 */
154 	public RoundedRect getOutline()
155 	{
156 		auto __p = gsk_outset_shadow_node_get_outline(cast(GskRenderNode*)gskOutsetShadowNode);
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 outwards.
168 	 *
169 	 * Returns: the size of the shadow, in pixels
170 	 */
171 	public float getSpread()
172 	{
173 		return gsk_outset_shadow_node_get_spread(cast(GskRenderNode*)gskOutsetShadowNode);
174 	}
175 }