176 LuaIntf::LuaBinding(L)
179 .beginExtendClass<
CadMdiChild, QWidget>(
"CadMdiChild")
199 .beginClass<LCViewer::Cursor>(
"Cursor")
200 .addFunction(
"position", &LCViewer::Cursor::position)
204 .addFunction(
"x", &LCViewer::LCADViewer::x)
205 .addFunction(
"y", &LCViewer::LCADViewer::y)
222 .beginExtendClass<
LuaScript, QDockWidget>(
"LuaScript")
223 .addConstructor(LUA_ARGS(QMdiArea*,
CliCommand*))
226 .beginClass<LCViewer::DocumentCanvas>(
"DocumentCanvas")
227 .addFunction(
"autoScale", &LCViewer::DocumentCanvas::autoScale)
228 .addFunction(
"selectPoint", &LCViewer::DocumentCanvas::selectPoint)
231 .beginExtendClass<
CliCommand, QDockWidget>(
"CliCommand")
232 .addConstructor(LUA_SP(std::shared_ptr<CliCommand>), LUA_ARGS(LuaIntf::_opt<QWidget*>))
238 .beginExtendClass<
Toolbar, QDockWidget>(
"Toolbar")
239 .addConstructor(LUA_SP(std::shared_ptr<Toolbar>), LUA_ARGS(LuaIntf::_opt<QWidget*>))
245 .beginExtendClass<
ToolbarTab, QDockWidget>(
"ToolbarTab")
267 .beginClass<LCViewer::TempEntities>(
"TempEntities")
268 .addFunction(
"addEntity", &LCViewer::TempEntities::addEntity)
269 .addFunction(
"removeEntity", &LCViewer::TempEntities::removeEntity)
276 .beginExtendClass<
Layers, QDockWidget>(
"Layers")
283 .beginClass<LCViewer::SnapManagerImpl>(
"SnapManager")
284 .addFunction(
"setGridSnappable", &LCViewer::SnapManagerImpl::setGridSnappable)
288 .addFactory([](lc::Document_SPtr document){
295 .addFactory([](QWidget* parent,
bool showByLayer,
bool showByBlock){
302 .addFactory([](QWidget* parent,
bool showByLayer,
bool showByBlock){
305 .addFunction(
"setMetaInfoManager",
307 LUA_ARGS(LuaIntf::_opt<lc::ui::MetaInfoManager_SPtr>)
312 .addFactory([](QWidget* parent,
bool showByLayer,
bool showByBlock){
315 .addFunction(
"setMetaInfoManager",
317 LUA_ARGS(LuaIntf::_opt<lc::ui::MetaInfoManager_SPtr>)
lc::ui::MetaInfoManager_SPtr metaInfoManager() const
Get the MetaInfo manager.
bool addCommand(std::string name)
Add a new command.
void setMdiChild(CadMdiChild *mdiChild=nullptr)
Set the window on which line pattern is applied.
LuaIntf::LuaRef operation(unsigned int windowID)
Dropdown select for line widths. Line widths are hardcoded in the constructor.
std::shared_ptr< LCViewer::Cursor > cursor() const
void write(QString message)
Write a message in the logs.
const LCViewer::SnapManagerImpl_SPtr & getSnapManager() const
LCViewer::LCADViewer * viewer() const
void setId(unsigned int id)
Set window ID.
Widget that allows to enter and run Lua code. This widget runs the code on the selected window in Cad...
Create a new window which shows a list of line patterns.
bool openFile()
Load existing file.
lc::UndoManager_SPtr undoManager() const
const std::shared_ptr< DocumentCanvas > & docCanvas() const
bool luaConnect(QObject *sender, std::string signalName, LuaIntf::LuaRef slot)
Connect Qt signal with Lua function.
LCViewer::TempEntities_SPtr tempEntities()
Get container of temporary entities.
std::vector< lc::entity::CADEntity_CSPtr > selection()
Get selected entities.
unsigned int id()
Get window ID.
void triggerEvent(const std::string &event, LuaIntf::LuaRef args)
bool qtConnect(QObject *sender, std::string signalName, QObject *receiver, std::string slotName)
Connect Qt signal with Qt slot.
void setOperation(unsigned int windowID, LuaIntf::LuaRef)
Widget which shows a list of layers.
void setMdiChild(CadMdiChild *mdiChild=nullptr)
Set new document.
void newDocument()
Create a new document.
void setDocument(lc::Document_SPtr document)
Set a new document and update the list of line patterns. Document can be set to nullptr to clear the ...
void setMetaInfoManager(lc::ui::MetaInfoManager_SPtr metaInfoManager=nullptr)
Set the MetaInfo manager.
void registerEvent(const std::string &event, LuaIntf::LuaRef callback)
Dropdown select for DxfLinePatterns.
std::shared_ptr< lc::Document > document() const
void returnText(bool returnText)
Return raw text to Lua.
void setOperationActive(bool operationActive)
void setDestroyCallback(LuaIntf::LuaRef callback)
Give function to call when window is destroyed.
void deleteEvent(const std::string &event, LuaIntf::LuaRef callback)
std::vector< std::string > pluginList(const char *path)
Return a list of plugins.
void setMetaInfoManager(lc::ui::MetaInfoManager_SPtr metaInfoManager)
Set the MetaInfo manager.
lc::Layer_CSPtr activeLayer() const
Get the selected layer.