1
// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
2
// Copyright © 2013 Canonical Ltd.
4
// This program is free software: you can redistribute it and/or modify it under
5
// the terms of the GNU Lesser General Public License version 3, as published by
6
// the Free Software Foundation.
8
// This program is distributed in the hope that it will be useful, but WITHOUT
9
// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
// Lesser General Public License for more details.
13
// You should have received a copy of the GNU Lesser General Public License
14
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#include "base/logging.h"
18
#include <surface_flinger/surface_flinger_compatibility_layer.h>
20
QUbuntuLegacyScreen::QUbuntuLegacyScreen() {
21
const int kScreenWidth = sf_get_display_width(SURFACE_FLINGER_DEFAULT_DISPLAY_ID);
22
const int kScreenHeight = sf_get_display_height(SURFACE_FLINGER_DEFAULT_DISPLAY_ID);
23
ASSERT(kScreenWidth > 0 && kScreenHeight > 0);
24
geometry_ = QRect(0, 0, kScreenWidth, kScreenHeight);
25
ASSERT((sfClient_ = sf_client_create_full(false)) != NULL);
26
DLOG("QUbuntuLegacyScreen::QUbuntuLegacyScreen (this=%p)", this);
29
QUbuntuLegacyScreen::~QUbuntuLegacyScreen() {
30
DLOG("QUbuntuLegacyScreen::~QUbuntuLegacyScreen");
31
// FIXME(loicm) Invalid because the struct is forward declarated, we need a way to clean the