~ubuntu-branches/ubuntu/quantal/cairo-dock-plug-ins/quantal-201208191523

« back to all changes in this revision

Viewing changes to dock-rendering/src/rendering-rainbow.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:
45
45
        pDock->fMagnitudeMax = my_fRainbowMagnitude;
46
46
        pDock->pFirstDrawnElement = cairo_dock_calculate_icons_positions_at_rest_linear (pDock->icons, pDock->fFlatDockWidth, pDock->iScrollOffset);
47
47
        
48
 
        double fMaxScale =  1. + my_fRainbowMagnitude * g_fAmplitude;
 
48
        double fMaxScale =  1. + my_fRainbowMagnitude * myIconsParam.fAmplitude;
49
49
        int iMaxIconWidth = pDock->iMaxIconHeight + my_iSpaceBetweenIcons;
50
50
        double fCone = G_PI - 2 * my_fRainbowConeOffset;
51
51
        int iNbIcons = g_list_length (pDock->icons);
68
68
static void cd_rendering_render_rainbow (cairo_t *pCairoContext, CairoDock *pDock)
69
69
{
70
70
        //g_print ("pDock->fFoldingFactor : %.2f\n", pDock->fFoldingFactor);
71
 
        double fMaxScale =  1. + my_fRainbowMagnitude * g_fAmplitude;
 
71
        double fMaxScale =  1. + my_fRainbowMagnitude * myIconsParam.fAmplitude;
72
72
        double fRadius=0;
73
73
        if (my_fRainbowColor[3] != 0 && pDock->icons != NULL)
74
74
        {
176
176
                        cairo_translate (pCairoContext, 0., pDock->container.iHeight);
177
177
                        cairo_scale (pCairoContext, 1., -1.);
178
178
                }
179
 
                cairo_set_line_width (pCairoContext, myBackground.iDockLineWidth);
 
179
                cairo_set_line_width (pCairoContext, myDocksParam.iDockLineWidth);
180
180
                cairo_move_to (pCairoContext, pDock->container.iWidth/2 - fRadius * cos (my_fRainbowConeOffset), pDock->container.iHeight - fRadius * sin (my_fRainbowConeOffset));
181
181
                cairo_line_to (pCairoContext, pDock->container.iWidth/2, pDock->container.iHeight);
182
182
                cairo_line_to (pCairoContext, pDock->container.iWidth/2 + fRadius * cos (my_fRainbowConeOffset), pDock->container.iHeight - fRadius * sin (my_fRainbowConeOffset));
230
230
        int x_cumulated = iIconNumber * (iMaxIconHeight + my_iSpaceBetweenRows);
231
231
        cd_debug (" iIconNumber : %d ; x_cumulated : %d\n", iIconNumber, x_cumulated);
232
232
        double fXMiddle = x_cumulated + iMaxIconHeight / 2;
233
 
        double fPhase = (fXMiddle - x_abs) / myIcons.iSinusoidWidth / fRatio * G_PI + G_PI / 2;
 
233
        double fPhase = (fXMiddle - x_abs) / myIconsParam.iSinusoidWidth / fRatio * G_PI + G_PI / 2;
234
234
        if (fPhase < 0)
235
235
        {
236
236
                fPhase = 0;
239
239
        {
240
240
                fPhase = G_PI;
241
241
        }
242
 
        double fScale = 1 + fMagnitude * g_fAmplitude * sin (fPhase);
 
242
        double fScale = 1 + fMagnitude * myIconsParam.fAmplitude * sin (fPhase);
243
243
        double fX = x_cumulated - 0*(fFlatDockWidth - iWidth) / 2 + (1 - fScale) * (x_abs - x_cumulated + .5*my_iSpaceBetweenRows);
244
244
        fX = fAlign * iWidth + (fX - fAlign * iWidth) * (1. - fFoldingFactor);
245
245
        
249
249
                x_cumulated = iIconNumber * (iMaxIconHeight + my_iSpaceBetweenRows);
250
250
                //cd_debug ("  %d) x_cumulated = %d\n", iIconNumber, x_cumulated);
251
251
                fXMiddle = x_cumulated + iMaxIconHeight / 2;
252
 
                fPhase = (fXMiddle - x_abs) / myIcons.iSinusoidWidth / fRatio * G_PI + G_PI / 2;
 
252
                fPhase = (fXMiddle - x_abs) / myIconsParam.iSinusoidWidth / fRatio * G_PI + G_PI / 2;
253
253
                if (fPhase < 0)
254
254
                {
255
255
                        fPhase = 0;
258
258
                {
259
259
                        fPhase = G_PI;
260
260
                }
261
 
                fScale = 1 + fMagnitude * g_fAmplitude * sin (fPhase);
 
261
                fScale = 1 + fMagnitude * myIconsParam.fAmplitude * sin (fPhase);
262
262
                
263
263
                fX = fX - (iMaxIconHeight + my_iSpaceBetweenRows) * fScale;
264
264
                fX = fAlign * iWidth + (fX - fAlign * iWidth) * (1. - fFoldingFactor);
318
318
                //cd_debug (" ligne %d\n", iNumRow);
319
319
                fXMiddle = x_cumulated + .5*iMaxIconHeight;
320
320
                
321
 
                fPhase = (fXMiddle - x_abs) / myIcons.iSinusoidWidth / fRatio * G_PI + G_PI / 2;
 
321
                fPhase = (fXMiddle - x_abs) / myIconsParam.iSinusoidWidth / fRatio * G_PI + G_PI / 2;
322
322
                if (fPhase < 0)
323
323
                        fPhase = 0;
324
324
                else if (fPhase > G_PI)
325
325
                        fPhase = G_PI;
326
 
                fScale = 1 + fMagnitude * g_fAmplitude * sin (fPhase);
 
326
                fScale = 1 + fMagnitude * myIconsParam.fAmplitude * sin (fPhase);
327
327
                pScales[2*iNumRow] = fScale;
328
328
                //cd_debug ("  fScale : %.2f\n", fScale);
329
329
                
381
381
                return NULL;
382
382
        
383
383
        //\____________________ On se place en coordonnees polaires.
384
 
        double fMaxScale =  1. + my_fRainbowMagnitude * g_fAmplitude;
 
384
        double fMaxScale =  1. + my_fRainbowMagnitude * myIconsParam.fAmplitude;
385
385
        int iMaxIconWidth = pDock->iMaxIconHeight + my_iSpaceBetweenIcons;
386
386
        double fCone = G_PI - 2 * my_fRainbowConeOffset;
387
387
        int iNbIcons = g_list_length (pDock->icons);
487
487
        
488
488
        //g_print ("fRadius : %.2f ; limite : %.2f\n", fRadius, fCurrentRadius + pDock->iMaxIconHeight * fCurrentScale);
489
489
        if (! pDock->container.bInside ||
490
 
                fRadius > fCurrentRadius + pDock->iMaxIconHeight * fCurrentScale + myLabels.iLabelSize - (pDock->fFoldingFactor > 0 ? 20 : 0) ||
 
490
                fRadius > fCurrentRadius + pDock->iMaxIconHeight * fCurrentScale + myIconsParam.iLabelSize - (pDock->fFoldingFactor > 0 ? 20 : 0) ||
491
491
                (fTheta < - G_PI/2 + my_fRainbowConeOffset || fTheta > G_PI/2 - my_fRainbowConeOffset) && fRadius > iMinRadius + .5 * pDock->iMaxIconHeight * fMaxScale)
492
492
        {
493
493
                cd_debug ("<<< on sort du demi-disque >>>\n");
563
563
                }
564
564
        }
565
565
        
566
 
        double fMaxScale =  1. + my_fRainbowMagnitude * g_fAmplitude;
 
566
        double fMaxScale =  1. + my_fRainbowMagnitude * myIconsParam.fAmplitude;
567
567
        double fRadius=0;
568
568
        if (my_fRainbowColor[3] != 0 && pDock->icons != NULL)
569
569
        {
684
684
                pVertexTab[2*4+0] = - pVertexTab[2*0+0];
685
685
                pVertexTab[2*4+1] = pVertexTab[2*0+1];
686
686
                
687
 
                cairo_dock_draw_current_path_opengl (myBackground.iDockLineWidth, my_fRainbowLineColor, 5);
 
687
                cairo_dock_draw_current_path_opengl (myDocksParam.iDockLineWidth, my_fRainbowLineColor, 5);
688
688
                
689
689
                glDisableClientState(GL_COLOR_ARRAY);
690
690
                glPopMatrix ();