summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2015-07-31 13:21:23 +0200
committerMurray Cumming <murrayc@murrayc.com>2015-07-31 13:21:23 +0200
commit632b5d1c4dfb7fb044351e56e69985ef64305fdd (patch)
tree1ab8f43e25e70ebc3cf3405c3ac488e80ece75fe
parenta6c9d44b6d07b151f1b3106c022daf2ac7d18426 (diff)
C++11: Use = delete instead of private constructors.
-rw-r--r--cairomm/context.h7
-rw-r--r--cairomm/fontface.h6
-rw-r--r--cairomm/path.h8
-rw-r--r--cairomm/pattern.h7
-rw-r--r--cairomm/scaledfont.h7
-rw-r--r--cairomm/surface.h8
6 files changed, 18 insertions, 25 deletions
diff --git a/cairomm/context.h b/cairomm/context.h
index f6b8c29..90e6e7b 100644
--- a/cairomm/context.h
+++ b/cairomm/context.h
@@ -64,6 +64,9 @@ public:
*/
explicit Context(cairo_t* cobject, bool has_reference = false);
+ Context(const Context&) = delete;
+ Context& operator=(const Context&) = delete;
+
static RefPtr<Context> create(const RefPtr<Surface>& target);
virtual ~Context();
@@ -1609,10 +1612,6 @@ public:
protected:
cobject* m_cobject;
-
-private:
- Context(const Context&);
- Context& operator=(const Context&);
};
} // namespace Cairo
diff --git a/cairomm/fontface.h b/cairomm/fontface.h
index aa0e0cc..909d6bb 100644
--- a/cairomm/fontface.h
+++ b/cairomm/fontface.h
@@ -58,6 +58,8 @@ public:
*/
explicit FontFace(cairo_font_face_t* cobject, bool has_reference = false);
+ FontFace(const FontFace&) = delete;
+ FontFace& operator=(const FontFace&) = delete;
virtual ~FontFace();
@@ -88,10 +90,6 @@ public:
protected:
cobject* m_cobject;
-
-private:
- FontFace(const FontFace&);
- FontFace& operator=(const FontFace&);
};
diff --git a/cairomm/path.h b/cairomm/path.h
index 28d843f..f168d94 100644
--- a/cairomm/path.h
+++ b/cairomm/path.h
@@ -40,7 +40,9 @@ class Path
public:
//Path();
explicit Path(cairo_path_t* cobject, bool take_ownership = false);
- //Path(const Path& src);
+
+ Path(const Path&) = delete;
+ Path& operator=(const Path&) = delete;
virtual ~Path();
@@ -63,10 +65,6 @@ public:
protected:
cobject* m_cobject;
-
-private:
- Path(const Path&);
- Path& operator=(const Path&);
};
} // namespace Cairo
diff --git a/cairomm/pattern.h b/cairomm/pattern.h
index 15cac40..dcacd49 100644
--- a/cairomm/pattern.h
+++ b/cairomm/pattern.h
@@ -56,6 +56,9 @@ public:
*/
explicit Pattern(cairo_pattern_t* cobject, bool has_reference = false);
+ Pattern(const Pattern&) = delete;
+ Pattern& operator=(const Pattern&) = delete;
+
virtual ~Pattern();
/**
@@ -147,10 +150,6 @@ protected:
Pattern();
cobject* m_cobject;
-
-private:
- Pattern(const Pattern&);
- Pattern& operator=(const Pattern&);
};
class SolidPattern : public Pattern
diff --git a/cairomm/scaledfont.h b/cairomm/scaledfont.h
index b5c8f08..d82b957 100644
--- a/cairomm/scaledfont.h
+++ b/cairomm/scaledfont.h
@@ -65,6 +65,9 @@ public:
*/
explicit ScaledFont(cobject* cobj, bool has_reference = false);
+ ScaledFont(const ScaledFont&) = delete;
+ ScaledFont& operator=(const ScaledFont&) = delete;
+
virtual ~ScaledFont();
/** Creates a ScaledFont object from a font face and matrices that describe
@@ -227,10 +230,6 @@ protected:
const cairo_matrix_t& ctm, const FontOptions& options = FontOptions());
/** The underlying C cairo object that is wrapped by this ScaledFont */
cobject* m_cobject;
-
-private:
- ScaledFont(const ScaledFont&);
- ScaledFont& operator=(const ScaledFont&);
};
#ifdef CAIRO_HAS_FT_FONT
diff --git a/cairomm/surface.h b/cairomm/surface.h
index 379742d..c83eb24 100644
--- a/cairomm/surface.h
+++ b/cairomm/surface.h
@@ -93,6 +93,7 @@ public:
* @return the status code of the write operation
*/
typedef sigc::slot<ErrorStatus, const unsigned char* /*data*/, unsigned int /*length*/> SlotWriteFunc;
+
/**
* This is the type of function which is called when a backend needs to read
* data from an input stream. It is passed the buffer to read the data into
@@ -115,6 +116,9 @@ public:
*/
explicit Surface(cairo_surface_t* cobject, bool has_reference = false);
+ Surface(const Surface&) = delete;
+ Surface& operator=(const Surface&) = delete;
+
virtual ~Surface();
/**
@@ -410,10 +414,6 @@ protected:
/** The underlying C cairo surface type that is wrapped by this Surface
*/
cobject* m_cobject;
-
-private:
- Surface(const Surface&);
- Surface& operator=(const Surface&);
};
/** @example image-surface.cc