Commit ff8d1971 authored by David Fuhrmann's avatar David Fuhrmann

macosx: add yosemite graphics to project file and use them in code

This also cleans up the images structure inside the project.

(cherry picked from commit 6616504dfb7658f3b394bef2555f92a390e682ed)
Signed-off-by: default avatarDavid Fuhrmann <dfuhrmann@videolan.org>

Conflicts:
	modules/gui/macosx/StringUtility.m
parent 0baaf44f
......@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">13C64</string>
<string key="IBDocument.SystemVersion">13F34</string>
<string key="IBDocument.InterfaceBuilderVersion">851</string>
<string key="IBDocument.AppKitVersion">1265.19</string>
<string key="IBDocument.HIToolboxVersion">697.40</string>
<string key="IBDocument.AppKitVersion">1265.21</string>
<string key="IBDocument.HIToolboxVersion">698.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
......@@ -22,9 +22,9 @@
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="5260"/>
<integer value="4850"/>
<integer value="5605"/>
<integer value="4682"/>
<integer value="4850"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -2540,6 +2540,14 @@
</object>
<int key="connectionID">5619</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_dropzone_img</string>
<reference key="source" ref="498338108"/>
<reference key="destination" ref="684815277"/>
</object>
<int key="connectionID">5620</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -4133,7 +4141,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">5619</int>
<int key="maxID">5620</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -4812,6 +4820,7 @@
<string>o_chosen_category_lbl</string>
<string>o_dropzone_box</string>
<string>o_dropzone_btn</string>
<string>o_dropzone_img</string>
<string>o_dropzone_lbl</string>
<string>o_dropzone_view</string>
<string>o_left_split_view</string>
......@@ -4866,6 +4875,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
......@@ -4875,6 +4885,7 @@
<string>o_chosen_category_lbl</string>
<string>o_dropzone_box</string>
<string>o_dropzone_btn</string>
<string>o_dropzone_img</string>
<string>o_dropzone_lbl</string>
<string>o_dropzone_view</string>
<string>o_left_split_view</string>
......@@ -4914,6 +4925,10 @@
<string key="name">o_dropzone_btn</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropzone_img</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_dropzone_lbl</string>
<string key="candidateClassName">id</string>
......@@ -5368,7 +5383,6 @@
<string>o_save_accessory_text</string>
<string>o_save_accessory_view</string>
<string>o_search_field</string>
<string>o_search_field_other</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -5394,7 +5408,6 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
......@@ -5423,7 +5436,6 @@
<string>o_save_accessory_text</string>
<string>o_save_accessory_view</string>
<string>o_search_field</string>
<string>o_search_field_other</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -5515,10 +5527,6 @@
<string key="name">o_search_field</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_search_field_other</string>
<string key="candidateClassName">id</string>
</object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="267334972">
......@@ -5703,7 +5711,7 @@
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="1011542144">
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
......@@ -5852,10 +5860,6 @@
<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="1011542144"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="1046022160"/>
......@@ -6145,13 +6149,6 @@
<string key="minorKey">WebKit.framework/Headers/WebFrameLoadDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">WebKit.framework/Headers/WebJavaPlugIn.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -64,6 +64,7 @@ typedef enum {
IBOutlet id o_dropzone_btn;
IBOutlet id o_dropzone_lbl;
IBOutlet id o_dropzone_box;
IBOutlet id o_dropzone_img;
VLCFSPanel *o_fspanel;
......
......@@ -176,6 +176,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_dropzone_btn setTitle: _NS("Open media...")];
[[o_dropzone_btn cell] accessibilitySetOverrideValue:_NS("Click to open an advanced dialog to select the media to play. You can also drop files here to play.") forAttribute:NSAccessibilityDescriptionAttribute];
[o_dropzone_lbl setStringValue: _NS("Drop media here")];
[o_dropzone_img setImage: imageFromRes(@"dropzone")];
[o_podcast_add_btn setTitle: _NS("Subscribe")];
[o_podcast_remove_btn setTitle: _NS("Unsubscribe")];
......@@ -325,9 +326,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
o_sidebaritems = [[NSMutableArray alloc] init];
SideBarItem *libraryItem = [SideBarItem itemWithTitle:_NS("LIBRARY") identifier:@"library"];
SideBarItem *playlistItem = [SideBarItem itemWithTitle:_NS("Playlist") identifier:@"playlist"];
[playlistItem setIcon: [NSImage imageNamed:@"sidebar-playlist"]];
[playlistItem setIcon: imageFromRes(@"sidebar-playlist")];
SideBarItem *medialibraryItem = [SideBarItem itemWithTitle:_NS("Media Library") identifier:@"medialibrary"];
[medialibraryItem setIcon: [NSImage imageNamed:@"sidebar-playlist"]];
[medialibraryItem setIcon: imageFromRes(@"sidebar-playlist")];
SideBarItem *mycompItem = [SideBarItem itemWithTitle:_NS("MY COMPUTER") identifier:@"mycomputer"];
SideBarItem *devicesItem = [SideBarItem itemWithTitle:_NS("DEVICES") identifier:@"devices"];
SideBarItem *lanItem = [SideBarItem itemWithTitle:_NS("LOCAL NETWORK") identifier:@"localnetwork"];
......@@ -352,7 +353,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
case SD_CAT_INTERNET:
[internetItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
if (!strncmp(*ppsz_name, "podcast", 7))
[[internetItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-podcast"]];
[[internetItems lastObject] setIcon: imageFromRes(@"sidebar-podcast")];
else
[[internetItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[internetItems lastObject] setSdtype: SD_CAT_INTERNET];
......@@ -366,18 +367,18 @@ static VLCMainWindow *_o_sharedInstance = nil;
break;
case SD_CAT_LAN:
[lanItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[lanItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-local"]];
[[lanItems lastObject] setIcon: imageFromRes(@"sidebar-local")];
[[lanItems lastObject] setSdtype: SD_CAT_LAN];
[[lanItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
break;
case SD_CAT_MYCOMPUTER:
[mycompItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
if (!strncmp(*ppsz_name, "video_dir", 9))
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-movie"]];
[[mycompItems lastObject] setIcon: imageFromRes(@"sidebar-movie")];
else if (!strncmp(*ppsz_name, "audio_dir", 9))
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-music"]];
[[mycompItems lastObject] setIcon: imageFromRes(@"sidebar-music")];
else if (!strncmp(*ppsz_name, "picture_dir", 11))
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-pictures"]];
[[mycompItems lastObject] setIcon: imageFromRes(@"sidebar-pictures")];
else
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[mycompItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
......
......@@ -67,7 +67,7 @@
- (void)awakeFromNib
{
[self setAutoresizesSubviews: YES];
[self setImagesLeft:[NSImage imageNamed:@"topbar-dark-left"] middle: [NSImage imageNamed:@"topbar-dark-center-fill"] right:[NSImage imageNamed:@"topbar-dark-right"]];
[self setImagesLeft:imageFromRes(@"topbar-dark-left") middle: imageFromRes(@"topbar-dark-center-fill") right:imageFromRes(@"topbar-dark-right")];
[self loadButtonIcons];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(controlTintChanged:) name: NSControlTintDidChangeNotification object: nil];
......
......@@ -256,7 +256,6 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
[_delegate mediaKeyTap:self receivedMediaKeyEvent:event];
}
-(void)eventTapThread;
{
_tapThreadRL = CFRunLoopGetCurrent();
......
......@@ -38,6 +38,12 @@
NSString *toNSStr(const char *str);
unsigned int CocoaKeyToVLC(unichar i_key);
/**
* Gets the proper variant for an image ressource,
* depending on the os version.
*/
NSImage *imageFromRes(NSString *o_id);
@interface VLCStringUtility : NSObject
+ (VLCStringUtility *)sharedInstance;
......
......@@ -24,13 +24,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <vlc_input.h>
#import "intf.h"
#import "StringUtility.h"
#import "CompatibilityFixes.h"
#import <vlc_keys.h>
#import <vlc_strings.h>
#import "StringUtility.h"
#import "intf.h"
@implementation VLCStringUtility
static VLCStringUtility *_o_sharedInstance = nil;
......@@ -393,5 +393,16 @@ NSString *toNSStr(const char *str) {
return returnStr;
}
@end
NSImage *imageFromRes(NSString *o_id)
{
NSString *result = @"";
if (OSX_YOSEMITE) {
result = [result stringByAppendingString:@"ys-"];
}
result = [result stringByAppendingString:o_id];
return [NSImage imageNamed:result];
}
......@@ -390,8 +390,8 @@
[o_button setBezelStyle: NSRegularSquareBezelStyle]; \
[o_button setBordered: NO]; \
[o_button setFont:[NSFont systemFontOfSize:0]]; \
[o_button setImage:[NSImage imageNamed:imageOff]]; \
[o_button setAlternateImage:[NSImage imageNamed:imageOn]]; \
[o_button setImage:imageFromRes(imageOff)]; \
[o_button setAlternateImage:imageFromRes(imageOn)]; \
[o_button sizeToFit]; \
[o_button setTarget: self]; \
[o_button setAction: @selector(action:)]; \
......@@ -486,11 +486,11 @@
addTextfield(VLCTimeField, o_streamLength_txt, NSRightTextAlignment, systemFontOfSize, whiteColor);
[o_streamLength_txt setRemainingIdentifier: @"DisplayFullscreenTimeAsTimeRemaining"];
o_background_img = [[NSImage imageNamed:@"fs_background"] retain];
o_vol_sld_img = [[NSImage imageNamed:@"fs_volume_slider_bar"] retain];
o_vol_mute_img = [[NSImage imageNamed:@"fs_volume_mute_highlight"] retain];
o_vol_max_img = [[NSImage imageNamed:@"fs_volume_max_highlight"] retain];
o_time_sld_img = [[NSImage imageNamed:@"fs_time_slider"] retain];
o_background_img = [imageFromRes(@"fs_background") retain];
o_vol_sld_img = [imageFromRes(@"fs_volume_slider_bar") retain];
o_vol_mute_img = [imageFromRes(@"fs_volume_mute_highlight") retain];
o_vol_max_img = [imageFromRes(@"fs_volume_max_highlight") retain];
o_time_sld_img = [imageFromRes(@"fs_time_slider") retain];
return view;
}
......@@ -517,14 +517,14 @@
- (void)setPlay
{
[o_play setImage:[NSImage imageNamed:@"fs_play_highlight"]];
[o_play setAlternateImage: [NSImage imageNamed:@"fs_play"]];
[o_play setImage:imageFromRes(@"fs_play_highlight")];
[o_play setAlternateImage: imageFromRes(@"fs_play")];
}
- (void)setPause
{
[o_play setImage: [NSImage imageNamed:@"fs_pause_highlight"]];
[o_play setAlternateImage: [NSImage imageNamed:@"fs_pause"]];
[o_play setImage: imageFromRes(@"fs_pause_highlight")];
[o_play setAlternateImage: imageFromRes(@"fs_pause")];
}
- (void)setStreamTitle:(NSString *)o_title
......@@ -683,7 +683,7 @@
- (void)drawKnobInRect:(NSRect)knobRect
{
NSRect image_rect;
NSImage *img = [NSImage imageNamed:@"fs_time_slider_knob_highlight"];
NSImage *img = imageFromRes(@"fs_time_slider_knob_highlight");
image_rect.size = [img size];
image_rect.origin.x = 0;
image_rect.origin.y = 0;
......@@ -727,7 +727,7 @@
- (void)drawKnobInRect:(NSRect) knobRect
{
NSRect image_rect;
NSImage *img = [NSImage imageNamed:@"fs_volume_slider_knob_highlight"];
NSImage *img = imageFromRes(@"fs_volume_slider_knob_highlight");
image_rect.size = [img size];
image_rect.origin.x = 0;
image_rect.origin.y = 0;
......
......@@ -533,10 +533,10 @@ void _drawFrameInRect(NSRect frameRect)
- (void)awakeFromNib
{
if (config_GetInt( VLCIntf, "macosx-interfacestyle" )) {
o_knob_img = [NSImage imageNamed:@"progression-knob_dark"];
o_knob_img = imageFromRes(@"progression-knob_dark");
b_dark = YES;
} else {
o_knob_img = [NSImage imageNamed:@"progression-knob"];
o_knob_img = imageFromRes(@"progression-knob");
b_dark = NO;
}
img_rect.size = [o_knob_img size];
......@@ -686,9 +686,9 @@ void _drawFrameInRect(NSRect frameRect)
{
BOOL b_dark = config_GetInt( VLCIntf, "macosx-interfacestyle" );
if (b_dark)
img = [NSImage imageNamed:@"volume-slider-knob_dark"];
img = imageFromRes(@"volume-slider-knob_dark");
else
img = [NSImage imageNamed:@"volume-slider-knob"];
img = imageFromRes(@"volume-slider-knob");
image_rect.size = [img size];
image_rect.origin.x = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment