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
6916c8d1
Commit
6916c8d1
authored
Jul 21, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimal-macosx: switch to ARC
parent
0d4616be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
52 deletions
+43
-52
modules/gui/Makefile.am
modules/gui/Makefile.am
+1
-1
modules/gui/minimal_macosx/intf.m
modules/gui/minimal_macosx/intf.m
+42
-51
No files found.
modules/gui/Makefile.am
View file @
6916c8d1
...
...
@@ -39,7 +39,7 @@ libminimal_macosx_plugin_la_SOURCES = \
gui/minimal_macosx/misc.h gui/minimal_macosx/misc.m
\
gui/minimal_macosx/VLCMinimalVoutWindow.h gui/minimal_macosx/VLCMinimalVoutWindow.m
\
gui/minimal_macosx/macosx.c
libminimal_macosx_plugin_la_OBJCFLAGS
=
$(AM_OBJCFLAGS)
-fobjc-exceptions
libminimal_macosx_plugin_la_OBJCFLAGS
=
$(AM_OBJCFLAGS)
-fobjc-
arc
-fobjc-
exceptions
libminimal_macosx_plugin_la_LDFLAGS
=
$(AM_LDFLAGS)
-rpath
'
$(guidir)
'
-Wl
,-framework,Cocoa
EXTRA_LTLIBRARIES
+=
libminimal_macosx_plugin.la
gui_LTLIBRARIES
+=
$(LTLIBminimal_macosx)
...
...
modules/gui/minimal_macosx/intf.m
View file @
6916c8d1
...
...
@@ -92,14 +92,13 @@ extern OSErr CPSSetFrontProcess(CPSProcessSerNum *psn);
static
void
Run
(
intf
_
thread
_
t
*
p
_
intf
)
{
CPSProcessSerNum
PSN
;
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
[
NSApplication
sharedApplication
]
;
if
(
!
CPSGetCurrentProcess
(
&
PSN
))
if
(
!
CPSEnableForegroundOperation
(
&
PSN
,
0
x03
,
0
x3C
,
0
x2C
,
0
x1103
))
if
(
!
CPSSetFrontProcess
(
&
PSN
))
[
NSApplication
sharedApplication
]
;
[
pool
release
]
;
@
autoreleasepool
{
[
NSApplication
sharedApplication
]
;
if
(
!
CPSGetCurrentProcess
(
&
PSN
))
if
(
!
CPSEnableForegroundOperation
(
&
PSN
,
0
x03
,
0
x3C
,
0
x2C
,
0
x1103
))
if
(
!
CPSSetFrontProcess
(
&
PSN
))
[
NSApplication
sharedApplication
]
;
}
}
/*****************************************************************************
...
...
@@ -113,32 +112,30 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
&&
cfg
->
type
!=
VOUT
_
WINDOW
_
TYPE
_
NSOBJECT
)
return
VLC
_
EGENERIC
;
NSAutoreleasePool
*
o
_
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
NSRect
proposedVideoViewPosition
=
NSMakeRect
(
cfg
->
x
,
cfg
->
y
,
cfg
->
width
,
cfg
->
height
)
;
@
autoreleasepool
{
NSRect
proposedVideoViewPosition
=
NSMakeRect
(
cfg
->
x
,
cfg
->
y
,
cfg
->
width
,
cfg
->
height
)
;
VLCMinimalVoutWindow
*
o
_
window
=
[[
VLCMinimalVoutWindow
alloc
]
initWithContentRect
:
proposedVideoViewPosition
]
;
[
o
_
window
makeKeyAndOrderFront
:
nil
]
;
VLCMinimalVoutWindow
*
o
_
window
=
[[
VLCMinimalVoutWindow
alloc
]
initWithContentRect
:
proposedVideoViewPosition
]
;
[
o
_
window
makeKeyAndOrderFront
:
nil
]
;
if
(
!
o
_
window
)
{
msg
_
Err
(
p
_
wnd
,
"window creation failed"
)
;
[
o
_
pool
release
]
;
return
VLC
_
EGENERIC
;
}
if
(
!
o
_
window
)
{
msg
_
Err
(
p
_
wnd
,
"window creation failed"
)
;
return
VLC
_
EGENERIC
;
}
msg
_
Dbg
(
p
_
wnd
,
"returning video window with proposed position x=%i, y=%i, width=%i, height=%i"
,
cfg
->
x
,
cfg
->
y
,
cfg
->
width
,
cfg
->
height
)
;
p
_
wnd
->
handle
.
nsobject
=
[
o
_
window
contentView
]
;
msg
_
Dbg
(
p
_
wnd
,
"returning video window with proposed position x=%i, y=%i, width=%i, height=%i"
,
cfg
->
x
,
cfg
->
y
,
cfg
->
width
,
cfg
->
height
)
;
p
_
wnd
->
handle
.
nsobject
=
(
void
*
)
CFBridgingRetain
([
o
_
window
contentView
])
;
p
_
wnd
->
type
=
VOUT
_
WINDOW
_
TYPE
_
NSOBJECT
;
p
_
wnd
->
control
=
WindowControl
;
p
_
wnd
->
type
=
VOUT
_
WINDOW
_
TYPE
_
NSOBJECT
;
p
_
wnd
->
control
=
WindowControl
;
}
[
o
_
pool
release
]
;
return
VLC
_
SUCCESS
;
}
static
int
WindowControl
(
vout
_
window
_
t
*
p
_
wnd
,
int
i
_
query
,
va
_
list
args
)
{
NSWindow
*
o
_
window
=
[(
id
)
p
_
wnd
->
handle
.
nsobject
window
]
;
NSWindow
*
o
_
window
=
[(
__
bridge
id
)
p
_
wnd
->
handle
.
nsobject
window
]
;
if
(
!
o
_
window
)
{
msg
_
Err
(
p
_
wnd
,
"failed to recover cocoa window"
)
;
return
VLC
_
EGENERIC
;
...
...
@@ -155,29 +152,26 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
}
case
VOUT
_
WINDOW
_
SET
_
SIZE
:
{
NSAutoreleasePool
*
o
_
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
NSRect
theFrame
=
[
o
_
window
frame
]
;
unsigned
int
i
_
width
=
va
_
arg
(
args
,
unsigned
int
)
;
unsigned
int
i
_
height
=
va
_
arg
(
args
,
unsigned
int
)
;
theFrame
.
size
.
width
=
i
_
width
;
theFrame
.
size
.
height
=
i
_
height
;
[
o
_
window
setFrame
:
theFrame
display
:
YES
animate
:
YES
]
;
[
o
_
pool
release
]
;
@
autoreleasepool
{
NSRect
theFrame
=
[
o
_
window
frame
]
;
unsigned
int
i
_
width
=
va
_
arg
(
args
,
unsigned
int
)
;
unsigned
int
i
_
height
=
va
_
arg
(
args
,
unsigned
int
)
;
theFrame
.
size
.
width
=
i
_
width
;
theFrame
.
size
.
height
=
i
_
height
;
[
o
_
window
setFrame
:
theFrame
display
:
YES
animate
:
YES
]
;
}
return
VLC
_
SUCCESS
;
}
case
VOUT
_
WINDOW
_
SET
_
FULLSCREEN
:
{
NSAutoreleasePool
*
o
_
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
int
i
_
full
=
va
_
arg
(
args
,
int
)
;
if
(
i
_
full
)
[
o
_
window
performSelectorOnMainThread
:@
selector
(
enterFullscreen
)
withObject
:
nil
waitUntilDone
:
NO
]
;
else
[
o
_
window
performSelectorOnMainThread
:@
selector
(
leaveFullscreen
)
withObject
:
nil
waitUntilDone
:
NO
]
;
[
o
_
pool
release
]
;
@
autoreleasepool
{
int
i
_
full
=
va
_
arg
(
args
,
int
)
;
if
(
i
_
full
)
[
o
_
window
performSelectorOnMainThread
:@
selector
(
enterFullscreen
)
withObject
:
nil
waitUntilDone
:
NO
]
;
else
[
o
_
window
performSelectorOnMainThread
:@
selector
(
leaveFullscreen
)
withObject
:
nil
waitUntilDone
:
NO
]
;
}
return
VLC
_
SUCCESS
;
}
default
:
...
...
@@ -188,12 +182,9 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
void
WindowClose
(
vout
_
window
_
t
*
p
_
wnd
)
{
NSAutoreleasePool
*
o
_
pool
=
[[
NSAutoreleasePool
alloc
]
init
]
;
NSWindow
*
o
_
window
=
[(
id
)
p
_
wnd
->
handle
.
nsobject
window
]
;
if
(
o
_
window
)
[
o
_
window
release
]
;
[
o
_
pool
release
]
;
@
autoreleasepool
{
NSWindow
*
o
_
window
=
[(
__
bridge
id
)
p
_
wnd
->
handle
.
nsobject
window
]
;
if
(
o
_
window
)
o
_
window
=
nil
;
}
}
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