[Mplayer-cvslog] CVS: main/Gui Makefile,1.16,1.17 app.h,1.9,1.10 interface.c,1.55,1.56
Zoltan Ponekker
pontscho at mplayerhq.hu
Sat Nov 2 21:10:49 CET 2002
Update of /cvsroot/mplayer/main/Gui
In directory mail:/var/tmp.root/cvs-serv11462/Gui
Modified Files:
Makefile app.h interface.c
Log Message:
cosmetic
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/Makefile,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Makefile 2 Nov 2002 17:07:09 -0000 1.16
+++ Makefile 2 Nov 2002 20:10:16 -0000 1.17
@@ -14,10 +14,9 @@
CFLAGS = $(OPTIMIZE) $(INCDIR) $(DEBUG)
-SRCS = wm/ws.c wm/wsxdnd.c app.c interface.c cfg.c \
- bitmap/bitmap.c \
+SRCS = wm/ws.c wm/wsxdnd.c app.c interface.c cfg.c bitmap.c \
skin/skin.c skin/font.c skin/cut.c \
- mplayer/mplayer.c mplayer/widgets.c mplayer/play.c \
+ mplayer/widgets.c mplayer/play.c mplayer/mw.c mplayer/sw.c mplayer/menu.c \
mplayer/gtk/menu.c mplayer/gtk/mb.c mplayer/gtk/about.c mplayer/gtk/pl.c mplayer/gtk/sb.c mplayer/gtk/fs.c mplayer/gtk/opts.c mplayer/gtk/url.c mplayer/gtk/eq.c
OBJS = $(SRCS:.c=.o)
Index: app.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/app.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- app.h 2 Nov 2002 16:09:03 -0000 1.9
+++ app.h 2 Nov 2002 20:10:16 -0000 1.10
@@ -2,7 +2,7 @@
#ifndef __APPS_H
#define __APPS_H
-#include "bitmap/bitmap.h"
+#include "bitmap.h"
#include "wm/ws.h"
#include "wm/wskeys.h"
Index: interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- interface.c 2 Nov 2002 16:09:03 -0000 1.55
+++ interface.c 2 Nov 2002 20:10:16 -0000 1.56
@@ -1,18 +1,20 @@
-
+
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <sys/types.h>
-#include "ws.h"
-#include "mplayer/play.h"
+#include "wm/ws.h"
+#include "wm/wsxdnd.h"
#include "interface.h"
#include "skin/skin.h"
-#include "mplayer/gtk/eq.h"
-#include "../mplayer.h"
+#include "mplayer/gtk/eq.h"
#include "mplayer/widgets.h"
#include "mplayer/mplayer.h"
+
+#include "../mplayer.h"
#include "app.h"
#include "cfg.h"
#include "../help_mp.h"
@@ -27,9 +29,6 @@
#include "../libao2/audio_plugin.h"
#include "../libao2/eq.h"
-#include <inttypes.h>
-#include <sys/types.h>
-
#ifdef USE_ICONV
#include <iconv.h>
#endif
@@ -150,6 +149,8 @@
void guiInit( void )
{
+ int i;
+
memset( &guiIntfStruct,0,sizeof( guiIntfStruct ) );
guiIntfStruct.Balance=50.0f;
guiIntfStruct.StreamType=-1;
@@ -165,7 +166,7 @@
gtkInit();
// --- initialize X
wsXInit( (void *)mDisplay );
-// ---
+// --- load skin
skinDirInHome=get_path("Skin");
skinMPlayerDir=DATADIR "/Skin";
printf("SKIN dir 1: '%s'\n",skinDirInHome);
@@ -176,7 +177,83 @@
case -1: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinNotFound,skinName ); exit( 0 );
case -2: mp_msg( MSGT_GPLAYER,MSGL_ERR,MSGTR_SKIN_SKINCFG_SkinCfgReadError,skinName ); exit( 0 );
}
- mplInit( (void *)mDisplay );
+// --- initialize windows
+ if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
+ {
+ fprintf( stderr,MSGTR_NEMDB );
+ exit( 0 );
+ }
+
+ wsCreateWindow( &appMPlayer.subWindow,
+ appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
+ wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" );
+
+ wsDestroyImage( &appMPlayer.subWindow );
+ wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
+ wsXDNDMakeAwareness(&appMPlayer.subWindow);
+
+ vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC );
+
+// i=wsHideFrame|wsMaxSize|wsHideWindow;
+// if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
+ i=wsShowFrame|wsMaxSize|wsHideWindow;
+ wsCreateWindow( &appMPlayer.mainWindow,
+ appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
+ wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize|
+
+ wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
+ wsXDNDMakeAwareness(&appMPlayer.mainWindow);
+
+ mplMenuInit();
+
+ #ifdef DEBUG
+ mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] Depth on screen: %d\n",wsDepthOnScreen );
+ mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID );
+ mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID );
+ #endif
+
+ appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw;
+ appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
+ appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
+ appMPlayer.mainWindow.DandDHandler=mplDandDHandler;
+
+ appMPlayer.subWindow.ReDraw=(void *)mplSubDraw;
+ appMPlayer.subWindow.MouseHandler=mplSubMouseHandle;
+ appMPlayer.subWindow.KeyHandler=mplMainKeyHandle;
+ appMPlayer.subWindow.DandDHandler=mplDandDHandler;
+
+ wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
+ wsClearWindow( appMPlayer.subWindow );
+ if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
+
+ btnModify( evSetVolume,guiIntfStruct.Volume );
+ btnModify( evSetBalance,guiIntfStruct.Balance );
+ btnModify( evSetMoviePosition,guiIntfStruct.Position );
+
+ wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
+ wsSetIcon( wsDisplay,appMPlayer.subWindow.WindowID,guiIcon,guiIconMask );
+
+ guiIntfStruct.Playing=0;
+
+ if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
+
+ wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
+#if 1
+ wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
+
+ {
+ XEvent xev;
+ do { XNextEvent( wsDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID );
+ appMPlayer.subWindow.Mapped=wsMapped;
+ }
+
+ if ( fullscreen )
+ {
+ mplFullScreen();
+ btnModify( evFullScreen,btnPressed );
+ }
+#endif
+ mplSubRender=1;
// ---
if ( plCurrent && !filename ) mplSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
More information about the MPlayer-cvslog
mailing list