gtk-mng-view.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Toy widget for GTK+ for displaying MNG animations.
  2. *
  3. * Copyright (C) 2000 The Free Software Foundation
  4. *
  5. * Author(s): Volodymyr Babin <vb :at: dwuj.ichf.edu.pl>
  6. *
  7. * This code is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. */
  22. #ifndef __GTK_MNG_VIEW_H__
  23. #define __GTK_MNG_VIEW_H__
  24. #include <libmng.h>
  25. #include <gtk/gtkwidget.h>
  26. #define GTK_MNG_VIEW_TYPE (gtk_mng_view_get_type ())
  27. #define GTK_MNG_VIEW(o) (GTK_CHECK_CAST ((o), GTK_MNG_VIEW_TYPE, GtkMngView))
  28. #define GTK_MNG_VIEW_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GTK_MNG_VIEW_TYPE, GtkMngViewClass))
  29. #define IS_GTK_MNG_VIEW(o) (GTK_CHECK_TYPE ((o), GTK_MNG_VIEW_TYPE))
  30. #define IS_GTK_MNG_VIEW_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GTK_MNG_VIEW_TYPE))
  31. typedef struct _GtkMngView GtkMngView;
  32. typedef struct _GtkMngViewClass GtkMngViewClass;
  33. struct _GtkMngView
  34. {
  35. GtkWidget widget;
  36. /* private */
  37. GTimer * timer;
  38. guint timeout_ID;
  39. guint width;
  40. guint height;
  41. mng_handle MNG_handle;
  42. guchar * MNG_drawing_buffer;
  43. guchar * mng_food;
  44. guint bytes_to_eat;
  45. guint bytes_eaten;
  46. };
  47. struct _GtkMngViewClass
  48. {
  49. GtkWidgetClass klass;
  50. };
  51. GtkType gtk_mng_view_get_type (void);
  52. GtkWidget * gtk_mng_view_new (void);
  53. /* returns !FALSE on success */
  54. gboolean gtk_mng_view_load_mng_from_memory (GtkMngView *, guchar *, guint);
  55. #endif /* __GTK_MNG_VIEW_H__ */