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 PdRenderBuffer.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 "PdRenderBuffer.h"
28 PdRenderBuffer::PdRenderBuffer(
29 std::string boxId, std::string instanceId,
30 int width, int height)
32 , m_instanceId(instanceId)
38 PdRenderBuffer::~PdRenderBuffer()
42 BufferInfoPtr PdRenderBuffer::acquireBuffer()
44 BufferInfoPtr bufferInfo =
45 provider_buffer_acquire(
52 handleTouchEventCallback,
58 void PdRenderBuffer::updateBuffer()
60 provider_send_desc_updated(
66 int PdRenderBuffer::handleTouchEventCallback(
67 BufferInfoPtr bufferInfo,
75 PdRenderBuffer* This = static_cast<PdRenderBuffer*>(data);
78 case BUFFER_EVENT_MOVE:
79 type = TOUCH_EVENT_MOVE;
81 case BUFFER_EVENT_DOWN:
82 type = TOUCH_EVENT_DOWN;
85 type = TOUCH_EVENT_UP;
88 type = TOUCH_EVENT_UNRECOGNIZED;
92 if (type != TOUCH_EVENT_UNRECOGNIZED) {
93 This->didHandleTouchEvent(type, timestamp, x, y);
98 void PdRenderBuffer::didHandleTouchEvent(
99 TouchType type, double timestamp, double x, double y)
103 case TOUCH_EVENT_MOVE:
105 evas_event_feed_mouse_move(
106 getCanvas(), x * m_width, y * m_height, timestamp, NULL);
108 case TOUCH_EVENT_DOWN:
110 evas_event_feed_mouse_move(
111 getCanvas(), x * m_width, y * m_height, timestamp, NULL);
112 evas_event_feed_mouse_down(
113 getCanvas(), 1, EVAS_BUTTON_NONE, 0, NULL);
117 evas_event_feed_mouse_up(
118 getCanvas(), 1, EVAS_BUTTON_NONE, 0, NULL);