Skip to content

Commit

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

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

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

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

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

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

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

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

#endif
3 changes: 0 additions & 3 deletions src/surface/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ 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 8084b1b

Please sign in to comment.