Mercurial > mplayer.hg
annotate Gui/mplayer/mplayer.c @ 4790:50288f9f6b15
Fix return value of VOCTRL_FULLSCREEN
author | atmos4 |
---|---|
date | Thu, 21 Feb 2002 16:17:15 +0000 |
parents | 3e1378354c2e |
children | b1a2469e78ac |
rev | line source |
---|---|
1693 | 1 |
2 #include <stdlib.h> | |
3 #include <stdio.h> | |
4 #include <string.h> | |
4428 | 5 #include <inttypes.h> |
1693 | 6 |
7 #include "./mplayer.h" | |
8 #include "../events.h" | |
9 #include "../app.h" | |
10 #include "../skin/skin.h" | |
11 #include "../skin/font.h" | |
12 #include "../wm/ws.h" | |
13 #include "../wm/wskeys.h" | |
14 #include "../wm/widget.h" | |
15 #include "../bitmap/bitmap.h" | |
16 #include "../timer.h" | |
17 #include "../error.h" | |
18 | |
19 #include "../../config.h" | |
1884 | 20 #include "../../help_mp.h" |
1776 | 21 #include "../../libvo/x11_common.h" |
2970 | 22 #include "../../libmpdemux/stream.h" |
1693 | 23 |
1697 | 24 #define mplMouseTimerConst 10 |
25 #define mplRedrawTimerConst 5 | |
1693 | 26 |
27 int mplMouseTimer = mplMouseTimerConst; | |
28 int mplRedrawTimer = mplRedrawTimerConst; | |
29 int mplGeneralTimer = -1; | |
30 int mplTimer = 0; | |
31 | |
32 void mplMsgHandle( int msg,float param ); | |
33 | |
34 #include "widgets.h" | |
35 #include "play.h" | |
36 #include "menu.h" | |
37 #include "mw.h" | |
38 #include "sw.h" | |
1801 | 39 #include "widgets.h" |
1693 | 40 |
41 void mplTimerHandler( int signum ) | |
42 { | |
43 mplTimer++; | |
44 mplMouseTimer--; | |
45 mplRedrawTimer--; | |
46 mplGeneralTimer--; | |
47 if ( mplMouseTimer == 0 ) mplMsgHandle( evHideMouseCursor,0 ); | |
48 if ( mplRedrawTimer == 0 ) mplMsgHandle( evRedraw,0 ); | |
49 if ( mplGeneralTimer == 0 ) mplMsgHandle( evGeneralTimer,0 ); | |
50 } | |
51 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1709
diff
changeset
|
52 void mplInit( int argc,char* argv[], char *envp[], void* disp ) |
1693 | 53 { |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1860
diff
changeset
|
54 int i; |
2854 | 55 |
56 // allocates shmem to mplShMem | |
57 // init fields of this struct to default values | |
58 mplMPlayerInit( argc,argv,envp ); | |
59 | |
1697 | 60 // allocates shmem to gtkShMem |
1742 | 61 // fork() a process which runs gtkThreadProc() [gtkPID] |
1693 | 62 gtkInit( argc,argv,envp ); |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1860
diff
changeset
|
63 strcpy( gtkShMem->sb.name,skinName ); |
1697 | 64 |
65 message=mplErrorHandler; // error messagebox drawing function | |
1693 | 66 |
1697 | 67 // opens X display, checks for extensions (XShape, DGA etc) |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1709
diff
changeset
|
68 wsXInit(disp); |
1693 | 69 |
70 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) | |
71 { | |
1884 | 72 fprintf( stderr,MSGTR_NEMDB ); |
1693 | 73 exit( 0 ); |
74 } | |
75 | |
76 wsCreateWindow( &appMPlayer.subWindow, | |
77 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, | |
3080 | 78 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" ); |
1693 | 79 |
3080 | 80 wsDestroyImage( &appMPlayer.subWindow ); |
81 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); | |
82 | |
83 vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC ); | |
1742 | 84 vo_setwindowsize( appMPlayer.sub.width,appMPlayer.sub.height ); |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1709
diff
changeset
|
85 |
2970 | 86 i=wsHideFrame|wsMaxSize|wsHideWindow; |
87 if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow; | |
1693 | 88 wsCreateWindow( &appMPlayer.mainWindow, |
89 appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height, | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1860
diff
changeset
|
90 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize| |
1693 | 91 |
92 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
2970 | 93 |
1693 | 94 mplMenuInit(); |
95 | |
96 #ifdef DEBUG | |
97 dbprintf( 1,"[main] Depth on screen: %d\n",wsDepthOnScreen ); | |
98 dbprintf( 1,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID ); | |
99 dbprintf( 1,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID ); | |
100 #endif | |
101 | |
102 appMPlayer.mainWindow.ReDraw=mplMainDraw; | |
103 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle; | |
104 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle; | |
105 | |
106 appMPlayer.subWindow.ReDraw=mplSubDraw; | |
107 appMPlayer.subWindow.MouseHandler=mplSubMouseHandle; | |
108 appMPlayer.subWindow.KeyHandler=mplMainKeyHandle; | |
109 appMPlayer.subWindow.ReSize=mplResize; | |
110 | |
2029 | 111 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); |
3080 | 112 wsClearWindow( appMPlayer.subWindow ); |
2025
0653e90b3118
some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents:
1884
diff
changeset
|
113 if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize ); |
0653e90b3118
some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents:
1884
diff
changeset
|
114 |
1693 | 115 wsPostRedisplay( &appMPlayer.mainWindow ); |
116 wsPostRedisplay( &appMPlayer.subWindow ); | |
117 | |
118 btnModify( evSetVolume,mplShMem->Volume ); | |
119 btnModify( evSetBalance,mplShMem->Balance ); | |
120 btnModify( evSetMoviePosition,mplShMem->Position ); | |
121 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1709
diff
changeset
|
122 mplShMem->Playing=0; |
1693 | 123 |
3080 | 124 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); |
125 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); | |
1709 | 126 } |
127 | |
128 void mplDone(){ | |
1693 | 129 |
130 dbprintf( 1,"[mplayer] exit.\n" ); | |
131 | |
132 mplStop(); | |
1697 | 133 // timerDone(); |
134 gtkDone(); // kills the gtkThreadProc() process | |
1693 | 135 wsXDone(); |
1709 | 136 |
1693 | 137 } |
1709 | 138 |