From: Enar Väikene Date: Tue, 29 Nov 2011 13:01:36 +0000 (+0200) Subject: Added the GuiLib library and the Gui::Window class. X-Git-Url: https://vaikene.ee/gitweb/overview.html?a=commitdiff_plain;h=5748bd7fdfa26ef2dd56735f2b7f77ad02c16ae0;p=evaf Added the GuiLib library and the Gui::Window class. The GuiLib library contains common GUI functions and classes. The Gui::Window class is the common ancestor for all the eVaf windows. --- diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt index 918e3ce..09e2f82 100644 --- a/src/libs/CMakeLists.txt +++ b/src/libs/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(Plugins) add_subdirectory(Common) +add_subdirectory(Gui) diff --git a/src/libs/Gui/CMakeLists.txt b/src/libs/Gui/CMakeLists.txt new file mode 100644 index 0000000..fab0577 --- /dev/null +++ b/src/libs/Gui/CMakeLists.txt @@ -0,0 +1,37 @@ +# Name of the target +set(TARGET GuiLib) + +# Qt modules +include(${QT_USE_FILE}) + +# Needed for exporting/importing symbols +add_definitions(-DGUI_LIBRARY) + +# Include files +include_directories(${eVaf_INCLUDE}) + +# Required eVaf libraries +set(eVaf_LIBRARIES) + +# Source files +set(SRCS + window.cpp +) + +# Header files for the meta-object compiler +set(MOC_HDRS + window.h +) + +# Version info resource file for Windows builds +if(WIN32) + set(SRCS ${SRCS} version.rc) +endif(WIN32) + +qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS}) + +add_library(${TARGET} SHARED ${SRCS} ${MOC_SRCS}) + +target_link_libraries(${TARGET} ${QT_LIBRARIES} ${eVaf_LIBRARIES}) + +install(TARGETS ${TARGET} DESTINATION bin) diff --git a/src/libs/Gui/Window b/src/libs/Gui/Window new file mode 100644 index 0000000..80b3d1c --- /dev/null +++ b/src/libs/Gui/Window @@ -0,0 +1 @@ +#include "window.h" diff --git a/src/libs/Gui/libgui.h b/src/libs/Gui/libgui.h new file mode 100644 index 0000000..b67d9be --- /dev/null +++ b/src/libs/Gui/libgui.h @@ -0,0 +1,30 @@ +/** + * @file Gui/libgui.h + * @author Enar Vaikene + * + * Copyright (c) 2011 Enar Vaikene + * + * This file is part of the eVaf C++ cross-platform application development framework. + * + * This file can be used under the terms of the GNU General Public License + * version 3.0 as published by the Free Software Foundation and appearing in + * the file LICENSE included in the packaging of this file. Please review the + * the following information to ensure the GNU General Public License version + * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + * + * Alternatively, this file may be used in accordance with the Commercial License + * Agreement provided with the Software. + */ + +#ifndef __GUI_LIBCOMMON_H +# define __GUI_LIBCOMMON_H + +#include + +#if defined(GUI_LIBRARY) +# define GUI_EXPORT Q_DECL_EXPORT +#else +# define GUI_EXPORT Q_DECL_IMPORT +#endif + +#endif // libgui.h diff --git a/src/libs/Gui/version.h b/src/libs/Gui/version.h new file mode 100644 index 0000000..a298704 --- /dev/null +++ b/src/libs/Gui/version.h @@ -0,0 +1,60 @@ +/** + * @file Gui/version.h + * @brief Version information for eVaf modules + * @author Enar Vaikene + * + * Copyright (c) 2011 Enar Vaikene + * + * This file is part of the eVaf C++ cross-platform application development framework. + * + * This file can be used under the terms of the GNU General Public License + * version 3.0 as published by the Free Software Foundation and appearing in + * the file LICENSE included in the packaging of this file. Please review the + * the following information to ensure the GNU General Public License version + * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + * + * Alternatively, this file may be used in accordance with the Commercial License + * Agreement provided with the Software. + */ + +#ifndef __GUI_VERSION_H +# define __GUI_VERSION_H + +#include + +/** + * Module/library version number in the form major,minor,release,build + */ +#define VER_FILE_VERSION 0,1,1,1 + +/** + * Module/library version number in the string format (shall end with \0) + */ +#define VER_FILE_VERSION_STR "0.1.1.1\0" + +/** + * Module/library name (shall end with \0) + */ +#define VER_MODULE_NAME_STR "GuiLib\0" + +/** + * Module type (see version_rc.h for all the types) + */ +#define VER_MODULE_TYPE MT_GENERIC + +/** + * Module type in the string format (see version_rc for all the types) + */ +#define VER_MODULE_TYPE_STR MT_GENERIC + +/** + * Original file name for windows (shall end with \0) + */ +#define VER_ORIGINAL_FILE_NAME_STR "GuiLib.dll\0" + +/** + * Description of the module/library (shall end with \0) + */ +#define VER_FILE_DESCRIPTION_STR "Library for eVaf applications implementing common GUI interfaces, functions and classes.\0" + +#endif // version.h diff --git a/src/libs/Gui/version.rc b/src/libs/Gui/version.rc new file mode 100644 index 0000000..dc65d89 --- /dev/null +++ b/src/libs/Gui/version.rc @@ -0,0 +1,54 @@ +/** + * @file Gui/version.rc + * @brief Windows resource file with module/library version information. + * @author Enar Vaikene + * + * Copyright (c) 2011 Enar Vaikene + * + * This file is part of the eVaf C++ cross-platform application development framework. + * + * This file can be used under the terms of the GNU General Public License + * version 3.0 as published by the Free Software Foundation and appearing in + * the file LICENSE included in the packaging of this file. Please review the + * the following information to ensure the GNU General Public License version + * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + * + * Alternatively, this file may be used in accordance with the Commercial License + * Agreement provided with the Software. + */ + +#include "version.h" +#include +#include + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VER_FILE_VERSION + PRODUCTVERSION VER_PRODUCT_VERSION + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", VER_COMPANY_NAME_STR + VALUE "FileDescription", VER_FILE_DESCRIPTION_STR + VALUE "FileVersion", VER_FILE_VERSION_STR + VALUE "LegalCopyright", VER_LEGAL_COPYRIGHT_STR + VALUE "OriginalFilename", VER_ORIGINAL_FILE_NAME_STR + VALUE "ProductName", VER_PRODUCT_NAME_STR + VALUE "ProductVersion", VER_PRODUCT_VERSION_STR + VALUE "Build Date", VER_PRODUCT_DATE_STR + VALUE "Module Name", VER_MODULE_NAME_STR + VALUE "Module Type", VER_MODULE_TYPE_STR + END + END + END diff --git a/src/libs/Gui/window.cpp b/src/libs/Gui/window.cpp new file mode 100644 index 0000000..880e118 --- /dev/null +++ b/src/libs/Gui/window.cpp @@ -0,0 +1,31 @@ +/** + * @file Gui/window.cpp + * @brief Version information for eVaf modules + * @author Enar Vaikene + * + * Copyright (c) 2011 Enar Vaikene + * + * This file is part of the eVaf C++ cross-platform application development framework. + * + * This file can be used under the terms of the GNU General Public License + * version 3.0 as published by the Free Software Foundation and appearing in + * the file LICENSE included in the packaging of this file. Please review the + * the following information to ensure the GNU General Public License version + * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + * + * Alternatively, this file may be used in accordance with the Commercial License + * Agreement provided with the Software. + */ + +#include "window.h" + +using namespace eVaf; + +//------------------------------------------------------------------- + +Gui::Window::Window(QWidget * parent) + : QWidget(parent) +{} + +Gui::Window::~Window() +{} diff --git a/src/libs/Gui/window.h b/src/libs/Gui/window.h new file mode 100644 index 0000000..07d3bd3 --- /dev/null +++ b/src/libs/Gui/window.h @@ -0,0 +1,60 @@ +/** + * @file Gui/window.h + * @brief Version information for eVaf modules + * @author Enar Vaikene + * + * Copyright (c) 2011 Enar Vaikene + * + * This file is part of the eVaf C++ cross-platform application development framework. + * + * This file can be used under the terms of the GNU General Public License + * version 3.0 as published by the Free Software Foundation and appearing in + * the file LICENSE included in the packaging of this file. Please review the + * the following information to ensure the GNU General Public License version + * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + * + * Alternatively, this file may be used in accordance with the Commercial License + * Agreement provided with the Software. + */ + +#ifndef __GUI_WINDOW_H +# define __GUI_WINDOW_H + +#include "libgui.h" + +#include + +namespace eVaf { + +/** + * Common eVaf GUI library. + * + * This library contains common Graphical User Interface functions and classes for eVaf applications. + * This library is a required dependency for all the eVaf modules that implement elements of the GUI. + */ +namespace Gui { + +/** + * eVaf GUI window class. + * @code#include @endcode + * + * The Gui::Window class is a common ancestor for all the windows in eVaf applications. Objects of Gui::Window class + * can be added to one of the eVaf Window managers. + */ +class GUI_EXPORT Window : public QWidget +{ + Q_OBJECT + +public: + + Window(QWidget * parent = 0); + + virtual ~Window(); + +}; + +} // namespace eVaf::Gui +} // namespace eVaf + + +#endif // window.h