summaryrefslogtreecommitdiffstats
path: root/include/visio.h
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-17 20:02:18 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-17 20:02:18 +0800
commit0487addce5ddefe4bbd9736aaa46644271787315 (patch)
treee0034cf1af134a584e8b328288b8a110e0bc570c /include/visio.h
parent1b0e3ccd58a342a56779dd843abd0f5e3f1c9dea (diff)
downloadpttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar
pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.gz
pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.bz2
pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.lz
pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.xz
pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.tar.zst
pttbbs-0487addce5ddefe4bbd9736aaa46644271787315.zip
- (internal) change chat to use vgetstring with new callback system
- (internal) move DBCS API to string lib git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'include/visio.h')
-rw-r--r--include/visio.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/visio.h b/include/visio.h
index aafcd0af..bfc9c945 100644
--- a/include/visio.h
+++ b/include/visio.h
@@ -71,12 +71,17 @@ typedef struct {
} VCOL;
-typedef int (*VGET_CALLBACK)(char *buf, int *pcurr, int len, void *ptr);
+#define VGETCB_NONE (0) // do nothing
+#define VGETCB_NEXT (1) // skip to next event loop
+#define VGETCB_END (2) // finish input
+#define VGETCB_ABORT (3) // clear buffer and finish
+
+typedef int (*VGET_FCALLBACK)(int key, char *buf, int *picurr, int *piend, int len, void *param);
typedef struct {
- VGET_CALLBACK peek; // called immediately after key hit
- VGET_CALLBACK accept; // called before inserting character data
- // ... ?
-} VGET_EXTENSION;
+ VGET_FCALLBACK peek; // called immediately after key hit
+ VGET_FCALLBACK data; // called before inserting character data
+ VGET_FCALLBACK post; // called after every data inserted into buffer.
+} VGET_CALLBACKS;
// API DEFINITION ----------------------------------------------------
@@ -108,7 +113,8 @@ void vshowmsg(const char *msg); /// draw standard pause/message
// vget: (y, x, ...)
int vgets (char *buf, int len, int flags); /// input with edit box control
int vgetstr (char *buf, int len, int flags, const char *str);/// input with default value
-int vget(int y, int x, const char *prompt, char *buf, int len, int mode);
+int vget (int y, int x, const char *prompt, char *buf, int len, int mode);
+int vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBACKS *pcb, void *cbparam);
// vs_*: formatted and themed virtual screen layout
// you cannot use ANSI escapes in these APIs.