[vlc-commits] macosx: re-implement the 'icon-change' options

Felix Paul Kühne git at videolan.org
Mon Apr 23 01:22:32 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr 23 01:22:18 2012 +0200| [608e4c7059b1e7569ecd14fcccbe84bff9870f6d] | committer: Felix Paul Kühne

macosx: re-implement the 'icon-change' options

Note that the displayed icon is a re-rendering based upon the original sources, since we need a higher resolution icon on the Mac.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=608e4c7059b1e7569ecd14fcccbe84bff9870f6d
---

 extras/package/macosx/Resources/icons/vlc-xmas.png |  Bin 0 -> 222641 bytes
 .../package/macosx/vlc.xcodeproj/project.pbxproj   |    4 ++++
 modules/gui/macosx/intf.m                          |   15 +++++++++++++++
 modules/gui/macosx/macosx.m                        |    4 ++++
 4 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/extras/package/macosx/Resources/icons/vlc-xmas.png b/extras/package/macosx/Resources/icons/vlc-xmas.png
new file mode 100644
index 0000000..7e2b59c
Binary files /dev/null and b/extras/package/macosx/Resources/icons/vlc-xmas.png differ
diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
index e8e34c4..0b37ac4 100644
--- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
@@ -248,6 +248,7 @@
 		CC58012C1423A85300166912 /* fs_volume_slider_bar at x1.5.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5801111423A85300166912 /* fs_volume_slider_bar at x1.5.png */; };
 		CC58012D1423A85300166912 /* fs_volume_slider_knob_highlight at x1.5.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5801121423A85300166912 /* fs_volume_slider_knob_highlight at x1.5.png */; };
 		CC58012E1423A85300166912 /* fs_volume_slider_knob at x1.5.png in Resources */ = {isa = PBXBuildFile; fileRef = CC5801131423A85300166912 /* fs_volume_slider_knob at x1.5.png */; };
+		CC68B0331544C1AE00FD9C7F /* vlc-xmas.png in Resources */ = {isa = PBXBuildFile; fileRef = CC68B0321544C1AE00FD9C7F /* vlc-xmas.png */; };
 		CC78DA4413DE056700E9603C /* topbar_background.png in Resources */ = {isa = PBXBuildFile; fileRef = CC78DA4313DE056700E9603C /* topbar_background.png */; };
 		CC8062641021F8790021EB9A /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = CC8062631021F8790021EB9A /* dsa_pub.pem */; };
 		CC84FB2D130083BB00816D38 /* BGHUDAppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC84FB2C130083BB00816D38 /* BGHUDAppKit.framework */; };
@@ -575,6 +576,7 @@
 		CC5801111423A85300166912 /* fs_volume_slider_bar at x1.5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fs_volume_slider_bar at x1.5.png"; path = "Resources/fspanel/fs_volume_slider_bar at x1.5.png"; sourceTree = "<group>"; };
 		CC5801121423A85300166912 /* fs_volume_slider_knob_highlight at x1.5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fs_volume_slider_knob_highlight at x1.5.png"; path = "Resources/fspanel/fs_volume_slider_knob_highlight at x1.5.png"; sourceTree = "<group>"; };
 		CC5801131423A85300166912 /* fs_volume_slider_knob at x1.5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fs_volume_slider_knob at x1.5.png"; path = "Resources/fspanel/fs_volume_slider_knob at x1.5.png"; sourceTree = "<group>"; };
+		CC68B0321544C1AE00FD9C7F /* vlc-xmas.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "vlc-xmas.png"; path = "Resources/icons/vlc-xmas.png"; sourceTree = "<group>"; };
 		CC6C01A90DDF3E9200C7D754 /* intf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = intf.h; path = ../../../modules/gui/minimal_macosx/intf.h; sourceTree = SOURCE_ROOT; };
 		CC6C01AA0DDF3E9200C7D754 /* intf.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = intf.m; path = ../../../modules/gui/minimal_macosx/intf.m; sourceTree = SOURCE_ROOT; };
 		CC6C01AB0DDF3E9200C7D754 /* macosx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = macosx.c; path = ../../../modules/gui/minimal_macosx/macosx.c; sourceTree = SOURCE_ROOT; };
@@ -827,6 +829,7 @@
 				CC0433A313B28B9C00D7D52E /* vlc.icns */,
 				CC0433A413B28B9C00D7D52E /* vob.icns */,
 				CC0433A513B28B9C00D7D52E /* wav.icns */,
+				CC68B0321544C1AE00FD9C7F /* vlc-xmas.png */,
 				CC0433A613B28B9C00D7D52E /* wma.icns */,
 				CC0433A713B28B9C00D7D52E /* wmv.icns */,
 			);
@@ -1539,6 +1542,7 @@
 				CC0F725315063C820086B6A0 /* fullscreen-one-button.png in Resources */,
 				CC0F725715063C980086B6A0 /* fullscreen-one-button_dark.png in Resources */,
 				CC0F725815063C980086B6A0 /* fullscreen-one-button-pressed_dark.png in Resources */,
+				CC68B0331544C1AE00FD9C7F /* vlc-xmas.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 93a6696..90f7c6c 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -626,6 +626,21 @@ static VLCMain *_o_sharedMainInstance = nil;
     if (i_value > 0)
         var_SetInteger( pl_Get( VLCIntf ), "audio-device", i_value );
 
+    if (config_GetInt( VLCIntf, "macosx-icon-change"))
+    {
+        /* After day 354 of the year, the usual VLC cone is replaced by another cone
+         * wearing a Father Xmas hat.
+         * Note: this icon doesn't represent an endorsement of The Coca-Cola Company.
+         */
+        NSCalendar *gregorian =
+        [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
+        NSUInteger dayOfYear = [gregorian ordinalityOfUnit:NSDayCalendarUnit inUnit:NSYearCalendarUnit forDate:[NSDate date]];
+        [gregorian release];
+
+        if (dayOfYear >= 354)
+            [[VLCApplication sharedApplication] setApplicationIconImage: [NSImage imageNamed:@"vlc-xmas"]];
+    }
+
     nib_main_loaded = TRUE;
 }
 
diff --git a/modules/gui/macosx/macosx.m b/modules/gui/macosx/macosx.m
index 8a6f096..4ba8075 100644
--- a/modules/gui/macosx/macosx.m
+++ b/modules/gui/macosx/macosx.m
@@ -102,6 +102,9 @@ void WindowClose  ( vout_window_t * );
 #define PAUSE_MINIMIZED_LONGTEXT N_( \
 "With this option enabled, the playback will be automatically paused when minimizing the window." )
 
+#define ICONCHANGE_TEXT N_( "Allow automatic icon changes")
+#define ICONCHANGE_LONGTEXT N_( "This option allows the interface to change its icon on various occasions.")
+
 #define LOCK_ASPECT_RATIO_TEXT N_("Lock Aspect Ratio")
 
 vlc_module_begin ()
@@ -125,6 +128,7 @@ vlc_module_begin ()
     add_bool( "macosx-video-autoresize", true, KEEPSIZE_TEXT, KEEPSIZE_LONGTEXT, false )
     add_bool( "macosx-pause-minimized", false, PAUSE_MINIMIZED_TEXT, PAUSE_MINIMIZED_LONGTEXT, false )
     add_bool( "macosx-lock-aspect-ratio", true, LOCK_ASPECT_RATIO_TEXT, LOCK_ASPECT_RATIO_TEXT, true )
+    add_bool( "macosx-icon-change", true, ICONCHANGE_TEXT, ICONCHANGE_LONGTEXT, true )
 
     add_submodule ()
         set_description( "Mac OS X Video Output Provider" )



More information about the vlc-commits mailing list