~jgonzalezdr/cairo-dock-plug-ins/suspend-workaround-applet_3.3

« back to all changes in this revision

Viewing changes to clock/src/applet-theme.c

  • Committer: Fabrice Rey
  • Date: 2013-05-19 17:26:37 UTC
  • Revision ID: fabounet03@gmail.com-20130519172637-cc4oyb5q3z0jd139
Here is quite a huge commit; it's "just" to update to the new core API

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        "clock-frame.svg" };
41
41
 
42
42
 
43
 
void cd_clock_load_theme (CairoDockModuleInstance *myApplet)
 
43
void cd_clock_load_theme (GldiModuleInstance *myApplet)
44
44
{
45
45
        cd_message ("%s (%s)", __func__, myConfig.cThemePath);
46
46
        //\_______________ On charge le theme choisi (on n'a pas besoin de connaitre les dimmensions de l'icone).
111
111
}
112
112
 
113
113
 
114
 
static void paint_background (CairoDockModuleInstance *myApplet, cairo_t* pDrawingContext)
 
114
static void paint_background (GldiModuleInstance *myApplet, cairo_t* pDrawingContext)
115
115
{
116
116
        if (myData.pSvgHandles[CLOCK_DROP_SHADOW] != NULL)
117
117
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_DROP_SHADOW], pDrawingContext);
120
120
        if (myData.pSvgHandles[CLOCK_MARKS] != NULL)
121
121
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_MARKS], pDrawingContext);
122
122
}
123
 
static void paint_foreground (CairoDockModuleInstance *myApplet, cairo_t* pDrawingContext)
 
123
static void paint_foreground (GldiModuleInstance *myApplet, cairo_t* pDrawingContext)
124
124
{
125
125
        if (myData.pSvgHandles[CLOCK_FACE_SHADOW] != NULL)
126
126
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_FACE_SHADOW], pDrawingContext);
129
129
        if (myData.pSvgHandles[CLOCK_FRAME] != NULL)
130
130
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_FRAME], pDrawingContext);
131
131
}
132
 
static cairo_surface_t* cd_clock_create_bg_surface (CairoDockModuleInstance *myApplet, int iWidth, int iHeight, SurfaceKind kind)
 
132
static cairo_surface_t* cd_clock_create_bg_surface (GldiModuleInstance *myApplet, int iWidth, int iHeight, SurfaceKind kind)
133
133
{
134
134
        //g_print ("%s (%dx%d)\n", __func__, iWidth, iHeight);
135
135
        cairo_surface_t* pNewSurface = cairo_dock_create_blank_surface (iWidth, iHeight);
166
166
        return pNewSurface;
167
167
}
168
168
 
169
 
static void paint_hour (CairoDockModuleInstance *myApplet, cairo_t* pDrawingContext)
 
169
static void paint_hour (GldiModuleInstance *myApplet, cairo_t* pDrawingContext)
170
170
{
171
171
        double fShadowOffsetX = -0.75f;
172
172
        double fShadowOffsetY = 0.75f;
178
178
        if (myData.pSvgHandles[CLOCK_HOUR_HAND] != NULL)
179
179
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_HOUR_HAND], pDrawingContext);
180
180
}
181
 
static void paint_minute (CairoDockModuleInstance *myApplet, cairo_t* pDrawingContext)
 
181
static void paint_minute (GldiModuleInstance *myApplet, cairo_t* pDrawingContext)
182
182
{
183
183
        double fShadowOffsetX = -0.75f;
184
184
        double fShadowOffsetY = 0.75f;
190
190
        if (myData.pSvgHandles[CLOCK_MINUTE_HAND] != NULL)
191
191
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_MINUTE_HAND], pDrawingContext);
192
192
}
193
 
static void paint_second (CairoDockModuleInstance *myApplet, cairo_t* pDrawingContext)
 
193
static void paint_second (GldiModuleInstance *myApplet, cairo_t* pDrawingContext)
194
194
{
195
195
        double fShadowOffsetX = -0.75f;
196
196
        double fShadowOffsetY = 0.75f;
202
202
        if (myData.pSvgHandles[CLOCK_SECOND_HAND] != NULL)
203
203
                rsvg_handle_render_cairo (myData.pSvgHandles[CLOCK_SECOND_HAND], pDrawingContext);
204
204
}
205
 
static cairo_surface_t *create_needle_surface (CairoDockModuleInstance *myApplet, cairo_t* pSourceContext, SurfaceKind kind)
 
205
static cairo_surface_t *create_needle_surface (GldiModuleInstance *myApplet, cairo_t* pSourceContext, SurfaceKind kind)
206
206
{
207
207
        cairo_surface_t* pNewSurface = cairo_dock_create_blank_surface (myData.iNeedleWidth, myData.iNeedleHeight + 0);  // +1 pour les ombres.
208
208
        g_return_val_if_fail (cairo_surface_status (pNewSurface) == CAIRO_STATUS_SUCCESS, NULL);
240
240
        return pNewSurface;
241
241
}
242
242
 
243
 
void cd_clock_load_back_and_fore_ground (CairoDockModuleInstance *myApplet)
 
243
void cd_clock_load_back_and_fore_ground (GldiModuleInstance *myApplet)
244
244
{
245
245
        int iWidth, iHeight;
246
246
        CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight);
263
263
        }
264
264
}
265
265
 
266
 
void cd_clock_load_textures (CairoDockModuleInstance *myApplet)
 
266
void cd_clock_load_textures (GldiModuleInstance *myApplet)
267
267
{
268
268
        if (myData.pBackgroundSurface != NULL)
269
269
                myData.iBgTexture = cairo_dock_create_texture_from_surface (myData.pBackgroundSurface);
308
308
 
309
309
 
310
310
 
311
 
void cd_clock_clear_theme (CairoDockModuleInstance *myApplet, gboolean bClearAll)
 
311
void cd_clock_clear_theme (GldiModuleInstance *myApplet, gboolean bClearAll)
312
312
{
313
313
        if (myData.pBackgroundSurface != NULL)
314
314
        {