🌌 SpectraShell
Current path:
usr
/
include
/
👤 Create WP Admin
⬆️
Go up: /usr
✏️ Editing: cursesapp.h
// * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** * Copyright 2019,2020 Thomas E. Dickey * * Copyright 1998-2005,2011 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 * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Juergen Pfeifer, 1997 * ****************************************************************************/ // $Id: cursesapp.h,v 1.17 2020/08/29 16:22:03 juergen Exp $ #ifndef NCURSES_CURSESAPP_H_incl #define NCURSES_CURSESAPP_H_incl #include <cursslk.h> #if (defined(_WIN32) || defined(_WIN64)) # define NCURSES_CXX_MAIN_NAME cursespp_main # define NCURSES_CXX_MAIN \ int main(int argc, char *argv[]) { \ return NCURSES_CXX_MAIN_NAME(argc, argv); \ } #else # define NCURSES_CXX_MAIN_NAME main #endif NCURSES_CXX_IMPEXP int NCURSES_CXX_MAIN_NAME(int argc, char *argv[]); class NCURSES_CXX_IMPEXP NCursesApplication { public: typedef struct _slk_link { // This structure is used to maintain struct _slk_link* prev; // a stack of SLKs Soft_Label_Key_Set* SLKs; } SLK_Link; private: static int rinit(NCursesWindow& w); // Internal Init function for title static NCursesApplication* theApp; // Global ref. to the application static SLK_Link* slk_stack; protected: static NCursesWindow* titleWindow; // The Title Window (if any) bool b_Colors; // Is this a color application? NCursesWindow* Root_Window; // This is the stdscr equiv. // Initialization of attributes; // Rewrite this in your derived class if you prefer other settings virtual void init(bool bColors); // The number of lines for the title window. Default is no title window // You may rewrite this in your derived class virtual int titlesize() const { return 0; } // This method is called to put something into the title window initially // You may rewrite this in your derived class virtual void title() { } // The layout used for the Soft Label Keys. Default is to have no SLKs. // You may rewrite this in your derived class virtual Soft_Label_Key_Set::Label_Layout useSLKs() const { return Soft_Label_Key_Set::None; } // This method is called to initialize the SLKs. Default is nothing. // You may rewrite this in your derived class virtual void init_labels(Soft_Label_Key_Set& S) const { (void) S; } // Your derived class must implement this method. The return value must // be the exit value of your application. virtual int run() = 0; // The constructor is protected, so you may use it in your derived // class constructor. The argument tells whether or not you want colors. NCursesApplication(bool wantColors = FALSE); NCursesApplication& operator=(const NCursesApplication& rhs) { if (this != &rhs) { *this = rhs; } return *this; } NCursesApplication(const NCursesApplication& rhs) : b_Colors(rhs.b_Colors), Root_Window(rhs.Root_Window) { } static NCursesWindow *&getTitleWindow(); public: virtual ~NCursesApplication() THROWS(NCursesException); // Get a pointer to the current application object static NCursesApplication* getApplication(); // This method runs the application and returns its exit value int operator()(void); // Process the commandline arguments. The default implementation simply // ignores them. Your derived class may rewrite this. virtual void handleArgs(int argc, char* argv[]) { (void) argc; (void) argv; } // Does this application use colors? inline bool useColors() const { return b_Colors; } // Push the Key Set S onto the SLK Stack. S then becomes the current set // of Soft Labelled Keys. void push(Soft_Label_Key_Set& S); // Throw away the current set of SLKs and make the previous one the // new current set. bool pop(); // Retrieve the current set of Soft Labelled Keys. Soft_Label_Key_Set* top() const; // Attributes to use for menu and forms foregrounds virtual chtype foregrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(1)) : A_BOLD; } // Attributes to use for menu and forms backgrounds virtual chtype backgrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(2)) : A_NORMAL; } // Attributes to use for inactive (menu) elements virtual chtype inactives() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(3)|A_DIM) : A_DIM; } // Attributes to use for (form) labels and SLKs virtual chtype labels() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL; } // Attributes to use for form backgrounds virtual chtype dialog_backgrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL; } // Attributes to use as default for (form) window backgrounds virtual chtype window_backgrounds() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(5)) : A_NORMAL; } // Attributes to use for the title window virtual chtype screen_titles() const { return b_Colors ? static_cast<chtype>(COLOR_PAIR(6)) : A_BOLD; } }; #endif /* NCURSES_CURSESAPP_H_incl */
Save
Upload
📁
Create Folder
📁
arpa
📁
asm
📁
asm-generic
📁
bind9
📁
bits
📁
blkid
📁
brotli
📁
c++
📁
coredumper
📁
drm
📁
e2p
📁
et
📁
event2
📁
ext2fs
📁
finclude
📁
fontconfig
📁
freetype2
📁
fstrm
📁
fwctl
📁
gdbm
📁
gio-unix-2.0
📁
GL
📁
glib-2.0
📁
gnu
📁
google
📁
graphite2
📁
gssapi
📁
gssrpc
📁
harfbuzz
📁
json-c
📁
kadm5
📁
krb5
📁
libexslt
📁
libltdl
📁
libmount
📁
libpng16
📁
libxml2
📁
libxslt
📁
linux
📁
lzma
📁
misc
📁
mtd
📁
ncurses
📁
ncursesw
📁
net
📁
netash
📁
netatalk
📁
netax25
📁
neteconet
📁
netinet
📁
netipx
📁
netiucv
📁
netpacket
📁
netrom
📁
netrose
📁
nfs
📁
openssl
📁
pcp
📁
protobuf-c
📁
protocols
📁
python3.9
📁
rdma
📁
rpc
📁
scsi
📁
security
📁
selinux
📁
sepol
📁
sound
📁
sys
📁
sysprof-4
📁
unicode
📁
video
📁
webp
📁
X11
📁
xcb
📁
xen
📄
a.out.h
|
✏️ Edit
📄
aio.h
|
✏️ Edit
📄
aliases.h
|
✏️ Edit
📄
alloca.h
|
✏️ Edit
📄
ar.h
|
✏️ Edit
📄
argp.h
|
✏️ Edit
📄
argz.h
|
✏️ Edit
📄
assert.h
|
✏️ Edit
📄
autosprintf.h
|
✏️ Edit
📄
byteswap.h
|
✏️ Edit
📄
bzlib.h
|
✏️ Edit
📄
complex.h
|
✏️ Edit
📄
com_err.h
|
✏️ Edit
📄
cpio.h
|
✏️ Edit
📄
cpuidle.h
|
✏️ Edit
📄
crypt.h
|
✏️ Edit
📄
ctype.h
|
✏️ Edit
📄
curses.h
|
✏️ Edit
📄
cursesapp.h
|
✏️ Edit
📄
cursesf.h
|
✏️ Edit
📄
cursesm.h
|
✏️ Edit
📄
cursesp.h
|
✏️ Edit
📄
cursesw.h
|
✏️ Edit
📄
cursslk.h
|
✏️ Edit
📄
dbm.h
|
✏️ Edit
📄
dirent.h
|
✏️ Edit
📄
dlfcn.h
|
✏️ Edit
📄
elf.h
|
✏️ Edit
📄
endian.h
|
✏️ Edit
📄
entities.h
|
✏️ Edit
📄
envz.h
|
✏️ Edit
📄
err.h
|
✏️ Edit
📄
errno.h
|
✏️ Edit
📄
error.h
|
✏️ Edit
📄
eti.h
|
✏️ Edit
📄
etip.h
|
✏️ Edit
📄
evdns.h
|
✏️ Edit
📄
event.h
|
✏️ Edit
📄
evhttp.h
|
✏️ Edit
📄
evrpc.h
|
✏️ Edit
📄
evutil.h
|
✏️ Edit
📄
execinfo.h
|
✏️ Edit
📄
expat.h
|
✏️ Edit
📄
expat_config.h
|
✏️ Edit
📄
expat_external.h
|
✏️ Edit
📄
fcntl.h
|
✏️ Edit
📄
features-time64.h
|
✏️ Edit
📄
features.h
|
✏️ Edit
📄
fenv.h
|
✏️ Edit
📄
ffi-x86_64.h
|
✏️ Edit
📄
ffi.h
|
✏️ Edit
📄
ffitarget-x86_64.h
|
✏️ Edit
📄
ffitarget.h
|
✏️ Edit
📄
FlexLexer.h
|
✏️ Edit
📄
fmtmsg.h
|
✏️ Edit
📄
fnmatch.h
|
✏️ Edit
📄
form.h
|
✏️ Edit
📄
fpu_control.h
|
✏️ Edit
📄
fstab.h
|
✏️ Edit
📄
fstrm.h
|
✏️ Edit
📄
fts.h
|
✏️ Edit
📄
ftw.h
|
✏️ Edit
📄
gconv.h
|
✏️ Edit
📄
gd.h
|
✏️ Edit
📄
gdbm.h
|
✏️ Edit
📄
gdcache.h
|
✏️ Edit
📄
gdfontg.h
|
✏️ Edit
📄
gdfontl.h
|
✏️ Edit
📄
gdfontmb.h
|
✏️ Edit
📄
gdfonts.h
|
✏️ Edit
📄
gdfontt.h
|
✏️ Edit
📄
gdfx.h
|
✏️ Edit
📄
gdpp.h
|
✏️ Edit
📄
gd_color_map.h
|
✏️ Edit
📄
gd_errors.h
|
✏️ Edit
📄
gd_io.h
|
✏️ Edit
📄
gelf.h
|
✏️ Edit
📄
getopt.h
|
✏️ Edit
📄
gettext-po.h
|
✏️ Edit
📄
gif_lib.h
|
✏️ Edit
📄
glob.h
|
✏️ Edit
📄
gnu-versions.h
|
✏️ Edit
📄
gnumake.h
|
✏️ Edit
📄
gpg-error.h
|
✏️ Edit
📄
gpgrt.h
|
✏️ Edit
📄
grp.h
|
✏️ Edit
📄
gshadow.h
|
✏️ Edit
📄
gssapi.h
|
✏️ Edit
📄
iconv.h
|
✏️ Edit
📄
idn-free.h
|
✏️ Edit
📄
idn-int.h
|
✏️ Edit
📄
idna.h
|
✏️ Edit
📄
ieee754.h
|
✏️ Edit
📄
ifaddrs.h
|
✏️ Edit
📄
inttypes.h
|
✏️ Edit
📄
jconfig-64.h
|
✏️ Edit
📄
jconfig.h
|
✏️ Edit
📄
jerror.h
|
✏️ Edit
📄
jmorecfg.h
|
✏️ Edit
📄
jpegint.h
|
✏️ Edit
📄
jpeglib.h
|
✏️ Edit
📄
kdb.h
|
✏️ Edit
📄
keyutils.h
|
✏️ Edit
📄
krad.h
|
✏️ Edit
📄
krb5.h
|
✏️ Edit
📄
langinfo.h
|
✏️ Edit
📄
lastlog.h
|
✏️ Edit
📄
libaio.h
|
✏️ Edit
📄
libelf.h
|
✏️ Edit
📄
libgen.h
|
✏️ Edit
📄
libintl.h
|
✏️ Edit
📄
libtasn1.h
|
✏️ Edit
📄
limits.h
|
✏️ Edit
📄
link.h
|
✏️ Edit
📄
lmdb.h
|
✏️ Edit
📄
locale.h
|
✏️ Edit
📄
ltdl.h
|
✏️ Edit
📄
lzma.h
|
✏️ Edit
📄
malloc.h
|
✏️ Edit
📄
math.h
|
✏️ Edit
📄
maxminddb.h
|
✏️ Edit
📄
maxminddb_config-64.h
|
✏️ Edit
📄
maxminddb_config.h
|
✏️ Edit
📄
mcheck.h
|
✏️ Edit
📄
memory.h
|
✏️ Edit
📄
menu.h
|
✏️ Edit
📄
mntent.h
|
✏️ Edit
📄
monetary.h
|
✏️ Edit
📄
mqueue.h
|
✏️ Edit
📄
ncurses.h
|
✏️ Edit
📄
ncurses_dll.h
|
✏️ Edit
📄
nc_tparm.h
|
✏️ Edit
📄
ndbm.h
|
✏️ Edit
📄
netdb.h
|
✏️ Edit
📄
nlist.h
|
✏️ Edit
📄
nl_types.h
|
✏️ Edit
📄
nss.h
|
✏️ Edit
📄
obstack.h
|
✏️ Edit
📄
panel.h
|
✏️ Edit
📄
paths.h
|
✏️ Edit
📄
pcre.h
|
✏️ Edit
📄
pcre2.h
|
✏️ Edit
📄
pcre2posix.h
|
✏️ Edit
📄
pcrecpp.h
|
✏️ Edit
📄
pcrecpparg.h
|
✏️ Edit
📄
pcreposix.h
|
✏️ Edit
📄
pcre_scanner.h
|
✏️ Edit
📄
pcre_stringpiece.h
|
✏️ Edit
📄
png.h
|
✏️ Edit
📄
pngconf.h
|
✏️ Edit
📄
pnglibconf.h
|
✏️ Edit
📄
poll.h
|
✏️ Edit
📄
powercap.h
|
✏️ Edit
📄
pr29.h
|
✏️ Edit
📄
printf.h
|
✏️ Edit
📄
proc_service.h
|
✏️ Edit
📄
profile.h
|
✏️ Edit
📄
pthread.h
|
✏️ Edit
📄
pty.h
|
✏️ Edit
📄
punycode.h
|
✏️ Edit
📄
pwd.h
|
✏️ Edit
📄
regex.h
|
✏️ Edit
📄
regexp.h
|
✏️ Edit
📄
resolv.h
|
✏️ Edit
📄
re_comp.h
|
✏️ Edit
📄
sched.h
|
✏️ Edit
📄
search.h
|
✏️ Edit
📄
semaphore.h
|
✏️ Edit
📄
setjmp.h
|
✏️ Edit
📄
sgtty.h
|
✏️ Edit
📄
shadow.h
|
✏️ Edit
📄
signal.h
|
✏️ Edit
📄
spawn.h
|
✏️ Edit
📄
stab.h
|
✏️ Edit
📄
stdc-predef.h
|
✏️ Edit
📄
stdint.h
|
✏️ Edit
📄
stdio.h
|
✏️ Edit
📄
stdio_ext.h
|
✏️ Edit
📄
stdlib.h
|
✏️ Edit
📄
string.h
|
✏️ Edit
📄
stringprep.h
|
✏️ Edit
📄
strings.h
|
✏️ Edit
📄
syscall.h
|
✏️ Edit
📄
sysexits.h
|
✏️ Edit
📄
syslog.h
|
✏️ Edit
📄
tar.h
|
✏️ Edit
📄
term.h
|
✏️ Edit
📄
termcap.h
|
✏️ Edit
📄
termio.h
|
✏️ Edit
📄
termios.h
|
✏️ Edit
📄
term_entry.h
|
✏️ Edit
📄
tgmath.h
|
✏️ Edit
📄
threads.h
|
✏️ Edit
📄
thread_db.h
|
✏️ Edit
📄
tic.h
|
✏️ Edit
📄
tiff.h
|
✏️ Edit
📄
tiffconf-64.h
|
✏️ Edit
📄
tiffconf.h
|
✏️ Edit
📄
tiffio.h
|
✏️ Edit
📄
tiffio.hxx
|
✏️ Edit
📄
tiffvers.h
|
✏️ Edit
📄
time.h
|
✏️ Edit
📄
tld.h
|
✏️ Edit
📄
ttyent.h
|
✏️ Edit
📄
uchar.h
|
✏️ Edit
📄
ucontext.h
|
✏️ Edit
📄
ulimit.h
|
✏️ Edit
📄
unctrl.h
|
✏️ Edit
📄
unistd.h
|
✏️ Edit
📄
utime.h
|
✏️ Edit
📄
utmp.h
|
✏️ Edit
📄
utmpx.h
|
✏️ Edit
📄
values.h
|
✏️ Edit
📄
verto-module.h
|
✏️ Edit
📄
verto.h
|
✏️ Edit
📄
wait.h
|
✏️ Edit
📄
wchar.h
|
✏️ Edit
📄
wctype.h
|
✏️ Edit
📄
wordexp.h
|
✏️ Edit
📄
zconf.h
|
✏️ Edit
📄
zdict.h
|
✏️ Edit
📄
zlib.h
|
✏️ Edit
📄
zstd.h
|
✏️ Edit
📄
zstd_errors.h
|
✏️ Edit