| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/components/controls/control.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "control.h"cxx . . $ `<file>/src/core/components/controls/control.h`/ |
| 5 | |
| 6 | Controlcxx . . $ Control#::Controlcxx . . $ Control#Control(b66b796e0ab441d6).(bool active, bool forceClean) noexcept |
| 7 | : active_cxx . . $ Control#active_.(active) |
| 8 | , forceClean_cxx . . $ Control#forceClean_.(forceClean) |
| 9 | { |
| 10 | } |
| 11 | |
| 12 | bool Controlcxx . . $ Control#::activecxx . . $ Control#active(50ce9a9e25b4a850).() const |
| 13 | { |
| 14 | return active_cxx . . $ Control#active_.; |
| 15 | } |
| 16 | |
| 17 | void Controlcxx . . $ Control#::activatecxx . . $ Control#activate(b45ddcbc8423892c).(bool active) |
| 18 | { |
| 19 | if (active_cxx . . $ Control#active_. && !active) |
| 20 | dirtycxx . . $ Control#dirty(b45ddcbc8423892c).(true); |
| 21 | |
| 22 | active_cxx . . $ Control#active_. = active; |
| 23 | } |
| 24 | |
| 25 | void Controlcxx . . $ Control#::cleanOncecxx . . $ Control#cleanOnce(49f6e7a06ebc5aa8).() |
| 26 | { |
| 27 | dirtycxx . . $ Control#dirty(b45ddcbc8423892c).(true); |
| 28 | } |
| 29 | |
| 30 | void Controlcxx . . $ Control#::importWithcxx . . $ Control#importWith(94eddebf9440278).(Importablecxx . . $ Importable#::Importercxx . . $ Importable#Importer# &i) |
| 31 | { |
| 32 | auto importer = i.provideImportercxx . . $ Importable#Importer#provideImporter(c13a3bcac0db4745).(*this); |
| 33 | if (importer.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 34 | auto &controlImporter = dynamic_cast<IControlcxx . . $ IControl#::Importercxx . . $ IControl#Importer# &>(importer->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).()); |
| 35 | |
| 36 | activatecxx . . $ Control#activate(b45ddcbc8423892c).(controlImporter.provideActivecxx . . $ IControl#Importer#provideActive(50ce9a9e25b4a850).()); |
| 37 | importControlcxx . . $ Control#importControl(4f796e3ecd5dcd94).(controlImporter); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | void Controlcxx . . $ Control#::exportWithcxx . . $ Control#exportWith(5b5c94ff60635419).(Exportablecxx . . $ Exportable#::Exportercxx . . $ Exportable#Exporter# &e) const |
| 42 | { |
| 43 | auto exporter = e.provideExportercxx . . $ Exportable#Exporter#provideExporter(3acccbde2694e33a).(*this); |
| 44 | if (exporter.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 45 | auto &controlExporter = dynamic_cast<IControlcxx . . $ IControl#::Exportercxx . . $ IControl#Exporter# &>(exporter->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).()); |
| 46 | |
| 47 | controlExporter.takeActivecxx . . $ IControl#Exporter#takeActive(b45ddcbc8423892c).(activecxx . . $ Control#active(50ce9a9e25b4a850).()); |
| 48 | exportControlcxx . . $ Control#exportControl(40299682ab9c8676).(controlExporter); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | void Controlcxx . . $ Control#::cleancxx . . $ Control#clean(151e9138769f295e).(ICommandQueuecxx . . $ ICommandQueue# &ctlCmds) |
| 53 | { |
| 54 | if (forceClean_cxx . . $ Control#forceClean_. || dirtycxx . . $ Control#dirty(50ce9a9e25b4a850).()) { |
| 55 | cleanControlcxx . . $ Control#cleanControl(151e9138769f295e).(ctlCmds); |
| 56 | dirtycxx . . $ Control#dirty(b45ddcbc8423892c).(false); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void Controlcxx . . $ Control#::synccxx . . $ Control#sync(151e9138769f295e).(ICommandQueuecxx . . $ ICommandQueue# &ctlCmds) |
| 61 | { |
| 62 | if (activecxx . . $ Control#active(50ce9a9e25b4a850).()) |
| 63 | syncControlcxx . . $ Control#syncControl(151e9138769f295e).(ctlCmds); |
| 64 | } |
| 65 | |
| 66 | bool Controlcxx . . $ Control#::dirtycxx . . $ Control#dirty(50ce9a9e25b4a850).() const |
| 67 | { |
| 68 | return dirty_cxx . . $ Control#dirty_.; |
| 69 | } |
| 70 | |
| 71 | void Controlcxx . . $ Control#::dirtycxx . . $ Control#dirty(b45ddcbc8423892c).(bool isDirty) |
| 72 | { |
| 73 | dirty_cxx . . $ Control#dirty_. = isDirty; |
| 74 | } |