]> git.lyx.org Git - features.git/commitdiff
remove getPixmap() from GraphicsImage
authorJohn Levon <levon@movementarian.org>
Mon, 15 Jul 2002 17:17:57 +0000 (17:17 +0000)
committerJohn Levon <levon@movementarian.org>
Mon, 15 Jul 2002 17:17:57 +0000 (17:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4642 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/frontends/qt2/ChangeLog
src/frontends/qt2/QLImage.C
src/frontends/qt2/QLImage.h
src/frontends/qt2/TODO
src/frontends/xforms/ChangeLog
src/frontends/xforms/XPainter.C
src/frontends/xforms/xformsImage.C
src/frontends/xforms/xformsImage.h
src/graphics/ChangeLog
src/graphics/GraphicsImage.h
src/insets/ChangeLog
src/insets/insetgraphics.C

index 7df69e2473e8a78b7a0462ebbfd230c68a081379..2977afd914ce90d1f879bc60fb779ece7f68aca7 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-15  John Levon  <moz@compsoc.man.ac.uk>
+
+       * QLImage.h:
+       * QLImage.C: remove getPixmap() add isDrawable()
 2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
 
        * io_callback.h:
index 124beb80b67dda9302fc921c4d6db55a23456ee5..a8ea704ae8c6f9f6d7620198830e74c3552bcb19 100644 (file)
@@ -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()) {
index ec30c356a5d2deef47fa88cb78d33e04597a5506..ed324c44edda9e28cdb06f167d25915606cc09fa 100644 (file)
@@ -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.
index c47ae8bae4cf31416fe2ea0f1db7e4f9a49d891f..e103dff33411120d0e7e3abeb0f62f47295c6471 100644 (file)
@@ -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
index 3e37e6f580a8a7b79656c194a0c596c70e89f7c2..a5722cf5e250c264b89cbcbccd6867a0e0da7e5a 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-15  John Levon  <moz@compsoc.man.ac.uk>
+
+       * xformsImage.h:
+       * xformsImage.C: add isDrawable()
+
+       * XPainter.C: use static cast to xformsImage
 2002-07-14  Angus Leeming  <leeming@lyx.org>
 
        * lyx_gui.C (C_read_callback): give it extern "C" linkage.
index f4692adaa028bea7481b18295367658b7e05093b..929db4904fb05f64a4f22f109feba1bffbbb9a6f 100644 (file)
@@ -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<grfx::xformsImage const &>(i);
        XGCValues val;
        val.function = GXcopy;
        GC gc = XCreateGC(fl_get_display(), owner_.getPixmap(),
index 1c18c6133638b774e1522ed3112ec34b8cf4dd43..63f82c3910c4fabba7a6864c307a216660142bb8 100644 (file)
@@ -167,6 +167,12 @@ unsigned int xformsImage::getHeight() const
 }
 
 
+bool xformsImage::isDrawable() const
+{
+       return pixmap_;
+}
+
 Pixmap xformsImage::getPixmap() const
 {
        if (!pixmap_status_ == PIXMAP_SUCCESS)
index ac922bd2e5e96e7ebdea7468b9652f516527ffa3..cc7e640c2bb0a2c5953c6ec945e4126e46c9ce6e 100644 (file)
 
 #include "graphics/GraphicsImage.h"
 
+#include <X11/X.h>
+
 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.
index 6bb09a92717c209fdb7e16aff4977ebef51d4974..6c0cfd02be1a5aa9f3a9ff8aaf0e2bd7e5b00a63 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-15  John Levon  <moz@compsoc.man.ac.uk>
+
+       * GraphicsImage.h: remove getPixmap/X, add isDrawable()
 2002-07-12  Angus Leeming  <leeming@lyx.org>
 
        * GraphicsLoader.[Ch]: smart loading of images. Images are loaded only
index 5a4ada786635d6cf461a9c46d1b32d8d84f51c8a..2384170266df0a6e27d54aa67f1214abd571bcff 100644 (file)
@@ -28,8 +28,6 @@
 #include <boost/function/function0.hpp>
 #include <boost/signals/signal1.hpp>
 
-#include <X11/X.h> // for Pixmap :-(
-
 #include <vector>
 #include <utility>
 
@@ -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.
         */
index 098c4d382be408d91b0d76c49c5deb540ddbe31b..a6afe99da00c94fc7579e166f70d531ec17d021b 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-15  John Levon  <moz@compsoc.man.ac.uk>
+
+       * insetgraphics.C: use ->isDrawable()
 2002-07-12  Angus Leeming  <leeming@lyx.org>
 
        * insetgraphics.C: use the new smart loading capabilities of the image
index 518924a72e31ed0e454e6603d69590397c8a70c5..36f80bfa73786bc7e6b7ddae2520e457dd8ad302 100644 (file)
@@ -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();
 }