Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../proc/self/root/usr/include
File: cursesapp.h
// * This makes emacs happy -*-Mode: C++;-*-
[0] Fix | Delete
/****************************************************************************
[1] Fix | Delete
* Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. *
[2] Fix | Delete
* *
[3] Fix | Delete
* Permission is hereby granted, free of charge, to any person obtaining a *
[4] Fix | Delete
* copy of this software and associated documentation files (the *
[5] Fix | Delete
* "Software"), to deal in the Software without restriction, including *
[6] Fix | Delete
* without limitation the rights to use, copy, modify, merge, publish, *
[7] Fix | Delete
* distribute, distribute with modifications, sublicense, and/or sell *
[8] Fix | Delete
* copies of the Software, and to permit persons to whom the Software is *
[9] Fix | Delete
* furnished to do so, subject to the following conditions: *
[10] Fix | Delete
* *
[11] Fix | Delete
* The above copyright notice and this permission notice shall be included *
[12] Fix | Delete
* in all copies or substantial portions of the Software. *
[13] Fix | Delete
* *
[14] Fix | Delete
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
[15] Fix | Delete
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
[16] Fix | Delete
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
[17] Fix | Delete
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
[18] Fix | Delete
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
[19] Fix | Delete
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
[20] Fix | Delete
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
[21] Fix | Delete
* *
[22] Fix | Delete
* Except as contained in this notice, the name(s) of the above copyright *
[23] Fix | Delete
* holders shall not be used in advertising or otherwise to promote the *
[24] Fix | Delete
* sale, use or other dealings in this Software without prior written *
[25] Fix | Delete
* authorization. *
[26] Fix | Delete
****************************************************************************/
[27] Fix | Delete
[28] Fix | Delete
/****************************************************************************
[29] Fix | Delete
* Author: Juergen Pfeifer, 1997 *
[30] Fix | Delete
****************************************************************************/
[31] Fix | Delete
[32] Fix | Delete
// $Id: cursesapp.h,v 1.12 2011/09/17 22:12:10 tom Exp $
[33] Fix | Delete
[34] Fix | Delete
#ifndef NCURSES_CURSESAPP_H_incl
[35] Fix | Delete
#define NCURSES_CURSESAPP_H_incl
[36] Fix | Delete
[37] Fix | Delete
#include <cursslk.h>
[38] Fix | Delete
[39] Fix | Delete
class NCURSES_IMPEXP NCursesApplication {
[40] Fix | Delete
public:
[41] Fix | Delete
typedef struct _slk_link { // This structure is used to maintain
[42] Fix | Delete
struct _slk_link* prev; // a stack of SLKs
[43] Fix | Delete
Soft_Label_Key_Set* SLKs;
[44] Fix | Delete
} SLK_Link;
[45] Fix | Delete
private:
[46] Fix | Delete
static int rinit(NCursesWindow& w); // Internal Init function for title
[47] Fix | Delete
static NCursesApplication* theApp; // Global ref. to the application
[48] Fix | Delete
[49] Fix | Delete
static SLK_Link* slk_stack;
[50] Fix | Delete
[51] Fix | Delete
protected:
[52] Fix | Delete
static NCursesWindow* titleWindow; // The Title Window (if any)
[53] Fix | Delete
[54] Fix | Delete
bool b_Colors; // Is this a color application?
[55] Fix | Delete
NCursesWindow* Root_Window; // This is the stdscr equiv.
[56] Fix | Delete
[57] Fix | Delete
// Initialization of attributes;
[58] Fix | Delete
// Rewrite this in your derived class if you prefer other settings
[59] Fix | Delete
virtual void init(bool bColors);
[60] Fix | Delete
[61] Fix | Delete
// The number of lines for the title window. Default is no title window
[62] Fix | Delete
// You may rewrite this in your derived class
[63] Fix | Delete
virtual int titlesize() const {
[64] Fix | Delete
return 0;
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
// This method is called to put something into the title window initially
[68] Fix | Delete
// You may rewrite this in your derived class
[69] Fix | Delete
virtual void title() {
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
// The layout used for the Soft Label Keys. Default is to have no SLKs.
[73] Fix | Delete
// You may rewrite this in your derived class
[74] Fix | Delete
virtual Soft_Label_Key_Set::Label_Layout useSLKs() const {
[75] Fix | Delete
return Soft_Label_Key_Set::None;
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
// This method is called to initialize the SLKs. Default is nothing.
[79] Fix | Delete
// You may rewrite this in your derived class
[80] Fix | Delete
virtual void init_labels(Soft_Label_Key_Set& S) const {
[81] Fix | Delete
(void) S;
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
// Your derived class must implement this method. The return value must
[85] Fix | Delete
// be the exit value of your application.
[86] Fix | Delete
virtual int run() = 0;
[87] Fix | Delete
[88] Fix | Delete
// The constructor is protected, so you may use it in your derived
[89] Fix | Delete
// class constructor. The argument tells whether or not you want colors.
[90] Fix | Delete
NCursesApplication(bool wantColors = FALSE);
[91] Fix | Delete
[92] Fix | Delete
NCursesApplication& operator=(const NCursesApplication& rhs)
[93] Fix | Delete
{
[94] Fix | Delete
if (this != &rhs) {
[95] Fix | Delete
*this = rhs;
[96] Fix | Delete
}
[97] Fix | Delete
return *this;
[98] Fix | Delete
}
[99] Fix | Delete
[100] Fix | Delete
NCursesApplication(const NCursesApplication& rhs)
[101] Fix | Delete
: b_Colors(rhs.b_Colors),
[102] Fix | Delete
Root_Window(rhs.Root_Window)
[103] Fix | Delete
{
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
public:
[107] Fix | Delete
virtual ~NCursesApplication();
[108] Fix | Delete
[109] Fix | Delete
// Get a pointer to the current application object
[110] Fix | Delete
static NCursesApplication* getApplication() {
[111] Fix | Delete
return theApp;
[112] Fix | Delete
}
[113] Fix | Delete
[114] Fix | Delete
// This method runs the application and returns its exit value
[115] Fix | Delete
int operator()(void);
[116] Fix | Delete
[117] Fix | Delete
// Process the commandline arguments. The default implementation simply
[118] Fix | Delete
// ignores them. Your derived class may rewrite this.
[119] Fix | Delete
virtual void handleArgs(int argc, char* argv[]) {
[120] Fix | Delete
(void) argc;
[121] Fix | Delete
(void) argv;
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
// Does this application use colors?
[125] Fix | Delete
inline bool useColors() const {
[126] Fix | Delete
return b_Colors;
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
// Push the Key Set S onto the SLK Stack. S then becomes the current set
[130] Fix | Delete
// of Soft Labelled Keys.
[131] Fix | Delete
void push(Soft_Label_Key_Set& S);
[132] Fix | Delete
[133] Fix | Delete
// Throw away the current set of SLKs and make the previous one the
[134] Fix | Delete
// new current set.
[135] Fix | Delete
bool pop();
[136] Fix | Delete
[137] Fix | Delete
// Retrieve the current set of Soft Labelled Keys.
[138] Fix | Delete
Soft_Label_Key_Set* top() const;
[139] Fix | Delete
[140] Fix | Delete
// Attributes to use for menu and forms foregrounds
[141] Fix | Delete
virtual chtype foregrounds() const {
[142] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(1)) : A_BOLD;
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
// Attributes to use for menu and forms backgrounds
[146] Fix | Delete
virtual chtype backgrounds() const {
[147] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(2)) : A_NORMAL;
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
// Attributes to use for inactive (menu) elements
[151] Fix | Delete
virtual chtype inactives() const {
[152] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(3)|A_DIM) : A_DIM;
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
// Attributes to use for (form) labels and SLKs
[156] Fix | Delete
virtual chtype labels() const {
[157] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL;
[158] Fix | Delete
}
[159] Fix | Delete
[160] Fix | Delete
// Attributes to use for form backgrounds
[161] Fix | Delete
virtual chtype dialog_backgrounds() const {
[162] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(4)) : A_NORMAL;
[163] Fix | Delete
}
[164] Fix | Delete
[165] Fix | Delete
// Attributes to use as default for (form) window backgrounds
[166] Fix | Delete
virtual chtype window_backgrounds() const {
[167] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(5)) : A_NORMAL;
[168] Fix | Delete
}
[169] Fix | Delete
[170] Fix | Delete
// Attributes to use for the title window
[171] Fix | Delete
virtual chtype screen_titles() const {
[172] Fix | Delete
return b_Colors ? static_cast<chtype>(COLOR_PAIR(6)) : A_BOLD;
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
};
[176] Fix | Delete
[177] Fix | Delete
#endif /* NCURSES_CURSESAPP_H_incl */
[178] Fix | Delete
[179] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function