cpp-terminal 1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
focus.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
12namespace Term
13{
14
15Focus::Focus(const Term::Focus::Type& type) : m_focus(type) {}
16
18
19bool Focus::in() const { return m_focus == Term::Focus::Type::In; }
20
21bool Focus::out() const { return m_focus == Term::Focus::Type::Out; }
22
23bool Term::Focus::operator==(const Term::Focus& focus) const { return m_focus == focus.m_focus; }
24
25bool Term::Focus::operator!=(const Term::Focus& focus) const { return !(*this == focus); }
26
27} // namespace Term
Class to return the focus of the terminal.
Definition focus.hpp:22
Term::Focus::Type m_focus
Definition focus.hpp:62
Focus()=default
bool in() const
Check is the focus is in.
Definition focus.cpp:19
bool operator!=(const Term::Focus &focus) const
Definition focus.cpp:25
@ Out
The terminal focus is out.
@ In
The terminal focus is in.
bool operator==(const Term::Focus &focus) const
Definition focus.cpp:23
Term::Focus::Type type() const
Get the type of focus.
Definition focus.cpp:17
bool out() const
Check is the focus is out.
Definition focus.cpp:21
Definition args.cpp:13