]> git.decadent.org.uk Git - ion3.git/blob - mod_query/listing.h
b4d10f06dca7b0612377ab6a0ec37d5f8063e33e
[ion3.git] / mod_query / listing.h
1 /*
2  * ion/mod_query/listing.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_LISTING_H
13 #define ION_MOD_QUERY_LISTING_H
14
15 #include <ioncore/common.h>
16 #include <ioncore/gr.h>
17 #include <ioncore/rectangle.h>
18
19 INTRSTRUCT(WListing);
20 INTRSTRUCT(WListingItemInfo);
21
22 DECLSTRUCT(WListingItemInfo){
23     int len;
24     int n_parts;
25     int *part_lens;
26 };
27
28 DECLSTRUCT(WListing){
29     char **strs;
30     WListingItemInfo *iteminfos;
31     int nstrs;
32     int selected_str;
33     int ncol, nrow, nitemcol, visrow;
34     int firstitem, firstoff;
35     int itemw, itemh, toth;
36     bool onecol;
37 };
38
39 extern void init_listing(WListing *l);
40 extern void setup_listing(WListing *l, char **strs, int nstrs, bool onecol);
41 extern void deinit_listing(WListing *l);
42 extern void fit_listing(GrBrush *brush, const WRectangle *geom, WListing *l);
43 extern void draw_listing(GrBrush *brush, const WRectangle *geom, WListing *l, 
44                          bool complete, GrAttr selattr);
45 extern bool scrollup_listing(WListing *l);
46 extern bool scrolldown_listing(WListing *l);
47 extern bool listing_select(WListing *l, int i);
48
49 #endif /* ION_MOD_QUERY_LISTING_H */