>From 4fbf82bfabf1d299c9eb692813c437e841a13b1b Mon Sep 17 00:00:00 2001
From: Goran Dokic <vlc@8hz.com>
Date: Sat, 2 Jan 2016 11:16:58 +0100
Subject: [PATCH] macosx: First commit VLCStatusBarIcon code for macosx gui.

---
 Makefile.am                                        |   7 +
 extras/package/macosx/Resources/Contents.json      |   6 +
 .../English.lproj/VLCStatusBarIconMainMenu.xib     |  71 ++++
 .../Media.xcassets/MenuIcon.imageset/Contents.json |  22 ++
 .../MenuIcon.imageset/vlc-statusbar-icon-21x21.png | Bin 0 -> 572 bytes
 .../MenuIcon.imageset/vlc-statusbar-icon-41x41.png | Bin 0 -> 1296 bytes
 .../package/macosx/Resources/icons/pause-19x19.png | Bin 0 -> 381 bytes
 .../package/macosx/Resources/icons/play-19x19.png  | Bin 0 -> 492 bytes
 .../package/macosx/Resources/icons/stop-19x19.png  | Bin 0 -> 281 bytes
 .../package/macosx/vlc.xcodeproj/project.pbxproj   |  37 +-
 modules/gui/macosx/Makefile.am                     |   1 +
 modules/gui/macosx/VLCStatusBarIcon.h              |  50 +++
 modules/gui/macosx/VLCStatusBarIcon.m              | 415 +++++++++++++++++++++
 modules/gui/macosx/intf.h                          |   2 +
 modules/gui/macosx/intf.m                          |  13 +-
 15 files changed, 622 insertions(+), 2 deletions(-)
 create mode 100644 extras/package/macosx/Resources/Contents.json
 create mode 100755 extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
 create mode 100644 extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/Contents.json
 create mode 100644 extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-21x21.png
 create mode 100644 extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-41x41.png
 create mode 100644 extras/package/macosx/Resources/icons/pause-19x19.png
 create mode 100644 extras/package/macosx/Resources/icons/play-19x19.png
 create mode 100644 extras/package/macosx/Resources/icons/stop-19x19.png
 create mode 100644 modules/gui/macosx/VLCStatusBarIcon.h
 create mode 100644 modules/gui/macosx/VLCStatusBarIcon.m

diff --git a/Makefile.am b/Makefile.am
index c853f52..3652aae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -855,6 +855,13 @@ EXTRA_DIST += \
 	extras/package/macosx/Resources/sidebar-icons_yosemite/ys-sidebar-playlist@2x.png \
 	extras/package/macosx/Resources/sidebar-icons_yosemite/ys-sidebar-podcast.png \
 	extras/package/macosx/Resources/sidebar-icons_yosemite/ys-sidebar-podcast@2x.png \
+        extras/package/macosx/Resources/Media.xcassets/Contents.json \
+        extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/Contents.json \
+        extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-21x21.png \
+        extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-41x41.png \
+	extras/package/macosx/Resources/icons/pause-19x19.png \
+	extras/package/macosx/Resources/icons/play-19x19.png \
+	extras/package/macosx/Resources/icons/stop-19x19.png \
 	extras/package/macosx/Resources/vlc.scriptSuite \
 	extras/package/macosx/Resources/vlc.scriptTerminology \
 	extras/package/macosx/ub.sh \
diff --git a/extras/package/macosx/Resources/Contents.json b/extras/package/macosx/Resources/Contents.json
new file mode 100644
index 0000000..da4a164
--- /dev/null
+++ b/extras/package/macosx/Resources/Contents.json
@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib b/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
new file mode 100755
index 0000000..0337ab0
--- /dev/null
+++ b/extras/package/macosx/Resources/English.lproj/VLCStatusBarIconMainMenu.xib
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="14F1509" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
+            <connections>
+                <outlet property="delegate" destination="533" id="495"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customObject id="420" customClass="NSFontManager"/>
+        <customObject id="533" customClass="VLCStatusBarIcon">
+            <connections>
+                <outlet property="VLCStatusBarIconMenu" destination="534" id="541"/>
+            </connections>
+        </customObject>
+        <menu id="534" userLabel="VLCStatusBarIconMenu">
+            <items>
+                <menuItem title="Main WIndow" toolTip="Restore main window" id="08C-TA-yqu">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <connections>
+                        <action selector="restoreMainWindow:" target="533" id="643"/>
+                    </connections>
+                </menuItem>
+                <menuItem isSeparatorItem="YES" id="t2X-zn-Z4x"/>
+                <menuItem title="Play" tag="74747" toolTip="Start/Pause playback" id="9kC-yJ-Gy5">
+                    <modifierMask key="keyEquivalentModifierMask"/>
+                    <connections>
+                        <action selector="statusBarIconTogglePlayPause:" target="533" id="644"/>
+                    </connections>
+                </menuItem>
+                <menuItem title="Stop" image="stop-19x19" toolTip="Stop playback" id="4Sh-MJ-bSf">
+                    <connections>
+                        <action selector="statusBarIconStop:" target="533" id="646"/>
+                    </connections>
+                </menuItem>
+                <menuItem isSeparatorItem="YES" id="b5S-aL-b79"/>
+                <menuItem title="Next" toolTip="Next track in playlist" id="GhQ-VQ-jtu">
+                    <connections>
+                        <action selector="statusBarIconNext:" target="533" id="647"/>
+                    </connections>
+                </menuItem>
+                <menuItem title="Previous" toolTip="Previous track in playlist" id="iHu-rd-8KL">
+                    <connections>
+                        <action selector="statusBarIconPrevious:" target="533" id="648"/>
+                    </connections>
+                </menuItem>
+                <menuItem isSeparatorItem="YES" id="Dn5-wA-WfF"/>
+                <menuItem title="Random" id="lPi-EL-hoN">
+                    <connections>
+                        <action selector="statusBarIconToggleRandom:" target="533" id="649"/>
+                    </connections>
+                </menuItem>
+                <menuItem isSeparatorItem="YES" id="p96-c8-lBM"/>
+                <menuItem title="Quit" toolTip="Quit VLC" id="539">
+                    <connections>
+                        <action selector="quitAction:" target="533" id="542"/>
+                    </connections>
+                </menuItem>
+            </items>
+            <point key="canvasLocation" x="328.5" y="267.5"/>
+        </menu>
+    </objects>
+    <resources>
+        <image name="stop-19x19" width="19" height="19"/>
+    </resources>
+</document>
diff --git a/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/Contents.json b/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/Contents.json
new file mode 100644
index 0000000..26b5694
--- /dev/null
+++ b/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "vlc-statusbar-icon-21x21.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "vlc-statusbar-icon-41x41.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}
\ No newline at end of file
diff --git a/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-21x21.png b/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-21x21.png
new file mode 100644
index 0000000000000000000000000000000000000000..05a5d3e3cb85cad8719a77a04d782f4af52820e5
GIT binary patch
diff --git a/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-41x41.png b/extras/package/macosx/Resources/Media.xcassets/MenuIcon.imageset/vlc-statusbar-icon-41x41.png
new file mode 100644
index 0000000000000000000000000000000000000000..64436d12e1c702f6d457e7e854276bcf16c1b729
GIT binary patch
diff --git a/extras/package/macosx/Resources/icons/pause-19x19.png b/extras/package/macosx/Resources/icons/pause-19x19.png
new file mode 100644
index 0000000000000000000000000000000000000000..fd33377267ba5e49134c2be19657d0dc0771f048
GIT binary patch
diff --git a/extras/package/macosx/Resources/icons/play-19x19.png b/extras/package/macosx/Resources/icons/play-19x19.png
new file mode 100644
index 0000000000000000000000000000000000000000..a2e281b7bffad926a938943f044287ee807d195d
GIT binary patch
diff --git a/extras/package/macosx/Resources/icons/stop-19x19.png b/extras/package/macosx/Resources/icons/stop-19x19.png
new file mode 100644
index 0000000000000000000000000000000000000000..0455026e2208ff33d5dcfbd8a040f0c7737e3d42
GIT binary patch
diff --git a/extras/package/macosx/vlc.xcodeproj/project.pbxproj b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
index fa0ed11..9ba685d 100644
--- a/extras/package/macosx/vlc.xcodeproj/project.pbxproj
+++ b/extras/package/macosx/vlc.xcodeproj/project.pbxproj
@@ -459,6 +459,11 @@
 		1CE5ED2419DD6AB700FCEFD3 /* lion-window-fullscreen-over@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CE5ED1E19DD6AB700FCEFD3 /* lion-window-fullscreen-over@2x.png */; };
 		1CE5ED2519DD6AB700FCEFD3 /* lion-window-fullscreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CE5ED1F19DD6AB700FCEFD3 /* lion-window-fullscreen.png */; };
 		1CE5ED2619DD6AB700FCEFD3 /* lion-window-fullscreen@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CE5ED2019DD6AB700FCEFD3 /* lion-window-fullscreen@2x.png */; };
+		532F0F251C31C5760050536C /* VLCStatusBarIconMainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 532F0F231C31C5760050536C /* VLCStatusBarIconMainMenu.xib */; settings = {ASSET_TAGS = (57575, ); }; };
+		533CFB161C32A743003AA4EE /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 533CFB151C32A743003AA4EE /* Media.xcassets */; };
+		53D49FC51C371FFC001CB49A /* pause-19x19.png in Resources */ = {isa = PBXBuildFile; fileRef = 53D49FC31C371FFC001CB49A /* pause-19x19.png */; };
+		53D49FC61C371FFC001CB49A /* play-19x19.png in Resources */ = {isa = PBXBuildFile; fileRef = 53D49FC41C371FFC001CB49A /* play-19x19.png */; };
+		53D49FCA1C37245B001CB49A /* stop-19x19.png in Resources */ = {isa = PBXBuildFile; fileRef = 53D49FC91C37245B001CB49A /* stop-19x19.png */; };
 		633121D01B5112C300E636DA /* ResumeDialog.xib in Resources */ = {isa = PBXBuildFile; fileRef = 633121CE1B5112C300E636DA /* ResumeDialog.xib */; };
 		6B13E2A81BC67678001AD24A /* VLCScrollingClipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B13E2A71BC67678001AD24A /* VLCScrollingClipView.m */; settings = {ASSET_TAGS = (); }; };
 		7D3F6525188051F2005776C4 /* BWQuincyMain.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D3F6523188051F2005776C4 /* BWQuincyMain.xib */; };
@@ -1233,6 +1238,13 @@
 		1CE5ED2019DD6AB700FCEFD3 /* lion-window-fullscreen@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-fullscreen@2x.png"; sourceTree = "<group>"; };
 		2AEF857609A5FEC900130822 /* fspanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fspanel.h; path = ../../../modules/gui/macosx/fspanel.h; sourceTree = SOURCE_ROOT; };
 		2AEF857709A5FEC900130822 /* fspanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = fspanel.m; path = ../../../modules/gui/macosx/fspanel.m; sourceTree = SOURCE_ROOT; };
+		532F0F241C31C5760050536C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/VLCStatusBarIconMainMenu.xib; sourceTree = "<group>"; };
+		532F0F261C31C68B0050536C /* VLCStatusBarIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCStatusBarIcon.h; path = ../../../modules/gui/macosx/VLCStatusBarIcon.h; sourceTree = "<group>"; };
+		532F0F271C31C68B0050536C /* VLCStatusBarIcon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCStatusBarIcon.m; path = ../../../modules/gui/macosx/VLCStatusBarIcon.m; sourceTree = "<group>"; };
+		533CFB151C32A743003AA4EE /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = Resources/Media.xcassets; sourceTree = "<group>"; };
+		53D49FC31C371FFC001CB49A /* pause-19x19.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "pause-19x19.png"; path = "Resources/icons/pause-19x19.png"; sourceTree = "<group>"; };
+		53D49FC41C371FFC001CB49A /* play-19x19.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "play-19x19.png"; path = "Resources/icons/play-19x19.png"; sourceTree = "<group>"; };
+		53D49FC91C37245B001CB49A /* stop-19x19.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "stop-19x19.png"; path = "Resources/icons/stop-19x19.png"; sourceTree = "<group>"; };
 		5CCED71014C0D4A90057F8D1 /* ExtensionsDialogProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtensionsDialogProvider.h; path = ../../../modules/gui/macosx/ExtensionsDialogProvider.h; sourceTree = SOURCE_ROOT; };
 		5CCED71114C0D4A90057F8D1 /* ExtensionsDialogProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExtensionsDialogProvider.m; path = ../../../modules/gui/macosx/ExtensionsDialogProvider.m; sourceTree = SOURCE_ROOT; };
 		5CCED71214C0D4A90057F8D1 /* ExtensionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExtensionsManager.h; path = ../../../modules/gui/macosx/ExtensionsManager.h; sourceTree = SOURCE_ROOT; };
@@ -1804,6 +1816,7 @@
 		089C167CFE841241C02AAC07 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				533CFB151C32A743003AA4EE /* Media.xcassets */,
 				DCF358BC077F1236007DB450 /* xibs */,
 				8E445F86047289E50059A3A7 /* fileicons */,
 				CC0430EE13B2461A00D7D52E /* ui graphics */,
@@ -1821,6 +1834,8 @@
 		08FB77AFFE84173DC02AAC07 /* Classes */ = {
 			isa = PBXGroup;
 			children = (
+				532F0F261C31C68B0050536C /* VLCStatusBarIcon.h */,
+				532F0F271C31C68B0050536C /* VLCStatusBarIcon.m */,
 				7D871D391B5E684D000B56C0 /* helpers.h */,
 				8EE1AF9F044465080059A3A7 /* about.h */,
 				8EE1AFA0044465080059A3A7 /* about.m */,
@@ -2385,6 +2400,9 @@
 		CC0430EE13B2461A00D7D52E /* ui graphics */ = {
 			isa = PBXGroup;
 			children = (
+				53D49FC91C37245B001CB49A /* stop-19x19.png */,
+				53D49FC31C371FFC001CB49A /* pause-19x19.png */,
+				53D49FC41C371FFC001CB49A /* play-19x19.png */,
 				1C88BC5719DC7CB300645190 /* fspanel-yosemite */,
 				CCCB86BF0ACFDE4A00CF1E10 /* fspanel */,
 				1C88BA9D19DC7C7800645190 /* mainwindow_yosemite */,
@@ -2895,7 +2913,9 @@
 		DCF358BC077F1236007DB450 /* xibs */ = {
 			isa = PBXGroup;
 			children = (
+				532F0F231C31C5760050536C /* VLCStatusBarIconMainMenu.xib */,
 				E0FB95CC1615B6DF0005069A /* DetachedVideoWindow.xib */,
+				7DD6EC0E1B58136D0047CF5C /* SimplePreferences.xib */,
 				CCD83E2E13FEA143004F1652 /* About.xib */,
 				1CBB2CC61B06A6DE00110ADA /* Help.xib */,
 				CCD83E3013FEA143004F1652 /* AudioEffects.xib */,
@@ -2905,7 +2925,6 @@
 				CCD83E3813FEA143004F1652 /* MediaInfo.xib */,
 				CCD83E3A13FEA143004F1652 /* Open.xib */,
 				CCD83E3C13FEA143004F1652 /* Preferences.xib */,
-				7DD6EC0E1B58136D0047CF5C /* SimplePreferences.xib */,
 				CCD83E3E13FEA143004F1652 /* SyncTracks.xib */,
 				CCD83E4013FEA143004F1652 /* VideoEffects.xib */,
 				CCD83E2B13FE9B90004F1652 /* MainMenu.xib */,
@@ -3029,6 +3048,9 @@
 		089C1669FE841209C02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
+				KnownAssetTags = (
+					57575,
+				);
 				LastUpgradeCheck = 0430;
 				TargetAttributes = {
 					1C07EDF61B1CD67300A0BBDB = {
@@ -3294,6 +3316,7 @@
 				CC0433AC13B28B9C00D7D52E /* generic.icns in Resources */,
 				1C88BCAC19DC7CB300645190 /* ys-fs_stop.png in Resources */,
 				CC0433AD13B28B9C00D7D52E /* m4a.icns in Resources */,
+				533CFB161C32A743003AA4EE /* Media.xcassets in Resources */,
 				CC0433AE13B28B9C00D7D52E /* m4v.icns in Resources */,
 				1C88BA6419DC7B2200645190 /* yosemite-window-fullscreen-on.png in Resources */,
 				1C88BCB419DC7CB300645190 /* ys-fs_time_slider_knob_highlight.png in Resources */,
@@ -3369,6 +3392,7 @@
 				CCD83E4A13FEA143004F1652 /* Open.xib in Resources */,
 				CCD83E4B13FEA143004F1652 /* Preferences.xib in Resources */,
 				1C88BA7419DC7B2200645190 /* yosemite-window-minimize-over.png in Resources */,
+				532F0F251C31C5760050536C /* VLCStatusBarIconMainMenu.xib in Resources */,
 				CCD83E4C13FEA143004F1652 /* SyncTracks.xib in Resources */,
 				CCD83E4D13FEA143004F1652 /* VideoEffects.xib in Resources */,
 				1C88BA9519DC7C5D00645190 /* ys-sidebar-music.png in Resources */,
@@ -3520,6 +3544,7 @@
 				CC9E5DAE15975F5B00D14E83 /* fs_volume_max_highlight@2x.png in Resources */,
 				CC9E5DAF15975F5B00D14E83 /* fs_volume_max@2x.png in Resources */,
 				CC9E5DB015975F5B00D14E83 /* fs_volume_mute_highlight@2x.png in Resources */,
+				53D49FC51C371FFC001CB49A /* pause-19x19.png in Resources */,
 				1C88BC1919DC7C8100645190 /* ys-playlist-1btn-dark.png in Resources */,
 				1C88BA9819DC7C5D00645190 /* ys-sidebar-pictures@2x.png in Resources */,
 				CC9E5DB115975F5B00D14E83 /* fs_volume_mute@2x.png in Resources */,
@@ -3690,6 +3715,7 @@
 				CC9190E3159B4CA800E634A7 /* lion-window-close-graphite@2x.png in Resources */,
 				1C88BC1A19DC7C8100645190 /* ys-playlist-1btn-dark@2x.png in Resources */,
 				CC9190E4159B4CA800E634A7 /* lion-window-close-on-graphite@2x.png in Resources */,
+				53D49FC61C371FFC001CB49A /* play-19x19.png in Resources */,
 				CC9190E5159B4CA800E634A7 /* lion-window-close-on@2x.png in Resources */,
 				CC9190E6159B4CA800E634A7 /* lion-window-close-over-graphite@2x.png in Resources */,
 				CC9190E7159B4CA800E634A7 /* lion-window-close-over@2x.png in Resources */,
@@ -3787,6 +3813,7 @@
 				CC166FFA15F517810088201B /* backward-6btns-dark-pressed@2x.png in Resources */,
 				CC166FFB15F517810088201B /* backward-6btns-dark.png in Resources */,
 				1C88BB4419DC7C7800645190 /* ys-progression-fill-left.png in Resources */,
+				53D49FCA1C37245B001CB49A /* stop-19x19.png in Resources */,
 				1C88BB0B19DC7C7800645190 /* ys-backward-3btns@2x.png in Resources */,
 				CC166FFC15F517810088201B /* backward-6btns-dark@2x.png in Resources */,
 				CC16700115F5178B0088201B /* forward-6btns-dark-pressed.png in Resources */,
@@ -3994,6 +4021,14 @@
 			name = Help.xib;
 			sourceTree = "<group>";
 		};
+		532F0F231C31C5760050536C /* VLCStatusBarIconMainMenu.xib */ = {
+			isa = PBXVariantGroup;
+			children = (
+				532F0F241C31C5760050536C /* English */,
+			);
+			name = VLCStatusBarIconMainMenu.xib;
+			sourceTree = "<group>";
+		};
 		633121CE1B5112C300E636DA /* ResumeDialog.xib */ = {
 			isa = PBXVariantGroup;
 			children = (
diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am
index 691cf12..78282e5 100644
--- a/modules/gui/macosx/Makefile.am
+++ b/modules/gui/macosx/Makefile.am
@@ -75,4 +75,5 @@ libmacosx_plugin_la_SOURCES = \
 	VLCUIWidgets.h VLCUIWidgets.m \
 	VLCScrollingClipView.h VLCScrollingClipView.m \
 	VLCVoutWindowController.h VLCVoutWindowController.m \
+	VLCStatusBarIcon.h VLCStatusBarIcon.m \
 	Windows.h Windows.m
diff --git a/modules/gui/macosx/VLCStatusBarIcon.h b/modules/gui/macosx/VLCStatusBarIcon.h
new file mode 100644
index 0000000..e11a894
--- /dev/null
+++ b/modules/gui/macosx/VLCStatusBarIcon.h
@@ -0,0 +1,50 @@
+//
+//  VLCStatusBarIcon.h
+//
+// VLC macosx statusItem: Goran Dokic <vlc at 8hz com>
+// v0.1
+//
+// some license
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+#import <cocoa/cocoa.h>
+
+
+@interface VLCStatusBarIcon : NSObject <NSMenuDelegate> {
+    NSStatusItem *_statusItem;
+    NSMenuItem *vlcStatusBarMenuItem;
+    IBOutlet NSMenu *VLCStatusBarIconMenu;
+}
+
+@property (getter=isPlaying) BOOL playing;
+@property (getter=isRandom)  BOOL random;
+@property NSTimer *dataRefreshUpdateTimer;
+
+// get data from VLC and update the little status menu
+- (void) updateMenuFromVLCdata;
+- (void) updateMenuItemRandom;
+- (void) updateMenuItemPlayPause;
+- (void) setDataUpdateTimer:(float) interval;
+
+
+
+- (IBAction) updateMenuItemContent:(id)sender;
+- (IBAction) restoreMainWindow:(id)sender;
+- (IBAction) statusBarIconTogglePlayPause:(id)sender;
+- (IBAction) statusBarIconStop:(id)sender;
+- (IBAction) statusBarIconNext:(id)sender;
+- (IBAction) statusBarIconPrevious:(id)sender;
+- (IBAction) statusBarIconToggleRandom:(id)sender;
+
+@end
diff --git a/modules/gui/macosx/VLCStatusBarIcon.m b/modules/gui/macosx/VLCStatusBarIcon.m
new file mode 100644
index 0000000..b357b5f
--- /dev/null
+++ b/modules/gui/macosx/VLCStatusBarIcon.m
@@ -0,0 +1,415 @@
+//
+//  VLCStatusBarIcon.m
+//
+// VLC macosx statusItem: Goran Dokic <vlc at 8hz com> 
+// v0.1 - 12-2015
+// 
+// some license
+//
+// THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import "VLCStatusBarIcon.h"
+
+#import "MainMenu.h"
+#import "intf.h"
+
+#import <vlc_common.h>
+#import <vlc_playlist.h>
+#import <vlc_input.h>
+#import <CoreInteraction.h>
+#import <StringUtility.h>
+
+// ==== Defines
+
+#define playPauseMenuItemTag 74747
+#define dataUpdateTimerInterval 2.0
+#define NSInitialToolTipDelayIn_ms 10
+#define maxURLLengthInMenu 50
+
+#define debug 0
+
+// ==== Implementation ========================================================
+
+@implementation VLCStatusBarIcon {
+    // need this in more methods
+
+    NSString *nameToDisplay;
+    NSString *timeToDisplay;
+    NSString *durationToDisplay;
+    NSString *urlToDisplay;
+    NSImage *menuImagePlay;
+    NSImage *menuImagePause;
+}
+
+// ==== App init ==============================================================
+
++(id)alloc 
+{
+    return [super alloc];
+}
+
+- (id)init 
+{
+    return [super init];
+}
+
+// fire it up
+- (void) awakeFromNib
+{
+
+    [super awakeFromNib];
+
+    _statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
+    [_statusItem setHighlightMode:YES];
+    [_statusItem setEnabled:YES];
+    [_statusItem setToolTip:@"VLCStatusBarIcon"];
+    [_statusItem setTarget:self];
+
+    // Attach pull-down menu
+    [_statusItem setMenu:VLCStatusBarIconMenu];
+
+    // add the top menu item for dynamic data
+    vlcStatusBarMenuItem = [[NSMenuItem alloc] initWithTitle:@"-- -- -- --"
+                 action:@selector(updateMenuItemContent:) keyEquivalent:@""];
+
+    [vlcStatusBarMenuItem setTarget:self];
+    [VLCStatusBarIconMenu insertItem:vlcStatusBarMenuItem atIndex:0];
+    
+    // Set our selves up as delegate, to receive menuNeedsUpdate messages, so
+    // we can update our menu as needed/before it's drawn
+    [VLCStatusBarIconMenu setDelegate:self];
+
+    // set icon
+    NSImage *menuIcon = [NSImage imageNamed:@"MenuIcon"];
+    [_statusItem setImage:menuIcon];
+	
+    // make sure we invert the statusItem icon on dark/light mode 
+     menuIcon.template = YES;
+     _statusItem.image = menuIcon;
+     _statusItem.highlightMode = YES;
+
+    // increase toolTip speed, improves status usability
+    // Tweak delay above (#define)
+
+    [[NSUserDefaults standardUserDefaults] setObject: [NSNumber numberWithInt: NSInitialToolTipDelayIn_ms] forKey: @"NSInitialToolTipDelay"];
+
+    // init with 'Unknown' (this now means 'empty')
+    urlToDisplay = @"Unknown";
+
+    // load the menu icons
+    menuImagePlay = [NSImage imageNamed:@"play-19x19.png"];
+    menuImagePause = [NSImage imageNamed:@"pause-19x19.png"];
+    // .. Image for menu item 'Stop' is loaded from resources through xib
+
+    // I'd rather not use a timer and only update when mouse comes near
+    // status icon in bar. But one can't tell without evil sourcery :(
+    // Tweak update frequency above (#define)
+
+    [self setDataUpdateTimer:dataUpdateTimerInterval];
+
+} // end awakeFromNib
+
+// ==== Various functions =====================================================
+
+//--- 
+// Menu delegate/callback for cocoa - called before menu is opened/displayed
+// fire off menu item updates (URL, play/pause, random, etc)
+
+- (void)menuNeedsUpdate:(NSMenu *)menu 
+{
+    if (debug) NSLog(@"MenuNeedsUpdate callback/delegate called.\n");
+
+    [self updateMenuFromVLCdata];
+}
+
+
+
+//---
+// callback for tooltip update timer
+// 
+- (void) dataRefreshTimeHandler:(NSTimer *)timer 
+{
+    if (debug) NSLog(@"tooltipRefreshTimeHandler called.\n");
+
+    // get all interesting data from VLC
+    [self gatherDataToDisplay];
+ 
+    // update the toolTip with new data
+    [self updateToolTipText];
+
+    // we can also update the dynamic menu item (item 0)
+    [self updateDynamicMenuItemText];   
+} 
+
+
+//--- Call this before updateToolTipText and updateDynamicMenuItem
+- (void) gatherDataToDisplay 
+{
+    // A nicer way than calling this through a timer would be to only
+    // update the tooltip on mouse-over, but &c
+
+    mtime_t pos;
+
+    // get name of current item - clear first! used in if/then
+    nameToDisplay = nil;
+    nameToDisplay = [[VLCCoreInteraction sharedInstance] nameOfCurrentPlaylistItem];
+
+    // if we have no name, there is probably nothing playing. 
+    // So no other useful data either.
+
+    if (nameToDisplay == nil) 
+    {
+        nameToDisplay = @"Name Unknown/Nothing playing";
+        durationToDisplay = @"--:--";
+        timeToDisplay = @"--:--";
+        urlToDisplay = @"Unknown";
+    } else {
+        input_thread_t * p_input;
+        p_input = pl_CurrentInput(VLCIntf);
+        if (p_input) 
+        {
+            pos = var_GetInteger(p_input, "time") / CLOCK_FREQ;
+            vlc_object_release(p_input); // must release or get segfault on quit
+        }
+
+        // update our time counter
+        timeToDisplay = [[VLCStringUtility sharedInstance] stringForTime:(long long) pos];
+
+        // get the duration (if it's there)
+        int duration = [[VLCCoreInteraction sharedInstance] durationOfCurrentPlaylistItem];
+        durationToDisplay = [[VLCStringUtility sharedInstance] stringForTime:(long long) duration];
+
+        // update the playing item's URL/Path
+        urlToDisplay =  [[[VLCCoreInteraction sharedInstance] URLOfCurrentPlaylistItem] absoluteString];
+    }
+
+    if (debug) NSLog(@"timeToDisplay: %@, nameToDisplay: %@, duration: %@, urlToDisplay: %@", timeToDisplay, nameToDisplay, durationToDisplay, urlToDisplay);
+
+} // end gatherDataToDisplay
+
+
+//--- Call for periodic updates of tooltip text
+- (void) updateToolTipText 
+{
+
+    // craft the multiline string, for the tooltip
+    NSString *toolTipText = [NSString stringWithFormat:@"VLC media player\nName: %@\nDuration: %@\nTime: %@\nURL/Path: %@", nameToDisplay, durationToDisplay, timeToDisplay, urlToDisplay];
+
+    [_statusItem setToolTip:toolTipText];
+
+} // end updateToolTipText
+
+
+
+//--- Call for periodic updates of dynamic menu item
+- (void) updateDynamicMenuItemText 
+{
+    NSString *menuString = nil;
+
+    // create string for dynamic menu bit
+    if ([urlToDisplay isEqualToString:@"Unknown"]) 
+    {
+         menuString =  @"-- -- -- --";
+    } else {
+         menuString = [NSString stringWithFormat:@"Copy URL: %@", urlToDisplay];
+    }
+
+    // truncate the URL string before inserting in menu.. Too long is ugly.
+    // .... fuuuu @30s does not work for NSStrings :(
+
+    if ([menuString length] > maxURLLengthInMenu) 
+    {
+         // truncate URL text for menu, add '...' cue at the end
+         [vlcStatusBarMenuItem setTitle:[NSString stringWithFormat:@"%@%@", [menuString substringToIndex:maxURLLengthInMenu],@"..."]];
+    } else {
+         // use full length, no '...' needed at the end
+         [vlcStatusBarMenuItem setTitle:[NSString stringWithFormat:@"%@", menuString]];
+
+    }
+}
+
+
+//--- 
+// set timer for tooltips updates and flee
+//
+- (void) setDataUpdateTimer:(float) interval 
+{
+    self.dataRefreshUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:interval
+    target:self
+    selector:@selector(dataRefreshTimeHandler:)
+    userInfo:nil
+    repeats:YES];
+}
+
+
+
+//--- 
+- (void) updateMenuItemRandom 
+{
+
+   // get current random status
+    bool b_value;
+    playlist_t *p_playlist = pl_Get(VLCIntf);
+    b_value = var_GetBool(p_playlist, "random");
+
+    if (debug) NSLog(@"Random status from vlc is: %d. Setting menu item Random.", b_value);
+
+    // get menuitem 'Random'
+    NSMenuItem* menuItemToChange = [VLCStatusBarIconMenu itemWithTitle:@"Random"];
+    if (b_value)  
+    {
+        [menuItemToChange setState:NSOnState];
+    } else {
+        [menuItemToChange setState:NSOffState];
+    }
+} // end updateMenuItemRandom
+
+
+//--- 
+- (void) updateMenuItemTrackInfo 
+{
+    // get track info
+    // update menu
+} // end updateMenuItemTrackInfo 
+
+
+
+//--- 
+- (void) updateMenuItemPlayPause 
+{
+
+    bool vlcPlaying = false;
+   
+    // get the current title of the mainMenu 'play' menuitem, it will hold
+    // it's status. Follow it in our status menu. 
+
+    NSString *titleString = [[[[VLCMain sharedInstance] mainMenu] play] title];
+
+    // note: if vlc mainmenu item title says 'pause', this means vlc is playing
+    if ([titleString isEqualToString:@"Pause"]) 
+    {   
+         vlcPlaying = true;
+    } 
+
+    // Select our 'play/pause' menuItem and update it as necessary.
+    // Tagged this menuitem in the xib, to be able to select it easily, 
+    // despite the variable nature.. see #define above
+
+    NSMenuItem* menuItemToChange = [VLCStatusBarIconMenu itemWithTag:playPauseMenuItemTag];
+
+    if (vlcPlaying) 
+    {
+        [menuItemToChange setTitle:@"Pause"];
+        [menuItemToChange setImage:menuImagePause];
+    } else {
+        [menuItemToChange setTitle:@"Play"];
+        [menuItemToChange setImage:menuImagePlay];
+    }
+
+} // end updateMenuItemPlayPause
+
+
+
+//--- Called when opening menu, to update status of various items
+- (void) updateMenuFromVLCdata {
+
+    // menu item index0 (URL/Path) is updated in dataRefreshTimeHandler
+
+    // update play/pause status in status bar menu
+    [self updateMenuItemPlayPause];
+
+    // update random status in status bar menu
+    [self updateMenuItemRandom];
+
+} // end updateMenuFromVLCData
+
+
+
+
+
+// ==== Menu actions ==========================================================
+
+// action for dynamic menu index 0 
+
+- (IBAction) updateMenuItemContent:(id)sender 
+{
+    // We update this item through the tooltip/timer cycle. As all data 
+    // is prepared there.
+    // Here we offer to copy the url to the clipboard (useful imo ;-)
+
+    NSString *menuString;
+
+    if ([urlToDisplay isEqualToString:@"Unknown"]) 
+    {
+ 	// Don't copy anything to clipboard, as the 'URL/path' is emtpy
+    } else {
+        // We have sane data, selecting menu item places URL/path in 
+        // system copy/paste buffer
+        [[NSPasteboard generalPasteboard] clearContents];
+        [[NSPasteboard generalPasteboard] setString:urlToDisplay  forType:NSStringPboardType];        
+    }
+}
+
+// action for 'main window'
+
+- (IBAction)restoreMainWindow:(id)sender 
+{
+    // force our window to go to front (huzzah) and restore window
+    [[VLCApplication sharedApplication] activateIgnoringOtherApps:YES];
+    [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:sender];
+}
+
+// action for 'toggle play/pause'
+
+- (IBAction)statusBarIconTogglePlayPause:(id)sender 
+{
+    [[VLCCoreInteraction sharedInstance] playOrPause];
+}
+
+// action for 'stop'
+
+- (IBAction)statusBarIconStop:(id)sender 
+{
+    [[VLCCoreInteraction sharedInstance] stop];
+}
+
+// action for 'Next track'
+
+- (IBAction)statusBarIconNext:(id)sender 
+{
+    [[VLCCoreInteraction sharedInstance] next];
+}
+
+// action for 'previous track'
+
+- (IBAction)statusBarIconPrevious:(id)sender 
+{
+    [[VLCCoreInteraction sharedInstance] previous];
+}
+
+// action to actually 'toggle VLC randomize playorder status' 
+
+- (IBAction)statusBarIconToggleRandom:(id)sender 
+{
+    [[VLCCoreInteraction sharedInstance] shuffle];
+}
+
+// action voor 'quit'
+
+- (IBAction)quitAction:(id)sender 
+{
+    // clean timer, quit 
+    [self.dataRefreshUpdateTimer invalidate];
+    [[NSApplication sharedApplication] terminate:nil];
+}
+
+@end
diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index f3cc079..6e297fd 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -74,6 +74,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 @class VLCVideoEffects;
 @class VLCConvertAndSave;
 @class ExtensionsManager;
+@class VLCStatusBarIcon;
 
 @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
 
@@ -95,6 +96,7 @@ static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
 - (ResumeDialogController *)resumeDialog;
 - (VLCInputManager *)inputManager;
 - (ExtensionsManager *)extensionsManager;
+- (VLCStatusBarIcon *)statusBarIcon;
 
 - (VLCDebugMessageVisualizer *)debugMsgPanel;
 
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 63d3e43..9705c75 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -65,6 +65,8 @@
 #import "AudioEffects.h"
 #import "intf-prefs.h"
 
+#import "VLCStatusBarIcon.h"
+
 #ifdef HAVE_SPARKLE
 #import <Sparkle/Sparkle.h>                 /* we're the update delegate */
 #endif
@@ -94,7 +96,10 @@ int OpenIntf (vlc_object_t *p_this)
         [VLCMain sharedInstance];
 
         [NSBundle loadNibNamed:@"MainMenu" owner:[[VLCMain sharedInstance] mainMenu]];
+        [NSBundle loadNibNamed:@"VLCStatusBarIconMainMenu" owner:[[VLCMain sharedInstance] statusBarIcon]];
+
         [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
+	
 
         msg_Dbg(p_intf, "Finished loading macosx interface");
         return VLC_SUCCESS;
@@ -165,6 +170,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
     ResumeDialogController *_resume_dialog;
     VLCInputManager *_input_manager;
     VLCPlaylist *_playlist;
+    VLCStatusBarIcon *_statusBarIcon;
     VLCDebugMessageVisualizer *_messagePanelController;
     VLCTrackSynchronization *_trackSyncPanel;
     VLCAudioEffects *_audioEffectsPanel;
@@ -221,7 +227,7 @@ static VLCMain *sharedInstance = nil;
         _voutController = [[VLCVoutWindowController alloc] init];
         _playlist = [[VLCPlaylist alloc] init];
 
-        _mainWindowController = [[NSWindowController alloc] initWithWindowNibName:@"MainWindow"];
+	_mainWindowController = [[NSWindowController alloc] initWithWindowNibName:@"MainWindow"];
 
         var_Create(p_intf, "intf-change", VLC_VAR_BOOL);
 
@@ -499,6 +505,11 @@ static VLCMain *sharedInstance = nil;
     return _mainmenu;
 }
 
+- (VLCStatusBarIcon *)statusBarIcon
+{
+    return _statusBarIcon;
+}
+
 - (VLCMainWindow *)mainWindow
 {
     return (VLCMainWindow *)[_mainWindowController window];
-- 
2.5.4 (Apple Git-61)

