]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/bmtable.h
Added // -*- C++ -*- to the top of all files in controllers/ and xforms/
[lyx.git] / src / frontends / xforms / bmtable.h
1 // -*- C++ -*-
2 /*
3  *  File:        bmtable.h
4  *  Purpose:     Declaration of the XForms object bmtable. 
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     November 1995
7  *  Description: A bitmap table uses a single bitmap to simulate a 2d array 
8  *               of bitmap buttons. It can be used to build bitmap menus.
9  *               
10  *  Copyright 1995, 1996 Alejandro Aguilar Sierra 
11  *
12  *  You are free to use and modify this code under the terms of
13  *  the GNU General Public Licence version 2 or later. 
14  * 
15  */ 
16
17 #ifndef BMTABLE_H
18 #define BMTABLE_H 
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include FORMS_H_LOCATION
25
26 #if defined(__cplusplus)
27 extern "C"
28 {
29 #endif
30
31 /**/
32 #define FL_BMTABLE 1500
33 /* A flat bitmap table */
34 #define FL_BMTABLE_FLAT 0
35 /* A grided bitmap table */
36 #define FL_BMTABLE_GRID 1
37
38
39 /*  Same as fl_bitmapbutton */
40
41
42 /**
43  *  normal bmtable default
44  */
45 #define FL_BMTABLE_BOXTYPE      FL_UP_BOX
46
47
48 /**/
49 FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord, 
50                              FL_Coord, FL_Coord, char const *);
51 /**/
52 FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord, 
53                           FL_Coord, FL_Coord, char const *);
54
55 /** Same as fl_get_button_numb() */
56 int fl_get_bmtable_numb(FL_OBJECT *ob);
57 /**/
58 void fl_set_bmtable(FL_OBJECT *, int pushed, int pos);
59
60 /** Number of columns and rows, and the background bitmap */
61 void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int , unsigned char const *);
62 /**/
63 void fl_set_bmtable_pixmap_data(FL_OBJECT *, int, int, char **);
64 /**/
65 void fl_set_bmtable_file(FL_OBJECT *, int, int, char const *);
66 /**/
67 void fl_set_bmtable_pixmap_file(FL_OBJECT *, int, int, char const *);
68
69 /** Adjust bitmap origin (ox, oy) and cell dimensions (dx, dy) incrementally */
70 void fl_set_bmtable_adjust(FL_OBJECT *, int ox, int oy, int dx, int dy);
71
72 /** The number of items is by default nc x nr, but you can change it */
73 void fl_set_bmtable_maxitems(FL_OBJECT *, int);
74 /**/
75 int fl_get_bmtable_maxitems(FL_OBJECT *); 
76
77 /** Returns the index of the selected item or -1 if none was selected */
78 int fl_get_bmtable(FL_OBJECT *);
79
80 /** Replace an item's sub_bitmap at id position */
81 void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int  cw, int ch, char *data); 
82
83 /** Get the sub_bitmap from id position. You must alloc memory for the data. */ 
84 void fl_get_bmtable_item(FL_OBJECT *ob, int id, int *cw, int *ch, char *data);
85
86 /** Returns a pixmap from the table, if available. */
87 Pixmap fl_get_bmtable_pixmap(FL_OBJECT *);
88
89 /** Draws a single item on a drawable */ 
90 void fl_draw_bmtable_item(FL_OBJECT *ob, int i, Drawable d, int xx, int yy);
91
92 /** Free the current bitmap in preparation for installing a new one */
93 void fl_free_bmtable_bitmap(FL_OBJECT *ob);
94
95 /** Free the current pixmap in preparation for installing a new one */
96 void fl_free_bmtable_pixmap(FL_OBJECT *ob);
97
98 #if defined(__cplusplus)
99 }
100 #endif
101
102 #endif  /* BMTABLE_H */
103