3
* Description: Adds text to pixmap support to Compiz.
7
* Copyright: (C) 2006-2007 Patrick Niklaus, Danny Baumann, Dennis Kasprzyk
8
* Authors: Patrick Niklaus <marex@opencompsiting.org>
9
* Danny Baumann <maniac@opencompositing.org>
10
* Dennis Kasprzyk <onestone@opencompositing.org>
12
* This program is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; either version 2
15
* of the License, or (at your option) any later version.
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
#include <core/core.h>
29
#include <core/pluginclasshandler.h>
30
#include <composite/composite.h>
31
#include <opengl/opengl.h>
33
#include <cairo-xlib-xrender.h>
34
#include <pango/pango.h>
35
#include <pango/pangocairo.h>
37
#include <X11/Xatom.h>
39
#include <text/text.h>
41
class PrivateTextScreen :
42
public PluginClassHandler <PrivateTextScreen, CompScreen, COMPIZ_TEXT_ABI>,
43
public ScreenInterface,
44
public GLScreenInterface
48
PrivateTextScreen (CompScreen *);
49
~PrivateTextScreen ();
51
CompString getWindowName (Window id);
60
CompString getUtf8Property (Window id, Atom atom);
61
CompString getTextProperty (Window id, Atom atom);
72
bool render (const CompText::Attrib &attrib,
73
const CompString &text);
80
bool initCairo (int w,
84
void drawBackground (int x, int y,
85
int width, int height,
89
cairo_surface_t *surface;
91
XRenderPictFormat *format;
92
PangoFontDescription *font;
96
#define TEXT_SCREEN(screen) \
97
PrivateTextScreen *ts = PrivateTextScreen::get (screen);
99
class TextPluginVTable :
100
public CompPlugin::VTableForScreen <PrivateTextScreen>