427
426
#define CD_APPLET_REDRAW_MY_ICON \
428
427
cairo_dock_redraw_icon (myIcon, myContainer)
428
/** Redraw the applet's container (as soon as the main loop is available).
429
430
#define CAIRO_DOCK_REDRAW_MY_CONTAINER \
430
431
cairo_dock_redraw_container (myContainer)
431
/** Reload the reflect of the applet's icon (useless in OpenGL mode).
432
/** Reload the reflect of the applet's icon (do nothing in OpenGL mode).
433
434
#define CD_APPLET_UPDATE_REFLECT_ON_MY_ICON \
434
435
if (myContainer->bUseReflect) cairo_dock_add_reflection_to_icon (myDrawContext, myIcon, myContainer)
437
*Charge une image dans une surface, aux dimensions of the icon of l'applet.
438
*@param cImagePath chemin du fichier of l'image.
439
*@return la surface nouvellement creee.
437
/** Load an image into a surface, at the same size as the applet's icon. If the image is given by its sole name, it is searched inside the current theme root folder.
438
*@param cImagePath path or name of an image.
439
*@return the newly allocated surface.
441
441
#define CD_APPLET_LOAD_SURFACE_FOR_MY_APPLET(cImagePath) \
442
cairo_dock_create_surface_for_icon (cImagePath, myDrawContext, myIcon->fWidth * (myDock ? (1 + g_fAmplitude) / myDock->fRatio : 1), myIcon->fHeight* (myDock ? (1 + g_fAmplitude) / myDock->fRatio : 1))
444
*Charge une image utilisateur dans une surface, aux dimensions of the icon of l'applet, ou une image par defaut si la premiere est NULL.
445
*@param cUserImageName nom of l'image utilisateur.
446
*@param cDefaultLocalImageName icone par defaut
447
*@return la surface nouvellement creee.
442
cairo_dock_create_surface_from_image_simple (cImagePath, myDrawContext, myIcon->fWidth * (myDock ? (1 + g_fAmplitude) / myDock->container.fRatio : 1), myIcon->fHeight* (myDock ? (1 + g_fAmplitude) / myDock->container.fRatio : 1))
444
/** Load a user image into a surface, at the same size as the applet's icon, or a default image taken in the installed folder of the applet if the first one is NULL. If the user image is given by its sole name, it is searched inside the current theme root folder.
445
*@param cUserImageName name or path of an user image.
446
*@param cDefaultLocalImageName default image
447
*@return the newly allocated surface.
449
#define CD_APPLET_LOAD_USER_SURFACE_FOR_MY_APPLET(cUserImageName, cDefaultLocalImageName) \
449
#define CD_APPLET_LOAD_SURFACE_FOR_MY_APPLET_WITH_DEFAULT(cUserImageName, cDefaultLocalImageName) \
450
450
__extension__ ({\
451
gchar *_cImagePath; \
451
cairo_surface_t *pSurface; \
452
452
if (cUserImageName != NULL) \
453
_cImagePath = cairo_dock_generate_file_path (cUserImageName); \
453
pSurface = CD_APPLET_LOAD_SURFACE_FOR_MY_APPLET (cUserImageName); \
454
454
else if (cDefaultLocalImageName != NULL)\
455
_cImagePath = g_strdup_printf ("%s/%s", MY_APPLET_SHARE_DATA_DIR, cDefaultLocalImageName); \
455
pSurface = CD_APPLET_LOAD_SURFACE_FOR_MY_APPLET (MY_APPLET_SHARE_DATA_DIR"/"cDefaultLocalImageName); \
458
cairo_surface_t *pSurface = CD_APPLET_LOAD_SURFACE_FOR_MY_APPLET (_cImagePath); \
459
g_free (_cImagePath);\
464
*Applique une surface existante sur le contexte of dessin of l'applet, et la rafraichit.
465
*@param pSurface la surface cairo a dessiner.
460
/** Apply a surface on the applet's icon, and redraw it.
461
*@param pSurface the surface to draw on your icon.
467
463
#define CD_APPLET_SET_SURFACE_ON_MY_ICON(pSurface) do { \
468
464
cairo_dock_set_icon_surface_with_reflect (myDrawContext, pSurface, myIcon, myContainer); \
469
465
cairo_dock_redraw_icon (myIcon, myContainer); } while (0)
471
*Applique une surface existante sur le contexte of dessin of l'applet en la zoomant, et la redessine.
472
*@param pSurface la surface cairo a dessiner.
473
*@param fScale le facteur of zoom (a 1 la surface remplit toute the icon).
467
/** Apply a surface on the applet's icon, with a zoom factor and centered, and redraw it.
468
*@param pSurface the surface to draw on your icon.
469
*@param fScale zoom factor (at 1 the surface will fill all the icon).
475
471
#define CD_APPLET_SET_SURFACE_ON_MY_ICON_WITH_ZOOM(pSurface, fScale) do { \
476
472
cairo_dock_set_icon_surface_full (myDrawContext, pSurface, fScale, 1., myIcon, myContainer); \
477
473
cairo_dock_add_reflection_to_icon (myDrawContext, myIcon, myContainer); \
478
474
cairo_dock_redraw_icon (myIcon, myContainer); } while (0)
480
*Applique une surface existante sur le contexte of dessin of l'applet with un facteur of transparence, et la rafraichit.
481
*@param pSurface la surface cairo a dessiner.
482
*@param fAlpha la transparence (dans [0 , 1]).
476
/** Apply a surface on the applet's icon with a transparency factor, and redraw it.
477
*@param pSurface the surface to draw on your icon.
478
*@param fAlpha transparency (in [0,1]).
484
480
#define CD_APPLET_SET_SURFACE_ON_MY_ICON_WITH_ALPHA(pSurface, fAlpha) do { \
485
481
cairo_dock_set_icon_surface_full (myDrawContext, pSurface, 1., fAlpha, myIcon, myContainer); \
486
482
cairo_dock_add_reflection_to_icon (myDrawContext, myIcon, myContainer); \
487
483
cairo_dock_redraw_icon (myIcon, myContainer); } while (0)
489
*Applique une surface existante sur le contexte of dessin of l'applet et ajoute une barre a sa base, et la rafraichit.
490
*@param pSurface la surface cairo a dessiner.
491
*@param fValue la valeur en fraction of la valeur max (donc dans [0 , 1]).
485
/** Apply a surface on the applet's icon with add a bar at the bottom, and redraw it. The bar is drawn at the bottom of the icon with a gradation from red to green and a given length.
486
*@param pSurface the surface to draw on your icon.
487
*@param fValue the value representing a percentage, in [-1,1]. If negative, the gradation is inverted, and the absolute value is used.
493
489
#define CD_APPLET_SET_SURFACE_ON_MY_ICON_WITH_BAR(pSurface, fValue) do { \
494
490
cairo_dock_set_icon_surface_with_bar (myDrawContext, pSurface, fValue, myIcon, myContainer); \
495
491
cairo_dock_add_reflection_to_icon (myDrawContext, myIcon, myContainer); \
496
492
cairo_dock_redraw_icon (myIcon, myContainer); } while (0)
499
*Applique une image definie par son chemin sur le contexte of dessin of l'applet, mais ne la rafraichit pas. L'image est redimensionnee aux dimensions of the icon.
500
*@param cImagePath chemin du fichier of l'image.
494
/** Apply an image on the applet's icon. The image is resized at the same size as the icon. Does not trigger the icon refresh.
495
*@param cImagePath path to an image.
502
#define CD_APPLET_SET_IMAGE_ON_MY_ICON(cImagePath) do { \
503
if (cImagePath != myIcon->acFileName) \
505
g_free (myIcon->acFileName); \
506
myIcon->acFileName = g_strdup (cImagePath); \
508
cairo_dock_set_image_on_icon (myDrawContext, cImagePath, myIcon, myContainer); } while (0)
497
#define CD_APPLET_SET_IMAGE_ON_MY_ICON(cImagePath) \
498
cairo_dock_set_image_on_icon (myDrawContext, cImagePath, myIcon, myContainer)
511
*Idem que precedemment mais l'image est definie par son nom localement au repertoire d'installation of l'applet
512
*@param cImageName nom du fichier of l'image
500
/** Apply an image, taken inside the installation folder of the applet, on the applet's icon. The image is resized at the same size as the icon. Does not trigger the icon refresh.
501
*@param cImageName name of an image
514
503
#define CD_APPLET_SET_LOCAL_IMAGE_ON_MY_ICON(cImageName) do { \
515
504
gchar *_cImageFilePath = g_strconcat (MY_APPLET_SHARE_DATA_DIR, "/", cImageName, NULL); \
516
505
CD_APPLET_SET_IMAGE_ON_MY_ICON (_cImageFilePath); \
517
506
g_free (_cImageFilePath); } while (0)
520
*Idem que precedemment mais l'image est definie soit relativement au repertoire utilisateur, soit relativement au repertoire d'installation of l'applet si la 1ere est NULL.
508
/** Apply an image on the applet's icon at the same size as the applet's icon, or a default image taken in the installed folder of the applet if the first one is NULL. If the user image is given by its sole name, it is searched inside the current theme root folder.
521
509
*@param cUserImageName nom du fichier of l'image cote utilisateur.
522
510
*@param cDefaultLocalImageName image locale par defaut cote installation.
530
518
CD_APPLET_SET_IMAGE_ON_MY_ICON (cImagePath); \
531
519
g_free (cImagePath); } while (0)
521
/** Apply the default icon on the applet's icon if there is no image yet.
533
523
#define CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE do { \
534
if (myIcon->acFileName == NULL) { \
535
CD_APPLET_SET_LOCAL_IMAGE_ON_MY_ICON (MY_APPLET_ICON_FILE); } } while (0)
538
*Applique une surface existante sur le contexte of dessin of l'applet, et la redessine. La surface est redimensionnee aux dimensions of the icon.
542
#define CD_APPLET_SET_ZOOMED_SURFACE_ON_MY_ICON(pSurface, fScale) do { \
543
cairo_dock_set_icon_surface_with_zoom (myDrawContext, pSurface, fScale, myIcon, myContainer); \
544
cairo_dock_redraw_icon (myIcon, myContainer); } while (0)
551
*Remplace l'etiquette of the icon of l'applet par une nouvelle.
552
*@param cIconName la nouvelle etiquette.
524
if (myIcon->cFileName == NULL) { \
525
CD_APPLET_SET_IMAGE_ON_MY_ICON (MY_APPLET_SHARE_DATA_DIR"/"MY_APPLET_ICON_FILE); } } while (0)
531
/** Set a new label on the applet's icon.
532
*@param cIconName the label.
554
534
#define CD_APPLET_SET_NAME_FOR_MY_ICON(cIconName) \
555
535
cairo_dock_set_icon_name (myDrawContext, cIconName, myIcon, myContainer)
557
*Remplace l'etiquette of the icon of l'applet par une nouvelle.
558
*@param cIconNameFormat la nouvelle etiquette au format 'printf'.
536
/** Set a new label on the applet's icon.
537
*@param cIconNameFormat the label, in a 'printf'-like format.
538
*@param ... values to be written in the string.
560
540
#define CD_APPLET_SET_NAME_FOR_MY_ICON_PRINTF(cIconNameFormat, ...) \
561
541
cairo_dock_set_icon_name_full (myDrawContext, myIcon, myContainer, cIconNameFormat, ##__VA_ARGS__)
568
*Ecris une info-rapide sur the icon of l'applet.
569
*@param cQuickInfo l'info-rapide. Ce doit etre une chaine of caracteres particulièrement petite, representant une info concise, puisque ecrite directement sur the icon.
547
/** Set a quick-info on the applet's icon.
548
*@param cQuickInfo the quick-info. This is a small text (a few characters) that is superimposed on the icon.
571
550
#define CD_APPLET_SET_QUICK_INFO_ON_MY_ICON(cQuickInfo) \
572
551
cairo_dock_set_quick_info (myDrawContext, cQuickInfo, myIcon, myDock ? (1 + myIcons.fAmplitude) / 1 : 1)
574
*Ecris une info-rapide sur the icon of l'applet.
575
*@param cQuickInfoFormat l'info-rapide, au format 'printf'. Ce doit etre une chaine of caracteres particulièrement petite, representant une info concise, puisque ecrite directement sur the icon.
552
/** Set a quick-info on the applet's icon.
553
*@param cQuickInfoFormat the label, in a 'printf'-like format.
554
*@param ... values to be written in the string.
577
556
#define CD_APPLET_SET_QUICK_INFO_ON_MY_ICON_PRINTF(cQuickInfoFormat, ...) \
578
557
cairo_dock_set_quick_info_full (myDrawContext, myIcon, myContainer, cQuickInfoFormat, ##__VA_ARGS__)
629
615
#define CD_APPLET_FINISH_DRAWING_MY_ICON cairo_dock_end_draw_icon (myIcon, myContainer)
631
618
/** Add a Data Renderer the applet's icon.
619
*@param pAttr the attributes of the Data Renderer. They allow you to define its properties.
633
621
#define CD_APPLET_ADD_DATA_RENDERER_ON_MY_ICON(pAttr) cairo_dock_add_new_data_renderer_on_icon (myIcon, myContainer, myDrawContext, pAttr)
634
623
/** Reload the Data Renderer of the applet's icon. Pass NULL as the attributes to simply reload the current data renderer without changing any of its parameters. Previous values are kept.
624
*@param pAttr the attributes of the Data Renderer, or NULL to simply reload the Data Renderer as it it.
636
626
#define CD_APPLET_RELOAD_MY_DATA_RENDERER(pAttr) cairo_dock_reload_data_renderer_on_icon (myIcon, myContainer, myDrawContext, pAttr)
637
/** Add new values to the Data Renderer of the applet's icon. Values are a table of 'double', having the same size as defined when the data renderer was created (1 by default).
628
/** Add new values to the Data Renderer of the applet's icon. Values are a table of 'double', having the same size as defined when the data renderer was created (1 by default). It also triggers the redraw of the icon.
629
*@param pValues the values, a table of double of the correct size.
639
631
#define CD_APPLET_RENDER_NEW_DATA_ON_MY_ICON(pValues) cairo_dock_render_new_data_on_icon (myIcon, myContainer, myDrawContext, pValues)
640
633
/** Completely remove the Data Renderer of the applet's icon, including the values associated with.
642
635
#define CD_APPLET_REMOVE_MY_DATA_RENDERER cairo_dock_remove_data_renderer_on_icon (myIcon)
644
///__________________ deprecated ___________________
645
#define CD_APPLET_RENDER_GAUGE(pGauge, fValue) cairo_dock_render_gauge (myDrawContext, myContainer, myIcon, pGauge, fValue)
646
#define CD_APPLET_RENDER_GAUGE_MULTI_VALUE(pGauge, pValueList) cairo_dock_render_gauge_multi_value (myDrawContext, myContainer, myIcon, pGauge, pValueList)
647
#define CD_APPLET_RENDER_GRAPH(pGraph) cairo_dock_render_graph (myDrawContext, myContainer, myIcon, pGraph);
648
#define CD_APPLET_RENDER_GRAPH_NEW_VALUE(pGraph, fValue) do { \
649
cairo_dock_update_graph (pGraph, fValue); \
650
CD_APPLET_RENDER_GRAPH (pGraph); } while (0)
651
#define CD_APPLET_RENDER_GRAPH_NEW_VALUES(pGraph, fValue, fValue2) do { \
652
cairo_dock_update_double_graph (pGraph, fValue, fValue2); \
653
CD_APPLET_RENDER_GRAPH (pGraph); } while (0)
654
///__________________ end of deprecated ____________
638
/** Set the history size of the Data Renderer of the applet's icon to the maximum size, that is to say 1 value per pixel.
640
#define CD_APPLET_SET_MY_DATA_RENDERER_HISTORY_TO_MAX cairo_dock_resize_data_renderer_history (myIcon, myIcon->fWidth)
656
643
#define CD_APPLET_GET_MY_ICON_DATA(pIcon) cairo_dock_get_icon_data (pIcon, myApplet)
657
644
#define CD_APPLET_GET_MY_CONTAINER_DATA(pContainer) cairo_dock_get_container_data (pContainer, myApplet)
700
701
#define CD_APPLET_SET_STATIC_DESKLET cairo_dock_set_static_desklet (myDesklet)
702
703
#define CD_APPLET_CREATE_MY_SUBDOCK(pIconsList, cRenderer) do { \
703
if (myIcon->acName == NULL) { \
704
if (myIcon->cName == NULL) { \
704
705
CD_APPLET_SET_NAME_FOR_MY_ICON (myApplet->pModule->pVisitCard->cModuleName); } \
705
706
if (cairo_dock_check_unique_subdock_name (myIcon)) { \
706
CD_APPLET_SET_NAME_FOR_MY_ICON (myIcon->acName); } \
707
myIcon->pSubDock = cairo_dock_create_subdock_from_scratch (pIconsList, myIcon->acName, myDock); \
707
CD_APPLET_SET_NAME_FOR_MY_ICON (myIcon->cName); } \
708
myIcon->pSubDock = cairo_dock_create_subdock_from_scratch (pIconsList, myIcon->cName, myDock); \
708
709
cairo_dock_set_renderer (myIcon->pSubDock, cRenderer); \
709
710
cairo_dock_update_dock_size (myIcon->pSubDock); } while (0)
711
712
#define CD_APPLET_DESTROY_MY_SUBDOCK do { \
712
cairo_dock_destroy_dock (myIcon->pSubDock, myIcon->acName, NULL, NULL); \
713
cairo_dock_destroy_dock (myIcon->pSubDock, myIcon->cName, NULL, NULL); \
713
714
myIcon->pSubDock = NULL; } while (0)
715
716
#define CD_APPLET_LOAD_ICONS_IN_MY_SUBDOCK(pIconsList) do { \
716
if (myIcon->acName == NULL) { \
717
if (myIcon->cName == NULL) { \
717
718
CD_APPLET_SET_NAME_FOR_MY_ICON (myIcon->pModuleInstance->pModule->pVisitCard->cModuleName); }\