~didrocks/cairo-dock-plug-ins/fix-abi-transition

« back to all changes in this revision

Viewing changes to compiz-icon/src/applet-load-icon.c

  • Committer: matttbe
  • Date: 2010-08-07 01:43:25 UTC
  • Revision ID: matttbe@gmail.com-20100807014325-36tmlrc8n1rrksk5
* New Upstream Version (LP: #614625)
* 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
* debian/cairo-dock-plug-ins*.install:
 - All sonames are now installed into lib32 or lib64 (lib*)
* Fixed a few bugs on LP:
 - LP: #483963, LP: #485159, LP: #500677, LP: #500979
 - LP: #521531, LP: #519915, LP: #526138, LP: #531317
 - LP: #531319, LP: #537115, LP: #537943, LP: #538637
 - More details on the 'ChangeLog' file

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#define MY_NB_ICON_STATE 3
29
29
#define MY_NB_SUB_ICONS 5
30
30
 
31
 
static gchar *s_iconName[MY_NB_SUB_ICONS] = {N_("Configure Compiz"), N_("Emerald Manager"), N_("Reload WM"), N_("Exposition"), N_("Widget Layer")};
32
 
 
33
 
static gchar *s_iconClass[MY_NB_SUB_ICONS] = {"ccsm", "emerald-theme-manager", NULL, NULL, NULL};
34
 
 
35
 
static gchar *s_iconFile[MY_NB_ICON_STATE] = {"default.svg", "broken.svg", "other.svg"};
 
31
static const gchar *s_iconName[MY_NB_SUB_ICONS] = {N_("Configure Compiz"), N_("Emerald Manager"), N_("Reload WM"), N_("Exposition"), N_("Widget Layer")};
 
32
 
 
33
static const gchar *s_iconClass[MY_NB_SUB_ICONS] = {"ccsm", "emerald-theme-manager", NULL, NULL, NULL};
 
34
 
 
35
static const gchar *s_iconFile[MY_NB_ICON_STATE] = {"default.svg", "broken.svg", "other.svg"};
36
36
 
37
37
 
38
38
static GList * _list_icons (void) {
43
43
        if (myConfig.bScriptSubDock)
44
44
                j = 5;
45
45
  
46
 
        for (i = 0; i < j; i ++) {
 
46
        for (i = 0; i < j; i ++)
 
47
        {
47
48
                if (i == 1 && ! myConfig.bEmeraldIcon)
48
49
                        continue;
49
 
                pIcon = g_new0 (Icon, 1);
50
 
                pIcon->cName = g_strdup (D_(s_iconName[i]));
51
 
                if (myConfig.cUserImage[i+MY_NB_ICON_STATE] != NULL) {
52
 
                        pIcon->cFileName = cairo_dock_generate_file_path (myConfig.cUserImage[i+MY_NB_ICON_STATE]);
53
 
                }
54
 
                else {
55
 
                        pIcon->cFileName = g_strdup_printf ("%s/%d.svg", MY_APPLET_SHARE_DATA_DIR, i);
56
 
                }
57
 
                pIcon->fOrder = 2*i;
58
 
                pIcon->iType = 2*i;
59
 
                pIcon->fScale = 1.;
60
 
                pIcon->fAlpha = 1.;
61
 
                pIcon->fWidthFactor = 1.;
62
 
                pIcon->fHeightFactor = 1.;
63
 
                pIcon->cCommand = (s_iconClass[i] != NULL ? g_strdup (s_iconClass[i]) : g_strdup ("none"));
 
50
                pIcon = cairo_dock_create_dummy_launcher (g_strdup (D_(s_iconName[i])),
 
51
                        (myConfig.cUserImage[i+MY_NB_ICON_STATE] != NULL ?
 
52
                                cairo_dock_generate_file_path (myConfig.cUserImage[i+MY_NB_ICON_STATE]) :
 
53
                                g_strdup_printf ("%s/%d.svg", MY_APPLET_SHARE_DATA_DIR, i)),
 
54
                        (s_iconClass[i] != NULL ? g_strdup (s_iconClass[i]) : g_strdup ("none")),
 
55
                        NULL,
 
56
                        2*i);
64
57
                pIcon->cParentDockName = g_strdup (myIcon->cName);
65
58
                pIconList = g_list_append (pIconList, pIcon);
66
 
                if (myConfig.bStealTaskBarIcon && s_iconClass[i] != NULL) {
 
59
                if (myConfig.bStealTaskBarIcon && s_iconClass[i] != NULL)
 
60
                {
67
61
                        cairo_dock_inhibate_class (s_iconClass[i], pIcon);
68
62
                }
69
63
        }
106
100
                CD_APPLET_SET_NAME_FOR_MY_ICON (COMPIZ_DEFAULT_NAME);
107
101
        }
108
102
        GList *pIconList = _list_icons ();  // ne nous appartiendra plus, donc ne pas desallouer.
109
 
        if (myDock) {
110
 
                CD_APPLET_CREATE_MY_SUBDOCK (pIconList, myConfig.cRenderer);
111
 
        }
112
 
        else {
113
 
                myDesklet->icons = pIconList;
114
 
                gpointer pConfig[2] = {GINT_TO_POINTER (FALSE), GINT_TO_POINTER (FALSE)};
115
 
                CD_APPLET_SET_DESKLET_RENDERER_WITH_DATA ("Caroussel", pConfig);
116
 
        }
 
103
        
 
104
        gpointer pConfig[2] = {GINT_TO_POINTER (FALSE), GINT_TO_POINTER (FALSE)};
 
105
        CD_APPLET_LOAD_MY_ICONS_LIST (pIconList, myConfig.cRenderer, "Caroussel", pConfig);
117
106
}