|
class Block * | get_top_block () override |
|
class Rules * | get_rules () override |
|
class GridSettings * | get_grid_settings () override |
|
class IPool & | get_pool () override |
|
class IPool & | get_pool_caching () override |
|
virtual ObjectType | get_object_type () const =0 |
|
void | rebuild (const std::string &comment) |
| Expands the non-working document.
|
|
ToolResponse | tool_begin (ToolID tool_id, const ToolArgs &args, class ImpInterface *imp, bool transient=false) |
|
ToolResponse | tool_update (ToolArgs &args) |
|
std::optional< ToolArgs > | get_pending_tool_args () |
|
std::pair< bool, bool > | tool_can_begin (ToolID tool_id, const std::set< SelectableRef > &selection) |
|
void | save () |
|
void | autosave () |
|
virtual void | delete_autosave ()=0 |
|
void | undo () |
|
void | redo () |
|
bool | can_undo () const |
|
bool | can_redo () const |
|
const std::string & | get_undo_comment () const |
|
const std::string & | get_redo_comment () const |
|
void | set_history_max (unsigned int m) |
|
void | set_history_never_forgets (bool x) |
|
bool | tool_is_active () |
|
virtual bool | set_property (ObjectType type, const UUID &uu, ObjectProperty::ID property, const class PropertyValue &value) |
|
virtual bool | get_property (ObjectType type, const UUID &uu, ObjectProperty::ID property, class PropertyValue &value) |
|
virtual bool | get_property_meta (ObjectType type, const UUID &uu, ObjectProperty::ID property, class PropertyMeta &meta) |
|
void | set_property_begin () |
|
void | set_property_commit () |
|
bool | get_property_transaction () const |
|
virtual json | get_meta () |
|
virtual void | update_rules () |
|
virtual std::pair< Coordi, Coordi > | get_bbox ()=0 |
|
std::set< SelectableRef > & | get_tool_selection () |
|
std::set< InToolActionID > | get_tool_actions () const |
|
bool | get_needs_save () const |
|
void | set_needs_save () |
|
virtual const std::string & | get_filename () const =0 |
|
type_signal_tool_changed | signal_tool_changed () |
|
type_signal_rebuilt | signal_rebuilt () |
|
type_signal_rebuilt | signal_save () |
| Gets emitted right before saving.
|
|
type_signal_rebuilt | signal_modified () |
|
type_signal_rebuilt | signal_can_undo_redo () |
|
type_signal_needs_save | signal_needs_save () |
|
type_signal_load_tool_settings | signal_load_tool_settings () |
|
type_signal_save_tool_settings | signal_save_tool_settings () |
|
virtual void | reload_pool () |
|
class Junction * | insert_junction (const class UUID &uu) override |
|
class Junction * | get_junction (const UUID &uu) override |
|
void | delete_junction (const UUID &uu) override |
|
class Line * | insert_line (const UUID &uu) override |
|
class Line * | get_line (const UUID &uu) override |
|
void | delete_line (const UUID &uu) override |
|
class Arc * | insert_arc (const UUID &uu) override |
|
class Arc * | get_arc (const UUID &uu) override |
|
void | delete_arc (const UUID &uu) override |
|
class Text * | insert_text (const UUID &uu) override |
|
class Text * | get_text (const UUID &uu) override |
|
void | delete_text (const UUID &uu) override |
|
class Polygon * | insert_polygon (const UUID &uu) override |
|
class Polygon * | get_polygon (const UUID &uu) override |
|
void | delete_polygon (const UUID &uu) override |
|
class Hole * | insert_hole (const UUID &uu) override |
|
class Hole * | get_hole (const UUID &uu) override |
|
void | delete_hole (const UUID &uu) override |
|
class Dimension * | insert_dimension (const UUID &uu) override |
|
class Dimension * | get_dimension (const UUID &uu) override |
|
void | delete_dimension (const UUID &uu) override |
|
class Keepout * | insert_keepout (const UUID &uu) override |
|
class Keepout * | get_keepout (const UUID &uu) override |
|
void | delete_keepout (const UUID &uu) override |
|
class Picture * | insert_picture (const UUID &uu) override |
|
class Picture * | get_picture (const UUID &uu) override |
|
void | delete_picture (const UUID &uu) override |
|
std::vector< Line * > | get_lines () override |
|
std::vector< Arc * > | get_arcs () override |
|
std::vector< Keepout * > | get_keepouts () override |
|
std::string | get_display_name (ObjectType type, const UUID &uu) override |
|
std::string | get_display_name (ObjectType type, const UUID &uu, const UUID &sheet) override |
|
virtual bool | has_object_type (ObjectType ty) const =0 |
|
virtual class LayerProvider & | get_layer_provider ()=0 |
|
virtual const class FileVersion & | get_version () const =0 |
|
|
| Core (class IPool &pool, IPool *m_pool_caching) |
|
void | set_needs_save (bool v) |
|
void | rebuild_finish (bool from_undo, const std::string &comment) |
|
virtual std::unique_ptr< HistoryManager::HistoryItem > | make_history_item (const std::string &comment)=0 |
|
virtual void | history_load (const HistoryManager::HistoryItem &it)=0 |
|
virtual std::string | get_history_comment_context () const |
|
void | layers_to_meta (class PropertyMeta &meta) |
|
void | get_placement (const Placement &placement, class PropertyValue &value, ObjectProperty::ID property) |
|
void | set_placement (Placement &placement, const class PropertyValue &value, ObjectProperty::ID property) |
|
virtual void | save (const std::string &suffix)=0 |
|
json | get_meta_from_file (const std::string &filename) |
|
virtual std::map< UUID, Junction > * | get_junction_map () |
|
virtual std::map< UUID, Line > * | get_line_map () |
|
virtual std::map< UUID, Arc > * | get_arc_map () |
|
virtual std::map< UUID, Text > * | get_text_map () |
|
virtual std::map< UUID, Polygon > * | get_polygon_map () |
|
virtual std::map< UUID, Hole > * | get_hole_map () |
|
virtual std::map< UUID, Dimension > * | get_dimension_map () |
|
virtual std::map< UUID, Keepout > * | get_keepout_map () |
|
virtual std::map< UUID, Picture > * | get_picture_map () |
|
Where Tools and and documents meet.
The Core provides a unified interface for Tools to access the objects common to all documents (whatever is being edited). It also provides the property interface for the property editor.
A Core always stores to copies of the document, one of which is the working copy. Tools always operate on this one. Tools use Core::commit() to commit their changes by replacing the non-working document with the working document. Core::revert() does the opposite thing by replacing the working document with the non-working document, thereby discarding the changes made to the working copy. Usually, calling Core::commit() or Core::revert() is the last thing a Tool does before finishing.
After a Tool has finished its work by returning ToolResponse::end(), the Core will initiate a rebuild. For CoreSchematic, a rebuild will update the Schematic according to its Block.
The Core also handles undo/redo by storing a full copy for each step.