Program Listing for File output.h¶
↰ Return to documentation for file (include/miral/miral/output.h
)
/*
* Copyright © Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 or 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MIRAL_OUTPUT_H
#define MIRAL_OUTPUT_H
#include <mir_toolkit/common.h>
#include <mir/geometry/rectangle.h>
#include <map>
#include <memory>
#include <optional>
namespace mir { namespace graphics { struct DisplayConfigurationOutput; } }
namespace miral
{
using namespace mir::geometry;
class Output
{
public:
struct PhysicalSizeMM { int width; int height; };
enum class Type
{
unknown,
vga,
dvii,
dvid,
dvia,
composite,
svideo,
lvds,
component,
ninepindin,
displayport,
hdmia,
hdmib,
tv,
edp
};
explicit Output(const mir::graphics::DisplayConfigurationOutput &output);
Output(Output const&);
Output& operator=(Output const&);
~Output();
auto type() const -> Type;
auto physical_size_mm() const -> PhysicalSizeMM;
auto connected() const -> bool;
auto used() const -> bool;
auto pixel_format() const -> MirPixelFormat;
auto refresh_rate() const -> double;
auto power_mode() const -> MirPowerMode;
auto orientation() const -> MirOrientation;
auto scale() const -> float;
auto form_factor() const -> MirFormFactor;
auto extents() const -> Rectangle;
auto id() const -> int;
auto name() const -> std::string;
auto attribute(std::string const& key) const -> std::optional<std::string>;
auto attributes_map() const -> std::map<std::string const, std::optional<std::string>>;
auto valid() const -> bool;
auto is_same_output(Output const& other) const -> bool;
auto logical_group_id() const -> int;
private:
std::shared_ptr<mir::graphics::DisplayConfigurationOutput> self;
};
bool operator==(Output::PhysicalSizeMM const& lhs, Output::PhysicalSizeMM const& rhs);
inline bool operator!=(Output::PhysicalSizeMM const& lhs, Output::PhysicalSizeMM const& rhs)
{ return !(lhs == rhs); }
auto equivalent_display_area(Output const& lhs, Output const& rhs) -> bool;
}
#endif //MIRAL_OUTPUT_H