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 ======================================*/
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/*============================ MACROS ========================================*/
57
58
59#define __VSF_TGUI_INTERFACE_CONTROLS_BUTTON { \
60 .msg_handler = { \
61 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
62 (vsf_msgt_method_fsm_t *)&vsf_tgui_button_msg_handler, \
63 }, \
64 .Status = (vsf_msgt_method_status_t *) \
65 &vsf_tgui_control_status_get, \
66 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
67 }
68
69
70/*============================ MACROFIED FUNCTIONS ===========================*/
71
72
73#define __tgui_button(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
74 tgui_control_base( __NAME, \
75 VSF_TGUI_COMPONENT_ID_BUTTON, \
76 vsf_tgui_button_t, \
77 (__PARENT_ADDR), \
78 __PREVIOUS, \
79 __NEXT, \
80 VSF_TGUI_V_BUTTON_STATIC_INIT_DEFAULT \
81 __VA_ARGS__ \
82 VSF_TGUI_V_BUTTON_STATIC_INIT_OVERRIDE)
83
84#define tgui_button(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
85 __tgui_button( __NAME, \
86 (__PARENT_ADDR), \
87 __PREVIOUS, \
88 __NEXT, \
89 __VA_ARGS__)
90
91#define __tgui_set_internal_button( __OWNER_ADDR, \
92 __MEMBER, \
93 __PREVIOUS, \
94 __NEXT, ...) \
95 (*__OWNER_ADDR) tgui_button( \
96 __MEMBER, \
97 (__OWNER_ADDR), \
98 __PREVIOUS, \
99 __NEXT, \
100 __VA_ARGS__)
101
102#define tgui_set_internal_button( __OWNER_ADDR, \
103 __MEMBER, \
104 __PREVIOUS, \
105 __NEXT, ...) \
106 __tgui_set_internal_button( (__OWNER_ADDR), \
107 __MEMBER, \
108 __PREVIOUS, \
109 __NEXT, \
110 __VA_ARGS__)
111
112
113#define tgui_set_priv_button( __OWNER_ADDR , \
114 __MEMBER, \
115 ...) \
116 __tgui_set_internal_button( (__OWNER_ADDR), \
117 __MEMBER, \
118 __MEMBER, \
119 __MEMBER, \
120 __VA_ARGS__)
121
122
123/*============================ TYPES =========================================*/
124
125declare_class(vsf_tgui_button_t)
126
127def_class(vsf_tgui_button_t,
128 which(
129 implement(vsf_tgui_label_t)
130 implement(vsf_tgui_v_button_t)
131 )
132
133 public_member(
134 implement_ex(
135 struct {
136 uint8_t bIsCheckButton : 1;
137 uint8_t bIsChecked : 1;
138 uint8_t bIsAllowEmphasize : 1;
139 uint8_t bIsEmphasized : 1;
140 },
141 _
142 )
143 )
144)
145end_def_class(vsf_tgui_button_t)
146
147
148/*============================ GLOBAL VARIABLES ==============================*/
149/*============================ PROTOTYPES ====================================*/
150
151extern
152fsm_rt_t vk_tgui_button_init(vsf_tgui_button_t* ptButton);
153
154extern
155fsm_rt_t vk_tgui_button_update(vsf_tgui_button_t* ptButton);
156
157extern
158fsm_rt_t vsf_tgui_button_msg_handler(vsf_tgui_button_t* control_ptr,
160
161#endif
162/* EOF */
163
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_tgui_common.h:509
fsm_rt_t
Definition vsf_fsm.h:315
struct @733::@738 _
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:540
which(vsf_tgui_control_t vsf_tgui_v_label_t) public vsf_tgui_msg_t * ptMSG
Definition vsf_tgui_label.h:157