## SwfdecGtkWidget SwfdecGtkWidget — a GtkWidget for embedding SWF files |

## Synopsis

    #include <swfdec/swfdec-gtk.h>

                        SwfdecGtkWidget;
    GtkWidget*          swfdec_gtk_widget_new               (SwfdecPlayer *player);
    GtkWidget*          swfdec_gtk_widget_new_fullscreen    (SwfdecPlayer *player);
    SwfdecPlayer*       swfdec_gtk_widget_get_player        (SwfdecGtkWidget *widget);
    void                swfdec_gtk_widget_set_player        (SwfdecGtkWidget *widget,
                                                             SwfdecPlayer *player);
    gboolean            swfdec_gtk_widget_get_interactive   (SwfdecGtkWidget *widget);
    void                swfdec_gtk_widget_set_interactive   (SwfdecGtkWidget *widget,
                                                             gboolean interactive);
    cairo_surface_type_t swfdec_gtk_widget_get_renderer     (SwfdecGtkWidget *widget);
    gboolean            swfdec_gtk_widget_uses_renderer     (SwfdecGtkWidget *widget);
    void                swfdec_gtk_widget_set_renderer      (SwfdecGtkWidget *widget,
                                                             cairo_surface_type_t renderer);
    void                swfdec_gtk_widget_unset_renderer    (SwfdecGtkWidget *widget);
    guint               swfdec_gtk_keycode_from_hardware_keycode
                                                            (guint hardware_keycode);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----SwfdecGtkWidget

## Implemented Interfaces

SwfdecGtkWidget implements AtkImplementorIface and GtkBuildable.

## Properties

      "fullscreen-mode"          gboolean              : Write / Construct Only
      "interactive"              gboolean              : Read / Write
      "player"                   SwfdecPlayer*         : Read / Write / Construct
      "renderer"                 guint                 : Read / Write
      "renderer-set"             gboolean              : Read / Write

## Description

This is a widget for playing Flash movies rendered with Swfdec in a Gtk application. It supports a lot of advanced features, if you want to use them. If you don't want to use them and just want to embed a movie in your application, `swfdec_gtk_widget_new()` will probably be the only function you need.

`see_also`: SwfdecGtkPlayer

## Details

### SwfdecGtkWidget

    typedef struct _SwfdecGtkWidget SwfdecGtkWidget;

The structure for the Swfdec Gtk widget contains no public fields.

### swfdec_gtk_widget_new ()

    GtkWidget*          swfdec_gtk_widget_new               (SwfdecPlayer *player);

Creates a new SwfdecGtkWidget to display `player`.

`player` : | a SwfdecPlayer or `NULL`
Returns : | the new widget that displays `player`

### swfdec_gtk_widget_new_fullscreen ()

    GtkWidget*          swfdec_gtk_widget_new_fullscreen    (SwfdecPlayer *player);

Creates a new SwfdecGtkWidget to display `player` inside a fullscreen window.

`player` : | a SwfdecPlayer
Returns : | the new widget that displays `player` in fullscreen mode.

### swfdec_gtk_widget_get_player ()

    SwfdecPlayer*       swfdec_gtk_widget_get_player        (SwfdecGtkWidget *widget);

Gets the player that is currently played back in this `widget`.

`widget` : | a SwfdecGtkWidget
Returns : | the SwfdecPlayer or `NULL` if none

### swfdec_gtk_widget_set_player ()

    void                swfdec_gtk_widget_set_player        (SwfdecGtkWidget *widget,
                                                             SwfdecPlayer *player);

Sets the new player to display in `widget`.

`widget` : | a SwfdecGtkWidget
`player` : | the SwfdecPlayer to display or `NULL` for none

### swfdec_gtk_widget_get_interactive ()

    gboolean            swfdec_gtk_widget_get_interactive   (SwfdecGtkWidget *widget);

Queries if the `widget` is currently interactive. See `swfdec_gtk_widget_set_interactive()` for details.

`widget` : | a SwfdecGtkWidget
Returns : | `TRUE` if the widget is interactive, `FALSE` otherwise.

### swfdec_gtk_widget_set_interactive ()

    void                swfdec_gtk_widget_set_interactive   (SwfdecGtkWidget *widget,
                                                             gboolean interactive);

Sets the widget to be interactive or not. An interactive widget processes mouse and keyboard events, while a non-interactive widget does not care about user input. Widgets are interactive by default.

`widget` : | a SwfdecGtkWidget
`interactive` : | `TRUE` to make the widget interactive

### swfdec_gtk_widget_get_renderer ()

    cairo_surface_type_t swfdec_gtk_widget_get_renderer     (SwfdecGtkWidget *widget);

Gets the intermediate renderer that is or would be in use by `widget`. Use `swfdec_gtk_widget_uses_renderer()` to check if an intermediate renderer is in use. See `swfdec_gtk_widget_set_renderer()` for details.

`widget` : | a SwfdecGtkWidget
Returns : | the type of the intermediate renderer

### swfdec_gtk_widget_uses_renderer ()

    gboolean            swfdec_gtk_widget_uses_renderer     (SwfdecGtkWidget *widget);

Queries if an intermediate renderer set via `swfdec_gtk_widget_set_renderer()` is currently in use.

`widget` : | a SwfdecGtkWidget
Returns : | `TRUE` if an intermediate renderer is used.

### swfdec_gtk_widget_set_renderer ()

    void                swfdec_gtk_widget_set_renderer      (SwfdecGtkWidget *widget,
                                                             cairo_surface_type_t renderer);

Tells `widget` to use an intermediate surface for rendering. This is useful for debugging or performance measurements inside swfdec and is probably not interesting for anyone else.

`widget` : | a SwfdecGtkWidget
`renderer` : | a cairo_surface_type_t for the intermediate renderer

### swfdec_gtk_widget_unset_renderer ()

    void                swfdec_gtk_widget_unset_renderer    (SwfdecGtkWidget *widget);

Unsets the use of an intermediate rendering surface. See `swfdec_gtk_widget_set_renderer()` for details.

`widget` : | a SwfdecGtkWidget

### swfdec_gtk_keycode_from_hardware_keycode ()

    guint               swfdec_gtk_keycode_from_hardware_keycode
                                                            (guint hardware_keycode);

Tries to transform an X hardware keycode to the corresponding SwfdecKey. This is a utility function for cases where key events need to be transformed manually.

`hardware_keycode` : | a hardware keycode sent from the X server
Returns : | the corresponding key code as used in Flash.

## Property Details

### The `"fullscreen-mode"` property

      "fullscreen-mode"          gboolean              : Write / Construct Only

special mode for fullscreen display.

Default value: FALSE

### The `"interactive"` property

      "interactive"              gboolean              : Read / Write

if mouse events are processed.

Default value: TRUE

### The `"player"` property

      "player"                   SwfdecPlayer*         : Read / Write / Construct

player that is displayed.

### The `"renderer"` property

      "renderer"                 guint                 : Read / Write

cairo_surface_type_t of intermediate renderer to use.

Default value: 0

### The `"renderer-set"` property

      "renderer-set"             gboolean              : Read / Write

if an intermediate renderer should be used.

Default value: TRUE