]> git.sesse.net Git - vlc/commitdiff
* modules/gui/macosx/macosx.m
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 1 May 2003 01:11:17 +0000 (01:11 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 1 May 2003 01:11:17 +0000 (01:11 +0000)
  - added a macosx-float config option
  - changed 'opaqueness' into 'macosx-opaqueness'
* modules/gui/macosx/vout.?
  - let vout respect 'float' on top option.
  - added a toggle function to toggle float on top.
ALL:
  - menuitem and corresponding code for float on top.

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/objects.nib
modules/gui/macosx/controls.h
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/macosx.m
modules/gui/macosx/vout.h
modules/gui/macosx/vout.m

index 8ab51cbf84cc1ce2afc29601f3ddd3165edf3027..2ae839d42f3c780e5a4cde05fe6d1c045194e392 100644 (file)
@@ -22,6 +22,7 @@
                 deinterlace = id; 
                 doubleWindow = id; 
                 faster = id; 
+                floatOnTop = id; 
                 forward = id; 
                 fullscreen = id; 
                 halfWindow = id; 
                 "o_mi_device" = id; 
                 "o_mi_double_window" = id; 
                 "o_mi_faster" = id; 
+                "o_mi_floatontop" = id; 
                 "o_mi_fullscreen" = id; 
                 "o_mi_fwd" = id; 
                 "o_mi_half_window" = id; 
index d0bc185b993a9da715d79df861879976f6ed666c..15bf516846555c1c30d0dcdfd52e7395c7300481 100644 (file)
@@ -23,8 +23,8 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>1411</integer>
                <integer>29</integer>
+               <integer>1411</integer>
        </array>
        <key>IBSystem Version</key>
        <string>6L29</string>
index 498649ce7e168b5dd87c1bd612a67bf46ff29a14..0ddfd0046f0f8802bd99acba1cabdd8e740c6e34 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 0562e72ff63ee0fdcb3a78a38cd5c484eda09c1a..ae77743fdbbcea0c6f7a78dee58f57aa1c98ef8d 100644 (file)
@@ -2,7 +2,7 @@
  * controls.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.h,v 1.1 2003/03/06 11:43:07 hartman Exp $
+ * $Id: controls.h,v 1.2 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -56,6 +56,7 @@
 - (IBAction)normalWindow:(id)sender;
 - (IBAction)doubleWindow:(id)sender;
 - (IBAction)fullscreen:(id)sender;
+- (IBAction)floatOnTop:(id)sender;
 - (IBAction)deinterlace:(id)sender;
 
 - (IBAction)toggleProgram:(id)sender;
index b9b7f2c9931ddc279c565aab5d8cb90c838012ff..d63577cec549c229f7a078cb491c4fbc91f4b243 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.33 2003/04/30 14:04:53 hartman Exp $
+ * $Id: controls.m,v 1.34 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
     }
 }
 
+- (IBAction)floatOnTop:(id)sender
+{
+    id o_window = [NSApp keyWindow];
+    NSArray *o_windows = [NSApp windows];
+    NSEnumerator *o_enumerator = [o_windows objectEnumerator];
+    
+    while ((o_window = [o_enumerator nextObject]))
+    {
+        if( [[o_window className] isEqualToString: @"VLCWindow"] )
+        {
+            [o_window toggleFloatOnTop];
+        }
+    }
+}
+
 - (IBAction)deinterlace:(id)sender
 {
     intf_thread_t * p_intf = [NSApp getIntf];
     else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
                 [[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("Double Size")] ||
+                [[o_mi title] isEqualToString: _NS("Float On Top")] )
     {
         id o_window;
         NSArray *o_windows = [NSApp windows];
         NSEnumerator *o_enumerator = [o_windows objectEnumerator];
         bEnabled = FALSE;
         
+        if ( [[o_mi title] isEqualToString: _NS("Float On Top")] )
+        {
+            int i_state = config_GetInt( p_playlist, "macosx-float" ) ?
+                      NSOnState : NSOffState;
+            [o_mi setState: i_state];
+        }
+        
         while ((o_window = [o_enumerator nextObject]))
         {
             if( [[o_window className] isEqualToString: @"VLCWindow"] )
             }
         }
     }
+    else if( [[o_mi title] isEqualToString: _NS("Float On Top")] )
+    {
+        
+        bEnabled = TRUE;
+    }
     else if( o_menu != nil && 
              [[o_menu title] isEqualToString: _NS("Deinterlace")] )
     {
index 68dc0fd2856f0b83a8abed449203b86b03ec8fcf..9abc3febf8d47195b9e0a692642f3cae2fb5fc55 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.h,v 1.33 2003/04/06 23:21:13 massiot Exp $
+ * $Id: intf.h,v 1.34 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -188,6 +188,7 @@ struct intf_sys_t
     IBOutlet id o_mi_normal_window;
     IBOutlet id o_mi_double_window;
     IBOutlet id o_mi_fullscreen;
+    IBOutlet id o_mi_floatontop;
     IBOutlet id o_mi_screen;
     IBOutlet id o_mi_deinterlace;
     IBOutlet id o_mu_deinterlace;
index c113e04a248f112ab76a78d4fcb2f0aafb727733..4f5a21ca2c378456f2f44bedc37147a6fedd916b 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.70 2003/04/15 14:05:13 hartman Exp $
+ * $Id: intf.m,v 1.71 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -346,6 +346,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
     [o_mi_normal_window setTitle: _NS("Normal Size")];
     [o_mi_double_window setTitle: _NS("Double Size")];
     [o_mi_fullscreen setTitle: _NS("Fullscreen")];
+    [o_mi_floatontop setTitle: _NS("Float On Top")];
     [o_mi_screen setTitle: _NS("Screen")];
     [o_mi_deinterlace setTitle: _NS("Deinterlace")];
     [o_mu_deinterlace setTitle: _NS("Deinterlace")];
index 630884fbcb12013e82f95570645bc626172eef3c..ba9f14c365abf4c5fbbc09236613aa665678ecef 100644 (file)
@@ -2,7 +2,7 @@
  * macosx.m: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: macosx.m,v 1.7 2003/04/19 13:55:56 hartman Exp $
+ * $Id: macosx.m,v 1.8 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Eugenio Jarosiewicz <ej0@cise.ufl.edu>
@@ -50,6 +50,10 @@ void E_(CloseVideo)   ( vlc_object_t * );
 #define OPAQUENESS_LONGTEXT N_( \
     "Set the transparency of the video output. 1 is non-transparent (default) " \
     "0 is fully transparent.")
+    
+#define FLOAT_TEXT N_("float on top")
+#define FLOAT_LONGTEXT N_( \
+    "Let the video window float on top of other windows.")
 
 vlc_module_begin();
     set_description( _("MacOS X interface, sound and video") );
@@ -61,6 +65,7 @@ vlc_module_begin();
         set_callbacks( E_(OpenVideo), E_(CloseVideo) );
         add_category_hint( N_("Video"), NULL, VLC_FALSE );
         add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT, VLC_FALSE );
-        add_float( "opaqueness", 1, NULL, OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_FALSE );
+        add_float( "macosx-opaqueness", 1, NULL, OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_FALSE );
+        add_bool( "macosx-float", 0, NULL, FLOAT_TEXT, FLOAT_LONGTEXT, VLC_FALSE );
 vlc_module_end();
 
index 59e2b4f431553fa3492cd20e2f020158e63a4ebf..0d96be5f0770f4e7a2510c8573bbba3556716f0b 100644 (file)
@@ -2,7 +2,7 @@
  * vout.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.h,v 1.10 2003/03/06 11:43:07 hartman Exp $
+ * $Id: vout.h,v 1.11 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -35,6 +35,7 @@
 - (vout_thread_t *)getVout;
 
 - (void)scaleWindowWithFactor: (float)factor;
+- (void)toggleFloatOnTop;
 - (void)toggleFullscreen;
 - (BOOL)isFullscreen;
 - (void)updateTitle;
index 5b23cb7eddcc084ca2bf5355eaa88013ed045a8b..518482a4e03c88b35ac1773c22c50ffefdb73d45 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.44 2003/04/19 13:55:56 hartman Exp $
+ * $Id: vout.m,v 1.45 2003/05/01 01:11:17 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -818,6 +818,20 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
     }
 }
 
+- (void)toggleFloatOnTop
+{
+    if( config_GetInt( p_vout, "macosx-float" ) )
+    {
+        config_PutInt( p_vout, "macosx-float", 0 );
+        [p_vout->p_sys->o_window setLevel: NSNormalWindowLevel];
+    }
+    else
+    {
+        config_PutInt( p_vout, "macosx-float", 1 );
+        [p_vout->p_sys->o_window setLevel: NSStatusWindowLevel];
+    }
+}
+
 - (void)toggleFullscreen
 {
     p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
@@ -1256,8 +1270,13 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
             backing: NSBackingStoreBuffered
             defer: NO screen: o_screen];
 
-        [p_vout->p_sys->o_window setAlphaValue: config_GetFloat( p_vout, "opaqueness" )];
-
+        [p_vout->p_sys->o_window setAlphaValue: config_GetFloat( p_vout, "macosx-opaqueness" )];
+        
+        if( config_GetInt( p_vout, "macosx-float" ) )
+        {
+            [p_vout->p_sys->o_window setLevel: NSStatusWindowLevel];
+        }
+        
         if( !p_vout->p_sys->b_pos_saved )   
         {
             [p_vout->p_sys->o_window center];