]> git.lyx.org Git - lyx.git/blobdiff - src/insets/figinset.h
Hopefully fixed the redo problems with insets!
[lyx.git] / src / insets / figinset.h
index 178ddf4acf9bd6446d429d2c92284570dc16b8b9..73d70d95d159732a40900a35a60662969f2cb34a 100644 (file)
@@ -7,78 +7,83 @@
 #ifndef FIGINSET_H
 #define FIGINSET_H
 
-#include "form1.h"
+#include "figure_form.h"
 #include "LString.h"
 #include "buffer.h"
 #include "LaTeXFeatures.h"
-#include "insets/lyxinset.h"
+#include "insets/inset.h"
+#include <sigc++/signal_system.h>
 /* the rest is figure stuff */
 
 struct Figref;
 
 ///
-class InsetFig: public Inset {
+class InsetFig: public Inset, public SigC::Object {
 public:
        ///
-       InsetFig(int tmpx, int tmpy, Buffer *);
+       InsetFig(int tmpx, int tmpy, Buffer const &);
        ///
        ~InsetFig();
        ///
-       int ascent(Painter &, LyXFont const & font) const;
+       int ascent(BufferView *, LyXFont const & font) const;
        ///
-       int descent(Painter &, LyXFont const & font) const;
+       int descent(BufferView *, LyXFont const & font) const;
        ///
-       int width(Painter &, LyXFont const & font) const;
+       int width(BufferView *, LyXFont const & font) const;
        ///
-       void draw(Painter &, LyXFont const & font,
-                 int baseline, float & x) const;
+       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
        ///
-       void Write(std::ostream &) const;
+       void write(Buffer const *, std::ostream &) const;
        ///
-       void Read(LyXLex & lex);
+       void read(Buffer const *, LyXLex & lex);
        ///
-       int Latex(std::ostream &, bool fragile, bool free_space) const;
+       int latex(Buffer const *, std::ostream &, bool fragile, bool free_space) const;
        ///
-       int Ascii(std::ostream &) const;
+       int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
-       int Linuxdoc(std::ostream &) const;
+       int linuxdoc(Buffer const *, std::ostream &) const;
        ///
-       int DocBook(std::ostream &) const;
+       int docbook(Buffer const *, std::ostream &) const;
        /// Updates needed features for this inset.
-       void Validate(LaTeXFeatures & features) const;
+       void validate(LaTeXFeatures & features) const;
 
        /// what appears in the minibuffer when opening
-       char const * EditMessage() const;
+       string const editMessage() const;
        
        ///
-       void Edit(BufferView *, int, int, unsigned int);
+       void edit(BufferView *, int, int, unsigned int);
        ///
-       EDITABLE Editable() const;
+       void edit(BufferView * bv, bool front = true);
        ///
-       bool Deletable() const;
+       EDITABLE editable() const;
        ///
-       Inset::Code LyxCode() const;
+       bool deletable() const;
        ///
-       Inset * Clone() const;
+       Inset::Code lyxCode() const;
        ///
-       void CallbackFig(long arg);
+       Inset * clone(Buffer const &, bool same_id = false) const;
        ///
-       void Preview(char const * p);
+       void callbackFig(long arg);
+       ///
+       void preview(string const & p);
        /// browse for file
-       void BrowseFile();
+       void browseFile();
 
        /// form for user input
        FD_Figure * form;
        /// width and height in pixels on screen
-       int wid, hgh;
+       int wid;
+       int hgh;
        /// width and height in postscript units (1/72 inch)
-       int pswid, pshgh;
+       int pswid;
+       int pshgh;
        /// width of raw figure w/o rotation
        int raw_wid;
        /// heigt of raw figure w/o rotation
        int raw_hgh;
        /// x and y coordinate in ps units
-       int psx, psy;
+       int psx;
+       int psy;
 
        /// .eps file name
        string fname;
@@ -111,7 +116,8 @@ public:
        HWTYPE thtype;
 
        /// width and height
-       float xwid, xhgh;
+       float xwid;
+       float xhgh;
 
        /// rotation angle
        float angle;
@@ -133,19 +139,25 @@ public:
        ///
        bool psubfigure;
 private:
+       /** Redraw the form (on receipt of a Signal indicating, for example,
+           that the xform colors have been re-mapped).
+       */
+       void redraw();
 
        ///
-       Buffer * owner;
+       Buffer const * owner;
        /// restore values on the form
-       void RestoreForm();
+       void restoreForm();
        /// recompute screen params
-       void Recompute();
+       void recompute();
        /// regenerate \includegraphics{} command
-       void Regenerate() const;
+       void regenerate() const;
        /// regenerate \inlcudegraphics{} command in temporary buffer
-       void TempRegenerate();
+       void tempRegenerate();
        /// get sizes from .eps file
-       void GetPSSizes();
+       void getPSSizes();
+       /// Redraw connection.
+       SigC::Connection r_;
 };