Commit c021c524 authored by Thomas Guillem's avatar Thomas Guillem

libvlc: re-order dialog callback arguments

The opaque p_data is now the first argument for the sake of consistency.
parent b37866a8
...@@ -52,12 +52,12 @@ typedef struct libvlc_dialog_cbs ...@@ -52,12 +52,12 @@ typedef struct libvlc_dialog_cbs
/** /**
* Called when an error message needs to be displayed * Called when an error message needs to be displayed
* *
* @param p_data opaque pointer for the callback
* @param psz_title title of the diaog * @param psz_title title of the diaog
* @param psz_text text of the dialog * @param psz_text text of the dialog
* @param p_data opaque pointer for the callback
*/ */
void (*pf_display_error)(const char *psz_title, const char *psz_text, void (*pf_display_error)(void *p_data, const char *psz_title,
void *p_data); const char *psz_text);
/** /**
* Called when a login dialog needs to be displayed * Called when a login dialog needs to be displayed
...@@ -68,18 +68,18 @@ typedef struct libvlc_dialog_cbs ...@@ -68,18 +68,18 @@ typedef struct libvlc_dialog_cbs
* @note to receive this callack, libvlc_dialog_cbs.pf_cancel should not be * @note to receive this callack, libvlc_dialog_cbs.pf_cancel should not be
* NULL. * NULL.
* *
* @param p_data opaque pointer for the callback
* @param p_id id used to interact with the dialog * @param p_id id used to interact with the dialog
* @param psz_title title of the diaog * @param psz_title title of the diaog
* @param psz_text text of the dialog * @param psz_text text of the dialog
* @param psz_default_username user name that should be set on the user form * @param psz_default_username user name that should be set on the user form
* @param b_ask_store if true, ask the user if he wants to save the * @param b_ask_store if true, ask the user if he wants to save the
* credentials * credentials
* @param p_data opaque pointer for the callback
*/ */
void (*pf_display_login)(libvlc_dialog_id *p_id, const char *psz_title, void (*pf_display_login)(void *p_data, libvlc_dialog_id *p_id,
const char *psz_text, const char *psz_title, const char *psz_text,
const char *psz_default_username, const char *psz_default_username,
bool b_ask_store, void *p_data); bool b_ask_store);
/** /**
* Called when a question dialog needs to be displayed * Called when a question dialog needs to be displayed
...@@ -90,6 +90,7 @@ typedef struct libvlc_dialog_cbs ...@@ -90,6 +90,7 @@ typedef struct libvlc_dialog_cbs
* @note to receive this callack, libvlc_dialog_cbs.pf_cancel should not be * @note to receive this callack, libvlc_dialog_cbs.pf_cancel should not be
* NULL. * NULL.
* *
* @param p_data opaque pointer for the callback
* @param p_id id used to interact with the dialog * @param p_id id used to interact with the dialog
* @param psz_title title of the diaog * @param psz_title title of the diaog
* @param psz_text text of the dialog * @param psz_text text of the dialog
...@@ -99,13 +100,12 @@ typedef struct libvlc_dialog_cbs ...@@ -99,13 +100,12 @@ typedef struct libvlc_dialog_cbs
* button * button
* @param psz_action2 text of the second button, if NULL, don't display * @param psz_action2 text of the second button, if NULL, don't display
* this button * this button
* @param p_data opaque pointer for the callback
*/ */
void (*pf_display_question)(libvlc_dialog_id *p_id, const char *psz_title, void (*pf_display_question)(void *p_data, libvlc_dialog_id *p_id,
const char *psz_text, const char *psz_title, const char *psz_text,
libvlc_dialog_question_type i_type, libvlc_dialog_question_type i_type,
const char *psz_cancel, const char *psz_action1, const char *psz_cancel, const char *psz_action1,
const char *psz_action2, void *p_data); const char *psz_action2);
/** /**
* Called when a progress dialog needs to be displayed * Called when a progress dialog needs to be displayed
...@@ -116,6 +116,7 @@ typedef struct libvlc_dialog_cbs ...@@ -116,6 +116,7 @@ typedef struct libvlc_dialog_cbs
* @note to receive this callack, libvlc_dialog_cbs.pf_cancel and * @note to receive this callack, libvlc_dialog_cbs.pf_cancel and
* libvlc_dialog_cbs.pf_update_progress should not be NULL. * libvlc_dialog_cbs.pf_update_progress should not be NULL.
* *
* @param p_data opaque pointer for the callback
* @param p_id id used to interact with the dialog * @param p_id id used to interact with the dialog
* @param psz_title title of the diaog * @param psz_title title of the diaog
* @param psz_text text of the dialog * @param psz_text text of the dialog
...@@ -124,12 +125,11 @@ typedef struct libvlc_dialog_cbs ...@@ -124,12 +125,11 @@ typedef struct libvlc_dialog_cbs
* 1.0) * 1.0)
* @param psz_cancel text of the cancel button, if NULL the dialog is not * @param psz_cancel text of the cancel button, if NULL the dialog is not
* cancellable * cancellable
* @param p_data opaque pointer for the callback
*/ */
void (*pf_display_progress)(libvlc_dialog_id *p_id, const char *psz_title, void (*pf_display_progress)(void *p_data, libvlc_dialog_id *p_id,
const char *psz_text, bool b_indeterminate, const char *psz_title, const char *psz_text,
float f_position, const char *psz_cancel, bool b_indeterminate, float f_position,
void *p_data); const char *psz_cancel);
/** /**
* Called when a displayed dialog needs to be cancelled * Called when a displayed dialog needs to be cancelled
...@@ -137,21 +137,21 @@ typedef struct libvlc_dialog_cbs ...@@ -137,21 +137,21 @@ typedef struct libvlc_dialog_cbs
* The implementation must call libvlc_dialog_dismiss() to really release * The implementation must call libvlc_dialog_dismiss() to really release
* the dialog. * the dialog.
* *
* @param p_id id of the dialog
* @param p_data opaque pointer for the callback * @param p_data opaque pointer for the callback
* @param p_id id of the dialog
*/ */
void (*pf_cancel)(libvlc_dialog_id *p_id, void *p_data); void (*pf_cancel)(void *p_data, libvlc_dialog_id *p_id);
/** /**
* Called when a progress dialog needs to be updated * Called when a progress dialog needs to be updated
* *
* @param p_data opaque pointer for the callback
* @param p_id id of the dialog * @param p_id id of the dialog
* @param f_position osition of the progress bar (between 0.0 and 1.0) * @param f_position osition of the progress bar (between 0.0 and 1.0)
* @param psz_text new text of the progress dialog * @param psz_text new text of the progress dialog
* @param p_data opaque pointer for the callback
*/ */
void (*pf_update_progress)(libvlc_dialog_id *p_id, float f_position, void (*pf_update_progress)(void *p_data, libvlc_dialog_id *p_id,
const char *psz_text, void *p_data); float f_position, const char *psz_text);
} libvlc_dialog_cbs; } libvlc_dialog_cbs;
/** /**
......
...@@ -49,8 +49,8 @@ display_error_cb(void *p_data, const char *psz_title, const char *psz_text) ...@@ -49,8 +49,8 @@ display_error_cb(void *p_data, const char *psz_title, const char *psz_text)
{ {
libvlc_instance_t *p_instance = p_data; libvlc_instance_t *p_instance = p_data;
p_instance->dialog.cbs.pf_display_error(psz_title, psz_text, p_instance->dialog.cbs.pf_display_error(p_instance->dialog.data, psz_title,
p_instance->dialog.data); psz_text);
} }
static void static void
...@@ -60,11 +60,10 @@ display_login_cb(void *p_data, vlc_dialog_id *p_id, const char *psz_title, ...@@ -60,11 +60,10 @@ display_login_cb(void *p_data, vlc_dialog_id *p_id, const char *psz_title,
{ {
libvlc_instance_t *p_instance = p_data; libvlc_instance_t *p_instance = p_data;
p_instance->dialog.cbs.pf_display_login((libvlc_dialog_id *) p_id, p_instance->dialog.cbs.pf_display_login(p_instance->dialog.data,
psz_title, psz_text, (libvlc_dialog_id *) p_id,
psz_default_username, psz_title, psz_text,
b_ask_store, psz_default_username, b_ask_store);
p_instance->dialog.data);
} }
static void static void
...@@ -77,11 +76,11 @@ display_question_cb(void *p_data, vlc_dialog_id *p_id, const char *psz_title, ...@@ -77,11 +76,11 @@ display_question_cb(void *p_data, vlc_dialog_id *p_id, const char *psz_title,
const libvlc_dialog_question_type i_ltype = const libvlc_dialog_question_type i_ltype =
vlc_to_libvlc_dialog_question_type(i_type); vlc_to_libvlc_dialog_question_type(i_type);
p_instance->dialog.cbs.pf_display_question((libvlc_dialog_id *) p_id, p_instance->dialog.cbs.pf_display_question(p_instance->dialog.data,
(libvlc_dialog_id *) p_id,
psz_title, psz_text, i_ltype, psz_title, psz_text, i_ltype,
psz_cancel, psz_cancel,
psz_action1, psz_action2, psz_action1, psz_action2);
p_instance->dialog.data);
} }
static void static void
...@@ -91,19 +90,19 @@ display_progress_cb(void *p_data, vlc_dialog_id *p_id, const char *psz_title, ...@@ -91,19 +90,19 @@ display_progress_cb(void *p_data, vlc_dialog_id *p_id, const char *psz_title,
{ {
libvlc_instance_t *p_instance = p_data; libvlc_instance_t *p_instance = p_data;
p_instance->dialog.cbs.pf_display_progress((libvlc_dialog_id *) p_id, p_instance->dialog.cbs.pf_display_progress(p_instance->dialog.data,
(libvlc_dialog_id *) p_id,
psz_title, psz_text, psz_title, psz_text,
b_indeterminate, f_position, b_indeterminate, f_position,
psz_cancel, psz_cancel);
p_instance->dialog.data);
} }
static void static void
cancel_cb(void *p_data, vlc_dialog_id *p_id) cancel_cb(void *p_data, vlc_dialog_id *p_id)
{ {
libvlc_instance_t *p_instance = p_data; libvlc_instance_t *p_instance = p_data;
p_instance->dialog.cbs.pf_cancel((libvlc_dialog_id *)p_id, p_instance->dialog.cbs.pf_cancel(p_instance->dialog.data,
p_instance->dialog.data); (libvlc_dialog_id *)p_id);
} }
static void static void
...@@ -111,9 +110,9 @@ update_progress_cb(void *p_data, vlc_dialog_id *p_id, float f_position, ...@@ -111,9 +110,9 @@ update_progress_cb(void *p_data, vlc_dialog_id *p_id, float f_position,
const char *psz_text) const char *psz_text)
{ {
libvlc_instance_t *p_instance = p_data; libvlc_instance_t *p_instance = p_data;
p_instance->dialog.cbs.pf_update_progress((libvlc_dialog_id *) p_id, p_instance->dialog.cbs.pf_update_progress(p_instance->dialog.data,
f_position, psz_text, (libvlc_dialog_id *) p_id,
p_instance->dialog.data); f_position, psz_text);
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment