X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Ffiginset.h;h=02000371d9d5a224e689cc5fb3666ab50f025ed8;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=dc47ae8c9f22c9ce372b3255173e2887d4629bb6;hpb=a0cf758d5a79140045c2a90e2ff5878e0b391bcc;p=lyx.git diff --git a/src/insets/figinset.h b/src/insets/figinset.h index dc47ae8c9f..02000371d9 100644 --- a/src/insets/figinset.h +++ b/src/insets/figinset.h @@ -1,84 +1,90 @@ // -*- C++ -*- /* figinset.h - Figure inset header - part of LyX project - (C)1996 by Ivan Schreter + Copyright 1996 by Ivan Schreter */ #ifndef FIGINSET_H #define FIGINSET_H -#include "form1.h" +#include FORMS_H_LOCATION +#include "figure_form.h" #include "LString.h" #include "buffer.h" #include "LaTeXFeatures.h" -#include "insets/lyxinset.h" +#include "insets/inset.h" +#include /* 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(ostream &); + void write(Buffer const *, std::ostream &) const; /// - void Read(LyXLex & lex); + void read(Buffer const *, LyXLex & lex); /// - int Latex(ostream &, signed char fragile); + int latex(Buffer const *, std::ostream &, bool fragile, bool free_space) const; /// - int Latex(string & file, signed char fragile); + int ascii(Buffer const *, std::ostream &, int linelen) const; /// - int Linuxdoc(string & file); + int linuxdoc(Buffer const *, std::ostream &) const; /// - int DocBook(string & file); + 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 { return _("Opened figure"); } + string const editMessage() const; + + /// + void edit(BufferView *, int, int, unsigned int); /// - void Edit(int, int); + void edit(BufferView * bv, bool front = true); /// - unsigned char Editable() const; + EDITABLE editable() const; /// - bool Deletable() const; + bool deletable() const; /// - Inset::Code LyxCode() const; + Inset::Code lyxCode() const; /// - Inset * Clone() const; + Inset * clone(Buffer const &, bool same_id = false) const; /// - void CallbackFig(long arg); + void callbackFig(long arg); /// - void Preview(char const * p); + 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,39 +117,48 @@ public: HWTYPE thtype; /// width and height - float xwid, xhgh; + float xwid; + float xhgh; /// rotation angle float angle; /// graphics command, latex version - string cmd; + mutable string cmd; /// Caption for subfigure package string subcaption; /// various flags int flags; - bool subfigure : 1; + /// + bool subfigure; /// figure reference Figref * figure; /// temporary flags int pflags; - bool psubfigure : 1; + /// + 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(); + 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_; };