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

« back to all changes in this revision

Viewing changes to lib/Hyena/src/Hyena.Gui/Hyena.Gui.Canvas/Thickness.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-24 10:35:57 UTC
  • mfrom: (2.4.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20100524103557-1j0i8f66caybci2n
* New upstream release 0.7.0
 + First release of the unstable 0.7 development series. Massive changes.
 + Reparenting and detaching support (Anton Keks) (Closes: #559745)
 + A new Mallard-based documentation (Harold Schreckengost)
 + No longer embeds flickrnet, uses distribution copy (Iain Lane)
 + Adoption of a large amount of Hyena functionality (Paul Lange, Peter
   Goetz)
 + No longer embeds gnome-keyring-sharp
 + Completely rewritten import, much faster and less memory hungry (Ruben
   Vermeersch) (Closes: #559080, #492658, #341790, #357811, #426017) (LP:
   #412091)
 + No longer use gphoto2-sharp, now uses gvfs which is less crash-pron
   (Ruben Vermeersch)
 + Fix Facebook support (Ruben Vermeersch)
 + Modernized unit tests
 + Revamped build (Mike Gemünde)
 + Much improved duplicate detection (much faster too) (Ruben Vermeersch)
 + Mouse selection in Iconview (Vincent Pomey)
 + Image panning support using middle mouse button (Wojciech Dzierżanowski)
 + Timeline slider now restricted to the size of the window (Iain Churcher)
 + Over 100 bugs closed (http://bit.ly/cyVjnD)
   - No more warnings about schema defaults (Closes: #584215) (LP: #586132)
* debian/control: Clean up build deps to match configure checks
* debian/rules: Don't run dh_makeshilbs as we don't ship any shared
  libraries. There are some private ones though, which get picked up and
  result in a useless postinst/postrm call to ldconfig. Thanks, lintian.
* debian/patches/debian_fix-distclean.patch,
  debian/patches/debian_fix_f-spot.exe.config.patch,
  debian/patches/debian_link-system-flickrnet.patch,
  debian/patches/debian_link-system-gnome-keyring.patch,
  debian/patches/debian_disable-unit-tests,
  debian/patches/git_transition_duration.patch,
  debian/patches/ubuntu_fix_folder_export_hang.patch:
  Clean up obsolete patches which are no longer necessary 
* debian/patches/*: Temporarily disable patches which originated from Ubuntu
  and no longer apply cleanly. We will get these back in a future upstream
  development release.
* debian/patches/*: Refresh to apply cleanly 
* debian/rules: Add new include dir to autoreconf call to pick up f-spot
  macros 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Thickness.cs
 
3
//
 
4
// Author:
 
5
//   Aaron Bockover <abockover@novell.com>
 
6
//
 
7
// Copyright 2009-2010 Novell, Inc.
 
8
//
 
9
// Permission is hereby granted, free of charge, to any person obtaining
 
10
// a copy of this software and associated documentation files (the
 
11
// "Software"), to deal in the Software without restriction, including
 
12
// without limitation the rights to use, copy, modify, merge, publish,
 
13
// distribute, sublicense, and/or sell copies of the Software, and to
 
14
// permit persons to whom the Software is furnished to do so, subject to
 
15
// the following conditions:
 
16
//
 
17
// The above copyright notice and this permission notice shall be
 
18
// included in all copies or substantial portions of the Software.
 
19
//
 
20
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
21
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
22
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
23
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 
24
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 
25
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 
26
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
27
//
 
28
 
 
29
using System;
 
30
 
 
31
namespace Hyena.Gui.Canvas
 
32
{
 
33
    public struct Thickness
 
34
    {
 
35
        private double left;
 
36
        private double top;
 
37
        private double right;
 
38
        private double bottom;
 
39
        
 
40
        public Thickness (double thickness) 
 
41
            : this (thickness, thickness, thickness, thickness)
 
42
        {
 
43
        }
 
44
        
 
45
        public Thickness (double xthickness, double ythickness) 
 
46
            : this (xthickness, ythickness, xthickness, ythickness)
 
47
        {
 
48
        }
 
49
        
 
50
        public Thickness (double left, double top, double right, double bottom)
 
51
        {
 
52
            this.left = left;
 
53
            this.top = top;
 
54
            this.right = right;
 
55
            this.bottom = bottom;
 
56
        }
 
57
        
 
58
        public override string ToString ()
 
59
        {
 
60
            return string.Format ("{0},{1},{2},{3}", Double.IsNaN (left) ? "Auto" : left.ToString (),
 
61
                Double.IsNaN (top) ? "Auto" : top.ToString (), 
 
62
                Double.IsNaN (right) ? "Auto" : right.ToString (), 
 
63
                Double.IsNaN (bottom) ? "Auto" : bottom.ToString ()); 
 
64
        }
 
65
 
 
66
        public override bool Equals (object o)
 
67
        {
 
68
            if (!(o is Thickness)) {
 
69
                return false;
 
70
            }
 
71
            
 
72
            return this == (Thickness)o;
 
73
        }
 
74
        
 
75
        public bool Equals (Thickness thickness)
 
76
        {
 
77
            return this == thickness;
 
78
        }
 
79
        
 
80
        public override int GetHashCode ()
 
81
        {
 
82
            return left.GetHashCode () ^ top.GetHashCode () ^ right.GetHashCode () ^ bottom.GetHashCode ();
 
83
        }
 
84
        
 
85
        public static bool operator == (Thickness t1, Thickness t2)
 
86
        {
 
87
            return t1.left == t2.left &&
 
88
                t1.right == t2.right &&
 
89
                t1.top == t2.top &&
 
90
                t1.bottom == t2.bottom;
 
91
        }
 
92
        
 
93
        public static bool operator != (Thickness t1, Thickness t2)
 
94
        {
 
95
            return !(t1 == t2);
 
96
        }
 
97
        
 
98
        public double Left {
 
99
            get { return left; }
 
100
            set { left = value; }
 
101
        }
 
102
        
 
103
        public double Top {
 
104
            get { return top; }
 
105
            set { top = value; }    
 
106
        }
 
107
        
 
108
        public double Right { 
 
109
            get { return right; }
 
110
            set { right = value; }
 
111
        }
 
112
        
 
113
        public double Bottom { 
 
114
            get { return bottom; }
 
115
            set { bottom = value; }
 
116
        }
 
117
 
 
118
        public double X {
 
119
            get { return Left + Right; }
 
120
        }
 
121
 
 
122
        public double Y {
 
123
            get { return Top + Bottom; }
 
124
        }
 
125
    }
 
126
}