xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
brush.h
Go to the documentation of this file.
1 #pragma once
5 #include <cstdint>
6 #include <memory>
7 #include <ostream>
8 #include <xtd/object.h>
9 #include <xtd/ustring.h>
10 #include "../drawing_export.h"
11 
13 namespace xtd {
15  namespace drawing {
17  class graphics;
19 
27  class drawing_export_ brush : public object {
28  public:
29  //static const brush null;
30 
32  brush(const brush& value);
33  brush& operator=(const brush& value);
34  ~brush();
35  bool operator==(const brush& value) const {return data_->handle_ == value.data_->handle_;}
36  bool operator!=(const brush& value) const {return !operator==(value);}
38 
40 
44  xtd::ustring to_string() const noexcept override {return ustring::full_class_name(*this);}
46 
48  friend std::ostream& operator<<(std::ostream& os, const xtd::drawing::brush& brush) noexcept {
49  return os << brush.to_string();
50  }
52 
53  protected:
54  friend class graphics;
55 
57 
60  brush();
62 
64 
68  void set_native_brush(intptr_t brush);
70 
71  //private:
73  struct data {
74  intptr_t handle_ = 0;
75  };
76 
77  std::shared_ptr<data> data_ = std::make_shared<data>();
79  };
80  }
81 }
xtd::ustring to_string() const noexcept override
Converts this brush object to a human-readable string.
Definition: brush.h:44
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:50
Contains xtd::ustring class.
Contains xtd::object class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:30
static ustring full_class_name()
Gets the fully qualified class name of the objec_t, including the namespace of the objec_t...
Definition: ustring.h:444
Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths.
Definition: brush.h:27
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition: graphics.h:48