~ubuntu-branches/ubuntu/maverick/cairo-dock/maverick

« back to all changes in this revision

Viewing changes to src/icon-factory/cairo-dock-applet-factory.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-09 23:26:12 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100809232612-yp4c6ig3jt1bzpdv
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614624)
* Fixed a few bugs on LP:
 - LP: #518453: Dock appears under all windows
                 (Compiz - fullscreen window)
 - LP: #521369: Separator are not removed when closing
                 grouped windows
 - LP: #521762: Some sentences are not correct
 - LP: #526466: Icons of apps with same class shouldn't
                 be stacked by default
 - LP: #535083: Dialogues looks ugly when a lot of them
                 appears at the same time
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - Man pages are now included in the source code
* debian/copyright:
 - Updated with the new pathes and new files
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev as Build-deps
 - Bump Standard-Version to 3.9.1
* debian/cairo-dock-core.install:
 - Man pages are now included in the source code
 - All sonames are now installed into lib32 or lib64
* debian/cairo-dock-dev.install:
 - pkgconfig is now installed into lib32 or lib64

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
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.
 
11
*
 
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/>.
 
18
*/
 
19
 
 
20
#include <math.h>
 
21
#include <string.h>
 
22
#include <stdlib.h>
 
23
#include <cairo.h>
 
24
 
 
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"
 
29
 
 
30
 
 
31
Icon *cairo_dock_new_applet_icon (CairoDockMinimalAppletConfig *pMinimalConfig, CairoDockModuleInstance *pModuleInstance)
 
32
{
 
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;
 
38
        
 
39
        //\____________ On recupere les infos de sa config.
 
40
        icon->cName = g_strdup (pMinimalConfig->cLabel);
 
41
        icon->cFileName = g_strdup (pMinimalConfig->cIconFileName);
 
42
        
 
43
        icon->fOrder = pMinimalConfig->fOrder;
 
44
        icon->bAlwaysVisible = pMinimalConfig->bAlwaysVisible;
 
45
        
 
46
        if (! pMinimalConfig->bIsDetached)
 
47
        {
 
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);
 
51
        }
 
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 !
 
53
        {
 
54
                icon->fWidth = -1;
 
55
                icon->fHeight = -1;
 
56
        }
 
57
        icon->fScale = 1;
 
58
        icon->fGlideScale = 1;
 
59
        icon->fWidthFactor = 1.;
 
60
        icon->fHeightFactor = 1.;
 
61
        
 
62
        return icon;
 
63
}