+/** Update a progress bar
+ * \param p_this Parent vlc_object
+ * \param i_id Identifier of the dialog
+ * \param psz_status New status
+ * \param f_position New position (0.0->100.0)
+ * \return nothing
+ */
+void __intf_UserProgressUpdate( vlc_object_t *p_this, int i_id,
+ const char *psz_status, float f_pos )
+{
+ interaction_t *p_interaction = intf_InteractionGet( p_this );
+ interaction_dialog_t *p_dialog;
+
+ if( !p_interaction ) return;
+
+ vlc_mutex_lock( &p_interaction->object_lock );
+ p_dialog = intf_InteractionGetById( p_this, i_id );
+
+ if( !p_dialog )
+ {
+ vlc_mutex_unlock( &p_interaction->object_lock ) ;
+ return;
+ }
+
+ if( p_dialog->pp_widgets[0]->psz_text )
+ free( p_dialog->pp_widgets[0]->psz_text );
+ p_dialog->pp_widgets[0]->psz_text = strdup( psz_status );
+
+ p_dialog->pp_widgets[0]->val.f_float = f_pos;
+
+ p_dialog->i_status = UPDATED_DIALOG;
+ vlc_mutex_unlock( &p_interaction->object_lock) ;
+}
+
+/** Helper function to make a login/password box
+ * \param p_this Parent vlc_object
+ * \param psz_title Title for the dialog
+ * \param psz_description A description
+ * \param ppsz_login Returned login
+ * \param ppsz_password Returned password
+ * \return Clicked button code
+ */
+int __intf_UserLoginPassword( vlc_object_t *p_this,
+ const char *psz_title,
+ const char *psz_description,
+ char **ppsz_login,
+ char **ppsz_password )
+{
+ int i_ret;
+ interaction_dialog_t *p_new = NULL;
+ user_widget_t *p_widget = NULL;
+
+ INTERACT_INIT( p_new );
+
+ p_new->i_type = INTERACT_DIALOG_TWOWAY;
+ p_new->psz_title = strdup( psz_title );
+
+ /* Text */
+ p_widget = (user_widget_t* )malloc( sizeof( user_widget_t ) );
+ p_widget->i_type = WIDGET_TEXT;
+ p_widget->psz_text = strdup( psz_description );
+ p_widget->val.psz_string = NULL;
+ INSERT_ELEM ( p_new->pp_widgets, p_new->i_widgets,
+ p_new->i_widgets, p_widget );
+
+ /* Login */
+ p_widget = (user_widget_t* )malloc( sizeof( user_widget_t ) );
+ p_widget->i_type = WIDGET_INPUT_TEXT;
+ p_widget->psz_text = strdup( _("Login") );
+ p_widget->val.psz_string = NULL;
+ INSERT_ELEM ( p_new->pp_widgets, p_new->i_widgets,
+ p_new->i_widgets, p_widget );
+
+ /* Password */
+ p_widget = (user_widget_t* )malloc( sizeof( user_widget_t ) );
+ p_widget->i_type = WIDGET_INPUT_TEXT;
+ p_widget->psz_text = strdup( _("Password") );
+ p_widget->val.psz_string = NULL;
+ INSERT_ELEM ( p_new->pp_widgets, p_new->i_widgets,
+ p_new->i_widgets, p_widget );
+
+ p_new->i_flags = DIALOG_OK_CANCEL;
+
+ i_ret = intf_Interact( p_this, p_new );
+
+ if( i_ret != DIALOG_CANCELLED )
+ {
+ *ppsz_login = strdup( p_new->pp_widgets[1]->val.psz_string );
+ *ppsz_password = strdup( p_new->pp_widgets[2]->val.psz_string );
+ }
+ return i_ret;
+}
+
+/** Hide an interaction dialog
+ * \param p_this the parent vlc object
+ * \param i_id the id of the item to hide
+ * \return nothing
+ */
+void __intf_UserHide( vlc_object_t *p_this, int i_id )
+{
+ interaction_t *p_interaction = intf_InteractionGet( p_this );
+ interaction_dialog_t *p_dialog;
+
+ if( !p_interaction ) return;
+
+ vlc_mutex_lock( &p_interaction->object_lock );
+ p_dialog = intf_InteractionGetById( p_this, i_id );
+
+ if( !p_dialog )
+ {
+ vlc_mutex_unlock( &p_interaction->object_lock );
+ return;
+ }
+
+ p_dialog->i_status = ANSWERED_DIALOG;
+ vlc_mutex_unlock( &p_interaction->object_lock );
+}
+
+
+
+/**********************************************************************
+ * The following functions are local
+ **********************************************************************/
+
+/* Get the interaction object. Create it if needed */
+static interaction_t * intf_InteractionGet( vlc_object_t *p_this )