~ubuntu-branches/ubuntu/natty/ncurses/natty

« back to all changes in this revision

Viewing changes to ncurses/base/lib_chgat.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-17 09:00:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517090042-86fgxrr6j5jzagot
Tags: 5.6-0ubuntu1
* New upstream version.
  - Remove patches applied upstream: ncurses.upstream, signed-chars.
  - Update patches: debian-backspace.
* Build-depend on g++-multilib instead of lib{32,64}c*-dev-*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2001,2005 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
3
3
 *                                                                          *
4
4
 * Permission is hereby granted, free of charge, to any person obtaining a  *
5
5
 * copy of this software and associated documentation files (the            *
42
42
 
43
43
#include <curses.priv.h>
44
44
 
45
 
MODULE_ID("$Id: lib_chgat.c,v 1.6 2005/01/29 21:46:12 tom Exp $")
 
45
MODULE_ID("$Id: lib_chgat.c,v 1.7 2006/07/15 22:07:11 tom Exp $")
46
46
 
47
47
NCURSES_EXPORT(int)
48
48
wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
52
52
    T((T_CALLED("wchgat(%p,%d,%s,%d)"), win, n, _traceattr(attr), color));
53
53
 
54
54
    if (win) {
 
55
        struct ldat *line = &(win->_line[win->_cury]);
 
56
 
55
57
        toggle_attr_on(attr, COLOR_PAIR(color));
56
58
 
57
59
        for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) {
58
 
            SetAttr(win->_line[win->_cury].text[i], attr);
59
 
            SetPair(win->_line[win->_cury].text[i], color);
 
60
            SetAttr(line->text[i], attr);
 
61
            SetPair(line->text[i], color);
 
62
            CHANGED_CELL(line, i);
60
63
        }
61
64
 
62
65
        returnCode(OK);