cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
Term::Mouse Class Reference

#include <cpp-terminal/mouse.hpp>

Public Member Functions

 Mouse ()=default
 
 Mouse (const Term::Button &buttons, const std::uint16_t &row, const std::uint16_t &column)
 
std::size_t row () const noexcept
 
std::size_t column () const noexcept
 
Term::Button getButton () const noexcept
 
bool is (const Term::Button::Type &type, const Term::Button::Action &action) const noexcept
 
bool is (const Term::Button::Type &type) const noexcept
 
bool operator== (const Term::Mouse &mouse) const
 
bool operator!= (const Term::Mouse &mouse) const
 

Private Attributes

Term::Button m_buttons
 
std::uint16_t m_row {0}
 
std::uint16_t m_column {0}
 

Detailed Description

Definition at line 59 of file mouse.hpp.

Constructor & Destructor Documentation

◆ Mouse() [1/2]

Term::Mouse::Mouse ( )
default

◆ Mouse() [2/2]

Term::Mouse::Mouse ( const Term::Button & buttons,
const std::uint16_t & row,
const std::uint16_t & column )
inline

Definition at line 63 of file mouse.hpp.

63: m_buttons(buttons), m_row(row), m_column(column) {}
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
std::uint16_t m_row
Definition mouse.hpp:74
Term::Button m_buttons
Definition mouse.hpp:73

Member Function Documentation

◆ column()

std::size_t Term::Mouse::column ( ) const
noexcept

Definition at line 28 of file mouse.cpp.

28{ return static_cast<std::size_t>(m_column); }

◆ getButton()

Term::Button Term::Mouse::getButton ( ) const
noexcept

Definition at line 24 of file mouse.cpp.

24{ return m_buttons; }

◆ is() [1/2]

bool Term::Mouse::is ( const Term::Button::Type & type) const
noexcept

Definition at line 22 of file mouse.cpp.

22{ return m_buttons.type() == type; }
Term::Button::Type type() const noexcept
Definition mouse.cpp:14

◆ is() [2/2]

bool Term::Mouse::is ( const Term::Button::Type & type,
const Term::Button::Action & action ) const
noexcept

Definition at line 20 of file mouse.cpp.

20{ return (m_buttons.type() == type) && (m_buttons.action() == action); }
Term::Button::Action action() const noexcept
Definition mouse.cpp:12

◆ operator!=()

bool Term::Mouse::operator!= ( const Term::Mouse & mouse) const

Definition at line 31 of file mouse.cpp.

31{ return !(*this == mouse); }

◆ operator==()

bool Term::Mouse::operator== ( const Term::Mouse & mouse) const

Definition at line 30 of file mouse.cpp.

30{ return (m_row == mouse.m_row) && (m_column == mouse.m_column) && (m_buttons == mouse.m_buttons); }

◆ row()

std::size_t Term::Mouse::row ( ) const
noexcept

Definition at line 26 of file mouse.cpp.

26{ return static_cast<std::size_t>(m_row); }

Member Data Documentation

◆ m_buttons

Term::Button Term::Mouse::m_buttons
private

Definition at line 73 of file mouse.hpp.

◆ m_column

std::uint16_t Term::Mouse::m_column {0}
private

Definition at line 75 of file mouse.hpp.

75{0};

◆ m_row

std::uint16_t Term::Mouse::m_row {0}
private

Definition at line 74 of file mouse.hpp.

74{0};

The documentation for this class was generated from the following files: