From 70abac1b8b995dc78ec312eb52f8724161b11b75 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 24 Nov 2001 02:46:19 +0000 Subject: Fix bugs in copy() methods. Add Fl_Shared_Image class, with get() and release() methods. Update Fl_Help_View to use Fl_Shared_Image class. Update image demo to accept a filename, and to use the Fl_Shared_Image class. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1714 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Help_View.H | 49 +++++++++++-------------------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) (limited to 'FL/Fl_Help_View.H') diff --git a/FL/Fl_Help_View.H b/FL/Fl_Help_View.H index c81bb059c..d2d226121 100644 --- a/FL/Fl_Help_View.H +++ b/FL/Fl_Help_View.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Help_View.H,v 1.1.2.3 2001/10/29 03:44:31 easysw Exp $" +// "$Id: Fl_Help_View.H,v 1.1.2.4 2001/11/24 02:46:19 easysw Exp $" // // Help Viewer widget definitions. // @@ -24,18 +24,19 @@ // Please report all bugs and problems to "fltk-bugs@fltk.org". // -#ifndef _Fl_Help_View_H_ -# define _Fl_Help_View_H_ +#ifndef Fl_Help_View_H +# define Fl_Help_View_H // // Include necessary header files... // # include -# include -# include -# include -# include +# include "Fl.H" +# include "Fl_Group.H" +# include "Fl_Scrollbar.H" +# include "fl_draw.H" +# include "Fl_Shared_Image.H" // @@ -88,23 +89,6 @@ struct Fl_Help_Target int y; // Y offset of target }; -// -// Fl_Help_Image structure... -// - -class Fl_Image; - -struct Fl_Help_Image -{ - char *name, // Path and name of the image - wattr[8], // Width attribute - hattr[8]; // Height attribute - Fl_Image *image; // FLTK image representation - unsigned char *data; // Raw image data - int copy; // Data is a copy? - int w, h, d; // Image size & depth -}; - // // Fl_Help_View class... // @@ -145,18 +129,6 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget size_; // Total document length Fl_Scrollbar scrollbar_; // Vertical scrollbar for document - int nimage_, // Number of images in a page - aimage_; // Allocated blocks - Fl_Help_Image *image_; // list of image descriptors - - Fl_Help_Image *add_image(const char *name, const char *wattr, - const char *hattr, int make = 1); - Fl_Help_Image *find_image(const char *name, const char *wattr, - const char *hattr); - int load_gif(Fl_Help_Image *img, FILE *fp); - int load_jpeg(Fl_Help_Image *img, FILE *fp); - int load_png(Fl_Help_Image *img, FILE *fp); - Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0); static int compare_blocks(const void *a, const void *b); void add_link(const char *n, int xx, int yy, int ww, int hh); @@ -169,6 +141,7 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget int get_align(const char *p, int a); const char *get_attr(const char *p, const char *n, char *buf, int bufsize); Fl_Color get_color(const char *n, Fl_Color c); + Fl_Shared_Image *get_image(const char *name, int W, int H); int handle(int); void initfont(uchar &f, uchar &s) { nfonts_ = 0; @@ -207,8 +180,8 @@ class Fl_Help_View : public Fl_Group //// Help viewer widget const char *value() const { return (value_); } }; -#endif // !_Fl_Help_View_H_ +#endif // !Fl_Help_View_H // -// End of "$Id: Fl_Help_View.H,v 1.1.2.3 2001/10/29 03:44:31 easysw Exp $". +// End of "$Id: Fl_Help_View.H,v 1.1.2.4 2001/11/24 02:46:19 easysw Exp $". // -- cgit v1.2.3