changeset 6221:4b2459557340

add XShape support for gui's submenu
author pontscho
date Tue, 28 May 2002 14:12:33 +0000
parents dc29d4236bdc
children 1a83bd7ff76e
files Gui/mplayer/menu.h Gui/mplayer/play.c Gui/skin/skin.c
diffstat 3 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/menu.h	Tue May 28 13:21:29 2002 +0000
+++ b/Gui/mplayer/menu.h	Tue May 28 14:12:33 2002 +0000
@@ -80,6 +80,7 @@
 
  wsMoveWindow( &appMPlayer.menuWindow,False,x,y );
  wsMoveTopWindow( wsDisplay,appMPlayer.menuWindow.WindowID );
+ wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,1 );
  mplMenuRender=1;
  wsVisibleWindow( &appMPlayer.menuWindow,wsShowWindow );
  wsPostRedisplay( &appMPlayer.menuWindow );
@@ -132,6 +133,8 @@
  appMPlayer.menuBase.x,appMPlayer.menuBase.y,appMPlayer.menuBase.width,appMPlayer.menuBase.height,
  wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsOverredirect|wsHideFrame|wsMaxSize|wsMinSize|wsHideWindow,"MPlayer menu" );
 
+ wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
+
  #ifdef DEBUG
   mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu.h] menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID );
  #endif
--- a/Gui/mplayer/play.c	Tue May 28 13:21:29 2002 +0000
+++ b/Gui/mplayer/play.c	Tue May 28 14:12:33 2002 +0000
@@ -182,6 +182,7 @@
     { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
    wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
    wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
+   wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
    wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
   }
 
--- a/Gui/skin/skin.c	Tue May 28 13:21:29 2002 +0000
+++ b/Gui/skin/skin.c	Tue May 28 14:12:33 2002 +0000
@@ -160,19 +160,6 @@
     }
    mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin]  %d,%d %dx%d\n",defList->sub.x,defList->sub.y,defList->sub.width,defList->sub.height );
   }
-/*
- if ( !strcmp( winList,"eq" ) )
-  {
-   defList->eq.x=x;
-   defList->eq.y=y;
-   defList->eq.type=itBase;
-   strcpy( tmp,path ); strcat( tmp,fname );
-   if ( skinBPRead( tmp,&defList->eq.Bitmap ) ) return 1;
-   defList->eq.width=defList->eq.Bitmap.Width;
-   defList->eq.height=defList->eq.Bitmap.Height;
-   mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin]  width: %d height: %d\n",defList->eq.width,defList->eq.height );
-  }
-*/
  if ( !strcmp( winList,"menu" ) )
   {
    defList->menuBase.type=itBase;
@@ -180,6 +167,22 @@
    if ( skinBPRead( tmp,&defList->menuBase.Bitmap ) ) return 1;
    defList->menuBase.width=defList->menuBase.Bitmap.Width;
    defList->menuBase.height=defList->menuBase.Bitmap.Height;
+   #ifdef HAVE_XSHAPE
+    Convert32to1( &defList->menuBase.Bitmap,&defList->menuBase.Mask,0x00ff00ff );
+#if 0
+    {
+     if ( defList->menuBase.Mask.Image != NULL )
+      {
+       txSample d;
+       Convert1to32( &defList->menuBase.Mask,&d );
+       tgaWriteTexture( "debug.tga",&d );
+      }
+    }
+#endif
+    mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin]  mask: %dx%d\n",defList->menuBase.Mask.Width,defList->menuBase.Mask.Height );
+   #else
+    defList->menuBase.Mask.Image=NULL;
+   #endif
    mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin]  width: %d height: %d\n",defList->menuBase.width,defList->menuBase.height );
   }
  return 0;