diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-15 01:16:13 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-15 01:16:13 +0800 |
commit | a942aaef1cdde595f482a853e6a1291c04b9d2c7 (patch) | |
tree | 73c7992b234f85bd7440a33ccf2a6c610cdff42c /include | |
parent | a2f6c27927c37f89b888f9e4c1afe96049bdf406 (diff) | |
download | pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.tar pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.tar.gz pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.tar.bz2 pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.tar.lz pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.tar.xz pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.tar.zst pttbbs-a942aaef1cdde595f482a853e6a1291c04b9d2c7.zip |
- (internal) code refine - improving visio system
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4164 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | include/proto.h | 20 | ||||
-rw-r--r-- | include/visio.h | 48 |
3 files changed, 52 insertions, 20 deletions
diff --git a/include/config.h b/include/config.h index aec5b3df..76b393a3 100644 --- a/include/config.h +++ b/include/config.h @@ -155,10 +155,6 @@ #define THREAD_SEARCH_RANGE (500) #endif -#ifndef HAVE_JCEE /* 大學聯考查榜系統 */ -#define HAVE_JCEE 0 -#endif - #ifndef MEM_CHECK #define MEM_CHECK 0x98761234 #endif diff --git a/include/proto.h b/include/proto.h index a223ac78..bdea4f75 100644 --- a/include/proto.h +++ b/include/proto.h @@ -46,6 +46,12 @@ void CallAngel(void); void angel_toggle_pause(); void angel_load_my_fullnick(char *buf, int szbuf); // full nick! const char *angel_get_nick(); +void pressanykey_or_callangel(void); +#ifdef PLAY_ANGEL +#define PRESSANYKEY() pressanykey_or_callangel() +#else // !PLAY_ANGEL +#define PRESSANYKEY() pressanykey() +#endif /* announce */ int a_menu(const char *maintitle, const char *path, int lastlevel, int lastbid, char *trans_buffer); @@ -598,13 +604,9 @@ int search_aidu(char *bfile, aidu_t aidu); int log_user(const char *fmt, ...) GCC_CHECK_FORMAT(1,2); time4_t gettime(int line, time4_t dt, const char* head); void setcalfile(char *buf, char *userid); -void stand_title(const char *title); char getans(const char *fmt,...) GCC_CHECK_FORMAT(1,2); -int getkey(const char *fmt,...) GCC_CHECK_FORMAT(1,2); -int vmsgf(const char *fmt,...) GCC_CHECK_FORMAT(1,2); -int vmsg(const char *msg); -int show_file(const char *filename, int y, int lines, int mode); -void bell(void); +int getkey(const char *fmt,...) GCC_CHECK_FORMAT(1,2); +int show_file(const char *filename, int y, int lines, int mode); int cursor_key(int row, int column); int search_num(int ch, int max); int is_BM(const char *list); @@ -628,9 +630,6 @@ int is_uBM(const char *list, const char *id); void *MALLOC(int size); void FREE(void *ptr); #endif -#ifdef PLAY_ANGEL -void pressanykey_or_callangel(void); -#endif void syncnow(void); /* syspost */ @@ -681,8 +680,9 @@ int j_ticket_main(void); /* term */ void init_tty(void); -int term_init(void); +int term_init(void); void term_resize(int w, int h); +void bell(void); /* topsong */ void sortsong(void); diff --git a/include/visio.h b/include/visio.h index e4241c52..542fab28 100644 --- a/include/visio.h +++ b/include/visio.h @@ -11,17 +11,53 @@ #include "ansi.h" // we need it. // THEME DEFINITION ---------------------------------------------------- +#define VCLR_HEADER ANSI_COLOR(1;37;46) // was: TITLE_COLOR +#define VCLR_HEADER_MID ANSI_COLOR(1;33;46) +#define VCLR_HEADER_RIGHT ANSI_COLOR(1;37;46) +#define VCLR_HDR ANSI_COLOR(1;37;46) #define VCLR_FOOTER_CAPTION ANSI_COLOR(0;34;46) #define VCLR_FOOTER ANSI_COLOR(0;30;47) #define VCLR_FOOTER_QUOTE ANSI_COLOR(0;31;47) +#define VCLR_MSG_FLOAT ANSI_COLOR(1;33;46) +#define VCLR_MSG ANSI_COLOR(1;36;44) +#define VCLR_PAUSE_PAD ANSI_COLOR(1;34;44) +#define VCLR_PAUSE ANSI_COLOR(1;37;44) + +#define VMSG_PAUSE " 請按任意鍵繼續 " +#define VMSG_PAUSE_PAD "▄" +#define VMSG_MSG_FLOAT " [按任意鍵繼續]" +#define VMSG_MSG_PREFIX " ◆ " +#define VMSG_HDR_PREFIX "【 " +#define VMSG_HDR_POSTFIX " 】" + +// DATATYPE DEFINITION ------------------------------------------------- +typedef void * VSOREF; // generic visio object reference // API DEFINITION ---------------------------------------------------- -// int vmsg(char *msg); -// int vmsgf(const char *fmt,...); // int vans(char *prompt); // prompt at bottom and return y/n in lower case. -// void vs_bar(char *title); e// like stand_title -void vfooter(const char *caption, const char *prompt); -void vbarf (const char *s, ...); -void vbar (const char *l, const char *r); +// void vs_bar(char *title); // like stand_title +void vpad (int n, const char *pattern); +void vbarf (const char *s, ...) GCC_CHECK_FORMAT(1,2); +void vbarlr (const char *l, const char *r); +int vmsgf (const char *fmt,...) GCC_CHECK_FORMAT(1,2); +int vmsg (const char *msg); +int vansf (const char *fmt,...) GCC_CHECK_FORMAT(1,2); +int vans (const char *msg); +void vshowmsg(const char *msg); + +// vs_*: formatted and themed virtual screen layout +// you cannot use ANSI escapes in these APIs. +void vs_header (const char *title, const char *mid, const char *right); // vs_head, showtitle +void vs_hdr (const char *title); // vs_bar, stand_title +void vs_footer (const char *caption, const char *prompt); + +// compatible macros +#define stand_title vs_hdr + +// VSOREF API +VSOREF vscr_save (void); +void vscr_restore(VSOREF); +VSOREF vcur_save (void); +void vcur_restore(VSOREF); #endif // _VISIO_H |