[Mplayer-cvslog] CVS: main/Gui/wm ws.c,1.8,1.9 ws.h,1.2,1.3

Zoltan Ponekker pontscho at mplayer.dev.hu
Sat Sep 1 00:06:31 CEST 2001


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

Modified Files:
	ws.c ws.h 
Log Message:
add wsSetForegroundRGB

Index: ws.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ws.c	31 Aug 2001 21:16:58 -0000	1.8
+++ ws.c	31 Aug 2001 22:06:28 -0000	1.9
@@ -434,8 +434,7 @@
 //  win->wGCV.background=wsBlack;
 
  win->wGC=XCreateGC( wsDisplay,win->WindowID,
-//  GCForeground | GCBackground,
-  0,
+  GCForeground | GCBackground,
   &win->wGCV );
 
  win->Visible=0;
@@ -881,6 +880,23 @@
  XSetWindowBackground( wsDisplay,win->WindowID,color );
 }
 
+void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b )
+{
+ int color = 0;
+ switch ( wsOutMask )
+  {
+   case wsRGB32:
+   case wsRGB24: color=( r << 16 ) + ( g << 8 ) + b;  break;
+   case wsBGR32:
+   case wsBGR24: color=( b << 16 ) + ( g << 8 ) + r;  break;
+   case wsRGB16: PACK_RGB16( r,g,b,color ); break;
+   case wsBGR16: PACK_RGB16( b,g,r,color ); break;
+   case wsRGB15: PACK_RGB15( r,g,b,color ); break;
+   case wsBGR15: PACK_RGB15( b,g,r,color ); break;
+  }
+ XSetForeground( wsDisplay,win->wGC,color );
+// XSetWindowBackground( wsDisplay,win->WindowID,color );
+}
 
 // ----------------------------------------------------------------------------------------------
 //    Draw string at x,y with fc ( foreground color ) and bc ( background color ).

Index: ws.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/ws.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ws.h	27 Aug 2001 23:56:43 -0000	1.2
+++ ws.h	31 Aug 2001 22:06:28 -0000	1.3
@@ -202,6 +202,7 @@
 extern void wsIconify( wsTWindow win );
 extern void wsMoveTopWindow( wsTWindow * win );
 extern void wsSetBackground( wsTWindow * win,int color );
+extern void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b );
 extern void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b );
 #define wsClearWindow( win ); XClearWindow( wsDisplay,win.WindowID );
 extern void wsSetTitle( wsTWindow * win,char * name );




More information about the MPlayer-cvslog mailing list