Update License
[platform/framework/web/provider.git] / sample / org.tizen.live-app / include / CWindow.h
1 /*
2  * Copyright 2013  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://floralicense.org/license/
9  *
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.
15  */
16
17 class CWindow {
18 public:
19         static CWindow *Find(enum target_type type, const char *id);
20         static CWindow *Create(enum target_type type, const char *id, int w, int h);
21
22         static void *s_AllocateCanvas(void *data, int size);
23         static void s_ReleaseCanvas(void *data, void *canvas);
24         static void s_PostRender(void *data, Evas *e, void *event_info);
25         static int s_BufferEventHandler(struct livebox_buffer *buffer, enum buffer_event event, double timestamp, double x, double y, void *data);
26
27         int Destroy(void);
28         int Resize(int w, int h);
29
30         void SetBuffer(struct livebox_buffer *pBuffer) { m_pBuffer = pBuffer; }
31         enum target_type Type(void) { return m_vType; }
32         int Width(void) { return m_nWidth; }
33         int Height(void) { return m_nHeight; }
34         struct livebox_buffer *Buffer(void) { return m_pBuffer; }
35         Evas_Object *Object(void) { return m_pObject; }
36         const char *Id(void) { return m_sID; }
37         Evas *EvasObject(void) { return m_pEvas; }
38
39 private:
40         CWindow(enum target_type type, int width, int height);
41         virtual ~CWindow(void);
42
43         enum target_type m_vType;
44         int m_nWidth;
45         int m_nHeight;
46
47         struct livebox_buffer *m_pBuffer;
48
49         Ecore_Evas *m_pEcoreEvas;
50         Evas *m_pEvas;
51         Evas_Object *m_pObject;
52
53         char *m_sID;
54
55         static Eina_List *s_pList;
56 };
57
58 /* End of a file */