Mercurial > mplayer.hg
annotate Gui/mplayer/mplayer.c @ 6668:4e3493443b36
100l - seq++ for grouping
author | arpi |
---|---|
date | Sun, 07 Jul 2002 20:06:55 +0000 |
parents | 8f49c75a2824 |
children | 77980ab4e296 |
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 |
6651 | 24 #include <gdk/gdkprivate.h> |
25 #include <gdk/gdkkeysyms.h> | |
26 #include <gdk/gdk.h> | |
27 #include <gtk/gtk.h> | |
28 | |
1697 | 29 #define mplRedrawTimerConst 5 |
1693 | 30 |
31 int mplRedrawTimer = mplRedrawTimerConst; | |
32 int mplTimer = 0; | |
33 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
34 void mplEventHandling( int msg,float param ); |
1693 | 35 |
36 #include "widgets.h" | |
37 #include "play.h" | |
38 #include "menu.h" | |
39 #include "mw.h" | |
40 #include "sw.h" | |
1801 | 41 #include "widgets.h" |
1693 | 42 |
6218 | 43 void mplInit( void * disp ) |
1693 | 44 { |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1860
diff
changeset
|
45 int i; |
2854 | 46 |
47 // init fields of this struct to default values | |
6219 | 48 guiIntfStruct.Balance=50.0f; |
49 guiIntfStruct.StreamType=-1; | |
2854 | 50 |
1742 | 51 // fork() a process which runs gtkThreadProc() [gtkPID] |
6218 | 52 gtkInit(); |
1693 | 53 |
1697 | 54 // opens X display, checks for extensions (XShape, DGA etc) |
6218 | 55 wsXInit( disp ); |
1693 | 56 |
57 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) | |
58 { | |
1884 | 59 fprintf( stderr,MSGTR_NEMDB ); |
1693 | 60 exit( 0 ); |
61 } | |
62 | |
63 wsCreateWindow( &appMPlayer.subWindow, | |
64 appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height, | |
3080 | 65 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsHideWindow,"ViDEO" ); |
1693 | 66 |
3080 | 67 wsDestroyImage( &appMPlayer.subWindow ); |
68 wsCreateImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height ); | |
69 | |
70 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
|
71 |
6280 | 72 // i=wsHideFrame|wsMaxSize|wsHideWindow; |
73 // if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow; | |
74 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 ); |
6651 | 107 |
108 wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask ); | |
109 wsSetIcon( wsDisplay,appMPlayer.subWindow.WindowID,guiIcon,guiIconMask ); | |
5046 | 110 |
111 if ( fullscreen ) | |
112 { | |
113 btnModify( evFullScreen,btnPressed ); | |
114 mplFullScreen(); | |
115 } | |
1693 | 116 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4797
diff
changeset
|
117 guiIntfStruct.Playing=0; |
1693 | 118 |
6280 | 119 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 ); |
120 | |
3080 | 121 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); |
122 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); | |
1709 | 123 } |
124 |