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
61d49645
Commit
61d49645
authored
Aug 19, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: removed explicit 10.5 compatibility code
parent
5e674f08
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
146 deletions
+15
-146
modules/gui/macosx/CompatibilityFixes.h
modules/gui/macosx/CompatibilityFixes.h
+0
-58
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainMenu.m
+4
-25
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+9
-49
modules/gui/macosx/intf.h
modules/gui/macosx/intf.h
+0
-4
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+2
-10
No files found.
modules/gui/macosx/CompatibilityFixes.h
View file @
61d49645
...
@@ -25,67 +25,9 @@
...
@@ -25,67 +25,9 @@
#pragma mark -
#pragma mark -
#pragma OS detection code
#pragma OS detection code
#define OSX_LEOPARD (NSAppKitVersionNumber < 1038 && NSAppKitVersionNumber >= 949)
#define OSX_SNOW_LEOPARD (NSAppKitVersionNumber < 1115 && NSAppKitVersionNumber >= 1038)
#define OSX_SNOW_LEOPARD (NSAppKitVersionNumber < 1115 && NSAppKitVersionNumber >= 1038)
#define OSX_LION NSAppKitVersionNumber >= 1115.2
#define OSX_LION NSAppKitVersionNumber >= 1115.2
#pragma mark -
#pragma Fixes for OS X Leopard (10.5)
#ifndef MAC_OS_X_VERSION_10_6
@protocol
NSAnimationDelegate
<
NSObject
>
@end
@protocol
NSApplicationDelegate
<
NSObject
>
@end
@protocol
NSWindowDelegate
<
NSObject
>
@end
@protocol
NSComboBoxDataSource
<
NSObject
>
@end
@protocol
NSTextFieldDelegate
<
NSObject
>
@end
@protocol
NSTableViewDataSource
<
NSObject
>
@end
@protocol
NSOutlineViewDelegate
<
NSObject
>
@end
@protocol
NSOutlineViewDataSource
<
NSObject
>
@end
@protocol
NSToolbarDelegate
<
NSObject
>
@end
@protocol
NSSplitViewDelegate
<
NSObject
>
@end
enum
{
NSApplicationPresentationDefault
=
0
,
NSApplicationPresentationAutoHideDock
=
(
1
<<
0
),
NSApplicationPresentationHideDock
=
(
1
<<
1
),
NSApplicationPresentationAutoHideMenuBar
=
(
1
<<
2
),
NSApplicationPresentationHideMenuBar
=
(
1
<<
3
),
NSApplicationPresentationDisableAppleMenu
=
(
1
<<
4
),
NSApplicationPresentationDisableProcessSwitching
=
(
1
<<
5
),
NSApplicationPresentationDisableForceQuit
=
(
1
<<
6
),
NSApplicationPresentationDisableSessionTermination
=
(
1
<<
7
),
NSApplicationPresentationDisableHideApplication
=
(
1
<<
8
),
NSApplicationPresentationDisableMenuBarTransparency
=
(
1
<<
9
)
};
typedef
NSUInteger
NSApplicationPresentationOptions
;
#if defined( __LP64__) && !defined(__POWER__)
/* Bug in the 10.5.sdk in 64bits */
extern
OSErr
UpdateSystemActivity
(
UInt8
activity
);
#define UsrActivity 1
#endif
/* the following is just to fix warnings, not for implementation! */
@interface
NSMenu
(
IntroducedInSnowLeopard
)
-
(
void
)
removeAllItems
;
@end
@interface
NSApplication
(
IntroducedInSnowLeopard
)
-
(
NSApplicationPresentationOptions
)
presentationOptions
;
-
(
void
)
setPresentationOptions
:(
NSApplicationPresentationOptions
)
newOptions
;
-
(
NSApplicationPresentationOptions
)
currentSystemPresentationOptions
;
@end
@interface
NSURL
(
IntroducedInSnowLeopard
)
-
(
NSArray
*
)
pathComponents
;
@end
@interface
NSCursor
(
IntroducedInSnowLeopard
)
+
(
NSCursor
*
)
dragCopyCursor
;
@end
#endif
#pragma mark -
#pragma mark -
#pragma Fixes for OS X Snow Leopard (10.6)
#pragma Fixes for OS X Snow Leopard (10.6)
...
...
modules/gui/macosx/MainMenu.m
View file @
61d49645
...
@@ -493,9 +493,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -493,9 +493,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
}
}
else
else
{
[
o_mi_record
setEnabled
:
NO
];
[
o_mi_record
setEnabled
:
NO
];
}
}
}
-
(
void
)
refreshVoutDeviceMenu
:(
NSNotification
*
)
o_notification
-
(
void
)
refreshVoutDeviceMenu
:(
NSNotification
*
)
o_notification
...
@@ -503,16 +501,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -503,16 +501,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSUInteger
count
=
[
o_mu_screen
numberOfItems
];
NSUInteger
count
=
[
o_mu_screen
numberOfItems
];
NSMenu
*
o_submenu
=
o_mu_screen
;
NSMenu
*
o_submenu
=
o_mu_screen
;
if
(
count
>
0
)
if
(
count
>
0
)
{
if
(
OSX_LEOPARD
)
{
NSUInteger
count
=
[
o_submenu
numberOfItems
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
[
o_submenu
removeItemAtIndex
:
0
];
}
else
[
o_submenu
removeAllItems
];
[
o_submenu
removeAllItems
];
}
NSArray
*
o_screens
=
[
NSScreen
screens
];
NSArray
*
o_screens
=
[
NSScreen
screens
];
NSMenuItem
*
o_mitem
;
NSMenuItem
*
o_mitem
;
...
@@ -1064,18 +1053,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
...
@@ -1064,18 +1053,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
int
i_type
,
i
;
int
i_type
,
i
;
/* remove previous items */
/* remove previous items */
if
(
OSX_LEOPARD
)
{
int
i_nb_items
;
i_nb_items
=
[
o_menu
numberOfItems
];
for
(
i
=
0
;
i
<
i_nb_items
;
i
++
)
[
o_menu
removeItemAtIndex
:
0
];
}
else
{
/* this is more efficient then the legacy code, but 10.6+ only */
[
o_menu
removeAllItems
];
[
o_menu
removeAllItems
];
}
/* we disable everything here, and enable it again when needed, below */
/* we disable everything here, and enable it again when needed, below */
[
o_parent
setEnabled
:
NO
];
[
o_parent
setEnabled
:
NO
];
...
...
modules/gui/macosx/MainWindow.m
View file @
61d49645
...
@@ -177,9 +177,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -177,9 +177,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[
o_detached_video_window
setDelegate
:
self
];
[
o_detached_video_window
setDelegate
:
self
];
[
self
useOptimizedDrawing
:
YES
];
[
self
useOptimizedDrawing
:
YES
];
if
(
!
OSX_LEOPARD
)
[
o_right_split_view
setWantsLayer
:
YES
];
[
o_play_btn
setToolTip
:
_NS
(
"Play/Pause"
)];
[
o_play_btn
setToolTip
:
_NS
(
"Play/Pause"
)];
[
o_detached_play_btn
setToolTip
:
[
o_play_btn
toolTip
]];
[
o_detached_play_btn
setToolTip
:
[
o_play_btn
toolTip
]];
[
o_bwd_btn
setToolTip
:
_NS
(
"Backward"
)];
[
o_bwd_btn
setToolTip
:
_NS
(
"Backward"
)];
...
@@ -935,23 +932,17 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -935,23 +932,17 @@ static VLCMainWindow *_o_sharedInstance = nil;
-
(
void
)
resizePlaylistAfterCollapse
-
(
void
)
resizePlaylistAfterCollapse
{
{
id
o_playlist_viewitem
;
if
(
OSX_LEOPARD
)
o_playlist_viewitem
=
o_playlist_table
;
else
o_playlist_viewitem
=
[
o_playlist_table
animator
];
NSRect
plrect
;
NSRect
plrect
;
plrect
=
[
o_playlist_table
frame
];
plrect
=
[
o_playlist_table
frame
];
plrect
.
size
.
height
=
i_lastSplitViewHeight
-
19
.
0
;
// actual pl top bar height, which differs from its frame
plrect
.
size
.
height
=
i_lastSplitViewHeight
-
19
.
0
;
// actual pl top bar height, which differs from its frame
[
o_playlist_viewitem
setFrame
:
plrect
];
[
[
o_playlist_table
animator
]
setFrame
:
plrect
];
NSRect
rightSplitRect
;
NSRect
rightSplitRect
;
rightSplitRect
=
[
o_right_split_view
frame
];
rightSplitRect
=
[
o_right_split_view
frame
];
plrect
=
[
o_dropzone_box
frame
];
plrect
=
[
o_dropzone_box
frame
];
plrect
.
origin
.
x
=
(
rightSplitRect
.
size
.
width
-
plrect
.
size
.
width
)
/
2
;
plrect
.
origin
.
x
=
(
rightSplitRect
.
size
.
width
-
plrect
.
size
.
width
)
/
2
;
plrect
.
origin
.
y
=
(
rightSplitRect
.
size
.
height
-
plrect
.
size
.
height
)
/
2
;
plrect
.
origin
.
y
=
(
rightSplitRect
.
size
.
height
-
plrect
.
size
.
height
)
/
2
;
[
o_playlist_viewitem
setFrame
:
plrect
];
[
[
o_playlist_table
animator
]
setFrame
:
plrect
];
}
}
-
(
void
)
makeSplitViewVisible
-
(
void
)
makeSplitViewVisible
...
@@ -969,9 +960,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -969,9 +960,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
new_frame
.
origin
.
y
=
old_frame
.
origin
.
y
+
old_frame
.
size
.
height
-
newHeight
;
new_frame
.
origin
.
y
=
old_frame
.
origin
.
y
+
old_frame
.
size
.
height
-
newHeight
;
new_frame
.
size
.
height
=
newHeight
;
new_frame
.
size
.
height
=
newHeight
;
if
(
OSX_LEOPARD
)
[
self
setFrame
:
new_frame
display
:
YES
animate
:
YES
];
else
[[
self
animator
]
setFrame
:
new_frame
display
:
YES
animate
:
YES
];
[[
self
animator
]
setFrame
:
new_frame
display
:
YES
animate
:
YES
];
}
}
...
@@ -1424,9 +1412,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -1424,9 +1412,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
b_dropzone_active
=
YES
;
b_dropzone_active
=
YES
;
[
o_right_split_view
addSubview
:
o_dropzone_view
positioned
:
NSWindowAbove
relativeTo
:
o_playlist_table
];
[
o_right_split_view
addSubview
:
o_dropzone_view
positioned
:
NSWindowAbove
relativeTo
:
o_playlist_table
];
[
o_dropzone_view
setFrame
:
[
o_playlist_table
frame
]];
[
o_dropzone_view
setFrame
:
[
o_playlist_table
frame
]];
if
(
OSX_LEOPARD
)
[
o_playlist_table
setHidden
:
YES
];
else
[[
o_playlist_table
animator
]
setHidden
:
YES
];
[[
o_playlist_table
animator
]
setHidden
:
YES
];
}
}
...
@@ -1434,9 +1419,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -1434,9 +1419,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
{
{
b_dropzone_active
=
NO
;
b_dropzone_active
=
NO
;
[
o_dropzone_view
removeFromSuperview
];
[
o_dropzone_view
removeFromSuperview
];
if
(
OSX_LEOPARD
)
[
o_playlist_table
setHidden
:
NO
];
else
[[
o_playlist_table
animator
]
setHidden
:
NO
];
[[
o_playlist_table
animator
]
setHidden
:
NO
];
}
}
...
@@ -1726,9 +1708,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -1726,9 +1708,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
-
(
void
)
drawFancyGradientEffectForTimeSlider
-
(
void
)
drawFancyGradientEffectForTimeSlider
{
{
if
(
OSX_LEOPARD
)
return
;
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
CGFloat
f_value
=
[
o_time_sld
knobPosition
];
CGFloat
f_value
=
[
o_time_sld
knobPosition
];
if
(
f_value
>
7
.
5
)
if
(
f_value
>
7
.
5
)
...
@@ -1964,9 +1943,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -1964,9 +1943,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
if
(
right_window_point
>
right_screen_point
)
if
(
right_window_point
>
right_screen_point
)
new_frame
.
origin
.
x
-=
(
right_window_point
-
right_screen_point
);
new_frame
.
origin
.
x
-=
(
right_window_point
-
right_screen_point
);
if
(
OSX_LEOPARD
)
[
o_videoWindow
setFrame
:
new_frame
display
:
YES
];
else
[[
o_videoWindow
animator
]
setFrame
:
new_frame
display
:
YES
];
[[
o_videoWindow
animator
]
setFrame
:
new_frame
display
:
YES
];
}
}
...
@@ -2095,12 +2071,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -2095,12 +2071,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
if
([
screen
isMainScreen
])
if
([
screen
isMainScreen
])
{
if
(
OSX_LEOPARD
)
SetSystemUIMode
(
kUIModeAllHidden
,
kUIOptionAutoShowMenuBar
);
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
}
[[
o_video_view
superview
]
replaceSubview
:
o_video_view
with
:
o_temp_view
];
[[
o_video_view
superview
]
replaceSubview
:
o_video_view
with
:
o_temp_view
];
[
o_temp_view
setFrame
:[
o_video_view
frame
]];
[
o_temp_view
setFrame
:[
o_video_view
frame
]];
...
@@ -2155,12 +2126,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -2155,12 +2126,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
if
([
screen
isMainScreen
])
if
([
screen
isMainScreen
])
{
if
(
OSX_LEOPARD
)
SetSystemUIMode
(
kUIModeAllHidden
,
kUIOptionAutoShowMenuBar
);
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
}
dict1
=
[[
NSMutableDictionary
alloc
]
initWithCapacity
:
2
];
dict1
=
[[
NSMutableDictionary
alloc
]
initWithCapacity
:
2
];
dict2
=
[[
NSMutableDictionary
alloc
]
initWithCapacity
:
3
];
dict2
=
[[
NSMutableDictionary
alloc
]
initWithCapacity
:
3
];
...
@@ -2269,9 +2235,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -2269,9 +2235,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
[
o_fspanel
setNonActive
:
nil
];
[
o_fspanel
setNonActive
:
nil
];
if
(
OSX_LEOPARD
)
SetSystemUIMode
(
kUIModeNormal
,
kUIOptionAutoShowMenuBar
);
else
[
NSApp
setPresentationOptions
:
NSApplicationPresentationDefault
];
[
NSApp
setPresentationOptions
:
NSApplicationPresentationDefault
];
/* Will release the lock */
/* Will release the lock */
...
@@ -2295,9 +2258,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
...
@@ -2295,9 +2258,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[
o_video_view
window
]
orderFront
:
self
];
[[
o_video_view
window
]
orderFront
:
self
];
[
o_fspanel
setNonActive
:
nil
];
[
o_fspanel
setNonActive
:
nil
];
if
(
OSX_LEOPARD
)
SetSystemUIMode
(
kUIModeNormal
,
kUIOptionAutoShowMenuBar
);
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationDefault
)];
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationDefault
)];
if
(
o_fullscreen_anim1
)
if
(
o_fullscreen_anim1
)
...
...
modules/gui/macosx/intf.h
View file @
61d49645
...
@@ -54,10 +54,6 @@ unsigned int CocoaKeyToVLC( unichar i_key );
...
@@ -54,10 +54,6 @@ unsigned int CocoaKeyToVLC( unichar i_key );
* the translated string. the translation should be '1:translatedstring' though */
* the translated string. the translation should be '1:translatedstring' though */
#define _ANS(s) [[[VLCMain sharedInstance] localizedString: _(s)] substringFromIndex:2]
#define _ANS(s) [[[VLCMain sharedInstance] localizedString: _(s)] substringFromIndex:2]
#define MACOS_VERSION [[[NSDictionary dictionaryWithContentsOfFile: \
@"/System/Library/CoreServices/SystemVersion.plist"] \
objectForKey: @"ProductVersion"] floatValue]
// You need to release those objects after use
// You need to release those objects after use
input_thread_t
*
getInput
(
void
);
input_thread_t
*
getInput
(
void
);
...
...
modules/gui/macosx/misc.m
View file @
61d49645
...
@@ -234,13 +234,8 @@ static NSMutableArray *blackoutWindows = NULL;
...
@@ -234,13 +234,8 @@ static NSMutableArray *blackoutWindows = NULL;
[
blackoutWindow
release
];
[
blackoutWindow
release
];
if
(
[
screen
isMainScreen
]
)
if
(
[
screen
isMainScreen
]
)
{
if
(
OSX_LEOPARD
)
SetSystemUIMode
(
kUIModeAllHidden
,
kUIOptionAutoShowMenuBar
);
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationAutoHideDock
|
NSApplicationPresentationAutoHideMenuBar
)];
}
}
}
}
}
+
(
void
)
unblackoutScreens
+
(
void
)
unblackoutScreens
...
@@ -253,9 +248,6 @@ static NSMutableArray *blackoutWindows = NULL;
...
@@ -253,9 +248,6 @@ static NSMutableArray *blackoutWindows = NULL;
[
blackoutWindow
closeAndAnimate
:
YES
];
[
blackoutWindow
closeAndAnimate
:
YES
];
}
}
if
(
OSX_LEOPARD
)
SetSystemUIMode
(
kUIModeNormal
,
kUIOptionAutoShowMenuBar
);
else
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationDefault
)];
[
NSApp
setPresentationOptions
:(
NSApplicationPresentationDefault
)];
}
}
...
...
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