~cairo-dock-team/ubuntu/precise/cairo-dock/3.0.0.0beta1

« back to all changes in this revision

Viewing changes to src/cairo-dock-config.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2008-09-14 16:26:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080914162612-t6aa8pr2o0qry48o
Tags: 1.6.2.3-0ubuntu1
* New upstream release.
* debian/control
 - Update to 3.8.0 (no change needed).
 - Add libxtst-dev as Build-Depends.
* debian/cairo-dock-data.install
 - Add usr/share/cairo-dock/emblems directory.
* debian/watch
 - Update location.
* debian/rules
 - Add a get-orig-source rule.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include "cairo-dock-dock-manager.h"
34
34
#include "cairo-dock-surface-factory.h"
35
35
#include "cairo-dock-class-manager.h"
 
36
#include "cairo-dock-emblem.h"
36
37
#include "cairo-dock-config.h"
37
38
 
38
39
#define CAIRO_DOCK_TYPE_CONF_FILE_FILE ".cairo-dock-conf-file"
61
62
extern gboolean g_bDynamicReflection;
62
63
extern double g_fAlphaAtRest;
63
64
 
64
 
extern gboolean g_bAutoHide;
65
65
extern double g_fVisibleZoneAlpha;
66
66
extern gboolean g_bSameHorizontality;
67
67
extern double g_fSubDockSizeRatio;
70
70
extern int g_iShowSubDockDelay;
71
71
extern gboolean bShowSubDockOnClick;
72
72
 
73
 
extern int g_iLabelSize;
74
 
extern gchar *g_cLabelPolice;
75
 
extern int g_iLabelWeight;
76
 
extern int g_iLabelStyle;
77
73
extern gboolean g_bLabelForPointedIconOnly;
78
74
extern double g_fLabelAlphaThreshold;
79
75
extern gboolean g_bTextAlwaysHorizontal;
80
 
extern double g_fLabelBackgroundColor[4];
81
 
extern gboolean g_bUseBackgroundForLabel;
82
76
 
83
77
extern gpointer *g_pDefaultIconDirectory;
84
78
static gboolean s_bUserTheme = FALSE;
129
123
extern gboolean g_bMinimizeOnClick;
130
124
extern gboolean g_bCloseAppliOnMiddleClick;
131
125
extern gboolean g_bAutoHideOnFullScreen;
 
126
extern gboolean g_bAutoHideOnMaximized;
132
127
extern gboolean g_bDemandsAttentionWithDialog;
133
128
extern gboolean g_bDemandsAttentionWithAnimation;
134
129
extern gboolean g_bAnimateOnActiveWindow;
135
130
extern double g_fVisibleAppliAlpha;
136
131
extern gboolean g_bHideVisibleApplis;
137
132
extern gboolean g_bAppliOnCurrentDesktopOnly;
 
133
extern int g_bActiveIndicatorAbove;
138
134
 
139
135
extern int g_tIconAuthorizedWidth[CAIRO_DOCK_NB_TYPES];
140
136
extern int g_tIconAuthorizedHeight[CAIRO_DOCK_NB_TYPES];
147
143
extern gboolean g_bRevolveSeparator;
148
144
extern gboolean g_bConstantSeparatorSize;
149
145
 
 
146
extern CairoDockLabelDescription g_iconTextDescription;
 
147
extern CairoDockLabelDescription g_quickInfoTextDescription;
 
148
extern CairoDockLabelDescription g_dialogTextDescription;
 
149
 
150
150
extern int g_iDialogButtonWidth;
151
151
extern int g_iDialogButtonHeight;
152
152
extern double g_fDialogColor[4];
153
153
extern int g_iDialogIconSize;
154
 
extern int g_iDialogMessageSize;
155
 
extern gchar *g_cDialogMessagePolice;
156
 
extern int g_iDialogMessageWeight;
157
 
extern int g_iDialogMessageStyle;
158
 
extern double g_fDialogTextColor[4];
159
154
 
160
155
extern double g_fDeskletColor[4];
161
156
extern double g_fDeskletColorInside[4];
166
161
extern cairo_surface_t *g_pIndicatorSurface[2];
167
162
extern gboolean g_bMixLauncherAppli;
168
163
extern gboolean g_bOverWriteXIcons;
 
164
extern gboolean g_bShowThumbnail;
169
165
extern double g_fIndicatorWidth, g_fIndicatorHeight;
170
166
extern int g_iIndicatorDeltaY;
171
167
extern gboolean g_bLinkIndicatorWithIcon;
 
168
extern gboolean g_bIndicatorAbove;
 
169
 
 
170
extern gboolean g_bPopUp;
172
171
 
173
172
static gchar **g_cUseXIconAppliList = NULL;
174
173
static gboolean s_bLoading = FALSE;
175
174
 
176
 
/**
177
 
*Recupere une cle booleene d'un fichier de cles.
178
 
*@param pKeyFile le fichier de cles.
179
 
*@param cGroupName le com du groupe.
180
 
*@param cKeyName le nom de la cle.
181
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
182
 
*@param bDefaultValue valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
183
 
@Returns la valeur booleene de la cle.
184
 
*/
 
175
 
185
176
gboolean cairo_dock_get_boolean_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, gboolean bDefaultValue, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
186
177
{
187
178
        GError *erreur = NULL;
224
215
        }
225
216
        return bValue;
226
217
}
227
 
/**
228
 
*Recupere une cle entiere d'un fichier de cles.
229
 
*@param pKeyFile le fichier de cles.
230
 
*@param cGroupName le com du groupe.
231
 
*@param cKeyName le nom de la cle.
232
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
233
 
*@param iDefaultValue valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
234
 
@Returns la valeur entiere de la cle.
235
 
*/
 
218
 
236
219
int cairo_dock_get_integer_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, int iDefaultValue, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
237
220
{
238
221
        GError *erreur = NULL;
275
258
        }
276
259
        return iValue;
277
260
}
278
 
/**
279
 
*Recupere une cle flottante d'un fichier de cles.
280
 
*@param pKeyFile le fichier de cles.
281
 
*@param cGroupName le com du groupe.
282
 
*@param cKeyName le nom de la cle.
283
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
284
 
*@param fDefaultValue valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
285
 
@Returns la valeur flottante de la cle.
286
 
*/
 
261
 
287
262
double cairo_dock_get_double_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, double fDefaultValue, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
288
263
{
289
264
        GError *erreur = NULL;
326
301
        }
327
302
        return fValue;
328
303
}
329
 
/**
330
 
*Recupere une cle d'un fichier de cles sous la forme d'une chaine de caractere.
331
 
*@param pKeyFile le fichier de cles.
332
 
*@param cGroupName le com du groupe.
333
 
*@param cKeyName le nom de la cle.
334
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
335
 
*@param cDefaultValue valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
336
 
@Returns la chaine de caractere nouvellement allouee correspondante a la cle.
337
 
*/
 
304
 
338
305
gchar *cairo_dock_get_string_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, const gchar *cDefaultValue, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
339
306
{
340
307
        GError *erreur = NULL;
382
349
        }
383
350
        return cValue;
384
351
}
385
 
/**
386
 
*Recupere une cle d'un fichier de cles sous la forme d'un tableau d'entiers.
387
 
*@param pKeyFile le fichier de cles.
388
 
*@param cGroupName le com du groupe.
389
 
*@param cKeyName le nom de la cle.
390
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
391
 
*@param iValueBuffer tableau qui sera rempli.
392
 
*@param iNbElements nombre d'elements a recuperer; c'est le nombre d'elements du tableau passe en entree.
393
 
*@param iDefaultValues valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
394
 
*/
 
352
 
395
353
void cairo_dock_get_integer_list_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, int *iValueBuffer, int iNbElements, int *iDefaultValues, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
396
354
{
397
355
        GError *erreur = NULL;
455
413
        }
456
414
        g_free (iValuesList);
457
415
}
458
 
/**
459
 
*Recupere une cle d'un fichier de cles sous la forme d'un tableau de doubles.
460
 
*@param pKeyFile le fichier de cles.
461
 
*@param cGroupName le com du groupe.
462
 
*@param cKeyName le nom de la cle.
463
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
464
 
*@param fValueBuffer tableau qui sera rempli.
465
 
*@param iNbElements nombre d'elements a recuperer; c'est le nombre d'elements du tableau passe en entree.
466
 
*@param fDefaultValues valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
467
 
*/
 
416
 
468
417
void cairo_dock_get_double_list_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, double *fValueBuffer, int iNbElements, double *fDefaultValues, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
469
418
{
470
419
        GError *erreur = NULL;
528
477
        }
529
478
        g_free (fValuesList);
530
479
}
531
 
/**
532
 
*Recupere une cle d'un fichier de cles sous la forme d'un tableau de chaines de caracteres.
533
 
*@param pKeyFile le fichier de cles.
534
 
*@param cGroupName le com du groupe.
535
 
*@param cKeyName le nom de la cle.
536
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
537
 
*@param length nombre de chaines de caracteres recuperees.
538
 
*@param cDefaultValues valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
539
 
@Returns un tableau de chaines de caracteres; a liberer avec g_strfreev().
540
 
*/
 
480
 
541
481
gchar **cairo_dock_get_string_list_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, gsize *length, gchar *cDefaultValues, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
542
482
{
543
483
        GError *erreur = NULL;
587
527
        }
588
528
        return cValuesList;
589
529
}
590
 
/**
591
 
*Recupere une cle d'un fichier de cles sous la forme d'un tableau de chaines de caracteres.
592
 
*@param pKeyFile le fichier de cles.
593
 
*@param cGroupName le com du groupe.
594
 
*@param cKeyName le nom de la cle.
595
 
*@param bFlushConfFileNeeded est mis a TRUE si la cle est manquante.
596
 
*@param iDefaultAnimation valeur par defaut a utiliser et a inserer dans le fichier de cles au cas ou la cle est manquante.
597
 
*@Returns le type de l'animation correspondante a la cle.
598
 
*/
 
530
 
599
531
CairoDockAnimationType cairo_dock_get_animation_type_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, CairoDockAnimationType iDefaultAnimation, gchar *cDefaultGroupName, gchar *cDefaultKeyName)
600
532
{
601
533
        CairoDockAnimationType iAnimationType = cairo_dock_get_integer_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, iDefaultAnimation, cDefaultGroupName, cDefaultKeyName);
604
536
        return iAnimationType;
605
537
}
606
538
 
 
539
gchar *cairo_dock_get_file_path_key_value (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, gchar *cDefaultGroupName, gchar *cDefaultKeyName, gchar *cDefaultDir, gchar *cDefaultFileName)
 
540
{
 
541
        gchar *cFileName = cairo_dock_get_string_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, NULL, cDefaultGroupName, cDefaultKeyName);
 
542
        gchar *cFilePath = NULL;
 
543
        if (cFileName != NULL)
 
544
                cFilePath = cairo_dock_generate_file_path (cFileName);
 
545
        else if (cDefaultFileName != NULL && cDefaultDir != NULL)
 
546
                cFilePath = g_strdup_printf ("%s/%s", cDefaultDir, cDefaultFileName);
 
547
        return cFilePath;
 
548
}
 
549
 
607
550
 
608
551
void cairo_dock_read_conf_file (gchar *cConfFilePath, CairoDock *pDock)
609
552
{
634
577
                iScreenBorder = 0;
635
578
 
636
579
        pDock->fAlign = cairo_dock_get_double_key_value (pKeyFile, "Position", "alignment", &bFlushConfFileNeeded, 0.5, NULL, NULL);
637
 
 
 
580
        
638
581
        g_bReserveSpace = cairo_dock_get_boolean_key_value (pKeyFile, "Position", "reserve space", &bFlushConfFileNeeded, FALSE, NULL, NULL);
639
582
 
640
583
        cairo_dock_deactivate_temporary_auto_hide ();
641
 
        g_bAutoHide = cairo_dock_get_boolean_key_value (pKeyFile, "Position", "auto-hide", &bFlushConfFileNeeded, FALSE, "Auto-Hide", "auto-hide");
642
 
 
643
 
 
 
584
        pDock->bAutoHide = cairo_dock_get_boolean_key_value (pKeyFile, "Position", "auto-hide", &bFlushConfFileNeeded, FALSE, "Auto-Hide", "auto-hide");
 
585
        
 
586
        gboolean bPopUpOld = g_bPopUp;
 
587
        g_bPopUp = cairo_dock_get_boolean_key_value (pKeyFile, "Position", "pop-up", &bFlushConfFileNeeded, FALSE, NULL, NULL);
 
588
        
 
589
        
644
590
        //\___________________ On recupere les parametres de la zone visible.
645
591
        gchar *cVisibleZoneImageFile = cairo_dock_get_string_key_value (pKeyFile, "Background", "callback image", &bFlushConfFileNeeded, NULL, "Auto-Hide", "background image");
646
592
 
661
607
 
662
608
        g_bTextAlwaysHorizontal = cairo_dock_get_boolean_key_value (pKeyFile, "System", "always horizontal", &bFlushConfFileNeeded, FALSE, "Labels", NULL);
663
609
 
664
 
 
665
 
        g_free (g_cLabelPolice);
666
 
        g_cLabelPolice = cairo_dock_get_string_key_value (pKeyFile, "Icons", "police", &bFlushConfFileNeeded, "sans", "Labels", NULL);
667
 
 
668
 
        g_iLabelSize = cairo_dock_get_integer_key_value (pKeyFile, "Icons", "size", &bFlushConfFileNeeded, 14, "Labels", NULL);
669
 
 
670
 
        g_iLabelWeight = cairo_dock_get_integer_key_value (pKeyFile, "Icons", "weight", &bFlushConfFileNeeded, 5, "Labels", NULL);
671
 
        g_iLabelWeight = ((PANGO_WEIGHT_HEAVY - PANGO_WEIGHT_ULTRALIGHT) * g_iLabelWeight + 9 * PANGO_WEIGHT_ULTRALIGHT - PANGO_WEIGHT_HEAVY) / 8;  // on se ramene aux intervalles definit par Pango.
672
 
 
 
610
        g_free (g_iconTextDescription.cFont);
 
611
        g_iconTextDescription.cFont = cairo_dock_get_string_key_value (pKeyFile, "Icons", "police", &bFlushConfFileNeeded, "sans", "Labels", NULL);
 
612
 
 
613
        g_iconTextDescription.iSize = cairo_dock_get_integer_key_value (pKeyFile, "Icons", "size", &bFlushConfFileNeeded, 14, "Labels", NULL);
 
614
        
 
615
        int iLabelWeight = cairo_dock_get_integer_key_value (pKeyFile, "Icons", "weight", &bFlushConfFileNeeded, 5, "Labels", NULL);
 
616
        g_iconTextDescription.iWeight = ((PANGO_WEIGHT_HEAVY - PANGO_WEIGHT_ULTRALIGHT) * iLabelWeight + 9 * PANGO_WEIGHT_ULTRALIGHT - PANGO_WEIGHT_HEAVY) / 8;  // on se ramene aux intervalles definit par Pango.
 
617
        
673
618
        gboolean bLabelStyleItalic = cairo_dock_get_boolean_key_value (pKeyFile, "Icons", "italic", &bFlushConfFileNeeded, FALSE, "Labels", NULL);
674
619
        if (bLabelStyleItalic)
675
 
                g_iLabelStyle = PANGO_STYLE_ITALIC;
 
620
                g_iconTextDescription.iStyle  = PANGO_STYLE_ITALIC;
676
621
        else
677
 
                g_iLabelStyle = PANGO_STYLE_NORMAL;
678
 
 
679
 
 
680
 
        if (g_cLabelPolice == NULL)
681
 
                g_iLabelSize = 0;
682
 
 
683
 
        if (g_iLabelSize == 0)
 
622
                g_iconTextDescription.iStyle  = PANGO_STYLE_NORMAL;
 
623
        
 
624
 
 
625
        if (g_iconTextDescription.cFont == NULL)
 
626
                g_iconTextDescription.iSize = 0;
 
627
 
 
628
        if (g_iconTextDescription.iSize == 0)
684
629
        {
685
 
                g_free (g_cLabelPolice);
686
 
                g_cLabelPolice = NULL;
 
630
                g_free (g_iconTextDescription.cFont);
 
631
                g_iconTextDescription.cFont = NULL;
687
632
        }
688
 
 
689
 
        double couleur_label[4] = {0., 0., 0., 0.5};
690
 
        cairo_dock_get_double_list_key_value (pKeyFile, "Icons", "text background color", &bFlushConfFileNeeded, g_fLabelBackgroundColor, 4, couleur_label, NULL, NULL);
691
 
 
692
 
        g_bUseBackgroundForLabel = cairo_dock_get_boolean_key_value (pKeyFile, "Icons", "background for label", &bFlushConfFileNeeded, FALSE, NULL, NULL);
693
 
 
 
633
        
 
634
        double couleur_label[3] = {1., 1., 1.};
 
635
        cairo_dock_get_double_list_key_value (pKeyFile, "Icons", "text color start", &bFlushConfFileNeeded, g_iconTextDescription.fColorStart, 3, couleur_label, NULL, NULL);
 
636
        
 
637
        cairo_dock_get_double_list_key_value (pKeyFile, "Icons", "text color stop", &bFlushConfFileNeeded, g_iconTextDescription.fColorStop, 3, couleur_label, NULL, NULL);
 
638
        
 
639
        g_iconTextDescription.bVerticalPattern = cairo_dock_get_boolean_key_value (pKeyFile, "Icons", "vertical label pattern", &bFlushConfFileNeeded, TRUE, NULL, NULL);
 
640
 
 
641
        double couleur_backlabel[4] = {0., 0., 0., 0.5};
 
642
        cairo_dock_get_double_list_key_value (pKeyFile, "Icons", "text background color", &bFlushConfFileNeeded, g_iconTextDescription.fBackgroundColor, 4, couleur_backlabel, NULL, NULL);
 
643
        
 
644
        g_free (g_quickInfoTextDescription.cFont);
 
645
        memcpy (&g_quickInfoTextDescription, &g_iconTextDescription, sizeof (CairoDockLabelDescription));
 
646
        g_quickInfoTextDescription.cFont = g_strdup (g_iconTextDescription.cFont);
 
647
        g_quickInfoTextDescription.iSize = 12;
 
648
        g_quickInfoTextDescription.iWeight = PANGO_WEIGHT_HEAVY;
 
649
        g_quickInfoTextDescription.iStyle = PANGO_STYLE_NORMAL;
 
650
        
 
651
        gboolean bUseBackgroundForLabel = cairo_dock_get_boolean_key_value (pKeyFile, "Icons", "background for label", &bFlushConfFileNeeded, FALSE, NULL, NULL);
 
652
        if (! bUseBackgroundForLabel)
 
653
                g_iconTextDescription.fBackgroundColor[3] = 0;  // ne sera pas pris en compte.
 
654
        
694
655
 
695
656
        //\___________________ On recupere les parametres du dock en lui-meme.
696
657
        gchar **cIconsTypesList = cairo_dock_get_string_list_key_value (pKeyFile, "Icons", "icon's type order", &bFlushConfFileNeeded, &length, NULL, "Cairo Dock", NULL);
710
671
        }
711
672
        g_strfreev (cIconsTypesList);
712
673
 
 
674
        gboolean bMixAppletsAndLaunchers = cairo_dock_get_boolean_key_value (pKeyFile, "Icons", "mix applets with launchers", &bFlushConfFileNeeded, FALSE , NULL, NULL);
 
675
        if (bMixAppletsAndLaunchers)
 
676
                g_tIconTypeOrder[CAIRO_DOCK_APPLET] = g_tIconTypeOrder[CAIRO_DOCK_LAUNCHER];
 
677
        
713
678
        g_free (g_cMainDockDefaultRendererName);
714
679
        g_cMainDockDefaultRendererName = cairo_dock_get_string_key_value (pKeyFile, "Views", "main dock view", &bFlushConfFileNeeded, CAIRO_DOCK_DEFAULT_RENDERER_NAME, "Cairo Dock", NULL);
715
680
        if (g_cMainDockDefaultRendererName == NULL)
908
873
 
909
874
        g_bCloseAppliOnMiddleClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "close on middle click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
910
875
 
911
 
        g_bAutoHideOnFullScreen = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "auto quick hide", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
 
876
        g_bAutoHideOnFullScreen = (! pDock->bAutoHide) && cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "auto quick hide", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
 
877
        g_bAutoHideOnMaximized = (! pDock->bAutoHide) && cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "auto quick hide on max", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
912
878
 
913
879
        g_bDemandsAttentionWithDialog = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "demands attention with dialog", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
914
880
        g_bDemandsAttentionWithAnimation = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "demands attention with animation", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
921
887
        g_fVisibleAppliAlpha = cairo_dock_get_double_key_value (pKeyFile, "TaskBar", "visibility alpha", &bFlushConfFileNeeded, .7, "Applications", NULL);  // >0 <=> les fenetres minimisees sont transparentes.
922
888
        if (g_bHideVisibleApplis && g_fVisibleAppliAlpha < 0)
923
889
                g_fVisibleAppliAlpha = 0.;  // on inhibe ce parametre, puisqu'il ne sert alors a rien.
924
 
 
 
890
        
 
891
        
 
892
        double fActiveColor[4], couleur_active[4] = {0., 0.4, 0.8, 0.25};
 
893
        cairo_dock_get_double_list_key_value (pKeyFile, "Indicators", "active color", &bFlushConfFileNeeded, fActiveColor, 4, couleur_active, "Icons", NULL);
 
894
        
 
895
        int iActiveLineWidth = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active line width", &bFlushConfFileNeeded, 3, "Icons", NULL);
 
896
        int iActiveCornerRadius = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active corner radius", &bFlushConfFileNeeded, 6, "Icons", NULL);
 
897
        g_bActiveIndicatorAbove = cairo_dock_get_boolean_key_value (pKeyFile, "Indicators", "active frame position", &bFlushConfFileNeeded, TRUE, "Icons", NULL);
 
898
        gchar *cActiveIndicatorImagePath= cairo_dock_get_string_key_value (pKeyFile, "Indicators", "active indicator", &bFlushConfFileNeeded, NULL, NULL, NULL);
 
899
        
925
900
        gboolean bAppliOnCurrentDesktopOnlyOld = g_bAppliOnCurrentDesktopOnly;
926
901
        g_bAppliOnCurrentDesktopOnly = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "current desktop only", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
927
902
 
928
 
        gchar *cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Icons", "indicator image", &bFlushConfFileNeeded, NULL, NULL, NULL);
 
903
        gchar *cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "indicator image", &bFlushConfFileNeeded, NULL, "Icons", NULL);
929
904
        gchar *cIndicatorImagePath;
930
905
        if (cIndicatorImageName != NULL)
931
906
        {
937
912
                cIndicatorImagePath = g_strdup_printf ("%s/%s", CAIRO_DOCK_SHARE_DATA_DIR, CAIRO_DOCK_DEFAULT_INDICATOR_NAME);
938
913
        }
939
914
        
940
 
        double fIndicatorRatio = cairo_dock_get_double_key_value (pKeyFile, "Icons", "indicator ratio", &bFlushConfFileNeeded, 1., NULL, NULL);
941
 
        
942
 
        g_bLinkIndicatorWithIcon = cairo_dock_get_boolean_key_value (pKeyFile, "Icons", "link indicator", &bFlushConfFileNeeded, TRUE, NULL, NULL);
943
 
        
944
 
        g_iIndicatorDeltaY = cairo_dock_get_integer_key_value (pKeyFile, "Icons", "indicator deltaY", &bFlushConfFileNeeded, 2, NULL, NULL);
 
915
        g_bIndicatorAbove = cairo_dock_get_boolean_key_value (pKeyFile, "Indicators", "indicator above", &bFlushConfFileNeeded, FALSE, "Icons", NULL);
 
916
        
 
917
        double fIndicatorRatio = cairo_dock_get_double_key_value (pKeyFile, "Indicators", "indicator ratio", &bFlushConfFileNeeded, 1., "Icons", NULL);
 
918
        
 
919
        g_bLinkIndicatorWithIcon = cairo_dock_get_boolean_key_value (pKeyFile, "Indicators", "link indicator", &bFlushConfFileNeeded, TRUE, "Icons", NULL);
 
920
        
 
921
        g_iIndicatorDeltaY = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "indicator deltaY", &bFlushConfFileNeeded, 2, "Icons", NULL);
945
922
        
946
923
        gboolean bMixLauncherAppliOld = g_bMixLauncherAppli;
947
924
        g_bMixLauncherAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "mix launcher appli", &bFlushConfFileNeeded, TRUE, NULL, NULL);
948
925
        
949
926
        length = 0;
950
927
        guint i, j;
951
 
        /**gchar **cUseXIconAppliListNew = cairo_dock_get_string_list_key_value (pKeyFile, "TaskBar", "use xicon", &bFlushConfFileNeeded, &length, NULL, NULL, NULL);
952
 
        if (cUseXIconAppliListNew != NULL)
953
 
        {
954
 
                for (i = 0; cUseXIconAppliListNew[i] != NULL; i ++)
955
 
                {
956
 
                        cairo_dock_set_class_use_xicon (cUseXIconAppliListNew[i], TRUE);
957
 
                }
958
 
        }
959
 
        if (g_cUseXIconAppliList != NULL)
960
 
        {
961
 
                for (i = 0; g_cUseXIconAppliList[i] != NULL; i ++)
962
 
                {
963
 
                        if (cUseXIconAppliListNew != NULL)
964
 
                        {
965
 
                                for (j = 0; cUseXIconAppliListNew[j] != NULL; j ++)
966
 
                                {
967
 
                                        if (strcmp (g_cUseXIconAppliList[i], cUseXIconAppliListNew[j]) == 0)
968
 
                                                break ;
969
 
                                }
970
 
                        }
971
 
                        if (cUseXIconAppliListNew == NULL || cUseXIconAppliListNew[j] == NULL)  // pas trouve.
972
 
                                cairo_dock_set_class_use_xicon (g_cUseXIconAppliList[i], FALSE);
973
 
                }
974
 
                g_strfreev (g_cUseXIconAppliList);
975
 
        }
976
 
        g_cUseXIconAppliList = cUseXIconAppliListNew;*/
977
928
        
978
929
        gboolean bOverWriteXIconsOld = g_bOverWriteXIcons;
979
930
        g_bOverWriteXIcons = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "overwrite xicon", &bFlushConfFileNeeded, TRUE, NULL, NULL);
980
931
        
 
932
        gboolean bShowThumbnailOld = g_bShowThumbnail;
 
933
        g_bShowThumbnail = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "window thumbnail", &bFlushConfFileNeeded, TRUE, NULL, NULL);
981
934
        
982
935
        //\___________________ On recupere les parametres des applets.
983
936
        g_tIconAuthorizedWidth[CAIRO_DOCK_APPLET] = cairo_dock_get_integer_key_value (pKeyFile, "Icons", "applet width", &bFlushConfFileNeeded, 48, "Applets", "max icon size");
1041
994
 
1042
995
        g_iDialogIconSize = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "icon size", &bFlushConfFileNeeded, 48, NULL, NULL);
1043
996
 
1044
 
        g_free (g_cDialogMessagePolice);
 
997
        g_free (g_dialogTextDescription.cFont);
1045
998
        if (cairo_dock_get_boolean_key_value (pKeyFile, "Dialogs", "homogeneous text", &bFlushConfFileNeeded, TRUE, NULL, NULL))
1046
999
        {
1047
 
                g_iDialogMessageSize = g_iLabelSize;
1048
 
                g_cDialogMessagePolice = g_strdup (g_cLabelPolice);
1049
 
                g_iDialogMessageWeight = g_iLabelWeight;
1050
 
                g_iDialogMessageStyle = g_iLabelStyle;
 
1000
                g_dialogTextDescription.iSize = g_iconTextDescription.iSize;
 
1001
                if (g_dialogTextDescription.iSize == 0)
 
1002
                        g_dialogTextDescription.iSize = 14;
 
1003
                g_dialogTextDescription.cFont = g_strdup (g_iconTextDescription.cFont);
 
1004
                g_dialogTextDescription.iWeight = g_iconTextDescription.iWeight;
 
1005
                g_dialogTextDescription.iStyle = g_iconTextDescription.iStyle;
1051
1006
        }
1052
1007
        else
1053
1008
        {
1054
 
                g_cDialogMessagePolice = cairo_dock_get_string_key_value (pKeyFile, "Dialogs", "message police", &bFlushConfFileNeeded, "sans", NULL, NULL);
1055
 
                g_iDialogMessageSize = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "message size", &bFlushConfFileNeeded, 14, NULL, NULL);
1056
 
                g_iDialogMessageWeight = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "message weight", &bFlushConfFileNeeded, 5, NULL, NULL);
1057
 
                g_iDialogMessageWeight = ((PANGO_WEIGHT_HEAVY - PANGO_WEIGHT_ULTRALIGHT) * g_iLabelWeight + 9 * PANGO_WEIGHT_ULTRALIGHT - PANGO_WEIGHT_HEAVY) / 8;  // on se ramene aux intervalles definit par Pango.
 
1009
                g_dialogTextDescription.cFont = cairo_dock_get_string_key_value (pKeyFile, "Dialogs", "message police", &bFlushConfFileNeeded, "sans", NULL, NULL);
 
1010
                g_dialogTextDescription.iSize = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "message size", &bFlushConfFileNeeded, 14, NULL, NULL);
 
1011
                int iLabelWeight = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "message weight", &bFlushConfFileNeeded, 5, NULL, NULL);
 
1012
                g_dialogTextDescription.iWeight = ((PANGO_WEIGHT_HEAVY - PANGO_WEIGHT_ULTRALIGHT) * iLabelWeight + 9 * PANGO_WEIGHT_ULTRALIGHT - PANGO_WEIGHT_HEAVY) / 8;  // on se ramene aux intervalles definit par Pango.
1058
1013
                if (cairo_dock_get_boolean_key_value (pKeyFile, "Dialogs", "message italic", &bFlushConfFileNeeded, FALSE, NULL, NULL))
1059
 
                        g_iDialogMessageStyle = PANGO_STYLE_ITALIC;
 
1014
                        g_dialogTextDescription.iStyle = PANGO_STYLE_ITALIC;
1060
1015
                else
1061
 
                        g_iDialogMessageStyle = PANGO_STYLE_NORMAL;
 
1016
                        g_dialogTextDescription.iStyle = PANGO_STYLE_NORMAL;
1062
1017
        }
1063
1018
        
1064
1019
        double couleur_dtext[4] = {0., 0., 0., 1.};
1065
 
        cairo_dock_get_double_list_key_value (pKeyFile, "Dialogs", "text color", &bFlushConfFileNeeded, g_fDialogTextColor, 4, couleur_dtext, NULL, NULL);
 
1020
        cairo_dock_get_double_list_key_value (pKeyFile, "Dialogs", "text color", &bFlushConfFileNeeded, g_dialogTextDescription.fColorStart, 3, couleur_dtext, NULL, NULL);
 
1021
        memcpy (&g_dialogTextDescription.fColorStop, &g_dialogTextDescription.fColorStart, 3*sizeof (double));
1066
1022
        
1067
1023
        double couleur_desklett[4] = {1.0, 1.0, 1.0, 0.2};
1068
1024
        cairo_dock_get_double_list_key_value (pKeyFile, "Desklets", "background color", &bFlushConfFileNeeded, g_fDeskletColor, 4, couleur_desklett, NULL, NULL);
1079
1035
        }
1080
1036
        g_cRaiseDockShortcut = cairo_dock_get_string_key_value (pKeyFile, "Position", "raise shortcut", &bFlushConfFileNeeded, NULL, NULL, NULL);
1081
1037
        
 
1038
        gchar *cDropIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "drop indicator", &bFlushConfFileNeeded, NULL, "Icons", NULL);
 
1039
        gchar *cDropIndicatorImagePath;
 
1040
        if (cDropIndicatorImageName != NULL)
 
1041
        {
 
1042
                cDropIndicatorImagePath = cairo_dock_generate_file_path (cDropIndicatorImageName);
 
1043
                g_free (cDropIndicatorImageName);
 
1044
        }
 
1045
        else
 
1046
        {
 
1047
                cDropIndicatorImagePath = g_strdup_printf ("%s/%s", CAIRO_DOCK_SHARE_DATA_DIR, CAIRO_DOCK_DEFAULT_DROP_INDICATOR_NAME);
 
1048
        }
 
1049
        
 
1050
        cairo_dock_updated_emblem_conf_file (pKeyFile, &bFlushConfFileNeeded);
1082
1051
        
1083
1052
        //\___________________ On (re)charge tout, car n'importe quel parametre peut avoir change.
1084
1053
        switch (iScreenBorder)
1091
1060
                        pDock->bHorizontalDock = CAIRO_DOCK_HORIZONTAL;
1092
1061
                        pDock->bDirectionUp = FALSE;
1093
1062
                break;
 
1063
                case CAIRO_DOCK_RIGHT :
 
1064
                        pDock->bHorizontalDock = CAIRO_DOCK_VERTICAL;
 
1065
                        pDock->bDirectionUp = TRUE;
 
1066
                break;
1094
1067
                case CAIRO_DOCK_LEFT :
1095
1068
                        pDock->bHorizontalDock = CAIRO_DOCK_VERTICAL;
1096
1069
                        pDock->bDirectionUp = FALSE;
1097
1070
                break;
1098
 
                case CAIRO_DOCK_RIGHT :
1099
 
                        pDock->bHorizontalDock = CAIRO_DOCK_VERTICAL;
1100
 
                        pDock->bDirectionUp = TRUE;
1101
 
                break;
1102
1071
        }
1103
1072
 
1104
1073
        if (g_iMaxAuthorizedWidth == 0)
1105
1074
                g_iMaxAuthorizedWidth = g_iScreenWidth[pDock->bHorizontalDock];
1106
1075
 
 
1076
        
 
1077
        cairo_t* pCairoContext = cairo_dock_create_context_from_window (CAIRO_CONTAINER (pDock));
 
1078
        double fMaxScale = cairo_dock_get_max_scale (pDock);
 
1079
        
1107
1080
        cairo_dock_load_dialog_buttons (CAIRO_CONTAINER (pDock), cButtonOkImage, cButtonCancelImage);
1108
1081
        g_free (cButtonOkImage);
1109
1082
        g_free (cButtonCancelImage);
1110
1083
        
1111
 
        cairo_surface_destroy (g_pIndicatorSurface[0]);
1112
 
        cairo_surface_destroy (g_pIndicatorSurface[1]);
1113
 
        g_pIndicatorSurface[0] = NULL;
1114
 
        g_pIndicatorSurface[1] = NULL;
1115
 
        if (g_bShowAppli)
1116
 
        {
1117
 
                double fLauncherWidth = (g_tIconAuthorizedWidth[CAIRO_DOCK_LAUNCHER] != 0 ? g_tIconAuthorizedWidth[CAIRO_DOCK_LAUNCHER] : 48);
1118
 
                double fLauncherHeight = (g_tIconAuthorizedHeight[CAIRO_DOCK_LAUNCHER] != 0 ? g_tIconAuthorizedHeight[CAIRO_DOCK_LAUNCHER] : 48);
1119
 
                
1120
 
                cairo_t* pCairoContext = cairo_dock_create_context_from_window (CAIRO_CONTAINER (pDock));
1121
 
                
1122
 
                double fMasxScale = (g_bLinkIndicatorWithIcon ? (1 + g_fAmplitude) : 1 + 0);
1123
 
                g_pIndicatorSurface[CAIRO_DOCK_HORIZONTAL] = cairo_dock_create_surface_from_image (
1124
 
                        cIndicatorImagePath,
1125
 
                        pCairoContext,
1126
 
                        fMasxScale,
1127
 
                        fLauncherWidth * fIndicatorRatio,
1128
 
                        fLauncherHeight * fIndicatorRatio,
1129
 
                        &g_fIndicatorWidth,
1130
 
                        &g_fIndicatorHeight,
1131
 
                        TRUE);
1132
 
                //g_print ("g_pIndicatorSurface : %.2fx%.2f\n", g_fIndicatorWidth, g_fIndicatorHeight);
1133
 
                g_pIndicatorSurface[CAIRO_DOCK_VERTICAL] = cairo_dock_rotate_surface (
1134
 
                        g_pIndicatorSurface[CAIRO_DOCK_HORIZONTAL],
1135
 
                        pCairoContext, 
1136
 
                        g_fIndicatorWidth * fMasxScale,
1137
 
                        g_fIndicatorHeight * fMasxScale,
1138
 
                        - G_PI / 2);
1139
 
                
1140
 
                cairo_destroy (pCairoContext);
1141
 
        }
 
1084
        cairo_dock_load_task_indicator (g_bShowAppli && g_bMixLauncherAppli ? cIndicatorImagePath : NULL, pCairoContext, fMaxScale, fIndicatorRatio);
 
1085
        //cairo_dock_load_task_indicator (g_bShowAppli && g_bMixLauncherAppli ? cIndicatorImagePath : NULL, fIndicatorRatio, CAIRO_CONTAINER (pDock));
1142
1086
        g_free (cIndicatorImagePath);
1143
 
 
 
1087
        
 
1088
        cairo_dock_load_drop_indicator (cDropIndicatorImagePath, pCairoContext, fMaxScale);
 
1089
        g_free (cDropIndicatorImagePath);
 
1090
        
 
1091
        cairo_dock_load_active_window_indicator (pCairoContext, cActiveIndicatorImagePath, cairo_dock_get_max_scale (pDock), iActiveCornerRadius, iActiveLineWidth, fActiveColor);
 
1092
        g_free (cActiveIndicatorImagePath);
 
1093
        
 
1094
        
1144
1095
        g_fReflectSize = 0;
1145
1096
        for (i = 0; i < CAIRO_DOCK_NB_TYPES; i ++)
1146
1097
        {
1160
1111
                        g_fReflectSize = 48;
1161
1112
        }
1162
1113
        g_fReflectSize *= fFieldDepth;
1163
 
        cd_debug ("  g_fReflectSize : %.2f pixels\n", g_fReflectSize);
 
1114
        cd_debug ("  g_fReflectSize : %.2f pixels", g_fReflectSize);
1164
1115
        
1165
 
        if (bUniquePidOld != g_bUniquePid || bGroupAppliByClassOld != g_bGroupAppliByClass || bHideVisibleApplisOld != g_bHideVisibleApplis || bAppliOnCurrentDesktopOnlyOld != g_bAppliOnCurrentDesktopOnly || (bMixLauncherAppliOld != g_bMixLauncherAppli) || (bOverWriteXIconsOld != g_bOverWriteXIcons) || (cairo_dock_application_manager_is_running () && ! g_bShowAppli))  // on ne veut plus voir les applis, il faut donc les enlever.
 
1116
        if (g_bShowThumbnail && ! bShowThumbnailOld)  // on verifie que cette option est acceptable.
 
1117
        {
 
1118
                if (! cairo_dock_support_X_extension ())
 
1119
                {
 
1120
                        cd_warning ("Sorry but your X server does not support the extension.\n You can't have window thumbnails in the dock");
 
1121
                        g_bShowThumbnail = FALSE;
 
1122
                }
 
1123
                
 
1124
        }
 
1125
        if (bUniquePidOld != g_bUniquePid || bGroupAppliByClassOld != g_bGroupAppliByClass || bHideVisibleApplisOld != g_bHideVisibleApplis || bAppliOnCurrentDesktopOnlyOld != g_bAppliOnCurrentDesktopOnly || (bMixLauncherAppliOld != g_bMixLauncherAppli) || (bOverWriteXIconsOld != g_bOverWriteXIcons) || (g_bShowThumbnail != bShowThumbnailOld) || (cairo_dock_application_manager_is_running () && ! g_bShowAppli))  // on ne veut plus voir les applis, il faut donc les enlever.
1166
1126
        {
1167
1127
                cairo_dock_stop_application_manager ();
1168
1128
        }
1180
1140
                cairo_dock_build_docks_tree_with_desktop_files (pDock, g_cCurrentLaunchersPath);
1181
1141
        }
1182
1142
        else
1183
 
                cairo_dock_reload_buffers_in_all_docks ();
 
1143
        {
 
1144
                cairo_dock_synchronize_sub_docks_position (pDock, FALSE);
 
1145
                cairo_dock_reload_buffers_in_all_docks ();  // tout sauf les applets, qui seront rechargees en bloc juste apres.
 
1146
        }
1184
1147
 
1185
1148
 
1186
1149
        if (! cairo_dock_application_manager_is_running () && g_bShowAppli)  // maintenant on veut voir les applis !
1196
1159
        GTimeVal time_val;
1197
1160
        g_get_current_time (&time_val);  // on pourrait aussi utiliser un compteur statique a la fonction ...
1198
1161
        double fTime = time_val.tv_sec + time_val.tv_usec * 1e-6;
1199
 
        cairo_dock_activate_modules_from_list (cActiveModuleList, pDock, fTime);
 
1162
        cairo_dock_activate_modules_from_list (cActiveModuleList, fTime);
1200
1163
        cairo_dock_deactivate_old_modules (fTime);
1201
1164
        g_strfreev (cActiveModuleList);
1202
1165
 
1203
 
        cairo_dock_set_all_views_to_default ();
 
1166
        cairo_dock_set_all_views_to_default ();  // met a jour la taille de tous les docks.
1204
1167
        
1205
1168
        g_bReserveSpace = g_bReserveSpace && (g_cRaiseDockShortcut == NULL);
1206
1169
        cairo_dock_reserve_space_for_dock (pDock, g_bReserveSpace);
1214
1177
 
1215
1178
        pDock->iMouseX = 0;  // on se place hors du dock initialement.
1216
1179
        pDock->iMouseY = 0;
1217
 
        pDock->calculate_max_dock_size (pDock);
 
1180
        ///pDock->calculate_max_dock_size (pDock);
1218
1181
        pDock->calculate_icons (pDock);
1219
1182
        gtk_widget_queue_draw (pDock->pWidget);  // le 'gdk_window_move_resize' ci-dessous ne provoquera pas le redessin si la taille n'a pas change.
1220
1183
 
1221
 
        if (pDock->bAtBottom)
1222
 
        {
1223
 
                cairo_dock_place_main_dock (pDock);
1224
 
        }
 
1184
        cairo_dock_place_root_dock (pDock);
1225
1185
 
1226
1186
        //\___________________ On ecrit si necessaire.
1227
1187
        if (! bFlushConfFileNeeded)
1228
1188
                bFlushConfFileNeeded = cairo_dock_conf_file_needs_update (pKeyFile, CAIRO_DOCK_VERSION);
1229
1189
        if (bFlushConfFileNeeded)
1230
1190
        {
1231
 
                cairo_dock_flush_conf_file (pKeyFile, cConfFilePath, CAIRO_DOCK_SHARE_DATA_DIR);
 
1191
                cairo_dock_flush_conf_file (pKeyFile, cConfFilePath, CAIRO_DOCK_SHARE_DATA_DIR, CAIRO_DOCK_CONF_FILE);
1232
1192
                g_key_file_free (pKeyFile);
1233
1193
                pKeyFile = g_key_file_new ();
1234
1194
                g_key_file_load_from_file (pKeyFile, cConfFilePath, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
1239
1199
        cairo_dock_update_renderer_list_for_gui ();
1240
1200
        
1241
1201
        if (g_cRaiseDockShortcut != NULL)
1242
 
                cd_keybinder_bind (g_cRaiseDockShortcut, (CDBindkeyHandler) cairo_dock_raise_from_keyboard, (gpointer)NULL);
 
1202
        {
 
1203
                if (! cd_keybinder_bind (g_cRaiseDockShortcut, (CDBindkeyHandler) cairo_dock_raise_from_keyboard, NULL))
 
1204
                {
 
1205
                        g_free (g_cRaiseDockShortcut);
 
1206
                        g_cRaiseDockShortcut = NULL;
 
1207
                }
 
1208
        }
 
1209
        
 
1210
        if (g_bPopUp)
 
1211
                cairo_dock_start_polling_screen_edge (pDock);
 
1212
        else
 
1213
                cairo_dock_stop_polling_screen_edge ();
 
1214
        if (! g_bPopUp && bPopUpOld)
 
1215
        {
 
1216
                cairo_dock_set_root_docks_on_top_layer ();
 
1217
        }
 
1218
        else if (g_bPopUp && ! bPopUpOld)
 
1219
                gtk_window_set_keep_below (GTK_WINDOW (pDock->pWidget), TRUE);  // le main dock ayant ete cree avant, il n'a pas herite de ce parametre.
1243
1220
        
1244
1221
        //\___________________ On applique les modifs au fichier de conf easy.
1245
1222
        cairo_dock_copy_to_easy_conf_file (pKeyFile, g_cEasyConfFile);
1246
1223
 
 
1224
        cairo_destroy (pCairoContext);
 
1225
        
1247
1226
        g_key_file_free (pKeyFile);
1248
1227
 
1249
1228
        cairo_dock_mark_theme_as_modified (TRUE);
1259
1238
 
1260
1239
static void _cairo_dock_user_action_on_config (GtkDialog *pDialog, gint action, gpointer *user_data);  // declaree en amont, car les 2 s'appellent mutuellement.
1261
1240
 
1262
 
static gboolean cairo_dock_edit_conf_file_core (GtkWindow *pWindow, gchar *cConfFilePath, gchar *cTitle, int iWindowWidth, int iWindowHeight, gchar iIdentifier, gchar *cPresentedGroup, CairoDockConfigFunc pConfigFunc, gpointer data, GFunc pFreeUserDataFunc, CairoDockConfigFunc pConfigFunc2, gchar *cConfFilePath2, gchar *cButtonConvert, gchar *cButtonRevert, gchar *cGettextDomain)
 
1241
static gboolean cairo_dock_edit_conf_file_core (GtkWindow *pWindow, gchar *cConfFilePath, const gchar *cTitle, int iWindowWidth, int iWindowHeight, gchar iIdentifier, gchar *cPresentedGroup, CairoDockConfigFunc pConfigFunc, gpointer data, GFunc pFreeUserDataFunc, CairoDockConfigFunc pConfigFunc2, gchar *cConfFilePath2, gchar *cButtonConvert, gchar *cButtonRevert, gchar *cGettextDomain)
1263
1242
{
1264
1243
        cd_message ("%s (%s; %s)", __func__, cConfFilePath, cConfFilePath2);
1265
1244
        GSList *pWidgetList = NULL;
1298
1277
                g_iScreenHeight[CAIRO_DOCK_HORIZONTAL] = gdk_screen_get_height (gdkscreen);
1299
1278
        }
1300
1279
        gtk_window_move (GTK_WINDOW (pDialog), (g_iScreenWidth[CAIRO_DOCK_HORIZONTAL] - iWidth) / 2, (g_iScreenHeight[CAIRO_DOCK_HORIZONTAL] - iHeight) / 2);
 
1280
        gtk_window_present (GTK_WINDOW (pDialog));
1301
1281
        
1302
1282
        if (pConfigFunc != NULL)  // alors on autorise la modification a la volee, avec un bouton "Appliquer". La fenetre doit donc laisser l'appli se derouler.
1303
1283
        {
1364
1344
                g_ptr_array_free (pDataGarbage, TRUE);
1365
1345
                g_free (cConfFilePath);
1366
1346
                g_free (cConfFilePath2);
1367
 
                g_free (cTitle);
 
1347
                ///g_free (cTitle);
1368
1348
                g_free (cButtonConvert);
1369
1349
                g_free (cButtonRevert);
1370
1350
                return config_ok;
1452
1432
}
1453
1433
 
1454
1434
 
1455
 
/**
1456
 
*Lis un fichier de conf, construit l'IHM appropriee, et la presente a l'utilisateur.
1457
 
*@param pWidget
1458
 
*@param cConfFilePath
1459
 
*@param cTitle
1460
 
*@param iWindowWidth
1461
 
*@param iWindowHeight
1462
 
*@param iIdentifier
1463
 
*@param cPresentedGroup
1464
 
*@param pConfigFunc
1465
 
*@param data
1466
 
*@param pFreeUserDataFunc
1467
 
*@param pConfigFunc2
1468
 
*@param cConfFilePath2
1469
 
*@param cButtonConvert
1470
 
*@param cButtonRevert
1471
 
*@param cGettextDomain
1472
 
@Returns TRUE si l'utilisateur a ferme le panneau de conf en appuyant sur OK, FALSE sinon.
1473
 
*/
1474
 
gboolean cairo_dock_edit_conf_file_full (GtkWindow *pWindow, gchar *cConfFilePath, gchar *cTitle, int iWindowWidth, int iWindowHeight, gchar iIdentifier, gchar *cPresentedGroup, CairoDockConfigFunc pConfigFunc, gpointer data, GFunc pFreeUserDataFunc, CairoDockConfigFunc pConfigFunc2, gchar *cConfFilePath2, gchar *cButtonConvert, gchar *cButtonRevert, gchar *cGettextDomain)
 
1435
gboolean cairo_dock_edit_conf_file_full (GtkWindow *pWindow, gchar *cConfFilePath, const gchar *cTitle, int iWindowWidth, int iWindowHeight, gchar iIdentifier, gchar *cPresentedGroup, CairoDockConfigFunc pConfigFunc, gpointer data, GFunc pFreeUserDataFunc, CairoDockConfigFunc pConfigFunc2, gchar *cConfFilePath2, gchar *cButtonConvert, gchar *cButtonRevert, gchar *cGettextDomain)
1475
1436
{
1476
1437
        return cairo_dock_edit_conf_file_core (pWindow, g_strdup (cConfFilePath), g_strdup (cTitle), iWindowWidth, iWindowHeight, iIdentifier, cPresentedGroup, pConfigFunc, data, pFreeUserDataFunc, pConfigFunc2, g_strdup (cConfFilePath2), g_strdup (cButtonConvert), g_strdup (cButtonRevert), cGettextDomain);
1477
1438
}
1478
1439
 
1479
1440
 
1480
 
void cairo_dock_update_conf_file (gchar *cConfFilePath, GType iFirstDataType, ...)  // type, groupe, nom, valeur, etc. finir par G_TYPE_INVALID.
 
1441
void cairo_dock_update_conf_file (const gchar *cConfFilePath, GType iFirstDataType, ...)  // type, groupe, nom, valeur, etc. finir par G_TYPE_INVALID.
1481
1442
{
1482
1443
        cd_message ("%s (%s)", __func__, cConfFilePath);
1483
1444
        va_list args;
1488
1449
        g_key_file_load_from_file (pKeyFile, cConfFilePath, G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &erreur);
1489
1450
        if (erreur != NULL)
1490
1451
        {
1491
 
                cd_warning ("Attention : %s", erreur->message);
 
1452
                cd_warning (erreur->message);
1492
1453
                g_error_free (erreur);
1493
1454
                //va_end (args);
1494
1455
                //return ;