</object>
<int key="connectionID">5002</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">o_detached_titlebar_view</string>
- <reference key="source" ref="498338108"/>
- <reference key="destination" ref="117751361"/>
- </object>
- <int key="connectionID">5003</int>
- </object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_detached_resize_view</string>
</object>
<int key="connectionID">5334</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">o_titlebar_view</string>
+ <reference key="source" ref="429979276"/>
+ <reference key="destination" ref="117751361"/>
+ </object>
+ <int key="connectionID">5337</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">5336</int>
+ <int key="maxID">5337</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">ITSlider</string>
- <string key="superclassName">NSSlider</string>
+ <string key="superclassName">VLCVolumeSliderCommon</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="516086310">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../../../modules/gui/macosx/misc.h</string>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCDetachedVideoWindow</string>
- <string key="superclassName">NSWindow</string>
- <object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">customZoom:</string>
- <string key="NS.object.0">id</string>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">customZoom:</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">customZoom:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
+ <string key="superclassName">VLCVideoWindowCommon</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="348153990">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">../../../modules/gui/macosx/MainWindow.h</string>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCMainWindow</string>
- <string key="superclassName">NSWindow</string>
+ <string key="superclassName">VLCVideoWindowCommon</string>
<object class="NSMutableDictionary" key="actions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<string>addPodcastWindowAction:</string>
<string>backward:</string>
<string>bwd:</string>
- <string>customZoom:</string>
<string>dropzoneButtonAction:</string>
<string>effects:</string>
<string>forward:</string>
<string>id</string>
<string>id</string>
<string>id</string>
- <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string>addPodcastWindowAction:</string>
<string>backward:</string>
<string>bwd:</string>
- <string>customZoom:</string>
<string>dropzoneButtonAction:</string>
<string>effects:</string>
<string>forward:</string>
<string key="name">bwd:</string>
<string key="candidateClassName">id</string>
</object>
- <object class="IBActionInfo">
- <string key="name">customZoom:</string>
- <string key="candidateClassName">id</string>
- </object>
<object class="IBActionInfo">
<string key="name">dropzoneButtonAction:</string>
<string key="candidateClassName">id</string>
<string>o_time_sld</string>
<string>o_time_sld_background</string>
<string>o_time_sld_fancygradient_view</string>
- <string>o_titlebar_view</string>
<string>o_topbar_view</string>
<string>o_video_view</string>
<string>o_volume_down_btn</string>
<string>id</string>
<string>id</string>
<string>id</string>
- <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string>o_time_sld</string>
<string>o_time_sld_background</string>
<string>o_time_sld_fancygradient_view</string>
- <string>o_titlebar_view</string>
<string>o_topbar_view</string>
<string>o_video_view</string>
<string>o_volume_down_btn</string>
<string key="name">o_time_sld_fancygradient_view</string>
<string key="candidateClassName">id</string>
</object>
- <object class="IBToOneOutletInfo">
- <string key="name">o_titlebar_view</string>
- <string key="candidateClassName">id</string>
- </object>
<object class="IBToOneOutletInfo">
<string key="name">o_topbar_view</string>
<string key="candidateClassName">id</string>
<string key="superclassName">NSTextField</string>
<reference key="sourceIdentifier" ref="516086310"/>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">VLCVideoWindowCommon</string>
+ <string key="superclassName">VLCWindow</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">o_titlebar_view</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">o_titlebar_view</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">o_titlebar_view</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="615738430">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">../../../modules/gui/macosx/Windows.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">VLCVolumeSliderCommon</string>
+ <string key="superclassName">NSSlider</string>
+ <reference key="sourceIdentifier" ref="516086310"/>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">VLCVoutView</string>
<string key="superclassName">NSView</string>
<string key="minorKey">../../../modules/gui/macosx/VideoView.h</string>
</object>
</object>
+ <object class="IBPartialClassDescription">
+ <string key="className">VLCWindow</string>
+ <string key="superclassName">NSWindow</string>
+ <reference key="sourceIdentifier" ref="615738430"/>
+ </object>
<object class="IBPartialClassDescription">
<string key="className">VLCWindowButtonCell</string>
<string key="superclassName">NSButtonCell</string>
IBOutlet id o_dropzone_box;
IBOutlet VLCFSPanel *o_fspanel;
- IBOutlet id o_titlebar_view;
IBOutlet id o_resize_view;
IBOutlet id o_detached_resize_view;
IBOutlet id o_detached_progress_bar;
IBOutlet id o_detached_time_sld_fancygradient_view;
IBOutlet id o_detached_bottombar_view;
- IBOutlet id o_detached_titlebar_view;
IBOutlet id o_detached_video_window;
IBOutlet id o_podcast_view;
- (IBAction)removePodcast:(id)sender;
- (IBAction)removePodcastWindowAction:(id)sender;
-- (void)setTitle:(NSString *)title;
- (void)windowResizedOrMoved:(NSNotification *)notification;
- (void)showDropZone;
- (void)windowDidEnterFullScreen:(NSNotification *)notification;
- (void)windowWillExitFullScreen:(NSNotification *)notification;
-- (id)detachedTitlebarView;
@end
@interface VLCDetachedVideoWindow : VLCVideoWindowCommon
// Set that here as IB seems to be buggy
if (b_dark_interface) {
[self setContentMinSize:NSMakeSize(604., 288. + [o_titlebar_view frame].size.height)];
- [o_detached_video_window setContentMinSize: NSMakeSize(363., f_min_video_height + [o_detached_bottombar_view frame].size.height + [o_detached_titlebar_view frame].size.height)];
+ [o_detached_video_window setContentMinSize: NSMakeSize(363., f_min_video_height + [o_detached_bottombar_view frame].size.height + [o_titlebar_view frame].size.height)];
} else {
[self setContentMinSize:NSMakeSize(604., 288.)];
[o_detached_video_window setContentMinSize: NSMakeSize(363., f_min_video_height + [o_detached_bottombar_view frame].size.height)];
[o_fullscreen_btn removeFromSuperviewWithoutNeedingDisplay];
} else {
[o_titlebar_view setFullscreenButtonHidden: YES];
- [o_detached_titlebar_view setFullscreenButtonHidden: YES];
}
if (!OSX_SNOW_LEOPARD) {
[o_split_view setFrame: winrect];
[o_video_view setFrame: winrect];
- /* detached video window */
- winrect = [o_detached_video_window frame];
- [o_detached_titlebar_view setFrame: NSMakeRect(0, winrect.size.height - f_titleBarHeight, winrect.size.width, f_titleBarHeight)];
- [[o_detached_video_window contentView] addSubview: o_detached_titlebar_view positioned: NSWindowAbove relativeTo: nil];
-
o_color_backdrop = [[VLCColorView alloc] initWithFrame: [o_split_view frame]];
[[self contentView] addSubview: o_color_backdrop positioned: NSWindowBelow relativeTo: o_split_view];
[o_color_backdrop setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
return YES;
}
-- (void)setTitle:(NSString *)title
-{
- if (b_dark_interface) {
- [o_titlebar_view setWindowTitle: title];
- [o_detached_titlebar_view setWindowTitle: title];
- }
- if (b_nonembedded && [[VLCMain sharedInstance] activeVideoPlayback])
- [o_detached_video_window setTitle: title];
- [super setTitle: title];
-}
-
- (void)windowResizedOrMoved:(NSNotification *)notification
{
[self saveFrameUsingName: [self frameAutosaveName]];
}
[self setTitle: aString];
+ if (b_nonembedded && [[VLCMain sharedInstance] activeVideoPlayback])
+ [o_detached_video_window setTitle: aString];
+
[o_fspanel setStreamTitle: aString];
vlc_object_release(p_input);
} else {
videoFrame.size = [[o_detached_video_window contentView] frame].size;
videoFrame.size.height -= [o_detached_bottombar_view frame].size.height;
if (b_dark_interface)
- videoFrame.size.height -= [o_detached_titlebar_view frame].size.height;
+ videoFrame.size.height -= [o_titlebar_view frame].size.height;
videoFrame.origin.x = .0;
videoFrame.origin.y = [o_detached_bottombar_view frame].size.height;
}
}
-#pragma mark -
-#pragma mark Accessibility stuff
-
-- (NSArray *)accessibilityAttributeNames
-{
- if (!b_dark_interface)
- return [super accessibilityAttributeNames];
-
- static NSMutableArray *attributes = nil;
- if (attributes == nil) {
- attributes = [[super accessibilityAttributeNames] mutableCopy];
- NSArray *appendAttributes = [NSArray arrayWithObjects: NSAccessibilitySubroleAttribute,
- NSAccessibilityCloseButtonAttribute,
- NSAccessibilityMinimizeButtonAttribute,
- NSAccessibilityZoomButtonAttribute,
- nil];
-
- for(NSString *attribute in appendAttributes) {
- if (![attributes containsObject:attribute])
- [attributes addObject:attribute];
- }
- }
- return attributes;
-}
-
-- (id)accessibilityAttributeValue: (NSString*)o_attribute_name
-{
- if (b_dark_interface) {
- VLCMainWindowTitleView *o_tbv = o_titlebar_view;
-
- if ([o_attribute_name isEqualTo: NSAccessibilitySubroleAttribute])
- return NSAccessibilityStandardWindowSubrole;
-
- if ([o_attribute_name isEqualTo: NSAccessibilityCloseButtonAttribute])
- return [[o_tbv closeButton] cell];
-
- if ([o_attribute_name isEqualTo: NSAccessibilityMinimizeButtonAttribute])
- return [[o_tbv minimizeButton] cell];
-
- if ([o_attribute_name isEqualTo: NSAccessibilityZoomButtonAttribute])
- return [[o_tbv zoomButton] cell];
- }
-
- return [super accessibilityAttributeValue: o_attribute_name];
-}
-
-- (id)detachedTitlebarView
-{
- return o_detached_titlebar_view;
-}
@end
@implementation VLCDetachedVideoWindow
[self display];
[self setHasShadow:NO];
[self setHasShadow:YES];
+
+ NSRect winrect = [self frame];
+ CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
+
+ [self setTitle: _NS("VLC media player")];
+ [o_titlebar_view setFrame: NSMakeRect(0, winrect.size.height - f_titleBarHeight, winrect.size.width, f_titleBarHeight)];
+ [[self contentView] addSubview: o_titlebar_view positioned: NSWindowAbove relativeTo: nil];
+
+ // native fs not supported with detached view yet
+ [o_titlebar_view setFullscreenButtonHidden: YES];
+
}
}
return YES;
}
-- (NSArray *)accessibilityAttributeNames
-{
- if (!b_dark_interface)
- return [super accessibilityAttributeNames];
-
- static NSMutableArray *attributes = nil;
- if (attributes == nil) {
- attributes = [[super accessibilityAttributeNames] mutableCopy];
- NSArray *appendAttributes = [NSArray arrayWithObjects: NSAccessibilitySubroleAttribute,
- NSAccessibilityCloseButtonAttribute,
- NSAccessibilityMinimizeButtonAttribute,
- NSAccessibilityZoomButtonAttribute,
- nil];
-
- for(NSString *attribute in appendAttributes) {
- if (![attributes containsObject:attribute])
- [attributes addObject:attribute];
- }
- }
- return attributes;
-}
-
-- (id)accessibilityAttributeValue: (NSString*)o_attribute_name
-{
- if (b_dark_interface) {
- VLCMainWindowTitleView *o_tbv = [[VLCMainWindow sharedInstance] detachedTitlebarView];
-
- if ([o_attribute_name isEqualTo: NSAccessibilitySubroleAttribute])
- return NSAccessibilityStandardWindowSubrole;
-
- if ([o_attribute_name isEqualTo: NSAccessibilityCloseButtonAttribute])
- return [[o_tbv closeButton] cell];
-
- if ([o_attribute_name isEqualTo: NSAccessibilityMinimizeButtonAttribute])
- return [[o_tbv minimizeButton] cell];
-
- if ([o_attribute_name isEqualTo: NSAccessibilityZoomButtonAttribute])
- return [[o_tbv zoomButton] cell];
- }
-
- return [super accessibilityAttributeValue: o_attribute_name];
-}
-
@end
{
NSRect previousSavedFrame;
BOOL b_dark_interface;
+
+ IBOutlet id o_titlebar_view; // only set in main or detached window
}
+- (void)setTitle:(NSString *)title;
+
@end
\ No newline at end of file
@implementation VLCVideoWindowCommon
+#pragma mark -
+#pragma mark Init
+
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
{
return self;
}
+- (void)setTitle:(NSString *)title
+{
+ if (b_dark_interface && o_titlebar_view)
+ [o_titlebar_view setWindowTitle: title];
+
+ [super setTitle: title];
+}
+
+#pragma mark -
+#pragma mark zoom / minimize / close
+
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
SEL s_menuAction = [menuItem action];
[self setFrame: maxRect display: YES animate: YES];
}
+#pragma mark -
+#pragma mark Accessibility stuff
+- (NSArray *)accessibilityAttributeNames
+{
+ if (!b_dark_interface || !o_titlebar_view)
+ return [super accessibilityAttributeNames];
+
+ static NSMutableArray *attributes = nil;
+ if (attributes == nil) {
+ attributes = [[super accessibilityAttributeNames] mutableCopy];
+ NSArray *appendAttributes = [NSArray arrayWithObjects: NSAccessibilitySubroleAttribute,
+ NSAccessibilityCloseButtonAttribute,
+ NSAccessibilityMinimizeButtonAttribute,
+ NSAccessibilityZoomButtonAttribute,
+ nil];
+
+ for(NSString *attribute in appendAttributes) {
+ if (![attributes containsObject:attribute])
+ [attributes addObject:attribute];
+ }
+ }
+ return attributes;
+}
+
+- (id)accessibilityAttributeValue: (NSString*)o_attribute_name
+{
+ if (b_dark_interface && o_titlebar_view) {
+ VLCMainWindowTitleView *o_tbv = o_titlebar_view;
+
+ if ([o_attribute_name isEqualTo: NSAccessibilitySubroleAttribute])
+ return NSAccessibilityStandardWindowSubrole;
+
+ if ([o_attribute_name isEqualTo: NSAccessibilityCloseButtonAttribute])
+ return [[o_tbv closeButton] cell];
+
+ if ([o_attribute_name isEqualTo: NSAccessibilityMinimizeButtonAttribute])
+ return [[o_tbv minimizeButton] cell];
+
+ if ([o_attribute_name isEqualTo: NSAccessibilityZoomButtonAttribute])
+ return [[o_tbv zoomButton] cell];
+ }
+
+ return [super accessibilityAttributeValue: o_attribute_name];
+}
@end