]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20100102
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 3 Jan 2010 02:07:10 +0000 (02:07 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 3 Jan 2010 02:07:10 +0000 (02:07 +0000)
+ minor improvement to tic's checking of similar SGR's to allow for the
  most common case of SGR 0.
+ modify getmouse() to act as its documentation implied, returning on
  each call the preceding event until none are left.  When no more
  events remain, it will return ERR.

NEWS
dist.mk
man/curs_mouse.3x
ncurses/base/lib_mouse.c
progs/tic.c

diff --git a/NEWS b/NEWS
index a2038f45a46e182040696c1f15f4347692aba401..e6bab6c354118b76e3639f03cc1ff2bf0cbc8489 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1484 2009/12/27 16:25:58 tom Exp $
+-- $Id: NEWS,v 1.1486 2010/01/02 22:56:01 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,13 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20100102
+       + minor improvement to tic's checking of similar SGR's to allow for the
+         most common case of SGR 0.
+       + modify getmouse() to act as its documentation implied, returning on
+         each call the preceding event until none are left.  When no more
+         events remain, it will return ERR.
+
 20091227
        + change order of lookup in progs/tput.c, looking for terminfo data
          first.  This fixes a confusion between termcap "sg" and terminfo
diff --git a/dist.mk b/dist.mk
index cd5990ec1bfee1eac58b32e4c1e14e8ab487a2c8..ed8939b3f919159d952f49273bf997fb9ac1e452 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.738 2009/12/27 15:45:50 tom Exp $
+# $Id: dist.mk,v 1.739 2010/01/02 18:52:02 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20091227
+NCURSES_PATCH = 20100102
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 8dbabca5bd7bf9e6e91c3a27f37b6d0f88ad61dc..7140261f459d5e9c67bac57f1cef9bd7eb06e19c 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_mouse.3x,v 1.32 2009/08/29 18:11:58 tom Exp $
+.\" $Id: curs_mouse.3x,v 1.34 2010/01/02 21:45:42 tom Exp $
 .TH curs_mouse 3X ""
 .na
 .hy 0
@@ -56,7 +56,7 @@ MEVENT;\fR
 .br
 \fBbool has_mouse(void);\fR
 .br
--\fBint getmouse(MEVENT *event);\fR
+\fBint getmouse(MEVENT *event);\fR
 .br
 \fBint ungetmouse(MEVENT *event);\fR
 .br
@@ -149,6 +149,9 @@ x in the event structure coordinates will be screen-relative character-cell
 coordinates.
 The returned state mask will have exactly one bit set to
 indicate the event type.
+The corresponding data in the queue is marked invalid.
+A subsequent call to \fBgetmouse\fP will retrieve the next older
+item from the queue.
 .PP
 The \fBungetmouse\fR function behaves analogously to \fBungetch\fR.
 It pushes
@@ -217,6 +220,7 @@ upon successful completion.
 returns an error.
 If no mouse driver was initialized, or
 if the mask parameter is zero,
+It also returns an error if no more events remain in the queue.
 .TP 5
 \fBungetmouse\fP
 returns an error if the FIFO is full.
index 4034c9a77726247e3a0c02afec8c5bb692c960db..e60e6be8df79f4fea18b23e5578e705ddef3a60c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.110 2009/10/24 23:21:31 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.111 2010/01/02 21:06:52 tom Exp $")
 
 #include <tic.h>
 
@@ -1286,6 +1286,8 @@ _nc_mouse_resume(SCREEN *sp)
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
 {
+    int result = ERR;
+
     T((T_CALLED("getmouse(%p,%p)"), (void *) SP_PARM, (void *) aevent));
 
     if ((aevent != 0) && (SP_PARM != 0) && (SP_PARM->_mouse_type != M_NONE)) {
@@ -1293,17 +1295,20 @@ NCURSES_SP_NAME(getmouse) (NCURSES_SP_DCLx MEVENT * aevent)
        /* compute the current-event pointer */
        MEVENT *prev = PREV(eventp);
 
-       /* copy the event we find there */
-       *aevent = *prev;
+       if (prev->id != INVALID_EVENT) {
+           /* copy the event we find there */
+           *aevent = *prev;
 
-       TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
-                         _nc_tracemouse(SP_PARM, prev),
-                         (long) IndexEV(SP_PARM, prev)));
+           TR(TRACE_IEVENT, ("getmouse: returning event %s from slot %ld",
+                             _nc_tracemouse(SP_PARM, prev),
+                             (long) IndexEV(SP_PARM, prev)));
 
-       prev->id = INVALID_EVENT;       /* so the queue slot becomes free */
-       returnCode(OK);
+           prev->id = INVALID_EVENT;   /* so the queue slot becomes free */
+           SP_PARM->_mouse_eventp = PREV(prev);
+           result = OK;
+       }
     }
-    returnCode(ERR);
+    returnCode(result);
 }
 
 #if NCURSES_SP_FUNCS
index 3d894acd2d406b850c465268400a2b6c2933c31b..23282e08d3c49e471331054cc56c0a797c6a6142 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -44,7 +44,7 @@
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.139 2009/12/12 17:30:12 Nicholas.Marriott Exp $")
+MODULE_ID("$Id: tic.c,v 1.140 2010/01/02 22:54:01 tom Exp $")
 
 const char *_nc_progname = "tic";
 
@@ -1272,6 +1272,8 @@ similar_sgr(int num, char *a, char *b)
            } else if (delaying) {
                a = skip_delay(a);
                b = skip_delay(b);
+           } else if ((*b == '0' || (*b == ';')) && *a == 'm') {
+               b++;
            } else {
                a++;
            }