Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
c500901b
Commit
c500901b
authored
Aug 11, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: remove VLCMainWindow singleton
parent
1fb3dfd8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
52 deletions
+29
-52
modules/gui/macosx/AddonsWindowController.m
modules/gui/macosx/AddonsWindowController.m
+1
-1
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+2
-2
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.h
+1
-1
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+0
-23
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/VLCVoutWindowController.m
+11
-11
modules/gui/macosx/VideoView.m
modules/gui/macosx/VideoView.m
+1
-1
modules/gui/macosx/Windows.m
modules/gui/macosx/Windows.m
+13
-13
No files found.
modules/gui/macosx/AddonsWindowController.m
View file @
c500901b
...
...
@@ -241,7 +241,7 @@ static void addonsEventsCallback( const vlc_event_t *event, void *data )
{
[
self
_refactorDataModel
];
if
(
_shouldRefreshSideBarOnAddonChange
)
{
[[
VLCMainWindow
sharedInstance
]
performSelector
:
@selector
(
reloadSidebar
)
withObject
:
nil
afterDelay
:
0
.
5
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
performSelector
:
@selector
(
reloadSidebar
)
withObject
:
nil
afterDelay
:
0
.
5
];
_shouldRefreshSideBarOnAddonChange
=
NO
;
}
}
...
...
modules/gui/macosx/MainMenu.m
View file @
c500901b
...
...
@@ -1308,12 +1308,12 @@
-
(
IBAction
)
showMainWindow
:(
id
)
sender
{
[[
VLCMainWindow
sharedInstance
]
makeKeyAndOrderFront
:
sender
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
makeKeyAndOrderFront
:
sender
];
}
-
(
IBAction
)
showPlaylist
:(
id
)
sender
{
[[
VLCMainWindow
sharedInstance
]
changePlaylistState
:
psUserMenuEvent
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
changePlaylistState
:
psUserMenuEvent
];
}
#pragma mark - Help and Docs
...
...
modules/gui/macosx/MainWindow.h
View file @
c500901b
...
...
@@ -83,7 +83,7 @@ typedef enum {
IBOutlet
id
o_podcast_unsubscribe_ok_btn
;
IBOutlet
id
o_podcast_unsubscribe_cancel_btn
;
}
+
(
VLCMainWindow
*
)
sharedInstance
;
@property
(
readonly
)
BOOL
nativeFullscreenMode
;
@property
(
readwrite
)
BOOL
nonembedded
;
...
...
modules/gui/macosx/MainWindow.m
View file @
c500901b
...
...
@@ -80,29 +80,6 @@ static const float f_min_window_height = 307.;
#pragma mark -
#pragma mark Initialization
static
VLCMainWindow
*
sharedInstance
=
nil
;
+
(
VLCMainWindow
*
)
sharedInstance
{
return
sharedInstance
;
}
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
styleMask
:(
NSUInteger
)
styleMask
backing
:(
NSBackingStoreType
)
backingType
defer
:(
BOOL
)
flag
{
static
dispatch_once_t
pred
;
dispatch_once
(
&
pred
,
^
{
sharedInstance
=
[
super
initWithContentRect
:
contentRect
styleMask:
styleMask
backing:
backingType
defer:
flag
];
});
return
sharedInstance
;
}
-
(
BOOL
)
isEvent
:(
NSEvent
*
)
o_event
forKey
:(
const
char
*
)
keyString
{
char
*
key
;
...
...
modules/gui/macosx/VLCVoutWindowController.m
View file @
c500901b
...
...
@@ -250,7 +250,7 @@ void WindowClose(vout_window_t *p_wnd)
// should be called before any window resizing occurs
if
(
!
b_multiple_vout_windows
)
[[
VLCMainWindow
sharedInstance
]
videoplayWillBeStarted
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
videoplayWillBeStarted
];
if
(
b_multiple_vout_windows
&&
b_video_wallpaper
)
b_video_wallpaper
=
false
;
...
...
@@ -262,13 +262,13 @@ void WindowClose(vout_window_t *p_wnd)
msg_Dbg
(
VLCIntf
,
"Creating background / blank window"
);
NSScreen
*
screen
=
[
NSScreen
screenWithDisplayID
:(
CGDirectDisplayID
)
var_InheritInteger
(
VLCIntf
,
"macosx-vdev"
)];
if
(
!
screen
)
screen
=
[[
VLCMainWindow
sharedInstance
]
screen
];
screen
=
[[
[
VLCMain
sharedInstance
]
mainWindow
]
screen
];
NSRect
window_rect
;
if
(
b_video_wallpaper
)
window_rect
=
[
screen
frame
];
else
window_rect
=
[[
VLCMainWindow
sharedInstance
]
frame
];
window_rect
=
[[
[
VLCMain
sharedInstance
]
mainWindow
]
frame
];
NSUInteger
mask
=
NSBorderlessWindowMask
;
if
(
!
b_video_deco
)
...
...
@@ -312,7 +312,7 @@ void WindowClose(vout_window_t *p_wnd)
}
else
{
if
((
var_InheritBool
(
VLCIntf
,
"embedded-video"
)
&&
!
b_mainwindow_has_video
))
{
// setup embedded video
o_new_video_window
=
[
VLCMainWindow
sharedInstance
]
;
o_new_video_window
=
[
[
VLCMain
sharedInstance
]
mainWindow
]
;
o_vout_view
=
[
o_new_video_window
videoView
];
b_mainwindow_has_video
=
YES
;
b_nonembedded
=
NO
;
...
...
@@ -377,11 +377,11 @@ void WindowClose(vout_window_t *p_wnd)
[
o_vout_dict
setObject
:
o_new_video_window
forKey
:[
NSValue
valueWithPointer
:
p_wnd
]];
[[
VLCMain
sharedInstance
]
setActiveVideoPlayback
:
YES
];
[[
VLCMainWindow
sharedInstance
]
setNonembedded
:
!
b_mainwindow_has_video
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
setNonembedded
:
!
b_mainwindow_has_video
];
// beware of order, setActiveVideoPlayback:, setHasActiveVideo: and setNonembedded: must be called before
if
([
o_new_video_window
class
]
==
[
VLCMainWindow
class
])
[[
VLCMainWindow
sharedInstance
]
changePlaylistState
:
psVideoStartedOrStoppedEvent
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
changePlaylistState
:
psVideoStartedOrStoppedEvent
];
if
(
b_nonembedded
)
{
// events might be posted before window is created, so call them again
...
...
@@ -425,7 +425,7 @@ void WindowClose(vout_window_t *p_wnd)
// prevent visible extra window if in fullscreen
NSDisableScreenUpdates
();
BOOL
b_native
=
[[
VLCMainWindow
sharedInstance
]
nativeFullscreenMode
];
BOOL
b_native
=
[[
[
VLCMain
sharedInstance
]
mainWindow
]
nativeFullscreenMode
];
// close fullscreen, without changing fullscreen vars
if
(
!
b_native
&&
([
o_window
fullscreen
]
||
[
o_window
inFullscreenTransition
]))
...
...
@@ -453,10 +453,10 @@ void WindowClose(vout_window_t *p_wnd)
// video in main window might get stopped while another vout is open
if
([
o_vout_dict
count
]
>
0
)
[[
VLCMainWindow
sharedInstance
]
setNonembedded
:
YES
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
setNonembedded
:
YES
];
// beware of order, setActiveVideoPlayback:, setHasActiveVideo: and setNonembedded: must be called before
[[
VLCMainWindow
sharedInstance
]
changePlaylistState
:
psVideoStartedOrStoppedEvent
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
changePlaylistState
:
psVideoStartedOrStoppedEvent
];
}
}
...
...
@@ -521,7 +521,7 @@ void WindowClose(vout_window_t *p_wnd)
if
(
b_nativeFullscreenMode
)
{
if
(
!
o_current_window
)
o_current_window
=
[
VLCMainWindow
sharedInstance
]
;
o_current_window
=
[
[
VLCMain
sharedInstance
]
mainWindow
]
;
assert
(
o_current_window
);
// fullscreen might be triggered twice (vout event)
...
...
@@ -588,7 +588,7 @@ void WindowClose(vout_window_t *p_wnd)
NSInteger
currentStatusWindowLevel
=
self
.
currentStatusWindowLevel
;
VLCMain
*
main
=
[
VLCMain
sharedInstance
];
[[
VLCMainWindow
sharedInstance
]
setWindowLevel
:
i_level
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
setWindowLevel
:
i_level
];
[[
main
videoEffectsPanel
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
main
audioEffectsPanel
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
[[
VLCInfo
sharedInstance
]
updateCocoaWindowLevel
:
currentStatusWindowLevel
];
...
...
modules/gui/macosx/VideoView.m
View file @
c500901b
...
...
@@ -155,7 +155,7 @@
-
(
BOOL
)
performKeyEquivalent
:(
NSEvent
*
)
o_event
{
return
[[
VLCMainWindow
sharedInstance
]
performKeyEquivalent
:
o_event
];
return
[[
[
VLCMain
sharedInstance
]
mainWindow
]
performKeyEquivalent
:
o_event
];
}
-
(
void
)
mouseDown
:(
NSEvent
*
)
o_event
...
...
modules/gui/macosx/Windows.m
View file @
c500901b
...
...
@@ -669,16 +669,16 @@
// change fspanel state for the case when multiple windows are in fullscreen
if
([
self
hasActiveVideo
]
&&
[
self
fullscreen
])
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setActive
:
nil
];
else
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setNonActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setNonActive
:
nil
];
}
-
(
void
)
resignKeyWindow
{
[
super
resignKeyWindow
];
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setNonActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setNonActive
:
nil
];
}
-
(
NSArray
*
)
customWindowsToEnterFullScreenForWindow
:(
NSWindow
*
)
window
...
...
@@ -748,7 +748,7 @@
}
if
([
self
hasActiveVideo
])
[[
VLCMainWindow
sharedInstance
]
recreateHideMouseTimer
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
recreateHideMouseTimer
];
if
(
_darkInterface
)
{
[
self
.
titlebarView
removeFromSuperviewWithoutNeedingDisplay
];
...
...
@@ -779,9 +779,9 @@
_inFullscreenTransition
=
NO
;
if
([
self
hasActiveVideo
])
{
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setVoutWasUpdated
:
self
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setVoutWasUpdated
:
self
];
if
(
!
[
_videoView
isHidden
])
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setActive
:
nil
];
}
NSArray
*
subviews
=
[[
self
videoView
]
subviews
];
...
...
@@ -809,7 +809,7 @@
}
[
NSCursor
setHiddenUntilMouseMoves
:
NO
];
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setNonActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setNonActive
:
nil
];
if
(
_darkInterface
)
{
...
...
@@ -875,9 +875,9 @@
if
(
self
.
controlsBar
)
[
self
.
controlsBar
setFullscreenState
:
YES
];
[[[
VLCMainWindow
sharedInstance
]
controlsBar
]
setFullscreenState
:
YES
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
controlsBar
]
setFullscreenState
:
YES
];
[[
VLCMainWindow
sharedInstance
]
recreateHideMouseTimer
];
[[
[
VLCMain
sharedInstance
]
mainWindow
]
recreateHideMouseTimer
];
if
(
blackout_other_displays
)
[
screen
blackoutOtherScreens
];
...
...
@@ -1012,8 +1012,8 @@
[
o_fullscreen_window
setAcceptsMouseMovedEvents
:
YES
];
/* tell the fspanel to move itself to front next time it's triggered */
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setVoutWasUpdated
:
o_fullscreen_window
];
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setVoutWasUpdated
:
o_fullscreen_window
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setActive
:
nil
];
if
([
self
isVisible
])
[
self
orderOut
:
self
];
...
...
@@ -1030,7 +1030,7 @@
if
(
self
.
controlsBar
)
[
self
.
controlsBar
setFullscreenState
:
NO
];
[[[
VLCMainWindow
sharedInstance
]
controlsBar
]
setFullscreenState
:
NO
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
controlsBar
]
setFullscreenState
:
NO
];
/* We always try to do so */
[
NSScreen
unblackoutScreens
];
...
...
@@ -1042,7 +1042,7 @@
return
;
}
[[[
VLCMainWindow
sharedInstance
]
fspanel
]
setNonActive
:
nil
];
[[[
[
VLCMain
sharedInstance
]
mainWindow
]
fspanel
]
setNonActive
:
nil
];
[[
o_fullscreen_window
screen
]
setNonFullscreenPresentationOptions
];
if
(
o_fullscreen_anim1
)
{
...
...
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