cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
mouse.cpp
Go to the documentation of this file.
1/*
2* cpp-terminal
3* C++ library for writing multi-platform terminal applications.
4*
5* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6*
7* SPDX-License-Identifier: MIT
8*/
9
11
13
14Term::Button::Type Term::Button::type() const noexcept { return m_type; }
15
16bool Term::Button::operator==(const Term::Button& button) const { return (m_action == button.m_action) && (m_type == button.m_type); }
17
18bool Term::Button::operator!=(const Term::Button& button) const { return !(*this == button); }
19
20bool Term::Mouse::is(const Term::Button::Type& type, const Term::Button::Action& action) const noexcept { return (m_buttons.type() == type) && (m_buttons.action() == action); }
21
22bool Term::Mouse::is(const Term::Button::Type& type) const noexcept { return m_buttons.type() == type; }
23
24Term::Button Term::Mouse::getButton() const noexcept { return m_buttons; }
25
26std::size_t Term::Mouse::row() const noexcept { return static_cast<std::size_t>(m_row); }
27
28std::size_t Term::Mouse::column() const noexcept { return static_cast<std::size_t>(m_column); }
29
30bool Term::Mouse::operator==(const Term::Mouse& mouse) const { return (m_row == mouse.m_row) && (m_column == mouse.m_column) && (m_buttons == mouse.m_buttons); }
31bool Term::Mouse::operator!=(const Term::Mouse& mouse) const { return !(*this == mouse); }
Term::Button::Action m_action
Definition mouse.hpp:56
bool operator!=(const Term::Button &button) const
Definition mouse.cpp:18
Term::Button::Type m_type
Definition mouse.hpp:55
bool operator==(const Term::Button &button) const
Definition mouse.cpp:16
Term::Button::Type type() const noexcept
Definition mouse.cpp:14
Term::Button::Action action() const noexcept
Definition mouse.cpp:12
std::uint16_t m_column
Definition mouse.hpp:75
std::size_t row() const noexcept
Definition mouse.cpp:26
std::size_t column() const noexcept
Definition mouse.cpp:28
bool operator==(const Term::Mouse &mouse) const
Definition mouse.cpp:30
std::uint16_t m_row
Definition mouse.hpp:74
bool is(const Term::Button::Type &type, const Term::Button::Action &action) const noexcept
Definition mouse.cpp:20
Term::Button m_buttons
Definition mouse.hpp:73
bool operator!=(const Term::Mouse &mouse) const
Definition mouse.cpp:31
Term::Button getButton() const noexcept
Definition mouse.cpp:24