Cairo-Dock 2.4.0~1
cairo-dock-container.h File Reference

Data Structures

struct  _CairoContainer
 Definition of a Container, whom derive Dock, Desklet, Dialog and FlyingContainer. More...

Defines

#define CAIRO_CONTAINER(p)
 Get the Container part of a pointer.
#define cairo_dock_init_container(pContainer)
#define cairo_dock_init_container_no_opengl(pContainer)
#define cairo_dock_get_max_scale(pContainer)
#define cairo_dock_popup_menu_on_container(menu, pContainer)

Enumerations

enum  CairoContainerNotifications {
  NOTIFICATION_BUILD_CONTAINER_MENU,
  NOTIFICATION_BUILD_ICON_MENU,
  NOTIFICATION_CLICK_ICON,
  NOTIFICATION_DOUBLE_CLICK_ICON,
  NOTIFICATION_MIDDLE_CLICK_ICON,
  NOTIFICATION_SCROLL_ICON,
  NOTIFICATION_ENTER_ICON,
  NOTIFICATION_START_DRAG_DATA,
  NOTIFICATION_DROP_DATA,
  NOTIFICATION_MOUSE_MOVED,
  NOTIFICATION_KEY_PRESSED,
  NOTIFICATION_UPDATE_DEFAULT_CONTAINER,
  NOTIFICATION_UPDATE_DEFAULT_CONTAINER_SLOW,
  NOTIFICATION_RENDER_DEFAULT_CONTAINER
}
 signals More...
enum  CairoDockTypeHorizontality
 Main orientation of a container.
enum  CairoDockTypeContainer
 Types of available containers.

Functions

void cairo_dock_finish_container (CairoContainer *pContainer)
void cairo_dock_redraw_container (CairoContainer *pContainer)
void cairo_dock_redraw_container_area (CairoContainer *pContainer, GdkRectangle *pArea)
void cairo_dock_redraw_icon (Icon *icon, CairoContainer *pContainer)
CairoContainercairo_dock_search_container_from_icon (Icon *icon)
void cairo_dock_allow_widget_to_receive_data (GtkWidget *pWidget, GCallback pCallBack, gpointer data)
gboolean cairo_dock_string_is_adress (const gchar *cString)
void cairo_dock_notify_drop_data (gchar *cReceivedData, Icon *pPointedIcon, double fOrder, CairoContainer *pContainer)
void cairo_dock_popup_menu_on_icon (GtkWidget *menu, Icon *pIcon, CairoContainer *pContainer)
GtkWidget * cairo_dock_add_in_menu_with_stock_and_data (const gchar *cLabel, const gchar *gtkStock, GFunc pFunction, GtkWidget *pMenu, gpointer pData)
GtkWidget * cairo_dock_create_sub_menu (const gchar *cLabel, GtkWidget *pMenu, const gchar *cImage)
GtkWidget * cairo_dock_build_menu (Icon *icon, CairoContainer *pContainer)

Detailed Description

This class defines the Containers, that are classic or hardware accelerated animated windows, and exposes common functions, such as redrawing a part of a container or popping a menu on a container.

A Container is a rectangular on-screen located surface, has the notion of orientation, can hold external datas, monitors the mouse position, and has its own animation loop.

Docks, Desklets, Dialogs, and Flying-containers all derive from Containers.

If you write a new type of container, you must call cairo_dock_init_container when you create it and cairo_dock_finish_container when you destroy it.


Define Documentation

#define cairo_dock_init_container (   pContainer)

Initialize a Container : create a GTK window with transparency and OpenGL support. To be called when you create a new container.

Returns:
the newly allocated GTK window.
#define cairo_dock_init_container_no_opengl (   pContainer)

Same as above, but with no OpenGL support.

#define cairo_dock_get_max_scale (   pContainer)

Get the maximum zoom of the icons inside a given container.

Parameters:
pContainerthe container.
Returns:
the maximum scale factor.
#define cairo_dock_popup_menu_on_container (   menu,
  pContainer 
)

Pop-up a menu on a container. In the case of a dock, it prevents this one from shrinking down.

Parameters:
menuthe menu.
pContainerthe container that was clicked.

Enumeration Type Documentation

signals

Enumerator:
NOTIFICATION_BUILD_CONTAINER_MENU 

notification called when the menu is being built on a container. data : {Icon, CairoContainer, GtkMenu, gboolean*}

NOTIFICATION_BUILD_ICON_MENU 

notification called when the menu is being built on an icon (possibly NULL). data : {Icon, CairoContainer, GtkMenu}

NOTIFICATION_CLICK_ICON 

notification called when use clicks on an icon data : {Icon, CairoDock, int}

NOTIFICATION_DOUBLE_CLICK_ICON 

notification called when the user double-clicks on an icon. data : {Icon, CairoDock}

NOTIFICATION_MIDDLE_CLICK_ICON 

notification called when the user middle-clicks on an icon. data : {Icon, CairoDock}

NOTIFICATION_SCROLL_ICON 

notification called when the user scrolls on an icon. data : {Icon, CairoDock, int}

NOTIFICATION_ENTER_ICON 

notification called when the mouse enters an icon. data : {Icon, CairoDock, gboolean*}

NOTIFICATION_START_DRAG_DATA 

notification called when the mouse enters a dock while dragging an object.

NOTIFICATION_DROP_DATA 

notification called when something is dropped inside a container. data : {gchar*, Icon, double*, CairoDock}

NOTIFICATION_MOUSE_MOVED 

notification called when the mouse has moved inside a container.

NOTIFICATION_KEY_PRESSED 

notification called when a key is pressed in a container that has the focus.

NOTIFICATION_UPDATE_DEFAULT_CONTAINER 

notification called for the fast rendering loop on a default container.

NOTIFICATION_UPDATE_DEFAULT_CONTAINER_SLOW 

notification called for the slow rendering loop on a default container.

NOTIFICATION_RENDER_DEFAULT_CONTAINER 

notification called when a default container is rendered.


Function Documentation

void cairo_dock_finish_container ( CairoContainer pContainer)

Finish a Container. To be called before you free it.

Parameters:
pContainera Container.
void cairo_dock_redraw_container ( CairoContainer pContainer)

Clear and trigger the redraw of a Container.

Parameters:
pContainerthe Container to redraw.
void cairo_dock_redraw_container_area ( CairoContainer pContainer,
GdkRectangle *  pArea 
)

Clear and trigger the redraw of a part of a container.

Parameters:
pContainerthe Container to redraw.
pAreathe zone to redraw.
void cairo_dock_redraw_icon ( Icon icon,
CairoContainer pContainer 
)

Clear and trigger the redraw of an Icon. The drawing is not done immediately, but when the expose event is received.

Parameters:
iconl'icone a retracer.
pContainerle container de l'icone.
CairoContainer* cairo_dock_search_container_from_icon ( Icon icon)

Search for the Container of a given Icon (dock or desklet in the case of an applet).

Parameters:
iconthe icon.
Returns:
the container contening this icon, or NULL if the icon is nowhere.
void cairo_dock_allow_widget_to_receive_data ( GtkWidget *  pWidget,
GCallback  pCallBack,
gpointer  data 
)

Let a widget accepts drag-and-drops.

Parameters:
pWidgeta widget.
pCallBackthe function that will be called when some data is received.
datadata passed to the callback.
gboolean cairo_dock_string_is_adress ( const gchar *  cString)

Say if a string is an adress (file://xxx, http://xxx, ftp://xxx, etc).

Parameters:
cStringa string.
Returns:
TRUE if it's an address.
void cairo_dock_notify_drop_data ( gchar *  cReceivedData,
Icon pPointedIcon,
double  fOrder,
CairoContainer pContainer 
)

Notify everybody that a drop has just occured.

Parameters:
cReceivedDatathe dropped data.
pPointedIconthe icon which was pointed when the drop occured.
fOrderthe order of the icon if the drop occured on it, or LAST_ORDER if the drop occured between 2 icons.
pContainerthe container of the icon
void cairo_dock_popup_menu_on_icon ( GtkWidget *  menu,
Icon pIcon,
CairoContainer pContainer 
)

Pop-up a menu on an icon. The menu is placed so that it touches the icon, without overlapping it. If the icon is NULL, it will be placed it at the mouse's position. In the case of a dock, it prevents this one from shrinking down.

Parameters:
menuthe menu.
pIconthe icon, or NULL.
pContainerthe container that was clicked.
GtkWidget* cairo_dock_add_in_menu_with_stock_and_data ( const gchar *  cLabel,
const gchar *  gtkStock,
GFunc  pFunction,
GtkWidget *  pMenu,
gpointer  pData 
)

Add an entry to a given menu.

Parameters:
cLabellabel of the entry
gtkStocka GTK stock or a path to an image
pFunctioncallback
pMenuthe menu to insert the entry in
pDatadata to feed the callback with
Returns:
the new menu-entry that has been added.
GtkWidget* cairo_dock_create_sub_menu ( const gchar *  cLabel,
GtkWidget *  pMenu,
const gchar *  cImage 
)

Add sub-menu to a given menu.

Parameters:
cLabellabel of the sub-menu
pMenuthe menu to insert the entry in
cImagea GTK stock or a path to an image
Returns:
the new sub-menu that has been added.
GtkWidget* cairo_dock_build_menu ( Icon icon,
CairoContainer pContainer 
)

Build the main menu of a Container.

Parameters:
iconthe icon that was left-clicked, or NULL if none.
pContainerthe container that was left-clicked.
Returns:
the menu.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines