Skip to content

Commit

Permalink
Start: Recreate start as a QtWidgets-based app
Browse files Browse the repository at this point in the history
Removes all Start network access and dependency on Chromium for rendering. Written
entirely in C++ (no HTML, CSS, JS, etc.).
  • Loading branch information
chennes committed Apr 22, 2024
1 parent 1f9be3f commit ef189f8
Show file tree
Hide file tree
Showing 36 changed files with 2,209 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "tests/lib"]
path = tests/lib
url = https://github.com/google/googletest
[submodule "src/3rdParty/GSL"]
path = src/3rdParty/GSL
url = https://github.com/microsoft/GSL
32 changes: 30 additions & 2 deletions cMake/FreeCAD_Helpers/PrintFinalReport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,39 @@ macro(PrintFinalReport)
value(FREECAD_CREATE_MAC_APP)
value(FREECAD_USE_PYBIND11)
value(FREECAD_USE_EXTERNAL_KDL)
value(BUILD_ADDONMGR)
value(BUILD_ARCH)
value(BUILD_ASSEMBLY)
value(BUILD_CLOUD)
value(BUILD_DRAFT)
value(BUILD_DRAWING)
value(BUILD_FEM)
value(BUILD_WEB)
value(BUILD_GUI)
value(BUILD_HELP)
value(BUILD_IDF)
value(BUILD_IMPORT)
value(BUILD_INSPECTION)
value(BUILD_JTREADER)
value(BUILD_MATERIAL)
value(BUILD_MESH)
value(BUILD_MESH_PART)
value(BUILD_OPENSCAD)
value(BUILD_PART)
value(BUILD_PART_DESIGN)
value(BUILD_PATH)
value(BUILD_PLOT)
value(BUILD_POINTS)
value(BUILD_REVERSEENGINEERING)
value(BUILD_ROBOT)
value(BUILD_SANDBOX)
value(BUILD_SHOW)
value(BUILD_SKETCHER)
value(BUILD_SPREADSHEET)
value(BUILD_START)
value(BUILD_SURFACE)
value(BUILD_TECHDRAW)
value(BUILD_TEST)
value(BUILD_TUX)
value(BUILD_WEB)
value(CMAKE_INSTALL_PREFIX)
value(USE_CUDA)
value(USE_OPENCV)
Expand Down
1 change: 1 addition & 0 deletions src/3rdParty/GSL
Submodule GSL added at b39e7e
1 change: 1 addition & 0 deletions src/Gui/Icons/resource.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<file>list-add.svg</file>
<file>freecad.svg</file>
<file>freecad-doc.png</file>
<file>freecad-doc.svg</file>
<file>bulb.svg</file>
<file>TextDocument.svg</file>
<file>button_down.svg</file>
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Assembly/Gui/Resources/Assembly.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<file>panels/TaskAssemblyInsertLink.ui</file>
<file>preferences/Assembly.ui</file>
<file>icons/Assembly_CreateJointDistance.svg</file>
<file>icons/AssemblyWorkbench.svg</file>
</qresource>
</RCC>
4 changes: 4 additions & 0 deletions src/Mod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if(BUILD_ASSEMBLY)
add_subdirectory(Assembly)
endif(BUILD_ASSEMBLY)

if(BUILD_CLEANSTART)
add_subdirectory(CleanStart)
endif(BUILD_CLEANSTART)

if(BUILD_CLOUD)
add_subdirectory(Cloud)
endif(BUILD_CLOUD)
Expand Down
60 changes: 60 additions & 0 deletions src/Mod/CleanStart/App/AppCleanStart.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/****************************************************************************
* *
# Copyright (c) 2024 The FreeCAD Project Association AISBL *
* *
* This file is part of FreeCAD. *
* *
* FreeCAD is free software: you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 2.1 of the *
* License, or (at your option) any later version. *
* *
* FreeCAD is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with FreeCAD. If not, see *
* <https://www.gnu.org/licenses/>. *
* *
***************************************************************************/

#include "PreCompiled.h"

#include <Base/Interpreter.h>
#include <Base/Tools.h>
#include <Base/Console.h>

#include <Base/PyObjectBase.h>

#include <3rdParty/GSL/include/gsl/pointers>

namespace CleanStart
{
class Module: public Py::ExtensionModule<Module>
{
public:
Module()
: Py::ExtensionModule<Module>("CleanStart")
{
initialize("This module is the CleanStart module."); // register with Python
}
};

PyObject* initModule()
{
auto newModule = gsl::owner<Module *>(new Module);
return Base::Interpreter().addModule(newModule); // Transfer ownership
}

} // namespace CleanStart

/* Python entry */
PyMOD_INIT_FUNC(CleanStart)
{
PyObject* mod = CleanStart::initModule();
Base::Console().Log("Loading CleanStart module... done\n");
PyMOD_Return(mod);
}
50 changes: 50 additions & 0 deletions src/Mod/CleanStart/App/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# /****************************************************************************
# * *
# * Copyright (c) 2024 The FreeCAD Project Association AISBL *
# * *
# * This file is part of FreeCAD. *
# * *
# * FreeCAD is free software: you can redistribute it and/or modify it *
# * under the terms of the GNU Lesser General Public License as *
# * published by the Free Software Foundation, either version 2.1 of the *
# * License, or (at your option) any later version. *
# * *
# * FreeCAD is distributed in the hope that it will be useful, but *
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
# * Lesser General Public License for more details. *
# * *
# * You should have received a copy of the GNU Lesser General Public *
# * License along with FreeCAD. If not, see *
# * <https://www.gnu.org/licenses/>. *
# * *
# ***************************************************************************/

include_directories(
${PYTHON_INCLUDE_DIRS}
${QtCore_INCLUDE_DIRS}
)

set(CleanStart_LIBS
FreeCADApp
)

SET(CleanStart_SRCS
AppCleanStart.cpp
DisplayedFilesModel.cpp
DisplayedFilesModel.h
ExamplesModel.cpp
ExamplesModel.h
PreCompiled.cpp
PreCompiled.h
RecentFilesModel.cpp
RecentFilesModel.h)

add_library(CleanStart SHARED ${CleanStart_SRCS})
target_link_libraries(CleanStart ${CleanStart_LIBS})

SET_BIN_DIR(CleanStart CleanStart /Mod/CleanStart)
SET_PYTHON_PREFIX_SUFFIX(CleanStart)

INSTALL(TARGETS CleanStart DESTINATION ${CMAKE_INSTALL_LIBDIR})
Loading

0 comments on commit ef189f8

Please sign in to comment.