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

« back to all changes in this revision

Viewing changes to src/Widgets/IconView.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Mirco Bauer, Iain Lane
  • Date: 2009-02-07 20:23:32 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20090207202332-oc93rfjo1st0571s
Tags: 0.5.0.3-2
[ Mirco Bauer]
* Upload to unstable.
* debian/control:
  + Lowered GNOME# build-deps to 2.0 ABI as that transition didn't happen
    yet in unstable.

[ Iain Lane ]
* debian/patches/svn-r4545_locales-import.dpatch: Patch backported from SVN
  trunk revision 4545 - initialize the translation catalog earlier (LP: #293305)
  (Closes: #514457). Thanks to Florian Heinle for finding the patch and to
  Chris Coulson for preparing the update.
* debian/control: Build-depend on libmono-dev (>= 1.2.4) to match configure
  checks.
* debian/rules: Pass CSC=/usr/bin/csc to configure for gio-sharp to fix FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
                private int click_count;
195
195
 
196
196
                // Public events.
197
 
                public delegate void DoubleClickedHandler (IconView view, int clicked_item);
 
197
                public delegate void DoubleClickedHandler (Widget widget, BrowsableEventArgs args);
198
198
                public event DoubleClickedHandler DoubleClicked;
199
199
 
200
200
                public delegate void ZoomChangedHandler (object sender, System.EventArgs args);
258
258
                private void HandleItemsChanged (FSpot.IBrowsableCollection sender, BrowsableEventArgs args)
259
259
                {
260
260
                        foreach (int item in args.Items) {
261
 
                                UpdateThumbnail (item);
 
261
                                if (args.Changes.DataChanged)
 
262
                                        UpdateThumbnail (item);
262
263
                                InvalidateCell (item);
263
264
                        }
264
265
                }
325
326
 
326
327
                        }
327
328
 
328
 
                        public void MarkChanged (int item)
 
329
                        public void MarkChanged (int item, IBrowsableItemChanges changes)
329
330
                        {
330
331
                                // Forward the change event up to our parent
331
332
                                // we'll fire the event when the parent calls us back
332
 
                                parent.MarkChanged ((int) selected_cells [item]);
 
333
                                parent.MarkChanged ((int) selected_cells [item], changes);
333
334
                        }
334
335
 
335
336
                        private void HandleParentItemsChanged (IBrowsableCollection collection, BrowsableEventArgs args)
351
352
                                if (local_ids.Count == 0)
352
353
                                        return;
353
354
 
354
 
                                ItemsChanged (this, new BrowsableEventArgs ((int [])local_ids.ToArray (typeof (int))));
 
355
                                int [] items = (int [])local_ids.ToArray (typeof (int));
 
356
                                ItemsChanged (this, new BrowsableEventArgs (items, args.Changes));
355
357
                        }
356
358
 
357
359
                        public int [] Ids {
867
869
                                                draw.Width, draw.Height);
868
870
 
869
871
                                if (region.Intersect (area, out draw)) {
 
872
                                        //FIXME
 
873
                                        if (FSpot.ColorManagement.IsEnabled) {
 
874
                                                temp_thumbnail = temp_thumbnail.Copy();
 
875
                                                FSpot.ColorManagement.ApplyScreenProfile (temp_thumbnail);
 
876
                                        }
870
877
                                        temp_thumbnail.RenderToDrawable (BinWindow, Style.WhiteGC,
871
878
                                                        draw.X - region.X,
872
879
                                                        draw.Y - region.Y,
986
993
                                                                        tag_bounds.Height,
987
994
                                                                        InterpType.Bilinear);
988
995
                                                }
 
996
                                                
 
997
                                                FSpot.ColorManagement.ApplyScreenProfile (scaled_icon);
989
998
 
990
999
                                                scaled_icon.RenderToDrawable (BinWindow, Style.WhiteGC,
991
1000
                                                                region.X - tag_bounds.X,
1030
1039
                        i ++) {
1031
1040
                                int cell_x = start_cell_x;
1032
1041
 
1033
 
                                //Console.WriteLine ("Drawing row {0}", start_cell_row + i);
 
1042
                                //Log.DebugFormat ("Drawing row {0}", start_cell_row + i);
1034
1043
                                for (int j = 0; j < num_cols && cell_num + j < collection.Count; j ++) {
1035
1044
                                        DrawCell (cell_num + j, area);
1036
1045
                                        cell_x += cell_width;
1079
1088
 
1080
1089
                        Gdk.Region offscreen = new Gdk.Region ();
1081
1090
                        /*
1082
 
                        System.Console.WriteLine ("step ({0}, {1}) allocation ({2},{3},{4},{5})",
 
1091
                        Log.DebugFormat ("step ({0}, {1}) allocation ({2},{3},{4},{5})",
1083
1092
                                        xstep, ystep, Hadjustment.Value, Vadjustment.Value,
1084
1093
                                        Allocation.Width, Allocation.Height);
1085
1094
                        */
1296
1305
                        int width, height;
1297
1306
                        PixbufUtils.Fit (result, ThumbnailWidth, ThumbnailHeight, false, out width, out height);
1298
1307
                        if (result.Width > width && result.Height > height) {
1299
 
                                //  System.Console.WriteLine ("scaling");
 
1308
                                //  Log.Debug ("scaling");
1300
1309
                                Gdk.Pixbuf temp = PixbufUtils.ScaleDown (result, width, height);
1301
1310
                                result.Dispose ();
1302
1311
                                result = temp;
1422
1431
 
1423
1432
                        switch (args.Event.Type) {
1424
1433
                        case EventType.TwoButtonPress:
1425
 
                                if (args.Event.Button != 1
1426
 
                                        || (args.Event.State &  (ModifierType.ControlMask
1427
 
                                | ModifierType.ShiftMask)) != 0)
1428
 
                                return;
 
1434
                                if (args.Event.Button != 1 ||
 
1435
                                                (args.Event.State &  (ModifierType.ControlMask | ModifierType.ShiftMask)) != 0)
 
1436
                                        return;
1429
1437
                                if (DoubleClicked != null)
1430
 
                                        DoubleClicked (this, cell_num);
 
1438
                                        DoubleClicked (this, new BrowsableEventArgs (cell_num, null));
1431
1439
                                return;
1432
1440
 
1433
1441
                        case EventType.ButtonPress:
1542
1550
                                ToggleCell (FocusCell);
1543
1551
                                break;
1544
1552
                        case Gdk.Key.Return:
1545
 
                                if (DoubleClicked == null)
1546
 
                                        break;
1547
 
                                DoubleClicked (this, FocusCell);
 
1553
                                if (DoubleClicked != null)
 
1554
                                        DoubleClicked (this, new BrowsableEventArgs (FocusCell, null));
1548
1555
                                break;
1549
1556
                        default:
1550
1557
                                args.RetVal = false;