comparison libvo/vo_xmga.c @ 4993:53c569d36b2c

small changes in libvo's X11 support
author pontscho
date Fri, 08 Mar 2002 20:14:08 +0000
parents 01bcb7a9bb4e
children 18690b95b24c
comparison
equal deleted inserted replaced
4992:e2f8b4b74c25 4993:53c569d36b2c
59 static unsigned int timerd=0; 59 static unsigned int timerd=0;
60 #endif 60 #endif
61 61
62 static vo_info_t vo_info = 62 static vo_info_t vo_info =
63 { 63 {
64 "X11 (Matrox G200/G400 overlay in window using /dev/mga_vid)", 64 "X11 (Matrox G200/G4x0/G550 overlay in window using /dev/mga_vid)",
65 "xmga", 65 "xmga",
66 "Zoltan Ponekker <pontscho@makacs.poliod.hu>", 66 "Zoltan Ponekker <pontscho@makacs.poliod.hu>",
67 "" 67 ""
68 }; 68 };
69 69
87 static uint32_t mvWidth; 87 static uint32_t mvWidth;
88 88
89 static Window mRoot; 89 static Window mRoot;
90 static uint32_t drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth; 90 static uint32_t drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth;
91 static uint32_t drwcX,drwcY,dwidth,dheight; 91 static uint32_t drwcX,drwcY,dwidth,dheight;
92
93 //#ifdef HAVE_NEW_GUI
94 static uint32_t mdwidth,mdheight;
95 //#endif
96 92
97 static XSetWindowAttributes xWAttribs; 93 static XSetWindowAttributes xWAttribs;
98 94
99 #define VO_XMGA 95 #define VO_XMGA
100 #include "mga_common.c" 96 #include "mga_common.c"
109 XFlush( mDisplay ); 105 XFlush( mDisplay );
110 } 106 }
111 107
112 static void set_window(){ 108 static void set_window(){
113 109
114 dwidth=mdwidth; dheight=mdheight;
115 if ( vo_fs )
116 {
117 dwidth=vo_screenwidth;
118 dheight=vo_screenwidth * mdheight / mdwidth;
119 }
120
121 XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth ); 110 XGetGeometry( mDisplay,vo_window,&mRoot,&drwX,&drwY,&drwWidth,&drwHeight,&drwBorderWidth,&drwDepth );
111 fprintf( stderr,"[xmga] x: %d y: %d w: %d h: %d\n",drwX,drwY,drwWidth,drwHeight );
122 drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight; 112 drwX=0; drwY=0; // drwWidth=wndWidth; drwHeight=wndHeight;
123 XTranslateCoordinates( mDisplay,vo_window,mRoot,0,0,&drwcX,&drwcY,&mRoot ); 113 XTranslateCoordinates( mDisplay,vo_window,mRoot,0,0,&drwcX,&drwcY,&mRoot );
124 fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight ); 114 fprintf( stderr,"[xmga] dcx: %d dcy: %d dx: %d dy: %d dw: %d dh: %d\n",drwcX,drwcY,drwX,drwY,drwWidth,drwHeight );
125 115
126 aspect(&dwidth,&dheight,A_NOZOOM); 116 aspect(&dwidth,&dheight,A_NOZOOM);
271 default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1; 261 default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1;
272 } 262 }
273 263
274 aspect(&d_width,&d_height,A_NOZOOM); 264 aspect(&d_width,&d_height,A_NOZOOM);
275 #ifdef HAVE_NEW_GUI 265 #ifdef HAVE_NEW_GUI
276 mdwidth=width; mdheight=height;
277 if ( vo_window == None ) 266 if ( vo_window == None )
278 { 267 {
279 #endif 268 #endif
280 if ( vo_fs ) 269 if ( vo_fs )
281 { 270 {
309 mDepth, 298 mDepth,
310 InputOutput, 299 InputOutput,
311 vinfo.visual,xswamask,&xWAttribs ); 300 vinfo.visual,xswamask,&xWAttribs );
312 vo_x11_classhint( mDisplay,vo_window,"xmga" ); 301 vo_x11_classhint( mDisplay,vo_window,"xmga" );
313 vo_hidecursor(mDisplay,vo_window); 302 vo_hidecursor(mDisplay,vo_window);
303 vo_x11_sizehint( wndX,wndY,wndWidth,wndHeight );
314 304
315 if ( vo_fs ) vo_x11_decoration( mDisplay,vo_window,0 ); 305 if ( vo_fs ) vo_x11_decoration( mDisplay,vo_window,0 );
316 306
317 XGetNormalHints( mDisplay,vo_window,&hint );
318 hint.x=wndX; hint.y=wndY;
319 hint.width=wndWidth; hint.height=wndHeight;
320 hint.base_width=wndWidth; hint.base_height=wndHeight;
321 hint.flags=USPosition | USSize;
322 XSetNormalHints( mDisplay,vo_window,&hint );
323 XStoreName( mDisplay,vo_window,mTitle ); 307 XStoreName( mDisplay,vo_window,mTitle );
324 XMapWindow( mDisplay,vo_window ); 308 XMapWindow( mDisplay,vo_window );
325 309
326 #ifdef HAVE_XINERAMA 310 #ifdef HAVE_XINERAMA
327 vo_x11_xinerama_move(mDisplay,vo_window); 311 vo_x11_xinerama_move(mDisplay,vo_window);