Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
b4a9d929
Commit
b4a9d929
authored
May 23, 2021
by
Maxime Perrotin
Browse files
Provide the interface coordinates to templates
parent
55ac29a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/taste-interface_view.adb
View file @
b4a9d929
...
...
@@ -1056,9 +1056,9 @@ package body TASTE.Interface_View is
for
Each
of
F
.
Provided
loop
-- Note: some backends need to have access to the function
-- user defined properties, and implementation language
-- They are added here.
At the moment t
he user-defined properties
-- of the interfaces themselves are
not
part of the template
--
This could be be added later if needed.
-- They are added here.
T
he user-defined properties
-- of the interfaces themselves are
also
part of the template
--
with the IF_ prefix (see in Interface_To_Template)
Interface_Tmplt
:=
Join_Sets
(
Each
.
Interface_To_Template
,
Properties_To_Template
(
F
.
User_Properties
))
...
...
@@ -1339,6 +1339,7 @@ package body TASTE.Interface_View is
Remote_Function_Names
,
Remote_Interface_Names
,
Remote_Languages
:
Vector_Tag
;
X
,
Y
:
Unbounded_String
:=
US
(
"0"
);
-- interface graphical coordinates
TI_Language
:
constant
String
:=
Map_Language
(
To_String
(
TI
.
Language
));
begin
for
Each
of
TI
.
Params
loop
...
...
@@ -1358,6 +1359,26 @@ package body TASTE.Interface_View is
Remote_Languages
:=
Remote_Languages
&
Each
.
Language
;
end
loop
;
-- Get the graphical coordinates of the interface
for
P
of
TI
.
User_Properties
loop
if
P
.
Name
=
"Taste::coordinates"
then
-- P.Value = x y
declare
Subs
:
String_Split
.
Slice_Set
;
Seps
:
constant
String
:=
" "
;
begin
String_Split
.
Create
(
S
=>
Subs
,
From
=>
To_String
(
P
.
Value
),
Separators
=>
Seps
,
Mode
=>
String_Split
.
Multiple
);
if
Integer
(
String_Split
.
Slice_Count
(
Subs
))
=
2
then
X
:=
US
(
String_Split
.
Slice
(
Subs
,
1
));
Y
:=
US
(
String_Split
.
Slice
(
Subs
,
2
));
end
if
;
end
;
end
if
;
end
loop
;
return
Properties_To_Template
(
TI
.
User_Properties
,
Prefix
=>
"IF_"
)
&
Assoc
(
"Name"
,
TI
.
Name
)
...
...
@@ -1376,6 +1397,8 @@ package body TASTE.Interface_View is
&
Assoc
(
"Remote_Function_Names"
,
Remote_Function_Names
)
&
Assoc
(
"Remote_Interface_Names"
,
Remote_Interface_Names
)
&
Assoc
(
"Remote_Languages"
,
Remote_Languages
)
&
Assoc
(
"Coord.X"
,
X
)
&
Assoc
(
"Coord.Y"
,
Y
)
&
Assoc
(
"Is_Timer"
,
TI
.
Is_Timer
);
end
Interface_To_Template
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment