Logo Search packages:      
Sourcecode: cairo-dock version File versions

void cairo_dock_set_icon_surface_full ( cairo_t *  pIconContext,
cairo_surface_t *  pSurface,
double  fScale,
double  fAlpha,
Icon *  pIcon,
CairoContainer *  pContainer 
)

Applique une surface sur un contexte, en effacant tout au prealable, et en appliquant un facteur de zoom et de transparence.

Parameters:
pIconContext le contexte du dessin; est modifie par la fonction.
pSurface la surface a appliquer.
fScale le zoom.
fAlpha la transparence.
pIcon l'icone.
pContainer le container de l'icone.

Definition at line 80 of file cairo-dock-applet-facility.c.

{
      g_return_if_fail (cairo_status (pIconContext) == CAIRO_STATUS_SUCCESS);

      //\________________ On efface l'ancienne image.
      cairo_set_source_rgba (pIconContext, 0.0, 0.0, 0.0, 0.0);
      cairo_set_operator (pIconContext, CAIRO_OPERATOR_SOURCE);
      cairo_paint (pIconContext);
      cairo_set_operator (pIconContext, CAIRO_OPERATOR_OVER);
      
      //\________________ On applique la nouvelle image.
      if (pSurface != NULL && fScale > 0)
      {
            if (fScale != 1 && pIcon != NULL)
            {
                  double fMaxScale = (CAIRO_DOCK_IS_DOCK (pContainer) ? (1 + g_fAmplitude) / CAIRO_DOCK (pContainer)->fRatio : 1);
                  cairo_translate (pIconContext, pIcon->fWidth * fMaxScale / 2 * (1 - fScale) , pIcon->fHeight * fMaxScale / 2 * (1 - fScale));
                  cairo_scale (pIconContext, fScale, fScale);
            }
            
            cairo_set_source_surface (
                  pIconContext,
                  pSurface,
                  0.,
                  0.);
            
            if (fAlpha != 1)
                  cairo_paint_with_alpha (pIconContext, fAlpha);
            else
                  cairo_paint (pIconContext);
      }
}


Generated by  Doxygen 1.6.0   Back to index