Debian Codegraph @

src/ui/castleuicontrols_serialize.inc

raw
1 {%MainUnit castleuicontrols.pas}
2 {
3 Copyright 2018-2021 Michalis Kamburelis.
4
5 This file is part of "Castle Game Engine".
6
7 "Castle Game Engine" is free software; see the file COPYING.txt,
8 included in this distribution, for details about the copyright.
9
10 "Castle Game Engine" is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 ----------------------------------------------------------------------------
15 }
16
17 { Integration of TCastleUserInterface with CastleComponentSerialize. }
18
19 {$ifdef read_interface}
20
21 { Save / load TCastleUserInterface (or descendant) to a .castle-user-interface file. }
22 procedure UserInterfaceSave(const C: TCastleUserInterface; const Url: String);
23 function UserInterfaceLoad(const Url: String; const Owner: TComponent): TCastleUserInterface;
24
25 {$endif read_interface}
26
27 {$ifdef read_implementation}
28
29 procedure UserInterfaceSave(const C: TCastleUserInterface; const Url: String);
30 begin
31 ComponentSave(C, Url);
32 end;
33
34 function UserInterfaceLoad(const Url: String; const Owner: TComponent): TCastleUserInterface;
35 begin
36 Result := ComponentLoad(Url, Owner) as TCastleUserInterface;
37 end;
38
39 {$endif read_implementation}