2003-10-10 21:08:55 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file RenderGraphic.h
|
2003-10-10 21:08:55 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#ifndef RENDERGRAPHIC_H
|
|
|
|
#define RENDERGRAPHIC_H
|
2003-10-10 21:08:55 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "RenderBase.h"
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
#include "graphics/GraphicsLoader.h"
|
|
|
|
#include "graphics/GraphicsParams.h"
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
class RenderGraphic : public RenderBase
|
|
|
|
{
|
|
|
|
public:
|
2019-09-17 21:06:18 +00:00
|
|
|
explicit RenderGraphic(Inset const *);
|
2007-04-29 13:39:47 +00:00
|
|
|
RenderGraphic(RenderGraphic const &, Inset const *);
|
2020-10-01 07:42:11 +00:00
|
|
|
RenderBase * clone(Inset const *) const override;
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
/// compute the size of the object returned in dim
|
2020-10-01 07:42:11 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const override;
|
2003-11-25 16:49:02 +00:00
|
|
|
/// draw inset
|
2020-12-13 08:51:32 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y, bool const darkmode = false) const override;
|
2003-10-10 21:08:55 +00:00
|
|
|
|
|
|
|
/// Refresh the info about which file to display and how to display it.
|
2006-10-21 00:16:43 +00:00
|
|
|
void update(graphics::Params const & params);
|
2009-08-13 17:21:59 +00:00
|
|
|
/// Reloads the image if necessary
|
|
|
|
void reload() const;
|
2003-10-10 21:08:55 +00:00
|
|
|
|
2003-10-25 20:09:52 +00:00
|
|
|
/// equivalent to dynamic_cast
|
2020-10-01 07:42:11 +00:00
|
|
|
RenderGraphic * asGraphic() override { return this; }
|
2003-10-25 20:09:52 +00:00
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
private:
|
|
|
|
/// Not implemented.
|
|
|
|
RenderGraphic & operator=(RenderGraphic const &);
|
|
|
|
|
2020-01-15 14:54:47 +00:00
|
|
|
/// Reference to owner
|
|
|
|
Inset const * inset_;
|
|
|
|
|
2003-10-10 21:08:55 +00:00
|
|
|
/// The stored data.
|
2006-10-21 00:16:43 +00:00
|
|
|
graphics::Loader loader_;
|
|
|
|
graphics::Params params_;
|
2003-10-10 21:08:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#endif // NOT RENDERGRAPHIC_H
|