summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-20 12:42:16 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-20 12:42:16 +0000
commit90b278bfaa7dcc0fa26d81cc033fc4cc1c3801a4 (patch)
treea6e2dd81d6efb35c87d3c4246be345434dffcd26 /Gui
parentb45f146c371817e0056af61a8dadbcfb54399271 (diff)
downloadmpv-90b278bfaa7dcc0fa26d81cc033fc4cc1c3801a4.tar.bz2
mpv-90b278bfaa7dcc0fa26d81cc033fc4cc1c3801a4.tar.xz
many 10l for me ...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9626 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/app.c11
-rw-r--r--Gui/app.h2
-rw-r--r--Gui/cfg.c11
-rw-r--r--Gui/cfg.h6
-rw-r--r--Gui/interface.c22
-rw-r--r--Gui/mplayer/common.c1
-rw-r--r--Gui/mplayer/gtk/mb.c2
-rw-r--r--Gui/mplayer/gtk/opts.c4
-rw-r--r--Gui/mplayer/mw.c1
-rw-r--r--Gui/mplayer/pb.c9
-rw-r--r--Gui/mplayer/sw.c1
-rw-r--r--Gui/skin/font.c2
12 files changed, 57 insertions, 15 deletions
diff --git a/Gui/app.c b/Gui/app.c
index c85e9fe0cc..803b4e2c16 100644
--- a/Gui/app.c
+++ b/Gui/app.c
@@ -119,17 +119,20 @@ void appInitStruct( listItems * item )
appClearItem( &item->Items[i] );
for ( i=0;i<item->NumberOfMenuItems;i++ )
appClearItem( &item->MenuItems[i] );
+ for ( i=0;i<item->NumberOfBarItems;i++ )
+ appClearItem( &item->barItems[i] );
item->NumberOfItems=-1;
- memset( item->Items,0,128 * sizeof( wItem ) );
+ memset( item->Items,0,256 * sizeof( wItem ) );
item->NumberOfMenuItems=-1;
- memset( item->MenuItems,0,32 * sizeof( wItem ) );
+ memset( item->MenuItems,0,64 * sizeof( wItem ) );
+ item->NumberOfBarItems=-1;
+ memset( item->barItems,0,256 * sizeof( wItem ) );
appClearItem( &item->main );
item->mainDecoration=0;
appClearItem( &item->sub );
- item->sub.Bitmap.Width=384; item->sub.Bitmap.Height=384;
- item->sub.width=384; item->sub.height=384;
+ item->sub.width=0; item->sub.height=0;
item->sub.x=-1; item->sub.y=-1;
appClearItem( &item->menuBase );
appClearItem( &item->menuSelected );
diff --git a/Gui/app.h b/Gui/app.h
index d0afd320e4..8631c3b35d 100644
--- a/Gui/app.h
+++ b/Gui/app.h
@@ -164,7 +164,7 @@ typedef struct
wItem MenuItems[64];
// ---
int NumberOfBarItems;
- wItem barItems[32];
+ wItem barItems[256];
} listItems;
extern listItems appMPlayer;
diff --git a/Gui/cfg.c b/Gui/cfg.c
index c32f058cf3..2160b0c01e 100644
--- a/Gui/cfg.c
+++ b/Gui/cfg.c
@@ -60,6 +60,11 @@ int gtkLoadFullscreen = 0;
int gtkShowVideoWindow = 1;
int gtkEnablePlayBar = 1;
+int gui_save_pos = 1;
+int gui_main_pos_x = -2;
+int gui_main_pos_y = -2;
+int gui_sub_pos_x = -1;
+int gui_sub_pos_y = -1;
// ---
extern char * get_path( char * filename );
@@ -144,6 +149,12 @@ static config_t gui_opts[] =
{ "gui_skin",&skinName,CONF_TYPE_STRING,0,0,0,NULL },
+ { "gui_save_pos", &gui_save_pos, CONF_TYPE_FLAG,0,0,1,NULL},
+ { "gui_main_pos_x", &gui_main_pos_x, CONF_TYPE_INT,0,0,0,NULL},
+ { "gui_main_pos_y", &gui_main_pos_y, CONF_TYPE_INT,0,0,0,NULL},
+ { "gui_video_out_pos_x", &gui_sub_pos_x, CONF_TYPE_INT,0,0,0,NULL},
+ { "gui_video_out_pos_y", &gui_sub_pos_y, CONF_TYPE_INT,0,0,0,NULL},
+
{ "equ_channel_1",&gtkEquChannel1,CONF_TYPE_STRING,0,0,0,NULL },
{ "equ_channel_2",&gtkEquChannel2,CONF_TYPE_STRING,0,0,0,NULL },
{ "equ_channel_3",&gtkEquChannel3,CONF_TYPE_STRING,0,0,0,NULL },
diff --git a/Gui/cfg.h b/Gui/cfg.h
index 136cec89b0..2ce1a89475 100644
--- a/Gui/cfg.h
+++ b/Gui/cfg.h
@@ -42,6 +42,12 @@ extern int gtkLoadFullscreen;
extern int gtkShowVideoWindow;
extern int gtkEnablePlayBar;
+extern int gui_save_pos;
+extern int gui_main_pos_x;
+extern int gui_main_pos_y;
+extern int gui_sub_pos_x;
+extern int gui_sub_pos_y;
+
extern int cfg_read( void );
extern int cfg_write( void );
diff --git a/Gui/interface.c b/Gui/interface.c
index 9a77c601e1..d8abd113c0 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -204,14 +204,21 @@ void guiInit( void )
exit( 0 );
}
+ if ( gui_save_pos )
+ {
+ appMPlayer.main.x = gui_main_pos_x;
+ appMPlayer.main.y = gui_main_pos_y;
+ appMPlayer.sub.x = gui_sub_pos_x;
+ appMPlayer.sub.y = gui_sub_pos_y;
+ }
+
if (WinID>0)
- {
+ {
appMPlayer.subWindow.Parent=WinID;
appMPlayer.sub.x=0;
appMPlayer.sub.y=0;
- }
- if (guiWinID>=0)
- appMPlayer.mainWindow.Parent=guiWinID;
+ }
+ if (guiWinID>=0) appMPlayer.mainWindow.Parent=guiWinID;
wsCreateWindow( &appMPlayer.subWindow,
appMPlayer.sub.x,appMPlayer.sub.y,appMPlayer.sub.width,appMPlayer.sub.height,
@@ -331,6 +338,13 @@ void guiDone( void )
{
mplMainRender=0;
mp_msg( MSGT_GPLAYER,MSGL_V,"[gui] done.\n" );
+
+ if ( gui_save_pos )
+ {
+ gui_main_pos_x=appMPlayer.mainWindow.X; gui_main_pos_y=appMPlayer.mainWindow.Y;
+ gui_sub_pos_x=appMPlayer.subWindow.X; gui_sub_pos_y=appMPlayer.subWindow.Y;
+ }
+
cfg_write();
wsXDone();
}
diff --git a/Gui/mplayer/common.c b/Gui/mplayer/common.c
index e9c909533f..69528c3b7b 100644
--- a/Gui/mplayer/common.c
+++ b/Gui/mplayer/common.c
@@ -15,6 +15,7 @@
#include "../../config.h"
#include "../../help_mp.h"
#include "../../libvo/x11_common.h"
+#include "../../libvo/fastmemcpy.h"
#include "../../libmpdemux/stream.h"
#include "../../mixer.h"
diff --git a/Gui/mplayer/gtk/mb.c b/Gui/mplayer/gtk/mb.c
index ebcb8b6098..f075c65d2b 100644
--- a/Gui/mplayer/gtk/mb.c
+++ b/Gui/mplayer/gtk/mb.c
@@ -11,7 +11,7 @@
#include "common.h"
GtkWidget * gtkMessageBoxText;
-GtkWidget * MessageBox;
+GtkWidget * MessageBox = NULL;
void ShowMessageBox( char * msg )
{
diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c
index 4d5610a2dd..3c5b317f0f 100644
--- a/Gui/mplayer/gtk/opts.c
+++ b/Gui/mplayer/gtk/opts.c
@@ -69,6 +69,7 @@ static GtkWidget * CBDumpSrt;
static GtkWidget * CBPostprocess;
static GtkWidget * CBCache;
static GtkWidget * CBLoadFullscreen;
+static GtkWidget * CBSaveWinPos;
static GtkWidget * CBStopXScreenSaver;
static GtkWidget * CBPlayBar;
@@ -352,6 +353,7 @@ void ShowPreferences( void )
// --- 6. page
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPostprocess ),gtkVopPP );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ),gtkLoadFullscreen );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ),gui_save_pos );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ),gtkShowVideoWindow );
if ( !gtkShowVideoWindow )
{
@@ -592,6 +594,7 @@ void prButton( GtkButton * button,gpointer user_data )
// --- 6. page
gtkVopPP=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPostprocess ) );
gtkLoadFullscreen=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBLoadFullscreen ) );
+ gui_save_pos=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ) );
gtkShowVideoWindow=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ) );
stop_xscreensaver=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ) );
gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) );
@@ -1195,6 +1198,7 @@ GtkWidget * create_Preferences( void )
CBShowVideoWindow=AddCheckButton( MSGTR_PREFERENCES_ShowVideoWindow,vbox602 );
CBLoadFullscreen=AddCheckButton( MSGTR_PREFERENCES_LoadFullscreen,vbox602 );
+ CBSaveWinPos=AddCheckButton( MSGTR_PREFERENCES_SaveWinPos,vbox602 );
CBStopXScreenSaver=AddCheckButton( MSGTR_PREFERENCES_XSCREENSAVER,vbox602 );
CBPlayBar=AddCheckButton( MSGTR_PREFERENCES_PlayBar,vbox602 );
diff --git a/Gui/mplayer/mw.c b/Gui/mplayer/mw.c
index a23a5c41ad..a3b4ddce93 100644
--- a/Gui/mplayer/mw.c
+++ b/Gui/mplayer/mw.c
@@ -15,6 +15,7 @@
#include "../../config.h"
#include "../../help_mp.h"
#include "../../libvo/x11_common.h"
+#include "../../libvo/fastmemcpy.h"
#include "../../libmpdemux/stream.h"
#include "../../mixer.h"
diff --git a/Gui/mplayer/pb.c b/Gui/mplayer/pb.c
index 7e7cadb882..644729e660 100644
--- a/Gui/mplayer/pb.c
+++ b/Gui/mplayer/pb.c
@@ -15,6 +15,7 @@
#include "../../config.h"
#include "../../help_mp.h"
#include "../../libvo/x11_common.h"
+#include "../../libvo/fastmemcpy.h"
#include "../../libmpdemux/stream.h"
#include "../../mixer.h"
@@ -214,13 +215,13 @@ void mplPBShow( int x, int y )
void mplPBInit( void )
{
- gfree( (void**)&mplPBDrawBuffer );
-
if ( !appMPlayer.barIsPresent ) return;
- if ( ( mplPBDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.bar.Bitmap.ImageSize ) ) == NULL )
+ gfree( (void**)&mplPBDrawBuffer );
+
+ if ( ( mplPBDrawBuffer = (unsigned char *)malloc( appMPlayer.bar.Bitmap.ImageSize ) ) == NULL )
{
- fprintf( stderr,MSGTR_NEMDB );
+ mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_NEMDB );
exit( 0 );
}
diff --git a/Gui/mplayer/sw.c b/Gui/mplayer/sw.c
index 1eca6d6bfa..55693ec345 100644
--- a/Gui/mplayer/sw.c
+++ b/Gui/mplayer/sw.c
@@ -5,6 +5,7 @@
#include "../../config.h"
#include "../../libvo/x11_common.h"
+#include "../../libvo/fastmemcpy.h"
#include "../app.h"
#include "../interface.h"
diff --git a/Gui/skin/font.c b/Gui/skin/font.c
index 20e588c579..14ff3fcece 100644
--- a/Gui/skin/font.c
+++ b/Gui/skin/font.c
@@ -174,7 +174,7 @@ txSample * fntRender( wItem * item,int px,char * fmt,... )
if ( item->Bitmap.Image == NULL )
{
item->Bitmap.Height=item->height=fntTextHeight( id,p );
- item->Bitmap.Width=iw;
+ item->Bitmap.Width=item->width=iw;
item->Bitmap.ImageSize=item->height * iw * 4;
if ( !item->Bitmap.ImageSize ) return NULL;
item->Bitmap.BPP=32;