comparison libvo/vo_quartz.c @ 13712:f6ef5a0ad7e4

removed duplicate case and fixed aspect ratio for window zoom feature
author nplourde
date Wed, 20 Oct 2004 23:33:31 +0000
parents 3fff37ed4fe7
children 43ecd6a73ec0
comparison
equal deleted inserted replaced
13711:eb70cfbc7aa2 13712:f6ef5a0ad7e4
206 UInt32 class = GetEventClass (event); 206 UInt32 class = GetEventClass (event);
207 UInt32 kind = GetEventKind (event); 207 UInt32 kind = GetEventKind (event);
208 208
209 result = CallNextEventHandler(nextHandler, event); 209 result = CallNextEventHandler(nextHandler, event);
210 210
211 if(class == kEventClassCommand) 211 if(class == kEventClassKeyboard)
212 {
213 HICommand theHICommand;
214 GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, sizeof( HICommand ), NULL, &theHICommand );
215
216 switch ( theHICommand.commandID )
217 {
218 case kHICommandQuit:
219 mplayer_put_key(KEY_ESC);
220 break;
221
222 case kHalfScreenCmd:
223 ShowMenuBar();
224 ShowCursor();
225 SizeWindow(theWindow, (imgRect.right/2), (imgRect.bottom/2), 1);
226 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
227 window_resized();
228 break;
229
230 case kNormalScreenCmd:
231 ShowMenuBar();
232 ShowCursor();
233 SizeWindow(theWindow, imgRect.right, imgRect.bottom, 1);
234 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
235 window_resized();
236 break;
237
238 case kDoubleScreenCmd:
239 ShowMenuBar();
240 ShowCursor();
241 SizeWindow(theWindow, (imgRect.right*2), (imgRect.bottom*2), 1);
242 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
243 window_resized();
244 break;
245
246 case kFullScreenCmd:
247 vo_fs = (!(vo_fs)); window_fullscreen();
248 break;
249
250 default:break;
251 }
252 }
253 else if(class == kEventClassKeyboard)
254 { 212 {
255 char macCharCodes; 213 char macCharCodes;
256 UInt32 macKeyCode; 214 UInt32 macKeyCode;
257 UInt32 macKeyModifiers; 215 UInt32 macKeyModifiers;
258 216
271 } 229 }
272 else if(macKeyModifiers == 256) 230 else if(macKeyModifiers == 256)
273 { 231 {
274 switch(macCharCodes) 232 switch(macCharCodes)
275 { 233 {
276 case '0':
277 {
278 ShowMenuBar();
279 ShowCursor();
280 SizeWindow(theWindow, (imgRect.right/2), (imgRect.bottom/2), 1);
281 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
282 window_resized();
283 }
284 break;
285
286 case '1':
287 {
288 ShowMenuBar();
289 ShowCursor();
290 SizeWindow(theWindow, imgRect.right, imgRect.bottom, 1);
291 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
292 window_resized();
293 }
294 break;
295
296 case '2':
297 {
298 ShowMenuBar();
299 ShowCursor();
300 SizeWindow(theWindow, (imgRect.right*2), (imgRect.bottom*2), 1);
301 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
302 window_resized();
303 }
304 break;
305
306 case 'f': vo_fs = (!(vo_fs)); window_fullscreen(); break;
307 case '[': SetWindowAlpha(theWindow, winAlpha-=0.05); break; 234 case '[': SetWindowAlpha(theWindow, winAlpha-=0.05); break;
308 case ']': SetWindowAlpha(theWindow, winAlpha+=0.05); break; 235 case ']': SetWindowAlpha(theWindow, winAlpha+=0.05); break;
309 } 236 }
310 } 237 }
311 else 238 else
376 OSStatus result = noErr; 303 OSStatus result = noErr;
377 UInt32 class = GetEventClass (event); 304 UInt32 class = GetEventClass (event);
378 UInt32 kind = GetEventKind (event); 305 UInt32 kind = GetEventKind (event);
379 306
380 result = CallNextEventHandler(nextHandler, event); 307 result = CallNextEventHandler(nextHandler, event);
308
309 uint32_t d_width;
310 uint32_t d_height;
311 aspect(&d_width,&d_height,A_NOZOOM);
381 312
382 if(class == kEventClassCommand) 313 if(class == kEventClassCommand)
383 { 314 {
384 HICommand theHICommand; 315 HICommand theHICommand;
385 GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, sizeof( HICommand ), NULL, &theHICommand ); 316 GetEventParameter( event, kEventParamDirectObject, typeHICommand, NULL, sizeof( HICommand ), NULL, &theHICommand );
391 break; 322 break;
392 323
393 case kHalfScreenCmd: 324 case kHalfScreenCmd:
394 ShowMenuBar(); 325 ShowMenuBar();
395 ShowCursor(); 326 ShowCursor();
396 SizeWindow(theWindow, (imgRect.right/2), (imgRect.bottom/2), 1); 327 SizeWindow(theWindow, (d_width/2), (d_height/2), 1);
397 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen); 328 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
398 window_resized(); 329 window_resized();
399 break; 330 break;
400 331
401 case kNormalScreenCmd: 332 case kNormalScreenCmd:
402 ShowMenuBar(); 333 ShowMenuBar();
403 ShowCursor(); 334 ShowCursor();
404 SizeWindow(theWindow, imgRect.right, imgRect.bottom, 1); 335 SizeWindow(theWindow, d_width, d_height, 1);
405 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen); 336 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
406 window_resized(); 337 window_resized();
407 break; 338 break;
408 339
409 case kDoubleScreenCmd: 340 case kDoubleScreenCmd:
410 ShowMenuBar(); 341 ShowMenuBar();
411 ShowCursor(); 342 ShowCursor();
412 SizeWindow(theWindow, (imgRect.right*2), (imgRect.bottom*2), 1); 343 SizeWindow(theWindow, (d_width*2), (d_height*2), 1);
413 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen); 344 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
414 window_resized(); 345 window_resized();
415 break; 346 break;
416 347
417 case kFullScreenCmd: 348 case kFullScreenCmd: