summaryrefslogtreecommitdiffstats
path: root/src/CanvasPort.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-02 14:02:44 +0100
committerDavid Robillard <d@drobilla.net>2021-01-02 14:02:44 +0100
commit663a5d01b1931b97370ed8feff3ae229a9cc7ea4 (patch)
treeaba74794cb45f06734bd80bbf53d79f947008e54 /src/CanvasPort.hpp
parent1936aace80b5594078d874e9b661a9a91e461279 (diff)
downloadpatchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.tar.gz
patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.tar.bz2
patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.zip
Format all code with clang-format
Diffstat (limited to 'src/CanvasPort.hpp')
-rw-r--r--src/CanvasPort.hpp126
1 files changed, 63 insertions, 63 deletions
diff --git a/src/CanvasPort.hpp b/src/CanvasPort.hpp
index e8e809f..3376e15 100644
--- a/src/CanvasPort.hpp
+++ b/src/CanvasPort.hpp
@@ -48,71 +48,71 @@ namespace patchage {
class CanvasPort : public Ganv::Port
{
public:
- CanvasPort(Ganv::Module& module,
- PortType type,
- PortID id,
- const std::string& name,
- const std::string& human_name,
- bool is_input,
- uint32_t color,
- bool show_human_name,
- boost::optional<int> order = boost::optional<int>())
- : Port(module,
- (show_human_name && !human_name.empty()) ? human_name : name,
- is_input,
- color)
- , _type(type)
- , _id(std::move(id))
- , _name(name)
- , _human_name(human_name)
- , _order(order)
- {
- signal_event().connect(sigc::mem_fun(this, &CanvasPort::on_event));
- }
-
- CanvasPort(const CanvasPort&) = delete;
- CanvasPort& operator=(const CanvasPort&) = delete;
-
- CanvasPort(CanvasPort&&) = delete;
- CanvasPort& operator=(CanvasPort&&) = delete;
-
- ~CanvasPort() override = default;
-
- void show_human_name(bool human)
- {
- if (human && !_human_name.empty()) {
- set_label(_human_name.c_str());
- } else {
- set_label(_name.c_str());
- }
- }
-
- bool on_event(GdkEvent* ev) override
- {
- if (ev->type != GDK_BUTTON_PRESS || ev->button.button != 3) {
- return false;
- }
-
- Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
- menu->items().push_back(Gtk::Menu_Helpers::MenuElem(
- "Disconnect", sigc::mem_fun(this, &Port::disconnect)));
-
- menu->popup(ev->button.button, ev->button.time);
- return true;
- }
-
- PortType type() const { return _type; }
- PortID id() const { return _id; }
- const std::string& name() const { return _name; }
- const std::string& human_name() const { return _human_name; }
- const boost::optional<int>& order() const { return _order; }
+ CanvasPort(Ganv::Module& module,
+ PortType type,
+ PortID id,
+ const std::string& name,
+ const std::string& human_name,
+ bool is_input,
+ uint32_t color,
+ bool show_human_name,
+ boost::optional<int> order = boost::optional<int>())
+ : Port(module,
+ (show_human_name && !human_name.empty()) ? human_name : name,
+ is_input,
+ color)
+ , _type(type)
+ , _id(std::move(id))
+ , _name(name)
+ , _human_name(human_name)
+ , _order(order)
+ {
+ signal_event().connect(sigc::mem_fun(this, &CanvasPort::on_event));
+ }
+
+ CanvasPort(const CanvasPort&) = delete;
+ CanvasPort& operator=(const CanvasPort&) = delete;
+
+ CanvasPort(CanvasPort&&) = delete;
+ CanvasPort& operator=(CanvasPort&&) = delete;
+
+ ~CanvasPort() override = default;
+
+ void show_human_name(bool human)
+ {
+ if (human && !_human_name.empty()) {
+ set_label(_human_name.c_str());
+ } else {
+ set_label(_name.c_str());
+ }
+ }
+
+ bool on_event(GdkEvent* ev) override
+ {
+ if (ev->type != GDK_BUTTON_PRESS || ev->button.button != 3) {
+ return false;
+ }
+
+ Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
+ menu->items().push_back(Gtk::Menu_Helpers::MenuElem(
+ "Disconnect", sigc::mem_fun(this, &Port::disconnect)));
+
+ menu->popup(ev->button.button, ev->button.time);
+ return true;
+ }
+
+ PortType type() const { return _type; }
+ PortID id() const { return _id; }
+ const std::string& name() const { return _name; }
+ const std::string& human_name() const { return _human_name; }
+ const boost::optional<int>& order() const { return _order; }
private:
- PortType _type;
- PortID _id;
- std::string _name;
- std::string _human_name;
- boost::optional<int> _order;
+ PortType _type;
+ PortID _id;
+ std::string _name;
+ std::string _human_name;
+ boost::optional<int> _order;
};
} // namespace patchage