|
KiCad PCB EDA Suite
|
Common base class for API handlers that operate on a BOARD via a BOARD_CONTEXT. More...
#include <api_handler_board.h>
Public Member Functions | |
| API_HANDLER_BOARD (std::shared_ptr< BOARD_CONTEXT > aContext, EDA_BASE_FRAME *aFrame=nullptr) | |
| API_RESULT | Handle (ApiRequest &aMsg) |
| Attempt to handle the given API request, if a handler exists in this class for the message. | |
Protected Types | |
| typedef std::function< HANDLER_RESULT< ApiResponse >(ApiRequest &)> | REQUEST_HANDLER |
| A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function. | |
Protected Member Functions | |
| std::unique_ptr< COMMIT > | createCommit () override |
| Override this to create an appropriate COMMIT subclass for the frame in question. | |
| void | deleteItemsInternal (std::map< KIID, ItemDeletionStatus > &aItemsToDelete, const std::string &aClientName) override |
| std::optional< EDA_ITEM * > | getItemFromDocument (const DocumentSpecifier &aDocument, const KIID &aId) override |
| void | pushCurrentCommit (const std::string &aClientName, const wxString &aMessage) override |
| HANDLER_RESULT< types::ItemRequestStatus > | handleCreateUpdateItemsInternal (bool aCreate, const std::string &aClientName, const types::ItemHeader &aHeader, const google::protobuf::RepeatedPtrField< google::protobuf::Any > &aItems, std::function< void(commands::ItemStatus, google::protobuf::Any)> aItemHandler) override |
| BOARD_CONTEXT * | context () const |
| BOARD * | board () const |
| PROJECT & | project () const |
| TOOL_MANAGER * | toolManager () const |
| std::optional< BOARD_ITEM * > | getItemById (const KIID &aId) const |
| virtual BOARD_ITEM_CONTAINER * | getDefaultContainer () |
| std::optional< ApiResponseStatus > | checkForHeadless (const std::string &aCommandName) const |
| std::vector< KICAD_T > | parseRequestedItemTypes (const google::protobuf::RepeatedField< int > &aTypes) |
| HANDLER_RESULT< std::optional< KIID > > | validateItemHeaderDocument (const kiapi::common::types::ItemHeader &aHeader) |
| If the header is valid, returns the item container. | |
| HANDLER_RESULT< bool > | validateDocument (const DocumentSpecifier &aDocument) |
| virtual std::optional< ApiResponseStatus > | checkForBusy () |
| Checks if the editor can accept commands. | |
| HANDLER_RESULT< commands::BeginCommitResponse > | handleBeginCommit (const HANDLER_CONTEXT< commands::BeginCommit > &aCtx) |
| HANDLER_RESULT< commands::EndCommitResponse > | handleEndCommit (const HANDLER_CONTEXT< commands::EndCommit > &aCtx) |
| COMMIT * | getCurrentCommit (const std::string &aClientName) |
| HANDLER_RESULT< commands::CreateItemsResponse > | handleCreateItems (const HANDLER_CONTEXT< commands::CreateItems > &aCtx) |
| HANDLER_RESULT< commands::UpdateItemsResponse > | handleUpdateItems (const HANDLER_CONTEXT< commands::UpdateItems > &aCtx) |
| HANDLER_RESULT< commands::DeleteItemsResponse > | handleDeleteItems (const HANDLER_CONTEXT< commands::DeleteItems > &aCtx) |
| HANDLER_RESULT< commands::HitTestResponse > | handleHitTest (const HANDLER_CONTEXT< commands::HitTest > &aCtx) |
| HANDLER_RESULT< types::TitleBlockInfo > | handleGetTitleBlockInfo (const HANDLER_CONTEXT< commands::GetTitleBlockInfo > &aCtx) |
| HANDLER_RESULT< google::protobuf::Empty > | handleSetTitleBlockInfo (const HANDLER_CONTEXT< commands::SetTitleBlockInfo > &aCtx) |
| HANDLER_RESULT< types::PageSettings > | handleGetPageSettings (const HANDLER_CONTEXT< commands::GetPageSettings > &aCtx) |
| HANDLER_RESULT< types::PageSettings > | handleSetPageSettings (const HANDLER_CONTEXT< commands::SetPageSettings > &aCtx) |
| virtual types::DocumentType | thisDocumentType () const =0 |
| Override this to specify which document type this editor handles. | |
| virtual tl::expected< bool, ApiResponseStatus > | validateDocumentInternal (const DocumentSpecifier &aDocument) const =0 |
| virtual const EDA_IU_SCALE & | getIuScale () const |
| Returns the internal-unit scale that the concrete editor uses. | |
| virtual std::optional< TITLE_BLOCK * > | getTitleBlock () |
| virtual std::optional< PAGE_INFO > | getPageSettings () |
| virtual bool | setPageSettings (const PAGE_INFO &aPageInfo) |
| virtual wxString | getDrawingSheetFileName () |
| virtual void | setDrawingSheetFileName (const wxString &aFileName) |
| virtual void | onModified () |
| template<class RequestType, class ResponseType, class HandlerType> | |
| void | registerHandler (HANDLER_RESULT< ResponseType >(HandlerType::*aHandler)(const HANDLER_CONTEXT< RequestType > &)) |
| Registers an API command handler for the given message types. | |
Static Protected Member Functions | |
| static HANDLER_RESULT< std::unique_ptr< BOARD_ITEM > > | createItemForType (KICAD_T aType, BOARD_ITEM_CONTAINER *aContainer) |
Protected Attributes | |
| std::map< std::string, std::pair< KIID, std::unique_ptr< COMMIT > > > | m_commits |
| std::set< std::string > | m_activeClients |
| EDA_BASE_FRAME * | m_frame |
| std::map< std::string, REQUEST_HANDLER > | m_handlers |
| Maps type name (without the URL prefix) to a handler method. | |
Static Protected Attributes | |
| static const wxString | m_defaultCommitMessage = _( "Modification from API" ) |
Private Member Functions | |
| HANDLER_RESULT< commands::RunActionResponse > | handleRunAction (const HANDLER_CONTEXT< commands::RunAction > &aCtx) |
| HANDLER_RESULT< commands::GetItemsResponse > | handleGetItemsById (const HANDLER_CONTEXT< commands::GetItemsById > &aCtx) |
| HANDLER_RESULT< commands::SelectionResponse > | handleGetSelection (const HANDLER_CONTEXT< commands::GetSelection > &aCtx) |
| HANDLER_RESULT< Empty > | handleClearSelection (const HANDLER_CONTEXT< commands::ClearSelection > &aCtx) |
| HANDLER_RESULT< commands::SelectionResponse > | handleAddToSelection (const HANDLER_CONTEXT< commands::AddToSelection > &aCtx) |
| HANDLER_RESULT< commands::SelectionResponse > | handleRemoveFromSelection (const HANDLER_CONTEXT< commands::RemoveFromSelection > &aCtx) |
| HANDLER_RESULT< BoardStackupResponse > | handleGetStackup (const HANDLER_CONTEXT< GetBoardStackup > &aCtx) |
| HANDLER_RESULT< BoardEnabledLayersResponse > | handleGetBoardEnabledLayers (const HANDLER_CONTEXT< GetBoardEnabledLayers > &aCtx) |
| HANDLER_RESULT< GraphicsDefaultsResponse > | handleGetGraphicsDefaults (const HANDLER_CONTEXT< GetGraphicsDefaults > &aCtx) |
| HANDLER_RESULT< commands::GetBoundingBoxResponse > | handleGetBoundingBox (const HANDLER_CONTEXT< commands::GetBoundingBox > &aCtx) |
| HANDLER_RESULT< PadShapeAsPolygonResponse > | handleGetPadShapeAsPolygon (const HANDLER_CONTEXT< GetPadShapeAsPolygon > &aCtx) |
| HANDLER_RESULT< PadstackPresenceResponse > | handleCheckPadstackPresenceOnLayers (const HANDLER_CONTEXT< CheckPadstackPresenceOnLayers > &aCtx) |
| HANDLER_RESULT< commands::ExpandTextVariablesResponse > | handleExpandTextVariables (const HANDLER_CONTEXT< commands::ExpandTextVariables > &aCtx) |
| HANDLER_RESULT< Empty > | handleInteractiveMoveItems (const HANDLER_CONTEXT< InteractiveMoveItems > &aCtx) |
| HANDLER_RESULT< commands::SavedDocumentResponse > | handleSaveDocumentToString (const HANDLER_CONTEXT< commands::SaveDocumentToString > &aCtx) |
| HANDLER_RESULT< commands::SavedSelectionResponse > | handleSaveSelectionToString (const HANDLER_CONTEXT< commands::SaveSelectionToString > &aCtx) |
| HANDLER_RESULT< commands::CreateItemsResponse > | handleParseAndCreateItemsFromString (const HANDLER_CONTEXT< commands::ParseAndCreateItemsFromString > &aCtx) |
| HANDLER_RESULT< BoardLayers > | handleGetVisibleLayers (const HANDLER_CONTEXT< GetVisibleLayers > &aCtx) |
| HANDLER_RESULT< Empty > | handleSetVisibleLayers (const HANDLER_CONTEXT< SetVisibleLayers > &aCtx) |
| HANDLER_RESULT< BoardLayerResponse > | handleGetActiveLayer (const HANDLER_CONTEXT< GetActiveLayer > &aCtx) |
| HANDLER_RESULT< Empty > | handleSetActiveLayer (const HANDLER_CONTEXT< SetActiveLayer > &aCtx) |
| template<typename MessageType> | |
| bool | tryUnpack (ApiRequest &aRequest, ApiResponse &aReply, MessageType &aDest) |
Private Attributes | |
| std::shared_ptr< BOARD_CONTEXT > | m_context |
Common base class for API handlers that operate on a BOARD via a BOARD_CONTEXT.
Shared by both the PCB editor and the footprint editor.
Definition at line 53 of file api_handler_board.h.
|
protectedinherited |
A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function.
Definition at line 76 of file api_handler.h.
| API_HANDLER_BOARD::API_HANDLER_BOARD | ( | std::shared_ptr< BOARD_CONTEXT > | aContext, |
| EDA_BASE_FRAME * | aFrame = nullptr ) |
Definition at line 52 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::API_HANDLER_EDITOR(), handleAddToSelection(), handleCheckPadstackPresenceOnLayers(), handleClearSelection(), handleExpandTextVariables(), handleGetActiveLayer(), handleGetBoardEnabledLayers(), handleGetBoundingBox(), handleGetGraphicsDefaults(), handleGetItemsById(), handleGetPadShapeAsPolygon(), handleGetSelection(), handleGetStackup(), handleGetVisibleLayers(), handleInteractiveMoveItems(), handleParseAndCreateItemsFromString(), handleRemoveFromSelection(), handleRunAction(), handleSaveDocumentToString(), handleSaveSelectionToString(), handleSetActiveLayer(), handleSetVisibleLayers(), m_context, move, and API_HANDLER::registerHandler().
Referenced by API_HANDLER_FOOTPRINT::API_HANDLER_FOOTPRINT(), and API_HANDLER_PCB::API_HANDLER_PCB().
|
inlineprotected |
Definition at line 78 of file api_handler_board.h.
References context(), and BOARD_CONTEXT::GetBoard().
Referenced by deleteItemsInternal(), getDefaultContainer(), API_HANDLER_FOOTPRINT::getDefaultContainer(), getItemById(), handleCreateUpdateItemsInternal(), handleExpandTextVariables(), API_HANDLER_PCB::handleGetBoardDesignRules(), handleGetBoardEnabledLayers(), API_HANDLER_PCB::handleGetBoardLayerName(), API_HANDLER_PCB::handleGetBoardOrigin(), API_HANDLER_PCB::handleGetConnectedItems(), handleGetGraphicsDefaults(), API_HANDLER_FOOTPRINT::handleGetItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_PCB::handleGetNetClassForNets(), API_HANDLER_PCB::handleGetNets(), handleGetStackup(), handleGetVisibleLayers(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_PCB::handleSaveCopyOfDocument(), handleSaveDocumentToString(), handleSaveSelectionToString(), handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardDesignRules(), API_HANDLER_PCB::handleSetBoardEnabledLayers(), handleSetVisibleLayers(), and API_HANDLER_FOOTPRINT::validateAndGetFootprint().
|
protectedvirtualinherited |
Checks if the editor can accept commands.
Definition at line 222 of file api_handler_editor.cpp.
References m_frame.
Referenced by API_HANDLER_BOARD::handleAddToSelection(), handleBeginCommit(), API_HANDLER_BOARD::handleClearSelection(), handleCreateItems(), handleDeleteItems(), handleEndCommit(), API_HANDLER_BOARD::handleGetBoundingBox(), API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_FOOTPRINT::handleGetItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_BOARD::handleGetItemsById(), API_HANDLER_SCH::handleGetItemsById(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_SCH::handleGetSchematicNetlist(), handleHitTest(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_BOARD::handleInteractiveMoveItems(), API_HANDLER_BOARD::handleParseAndCreateItemsFromString(), API_HANDLER_PCB::handleRefillZones(), API_HANDLER_BOARD::handleRemoveFromSelection(), API_HANDLER_FOOTPRINT::handleRevertDocument(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_BOARD::handleRunAction(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportDxf(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), API_HANDLER_SCH::handleRunSchematicJobExportPdf(), API_HANDLER_SCH::handleRunSchematicJobExportPs(), API_HANDLER_SCH::handleRunSchematicJobExportSvg(), API_HANDLER_PCB::handleSaveCopyOfDocument(), API_HANDLER_PCB::handleSaveDocument(), API_HANDLER_BOARD::handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardEditorAppearanceSettings(), API_HANDLER_PCB::handleSetBoardOrigin(), API_HANDLER_BOARD::handleSetVisibleLayers(), handleUpdateItems(), and API_HANDLER_FOOTPRINT::validateAndGetFootprint().
|
protected |
Definition at line 97 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::m_frame.
Referenced by handleAddToSelection(), handleClearSelection(), handleGetActiveLayer(), API_HANDLER_PCB::handleGetBoardEditorAppearanceSettings(), handleGetSelection(), handleGetVisibleLayers(), handleInteractiveMoveItems(), handleRemoveFromSelection(), API_HANDLER_PCB::handleRevertDocument(), handleRunAction(), handleSaveSelectionToString(), handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardEditorAppearanceSettings(), and handleSetVisibleLayers().
|
inlineprotected |
Definition at line 76 of file api_handler_board.h.
References m_context.
Referenced by board(), API_HANDLER_FOOTPRINT::footprintContext(), API_HANDLER_PCB::getPageSettings(), API_HANDLER_PCB::getTitleBlock(), API_HANDLER_PCB::pcbContext(), project(), API_HANDLER_PCB::setPageSettings(), and toolManager().
|
overrideprotectedvirtual |
Override this to create an appropriate COMMIT subclass for the frame in question.
Implements API_HANDLER_EDITOR.
Definition at line 126 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::m_frame, and toolManager().
|
staticprotected |
Definition at line 146 of file api_handler_board.cpp.
References CreateItemForType(), EDA_ITEM::GetFriendlyName(), PCB_FOOTPRINT_T, and PCB_PAD_T.
Referenced by handleCreateUpdateItemsInternal().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 189 of file api_handler_board.cpp.
References _, board(), API_HANDLER_EDITOR::getCurrentCommit(), API_HANDLER_EDITOR::m_activeClients, pushCurrentCommit(), and COMMIT::Remove().
|
protectedinherited |
Definition at line 152 of file api_handler_editor.cpp.
References createCommit(), and m_commits.
Referenced by API_HANDLER_BOARD::deleteItemsInternal(), API_HANDLER_SCH::deleteItemsInternal(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_PCB::handleInjectDrcError(), and API_HANDLER_BOARD::handleInteractiveMoveItems().
|
protectedvirtual |
Reimplemented in API_HANDLER_FOOTPRINT.
Definition at line 110 of file api_handler_board.cpp.
References board().
Referenced by handleCreateUpdateItemsInternal().
|
inlineprotectedvirtualinherited |
Reimplemented in API_HANDLER_PCB, and API_HANDLER_SCH.
Definition at line 138 of file api_handler_editor.h.
Referenced by handleGetPageSettings(), and handleSetPageSettings().
|
protected |
Definition at line 135 of file api_handler_board.cpp.
References board(), and BOARD::ResolveItem().
Referenced by getItemFromDocument(), handleAddToSelection(), handleCheckPadstackPresenceOnLayers(), handleCreateUpdateItemsInternal(), handleGetBoundingBox(), API_HANDLER_PCB::handleGetConnectedItems(), handleGetItemsById(), handleGetPadShapeAsPolygon(), handleInteractiveMoveItems(), and handleRemoveFromSelection().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 217 of file api_handler_board.cpp.
References getItemById(), and API_HANDLER_EDITOR::validateDocument().
|
inlineprotectedvirtualinherited |
Returns the internal-unit scale that the concrete editor uses.
API wire coordinates are always in nanometers, so this scale drives conversion to the editor's native IU. Defaults to pcbIUScale; schematic-like editors must override.
Reimplemented in API_HANDLER_SCH.
Definition at line 116 of file api_handler_editor.h.
References pcbIUScale.
Referenced by handleHitTest().
|
inlineprotectedvirtualinherited |
Reimplemented in API_HANDLER_PCB, and API_HANDLER_SCH.
Definition at line 134 of file api_handler_editor.h.
Referenced by handleGetPageSettings(), and handleSetPageSettings().
|
inlineprotectedvirtualinherited |
Reimplemented in API_HANDLER_PCB, and API_HANDLER_SCH.
Definition at line 132 of file api_handler_editor.h.
Referenced by handleGetTitleBlockInfo(), and handleSetTitleBlockInfo().
|
inherited |
Attempt to handle the given API request, if a handler exists in this class for the message.
| aMsg | is a request to attempt to handle |
Definition at line 30 of file api_handler.cpp.
References m_handlers.
|
private |
Definition at line 568 of file api_handler_board.cpp.
References SELECTION_TOOL::AddItemsToSel(), API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), getItemById(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), API_HANDLER_EDITOR::m_frame, HANDLER_CONTEXT< RequestMessageType >::Request, toolManager(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 48 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, createCommit(), m_activeClients, m_commits, HANDLER_CONTEXT< RequestMessageType >::Request, and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 824 of file api_handler_board.cpp.
References FromProtoEnum(), getItemById(), pad, PCB_PAD_T, PCB_VIA_T, HANDLER_CONTEXT< RequestMessageType >::Request, BASE_SET::set(), ToProtoEnum(), API_HANDLER_EDITOR::validateDocument(), and via.
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 543 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), API_HANDLER_EDITOR::m_frame, HANDLER_CONTEXT< RequestMessageType >::Request, TOOL_MANAGER::RunAction(), ACTIONS::selectionClear, toolManager(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 239 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, handleCreateUpdateItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, and result.
Referenced by API_HANDLER_EDITOR().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 227 of file api_handler_board.cpp.
References _, COMMIT::Add(), EDA_GROUP::AddItem(), KIID::AsStdString(), board(), BOARD_ITEM::CopyFrom(), createItemForType(), API_HANDLER_EDITOR::getCurrentCommit(), getDefaultContainer(), getItemById(), EDA_ITEM::GetParentGroup(), API_HANDLER_EDITOR::m_activeClients, COMMIT::Modify(), PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_RADIAL_T, PCB_DIMENSION_T, PCB_FOOTPRINT_T, PCB_GROUP_T, pushCurrentCommit(), RECURSE, COMMIT::Remove(), BOARD_ITEM::ResetUuid(), SERIALIZABLE::Serialize(), EDA_ITEM::Type(), kiapi::common::TypeNameFromAny(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
|
protectedinherited |
Definition at line 293 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, deleteItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, result, and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
protectedinherited |
Definition at line 86 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, m_activeClients, m_commits, pushCurrentCommit(), HANDLER_CONTEXT< RequestMessageType >::Request, and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 891 of file api_handler_board.cpp.
References board(), ExpandTextVars(), HANDLER_CONTEXT< RequestMessageType >::Request, text, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 1086 of file api_handler_board.cpp.
References checkForHeadless(), PCB_BASE_FRAME::GetActiveLayer(), API_HANDLER_EDITOR::m_frame, HANDLER_CONTEXT< RequestMessageType >::Request, ToProtoEnum(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 679 of file api_handler_board.cpp.
References LSET::AllCuMask(), board(), kiapi::board::PackLayerSet(), HANDLER_CONTEXT< RequestMessageType >::Request, Rescue, BASE_SET::reset(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 748 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), EDA_ITEM::GetBoundingBox(), getItemById(), kiapi::common::PackBox2(), PCB_FOOTPRINT_T, HANDLER_CONTEXT< RequestMessageType >::Request, EDA_ITEM::Type(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 708 of file api_handler_board.cpp.
References board(), BOARD::GetDesignSettings(), LAYER_CLASS_COUNT, BOARD_DESIGN_SETTINGS::m_LineThickness, BOARD_DESIGN_SETTINGS::m_TextItalic, BOARD_DESIGN_SETTINGS::m_TextSize, BOARD_DESIGN_SETTINGS::m_TextThickness, BOARD_DESIGN_SETTINGS::m_TextUpright, HANDLER_CONTEXT< RequestMessageType >::Request, text, API_HANDLER_EDITOR::validateDocument(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 466 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), getItemById(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 789 of file api_handler_board.cpp.
References SHAPE_POLY_SET::COutline(), ERROR_INSIDE, FromProtoEnum(), getItemById(), kiapi::common::PackPolyLine(), pad, PCB_PAD_T, HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 488 of file api_handler_editor.cpp.
References getDrawingSheetFileName(), getPageSettings(), PAGE_INFO::GetSizeIU(), PAGE_INFO::GetType(), PAGE_INFO::IsCustom(), PAGE_INFO::IsPortrait(), kiapi::common::PackVector2(), pcbIUScale, HANDLER_CONTEXT< RequestMessageType >::Request, ToProtoEnum(), and validateDocument().
Referenced by API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().
|
private |
Definition at line 509 of file api_handler_board.cpp.
References checkForHeadless(), filter, PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), parseRequestedItemTypes(), HANDLER_CONTEXT< RequestMessageType >::Request, toolManager(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 648 of file api_handler_board.cpp.
References board(), FromProtoEnum(), BOARD::GetStackupOrDefault(), HANDLER_CONTEXT< RequestMessageType >::Request, BOARD_STACKUP::Serialize(), UNDEFINED_LAYER, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 399 of file api_handler_editor.cpp.
References TITLE_BLOCK::GetComment(), TITLE_BLOCK::GetCompany(), TITLE_BLOCK::GetDate(), TITLE_BLOCK::GetRevision(), TITLE_BLOCK::GetTitle(), getTitleBlock(), HANDLER_CONTEXT< RequestMessageType >::Request, and validateDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 1030 of file api_handler_board.cpp.
References board(), checkForHeadless(), HANDLER_CONTEXT< RequestMessageType >::Request, ToProtoEnum(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 342 of file api_handler_editor.cpp.
References checkForBusy(), getItemFromDocument(), getIuScale(), HANDLER_CONTEXT< RequestMessageType >::Request, scale, kiapi::common::UnpackVector2(), and validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 919 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), HANDLER_CONTEXT< RequestMessageType >::ClientName, API_HANDLER_EDITOR::getCurrentCommit(), getItemById(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), PCB_ACTIONS::move, TOOL_MANAGER::PostAPIAction(), HANDLER_CONTEXT< RequestMessageType >::Request, TOOL_MANAGER::RunAction(), ACTIONS::selectionClear, ACTIONS::selectItems, SELECTION::SetReferencePoint(), toolManager(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 1014 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 608 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), getItemById(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), API_HANDLER_EDITOR::m_frame, SELECTION_TOOL::RemoveItemsFromSel(), HANDLER_CONTEXT< RequestMessageType >::Request, toolManager(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 446 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), HANDLER_CONTEXT< RequestMessageType >::Request, and toolManager().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 964 of file api_handler_board.cpp.
References board(), HANDLER_CONTEXT< RequestMessageType >::Request, CLIPBOARD_IO::SaveBoard(), CLIPBOARD_IO::SetWriter(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 988 of file api_handler_board.cpp.
References board(), checkForHeadless(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), CLIPBOARD_IO::SaveSelection(), CLIPBOARD_IO::SetBoard(), CLIPBOARD_IO::SetWriter(), and toolManager().
Referenced by API_HANDLER_BOARD().
|
private |
Definition at line 1107 of file api_handler_board.cpp.
References board(), API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), FromProtoEnum(), API_HANDLER_EDITOR::m_frame, HANDLER_CONTEXT< RequestMessageType >::Request, PCB_BASE_FRAME::SetActiveLayer(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 522 of file api_handler_editor.cpp.
References FromProtoEnum(), getDrawingSheetFileName(), getPageSettings(), PAGE_INFO::GetSizeIU(), PAGE_INFO::GetType(), PAGE_INFO::IsCustom(), PAGE_INFO::IsPortrait(), onModified(), kiapi::common::PackVector2(), pcbIUScale, HANDLER_CONTEXT< RequestMessageType >::Request, PAGE_INFO::SetCustomHeightMils(), PAGE_INFO::SetCustomWidthMils(), setDrawingSheetFileName(), setPageSettings(), PAGE_INFO::SetType(), ToProtoEnum(), kiapi::common::UnpackVector2(), User, validateDocument(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().
|
protectedinherited |
Definition at line 439 of file api_handler_editor.cpp.
References getTitleBlock(), onModified(), HANDLER_CONTEXT< RequestMessageType >::Request, TITLE_BLOCK::SetComment(), TITLE_BLOCK::SetCompany(), TITLE_BLOCK::SetDate(), TITLE_BLOCK::SetRevision(), TITLE_BLOCK::SetTitle(), and validateDocument().
Referenced by API_HANDLER_EDITOR().
|
private |
Definition at line 1050 of file api_handler_board.cpp.
References board(), API_HANDLER_EDITOR::checkForBusy(), checkForHeadless(), LSET::Contains(), FromProtoEnum(), PCB_BASE_EDIT_FRAME::GetAppearancePanel(), PCB_BASE_FRAME::GetCanvas(), BOARD::GetEnabledLayers(), API_HANDLER_EDITOR::m_frame, APPEARANCE_CONTROLS::OnBoardChanged(), HANDLER_CONTEXT< RequestMessageType >::Request, BASE_SET::set(), BOARD::SetVisibleLayers(), PCB_DRAW_PANEL_GAL::SyncLayersVisibility(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_BOARD().
|
protectedinherited |
Definition at line 266 of file api_handler_editor.cpp.
References checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, handleCreateUpdateItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, and result.
Referenced by API_HANDLER_EDITOR().
|
inlineprotectedvirtualinherited |
Reimplemented in API_HANDLER_PCB, and API_HANDLER_SCH.
Definition at line 142 of file api_handler_editor.h.
Referenced by handleSetPageSettings(), and handleSetTitleBlockInfo().
|
protected |
Definition at line 428 of file api_handler_board.cpp.
References FromProtoEnum(), and TYPE_NOT_INIT.
Referenced by API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), and handleGetSelection().
|
inlineprotected |
Definition at line 80 of file api_handler_board.h.
References context(), and BOARD_CONTEXT::Prj().
Referenced by API_HANDLER_FOOTPRINT::handleGetOpenDocuments(), API_HANDLER_PCB::handleGetOpenDocuments(), API_HANDLER_PCB::handleRevertDocument(), and API_HANDLER_PCB::handleSaveCopyOfDocument().
|
overrideprotectedvirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 116 of file api_handler_board.cpp.
References API_HANDLER_EDITOR::m_frame, and API_HANDLER_EDITOR::pushCurrentCommit().
Referenced by deleteItemsInternal(), and handleCreateUpdateItemsInternal().
|
inlineprotectedinherited |
Registers an API command handler for the given message types.
When an API request matching the given type comes in, the handler will be called and its response will be packed into an envelope for sending back to the API client.
If the given message does not unpack into the request type, an envelope is returned with status AS_BAD_REQUEST, which probably indicates corruption in the message.
| RequestType | is a protobuf message type containing a command |
| ResponseType | is a protobuf message type containing a command response |
| HandlerType | is the implied type of the API_HANDLER subclass |
| aHandler | is the handler function for the given request and response types |
Definition at line 93 of file api_handler.h.
References HANDLER_CONTEXT< RequestMessageType >::ClientName, m_handlers, HANDLER_CONTEXT< RequestMessageType >::Request, and tryUnpack().
Referenced by API_HANDLER_BOARD::API_HANDLER_BOARD(), API_HANDLER_COMMON::API_HANDLER_COMMON(), API_HANDLER_EDITOR::API_HANDLER_EDITOR(), API_HANDLER_FOOTPRINT::API_HANDLER_FOOTPRINT(), API_HANDLER_PCB::API_HANDLER_PCB(), and API_HANDLER_SCH::API_HANDLER_SCH().
|
inlineprotectedvirtualinherited |
Reimplemented in API_HANDLER_PCB, and API_HANDLER_SCH.
Definition at line 140 of file api_handler_editor.h.
Referenced by handleSetPageSettings().
|
inlineprotectedvirtualinherited |
Reimplemented in API_HANDLER_PCB, and API_HANDLER_SCH.
Definition at line 136 of file api_handler_editor.h.
Referenced by handleSetPageSettings().
|
protectedpure virtualinherited |
Override this to specify which document type this editor handles.
Implemented in API_HANDLER_FOOTPRINT, API_HANDLER_PCB, and API_HANDLER_SCH.
Referenced by validateItemHeaderDocument().
|
inlineprotected |
Definition at line 82 of file api_handler_board.h.
References context(), and BOARD_CONTEXT::GetToolManager().
Referenced by createCommit(), handleAddToSelection(), handleClearSelection(), handleGetSelection(), handleInteractiveMoveItems(), API_HANDLER_PCB::handleRefillZones(), handleRemoveFromSelection(), handleRunAction(), handleSaveSelectionToString(), and API_HANDLER_PCB::handleSetBoardEnabledLayers().
|
inlineprivateinherited |
Definition at line 136 of file api_handler.h.
Referenced by registerHandler().
|
protectedinherited |
Definition at line 178 of file api_handler_editor.cpp.
References validateDocumentInternal().
Referenced by API_HANDLER_BOARD::getItemFromDocument(), API_HANDLER_SCH::getItemFromDocument(), API_HANDLER_BOARD::handleCheckPadstackPresenceOnLayers(), API_HANDLER_BOARD::handleExpandTextVariables(), API_HANDLER_BOARD::handleGetActiveLayer(), API_HANDLER_PCB::handleGetBoardDesignRules(), API_HANDLER_BOARD::handleGetBoardEnabledLayers(), API_HANDLER_PCB::handleGetBoardLayerName(), API_HANDLER_PCB::handleGetBoardOrigin(), API_HANDLER_PCB::handleGetCustomDesignRules(), API_HANDLER_BOARD::handleGetGraphicsDefaults(), API_HANDLER_PCB::handleGetNets(), API_HANDLER_BOARD::handleGetPadShapeAsPolygon(), handleGetPageSettings(), API_HANDLER_SCH::handleGetSchematicHierarchy(), API_HANDLER_SCH::handleGetSchematicNetlist(), API_HANDLER_BOARD::handleGetStackup(), handleGetTitleBlockInfo(), API_HANDLER_BOARD::handleGetVisibleLayers(), API_HANDLER_PCB::handleInjectDrcError(), API_HANDLER_BOARD::handleInteractiveMoveItems(), API_HANDLER_BOARD::handleParseAndCreateItemsFromString(), API_HANDLER_PCB::handleRefillZones(), API_HANDLER_FOOTPRINT::handleRevertDocument(), API_HANDLER_PCB::handleRevertDocument(), API_HANDLER_PCB::handleRunBoardJobExport3D(), API_HANDLER_PCB::handleRunBoardJobExportDrill(), API_HANDLER_PCB::handleRunBoardJobExportDxf(), API_HANDLER_PCB::handleRunBoardJobExportGencad(), API_HANDLER_PCB::handleRunBoardJobExportGerbers(), API_HANDLER_PCB::handleRunBoardJobExportIpc2581(), API_HANDLER_PCB::handleRunBoardJobExportIpcD356(), API_HANDLER_PCB::handleRunBoardJobExportODB(), API_HANDLER_PCB::handleRunBoardJobExportPdf(), API_HANDLER_PCB::handleRunBoardJobExportPosition(), API_HANDLER_PCB::handleRunBoardJobExportPs(), API_HANDLER_PCB::handleRunBoardJobExportRender(), API_HANDLER_PCB::handleRunBoardJobExportStats(), API_HANDLER_PCB::handleRunBoardJobExportSvg(), API_HANDLER_SCH::handleRunSchematicJobExportBOM(), API_HANDLER_SCH::handleRunSchematicJobExportDxf(), API_HANDLER_SCH::handleRunSchematicJobExportNetlist(), API_HANDLER_SCH::handleRunSchematicJobExportPdf(), API_HANDLER_SCH::handleRunSchematicJobExportPs(), API_HANDLER_SCH::handleRunSchematicJobExportSvg(), API_HANDLER_PCB::handleSaveCopyOfDocument(), API_HANDLER_PCB::handleSaveDocument(), API_HANDLER_BOARD::handleSaveDocumentToString(), API_HANDLER_BOARD::handleSetActiveLayer(), API_HANDLER_PCB::handleSetBoardDesignRules(), API_HANDLER_PCB::handleSetBoardEnabledLayers(), API_HANDLER_PCB::handleSetBoardOrigin(), API_HANDLER_PCB::handleSetCustomDesignRules(), handleSetPageSettings(), handleSetTitleBlockInfo(), API_HANDLER_BOARD::handleSetVisibleLayers(), API_HANDLER_FOOTPRINT::validateAndGetFootprint(), and validateItemHeaderDocument().
|
protectedpure virtualinherited |
Implemented in API_HANDLER_FOOTPRINT, API_HANDLER_PCB, and API_HANDLER_SCH.
Referenced by validateDocument(), and validateItemHeaderDocument().
|
protectedinherited |
If the header is valid, returns the item container.
Definition at line 193 of file api_handler_editor.cpp.
References result, thisDocumentType(), validateDocument(), and validateDocumentInternal().
Referenced by API_HANDLER_BOARD::handleAddToSelection(), handleBeginCommit(), API_HANDLER_BOARD::handleClearSelection(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleDeleteItems(), handleEndCommit(), API_HANDLER_BOARD::handleGetBoundingBox(), API_HANDLER_PCB::handleGetConnectedItems(), API_HANDLER_FOOTPRINT::handleGetItems(), API_HANDLER_PCB::handleGetItems(), API_HANDLER_SCH::handleGetItems(), API_HANDLER_BOARD::handleGetItemsById(), API_HANDLER_SCH::handleGetItemsById(), API_HANDLER_PCB::handleGetItemsByNet(), API_HANDLER_PCB::handleGetItemsByNetClass(), API_HANDLER_BOARD::handleGetSelection(), handleHitTest(), and API_HANDLER_BOARD::handleRemoveFromSelection().
|
protectedinherited |
Definition at line 147 of file api_handler_editor.h.
Referenced by API_HANDLER_BOARD::deleteItemsInternal(), API_HANDLER_SCH::deleteItemsInternal(), handleBeginCommit(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleEndCommit(), and pushCurrentCommit().
|
protectedinherited |
Definition at line 145 of file api_handler_editor.h.
Referenced by getCurrentCommit(), handleBeginCommit(), handleEndCommit(), and pushCurrentCommit().
|
private |
Definition at line 160 of file api_handler_board.h.
Referenced by API_HANDLER_BOARD(), and context().
|
staticprotectedinherited |
Definition at line 131 of file api_handler.h.
Referenced by API_HANDLER_EDITOR::pushCurrentCommit().
|
protectedinherited |
Definition at line 149 of file api_handler_editor.h.
Referenced by API_HANDLER_EDITOR(), checkForBusy(), API_HANDLER_BOARD::checkForHeadless(), API_HANDLER_BOARD::createCommit(), API_HANDLER_FOOTPRINT::frame(), API_HANDLER_PCB::frame(), API_HANDLER_BOARD::handleAddToSelection(), API_HANDLER_BOARD::handleClearSelection(), API_HANDLER_BOARD::handleGetActiveLayer(), API_HANDLER_BOARD::handleRemoveFromSelection(), API_HANDLER_BOARD::handleSetActiveLayer(), API_HANDLER_BOARD::handleSetVisibleLayers(), and API_HANDLER_BOARD::pushCurrentCommit().
|
protectedinherited |
Maps type name (without the URL prefix) to a handler method.
Definition at line 129 of file api_handler.h.
Referenced by Handle(), and registerHandler().