]> git.sesse.net Git - vlc/commitdiff
* Added a Close Window and a close box to our QuickTime video output.
authorChristophe Massiot <massiot@videolan.org>
Sun, 5 Jan 2003 01:55:07 +0000 (01:55 +0000)
committerChristophe Massiot <massiot@videolan.org>
Sun, 5 Jan 2003 01:55:07 +0000 (01:55 +0000)
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/vout.h
modules/gui/macosx/vout.m

index 12fa707c19d7f8240187b71bdcc2a0f512c7f792..81b04656eaa1b46d443a6ce6ef00ade47cb557c7 100644 (file)
@@ -7,7 +7,7 @@
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
-               <string>407 753 308 44 0 0 1600 1178 </string>
+               <string>266 466 308 44 0 0 1152 746 </string>
                <key>303</key>
                <string>93 566 72 114 0 0 1600 1178 </string>
        </dict>
@@ -15,6 +15,8 @@
        <string>291.0</string>
        <key>IBOpenObjects</key>
        <array>
+               <integer>29</integer>
+               <integer>636</integer>
                <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
index 3f8a91761f087d0ae07af04b3b45c3e48758d9cb..cd3303dd8e740dd66f2b64b44571107ead35f8ac 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 1fad345006cfe37560f005a6603d99f12c35065c..2e5ede84eec1f726238b338ce628a206d15d1a8c 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.9 2003/01/04 04:11:08 jlj Exp $
+ * $Id: intf.h,v 1.10 2003/01/05 01:55:07 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -163,6 +163,7 @@ struct intf_sys_t
 
     IBOutlet id o_mu_window;
     IBOutlet id o_mi_minimize;
+    IBOutlet id o_mi_close_window;
     IBOutlet id o_mi_bring_atf;
 
     /* dock menu */
index 15b7b5a8525843733d4a49263d4b61513ac96c49..aa27bdeaf905f5fc02932499f7e32fb1f7a3e8e3 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.m,v 1.17 2003/01/04 04:11:08 jlj Exp $
+ * $Id: intf.m,v 1.18 2003/01/05 01:55:07 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -249,7 +249,8 @@ static void Run( intf_thread_t *p_intf )
     [o_mi_subtitle setTitle: _NS("Subtitles")];
 
     [o_mu_window setTitle: _NS("Window")];
-    [o_mi_minimize setTitle: _NS("Minimize")];
+    [o_mi_minimize setTitle: _NS("Minimize Window")];
+    [o_mi_close_window setTitle: _NS("Close Window")];
     [o_mi_bring_atf setTitle: _NS("Bring All to Front")];
 
     /* dock menu */
@@ -304,8 +305,17 @@ static void Run( intf_thread_t *p_intf )
         }
         else if( p_intf->p_sys->p_input->b_dead )
         {
+            vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
+                                                      FIND_ANYWHERE );
             vlc_object_release( p_intf->p_sys->p_input );
             p_intf->p_sys->p_input = NULL;
+
+            if ( p_vout != NULL )
+            {
+                vlc_object_detach( p_vout );
+                vlc_object_release( p_vout );
+                vout_Destroy( p_vout );
+            }
         }
 
         if( p_intf->p_sys->p_input != NULL )
@@ -461,6 +471,12 @@ static void Run( intf_thread_t *p_intf )
         p_intf->p_sys->p_input = NULL;
     }
 
+    if( o_prefs != nil )
+    {
+        [o_prefs release];
+        o_prefs = nil;
+    }
+
     /*
      * Free playlists
      */
@@ -542,6 +558,7 @@ static void Run( intf_thread_t *p_intf )
         [o_mi_channels setEnabled: FALSE];
         [o_mi_device setEnabled: FALSE];
         [o_mi_screen setEnabled: FALSE];
+        [o_mi_close_window setEnabled: FALSE];
     }
 
     p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 
@@ -801,6 +818,8 @@ static void Run( intf_thread_t *p_intf )
                 var: "video-device" selector: @selector(toggleVar:)];
 
             vlc_object_release( (vlc_object_t *)p_vout );
+
+            [o_mi_close_window setEnabled: TRUE];
         }
 
         p_intf->p_sys->b_vout_update = 0;
index 9f6f3d6d5a73eb5e52e2a73d4c97d73a23e1090d..3d5937aeed5a8b9fe32bc07ed55f1a7491708547 100644 (file)
@@ -2,7 +2,7 @@
  * vout.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.h,v 1.3 2002/12/24 23:00:51 massiot Exp $
+ * $Id: vout.h,v 1.4 2003/01/05 01:55:07 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -37,6 +37,8 @@
 - (void)toggleFullscreen;
 - (BOOL)isFullscreen;
 
+- (BOOL)windowShouldClose:(id)sender;
+
 @end
 
 /*****************************************************************************
index f2b1b55844d05fd39cc7f9ed5a1284a7c8799037..b10634c8045e4eb2aef78a20b35429b9d867b19a 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.m,v 1.9 2002/12/25 02:23:36 massiot Exp $
+ * $Id: vout.m,v 1.10 2003/01/05 01:55:07 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -317,6 +317,9 @@ void E_(CloseVideo) ( vlc_object_t *p_this )
         msg_Err( p_vout, "unable to destroy window" );
     }
 
+    if ( p_vout->p_sys->p_fullscreen_state != NULL )
+        EndFullScreen ( p_vout->p_sys->p_fullscreen_state, NULL );
+
     ExitMovies();
 
     free( p_vout->p_sys->p_matrix );
@@ -858,6 +861,24 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
     }
 }
 
+/* This is actually the same as VLCControls::stop. */
+- (BOOL)windowShouldClose:(id)sender
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+    if( p_playlist == NULL )      
+    {
+        return NO;
+    }
+
+    playlist_Stop( p_playlist );
+    vlc_object_release( p_playlist );
+
+    /* The window will be closed by the intf later. */
+    return NO;
+}
+
 @end
 
 /*****************************************************************************
@@ -1016,6 +1037,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
     {
         unsigned int i_stylemask = NSTitledWindowMask |
                                    NSMiniaturizableWindowMask |
+                                   NSClosableWindowMask |
                                    NSResizableWindowMask;
 
         [p_vout->p_sys->o_window