• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
IMAGE_WIN_Onhide(HIGV_HANDLE widget,HI_PARAM wParam,HI_PARAM lParam)29 HI_S32 IMAGE_WIN_Onhide(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)
30 {
31     HIGV_UNUSED(wParam);
32     HIGV_UNUSED(lParam);
33 
34     HI_U32 ret = (HI_U32)HI_GV_Timer_Stop(widget, g_timerId);
35     ret |= (HI_U32)HI_GV_Timer_Destroy(widget, g_timerId);
36 
37     HIGV_CHECK("HI_GV_Timer_Destory", ret);
38 
39     return HIGV_PROC_GOON;
40 }
41 
IMAGE_WIN_Onshow(HIGV_HANDLE widget,HI_PARAM wParam,HI_PARAM lParam)42 HI_S32 IMAGE_WIN_Onshow(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)
43 {
44     HIGV_UNUSED(wParam);
45     HIGV_UNUSED(lParam);
46 
47     HI_S32 ret = HI_GV_Timer_Create(widget, g_timerId, TIMER_SPEED);
48     HIGV_CHECK("HI_GV_Timer_Create", ret);
49 
50     ret = HI_GV_Timer_Start(widget, g_timerId);
51     HIGV_CHECK("HI_GV_Timer_Start", ret);
52     return HIGV_PROC_GOON;
53 }
54 
IMAGE_WIN_Ontimer(HIGV_HANDLE widget,HI_PARAM wParam,HI_PARAM lParam)55 HI_S32 IMAGE_WIN_Ontimer(HIGV_HANDLE widget, HI_PARAM wParam, HI_PARAM lParam)
56 {
57     HIGV_UNUSED(widget);
58     HIGV_UNUSED(wParam);
59     HIGV_UNUSED(lParam);
60 
61     HI_U32 ret = (HI_U32)HI_GV_PARSER_LoadViewById(LISTBOX_WIN);
62     ret |= (HI_U32)HI_GV_Widget_Show(LISTBOX_WIN);
63     ret |= (HI_U32)HI_GV_Widget_Active(LISTBOX_WIN);
64     ret |= (HI_U32)HI_GV_Widget_Hide(IMAGE_WIN);
65 
66     HIGV_CHECK("HI_GV_Widget_Show", ret);
67     return HIGV_PROC_GOON;
68 }
69 
70 #ifdef __cplusplus
71 #if __cplusplus
72 }
73 #endif
74 #endif /*  __cplusplus  */
75