@ -129,7 +129,6 @@ static int xmakeglyphfontspecs(XftGlyphFontSpec *, const Glyph *, int, int, int)
static void xdrawglyphfontspecs ( const XftGlyphFontSpec * , Glyph , int , int , int ) ;
static void xdrawglyphfontspecs ( const XftGlyphFontSpec * , Glyph , int , int , int ) ;
static void xdrawglyph ( Glyph , int , int ) ;
static void xdrawglyph ( Glyph , int , int ) ;
static void xclear ( int , int , int , int ) ;
static void xclear ( int , int , int , int ) ;
static void xdrawcursor ( void ) ;
static int xgeommasktogravity ( int ) ;
static int xgeommasktogravity ( int ) ;
static void xinit ( void ) ;
static void xinit ( void ) ;
static void cresize ( int , int ) ;
static void cresize ( int , int ) ;
@ -1512,45 +1511,29 @@ xsettitle(char *p)
XFree ( prop . value ) ;
XFree ( prop . value ) ;
}
}
void
int
draw( void )
xstart draw( void )
{
{
drawregion ( 0 , 0 , term . col , term . row ) ;
return IS_SET ( MODE_VISIBLE ) ;
XCopyArea ( xw . dpy , xw . buf , xw . win , dc . gc , 0 , 0 , win . w ,
win . h , 0 , 0 ) ;
XSetForeground ( xw . dpy , dc . gc ,
dc . col [ IS_SET ( MODE_REVERSE ) ?
defaultfg : defaultbg ] . pixel ) ;
}
}
void
void
drawregion( int x1 , int y1 , int x 2, int y 2)
xdrawline ( Line line , int x1 , int y1 , int x2 )
{
{
int i , x , y, ox, numspecs ;
int i , x , ox, numspecs ;
Glyph base , new ;
Glyph base , new ;
XftGlyphFontSpec * specs ;
XftGlyphFontSpec * specs = xw . specbuf ;
if ( ! ( IS_SET ( MODE_VISIBLE ) ) )
return ;
for ( y = y1 ; y < y2 ; y + + ) {
if ( ! term . dirty [ y ] )
continue ;
term . dirty [ y ] = 0 ;
specs = xw . specbuf ;
numspecs = xmakeglyphfontspecs ( specs , & term . line [ y ] [ x1 ] , x2 - x1 , x1 , y ) ;
numspecs = xmakeglyphfontspecs ( specs , & line [ x1 ] , x2 - x1 , x1 , y1 ) ;
i = ox = 0 ;
i = ox = 0 ;
for ( x = x1 ; x < x2 & & i < numspecs ; x + + ) {
for ( x = x1 ; x < x2 & & i < numspecs ; x + + ) {
new = term . line [ y ] [ x ] ;
new = line [ x ] ;
if ( new . mode = = ATTR_WDUMMY )
if ( new . mode = = ATTR_WDUMMY )
continue ;
continue ;
if ( selected ( x , y ) )
if ( selected ( x , y1 ) )
new . mode ^ = ATTR_REVERSE ;
new . mode ^ = ATTR_REVERSE ;
if ( i > 0 & & ATTRCMP ( base , new ) ) {
if ( i > 0 & & ATTRCMP ( base , new ) ) {
xdrawglyphfontspecs ( specs , base , i , ox , y ) ;
xdrawglyphfontspecs ( specs , base , i , ox , y1 ) ;
specs + = i ;
specs + = i ;
numspecs - = i ;
numspecs - = i ;
i = 0 ;
i = 0 ;
@ -1562,9 +1545,17 @@ drawregion(int x1, int y1, int x2, int y2)
i + + ;
i + + ;
}
}
if ( i > 0 )
if ( i > 0 )
xdrawglyphfontspecs ( specs , base , i , ox , y ) ;
xdrawglyphfontspecs ( specs , base , i , ox , y1 ) ;
}
}
xdrawcursor ( ) ;
void
xfinishdraw ( void )
{
XCopyArea ( xw . dpy , xw . buf , xw . win , dc . gc , 0 , 0 , win . w ,
win . h , 0 , 0 ) ;
XSetForeground ( xw . dpy , dc . gc ,
dc . col [ IS_SET ( MODE_REVERSE ) ?
defaultfg : defaultbg ] . pixel ) ;
}
}
void
void