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

Data Structures

struct  _GldiContainer
 Definition of a Container, whom derive Dock, Desklet, Dialog and FlyingContainer. More...
 
struct  _GldiContainerManagerBackend
 Definition of the Container backend. It defines some operations that should be, but are not, provided by GTK. More...
 

Macros

#define CAIRO_CONTAINER(p)
 Get the Container part of a pointer.
 
#define CAIRO_DOCK_IS_CONTAINER(obj)
 
#define gldi_container_enable_drop(pContainer, pCallBack, data)
 

Enumerations

enum  GldiContainerNotifications {
  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,
  NOTIFICATION_UPDATE_SLOW,
  NOTIFICATION_RENDER
}
 signals More...
 
enum  CairoDockTypeHorizontality
 Main orientation of a container.
 

Functions

void gldi_container_reserve_space (GldiContainer *pContainer, int left, int right, int top, int bottom, int left_start_y, int left_end_y, int right_start_y, int right_end_y, int top_start_x, int top_end_x, int bottom_start_x, int bottom_end_x)
 
int gldi_container_get_current_desktop_index (GldiContainer *pContainer)
 
void gldi_container_move (GldiContainer *pContainer, int iNumDesktop, int iAbsolutePositionX, int iAbsolutePositionY)
 
gboolean gldi_container_is_active (GldiContainer *pContainer)
 
void gldi_container_present (GldiContainer *pContainer)
 
void cairo_dock_redraw_container (GldiContainer *pContainer)
 
void cairo_dock_redraw_container_area (GldiContainer *pContainer, GdkRectangle *pArea)
 
void cairo_dock_redraw_icon (Icon *icon)
 
void gldi_container_notify_drop_data (GldiContainer *pContainer, gchar *cReceivedData, Icon *pPointedIcon, double fOrder)
 
GtkWidget * gldi_container_build_menu (GldiContainer *pContainer, Icon *icon)
 

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.

Macro Definition Documentation

#define CAIRO_DOCK_IS_CONTAINER (   obj)

Say if an object is a Container.

Parameters
objthe object.
Returns
TRUE if the object is a Container.
#define gldi_container_enable_drop (   pContainer,
  pCallBack,
  data 
)

Enable a Container to accept drag-and-drops.

Parameters
pContainera container.
pCallBackthe function that will be called when some data is received.
datadata passed to the callback.

Enumeration Type Documentation

signals

Enumerator
NOTIFICATION_BUILD_CONTAINER_MENU 

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

NOTIFICATION_BUILD_ICON_MENU 

notification called when the menu is being built on an icon (possibly NULL). data : {Icon, GldiContainer, 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 

notification called for the fast rendering loop on a container.

NOTIFICATION_UPDATE_SLOW 

notification called for the slow rendering loop on a container.

NOTIFICATION_RENDER 

notification called when a container is rendered.

Function Documentation

void gldi_container_reserve_space ( GldiContainer pContainer,
int  left,
int  right,
int  top,
int  bottom,
int  left_start_y,
int  left_end_y,
int  right_start_y,
int  right_end_y,
int  top_start_x,
int  top_end_x,
int  bottom_start_x,
int  bottom_end_x 
)

Reserve a space on the screen for a Container; other windows won't overlap this space when maximised.

Parameters
pContainerthe container
left
right
top
bottom
left_start_y
left_end_y
right_start_y
right_end_y
top_start_x
top_end_x
bottom_start_x
bottom_end_x
int gldi_container_get_current_desktop_index ( GldiContainer pContainer)

Get the desktop and viewports a Container is placed on.

Parameters
pContainerthe container
Returns
an index representing the desktop and viewports.
void gldi_container_move ( GldiContainer pContainer,
int  iNumDesktop,
int  iAbsolutePositionX,
int  iAbsolutePositionY 
)

Move a Container to a given desktop, viewport, and position (similar to gtk_window_move except that the position is defined on the whole desktop (made of all viewports); it's only useful if the Container is sticky).

Parameters
pContainerthe container
iNumDesktopdesktop number
iAbsolutePositionXhorizontal position on the virtual screen
iAbsolutePositionYvertical position on the virtual screen
gboolean gldi_container_is_active ( GldiContainer pContainer)

Tell if a Container is the current active window (similar to gtk_window_is_active but actually works).

Parameters
pContainerthe container
Returns
TRUE if the Container is the current active window.
void gldi_container_present ( GldiContainer pContainer)

Show a Container and make it take the focus (similar to gtk_window_present, but bypasses the WM focus steal prevention).

Parameters
pContainerthe container
void cairo_dock_redraw_container ( GldiContainer pContainer)

Clear and trigger the redraw of a Container.

Parameters
pContainerthe Container to redraw.
void cairo_dock_redraw_container_area ( GldiContainer 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)

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.
void gldi_container_notify_drop_data ( GldiContainer pContainer,
gchar *  cReceivedData,
Icon pPointedIcon,
double  fOrder 
)

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
GtkWidget* gldi_container_build_menu ( GldiContainer pContainer,
Icon icon 
)

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.