Mercurial > mplayer.hg
annotate Gui/mplayer/mplayer.c @ 5999:792d58595767
fix -fs and 'f'
author | pontscho |
---|---|
date | Mon, 06 May 2002 16:56:41 +0000 |
parents | b8d8d72776f2 |
children | 8cfddba867b4 |
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" | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
10 #include "../interface.h" |
1693 | 11 #include "../skin/skin.h" |
12 #include "../skin/font.h" | |
13 #include "../wm/ws.h" | |
14 #include "../wm/wskeys.h" | |
15 #include "../wm/widget.h" | |
16 #include "../bitmap/bitmap.h" | |
17 | |
18 #include "../../config.h" | |
1884 | 19 #include "../../help_mp.h" |
1776 | 20 #include "../../libvo/x11_common.h" |
2970 | 21 #include "../../libmpdemux/stream.h" |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
22 #include "../../mp_msg.h" |
1693 | 23 |
1697 | 24 #define mplRedrawTimerConst 5 |
1693 | 25 |
26 int mplRedrawTimer = mplRedrawTimerConst; | |
27 int mplTimer = 0; | |
28 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
29 void mplEventHandling( int msg,float param ); |
1693 | 30 |
31 #include "widgets.h" | |
32 #include "play.h" | |
33 #include "menu.h" | |
34 #include "mw.h" | |
35 #include "sw.h" | |
1801 | 36 #include "widgets.h" |
1693 | 37 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
38 void mplTimerHandler( void ) |
1693 | 39 { |
40 mplTimer++; | |
41 mplRedrawTimer--; | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
42 if ( mplRedrawTimer == 0 ) mplEventHandling( evRedraw,0 ); |
1693 | 43 } |
44 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1709
diff
changeset
|
45 void mplInit( int argc,char* argv[], char *envp[], void* disp ) |
1693 | 46 { |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1860
diff
changeset
|
47 int i; |
2854 | 48 |
49 // init fields of this struct to default values | |
50 mplMPlayerInit( argc,argv,envp ); | |
51 | |
1742 | 52 // fork() a process which runs gtkThreadProc() [gtkPID] |
1693 | 53 gtkInit( argc,argv,envp ); |
54 | |
1697 | 55 // 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
|
56 wsXInit(disp); |
1693 | 57 |
58 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) | |
59 { | |
1884 | 60 fprintf( stderr,MSGTR_NEMDB ); |
1693 | 61 exit( 0 ); |
62 } | |
63 | |
64 wsCreateWindow( &appMPlayer.subWindow, | |
65 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, | |
3080 | 66 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" ); |
1693 | 67 |
3080 | 68 wsDestroyImage( &appMPlayer.subWindow ); |
69 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); | |
70 | |
71 vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
72 |
2970 | 73 i=wsHideFrame|wsMaxSize|wsHideWindow; |
74 if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow; | |
1693 | 75 wsCreateWindow( &appMPlayer.mainWindow, |
76 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
|
77 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize| |
1693 | 78 |
79 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
80 |
1693 | 81 mplMenuInit(); |
82 | |
83 #ifdef DEBUG | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
84 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] Depth on screen: %d\n",wsDepthOnScreen ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
85 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] parent: 0x%x\n",(int)appMPlayer.mainWindow.WindowID ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
86 mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[main] sub: 0x%x\n",(int)appMPlayer.subWindow.WindowID ); |
1693 | 87 #endif |
88 | |
89 appMPlayer.mainWindow.ReDraw=mplMainDraw; | |
90 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle; | |
91 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle; | |
92 | |
93 appMPlayer.subWindow.ReDraw=mplSubDraw; | |
94 appMPlayer.subWindow.MouseHandler=mplSubMouseHandle; | |
95 appMPlayer.subWindow.KeyHandler=mplMainKeyHandle; | |
96 | |
2029 | 97 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); |
3080 | 98 wsClearWindow( appMPlayer.subWindow ); |
2025
0653e90b3118
some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents:
1884
diff
changeset
|
99 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
|
100 |
1693 | 101 wsPostRedisplay( &appMPlayer.mainWindow ); |
102 wsPostRedisplay( &appMPlayer.subWindow ); | |
103 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
104 btnModify( evSetVolume,guiIntfStruct.Volume ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
105 btnModify( evSetBalance,guiIntfStruct.Balance ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
106 btnModify( evSetMoviePosition,guiIntfStruct.Position ); |
5046 | 107 |
108 if ( fullscreen ) | |
109 { | |
110 btnModify( evFullScreen,btnPressed ); | |
111 mplFullScreen(); | |
112 } | |
1693 | 113 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
114 guiIntfStruct.Playing=0; |
1693 | 115 |
3080 | 116 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); |
117 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); | |
1709 | 118 } |
119 |