~cairo-dock-team/ubuntu/natty/cairo-dock/2.3.0-2.1

« back to all changes in this revision

Viewing changes to src/cairo-dock-applet-facility.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe), Matthieu Baerts (matttbe), Didier Roche
  • Date: 2010-03-01 21:24:00 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100301212400-3a3csog6eonse3in
Tags: 2.1.3-6-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New Upstream Version. (LP: #521534)
* Updated debian/watch and debian/copyright with LP account.
* Removed debian/patches/02-merge-changelog.patch'
 - data/ChangeLog.txt has to respect a syntax and is used by CD.
* debian/cairo-dock.1:
 - Updated with the latest release.
 - The domain name 'cairo-dock.org' has changed to 'glx-dock.org'
* debian/control:
 - Changed the homepage and other links (glx-dock.org)
 - Updated cairo-dock-dev architecture to 'all' (it no longer contains compiled files)
* debian/cairo-dock-dev.install
 - libcairo-dock.a and libcairo-dock.so no longer exist
* debian/rules
 - removed uneeded changelog file
* Updated debian/patches/01-desktop-file-category.patch

[ Didier Roche ]
* Fix debian/watch
* Fix some issue in versionning
* debian/control: clean the packaging and add right -plugins depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
52
50
 
53
51
extern gboolean g_bUseOpenGL;
54
52
 
60
58
        //\________________ On efface l'ancienne image.
61
59
        cairo_dock_erase_cairo_context (pIconContext);
62
60
        
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))*/))
68
66
        {
69
67
                cd_message (">>> %s prendra un fond d'icone", pIcon->cName);
70
68
 
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,
77
75
                        0.,
78
76
                        0.);
79
77
                cairo_set_operator (pIconContext, CAIRO_OPERATOR_DEST_OVER);
216
214
{
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));
221
220
        else
254
253
void cairo_dock_set_size_as_quick_info (cairo_t *pSourceContext, Icon *pIcon, CairoContainer *pContainer, long long int iSizeInBytes)
255
254
{
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);
259
257
        g_free (cSize);
260
258
}
261
259
 
262
260
 
263
261
 
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)
265
263
{
266
264
        gchar *cThemeName = cairo_dock_get_string_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, cDefaultThemeName, NULL, NULL);
267
265
        
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
269
        
 
270
        if (iType != CAIRO_DOCK_ANY_THEME)
 
271
        {
 
272
                g_key_file_set_string (pKeyFile, cGroupName, cKeyName, cThemeName);
 
273
                cairo_dock_write_keys_to_file (pKeyFile, cAppletConfFilePath);
 
274
        }
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 == '/')
288
292
                {
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);
292
296
                }
418
422
{
419
423
        if (iClickedButton == 0 || iClickedButton == -1)  // bouton OK ou touche Entree.
420
424
        {
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);
423
428
        }
424
429
}