Merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock/2.3.0-3 into lp:ubuntu/oneiric/cairo-dock
- Oneiric (11.10)
- 2.3.0-3
- Merge into oneiric
Proposed by
Matthieu Baerts
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 19 | ||||||||
Proposed branch: | lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock/2.3.0-3 | ||||||||
Merge into: | lp:ubuntu/oneiric/cairo-dock | ||||||||
Diff against target: |
1509 lines (+68/-1323) 9 files modified
.pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch/src/gldit/cairo-dock-dock-facility.c (+0/-1243) .pc/applied-patches (+0/-1) CMakeLists.txt (+1/-1) debian/changelog (+13/-0) debian/patches/01-default_theme_with_default_apps (+50/-50) debian/patches/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch (+0/-25) debian/patches/series (+0/-1) src/gldit/cairo-dock-class-manager.c (+3/-1) src/gldit/cairo-dock-dock-manager.c (+1/-1) |
||||||||
To merge this branch: | bzr merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock/2.3.0-3 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Sponsors | Pending | ||
Review via email: mp+65211@code.launchpad.net |
Commit message
Description of the change
This is a bugs fixed version:
How to reproduce the bugs:
* Cairo-Dock (without the OpenGL backend, version 2.3.0~1) crashes if we group windows with the same class in a subdock and then we click on the subdock to maximise windows.
* Slowly leave the dock (version 2.3.0~1) with the cursor on the edge of it and the dock will stay zoomed and active.
* Cairo-Dock (version 2.3.0~1 and 2.3.0~2.1) crashes when the musicPlayer applet is in desklet mode and applets are separated from launchers and the music-player is launched at the same time.
Thank you
PS: please don't forget to update our plug-ins too. (LP: #799774)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed directory '.pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch' | |||
2 | === removed directory '.pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch/src' | |||
3 | === removed directory '.pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch/src/gldit' | |||
4 | === removed file '.pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch/src/gldit/cairo-dock-dock-facility.c' | |||
5 | --- .pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch/src/gldit/cairo-dock-dock-facility.c 2011-05-21 21:03:26 +0000 | |||
6 | +++ .pc/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch/src/gldit/cairo-dock-dock-facility.c 1970-01-01 00:00:00 +0000 | |||
7 | @@ -1,1243 +0,0 @@ | |||
8 | 1 | /** | ||
9 | 2 | * This file is a part of the Cairo-Dock project | ||
10 | 3 | * | ||
11 | 4 | * Copyright : (C) see the 'copyright' file. | ||
12 | 5 | * E-mail : see the 'copyright' file. | ||
13 | 6 | * | ||
14 | 7 | * This program is free software; you can redistribute it and/or | ||
15 | 8 | * modify it under the terms of the GNU General Public License | ||
16 | 9 | * as published by the Free Software Foundation; either version 3 | ||
17 | 10 | * of the License, or (at your option) any later version. | ||
18 | 11 | * | ||
19 | 12 | * This program is distributed in the hope that it will be useful, | ||
20 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | 15 | * GNU General Public License for more details. | ||
23 | 16 | * You should have received a copy of the GNU General Public License | ||
24 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | 18 | */ | ||
26 | 19 | |||
27 | 20 | #include <math.h> | ||
28 | 21 | #include <string.h> | ||
29 | 22 | #include <stdio.h> | ||
30 | 23 | #include <stdlib.h> | ||
31 | 24 | |||
32 | 25 | #include <glib/gstdio.h> | ||
33 | 26 | #include <gtk/gtk.h> | ||
34 | 27 | #include <gdk/gdkx.h> | ||
35 | 28 | |||
36 | 29 | #include <cairo.h> | ||
37 | 30 | #include <pango/pango.h> | ||
38 | 31 | #include <librsvg/rsvg.h> | ||
39 | 32 | #include <librsvg/rsvg-cairo.h> | ||
40 | 33 | |||
41 | 34 | #ifdef HAVE_GLITZ | ||
42 | 35 | #include <glitz-glx.h> | ||
43 | 36 | #include <cairo-glitz.h> | ||
44 | 37 | #endif | ||
45 | 38 | |||
46 | 39 | #include <gtk/gtkgl.h> | ||
47 | 40 | #include <X11/extensions/Xrender.h> | ||
48 | 41 | #include <X11/extensions/shape.h> | ||
49 | 42 | #include <GL/gl.h> | ||
50 | 43 | #include <GL/glu.h> | ||
51 | 44 | #include <GL/glx.h> | ||
52 | 45 | #include <gdk/x11/gdkglx.h> | ||
53 | 46 | |||
54 | 47 | #include "cairo-dock-draw.h" | ||
55 | 48 | #include "cairo-dock-applications-manager.h" | ||
56 | 49 | #include "cairo-dock-image-buffer.h" | ||
57 | 50 | #include "cairo-dock-config.h" | ||
58 | 51 | #include "cairo-dock-module-factory.h" | ||
59 | 52 | #include "cairo-dock-callbacks.h" | ||
60 | 53 | #include "cairo-dock-icon-factory.h" | ||
61 | 54 | #include "cairo-dock-icon-facility.h" | ||
62 | 55 | #include "cairo-dock-separator-factory.h" | ||
63 | 56 | #include "cairo-dock-launcher-factory.h" | ||
64 | 57 | #include "cairo-dock-backends-manager.h" // myBackendsParam.fSubDockSizeRatio | ||
65 | 58 | #include "cairo-dock-X-utilities.h" | ||
66 | 59 | #include "cairo-dock-log.h" | ||
67 | 60 | #include "cairo-dock-keyfile-utilities.h" | ||
68 | 61 | #include "cairo-dock-dock-manager.h" | ||
69 | 62 | #include "cairo-dock-dialog-manager.h" | ||
70 | 63 | #include "cairo-dock-notifications.h" | ||
71 | 64 | #include "cairo-dock-indicator-manager.h" // myIndicators.bUseClassIndic | ||
72 | 65 | #include "cairo-dock-class-manager.h" | ||
73 | 66 | #include "cairo-dock-animations.h" | ||
74 | 67 | #include "cairo-dock-emblem.h" | ||
75 | 68 | #include "cairo-dock-X-manager.h" | ||
76 | 69 | #include "cairo-dock-dock-facility.h" | ||
77 | 70 | |||
78 | 71 | extern CairoDockDesktopGeometry g_desktopGeometry; | ||
79 | 72 | |||
80 | 73 | void cairo_dock_reload_reflects_in_dock (CairoDock *pDock) | ||
81 | 74 | { | ||
82 | 75 | cairo_t *pCairoContext = cairo_dock_create_drawing_context_generic (CAIRO_CONTAINER (pDock)); | ||
83 | 76 | Icon *icon; | ||
84 | 77 | GList *ic; | ||
85 | 78 | for (ic = pDock->icons; ic != NULL; ic = ic->next) | ||
86 | 79 | { | ||
87 | 80 | icon = ic->data; | ||
88 | 81 | if (icon->pReflectionBuffer != NULL) | ||
89 | 82 | { | ||
90 | 83 | cairo_dock_add_reflection_to_icon (icon, CAIRO_CONTAINER (pDock)); | ||
91 | 84 | } | ||
92 | 85 | } | ||
93 | 86 | cairo_destroy (pCairoContext); | ||
94 | 87 | } | ||
95 | 88 | |||
96 | 89 | |||
97 | 90 | void cairo_dock_update_dock_size (CairoDock *pDock) // iMaxIconHeight et fFlatDockWidth doivent avoir ete mis a jour au prealable. | ||
98 | 91 | { | ||
99 | 92 | //g_print ("%s ()\n", __func__); | ||
100 | 93 | g_return_if_fail (pDock != NULL); | ||
101 | 94 | int iPrevMaxDockHeight = pDock->iMaxDockHeight; | ||
102 | 95 | int iPrevMaxDockWidth = pDock->iMaxDockWidth; | ||
103 | 96 | |||
104 | 97 | if (pDock->container.fRatio != 0/* && pDock->container.fRatio != 1*/) // on remet leur taille reelle aux icones, sinon le calcul de max_dock_size sera biaise. | ||
105 | 98 | { | ||
106 | 99 | GList *ic; | ||
107 | 100 | Icon *icon; | ||
108 | 101 | pDock->fFlatDockWidth = -myIconsParam.iIconGap; | ||
109 | 102 | pDock->iMaxIconHeight = 0; | ||
110 | 103 | for (ic = pDock->icons; ic != NULL; ic = ic->next) | ||
111 | 104 | { | ||
112 | 105 | icon = ic->data; | ||
113 | 106 | icon->fWidth /= pDock->container.fRatio; | ||
114 | 107 | icon->fHeight /= pDock->container.fRatio; | ||
115 | 108 | pDock->fFlatDockWidth += icon->fWidth + myIconsParam.iIconGap; | ||
116 | 109 | if (! CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (icon)) | ||
117 | 110 | pDock->iMaxIconHeight = MAX (pDock->iMaxIconHeight, icon->fHeight); | ||
118 | 111 | } | ||
119 | 112 | if (pDock->iMaxIconHeight == 0) | ||
120 | 113 | pDock->iMaxIconHeight = 10; | ||
121 | 114 | pDock->container.fRatio = 1.; | ||
122 | 115 | } | ||
123 | 116 | pDock->pRenderer->compute_size (pDock); | ||
124 | 117 | |||
125 | 118 | double hmax = pDock->iMaxIconHeight; | ||
126 | 119 | int iMaxAuthorizedWidth = cairo_dock_get_max_authorized_dock_width (pDock); | ||
127 | 120 | int n = 0; | ||
128 | 121 | do | ||
129 | 122 | { | ||
130 | 123 | double fPrevRatio = pDock->container.fRatio; | ||
131 | 124 | //g_print (" %s (%d / %d)\n", __func__, (int)pDock->iMaxDockWidth, iMaxAuthorizedWidth); | ||
132 | 125 | if (pDock->iMaxDockWidth > iMaxAuthorizedWidth) | ||
133 | 126 | { | ||
134 | 127 | pDock->container.fRatio *= 1. * iMaxAuthorizedWidth / pDock->iMaxDockWidth; | ||
135 | 128 | } | ||
136 | 129 | else | ||
137 | 130 | { | ||
138 | 131 | double fMaxRatio = (pDock->iRefCount == 0 ? 1 : myBackendsParam.fSubDockSizeRatio); | ||
139 | 132 | if (pDock->container.fRatio < fMaxRatio) | ||
140 | 133 | { | ||
141 | 134 | pDock->container.fRatio *= 1. * iMaxAuthorizedWidth / pDock->iMaxDockWidth; | ||
142 | 135 | pDock->container.fRatio = MIN (pDock->container.fRatio, fMaxRatio); | ||
143 | 136 | } | ||
144 | 137 | else | ||
145 | 138 | pDock->container.fRatio = fMaxRatio; | ||
146 | 139 | } | ||
147 | 140 | |||
148 | 141 | if (pDock->iMaxDockHeight > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal]) | ||
149 | 142 | { | ||
150 | 143 | pDock->container.fRatio = MIN (pDock->container.fRatio, fPrevRatio * g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] / pDock->iMaxDockHeight); | ||
151 | 144 | } | ||
152 | 145 | |||
153 | 146 | if (fPrevRatio != pDock->container.fRatio) | ||
154 | 147 | { | ||
155 | 148 | //g_print (" -> changement du ratio : %.3f -> %.3f (%d, %d try)\n", fPrevRatio, pDock->container.fRatio, pDock->iRefCount, n); | ||
156 | 149 | Icon *icon; | ||
157 | 150 | GList *ic; | ||
158 | 151 | pDock->fFlatDockWidth = -myIconsParam.iIconGap; | ||
159 | 152 | for (ic = pDock->icons; ic != NULL; ic = ic->next) | ||
160 | 153 | { | ||
161 | 154 | icon = ic->data; | ||
162 | 155 | icon->fWidth *= pDock->container.fRatio / fPrevRatio; | ||
163 | 156 | icon->fHeight *= pDock->container.fRatio / fPrevRatio; | ||
164 | 157 | pDock->fFlatDockWidth += icon->fWidth + myIconsParam.iIconGap; | ||
165 | 158 | } | ||
166 | 159 | hmax *= pDock->container.fRatio / fPrevRatio; | ||
167 | 160 | |||
168 | 161 | pDock->pRenderer->compute_size (pDock); | ||
169 | 162 | } | ||
170 | 163 | |||
171 | 164 | //g_print ("*** ratio : %.3f -> %.3f\n", fPrevRatio, pDock->container.fRatio); | ||
172 | 165 | n ++; | ||
173 | 166 | } while ((pDock->iMaxDockWidth > iMaxAuthorizedWidth || pDock->iMaxDockHeight > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] || (pDock->container.fRatio < 1 && pDock->iMaxDockWidth < iMaxAuthorizedWidth-5)) && n < 8); | ||
174 | 167 | pDock->iMaxIconHeight = hmax; | ||
175 | 168 | //g_print (">>> iMaxIconHeight : %d, ratio : %.2f, fFlatDockWidth : %.2f\n", (int) pDock->iMaxIconHeight, pDock->container.fRatio, pDock->fFlatDockWidth); | ||
176 | 169 | |||
177 | 170 | pDock->pRenderer->calculate_icons (pDock); // le calcul de max_dock_size a altere les fX et fY. | ||
178 | 171 | |||
179 | 172 | pDock->bWMIconsNeedUpdate = TRUE; | ||
180 | 173 | ///cairo_dock_trigger_set_WM_icons_geometry (pDock); | ||
181 | 174 | |||
182 | 175 | cairo_dock_update_input_shape (pDock); | ||
183 | 176 | |||
184 | 177 | if (GTK_WIDGET_VISIBLE (pDock->container.pWidget) && (iPrevMaxDockHeight != pDock->iMaxDockHeight || iPrevMaxDockWidth != pDock->iMaxDockWidth)) | ||
185 | 178 | { | ||
186 | 179 | //g_print ("*******%s (%dx%d -> %dx%d)\n", __func__, iPrevMaxDockWidth, iPrevMaxDockHeight, pDock->iMaxDockWidth, pDock->iMaxDockHeight); | ||
187 | 180 | cairo_dock_move_resize_dock (pDock); | ||
188 | 181 | } | ||
189 | 182 | |||
190 | 183 | cairo_dock_trigger_load_dock_background (pDock); | ||
191 | 184 | |||
192 | 185 | if (pDock->iRefCount == 0 && pDock->iVisibility == CAIRO_DOCK_VISI_RESERVE && iPrevMaxDockHeight != pDock->iMaxDockHeight) | ||
193 | 186 | cairo_dock_reserve_space_for_dock (pDock, TRUE); | ||
194 | 187 | } | ||
195 | 188 | |||
196 | 189 | Icon *cairo_dock_calculate_dock_icons (CairoDock *pDock) | ||
197 | 190 | { | ||
198 | 191 | Icon *pPointedIcon = pDock->pRenderer->calculate_icons (pDock); | ||
199 | 192 | cairo_dock_manage_mouse_position (pDock); | ||
200 | 193 | return (pDock->iMousePositionType == CAIRO_DOCK_MOUSE_INSIDE ? pPointedIcon : NULL); | ||
201 | 194 | } | ||
202 | 195 | |||
203 | 196 | |||
204 | 197 | |||
205 | 198 | //////////////////////////////// | ||
206 | 199 | /// WINDOW SIZE AND POSITION /// | ||
207 | 200 | //////////////////////////////// | ||
208 | 201 | |||
209 | 202 | void cairo_dock_reserve_space_for_dock (CairoDock *pDock, gboolean bReserve) | ||
210 | 203 | { | ||
211 | 204 | Window Xid = GDK_WINDOW_XID (pDock->container.pWidget->window); | ||
212 | 205 | int left=0, right=0, top=0, bottom=0; | ||
213 | 206 | int left_start_y=0, left_end_y=0, right_start_y=0, right_end_y=0, top_start_x=0, top_end_x=0, bottom_start_x=0, bottom_end_x=0; | ||
214 | 207 | |||
215 | 208 | if (bReserve) | ||
216 | 209 | { | ||
217 | 210 | int iWindowPositionX = pDock->container.iWindowPositionX, iWindowPositionY = pDock->container.iWindowPositionY; | ||
218 | 211 | |||
219 | 212 | int w = pDock->iMinDockWidth; | ||
220 | 213 | int h = pDock->iMinDockHeight; | ||
221 | 214 | int x, y; // position qu'aurait la fenetre du dock s'il avait la taille minimale. | ||
222 | 215 | cairo_dock_get_window_position_at_balance (pDock, w, h, &x, &y); | ||
223 | 216 | |||
224 | 217 | if (pDock->container.bDirectionUp) | ||
225 | 218 | { | ||
226 | 219 | if (pDock->container.bIsHorizontal) | ||
227 | 220 | { | ||
228 | 221 | bottom = h + pDock->iGapY; | ||
229 | 222 | bottom_start_x = x; | ||
230 | 223 | bottom_end_x = x + w; | ||
231 | 224 | } | ||
232 | 225 | else | ||
233 | 226 | { | ||
234 | 227 | right = h + pDock->iGapY; | ||
235 | 228 | right_start_y = x; | ||
236 | 229 | right_end_y = x + w; | ||
237 | 230 | } | ||
238 | 231 | } | ||
239 | 232 | else | ||
240 | 233 | { | ||
241 | 234 | if (pDock->container.bIsHorizontal) | ||
242 | 235 | { | ||
243 | 236 | top = h + pDock->iGapY; | ||
244 | 237 | top_start_x = x; | ||
245 | 238 | top_end_x = x + w; | ||
246 | 239 | } | ||
247 | 240 | else | ||
248 | 241 | { | ||
249 | 242 | left = h + pDock->iGapY; | ||
250 | 243 | left_start_y = x; | ||
251 | 244 | left_end_y = x + w; | ||
252 | 245 | } | ||
253 | 246 | } | ||
254 | 247 | } | ||
255 | 248 | |||
256 | 249 | cairo_dock_set_strut_partial (Xid, left, right, top, bottom, left_start_y, left_end_y, right_start_y, right_end_y, top_start_x, top_end_x, bottom_start_x, bottom_end_x); | ||
257 | 250 | /*if ((bReserve && ! pDock->container.bDirectionUp) || (g_iWmHint == GDK_WINDOW_TYPE_HINT_DOCK)) // merci a Robrob pour le patch ! | ||
258 | 251 | cairo_dock_set_xwindow_type_hint (Xid, "_NET_WM_WINDOW_TYPE_DOCK"); // gtk_window_set_type_hint ne marche que sur une fenetre avant de la rendre visible ! | ||
259 | 252 | else if (g_iWmHint == GDK_WINDOW_TYPE_HINT_NORMAL) | ||
260 | 253 | cairo_dock_set_xwindow_type_hint (Xid, "_NET_WM_WINDOW_TYPE_NORMAL"); // idem. | ||
261 | 254 | else if (g_iWmHint == GDK_WINDOW_TYPE_HINT_TOOLBAR) | ||
262 | 255 | cairo_dock_set_xwindow_type_hint (Xid, "_NET_WM_WINDOW_TYPE_TOOLBAR"); // idem.*/ | ||
263 | 256 | } | ||
264 | 257 | |||
265 | 258 | void cairo_dock_prevent_dock_from_out_of_screen (CairoDock *pDock) | ||
266 | 259 | { | ||
267 | 260 | int x, y; // position du point invariant du dock. | ||
268 | 261 | x = pDock->container.iWindowPositionX + pDock->container.iWidth * pDock->fAlign; | ||
269 | 262 | y = (pDock->container.bDirectionUp ? pDock->container.iWindowPositionY + pDock->container.iHeight : pDock->container.iWindowPositionY); | ||
270 | 263 | //cd_debug ("%s (%d;%d)", __func__, x, y); | ||
271 | 264 | |||
272 | 265 | pDock->iGapX = x - g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] * pDock->fAlign; | ||
273 | 266 | pDock->iGapY = (pDock->container.bDirectionUp ? g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - y : y); | ||
274 | 267 | //cd_debug (" -> (%d;%d)", pDock->iGapX, pDock->iGapY); | ||
275 | 268 | |||
276 | 269 | if (pDock->iGapX < - g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal]/2) | ||
277 | 270 | pDock->iGapX = - g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal]/2; | ||
278 | 271 | if (pDock->iGapX > g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal]/2) | ||
279 | 272 | pDock->iGapX = g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal]/2; | ||
280 | 273 | if (pDock->iGapY < 0) | ||
281 | 274 | pDock->iGapY = 0; | ||
282 | 275 | if (pDock->iGapY > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal]) | ||
283 | 276 | pDock->iGapY = g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal]; | ||
284 | 277 | } | ||
285 | 278 | |||
286 | 279 | #define CD_VISIBILITY_MARGIN 20 | ||
287 | 280 | void cairo_dock_get_window_position_at_balance (CairoDock *pDock, int iNewWidth, int iNewHeight, int *iNewPositionX, int *iNewPositionY) | ||
288 | 281 | { | ||
289 | 282 | int iWindowPositionX = (g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] - iNewWidth) * pDock->fAlign + pDock->iGapX; | ||
290 | 283 | if (pDock->iRefCount == 0 && pDock->fAlign != .5) | ||
291 | 284 | iWindowPositionX += (.5 - pDock->fAlign) * (pDock->iMaxDockWidth - iNewWidth); | ||
292 | 285 | int iWindowPositionY = (pDock->container.bDirectionUp ? g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight - pDock->iGapY : pDock->iGapY); | ||
293 | 286 | //g_print ("pDock->iGapX : %d => iWindowPositionX <- %d\n", pDock->iGapX, iWindowPositionX); | ||
294 | 287 | //g_print ("iNewHeight : %d -> pDock->container.iWindowPositionY <- %d\n", iNewHeight, iWindowPositionY); | ||
295 | 288 | |||
296 | 289 | if (pDock->iRefCount == 0) | ||
297 | 290 | { | ||
298 | 291 | if (iWindowPositionX + iNewWidth < CD_VISIBILITY_MARGIN) | ||
299 | 292 | iWindowPositionX = CD_VISIBILITY_MARGIN - iNewWidth; | ||
300 | 293 | else if (iWindowPositionX > g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] - CD_VISIBILITY_MARGIN) | ||
301 | 294 | iWindowPositionX = g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] - CD_VISIBILITY_MARGIN; | ||
302 | 295 | } | ||
303 | 296 | else | ||
304 | 297 | { | ||
305 | 298 | if (iWindowPositionX < - pDock->iLeftMargin) | ||
306 | 299 | iWindowPositionX = - pDock->iLeftMargin; | ||
307 | 300 | else if (iWindowPositionX > g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] - iNewWidth + pDock->iMinRightMargin) | ||
308 | 301 | iWindowPositionX = g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] - iNewWidth + pDock->iMinRightMargin; | ||
309 | 302 | } | ||
310 | 303 | if (iWindowPositionY < - pDock->iMaxIconHeight) | ||
311 | 304 | iWindowPositionY = - pDock->iMaxIconHeight; | ||
312 | 305 | else if (iWindowPositionY > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight) | ||
313 | 306 | iWindowPositionY = g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight; | ||
314 | 307 | |||
315 | 308 | if (pDock->container.bIsHorizontal) | ||
316 | 309 | { | ||
317 | 310 | *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetX; | ||
318 | 311 | *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetY; | ||
319 | 312 | } | ||
320 | 313 | else | ||
321 | 314 | { | ||
322 | 315 | *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetY; | ||
323 | 316 | *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetX; | ||
324 | 317 | } | ||
325 | 318 | //g_print ("POSITION : %d+%d ; %d+%d\n", iWindowPositionX, pDock->iScreenOffsetX, iWindowPositionY, pDock->iScreenOffsetY); | ||
326 | 319 | } | ||
327 | 320 | |||
328 | 321 | static gboolean _move_resize_dock (CairoDock *pDock) | ||
329 | 322 | { | ||
330 | 323 | int iNewWidth = pDock->iMaxDockWidth; | ||
331 | 324 | int iNewHeight = pDock->iMaxDockHeight; | ||
332 | 325 | int iNewPositionX, iNewPositionY; | ||
333 | 326 | cairo_dock_get_window_position_at_balance (pDock, iNewWidth, iNewHeight, &iNewPositionX, &iNewPositionY); // on ne peut pas intercepter le cas ou les nouvelles dimensions sont egales aux dimensions courantes de la fenetre, car il se peut qu'il y'ait 2 redimensionnements d'affilee s'annulant mutuellement (remove + insert d'une icone). Il faut donc avoir les 2 configure, sinon la taille reste bloquee aux valeurs fournies par le 1er configure. | ||
334 | 327 | |||
335 | 328 | //g_print (" -> %dx%d, %d;%d\n", iNewWidth, iNewHeight, iNewPositionX, iNewPositionY); | ||
336 | 329 | |||
337 | 330 | if (pDock->container.bIsHorizontal) | ||
338 | 331 | { | ||
339 | 332 | gdk_window_move_resize (pDock->container.pWidget->window, | ||
340 | 333 | iNewPositionX, | ||
341 | 334 | iNewPositionY, | ||
342 | 335 | iNewWidth, | ||
343 | 336 | iNewHeight); // lorsqu'on a 2 gdk_window_move_resize d'affilee, Compiz deconne et bloque le dock (il est toujours actif mais n'est plus redessine). Compiz envoit un configure de trop par rapport a Metacity. | ||
344 | 337 | } | ||
345 | 338 | else | ||
346 | 339 | { | ||
347 | 340 | gdk_window_move_resize (pDock->container.pWidget->window, | ||
348 | 341 | iNewPositionY, | ||
349 | 342 | iNewPositionX, | ||
350 | 343 | iNewHeight, | ||
351 | 344 | iNewWidth); | ||
352 | 345 | } | ||
353 | 346 | pDock->iSidMoveResize = 0; | ||
354 | 347 | return FALSE; | ||
355 | 348 | } | ||
356 | 349 | |||
357 | 350 | void cairo_dock_move_resize_dock (CairoDock *pDock) | ||
358 | 351 | { | ||
359 | 352 | //g_print ("*********%s (current : %dx%d, %d;%d)\n", __func__, pDock->container.iWidth, pDock->container.iHeight, pDock->container.iWindowPositionX, pDock->container.iWindowPositionY); | ||
360 | 353 | if (pDock->iSidMoveResize == 0) | ||
361 | 354 | { | ||
362 | 355 | pDock->iSidMoveResize = g_idle_add ((GSourceFunc)_move_resize_dock, pDock); | ||
363 | 356 | } | ||
364 | 357 | return ; | ||
365 | 358 | } | ||
366 | 359 | |||
367 | 360 | |||
368 | 361 | /////////////////// | ||
369 | 362 | /// INPUT SHAPE /// | ||
370 | 363 | /////////////////// | ||
371 | 364 | |||
372 | 365 | static GdkBitmap *_cairo_dock_create_input_shape (CairoDock *pDock, int w, int h) | ||
373 | 366 | { | ||
374 | 367 | int W = pDock->iMaxDockWidth; | ||
375 | 368 | int H = pDock->iMaxDockHeight; | ||
376 | 369 | //g_print ("%s (%dx%d / %dx%d)\n", __func__, w, h, W, H); | ||
377 | 370 | |||
378 | 371 | GdkBitmap *pShapeBitmap = (GdkBitmap*) gdk_pixmap_new (NULL, | ||
379 | 372 | pDock->container.bIsHorizontal ? W : H, | ||
380 | 373 | pDock->container.bIsHorizontal ? H : W, | ||
381 | 374 | 1); | ||
382 | 375 | |||
383 | 376 | cairo_t *pCairoContext = gdk_cairo_create (pShapeBitmap); | ||
384 | 377 | cairo_set_source_rgba (pCairoContext, 0.0f, 0.0f, 0.0f, 0.0f); | ||
385 | 378 | cairo_set_operator (pCairoContext, CAIRO_OPERATOR_SOURCE); | ||
386 | 379 | cairo_paint (pCairoContext); | ||
387 | 380 | if (w != 0 && h != 0) | ||
388 | 381 | { | ||
389 | 382 | if (pDock->container.bIsHorizontal) | ||
390 | 383 | { | ||
391 | 384 | cairo_rectangle (pCairoContext, | ||
392 | 385 | (W - w) / 2, // centre en x. | ||
393 | 386 | pDock->container.bDirectionUp ? H - h : 0, | ||
394 | 387 | w, | ||
395 | 388 | h); | ||
396 | 389 | } | ||
397 | 390 | else | ||
398 | 391 | { | ||
399 | 392 | cairo_rectangle (pCairoContext, | ||
400 | 393 | pDock->container.bDirectionUp ? H - h : 0, | ||
401 | 394 | (W - w) / 2, // centre en x. | ||
402 | 395 | h, | ||
403 | 396 | w); | ||
404 | 397 | } | ||
405 | 398 | cairo_set_source_rgba (pCairoContext, 1., 1., 1., 1.); | ||
406 | 399 | cairo_fill (pCairoContext); | ||
407 | 400 | } | ||
408 | 401 | cairo_destroy (pCairoContext); | ||
409 | 402 | |||
410 | 403 | return pShapeBitmap; | ||
411 | 404 | } | ||
412 | 405 | |||
413 | 406 | void cairo_dock_update_input_shape (CairoDock *pDock) | ||
414 | 407 | { | ||
415 | 408 | //\_______________ On detruit les zones d'input actuelles. | ||
416 | 409 | if (pDock->pShapeBitmap != NULL) | ||
417 | 410 | { | ||
418 | 411 | g_object_unref ((gpointer) pDock->pShapeBitmap); | ||
419 | 412 | pDock->pShapeBitmap = NULL; | ||
420 | 413 | } | ||
421 | 414 | if (pDock->pHiddenShapeBitmap != NULL) | ||
422 | 415 | { | ||
423 | 416 | g_object_unref ((gpointer) pDock->pHiddenShapeBitmap); | ||
424 | 417 | pDock->pHiddenShapeBitmap = NULL; | ||
425 | 418 | } | ||
426 | 419 | |||
427 | 420 | //\_______________ on definit les tailles des zones. | ||
428 | 421 | int W = pDock->iMaxDockWidth; | ||
429 | 422 | int H = pDock->iMaxDockHeight; | ||
430 | 423 | int w = pDock->iMinDockWidth; | ||
431 | 424 | int h = pDock->iMinDockHeight; | ||
432 | 425 | ///int w_ = MIN (myDocksParam.iVisibleZoneWidth, pDock->iMaxDockWidth); | ||
433 | 426 | ///int h_ = MIN (myDocksParam.iVisibleZoneHeight, pDock->iMaxDockHeight); | ||
434 | 427 | int w_ = 1; | ||
435 | 428 | int h_ = 1; | ||
436 | 429 | |||
437 | 430 | //\_______________ on verifie que les conditions sont toujours remplies. | ||
438 | 431 | if (w == 0 || h == 0 || pDock->iRefCount > 0 || W == 0 || H == 0) | ||
439 | 432 | { | ||
440 | 433 | if (pDock->iInputState != CAIRO_DOCK_INPUT_ACTIVE) | ||
441 | 434 | { | ||
442 | 435 | //g_print ("+++ input shape active on update input shape\n"); | ||
443 | 436 | cairo_dock_set_input_shape_active (pDock); | ||
444 | 437 | pDock->iInputState = CAIRO_DOCK_INPUT_ACTIVE; | ||
445 | 438 | } | ||
446 | 439 | return ; | ||
447 | 440 | } | ||
448 | 441 | |||
449 | 442 | //\_______________ on cree les zones. | ||
450 | 443 | pDock->pShapeBitmap = _cairo_dock_create_input_shape (pDock, w, h); | ||
451 | 444 | |||
452 | 445 | pDock->pHiddenShapeBitmap = _cairo_dock_create_input_shape (pDock, w_, h_); | ||
453 | 446 | } | ||
454 | 447 | |||
455 | 448 | |||
456 | 449 | |||
457 | 450 | /////////////////// | ||
458 | 451 | /// LINEAR DOCK /// | ||
459 | 452 | /////////////////// | ||
460 | 453 | |||
461 | 454 | GList *cairo_dock_calculate_icons_positions_at_rest_linear (GList *pIconList, double fFlatDockWidth, int iXOffset) | ||
462 | 455 | { | ||
463 | 456 | //g_print ("%s (%d, +%d)\n", __func__, fFlatDockWidth, iXOffset); | ||
464 | 457 | double x_cumulated = iXOffset; | ||
465 | 458 | double fXMin = 99999; | ||
466 | 459 | GList* ic, *pFirstDrawnElement = NULL; | ||
467 | 460 | Icon *icon; | ||
468 | 461 | for (ic = pIconList; ic != NULL; ic = ic->next) | ||
469 | 462 | { | ||
470 | 463 | icon = ic->data; | ||
471 | 464 | |||
472 | 465 | if (x_cumulated + icon->fWidth / 2 < 0) | ||
473 | 466 | icon->fXAtRest = x_cumulated + fFlatDockWidth; | ||
474 | 467 | else if (x_cumulated + icon->fWidth / 2 > fFlatDockWidth) | ||
475 | 468 | icon->fXAtRest = x_cumulated - fFlatDockWidth; | ||
476 | 469 | else | ||
477 | 470 | icon->fXAtRest = x_cumulated; | ||
478 | 471 | |||
479 | 472 | if (icon->fXAtRest < fXMin) | ||
480 | 473 | { | ||
481 | 474 | fXMin = icon->fXAtRest; | ||
482 | 475 | pFirstDrawnElement = ic; | ||
483 | 476 | } | ||
484 | 477 | //g_print ("%s : fXAtRest = %.2f\n", icon->cName, icon->fXAtRest); | ||
485 | 478 | |||
486 | 479 | x_cumulated += icon->fWidth + myIconsParam.iIconGap; | ||
487 | 480 | } | ||
488 | 481 | |||
489 | 482 | return pFirstDrawnElement; | ||
490 | 483 | } | ||
491 | 484 | |||
492 | 485 | double cairo_dock_calculate_max_dock_width (CairoDock *pDock, GList *pFirstDrawnElementGiven, double fFlatDockWidth, double fWidthConstraintFactor, double fExtraWidth) | ||
493 | 486 | { | ||
494 | 487 | double fMaxDockWidth = 0.; | ||
495 | 488 | //g_print ("%s (%d)\n", __func__, (int)fFlatDockWidth); | ||
496 | 489 | GList *pIconList = pDock->icons; | ||
497 | 490 | if (pIconList == NULL) | ||
498 | 491 | return 2 * myDocksParam.iDockRadius + myDocksParam.iDockLineWidth + 2 * myDocksParam.iFrameMargin; | ||
499 | 492 | |||
500 | 493 | //\_______________ On remet a zero les positions extremales des icones. | ||
501 | 494 | GList* ic; | ||
502 | 495 | Icon *icon; | ||
503 | 496 | for (ic = pIconList; ic != NULL; ic = ic->next) | ||
504 | 497 | { | ||
505 | 498 | icon = ic->data; | ||
506 | 499 | icon->fXMax = -1e4; | ||
507 | 500 | icon->fXMin = 1e4; | ||
508 | 501 | } | ||
509 | 502 | |||
510 | 503 | //\_______________ On simule le passage du curseur sur toute la largeur du dock, et on chope la largeur maximale qui s'en degage, ainsi que les positions d'equilibre de chaque icone. | ||
511 | 504 | GList *pFirstDrawnElement = (pFirstDrawnElementGiven != NULL ? pFirstDrawnElementGiven : pIconList); | ||
512 | 505 | //for (int iVirtualMouseX = 0; iVirtualMouseX < fFlatDockWidth; iVirtualMouseX ++) | ||
513 | 506 | GList *ic2; | ||
514 | 507 | for (ic = pIconList; ic != NULL; ic = ic->next) | ||
515 | 508 | { | ||
516 | 509 | icon = ic->data; | ||
517 | 510 | |||
518 | 511 | cairo_dock_calculate_wave_with_position_linear (pIconList, pFirstDrawnElement, icon->fXAtRest, pDock->fMagnitudeMax, fFlatDockWidth, 0, 0, 0.5, 0, pDock->container.bDirectionUp); | ||
519 | 512 | ic2 = pFirstDrawnElement; | ||
520 | 513 | do | ||
521 | 514 | { | ||
522 | 515 | icon = ic2->data; | ||
523 | 516 | |||
524 | 517 | if (icon->fX + icon->fWidth * icon->fScale > icon->fXMax) | ||
525 | 518 | icon->fXMax = icon->fX + icon->fWidth * icon->fScale; | ||
526 | 519 | if (icon->fX < icon->fXMin) | ||
527 | 520 | icon->fXMin = icon->fX; | ||
528 | 521 | |||
529 | 522 | ic2 = cairo_dock_get_next_element (ic2, pDock->icons); | ||
530 | 523 | } while (ic2 != pFirstDrawnElement); | ||
531 | 524 | } | ||
532 | 525 | cairo_dock_calculate_wave_with_position_linear (pIconList, pFirstDrawnElement, fFlatDockWidth - 1, pDock->fMagnitudeMax, fFlatDockWidth, 0, 0, pDock->fAlign, 0, pDock->container.bDirectionUp); // pDock->fFoldingFactor | ||
533 | 526 | ic = pFirstDrawnElement; | ||
534 | 527 | do | ||
535 | 528 | { | ||
536 | 529 | icon = ic->data; | ||
537 | 530 | |||
538 | 531 | if (icon->fX + icon->fWidth * icon->fScale > icon->fXMax) | ||
539 | 532 | icon->fXMax = icon->fX + icon->fWidth * icon->fScale; | ||
540 | 533 | if (icon->fX < icon->fXMin) | ||
541 | 534 | icon->fXMin = icon->fX; | ||
542 | 535 | |||
543 | 536 | ic = cairo_dock_get_next_element (ic, pDock->icons); | ||
544 | 537 | } while (ic != pFirstDrawnElement); | ||
545 | 538 | |||
546 | 539 | fMaxDockWidth = (icon->fXMax - ((Icon *) pFirstDrawnElement->data)->fXMin) * fWidthConstraintFactor + fExtraWidth; | ||
547 | 540 | fMaxDockWidth = ceil (fMaxDockWidth) + 1; | ||
548 | 541 | |||
549 | 542 | for (ic = pIconList; ic != NULL; ic = ic->next) | ||
550 | 543 | { | ||
551 | 544 | icon = ic->data; | ||
552 | 545 | icon->fXMin += fMaxDockWidth / 2; | ||
553 | 546 | icon->fXMax += fMaxDockWidth / 2; | ||
554 | 547 | //g_print ("%s : [%d;%d]\n", icon->cName, (int) icon->fXMin, (int) icon->fXMax); | ||
555 | 548 | icon->fX = icon->fXAtRest; | ||
556 | 549 | icon->fScale = 1; | ||
557 | 550 | } | ||
558 | 551 | |||
559 | 552 | return fMaxDockWidth; | ||
560 | 553 | } | ||
561 | 554 | |||
562 | 555 | Icon * cairo_dock_calculate_wave_with_position_linear (GList *pIconList, GList *pFirstDrawnElementGiven, int x_abs, gdouble fMagnitude, double fFlatDockWidth, int iWidth, int iHeight, double fAlign, double fFoldingFactor, gboolean bDirectionUp) | ||
563 | 556 | { | ||
564 | 557 | //g_print (">>>>>%s (%d/%.2f, %dx%d, %.2f, %.2f)\n", __func__, x_abs, fFlatDockWidth, iWidth, iHeight, fAlign, fFoldingFactor); | ||
565 | 558 | if (pIconList == NULL) | ||
566 | 559 | return NULL; | ||
567 | 560 | if (x_abs < 0 && iWidth > 0) // ces cas limite sont la pour empecher les icones de retrecir trop rapidement quand on sort par les cotes. | ||
568 | 561 | ///x_abs = -1; | ||
569 | 562 | x_abs = 0; | ||
570 | 563 | else if (x_abs > fFlatDockWidth && iWidth > 0) | ||
571 | 564 | ///x_abs = fFlatDockWidth+1; | ||
572 | 565 | x_abs = (int) fFlatDockWidth; | ||
573 | 566 | |||
574 | 567 | |||
575 | 568 | float x_cumulated = 0, fXMiddle, fDeltaExtremum; | ||
576 | 569 | GList* ic, *pointed_ic; | ||
577 | 570 | Icon *icon, *prev_icon; | ||
578 | 571 | |||
579 | 572 | double fScale = 0.; | ||
580 | 573 | double offset = 0.; | ||
581 | 574 | GList *pFirstDrawnElement = (pFirstDrawnElementGiven != NULL ? pFirstDrawnElementGiven : pIconList); | ||
582 | 575 | ic = pFirstDrawnElement; | ||
583 | 576 | pointed_ic = (x_abs < 0 ? ic : NULL); | ||
584 | 577 | do | ||
585 | 578 | { | ||
586 | 579 | icon = ic->data; | ||
587 | 580 | x_cumulated = icon->fXAtRest; | ||
588 | 581 | fXMiddle = icon->fXAtRest + icon->fWidth / 2; | ||
589 | 582 | |||
590 | 583 | //\_______________ On calcule sa phase (pi/2 au niveau du curseur). | ||
591 | 584 | icon->fPhase = (fXMiddle - x_abs) / myIconsParam.iSinusoidWidth * G_PI + G_PI / 2; | ||
592 | 585 | if (icon->fPhase < 0) | ||
593 | 586 | { | ||
594 | 587 | icon->fPhase = 0; | ||
595 | 588 | } | ||
596 | 589 | else if (icon->fPhase > G_PI) | ||
597 | 590 | { | ||
598 | 591 | icon->fPhase = G_PI; | ||
599 | 592 | } | ||
600 | 593 | |||
601 | 594 | //\_______________ On en deduit l'amplitude de la sinusoide au niveau de cette icone, et donc son echelle. | ||
602 | 595 | icon->fScale = 1 + fMagnitude * myIconsParam.fAmplitude * sin (icon->fPhase); | ||
603 | 596 | if (iWidth > 0 && icon->fInsertRemoveFactor != 0) | ||
604 | 597 | { | ||
605 | 598 | fScale = icon->fScale; | ||
606 | 599 | ///offset += (icon->fWidth * icon->fScale) * (pointed_ic == NULL ? 1 : -1); | ||
607 | 600 | if (icon->fInsertRemoveFactor > 0) | ||
608 | 601 | icon->fScale *= icon->fInsertRemoveFactor; | ||
609 | 602 | else | ||
610 | 603 | icon->fScale *= (1 + icon->fInsertRemoveFactor); | ||
611 | 604 | ///offset -= (icon->fWidth * icon->fScale) * (pointed_ic == NULL ? 1 : -1); | ||
612 | 605 | } | ||
613 | 606 | |||
614 | 607 | icon->fY = (bDirectionUp ? iHeight - myDocksParam.iDockLineWidth - myDocksParam.iFrameMargin - icon->fScale * icon->fHeight : myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin); | ||
615 | 608 | //g_print ("%s fY : %d; %.2f\n", icon->cName, iHeight, icon->fHeight); | ||
616 | 609 | |||
617 | 610 | //\_______________ Si on avait deja defini l'icone pointee, on peut placer l'icone courante par rapport a la precedente. | ||
618 | 611 | if (pointed_ic != NULL) | ||
619 | 612 | { | ||
620 | 613 | if (ic == pFirstDrawnElement) // peut arriver si on est en dehors a gauche du dock. | ||
621 | 614 | { | ||
622 | 615 | icon->fX = x_cumulated - 1. * (fFlatDockWidth - iWidth) / 2; | ||
623 | 616 | //g_print (" en dehors a gauche : icon->fX = %.2f (%.2f)\n", icon->fX, x_cumulated); | ||
624 | 617 | } | ||
625 | 618 | else | ||
626 | 619 | { | ||
627 | 620 | prev_icon = (ic->prev != NULL ? ic->prev->data : cairo_dock_get_last_icon (pIconList)); | ||
628 | 621 | icon->fX = prev_icon->fX + (prev_icon->fWidth + myIconsParam.iIconGap) * prev_icon->fScale; | ||
629 | 622 | |||
630 | 623 | if (icon->fX + icon->fWidth * icon->fScale > icon->fXMax - myIconsParam.fAmplitude * fMagnitude * (icon->fWidth + 1.5*myIconsParam.iIconGap) / 8 && iWidth != 0) | ||
631 | 624 | { | ||
632 | 625 | //g_print (" on contraint %s (fXMax=%.2f , fX=%.2f\n", prev_icon->cName, prev_icon->fXMax, prev_icon->fX); | ||
633 | 626 | fDeltaExtremum = icon->fX + icon->fWidth * icon->fScale - (icon->fXMax - myIconsParam.fAmplitude * fMagnitude * (icon->fWidth + 1.5*myIconsParam.iIconGap) / 16); | ||
634 | 627 | if (myIconsParam.fAmplitude != 0) | ||
635 | 628 | icon->fX -= fDeltaExtremum * (1 - (icon->fScale - 1) / myIconsParam.fAmplitude) * fMagnitude; | ||
636 | 629 | } | ||
637 | 630 | } | ||
638 | 631 | icon->fX = fAlign * iWidth + (icon->fX - fAlign * iWidth) * (1. - fFoldingFactor); | ||
639 | 632 | //g_print (" a droite : icon->fX = %.2f (%.2f)\n", icon->fX, x_cumulated); | ||
640 | 633 | } | ||
641 | 634 | |||
642 | 635 | //\_______________ On regarde si on pointe sur cette icone. | ||
643 | 636 | if (x_cumulated + icon->fWidth + .5*myIconsParam.iIconGap >= x_abs && x_cumulated - .5*myIconsParam.iIconGap <= x_abs && pointed_ic == NULL) // on a trouve l'icone sur laquelle on pointe. | ||
644 | 637 | { | ||
645 | 638 | pointed_ic = ic; | ||
646 | 639 | ///icon->bPointed = TRUE; | ||
647 | 640 | icon->bPointed = (x_abs != (int) fFlatDockWidth && x_abs != 0); | ||
648 | 641 | icon->fX = x_cumulated - (fFlatDockWidth - iWidth) / 2 + (1 - icon->fScale) * (x_abs - x_cumulated + .5*myIconsParam.iIconGap); | ||
649 | 642 | icon->fX = fAlign * iWidth + (icon->fX - fAlign * iWidth) * (1. - fFoldingFactor); | ||
650 | 643 | //g_print (" icone pointee : fX = %.2f (%.2f, %d)\n", icon->fX, x_cumulated, icon->bPointed); | ||
651 | 644 | } | ||
652 | 645 | else | ||
653 | 646 | icon->bPointed = FALSE; | ||
654 | 647 | |||
655 | 648 | if (iWidth > 0 && icon->fInsertRemoveFactor != 0) | ||
656 | 649 | { | ||
657 | 650 | if (pointed_ic != ic) // bPointed peut etre false a l'extremite droite. | ||
658 | 651 | offset += (icon->fWidth * (fScale - icon->fScale)) * (pointed_ic == NULL ? 1 : -1); | ||
659 | 652 | else | ||
660 | 653 | offset += (2*(fXMiddle - x_abs) * (fScale - icon->fScale)) * (pointed_ic == NULL ? 1 : -1); | ||
661 | 654 | } | ||
662 | 655 | |||
663 | 656 | ic = cairo_dock_get_next_element (ic, pIconList); | ||
664 | 657 | } while (ic != pFirstDrawnElement); | ||
665 | 658 | |||
666 | 659 | //\_______________ On place les icones precedant l'icone pointee par rapport a celle-ci. | ||
667 | 660 | if (pointed_ic == NULL) // on est a droite des icones. | ||
668 | 661 | { | ||
669 | 662 | pointed_ic = (pFirstDrawnElement->prev == NULL ? g_list_last (pIconList) : pFirstDrawnElement->prev); | ||
670 | 663 | icon = pointed_ic->data; | ||
671 | 664 | icon->fX = x_cumulated - (fFlatDockWidth - iWidth) / 2 + (1 - icon->fScale) * (icon->fWidth + .5*myIconsParam.iIconGap); | ||
672 | 665 | icon->fX = fAlign * iWidth + (icon->fX - fAlign * iWidth) * (1 - fFoldingFactor); | ||
673 | 666 | //g_print (" en dehors a droite : icon->fX = %.2f (%.2f)\n", icon->fX, x_cumulated); | ||
674 | 667 | } | ||
675 | 668 | |||
676 | 669 | ic = pointed_ic; | ||
677 | 670 | while (ic != pFirstDrawnElement) | ||
678 | 671 | { | ||
679 | 672 | icon = ic->data; | ||
680 | 673 | |||
681 | 674 | ic = ic->prev; | ||
682 | 675 | if (ic == NULL) | ||
683 | 676 | ic = g_list_last (pIconList); | ||
684 | 677 | |||
685 | 678 | prev_icon = ic->data; | ||
686 | 679 | |||
687 | 680 | prev_icon->fX = icon->fX - (prev_icon->fWidth + myIconsParam.iIconGap) * prev_icon->fScale; | ||
688 | 681 | //g_print ("fX <- %.2f; fXMin : %.2f\n", prev_icon->fX, prev_icon->fXMin); | ||
689 | 682 | if (prev_icon->fX < prev_icon->fXMin + myIconsParam.fAmplitude * fMagnitude * (prev_icon->fWidth + 1.5*myIconsParam.iIconGap) / 8 && iWidth != 0 && x_abs < iWidth && fMagnitude > 0) /// && prev_icon->fPhase == 0 // on rajoute 'fMagnitude > 0' sinon il y'a un leger "saut" du aux contraintes a gauche de l'icone pointee. | ||
690 | 683 | { | ||
691 | 684 | //g_print (" on contraint %s (fXMin=%.2f , fX=%.2f\n", prev_icon->cName, prev_icon->fXMin, prev_icon->fX); | ||
692 | 685 | fDeltaExtremum = prev_icon->fX - (prev_icon->fXMin + myIconsParam.fAmplitude * fMagnitude * (prev_icon->fWidth + 1.5*myIconsParam.iIconGap) / 16); | ||
693 | 686 | if (myIconsParam.fAmplitude != 0) | ||
694 | 687 | prev_icon->fX -= fDeltaExtremum * (1 - (prev_icon->fScale - 1) / myIconsParam.fAmplitude) * fMagnitude; | ||
695 | 688 | } | ||
696 | 689 | prev_icon->fX = fAlign * iWidth + (prev_icon->fX - fAlign * iWidth) * (1. - fFoldingFactor); | ||
697 | 690 | //g_print (" prev_icon->fX : %.2f\n", prev_icon->fX); | ||
698 | 691 | } | ||
699 | 692 | |||
700 | 693 | if (offset != 0) | ||
701 | 694 | { | ||
702 | 695 | offset /= 2; | ||
703 | 696 | //g_print ("offset : %.2f (pointed:%s)\n", offset, pointed_ic?((Icon*)pointed_ic->data)->cName:"none"); | ||
704 | 697 | for (ic = pIconList; ic != NULL; ic = ic->next) | ||
705 | 698 | { | ||
706 | 699 | icon = ic->data; | ||
707 | 700 | //if (ic == pIconList) | ||
708 | 701 | // cd_debug ("fX : %.2f - %.2f\n", icon->fX, offset); | ||
709 | 702 | icon->fX -= offset; | ||
710 | 703 | } | ||
711 | 704 | } | ||
712 | 705 | |||
713 | 706 | icon = pointed_ic->data; | ||
714 | 707 | return (icon->bPointed ? icon : NULL); | ||
715 | 708 | } | ||
716 | 709 | |||
717 | 710 | Icon *cairo_dock_apply_wave_effect_linear (CairoDock *pDock) | ||
718 | 711 | { | ||
719 | 712 | //\_______________ On calcule la position du curseur dans le referentiel du dock a plat. | ||
720 | 713 | int dx = pDock->container.iMouseX - (pDock->iOffsetForExtend * (pDock->fAlign - .5) * 2) - pDock->container.iWidth / 2; // ecart par rapport au milieu du dock a plat. | ||
721 | 714 | int x_abs = dx + pDock->fFlatDockWidth / 2; // ecart par rapport a la gauche du dock minimal plat. | ||
722 | 715 | //g_print ("%s (flat:%d, w:%d, x:%d)\n", __func__, (int)pDock->fFlatDockWidth, pDock->container.iWidth, pDock->container.iMouseX); | ||
723 | 716 | //\_______________ On calcule l'ensemble des parametres des icones. | ||
724 | 717 | double fMagnitude = cairo_dock_calculate_magnitude (pDock->iMagnitudeIndex) * pDock->fMagnitudeMax; | ||
725 | 718 | Icon *pPointedIcon = cairo_dock_calculate_wave_with_position_linear (pDock->icons, pDock->pFirstDrawnElement, x_abs, fMagnitude, pDock->fFlatDockWidth, pDock->container.iWidth, pDock->container.iHeight, pDock->fAlign, pDock->fFoldingFactor, pDock->container.bDirectionUp); // iMaxDockWidth | ||
726 | 719 | return pPointedIcon; | ||
727 | 720 | } | ||
728 | 721 | |||
729 | 722 | double cairo_dock_get_current_dock_width_linear (CairoDock *pDock) | ||
730 | 723 | { | ||
731 | 724 | if (pDock->icons == NULL) | ||
732 | 725 | //return 2 * myDocksParam.iDockRadius + myDocksParam.iDockLineWidth + 2 * myDocksParam.iFrameMargin; | ||
733 | 726 | return 1 + 2 * myDocksParam.iFrameMargin; | ||
734 | 727 | |||
735 | 728 | Icon *pLastIcon = cairo_dock_get_last_drawn_icon (pDock); | ||
736 | 729 | Icon *pFirstIcon = cairo_dock_get_first_drawn_icon (pDock); | ||
737 | 730 | double fWidth = pLastIcon->fX - pFirstIcon->fX + pLastIcon->fWidth * pLastIcon->fScale + 2 * myDocksParam.iFrameMargin; // + 2 * myDocksParam.iDockRadius + myDocksParam.iDockLineWidth + 2 * myDocksParam.iFrameMargin | ||
738 | 731 | |||
739 | 732 | return fWidth; | ||
740 | 733 | } | ||
741 | 734 | |||
742 | 735 | |||
743 | 736 | void cairo_dock_check_if_mouse_inside_linear (CairoDock *pDock) | ||
744 | 737 | { | ||
745 | 738 | CairoDockMousePositionType iMousePositionType; | ||
746 | 739 | int iWidth = pDock->container.iWidth; | ||
747 | 740 | int iHeight = (pDock->fMagnitudeMax != 0 ? pDock->container.iHeight : pDock->iMinDockHeight); | ||
748 | 741 | ///int iExtraHeight = (pDock->bAtBottom ? 0 : myIconsParam.iLabelSize); | ||
749 | 742 | int iExtraHeight = 0; /// il faudrait voir si on a un sous-dock ou un dialogue au dessus :-/ | ||
750 | 743 | int iMouseX = pDock->container.iMouseX; | ||
751 | 744 | int iMouseY = (pDock->container.bDirectionUp ? pDock->container.iHeight - pDock->container.iMouseY : pDock->container.iMouseY); | ||
752 | 745 | //g_print ("%s (%dx%d, %dx%d, %f)\n", __func__, iMouseX, iMouseY, iWidth, iHeight, pDock->fFoldingFactor); | ||
753 | 746 | |||
754 | 747 | //\_______________ On regarde si le curseur est dans le dock ou pas, et on joue sur la taille des icones en consequence. | ||
755 | 748 | int x_abs = pDock->container.iMouseX + (pDock->fFlatDockWidth - iWidth) / 2; // abscisse par rapport a la gauche du dock minimal plat. | ||
756 | 749 | gboolean bMouseInsideDock = (x_abs >= 0 && x_abs <= pDock->fFlatDockWidth && iMouseX > 0 && iMouseX < iWidth); | ||
757 | 750 | //g_print ("bMouseInsideDock : %d (%d;%d/%.2f)\n", bMouseInsideDock, pDock->container.bInside, x_abs, pDock->fFlatDockWidth); | ||
758 | 751 | |||
759 | 752 | if (! bMouseInsideDock) // hors du dock par les cotes. | ||
760 | 753 | { | ||
761 | 754 | if (/*cairo_dock_is_extended_dock (pDock) && */pDock->bAutoHide) // c'est penible de sortir du dock trop facilement avec l'auto-hide. | ||
762 | 755 | { | ||
763 | 756 | if (iMouseY >= 0 && iMouseY < iHeight) | ||
764 | 757 | iMousePositionType = CAIRO_DOCK_MOUSE_INSIDE; | ||
765 | 758 | else | ||
766 | 759 | iMousePositionType = CAIRO_DOCK_MOUSE_OUTSIDE; | ||
767 | 760 | } | ||
768 | 761 | else | ||
769 | 762 | { | ||
770 | 763 | double fSideMargin = fabs (pDock->fAlign - .5) * (iWidth - pDock->fFlatDockWidth); | ||
771 | 764 | if (x_abs < - fSideMargin || x_abs > pDock->fFlatDockWidth + fSideMargin) | ||
772 | 765 | iMousePositionType = CAIRO_DOCK_MOUSE_OUTSIDE; | ||
773 | 766 | else | ||
774 | 767 | iMousePositionType = CAIRO_DOCK_MOUSE_ON_THE_EDGE; | ||
775 | 768 | } | ||
776 | 769 | } | ||
777 | 770 | else if (iMouseY >= 0 && iMouseY < iHeight) // et en plus on est dedans en y. // && pPointedIcon != NULL | ||
778 | 771 | { | ||
779 | 772 | //g_print ("on est dedans en x et en y (iMouseX=%d => x_abs=%d ; iMouseY=%d/%d)\n", iMouseX, x_abs, iMouseY, iHeight); | ||
780 | 773 | //pDock->container.bInside = TRUE; | ||
781 | 774 | iMousePositionType = CAIRO_DOCK_MOUSE_INSIDE; | ||
782 | 775 | } | ||
783 | 776 | else | ||
784 | 777 | iMousePositionType = CAIRO_DOCK_MOUSE_OUTSIDE; | ||
785 | 778 | |||
786 | 779 | pDock->iMousePositionType = iMousePositionType; | ||
787 | 780 | } | ||
788 | 781 | |||
789 | 782 | void cairo_dock_manage_mouse_position (CairoDock *pDock) | ||
790 | 783 | { | ||
791 | 784 | switch (pDock->iMousePositionType) | ||
792 | 785 | { | ||
793 | 786 | case CAIRO_DOCK_MOUSE_INSIDE : | ||
794 | 787 | //g_print ("INSIDE (%d;%d;%d;%d;%d)\n", cairo_dock_entrance_is_allowed (pDock), pDock->iMagnitudeIndex, pDock->bIsGrowingUp, pDock->bIsShrinkingDown, pDock->iInputState); | ||
795 | 788 | if (cairo_dock_entrance_is_allowed (pDock) && ((pDock->iMagnitudeIndex < CAIRO_DOCK_NB_MAX_ITERATIONS && ! pDock->bIsGrowingUp) || pDock->bIsShrinkingDown) && pDock->iInputState != CAIRO_DOCK_INPUT_HIDDEN && (pDock->iInputState != CAIRO_DOCK_INPUT_AT_REST || pDock->bIsDragging)) // on est dedans et la taille des icones est non maximale bien que le dock ne soit pas en train de grossir, cependant on respecte l'etat 'cache', et l'etat repos. | ||
796 | 789 | { | ||
797 | 790 | //g_print ("on est dedans en x et en y et la taille des icones est non maximale bien qu'aucune icone ne soit animee (%d;%d)\n", pDock->iMagnitudeIndex, pDock->container.bInside); | ||
798 | 791 | if (pDock->iRefCount != 0 && !pDock->container.bInside) | ||
799 | 792 | { | ||
800 | 793 | |||
801 | 794 | break; | ||
802 | 795 | } | ||
803 | 796 | //pDock->container.bInside = TRUE; | ||
804 | 797 | ///if ((pDock->bAtBottom && pDock->iRefCount == 0 && ! pDock->bAutoHide) || (pDock->container.iWidth != pDock->iMaxDockWidth || pDock->container.iHeight != pDock->iMaxDockHeight) || (!pDock->container.bInside)) // on le fait pas avec l'auto-hide, car un signal d'entree est deja emis a cause des mouvements/redimensionnements de la fenetre, et en rajouter un ici fout le boxon. // !pDock->container.bInside ajoute pour le bug du chgt de bureau. | ||
805 | 798 | if ((pDock->iMagnitudeIndex == 0 && pDock->iRefCount == 0 && ! pDock->bAutoHide) || !pDock->container.bInside) | ||
806 | 799 | { | ||
807 | 800 | //g_print (" on emule une re-rentree (pDock->iMagnitudeIndex:%d)\n", pDock->iMagnitudeIndex); | ||
808 | 801 | cairo_dock_emit_enter_signal (CAIRO_CONTAINER (pDock)); | ||
809 | 802 | } | ||
810 | 803 | else // on se contente de faire grossir les icones. | ||
811 | 804 | { | ||
812 | 805 | //g_print (" on se contente de faire grossir les icones\n"); | ||
813 | 806 | cairo_dock_start_growing (pDock); | ||
814 | 807 | if (pDock->bAutoHide && pDock->iRefCount == 0) | ||
815 | 808 | cairo_dock_start_showing (pDock); | ||
816 | 809 | } | ||
817 | 810 | } | ||
818 | 811 | break ; | ||
819 | 812 | |||
820 | 813 | case CAIRO_DOCK_MOUSE_ON_THE_EDGE : | ||
821 | 814 | if (pDock->iMagnitudeIndex > 0 && ! pDock->bIsGrowingUp) | ||
822 | 815 | cairo_dock_start_shrinking (pDock); | ||
823 | 816 | break ; | ||
824 | 817 | |||
825 | 818 | case CAIRO_DOCK_MOUSE_OUTSIDE : | ||
826 | 819 | //g_print ("en dehors du dock (bIsShrinkingDown:%d;bIsGrowingUp:%d;iMagnitudeIndex:%d)\n", pDock->bIsShrinkingDown, pDock->bIsGrowingUp, pDock->iMagnitudeIndex); | ||
827 | 820 | if (! pDock->bIsGrowingUp && ! pDock->bIsShrinkingDown && pDock->iSidLeaveDemand == 0 && pDock->iMagnitudeIndex > 0 && ! pDock->bIconIsFlyingAway) | ||
828 | 821 | { | ||
829 | 822 | if (pDock->iRefCount > 0) | ||
830 | 823 | { | ||
831 | 824 | Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (pDock, NULL); | ||
832 | 825 | if (pPointingIcon && pPointingIcon->bPointed) // sous-dock pointe, n le laisse en position haute. | ||
833 | 826 | return; | ||
834 | 827 | } | ||
835 | 828 | //g_print ("on force a quitter (iRefCount:%d; bIsGrowingUp:%d; iMagnitudeIndex:%d)\n", pDock->iRefCount, pDock->bIsGrowingUp, pDock->iMagnitudeIndex); | ||
836 | 829 | pDock->iSidLeaveDemand = g_timeout_add (MAX (myDocksParam.iLeaveSubDockDelay, 330), (GSourceFunc) cairo_dock_emit_leave_signal, (gpointer) pDock); | ||
837 | 830 | } | ||
838 | 831 | break ; | ||
839 | 832 | } | ||
840 | 833 | } | ||
841 | 834 | |||
842 | 835 | #define make_icon_avoid_mouse(icon) \ | ||
843 | 836 | cairo_dock_mark_icon_as_avoiding_mouse (icon);\ | ||
844 | 837 | icon->fAlpha = 0.75;\ | ||
845 | 838 | if (myIconsParam.fAmplitude != 0)\ | ||
846 | 839 | icon->fDrawX += icon->fWidth / 2 * (icon->fScale - 1) / myIconsParam.fAmplitude * (icon->fPhase < G_PI/2 ? -1 : 1); | ||
847 | 840 | |||
848 | 841 | static gboolean _cairo_dock_check_can_drop_linear (CairoDock *pDock, CairoDockIconGroup iGroup, double fMargin) | ||
849 | 842 | { | ||
850 | 843 | gboolean bCanDrop = FALSE; | ||
851 | 844 | Icon *icon; | ||
852 | 845 | GList *pFirstDrawnElement = (pDock->pFirstDrawnElement != NULL ? pDock->pFirstDrawnElement : pDock->icons); | ||
853 | 846 | GList *ic = pFirstDrawnElement; | ||
854 | 847 | do | ||
855 | 848 | { | ||
856 | 849 | icon = ic->data; | ||
857 | 850 | if (icon->bPointed) // && icon->iAnimationState != CAIRO_DOCK_FOLLOW_MOUSE | ||
858 | 851 | { | ||
859 | 852 | if (pDock->container.iMouseX < icon->fDrawX + icon->fWidth * icon->fScale * fMargin) // on est a gauche. // fDrawXAtRest | ||
860 | 853 | { | ||
861 | 854 | Icon *prev_icon = cairo_dock_get_previous_element (ic, pDock->icons) -> data; | ||
862 | 855 | if ((cairo_dock_get_icon_order (icon) == cairo_dock_get_group_order (iGroup) || cairo_dock_get_icon_order (prev_icon) == cairo_dock_get_group_order (iGroup))) // && prev_icon->iAnimationType != CAIRO_DOCK_FOLLOW_MOUSE | ||
863 | 856 | { | ||
864 | 857 | make_icon_avoid_mouse (icon); | ||
865 | 858 | make_icon_avoid_mouse (prev_icon); | ||
866 | 859 | //g_print ("%s> <%s\n", prev_icon->cName, icon->cName); | ||
867 | 860 | bCanDrop = TRUE; | ||
868 | 861 | } | ||
869 | 862 | } | ||
870 | 863 | else if (pDock->container.iMouseX > icon->fDrawX + icon->fWidth * icon->fScale * (1 - fMargin)) // on est a droite. // fDrawXAtRest | ||
871 | 864 | { | ||
872 | 865 | Icon *next_icon = cairo_dock_get_next_element (ic, pDock->icons) -> data; | ||
873 | 866 | if ((icon->iGroup == iGroup || next_icon->iGroup == iGroup)) // && next_icon->iAnimationType != CAIRO_DOCK_FOLLOW_MOUSE | ||
874 | 867 | { | ||
875 | 868 | make_icon_avoid_mouse (icon); | ||
876 | 869 | make_icon_avoid_mouse (next_icon); | ||
877 | 870 | //g_print ("%s> <%s\n", icon->cName, next_icon->cName); | ||
878 | 871 | bCanDrop = TRUE; | ||
879 | 872 | } | ||
880 | 873 | ic = cairo_dock_get_next_element (ic, pDock->icons); // on la saute. | ||
881 | 874 | if (ic == pFirstDrawnElement) | ||
882 | 875 | break ; | ||
883 | 876 | } // else on est dessus. | ||
884 | 877 | } | ||
885 | 878 | else | ||
886 | 879 | cairo_dock_stop_marking_icon_as_avoiding_mouse (icon); | ||
887 | 880 | |||
888 | 881 | ic = cairo_dock_get_next_element (ic, pDock->icons); | ||
889 | 882 | } while (ic != pFirstDrawnElement); | ||
890 | 883 | |||
891 | 884 | return bCanDrop; | ||
892 | 885 | } | ||
893 | 886 | |||
894 | 887 | |||
895 | 888 | void cairo_dock_check_can_drop_linear (CairoDock *pDock) | ||
896 | 889 | { | ||
897 | 890 | if (pDock->icons == NULL) | ||
898 | 891 | return; | ||
899 | 892 | |||
900 | 893 | if (pDock->bIsDragging) | ||
901 | 894 | pDock->bCanDrop = _cairo_dock_check_can_drop_linear (pDock, pDock->iAvoidingMouseIconType, pDock->fAvoidingMouseMargin); | ||
902 | 895 | else | ||
903 | 896 | pDock->bCanDrop = FALSE; | ||
904 | 897 | } | ||
905 | 898 | |||
906 | 899 | void cairo_dock_stop_marking_icons (CairoDock *pDock) | ||
907 | 900 | { | ||
908 | 901 | if (pDock->icons == NULL) | ||
909 | 902 | return; | ||
910 | 903 | //g_print ("%s (%d)\n", __func__, iType); | ||
911 | 904 | |||
912 | 905 | Icon *icon; | ||
913 | 906 | GList *ic; | ||
914 | 907 | for (ic = pDock->icons; ic != NULL; ic = ic->next) | ||
915 | 908 | { | ||
916 | 909 | icon = ic->data; | ||
917 | 910 | cairo_dock_stop_marking_icon_as_avoiding_mouse (icon); | ||
918 | 911 | } | ||
919 | 912 | } | ||
920 | 913 | |||
921 | 914 | |||
922 | 915 | void cairo_dock_set_subdock_position_linear (Icon *pPointedIcon, CairoDock *pDock) | ||
923 | 916 | { | ||
924 | 917 | CairoDock *pSubDock = pPointedIcon->pSubDock; | ||
925 | 918 | int iX = pPointedIcon->fXAtRest - (pDock->fFlatDockWidth - pDock->iMaxDockWidth) / 2 + pPointedIcon->fWidth / 2 + (pDock->iOffsetForExtend * (pDock->fAlign - .5) * 2); | ||
926 | 919 | if (pSubDock->container.bIsHorizontal == pDock->container.bIsHorizontal) | ||
927 | 920 | { | ||
928 | 921 | pSubDock->fAlign = 0.5; | ||
929 | 922 | pSubDock->iGapX = iX + pDock->container.iWindowPositionX - (pDock->container.bIsHorizontal ? pDock->iScreenOffsetX : pDock->iScreenOffsetY) - g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] / 2; // ici les sous-dock ont un alignement egal a 0.5 | ||
930 | 923 | pSubDock->iGapY = pDock->iGapY + pDock->iMaxDockHeight; | ||
931 | 924 | } | ||
932 | 925 | else | ||
933 | 926 | { | ||
934 | 927 | pSubDock->fAlign = (pDock->container.bDirectionUp ? 1 : 0); | ||
935 | 928 | pSubDock->iGapX = (pDock->iGapY + pDock->iMaxDockHeight) * (pDock->container.bDirectionUp ? -1 : 1); | ||
936 | 929 | if (pDock->container.bDirectionUp) | ||
937 | 930 | pSubDock->iGapY = g_desktopGeometry.iScreenWidth[pDock->container.bIsHorizontal] - (iX + pDock->container.iWindowPositionX - (pDock->container.bIsHorizontal ? pDock->iScreenOffsetX : pDock->iScreenOffsetY)) - pSubDock->iMaxDockHeight / 2; // les sous-dock ont un alignement egal a 1. | ||
938 | 931 | else | ||
939 | 932 | pSubDock->iGapY = iX + pDock->container.iWindowPositionX - pSubDock->iMaxDockHeight / 2; // les sous-dock ont un alignement egal a 0. | ||
940 | 933 | } | ||
941 | 934 | } | ||
942 | 935 | |||
943 | 936 | |||
944 | 937 | GList *cairo_dock_get_first_drawn_element_linear (GList *icons) | ||
945 | 938 | { | ||
946 | 939 | Icon *icon; | ||
947 | 940 | GList *ic; | ||
948 | 941 | GList *pFirstDrawnElement = NULL; | ||
949 | 942 | for (ic = icons; ic != NULL; ic = ic->next) | ||
950 | 943 | { | ||
951 | 944 | icon = ic->data; | ||
952 | 945 | if (icon->bPointed) | ||
953 | 946 | break ; | ||
954 | 947 | } | ||
955 | 948 | |||
956 | 949 | if (ic == NULL || ic->next == NULL) // derniere icone ou aucune pointee. | ||
957 | 950 | pFirstDrawnElement = icons; | ||
958 | 951 | else | ||
959 | 952 | pFirstDrawnElement = ic->next; | ||
960 | 953 | return pFirstDrawnElement; | ||
961 | 954 | } | ||
962 | 955 | |||
963 | 956 | |||
964 | 957 | void cairo_dock_show_subdock (Icon *pPointedIcon, CairoDock *pParentDock) | ||
965 | 958 | { | ||
966 | 959 | cd_debug ("on montre le dock fils"); | ||
967 | 960 | CairoDock *pSubDock = pPointedIcon->pSubDock; | ||
968 | 961 | g_return_if_fail (pSubDock != NULL); | ||
969 | 962 | |||
970 | 963 | if (GTK_WIDGET_VISIBLE (pSubDock->container.pWidget)) // il est deja visible. | ||
971 | 964 | { | ||
972 | 965 | if (pSubDock->bIsShrinkingDown) // il est en cours de diminution, on renverse le processus. | ||
973 | 966 | { | ||
974 | 967 | cairo_dock_start_growing (pSubDock); | ||
975 | 968 | } | ||
976 | 969 | return ; | ||
977 | 970 | } | ||
978 | 971 | |||
979 | 972 | pSubDock->pRenderer->set_subdock_position (pPointedIcon, pParentDock); | ||
980 | 973 | if (pParentDock->fMagnitudeMax == 0) // son input shape n'est pas la taille max mais iMinDockHeight. | ||
981 | 974 | pSubDock->iGapY -= (pParentDock->container.iHeight - pParentDock->iMinDockHeight); | ||
982 | 975 | |||
983 | 976 | if (pSubDock->icons != NULL) | ||
984 | 977 | { | ||
985 | 978 | pSubDock->fFoldingFactor = (myDocksParam.bAnimateSubDock ? .99 : 0.); | ||
986 | 979 | cairo_dock_notify_on_object (&myIconsMgr, NOTIFICATION_UNFOLD_SUBDOCK, pPointedIcon); | ||
987 | 980 | cairo_dock_notify_on_object (pPointedIcon, NOTIFICATION_UNFOLD_SUBDOCK, pPointedIcon); | ||
988 | 981 | } | ||
989 | 982 | else | ||
990 | 983 | pSubDock->fFoldingFactor = 0.; | ||
991 | 984 | |||
992 | 985 | int iNewWidth = pSubDock->iMaxDockWidth; | ||
993 | 986 | int iNewHeight = pSubDock->iMaxDockHeight; | ||
994 | 987 | int iNewPositionX, iNewPositionY; | ||
995 | 988 | cairo_dock_get_window_position_at_balance (pSubDock, iNewWidth, iNewHeight, &iNewPositionX, &iNewPositionY); | ||
996 | 989 | |||
997 | 990 | gtk_window_present (GTK_WINDOW (pSubDock->container.pWidget)); | ||
998 | 991 | |||
999 | 992 | if (pSubDock->container.bIsHorizontal) | ||
1000 | 993 | gdk_window_move_resize (pSubDock->container.pWidget->window, | ||
1001 | 994 | iNewPositionX, | ||
1002 | 995 | iNewPositionY, | ||
1003 | 996 | iNewWidth, | ||
1004 | 997 | iNewHeight); | ||
1005 | 998 | else | ||
1006 | 999 | gdk_window_move_resize (pSubDock->container.pWidget->window, | ||
1007 | 1000 | iNewPositionY, | ||
1008 | 1001 | iNewPositionX, | ||
1009 | 1002 | iNewHeight, | ||
1010 | 1003 | iNewWidth); | ||
1011 | 1004 | |||
1012 | 1005 | if (pSubDock->fFoldingFactor == 0.) | ||
1013 | 1006 | { | ||
1014 | 1007 | cd_debug (" on montre le sous-dock sans animation"); | ||
1015 | 1008 | gtk_widget_queue_draw (pSubDock->container.pWidget); | ||
1016 | 1009 | } | ||
1017 | 1010 | else | ||
1018 | 1011 | { | ||
1019 | 1012 | cd_debug (" on montre le sous-dock avec animation"); | ||
1020 | 1013 | cairo_dock_start_growing (pSubDock); // on commence a faire grossir les icones. | ||
1021 | 1014 | pSubDock->pRenderer->calculate_icons (pSubDock); // on recalcule les icones car sinon le 1er dessin se fait avec les parametres tels qu'ils etaient lorsque le dock s'est cache; or l'animation de pliage peut prendre plus de temps que celle de cachage. | ||
1022 | 1015 | } | ||
1023 | 1016 | //g_print (" -> Gap %d;%d -> W(%d;%d) (%d)\n", pSubDock->iGapX, pSubDock->iGapY, pSubDock->container.iWindowPositionX, pSubDock->container.iWindowPositionY, pSubDock->container.bIsHorizontal); | ||
1024 | 1017 | |||
1025 | 1018 | ///gtk_window_set_keep_above (GTK_WINDOW (pSubDock->container.pWidget), myDocksParam.bPopUp); | ||
1026 | 1019 | |||
1027 | 1020 | cairo_dock_replace_all_dialogs (); | ||
1028 | 1021 | } | ||
1029 | 1022 | |||
1030 | 1023 | |||
1031 | 1024 | |||
1032 | 1025 | static gboolean _redraw_subdock_content_idle (Icon *pIcon) | ||
1033 | 1026 | { | ||
1034 | 1027 | cd_debug ("%s()", __func__); | ||
1035 | 1028 | cd_debug (" %s", pIcon->cName); | ||
1036 | 1029 | CairoDock *pDock = cairo_dock_search_dock_from_name (pIcon->cParentDockName); | ||
1037 | 1030 | if (pDock != NULL) | ||
1038 | 1031 | { | ||
1039 | 1032 | if (pIcon->pSubDock != NULL) | ||
1040 | 1033 | { | ||
1041 | 1034 | cairo_dock_draw_subdock_content_on_icon (pIcon, pDock); | ||
1042 | 1035 | } | ||
1043 | 1036 | else // l'icone a pu perdre son sous-dock entre-temps (exemple : une classe d'appli contenant 2 icones, dont on enleve l'une des 2. | ||
1044 | 1037 | { | ||
1045 | 1038 | cairo_dock_reload_icon_image (pIcon, CAIRO_CONTAINER (pDock)); | ||
1046 | 1039 | } | ||
1047 | 1040 | cairo_dock_redraw_icon (pIcon, CAIRO_CONTAINER (pDock)); | ||
1048 | 1041 | } | ||
1049 | 1042 | pIcon->iSidRedrawSubdockContent = 0; | ||
1050 | 1043 | return FALSE; | ||
1051 | 1044 | } | ||
1052 | 1045 | void cairo_dock_trigger_redraw_subdock_content (CairoDock *pDock) | ||
1053 | 1046 | { | ||
1054 | 1047 | Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (pDock, NULL); | ||
1055 | 1048 | if (pPointingIcon != NULL && (pPointingIcon->iSubdockViewType != 0 || (pPointingIcon->cClass != NULL && ! myIndicatorsParam.bUseClassIndic && (CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER (pPointingIcon) || CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pPointingIcon))))) | ||
1056 | 1049 | { | ||
1057 | 1050 | if (pPointingIcon->iSidRedrawSubdockContent != 0) // s'il y'a deja un redessin de prevu, on le passe a la fin de facon a ce qu'il ne se fasse pas avant le redessin de l'icone responsable de ce trigger. | ||
1058 | 1051 | g_source_remove (pPointingIcon->iSidRedrawSubdockContent); | ||
1059 | 1052 | pPointingIcon->iSidRedrawSubdockContent = g_idle_add ((GSourceFunc) _redraw_subdock_content_idle, pPointingIcon); | ||
1060 | 1053 | } | ||
1061 | 1054 | } | ||
1062 | 1055 | |||
1063 | 1056 | void cairo_dock_trigger_redraw_subdock_content_on_icon (Icon *icon) | ||
1064 | 1057 | { | ||
1065 | 1058 | if (icon->iSidRedrawSubdockContent == 0) | ||
1066 | 1059 | icon->iSidRedrawSubdockContent = g_idle_add ((GSourceFunc) _redraw_subdock_content_idle, icon); | ||
1067 | 1060 | } | ||
1068 | 1061 | |||
1069 | 1062 | void cairo_dock_redraw_subdock_content (CairoDock *pDock) | ||
1070 | 1063 | { | ||
1071 | 1064 | CairoDock *pParentDock = NULL; | ||
1072 | 1065 | Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (pDock, &pParentDock); | ||
1073 | 1066 | if (pPointingIcon != NULL && pPointingIcon->iSubdockViewType != 0 && pPointingIcon->iSidRedrawSubdockContent == 0 && pParentDock != NULL) | ||
1074 | 1067 | { | ||
1075 | 1068 | cairo_dock_draw_subdock_content_on_icon (pPointingIcon, pParentDock); | ||
1076 | 1069 | cairo_dock_redraw_icon (pPointingIcon, CAIRO_CONTAINER (pParentDock)); | ||
1077 | 1070 | } | ||
1078 | 1071 | } | ||
1079 | 1072 | |||
1080 | 1073 | static gboolean _update_WM_icons (CairoDock *pDock) | ||
1081 | 1074 | { | ||
1082 | 1075 | cairo_dock_set_icons_geometry_for_window_manager (pDock); | ||
1083 | 1076 | pDock->iSidUpdateWMIcons = 0; | ||
1084 | 1077 | return FALSE; | ||
1085 | 1078 | } | ||
1086 | 1079 | void cairo_dock_trigger_set_WM_icons_geometry (CairoDock *pDock) | ||
1087 | 1080 | { | ||
1088 | 1081 | if (pDock->iSidUpdateWMIcons == 0) | ||
1089 | 1082 | { | ||
1090 | 1083 | pDock->iSidUpdateWMIcons = g_idle_add ((GSourceFunc) _update_WM_icons, pDock); | ||
1091 | 1084 | } | ||
1092 | 1085 | } | ||
1093 | 1086 | |||
1094 | 1087 | |||
1095 | 1088 | /////////////////////// | ||
1096 | 1089 | /// DOCK BACKGROUND /// | ||
1097 | 1090 | /////////////////////// | ||
1098 | 1091 | |||
1099 | 1092 | static cairo_surface_t *_cairo_dock_make_stripes_background (int iWidth, int iHeight, double *fStripesColorBright, double *fStripesColorDark, int iNbStripes, double fStripesWidth, double fStripesAngle) | ||
1100 | 1093 | { | ||
1101 | 1094 | cairo_pattern_t *pStripesPattern; | ||
1102 | 1095 | double fWidth = iWidth; | ||
1103 | 1096 | if (fabs (fStripesAngle) != 90) | ||
1104 | 1097 | pStripesPattern = cairo_pattern_create_linear (0.0f, | ||
1105 | 1098 | 0.0f, | ||
1106 | 1099 | iWidth, | ||
1107 | 1100 | iWidth * tan (fStripesAngle * G_PI/180.)); | ||
1108 | 1101 | else | ||
1109 | 1102 | pStripesPattern = cairo_pattern_create_linear (0.0f, | ||
1110 | 1103 | 0.0f, | ||
1111 | 1104 | 0., | ||
1112 | 1105 | (fStripesAngle == 90) ? iHeight : - iHeight); | ||
1113 | 1106 | g_return_val_if_fail (cairo_pattern_status (pStripesPattern) == CAIRO_STATUS_SUCCESS, NULL); | ||
1114 | 1107 | |||
1115 | 1108 | cairo_pattern_set_extend (pStripesPattern, CAIRO_EXTEND_REPEAT); | ||
1116 | 1109 | |||
1117 | 1110 | if (iNbStripes > 0) | ||
1118 | 1111 | { | ||
1119 | 1112 | gdouble fStep; | ||
1120 | 1113 | int i; | ||
1121 | 1114 | for (i = 0; i < iNbStripes+1; i ++) | ||
1122 | 1115 | { | ||
1123 | 1116 | fStep = (double)i / iNbStripes; | ||
1124 | 1117 | cairo_pattern_add_color_stop_rgba (pStripesPattern, | ||
1125 | 1118 | fStep - fStripesWidth / 2., | ||
1126 | 1119 | fStripesColorBright[0], | ||
1127 | 1120 | fStripesColorBright[1], | ||
1128 | 1121 | fStripesColorBright[2], | ||
1129 | 1122 | fStripesColorBright[3]); | ||
1130 | 1123 | cairo_pattern_add_color_stop_rgba (pStripesPattern, | ||
1131 | 1124 | fStep, | ||
1132 | 1125 | fStripesColorDark[0], | ||
1133 | 1126 | fStripesColorDark[1], | ||
1134 | 1127 | fStripesColorDark[2], | ||
1135 | 1128 | fStripesColorDark[3]); | ||
1136 | 1129 | cairo_pattern_add_color_stop_rgba (pStripesPattern, | ||
1137 | 1130 | fStep + fStripesWidth / 2., | ||
1138 | 1131 | fStripesColorBright[0], | ||
1139 | 1132 | fStripesColorBright[1], | ||
1140 | 1133 | fStripesColorBright[2], | ||
1141 | 1134 | fStripesColorBright[3]); | ||
1142 | 1135 | } | ||
1143 | 1136 | } | ||
1144 | 1137 | else | ||
1145 | 1138 | { | ||
1146 | 1139 | cairo_pattern_add_color_stop_rgba (pStripesPattern, | ||
1147 | 1140 | 0., | ||
1148 | 1141 | fStripesColorDark[0], | ||
1149 | 1142 | fStripesColorDark[1], | ||
1150 | 1143 | fStripesColorDark[2], | ||
1151 | 1144 | fStripesColorDark[3]); | ||
1152 | 1145 | cairo_pattern_add_color_stop_rgba (pStripesPattern, | ||
1153 | 1146 | 1., | ||
1154 | 1147 | fStripesColorBright[0], | ||
1155 | 1148 | fStripesColorBright[1], | ||
1156 | 1149 | fStripesColorBright[2], | ||
1157 | 1150 | fStripesColorBright[3]); | ||
1158 | 1151 | } | ||
1159 | 1152 | |||
1160 | 1153 | cairo_surface_t *pNewSurface = cairo_dock_create_blank_surface ( | ||
1161 | 1154 | iWidth, | ||
1162 | 1155 | iHeight); | ||
1163 | 1156 | cairo_t *pImageContext = cairo_create (pNewSurface); | ||
1164 | 1157 | cairo_set_source (pImageContext, pStripesPattern); | ||
1165 | 1158 | cairo_paint (pImageContext); | ||
1166 | 1159 | |||
1167 | 1160 | cairo_pattern_destroy (pStripesPattern); | ||
1168 | 1161 | cairo_destroy (pImageContext); | ||
1169 | 1162 | |||
1170 | 1163 | return pNewSurface; | ||
1171 | 1164 | } | ||
1172 | 1165 | static void _cairo_dock_load_default_background (CairoDockImageBuffer *pImage, int iWidth, int iHeight) | ||
1173 | 1166 | { | ||
1174 | 1167 | //g_print ("%s (%s, %d)\n", __func__, myDocksParam.cBackgroundImageFile, myDocksParam.bBackgroundImageRepeat); | ||
1175 | 1168 | if (myDocksParam.cBackgroundImageFile != NULL) | ||
1176 | 1169 | { | ||
1177 | 1170 | if (myDocksParam.bBackgroundImageRepeat) | ||
1178 | 1171 | { | ||
1179 | 1172 | cairo_surface_t *pBgSurface = cairo_dock_create_surface_from_pattern (myDocksParam.cBackgroundImageFile, | ||
1180 | 1173 | iWidth, | ||
1181 | 1174 | iHeight, | ||
1182 | 1175 | myDocksParam.fBackgroundImageAlpha); | ||
1183 | 1176 | cairo_dock_load_image_buffer_from_surface (pImage, | ||
1184 | 1177 | pBgSurface, | ||
1185 | 1178 | iWidth, | ||
1186 | 1179 | iHeight); | ||
1187 | 1180 | } | ||
1188 | 1181 | else | ||
1189 | 1182 | { | ||
1190 | 1183 | cairo_dock_load_image_buffer_full (pImage, | ||
1191 | 1184 | myDocksParam.cBackgroundImageFile, | ||
1192 | 1185 | iWidth, | ||
1193 | 1186 | iHeight, | ||
1194 | 1187 | CAIRO_DOCK_FILL_SPACE, | ||
1195 | 1188 | myDocksParam.fBackgroundImageAlpha); | ||
1196 | 1189 | } | ||
1197 | 1190 | } | ||
1198 | 1191 | if (pImage->pSurface == NULL) | ||
1199 | 1192 | { | ||
1200 | 1193 | cairo_surface_t *pBgSurface = _cairo_dock_make_stripes_background ( | ||
1201 | 1194 | iWidth, | ||
1202 | 1195 | iHeight, | ||
1203 | 1196 | myDocksParam.fStripesColorBright, | ||
1204 | 1197 | myDocksParam.fStripesColorDark, | ||
1205 | 1198 | myDocksParam.iNbStripes, | ||
1206 | 1199 | myDocksParam.fStripesWidth, | ||
1207 | 1200 | myDocksParam.fStripesAngle); | ||
1208 | 1201 | cairo_dock_load_image_buffer_from_surface (pImage, | ||
1209 | 1202 | pBgSurface, | ||
1210 | 1203 | iWidth, | ||
1211 | 1204 | iHeight); | ||
1212 | 1205 | } | ||
1213 | 1206 | } | ||
1214 | 1207 | |||
1215 | 1208 | void cairo_dock_load_dock_background (CairoDock *pDock) | ||
1216 | 1209 | { | ||
1217 | 1210 | cairo_dock_unload_image_buffer (&pDock->backgroundBuffer); | ||
1218 | 1211 | |||
1219 | 1212 | int iWidth = pDock->iDecorationsWidth; | ||
1220 | 1213 | int iHeight = pDock->iDecorationsHeight; | ||
1221 | 1214 | |||
1222 | 1215 | if (pDock->bGlobalBg || pDock->iRefCount > 0) | ||
1223 | 1216 | { | ||
1224 | 1217 | _cairo_dock_load_default_background (&pDock->backgroundBuffer, iWidth, iHeight); | ||
1225 | 1218 | } | ||
1226 | 1219 | else if (pDock->cBgImagePath != NULL) | ||
1227 | 1220 | { | ||
1228 | 1221 | cairo_dock_load_image_buffer (&pDock->backgroundBuffer, pDock->cBgImagePath, iWidth, iHeight, CAIRO_DOCK_FILL_SPACE); | ||
1229 | 1222 | } | ||
1230 | 1223 | if (pDock->backgroundBuffer.pSurface == NULL) | ||
1231 | 1224 | { | ||
1232 | 1225 | cairo_surface_t *pSurface = _cairo_dock_make_stripes_background (iWidth, iHeight, pDock->fBgColorBright, pDock->fBgColorDark, 0, 0., 90); | ||
1233 | 1226 | cairo_dock_load_image_buffer_from_surface (&pDock->backgroundBuffer, pSurface, iWidth, iHeight); | ||
1234 | 1227 | } | ||
1235 | 1228 | } | ||
1236 | 1229 | |||
1237 | 1230 | static gboolean _load_background_idle (CairoDock *pDock) | ||
1238 | 1231 | { | ||
1239 | 1232 | cairo_dock_load_dock_background (pDock); | ||
1240 | 1233 | |||
1241 | 1234 | pDock->iSidLoadBg = 0; | ||
1242 | 1235 | return FALSE; | ||
1243 | 1236 | } | ||
1244 | 1237 | void cairo_dock_trigger_load_dock_background (CairoDock *pDock) | ||
1245 | 1238 | { | ||
1246 | 1239 | if (pDock->iDecorationsWidth == pDock->backgroundBuffer.iWidth && pDock->iDecorationsHeight == pDock->backgroundBuffer.iHeight) // mise a jour inutile. | ||
1247 | 1240 | return; | ||
1248 | 1241 | if (pDock->iSidLoadBg == 0) | ||
1249 | 1242 | pDock->iSidLoadBg = g_idle_add ((GSourceFunc)_load_background_idle, pDock); | ||
1250 | 1243 | } | ||
1251 | 1244 | 0 | ||
1252 | === modified file '.pc/applied-patches' | |||
1253 | --- .pc/applied-patches 2011-05-21 21:03:26 +0000 | |||
1254 | +++ .pc/applied-patches 2011-06-20 15:05:34 +0000 | |||
1255 | @@ -1,2 +1,1 @@ | |||
1256 | 1 | 01-default_theme_with_default_apps | 1 | 01-default_theme_with_default_apps |
1257 | 2 | 02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch | ||
1258 | 3 | 2 | ||
1259 | === modified file 'CMakeLists.txt' | |||
1260 | --- CMakeLists.txt 2011-05-21 21:03:26 +0000 | |||
1261 | +++ CMakeLists.txt 2011-06-20 15:05:34 +0000 | |||
1262 | @@ -10,7 +10,7 @@ | |||
1263 | 10 | ########### project ############### | 10 | ########### project ############### |
1264 | 11 | 11 | ||
1265 | 12 | project ("cairo-dock") | 12 | project ("cairo-dock") |
1267 | 13 | set (VERSION "2.3.0~2") | 13 | set (VERSION "2.3.0~3") |
1268 | 14 | 14 | ||
1269 | 15 | add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall | 15 | add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall |
1270 | 16 | if (NOT ${CMAKE_BUILD_TYPE}) | 16 | if (NOT ${CMAKE_BUILD_TYPE}) |
1271 | 17 | 17 | ||
1272 | === modified file 'debian/changelog' | |||
1273 | --- debian/changelog 2011-05-21 21:03:26 +0000 | |||
1274 | +++ debian/changelog 2011-06-20 15:05:34 +0000 | |||
1275 | @@ -1,3 +1,16 @@ | |||
1276 | 1 | cairo-dock (2.3.0~3-0ubuntu1) UNRELEASED; urgency=low | ||
1277 | 2 | |||
1278 | 3 | * New upstream release. (LP: #799773) | ||
1279 | 4 | * Upstream ChangeLog: | ||
1280 | 5 | - Fixed a crash that occurs when the MP applet is in desklet | ||
1281 | 6 | mode and applets separated from launchers | ||
1282 | 7 | and the music-player is launched. (LP: #797273) | ||
1283 | 8 | * debian/patches: | ||
1284 | 9 | - Removed 02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch | ||
1285 | 10 | (now in the upstream release) | ||
1286 | 11 | |||
1287 | 12 | -- Matthieu Baerts (matttbe) <matttbe@gmail.com> Mon, 20 Jun 2011 16:55:12 +0200 | ||
1288 | 13 | |||
1289 | 1 | cairo-dock (2.3.0~2-0ubuntu1) oneiric; urgency=low | 14 | cairo-dock (2.3.0~2-0ubuntu1) oneiric; urgency=low |
1290 | 2 | 15 | ||
1291 | 3 | * New upstream release. (LP: #786104) | 16 | * New upstream release. (LP: #786104) |
1292 | 4 | 17 | ||
1293 | === modified file 'debian/patches/01-default_theme_with_default_apps' | |||
1294 | --- debian/patches/01-default_theme_with_default_apps 2011-03-17 14:08:48 +0000 | |||
1295 | +++ debian/patches/01-default_theme_with_default_apps 2011-06-20 15:05:34 +0000 | |||
1296 | @@ -1,7 +1,7 @@ | |||
1297 | 1 | Index: cairo-dock/data/default-theme/launchers/01eog.desktop | 1 | Index: cairo-dock/data/default-theme/launchers/01eog.desktop |
1298 | 2 | =================================================================== | 2 | =================================================================== |
1299 | 3 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 3 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1301 | 4 | +++ cairo-dock/data/default-theme/launchers/01eog.desktop 2011-04-19 22:59:04.000000000 +0200 | 4 | +++ cairo-dock/data/default-theme/launchers/01eog.desktop 2011-06-19 18:02:00.744393000 +0200 |
1302 | 5 | @@ -0,0 +1,54 @@ | 5 | @@ -0,0 +1,54 @@ |
1303 | 6 | +#!en | 6 | +#!en |
1304 | 7 | + | 7 | + |
1305 | @@ -60,7 +60,7 @@ | |||
1306 | 60 | Index: cairo-dock/data/default-theme/launchers/01evolution.desktop | 60 | Index: cairo-dock/data/default-theme/launchers/01evolution.desktop |
1307 | 61 | =================================================================== | 61 | =================================================================== |
1308 | 62 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 62 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1310 | 63 | +++ cairo-dock/data/default-theme/launchers/01evolution.desktop 2011-04-19 22:59:04.000000000 +0200 | 63 | +++ cairo-dock/data/default-theme/launchers/01evolution.desktop 2011-06-19 18:02:00.744393000 +0200 |
1311 | 64 | @@ -0,0 +1,47 @@ | 64 | @@ -0,0 +1,47 @@ |
1312 | 65 | +#!en | 65 | +#!en |
1313 | 66 | + | 66 | + |
1314 | @@ -111,7 +111,7 @@ | |||
1315 | 111 | +X-Ubuntu-Gettext-Domain=evolution-2.32 | 111 | +X-Ubuntu-Gettext-Domain=evolution-2.32 |
1316 | 112 | Index: cairo-dock/data/default-theme/launchers/01f-spot.desktop | 112 | Index: cairo-dock/data/default-theme/launchers/01f-spot.desktop |
1317 | 113 | =================================================================== | 113 | =================================================================== |
1319 | 114 | --- cairo-dock.orig/data/default-theme/launchers/01f-spot.desktop 2011-04-19 22:58:37.817058474 +0200 | 114 | --- cairo-dock.orig/data/default-theme/launchers/01f-spot.desktop 2011-06-19 18:02:00.744393000 +0200 |
1320 | 115 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | 115 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1321 | 116 | @@ -1,53 +0,0 @@ | 116 | @@ -1,53 +0,0 @@ |
1322 | 117 | -#!en | 117 | -#!en |
1323 | @@ -169,7 +169,7 @@ | |||
1324 | 169 | -X-GNOME-DocPath=f-spot/f-spot.xml | 169 | -X-GNOME-DocPath=f-spot/f-spot.xml |
1325 | 170 | Index: cairo-dock/data/default-theme/launchers/01inkscape.desktop | 170 | Index: cairo-dock/data/default-theme/launchers/01inkscape.desktop |
1326 | 171 | =================================================================== | 171 | =================================================================== |
1328 | 172 | --- cairo-dock.orig/data/default-theme/launchers/01inkscape.desktop 2011-04-19 22:58:37.787058430 +0200 | 172 | --- cairo-dock.orig/data/default-theme/launchers/01inkscape.desktop 2011-06-19 18:02:00.744393000 +0200 |
1329 | 173 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | 173 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1330 | 174 | @@ -1,92 +0,0 @@ | 174 | @@ -1,92 +0,0 @@ |
1331 | 175 | -#!en | 175 | -#!en |
1332 | @@ -264,54 +264,10 @@ | |||
1333 | 264 | -MimeType=image/svg+xml;image/svg+xml-compressed; | 264 | -MimeType=image/svg+xml;image/svg+xml-compressed; |
1334 | 265 | -TryExec=inkscape | 265 | -TryExec=inkscape |
1335 | 266 | -StartupNotify=true | 266 | -StartupNotify=true |
1336 | 267 | Index: cairo-dock/data/default-theme/launchers/CMakeLists.txt | ||
1337 | 268 | =================================================================== | ||
1338 | 269 | --- cairo-dock.orig/data/default-theme/launchers/CMakeLists.txt 2011-04-19 22:58:37.707058307 +0200 | ||
1339 | 270 | +++ cairo-dock/data/default-theme/launchers/CMakeLists.txt 2011-04-19 22:59:04.000000000 +0200 | ||
1340 | 271 | @@ -8,10 +8,10 @@ | ||
1341 | 272 | 01gimp.desktop | ||
1342 | 273 | 01firefox.desktop | ||
1343 | 274 | 01gnome-terminal.desktop | ||
1344 | 275 | - 01f-spot.desktop | ||
1345 | 276 | - 01inkscape.desktop | ||
1346 | 277 | + 01shotwell.desktop | ||
1347 | 278 | + 01eog.desktop | ||
1348 | 279 | 01separator.desktop | ||
1349 | 280 | - 01thunderbird.desktop | ||
1350 | 281 | + 01evolution.desktop | ||
1351 | 282 | 02separator.desktop | ||
1352 | 283 | 03separator.desktop | ||
1353 | 284 | DESTINATION ${pkgdatadir}/themes/_default_/launchers) | ||
1354 | 285 | Index: cairo-dock/data/default-theme/plug-ins/GMenu/GMenu.conf | ||
1355 | 286 | =================================================================== | ||
1356 | 287 | --- cairo-dock.orig/data/default-theme/plug-ins/GMenu/GMenu.conf 2011-04-19 22:58:37.907058606 +0200 | ||
1357 | 288 | +++ cairo-dock/data/default-theme/plug-ins/GMenu/GMenu.conf 2011-04-19 22:59:04.000000000 +0200 | ||
1358 | 289 | @@ -17,7 +17,7 @@ | ||
1359 | 290 | |||
1360 | 291 | #S+ Image filename: | ||
1361 | 292 | #{Leave empty to use the default one.} | ||
1362 | 293 | -icon=alacarte | ||
1363 | 294 | +icon=distributor-logo | ||
1364 | 295 | |||
1365 | 296 | #j+[0;128] Desired icon size for this applet | ||
1366 | 297 | #{Set to 0 to use the default applet size} | ||
1367 | 298 | Index: cairo-dock/data/default-theme/plug-ins/musicPlayer/musicPlayer.conf | ||
1368 | 299 | =================================================================== | ||
1369 | 300 | --- cairo-dock.orig/data/default-theme/plug-ins/musicPlayer/musicPlayer.conf 2011-04-19 22:58:37.867058541 +0200 | ||
1370 | 301 | +++ cairo-dock/data/default-theme/plug-ins/musicPlayer/musicPlayer.conf 2011-04-19 22:59:04.000000000 +0200 | ||
1371 | 302 | @@ -107,7 +107,7 @@ | ||
1372 | 303 | #F[Audio Player;gtk-cdrom] | ||
1373 | 304 | frame_player= | ||
1374 | 305 | #L[Amarok 2;Audacious;Banshee;Clementine;Exaile;Exaile 0.3;GMusicBrowser;Guayadeque;Listen;Qmmp;QuodLibet;Rhythmbox;Songbird;XMMS 2;XMMS] Player to control: | ||
1375 | 306 | -current-player=Rhythmbox | ||
1376 | 307 | +current-player=Banshee | ||
1377 | 308 | |||
1378 | 309 | #b Steal the player's icon from the taskbar? | ||
1379 | 310 | #{This will prevent the player icon appearing in the taskbar. The applet's icon will then behave as a launcher, an application and an applet.} | ||
1380 | 311 | Index: cairo-dock/data/default-theme/launchers/01shotwell.desktop | 267 | Index: cairo-dock/data/default-theme/launchers/01shotwell.desktop |
1381 | 312 | =================================================================== | 268 | =================================================================== |
1382 | 313 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 269 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1384 | 314 | +++ cairo-dock/data/default-theme/launchers/01shotwell.desktop 2011-04-19 22:59:04.000000000 +0200 | 270 | +++ cairo-dock/data/default-theme/launchers/01shotwell.desktop 2011-06-19 18:02:00.744393000 +0200 |
1385 | 315 | @@ -0,0 +1,52 @@ | 271 | @@ -0,0 +1,52 @@ |
1386 | 316 | +#!en | 272 | +#!en |
1387 | 317 | + | 273 | + |
1388 | @@ -367,7 +323,7 @@ | |||
1389 | 367 | +X-Ayatana-Appmenu-Show-Stubs=false | 323 | +X-Ayatana-Appmenu-Show-Stubs=false |
1390 | 368 | Index: cairo-dock/data/default-theme/launchers/01thunderbird.desktop | 324 | Index: cairo-dock/data/default-theme/launchers/01thunderbird.desktop |
1391 | 369 | =================================================================== | 325 | =================================================================== |
1393 | 370 | --- cairo-dock.orig/data/default-theme/launchers/01thunderbird.desktop 2011-04-19 22:58:37.757058386 +0200 | 326 | --- cairo-dock.orig/data/default-theme/launchers/01thunderbird.desktop 2011-06-19 18:02:00.744393000 +0200 |
1394 | 371 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | 327 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1395 | 372 | @@ -1,58 +0,0 @@ | 328 | @@ -1,58 +0,0 @@ |
1396 | 373 | -#!en | 329 | -#!en |
1397 | @@ -428,3 +384,47 @@ | |||
1398 | 428 | -Comment[pl]=Czytanie i wysyłanie e-maili | 384 | -Comment[pl]=Czytanie i wysyłanie e-maili |
1399 | 429 | -Comment[pt_BR]=Ler e escrever suas mensagens | 385 | -Comment[pt_BR]=Ler e escrever suas mensagens |
1400 | 430 | -Comment[sv]=Läs och skriv e-post | 386 | -Comment[sv]=Läs och skriv e-post |
1401 | 387 | Index: cairo-dock/data/default-theme/launchers/CMakeLists.txt | ||
1402 | 388 | =================================================================== | ||
1403 | 389 | --- cairo-dock.orig/data/default-theme/launchers/CMakeLists.txt 2011-06-19 18:02:00.744393000 +0200 | ||
1404 | 390 | +++ cairo-dock/data/default-theme/launchers/CMakeLists.txt 2011-06-19 18:02:00.744393000 +0200 | ||
1405 | 391 | @@ -8,10 +8,10 @@ | ||
1406 | 392 | 01gimp.desktop | ||
1407 | 393 | 01firefox.desktop | ||
1408 | 394 | 01gnome-terminal.desktop | ||
1409 | 395 | - 01f-spot.desktop | ||
1410 | 396 | - 01inkscape.desktop | ||
1411 | 397 | + 01shotwell.desktop | ||
1412 | 398 | + 01eog.desktop | ||
1413 | 399 | 01separator.desktop | ||
1414 | 400 | - 01thunderbird.desktop | ||
1415 | 401 | + 01evolution.desktop | ||
1416 | 402 | 02separator.desktop | ||
1417 | 403 | 03separator.desktop | ||
1418 | 404 | DESTINATION ${pkgdatadir}/themes/_default_/launchers) | ||
1419 | 405 | Index: cairo-dock/data/default-theme/plug-ins/GMenu/GMenu.conf | ||
1420 | 406 | =================================================================== | ||
1421 | 407 | --- cairo-dock.orig/data/default-theme/plug-ins/GMenu/GMenu.conf 2011-06-19 18:02:00.744393000 +0200 | ||
1422 | 408 | +++ cairo-dock/data/default-theme/plug-ins/GMenu/GMenu.conf 2011-06-19 18:02:00.744393000 +0200 | ||
1423 | 409 | @@ -17,7 +17,7 @@ | ||
1424 | 410 | |||
1425 | 411 | #S+ Image filename: | ||
1426 | 412 | #{Leave empty to use the default one.} | ||
1427 | 413 | -icon=alacarte | ||
1428 | 414 | +icon=distributor-logo | ||
1429 | 415 | |||
1430 | 416 | #j+[0;128] Desired icon size for this applet | ||
1431 | 417 | #{Set to 0 to use the default applet size} | ||
1432 | 418 | Index: cairo-dock/data/default-theme/plug-ins/musicPlayer/musicPlayer.conf | ||
1433 | 419 | =================================================================== | ||
1434 | 420 | --- cairo-dock.orig/data/default-theme/plug-ins/musicPlayer/musicPlayer.conf 2011-06-19 18:02:00.744393000 +0200 | ||
1435 | 421 | +++ cairo-dock/data/default-theme/plug-ins/musicPlayer/musicPlayer.conf 2011-06-19 18:02:00.744393000 +0200 | ||
1436 | 422 | @@ -107,7 +107,7 @@ | ||
1437 | 423 | #F[Audio Player;gtk-cdrom] | ||
1438 | 424 | frame_player= | ||
1439 | 425 | #L[Amarok 2;Audacious;Banshee;Clementine;Exaile;Exaile 0.3;GMusicBrowser;Guayadeque;Listen;Qmmp;QuodLibet;Rhythmbox;Songbird;XMMS 2;XMMS] Player to control: | ||
1440 | 426 | -current-player=Rhythmbox | ||
1441 | 427 | +current-player=Banshee | ||
1442 | 428 | |||
1443 | 429 | #b Steal the player's icon from the taskbar? | ||
1444 | 430 | #{This will prevent the player icon appearing in the taskbar. The applet's icon will then behave as a launcher, an application and an applet.} | ||
1445 | 431 | 431 | ||
1446 | === removed file 'debian/patches/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch' | |||
1447 | --- debian/patches/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch 2011-05-21 21:03:26 +0000 | |||
1448 | +++ debian/patches/02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch 1970-01-01 00:00:00 +0000 | |||
1449 | @@ -1,25 +0,0 @@ | |||
1450 | 1 | From: Matthieu Baerts <matttbe@gmail.com> | ||
1451 | 2 | Subject: Fixed an annoying bug when we slowly leave the dock with the cursor on the edge of it | ||
1452 | 3 | Origin: upstream, http://bazaar.launchpad.net/~cairo-dock-team/cairo-dock-core/2.3.x/revision/757 | ||
1453 | 4 | Bug: http://www.glx-dock.org/tt_task.php?p=1&t=174 | ||
1454 | 5 | Forwarded: yes | ||
1455 | 6 | |||
1456 | 7 | Index: cairo-dock/src/gldit/cairo-dock-dock-facility.c | ||
1457 | 8 | =================================================================== | ||
1458 | 9 | --- cairo-dock.orig/src/gldit/cairo-dock-dock-facility.c 2011-05-21 10:52:15.504630255 +0200 | ||
1459 | 10 | +++ cairo-dock/src/gldit/cairo-dock-dock-facility.c 2011-05-21 10:52:38.494663981 +0200 | ||
1460 | 11 | @@ -760,11 +760,10 @@ | ||
1461 | 12 | } | ||
1462 | 13 | else | ||
1463 | 14 | { | ||
1464 | 15 | - double fSideMargin = fabs (pDock->fAlign - .5) * (iWidth - pDock->fFlatDockWidth); | ||
1465 | 16 | - if (x_abs < - fSideMargin || x_abs > pDock->fFlatDockWidth + fSideMargin) | ||
1466 | 17 | - iMousePositionType = CAIRO_DOCK_MOUSE_OUTSIDE; | ||
1467 | 18 | - else | ||
1468 | 19 | + if (iMouseY >= 0 && iMouseY < iHeight) | ||
1469 | 20 | iMousePositionType = CAIRO_DOCK_MOUSE_ON_THE_EDGE; | ||
1470 | 21 | + else | ||
1471 | 22 | + iMousePositionType = CAIRO_DOCK_MOUSE_OUTSIDE; | ||
1472 | 23 | } | ||
1473 | 24 | } | ||
1474 | 25 | else if (iMouseY >= 0 && iMouseY < iHeight) // et en plus on est dedans en y. // && pPointedIcon != NULL | ||
1475 | 26 | 0 | ||
1476 | === modified file 'debian/patches/series' | |||
1477 | --- debian/patches/series 2011-05-21 21:03:26 +0000 | |||
1478 | +++ debian/patches/series 2011-06-20 15:05:34 +0000 | |||
1479 | @@ -1,2 +1,1 @@ | |||
1480 | 1 | 01-default_theme_with_default_apps | 1 | 01-default_theme_with_default_apps |
1481 | 2 | 02-mouse-leaves-on-the-edge_upstream-version-2.3.0~2.1.patch | ||
1482 | 3 | 2 | ||
1483 | === modified file 'src/gldit/cairo-dock-class-manager.c' | |||
1484 | --- src/gldit/cairo-dock-class-manager.c 2011-03-17 14:08:48 +0000 | |||
1485 | +++ src/gldit/cairo-dock-class-manager.c 2011-06-20 15:05:34 +0000 | |||
1486 | @@ -1004,7 +1004,9 @@ | |||
1487 | 1004 | if (CAIRO_DOCK_ICON_TYPE_IS_APPLET (pInhibitorIcon) && myIconsParam.iSeparateIcons) | 1004 | if (CAIRO_DOCK_ICON_TYPE_IS_APPLET (pInhibitorIcon) && myIconsParam.iSeparateIcons) |
1488 | 1005 | continue; | 1005 | continue; |
1489 | 1006 | pDock = cairo_dock_search_dock_from_name (pInhibitorIcon->cParentDockName); | 1006 | pDock = cairo_dock_search_dock_from_name (pInhibitorIcon->cParentDockName); |
1491 | 1007 | if (!pDock || !pDock->bIsMainDock) | 1007 | if (!pDock) // not inside a dock, for instance a desklet; no interest for us here. |
1492 | 1008 | continue; | ||
1493 | 1009 | if (pDock->iRefCount != 0) // inside a sub-dock, take the pointing icon inside the main dock. | ||
1494 | 1008 | pInhibitorIcon = cairo_dock_search_icon_pointing_on_dock (pDock, NULL); | 1010 | pInhibitorIcon = cairo_dock_search_icon_pointing_on_dock (pDock, NULL); |
1495 | 1009 | pSameClassIcon = pInhibitorIcon; | 1011 | pSameClassIcon = pInhibitorIcon; |
1496 | 1010 | if (CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pSameClassIcon)) // on prend les lanceurs de preference. | 1012 | if (CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pSameClassIcon)) // on prend les lanceurs de preference. |
1497 | 1011 | 1013 | ||
1498 | === modified file 'src/gldit/cairo-dock-dock-manager.c' | |||
1499 | --- src/gldit/cairo-dock-dock-manager.c 2011-05-20 23:13:48 +0000 | |||
1500 | +++ src/gldit/cairo-dock-dock-manager.c 2011-06-20 15:05:34 +0000 | |||
1501 | @@ -372,7 +372,7 @@ | |||
1502 | 372 | } | 372 | } |
1503 | 373 | Icon *cairo_dock_search_icon_pointing_on_dock (CairoDock *pDock, CairoDock **pParentDock) // pParentDock peut etre NULL. | 373 | Icon *cairo_dock_search_icon_pointing_on_dock (CairoDock *pDock, CairoDock **pParentDock) // pParentDock peut etre NULL. |
1504 | 374 | { | 374 | { |
1506 | 375 | if (pDock->bIsMainDock) // par definition. On n'utilise pas iRefCount, car si on est en train de detruire un dock, sa reference est deja decrementee. C'est dommage mais c'est comme ca. | 375 | if (pDock == NULL || pDock->bIsMainDock) // par definition. On n'utilise pas iRefCount, car si on est en train de detruire un dock, sa reference est deja decrementee. C'est dommage mais c'est comme ca. |
1507 | 376 | return NULL; | 376 | return NULL; |
1508 | 377 | Icon *pPointingIcon = NULL; | 377 | Icon *pPointingIcon = NULL; |
1509 | 378 | gpointer data[3] = {pDock, &pPointingIcon, pParentDock}; | 378 | gpointer data[3] = {pDock, &pPointingIcon, pParentDock}; |