2 * ion/mod_query/wedln-wrappers.c
4 * Copyright (c) Tuomo Valkonen 1999-2007.
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.
17 * Move backward one character.
20 void wedln_back(WEdln *wedln)
22 edln_back(&(wedln->edln));
26 * Move forward one character.
29 void wedln_forward(WEdln *wedln)
31 edln_forward(&(wedln->edln));
35 * Transpose characters.
38 void wedln_transpose_chars(WEdln *wedln)
40 edln_transpose_chars(&(wedln->edln));
47 void wedln_transpose_words(WEdln *wedln)
49 edln_transpose_words(&(wedln->edln));
53 * Go to the beginning of line.
56 void wedln_bol(WEdln *wedln)
58 edln_bol(&(wedln->edln));
62 * Go to the end of line.
65 void wedln_eol(WEdln *wedln)
67 edln_eol(&(wedln->edln));
71 * Go to to end of current sequence of whitespace followed by alphanumeric
75 void wedln_skip_word(WEdln *wedln)
77 edln_skip_word(&(wedln->edln));
81 * Go to to beginning of current sequence of alphanumeric characters
82 * followed by whitespace.
85 void wedln_bskip_word(WEdln *wedln)
87 edln_bskip_word(&(wedln->edln));
91 * Delete current character.
94 void wedln_delete(WEdln *wedln)
96 edln_delete(&(wedln->edln));
100 * Delete previous character.
103 void wedln_backspace(WEdln *wedln)
105 edln_backspace(&(wedln->edln));
109 * Delete all characters from current to end of line.
112 void wedln_kill_to_eol(WEdln *wedln)
114 edln_kill_to_eol(&(wedln->edln));
118 * Delete all characters from previous to beginning of line.
121 void wedln_kill_to_bol(WEdln *wedln)
123 edln_kill_to_bol(&(wedln->edln));
127 * Delete the whole line.
130 void wedln_kill_line(WEdln *wedln)
132 edln_kill_line(&(wedln->edln));
136 * Starting from the current point, delete possible whitespace and
137 * following alphanumeric characters until next non-alphanumeric character.
140 void wedln_kill_word(WEdln *wedln)
142 edln_kill_word(&(wedln->edln));
146 * Starting from the previous characters, delete possible whitespace and
147 * preceding alphanumeric characters until previous non-alphanumeric character.
150 void wedln_bkill_word(WEdln *wedln)
152 edln_bkill_word(&(wedln->edln));
156 * Set \emph{mark} to current cursor position.
159 void wedln_set_mark(WEdln *wedln)
161 edln_set_mark(&(wedln->edln));
168 void wedln_clear_mark(WEdln *wedln)
170 edln_clear_mark(&(wedln->edln));
174 * Copy text between \emph{mark} and current cursor position to clipboard
175 * and then delete that sequence.
178 void wedln_cut(WEdln *wedln)
180 edln_cut(&(wedln->edln));
184 * Copy text between \emph{mark} and current cursor position to clipboard.
187 void wedln_copy(WEdln *wedln)
189 edln_copy(&(wedln->edln));
193 * Replace line editor contents with next entry in history if one exists.
194 * If \var{match} is \code{true}, the initial part of the history entry
195 * must match the current line from beginning to point.
198 void wedln_history_next(WEdln *wedln, bool match)
200 edln_history_next(&(wedln->edln), match);
204 * Replace line editor contents with previous in history if one exists.
205 * If \var{match} is \code{true}, the initial part of the history entry
206 * must match the current line from beginning to point.
209 void wedln_history_prev(WEdln *wedln, bool match)
211 edln_history_prev(&(wedln->edln), match);
216 * Input \var{str} in wedln at current editing point.
218 EXTL_EXPORT_AS(WEdln, insstr)
219 void wedln_insstr_exported(WEdln *wedln, const char *str)
221 edln_insstr(&(wedln->edln), str);
226 * Get line editor contents.
230 const char *wedln_contents(WEdln *wedln)
232 return wedln->edln.p;
236 * Get current editing point.
237 * Beginning of the edited line is point 0.
241 int wedln_point(WEdln *wedln)
243 return wedln->edln.point;
247 * Get current mark (start of selection) for \var{wedln}.
248 * Return value of -1 indicates that there is no mark, and
249 * 0 is the beginning of the line.
253 int wedln_mark(WEdln *wedln)
255 return wedln->edln.mark;
260 * Set history context for \var{wedln}.
263 void wedln_set_context(WEdln *wedln, const char *context)
265 edln_set_context(&(wedln->edln), context);
270 * Get history context for \var{wedln}.
274 const char *wedln_context(WEdln *wedln)
276 return wedln->edln.context;