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