]> git.sesse.net Git - vlc/commitdiff
* implemented a ctrl-click menu for the vouts (refs #302)
authorFelix Paul Kühne <fkuehne@videolan.org>
Sat, 15 Jul 2006 19:47:29 +0000 (19:47 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 15 Jul 2006 19:47:29 +0000 (19:47 +0000)
- 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 :)

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/vout.m

index 866c8430ecc8a7425d63f94f073aa1834395c7f8..ced9bfe3dc9f8d79e027521d037eba675dd96c66 100644 (file)
                 "o_timefield" = id; 
                 "o_timeslider" = id; 
                 "o_volumeslider" = id; 
+                "o_vout_menu" = id; 
                 "o_window" = id; 
             }; 
             SUPERCLASS = NSObject; 
index 380fb947dc33d1f1a5d5424c7696512ea0b5630e..ed8bddb32b49c913c11daca24f7a3498b1d902af 100644 (file)
@@ -3,17 +3,19 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>90 147 478 430 0 0 1024 746 </string>
+       <string>185 59 478 430 0 0 1440 878 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>1617</key>
                <string>788 586 109 149 0 0 1440 878 </string>
                <key>2197</key>
-               <string>172 420 596 143 0 0 1024 746 </string>
+               <string>422 532 596 143 0 0 1440 878 </string>
                <key>2709</key>
                <string>305 626 508 82 0 0 1024 746 </string>
+               <key>2730</key>
+               <string>694 440 105 68 0 0 1440 878 </string>
                <key>29</key>
-               <string>76 675 438 44 0 0 1024 746 </string>
+               <string>130 802 438 44 0 0 1440 878 </string>
                <key>915</key>
                <string>777 479 187 249 0 0 1440 878 </string>
        </dict>
@@ -23,6 +25,7 @@
        <array/>
        <key>IBOpenObjects</key>
        <array>
+               <integer>2416</integer>
                <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
index d9dea177e71be71796279c5405c269f33801b975..3b319f9b39a52056c2f63d1cebadd0e4a3d96d71 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
index 3edc07e6492bb484b236f8615cebff72d8beb946..ddf28b95bec7b8b90cb9c436326b525f09071cef 100644 (file)
@@ -7,6 +7,7 @@
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <hartman at videolan dot org>
+ *          Felix K\9fhne <fkuehne at videolan dot org>
  *
  * 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;
index 0ceafeffec733168a0aaedef7bf4c93ac4be6be9..e57f63655eabbefbc5d3dbc18d9f536ebafc0eec 100644 (file)
@@ -7,6 +7,7 @@
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <hartman at videolan.org>
+ *          Felix K\9fhne <fkuehne at videolan dot org>
  *
  * 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;
index 6be49cc14fa6a5b51c2e9a80d6ef25ae273c3d27..9822cf27d10ca974b818d7c65bc2b4409c0e9942 100644 (file)
@@ -10,6 +10,7 @@
  *          Derk-Jan Hartman <hartman at videolan dot org>
  *          Eric Petit <titer@m0k.org>
  *          Benjamin Pracht <bigben at videolan dot org>
+ *          Felix K\9fhne <fkuehne at videolan dot org>
  *
  * 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;