Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / guicast / bcpixmap.h
blob9d244a93c14de1f5e27470cabd230f221119ac65
1 #ifndef BCPIXMAP_H
2 #define BCPIXMAP_H
4 #include <X11/Xlib.h>
6 #if defined(HAVE_CONFIG_H)
7 #include "config.h"
8 #endif
10 #ifdef HAVE_XFT
11 #include <X11/Xft/Xft.h>
12 #endif
14 #ifdef HAVE_GL
15 #include <GL/glx.h>
16 #endif
18 #include "bcbitmap.inc"
19 #include "bcpixmap.inc"
20 #include "bcwindowbase.inc"
21 #include "vframe.inc"
23 class BC_Pixmap
25 public:
26 BC_Pixmap(BC_WindowBase *parent_window,
27 VFrame *frame,
28 int mode = PIXMAP_OPAQUE,
29 int icon_offset = 0);
30 BC_Pixmap(BC_WindowBase *parent_window,
31 int w,
32 int h);
33 ~BC_Pixmap();
35 friend class BC_WindowBase;
37 void reset();
38 void resize(int w, int h);
39 // OpenGL for pixmaps doesn't seem to be accelerated so it has been discontinued.
40 void enable_opengl();
41 void copy_area(int x, int y, int w, int h, int x2, int y2);
42 // Draw this pixmap onto the drawable pointed to by pixmap.
43 int write_drawable(Drawable &pixmap,
44 int dest_x,
45 int dest_y,
46 int dest_w = -1,
47 int dest_h = -1,
48 int src_x = -1,
49 int src_y = -1);
50 // Draw the pixmap pointed to by pixmap onto this pixmap.
51 void draw_pixmap(BC_Pixmap *pixmap,
52 int dest_x = 0,
53 int dest_y = 0,
54 int dest_w = -1,
55 int dest_h = -1,
56 int src_x = 0,
57 int src_y = 0);
58 // Draw the vframe pointed to by frame onto this pixmap.
59 void draw_vframe(VFrame *frame,
60 int dest_x = 0,
61 int dest_y = 0,
62 int dest_w = -1,
63 int dest_h = -1,
64 int src_x = 0,
65 int src_y = 0);
66 int get_w();
67 int get_h();
68 int get_w_fixed();
69 int get_h_fixed();
70 Pixmap get_pixmap();
71 Pixmap get_alpha();
72 int use_alpha();
73 int use_opaque();
75 private:
76 int initialize(BC_WindowBase *parent_window, int w, int h, int mode);
78 BC_WindowBase *parent_window;
79 BC_WindowBase *top_level;
80 Pixmap opaque_pixmap, alpha_pixmap;
81 void *opaque_xft_draw, *alpha_xft_draw;
82 #ifdef HAVE_GL
83 GLXContext gl_pixmap_context;
84 GLXPixmap gl_pixmap;
85 #endif
86 int w, h;
87 int mode;
88 // GC's only used if alpha pixmap
89 GC alpha_gc, copy_gc;
93 #endif
95 // Local Variables:
96 // mode: C++
97 // c-file-style: "linux"
98 // End: