Webview : initial version
authorJin Yoon <jinny.yoon@samsung.com>
Sun, 14 Jun 2015 13:32:40 +0000 (22:32 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Sun, 14 Jun 2015 13:32:40 +0000 (22:32 +0900)
Change-Id: Ifac4a55a211dcff73c523ee4d9f63f3525ed9c91

src/adventure.c
tizen-manifest.xml

index e3df469..b3a1753 100644 (file)
@@ -18,6 +18,7 @@
 #include <tizen.h>
 #include "adventure.h"
 #include "log.h"
+#include "webview.h"
 
 typedef struct appdata{
        Evas_Object* win;
@@ -32,28 +33,8 @@ win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
 }
 
 static void
-layout_back_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       appdata_s *ad = data;
-       /* Let window go to hide state. */
-       elm_win_lower(ad->win);
-}
-
-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);
-               free(res_path);
-       }
-}
-
-static void
 create_base_gui(appdata_s *ad)
 {
-       char edj_path[PATH_MAX] = {0, };
-
        /* Window */
        ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
        elm_win_conformant_set(ad->win, EINA_TRUE);
@@ -74,15 +55,6 @@ create_base_gui(appdata_s *ad)
        elm_win_resize_object_add(ad->win, ad->conform);
        evas_object_show(ad->conform);
 
-       /* Base Layout */
-       app_get_resource(EDJ_FILE, edj_path, (int)PATH_MAX);
-       ad->layout = elm_layout_add(ad->win);
-       elm_layout_file_set(ad->layout, edj_path, GRP_MAIN);
-       elm_object_part_text_set(ad->layout, "txt_title", "Hello EFL");
-       evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       eext_object_event_callback_add(ad->layout, EEXT_CALLBACK_BACK, layout_back_cb, ad);
-       elm_object_content_set(ad->conform, ad->layout);
-
        /* Show window after base gui is set up */
        evas_object_show(ad->win);
 
@@ -91,10 +63,6 @@ create_base_gui(appdata_s *ad)
 static bool
 app_create(void *data)
 {
-       /* Hook to take necessary actions before main event loop starts
-          Initialize UI resources and application's data
-          If this function returns true, the main loop of application starts
-          If this function returns false, the application is terminated */
        appdata_s *ad = data;
 
        create_base_gui(ad);
@@ -105,7 +73,14 @@ app_create(void *data)
 static void
 app_control(app_control_h app_control, void *data)
 {
-       /* Handle the launch request. */
+       appdata_s *ad = data;
+       Evas_Object *webview = NULL;
+
+       webview = webview_create(ad->conform);
+       ret_if(!webview);
+       elm_object_content_set(ad->conform, webview);
+
+       webview_set_url(webview, "http://www.naver.com");
 }
 
 static void
index a7d821e..0adbc05 100644 (file)
@@ -1,11 +1,12 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="2.3" package="org.tizen.adventure" version="1.0.0">
-       <profile name="mobile" />
-       <ui-application appid="org.tizen.adventure" exec="adventure" type="capp" multiple="false" taskmanage="true" nodisplay="false">
-               <icon>adventure.png</icon>
-               <label>adventure</label>
-       </ui-application>
-       <privileges>
-               <privilege>http://tizen.org/privilege/systemsettings</privilege>
-       </privileges>
+    <profile name="mobile"/>
+    <ui-application appid="org.tizen.adventure" exec="adventure" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+        <label>adventure</label>
+        <icon>adventure.png</icon>
+    </ui-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/internet</privilege>
+    </privileges>
+    <feature name="http://tizen.org/feature/screen.size.all">true</feature>
 </manifest>