Commit f6fb175a authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

Preliminary interaction framework for Mac OS X. Not finished, since core...

Preliminary interaction framework for Mac OS X. Not finished, since core changes should be made to better match wxwidgets vs. Mac OS X style dialogs and concepts.
parent 746ad2ae
...@@ -7,6 +7,8 @@ SOURCES_macosx = \ ...@@ -7,6 +7,8 @@ SOURCES_macosx = \
controls.m \ controls.m \
equalizer.m \ equalizer.m \
equalizer.h \ equalizer.h \
interaction.m \
interaction.h \
intf.m \ intf.m \
intf.h \ intf.h \
macosx.m \ macosx.m \
......
...@@ -95,6 +95,7 @@ struct intf_sys_t ...@@ -95,6 +95,7 @@ struct intf_sys_t
id o_extended; /* VLCExtended */ id o_extended; /* VLCExtended */
id o_bookmarks; /* VLCBookmarks */ id o_bookmarks; /* VLCBookmarks */
id o_embedded_list; /* VLCEmbeddedList*/ id o_embedded_list; /* VLCEmbeddedList*/
id o_interaction_list; /* VLCInteractionList*/
id o_sfilters; /* VLCsFilters */ id o_sfilters; /* VLCsFilters */
/*id o_update; VLCUpdate */ /*id o_update; VLCUpdate */
BOOL nib_main_loaded; /* reference to the main-nib */ BOOL nib_main_loaded; /* reference to the main-nib */
...@@ -281,6 +282,7 @@ struct intf_sys_t ...@@ -281,6 +282,7 @@ struct intf_sys_t
- (id)getWizard; - (id)getWizard;
- (id)getBookmarks; - (id)getBookmarks;
- (id)getEmbeddedList; - (id)getEmbeddedList;
- (id)getInteractionList;
- (void)terminate; - (void)terminate;
- (NSString *)localizedString:(char *)psz; - (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz; - (char *)delocalizeString:(NSString *)psz;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "extended.h" #include "extended.h"
#include "bookmarks.h" #include "bookmarks.h"
#include "sfilters.h" #include "sfilters.h"
#include "interaction.h"
/*#include "update.h"*/ /*#include "update.h"*/
/***************************************************************************** /*****************************************************************************
...@@ -178,7 +179,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -178,7 +179,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
* playlistChanged: Callback triggered by the intf-change playlist * playlistChanged: Callback triggered by the intf-change playlist
* variable, to let the intf update the playlist. * variable, to let the intf update the playlist.
*****************************************************************************/ *****************************************************************************/
int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable, static int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param ) vlc_value_t old_val, vlc_value_t new_val, void *param )
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
...@@ -192,7 +193,7 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable, ...@@ -192,7 +193,7 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
* FullscreenChanged: Callback triggered by the fullscreen-change playlist * FullscreenChanged: Callback triggered by the fullscreen-change playlist
* variable, to let the intf update the controller. * variable, to let the intf update the controller.
*****************************************************************************/ *****************************************************************************/
int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable, static int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param ) vlc_value_t old_val, vlc_value_t new_val, void *param )
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
...@@ -200,6 +201,24 @@ int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable, ...@@ -200,6 +201,24 @@ int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
/*****************************************************************************
* InteractCallback: Callback triggered by the interaction
* variable, to let the intf display error and interaction dialogs
*****************************************************************************/
static int InteractCallback( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
VLCMain *interface = (VLCMain *)param;
interaction_dialog_t *p_dialog = (interaction_dialog_t *)(new_val.p_address);
NSValue *o_value = [NSValue valueWithPointer:p_dialog];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewInteractionEventNotification" object:[interface getInteractionList]
userInfo:[NSDictionary dictionaryWithObject:o_value forKey:@"VLCDialogPointer"]];
[o_pool release];
return VLC_SUCCESS;
}
static struct static struct
{ {
...@@ -305,6 +324,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -305,6 +324,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_extended = nil; o_extended = nil;
o_bookmarks = [[VLCBookmarks alloc] init]; o_bookmarks = [[VLCBookmarks alloc] init];
o_embedded_list = [[VLCEmbeddedList alloc] init]; o_embedded_list = [[VLCEmbeddedList alloc] init];
o_interaction_list = [[VLCInteractionList alloc] init];
o_sfilters = nil; o_sfilters = nil;
/*o_update = [[VLCUpdate alloc] init];*/ /*o_update = [[VLCUpdate alloc] init];*/
...@@ -432,6 +452,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -432,6 +452,11 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )]; [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
var_Create( p_intf, "interaction", VLC_VAR_ADDRESS );
var_AddCallback( p_intf, "interaction", InteractCallback, self );
p_intf->b_interaction = VLC_TRUE;
nib_main_loaded = TRUE; nib_main_loaded = TRUE;
} }
...@@ -814,6 +839,15 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -814,6 +839,15 @@ static VLCMain *_o_sharedMainInstance = nil;
return nil; return nil;
} }
- (id)getInteractionList
{
if( o_interaction_list )
{
return o_interaction_list;
}
return nil;
}
- (void)manage - (void)manage
{ {
playlist_t * p_playlist; playlist_t * p_playlist;
...@@ -1378,6 +1412,9 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1378,6 +1412,9 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_extended savePrefs]; [o_extended savePrefs];
} }
p_intf->b_interaction = VLC_FALSE;
var_DelCallback( p_intf, "interaction", InteractCallback, self );
/* release some other objects here, because it isn't sure whether dealloc /* release some other objects here, because it isn't sure whether dealloc
* will be called later on -- FK (10/6/05) */ * will be called later on -- FK (10/6/05) */
if( nib_about_loaded && o_about ) if( nib_about_loaded && o_about )
...@@ -1398,6 +1435,12 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1398,6 +1435,12 @@ static VLCMain *_o_sharedMainInstance = nil;
if( nib_wizard_loaded && o_wizard ) if( nib_wizard_loaded && o_wizard )
[o_wizard release]; [o_wizard release];
if( o_embedded_list != nil )
[o_embedded_list release];
if( o_interaction_list != nil )
[o_interaction_list release];
if( o_img_pause_pressed != nil ) if( o_img_pause_pressed != nil )
{ {
[o_img_pause_pressed release]; [o_img_pause_pressed release];
......
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