00001 #ifndef BCPIXMAP_H
00002 #define BCPIXMAP_H
00003
00004 #include <X11/Xlib.h>
00005
00006 #if defined(HAVE_CONFIG_H)
00007 #include "config.h"
00008 #endif
00009
00010 #ifdef HAVE_XFT
00011 #include <X11/Xft/Xft.h>
00012 #endif
00013
00014 #ifdef HAVE_GL
00015 #include <GL/glx.h>
00016 #endif
00017
00018 #include "bcbitmap.inc"
00019 #include "bcpixmap.inc"
00020 #include "bcwindowbase.inc"
00021 #include "vframe.inc"
00022
00023 class BC_Pixmap
00024 {
00025 public:
00026 BC_Pixmap(BC_WindowBase *parent_window,
00027 VFrame *frame,
00028 int mode = PIXMAP_OPAQUE,
00029 int icon_offset = 0);
00030 BC_Pixmap(BC_WindowBase *parent_window,
00031 int w,
00032 int h);
00033 ~BC_Pixmap();
00034
00035 friend class BC_WindowBase;
00036
00037 void reset();
00038 void resize(int w, int h);
00039
00040 void enable_opengl();
00041 void copy_area(int x, int y, int w, int h, int x2, int y2);
00042
00043 int write_drawable(Drawable &pixmap,
00044 int dest_x,
00045 int dest_y,
00046 int dest_w = -1,
00047 int dest_h = -1,
00048 int src_x = -1,
00049 int src_y = -1);
00050
00051 void draw_pixmap(BC_Pixmap *pixmap,
00052 int dest_x = 0,
00053 int dest_y = 0,
00054 int dest_w = -1,
00055 int dest_h = -1,
00056 int src_x = 0,
00057 int src_y = 0);
00058
00059 void draw_vframe(VFrame *frame,
00060 int dest_x = 0,
00061 int dest_y = 0,
00062 int dest_w = -1,
00063 int dest_h = -1,
00064 int src_x = 0,
00065 int src_y = 0);
00066 int get_w();
00067 int get_h();
00068 int get_w_fixed();
00069 int get_h_fixed();
00070 Pixmap get_pixmap();
00071 Pixmap get_alpha();
00072 int use_alpha();
00073 int use_opaque();
00074
00075 private:
00076 int initialize(BC_WindowBase *parent_window, int w, int h, int mode);
00077
00078 BC_WindowBase *parent_window;
00079 BC_WindowBase *top_level;
00080 Pixmap opaque_pixmap, alpha_pixmap;
00081 void *opaque_xft_draw, *alpha_xft_draw;
00082 #ifdef HAVE_GL
00083 GLXContext gl_pixmap_context;
00084 GLXPixmap gl_pixmap;
00085 #endif
00086 int w, h;
00087 int mode;
00088
00089 GC alpha_gc, copy_gc;
00090 };
00091
00092
00093 #endif