| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#include <string.h> |
| 21 |
|
| 22 |
#include "applet-struct.h" |
| 23 |
#include "applet-config.h" |
| 24 |
|
| 25 |
|
| 26 |
CD_APPLET_GET_CONFIG_BEGIN |
| 27 |
|
| 28 |
myConfig.cThemePath = CD_CONFIG_GET_THEME_PATH ("Configuration", "theme", "themes", "Classic"); |
| 29 |
|
| 30 |
myConfig.iDelayBetweenChanges = MAX (2, CD_CONFIG_GET_INTEGER ("Configuration", "change delay")); |
| 31 |
|
| 32 |
myConfig.fAlpha = CD_CONFIG_GET_DOUBLE ("Configuration", "alpha"); |
| 33 |
|
| 34 |
myConfig.bFree = CD_CONFIG_GET_BOOLEAN ("Configuration", "free"); |
| 35 |
|
| 36 |
myConfig.iGroundOffset = CD_CONFIG_GET_INTEGER ("Configuration", "ground"); |
| 37 |
CD_APPLET_GET_CONFIG_END |
| 38 |
|
| 39 |
|
| 40 |
CD_APPLET_RESET_CONFIG_BEGIN |
| 41 |
g_free (myConfig.cThemePath); |
| 42 |
CD_APPLET_RESET_CONFIG_END |
| 43 |
|
| 44 |
|
| 45 |
static void _penguin_reset_one_animation (PenguinAnimation *pAnimation) |
| 46 |
{ |
| 47 |
if (pAnimation->pSurfaces != NULL) |
| 48 |
{ |
| 49 |
int i, j; |
| 50 |
for (i = 0; i < pAnimation->iNbDirections; i ++) |
| 51 |
{ |
| 52 |
for (j = 0; j < pAnimation->iNbFrames; j ++) |
| 53 |
{ |
| 54 |
cairo_surface_destroy (pAnimation->pSurfaces[i][j]); |
| 55 |
} |
| 56 |
g_free (pAnimation->pSurfaces[i]); |
| 57 |
pAnimation->pSurfaces[i] = NULL; |
| 58 |
} |
| 59 |
g_free (pAnimation->pSurfaces); |
| 60 |
pAnimation->pSurfaces = NULL; |
| 61 |
} |
| 62 |
if (pAnimation->iTexture != 0) |
| 63 |
{ |
| 64 |
_cairo_dock_delete_texture (pAnimation->iTexture); |
| 65 |
pAnimation->iTexture = 0; |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
void cd_penguin_reset_data (GldiModuleInstance *myApplet) |
| 70 |
{ |
| 71 |
int i; |
| 72 |
for (i = 0; i < myData.iNbAnimations; i++) |
| 73 |
{ |
| 74 |
_penguin_reset_one_animation (&myData.pAnimations[i]); |
| 75 |
} |
| 76 |
|
| 77 |
g_free (myData.pAnimations); |
| 78 |
myData.pAnimations = NULL; |
| 79 |
g_free (myData.pBeginningAnimations); |
| 80 |
myData.pBeginningAnimations = NULL; |
| 81 |
g_free (myData.pEndingAnimations); |
| 82 |
myData.pEndingAnimations = NULL; |
| 83 |
g_free (myData.pGoUpAnimations); |
| 84 |
myData.pGoUpAnimations = NULL; |
| 85 |
g_free (myData.pMovmentAnimations); |
| 86 |
myData.pMovmentAnimations = NULL; |
| 87 |
g_free (myData.pRestAnimations); |
| 88 |
myData.pRestAnimations = NULL; |
| 89 |
} |
| 90 |
|
| 91 |
CD_APPLET_RESET_DATA_BEGIN |
| 92 |
cd_penguin_reset_data (myApplet); |
| 93 |
CD_APPLET_RESET_DATA_END |