eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
7b7dab2005-10-07Henrik Grubbström (Grubba) not gtk_beta;
3d76632005-11-03Lance Dillon 
1a05542005-07-28Martin Nilsson class GDK2.PixbufAnimation; inherit G.Object; //! The GdkPixbufAnimation object. Holds animations, like gifs. void create(string filename) //! Create a new PixbufAnimation. {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_not_inited(); pgtk2_verify_setup();
1a05542005-07-28Martin Nilsson  { const char *filename;
3d76632005-11-03Lance Dillon  GdkPixbufAnimation *gpa;
1a05542005-07-28Martin Nilsson  GError *error=NULL;
96f5f42018-08-05Martin Nilsson  get_all_args(NULL,args,"%s",&filename);
3d76632005-11-03Lance Dillon  gpa=gdk_pixbuf_animation_new_from_file(filename,&error);
ba9e802006-02-27Martin Stjernholm  pgtk2_pop_n_elems(args);
3d76632005-11-03Lance Dillon  if (gpa==NULL)
1a05542005-07-28Martin Nilsson  Pike_error("Unable to load file %s: %s\n",filename,error->message);
3d76632005-11-03Lance Dillon  THIS->obj=G_OBJECT(gpa);
1a05542005-07-28Martin Nilsson  }
ba9e802006-02-27Martin Stjernholm  pgtk2__init_this_object();
1a05542005-07-28Martin Nilsson } int get_width(); //! Returns the width of the bounding box. int get_height(); //! Returns the height of the bounding box. GDK2.PixbufAnimationIter get_iter() //! Get an iterator for displaying an animation. The iterator provides the //! frames that should be displayed at a given time. //! <p> //! Returns the beginning of the animation. Afterwards you should probably //! immediately display the pixbuf return by //! GDK2.PixbufAnimationIter->get_pixbuf(). Then, you should install a timeout //! or by some other mechanism ensure that you'll update the image after //! GDK2.PixbufAnimationIter->get_delay_time() milliseconds. Each time the //! image is updated, you should reinstall the timeout with the new, possibly //! changed delay time. //! <p> //! To update the image, call GDK2.PixbufAnimationIter->advance(). {
ba9e802006-02-27Martin Stjernholm  pgtk2_verify_inited(); pgtk2_pop_n_elems(args);
1a05542005-07-28Martin Nilsson  { GdkPixbufAnimationIter *iter; iter=gdk_pixbuf_animation_get_iter(GDK_PIXBUF_ANIMATION(THIS->obj),NULL);
2edd4f2008-01-30Per Hedbor  push_gobject(iter);
1a05542005-07-28Martin Nilsson  } } int is_static_image(); //! If the file turns out to be a plain, unanimated image, this function will //! return true. Use get_static_image() to retrieve the image. GDK2.Pixbuf get_static_image(); //! If an animation is really just a plain image (has only one frame), this //! function returns that image. If the animation is an animation, this //! function returns reasonable thing to display as a static unanimated image, //! which might be the first frame, or something more sophisticated. If an //! animation hasn't loaded any frames yet, this function will return 0.
7b7dab2005-10-07Henrik Grubbström (Grubba) endnot;