home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / figlist.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  2KB  |  74 lines

  1. // -*- C++ -*-
  2.  
  3. #ifndef FIGLIST_H_
  4. #define FIGLIST_H_
  5.  
  6. #include FORMS_H_LOCATION
  7. #include "form1.h"
  8. #include "LString.h"
  9.  
  10. class InsetFig;
  11.  
  12. ///
  13. struct figdata {
  14.     /// bitmap data
  15.     Pixmap bitmap;
  16.     /// reference count for this bitmap
  17.     int ref;
  18.         /// rotation angle
  19.         float angle;
  20.         /// width of raw figure w/o rotation
  21.     int raw_wid;
  22.         /// heigt of raw figure w/o rotation
  23.     int raw_hgh;
  24.     /// width and height on screen
  25.     int wid, hgh;
  26.     /// pointer to file name
  27.     LString fname;
  28.     /// type; 0-none, 1-B/W, 2-Grayscale, 3-Color
  29.     char flags;
  30.     /// reading request is pending on this figure
  31.     bool reading;
  32.     /// could not read it, because it's broken
  33.     bool broken;
  34.     /// when gs was killed, this says that image is ok
  35.     bool gsdone;
  36.     /// gs pid for reading
  37.     int gspid;
  38. };
  39.  
  40. class FigureList {
  41. public:
  42. ///
  43.     struct Figref {
  44.         /// figure data (image)
  45.         figdata *data;
  46.         /// inset of this figure
  47.         InsetFig *inset;
  48.     };
  49.     FigureList() {
  50.         bitmap_waiting = false;
  51.         figinsref = 0;
  52.     }
  53.     ~FigureList() {};
  54.     Figref **figures;  // all the figures
  55.     figdata **bitmaps; // all the bitmaps
  56.     void RegisterFigure(InsetFig *fi);
  57.     void UnregisterFigure(InsetFig *fi);
  58.     int FindFigIndex(Figref *tmpfig);
  59.     void InitFigures();
  60.     void DoneFigures();
  61.     bool bitmap_waiting; // bitmaps are waiting finished
  62.     void getbitmaps();
  63.     figdata *getfigdata(int wid, int hgh, LString const & fname, 
  64.                 int psx, int psy, int pswid, int pshgh, 
  65.                 int raw_wid, int raw_hgh, float angle, char flags);
  66.     void freefigdata(figdata *tmpdata);
  67.     int figinsref;  // number of figures
  68.  
  69. };
  70.  
  71. extern FigureList figL;
  72.  
  73. #endif
  74.