From f25d62a4e617035cc2632c3eed68ffd9ec310f68 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Mon, 11 May 2015 16:31:31 +0900 Subject: [PATCH] Fix build error and reduce the RPMLint warnings Need to implements some porting layers. Regarding accessibility & Key event handling codes. Wayland buffer management related parts should be ported. Change-Id: I6f7d309dfb038f32323f66c0eeee8b4a3cd6fcad --- packaging/libwidget.spec | 7 ++- src/binder.c | 4 +- src/snapshot_window.c | 4 +- src/virtual_window_wayland.c | 117 ++++++++++++++++++++++++++++++------------- 4 files changed, 88 insertions(+), 44 deletions(-) diff --git a/packaging/libwidget.spec b/packaging/libwidget.spec index 58be75e..c0ef27c 100644 --- a/packaging/libwidget.spec +++ b/packaging/libwidget.spec @@ -1,10 +1,10 @@ %bcond_with wayland Name: libwidget -Summary: widget development library +Summary: Widget development library Version: 1.1.3 Release: 1 -Group: HomeTF/widget +Group: Applications/Core Applications License: Flora License, Version 1.1 Source0: %{name}-%{version}.tar.gz Source1001: %{name}.manifest @@ -15,7 +15,6 @@ BuildRequires: pkgconfig(widget_provider) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(evas) BuildRequires: pkgconfig(elementary) -BuildRequires: model-build-features %if %{with wayland} %else @@ -30,7 +29,7 @@ ExclusiveArch: Library for the development of a widget %package devel -Summary: widget development library (dev) +Summary: Widget development library (dev) Group: Development/Libraries Requires: %{name} = %{version}-%{release} diff --git a/src/binder.c b/src/binder.c index d586f9f..735a493 100644 --- a/src/binder.c +++ b/src/binder.c @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include #include #include #include @@ -505,7 +505,7 @@ Ecore_Evas *binder_ecore_evas_new(vwin_info_t info) load_ecore_evas_function(); - engine = elm_config_preferred_engine_get(); + engine = elm_config_accel_preference_get(); DbgPrint("Preferred engine: %s (%s)\n", engine, GL_ENGINE); if (engine && !strcmp(engine, GL_ENGINE)) { diff --git a/src/snapshot_window.c b/src/snapshot_window.c index fd96018..aa06842 100644 --- a/src/snapshot_window.c +++ b/src/snapshot_window.c @@ -21,8 +21,8 @@ #include #include -#include #include +#include #include "widget.h" #include "widget_internal.h" @@ -432,7 +432,7 @@ PUBLIC void *widget_snapshot_window_add(const char *id, int size_type) return NULL; } - snapshot_win = elm_win_add(parent, "widget,Snapshot", ELM_WIN_TIZEN_WIDGET); + snapshot_win = elm_win_add(parent, "widget,Snapshot", ELM_WIN_FAKE); /* ELM_WIN_TIZEN_WIDGET */ evas_object_del(parent); if (!snapshot_win) { destroy_virtual_canvas(e); diff --git a/src/virtual_window_wayland.c b/src/virtual_window_wayland.c index 5bd2c80..424d8cd 100644 --- a/src/virtual_window_wayland.c +++ b/src/virtual_window_wayland.c @@ -14,28 +14,38 @@ * limitations under the License. */ +#define _GNU_SOURCE + #include #include #include -#include #include +#include +#include +#include #include #include #include +#include +#include +#include +#include +#include -#include "binder.h" #include "widget.h" +#include "widget_internal.h" #include "debug.h" +#include "binder.h" #define IS_GBAR 1 #define PUBLIC __attribute__((visibility("default"))) #define WIDGET_WIN_TAG "dynamic,box,win" +#define WIN_INFO_TAG "dynamic,box,info" #define WIDGET_DEFAULT_WIDTH 1 #define WIDGET_DEFAULT_HEIGHT 1 -#define GL_ENGINE "opengl_x11" static inline Evas_Object *get_highlighted_object(Evas_Object *obj) { @@ -92,11 +102,11 @@ static inline void apply_orientation(int degree, int *x, int *y, int width, int } } -/*! - * \note +/** + * @note * Every user event (mouse) on the buffer will be passed via this event callback */ -static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_event_data *event_info, void *data) +static int event_handler_cb(widget_buffer_h handler, struct widget_buffer_event_data *event_info, void *data) { vwin_info_t info = data; Elm_Access_Action_Info action_info; @@ -106,8 +116,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ unsigned int flags = 0; double timestamp; - - if (!info->handle) { + if (!info || info->state != VWIN_INFO_CREATED || !info->handle) { /* Just ignore this event */ return 0; } @@ -117,7 +126,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ struct timeval tv; if (gettimeofday(&tv, NULL) < 0) { - ErrPrint("gettimeofday: %s\n", strerror(errno)); + ErrPrint("gettimeofday: %d\n", errno); } else { timestamp = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f; timestamp -= event_info->timestamp; @@ -148,8 +157,8 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ timestamp = event_info->timestamp * 1000.0f; } - /*! - * \note + /** + * @note * Feed up events */ switch (event_info->type) { @@ -182,6 +191,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; case WIDGET_BUFFER_EVENT_DOWN: apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, info->w, info->h, event_info->info.pointer.source); + if (info->pressed) { ErrPrint("MOUSE UP is not called\n"); ErrPrint("UP[%s] %dx%d - %lf\n", info->id, event_info->info.pointer.x, event_info->info.pointer.y, timestamp); @@ -236,7 +246,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_HIGHLIGHT; + action_type = 0; //ELM_ACCESS_ACTION_HIGHLIGHT; /** * @note * Calculate the event occurred X & Y on the buffer @@ -264,7 +274,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_HIGHLIGHT_NEXT; + action_type = 0; //ELM_ACCESS_ACTION_HIGHLIGHT_NEXT; action_info.highlight_cycle = EINA_FALSE; ret = elm_access_action(parent_elm, action_type, &action_info); ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_LAST : WIDGET_ACCESS_STATUS_DONE; @@ -276,7 +286,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_HIGHLIGHT_PREV; + action_type = 0; //ELM_ACCESS_ACTION_HIGHLIGHT_PREV; action_info.highlight_cycle = EINA_FALSE; ret = elm_access_action(parent_elm, action_type, &action_info); ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_FIRST : WIDGET_ACCESS_STATUS_DONE; @@ -288,7 +298,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_ACTIVATE; + action_type = 0; //ELM_ACCESS_ACTION_ACTIVATE; ret = elm_access_action(parent_elm, action_type, &action_info); ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE; break; @@ -299,7 +309,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_UP; + action_type = 0; //ELM_ACCESS_ACTION_UP; ret = elm_access_action(parent_elm, action_type, &action_info); ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE; break; @@ -310,7 +320,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_DOWN; + action_type = 0; //ELM_ACCESS_ACTION_DOWN; ret = elm_access_action(parent_elm, action_type, &action_info); ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE; break; @@ -321,7 +331,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_SCROLL; + action_type = 0; //ELM_ACCESS_ACTION_SCROLL; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -335,7 +345,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_SCROLL; + action_type = 0; //ELM_ACCESS_ACTION_SCROLL; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -349,7 +359,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_SCROLL; + action_type = 0; //ELM_ACCESS_ACTION_SCROLL; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -363,7 +373,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_UNHIGHLIGHT; + action_type = 0; //ELM_ACCESS_ACTION_UNHIGHLIGHT; ret = elm_access_action(parent_elm, action_type, &action_info); ret = (ret == EINA_FALSE) ? WIDGET_ACCESS_STATUS_ERROR : WIDGET_ACCESS_STATUS_DONE; break; @@ -374,7 +384,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_VALUE_CHANGE; + action_type = 0; //ELM_ACCESS_ACTION_VALUE_CHANGE; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -388,7 +398,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_MOUSE; + action_type = 0; //ELM_ACCESS_ACTION_MOUSE; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -402,7 +412,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_BACK; + action_type = 0; //ELM_ACCESS_ACTION_BACK; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -416,7 +426,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_OVER; + action_type = 0; //ELM_ACCESS_ACTION_OVER; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -430,7 +440,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_READ; + action_type = 0; //ELM_ACCESS_ACTION_READ; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -444,7 +454,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_ENABLE; + action_type = 0; //ELM_ACCESS_ACTION_ENABLE; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -458,7 +468,7 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } memset(&action_info, 0, sizeof(action_info)); - action_type = ELM_ACCESS_ACTION_DISABLE; + action_type = 0; //ELM_ACCESS_ACTION_DISABLE; action_info.x = event_info->info.access.x; action_info.y = event_info->info.access.y; action_info.mouse_type = event_info->info.access.mouse_type; @@ -472,6 +482,11 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } + /** + * @TODO + * Fills me + */ + ret = WIDGET_KEY_STATUS_ERROR; break; case WIDGET_BUFFER_EVENT_KEY_UP: @@ -481,6 +496,10 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } + /** + * @TODO + * Fills me + */ ret = WIDGET_KEY_STATUS_ERROR; break; case WIDGET_BUFFER_EVENT_KEY_FOCUS_IN: @@ -490,6 +509,10 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } + /** + * @TODO + * Fills me + */ ret = WIDGET_KEY_STATUS_ERROR; break; case WIDGET_BUFFER_EVENT_KEY_FOCUS_OUT: @@ -499,6 +522,10 @@ static int event_handler_cb(struct widget_buffer *handler, struct widget_buffer_ break; } + /** + * @TODO + * Fills me + */ ret = WIDGET_KEY_STATUS_ERROR; break; default: @@ -562,10 +589,28 @@ static void post_render_cb(void *data, Evas *e, void *event_info) if (info->type == VWIN_GEM) { widget_buffer_post_render(info->handle); } else if (info->type == VWIN_PIXMAP) { - /** - * TODO - */ - ErrPrint("NOT SUPPORTED\n"); + int idx; + unsigned int front_resource_id; + + front_resource_id = ecore_evas_gl_x11_pixmap_get(info->ee); + + for (idx = 0; idx < WIDGET_CONF_EXTRA_BUFFER_COUNT; idx++) { + if (front_resource_id == info->resource_array[idx]) { + /** + */ + widget_send_updated_by_idx(info->handle, idx); + break; + } + } + + if (idx == WIDGET_CONF_EXTRA_BUFFER_COUNT) { + /* Send updated event for PRIMARY BUFFER */ + if (front_resource_id == widget_viewer_get_resource_id(info->handle, WIDGET_PRIMARY_BUFFER)) { + widget_send_updated_by_idx(info->handle, WIDGET_PRIMARY_BUFFER); + } else { + DbgPrint("Unable to send updated: %u (%u)\n", front_resource_id, widget_viewer_get_resource_id(info->handle, WIDGET_PRIMARY_BUFFER)); + } + } } else if (info->type == VWIN_SW_BUF) { widget_viewer_sync_buffer(info->handle); } @@ -600,7 +645,7 @@ static int pre_orientation_cb(const char *id, void *data) return WIDGET_ERROR_NONE; } -static void pre_destroy_cb(const char *id, void *data) +static int pre_destroy_cb(const char *id, void *data) { vwin_info_t info = data; const char *path = NULL; @@ -633,7 +678,7 @@ static void ecore_evas_free_cb(Ecore_Evas *ee) { vwin_info_t info; - info = ecore_evas_data_get(ee, "dynamic,box,info"); + info = ecore_evas_data_get(ee, WIN_INFO_TAG); if (!info) { DbgPrint("Info is not valid\n"); return; @@ -696,7 +741,7 @@ PUBLIC Evas *widget_get_evas(const char *id) * Acquire a buffer for canvas. */ info->handle = widget_create_buffer(info->id, info->is_gbar, - widget_conf_auto_align(), + binder_widget_auto_align(), event_handler_cb, info); if (!info->handle) { @@ -723,7 +768,7 @@ PUBLIC Evas *widget_get_evas(const char *id) return NULL; } - ecore_evas_data_set(info->ee, "dynamic,box,info", info); + ecore_evas_data_set(info->ee, WIN_INFO_TAG, info); /** * @note -- 2.7.4