2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file BoxRenderBuffer.cpp
18 * @author Yunchan Cho (yunchan.cho@samsung.com)
23 #include <provider_buffer.h>
24 #include <Core/Util/Log.h>
25 #include "RenderBuffer.h"
26 #include "BoxRenderBuffer.h"
28 BoxRenderBuffer::BoxRenderBuffer(
29 std::string boxId, std::string instanceId,
30 int width, int height)
32 , m_instanceId(instanceId)
38 BoxRenderBuffer::~BoxRenderBuffer()
42 BufferInfoPtr BoxRenderBuffer::acquireBuffer()
46 BufferInfoPtr bufferInfo =
47 provider_buffer_acquire(
54 handleTouchEventCallback,
59 void BoxRenderBuffer::updateBuffer()
62 provider_send_updated(
69 int BoxRenderBuffer::handleTouchEventCallback(
70 BufferInfoPtr bufferInfo,
78 BoxRenderBuffer* This = static_cast<BoxRenderBuffer*>(data);
81 case BUFFER_EVENT_MOVE:
82 type = TOUCH_EVENT_MOVE;
84 case BUFFER_EVENT_DOWN:
85 type = TOUCH_EVENT_DOWN;
88 type = TOUCH_EVENT_UP;
91 type = TOUCH_EVENT_UNRECOGNIZED;
95 if (type != TOUCH_EVENT_UNRECOGNIZED) {
96 This->didHandleTouchEvent(type, timestamp, x, y);
101 void BoxRenderBuffer::didHandleTouchEvent(
102 TouchType type, double timestamp, double x, double y)
106 case TOUCH_EVENT_MOVE:
108 evas_event_feed_mouse_move(
109 getCanvas(), x * m_width, y * m_height, timestamp, NULL);
111 case TOUCH_EVENT_DOWN:
113 evas_event_feed_mouse_move(
114 getCanvas(), x * m_width, y * m_height, timestamp, NULL);
115 evas_event_feed_mouse_down(
116 getCanvas(), 1, EVAS_BUTTON_NONE, 0, NULL);
120 evas_event_feed_mouse_up(
121 getCanvas(), 1, EVAS_BUTTON_NONE, 0, NULL);