Merge lp:~canonical-dx-team/unity/unity.shimmer into lp:unity
- unity.shimmer
- Merge into trunk
Proposed by
Jason Smith
Status: | Merged |
---|---|
Merged at revision: | 635 |
Proposed branch: | lp:~canonical-dx-team/unity/unity.shimmer |
Merge into: | lp:unity |
Diff against target: |
350 lines (+131/-65) 5 files modified
src/Launcher.cpp (+79/-52) src/Launcher.h (+12/-8) src/LauncherController.cpp (+9/-5) src/LauncherIcon.cpp (+22/-0) src/LauncherIcon.h (+9/-0) |
To merge this branch: | bzr merge lp:~canonical-dx-team/unity/unity.shimmer |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sam Spilsbury (community) | Approve | ||
Review via email:
|
Commit message
Description of the change
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 | === modified file 'src/Launcher.cpp' | |||
2 | --- src/Launcher.cpp 2010-11-25 07:33:42 +0000 | |||
3 | +++ src/Launcher.cpp 2010-11-25 23:52:43 +0000 | |||
4 | @@ -331,24 +331,28 @@ | |||
5 | 331 | 331 | ||
6 | 332 | bool Launcher::IconNeedsAnimation (LauncherIcon *icon, struct timespec current) | 332 | bool Launcher::IconNeedsAnimation (LauncherIcon *icon, struct timespec current) |
7 | 333 | { | 333 | { |
26 | 334 | struct timespec visible_time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_VISIBLE); | 334 | struct timespec time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_VISIBLE); |
27 | 335 | if (TimeDelta (¤t, &visible_time) < ANIM_DURATION_SHORT) | 335 | if (TimeDelta (¤t, &time) < ANIM_DURATION_SHORT) |
28 | 336 | return true; | 336 | return true; |
29 | 337 | 337 | ||
30 | 338 | struct timespec running_time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_RUNNING); | 338 | time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_RUNNING); |
31 | 339 | if (TimeDelta (¤t, &running_time) < ANIM_DURATION_SHORT) | 339 | if (TimeDelta (¤t, &time) < ANIM_DURATION_SHORT) |
32 | 340 | return true; | 340 | return true; |
33 | 341 | 341 | ||
34 | 342 | struct timespec starting_time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING); | 342 | time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_STARTING); |
35 | 343 | if (TimeDelta (¤t, &starting_time) < (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2)) | 343 | if (TimeDelta (¤t, &time) < (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2)) |
36 | 344 | return true; | 344 | return true; |
37 | 345 | 345 | ||
38 | 346 | struct timespec urgent_time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_URGENT); | 346 | time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_URGENT); |
39 | 347 | if (TimeDelta (¤t, &urgent_time) < (ANIM_DURATION_LONG * URGENT_BLINKS * 2)) | 347 | if (TimeDelta (¤t, &time) < (ANIM_DURATION_LONG * URGENT_BLINKS * 2)) |
40 | 348 | return true; | 348 | return true; |
41 | 349 | 349 | ||
42 | 350 | struct timespec present_time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_PRESENTED); | 350 | time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_PRESENTED); |
43 | 351 | if (TimeDelta (¤t, &present_time) < ANIM_DURATION) | 351 | if (TimeDelta (¤t, &time) < ANIM_DURATION) |
44 | 352 | return true; | ||
45 | 353 | |||
46 | 354 | time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_SHIMMER); | ||
47 | 355 | if (TimeDelta (¤t, &time) < ANIM_DURATION_LONG) | ||
48 | 352 | return true; | 356 | return true; |
49 | 353 | 357 | ||
50 | 354 | return false; | 358 | return false; |
51 | @@ -481,6 +485,13 @@ | |||
52 | 481 | return 1.0f - result; | 485 | return 1.0f - result; |
53 | 482 | } | 486 | } |
54 | 483 | 487 | ||
55 | 488 | float Launcher::IconShimmerProgress (LauncherIcon *icon, struct timespec current) | ||
56 | 489 | { | ||
57 | 490 | struct timespec shimmer_time = icon->GetQuirkTime (LAUNCHER_ICON_QUIRK_SHIMMER); | ||
58 | 491 | int shimmer_ms = TimeDelta (¤t, &shimmer_time); | ||
59 | 492 | return CLAMP ((float) shimmer_ms / (float) ANIM_DURATION_LONG, 0.0f, 1.0f); | ||
60 | 493 | } | ||
61 | 494 | |||
62 | 484 | float Launcher::IconUrgentPulseValue (LauncherIcon *icon, struct timespec current) | 495 | float Launcher::IconUrgentPulseValue (LauncherIcon *icon, struct timespec current) |
63 | 485 | { | 496 | { |
64 | 486 | if (!icon->GetQuirk (LAUNCHER_ICON_QUIRK_URGENT)) | 497 | if (!icon->GetQuirk (LAUNCHER_ICON_QUIRK_URGENT)) |
65 | @@ -530,6 +541,29 @@ | |||
66 | 530 | return result; | 541 | return result; |
67 | 531 | } | 542 | } |
68 | 532 | 543 | ||
69 | 544 | void Launcher::SetupRenderArg (LauncherIcon *icon, struct timespec current, RenderArg &arg) | ||
70 | 545 | { | ||
71 | 546 | arg.icon = icon; | ||
72 | 547 | arg.alpha = 1.0f; | ||
73 | 548 | arg.running_arrow = false; | ||
74 | 549 | arg.active_arrow = icon->GetQuirk (LAUNCHER_ICON_QUIRK_ACTIVE); | ||
75 | 550 | arg.folding_rads = 0.0f; | ||
76 | 551 | arg.skip = false; | ||
77 | 552 | |||
78 | 553 | arg.window_indicators = MIN (4, icon->RelatedWindows ()); | ||
79 | 554 | |||
80 | 555 | // we dont need to show strays | ||
81 | 556 | if (arg.window_indicators == 1 || !icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING)) | ||
82 | 557 | arg.window_indicators = 0; | ||
83 | 558 | |||
84 | 559 | arg.backlight_intensity = IconBackgroundIntensity (icon, current); | ||
85 | 560 | arg.shimmer_progress = IconShimmerProgress (icon, current); | ||
86 | 561 | |||
87 | 562 | float urgent_progress = IconUrgentProgress (icon, current); | ||
88 | 563 | urgent_progress = CLAMP (urgent_progress * 3, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle | ||
89 | 564 | arg.glow_intensity = urgent_progress; | ||
90 | 565 | } | ||
91 | 566 | |||
92 | 533 | void Launcher::RenderArgs (std::list<Launcher::RenderArg> &launcher_args, | 567 | void Launcher::RenderArgs (std::list<Launcher::RenderArg> &launcher_args, |
93 | 534 | std::list<Launcher::RenderArg> &shelf_args, | 568 | std::list<Launcher::RenderArg> &shelf_args, |
94 | 535 | nux::Geometry &box_geo, nux::Geometry &shelf_geo) | 569 | nux::Geometry &box_geo, nux::Geometry &shelf_geo) |
95 | @@ -648,24 +682,7 @@ | |||
96 | 648 | RenderArg arg; | 682 | RenderArg arg; |
97 | 649 | LauncherIcon *icon = *it; | 683 | LauncherIcon *icon = *it; |
98 | 650 | 684 | ||
117 | 651 | arg.icon = icon; | 685 | SetupRenderArg (icon, current, arg); |
100 | 652 | arg.alpha = 1.0f; | ||
101 | 653 | arg.running_arrow = false; | ||
102 | 654 | arg.active_arrow = icon->GetQuirk (LAUNCHER_ICON_QUIRK_ACTIVE); | ||
103 | 655 | arg.folding_rads = 0.0f; | ||
104 | 656 | arg.skip = false; | ||
105 | 657 | |||
106 | 658 | arg.window_indicators = MIN (4, icon->RelatedWindows ()); | ||
107 | 659 | |||
108 | 660 | // we dont need to show strays | ||
109 | 661 | if (arg.window_indicators == 1 || !icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING)) | ||
110 | 662 | arg.window_indicators = 0; | ||
111 | 663 | |||
112 | 664 | arg.backlight_intensity = IconBackgroundIntensity (icon, current); | ||
113 | 665 | |||
114 | 666 | float urgent_progress = IconUrgentProgress (icon, current); | ||
115 | 667 | urgent_progress = CLAMP (urgent_progress * 3, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle | ||
116 | 668 | arg.glow_intensity = urgent_progress; | ||
118 | 669 | 686 | ||
119 | 670 | // reset z | 687 | // reset z |
120 | 671 | center.z = 0; | 688 | center.z = 0; |
121 | @@ -721,22 +738,8 @@ | |||
122 | 721 | { | 738 | { |
123 | 722 | RenderArg arg; | 739 | RenderArg arg; |
124 | 723 | LauncherIcon *icon = *it; | 740 | LauncherIcon *icon = *it; |
141 | 724 | 741 | ||
142 | 725 | arg.icon = icon; | 742 | SetupRenderArg (icon, current, arg); |
127 | 726 | arg.alpha = 1.0f; | ||
128 | 727 | arg.glow_intensity = 0.0f; | ||
129 | 728 | arg.running_arrow = false; | ||
130 | 729 | arg.active_arrow = icon->GetQuirk (LAUNCHER_ICON_QUIRK_ACTIVE); | ||
131 | 730 | arg.folding_rads = 0.0f; | ||
132 | 731 | arg.skip = false; | ||
133 | 732 | |||
134 | 733 | arg.window_indicators = MIN (4, icon->RelatedWindows ()); | ||
135 | 734 | |||
136 | 735 | // we dont need to show strays | ||
137 | 736 | if (arg.window_indicators == 1 || !icon->GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING)) | ||
138 | 737 | arg.window_indicators = 0; | ||
139 | 738 | |||
140 | 739 | arg.backlight_intensity = IconBackgroundIntensity (icon, current); | ||
143 | 740 | 743 | ||
144 | 741 | // reset z | 744 | // reset z |
145 | 742 | center.z = 0; | 745 | center.z = 0; |
146 | @@ -1241,6 +1244,30 @@ | |||
147 | 1241 | geo, | 1244 | geo, |
148 | 1242 | false); | 1245 | false); |
149 | 1243 | } | 1246 | } |
150 | 1247 | |||
151 | 1248 | if (arg.shimmer_progress > 0.0f && arg.shimmer_progress < 1.0f) | ||
152 | 1249 | { | ||
153 | 1250 | nux::Geometry base = GetGeometry (); | ||
154 | 1251 | int x1 = base.x + base.width; | ||
155 | 1252 | int x2 = base.x + base.width; | ||
156 | 1253 | float shimmer_constant = 1.9f; | ||
157 | 1254 | |||
158 | 1255 | x1 -= geo.width * arg.shimmer_progress * shimmer_constant; | ||
159 | 1256 | GfxContext.PushClippingRectangle(nux::Geometry (x1, geo.y, x2 - x1, geo.height)); | ||
160 | 1257 | |||
161 | 1258 | float fade_out = 1.0f - CLAMP (((x2 - x1) - geo.width) / (geo.width * (shimmer_constant - 1.0f)), 0.0f, 1.0f); | ||
162 | 1259 | |||
163 | 1260 | RenderIcon(GfxContext, | ||
164 | 1261 | arg, | ||
165 | 1262 | _icon_glow_texture, | ||
166 | 1263 | arg.icon->GlowColor (), | ||
167 | 1264 | fade_out, | ||
168 | 1265 | arg.icon->_xform_coords["Glow"], | ||
169 | 1266 | geo, | ||
170 | 1267 | false); | ||
171 | 1268 | |||
172 | 1269 | GfxContext.PopClippingRectangle(); | ||
173 | 1270 | } | ||
174 | 1244 | } | 1271 | } |
175 | 1245 | 1272 | ||
176 | 1246 | void Launcher::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) | 1273 | void Launcher::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) |
177 | 1247 | 1274 | ||
178 | === modified file 'src/Launcher.h' | |||
179 | --- src/Launcher.h 2010-11-25 01:55:23 +0000 | |||
180 | +++ src/Launcher.h 2010-11-25 23:52:43 +0000 | |||
181 | @@ -23,7 +23,7 @@ | |||
182 | 23 | #include <sys/time.h> | 23 | #include <sys/time.h> |
183 | 24 | 24 | ||
184 | 25 | #include <Nux/View.h> | 25 | #include <Nux/View.h> |
186 | 26 | #include <Nux/BaseWindow.h> | 26 | #include <Nux/BaseWindow.h> |
187 | 27 | #include "Introspectable.h" | 27 | #include "Introspectable.h" |
188 | 28 | #include "LauncherIcon.h" | 28 | #include "LauncherIcon.h" |
189 | 29 | #include "NuxGraphics/IOpenGLAsmShader.h" | 29 | #include "NuxGraphics/IOpenGLAsmShader.h" |
190 | @@ -65,20 +65,20 @@ | |||
191 | 65 | virtual void RecvMouseEnter(int x, int y, unsigned long button_flags, unsigned long key_flags); | 65 | virtual void RecvMouseEnter(int x, int y, unsigned long button_flags, unsigned long key_flags); |
192 | 66 | virtual void RecvMouseLeave(int x, int y, unsigned long button_flags, unsigned long key_flags); | 66 | virtual void RecvMouseLeave(int x, int y, unsigned long button_flags, unsigned long key_flags); |
193 | 67 | virtual void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags); | 67 | virtual void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags); |
196 | 68 | virtual void RecvMouseWheel(int x, int y, int wheel_delta, unsigned long button_flags, unsigned long key_flags); | 68 | virtual void RecvMouseWheel(int x, int y, int wheel_delta, unsigned long button_flags, unsigned long key_flags); |
197 | 69 | 69 | ||
198 | 70 | //! Called by LauncherIcon to signal that a Quicklist is becoming active. | 70 | //! Called by LauncherIcon to signal that a Quicklist is becoming active. |
199 | 71 | void SetActiveQuicklist (QuicklistView *quicklist); | 71 | void SetActiveQuicklist (QuicklistView *quicklist); |
200 | 72 | //! Get the active qicklist | 72 | //! Get the active qicklist |
201 | 73 | QuicklistView *GetActiveQuicklist (); | 73 | QuicklistView *GetActiveQuicklist (); |
202 | 74 | //! Called by LauncherIcon to signal that a Quicklist is becoming unactive. | 74 | //! Called by LauncherIcon to signal that a Quicklist is becoming unactive. |
203 | 75 | void CancelActiveQuicklist (QuicklistView *quicklist); | 75 | void CancelActiveQuicklist (QuicklistView *quicklist); |
208 | 76 | 76 | ||
209 | 77 | protected: | 77 | protected: |
210 | 78 | // Introspectable methods | 78 | // Introspectable methods |
211 | 79 | const gchar* GetName (); | 79 | const gchar* GetName (); |
212 | 80 | void AddProperties (GVariantBuilder *builder); | 80 | void AddProperties (GVariantBuilder *builder); |
214 | 81 | 81 | ||
215 | 82 | private: | 82 | private: |
216 | 83 | typedef enum | 83 | typedef enum |
217 | 84 | { | 84 | { |
218 | @@ -101,6 +101,7 @@ | |||
219 | 101 | float alpha; | 101 | float alpha; |
220 | 102 | float backlight_intensity; | 102 | float backlight_intensity; |
221 | 103 | float glow_intensity; | 103 | float glow_intensity; |
222 | 104 | float shimmer_progress; | ||
223 | 104 | bool running_arrow; | 105 | bool running_arrow; |
224 | 105 | bool active_arrow; | 106 | bool active_arrow; |
225 | 106 | bool skip; | 107 | bool skip; |
226 | @@ -126,6 +127,7 @@ | |||
227 | 126 | float AutohideProgress (); | 127 | float AutohideProgress (); |
228 | 127 | float IconPresentProgress (LauncherIcon *icon, struct timespec current); | 128 | float IconPresentProgress (LauncherIcon *icon, struct timespec current); |
229 | 128 | float IconUrgentProgress (LauncherIcon *icon, struct timespec current); | 129 | float IconUrgentProgress (LauncherIcon *icon, struct timespec current); |
230 | 130 | float IconShimmerProgress (LauncherIcon *icon, struct timespec current); | ||
231 | 129 | float IconUrgentPulseValue (LauncherIcon *icon, struct timespec current); | 131 | float IconUrgentPulseValue (LauncherIcon *icon, struct timespec current); |
232 | 130 | float IconStartingPulseValue (LauncherIcon *icon, struct timespec current); | 132 | float IconStartingPulseValue (LauncherIcon *icon, struct timespec current); |
233 | 131 | float IconBackgroundIntensity (LauncherIcon *icon, struct timespec current); | 133 | float IconBackgroundIntensity (LauncherIcon *icon, struct timespec current); |
234 | @@ -135,6 +137,8 @@ | |||
235 | 135 | void SetHidden (bool hidden); | 137 | void SetHidden (bool hidden); |
236 | 136 | 138 | ||
237 | 137 | void SetDndDelta (float x, float y, nux::Geometry geo, struct timespec current); | 139 | void SetDndDelta (float x, float y, nux::Geometry geo, struct timespec current); |
238 | 140 | |||
239 | 141 | void SetupRenderArg (LauncherIcon *icon, struct timespec current, RenderArg &arg); | ||
240 | 138 | void RenderArgs (std::list<Launcher::RenderArg> &launcher_args, | 142 | void RenderArgs (std::list<Launcher::RenderArg> &launcher_args, |
241 | 139 | std::list<Launcher::RenderArg> &shelf_args, | 143 | std::list<Launcher::RenderArg> &shelf_args, |
242 | 140 | nux::Geometry &box_geo, nux::Geometry &shelf_geo); | 144 | nux::Geometry &box_geo, nux::Geometry &shelf_geo); |
243 | 141 | 145 | ||
244 | === modified file 'src/LauncherController.cpp' | |||
245 | --- src/LauncherController.cpp 2010-11-25 05:40:01 +0000 | |||
246 | +++ src/LauncherController.cpp 2010-11-25 23:52:43 +0000 | |||
247 | @@ -52,24 +52,28 @@ | |||
248 | 52 | LauncherController::PresentIconOwningWindow (Window window) | 52 | LauncherController::PresentIconOwningWindow (Window window) |
249 | 53 | { | 53 | { |
250 | 54 | LauncherModel::iterator it; | 54 | LauncherModel::iterator it; |
251 | 55 | LauncherIcon *owner = 0; | ||
252 | 55 | 56 | ||
253 | 56 | for (it = _model->begin (); it != _model->end (); it++) | 57 | for (it = _model->begin (); it != _model->end (); it++) |
254 | 57 | { | 58 | { |
255 | 58 | if ((*it)->IconOwnsWindow (window)) | 59 | if ((*it)->IconOwnsWindow (window)) |
256 | 59 | { | 60 | { |
259 | 60 | (*it)->Present (2, 600); | 61 | owner = *it; |
260 | 61 | return; | 62 | break; |
261 | 62 | } | 63 | } |
262 | 63 | } | 64 | } |
263 | 64 | 65 | ||
265 | 65 | for (it = _model->shelf_begin (); it != _model->shelf_end (); it++) | 66 | for (it = _model->shelf_begin (); !owner && it != _model->shelf_end (); it++) |
266 | 66 | { | 67 | { |
267 | 67 | if ((*it)->IconOwnsWindow (window)) | 68 | if ((*it)->IconOwnsWindow (window)) |
268 | 68 | { | 69 | { |
271 | 69 | (*it)->Present (2, 600); | 70 | owner = *it; |
272 | 70 | return; | 71 | break; |
273 | 71 | } | 72 | } |
274 | 72 | } | 73 | } |
275 | 74 | |||
276 | 75 | owner->Present (2, 600); | ||
277 | 76 | owner->UpdateQuirkTimeDelayed (300, LAUNCHER_ICON_QUIRK_SHIMMER); | ||
278 | 73 | } | 77 | } |
279 | 74 | 78 | ||
280 | 75 | void | 79 | void |
281 | 76 | 80 | ||
282 | === modified file 'src/LauncherIcon.cpp' | |||
283 | --- src/LauncherIcon.cpp 2010-11-25 16:23:26 +0000 | |||
284 | +++ src/LauncherIcon.cpp 2010-11-25 23:52:43 +0000 | |||
285 | @@ -512,6 +512,28 @@ | |||
286 | 512 | Present (1, 1500); | 512 | Present (1, 1500); |
287 | 513 | } | 513 | } |
288 | 514 | 514 | ||
289 | 515 | gboolean | ||
290 | 516 | LauncherIcon::OnDelayedUpdateTimeout (gpointer data) | ||
291 | 517 | { | ||
292 | 518 | DelayedUpdateArg *arg = (DelayedUpdateArg *) data; | ||
293 | 519 | LauncherIcon *self = arg->self; | ||
294 | 520 | |||
295 | 521 | clock_gettime (CLOCK_MONOTONIC, &(self->_quirk_times[arg->quirk])); | ||
296 | 522 | self->needs_redraw.emit (self); | ||
297 | 523 | |||
298 | 524 | return false; | ||
299 | 525 | } | ||
300 | 526 | |||
301 | 527 | void | ||
302 | 528 | LauncherIcon::UpdateQuirkTimeDelayed (guint ms, LauncherIconQuirk quirk) | ||
303 | 529 | { | ||
304 | 530 | DelayedUpdateArg *arg = new DelayedUpdateArg (); | ||
305 | 531 | arg->self = this; | ||
306 | 532 | arg->quirk = quirk; | ||
307 | 533 | |||
308 | 534 | g_timeout_add (ms, &LauncherIcon::OnDelayedUpdateTimeout, arg); | ||
309 | 535 | } | ||
310 | 536 | |||
311 | 515 | void | 537 | void |
312 | 516 | LauncherIcon::UpdateQuirkTime (LauncherIconQuirk quirk) | 538 | LauncherIcon::UpdateQuirkTime (LauncherIconQuirk quirk) |
313 | 517 | { | 539 | { |
314 | 518 | 540 | ||
315 | === modified file 'src/LauncherIcon.h' | |||
316 | --- src/LauncherIcon.h 2010-11-25 16:23:26 +0000 | |||
317 | +++ src/LauncherIcon.h 2010-11-25 23:52:43 +0000 | |||
318 | @@ -58,6 +58,7 @@ | |||
319 | 58 | LAUNCHER_ICON_QUIRK_URGENT, | 58 | LAUNCHER_ICON_QUIRK_URGENT, |
320 | 59 | LAUNCHER_ICON_QUIRK_PRESENTED, | 59 | LAUNCHER_ICON_QUIRK_PRESENTED, |
321 | 60 | LAUNCHER_ICON_QUIRK_STARTING, | 60 | LAUNCHER_ICON_QUIRK_STARTING, |
322 | 61 | LAUNCHER_ICON_QUIRK_SHIMMER, | ||
323 | 61 | 62 | ||
324 | 62 | LAUNCHER_ICON_QUIRK_LAST, | 63 | LAUNCHER_ICON_QUIRK_LAST, |
325 | 63 | } LauncherIconQuirk; | 64 | } LauncherIconQuirk; |
326 | @@ -116,6 +117,7 @@ | |||
327 | 116 | protected: | 117 | protected: |
328 | 117 | void SetQuirk (LauncherIconQuirk quirk, bool value); | 118 | void SetQuirk (LauncherIconQuirk quirk, bool value); |
329 | 118 | 119 | ||
330 | 120 | void UpdateQuirkTimeDelayed (guint ms, LauncherIconQuirk quirk); | ||
331 | 119 | void UpdateQuirkTime (LauncherIconQuirk quirk); | 121 | void UpdateQuirkTime (LauncherIconQuirk quirk); |
332 | 120 | void ResetQuirkTime (LauncherIconQuirk quirk); | 122 | void ResetQuirkTime (LauncherIconQuirk quirk); |
333 | 121 | 123 | ||
334 | @@ -157,10 +159,17 @@ | |||
335 | 157 | friend class LauncherController; | 159 | friend class LauncherController; |
336 | 158 | 160 | ||
337 | 159 | private: | 161 | private: |
338 | 162 | typedef struct | ||
339 | 163 | { | ||
340 | 164 | LauncherIcon *self; | ||
341 | 165 | LauncherIconQuirk quirk; | ||
342 | 166 | } DelayedUpdateArg; | ||
343 | 167 | |||
344 | 160 | static void ChildRealized (DbusmenuMenuitem *newitem, QuicklistView *quicklist); | 168 | static void ChildRealized (DbusmenuMenuitem *newitem, QuicklistView *quicklist); |
345 | 161 | static void RootChanged (DbusmenuClient * client, DbusmenuMenuitem *newroot, QuicklistView *quicklist); | 169 | static void RootChanged (DbusmenuClient * client, DbusmenuMenuitem *newroot, QuicklistView *quicklist); |
346 | 162 | static gboolean OnPresentTimeout (gpointer data); | 170 | static gboolean OnPresentTimeout (gpointer data); |
347 | 163 | static gboolean OnCenterTimeout (gpointer data); | 171 | static gboolean OnCenterTimeout (gpointer data); |
348 | 172 | static gboolean OnDelayedUpdateTimeout (gpointer data); | ||
349 | 164 | 173 | ||
350 | 165 | void ColorForIcon (GdkPixbuf *pixbuf, nux::Color &background, nux::Color &glow); | 174 | void ColorForIcon (GdkPixbuf *pixbuf, nux::Color &background, nux::Color &glow); |
351 | 166 | 175 |
Looks good to merge, although it would be nice if you could fix these:
1) You need to either change these to const gchar * or create stack or heap memory for them
/home/smspillaz /Source/ compiz/ compiz- glib/unity. shimmer/ src/Introspecti onDBusInterface .cpp:41: 1: warning: deprecated conversion from string constant to ‘gchar*’ /Source/ compiz/ compiz- glib/unity. shimmer/ src/Introspecti onDBusInterface .cpp:41: 1: warning: deprecated conversion from string constant to ‘gchar*’ /Source/ compiz/ compiz- glib/unity. shimmer/ src/Introspecti onDBusInterface .cpp:51: 1: warning: deprecated conversion from string constant to ‘gchar*’ /Source/ compiz/ compiz- glib/unity. shimmer/ src/Introspecti onDBusInterface .cpp:51: 1: warning: deprecated conversion from string constant to ‘gchar*’ /Source/ compiz/ compiz- glib/unity. shimmer/ src/Introspecti onDBusInterface .cpp:61: 1: warning: deprecated conversion from string constant to ‘gchar*’ /Source/ compiz/ compiz- glib/unity. shimmer/ src/Introspecti onDBusInterface .cpp:73: 1: warning: deprecated conversion from string constant to ‘gchar*’
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
2) Remove these unused variables
/home/smspillaz /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘_dbus_ handle_ unity_place_ service_ entry_added’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:2664: 15: warning: unused variable ‘reply’ /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘_dbus_ handle_ unity_place_ service_ entry_removed’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:2799: 15: warning: unused variable ‘reply’ /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘_dbus_ handle_ unity_place_ entry_service_ entry_renderer_ info_changed’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:4102: 15: warning: unused variable ‘reply’ /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘_dbus_ handle_ unity_place_ entry_service_ global_ renderer_ info_changed’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:4154: 15: warning: unused variable ‘reply’ /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘_dbus_ handle_ unity_place_ entry_service_ place_entry_ info_changed’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:4214: 15: warning: unused variable ‘reply’
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
/home/smspillaz
3) This is bad
/home/smspillaz /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘unity_ place_service_ impl_dbus_ message’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:4851: 2: warning: implicit declaration of function ‘unity_ place_activatio n_dbus_ message’ /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c: In function ‘unity_ place_service_ impl_dbus_ register_ object’ : /Source/ compiz/ compiz- glib/unity. shimmer/ build/libunity/ unity-place. c:4866: 2: warning: implicit declaration of f...
/home/smspillaz
/home/smspillaz
/home/smspillaz