Skip to content

Commit

Permalink
Revert "I'm a clever boy"
Browse files Browse the repository at this point in the history
This reverts commit 8084b1b.
  • Loading branch information
serebit committed Nov 3, 2023
1 parent 8084b1b commit 7fae4d4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/surface/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ Layer::~Layer() noexcept {
inline Server& Layer::get_server() const {
return server;
}

bool Layer::is_view() const {
return false;
}
1 change: 1 addition & 0 deletions src/surface/layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Layer : public Surface {
~Layer() noexcept;

inline Server& get_server() const override;
bool is_view() const override;
};

class LayerSubsurface {
Expand Down
4 changes: 4 additions & 0 deletions src/surface/popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ Popup::~Popup() noexcept {
constexpr Server& Popup::get_server() const {
return server;
}

constexpr bool Popup::is_view() const {
return false;
}
1 change: 1 addition & 0 deletions src/surface/popup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Popup : public Surface {
~Popup() noexcept;

constexpr Server& get_server() const override;
constexpr bool is_view() const override;
};

#endif
4 changes: 1 addition & 3 deletions src/surface/surface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ struct Surface {
virtual ~Surface() noexcept {};

virtual constexpr Server& get_server() const = 0;
constexpr bool is_view() const {
return std::is_base_of<View, decltype(this)>();
};
virtual bool is_view() const = 0;
};

#endif
3 changes: 3 additions & 0 deletions src/surface/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ struct View : public Surface {
virtual void map() = 0;
virtual void unmap() = 0;

constexpr bool is_view() const override {
return true;
}
void begin_interactive(const CursorMode mode, const uint32_t edges);
void set_position(const int new_x, const int new_y);
void set_size(const int new_width, const int new_height);
Expand Down

0 comments on commit 7fae4d4

Please sign in to comment.