+#undef PUSH_VAR
+/*****************************************************************************
+ * Popup menus
+ *****************************************************************************/
+#define PUSH_VAR( var ) as_varnames.push_back( var ); \
+ ai_objects.push_back( p_object->i_object_id );
+#define PUSH_SEPARATOR if( ai_objects.size() != i_last_separator ) { \
+ ai_objects.push_back( 0 ); \
+ as_varnames.push_back( "" ); \
+ i_last_separator = ai_objects.size(); }
+
+#define POPUP_BOILERPLATE \
+ unsigned int i_last_separator = 0; \
+ vector<int> ai_objects; \
+ vector<string> as_varnames; \
+ playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_intf, \
+ VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\
+ if( !p_playlist ) \
+ return; \
+ input_thread_t *p_input = p_playlist->p_input;
+
+#define CREATE_POPUP \
+ Menu popupmenu( p_intf, PopupMenu_Events ); \
+ popupmenu.Populate( as_varnames, ai_objects ); \
+ p_intf->p_sys->p_popup_menu = &popupmenu; \
+ p_parent->PopupMenu( &popupmenu, pos.x, pos.y ); \
+ p_intf->p_sys->p_popup_menu = NULL; \
+
+#define POPUP_STATIC_ENTRIES \
+ if( p_input != NULL ) \
+ { \
+ vlc_value_t val; \
+ popupmenu.InsertSeparator( 0 ); \
+ if (!minimal) \
+ { \
+ popupmenu.Insert( 0, Stop_Event, wxU(_("Stop")) ); \
+ popupmenu.Insert( 0, Previous_Event, wxU(_("Previous")) ); \
+ popupmenu.Insert( 0, Next_Event, wxU(_("Next")) ); \
+ } \
+ \
+ var_Get( p_input, "state", &val ); \
+ if( val.i_int == PAUSE_S ) \
+ popupmenu.Insert( 0, Play_Event, wxU(_("Play")) ); \
+ else \
+ popupmenu.Insert( 0, Pause_Event, wxU(_("Pause")) ); \
+ \
+ vlc_object_release( p_input ); \
+ } \
+ else \
+ { \
+ if( p_playlist && p_playlist->i_size ) \
+ { \
+ popupmenu.InsertSeparator( 0 ); \
+ popupmenu.Insert( 0, Play_Event, wxU(_("Play")) ); \
+ } \
+ if( p_playlist ) vlc_object_release( p_playlist ); \
+ } \
+ \
+ popupmenu.Append( MenuDummy_Event, wxU(_("Miscellaneous")), \
+ MiscMenu( p_intf ), wxT("") ); \
+
+
+void VideoPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
+ const wxPoint& pos )
+{
+ POPUP_BOILERPLATE;
+ if( p_input )