| 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 |
#include <glib/gstdio.h> |
| 27 |
|
| 28 |
typedef enum { |
| 29 |
SLIDER_DEFAULT = 0, |
| 30 |
SLIDER_FADE, |
| 31 |
SLIDER_BLANK_FADE, |
| 32 |
SLIDER_FADE_IN_OUT, |
| 33 |
SLIDER_SIDE_KICK, |
| 34 |
SLIDER_DIAPORAMA, |
| 35 |
SLIDER_GROW_UP, |
| 36 |
SLIDER_SHRINK_DOWN, |
| 37 |
SLIDER_CUBE, |
| 38 |
SLIDER_RANDOM, |
| 39 |
SLIDER_NB_ANIMATION |
| 40 |
} SliderAnimation; |
| 41 |
|
| 42 |
typedef enum { |
| 43 |
SLIDER_PAUSE = 0, |
| 44 |
SLIDER_OPEN_IMAGE, |
| 45 |
SLIDER_OPEN_FOLDER, |
| 46 |
SLIDER_NB_CLICK_OPTION |
| 47 |
} SliderClickOption; |
| 48 |
|
| 49 |
typedef struct { |
| 50 |
double fImgX; |
| 51 |
double fImgY; |
| 52 |
double fImgW; |
| 53 |
double fImgH; |
| 54 |
} SliderImageArea; |
| 55 |
|
| 56 |
typedef enum { |
| 57 |
SLIDER_UNKNOWN_FORMAT = 0, |
| 58 |
SLIDER_PNG, |
| 59 |
SLIDER_JPG, |
| 60 |
SLIDER_SVG, |
| 61 |
SLIDER_GIF, |
| 62 |
SLIDER_XPM, |
| 63 |
SLIDER_NB_IMAGE_FORMAT |
| 64 |
} SliderImageFormat; |
| 65 |
|
| 66 |
typedef struct { |
| 67 |
gchar *cPath; |
| 68 |
gint iSize; |
| 69 |
SliderImageFormat iFormat; |
| 70 |
gint iOrientation; |
| 71 |
gboolean bGotExifData; |
| 72 |
} SliderImage; |
| 73 |
|
| 74 |
//\___________ structure containing the applet's configuration parameters. |
| 75 |
struct _AppletConfig { |
| 76 |
gint iSlideTime; |
| 77 |
gchar *cDirectory; |
| 78 |
gboolean bSubDirs; |
| 79 |
gboolean bRandom; |
| 80 |
gboolean bNoStretch; |
| 81 |
gboolean bFillIcon; |
| 82 |
gboolean bImageName; |
| 83 |
gboolean bGetExifDataAtOnce; |
| 84 |
guint iBackgroundType; |
| 85 |
gdouble pBackgroundColor[4]; |
| 86 |
SliderAnimation iAnimation; |
| 87 |
gint iNbAnimationStep; |
| 88 |
SliderClickOption iClickOption; |
| 89 |
SliderClickOption iMiddleClickOption; |
| 90 |
gboolean bUseThread; // plante sur certaines images (svg) dans X :-( |
| 91 |
gint iFrameWidth; |
| 92 |
} ; |
| 93 |
|
| 94 |
//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc. |
| 95 |
struct _AppletData { |
| 96 |
GList *pList; // list d'images. |
| 97 |
GList *pElement; // pointeur sur l'element courant de la liste. |
| 98 |
GList *pExifElement; // pointeur sur l'element courant de la liste pour la recuperation des donnees exif. |
| 99 |
guint iSidExifIdle; // SID de la tache exif. |
| 100 |
guint iTimerID; // timer d'attente de la prochaine image. |
| 101 |
gboolean bPause; |
| 102 |
gdouble fAnimAlpha; // ces 3 variables sont pour les animations. |
| 103 |
gint iAnimCNT; |
| 104 |
gint sens; |
| 105 |
SliderImageArea slideArea; // aire de l'image courante. |
| 106 |
SliderImageArea prevSlideArea; // aire de l'image precedente. |
| 107 |
cairo_surface_t* pCairoSurface; // surface courante. |
| 108 |
cairo_surface_t* pPrevCairoSurface; // surface precedente. |
| 109 |
GLuint iTexture; // texture courante. |
| 110 |
GLuint iPrevTexture; // texture precedente. |
| 111 |
gint iSurfaceWidth, iSurfaceHeight; // dimension de la zone de dessin. |
| 112 |
SliderAnimation iAnimation; // animation de transition courante. |
| 113 |
GldiTask *pMeasureDirectory; // mesure pour parcourir le repertoire courant. |
| 114 |
GldiTask *pMeasureImage; // mesure pour charger l'image courante. |
| 115 |
guint iScrollID; |
| 116 |
gint iNbScroll; |
| 117 |
gchar *cSelectedImagePath; // donnee du menu |
| 118 |
GList *pAppList; // donnee du menu |
| 119 |
gchar *cDirectory; |
| 120 |
gboolean bSubDirs; |
| 121 |
gboolean bRandom; |
| 122 |
} ; |
| 123 |
|
| 124 |
|
| 125 |
#endif |