~cairo-dock-team/ubuntu/precise/cairo-dock-plug-ins/984054

« back to all changes in this revision

Viewing changes to switcher/src/applet-load-icons.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-10 00:05:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810000557-pfxoz5w7hbyclcqh
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614625)
* Fixed a few bugs on LP:
 - LP: #483963: Dustbin applet does not display trashes on all volumes
 - LP: #485159: Some apps have problem with Systray
 - LP: #500677: ~/.xsession-errors is too much used by CD
 - LP: #500979: Shortcuts: the order gets messed up
 - LP: #521531: Mail: crashes on Maildir
 - LP: #519915: GTG: create a new applet to control GTG
 - LP: #526138: GMenu doesn't handle desktop file exec strings properly
 - LP: #531317: CMake: Added an error if the prefix of 'cairo-dock-plugins'
                 is not the same 'cairo-dock-core'
 - LP: #531319: CMake: check the version of 'cairo-dock' when building
                 'cairo-dock-plugins'
 - LP: #537115: Click at the position where icon lavel was, the icon
                 and dock still receive the event
 - LP: #537943: Terminal applet shortkey behaviour
 - LP: #538637: Trash applet doesn't create .trashinfo files on XFCE
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - cdbs is now used.
* debian/copyright:
 - Updated with the new applets
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev, libindicator-dev, libdbusmenu-glib-dev
   libido-0.1-dev, libical-dev, libdbusmenu-gtk-dev as Build-deps
 - Bump Standard-Version to 3.9.1
 - Wget is required for dnd2share applet
 - Added the exact realease for 'cairo-dock-dev' in order to prevent any
    build error if this package is not already available (thx to didrocks)
* debian/cairo-dock-plug-ins*.install:
 - All sonames are now installed into lib32 or lib64 (lib*)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        int i;
34
34
        for (i = 0; i < myData.switcher.iNbViewportTotal; i ++)
35
35
        {
36
 
                pIcon = g_new0 (Icon, 1);
37
 
                
 
36
                pIcon = cairo_dock_create_dummy_launcher (NULL,
 
37
                        (myConfig.bMapWallpaper ? NULL : (myConfig.cDefaultIcon != NULL ? g_strdup (myConfig.cDefaultIcon) : g_strdup (MY_APPLET_SHARE_DATA_DIR"/default.svg"))),
 
38
                        NULL,
 
39
                        g_strdup_printf ("%d",i+1),
 
40
                        i);
38
41
                if (i == iIndex)
39
42
                {
40
43
                        pIcon->cName = g_strdup_printf ("%s (%d)", D_("Current"), i+1);
47
50
                        pIcon->bHasIndicator = FALSE;
48
51
                        pIcon->fAlpha = 1.;
49
52
                }
50
 
                pIcon->cQuickInfo = g_strdup_printf ("%d",i+1);
51
 
                pIcon->fOrder = i;
52
 
                pIcon->fWidthFactor = 1.;
53
 
                pIcon->fHeightFactor = 1.;
54
 
                pIcon->cCommand = g_strdup ("none");
55
53
                pIcon->cParentDockName = g_strdup (myIcon->cName);
56
 
                pIcon->cFileName = (myConfig.bMapWallpaper ? NULL : (myConfig.cDefaultIcon != NULL ? g_strdup (myConfig.cDefaultIcon) : g_strdup (MY_APPLET_SHARE_DATA_DIR"/default.svg")));
57
54
                
58
55
                pIconList = g_list_append (pIconList, pIcon);
59
56
        }
84
81
        {
85
82
                if (myIcon->pSubDock != NULL)  // si on est passe de expanded a compact, le sous-dock vide reste.
86
83
                {
87
 
                        CD_APPLET_DESTROY_MY_SUBDOCK;
 
84
                        cairo_dock_destroy_dock (myIcon->pSubDock, myIcon->cName);
 
85
                        myIcon->pSubDock = NULL;
88
86
                }
89
87
                if (myDesklet)
90
88
                {
98
96
                GList *pIconList = _load_icons ();
99
97
                
100
98
                //\_______________________ On charge la nouvelle liste.
101
 
                gpointer pConfig[2] = {GINT_TO_POINTER (myConfig.bDesklet3D), GINT_TO_POINTER (FALSE)};
102
 
                CD_APPLET_LOAD_MY_ICONS_LIST (pIconList, myConfig.cRenderer, "Caroussel", pConfig);
 
99
                ///gpointer pConfig[2] = {GINT_TO_POINTER (myConfig.bDesklet3D), GINT_TO_POINTER (FALSE)};
 
100
                CD_APPLET_LOAD_MY_ICONS_LIST (pIconList, myConfig.cRenderer, "Slide", NULL);
103
101
                
104
102
                //\_______________________ On peint les icones.
105
 
                cd_switcher_paint_icons ();
 
103
                cd_switcher_trigger_paint_icons ();
106
104
        }
107
105
}
108
106
 
156
154
}
157
155
 
158
156
 
 
157
static gboolean _paint_icons (gpointer data)
 
158
{
 
159
        CD_APPLET_ENTER;
 
160
        if (myConfig.bCompactView)
 
161
                cd_switcher_paint_icons ();
 
162
        myData.iSidPainIcons = 0;
 
163
        CD_APPLET_LEAVE (FALSE);
 
164
}
 
165
void cd_switcher_trigger_paint_icons (void)
 
166
{
 
167
        if (myData.iSidPainIcons != 0)  // on la lance en idle, car les icones sont chargees en idle.
 
168
                g_source_remove (myData.iSidPainIcons);
 
169
        myData.iSidPainIcons = g_idle_add ((GSourceFunc)_paint_icons, NULL);
 
170
}
 
171
 
 
172
 
159
173
void cd_switcher_load_desktop_bg_map_surface (void)
160
174
{
161
175
        CairoDockDesktopBackground *db = cairo_dock_get_desktop_background (FALSE);  // FALSE <=> sans texture.
175
189
        CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight);
176
190
        cd_debug ("%s (%dx%d)", __func__, iWidth, iHeight);
177
191
        
178
 
        cairo_t *pCairoContext = cairo_dock_create_context_from_container (CAIRO_CONTAINER (g_pMainDock));
 
192
        cairo_t *pCairoContext = cairo_dock_create_context_from_container (myContainer);
179
193
        myData.pDesktopBgMapSurface = cairo_dock_duplicate_surface (pBgSurface,
180
 
                pCairoContext,
181
 
                g_iXScreenWidth[CAIRO_DOCK_HORIZONTAL], g_iXScreenHeight[CAIRO_DOCK_HORIZONTAL],
 
194
                g_desktopGeometry.iXScreenWidth[CAIRO_DOCK_HORIZONTAL], g_desktopGeometry.iXScreenHeight[CAIRO_DOCK_HORIZONTAL],
182
195
                iWidth, iHeight);
183
196
        
184
197
        cairo_destroy (pCairoContext);