36
36
#include "cairo-dock-callbacks.h"
37
37
#include "cairo-dock-dock-manager.h"
38
38
#include "cairo-dock-draw-opengl.h"
39
#include "cairo-dock-internal-system.h"
40
#include "cairo-dock-internal-labels.h"
41
#include "cairo-dock-internal-icons.h"
42
39
#include "cairo-dock-icons.h"
43
40
#include "cairo-dock-container.h"
44
41
#include "cairo-dock-gui-manager.h"
47
44
extern gchar *g_cCurrentThemePath;
48
45
extern gchar *g_cCairoDockDataDir;
49
46
extern gchar *g_cConfFile;
50
extern cairo_surface_t *g_pIconBackgroundImageSurface;
51
extern double g_iIconBackgroundImageWidth, g_iIconBackgroundImageHeight;
47
extern CairoDockImageBuffer g_pIconBackgroundBuffer;
48
///extern cairo_surface_t *g_pIconBackgroundImageSurface;
49
///extern double g_iIconBackgroundImageWidth, g_iIconBackgroundImageHeight;
53
51
extern gboolean g_bUseOpenGL;
60
58
//\________________ On efface l'ancienne image.
61
59
cairo_dock_erase_cairo_context (pIconContext);
63
//\_____________ On met le background de l'icone si necessaire
61
//\________________ On met le background de l'icone si necessaire
64
62
if (pIcon != NULL &&
65
63
pIcon->pIconBuffer != NULL &&
66
g_pIconBackgroundImageSurface != NULL &&
64
g_pIconBackgroundBuffer.pSurface != NULL &&
67
65
(! CAIRO_DOCK_IS_SEPARATOR (pIcon)/* && (myIcons.bBgForApplets || ! CAIRO_DOCK_IS_APPLET(pIcon))*/))
69
67
cd_message (">>> %s prendra un fond d'icone", pIcon->cName);
71
69
cairo_save (pIconContext);
72
70
cairo_scale(pIconContext,
73
pIcon->fWidth / g_iIconBackgroundImageWidth,
74
pIcon->fHeight / g_iIconBackgroundImageHeight);
71
pIcon->fWidth / (g_pIconBackgroundBuffer.iWidth / fScale),
72
pIcon->fHeight / (g_pIconBackgroundBuffer.iHeight / fScale));
75
73
cairo_set_source_surface (pIconContext,
76
g_pIconBackgroundImageSurface,
74
g_pIconBackgroundBuffer.pSurface,
79
77
cairo_set_operator (pIconContext, CAIRO_OPERATOR_DEST_OVER);
217
215
int minutes = iTimeInSeconds / 60;
218
216
int secondes = iTimeInSeconds % 60;
217
cd_debug ("%s (%d:%d)\n", __func__, minutes, secondes);
219
218
if (minutes != 0)
220
219
cairo_dock_set_quick_info_full (pSourceContext, pIcon, pContainer, "%d:%02d", minutes, abs (secondes));
254
253
void cairo_dock_set_size_as_quick_info (cairo_t *pSourceContext, Icon *pIcon, CairoContainer *pContainer, long long int iSizeInBytes)
256
255
gchar *cSize = cairo_dock_get_human_readable_size (iSizeInBytes);
257
double fMaxScale = cairo_dock_get_max_scale (pContainer);
258
cairo_dock_set_quick_info (pSourceContext, cSize, pIcon, fMaxScale);
256
cairo_dock_set_quick_info (pSourceContext, pIcon, pContainer, cSize);
264
gchar *cairo_dock_get_theme_path_for_module (GKeyFile *pKeyFile, gchar *cGroupName, gchar *cKeyName, gboolean *bFlushConfFileNeeded, gchar *cDefaultThemeName, const gchar *cShareThemesDir, const gchar *cExtraDirName)
262
gchar *cairo_dock_get_theme_path_for_module (const gchar *cAppletConfFilePath, GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *cKeyName, gboolean *bFlushConfFileNeeded, const gchar *cDefaultThemeName, const gchar *cShareThemesDir, const gchar *cExtraDirName)
266
264
gchar *cThemeName = cairo_dock_get_string_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, cDefaultThemeName, NULL, NULL);
268
266
gchar *cUserThemesDir = (cExtraDirName != NULL ? g_strdup_printf ("%s/%s/%s", g_cCairoDockDataDir, CAIRO_DOCK_EXTRAS_DIR, cExtraDirName) : NULL);
269
gchar *cThemePath = cairo_dock_get_theme_path (cThemeName, cShareThemesDir, cUserThemesDir, cExtraDirName);
267
CairoDockThemeType iType = cairo_dock_extract_theme_type_from_name (cThemeName);
268
gchar *cThemePath = cairo_dock_get_theme_path (cThemeName, cShareThemesDir, cUserThemesDir, cExtraDirName, iType);
270
if (iType != CAIRO_DOCK_ANY_THEME)
272
g_key_file_set_string (pKeyFile, cGroupName, cKeyName, cThemeName);
273
cairo_dock_write_keys_to_file (pKeyFile, cAppletConfFilePath);
271
275
g_free (cThemeName);
272
276
g_free (cUserThemesDir);
273
277
return cThemePath;
286
290
pMenuItem = gtk_image_menu_item_new_with_label (cLabel);
287
291
if (*cImage == '/')
289
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size (cImage, 32, 32, NULL);
293
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size (cImage, 24, 24, NULL);
290
294
image = gtk_image_new_from_pixbuf (pixbuf);
291
295
g_object_unref (pixbuf);
419
423
if (iClickedButton == 0 || iClickedButton == -1) // bouton OK ou touche Entree.
421
cairo_dock_build_main_ihm (g_cConfFile, FALSE);
422
cairo_dock_present_module_instance_gui (pModuleInstance);
425
/**cairo_dock_build_main_ihm (g_cConfFile, FALSE);
426
cairo_dock_present_module_instance_gui (pModuleInstance);*/
427
cairo_dock_show_module_instance_gui (pModuleInstance, -1);