// -*- C++ -*-
/*
figinset.h - Figure inset header - part of LyX project
- (C)1996 by Ivan Schreter
+ Copyright 1996 by Ivan Schreter
*/
#ifndef FIGINSET_H
#include "buffer.h"
#include "LaTeXFeatures.h"
#include "insets/lyxinset.h"
+#include <sigc++/signal_system.h>
/* the rest is figure stuff */
-
struct Figref;
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Object;
+using SigC::Connection;
+#endif
+
///
-class InsetFig: public Inset {
+class InsetFig: public Inset, public Object {
public:
///
- InsetFig(int tmpx, int tmpy, Buffer *);
+ InsetFig(int tmpx, int tmpy, Buffer const &);
///
~InsetFig();
///
- int ascent(Painter &, LyXFont const & font) const;
- ///
- int descent(Painter &, LyXFont const & font) const;
- ///
- int width(Painter &, LyXFont const & font) const;
+ int ascent(BufferView *, LyXFont const & font) const;
///
- void draw(Painter &, LyXFont const & font,
- int baseline, float & x) const;
+ int descent(BufferView *, LyXFont const & font) const;
///
- void Write(ostream &) const;
+ int width(BufferView *, LyXFont const & font) const;
///
- void Read(LyXLex & lex);
+ void draw(BufferView *, LyXFont const &, int, float &, bool) const;
///
- int Latex(ostream &, signed char fragile) const;
-#ifndef USE_OSTREAM_ONLY
+ void Write(Buffer const *, std::ostream &) const;
///
- int Latex(string & file, signed char fragile) const;
+ void Read(Buffer const *, LyXLex & lex);
///
- int Linuxdoc(string & file) const;
+ int Latex(Buffer const *, std::ostream &, bool fragile, bool free_space) const;
///
- int DocBook(string & file) const;
-#else
+ int Ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int Linuxdoc(ostream &) const;
+ int Linuxdoc(Buffer const *, std::ostream &) const;
///
- int DocBook(ostream &) const;
-#endif
+ int DocBook(Buffer const *, std::ostream &) const;
/// Updates needed features for this inset.
void Validate(LaTeXFeatures & features) const;
/// what appears in the minibuffer when opening
- const char * EditMessage() const { return _("Opened figure"); }
+ string const EditMessage() const;
+
///
void Edit(BufferView *, int, int, unsigned int);
///
///
Inset::Code LyxCode() const;
///
- Inset * Clone() const;
+ Inset * Clone(Buffer const &) const;
///
void CallbackFig(long arg);
///
- void Preview(char const * p);
+ void Preview(string const & p);
/// browse for file
void BrowseFile();
/// 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();
/// recompute screen params
void TempRegenerate();
/// get sizes from .eps file
void GetPSSizes();
+ /// Redraw connection.
+ Connection r_;
};