* limitations under the License.
*/
+#define _GNU_SOURCE
+
#include <Elementary.h>
#include <string.h>
#include <Ecore_Evas.h>
-#include <Ecore_X.h>
#include <Evas.h>
+#include <dlfcn.h>
+#include <Eina.h>
+#include <math.h>
#include <dlog.h>
#include <widget_errno.h>
#include <widget_service.h>
+#include <widget_service_internal.h>
+#include <widget_conf.h>
+#include <widget_buffer.h>
+#include <widget_provider.h>
+#include <widget_util.h>
-#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)
{
}
}
-/*!
- * \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;
unsigned int flags = 0;
double timestamp;
-
- if (!info->handle) {
+ if (!info || info->state != VWIN_INFO_CREATED || !info->handle) {
/* Just ignore this event */
return 0;
}
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;
timestamp = event_info->timestamp * 1000.0f;
}
- /*!
- * \note
+ /**
+ * @note
* Feed up events
*/
switch (event_info->type) {
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);
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
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
break;
}
+ /**
+ * @TODO
+ * Fills me
+ */
+
ret = WIDGET_KEY_STATUS_ERROR;
break;
case WIDGET_BUFFER_EVENT_KEY_UP:
break;
}
+ /**
+ * @TODO
+ * Fills me
+ */
ret = WIDGET_KEY_STATUS_ERROR;
break;
case WIDGET_BUFFER_EVENT_KEY_FOCUS_IN:
break;
}
+ /**
+ * @TODO
+ * Fills me
+ */
ret = WIDGET_KEY_STATUS_ERROR;
break;
case WIDGET_BUFFER_EVENT_KEY_FOCUS_OUT:
break;
}
+ /**
+ * @TODO
+ * Fills me
+ */
ret = WIDGET_KEY_STATUS_ERROR;
break;
default:
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);
}
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;
{
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;
* 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) {
return NULL;
}
- ecore_evas_data_set(info->ee, "dynamic,box,info", info);
+ ecore_evas_data_set(info->ee, WIN_INFO_TAG, info);
/**
* @note