KiCad PCB EDA Suite
|
#include <api_handler_pcb.h>
Public Member Functions | |
API_HANDLER_PCB (PCB_EDIT_FRAME *aFrame) | |
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. | |
kiapi::common::types::DocumentType | thisDocumentType () const override |
Override this to specify which document type this editor handles. | |
bool | validateDocumentInternal (const DocumentSpecifier &aDocument) const override |
void | deleteItemsInternal (std::map< KIID, ItemDeletionStatus > &aItemsToDelete, const std::string &aClientName) override |
std::optional< EDA_ITEM * > | getItemFromDocument (const DocumentSpecifier &aDocument, const KIID &aId) override |
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) |
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. | |
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 Types | |
typedef std::map< std::string, PROPERTY_BASE * > | PROTO_PROPERTY_MAP |
Private Member Functions | |
HANDLER_RESULT< commands::RunActionResponse > | handleRunAction (const HANDLER_CONTEXT< commands::RunAction > &aCtx) |
HANDLER_RESULT< commands::GetOpenDocumentsResponse > | handleGetOpenDocuments (const HANDLER_CONTEXT< commands::GetOpenDocuments > &aCtx) |
HANDLER_RESULT< Empty > | handleSaveDocument (const HANDLER_CONTEXT< commands::SaveDocument > &aCtx) |
HANDLER_RESULT< Empty > | handleSaveCopyOfDocument (const HANDLER_CONTEXT< commands::SaveCopyOfDocument > &aCtx) |
HANDLER_RESULT< Empty > | handleRevertDocument (const HANDLER_CONTEXT< commands::RevertDocument > &aCtx) |
HANDLER_RESULT< commands::GetItemsResponse > | handleGetItems (const HANDLER_CONTEXT< commands::GetItems > &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< GraphicsDefaultsResponse > | handleGetGraphicsDefaults (const HANDLER_CONTEXT< GetGraphicsDefaults > &aCtx) |
HANDLER_RESULT< types::Vector2 > | handleGetBoardOrigin (const HANDLER_CONTEXT< GetBoardOrigin > &aCtx) |
HANDLER_RESULT< Empty > | handleSetBoardOrigin (const HANDLER_CONTEXT< SetBoardOrigin > &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< types::TitleBlockInfo > | handleGetTitleBlockInfo (const HANDLER_CONTEXT< commands::GetTitleBlockInfo > &aCtx) |
HANDLER_RESULT< commands::ExpandTextVariablesResponse > | handleExpandTextVariables (const HANDLER_CONTEXT< commands::ExpandTextVariables > &aCtx) |
HANDLER_RESULT< Empty > | handleInteractiveMoveItems (const HANDLER_CONTEXT< InteractiveMoveItems > &aCtx) |
HANDLER_RESULT< NetsResponse > | handleGetNets (const HANDLER_CONTEXT< GetNets > &aCtx) |
HANDLER_RESULT< NetClassForNetsResponse > | handleGetNetClassForNets (const HANDLER_CONTEXT< GetNetClassForNets > &aCtx) |
HANDLER_RESULT< Empty > | handleRefillZones (const HANDLER_CONTEXT< RefillZones > &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) |
HANDLER_RESULT< BoardEditorAppearanceSettings > | handleGetBoardEditorAppearanceSettings (const HANDLER_CONTEXT< GetBoardEditorAppearanceSettings > &aCtx) |
HANDLER_RESULT< Empty > | handleSetBoardEditorAppearanceSettings (const HANDLER_CONTEXT< SetBoardEditorAppearanceSettings > &aCtx) |
PCB_EDIT_FRAME * | frame () const |
void | pushCurrentCommit (const std::string &aClientName, const wxString &aMessage) override |
std::optional< BOARD_ITEM * > | getItemById (const KIID &aId) const |
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 |
template<typename MessageType > | |
bool | tryUnpack (ApiRequest &aRequest, ApiResponse &aReply, MessageType &aDest) |
Static Private Member Functions | |
static HANDLER_RESULT< std::unique_ptr< BOARD_ITEM > > | createItemForType (KICAD_T aType, BOARD_ITEM_CONTAINER *aContainer) |
Definition at line 50 of file api_handler_pcb.h.
|
private |
Definition at line 56 of file api_handler_pcb.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_PCB::API_HANDLER_PCB | ( | PCB_EDIT_FRAME * | aFrame | ) |
Definition at line 56 of file api_handler_pcb.cpp.
References handleAddToSelection(), handleCheckPadstackPresenceOnLayers(), handleClearSelection(), handleExpandTextVariables(), handleGetActiveLayer(), handleGetBoardEditorAppearanceSettings(), handleGetBoardOrigin(), handleGetBoundingBox(), handleGetGraphicsDefaults(), handleGetItems(), handleGetItemsById(), handleGetNetClassForNets(), handleGetNets(), handleGetOpenDocuments(), handleGetPadShapeAsPolygon(), handleGetSelection(), handleGetStackup(), handleGetTitleBlockInfo(), handleGetVisibleLayers(), handleInteractiveMoveItems(), handleParseAndCreateItemsFromString(), handleRefillZones(), handleRemoveFromSelection(), handleRevertDocument(), handleRunAction(), handleSaveCopyOfDocument(), handleSaveDocument(), handleSaveDocumentToString(), handleSaveSelectionToString(), handleSetActiveLayer(), handleSetBoardEditorAppearanceSettings(), handleSetBoardOrigin(), and handleSetVisibleLayers().
|
protectedvirtualinherited |
Checks if the editor can accept commands.
Definition at line 205 of file api_handler_editor.cpp.
References EDA_BASE_FRAME::CanAcceptApiCommands(), and API_HANDLER_EDITOR::m_frame.
Referenced by handleAddToSelection(), API_HANDLER_EDITOR::handleBeginCommit(), handleClearSelection(), API_HANDLER_EDITOR::handleCreateItems(), API_HANDLER_EDITOR::handleDeleteItems(), API_HANDLER_EDITOR::handleEndCommit(), handleGetBoundingBox(), handleGetItems(), handleGetItemsById(), API_HANDLER_EDITOR::handleHitTest(), handleInteractiveMoveItems(), handleParseAndCreateItemsFromString(), handleRefillZones(), handleRemoveFromSelection(), handleRevertDocument(), handleRunAction(), handleSaveCopyOfDocument(), handleSaveDocument(), handleSetActiveLayer(), handleSetBoardEditorAppearanceSettings(), handleSetBoardOrigin(), handleSetVisibleLayers(), and API_HANDLER_EDITOR::handleUpdateItems().
|
overrideprotectedvirtual |
Override this to create an appropriate COMMIT subclass for the frame in question.
Implements API_HANDLER_EDITOR.
Definition at line 268 of file api_handler_pcb.cpp.
References frame().
|
staticprivate |
Definition at line 295 of file api_handler_pcb.cpp.
References CreateItemForType(), EDA_ITEM::GetFriendlyName(), PCB_FOOTPRINT_T, and PCB_PAD_T.
Referenced by handleCreateUpdateItemsInternal().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 701 of file api_handler_pcb.cpp.
References _, frame(), PCB_BASE_FRAME::GetBoard(), API_HANDLER_EDITOR::getCurrentCommit(), API_HANDLER_EDITOR::m_activeClients, pushCurrentCommit(), COMMIT::Remove(), and BOARD::ResolveItem().
|
private |
Definition at line 114 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::m_frame.
Referenced by createCommit(), deleteItemsInternal(), getItemById(), handleAddToSelection(), handleClearSelection(), handleCreateUpdateItemsInternal(), handleExpandTextVariables(), handleGetActiveLayer(), handleGetBoardEditorAppearanceSettings(), handleGetBoardOrigin(), handleGetGraphicsDefaults(), handleGetItems(), handleGetNetClassForNets(), handleGetNets(), handleGetOpenDocuments(), handleGetSelection(), handleGetStackup(), handleGetTitleBlockInfo(), handleGetVisibleLayers(), handleInteractiveMoveItems(), handleRefillZones(), handleRemoveFromSelection(), handleRevertDocument(), handleRunAction(), handleSaveCopyOfDocument(), handleSaveDocument(), handleSaveDocumentToString(), handleSaveSelectionToString(), handleSetActiveLayer(), handleSetBoardEditorAppearanceSettings(), handleSetBoardOrigin(), handleSetVisibleLayers(), pushCurrentCommit(), and validateDocumentInternal().
|
protectedinherited |
Definition at line 129 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::createCommit(), and API_HANDLER_EDITOR::m_commits.
Referenced by deleteItemsInternal(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleCreateUpdateItemsInternal(), and handleInteractiveMoveItems().
|
private |
Definition at line 274 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetBoard(), and BOARD::ResolveItem().
Referenced by getItemFromDocument(), handleAddToSelection(), handleCheckPadstackPresenceOnLayers(), handleCreateUpdateItemsInternal(), handleGetBoundingBox(), handleGetItemsById(), handleGetPadShapeAsPolygon(), handleInteractiveMoveItems(), and handleRemoveFromSelection().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 729 of file api_handler_pcb.cpp.
References getItemById(), and API_HANDLER_EDITOR::validateDocument().
|
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 API_HANDLER::m_handlers.
|
private |
Definition at line 800 of file api_handler_pcb.cpp.
References SELECTION_TOOL::AddItemsToSel(), API_HANDLER_EDITOR::checkForBusy(), frame(), getItemById(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_PCB().
|
protectedinherited |
Definition at line 43 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, API_HANDLER_EDITOR::createCommit(), API_HANDLER_EDITOR::m_activeClients, and API_HANDLER_EDITOR::m_commits.
Referenced by API_HANDLER_EDITOR::API_HANDLER_EDITOR().
|
private |
Definition at line 1116 of file api_handler_pcb.cpp.
References getItemById(), pad, PCB_PAD_T, PCB_VIA_T, HANDLER_CONTEXT< RequestMessageType >::Request, BASE_SET::set(), API_HANDLER_EDITOR::validateDocument(), and via.
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 778 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), TOOLS_HOLDER::GetToolManager(), HANDLER_CONTEXT< RequestMessageType >::Request, TOOL_MANAGER::RunAction(), ACTIONS::selectionClear, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_PCB().
|
protectedinherited |
Definition at line 219 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, API_HANDLER_EDITOR::handleCreateUpdateItemsInternal(), and HANDLER_CONTEXT< RequestMessageType >::Request.
Referenced by API_HANDLER_EDITOR::API_HANDLER_EDITOR().
|
overrideprivatevirtual |
Implements API_HANDLER_EDITOR.
Definition at line 338 of file api_handler_pcb.cpp.
References _, COMMIT::Add(), KIID::AsStdString(), BOARD_ITEM::CopyFrom(), createItemForType(), frame(), PCB_BASE_FRAME::GetBoard(), API_HANDLER_EDITOR::getCurrentCommit(), BOARD::GetEnabledLayers(), getItemById(), 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(), COMMIT::Remove(), SERIALIZABLE::Serialize(), EDA_ITEM::Type(), kiapi::common::TypeNameFromAny(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
|
protectedinherited |
Definition at line 273 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, API_HANDLER_EDITOR::deleteItemsInternal(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR::API_HANDLER_EDITOR().
|
protectedinherited |
Definition at line 72 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, API_HANDLER_EDITOR::m_activeClients, API_HANDLER_EDITOR::m_commits, API_HANDLER_EDITOR::pushCurrentCommit(), and HANDLER_CONTEXT< RequestMessageType >::Request.
Referenced by API_HANDLER_EDITOR::API_HANDLER_EDITOR().
|
private |
Definition at line 1214 of file api_handler_pcb.cpp.
References ExpandTextVars(), frame(), PCB_BASE_FRAME::GetBoard(), HANDLER_CONTEXT< RequestMessageType >::Request, BOARD::ResolveTextVar(), text, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1481 of file api_handler_pcb.cpp.
References frame(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1524 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetDisplayOptions(), PCB_BASE_FRAME::GetPcbNewSettings(), PCB_DISPLAY_OPTIONS::m_ContrastModeDisplay, PCBNEW_SETTINGS::m_Display, PCB_DISPLAY_OPTIONS::m_NetColorMode, and PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_RatsnestMode.
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 945 of file api_handler_pcb.cpp.
References frame(), BOARD_DESIGN_SETTINGS::GetAuxOrigin(), PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetGridOrigin(), kiapi::common::PackVector2(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1040 of file api_handler_pcb.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_PCB().
|
private |
Definition at line 905 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetBoard(), 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_PCB().
|
private |
Definition at line 518 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), BOARD::Drawings(), BOARD::Footprints(), frame(), PCB_BASE_FRAME::GetBoard(), BOARD::Groups(), PCB_ARC_T, PCB_FOOTPRINT_T, PCB_GROUP_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, HANDLER_CONTEXT< RequestMessageType >::Request, BOARD::Tracks(), TYPE_NOT_INIT, API_HANDLER_EDITOR::validateItemHeaderDocument(), and BOARD::Zones().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 659 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), getItemById(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1315 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetBoard(), NETINFO_ITEM::GetNetClass(), BOARD::GetNetInfo(), NETINFO_LIST::GetNetItem(), HANDLER_CONTEXT< RequestMessageType >::Request, and NETCLASS::Serialize().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1284 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetBoard(), NETCLASS::GetName(), BOARD::GetNetInfo(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 137 of file api_handler_pcb.cpp.
References frame(), Prj(), and HANDLER_CONTEXT< RequestMessageType >::Request.
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1081 of file api_handler_pcb.cpp.
References SHAPE_POLY_SET::COutline(), ERROR_INSIDE, getItemById(), kiapi::common::PackPolyLine(), pad, PCB_PAD_T, HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 739 of file api_handler_pcb.cpp.
References filter, frame(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), HANDLER_CONTEXT< RequestMessageType >::Request, TYPE_NOT_INIT, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 874 of file api_handler_pcb.cpp.
References frame(), GetBoard(), PCB_BASE_FRAME::GetBoard(), BOARD::GetStackupOrDefault(), HANDLER_CONTEXT< RequestMessageType >::Request, BOARD_STACKUP::Serialize(), UNDEFINED_LAYER, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1183 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetBoard(), TITLE_BLOCK::GetComment(), TITLE_BLOCK::GetCompany(), TITLE_BLOCK::GetDate(), TITLE_BLOCK::GetRevision(), TITLE_BLOCK::GetTitle(), BOARD::GetTitleBlock(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1433 of file api_handler_pcb.cpp.
References frame(), GetBoard(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
protectedinherited |
Definition at line 322 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::checkForBusy(), API_HANDLER_EDITOR::getItemFromDocument(), HANDLER_CONTEXT< RequestMessageType >::Request, kiapi::common::UnpackVector2(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_EDITOR::API_HANDLER_EDITOR().
|
private |
Definition at line 1242 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, frame(), API_HANDLER_EDITOR::getCurrentCommit(), getItemById(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), PCB_ACTIONS::move, TOOL_MANAGER::PostAPIAction(), HANDLER_CONTEXT< RequestMessageType >::Request, TOOL_MANAGER::RunAction(), ACTIONS::selectionClear, ACTIONS::selectItems, SELECTION::SetReferencePoint(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1417 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1340 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), TOOLS_HOLDER::GetToolManager(), HANDLER_CONTEXT< RequestMessageType >::Request, TOOL_MANAGER::RunAction(), API_HANDLER_EDITOR::validateDocument(), and PCB_ACTIONS::zoneFillAll.
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 837 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), getItemById(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), SELECTION_TOOL::RemoveItemsFromSel(), HANDLER_CONTEXT< RequestMessageType >::Request, and API_HANDLER_EDITOR::validateItemHeaderDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 240 of file api_handler_pcb.cpp.
References PROJECT::AbsolutePath(), API_HANDLER_EDITOR::checkForBusy(), frame(), GetBoard(), PCB_BASE_FRAME::GetScreen(), KICTL_REVERT, PCB_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), EDA_DRAW_FRAME::ReleaseFile(), HANDLER_CONTEXT< RequestMessageType >::Request, BASE_SCREEN::SetContentModified(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 120 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), and HANDLER_CONTEXT< RequestMessageType >::Request.
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 180 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), PCB_BASE_FRAME::GetBoard(), BOARD::GetFileName(), FILEEXT::KiCadPcbFileExtension, Prj(), HANDLER_CONTEXT< RequestMessageType >::Request, PCB_EDIT_FRAME::SaveBoard(), PCB_EDIT_FRAME::SavePcbCopy(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 164 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), HANDLER_CONTEXT< RequestMessageType >::Request, PCB_EDIT_FRAME::SaveBoard(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1370 of file api_handler_pcb.cpp.
References frame(), GetBoard(), HANDLER_CONTEXT< RequestMessageType >::Request, CLIPBOARD_IO::SaveBoard(), CLIPBOARD_IO::SetWriter(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1394 of file api_handler_pcb.cpp.
References frame(), PCB_BASE_FRAME::GetBoard(), PCB_SELECTION_TOOL::GetSelection(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), CLIPBOARD_IO::SaveSelection(), CLIPBOARD_IO::SetBoard(), and CLIPBOARD_IO::SetWriter().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1497 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), GetBoard(), HANDLER_CONTEXT< RequestMessageType >::Request, PCB_EDIT_FRAME::SetActiveLayer(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1551 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), frame(), PCB_BASE_FRAME::GetCanvas(), PCB_BASE_FRAME::GetDisplayOptions(), PCB_BASE_FRAME::GetPcbNewSettings(), PCB_DRAW_PANEL_GAL::GetView(), KIGFX::VIEW::IsMirroredX(), KIGFX::VIEW::IsMirroredY(), PCB_DISPLAY_OPTIONS::m_ContrastModeDisplay, PCBNEW_SETTINGS::m_Display, PCB_DISPLAY_OPTIONS::m_NetColorMode, PCBNEW_SETTINGS::DISPLAY_OPTIONS::m_RatsnestMode, KIGFX::VIEW::RecacheAllItems(), EDA_DRAW_PANEL_GAL::Refresh(), HANDLER_CONTEXT< RequestMessageType >::Request, PCB_BASE_FRAME::SetDisplayOptions(), KIGFX::VIEW::SetMirror(), and KIGFX::VIEW::UpdateAllLayersColor().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 982 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), PCB_ACTIONS::drillSetOrigin, frame(), TOOLS_HOLDER::GetToolManager(), ACTIONS::gridSetOrigin, HANDLER_CONTEXT< RequestMessageType >::Request, TOOL_MANAGER::RunAction(), kiapi::common::UnpackVector2(), and API_HANDLER_EDITOR::validateDocument().
Referenced by API_HANDLER_PCB().
|
private |
Definition at line 1450 of file api_handler_pcb.cpp.
References API_HANDLER_EDITOR::checkForBusy(), LSET::Contains(), frame(), PCB_BASE_EDIT_FRAME::GetAppearancePanel(), GetBoard(), PCB_BASE_FRAME::GetBoard(), PCB_BASE_FRAME::GetCanvas(), BOARD::GetEnabledLayers(), 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_PCB().
|
protectedinherited |
Definition at line 246 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::checkForBusy(), HANDLER_CONTEXT< RequestMessageType >::ClientName, API_HANDLER_EDITOR::handleCreateUpdateItemsInternal(), and HANDLER_CONTEXT< RequestMessageType >::Request.
Referenced by API_HANDLER_EDITOR::API_HANDLER_EDITOR().
|
overrideprivatevirtual |
Reimplemented from API_HANDLER_EDITOR.
Definition at line 261 of file api_handler_pcb.cpp.
References 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, and HANDLER_CONTEXT< RequestMessageType >::Request.
|
inlineoverrideprotectedvirtual |
Override this to specify which document type this editor handles.
Implements API_HANDLER_EDITOR.
Definition at line 151 of file api_handler_pcb.h.
|
inlineprivateinherited |
Definition at line 136 of file api_handler.h.
|
protectedinherited |
Definition at line 155 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::validateDocumentInternal().
Referenced by API_HANDLER_SCH::getItemFromDocument(), getItemFromDocument(), handleCheckPadstackPresenceOnLayers(), handleExpandTextVariables(), handleGetActiveLayer(), handleGetBoardOrigin(), handleGetGraphicsDefaults(), handleGetNets(), handleGetPadShapeAsPolygon(), handleGetStackup(), handleGetTitleBlockInfo(), handleGetVisibleLayers(), handleInteractiveMoveItems(), handleParseAndCreateItemsFromString(), handleRefillZones(), handleRevertDocument(), handleSaveCopyOfDocument(), handleSaveDocument(), handleSaveDocumentToString(), handleSetActiveLayer(), handleSetBoardOrigin(), handleSetVisibleLayers(), and API_HANDLER_EDITOR::validateItemHeaderDocument().
|
overrideprotectedvirtual |
Implements API_HANDLER_EDITOR.
Definition at line 285 of file api_handler_pcb.cpp.
References frame().
|
protectedinherited |
If the header is valid, returns the item container.
Definition at line 170 of file api_handler_editor.cpp.
References API_HANDLER_EDITOR::thisDocumentType(), API_HANDLER_EDITOR::validateDocument(), and API_HANDLER_EDITOR::validateDocumentInternal().
Referenced by handleAddToSelection(), handleClearSelection(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleCreateUpdateItemsInternal(), API_HANDLER_EDITOR::handleDeleteItems(), handleGetBoundingBox(), handleGetItems(), handleGetItemsById(), handleGetSelection(), API_HANDLER_EDITOR::handleHitTest(), and handleRemoveFromSelection().
|
protectedinherited |
Definition at line 110 of file api_handler_editor.h.
Referenced by deleteItemsInternal(), API_HANDLER_EDITOR::handleBeginCommit(), API_HANDLER_SCH::handleCreateUpdateItemsInternal(), handleCreateUpdateItemsInternal(), API_HANDLER_EDITOR::handleEndCommit(), and API_HANDLER_EDITOR::pushCurrentCommit().
|
protectedinherited |
Definition at line 108 of file api_handler_editor.h.
Referenced by API_HANDLER_EDITOR::getCurrentCommit(), API_HANDLER_EDITOR::handleBeginCommit(), API_HANDLER_EDITOR::handleEndCommit(), and API_HANDLER_EDITOR::pushCurrentCommit().
|
staticprotectedinherited |
Definition at line 131 of file api_handler.h.
Referenced by API_HANDLER_EDITOR::pushCurrentCommit().
|
protectedinherited |
Definition at line 112 of file api_handler_editor.h.
Referenced by API_HANDLER_EDITOR::checkForBusy(), and frame().
|
protectedinherited |
Maps type name (without the URL prefix) to a handler method.
Definition at line 129 of file api_handler.h.
Referenced by API_HANDLER::Handle().