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>
27 #include "ico_syc_common.h"
28 #include "ico_syc_winctl.h"
29 #include "ico_syc_private.h"
31 #include "CicoHomeScreenCommon.h"
33 /*1920 * 1080 display*/
34 /*orientation is vertical*/
36 /*it can't use all height 1920 ,it needs deduct ControlBar 128 and StatusBar 64*/
37 /*home screen use 1728 * 1080*/
38 /*one rectangle size is 340 * 340 and space = 15*/
43 /***+---+---+---+******/
44 /***+ 0 + 1 + 2 +******/
45 /***+ 3 + 4 + 5 +******/
46 /***+ 6 + 7 + 8 +******/
47 /***+ 9 +10 +11 +******/
48 /***+---+---+---+******/
50 #define ICO_HS_MENUTILE_ROW 3
51 #define ICO_HS_MENUTILE_COLUMN 4
52 #define ICO_HS_MENUTILE_NUM (ICO_HS_MENUTILE_COLUMN * ICO_HS_MENUTILE_ROW)
53 #define ICO_HS_MENUTILE_POSITION_0 0
54 #define ICO_HS_MENUTILE_POSITION_1 1
55 #define ICO_HS_MENUTILE_POSITION_2 2
56 #define ICO_HS_MENUTILE_POSITION_3 3
57 #define ICO_HS_MENUTILE_POSITION_4 4
58 #define ICO_HS_MENUTILE_POSITION_5 5
59 #define ICO_HS_MENUTILE_POSITION_6 6
60 #define ICO_HS_MENUTILE_POSITION_7 7
61 #define ICO_HS_MENUTILE_POSITION_8 8
62 #define ICO_HS_MENUTILE_POSITION_9 9
63 #define ICO_HS_MENUTILE_POSITION_10 10
64 #define ICO_HS_MENUTILE_POSITION_11 11
65 #define ICO_HS_MENUTILE_POSITION_RESERVE 0xFFFF
67 #define ICO_HS_MENUTILE_WIDTH 290
68 #define ICO_HS_MENUTILE_HEIGHT 290
69 #define ICO_HS_MENUTILE_SPACE_TILE_AND_TILE 25
71 #define ICO_HS_MENUTILE_START_POS_X 80
72 #define ICO_HS_MENUTILE_START_POS_Y 210
74 #define ICO_HS_MENUTILE_TERM_ICON_PATH ICO_SYC_PACKAGE_HOMESCREEN "/res/images/termIcon.png"
75 #define ICO_HS_MENUTILE_DEFAULT_ICON_PATH ICO_SYC_PACKAGE_HOMESCREEN "/res/images/tizen_32.png"
76 #define ICO_HS_MENUTILE_TERM_ICON_WIDTH 64
77 #define ICO_HS_MENUTILE_TERM_ICON_HEIGHT 64
79 #define ICO_HS_MENUTILE_THUMBNAIL_FPS_SHOW 15 /* 15 frames/sec */
80 #define ICO_HS_MENUTILE_THUMBNAIL_FPS_HIDE -1 /* meanse 'not update' */
81 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX 4
82 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_PIX2 6
83 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCE_RATE 10
84 #define ICO_HS_MENUTILE_THUMBNAIL_REDUCTION 4
86 #define ICO_HS_MENUTILE_THUMBNAIL_RETRYTIME (0.3f) /* thumbnail retry time(sec) */
88 /*shared memory buffer*/
89 #define ICO_HS_THUMB_ICODIR "/tmp/ico"
90 #define ICO_HS_THUMB_FILEDIR "/thumbnail"
91 #define ICO_HS_THUMB_FILEEXT "pixel"
93 struct _CicoHSMenuTile_thumb {
94 int surface; // surface id
95 int type; // frame buffer type
96 int width; // frame buffer width
97 int height; // frame buff height
98 int stride; // frame buffer stride
99 int format; // frame buffer format(only EGL_TEXTURE_RGBA)
100 int fbcount; // frame buffer change counter
101 char *pixel_data; // glReadPixels data buffer
102 int pixel_bufsize; // data buffer size
103 Ecore_Timer *thumb_timer; // retry timer
104 int orgsurface; // original surface id
110 CicoHSMenuTile(const char *appid,const char *icon_image_path
111 ,int page,int subpage,int position,int width,int height);
112 ~CicoHSMenuTile(void);
113 void CreateObject(Evas *evas);
114 void FreeObject(void);
115 void Resize(int width,int height);
116 void MovePosition(int page,int poisition);
117 void OffsetMove(int offset_x,int offset_y);
118 const char* GetImagePath(void);
121 int GetPosition(void);
123 int GetSubPage(void);
124 int GetPositionX(void);
125 int GetPositionY(void);
127 const char* GetAppId(void);
128 void ShowTermIcon(void);
129 void HideTermIcon(void);
130 void ValidMenuIcon(void);
131 void ValidThumbnail(int surface);
132 void SetThumbnail(ico_syc_thumb_info_t *info);
133 void ShowMenu(bool show);
134 void SetOrgThumbnail(CicoHSMenuTile *orgTile);
135 void RetryThumbnail(void);
136 static Eina_Bool TimerThumbnail(void *data);
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: