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 EDITABLE editable() const;
58 bool deletable() const;
60 Inset::Code lyxCode() const;
62 Inset * clone(Buffer const &, bool same_id = false) const;
64 void callbackFig(long arg);
66 void preview(string const & p);
70 /// form for user input
72 /// width and height in pixels on screen
75 /// width and height in postscript units (1/72 inch)
78 /// width of raw figure w/o rotation
80 /// heigt of raw figure w/o rotation
82 /// x and y coordinate in ps units
88 /// changed filename -> for recompute
105 /// width and height types: 0-default, 1-cm, 2-in, 3-%of page
106 /// For width, there is also: 4-% of col
111 /// temporary w and h type
123 /// graphics command, latex version
126 /// Caption for subfigure package
140 /** Redraw the form (on receipt of a Signal indicating, for example,
141 that the xform colors have been re-mapped).
146 Buffer const * owner;
147 /// restore values on the form
149 /// recompute screen params
151 /// regenerate \includegraphics{} command
152 void regenerate() const;
153 /// regenerate \inlcudegraphics{} command in temporary buffer
154 void tempRegenerate();
155 /// get sizes from .eps file
157 /// Redraw connection.
166 /// reference count for this bitmap
170 /// width of raw figure w/o rotation
172 /// heigt of raw figure w/o rotation
174 /// width and height on screen
176 /// pointer to file name
178 /// type; 0-none, 1-B/W, 2-Grayscale, 3-Color
180 /// reading request is pending on this figure
182 /// could not read it, because it's broken
184 /// when gs was killed, this says that image is ok
186 /// gs pid for reading
193 /// figure data (image)
195 /// inset of this figure