Further readonly handle work and comments
[ndesk-cairo-sharp.git] / src / Primitives.cs
blobd8a20a5b96fc6c1d5412606ca46ae1fb5fa2401e
1 //
2 // Mono.Cairo.Primitives.cs
3 //
4 // Authors:
5 // Duncan Mak (duncan@ximian.com)
6 // Miguel de Icaza (miguel@novell.com)
7 // Hisham Mardam Bey (hisham.mardambey@gmail.com)
8 // Alp Toker (alp@atoker.com)
9 //
10 // (C) Ximian Inc, 2003.
11 // (C) Novell Inc, 2003.
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System;
35 namespace Cairo
37 public struct Point
39 public Point (int x, int y)
41 this.x = x;
42 this.y = y;
45 int x, y;
46 public int X {
47 get { return x; }
48 set { x = value; }
51 public int Y {
52 get { return y; }
53 set { y = value; }
57 public struct PointD
59 public PointD (double x, double y)
61 this.x = x;
62 this.y = y;
65 double x, y;
66 public double X {
67 get { return x; }
68 set { x = value; }
71 public double Y {
72 get { return y; }
73 set { y = value; }
77 public struct Distance
79 public Distance (double dx, double dy)
81 this.dx = dx;
82 this.dy = dy;
85 double dx, dy;
86 public double Dx {
87 get { return dx; }
88 set { dx = value; }
91 public double Dy {
92 get { return dy; }
93 set { dy = value; }
97 public struct Color
99 public Color (double r, double g, double b) : this (r, g, b, 1.0)
103 public Color (double r, double g, double b, double a)
105 this.r = r;
106 this.g = g;
107 this.b = b;
108 this.a = a;
111 double r, g, b, a;
113 public double R {
114 get { return r; }
115 set { r = value; }
118 public double G {
119 get { return g; }
120 set { g = value; }
123 public double B {
124 get { return b; }
125 set { b = value; }
128 public double A {
129 get { return a; }
130 set { a = value; }