1 /*
2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
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 #include "higv_cextfile.h"
16 #include "sample_utils.h"
17 #include "hi_gv_parser.h"
18
19 #ifdef __cplusplus
20 #if __cplusplus
21 extern "C" {
22 #endif
23 #endif /* __cplusplus */
24
25 #define TIMER_SPEED (3000)
26
27 static HI_U32 g_timerId = 2;
28
LABEL_WIN_Onrefresh(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)29 HI_S32 LABEL_WIN_Onrefresh(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)
30 {
31 HIGV_UNUSED(wParam);
32 HIGV_UNUSED(lParam);
33
34 HI_S32 ret = HI_GV_Timer_Create(widget, g_timerId, TIMER_SPEED);
35 HIGV_CHECK("HI_GV_Timer_Create", ret);
36
37 ret = HI_GV_Timer_Start(widget, g_timerId);
38 HIGV_CHECK("HI_GV_Timer_Start", ret);
39
40 return HIGV_PROC_GOON;
41 }
42
LABEL_WIN_Ontimer(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)43 HI_S32 LABEL_WIN_Ontimer(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)
44 {
45 HIGV_UNUSED(widget);
46 HIGV_UNUSED(wParam);
47 HIGV_UNUSED(lParam);
48
49 HI_U32 ret = (HI_U32)HI_GV_PARSER_LoadViewById(IMAGE_WIN);
50 ret |= (HI_U32)HI_GV_Widget_Show(IMAGE_WIN);
51 ret |= (HI_U32)HI_GV_Widget_Active(IMAGE_WIN);
52 ret |= (HI_U32)HI_GV_Widget_Hide(LABEL_WIN);
53
54 HIGV_CHECK("HI_GV_Widget_Show", ret);
55 return HIGV_PROC_GOON;
56 }
57
LABEL_WIN_Onhide(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)58 HI_S32 LABEL_WIN_Onhide(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)
59 {
60 HIGV_UNUSED(wParam);
61 HIGV_UNUSED(lParam);
62
63 HI_U32 ret = (HI_U32)HI_GV_Timer_Stop(widget, g_timerId);
64 ret |= (HI_U32)HI_GV_Timer_Destroy(widget, g_timerId);
65
66 HIGV_CHECK("HI_GV_Timer_Destory", ret);
67
68 return HIGV_PROC_GOON;
69 }
70
71 #ifdef __cplusplus
72 #if __cplusplus
73 }
74 #endif
75 #endif /* __cplusplus */
76
77