[vlc-commits] macosx/extensions: implement new dialog callback
Felix Paul Kühne
git at videolan.org
Thu Feb 4 18:44:09 CET 2016
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Feb 4 18:44:16 2016 +0100| [545616ae33c0d53281a63a28a97e0eff0046867b] | committer: Felix Paul Kühne
macosx/extensions: implement new dialog callback
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=545616ae33c0d53281a63a28a97e0eff0046867b
---
modules/gui/macosx/ExtensionsDialogProvider.m | 33 ++++++++++---------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/modules/gui/macosx/ExtensionsDialogProvider.m b/modules/gui/macosx/ExtensionsDialogProvider.m
index 60d108e..13a20f4 100644
--- a/modules/gui/macosx/ExtensionsDialogProvider.m
+++ b/modules/gui/macosx/ExtensionsDialogProvider.m
@@ -38,9 +38,8 @@
* VLCExtensionsDialogProvider implementation
*****************************************************************************/
-static int extensionDialogCallback(vlc_object_t *p_this, const char *psz_variable,
- vlc_value_t old_val, vlc_value_t new_val,
- void *param);
+static void extensionDialogCallback(extension_dialog_t *p_ext_dialog,
+ void *p_data);
static NSView *createControlFromWidget(extension_widget_t *widget, id self)
{
@@ -245,22 +244,18 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
/**
* Ask the dialogs provider to create a new dialog
**/
-static int extensionDialogCallback(vlc_object_t *p_this, const char *psz_variable,
- vlc_value_t old_val, vlc_value_t new_val,
- void *param)
+
+static void extensionDialogCallback(extension_dialog_t *p_ext_dialog,
+ void *p_data)
+
{
@autoreleasepool {
- (void) p_this;
- (void) psz_variable;
- (void) old_val;
-
- ExtensionsDialogProvider *provider = (__bridge ExtensionsDialogProvider *)param;
- if (!new_val.p_address)
- return VLC_EGENERIC;
+ ExtensionsDialogProvider *provider = (__bridge ExtensionsDialogProvider *)p_data;
+ if (!provider)
+ return;
- extension_dialog_t *p_dialog = (extension_dialog_t*) new_val.p_address;
- [provider manageDialog:p_dialog];
- return VLC_SUCCESS;
+ [provider manageDialog:p_ext_dialog];
+ return;
}
}
@@ -271,16 +266,14 @@ static int extensionDialogCallback(vlc_object_t *p_this, const char *psz_variabl
self = [super init];
if (self) {
intf_thread_t *p_intf = getIntf();
- var_Create(p_intf, "dialog-extension", VLC_VAR_ADDRESS);
- var_AddCallback(p_intf, "dialog-extension", extensionDialogCallback, (__bridge void *)self);
- // dialog_Register(p_intf) is called by coredialog provider
+ vlc_dialog_provider_set_ext_callback(p_intf, extensionDialogCallback, (__bridge void *)self);
}
return self;
}
- (void)dealloc
{
- var_DelCallback(getIntf(), "dialog-extension", extensionDialogCallback, (__bridge void *)self);
+ vlc_dialog_provider_set_ext_callback(getIntf(), NULL, NULL);
}
- (void)performEventWithObject:(NSValue *)objectValue ofType:(const char*)type
More information about the vlc-commits
mailing list