add new sigc++2 directory
[ardour.git] / libs / cairomm / cairomm / path.cc
1 /* Copyright (C) 2005 The cairomm Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Library General Public
5  * License as published by the Free Software Foundation; either
6  * version 2 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Library General Public License for more details.
12  *
13  * You should have received a copy of the GNU Library General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16  * 02110-1301, USA.
17  */
18
19 #include <cairomm/path.h>
20 #include <cairomm/private.h>
21 #include <iostream>
22
23 namespace Cairo
24 {
25
26 /*
27 Path::Path()
28 : m_cobject(0)
29 {
30   m_cobject = cairo_path_create();
31 }
32 */
33
34 Path::Path(cairo_path_t* cobject, bool take_ownership)
35 : m_cobject(0)
36 {
37   if(take_ownership)
38     m_cobject = cobject;
39   else
40   {
41     std::cerr << "cairomm: Path::Path(): copying of the underlying cairo_path_t* is not yet implemented." << std::endl;
42     //m_cobject = cairo_path_copy(cobject);
43   }
44 }
45
46 /*
47 Path::Path(const Path& src)
48 {
49   //Reference-counting, instead of copying by value:
50   if(!src.m_cobject)
51     m_cobject = 0;
52   else
53     m_cobject = cairo_path_copy(src.m_cobject);
54 }
55 */
56
57 Path::~Path()
58 {
59   if(m_cobject)
60     cairo_path_destroy(m_cobject);
61 }
62
63 /*
64 Path& Path::operator=(const Path& src)
65 {
66   //Reference-counting, instead of copying by value:
67
68   if(this == &src)
69     return *this;
70
71   if(m_cobject == src.m_cobject)
72     return *this;
73
74   if(m_cobject)
75   {
76     cairo_path_destroy(m_cobject);
77     m_cobject = 0;
78   }
79
80   if(!src.m_cobject)
81     return *this;
82
83   m_cobject = cairo_path_copy(src.m_cobject);
84
85   return *this;
86 }
87 */
88
89 /*
90 bool Path::operator==(const Path& src) const
91 {
92   return cairo_path_equal(m_cobject, src.cobj());
93 }
94 */
95
96 } //namespace Cairo
97
98 // vim: ts=2 sw=2 et