~cairo-dock-team/ubuntu/precise/cairo-dock-plug-ins/3.0.0.0rc1

« back to all changes in this revision

Viewing changes to Composite-Manager/src/applet-init.c

  • Committer: Kees Cook
  • Date: 2011-08-11 23:17:39 UTC
  • mfrom: (20.1.1 cairo-dock-plug-ins)
  • Revision ID: kees@outflux.net-20110811231739-cteedan51tmdg77v
Tags: 2.4.0~0beta2-0ubuntu1
releasing version 2.4.0~0beta2-0ubuntu1

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 "applet-config.h"
 
21
#include "applet-notifications.h"
 
22
#include "applet-struct.h"
 
23
#include "applet-composite-manager.h"
 
24
#include "applet-init.h"
 
25
 
 
26
 
 
27
CD_APPLET_DEFINITION (N_("Composite-Manager"),
 
28
        2, 3, 0,
 
29
        CAIRO_DOCK_CATEGORY_APPLET_DESKTOP,
 
30
        N_("This applet allows you to <b>toggle the composite ON/OFF</b>.\n"
 
31
        "The composite is what allows transparency on the desktop, but it can slow down your PC, especially during games.\n"
 
32
        "<b>Click</b> on the icon to switch the composite ON/OFF. You can define a <b>shortcut</b> for this action.\n"
 
33
        "The applet also lets you acces to some actions of the Window-Manager, from <b>middle-click and the menu</b>.\n"
 
34
        "You can define in the configuration a Window-Manager that will provide the composite, and another as a fallback."),
 
35
        "Fabounet")
 
36
 
 
37
 
 
38
CD_APPLET_INIT_BEGIN
 
39
        if (myDesklet)
 
40
        {
 
41
                CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
42
        }
 
43
        
 
44
        cd_init_wms ();
 
45
        
 
46
        CD_APPLET_REGISTER_FOR_CLICK_EVENT;
 
47
        CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT;
 
48
        CD_APPLET_REGISTER_FOR_BUILD_MENU_EVENT;
 
49
CD_APPLET_INIT_END
 
50
 
 
51
 
 
52
CD_APPLET_STOP_BEGIN
 
53
        cd_stop_wms ();
 
54
        
 
55
        CD_APPLET_UNREGISTER_FOR_CLICK_EVENT;
 
56
        CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT;
 
57
        CD_APPLET_UNREGISTER_FOR_BUILD_MENU_EVENT;
 
58
CD_APPLET_STOP_END
 
59
 
 
60
 
 
61
CD_APPLET_RELOAD_BEGIN
 
62
        if (CD_APPLET_MY_CONFIG_CHANGED)
 
63
        {
 
64
                if (myDesklet && CD_APPLET_MY_CONTAINER_TYPE_CHANGED)  // we are now in a desklet, set a renderer.
 
65
                {
 
66
                        CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
67
                }
 
68
                
 
69
                cd_define_prefered_wms ();
 
70
                
 
71
                cd_draw_current_state ();
 
72
        }
 
73
CD_APPLET_RELOAD_END