From: Thomas E. Dickey Date: Sun, 3 Jan 2010 02:07:10 +0000 (+0000) Subject: ncurses 5.7 - patch 20100102 X-Git-Tag: v5.8~54 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=40cf934fff2d2790c060619e3a29bd54c20994b0;hp=2debf76e0c23a2b3d1333f0853317a7b2ae1777f ncurses 5.7 - patch 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. --- diff --git a/NEWS b/NEWS index a2038f45..e6bab6c3 100644 --- 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 cd5990ec..ed8939b3 100644 --- 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) diff --git a/man/curs_mouse.3x b/man/curs_mouse.3x index 8dbabca5..7140261f 100644 --- a/man/curs_mouse.3x +++ b/man/curs_mouse.3x @@ -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. diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 4034c9a7..e60e6be8 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -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 @@ -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 diff --git a/progs/tic.c b/progs/tic.c index 3d894acd..23282e08 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -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 #include -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++; }