2013-06-27 00:57:25 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2015-09-30 01:26:49 +00:00
|
|
|
use construct::ConstructionResult;
|
2016-10-09 06:37:42 +00:00
|
|
|
use script_layout_interface::PartialPersistentLayoutData;
|
2013-11-13 08:07:16 +00:00
|
|
|
|
|
|
|
/// Data that layout associates with a node.
|
2016-10-03 02:24:11 +00:00
|
|
|
pub struct PersistentLayoutData {
|
2016-10-09 06:37:42 +00:00
|
|
|
/// Data accessed by script_layout_interface. This must be first to allow
|
|
|
|
/// casting between PersistentLayoutData and PartialPersistentLayoutData.
|
|
|
|
pub base: PartialPersistentLayoutData,
|
2013-11-13 08:07:16 +00:00
|
|
|
|
2016-04-29 21:27:16 +00:00
|
|
|
/// The current results of flow construction for this node. This is either a
|
|
|
|
/// flow or a `ConstructionItem`. See comments in `construct.rs` for more
|
|
|
|
/// details.
|
2014-04-27 22:52:39 +00:00
|
|
|
pub flow_construction_result: ConstructionResult,
|
2014-01-30 20:10:35 +00:00
|
|
|
|
2014-04-27 22:52:39 +00:00
|
|
|
pub before_flow_construction_result: ConstructionResult,
|
2014-04-04 01:01:48 +00:00
|
|
|
|
2014-04-27 22:52:39 +00:00
|
|
|
pub after_flow_construction_result: ConstructionResult,
|
2014-04-04 01:01:48 +00:00
|
|
|
|
2016-03-20 07:57:59 +00:00
|
|
|
pub details_summary_flow_construction_result: ConstructionResult,
|
|
|
|
|
|
|
|
pub details_content_flow_construction_result: ConstructionResult,
|
|
|
|
|
2014-10-31 20:39:34 +00:00
|
|
|
/// Various flags.
|
|
|
|
pub flags: LayoutDataFlags,
|
2013-11-13 08:07:16 +00:00
|
|
|
}
|
|
|
|
|
2016-10-03 02:24:11 +00:00
|
|
|
impl PersistentLayoutData {
|
2013-11-13 08:07:16 +00:00
|
|
|
/// Creates new layout data.
|
2016-10-03 02:24:11 +00:00
|
|
|
pub fn new() -> PersistentLayoutData {
|
|
|
|
PersistentLayoutData {
|
2016-10-09 06:37:42 +00:00
|
|
|
base: PartialPersistentLayoutData::new(),
|
2014-12-18 01:45:49 +00:00
|
|
|
flow_construction_result: ConstructionResult::None,
|
|
|
|
before_flow_construction_result: ConstructionResult::None,
|
|
|
|
after_flow_construction_result: ConstructionResult::None,
|
2016-03-20 07:57:59 +00:00
|
|
|
details_summary_flow_construction_result: ConstructionResult::None,
|
|
|
|
details_content_flow_construction_result: ConstructionResult::None,
|
2014-10-31 20:39:34 +00:00
|
|
|
flags: LayoutDataFlags::empty(),
|
2013-11-13 08:07:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-31 20:39:34 +00:00
|
|
|
bitflags! {
|
2016-04-30 22:21:22 +00:00
|
|
|
pub flags LayoutDataFlags: u8 {
|
2015-09-01 14:33:02 +00:00
|
|
|
#[doc = "Whether a flow has been newly constructed."]
|
2014-11-13 03:48:31 +00:00
|
|
|
const HAS_NEWLY_CONSTRUCTED_FLOW = 0x01
|
2014-10-31 20:39:34 +00:00
|
|
|
}
|
|
|
|
}
|