Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/flutter_inappwebview/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.3.0

- Use wrapper APIs for the EWK and WV backends.
- Move the native web engine code behind a `WebViewBackend` interface.
- Add an experimental WV API backend with EWK-wrapper and standalone modes.
- Select EWK through Tizen 10.0, WV EWK-wrapper mode on Tizen 10.1, and WV standalone mode from Tizen 11.0.
Expand Down
300 changes: 300 additions & 0 deletions packages/flutter_inappwebview/tizen/inc/ftpw_flutter_inappwebview.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_TIZEN_PLUGINS_WRAPPER_FLUTTER_INAPPWEBVIEW_H_
#define FLUTTER_TIZEN_PLUGINS_WRAPPER_FLUTTER_INAPPWEBVIEW_H_

#include <stdbool.h>

typedef enum {
EWK_TOUCH_START,
EWK_TOUCH_MOVE,
EWK_TOUCH_END
} Ewk_Touch_Event_Type;

typedef struct _Ewk_Touch_Point Ewk_Touch_Point;

typedef enum {
EWK_MOUSE_BUTTON_LEFT = 1,
EWK_MOUSE_BUTTON_MIDDLE = 2,
EWK_MOUSE_BUTTON_RIGHT = 3
} Ewk_Mouse_Button_Type;

struct _Ewk_Touch_Point {
int id;
int x;
int y;
int state;
};

typedef unsigned char (*Ewk_View_JavaScript_Alert_Callback)(
void* o, const char* alert_text, void* user_data);
typedef unsigned char (*Ewk_View_JavaScript_Confirm_Callback)(
void* o, const char* message, void* user_data);
typedef unsigned char (*Ewk_View_JavaScript_Prompt_Callback)(
void* o, const char* message, const char* default_value, void* user_data);

typedef enum {
EWK_CONSOLE_MESSAGE_LEVEL_NULL,
EWK_CONSOLE_MESSAGE_LEVEL_LOG,
EWK_CONSOLE_MESSAGE_LEVEL_WARNING,
EWK_CONSOLE_MESSAGE_LEVEL_ERROR,
EWK_CONSOLE_MESSAGE_LEVEL_DEBUG,
EWK_CONSOLE_MESSAGE_LEVEL_INFO,
} Ewk_Console_Message_Level;

typedef enum {
WV_HTTP_METHOD_GET,
WV_HTTP_METHOD_HEAD,
WV_HTTP_METHOD_POST,
WV_HTTP_METHOD_PUT,
WV_HTTP_METHOD_DELETE,
} wv_http_method_e;

typedef enum {
WV_CACHE_MODEL_DOCUMENT_VIEWER,
WV_CACHE_MODEL_DOCUMENT_BROWSER,
WV_CACHE_MODEL_PRIMARY_WEBBROWSER
} wv_cache_model_e;

typedef enum {
WV_TOUCH_EVENT_START,
WV_TOUCH_EVENT_MOVE,
WV_TOUCH_EVENT_END,
WV_TOUCH_EVENT_CANCEL
} wv_touch_event_type_e;

typedef enum {
WV_TOUCH_POINT_STATE_DOWN,
WV_TOUCH_POINT_STATE_UP,
WV_TOUCH_POINT_STATE_MOVE,
WV_TOUCH_POINT_STATE_STILL,
WV_TOUCH_POINT_STATE_CANCEL
} wv_touch_point_state_e;

typedef enum {
WV_MODIFIER_NONE = 0,
WV_MODIFIER_SHIFT = 1 << 0,
WV_MODIFIER_CONTROL = 1 << 1,
WV_MODIFIER_ALT = 1 << 2,
WV_MODIFIER_SUPER = 1 << 3,
WV_MODIFIER_HYPER = 1 << 4,
WV_MODIFIER_CAPS_LOCK = 1 << 5,
WV_MODIFIER_NUM_LOCK = 1 << 6
} wv_modifier_e;

typedef enum {
WV_MOUSE_BUTTON_LEFT = 1,
WV_MOUSE_BUTTON_MIDDLE = 2,
WV_MOUSE_BUTTON_RIGHT = 3
} wv_mouse_button_type_e;

typedef enum {
WV_COOKIE_ACCEPT_POLICY_ALWAYS,
WV_COOKIE_ACCEPT_POLICY_NEVER,
WV_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY
} wv_cookie_accept_policy_e;

typedef enum {
WV_CONSOLE_MESSAGE_LEVEL_NULL,
WV_CONSOLE_MESSAGE_LEVEL_LOG,
WV_CONSOLE_MESSAGE_LEVEL_WARNING,
WV_CONSOLE_MESSAGE_LEVEL_ERROR,
WV_CONSOLE_MESSAGE_LEVEL_DEBUG,
WV_CONSOLE_MESSAGE_LEVEL_INFO
} wv_console_message_level_e;

typedef struct {
int id;
int x;
int y;
wv_touch_point_state_e state;
} wv_touch_point_s;

typedef struct {
const char* key_name;
const char* key;
const char* string;
const char* compose;
unsigned int timestamp;
wv_modifier_e modifiers;
int event_flags;
unsigned int key_code;
const char* device_name;
} wv_key_event_s;

typedef void (*wv_view_cb)(void* obj, void* event_info, void* user_data);
typedef void (*wv_view_script_execute_cb)(void* view, const char* result_value,
void* user_data);
typedef bool (*wv_view_javascript_alert_cb)(void* view, const char* alert_text,
void* user_data);
typedef bool (*wv_view_javascript_confirm_cb)(void* view, const char* message,
void* user_data);
typedef bool (*wv_view_javascript_prompt_cb)(void* view, const char* message,
const char* default_value,
void* user_data);

#ifdef __cplusplus
extern "C" {
#endif

unsigned char ftpw_flutter_inappwebview_ewk_view_bg_color_set(void* obj, int r,
int g, int b,
int a);
unsigned char ftpw_flutter_inappwebview_ewk_view_touch_events_enabled_set(
void* view, unsigned char enabled);
unsigned char ftpw_flutter_inappwebview_ewk_view_feed_touch_event(
void* obj, Ewk_Touch_Event_Type type, const void* points,
const void* modifiers);
unsigned char ftpw_flutter_inappwebview_ewk_view_mouse_events_enabled_set(
void* view, unsigned char enabled);
unsigned char ftpw_flutter_inappwebview_ewk_view_feed_mouse_down(
void* obj, Ewk_Mouse_Button_Type button, int x, int y);
unsigned char ftpw_flutter_inappwebview_ewk_view_feed_mouse_up(
void* obj, Ewk_Mouse_Button_Type button, int x, int y);
unsigned char ftpw_flutter_inappwebview_ewk_view_feed_mouse_wheel(
void* obj, unsigned char y_direction, int step, int x, int y);
unsigned char ftpw_flutter_inappwebview_ewk_view_send_key_event(
void* obj, void* key_event, unsigned char is_press);
void ftpw_flutter_inappwebview_ewk_view_offscreen_rendering_enabled_set(
void* obj, unsigned char enabled);
void ftpw_flutter_inappwebview_ewk_view_ime_window_set(void* obj, void* window);
unsigned char ftpw_flutter_inappwebview_ewk_view_key_events_enabled_set(
void* obj, unsigned char enabled);
unsigned char ftpw_flutter_inappwebview_ewk_view_set_support_video_hole(
void* obj, void* window, unsigned char enabled, unsigned char is_supported);
void ftpw_flutter_inappwebview_ewk_view_javascript_alert_callback_set(
void* o, Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
void ftpw_flutter_inappwebview_ewk_view_javascript_confirm_callback_set(
void* o, Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
void ftpw_flutter_inappwebview_ewk_view_javascript_prompt_callback_set(
void* o, Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
void ftpw_flutter_inappwebview_ewk_view_javascript_alert_reply(void* o);
void ftpw_flutter_inappwebview_ewk_view_javascript_confirm_reply(
void* o, unsigned char result);
void ftpw_flutter_inappwebview_ewk_view_javascript_prompt_reply(
void* o, const char* result);
void ftpw_flutter_inappwebview_ewk_set_arguments(int argc, char** argv);
void ftpw_flutter_inappwebview_ewk_settings_ime_panel_enabled_set(
void* settings, unsigned char enabled);
void ftpw_flutter_inappwebview_ewk_settings_force_zoom_set(
void* settings, unsigned char enable);
Ewk_Console_Message_Level
ftpw_flutter_inappwebview_ewk_console_message_level_get(const void* message);
const char* ftpw_flutter_inappwebview_ewk_console_message_text_get(
const void* message);

int ftpw_flutter_inappwebview_wv_init(void);
int ftpw_flutter_inappwebview_wv_shutdown(void);
int ftpw_flutter_inappwebview_wv_set_arguments(int argc, const char** argv);
void* ftpw_flutter_inappwebview_wv_view_create(void);
void ftpw_flutter_inappwebview_wv_view_destroy(void* view);
void ftpw_flutter_inappwebview_wv_view_resize(void* view, int w, int h);
bool ftpw_flutter_inappwebview_wv_view_focus_set(void* view, int focused);
bool ftpw_flutter_inappwebview_wv_view_url_set(void* view, const char* url);
const char* ftpw_flutter_inappwebview_wv_view_url_get(void* view);
bool ftpw_flutter_inappwebview_wv_view_url_request_set(void* view,
const char* url,
wv_http_method_e method,
void* headers,
const char* body);
bool ftpw_flutter_inappwebview_wv_view_html_string_load(
void* view, const char* html, const char* base_url,
const char* unreachable_url);
bool ftpw_flutter_inappwebview_wv_view_back_possible(void* view);
bool ftpw_flutter_inappwebview_wv_view_forward_possible(void* view);
bool ftpw_flutter_inappwebview_wv_view_back(void* view);
bool ftpw_flutter_inappwebview_wv_view_forward(void* view);
bool ftpw_flutter_inappwebview_wv_view_reload(void* view);
bool ftpw_flutter_inappwebview_wv_view_stop(void* view);
void ftpw_flutter_inappwebview_wv_view_suspend(void* view);
void ftpw_flutter_inappwebview_wv_view_resume(void* view);
const char* ftpw_flutter_inappwebview_wv_view_title_get(void* view);
double ftpw_flutter_inappwebview_wv_view_load_progress_get(void* view);
bool ftpw_flutter_inappwebview_wv_view_scale_set(void* view,
double scale_factor, int cx,
int cy);
double ftpw_flutter_inappwebview_wv_view_scale_get(void* view);
bool ftpw_flutter_inappwebview_wv_view_user_agent_set(void* view,
const char* user_agent);
const char* ftpw_flutter_inappwebview_wv_view_user_agent_get(void* view);
bool ftpw_flutter_inappwebview_wv_view_scroll_set(void* view, int x, int y);
bool ftpw_flutter_inappwebview_wv_view_scroll_pos_get(void* view, int* x,
int* y);
bool ftpw_flutter_inappwebview_wv_view_script_execute(
void* view, const char* script, wv_view_script_execute_cb callback,
void* user_data);
bool ftpw_flutter_inappwebview_wv_view_bg_color_set(void* view, int r, int g,
int b, int a);
void* ftpw_flutter_inappwebview_wv_view_context_get(void* view);
void* ftpw_flutter_inappwebview_wv_view_settings_get(void* view);
bool ftpw_flutter_inappwebview_wv_view_feed_touch_event(
void* view, wv_touch_event_type_e event_type, void* points,
wv_modifier_e modifiers);
int ftpw_flutter_inappwebview_wv_view_feed_mouse_down(
void* view, wv_mouse_button_type_e button, int x, int y);
int ftpw_flutter_inappwebview_wv_view_feed_mouse_up(
void* view, wv_mouse_button_type_e button, int x, int y);
int ftpw_flutter_inappwebview_wv_view_feed_mouse_wheel(void* view,
bool y_direction,
int step, int x, int y);
bool ftpw_flutter_inappwebview_wv_view_send_key_event(
void* view, const wv_key_event_s* key_event, int is_press);
bool ftpw_flutter_inappwebview_wv_view_touch_events_enabled_set(void* view,
int enabled);
bool ftpw_flutter_inappwebview_wv_view_mouse_events_enabled_set(void* view,
bool enabled);
bool ftpw_flutter_inappwebview_wv_view_key_events_enabled_set(void* view,
bool enabled);
void ftpw_flutter_inappwebview_wv_view_ime_window_set(void* view, void* window);
int ftpw_flutter_inappwebview_wv_view_add_cb(void* view, const char* event,
wv_view_cb func,
const void* user_data);
int ftpw_flutter_inappwebview_wv_view_remove_full_cb(void* view,
const char* event,
wv_view_cb func,
const void* user_data);
int ftpw_flutter_inappwebview_wv_view_javascript_alert_callback_set(
void* view, wv_view_javascript_alert_cb callback, void* user_data);
int ftpw_flutter_inappwebview_wv_view_javascript_confirm_callback_set(
void* view, wv_view_javascript_confirm_cb callback, void* user_data);
int ftpw_flutter_inappwebview_wv_view_javascript_prompt_callback_set(
void* view, wv_view_javascript_prompt_cb callback, void* user_data);
void ftpw_flutter_inappwebview_wv_view_javascript_alert_reply(void* view);
void ftpw_flutter_inappwebview_wv_view_javascript_confirm_reply(void* view,
bool result);
void ftpw_flutter_inappwebview_wv_view_javascript_prompt_reply(
void* view, const char* result);
bool ftpw_flutter_inappwebview_wv_view_set_support_video_hole(
void* view, void* window, bool enable, bool is_video_window);
bool ftpw_flutter_inappwebview_wv_view_main_frame_scrollbar_visible_set(
void* view, bool visible);
void* ftpw_flutter_inappwebview_wv_context_cookie_manager_get(void* context);
bool ftpw_flutter_inappwebview_wv_context_cache_model_set(
void* context, wv_cache_model_e model);
bool ftpw_flutter_inappwebview_wv_context_cache_clear(void* context);
void ftpw_flutter_inappwebview_wv_cookie_manager_accept_policy_set(
void* manager, wv_cookie_accept_policy_e policy);
void ftpw_flutter_inappwebview_wv_cookie_manager_cookies_clear(void* manager);
bool ftpw_flutter_inappwebview_wv_settings_javascript_enabled_set(
void* settings, bool enable);
void ftpw_flutter_inappwebview_wv_settings_ime_panel_enabled_set(void* settings,
bool enable);
bool ftpw_flutter_inappwebview_wv_settings_force_zoom_set(void* settings,
bool enable);
int ftpw_flutter_inappwebview_wv_error_code_get(void* error);
const char* ftpw_flutter_inappwebview_wv_error_description_get(void* error);
const char* ftpw_flutter_inappwebview_wv_error_url_get(void* error);
bool ftpw_flutter_inappwebview_wv_policy_decision_use(void* policy_decision);
const char* ftpw_flutter_inappwebview_wv_policy_decision_url_get(
void* policy_decision);
wv_console_message_level_e
ftpw_flutter_inappwebview_wv_console_message_level_get(void* message);
const char* ftpw_flutter_inappwebview_wv_console_message_text_get(
void* message);

#ifdef __cplusplus
}
#endif

#endif // FLUTTER_TIZEN_PLUGINS_WRAPPER_FLUTTER_INAPPWEBVIEW_H_
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions packages/flutter_inappwebview/tizen/project_def.prop
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ USER_CPP_UNDEFS =
USER_INC_DIRS = inc src
USER_INC_FILES =
USER_CPP_INC_FILES =

# User libraries
USER_LIB_DIRS += lib/${BUILD_ARCH}
USER_LIBS += ftpw_flutter_inappwebview
Loading
Loading