From: <hba...@us...> - 2014-07-07 01:43:04
|
Revision: 13136 http://sourceforge.net/p/plplot/code/13136 Author: hbabcock Date: 2014-07-07 01:42:58 +0000 (Mon, 07 Jul 2014) Log Message: ----------- Add (not yet) working smoke bindings for the qtwidget and extqt drivers. Modified Paths: -------------- trunk/bindings/qt_gui/CMakeLists.txt trunk/cmake/modules/qt.cmake Added Paths: ----------- trunk/bindings/qt_gui/smoke/ trunk/bindings/qt_gui/smoke/CMakeLists.txt trunk/bindings/qt_gui/smoke/plplotqt.h trunk/bindings/qt_gui/smoke/plplotqt.pro trunk/bindings/qt_gui/smoke/plplotqt_smoke.h trunk/bindings/qt_gui/smoke/smokeconfig.xml Modified: trunk/bindings/qt_gui/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/CMakeLists.txt 2014-07-04 10:59:42 UTC (rev 13135) +++ trunk/bindings/qt_gui/CMakeLists.txt 2014-07-07 01:42:58 UTC (rev 13136) @@ -175,4 +175,5 @@ endif(PKG_CONFIG_EXECUTABLE) add_subdirectory(pyqt4) + add_subdirectory(smoke) endif(ENABLE_qt) Added: trunk/bindings/qt_gui/smoke/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/smoke/CMakeLists.txt (rev 0) +++ trunk/bindings/qt_gui/smoke/CMakeLists.txt 2014-07-07 01:42:58 UTC (rev 13136) @@ -0,0 +1,95 @@ +# bindings/qt_gui/smoke/CMakeLists.txt +### Process this file with cmake to produce Makefile +### +# Copyright (C) 2014 Hazen Babcock +# +# This file is part of PLplot. +# +# PLplot 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; version 2 of the License. +# +# PLplot 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 Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +if(ENABLE_smoke) + + set(plplot_smoke_SRC + ${CMAKE_CURRENT_BINARY_DIR}/smokedata.cpp + ${CMAKE_CURRENT_BINARY_DIR}/x_1.cpp + ) + set_source_files_properties( + ${plplot_smoke_SRC} + PROPERTIES + GENERATED ON + COMPILE_FLAGS "-DUSINGDLL" + ) + + add_custom_command( + OUTPUT ${plplot_smoke_SRC} + COMMAND ${SMOKE_GEN_BIN} + ARGS -config "${SMOKE_GEN_SHARED}/qt-config.xml" -smokeconfig "${CMAKE_CURRENT_SOURCE_DIR}/smokeconfig.xml" -I "${CMAKE_SOURCE_DIR}/include" -- ${CMAKE_CURRENT_SOURCE_DIR}/plplotqt.h + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/smokeconfig.xml ${CMAKE_CURRENT_SOURCE_DIR}/plplotqt.h + ) + add_custom_target(generate_smoke_source + DEPENDS ${plplot_smoke_SRC} + ) + + message("DEBUG: SMOKE_GEN_BIN = ${SMOKE_GEN_BIN}") + message("DEBUG: SMOKE_GEN_SHARED = ${SMOKE_GEN_SHARED}") + + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/lib/qsastime + ${CMAKE_SOURCE_DIR}/lib/nistcd + ${CMAKE_SOURCE_DIR}/drivers + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/include + ) + + add_library(smokeplplotqt${LIB_TAG} ${plplot_smoke_SRC}) + + target_link_libraries( + smokeplplotqt${LIB_TAG} + plplotqt${LIB_TAG} + plplot${LIB_TAG} + ${QT_LIBRARIES} + ) + + add_dependencies(smokeplplotqt${LIB_TAG} generate_smoke_source) + + # Update the target COMPILE_DEFINITIONS and INCLUDE_DIRECTORIES + set_qt_target_properties(smokeplplotqt${LIB_TAG}) + + if(USE_RPATH) + + set_target_properties( + smokeplplotqt${LIB_TAG} + PROPERTIES + INSTALL_RPATH "${LIB_INSTALL_RPATH}" + INSTALL_NAME_DIR "${LIB_DIR}" + ) + + else(USE_RPATH) + set_target_properties( + smokeplplotqt${LIB_TAG} + PROPERTIES + INSTALL_NAME_DIR "${LIB_DIR}" + ) + endif(USE_RPATH) + + install(TARGETS smokeplplotqt${LIB_TAG} + EXPORT export_plplot + ARCHIVE DESTINATION ${LIB_DIR} + LIBRARY DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) + +endif(ENABLE_smoke) Added: trunk/bindings/qt_gui/smoke/plplotqt.h =================================================================== --- trunk/bindings/qt_gui/smoke/plplotqt.h (rev 0) +++ trunk/bindings/qt_gui/smoke/plplotqt.h 2014-07-07 01:42:58 UTC (rev 13136) @@ -0,0 +1 @@ +#include "qt.h" Added: trunk/bindings/qt_gui/smoke/plplotqt.pro =================================================================== --- trunk/bindings/qt_gui/smoke/plplotqt.pro (rev 0) +++ trunk/bindings/qt_gui/smoke/plplotqt.pro 2014-07-07 01:42:58 UTC (rev 13136) @@ -0,0 +1,10 @@ +TEMPLATE = lib +CONFIG += qt dll +QT += svg +HEADERS += plplotqt_smoke.h +SOURCES += smokedata.cpp +SOURCES += x_1.cpp +INCLUDEPATH = /usr/local/include/plplot/ +LIBS += -lsmokeqtcore -lsmokeqtgui -lplplotqt +VERSION = 0.0.1 +TARGET = smokeplplotqt Added: trunk/bindings/qt_gui/smoke/plplotqt_smoke.h =================================================================== --- trunk/bindings/qt_gui/smoke/plplotqt_smoke.h (rev 0) +++ trunk/bindings/qt_gui/smoke/plplotqt_smoke.h 2014-07-07 01:42:58 UTC (rev 13136) @@ -0,0 +1,15 @@ +#ifndef QT_SMOKE_H +#define QT_SMOKE_H + +#include <smoke.h> + +extern "C" SMOKE_EXPORT Smoke* plplotqt_Smoke; +extern "C" SMOKE_EXPORT void init_plplotqt_Smoke(); +extern "C" SMOKE_EXPORT void delete_plplotqt_Smoke(); + +#ifndef QGLOBALSPACE_CLASS +#define QGLOBALSPACE_CLASS +class QGlobalSpace { }; +#endif + +#endif Added: trunk/bindings/qt_gui/smoke/smokeconfig.xml =================================================================== --- trunk/bindings/qt_gui/smoke/smokeconfig.xml (rev 0) +++ trunk/bindings/qt_gui/smoke/smokeconfig.xml 2014-07-07 01:42:58 UTC (rev 13136) @@ -0,0 +1,45 @@ +<config> + <moduleName>plplotqt</moduleName> + + <!-- Our classes inherit from classes that are in the qtcore and qtgui modules. --> + <parentModules> + <module>qtcore</module> + <module>qtgui</module> + </parentModules> + + <!-- how many source files should the generator create? --> + <parts>1</parts> + + <!-- the following two sections are needed for every Qt based module! --> + <scalarTypes> + <!-- QString is a class, but represented as a scalar (#) in munged names --> + <typeName>QString</typeName> + </scalarTypes> + <voidpTypes> + <!-- both are classes, but they are represented as Smoke::t_voidp --> + <typeName>QStringList</typeName> + <typeName>QString</typeName> + </voidpTypes> + + <!-- regexps for signatures of methods and functions that we don't want + to be wrapped in the smoke module --> + <exclude> + <!-- we don't want private stuff in smoke.. --> + <signature>.*::d_ptr.*</signature> + <signature>.*::q_ptr.*</signature> + + <!-- don't include these classes. --> + <signature>.*QMutex.*</signature> + </exclude> + + <functions> + <name>plsetqtdev</name> + <name>plfreeqtdev</name> + </functions> + + <classList> + <class>QtPLDriver</class> + <class>QtPLWidget</class> + <class>QtExtWidget</class> + </classList> +</config> Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2014-07-04 10:59:42 UTC (rev 13135) +++ trunk/cmake/modules/qt.cmake 2014-07-07 01:42:58 UTC (rev 13136) @@ -52,6 +52,7 @@ # ENABLE_qt - ON means the plplot_qt library is enabled. # ENABLE_pyqt4 - ON means the plplot_pyqt4 Python extension module # is enabled. +# ENABLE_smoke - ON means the smoke plplotqt library is enabled. # SIP_EXECUTABLE - full path for sip # PYQT_SIP_DIR - sip system directory # PYQT_SIP_FLAGS - sip command flags @@ -59,9 +60,11 @@ if(DEFAULT_NO_BINDINGS) option(ENABLE_qt "Enable Qt bindings" OFF) option(ENABLE_pyqt4 "Enable pyqt4 Python extension module" OFF) + option(ENABLE_smoke "Enable smoke Qt bindings" OFF) else(DEFAULT_NO_BINDINGS) option(ENABLE_qt "Enable Qt bindings" ON) option(ENABLE_pyqt4 "Enable pyqt4 Python extension module" ON) + option(ENABLE_smoke "Enable smoke Qt bindings" ON) endif(DEFAULT_NO_BINDINGS) if(ENABLE_qt) @@ -341,3 +344,17 @@ # COMMAND will work properly with these flags later on. string(REGEX REPLACE " " ";" PYQT_SIP_FLAGS "${PYQT_SIP_FLAGS}") endif(ENABLE_pyqt4) + +if(ENABLE_smoke) + find_package(Smoke) + if(NOT SMOKE_GEN_BIN) + message(STATUS + "WARNING: smoke not found so setting ENABLE_smoke to OFF." + ) + set(ENABLE_smoke OFF CACHE BOOL "Enable smoke Qt extension module " FORCE) + endif(NOT SMOKE_GEN_BIN) + + # Doesn't work so disable. + set(ENABLE_smoke OFF CACHE BOOL "Enable smoke Qt extension module " FORCE) + +endif(ENABLE_smoke) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |