Commit f8280379 authored by nschnitz's avatar nschnitz

Merge branch 'master' of github.com:d-tk/dtk

parents a900295e b4990506
......@@ -36,6 +36,8 @@ set(dtk_VERSION
## Path setup
## ###################################################################
include(GNUInstallDirs)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
......@@ -65,7 +67,6 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(GNUInstallDirs)
include(GenerateExportHeader)
if(APPLE)
......@@ -114,6 +115,7 @@ option(DTK_BUILD_COMPOSER "Build composer layer" false)
option(DTK_BUILD_DISTRIBUTED "Build distributed layer" true)
option(DTK_BUILD_SCRIPT "Build script layer" false)
option(DTK_BUILD_WRAPPERS "Build wrappers" false)
option(DTK_BUILD_WIDGETS "Build widgets" true)
option(DTK_BUILD_SUPPORT_CORE "Build support layer" false)
option(DTK_BUILD_SUPPORT_CONTAINER "Build support layer" false)
option(DTK_BUILD_SUPPORT_COMPOSER "Build support layer" false)
......@@ -385,6 +387,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/dtkMath)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/dtkMeta)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/dtkScript)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/dtkTest)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/dtkWidgets)
## ###################################################################
## Input
......@@ -442,6 +445,7 @@ mark_as_advanced(Qt5Qml_DIR)
mark_as_advanced(Qt5Quick_DIR)
mark_as_advanced(Qt5QuickTest_DIR)
mark_as_advanced(Qt5Script_DIR)
mark_as_advanced(Qt5Svg_DIR)
mark_as_advanced(Qt5Test_DIR)
mark_as_advanced(Qt5Widgets_DIR)
mark_as_advanced(Qt5Xml_DIR)
......
......@@ -399,7 +399,7 @@ dtkCreatorMainWindow::dtkCreatorMainWindow(QWidget *parent) : QMainWindow(parent
d->inner = new dtkSplitter(this);
d->inner->setOrientation(Qt::Horizontal);
d->inner->addWidget(left);
d->inner->addWidget(d->graph);
// d->inner->addWidget(d->graph);
d->inner->addWidget(d->composer);
d->inner->addWidget(right);
d->inner->setSizes(QList<int>()
......@@ -636,7 +636,7 @@ void dtkCreatorMainWindow::switchToCompo(void)
// d->distributor->setVisible(false);
d->view_manager->setVisible(false);
d->graph->setVisible(false);
// d->graph->setVisible(false);
// d->log_view->setVisible(false);
d->inner->setSizes(QList<int>() << d->wl << 0 << this->size().width() - d->wl - d->wr << d->wr);
......@@ -664,7 +664,7 @@ void dtkCreatorMainWindow::switchToDstrb(void)
// d->distributor->setVisible(true);
d->view_manager->setVisible(false);
d->graph->setVisible(false);
// d->graph->setVisible(false);
// d->log_view->setVisible(false);
d->inner->setSizes(QList<int>() << d->wl << 0 << this->size().width() - d->wl - d->wr << d->wr);
......@@ -692,7 +692,7 @@ void dtkCreatorMainWindow::switchToDebug(void)
// d->distributor->setVisible(false);
d->view_manager->setVisible(false);
d->graph->setVisible(true);
// d->graph->setVisible(true);
// d->log_view->setVisible(true);
int w = this->size().width() - d->wl - d->wr;
......@@ -722,7 +722,7 @@ void dtkCreatorMainWindow::switchToView(void)
// d->distributor->setVisible(false);
d->view_manager->setVisible(true);
d->graph->setVisible(false);
// d->graph->setVisible(false);
// d->log_view->setVisible(false);
}
......
......@@ -21,7 +21,7 @@
int main(int argc, char **argv)
{
dtkApplication *application = dtkApplication::create(argc, argv);
dtkCoreApplication *application = dtkCoreApplication::create(argc, argv);
application->setApplicationName("dtkDistributedServer");
application->setApplicationVersion("1.0.0");
application->setOrganizationName("inria");
......
......@@ -29,6 +29,7 @@ target_link_libraries(${PROJECT_NAME}
dtkCore
dtkDistributed
dtkLog
dtkWidgets
)
target_link_libraries(${PROJECT_NAME} Qt5::Core)
......
......@@ -18,6 +18,7 @@
#include <dtkDistributed>
#include <dtkLog>
#include <dtkWidgets/dtkDistributedGuiApplication.h>
#include <QtCore>
......@@ -58,7 +59,7 @@ public:
int main(int argc, char **argv)
{
dtkDistributedApplication *app = dtkDistributed::create(argc, argv);
dtkDistributedGuiApplication *app = dtkDistributedGuiApplication::create(argc, argv);
app->setApplicationName("dtkDistributedSlave");
app->setApplicationVersion("1.0.0");
app->setOrganizationName("inria");
......
......@@ -179,7 +179,7 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname
${_testrunner} ${ARGV3}
# Running gcovr
COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/' -o ${_outputname}.xml
COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/build/' -e '${CMAKE_SOURCE_DIR}/tst/' -o ${_outputname}.xml
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Running gcovr to produce Cobertura code coverage report."
)
......
......@@ -31,7 +31,6 @@ set(dtk_INCLUDE_DIRS
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkMath"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkMeta"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkTest"
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkWidgets"
"@CMAKE_CURRENT_BINARY_DIR@")
include("@CMAKE_BINARY_DIR@/dtkDepends.cmake")
......@@ -57,6 +56,7 @@ set(DTK_BUILD_DISTRIBUTED @DTK_BUILD_DISTRIBUTED@)
set(DTK_BUILD_COMPOSER @DTK_BUILD_COMPOSER@)
set(DTK_BUILD_SCRIPT @DTK_BUILD_SCRIPT@)
set(DTK_BUILD_WRAPPERS @DTK_BUILD_WRAPPERS@)
set(DTK_BUILD_WIDGETS @DTK_BUILD_WIDGETS@)
set(DTK_BUILD_SUPPORT_CORE @DTK_BUILD_SUPPORT_CORE@)
set(DTK_BUILD_SUPPORT_CONTAINER @DTK_BUILD_SUPPORT_CONTAINER@)
set(DTK_BUILD_SUPPORT_COMPOSER @DTK_BUILD_SUPPORT_COMPOSER@)
......@@ -79,5 +79,10 @@ if(DTK_BUILD_COMPOSER)
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkComposer")
endif(DTK_BUILD_COMPOSER)
if(DTK_BUILD_WIDGETS)
set(dtk_INCLUDE_DIRS ${dtk_INCLUDE_DIRS}
"@CMAKE_CURRENT_SOURCE_DIR@/src/dtkWidgets")
endif(DTK_BUILD_WIDGETS)
######################################################################
### dtkConfig.cmake.in ends here
......@@ -28,7 +28,11 @@ set(dtk_INCLUDE_DIRS
"@CMAKE_INSTALL_PREFIX@/include/dtkLog"
"@CMAKE_INSTALL_PREFIX@/include/dtkMath"
"@CMAKE_INSTALL_PREFIX@/include/dtkMeta"
"@CMAKE_INSTALL_PREFIX@/include/dtkTest")
"@CMAKE_INSTALL_PREFIX@/include/dtkTest"
"@CMAKE_INSTALL_PREFIX@/include/dtkWidgets")
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH} "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake/dtk/")
set(DTK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
......@@ -54,6 +58,7 @@ set(DTK_BUILD_DISTRIBUTED @DTK_BUILD_DISTRIBUTED@)
set(DTK_BUILD_COMPOSER @DTK_BUILD_COMPOSER@)
set(DTK_BUILD_SCRIPT @DTK_BUILD_SCRIPT@)
set(DTK_BUILD_WRAPPERS @DTK_BUILD_WRAPPERS@)
set(DTK_BUILD_WIDGETS @DTK_BUILD_WIDGETS@)
set(DTK_BUILD_SUPPORT_CORE @DTK_BUILD_SUPPORT_CORE@)
set(DTK_BUILD_SUPPORT_CONTAINER @DTK_BUILD_SUPPORT_CONTAINER@)
set(DTK_BUILD_SUPPORT_COMPOSER @DTK_BUILD_SUPPORT_COMPOSER@)
......@@ -76,6 +81,23 @@ if(DTK_BUILD_COMPOSER)
"@CMAKE_INSTALL_PREFIX@/include/dtkComposer")
endif(DTK_BUILD_COMPOSER)
if(DTK_BUILD_WIDGETS)
set(dtk_INCLUDE_DIRS ${dtk_INCLUDE_DIRS}
"@CMAKE_INSTALL_PREFIX@/include/dtkWidgets")
endif(DTK_BUILD_WIDGETS)
## ###################################################################
## Always full RPATH
## ###################################################################
include(GNUInstallDirs)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
ENDIF("${isSystemDir}" STREQUAL "-1")
######################################################################
### dtkConfig.cmake.in ends here
......@@ -105,6 +105,20 @@ add_custom_target(dtkDistributed-doc
add_dependencies(dtkDistributed-doc dtkCore-doc)
## ###################################################################
## dtkComposer
## ###################################################################
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dtkComposer/dtkcomposer.qdocconf.in ${CMAKE_CURRENT_BINARY_DIR}/dtkcomposer.qdocconf IMMEDIATE @ONLY)
add_custom_target(dtkComposer-doc
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${DTK_QDOC_EXECUTABLE} dtkcomposer.qdocconf
COMMAND ${QT5_QHGN_EXECUTABLE} ${dtk_INSTALL_DOCS}/dtkcomposer/dtkcomposer.qhp -o ${dtk_INSTALL_DOCS}/dtkcomposer.qch
COMMENT "-- Generating dtkComposer documentation")
add_dependencies(dtkComposer-doc dtkCore-doc)
## ###################################################################
## ALL
## ###################################################################
......@@ -115,7 +129,7 @@ add_custom_target(doc
COMMAND ${QT5_QHGN_EXECUTABLE} ${dtk_INSTALL_DOCS}/dtkdoc/dtkdoc.qhp -o ${dtk_INSTALL_DOCS}/dtkdoc.qch
COMMENT "-- Generating dtk documentation")
add_dependencies(doc dtkMeta-doc dtkLog-doc dtkCore-doc dtkDistributed-doc)
add_dependencies(doc dtkMeta-doc dtkLog-doc dtkCore-doc dtkDistributed-doc dtkComposer-doc)
######################################################################
### CMakeLists.txt ends here
......@@ -48,6 +48,7 @@ indexes = \
@dtk_INSTALL_DOCS@/dtklog/dtklog.index \
@dtk_INSTALL_DOCS@/dtkmeta/dtkmeta.index \
@dtk_INSTALL_DOCS@/dtkcore/dtkcore.index \
@dtk_INSTALL_DOCS@/dtkcomposer/dtkcomposer.index \
@dtk_INSTALL_DOCS@/dtkdistributed/dtkdistributed.index \
@dtk_INSTALL_DOCS@/dtkio/dtkio.index \
@dtk_INSTALL_DOCS@/dtklinearalgebradense/dtklinearalgebradense.index \
......
/* dtk-allAPI.qdoc ---
*
* Author: Thibaud Kloczko
* Created: mer. avril 9 10:18:20 2014 (+0200)
* Version:
* Last-Updated: lun. nov. 23 14:17:46 2015 (+0100)
* By: Thibaud Kloczko
* Update #: 5
*/
// Version: $Id$
//
//
/* Change Log:
*
*/
// Commentary:
//
//
// Change Log:
//
//
// Code:
/*!
\group dtk-allAPI
......@@ -20,4 +20,6 @@
This page lists the C++ APIs in dtk. The \l{All Modules} page contains a list
of all dtk modules.
*/
1
//
// dtk-allAPI.qdoc ends here
// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
/*!
\page dtk-coding-style.html
\title dtk Coding Style
\brief Description of dtk coding style.
\section1 Introduction
This document describes the recommended coding style for dtk. Nobody
is forced to use this style, but to have consistent formatting of
the source code files it is recommended to make use of it.
dtk coding style follows the \l
{http://wiki.qt.io/Qt_Coding_Style}{Qt coding style}, with few
differences desribed here after.
\section1 Indentation
\list
\li 4 spaces
\li no tab
\endlist
\section1 Variable declaration
\list
\li Declare each variable on a separate line
\li Avoid abbreviations and meaningless names (\e {e.g.} "a",
"rabarr", "toto")
\li Take useful names. No short names, except:
\list
\li Single character variable names can denote counters and
temporary variables whose purpose is obvious.
\endlist
\li Variable name are lower case and each part of the name is
separated with underscore.
\li Functions, methods and classes start with lower-case
letter. Each consecutive word in their names start with an
upper-case letter.
\li typedef and acronyms are camel-cased (\e {e.g.} dtkMesherCgal
rather than dtkMesherCGAL)
\endlist
Examples:
\code
// wrong
dtkSparseSolver *ss;
dtkSparseMatrix *mtx;
// correct
dtkSparseSolver *sparse_solver;
dtkSparseMatrix *sparse_matrix;
\endcode
\section1 Member variables
\list
\li When using a d-pointer, the member variable declaration follows
the above rules.
\li When variables are declared directly as member of a class, their
name is asked to start with the prefix 'm_'
\endlist
Examples:
\code
// wrong
class dtkConcreteDummy
{
private:
int _counter;
double value_;
};
// correct
class dtkConcreteDummy
{
private:
int m_counter;
double m_value;
};
\endcode
\section1 Member methods
\list
\li Setter methods start with the prefix 'set' in lower case.
\li The getter methods do not start with 'get'.
\li When argument list is empty, the keyword \e{void} is used.
\li Users are asked to group setter and getter methods in a
consistent way by using \e{public} keyword as separator.
\endlist
Examples:
\code
// wrong
class dtkConcreteDummy
{
public:
void SetCounter(int counter);
double getValue();
};
// correct
class dtkConcreteDummy
{
public:
void setCounter(int counter);
public:
double value(void);
};
\endcode
\section1 Whitespaces
\list
\li Use blank lines to group statements together
\li Always use only one blank line
\li Always use a single space after a keyword and before a curly brace:
\endlist
\code
// wrong
if(foo){
}
// correct
if (foo) {
}
\endcode
\list
\li For pointers always use a single space between the type and '*'
but no space between the '*' and the variable name
\li For references, use no space between the type and the '&' but
always a single space between the '&' and the variable name
\endlist
\code
// wrong
char* my_char;
const QString &my_string;
// correct
char *my_char;
const QString& my_string;
\endcode
\list
\li Surround binary operators with spaces
\endlist
\code
// wrong
for (int i=0;i<N;++i) {
dtkDebug() << i;
}
// correct
for (int i = 0; i < N; ++i) {
dtkDebug() << i;
}
\endcode
\list
\li No space after a cast
\li Avoid C-style casts when possible
\endlist
\code
// wrong
char *block_of_memory = (char*) malloc(data.size());
// correct
char *block_of_memory = reinterpret_cast<char *>(malloc(data.size()));
\endcode
\list
\li Do not put multiple statements on one line
\li By extension, use a new line for the body of a control flow statement:
\endlist
\code
// wrong
if (foo) bar();
// correct
if (foo) {
bar();
}
\endcode
\section1 Braces
\list
\li As a base rule, the left curly brace goes on the same line as
the start of the statement.
\endlist
\code
// wrong
if (true)
{
}
else
{
}
// correct
if (true) {
} else {
}
\endcode
\list
\li The rule differs for function implementations, class, struct and
namespace declarations. In this case, the opening brace always
starts on a line.
\endlist
\code
static void foo(int g)
{
dtkDebug() << "foo: " << g;
}
class dtkAbstractConcept
{
};
\endcode
\list
\li Use curly braces even when the body of a conditional statement
contains only one line.
\endlist
Example:
\code
// wrong
if (true)
return true;
for (int i = 0; i < 10; ++i)
dtkDebug() << i;
// correct
if (true) {
return true;
}
for (int i = 0; i < 10; ++i) {
dtkDebug() << i;
}
\endcode
\section1 Parenthesis
\list
\li Use parentheses to group expressions:
\endlist
\code
// wrong
if (a && b || c)
// correct
if ((a && b) || c)
// wrong
a + b & c
// correct
(a + b) & c
\endcode
\section1 Switch statements
\list
\li The case labels are in the same column as the switch
\li Every case must have a break (or return) statement at the end or
a comment to indicate that there's intentionally no break, unless
another case follows immediately.
\endlist
\code
switch (myEnum) {
case Value1:
doSomething();
break;
case Value2:
case Value3:
doSomethingElse();
// fall through
default:
defaultHandling();
break;
}
\endcode
\section1 Jump statements
\list
\li Do not put 'else' after jump statements
\endlist
\code
// Wrong
if (this_or_that) {
return;
} else {
somethingElse();
}
// Correct
if (this_or_that) {
return;
}
somethingElse();
\endcode
\section1 Line breaks
\list
\li Line size is not limited provided the code is readable.
\li When breaking a line, commas go at the end of wrapped lines;
operators start at the beginning of the new lines. An operator at
the end of the line is easy to miss if the editor is too narrow.
\endlist
\code
// Wrong
if (long_expression +
other_long_expression +
another_long_expression) {
}
// Correct
if (long_expression
+ other_long_expression
+ anothero_ther_long_expression) {
}
\endcode
\section1 Qt includes
\list
\li When including Qt classes, prefer the inclusion of the full