acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa__impl.h
1#pragma once
2
3//
4//#include "_rect_impl.h"
5//#include "_size_impl.h"
6//
7
8//template < prototype_point POINT >
9//inline constexpr auto __horz(const POINT & point) { return point.x; }
10//template < prototype_point POINT >
11//inline constexpr auto __vert(const POINT & point) { return point.y; }
12//template < prototype_size SIZE >
13//inline constexpr auto __horz(const SIZE & size) { return size.cx; }
14//template < prototype_size SIZE >
15//inline constexpr auto __vert(const SIZE & size) { return size.cy; }
16//
17//inline i32_point& top_left(const ::i32_rectangle* prectangle) { return *(i32_point*)prectangle; }
18//inline i32_point& bottom_right(const ::i32_rectangle* prectangle) { return *(i32_point*)& prectangle->right; }
19//inline i32_point& top_left(const ::i32_rectangle& rectangle) { return top_left(&rectangle); }
20//inline i32_point& bottom_right(const ::i32_rectangle& rectangle) { return bottom_right(&rectangle); }
21//
22//
23//inline i64_point& top_left(const ::i64_rectangle* prectangle) { return *(i64_point*)prectangle; }
24//inline i64_point& bottom_right(const ::i64_rectangle* prectangle) { return *(i64_point*)& prectangle->right; }
25//inline i64_point& top_left(const ::i64_rectangle& rectangle) { return top_left(&rectangle); }
26//inline i64_point& bottom_right(const ::i64_rectangle& rectangle) { return bottom_right(&rectangle); }
27//
28//
29//inline ::f64_point& top_left(const ::f64_rectangle* prectangle) { return *(::f64_point*)prectangle; }
30//inline ::f64_point& bottom_right(const ::f64_rectangle* prectangle) { return *(::f64_point*)& prectangle->right; }
31//inline ::f64_point& top_left(const ::f64_rectangle& rectangle) { return top_left(&rectangle); }
32//inline ::f64_point& bottom_right(const ::f64_rectangle& rectangle) { return bottom_right(&rectangle); }
33
34
35//template < typename X, typename Y >
36//inline auto get_dimension(enum_orientation eorientation, X x, Y y)
37//{
38//
39// if (eorientation == e_orientation_horizontal)
40// {
41//
42// return x;
43//
44// }
45// else if (eorientation == e_orientation_vertical)
46// {
47//
48// return y;
49//
50// }
51// else
52// {
53//
54// throw ::exception(error_bad_argument, "invalid orientation");
55//
56// }
57//
58//}
59//
60//
61//template < typename X, typename Y >
62//inline auto get_normal_dimension(enum_orientation eorientation, X x, Y y)
63//{
64//
65// if (eorientation == e_orientation_vertical)
66// {
67//
68// return x;
69//
70// }
71// else if (eorientation == e_orientation_horizontal)
72// {
73//
74// return y;
75//
76// }
77// else
78// {
79//
80// throw ::exception(error_bad_argument, "invalid orientation");
81//
82// }
83//
84//}
85//
86//
93//
94//
95//template < typename UNIT_TYPE >
96//inline UNIT_TYPE __conv(const ::scoped_string & scopedstr)
97//{
98//
99// return (UNIT_TYPE) str;
100//
101//}
102//
103//
104//template < >
105//inline ::i32 __conv<::i32>(const ::scoped_string & scopedstr)
106//{
107//
108// return (::i32) ::atoi(str);
109//
110//}
111//
112//
113//template < >
114//inline ::i64 __conv<::i64>(const ::scoped_string & scopedstr)
115//{
116//
117// return (::i32) ::atoi(str);
118//
119//}
120//
121//
122//template < >
123//inline ::f64 __conv<::f64>(const ::scoped_string & scopedstr)
124//{
125//
126// return (::i32) ::atoi(str);
127//
128//}
129//
130//
131//template < typename TYPE >
132//inline string __xmlpri()
133//{
134//
135// return "%";
136//
137//}
138//
139//
140//template < >
141//inline string __xmlpri<::i32>()
142//{
143//
144// return "%" PRId32;
145//
146//}
147//
148//
149//template < >
150//inline string __xmlpri<::i64>()
151//{
152//
153// return "%" PRId64;
154//
155//}
156//
157//
158//template < >
159//inline string __xmlpri<::f64>()
160//{
161//
162// return "%f";
163//
164//}
165//
166//
167//template < typename HOLDEE >
168//inline ::pointer<___shape<HOLDEE >> __create_shape(const enum_shape& eshape)
169//{
170//
171// switch (eshape)
172// {
173// case e_shape_none:
174// return nullptr;
175// case e_shape_begin_clip:
176// return allocateø begin_clip_shape<HOLDEE> ();
177// case e_shape_intersect_clip:
178// return allocateø intersect_clip_shape<HOLDEE> ();
179// case e_shape_begin_figure:
180// return allocateø begin_figure_shape<HOLDEE> ();
181// case e_shape_close_figure:
182// return allocateø close_figure_shape<HOLDEE> ();
183// case e_shape_end_figure:
184// return allocateø end_figure_shape<HOLDEE> ();
185// default:
186// throw ::exception(error_not_implemented, "aaa_primitive_new geometry processor or not a geometry processor?");
187// return nullptr;
188// }
189//
190//}
191//namespace geometry
192//{
193//
194// //////////////////////////////////////////////////////////////////////
195// //
196// // Function Name: deflate
197// //
198// // Purpose:
199// // Change rectangle dimension using its dimensions and the specified
200// // rates. For example, the dLeftRate machine the left position of the
201// // rectangle. If 0.0, it remains the same as the original left.
202// // If 1.0, it turns as the original right. If 0.4, it will be 40%
203// // of the width from left to right.
204// //
205// // Output:
206// // -1 if the creation of the ::user::impact failed.
207// // 0 if the creation of the ::user::impact succeeded.
208// //
209// // Author:
210// // Vanessa Testoni
211// //
212// //
213// //////////////////////////////////////////////////////////////////////
214// template < prototype_rectangle RECTANGLE >
215// inline void deflate(RECTANGLE* prectangle, ::f64 dLeftRate, ::f64 dRightRate, ::f64 dTopRate, ::f64 dBottomRate)
216// {
217//
218// auto rectangle = *prectangle;
219//
220// prectangle->left = range_rate(rectangle.left, rectangle.right, dLeftRate);
221//
222// prectangle->right = range_rate(rectangle.right, rectangle.left, dRightRate);
223//
224// prectangle->top = range_rate(rectangle.top, rectangle.bottom, dTopRate);
225//
226// prectangle->bottom = range_rate(rectangle.bottom, rectangle.top, dBottomRate);
227//
228// }
229//
230//
231//} // namespace geometry
232//
233//
234//template < prototype_point POINT >
235//inline ::string as_string(const POINT & point)
236//{
237//
238// str = as_string(point.x) + ", " + as_string(point.y);
239//
240//}
241//
242//
243//template < prototype_size SIZE >
244//inline ::string as_string(const SIZE & size)
245//{
246//
247// str = as_string(size.cx) + ", " + as_string(size.cy);
248//
249//}