Closed waltje closed 9 months ago
Interesting. Well, it wouldn't be wprintw()
-- that already exists, but it means window-printw() -- but I get what you mean. It seems this is a gap in the X/Open Curses standard.
You could use swprintf()
to format the string to a buffer, and then addwstr()
to render that to curses.
I cloned the printw.c module into a printww.c module, added defs to curses.h and this works as expected. so, all these are like printww() wprintww() etc, because of confusion that would ensue if I'd use wprintw() :P I can do a PR so you can see what I did. It's in my local version of PDCurses for now, but I may simplymerge that code into my application.
You could use swprintf() to format the string to a buffer, and then addwstr() to render that to curses.That is what I did initially, just to see if the wchar_t's were even working.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
/ PDCurses /
/*man-start**
int printww(const wchar_t *fmt, ...);
int wprintww(WINDOW *win, const wchar_t *fmt, ...);
int mvprintww(int y, int x, const wchar_t *fmt, ...);
int mvwprintww(WINDOW *win, int y, int x, const wchar_t *fmt,...);
int vwprintww(WINDOW *win, const wchar_t *fmt, va_list varglist);
int vw_printww(WINDOW *win, const wchar_t *fmt, va_list varglist);
The printww() functions add a formatted string to the window at the current or specified cursor position. The format strings are the same as used in the standard C library's printf(). (printw() can be used as a drop-in replacement for printf().)
The duplication between vwprintww() and vw_printww() is for historic reasons. In PDCurses, they're the same.
All functions return the number of characters printed, or ERR on error.
X/Open ncurses NetBSD
printww ? ? ?
wprintww ? ? ?
mvprintww ? ? ?
mvwprintww ? ? ?
vwprintww ? ? ?
vw_printww ? ? ?
man-end**/
int vwprintww(WINDOW win, const wchar_t fmt, va_list varglist) { wchar_t printbuf[513]; int len;
PDC_LOG(("vwprintww() - called\n"));
len = vswprintf(printbuf, 512, fmt, varglist);
return (waddwstr(win, printbuf) == ERR) ? ERR : len;
}
int printww(const wchar_t *fmt, ...) { va_list args; int retval;
PDC_LOG(("printww() - called\n"));
va_start(args, fmt);
retval = vwprintww(stdscr, fmt, args);
va_end(args);
return retval;
}
int wprintww(WINDOW win, const wchar_t fmt, ...) { va_list args; int retval;
PDC_LOG(("wprintww() - called\n"));
va_start(args, fmt);
retval = vwprintww(win, fmt, args);
va_end(args);
return retval;
}
int mvprintww(int y, int x, const wchar_t *fmt, ...) { va_list args; int retval;
PDC_LOG(("mvprintww() - called\n"));
if (move(y, x) == ERR)
return ERR;
va_start(args, fmt);
retval = vwprintww(stdscr, fmt, args);
va_end(args);
return retval;
}
int mvwprintww(WINDOW win, int y, int x, const wchar_t fmt, ...) { va_list args; int retval;
PDC_LOG(("mvwprintww() - called\n"));
if (wmove(win, y, x) == ERR)
return ERR;
va_start(args, fmt);
retval = vwprintww(win, fmt, args);
va_end(args);
return retval;
}
int vw_wprintw(WINDOW win, const wchar_t fmt, va_list varglist) { PDC_LOG(("vw_wprintw() - called\n"));
return vwprintww(win, fmt, varglist);
}
/----------------------------------------------------------------------
/*man-start**
Define before inclusion (only those needed):
XCURSES if building / built for X11
PDC_RGB if you want to use RGB color definitions
(Red = 1, Green = 2, Blue = 4) instead of BGR
PDC_WIDE if building / built with wide-character support
PDC_DLL_BUILD if building / built as a Windows DLL
PDC_NCMOUSE to use the ncurses mouse API instead
of PDCurses' traditional mouse API
Defined by this header:
PDCURSES PDCurses-only features are available
PDC_BUILD API build version
PDC_VER_MAJOR major version number
PDC_VER_MINOR minor version number
PDC_VERDOT version string
man-end**/
/----------------------------------------------------------------------/
extern "C" {
/----------------------------------------------------------------------
*/
typedef unsigned char bool;
typedef unsigned int chtype;
typedef unsigned long chtype; / 16-bit attr + 16-bit char /
typedef chtype cchar_t;
typedef chtype attr_t;
/----------------------------------------------------------------------
*/
/ Use this structure with PDC_get_version() for run-time info about the way the library was built, in case it doesn't match the header. /
typedef struct { short flags; / flags OR'd together (see below) / short build; / PDC_BUILD at compile time / unsigned char major; / PDC_VER_MAJOR / unsigned char minor; / PDC_VER_MINOR / unsigned char csize; / sizeof chtype / unsigned char bsize; / sizeof bool / } PDC_VERSION;
enum { PDC_VFLAG_DEBUG = 1, / set if built with -DPDCDEBUG / PDC_VFLAG_WIDE = 2, / -DPDC_WIDE / PDC_VFLAG_UTF8 = 4, / -DPDC_FORCE_UTF8 / PDC_VFLAG_DLL = 8, / -DPDC_DLL_BUILD / PDC_VFLAG_RGB = 16 / -DPDC_RGB / };
/----------------------------------------------------------------------
*/
typedef unsigned int mmask_t;
typedef unsigned long mmask_t;
typedef struct { int x; / absolute column, 0 based, measured in characters / int y; / absolute row, 0 based, measured in characters / short button[3]; / state of each button / int changes; / flags indicating what has changed with the mouse / } MOUSE_STATUS;
/*
/ mouse bit-masks /
/ For the ncurses-compatible functions only, BUTTON4_PRESSED and BUTTON5_PRESSED are returned for mouse scroll wheel up and down; otherwise PDCurses doesn't support buttons 4 and 5 /
/ ncurses mouse interface /
typedef struct { short id; / unused, always 0 / int x, y, z; / x, y same as MOUSE_STATUS; z unused / mmask_t bstate; / equivalent to changes + button[], but in the same format as used for mousemask() / } MEVENT;
/----------------------------------------------------------------------
*/
typedef struct _win / definition of a window / { int _cury; / current pseudo-cursor / int _curx; int _maxy; / max window coordinates / int _maxx; int _begy; / origin on screen / int _begx; int _flags; / window properties / chtype _attrs; / standard attributes and colors / chtype _bkgd; / background, normally blank / bool _clear; / causes clear at next refresh / bool _leaveit; / leaves cursor where it is / bool _scroll; / allows window scrolling / bool _nodelay; / input character wait flag / bool _immed; / immediate update flag / bool _sync; / synchronize window ancestors / bool _use_keypad; / flags keypad key mode active / chtype *_y; / pointer to line pointer array / int _firstch; / first changed character in line / int _lastch; / last changed character in line / int _tmarg; / top of scrolling region / int _bmarg; / bottom of scrolling region / int _delayms; / milliseconds of delay for getch() / int _parx, _pary; / coords relative to parent (0,0) / struct _win _parent; / subwin's pointer to parent win /
/* these are used only if this is a pad */
struct pdat
{
int _pad_y;
int _pad_x;
int _pad_top;
int _pad_left;
int _pad_bottom;
int _pad_right;
} _pad; /* Pad-properties structure */
} WINDOW;
/ Color pair structure /
typedef struct { short f; / foreground color / short b; / background color / int count; / allocation order / bool set; / pair has been set / } PDC_PAIR;
/ Avoid using the SCREEN struct directly -- use the corresponding functions if possible. This struct may eventually be made private. /
typedef struct { bool alive; / if initscr() called, and not endwin() / bool autocr; / if cr -> lf / bool cbreak; / if terminal unbuffered / bool echo; / if terminal echo / bool raw_inp; / raw input mode (v. cooked input) / bool raw_out; / raw output mode (7 v. 8 bits) / bool audible; / FALSE if the bell is visual / bool mono; / TRUE if current screen is mono / bool resized; / TRUE if TERM has been resized / bool orig_attr; / TRUE if we have the original colors / short orig_fore; / original screen foreground color / short orig_back; / original screen foreground color / int cursrow; / position of physical cursor / int curscol; / position of physical cursor / int visibility; / visibility of cursor / int orig_cursor; / original cursor size / int lines; / new value for LINES / int cols; / new value for COLS / mmask_t _trap_mbe; / trap these mouse button events / int mouse_wait; / time to wait (in ms) for a button release after a press, in order to count it as a click / int slklines; / lines in use by slk_init() / WINDOW slk_winptr; / window for slk / int linesrippedoff; / lines ripped off via ripoffline() / int linesrippedoffontop; / lines ripped off on top via ripoffline() / int delaytenths; / 1/10ths second to wait block getch() for / bool _preserve; / TRUE if screen background to be preserved / int _restore; / specifies if screen background to be restored, and how / unsigned long key_modifiers; / key modifiers (SHIFT, CONTROL, etc.) on last key press / bool return_key_modifiers; / TRUE if modifier keys are returned as "real" keys / bool key_code; / TRUE if last key is a special key; used internally by get_wch() / MOUSE_STATUS mouse_status; / last returned mouse status / short line_color; / color of line attributes - default -1 / attr_t termattrs; / attribute capabilities / WINDOW lastscr; / the last screen image / FILE dbfp; / debug trace file pointer / bool color_started; / TRUE after start_color() / bool dirty; / redraw on napms() after init_color() / int sel_start; / start of selection (y COLS + x) / int sel_end; / end of selection / int c_buffer; / character buffer / int c_pindex; / putter index / int c_gindex; / getter index / int c_ungch; / array of ungotten chars / int c_ungind; / ungetch() push index / int c_ungmax; / allocated size of ungetch() buffer / PDC_PAIR atrtab; / table of color pairs */ } SCREEN;
/----------------------------------------------------------------------
*/
PDCEX int LINES; / terminal height / PDCEX int COLS; / terminal width / PDCEX WINDOW stdscr; / the default screen window / PDCEX WINDOW curscr; / the current screen image / PDCEX SCREEN SP; / curses variables / PDCEX MOUSE_STATUS Mouse_status; PDCEX int COLORS; PDCEX int COLOR_PAIRS; PDCEX int TABSIZE; PDCEX chtype acs_map[]; / alternate character set map / PDCEX char ttytype[]; / terminal name/description */
/*man-start**
PDCurses uses a 32-bit integer for its chtype:
+--------------------------------------------------------------------+
|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|..| 2| 1| 0|
+--------------------------------------------------------------------+
color pair | modifiers | character eg 'a'
There are 256 color pairs (8 bits), 8 bits for modifiers, and 16 bits for character data. The modifiers are bold, underline, right-line, left-line, italic, reverse and blink, plus the alternate character set indicator.
man-end**/
/ Video attribute macros /
/ For use with attr_t -- X/Open says, "these shall be distinct", so this is a non-conforming implementation. /
/ Alternate character set macros /
/ VT100-compatible symbols -- box chars /
/ VT100-compatible symbols -- other /
/ Teletype 5410v1 symbols -- these are defined in SysV curses, but are not well-supported by most terminals. Stick to VT100 characters for optimum portability. /
/ That goes double for these -- undocumented SysV symbols. Don't use them. /
/ Box char aliases /
/ cchar_t aliases /
/ Color macros /
/----------------------------------------------------------------------
*/
/ PDCurses-specific key definitions -- PC only /
/----------------------------------------------------------------------
*/
/ Standard /
PDCEX int addch(const chtype); PDCEX int addchnstr(const chtype , int); PDCEX int addchstr(const chtype ); PDCEX int addnstr(const char , int); PDCEX int addstr(const char ); PDCEX int attroff(chtype); PDCEX int attron(chtype); PDCEX int attrset(chtype); PDCEX int attr_get(attr_t , short , void ); PDCEX int attr_off(attr_t, void ); PDCEX int attr_on(attr_t, void ); PDCEX int attr_set(attr_t, short, void ); PDCEX int baudrate(void); PDCEX int beep(void); PDCEX int bkgd(chtype); PDCEX void bkgdset(chtype); PDCEX int border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype); PDCEX int box(WINDOW , chtype, chtype); PDCEX bool can_change_color(void); PDCEX int cbreak(void); PDCEX int chgat(int, attr_t, short, const void ); PDCEX int clearok(WINDOW , bool); PDCEX int clear(void); PDCEX int clrtobot(void); PDCEX int clrtoeol(void); PDCEX int color_content(short, short , short , short ); PDCEX int color_set(short, void ); PDCEX int copywin(const WINDOW , WINDOW , int, int, int, int, int, int, int); PDCEX int curs_set(int); PDCEX int def_prog_mode(void); PDCEX int def_shell_mode(void); PDCEX int delay_output(int); PDCEX int delch(void); PDCEX int deleteln(void); PDCEX void delscreen(SCREEN ); PDCEX int delwin(WINDOW ); PDCEX WINDOW derwin(WINDOW , int, int, int, int); PDCEX int doupdate(void); PDCEX WINDOW dupwin(WINDOW ); PDCEX int echochar(const chtype); PDCEX int echo(void); PDCEX int endwin(void); PDCEX char erasechar(void); PDCEX int erase(void); PDCEX void filter(void); PDCEX int flash(void); PDCEX int flushinp(void); PDCEX chtype getbkgd(WINDOW ); PDCEX int getnstr(char , int); PDCEX int getstr(char ); PDCEX WINDOW getwin(FILE ); PDCEX int halfdelay(int); PDCEX bool has_colors(void); PDCEX bool has_ic(void); PDCEX bool has_il(void); PDCEX int hline(chtype, int); PDCEX void idcok(WINDOW , bool); PDCEX int idlok(WINDOW , bool); PDCEX void immedok(WINDOW , bool); PDCEX int inchnstr(chtype , int); PDCEX int inchstr(chtype ); PDCEX chtype inch(void); PDCEX int init_color(short, short, short, short); PDCEX int init_pair(short, short, short); PDCEX WINDOW initscr(void); PDCEX int innstr(char , int); PDCEX int insch(chtype); PDCEX int insdelln(int); PDCEX int insertln(void); PDCEX int insnstr(const char , int); PDCEX int insstr(const char ); PDCEX int instr(char ); PDCEX int intrflush(WINDOW , bool); PDCEX bool isendwin(void); PDCEX bool is_linetouched(WINDOW , int); PDCEX bool is_wintouched(WINDOW ); PDCEX char keyname(int); PDCEX int keypad(WINDOW , bool); PDCEX char killchar(void); PDCEX int leaveok(WINDOW , bool); PDCEX char longname(void); PDCEX int meta(WINDOW , bool); PDCEX int move(int, int); PDCEX int mvaddch(int, int, const chtype); PDCEX int mvaddchnstr(int, int, const chtype , int); PDCEX int mvaddchstr(int, int, const chtype ); PDCEX int mvaddnstr(int, int, const char , int); PDCEX int mvaddstr(int, int, const char ); PDCEX int mvchgat(int, int, int, attr_t, short, const void ); PDCEX int mvcur(int, int, int, int); PDCEX int mvdelch(int, int); PDCEX int mvderwin(WINDOW , int, int); PDCEX int mvgetch(int, int); PDCEX int mvgetnstr(int, int, char , int); PDCEX int mvgetstr(int, int, char ); PDCEX int mvhline(int, int, chtype, int); PDCEX chtype mvinch(int, int); PDCEX int mvinchnstr(int, int, chtype , int); PDCEX int mvinchstr(int, int, chtype ); PDCEX int mvinnstr(int, int, char , int); PDCEX int mvinsch(int, int, chtype); PDCEX int mvinsnstr(int, int, const char , int); PDCEX int mvinsstr(int, int, const char ); PDCEX int mvinstr(int, int, char ); PDCEX int mvprintw(int, int, const char , ...); PDCEX int mvscanw(int, int, const char , ...); PDCEX int mvvline(int, int, chtype, int); PDCEX int mvwaddchnstr(WINDOW , int, int, const chtype , int); PDCEX int mvwaddchstr(WINDOW , int, int, const chtype ); PDCEX int mvwaddch(WINDOW , int, int, const chtype); PDCEX int mvwaddnstr(WINDOW , int, int, const char , int); PDCEX int mvwaddstr(WINDOW , int, int, const char ); PDCEX int mvwchgat(WINDOW , int, int, int, attr_t, short, const void ); PDCEX int mvwdelch(WINDOW , int, int); PDCEX int mvwgetch(WINDOW , int, int); PDCEX int mvwgetnstr(WINDOW , int, int, char , int); PDCEX int mvwgetstr(WINDOW , int, int, char ); PDCEX int mvwhline(WINDOW , int, int, chtype, int); PDCEX int mvwinchnstr(WINDOW , int, int, chtype , int); PDCEX int mvwinchstr(WINDOW , int, int, chtype ); PDCEX chtype mvwinch(WINDOW , int, int); PDCEX int mvwinnstr(WINDOW , int, int, char , int); PDCEX int mvwinsch(WINDOW , int, int, chtype); PDCEX int mvwinsnstr(WINDOW , int, int, const char , int); PDCEX int mvwinsstr(WINDOW , int, int, const char ); PDCEX int mvwinstr(WINDOW , int, int, char ); PDCEX int mvwin(WINDOW , int, int); PDCEX int mvwprintw(WINDOW , int, int, const char , ...); PDCEX int mvwscanw(WINDOW , int, int, const char , ...); PDCEX int mvwvline(WINDOW , int, int, chtype, int); PDCEX int napms(int); PDCEX WINDOW newpad(int, int); PDCEX SCREEN newterm(const char , FILE , FILE ); PDCEX WINDOW newwin(int, int, int, int); PDCEX int nl(void); PDCEX int nocbreak(void); PDCEX int nodelay(WINDOW , bool); PDCEX int noecho(void); PDCEX int nonl(void); PDCEX void noqiflush(void); PDCEX int noraw(void); PDCEX int notimeout(WINDOW , bool); PDCEX int overlay(const WINDOW , WINDOW ); PDCEX int overwrite(const WINDOW , WINDOW ); PDCEX int pair_content(short, short , short ); PDCEX int pechochar(WINDOW , chtype); PDCEX int pnoutrefresh(WINDOW , int, int, int, int, int, int); PDCEX int prefresh(WINDOW , int, int, int, int, int, int); PDCEX int printw(const char , ...); PDCEX int putwin(WINDOW , FILE ); PDCEX void qiflush(void); PDCEX int raw(void); PDCEX int redrawwin(WINDOW ); PDCEX int refresh(void); PDCEX int reset_prog_mode(void); PDCEX int reset_shell_mode(void); PDCEX int resetty(void); PDCEX int ripoffline(int, int ()(WINDOW , int)); PDCEX int savetty(void); PDCEX int scanw(const char , ...); PDCEX int scr_dump(const char ); PDCEX int scr_init(const char ); PDCEX int scr_restore(const char ); PDCEX int scr_set(const char ); PDCEX int scrl(int); PDCEX int scroll(WINDOW ); PDCEX int scrollok(WINDOW , bool); PDCEX SCREEN set_term(SCREEN ); PDCEX int setscrreg(int, int); PDCEX int slk_attroff(const chtype); PDCEX int slk_attr_off(const attr_t, void ); PDCEX int slk_attron(const chtype); PDCEX int slk_attr_on(const attr_t, void ); PDCEX int slk_attrset(const chtype); PDCEX int slk_attr_set(const attr_t, short, void ); PDCEX int slk_clear(void); PDCEX int slk_color(short); PDCEX int slk_init(int); PDCEX char slk_label(int); PDCEX int slk_noutrefresh(void); PDCEX int slk_refresh(void); PDCEX int slk_restore(void); PDCEX int slk_set(int, const char , int); PDCEX int slk_touch(void); PDCEX int standend(void); PDCEX int standout(void); PDCEX int start_color(void); PDCEX WINDOW subpad(WINDOW , int, int, int, int); PDCEX WINDOW subwin(WINDOW , int, int, int, int); PDCEX int syncok(WINDOW , bool); PDCEX chtype termattrs(void); PDCEX attr_t term_attrs(void); PDCEX char termname(void); PDCEX void timeout(int); PDCEX int touchline(WINDOW , int, int); PDCEX int touchwin(WINDOW ); PDCEX int typeahead(int); PDCEX int untouchwin(WINDOW ); PDCEX void use_env(bool); PDCEX int vidattr(chtype); PDCEX int vid_attr(attr_t, short, void ); PDCEX int vidputs(chtype, int ()(int)); PDCEX int vid_puts(attr_t, short, void , int ()(int)); PDCEX int vline(chtype, int); PDCEX int vw_printw(WINDOW , const char , va_list); PDCEX int vwprintw(WINDOW , const char , va_list); PDCEX int vw_scanw(WINDOW , const char , va_list); PDCEX int vwscanw(WINDOW , const char , va_list); PDCEX int waddchnstr(WINDOW , const chtype , int); PDCEX int waddchstr(WINDOW , const chtype ); PDCEX int waddch(WINDOW , const chtype); PDCEX int waddnstr(WINDOW , const char , int); PDCEX int waddstr(WINDOW , const char ); PDCEX int wattroff(WINDOW , chtype); PDCEX int wattron(WINDOW , chtype); PDCEX int wattrset(WINDOW , chtype); PDCEX int wattr_get(WINDOW , attr_t , short , void ); PDCEX int wattr_off(WINDOW , attr_t, void ); PDCEX int wattr_on(WINDOW , attr_t, void ); PDCEX int wattr_set(WINDOW , attr_t, short, void ); PDCEX void wbkgdset(WINDOW , chtype); PDCEX int wbkgd(WINDOW , chtype); PDCEX int wborder(WINDOW , chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype); PDCEX int wchgat(WINDOW , int, attr_t, short, const void ); PDCEX int wclear(WINDOW ); PDCEX int wclrtobot(WINDOW ); PDCEX int wclrtoeol(WINDOW ); PDCEX int wcolor_set(WINDOW , short, void ); PDCEX void wcursyncup(WINDOW ); PDCEX int wdelch(WINDOW ); PDCEX int wdeleteln(WINDOW ); PDCEX int wechochar(WINDOW , const chtype); PDCEX int werase(WINDOW ); PDCEX int wgetch(WINDOW ); PDCEX int wgetnstr(WINDOW , char , int); PDCEX int wgetstr(WINDOW , char ); PDCEX int whline(WINDOW , chtype, int); PDCEX int winchnstr(WINDOW , chtype , int); PDCEX int winchstr(WINDOW , chtype ); PDCEX chtype winch(WINDOW ); PDCEX int winnstr(WINDOW , char , int); PDCEX int winsch(WINDOW , chtype); PDCEX int winsdelln(WINDOW , int); PDCEX int winsertln(WINDOW ); PDCEX int winsnstr(WINDOW , const char , int); PDCEX int winsstr(WINDOW , const char ); PDCEX int winstr(WINDOW , char ); PDCEX int wmove(WINDOW , int, int); PDCEX int wnoutrefresh(WINDOW ); PDCEX int wprintw(WINDOW , const char , ...); PDCEX int wredrawln(WINDOW , int, int); PDCEX int wrefresh(WINDOW ); PDCEX int wscanw(WINDOW , const char , ...); PDCEX int wscrl(WINDOW , int); PDCEX int wsetscrreg(WINDOW , int, int); PDCEX int wstandend(WINDOW ); PDCEX int wstandout(WINDOW ); PDCEX void wsyncdown(WINDOW ); PDCEX void wsyncup(WINDOW ); PDCEX void wtimeout(WINDOW , int); PDCEX int wtouchln(WINDOW , int, int, int); PDCEX int wvline(WINDOW , chtype, int);
/ Wide-character functions /
PDCEX int addnwstr(const wchar_t , int); PDCEX int addwstr(const wchar_t ); PDCEX int add_wch(const cchar_t ); PDCEX int add_wchnstr(const cchar_t , int); PDCEX int add_wchstr(const cchar_t ); PDCEX int bkgrnd(const cchar_t ); PDCEX void bkgrndset(const cchar_t ); PDCEX int border_set(const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t ); PDCEX int box_set(WINDOW , const cchar_t , const cchar_t ); PDCEX int echo_wchar(const cchar_t ); PDCEX int erasewchar(wchar_t ); PDCEX int getbkgrnd(cchar_t ); PDCEX int getcchar(const cchar_t , wchar_t , attr_t , short , void ); PDCEX int getn_wstr(wint_t , int); PDCEX int get_wch(wint_t ); PDCEX int get_wstr(wint_t ); PDCEX int hline_set(const cchar_t , int); PDCEX int innwstr(wchar_t , int); PDCEX int ins_nwstr(const wchar_t , int); PDCEX int ins_wch(const cchar_t ); PDCEX int ins_wstr(const wchar_t ); PDCEX int inwstr(wchar_t ); PDCEX int in_wch(cchar_t ); PDCEX int in_wchnstr(cchar_t , int); PDCEX int in_wchstr(cchar_t ); PDCEX char key_name(wchar_t); PDCEX int killwchar(wchar_t ); PDCEX int mvaddnwstr(int, int, const wchar_t , int); PDCEX int mvaddwstr(int, int, const wchar_t ); PDCEX int mvadd_wch(int, int, const cchar_t ); PDCEX int mvadd_wchnstr(int, int, const cchar_t , int); PDCEX int mvadd_wchstr(int, int, const cchar_t ); PDCEX int mvgetn_wstr(int, int, wint_t , int); PDCEX int mvget_wch(int, int, wint_t ); PDCEX int mvget_wstr(int, int, wint_t ); PDCEX int mvhline_set(int, int, const cchar_t , int); PDCEX int mvinnwstr(int, int, wchar_t , int); PDCEX int mvins_nwstr(int, int, const wchar_t , int); PDCEX int mvins_wch(int, int, const cchar_t ); PDCEX int mvins_wstr(int, int, const wchar_t ); PDCEX int mvinwstr(int, int, wchar_t ); PDCEX int mvin_wch(int, int, cchar_t ); PDCEX int mvin_wchnstr(int, int, cchar_t , int); PDCEX int mvin_wchstr(int, int, cchar_t ); PDCEX int mvprintww(int, int, const wchar_t , ...); PDCEX int mvvline_set(int, int, const cchar_t , int); PDCEX int mvwaddnwstr(WINDOW , int, int, const wchar_t , int); PDCEX int mvwaddwstr(WINDOW , int, int, const wchar_t ); PDCEX int mvwadd_wch(WINDOW , int, int, const cchar_t ); PDCEX int mvwadd_wchnstr(WINDOW , int, int, const cchar_t , int); PDCEX int mvwadd_wchstr(WINDOW , int, int, const cchar_t ); PDCEX int mvwgetn_wstr(WINDOW , int, int, wint_t , int); PDCEX int mvwget_wch(WINDOW , int, int, wint_t ); PDCEX int mvwget_wstr(WINDOW , int, int, wint_t ); PDCEX int mvwhline_set(WINDOW , int, int, const cchar_t , int); PDCEX int mvwinnwstr(WINDOW , int, int, wchar_t , int); PDCEX int mvwins_nwstr(WINDOW , int, int, const wchar_t , int); PDCEX int mvwins_wch(WINDOW , int, int, const cchar_t ); PDCEX int mvwins_wstr(WINDOW , int, int, const wchar_t ); PDCEX int mvwin_wch(WINDOW , int, int, cchar_t ); PDCEX int mvwin_wchnstr(WINDOW , int, int, cchar_t , int); PDCEX int mvwin_wchstr(WINDOW , int, int, cchar_t ); PDCEX int mvwinwstr(WINDOW , int, int, wchar_t ); PDCEX int mvwvline_set(WINDOW , int, int, const cchar_t , int); PDCEX int mvwprintww(WINDOW , int, int, const wchar_t , ...); PDCEX int pecho_wchar(WINDOW , const cchar_t); PDCEX int printww(const wchar_t , ...); PDCEX int setcchar(cchar_t, const wchar_t, const attr_t, short, const void); PDCEX int slk_wset(int, const wchar_t , int); PDCEX int unget_wch(const wchar_t); PDCEX int vline_set(const cchar_t , int); PDCEX int vw_printww(WINDOW , const wchar_t , va_list); PDCEX int vwprintww(WINDOW , const wchar_t , va_list); PDCEX int waddnwstr(WINDOW , const wchar_t , int); PDCEX int waddwstr(WINDOW , const wchar_t ); PDCEX int wadd_wch(WINDOW , const cchar_t ); PDCEX int wadd_wchnstr(WINDOW , const cchar_t , int); PDCEX int wadd_wchstr(WINDOW , const cchar_t ); PDCEX int wbkgrnd(WINDOW , const cchar_t ); PDCEX void wbkgrndset(WINDOW , const cchar_t ); PDCEX int wborder_set(WINDOW , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t , const cchar_t ); PDCEX int wecho_wchar(WINDOW , const cchar_t ); PDCEX int wgetbkgrnd(WINDOW , cchar_t ); PDCEX int wgetn_wstr(WINDOW , wint_t , int); PDCEX int wget_wch(WINDOW , wint_t ); PDCEX int wget_wstr(WINDOW , wint_t ); PDCEX int whline_set(WINDOW , const cchar_t , int); PDCEX int winnwstr(WINDOW , wchar_t , int); PDCEX int wins_nwstr(WINDOW , const wchar_t , int); PDCEX int wins_wch(WINDOW , const cchar_t ); PDCEX int wins_wstr(WINDOW , const wchar_t ); PDCEX int winwstr(WINDOW , wchar_t ); PDCEX int win_wch(WINDOW , cchar_t ); PDCEX int win_wchnstr(WINDOW , cchar_t , int); PDCEX int win_wchstr(WINDOW , cchar_t ); PDCEX int wprintww(WINDOW , const wchar_t , ...); PDCEX wchar_t wunctrl(cchar_t ); PDCEX int wvline_set(WINDOW , const cchar_t , int);
/ Quasi-standard /
PDCEX chtype getattrs(WINDOW ); PDCEX int getbegx(WINDOW ); PDCEX int getbegy(WINDOW ); PDCEX int getmaxx(WINDOW ); PDCEX int getmaxy(WINDOW ); PDCEX int getparx(WINDOW ); PDCEX int getpary(WINDOW ); PDCEX int getcurx(WINDOW ); PDCEX int getcury(WINDOW ); PDCEX void traceoff(void); PDCEX void traceon(void); PDCEX char unctrl(chtype);
PDCEX int crmode(void); PDCEX int nocrmode(void); PDCEX int draino(int); PDCEX int resetterm(void); PDCEX int fixterm(void); PDCEX int saveterm(void); PDCEX void setsyx(int, int);
PDCEX int mouse_set(mmask_t); PDCEX int mouse_on(mmask_t); PDCEX int mouse_off(mmask_t); PDCEX int request_mouse_pos(void); PDCEX void wmouse_position(WINDOW , int , int *); PDCEX mmask_t getmouse(void);
/ ncurses /
PDCEX int alloc_pair(int, int); PDCEX int assume_default_colors(int, int); PDCEX const char curses_version(void); PDCEX int find_pair(int, int); PDCEX int free_pair(int); PDCEX bool has_key(int); PDCEX bool is_cleared(const WINDOW ); PDCEX bool is_idcok(const WINDOW ); PDCEX bool is_idlok(const WINDOW ); PDCEX bool is_immedok(const WINDOW ); PDCEX bool is_keypad(const WINDOW ); PDCEX bool is_leaveok(const WINDOW ); PDCEX bool is_nodelay(const WINDOW ); PDCEX bool is_notimeout(const WINDOW ); PDCEX bool is_pad(const WINDOW ); PDCEX bool is_scrollok(const WINDOW ); PDCEX bool is_subwin(const WINDOW ); PDCEX bool is_syncok(const WINDOW ); PDCEX int set_tabsize(int); PDCEX int use_default_colors(void); PDCEX int wgetdelay(const WINDOW ); PDCEX WINDOW wgetparent(const WINDOW ); PDCEX int wgetscrreg(const WINDOW , int , int ); PDCEX int wresize(WINDOW , int, int);
PDCEX bool has_mouse(void); PDCEX int mouseinterval(int); PDCEX mmask_t mousemask(mmask_t, mmask_t ); PDCEX bool mouse_trafo(int , int , bool); PDCEX int nc_getmouse(MEVENT ); PDCEX int ungetmouse(MEVENT ); PDCEX bool wenclose(const WINDOW , int, int); PDCEX bool wmouse_trafo(const WINDOW , int , int *, bool);
/ PDCurses /
PDCEX int addrawch(chtype); PDCEX int insrawch(chtype); PDCEX bool is_termresized(void); PDCEX int mvaddrawch(int, int, chtype); PDCEX int mvdeleteln(int, int); PDCEX int mvinsertln(int, int); PDCEX int mvinsrawch(int, int, chtype); PDCEX int mvwaddrawch(WINDOW , int, int, chtype); PDCEX int mvwdeleteln(WINDOW , int, int); PDCEX int mvwinsertln(WINDOW , int, int); PDCEX int mvwinsrawch(WINDOW , int, int, chtype); PDCEX int raw_output(bool); PDCEX int resize_term(int, int); PDCEX WINDOW resize_window(WINDOW , int, int); PDCEX int waddrawch(WINDOW , chtype); PDCEX int winsrawch(WINDOW , chtype); PDCEX char wordchar(void);
PDCEX wchar_t *slk_wlabel(int);
PDCEX void PDC_debug(const char , ...); PDCEX void PDC_get_version(PDC_VERSION ); PDCEX int PDC_ungetch(int); PDCEX int PDC_set_blink(bool); PDCEX int PDC_set_bold(bool); PDCEX int PDC_set_line_color(short); PDCEX void PDC_set_title(const char *);
PDCEX int PDC_clearclipboard(void); PDCEX int PDC_freeclipboard(char *); PDCEX int PDC_getclipboard(char *, long ); PDCEX int PDC_setclipboard(const char *, long);
PDCEX unsigned long PDC_get_key_modifiers(void); PDCEX int PDC_return_key_modifiers(bool);
PDCEX WINDOW *Xinitscr(int, char *); PDCEX void XCursesExit(void); PDCEX int sb_init(void); PDCEX int sb_set_horz(int, int, int); PDCEX int sb_set_vert(int, int, int); PDCEX int sb_get_horz(int , int , int ); PDCEX int sb_get_vert(int , int , int *); PDCEX int sb_refresh(void);
/ NetBSD /
PDCEX int touchoverlap(const WINDOW , WINDOW ); PDCEX int underend(void); PDCEX int underscore(void); PDCEX int wunderend(WINDOW ); PDCEX int wunderscore(WINDOW );
/ Functions defined as macros /
/ getch() and ungetch() conflict with some DOS libraries /
/ These will only work as macros /
else getyx(curscr,(y),(x)); }
/ Deprecated /
/ return codes from PDC_getclipboard() and PDC_setclipboard() calls /
/ PDCurses key modifier masks /
}
Eh, thanks, but I prefer not to extend PDCurses in this way. Unless you got X/Open to adopt it...
Hi:
Is it me, or are there no 'w' variants for the printw() series of functions?
I have a Unicode (wide-char) mode application that wants to write wchart strings to the screen, using vw[]printw, but that of course won't work; the strings will eventually be sent to the regular, narrow-character functions (waddch et al.)
Shouldn't there be a wprintw.c module that handles these?
Just checking before I dive in too deep...