[Mplayer-cvslog] CVS: main/Gui/mplayer mplayer.c,1.27,1.28 mw.h,1.68,1.69 sw.h,1.34,1.35 widgets.c,1.30,1.31 widgets.h,1.14,1.15

Zoltan Ponekker pontscho at mplayerhq.hu
Sat Jul 6 01:47:30 CEST 2002


Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mail:/var/tmp.root/cvs-serv29922/Gui/mplayer

Modified Files:
	mplayer.c mw.h sw.h widgets.c widgets.h 
Log Message:


- add icon (nice, but very ugly hakk:)
- move all window to one group
- better multilanguage support
- some small bug fixed
- some warning fixed
- swap the two menu
- fix small network playing bug ( evPlay instead of evPlayNetwork :)
- add channel name selection for equalizer support



Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mplayer.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- mplayer.c	2 Jul 2002 13:35:03 -0000	1.27
+++ mplayer.c	5 Jul 2002 23:46:57 -0000	1.28
@@ -21,6 +21,11 @@
 #include "../../libmpdemux/stream.h"
 #include "../../mp_msg.h"
 
+#include <gdk/gdkprivate.h>
+#include <gdk/gdkkeysyms.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+
 #define mplRedrawTimerConst 5
 
 int mplRedrawTimer = mplRedrawTimerConst;
@@ -99,6 +104,9 @@
  btnModify( evSetVolume,guiIntfStruct.Volume );
  btnModify( evSetBalance,guiIntfStruct.Balance );
  btnModify( evSetMoviePosition,guiIntfStruct.Position );
+
+ wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
+ wsSetIcon( wsDisplay,appMPlayer.subWindow.WindowID,guiIcon,guiIconMask );
  
  if ( fullscreen )
   {

Index: mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- mw.h	3 Jul 2002 18:57:51 -0000	1.68
+++ mw.h	5 Jul 2002 23:46:57 -0000	1.69
@@ -489,11 +489,11 @@
 
  switch ( Button )
   {
-   case wsPRMouseButton:
+   case wsPMMouseButton:
           mplShowMenu( RX,RY );
           itemtype=itPRMButton;
           break;
-   case wsRRMouseButton:
+   case wsRMMouseButton:
           mplHideMenu( RX,RY,0 );
           break;
 
@@ -536,7 +536,7 @@
           itemtype=0;
           break;
 
-   case wsPMMouseButton:
+   case wsPRMouseButton:
         gtkShow( evShowPopUpMenu,NULL );
         break;
 

Index: sw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/sw.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- sw.h	2 Jul 2002 22:31:49 -0000	1.34
+++ sw.h	5 Jul 2002 23:46:57 -0000	1.35
@@ -30,15 +30,15 @@
 
  switch( Button )
   {
-   case wsPMMouseButton:
+   case wsPRMouseButton:
           gtkShow( evShowPopUpMenu,NULL );
           break;
-   case wsPRMouseButton:
+   case wsPMMouseButton:
           gtkShow( evHidePopUpMenu,NULL );
           mplShowMenu( RX,RY );
-          msButton=wsPRMouseButton;
+          msButton=wsPMMouseButton;
           break;
-   case wsRRMouseButton:
+   case wsRMMouseButton:
           mplHideMenu( RX,RY,1 );
           msButton=0;
           break;
@@ -56,7 +56,7 @@
                    mplSubMoved=1;
                    if ( !appMPlayer.subWindow.isFullScreen ) wsMoveWindow( &appMPlayer.subWindow,False,RX - sx,RY - sy );
                    break;
-            case wsPRMouseButton:
+            case wsPMMouseButton:
                    mplMenuMouseHandle( X,Y,RX,RY );
                    break;
            }

Index: widgets.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/widgets.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- widgets.c	3 Jul 2002 18:57:51 -0000	1.30
+++ widgets.c	5 Jul 2002 23:46:57 -0000	1.31
@@ -11,6 +11,7 @@
 
 #include <gdk/gdkprivate.h>
 #include <gdk/gdkkeysyms.h>
+#include <gdk/gdkx.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
@@ -19,6 +20,8 @@
 #include "./mplayer.h"
 #include "../events.h"
 #include "../app.h"
+#include "../wm/ws.h"
+
 
 #include "gtk/menu.h"
 #include "play.h"
@@ -48,8 +51,15 @@
 #include "gtk/url.h"
 #include "gtk/eq.h"
 
+#include "pixmaps/MPlayer_mini.xpm"
+
 // --- init & close gtk
 
+GdkPixmap * gtkIcon = NULL;
+GdkBitmap * gtkIconMask = NULL;
+Pixmap	    guiIcon;
+Pixmap	    guiIconMask;
+
 void gtkInit( void )
 {
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[widget] init gtk ...\n" );
@@ -57,6 +67,20 @@
 // gtk_init( &argc,&argv );
  gtk_init( 0,NULL );
 // gdk_set_use_xshm( TRUE );
+
+ {
+  GtkWidget * win;
+  win=gtk_window_new( GTK_WINDOW_TOPLEVEL );
+
+  if ( !gtkIcon ) 
+    gtkIcon=gdk_pixmap_colormap_create_from_xpm_d( win->window,gdk_colormap_get_system(),&gtkIconMask,&win->style->bg[GTK_STATE_NORMAL],MPlayer_mini_xpm );
+
+  guiIcon=GDK_WINDOW_XWINDOW( gtkIcon );
+  guiIconMask=GDK_WINDOW_XWINDOW( gtkIconMask );
+
+  gtk_widget_destroy( win );
+ }
+ 
  gtkInited=1;
 }
 
@@ -64,6 +88,12 @@
 {
 }
 
+void gtkAddIcon( GtkWidget * window )
+{
+ GdkWindowPrivate * win = (GdkWindowPrivate *)window->window;
+ wsSetIcon( gdk_display,win->xwindow,guiIcon,guiIconMask );
+}
+
 void gtkClearList( GtkWidget * list )
 { gtk_clist_clear( GTK_CLIST( list ) ); }
 
@@ -121,13 +151,13 @@
 
 void gtkSetLayer( GtkWidget * wdg )
 {
- GdkWindowPrivate * win = wdg->window;
+ GdkWindowPrivate * win = (GdkWindowPrivate *)wdg->window;
  wsSetLayer( gdk_display,win->xwindow,appMPlayer.subWindow.isFullScreen );
 }
 
 void gtkActive( GtkWidget * wdg )
 {
- GdkWindowPrivate * win = wdg->window;
+ GdkWindowPrivate * win = (GdkWindowPrivate *)wdg->window;
  wsMoveTopWindow( gdk_display,win->xwindow );
 }
 
@@ -145,7 +175,7 @@
         if ( gtkFillSkinList( sbMPlayerPrefixDir ) && gtkFillSkinList( sbMPlayerDirInHome ) )
          {
           gtkSetDefaultToCList( SkinList,param );
-	  gtk_clist_sort( SkinList );
+	  gtk_clist_sort( GTK_CLIST( SkinList ) );
           gtk_widget_show( SkinBrowser );
 	  gtkSetLayer( SkinBrowser );
          } 

Index: widgets.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/widgets.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- widgets.h	28 May 2002 11:55:16 -0000	1.14
+++ widgets.h	5 Jul 2002 23:46:57 -0000	1.15
@@ -12,6 +12,7 @@
 #include "play.h"
 #include "mplayer.h"
 #include "../interface.h"
+#include "../wm/ws.h"
 
 #define GTK_MB_SIMPLE 0
 #define GTK_MB_MODAL 1
@@ -35,10 +36,16 @@
 extern char          * sbMPlayerDirInHome;
 extern char          * sbMPlayerPrefixDir;
 
+extern GdkPixmap * gtkIcon;
+extern GdkBitmap * gtkIconMask;
+extern Pixmap      guiIcon;
+extern Pixmap	   guiIconMask;
+
 extern void widgetsCreate( void );
 
 extern void gtkInit( void );
 extern void gtkDone( void );
+extern void gtkAddIcon( GtkWidget * window );
 
 extern int  gtkFillSkinList( gchar * dir );
 extern void gtkClearList( GtkWidget * list );




More information about the MPlayer-cvslog mailing list