~cairo-dock-team/ubuntu/natty/cairo-dock-plug-ins/2.3.0-2.1

« back to all changes in this revision

Viewing changes to desklet-rendering/src/rendering-desklet-controler.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:
68
68
        }
69
69
        
70
70
        int iNbIcons = g_list_length (pDesklet->icons);
71
 
        pControler->fGapBetweenIcons = (pDesklet->container.iWidth - 2*g_iDockRadius) / (iNbIcons + 1);
 
71
        pControler->fGapBetweenIcons = (pDesklet->container.iWidth - 2*myDocksParam.iDockRadius) / (iNbIcons + 1);
72
72
        
73
73
        return pControler;
74
74
}
92
92
        
93
93
        if (pControler->b3D)
94
94
        {
95
 
                pControler->iEllipseHeight = MIN (pDesklet->pIcon->fHeight, pDesklet->container.iHeight - 2 * (myLabels.iconTextDescription.iSize + myIcons.fReflectSize) - 1);
 
95
                pControler->iEllipseHeight = MIN (pDesklet->pIcon->fHeight, pDesklet->container.iHeight - 2 * (myIconsParam.iconTextDescription.iSize + myIconsParam.fReflectSize) - 1);
96
96
                pControler->fInclinationOnHorizon = atan2 (pDesklet->container.iHeight, pDesklet->container.iWidth/4);
97
 
                pControler->iFrameHeight = pControler->iEllipseHeight + 0*2 * myBackground.iFrameMargin + myIcons.fReflectSize;
98
 
                pControler->fExtraWidth = cairo_dock_calculate_extra_width_for_trapeze (pControler->iFrameHeight, pControler->fInclinationOnHorizon, g_iDockRadius, g_iDockLineWidth);
 
97
                pControler->iFrameHeight = pControler->iEllipseHeight + myIconsParam.fReflectSize;
 
98
                pControler->fExtraWidth = cairo_dock_calculate_extra_width_for_trapeze (pControler->iFrameHeight, pControler->fInclinationOnHorizon, myDocksParam.iDockRadius, myDocksParam.iDockLineWidth);
99
99
        }
100
100
        else
101
101
        {
136
136
        double fCentralSphereWidth, fCentralSphereHeight;
137
137
        if (pControler->b3D)
138
138
        {
139
 
                fCentralSphereWidth = MAX (1, (MIN (pDesklet->container.iWidth, pDesklet->container.iHeight - myLabels.iconTextDescription.iSize) - g_iDockRadius) * CONTROLER_RATIO_ICON_DESKLET - myIcons.fReflectSize);
 
139
                fCentralSphereWidth = MAX (1, (MIN (pDesklet->container.iWidth, pDesklet->container.iHeight - myIconsParam.iconTextDescription.iSize) - myDocksParam.iDockRadius) * CONTROLER_RATIO_ICON_DESKLET - myIconsParam.fReflectSize);
140
140
                fCentralSphereHeight = fCentralSphereWidth;
141
141
        }
142
142
        else
143
143
        {
144
 
                fCentralSphereWidth = MAX (1, (pDesklet->container.iWidth - g_iDockRadius) * CONTROLER_RATIO_ICON_DESKLET);
145
 
                fCentralSphereHeight = MAX (1, (pDesklet->container.iHeight - g_iDockRadius - myLabels.iconTextDescription.iSize) * CONTROLER_RATIO_ICON_DESKLET);
 
144
                fCentralSphereWidth = MAX (1, (pDesklet->container.iWidth - myDocksParam.iDockRadius) * CONTROLER_RATIO_ICON_DESKLET);
 
145
                fCentralSphereHeight = MAX (1, (pDesklet->container.iHeight - myDocksParam.iDockRadius - myIconsParam.iconTextDescription.iSize) * CONTROLER_RATIO_ICON_DESKLET);
146
146
        }
147
147
        
148
148
        //\_________________ On charge l'icone centrale.
154
154
                pIcon->iImageWidth = pIcon->fWidth;
155
155
                pIcon->iImageHeight = pIcon->fHeight;
156
156
                pIcon->fDrawX = (pDesklet->container.iWidth - pDesklet->pIcon->fWidth) / 2;
157
 
                pIcon->fDrawY = myLabels.iconTextDescription.iSize + g_iDockRadius/2;
 
157
                pIcon->fDrawY = myIconsParam.iconTextDescription.iSize + myDocksParam.iDockRadius/2;
158
158
                pIcon->fScale = 1.;
159
159
                pIcon->fAlpha = 1.;
160
160
                pIcon->fWidthFactor = 1.;
163
163
        }
164
164
        
165
165
        //\_________________ On charge les boutons.
166
 
        double fX = g_iDockRadius + pControler->fGapBetweenIcons, fY = myLabels.iconTextDescription.iSize + pDesklet->pIcon->fHeight + myIcons.fReflectSize;
 
166
        double fX = myDocksParam.iDockRadius + pControler->fGapBetweenIcons, fY = myIconsParam.iconTextDescription.iSize + pDesklet->pIcon->fHeight + myIconsParam.fReflectSize;
167
167
        GList* ic;
168
168
        for (ic = pDesklet->icons; ic != NULL; ic = ic->next)
169
169
        {
175
175
                }
176
176
                else
177
177
                {
178
 
                        pIcon->fWidth = MAX (1, (pDesklet->container.iWidth - g_iDockRadius) * (1 - CONTROLER_RATIO_ICON_DESKLET));
179
 
                        pIcon->fHeight = MAX (1, (pDesklet->container.iHeight - g_iDockRadius - myLabels.iconTextDescription.iSize) *(1 - CONTROLER_RATIO_ICON_DESKLET));
 
178
                        pIcon->fWidth = MAX (1, (pDesklet->container.iWidth - myDocksParam.iDockRadius) * (1 - CONTROLER_RATIO_ICON_DESKLET));
 
179
                        pIcon->fHeight = MAX (1, (pDesklet->container.iHeight - myDocksParam.iDockRadius - myIconsParam.iconTextDescription.iSize) *(1 - CONTROLER_RATIO_ICON_DESKLET));
180
180
                }
181
181
                pIcon->iImageWidth = pIcon->fWidth;
182
182
                pIcon->iImageHeight = pIcon->fHeight;
221
221
        
222
222
        if (pControler->b3D)
223
223
        {
224
 
                double fX = g_iDockRadius + pControler->fGapBetweenIcons, fY = myLabels.iconTextDescription.iSize + pDesklet->pIcon->fHeight + myIcons.fReflectSize;
 
224
                double fX = myDocksParam.iDockRadius + pControler->fGapBetweenIcons, fY = myIconsParam.iconTextDescription.iSize + pDesklet->pIcon->fHeight + myIconsParam.fReflectSize;
225
225
                for (ic = pDesklet->icons; ic != NULL; ic = ic->next)
226
226
                {
227
227
                        pIcon = ic->data;
238
238
                }
239
239
                
240
240
                //\____________________ On trace le cadre.
241
 
                double fLineWidth = g_iDockLineWidth;
242
 
                double fMargin = 0*myBackground.iFrameMargin;
 
241
                double fLineWidth = myDocksParam.iDockLineWidth;
 
242
                double fMargin = 0;
243
243
                
244
244
                double fDockWidth = pDesklet->container.iWidth - fExtraWidth;
245
245
                int sens=1;
248
248
                fDockOffsetY = pDesklet->container.iHeight - iControlPanelHeight - 2 * fLineWidth - iFrameHeight;
249
249
                
250
250
                cairo_save (pCairoContext);
251
 
                cairo_dock_draw_frame (pCairoContext, g_iDockRadius, fLineWidth, fDockWidth, iFrameHeight, fDockOffsetX, fDockOffsetY, sens, fInclinationOnHorizon, pDesklet->container.bIsHorizontal, TRUE);
 
251
                cairo_dock_draw_frame (pCairoContext, myDocksParam.iDockRadius, fLineWidth, fDockWidth, iFrameHeight, fDockOffsetX, fDockOffsetY, sens, fInclinationOnHorizon, pDesklet->container.bIsHorizontal, TRUE);
252
252
                
253
253
                //\____________________ On dessine les decorations dedans.
254
254
                cairo_set_source_rgba (pCairoContext, .8, .8, .8, .75);
265
265
                
266
266
                //\____________________ On dessine les icones.
267
267
                cairo_save (pCairoContext);
268
 
                pDesklet->pIcon->fDrawY = myLabels.iconTextDescription.iSize;
 
268
                pDesklet->pIcon->fDrawY = myIconsParam.iconTextDescription.iSize;
269
269
                cairo_dock_render_one_icon_in_desklet (pDesklet->pIcon, pCairoContext, TRUE, TRUE, pDesklet->container.iWidth);
270
270
                cairo_restore (pCairoContext);
271
271
                
288
288
                cairo_dock_render_one_icon_in_desklet (pDesklet->pIcon, pCairoContext, FALSE, TRUE, pDesklet->container.iWidth);
289
289
                cairo_restore (pCairoContext);
290
290
                
291
 
                double fX = g_iDockRadius + pControler->fGapBetweenIcons, fY = myLabels.iconTextDescription.iSize + pDesklet->pIcon->fHeight;
 
291
                double fX = myDocksParam.iDockRadius + pControler->fGapBetweenIcons, fY = myIconsParam.iconTextDescription.iSize + pDesklet->pIcon->fHeight;
292
292
                for (ic = pDesklet->icons; ic != NULL; ic = ic->next)
293
293
                {
294
294
                        pIcon = ic->data;