[MPlayer-cvslog] r33617 - in trunk/gui: interface.c mplayer/play.c mplayer/widgets.c mplayer/widgets.h wm/ws.c wm/ws.h

ib subversion at mplayerhq.hu
Tue Jun 14 20:55:04 CEST 2011


Author: ib
Date: Tue Jun 14 20:55:04 2011
New Revision: 33617

Log:
Store icon data in a struct variable.

This is a preparation for different sized icons to come.

Modified:
   trunk/gui/interface.c
   trunk/gui/mplayer/play.c
   trunk/gui/mplayer/widgets.c
   trunk/gui/mplayer/widgets.h
   trunk/gui/wm/ws.c
   trunk/gui/wm/ws.h

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue Jun 14 20:01:22 2011	(r33616)
+++ trunk/gui/interface.c	Tue Jun 14 20:55:04 2011	(r33617)
@@ -295,8 +295,8 @@ void guiInit(void)
     btnModify(evSetBalance, guiIntfStruct.Balance);
     btnModify(evSetMoviePosition, guiIntfStruct.Position);
 
-    wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, guiIcon, guiIconMask);
-    wsSetIcon(wsDisplay, appMPlayer.subWindow.WindowID, guiIcon, guiIconMask);
+    wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, &guiIcon);
+    wsSetIcon(wsDisplay, appMPlayer.subWindow.WindowID, &guiIcon);
 
     guiIntfStruct.Playing = 0;
 

Modified: trunk/gui/mplayer/play.c
==============================================================================
--- trunk/gui/mplayer/play.c	Tue Jun 14 20:01:22 2011	(r33616)
+++ trunk/gui/mplayer/play.c	Tue Jun 14 20:55:04 2011	(r33617)
@@ -270,7 +270,7 @@ void ChangeSkin(char *name)
     wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer");
     wsCreateImage(&appMPlayer.mainWindow, appMPlayer.main.Bitmap.Width, appMPlayer.main.Bitmap.Height);
     wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image);
-    wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, guiIcon, guiIconMask);
+    wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, &guiIcon);
 
     appMPlayer.mainWindow.ReDraw       = (void *)mplMainDraw;
     appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle;

Modified: trunk/gui/mplayer/widgets.c
==============================================================================
--- trunk/gui/mplayer/widgets.c	Tue Jun 14 20:01:22 2011	(r33616)
+++ trunk/gui/mplayer/widgets.c	Tue Jun 14 20:55:04 2011	(r33617)
@@ -69,8 +69,7 @@ int gtkInitialized = 0;
 
 // --- init & close gtk
 
-Pixmap	    guiIcon;
-Pixmap	    guiIconMask;
+guiIcon_t guiIcon;
 
 void gtkInit( void )
 {
@@ -100,14 +99,14 @@ void gtkInit( void )
  // start up GTK which realizes the pixmaps
  gtk_main_iteration_do(FALSE);
 
- guiIcon=GDK_PIXMAP_XID( gdkIcon );
- guiIconMask=GDK_PIXMAP_XID( gdkIconMask );
+ guiIcon.normal=GDK_PIXMAP_XID( gdkIcon );
+ guiIcon.normal_mask=GDK_PIXMAP_XID( gdkIconMask );
 
  gtkInitialized=1;
 }
 
 void gtkAddIcon( GtkWidget * window )
-{ wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),guiIcon,guiIconMask ); }
+{ wsSetIcon( gdk_display,GDK_WINDOW_XWINDOW( window->window ),&guiIcon ); }
 
 void gtkClearList( GtkWidget * list )
 { gtk_clist_clear( GTK_CLIST( list ) ); }

Modified: trunk/gui/mplayer/widgets.h
==============================================================================
--- trunk/gui/mplayer/widgets.h	Tue Jun 14 20:01:22 2011	(r33616)
+++ trunk/gui/mplayer/widgets.h	Tue Jun 14 20:55:04 2011	(r33617)
@@ -23,13 +23,13 @@
 #include <stdlib.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
+#include <X11/Xlib.h>
 
 #include "config.h"
 #include "osdep/shmem.h"
 #include "play.h"
 #include "mplayer.h"
 #include "gui/interface.h"
-#include "gui/wm/ws.h"
 
 #define GTK_MB_SIMPLE 0
 #define GTK_MB_MODAL 1
@@ -53,8 +53,12 @@ extern int             gtkPopupMenuParam
 extern char          * sbMPlayerDirInHome;
 extern char          * sbMPlayerPrefixDir;
 
-extern Pixmap      guiIcon;
-extern Pixmap	   guiIconMask;
+typedef struct {
+  Pixmap normal;
+  Pixmap normal_mask;
+} guiIcon_t;
+
+extern guiIcon_t guiIcon;
 
 void widgetsCreate( void );
 

Modified: trunk/gui/wm/ws.c
==============================================================================
--- trunk/gui/wm/ws.c	Tue Jun 14 20:01:22 2011	(r33616)
+++ trunk/gui/wm/ws.c	Tue Jun 14 20:55:04 2011	(r33617)
@@ -1250,7 +1250,7 @@ void wsSetShape( wsTWindow * win,char * 
 #endif
 }
 
-void wsSetIcon( Display * dsp,Window win,Pixmap icon,Pixmap mask )
+void wsSetIcon( Display * dsp,Window win,guiIcon_t * icon )
 {
  XWMHints * wm;
  CARD32     data[2];
@@ -1259,14 +1259,14 @@ void wsSetIcon( Display * dsp,Window win
  wm=XGetWMHints( dsp,win );
  if ( !wm ) wm=XAllocWMHints();
 
- wm->icon_pixmap=icon;
- wm->icon_mask=mask;
+ wm->icon_pixmap=icon->normal;
+ wm->icon_mask=icon->normal_mask;
  wm->flags|=IconPixmapHint | IconMaskHint;
 
  XSetWMHints( dsp,win,wm );
 
- data[0]=icon;
- data[1]=mask;
+ data[0]=icon->normal;
+ data[1]=icon->normal_mask;
  iconatom=XInternAtom( dsp,"KWM_WIN_ICON",0 );
  XChangeProperty( dsp,win,iconatom,iconatom,32,PropModeReplace,(unsigned char *)data,2 );
 

Modified: trunk/gui/wm/ws.h
==============================================================================
--- trunk/gui/wm/ws.h	Tue Jun 14 20:01:22 2011	(r33616)
+++ trunk/gui/wm/ws.h	Tue Jun 14 20:55:04 2011	(r33617)
@@ -22,6 +22,8 @@
 #ifndef MPLAYER_GUI_WS_H
 #define MPLAYER_GUI_WS_H
 
+#include "gui/mplayer/widgets.h"
+
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/keysym.h>
@@ -243,7 +245,7 @@ void wsSetLayer( Display * wsDisplay, Wi
 void wsFullScreen( wsTWindow * win );
 void wsPostRedisplay( wsTWindow * win );
 void wsSetShape( wsTWindow * win, char * data );
-void wsSetIcon( Display * dsp, Window win, Pixmap icon, Pixmap mask );
+void wsSetIcon( Display * dsp, Window win, guiIcon_t * icon );
 
 // ----------------------------------------------------------------------------------------------
 //    Draw string at x,y with fc ( foreground color ) and bc ( background color ).


More information about the MPlayer-cvslog mailing list