Use C-style comments rather than C++-style
[notion.git] / mod_query / listing.h
blob2b2a215aeffdcdbdfc1ee1224f2cc5442af8c64f
1 /*
2 * ion/mod_query/listing.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
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>
17 INTRSTRUCT(WListing);
18 INTRSTRUCT(WListingItemInfo);
20 DECLSTRUCT(WListingItemInfo){
21 int len;
22 int n_parts;
23 int *part_lens;
26 DECLSTRUCT(WListing){
27 char **strs;
28 WListingItemInfo *iteminfos;
29 int nstrs;
30 int selected_str;
31 int ncol, nrow, nitemcol, visrow;
32 int firstitem, firstoff;
33 int itemw, itemh, toth;
34 bool onecol;
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 */