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

« back to all changes in this revision

Viewing changes to src/cairo-dock-applet-factory.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:
21
21
#include "cairo-dock-applet-factory.h"
22
22
 
23
23
extern double g_fAmplitude;
24
 
extern int g_iLabelSize;
25
 
extern gchar *g_cLabelPolice;
26
 
extern gboolean g_bTextAlwaysHorizontal;
27
24
 
28
25
extern int g_tIconAuthorizedWidth[CAIRO_DOCK_NB_TYPES];
29
26
extern int g_tIconAuthorizedHeight[CAIRO_DOCK_NB_TYPES];
34
31
        cd_message ("%s (%.2fx%.2f x %.2f / %d)", __func__, *fWidth, *fHeight,fMaxScale, bApplySizeRestriction);
35
32
        g_return_val_if_fail (cairo_status (pSourceContext) == CAIRO_STATUS_SUCCESS, NULL);
36
33
        double fIconWidthSaturationFactor, fIconHeightSaturationFactor;
37
 
        cairo_dock_calculate_contrainted_size (fWidth,
 
34
        cairo_dock_calculate_size_fill (fWidth,
38
35
                fHeight,
39
36
                (bApplySizeRestriction ? g_tIconAuthorizedWidth[CAIRO_DOCK_APPLET] : 0),
40
37
                (bApplySizeRestriction ? g_tIconAuthorizedHeight[CAIRO_DOCK_APPLET] : 0),
 
38
                FALSE,
41
39
                &fIconWidthSaturationFactor, &fIconHeightSaturationFactor);
42
40
        cd_message (" -> %.2fx%.2f x %.2f", *fWidth, *fHeight,fMaxScale);
43
41
        cairo_surface_t *pNewSurface;
54
52
                        fMaxScale,
55
53
                        *fWidth,
56
54
                        *fHeight,
 
55
                        CAIRO_DOCK_FILL_SPACE,
57
56
                        fWidth,
58
57
                        fHeight,
59
 
                        FALSE);
 
58
                        NULL, NULL);
60
59
                g_free (cIconPath);
61
60
        }
62
61
        return pNewSurface;
63
62
}
64
63
 
65
64
 
66
 
Icon *cairo_dock_create_icon_for_applet (CairoContainer *pContainer, int iWidth, int iHeight, gchar *cName, gchar *cIconFileName, CairoDockModule *pModule)
 
65
Icon *cairo_dock_create_icon_for_applet (CairoContainer *pContainer, int iWidth, int iHeight, gchar *cName, gchar *cIconFileName, CairoDockModuleInstance *pModuleInstance)
67
66
{
68
67
        Icon *icon = g_new0 (Icon, 1);
69
68
        icon->iType = CAIRO_DOCK_APPLET;
70
 
        icon->pModule = pModule;
 
69
        icon->pModuleInstance = pModuleInstance;
71
70
 
72
71
        icon->acName = g_strdup (cName);
73
72
        icon->acFileName = g_strdup (cIconFileName);  // NULL si cIconFileName = NULL.
83
82
        if (CAIRO_DOCK_IS_DOCK (pContainer))
84
83
        {
85
84
                CairoDock *pDock = CAIRO_DOCK (pContainer);
86
 
                ///cairo_dock_fill_one_icon_buffer (icon, pSourceContext, 1 + g_fAmplitude, pDock->bHorizontalDock, TRUE, pDock->bDirectionUp);
87
 
                ///cairo_dock_fill_one_text_buffer (icon, pSourceContext, g_iLabelSize, g_cLabelPolice, (g_bTextAlwaysHorizontal ? CAIRO_DOCK_HORIZONTAL : pDock->bHorizontalDock), pDock->bDirectionUp);
88
85
                cairo_dock_fill_icon_buffers_for_dock (icon, pSourceContext, pDock);
89
86
        }
90
87
        else