LibreCAD 3 Development Logs

Development logs of GSoC 2017

No comments

Today I started working on custom entities.
I created the class derived of Block which is used for custom entity storage, with the corresponding unit tests and Lua bindings.

I added the AddBlock, RemoveBlock and ReplaceBlock classes, with unit tests and Lua bindings too.

After discussing with ries, I will modify the builder class to use the others operations (AddLayer, AddBlock, ...) in one undo cycle.

No comments

I'll be working on rendering of ByBlock properties now.
The current implementation of properties in block is wrong, and new classes for LinePattern and Color are needed

No comments

Today I added a Lua function which ask the user to open/save a file like this :


openFileDialog(true, "Plugin configuration")

The first boolean is true if a file will be opened, or false if it will be saved.
The string parameter is the description of the file

That required some changes, the PluginManager is now created by LCLua, because the two classes are created at the same time, and both need to access the UI open file function.

No comments

I continued my work on builders today by adding the ones for Layer and DxfLinePattern

I made some tests for C++ exception handling in Lua, and all the bindings will need a wrapper function to convert the exception in Lua error.
Lua will probably need to be recompiled in C++

No comments

File write/read operations are now accessible from Lua. There are no security checks yet.

Here is an example of how it works in a script


file = openFile("/tmp/a", "r+")
actual = file:read(1)
file:write(new)

I refactored the lcluascript library too, now there is a LCLua class which add the Lua functions and LibreCAD kernel functions into Lua.

No comments

Today I worked on a meta info storage in CadMdiChild, so the plugins in the sandbox can access the selected color/line width/line pattern.

It create a new MetaInfo instance in the getter, but that's probably unnecessary and could be optimized

I created a new class for the line width, because the common class between LineWidthByValue and LineWidthByBlock is EntityMetaType, it is now used in the block

No comments

I copied a function of the Lua C API in the code to prevent some Lua libraries (io, system and debug) to be accessible from plugins.
The variable LC_interface was added so the plugins knows if they are run on the GUI, or the CLI

For the layers, I moved the active layer variable from the layer selection widget to CadMdiChild, it will allow plugins to access the selected layer if they run in GUI version.
The selected layer is now remembered if we move between 2 or more documents.

The layer "0" is now created with the document, and impossible to remove.

No comments

Today I worked on the Lua scripts.
I fixed a problem with the operations, Qt was adding mnemonics and the scripts could not find the widget because a "&" was present.

The luacmdinterface crash was resolved too. It was caused by an uninitialized pointer.

I began the work on the plugin manager, now it only load the Lua files, and prevent the propagation of crashes.

No comments

Today I updated the nano-signal-slot present in the repo to the latest version, the current version was causing a crash.

It took time because the new version was not using the same function names, and it caused conflicts with Qt (the emit function). The new version was not keeping the same order so it has to be changed too.

No comments

Today I finished the block implementation.
I also added an error when the file extension is not recognized and I fixed a bug with an uninitialized variable in Layer

I'll add this to master later, after doing a rebase