12296
|
1 /*
|
|
2 vo_quartz.c
|
|
3
|
|
4 by Nicolas Plourde <nicolasplourde@hotmail.com>
|
|
5
|
|
6 Copyright (c) Nicolas Plourde - April 2004
|
|
7
|
|
8 MPlayer Mac OSX Quartz video out module.
|
|
9
|
|
10 todo: -YUV support.
|
|
11 -Redo event handling.
|
|
12 -Choose fullscreen display device.
|
|
13 -Fullscreen antialiasing.
|
|
14 -resize black bar without CGContext
|
|
15 -rootwin
|
|
16 -non-blocking event
|
|
17 -(add sugestion here)
|
12120
|
18 */
|
|
19
|
|
20 //SYS
|
|
21 #include <stdio.h>
|
|
22
|
|
23 //OSX
|
|
24 #include <Carbon/Carbon.h>
|
|
25
|
|
26 //MPLAYER
|
|
27 #include "config.h"
|
|
28 #include "video_out.h"
|
|
29 #include "video_out_internal.h"
|
|
30 #include "aspect.h"
|
|
31
|
|
32 #include "../input/input.h"
|
|
33 #include "../input/mouse.h"
|
|
34
|
|
35 #include "vo_quartz.h"
|
|
36
|
12296
|
37 static vo_info_t info =
|
|
38 {
|
|
39 "Mac OSX (Quartz)",
|
|
40 "quartz",
|
|
41 "Nicolas Plourde <nicolasplourde@hotmail.com>",
|
|
42 ""
|
12120
|
43 };
|
|
44
|
12296
|
45 LIBVO_EXTERN(quartz)
|
12120
|
46
|
12296
|
47 uint32_t image_width;
|
|
48 uint32_t image_height;
|
|
49 uint32_t image_depth;
|
|
50 uint32_t image_bytes;
|
|
51 uint32_t image_format;
|
|
52 char *image_data;
|
12120
|
53
|
12296
|
54 extern int vo_ontop;
|
|
55 extern int vo_fs;
|
12120
|
56
|
12296
|
57 int int_pause = 0;
|
|
58 float winAlpha = 1;
|
|
59
|
|
60 int device_width, device_height;
|
12120
|
61
|
|
62 WindowRef theWindow;
|
12296
|
63
|
|
64 GWorldPtr imgGWorld;
|
|
65
|
|
66 Rect imgRect;
|
|
67 Rect dstRect;
|
|
68 Rect winRect;
|
|
69
|
12120
|
70 CGContextRef context;
|
|
71
|
|
72 #include "../osdep/keycodes.h"
|
12296
|
73 extern void mplayer_put_key(int code);
|
|
74
|
|
75 extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
|
12120
|
76
|
|
77 //PROTOTYPE/////////////////////////////////////////////////////////////////
|
12296
|
78 void window_resized();
|
|
79 void window_ontop();
|
|
80 void window_fullscreen();
|
12120
|
81
|
12296
|
82 static OSStatus MainWindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
|
|
83 static OSStatus MainKeyboardEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
|
|
84 static OSStatus MainMouseEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData);
|
|
85
|
|
86 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride)
|
|
87 {
|
|
88 vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*imgRect.right+x0),4*imgRect.right);
|
|
89 }
|
12120
|
90
|
|
91 //default window event handler
|
12296
|
92 static OSStatus MainWindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData)
|
12120
|
93 {
|
12296
|
94 OSStatus err = noErr;
|
|
95 WindowRef window;
|
|
96 Rect rectPort = {0,0,0,0};
|
|
97 OSStatus result = eventNotHandledErr;
|
|
98 UInt32 class = GetEventClass (event);
|
|
99 UInt32 kind = GetEventKind (event);
|
12120
|
100
|
12296
|
101 GetEventParameter(event, kEventParamDirectObject, typeWindowRef, NULL, sizeof(WindowRef), NULL, &window);
|
|
102 if(window)
|
|
103 {
|
|
104 GetWindowPortBounds (window, &rectPort);
|
|
105 }
|
|
106
|
|
107 switch (kind)
|
|
108 {
|
|
109 //close window
|
|
110 case kEventWindowClosed:
|
|
111 HideWindow(window);
|
|
112 mplayer_put_key(KEY_ESC);
|
|
113 break;
|
|
114
|
|
115 //resize window
|
|
116 case kEventWindowBoundsChanged:
|
|
117 window_resized();
|
|
118 flip_page();
|
|
119 break;
|
|
120
|
|
121 default:
|
|
122 err = eventNotHandledErr;
|
|
123 break;
|
12120
|
124 }
|
12296
|
125
|
|
126 return err;
|
12120
|
127 }
|
|
128
|
|
129 //keyboard event handler
|
12296
|
130 static OSStatus MainKeyboardEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData)
|
12120
|
131 {
|
12296
|
132 OSStatus err = noErr;
|
|
133 UInt32 macKeyCode;
|
|
134
|
|
135 GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, sizeof(macKeyCode), NULL, &macKeyCode);
|
|
136
|
|
137 switch (GetEventKind (event))
|
|
138 {
|
|
139 case kEventRawKeyDown:
|
|
140 {
|
|
141 switch(macKeyCode)
|
|
142 {
|
|
143 case QZ_RETURN: mplayer_put_key(KEY_ENTER);break;
|
|
144 case QZ_ESCAPE: mplayer_put_key(KEY_ESC);break;
|
|
145 case QZ_q: mplayer_put_key('q');break;
|
|
146 case QZ_F1: mplayer_put_key(KEY_F+1);break;
|
|
147 case QZ_F2: mplayer_put_key(KEY_F+2);break;
|
|
148 case QZ_F3: mplayer_put_key(KEY_F+3);break;
|
|
149 case QZ_F4: mplayer_put_key(KEY_F+4);break;
|
|
150 case QZ_F5: mplayer_put_key(KEY_F+5);break;
|
|
151 case QZ_F6: mplayer_put_key(KEY_F+6);break;
|
|
152 case QZ_F7: mplayer_put_key(KEY_F+7);break;
|
|
153 case QZ_F8: mplayer_put_key(KEY_F+8);break;
|
|
154 case QZ_F9: mplayer_put_key(KEY_F+9);break;
|
|
155 case QZ_F10: mplayer_put_key(KEY_F+10);break;
|
|
156 case QZ_F11: mplayer_put_key(KEY_F+11);break;
|
|
157 case QZ_F12: mplayer_put_key(KEY_F+12);break;
|
|
158 case QZ_o: mplayer_put_key('o');break;
|
|
159 case QZ_SPACE: mplayer_put_key(' ');break;
|
|
160 case QZ_p: mplayer_put_key('p');break;
|
|
161 //case QZ_7: mplayer_put_key(shift_key?'/':'7');
|
|
162 //case QZ_PLUS: mplayer_put_key(shift_key?'*':'+');
|
|
163 case QZ_KP_PLUS: mplayer_put_key('+');break;
|
|
164 case QZ_MINUS:
|
|
165 case QZ_KP_MINUS: mplayer_put_key('-');break;
|
|
166 case QZ_TAB: mplayer_put_key('\t');break;
|
|
167 case QZ_PAGEUP: mplayer_put_key(KEY_PAGE_UP);break;
|
|
168 case QZ_PAGEDOWN: mplayer_put_key(KEY_PAGE_DOWN);break;
|
|
169 case QZ_UP: mplayer_put_key(KEY_UP);break;
|
|
170 case QZ_DOWN: mplayer_put_key(KEY_DOWN);break;
|
|
171 case QZ_LEFT: mplayer_put_key(KEY_LEFT);break;
|
|
172 case QZ_RIGHT: mplayer_put_key(KEY_RIGHT);break;
|
|
173 //case QZ_LESS: mplayer_put_key(shift_key?'>':'<'); break;
|
|
174 //case QZ_GREATER: mplayer_put_key('>'); break;
|
|
175 //case QZ_ASTERISK:
|
|
176 case QZ_KP_MULTIPLY: mplayer_put_key('*'); break;
|
|
177 case QZ_SLASH:
|
|
178 case QZ_KP_DIVIDE: mplayer_put_key('/'); break;
|
|
179 case QZ_KP0: mplayer_put_key(KEY_KP0); break;
|
|
180 case QZ_KP1: mplayer_put_key(KEY_KP1); break;
|
|
181 case QZ_KP2: mplayer_put_key(KEY_KP2); break;
|
|
182 case QZ_KP3: mplayer_put_key(KEY_KP3); break;
|
|
183 case QZ_KP4: mplayer_put_key(KEY_KP4); break;
|
|
184 case QZ_KP5: mplayer_put_key(KEY_KP5); break;
|
|
185 case QZ_KP6: mplayer_put_key(KEY_KP6); break;
|
|
186 case QZ_KP7: mplayer_put_key(KEY_KP7); break;
|
|
187 case QZ_KP8: mplayer_put_key(KEY_KP8); break;
|
|
188 case QZ_KP9: mplayer_put_key(KEY_KP9); break;
|
|
189 case QZ_KP_PERIOD: mplayer_put_key(KEY_KPDEC); break;
|
|
190 case QZ_KP_ENTER: mplayer_put_key(KEY_KPENTER); break;
|
|
191 case QZ_LEFTBRACKET: SetWindowAlpha(theWindow, winAlpha-=0.05);break;
|
|
192 case QZ_RIGHTBRACKET: SetWindowAlpha(theWindow, winAlpha+=0.05);break;
|
|
193 case QZ_f: mplayer_put_key('f'); break;
|
|
194 case QZ_t: mplayer_put_key('T'); break;
|
|
195 default:
|
|
196 break;
|
|
197 }
|
|
198 }
|
|
199 break;
|
|
200 default:
|
|
201 err = eventNotHandledErr;
|
|
202 break;
|
|
203 }
|
|
204
|
|
205 return err;
|
|
206 }
|
12120
|
207
|
12296
|
208 //Mouse event handler
|
|
209 static OSStatus MainMouseEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData)
|
|
210 {
|
|
211 OSStatus err = noErr;
|
|
212 WindowPtr tmpWin;
|
|
213 Point mousePos;
|
|
214
|
|
215 GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0, sizeof(Point), 0, &mousePos);
|
12120
|
216
|
12296
|
217 switch (GetEventKind (event))
|
12120
|
218 {
|
12296
|
219 case kEventMouseDown:
|
|
220 {
|
|
221 short part = FindWindow(mousePos,&tmpWin);
|
|
222
|
|
223 if(part == inMenuBar)
|
|
224 {
|
|
225 MenuSelect(mousePos);
|
|
226 }
|
|
227 }
|
|
228 break;
|
|
229 default:
|
|
230 err = eventNotHandledErr;
|
|
231 break;
|
12120
|
232 }
|
12296
|
233
|
|
234 HiliteMenu(0);
|
|
235 return err;
|
|
236 }
|
12120
|
237
|
12296
|
238 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
|
|
239 {
|
|
240 WindowAttributes windowAttrs;
|
|
241 CFStringRef titleKey;
|
|
242 CFStringRef windowTitle;
|
|
243 OSStatus result;
|
|
244 GDHandle deviceHdl;
|
|
245 Rect deviceRect;
|
|
246
|
|
247 //Get Main device info///////////////////////////////////////////////////
|
|
248 deviceHdl = GetMainDevice();
|
|
249 deviceRect = (*deviceHdl)->gdRect;
|
|
250
|
|
251 device_width = deviceRect.right;
|
|
252 device_height = deviceRect.bottom;
|
|
253
|
|
254 //misc mplayer setup/////////////////////////////////////////////////////
|
|
255 image_width = width;
|
|
256 image_height = height;
|
|
257 image_depth = IMGFMT_RGB_DEPTH(format);
|
|
258 image_bytes = (IMGFMT_RGB_DEPTH(format)+7)/8;
|
|
259 image_data = malloc(image_width*image_height*4);
|
|
260
|
|
261 vo_fs = flags & VOFLAG_FULLSCREEN;
|
|
262
|
|
263 //get movie aspect
|
|
264 aspect_save_orig(width,height);
|
|
265 aspect_save_prescale(d_width,d_height);
|
|
266 aspect_save_screenres(device_width, device_height);
|
|
267
|
|
268 aspect(&d_width,&d_height,A_NOZOOM);
|
|
269
|
|
270 //Create player window//////////////////////////////////////////////////
|
|
271 windowAttrs = kWindowStandardDocumentAttributes
|
|
272 | kWindowStandardHandlerAttribute
|
|
273 | kWindowLiveResizeAttribute;
|
|
274
|
|
275 SetRect(&winRect, 0, 0, d_width, d_height);
|
|
276 SetRect(&dstRect, 0, 0, d_width, d_height);
|
|
277 SetRect(&imgRect, 0, 0, image_width, image_height);
|
|
278
|
|
279 CreateNewWindow(kDocumentWindowClass, windowAttrs, &winRect, &theWindow);
|
|
280
|
|
281 //Set window title
|
|
282 titleKey = CFSTR("MPlayer");
|
|
283 windowTitle = CFCopyLocalizedString(titleKey, NULL);
|
|
284 result = SetWindowTitleWithCFString(theWindow, windowTitle);
|
|
285 CFRelease(titleKey);
|
|
286 CFRelease(windowTitle);
|
|
287
|
|
288 //Install event handler
|
|
289 const EventTypeSpec winEvents[] = { { kEventClassWindow, kEventWindowClosed }, { kEventClassWindow, kEventWindowBoundsChanged } };
|
|
290 const EventTypeSpec keyEvents[] = { { kEventClassKeyboard, kEventRawKeyDown } };
|
|
291 const EventTypeSpec mouseEvents[] = { { kEventClassMouse, kEventMouseDown } };
|
|
292
|
|
293 InstallWindowEventHandler (theWindow, NewEventHandlerUPP (MainWindowEventHandler), GetEventTypeCount(winEvents), winEvents, theWindow, NULL);
|
|
294 InstallWindowEventHandler (theWindow, NewEventHandlerUPP (MainKeyboardEventHandler), GetEventTypeCount(keyEvents), keyEvents, theWindow, NULL);
|
|
295 InstallApplicationEventHandler (NewEventHandlerUPP (MainMouseEventHandler), GetEventTypeCount(mouseEvents), mouseEvents, 0, NULL);
|
|
296
|
|
297 //Show window
|
|
298 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
299 ShowWindow (theWindow);
|
|
300
|
|
301 if(vo_fs)
|
|
302 window_fullscreen();
|
|
303
|
|
304 if(vo_ontop)
|
|
305 window_ontop();
|
|
306
|
|
307 return 0;
|
12120
|
308 }
|
|
309
|
12296
|
310 static void check_events(void)
|
12120
|
311 {
|
12296
|
312 EventRef theEvent;
|
|
313 EventTargetRef theTarget;
|
|
314 OSStatus theErr;
|
|
315
|
|
316 //Get event
|
|
317 theTarget = GetEventDispatcherTarget();
|
|
318 theErr = ReceiveNextEvent(0, 0, kEventDurationNoWait,true, &theEvent);
|
|
319 if(theErr == noErr && theEvent != NULL)
|
|
320 {
|
|
321 SendEventToEventTarget (theEvent, theTarget);
|
|
322 ReleaseEvent(theEvent);
|
|
323 }
|
12120
|
324
|
12296
|
325 //update activity every 30 seconds to prevent
|
|
326 //screensaver from starting up.
|
|
327 DateTimeRec d;
|
|
328 unsigned long curTime;
|
|
329 static unsigned long lastTime = 0;
|
|
330
|
|
331 GetTime(&d);
|
|
332 DateToSeconds( &d, &curTime);
|
|
333
|
|
334 if( ( (curTime - lastTime) >= 30) || (lastTime == 0))
|
|
335 {
|
|
336 UpdateSystemActivity(UsrActivity);
|
|
337 lastTime = curTime;
|
|
338 }
|
|
339 }
|
12120
|
340
|
12296
|
341 static void draw_osd(void)
|
|
342 {
|
|
343 vo_draw_text(image_width,image_height,draw_alpha);
|
|
344 }
|
12120
|
345
|
12296
|
346 static void flip_page(void)
|
|
347 {
|
|
348 OSStatus error;
|
|
349 CGrafPtr oldPort,deskPort;
|
|
350 GDHandle oldGDevice;
|
|
351 OSStatus lockPixelsError;
|
|
352 Boolean canLockPixels;
|
|
353
|
|
354 GetGWorld (&oldPort, &oldGDevice);
|
|
355 SetGWorld(GetWindowPort(theWindow), GetMainDevice());
|
|
356
|
|
357 CGrafPtr windowPort = GetWindowPort(theWindow);
|
|
358
|
|
359 lockPixelsError = LockPortBits(windowPort);
|
|
360
|
|
361 if (lockPixelsError == noErr)
|
|
362 canLockPixels = true;
|
|
363 else
|
|
364 canLockPixels = false;
|
|
365
|
|
366 if (canLockPixels)
|
|
367 {
|
|
368 CopyBits( GetPortBitMapForCopyBits (imgGWorld), GetPortBitMapForCopyBits (windowPort), &imgRect, &dstRect, srcCopy, 0 );
|
|
369 lockPixelsError = UnlockPortBits(windowPort);
|
|
370 }
|
|
371
|
|
372 RgnHandle theVisibleRegion;
|
|
373
|
|
374 if (QDIsPortBuffered(windowPort))
|
|
375 {
|
|
376 theVisibleRegion = NewRgn();
|
|
377 GetPortVisibleRegion(windowPort, theVisibleRegion);
|
|
378 QDFlushPortBuffer(windowPort, theVisibleRegion);
|
|
379 DisposeRgn(theVisibleRegion);
|
|
380 }
|
12120
|
381
|
12296
|
382 SetGWorld(oldPort, oldGDevice);
|
|
383 }
|
|
384
|
|
385 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
|
|
386 {
|
|
387 return -1;
|
|
388 }
|
|
389
|
|
390 static uint32_t draw_frame(uint8_t *src[])
|
|
391 {
|
|
392 image_data = src[0];
|
|
393
|
|
394 DisposeGWorld(imgGWorld);
|
|
395 NewGWorldFromPtr (&imgGWorld, k32ARGBPixelFormat, &imgRect, 0, 0, 0, image_data, image_width * 4);
|
|
396
|
|
397 return 0;
|
|
398 }
|
12120
|
399
|
12296
|
400 static uint32_t query_format(uint32_t format)
|
|
401 {
|
|
402 image_format = format;
|
|
403
|
|
404 //Curently supporting only rgb32 format.
|
|
405 if ((format == IMGFMT_RGB32))
|
|
406 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW;
|
|
407 return 0;
|
|
408 }
|
12120
|
409
|
12296
|
410 static void uninit(void)
|
|
411 {
|
|
412 ShowMenuBar();
|
|
413 }
|
12120
|
414
|
12296
|
415 static uint32_t preinit(const char *arg)
|
|
416 {
|
|
417 return 0;
|
12120
|
418 }
|
|
419
|
12296
|
420 static uint32_t control(uint32_t request, void *data, ...)
|
12120
|
421 {
|
12296
|
422 switch (request)
|
|
423 {
|
|
424 case VOCTRL_PAUSE: return (int_pause=1);
|
|
425 case VOCTRL_RESUME: return (int_pause=0);
|
|
426 case VOCTRL_FULLSCREEN: window_fullscreen(); return VO_TRUE;
|
|
427 case VOCTRL_ONTOP: window_ontop(); return VO_TRUE;
|
|
428 case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data));
|
|
429 }
|
|
430 return VO_NOTIMPL;
|
12120
|
431 }
|
|
432
|
12296
|
433 void window_resized()
|
12120
|
434 {
|
12296
|
435 float aspectX;
|
|
436 float aspectY;
|
|
437
|
|
438 int padding;
|
|
439
|
|
440 uint32_t d_width;
|
|
441 uint32_t d_height;
|
|
442
|
|
443 GetWindowPortBounds(theWindow, &winRect);
|
12120
|
444
|
12296
|
445 aspect( &d_width, &d_height, A_NOZOOM);
|
|
446
|
|
447 aspectX = (float)((float)winRect.right/(float)d_width);
|
|
448 aspectY = (float)((float)winRect.bottom/(float)d_height);
|
|
449
|
|
450 if((d_height*aspectX)>winRect.bottom)
|
|
451 {
|
|
452 padding = (winRect.right - d_width*aspectY)/2;
|
|
453 SetRect(&dstRect, padding, 0, d_width*aspectY+padding, d_height*aspectY);
|
|
454 }
|
|
455 else
|
|
456 {
|
|
457 padding = (winRect.bottom - d_height*aspectX)/2;
|
|
458 SetRect(&dstRect, 0, padding, (d_width*aspectX), d_height*aspectX+padding);
|
|
459 }
|
12120
|
460
|
12296
|
461 //create a graphic context for the window
|
|
462 SetPortBounds(GetWindowPort(theWindow), &winRect);
|
|
463 CreateCGContextForPort(GetWindowPort(theWindow),&context);
|
|
464
|
|
465 //fill background with black
|
|
466 CGRect winBounds = CGRectMake( winRect.top, winRect.left, winRect.right, winRect.bottom);
|
|
467 CGContextSetRGBFillColor(context, 0.0, 0.0, 0.0, 1.0);
|
|
468 CGContextFillRect(context, winBounds);
|
|
469 CGContextFlush(context);
|
12120
|
470 }
|
|
471
|
12296
|
472 void window_ontop()
|
|
473 {
|
|
474 if(!vo_ontop)
|
|
475 SetWindowClass( theWindow, kUtilityWindowClass);
|
|
476 else
|
|
477 SetWindowClass( theWindow, kDocumentWindowClass);
|
|
478
|
|
479 vo_ontop = (!(vo_ontop));
|
12120
|
480 }
|
|
481
|
12296
|
482 void window_fullscreen()
|
12120
|
483 {
|
12296
|
484 static Rect oldRect;
|
|
485 static Ptr *restoreState = nil;
|
|
486 short width=640;
|
|
487 short height=480;
|
|
488 RGBColor black={0,0,0};
|
|
489 GDHandle deviceHdl;
|
|
490 Rect deviceRect;
|
12120
|
491
|
12296
|
492 //go fullscreen
|
|
493 if(!vo_fs)
|
|
494 {
|
|
495 //BeginFullScreen( &restoreState,nil,&width,&height,nil,&black,nil);
|
|
496 HideMenuBar();
|
12120
|
497
|
12296
|
498 //Get Main device info///////////////////////////////////////////////////
|
|
499 deviceHdl = GetMainDevice();
|
|
500 deviceRect = (*deviceHdl)->gdRect;
|
|
501
|
|
502 device_width = deviceRect.right;
|
|
503 device_height = deviceRect.bottom;
|
12120
|
504
|
12296
|
505 //save old window size
|
|
506 GetWindowPortBounds(theWindow, &oldRect);
|
|
507
|
|
508 //hide mouse cursor
|
|
509 HideCursor();
|
|
510
|
|
511 //go fullscreen
|
|
512 ChangeWindowAttributes(theWindow, 0, kWindowResizableAttribute);
|
|
513 MoveWindow (theWindow, 0, 0, 1);
|
|
514 SizeWindow(theWindow, device_width, device_height,1);
|
12120
|
515
|
12296
|
516 vo_fs = 1;
|
|
517 }
|
|
518 else //go back to windowed mode
|
|
519 {
|
|
520 //EndFullScreen( restoreState,0);
|
|
521 ShowMenuBar();
|
|
522
|
|
523 //Get Main device info///////////////////////////////////////////////////
|
|
524 deviceHdl = GetMainDevice();
|
|
525 deviceRect = (*deviceHdl)->gdRect;
|
|
526
|
|
527 device_width = deviceRect.right;
|
|
528 device_height = deviceRect.bottom;
|
12120
|
529
|
12296
|
530 //show mouse cursor
|
|
531 ShowCursor();
|
|
532
|
|
533 //revert window to previous setting
|
|
534 ChangeWindowAttributes(theWindow, kWindowResizableAttribute, 0);
|
|
535 SizeWindow(theWindow, oldRect.right, oldRect.bottom,1);
|
|
536 RepositionWindow(theWindow, NULL, kWindowCascadeOnMainScreen);
|
|
537
|
|
538 vo_fs = 0;
|
|
539 }
|
|
540
|
|
541 window_resized();
|
12120
|
542 }
|
|
543
|