comparison Gui/wm/ws.c @ 1814:9c674dc76ff3

add wsSetForegroundRGB
author pontscho
date Fri, 31 Aug 2001 22:06:28 +0000
parents d44b0ce32791
children a6c67352ccac
comparison
equal deleted inserted replaced
1813:c68e82514f56 1814:9c674dc76ff3
432 // win->wGCV.font=win->Font->fid; 432 // win->wGCV.font=win->Font->fid;
433 // win->wGCV.foreground=wsBlack; 433 // win->wGCV.foreground=wsBlack;
434 // win->wGCV.background=wsBlack; 434 // win->wGCV.background=wsBlack;
435 435
436 win->wGC=XCreateGC( wsDisplay,win->WindowID, 436 win->wGC=XCreateGC( wsDisplay,win->WindowID,
437 // GCForeground | GCBackground, 437 GCForeground | GCBackground,
438 0,
439 &win->wGCV ); 438 &win->wGCV );
440 439
441 win->Visible=0; 440 win->Visible=0;
442 win->Focused=0; 441 win->Focused=0;
443 win->Mapped=0; 442 win->Mapped=0;
879 case wsBGR15: PACK_RGB15( b,g,r,color ); break; 878 case wsBGR15: PACK_RGB15( b,g,r,color ); break;
880 } 879 }
881 XSetWindowBackground( wsDisplay,win->WindowID,color ); 880 XSetWindowBackground( wsDisplay,win->WindowID,color );
882 } 881 }
883 882
883 void wsSetForegroundRGB( wsTWindow * win,int r,int g,int b )
884 {
885 int color = 0;
886 switch ( wsOutMask )
887 {
888 case wsRGB32:
889 case wsRGB24: color=( r << 16 ) + ( g << 8 ) + b; break;
890 case wsBGR32:
891 case wsBGR24: color=( b << 16 ) + ( g << 8 ) + r; break;
892 case wsRGB16: PACK_RGB16( r,g,b,color ); break;
893 case wsBGR16: PACK_RGB16( b,g,r,color ); break;
894 case wsRGB15: PACK_RGB15( r,g,b,color ); break;
895 case wsBGR15: PACK_RGB15( b,g,r,color ); break;
896 }
897 XSetForeground( wsDisplay,win->wGC,color );
898 // XSetWindowBackground( wsDisplay,win->WindowID,color );
899 }
884 900
885 // ---------------------------------------------------------------------------------------------- 901 // ----------------------------------------------------------------------------------------------
886 // Draw string at x,y with fc ( foreground color ) and bc ( background color ). 902 // Draw string at x,y with fc ( foreground color ) and bc ( background color ).
887 // ---------------------------------------------------------------------------------------------- 903 // ----------------------------------------------------------------------------------------------
888 void wsDrawString( wsTWindow win,int x,int y,char * str,int fc,int bc ) 904 void wsDrawString( wsTWindow win,int x,int y,char * str,int fc,int bc )