initial upload
[apps/core/preloaded/ug-image-viewer-efl.git] / common / include / ivug-mouse-event.h
1 /*\r
2  * Copyright 2012  Samsung Electronics Co., Ltd\r
3  *\r
4  * Licensed under the Flora License, Version 1.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *        http://www.tizenopensource.org/license\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16
17 #pragma once
18
19 typedef struct  {
20         int x, y;
21
22         unsigned int timestamp;
23
24         int button_flags;
25
26         int event_flags;
27         int device;
28 } MouseEvent;
29
30
31 // TODO : Review below APIs
32 typedef struct {
33         void (*onMouseDown)(Evas_Object *obj, MouseEvent *down, void *data);
34         void (*onMouseDlbClick)(Evas_Object *obj, MouseEvent *click, void *data);
35         void (*onMouseUp)(Evas_Object *obj, MouseEvent *up, void *data);
36         void (*onMouseMove)(Evas_Object *obj, MouseEvent *prev, MouseEvent *cur, void *data);
37
38         void (*onPinchStart)(Evas_Object *obj, MouseEvent *center, int dist, void *data);
39         void (*onPinchMove)(Evas_Object *obj, MouseEvent *center, int dist, void *data);
40         void (*onPinchEnd)(Evas_Object *obj, MouseEvent *end, void *data);              // Is it really needed????
41
42 } mouse_callback_t;
43
44 typedef void *Ivug_Event_Handle;
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 Ivug_Event_Handle
51 ivug_mouse_event_add(Evas_Object *obj, mouse_callback_t *pCallback, void *client_data, const char *alias /* for debugging*/);
52
53 void ivug_mouse_event_del(Ivug_Event_Handle handle);
54
55 #ifdef __cplusplus
56 }
57 #endif
58
59