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
df538303
Commit
df538303
authored
May 21, 2009
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: clean Dudiak's code a bit
parent
654504d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
66 deletions
+42
-66
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+6
-10
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/embeddedwindow.m
+32
-54
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+4
-2
No files found.
modules/gui/macosx/controls.m
View file @
df538303
...
...
@@ -423,12 +423,10 @@
-
(
IBAction
)
showPosition
:
(
id
)
sender
{
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
input_GetVout
(
pl_CurrentInput
(
VLCIntf
));
if
(
p_vout
!=
NULL
)
{
intf_thread_t
*
p_intf
=
VLCIntf
;
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-action"
,
ACTIONID_POSITION
);
var_SetInteger
(
VLCIntf
->
p_libvlc
,
"key-action"
,
ACTIONID_POSITION
);
vlc_object_release
(
(
vlc_object_t
*
)
p_vout
);
}
}
...
...
@@ -451,8 +449,7 @@
{
NSString
*
o_title
=
[
sender
title
];
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
input_GetVout
(
pl_CurrentInput
(
VLCIntf
));
if
(
p_vout
!=
NULL
)
{
id
o_vout_view
=
[
self
voutView
];
...
...
@@ -615,8 +612,8 @@
if
(
key
)
{
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
input_GetVout
(
pl_CurrentInput
(
VLCIntf
));
if
(
p_vout
!=
NULL
)
{
/* Escape */
...
...
@@ -1044,8 +1041,7 @@
NSEnumerator
*
o_enumerator
=
[
o_windows
objectEnumerator
];
bEnabled
=
FALSE
;
vout_thread_t
*
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
vout_thread_t
*
p_vout
=
input_GetVout
(
pl_CurrentInput
(
VLCIntf
));
if
(
p_vout
!=
NULL
)
{
if
(
[[
o_mi
title
]
isEqualToString
:
_NS
(
"Float on Top"
)]
)
...
...
modules/gui/macosx/embeddedwindow.m
View file @
df538303
...
...
@@ -26,9 +26,6 @@
* Preamble
*****************************************************************************/
/* DisableScreenUpdates, SetSystemUIMode, ... */
#import <QuickTime/QuickTime.h>
#import "intf.h"
#import "controls.h"
#import "vout.h"
...
...
@@ -36,6 +33,9 @@
#import "fspanel.h"
#import "playlist.h"
/* SetSystemUIMode, ... */
#import <Carbon/Carbon.h>
/*****************************************************************************
* extension to NSWindow's interface to fix compilation warnings
* and let us access this functions properly
...
...
@@ -53,6 +53,22 @@
@implementation
VLCEmbeddedWindow
-
(
id
)
initWithContentRect
:(
NSRect
)
contentRect
styleMask
:
(
NSUInteger
)
windowStyle
backing
:(
NSBackingStoreType
)
bufferingType
defer
:(
BOOL
)
deferCreation
{
BOOL
b_useTextured
=
YES
;
if
(
[[
NSWindow
class
]
instancesRespondToSelector
:
@selector
(
setContentBorderThickness
:
forEdge
:
)]
)
{
b_useTextured
=
NO
;
windowStyle
^=
NSTexturedBackgroundWindowMask
;
}
self
=
[
super
initWithContentRect
:
contentRect
styleMask
:
windowStyle
backing
:
bufferingType
defer
:
deferCreation
];
if
(
!
b_useTextured
)
{
[
self
setContentBorderThickness
:
28
.
0
forEdge
:
NSMinYEdge
];
}
return
self
;
}
-
(
void
)
awakeFromNib
{
[
self
setDelegate
:
self
];
...
...
@@ -71,15 +87,9 @@
[
o_btn_playlist
setToolTip
:
_NS
(
"Playlist"
)];
[
self
setTitle
:
_NS
(
"VLC media player"
)];
if
(
MACOS_VERSION
<
10
.
5
f
)
{
o_img_play
=
[
NSImage
imageNamed
:
@"play"
];
o_img_pause
=
[
NSImage
imageNamed
:
@"pause"
];
[
o_btn_play
setImage
:
[
NSImage
imageNamed
:
@"play"
]];
}
else
{
o_img_play
=
[
NSImage
imageNamed
:
@"play_big"
];
o_img_pause
=
[
NSImage
imageNamed
:
@"pause_big"
];
}
o_img_play
=
[
NSImage
imageNamed
:
@"play_big"
];
o_img_pause
=
[
NSImage
imageNamed
:
@"pause_big"
];
[
self
controlTintChanged
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector:
@selector
(
controlTintChanged
)
...
...
@@ -118,30 +128,8 @@
if
(
[
o_btn_play
alternateImage
]
==
o_img_play_pressed
)
b_playing
=
YES
;
if
(
MACOS_VERSION
<
10
.
5
f
)
{
/* System is running Tiger and should use aqua buttons */
[
o_btn_backward
setImage
:
[
NSImage
imageNamed
:
@"skip_previous_active"
]];
[
o_btn_forward
setImage
:
[
NSImage
imageNamed
:
@"skip_forward_active"
]];
if
(
[
NSColor
currentControlTint
]
==
NSGraphiteControlTint
)
{
o_img_play_pressed
=
[
NSImage
imageNamed
:
@"play_graphite"
];
o_img_pause_pressed
=
[
NSImage
imageNamed
:
@"pause_graphite"
];
[
o_btn_backward
setAlternateImage
:
[
NSImage
imageNamed
:
@"skip_previous_graphite"
]];
[
o_btn_forward
setAlternateImage
:
[
NSImage
imageNamed
:
@"skip_forward_graphite"
]];
}
else
{
o_img_play_pressed
=
[
NSImage
imageNamed
:
@"play_blue"
];
o_img_pause_pressed
=
[
NSImage
imageNamed
:
@"pause_blue"
];
[
o_btn_backward
setAlternateImage
:
[
NSImage
imageNamed
:
@"skip_previous_blue"
]];
[
o_btn_forward
setAlternateImage
:
[
NSImage
imageNamed
:
@"skip_forward_blue"
]];
}
}
else
{
/* System is running Leopard or later and should use metal buttons */
o_img_play_pressed
=
[
NSImage
imageNamed
:
@"play_big_down"
];
o_img_pause_pressed
=
[
NSImage
imageNamed
:
@"pause_big_down"
];
}
o_img_play_pressed
=
[
NSImage
imageNamed
:
@"play_big_down"
];
o_img_pause_pressed
=
[
NSImage
imageNamed
:
@"pause_big_down"
];
if
(
b_playing
)
[
o_btn_play
setAlternateImage
:
o_img_play_pressed
];
...
...
@@ -461,10 +449,9 @@
[
o_fullscreen_window
setBackgroundColor
:
[
NSColor
blackColor
]];
[
o_fullscreen_window
setCanBecomeKeyWindow
:
YES
];
if
(
!
[
self
isVisible
]
||
[
self
alphaValue
]
==
0
.
0
||
MACOS_VERSION
<
10
.
4
f
)
if
(
!
[
self
isVisible
]
||
[
self
alphaValue
]
==
0
.
0
)
{
/* We don't animate if we are not visible or if we are running on
* Mac OS X <10.4 which doesn't support NSAnimation, instead we
/* We don't animate if we are not visible, instead we
* simply fade the display */
CGDisplayFadeReservationToken
token
;
...
...
@@ -495,20 +482,12 @@
}
/* Make sure we don't see the o_view disappearing of the screen during this operation */
DisableScreenUpdates
();
NS
DisableScreenUpdates
();
[[
self
contentView
]
replaceSubview
:
o_view
with
:
o_temp_view
];
[
o_temp_view
setFrame
:[
o_view
frame
]];
[
o_fullscreen_window
setContentView
:
o_view
];
[
o_fullscreen_window
makeKeyAndOrderFront
:
self
];
EnableScreenUpdates
();
}
if
(
MACOS_VERSION
<
10
.
4
f
)
{
/* We were already fullscreen nothing to do when NSAnimation
* is not supported */
[
self
unlockFullscreenAnimation
];
return
;
NSEnableScreenUpdates
();
}
/* We are in fullscreen (and no animation is running) */
...
...
@@ -612,10 +591,9 @@
return
;
}
if
(
fadeout
||
MACOS_VERSION
<
10
.
4
f
)
if
(
fadeout
)
{
/* We don't animate if we are not visible or if we are running on
* Mac OS X <10.4 which doesn't support NSAnimation, instead we
/* We don't animate if we are not visible, instead we
* simply fade the display */
CGDisplayFadeReservationToken
token
;
...
...
@@ -696,7 +674,7 @@
{
/* This function is private and should be only triggered at the end of the fullscreen change animation */
/* Make sure we don't see the o_view disappearing of the screen during this operation */
DisableScreenUpdates
();
NS
DisableScreenUpdates
();
[
o_view
retain
];
[
o_view
removeFromSuperviewWithoutNeedingDisplay
];
[[
self
contentView
]
replaceSubview
:
o_temp_view
with
:
o_view
];
...
...
@@ -706,7 +684,7 @@
if
([
self
isVisible
])
[
super
makeKeyAndOrderFront
:
self
];
/* our version contains a workaround */
[
o_fullscreen_window
orderOut
:
self
];
EnableScreenUpdates
();
NS
EnableScreenUpdates
();
[
o_fullscreen_window
release
];
o_fullscreen_window
=
nil
;
...
...
modules/gui/macosx/playlist.m
View file @
df538303
...
...
@@ -1551,10 +1551,12 @@
playlist_t
*
p_playlist
=
pl_Hold
(
VLCIntf
);
id
o_playing_item
;
PL_LOCK
;
o_playing_item
=
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
playlist_CurrentPlayingItem
(
p_playlist
)]];
PL_UNLOCK
;
pl_Release
(
VLCIntf
);
return
o_playing_item
;
...
...
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