]> git.lyx.org Git - lyx.git/blob - src/frontends/support/LyXImage_X.C
We don't currently use fork anywhere (or if we do it's by mistake!), so
[lyx.git] / src / frontends / support / LyXImage_X.C
1 /* This file is part of
2  * =================================================
3  * 
4  *          LyX, The Document Processor
5  *          Copyright 1995 Matthias Ettrich.
6  *          Copyright 1995-2000 The LyX Team.
7  *
8  *          This file Copyright 2000 Baruch Even
9  * ================================================= */
10
11 #include <config.h>
12 #include "LyXImage.h"
13
14 #include FORMS_H_LOCATION
15
16 #include "support/LAssert.h"
17
18 LyXImage::LyXImage()
19         : pixmap_(0), pixmapInitialized(false), width_(0), height_(0)
20 {}
21
22 LyXImage::LyXImage(Pixmap pixmap, unsigned int width, unsigned int height)
23         : pixmap_(pixmap), pixmapInitialized(true), width_(width), height_(height)
24 {}
25
26 LyXImage::~LyXImage()
27 {
28         if (pixmapInitialized)
29                 XFreePixmap(fl_get_display(), pixmap_);
30 }
31
32 Pixmap
33 LyXImage::getPixmap() const
34 {
35         lyx::Assert(pixmapInitialized);
36                 
37         return pixmap_;
38 }