.. _program_listing_file_include_miral_miral_window.h: Program Listing for File window.h ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``include/miral/miral/window.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * 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 . */ #ifndef MIRAL_WINDOW_H #define MIRAL_WINDOW_H #include "miral/application.h" #include #include #include namespace mir { namespace scene { class Surface; } } namespace miral { class Window { public: Window(); Window(Application const& application, std::shared_ptr const& surface); ~Window(); auto top_left() const -> mir::geometry::Point; auto size() const -> mir::geometry::Size; auto application() const -> Application; operator bool() const; void resize(mir::geometry::Size const& size); void move_to(mir::geometry::Point top_left); operator std::weak_ptr() const; operator std::shared_ptr() const; private: struct Self; std::shared_ptr self; friend bool operator==(Window const& lhs, Window const& rhs); friend bool operator==(std::shared_ptr const& lhs, Window const& rhs); friend bool operator==(Window const& lhs, std::shared_ptr const& rhs); friend bool operator<(Window const& lhs, Window const& rhs); }; bool operator==(Window const& lhs, Window const& rhs); bool operator==(std::shared_ptr const& lhs, Window const& rhs); bool operator==(Window const& lhs, std::shared_ptr const& rhs); bool operator<(Window const& lhs, Window const& rhs); inline bool operator!=(Window const& lhs, Window const& rhs) { return !(lhs == rhs); } inline bool operator!=(std::shared_ptr const& lhs, Window const& rhs) { return !(lhs == rhs); } inline bool operator!=(Window const& lhs, std::shared_ptr const& rhs) { return !(lhs == rhs); } inline bool operator>(Window const& lhs, Window const& rhs) { return rhs < lhs; } inline bool operator<=(Window const& lhs, Window const& rhs) { return !(lhs > rhs); } inline bool operator>=(Window const& lhs, Window const& rhs) { return !(lhs < rhs); } void PrintTo(Window const& bar, std::ostream* os); } #endif //MIRAL_WINDOW_H