]> git.decadent.org.uk Git - ion3.git/blob - mod_query/edln.h
ea00f6f63c3139b4da3b7c0b4452ff7be9c36117
[ion3.git] / mod_query / edln.h
1 /*
2  * ion/mod_query/edln.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_EDLN_H
13 #define ION_MOD_QUERY_EDLN_H
14
15 #include <ioncore/common.h>
16 #include <libtu/obj.h>
17
18 INTRSTRUCT(Edln);
19
20 typedef void EdlnUpdateHandler(void*, int from, int mode);
21
22 #define EDLN_UPDATE_MOVED   0x01
23 #define EDLN_UPDATE_CHANGED 0x02
24 #define EDLN_UPDATE_NEW     0x04
25         
26 DECLSTRUCT(Edln){
27     char *p;
28     char *tmp_p;
29     int point;
30     int mark;
31     int psize;
32     int palloced;
33     int tmp_palloced;
34     int modified;
35     int histent;
36     void *uiptr;
37     char *context;
38
39     EdlnUpdateHandler *ui_update;
40 };
41
42
43 bool edln_insstr(Edln *edln, const char *str);
44 bool edln_insstr_n(Edln *edln, const char *str, int len,
45                    bool update, bool movepoint);
46 bool edln_transpose_chars(Edln *edln);
47 bool edln_transpose_words(Edln *edln);
48 void edln_back(Edln *edln);
49 void edln_forward(Edln *edln);
50 void edln_bol(Edln *edln);
51 void edln_eol(Edln *edln);
52 void edln_bskip_word(Edln *edln);
53 void edln_skip_word(Edln *edln);
54 void edln_set_point(Edln *edln, int point);
55 void edln_delete(Edln *edln);
56 void edln_backspace(Edln *edln);
57 void edln_kill_to_eol(Edln *edln);
58 void edln_kill_to_bol(Edln *edln);
59 void edln_kill_line(Edln *edln);
60 void edln_kill_word(Edln *edln);
61 void edln_bkill_word(Edln *edln);
62 void edln_set_mark(Edln *edln);
63 void edln_clear_mark(Edln *edln);
64 void edln_cut(Edln *edln);
65 void edln_copy(Edln *edln);
66 void edln_history_prev(Edln *edln, bool match);
67 void edln_history_next(Edln *edln, bool match);
68 uint edln_history_matches(Edln *edln, char ***h_ret);
69 bool edln_set_context(Edln *edln, const char *str);
70
71 bool edln_init(Edln *edln, const char *dflt);
72 void edln_deinit(Edln *edln);
73 char* edln_finish(Edln *edln);
74
75 #endif /* ION_MOD_QUERY_EDLN_H */