Debian Codegraph @

pencil/include/layout/layout_order.inl

raw
1 /* File: layout_order.inl; Copyright and License: see below */
2
3 #include "u8/u8_trace.h"
4
5 static inline void layout_order_private_init ( layout_order_t *this_, layout_order_type_t order_type, int32_t first, int32_t second )
6 {
7 (*this_).first = first;
8 (*this_).second = second;
9 (*this_).order_type = order_type;
10 }
11
12
13 static inline void layout_order_private_reinit ( layout_order_t *this_, layout_order_type_t order_type, int32_t first, int32_t second )
14 {
15 (*this_).first = first;
16 (*this_).second = second;
17 (*this_).order_type = order_type;
18 }
19
20 static inline void layout_order_init_x_y ( layout_order_t *this_, int32_t x_order, int32_t y_order )
21 {
22 (*this_).first = x_order;
23 (*this_).second = y_order;
24 (*this_).order_type = LAYOUT_ORDER_TYPE_X_Y;
25 }
26
27 static inline void layout_order_reinit_x_y ( layout_order_t *this_, int32_t x_order, int32_t y_order )
28 {
29 (*this_).first = x_order;
30 (*this_).second = y_order;
31 (*this_).order_type = LAYOUT_ORDER_TYPE_X_Y;
32 }
33
34 static inline void layout_order_init_list ( layout_order_t *this_, int32_t list_order )
35 {
36 (*this_).first = list_order;
37 (*this_).second = 0;
38 (*this_).order_type = LAYOUT_ORDER_TYPE_LIST;
39 }
40
41 static inline void layout_order_reinit_list ( layout_order_t *this_, int32_t list_order )
42 {
43 (*this_).first = list_order;
44 (*this_).second = 0;
45 (*this_).order_type = LAYOUT_ORDER_TYPE_LIST;
46 }
47
48 static inline void layout_order_copy ( layout_order_t *this_, const layout_order_t *original )
49 {
50 (*this_) = (*original);
51 }
52
53 static inline void layout_order_replace ( layout_order_t *this_, const layout_order_t *original )
54 {
55 (*this_) = (*original);
56 }
57
58 static inline void layout_order_init_empty ( layout_order_t *this_ )
59 {
60 (*this_).first = 0;
61 (*this_).second = 0;
62 (*this_).order_type = LAYOUT_ORDER_TYPE_NONE;
63 }
64
65 static inline void layout_order_reinit_empty ( layout_order_t *this_ )
66 {
67 (*this_).first = 0;
68 (*this_).second = 0;
69 (*this_).order_type = LAYOUT_ORDER_TYPE_NONE;
70 }
71
72 static inline void layout_order_destroy ( layout_order_t *this_ )
73 {
74 }
75
76 static inline layout_order_type_t layout_order_get_order_type ( const layout_order_t *this_ )
77 {
78 return (*this_).order_type;
79 }
80
81 static inline int32_t layout_order_get_first ( const layout_order_t *this_ )
82 {
83 return (*this_).first;
84 }
85
86 static inline int32_t layout_order_get_second ( const layout_order_t *this_ )
87 {
88 return (*this_).second;
89 }
90
91 static inline void layout_order_trace ( const layout_order_t *this_ )
92 {
93 U8_TRACE_INFO( "layout_order_t" );
94 switch ( (*this_).order_type )
95 {
96 case LAYOUT_ORDER_TYPE_NONE:
97 {
98 U8_TRACE_INFO( "- order_type: LAYOUT_ORDER_TYPE_NONE" );
99 }
100 break;
101
102 case LAYOUT_ORDER_TYPE_X_Y:
103 {
104 U8_TRACE_INFO( "- order_type: LAYOUT_ORDER_TYPE_X_Y" );
105 }
106 break;
107
108 case LAYOUT_ORDER_TYPE_LIST:
109 {
110 U8_TRACE_INFO( "- order_type: LAYOUT_ORDER_TYPE_LIST" );
111 }
112 break;
113
114 default:
115 {
116 U8_TRACE_INFO( "- order_type: <error>" );
117 }
118 break;
119 }
120 U8_TRACE_INFO_INT( "- first:", (*this_).first );
121 U8_TRACE_INFO_INT( "- second:", (*this_).second );
122 }
123
124
125 /*
126 Copyright 2025-2026 Andreas Warnke
127
128 Licensed under the Apache License, Version 2.0 (the "License");
129 you may not use this file except in compliance with the License.
130 You may obtain a copy of the License at
131
132 http://www.apache.org/licenses/LICENSE-2.0
133
134 Unless required by applicable law or agreed to in writing, software
135 distributed under the License is distributed on an "AS IS" BASIS,
136 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137 See the License for the specific language governing permissions and
138 limitations under the License.
139 */