3 figinset.h - Figure inset header - part of LyX project
4 Copyright 1996 by Ivan Schreter
10 #include FORMS_H_LOCATION
11 #include "figure_form.h"
14 #include "LaTeXFeatures.h"
15 #include "insets/inset.h"
16 #include <sigc++/signal_system.h>
17 /* the rest is figure stuff */
22 class InsetFig: public Inset, public SigC::Object {
25 InsetFig(int tmpx, int tmpy, Buffer const &);
29 int ascent(BufferView *, LyXFont const & font) const;
31 int descent(BufferView *, LyXFont const & font) const;
33 int width(BufferView *, LyXFont const & font) const;
35 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
37 void write(Buffer const *, std::ostream &) const;
39 void read(Buffer const *, LyXLex & lex);
41 int latex(Buffer const *, std::ostream &, bool fragile, bool free_space) const;
43 int ascii(Buffer const *, std::ostream &, int linelen) const;
45 int linuxdoc(Buffer const *, std::ostream &) const;
47 int docbook(Buffer const *, std::ostream &) const;
48 /// Updates needed features for this inset.
49 void validate(LaTeXFeatures & features) const;
51 /// what appears in the minibuffer when opening
52 string const editMessage() const;
55 void edit(BufferView *, int, int, unsigned int);
57 void edit(BufferView * bv, bool front = true);
59 EDITABLE editable() const;
61 bool deletable() const;
63 Inset::Code lyxCode() const;
65 Inset * clone(Buffer const &, bool same_id = false) const;
67 void callbackFig(long arg);
69 void preview(string const & p);
73 /// form for user input
75 /// width and height in pixels on screen
78 /// width and height in postscript units (1/72 inch)
81 /// width of raw figure w/o rotation
83 /// heigt of raw figure w/o rotation
85 /// x and y coordinate in ps units
91 /// changed filename -> for recompute
108 /// width and height types: 0-default, 1-cm, 2-in, 3-%of page
109 /// For width, there is also: 4-% of col
114 /// temporary w and h type
126 /// graphics command, latex version
129 /// Caption for subfigure package
143 /** Redraw the form (on receipt of a Signal indicating, for example,
144 that the xform colors have been re-mapped).
149 Buffer const * owner;
150 /// restore values on the form
152 /// recompute screen params
154 /// regenerate \includegraphics{} command
155 void regenerate() const;
156 /// regenerate \inlcudegraphics{} command in temporary buffer
157 void tempRegenerate();
158 /// get sizes from .eps file
160 /// Redraw connection.
169 /// reference count for this bitmap
173 /// width of raw figure w/o rotation
175 /// heigt of raw figure w/o rotation
177 /// width and height on screen
179 /// pointer to file name
181 /// type; 0-none, 1-B/W, 2-Grayscale, 3-Color
183 /// reading request is pending on this figure
185 /// could not read it, because it's broken
187 /// when gs was killed, this says that image is ok
189 /// gs pid for reading
196 /// figure data (image)
198 /// inset of this figure