/* Swfdec
 * Copyright (C) 2006-2007 Benjamin Otte <otte@gnome.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
 * Boston, MA  02110-1301  USA
 */

#ifndef _SWFDEC_FB_WIDGET_H_
#define _SWFDEC_FB_WIDGET_H_

#include <swfdec/swfdec.h>
#include <cairo.h>

G_BEGIN_DECLS

typedef struct _SwfdecFbWidget SwfdecFbWidget;
typedef struct _SwfdecFbWidgetClass SwfdecFbWidgetClass;
typedef struct _SwfdecFbWidgetPrivate SwfdecFbWidgetPrivate;

#define SWFDEC_TYPE_FB_WIDGET                    (swfdec_fb_widget_get_type())
#define SWFDEC_IS_FB_WIDGET(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_FB_WIDGET))
#define SWFDEC_IS_FB_WIDGET_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_FB_WIDGET))
#define SWFDEC_FB_WIDGET(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_FB_WIDGET, SwfdecFbWidget))
#define SWFDEC_FB_WIDGET_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_FB_WIDGET, SwfdecFbWidgetClass))

struct _SwfdecFbWidget
{
  GObject	object;
  /*< private >*/
  SwfdecFbWidgetPrivate *	priv;
};

struct _SwfdecFbWidgetClass
{
  GObjectClass	object_class;
};

GType		swfdec_fb_widget_get_type		(void);

GObject *	swfdec_fb_widget_new			(SwfdecPlayer *		player);
GObject *	swfdec_fb_widget_new_fullscreen	(SwfdecPlayer *		player);
GObject *	swfdec_fb_widget_new_withposition	(SwfdecPlayer *		player,
						int xpos, int ypos, int width, int height);
void		swfdec_fb_widget_set_player		(SwfdecFbWidget *	widget,
							 SwfdecPlayer *		player);
SwfdecPlayer *	
			swfdec_fb_widget_get_player		(SwfdecFbWidget *	widget);
void		swfdec_fb_widget_set_renderer		(SwfdecFbWidget *	widget,
							 cairo_surface_type_t	renderer);
void		swfdec_fb_widget_unset_renderer	(SwfdecFbWidget *      widget);
cairo_surface_type_t
			swfdec_fb_widget_get_renderer		(SwfdecFbWidget *	widget);
gboolean	swfdec_fb_widget_uses_renderer		(SwfdecFbWidget *	widget);
void		swfdec_fb_widget_set_interactive	(SwfdecFbWidget *	widget,
							 gboolean		interactive);
gboolean	swfdec_fb_widget_get_interactive	(SwfdecFbWidget *	widget);
void        swfdec_fb_widget_get_position      (SwfdecFbWidget*     widget,
                         int *          xpos,
                         int *          ypos);
void        swfdec_fb_widget_set_position      (SwfdecFbWidget*     widget,
                         int            xpos,
                         int            ypos);
void        swfdec_fb_widget_resize			   (SwfdecFbWidget*     widget,
                         int            x,
                         int            y,
                         int            w,
                         int            h);
void		swfdec_fb_widget_emit_invalidate (SwfdecFbWidget *fbwidget,
        				 const SwfdecRectangle *rect, 
						 guint n_rects);
void		swfdec_fb_widget_emit_key (SwfdecFbWidget *fbwidget, 
						 guint code, guint keyval, gboolean down);
void		swfdec_fb_widget_emit_mouse (SwfdecFbWidget *fbwidget, 
						 double x, double y, int button);

G_END_DECLS
#endif
