晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /usr/include/ncurses/ |
Upload File : |
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
* Copyright (c) 1998-2003,2005 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: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $
#ifndef NCURSES_CURSSLK_H_incl
#define NCURSES_CURSSLK_H_incl
#include <cursesw.h>
class NCURSES_IMPEXP Soft_Label_Key_Set {
public:
// This inner class represents the attributes of a Soft Label Key (SLK)
class NCURSES_IMPEXP Soft_Label_Key {
friend class Soft_Label_Key_Set;
public:
typedef enum { Left=0, Center=1, Right=2 } Justification;
private:
char *label; // The Text of the Label
Justification format; // The Justification
int num; // The number of the Label
Soft_Label_Key() : label(NULL), format(Left), num(-1) {
}
virtual ~Soft_Label_Key() {
delete[] label;
};
public:
// Set the text of the Label
Soft_Label_Key& operator=(char *text);
// Set the Justification of the Label
Soft_Label_Key& operator=(Justification just) {
format = just;
return *this;
}
// Retrieve the text of the label
inline char* operator()(void) const {
return label;
}
Soft_Label_Key& operator=(const Soft_Label_Key& rhs)
{
if (this != &rhs) {
*this = rhs;
}
return *this;
}
Soft_Label_Key(const Soft_Label_Key& rhs)
: label(NULL),
format(rhs.format),
num(rhs.num)
{
*this = rhs.label;
}
};
public:
typedef enum {
None = -1,
Three_Two_Three = 0,
Four_Four = 1,
PC_Style = 2,
PC_Style_With_Index = 3
} Label_Layout;
private:
static long NCURSES_IMPEXP count; // Number of Key Sets
static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets
static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets
bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized
Soft_Label_Key *slk_array; // The array of SLK's
// Init the Key Set
void init();
// Activate or Deactivate Label# i, Label counting starts with 1!
void activate_label(int i, bool bf=TRUE);
// Activate of Deactivate all Labels
void activate_labels(bool bf);
protected:
inline void Error (const char* msg) const THROWS(NCursesException) {
THROW(new NCursesException (msg));
}
// Remove SLK's from screen
void clear() {
if (ERR==::slk_clear())
Error("slk_clear");
}
// Restore them
void restore() {
if (ERR==::slk_restore())
Error("slk_restore");
}
public:
// Construct a Key Set, use the most comfortable layout as default.
// You must create a Soft_Label_Key_Set before you create any object of
// the NCursesWindow, NCursesPanel or derived classes. (Actually before
// ::initscr() is called).
Soft_Label_Key_Set(Label_Layout fmt);
// This constructor assumes, that you already constructed a Key Set
// with a layout by the constructor above. This layout will be reused.
NCURSES_IMPEXP Soft_Label_Key_Set();
Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs)
{
if (this != &rhs) {
*this = rhs;
init(); // allocate a new slk_array[]
}
return *this;
}
Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs)
: b_attrInit(rhs.b_attrInit),
slk_array(NULL)
{
init(); // allocate a new slk_array[]
}
virtual ~Soft_Label_Key_Set();
// Get Label# i. Label counting starts with 1!
NCURSES_IMPEXP Soft_Label_Key& operator[](int i);
// Retrieve number of Labels
inline int labels() const { return num_labels; }
// Refresh the SLK portion of the screen
inline void refresh() {
if (ERR==::slk_refresh())
Error("slk_refresh");
}
// Mark the SLK portion of the screen for refresh, defer actual refresh
// until next update call.
inline void noutrefresh() {
if (ERR==::slk_noutrefresh())
Error("slk_noutrefresh");
}
// Mark the whole SLK portion of the screen as modified
inline void touch() {
if (ERR==::slk_touch())
Error("slk_touch");
}
// Activate Label# i
inline void show(int i) {
activate_label(i,FALSE);
activate_label(i,TRUE);
}
// Hide Label# i
inline void hide(int i) {
activate_label(i,FALSE);
}
// Show all Labels
inline void show() {
activate_labels(FALSE);
activate_labels(TRUE);
}
// Hide all Labels
inline void hide() {
activate_labels(FALSE);
}
inline void attron(attr_t attrs) {
if (ERR==::slk_attron(attrs))
Error("slk_attron");
}
inline void attroff(attr_t attrs) {
if (ERR==::slk_attroff(attrs))
Error("slk_attroff");
}
inline void attrset(attr_t attrs) {
if (ERR==::slk_attrset(attrs))
Error("slk_attrset");
}
inline void color(short color_pair_number) {
if (ERR==::slk_color(color_pair_number))
Error("slk_color");
}
inline attr_t attr() const {
return ::slk_attr();
}
};
#endif /* NCURSES_CURSSLK_H_incl */