~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric

« back to all changes in this revision

Viewing changes to desklet-rendering/src/rendering-desklet-slide.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:
46
46
                pSlide->iGapBetweenIcons = 10;
47
47
        }
48
48
        
49
 
        cairo_dock_register_notification_on_container (CAIRO_CONTAINER (pDesklet), CAIRO_DOCK_ENTER_ICON, (CairoDockNotificationFunc) on_enter_icon_slide, CAIRO_DOCK_RUN_FIRST, NULL);
 
49
        cairo_dock_register_notification_on_object (CAIRO_CONTAINER (pDesklet), NOTIFICATION_ENTER_ICON, (CairoDockNotificationFunc) on_enter_icon_slide, CAIRO_DOCK_RUN_FIRST, NULL);  // CAIRO_CONTAINER (pDesklet)
50
50
        
51
51
        return pSlide;
52
52
}
71
71
        
72
72
        double w = pDesklet->container.iWidth - 2 * pSlide->fMargin;
73
73
        double h = pDesklet->container.iHeight - 2 * pSlide->fMargin;
74
 
        int dh = myLabels.iLabelSize;  // taille verticale ajoutee a chaque icone.
 
74
        int dh = myIconsParam.iLabelSize;  // taille verticale ajoutee a chaque icone.
75
75
        int dw = 2 * dh;  // taille horizontale ajoutee a chaque icone.
76
76
        int di = pSlide->iGapBetweenIcons;  // ecart entre 2 lignes/colonnes.
77
77
        
78
78
        int p, q;  // nombre de lignes et colonnes.
79
79
        int iSize;
80
80
        pSlide->iIconSize = 0, pSlide->iNbLines = 0, pSlide->iNbColumns = 0;
81
 
        //g_print ("%d icones sur %dx%d (%d)\n", pSlide->iNbIcons, (int)w, (int)h, myLabels.iLabelSize);
 
81
        //g_print ("%d icones sur %dx%d (%d)\n", pSlide->iNbIcons, (int)w, (int)h, myIconsParam.iLabelSize);
82
82
        for (p = 1; p <= pSlide->iNbIcons; p ++)
83
83
        {
84
84
                q = (int) ceil ((double)pSlide->iNbIcons / p);
105
105
 
106
106
static void free_data (CairoDesklet *pDesklet)
107
107
{
108
 
        cairo_dock_remove_notification_func_on_container (CAIRO_CONTAINER (pDesklet), CAIRO_DOCK_ENTER_ICON, (CairoDockNotificationFunc) on_enter_icon_slide, NULL);
 
108
        cairo_dock_remove_notification_func_on_object (CAIRO_CONTAINER (pDesklet), NOTIFICATION_ENTER_ICON, (CairoDockNotificationFunc) on_enter_icon_slide, NULL);
109
109
        
110
110
        CDSlideParameters *pSlide = (CDSlideParameters *) pDesklet->pRendererData;
111
111
        if (pSlide == NULL)
213
213
        // les icones.
214
214
        double w = pDesklet->container.iWidth - 2 * pSlide->fMargin;
215
215
        double h = pDesklet->container.iHeight - 2 * pSlide->fMargin;
216
 
        int dh = (h - pSlide->iNbLines * (pSlide->iIconSize + myLabels.iLabelSize)) / (pSlide->iNbLines != 1 ? pSlide->iNbLines - 1 : 1);  // ecart entre 2 lignes.
 
216
        int dh = (h - pSlide->iNbLines * (pSlide->iIconSize + myIconsParam.iLabelSize)) / (pSlide->iNbLines != 1 ? pSlide->iNbLines - 1 : 1);  // ecart entre 2 lignes.
217
217
        int dw = (w - pSlide->iNbColumns * pSlide->iIconSize) / pSlide->iNbColumns;  // ecart entre 2 colonnes.
218
218
        
219
219
        // on determine la 1ere icone a tracer : l'icone suivant l'icone pointee.
220
220
        
221
 
        double x = pSlide->fMargin + dw/2, y = pSlide->fMargin + myLabels.iLabelSize;
 
221
        double x = pSlide->fMargin + dw/2, y = pSlide->fMargin + myIconsParam.iLabelSize;
222
222
        int q = 0;
223
223
        Icon *pIcon;
224
224
        GList *ic;
237
237
                {
238
238
                        q = 0;
239
239
                        x = pSlide->fMargin + dw/2;
240
 
                        y += pSlide->iIconSize + myLabels.iLabelSize + dh;
 
240
                        y += pSlide->iIconSize + myIconsParam.iLabelSize + dh;
241
241
                }
242
242
        }
243
243
        
273
273
                                        cairo_set_source_surface (pCairoContext,
274
274
                                                pIcon->pTextBuffer,
275
275
                                                fOffsetX + pIcon->fWidth/2 - pIcon->iTextWidth/2,
276
 
                                                -myLabels.iLabelSize);
 
276
                                                -myIconsParam.iLabelSize);
277
277
                                        cairo_paint_with_alpha (pCairoContext, fAlpha);
278
278
                                }
279
279
                                else
280
280
                                {
281
281
                                        fAlpha = .6;
282
 
                                        if (pIcon->iTextWidth > pIcon->fWidth + 2 * myLabels.iLabelSize)
 
282
                                        if (pIcon->iTextWidth > pIcon->fWidth + 2 * myIconsParam.iLabelSize)
283
283
                                        {
284
 
                                                fOffsetX = - myLabels.iLabelSize;
 
284
                                                fOffsetX = - myIconsParam.iLabelSize;
285
285
                                                cairo_pattern_t *pGradationPattern = cairo_pattern_create_linear (fOffsetX,
286
286
                                                        0.,
287
 
                                                        fOffsetX + pIcon->fWidth + 2*myLabels.iLabelSize,
 
287
                                                        fOffsetX + pIcon->fWidth + 2*myIconsParam.iLabelSize,
288
288
                                                        0.);
289
289
                                                cairo_pattern_set_extend (pGradationPattern, CAIRO_EXTEND_NONE);
290
290
                                                cairo_pattern_add_color_stop_rgba (pGradationPattern,
308
308
                                                cairo_set_source_surface (pCairoContext,
309
309
                                                        pIcon->pTextBuffer,
310
310
                                                        fOffsetX,
311
 
                                                        -myLabels.iLabelSize);
 
311
                                                        -myIconsParam.iLabelSize);
312
312
                                                cairo_mask (pCairoContext, pGradationPattern);
313
313
                                                cairo_pattern_destroy (pGradationPattern);
314
314
                                        }
318
318
                                                cairo_set_source_surface (pCairoContext,
319
319
                                                        pIcon->pTextBuffer,
320
320
                                                        fOffsetX,
321
 
                                                        -myLabels.iLabelSize);
 
321
                                                        -myIconsParam.iLabelSize);
322
322
                                                cairo_paint_with_alpha (pCairoContext, fAlpha);
323
323
                                        }
324
324
                                }
356
356
        // les icones.
357
357
        double w = pDesklet->container.iWidth - 2 * pSlide->fMargin;
358
358
        double h = pDesklet->container.iHeight - 2 * pSlide->fMargin;
359
 
        int dh = (h - pSlide->iNbLines * (pSlide->iIconSize + myLabels.iLabelSize)) / (pSlide->iNbLines != 1 ? pSlide->iNbLines - 1 : 1);  // ecart entre 2 lignes.
 
359
        int dh = (h - pSlide->iNbLines * (pSlide->iIconSize + myIconsParam.iLabelSize)) / (pSlide->iNbLines != 1 ? pSlide->iNbLines - 1 : 1);  // ecart entre 2 lignes.
360
360
        int dw = (w - pSlide->iNbColumns * pSlide->iIconSize) / pSlide->iNbColumns;  // ecart entre 2 colonnes.
361
361
        
362
362
        _cairo_dock_enable_texture ();
364
364
        _cairo_dock_set_alpha (1.);
365
365
        
366
366
        
367
 
        double x = pSlide->fMargin + dw/2, y = pSlide->fMargin + myLabels.iLabelSize;
 
367
        double x = pSlide->fMargin + dw/2, y = pSlide->fMargin + myIconsParam.iLabelSize;
368
368
        int q = 0;
369
369
        Icon *pIcon;
370
370
        GList *ic;
383
383
                {
384
384
                        q = 0;
385
385
                        x = pSlide->fMargin + dw/2;
386
 
                        y += pSlide->iIconSize + myLabels.iLabelSize + dh;
 
386
                        y += pSlide->iIconSize + myIconsParam.iLabelSize + dh;
387
387
                }
388
388
        }
389
389
        
434
434
                                else
435
435
                                {
436
436
                                        _cairo_dock_set_alpha (.6);
437
 
                                        if (pIcon->iTextWidth > pIcon->fWidth + 2 * myLabels.iLabelSize)
 
437
                                        if (pIcon->iTextWidth > pIcon->fWidth + 2 * myIconsParam.iLabelSize)
438
438
                                        {
439
439
                                                fOffsetX = 0.;
440
 
                                                u1 = (double) (pIcon->fWidth + 2 * myLabels.iLabelSize) / pIcon->iTextWidth;
 
440
                                                u1 = (double) (pIcon->fWidth + 2 * myIconsParam.iLabelSize) / pIcon->iTextWidth;
441
441
                                        }
442
442
                                }
443
443