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
36276b8d
Commit
36276b8d
authored
Apr 30, 2006
by
Benjamin Pracht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Backport of 15488
parent
79c0a584
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
40 deletions
+83
-40
modules/gui/macosx/controls.h
modules/gui/macosx/controls.h
+1
-0
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+79
-39
modules/gui/macosx/misc.m
modules/gui/macosx/misc.m
+3
-1
No files found.
modules/gui/macosx/controls.h
View file @
36276b8d
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
-
(
IBAction
)
volumeSliderUpdated
:(
id
)
sender
;
-
(
IBAction
)
volumeSliderUpdated
:(
id
)
sender
;
-
(
IBAction
)
windowAction
:(
id
)
sender
;
-
(
IBAction
)
windowAction
:(
id
)
sender
;
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
;
-
(
void
)
setupVarMenuItem
:(
NSMenuItem
*
)
o_mi
-
(
void
)
setupVarMenuItem
:(
NSMenuItem
*
)
o_mi
target
:(
vlc_object_t
*
)
p_object
target
:(
vlc_object_t
*
)
p_object
...
...
modules/gui/macosx/controls.m
View file @
36276b8d
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "controls.h"
#include "controls.h"
#include <vlc_osd.h>
#include <vlc_osd.h>
/*****************************************************************************
/*****************************************************************************
* VLCControls implementation
* VLCControls implementation
*****************************************************************************/
*****************************************************************************/
...
@@ -77,6 +78,32 @@
...
@@ -77,6 +78,32 @@
var_Set
(
p_intf
->
p_vlc
,
"key-pressed"
,
val
);
var_Set
(
p_intf
->
p_vlc
,
"key-pressed"
,
val
);
}
}
/* Small helper method */
-
(
id
)
getVoutView
{
id
o_window
;
id
o_vout_view
=
nil
;
id
o_embedded_vout_list
=
[[
VLCMain
sharedInstance
]
getEmbeddedList
];
NSEnumerator
*
o_enumerator
=
[[
NSApp
orderedWindows
]
objectEnumerator
];
while
(
!
o_vout_view
&&
(
o_window
=
[
o_enumerator
nextObject
]
)
)
{
/* We have an embedded vout */
if
(
[
o_embedded_vout_list
windowContainsEmbedded
:
o_window
]
)
{
o_vout_view
=
[
o_embedded_vout_list
getViewForWindow
:
o_window
];
}
/* We have a detached vout */
else
if
(
[[
o_window
className
]
isEqualToString
:
@"VLCWindow"
]
)
{
msg_Dbg
(
VLCIntf
,
"detached vout controls.m call getVoutView"
);
o_vout_view
=
[
o_window
getVoutView
];
}
}
return
o_vout_view
;
}
-
(
IBAction
)
stop
:(
id
)
sender
-
(
IBAction
)
stop
:(
id
)
sender
{
{
vlc_value_t
val
;
vlc_value_t
val
;
...
@@ -269,55 +296,36 @@
...
@@ -269,55 +296,36 @@
-
(
IBAction
)
windowAction
:(
id
)
sender
-
(
IBAction
)
windowAction
:(
id
)
sender
{
{
id
o_window
=
[
NSApp
keyWindow
];
NSString
*
o_title
=
[
sender
title
];
NSString
*
o_title
=
[
sender
title
];
NSArray
*
o_windows
=
[
NSApp
orderedWindows
];
NSEnumerator
*
o_enumerator
=
[
o_windows
objectEnumerator
];
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
FIND_ANYWHERE
);
if
(
p_vout
!=
NULL
)
if
(
p_vout
!=
NULL
)
{
{
id
o_
embedded_vout_list
=
[[
VLCMain
sharedInstance
]
getEmbeddedList
];
id
o_
vout_view
=
[
self
getVoutView
];
while
((
o_window
=
[
o_enumerator
nextObject
])
)
if
(
o_vout_view
)
{
{
id
o_vout_view
=
nil
;
if
(
[
o_title
isEqualToString
:
_NS
(
"Half Size"
)
]
)
/* We have an embedded vout */
[
o_vout_view
scaleWindowWithFactor
:
0
.
5
];
if
(
[
o_embedded_vout_list
windowContainsEmbedded
:
o_window
]
)
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Normal Size"
)
]
)
[
o_vout_view
scaleWindowWithFactor
:
1
.
0
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Double Size"
)
]
)
[
o_vout_view
scaleWindowWithFactor
:
2
.
0
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Float on Top"
)
]
)
[
o_vout_view
toggleFloatOnTop
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Fit to Screen"
)
]
)
{
{
o_vout_view
=
[
o_embedded_vout_list
getViewForWindow
:
o_window
];
id
o_window
=
[
o_vout_view
getWindow
];
if
(
!
[
o_window
isZoomed
]
)
[
o_window
performZoom
:
self
];
}
}
/* We have a detached Vout */
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Snapshot"
)
]
)
else
if
(
[[
o_window
className
]
isEqualToString
:
@"VLCWindow"
]
)
{
{
msg_Dbg
(
VLCIntf
,
"detached vout controls.m call getVoutView"
);
[
o_vout_view
snapshot
];
o_vout_view
=
[
o_window
getVoutView
];
}
}
else
if
(
o_vout_view
)
{
{
if
(
[
o_title
isEqualToString
:
_NS
(
"Half Size"
)
]
)
[
o_vout_view
toggleFullscreen
];
[
o_vout_view
scaleWindowWithFactor
:
0
.
5
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Normal Size"
)
]
)
[
o_vout_view
scaleWindowWithFactor
:
1
.
0
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Double Size"
)
]
)
[
o_vout_view
scaleWindowWithFactor
:
2
.
0
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Float on Top"
)
]
)
[
o_vout_view
toggleFloatOnTop
];
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Fit to Screen"
)
]
)
{
if
(
!
[
o_window
isZoomed
]
)
[
o_window
performZoom
:
self
];
}
else
if
(
[
o_title
isEqualToString
:
_NS
(
"Snapshot"
)
]
)
{
[
o_vout_view
snapshot
];
}
else
{
[
o_vout_view
toggleFullscreen
];
}
break
;
}
}
}
}
vlc_object_release
(
(
vlc_object_t
*
)
p_vout
);
vlc_object_release
(
(
vlc_object_t
*
)
p_vout
);
...
@@ -339,6 +347,38 @@
...
@@ -339,6 +347,38 @@
}
}
-
(
BOOL
)
keyEvent
:(
NSEvent
*
)
o_event
{
BOOL
eventHandled
=
NO
;
unichar
key
=
[[
o_event
charactersIgnoringModifiers
]
characterAtIndex
:
0
];
if
(
key
)
{
vout_thread_t
*
p_vout
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
if
(
p_vout
!=
NULL
)
{
/* Escape */
if
(
key
==
(
unichar
)
0x1b
)
{
id
o_vout_view
=
[
self
getVoutView
];
if
(
o_vout_view
&&
[
o_vout_view
isFullscreen
]
)
{
[
o_vout_view
toggleFullscreen
];
eventHandled
=
YES
;
}
}
else
if
(
key
==
' '
)
{
[
self
play
:
self
];
eventHandled
=
YES
;
}
vlc_object_release
(
(
vlc_object_t
*
)
p_vout
);
}
}
return
eventHandled
;
}
-
(
void
)
setupVarMenuItem
:(
NSMenuItem
*
)
o_mi
-
(
void
)
setupVarMenuItem
:(
NSMenuItem
*
)
o_mi
target
:(
vlc_object_t
*
)
p_object
target
:(
vlc_object_t
*
)
p_object
var
:(
const
char
*
)
psz_variable
var
:(
const
char
*
)
psz_variable
...
@@ -747,7 +787,7 @@
...
@@ -747,7 +787,7 @@
[
o_mi
setState
:
val
.
b_bool
];
[
o_mi
setState
:
val
.
b_bool
];
bEnabled
=
TRUE
;
bEnabled
=
TRUE
;
}
}
[
o_main
setupMenus
];
/* Make sure video menu is up to date */
[
o_main
setupMenus
];
/* Make sure video menu is up to date */
}
}
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
...
...
modules/gui/macosx/misc.m
View file @
36276b8d
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "intf.h"
/* VLCApplication */
#include "intf.h"
/* VLCApplication */
#include "misc.h"
#include "misc.h"
#include "playlist.h"
#include "playlist.h"
#include "controls.h"
/*****************************************************************************
/*****************************************************************************
* VLCControllerWindow
* VLCControllerWindow
...
@@ -46,7 +47,8 @@
...
@@ -46,7 +47,8 @@
-
(
BOOL
)
performKeyEquivalent
:(
NSEvent
*
)
o_event
-
(
BOOL
)
performKeyEquivalent
:(
NSEvent
*
)
o_event
{
{
return
[[
VLCMain
sharedInstance
]
hasDefinedShortcutKey
:
o_event
];
return
[[
VLCMain
sharedInstance
]
hasDefinedShortcutKey
:
o_event
]
||
[(
VLCControls
*
)[[
VLCMain
sharedInstance
]
getControls
]
keyEvent
:
o_event
];
}
}
@end
@end
...
...
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