2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
14 #ifndef __CICO_HS_MENU_TILE_H__
15 #define __CICO_HS_MENU_TILE_H__
23 #include <Ecore_Wayland.h>
24 #include <Ecore_Evas.h>
28 #include <GLES2/gl2.h>
29 #include <GLES2/gl2ext.h>
30 #include <EGL/eglext.h>
32 #include "ico_syc_common.h"
33 #include "ico_syc_winctl.h"
35 #include "CicoHomeScreenCommon.h"
37 /*1920 * 1080 display*/
38 /*orientation is vertical*/
40 /*it can't use all height 1920 ,it needs deduct ControlBar 128 and StatusBar 64*/
41 /*home screen use 1728 * 1080*/
42 /*one rectangle size is 340 * 340 and space = 15*/
47 /***+---+---+---+******/
48 /***+ 0 + 1 + 2 +******/
49 /***+ 3 + 4 + 5 +******/
50 /***+ 6 + 7 + 8 +******/
51 /***+ 9 +10 +11 +******/
52 /***+---+---+---+******/
54 #define ICO_HS_MENUTILE_ROW 3
55 #define ICO_HS_MENUTILE_COLUMN 4
56 #define ICO_HS_MENUTILE_NUM (ICO_HS_MENUTILE_COLUMN * ICO_HS_MENUTILE_ROW)
57 #define ICO_HS_MENUTILE_POSITION_0 0
58 #define ICO_HS_MENUTILE_POSITION_1 1
59 #define ICO_HS_MENUTILE_POSITION_2 2
60 #define ICO_HS_MENUTILE_POSITION_3 3
61 #define ICO_HS_MENUTILE_POSITION_4 4
62 #define ICO_HS_MENUTILE_POSITION_5 5
63 #define ICO_HS_MENUTILE_POSITION_6 6
64 #define ICO_HS_MENUTILE_POSITION_7 7
65 #define ICO_HS_MENUTILE_POSITION_8 8
66 #define ICO_HS_MENUTILE_POSITION_9 9
67 #define ICO_HS_MENUTILE_POSITION_10 10
68 #define ICO_HS_MENUTILE_POSITION_11 11
69 #define ICO_HS_MENUTILE_POSITION_RESERVE 0xFFFF
71 #define ICO_HS_MENUTILE_WIDTH 290
72 #define ICO_HS_MENUTILE_HEIGHT 290
73 #define ICO_HS_MENUTILE_SPACE_TILE_AND_TILE 25
75 #define ICO_HS_MENUTILE_START_POS_X 80
76 #define ICO_HS_MENUTILE_START_POS_Y 210
78 #define ICO_HS_MENUTILE_TERM_ICON_PATH "/usr/apps/org.tizen.ico.homescreen/res/images/termIcon.png"
79 #define ICO_HS_MENUTILE_DEFAULT_ICON_PATH "/usr/apps/org.tizen.ico.homescreen/res/images/tizen_32.png"
80 #define ICO_HS_MENUTILE_TERM_ICON_WIDTH 64
81 #define ICO_HS_MENUTILE_TERM_ICON_HEIGHT 64
83 #define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW 10
84 #define ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE 1
85 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX 4
86 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2 6
87 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE 10
88 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCTION 4
90 struct _CicoHSMenuTile_glfunc {
91 EGLDisplay egl_display; // EGL display
92 PFNEGLCREATEIMAGEKHRPROC create_image; // create image
93 PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d; // set image target
94 PFNEGLDESTROYIMAGEKHRPROC destroy_image; // destroy image
96 struct _CicoHSMenuTile_thumb {
97 int surface; // surface id
98 int name; // EGL buffer name
99 int width; // frame buffer width
100 int height; // frame buff height
101 int stride; // frame buffer stride
102 int format; // frame buffer format(only EGL_TEXTURE_RGBA)
103 int fbcount; // frame buffer change counter
104 EGLImageKHR image; // frame buffer image
105 GLuint texture; // texture id
111 CicoHSMenuTile(const char *appid,const char *icon_image_path
112 ,int page,int subpage,int position,int width,int height);
113 ~CicoHSMenuTile(void);
114 void CreateObject(Evas *evas);
115 void FreeObject(void);
116 void Resize(int width,int height);
117 void MovePosition(int page,int poisition);
118 void OffsetMove(int offset_x,int offset_y);
119 const char* GetImagePath(void);
122 int GetPosition(void);
124 int GetSubPage(void);
125 int GetPositionX(void);
126 int GetPositionY(void);
128 const char* GetAppId(void);
129 void ShowTermIcon(void);
130 void HideTermIcon(void);
131 void ValidMenuIcon(void);
132 void ValidThumbnail(int surface);
133 void SetThumbnail(ico_syc_thumb_info_t *info);
134 void ShowMenu(bool show);
137 static struct _CicoHSMenuTile_glfunc glfunc;
139 char appid[ICO_HS_MAX_PROCESS_NAME];
140 char icon_image_path[ICO_HS_MAX_PATH_BUFF_LEN];
154 Evas_Object *thumb_tile;
156 Evas_Object *small_icon;
157 Evas_Object *term_icon;
158 struct _CicoHSMenuTile_thumb thumb;
161 CicoHSMenuTile operator=(const CicoHSMenuTile&);
162 CicoHSMenuTile(const CicoHSMenuTile&);
165 // vim: set expandtab ts=4 sw=4: