Re: Fwd: regarding animated mng support in gtk for directfb

2009-03-10 Thread Sven Neumann
Hi,

On Sat, 2009-03-07 at 10:37 +0530, Monil Parmar wrote:

 I am using GTK-2.12.12.
 I have compiled mng lib from http://sourceforge.net/projects/libmng/ .
 The test application, I have used for  X11 with linux.mng is at
 libmng-1.0.10/contrib/gcc/gtm-mng-view . 
 gtk-mng-view is a sample gtk based application to view mng.
 I could able to see linux.mng with animation effect.
 
 But when I try to run the same source code(gtk-mng-view) for
 GTK/DirectFB only 1st frame it shows.

I've had a look at this and the problem is clearly in the gtk-mng-view
code. The example code there draws outside the expose handler. This is
something that you should never do. It may work for GTK-X11 if you are
lucky, but it's not supported and it definitely does not work if you
using the DirectFB backend. Simply replace the function
mng_refresh_callback() in gtk-mng-view.c with the following code and it
will work just fine:

static mng_bool
mng_refresh_callback (mng_handle mng_h,
  mng_uint32 x,
  mng_uint32 y,
  mng_uint32 width,
  mng_uint32 height)
{
  gtk_widget_queue_draw_area (GTK_WIDGET (mng_get_userdata (mng_h)),
  x, y, width, height);

  return MNG_TRUE;
}


Sven



___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Fwd: regarding animated mng support in gtk for directfb

2009-03-10 Thread Dominic Lachowicz
Also, you could write a GdkPixbufLoader plugin, so that all GTK+ apps
can view MNGs. It shouldn't be too difficult.

On Tue, Mar 10, 2009 at 11:52 AM, Sven Neumann s...@gimp.org wrote:
 Hi,

 On Sat, 2009-03-07 at 10:37 +0530, Monil Parmar wrote:

 I am using GTK-2.12.12.
 I have compiled mng lib from http://sourceforge.net/projects/libmng/ .
 The test application, I have used for  X11 with linux.mng is at
 libmng-1.0.10/contrib/gcc/gtm-mng-view .
 gtk-mng-view is a sample gtk based application to view mng.
 I could able to see linux.mng with animation effect.

 But when I try to run the same source code(gtk-mng-view) for
 GTK/DirectFB only 1st frame it shows.

 I've had a look at this and the problem is clearly in the gtk-mng-view
 code. The example code there draws outside the expose handler. This is
 something that you should never do. It may work for GTK-X11 if you are
 lucky, but it's not supported and it definitely does not work if you
 using the DirectFB backend. Simply replace the function
 mng_refresh_callback() in gtk-mng-view.c with the following code and it
 will work just fine:

 static mng_bool
 mng_refresh_callback (mng_handle mng_h,
                      mng_uint32 x,
                      mng_uint32 y,
                      mng_uint32 width,
                      mng_uint32 height)
 {
  gtk_widget_queue_draw_area (GTK_WIDGET (mng_get_userdata (mng_h)),
                              x, y, width, height);

  return MNG_TRUE;
 }


 Sven



 ___
 gtk-devel-list mailing list
 gtk-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-devel-list




-- 
Mediocrity knows nothing higher than itself; but talent instantly
recognizes genius.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Fwd: regarding animated mng support in gtk for directfb

2009-03-10 Thread Matthias Clasen
On Tue, Mar 10, 2009 at 12:56 PM, Dominic Lachowicz
domlachow...@gmail.com wrote:
 Also, you could write a GdkPixbufLoader plugin, so that all GTK+ apps
 can view MNGs. It shouldn't be too difficult.

It actually is difficult, because libmng doesn't expose its
functionality in a way that easily maps to
GdkPixbufAnimation/GdkPixbufAnimationIter.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list