~ubuntu-branches/debian/sid/f-spot/sid

« back to all changes in this revision

Viewing changes to src/SlideView.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-17 11:59:58 UTC
  • mfrom: (2.4.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100517115958-rplbws9ddda5ikcp
* New upstream release 0.6.2:
 + Stable release before starting large cleanup refactorings, mostly 
   usability, bug fixes and translations as well as some modernization.
   A large part of this comes from the Ubuntu one hundred papercuts effort.
 + Replaced the old slow slideshow code with new fast SlideShow
   (Gabriel Burt)
 + Wording changes for clarity (Edit Tag) (Jeffrey Finkelstein)
 + Fix version selection tooltip (Lorenzo Milesi)
 + Add gconf schema (Jeffrey Stedfast)
 + Added a border to filmstrip thumbnails (Matt Perry) (LP: #513036)
 + Fix display names of color profiles (Pascal de Bruijn)
 + Fix histogram colors on theme change (Paul Wellner Bou)
 + Always update ImageView adjustments when scaling.
   (Wojciech Dzierżanowski)
 + Correctly set attributes on copying (Yann Leprince)
 + Correct mnemonics in create tag dialog (Yves Kurz)
 + Provide sane defaults for image resize size (Yves Kurz)
 + Updates to the build system, including fixes for distcheck
   (Ruben Vermeersch)
 + Fix wording for duplicate hashing (Matt Perry)
 + Fix wording for imported tags tag (Ian Churcher)
 + Fix label alignment in preferences dialog (Pascal de Bruijn)
 + Add unique# and use it to handle our activation (Stephane Delcroix)
 + Stop bundling Mono.Addins (Stephane Delcroix)
 + Avoid leakage in straighten and softfocus editor (Stephane Delcroix)
 + Allow to copy files to clipboard (Stephane Delcroix)
 + Large number of color management related fixes (Stephane Delcroix)
 + Removed the Beagle plugin at the request of the openSUSE team
   (Ruben Vermeersch)
 + A pile of other cleanups and fixes (Ruben Vermeersch)
   - Including '"Import tags" category sounds like an action' (LP: #488784)
 + Two performance improvement patches for our database interaction
   (Michal Nánási)
 + Fix the longstanding issue of F-Spot changing photo timestamps
   (Paul Wellner Bou) (Closes: #445511) (LP: #175191)
 + Tons of translation updates (seriously)
* debian/control, debian/rules: Drop gnome-screensaver build-dep and set
  variables at configure time. Should reduce the BD chain significantly. 
* debian/control: Increase minimum version on libgphoto2-dev BD in line with
  configure requirements.
* debian/control: Add build-dependency on libunique-dev to build new
  unique-sharp bindings which f-spot now uses to handle activation.
* debian/patches/debian_link-system-mono-addins.patch: Drop, now upstream 
* debian/patches/*: Refresh to apply to new upstream version 
* debian/rules: Pass include directories to autoreconf to have the correct
  macros in scope for the new build system 
* debian/patches/ubuntu*: Steal patches from Ubuntu package to improve
  --view mode and add an undo/redo stack. Rebase on new upstream version.
  Thanks to Chris Halse Rogers.
* debian/patches/ubuntu_fname_quote_percent.patch: Drop, now upstream.
* debian/patches/git_transition_duration.patch: Cherrypick patch from
  upstream to reduce the transition duration when entering fullscreen to
  600ms. 
* debian/rules: Incorporate Ubuntu specific changes, and guard by a call to
  dpkg-vendor.
* debian/rules: Don't try to install the gconf schemas when building 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using Gtk;
2
 
using Gdk;
3
 
using System;
4
 
using GLib;
5
 
using System.Runtime.InteropServices;
6
 
using FSpot;
7
 
using FSpot.Utils;
8
 
 
9
 
namespace FSpot {
10
 
        public class XScreenSaverSlide : Gtk.Window {
11
 
                public const string ScreenSaverEnviroment = "XSCREENSAVER_WINDOW";
12
 
 
13
 
                public XScreenSaverSlide () : base (String.Empty)
14
 
                {
15
 
                }
16
 
               
17
 
                protected override void OnRealized ()
18
 
                {
19
 
                        string env = Environment.GetEnvironmentVariable (ScreenSaverEnviroment);
20
 
                        
21
 
                        if (env != null) {
22
 
                                try {
23
 
                                        env = env.ToLower ();
24
 
                                        
25
 
                                        if (env.StartsWith ("0x"))
26
 
                                                env = env.Substring (2);
27
 
 
28
 
                                        uint xid = UInt32.Parse (env, System.Globalization.NumberStyles.HexNumber);
29
 
                                        
30
 
                                        GdkWindow = Gdk.Window.ForeignNew (xid);
31
 
                                        Style.Attach (GdkWindow);
32
 
                                        GdkWindow.Events = EventMask.ExposureMask 
33
 
                                                | EventMask.StructureMask 
34
 
                                                | EventMask.EnterNotifyMask 
35
 
                                                | EventMask.LeaveNotifyMask 
36
 
                                                | EventMask.FocusChangeMask;
37
 
                                        
38
 
                                        Style.SetBackground (GdkWindow, Gtk.StateType.Normal);
39
 
                                        GdkWindow.SetDecorations ((Gdk.WMDecoration) 0);
40
 
                                        GdkWindow.UserData = this.Handle;
41
 
                                        SetFlag (WidgetFlags.Realized);
42
 
                                        SizeRequest ();
43
 
                                        Gdk.Rectangle geom;
44
 
                                        int depth;
45
 
                                        GdkWindow.GetGeometry (out geom.X, out geom.Y, out geom.Width, out geom.Height, out depth);
46
 
                                        SizeAllocate (new Gdk.Rectangle (geom.X, geom.Y, geom.Width, geom.Height));
47
 
                                        Resize (geom.Width, geom.Height);
48
 
                                        return;
49
 
                                } catch (System.Exception e) {
50
 
                                        System.Console.WriteLine (e);
51
 
                                }
52
 
                        } else {
53
 
                                System.Console.WriteLine ("{0} not set, falling back to window", ScreenSaverEnviroment);
54
 
                        }
55
 
 
56
 
                        SetSizeRequest (640, 480);
57
 
                        base.OnRealized ();
58
 
                }
59
 
        }
60
 
 
61
 
        public class FullSlide : Gtk.Window {
62
 
                private SlideView slideview;
63
 
                private Gdk.Pixbuf screenshot;
64
 
                private Delay hide;
65
 
                private Gdk.Cursor busy;
66
 
                private Gdk.Cursor none;
67
 
                
68
 
                public FullSlide (Gtk.Window parent, IBrowsableItem [] items) : base ("Slideshow")
69
 
                {
70
 
                        screenshot =  PixbufUtils.LoadFromScreen (parent.GdkWindow);
71
 
                        
72
 
                        this.Destroyed += HandleDestroyed;
73
 
 
74
 
                        this.TransientFor = parent;
75
 
 
76
 
                        this.ButtonPressEvent += HandleSlideViewButtonPressEvent;
77
 
                        this.KeyPressEvent += HandleSlideViewKeyPressEvent;
78
 
                        this.AddEvents ((int) (EventMask.ButtonPressMask | EventMask.KeyPressMask | EventMask.PointerMotionMask));
79
 
                        slideview = new SlideView (screenshot, items, 2.0);
80
 
                        this.Add (slideview);
81
 
                        this.Decorated = false;
82
 
                        this.Fullscreen();
83
 
                        this.Realize ();
84
 
 
85
 
                        busy = new Gdk.Cursor (Gdk.CursorType.Watch);
86
 
                        this.GdkWindow.Cursor = busy;
87
 
                        none = GdkUtils.CreateEmptyCursor (GdkWindow.Display);
88
 
 
89
 
                        hide = new Delay (2000, new GLib.IdleHandler (HideCursor));
90
 
                }
91
 
 
92
 
                public void Play ()
93
 
                {
94
 
                        Gdk.GCValues values = new Gdk.GCValues ();
95
 
                        values.SubwindowMode = SubwindowMode.IncludeInferiors;
96
 
                        Gdk.GC fillgc = new Gdk.GC (this.GdkWindow, values, Gdk.GCValuesMask.Subwindow);
97
 
                        
98
 
                        slideview.Show ();
99
 
                        this.GdkWindow.SetBackPixmap (null, false);
100
 
                        this.Show ();
101
 
                        screenshot.RenderToDrawable (this.GdkWindow, fillgc, 
102
 
                                                     0, 0, 0, 0, -1, -1, RgbDither.Normal, 0, 0);
103
 
                        
104
 
                        slideview.Play ();
105
 
                        hide.Start ();
106
 
                }
107
 
                
108
 
                [GLib.ConnectBefore]
109
 
                private void HandleSlideViewKeyPressEvent (object sender, KeyPressEventArgs args)
110
 
                {
111
 
                        this.Destroy ();
112
 
                        args.RetVal = true;
113
 
                }
114
 
 
115
 
                protected override bool OnMotionNotifyEvent (Gdk.EventMotion args)
116
 
                {
117
 
                        base.OnMotionNotifyEvent (args);
118
 
                        this.GdkWindow.Cursor = busy;
119
 
                        hide.Start ();
120
 
                        return true;
121
 
                }
122
 
                
123
 
                private bool HideCursor ()
124
 
                {
125
 
                        this.GdkWindow.Cursor = none;
126
 
                        return false;
127
 
                }
128
 
                
129
 
                private void HandleDestroyed (object sender, System.EventArgs args)
130
 
                {
131
 
                        hide.Stop ();
132
 
                }
133
 
 
134
 
                private void HandleSlideViewButtonPressEvent (object sender, ButtonPressEventArgs args)
135
 
                {
136
 
                        this.Destroy ();
137
 
                        args.RetVal = true;
138
 
                }
139
 
        }
140
 
        
141
 
        public class SlideView : Gtk.Image {
142
 
                IBrowsableItem [] photos;
143
 
                Pixbuf last;
144
 
                Pixbuf next;
145
 
                
146
 
                
147
 
                Pixbuf [] tweens = new Pixbuf [10];     
148
 
                int current_tween;
149
 
                uint tween_idle;
150
 
                uint resize_idle;
151
 
                
152
 
                int current_idx = 0;    
153
 
                int next_idx = 0;
154
 
                
155
 
                uint flip_timer = 0;
156
 
                uint transition_timer = 0;
157
 
                
158
 
                uint fail_count = 0;
159
 
                bool animate = true;
160
 
                uint animate_max = 200;
161
 
                
162
 
                bool black = false;
163
 
                uint flip_interval = 2000;
164
 
                uint transition_interval = 75;
165
 
                
166
 
                public bool Running {
167
 
                        get {
168
 
                                return flip_timer != 0 || transition_timer != 0;
169
 
                        }
170
 
                }
171
 
                
172
 
                public bool Animate {
173
 
                        get { return animate; }
174
 
                        set { animate = value; }
175
 
                }
176
 
                
177
 
                public void Play () 
178
 
                {
179
 
                        if (photos.Length < 1)
180
 
                                return;
181
 
 
182
 
                        StopTweenIdle ();
183
 
                        if (current_idx >= 0) {
184
 
                                Pixbuf frame = GetScaled (photos[current_idx]);
185
 
                                this.Pixbuf = frame;
186
 
                                frame.Dispose ();
187
 
                        } 
188
 
                        
189
 
                        if (PreloadNextImage (current_idx + 1))
190
 
                                StartFlipTimer ();
191
 
                }
192
 
                
193
 
                public void Pause () 
194
 
                {
195
 
                        StopTranstionTimer ();
196
 
                        StopFlipTimer ();
197
 
                }
198
 
                
199
 
                public void Stop ()
200
 
                {
201
 
                        StopTweenIdle ();
202
 
                        StopTranstionTimer ();
203
 
                        StopFlipTimer ();
204
 
                }
205
 
                
206
 
                public void Forward ()
207
 
                {
208
 
                        if (PreloadNextImage (current_idx + 1))
209
 
                                ShowNext ();
210
 
                }
211
 
                
212
 
                public void Back ()
213
 
                {
214
 
                        if (PreloadNextImage (current_idx - 1))
215
 
                                ShowNext ();
216
 
                }       
217
 
                
218
 
                private void ShowNext ()
219
 
                {
220
 
                        StopTweenIdle ();
221
 
                        
222
 
                        if (current_idx != next_idx && next != null)
223
 
                                this.Pixbuf = next;
224
 
                        
225
 
                        current_idx = next_idx;
226
 
                        
227
 
                        black = false;
228
 
                }
229
 
                
230
 
                private bool PreloadNextImage (int idx)
231
 
                {
232
 
                        try {
233
 
                                if (idx < photos.Length && idx >= 0) {
234
 
                                        if (next != null)
235
 
                                                next.Dispose ();
236
 
                                        
237
 
                                        next = GetScaled (photos [idx]);
238
 
                                        if (next == null)
239
 
                                                next = GetScaled (PixbufUtils.ShallowCopy (PixbufUtils.ErrorPixbuf));
240
 
                                        
241
 
                                        next_idx = idx;
242
 
                                        StartTweenIdle ();
243
 
                                        
244
 
                                        return true;
245
 
                                } else {
246
 
                                        if (next != null)
247
 
                                                next.Dispose ();
248
 
 
249
 
                                        next = GetScaled (photos [0]);
250
 
                                        if (next == null)
251
 
                                                next = GetScaled (PixbufUtils.ShallowCopy (PixbufUtils.ErrorPixbuf));
252
 
                                        next_idx = 0;
253
 
                                        StartTweenIdle ();
254
 
                                        
255
 
                                        return false;
256
 
                                }
257
 
                        } catch (GLib.GException e) {
258
 
                                System.Console.WriteLine (e);
259
 
                                idx = (idx + 1) % photos.Length;
260
 
                                return PreloadNextImage (idx);
261
 
                        }
262
 
                }
263
 
                
264
 
                private Pixbuf CrossFade (Pixbuf current, Pixbuf prev, Pixbuf next, double percent)
265
 
                { 
266
 
                        Rectangle area = new Rectangle (0, 0, Allocation.Width, Allocation.Height);
267
 
                        BlockProcessor proc = new BlockProcessor (area, 256);
268
 
                        Rectangle subarea;
269
 
 
270
 
                        while (proc.Step (out subarea)) {
271
 
                                if (IsRealized)
272
 
                                        GdkWindow.ProcessUpdates (false);
273
 
                                
274
 
                                prev.CopyArea (subarea.X, subarea.Y, subarea.Width, subarea.Height, current, subarea.X, subarea.Y);
275
 
                                next.Composite (current, subarea.X, subarea.Y, subarea.Width, subarea.Height, 0, 0, 1, 1,
276
 
                                                Gdk.InterpType.Nearest, (int) System.Math.Round (255 * percent));
277
 
                        }
278
 
                        return current;
279
 
                }
280
 
                
281
 
                private Pixbuf BlackFade (Pixbuf current, Pixbuf prev, Pixbuf next, double percent)
282
 
                { 
283
 
                        int width = Allocation.Width;
284
 
                        int height = Allocation.Height;
285
 
                        
286
 
                        current.Fill (0);               
287
 
                        
288
 
                        if (percent < 0.5)
289
 
                                prev.Composite (current, 0,0, width, height, 0, 0, 1, 1,
290
 
                                                Gdk.InterpType.Nearest, (int)System.Math.Round (255  * (1 - percent * 2)));
291
 
                        else
292
 
                                next.Composite (current, 0,0, width, height, 0, 0, 1, 1,
293
 
                                                Gdk.InterpType.Nearest, (int)System.Math.Round (255 * (percent * 2 - 1)));
294
 
                        return current;
295
 
                }
296
 
                
297
 
                private Pixbuf Blend (Pixbuf current, Pixbuf prev, Pixbuf next, double percent)
298
 
                {
299
 
                        if (black) {
300
 
                                return BlackFade (current, prev, next, percent);
301
 
                        } else {
302
 
                                return CrossFade (current, prev, next, percent);
303
 
                        }
304
 
                }
305
 
                
306
 
                private Pixbuf GetScaled (Pixbuf orig)
307
 
                {
308
 
                        Gdk.Rectangle pos;
309
 
                        int width = Allocation.Width;
310
 
                        int height = Allocation.Height;
311
 
                        double scale = PixbufUtils.Fit (orig, width, height, false, out pos.Width, out pos.Height);
312
 
                        pos.X = (width - pos.Width) / 2;
313
 
                        pos.Y = (height - pos.Height) / 2;
314
 
                        
315
 
                        Pixbuf scaled = new Pixbuf (Colorspace.Rgb, false, 8, width, height);
316
 
                        scaled.Fill (0x000000); 
317
 
                        
318
 
                        Rectangle rect = new Rectangle (pos.X, pos.Y, 256, 256);
319
 
                        Rectangle subarea;
320
 
                        
321
 
                        while (rect.Top < pos.Bottom) {
322
 
                                while (rect.X < pos.Right) {
323
 
                                        if (IsRealized) 
324
 
                                                GdkWindow.ProcessUpdates (false);
325
 
 
326
 
                                        rect.Intersect (pos, out subarea);
327
 
                                        orig.Composite (scaled, subarea.X, subarea.Y, 
328
 
                                                        subarea.Width, subarea.Height,
329
 
                                                        pos.X, pos.Y, scale, scale,
330
 
                                                        Gdk.InterpType.Bilinear,
331
 
                                                        255);
332
 
                                        rect.X += rect.Width;
333
 
                                }
334
 
                                rect.X = pos.X;
335
 
                                rect.Y += rect.Height;
336
 
                        }
337
 
                        
338
 
                        orig.Dispose ();
339
 
                        return scaled;
340
 
                }
341
 
                
342
 
                private Pixbuf GetScaled (IBrowsableItem photo)
343
 
                {
344
 
                        Pixbuf orig;
345
 
                        try { 
346
 
                                orig = FSpot.PhotoLoader.LoadAtMaxSize (photo, Allocation.Width, Allocation.Height);
347
 
                        } catch {
348
 
                                orig = null;
349
 
                        }
350
 
 
351
 
                        if (orig == null)
352
 
                                return null;
353
 
 
354
 
                        Pixbuf result = GetScaled (orig);
355
 
                        if (orig != result)
356
 
                                orig.Dispose ();
357
 
                        
358
 
                        return result;
359
 
                }
360
 
                
361
 
                private bool HandleFlipTimer ()
362
 
                {       
363
 
                        StopTweenIdle ();
364
 
                        
365
 
                        StartTransitionTimer ();
366
 
                        
367
 
                        flip_timer = 0;
368
 
                        return false;
369
 
                }
370
 
                
371
 
                private bool HandleTransitionTimer ()
372
 
                {                       
373
 
                        System.DateTime start_time = System.DateTime.Now;
374
 
                        transition_timer = 0;
375
 
                        if (current_tween--  > 0) {
376
 
                                StartTransitionTimer ();
377
 
                                this.Pixbuf = tweens[current_tween];
378
 
                                GdkWindow.ProcessUpdates (false);
379
 
                                System.TimeSpan span = System.DateTime.Now  - start_time;
380
 
                                
381
 
                                if (Animate) { 
382
 
                                        if (span.TotalMilliseconds > animate_max) {
383
 
                                                fail_count++;
384
 
                                                
385
 
                                                if (fail_count > 3) {
386
 
                                                        Animate = false;
387
 
                                                        System.Console.WriteLine ("Disabling slide animation due to 3 consecutive excessive frame intervals {0}ms", 
388
 
                                                                                  span.TotalMilliseconds);
389
 
                                                        current_tween = 0;
390
 
                                                }
391
 
                                        } else {
392
 
                                                fail_count = 0;
393
 
                                        }
394
 
                                } 
395
 
                        } else {
396
 
                                ShowNext ();
397
 
 
398
 
                                PreloadNextImage (current_idx + 1);
399
 
                                StartFlipTimer ();
400
 
                        }
401
 
                        
402
 
                        return false;                   
403
 
                }
404
 
 
405
 
                
406
 
                private bool HandleTweenIdle ()
407
 
                {
408
 
                        using (Pixbuf prev = this.Pixbuf) {     
409
 
                                if (!Animate) {
410
 
                                        ClearTweens ();
411
 
                                        return false;
412
 
                                }
413
 
                                
414
 
                                if (photos.Length < 2) { // Only one photo. Nothing to do
415
 
                                        ClearTweens ();
416
 
                                        return false;
417
 
                                }
418
 
                                
419
 
                                if (current_tween >= tweens.Length) {
420
 
                                        tween_idle = 0;
421
 
                                        return false;
422
 
                                }
423
 
 
424
 
                                if (current_tween < tweens.Length && tweens[current_tween] == null) {
425
 
                                        tweens[current_tween] = new Pixbuf (Colorspace.Rgb, false, 8, 
426
 
                                                                            Allocation.Width, Allocation.Height);
427
 
                                }
428
 
 
429
 
                                double blend_val;
430
 
#if USE_EXP
431
 
                                double blend_t = (-10 * current_tween) / ((double)tweens.Length - 1);
432
 
                                blend_val = 1.0 - (.01 / (.01 + (.99 * Math.Exp(blend_t))));
433
 
#else
434
 
                                double [] blends = new double [] { .99, .97, .9, .8, .7, .6, .5, .4, .3, .15};
435
 
                                blend_val = blends [current_tween];
436
 
#endif
437
 
                                tweens[current_tween] = Blend (tweens[current_tween], prev, next, blend_val);
438
 
                                current_tween++;
439
 
                                return true;
440
 
                        }
441
 
                }       
442
 
                
443
 
                private void StartTweenIdle () 
444
 
                {
445
 
                        if (tween_idle == 0) {
446
 
                                current_tween = 0;      
447
 
                                tween_idle = GLib.Idle.Add (new GLib.IdleHandler (HandleTweenIdle));
448
 
                        }
449
 
                }
450
 
                
451
 
                private void StopTweenIdle ()
452
 
                {
453
 
                        if (tween_idle != 0) {
454
 
                                GLib.Source.Remove (tween_idle);
455
 
                        }
456
 
                        tween_idle = 0;
457
 
        
458
 
                }
459
 
                
460
 
                private void StartTransitionTimer ()
461
 
                {
462
 
                        if (transition_timer == 0)
463
 
                                transition_timer = GLib.Timeout.Add (transition_interval, 
464
 
                                                                     new TimeoutHandler (HandleTransitionTimer));
465
 
                }
466
 
                
467
 
                private void StopTranstionTimer ()
468
 
                {
469
 
                        if (transition_timer != 0)
470
 
                                GLib.Source.Remove (transition_timer);
471
 
 
472
 
                        transition_timer = 0;
473
 
                }
474
 
                
475
 
                private void StartFlipTimer ()
476
 
                {
477
 
                        if (flip_timer == 0)
478
 
                                flip_timer = GLib.Timeout.Add (flip_interval, 
479
 
                                                               new TimeoutHandler (HandleFlipTimer));
480
 
                }
481
 
                
482
 
                private void StopFlipTimer ()
483
 
                {       
484
 
                        if (flip_timer != 0)
485
 
                                GLib.Source.Remove (flip_timer);
486
 
 
487
 
                        flip_timer = 0;
488
 
                }
489
 
 
490
 
                
491
 
                private void HandleSizeAllocate (object sender, SizeAllocatedArgs args)
492
 
                {       
493
 
                        Pixbuf current = this.Pixbuf;
494
 
 
495
 
                        if (current == null)
496
 
                                return;
497
 
 
498
 
                        //
499
 
                        // The size has changed so we need to reload the images.
500
 
                        //
501
 
                        if (current.Width != Allocation.Width || current.Height != Allocation.Height) {
502
 
                                bool playing = (flip_timer != 0 || transition_timer != 0);
503
 
                                
504
 
                                if (current_idx < 0) {
505
 
                                        using (Gdk.Pixbuf old = this.Pixbuf) {
506
 
                                                this.Pixbuf = GetScaled (old);
507
 
                                                current.Dispose ();
508
 
                                        }
509
 
                                } else {
510
 
                                        using (Pixbuf frame =  GetScaled (photos[current_idx])) {
511
 
                                                this.Pixbuf =  frame;
512
 
                                                current.Dispose ();
513
 
                                        }
514
 
                                }
515
 
                                
516
 
                                Stop ();
517
 
                                
518
 
                                ClearTweens ();
519
 
                                
520
 
                                if (playing && current_idx != next_idx)
521
 
                                        Play ();
522
 
                                
523
 
                                
524
 
                        }
525
 
                }
526
 
 
527
 
                private void ClearTweens () {
528
 
                        for (int i = 0; i < tweens.Length; i++) {
529
 
                                if (tweens[i] != null) 
530
 
                                        tweens[i].Dispose ();
531
 
                                tweens[i] = null;
532
 
                        }
533
 
                }
534
 
                
535
 
                private void HandleDestroyed (object sender, EventArgs args)
536
 
                {
537
 
                        ClearTweens ();
538
 
                        Stop ();
539
 
                }
540
 
 
541
 
                public SlideView (Pixbuf background, IBrowsableItem [] photos, double delay) : base ()
542
 
                {
543
 
                        this.photos = photos;
544
 
 
545
 
                        if (background != null) {
546
 
                                this.Pixbuf = background;
547
 
                                background.Dispose ();
548
 
                                
549
 
                                current_idx = -1;
550
 
                                black = true;
551
 
                                flip_interval = (uint)(delay * 1000);
552
 
                        }
553
 
                        
554
 
                        SizeAllocated += new SizeAllocatedHandler (HandleSizeAllocate);
555
 
                        Destroyed += new EventHandler (HandleDestroyed);
556
 
                }
557
 
        }
558
 
}