2022-03-19 15:59:53 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
|
|
|
#include "../Window.hpp"
|
|
|
|
|
|
|
|
interface IHyprLayout {
|
|
|
|
public:
|
|
|
|
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called when a window is created (mapped)
|
|
|
|
*/
|
2022-03-20 11:14:24 +01:00
|
|
|
virtual void onWindowCreated(CWindow*) = 0;
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called when a window is removed (unmapped)
|
|
|
|
*/
|
2022-03-20 11:14:24 +01:00
|
|
|
virtual void onWindowRemoved(CWindow*) = 0;
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
2022-04-02 20:04:32 +02:00
|
|
|
Called when the monitor requires a layout recalculation
|
2022-03-21 19:18:33 +01:00
|
|
|
this usually means reserved area changes
|
|
|
|
*/
|
2022-03-20 11:14:24 +01:00
|
|
|
virtual void recalculateMonitor(const int&) = 0;
|
|
|
|
|
2022-04-02 20:04:32 +02:00
|
|
|
/*
|
|
|
|
Called when the compositor requests a window
|
|
|
|
to be recalculated, e.g. when pseudo is toggled.
|
|
|
|
*/
|
|
|
|
virtual void recalculateWindow(CWindow*) = 0;
|
|
|
|
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called when a window is requested to be floated
|
|
|
|
*/
|
2022-03-20 11:14:24 +01:00
|
|
|
virtual void changeWindowFloatingMode(CWindow*) = 0;
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called when a window is clicked on, beginning a drag
|
|
|
|
this might be a resize, move, whatever the layout defines it
|
|
|
|
as.
|
|
|
|
*/
|
2022-03-20 11:14:24 +01:00
|
|
|
virtual void onBeginDragWindow() = 0;
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called whenever the mouse moves, should the layout want to
|
|
|
|
do anything with it.
|
|
|
|
Useful for dragging.
|
|
|
|
*/
|
2022-03-20 11:14:24 +01:00
|
|
|
virtual void onMouseMove(const Vector2D&) = 0;
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called when a window is created, but is requesting to be floated.
|
|
|
|
Warning: this also includes stuff like popups, incorrect handling
|
|
|
|
of which can result in a crash!
|
|
|
|
*/
|
2022-03-20 13:37:07 +01:00
|
|
|
virtual void onWindowCreatedFloating(CWindow*) = 0;
|
2022-03-19 15:59:53 +01:00
|
|
|
|
2022-03-21 19:18:33 +01:00
|
|
|
/*
|
|
|
|
Called when a window requests to toggle its' fullscreen state.
|
|
|
|
The layout sets all the fullscreen flags.
|
|
|
|
It can either accept or ignore.
|
|
|
|
*/
|
|
|
|
virtual void fullscreenRequestForWindow(CWindow*) = 0;
|
|
|
|
|
2022-03-19 15:59:53 +01:00
|
|
|
};
|