Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
915 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (C) 2016 P.L. Lucas | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
#include "lxqtbacklight.h" | ||
#include "lxqtbacklight/virtual_backend.h" | ||
#include "lxqtbacklight/linux_backend/linuxbackend.h" | ||
|
||
namespace LXQt { | ||
|
||
Backlight::Backlight(QObject *parent):QObject(parent) | ||
{ | ||
_backend = (VirtualBackEnd *) new LinuxBackend(this); | ||
connect(_backend, SIGNAL(backlightChanged(int)), this, SLOT(backlightChangedSlot(int))); | ||
} | ||
|
||
Backlight::~Backlight() | ||
{ | ||
delete _backend; | ||
} | ||
|
||
int Backlight::getBacklight() | ||
{ | ||
return _backend->getBacklight(); | ||
} | ||
|
||
int Backlight::getMaxBacklight() | ||
{ | ||
return _backend->getMaxBacklight(); | ||
} | ||
|
||
bool Backlight::isBacklightAvailable() | ||
{ | ||
return _backend->isBacklightAvailable(); | ||
} | ||
|
||
void Backlight::setBacklight(int value) | ||
{ | ||
_backend->setBacklight(value); | ||
} | ||
|
||
void Backlight::backlightChangedSlot(int value) | ||
{ | ||
emit backlightChanged(value); | ||
} | ||
|
||
} // namespace LXQt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2016 P.L. Lucas | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
#ifndef __Backlight_H__ | ||
#define __Backlight_H__ | ||
|
||
#include <QObject> | ||
#include "lxqtglobals.h" | ||
|
||
namespace LXQt | ||
{ | ||
class VirtualBackEnd; | ||
|
||
class LXQT_API Backlight : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
Backlight(QObject *parent = 0); | ||
~Backlight(); | ||
|
||
bool isBacklightAvailable(); | ||
void setBacklight(int value); | ||
int getBacklight(); | ||
int getMaxBacklight(); | ||
|
||
signals: | ||
void backlightChanged(int value); | ||
|
||
private slots: | ||
void backlightChangedSlot(int value); | ||
|
||
private: | ||
VirtualBackEnd *_backend; | ||
}; | ||
|
||
} // namespace LXQt | ||
|
||
#endif // __Backlight_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
project(lxqt-backlight_backend) | ||
|
||
set(C_FILES | ||
lxqtbacklight_backend.c | ||
) | ||
|
||
include_directories( | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set( CMAKE_BUILD_TYPE Release ) | ||
endif (NOT CMAKE_BUILD_TYPE) | ||
|
||
add_executable(${PROJECT_NAME} | ||
${C_FILES} | ||
) | ||
|
||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |
Oops, something went wrong.