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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
1
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
2 #include <stdlib.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdio.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
4 #include <string.h>
4428
3e1378354c2e Compilation fixing
nick
parents: 3080
diff changeset
5 #include <inttypes.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7 #include "./mplayer.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #include "../events.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9 #include "../app.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
10 #include "../skin/skin.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
11 #include "../skin/font.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
12 #include "../wm/ws.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
13 #include "../wm/wskeys.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
14 #include "../wm/widget.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
15 #include "../bitmap/bitmap.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
16 #include "../timer.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
17 #include "../error.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
19 #include "../../config.h"
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
20 #include "../../help_mp.h"
1776
48e6351f5714 add x11_common.h
pontscho
parents: 1742
diff changeset
21 #include "../../libvo/x11_common.h"
2970
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
22 #include "../../libmpdemux/stream.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
23
1697
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
24 #define mplMouseTimerConst 10
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
25 #define mplRedrawTimerConst 5
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
26
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
27 int mplMouseTimer = mplMouseTimerConst;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
28 int mplRedrawTimer = mplRedrawTimerConst;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
29 int mplGeneralTimer = -1;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
30 int mplTimer = 0;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
31
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
32 void mplMsgHandle( int msg,float param );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
33
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
34 #include "widgets.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
35 #include "play.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
36 #include "menu.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
37 #include "mw.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
38 #include "sw.h"
1801
e16646a140fd fix skin change
pontscho
parents: 1791
diff changeset
39 #include "widgets.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
40
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
41 void mplTimerHandler( int signum )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
42 {
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
43 mplTimer++;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
44 mplMouseTimer--;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
45 mplRedrawTimer--;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
46 mplGeneralTimer--;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
47 if ( mplMouseTimer == 0 ) mplMsgHandle( evHideMouseCursor,0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
48 if ( mplRedrawTimer == 0 ) mplMsgHandle( evRedraw,0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
49 if ( mplGeneralTimer == 0 ) mplMsgHandle( evGeneralTimer,0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
50 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
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
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
53 {
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1860
diff changeset
54 int i;
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
55
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
56 // allocates shmem to mplShMem
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
57 // init fields of this struct to default values
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
58 mplMPlayerInit( argc,argv,envp );
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2226
diff changeset
59
1697
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
60 // allocates shmem to gtkShMem
1742
0880718750d5 fix signalhandling
pontscho
parents: 1723
diff changeset
61 // fork() a process which runs gtkThreadProc() [gtkPID]
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
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
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
64
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
65 message=mplErrorHandler; // error messagebox drawing function
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66
1697
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
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
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
69
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
70 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
71 {
1884
d21f8afc7680 add to multi lang support
pontscho
parents: 1866
diff changeset
72 fprintf( stderr,MSGTR_NEMDB );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
73 exit( 0 );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
74 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
75
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
76 wsCreateWindow( &appMPlayer.subWindow,
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
77 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
78 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
79
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
80 wsDestroyImage( &appMPlayer.subWindow );
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
81 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
82
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
83 vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC );
1742
0880718750d5 fix signalhandling
pontscho
parents: 1723
diff changeset
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
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
86 i=wsHideFrame|wsMaxSize|wsHideWindow;
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
87 if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
88 wsCreateWindow( &appMPlayer.mainWindow,
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
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
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
91
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
92 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
2970
4ecb26be6657 fix blackbox xshape bug
pontscho
parents: 2854
diff changeset
93
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
94 mplMenuInit();
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
95
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
96 #ifdef DEBUG
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
97 dbprintf( 1,"[main] Depth on screen: %d\n",wsDepthOnScreen );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
98 dbprintf( 1,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
99 dbprintf( 1,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
100 #endif
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
101
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
102 appMPlayer.mainWindow.ReDraw=mplMainDraw;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
103 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
104 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
105
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
106 appMPlayer.subWindow.ReDraw=mplSubDraw;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
107 appMPlayer.subWindow.MouseHandler=mplSubMouseHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
108 appMPlayer.subWindow.KeyHandler=mplMainKeyHandle;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
109 appMPlayer.subWindow.ReSize=mplResize;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
110
2029
41ed89701ece fix fucking icewm fullscreen bug.
pontscho
parents: 2025
diff changeset
111 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
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
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
115 wsPostRedisplay( &appMPlayer.mainWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
116 wsPostRedisplay( &appMPlayer.subWindow );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
117
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
118 btnModify( evSetVolume,mplShMem->Volume );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
119 btnModify( evSetBalance,mplShMem->Balance );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
120 btnModify( evSetMoviePosition,mplShMem->Position );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
121
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1709
diff changeset
122 mplShMem->Playing=0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
123
3080
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
124 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
182163807172 bug fixs
pontscho
parents: 2970
diff changeset
125 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
1709
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
126 }
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
127
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
128 void mplDone(){
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
129
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
130 dbprintf( 1,"[mplayer] exit.\n" );
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
131
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
132 mplStop();
1697
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
133 // timerDone();
0b881b5e9e7b commented, timer code disabled (see ws.c)
arpi
parents: 1693
diff changeset
134 gtkDone(); // kills the gtkThreadProc() process
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
135 wsXDone();
1709
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
136
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
137 }
1709
a4e0211455d8 GUI integration, step 1
arpi
parents: 1697
diff changeset
138