mirror of https://github.com/mpv-player/mpv
removed duplicate case and fixed aspect ratio for window zoom feature
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13713 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5aa29a4b65
commit
05e19b3333
|
@ -208,49 +208,7 @@ static OSStatus MainWindowEventHandler(EventHandlerCallRef nextHandler, EventRef
|
||||||
|
|
||||||
result = CallNextEventHandler(nextHandler, event);
|
result = CallNextEventHandler(nextHandler, event);
|
||||||
|
|
||||||
if(class == kEventClassCommand)
|
if(class == kEventClassKeyboard)
|
||||||
{
|
|
||||||
HICommand theHICommand;
|
|
||||||
GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, sizeof( HICommand ), NULL, &theHICommand );
|
|
||||||
|
|
||||||
switch ( theHICommand.commandID )
|
|
||||||
{
|
|
||||||
case kHICommandQuit:
|
|
||||||
mplayer_put_key(KEY_ESC);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kHalfScreenCmd:
|
|
||||||
ShowMenuBar();
|
|
||||||
ShowCursor();
|
|
||||||
SizeWindow(theWindow, (imgRect.right/2), (imgRect.bottom/2), 1);
|
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
||||||
window_resized();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kNormalScreenCmd:
|
|
||||||
ShowMenuBar();
|
|
||||||
ShowCursor();
|
|
||||||
SizeWindow(theWindow, imgRect.right, imgRect.bottom, 1);
|
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
||||||
window_resized();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kDoubleScreenCmd:
|
|
||||||
ShowMenuBar();
|
|
||||||
ShowCursor();
|
|
||||||
SizeWindow(theWindow, (imgRect.right*2), (imgRect.bottom*2), 1);
|
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
||||||
window_resized();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kFullScreenCmd:
|
|
||||||
vo_fs = (!(vo_fs)); window_fullscreen();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(class == kEventClassKeyboard)
|
|
||||||
{
|
{
|
||||||
char macCharCodes;
|
char macCharCodes;
|
||||||
UInt32 macKeyCode;
|
UInt32 macKeyCode;
|
||||||
|
@ -273,37 +231,6 @@ static OSStatus MainWindowEventHandler(EventHandlerCallRef nextHandler, EventRef
|
||||||
{
|
{
|
||||||
switch(macCharCodes)
|
switch(macCharCodes)
|
||||||
{
|
{
|
||||||
case '0':
|
|
||||||
{
|
|
||||||
ShowMenuBar();
|
|
||||||
ShowCursor();
|
|
||||||
SizeWindow(theWindow, (imgRect.right/2), (imgRect.bottom/2), 1);
|
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
||||||
window_resized();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '1':
|
|
||||||
{
|
|
||||||
ShowMenuBar();
|
|
||||||
ShowCursor();
|
|
||||||
SizeWindow(theWindow, imgRect.right, imgRect.bottom, 1);
|
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
||||||
window_resized();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '2':
|
|
||||||
{
|
|
||||||
ShowMenuBar();
|
|
||||||
ShowCursor();
|
|
||||||
SizeWindow(theWindow, (imgRect.right*2), (imgRect.bottom*2), 1);
|
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
||||||
window_resized();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'f': vo_fs = (!(vo_fs)); window_fullscreen(); break;
|
|
||||||
case '[': SetWindowAlpha(theWindow, winAlpha-=0.05); break;
|
case '[': SetWindowAlpha(theWindow, winAlpha-=0.05); break;
|
||||||
case ']': SetWindowAlpha(theWindow, winAlpha+=0.05); break;
|
case ']': SetWindowAlpha(theWindow, winAlpha+=0.05); break;
|
||||||
}
|
}
|
||||||
|
@ -378,6 +305,10 @@ static OSStatus MainWindowCommandHandler(EventHandlerCallRef nextHandler, EventR
|
||||||
UInt32 kind = GetEventKind (event);
|
UInt32 kind = GetEventKind (event);
|
||||||
|
|
||||||
result = CallNextEventHandler(nextHandler, event);
|
result = CallNextEventHandler(nextHandler, event);
|
||||||
|
|
||||||
|
uint32_t d_width;
|
||||||
|
uint32_t d_height;
|
||||||
|
aspect(&d_width,&d_height,A_NOZOOM);
|
||||||
|
|
||||||
if(class == kEventClassCommand)
|
if(class == kEventClassCommand)
|
||||||
{
|
{
|
||||||
|
@ -393,7 +324,7 @@ static OSStatus MainWindowCommandHandler(EventHandlerCallRef nextHandler, EventR
|
||||||
case kHalfScreenCmd:
|
case kHalfScreenCmd:
|
||||||
ShowMenuBar();
|
ShowMenuBar();
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
SizeWindow(theWindow, (imgRect.right/2), (imgRect.bottom/2), 1);
|
SizeWindow(theWindow, (d_width/2), (d_height/2), 1);
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
||||||
window_resized();
|
window_resized();
|
||||||
break;
|
break;
|
||||||
|
@ -401,7 +332,7 @@ static OSStatus MainWindowCommandHandler(EventHandlerCallRef nextHandler, EventR
|
||||||
case kNormalScreenCmd:
|
case kNormalScreenCmd:
|
||||||
ShowMenuBar();
|
ShowMenuBar();
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
SizeWindow(theWindow, imgRect.right, imgRect.bottom, 1);
|
SizeWindow(theWindow, d_width, d_height, 1);
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
||||||
window_resized();
|
window_resized();
|
||||||
break;
|
break;
|
||||||
|
@ -409,7 +340,7 @@ static OSStatus MainWindowCommandHandler(EventHandlerCallRef nextHandler, EventR
|
||||||
case kDoubleScreenCmd:
|
case kDoubleScreenCmd:
|
||||||
ShowMenuBar();
|
ShowMenuBar();
|
||||||
ShowCursor();
|
ShowCursor();
|
||||||
SizeWindow(theWindow, (imgRect.right*2), (imgRect.bottom*2), 1);
|
SizeWindow(theWindow, (d_width*2), (d_height*2), 1);
|
||||||
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
||||||
window_resized();
|
window_resized();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue