Skip to content

Commit

Permalink
Initial implementation of Spreadsheet module (C++ version) by Eivind …
Browse files Browse the repository at this point in the history
…Kvedalen.

Various fixes for Windows by
Peter Lama <peterldev94@gmail.com>
Werner Mayer <wmayer@users.sourceforge.net>
  • Loading branch information
eivindkv authored and wwmayer committed Feb 13, 2015
1 parent 8ec6b34 commit 383ffa6
Show file tree
Hide file tree
Showing 80 changed files with 27,082 additions and 1,217 deletions.
52 changes: 52 additions & 0 deletions src/Mod/Spreadsheet/App/AppSpreadsheet.cpp
@@ -0,0 +1,52 @@
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* for detail see the LICENCE text file. *
* Jrgen Riegel 2002 *
* Eivind Kvedalen 2015 *
* *
***************************************************************************/

#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif

#include <Base/Console.h>
#include "Sheet.h"
#include "Expression.h"


/* registration table */
static struct PyMethodDef Spreadsheet_methods[] = {
{NULL, NULL} /* end of table marker */
};

/* Python entry */
extern "C" {
void SpreadsheetExport initSpreadsheet() {
(void) Py_InitModule("Spreadsheet", Spreadsheet_methods); /* mod name, table ptr */
Base::Console().Log("Loading Spreadsheet module... done\n");

Spreadsheet::PropertyColumnWidths::init();
Spreadsheet::PropertyRowHeights::init();
Spreadsheet::PropertySheet::init();

Spreadsheet::Sheet::init();
Spreadsheet::Expression::init();
Spreadsheet::UnitExpression::init();
Spreadsheet::NumberExpression::init();
Spreadsheet::ConstantExpression::init();
Spreadsheet::FunctionExpression::init();
Spreadsheet::OperatorExpression::init();
Spreadsheet::VariableExpression::init();
Spreadsheet::ConditionalExpression::init();
Spreadsheet::StringExpression::init();

return;
}

} // extern "C"
69 changes: 69 additions & 0 deletions src/Mod/Spreadsheet/App/CMakeLists.txt
@@ -0,0 +1,69 @@
if(WIN32)
add_definitions(-DFCAppSpreadsheet)
endif(WIN32)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${PYTHON_INCLUDE_PATH}
${Boost_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}
${XERCESC_INCLUDE_DIR}
${QT_INCLUDE_DIR}
)

set(Spreadsheet_LIBS
FreeCADApp
)

set(Spreadsheet_SRCS
Expression.cpp
Expression.h
Cell.cpp
Cell.h
DisplayUnit.h
PropertySheet.cpp
PropertySheet.h
PropertySheetPy.xml
PropertySheetPyImp.cpp
PropertyColumnWidths.cpp
PropertyColumnWidths.h
PropertyColumnWidthsPy.xml
PropertyColumnWidthsPyImp.cpp
PropertyRowHeights.cpp
PropertyRowHeights.h
PropertyRowHeightsPy.xml
PropertyRowHeightsPyImp.cpp
PreCompiled.cpp
PreCompiled.h
Sheet.cpp
Sheet.h
SheetPy.xml
SheetPyImp.cpp
SheetObserver.cpp
SheetObserver.h
Utils.cpp
Utils.h
Range.h
Range.cpp
AppSpreadsheet.cpp
)

generate_from_xml(SheetPy)
generate_from_xml(PropertySheetPy)
generate_from_xml(PropertyColumnWidthsPy)
generate_from_xml(PropertyRowHeightsPy)

add_library(Spreadsheet SHARED ${Spreadsheet_SRCS})
target_link_libraries(Spreadsheet ${Spreadsheet_LIBS})


fc_target_copy_resource(Spreadsheet
${CMAKE_SOURCE_DIR}/src/Mod/Spreadsheet
${CMAKE_BINARY_DIR}/Mod/Spreadsheet
Init.py)

SET_BIN_DIR(Spreadsheet Spreadsheet /Mod/Spreadsheet)
SET_PYTHON_PREFIX_SUFFIX(Spreadsheet)

INSTALL(TARGETS Spreadsheet DESTINATION ${CMAKE_INSTALL_LIBDIR})

0 comments on commit 383ffa6

Please sign in to comment.