3 figinset.h - Figure inset header - part of LyX project
4 Copyright 1996 by Ivan Schreter
10 #include "figure_form.h"
13 #include "LaTeXFeatures.h"
14 #include "insets/inset.h"
15 #include <sigc++/signal_system.h>
16 /* the rest is figure stuff */
21 class InsetFig: public Inset, public SigC::Object {
24 InsetFig(int tmpx, int tmpy, Buffer const &);
28 int ascent(BufferView *, LyXFont const & font) const;
30 int descent(BufferView *, LyXFont const & font) const;
32 int width(BufferView *, LyXFont const & font) const;
34 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
36 void write(Buffer const *, std::ostream &) const;
38 void read(Buffer const *, LyXLex & lex);
40 int latex(Buffer const *, std::ostream &, bool fragile, bool free_space) const;
42 int ascii(Buffer const *, std::ostream &, int linelen) const;
44 int linuxdoc(Buffer const *, std::ostream &) const;
46 int docbook(Buffer const *, std::ostream &) const;
47 /// Updates needed features for this inset.
48 void validate(LaTeXFeatures & features) const;
50 /// what appears in the minibuffer when opening
51 string const editMessage() const;
54 void edit(BufferView *, int, int, unsigned int);
56 void edit(BufferView * bv, bool front = true);
58 EDITABLE editable() const;
60 bool deletable() const;
62 Inset::Code lyxCode() const;
64 Inset * clone(Buffer const &, bool same_id = false) const;
66 void callbackFig(long arg);
68 void preview(string const & p);
72 /// form for user input
74 /// width and height in pixels on screen
77 /// width and height in postscript units (1/72 inch)
80 /// width of raw figure w/o rotation
82 /// heigt of raw figure w/o rotation
84 /// x and y coordinate in ps units
90 /// changed filename -> for recompute
107 /// width and height types: 0-default, 1-cm, 2-in, 3-%of page
108 /// For width, there is also: 4-% of col
113 /// temporary w and h type
125 /// graphics command, latex version
128 /// Caption for subfigure package
142 /** Redraw the form (on receipt of a Signal indicating, for example,
143 that the xform colors have been re-mapped).
148 Buffer const * owner;
149 /// restore values on the form
151 /// recompute screen params
153 /// regenerate \includegraphics{} command
154 void regenerate() const;
155 /// regenerate \inlcudegraphics{} command in temporary buffer
156 void tempRegenerate();
157 /// get sizes from .eps file
159 /// Redraw connection.
168 /// reference count for this bitmap
172 /// width of raw figure w/o rotation
174 /// heigt of raw figure w/o rotation
176 /// width and height on screen
178 /// pointer to file name
180 /// type; 0-none, 1-B/W, 2-Grayscale, 3-Color
182 /// reading request is pending on this figure
184 /// could not read it, because it's broken
186 /// when gs was killed, this says that image is ok
188 /// gs pid for reading
195 /// figure data (image)
197 /// inset of this figure