Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC Browser Plugins
Commits
843cea2c
Commit
843cea2c
authored
Jan 15, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowed mac plugin: merge NSScreen additions from the minimal macosx module
parent
87590128
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
npapi/vlcplugin_mac.mm
npapi/vlcplugin_mac.mm
+36
-0
No files found.
npapi/vlcplugin_mac.mm
View file @
843cea2c
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
* Jean-Baptiste Kempf <jb@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* James Bates <james.h.bates@gmail.com>
* James Bates <james.h.bates@gmail.com>
* Pierre d'Herbemont <pdherbemont # videolan.org>
* Pierre d'Herbemont <pdherbemont # videolan.org>
* David Fuhrmann <david dot fuhrmann at googlemail dot com>
*
*
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -99,6 +100,12 @@
...
@@ -99,6 +100,12 @@
@end
@end
@interface
NSScreen
(
VLCAdditions
)
-
(
BOOL
)
hasMenuBar
;
-
(
BOOL
)
hasDock
;
-
(
CGDirectDisplayID
)
displayID
;
@end
static
CALayer
*
rootLayer
;
static
CALayer
*
rootLayer
;
static
VLCPlaybackLayer
*
playbackLayer
;
static
VLCPlaybackLayer
*
playbackLayer
;
static
VLCNoMediaLayer
*
noMediaLayer
;
static
VLCNoMediaLayer
*
noMediaLayer
;
...
@@ -736,6 +743,35 @@ static CGImageRef createImageNamed(NSString *name)
...
@@ -736,6 +743,35 @@ static CGImageRef createImageNamed(NSString *name)
@end
@end
@implementation
NSScreen
(
VLCAdditions
)
-
(
BOOL
)
hasMenuBar
{
return
([
self
displayID
]
==
[[[
NSScreen
screens
]
objectAtIndex
:
0
]
displayID
]);
}
-
(
BOOL
)
hasDock
{
NSRect
screen_frame
=
[
self
frame
];
NSRect
screen_visible_frame
=
[
self
visibleFrame
];
CGFloat
f_menu_bar_thickness
=
[
self
hasMenuBar
]
?
[[
NSStatusBar
systemStatusBar
]
thickness
]
:
0.0
;
BOOL
b_found_dock
=
NO
;
if
(
screen_visible_frame
.
size
.
width
<
screen_frame
.
size
.
width
)
b_found_dock
=
YES
;
else
if
(
screen_visible_frame
.
size
.
height
+
f_menu_bar_thickness
<
screen_frame
.
size
.
height
)
b_found_dock
=
YES
;
return
b_found_dock
;
}
-
(
CGDirectDisplayID
)
displayID
{
return
(
CGDirectDisplayID
)[[[
self
deviceDescription
]
objectForKey
:
@"NSScreenNumber"
]
intValue
];
}
@end
@implementation
VLCFullscreenWindow
@implementation
VLCFullscreenWindow
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment