2002-03-11 17:00:41 +00:00
|
|
|
/**
|
|
|
|
* \file bmtable.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2002-03-11 17:00:41 +00:00
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-03-11 17:00:41 +00:00
|
|
|
*/
|
|
|
|
|
2003-07-18 12:22:19 +00:00
|
|
|
/** A bitmap table uses a single bitmap to simulate a 2d array
|
|
|
|
* of bitmap buttons. It can be used to build bitmap menus.
|
2002-03-11 17:00:41 +00:00
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-15 12:01:38 +00:00
|
|
|
#ifndef BMTABLE_H
|
2002-03-21 21:21:28 +00:00
|
|
|
#define BMTABLE_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
2003-05-14 09:17:22 +00:00
|
|
|
#include "lyx_forms.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-12-21 06:10:21 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
1999-09-27 18:44:28 +00:00
|
|
|
#define FL_BMTABLE 1500
|
2000-04-03 11:36:35 +00:00
|
|
|
/* A flat bitmap table */
|
1999-09-27 18:44:28 +00:00
|
|
|
#define FL_BMTABLE_FLAT 0
|
2000-04-03 11:36:35 +00:00
|
|
|
/* A grided bitmap table */
|
1999-09-27 18:44:28 +00:00
|
|
|
#define FL_BMTABLE_GRID 1
|
|
|
|
|
|
|
|
|
|
|
|
/* Same as fl_bitmapbutton */
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* normal bmtable default
|
|
|
|
*/
|
|
|
|
#define FL_BMTABLE_BOXTYPE FL_UP_BOX
|
|
|
|
|
1999-12-21 06:10:21 +00:00
|
|
|
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
2002-03-21 21:21:28 +00:00
|
|
|
FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord,
|
1999-09-27 18:44:28 +00:00
|
|
|
FL_Coord, FL_Coord, char const *);
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
2002-03-21 21:21:28 +00:00
|
|
|
FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord,
|
1999-09-27 18:44:28 +00:00
|
|
|
FL_Coord, FL_Coord, char const *);
|
|
|
|
|
|
|
|
/** Same as fl_get_button_numb() */
|
|
|
|
int fl_get_bmtable_numb(FL_OBJECT *ob);
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
1999-09-27 18:44:28 +00:00
|
|
|
void fl_set_bmtable(FL_OBJECT *, int pushed, int pos);
|
|
|
|
|
|
|
|
/** Number of columns and rows, and the background bitmap */
|
2002-08-15 16:02:22 +00:00
|
|
|
void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int, unsigned char const *);
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
1999-09-27 18:44:28 +00:00
|
|
|
void fl_set_bmtable_pixmap_data(FL_OBJECT *, int, int, char **);
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
1999-09-27 18:44:28 +00:00
|
|
|
void fl_set_bmtable_file(FL_OBJECT *, int, int, char const *);
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
1999-09-27 18:44:28 +00:00
|
|
|
void fl_set_bmtable_pixmap_file(FL_OBJECT *, int, int, char const *);
|
|
|
|
|
|
|
|
/** Adjust bitmap origin (ox, oy) and cell dimensions (dx, dy) incrementally */
|
|
|
|
void fl_set_bmtable_adjust(FL_OBJECT *, int ox, int oy, int dx, int dy);
|
|
|
|
|
|
|
|
/** The number of items is by default nc x nr, but you can change it */
|
|
|
|
void fl_set_bmtable_maxitems(FL_OBJECT *, int);
|
2000-04-03 11:36:35 +00:00
|
|
|
/**/
|
2002-03-21 21:21:28 +00:00
|
|
|
int fl_get_bmtable_maxitems(FL_OBJECT *);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** Returns the index of the selected item or -1 if none was selected */
|
|
|
|
int fl_get_bmtable(FL_OBJECT *);
|
|
|
|
|
|
|
|
/** Replace an item's sub_bitmap at id position */
|
2002-03-21 21:21:28 +00:00
|
|
|
void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int cw, int ch, char *data);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
/** Get the sub_bitmap from id position. You must alloc memory for the data. */
|
1999-09-27 18:44:28 +00:00
|
|
|
void fl_get_bmtable_item(FL_OBJECT *ob, int id, int *cw, int *ch, char *data);
|
|
|
|
|
|
|
|
/** Returns a pixmap from the table, if available. */
|
|
|
|
Pixmap fl_get_bmtable_pixmap(FL_OBJECT *);
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
/** Draws a single item on a drawable */
|
1999-09-27 18:44:28 +00:00
|
|
|
void fl_draw_bmtable_item(FL_OBJECT *ob, int i, Drawable d, int xx, int yy);
|
|
|
|
|
|
|
|
/** Free the current bitmap in preparation for installing a new one */
|
|
|
|
void fl_free_bmtable_bitmap(FL_OBJECT *ob);
|
|
|
|
|
|
|
|
/** Free the current pixmap in preparation for installing a new one */
|
|
|
|
void fl_free_bmtable_pixmap(FL_OBJECT *ob);
|
|
|
|
|
1999-12-21 06:10:21 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1999-11-15 12:01:38 +00:00
|
|
|
#endif /* BMTABLE_H */
|