comparison libvo/vo_xvidix.c @ 4805:79b753e2e84a

mondom fix bazmeg.
author pontscho
date Fri, 22 Feb 2002 15:22:27 +0000
parents 64be405bab7b
children bfc652fc7f43
comparison
equal deleted inserted replaced
4804:62a281be07ce 4805:79b753e2e84a
44 }; 44 };
45 45
46 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ 46 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */
47 47
48 /* X11 related variables */ 48 /* X11 related variables */
49 static Window mWindow;
50 static int X_already_started = 0; 49 static int X_already_started = 0;
51 50
52 /* Colorkey handling */ 51 /* Colorkey handling */
53 static GC mGC;
54 static XGCValues mGCV; 52 static XGCValues mGCV;
55 static uint32_t fgColor; 53 static uint32_t fgColor;
56 static vidix_grkey_t gr_key; 54 static vidix_grkey_t gr_key;
57 55
58 /* VIDIX related */ 56 /* VIDIX related */
92 dheight = vo_dheight; 90 dheight = vo_dheight;
93 } 91 }
94 } 92 }
95 #endif 93 #endif
96 94
97 XGetGeometry(mDisplay, mWindow, &mRoot, &drwX, &drwY, &drwWidth, 95 XGetGeometry(mDisplay, vo_window, &mRoot, &drwX, &drwY, &drwWidth,
98 &drwHeight, &drwBorderWidth, &drwDepth); 96 &drwHeight, &drwBorderWidth, &drwDepth);
99 drwX = drwY = 0; 97 drwX = drwY = 0;
100 XTranslateCoordinates(mDisplay, mWindow, mRoot, 0, 0, 98 XTranslateCoordinates(mDisplay, vo_window, mRoot, 0, 0,
101 &drwcX, &drwcY, &mRoot); 99 &drwcX, &drwcY, &mRoot);
102 100
103 if (!mFullscreen) 101 if (!mFullscreen)
104 mp_msg(MSGT_VO, MSGL_V, "[xvidix] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n", 102 mp_msg(MSGT_VO, MSGL_V, "[xvidix] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",
105 drwcX, drwcY, drwX, drwY, drwWidth, drwHeight); 103 drwcX, drwcY, drwX, drwY, drwWidth, drwHeight);
171 window_x, window_y, window_width, window_height); 169 window_x, window_y, window_width, window_height);
172 170
173 /* mDrawColorKey: */ 171 /* mDrawColorKey: */
174 172
175 /* fill drawable with specified color */ 173 /* fill drawable with specified color */
176 XSetBackground( mDisplay,mGC,0 ); 174 XSetBackground( mDisplay,vo_gc,0 );
177 XClearWindow( mDisplay,mWindow ); 175 XClearWindow( mDisplay,vo_window );
178 XSetForeground(mDisplay, mGC, fgColor); 176 XSetForeground(mDisplay, vo_gc, fgColor);
179 XFillRectangle(mDisplay, mWindow, mGC, drwX, drwY, drwWidth, 177 XFillRectangle(mDisplay, vo_window, vo_gc, drwX, drwY, drwWidth,
180 (mFullscreen ? drwHeight - 1 : drwHeight)); 178 (mFullscreen ? drwHeight - 1 : drwHeight));
181 /* flush, update drawable */ 179 /* flush, update drawable */
182 XFlush(mDisplay); 180 XFlush(mDisplay);
183 181
184 return; 182 return;
308 xswa.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask; 306 xswa.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask;
309 xswamask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; 307 xswamask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
310 308
311 if (WinID >= 0) 309 if (WinID >= 0)
312 { 310 {
313 mWindow = WinID ? ((Window)WinID) : RootWindow(mDisplay, mScreen); 311 vo_window = WinID ? ((Window)WinID) : RootWindow(mDisplay, mScreen);
314 XUnmapWindow(mDisplay, mWindow); 312 XUnmapWindow(mDisplay, vo_window);
315 XChangeWindowAttributes(mDisplay, mWindow, xswamask, &xswa); 313 XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
316 } 314 }
317 else 315 else
318 mWindow = XCreateWindow(mDisplay, RootWindow(mDisplay, mScreen), 316 vo_window = XCreateWindow(mDisplay, RootWindow(mDisplay, mScreen),
319 window_x, window_y, window_width, window_height, xswa.border_pixel, 317 window_x, window_y, window_width, window_height, xswa.border_pixel,
320 vinfo.depth, InputOutput, vinfo.visual, xswamask, &xswa); 318 vinfo.depth, InputOutput, vinfo.visual, xswamask, &xswa);
321 319
322 vo_x11_classhint(mDisplay, mWindow, "xvidix"); 320 vo_x11_classhint(mDisplay, vo_window, "xvidix");
323 vo_hidecursor(mDisplay, mWindow); 321 vo_hidecursor(mDisplay, vo_window);
324 322
325 #ifdef X11_FULLSCREEN 323 #ifdef X11_FULLSCREEN
326 if (mFullscreen) /* fullscreen */ 324 if (mFullscreen) /* fullscreen */
327 vo_x11_decoration(mDisplay, mWindow, 0); 325 vo_x11_decoration(mDisplay, vo_window, 0);
328 #endif 326 #endif
329 327
330 XGetNormalHints(mDisplay, mWindow, &hint); 328 XGetNormalHints(mDisplay, vo_window, &hint);
331 hint.x = window_x; 329 hint.x = window_x;
332 hint.y = window_y; 330 hint.y = window_y;
333 hint.base_width = hint.width = window_width; 331 hint.base_width = hint.width = window_width;
334 hint.base_height = hint.height = window_height; 332 hint.base_height = hint.height = window_height;
335 hint.flags = USPosition | USSize; 333 hint.flags = USPosition | USSize;
336 XSetNormalHints(mDisplay, mWindow, &hint); 334 XSetNormalHints(mDisplay, vo_window, &hint);
337 335
338 XStoreName(mDisplay, mWindow, title); 336 XStoreName(mDisplay, vo_window, title);
339 /* Map window. */ 337 /* Map window. */
340 338
341 XMapWindow(mDisplay, mWindow); 339 XMapWindow(mDisplay, vo_window);
342 #ifdef HAVE_XINERAMA 340 #ifdef HAVE_XINERAMA
343 vo_x11_xinerama_move(mDisplay, mWindow); 341 vo_x11_xinerama_move(mDisplay, vo_window);
344 #endif 342 #endif
345 343
346 mGC = XCreateGC(mDisplay, mWindow, GCForeground, &mGCV); 344 vo_gc = XCreateGC(mDisplay, vo_window, GCForeground, &mGCV);
347 345
346 XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask );
348 #ifdef HAVE_NEW_GUI 347 #ifdef HAVE_NEW_GUI
349 }
350 else
351 {
352 /* window was created by GUI */
353 mWindow = vo_window;
354 mGC = vo_gc;
355 } 348 }
356 #endif 349 #endif
357 350
358 mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] image properties: %dx%d depth: %d\n", 351 mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] image properties: %dx%d depth: %d\n",
359 image_width, image_height, image_depth); 352 image_width, image_height, image_depth);
370 } 363 }
371 364
372 set_window(1,info); 365 set_window(1,info);
373 if(info) memcpy(&vtune,info,sizeof(vo_tune_info_t)); 366 if(info) memcpy(&vtune,info,sizeof(vo_tune_info_t));
374 else memset(&vtune,0,sizeof(vo_tune_info_t)); 367 else memset(&vtune,0,sizeof(vo_tune_info_t));
375 #ifdef HAVE_NEW_GUI 368 XFlush(mDisplay);
376 if (vo_window == None) 369 XSync(mDisplay, False);
377 #endif
378 {
379 XFlush(mDisplay);
380 XSync(mDisplay, False);
381 }
382 370
383 saver_off(mDisplay); /* turning off screen saver */ 371 saver_off(mDisplay); /* turning off screen saver */
384 372
385 return(0); 373 return(0);
386 } 374 }
442 static void uninit(void) 430 static void uninit(void)
443 { 431 {
444 vidix_term(); 432 vidix_term();
445 433
446 saver_on(mDisplay); /* screen saver back on */ 434 saver_on(mDisplay); /* screen saver back on */
447 vo_x11_uninit(mDisplay, mWindow); 435 vo_x11_uninit(mDisplay, vo_window);
448 } 436 }
449 437
450 static uint32_t preinit(const char *arg) 438 static uint32_t preinit(const char *arg)
451 { 439 {
452 if (arg) 440 if (arg)