mirror of https://github.com/mpv-player/mpv
add wsSetForegroundRGB
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1815 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
f67d569a5a
commit
454fe03492
20
Gui/wm/ws.c
20
Gui/wm/ws.c
|
@ -434,8 +434,7 @@ void wsCreateWindow( wsTWindow * win,int X,int Y,int wX,int hY,int bW,int cV,uns
|
||||||
// win->wGCV.background=wsBlack;
|
// win->wGCV.background=wsBlack;
|
||||||
|
|
||||||
win->wGC=XCreateGC( wsDisplay,win->WindowID,
|
win->wGC=XCreateGC( wsDisplay,win->WindowID,
|
||||||
// GCForeground | GCBackground,
|
GCForeground | GCBackground,
|
||||||
0,
|
|
||||||
&win->wGCV );
|
&win->wGCV );
|
||||||
|
|
||||||
win->Visible=0;
|
win->Visible=0;
|
||||||
|
@ -881,6 +880,23 @@ void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b )
|
||||||
XSetWindowBackground( wsDisplay,win->WindowID,color );
|
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 ).
|
// Draw string at x,y with fc ( foreground color ) and bc ( background color ).
|
||||||
|
|
|
@ -202,6 +202,7 @@ extern void wsResizeWindow( wsTWindow * win,int sx, int sy );
|
||||||
extern void wsIconify( wsTWindow win );
|
extern void wsIconify( wsTWindow win );
|
||||||
extern void wsMoveTopWindow( wsTWindow * win );
|
extern void wsMoveTopWindow( wsTWindow * win );
|
||||||
extern void wsSetBackground( wsTWindow * win,int color );
|
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 );
|
extern void wsSetBackgroundRGB( wsTWindow * win,int r,int g,int b );
|
||||||
#define wsClearWindow( win ); XClearWindow( wsDisplay,win.WindowID );
|
#define wsClearWindow( win ); XClearWindow( wsDisplay,win.WindowID );
|
||||||
extern void wsSetTitle( wsTWindow * win,char * name );
|
extern void wsSetTitle( wsTWindow * win,char * name );
|
||||||
|
|
Loading…
Reference in New Issue