]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/bmtable.h
get rid of broken_header.h and some unneeded tests
[lyx.git] / src / frontends / xforms / bmtable.h
1 /**
2  * \file bmtable.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Alejandro Aguilar Sierra
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 /** A bitmap table uses a single bitmap to simulate a 2d array
12  *  of bitmap buttons. It can be used to build bitmap menus.
13  */
14
15 #ifndef BMTABLE_H
16 #define BMTABLE_H
17
18
19 #include "lyx_forms.h"
20
21 #if defined(__cplusplus)
22 extern "C"
23 {
24 #endif
25
26 /**/
27 #define FL_BMTABLE 1500
28 /* A flat bitmap table */
29 #define FL_BMTABLE_FLAT 0
30 /* A grided bitmap table */
31 #define FL_BMTABLE_GRID 1
32
33
34 /*  Same as fl_bitmapbutton */
35
36
37 /**
38  *  normal bmtable default
39  */
40 #define FL_BMTABLE_BOXTYPE      FL_UP_BOX
41
42
43 /**/
44 FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord,
45                              FL_Coord, FL_Coord, char const *);
46 /**/
47 FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord,
48                           FL_Coord, FL_Coord, char const *);
49
50 /** Same as fl_get_button_numb() */
51 int fl_get_bmtable_numb(FL_OBJECT *ob);
52 /**/
53 void fl_set_bmtable(FL_OBJECT *, int pushed, int pos);
54
55 /** Number of columns and rows, and the background bitmap */
56 void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int, unsigned char const *);
57 /**/
58 void fl_set_bmtable_pixmap_data(FL_OBJECT *, int, int, char **);
59 /**/
60 void fl_set_bmtable_file(FL_OBJECT *, int, int, char const *);
61 /**/
62 void fl_set_bmtable_pixmap_file(FL_OBJECT *, int, int, char const *);
63
64 /** Adjust bitmap origin (ox, oy) and cell dimensions (dx, dy) incrementally */
65 void fl_set_bmtable_adjust(FL_OBJECT *, int ox, int oy, int dx, int dy);
66
67 /** The number of items is by default nc x nr, but you can change it */
68 void fl_set_bmtable_maxitems(FL_OBJECT *, int);
69 /**/
70 int fl_get_bmtable_maxitems(FL_OBJECT *);
71
72 /** Returns the index of the selected item or -1 if none was selected */
73 int fl_get_bmtable(FL_OBJECT *);
74
75 /** Replace an item's sub_bitmap at id position */
76 void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int  cw, int ch, char *data);
77
78 /** Get the sub_bitmap from id position. You must alloc memory for the data. */
79 void fl_get_bmtable_item(FL_OBJECT *ob, int id, int *cw, int *ch, char *data);
80
81 /** Returns a pixmap from the table, if available. */
82 Pixmap fl_get_bmtable_pixmap(FL_OBJECT *);
83
84 /** Draws a single item on a drawable */
85 void fl_draw_bmtable_item(FL_OBJECT *ob, int i, Drawable d, int xx, int yy);
86
87 /** Free the current bitmap in preparation for installing a new one */
88 void fl_free_bmtable_bitmap(FL_OBJECT *ob);
89
90 /** Free the current pixmap in preparation for installing a new one */
91 void fl_free_bmtable_pixmap(FL_OBJECT *ob);
92
93 #if defined(__cplusplus)
94 }
95 #endif
96
97 #endif  /* BMTABLE_H */