diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-16 22:28:12 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-09-16 22:28:12 +0300 |
commit | e1ecc4315265c465080616b8d8d9257b3aab6ee9 (patch) | |
tree | d8a3aacf1b5468c59da202e44c5035924f5c1a3e /libvo | |
parent | 0e1b7765be878491565cf5e471f22b15e106164c (diff) | |
parent | 4dae2a980c4313deed6ddb69556d2ead4417119c (diff) | |
download | mpv-e1ecc4315265c465080616b8d8d9257b3aab6ee9.tar.bz2 mpv-e1ecc4315265c465080616b8d8d9257b3aab6ee9.tar.xz |
Merge svn changes up to r29684
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/osx_common.c | 19 | ||||
-rw-r--r-- | libvo/vo_corevideo.m | 62 |
2 files changed, 40 insertions, 41 deletions
diff --git a/libvo/osx_common.c b/libvo/osx_common.c index 642fa9e4da..97651f9f04 100644 --- a/libvo/osx_common.c +++ b/libvo/osx_common.c @@ -1,6 +1,23 @@ -// only to get keycode definitions from HIToolbox/Events.h +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include "config.h" +// only to get keycode definitions from HIToolbox/Events.h #include <Carbon/Carbon.h> #include "osx_common.h" #include "video_out.h" diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index 9ed49a844d..ed90f5b14c 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -337,7 +337,7 @@ static void uninit(void) buffer_name = NULL; } -static opt_t subopts[] = { +static const opt_t subopts[] = { {"device_id", OPT_ARG_INT, &screen_id, NULL}, {"shared_buffer", OPT_ARG_BOOL, &shared_buffer, NULL}, {"buffer_name", OPT_ARG_MSTRZ,&buffer_name, NULL}, @@ -594,58 +594,40 @@ static int control(uint32_t request, void *data) [menuItem release]; } +- (void)set_winSizeMult:(float)mult +{ + NSRect frame; + int d_width, d_height; + aspect(&d_width, &d_height, A_NOZOOM); + + if (isFullscreen) { + vo_fs = !vo_fs; + [self fullscreen:NO]; + } + + winSizeMult = mult; + frame.size.width = d_width * mult; + frame.size.height = d_height * mult; + [window setContentSize: frame.size]; + [self reshape]; +} + /* Menu Action */ - (void)menuAction:(id)sender { - uint32_t d_width; - uint32_t d_height; - NSRect frame; - - aspect((int *)&d_width, (int *)&d_height,A_NOZOOM); - if(sender == kQuitCmd) { mplayer_put_key(KEY_ESC); } if(sender == kHalfScreenCmd) - { - if(isFullscreen) { - vo_fs = (!(vo_fs)); [self fullscreen:NO]; - } - - winSizeMult = 0.5; - frame.size.width = d_width*winSizeMult; - frame.size.height = d_height*winSizeMult; - [window setContentSize: frame.size]; - [self reshape]; - } + [self set_winSizeMult: 0.5]; if(sender == kNormalScreenCmd) - { - if(isFullscreen) { - vo_fs = (!(vo_fs)); [self fullscreen:NO]; - } - - winSizeMult = 1; - frame.size.width = d_width; - frame.size.height = d_height; - [window setContentSize: frame.size]; - [self reshape]; - } + [self set_winSizeMult: 1]; if(sender == kDoubleScreenCmd) - { - if(isFullscreen) { - vo_fs = (!(vo_fs)); [self fullscreen:NO]; - } - - winSizeMult = 2; - frame.size.width = d_width*winSizeMult; - frame.size.height = d_height*winSizeMult; - [window setContentSize: frame.size]; - [self reshape]; - } + [self set_winSizeMult: 2]; if(sender == kFullScreenCmd) { vo_fs = (!(vo_fs)); |