новые иконки в OpenBoard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OpenBoard/src/core/UBDisplayManager.h

140 lines
3.2 KiB

/*
9 years ago
* Copyright (C) 2015-2016 Département de l'Instruction Publique (DIP-SEM)
*
12 years ago
* Copyright (C) 2013 Open Education Foundation
*
12 years ago
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour
* l'Education Numérique en Afrique (GIP ENA)
*
12 years ago
* This file is part of OpenBoard.
*
* OpenBoard is free software: you can redistribute it and/or modify
12 years ago
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License,
* with a specific linking exception for the OpenSSL project's
* "OpenSSL" library (or with modified versions of it that use the
* same license as the "OpenSSL" library).
*
12 years ago
* OpenBoard is distributed in the hope that it will be useful,
14 years ago
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12 years ago
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 years ago
* GNU General Public License for more details.
14 years ago
*
12 years ago
* You should have received a copy of the GNU General Public License
12 years ago
* along with OpenBoard. If not, see <http://www.gnu.org/licenses/>.
*/
12 years ago
12 years ago
#ifndef UBDISPLAYMANAGER_H_
#define UBDISPLAYMANAGER_H_
#include <QtGui>
class UBBlackoutWidget;
class UBBoardView;
class QDesktopWidget;
class UBDisplayManager : public QObject
{
Q_OBJECT;
public:
UBDisplayManager(QObject *parent = 0);
virtual ~UBDisplayManager();
int numScreens();
int numPreviousViews();
13 years ago
void setControlWidget(QWidget* pControlWidget);
13 years ago
void setDisplayWidget(QWidget* pDisplayWidget);
13 years ago
void setDesktopWidget(QWidget* pControlWidget);
13 years ago
void setPreviousDisplaysWidgets(QList<UBBoardView*> pPreviousViews);
bool hasControl()
{
return mControlScreenIndex > -1;
}
bool hasDisplay()
{
return mDisplayScreenIndex > -1;
}
bool hasPrevious()
{
return !mPreviousScreenIndexes.isEmpty();
}
enum DisplayRole
{
None = 0, Control, Display, Previous1, Previous2, Previous3, Previous4, Previous5
};
Correct screen indexing in some cases Several issues remain with multi-screen mode on Linux. The behavior is inconsistent from one desktop evironment to the next, making it hard to work around these problems. Among the known issues at this stage: On Ubuntu 14.04, a call to QWidget::setGeometry requires the widget to be hidden on KDE, but visible on MATE, for the geometry changes to take effect. Despite the widget's geometry being updated by this call, the windows aren't necessarily moved. Meaning that the control and display widgets will tend to be displayed on the same monitor, even though their positions are correctly set to different areas on the extended screen. In the current state, this behavior is observed on MATE. Unity works fine and KDE only has transient positioning issues (for example, swapping control and display windows in multi-screen mode leads to both windows being placed on the same monitor, until multi-screen mode is turned off then on again). # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch dev # Your branch is ahead of 'origin/dev' by 29 commits. # (use "git push" to publish your local commits) # # Changes to be committed: # modified: src/core/UBApplicationController.cpp # modified: src/core/UBDisplayManager.cpp # modified: src/core/UBDisplayManager.h # # Changes not staged for commit: # modified: release_scripts/linux/build.sh # modified: release_scripts/linux/package.sh # # Untracked files: # release_scripts/linux/generateDependencies.sh #
9 years ago
bool useMultiScreen() { return mUseMultiScreen; }
void setUseMultiScreen(bool pUse);
int controleScreenIndex()
{
return mControlScreenIndex;
}
QRect controlGeometry();
QRect displayGeometry();
signals:
void screenLayoutChanged();
void adjustDisplayViewsRequired();
public slots:
13 years ago
void reinitScreens(bool bswap);
void adjustScreens(int screen);
void blackout();
void unBlackout();
void setRoleToScreen(DisplayRole role, int screenIndex);
void swapDisplayScreens(bool swap);
private:
void positionScreens();
void initScreenIndexes();
int mControlScreenIndex;
int mDisplayScreenIndex;
QList<int> mPreviousScreenIndexes;
QDesktopWidget* mDesktop;
QWidget* mControlWidget;
QWidget* mDisplayWidget;
QWidget *mDesktopWidget;
QList<UBBoardView*> mPreviousDisplayWidgets;
QList<UBBlackoutWidget*> mBlackoutWidgets;
QList<DisplayRole> mScreenIndexesRoles;
bool mUseMultiScreen;
};
#endif /* UBDISPLAYMANAGER_H_ */