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 private import gdk.Pixbuf; 63 64 65 private import gobject.ObjectG; 66 67 /** 68 * The GdkPixBuf library provides a simple mechanism to load and 69 * represent animations. An animation is conceptually a series of 70 * frames to be displayed over time. The animation may not be 71 * represented as a series of frames internally; for example, it may 72 * be stored as a sprite and instructions for moving the sprite around 73 * a background. To display an animation you don't need to understand 74 * its representation, however; you just ask GdkPixBuf what should 75 * be displayed at a given point in time. 76 */ 77 public class PixbufSimpleAnimation : ObjectG 78 { 79 80 /** the main Gtk struct */ 81 protected GdkPixbufSimpleAnim* gdkPixbufSimpleAnim; 82 83 84 /** Get the main Gtk struct */ 85 public GdkPixbufSimpleAnim* getPixbufSimpleAnimationStruct() 86 { 87 return gdkPixbufSimpleAnim; 88 } 89 90 91 /** the main Gtk struct as a void* */ 92 protected override void* getStruct() 93 { 94 return cast(void*)gdkPixbufSimpleAnim; 95 } 96 97 /** 98 * Sets our main struct and passes it to the parent class 99 */ 100 public this (GdkPixbufSimpleAnim* gdkPixbufSimpleAnim) 101 { 102 super(cast(GObject*)gdkPixbufSimpleAnim); 103 this.gdkPixbufSimpleAnim = gdkPixbufSimpleAnim; 104 } 105 106 protected override void setStruct(GObject* obj) 107 { 108 super.setStruct(obj); 109 gdkPixbufSimpleAnim = cast(GdkPixbufSimpleAnim*)obj; 110 } 111 112 /** 113 */ 114 115 /** 116 * Creates a new, empty animation. 117 * Since 2.8 118 * Params: 119 * width = the width of the animation 120 * height = the height of the animation 121 * rate = the speed of the animation, in frames per second 122 * Throws: ConstructionException GTK+ fails to create the object. 123 */ 124 public this (int width, int height, float rate) 125 { 126 // GdkPixbufSimpleAnim * gdk_pixbuf_simple_anim_new (gint width, gint height, gfloat rate); 127 auto p = gdk_pixbuf_simple_anim_new(width, height, rate); 128 if(p is null) 129 { 130 throw new ConstructionException("null returned by gdk_pixbuf_simple_anim_new(width, height, rate)"); 131 } 132 this(cast(GdkPixbufSimpleAnim*) p); 133 } 134 135 /** 136 * Adds a new frame to animation. The pixbuf must 137 * have the dimensions specified when the animation 138 * was constructed. 139 * Since 2.8 140 * Params: 141 * pixbuf = the pixbuf to add 142 */ 143 public void addFrame(Pixbuf pixbuf) 144 { 145 // void gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation, GdkPixbuf *pixbuf); 146 gdk_pixbuf_simple_anim_add_frame(gdkPixbufSimpleAnim, (pixbuf is null) ? null : pixbuf.getPixbufStruct()); 147 } 148 149 /** 150 * Sets whether animation should loop indefinitely when it reaches the end. 151 * Since 2.18 152 * Params: 153 * loop = whether to loop the animation 154 */ 155 public void setLoop(int loop) 156 { 157 // void gdk_pixbuf_simple_anim_set_loop (GdkPixbufSimpleAnim *animation, gboolean loop); 158 gdk_pixbuf_simple_anim_set_loop(gdkPixbufSimpleAnim, loop); 159 } 160 161 /** 162 * Gets whether animation should loop indefinitely when it reaches the end. 163 * Since 2.18 164 * Returns: TRUE if the animation loops forever, FALSE otherwise 165 */ 166 public int getLoop() 167 { 168 // gboolean gdk_pixbuf_simple_anim_get_loop (GdkPixbufSimpleAnim *animation); 169 return gdk_pixbuf_simple_anim_get_loop(gdkPixbufSimpleAnim); 170 } 171 }