~ubuntu-branches/ubuntu/oneiric/cairo-dock/oneiric

« back to all changes in this revision

Viewing changes to src/gldit/cairo-dock-icon-loader.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-09 23:26:12 UTC
  • mto: (18.1.1 cairo-dock) (19.1.1 cairo-dock)
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: james.westby@ubuntu.com-20100809232612-pocdxliaxjdetm37
Tags: upstream-2.2.0~0beta4
ImportĀ upstreamĀ versionĀ 2.2.0~0beta4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation; either version 3
 
10
* of the License, or (at your option) any later version.
 
11
*
 
12
* This program is distributed in the hope that it will be useful,
 
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
* GNU General Public License for more details.
 
16
* You should have received a copy of the GNU General Public License
 
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __CAIRO_DOCK_ICON_LOADER__
 
22
#define  __CAIRO_DOCK_ICON_LOADER__
 
23
 
 
24
#include <glib.h>
 
25
 
 
26
#include "cairo-dock-struct.h"
 
27
#include "cairo-dock-surface-factory.h"
 
28
G_BEGIN_DECLS
 
29
 
 
30
/**
 
31
*@file cairo-dock-icon-loader.h This class loads the icons and manages the associated ressources.
 
32
*/
 
33
 
 
34
 
 
35
/** Search the path of an icon into the defined icons themes. It also handles the '~' caracter in paths.
 
36
 * @param cFileName name of the icon file.
 
37
 * @return the complete path of the icon, or NULL if not found.
 
38
 */
 
39
gchar *cairo_dock_search_icon_s_path (const gchar *cFileName);
 
40
 
 
41
/* Cree la surface de reflection d'une icone (pour cairo).
 
42
*@param pIcon l'icone.
 
43
*@param pContainer le container de l'icone.
 
44
*/
 
45
void cairo_dock_add_reflection_to_icon (Icon *pIcon, CairoContainer *pContainer);
 
46
 
 
47
void cairo_dock_set_icon_size (CairoContainer *pContainer, Icon *icon);
 
48
 
 
49
/**Fill the image buffer (surface & texture) of a given icon, according to its type. Set its size if necessary, and fills the reflection buffer for cairo.
 
50
*@param icon the icon.
 
51
*@param pContainer its container.
 
52
*/
 
53
void cairo_dock_load_icon_image (Icon *icon, CairoContainer *pContainer);
 
54
 
 
55
/**Cut an UTF-8 or ASCII string to n characters, and add '...' to the end in cas it was effectively cut. If n is negative, it will remove the last |n| characters. It manages correctly UTF-8 strings.
 
56
*@param cString the string.
 
57
*@param iNbCaracters the maximum number of characters wished, or the number of characters to remove if negative.
 
58
*@return the newly allocated string.
 
59
*/
 
60
gchar *cairo_dock_cut_string (const gchar *cString, int iNbCaracters);
 
61
 
 
62
/**Fill the label buffer (surface & texture) of a given icon, according to a text description.
 
63
*@param icon the icon.
 
64
*@param pTextDescription desctiption of the text rendering.
 
65
*/
 
66
void cairo_dock_load_icon_text (Icon *icon, CairoDockLabelDescription *pTextDescription);
 
67
 
 
68
/**Fill the quick-info buffer (surface & texture) of a given icon, according to a text description.
 
69
*@param icon the icon.
 
70
*@param pTextDescription desctiption of the text rendering.
 
71
*@param fMaxScale maximum zoom.
 
72
*/
 
73
void cairo_dock_load_icon_quickinfo (Icon *icon, CairoDockLabelDescription *pTextDescription, double fMaxScale);
 
74
 
 
75
/** Fill all the buffers (surfaces & textures) of a given icon, according to its type. Set its size accordingly, and fills the reflection buffer for cairo. Label and quick-info are loaded with the current global text description.
 
76
*@param pIcon the icon.
 
77
*@param pContainer its container.
 
78
*/
 
79
void cairo_dock_load_icon_buffers (Icon *pIcon, CairoContainer *pContainer);
 
80
 
 
81
void cairo_dock_trigger_load_icon_buffers (Icon *pIcon, CairoContainer *pContainer);
 
82
 
 
83
void cairo_dock_reload_buffers_in_dock (gchar *cDockName, CairoDock *pDock, gpointer data);
 
84
#define cairo_dock_load_buffers_in_one_dock(pDock) cairo_dock_reload_buffers_in_dock (NULL, pDock, GINT_TO_POINTER (TRUE))
 
85
 
 
86
void cairo_dock_reload_icon_image (Icon *icon, CairoContainer *pContainer);
 
87
 
 
88
 
 
89
 
 
90
void cairo_dock_load_icons_background_surface (const gchar *cImagePath, double fMaxScale);
 
91
 
 
92
/**void cairo_dock_load_task_indicator (const gchar *cIndicatorImagePath, double fMaxScale, double fIndicatorRatio);
 
93
 
 
94
void cairo_dock_load_active_window_indicator (const gchar *cImagePath, double fMaxScale, double fCornerRadius, double fLineWidth, double *fActiveColor);
 
95
 
 
96
void cairo_dock_load_class_indicator (const gchar *cIndicatorImagePath, double fMaxScale);*/
 
97
 
 
98
 
 
99
void cairo_dock_init_icon_manager (void);
 
100
 
 
101
void cairo_dock_load_icon_textures (void);
 
102
 
 
103
void cairo_dock_unload_icon_textures (void);
 
104
 
 
105
 
 
106
void cairo_dock_draw_subdock_content_on_icon (Icon *pIcon, CairoDock *pDock);
 
107
 
 
108
 
 
109
 
 
110
typedef void (*CairoIconContainerLoadFunc) (void);
 
111
typedef void (*CairoIconContainerUnloadFunc) (void);
 
112
typedef void (*CairoIconContainerRenderFunc) (Icon *pIcon, CairoContainer *pContainer, int w, int h, cairo_t *pCairoContext);
 
113
typedef void (*CairoIconContainerRenderOpenGLFunc) (Icon *pIcon, CairoContainer *pContainer, int w, int h);
 
114
 
 
115
struct _CairoIconContainerRenderer {
 
116
        CairoIconContainerLoadFunc load;
 
117
        CairoIconContainerUnloadFunc unload;
 
118
        CairoIconContainerRenderFunc render;
 
119
        CairoIconContainerRenderOpenGLFunc render_opengl;
 
120
};
 
121
 
 
122
 
 
123
G_END_DECLS
 
124
#endif