2
** Login : <ctaf42@gmail.com>
3
** Started on Sun Jan 27 18:35:38 2008 Cedric GESTES
7
** - Cedric GESTES <ctaf42@gmail.com>
10
** Copyright (C) 2008 Cedric GESTES
11
** This program is free software; you can redistribute it and/or modify
12
** it under the terms of the GNU General Public License as published by
13
** the Free Software Foundation; either version 3 of the License, or
14
** (at your option) any later version.
16
** This program is distributed in the hope that it will be useful,
17
** but WITHOUT ANY WARRANTY; without even the implied warranty of
18
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
** GNU General Public License for more details.
21
** You should have received a copy of the GNU General Public License
22
** along with this program; if not, write to the Free Software
23
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
#ifndef __CAIRO_DESKLET_MANAGER_H__
27
#define __CAIRO_DESKLET_MANAGER_H__
29
#include "cairo-dock-struct.h"
30
#include "cairo-dock-surface-factory.h"
31
#include "cairo-dock-load.h"
32
#include "cairo-dock-container.h"
37
*@file cairo-dock-desklet-manager.h This class manages the Desklets, that are Widgets placed directly on your desktop.
38
* A Desklet is a container that holds 1 applet's icon plus an optionnal list of other icons and an optionnal GTK widget, has a decoration, suports several accessibility types (like Compiz Widget Layer), and has a renderer.
39
* Desklets can be resized or moved directly with the mouse, and can be rotated in the 3 directions of space.
42
/// Definition of a function that runs through all desklets.
43
typedef gboolean (* CairoDockForeachDeskletFunc) (CairoDesklet *pDesklet, gpointer data);
45
struct _CairoDeskletManager {
47
CairoDesklet* (*create_desklet) (Icon *pIcon, CairoDeskletAttribute *pAttributes);
48
void (*destroy_desklet) (CairoDesklet *pDesklet);
50
void (*foreach_desklet) (CairoDockForeachDeskletFunc pCallback, gpointer user_data);
51
void (*reload_desklets_decorations) (gboolean bDefaultThemeOnly);
52
void (*set_all_desklets_visible) (gboolean bOnWidgetLayerToo);
53
void (*set_desklets_visibility_to_default) (void);
54
void (*get_desklet_by_Xid) (Window Xid);
56
void (*find_clicked_icon_in_desklet) (CairoDesklet *pDesklet);
59
void cairo_dock_init_desklet_manager (void);
60
void cairo_dock_load_desklet_buttons (void);
61
void cairo_dock_unload_desklet_buttons (void);
64
/** Create a desklet linked to an Icon, and load its configuration.
65
*@param pIcon the main icon, or NULL.
66
*@param pAttributes the configuration attributes, or NULL.
67
*@return the newly allocated desklet.
69
CairoDesklet *cairo_dock_create_desklet (Icon *pIcon, CairoDeskletAttribute *pAttributes);
71
/** Destroy a desklet.
72
*@param pDesklet a desklet.
74
void cairo_dock_destroy_desklet (CairoDesklet *pDesklet);
77
/** Run a function through all the desklets. If the callback returns TRUE, then the loop ends and the function returns the current desklet.
78
*@param pCallback function to be called on eash desklet. If it returns TRUE, the loop ends and the function returns the current desklet.
79
*@param user_data data to be passed to the callback.
80
*@return the found desklet, or NULL.
82
CairoDesklet *cairo_dock_foreach_desklet (CairoDockForeachDeskletFunc pCallback, gpointer user_data);
84
/** Reload the decorations of all the desklets.
85
*@param bDefaultThemeOnly whether to reload only the desklet that have the default decoration theme.
87
void cairo_dock_reload_desklets_decorations (gboolean bDefaultThemeOnly);
89
/** Make all desklets visible. Their accessibility is set to #CAIRO_DESKLET_NORMAL.
90
*@param bOnWidgetLayerToo TRUE if you want to act on the desklet that are on the WidgetLayer as well.
92
void cairo_dock_set_all_desklets_visible (gboolean bOnWidgetLayerToo);
94
/** Reset the desklets accessibility to the state defined in their conf file.
96
void cairo_dock_set_desklets_visibility_to_default (void);
98
/** Search the desklet whose X ID matches the given one.
100
*@return the desklet that matches, or NULL if none match.
102
CairoDesklet *cairo_dock_get_desklet_by_Xid (Window Xid);
105
/** Find the currently pointed icon in a desklet, taking into account the 3D rotations.
106
*@param pDesklet the desklet.
107
*@return the pointed icon, or NULL if none.
109
Icon *cairo_dock_find_clicked_icon_in_desklet (CairoDesklet *pDesklet);