Foenix A2650 OS/f Library
 
Loading...
Searching...
No Matches
control_template.h
Go to the documentation of this file.
1
2
3/*
4 * control_template.h
5 *
6* Created on: Mar 26, 2022
7 * Author: micahbly
8 */
9
10#ifndef CONTROL_TEMPLATE_H_
11#define CONTROL_TEMPLATE_H_
12
13
14/* about this class: Control Template
15 *
16 * Provides structures and functions for creating and destroying templates for controls such as close widgets, buttons, sliders, etc.
17 *
18 *** things this class needs to be able to do
19 * Create a proto-control (control template)
20 * Destroy a proto-control (control template)
21 *
22 *
23 * STRETCH GOALS
24 *
25 *
26 * SUPER STRETCH GOALS
27 *
28 *
29 */
30
31
32/*****************************************************************************/
33/* Includes */
34/*****************************************************************************/
35
36// project includes
37#include "control.h"
38
39
40// C includes
41#include <stdbool.h>
42
43
44// A2560 includes
45#include <mcp/syscalls.h>
46#include "a2560k.h"
47
48
49/*****************************************************************************/
50/* Macro Definitions */
51/*****************************************************************************/
52
53
54
55/*****************************************************************************/
56/* Enumerations */
57/*****************************************************************************/
58
59
60
61/*****************************************************************************/
62/* Structs */
63/*****************************************************************************/
64
69{
70 control_type type_;
71 h_align_type h_align_;
72 v_align_type v_align_;
73 int16_t x_offset_;
74 int16_t y_offset_;
75 int16_t width_;
76 int16_t height_;
77 int16_t min_;
78 int16_t max_;
79 Bitmap* image_[2][2];
80 char* caption_;
82// char* hover_text_; //! optional string to show in help/hover-text situations
83};
84
85
86
87
88/*****************************************************************************/
89/* Global Variables */
90/*****************************************************************************/
91
92
93/*****************************************************************************/
94/* Public Function Prototypes */
95/*****************************************************************************/
96
97
98// **** CONSTRUCTOR AND DESTRUCTOR *****
99
100// constructor
104
105// destructor
109bool ControlTemplate_Destroy(ControlTemplate** the_template);
110
111
112
113
114
115
116// **** xxx functions *****
117
118
119
120
121// **** Set xxx functions *****
122
123
124
125
126// **** Get xxx functions *****
127
128
129
130
131
132// **** xxx functions *****
133
134
135
136
137// **** xxx functions *****
138
139
140// **** Debug functions *****
141
142void ControlTemplate_Print(ControlTemplate* the_template);
143
144
145#endif /* CONTROL_TEMPLATE_H_ */
146
147
control_type
Definition: control.h:83
ControlTemplate * ControlTemplate_New(void)
Creates a new ControlTemplate object, allocating space from the heap.
Definition: control_template.c:98
bool ControlTemplate_Destroy(ControlTemplate **the_template)
Frees all allocated memory associated with the passed object, and the object itself.
Definition: control_template.c:123
Definition: bitmap.h:97
A structure that can be used to instantiate a ControlTemplate object instance in a window The Control...
Definition: control_template.h:69
int16_t min_
height of the control
Definition: control_template.h:77
int16_t avail_text_width_
optional string to draw centered horizontally and vertically on the control. Typical use case is for ...
Definition: control_template.h:81
int16_t max_
minimum allowed value
Definition: control_template.h:78
Bitmap * image_[2][2]
maximum allowed value
Definition: control_template.h:79
int16_t width_
vertical coordinate relative to the parent window's top or bottom edge. If v_align_ is V_ALIGN_CENTER...
Definition: control_template.h:75
char * caption_
4 image state bitmaps: [active yes/no][pushed down yes/no]
Definition: control_template.h:80
int16_t y_offset_
horizontal coordinate relative to the parent window's left or right edge. If h_align_ is H_ALIGN_CENT...
Definition: control_template.h:74
v_align_type v_align_
whether the control should be positioned relative to the left side, right side, or centered
Definition: control_template.h:72
int16_t height_
width of the control
Definition: control_template.h:76
h_align_type h_align_
button vs checkbox vs radio button, etc.
Definition: control_template.h:71
int16_t x_offset_
whether the control should be positioned relative to the top edge, bottom edge, or centered
Definition: control_template.h:73