Remove/mark some unused functions and parameters
[notion.git] / mod_query / query.c
blob0f5549c124f83adbc1b0f18dd95d78448c839fc8
1 /*
2 * ion/mod_query/query.c
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #include <libextl/extl.h>
11 #include <ioncore/common.h>
12 #include <ioncore/global.h>
13 #include <ioncore/binding.h>
14 #include <ioncore/regbind.h>
15 #include <ioncore/bindmaps.h>
16 #include <ioncore/stacking.h>
17 #include <ioncore/key.h>
18 #include "query.h"
19 #include "wedln.h"
22 /*--lowlevel routine not to be called by the user--EXTL_DOC
23 * Show a query window in \var{mplex} with prompt \var{prompt}, initial
24 * contents \var{dflt}. The function \var{handler} is called with
25 * the entered string as the sole argument when \fnref{WEdln.finish}
26 * is called. The function \var{completor} is called with the created
27 * \type{WEdln} is first argument and the string to complete is the
28 * second argument when \fnref{WEdln.complete} is called.
30 EXTL_EXPORT
31 WEdln *mod_query_do_query(WMPlex *mplex, const char *prompt, const char *dflt,
32 ExtlFn handler, ExtlFn completor,
33 ExtlFn cycle, ExtlFn bcycle)
35 WEdlnCreateParams fnp;
36 WMPlexAttachParams par;
37 WEdln *wedln;
39 fnp.prompt=prompt;
40 fnp.dflt=dflt;
41 fnp.handler=handler;
42 fnp.completor=completor;
44 par.flags=(MPLEX_ATTACH_SWITCHTO|
45 MPLEX_ATTACH_LEVEL|
46 MPLEX_ATTACH_UNNUMBERED|
47 MPLEX_ATTACH_SIZEPOLICY);
48 par.szplcy=SIZEPOLICY_FULL_BOUNDS;
49 par.level=STACKING_LEVEL_MODAL1+2;
51 wedln=(WEdln*)mplex_do_attach_new(mplex, &par,
52 (WRegionCreateFn*)create_wedln,
53 (void*)&fnp);
55 if(wedln!=NULL && cycle!=extl_fn_none()){
56 uint kcb, state;
57 bool sub;
59 if(ioncore_current_key(&kcb, &state, &sub) && !sub){
60 wedln->cycle_bindmap=region_add_cycle_bindmap((WRegion*)wedln,
61 kcb, state, cycle,
62 bcycle);
66 return wedln;