~ubuntu-branches/debian/sid/ncurses/sid-200908151543

« back to all changes in this revision

Viewing changes to ncurses/base/lib_chgat.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-12-14 21:06:00 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20081214210600-2rdjwvpplgvh3zeb
Tags: 5.7+20081213-1
MergingĀ upstreamĀ versionĀ 5.7+20081213.

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);