This acts as a template for other app framework adoptions.
Using the weston ivi shell to control surfaces.
Using the input event manager to dispatch hard key inputs.
This is a bigger update, so I increased the version number from 0.1.1 to 0.2.0.
Some parts are under development.
I created the components "WindowsManager" and "InputEventManager" because they are not defined in AGL right now.
As soon as they are defined, we should switch to them.
Find more information on the official wiki page:
https://wiki.automotivelinux.org/homescreen
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
SUBDIRS = interfaces \
HomeScreen \
+ HomeScreenAppFrameworkBinderTizen \
HomeScreenSimulator \
- SampleAppTimeDate
+ InputEventManager \
+ SampleAppTimeDate \
+ WindowManager
HomeScreen.depends = interfaces
HomeScreenSimulator.depends = interfaces
+HomeScreenAppFrameworkBinderTizen.depends = interfaces
+InputEventManager.depends = interfaces
SampleAppTimeDate.depends = interfaces
+WindowManager.depends = interfaces
# remove generated files
QMAKE_CLEAN += -r \
TARGET = HomeScreen
TEMPLATE = app
-
SOURCES += \
src/main.cpp \
src/mainwindow.cpp \
src/settingswidget.cpp \
src/popupwidget.cpp \
src/controlbarwidget.cpp \
- src/statusbarwidget.cpp
+ src/statusbarwidget.cpp \
+ src/applauncherwidget.cpp \
+ src/homescreencontrolinterface.cpp
HEADERS += \
+ ../interfaces/appframework.h \
../interfaces/daynightmode.h \
../interfaces/popup.h \
+ ../interfaces/statusbar.h \
src/mainwindow.h \
src/settingswidget.h \
src/popupwidget.h \
src/controlbarwidget.h \
src/statusbarwidget.h \
- $$OUT_PWD/../interfaces/daynightmode_adapter.h \ #generated dbus adapter
- $$OUT_PWD/../interfaces/daynightmode_proxy.h \ #generated dbus proxy
- $$OUT_PWD/../interfaces/popup_adapter.h \ #generated dbus adapter
- $$OUT_PWD/../interfaces/popup_proxy.h \ #generated dbus proxy
- $$OUT_PWD/../interfaces/statusbar_adapter.h \ #generated dbus adapter
- $$OUT_PWD/../interfaces/statusbar_proxy.h #generated dbus proxy
+ src/applauncherwidget.h \
+ src/homescreencontrolinterface.h
INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += ../interfaces/
LIBS += -L$$OUT_PWD/../interfaces -linterfaces
resources/settingswidget.ui \
resources/popupwidget.ui \
resources/controlbarwidget.ui \
- resources/statusbarwidget.ui
+ resources/statusbarwidget.ui \
+ resources/applauncherwidget.ui
TRANSLATIONS = \
resources/translations/homescreen_en_US.ts \
# remove generated files
QMAKE_CLEAN += -r \
+ $$OUT_PWD/colorschemes \
$$OUT_PWD/HomeScreen \
$$OUT_PWD/Makefile
AGL repo for bitbake recipe:
https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+v0.2.0
+08/05/2016
+
+#new features
+- app launcher implemented
+- input event manager used for new control bar "nav" button
+
v0.1.1
07/06/2016
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AppLauncherWidget</class>
+ <widget class="QWidget" name="AppLauncherWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1080</width>
+ <height>1800</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form_AppLauncher</string>
+ </property>
+ <widget class="QWidget" name="widget_Background" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1080</width>
+ <height>1800</height>
+ </rect>
+ </property>
+ <widget class="QWidget" name="widget_Home_Icon" native="true">
+ <property name="geometry">
+ <rect>
+ <x>-40</x>
+ <y>1640</y>
+ <width>200</width>
+ <height>200</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
[ControlBarWidget]
pushButton_Home=:/icons/home_day.png
pushButton_Settings=:/icons/settings_day.png
+pushButton_Nav=:/icons/explore_day.png
widget_Background=background-image: url(:/images/backgrounds/bg_green_day.png)
[MainWindow]
widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
widget_Home_Icon="border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch;"
+[AppLauncherWidget]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Home_Icon="border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch;"
+
[PopupWidget]
label_Text="background-color: rgba(109, 109, 109, 0); background-image: url(:/images/transparency.png); border-image: url(:/images/transparency.png);"
widget_Popup="QWidget { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(242, 242, 249, 255), stop:1 rgba(255, 255, 255, 255)); color: #333; padding: 0px; } QWidget:on { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); }"
[ControlBarWidget]
pushButton_Home=:/icons/home_night.png
pushButton_Settings=:/icons/settings_night.png
+pushButton_Nav=:/icons/explore_night.png
widget_Background=background-image: url(:/images/backgrounds/bg_green_night.png)
[MainWindow]
widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
widget_Home_Icon="border-image: url(:/icons/home_night.png) 0 0 0 0 stretch stretch;"
+[AppLauncherWidget]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Home_Icon="border-image: url(:/icons/home_night.png) 0 0 0 0 stretch stretch;"
+
[PopupWidget]
label_Text="background-color: rgba(109, 109, 109, 0); background-image: url(:/images/transparency.png); border-image: url(:/images/transparency.png);"
widget_Popup="QWidget { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(147, 147, 151, 255), stop:1 rgba(255, 255, 255, 255)); color: #333; padding: 0px; } QWidget:on { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); }"
</size>
</property>
</widget>
+ <widget class="QPushButton" name="pushButton_Nav">
+ <property name="geometry">
+ <rect>
+ <x>110</x>
+ <y>10</y>
+ <width>40</width>
+ <height>40</height>
+ </rect>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background-image: url(:/images/transparency.png);
+border-image: url(:/images/transparency.png);</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="homescreen.qrc">
+ <normaloff>:/icons/explore_day.png</normaloff>:/icons/explore_day.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>40</width>
+ <height>40</height>
+ </size>
+ </property>
+ </widget>
</widget>
</widget>
<resources>
<file alias="icons/home_night.png">images/icons/Black/01.Home.png</file>
<file alias="icons/settings_day.png">images/icons/White/45.Settings.png</file>
<file alias="icons/settings_night.png">images/icons/Black/45.Settings.png</file>
+ <file alias="icons/explore_day.png">images/icons/White/47.Explore.png</file>
+ <file alias="icons/explore_night.png">images/icons/Black/47.Explore.png</file>
<file>translations/homescreen_de_DE.qm</file>
<file>translations/homescreen_en_US.qm</file>
<file>translations/homescreen_ja_JP.qm</file>
</rect>
</property>
<property name="windowTitle">
- <string>Form</string>
+ <string>Form_Popup</string>
</property>
<widget class="QWidget" name="widget_Popup" native="true">
<property name="geometry">
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "applauncherwidget.h"
+#include "ui_applauncherwidget.h"
+#include <include/daynightmode.hpp>
+#include <QSettings>
+
+#define APP_LIST_COLUMN_COUNT 5
+
+AppLauncherWidget::AppLauncherWidget(QWidget *parent) :
+ QWidget(parent),
+ mp_ui(new Ui::AppLauncherWidget),
+ mp_appList(new QList<AppInfo>()),
+ mp_appTable(0),
+ mp_dBusAppFrameworkProxy()
+{
+ mp_ui->setupUi(this);
+
+ AppInfo ai;
+ for (int i = 0; i < 100; ++i)
+ {
+ ai.setName("test" + QString::number(i));
+ mp_appList->append(ai);
+ }
+
+ qDebug("D-Bus: connect to org.agl.homescreenappframeworkbindertizen /AppFramework");
+ mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbindertizen",
+ "/AppFramework",
+ QDBusConnection::sessionBus(),
+ 0);
+
+ populateAppList();
+}
+
+AppLauncherWidget::~AppLauncherWidget()
+{
+ delete mp_dBusAppFrameworkProxy;
+ if (0 != mp_appTable)
+ {
+ delete mp_appTable;
+ }
+ delete mp_appList;
+ delete mp_ui;
+}
+
+void AppLauncherWidget::updateColorScheme()
+{
+ QSettings settings;
+ QSettings settings_cs(QApplication::applicationDirPath() +
+ "/colorschemes/" +
+ settings.value("systemsettings/colorscheme", "default").toString() +
+ "/" +
+ QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
+ ".ini",
+ QSettings::IniFormat);
+
+ mp_ui->widget_Background->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Background").toString());
+ mp_ui->widget_Home_Icon->setStyleSheet(settings_cs.value("AppLauncherWidget/widget_Home_Icon").toString());
+}
+
+void AppLauncherWidget::populateAppList()
+{
+ setStyleSheet("QTableWidget {background-color: transparent;}"
+ "QTableCornerButton::section {background-color: transparent;}");
+
+ if (0 == mp_appTable)
+ {
+ mp_appTable = new QTableWidget(this);
+ QObject::connect(mp_appTable, SIGNAL(cellClicked(int, int)), this, SLOT(on_tableView_clicked(int, int)));
+ }
+ else
+ {
+ mp_appTable->clear();
+ }
+
+ mp_appTable->setShowGrid(false);
+ mp_appTable->setFrameShape(QFrame::NoFrame);
+ mp_appTable->move(40, 40);
+ mp_appTable->resize(1000, 1920 - 40 - 40 - 60 - 60);
+ mp_appTable->horizontalHeader()->setVisible(false);
+ mp_appTable->verticalHeader()->setVisible(false);
+ mp_appTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ mp_appTable->setRowCount(100);
+ mp_appTable->setColumnCount(APP_LIST_COLUMN_COUNT);
+
+ int i;
+
+ QStringList apps = mp_dBusAppFrameworkProxy->getAvailableAppNames();
+ mp_appList->clear();
+
+ mp_appTable->setRowCount((apps.size() + (APP_LIST_COLUMN_COUNT - 1)) / APP_LIST_COLUMN_COUNT);
+
+ if (apps.size() >= (9 * APP_LIST_COLUMN_COUNT))
+ {
+ mp_appTable->resize(1000, 1920 - 40 - 40 - 60 - 60);
+ }
+ else
+ {
+ mp_appTable->resize(1000, mp_appTable->rowCount() * 190);
+ }
+
+
+ for (i = 0; i < (mp_appTable->rowCount() * APP_LIST_COLUMN_COUNT); i++)
+ {
+ mp_appTable->verticalHeader()->resizeSection(i, 190);
+ mp_appTable->horizontalHeader()->resizeSection(i, 190);
+ }
+
+ AppInfo ai;
+ for (i = 0; i < apps.size(); ++i)
+ {
+ qDebug("new app: %s", apps.at(i).toStdString().c_str());
+ ai.setName(apps.at(i));
+ mp_appList->append(ai);
+ }
+
+ for (i = 0; i < mp_appList->size(); i++)
+ {
+ mp_appTable->setItem(i / APP_LIST_COLUMN_COUNT,
+ i % APP_LIST_COLUMN_COUNT,
+ new QTableWidgetItem(mp_appList->at(i).getName()));
+ mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
+ i % APP_LIST_COLUMN_COUNT)->setFlags(Qt::ItemIsEnabled);
+ mp_appTable->item(i / APP_LIST_COLUMN_COUNT,
+ i % APP_LIST_COLUMN_COUNT)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ }
+
+
+}
+
+void AppLauncherWidget::on_tableView_clicked(int row, int col)
+{
+ if (mp_appList->size() > row * APP_LIST_COLUMN_COUNT + col)
+ {
+ int pid = mp_dBusAppFrameworkProxy->launchApp(mp_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName());
+ qDebug("%d, %d: start app %s", row, col, mp_appList->at(row * APP_LIST_COLUMN_COUNT + col).getName().toStdString().c_str());
+ qDebug("pid: %d", pid);
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef APPLAUNCHERWIDGET_H
+#define APPLAUNCHERWIDGET_H
+
+#include <QWidget>
+#include <QList>
+#include <QTableWidget>
+#include <include/appframework.hpp>
+#include <appframework_proxy.h>
+
+namespace Ui {
+class AppLauncherWidget;
+}
+
+class AppLauncherWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit AppLauncherWidget(QWidget *parent = 0);
+ ~AppLauncherWidget();
+public slots:
+ void updateColorScheme();
+
+private slots:
+ void on_tableView_clicked(int row, int col);
+
+private:
+ Ui::AppLauncherWidget *mp_ui;
+ QList<AppInfo> *mp_appList;
+ QTableWidget *mp_appTable;
+ org::agl::appframework *mp_dBusAppFrameworkProxy;
+ void populateAppList();
+};
+
+#endif // APPLAUNCHERWIDGET_H
#include "controlbarwidget.h"
#include "ui_controlbarwidget.h"
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
+#include <include/inputevent.hpp>
#include <QSettings>
ControlBarWidget::ControlBarWidget(QWidget *parent) :
QWidget(parent),
- mp_ui(new Ui::ControlBarWidget)
+ mp_ui(new Ui::ControlBarWidget),
+ mp_dBusInputEventProxy()
{
mp_ui->setupUi(this);
+
+ qDebug("D-Bus: connect to org.agl.homescreenappframeworkbindertizen /AppFramework");
+ mp_dBusInputEventProxy = new org::agl::inputevent("org.agl.inputeventmanager",
+ "/InputEvent",
+ QDBusConnection::sessionBus(),
+ 0);
}
ControlBarWidget::~ControlBarWidget()
{
+ delete mp_dBusInputEventProxy;
delete mp_ui;
}
mp_ui->pushButton_Home->setIcon(icon);
icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Settings")).toString(), QSize(), QIcon::Normal, QIcon::Off);
mp_ui->pushButton_Settings->setIcon(icon);
+ icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Nav")).toString(), QSize(), QIcon::Normal, QIcon::Off);
+ mp_ui->pushButton_Nav->setIcon(icon);
}
void ControlBarWidget::on_pushButton_Settings_clicked()
{
emit homeButtonPressed();
}
+
+void ControlBarWidget::on_pushButton_Nav_clicked()
+{
+ mp_dBusInputEventProxy->hardKeyPressed(InputEvent::HARDKEY_NAV);
+}
#define CONTROLBARWIDGET_H
#include <QWidget>
+#include "inputevent_proxy.h"
namespace Ui {
class ControlBarWidget;
private slots:
void on_pushButton_Settings_clicked();
void on_pushButton_Home_clicked();
+ void on_pushButton_Nav_clicked();
private:
Ui::ControlBarWidget *mp_ui;
+ org::agl::inputevent *mp_dBusInputEventProxy;
};
#endif // CONTROLBARWIDGET_H
--- /dev/null
+#include "homescreencontrolinterface.h"
+
+HomeScreenControlInterface::HomeScreenControlInterface(QObject *parent) :
+ QObject(parent),
+ mp_homeScreenAdaptor(0),
+ mp_dBusAppFrameworkProxy()
+{
+ // publish dbus homescreen interface
+ mp_homeScreenAdaptor = new HomescreenAdaptor((QObject*)this);
+ QDBusConnection dbus = QDBusConnection::sessionBus();
+ dbus.registerObject("/HomeScreen", this);
+ dbus.registerService("org.agl.homescreen");
+
+ qDebug("D-Bus: connect to org.agl.homescreenappframeworkbindertizen /AppFramework");
+ mp_dBusAppFrameworkProxy = new org::agl::appframework("org.agl.homescreenappframeworkbindertizen",
+ "/AppFramework",
+ QDBusConnection::sessionBus(),
+ 0);
+}
+
+HomeScreenControlInterface::~HomeScreenControlInterface()
+{
+ delete mp_dBusAppFrameworkProxy;
+ delete mp_homeScreenAdaptor;
+}
+
+void HomeScreenControlInterface::hardKeyPressed(int key)
+{
+ int pid = -1;
+
+ switch (key)
+ {
+ case InputEvent::HARDKEY_NAV:
+ qDebug("hardKeyPressed NAV key pressed!");
+ pid = mp_dBusAppFrameworkProxy->launchApp("demoapp");
+ qDebug("pid: %d", pid);
+ break;
+ default:
+ qDebug("hardKeyPressed %d", key);
+ break;
+ }
+}
--- /dev/null
+#ifndef HOMESCREENCONTROLINTERFACE_H
+#define HOMESCREENCONTROLINTERFACE_H
+
+#include <QObject>
+#include "include/homescreen.hpp"
+#include "homescreen_adapter.h"
+#include <include/appframework.hpp>
+#include <appframework_proxy.h>
+
+class HomeScreenControlInterface : public QObject
+{
+ Q_OBJECT
+public:
+ explicit HomeScreenControlInterface(QObject *parent = 0);
+ ~HomeScreenControlInterface();
+
+signals:
+
+public slots:
+
+//from homescreen_adapter.h
+public Q_SLOTS: // METHODS
+ void hardKeyPressed(int key);
+
+private:
+ HomescreenAdaptor *mp_homeScreenAdaptor;
+ org::agl::appframework *mp_dBusAppFrameworkProxy;
+};
+
+#endif // HOMESCREENCONTROLINTERFACE_H
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
QCoreApplication::setApplicationName("HomeScreen");
- QCoreApplication::setApplicationVersion("0.1.1");
+ QCoreApplication::setApplicationVersion("0.2.0");
- // maybe trigger the wayland compositor to position the surface correctly
MainWindow w;
- w.move(0, 0);
w.show();
+#ifdef __arm__
+ // trigger wayland compositor to position the surface correctly
+#endif
+#ifdef __i386__
+ w.move(0, 0);
+#endif
#ifdef __arm__
#include "mainwindow.h"
#include "ui_mainwindow.h"
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
mp_statusBarWidget(0),
mp_controlBarWidget(0),
mp_settingsWidget(0),
+ mp_applauncherwidget(0),
mp_popupWidget(0),
- mp_dayNightModeProxy(0)
+ mp_dBusDayNightModeProxy(0),
+ mp_homeScreenControlInterface(0)
{
// this has to be adopted to the system setup
- mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
+ mp_dBusDayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
"/",
QDBusConnection::sessionBus(),
0);
- QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
+ QObject::connect(mp_dBusDayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
// dbus setup
QDBusConnection dbus = QDBusConnection::sessionBus();
// no window decoration
setWindowFlags(Qt::FramelessWindowHint);
+
mp_ui->setupUi(this);
mp_statusBarWidget = new StatusBarWidget(this);
mp_settingsWidget->raise();
// apply layout
mp_settingsWidget->move(0, 60);
- mp_settingsWidget->hide();
+ //mp_settingsWidget->hide();
+
+ mp_applauncherwidget = new AppLauncherWidget(this);
+ mp_applauncherwidget->raise();
+ // apply layout
+ mp_applauncherwidget->move(0, 60);
- mp_popupWidget = new PopupWidget(this);
+ mp_popupWidget = new PopupWidget();
mp_controlBarWidget->raise();
// apply layout
mp_popupWidget->move(0, 0);
+
QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), this, SLOT(updateColorScheme()));
QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_statusBarWidget, SLOT(updateColorScheme()));
QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_controlBarWidget, SLOT(updateColorScheme()));
QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_settingsWidget, SLOT(updateColorScheme()));
QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_popupWidget, SLOT(updateColorScheme()));
- QObject::connect(mp_controlBarWidget, SIGNAL(settingsButtonPressed()), mp_settingsWidget, SLOT(show()));
- QObject::connect(mp_controlBarWidget, SIGNAL(homeButtonPressed()), mp_settingsWidget, SLOT(hide()));
+ QObject::connect(mp_controlBarWidget, SIGNAL(settingsButtonPressed()), mp_settingsWidget, SLOT(raise()));
+ QObject::connect(mp_controlBarWidget, SIGNAL(homeButtonPressed()), mp_applauncherwidget, SLOT(raise()));
// apply color scheme
updateColorScheme();
mp_statusBarWidget->updateColorScheme();
mp_controlBarWidget->updateColorScheme();
mp_settingsWidget->updateColorScheme();
+ mp_applauncherwidget->updateColorScheme();
mp_popupWidget->updateColorScheme();
+ // this is only useful during development and will be removed later
setWindowIcon(QIcon(":/icons/home_day.png"));
+
+ mp_homeScreenControlInterface = new HomeScreenControlInterface(this);
}
MainWindow::~MainWindow()
{
- delete mp_dayNightModeProxy;
+ delete mp_homeScreenControlInterface;
+
+ delete mp_dBusDayNightModeProxy;
delete mp_popupWidget;
+ delete mp_applauncherwidget;
delete mp_settingsWidget;
delete mp_controlBarWidget;
delete mp_statusBarWidget;
mp_statusBarWidget->updateColorScheme();
mp_controlBarWidget->updateColorScheme();
mp_settingsWidget->updateColorScheme();
+ mp_applauncherwidget->updateColorScheme();
mp_popupWidget->updateColorScheme();
}
QMainWindow::changeEvent(event);
}
+
+void MainWindow::on_pushButton_clicked()
+{
+ // start app
+ QProcess process;
+ QString file = "vlc";
+ process.startDetached(file);
+ // manage ivi shell
+}
#include <QMainWindow>
#include "daynightmode_proxy.h"
+#include "homescreencontrolinterface.h"
+
#include "statusbarwidget.h"
#include "controlbarwidget.h"
#include "settingswidget.h"
+#include "applauncherwidget.h"
#include "popupwidget.h"
public Q_SLOTS:
void dayNightModeSlot(int mode);
+
public slots:
void updateColorScheme();
// called when the translator loaded a new language set
void changeEvent(QEvent* event);
+private slots:
+ void on_pushButton_clicked();
+
private:
Ui::MainWindow *mp_ui;
ControlBarWidget *mp_controlBarWidget;
org::agl::daynightmode *mp_dBusDayNightMode_ControlBarWidget;
SettingsWidget *mp_settingsWidget;
+ AppLauncherWidget *mp_applauncherwidget;
PopupWidget *mp_popupWidget;
- org::agl::daynightmode *mp_dayNightModeProxy;
+ org::agl::daynightmode *mp_dBusDayNightModeProxy;
+
+ HomeScreenControlInterface *mp_homeScreenControlInterface;
};
#endif // MAINWINDOW_H
#include "popupwidget.h"
#include "ui_popupwidget.h"
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
PopupWidget::PopupWidget(QWidget *parent) :
QWidget(parent),
dbus.registerObject("/Popup", this);
dbus.registerService("org.agl.homescreen");
+ // no window decoration
+ setWindowFlags(Qt::FramelessWindowHint);
+
mp_ui->setupUi(this);
+
this->close();
}
#define POPUPWIDGET_H
#include <QWidget>
-#include "../interfaces/popup.h"
+#include <include/popup.hpp>
#include "popup_adapter.h"
namespace Ui {
Ui::PopupWidget *mp_ui;
PopupAdaptor *mp_popupAdaptor;
+ // for showPupupFor LayoutSelection
+ //QList<QPushButton> m_pushButtons;
};
#endif // POPUPWIDGET_H
#include "settingswidget.h"
#include "ui_settingswidget.h"
#include <QSettings>
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
SettingsWidget::SettingsWidget(QWidget *parent) :
QWidget(parent),
#include "statusbarwidget.h"
#include "ui_statusbarwidget.h"
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
StatusBarWidget::StatusBarWidget(QWidget *parent) :
QWidget(parent),
--- /dev/null
+# manually added:
+.DS_Store
+
+# Created by https://www.gitignore.io/api/linux,qt,c,c++
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+
+### Qt ###
+# C++ objects and libs
+
+*.slo
+*.lo
+*.o
+*.a
+*.la
+*.lai
+*.so
+*.dll
+*.dylib
+
+# Qt-es
+
+/.qmake.cache
+/.qmake.stash
+*.pro.user
+*.pro.user.*
+*.qbs.user
+*.qbs.user.*
+*.moc
+moc_*.cpp
+qrc_*.cpp
+ui_*.h
+Makefile*
+*build-*
+
+# QtCreator
+
+*.autosave
+
+# QtCtreator Qml
+*.qmlproject.user
+*.qmlproject.user.*
+
+# QtCtreator CMake
+CMakeLists.txt.user
+
+
+
+### C ###
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+
+
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
--- /dev/null
+# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+QT += core dbus
+QT -= gui
+
+TARGET = HomeScreenAppFrameworkBinderTizen
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += src/main.cpp \
+ src/homescreenappframeworkbindertizen.cpp
+
+HEADERS += \
+ src/homescreenappframeworkbindertizen.h
+
+INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += ../interfaces/
+
+LIBS += -L$$OUT_PWD/../interfaces -linterfaces
+
+contains(QT_ARCH, arm.*) {
+ LIBS += -lpkgmgr-info
+ LIBS += -laul
+}
+
+OTHER_FILES += \
+ README.md
+
+# remove generated files
+QMAKE_CLEAN += -r \
+ $$OUT_PWD/HomeScreenAppFrameworkBinderTizen \
+ $$OUT_PWD/Makefile
--- /dev/null
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
--- /dev/null
+AGL Home Screen AppFramework Binder for Tizen App Framework
+
+
+Build with QtCreator 3.0.1
+
+AGL repo for source code:
+https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen
+
+AGL repo for bitbake recipe:
+https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.2.0
+08/05/2016
+
+#new features
+- initial version
+
+#TODOs
+
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "homescreenappframeworkbindertizen.h"
+
+
+HomeScreenAppFrameworkBinderTizen::HomeScreenAppFrameworkBinderTizen(QObject *parent) :
+ QObject(parent),
+ mp_appframeworkAdaptor(0)
+{
+ qDebug("D-Bus: register as org.agl.homescreenappframeworkbindertizen");
+
+ m_apps.clear();
+
+ // publish app framework interface
+ mp_appframeworkAdaptor = new AppframeworkAdaptor((QObject*)this);
+ QDBusConnection dbus = QDBusConnection::sessionBus();
+ dbus.registerObject("/AppFramework", this);
+ dbus.registerService("org.agl.homescreenappframeworkbindertizen");
+
+#ifdef __arm__
+ pkgmgrinfo_pkginfo_get_list(HomeScreenAppFrameworkBinderTizen::pkg_list_cb_static, this);
+ //list_pkgs(this);
+#endif
+#ifdef __i386__
+ // for the simulation
+ AppInfo ai;
+ ai.setName("org.test.app1");
+ ai.setDescription("testdesc1");
+ ai.setIconPath("https://www.automotivelinux.org/sites/cpstandard/files/logo.png");
+ m_apps.append(ai);
+ ai.setName("org.test.app2");
+ ai.setDescription("testdesc2");
+ m_apps.append(ai);
+#endif
+}
+
+HomeScreenAppFrameworkBinderTizen::~HomeScreenAppFrameworkBinderTizen()
+{
+ delete mp_appframeworkAdaptor;
+}
+
+QStringList HomeScreenAppFrameworkBinderTizen::getAvailableAppNames()
+{
+ QStringList result;
+ for (int i = 0; i < m_apps.size(); ++i)
+ {
+ result.append(m_apps.at(i).getName());
+ }
+ qDebug("size: %d", result.size());
+ return result;
+}
+
+int HomeScreenAppFrameworkBinderTizen::launchApp(const QString &name)
+{
+ int pid = -1;
+#ifdef __arm__
+ qDebug("launchApp name: %s", name.toStdString().c_str());
+ pid = aul_launch_app(name.toStdString().c_str(), 0);
+ qDebug("launchApp pid: %d", pid);
+#endif
+#ifdef __i386__
+ qDebug("launchApp name: %s", name.toStdString().c_str());
+#endif
+
+ return pid;
+}
+
+void HomeScreenAppFrameworkBinderTizen::clearAppList()
+{
+ m_apps.clear();
+}
+
+void HomeScreenAppFrameworkBinderTizen::appendAppName(const char* name)
+{
+ AppInfo newApp;
+ newApp.setName(QString(name));
+ m_apps.append(newApp);
+}
+
+#ifdef __arm__
+void HomeScreenAppFrameworkBinderTizen::pkg_list_cb_non_static(pkgmgrinfo_pkginfo_h handle)
+{
+ qDebug("pkg_list_cb_non_static");
+ char *pkgid2 = NULL;
+ pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
+ printf("pkg_list_cb_non_static: %s\n", pkgid2);
+ appendAppName(pkgid2);
+}
+
+int HomeScreenAppFrameworkBinderTizen::pkg_list_cb_static(pkgmgrinfo_pkginfo_h handle, void *user_data)
+{
+ qDebug("pkg_list_cb_static");
+ static_cast<HomeScreenAppFrameworkBinderTizen*>(user_data)->pkg_list_cb_non_static(handle);
+}
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HOMESCREENAPPFRAMEWORKBINDERTIZEN_H
+#define HOMESCREENAPPFRAMEWORKBINDERTIZEN_H
+
+#include <QObject>
+#include <include/appframework.hpp>
+#include "appframework_adapter.h"
+
+#ifdef __arm__
+extern "C" {
+#include "aul/aul.h"
+#include "pkgmgr-info.h"
+}
+#endif
+
+class HomeScreenAppFrameworkBinderTizen : public QObject
+{
+ Q_OBJECT
+public:
+ explicit HomeScreenAppFrameworkBinderTizen(QObject *parent = 0);
+ ~HomeScreenAppFrameworkBinderTizen();
+private:
+ AppframeworkAdaptor *mp_appframeworkAdaptor;
+ QList<AppInfo> m_apps;
+
+ //from appframework_adapter.h
+public Q_SLOTS: // METHODS
+ QStringList getAvailableAppNames();
+ int launchApp(const QString &name);
+
+public:
+ void clearAppList();
+ void appendAppName(const char* name);
+
+#ifdef __arm__
+ void pkg_list_cb_non_static(pkgmgrinfo_pkginfo_h handle);
+ static int pkg_list_cb_static(pkgmgrinfo_pkginfo_h handle, void *user_data);
+#endif
+
+public slots:
+
+};
+
+#endif // HOMESCREENAPPFRAMEWORKBINDERTIZEN_H
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <QCoreApplication>
+#include "homescreenappframeworkbindertizen.h"
+
+int main(int argc, char *argv[])
+{
+ AppInfo::registerMetaType();
+
+ QCoreApplication a(argc, argv);
+
+ // used for application settings (QSettings)
+ QCoreApplication::setOrganizationDomain("LinuxFoundation");
+ QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
+ QCoreApplication::setApplicationName("HomeScreenAppFrameworkBinderTizen");
+ QCoreApplication::setApplicationVersion("0.2.0");
+
+ HomeScreenAppFrameworkBinderTizen *tdp = new HomeScreenAppFrameworkBinderTizen();
+
+ return a.exec();
+}
HEADERS += \
../interfaces/daynightmode.h \
../interfaces/popup.h \
- src/mainwindow.h \
- $$OUT_PWD/../interfaces/daynightmode_adapter.h \ #generated dbus adapter
- $$OUT_PWD/../interfaces/daynightmode_proxy.h \ #generated dbus proxy
- $$OUT_PWD/../interfaces/popup_adapter.h \ #generated dbus adapter
- $$OUT_PWD/../interfaces/popup_proxy.h \ #generated dbus proxy
- $$OUT_PWD/../interfaces/statusbar_adapter.h \ #generated dbus adapter
- $$OUT_PWD/../interfaces/statusbar_proxy.h #generated dbus proxy
+ src/mainwindow.h
INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += ../interfaces
LIBS += -L$$OUT_PWD/../interfaces -linterfaces
AGL repo for bitbake recipe:
https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+v0.2.0
+08/05/2016
+
+#changes
+- just new version number
+
v0.1.1
07/06/2015
<rect>
<x>20</x>
<y>380</y>
- <width>221</width>
+ <width>211</width>
<height>27</height>
</rect>
</property>
<widget class="QTableWidget" name="tableWidget_Status">
<property name="geometry">
<rect>
- <x>20</x>
+ <x>30</x>
<y>20</y>
<width>681</width>
<height>341</height>
</rect>
</property>
</widget>
+ <widget class="QPushButton" name="pushButton_PopupExample">
+ <property name="geometry">
+ <rect>
+ <x>428</x>
+ <y>380</y>
+ <width>171</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>"Hello World" Example</string>
+ </property>
+ </widget>
</widget>
<widget class="QWidget" name="tab_DayNightMode">
<attribute name="title">
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
QCoreApplication::setApplicationName("HomeScreenSimulator");
- QCoreApplication::setApplicationVersion("0.1.1");
+ QCoreApplication::setApplicationVersion("0.2.0");
MainWindow w;
w.show();
- // TODO: input handling not defined right now...
- /*InputEventDistributor *mp_inputEventDistributor;
- mp_inputEventDistributor = new InputEventDistributor();*/
-
-
// start input and system settings simulator on developer PCs
#ifdef __arm__
qDebug("Running on ARM architecture");
// Home Screen app resources...
mp_ui->tableWidget_Status->setItem(0, 2, new QTableWidgetItem(":/icons/home_day.png"));
}
+
+void MainWindow::on_pushButton_PopupExample_clicked()
+{
+ mp_dBusPopupProxy->showPopup(0, "Hello Popup!\nNice to see you!");
+}
#define MAINWINDOW_H
#include <QMainWindow>
-#include "../interfaces/daynightmode.h"
+#include <include/daynightmode.hpp>
#include "daynightmode_adapter.h"
#include "statusbar_proxy.h"
void on_pushButton_IconExample_clicked();
+ void on_pushButton_PopupExample_clicked();
+
private:
Ui::MainWindow *mp_ui;
DaynightmodeAdaptor *mp_dBusDayNightModeAdapter;
--- /dev/null
+# manually added:
+.DS_Store
+
+# Created by https://www.gitignore.io/api/linux,qt,c,c++
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+
+### Qt ###
+# C++ objects and libs
+
+*.slo
+*.lo
+*.o
+*.a
+*.la
+*.lai
+*.so
+*.dll
+*.dylib
+
+# Qt-es
+
+/.qmake.cache
+/.qmake.stash
+*.pro.user
+*.pro.user.*
+*.qbs.user
+*.qbs.user.*
+*.moc
+moc_*.cpp
+qrc_*.cpp
+ui_*.h
+Makefile*
+*build-*
+
+# QtCreator
+
+*.autosave
+
+# QtCtreator Qml
+*.qmlproject.user
+*.qmlproject.user.*
+
+# QtCtreator CMake
+CMakeLists.txt.user
+
+
+
+### C ###
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+
+
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
--- /dev/null
+# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+QT += core dbus
+QT -= gui
+
+TARGET = InputEventManager
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += src/main.cpp \
+ src/inputeventmanager.cpp
+
+HEADERS += \
+ src/inputeventmanager.h
+
+INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += ../interfaces/
+
+LIBS += -L$$OUT_PWD/../interfaces -linterfaces
+
+#contains(QT_ARCH, arm.*) {
+# LIBS += -lpkgmgr-info
+# LIBS += -laul
+#}
+
+OTHER_FILES += \
+ README.md
+
+# remove generated files
+QMAKE_CLEAN += -r \
+ $$OUT_PWD/InputEventManager \
+ $$OUT_PWD/Makefile
--- /dev/null
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
--- /dev/null
+AGL InputEventManager Sample App
+
+
+Build with QtCreator 3.0.1
+
+AGL repo for source code:
+https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen
+
+AGL repo for bitbake recipe:
+https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.2.0
+08/05/2016
+
+#new features
+- initial version
+
+#TODOs
+
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "inputeventmanager.h"
+#include "include/inputevent.hpp"
+
+
+InputEventManager::InputEventManager(QObject *parent) :
+ QObject(parent),
+ mp_inputEventAdaptor(0),
+ mp_dBusHomeScreenProxy(0)
+{
+ qDebug("D-Bus: register as org.agl.inputeventmanager");
+
+ // publish app framework interface
+ mp_inputEventAdaptor = new InputeventAdaptor((QObject*)this);
+ QDBusConnection dbus = QDBusConnection::sessionBus();
+ dbus.registerObject("/InputEvent", this);
+ dbus.registerService("org.agl.inputeventmanager");
+
+
+ qDebug("D-Bus: connect to org.agl.homescreen /HomeScreen");
+ mp_dBusHomeScreenProxy = new org::agl::homescreen("org.agl.homescreen",
+ "/HomeScreen",
+ QDBusConnection::sessionBus(),
+ 0);
+}
+
+InputEventManager::~InputEventManager()
+{
+ delete mp_dBusHomeScreenProxy;
+ delete mp_inputEventAdaptor;
+}
+
+void InputEventManager::hardKeyPressed(int key)
+{
+ switch (key)
+ {
+ case InputEvent::HARDKEY_NAV:
+ mp_dBusHomeScreenProxy->hardKeyPressed(key);
+ qDebug("hardKeyPressed NAV key pressed!");
+ break;
+ default:
+ qDebug("hardKeyPressed %d", key);
+ break;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INPUTEVENTMANAGER_H
+#define INPUTEVENTMANAGER_H
+
+#include "inputevent_adapter.h"
+#include <include/homescreen.hpp>
+#include "homescreen_proxy.h"
+
+/*
+#ifdef __arm__
+extern "C" {
+#include "aul/aul.h"
+#include "pkgmgr-info.h"
+}
+#endif
+*/
+
+class InputEventManager : public QObject
+{
+ Q_OBJECT
+public:
+ explicit InputEventManager(QObject *parent = 0);
+ ~InputEventManager();
+private:
+ InputeventAdaptor *mp_inputEventAdaptor;
+ org::agl::homescreen *mp_dBusHomeScreenProxy;
+
+ //from inputevent_adapter.h
+public Q_SLOTS: // METHODS
+ void hardKeyPressed(int key);
+
+public:
+
+
+public slots:
+
+};
+
+#endif // INPUTEVENTMANAGER_H
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <QCoreApplication>
+#include "inputeventmanager.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ // used for application settings (QSettings)
+ QCoreApplication::setOrganizationDomain("LinuxFoundation");
+ QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
+ QCoreApplication::setApplicationName("InputEventManager");
+ QCoreApplication::setApplicationVersion("0.2.0");
+
+ InputEventManager *inputEventManager = new InputEventManager();
+
+ return a.exec();
+}
AGL repo for bitbake recipe:
https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+v0.2.0
+08/05/2016
+
+#changes
+- just new version number
+
v0.1.1
07/06/2015
src/timedateprovider.cpp
HEADERS += \
- $$OUT_PWD/../interfaces/statusbar_proxy.h \ #generated dbus proxy
- src/timedateprovider.h
+ src/timedateprovider.hpp
-INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += ../interfaces
LIBS += -L$$OUT_PWD/../interfaces -linterfaces
#include <QCoreApplication>
-#include "timedateprovider.h"
+#include "timedateprovider.hpp"
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationDomain("LinuxFoundation");
QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
QCoreApplication::setApplicationName("SampleAppTimeDate");
- QCoreApplication::setApplicationVersion("0.1.1");
+ QCoreApplication::setApplicationVersion("0.2.0");
TimeDateProvider *tdp = new TimeDateProvider();
tdp->start();
-#include "timedateprovider.h"
+#include "timedateprovider.hpp"
#include <QTimerEvent>
TimeDateProvider::TimeDateProvider(QObject *parent) :
dbus.registerService("org.agl.sampleapptimedate");
- qDebug("D-Bus: connect to org.agl.mainwindow /StatusBar");
+ qDebug("D-Bus: connect to org.agl.homescreen /StatusBar");
mp_dBusStatusBarProxy = new org::agl::statusbar("org.agl.homescreen",
"/StatusBar",
QDBusConnection::sessionBus(),
if (0 != mp_dBusStatusBarProxy)
{
- qDebug("x");
mp_dBusStatusBarProxy->setStatusText(1, "");
delete mp_dBusStatusBarProxy;
}
-#ifndef TIMEDATEPROVIDER_H
-#define TIMEDATEPROVIDER_H
+#ifndef TIMEDATEPROVIDER_HPP
+#define TIMEDATEPROVIDER_HPP
#include <QObject>
#include "statusbar_proxy.h"
};
-#endif // TIMEDATEPROVIDER_H
+#endif // TIMEDATEPROVIDER_HPP
--- /dev/null
+# manually added:
+.DS_Store
+
+# Created by https://www.gitignore.io/api/linux,qt,c,c++
+
+### Linux ###
+*~
+
+# temporary files which can be created if a process still has a handle open of a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+
+### Qt ###
+# C++ objects and libs
+
+*.slo
+*.lo
+*.o
+*.a
+*.la
+*.lai
+*.so
+*.dll
+*.dylib
+
+# Qt-es
+
+/.qmake.cache
+/.qmake.stash
+*.pro.user
+*.pro.user.*
+*.qbs.user
+*.qbs.user.*
+*.moc
+moc_*.cpp
+qrc_*.cpp
+ui_*.h
+Makefile*
+*build-*
+
+# QtCreator
+
+*.autosave
+
+# QtCtreator Qml
+*.qmlproject.user
+*.qmlproject.user.*
+
+# QtCtreator CMake
+CMakeLists.txt.user
+
+
+
+### C ###
+# Object files
+*.o
+*.ko
+*.obj
+*.elf
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Libraries
+*.lib
+*.a
+*.la
+*.lo
+
+# Shared objects (inc. Windows DLLs)
+*.dll
+*.so
+*.so.*
+*.dylib
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+# Debug files
+*.dSYM/
+
+
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
--- /dev/null
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
--- /dev/null
+AGL WindowManager Sample App
+
+
+Build with QtCreator 3.0.1
+
+AGL repo for source code:
+https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen
+
+AGL repo for bitbake recipe:
+https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo/recipes-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.2.0
+08/05/2016
+
+#new features
+- initial version
+
+#TODOs
+
+
--- /dev/null
+# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+QT += core dbus
+QT -= gui
+
+TARGET = WindowManager
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += src/main.cpp \
+ src/windowmanager.cpp
+
+HEADERS += \
+ src/windowmanager.hpp
+
+INCLUDEPATH += $$OUT_PWD/../interfaces
+INCLUDEPATH += ../interfaces/
+
+#LIBS += -L$$OUT_PWD/../interfaces -linterfaces
+contains(QT_ARCH, arm.*) {
+ LIBS += -lilmControl -lilmCommon
+}
+
+#contains(QT_ARCH, arm.*) {
+# LIBS += -lpkgmgr-info
+# LIBS += -laul
+#}
+
+OTHER_FILES += \
+ README.md
+
+# remove generated files
+QMAKE_CLEAN += -r \
+ $$OUT_PWD/WindowManager \
+ $$OUT_PWD/Makefile
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <QCoreApplication>
+#include "windowmanager.hpp"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ // used for application settings (QSettings)
+ QCoreApplication::setOrganizationDomain("LinuxFoundation");
+ QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
+ QCoreApplication::setApplicationName("WindowManager");
+ QCoreApplication::setApplicationVersion("0.2.0");
+
+ WindowManager *windowManager = new WindowManager();
+
+ return a.exec();
+}
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "windowmanager.hpp"
+
+//////////////////////////////////////////
+// THIS IS STILL UNDER HEAVY DEVELOPMENT!
+// DO NOT JUDGE THE SOURCE CODE :)
+//////////////////////////////////////////
+
+
+WindowManager::WindowManager(QObject *parent) :
+ QObject(parent)
+{
+ qDebug("WindowManager");
+#ifdef __arm__
+ ilmErrorTypes err;
+ if (true)//!ilm_isInitialized()) ...crashes...
+ {
+ err = ilm_init();
+ qDebug("ilm_init = %d", err);
+ }
+
+
+ t_ilm_uint screenID = 0;
+ t_ilm_uint width;
+ t_ilm_uint height;
+
+ err = ilm_getScreenResolution(screenID, &width, &height);
+ qDebug("ilm_getScreenResolution = %d", err);
+ qDebug("pWidth %d, pHeight %d", width, height);
+
+
+ t_ilm_layer layerId = 42; // does not matter
+ err = ilm_layerCreateWithDimension(&layerId, width, height);
+ qDebug("ilm_layerCreateWithDimension = %d", err);
+ qDebug("layerId = %d", layerId);
+
+ err = ilm_layerSetVisibility(layerId, true);
+ qDebug("ilm_layerSetVisibility = %d", err);
+
+ ilm_commitChanges();
+
+ err = ilm_displaySetRenderOrder(screenID, &layerId, 1);
+ qDebug("ilm_displaySetRenderOrder = %d", err);
+
+ ilm_commitChanges();
+
+ err = ilm_layerSetSourceRectangle(layerId, 0, 0, width, height);
+ qDebug("ilm_layerSetSourceRectangle = %d", err);
+ err = ilm_layerSetDestinationRectangle(layerId, 0, 0, width, height);
+ qDebug("layerSetDestinationRectangle = %d", err);
+
+ ilm_commitChanges();
+
+ t_ilm_float opacity = 1.0;
+
+ err = ilm_layerSetOpacity(layerId, opacity);
+ qDebug("ilm_layerSetOpacity = %d", err);
+
+
+ t_ilm_int length;
+ t_ilm_surface* pArray;
+
+ err = ilm_getSurfaceIDs(&length, &pArray);
+ qDebug("ilm_getSurfaceIDs = %d", err);
+ qDebug("length %d pArray[0] %d", length, pArray[0]);
+
+ if (length > 0)
+ {
+ t_ilm_surface surfaceId = pArray[0];
+
+ err = ilm_layerAddSurface(layerId, surfaceId);
+ qDebug("ilm_layerAddSurface = %d", err);
+
+ t_ilm_bool visibility;
+ err = ilm_surfaceGetVisibility(surfaceId, &visibility);
+ qDebug("ilm_surfaceGetVisibility = %d", err);
+ qDebug("visibility %d", visibility);
+
+ err = ilm_surfaceSetVisibility(surfaceId, true);
+ qDebug("ilm_surfaceSetVisibility = %d", err);
+
+ err = ilm_surfaceSetOpacity(surfaceId, opacity);
+ qDebug("ilm_surfaceSetOpacity = %d", err);
+
+ err = ilm_surfaceSetSourceRectangle(surfaceId, 0, 0, 200, 200);
+ qDebug("ilm_surfaceSetSourceRectangle = %d", err);
+ err = ilm_surfaceSetDestinationRectangle(surfaceId, 0, 0, 200, 200);
+ qDebug("surfaceSetDestinationRectangle = %d", err);
+
+
+ }
+
+ ilm_commitChanges();
+
+ struct ilmScreenProperties screenProperties;
+ struct ilmLayerProperties layerProperties;
+ struct ilmSurfaceProperties surfaceProperties;
+
+ err = ilm_getPropertiesOfScreen(0, &screenProperties);
+ qDebug("ilm_getPropertiesOfScreen = %d", err);
+ err = ilm_getPropertiesOfLayer(layerId, &layerProperties);
+ qDebug("ilm_getPropertiesOfLayer = %d", err);
+ err = ilm_getPropertiesOfSurface(pArray[0], &surfaceProperties);
+ qDebug("ilm_getPropertiesOfSurface = %d", err);
+
+
+ qDebug("screen");
+ qDebug("t_ilm_uint %d", screenProperties.layerCount); /*!< number of layers displayed on the screen */
+ //qDebug("t_ilm_layer* %d", screenProperties.layerIds[0]); /*!< array of layer ids */
+ qDebug("t_ilm_uint %d", screenProperties.harwareLayerCount); /*!< number of hardware layers */
+ qDebug("t_ilm_uint %d", screenProperties.screenWidth); /*!< width value of screen in pixels */
+ qDebug("t_ilm_uint %d", screenProperties.screenHeight); /*!< height value of screen in pixels */
+
+ qDebug("layer");
+ qDebug("t_ilm_float %f", layerProperties.opacity); /*!< opacity value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.sourceX); /*!< x source position value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.sourceY); /*!< y source position value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.sourceWidth); /*!< source width value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.sourceHeight); /*!< source height value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.origSourceWidth); /*!< original source width value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.origSourceHeight); /*!< original source height value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.destX); /*!< x destination position value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.destY); /*!< y desitination position value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.destWidth); /*!< destination width value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.destHeight); /*!< destination height value of the layer */
+ qDebug("ilmOrientation%d", layerProperties.orientation); /*!< orientation value of the layer */
+ qDebug("t_ilm_bool %d", layerProperties.visibility); /*!< visibility value of the layer */
+ qDebug("t_ilm_uint %d", layerProperties.type); /*!< type of layer */
+ qDebug("t_ilm_int %d", layerProperties.creatorPid); /*!< process id of application that created this layer */
+
+ qDebug("surface");
+ qDebug("t_ilm_float %f", surfaceProperties.opacity); /*!< opacity value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.sourceX); /*!< x source position value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.sourceY); /*!< y source position value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.sourceWidth); /*!< source width value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.sourceHeight); /*!< source height value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.origSourceWidth); /*!< original source width value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.origSourceHeight); /*!< original source height value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.destX); /*!< x destination position value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.destY); /*!< y desitination position value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.destWidth); /*!< destination width value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.destHeight); /*!< destination height value of the surface */
+ qDebug("ilmOrientation %d", surfaceProperties.orientation); /*!< orientation value of the surface */
+ qDebug("t_ilm_bool %d", surfaceProperties.visibility); /*!< visibility value of the surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.frameCounter); /*!< already rendered frames of surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.drawCounter); /*!< content updates of surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.updateCounter); /*!< content updates of surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.pixelformat); /*!< pixel format of surface */
+ qDebug("t_ilm_uint %d", surfaceProperties.nativeSurface); /*!< native surface handle of surface */
+ qDebug("t_ilm_int %d", surfaceProperties.creatorPid); /*!< process id of application that created this surface */
+ qDebug("ilmInputDevice %d", surfaceProperties.focus); /*!< bitmask of every type of device that this surface has focus in */
+
+ err = ilm_registerNotification(WindowManager::notificationFunc_static, this);
+#endif
+}
+
+WindowManager::~WindowManager()
+{
+#ifdef __arm__
+ ilmErrorTypes err;
+ if (ilm_isInitialized())
+ {
+ err = ilm_destroy();
+ qDebug("ilm_destroy = %d", err);
+ }
+#endif
+}
+
+#ifdef __arm__
+void WindowManager::notificationFunc_non_static(ilmObjectType object,
+ t_ilm_uint id,
+ t_ilm_bool created)
+{
+ qDebug("notificationFunc_non_static");
+ if (ILM_SURFACE == object)
+ {
+ struct ilmSurfaceProperties surfaceProperties;
+
+ if (created)
+ {
+ qDebug("Surface created, ID: %d", id);
+
+ ilm_layerAddSurface(42 /*always use layer 42 for now*/, id);
+ ilm_surfaceSetOpacity(id, 1.0);
+ ilm_surfaceSetVisibility(id, true);
+ ilm_getPropertiesOfSurface(id, &surfaceProperties);
+ ilm_surfaceSetSourceRectangle(id, 0, 0, surfaceProperties.origSourceWidth, surfaceProperties.origSourceHeight);
+
+ ilm_commitChanges();
+ }
+ else
+ {
+ qDebug("Surface destroyed, ID: %d", id);
+ }
+
+ t_ilm_uint screenID = 0;
+ t_ilm_uint width;
+ t_ilm_uint height;
+ ilm_getScreenResolution(screenID, &width, &height);
+
+ t_ilm_int length;
+ t_ilm_surface* pArray;
+
+ ilm_getSurfaceIDs(&length, &pArray);
+ qDebug("length %d", length);
+
+
+ for (int i = 0; i < length; ++i)
+ {
+ //ilm_getPropertiesOfSurface(pArray[i], &surfaceProperties);
+ qDebug("place surface %d at x: %f, y: %f, width: %f, height: %f",
+ pArray[i],
+ i * (width / (1.0 * length)),
+ 0,
+ width / (1.0 * length),
+ height);
+ ilm_surfaceSetDestinationRectangle(pArray[(int)i],
+ i * (width / (1.0 * length)),
+ 0,
+ width / (1.0 * length),
+ height);
+ }
+
+ ilm_commitChanges();
+ }
+ if (ILM_LAYER == object)
+ {
+ qDebug("Layer.. we don't care...");
+ }
+}
+
+void WindowManager::notificationFunc_static(ilmObjectType object,
+ t_ilm_uint id,
+ t_ilm_bool created,
+ void* user_data)
+{
+ qDebug("notificationFunc_static");
+ static_cast<WindowManager*>(user_data)->notificationFunc_non_static(object, id, created);
+}
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WINDOWMANAGER_HPP
+#define WINDOWMANAGER_HPP
+
+#include <QObject>
+
+
+#ifdef __arm__
+extern "C" {
+#include "ilm/ilm_control.h"
+}
+#endif
+
+
+class WindowManager : public QObject
+{
+ Q_OBJECT
+public:
+ explicit WindowManager(QObject *parent = 0);
+ ~WindowManager();
+private:
+
+
+public:
+
+#ifdef __arm__
+ void notificationFunc_non_static(ilmObjectType object,
+ t_ilm_uint id,
+ t_ilm_bool created);
+ static void notificationFunc_static(ilmObjectType object,
+ t_ilm_uint id,
+ t_ilm_bool created,
+ void* user_data);
+#endif
+public slots:
+
+};
+
+#endif // WINDOWMANAGER_HPP
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<!-- Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. -->
+<node>
+ <interface name="org.agl.appframework">
+ <method name="getAvailableAppNames">
+ <arg name="names" type="as" direction="out"/>
+ </method>
+ <method name="launchApp">
+ <arg name="name" type="s" direction="in"/>
+ <arg name="pid" type="i" direction="out"/>
+ </method>
+ </interface>
+</node>
+
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<!-- Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. -->
+<node>
+ <interface name="org.agl.homescreen">
+ <method name="hardKeyPressed">
+ <arg name="key" type="i" direction="in"/> <!-- using the inputevent.hpp InputEvent::HardKey type -->
+ </method>
+ </interface>
+</node>
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef APPFRAMEWORK_HPP
+#define APPFRAMEWORK_HPP
+
+#include <QObject>
+#include <QtDBus>
+#include <QString>
+
+class AppInfo : public QObject
+{
+ Q_OBJECT
+public:
+ explicit AppInfo(QObject *parent = 0);
+ AppInfo(const AppInfo &other);
+ AppInfo& operator=(const AppInfo &other);
+ ~AppInfo();
+
+ //register Message with the Qt type system
+ static void registerMetaType();
+
+ friend QDBusArgument &operator<<(QDBusArgument &argument, const AppInfo &appInfo);
+ friend const QDBusArgument &operator>>(const QDBusArgument &argument, AppInfo &appInfo);
+
+ void setName(const QString name) {this->name = name;}
+ QString getName() const {return name;}
+ void setIconPath(const QString iconPath) {this->iconPath = iconPath;}
+ QString getIconPath() const {return iconPath;}
+ void setDescription(const QString description) {this->description = description;}
+ QString getDescription() const {return description;}
+
+private:
+ QString name;
+ QString iconPath;
+ QString description;
+};
+
+Q_DECLARE_METATYPE(AppInfo)
+
+#endif // APPFRAMEWORK_HPP
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HOMESCREEN_H
+#define HOMESCREEN_H
+
+#include "inputevent.hpp"
+
+#endif // HOMESCREEN_H
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INPUTEVENT_H
+#define INPUTEVENT_H
+
+namespace InputEvent {
+ typedef enum HardKey
+ {
+ HARDKEY_UNDEFINED,
+ HARDKEY_NAV
+ } eHardKey;
+}
+
+#endif // INPUTEVENT_H
+
--- /dev/null
+/*
+ * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef STATUSBAR_H
+#define STATUSBAR_H
+
+
+
+#endif // STATUSBAR_H
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<!-- Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. -->
+<node>
+ <interface name="org.agl.inputevent">
+ <method name="hardKeyPressed">
+ <arg name="key" type="i" direction="in"/>
+ </method>
+ </interface>
+</node>
+
# See the License for the specific language governing permissions and
# limitations under the License.
-QT += core gui dbus
+QT += core dbus
+QT -= gui
+
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TEMPLATE = lib
CONFIG += staticlib
TARGET = interfaces
+HEADERS += include/appframework.hpp
+SOURCES += src/appframework.cpp
+
XMLSOURCES = \
+ appframework.xml \
daynightmode.xml \
+ homescreen.xml \
+ inputevent.xml \
popup.xml \
statusbar.xml
gen_adapter_cpp.input = XMLSOURCES
gen_adapter_cpp.commands = \
- qdbusxml2cpp -m -a ${QMAKE_FILE_IN_BASE}_adapter ${QMAKE_FILE_IN}; \
+ qdbusxml2cpp -i include/${QMAKE_FILE_IN_BASE}.hpp -m -a ${QMAKE_FILE_IN_BASE}_adapter ${QMAKE_FILE_IN}; \
moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adapter.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adapter.moc
gen_adapter_cpp.output = ${QMAKE_FILE_IN_BASE}_adapter.cpp
gen_adapter_cpp.variable_out = SOURCES
gen_proxy_cpp.input = XMLSOURCES
gen_proxy_cpp.commands = \
- qdbusxml2cpp -m -p ${QMAKE_FILE_IN_BASE}_proxy ${QMAKE_FILE_IN}; \
+ qdbusxml2cpp -i include/${QMAKE_FILE_IN_BASE}.hpp -m -p ${QMAKE_FILE_IN_BASE}_proxy ${QMAKE_FILE_IN}; \
moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.moc
gen_proxy_cpp.output = ${QMAKE_FILE_IN_BASE}_proxy.cpp
gen_proxy_cpp.variable_out = SOURCES
gen_adapter_h.input = XMLSOURCES
gen_adapter_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN}
gen_adapter_h.depends = ${QMAKE_FILE_IN_BASE}_adapter.cpp
-en_adapter_h.output = ${QMAKE_FILE_IN_BASE}_adapter.h
+gen_adapter_h.output = ${QMAKE_FILE_IN_BASE}_adapter.h
gen_adapter_h.clean = ${QMAKE_FILE_IN_BASE}_adapter.h
gen_proxy_h.input = XMLSOURCES
--- /dev/null
+#include "include/appframework.hpp"
+
+AppInfo::AppInfo(QObject *parent) :
+ QObject(parent)
+{
+}
+
+AppInfo::AppInfo(const AppInfo &other) :
+ QObject(other.parent()),
+ name(other.getName()),
+ iconPath(other.getIconPath()),
+ description(other.getDescription())
+{
+}
+
+AppInfo& AppInfo::operator=(const AppInfo &other)
+{
+ setParent(other.parent());
+ name = other.getName();
+ iconPath = other.getIconPath();
+ description = other.getDescription();
+
+ return *this;
+}
+
+AppInfo::~AppInfo()
+{
+}
+
+void AppInfo::registerMetaType()
+{
+ qRegisterMetaType<AppInfo>("AppInfo");
+ qDBusRegisterMetaType<AppInfo>();
+}
+
+
+// Marshall the MyStructure data into a D-Bus argument
+QDBusArgument &operator<<(QDBusArgument &argument, const AppInfo &appInfo)
+{
+ argument.beginStructure();
+ argument << appInfo.name << appInfo.iconPath << appInfo.description;
+ argument.endStructure();
+ qDebug("appInfo.name:<< %s", appInfo.name.toStdString().c_str());
+ return argument;
+}
+
+// Retrieve the MyStructure data from the D-Bus argument
+const QDBusArgument &operator>>(const QDBusArgument &argument, AppInfo &appInfo)
+{
+ argument.beginStructure();
+ argument >> appInfo.name >> appInfo.iconPath >> appInfo.description;
+ argument.endStructure();
+ qDebug("appInfo.name:>> %s", appInfo.name.toStdString().c_str());
+ return argument;
+}