Cairo-Dock  3.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cairo-dock-desklet-factory.h File Reference

Data Structures

struct  _CairoDeskletDecoration
 Decoration of a Desklet. More...
struct  _CairoDeskletAttr
 Configuration attributes of a Desklet. More...
struct  _CairoDeskletRenderer
 Definition of a Desklet's renderer. More...
struct  _CairoDesklet
 Definition of a Desklet, which derives from a Container. More...


#define CAIRO_DESKLET(pContainer)
#define gldi_desklet_add_interactive_widget(pDesklet, pInteractiveWidget)


enum  CairoDeskletVisibility {
 Type of accessibility of a Desklet. More...


CairoDeskletgldi_desklet_new (CairoDeskletAttr *attr)
void gldi_desklet_add_interactive_widget_with_margin (CairoDesklet *pDesklet, GtkWidget *pInteractiveWidget, int iRightMargin)
void gldi_desklet_set_margin (CairoDesklet *pDesklet, int iRightMargin)
GtkWidget * gldi_desklet_steal_interactive_widget (CairoDesklet *pDesklet)
void gldi_desklet_hide (CairoDesklet *pDesklet)
void gldi_desklet_show (CairoDesklet *pDesklet)
void gldi_desklet_set_accessibility (CairoDesklet *pDesklet, CairoDeskletVisibility iVisibility, gboolean bSaveState)
void gldi_desklet_set_sticky (CairoDesklet *pDesklet, gboolean bSticky)
void gldi_desklet_lock_position (CairoDesklet *pDesklet, gboolean bPositionLocked)

Detailed Description

This file is a part of the Cairo-Dock project Login : Started on Sun Jan 27 18:35:38 2008 Cedric GESTES $Id$


Copyright : (C) 2008 Cedric GESTES E-mail : see the 'copyright' file.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see This class defines the Desklets, that are Widgets placed directly on your desktop. 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. Desklets can be resized or moved directly with the mouse, and can be rotated in the 3 directions of space. To actually create or destroy a Desklet, use the Desklet Manager's functoins in cairo-dock-desklet-manager.h.

Macro Definition Documentation

#define GLDI_OBJECT_IS_DESKLET (   obj)

Say if an object is a Desklet.

objthe object.
TRUE if the object is a Desklet.
#define CAIRO_DESKLET (   pContainer)

Cast a Container into a Desklet.

pContainerthe container.
the desklet.
#define gldi_desklet_add_interactive_widget (   pDesklet,

Add a GtkWidget to a desklet. Only 1 widget is allowed per desklet, if you need more, you can just use a GtkContainer, and place as many widget as you want inside.

pInteractiveWidgetthe widget to add.
pDeskletthe desklet.

Enumeration Type Documentation

Type of accessibility of a Desklet.


Normal, like normal window.


always above


always below


on the Compiz widget layer


prevent other windows form overlapping it

Function Documentation

CairoDesklet* gldi_desklet_new ( CairoDeskletAttr attr)

Create a new desklet.

attrthe attributes of the desklet
the desklet.
void gldi_desklet_add_interactive_widget_with_margin ( CairoDesklet pDesklet,
GtkWidget *  pInteractiveWidget,
int  iRightMargin 

Add a GtkWidget to a desklet. Only 1 widget is allowed per desklet, if you need more, you can just use a GtkContainer, and place as many widget as you want inside.

pInteractiveWidgetthe widget to add.
pDeskletthe desklet.
iRightMarginright margin, in pixels, useful to keep a clickable zone on the desklet, or 0 if you don't want a margin.
void gldi_desklet_set_margin ( CairoDesklet pDesklet,
int  iRightMargin 

Set the right margin of a desklet. This is useful to keep a clickable zone on the desklet when you put a GTK widget inside.

pDeskletthe desklet.
iRightMarginright margin, in pixels.
GtkWidget* gldi_desklet_steal_interactive_widget ( CairoDesklet pDesklet)

Detach the interactive widget from a desklet. The widget can then be placed anywhere after that. You have to unref it after you placed it into a container, or to destroy it.

pDeskletthe desklet with an interactive widget.
the widget.
void gldi_desklet_hide ( CairoDesklet pDesklet)

Hide a desklet.

pDeskletthe desklet.
void gldi_desklet_show ( CairoDesklet pDesklet)

Show a desklet, and give it the focus.

pDeskletthe desklet.
void gldi_desklet_set_accessibility ( CairoDesklet pDesklet,
CairoDeskletVisibility  iVisibility,
gboolean  bSaveState 

Set a desklet's accessibility. For Widget Layer, the WM must support it and the correct rule must be set up in the WM (for instance for Compiz : class=Cairo-dock & type=utility). The function automatically sets up the rule for Compiz (if Dbus is activated).

pDeskletthe desklet.
iVisibilitythe new accessibility.
bSaveStatewhether to save the new state in the conf file.
void gldi_desklet_set_sticky ( CairoDesklet pDesklet,
gboolean  bSticky 

Set a desklet sticky (i.e. visible on all desktops), or not. In case the desklet is set unsticky, its current desktop/viewport is saved.

pDeskletthe desklet.
bStickywhether the desklet should be sticky or not.
void gldi_desklet_lock_position ( CairoDesklet pDesklet,
gboolean  bPositionLocked 

Lock the position of a desklet. This makes the desklet impossible to rotate, drag with the mouse, or retach to the dock. The new state is saved in conf.

pDeskletthe desklet.
bPositionLockedwhether the position should be locked or not.