2021-05-18 10:05:59 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-01-24 00:11:17 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2021 Symless Ltd.
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
2021-05-18 10:05:59 +00:00
|
|
|
*/
|
2024-08-08 17:41:59 +00:00
|
|
|
|
|
|
|
|
#pragma once
|
2021-05-18 10:05:59 +00:00
|
|
|
|
|
|
|
|
#include "Screen.h"
|
|
|
|
|
|
2024-10-17 18:04:35 +00:00
|
|
|
class ScreenList : public QList<Screen>
|
|
|
|
|
{
|
2024-07-02 19:07:06 +00:00
|
|
|
int m_width = 5;
|
2021-05-18 10:05:59 +00:00
|
|
|
|
|
|
|
|
public:
|
2024-07-02 19:07:06 +00:00
|
|
|
explicit ScreenList(int width = 5);
|
2021-05-18 10:05:59 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
/**
|
|
|
|
|
* @brief addScreenByPriority adds a new screen according to the following
|
|
|
|
|
* priority: 1.left side of the server 2.right side of the server 3.top 4.down
|
|
|
|
|
* 5.top left-hand diagonally
|
|
|
|
|
* 6.top right-hand diagonally
|
|
|
|
|
* 7.bottom right-hand diagonally
|
|
|
|
|
* 8.bottom left-hand diagonally
|
|
|
|
|
* 9.In case all places from the list have already booked, place in any spare
|
|
|
|
|
* place
|
|
|
|
|
* @param newScreen
|
|
|
|
|
*/
|
|
|
|
|
void addScreenByPriority(const Screen &newScreen);
|
2021-05-18 10:05:59 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
/**
|
|
|
|
|
* @brief addScreenToFirstEmpty adds screen into the first empty place
|
|
|
|
|
* @param newScreen
|
|
|
|
|
*/
|
|
|
|
|
void addScreenToFirstEmpty(const Screen &newScreen);
|
2021-08-20 12:22:07 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
/**
|
|
|
|
|
* @brief Returns true if screens are equal
|
|
|
|
|
* @param sc
|
|
|
|
|
*/
|
|
|
|
|
bool operator==(const ScreenList &sc) const;
|
2021-05-18 10:05:59 +00:00
|
|
|
};
|