]> git.decadent.org.uk Git - ion3.git/blob - mod_query/listing.h
[svn-upgrade] Integrating new upstream version, ion3 (20070506)
[ion3.git] / mod_query / listing.h
1 /*
2  * ion/mod_query/listing.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_MOD_QUERY_LISTING_H
10 #define ION_MOD_QUERY_LISTING_H
11
12 #include <ioncore/common.h>
13 #include <ioncore/gr.h>
14 #include <ioncore/rectangle.h>
15
16 INTRSTRUCT(WListing);
17 INTRSTRUCT(WListingItemInfo);
18
19 DECLSTRUCT(WListingItemInfo){
20     int len;
21     int n_parts;
22     int *part_lens;
23 };
24
25 DECLSTRUCT(WListing){
26     char **strs;
27     WListingItemInfo *iteminfos;
28     int nstrs;
29     int selected_str;
30     int ncol, nrow, nitemcol, visrow;
31     int firstitem, firstoff;
32     int itemw, itemh, toth;
33     bool onecol;
34 };
35
36 extern void init_listing(WListing *l);
37 extern void setup_listing(WListing *l, char **strs, int nstrs, bool onecol);
38 extern void deinit_listing(WListing *l);
39 extern void fit_listing(GrBrush *brush, const WRectangle *geom, WListing *l);
40 extern void draw_listing(GrBrush *brush, const WRectangle *geom, WListing *l, 
41                          bool complete, GrAttr selattr);
42 extern bool scrollup_listing(WListing *l);
43 extern bool scrolldown_listing(WListing *l);
44 extern bool listing_select(WListing *l, int i);
45
46 #endif /* ION_MOD_QUERY_LISTING_H */