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 #include <sigc++/signal_system.h>
16 /* the rest is figure stuff */
20 #ifdef SIGC_CXX_NAMESPACES
22 using SigC::Connection;
26 class InsetFig: public Inset, public Object {
29 InsetFig(int tmpx, int tmpy, Buffer const &);
33 int ascent(BufferView *, LyXFont const & font) const;
35 int descent(BufferView *, LyXFont const & font) const;
37 int width(BufferView *, LyXFont const & font) const;
39 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
41 void Write(Buffer const *, std::ostream &) const;
43 void Read(Buffer const *, LyXLex & lex);
45 int Latex(Buffer const *, std::ostream &, bool fragile, bool free_space) const;
47 int Ascii(Buffer const *, std::ostream &, int linelen) const;
49 int Linuxdoc(Buffer const *, std::ostream &) const;
51 int DocBook(Buffer const *, std::ostream &) const;
52 /// Updates needed features for this inset.
53 void Validate(LaTeXFeatures & features) const;
55 /// what appears in the minibuffer when opening
56 string const EditMessage() const;
59 void Edit(BufferView *, int, int, unsigned int);
61 EDITABLE Editable() const;
63 bool Deletable() const;
65 Inset::Code LyxCode() const;
67 Inset * Clone(Buffer const &) const;
69 void CallbackFig(long arg);
71 void Preview(string const & p);
75 /// form for user input
77 /// width and height in pixels on screen
79 /// 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
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
124 /// graphics command, latex version
127 /// Caption for subfigure package
141 /** Redraw the form (on receipt of a Signal indicating, for example,
142 that the xform colors have been re-mapped).
147 Buffer const * owner;
148 /// restore values on the form
150 /// recompute screen params
152 /// regenerate \includegraphics{} command
153 void Regenerate() const;
154 /// regenerate \inlcudegraphics{} command in temporary buffer
155 void TempRegenerate();
156 /// get sizes from .eps file
158 /// Redraw connection.
167 /// reference count for this bitmap
171 /// width of raw figure w/o rotation
173 /// heigt of raw figure w/o rotation
175 /// width and height on screen
177 /// pointer to file name
179 /// type; 0-none, 1-B/W, 2-Grayscale, 3-Color
181 /// reading request is pending on this figure
183 /// could not read it, because it's broken
185 /// when gs was killed, this says that image is ok
187 /// gs pid for reading
194 /// figure data (image)
196 /// inset of this figure