]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/controls.m
* Apply changed made to the 0.8.5 branch to trunk.
[vlc] / modules / gui / macosx / controls.m
index fa3b8a3b9ac2b2e34c23be45dfc8852cd6007f75..6396e8b721675bf722d3d3215ac1a33ca3968667 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>
+ *          Benjamin Pracht <bigben at videolan doit 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
 
     if( p_vout != NULL )
     {
+        id o_embedded_vout_list = [[VLCMain sharedInstance] getEmbeddedList];
         while ((o_window = [o_enumerator nextObject]))
         {
-            if( [[o_window className] isEqualToString: @"VLCWindow"] )
+            id o_vout_view = nil;
+            /* We have an embedded vout */
+            if( [o_embedded_vout_list windowContainsEmbedded: o_window] )
+            {
+                o_vout_view = [o_embedded_vout_list getViewForWindow: o_window];
+            }
+            /* We have a detached Vout */
+            else if( [[o_window className] isEqualToString: @"VLCWindow"] )
+            {
+                o_vout_view = [o_window getVoutView];
+            }
+
+            if( o_vout_view )
             {
                 if( [o_title isEqualToString: _NS("Half Size") ] )
-                    [o_window scaleWindowWithFactor: 0.5];
+                    [o_vout_view scaleWindowWithFactor: 0.5];
                 else if( [o_title isEqualToString: _NS("Normal Size") ] )
-                    [o_window scaleWindowWithFactor: 1.0];
+                    [o_vout_view scaleWindowWithFactor: 1.0];
                 else if( [o_title isEqualToString: _NS("Double Size") ] )
-                    [o_window scaleWindowWithFactor: 2.0];
+                    [o_vout_view scaleWindowWithFactor: 2.0];
                 else if( [o_title isEqualToString: _NS("Float on Top") ] )
-                    [o_window toggleFloatOnTop];
+                    [o_vout_view toggleFloatOnTop];
                 else if( [o_title isEqualToString: _NS("Fit to Screen") ] )
                 {
                     if( ![o_window isZoomed] )
                 }
                 else if( [o_title isEqualToString: _NS("Snapshot") ] )
                 {
-                    [o_window snapshot];
+                    [o_vout_view snapshot];
                 }
                 else
                 {
-                    [o_window toggleFullscreen];
+                    [o_vout_view toggleFullscreen];
                 }
                 break;
             }
                     Value: another_val ofType: i_type];
             [o_lmi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
             [o_lmi setTarget: self];
-            
+
             if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) && !( i_type & VLC_VAR_ISCOMMAND ) )
                 [o_lmi setState: TRUE ];
 
           break;
         }
     }
-    
+
     /* clean up everything */
     if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
     var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
 
             while( (o_window = [o_enumerator nextObject]))
             {
-                if( [[o_window className] isEqualToString: @"VLCWindow"] )
+                if( [[o_window className] isEqualToString: @"VLCWindow"] ||
+                            [[[VLCMain sharedInstance] getEmbeddedList]
+                            windowContainsEmbedded: o_window])
                 {
                     bEnabled = TRUE;
                     break;