DummyBackend: fix midi event mux+sorting
[ardour.git] / libs / canvas / types.cc
index c2612a0b2b9b34418817e4f6f650ec79959a9b69..4fd064d7467b1f844847207b6006e85da02ad0cd 100644 (file)
 #include <algorithm>
 #include <cfloat>
 #include <cassert>
+
+#include <cairomm/context.h>
+
 #include "canvas/types.h"
 
 using namespace std;
 using namespace ArdourCanvas;
 
-Coord const ArdourCanvas::COORD_MAX = DBL_MAX;
-/* XXX: empirically arrived at */
-Coord const ArdourCanvas::CAIRO_MAX = 65536;
+Coord const ArdourCanvas::COORD_MAX = 1.7e307;
 
 static inline Coord
 safe_add (Coord a, Coord b)
@@ -120,6 +121,16 @@ Rect::fix () const
        return r;
 }
 
+bool
+ArdourCanvas::operator!= (Rect const& a, Rect const& b)
+{
+       return a.x0 != b.x0 ||
+               a.x1 != b.x1 ||
+               a.y0 != b.y0 ||
+               a.y1 != b.y1;
+}
+
+
 Duple
 ArdourCanvas::operator- (Duple const & o)
 {
@@ -132,6 +143,18 @@ ArdourCanvas::operator+ (Duple const & a, Duple const & b)
        return Duple (safe_add (a.x, b.x), safe_add (a.y, b.y));
 }
 
+bool
+ArdourCanvas::operator== (Duple const & a, Duple const & b)
+{
+       return a.x == b.x && a.y == b.y;
+}
+
+bool
+ArdourCanvas::operator!= (Duple const & a, Duple const & b)
+{
+       return a.x != b.x || a.y != b.y;
+}
+
 Duple
 ArdourCanvas::operator- (Duple const & a, Duple const & b)
 {