]> git.sesse.net Git - vlc/commitdiff
* Fullscreen button works again
authorBenjamin Pracht <bigben@videolan.org>
Thu, 7 Oct 2004 21:33:38 +0000 (21:33 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Thu, 7 Oct 2004 21:33:38 +0000 (21:33 +0000)
* It enabled even when no vout is present
* Still a little issue with the fullscreen hotkey

extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/controls.m
modules/gui/macosx/intf.m

index a48a51bfac21a685f83f3dc0aa3def7a78951a09..a363be464133de721876949acd39fe4e12d312e6 100644 (file)
@@ -9,7 +9,7 @@
                <key>1617</key>
                <string>542 480 104 149 0 0 1024 746 </string>
                <key>29</key>
-               <string>59 849 419 44 0 0 1280 938 </string>
+               <string>41 667 419 44 0 0 1024 746 </string>
                <key>915</key>
                <string>54 452 185 199 0 0 1024 746 </string>
        </dict>
@@ -21,8 +21,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>29</integer>
                <integer>21</integer>
+               <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
        <string>7M34</string>
index e000f5dfc770d637717629cc5dd75aff59c08fea..0d025bda7667dc59f2cf0d50d0c7acb045f27d0b 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index e4eb23115ba8b6cc93e5b4cdfeb0f277340f98f4..01e5dd7f6c5258bc26e6b40133467ab551e4bdc4 100644 (file)
     vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
                                               FIND_ANYWHERE );
 
+    playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
+                                              FIND_ANYWHERE );
+
     if( p_vout != NULL )
     {
         while ((o_window = [o_enumerator nextObject]))
             }
         }
         vlc_object_release( (vlc_object_t *)p_vout );
+        if (p_playlist) vlc_object_release(p_playlist);
     }
+
+    else if ( p_playlist != NULL )
+    {
+        if (! ([o_title isEqualToString: _NS("Half Size") ] ||
+               [o_title isEqualToString: _NS("Normal Size") ] ||
+               [o_title isEqualToString: _NS("Double Size") ] ||
+               [o_title isEqualToString: _NS("Float on Top") ] ||
+               [o_title isEqualToString: _NS("Fit to Screen") ] ))
+        {
+            vlc_value_t val;
+            var_Get( p_playlist, "fullscreen", &val );
+            var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
+        }
+    vlc_object_release( (vlc_object_t *)p_playlist );
+    }
+
 }
 
 - (void)setupVarMenuItem:(NSMenuItem *)o_mi
     {
         [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
     }
-    else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
-                [[o_mi title] isEqualToString: _NS("Half Size")] ||
+    else if( [[o_mi title] isEqualToString: _NS("Half Size")] ||
                 [[o_mi title] isEqualToString: _NS("Normal Size")] ||
                 [[o_mi title] isEqualToString: _NS("Double Size")] ||
                 [[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
             vlc_object_release( (vlc_object_t *)p_vout );
         }
     }
+    else if( [[o_mi title] isEqualToString: _NS("Fullscreen")])
+    {
+        if (p_playlist)
+        {
+            var_Get(p_playlist, "fullscreen", &val );
+            [o_mi setState: val.b_bool];
+            bEnabled = TRUE;
+        }
+        else
+        {
+            bEnabled = FALSE;
+        }
+    }
+
 
     if( p_playlist != NULL )
     {
index d2c9e0717d8cf1490cc14355b474c4105ca9fb13..07c145cc21487f91c2338f4fe0aff36ec67918d3 100644 (file)
@@ -180,6 +180,19 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * FullscreenChanged: Callback triggered by the fullscreen-change playlist
+ * variable, to let the intf update the controller.
+ *****************************************************************************/
+int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable,
+                     vlc_value_t old_val, vlc_value_t new_val, void *param )
+{
+    intf_thread_t * p_intf = VLCIntf;
+    p_intf->p_sys->b_fullscreen_update = TRUE;
+    return VLC_SUCCESS;
+}
+
+
 static struct
 {
     unichar i_nskey;
@@ -365,6 +378,11 @@ static VLCMain *_o_sharedMainInstance = nil;
         {
             playlist_Play( p_playlist );
         }
+        var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
+        val.b_bool = VLC_FALSE;
+
+        var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);
+
         [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
         vlc_object_release( p_playlist );
     }
@@ -700,6 +718,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 {
     NSDate * o_sleep_date;
     playlist_t * p_playlist;
+    vlc_value_t val;
 
     /* new thread requires a new pool */
     NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
@@ -714,6 +733,7 @@ static VLCMain *_o_sharedMainInstance = nil;
         var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
         var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
         var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
+
         vlc_object_release( p_playlist );
     }
 
@@ -816,14 +836,12 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     if ( p_intf->p_sys->b_playlist_update )
     {
-        [o_playlist playlistUpdated];
+       [o_playlist playlistUpdated];
         p_intf->p_sys->b_playlist_update = VLC_FALSE;
     }
 
     if( p_intf->p_sys->b_fullscreen_update )
     {
-        vout_thread_t * p_vout;
-
         playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                                    FIND_ANYWHERE );
 
@@ -831,16 +849,6 @@ static VLCMain *_o_sharedMainInstance = nil;
 
         vlc_object_release( p_playlist );
 
-        p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
-        if( p_vout != NULL )
-        {
-            [o_btn_fullscreen setEnabled: VLC_TRUE];
-            vlc_object_release( p_vout );
-        }
-        else
-        {
-            [o_btn_fullscreen setEnabled: VLC_FALSE];
-        }
         p_intf->p_sys->b_fullscreen_update = VLC_FALSE;
     }