3 figinset.h - Figure inset header - part of LyX project
4 Copyright 1996 by Ivan Schreter
13 #include "LaTeXFeatures.h"
14 #include "insets/lyxinset.h"
15 /* the rest is figure stuff */
21 class InsetFig: public Inset {
24 InsetFig(int tmpx, int tmpy, Buffer *);
28 int ascent(Painter &, LyXFont const & font) const;
30 int descent(Painter &, LyXFont const & font) const;
32 int width(Painter &, LyXFont const & font) const;
34 void draw(Painter &, LyXFont const & font,
35 int baseline, float & x) const;
37 void Write(ostream &) const;
39 void Read(LyXLex & lex);
41 int Latex(ostream &, signed char fragile, bool free_space) const;
42 #ifndef USE_OSTREAM_ONLY
44 int Latex(string & file, signed char fragile, bool free_space) const;
46 int Linuxdoc(string & file) const;
48 int DocBook(string & file) const;
51 int Linuxdoc(ostream &) const;
53 int DocBook(ostream &) const;
55 /// Updates needed features for this inset.
56 void Validate(LaTeXFeatures & features) const;
58 /// what appears in the minibuffer when opening
59 const char * EditMessage() const { return _("Opened figure"); }
61 void Edit(BufferView *, int, int, unsigned int);
63 EDITABLE Editable() const;
65 bool Deletable() const;
67 Inset::Code LyxCode() const;
69 Inset * Clone() const;
71 void CallbackFig(long arg);
73 void Preview(char const * p);
77 /// form for user input
79 /// width and height in pixels on screen
81 /// width and height in postscript units (1/72 inch)
83 /// width of raw figure w/o rotation
85 /// heigt of raw figure w/o rotation
87 /// x and y coordinate in ps units
92 /// changed filename -> for recompute
109 /// width and height types: 0-default, 1-cm, 2-in, 3-%of page
110 /// For width, there is also: 4-% of col
115 /// temporary w and h type
126 /// graphics command, latex version
129 /// Caption for subfigure package
144 /// restore values on the form
146 /// recompute screen params
148 /// regenerate \includegraphics{} command
149 void Regenerate() const;
150 /// regenerate \inlcudegraphics{} command in temporary buffer
151 void TempRegenerate();
152 /// get sizes from .eps file
161 /// reference count for this bitmap
165 /// width of raw figure w/o rotation
167 /// heigt of raw figure w/o rotation
169 /// width and height on screen
171 /// pointer to file name
173 /// type; 0-none, 1-B/W, 2-Grayscale, 3-Color
175 /// reading request is pending on this figure
177 /// could not read it, because it's broken
179 /// when gs was killed, this says that image is ok
181 /// gs pid for reading
188 /// figure data (image)
190 /// inset of this figure