~ubuntu-branches/ubuntu/saucy/cairo-dock-plug-ins/saucy

« back to all changes in this revision

Viewing changes to Animated-icons/src/applet-struct.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-08-26 21:07:39 UTC
  • Revision ID: james.westby@ubuntu.com-20090826210739-gyjuuqezrzuluao4
Tags: upstream-2.0.8.1
ImportĀ upstreamĀ versionĀ 2.0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
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.
 
11
*
 
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/>.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __CD_APPLET_STRUCT__
 
22
#define  __CD_APPLET_STRUCT__
 
23
 
 
24
#include <cairo-dock.h>
 
25
 
 
26
#define CD_ANIMATIONS_SPOT_HEIGHT 12
 
27
 
 
28
typedef enum {
 
29
        CD_SQUARE_MESH=0,
 
30
        CD_CUBE_MESH,
 
31
        CD_CAPSULE_MESH,
 
32
        CD_ANIMATIONS_NB_MESH
 
33
        } CDAnimationsMeshType;
 
34
 
 
35
typedef enum {
 
36
        CD_HORIZONTAL_STRECTH=0,
 
37
        CD_VERTICAL_STRECTH,
 
38
        CD_CORNER_STRECTH,
 
39
        CD_ANIMATIONS_NB_STRECTH
 
40
        } CDAnimationsStretchType;
 
41
 
 
42
typedef enum {
 
43
        CD_ANIMATIONS_BOUNCE=0,
 
44
        CD_ANIMATIONS_ROTATE,
 
45
        CD_ANIMATIONS_BLINK,
 
46
        CD_ANIMATIONS_PULSE,
 
47
        CD_ANIMATIONS_WOBBLY,
 
48
        CD_ANIMATIONS_WAVE,
 
49
        CD_ANIMATIONS_SPOT,
 
50
        CD_ANIMATIONS_NB_EFFECTS
 
51
        } CDAnimationsEffects;
 
52
 
 
53
//\___________ structure containing the applet's configuration parameters.
 
54
struct _AppletConfig {
 
55
        gint iRotationDuration;
 
56
        gboolean bContinueRotation;
 
57
        CDAnimationsMeshType iMeshType;
 
58
        GLfloat pMeshColor[4];
 
59
        
 
60
        gint iSpotDuration;
 
61
        gboolean bContinueSpot;
 
62
        GLfloat pSpotColor[3];
 
63
        GLfloat pHaloColor[4];
 
64
        gdouble pRaysColor1[3];
 
65
        gdouble pRaysColor2[3];
 
66
        gboolean bMysticalRays;
 
67
        gint iNbRaysParticles;
 
68
        gint iRaysParticleSize;
 
69
        gdouble fRaysParticleSpeed;
 
70
        
 
71
        gboolean bContinueWobbly;
 
72
        gint iNbGridNodes;
 
73
        CDAnimationsStretchType iInitialStrecth;
 
74
        gdouble fSpringConstant;
 
75
        gdouble fFriction;
 
76
        
 
77
        gint iWaveDuration;
 
78
        gboolean bContinueWave;
 
79
        gdouble fWaveWidth;
 
80
        gdouble fWaveAmplitude;
 
81
        
 
82
        gint iPulseDuration;
 
83
        gboolean bContinuePulse;
 
84
        gdouble fPulseZoom;
 
85
        gboolean bPulseSameShape;
 
86
        
 
87
        gint iBounceDuration;
 
88
        gboolean bContinueBounce;
 
89
        gdouble fBounceResize;
 
90
        gdouble fBounceFlatten;
 
91
        
 
92
        gint iBlinkDuration;
 
93
        gboolean bContinueBlink;
 
94
        
 
95
        CDAnimationsEffects iEffectsOnMouseOver[CD_ANIMATIONS_NB_EFFECTS];
 
96
        CDAnimationsEffects iEffectsOnClick[CAIRO_DOCK_NB_TYPES][CD_ANIMATIONS_NB_EFFECTS];
 
97
        gint iNbRoundsOnClick[CAIRO_DOCK_NB_TYPES];
 
98
        } ;
 
99
 
 
100
//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc.
 
101
struct _AppletData {
 
102
        GLuint iChromeTexture;
 
103
        GLuint iCallList[CD_ANIMATIONS_NB_MESH];
 
104
        GLuint iSpotTexture;
 
105
        GLuint iHaloTexture;
 
106
        GLuint iSpotFrontTexture;
 
107
        GLuint iRaysTexture;
 
108
        gint iAnimationID[CD_ANIMATIONS_NB_EFFECTS];
 
109
        } ;
 
110
 
 
111
typedef struct _CDAnimationGridNode {
 
112
        gdouble x, y;
 
113
        gdouble vx, vy;
 
114
        gdouble fx, fy;
 
115
        gdouble rk[5][4];
 
116
        } CDAnimationGridNode;
 
117
 
 
118
#define CD_WAVE_NB_POINTS 9
 
119
 
 
120
typedef struct _CDAnimationData {
 
121
        gdouble fRotationSpeed;
 
122
        gdouble fRotationAngle;
 
123
        gdouble fRotationBrake;
 
124
        gdouble fAdjustFactor;
 
125
        gboolean bRotationBeginning;
 
126
        gdouble fRotateWidthFactor;
 
127
        
 
128
        gdouble fIconOffsetY;
 
129
        gdouble fRadiusFactor;
 
130
        gdouble fHaloRotationAngle;
 
131
        CairoParticleSystem *pRaysSystem;
 
132
        
 
133
        gboolean bIsWobblying;
 
134
        CDAnimationGridNode gridNodes[4][4];
 
135
        GLfloat pCtrlPts[4][4][3];
 
136
        gint iWobblyCount;
 
137
        gdouble fWobblyWidthFactor, fWobblyHeightFactor;
 
138
        
 
139
        gboolean bIsWaving;
 
140
        gdouble fWavePosition;
 
141
        gint iNumActiveNodes;
 
142
        GLfloat pVertices[3*(2*CD_WAVE_NB_POINTS+2)];
 
143
        GLfloat pCoords[2*(2*CD_WAVE_NB_POINTS+2)];
 
144
        GLfloat pColors[4*(2*CD_WAVE_NB_POINTS+2)];
 
145
        
 
146
        gdouble fPulseSpeed;
 
147
        gdouble fPulseAlpha;
 
148
        
 
149
        gint iNumRound;
 
150
        
 
151
        gboolean bIsBouncing;
 
152
        gint iBounceCount;
 
153
        gdouble fElevation;
 
154
        gdouble fFlattenFactor;
 
155
        gdouble fResizeFactor;
 
156
        
 
157
        gboolean bIsBlinking;
 
158
        gint iBlinkCount;
 
159
        gdouble fBlinkAlpha;
 
160
        
 
161
        gint iReflectShadeCount;
 
162
        } CDAnimationData;
 
163
 
 
164
#endif