From 54b3f1e9c08c91e07a87cf57282490a546b93a44 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 9 Dec 2006 18:03:18 +0000 Subject: Support, in the winhelp module only, for adding pictures to .HLP files. Halibut does not make use of this feature, but I hope that one day it might. [originally from svn r6980] --- winhelp.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'winhelp.h') diff --git a/winhelp.h b/winhelp.h index d0c81d5..b22e4e0 100644 --- a/winhelp.h +++ b/winhelp.h @@ -166,3 +166,33 @@ void whlp_text(WHLP h, char *text); void whlp_start_hyperlink(WHLP h, WHLP_TOPIC target); void whlp_end_hyperlink(WHLP h); void whlp_tab(WHLP h); + +/* + * Routines to add images to a help file. + * + * First call whlp_add_picture() to load some actual image data + * into a help file. This will return a numeric index which + * identifies the picture. Then you can call whlp_ref_picture() to + * indicate that that picture should be displayed inline in the + * current paragraph (i.e. it occurs between a call to + * whlp_begin_para() and whlp_end_para()). + */ + +/* + * The parameters to this function are: + * + * - wd and ht give the width and height of the image in pixels. + * - picdata is a pointer to the actual bitmap data. This _must_ + * be formatted as one byte per pixel, with each byte being an + * index into the `palette' array. Ordering is the normal one + * (top to bottom, left to right), not the Windows BMP one. + * - palettelen is an array of up to 256 unsigned longs. Each + * unsigned long represents an RGB value, in the form + * 0x00RRGGBB. Thus 0x00FF0000 is red, 0x00FF00 is green, + * 0x000000FF is blue, 0x00FFFFFF is white, zero is black, and + * so on. You may supply fewer than 256 entries if the image + * data does not refer to all possible values. + */ +int whlp_add_picture(WHLP h, int wd, int ht, const void *picdata, + const unsigned long *palette); +void whlp_ref_picture(WHLP h, int index); -- cgit v1.1