1
2 #include "base/modules/c/include/WrapperIHaasUI.h"
3 #include "base/include/IHaasUI.h"
4 #include "ulog/ulog.h"
5 #include "base/modules/core/include/HaasErrno.h"
6
7 #define LOG_TAG "WRAPPER_UI"
8
UICreateInstance(UIFrameworkType_t type)9 void* UICreateInstance(UIFrameworkType_t type)
10 {
11 LOGD(LOG_TAG, "entern %s;\n", __func__);
12 #if 0
13 IHaasUI* mIHaasUI = IHaasUIInstance(type);
14 if (mIHaasUI == NULL)
15 {
16 LOGD(LOG_TAG, "IHaasInstance failed %s;\n", __func__);
17 return NULL;
18 }
19 return (void*)mIHaasUI;
20 #else
21 return NULL;
22 #endif
23 }
24
UIDestoryInstance(void * instance)25 void UIDestoryInstance(void* instance)
26 {
27 LOGD(LOG_TAG, "entern %s;\n", __func__);
28 #if 0
29 IHaasUI* mIHaasUI = (IHaasUI*)instance;
30 if (mIHaasUI == NULL)
31 {
32 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
33 return;
34 }
35 delete mIHaasUI;
36 #endif
37 }
38
UIGetDisplayWidth(void * instance)39 int UIGetDisplayWidth(void* instance)
40 {
41 LOGD(LOG_TAG, "entern %s;\n", __func__);
42 #if 0
43 IHaasUI* mIHaasUI = (IHaasUI*)instance;
44 if (mIHaasUI == NULL)
45 {
46 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
47 return -1;
48 }
49 int ret = mIHaasUI->GetDisplayWidth();
50 return ret;
51 #else
52 return 0;
53 #endif
54 }
55
UIGetDisplayHeight(void * instance)56 int UIGetDisplayHeight(void* instance)
57 {
58 LOGD(LOG_TAG, "entern %s;\n", __func__);
59 #if 0
60 IHaasUI* mIHaasUI = (IHaasUI*)instance;
61 if (mIHaasUI == NULL)
62 {
63 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
64 return -1;
65 }
66 int ret = mIHaasUI->GetDisplayHeight();
67 return ret;
68 #else
69 return 0;
70 #endif
71 }
72
UIGetDisplayBacklight(void * instance)73 int UIGetDisplayBacklight(void* instance)
74 {
75 LOGD(LOG_TAG, "entern %s;\n", __func__);
76 #if 0
77 IHaasUI* mIHaasUI = (IHaasUI*)instance;
78 if (mIHaasUI == NULL)
79 {
80 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
81 return -1;
82 }
83 int ret = mIHaasUI->GetDisplayBacklight();
84 return ret;
85 #else
86 return 0;
87 #endif
88 }
89
UISetDisplayBacklight(void * instance,int32_t value)90 int UISetDisplayBacklight(void* instance, int32_t value)
91 {
92 LOGD(LOG_TAG, "entern %s;\n", __func__);
93 #if 0
94 IHaasUI* mIHaasUI = (IHaasUI*)instance;
95 if (mIHaasUI == NULL)
96 {
97 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
98 return -1;
99 }
100 int ret = mIHaasUI->SetDisplayBacklight(value);
101 return ret;
102 #else
103 return 0;
104 #endif
105 }
106
UIGetDisplayType(void * instance)107 int UIGetDisplayType(void* instance)
108 {
109 LOGD(LOG_TAG, "entern %s;\n", __func__);
110 #if 0
111 IHaasUI* mIHaasUI = (IHaasUI*)instance;
112 if (mIHaasUI == NULL)
113 {
114 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
115 return -1;
116 }
117 int ret = mIHaasUI->GetDisplayType();
118 return ret;
119 #else
120 return 0;
121 #endif
122 }
123
UIGetDisplayFreq(void * instance)124 int UIGetDisplayFreq(void* instance)
125 {
126 LOGD(LOG_TAG, "entern %s;\n", __func__);
127 #if 0
128 IHaasUI* mIHaasUI = (IHaasUI*)instance;
129 if (mIHaasUI == NULL)
130 {
131 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
132 return -1;
133 }
134 int ret = mIHaasUI->GetDisplayFreq();
135 return ret;
136 #else
137 return 0;
138 #endif
139 }
140
UISetDisplayFreq(void * instance,int32_t freq)141 int UISetDisplayFreq(void* instance, int32_t freq)
142 {
143 LOGD(LOG_TAG, "entern %s;\n", __func__);
144 #if 0
145 IHaasUI* mIHaasUI = (IHaasUI*)instance;
146 if (mIHaasUI == NULL)
147 {
148 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
149 return -1;
150 }
151 int ret = mIHaasUI->SetDisplayFreq(freq);
152 return ret;
153 #else
154 return 0;
155 #endif
156 }
157
UIDrawPoint(void * instance,Point_t * pt,int32_t color)158 int UIDrawPoint(void* instance, Point_t *pt, int32_t color)
159 {
160 LOGD(LOG_TAG, "entern %s;\n", __func__);
161 #if 0
162 IHaasUI* mIHaasUI = (IHaasUI*)instance;
163 if (mIHaasUI == NULL)
164 {
165 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
166 return -1;
167 }
168 int ret = mIHaasUI->DrawPoint(pt, color);
169 return ret;
170 #else
171 return 0;
172 #endif
173 }
174
UIDrawLine(void * instance,Point_t * start,Point_t * end,int32_t color)175 int UIDrawLine(void* instance, Point_t *start, Point_t *end, int32_t color)
176 {
177 LOGD(LOG_TAG, "entern %s;\n", __func__);
178 #if 0
179 IHaasUI* mIHaasUI = (IHaasUI*)instance;
180 if (mIHaasUI == NULL)
181 {
182 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
183 return -1;
184 }
185 int ret = mIHaasUI->DrawLine(start, end, color);
186 return ret;
187 #else
188 return 0;
189 #endif
190 }
191
UIDrawRectangle(void * instance,int32_t left,int32_t top,int32_t right,int32_t bottom,int32_t color)192 int UIDrawRectangle(void* instance, int32_t left, int32_t top, int32_t right, int32_t bottom,
193 int32_t color)
194 {
195 LOGD(LOG_TAG, "entern %s;\n", __func__);
196 #if 0
197 IHaasUI* mIHaasUI = (IHaasUI*)instance;
198 if (mIHaasUI == NULL)
199 {
200 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
201 return -1;
202 }
203 int ret = mIHaasUI->DrawRectangle(left, top, right, bottom, color);
204 return ret;
205 #else
206 return 0;
207 #endif
208 }
209
UIDrawCircle(void * instance,Point_t * center,int32_t radius,int32_t color)210 int UIDrawCircle(void* instance, Point_t * center, int32_t radius, int32_t color)
211 {
212 LOGD(LOG_TAG, "entern %s;\n", __func__);
213 #if 0
214 IHaasUI* mIHaasUI = (IHaasUI*)instance;
215 if (mIHaasUI == NULL)
216 {
217 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
218 return -1;
219 }
220 int ret = mIHaasUI->DrawCircle(center, radius, color);
221 return ret;
222 #else
223 return 0;
224 #endif
225 }
226
UIDrawText(void * instance,char * text,int32_t size,int32_t color,int32_t left,int32_t top,int32_t right,int32_t bottom)227 void UIDrawText(void* instance, char* text, int32_t size, int32_t color, int32_t left,
228 int32_t top, int32_t right, int32_t bottom)
229 {
230 LOGD(LOG_TAG, "entern %s;\n", __func__);
231 #if 0
232 IHaasUI* mIHaasUI = (IHaasUI*)instance;
233 if (mIHaasUI == NULL)
234 {
235 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
236 return;
237 }
238 mIHaasUI->DrawText(text, size, color, left, top, right, bottom);
239 #endif
240 }
241
UIDrawPixels(void * instance,int32_t * pixels,Point_t * pt,int32_t width,int32_t height)242 bool UIDrawPixels(void* instance, int32_t* pixels, Point_t *pt, int32_t width, int32_t height)
243 {
244 LOGD(LOG_TAG, "entern %s;\n", __func__);
245 #if 0
246 IHaasUI* mIHaasUI = (IHaasUI*)instance;
247 if (mIHaasUI == NULL)
248 {
249 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
250 return false;
251 }
252 bool ret = mIHaasUI->DrawPixels(pixels, pt, width, height);
253 return ret;
254 #else
255 return 0;
256 #endif
257 }
258
UIDrawImage(void * instance,char * path,Point_t * pt,int32_t width,int32_t height)259 bool UIDrawImage(void* instance, char * path, Point_t *pt, int32_t width, int32_t height)
260 {
261 LOGD(LOG_TAG, "entern %s;\n", __func__);
262 #if 0
263 IHaasUI* mIHaasUI = (IHaasUI*)instance;
264 if (mIHaasUI == NULL)
265 {
266 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
267 return false;
268 }
269 bool ret = mIHaasUI->DrawImage(path, pt, width, height);
270 return ret;
271 #else
272 return 0;
273 #endif
274 }
275
UIUpdateDisplay(void * instance)276 void UIUpdateDisplay(void* instance)
277 {
278 LOGD(LOG_TAG, "entern %s;\n", __func__);
279 #if 0
280 IHaasUI* mIHaasUI = (IHaasUI*)instance;
281 if (mIHaasUI == NULL)
282 {
283 LOGD(LOG_TAG, "mIHaasUI is NULL %s;\n", __func__);
284 return;
285 }
286 mIHaasUI->UpdateDisplay();
287 #endif
288 }
289
290