]> git.decadent.org.uk Git - ion3.git/blob - mod_query/wedln.h
e20a7c9ddf91e55447884623c9b0dc056ee8b4c9
[ion3.git] / mod_query / wedln.h
1 /*
2  * ion/mod_query/wedln.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2008. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_MOD_QUERY_WEDLN_H
10 #define ION_MOD_QUERY_WEDLN_H
11
12 #include <libtu/obj.h>
13 #include <libextl/extl.h>
14 #include <libmainloop/signal.h>
15 #include <ioncore/common.h>
16 #include <ioncore/window.h>
17 #include <ioncore/xic.h>
18 #include <ioncore/rectangle.h>
19 #include <ioncore/binding.h>
20 #include "listing.h"
21 #include "input.h"
22 #include "edln.h"
23
24 INTRCLASS(WEdln);
25 INTRSTRUCT(WEdlnCreateParams);
26
27 DECLSTRUCT(WEdlnCreateParams){
28     const char *prompt;
29     const char *dflt;
30     ExtlFn handler;
31     ExtlFn completor;
32 };
33
34
35 DECLCLASS(WEdln){
36     WInput input;
37
38     Edln edln;
39
40     char *prompt;
41     int prompt_len;
42     int prompt_w;
43     
44     char *info;
45     int info_len;
46     int info_w;
47     
48     int vstart;
49     
50     ExtlFn handler;
51     ExtlFn completor;
52     
53     WTimer *autoshowcompl_timer;
54     
55     WListing compl_list;
56     char *compl_beg;
57     char *compl_end;
58     int compl_waiting_id;
59     int compl_current_id;
60     int compl_timed_id;
61     uint compl_tab:1;
62     uint compl_history_mode:1;
63     
64     WBindmap *cycle_bindmap;
65 };
66
67 extern WEdln *create_wedln(WWindow *par, const WFitParams *fp,
68                            WEdlnCreateParams *p);
69 extern void wedln_finish(WEdln *wedln);
70 extern void wedln_paste(WEdln *wedln);
71 extern void wedln_draw(WEdln *wedln, bool complete);
72 extern void wedln_set_completions(WEdln *wedln, ExtlTab completions,
73                                   bool autoshow_select_first);
74 extern void wedln_hide_completions(WEdln *wedln);
75 extern bool wedln_set_histcompl(WEdln *wedln, int sp);
76 extern bool wedln_get_histcompl(WEdln *wedln);
77
78 #endif /* ION_MOD_QUERY_WEDLN_H */