~helene-verhaeghe27/cairo-dock-core/bugfix

« back to all changes in this revision

Viewing changes to src/gldit/cairo-dock-icon-factory.c

  • Committer: Fabrice Rey
  • Date: 2013-06-04 22:58:28 UTC
  • Revision ID: fabounet03@gmail.com-20130604225828-x8lg3mv9135jr114
updated various parts of the core to the new API (new icons type, 'delete' method, simplified functions, etc)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "cairo-dock-surface-factory.h"
30
30
#include "cairo-dock-module-instance-manager.h"  // GldiModuleInstance
31
31
#include "cairo-dock-log.h"
 
32
#include "cairo-dock-utils.h"  // cairo_dock_cut_string
32
33
#include "cairo-dock-applications-manager.h"  // myTaskbarParam.iAppliMaxNameLength
 
34
#include "cairo-dock-separator-manager.h"  // GLDI_OBJECT_IS_SEPARATOR_ICON
33
35
#include "cairo-dock-dock-facility.h"  // cairo_dock_update_dock_size
34
36
#include "cairo-dock-dock-manager.h"  // cairo_dock_synchronize_one_sub_dock_orientation
35
37
#include "cairo-dock-backends-manager.h"  // cairo_dock_get_icon_container_renderer
39
41
#include "cairo-dock-icon-factory.h"
40
42
 
41
43
extern CairoDockImageBuffer g_pIconBackgroundBuffer;
42
 
 
43
 
extern gboolean g_bUseOpenGL;
 
44
//extern gboolean g_bUseOpenGL;
44
45
 
45
46
const gchar *s_cRendererNames[4] = {NULL, "Emblem", "Stack", "Box"};  // c'est juste pour realiser la transition entre le chiffre en conf, et un nom (limitation du panneau de conf). On garde le numero pour savoir rapidement sur laquelle on set.
46
47
 
47
48
 
48
 
inline Icon *cairo_dock_new_icon (void)
 
49
Icon *gldi_icon_new (void)
49
50
{
50
51
        Icon *_icon = (Icon*)gldi_object_new (GLDI_MANAGER (&myIconsMgr), NULL);
51
52
        return _icon;
52
53
}
53
54
 
 
55
Icon * cairo_dock_create_dummy_launcher (gchar *cName, gchar *cFileName, gchar *cCommand, gchar *cQuickInfo, double fOrder)
 
56
{
 
57
        //\____________ On cree l'icone.
 
58
        Icon *pIcon = gldi_icon_new ();
 
59
        pIcon->iGroup = CAIRO_DOCK_LAUNCHER;
 
60
        pIcon->cName = cName;
 
61
        pIcon->cFileName = cFileName;
 
62
        pIcon->cQuickInfo = cQuickInfo;
 
63
        pIcon->fOrder = fOrder;
 
64
        pIcon->fScale = 1.;
 
65
        pIcon->fAlpha = 1.;
 
66
        pIcon->fWidthFactor = 1.;
 
67
        pIcon->fHeightFactor = 1.;
 
68
        pIcon->cCommand = cCommand;
 
69
        
 
70
        return pIcon;
 
71
}
 
72
 
54
73
 
55
74
  //////////////
56
75
 /// LOADER ///
123
142
        
124
143
        //\_____________ set the background if needed.
125
144
        icon->bNeedApplyBackground = FALSE;
126
 
        if (g_pIconBackgroundBuffer.pSurface != NULL && ! CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (icon))
 
145
        if (g_pIconBackgroundBuffer.pSurface != NULL && ! GLDI_OBJECT_IS_SEPARATOR_ICON (icon))
127
146
        {
128
147
                if (icon->image.iTexture != 0 && g_pIconBackgroundBuffer.iTexture != 0)
129
148
                {
246
265
                
247
266
                cairo_dock_load_icon_quickinfo (pIcon);
248
267
                
249
 
                cairo_dock_redraw_icon (pIcon, pContainer);
 
268
                cairo_dock_redraw_icon (pIcon);
250
269
                //g_print ("icon-factory: do 1 main loop iteration\n");
251
270
                //gtk_main_iteration_do (FALSE);  /// "unforseen consequences" : if _redraw_subdock_content_idle is planned just after, the container-icon stays blank in opengl only. couldn't figure why exactly :-/
252
271
        }