tadd frdrawseltick - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 813751d7549110861174912c9c12ea01dae0d084
 (DIR) parent 35920e96a1bd6dcc5c803582ce9568c2f0a4fdc1
 (HTM) Author: rsc <devnull@localhost>
       Date:   Thu, 10 May 2007 19:08:09 +0000
       
       add frdrawseltick
       
       Diffstat:
         M man/man3/frame.3                    |      20 +++++++++++++++++++-
         M src/libframe/frdraw.c               |      10 ++++++++--
       
       2 files changed, 27 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/man/man3/frame.3 b/man/man3/frame.3
       t@@ -1,6 +1,6 @@
        .TH FRAME 3
        .SH NAME
       -frinit, frsetrects, frinittick, frclear, frcharofpt, frptofchar, frinsert, frdelete, frselect, frtick, frselectpaint, frdrawsel, frdrawsel0, frgetmouse \- frames of text
       +frinit, frsetrects, frinittick, frclear, frcharofpt, frptofchar, frinsert, frdelete, frselect, frtick, frselectpaint, frdrawsel, frdrawsel0, frdrawseltick, frgetmouse \- frames of text
        .SH SYNOPSIS
        .nf
        .B
       t@@ -55,6 +55,11 @@ void  frdrawsel(Frame *f, Point pt0, ulong p0, ulong p1,
                        int highlighted)
        .PP
        .B
       +void  frdrawseltick(Frame *f, Point pt0, ulong p0, ulong p1,
       +.B
       +                int highlighted, int ticked)
       +.PP
       +.B
        void  frdrawsel0(Frame *f, Point pt0, ulong p0, ulong p1,
        .B
                        Image *back, Image *text)
       t@@ -339,6 +344,19 @@ on the screen; like all of the selection-helper routines'
        .B Point
        arguments, it must be a value generated by
        .IR frptofchar .
       +.I Frdrawseltick
       +is identical to 
       +.I frdrawsel
       +except that the 
       +.I ticked
       +flag controls whether to draw the tick
       +when
       +.I highlighted
       +is non-zero and
       +.I p0
       +and
       +.I p1
       +are equal.
        .I Frdrawsel0
        is a lower-level routine, taking as arguments a background color,
        .IR back ,
 (DIR) diff --git a/src/libframe/frdraw.c b/src/libframe/frdraw.c
       t@@ -32,7 +32,7 @@ nbytes(char *s0, int nr)
        }
        
        void
       -frdrawsel(Frame *f, Point pt, ulong p0, ulong p1, int issel)
       +frdrawseltick(Frame *f, Point pt, ulong p0, ulong p1, int issel, int ticked)
        {
                Image *back, *text;
        
       t@@ -40,7 +40,7 @@ frdrawsel(Frame *f, Point pt, ulong p0, ulong p1, int issel)
                        frtick(f, frptofchar(f, f->p0), 0);
        
                if(p0 == p1){
       -                frtick(f, pt, issel);
       +                frtick(f, pt, issel && ticked);
                        return;
                }
        
       t@@ -56,6 +56,12 @@ frdrawsel(Frame *f, Point pt, ulong p0, ulong p1, int issel)
        }
        
        void
       +frdrawsel(Frame *f, Point pt, ulong p0, ulong p1, int issel)
       +{
       +        frdrawseltick(f, pt, p0, p1, issel, issel);
       +}
       +
       +void
        frdrawsel0(Frame *f, Point pt, ulong p0, ulong p1, Image *back, Image *text)
        {
                Frbox *b;