aboutsummaryrefslogtreecommitdiff
path: root/src/layouts/tiling_layout.cc
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-09-26 12:23:19 +0200
committersrdusr <trevorgray@srdusr.com>2025-09-26 12:23:19 +0200
commite4a0432383331e013808a97b7c24707e4ddc4726 (patch)
tree3ef4465be03bc7b92a0b048f02f76475045404b6 /src/layouts/tiling_layout.cc
parent105732dde10b317a81d5a10a3f66b315d6f85015 (diff)
downloadsrdwm-e4a0432383331e013808a97b7c24707e4ddc4726.tar.gz
srdwm-e4a0432383331e013808a97b7c24707e4ddc4726.zip
Initial Commit
Diffstat (limited to 'src/layouts/tiling_layout.cc')
-rw-r--r--src/layouts/tiling_layout.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/layouts/tiling_layout.cc b/src/layouts/tiling_layout.cc
new file mode 100644
index 0000000..440c95a
--- /dev/null
+++ b/src/layouts/tiling_layout.cc
@@ -0,0 +1,38 @@
+#include "tiling_layout.h"
+#include <iostream>
+
+TilingLayout::TilingLayout() {
+ // Constructor implementation
+}
+
+TilingLayout::~TilingLayout() {
+ // Destructor implementation
+}
+
+void TilingLayout::arrange_windows(const std::vector<SRDWindow*>& windows, const Monitor& monitor) {
+ std::cout << "TilingLayout::arrange_windows called for monitor:" << std::endl;
+ std::cout << " Position: (" << monitor.x << ", " << monitor.y << "), Dimensions: (" << monitor.width << ", " << monitor.height << ")" << std::endl;
+ std::cout << " Number of windows: " << windows.size() << std::endl;
+
+ // Basic placeholder tiling logic (e.g., splitting the screen vertically)
+ if (!windows.empty()) {
+ int window_width = monitor.width / windows.size();
+ int current_x = monitor.x;
+
+ for (size_t i = 0; i < windows.size(); ++i) {
+ SRDWindow* window = windows[i];
+ // In a real implementation, you would calculate the desired
+ // position and size for the window based on the tiling algorithm
+ // and then call a method on the window object (which would
+ // internally use the platform backend) to apply these changes.
+ std::cout << " SRDWindow " << window->getId() << ": Placeholder position (" << current_x << ", " << monitor.y << "), size (" << window_width << ", " << monitor.height << ")" << std::endl;
+
+ // Update the window's properties in the SRDWindow object
+ window->setPosition(current_x, monitor.y);
+ window->setDimensions(current_x, monitor.y, window_width, monitor.height);
+
+
+ current_x += window_width;
+ }
+ }
+}