From: John Levon Date: Mon, 15 Jul 2002 17:17:57 +0000 (+0000) Subject: remove getPixmap() from GraphicsImage X-Git-Tag: 1.6.10~18867 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bc2f8994a26649972473a8190c134ba6bb0230ac;p=features.git remove getPixmap() from GraphicsImage git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4642 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 7df69e2473..2977afd914 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2002-07-15 John Levon + + * QLImage.h: + * QLImage.C: remove getPixmap() add isDrawable() + 2002-07-14 John Levon * io_callback.h: diff --git a/src/frontends/qt2/QLImage.C b/src/frontends/qt2/QLImage.C index 124beb80b6..a8ea704ae8 100644 --- a/src/frontends/qt2/QLImage.C +++ b/src/frontends/qt2/QLImage.C @@ -124,13 +124,6 @@ unsigned int QLImage::getHeight() const } -// FIXME -Pixmap QLImage::getPixmap() const -{ - return 1; -} - - void QLImage::load(string const & filename) { if (!pixmap_.isNull()) { diff --git a/src/frontends/qt2/QLImage.h b/src/frontends/qt2/QLImage.h index ec30c356a5..ed324c44ed 100644 --- a/src/frontends/qt2/QLImage.h +++ b/src/frontends/qt2/QLImage.h @@ -35,9 +35,6 @@ public: /// Create a copy virtual Image * clone() const; - /// FIXME - virtual Pixmap getPixmap() const; - QPixmap const & qpixmap() const { return xformed_pixmap_; } /// Get the image width @@ -46,6 +43,9 @@ public: /// Get the image height virtual unsigned int getHeight() const; + // FIXME + virtual bool isDrawable() const { return true; } + /** * Load the image file into memory. * The process is asynchronous, so this method starts the loading. diff --git a/src/frontends/qt2/TODO b/src/frontends/qt2/TODO index c47ae8bae4..e103dff334 100644 --- a/src/frontends/qt2/TODO +++ b/src/frontends/qt2/TODO @@ -8,10 +8,6 @@ FileDialog - add buttons for Documents, Templates, etc. to the file dialog toolbar - work around Qt crash bug with double click -GraphicsImage - - - remove getPixmap() - lyx_gui (qt) - move out lyxserver @@ -82,7 +78,6 @@ QLImage - get mono/color to work - get bgcolor and clipping to work - QLPainter - work out why buttons look ugly and fix diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 3e37e6f580..a5722cf5e2 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,10 @@ +2002-07-15 John Levon + + * xformsImage.h: + * xformsImage.C: add isDrawable() + + * XPainter.C: use static cast to xformsImage + 2002-07-14 Angus Leeming * lyx_gui.C (C_read_callback): give it extern "C" linkage. diff --git a/src/frontends/xforms/XPainter.C b/src/frontends/xforms/XPainter.C index f4692adaa0..929db4904f 100644 --- a/src/frontends/xforms/XPainter.C +++ b/src/frontends/xforms/XPainter.C @@ -23,7 +23,7 @@ #include "encoding.h" #include "language.h" -#include "graphics/GraphicsImage.h" +#include "xformsImage.h" #include "support/LAssert.h" #include "support/lstrings.h" @@ -150,8 +150,9 @@ Painter & XPainter::arc(int x, int y, Painter & XPainter::image(int x, int y, int w, int h, - grfx::Image const & image) + grfx::Image const & i) { + grfx::xformsImage const & image = static_cast(i); XGCValues val; val.function = GXcopy; GC gc = XCreateGC(fl_get_display(), owner_.getPixmap(), diff --git a/src/frontends/xforms/xformsImage.C b/src/frontends/xforms/xformsImage.C index 1c18c61336..63f82c3910 100644 --- a/src/frontends/xforms/xformsImage.C +++ b/src/frontends/xforms/xformsImage.C @@ -167,6 +167,12 @@ unsigned int xformsImage::getHeight() const } +bool xformsImage::isDrawable() const +{ + return pixmap_; +} + + Pixmap xformsImage::getPixmap() const { if (!pixmap_status_ == PIXMAP_SUCCESS) diff --git a/src/frontends/xforms/xformsImage.h b/src/frontends/xforms/xformsImage.h index ac922bd2e5..cc7e640c2b 100644 --- a/src/frontends/xforms/xformsImage.h +++ b/src/frontends/xforms/xformsImage.h @@ -20,9 +20,11 @@ #include "graphics/GraphicsImage.h" +#include + struct flimage_; typedef flimage_ FL_IMAGE; - + namespace grfx { class xformsImage : public Image @@ -49,6 +51,8 @@ public: /// Get the image height unsigned int getHeight() const; + virtual bool isDrawable() const; + /** Load the image file into memory. * The process is asynchronous, so this method starts the loading. * When finished, the Image::finishedLoading signal is emitted. diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 6bb09a9271..6c0cfd02be 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,7 @@ +2002-07-15 John Levon + + * GraphicsImage.h: remove getPixmap/X, add isDrawable() + 2002-07-12 Angus Leeming * GraphicsLoader.[Ch]: smart loading of images. Images are loaded only diff --git a/src/graphics/GraphicsImage.h b/src/graphics/GraphicsImage.h index 5a4ada7866..2384170266 100644 --- a/src/graphics/GraphicsImage.h +++ b/src/graphics/GraphicsImage.h @@ -28,8 +28,6 @@ #include #include -#include // for Pixmap :-( - #include #include @@ -65,15 +63,15 @@ public: /// Create a copy virtual Image * clone() const = 0; - /// - virtual Pixmap getPixmap() const = 0; - /// Get the image width virtual unsigned int getWidth() const = 0; /// Get the image height virtual unsigned int getHeight() const = 0; + /// is the image drawable ? + virtual bool isDrawable() const = 0; + /** At the end of the loading process inform the outside world * by emitting a signal. */ diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 098c4d382b..a6afe99da0 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-07-15 John Levon + + * insetgraphics.C: use ->isDrawable() + 2002-07-12 Angus Leeming * insetgraphics.C: use the new smart loading capabilities of the image diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 518924a72e..36f80bfa73 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -259,7 +259,7 @@ bool InsetGraphics::imageIsDrawable() const if (!cache_->loader.image() || cache_->loader.status() != grfx::Ready) return false; - return cache_->loader.image()->getPixmap() != 0; + return cache_->loader.image()->isDrawable(); }