VSF Documented
vsf_tgui_button.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18/****************************************************************************
19* Copyright 2020 by Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
20* *
21* Licensed under the Apache License, Version 2.0 (the "License"); *
22* you may not use this file except in compliance with the License. *
23* You may obtain a copy of the License at *
24* *
25* http://www.apache.org/licenses/LICENSE-2.0 *
26* *
27* Unless required by applicable law or agreed to in writing, software *
28* distributed under the License is distributed on an "AS IS" BASIS, *
29* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
30* See the License for the specific language governing permissions and *
31* limitations under the License. *
32* *
33****************************************************************************/
34
35#ifndef __VSF_TGUI_CONTROLS_BUTTON_H__
36#define __VSF_TGUI_CONTROLS_BUTTON_H__
37
38/*============================ INCLUDES ======================================*/
39
40#include "./vsf_tgui_label.h"
41
46#if defined(__VSF_TGUI_CONTROLS_BUTTON_CLASS_IMPLEMENT)
47# define __PLOOC_CLASS_IMPLEMENT__
48# undef __VSF_TGUI_CONTROLS_BUTTON_CLASS_IMPLEMENT
49#elif defined(__VSF_TGUI_CONTROLS_BUTTON_CLASS_INHERIT)
50# define __PLOOC_CLASS_INHERIT__
51# undef __VSF_TGUI_CONTROLS_BUTTON_CLASS_INHERIT
52#endif
53
54#include "utilities/ooc_class.h"
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60/*============================ MACROS ========================================*/
61
62
63#define __VSF_TGUI_INTERFACE_CONTROLS_BUTTON { \
64 .msg_handler = { \
65 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
66 (vsf_msgt_method_fsm_t *)&vsf_tgui_button_msg_handler, \
67 }, \
68 .Status = (vsf_msgt_method_status_t *) \
69 &vsf_tgui_control_status_get, \
70 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
71 }
72
73
74/*============================ MACROFIED FUNCTIONS ===========================*/
75
76
77#define __tgui_button(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
78 tgui_control_base( __NAME, \
79 VSF_TGUI_COMPONENT_ID_BUTTON, \
80 vsf_tgui_button_t, \
81 (__PARENT_ADDR), \
82 __PREVIOUS, \
83 __NEXT, \
84 VSF_TGUI_V_BUTTON_STATIC_INIT_DEFAULT \
85 __VA_ARGS__ \
86 VSF_TGUI_V_BUTTON_STATIC_INIT_OVERRIDE)
87
88#define tgui_button(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
89 __tgui_button( __NAME, \
90 (__PARENT_ADDR), \
91 __PREVIOUS, \
92 __NEXT, \
93 __VA_ARGS__)
94
95#define __tgui_set_internal_button( __OWNER_ADDR, \
96 __MEMBER, \
97 __PREVIOUS, \
98 __NEXT, ...) \
99 (*__OWNER_ADDR) tgui_button( \
100 __MEMBER, \
101 (__OWNER_ADDR), \
102 __PREVIOUS, \
103 __NEXT, \
104 __VA_ARGS__)
105
106#define tgui_set_internal_button( __OWNER_ADDR, \
107 __MEMBER, \
108 __PREVIOUS, \
109 __NEXT, ...) \
110 __tgui_set_internal_button( (__OWNER_ADDR), \
111 __MEMBER, \
112 __PREVIOUS, \
113 __NEXT, \
114 __VA_ARGS__)
115
116
117#define tgui_set_priv_button( __OWNER_ADDR , \
118 __MEMBER, \
119 ...) \
120 __tgui_set_internal_button( (__OWNER_ADDR), \
121 __MEMBER, \
122 __MEMBER, \
123 __MEMBER, \
124 __VA_ARGS__)
125
126
127/*============================ TYPES =========================================*/
128
129declare_class(vsf_tgui_button_t)
130
131def_class(vsf_tgui_button_t,
132 which(
133 implement(vsf_tgui_label_t)
134 implement(vsf_tgui_v_button_t)
135 )
136
137 public_member(
138 implement_ex(
139 struct {
140 uint8_t bIsCheckButton : 1;
141 uint8_t bIsChecked : 1;
142 uint8_t bIsAllowEmphasize : 1;
143 uint8_t bIsEmphasized : 1;
144 },
145 _
146 )
147 )
148)
149end_def_class(vsf_tgui_button_t)
150
151
152/*============================ GLOBAL VARIABLES ==============================*/
153/*============================ PROTOTYPES ====================================*/
154
155extern
156fsm_rt_t vk_tgui_button_init(vsf_tgui_button_t* ptButton);
157
158extern
159fsm_rt_t vk_tgui_button_update(vsf_tgui_button_t* ptButton);
160
161extern
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif
170/* EOF */
171
unsigned char uint8_t
Definition lvgl.h:40
Definition vsf_tgui_common.h:558
fsm_rt_t
Definition vsf_fsm.h:315
struct @747::@773 _
def_class(vsf_stream_fifo_t, which(vsf_stream_tx_t TX;vsf_stream_rx_t RX;), private:vsf_slist_queue_t union { vsf_stream_fifo_cfg_t cfg;struct { vsf_stream_dat_rdy_evt_t tDataReadyEventHandling;vsf_stream_dat_drn_evt_t tDataDrainEventHandling;vsf_stream_status_t Status;#if !defined(VSF_PBUF_QUEUE_CFG_ATOM_ACCESS) vsf_protect_region_t *pregion;#endif };};) end_def_class(vsf_stream_fifo_t) extern vsf_err_t vsf_stream_fifo_init(vsf_stream_fifo_t *obj_ptr
fsm_rt_t vk_tgui_button_init(vsf_tgui_button_t *ptButton)
Definition vsf_tgui_button.c:232
declare_class(vsf_tgui_button_t) def_class(vsf_tgui_button_t
which(vsf_tgui_label_t vsf_tgui_v_button_t) public fsm_rt_t vk_tgui_button_update(vsf_tgui_button_t *ptButton)
Definition vsf_tgui_button.c:227
fsm_rt_t vsf_tgui_button_msg_handler(vsf_tgui_button_t *control_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_button.c:70
which(union { inherit(vsf_msgt_container_t) vsf_tgui_control_t };vsf_tgui_v_container_t) implement_ex(struct
Definition vsf_tgui_control.h:566
which(vsf_tgui_control_t vsf_tgui_v_label_t) public vsf_tgui_msg_t * ptMSG
Definition vsf_tgui_label.h:161
const vsf_tgui_control_t * control_ptr
Definition vsf_tgui_scguiv_port.h:91