~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.4.0-0beta2

« back to all changes in this revision

Viewing changes to dock-rendering/src/rendering-panel.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2011-04-20 20:46:51 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110420204651-ftnpzesj6uc7qeul
Tags: 2.3.0~1-0ubuntu1
* New Upstream Version (LP: #723995)
* Upstream short ChangeLog (since 2.3.0~0rc1):
 - Updated translations
 - Updated the integration of the new versions of kwin and compiz
    (Switcher, ShowDesktop, etc.)
 - Removed a lot of useless g_print
 - Updated a few plug-ins to fit with the new version of the API (gldit)
 - Fixed a few bugs
 - Updated MeMenu, MessagingMenu and Status-Notifier to works
    with the latest version of dbusmenu, etc.
* Switch to dpkg-source 3.0 (quilt) format
* debian/cairo-dock-plug-ins.install:
 - Added new files (interfaces for python, ruby, vala and mono)
* debian/control:
 - Added new dependences for new applets (sensors and zeitgeist)
    and new interfaces (python, valac, ruby and mono)
 - Updated the version of cairo-dock build-dependences
* debian/rules:
 - Added a new CMake flag to install python interface in debian/tmp
* Updated debian/watch

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
{
38
38
        //\_____________ On calcule le nombre de groupes et la place qu'ils occupent.
39
39
        int iNbGroups = 1, iCurrentOrder = -1;
40
 
        double fCurrentGroupWidth = - myIcons.iIconGap, fGroupsWidth = 0.;
 
40
        double fCurrentGroupWidth = - myIconsParam.iIconGap, fGroupsWidth = 0.;
41
41
        GList *ic;
42
42
        Icon *pIcon;
43
43
        for (ic = pDock->icons; ic != NULL; ic = ic->next)
44
44
        {
45
45
                pIcon = ic->data;
46
 
                if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
46
                if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
47
47
                {
48
48
                        if (CAIRO_DOCK_IS_USER_SEPARATOR (pIcon))  // si c'est un separateur automatique, le changement de groupe incrementera le compteur a l'icone suivante.
49
49
                        {
52
52
                                        iNbGroups ++;
53
53
                                        fGroupsWidth += MAX (0, fCurrentGroupWidth);
54
54
                                        //g_print ("fGroupsWidth += %.2f\n", fCurrentGroupWidth);
55
 
                                        fCurrentGroupWidth = - myIcons.iIconGap;
 
55
                                        fCurrentGroupWidth = - myIconsParam.iIconGap;
56
56
                                }
57
57
                        }
58
58
                        continue;
64
64
                                iNbGroups ++;
65
65
                                fGroupsWidth += MAX (0, fCurrentGroupWidth);
66
66
                                //g_print ("fGroupsWidth += %.2f\n", fCurrentGroupWidth);
67
 
                                fCurrentGroupWidth = - myIcons.iIconGap;
 
67
                                fCurrentGroupWidth = - myIconsParam.iIconGap;
68
68
                        }
69
69
                }
70
70
                iCurrentOrder = cairo_dock_get_icon_order (pIcon);
71
 
                fCurrentGroupWidth += pIcon->fWidth * my_fPanelRatio + myIcons.iIconGap;
 
71
                fCurrentGroupWidth += pIcon->fWidth * my_fPanelRatio + myIconsParam.iIconGap;
72
72
                //g_print ("fCurrentGroupWidth <- %.2f\n", fCurrentGroupWidth);
73
73
        }
74
74
        if (fCurrentGroupWidth > 0)  // le groupe courant est non vide, sinon c'est juste un separateur a la fin.
81
81
        
82
82
        //\_____________ On en deduit l'ecart entre les groupes d'icones.
83
83
        double W = cairo_dock_get_max_authorized_dock_width (pDock);
84
 
        double fScreenBorderGap = myBackground.iDockRadius + myBackground.iDockLineWidth;  // on laisse un ecart avec le bord de l'ecran.
 
84
        double fScreenBorderGap = myDocksParam.iDockRadius + myDocksParam.iDockLineWidth;  // on laisse un ecart avec le bord de l'ecran.
85
85
        double fGroupGap = (iNbGroups > 1 ? (W - 2*fScreenBorderGap - fGroupsWidth) / (iNbGroups - 1) : W - fScreenBorderGap - fGroupsWidth);
86
 
        if (fGroupGap < myIcons.iIconGap)  // les icones depassent en largeur.
87
 
                fGroupGap = myIcons.iIconGap;
 
86
        if (fGroupGap < myIconsParam.iIconGap)  // les icones depassent en largeur.
 
87
                fGroupGap = myIconsParam.iIconGap;
88
88
        //g_print (" -> %d groups, %d/%d\nfGroupGap = %.2f\n", iNbGroups, (int)fGroupsWidth, (int)W, fGroupGap);
89
89
        
90
90
        //\_____________ On calcule la position au repos des icones et la taille du dock.
91
91
        double xg = fScreenBorderGap;  // abscisse de l'icone courante, et abscisse du debut du groupe courant.
92
92
        double x = xg;
93
 
        fCurrentGroupWidth = - myIcons.iIconGap;
 
93
        fCurrentGroupWidth = - myIconsParam.iIconGap;
94
94
        iCurrentOrder = -1;
95
95
        for (ic = pDock->icons; ic != NULL; ic = ic->next)
96
96
        {
97
97
                pIcon = ic->data;
98
 
                if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
98
                if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
99
99
                {
100
100
                        if (CAIRO_DOCK_IS_USER_SEPARATOR (pIcon))  // si c'est un separateur automatique, le changement de groupe incrementera le compteur a l'icone suivante.
101
101
                        {
104
104
                                        xg += fCurrentGroupWidth + fGroupGap;
105
105
                                        x = xg;
106
106
                                        //g_print ("jump to %.2f\n", x);
107
 
                                        fCurrentGroupWidth = - myIcons.iIconGap;
 
107
                                        fCurrentGroupWidth = - myIconsParam.iIconGap;
108
108
                                }
109
109
                        }
110
110
                        continue;
116
116
                                xg += fCurrentGroupWidth + fGroupGap;
117
117
                                x = xg;
118
118
                                //g_print ("jump to %.2f\n", x);
119
 
                                fCurrentGroupWidth = - myIcons.iIconGap;
 
119
                                fCurrentGroupWidth = - myIconsParam.iIconGap;
120
120
                        }
121
121
                }
122
122
                iCurrentOrder = cairo_dock_get_icon_order (pIcon);
123
 
                fCurrentGroupWidth += pIcon->fWidth * my_fPanelRatio + myIcons.iIconGap;
 
123
                fCurrentGroupWidth += pIcon->fWidth * my_fPanelRatio + myIconsParam.iIconGap;
124
124
                
125
125
                //g_print ("icon at %.2f\n", x);
126
126
                pIcon->fXAtRest = x;
127
 
                x += pIcon->fWidth * my_fPanelRatio + myIcons.iIconGap;
 
127
                x += pIcon->fWidth * my_fPanelRatio + myIconsParam.iIconGap;
128
128
        }
129
129
        
130
130
        pDock->fMagnitudeMax = 0.;  // pas de vague.
132
132
        pDock->pFirstDrawnElement = pDock->icons;
133
133
        
134
134
        double hicon = pDock->iMaxIconHeight * my_fPanelRatio;
135
 
        pDock->iDecorationsHeight = hicon * pDock->container.fRatio + 2 * myBackground.iFrameMargin;
 
135
        pDock->iDecorationsHeight = hicon * pDock->container.fRatio + 2 * myDocksParam.iFrameMargin;
136
136
        
137
137
        pDock->iMaxDockWidth = pDock->fFlatDockWidth = pDock->iMinDockWidth = MAX (W, x);
138
138
        //g_print ("iMaxDockWidth : %d (%.2f)\n", pDock->iMaxDockWidth, pDock->container.fRatio);
139
139
        
140
 
        pDock->iMaxDockHeight = myBackground.iDockLineWidth + myBackground.iFrameMargin + hicon * pDock->container.fRatio + myBackground.iFrameMargin + myBackground.iDockLineWidth + myLabels.iLabelSize;
 
140
        pDock->iMaxDockHeight = myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin + hicon * pDock->container.fRatio + myDocksParam.iFrameMargin + myDocksParam.iDockLineWidth + myIconsParam.iLabelSize;
141
141
        
142
 
        pDock->iMaxDockHeight = MAX (pDock->iMaxDockHeight, hicon * (1 + myIcons.fAmplitude));  // au moins la taille du FBO.
 
142
        pDock->iMaxDockHeight = MAX (pDock->iMaxDockHeight, pDock->iMaxIconHeight * (1 + myIconsParam.fAmplitude));  // au moins la taille du FBO.
 
143
        //g_print ("panel view: pDock->iMaxIconHeight = %d\n", pDock->iMaxIconHeight);
143
144
 
144
145
        pDock->iDecorationsWidth = pDock->iMaxDockWidth;
145
 
        pDock->iMinDockHeight = 2 * (myBackground.iDockLineWidth + myBackground.iFrameMargin) + hicon * pDock->container.fRatio;
 
146
        pDock->iMinDockHeight = 2 * (myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin) + hicon * pDock->container.fRatio;  /// TODO: make the height constant, to avoid moving all windows when space is reserved and ratio changes.
146
147
}
147
148
 
148
149
 
149
150
static void cd_render (cairo_t *pCairoContext, CairoDock *pDock)
150
151
{
151
152
        //\____________________ On trace le cadre.
152
 
        double fLineWidth = myBackground.iDockLineWidth;
153
 
        double fMargin = myBackground.iFrameMargin;
154
 
        double fRadius = (pDock->iDecorationsHeight + fLineWidth - 2 * myBackground.iDockRadius > 0 ? myBackground.iDockRadius : (pDock->iDecorationsHeight + fLineWidth) / 2 - 1);
 
153
        double fLineWidth = myDocksParam.iDockLineWidth;
 
154
        double fMargin = myDocksParam.iFrameMargin;
 
155
        double fRadius = (pDock->iDecorationsHeight + fLineWidth - 2 * myDocksParam.iDockRadius > 0 ? myDocksParam.iDockRadius : (pDock->iDecorationsHeight + fLineWidth) / 2 - 1);
155
156
        double fExtraWidth = 2 * fRadius + fLineWidth;
156
157
        double fDockWidth;
157
158
        int sens;
183
184
        }
184
185
 
185
186
        cairo_save (pCairoContext);
186
 
        double fDeltaXTrapeze = cairo_dock_draw_frame (pCairoContext, fRadius, fLineWidth, fDockWidth, pDock->iDecorationsHeight, fDockOffsetX, fDockOffsetY, sens, 0., pDock->container.bIsHorizontal, myBackground.bRoundedBottomCorner);
 
187
        double fDeltaXTrapeze = cairo_dock_draw_frame (pCairoContext, fRadius, fLineWidth, fDockWidth, pDock->iDecorationsHeight, fDockOffsetX, fDockOffsetY, sens, 0., pDock->container.bIsHorizontal, myDocksParam.bRoundedBottomCorner);
187
188
 
188
189
        //\____________________ On dessine les decorations dedans.
189
190
        fDockOffsetY = (pDock->container.bDirectionUp ? pDock->container.iHeight - pDock->iDecorationsHeight - fLineWidth : fLineWidth);
193
194
        if (fLineWidth > 0)
194
195
        {
195
196
                cairo_set_line_width (pCairoContext, fLineWidth);
196
 
                cairo_set_source_rgba (pCairoContext, myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
197
                cairo_set_source_rgba (pCairoContext, myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
197
198
                cairo_stroke (pCairoContext);
198
199
        }
199
200
        else
225
226
        for (ic = pDock->icons; ic != NULL; ic = ic->next)
226
227
        {
227
228
                pIcon = ic->data;
228
 
                if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
229
                if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
229
230
                {
230
231
                        x1 = pIcon->fDrawX = pIcon->fX;
231
232
                        
233
234
                        for (ic = ic->next; ic != NULL; ic = ic->next)
234
235
                        {
235
236
                                pIcon = ic->data;
236
 
                                if (!CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
237
                                if (!CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
237
238
                                        break;
238
239
                        }
239
240
                        if (ic != NULL)
282
283
                                
283
284
                                cairo_set_operator (pCairoContext, CAIRO_OPERATOR_OVER);
284
285
                                cairo_set_line_width (pCairoContext, fLineWidth);
285
 
                                cairo_set_source_rgba (pCairoContext, myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
286
                                cairo_set_source_rgba (pCairoContext, myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
286
287
                                cairo_stroke (pCairoContext);
287
288
                        }
288
289
                }
290
291
        cairo_restore (pCairoContext);
291
292
        
292
293
        //\____________________ On dessine la ficelle qui les joint.
293
 
        if (myIcons.iStringLineWidth > 0)
294
 
                cairo_dock_draw_string (pCairoContext, pDock, myIcons.iStringLineWidth, FALSE, FALSE);
 
294
        if (myIconsParam.iStringLineWidth > 0)
 
295
                cairo_dock_draw_string (pCairoContext, pDock, myIconsParam.iStringLineWidth, FALSE, FALSE);
295
296
 
296
297
        //\____________________ On dessine les icones et les etiquettes, en tenant compte de l'ordre pour dessiner celles en arriere-plan avant celles en avant-plan.
297
298
        GList *pFirstDrawnElement = cairo_dock_get_first_drawn_element_linear (pDock->icons);
304
305
        {
305
306
                pIcon = ic->data;
306
307
                
307
 
                if (! CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
308
                if (! CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
308
309
                {
309
310
                        cairo_save (pCairoContext);
310
311
                        cairo_dock_render_one_icon (pIcon, pDock, pCairoContext, fDockMagnitude, pIcon->bPointed);
319
320
static void cd_render_optimized (cairo_t *pCairoContext, CairoDock *pDock, GdkRectangle *pArea)
320
321
{
321
322
        //g_print ("%s ((%d;%d) x (%d;%d) / (%dx%d))\n", __func__, pArea->x, pArea->y, pArea->width, pArea->height, pDock->container.iWidth, pDock->container.iHeight);
322
 
        double fLineWidth = myBackground.iDockLineWidth;
323
 
        double fMargin = myBackground.iFrameMargin;
 
323
        double fLineWidth = myDocksParam.iDockLineWidth;
 
324
        double fMargin = myDocksParam.iFrameMargin;
324
325
        int iWidth = pDock->container.iWidth;
325
326
        int iHeight = pDock->container.iHeight;
326
327
 
346
347
 
347
348
        fDockOffsetY = (pDock->container.bDirectionUp ? pDock->container.iHeight - pDock->iDecorationsHeight - fLineWidth : fLineWidth);
348
349
        
349
 
        double fRadius = MIN (myBackground.iDockRadius, (pDock->iDecorationsHeight + myBackground.iDockLineWidth) / 2 - 1);
 
350
        double fRadius = MIN (myDocksParam.iDockRadius, (pDock->iDecorationsHeight + myDocksParam.iDockLineWidth) / 2 - 1);
350
351
        double fOffsetX;
351
352
        if (cairo_dock_is_extended_dock (pDock))  // mode panel etendu.
352
353
        {
369
370
                cairo_move_to (pCairoContext, fDockOffsetX, fDockOffsetY - fLineWidth / 2);
370
371
                cairo_rel_line_to (pCairoContext, pArea->width, 0);
371
372
                cairo_set_line_width (pCairoContext, fLineWidth);
372
 
                cairo_set_source_rgba (pCairoContext, myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
373
                cairo_set_source_rgba (pCairoContext, myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
373
374
                cairo_stroke (pCairoContext);
374
375
 
375
376
                cairo_new_path (pCairoContext);
376
377
                cairo_move_to (pCairoContext, fDockOffsetX, (pDock->container.bDirectionUp ? iHeight - fLineWidth / 2 : pDock->iDecorationsHeight + 1.5 * fLineWidth));
377
378
                cairo_rel_line_to (pCairoContext, pArea->width, 0);
378
379
                cairo_set_line_width (pCairoContext, fLineWidth);
379
 
                cairo_set_source_rgba (pCairoContext, myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
380
                cairo_set_source_rgba (pCairoContext, myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
380
381
        }
381
382
        else
382
383
        {
383
384
                cairo_move_to (pCairoContext, fDockOffsetX - fLineWidth / 2, fDockOffsetY);
384
385
                cairo_rel_line_to (pCairoContext, 0, pArea->height);
385
386
                cairo_set_line_width (pCairoContext, fLineWidth);
386
 
                cairo_set_source_rgba (pCairoContext, myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
387
                cairo_set_source_rgba (pCairoContext, myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
387
388
                cairo_stroke (pCairoContext);
388
389
 
389
390
                cairo_new_path (pCairoContext);
390
391
                cairo_move_to (pCairoContext, (pDock->container.bDirectionUp ? iHeight - fLineWidth / 2 : pDock->iDecorationsHeight + 1.5 * fLineWidth), fDockOffsetY);
391
392
                cairo_rel_line_to (pCairoContext, 0, pArea->height);
392
393
                cairo_set_line_width (pCairoContext, fLineWidth);
393
 
                cairo_set_source_rgba (pCairoContext, myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
394
                cairo_set_source_rgba (pCairoContext, myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
394
395
        }
395
396
        cairo_stroke (pCairoContext);
396
397
 
441
442
static void cd_render_opengl (CairoDock *pDock)
442
443
{
443
444
        //\_____________ On definit notre rectangle.
444
 
        double fLineWidth = myBackground.iDockLineWidth;
445
 
        double fMargin = myBackground.iFrameMargin;
446
 
        double fRadius = (pDock->iDecorationsHeight + fLineWidth - 2 * myBackground.iDockRadius > 0 ? myBackground.iDockRadius : (pDock->iDecorationsHeight + fLineWidth) / 2 - 1);
 
445
        double fLineWidth = myDocksParam.iDockLineWidth;
 
446
        double fMargin = myDocksParam.iFrameMargin;
 
447
        double fRadius = (pDock->iDecorationsHeight + fLineWidth - 2 * myDocksParam.iDockRadius > 0 ? myDocksParam.iDockRadius : (pDock->iDecorationsHeight + fLineWidth) / 2 - 1);
447
448
        double fExtraWidth = 2 * fRadius + fLineWidth;
448
449
        double fDockWidth;
449
450
        double fFrameHeight = pDock->iDecorationsHeight + fLineWidth;
473
474
        double fDockMagnitude = cairo_dock_calculate_magnitude (pDock->iMagnitudeIndex);
474
475
        
475
476
        //\_____________ On genere les coordonnees du contour.
476
 
        const CairoDockGLPath *pFramePath = cairo_dock_generate_rectangle_path (fDockWidth, fFrameHeight, fRadius, myBackground.bRoundedBottomCorner);
 
477
        const CairoDockGLPath *pFramePath = cairo_dock_generate_rectangle_path (fDockWidth, fFrameHeight, fRadius, myDocksParam.bRoundedBottomCorner);
477
478
        
478
479
        //\_____________ On remplit avec le fond.
479
480
        glPushMatrix ();
489
490
        if (fLineWidth != 0)
490
491
        {
491
492
                glLineWidth (fLineWidth);
492
 
                glColor4f (myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
493
                glColor4f (myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
493
494
                cairo_dock_stroke_gl_path (pFramePath, TRUE);
494
495
        }
495
496
        glPopMatrix ();
505
506
        for (ic = pDock->icons; ic != NULL; ic = ic->next)
506
507
        {
507
508
                pIcon = ic->data;
508
 
                if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
509
                if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
509
510
                {
510
511
                        x1 = pIcon->fDrawX = pIcon->fX;
511
512
                        
513
514
                        for (ic = ic->next; ic != NULL; ic = ic->next)
514
515
                        {
515
516
                                pIcon = ic->data;
516
 
                                if (!CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
517
                                if (!CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
517
518
                                        break;
518
519
                        }
519
520
                        if (ic != NULL)
563
564
                                        delta - dx, h_,
564
565
                                        delta, h_);
565
566
                                glLineWidth (fLineWidth);
566
 
                                glColor4f (myBackground.fLineColor[0], myBackground.fLineColor[1], myBackground.fLineColor[2], myBackground.fLineColor[3]);
 
567
                                glColor4f (myDocksParam.fLineColor[0], myDocksParam.fLineColor[1], myDocksParam.fLineColor[2], myDocksParam.fLineColor[3]);
567
568
                                cairo_dock_stroke_gl_path (pPath, FALSE);
568
569
                        }
569
570
                        
574
575
        
575
576
        
576
577
        //\_____________ On dessine la ficelle.
577
 
        if (myIcons.iStringLineWidth > 0)
578
 
                cairo_dock_draw_string_opengl (pDock, myIcons.iStringLineWidth, FALSE, FALSE);
 
578
        if (myIconsParam.iStringLineWidth > 0)
 
579
                cairo_dock_draw_string_opengl (pDock, myIconsParam.iStringLineWidth, FALSE, FALSE);
579
580
        
580
581
        
581
582
        //\_____________ On dessine les icones.
602
603
{
603
604
        //\_____________ On calcule le nombre de groupes et la place qu'ils occupent.
604
605
        int iNbGroups = 1, iCurrentOrder = -1;
605
 
        double fCurrentGroupWidth = - myIcons.iIconGap, fGroupsWidth = 0.;
 
606
        double fCurrentGroupWidth = - myIconsParam.iIconGap, fGroupsWidth = 0.;
606
607
        double fSeparatorsPonderation = 0;
607
608
        GList *ic;
608
609
        Icon *pIcon;
609
610
        for (ic = pDock->icons; ic != NULL; ic = ic->next)
610
611
        {
611
612
                pIcon = ic->data;
612
 
                if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
613
                if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
613
614
                {
614
615
                        pIcon->fScale = 1.;
615
616
                        if (pIcon->fInsertRemoveFactor != 0)
627
628
                                        iNbGroups ++;
628
629
                                        fSeparatorsPonderation += pIcon->fScale;
629
630
                                        fGroupsWidth += MAX (0, fCurrentGroupWidth);
630
 
                                        fCurrentGroupWidth = - myIcons.iIconGap;
 
631
                                        fCurrentGroupWidth = - myIconsParam.iIconGap;
631
632
                                }
632
633
                        }
633
634
                        continue;
639
640
                                iNbGroups ++;
640
641
                                fSeparatorsPonderation ++; // seuls les separateurs utilisateurs peuvent zoomer.
641
642
                                fGroupsWidth += MAX (0, fCurrentGroupWidth);
642
 
                                fCurrentGroupWidth = - myIcons.iIconGap;
 
643
                                fCurrentGroupWidth = - myIconsParam.iIconGap;
643
644
                        }
644
645
                }
645
646
                
653
654
                }
654
655
                
655
656
                iCurrentOrder = cairo_dock_get_icon_order (pIcon);
656
 
                fCurrentGroupWidth += pIcon->fWidth * pIcon->fScale + myIcons.iIconGap;
 
657
                fCurrentGroupWidth += pIcon->fWidth * pIcon->fScale + myIconsParam.iIconGap;
657
658
        }
658
659
        if (fCurrentGroupWidth > 0)  // le groupe courant est non vide, sinon c'est juste un separateur a la fin.
659
660
        {
664
665
        
665
666
        //\_____________ On en deduit l'ecart entre les groupes d'icones.
666
667
        double W = cairo_dock_get_max_authorized_dock_width (pDock);
667
 
        double fScreenBorderGap = myBackground.iDockRadius + myBackground.iDockLineWidth;  // on laisse un ecart avec le bord de l'ecran.
 
668
        double fScreenBorderGap = myDocksParam.iDockRadius + myDocksParam.iDockLineWidth;  // on laisse un ecart avec le bord de l'ecran.
668
669
        double fGroupGap;
669
670
        if (iNbGroups > 1)
670
671
        {
680
681
        double xm = pDock->container.iMouseX;
681
682
        double xg = fScreenBorderGap;  // abscisse de l'icone courante, et abscisse du debut du groupe courant.
682
683
        double x = xg;
683
 
        fCurrentGroupWidth = - myIcons.iIconGap;
 
684
        fCurrentGroupWidth = - myIconsParam.iIconGap;
684
685
        iCurrentOrder = -1;
685
686
        for (ic = pDock->icons; ic != NULL; ic = ic->next)
686
687
        {
687
688
                pIcon = ic->data;
688
 
                if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
 
689
                if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
689
690
                {
690
691
                        pIcon->fX = x;
691
692
                        pIcon->fDrawX = pIcon->fX;
702
703
                                        else
703
704
                                                pIcon->bPointed = FALSE;
704
705
                                        x = xg;
705
 
                                        fCurrentGroupWidth = - myIcons.iIconGap;
 
706
                                        fCurrentGroupWidth = - myIconsParam.iIconGap;
706
707
                                }
707
708
                        }
708
709
                        continue;
713
714
                        {
714
715
                                xg += fCurrentGroupWidth + fGroupGap;
715
716
                                x = xg;
716
 
                                fCurrentGroupWidth = - myIcons.iIconGap;
 
717
                                fCurrentGroupWidth = - myIconsParam.iIconGap;
717
718
                        }
718
719
                }
719
720
                iCurrentOrder = cairo_dock_get_icon_order (pIcon);
720
 
                fCurrentGroupWidth += pIcon->fWidth * pIcon->fScale + myIcons.iIconGap;
 
721
                fCurrentGroupWidth += pIcon->fWidth * pIcon->fScale + myIconsParam.iIconGap;
721
722
                
722
723
                pIcon->fX = x;
723
 
                if (pPointedIcon == NULL && xm > pIcon->fX - .5*myIcons.iIconGap && xm <= pIcon->fX + pIcon->fWidth * pIcon->fScale + .5*myIcons.iIconGap)
 
724
                if (pPointedIcon == NULL && xm > pIcon->fX - .5*myIconsParam.iIconGap && xm <= pIcon->fX + pIcon->fWidth * pIcon->fScale + .5*myIconsParam.iIconGap)
724
725
                {
725
726
                        pIcon->bPointed = TRUE;
726
727
                        pPointedIcon = pIcon;
730
731
                pIcon->fDrawX = pIcon->fX;
731
732
                
732
733
                if (pDock->container.bDirectionUp)
733
 
                        pIcon->fY = pDock->iMaxDockHeight - (myBackground.iDockLineWidth + myBackground.iFrameMargin + pIcon->fHeight * my_fPanelRatio);
 
734
                        pIcon->fY = pDock->iMaxDockHeight - (myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin + pIcon->fHeight * my_fPanelRatio);
734
735
                else
735
 
                        pIcon->fY = myBackground.iDockLineWidth + myBackground.iFrameMargin;
 
736
                        pIcon->fY = myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin;
736
737
                pIcon->fDrawY = pIcon->fY;
737
738
                
738
739
                pIcon->fWidthFactor = 1.;
740
741
                pIcon->fOrientation = 0.;
741
742
                pIcon->fAlpha = 1.;
742
743
                
743
 
                x += pIcon->fWidth * pIcon->fScale + myIcons.iIconGap;
 
744
                x += pIcon->fWidth * pIcon->fScale + myIconsParam.iIconGap;
744
745
        }
745
746
        
746
747
        cairo_dock_check_if_mouse_inside_linear (pDock);
765
766
        pRenderer->bUseReflect = FALSE;
766
767
        pRenderer->cDisplayedName = D_ (cRendererName);
767
768
        pRenderer->cReadmeFilePath = g_strdup (MY_APPLET_SHARE_DATA_DIR"/readme-panel-view");
768
 
        pRenderer->cPreviewFilePath = g_strdup (MY_APPLET_SHARE_DATA_DIR"/preview-panel.png");
 
769
        pRenderer->cPreviewFilePath = g_strdup (MY_APPLET_SHARE_DATA_DIR"/preview-panel.jpg");
769
770
        
770
771
        cairo_dock_register_renderer (cRendererName, pRenderer);
771
772
}