diff options
-rw-r--r-- | homescreen/src/homescreenhandler.cpp | 118 | ||||
-rw-r--r-- | package/icon.svg | 279 | ||||
-rw-r--r-- | package/package.pro | 27 |
3 files changed, 13 insertions, 411 deletions
diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index d5e46fa..9111ebb 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -38,19 +38,10 @@ HomescreenHandler::HomescreenHandler(Shell *_aglShell, ApplicationLauncher *laun HomescreenHandler::~HomescreenHandler() { -#if 0 - if (mp_hs != NULL) { - delete mp_hs; - } -#endif } void HomescreenHandler::init(void) { -#if 0 - mp_hs = new LibHomeScreen(); - mp_hs->init(port, token); -#endif myThis = this; /* @@ -61,45 +52,6 @@ void HomescreenHandler::init(void) connect(applaunch_iface, SIGNAL(started(QString)), this, SLOT(appStarted(QString))); connect(applaunch_iface, SIGNAL(terminated(QString)), this, SLOT(appTerminated(QString))); -#if 0 - mp_hs->registerCallback(nullptr, HomescreenHandler::onRep_static); - - mp_hs->set_event_handler(LibHomeScreen::Event_OnScreenMessage, [this](json_object *object){ - const char *display_message = json_object_get_string( - json_object_object_get(object, "display_message")); - HMI_DEBUG("HomeScreen","set_event_handler Event_OnScreenMessage display_message = %s", display_message); - }); - - // should be handled in the top panel - mp_hs->set_event_handler(LibHomeScreen::Event_ShowNotification,[this](json_object *object){ - json_object *p_obj = json_object_object_get(object, "parameter"); - const char *icon = json_object_get_string( - json_object_object_get(p_obj, "icon")); - const char *text = json_object_get_string( - json_object_object_get(p_obj, "text")); - const char *app_id = json_object_get_string( - json_object_object_get(p_obj, "caller")); - HMI_DEBUG("HomeScreen","Event_ShowNotification icon=%s, text=%s, caller=%s", icon, text, app_id); - QFileInfo icon_file(icon); - QString icon_path; - if (icon_file.isFile() && icon_file.exists()) { - icon_path = QString(QLatin1String(icon)); - } else { - icon_path = "./images/Utility_Logo_Grey-01.svg"; - } - - emit showNotification(QString(QLatin1String(app_id)), icon_path, QString(QLatin1String(text))); - }); - - // should be handled in the bottom panel - mp_hs->set_event_handler(LibHomeScreen::Event_ShowInformation,[this](json_object *object){ - json_object *p_obj = json_object_object_get(object, "parameter"); - const char *info = json_object_get_string( - json_object_object_get(p_obj, "info")); - - emit showInformation(QString(QLatin1String(info))); - }); -#endif } static struct wl_output * @@ -111,65 +63,21 @@ getWlOutput(QPlatformNativeInterface *native, QScreen *screen) void HomescreenHandler::tapShortcut(QString application_id) { - HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str()); -#if 0 - struct json_object* j_json = json_object_new_object(); - struct json_object* value; - - struct agl_shell *agl_shell = aglShell->shell.get(); - QPlatformNativeInterface *native = qApp->platformNativeInterface(); - struct wl_output *output = getWlOutput(native, qApp->screens().first()); - - value = json_object_new_string("normal.full"); - json_object_object_add(j_json, "area", value); - - mp_hs->showWindow(application_id.toStdString().c_str(), j_json); - - // this works (and it is redundant the first time), due to the default - // policy engine installed which actives the application, when starting - // the first time. Later calls to HomescreenHandler::tapShortcut will - // require calling 'agl_shell_activate_app' - agl_shell_activate_app(agl_shell, application_id.toStdString().c_str(), output); - -#endif - - if (mp_launcher) { - mp_launcher->setCurrent(application_id); - } - appStarted(application_id); -} - -#if 0 -void HomescreenHandler::onRep_static(struct json_object* reply_contents) -{ - static_cast<HomescreenHandler*>(HomescreenHandler::myThis)->onRep(reply_contents); -} - -void HomescreenHandler::onEv_static(const string& event, struct json_object* event_contents) -{ - static_cast<HomescreenHandler*>(HomescreenHandler::myThis)->onEv(event, event_contents); -} - -void HomescreenHandler::onRep(struct json_object* reply_contents) -{ - const char* str = json_object_to_json_string(reply_contents); - HMI_DEBUG("HomeScreen","HomeScreen onReply %s", str); -} - -void HomescreenHandler::onEv(const string& event, struct json_object* event_contents) -{ - const char* str = json_object_to_json_string(event_contents); - HMI_DEBUG("HomeScreen","HomeScreen onEv %s, contents: %s", event.c_str(), str); - - if (event.compare("homescreen/on_screen_message") == 0) { - struct json_object *json_data = json_object_object_get(event_contents, "data"); - struct json_object *json_display_message = json_object_object_get(json_data, "display_message"); - const char* display_message = json_object_get_string(json_display_message); - - HMI_DEBUG("HomeScreen","display_message = %s", display_message); + HMI_DEBUG("HomeScreen","tapShortcut %s", application_id.toStdString().c_str()); + + QDBusPendingReply<> reply = applaunch_iface->start(application_id); + reply.waitForFinished(); + if (reply.isError()) { + HMI_ERROR("HomeScreen","Unable to start application '%s': %s", + application_id.toStdString().c_str(), + reply.error().message().toStdString().c_str()); + } else { + if (mp_launcher) { + mp_launcher->setCurrent(application_id); + } + appStarted(application_id); } } -#endif void HomescreenHandler::appStarted(const QString& application_id) { diff --git a/package/icon.svg b/package/icon.svg deleted file mode 100644 index 91661a7..0000000 --- a/package/icon.svg +++ /dev/null @@ -1,279 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> - -<svg - xmlns:i="&ns_ai;" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.1" - x="0px" - y="0px" - viewBox="0 0 320 320" - style="enable-background:new 0 0 320 320;" - xml:space="preserve" - id="svg2" - inkscape:version="0.91 r13725" - sodipodi:docname="icon.svg"><metadata - id="metadata1292"><rdf:RDF><cc:Work - rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs - id="defs1290" /><sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="2560" - inkscape:window-height="1464" - id="namedview1288" - showgrid="false" - inkscape:zoom="0.7375" - inkscape:cx="-572.20339" - inkscape:cy="160" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" - inkscape:current-layer="svg2" /><style - type="text/css" - id="style4"> - .st0{display:none;} - .st1{display:inline;} - .st2{opacity:0.4;fill:url(#SVGID_1_);} - .st3{fill:url(#SVGID_2_);} - .st4{fill:#FFFFFF;} - .st5{font-family:'Roboto-Regular';} - .st6{font-size:25px;} - .st7{letter-spacing:6;} - .st8{fill:url(#SVGID_3_);} - .st9{fill:url(#SVGID_4_);} - .st10{fill:url(#SVGID_5_);} - .st11{fill:url(#SVGID_6_);} - .st12{fill:url(#SVGID_7_);} - .st13{fill:url(#SVGID_8_);} - .st14{fill:url(#SVGID_9_);} - .st15{fill:url(#SVGID_10_);} - .st16{fill:url(#SVGID_11_);} - .st17{fill:url(#SVGID_12_);} - .st18{fill:url(#SVGID_13_);} - .st19{fill:url(#SVGID_14_);} - .st20{fill:url(#SVGID_15_);} - .st21{fill:url(#SVGID_16_);} - .st22{fill:url(#SVGID_17_);} - .st23{fill:url(#SVGID_18_);} - .st24{opacity:0.29;} - .st25{fill:url(#SVGID_19_);} - .st26{fill:url(#SVGID_20_);} - .st27{fill:url(#SVGID_21_);} - .st28{fill:url(#SVGID_22_);} - .st29{fill:url(#SVGID_23_);} - .st30{fill:url(#SVGID_24_);} - .st31{fill:url(#SVGID_25_);} - .st32{fill:url(#SVGID_26_);} - .st33{fill:url(#SVGID_27_);} - .st34{fill:url(#SVGID_28_);} - .st35{fill:url(#SVGID_29_);} - .st36{fill:url(#SVGID_30_);} - .st37{fill:url(#SVGID_31_);} - .st38{fill:url(#SVGID_32_);} - .st39{fill:url(#SVGID_33_);} - .st40{fill:url(#SVGID_34_);} - .st41{fill:url(#SVGID_35_);} - .st42{fill:url(#SVGID_36_);} - .st43{opacity:0.4;fill:url(#SVGID_37_);} - .st44{fill:url(#SVGID_38_);} - .st45{fill:url(#SVGID_39_);} - .st46{fill:url(#SVGID_40_);} - .st47{fill:url(#SVGID_41_);} - .st48{fill:url(#SVGID_42_);} - .st49{fill:url(#SVGID_43_);} - .st50{fill:url(#SVGID_44_);} - .st51{display:inline;opacity:0.29;} - .st52{display:inline;fill:url(#SVGID_45_);} - .st53{display:inline;fill:url(#SVGID_46_);} - .st54{display:inline;fill:#FFFFFF;} - .st55{display:inline;fill:url(#SVGID_47_);} - .st56{display:inline;fill:url(#SVGID_48_);} - .st57{display:inline;fill:url(#SVGID_49_);} - .st58{display:inline;fill:url(#SVGID_50_);} - .st59{display:inline;fill:url(#SVGID_51_);} - .st60{display:inline;fill:url(#SVGID_52_);} - .st61{opacity:0.4;fill:url(#SVGID_53_);} - .st62{fill:url(#SVGID_54_);} - .st63{fill:url(#SVGID_55_);} - .st64{fill:url(#SVGID_56_);} - .st65{fill:url(#SVGID_57_);} - .st66{fill:url(#SVGID_58_);} - .st67{opacity:0.4;fill:url(#SVGID_59_);} - .st68{fill:url(#SVGID_60_);} - .st69{fill:url(#SVGID_61_);} - .st70{fill:url(#SVGID_62_);} - .st71{fill:url(#SVGID_63_);} - .st72{fill:url(#SVGID_64_);} - .st73{fill:url(#SVGID_65_);} - .st74{fill:url(#SVGID_66_);} - .st75{fill:url(#SVGID_67_);} - .st76{fill:url(#SVGID_68_);} - .st77{fill:url(#SVGID_69_);} - .st78{fill:url(#SVGID_70_);} - .st79{fill:url(#SVGID_71_);} - .st80{fill:url(#SVGID_72_);} - .st81{fill:url(#SVGID_73_);} - .st82{fill:url(#SVGID_74_);} - .st83{fill:url(#SVGID_75_);} - .st84{fill:url(#SVGID_76_);} - .st85{fill:url(#SVGID_77_);} - .st86{fill:url(#SVGID_78_);} - .st87{fill:url(#SVGID_79_);} - .st88{fill:url(#SVGID_80_);} - .st89{fill:url(#SVGID_81_);} - .st90{fill:url(#SVGID_82_);} - .st91{fill:url(#SVGID_83_);} - .st92{fill:url(#SVGID_84_);} - .st93{fill:url(#SVGID_85_);} - .st94{fill:url(#SVGID_86_);} - .st95{opacity:0.4;fill:url(#SVGID_87_);} - .st96{fill:url(#SVGID_88_);} - .st97{fill:url(#SVGID_89_);} - .st98{fill:url(#SVGID_90_);} - .st99{fill:url(#SVGID_91_);} - .st100{fill:url(#SVGID_92_);} - .st101{fill:url(#SVGID_93_);} - .st102{fill:url(#SVGID_94_);} - .st103{opacity:0.4;fill:url(#SVGID_95_);} - .st104{fill:url(#SVGID_96_);} - .st105{fill:url(#SVGID_97_);} - .st106{fill:url(#SVGID_98_);} - .st107{fill:url(#SVGID_99_);} - .st108{fill:url(#SVGID_100_);} - .st109{fill:url(#SVGID_101_);} - .st110{display:inline;fill:url(#SVGID_102_);} - .st111{display:inline;fill:url(#SVGID_103_);} - .st112{fill:url(#SVGID_104_);} - .st113{fill:url(#SVGID_105_);} - .st114{fill:url(#SVGID_106_);} - .st115{fill:url(#SVGID_107_);} - .st116{fill:url(#SVGID_108_);} - .st117{opacity:0.4;fill:url(#SVGID_109_);} - .st118{fill:url(#SVGID_110_);} - .st119{fill:url(#SVGID_111_);} - .st120{fill:url(#SVGID_112_);} - .st121{fill:url(#SVGID_113_);} - .st122{fill:url(#SVGID_114_);} - .st123{opacity:0.4;fill:url(#SVGID_115_);} - .st124{fill:url(#SVGID_116_);} - .st125{fill:url(#SVGID_117_);} - .st126{fill:url(#SVGID_118_);} - .st127{display:inline;fill:url(#SVGID_119_);} - .st128{display:inline;fill:url(#SVGID_120_);} - .st129{fill:url(#SVGID_121_);} - .st130{fill:url(#SVGID_122_);} -</style><switch - id="switch6"><g - i:extraneous="self" - id="g8"><g - id="Multimedia_Inactive_copy"><circle - class="st24" - cx="159.7" - cy="133.4" - r="101.9" - id="circle884" /><linearGradient - id="SVGID_91_" - gradientUnits="userSpaceOnUse" - x1="115.9317" - y1="254.1836" - x2="256.3852" - y2="-133.5267"><stop - offset="0" - style="stop-color:#8BC53F" - id="stop887" /><stop - offset="2.015080e-02" - style="stop-color:#7CCB56;stop-opacity:0.9678" - id="stop889" /><stop - offset="6.089833e-02" - style="stop-color:#62D67D;stop-opacity:0.9028" - id="stop891" /><stop - offset="0.1057" - style="stop-color:#4BDFA0;stop-opacity:0.8312" - id="stop893" /><stop - offset="0.1543" - style="stop-color:#38E7BE;stop-opacity:0.7537" - id="stop895" /><stop - offset="0.2077" - style="stop-color:#28EED6;stop-opacity:0.6684" - id="stop897" /><stop - offset="0.2681" - style="stop-color:#1CF3E8;stop-opacity:0.572" - id="stop899" /><stop - offset="0.3394" - style="stop-color:#13F6F5;stop-opacity:0.4581" - id="stop901" /><stop - offset="0.4323" - style="stop-color:#0EF8FD;stop-opacity:0.3098" - id="stop903" /><stop - offset="0.6264" - style="stop-color:#0DF9FF;stop-opacity:0" - id="stop905" /></linearGradient><circle - class="st99" - cx="159.7" - cy="133.4" - r="101.9" - id="circle907" /><linearGradient - id="SVGID_92_" - gradientUnits="userSpaceOnUse" - x1="4.0481" - y1="287.9492" - x2="320.4859" - y2="-15.4029" - gradientTransform="matrix(1 5.464556e-03 -5.464556e-03 1 -2.0192 -3.0212)"><stop - offset="0" - style="stop-color:#59FF7F" - id="stop910" /><stop - offset="1" - style="stop-color:#6BFBFF" - id="stop912" /></linearGradient><path - class="st100" - d="M160,238.8c-0.2,0-0.4,0-0.6,0c-58-0.3-104.9-47.7-104.6-105.7C55.2,75.3,102.3,28.5,160,28.5 c0.2,0,0.4,0,0.6,0c58,0.3,104.9,47.7,104.6,105.7l0,0C264.8,192,217.7,238.8,160,238.8z M160,32.2 c-55.7,0-101.2,45.2-101.5,100.9c-0.3,55.9,45,101.7,100.9,102c0.2,0,0.4,0,0.6,0c55.7,0,101.2-45.2,101.5-100.9 c0.3-55.9-45-101.7-100.9-102C160.4,32.2,160.2,32.2,160,32.2z" - id="path914" /><g - id="g916"><text - transform="matrix(1 0 0 1 53.5841 284.7119)" - class="st4 st5 st6 st7" - id="text918">MULTIMEDIA</text> -<linearGradient - id="SVGID_93_" - gradientUnits="userSpaceOnUse" - x1="140.5445" - y1="202.2363" - x2="186.8444" - y2="68.7049"><stop - offset="0" - style="stop-color:#59FF7F" - id="stop921" /><stop - offset="1" - style="stop-color:#6BFBFF" - id="stop923" /></linearGradient><path - class="st101" - d="M114.5,190.9c-6.4,0-12-2.6-14.8-7.5c-2.9-4.9-5.4-14.5,9.6-23.2c4.8-2.8,17.1-3.9,20.8-4l0.1,3.6 c-4.6,0.1-15.5,1.4-19.1,3.5c-9.4,5.4-12.1,11.5-8.3,18.3c3.8,6.6,14.6,7.6,24,2.2c6.6-3.8,10.6-10.5,10.7-17.9l-0.1-0.7V95.4 l71.9-14.2l0.1,71.3c0,6.7-3.3,16.4-12.5,21.8c-11.1,6.4-24.1,4.8-28.9-3.5c-2.9-4.9-5.4-14.5,9.6-23.2 c4.4-2.5,14.4-3.8,18.8-3.9l0.1,3.6c-4.2,0.1-13.5,1.4-17.1,3.5c-6.4,3.7-13.1,9.9-8.3,18.3c3.8,6.6,14.6,7.6,24,2.2 c7.9-4.5,10.7-12.8,10.7-18.5l-0.1-0.8V85.6l-64.7,12.7v66.8l0.1,0.7c0,8.7-4.7,16.6-12.5,21.1 C123.9,189.6,119,190.9,114.5,190.9z" - id="path925" /><linearGradient - id="SVGID_94_" - gradientUnits="userSpaceOnUse" - x1="145.3286" - y1="203.8951" - x2="191.6285" - y2="70.3637"><stop - offset="0" - style="stop-color:#59FF7F" - id="stop928" /><stop - offset="1" - style="stop-color:#6BFBFF" - id="stop930" /></linearGradient><polygon - class="st102" - points="155.6,123.3 154.8,119.8 195.5,110.2 196.3,113.7 " - id="polygon932" /></g></g></g></switch></svg>
\ No newline at end of file diff --git a/package/package.pro b/package/package.pro deleted file mode 100644 index 1035088..0000000 --- a/package/package.pro +++ /dev/null @@ -1,27 +0,0 @@ -DISTFILES = icon.svg config.xml - -copy_icon.target = $$OUT_PWD/root/icon.svg -copy_icon.depends = $$_PRO_FILE_PWD_/icon.svg -copy_icon.commands = $(COPY_FILE) \"$$replace(copy_icon.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_icon.target, /, $$QMAKE_DIR_SEP)\" -QMAKE_EXTRA_TARGETS += copy_icon -PRE_TARGETDEPS += $$copy_icon.target - -copy_config.target = $$OUT_PWD/root/config.xml -copy_config.depends = $$_PRO_FILE_PWD_/config.xml -copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_config.target, /, $$QMAKE_DIR_SEP)\" -QMAKE_EXTRA_TARGETS += copy_config -PRE_TARGETDEPS += $$copy_config.target - -WGT_TYPE = -CONFIG(debug, debug|release) { - WGT_TYPE = -debug -} - -wgt.target = package -wgt.commands = wgtpkg-pack -f -o homescreen$${WGT_TYPE}.wgt root - -QMAKE_EXTRA_TARGETS += wgt - -deploy.files = homescreen.wgt -deploy.path = /usr/AGL/apps/autoinstall -INSTALLS += deploy |