1
// Transparent.hh for FbTk - Fluxbox Toolkit
2
// Copyright (c) 2003 Henrik Kinnunen (fluxgen at fluxbox dot org)
4
// Permission is hereby granted, free of charge, to any person obtaining a
5
// copy of this software and associated documentation files (the "Software"),
6
// to deal in the Software without restriction, including without limitation
7
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
// and/or sell copies of the Software, and to permit persons to whom the
9
// Software is furnished to do so, subject to the following conditions:
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
// DEALINGS IN THE SOFTWARE.
22
// $Id: Transparent.hh 3932 2005-04-10 18:18:14Z simonb $
24
#ifndef FBTK_TRANSPARENT_HH
25
#define FBTK_TRANSPARENT_HH
31
/// renders to drawable together with an alpha mask
34
Transparent(Drawable source, Drawable dest, unsigned char alpha, int screen_num);
37
void setAlpha(unsigned char alpha);
38
/// sets source drawable
39
void setSource(Drawable src, int screen_num);
40
/// sets destination drawable
41
void setDest(Drawable dest, int screen_num);
44
renders to dest from src with specified coordinates and size
46
void render(int src_x, int src_y,
47
int dest_x, int dest_y,
48
unsigned int width, unsigned int height) const;
50
unsigned char alpha() const { return m_alpha; }
51
Drawable dest() const { return m_dest; }
52
Drawable source() const { return m_source; }
54
static bool haveComposite(bool for_real = false);
55
static bool haveRender() { if (!s_init) init(); return s_render; }
56
static void usePseudoTransparent(bool no_composite);
60
void allocAlpha(unsigned char newval);
61
unsigned long m_alpha_pic;
62
unsigned long m_src_pic;
63
unsigned long m_dest_pic;
64
Drawable m_source, m_dest;
65
unsigned char m_alpha;
68
static bool s_render; ///< wheter we have RENDER support
69
static bool s_composite; ///< wheter we have Composite support
73
}; // end namespace FbTk
75
#endif // FBTK_TRANSPARENT_HH