2 * ion/mod_query/listing.h
4 * Copyright (c) Tuomo Valkonen 1999-2008.
6 * See the included file LICENSE for details.
9 #ifndef ION_MOD_QUERY_LISTING_H
10 #define ION_MOD_QUERY_LISTING_H
12 #include <ioncore/common.h>
13 #include <ioncore/gr.h>
14 #include <ioncore/rectangle.h>
15 #include <libtu/minmax.h>
18 INTRSTRUCT(WListingItemInfo);
20 DECLSTRUCT(WListingItemInfo){
28 WListingItemInfo *iteminfos;
31 int ncol, nrow, nitemcol, visrow;
32 int firstitem, firstoff;
33 int itemw, itemh, toth;
38 #define LISTING_DRAW_COMPLETE 1
39 #define LISTING_DRAW_ALL 0
40 #define LISTING_DRAW_SELECTED(X) minof(-1, -(X)-2)
41 #define LISTING_DRAW_GET_SELECTED(X) (-(X)-2)
44 extern void init_listing(WListing *l);
45 extern void setup_listing(WListing *l, char **strs, int nstrs, bool onecol);
46 extern void deinit_listing(WListing *l);
47 extern void fit_listing(GrBrush *brush, const WRectangle *geom, WListing *l);
48 extern void draw_listing(GrBrush *brush, const WRectangle *geom, WListing *l,
49 bool complete, GrAttr selattr);
50 extern bool scrollup_listing(WListing *l);
51 extern bool scrolldown_listing(WListing *l);
52 extern bool listing_select(WListing *l, int i);
54 #endif /* ION_MOD_QUERY_LISTING_H */