2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
#include "applet-struct.h"
24
#include "applet-draw.h"
27
void cd_xeyes_render_to_texture (GldiModuleInstance *myApplet, int iWidth, int iHeight)
29
CD_APPLET_START_DRAWING_MY_ICON_OR_RETURN ();
31
_cairo_dock_enable_texture ();
32
_cairo_dock_set_blend_alpha ();
33
_cairo_dock_set_alpha (1.);
35
if (myData.bWink && myData.pEyelidImage)
37
cairo_dock_apply_image_buffer_texture (myData.pToonImage);
39
_cairo_dock_set_blend_pbuffer ();
41
cairo_dock_apply_image_buffer_texture_with_offset (myData.pEyelidImage,
42
-.5*iWidth + myData.iXeyelid + .5*myData.pEyelidImage->iWidth,
43
.5*iHeight - myData.iYeyelid - .5*myData.pEyelidImage->iHeight);
49
_cairo_dock_set_blend_source ();
50
cairo_dock_apply_image_buffer_texture_with_offset (myData.pBgImage,
51
-.5*iWidth + myData.iXbg + .5*myData.pBgImage->iWidth,
52
.5*iHeight - myData.iYbg - .5*myData.pBgImage->iHeight);
54
_cairo_dock_set_blend_alpha ();
56
for (i = 0; i < 2; i ++)
58
if (myData.pPupilImage[i] != 0)
60
cairo_dock_apply_image_buffer_texture_with_offset (myData.pPupilImage[i],
61
-.5*iWidth + myData.fXpupil[i],
62
.5*iHeight - myData.fYpupil[i]);
65
_cairo_dock_set_blend_pbuffer ();
66
cairo_dock_apply_image_buffer_texture (myData.pToonImage);
69
_cairo_dock_disable_texture ();
71
CD_APPLET_FINISH_DRAWING_MY_ICON;
75
void cd_xeyes_render_to_surface (GldiModuleInstance *myApplet, int iWidth, int iHeight)
77
CD_APPLET_START_DRAWING_MY_ICON_OR_RETURN_CAIRO ();
78
///cairo_dock_erase_cairo_context (myDrawContext);
79
if (myData.bWink && myData.pEyelidImage)
81
cairo_dock_apply_image_buffer_surface_with_offset (myData.pToonImage, myDrawContext,
82
.5*(iWidth - myData.pToonImage->iWidth),
83
.5*(iHeight - myData.pToonImage->iHeight),
86
cairo_dock_apply_image_buffer_surface_with_offset (myData.pEyelidImage, myDrawContext,
95
cairo_dock_apply_image_buffer_surface_with_offset (myData.pBgImage, myDrawContext,
102
for (i = 0; i < 2; i ++)
104
if (myData.pPupilImage[i])
106
cairo_dock_apply_image_buffer_surface_with_offset (myData.pPupilImage[i], myDrawContext,
107
myData.fXpupil[i] - .5*myData.pPupilImage[i]->iWidth,
108
myData.fYpupil[i] - .5*myData.pPupilImage[i]->iHeight,
112
cairo_dock_apply_image_buffer_surface_with_offset (myData.pToonImage, myDrawContext,
113
.5*(iWidth - myData.pToonImage->iWidth),
114
.5*(iHeight - myData.pToonImage->iHeight),
117
CD_APPLET_FINISH_DRAWING_MY_ICON_CAIRO;