2003-04-25 12:29:49 +00:00
|
|
|
// FbPixmap.hh for FbTk - Fluxbox ToolKit
|
2005-01-24 18:02:34 +00:00
|
|
|
// Copyright (c) 2003 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
2003-04-25 12:29:49 +00:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the "Software"),
|
|
|
|
// to deal in the Software without restriction, including without limitation
|
|
|
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
// and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
// Software is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
// DEALINGS IN THE SOFTWARE.
|
|
|
|
|
2004-11-19 11:37:27 +00:00
|
|
|
// $Id$
|
2003-04-25 12:29:49 +00:00
|
|
|
|
|
|
|
#ifndef FBTK_FBPIXMAP_HH
|
|
|
|
#define FBTK_FBPIXMAP_HH
|
|
|
|
|
2003-04-29 08:53:24 +00:00
|
|
|
#include "FbDrawable.hh"
|
|
|
|
|
2003-04-25 12:29:49 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
|
|
|
namespace FbTk {
|
|
|
|
|
|
|
|
/// a wrapper for X Pixmap
|
2003-04-29 08:53:24 +00:00
|
|
|
class FbPixmap:public FbDrawable {
|
2003-04-25 12:29:49 +00:00
|
|
|
public:
|
|
|
|
FbPixmap();
|
2003-04-27 00:12:17 +00:00
|
|
|
/// copy pixmap
|
2004-04-26 21:57:32 +00:00
|
|
|
FbPixmap(const FbPixmap ©);
|
2003-04-27 00:12:17 +00:00
|
|
|
/// creates a FbPixmap from X pixmap
|
|
|
|
explicit FbPixmap(Pixmap pm);
|
2004-01-11 12:48:46 +00:00
|
|
|
FbPixmap(const FbDrawable &src,
|
|
|
|
unsigned int width, unsigned int height,
|
|
|
|
int depth);
|
2003-04-25 12:29:49 +00:00
|
|
|
FbPixmap(Drawable src,
|
|
|
|
unsigned int width, unsigned int height,
|
|
|
|
int depth);
|
2003-04-27 00:12:17 +00:00
|
|
|
|
2004-01-11 12:48:46 +00:00
|
|
|
virtual ~FbPixmap();
|
2003-04-27 00:12:17 +00:00
|
|
|
|
2003-04-25 12:29:49 +00:00
|
|
|
void copy(const FbPixmap &the_copy);
|
2003-08-11 14:59:07 +00:00
|
|
|
void copy(Pixmap pixmap);
|
2003-07-10 11:55:01 +00:00
|
|
|
/// rotates the pixmap 90 deg, not implemented!
|
|
|
|
void rotate();
|
2003-04-27 23:55:08 +00:00
|
|
|
/// scales the pixmap to specified size
|
|
|
|
void scale(unsigned int width, unsigned int height);
|
2003-09-10 21:28:13 +00:00
|
|
|
void resize(unsigned int width, unsigned int height);
|
2004-07-05 23:51:57 +00:00
|
|
|
/// tiles the pixmap to specified size
|
|
|
|
void tile(unsigned int width, unsigned int height);
|
2003-04-27 23:55:08 +00:00
|
|
|
/// drops pixmap and returns it
|
|
|
|
Pixmap release();
|
2003-04-27 00:12:17 +00:00
|
|
|
|
2003-04-25 12:29:49 +00:00
|
|
|
FbPixmap &operator = (const FbPixmap ©);
|
2003-04-27 00:12:17 +00:00
|
|
|
/// sets new pixmap
|
|
|
|
FbPixmap &operator = (Pixmap pm);
|
2003-04-25 12:29:49 +00:00
|
|
|
|
|
|
|
inline Drawable drawable() const { return m_pm; }
|
|
|
|
inline unsigned int width() const { return m_width; }
|
|
|
|
inline unsigned int height() const { return m_height; }
|
|
|
|
inline int depth() const { return m_depth; }
|
|
|
|
|
2004-09-09 14:29:10 +00:00
|
|
|
static Pixmap getRootPixmap(int screen_num);
|
2003-04-27 23:55:08 +00:00
|
|
|
|
2003-04-25 12:29:49 +00:00
|
|
|
private:
|
|
|
|
void free();
|
|
|
|
void create(Drawable src,
|
|
|
|
unsigned int width, unsigned int height,
|
|
|
|
int depth);
|
|
|
|
Pixmap m_pm;
|
|
|
|
unsigned int m_width, m_height;
|
2004-01-08 22:07:58 +00:00
|
|
|
int m_depth;
|
2003-04-25 12:29:49 +00:00
|
|
|
};
|
|
|
|
|
2003-12-16 17:06:52 +00:00
|
|
|
} // end namespace FbTk
|
2003-04-25 12:29:49 +00:00
|
|
|
|
|
|
|
#endif // FBTK_FBPIXMAP_HH
|
|
|
|
|