Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libcurses New function getattrs().
details: https://anonhg.NetBSD.org/src/rev/85a54ef9d86e
branches: trunk
changeset: 486042:85a54ef9d86e
user: jdc <jdc%NetBSD.org@localhost>
date: Thu May 11 22:44:45 2000 +0000
description:
New function getattrs().
Add win to debug output.
diffstat:
lib/libcurses/attributes.c | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
diffs (114 lines):
diff -r d7b72ba0c94d -r 85a54ef9d86e lib/libcurses/attributes.c
--- a/lib/libcurses/attributes.c Thu May 11 21:30:07 2000 +0000
+++ b/lib/libcurses/attributes.c Thu May 11 22:44:45 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: attributes.c,v 1.7 2000/04/28 23:37:11 mycroft Exp $ */
+/* $NetBSD: attributes.c,v 1.8 2000/05/11 22:44:45 jdc Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.7 2000/04/28 23:37:11 mycroft Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.8 2000/05/11 22:44:45 jdc Exp $");
#endif /* not lint */
#include "curses.h"
@@ -46,7 +46,7 @@
#ifndef _CURSES_USE_MACROS
/*
- * attron
+ * attron --
* Test and set attributes on stdscr
*/
@@ -57,7 +57,7 @@
}
/*
- * attroff
+ * attroff --
* Test and unset attributes on stdscr.
*/
int
@@ -67,7 +67,7 @@
}
/*
- * attrset
+ * attrset --
* Set specific attribute modes.
* Unset others. On stdscr.
*/
@@ -80,7 +80,7 @@
#endif
/*
- * wattron
+ * wattron --
* Test and set attributes.
*
* Modes are blinking, bold (extra bright), dim (half-bright),
@@ -91,7 +91,7 @@
wattron(WINDOW *win, int attr)
{
#ifdef DEBUG
- __CTRACE ("wattron: %08x, %08x\n", attr, __nca);
+ __CTRACE ("wattron: win %0.2o, attr %08x\n", win, attr);
#endif
/* If can enter modes, set the relevent attribute bits. */
if (ME != NULL) {
@@ -128,7 +128,7 @@
}
/*
- * wattroff
+ * wattroff --
* Test and unset attributes.
*
* Note that the 'me' sequence unsets all attributes. We handle
@@ -138,7 +138,7 @@
wattroff(WINDOW *win, int attr)
{
#ifdef DEBUG
- __CTRACE ("wattroff: %08x\n", attr);
+ __CTRACE ("wattroff: win %0.2o, attr %08x\n", win, attr);
#endif
/* If can do exit modes, unset the relevent attribute bits. */
if (ME != NULL) {
@@ -167,7 +167,7 @@
}
/*
- * wattrset
+ * wattrset --
* Set specific attribute modes.
* Unset others.
*/
@@ -175,9 +175,22 @@
wattrset(WINDOW *win, int attr)
{
#ifdef DEBUG
- __CTRACE ("wattrset: %08x\n", attr, __nca);
+ __CTRACE ("wattrset: win %0.2o, attr %08x\n", win, attr);
#endif
wattron(win, attr);
wattroff(win, (~attr & ~__COLOR) | ((attr & __COLOR) ? 0 : __COLOR));
return (OK);
}
+
+/*
+ * getattrs --
+ * Get window attributes.
+ */
+chtype
+getattrs(WINDOW *win)
+{
+#ifdef DEBUG
+ __CTRACE ("getattrs: win %0.2o\n", win);
+#endif
+ return((chtype) win->wattr);
+}
Home |
Main Index |
Thread Index |
Old Index