ttx 0.1.0
Loading...
Searching...
No Matches
ttx::MousePosition Class Reference

#include </home/runner/work/ttx/ttx/lib/include/ttx/mouse.h>

Public Member Functions

 MousePosition ()=default
 
constexpr MousePosition (MouseCoordinate cells, di::Optional< MouseCoordinate > pixels={})
 
constexpr auto in_cells () const -> MouseCoordinate
 
constexpr auto in_pixels () const -> di::Optional< MouseCoordinate >
 
constexpr auto in_pixels_with_fallback (dius::tty::WindowSize const &size) const -> MouseCoordinate
 
constexpr auto translate (MouseCoordinate offset_in_cells, dius::tty::WindowSize const &size) const -> MousePosition
 
auto operator== (MousePosition const &) const -> bool=default
 

Static Public Member Functions

static constexpr auto from_pixels (MouseCoordinate pixels, dius::tty::WindowSize const &size) -> MousePosition
 

Friends

constexpr friend auto tag_invoke (di::Tag< di::reflect >, di::InPlaceType< MousePosition >)
 

Constructor & Destructor Documentation

◆ MousePosition() [1/2]

ttx::MousePosition::MousePosition ( )
default

◆ MousePosition() [2/2]

ttx::MousePosition::MousePosition ( MouseCoordinate cells,
di::Optional< MouseCoordinate > pixels = {} )
inlineexplicitconstexpr

Member Function Documentation

◆ from_pixels()

static constexpr auto ttx::MousePosition::from_pixels ( MouseCoordinate pixels,
dius::tty::WindowSize const & size ) -> MousePosition
inlinestaticconstexpr

◆ in_cells()

auto ttx::MousePosition::in_cells ( ) const -> MouseCoordinate
inlineconstexpr

◆ in_pixels()

auto ttx::MousePosition::in_pixels ( ) const -> di::Optional<MouseCoordinate>
inlineconstexpr

◆ in_pixels_with_fallback()

auto ttx::MousePosition::in_pixels_with_fallback ( dius::tty::WindowSize const & size) const -> MouseCoordinate
inlineconstexpr

◆ operator==()

auto ttx::MousePosition::operator== ( MousePosition const & ) const -> bool=default
default

◆ translate()

auto ttx::MousePosition::translate ( MouseCoordinate offset_in_cells,
dius::tty::WindowSize const & size ) const -> MousePosition
inlineconstexpr

Friends And Related Symbol Documentation

◆ tag_invoke

friend auto tag_invoke ( di::Tag< di::reflect > ,
di::InPlaceType< MousePosition >  )
friend

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