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  * Conversion parameters:
26  * inFile  = 
27  * outPack = gdkpixbuf
28  * outFile = PixbufSimpleAnimation
29  * strct   = GdkPixbufSimpleAnim
30  * realStrct=
31  * ctorStrct=
32  * clss    = PixbufSimpleAnimation
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = GObject
38  * implements:
39  * prefixes:
40  * 	- gdk_pixbuf_simple_anim_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gdk.Pixbuf
47  * structWrap:
48  * 	- GdkPixbuf* -> Pixbuf
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gdkpixbuf.PixbufSimpleAnimation;
55 
56 public  import gtkc.gdkpixbuftypes;
57 
58 private import gtkc.gdkpixbuf;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 
63 private import gdk.Pixbuf;
64 
65 
66 
67 private import gobject.ObjectG;
68 
69 /**
70  * Description
71  * The gdk-pixbuf; library provides a simple mechanism to load and represent
72  * animations. An animation is conceptually a series of frames to be displayed
73  * over time. Each frame is the same size. The animation may not be represented
74  * as a series of frames internally; for example, it may be stored as a
75  * sprite and instructions for moving the sprite around a background. To display
76  * an animation you don't need to understand its representation, however; you just
77  * ask gdk-pixbuf; what should be displayed at a given point in time.
78  */
79 public class PixbufSimpleAnimation : ObjectG
80 {
81 	
82 	/** the main Gtk struct */
83 	protected GdkPixbufSimpleAnim* gdkPixbufSimpleAnim;
84 	
85 	
86 	public GdkPixbufSimpleAnim* getPixbufSimpleAnimationStruct()
87 	{
88 		return gdkPixbufSimpleAnim;
89 	}
90 	
91 	
92 	/** the main Gtk struct as a void* */
93 	protected override void* getStruct()
94 	{
95 		return cast(void*)gdkPixbufSimpleAnim;
96 	}
97 	
98 	/**
99 	 * Sets our main struct and passes it to the parent class
100 	 */
101 	public this (GdkPixbufSimpleAnim* gdkPixbufSimpleAnim)
102 	{
103 		super(cast(GObject*)gdkPixbufSimpleAnim);
104 		this.gdkPixbufSimpleAnim = gdkPixbufSimpleAnim;
105 	}
106 	
107 	protected override void setStruct(GObject* obj)
108 	{
109 		super.setStruct(obj);
110 		gdkPixbufSimpleAnim = cast(GdkPixbufSimpleAnim*)obj;
111 	}
112 	
113 	/**
114 	 */
115 	
116 	/**
117 	 * Creates a new, empty animation.
118 	 * Since 2.8
119 	 * Params:
120 	 * width = the width of the animation
121 	 * height = the height of the animation
122 	 * rate = the speed of the animation, in frames per second
123 	 * Throws: ConstructionException GTK+ fails to create the object.
124 	 */
125 	public this (int width, int height, float rate)
126 	{
127 		// GdkPixbufSimpleAnim * gdk_pixbuf_simple_anim_new (gint width,  gint height,  gfloat rate);
128 		auto p = gdk_pixbuf_simple_anim_new(width, height, rate);
129 		if(p is null)
130 		{
131 			throw new ConstructionException("null returned by gdk_pixbuf_simple_anim_new(width, height, rate)");
132 		}
133 		this(cast(GdkPixbufSimpleAnim*) p);
134 	}
135 	
136 	/**
137 	 * Adds a new frame to animation. The pixbuf must
138 	 * have the dimensions specified when the animation
139 	 * was constructed.
140 	 * Since 2.8
141 	 * Params:
142 	 * pixbuf = the pixbuf to add
143 	 */
144 	public void addFrame(Pixbuf pixbuf)
145 	{
146 		// void gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation,  GdkPixbuf *pixbuf);
147 		gdk_pixbuf_simple_anim_add_frame(gdkPixbufSimpleAnim, (pixbuf is null) ? null : pixbuf.getPixbufStruct());
148 	}
149 	
150 	/**
151 	 * Sets whether animation should loop indefinitely when it reaches the end.
152 	 * Since 2.18
153 	 * Params:
154 	 * loop = whether to loop the animation
155 	 */
156 	public void setLoop(int loop)
157 	{
158 		// void gdk_pixbuf_simple_anim_set_loop (GdkPixbufSimpleAnim *animation,  gboolean loop);
159 		gdk_pixbuf_simple_anim_set_loop(gdkPixbufSimpleAnim, loop);
160 	}
161 	
162 	/**
163 	 * Gets whether animation should loop indefinitely when it reaches the end.
164 	 * Since 2.18
165 	 * Returns: TRUE if the animation loops forever, FALSE otherwise
166 	 */
167 	public int getLoop()
168 	{
169 		// gboolean gdk_pixbuf_simple_anim_get_loop (GdkPixbufSimpleAnim *animation);
170 		return gdk_pixbuf_simple_anim_get_loop(gdkPixbufSimpleAnim);
171 	}
172 }