]> git.sesse.net Git - vlc/commitdiff
* Option for Desktop Background mode for VLC OSX.
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 9 Sep 2005 21:19:15 +0000 (21:19 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 9 Sep 2005 21:19:15 +0000 (21:19 +0000)
  Does not work on the fly, because that requires recreating the window atm.

modules/gui/macosx/macosx.m
modules/gui/macosx/vout.m

index f0df4f2802c366bd5e70377f620f25dcd4162df1..4dd2c1c18dcb3d030c2ea66fe49dc516d82ac8f6 100644 (file)
@@ -66,6 +66,10 @@ void E_(CloseVideoGL) ( vlc_object_t * );
 #define FILL_LONGTEXT N_("In fullscreen mode, crop the picture if " \
         "necessary in order to fill the screen without black " \
         "borders (OpenGL only)." )
+        
+#define BACKGROUND_TEXT N_("Use as Desktop Background")
+#define BACKGROUND_LONGTEXT N_("Use the video as the Desktop Background " \
+        "of the Finder. Desktop icons cannot be interacted with in this mode." )
 
 vlc_module_begin();
     set_description( _("Mac OS X interface") );
@@ -87,6 +91,8 @@ vlc_module_begin();
                 OPAQUENESS_TEXT, OPAQUENESS_LONGTEXT, VLC_TRUE );
         add_bool( "macosx-fill", 0, NULL, FILL_TEXT, FILL_LONGTEXT,
                   VLC_TRUE );
+        add_bool( "macosx-background", 0, NULL, BACKGROUND_TEXT, BACKGROUND_LONGTEXT,
+                     VLC_FALSE );
     add_submodule();
         set_description( "Mac OS X OpenGL" );
         set_capability( "opengl provider", 100 );
index 1918e1e128fef8f13dd5c77dbdea59bbc605a220..7238dc94be4f464de6c077b0d35a87e32cd9cef5 100644 (file)
@@ -144,6 +144,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     var_Create( p_vout, "macosx-fill", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     var_Create( p_vout, "macosx-opaqueness", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
+    var_Create( p_vout, "macosx-background", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
 
     /* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */
     if( var_Type( p_real_vout->p_vlc, "video-device" ) == 0 )
@@ -234,6 +235,19 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
                              NULL, NULL, fullScreenAllowEvents );
         }
     }
+    else if( var_GetBool( p_real_vout, "macosx-background" ) )
+    {
+        NSRect screen_rect = [o_screen frame];
+        screen_rect.origin.x = screen_rect.origin.y = 0;
+
+        /* Creates a window with size: screen_rect on o_screen */
+        [self initWithContentRect: screen_rect
+              styleMask: NSBorderlessWindowMask
+              backing: NSBackingStoreBuffered
+              defer: YES screen: o_screen];
+
+        [self setLevel: CGWindowLevelForKey(kCGDesktopWindowLevelKey)];
+    }
     else
     {
         unsigned int i_stylemask = NSTitledWindowMask |