From: Felix Paul Kühne Date: Sat, 15 Jul 2006 19:47:29 +0000 (+0000) Subject: * implemented a ctrl-click menu for the vouts (refs #302) X-Git-Tag: 0.9.0-test0~10851 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9e2759bc11a6e9302c676502f919e9995e4942d0;p=vlc * implemented a ctrl-click menu for the vouts (refs #302) - currently loaded through rightMouseUp because rightMouseDown, etc. don't register any NSRightMouseDowns. If anybody got an idea why, I would be willing to change this of cause, since the current way is quite slower in the user's experience. - the Snapshot item doesn't work yet (it triggers the fullscreen-event) - localisation support is complete Any comments and wanteds for further items are welcome :) --- diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index 866c8430ec..ced9bfe3dc 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -330,6 +330,7 @@ "o_timefield" = id; "o_timeslider" = id; "o_volumeslider" = id; + "o_vout_menu" = id; "o_window" = id; }; SUPERCLASS = NSObject; diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index 380fb947dc..ed8bddb32b 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -3,17 +3,19 @@ IBDocumentLocation - 90 147 478 430 0 0 1024 746 + 185 59 478 430 0 0 1440 878 IBEditorPositions 1617 788 586 109 149 0 0 1440 878 2197 - 172 420 596 143 0 0 1024 746 + 422 532 596 143 0 0 1440 878 2709 305 626 508 82 0 0 1024 746 + 2730 + 694 440 105 68 0 0 1440 878 29 - 76 675 438 44 0 0 1024 746 + 130 802 438 44 0 0 1440 878 915 777 479 187 249 0 0 1440 878 @@ -23,6 +25,7 @@ IBOpenObjects + 2416 21 IBSystem Version diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib index d9dea177e7..3b319f9b39 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index 3edc07e649..ddf28b95be 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -7,6 +7,7 @@ * Authors: Jon Lech Johansen * Christophe Massiot * Derk-Jan Hartman + * Felix KŸhne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -270,6 +271,18 @@ struct intf_sys_t IBOutlet id o_dmi_previous; IBOutlet id o_dmi_mute; + /* vout menu */ + IBOutlet id o_vout_menu; + IBOutlet id o_vmi_play; + IBOutlet id o_vmi_stop; + IBOutlet id o_vmi_prev; + IBOutlet id o_vmi_next; + IBOutlet id o_vmi_volup; + IBOutlet id o_vmi_voldown; + IBOutlet id o_vmi_mute; + IBOutlet id o_vmi_fullscreen; + IBOutlet id o_vmi_snapshot; + bool b_small_window; mtime_t i_end_scroll; @@ -295,6 +308,7 @@ struct intf_sys_t - (id)getInteractionList; - (id)getMainIntfPgbar; - (id)getControllerWindow; +- (id)getVoutMenu; - (void)terminate; - (NSString *)localizedString:(char *)psz; - (char *)delocalizeString:(NSString *)psz; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 0ceafeffec..e57f63655e 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -7,6 +7,7 @@ * Authors: Jon Lech Johansen * Christophe Massiot * Derk-Jan Hartman + * Felix KŸhne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -615,6 +616,17 @@ static VLCMain *_o_sharedMainInstance = nil; [o_dmi_next setTitle: _NS("Next")]; [o_dmi_previous setTitle: _NS("Previous")]; [o_dmi_mute setTitle: _NS("Mute")]; + + /* vout menu */ + [o_vmi_play setTitle: _NS("Play")]; + [o_vmi_stop setTitle: _NS("Stop")]; + [o_vmi_prev setTitle: _NS("Previous")]; + [o_vmi_next setTitle: _NS("Next")]; + [o_vmi_volup setTitle: _NS("Volume Up")]; + [o_vmi_voldown setTitle: _NS("Volume Down")]; + [o_vmi_mute setTitle: _NS("Mute")]; + [o_vmi_fullscreen setTitle: _NS("Fullscreen")]; + [o_vmi_snapshot setTitle: _NS("Snapshot")]; /* error panel */ [o_error setTitle: _NS("Error")]; @@ -929,6 +941,11 @@ static VLCMain *_o_sharedMainInstance = nil; return nil; } +- (id)getVoutMenu +{ + return o_vout_menu; +} + - (void)manage { playlist_t * p_playlist; diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index 6be49cc14f..9822cf27d1 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -10,6 +10,7 @@ * Derk-Jan Hartman * Eric Petit * Benjamin Pracht + * Felix KŸhne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +41,7 @@ #include "intf.h" #include "vout.h" - +#import "controls.h" /***************************************************************************** * DeviceCallback: Callback triggered when the video-device variable is changed @@ -474,6 +475,12 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, } } break; + case NSRightMouseDown: + { + msg_Dbg( p_vout, "received NSRightMouseDown (generic method)" ); + [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; + } + break; default: [super mouseDown: o_event]; @@ -507,17 +514,14 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, - (void)rightMouseDown:(NSEvent *)o_event { - vlc_value_t val; - if( p_vout ) { switch( [o_event type] ) { case NSRightMouseDown: { - var_Get( p_vout, "mouse-button-down", &val ); - val.i_int |= 4; - var_Set( p_vout, "mouse-button-down", val ); + msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" ); + [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; } break; @@ -580,17 +584,16 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, - (void)rightMouseUp:(NSEvent *)o_event { - vlc_value_t val; - if( p_vout ) { switch( [o_event type] ) { case NSRightMouseUp: { - var_Get( p_vout, "mouse-button-down", &val ); - val.i_int &= ~4; - var_Set( p_vout, "mouse-button-down", val ); + /* FIXME: this is the appropriate place, but we can't receive + * NSRightMouseDown some how */ + msg_Dbg( p_vout, "received NSRightMouseUp" ); + [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; } break;