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...
 

Macros

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

Enumerations

enum  CairoDeskletVisibility {
  CAIRO_DESKLET_NORMAL,
  CAIRO_DESKLET_KEEP_ABOVE,
  CAIRO_DESKLET_KEEP_BELOW,
  CAIRO_DESKLET_ON_WIDGET_LAYER,
  CAIRO_DESKLET_RESERVE_SPACE
}
 Type of accessibility of a Desklet. More...
 

Functions

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 : ctaf4.nosp@m.2@gm.nosp@m.ail.c.nosp@m.om Started on Sun Jan 27 18:35:38 2008 Cedric GESTES $Id$

Author(s)

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 http://www.gnu.org/licenses/. 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.

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

Cast a Container into a Desklet.

Parameters
pContainerthe container.
Returns
the desklet.
#define gldi_desklet_add_interactive_widget (   pDesklet,
  pInteractiveWidget 
)

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.

Parameters
pInteractiveWidgetthe widget to add.
pDeskletthe desklet.

Enumeration Type Documentation

Type of accessibility of a Desklet.

Enumerator
CAIRO_DESKLET_NORMAL 

Normal, like normal window.

CAIRO_DESKLET_KEEP_ABOVE 

always above

CAIRO_DESKLET_KEEP_BELOW 

always below

CAIRO_DESKLET_ON_WIDGET_LAYER 

on the Compiz widget layer

CAIRO_DESKLET_RESERVE_SPACE 

prevent other windows form overlapping it

Function Documentation

CairoDesklet* gldi_desklet_new ( CairoDeskletAttr attr)

Create a new desklet.

Parameters
attrthe attributes of the desklet
Returns
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.

Parameters
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.

Parameters
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.

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

Hide a desklet.

Parameters
pDeskletthe desklet.
void gldi_desklet_show ( CairoDesklet pDesklet)

Show a desklet, and give it the focus.

Parameters
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).

Parameters
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.

Parameters
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.

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