]> git.lyx.org Git - lyx.git/blobdiff - src/insets/RenderGraphic.cpp
* src/insets/InsetListings.{cpp,h}:
[lyx.git] / src / insets / RenderGraphic.cpp
index 3a5bc405c31d42b6d8061b1acaedbb9bf3ec4948..d305024192c0788e80bab2821022f705b03973a8 100644 (file)
@@ -38,7 +38,7 @@ using std::string;
 using std::auto_ptr;
 
 
-RenderGraphic::RenderGraphic(InsetBase const * inset)
+RenderGraphic::RenderGraphic(Inset const * inset)
 {
        loader_.connect(boost::bind(&LyX::updateInset,
                                    boost::cref(LyX::cref()), inset));
@@ -46,7 +46,7 @@ RenderGraphic::RenderGraphic(InsetBase const * inset)
 
 
 RenderGraphic::RenderGraphic(RenderGraphic const & other,
-                            InsetBase const * inset)
+                            Inset const * inset)
        : RenderBase(other),
          loader_(other.loader_),
          params_(other.params_)
@@ -56,7 +56,7 @@ RenderGraphic::RenderGraphic(RenderGraphic const & other,
 }
 
 
-auto_ptr<RenderBase> RenderGraphic::clone(InsetBase const * inset) const
+auto_ptr<RenderBase> RenderGraphic::clone(Inset const * inset) const
 {
        return auto_ptr<RenderBase>(new RenderGraphic(*this, inset));
 }
@@ -149,25 +149,25 @@ bool RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const
 
        if (image_ready) {
                dim.wid = loader_.image()->getWidth() +
-                       2 * InsetOld::TEXT_TO_INSET_OFFSET;
+                       2 * Inset::TEXT_TO_INSET_OFFSET;
        } else {
                int font_width = 0;
 
-               LyXFont msgFont(mi.base.font);
-               msgFont.setFamily(LyXFont::SANS_FAMILY);
+               Font msgFont(mi.base.font);
+               msgFont.setFamily(Font::SANS_FAMILY);
 
                // FIXME UNICODE
                docstring const justname = 
                        from_utf8(onlyFilename(params_.filename.absFilename()));
                if (!justname.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
+                       msgFont.setSize(Font::SIZE_FOOTNOTE);
                        font_width = theFontMetrics(msgFont)
                                .width(justname);
                }
 
                docstring const msg = statusMessage(params_, loader_.status());
                if (!msg.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_TINY);
+                       msgFont.setSize(Font::SIZE_TINY);
                        font_width = std::max(font_width,
                                theFontMetrics(msgFont).width(msg));
                }
@@ -194,27 +194,27 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
        // loaded yet, we draw just a rectangle.
 
        if (displayGraphic(params_) && readyToDisplay(loader_)) {
-               pi.pain.image(x + InsetOld::TEXT_TO_INSET_OFFSET,
+               pi.pain.image(x + Inset::TEXT_TO_INSET_OFFSET,
                              y - dim_.asc,
-                             dim_.wid - 2 * InsetOld::TEXT_TO_INSET_OFFSET,
+                             dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET,
                              dim_.asc + dim_.des,
                              *loader_.image());
 
        } else {
-               pi.pain.rectangle(x + InsetOld::TEXT_TO_INSET_OFFSET,
+               pi.pain.rectangle(x + Inset::TEXT_TO_INSET_OFFSET,
                                  y - dim_.asc,
-                                 dim_.wid - 2 * InsetOld::TEXT_TO_INSET_OFFSET,
+                                 dim_.wid - 2 * Inset::TEXT_TO_INSET_OFFSET,
                                  dim_.asc + dim_.des,
                                  Color::foreground);
 
                // Print the file name.
-               LyXFont msgFont = pi.base.font;
-               msgFont.setFamily(LyXFont::SANS_FAMILY);
+               Font msgFont = pi.base.font;
+               msgFont.setFamily(Font::SANS_FAMILY);
                string const justname = onlyFilename(params_.filename.absFilename());
 
                if (!justname.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
-                       pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
+                       msgFont.setSize(Font::SIZE_FOOTNOTE);
+                       pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6,
                                   y - theFontMetrics(msgFont).maxAscent() - 4,
                                   from_utf8(justname), msgFont);
                }
@@ -222,8 +222,8 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
                // Print the message.
                docstring const msg = statusMessage(params_, loader_.status());
                if (!msg.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_TINY);
-                       pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6,
+                       msgFont.setSize(Font::SIZE_TINY);
+                       pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6,
                                     y - 4, msg, msgFont);
                }
        }