From: minho.sun Date: Thu, 9 Aug 2018 05:38:10 +0000 (+0900) Subject: [TBT][dali-adaptor] fix widget application tbt X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e1c19785b4621b6f39f61c3f5f595f94832aa11;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][dali-adaptor] fix widget application tbt Fix widget application tbt and remove unused resources, codes. Change-Id: Ib1308cbcb3e30e6855ff10e377d5adad2fe55747 Signed-off-by: minho.sun --- diff --git a/coretbtwidgetapp-dali/.cproject b/coretbtwidgetapp-dali/.cproject index 09054c6..3616203 100644 --- a/coretbtwidgetapp-dali/.cproject +++ b/coretbtwidgetapp-dali/.cproject @@ -16,17 +16,17 @@ - + - - + + - + - + - + @@ -317,24 +319,19 @@ - + - + @@ -616,4 +612,5 @@ + diff --git a/coretbtwidgetapp-dali/inc/tbt-widget/tbt-widget-impl.h b/coretbtwidgetapp-dali/inc/tbt-widget/tbt-widget-impl.h new file mode 100644 index 0000000..c75bbd2 --- /dev/null +++ b/coretbtwidgetapp-dali/inc/tbt-widget/tbt-widget-impl.h @@ -0,0 +1,63 @@ +#ifndef __DALI_INTERNAL_TBT_WIDGET_H__ +#define __DALI_INTERNAL_TBT_WIDGET_H__ + +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * + * 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. + * + */ + +// EXTERNAL INCLUDES +#include +#include "../../inc/tbt-widget/tbt-widget.h" + +namespace TBT +{ + +namespace Internal +{ + +class TBTWidget : public Dali::Internal::Adaptor::Widget +{ +public: + + TBTWidget(); + + ~TBTWidget(); + + static TBT::TBTWidget New(); + + virtual void OnCreate( const std::string& contentInfo, Dali::Window window ); + + virtual void OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type ); + + virtual void OnPause(); + + virtual void OnResume(); + + virtual void OnResize( Dali::Window window ); + + virtual void OnUpdate( const std::string& contentInfo, int force ); + +protected: + + // Undefined + TBTWidget(const TBTWidget&); + TBTWidget& operator=(TBTWidget&); +}; + +} // namespace Internal + +} // namespace Dali +#endif // __DALI_INTERNAL_TBT_WIDGET_H__ diff --git a/coretbtwidgetapp-dali/inc/tbt-widget/tbt-widget.h b/coretbtwidgetapp-dali/inc/tbt-widget/tbt-widget.h new file mode 100644 index 0000000..d0aba69 --- /dev/null +++ b/coretbtwidgetapp-dali/inc/tbt-widget/tbt-widget.h @@ -0,0 +1,51 @@ +#ifndef __DALI_TBT_WIDGET_H__ +#define __DALI_TBT_WIDGET_H__ + +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * + * 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 + +namespace TBT +{ + +namespace Internal +{ +class TBTWidget; +} + +class TBTWidget : public Dali::Widget +{ +public: + + TBTWidget(); + + static TBTWidget New(); + + ~TBTWidget(); + + TBTWidget( const TBTWidget& tbtWidget ); + + TBTWidget& operator=( const TBTWidget& tbtWidget ); + +public: + explicit TBTWidget( Internal::TBTWidget* tbtWidget ); + +}; + +} +#endif // ___DALI_TBT_WIDGET_H__ diff --git a/coretbtwidgetapp-dali/src/hello-world-example.cpp b/coretbtwidgetapp-dali/src/hello-world-example.cpp index 39fa54c..58e3945 100644 --- a/coretbtwidgetapp-dali/src/hello-world-example.cpp +++ b/coretbtwidgetapp-dali/src/hello-world-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ */ #include +#include <../inc/tbt-widget/tbt-widget.h> using namespace Dali; -using Dali::Toolkit::TextLabel; // This example shows how to create and display Hello World! using a simple TextActor // @@ -26,7 +26,7 @@ class HelloWorldController : public ConnectionTracker { public: - HelloWorldController( Application& application ) + HelloWorldController( WidgetApplication& application ) : mApplication( application ) { // Connect to the Application's Init signal @@ -41,17 +41,13 @@ public: // The Init signal is received once (only) during the Application lifetime void Create( Application& application ) { - // Get a handle to the stage - Stage stage = Stage::GetCurrent(); - stage.SetBackgroundColor( Color::WHITE ); - - TextLabel textLabel = TextLabel::New( "Hello World" ); - textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - textLabel.SetName( "helloWorldLabel" ); - stage.Add( textLabel ); + mApplication.RegisterWidgetCreatingFunction("org.tizen.coretbtwidgetapp-dali", CustomWidgetCreatingFunction); + } - // Respond to a click anywhere on the stage - stage.GetRootLayer().TouchSignal().Connect( this, &HelloWorldController::OnTouch ); + static Widget CustomWidgetCreatingFunction(const std::string& widgetName) + { + TBT::TBTWidget tbtWidget = TBT::TBTWidget::New(); + return tbtWidget; } bool OnTouch( Actor actor, const TouchData& touch ) @@ -62,12 +58,12 @@ public: } private: - Application& mApplication; + WidgetApplication& mApplication; }; int DALI_EXPORT_API main( int argc, char **argv ) { - Application application = Application::New( &argc, &argv ); + WidgetApplication application = WidgetApplication::New( &argc, &argv,"" ); HelloWorldController test( application ); application.MainLoop(); return 0; diff --git a/coretbtwidgetapp-dali/src/tbt-widget/tbt-widget-impl.cpp b/coretbtwidgetapp-dali/src/tbt-widget/tbt-widget-impl.cpp new file mode 100644 index 0000000..a69fdc7 --- /dev/null +++ b/coretbtwidgetapp-dali/src/tbt-widget/tbt-widget-impl.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * + * 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. + * + */ + +// CLASS HEADER +#include +#include "../../inc/tbt-widget/tbt-widget-impl.h" + +using namespace Dali; +using namespace Dali::Toolkit; + +namespace TBT +{ + +namespace Internal +{ + +TBT::TBTWidget TBTWidget::New() +{ + IntrusivePtr impl = new TBTWidget(); + TBT::TBTWidget handle = TBT::TBTWidget( impl.Get() ); + return handle; +} + +TBTWidget::TBTWidget() +{ +} + +TBTWidget::~TBTWidget() +{ +} + + +void TBTWidget::OnCreate( const std::string& contentInfo, Dali::Window window ) +{ + Stage::GetCurrent().SetBackgroundColor(Color::WHITE); + TextLabel label = TextLabel::New("Hello world!"); + label.SetPosition(0,0); + label.SetSize(Stage::GetCurrent().GetSize()); + label.SetProperty(TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER"); + label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER"); + label.SetAnchorPoint(AnchorPoint::TOP_LEFT); + Stage::GetCurrent().Add( label ); +} + +void TBTWidget::OnTerminate( const std::string& contentInfo, Dali::Widget::Termination type ) +{ +} + +void TBTWidget::OnPause() +{ +} + +void TBTWidget::OnResume() +{ +} + +void TBTWidget::OnResize( Dali::Window window ) +{ +} + +void TBTWidget::OnUpdate( const std::string& contentInfo, int force ) +{ +} + +} // Internal + +} // Dali diff --git a/coretbtwidgetapp-dali/src/tbt-widget/tbt-widget.cpp b/coretbtwidgetapp-dali/src/tbt-widget/tbt-widget.cpp new file mode 100644 index 0000000..f7e6238 --- /dev/null +++ b/coretbtwidgetapp-dali/src/tbt-widget/tbt-widget.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * + * 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 "../../inc/tbt-widget/tbt-widget.h" +#include "../../inc/tbt-widget/tbt-widget-impl.h" + +namespace TBT +{ + +TBTWidget::TBTWidget() +{ +} + +TBTWidget TBTWidget::New() +{ + return Internal::TBTWidget::New(); +} + +TBTWidget::~TBTWidget() +{ +} + + +TBTWidget::TBTWidget(const TBTWidget& tbtWidget) +: Dali::Widget(tbtWidget) +{ +} + +TBTWidget& TBTWidget::operator=(const TBTWidget& tbtWidget) +{ + if( *this != tbtWidget ) + { + Dali::Widget::operator=( tbtWidget ); + } + return *this; +} + +TBTWidget::TBTWidget( Internal::TBTWidget* tbtWidget ) +: Dali::Widget( tbtWidget ) +{ +} + +} // namespace Dali diff --git a/tbtcoreapp-widget-new-dali/.cproject b/tbtcoreapp-widget-new-dali/.cproject index 0dd8080..ff3dd50 100644 --- a/tbtcoreapp-widget-new-dali/.cproject +++ b/tbtcoreapp-widget-new-dali/.cproject @@ -21,13 +21,13 @@ - - + + - + - + - + @@ -313,25 +317,20 @@ - + - + @@ -615,4 +613,5 @@ + diff --git a/tbtcoreapp-widget-new-dali/inc/model/tbt-info.h b/tbtcoreapp-widget-new-dali/inc/model/tbt-info.h deleted file mode 100644 index c1c41d8..0000000 --- a/tbtcoreapp-widget-new-dali/inc/model/tbt-info.h +++ /dev/null @@ -1,395 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - * - *******************************************************************************/ - -/** - * @file tbt-info.h - * @brief This file provides the basic structure of all modules. - * @since_tizen 2.3 - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @bug - * @credit - */ -#ifndef __TBT_INFO_H__ -#define __TBT_INFO_H__ - -#include -#include - -typedef struct _tbt_info tbt_info; - -typedef enum{ - TBT_INFO_RESULT_NOT_TESTED=0, - TBT_INFO_RESULT_PASS=1, - TBT_INFO_RESULT_FAIL=2, - TBT_INFO_RESULT_NOT_SUPPORTED=3 -} tbt_info_result; - -/** - * @brief main Item for tbt list - * @since_tizen 2.3 - */ -typedef enum { - TBT_APP_CAMERA_CAPTURE = 0, - TBT_APP_CAMERA_RECORD, - TBT_APP_CAMERA_FACE_DETECT, - TBT_APP_CAMERA_HDR_CAPTURE, - - TBT_APP_SOUND_AUDIO, - TBT_APP_SOUND_VOLUME, - - TBT_APP_GPS_GPS, - - TBT_APP_BT_CLIENT_PAIRED, - TBT_APP_BT_SERVER_PAIRED, - TBT_APP_BT_AUDIO_CONNECT, - TBT_APP_BT_AUDIO_CONNECT_HANDSFREE, - TBT_APP_BT_AUTHORIZATION, - TBT_APP_BT_OPP_CLIENT, - TBT_APP_BT_OPP_SERVER, - TBT_APP_BT_PROFILES, - TBT_APP_BT_SDP, - TBT_APP_BT_SERVER_SOCKET, - TBT_APP_BT_CLIENT_SOCKET, - TBT_APP_BT_HID_CONNECT, - TBT_APP_BT_OOB_PERIPHERAL, - TBT_APP_BT_OOB_DEVICE, - TBT_APP_BT_AVRCP, - TBT_APP_BT_AG, - TBT_APP_BT_HDP, - - TBT_APP_BLE_GATT_CLIENT, - - TBT_APP_BT_CALLBACK_CREATE_BOND_TEST, - TBT_APP_BT_CALLBACK_DESTROY_BOND_TEST, - TBT_APP_BT_CALLBACK_DISCOVER_DEVICES_TEST, - TBT_APP_BT_CALLBACK_GET_DEVICE_TEST, - TBT_APP_BT_CALLBACK_SET_NAME_TEST, - TBT_APP_BT_CALLBACK_ADD_ADVERTISING_SERVICE_UUID_TEST, - - - TBT_APP_WIFIDIRECT, - TBT_APP_WIFIDIRECT_CONNECTION_CANCEL, - - TBT_APP_WIFI_WIFI, - - TBT_APP_NFC_P2P, - TBT_APP_NFC_TAG, - - TBT_APP_DISPLAY_DISPLAY, - - TBT_APP_GRAPHICS_GRAPHICS, - - TBT_APP_IDEV_NUM_KEYPAD, - TBT_APP_IDEV_PH_NUM_KEYPAD, - TBT_APP_IDEV_IP_KEYPAD, - - TBT_APP_LOCAL_MPEG4, - TBT_APP_LOCAL_H263, - TBT_APP_LOCAL_H264, - - TBT_APP_IMAGEVIEW_JPEG, - TBT_APP_IMAGEVIEW_BMP, - TBT_APP_IMAGEVIEW_GIF, - TBT_APP_IMAGEVIEW_PNG, - - TBT_APP_DC_INSERT, - TBT_APP_DC_DELETE, - TBT_APP_DC_UPDATE, - TBT_APP_DC_SELECT, - TBT_APP_DC_CURSOR, - TBT_APP_DC_MAP, - - TBT_APP_PICK_VIEW_APP, - TBT_APP_PICK_PICK_APP, - - TBT_APP_PICK_VIEW_BR0WSER_APP, - TBT_APP_PICK_VIEW_IMAGE_APP, - TBT_APP_PICK_VIEW_SOUND_APP, - TBT_APP_PICK_VIEW_VIDEO_APP, - TBT_APP_PICK_PICK_ALL_APP, - TBT_APP_PICK_PICK_IMAGE_APP, - TBT_APP_PICK_PICK_VIDEO_APP, - TBT_APP_PICK_PICK_AUDIO_APP, - - TBT_APP_SENSOR_ACCELEROMETER, - TBT_APP_SENSOR_GYROSCOPE, - TBT_APP_SENSOR_PROXIMITY, - TBT_APP_SENSOR_LIGHT, - TBT_APP_SENSOR_ULTRA_VIOLET, - TBT_APP_SENSOR_MAGNATOMETER, - TBT_APP_SENSOR_PRESSURE, - - - TBT_APP_ANIMATION_FADE, - TBT_APP_ANIMATION_POINT, - TBT_APP_ANIMATION_DIMENSION, - TBT_APP_ANIMATION_RECT, - TBT_APP_ANIMATION_ROTATE, - - TBT_APP_UI_RESIZE, - TBT_APP_UI_SHAPE, - TBT_APP_UI_ROTATE, - TBT_APP_UI_FONT, - TBT_APP_UI_LINE, - TBT_APP_UI_ALPHA, - - TBT_APP_SL_SCREENLOCK, - - TBT_APP_TOUCH_TOUCH, - - TBT_APP_MOCK, - TBT_APP_EVENT_VIEW, - - TBT_APP_FEATURE_SUMMARY, - - TBT_APP_RUNTIME_INFO, - - TBT_APP_SCREEN_MIRROR_SINK, - - TBT_APP_ATTACH_PANEL, - - TBT_APP_OAUTH2, - - TBT_APP_PUSH_SERVICE, - - TBT_APP_MAX, - - TBT_APP_EFL_CALLBACK, - - TBT_APP_SHORTCUT, - - TBT_APP_IME_ALPHABATIC, - - TBT_APP_IME_NUMERIC, - - TBT_APP_IME_EVENT, - - TBT_APP_IME_CONTEXT_GET, - - TBT_APP_WIDGET, - - TBT_APP_MTP, - - TBT_APP_NSD_DNS_SD_LOCAL, - - TBT_APP_NSD_DNS_SD_REMOTE, - - TBT_APP_NSD_SSDP_LOCAL, - - TBT_APP_NSD_SSDP_REMOTE, - - TBT_APP_STORAGE, - - TBT_APP_RADIO, - - TBT_APP_SOUND_MANAGER, - - TBT_APP_SOUND_MANAGER_DEVICE, - - TBT_APP_MEDIA_KEY, - - TBT_APP_PACKAGE_MANAGER, - - TBT_APP_NOTIFICATION_TEXT, - - TBT_APP_NOTIFICATION_TIME, - - TBT_APP_NOTIFICATION_TITLE, - - TBT_APP_NOTIFICATION_IMAGE, - - TBT_APP_CONNECTION, - - TBT_APP_SYSTEM_SETTINGS, - - TBT_APP_CONTACTS, - - TBT_APP_DALI_DALI - -} tbt_app_type_e; - - -/** - * @brief Measurement units for sensors - * @since_tizen 2.3 - */ -typedef enum { - SENSOR_UNIT_METRE_PER_SECOND_SQUARED, - SENSOR_UNIT_MICRO_TESLA, - SENSOR_UNIT_DEGREE, - SENSOR_UNIT_LUX, - SENSOR_UNIT_CENTIMETER, - SENSOR_UNIT_DEGREE_PER_SECOND, - SENSOR_UNIT_HECTOPASCAL, - SENSOR_UNIT_MAX -} sensor_unit_e; - - - -/** - * @brief Extra value getter function - * @since_tizen 2.3 - * @param[in] info Sensor info - * @param[in] values Values received from the sensor - * @return Calculated value - */ -typedef float (*sensor_extra_value_get_cb)(const tbt_info *info, const float *values); - -/** - * @brief Extra value associated with the sensor - * @since_tizen 2.3 - * @details Allows to add value which is not received from the sensor, - * but instead calculated based on sensor values - */ -typedef struct _sensor_extra_value -{ - const char *name; /**< Value name */ - const char *format; /**< Value printf() format for text representation */ - sensor_extra_value_get_cb value_get; /**< Value getter function */ -} sensor_extra_value; - -/** - * @brief Module metadata - * @since_tizen 2.3 - */ -struct _tbt_info -{ - - const char *name; //tbt display name - const char *parent; //tbt display name - tbt_app_type_e apptype; //Values measurement units - tbt_info_result result; //app status: pass or fail - const char *info; //Values measurement units string representation - const char *icon_name; //Values measurement units string representation - const char *file_name; //Values measurement units string representation - const char *extra_file_name; - const char *layout_file; //Values measurement units string representation - const char *layout_group; //Values measurement units string representation - sensor_h sensor; /**< Sensor handle */ - sensor_type_e sensortype; /**< Sensor type, @see sensor_type_e */ - sensor_unit_e units; /**< Values measurement units */ - int sensor_response_interval; - const char **value_names; /**< Value names array of value_count size */ - int value_count; /**< Values count */ - float value_min; /**< Minimal value */ - float value_max; /**< Maximal value */ - float value_range; /**< Values range */ - const char *units_str; /**< Values measurement units string representation */ - const char *value_format; /**< Values printf() format for text representation */ - int axes[3]; /**< Sensor axes directions relative to screen coordinate system */ - sensor_extra_value *extra_values; /**< Sensor variable to retrieve the sensor extra values */ - int extra_value_count; /**< The count of the extra values */ - bool is_push_from_outside; /**< Checks if push data is received or not */ - char* push_operation_id; /**< Operation id of push data */ - app_control_h push_app_control; /**< App conrol handler*/ - int required_features_count; /**< Number of features required */ - int features_required[16]; /**< Index/indexs of features required */ - -}; - -/** - * @brief Feature List - * @since_tizen 2.3 - */ -static char *feature_list[1024] = -{ - "tizen.org/feature/camera", - "tizen.org/feature/camera.back", - "tizen.org/feature/camera.back.flash", - "tizen.org/feature/camera.front", - "tizen.org/feature/camera.front.flash", - "tizen.org/feature/database.encryption", - "tizen.org/feature/fmradio", - "tizen.org/feature/graphics.acceleration", - "tizen.org/feature/input.keyboard", - "tizen.org/feature/input.keyboard.layout", - "tizen.org/feature/location", - "tizen.org/feature/location.gps", - "tizen.org/feature/location.wps", - "tizen.org/feature/microphone", - "tizen.org/feature/multi_point_touch.point_count", - "tizen.org/feature/multi_point_touch.pinch_zoom", - "tizen.org/feature/network.bluetooth", - "tizen.org/feature/network.nfc", - "tizen.org/feature/network.nfc.reserved_push", - "tizen.org/feature/network.push", - "tizen.org/feature/network.secure_element", - "tizen.org/feature/network.telephony", - "tizen.org/feature/network.telephony.mms", - "tizen.org/feature/network.telephony.sms.cbs", - "tizen.org/feature/network.wifi", - "tizen.org/feature/network.wifi.direct", - "tizen.org/feature/opengles.texture_format.3dc", - "tizen.org/feature/opengles.texture_format.atc", - "tizen.org/feature/opengles.texture_format.etc", - "tizen.org/feature/opengles.texture_format.ptc", - "tizen.org/feature/opengles.texture_format.pvrtc", - "tizen.org/feature/opengles.texture_format.utc", - "tizen.org/feature/opengles.version.1_1", - "tizen.org/feature/opengles.version.2_0", - "tizen.org/feature/platform.core.cpu.arch.armv7", - "tizen.org/feature/platform.core.fpu.arch.sse2", - "tizen.org/feature/platform.core.fpu.arch.sse3", - "tizen.org/feature/platform.core.fpu.arch.ssse3", - "tizen.org/feature/platform.core.fpu.arch.vfpv3", - "tizen.org/feature/platform.core.cpu.arch.x86", - "tizen.org/feature/platform.native.osp_compatible", - "tizen.org/feature/screen.auto_rotation", - "tizen.org/feature/sensor.accelerometer", - "tizen.org/feature/sensor.accelerometer.wakeup", - "tizen.org/feature/sensor.gyroscope", - "tizen.org/feature/sensor.gyroscope.wakeup", - "tizen.org/feature/sensor.magnetometer", - "tizen.org/feature/sensor.magnetometer.wakeup", - "tizen.org/feature/sensor.proximity", - "tizen.org/feature/sensor.proximity.wakeup", - "tizen.org/feature/sensor.tiltmeter", - "tizen.org/feature/sensor.tiltmeter.wakeup", - "tizen.org/feature/shell.appwidget", - "tizen.org/feature/network.bluetooth", - "tizen.org/feature/sip.voip", - "tizen.org/feature/speech.recognition", - "tizen.org/feature/speech.synthesis", - "tizen.org/feature/usb.accessory", - "tizen.org/feature/usb.host", - "tizen.org/feature/vision.face_recognition", - "tizen.org/feature/vision.image_recognition", - "tizen.org/feature/vision.qrcode_generation", - "tizen.org/feature/vision.qrcode_recognition", - "tizen.org/feature/bluetooth", - "tizen.org/feature/bluetooth.le", - "tizen.org/feature/network.bluetooth.le", - "tizen.org/feature/bluetooth.audio.media", - "tizen.org/feature/network.bluetooth.audio.media", - "tizen.org/feature/bluetooth.audio.call", - "tizen.org/feature/network.bluetooth.audio.call", - "tizen.org/feature/bluetooth.hdp", - "tizen.org/feature/network.bluetooth.hdp" - "tizen.org/feature/bluetooth.hid", - "tizen.org/feature/network.bluetooth.hid", - "tizen.org/feature/bluetooth.opp", - "tizen.org/feature/network.bluetooth.opp", - "tizen.org/feature/bluetooth.spp", - "tizen.org/feature/network.nfc.p2p", - "tizen.org/feature/network.nfc.tag", - "tizen.org/feature/network.wifi.direct.display", - "tizen.org/feature/network.internet", - "tizen.org/feature/notification" -}; - -#endif /* __TBT_INFO_H__ */ diff --git a/tbtcoreapp-widget-new-dali/inc/model/tbt-list.h b/tbtcoreapp-widget-new-dali/inc/model/tbt-list.h deleted file mode 100644 index c7334ef..0000000 --- a/tbtcoreapp-widget-new-dali/inc/model/tbt-list.h +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - * - *******************************************************************************/ - -/** - * @file tbt-list.h - * @brief This file Handles main List of Application. - * @since_tizen 2.3 - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @bug - * @credit - */ - -#ifndef __TBT_LIST_H__ -#define __TBT_LIST_H__ - -#include "tbt-info.h" - -/** - * @brief Initialize sensor info list - * @since_tizen 2.3 - */ -void tbt_list_init(); - -/** - * Save xml report file for future use - * @since_tizen 2.3 - */ -void tbt_save_report(); - -/** - * @brief Get list of tbt list supported by application - * @since_tizen 2.3 - * @param[out] count tbts list count - * @return Sensor list - */ -const tbt_info *tbt_list_get(unsigned *count); - -/** - * Returns total count of tbt_info; - * @since_tizen 2.3 - */ -const int tbt_info_count(); - -/** - * @brief Get list of tbt list supported by application - * @since_tizen 2.3 - * @param[out] count tbts list count - * @return Sensor list - */ -tbt_info *tbt_list_item_get(int index); - -/** - * @brief Get list item index of tbt list supported by application - * @since_tizen 2.3 - * @param[out] count tbts list count - * @return Sensor list - */ -const int tbt_list_item_index_get_by_app_type(int app_type); -/** - * @brief Get list item count tbt list supported by application - * @since_tizen 2.3 - * @param[out] count tbts list count - * @return Sensor list - */ -const int tbt_list_item_count(int index); - -#endif /* __TBT_LIST_H__ */ diff --git a/tbtcoreapp-widget-new-dali/inc/utils/app_module_config.h b/tbtcoreapp-widget-new-dali/inc/utils/app_module_config.h deleted file mode 100644 index 3e06a29..0000000 --- a/tbtcoreapp-widget-new-dali/inc/utils/app_module_config.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _EXCLUDE_LIST_H -#define _EXCLUDE_LIST_H - -//#define TIZEN_2_3_1 -//#define TIZEN_2_4 -#define TIZEN_3_0 - -#define DEVICE_TYPE_MOBILE -//#define DEVICE_TYPE_WEARABLE - -#define TBT_MODULE_DALI -#define TBT_MODULE_APP_DALI_TTS - -#endif diff --git a/tbtcoreapp-widget-new-dali/inc/utils/config.h b/tbtcoreapp-widget-new-dali/inc/utils/config.h deleted file mode 100644 index d7f7908..0000000 --- a/tbtcoreapp-widget-new-dali/inc/utils/config.h +++ /dev/null @@ -1,375 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - * - *******************************************************************************/ - -/** - * @file config.h - * @brief This file Configures the Application. - * @since_tizen 2.3 - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @bug - * @credit - */ -#ifndef CONFIG_H_ -#define CONFIG_H_ - -#include "utils/app_module_config.h" -#include -#include -#include -#include -#include -#include -#include "utils/logger.h" -#include -#include - -#define MAX_LENGTH_CONFIG 1024 - -#define EDJPATH "edje" -#define AUDIOPATH "sounds" -#define VIDEOPATH "video" -#define IMAGEPATH "images" - -extern bool __is_efl_test_running; - -//Push: -#define PUSH_APP_ID "da58f09b7dcd898f" -#define PUSH_APP_SECRET "E55A746761233098DDD1114F652AFE51" - - -// *_X_POS, *_Y_POS, *_WIDTH, *_HEIGHT are virtual (relative) coords of grid widget -#define MAX_WIDTH 100 -#define MAX_HEIGHT 100 - -#define IMAGE_X_POS 0 -#define IMAGE_Y_POS 0 -#define IMAGE_WIDTH MAX_WIDTH -#define IMAGE_HEIGHT 40 - -#define LABEL_X_POS 0 -#define LABEL_Y_POS IMAGE_HEIGHT -#define LABEL_WIDTH MAX_WIDTH -#define LABEL_HEIGHT MAX_WIDTH-IMAGE_HEIGHT - -#define LABEL_MAX_LEN 500 - -#define IMAGES_REL_FOLDER "images" -#define IMAGE_REL_PATH_TEMPLATE "%s/%s" - -#define TOOLBAR_BUTTON_DATA_KEY "button_id" - -#define LABEL_REL_PATH "res/IMAGES_REL_FOLDER/" -#define LABEL_TEMPLATE "%s%s
Dimension = %u x %u
Result:E_SUCCESS" - -#define TABLE_PADDING_VERTICAL 20 -#define TABLE_PADDING_HORIZONTAL 20 - -#define NAVI_TOOLBAR_HEIGHT 150 - -#ifdef TIZEN_2_3_1 - #define WINDOW_PREFERED_ENGINE "opengl_x11" -#else - #define WINDOW_PREFERED_ENGINE "3d" -#endif - - -#define PICK_VIEW_APP_PACKAGE_NAME "org.tizen.coretbt_uiapp"; -#define PICK_VIEW_SERVICEAPP_PACKAGE_NAME "org.tizen.coretbt_serviceapp"; - - -#define PICK_VIEW_URL_HTTP "http://www.tizen.org" -#define PICK_VIEW_URL_HTTPS "https://www.tizen.org/" - -#define PICK_VIEW_IMAGE_BMP "images/zebra_1024_680.bmp" -#define PICK_VIEW_IMAGE_JPG "images/giraffe_800_1179.jpg" -#define PICK_VIEW_IMAGE_GIF "images/squee.gif" -#define PICK_VIEW_IMAGE_PNG "images/plane_1024_768.png" - -#define PICK_VIEW_SOUND_AAC "sounds/SampleAAC.aac" -#define PICK_VIEW_SOUND_AMR "sounds/SampleAMR.amr" -#define PICK_VIEW_SOUND_MP3 "sounds/SampleMP3.mp3" -#define PICK_VIEW_SOUND_WAV "sounds/SampleWAV.wav" - -#define PICK_VIEW_VIDEO_3GP "video/sampleH263.3gp" -#define PICK_VIEW_VIDEO_MP4 "video/sampleMPEG4.mp4" - - - - -#define WIDGET_VIEW_APPID "org.tizen.coretbtwidgetapp"; -#define VIEWER_VIEW_APP_PACKAGE_NAME "org.tizen.widget_viewer_sdk"; - -#define DATA_CONTROL_PROVIDER_MAP_ID "MapRepository"; -#define DATA_CONTROL_PROVIDER_DATA_ID "provider"; - -#define DATA_CONTROL_PROVIDER_ID "http://coretbt_dataprovider.com/datacontrol/provider/coretbt_dataprovider"; -#define DATA_CONTROL_MAP_PROVIDER_ID "http://coretbt_dataprovider.com/datacontrol/provider/coretbt_dataprovider_map"; - - -#define BLUETOOTH_SOCKET_UUID "00001101-0000-1000-8000-00805F9B34FB" - -#define DEFINED_WIDTH 480 -#define DEFINED_HEIGHT 800 - -//char *TBT_LOGGING_DIR; -//char *TBT_MEDIA_DIR; -//char XML_REPORT_FILE_PATH[128]; -//char MEDIA_FILE_PATH[128]; - - -static inline const char *get_data_path(const char * file_path); -static inline const char *get_resource_path(const char * file_path); -static inline const char *get_shared_resource_path(const char *file_path); - - -typedef enum { - DEVICE_WEARABLE, - DEVICE_MOBILE, - DEVICE_WEARABLE_360_X_480, - DEVICE_WEARABLE_320_X_320, - DEVICE_WEARABLE_CIRCLE, - - DEVICE_NONE, - DEVICE_MAX -}device_type_e; - -static inline device_type_e get_device_type(); - -typedef enum -{ - CURSOR_NONE_PRESSED = -1, - CURSOR_START_PRESSED , - CURSOR_FIRST_PRESSED , - CURSOR_NEXT_PRESSED , - CURSOR_PREVIOUS_PRESSED , - CURSOR_LAST_PRESSED -}_Data_Control_Cursor_State; - -static int _supportedStorageID; -static bool _storage_device_supported_cb(int storage_id, storage_type_e type, storage_state_e state, const char *path, void *user_data) -{ - if(type == STORAGE_TYPE_INTERNAL) - { - // save storage id - _supportedStorageID=storage_id; - return false; - } - return true; -} - -static void -app_get_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max) -{ - char *res_path = app_get_resource_path(); - if (res_path) { - snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in); - } -} - -static void -app_get_shared_resource(const char *edj_file_in, char *edj_path_out, int edj_path_max) -{ - char *res_path = app_get_shared_resource_path(); - if (res_path) { - snprintf(edj_path_out, edj_path_max, "%s%s", res_path, edj_file_in); - } -} - -static inline const char *get_edje_path(const char *file_name) -{ -char absolute_path[MAX_LENGTH_CONFIG] = {'\0'}; -char file_path[MAX_LENGTH_CONFIG] = {'\0'}; -#ifdef TIZEN_2_3_1 - #ifdef DEVICE_TYPE_MOBILE - strncat(file_path, "edje/2.3.1/mobile/", sizeof("edje/2.3.1/mobile/")); - #endif - #ifdef DEVICE_TYPE_WEARABLE - if(get_device_type() == DEVICE_WEARABLE) - { - strncat(file_path, "edje/2.3.1/wearable/", sizeof("edje/2.3.1/wearable/")); - } - else if(get_device_type() == DEVICE_WEARABLE_360_X_480) - { - strncat(file_path, "edje/2.3.1/wearable_360_x_480/", sizeof("edje/2.3.1/wearable_360_x_480/")); - } - else if(get_device_type() == DEVICE_WEARABLE_320_X_320) - { - strncat(file_path, "edje/2.3.1/wearable_320_x_320/", sizeof("edje/2.3.1/wearable_320_x_320/")); - } - else if(get_device_type() == DEVICE_WEARABLE_CIRCLE) - { - strncat(file_path, "edje/2.3.1/wearable_circle/", sizeof("edje/2.3.1/wearable_circle/")); - } - #endif -#endif - - - -#ifdef TIZEN_2_4 - #ifdef DEVICE_TYPE_MOBILE - strncat(file_path, "edje/2.4/mobile/", sizeof("edje/2.4/mobile/")); - #endif - #ifdef DEVICE_TYPE_WEARABLE - if(get_device_type() == DEVICE_WEARABLE) - { - strncat(file_path, "edje/2.4/wearable/", sizeof("edje/2.4/wearable/")); - } - else if(get_device_type() == DEVICE_WEARABLE_360_X_480) - { - strncat(file_path, "edje/2.4/wearable_360_x_480/", sizeof("edje/2.4/wearable_360_x_480/")); - } - else if(get_device_type() == DEVICE_WEARABLE_320_X_320) - { - strncat(file_path, "edje/2.4/wearable_320_x_320/", sizeof("edje/2.4/wearable_320_x_320/")); - } - else if(get_device_type() == DEVICE_WEARABLE_CIRCLE) - { - strncat(file_path, "edje/2.4/wearable_circle/", sizeof("edje/2.4/wearable_circle/")); - } - #endif -#endif - - - -#ifdef TIZEN_3_0 - #ifdef DEVICE_TYPE_MOBILE - strncat(file_path, "edje/3.0/mobile/", sizeof("edje/3.0/mobile/")); - #endif - #ifdef DEVICE_TYPE_WEARABLE - if(get_device_type() == DEVICE_WEARABLE) - { - strncat(file_path, "edje/2.4/wearable/", sizeof("edje/2.4/wearable/")); - } - else if(get_device_type() == DEVICE_WEARABLE_360_X_480) - { - strncat(file_path, "edje/2.4/wearable_360_x_480/", sizeof("edje/2.4/wearable_360_x_480/")); - } - else if(get_device_type() == DEVICE_WEARABLE_320_X_320) - { - strncat(file_path, "edje/2.4/wearable_320_x_320/", sizeof("edje/2.4/wearable_320_x_320/")); - } - else if(get_device_type() == DEVICE_WEARABLE_CIRCLE) - { - strncat(file_path, "edje/2.4/wearable_circle/", sizeof("edje/2.4/wearable_circle/")); - } - #endif -#endif - - int num = strlen(file_name); - if(strlen(file_path)+strlen(file_name) <= MAX_LENGTH_CONFIG) - { - num = strlen(file_name); - } - else - { - num = MAX_LENGTH_CONFIG-strlen(file_path); - } - - strncat(file_path,file_name, num); - app_get_resource(file_path, absolute_path, (int)MAX_LENGTH_CONFIG); - return strdup(absolute_path); - -} -static inline const char *get_resource_path(const char *file_path) -{ - static char absolute_path[MAX_LENGTH_CONFIG] = {'\0'}; - app_get_resource(file_path, absolute_path, (int)MAX_LENGTH_CONFIG); - return strdup(absolute_path); -} - -static inline const char *get_shared_resource_path(const char *file_path) -{ - static char absolute_path[MAX_LENGTH_CONFIG] = {'\0'}; - app_get_shared_resource(file_path, absolute_path, (int)MAX_LENGTH_CONFIG); - return strdup(absolute_path); -} - -static inline const char *get_storage_image_dir_path() -{ - static char *absolute_path; - // lets set storage devices - storage_foreach_device_supported(_storage_device_supported_cb,NULL); - storage_get_directory(_supportedStorageID,STORAGE_DIRECTORY_IMAGES,&absolute_path); - DBG("Logging_Dir set = %s",absolute_path); - - return strdup(absolute_path); -} - -static inline const char *get_data_path(const char *file_path) -{ - static char* absolute_path = NULL; - static char result[MAX_LENGTH_CONFIG]; - absolute_path = strdup(app_get_data_path()); - strcpy(result, absolute_path); - strcat(result, "/"); - strcat(result, file_path); - DBG("Data Path is %s", result); - return result; -} - -static inline char *gen_data_path(const char *file_path) -{ - char path[128]; - snprintf(path, sizeof(path), "%s%s",app_get_data_path(),file_path); - - return strdup(path); -} - -static inline char *format_string(const char *format, ...) -{ - va_list arg; - char* chTemp; - chTemp= (char*)malloc(1024 * sizeof(char)); - RETVM_IF(!chTemp, NULL,"malloc failed."); - va_start(arg,format); - vsnprintf(chTemp,1024,format,arg); - va_end(arg); - return chTemp; -} - -static inline device_type_e get_device_type() -{ - int width, height; - device_type_e device_type = DEVICE_NONE; - system_info_get_platform_int("tizen.org/feature/screen.width", &width); - system_info_get_platform_int("tizen.org/feature/screen.height", &height); - - if(width == 360 && height == 360) - { - //circle - device_type = DEVICE_WEARABLE_CIRCLE; - } - else if(width == 360 && height == 480) - { - device_type = DEVICE_WEARABLE_360_X_480; - } - else if(width == 320 && height == 320) - { - device_type = DEVICE_WEARABLE_320_X_320; - } - else - { - device_type = DEVICE_MOBILE; - } - -return device_type; - -} - - -#endif /* CONFIG_H_ */ diff --git a/tbtcoreapp-widget-new-dali/inc/utils/constrants.h b/tbtcoreapp-widget-new-dali/inc/utils/constrants.h deleted file mode 100644 index fc67127..0000000 --- a/tbtcoreapp-widget-new-dali/inc/utils/constrants.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - *******************************************************************************/ -/** - * @file constraints.h - * @brief constant values - * - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @credit - * - */ - -#ifndef CONSTRANTS_H_ -#define CONSTRANTS_H_ -#include -using namespace Dali; - -#define TEXTLABEL_HEIGHT 0.0625f // assume full screen width 1 and height 1. 0.0625 is 1/16 -#define TEXTFIELD_HEIGHT 0.0625f // assume full screen width 1 and height 1. 0.0625 is 1/16 -#define TEXTEDITOR_HEIGHT 0.08333f // assume full screen width 1 and height 1. 0.0625 is 1/12 -#define BUTTON_HEIGHT 0.125f // assume full screen width 1 and height 1. 0.125 is 1/8 -#define VERTICAL_SPACE 0.00781f // assume full screen width 1 and height 1. 0.125 is 1/128 -#define HORIZONTAL_SPACE 0.00781f // assume full screen width 1 and height 1. 0.125 is 1/128 - -const Vector4 selectedColor=Vector4(0.55f, 0.8f, 0.9f, 1.0f); -const Vector4 unSelectedColor=Vector4(0.8f, 0.9f, 0.9f, 1.0f); - - -#endif /* CONSTRANTS_H_ */ diff --git a/tbtcoreapp-widget-new-dali/inc/utils/dali-ui-utils.h b/tbtcoreapp-widget-new-dali/inc/utils/dali-ui-utils.h deleted file mode 100644 index 5bb8a36..0000000 --- a/tbtcoreapp-widget-new-dali/inc/utils/dali-ui-utils.h +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - *******************************************************************************/ -/** - * @file dali-ui-utils.h - * @brief UI Utils - * - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @credit - * - */ - -#ifndef DALI_UI_UTILS_H_ -#define DALI_UI_UTILS_H_ - -#include -#include -#include -#include -#include -#include "logger.h" -#include -#include "utils/constrants.h" -#include "utils/type-cast.h" - - -//global function -void get_screen_height_width(const char *key, int *value); - -using namespace Dali; -using namespace Dali::Toolkit; -using namespace std; - - -class UiUtils : public ConnectionTracker -{ - -public: - UiUtils(Application& application, app_control_h app_control); -public: - - Vector2 headerSize; - Vector2 bodySize; - Vector2 footerSize; - - TextLabel lblTitle; - //TextLabel lblInfoTitle; - - Control ctlRoot; - Control ctlHeader; - Control ctlBody; - Control ctlFooter; - Control ctlInfo; - - PushButton btnPassButton; - PushButton btnFailButton; - PushButton btnInfoButton; - - TableView tblVerdict; - - Application& mApplication; - app_control_h _control; - - bool bflag; - std::string mAppResourcePath; - std::string mImageDirectory; - std::string mInfoText; - -public: - void Init(std::string title); - - template - PushButton CreateVerdictButton(TableView parent, TableView::CellPosition cellPosition, - Vector3 anchorPoint, Vector2 position, std::string label, X* obj, - Ret (X::*onClickedCallback)(Arg0 arg0), - Vector4 selectedColor, Vector4 unselectedColor, Vector2 size); - - //template - PushButton CreateButton(Vector3 anchorPoint, Vector2 position, std::string label,/* X* obj, - Ret (X::*onClickedCallback)(Arg0 arg0),*/ Vector4 selectedColor, - Vector4 unselectedColor, Vector2 size); - - TextLabel CreateTextLabel(Vector3 anchorPoint, Vector3 parentOrigin, Vector2 position, - std::string txt, Vector2 size ); - - //template - Control CreateTextField(Vector3 anchorPoint, Vector3 parentOrigin, Vector2 position, - std::string txt, Vector2 size/*, X* obj, Ret (X::*onClickedCallback)(Arg0 arg0)*/ ); - - //template - Control CreateTextEditor(Vector3 anchorPoint, Vector3 parentOrigin, Vector2 position, - std::string txt, Vector2 size/*, X* obj, Ret (X::*onClickedCallback)(Arg0 arg0)*/ ); - - void CreateLabelList(Property::Map keyMap, Property::Map sizeMap); - void AddLabelToTable(TableView table,Property::Map keyMap, Property::Map sizeMap); - - void FillInfoPage(std::string content); - - bool OnPassButtonClick(Button button); - bool OnFailButtonClick(Button button); - bool OnInfoButtonClick(Button button); - void OnKeyEvent( const KeyEvent& event ); -}; - - -#endif /* DALI_UI_UTILS_H_ */ diff --git a/tbtcoreapp-widget-new-dali/inc/utils/type-cast.h b/tbtcoreapp-widget-new-dali/inc/utils/type-cast.h deleted file mode 100644 index dc615ca..0000000 --- a/tbtcoreapp-widget-new-dali/inc/utils/type-cast.h +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - *******************************************************************************/ - -/** - * @file type-cast.h - * @brief This file provide necessary Util functions UI. - * @since_tizen 3.0 - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @bug - * @credit - */ - -#ifndef __TYPE_CASE_H__ -#define __TYPE_CASE_H__ -#include -#include -#include - -std::string IntToString ( int number ); -std::string FloatToString ( float number ); -std::string LongToString ( long number ); - -#endif /* __TYPE_CASE_H__ */ diff --git a/tbtcoreapp-widget-new-dali/inc/utils/ui-utils.h b/tbtcoreapp-widget-new-dali/inc/utils/ui-utils.h deleted file mode 100644 index 5ce6b70..0000000 --- a/tbtcoreapp-widget-new-dali/inc/utils/ui-utils.h +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - *******************************************************************************/ - -/** - * @file ui-utils.h - * @brief This file provide necessary Util functions UI. - * @since_tizen 2.3 - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @bug - * @credit - */ - - -#ifndef __UI_UTILS_H__ -#define __UI_UTILS_H__ - -#include "utils/app_module_config.h" - -#include - -#ifdef TIZEN_3_0 - #include -#endif -#ifdef TIZEN_2_4 - #include -#endif -#ifdef TIZEN_2_3_1 - #include "efl_extension_events.h" -#endif -#include - - -enum -{ - TOOLBAR_ITEM_INDEX_PASS = 0, - TOOLBAR_ITEM_INDEX_FAIL, - TOOLBAR_ITEM_INDEX_INFO, - TOOLBAR_ITEM_INDEX_COUNT_MAX -} TOOLBAR_ITEM_INDEXS; - -static const char *caption_ok = "OK"; - -static const char *toolbar_item_names[TOOLBAR_ITEM_INDEX_COUNT_MAX] = { "Pass", - "Fail", - "Info" -}; - -static const int toolbar_item_ids[TOOLBAR_ITEM_INDEX_COUNT_MAX] = { TOOLBAR_ITEM_INDEX_PASS, - TOOLBAR_ITEM_INDEX_FAIL, - TOOLBAR_ITEM_INDEX_INFO -}; - - -#endif /* __UI_UTILS_H__ */ diff --git a/tbtcoreapp-widget-new-dali/inc/view/tbt-dali-widget-custom-view.h b/tbtcoreapp-widget-new-dali/inc/view/tbt-dali-widget-custom-view.h index 3cc9d9b..0bb27c9 100644 --- a/tbtcoreapp-widget-new-dali/inc/view/tbt-dali-widget-custom-view.h +++ b/tbtcoreapp-widget-new-dali/inc/view/tbt-dali-widget-custom-view.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -24,29 +24,25 @@ */ #ifndef __TBT_MODULE_APP_DALI_CUSTOM_WIDGET #define __TBT_MODULE_APP_DALI_CUSTOM_WIDGET -#include #include -#include #include #include "utils/logger.h" -#include "utils/config.h" -#include "utils/ui-utils.h" -#include "utils/dali-ui-utils.h" + using namespace Dali; using namespace Dali::Toolkit; -class WidgetApplicationController : public ConnectionTracker +class WidgetViewApplicationController : public ConnectionTracker { public: - WidgetApplicationController(WidgetApplication& application); - void Create(Application& application); - bool OnWidgetAdded(Toolkit::Button button ); - bool OnWidgetDeleted(Toolkit::Button button ); + WidgetViewApplicationController(Application& application); + void Create(Application& application); + bool OnWidgetAdded(Toolkit::Button button ); + bool OnWidgetDeleted(Toolkit::Button button ); - private: - void OnKeyEvent(const KeyEvent& event); - WidgetApplication & mApplication; - WidgetView::WidgetViewManager mWidgetViewManager; - WidgetView::WidgetView mWidgetView; +private: + void OnKeyEvent(const KeyEvent& event); + Application & mApplication; + WidgetView::WidgetViewManager mWidgetViewManager; + WidgetView::WidgetView mWidgetView; }; #endif diff --git a/tbtcoreapp-widget-new-dali/res/dali-toolkit-test-theme_720x1280.json b/tbtcoreapp-widget-new-dali/res/dali-toolkit-test-theme_720x1280.json deleted file mode 100644 index d3645a5..0000000 --- a/tbtcoreapp-widget-new-dali/res/dali-toolkit-test-theme_720x1280.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "styles": - { - "textlabel": - { - "fontStyle":"italic", - "pointSize":12 - }, - "testbutton": - { - "backgroundColor":[1.0,0.0,0.0,1.0], - "foregroundColor":[0.0,1.0,1.0,1.0] - } - } -} diff --git a/tbtcoreapp-widget-new-dali/res/images/Default_home.png b/tbtcoreapp-widget-new-dali/res/images/Default_home.png deleted file mode 100644 index 4487cab..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/Default_home.png and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/customTextFieldBgImage.jpg b/tbtcoreapp-widget-new-dali/res/images/customTextFieldBgImage.jpg deleted file mode 100644 index 85776e3..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/customTextFieldBgImage.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-1.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-1.jpg deleted file mode 100644 index ce9620f..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-1.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-10.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-10.jpg deleted file mode 100644 index dcf6188..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-10.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-11.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-11.jpg deleted file mode 100644 index 7f98989..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-11.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-12.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-12.jpg deleted file mode 100644 index c0e72ce..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-12.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-13.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-13.jpg deleted file mode 100644 index c96a2d6..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-13.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-14.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-14.jpg deleted file mode 100644 index 093adba..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-14.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-2.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-2.jpg deleted file mode 100644 index 75bcf3a..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-2.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-3.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-3.jpg deleted file mode 100644 index c0e72ce..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-3.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-4.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-4.jpg deleted file mode 100644 index 24f7ccd..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-4.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-5.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-5.jpg deleted file mode 100644 index c4a2414..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-5.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-6.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-6.jpg deleted file mode 100644 index b87e092..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-6.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-7.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-7.jpg deleted file mode 100644 index cf71867..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-7.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-8.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-8.jpg deleted file mode 100644 index 42b971e..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-8.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-9.jpg b/tbtcoreapp-widget-new-dali/res/images/gallery-medium-9.jpg deleted file mode 100644 index b2edbe4..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/gallery-medium-9.jpg and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/innerButtonSelected.png b/tbtcoreapp-widget-new-dali/res/images/innerButtonSelected.png deleted file mode 100644 index eae282c..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/innerButtonSelected.png and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/innerButtonUnselected.png b/tbtcoreapp-widget-new-dali/res/images/innerButtonUnselected.png deleted file mode 100644 index 657da96..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/innerButtonUnselected.png and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/text-field-bg.9.png b/tbtcoreapp-widget-new-dali/res/images/text-field-bg.9.png deleted file mode 100644 index 60d6173..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/text-field-bg.9.png and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/res/images/top-bar.png b/tbtcoreapp-widget-new-dali/res/images/top-bar.png deleted file mode 100644 index 0a31d0e..0000000 Binary files a/tbtcoreapp-widget-new-dali/res/images/top-bar.png and /dev/null differ diff --git a/tbtcoreapp-widget-new-dali/src/tbtcoreapp-dali-new.cpp b/tbtcoreapp-widget-new-dali/src/tbtcoreapp-dali-new.cpp index 74ae24f..1b8a00b 100644 --- a/tbtcoreapp-widget-new-dali/src/tbtcoreapp-dali-new.cpp +++ b/tbtcoreapp-widget-new-dali/src/tbtcoreapp-dali-new.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -14,31 +14,25 @@ * limitations under the License. *******************************************************************************/ /** - * @file tbtcoreapp-dali-new.cpp - * @brief tbt dali entry file + * @file tbtcoreapp-dali-new.cpp + * @brief tbt dali entry file * - * @author Awadhesh singh (awadhesh1.s@samsung.com) - * @date July, 2018 + * @author Awadhesh singh (awadhesh1.s@samsung.com) + * @date July, 2018 * @credit * */ -#include -#include -#include #include #include "utils/logger.h" -#include -#include -#include -#include #include "view/tbt-dali-widget-custom-view.h" + using namespace Dali; using namespace Dali::Toolkit; int main( int argc, char **argv ) { - WidgetApplication application = WidgetApplication::New( &argc, &argv, ""); - WidgetApplicationController test( application ); - application.MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS); - return 0; + Application application = Application::New( &argc, &argv, ""); + WidgetViewApplicationController test( application ); + application.MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS); + return 0; } diff --git a/tbtcoreapp-widget-new-dali/src/utils/dali-ui-utils.cpp b/tbtcoreapp-widget-new-dali/src/utils/dali-ui-utils.cpp deleted file mode 100644 index f1ca130..0000000 --- a/tbtcoreapp-widget-new-dali/src/utils/dali-ui-utils.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - *******************************************************************************/ -/** - * @file dali-ui-utils.cpp - * @brief UI Utils - * - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @credit - * - */ - -#include "utils/dali-ui-utils.h" -const Vector4 CUSTOM_BLUE_COLOR = Vector4( 66.0f/255.0f, 180.0f/255.0f, 198.0f/255.0f, 1.0f ); -const Vector4 EDITOR_COLOR = Vector4( 214.0f, 234.0f, 248.0f, 1.0f); - -UiUtils::UiUtils(Application& application, app_control_h app_control) : mApplication(application) -{ - DBG("UiUtils::UiUtils...."); - this->bflag=false; - this->mAppResourcePath= app_get_resource_path(); - this->mImageDirectory = this->mAppResourcePath + "images/"; - //this->mApplication=application; - this->_control=app_control; -} -void UiUtils::Init(std::string title) -{ - DBG("UiUtils::Init....Begin"); - Stage stage = Stage::GetCurrent(); - Vector2 stageSize=stage.GetSize(); - stage.SetBackgroundColor( Color::WHITE ); - - this->ctlRoot=Control::New(); - this->ctlRoot.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->ctlRoot.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->ctlRoot.SetSize(stageSize); - this->ctlRoot.SetPosition(0.0f, 0.0f); - this->ctlRoot.SetBackgroundColor(Color::WHITE); - stage.Add(this->ctlRoot); - - this->headerSize=Vector2(stageSize.width, stageSize.height*0.0781); - this->footerSize=Vector2(stageSize.width, stageSize.height*0.125); - this->bodySize=Vector2(stageSize.width, stageSize.height - (this->headerSize.y+footerSize.y)); - - this->lblTitle=TextLabel::New(title); - this->lblTitle.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->lblTitle.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->lblTitle.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER"); - this->lblTitle.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER"); - - this->ctlHeader=Control::New(); - this->ctlHeader.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->ctlHeader.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->ctlHeader.SetSize(this->headerSize); - this->ctlHeader.SetPosition(0.0f, 0.0f); - this->ctlHeader.SetBackgroundColor(CUSTOM_BLUE_COLOR); - this->ctlHeader.Add(this->lblTitle); - this->ctlRoot.Add(this->ctlHeader); - - this->ctlBody=Control::New(); - this->ctlBody.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->ctlBody.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->ctlBody.SetSize(this->bodySize); - this->ctlBody.SetPosition(0.0f,this->headerSize.y); - //this->ctlBody.SetBackgroundColor(CUSTOM_BLUE_COLOR); - this->ctlRoot.Add(this->ctlBody); - //DBG("X=%d Y=%d",bodySize.x,bodySize.y); - - this->ctlFooter=Control::New(); - this->ctlFooter.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->ctlFooter.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->ctlFooter.SetSize(this->footerSize); - this->ctlFooter.SetPosition(0.0f,this->headerSize.y+this->bodySize.y); - this->ctlFooter.SetBackgroundColor(CUSTOM_BLUE_COLOR); - this->ctlRoot.Add(this->ctlFooter); - - this->ctlInfo=Control::New(); - this->ctlInfo.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->ctlInfo.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->ctlInfo.SetSize(this->bodySize+this->footerSize); - this->ctlInfo.SetPosition(0.0f,this->headerSize.y); - this->ctlInfo.SetBackgroundColor(Color::WHITE); - - this->tblVerdict=TableView::New(1,3); - this->tblVerdict.SetAnchorPoint(AnchorPoint::TOP_LEFT); - this->tblVerdict.SetParentOrigin(ParentOrigin::TOP_LEFT); - this->tblVerdict.SetSize(this->footerSize); - this->tblVerdict.SetPosition(0.0f, 0.0f); - this->ctlFooter.Add(this->tblVerdict); - - Vector2 size(this->footerSize.x/3,this->footerSize.y); - this->btnPassButton = this->CreateVerdictButton(this->tblVerdict, TableView::CellPosition(0, 0), AnchorPoint::TOP_LEFT, Vector2(0.0f, 0.0f), "Pass", this, &UiUtils::OnPassButtonClick, Vector4(0.55f, 0.8f, 0.9f, 1.0f), Vector4(0.8f, 0.9f, 0.9f, 1.0f),size); - this->btnFailButton = this->CreateVerdictButton(this->tblVerdict, TableView::CellPosition(0, 1), AnchorPoint::TOP_LEFT, Vector2(0.0f, 0.0f), "Fail", this, &UiUtils::OnFailButtonClick, Vector4(0.55f, 0.8f, 0.9f, 1.0f), Vector4(0.8f, 0.9f, 0.9f, 1.0f),size); - this->btnInfoButton = this->CreateVerdictButton(this->tblVerdict, TableView::CellPosition(0, 2), AnchorPoint::TOP_LEFT, Vector2(0.0f, 0.0f), "Info", this, &UiUtils::OnInfoButtonClick, Vector4(0.55f, 0.8f, 0.9f, 1.0f), Vector4(0.8f, 0.9f, 0.9f, 1.0f),size); - - Stage::GetCurrent().KeyEventSignal().Connect( this, &UiUtils::OnKeyEvent ); - DBG("UiUtils::Init.... End"); -} - -template -PushButton UiUtils::CreateVerdictButton(TableView parent, TableView::CellPosition cellPosition, - Vector3 anchorPoint, Vector2 position, std::string label, X* obj, - Ret (X::*onClickedCallback)(Arg0 arg0), - Vector4 selectedColor, Vector4 unselectedColor, Vector2 size) -{ - PushButton button = PushButton::New(); - button.SetAnchorPoint(anchorPoint); - button.SetPosition(position.x,position.y); - //button.SetSize(size); - button.SetProperty( Button::Property::LABEL, label ); - button.SetProperty(Button::Property::UNSELECTED_COLOR, selectedColor); - button.SetProperty(Button::Property::SELECTED_COLOR, unselectedColor); - parent.AddChild(button, cellPosition); - - button.ClickedSignal().Connect(obj, onClickedCallback); - return button; -} - -//template -PushButton UiUtils::CreateButton(Vector3 anchorPoint, Vector2 position, std::string label,/* X* obj, - Ret (X::*onClickedCallback)(Arg0 arg0), */Vector4 selectedColor, - Vector4 unselectedColor, Vector2 size) -{ - PushButton button = PushButton::New(); - button.SetAnchorPoint(anchorPoint); - //button.SetParentOrigin(parentOrigin); - button.SetPosition(position.x,position.y); - //button.SetSize(size); - button.SetProperty( Button::Property::LABEL, label ); - button.SetProperty(Button::Property::UNSELECTED_COLOR, selectedColor); - button.SetProperty(Button::Property::SELECTED_COLOR, unselectedColor); - - //button.ClickedSignal().Connect(obj, onClickedCallback); - return button; -} -TextLabel UiUtils::CreateTextLabel(Vector3 anchorPoint,Vector3 parentOrigin, Vector2 position, std::string txt, Vector2 size ) -{ - DBG("UiUtils::CreateTextLabel Begin"); - TextLabel label=TextLabel::New(" "+txt); - label.SetAnchorPoint(anchorPoint); - label.SetParentOrigin(parentOrigin); - label.SetPosition(position.x,position.y); - DBG("X=%f Y=%f Width=%f Height=%f",size.x,size.y,size.width,size.height); - label.SetSize(size); - label.SetProperty(TextLabel::Property::MULTI_LINE,true); - DBG("UiUtils::CreateTextLabel End"); - return label; -} -//template -Control UiUtils::CreateTextField(Vector3 anchorPoint, Vector3 parentOrigin, Vector2 position, - std::string txt, Vector2 size/*, X* obj, Ret (X::*onClickedCallback)(Arg0 arg0)*/ ) -{ - Control customTextField = Control::New(); - customTextField.SetAnchorPoint( anchorPoint ); - customTextField.SetParentOrigin(parentOrigin); - customTextField.SetSize( size); - customTextField.SetPosition( position.x,position.y ); - Image customTextFieldBgImage = ResourceImage::New( this->mImageDirectory+"customTextFieldBgImage.jpg" ); - customTextField.SetBackgroundImage(customTextFieldBgImage); - - TextField field=TextField::New(); - field.SetAnchorPoint(anchorPoint); - field.SetParentOrigin(parentOrigin); - //field.SetPosition(position.x,position.y); - field.SetSize(size); - field.SetProperty( TextField::Property::POINT_SIZE, 10.0f ); - field.SetProperty( TextField::Property::TEXT_COLOR, CUSTOM_BLUE_COLOR); - field.SetProperty( TextField::Property::VERTICAL_ALIGNMENT, "CENTER" ); - field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); - field.SetProperty( TextField::Property::PLACEHOLDER_TEXT,"Edit here"); - //field.SetBackgroundColor(Color::YELLOW); - customTextField.Add(field); - - PushButton btnCross = PushButton::New(); - btnCross.SetAnchorPoint( anchorPoint ); - btnCross.SetParentOrigin(parentOrigin); - btnCross.SetSize( size.width/10, size.height ); - btnCross.SetPosition( size.width - size.width/10, 0.0f ); - btnCross.SetUnselectedImage( this->mImageDirectory + "innerButtonUnselected.png" ); - btnCross.SetSelectedImage( this->mImageDirectory + "innerButtonSelected.png" ); - //btnCross.ClickedSignal().Connect( obj, onClickedCallback ); - customTextField.Add(btnCross); - - return customTextField; -} -//template -Control UiUtils::CreateTextEditor(Vector3 anchorPoint, Vector3 parentOrigin, Vector2 position, - std::string txt, Vector2 size/*, X* obj, Ret (X::*onClickedCallback)(Arg0 arg0)*/ ) -{ - Control customTextEditor = Control::New(); - customTextEditor.SetAnchorPoint( anchorPoint ); - customTextEditor.SetParentOrigin(parentOrigin); - customTextEditor.SetSize( size); - customTextEditor.SetPosition( position.x,position.y ); - - TextEditor editor=TextEditor::New(); - editor.SetAnchorPoint(anchorPoint); - editor.SetParentOrigin(parentOrigin); - //editor.SetPosition(position.x,position.y); - editor.SetSize(size); - editor.SetBackgroundColor(CUSTOM_BLUE_COLOR); - editor.SetProperty( TextEditor::Property::POINT_SIZE, 10); - editor.SetProperty( TextEditor::Property::TEXT_COLOR, Color::BLACK); - editor.SetProperty( TextEditor::Property::TEXT, "Text edit here"); - editor.SetProperty( TextEditor::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); - customTextEditor.Add(editor); - - PushButton btnCross = PushButton::New(); - btnCross.SetAnchorPoint( anchorPoint ); - btnCross.SetParentOrigin(parentOrigin); - btnCross.SetSize( bodySize.width*TEXTEDITOR_HEIGHT, bodySize.height*TEXTEDITOR_HEIGHT ); - btnCross.SetPosition( size.width - size.width/10, 0.0f ); - btnCross.SetUnselectedImage( this->mImageDirectory + "innerButtonSelected.png" ); - btnCross.SetSelectedImage( this->mImageDirectory + "innerButtonUnselected.png" ); - //btnCross.ClickedSignal().Connect( obj, onClickedCallback ); - customTextEditor.Add(btnCross); - - return customTextEditor; -} -void UiUtils::CreateLabelList(Property::Map keyMap, Property::Map sizeMap) -{ - DBG("UiUtils::CreateLabelList Begin"); - //Dali::Property::Map textlabelMap; - std::string key; - Property::Value value; - Property::Value size_value; - Vector2 size; - Vector2 position; - int count=keyMap.Count(); - float next=Stage::GetCurrent().GetSize().height*0.039; - TextLabel lbl; - for(int i=0;i(); - position=Vector2(0.0f, next); - lbl=this->CreateTextLabel(AnchorPoint::TOP_LEFT, ParentOrigin::TOP_LEFT,position,value.Get(),size); - lbl.SetProperty( TextLabel::Property::POINT_SIZE, 8); - lbl.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED); - lbl.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "TOP"); - lbl.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); - lbl.SetName(value.Get()); - //textlabelMap.Insert(key,lbl); - this->ctlBody.Add(lbl); - next=next+size.y; - } - DBG("UiUtils::CreateLabelList End"); - //return textlabelMap; -} - -void UiUtils::AddLabelToTable(TableView table,Property::Map keyMap, Property::Map sizeMap) -{ - DBG("UiUtils::AddLabelToTable Begin"); - //Dali::Property::Map textlabelMap; - std::string key; - Property::Value value; - Property::Value size_value; - Vector2 size; - Vector2 position; - int count=keyMap.Count(); - float next=Stage::GetCurrent().GetSize().height*0.039; - TextLabel lbl; - for(int i=0;i(); - position=Vector2(0.0f, next); - lbl=this->CreateTextLabel(AnchorPoint::TOP_LEFT, ParentOrigin::TOP_LEFT,position,value.Get(),size); - lbl.SetProperty( TextLabel::Property::POINT_SIZE, 8); - lbl.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED); - lbl.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "TOP"); - lbl.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN"); - lbl.SetName(value.Get()); - - table.AddChild(lbl,TableView::CellPosition(i,0)); - - next=next+size.y; - } - DBG("UiUtils::AddLabelToTable End"); - //return textlabelMap; -} - -bool UiUtils::OnPassButtonClick(Button button) -{ - DBG("UiUtils::OnPassButtonClick"); - app_control_h reply; - int nStatus = app_control_create(&reply); - - app_control_result_e res = APP_CONTROL_RESULT_SUCCEEDED; - nStatus = app_control_reply_to_launch_request(reply, _control, res); - DBG("app_control_reply_to_launch_request=%s", nStatus); - - this->mApplication.Quit(); - return true; -} -bool UiUtils::OnFailButtonClick(Button button) -{ - DBG("UiUtils::OnFailButtonClick"); - app_control_h reply; - int nStatus = app_control_create(&reply); - - app_control_result_e res = APP_CONTROL_RESULT_FAILED; - nStatus = app_control_reply_to_launch_request(reply, _control, res); - DBG("app_control_reply_to_launch_request=%s", nStatus); - this->mApplication.Quit(); - return true; -} -bool UiUtils::OnInfoButtonClick(Button button) -{ - DBG("UiUtils::OnInfoButtonClick"); - - DBG("ho ho i m in info page"); - this->bflag=true; - //Stage::GetCurrent().Remove(ctlRoot); - //ctlRoot.Add(ctlHeader); - ctlRoot.Remove(ctlBody); - ctlRoot.Add(ctlInfo); - - FillInfoPage(mInfoText); - return true; -} -void UiUtils::OnKeyEvent( const KeyEvent& event ) -{ - DBG("UiUtils::OnKeyEvent"); - - if( event.state == KeyEvent::Down ) - { - if( IsKey( event, DALI_KEY_ESCAPE ) || IsKey( event, DALI_KEY_BACK ) ) - { - //mApplication.Quit(); - if(this->bflag != true) - mApplication.Quit(); - DBG("ho ho i m in content page"); - ctlRoot.Remove(ctlInfo); - ctlRoot.Add(ctlBody); - this->bflag=false; - } - } -} -void UiUtils::FillInfoPage(std::string content) -{ - DBG("UiUtils::FillInfoPage"); - TextLabel lblText=TextLabel::New(); - lblText.SetProperty(TextLabel::Property::ENABLE_MARKUP, true); - lblText.SetProperty(TextLabel::Property::MULTI_LINE, true); - lblText.SetProperty( TextLabel::Property::TEXT, content); - lblText.SetAnchorPoint(AnchorPoint::TOP_LEFT); - lblText.SetParentOrigin(ParentOrigin::TOP_LEFT); - lblText.SetSize(bodySize); - lblText.SetProperty(TextLabel::Property::POINT_SIZE,7.0f); - lblText.SetProperty(TextLabel::Property::TEXT_COLOR,Color::BLACK); - lblText.SetPosition(0.0f, 0.0f); - - this->ctlInfo.Add(lblText); -} diff --git a/tbtcoreapp-widget-new-dali/src/utils/type-cast.cpp b/tbtcoreapp-widget-new-dali/src/utils/type-cast.cpp deleted file mode 100644 index 583a581..0000000 --- a/tbtcoreapp-widget-new-dali/src/utils/type-cast.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - *******************************************************************************/ -/** - * @file type-cast.cpp - * @brief Type casting - * - * @author Awadhesh Singh (awadhesh1.s@samsung.com) - * @date July, 2018 - * @credit - * - */ - -#include "utils/type-cast.h" - - -std::string IntToString ( int number ) -{ - std::ostringstream oss; - // Works just like cout - oss<< number; - // Return the underlying string - return oss.str(); -} -std::string FloatToString ( float number ) -{ - std::ostringstream oss; - // Works just like cout - oss<< number; - // Return the underlying string - return oss.str(); -} -std::string LongToString ( long number ) -{ - std::ostringstream oss; - // Works just like cout - oss<< number; - // Return the underlying string - return oss.str(); -} diff --git a/tbtcoreapp-widget-new-dali/src/view/tbt-dali-widget-custom-view.cpp b/tbtcoreapp-widget-new-dali/src/view/tbt-dali-widget-custom-view.cpp index 259b0c8..1e4af2d 100644 --- a/tbtcoreapp-widget-new-dali/src/view/tbt-dali-widget-custom-view.cpp +++ b/tbtcoreapp-widget-new-dali/src/view/tbt-dali-widget-custom-view.cpp @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -24,81 +24,73 @@ */ #include "view/tbt-dali-widget-custom-view.h" -WidgetApplicationController::WidgetApplicationController(WidgetApplication& application):mApplication(application) +WidgetViewApplicationController::WidgetViewApplicationController(Application& application):mApplication(application) { - DBG(">>>>>>WidgetApplicationController "); - mApplication.InitSignal().Connect(this,&WidgetApplicationController::Create); + DBG(">>>>>>WidgetViewApplicationController "); + mApplication.InitSignal().Connect(this,&WidgetViewApplicationController::Create); } -static Dali::Widget CreatingWidgetFunction(const std::string& widgetName) +void WidgetViewApplicationController::Create(Application& application) { - DBG(">>>>>>CreateWidgetFunction "); - Dali::Widget widget = Dali::Widget::New(); - return widget; -} -void WidgetApplicationController::Create(Application& application) -{ - DBG(">>>>Create called "); - - Stage stage = Stage::GetCurrent(); - stage.SetBackgroundColor( Color::BLACK ); - stage.KeyEventSignal().Connect( this, &WidgetApplicationController::OnKeyEvent ); + DBG(">>>>Create called "); - mWidgetViewManager = WidgetView::WidgetViewManager::New( mApplication, "org.tizen.tbtcoreapp-widget-new-dali" ); + Stage stage = Stage::GetCurrent(); + stage.SetBackgroundColor( Color::BLACK ); + stage.KeyEventSignal().Connect( this, &WidgetViewApplicationController::OnKeyEvent ); - PushButton button = PushButton::New(); - button.ClickedSignal().Connect( this, &WidgetApplicationController::OnWidgetDeleted ); - button.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); - button.SetAnchorPoint( ParentOrigin::BOTTOM_LEFT ); - button.SetProperty(Button::Property::LABEL, "Delete Widget"); - button.SetPosition( 0, 0 ); - button.SetSize(300,100); - stage.Add( button ); + mWidgetViewManager = WidgetView::WidgetViewManager::New( mApplication, "org.tizen.tbtcoreapp-widget-new-dali" ); - PushButton button2 = PushButton::New(); - button2.ClickedSignal().Connect( this, &WidgetApplicationController::OnWidgetAdded ); - button2.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); - button2.SetAnchorPoint( ParentOrigin::BOTTOM_RIGHT ); - button2.SetProperty(Button::Property::LABEL, "Add Widget"); - button2.SetPosition( 0, 0 ); - button2.SetSize(300,100); - stage.Add( button2 ); - mApplication.RegisterWidgetCreatingFunction("org.tizen.coretbtwidgetapp-dali",CreatingWidgetFunction); + PushButton button = PushButton::New(); + button.ClickedSignal().Connect( this, &WidgetViewApplicationController::OnWidgetDeleted ); + button.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + button.SetAnchorPoint( ParentOrigin::BOTTOM_LEFT ); + button.SetProperty(Button::Property::LABEL, "Delete Widget"); + button.SetPosition( 0, 0 ); + button.SetSize(300,100); + stage.Add( button ); + PushButton button2 = PushButton::New(); + button2.ClickedSignal().Connect( this, &WidgetViewApplicationController::OnWidgetAdded ); + button2.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); + button2.SetAnchorPoint( ParentOrigin::BOTTOM_RIGHT ); + button2.SetProperty(Button::Property::LABEL, "Add Widget"); + button2.SetPosition( 0, 0 ); + button2.SetSize(300,100); + stage.Add( button2 ); } -bool WidgetApplicationController::OnWidgetAdded(Toolkit::Button button ) -{ - DBG("WidgetApplicationController::OnWidgetAdded"); - if(!mWidgetView) - { - mWidgetView = mWidgetViewManager.AddWidget("org.tizen.coretbtwidgetapp-dali","",480,680,-1); - mWidgetView.SetParentOrigin( ParentOrigin::CENTER ); - mWidgetView.SetAnchorPoint( AnchorPoint::CENTER ); - mWidgetView.SetBackgroundColor( Vector4(0.0f, 0.0f, 0.0f, 0.0f) ); - Stage::GetCurrent().Add( mWidgetView ); - } +bool WidgetViewApplicationController::OnWidgetAdded(Toolkit::Button button ) +{ + DBG("WidgetViewApplicationController::OnWidgetAdded"); + if(!mWidgetView) + { + mWidgetView = mWidgetViewManager.AddWidget("org.tizen.coretbtwidgetapp-dali","",480,680,-1); + mWidgetView.SetParentOrigin( ParentOrigin::CENTER ); + mWidgetView.SetAnchorPoint( AnchorPoint::CENTER ); + mWidgetView.SetBackgroundColor( Vector4(0.0f, 0.0f, 0.0f, 0.0f) ); + Stage::GetCurrent().Add( mWidgetView ); + } + return true; } -bool WidgetApplicationController::OnWidgetDeleted(Toolkit::Button button ) +bool WidgetViewApplicationController::OnWidgetDeleted(Toolkit::Button button ) { - DBG("WidgetApplicationController::OnWidgetDeleted"); - if(mWidgetView) - { - mWidgetView.TerminateWidget(); - Stage::GetCurrent().Remove( mWidgetView ); - mWidgetView.Reset(); - } + if(mWidgetView) + { + mWidgetView.TerminateWidget(); + Stage::GetCurrent().Remove( mWidgetView ); + mWidgetView.Reset(); + } + return true; } -void WidgetApplicationController::OnKeyEvent(const KeyEvent& event) +void WidgetViewApplicationController::OnKeyEvent(const KeyEvent& event) { - if(event.state == KeyEvent::Down) - { - if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) - { - mApplication.Quit(); - } - } + if(event.state == KeyEvent::Down) + { + if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) + { + mApplication.Quit(); + } + } } -