~ubuntu-branches/ubuntu/saucy/cairo-dock-plug-ins/saucy-proposed

« back to all changes in this revision

Viewing changes to Global-Menu/src/applet-draw.c

  • Committer: Jamie Strandboge
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2012-03-26 14:35:01 UTC
  • mfrom: (25.1.1 cairo-dock-plug-ins)
  • Revision ID: jamie@canonical.com-20120326143501-r3c8mq6n2vyc0e2j
* New upstream release. (LP: #961579)
* Upstream ChangeLog: (main changes)
 - Updated translations
 - MusicPlayer:
  + When choosing the player the first time, launch it and set the name
  + It seems the latest stable version of rhythmbox now re-uses this DBus
     address: org.mpris.MediaPlayer2.rhythmbox
 - Use the default bg color for always visible icons
 - GMenu: check if kde4-applications.menu and lxde-applications.menu
    are available
 - Dbus:
  + Bash interface: fixed a typo
  + Changed the third-party applets dir on the server for the 3.0
  + Enabling threads on the Python Interface
  + Modified the old SetEmblem method to use the new overlays
 - Enable GVFS if detected
 - Indicators: handle the case where the service crashes
 - Status-Notifier:
  + Indicator 0.4.90 (and newer) has a new variable (Title)
  + Display Label first if it's available instead of Title first
  + Fixed a bug with empty labels
  + KDE's watcher: if ItemIsMenu is true (e.g. Klipper) and if we only show
     the menu on left click, we emit a signal to the application to show
     its own menu
  + checked if the menu path is different that '/NO_DBUSMENU'
  + IAS: checked if an item is not already available in the systray
     (workaround) and fixed a few typos
  + Added a space between icons and fixed the wrong drawing of the icon
     on a vertical dock if the icon can be resized
  + Used cairo_dock_add_path_to_icon_theme
 - Sound control:
  + Fixed a small bug on reload (invisible icon)
  + Updated the Dbus names to match with Ubuntu 12.04
  + Backported the latest version of Ubuntu's indicator-sound into the
     Sound-Control applet
  + Make some items in the menu invisible if not available
  + Worked around a bug in libindicator, which keeps internally
     the service pointer
 - Logout:
  + Fixed a tiny memory leak
  + Look for a different icon's size if we want to display this icon in
     a menu/a dock/an emblem
 - PowerManager:
  + Removed an extraseparators in the menu
 - Clock:
  + Used the logical rectangle in order to fix the position of the text
  + Removed unused files
  + Removed useless translations (log.x and log.y = 0)
  + Only used this ratio to limit the deformation with the height
  + Fixed a problem with the ratio if this applet is displayed in
     a vertical dock
 - Remote Control: fixed a crash during the 'click' signal
 - Slider:
  + When reloading, display the changes immediately
  + Added the possibility to refresh the images list from the menu
  + Fixed the loading of the image on startup, when the applet's size is
     not yet stable
  + Code cleaning
 - Fixed an error when compiling without libindicator
 - A few minor changes (comments, factorisation, etc)
 - Recent-Events: if zeitgeist is not yet running on first search,
    try 3 times before giving up.
* debian/control:
 - Updated the version of cairo-dock-[core;data;dev].

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        }
75
75
        
76
76
        // draw current icon
 
77
        const CairoDockImageBuffer *pImage = NULL, *pPrevImage = NULL;
 
78
        
77
79
        Icon *pAppli = cairo_dock_get_icon_with_Xid (myData.iCurrentWindow);
78
 
        GLuint iTexture = (pAppli ? pAppli->iIconTexture : myData.defaultIcon.iTexture);
 
80
        if (pAppli)
 
81
        {
 
82
                pImage = cairo_dock_appli_get_image_buffer (pAppli);
 
83
        }
 
84
        GLuint iTexture = (pImage ? pImage->iTexture : 0);
 
85
        
79
86
        Icon *pPrevIcon = cairo_dock_get_icon_with_Xid (myData.iPreviousWindow);
80
 
        GLuint iPrevTexture = (pPrevIcon ? pPrevIcon->iIconTexture : myData.defaultIcon.iTexture);
 
87
        if (pPrevIcon)
 
88
        {
 
89
                pPrevImage = cairo_dock_appli_get_image_buffer (pPrevIcon);
 
90
        }
 
91
        GLuint iPrevTexture = (pPrevImage ? pPrevImage->iTexture : 0);
81
92
        
82
93
        if (iPrevTexture != 0)
83
94
        {
178
189
                y = 0;  // on top
179
190
        }
180
191
        
181
 
        Icon *pAppli = cairo_dock_get_icon_with_Xid (myData.iCurrentWindow);
182
 
        cairo_surface_t *pSurface = (pAppli ? pAppli->pIconBuffer : myData.defaultIcon.pSurface);
 
192
        const CairoDockImageBuffer *pImage = NULL, *pPrevImage = NULL;
 
193
        
183
194
        Icon *pPrevIcon = cairo_dock_get_icon_with_Xid (myData.iPreviousWindow);
184
 
        cairo_surface_t *pPrevSurface = (pPrevIcon ? pPrevIcon->pIconBuffer : myData.defaultIcon.pSurface);
185
 
        
186
 
        if (pPrevSurface != NULL)
187
 
        {
188
 
                cairo_set_source_surface (myDrawContext, pPrevSurface, x, y);
 
195
        if (pPrevIcon)
 
196
        {
 
197
                pPrevImage = cairo_dock_appli_get_image_buffer (pPrevIcon);
 
198
        }
 
199
        if (pPrevImage && pPrevImage->pSurface)
 
200
        {
 
201
                cairo_save (myDrawContext);
 
202
                cairo_scale (myDrawContext, (double)w / pPrevImage->iWidth, (double)h / pPrevImage->iHeight);
 
203
                cairo_set_source_surface (myDrawContext, pPrevImage->pSurface, x, y);
189
204
                cairo_paint_with_alpha (myDrawContext, 1-f);
190
 
        }
191
 
        if (pSurface != NULL)
192
 
        {
193
 
                cairo_set_source_surface (myDrawContext, pSurface, x, y);
 
205
                cairo_restore (myDrawContext);
 
206
        }
 
207
        
 
208
        Icon *pAppli = cairo_dock_get_icon_with_Xid (myData.iCurrentWindow);
 
209
        if (pAppli)
 
210
        {
 
211
                pImage = cairo_dock_appli_get_image_buffer (pAppli);
 
212
        }
 
213
        if (pImage && pImage->pSurface)
 
214
        {
 
215
                cairo_save (myDrawContext);
 
216
                cairo_scale (myDrawContext, (double)w / pImage->iWidth, (double)h / pImage->iHeight);
 
217
                cairo_set_source_surface (myDrawContext, pImage->pSurface, x, y);
194
218
                cairo_paint_with_alpha (myDrawContext, f);
 
219
                cairo_restore (myDrawContext);
195
220
        }
196
221
        
197
222
        // draw window buttons