ncurses 5.6 - patch 20070728
[ncurses.git] / ncurses / base / lib_slkclear.c
index ac6e414beaa26bc5228e565ba91a71188fdde10a..99edcd538ec53baf6806040df3d2cbaf99c7574b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998-2001,2006 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            *
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkclear.c,v 1.4 1999/03/03 23:44:22 juergen Exp $")
+MODULE_ID("$Id: lib_slkclear.c,v 1.9 2006/05/27 19:21:19 tom Exp $")
 
-int
+NCURSES_EXPORT(int)
 slk_clear(void)
 {
-       T((T_CALLED("slk_clear()")));
+    T((T_CALLED("slk_clear()")));
 
-       if (SP == NULL || SP->_slk == NULL)
-               returnCode(ERR);
-       SP->_slk->hidden = TRUE;
-       /* For simulated SLK's it's looks much more natural to
-          inherit those attributes from the standard screen */
-       SP->_slk->win->_bkgd  = stdscr->_bkgd;
-       SP->_slk->win->_attrs = stdscr->_attrs;
-        if (SP->_slk->win == stdscr) {
-          returnCode(OK);
-        }
-       else {
-         werase(SP->_slk->win);
-         returnCode(wrefresh(SP->_slk->win));
-       }
+    if (SP == NULL || SP->_slk == NULL)
+       returnCode(ERR);
+    SP->_slk->hidden = TRUE;
+    /* For simulated SLK's it's looks much more natural to
+       inherit those attributes from the standard screen */
+    SP->_slk->win->_nc_bkgd = stdscr->_nc_bkgd;
+    WINDOW_ATTRS(SP->_slk->win) = WINDOW_ATTRS(stdscr);
+    if (SP->_slk->win == stdscr) {
+       returnCode(OK);
+    } else {
+       werase(SP->_slk->win);
+       returnCode(wrefresh(SP->_slk->win));
+    }
 }