• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __UI_CONFIG_H__
17 #define __UI_CONFIG_H__
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define LCD_CH_55 0
24 #define LCD_CH_70 1
25 #define LCD_CH_SEL LCD_CH_55
26 
27 #define LCD_MODE_HORIZONTAL 0
28 #define LCD_MODE_VERTICAL 1
29 #define LCD_MODE_SELECT LCD_MODE_HORIZONTAL
30 
31 #if (LCD_CH_SEL==LCD_CH_55)
32 #if (LCD_MODE_SELECT==LCD_MODE_HORIZONTAL)
33 #define SCREEN_WIDTH 960
34 #define SCREEN_HEIGHT 480
35 #else
36 #define SCREEN_WIDTH 480
37 #define SCREEN_HEIGHT 960
38 #endif
39 #elif (LCD_CH_SEL==LCD_CH_70)
40 #if (LCD_MODE_SELECT==LCD_MODE_HORIZONTAL)
41 #define SCREEN_WIDTH 1024
42 #define SCREEN_HEIGHT 600
43 #else
44 #define SCREEN_WIDTH 600
45 #define SCREEN_HEIGHT 1024
46 #endif
47 #else
48 #error "no such type LCD SIZE select!!!"
49 // exit (1)
50 #endif
51 
52 #define START_X 0
53 #define START_Y 0
54 #define BUTTON_ICON_SW 60
55 #define BUTTON_ICON_SH 60
56 #define BUTTON_ICON_BW 114
57 #define BUTTON_ICON_BH 114
58 
59 #define TITLE_HEIGHT 80
60 
61 #define ICON_B_WIDTH 50
62 #define ICON_B_HEIGHT 50
63 #define ICON_M_WIDTH 36
64 #define ICON_M_HEIGHT 36
65 #define ICON_S_WIDTH 12
66 #define ICON_S_HEIGHT 12
67 
68 // coord define
69 #define V_GROUP_X START_X
70 #define V_GROUP_Y START_Y
71 #define V_GROUP_W SCREEN_WIDTH
72 #define V_GROUP_H SCREEN_HEIGHT
73 
74 #if (LCD_MODE_SELECT==LCD_MODE_HORIZONTAL)
75 #define BACK_LABEL_X (START_X + 30)
76 #define BACK_LABEL_Y ((TITLE_HEIGHT - ICON_M_HEIGHT) / 2)
77 #define BACK_LABEL_W ICON_M_WIDTH
78 #define BACK_LABEL_H ICON_M_HEIGHT
79 
80 #define TXT_LABEL_X (BACK_LABEL_X + BUTTON_ICON_SW)
81 #define TXT_LABEL_Y (START_Y + (TITLE_HEIGHT - ICON_B_HEIGHT) / 2)
82 #define TXT_LABEL_W (ICON_B_WIDTH * 3)
83 #define TXT_LABEL_H ICON_B_HEIGHT
84 
85 #define RECORD_IMAGE_X (SCREEN_WIDTH / 2 - BUTTON_ICON_SW)
86 #define RECORD_IMAGE_Y (START_Y + (TITLE_HEIGHT - ICON_S_HEIGHT) / 2)
87 #define RECORD_IMAGE_W ICON_S_WIDTH
88 #define RECORD_IMAGE_H ICON_S_HEIGHT
89 
90 #define TIME_LABEL_X (RECORD_IMAGE_X + RECORD_IMAGE_W + 14)
91 #define TIME_LABEL_Y (START_Y + (TITLE_HEIGHT - ICON_B_HEIGHT) / 2)
92 #define TIME_LABEL_W (SCREEN_WIDTH-(RECORD_IMAGE_X + RECORD_IMAGE_W + 14))
93 #define TIME_LABEL_H ICON_B_HEIGHT
94 
95 #define SCROLL_VIEW_X START_X
96 #define SCROLL_VIEW_Y ((SCREEN_HEIGHT - BUTTON_ICON_BH) - 30)
97 #define SCROLL_VIEW_W SCREEN_WIDTH
98 #define SCROLL_VIEW_H (BUTTON_ICON_BH + 6)
99 
100 #define LEFT_BUTTON_X (SCREEN_WIDTH / 3)
101 #define LEFT_BUTTON_Y ((SCROLL_VIEW_H - BUTTON_ICON_SH) / 2)
102 #define LEFT_BUTTON_W BUTTON_ICON_SW
103 #define LEFT_BUTTON_H BUTTON_ICON_SH
104 #define MID_BUTTON_X (((SCREEN_WIDTH / 3) - BUTTON_ICON_BW) / 2 + 1 * (SCREEN_WIDTH / 3))
105 #define MID_BUTTON_Y ((SCROLL_VIEW_H - BUTTON_ICON_BH) / 2)
106 #define MID_BUTTON_W BUTTON_ICON_BW
107 #define MID_BUTTON_H BUTTON_ICON_BH
108 #define RIGHT_BUTTON_X (2 * (SCREEN_WIDTH / 3) - BUTTON_ICON_SW)
109 #define RIGHT_BUTTON_Y ((SCROLL_VIEW_H - BUTTON_ICON_SH) / 2)
110 #define RIGHT_BUTTON_W BUTTON_ICON_SW
111 #define RIGHT_BUTTON_H BUTTON_ICON_SH
112 
113 #else
114 #define BACK_LABEL_X (START_X + 30)
115 #define BACK_LABEL_Y ((BUTTON_ICON_SH - ICON_M_HEIGHT) / 2)
116 #define BACK_LABEL_W ICON_M_WIDTH
117 #define BACK_LABEL_H ICON_M_HEIGHT
118 
119 #define TXT_LABEL_X (BACK_LABEL_X + BUTTON_ICON_SW)
120 #define TXT_LABEL_Y (START_Y + (BUTTON_ICON_SH - ICON_B_HEIGHT) / 2)
121 #define TXT_LABEL_W (ICON_B_WIDTH * 3)
122 #define TXT_LABEL_H ICON_B_HEIGHT
123 
124 #define RECORD_IMAGE_X (SCREEN_WIDTH / 2 - BUTTON_ICON_SW)
125 #define RECORD_IMAGE_Y (START_Y + (BUTTON_ICON_SH - ICON_S_HEIGHT) / 2)
126 #define RECORD_IMAGE_W ICON_S_WIDTH
127 #define RECORD_IMAGE_H ICON_S_HEIGHT
128 
129 #define TIME_LABEL_X (RECORD_IMAGE_X + RECORD_IMAGE_W + 14)
130 #define TIME_LABEL_Y (START_Y + (BUTTON_ICON_SH - ICON_B_HEIGHT) / 2)
131 #define TIME_LABEL_W (BUTTON_ICON_SW * 2)
132 #define TIME_LABEL_H ICON_B_HEIGHT
133 
134 #define SCROLL_VIEW_X START_X
135 #define SCROLL_VIEW_Y ((SCREEN_HEIGHT - BUTTON_ICON_BH) - 10)
136 #define SCROLL_VIEW_W SCREEN_WIDTH
137 #define SCROLL_VIEW_H (BUTTON_ICON_BH + 6)
138 
139 #define LEFT_BUTTON_X (SCREEN_WIDTH / 3)
140 #define LEFT_BUTTON_Y ((SCROLL_VIEW_H - BUTTON_ICON_SH) / 2)
141 #define LEFT_BUTTON_W BUTTON_ICON_SW
142 #define LEFT_BUTTON_H BUTTON_ICON_SH
143 #define MID_BUTTON_X (((SCREEN_WIDTH / 3) - BUTTON_ICON_BW) / 2 + 1 * (SCREEN_WIDTH / 3))
144 #define MID_BUTTON_Y ((SCROLL_VIEW_H - BUTTON_ICON_SH) / 2)
145 #define MID_BUTTON_W BUTTON_ICON_SW
146 #define MID_BUTTON_H BUTTON_ICON_SH
147 #define RIGHT_BUTTON_X (2 * (SCREEN_WIDTH / 3) - BUTTON_ICON_SW)
148 #define RIGHT_BUTTON_Y ((SCROLL_VIEW_H - BUTTON_ICON_SH) / 2)
149 #define RIGHT_BUTTON_W BUTTON_ICON_SW
150 #define RIGHT_BUTTON_H BUTTON_ICON_SH
151 #endif
152 
153 #define UI_IMAGE_PATH \
154     "/storage/app/run/com.huawei.camera/cameraApp/assets/cameraApp/resources/base/media/"
155 #define TTF_PATH "SourceHanSansSC-Regular.otf"
156 
157 #define PHOTO_PATH "/userdata/photo/"
158 #define VIDEO_PATH "/userdata/video/"
159 #define THUMB_PATH "/userdata/thumb/"
160 
161 #define MAX_NAME_LEN 256
162 #define PAGE_SIZE 1024
163 
164 #define IMAGE_WIDTH 1920
165 #define IMAGE_HEIGHT 1080
166 
167 #define SAMPLE_RATE 48000
168 #define CHANNEL_COUNT 1
169 #define AUDIO_ENCODING_BITRATE SAMPLE_RATE
170 #define FRAME_RATE 30
171 #define BIT_RATE 4096
172 
173 #define FILE_MODE 0777
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif
180