-#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) < 20)
-VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
-#else
-VlcPlugin::VlcPlugin( NPP instance, uint16_t mode ) :
-#endif
- i_npmode(mode),
- b_stream(0),
- b_autoplay(1),
- b_toolbar(0),
- psz_text(NULL),
- psz_target(NULL),
- playlist_index(-1),
- libvlc_instance(NULL),
- libvlc_media_list(NULL),
- libvlc_media_player(NULL),
- p_scriptClass(NULL),
- p_browser(instance),
- psz_baseURL(NULL)
-#if defined(XP_WIN)
- ,pf_wndproc(NULL)
-#endif
-#if defined(XP_UNIX)
- ,i_width((unsigned)-1)
- ,i_height((unsigned)-1)
- ,i_tb_width(0)
- ,i_tb_height(0)
- ,i_last_position(0)
- ,p_btnPlay(NULL)
- ,p_btnPause(NULL)
- ,p_btnStop(NULL)
- ,p_btnMute(NULL)
- ,p_btnUnmute(NULL)
- ,p_btnFullscreen(NULL)
- ,p_btnTime(NULL)
- ,p_timeline(NULL)
-#endif
+static void handle_input_event(const libvlc_event_t* event, void *param);
+static void handle_changed_event(const libvlc_event_t* event, void *param);
+
+static vlcplugin_event_t vlcevents[] = {
+ { "MediaPlayerMediaChanged", libvlc_MediaPlayerMediaChanged, handle_input_event },
+ { "MediaPlayerNothingSpecial", libvlc_MediaPlayerNothingSpecial, handle_input_event },
+ { "MediaPlayerOpening", libvlc_MediaPlayerOpening, handle_input_event },
+ { "MediaPlayerBuffering", libvlc_MediaPlayerBuffering, handle_changed_event },
+ { "MediaPlayerPlaying", libvlc_MediaPlayerPlaying, handle_input_event },
+ { "MediaPlayerPaused", libvlc_MediaPlayerPaused, handle_input_event },
+ { "MediaPlayerStopped", libvlc_MediaPlayerStopped, handle_input_event },
+ { "MediaPlayerForward", libvlc_MediaPlayerForward, handle_input_event },
+ { "MediaPlayerBackward", libvlc_MediaPlayerBackward, handle_input_event },
+ { "MediaPlayerEndReached", libvlc_MediaPlayerEndReached, handle_input_event },
+ { "MediaPlayerEncounteredError", libvlc_MediaPlayerEncounteredError, handle_input_event },
+ { "MediaPlayerTimeChanged", libvlc_MediaPlayerTimeChanged, handle_changed_event },
+ { "MediaPlayerPositionChanged", libvlc_MediaPlayerPositionChanged, handle_changed_event },
+ { "MediaPlayerSeekableChanged", libvlc_MediaPlayerSeekableChanged, handle_changed_event },
+ { "MediaPlayerPausableChanged", libvlc_MediaPlayerPausableChanged, handle_changed_event },
+ { "MediaPlayerTitleChanged", libvlc_MediaPlayerTitleChanged, handle_changed_event },
+ { "MediaPlayerLengthChanged", libvlc_MediaPlayerLengthChanged, handle_changed_event },
+};
+
+static void handle_input_event(const libvlc_event_t* event, void *param)