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

« back to all changes in this revision

Viewing changes to clock/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_CLOCK_STRUCT__
 
22
#define  __CD_CLOCK_STRUCT__
 
23
 
 
24
#include <cairo-dock.h>
 
25
#include <time.h>
 
26
 
 
27
//Frame de fond pour chaque partie de l'heure
 
28
typedef struct {
 
29
        int iWidth;
 
30
        int iHeight;
 
31
        int iXOffset;
 
32
        int iYOffset;
 
33
        cairo_surface_t *pFrameSurface;
 
34
} ClockDigitalFrame;
 
35
 
 
36
//Texte de l'heure.
 
37
typedef struct {
 
38
        int iXOffset;
 
39
        int iYOffset;
 
40
        cairo_surface_t *pTextSurface;
 
41
} ClockDigitalText;
 
42
 
 
43
//Mode digital de l'horloge, contient tout ce dont on a besoin
 
44
//Surfaces et paramètres X/Y/W/H
 
45
typedef struct {
 
46
 ClockDigitalFrame pFrame[4];
 
47
 ClockDigitalText pText[4];
 
48
 gboolean bSecondCapable;
 
49
 int iFrameSpacing;
 
50
 int i12modeWidth;
 
51
 int i12modeHeight;
 
52
 int i12modeXOffset;
 
53
 int i12modeYOffset;
 
54
 int i12modeFrame;
 
55
} ClockDigital;
 
56
 
 
57
typedef enum _LayerElement
 
58
{
 
59
        CLOCK_DROP_SHADOW = 0,
 
60
        CLOCK_FACE,
 
61
        CLOCK_MARKS,
 
62
        CLOCK_HOUR_HAND_SHADOW,
 
63
        CLOCK_MINUTE_HAND_SHADOW,
 
64
        CLOCK_SECOND_HAND_SHADOW,
 
65
        CLOCK_HOUR_HAND,
 
66
        CLOCK_MINUTE_HAND,
 
67
        CLOCK_SECOND_HAND,
 
68
        CLOCK_FACE_SHADOW,
 
69
        CLOCK_GLASS,
 
70
        CLOCK_FRAME,
 
71
        CLOCK_ELEMENTS
 
72
} LayerElement;
 
73
 
 
74
typedef enum _SurfaceKind
 
75
{
 
76
        KIND_BACKGROUND = 0,
 
77
        KIND_FOREGROUND,
 
78
        KIND_HOUR,
 
79
        KIND_MINUTE,
 
80
        KIND_SECOND,
 
81
} SurfaceKind;
 
82
 
 
83
 
 
84
typedef struct {
 
85
        int iHour;
 
86
        int iMinute;
 
87
        int iDayOfWeek;
 
88
        int iDayOfMonth;
 
89
        gchar *cMessage;
 
90
        gchar *cCommand;
 
91
        } CDClockAlarm;
 
92
 
 
93
 
 
94
struct _AppletConfig {
 
95
        CairoDockInfoDisplay iShowDate;
 
96
        gboolean bShowSeconds;
 
97
        gboolean bOldStyle;
 
98
        gboolean b24Mode;
 
99
        double fTextColor[4];
 
100
        double fDateColor[4];
 
101
        gchar *cThemePath;
 
102
        GPtrArray *pAlarms;
 
103
        gchar *cSetupTimeCommand;
 
104
        gchar *cFont;
 
105
        gint iWeight;
 
106
        gchar *cLocation;
 
107
        gchar *cDigital;
 
108
        gint iSmoothAnimationDuration;
 
109
        } ;
 
110
 
 
111
struct _AppletData {
 
112
        cairo_surface_t *pBackgroundSurface;
 
113
        cairo_surface_t *pForegroundSurface;
 
114
        RsvgDimensionData DimensionData;
 
115
        RsvgDimensionData needleDimension;
 
116
        gint iNeedleRealWidth, iNeedleRealHeight;
 
117
        gdouble iNeedleOffsetX, iNeedleOffsetY;
 
118
        gdouble fNeedleScale;
 
119
        RsvgHandle *pSvgHandles[CLOCK_ELEMENTS];
 
120
        guint iSidUpdateClock;
 
121
        GPid iAlarmPID;
 
122
        CairoDialog *pCalendarDialog;
 
123
        gchar *cSystemLocation;
 
124
        gint iLastCheckedMinute, iLastCheckedDay, iLastCheckedMonth, iLastCheckedYear;
 
125
        struct tm currentTime;
 
126
        
 
127
        ClockDigital pDigitalClock;
 
128
        
 
129
        GLuint iBgTexture, iFgTexture, iHourNeedleTexture, iMinuteNeedleTexture, iSecondNeedleTexture, iDateTexture;
 
130
        gint iNeedleWidth, iNeedleHeight;
 
131
        gint iDateWidth, iDateHeight;
 
132
        gint iSmoothAnimationStep;
 
133
        } ;
 
134
 
 
135
#endif
 
136