2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
#include "cairo-dock-icons.h"
26
#include "cairo-dock-modules.h"
27
#include "cairo-dock-log.h"
28
#include "cairo-dock-applet-factory.h"
31
Icon *cairo_dock_new_applet_icon (CairoDockMinimalAppletConfig *pMinimalConfig, CairoDockModuleInstance *pModuleInstance)
33
//\____________ On cree l'icone.
34
Icon *icon = g_new0 (Icon, 1);
35
icon->iType = CAIRO_DOCK_APPLET;
36
icon->iTrueType = CAIRO_DOCK_ICON_TYPE_APPLET;
37
icon->pModuleInstance = pModuleInstance;
39
//\____________ On recupere les infos de sa config.
40
icon->cName = g_strdup (pMinimalConfig->cLabel);
41
icon->cFileName = g_strdup (pMinimalConfig->cIconFileName);
43
icon->fOrder = pMinimalConfig->fOrder;
44
icon->bAlwaysVisible = pMinimalConfig->bAlwaysVisible;
46
if (! pMinimalConfig->bIsDetached)
48
icon->fWidth = pMinimalConfig->iDesiredIconWidth;
49
icon->fHeight = pMinimalConfig->iDesiredIconHeight;
50
icon->cParentDockName = g_strdup (pMinimalConfig->cDockName != NULL ? pMinimalConfig->cDockName : CAIRO_DOCK_MAIN_DOCK_NAME);
52
else // l'applet creera la surface elle-meme, car on ne sait ni la taille qu'elle voudra lui donner, ni meme si elle l'utilisera !
58
icon->fGlideScale = 1;
59
icon->fWidthFactor = 1.;
60
icon->fHeightFactor = 1.;