diff -Nru tupi-0.2+git04/configure tupi-0.2+git05/configure --- tupi-0.2+git04/configure 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure 2014-12-15 14:21:32.000000000 +0000 @@ -35,12 +35,8 @@ # along with this program. If not, see . # ########################################################################### -function checkQt { - hash qmake-qt4 2>&- || { echo >&2 "Fatal error: Package \"qmake/qmake-qt4\" is not installed on your system. Aborting..."; exit 1; } -} - hash ruby 2>&- || { echo >&2 "Fatal error: Package \"ruby\" is not installed on your system. Aborting..."; exit 1; } -hash qmake 2>&- || checkQt +hash qmake 2>&- || { echo >&2 "Fatal error: Package \"qmake\" is not installed on your system. Aborting..."; exit 1; } export RUBYLIB=.:${RUBYLIB} ruby configure.rb $* diff -Nru tupi-0.2+git04/configure.rb tupi-0.2+git05/configure.rb --- tupi-0.2+git04/configure.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.rb 2014-12-15 14:21:32.000000000 +0000 @@ -55,8 +55,10 @@ --bindir=[path]: Set binaries path [/usr/bin] --libdir=[path]: Set library path [/usr/lib/tupi | /usr/lib64/tupi] --sharedir=[path]: Set data path [/usr/share] - --with-ffmpeg=[path]: Set ffmpeg installation path [/usr] - --without-ffmpeg: Disable ffmpeg support + --with-libav=[path]: Set libav installation path [/usr] + --with-quazip=[path]: Set quazip installation path [/usr] + --with-theora=[path]: Set theora installation path [/usr] + --without-libav: Disable libav support --without-debug: Disable debug --with-qtdir=[path]: Set Qt directory [i.e. /usr/local/qt] --package-build: Option exclusive for package maintainers @@ -70,104 +72,67 @@ debug = 0 end - if conf.hasArgument?("with-ffmpeg") and conf.hasArgument?("without-ffmpeg") - Info.error << " ERROR: Options --with-ffmpeg and --without-ffmpeg are mutually exclusive\n" + if conf.hasArgument?("with-libav") and conf.hasArgument?("without-libav") + Info.error << " ERROR: Options --with-libav and --without-libav are mutually exclusive\n" exit 0 end config = RQonf::Config.new - distro = "" - if FileTest.exists?("/etc/lsb-release") - conf.load_properties("/etc/lsb-release") - if conf.hasProperty?("DISTRIB_CODENAME") - distro = conf.propertyValue("DISTRIB_CODENAME") - end - if conf.hasProperty?("DISTRIB_ID") - distroName = conf.propertyValue("DISTRIB_ID") - if distroName == "Ubuntu" - config.addDefine("UBUNTU") - end - end - end - if conf.hasArgument?("with-qtdir") qtdir = conf.argumentValue("with-qtdir") - conf.verifyQtVersion("4.7.0", debug, qtdir) - if distro == "lucid" - config.addDefine("K_LUCID") - end + conf.verifyQtVersion("5.2.0", debug, qtdir) else - if distro == "lucid" - Info.error << " ERROR: If you are using Ubuntu Lucid (10.04). You must use the parameter --with-qtdir\n" - Info.error << " Try the option --help for more info\n" - exit 0 - else - conf.verifyQtVersion("4.7.0", debug, "") - end + conf.verifyQtVersion("5.2.0", debug, "") end - avcodecFile = "/usr/include/libavcodec/version.h" - - if conf.hasArgument?("with-ffmpeg") - ffmpegDir = conf.argumentValue("with-ffmpeg") - if File.directory? ffmpegDir - ffmpegLib = conf.argumentValue("with-ffmpeg") + "/lib" - ffmpegInclude = conf.argumentValue("with-ffmpeg") + "/include" - avcodecFile = ffmpegInclude + "/libavcodec/version.h" - config.addLib("-L" + ffmpegLib) - config.addIncludePath(ffmpegInclude) + if conf.hasArgument?("with-libav") + libavDir = conf.argumentValue("with-libav") + if File.directory? libavDir + libavLib = libavDir + "/lib" + libavInclude = libavDir + "/include" + config.addLib("-L" + libavLib) + config.addIncludePath(libavInclude) else - Info.error << " ERROR: ffmpeg directory does not exist!\n" + Info.error << " ERROR: libav directory does not exist!\n" exit 0 end + else + if conf.hasArgument?("without-libav") + Info.warn << "Disabling libav support: " << $endl + conf.disableFFmpeg() + end end - if FileTest.exists?(avcodecFile) - major = `egrep LIBAVCODEC_VERSION_MAJOR #{avcodecFile} | head -n 1` - minor = `egrep LIBAVCODEC_VERSION_MINOR #{avcodecFile} | head -n 1` - majorVersion = major.split - minorVersion = minor.split - destination = "src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.cpp" - - if FileTest.exists?("/etc/debian_version") - if FileTest.exists?("/etc/lsb-release") # Ubuntu - if majorVersion[2] >= "54" and minorVersion[2] >= "35" - FileUtils.cp("src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.new.cpp", destination) - else - FileUtils.cp("src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.old.cpp", destination) - end - else # Debian - if majorVersion[2] >= "54" and minorVersion[2] == "35" - FileUtils.cp("src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.debian.cpp", destination) - end - end - else # Other distros - if FileTest.exists?("/usr/bin/pacman") # Arch / Manjaro - FileUtils.cp("src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.arch.cpp", destination) - else - if majorVersion[2] >= "54" and minorVersion[2] >= "35" - FileUtils.cp("src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.new.cpp", destination) - else - FileUtils.cp("src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.old.cpp", destination) - end - end + if conf.hasArgument?("with-quazip") + quazipDir = conf.argumentValue("with-quazip") + if File.directory? quazipDir + quazipLib = quazipDir + "/lib" + quazipInclude = quazipDir + "/include" + config.addLib("-L" + quazipLib) + config.addIncludePath(quazipInclude) + else + Info.error << " ERROR: quazip directory does not exist!\n" + exit 0 end end - if conf.hasArgument?("without-ffmpeg") - Info.warn << "Disabling ffmpeg support: " << $endl - conf.disableFFmpeg() + if conf.hasArgument?("with-theora") + theoraDir = conf.argumentValue("with-theora") + if File.directory? theoraDir + theoraLib = theoraDir + "/lib" + theoraInclude = theoraDir + "/include" + config.addLib("-L" + theoraLib) + config.addIncludePath(theoraInclude) + else + Info.error << " ERROR: theora directory does not exist!\n" + exit 0 + end end conf.createTests conf.setTestDir("configure.tests") - - if distro == "lucid" - conf.runTests(config, conf, debug, true) - else - conf.runTests(config, conf, debug, false) - end + conf.runTests(config, conf, debug) config.addModule("core") config.addModule("gui") @@ -180,8 +145,8 @@ # config.addLib("-ltupifwsound") config.addDefine('VERSION=\\\\\"0.2\\\\\"') - config.addDefine('CODE_NAME=\\\\\"Argentum\\\\\"') - config.addDefine('REVISION=\\\\\"git04\\\\\"') + config.addDefine('CODE_NAME=\\\\\"Amandy\\\\\"') + config.addDefine('REVISION=\\\\\"git05\\\\\"') if conf.hasArgument?("install-headers") config.addDefine("ADD_HEADERS"); @@ -197,13 +162,16 @@ config.addOption("silent") print "[ \033[91mOFF\033[0m ]\n" end - + + if File.exists?('/etc/canaima_version') + config.addDefine("CANAIMA") + end + unix = config.addScope("unix") unix.addVariable("MOC_DIR", ".moc") unix.addVariable("UI_DIR", ".ui") unix.addVariable("OBJECTS_DIR", ".obj") - # The file tupiglobal.pri contains all the global variables for the compilation process config.save("tupiglobal.pri") conf.createMakefiles diff -Nru tupi-0.2+git04/configure.tests/ffmpeg/ffmpeg.pro tupi-0.2+git05/configure.tests/ffmpeg/ffmpeg.pro --- tupi-0.2+git04/configure.tests/ffmpeg/ffmpeg.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/ffmpeg/ffmpeg.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -###################################################################### -# Automatically generated by qmake (1.07a) Fri Jan 20 09:41:23 2006 -###################################################################### - -TEMPLATE = app -CONFIG -= moc - -macx { - CONFIG -= app_bundle - CONFIG += warn_on static console -} - -INCLUDEPATH += . -INCLUDEPATH += /usr/include/ffmpeg -DEFINES += __STDC_CONSTANT_MACROS - -LIBS += -lavformat -lavcodec -lavutil -# Input -SOURCES += main.cpp diff -Nru tupi-0.2+git04/configure.tests/ffmpeg/ffmpeg.qonf tupi-0.2+git05/configure.tests/ffmpeg/ffmpeg.qonf --- tupi-0.2+git04/configure.tests/ffmpeg/ffmpeg.qonf 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/ffmpeg/ffmpeg.qonf 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru tupi-0.2+git04/configure.tests/ffmpeg/main.cpp tupi-0.2+git05/configure.tests/ffmpeg/main.cpp --- tupi-0.2+git04/configure.tests/ffmpeg/main.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/ffmpeg/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifdef __cplusplus -extern "C" { - #include "libavformat/avformat.h" - #include "libavcodec/avcodec.h" -} -#endif - -#include - -int main() -{ - av_register_all(); - - #if defined(K_LUCID) - AVOutputFormat *fmt = guess_format("mpeg", NULL, NULL); - #else - AVOutputFormat *fmt = av_guess_format("mpeg", NULL, NULL); - #endif - - AVFormatContext *oc = avformat_alloc_context(); - oc->oformat = fmt; - - AVCodecContext *c; - AVStream *st; - - // st = av_new_stream(oc, 0); - st = avformat_new_stream(oc, 0); - - c = st->codec; - c->time_base.den = 24; - c->time_base.num = 1; - c->gop_size = 12; - c->pix_fmt = PIX_FMT_YUV420P; - - av_free(oc); - - return 0; -} - diff -Nru tupi-0.2+git04/configure.tests/libav/libav.pro tupi-0.2+git05/configure.tests/libav/libav.pro --- tupi-0.2+git04/configure.tests/libav/libav.pro 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/libav/libav.pro 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,15 @@ +TEMPLATE = app +CONFIG -= moc +TARGET = libav + +macx { + CONFIG -= app_bundle + CONFIG += warn_on static console +} + +INCLUDEPATH += . +DEFINES += __STDC_CONSTANT_MACROS +LIBS += -lavformat -lavcodec -lavutil + +# Input +SOURCES += main.cpp diff -Nru tupi-0.2+git04/configure.tests/libav/libav.qonf tupi-0.2+git05/configure.tests/libav/libav.qonf --- tupi-0.2+git04/configure.tests/libav/libav.qonf 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/libav/libav.qonf 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru tupi-0.2+git04/configure.tests/libav/main.cpp tupi-0.2+git05/configure.tests/libav/main.cpp --- tupi-0.2+git04/configure.tests/libav/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/libav/main.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,74 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifdef __cplusplus +extern "C" { + #include "libavformat/avformat.h" + #include "libavcodec/avcodec.h" +} +#endif + +#include + +int main() +{ + av_register_all(); + + #if defined(K_LUCID) + AVOutputFormat *fmt = guess_format("mpeg", NULL, NULL); + #else + AVOutputFormat *fmt = av_guess_format("mpeg", NULL, NULL); + #endif + + AVFormatContext *oc = avformat_alloc_context(); + oc->oformat = fmt; + + AVCodecContext *c; + AVStream *st; + + // st = av_new_stream(oc, 0); + st = avformat_new_stream(oc, 0); + + c = st->codec; + c->time_base.den = 24; + c->time_base.num = 1; + c->gop_size = 12; + c->pix_fmt = PIX_FMT_YUV420P; + + av_free(oc); + + return 0; +} + diff -Nru tupi-0.2+git04/configure.tests/libav/Makefile tupi-0.2+git05/configure.tests/libav/Makefile --- tupi-0.2+git04/configure.tests/libav/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/libav/Makefile 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,311 @@ +############################################################################# +# Makefile for building: libav +# Generated by qmake (3.0) (Qt 5.3.0) +# Project: libav.pro +# Template: app +# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile libav.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -D__STDC_CONSTANT_MACROS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +INCPATH = -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. +LINK = g++ +LFLAGS = -m64 -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lavformat -lavcodec -lavutil -lQt5Gui -L/usr/lib/x86_64-linux-gnu -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp +OBJECTS = main.o +DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + libav.pro main.cpp +QMAKE_TARGET = libav +TARGET = libav + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: libav.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + libav.pro \ + /usr/lib/x86_64-linux-gnu/libQt5Gui.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Core.prl + $(QMAKE) -o Makefile libav.pro +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf: +libav.pro: +/usr/lib/x86_64-linux-gnu/libQt5Gui.prl: +/usr/lib/x86_64-linux-gnu/libQt5Core.prl: +qmake: FORCE + @$(QMAKE) -o Makefile libav.pro + +qmake_all: FORCE + +dist: + @test -d .tmp/libav1.0.0 || mkdir -p .tmp/libav1.0.0 + $(COPY_FILE) --parents $(DIST) .tmp/libav1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/libav1.0.0/ && (cd `dirname .tmp/libav1.0.0` && $(TAR) libav1.0.0.tar libav1.0.0 && $(COMPRESS) libav1.0.0.tar) && $(MOVE) `dirname .tmp/libav1.0.0`/libav1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/libav1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + +####### Compile + +main.o: main.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff -Nru tupi-0.2+git04/configure.tests/mobility/main.cpp tupi-0.2+git05/configure.tests/mobility/main.cpp --- tupi-0.2+git04/configure.tests/mobility/main.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/mobility/main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -/* -#include -#include -#include "zlib.h" -*/ - -#include -#include -#include - -int main() -{ - QByteArray cameraDevice = QCamera::availableDevices()[0]; - QCamera *camera = new QCamera(cameraDevice); - QCameraViewfinder *viewFinder = new QCameraViewfinder(); - camera->setViewfinder(viewFinder); - - camera->setCaptureMode(QCamera::CaptureStillImage); - new QCameraImageCapture(camera); - - if (camera->state() == QCamera::ActiveState) - camera->stop(); - - camera->start(); -} diff -Nru tupi-0.2+git04/configure.tests/mobility/mobility.pro tupi-0.2+git05/configure.tests/mobility/mobility.pro --- tupi-0.2+git04/configure.tests/mobility/mobility.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/mobility/mobility.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -DEPENDPATH += . -INCLUDEPATH += /usr/include/QtMobility /usr/include/QtMultimediaKit - -macx { - CONFIG -= app_bundle - CONFIG += warn_on static console -} - -# Input -SOURCES += main.cpp -LIBS += -lQtMultimediaKit diff -Nru tupi-0.2+git04/configure.tests/mobility/mobility.qonf tupi-0.2+git05/configure.tests/mobility/mobility.qonf --- tupi-0.2+git04/configure.tests/mobility/mobility.qonf 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/mobility/mobility.qonf 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff -Nru tupi-0.2+git04/configure.tests/multimedia/main.cpp tupi-0.2+git05/configure.tests/multimedia/main.cpp --- tupi-0.2+git04/configure.tests/multimedia/main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/multimedia/main.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,60 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +/* +#include +#include +#include "zlib.h" +*/ + +#include +#include +#include + +int main() +{ + QByteArray cameraDevice = QCamera::availableDevices()[0]; + QCamera *camera = new QCamera(cameraDevice); + QCameraViewfinder *viewFinder = new QCameraViewfinder(); + camera->setViewfinder(viewFinder); + + camera->setCaptureMode(QCamera::CaptureStillImage); + new QCameraImageCapture(camera); + + if (camera->state() == QCamera::ActiveState) + camera->stop(); + + camera->start(); +} diff -Nru tupi-0.2+git04/configure.tests/multimedia/Makefile tupi-0.2+git05/configure.tests/multimedia/Makefile --- tupi-0.2+git04/configure.tests/multimedia/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/multimedia/Makefile 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,324 @@ +############################################################################# +# Makefile for building: multimedia +# Generated by qmake (3.0) (Qt 5.3.0) +# Project: multimedia.pro +# Template: app +# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile multimedia.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_MULTIMEDIAWIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +INCPATH = -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -isystem /usr/include/qt5/QtMultimedia -isystem /usr/include/qt5/QtMultimediaWidgets -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimediaWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtMultimedia -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. +LINK = g++ +LFLAGS = -m64 -Wl,-O1 -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5MultimediaWidgets -L/usr/lib/x86_64-linux-gnu -lQt5Multimedia -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp +OBJECTS = main.o +DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + multimedia.pro main.cpp +QMAKE_TARGET = multimedia +TARGET = multimedia + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: multimedia.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + multimedia.pro \ + /usr/lib/x86_64-linux-gnu/libQt5MultimediaWidgets.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Multimedia.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Gui.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Core.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Network.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Widgets.prl + $(QMAKE) -o Makefile multimedia.pro +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf: +multimedia.pro: +/usr/lib/x86_64-linux-gnu/libQt5MultimediaWidgets.prl: +/usr/lib/x86_64-linux-gnu/libQt5Multimedia.prl: +/usr/lib/x86_64-linux-gnu/libQt5Gui.prl: +/usr/lib/x86_64-linux-gnu/libQt5Core.prl: +/usr/lib/x86_64-linux-gnu/libQt5Network.prl: +/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl: +qmake: FORCE + @$(QMAKE) -o Makefile multimedia.pro + +qmake_all: FORCE + +dist: + @test -d .tmp/multimedia1.0.0 || mkdir -p .tmp/multimedia1.0.0 + $(COPY_FILE) --parents $(DIST) .tmp/multimedia1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/multimedia1.0.0/ && (cd `dirname .tmp/multimedia1.0.0` && $(TAR) multimedia1.0.0.tar multimedia1.0.0 && $(COMPRESS) multimedia1.0.0.tar) && $(MOVE) `dirname .tmp/multimedia1.0.0`/multimedia1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/multimedia1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + +####### Compile + +main.o: main.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff -Nru tupi-0.2+git04/configure.tests/multimedia/multimedia.pro tupi-0.2+git05/configure.tests/multimedia/multimedia.pro --- tupi-0.2+git04/configure.tests/multimedia/multimedia.pro 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/multimedia/multimedia.pro 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,15 @@ +TEMPLATE = app +CONFIG -= moc +TARGET = multimedia + +macx { + CONFIG -= app_bundle + CONFIG += warn_on static console +} + +QT += multimedia multimediawidgets +DEPENDPATH += . +INCLUDEPATH += /usr/include/qt5/QtMultimedia /usr/include/qt5/QtMultimediaWidgets + +# Input +SOURCES += main.cpp diff -Nru tupi-0.2+git04/configure.tests/multimedia/multimedia.qonf tupi-0.2+git05/configure.tests/multimedia/multimedia.qonf --- tupi-0.2+git04/configure.tests/multimedia/multimedia.qonf 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/multimedia/multimedia.qonf 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -Nru tupi-0.2+git04/configure.tests/opengl/Makefile tupi-0.2+git05/configure.tests/opengl/Makefile --- tupi-0.2+git04/configure.tests/opengl/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/opengl/Makefile 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,320 @@ +############################################################################# +# Makefile for building: opengl +# Generated by qmake (3.0) (Qt 5.3.0) +# Project: opengl.pro +# Template: app +# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile opengl.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +INCPATH = -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtOpenGL -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. +LINK = g++ +LFLAGS = -m64 -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5OpenGL -L/usr/lib/x86_64-linux-gnu -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp +OBJECTS = main.o +DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + opengl.pro main.cpp +QMAKE_TARGET = opengl +TARGET = opengl + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: opengl.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + opengl.pro \ + /usr/lib/x86_64-linux-gnu/libQt5OpenGL.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Widgets.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Gui.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Core.prl + $(QMAKE) -o Makefile opengl.pro +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/uic.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf: +opengl.pro: +/usr/lib/x86_64-linux-gnu/libQt5OpenGL.prl: +/usr/lib/x86_64-linux-gnu/libQt5Widgets.prl: +/usr/lib/x86_64-linux-gnu/libQt5Gui.prl: +/usr/lib/x86_64-linux-gnu/libQt5Core.prl: +qmake: FORCE + @$(QMAKE) -o Makefile opengl.pro + +qmake_all: FORCE + +dist: + @test -d .tmp/opengl1.0.0 || mkdir -p .tmp/opengl1.0.0 + $(COPY_FILE) --parents $(DIST) .tmp/opengl1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/opengl1.0.0/ && (cd `dirname .tmp/opengl1.0.0` && $(TAR) opengl1.0.0.tar opengl1.0.0 && $(COMPRESS) opengl1.0.0.tar) && $(MOVE) `dirname .tmp/opengl1.0.0`/opengl1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/opengl1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + +####### Compile + +main.o: main.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff -Nru tupi-0.2+git04/configure.tests/opengl/opengl.pro tupi-0.2+git05/configure.tests/opengl/opengl.pro --- tupi-0.2+git04/configure.tests/opengl/opengl.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/opengl/opengl.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,17 +1,15 @@ -###################################################################### -# Automatically generated by qmake (2.00a) Tue Jan 2 12:58:43 2007 -###################################################################### - TEMPLATE = app -DEPENDPATH += . -INCLUDEPATH += . +CONFIG -= moc +TARGET = opengl macx { CONFIG -= app_bundle CONFIG += warn_on static console } +QT += opengl +DEPENDPATH += . +INCLUDEPATH += . + # Input SOURCES += main.cpp - -QT += opengl diff -Nru tupi-0.2+git04/configure.tests/quazip/Makefile tupi-0.2+git05/configure.tests/quazip/Makefile --- tupi-0.2+git04/configure.tests/quazip/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/quazip/Makefile 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,311 @@ +############################################################################# +# Makefile for building: quazip +# Generated by qmake (3.0) (Qt 5.3.0) +# Project: quazip.pro +# Template: app +# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake LIBS\ +=\ -lquazip-qt5 -o Makefile quazip.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +INCPATH = -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -isystem /usr/include/quazip -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. +LINK = g++ +LFLAGS = -m64 -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lquazip-qt5 -lz -lQt5Gui -L/usr/lib/x86_64-linux-gnu -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp +OBJECTS = main.o +DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + quazip.pro main.cpp +QMAKE_TARGET = quazip +TARGET = quazip + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: quazip.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + quazip.pro \ + /usr/lib/x86_64-linux-gnu/libQt5Gui.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Core.prl + $(QMAKE) LIBS\ +=\ -lquazip-qt5 -o Makefile quazip.pro +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf: +quazip.pro: +/usr/lib/x86_64-linux-gnu/libQt5Gui.prl: +/usr/lib/x86_64-linux-gnu/libQt5Core.prl: +qmake: FORCE + @$(QMAKE) LIBS\ +=\ -lquazip-qt5 -o Makefile quazip.pro + +qmake_all: FORCE + +dist: + @test -d .tmp/quazip1.0.0 || mkdir -p .tmp/quazip1.0.0 + $(COPY_FILE) --parents $(DIST) .tmp/quazip1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/quazip1.0.0/ && (cd `dirname .tmp/quazip1.0.0` && $(TAR) quazip1.0.0.tar quazip1.0.0 && $(COMPRESS) quazip1.0.0.tar) && $(MOVE) `dirname .tmp/quazip1.0.0`/quazip1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/quazip1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + +####### Compile + +main.o: main.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff -Nru tupi-0.2+git04/configure.tests/quazip/quazip.pro tupi-0.2+git05/configure.tests/quazip/quazip.pro --- tupi-0.2+git04/configure.tests/quazip/quazip.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/quazip/quazip.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,10 @@ +TEMPLATE = app +CONFIG -= moc +TARGET = quazip DEPENDPATH += . macx { - INCLUDEPATH += /usr/local/include/quazip + INCLUDEPATH += /usr/local/include CONFIG -= app_bundle CONFIG += warn_on static console } @@ -10,6 +13,7 @@ INCLUDEPATH += /usr/include/quazip } +LIBS += -lz + # Input SOURCES += main.cpp -LIBS += -lquazip diff -Nru tupi-0.2+git04/configure.tests/quazip/quazip.qonf tupi-0.2+git05/configure.tests/quazip/quazip.qonf --- tupi-0.2+git04/configure.tests/quazip/quazip.qonf 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/quazip/quazip.qonf 2014-12-15 14:21:32.000000000 +0000 @@ -7,9 +7,6 @@ - - - diff -Nru tupi-0.2+git04/configure.tests/theora/Makefile tupi-0.2+git05/configure.tests/theora/Makefile --- tupi-0.2+git04/configure.tests/theora/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/theora/Makefile 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,311 @@ +############################################################################# +# Makefile for building: theora +# Generated by qmake (3.0) (Qt 5.3.0) +# Project: theora.pro +# Template: app +# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile theora.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +INCPATH = -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. +LINK = g++ +LFLAGS = -m64 -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -ltheora -ltheoraenc -ltheoradec -logg -lQt5Gui -L/usr/lib/x86_64-linux-gnu -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp +OBJECTS = main.o +DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + theora.pro main.cpp +QMAKE_TARGET = theora +TARGET = theora + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: theora.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + theora.pro \ + /usr/lib/x86_64-linux-gnu/libQt5Gui.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Core.prl + $(QMAKE) -o Makefile theora.pro +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf: +theora.pro: +/usr/lib/x86_64-linux-gnu/libQt5Gui.prl: +/usr/lib/x86_64-linux-gnu/libQt5Core.prl: +qmake: FORCE + @$(QMAKE) -o Makefile theora.pro + +qmake_all: FORCE + +dist: + @test -d .tmp/theora1.0.0 || mkdir -p .tmp/theora1.0.0 + $(COPY_FILE) --parents $(DIST) .tmp/theora1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/theora1.0.0/ && (cd `dirname .tmp/theora1.0.0` && $(TAR) theora1.0.0.tar theora1.0.0 && $(COMPRESS) theora1.0.0.tar) && $(MOVE) `dirname .tmp/theora1.0.0`/theora1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/theora1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + +####### Compile + +main.o: main.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff -Nru tupi-0.2+git04/configure.tests/theora/theora.pro tupi-0.2+git05/configure.tests/theora/theora.pro --- tupi-0.2+git04/configure.tests/theora/theora.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/theora/theora.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,6 @@ TEMPLATE = app CONFIG -= moc +TARGET = theora macx { CONFIG -= app_bundle @@ -7,7 +8,7 @@ } INCLUDEPATH += . - LIBS += -ltheora -ltheoraenc -ltheoradec -logg +# Input SOURCES += main.cpp diff -Nru tupi-0.2+git04/configure.tests/zlib/Makefile tupi-0.2+git05/configure.tests/zlib/Makefile --- tupi-0.2+git04/configure.tests/zlib/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/configure.tests/zlib/Makefile 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,311 @@ +############################################################################# +# Makefile for building: zlib +# Generated by qmake (3.0) (Qt 5.3.0) +# Project: zlib.pro +# Template: app +# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile zlib.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIE $(DEFINES) +INCPATH = -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I. -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. +LINK = g++ +LFLAGS = -m64 -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lz -lQt5Gui -L/usr/lib/x86_64-linux-gnu -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp +OBJECTS = main.o +DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + zlib.pro main.cpp +QMAKE_TARGET = zlib +TARGET = zlib + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: zlib.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \ + zlib.pro \ + /usr/lib/x86_64-linux-gnu/libQt5Gui.prl \ + /usr/lib/x86_64-linux-gnu/libQt5Core.prl + $(QMAKE) -o Makefile zlib.pro +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/shell-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf: +zlib.pro: +/usr/lib/x86_64-linux-gnu/libQt5Gui.prl: +/usr/lib/x86_64-linux-gnu/libQt5Core.prl: +qmake: FORCE + @$(QMAKE) -o Makefile zlib.pro + +qmake_all: FORCE + +dist: + @test -d .tmp/zlib1.0.0 || mkdir -p .tmp/zlib1.0.0 + $(COPY_FILE) --parents $(DIST) .tmp/zlib1.0.0/ && $(COPY_FILE) --parents main.cpp .tmp/zlib1.0.0/ && (cd `dirname .tmp/zlib1.0.0` && $(TAR) zlib1.0.0.tar zlib1.0.0 && $(COMPRESS) zlib1.0.0.tar) && $(MOVE) `dirname .tmp/zlib1.0.0`/zlib1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/zlib1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + +####### Compile + +main.o: main.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff -Nru tupi-0.2+git04/configure.tests/zlib/zlib.pro tupi-0.2+git05/configure.tests/zlib/zlib.pro --- tupi-0.2+git04/configure.tests/zlib/zlib.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/configure.tests/zlib/zlib.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,11 +1,15 @@ -DEPENDPATH += . -INCLUDEPATH += . +TEMPLATE = app +CONFIG -= moc +TARGET = zlib macx { CONFIG -= app_bundle CONFIG += warn_on static console } +DEPENDPATH += . +INCLUDEPATH += . +LIBS += -lz + # Input SOURCES += main.cpp -LIBS += -lz diff -Nru tupi-0.2+git04/debian/changelog tupi-0.2+git05/debian/changelog --- tupi-0.2+git04/debian/changelog 2014-09-18 10:11:54.000000000 +0000 +++ tupi-0.2+git05/debian/changelog 2015-05-21 04:55:03.000000000 +0000 @@ -1,20 +1,43 @@ -tupi (0.2+git04-2build3) utopic; urgency=medium +tupi (0.2+git05-3) unstable; urgency=medium - * Rebuild against libquazip1. + * Upload to unstable (Closes: #786337). - -- Colin Watson Thu, 18 Sep 2014 11:11:54 +0100 + -- Dmitry Smirnov Thu, 21 May 2015 14:54:58 +1000 -tupi (0.2+git04-2build2) utopic; urgency=medium +tupi (0.2+git05-2) experimental; urgency=low - * Rebuild against libav11. + * override_dh_fixperms: check if -data package is built to fix + FTBFS "-B" type, like on buildd servers. + + -- Dmitry Smirnov Mon, 05 Jan 2015 10:25:13 +1100 + +tupi (0.2+git05-1) experimental; urgency=low + + * New upstream release [December 2014]. + * Build-Depends: + - pkg-config + - qtmobility-dev + - qt4-linguist-tools + + qttools5-dev-tools + - qt4-qmake + + qt5-qmake + + qtmultimedia5-dev + - libqt4-opengl-dev + + libqt5opengl5-dev + + libqt5svg5-dev + - libquazip-dev + + libquazip-qt5-dev + * Build with "--without-debug"; added new patch to enable verbose build. + * Do not inject "-Wl,--as-needed" to LDFLAGS. + * Added new patch to disable defective libquazip detection. + * Standards-Version: 3.9.6. + * Updated Vcs-Browser URL. + * Updated "debian/watch" file. + * Updated link to new upstream repository. + * tupi-data: new lintian-override for "extra-license-file". + * "debian/rules": --parallel build; minor cleanup; override_dh_fixperms. - -- Colin Watson Fri, 05 Sep 2014 02:39:17 +0100 - -tupi (0.2+git04-2build1) utopic; urgency=medium - - * No-change rebuild against libav10. - - -- Logan Rosen Fri, 30 May 2014 23:28:15 -0400 + -- Dmitry Smirnov Sun, 04 Jan 2015 18:42:38 +1100 tupi (0.2+git04-2) unstable; urgency=low diff -Nru tupi-0.2+git04/debian/clean tupi-0.2+git05/debian/clean --- tupi-0.2+git04/debian/clean 2014-05-17 11:55:17.000000000 +0000 +++ tupi-0.2+git05/debian/clean 2015-01-07 06:11:38.000000000 +0000 @@ -1,8 +1,8 @@ debian/*.xpm +bin/tupi.bin tupiglobal.pri launcher/tupi launcher/tupi.desktop -src/components/help/help/css/tupi.css src/framework/tupconfig.pri src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.cpp src/components/help/man/*.1.gz diff -Nru tupi-0.2+git04/debian/control tupi-0.2+git05/debian/control --- tupi-0.2+git04/debian/control 2014-05-17 10:33:21.000000000 +0000 +++ tupi-0.2+git05/debian/control 2015-05-21 04:54:38.000000000 +0000 @@ -2,22 +2,24 @@ Section: graphics Priority: optional Maintainer: Dmitry Smirnov -Build-Depends: debhelper (>= 9), ruby (>= 4.9), perl, qt4-qmake, pkg-config +Build-Depends: debhelper (>= 9), ruby (>= 4.9), perl ,imagemagick ,rdfind ,symlinks - ,qt4-linguist-tools - ,qtmobility-dev ,libaspell-dev (>= 0.60.7~) ,libavformat-dev ,libavutil-dev ,libogg-dev - ,libqt4-opengl-dev - ,libquazip-dev + ,qt5-qmake + ,qttools5-dev-tools + ,qtmultimedia5-dev + ,libqt5opengl5-dev + ,libqt5svg5-dev + ,libquazip-qt5-dev ,libtheora-dev ,zlib1g-dev -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Homepage: http://www.maefloresta.com/portal +Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/tupi.git Vcs-Git: git://anonscm.debian.org/collab-maint/tupi.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/tupi.git Package: tupi Architecture: linux-any diff -Nru tupi-0.2+git04/debian/copyright tupi-0.2+git05/debian/copyright --- tupi-0.2+git04/debian/copyright 2014-03-01 07:09:28.000000000 +0000 +++ tupi-0.2+git05/debian/copyright 2015-01-01 11:30:56.000000000 +0000 @@ -1,20 +1,20 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: tupi Upstream-Contact: Gustav Gonzalez -Source: https://github.com/xtingray/tupi - -Files: debian/* -Copyright: 2011-2014 Dmitry Smirnov -License: GPL-2+ +Source: https://projects.kde.org/projects/playground/artwork/tupi/repository Files: * -Copyright: 2010-2013 Gustav Gonzalez +Copyright: 2010-2014 Gustav Gonzalez 2006 David Cuadrado 2006 Jorge Cuadrado 2003 Fernado Roldan 2003 Simena Dinas License: GPL-2+ +Files: debian/* +Copyright: 2011-2015 Dmitry Smirnov +License: GPL-2+ + License: GPL-2+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru tupi-0.2+git04/debian/patches/quazip.patch tupi-0.2+git05/debian/patches/quazip.patch --- tupi-0.2+git04/debian/patches/quazip.patch 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/debian/patches/quazip.patch 2015-01-01 21:42:21.000000000 +0000 @@ -0,0 +1,37 @@ +Last-Update: 2015-01-02 +Forwarded: yes +Author: Dmitry Smirnov +Description: drop stupid quazip detection. + +--- a/qonf/test.rb ++++ b/qonf/test.rb +@@ -102,13 +102,9 @@ + extraInclude = quazipDir + "/include" + qmakeLine = "'LIBS += #{extraLib}'" + qmakeLine += " 'INCLUDEPATH += #{extraInclude}'" + else +- if parser.os.eql? "14.10" +- extraLib = "-lquazip-qt5" +- else +- extraLib = "-lquazip" +- end ++ extraLib = "-lquazip-qt5" + qmakeLine = "'LIBS += #{extraLib}'" + end + else + if File.dirname(@rules).end_with?("theora") +@@ -176,13 +172,9 @@ + parser.libs.each { |lib| + config.addLib(lib) + } + +- if parser.os.eql? "14.10" +- config.addLib("-lquazip-qt5") +- else +- config.addLib("-lquazip") +- end ++ config.addLib("-lquazip-qt5") + + parser.defines.each { |define| + config.addDefine(define) + } diff -Nru tupi-0.2+git04/debian/patches/series tupi-0.2+git05/debian/patches/series --- tupi-0.2+git04/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/debian/patches/series 2015-01-16 18:26:31.000000000 +0000 @@ -0,0 +1,2 @@ +quazip.patch +verbose-build.patch diff -Nru tupi-0.2+git04/debian/patches/verbose-build.patch tupi-0.2+git05/debian/patches/verbose-build.patch --- tupi-0.2+git04/debian/patches/verbose-build.patch 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/debian/patches/verbose-build.patch 2015-01-04 06:18:08.000000000 +0000 @@ -0,0 +1,17 @@ +Last-Update: 2015-01-04 +Forwarded: no +Author: Dmitry Smirnov +Description: enable verbose build. + +--- a/configure.rb ++++ b/configure.rb +@@ -158,9 +158,8 @@ + config.addDefine("K_DEBUG") + print "[ \033[92mON\033[0m ]\n" + else + config.addDefine("K_NODEBUG") +- config.addOption("silent") + print "[ \033[91mOFF\033[0m ]\n" + end + + if File.exists?('/etc/canaima_version') diff -Nru tupi-0.2+git04/debian/rules tupi-0.2+git05/debian/rules --- tupi-0.2+git04/debian/rules 2014-05-17 11:55:06.000000000 +0000 +++ tupi-0.2+git05/debian/rules 2015-01-04 23:06:57.000000000 +0000 @@ -4,25 +4,20 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +export QT_SELECT=5 QM_FILES := $(patsubst %.ts, %.qm, $(wildcard src/shell/data/translations/*.ts)) %: - dh $@ + dh $@ --parallel override_dh_auto_clean: - # remove pre-generated binaries; the following is intentional: - # trick lintian and always use Makefile.common to clean generated files. - -true && $(MAKE) -f Makefile.common confclean $(RM) -v configure.tests/*/Makefile $(QM_FILES) dh_auto_clean override_dh_auto_configure: - # arch-dependent patching - cat debian/patches/series.$(DEB_HOST_ARCH_OS) >> debian/patches/series \ - && $(RM) debian/patches/series.$(DEB_HOST_ARCH_OS) \ - && dh_quilt_patch || true # override qonf/defaults.rb ruby configure.rb \ + --without-debug \ --prefix=/usr \ --bindir=/usr/lib/tupi/bin \ --libdir=/usr/lib/tupi \ @@ -30,19 +25,10 @@ --includedir=/usr/include/tupi # force qmake-generated Makefiles to respect dpkg-provided flags and don't strip perl -0pi -e 's[(CXXFLAGS\s*=)][$$1 $$ENV{CFLAGS} $$ENV{CPPFLAGS}]; \ - s[(LFLAGS\s*=)][$$1 -Wl,--as-needed $$ENV{LDFLAGS}]; \ - s[(CFLAGS\s*=)][$$1 $$ENV{CFLAGS} $$ENV{CPPFLAGS}]; \ + s[(LFLAGS\s*=)][$$1 $$ENV{LDFLAGS}]; \ + s[(CFLAGS\s*=)][$$1 $$ENV{CFLAGS}]; \ s[(STRIP\s*=)\s*\w+][$$1 true];' \ $$(find . -name Makefile) - ## libav9 and older: ugly override for upstream libav detection: - ## FTBFS: "WARNING: Failure to find: tffmpegmoviegenerator.cpp" - ## https://github.com/xtingray/tupi/issues/2 - ## remove "pkg-config" fron Build-Depends when this will not be needed. - dpkg --compare-versions $$(pkg-config --modversion libavcodec) lt 54.35.0 \ - && cp -v src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.old.cpp \ - src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.cpp \ - || cp -v src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.debian.cpp \ - src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.cpp $(QM_FILES): # rebuild translations @@ -54,6 +40,13 @@ cd src/components/help/man && gzip -9 -c tupi.man > tupi.1.gz dh_auto_build +override_dh_fixperms: + dh_fixperms + if [ -d "$(CURDIR)/debian/tupi-data" ]; then \ + find $(CURDIR)/debian/tupi-data/usr/share/tupi/data/xml/ \ + -type f -executable -exec chmod -c a-x '{}' \;\ + ;fi + override_dh_install: dh_install # De-duplication (http://wiki.debian.org/dedup.debian.net): @@ -68,10 +61,7 @@ dh_makeshlibs --noscripts override_dh_strip: - dh_strip -v --dbg-package=tupi-dbg - -override_dh_builddeb: - dh_builddeb -- -Zxz + dh_strip --dbg-package=tupi-dbg PKD = $(abspath $(dir $(MAKEFILE_LIST))) PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source)) diff -Nru tupi-0.2+git04/debian/tupi-data.lintian-overrides tupi-0.2+git05/debian/tupi-data.lintian-overrides --- tupi-0.2+git04/debian/tupi-data.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/debian/tupi-data.lintian-overrides 2015-01-01 11:30:56.000000000 +0000 @@ -0,0 +1,2 @@ +## False-positive, this is a CSS file, not a text of the license: +extra-license-file usr/share/tupi/data/xml/en/gpl.css diff -Nru tupi-0.2+git04/debian/tupi.lintian-overrides tupi-0.2+git05/debian/tupi.lintian-overrides --- tupi-0.2+git04/debian/tupi.lintian-overrides 2014-04-26 12:12:03.000000000 +0000 +++ tupi-0.2+git05/debian/tupi.lintian-overrides 2015-01-04 06:21:57.000000000 +0000 @@ -1,3 +1,3 @@ ## false-positives: -hardening-no-fortify-functions usr/lib/tupi/bin/tupi.bin +hardening-no-fortify-functions usr/lib/tupi/libtupifwcore.so.1.0.0 diff -Nru tupi-0.2+git04/debian/watch tupi-0.2+git05/debian/watch --- tupi-0.2+git04/debian/watch 2013-06-23 02:22:36.000000000 +0000 +++ tupi-0.2+git05/debian/watch 2015-01-01 07:47:31.000000000 +0000 @@ -10,6 +10,7 @@ uversionmangle=s/\-git/+git/ \ https://github.com/xtingray/tupi/tags .*/archive/v?(\d[-\d\.git]+)\.tar\.(?:gz|bzip2|xz) +## Redirector http://qa.debian.org/watch/sf.php/tupi2d/ opts=\ uversionmangle=s/\-git/\+git/ \ - http://sf.net/tupi.berlios/tupi_([0-9.]+\-git[0-9]+)\.tar\.(?:gz|bzip2|xz) + http://sf.net/tupi2d/tupi[_-]([0-9.]+\-git[0-9]+)\.tar\.(?:gz|bzip2|xz) diff -Nru tupi-0.2+git04/.gitignore tupi-0.2+git05/.gitignore --- tupi-0.2+git04/.gitignore 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/.gitignore 2014-12-15 14:21:32.000000000 +0000 @@ -7,6 +7,10 @@ *.1 *.dylib *.pro.user +*.moc +*.Debug +*.Release +moc_* bin/ src/framework/tgui/qrc_tgui_images.cpp @@ -27,6 +31,7 @@ launcher/tupi launcher/tupi.desktop +src/components/help/help/css/tupi.css 3rdparty/Makefile 3rdparty/potrace/Makefile diff -Nru tupi-0.2+git04/INSTALL tupi-0.2+git05/INSTALL --- tupi-0.2+git04/INSTALL 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/INSTALL 2014-12-15 14:21:32.000000000 +0000 @@ -18,9 +18,9 @@ * Qt: The full development toolkit used to create Tupi * ruby: A script language used to do the configuration process previous to the compilation - * libavcodec-dev: A subcomponent of the project ffmpeg, to deal with + * libavcodec-dev: A subcomponent of the project libav, to deal with video manipulation - * libavformat-dev: A subcomponent of the project ffmpeg, to deal with + * libavformat-dev: A subcomponent of the project libav, to deal with video manipulation * zlib-dev: A file-compression library * quazip: A very handy API to deal with zip files @@ -70,3 +70,4 @@ Additional info: http://www.maefloresta.com + diff -Nru tupi-0.2+git04/INSTALL.md tupi-0.2+git05/INSTALL.md --- tupi-0.2+git04/INSTALL.md 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/INSTALL.md 2014-12-15 14:21:32.000000000 +0000 @@ -18,9 +18,9 @@ * Qt: The full development toolkit used to create Tupi * ruby: A script language used to do the configuration process previous to the compilation -* libavcodec-dev: A subcomponent of the project ffmpeg, to deal with +* libavcodec-dev: A subcomponent of the project libav, to deal with video manipulation -* libavformat-dev: A subcomponent of the project ffmpeg, to deal with +* libavformat-dev: A subcomponent of the project libav, to deal with video manipulation * zlib-dev: A file-compression library * quazip: A very handy API to deal with zip files diff -Nru tupi-0.2+git04/INSTALL.osx tupi-0.2+git05/INSTALL.osx --- tupi-0.2+git04/INSTALL.osx 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/INSTALL.osx 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,56 @@ +* Warning: Guide pending for update! + + Tupi basic installation guide for Mac OSX + +Note: Currently, to build and install Tupi on Mac OSX the Terminal application +is required. This tool can be located at /Applications/Utilities/Terminal using +the Finder application. +The Terminal is just a command console, so if you have no experience using it, +we recommend you to take a look at this little guide: + http://www.hacktheday.com/beginners-guide-to-apple-terminal-part-1/ + +Now, to compile/install Tupi from source code, please follow the instructions +below: + +1. Install the XCode Developer Tools available at: + https://developer.apple.com/downloads/index.action + If your OSX version is Lion, try version 4.1 or later and include the + package called "Command Line Tools for Xcode" + If your OSX version is Snow Leopard, try version 3.2 or later + + Note: an Apple ID account is required to download XCode + +2. Install the Macports (package manager) available at: + http://www.macports.org/ + Read the installation instructions at: + http://www.macports.org/install.php + +3. Install required ports: + $ sudo port install zlib + $ sudo port install ffmpeg +nonfree + $ sudo port install aspell + $ sudo port install git-core + $ sudo port install qt4-mac + +4. Download Tupi source code from Gitorious: + $ git clone -b experimental https://git.gitorious.org/tupi/tupi.git + +5. Move into project's directory: + $ cd tupi + +6. Run the configure script: + $ ./configure --prefix=/opt/local --bindir=/opt/local/bin/ --libdir=/opt/local/lib + --sharedir=/opt/local/share --with-debug + +7. Compile the project: + $ make + +8. Install binaries and resources: + $ sudo make install + +9. Run Tupi: + /opt/local/bin/tupi + +TODO: +1. To make Tupi port file for Macports +2. To build App Bundle for easy install (.dmg) diff -Nru tupi-0.2+git04/launcher/tupi tupi-0.2+git05/launcher/tupi --- tupi-0.2+git04/launcher/tupi 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/launcher/tupi 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/bash + +export TUPI_HOME="/usr/local/tupi" +export TUPI_SHARE="/usr/local/tupi/share/tupi" +export TUPI_LIB="/usr/local/tupi/lib/tupi" +export TUPI_PLUGIN="/usr/local/tupi/lib/tupi/plugins" +export TUPI_BIN="/usr/local/tupi/bin" + +export LD_LIBRARY_PATH="${TUPI_LIB}:${TUPI_PLUGIN}:$LD_LIBRARY_PATH" + +exec ${TUPI_BIN}/tupi.bin $* \ No newline at end of file diff -Nru tupi-0.2+git04/launcher/tupi.desktop tupi-0.2+git05/launcher/tupi.desktop --- tupi-0.2+git04/launcher/tupi.desktop 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/launcher/tupi.desktop 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=Tupi: Open 2D Magic +Name[es]=Tupí: Magia 2D Libre +Name[pt]=Tupí: Magia 2D Libre +Name[ru]=Tupi: Open 2D Magic +Exec=/usr/local/tupi/bin/tupi +Icon=tupi +Type=Application +MimeType=application/tup; +Categories=Graphics;2DGraphics;RasterGraphics; +Comment=2D Animation Toolkit +Comment[es]=Herramienta para Animación 2D +Comment[pt]=Ferramenta de animação 2D +Comment[ru]=Создание двухмерной векторной анимации +Terminal=false diff -Nru tupi-0.2+git04/libav.win.pri tupi-0.2+git05/libav.win.pri --- tupi-0.2+git04/libav.win.pri 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/libav.win.pri 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,2 @@ +LIBS += -LC:\libav\bin\ -lavformat -lavcodec -lavutil +INCLUDEPATH += C:\libav\include \ No newline at end of file diff -Nru tupi-0.2+git04/qonf/config.rb tupi-0.2+git05/qonf/config.rb --- tupi-0.2+git04/qonf/config.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/qonf/config.rb 2014-12-15 14:21:32.000000000 +0000 @@ -109,20 +109,18 @@ } File.open("src/framework/tupconfig.pri", "w") { |f| - f << "# Generated automatically at #{Time.now}! PLEASE DO NOT EDIT!"<< $endl - f << "contains(DEFINES, HAVE_FFMPEG){" << $endl - f << "LIBS += -lavcodec -lavformat -lavutil" << $endl - f << "}" << $endl + # f << "# Generated automatically at #{Time.now}! PLEASE DO NOT EDIT!"<< $endl + # f << "contains(DEFINES, HAVE_LIBAV){" << $endl + # f << "LIBS += -lavcodec -lavformat -lavutil" << $endl + # f << "}" << $endl if @defines.include? 'ADD_HEADERS' f << "DEFINES += ADD_HEADERS" << $endl end f << $endl - f << "QT += opengl core gui svg xml network" << $endl - f << "unix {" << $endl - f << " OBJECTS_DIR = .obj" << $endl - f << " UI_DIR = .ui" << $endl - f << " MOC_DIR = .moc" << $endl - f << "}" << $endl + + if not @defines.empty? + f << "DEFINES += " << @defines.uniq.join(" ") << $endl + end if not @options.empty? f << "CONFIG += " << @options.uniq.join(" ") << $endl diff -Nru tupi-0.2+git04/qonf/configure.rb tupi-0.2+git05/qonf/configure.rb --- tupi-0.2+git04/qonf/configure.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/qonf/configure.rb 2014-12-15 14:21:32.000000000 +0000 @@ -67,7 +67,7 @@ @qmake = QMake.new @properties = {} - @ffmpeg = true + @libav = true setPath() Makefile::setArgs(@options) @@ -111,17 +111,17 @@ end def disableFFmpeg() - @ffmpeg = false + @libav = false end def verifyQtVersion(minqtversion, verbose, qtdir) - Info.info << "Checking for Qt >= " << minqtversion << " and Qt < 5.x ..." << $endl + Info.info << "Checking for Qt >= " << minqtversion << $endl if @qmake.findQMake(minqtversion, verbose, qtdir) print "[ \033[92mOK\033[0m ]\n" else print "[ \033[91mFAILED\033[0m ]\n" - raise QonfException.new("\033[91mInvalid Qt version\033[0m.\n Please, upgrade to #{minqtversion} or higher (Visit: http://qt.nokia.com)") + raise QonfException.new("\033[91mInvalid Qt version\033[0m.\n Please, upgrade to #{minqtversion} or higher (Visit: http://qt-project.org)") end end @@ -130,10 +130,10 @@ findTest(@testsDir) end - def runTests(config, conf, debug, isLucid) + def runTests(config, conf, debug) @tests.each { |test| - if not test.run(config, conf, debug, isLucid) and not test.optional - raise QonfException.new("\033[91mMissing required dependency\033[0m") + if not test.run(config, conf, debug) and not test.optional + raise QonfException.new("\033[91mMissing required dependency\033[0m") end } end @@ -142,7 +142,7 @@ Info.info << "Creating makefiles..." << $endl if RUBY_PLATFORM.downcase.include?("darwin") - qmakeLine = "'CONFIG += console warn_on' 'INCLUDEPATH += /usr/local/include/quazip LIBS += -L/usr/local/lib -lavcodec -lavutil -lavformat -framework CoreFoundation'" + qmakeLine = "'CONFIG += console warn_on' 'INCLUDEPATH += /opt/local/include LIBS += -L/opt/local/lib -lavcodec -lavutil -lavformat -framework CoreFoundation'" @qmake.run(qmakeLine, true) else @qmake.run("", true) @@ -203,9 +203,9 @@ findTest(file) end elsif file =~ /.qonf$/ - if file.include? "ffmpeg" - if @ffmpeg - Info.warn << "Adding ffmpeg support: " << @ffmpeg << $endl + if file.include? "libav" + if @libav + Info.warn << "Adding libav support: " << @libav << $endl @tests << Test.new(file, @qmake) end else @@ -269,15 +269,27 @@ newfile += "export TUPI_PLUGIN=\"" + launcher_libdir + "/plugins\"\n" newfile += "export TUPI_BIN=\"" + launcher_bindir + "\"\n\n" + path = "" + unless @options['with-libav'].nil? then + value = @options['with-libav'] + path = value + "/lib:" + end + + unless @options['with-quazip'].nil? then + value = @options['with-quazip'] + path += value + "/lib:" + end + + unless @options['with-theora'].nil? then + value = @options['with-theora'] + path += value + "/lib:" + end + if RUBY_PLATFORM.downcase.include?("darwin") - newfile += "export DYLD_FALLBACK_LIBRARY_PATH=\"\$\{TUPI_LIB\}:\$\{TUPI_PLUGIN\}:$DYLD_FALLBACK_LIBRARY_PATH\"\n\n" + newfile += "export DYLD_FALLBACK_LIBRARY_PATH=\"" + path + "\$\{TUPI_LIB\}:\$\{TUPI_PLUGIN\}:$DYLD_FALLBACK_LIBRARY_PATH\"\n\n" newfile += "open ${TUPI_BIN}/Tupi.app $*" else - if @options['with-ffmpeg'].nil? then - newfile += "export LD_LIBRARY_PATH=\"\$\{TUPI_LIB\}:\$\{TUPI_PLUGIN\}:$LD_LIBRARY_PATH\"\n\n" - else - newfile += "export LD_LIBRARY_PATH=\"" + @options['with-ffmpeg'] + "/lib:\$\{TUPI_LIB\}:\$\{TUPI_PLUGIN\}:$LD_LIBRARY_PATH\"\n\n" - end + newfile += "export LD_LIBRARY_PATH=\"" + path + "\$\{TUPI_LIB\}:\$\{TUPI_PLUGIN\}:$LD_LIBRARY_PATH\"\n\n" newfile += "exec ${TUPI_BIN}/tupi.bin $*" end @@ -285,26 +297,26 @@ f << newfile } - newfile = "[Desktop Entry]\n" - # newfile += "Encoding=UTF-8\n" - newfile += "Name=Tupi: Open 2D Magic\n" - newfile += "Name[es]=Tupí: Magia 2D Libre\n" - newfile += "Name[pt]=Tupí: Magia 2D Libre\n" - newfile += "Name[ru]=Tupi: Open 2D Magic\n" - newfile += "Exec=" + launcher_bindir + "/tupi\n" - newfile += "Icon=tupi\n" - newfile += "Type=Application\n" - newfile += "MimeType=application/tup;\n" - newfile += "Categories=Graphics;2DGraphics;RasterGraphics;\n" - newfile += "Comment=2D Animation Toolkit\n" - newfile += "Comment[es]=Herramienta para Animación 2D\n" - newfile += "Comment[pt]=Ferramenta de animação 2D\n" - newfile += "Comment[ru]=Создание двухмерной векторной анимации\n" - newfile += "Terminal=false\n" - - File.open("launcher/tupi.desktop", "w") { |f| - f << newfile - } + newfile = "[Desktop Entry]\n" + # newfile += "Encoding=UTF-8\n" + newfile += "Name=Tupi: Open 2D Magic\n" + newfile += "Name[es]=Tupí: Magia 2D Libre\n" + newfile += "Name[pt]=Tupí: Magia 2D Libre\n" + newfile += "Name[ru]=Tupi: Open 2D Magic\n" + newfile += "Exec=" + launcher_bindir + "/tupi\n" + newfile += "Icon=tupi\n" + newfile += "Type=Application\n" + newfile += "MimeType=application/tup;\n" + newfile += "Categories=Graphics;2DGraphics;RasterGraphics;\n" + newfile += "Comment=2D Animation Toolkit\n" + newfile += "Comment[es]=Herramienta para Animación 2D\n" + newfile += "Comment[pt]=Ferramenta de animação 2D\n" + newfile += "Comment[ru]=Создание двухмерной векторной анимации\n" + newfile += "Terminal=false\n" + + File.open("launcher/tupi.desktop", "w") { |f| + f << newfile + } end end diff -Nru tupi-0.2+git04/qonf/defaults.rb tupi-0.2+git05/qonf/defaults.rb --- tupi-0.2+git04/qonf/defaults.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/qonf/defaults.rb 2014-12-15 14:21:32.000000000 +0000 @@ -40,5 +40,5 @@ CONFIG["libdir"] = "/usr/local/tupi/lib" CONFIG["includedir"] = "/usr/local/tupi/include" CONFIG["sharedir"] = "/usr/local/tupi/share" - CONFIG["ffmpegdir"] = "/usr" + CONFIG["libavdir"] = "/usr" end diff -Nru tupi-0.2+git04/qonf/detectos.rb tupi-0.2+git05/qonf/detectos.rb --- tupi-0.2+git04/qonf/detectos.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/qonf/detectos.rb 2014-12-15 14:21:32.000000000 +0000 @@ -43,6 +43,8 @@ 3 => "Linux", 31 => "Debian", 311 => "Ubuntu", + 312 => "14.04", + 313 => "14.10", 32 => "Gentoo", 4 => "Mac OS X" } @@ -58,38 +60,43 @@ @os = linux if linux > 0 end - return @os end def self.tryToFindLinuxDistribution - cwd = Dir.getwd - Dir.chdir("/etc/") - - Dir["*{-,_}{version,release}"].each { |path| - if path.downcase =~ /^(\w*)(-|_)(version|release)/ - DetectOS::OS.each { |id, os| - if os.downcase == $1 - Dir.chdir(cwd) - - if $1 == "debian" - if `apt-cache -v`.include?("ubuntu") - return 311 - end - end - - return id - end - } - end - } - - Dir.chdir(cwd) + lsb = "/etc/lsb-release" + if File.exist?(lsb) + distro = "" + version = "" + File.open(lsb, "r") do |f| + f.each_line do |line| + line = line.chop + tag, value = line.split("=") + + if tag.eql? "DISTRIB_ID" + distro = value + end + if tag.eql? "DISTRIB_RELEASE" + version = value + end + end + end + + if distro.eql? "Ubuntu" + if version.eql? "14.04" + return 312 + end + if version.eql? "14.10" + return 313 + end + return 311 + end + end if `uname`.downcase == "linux" return 2 end - + return 0 end end diff -Nru tupi-0.2+git04/qonf/qmake.rb tupi-0.2+git05/qonf/qmake.rb --- tupi-0.2+git04/qonf/qmake.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/qonf/qmake.rb 2014-12-15 14:21:32.000000000 +0000 @@ -48,88 +48,66 @@ # This method check if the current version of Qt is valid for Tupi compilation def findQMake(minqtversion, verbose, qtdir) + path = "qmake" + command = "" + + Info.info << "Testing for #{path}... " + + IO.popen("which #{path}") { |result| + if qtdir.length > 0 + command = qtdir + "/bin/qmake" + else + pathVar = result.readlines.join("").split(":") + if pathVar.length > 0 + command = pathVar[0].chop + end + end + + if command.length == 0 + return false + end + } + qtversion = "" - paths = [ "qmake", "qmake-qt4", "qmake4" ] + version = [] + + IO.popen("#{command} -query QT_VERSION") { |prc| + found = prc.readlines.join("") + version = found.split(".") + if (found.length != 0) + qtversion = found.chop + end + } + minver = minqtversion.split(".") - valid = true - count = 0 - paths.each { |path| - begin - Info.info << "Testing for #{path}... " - valid = true - version = [] - sites = [] - distance = 0 - IO.popen("which #{path}") { |result| - sites = result.readlines.join("").split(":") - word = "" - if qtdir.length > 0 - word = qtdir + "/bin/qmake" - else - if sites.length > 0 - word = sites[0].chop - end - end - distance = word.length - } - - if distance > 0 - IO.popen("#{path} -query QT_VERSION") { |prc| - found = prc.readlines.join("") - version = found.split(".") - if (found.length != 0) - qtversion = found.chop - if (qtversion.start_with?('5')) - return false - end - end - } - next if $? != 0 - - version.size.times { |i| - if i == 0 - if version[i] < minver[i] - return false - elsif version[i] > minver[i] - return true - end - end - - if i == 1 - if version[i] < minver[i] - return false - end - end - - if i == 2 - if version[i] < minver[i] - return false - end - end - } - - if valid - @path = path - break - end + version.size.times { |i| + if i == 0 + if version[i] < minver[i] + return false + end + end - else - count = count + 1 + if i == 1 + if version[i] < minver[i] + return false + end end - end + if i == 2 + if version[i] < minver[i] + return false + end + end } + + @path = command - if count == 3 - return false - end - - if verbose == 1 && valid + if verbose == 1 print "(Found: #{qtversion}) " end - return valid + return true end def query(var) @@ -143,8 +121,8 @@ if recur options += "-r" end - - output = `#{@path} #{args} #{options} ` + + output = `#{@path} #{args} #{options}` if output.strip.empty? return true diff -Nru tupi-0.2+git04/qonf/test.rb tupi-0.2+git05/qonf/test.rb --- tupi-0.2+git04/qonf/test.rb 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/qonf/test.rb 2014-12-15 14:21:32.000000000 +0000 @@ -55,13 +55,13 @@ @optional = false end - def run(config, conf, debug, isLucid) + def run(config, conf, debug) parser = Parser.new parser.os = DetectOS::OS[DetectOS.whatOS].to_s.downcase - + return false if not parser.parse(@rules) or parser.name.empty? - + @optional = parser.optional Info.info << "Checking for " << parser.name << "... " @@ -84,25 +84,51 @@ extraLib = "-L/usr/lib64 " end - if File.dirname(@rules).end_with?("ffmpeg") - if conf.hasArgument?("with-ffmpeg") - ffmpegLib = conf.argumentValue("with-ffmpeg") + "/lib" - extraLib += "-L#{ffmpegLib}" - extraInclude = conf.argumentValue("with-ffmpeg") + "/include" + if File.dirname(@rules).end_with?("libav") + if conf.hasArgument?("with-libav") + libavDir = conf.argumentValue("with-libav") + libavLib = libavDir + "/lib" + extraLib += "-L#{libavLib}" + extraInclude = libavDir + "/include" qmakeLine = "'LIBS += #{extraLib}'"; qmakeLine += " 'INCLUDEPATH += #{extraInclude}'"; end else - qmakeLine = "" - if extraLib.length > 0 - qmakeLine = "'LIBS += #{extraLib} #{parser.libs.join(" ")}'"; + if File.dirname(@rules).end_with?("quazip") + if conf.hasArgument?("with-quazip") + quazipDir = conf.argumentValue("with-quazip") + quazipLib = quazipDir + "/lib" + extraLib += "-L#{quazipLib} -lquazip" + extraInclude = quazipDir + "/include" + qmakeLine = "'LIBS += #{extraLib}'" + qmakeLine += " 'INCLUDEPATH += #{extraInclude}'" + else + if parser.os.eql? "14.10" + extraLib = "-lquazip-qt5" + else + extraLib = "-lquazip" + end + qmakeLine = "'LIBS += #{extraLib}'" + end + else + if File.dirname(@rules).end_with?("theora") + if conf.hasArgument?("with-theora") + theoraDir = conf.argumentValue("with-theora") + theoraLib = theoraDir + "/lib" + extraLib += "-L#{theoraLib}" + extraInclude = theoraDir + "/include" + qmakeLine = "'LIBS += #{extraLib}'" + qmakeLine += " 'INCLUDEPATH += #{extraInclude}'" + end + else + qmakeLine = "" + if extraLib.length > 0 + qmakeLine = "'LIBS += #{extraLib} #{parser.libs.join(" ")}'" + end + end end end - if isLucid - qmakeLine = "'DEFINES += K_LUCID' " + qmakeLine - end - @qmake.run(qmakeLine, true) if not @qmake.compile(debug) @@ -150,6 +176,12 @@ parser.libs.each { |lib| config.addLib(lib) } + + if parser.os.eql? "14.10" + config.addLib("-lquazip-qt5") + else + config.addLib("-lquazip") + end parser.defines.each { |define| config.addDefine(define) diff -Nru tupi-0.2+git04/quazip.win.pri tupi-0.2+git05/quazip.win.pri --- tupi-0.2+git04/quazip.win.pri 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/quazip.win.pri 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,2 @@ +LIBS += -LC:/Quazip/lib/ -lquazip +INCLUDEPATH += C:\Quazip\include\quazip \ No newline at end of file diff -Nru tupi-0.2+git04/src/components/animation/animation.pri tupi-0.2+git05/src/components/animation/animation.pri --- tupi-0.2+git04/src/components/animation/animation.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/animation.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$ANIMATION_DIR -LIBS += -L$$ANIMATION_DIR -ltupianimation + +unix { + LIBS += -L$$ANIMATION_DIR -ltupianimation +} + +win32 { + LIBS += -L$$ANIMATION_DIR/release/ -ltupianimation +} linux-g++ { PRE_TARGETDEPS += $$ANIMATION_DIR/libtupianimation.so diff -Nru tupi-0.2+git04/src/components/animation/animation.pro tupi-0.2+git05/src/components/animation/animation.pro --- tupi-0.2+git04/src/components/animation/animation.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/animation.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/animation -# Target is a library: animation +QT += opengl core gui svg xml network multimedia INSTALLS += target target.path = /lib/ @@ -34,4 +31,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/animation/tupanimationspace.cpp tupi-0.2+git05/src/components/animation/tupanimationspace.cpp --- tupi-0.2+git04/src/components/animation/tupanimationspace.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupanimationspace.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tupanimationspace.h" -#include "tdebug.h" - -#include -#include -#include -#include /** * This class defines the space which contains the Animation Mode interface. diff -Nru tupi-0.2+git04/src/components/animation/tupanimationspace.h tupi-0.2+git05/src/components/animation/tupanimationspace.h --- tupi-0.2+git04/src/components/animation/tupanimationspace.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupanimationspace.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,20 @@ #ifndef TUPWORKSPACE_H #define TUPWORKSPACE_H +#include "tglobal.h" #include "tupcamerawidget.h" + #include +#include +#include +#include +#include /** * @author David Cuadrado **/ -class TupAnimationspace : public QMainWindow +class TUPI_EXPORT TupAnimationspace : public QMainWindow { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/animation/tupcamerabar.cpp tupi-0.2+git05/src/components/animation/tupcamerabar.cpp --- tupi-0.2+git04/src/components/animation/tupcamerabar.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupcamerabar.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,17 +34,15 @@ ***************************************************************************/ #include "tupcamerabar.h" -#include "tdebug.h" -#include "tglobal.h" -#include - - -TupCameraBar::TupCameraBar(QWidget *parent) - : QFrame(parent) +TupCameraBar::TupCameraBar(QWidget *parent) : QFrame(parent) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupCameraBar()]"; + #else + TINIT; + #endif #endif setFrameStyle(QFrame::StyledPanel | QFrame::Raised); @@ -89,7 +87,11 @@ TupCameraBar::~TupCameraBar() { #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[~TupCameraBar()]"; + #else TEND; + #endif #endif } diff -Nru tupi-0.2+git04/src/components/animation/tupcamerabar.h tupi-0.2+git05/src/components/animation/tupcamerabar.h --- tupi-0.2+git04/src/components/animation/tupcamerabar.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupcamerabar.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,18 +36,20 @@ #ifndef TUPCAMERABAR_H #define TUPCAMERABAR_H +#include "tglobal.h" #include "timagebutton.h" #include "tapplicationproperties.h" #include #include #include +#include /** * @author David Cuadrado */ -class TupCameraBar : public QFrame +class TUPI_EXPORT TupCameraBar : public QFrame { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/animation/tupcamerastatus.cpp tupi-0.2+git05/src/components/animation/tupcamerastatus.cpp --- tupi-0.2+git04/src/components/animation/tupcamerastatus.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupcamerastatus.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,22 +34,9 @@ ***************************************************************************/ #include "tupcamerastatus.h" -#include "tupexportwidget.h" -#include "tdebug.h" -#include "tconfig.h" -#include "tseparator.h" - -#include -#include -#include -#include -#include -#include -#include struct TupCameraStatus::Private { - // QComboBox *fps; QSpinBox *fps; QComboBox *scenes; QLabel *framesTotal; @@ -60,7 +47,11 @@ TupCameraStatus::TupCameraStatus(TupCameraWidget *camera, bool isNetworked, QWidget *parent) : QFrame(parent), k(new Private) { #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupCameraStatus()]"; + #else TINIT; + #endif #endif setFrameStyle(QFrame::StyledPanel | QFrame::Raised); @@ -159,7 +150,11 @@ TupCameraStatus::~TupCameraStatus() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupCameraStatus()]"; + #else + TEND; + #endif #endif } @@ -187,9 +182,12 @@ if (k->scenes->count()) k->scenes->clear(); - foreach (TupScene *scene, project->scenes().values()) { - if (scene) - k->scenes->addItem(scene->sceneName()); + int scenesTotal = project->scenes().size(); + for (int i = 0; i < scenesTotal; i++) { + TupScene *scene = project->scenes().at(i); + if (scene) + k->scenes->addItem(scene->sceneName()); + } } diff -Nru tupi-0.2+git04/src/components/animation/tupcamerastatus.h tupi-0.2+git05/src/components/animation/tupcamerastatus.h --- tupi-0.2+git04/src/components/animation/tupcamerastatus.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupcamerastatus.h 2014-12-15 14:21:32.000000000 +0000 @@ -37,16 +37,22 @@ #define TUPCAMERASTATUS_H #include "tupcamerawidget.h" +#include "tupexportwidget.h" +#include "tconfig.h" +#include "tseparator.h" #include #include #include #include #include +#include +#include +#include class TupCameraWidget; -class TupCameraStatus : public QFrame +class TUPI_EXPORT TupCameraStatus : public QFrame { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/animation/tupcamerawidget.cpp tupi-0.2+git05/src/components/animation/tupcamerawidget.cpp --- tupi-0.2+git04/src/components/animation/tupcamerawidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupcamerawidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,22 +34,13 @@ ***************************************************************************/ #include "tupcamerawidget.h" -#include "tupexportwidget.h" -#include "tdebug.h" -#include "tseparator.h" -#include "tupprojectrequest.h" -#include "tupprojectresponse.h" -#include "tuprequestbuilder.h" - -#include -#include -#include -#include struct TupCameraWidget::Private { QFrame *container; TupScreen *screen; + TupCameraBar *cameraBar; + QProgressBar *progressBar; TupCameraStatus *status; TupProject *project; int currentSceneIndex; @@ -62,7 +53,11 @@ TupCameraWidget::TupCameraWidget(TupProject *project, bool isNetworked, QWidget *parent) : QFrame(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupCameraWidget()]"; + #else + TINIT; + #endif #endif QDesktopWidget desktop; @@ -118,18 +113,27 @@ layout->addWidget(scaleWidget, 0, Qt::AlignCenter); layout->addLayout(labelLayout, Qt::AlignCenter); + k->progressBar = new QProgressBar(this); + QString style = "QProgressBar { background-color: #DDDDDD; text-align: center; color: #FFFFFF; border-radius: 2px; } QProgressBar::chunk { background-color: #009500; border-radius: 2px; }"; + k->progressBar->setStyleSheet(style); + k->progressBar->setMaximumHeight(5); + k->progressBar->setTextVisible(false); + k->progressBar->setRange(1, 100); + layout->addWidget(k->progressBar, 0, Qt::AlignCenter); + k->screen = new TupScreen(k->project, k->playerDimension, k->isScaled); + connect(k->screen, SIGNAL(isRendering(int)), this, SLOT(updateProgressBar(int))); + layout->addWidget(k->screen, 0, Qt::AlignCenter); - TupCameraBar *cameraBar = new TupCameraBar; - layout->addWidget(cameraBar, 0, Qt::AlignCenter); - cameraBar->show(); - - connect(cameraBar, SIGNAL(play()), this, SLOT(doPlay())); - connect(cameraBar, SIGNAL(playBack()), this, SLOT(doPlayBack())); - connect(cameraBar, SIGNAL(stop()), k->screen, SLOT(stop())); - connect(cameraBar, SIGNAL(ff()), k->screen, SLOT(nextFrame())); - connect(cameraBar, SIGNAL(rew()), k->screen, SLOT(previousFrame())); + k->cameraBar = new TupCameraBar; + layout->addWidget(k->cameraBar, 0, Qt::AlignCenter); + + connect(k->cameraBar, SIGNAL(play()), this, SLOT(doPlay())); + connect(k->cameraBar, SIGNAL(playBack()), this, SLOT(doPlayBack())); + connect(k->cameraBar, SIGNAL(stop()), k->screen, SLOT(stop())); + connect(k->cameraBar, SIGNAL(ff()), k->screen, SLOT(nextFrame())); + connect(k->cameraBar, SIGNAL(rew()), k->screen, SLOT(previousFrame())); k->status = new TupCameraStatus(this, isNetworked); k->status->setScenes(k->project); @@ -147,7 +151,11 @@ TupCameraWidget::~TupCameraWidget() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupCameraWidget()]"; + #else + TEND; + #endif #endif } @@ -228,7 +236,11 @@ bool TupCameraWidget::handleProjectResponse(TupProjectResponse *response) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupCameraWidget::handleProjectResponse()]"; + #else + T_FUNCINFO; + #endif #endif if (TupSceneResponse *sceneResponse = static_cast(response)) { @@ -276,7 +288,12 @@ default: { #ifdef K_DEBUG - tFatal() << "TupCameraWidget::handleProjectResponse() - Unknown/Unhandled project action: " << sceneResponse->action(); + QString msg = "TupCameraWidget::handleProjectResponse() - Unknown/Unhandled project action: " + QString::number(sceneResponse->action()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } break; @@ -293,13 +310,23 @@ k->screen->setFPS(fps); } +void TupCameraWidget::setStatusFPS(int fps) +{ + k->status->blockSignals(true); + k->status->setFPS(fps); + k->status->blockSignals(false); + + k->project->setFPS(fps); + k->screen->setFPS(fps); +} + void TupCameraWidget::updateFramesTotal(int sceneIndex) { TupScene *scene = k->project->scene(sceneIndex); if (scene) { - QString total = ""; - total = total.setNum(scene->framesTotal()); - k->status->setFramesTotal(total); + int total = scene->framesTotal(); + k->status->setFramesTotal(QString::number(total)); + k->progressBar->setRange(0, total); } } @@ -352,3 +379,8 @@ { k->screen->updateAnimationArea(); } + +void TupCameraWidget::updateProgressBar(int advance) +{ + k->progressBar->setValue(advance); +} diff -Nru tupi-0.2+git04/src/components/animation/tupcamerawidget.h tupi-0.2+git05/src/components/animation/tupcamerawidget.h --- tupi-0.2+git04/src/components/animation/tupcamerawidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupcamerawidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,6 +36,12 @@ #ifndef TUPCAMERAWIDGET_H #define TUPCAMERAWIDGET_H +#include "tglobal.h" +#include "tupexportwidget.h" +#include "tseparator.h" +#include "tupprojectrequest.h" +#include "tupprojectresponse.h" +#include "tuprequestbuilder.h" #include "tcirclebuttonbar.h" #include "tvhbox.h" #include "tupscreen.h" @@ -44,6 +50,11 @@ #include #include +#include +#include +#include +#include +#include class TupProjectResponse; class QCheckBox; @@ -53,7 +64,7 @@ * @author David Cuadrado */ -class TupCameraWidget : public QFrame +class TUPI_EXPORT TupCameraWidget : public QFrame { Q_OBJECT @@ -68,10 +79,12 @@ private slots: void setLoop(); void selectScene(int index); + void updateProgressBar(int advance); public slots: bool handleProjectResponse(TupProjectResponse *event); void setFPS(int fps); + void setStatusFPS(int fps); void updateFramesTotal(int sceneIndex); void exportDialog(); void postDialog(); diff -Nru tupi-0.2+git04/src/components/animation/tupscreen.cpp tupi-0.2+git05/src/components/animation/tupscreen.cpp --- tupi-0.2+git04/src/components/animation/tupscreen.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupscreen.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,19 +34,6 @@ ***************************************************************************/ #include "tupscreen.h" -#include "tupprojectresponse.h" -#include "tupgraphicobject.h" -#include "tupgraphicsscene.h" -#include "tupanimationrenderer.h" -#include "tupsoundlayer.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include typedef QList photoArray; @@ -54,6 +41,7 @@ { QWidget *container; QImage renderCamera; + QPoint imagePos; bool firstShoot; bool isScaled; const TupProject *project; @@ -70,24 +58,35 @@ QList animationList; QList renderControl; QSize screenDimension; + + TupLibrary *library; + QList > lipSyncRecords; + QMediaPlayer *soundPlayer; + + bool isPlaying; }; -TupScreen::TupScreen(const TupProject *project, const QSize viewSize, bool isScaled, QWidget *parent) : QFrame(parent), k(new Private) +TupScreen::TupScreen(TupProject *project, const QSize viewSize, bool isScaled, QWidget *parent) : QFrame(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen()]"; + #else + TINIT; + #endif #endif k->container = parent; k->project = project; + k->library = project->library(); k->isScaled = isScaled; - k->screenDimension = viewSize; - k->cyclicAnimation = false; k->fps = 24; k->currentSceneIndex = 0; k->currentFramePosition = 0; + k->soundPlayer = new QMediaPlayer; + k->isPlaying = false; k->timer = new QTimer(this); k->playBackTimer = new QTimer(this); @@ -96,15 +95,19 @@ connect(k->playBackTimer, SIGNAL(timeout()), this, SLOT(back())); initPhotogramsArray(); - updateFirstFrame(); updateSceneIndex(0); + updateFirstFrame(); } TupScreen::~TupScreen() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupScreen()]"; + #else + TEND; + #endif #endif k->timer->stop(); @@ -122,7 +125,11 @@ void TupScreen::resetPhotograms(int sceneIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::resetPhotograms()]"; + #else + T_FUNCINFO; + #endif #endif if (sceneIndex > -1) { @@ -139,7 +146,11 @@ void TupScreen::initPhotogramsArray() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::initPhotogramsArray()]"; + #else + T_FUNCINFO; + #endif #endif k->renderControl.clear(); @@ -154,95 +165,124 @@ void TupScreen::setFPS(int fps) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::setFPS()]"; + #else + T_FUNCINFO; + #endif #endif - k->fps = fps; + k->fps = fps; - if (k->timer->isActive()) { - k->timer->stop(); - play(); - } + if (k->timer->isActive()) { + k->timer->stop(); + play(); + } - if (k->playBackTimer->isActive()) { - k->playBackTimer->stop(); - playBack(); - } + if (k->playBackTimer->isActive()) { + k->playBackTimer->stop(); + playBack(); + } } void TupScreen::paintEvent(QPaintEvent *) { - /* - #ifdef K_DEBUG - T_FUNCINFO; - #endif - */ - - if (!k->firstShoot) { - if (k->currentFramePosition > -1 && k->currentFramePosition < k->photograms.count()) - k->renderCamera = k->photograms[k->currentFramePosition]; - } else { - k->firstShoot = false; - } + /* + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::paintEvent()]"; + #else + T_FUNCINFO; + #endif + #endif + */ - QPainter painter; - painter.begin(this); + if (k->isPlaying) + playLipSyncAt(k->currentFramePosition); - int x = (frameSize().width() - k->renderCamera.size().width()) / 2; - int y = (frameSize().height() - k->renderCamera.size().height()) / 2; - painter.drawImage(QPoint(x, y), k->renderCamera); - - // SQA: Border for the player. Useful for some tests - // painter.setPen(QPen(Qt::gray, 0.5, Qt::SolidLine)); - // painter.drawRect(x, y, k->renderCamera.size().width()-1, k->renderCamera.size().height()-1); + if (!k->firstShoot) { + if (k->currentFramePosition > -1 && k->currentFramePosition < k->photograms.count()) + k->renderCamera = k->photograms[k->currentFramePosition]; + } else { + k->firstShoot = false; + } + + QPainter painter; + painter.begin(this); + + painter.drawImage(k->imagePos, k->renderCamera); + + // SQA: Border for the player. Useful for some tests + // painter.setPen(QPen(Qt::gray, 0.5, Qt::SolidLine)); + // painter.drawRect(x, y, k->renderCamera.size().width()-1, k->renderCamera.size().height()-1); } void TupScreen::play() { - #ifdef K_DEBUG - tWarning("camera") << "TupScreen::play() - Playing at " << k->fps << " FPS"; - #endif - - if (k->playBackTimer->isActive()) - stop(); - - k->currentFramePosition = 0; - - if (!k->timer->isActive()) { - if (!k->renderControl.at(k->currentSceneIndex)) { - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - render(); - QApplication::restoreOverrideCursor(); - } + #ifdef K_DEBUG + QString msg = "TupScreen::play() - Playing at " + QString::number(k->fps) + " FPS"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("camera") << msg; + #endif + #endif - if (k->renderControl.at(k->currentSceneIndex)) - k->timer->start(1000 / k->fps); - } + k->isPlaying = true; + + if (k->playBackTimer->isActive()) + stop(); + + k->currentFramePosition = 0; + + if (!k->timer->isActive()) { + if (!k->renderControl.at(k->currentSceneIndex)) { + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + render(); + QApplication::restoreOverrideCursor(); + } + + if (k->renderControl.at(k->currentSceneIndex)) + k->timer->start(1000 / k->fps); + } } void TupScreen::playBack() { - #ifdef K_DEBUG - tWarning("camera") << "TupScreen::playBack() - Starting procedure..."; - #endif - - if (k->timer->isActive()) - stop(); - - k->currentFramePosition = k->photograms.count() - 1; - - if (!k->playBackTimer->isActive()) { - if (!k->renderControl.at(k->currentSceneIndex)) - render(); - k->playBackTimer->start(1000 / k->fps); - } + #ifdef K_DEBUG + QString msg = "TupScreen::playBack() - Starting procedure..."; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("camera") << msg; + #endif + #endif + + if (k->timer->isActive()) + stop(); + + k->currentFramePosition = k->photograms.count() - 1; + + if (!k->playBackTimer->isActive()) { + if (!k->renderControl.at(k->currentSceneIndex)) + render(); + k->playBackTimer->start(1000 / k->fps); + } } void TupScreen::stop() { #ifdef K_DEBUG - tWarning("camera") << "TupScreen::stop() - Stopping player!"; + QString msg = "TupScreen::stop() - Stopping player!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("camera") << msg; + #endif #endif + + k->isPlaying = false; + k->soundPlayer->stop(); if (k->timer->isActive()) k->timer->stop(); @@ -260,26 +300,44 @@ void TupScreen::nextFrame() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::nextFrame()]"; + #else + T_FUNCINFO; + #endif #endif if (!k->renderControl.at(k->currentSceneIndex)) render(); k->currentFramePosition += 1; + + if (k->currentFramePosition == k->photograms.count()) + k->currentFramePosition = 0; + repaint(); } void TupScreen::previousFrame() { + /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::previousFrame()]"; + #else + T_FUNCINFO; + #endif #endif + */ if (!k->renderControl.at(k->currentSceneIndex)) render(); k->currentFramePosition -= 1; + + if (k->currentFramePosition < 0) + k->currentFramePosition = k->photograms.count() - 1; + repaint(); } @@ -287,7 +345,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::advance()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -310,7 +372,11 @@ void TupScreen::back() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::back()]"; + #else + T_FUNCINFO; + #endif #endif if (k->cyclicAnimation && k->currentFramePosition < 0) @@ -335,7 +401,11 @@ void TupScreen::sceneResponse(TupSceneResponse *event) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::sceneResponse()]"; + #else + T_FUNCINFO; + #endif #endif int index = event->sceneIndex(); @@ -393,40 +463,43 @@ void TupScreen::render() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::render()]"; + #else + T_FUNCINFO; + #endif #endif + emit isRendering(0); + TupScene *scene = k->project->scene(k->currentSceneIndex); if (!scene) { #ifdef K_DEBUG - tError() << "TupScreen::render() - [ Fatal Error ] - Scene is NULL! -> index: " << k->currentSceneIndex; + QString msg = "TupScreen::render() - [ Fatal Error ] - Scene is NULL! -> index: " + QString::number(k->currentSceneIndex); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } k->sounds.clear(); - foreach (TupSoundLayer *layer, scene->soundLayers().values()) - k->sounds << layer; + int soundLayersTotal = scene->soundLayers().size(); + for (int i = 0; i < soundLayersTotal; i++) { + TupSoundLayer *layer = scene->soundLayers().at(i); + k->sounds << layer; + } - TupAnimationRenderer renderer(k->project->bgColor()); + TupAnimationRenderer renderer(k->project->bgColor(), k->library); renderer.setScene(scene, k->project->dimension()); QFont font = this->font(); font.setPointSize(8); - QProgressDialog progressDialog(this, Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Dialog); - progressDialog.setFont(font); - progressDialog.setLabelText(tr("Rendering...")); - progressDialog.setCancelButton(0); - progressDialog.setRange(1, renderer.totalPhotograms()); - - QDesktopWidget desktop; - progressDialog.move((int) (desktop.screenGeometry().width() - progressDialog.width())/2, - (int) (desktop.screenGeometry().height() - progressDialog.height())/2); - progressDialog.show(); - QList photogramList; int i = 1; @@ -444,19 +517,25 @@ photogramList << renderized; } - progressDialog.setValue(i); + emit isRendering(i); i++; } k->photograms = photogramList; k->animationList.replace(k->currentSceneIndex, photogramList); k->renderControl.replace(k->currentSceneIndex, true); + + emit isRendering(0); } QSize TupScreen::sizeHint() const { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::sizeHint()]"; + #else + T_FUNCINFO; + #endif #endif return k->renderCamera.size(); @@ -465,7 +544,11 @@ void TupScreen::resizeEvent(QResizeEvent *event) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::resizeEvent()]"; + #else + T_FUNCINFO; + #endif #endif QFrame::resizeEvent(event); @@ -478,7 +561,12 @@ update(); } else { #ifdef K_DEBUG - tError() << "TupScreen::resizeEvent() - [ Error ] - Current index is invalid -> " << k->currentSceneIndex; + QString msg = "TupScreen::resizeEvent() - [ Error ] - Current index is invalid -> " + QString::number(k->currentSceneIndex); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -486,7 +574,11 @@ void TupScreen::setLoop(bool loop) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::setLoop()]"; + #else + T_FUNCINFO; + #endif #endif k->cyclicAnimation = loop; @@ -495,7 +587,11 @@ void TupScreen::updateSceneIndex(int index) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::updateSceneIndex()]"; + #else + T_FUNCINFO; + #endif #endif k->currentSceneIndex = index; @@ -504,7 +600,12 @@ k->photograms = k->animationList.at(k->currentSceneIndex); } else { #ifdef K_DEBUG - tError() << "TupScreen::updateSceneIndex() - [ Error ] - Can't set current photogram array -> " << k->currentSceneIndex; + QString msg = "TupScreen::updateSceneIndex() - [ Error ] - Can't set current photogram array -> " + QString::number(k->currentSceneIndex); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -517,7 +618,11 @@ TupScene *TupScreen::currentScene() const { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::currentScene()]"; + #else + T_FUNCINFO; + #endif #endif if (k->currentSceneIndex > -1) { @@ -539,7 +644,11 @@ void TupScreen::updateAnimationArea() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::updateAnimationArea()]"; + #else + T_FUNCINFO; + #endif #endif if (k->currentSceneIndex > -1 && k->currentSceneIndex < k->animationList.count()) { @@ -549,7 +658,12 @@ update(); } else { #ifdef K_DEBUG - tError() << "TupScreen::updateAnimationArea() - [ Fatal Error ] - Can't access to scene index: " << k->currentSceneIndex; + QString msg = "TupScreen::updateAnimationArea() - [ Fatal Error ] - Can't access to scene index: " + QString::number(k->currentSceneIndex); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -561,13 +675,19 @@ void TupScreen::updateFirstFrame() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::updateFirstFrame()]"; + #else + T_FUNCINFO; + #endif #endif if (k->currentSceneIndex > -1 && k->currentSceneIndex < k->animationList.count()) { TupScene *scene = k->project->scene(k->currentSceneIndex); if (scene) { - TupAnimationRenderer renderer(k->project->bgColor()); + setLipSyncSettings(); + + TupAnimationRenderer renderer(k->project->bgColor(), k->library); renderer.setScene(scene, k->project->dimension()); renderer.renderPhotogram(0); @@ -584,15 +704,29 @@ k->renderCamera = firstFrame; } + int x = (frameSize().width() - k->renderCamera.size().width()) / 2; + int y = (frameSize().height() - k->renderCamera.size().height()) / 2; + k->imagePos = QPoint(x, y); + k->firstShoot = true; } else { #ifdef K_DEBUG - tError() << "TupScreen::updateFirstFrame() - [ Fatal Error ] - Null scene at index: " << k->currentSceneIndex; + QString msg = "TupScreen::updateFirstFrame() - [ Fatal Error ] - Null scene at index: " + QString::number(k->currentSceneIndex); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupScreen::updateFirstFrame() - [ Fatal Error ] - Can't access to scene index: " << k->currentSceneIndex; + QString msg = "TupScreen::updateFirstFrame() - [ Fatal Error ] - Can't access to scene index: " + QString::number(k->currentSceneIndex); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -600,7 +734,11 @@ void TupScreen::addPhotogramsArray(int sceneIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScreen::addPhotogramsArray()]"; + #else + T_FUNCINFO; + #endif #endif if (sceneIndex > -1) { @@ -609,3 +747,40 @@ k->animationList.insert(sceneIndex, photograms); } } + +void TupScreen::setLipSyncSettings() +{ + TupScene *scene = k->project->scene(k->currentSceneIndex); + if (scene) { + if (scene->lipSyncTotal() > 0) { + k->lipSyncRecords.clear(); + Mouths mouths = scene->getLipSyncList(); + foreach(TupLipSync *lipsync, mouths) { + TupLibraryFolder *folder = k->library->getFolder(lipsync->name()); + if (folder) { + TupLibraryObject *sound = folder->getObject(lipsync->soundFile()); + if (sound) { + QPair soundRecord; + soundRecord.first = lipsync->initFrame(); + soundRecord.second = sound->dataPath(); + k->lipSyncRecords << soundRecord; + } + } + } + } + } +} + +void TupScreen::playLipSyncAt(int frame) +{ + int size = k->lipSyncRecords.count(); + for(int i=0; i soundRecord = k->lipSyncRecords.at(i); + if (frame == soundRecord.first) { + QString path = soundRecord.second; + k->soundPlayer->setMedia(QUrl::fromLocalFile(soundRecord.second)); + k->soundPlayer->play(); + } + } +} + diff -Nru tupi-0.2+git04/src/components/animation/tupscreen.h tupi-0.2+git05/src/components/animation/tupscreen.h --- tupi-0.2+git04/src/components/animation/tupscreen.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/animation/tupscreen.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,27 @@ #ifndef TUPSCREEN_H #define TUPSCREEN_H +#include "tglobal.h" #include "tupscene.h" -#include "tupglobal.h" #include "tupabstractprojectresponsehandler.h" +#include "tupprojectresponse.h" +#include "tupgraphicobject.h" +#include "tupgraphicsscene.h" +#include "tupanimationrenderer.h" +#include "tupsoundlayer.h" +#include "tuplibrary.h" #include #include #include #include +#include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado @@ -54,7 +67,7 @@ Q_OBJECT public: - TupScreen(const TupProject *project, const QSize viewSize = QSize(), bool isScaled = false, QWidget *parent = 0); + TupScreen(TupProject *project, const QSize viewSize = QSize(), bool isScaled = false, QWidget *parent = 0); ~TupScreen(); QSize sizeHint() const; @@ -92,6 +105,7 @@ void toStatusBar(const QString &, int); void sceneChanged(const TupScene *newScene); void requestTriggered(const TupProjectRequest *event); + void isRendering(int advance); protected: void paintEvent(QPaintEvent *event); @@ -101,6 +115,9 @@ void initPhotogramsArray(); void addPhotogramsArray(int index); void updateFirstFrame(); + void setLipSyncSettings(); + void playLipSyncAt(int frame); + struct Private; Private *const k; }; diff -Nru tupi-0.2+git04/src/components/colorpalette/colorpalette.pri tupi-0.2+git05/src/components/colorpalette/colorpalette.pri --- tupi-0.2+git04/src/components/colorpalette/colorpalette.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/colorpalette.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$COLORPALETTE_DIR -LIBS += -L$$COLORPALETTE_DIR -ltupicolorpalette + +unix { + LIBS += -L$$COLORPALETTE_DIR -ltupicolorpalette +} + +win32 { + LIBS += -L$$COLORPALETTE_DIR/release -ltupicolorpalette +} linux-g++ { PRE_TARGETDEPS += $$COLORPALETTE_DIR/libtupicolorpalette.so diff -Nru tupi-0.2+git04/src/components/colorpalette/colorpalette.pro tupi-0.2+git05/src/components/colorpalette/colorpalette.pro --- tupi-0.2+git04/src/components/colorpalette/colorpalette.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/colorpalette.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/colorpalette -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += tpal @@ -35,10 +32,43 @@ *:!macx{ CONFIG += dll warn_on } + TEMPLATE = lib TARGET = tupicolorpalette FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/colorpalette/palettes/Default.tpal tupi-0.2+git05/src/components/colorpalette/palettes/Default.tpal --- tupi-0.2+git04/src/components/colorpalette/palettes/Default.tpal 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/palettes/Default.tpal 2014-12-15 14:21:32.000000000 +0000 @@ -1,26 +1,211 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcellscolor.cpp tupi-0.2+git05/src/components/colorpalette/tupcellscolor.cpp --- tupi-0.2+git04/src/components/colorpalette/tupcellscolor.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcellscolor.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,15 +34,6 @@ ***************************************************************************/ #include "tupcellscolor.h" -#include "tdebug.h" -#include "tuppalettedocument.h" - -#include -#include -#include -#include -#include -#include struct TupCellsColor::Private { diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcellscolor.h tupi-0.2+git05/src/components/colorpalette/tupcellscolor.h --- tupi-0.2+git04/src/components/colorpalette/tupcellscolor.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcellscolor.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,24 @@ #ifndef TUPCELLSCOLOR_H #define TUPCELLSCOLOR_H +#include "tglobal.h" #include "tcellview.h" +#include "tuppalettedocument.h" + +#include +#include +#include +#include +#include +#include +#include +#include /** * @author Jorge Cuadrado **/ -class TupCellsColor : public TCellView +class TUPI_EXPORT TupCellsColor : public TCellView { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcolorpalette.cpp tupi-0.2+git05/src/components/colorpalette/tupcolorpalette.cpp --- tupi-0.2+git04/src/components/colorpalette/tupcolorpalette.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcolorpalette.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,28 +34,6 @@ ***************************************************************************/ #include "tupcolorpalette.h" -#include "tdebug.h" -#include "timagebutton.h" -#include "tglobal.h" -#include "tconfig.h" -#include "tuppaintareaevent.h" -#include "tupcolorvalue.h" -#include "tupviewcolorcells.h" -#include "tupcolorpicker.h" -#include "tupluminancepicker.h" -#include "tupgradientcreator.h" -#include "tvhbox.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include struct TupColorPalette::Private { @@ -84,7 +62,11 @@ TupColorPalette::TupColorPalette(QWidget *parent) : TupModuleWidgetBase(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupColorPalette()]"; + #else + TINIT; + #endif #endif k->currentOutlineColor = Qt::black; @@ -96,6 +78,7 @@ setWindowIcon(QPixmap(THEME_DIR + "icons/color_palette.png")); k->splitter = new QSplitter(Qt::Vertical, this); + k->tab = new QTabWidget; connect(k->tab, SIGNAL(currentChanged(int)), this, SLOT(updateColorType(int))); @@ -108,8 +91,11 @@ setupGradientManager(); k->tab->setPalette(palette()); + k->tab->setMinimumHeight(300); k->splitter->addWidget(k->tab); + setMinimumWidth(316); + TCONFIG->beginGroup("ColorPalette"); // QColor foreground = QColor(TCONFIG->value("LastForegroundColor", Qt::black).toString()); // QColor background = QColor(TCONFIG->value("LastBackgroundColor", Qt::transparent).toString()); @@ -118,8 +104,12 @@ TupColorPalette::~TupColorPalette() { #ifdef K_DEBUG - TEND; - #endif + #ifdef Q_OS_WIN32 + qDebug() << "[~TupColorPalette()]"; + #else + TEND; + #endif + #endif TCONFIG->beginGroup("ColorPalette"); TCONFIG->setValue("LastForegroundColor", color().first); @@ -159,8 +149,11 @@ QBoxLayout *layoutName = new QBoxLayout(QBoxLayout::TopToBottom); layoutName->setMargin(0); + layoutName->setSpacing(1); - layoutName->addWidget(new QLabel("HTML", viewColor)); + QLabel *html = new QLabel(tr("HTML"), viewColor); + html->setAlignment(Qt::AlignHCenter); + layoutName->addWidget(html); k->htmlNameColor = new QLineEdit(viewColor); k->htmlNameColor->setMaximumWidth(70); k->htmlNameColor->setMaxLength(7); @@ -267,12 +260,12 @@ */ } - tFatal() << "TupColorPalette::setColor() - Updating background color!"; + // tFatal() << "TupColorPalette::setColor() - Updating background color!"; // TupPaintAreaEvent event(TupPaintAreaEvent::ChangeBrush, k->outlineAndFillColors->background().color()); TupPaintAreaEvent event(TupPaintAreaEvent::ChangeBrush, brush); emit paintAreaEventTriggered(&event); - tFatal() << "TupColorPalette::setColor() - Updating foreground color!"; + // tFatal() << "TupColorPalette::setColor() - Updating foreground color!"; TupPaintAreaEvent event2(TupPaintAreaEvent::ChangeColorPen, k->outlineAndFillColors->foreground().color()); emit paintAreaEventTriggered(&event2); } @@ -309,7 +302,7 @@ void TupColorPalette::updateColorFromDisplay(const QBrush &brush) { - tFatal() << "TupColorPalette::updateColorFromDisplay() - Just tracing color: " << brush.color().name(); + // tFatal() << "TupColorPalette::updateColorFromDisplay() - Just tracing color: " << brush.color().name(); setGlobalColors(brush); QColor color = brush.color(); @@ -330,9 +323,9 @@ k->labelType->setCurrentIndex(k->currentSpace); - tFatal() << "TupColorPalette::updateColorSpace() - Picking button #" << space; - tFatal() << "TupColorPalette::updateColorSpace() - Color: " << color.name(); - tFatal() << "TupColorPalette::updateColorSpace() - Alpha: " << color.alpha(); + // tFatal() << "TupColorPalette::updateColorSpace() - Picking button #" << space; + // tFatal() << "TupColorPalette::updateColorSpace() - Color: " << color.name(); + // tFatal() << "TupColorPalette::updateColorSpace() - Alpha: " << color.alpha(); k->htmlNameColor->setText(color.name()); k->luminancePicker->setColor(color.hue(), color.saturation(), color.value()); @@ -341,7 +334,7 @@ void TupColorPalette::updateGradientColor(const QBrush &brush) { - tFatal() << "TupColorPalette::updateGradientColor() - Just tracing!"; + // tFatal() << "TupColorPalette::updateGradientColor() - Just tracing!"; setGlobalColors(brush); } @@ -357,8 +350,8 @@ void TupColorPalette::setHS(int hue, int saturation) { - tFatal() << "TupColorPalette::setHS() - H: " << hue; - tFatal() << "TupColorPalette::setHS() - S: " << saturation; + // tFatal() << "TupColorPalette::setHS() - H: " << hue; + // tFatal() << "TupColorPalette::setHS() - S: " << saturation; int luminance = 255; if (hue == 0 && saturation == 0) @@ -369,8 +362,8 @@ k->luminancePicker->setColor(color.hue(), color.saturation(), color.value()); k->displayColorForms->setColor(color); - tFatal() << "TupColorPalette::setHS() - Color: " << color.name(); - tDebug() << ""; + // tFatal() << "TupColorPalette::setHS() - Color: " << color.name(); + // tDebug() << ""; setGlobalColors(QBrush(color)); } @@ -455,7 +448,7 @@ k->displayColorForms->setColor(color); k->gradientManager->setCurrentColor(Qt::white); - TupPaintAreaEvent event(TupPaintAreaEvent::ChangeColorPen, Qt::black); + TupPaintAreaEvent event(TupPaintAreaEvent::ChangeColorPen, QColor(Qt::black)); emit paintAreaEventTriggered(&event); event = TupPaintAreaEvent(TupPaintAreaEvent::ChangeBrush, brush); @@ -549,13 +542,13 @@ void TupColorPalette::updateColorType(int index) { if (index == TupColorPalette::Solid) { - tFatal() << "TupColorPalette::updateColorType() - Solid Color!"; + // tFatal() << "TupColorPalette::updateColorType() - Solid Color!"; if (k->currentSpace == TDualColorButton::Foreground) k->fgType = Solid; else k->bgType = Solid; } else { - tFatal() << "TupColorPalette::updateColorType() - Gradient Color!"; + // tFatal() << "TupColorPalette::updateColorType() - Gradient Color!"; if (k->currentSpace == TDualColorButton::Foreground) k->fgType = Gradient; else diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcolorpalette.h tupi-0.2+git05/src/components/colorpalette/tupcolorpalette.h --- tupi-0.2+git04/src/components/colorpalette/tupcolorpalette.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcolorpalette.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,9 +36,30 @@ #ifndef TUPCOLORPALETTE_H #define TUPCOLORPALETTE_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "tdualcolorbutton.h" #include "ticon.h" +#include "timagebutton.h" +#include "tconfig.h" +#include "tuppaintareaevent.h" +#include "tupcolorvalue.h" +#include "tupviewcolorcells.h" +#include "tupcolorpicker.h" +#include "tupluminancepicker.h" +#include "tupgradientcreator.h" +#include "tvhbox.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include class TupColorPalette; @@ -46,7 +67,7 @@ * @author Jorge Cuadrado */ -class TupColorPalette : public TupModuleWidgetBase +class TUPI_EXPORT TupColorPalette : public TupModuleWidgetBase { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcolorpicker.cpp tupi-0.2+git05/src/components/colorpalette/tupcolorpicker.cpp --- tupi-0.2+git04/src/components/colorpalette/tupcolorpicker.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcolorpicker.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tupcolorpicker.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include static int pWidth = 100; static int pHeight = 80; @@ -81,8 +70,13 @@ TupColorPicker::~TupColorPicker() { delete k; + #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupColorPicker()]"; + #else + TEND; + #endif #endif } @@ -125,7 +119,7 @@ QRect rect(colorPoint(), QSize(20,20)); k->hue = nhue; k->saturation = nsat; - rect = rect.unite(QRect(colorPoint(), QSize(20,20))); + rect = rect.united(QRect(colorPoint(), QSize(20,20))); rect.translate(contentsRect().x()-9, contentsRect().y()-9); repaint(rect); @@ -139,7 +133,7 @@ QRect rect(colorPoint(), QSize(20, 20)); k->hue = newHue; - rect = rect.unite(QRect(colorPoint(), QSize(20, 20))); + rect = rect.united(QRect(colorPoint(), QSize(20, 20))); rect.translate(contentsRect().x()-9, contentsRect().y()-9); repaint(rect); @@ -153,7 +147,7 @@ QRect rect(colorPoint(), QSize(20,20)); k->saturation = newSat; - rect = rect.unite(QRect(colorPoint(), QSize(20,20))); + rect = rect.united(QRect(colorPoint(), QSize(20,20))); rect.translate(contentsRect().x()-9, contentsRect().y()-9); repaint(rect); diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcolorpicker.h tupi-0.2+git05/src/components/colorpalette/tupcolorpicker.h --- tupi-0.2+git04/src/components/colorpalette/tupcolorpicker.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcolorpicker.h 2014-12-15 14:21:32.000000000 +0000 @@ -33,12 +33,23 @@ * along with this program. If not, see . * ***************************************************************************/ -#include - #ifndef TUPCOLORPICKER_H #define TUPCOLORPICKER_H -class TupColorPicker : public QFrame +#include "tglobal.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class TUPI_EXPORT TupColorPicker : public QFrame { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcolorvalue.cpp tupi-0.2+git05/src/components/colorpalette/tupcolorvalue.cpp --- tupi-0.2+git04/src/components/colorpalette/tupcolorvalue.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcolorvalue.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,18 +34,6 @@ ***************************************************************************/ #include "tupcolorvalue.h" -#include "tdebug.h" -#include "tdoublecombobox.h" - -#include -#include -#include -#include -#include -#include -#include - -#include struct TupItemColorValue::Private { @@ -125,7 +113,11 @@ TupColorValue::TupColorValue(QWidget *parent) : QFrame(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupColorValue()]"; + #else + TINIT; + #endif #endif k->ok = true; @@ -137,7 +129,11 @@ TupColorValue::~TupColorValue() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupColorValue()]"; + #else + TEND; + #endif #endif } diff -Nru tupi-0.2+git04/src/components/colorpalette/tupcolorvalue.h tupi-0.2+git05/src/components/colorpalette/tupcolorvalue.h --- tupi-0.2+git04/src/components/colorpalette/tupcolorvalue.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupcolorvalue.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,24 @@ #ifndef TUPVALUECOLOR_H #define TUPVALUECOLOR_H +#include "tglobal.h" +#include "tdoublecombobox.h" + #include +#include +#include +#include +#include +#include +#include +#include +#include /** * @author Jorge Cuadrado **/ -class TupItemColorValue : public QFrame +class TUPI_EXPORT TupItemColorValue : public QFrame { Q_OBJECT @@ -67,7 +78,7 @@ void editingFinished(); }; -class TupColorValue : public QFrame +class TUPI_EXPORT TupColorValue : public QFrame { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/colorpalette/tupluminancepicker.cpp tupi-0.2+git05/src/components/colorpalette/tupluminancepicker.cpp --- tupi-0.2+git04/src/components/colorpalette/tupluminancepicker.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupluminancepicker.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tupluminancepicker.h" -#include "tdebug.h" - -#include -#include struct TupLuminancePicker::Private { @@ -75,9 +71,14 @@ TupLuminancePicker::~TupLuminancePicker() { delete k; + #ifdef K_DEBUG - TEND; - #endif + #ifdef Q_OS_WIN32 + qDebug() << "[~TupLuminancePicker()]"; + #else + TEND; + #endif + #endif } void TupLuminancePicker::mouseMoveEvent(QMouseEvent *event) diff -Nru tupi-0.2+git04/src/components/colorpalette/tupluminancepicker.h tupi-0.2+git05/src/components/colorpalette/tupluminancepicker.h --- tupi-0.2+git04/src/components/colorpalette/tupluminancepicker.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupluminancepicker.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,12 +36,16 @@ #ifndef TUPLUMINACEPICKER_H #define TUPLUMINACEPICKER_H +#include "tglobal.h" + +#include +#include #include #include #include #include -class TupLuminancePicker : public QWidget +class TUPI_EXPORT TupLuminancePicker : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/colorpalette/tuppaletteparser.cpp tupi-0.2+git05/src/components/colorpalette/tuppaletteparser.cpp --- tupi-0.2+git04/src/components/colorpalette/tuppaletteparser.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tuppaletteparser.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tuppaletteparser.h" -#include "tdebug.h" struct TupPaletteParser::Private { @@ -54,17 +53,14 @@ TupPaletteParser::TupPaletteParser(): TXmlParserBase(), k(new Private) { - // TINIT; k->paletteName = ""; k->isEditable = false; k->gradient = 0; } - TupPaletteParser::~TupPaletteParser() { delete k; - // TEND; } bool TupPaletteParser::startTag(const QString &tag, const QXmlAttributes &atts) @@ -83,9 +79,14 @@ if (c.isValid()) { k->brushes << c; } else { - #ifdef K_DEBUG - tError() << "Invalid Color"; - #endif + #ifdef K_DEBUG + QString msg = "TupPaletteParser::startTag() - Error: Invalid color!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } else if (tag == "Gradient") { if (k->gradient) @@ -121,7 +122,12 @@ default: { #ifdef K_DEBUG - tFatal() << "No gradient type: " << type; + QString msg = "TupPaletteParser::startTag() - No gradient type: " + QString::number(type); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } break; diff -Nru tupi-0.2+git04/src/components/colorpalette/tuppaletteparser.h tupi-0.2+git05/src/components/colorpalette/tuppaletteparser.h --- tupi-0.2+git04/src/components/colorpalette/tuppaletteparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tuppaletteparser.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,6 +36,7 @@ #ifndef TUPPALETTEPARSER_H #define TUPPALETTEPARSER_H +#include "tglobal.h" #include "txmlparserbase.h" #include @@ -50,7 +51,7 @@ //TODO TupPaletteParser: portar a TXmlParserBase -class TupPaletteParser : public TXmlParserBase +class TUPI_EXPORT TupPaletteParser : public TXmlParserBase { public: TupPaletteParser(); diff -Nru tupi-0.2+git04/src/components/colorpalette/tupviewcolorcells.cpp tupi-0.2+git05/src/components/colorpalette/tupviewcolorcells.cpp --- tupi-0.2+git04/src/components/colorpalette/tupviewcolorcells.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupviewcolorcells.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,13 +34,6 @@ ***************************************************************************/ #include "tupviewcolorcells.h" -#include "tdebug.h" -#include "tglobal.h" -#include "timagebutton.h" -#include "tconfig.h" - -#include -#include struct TupViewColorCells::Private { @@ -70,7 +63,7 @@ TupViewColorCells::~TupViewColorCells() { TCONFIG->beginGroup("ColorPalette"); - TCONFIG->setValue("LastPalette", k->chooserPalette->currentIndex());; + TCONFIG->setValue("LastPalette", k->chooserPalette->currentIndex()); QDir brushesDir(CONFIG_DIR + "palettes"); @@ -78,21 +71,30 @@ brushesDir.mkdir(brushesDir.path()); #ifdef K_DEBUG - tWarning("palette") << "TupViewColorCells::~TupViewColorCells() - Saving color palettes in: " << brushesDir.path(); + QString msg = "TupViewColorCells::~TupViewColorCells() - Saving color palettes in: " + brushesDir.path(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("palette") << msg; + #endif #endif for (int i = 0; i < k->containerPalette->count(); i++) { TupCellsColor *palette = qobject_cast(k->containerPalette->widget(i)); if (palette) { if (!palette->isReadOnly()) - palette->save(CONFIG_DIR + "palettes/" + palette->name() + ".tpal"); + palette->save(CONFIG_DIR + "palettes" + QDir::separator() + palette->name() + ".tpal"); } } delete k; #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupViewColorCells()]"; + #else + TEND; + #endif #endif } @@ -107,52 +109,66 @@ // Default Palette k->defaultPalette = new TupCellsColor(k->containerPalette); k->defaultPalette->setName(tr("Default Palette")); - k->defaultPalette->setReadOnly( true); - - fillDefaultColors(); + k->defaultPalette->setReadOnly(true); + // fillDefaultColors(); addPalette(k->defaultPalette); //Named Colors k->qtColorPalette = new TupCellsColor(k->containerPalette); k->qtColorPalette->setReadOnly(true); k->qtColorPalette->setName(tr("Named Colors")); - addPalette(k->qtColorPalette); - fillNamedColor(); + addPalette(k->qtColorPalette); //Custom Color Palette + // SQA: This palette must be implemented k->customColorPalette = new TupCellsColor(k->containerPalette); k->customColorPalette->setName(tr("Custom Color Palette")); addPalette(k->customColorPalette); //Custom Gradient Palette + // SQA: This palette must be implemented k->customGradientPalette = new TupCellsColor(k->containerPalette); k->customGradientPalette->setName(tr("Custom Gradient Palette")); k->customGradientPalette->setType(TupCellsColor::Gradient); addPalette(k->customGradientPalette); - connect(k->chooserPalette, SIGNAL(activated(int )), k->containerPalette, SLOT(setCurrentIndex(int ))); +#ifdef Q_OS_WIN32 + QString palettesPath = SHARE_DIR + "palettes"; +#else + QString palettesPath = SHARE_DIR + "data" + QDir::separator() + "palettes"; +#endif + readPalettes(palettesPath); // Pre-installed + readPalettes(CONFIG_DIR + "palettes"); // Locals + + // fillDefaultColors(palettesPath); + + connect(k->chooserPalette, SIGNAL(activated(int)), k->containerPalette, SLOT(setCurrentIndex(int))); TCONFIG->beginGroup("ColorPalette"); int lastIndex = TCONFIG->value("LastPalette").toInt(); - if (lastIndex > 0) { - k->chooserPalette->setCurrentIndex(lastIndex); - k->containerPalette->setCurrentIndex(lastIndex); - } - - readPalettes(SHARE_DIR + "data/palettes"); // Pre-installed - readPalettes(CONFIG_DIR + "palettes"); // Locals + if (lastIndex < 0) + lastIndex = 0; + + k->chooserPalette->setCurrentIndex(lastIndex); + k->containerPalette->setCurrentIndex(lastIndex); } void TupViewColorCells::readPalettes(const QString &paletteDir) { #ifdef K_DEBUG - tDebug("palette") << "Reading palettes from: " << paletteDir; + QString msg = "TupViewColorCells::readPalettes() - Reading palettes from: " + paletteDir; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("palette") << msg; + #endif #endif + QDir dir(paletteDir); - if (dir.exists ()) { + if (dir.exists()) { QStringList files = dir.entryList(QStringList() << "*.tpal"); QStringList::ConstIterator it = files.begin(); @@ -160,7 +176,16 @@ readPaletteFile(dir.path() + "/" + *it); ++it; } - } + } else { + #ifdef K_DEBUG + QString msg = "TupViewColorCells::readPalettes() - Error: Invalid path -> " + paletteDir; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError("palette") << msg; + #endif + #endif + } } void TupViewColorCells::readPaletteFile(const QString &file) @@ -171,21 +196,33 @@ QList brushes = parser.brushes(); QString name = parser.paletteName(); bool editable = parser.paletteIsEditable(); - addPalette(name,brushes,editable ); + addPalette(name, brushes, editable); } else { #ifdef K_DEBUG - tError() << "Error while parse palette file: " << file; + QString msg = "TupViewColorCells::readPaletteFile() - Error while parse palette file: " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } -void TupViewColorCells::addPalette(const QString & name, const QList & brushes, bool editable ) +void TupViewColorCells::addPalette(const QString & name, const QList & brushes, bool editable) { - if (name == k->customColorPalette->name()) { + if (name == "Default Palette") { QList::ConstIterator it = brushes.begin(); while (it != brushes.end()) { - k->customColorPalette->addItem( *it); + k->defaultPalette->addItem(*it); + ++it; + } + } else if (name == k->customColorPalette->name()) { + QList::ConstIterator it = brushes.begin(); + + while (it != brushes.end()) { + k->customColorPalette->addItem(*it); ++it; } } else if (name == k->customGradientPalette->name()) { @@ -222,13 +259,18 @@ void TupViewColorCells::changeColor(QTableWidgetItem* item) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupViewColorCells::changeColor()]"; + #else + T_FUNCINFO; + #endif #endif if (item) emit selectColor(item->background()); } +/* void TupViewColorCells::fillDefaultColors() { int i; @@ -282,6 +324,7 @@ k->defaultPalette->addItem(QColor(255, (j - 13) * 51, (i - 6) * 51)); } } +*/ void TupViewColorCells::fillNamedColor() { diff -Nru tupi-0.2+git04/src/components/colorpalette/tupviewcolorcells.h tupi-0.2+git05/src/components/colorpalette/tupviewcolorcells.h --- tupi-0.2+git04/src/components/colorpalette/tupviewcolorcells.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/colorpalette/tupviewcolorcells.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,21 +36,26 @@ #ifndef TUPVIEWCOLORCELLS_H #define TUPVIEWCOLORCELLS_H +#include "tglobal.h" +#include "tconfig.h" +#include "timagebutton.h" +#include "tupcellscolor.h" +#include "tuppaletteparser.h" +#include "tapplicationproperties.h" + #include #include #include #include #include - -#include "tupcellscolor.h" -#include "tuppaletteparser.h" -#include "tapplicationproperties.h" +#include +#include /** @author Jorge Cuadrado **/ -class TupViewColorCells : public QFrame +class TUPI_EXPORT TupViewColorCells : public QFrame { Q_OBJECT @@ -67,13 +72,14 @@ private: void setupForm(); void setupButtons(); - void fillDefaultColors(); + // void fillDefaultColors(); void addDefaultColor(int i, int j, const QColor &); void fillNamedColor(); void readPalettes(const QString &paletteDir); void addPalette(TupCellsColor *palette); - protected: + // protected: + // QSize sizeHint() const; signals: void selectColor(const QBrush &); diff -Nru tupi-0.2+git04/src/components/components_config.pri tupi-0.2+git05/src/components/components_config.pri --- tupi-0.2+git04/src/components/components_config.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/components_config.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ - -STORE_DIR = ../../store -LIBTUPI_DIR = ../../libtupi -LIBBASE_DIR = ../../libbase - -include($$STORE_DIR/store.pri) -include($$LIBTUPI_DIR/libtupi.pri) -include($$LIBBASE_DIR/libbase.pri) - -include(../../../tupiglobal.pri) - -INCLUDEPATH += ../../shell - -QT += xml diff -Nru tupi-0.2+git04/src/components/components.pro tupi-0.2+git05/src/components/components.pro --- tupi-0.2+git04/src/components/components.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/components.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components -# Target is a subdirs project +# QT += xml opengl network SUBDIRS += scenes \ colorpalette \ @@ -11,16 +8,15 @@ export \ import \ help \ - kinas \ + # kinas \ pen \ paintarea \ twitter \ - animation \ - debug + animation + +unix { + SUBDIRS += debug +} CONFIG += ordered warn_on TEMPLATE = subdirs - -QT += xml opengl network - -#QT += qt3support xml opengl network diff -Nru tupi-0.2+git04/src/components/debug/debug.pri tupi-0.2+git05/src/components/debug/debug.pri --- tupi-0.2+git04/src/components/debug/debug.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/debug/debug.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$DEBUG_DIR -LIBS += -L$$DEBUG_DIR -ltupidebug + +unix { + LIBS += -L$$DEBUG_DIR -ltupidebug +} + +win32 { + LIBS += -L$$DEBUG_DIR/release/ -ltupidebug +} linux-g++ { PRE_TARGETDEPS += $$DEBUG_DIR/libtupidebug.so diff -Nru tupi-0.2+git04/src/components/debug/debug.pro tupi-0.2+git05/src/components/debug/debug.pro --- tupi-0.2+git04/src/components/debug/debug.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/debug/debug.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/debug -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -24,5 +21,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/debug/tupdebugterm.cpp tupi-0.2+git05/src/components/debug/tupdebugterm.cpp --- tupi-0.2+git04/src/components/debug/tupdebugterm.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/debug/tupdebugterm.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,26 +34,26 @@ ***************************************************************************/ #include "tupdebugterm.h" -#include "tdebug.h" -#include -#include -#include +#ifdef K_DEBUG TupDebugTerm::TupDebugTerm(QWidget *parent, int width) : QWidget(parent) { - #ifdef K_DEBUG - TINIT; - QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); - mainLayout->setSizeConstraint(QLayout::SetMaximumSize); - debugBrowser = TDebug::browser(this, width); - mainLayout->addWidget(debugBrowser); - #endif + TINIT; + QBoxLayout *mainLayout = new QBoxLayout(QBoxLayout::TopToBottom, this); + mainLayout->setSizeConstraint(QLayout::SetMaximumSize); + debugBrowser = TDebug::browser(this, width); + mainLayout->addWidget(debugBrowser); } TupDebugTerm::~TupDebugTerm() { - #ifdef K_DEBUG - TEND; - #endif + TEND; } + +void TupDebugTerm::setProjectStatus(bool status) +{ + TDebug::setProjectStatus(status); +} + +#endif diff -Nru tupi-0.2+git04/src/components/debug/tupdebugterm.h tupi-0.2+git05/src/components/debug/tupdebugterm.h --- tupi-0.2+git04/src/components/debug/tupdebugterm.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/debug/tupdebugterm.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,23 +36,32 @@ #ifndef TUPDEBUGTERM_H #define TUPDEBUGTERM_H +#ifdef K_DEBUG + +#include "tglobal.h" + #include #include +#include +#include +#include /** * @author Gustav Gonzalez */ -class TupDebugTerm : public QWidget +class TUPI_EXPORT TupDebugTerm : public QWidget { Q_OBJECT public: TupDebugTerm(QWidget *parent = 0, int width = 0); ~TupDebugTerm(); + void setProjectStatus(bool status); private: QTextEdit *debugBrowser; }; #endif +#endif diff -Nru tupi-0.2+git04/src/components/debug/tupdebugwidget.cpp tupi-0.2+git05/src/components/debug/tupdebugwidget.cpp --- tupi-0.2+git04/src/components/debug/tupdebugwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/debug/tupdebugwidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,16 +34,12 @@ ***************************************************************************/ #include "tupdebugwidget.h" -#include "tupdebugterm.h" -#include "tdebug.h" -#include +#ifdef K_DEBUG TupDebugWidget::TupDebugWidget(QWidget *parent, int width) : TupModuleWidgetBase(parent, "Debug Terminal") { - #ifdef K_DEBUG - TINIT; - #endif + TINIT; setWindowTitle(tr("Debug Console")); setWindowIcon(QIcon(THEME_DIR + "icons/debug.png")); @@ -53,13 +49,18 @@ setFixedHeight(120); - TupDebugTerm *term = new TupDebugTerm(this, width); + term = new TupDebugTerm(this, width); addChild(term); } TupDebugWidget::~TupDebugWidget() { - #ifdef K_DEBUG - TEND; - #endif + TEND; } + +void TupDebugWidget::setProjectStatus(bool status) +{ + term->setProjectStatus(status); +} + +#endif diff -Nru tupi-0.2+git04/src/components/debug/tupdebugwidget.h tupi-0.2+git05/src/components/debug/tupdebugwidget.h --- tupi-0.2+git04/src/components/debug/tupdebugwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/debug/tupdebugwidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,17 +36,30 @@ #ifndef TUPDEBUGWIDGET_H #define TUPDEBUGWIDGET_H -#include +#ifdef K_DEBUG + +#include "tglobal.h" +#include "tupmodulewidgetbase.h" +#include "tupdebugterm.h" + +#include /** * @author Gustav Gonzalez */ -class TupDebugWidget : public TupModuleWidgetBase + +class TUPI_EXPORT TupDebugWidget : public TupModuleWidgetBase { Q_OBJECT + public: TupDebugWidget(QWidget *parent = 0, int width = 0); ~TupDebugWidget(); + void setProjectStatus(bool status); + + private: + TupDebugTerm *term; }; #endif +#endif diff -Nru tupi-0.2+git04/src/components/export/export.pri tupi-0.2+git05/src/components/export/export.pri --- tupi-0.2+git04/src/components/export/export.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/export/export.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$EXPORT_DIR -LIBS += -L$$EXPORT_DIR -ltupiexport + +unix { + LIBS += -L$$EXPORT_DIR -ltupiexport +} + +win32 { + LIBS += -L$$EXPORT_DIR/release/ -ltupiexport +} linux-g++ { PRE_TARGETDEPS += $$EXPORT_DIR/libtupiexport.so diff -Nru tupi-0.2+git04/src/components/export/export.pro tupi-0.2+git05/src/components/export/export.pro --- tupi-0.2+git04/src/components/export/export.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/export/export.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/export -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -25,4 +22,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/export/tupexportwidget.cpp tupi-0.2+git05/src/components/export/tupexportwidget.cpp --- tupi-0.2+git04/src/components/export/tupexportwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/export/tupexportwidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,30 +34,6 @@ ***************************************************************************/ #include "tupexportwidget.h" -#include "tuppluginmanager.h" -#include "tglobal.h" -#include "tdebug.h" -#include "titemselector.h" -#include "txyspinbox.h" - -// Qt -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /** * This class handles the whole process to export a project into a movie format. @@ -65,7 +41,7 @@ * @author David Cuadrado */ -class SelectPlugin : public TupExportWizardPage +class TUPI_EXPORT SelectPlugin : public TupExportWizardPage { Q_OBJECT @@ -136,7 +112,17 @@ void SelectPlugin::addPlugin(const QString &plugin) { - new QListWidgetItem(plugin, m_exporterList); + qDebug() << "SelectPlugin::addPlugin() - plugin: " << plugin; + #ifdef Q_OS_WIN32 + if (QSysInfo::windowsVersion() != QSysInfo::WV_XP) { + new QListWidgetItem(plugin, m_exporterList); + } else { + if (plugin.compare(tr("Video Formats")) != 0) + new QListWidgetItem(plugin, m_exporterList); + } + #else + new QListWidgetItem(plugin, m_exporterList); + #endif } void SelectPlugin::selectedPluginItem(QListWidgetItem *item) @@ -167,10 +153,12 @@ format->setData(3124, TupExportInterface::WEBM); } +#ifdef Q_OS_UNIX if (formats & TupExportInterface::OGV) { QListWidgetItem *format = new QListWidgetItem(tr("OGV Video"), m_formatList); format->setData(3124, TupExportInterface::OGV); } +#endif if (formats & TupExportInterface::MPEG) { QListWidgetItem *format = new QListWidgetItem(tr("MPEG Video"), m_formatList); @@ -197,7 +185,7 @@ format->setData(3124, TupExportInterface::MOV); } - // SQA: The ffmpeg procedure to export animated GIF files must be implemented + // SQA: The libav procedure to export animated GIF files must be implemented /* if (formats & TupExportInterface::GIF) { QListWidgetItem *format = new QListWidgetItem(tr("Gif Image"), m_formatList); @@ -232,8 +220,10 @@ if (format.compare(tr("WEBM Video")) == 0) return ".webm"; +#ifdef Q_OS_UNIX if (format.compare(tr("OGV Video")) == 0) return ".ogv"; +#endif if (format.compare(tr("MPEG Video")) == 0) return ".mpg"; @@ -299,7 +289,7 @@ return extension; } -class SelectScenes : public TupExportWizardPage +class TUPI_EXPORT SelectScenes : public TupExportWizardPage { Q_OBJECT @@ -352,7 +342,11 @@ void SelectScenes::setScenes(const QList &scenes) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[SelectScenes::setScenes()]"; + #else + T_FUNCINFO; + #endif #endif m_selector->clear(); @@ -360,14 +354,25 @@ foreach (TupScene *scene, scenes) { #ifdef K_DEBUG - tDebug("export") << "SelectScenes::setScenes() - Adding " << scene->sceneName(); + QString msg = "SelectScenes::setScenes() - Adding " + scene->sceneName(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("export") << msg; + #endif #endif + m_selector->addItem(QString("%1: ").arg(pos) + scene->sceneName()); pos++; } #ifdef K_DEBUG - tWarning("export") << "SelectScenes::setScenes() - Available Scenes: " << pos - 1; + QString msg = "SelectScenes::setScenes() - Available Scenes: " + QString::number(pos - 1); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif m_selector->selectFirstItem(); @@ -388,12 +393,12 @@ // SQA: Pending code right over here } -class ExportTo : public TupExportWizardPage +class TUPI_EXPORT ExportTo : public TupExportWizardPage { Q_OBJECT public: - ExportTo(const TupProject *project, TupExportWidget::OutputFormat output, QString title, const TupExportWidget *widget); + ExportTo(TupProject *project, TupExportWidget::OutputFormat output, QString title, const TupExportWidget *widget); ~ExportTo(); bool isComplete() const; @@ -431,7 +436,8 @@ TupExportInterface::Format m_currentFormat; TupExportWidget::OutputFormat output; - const TupProject *m_project; + // const TupProject *m_project; + TupProject *m_project; QLineEdit *m_filePath; QLineEdit *m_prefix; QSpinBox *m_fps; @@ -443,9 +449,17 @@ bool transparency; }; -ExportTo::ExportTo(const TupProject *project, TupExportWidget::OutputFormat outputFormat, QString title, const TupExportWidget *widget) : TupExportWizardPage(title), m_currentExporter(0), +ExportTo::ExportTo(TupProject *project, TupExportWidget::OutputFormat outputFormat, QString title, const TupExportWidget *widget) : TupExportWizardPage(title), m_currentExporter(0), m_currentFormat(TupExportInterface::NONE), m_project(project) { + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[ExportTo::ExportTo()]"; + #else + TINIT; + #endif + #endif + output = outputFormat; transparency = false; @@ -461,7 +475,8 @@ QWidget *container = new QWidget; QVBoxLayout *layout = new QVBoxLayout(container); - path = getenv("HOME"); + // path = getenv("HOME"); + path = QDir::homePath(); //////////////// @@ -504,11 +519,10 @@ QToolButton *button = new QToolButton; button->setIcon(QIcon(THEME_DIR + "icons" + QDir::separator() + "open.png")); - if (output == TupExportWidget::ImagesArray) { + if (output == TupExportWidget::ImagesArray) connect(button, SIGNAL(clicked()), this, SLOT(chooseDirectory())); - } else { + else connect(button, SIGNAL(clicked()), this, SLOT(chooseFile())); - } filePathLayout->addWidget(button); @@ -600,16 +614,18 @@ extension = value; filename = path; -#if defined(Q_OS_UNIX) - if (m_currentFormat == TupExportInterface::APNG || (m_currentFormat != TupExportInterface::PNG && m_currentFormat != TupExportInterface::JPEG)) { // Animated Image or Animation if (!filename.endsWith(QDir::separator())) filename += QDir::separator(); filename += m_project->projectName(); filename += extension; + + qDebug() << "ExportTo::setCurrentFormat() - Tracing name: " << filename; + } else { // Images Array - filename = getenv("HOME"); + // filename = getenv("HOME"); + filename = QDir::homePath(); if (m_currentFormat == TupExportInterface::JPEG) { if (bgTransparency->isEnabled()) @@ -618,18 +634,21 @@ if (!bgTransparency->isEnabled()) bgTransparency->setEnabled(true); } + + qDebug() << "ExportTo::setCurrentFormat() - Tracing name: " << filename; } + #ifdef Q_OS_WIN32 + filename.replace(QString("/"), QString("\\")); + #endif + m_filePath->setText(filename); - -#endif } void ExportTo::updateNameField() { - if (filename.length() > 0) { + if (filename.length() > 0) m_filePath->setText(filename); - } } void ExportTo::enableTransparency(bool flag) @@ -654,7 +673,8 @@ void ExportTo::chooseDirectory() { - QString dir = getenv("HOME"); + // QString dir = getenv("HOME"); + QString dir = QDir::homePath(); filename = QFileDialog::getExistingDirectory(this, tr("Choose a directory..."), dir, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); @@ -675,7 +695,11 @@ void ExportTo::exportIt() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[ExportTo::exportIt()]"; + #else + T_FUNCINFO; + #endif #endif bool done = false; @@ -691,7 +715,8 @@ } if (path.length() == 0) - path = getenv("HOME"); + path = QDir::homePath(); + // path = getenv("HOME"); filename = path + QDir::separator() + name; } else { // Animation or Animated Image @@ -699,9 +724,15 @@ if (filename.length() == 0) { TOsd::self()->display(tr("Error"), tr("Directory doesn't exist! Please, choose another path."), TOsd::Error); + #ifdef K_DEBUG - QString file = path.toLocal8Bit(); - tError() << "ExportTo::exportIt() - Fatal Error: Directory doesn't exist! -> " << file; + QString file = path.toLocal8Bit(); + QString msg = "ExportTo::exportIt() - Fatal Error: Directory doesn't exist! -> " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -715,7 +746,8 @@ name += extension; if (path.length() == 0) { - path = getenv("HOME"); + //path = getenv("HOME"); + path = QDir::homePath(); filename = path + QDir::separator() + name; } @@ -734,8 +766,13 @@ if (!directory.exists()) { TOsd::self()->display(tr("Error"), tr("Directory doesn't exist! Please, choose another path."), TOsd::Error); #ifdef K_DEBUG - QString file = path.toLocal8Bit(); - tError() << "ExportTo::exportIt() - Fatal Error: Directory doesn't exist! -> " << file; + QString file = path.toLocal8Bit(); + QString msg = "ExportTo::exportIt() - Fatal Error: Directory doesn't exist! -> " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } else { @@ -752,19 +789,30 @@ if (m_currentExporter) { #ifdef K_DEBUG - tWarning() << "ExportTo::exportIt() - Exporting to file: " << filename; + QString file = path.toLocal8Bit(); + QString msg = "ExportTo::exportIt() - Exporting to file: " + file; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif QList scenes = scenesToExport(); #ifdef K_DEBUG - tWarning() << "ExportTo::exportIt() - Exporting " << scenes.count() << " scenes"; + QString msg1 = "ExportTo::exportIt() - Exporting " + QString::number(scenes.count()) + " scenes"; + #ifdef Q_OS_WIN32 + qWarning() << msg1; + #else + tWarning() << msg1; + #endif #endif if (scenes.count() > 0) { int width = (int) m_size->x(); int height = (int) m_size->y(); - /* ffmpeg requirement: resolution must be a multiple of two */ + /* libav requirement: resolution must be a multiple of two */ if (width%2 != 0) width++; if (height%2 != 0) @@ -779,7 +827,7 @@ } done = m_currentExporter->exportToFormat(color, filename, scenes, m_currentFormat, - QSize(width, height), m_fps->value()); + QSize(width, height), m_fps->value(), m_project->library()); } } else { TOsd::self()->display(tr("Error"), tr("Format problem. Tupi Internal error."), TOsd::Error); @@ -806,7 +854,7 @@ return scenes; } -class VideoProperties : public TupExportWizardPage +class TUPI_EXPORT VideoProperties : public TupExportWizardPage { Q_OBJECT @@ -983,10 +1031,14 @@ } */ -TupExportWidget::TupExportWidget(const TupProject *project, QWidget *parent, bool isLocal) : TupExportWizard(parent), m_project(project) +TupExportWidget::TupExportWidget(TupProject *project, QWidget *parent, bool isLocal) : TupExportWizard(parent), m_project(project) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExportWidget()]"; + #else + TINIT; + #endif #endif if (isLocal) { @@ -997,7 +1049,8 @@ addPage(m_pluginSelectionPage); m_scenesSelectionPage = new SelectScenes(this); - m_scenesSelectionPage->setScenes(project->scenes().values()); + // m_scenesSelectionPage->setScenes(project->scenes().values()); + m_scenesSelectionPage->setScenes(project->scenes()); addPage(m_scenesSelectionPage); m_exportAnimation = new ExportTo(project, TupExportWidget::Animation, tr("Export to Video File"), this); @@ -1026,7 +1079,8 @@ setWindowIcon(QIcon(THEME_DIR + "icons" + QDir::separator() + "net_document.png")); m_scenesSelectionPage = new SelectScenes(this); - m_scenesSelectionPage->setScenes(project->scenes().values()); + // m_scenesSelectionPage->setScenes(project->scenes().values()); + m_scenesSelectionPage->setScenes(project->scenes()); addPage(m_scenesSelectionPage); videoProperties = new VideoProperties(this); @@ -1039,7 +1093,11 @@ TupExportWidget::~TupExportWidget() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupExportWidget()]"; + #else + TEND; + #endif #endif } @@ -1063,7 +1121,12 @@ pluginList.insert(index, exporter); } else { #ifdef K_DEBUG - tError() << "TupExportWidget::loadPlugins() - [ Fatal Error ] - Can't load export plugin"; + QString msg = "TupExportWidget::loadPlugins() - [ Fatal Error ] - Can't load export plugin"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -1088,7 +1151,12 @@ m_exportImagesArray->setCurrentExporter(currentExporter); } else { #ifdef K_DEBUG - tError() << "TupExportWidget::setExporter() - [ Fatal Error ] - Can't load export plugin"; + QString msg = "TupExportWidget::setExporter() - [ Fatal Error ] - Can't load export plugin -> " + plugin; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } diff -Nru tupi-0.2+git04/src/components/export/tupexportwidget.h tupi-0.2+git05/src/components/export/tupexportwidget.h --- tupi-0.2+git04/src/components/export/tupexportwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/export/tupexportwidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,16 +36,39 @@ #ifndef TUPEXPORTWIDGET_H #define TUPEXPORTWIDGET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "tupproject.h" #include "tupexportpluginobject.h" #include "tupexportwizard.h" +#include "titemselector.h" +#include "txyspinbox.h" +#include "tuppluginmanager.h" #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class QButtonGroup; -class QLineEdit; +// class QButtonGroup; +// class QLineEdit; class SelectPlugin; class SelectScenes; class ExportTo; @@ -55,13 +78,13 @@ * @author David Cuadrado */ -class TupExportWidget : public TupExportWizard +class TUPI_EXPORT TupExportWidget : public TupExportWizard { Q_OBJECT public: enum OutputFormat { Animation = 0, ImagesArray, AnimatedImage }; - TupExportWidget(const TupProject *project, QWidget *parent = 0, bool isLocal = true); + TupExportWidget(TupProject *project, QWidget *parent = 0, bool isLocal = true); ~TupExportWidget(); QString videoTitle() const; QString videoTopics() const; diff -Nru tupi-0.2+git04/src/components/export/tupexportwizard.cpp tupi-0.2+git05/src/components/export/tupexportwizard.cpp --- tupi-0.2+git04/src/components/export/tupexportwizard.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/export/tupexportwizard.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tupexportwizard.h" -#include "tvhbox.h" -#include "tseparator.h" -#include "tdebug.h" - -// Qt -#include -#include -#include struct TupExportWizard::Private { @@ -265,9 +257,9 @@ hide(); } -void TupExportWizardPage::setPixmap(const QPixmap &px) +void TupExportWizardPage::setPixmap(const QPixmap &pixmap) { - k->image->setPixmap(px); + k->image->setPixmap(pixmap); k->image->show(); } @@ -286,4 +278,6 @@ return k->tag; } -TupExportWizardPage::~TupExportWizardPage() {}; +TupExportWizardPage::~TupExportWizardPage() +{ +} diff -Nru tupi-0.2+git04/src/components/export/tupexportwizard.h tupi-0.2+git05/src/components/export/tupexportwizard.h --- tupi-0.2+git04/src/components/export/tupexportwizard.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/export/tupexportwizard.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,15 +36,18 @@ #ifndef TUPEXPORTWIZARD_H #define TUPEXPORTWIZARD_H -#include "tvhbox.h" #include "tglobal.h" +#include "tvhbox.h" #include "toolview.h" +#include "tseparator.h" #include #include #include #include #include +#include +#include class TupExportWizardPage; @@ -52,7 +55,7 @@ * @author David Cuadrado */ -class TupExportWizard : public QDialog +class TUPI_EXPORT TupExportWizard : public QDialog { Q_OBJECT @@ -94,7 +97,7 @@ #include #include -class TupExportWizardPage : public TVHBox +class TUPI_EXPORT TupExportWizardPage : public TVHBox { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/exposure/exposure.pri tupi-0.2+git05/src/components/exposure/exposure.pri --- tupi-0.2+git04/src/components/exposure/exposure.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/exposure.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$EXPOSURE_DIR -LIBS += -L$$EXPOSURE_DIR -ltupiexposure + +unix { + LIBS += -L$$EXPOSURE_DIR -ltupiexposure +} + +win32 { + LIBS += -L$$EXPOSURE_DIR/release/ -ltupiexposure +} linux-g++ { PRE_TARGETDEPS += $$EXPOSURE_DIR/libtupiexposure.so diff -Nru tupi-0.2+git04/src/components/exposure/exposure.pro tupi-0.2+git05/src/components/exposure/exposure.pro --- tupi-0.2+git04/src/components/exposure/exposure.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/exposure.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/exposure -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -28,4 +25,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/exposure/tupexposureheader.cpp tupi-0.2+git05/src/components/exposure/tupexposureheader.cpp --- tupi-0.2+git04/src/components/exposure/tupexposureheader.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupexposureheader.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -35,46 +35,21 @@ #include "tupexposureheader.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tdebug.h" - -/* -struct LayerItem -{ - QString title; - int lastFrame; - bool isVisible; - bool isLocked; -}; -*/ - /** * @author Jorge Cuadrado */ -TupExposureHeader::TupExposureHeader(QWidget * parent) : QHeaderView(Qt::Horizontal, parent), m_sectionEdited(-1), - m_blockSectionMoved(false) +TupExposureHeader::TupExposureHeader(QWidget * parent) : QHeaderView(Qt::Horizontal, parent), m_editedSection(-1), m_sectionOnMotion(false) { - setClickable(true); - - //SQA: Disabled while layers movability is enhanced - //setMovable(true); + setSectionsClickable(true); + setSectionsMovable(true); - connect(this, SIGNAL(sectionDoubleClicked(int)), this, SLOT(showEditorName(int))); + connect(this, SIGNAL(sectionDoubleClicked(int)), this, SLOT(showTitleEditor(int))); m_editor = new QLineEdit(this); m_editor->setFocusPolicy(Qt::ClickFocus); m_editor->setInputMask(""); - connect(m_editor, SIGNAL(editingFinished()), this, SLOT(hideEditorName())); + connect(m_editor, SIGNAL(editingFinished()), this, SLOT(hideTitleEditor())); m_editor->hide(); } @@ -82,22 +57,22 @@ { } -void TupExposureHeader::emitVisibilityChanged(int section) +void TupExposureHeader::notifyVisibilityChange(int section) { - emit visibilityChanged(visualIndex(section), !m_layers[section].isVisible); + emit visibilityChanged(visualIndex(section), !m_sections[section].isVisible); } -void TupExposureHeader::setVisibilityChanged(int layerIndex, bool visibility) +void TupExposureHeader::setSectionVisibility(int section, bool visibility) { // Q_UNUSED(visibility); - // FIXME: in tupexpousertable.cpp visibility or !m_layers[logicalndex].isVisible - // m_layers[logicalndex].isVisible = !m_layers[logicalndex].isVisible; + // FIXME: in tupexpousertable.cpp visibility or !m_sections[logicalndex].isVisible + // m_sections[logicalndex].isVisible = !m_sections[logicalndex].isVisible; - m_layers[layerIndex].isVisible = visibility; - updateSection(layerIndex); + m_sections[section].isVisible = visibility; + updateSection(section); } -void TupExposureHeader::showEditorName(int section) +void TupExposureHeader::showTitleEditor(int section) { if (section >= 0) { QFont font("Arial", 8, QFont::Normal, false); @@ -105,70 +80,75 @@ int x = sectionViewportPosition(section); m_editor->setGeometry(x, 0, sectionSize(section), height()); - m_sectionEdited = section; - m_editor->setText(m_layers[section].title); + m_editedSection = section; + m_editor->setText(m_sections[section].title); m_editor->show(); m_editor->setFocus(); } } -void TupExposureHeader::hideEditorName() +void TupExposureHeader::hideTitleEditor() { m_editor->hide(); - if (m_sectionEdited != -1 && m_editor->isModified()) - emit changedName(m_sectionEdited, m_editor->text()); + if (m_editedSection != -1 && m_editor->isModified()) + emit nameChanged(m_editedSection, m_editor->text()); - m_sectionEdited = -1; + m_editedSection = -1; } -void TupExposureHeader::insertLayer(int layerIndex, const QString &text) +void TupExposureHeader::insertSection(int section, const QString &text) { - LayerItem layer; + ExposureLayerItem layer; layer.title = text; layer.lastFrame = 0; layer.isVisible = true; layer.isLocked = false; - m_layers.insert(layerIndex, layer); + m_sections.insert(section, layer); } -void TupExposureHeader::setLayerName(int layerIndex, const QString &text) +void TupExposureHeader::setSectionTitle(int section, const QString &text) { - m_layers[layerIndex].title = text; - updateSection(layerIndex); + m_sections[section].title = text; + updateSection(section); } -bool TupExposureHeader::signalMovedBlocked() +bool TupExposureHeader::sectionIsMoving() { - return m_blockSectionMoved; + return m_sectionOnMotion; } -void TupExposureHeader::setLockLayer(int logicalndex, bool lock) +void TupExposureHeader::setLockFlag(int logicalndex, bool lock) { - m_layers[logicalndex].isLocked = lock; + m_sections[logicalndex].isLocked = lock; updateSection(logicalndex); } -void TupExposureHeader::moveLayer(int position, int newPosition) +void TupExposureHeader::moveHeaderSection(int position, int newPosition, bool isLocalRequest) { - m_blockSectionMoved = true; - moveSection(position, newPosition); - m_blockSectionMoved = false; + if (isLocalRequest) { + m_sectionOnMotion = true; + moveSection(visualIndex(position), visualIndex(newPosition)); + m_sections.swap(position, newPosition); + m_sectionOnMotion = false; + } else { + m_sections.swap(position, newPosition); + } } -int TupExposureHeader::lastFrame(int layerIndex) +int TupExposureHeader::lastFrame(int section) { - return m_layers[layerIndex].lastFrame; + return m_sections[section].lastFrame; } -void TupExposureHeader::removeLayer(int layerIndex) +void TupExposureHeader::removeSection(int section) { - m_layers.remove(layerIndex); + m_sections.removeAt(section); } -void TupExposureHeader::setLastFrame(int layerIndex, int num) +void TupExposureHeader::setLastFrame(int section, int num) { - m_layers[layerIndex].lastFrame = num; + m_sections[section].lastFrame = num; } void TupExposureHeader::mousePressEvent(QMouseEvent * event) @@ -176,17 +156,24 @@ int section = logicalIndexAt(event->pos()); int x = sectionViewportPosition(section) + 3; - QRect rect(x+3, 3, height()-3, height()-3); + QFont font("Arial", 8, QFont::Normal, false); + QFontMetrics fm(font); + QString text = m_sections[section].title; + int w = fm.width(text); + int limit = sectionSize(section)/2 - w/2; + + QRect rect(x + limit - 12, 3, 12, height()-3); if (rect.contains(event->pos())) { - emitVisibilityChanged(section); + notifyVisibilityChange(section); } else { - if (currentCol != section) + if (m_currentSection != section) emit selectionChanged(section); + QHeaderView::mousePressEvent(event); } } -void TupExposureHeader::paintSection(QPainter * painter, const QRect & rect, int layerIndex) const +void TupExposureHeader::paintSection(QPainter *painter, const QRect & rect, int section) const { if (!rect.isValid()) return; @@ -207,31 +194,24 @@ style()->drawControl(QStyle::CE_HeaderSection, &headerOption, painter); - QString text = m_layers[layerIndex].title; + QString text = m_sections[section].title; QFont font("Arial", 8, QFont::Normal, false); QFontMetrics fm(font); + if (((section == m_currentSection) || (m_sections.size() == 1)) && m_sections[section].isVisible) { // Header selected + QColor color(0, 136, 0, 40); + painter->fillRect(rect.normalized().adjusted(0, 0, 0, -1), color); + } + QStyleOptionButton buttonOption; - if (m_layers[layerIndex].isVisible) { - buttonOption.palette.setBrush(QPalette::Button, Qt::green); + if (m_sections[section].isVisible) { + buttonOption.palette.setBrush(QPalette::Button, QColor(0, 136, 0, 255)); } else { buttonOption.palette.setBrush(QPalette::Button, Qt::red); buttonOption.state |= QStyle::State_Sunken; QColor color(255, 0, 0, 40); - painter->fillRect(rect.normalized().adjusted(0, 1, 0, -1), color); - } - - if ((layerIndex == currentCol) || (m_layers.size() == 1)) { - QColor color(250, 209, 132, 80); - painter->fillRect(rect.normalized().adjusted(0, 1, 0, -1), color); - if (m_layers[layerIndex].isVisible) { - painter->setPen(QPen(QColor(250, 209, 132, 255), 2, Qt::SolidLine)); // Header selected - painter->drawRect(rect.normalized().adjusted(0, 1, 0, -1)); - } else { - painter->setPen(QPen(QColor(255, 0, 0, 70), 2, Qt::SolidLine)); // Header locked - painter->drawRect(rect.normalized().adjusted(0, 1, 0, -1)); - } + painter->fillRect(rect.normalized().adjusted(0, 0, 0, -1), color); } int buttonWidth = 12; @@ -244,24 +224,24 @@ painter->drawText(x, y, text); buttonOption.rect = QRect(rect.x() + width - 4, rect.y() + ((rect.normalized().height()-buttonWidth)/2) + 1, buttonWidth, buttonWidth); - + style()->drawControl(QStyle::CE_PushButton, &buttonOption, painter); } -void TupExposureHeader::updateSelection(int col) +void TupExposureHeader::updateSelection(int section) { - currentCol = col; - updateSection(col); + m_currentSection = section; + updateSection(section); } -int TupExposureHeader::layersTotal() +int TupExposureHeader::sectionsTotal() { - return m_layers.size(); + return m_sections.size(); } -int TupExposureHeader::currentLayerIndex() +int TupExposureHeader::currentSectionIndex() { - return currentCol; + return m_currentSection; } //#include "tupexposuretable.moc" diff -Nru tupi-0.2+git04/src/components/exposure/tupexposureheader.h tupi-0.2+git05/src/components/exposure/tupexposureheader.h --- tupi-0.2+git04/src/components/exposure/tupexposureheader.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupexposureheader.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,19 @@ #ifndef TUPEXPOSUREHEADER_H #define TUPEXPOSUREHEADER_H +#include "tglobal.h" + #include #include #include -#include +#include +#include +#include #include #include +#include -struct LayerItem +struct ExposureLayerItem { QString title; int lastFrame; @@ -54,48 +59,50 @@ /** * @author Jorge Cuadrado */ -class TupExposureHeader: public QHeaderView + +class TUPI_EXPORT TupExposureHeader: public QHeaderView { Q_OBJECT public: TupExposureHeader(QWidget * parent = 0); ~TupExposureHeader(); - void paintSection(QPainter *painter, const QRect & rect, int layerIndex) const; - void insertLayer(int layerIndex, const QString &text); - void setLayerName(int layerIndex, const QString &text); - void setLastFrame(int layerIndex, int num); - int lastFrame(int layerIndex); - void removeLayer(int layerIndex); - void moveLayer(int index, int newIndex); - void setLockLayer(int logicalndex, bool lock); - bool signalMovedBlocked(); - void setVisibilityChanged(int logicalndex, bool visibility); - int layersTotal(); - int currentLayerIndex(); + void paintSection(QPainter *painter, const QRect & rect, int section) const; + void insertSection(int section, const QString &text); + void setSectionTitle(int section, const QString &text); + void removeSection(int section); + void moveHeaderSection(int index, int newIndex, bool isLocalRequest); + void setLockFlag(int section, bool lock); + bool sectionIsMoving(); + void setSectionVisibility(int section, bool visibility); + int sectionsTotal(); + int currentSectionIndex(); + + void setLastFrame(int section, int num); + int lastFrame(int section); + + protected: + virtual void mousePressEvent(QMouseEvent * event); public slots: - void updateSelection(int col); + void updateSelection(int section); private slots: - void emitVisibilityChanged(int section); - void showEditorName(int section); - void hideEditorName(); + void notifyVisibilityChange(int section); + void showTitleEditor(int section); + void hideTitleEditor(); - protected: - virtual void mousePressEvent(QMouseEvent * event); + signals: + void nameChanged(int section, const QString & name); + void visibilityChanged(int section, bool visibility); + void selectionChanged(int section); private: - QVector m_layers; + QList m_sections; QLineEdit *m_editor; - int m_sectionEdited; - int m_blockSectionMoved; - int currentCol; - - signals: - void changedName(int indexLayer, const QString & name); - void visibilityChanged(int indexLayer, bool visibility); - void selectionChanged(int indexLayer); + int m_editedSection; + bool m_sectionOnMotion; + int m_currentSection; }; #endif diff -Nru tupi-0.2+git04/src/components/exposure/tupexposuresheet.cpp tupi-0.2+git05/src/components/exposure/tupexposuresheet.cpp --- tupi-0.2+git04/src/components/exposure/tupexposuresheet.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupexposuresheet.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,21 +34,6 @@ ***************************************************************************/ #include "tupexposuresheet.h" -#include "tapplication.h" -#include "tdebug.h" -#include "tglobal.h" -#include "toptionaldialog.h" -#include "tupprojectrequest.h" -#include "tuprequestbuilder.h" -#include "tupscene.h" -#include "tuplayer.h" -#include "tupframe.h" - -#include -#include -#include -#include -#include struct TupExposureSheet::Private { @@ -58,16 +43,22 @@ QMenu *menu; QString nameCopyFrame; bool fromMenu; + bool localRequest; }; TupExposureSheet::TupExposureSheet(QWidget *parent) : TupModuleWidgetBase(parent, "Exposure Sheet"), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet()]"; + #else + TINIT; + #endif #endif k->currentTable = 0; k->fromMenu = false; + k->localRequest = false; setWindowTitle(tr("Exposure Sheet")); setWindowIcon(QPixmap(kAppProp->themeDir() + "icons/exposure_sheet.png")); @@ -76,8 +67,8 @@ TupProjectActionBar::Separator | TupProjectActionBar::InsertFrame | TupProjectActionBar::RemoveFrame | - TupProjectActionBar::MoveFrameUp | - TupProjectActionBar::MoveFrameDown | + TupProjectActionBar::MoveFrameBackward | + TupProjectActionBar::MoveFrameForward | TupProjectActionBar::LockFrame); connect(k->actionBar, SIGNAL(actionSelected(int)), this, SLOT(applyAction(int))); @@ -92,48 +83,47 @@ TupExposureSheet::~TupExposureSheet() { delete k; + #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupExposureSheet()]"; + #else + TEND; + #endif #endif } void TupExposureSheet::createMenu() { k->menu = new QMenu(tr("actions")); - //k->menu->addAction(tr("Insert layer"))->setData(TupProjectActionBar::InsertLayer); - //k->menu->addAction(tr("Remove layer"))->setData(TupProjectActionBar::RemoveLayer); QMenu *insertMenu = new QMenu(tr("Insert")); QAction *insertOne = new QAction(QIcon(THEME_DIR + "icons/add_frame.png"), tr("1 frame"), this); insertOne->setIconVisibleInMenu(true); insertMenu->addAction(insertOne); - connect(insertOne, SIGNAL(triggered()), this, SLOT(insertOneFrame())); QAction *insertFive = new QAction(QIcon(THEME_DIR + "icons/add_frame.png"), tr("5 frames"), this); insertFive->setIconVisibleInMenu(true); insertMenu->addAction(insertFive); - connect(insertFive, SIGNAL(triggered()), this, SLOT(insertFiveFrames())); QAction *insertTen = new QAction(QIcon(THEME_DIR + "icons/add_frame.png"), tr("10 frames"), this); insertTen->setIconVisibleInMenu(true); insertMenu->addAction(insertTen); - connect(insertTen, SIGNAL(triggered()), this, SLOT(insertTenFrames())); QAction *insertTwenty = new QAction(QIcon(THEME_DIR + "icons/add_frame.png"), tr("20 frames"), this); insertTwenty->setIconVisibleInMenu(true); insertMenu->addAction(insertTwenty); - connect(insertTwenty, SIGNAL(triggered()), this, SLOT(insertTwentyFrames())); QAction *insertFifty = new QAction(QIcon(THEME_DIR + "icons/add_frame.png"), tr("50 frames"), this); insertFifty->setIconVisibleInMenu(true); insertMenu->addAction(insertFifty); - connect(insertFifty, SIGNAL(triggered()), this, SLOT(insertFiftyFrames())); QAction *insertHundred = new QAction(QIcon(THEME_DIR + "icons/add_frame.png"), tr("100 frames"), this); insertHundred->setIconVisibleInMenu(true); insertMenu->addAction(insertHundred); - connect(insertHundred, SIGNAL(triggered()), this, SLOT(insertHundredFrames())); + + connect(insertMenu, SIGNAL(triggered(QAction *)), this, SLOT(insertFramesFromMenu(QAction*))); k->menu->addMenu(insertMenu); @@ -162,51 +152,60 @@ k->menu->addAction(pasteAction); connect(pasteAction, SIGNAL(triggered()), this, SLOT(emitRequestPasteInCurrentFrame())); - QMenu *expandMenu = new QMenu(tr("Expand")); - expandMenu->addAction(tr("1 frame"), this, SLOT(expandCurrentFrameOnce())); - expandMenu->addAction(tr("5 frames"), this, SLOT(expandCurrentFrameFive())); - expandMenu->addAction(tr("10 frames"), this, SLOT(expandCurrentFrameTen())); - expandMenu->setDisabled(true); - k->menu->addMenu(expandMenu); - //connect(expandMenu, SIGNAL(triggered(QAction *)), this, SLOT(actionTriggered(QAction*))); - QMenu *timeLineMenu = new QMenu(tr("Copy TL forward")); - timeLineMenu->addAction(QIcon(THEME_DIR + "icons/copy.png"), tr("1 time"), this, SLOT(copyTimeLineOnce())); - timeLineMenu->addAction(QIcon(THEME_DIR + "icons/copy.png"), tr("2 times"), this, SLOT(copyTimeLineTwoTimes())); - timeLineMenu->addAction(QIcon(THEME_DIR + "icons/copy.png"), tr("3 times"), this, SLOT(copyTimeLineThreeTimes())); - timeLineMenu->addAction(QIcon(THEME_DIR + "icons/copy.png"), tr("4 times"), this, SLOT(copyTimeLineFourTimes())); - timeLineMenu->addAction(QIcon(THEME_DIR + "icons/copy.png"), tr("5 times"), this, SLOT(copyTimeLineFiveTimes())); - k->menu->addMenu(timeLineMenu); + QAction *copyTLOnce = new QAction(QIcon(THEME_DIR + "icons/copy.png"), tr("1 time"), this); + copyTLOnce->setIconVisibleInMenu(true); + timeLineMenu->addAction(copyTLOnce); + + QAction *copyTLTwice = new QAction(QIcon(THEME_DIR + "icons/copy.png"), tr("2 times"), this); + copyTLTwice->setIconVisibleInMenu(true); + timeLineMenu->addAction(copyTLTwice); + + QAction *copyTLThird = new QAction(QIcon(THEME_DIR + "icons/copy.png"), tr("3 times"), this); + copyTLThird->setIconVisibleInMenu(true); + timeLineMenu->addAction(copyTLThird); + + QAction *copyTLFourth = new QAction(QIcon(THEME_DIR + "icons/copy.png"), tr("4 times"), this); + copyTLFourth->setIconVisibleInMenu(true); + timeLineMenu->addAction(copyTLFourth); + + QAction *copyTLFifth = new QAction(QIcon(THEME_DIR + "icons/copy.png"), tr("5 times"), this); + copyTLFifth->setIconVisibleInMenu(true); + timeLineMenu->addAction(copyTLFifth); + + connect(timeLineMenu, SIGNAL(triggered(QAction *)), this, SLOT(copyTimeLineFromMenu(QAction*))); + + k->menu->addMenu(timeLineMenu); connect(k->menu, SIGNAL(triggered(QAction *)), this, SLOT(actionTriggered(QAction*))); } void TupExposureSheet::addScene(int index, const QString &name) { #ifdef K_DEBUG - T_FUNCINFO << " index: " << index << " name: " << name; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::addScene()] - index: " << QString::number(index) << " name: " << name; + #else + T_FUNCINFO << " index: " << index << " name: " << name; + #endif #endif - TupExposureTable *newScene = new TupExposureTable; - newScene->setMenu(k->menu); + TupExposureTable *scene = new TupExposureTable; + scene->setMenu(k->menu); - connect(newScene, SIGNAL(requestSetUsedFrame(int, int)), - this, SLOT(insertFrame(int, int))); + connect(scene, SIGNAL(frameUsed(int, int)), this, SLOT(insertFrame(int, int))); - connect(newScene, SIGNAL(requestRenameFrame(int, int,const QString &)), - this, SLOT(renameFrame(int, int, const QString &))); + connect(scene, SIGNAL(frameRenamed(int, int, const QString &)), this, SLOT(renameFrame(int, int, const QString &))); - connect(newScene, SIGNAL(requestSelectFrame(int, int)), SLOT(selectFrame(int, int))); + connect(scene, SIGNAL(frameSelected(int, int)), SLOT(selectFrame(int, int))); - connect(newScene, SIGNAL(requestRenameLayer(int, const QString &)), - this, SLOT(renameLayer(int, const QString &))); + connect(scene, SIGNAL(layerNameChanged(int, const QString &)), this, SLOT(requestRenameLayer(int, const QString &))); - connect(newScene, SIGNAL(requestMoveLayer(int,int)), this, SLOT(moveLayer(int, int))); + connect(scene, SIGNAL(layerMoved(int, int)), this, SLOT(moveLayer(int, int))); - connect(newScene, SIGNAL(requestChangeVisibilityLayer(int , bool)), - this, SLOT(changeVisibilityLayer(int, bool))); + connect(scene, SIGNAL(layerVisibilityChanged(int, bool)), this, SLOT(changeVisibilityLayer(int, bool))); - k->scenesContainer->addScene(index, name, newScene); + k->scenesContainer->addScene(index, name, scene); } void TupExposureSheet::renameScene(int index, const QString &name) @@ -217,14 +216,23 @@ void TupExposureSheet::applyAction(int action) { #ifdef K_DEBUG - T_FUNCINFO << "TupExposureSheet::applyAction() - action: " << action; + #ifdef Q_OS_WIN32 + qDebug() << "TupExposureSheet::applyAction() - action: " << QString::number(action); + #else + T_FUNCINFO << "TupExposureSheet::applyAction() - action: " << action; + #endif #endif k->currentTable = k->scenesContainer->getCurrentTable(); if (k->currentTable == 0) { #ifdef K_DEBUG - tFatal() << "TupExposureSheet::applyAction: No layer view!!" << endl; + QString msg = "TupExposureSheet::applyAction: No layer view!!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif return; } @@ -261,10 +269,8 @@ case TupProjectActionBar::InsertFrame: { int usedFrames = k->currentTable->usedFrames(k->currentTable->currentColumn()); - //int target = k->currentTable->currentRow(); if (k->currentTable->currentRow() >= usedFrames) { - for (int layer=0; layer < k->currentTable->layersTotal(); layer++) { if (usedFrames >= k->currentTable->usedFrames(layer)) { int finish = k->currentTable->currentFrame() + 1; @@ -272,17 +278,16 @@ insertFrame(layer, frame); } } - // selectFrame(k->currentTable->currentLayer(), target); - } else { insertFrames(1); } - } break; case TupProjectActionBar::RemoveFrame: { + k->localRequest = true; + int scene = k->scenesContainer->currentIndex(); int layer = k->currentTable->currentLayer(); int lastFrame = k->currentTable->framesTotalAtCurrentLayer() - 1; @@ -291,12 +296,12 @@ if (k->currentTable->currentRow() > lastFrame) return; + // SQA: Check if this condition is really working if (k->currentTable->frameIsLocked(layer, target)) k->actionBar->emitActionSelected(TupProjectActionBar::LockFrame); if (k->currentTable->framesTotalAtCurrentLayer() == 1) { - TupProjectRequest request = TupRequestBuilder::createFrameRequest(scene, layer, target, - TupProjectRequest::Reset); + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scene, layer, target, TupProjectRequest::Reset); emit requestTriggered(&request); k->fromMenu = false; return; @@ -304,8 +309,7 @@ // SQA: Take care about the first frame case and paint a message on the workspace if (target == lastFrame) { - TupProjectRequest request = TupRequestBuilder::createFrameRequest(scene, layer, target, - TupProjectRequest::Remove); + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scene, layer, target, TupProjectRequest::Remove); emit requestTriggered(&request); if (target > 0) @@ -323,8 +327,7 @@ QString label = k->currentTable->frameName(layer, index); renameFrame(layer, index - 1, label); - TupProjectRequest request = TupRequestBuilder::createFrameRequest(scene, layer, index, - TupProjectRequest::Move, index - 1); + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scene, layer, index, TupProjectRequest::Move, index - 1); emit requestTriggered(&request); } @@ -338,7 +341,7 @@ } break; - case TupProjectActionBar::MoveFrameUp: + case TupProjectActionBar::MoveFrameBackward: { TupProjectRequest request = TupRequestBuilder::createFrameRequest(k->scenesContainer->currentIndex(), k->currentTable->currentLayer(), k->currentTable->currentFrame(), @@ -347,7 +350,7 @@ } break; - case TupProjectActionBar::MoveFrameDown: + case TupProjectActionBar::MoveFrameForward: { if (k->currentTable->currentFrame()+1 == k->currentTable->framesTotalAtCurrentLayer()) insertFrames(1); @@ -361,8 +364,7 @@ case TupProjectActionBar::LockFrame: { - bool locked = k->currentTable->frameIsLocked(k->currentTable->currentColumn(), - k->currentTable->currentFrame()); + bool locked = k->currentTable->frameIsLocked(k->currentTable->currentColumn(), k->currentTable->currentFrame()); TupProjectRequest request = TupRequestBuilder::createFrameRequest(k->scenesContainer->currentIndex(), k->currentTable->currentLayer(), k->currentTable->currentFrame(), @@ -376,19 +378,29 @@ void TupExposureSheet::setScene(int index) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::setScene()]"; + #else + T_FUNCINFO; + #endif #endif if (k->scenesContainer->count() >= index) { k->scenesContainer->blockSignals(true); k->scenesContainer->setCurrentIndex(index); k->currentTable = k->scenesContainer->getTable(index); - // k->currentTable = k->scenesContainer->getCurrentTable(); k->scenesContainer->blockSignals(false); } else { #ifdef K_DEBUG - tError() << "TupExposureSheet::setScene() - Invalid scene index -> " << index; - tError() << "TupExposureSheet::setScene() - Scenes total -> " << k->scenesContainer->count(); + QString msg1 = "TupExposureSheet::setScene() - Invalid scene index -> " + QString::number(index); + QString msg2 = "TupExposureSheet::setScene() - Scenes total -> " + QString::number(k->scenesContainer->count()); + #ifdef Q_OS_WIN32 + qDebug() << msg1; + qDebug() << msg2; + #else + tError() << msg1; + tError() << msg2; + #endif #endif } } @@ -414,9 +426,13 @@ { if (k->nameCopyFrame.isEmpty()) { #ifdef K_DEBUG - tError() << "TupExposureSheet::emitRequestPasteInCurrentFrame() - The copied frame name is empty!"; + QString msg = "TupExposureSheet::emitRequestPasteInCurrentFrame() - The copied frame name is empty!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif - return; } @@ -448,26 +464,14 @@ emit requestTriggered(&request); } -void TupExposureSheet::expandCurrentFrameOnce() -{ - emitRequestExpandCurrentFrame(1); -} - -void TupExposureSheet::expandCurrentFrameFive() -{ - emitRequestExpandCurrentFrame(5); -} - -void TupExposureSheet::expandCurrentFrameTen() -{ - emitRequestExpandCurrentFrame(10); -} - - void TupExposureSheet::insertFrame(int indexLayer, int indexFrame) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::insertFrame()]"; + #else + T_FUNCINFO; + #endif #endif TupProjectRequest request = TupRequestBuilder::createFrameRequest(k->scenesContainer->currentIndex(), @@ -485,34 +489,36 @@ void TupExposureSheet::selectFrame(int indexLayer, int indexFrame) { #ifdef K_DEBUG - T_FUNCINFO; - #endif + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::selectFrame()]"; + #else + T_FUNCINFO; + #endif + #endif TupProjectRequest request = TupRequestBuilder::createFrameRequest(k->scenesContainer->currentIndex(), indexLayer, - indexFrame, TupProjectRequest::Select, "1"); + indexFrame, TupProjectRequest::Select, "1"); emit localRequestTriggered(&request); - // emit requestTriggered(&request); } void TupExposureSheet::changeVisibilityLayer(int visualIndexLayer, bool visibility) { TupProjectRequest request = TupRequestBuilder::createLayerRequest(k->scenesContainer->currentIndex(), visualIndexLayer, - TupProjectRequest::View, visibility); + TupProjectRequest::View, visibility); emit localRequestTriggered(&request); - // emit requestTriggered(&event); } -void TupExposureSheet::renameLayer(int indexLayer, const QString & name) +void TupExposureSheet::requestRenameLayer(int indexLayer, const QString & name) { TupProjectRequest request = TupRequestBuilder::createLayerRequest(k->scenesContainer->currentIndex(), indexLayer, - TupProjectRequest::Rename, name); + TupProjectRequest::Rename, name); emit requestTriggered(&request); } void TupExposureSheet::moveLayer(int oldIndex, int newIndex) { TupProjectRequest request = TupRequestBuilder::createLayerRequest(k->scenesContainer->currentIndex(), oldIndex, - TupProjectRequest::Move, newIndex); + TupProjectRequest::Move, newIndex); emit requestTriggered(&request); } @@ -528,7 +534,11 @@ void TupExposureSheet::closeAllScenes() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::closeAllScenes()]"; + #else + T_FUNCINFO; + #endif #endif k->scenesContainer->blockSignals(true); @@ -543,7 +553,11 @@ void TupExposureSheet::sceneResponse(TupSceneResponse *e) { #ifdef K_DEBUG - T_FUNCINFOX("exposure"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::sceneResponse()]"; + #else + T_FUNCINFOX("exposure"); + #endif #endif switch(e->action()) { @@ -555,24 +569,6 @@ case TupProjectRequest::Remove: { k->scenesContainer->removeScene(e->sceneIndex()); - - /* - k->currentTable = k->scenesContainer->getCurrentTable(); - int layer = k->currentTable->currentLayer(); - int frame = k->currentTable->currentFrame() + 1; - - if (e->sceneIndex() == 0 && k->scenesContainer->count() == 1) { - TupProjectRequest request = TupRequestBuilder::createFrameRequest(0, layer, - frame, TupProjectRequest::Select, "1"); - emit requestTriggered(&request); - } else { - if (e->sceneIndex() > 0) { - TupProjectRequest request = TupRequestBuilder::createFrameRequest(e->sceneIndex() - 1, layer, - frame, TupProjectRequest::Select, "1"); - emit requestTriggered(&request); - } - } - */ } break; case TupProjectRequest::Reset: @@ -580,8 +576,7 @@ setScene(e->sceneIndex()); renameScene(e->sceneIndex(), e->arg().toString()); - TupProjectRequest request = TupRequestBuilder::createFrameRequest(e->sceneIndex(), 0, - 0, TupProjectRequest::Select, "1"); + TupProjectRequest request = TupRequestBuilder::createFrameRequest(e->sceneIndex(), 0, 0, TupProjectRequest::Select, "1"); emit requestTriggered(&request); k->currentTable->reset(); @@ -627,14 +622,6 @@ case TupProjectRequest::Remove: { table->removeLayer(e->layerIndex()); - - if (table->layersTotal() == 0) { - TupProjectRequest request = TupRequestBuilder::createLayerRequest(0, 0, TupProjectRequest::Add, tr("Layer %1").arg(1)); - emit requestTriggered(&request); - - request = TupRequestBuilder::createFrameRequest(0, 0, 0, TupProjectRequest::Add, tr("Frame %1").arg(1)); - emit requestTriggered(&request); - } } break; case TupProjectRequest::Move: @@ -661,18 +648,28 @@ } case TupProjectRequest::View: { - table->setVisibilityChanged(e->layerIndex(), e->arg().toBool()); + table->setLayerVisibility(e->layerIndex(), e->arg().toBool()); } break; default: #ifdef K_DEBUG - tFatal() << "TupExposureSheet::layerResponse - Layer option undefined! -> " << e->action(); + QString msg = "TupExposureSheet::layerResponse - Layer option undefined! -> " + QString::number(e->action()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif break; } } else { #ifdef K_DEBUG - tFatal() << "TupExposureSheet::layerResponse -> Scene index invalid: " << e->sceneIndex(); + QString msg = "TupExposureSheet::layerResponse -> Scene index invalid: " + QString::number(e->sceneIndex()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } @@ -680,7 +677,11 @@ void TupExposureSheet::frameResponse(TupFrameResponse *e) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::frameResponse()]"; + #else + T_FUNCINFO; + #endif #endif TupExposureTable *table = k->scenesContainer->getTable(e->sceneIndex()); @@ -699,7 +700,34 @@ break; case TupProjectRequest::Remove: { - table->removeFrame(e->layerIndex(), e->frameIndex(), k->fromMenu); + if (k->localRequest) { + k->localRequest = false; + table->removeFrame(e->layerIndex(), e->frameIndex(), k->fromMenu); + } else { + int layer = k->currentTable->currentLayer(); + int lastFrame = k->currentTable->framesTotalAtCurrentLayer() - 1; + int target = e->frameIndex(); + + if (target == lastFrame) { + table->removeFrame(e->layerIndex(), target, k->fromMenu); + if (target <= 0) + k->currentTable->clearSelection(); + } else { + // When the item deleted is not the last one + for (int index=target+1; index <= lastFrame; index++) { + TupExposureTable::FrameType type; + type = k->currentTable->frameState(layer, index); + k->currentTable->updateFrameState(layer, index - 1, type); + + QString label = k->currentTable->frameName(layer, index); + renameFrame(layer, index - 1, label); + } + + table->removeFrame(e->layerIndex(), lastFrame, k->fromMenu); + } + } + + k->fromMenu = false; } break; case TupProjectRequest::Reset: @@ -710,15 +738,7 @@ break; case TupProjectRequest::Exchange: { - if (e->arg().toInt() < table->framesTotalAtCurrentLayer()) { - table->exchangeFrame(e->layerIndex(), e->frameIndex(), e->layerIndex(), e->arg().toInt(), - e->external()); - } else { - // insertFrame(e->layerIndex(), e->arg().toInt()); - //insertFrames(1); - table->exchangeFrame(e->layerIndex(), e->frameIndex(), e->layerIndex(), e->arg().toInt(), - e->external()); - } + table->exchangeFrame(e->layerIndex(), e->frameIndex(), e->layerIndex(), e->arg().toInt(), e->external()); } break; case TupProjectRequest::Move: @@ -746,11 +766,7 @@ break; case TupProjectRequest::Expand: { - /* - tFatal() << "TupExposureSheet::frameResponse - Expand! -> Just Tracing!"; - tFatal() << "TupExposureSheet::frameResponse - Starting point: -> " << e->frameIndex(); - tFatal() << "TupExposureSheet::frameResponse - Range: -> " << e->arg().toInt(); - */ + // SQA: It's very possible this feature will be deprecated. Please confirm! for(int i = 0; i < e->arg().toInt(); i++) table->insertFrame(e->layerIndex(), e->frameIndex()+i+1, table->frameName(e->layerIndex(), e->frameIndex()), @@ -783,7 +799,12 @@ } } else { #ifdef K_DEBUG - tError() << "TupExposureSheet::frameResponse - [ Fatal Error ] - Scene index is invalid -> " << e->sceneIndex(); + QString msg = "TupExposureSheet::frameResponse() - [ Fatal Error ] - Scene index is invalid -> " + QString::number(e->sceneIndex()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -805,7 +826,7 @@ break; case TupProjectRequest::SetTween: { - // tError() << "TupExposureSheet::itemResponse() - Tracing!"; + // SQA: Check if this case has relevance for this context } break; default: @@ -835,40 +856,14 @@ } } -void TupExposureSheet::insertOneFrame() -{ - insertFrames(1); -} - -void TupExposureSheet::insertFiveFrames() -{ - insertFrames(5); -} - -void TupExposureSheet::insertTenFrames() -{ - insertFrames(10); -} - -void TupExposureSheet::insertTwentyFrames() -{ - insertFrames(20); -} - -void TupExposureSheet::insertFiftyFrames() -{ - insertFrames(50); -} - -void TupExposureSheet::insertHundredFrames() -{ - insertFrames(100); -} - void TupExposureSheet::insertFrames(int n) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::insertFrames()]"; + #else + T_FUNCINFO; + #endif #endif int scene = k->scenesContainer->currentIndex(); @@ -876,16 +871,31 @@ int target = k->currentTable->currentFrame() + 1; int lastFrame = k->currentTable->framesTotalAtCurrentLayer() - 1; - for (int i=0; icurrentTable->framesTotalAtCurrentLayer()); + if (target > lastFrame) { + for (int i=0; icurrentTable->framesTotalAtCurrentLayer()); + + selectFrame(layer, k->currentTable->currentFrame()); + } else { + int frame = k->currentTable->currentFrame() + 1; + + for (int i=0; icurrentTable->framesTotalAtCurrentLayer()); + + for (int index=lastFrame; index >= target; index--) { + TupProjectRequest event = TupRequestBuilder::createFrameRequest(scene, layer, index, TupProjectRequest::Exchange, index + n); + emit requestTriggered(&event); + } + + lastFrame = k->currentTable->framesTotalAtCurrentLayer() - 1; + for (int index=target; index <= lastFrame; index++) { + target++; + TupProjectRequest event = TupRequestBuilder::createFrameRequest(scene, layer, index, TupProjectRequest::Rename, tr("Frame %1").arg(target)); + emit requestTriggered(&event); + } - for (int index=lastFrame; index >= target; index--) { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scene, - layer, index, TupProjectRequest::Move, index + n); - emit requestTriggered(&event); + selectFrame(layer, frame); } - - selectFrame(layer, k->currentTable->currentFrame()); } void TupExposureSheet::removeOne() @@ -897,7 +907,11 @@ void TupExposureSheet::clearFrame() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureSheet::clearFrame()]"; + #else + T_FUNCINFO; + #endif #endif int scene = k->scenesContainer->currentIndex(); @@ -933,32 +947,6 @@ } } - -void TupExposureSheet::copyTimeLineOnce() -{ - copyTimeLine(1); -} - -void TupExposureSheet::copyTimeLineTwoTimes() -{ - copyTimeLine(2); -} - -void TupExposureSheet::copyTimeLineThreeTimes() -{ - copyTimeLine(3); -} - -void TupExposureSheet::copyTimeLineFourTimes() -{ - copyTimeLine(4); -} - -void TupExposureSheet::copyTimeLineFiveTimes() -{ - copyTimeLine(5); -} - void TupExposureSheet::copyTimeLine(int times) { int currentScene = k->scenesContainer->currentIndex(); @@ -990,3 +978,65 @@ emit requestTriggered(&request); } +void TupExposureSheet::insertFramesFromMenu(QAction *action) +{ + QString actionName = action->text(); + + if (actionName.compare(tr("1 frame")) == 0) { + insertFrames(1); + return; + } + + if (actionName.compare(tr("5 frames")) == 0) { + insertFrames(5); + return; + } + + if (actionName.compare(tr("10 frames")) == 0) { + insertFrames(10); + return; + } + + if (actionName.compare(tr("20 frames")) == 0) { + insertFrames(20); + return; + } + + if (actionName.compare(tr("50 frames")) == 0) { + insertFrames(50); + return; + } + + if (actionName.compare(tr("100 frames")) == 0) + insertFrames(100); +} + +void TupExposureSheet::copyTimeLineFromMenu(QAction *action) +{ + QString actionName = action->text(); + + if (actionName.compare(tr("1 time")) == 0) { + copyTimeLine(1); + return; + } + + if (actionName.compare(tr("2 times")) == 0) { + copyTimeLine(2); + return; + } + + if (actionName.compare(tr("3 times")) == 0) { + copyTimeLine(3); + return; + } + + if (actionName.compare(tr("4 times")) == 0) { + copyTimeLine(4); + return; + } + + if (actionName.compare(tr("5 times")) == 0) { + copyTimeLine(5); + return; + } +} diff -Nru tupi-0.2+git04/src/components/exposure/tupexposuresheet.h tupi-0.2+git05/src/components/exposure/tupexposuresheet.h --- tupi-0.2+git04/src/components/exposure/tupexposuresheet.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupexposuresheet.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,26 +36,38 @@ #ifndef TUPEXPOSURESHEET_H #define TUPEXPOSURESHEET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "tupexposuretable.h" #include "tupscenetabwidget.h" #include "timagebutton.h" #include "tupprojectactionbar.h" #include "tupproject.h" +#include "tapplication.h" +#include "toptionaldialog.h" +#include "tupprojectrequest.h" +#include "tuprequestbuilder.h" +#include "tupscene.h" +#include "tuplayer.h" +#include "tupframe.h" -// Qt #include #include #include #include #include #include +#include +#include +#include +#include +#include /** * @author Jorge Cuadrado */ -class TupExposureSheet : public TupModuleWidgetBase +class TUPI_EXPORT TupExposureSheet : public TupModuleWidgetBase { Q_OBJECT @@ -91,28 +103,18 @@ void emitRequestChangeScene(int index); void emitRequestCopyCurrentFrame(); void emitRequestPasteInCurrentFrame(); - void expandCurrentFrameOnce(); - void expandCurrentFrameFive(); - void expandCurrentFrameTen(); - void insertOneFrame(); - void insertFiveFrames(); - void insertTenFrames(); - void insertTwentyFrames(); - void insertFiftyFrames(); - void insertHundredFrames(); + + void insertFramesFromMenu(QAction *action); + void copyTimeLineFromMenu(QAction *action); + void removeOne(); void clearFrame(); void lockFrame(); - void copyTimeLineOnce(); - void copyTimeLineTwoTimes(); - void copyTimeLineThreeTimes(); - void copyTimeLineFourTimes(); - void copyTimeLineFiveTimes(); - + void insertFrame(int indexLayer, int indexFrame); - void renameFrame(int indexLayer, int indexFrame, const QString & name); + void renameFrame(int indexLayer, int indexFrame, const QString &name); void selectFrame(int indexLayer, int indexFrame); - void renameLayer(int indexLayer, const QString & name); + void requestRenameLayer(int indexLayer, const QString &name); void moveLayer(int oldIndex, int newIndex); void actionTriggered(QAction *action); }; diff -Nru tupi-0.2+git04/src/components/exposure/tupexposuretable.cpp tupi-0.2+git05/src/components/exposure/tupexposuretable.cpp --- tupi-0.2+git04/src/components/exposure/tupexposuretable.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupexposuretable.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,26 +34,14 @@ ***************************************************************************/ #include "tupexposuretable.h" -#include "tupexposureheader.h" -#include "tdebug.h" -#include "tupglobal.h" - -#include -#include -#include -#include -#include -#include /** * @author Jorge Cuadrado */ ///////////////// -class TupExposureVerticalHeader : public QHeaderView +class TUPI_EXPORT TupExposureVerticalHeader : public QHeaderView { - //Q_OBJECT - public: TupExposureVerticalHeader(QWidget * parent = 0); ~TupExposureVerticalHeader(); @@ -62,7 +50,6 @@ TupExposureVerticalHeader::TupExposureVerticalHeader(QWidget * parent) : QHeaderView(Qt::Vertical, parent) { - //setClickable(true); setFixedWidth(25); } @@ -127,14 +114,11 @@ void TupExposureItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex & index) const { QItemDelegate::paint(painter, option, index); - TupExposureTable *table = qobject_cast(index.model()->parent()); - QTableWidgetItem *item = table->itemFromIndex(index); if (item) { - - /* Useful code + /* SQA: Useful code if (item->data(TupExposureTable::IsLocked).toBool()) { QPixmap pixmap(THEME_DIR + "icons/padlock.png"); painter->drawPixmap(1, 5, pixmap); @@ -146,11 +130,6 @@ int w = option.rect.bottomRight().x() - x - 2; int h = option.rect.bottomRight().y() - y - 2; - if (item->data(TupExposureTable::IsLocked).toBool()) { - painter->setPen(QColor(255, 255, 255, 200)); - painter->drawRect(x, y, w, h); - } - if ((item->data(TupExposureTable::IsEmpty).toInt() == TupExposureTable::Empty) && !item->data(TupExposureTable::IsLocked).toBool()) { QPen pen(QColor(100, 100, 100, 30)); pen.setStyle(Qt::DashLine); @@ -179,10 +158,13 @@ QMenu *menu; bool removingLayer; bool removingFrame; + bool isLocalRequest; }; TupExposureTable::TupExposureTable(QWidget * parent) : QTableWidget(parent), k(new Private) { + k->isLocalRequest = false; + TupExposureVerticalHeader *verticalHeader = new TupExposureVerticalHeader(this); setVerticalHeader(verticalHeader); @@ -204,16 +186,15 @@ k->header = new TupExposureHeader(this); - connect(k->header, SIGNAL(visibilityChanged(int, bool)), this, SIGNAL(requestChangeVisibilityLayer(int, bool))); - connect(k->header, SIGNAL(changedName(int, const QString &)), this, SIGNAL(requestRenameLayer(int, - const QString & ))); - connect(k->header, SIGNAL(sectionMoved(int, int, int)), this, SLOT(emitRequestMoveLayer(int, int, int))); + connect(k->header, SIGNAL(visibilityChanged(int, bool)), this, SIGNAL(layerVisibilityChanged(int, bool))); + connect(k->header, SIGNAL(nameChanged(int, const QString &)), this, SIGNAL(layerNameChanged(int, const QString & ))); + connect(k->header, SIGNAL(sectionMoved(int, int, int)), this, SLOT(requestLayerMove(int, int, int))); connect(k->header, SIGNAL(selectionChanged(int)), this, SLOT(updateLayerSelection(int))); setHorizontalHeader(k->header); - connect(this, SIGNAL(cellClicked(int, int)), this, SLOT(emitRequestSetUsedFrame(int, int))); - connect(this, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(emitRequestSelectFrame(int, int, int, int))); + connect(this, SIGNAL(cellClicked(int, int)), this, SLOT(markUsedFrames(int, int))); + connect(this, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(requestFrameSelection(int, int, int, int))); setSelectionBehavior(QAbstractItemView::SelectItems); setSelectionMode(QAbstractItemView::SingleSelection); @@ -221,23 +202,23 @@ k->menu = 0; } -void TupExposureTable::emitRequestRenameFrame(QTableWidgetItem * item) +void TupExposureTable::requestFrameRenaming(QTableWidgetItem * item) { QModelIndex index = indexFromItem(item); - emit requestRenameFrame(index.column(), index.row(), item->text()); + emit frameRenamed(index.column(), index.row(), item->text()); } -void TupExposureTable::emitRequestSelectFrame(int currentSelectedRow, int currentColumn, int previousRow, int previousColumn) +void TupExposureTable::requestFrameSelection(int currentSelectedRow, int currentColumn, int previousRow, int previousColumn) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureTable::requestFrameSelection()]"; + #else + T_FUNCINFO; + #endif #endif - // tError() << "TupExposureTable::emitRequestSelectFrame() - Current frame: " << currentSelectedRow; - // tError() << "TupExposureTable::emitRequestSelectFrame() - Previous frame: " << previousRow; - if (!k->removingLayer) { - if (k->removingFrame) { k->removingFrame = false; @@ -245,17 +226,19 @@ k->header->updateSelection(currentColumn); if (previousRow != currentSelectedRow) - emit requestSelectFrame(currentLayer(), currentRow()); + emit frameSelected(currentLayer(), currentRow()); return; + } else { + QTableWidgetItem *frame = item(currentSelectedRow, currentColumn); + if (frame) { + if (previousColumn != currentColumn || previousRow != currentSelectedRow) + emit frameSelected(currentLayer(), currentRow()); + + if ((previousColumn != currentColumn) || (columnCount() == 1)) + k->header->updateSelection(currentColumn); + } } - - if (previousColumn != currentColumn || previousRow != currentSelectedRow) - emit requestSelectFrame(currentLayer(), currentRow()); - - if ((previousColumn != currentColumn) || (columnCount() == 1)) - k->header->updateSelection(currentColumn); - } else { // A layer is being removed k->removingLayer = false; selectFrame(currentColumn, currentSelectedRow); @@ -267,13 +250,23 @@ } } -void TupExposureTable::emitRequestMoveLayer(int logicalIndex, int oldVisualIndex, int newVisualIndex) +void TupExposureTable::requestLayerMove(int logicalIndex, int oldVisualIndex, int newVisualIndex) { Q_UNUSED(logicalIndex); - if (! k->header->signalMovedBlocked()) { - k->header->moveLayer(newVisualIndex, oldVisualIndex); - emit requestMoveLayer(oldVisualIndex, newVisualIndex); + if (!k->header->sectionIsMoving()) { + int distance = newVisualIndex - oldVisualIndex; + if (distance > 0) { + if (distance > 1) + newVisualIndex = oldVisualIndex + 1; + } else { + distance = abs(distance); + if (distance > 1) + newVisualIndex = oldVisualIndex - 1; + } + + k->isLocalRequest = true; + emit layerMoved(oldVisualIndex, newVisualIndex); } } @@ -298,7 +291,7 @@ void TupExposureTable::setFrameName(int layerIndex, int frameIndex, const QString &name) { - QTableWidgetItem *frame = item(frameIndex , layerIndex); + QTableWidgetItem *frame = item(frameIndex, layerIndex); frame->setFont(QFont("Arial", 7, QFont::Normal, false)); if (frame) { @@ -309,7 +302,7 @@ void TupExposureTable::setLayerName(int layerIndex, const QString & name) { - k->header->setLayerName(k->header->logicalIndex(layerIndex), name); + k->header->setSectionTitle(k->header->logicalIndex(layerIndex), name); } bool TupExposureTable::frameIsLocked(int layerIndex, int frameIndex) @@ -319,7 +312,12 @@ return frame->data(IsLocked).toBool(); } else { #ifdef K_DEBUG - tWarning() << "TupExposureTable::frameIsLocked() - Layer: " << layerIndex << ", Frame: " << frameIndex << " doesn't exist"; + QString msg = "TupExposureTable::frameIsLocked() - Layer: " + QString::number(layerIndex) + QString(", Frame: ") + QString::number(frameIndex) + QString(" doesn't exist"); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } return false; @@ -342,7 +340,12 @@ frame->setData(IsEmpty, value); } else { #ifdef K_DEBUG - tError() << "TupExposureTable::updateFrameState() - Error: No frame at [" << layerIndex << ", " << frameIndex << "]"; + QString msg = "TupExposureTable::updateFrameState() - Error: No frame at [" + QString::number(layerIndex) + ", " + QString::number(frameIndex) + "]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -350,12 +353,17 @@ void TupExposureTable::selectFrame(int layerIndex, int frameIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureTable::selectFrame()]"; + #else + T_FUNCINFO; + #endif #endif - if (k->header->currentLayerIndex() != layerIndex) + if (k->header->currentSectionIndex() != layerIndex) k->header->updateSelection(layerIndex); - setCurrentCell(frameIndex, k->header->logicalIndex(layerIndex)); + + setCurrentCell(frameIndex, layerIndex); } void TupExposureTable::setMenu(QMenu *menu) @@ -371,7 +379,11 @@ int TupExposureTable::currentFrame() const { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureTable::currentFrame()]"; + #else + T_FUNCINFO; + #endif #endif QTableWidgetItem *frame = currentItem(); @@ -388,7 +400,7 @@ { insertColumn(index); setColumnWidth(index, 70); - k->header->insertLayer(index, name); + k->header->insertSection(index, name); } void TupExposureTable::insertFrame(int layerIndex, int frameIndex, const QString & name, bool external) @@ -425,9 +437,9 @@ if (frame) { if (frame->data(TupExposureTable::IsEmpty).toInt() != Unset) { if (locked) - frame->setBackgroundColor(QColor(250, 71, 53)); + frame->setBackgroundColor(QColor(255, 0, 0, 90)); else - frame->setBackgroundColor(QColor(0xe6e6e6)); + frame->setBackgroundColor(QColor(255, 255, 255)); frame->setData(IsLocked, locked); } @@ -436,12 +448,12 @@ void TupExposureTable::setLockLayer(int layerIndex, bool locked) { - k->header->setLockLayer(layerIndex, locked); + k->header->setLockFlag(layerIndex, locked); } -void TupExposureTable::setVisibilityChanged(int visualIndex, bool visibility) +void TupExposureTable::setLayerVisibility(int visualIndex, bool visibility) { - k->header->setVisibilityChanged(k->header->logicalIndex(visualIndex), visibility); + k->header->setSectionVisibility(k->header->logicalIndex(visualIndex), visibility); } void TupExposureTable::removeLayer(int layerIndex) @@ -449,7 +461,7 @@ setUpdatesEnabled(false); k->removingLayer = true; - k->header->removeLayer(layerIndex); + k->header->removeSection(layerIndex); removeColumn(layerIndex); setUpdatesEnabled(true); @@ -457,34 +469,28 @@ void TupExposureTable::removeFrame(int layerIndex, int frameIndex, bool fromMenu) { - blockSignals(true); - k->removingFrame = fromMenu; QTableWidgetItem *item = takeItem(frameIndex, layerIndex); if (item) { - /* - for (int index = frameIndex + 1; index < k->header->lastFrame(layerIndex); index++) { - QTableWidgetItem *idx = takeItem(index, layerIndex); - if (idx) - setItem(index - 1, layerIndex, idx); - } - */ k->header->setLastFrame(layerIndex, k->header->lastFrame(layerIndex)-1); } else { #ifdef K_DEBUG - tError() << "TupExposureTable::removeFrame() - No item available at [" << layerIndex << ", " << frameIndex << "]"; + QString msg = "TupExposureTable::removeFrame() - No item available at [" + QString::number(layerIndex) + ", " + QString::number(frameIndex) + "]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } - - //setUpdatesEnabled(true); } void TupExposureTable::exchangeFrame(int oldPosLayer, int oldPosFrame, int newPosLayer, int newPosFrame, bool external) { - QTableWidgetItem * oldItem = takeItem(oldPosFrame, oldPosLayer); - QTableWidgetItem * newItem = takeItem(newPosFrame, newPosLayer); + QTableWidgetItem *oldItem = takeItem(oldPosFrame, oldPosLayer); + QTableWidgetItem *newItem = takeItem(newPosFrame, newPosLayer); setItem(newPosFrame, newPosLayer, oldItem); setItem(oldPosFrame, oldPosLayer, newItem); @@ -495,13 +501,26 @@ void TupExposureTable::moveLayer(int oldPosLayer, int newPosLayer) { - k->header->moveLayer(oldPosLayer, newPosLayer); + k->header->moveHeaderSection(oldPosLayer, newPosLayer, k->isLocalRequest); + if (k->isLocalRequest) + k->isLocalRequest = false; + + for (int frameIndex = 0; frameIndex < k->header->lastFrame(oldPosLayer); frameIndex++) + exchangeFrame(oldPosLayer, frameIndex, newPosLayer, frameIndex, true); + + blockSignals(true); + selectFrame(newPosLayer, currentRow()); + blockSignals(false); } -void TupExposureTable::emitRequestSetUsedFrame(int frameIndex, int layerIndex) +void TupExposureTable::markUsedFrames(int frameIndex, int layerIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureTable::markUsedFrames()]"; + #else + T_FUNCINFO; + #endif #endif int layer = k->header->visualIndex(layerIndex); @@ -512,11 +531,11 @@ int used = usedFrames(column); if (lastFrame >= used) { for (int frame=used; frame <= frameIndex; frame++) - emit requestSetUsedFrame(column, frame); + emit frameUsed(column, frame); } } - emit requestSelectFrame(layer, frameIndex); + emit frameSelected(layer, frameIndex); } } @@ -562,12 +581,12 @@ QTableWidget::commitData(0); // Don't rename if (lineEdit) - emit requestRenameFrame(currentLayer(), currentFrame(), lineEdit->text()); + emit frameRenamed(currentLayer(), currentFrame(), lineEdit->text()); } int TupExposureTable::layersTotal() { - return k->header->layersTotal(); + return k->header->sectionsTotal(); } int TupExposureTable::framesTotal() @@ -588,7 +607,12 @@ setCurrentCell(row, currentColumn()); } else { #ifdef K_DEBUG - tWarning() << "TupExposureTable::keyPressEvent() - Warning: wrong frame index [ " << row << " ]"; + QString msg = "TupExposureTable::keyPressEvent() - Warning: wrong frame index [ " + QString::number(row) + " ]"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } @@ -596,15 +620,12 @@ } if (event->key() == Qt::Key_Down) { - int limit = rowCount()-1; + int framesTotal = k->header->lastFrame(currentLayer()); int next = currentRow()+1; - if (next <= limit) { + if (next >= framesTotal) + markUsedFrames(next, currentColumn()); + else setCurrentCell(next, currentColumn()); - } else { - #ifdef K_DEBUG - tWarning() << "TupExposureTable::keyPressEvent() - Warning: wrong frame index [ " << next << " ]"; - #endif - } return; } @@ -623,14 +644,10 @@ setCurrentCell(currentRow(), column); return; } - - if (event->key() == Qt::Key_Return) { - emitRequestSetUsedFrame(currentRow(), currentColumn()); - return; - } } -void TupExposureTable::emitCellClicked(int frame, int layer) +// SQA : Verify if this method is required +void TupExposureTable::notifyCellClicked(int frame, int layer) { emit cellClicked(frame, layer); } @@ -660,10 +677,8 @@ } int rows = rowCount(); - for (int i=1; i < rows; i++) { + for (int i=1; i < rows; i++) takeItem(i, 0); - // QTableWidgetItem *item = takeItem(i, 0); - } k->header->setLastFrame(0, 1); } diff -Nru tupi-0.2+git04/src/components/exposure/tupexposuretable.h tupi-0.2+git05/src/components/exposure/tupexposuretable.h --- tupi-0.2+git04/src/components/exposure/tupexposuretable.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupexposuretable.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,16 +36,29 @@ #ifndef TUPEXPOSURETABLE_H #define TUPEXPOSURETABLE_H +#include "tglobal.h" +#include "tupexposureheader.h" + #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include class TupExposureVerticalHeader; -class QMenu; +// class QMenu; /** * @author Jorge Cuadrado */ -class TupExposureTable : public QTableWidget +class TUPI_EXPORT TupExposureTable : public QTableWidget { Q_OBJECT @@ -67,13 +80,13 @@ UsedWithTween }; - TupExposureTable(QWidget * parent = 0); + TupExposureTable(QWidget *parent = 0); ~TupExposureTable(); int currentLayer() const; int currentFrame() const; - void insertLayer(int index, const QString & name); - void insertFrame(int layerIndex, int frameIndex, const QString & name, bool external); + void insertLayer(int index, const QString &name); + void insertFrame(int layerIndex, int frameIndex, const QString &name, bool external); void removeLayer(int layerIndex); void removeFrame(int layerIndex, int frameIndex, bool fromMenu); void exchangeFrame(int oldPosLayer, int oldPosFrame, int newPosLayer, int newPosFrame, bool external); @@ -81,7 +94,7 @@ void setLockFrame(int layerIndex, int frameIndex, bool locked); void setLockLayer(int layerIndex, bool locked); - void setVisibilityChanged(int visualIndex, bool visibility); + void setLayerVisibility(int visualIndex, bool visibility); int usedFrames(int column) const; QString frameName(int layerIndex, int frameIndex); @@ -95,41 +108,41 @@ int framesTotalAtCurrentLayer(); void setMenu(QMenu *menu); - void emitCellClicked(int frame, int layer); + void notifyCellClicked(int frame, int layer); void reset(); TupExposureTable::FrameType frameState(int layerIndex, int frameIndex); void updateFrameState(int layerIndex, int frameIndex, TupExposureTable::FrameType value); - private: - struct Private; - Private *const k; - private slots: - void emitRequestSetUsedFrame(int frameIndex, int layerIndex); - void emitRequestRenameFrame(QTableWidgetItem * item); - void emitRequestSelectFrame(int currentRow, int currentColumn, int previousRow, int previousColumn); - void emitRequestMoveLayer(int logicalIndex, int oldVisualIndex, int newVisualIndex); + void markUsedFrames(int frameIndex, int layerIndex); + void requestFrameRenaming(QTableWidgetItem *item); + void requestFrameSelection(int currentRow, int currentColumn, int previousRow, int previousColumn); + void requestLayerMove(int logicalIndex, int oldVisualIndex, int newVisualIndex); void updateLayerSelection(int layerIndex); protected: - bool edit(const QModelIndex & index, EditTrigger trigger, QEvent * event); - void mousePressEvent(QMouseEvent * event); - void keyPressEvent(QKeyEvent * event); + bool edit(const QModelIndex & index, EditTrigger trigger, QEvent *event); + void mousePressEvent(QMouseEvent *event); + void keyPressEvent(QKeyEvent *event); void enterEvent(QEvent *event); void leaveEvent(QEvent *event); protected slots: - void commitData(QWidget * editor); + void commitData(QWidget *editor); signals: - void requestSetUsedFrame(int layerIndex, int frameIndex); - void requestRenameFrame(int layerIndex, int frameIndex,const QString & name); - void requestSelectFrame(int layerIndex, int frameIndex); - - void requestRenameLayer(int layerIndex, const QString & name); - void requestMoveLayer(int oldIndex, int newIndex); - void requestChangeVisibilityLayer(int visualIndexLayer, bool visibility); + void frameUsed(int layerIndex, int frameIndex); + void frameRenamed(int layerIndex, int frameIndex,const QString & name); + void frameSelected(int layerIndex, int frameIndex); + + void layerNameChanged(int layerIndex, const QString & name); + void layerMoved(int oldIndex, int newIndex); + void layerVisibilityChanged(int visualIndexLayer, bool visibility); + + private: + struct Private; + Private *const k; }; #endif diff -Nru tupi-0.2+git04/src/components/exposure/tupscenetabwidget.cpp tupi-0.2+git05/src/components/exposure/tupscenetabwidget.cpp --- tupi-0.2+git04/src/components/exposure/tupscenetabwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupscenetabwidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,13 +34,6 @@ ***************************************************************************/ #include "tupscenetabwidget.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include struct TupSceneTabWidget::Private { @@ -128,7 +121,12 @@ return table; } else { #ifdef K_DEBUG - tError() << "TupSceneTabWidget::getTable() - [ Fatal Error ] - Invalid table index: " << index; + QString msg = "TupSceneTabWidget::getTable() - [ Fatal Error ] - Invalid table index: " + QString::number(index); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } diff -Nru tupi-0.2+git04/src/components/exposure/tupscenetabwidget.h tupi-0.2+git05/src/components/exposure/tupscenetabwidget.h --- tupi-0.2+git04/src/components/exposure/tupscenetabwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/exposure/tupscenetabwidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -44,6 +44,9 @@ #include #include #include +#include +#include +#include /** * @author Gustav Gonzalez diff -Nru tupi-0.2+git04/src/components/help/help/css/tupi.css tupi-0.2+git05/src/components/help/help/css/tupi.css --- tupi-0.2+git04/src/components/help/help/css/tupi.css 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help/css/tupi.css 2014-12-15 14:21:32.000000000 +0000 @@ -138,25 +138,25 @@ a:link { text-decoration:underline; - color:#000000; + color:#004000; font-weight:bold; } a:visited { text-decoration:underline; - color:#000000; + color:#004000; font-weight:bold; } a:active { text-decoration:underline; - color:#000000; + color:#004000; font-weight:bold; } a:hover { text-decoration:underline; - color:#000000; + color:#004000; font-weight:bold; } @@ -170,59 +170,37 @@ font-weight:bold; } -.status_table { - background-color:#ffffff; - color:#000000; - margin-left:10px; - margin-right:10px; - margin-top:10px; - margin-bottom:10px; -} - -.twitter_status { - background-color:#ffffff; - color:#000000; +.shortcut_table { + padding:10px; + border:2px solid #000000; } -.desc_table { - margin-left:10px; - margin-right:10px; - margin-top:10px; - - background-color:#ddeef6; - - color:#000000; - text-align:left; +.shortcut_subtitle { + padding:3px; + text-align:center; text-decoration:none; - font-family:"Times New Roman", Times, serif; + font-family:"Arial", Times, serif; font-style:normal; - font-size:13px; - font-weight:normal; -} - -.twitter_desc { - background-color:#ddeef6; -} - -.twitter_base { - margin-top:10px; - margin-bottom:10px; - margin-left:100px; - margin-right:100px; + font-size:12px; + font-weight:bold; } -.date { - margin-left:10px; - color:#000000; - text-align:left; +.shortcut_record { + padding:3px; + text-align:center; text-decoration:none; - font-family:"Times New Roman", Times, serif; + font-family:"Arial", Times, serif; font-style:normal; - font-size:11px; + font-size:10px; font-weight:normal; } +.twitter_white { + background-color:#fff; +} + .twitter_headline { + background-image:url('file:bg1.png'); color:#000000; text-align:left; text-decoration:none; @@ -236,77 +214,64 @@ vertical-align:middle; } -.twitter_header { - border-style:solid; - border-width:5px; - border-color:#ff0000; -} - -.twitter_slang { - margin-left:5px; - margin-right:5px; - margin-top:5px; - margin-bottom:5px; - background-color:#edfeff; -} - -.twitter_slang_td { - margin-left:5px; - margin-right:5px; - margin-top:5px; - margin-bottom:5px; +.twitter_tupi_version { + background-color:#eee; color:#000000; - text-align:justify; + text-align:center; text-decoration:none; font-family:"Arial", Times, serif; font-style:normal; - font-size:10px; + font-size:12px; font-weight:normal; } -.tupi_version { - background-color:#f3f3f3; +.twitter_tupi_update { + background-color:#eee; color:#000000; text-align:center; text-decoration:none; font-family:"Arial", Times, serif; font-style:normal; - font-size:11px; + font-size:12px; font-weight:normal; } -.tupi_update { - background-color:#ff5d5d; +.twitter_tupi_donation { + background-color:#ddd; color:#000000; text-align:center; text-decoration:none; font-family:"Arial", Times, serif; font-style:normal; - font-size:11px; + font-size:12px; font-weight:normal; } -.shortcut_table { - padding:10px; - border:2px solid #000000; -} - -.shortcut_subtitle { - padding:3px; - text-align:center; +.twitter_tweet { + /* background-color:#fff; */ + color:#000000; + text-align:justify; text-decoration:none; font-family:"Arial", Times, serif; font-style:normal; font-size:12px; - font-weight:bold; + font-weight:normal; } -.shortcut_record { - padding:3px; +.twitter_separator { + height:2px; + font-size:5px; +} + +.twitter_links { + color:#000000; text-align:center; text-decoration:none; font-family:"Arial", Times, serif; font-style:normal; - font-size:10px; + font-size:12px; font-weight:normal; + font-weight:bold; } + + diff -Nru tupi-0.2+git04/src/components/help/help/en/shortcuts.html tupi-0.2+git05/src/components/help/help/en/shortcuts.html --- tupi-0.2+git04/src/components/help/help/en/shortcuts.html 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help/en/shortcuts.html 2014-12-15 14:21:32.000000000 +0000 @@ -194,7 +194,7 @@ Object selection - 1 + I Internal colour fill Binary files /tmp/_5KeXDu2Bl/tupi-0.2+git04/src/components/help/help/examples/example.tup and /tmp/x_3ooyo8DI/tupi-0.2+git05/src/components/help/help/examples/example.tup differ diff -Nru tupi-0.2+git04/src/components/help/help/gl/shortcuts.html tupi-0.2+git05/src/components/help/help/gl/shortcuts.html --- tupi-0.2+git04/src/components/help/help/gl/shortcuts.html 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help/gl/shortcuts.html 2014-12-15 14:21:32.000000000 +0000 @@ -200,7 +200,7 @@ Selección de obxecto - 1 + I Cor do recheo interno Binary files /tmp/_5KeXDu2Bl/tupi-0.2+git04/src/components/help/help/images/facebook.png and /tmp/x_3ooyo8DI/tupi-0.2+git05/src/components/help/help/images/facebook.png differ Binary files /tmp/_5KeXDu2Bl/tupi-0.2+git04/src/components/help/help/images/maefloresta.png and /tmp/x_3ooyo8DI/tupi-0.2+git05/src/components/help/help/images/maefloresta.png differ Binary files /tmp/_5KeXDu2Bl/tupi-0.2+git04/src/components/help/help/images/twitter01.png and /tmp/x_3ooyo8DI/tupi-0.2+git05/src/components/help/help/images/twitter01.png differ Binary files /tmp/_5KeXDu2Bl/tupi-0.2+git04/src/components/help/help/images/twitter.png and /tmp/x_3ooyo8DI/tupi-0.2+git05/src/components/help/help/images/twitter.png differ Binary files /tmp/_5KeXDu2Bl/tupi-0.2+git04/src/components/help/help/images/youtube.png and /tmp/x_3ooyo8DI/tupi-0.2+git05/src/components/help/help/images/youtube.png differ diff -Nru tupi-0.2+git04/src/components/help/help/README/HowToTranslate tupi-0.2+git05/src/components/help/help/README/HowToTranslate --- tupi-0.2+git04/src/components/help/help/README/HowToTranslate 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help/README/HowToTranslate 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -Translate it with your favorite CAT tool - -Save it with the "same_name.po" - -Not generate the file ".mo" if your CAT tool automatically generates it, delete it - -Generate the screenshots in the folder .. /en/images in your language and prepare them as they are. If you have no knowledge of the use of design tools, send the window screenshots unprocessed, making it evident a note in the mail. - -Make a compressed package tar.gz (or similar) with all the files and send to: , to integrate it into the help - -In the file "philosophy.html", see the notice in the third inning: "This is the content of our license:" - -TRANSLATRORS: IMPORTANT NOTICE! -If there is "no official" translation of the license to your language, we recommend that you include the following notice after the sentence to be translated: - -You can see the original content License: http://fsf.org/ - -This is an unofficial translation of the GNU General Public License into YOUR_LANGUAGE. It was not published by the Free Software Foundation, and does not legally state the distribution terms for software that uses the GNU GPL only the original English text of the GNU GPL does that. However, we hope that this translation will help YOUR_LANGUAGE speakers understand the GNU GPL better. - -The above paragraph should be in their language and in English. - -FRENCH EXAMPLE: - -Ceci est le contenu de notre licence: - -Vous pouvez voir le contenu original de licence: http://fsf.org/ - -This is an unofficial translation of the GNU General Public License into French ... ... French speakers understand the GNU GPL better. - -Il s'agit d'une traduction officieuse de la Licence Publique Générale GNU en français ... ... francophones comprendre la GNU GPL mieux. - -#: en/philosophy.html+html.body.p:17 -msgid "This is the content of our license:" -msgstr "" diff -Nru tupi-0.2+git04/src/components/help/help/README/philosophy-notice tupi-0.2+git05/src/components/help/help/README/philosophy-notice --- tupi-0.2+git04/src/components/help/help/README/philosophy-notice 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help/README/philosophy-notice 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ - - -#. TRANSLATRORS: IMPORTANT NOTICE! -#. If there is "no official" translation of the license to your language, we recommend that you include the following notice after the sentence to be translated: -#. -#. You can see the original content License: http://fsf.org/ -#. -#. This is an unofficial translation of the GNU General Public License into YOUR_LANGUAGE. It was not published by the Free Software Foundation, and does not legally state the distribution terms for software that uses the GNU GPL only the original English text of the GNU GPL does that. However, we hope that this translation will help YOUR_LANGUAGE speakers understand the GNU GPL better. -#. -#. The above paragraph should be in their language and in English. -#. -#. FRENCH EXAMPLE: -#. -#. Ceci est le contenu de notre licence: -#. -#. Vous pouvez voir le contenu original de licence: http://fsf.org/ -#. -#. This is an unofficial translation of the GNU General Public License into French ... ... French speakers understand the GNU GPL better. -#. -#. Il s'agit d'une traduction officieuse de la Licence Publique Générale GNU en français ... ... francophones comprendre la GNU GPL mieux. -#. -#: en/philosophy.html+html.body.p:17 -msgid "This is the content of our license:" -msgstr "" - - diff -Nru tupi-0.2+git04/src/components/help/help.pri tupi-0.2+git05/src/components/help/help.pri --- tupi-0.2+git04/src/components/help/help.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$HELP_DIR -LIBS += -L$$HELP_DIR -ltupihelp + +unix { + LIBS += -L$$HELP_DIR -ltupihelp +} + +win32 { + LIBS += -L$$HELP_DIR/release/ -ltupihelp +} linux-g++ { PRE_TARGETDEPS += $$HELP_DIR/libtupihelp.so diff -Nru tupi-0.2+git04/src/components/help/help.pro tupi-0.2+git05/src/components/help/help.pro --- tupi-0.2+git04/src/components/help/help.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/help.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/help -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += help help.files += help @@ -17,7 +14,8 @@ HEADERS += tuphelpwidget.h \ tuphelpbrowser.h SOURCES += tuphelpwidget.cpp \ - tuphelpbrowser.cpp + tuphelpbrowser.cpp + *:!macx{ CONFIG += dll warn_on } @@ -27,4 +25,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/help/tuphelpbrowser.cpp tupi-0.2+git05/src/components/help/tuphelpbrowser.cpp --- tupi-0.2+git04/src/components/help/tuphelpbrowser.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/tuphelpbrowser.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tuphelpbrowser.h" -#include "tglobal.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include // Help Browser @@ -70,12 +62,18 @@ locale = "en"; QStringList path; - QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); + +#ifdef Q_OS_WIN32 + QString resources = SHARE_DIR + "help" + QDir::separator(); +#else + QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); +#endif + // QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); path << resources + "css"; path << resources + "images"; m_pageArea->setSearchPaths(path); - m_pageArea->setSource(filePath); + m_pageArea->setSource(QUrl::fromLocalFile(filePath)); } // SQA: These methods are just temporary for developing reasons diff -Nru tupi-0.2+git04/src/components/help/tuphelpbrowser.h tupi-0.2+git05/src/components/help/tuphelpbrowser.h --- tupi-0.2+git04/src/components/help/tuphelpbrowser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/tuphelpbrowser.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,6 +36,7 @@ #ifndef TUPHELPBROWSER_H #define TUPHELPBROWSER_H +#include "tglobal.h" #include "tapplicationproperties.h" #include @@ -43,12 +44,16 @@ #include #include #include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TupHelpBrowser : public QWidget +class TUPI_EXPORT TupHelpBrowser : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/help/tuphelpwidget.cpp tupi-0.2+git05/src/components/help/tuphelpwidget.cpp --- tupi-0.2+git04/src/components/help/tuphelpwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/tuphelpwidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tuphelpwidget.h" -// Tupi Framework -#include "tdebug.h" -#include "tglobal.h" - -#include -#include -#include -#include TupHelpWidget::TupHelpWidget(const QString &path, QWidget *parent) : TupModuleWidgetBase(parent) { @@ -58,6 +50,15 @@ m_helpPath = new QDir(path + "en"); } + #ifdef K_DEBUG + QString msg = "TupHelpWidget() - Loading help files from -> " + m_helpPath->path(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + QTreeWidget *contentsListView = new QTreeWidget(this); contentsListView->setHeaderLabels(QStringList() << tr("")); contentsListView->header()->hide(); @@ -107,13 +108,23 @@ } } else { #ifdef K_DEBUG - tError() << "TupHelpWidget::TupHelpWidget() - Fatal Error: Can't set content"; + QString msg = "TupHelpWidget::TupHelpWidget() - Fatal Error: Can't set content"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } file.close(); } else { #ifdef K_DEBUG - tError() << "TupHelpWidget::TupHelpWidget() - Fatal Error: Can't open 'help.xml' file"; + QString msg = "TupHelpWidget::TupHelpWidget() - Fatal Error: Can't open 'help.xml' file"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } diff -Nru tupi-0.2+git04/src/components/help/tuphelpwidget.h tupi-0.2+git05/src/components/help/tuphelpwidget.h --- tupi-0.2+git04/src/components/help/tuphelpwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/help/tuphelpwidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,12 +36,16 @@ #ifndef TUPHELPWIDGET_H #define TUPHELPWIDGET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include #include #include #include +#include +#include +#include // class KHelpWidgetManager; @@ -49,7 +53,7 @@ * @author David Alejandro Cuadrado Cabrera */ -class TupHelpWidget : public TupModuleWidgetBase +class TUPI_EXPORT TupHelpWidget : public TupModuleWidgetBase { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/import/import.pri tupi-0.2+git05/src/components/import/import.pri --- tupi-0.2+git04/src/components/import/import.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/import/import.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$IMPORT_DIR -LIBS += -L$$IMPORT_DIR -ltupimport + +unix { + LIBS += -L$$IMPORT_DIR -ltupimport +} + +win32 { + LIBS += -L$$IMPORT_DIR/release/ -ltupimport +} linux-g++ { PRE_TARGETDEPS += $$IMPORT_DIR/libtupimport.so diff -Nru tupi-0.2+git04/src/components/import/import.pro tupi-0.2+git05/src/components/import/import.pro --- tupi-0.2+git04/src/components/import/import.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/import/import.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/import -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -22,4 +19,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/import/tuppaletteimporter.cpp tupi-0.2+git05/src/components/import/tuppaletteimporter.cpp --- tupi-0.2+git04/src/components/import/tuppaletteimporter.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/import/tuppaletteimporter.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "tuppaletteimporter.h" -#include "tdebug.h" - -#include -#include -#include struct TupPaletteImporter::Private { @@ -81,7 +76,12 @@ if (extension.compare("gpl") == 0) { if (! stream.readLine().contains("GIMP Palette")) { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " << file; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -89,7 +89,12 @@ QString line = stream.readLine(); if (!line.startsWith("Name:")) { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " << file; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -107,7 +112,12 @@ if (rgb.count() != 3) { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -125,7 +135,12 @@ color.setBlue(item); } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.gpl) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -135,7 +150,12 @@ k->document->addColor(color); } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid color format (.gpl) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid color format (.gpl) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -153,8 +173,13 @@ k->document->addColor(color); } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid color format (.txt) -> " << line; - #endif + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid color format (.txt) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif return false; } } @@ -166,7 +191,12 @@ int end = line.indexOf(")"); if (init == -1 || end == -1) { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.css) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.css) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -175,7 +205,12 @@ QStringList rgb = text.split(","); if (rgb.count() != 3) { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.css) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.css) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -193,7 +228,12 @@ color.setBlue(item); } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.css) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid palette format (.css) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -203,14 +243,24 @@ k->document->addColor(color); } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid color format (.css) -> " << line; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid color format (.css) -> " + line; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } } } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid extension! -> " << extension; + QString msg = "TupPaletteImporter::importGimpPalette() - Fatal Error: Invalid extension! -> " + extension; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -224,7 +274,12 @@ { if (k->paletteName.isNull()) { #ifdef K_DEBUG - tError() << "TupPaletteImporter::saveFile() - Fatal Error: Palette name is null!"; + QString msg = "TupPaletteImporter::saveFile() - Fatal Error: Palette name is null!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -238,7 +293,12 @@ k->filePath = pathName; } else { #ifdef K_DEBUG - tError() << "TupPaletteImporter::saveFile() - Fatal Error: Insufficient permission to save palette file -> " << pathName; + QString msg = "TupPaletteImporter::saveFile() - Fatal Error: Insufficient permission to save palette file -> " + pathName; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } diff -Nru tupi-0.2+git04/src/components/import/tuppaletteimporter.h tupi-0.2+git05/src/components/import/tuppaletteimporter.h --- tupi-0.2+git04/src/components/import/tuppaletteimporter.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/import/tuppaletteimporter.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,18 @@ #ifndef TUPPALETTEIMPORTER_H #define TUPPALETTEIMPORTER_H +#include "tglobal.h" #include "tuppalettedocument.h" +#include +#include +#include + /** * @author David Cuadrado **/ -class TupPaletteImporter +class TUPI_EXPORT TupPaletteImporter { public: enum PaletteType diff -Nru tupi-0.2+git04/src/components/kinas/kinas.pro tupi-0.2+git05/src/components/kinas/kinas.pro --- tupi-0.2+git04/src/components/kinas/kinas.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/kinas/kinas.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,8 +1,3 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/kinas -# Target is a library: - INSTALLS += target target.path = /lib/ @@ -23,6 +18,13 @@ TEMPLATE = lib TARGET = tupikinas +INCLUDEPATH += ../../libbase +INCLUDEPATH += ../../store +INCLUDEPATH += ../../libtupi +LIBS += -L../../libbase +LIBS += -L../../store +LIBS += -L../../libtupi + FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) include(../components_config.pri) diff -Nru tupi-0.2+git04/src/components/kinas/kinaswidget.cpp tupi-0.2+git05/src/components/kinas/kinaswidget.cpp --- tupi-0.2+git04/src/components/kinas/kinaswidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/kinas/kinaswidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "kinaswidget.h" -#include "tdebug.h" KinasWidget::KinasWidget(QWidget *parent) : TupModuleWidgetBase(parent) { diff -Nru tupi-0.2+git04/src/components/kinas/kinaswidget.h tupi-0.2+git05/src/components/kinas/kinaswidget.h --- tupi-0.2+git04/src/components/kinas/kinaswidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/kinas/kinaswidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,6 +36,7 @@ #ifndef KINASWIDGET_H #define KINASWIDGET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "tupseditor.h" #include "tupsfunctionview.h" diff -Nru tupi-0.2+git04/src/components/kinas/tupsfunctionview.cpp tupi-0.2+git05/src/components/kinas/tupsfunctionview.cpp --- tupi-0.2+git04/src/components/kinas/tupsfunctionview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/kinas/tupsfunctionview.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -45,8 +45,8 @@ setHeaderLabels(QStringList() << "Members"); setRootIsDecorated (true); - header()->setResizeMode(QHeaderView::Stretch); - // header()->setSectionResizeMode(QHeaderView::Stretch); + // header()->setResizeMode(QHeaderView::Stretch); + header()->setSectionResizeMode(QHeaderView::Stretch); setEditTriggers(QAbstractItemView::AnyKeyPressed); diff -Nru tupi-0.2+git04/src/components/library/library.pri tupi-0.2+git05/src/components/library/library.pri --- tupi-0.2+git04/src/components/library/library.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/library.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$LIBRARY_DIR -LIBS += -L$$LIBRARY_DIR -ltupilibrary + +unix { + LIBS += -L$$LIBRARY_DIR -ltupilibrary +} + +win32 { + LIBS += -L$$LIBRARY_DIR/release/ -ltupilibrary +} linux-g++ { PRE_TARGETDEPS += $$LIBRARY_DIR/libtupilibrary.so diff -Nru tupi-0.2+git04/src/components/library/library.pro tupi-0.2+git05/src/components/library/library.pro --- tupi-0.2+git04/src/components/library/library.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/library.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/library -# Target is a library: +QT += opengl core gui svg xml network multimedia INSTALLS += target target.path = /lib/ @@ -14,14 +11,18 @@ tupitemmanager.h \ tupsymboleditor.h \ tuptreedelegate.h \ - tupnewitemdialog.h + tupnewitemdialog.h \ + tuplibrarydisplay.h \ + tupsoundplayer.h SOURCES += tuplibrarywidget.cpp \ tupitemmanager.cpp \ tupsymboleditor.cpp \ tuptreedelegate.cpp \ - tupnewitemdialog.cpp - + tupnewitemdialog.cpp \ + tuplibrarydisplay.cpp \ + tupsoundplayer.cpp + *:!macx{ CONFIG += dll warn_on } @@ -31,4 +32,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/library/tupitemmanager.cpp tupi-0.2+git05/src/components/library/tupitemmanager.cpp --- tupi-0.2+git04/src/components/library/tupitemmanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupitemmanager.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tupitemmanager.h" -#include "tglobal.h" -#include "tdebug.h" -#include "tapplication.h" - -#include -#include /** * This class provides some methods for the TupLibraryWidget. @@ -52,7 +46,8 @@ currentSelection = ""; setHeaderLabels(QStringList() << "" << ""); - header()->setResizeMode(QHeaderView::ResizeToContents); + header()->setSectionResizeMode(QHeaderView::ResizeToContents); + setItemDelegate(new TupTreeDelegate(this)); setColumnCount(3); @@ -81,7 +76,6 @@ newFolder->setText(1, folderName); newFolder->setText(2, ""); - // SQA: Check if this instruction is really necessary newFolder->setFlags(newFolder->flags() | Qt::ItemIsEditable); foldersTotal++; @@ -198,8 +192,12 @@ { if (event->buttons() == Qt::LeftButton) { QTreeWidgetItem *item = currentItem(); - if (item) - emit itemRequired(); + if (item) { + if (isFolder(item)) + emit itemRenamed(item); + else + emit itemRequired(); + } } } @@ -227,137 +225,154 @@ emit itemSelected(item); if (event->buttons() == Qt::RightButton) { - QMenu *menu = new QMenu(tr("Options")); - if (item->text(2).compare("SVG")==0) { - QAction *edit = new QAction(tr("Edit with Inkscape"), this); - connect(edit, SIGNAL(triggered()), this, SLOT(callInkscapeToEdit())); -#ifdef Q_OS_UNIX - if (!QFile::exists("/usr/bin/inkscape")) - edit->setDisabled(true); -#else - edit->setDisabled(true); -#endif - menu->addAction(edit); - } else if (item->text(2).compare("OBJ")!=0) { - QAction *gimpEdit = new QAction(tr("Edit with Gimp"), this); - connect(gimpEdit, SIGNAL(triggered()), this, SLOT(callGimpToEdit())); -#ifdef Q_OS_UNIX - if (!QFile::exists("/usr/bin/gimp")) - gimpEdit->setDisabled(true); -#else - gimpEdit->setDisabled(true); -#endif - menu->addAction(gimpEdit); - - QAction *kritaEdit = new QAction(tr("Edit with Krita"), this); - connect(kritaEdit, SIGNAL(triggered()), this, SLOT(callKritaToEdit())); -#ifdef Q_OS_UNIX - if (!QFile::exists("/usr/bin/krita")) - kritaEdit->setDisabled(true); -#else - kritaEdit->setDisabled(true); -#endif - menu->addAction(kritaEdit); - - QAction *myPaintEdit = new QAction(tr("Edit with MyPaint"), this); - connect(myPaintEdit, SIGNAL(triggered()), this, SLOT(callMyPaintToEdit())); -#ifdef Q_OS_UNIX - if (!QFile::exists("/usr/bin/mypaint")) - myPaintEdit->setDisabled(true); -#else - myPaintEdit->setDisabled(true); -#endif - menu->addAction(myPaintEdit); - } - - QAction *clone = new QAction(tr("Clone"), this); - connect(clone, SIGNAL(triggered()), this, SLOT(cloneItem())); + if (isFolder(item)) { + QAction *rename = new QAction(tr("Rename"), this); + connect(rename, SIGNAL(triggered()), this, SLOT(renameItem())); + + QAction *remove = new QAction(tr("Delete"), this); + connect(remove, SIGNAL(triggered()), this, SIGNAL(itemRemoved())); + + menu->addAction(rename); + menu->addAction(remove); + } else { + QString extension = item->text(2); + bool isSound = false; + if ((extension.compare("OGG") == 0) || (extension.compare("MP3") == 0) || (extension.compare("WAV") == 0)) + isSound = true; + + if (extension.compare("SVG") == 0) { + QAction *edit = new QAction(tr("Edit with Inkscape"), this); + connect(edit, SIGNAL(triggered()), this, SLOT(callInkscapeToEdit())); + #ifdef Q_OS_UNIX + if (!QFile::exists("/usr/bin/inkscape")) + edit->setDisabled(true); + #else + edit->setDisabled(true); + #endif + menu->addAction(edit); + } else if ((extension.compare("OBJ") != 0) && !isSound) { + QAction *gimpEdit = new QAction(tr("Edit with Gimp"), this); + connect(gimpEdit, SIGNAL(triggered()), this, SLOT(callGimpToEdit())); + #ifdef Q_OS_UNIX + if (!QFile::exists("/usr/bin/gimp")) + gimpEdit->setDisabled(true); + #else + gimpEdit->setDisabled(true); + #endif + menu->addAction(gimpEdit); + + QAction *kritaEdit = new QAction(tr("Edit with Krita"), this); + connect(kritaEdit, SIGNAL(triggered()), this, SLOT(callKritaToEdit())); + #ifdef Q_OS_UNIX + if (!QFile::exists("/usr/bin/krita")) + kritaEdit->setDisabled(true); + #else + kritaEdit->setDisabled(true); + #endif + menu->addAction(kritaEdit); + + QAction *myPaintEdit = new QAction(tr("Edit with MyPaint"), this); + connect(myPaintEdit, SIGNAL(triggered()), this, SLOT(callMyPaintToEdit())); + #ifdef Q_OS_UNIX + if (!QFile::exists("/usr/bin/mypaint")) + myPaintEdit->setDisabled(true); + #else + myPaintEdit->setDisabled(true); + #endif + menu->addAction(myPaintEdit); + } - QAction *exportObject = new QAction(tr("Export"), this); - connect(exportObject, SIGNAL(triggered()), this, SLOT(exportItem())); + if (!isSound) { + QAction *clone = new QAction(tr("Clone"), this); + connect(clone, SIGNAL(triggered()), this, SLOT(cloneItem())); + menu->addAction(clone); + } - QAction *rename = new QAction(tr("Rename"), this); - connect(rename, SIGNAL(triggered()), this, SLOT(renameItem())); + QAction *exportObject = new QAction(tr("Export"), this); + connect(exportObject, SIGNAL(triggered()), this, SLOT(exportItem())); - QAction *remove = new QAction(tr("Delete"), this); - connect(remove, SIGNAL(triggered()), this, SIGNAL(itemRemoved())); + QAction *rename = new QAction(tr("Rename"), this); + connect(rename, SIGNAL(triggered()), this, SLOT(renameItem())); - menu->addAction(clone); - menu->addAction(exportObject); - menu->addAction(rename); - menu->addAction(remove); - menu->addSeparator(); + QAction *remove = new QAction(tr("Delete"), this); + connect(remove, SIGNAL(triggered()), this, SIGNAL(itemRemoved())); -#ifdef Q_OS_UNIX - if (QFile::exists("/usr/bin/gimp") || QFile::exists("/usr/bin/krita") || QFile::exists("/usr/bin/mypaint")) { - QAction *raster = new QAction(tr("Create new raster item"), this); - connect(raster, SIGNAL(triggered()), this, SLOT(createNewRaster())); - menu->addAction(raster); + menu->addAction(exportObject); + menu->addAction(rename); + menu->addAction(remove); + menu->addSeparator(); + + #ifdef Q_OS_UNIX + if (!isSound) { + if (QFile::exists("/usr/bin/gimp") || QFile::exists("/usr/bin/krita") || QFile::exists("/usr/bin/mypaint")) { + QAction *raster = new QAction(tr("Create new raster item"), this); + connect(raster, SIGNAL(triggered()), this, SLOT(createNewRaster())); + menu->addAction(raster); + } + + if (QFile::exists("/usr/bin/inkscape")) { + QAction *svg = new QAction(tr("Create new svg item"), this); + connect(svg, SIGNAL(triggered()), this, SLOT(createNewSVG())); + menu->addAction(svg); + } + } + #endif } -#endif -#ifdef Q_OS_UNIX - if (QFile::exists("/usr/bin/inkscape")) { - QAction *svg = new QAction(tr("Create new svg item"), this); - connect(svg, SIGNAL(triggered()), this, SLOT(createNewSVG())); - menu->addAction(svg); - } -#endif menu->exec(event->globalPos()); - } else if (event->buttons() == Qt::LeftButton) { + // SQA: This code doesn't work well at all. Reengineering is urgently required right here! + // If the node has a parent, get the parent's name + QTreeWidgetItem *top = item->parent(); + if (top) + parentNode = top->text(1); + + // For directories, get the children + nodeChildren.clear(); + if (item->text(2).length()==0 && item->childCount() > 0) { + for (int i=0;ichildCount();i++) { + QTreeWidgetItem *node = item->child(i); + nodeChildren << node; + } + } + + QPixmap pixmap = item->icon(0).pixmap(15, 15); + + QByteArray itemData; + QDataStream dataStream(&itemData, QIODevice::WriteOnly); + dataStream << pixmap << item->text(1) << item->text(2) << item->text(3); + + QMimeData *mimeData = new QMimeData; + mimeData->setData("application/x-dnditemdata", itemData); + + QDrag *drag = new QDrag(this); + drag->setMimeData(mimeData); + drag->setPixmap(pixmap); - // If the node has a parent, get the parent's name - QTreeWidgetItem *top = item->parent(); - if (top) - parentNode = top->text(1); - - // For directories, get the children - nodeChildren.clear(); - if (item->text(2).length()==0 && item->childCount() > 0) { - for (int i=0;ichildCount();i++) { - QTreeWidgetItem *node = item->child(i); - nodeChildren << node; - } - } - - QPixmap pixmap = item->icon(0).pixmap(15, 15); - - QByteArray itemData; - QDataStream dataStream(&itemData, QIODevice::WriteOnly); - dataStream << pixmap << item->text(1) << item->text(2) << item->text(3); - - QMimeData *mimeData = new QMimeData; - mimeData->setData("application/x-dnditemdata", itemData); - - QDrag *drag = new QDrag(this); - drag->setMimeData(mimeData); - drag->setPixmap(pixmap); - - if (drag->start(Qt::MoveAction) == Qt::MoveAction) - delete takeTopLevelItem(indexOfTopLevelItem(item)); + if (drag->start(Qt::MoveAction) == Qt::MoveAction) + delete takeTopLevelItem(indexOfTopLevelItem(item)); } } else { + if (event->buttons() == Qt::RightButton) { QMenu *menu = new QMenu(tr("Options")); -#ifdef Q_OS_UNIX + #ifdef Q_OS_UNIX if (QFile::exists("/usr/bin/gimp") || QFile::exists("/usr/bin/krita") || QFile::exists("/usr/bin/mypaint")) { QAction *raster = new QAction(tr("Create new raster item"), this); connect(raster, SIGNAL(triggered()), this, SLOT(createNewRaster())); menu->addAction(raster); } -#endif - -#ifdef Q_OS_UNIX if (QFile::exists("/usr/bin/inkscape")) { QAction *svg = new QAction(tr("Create new svg item"), this); connect(svg, SIGNAL(triggered()), this, SLOT(createNewSVG())); menu->addAction(svg); } -#endif + #endif + menu->exec(event->globalPos()); + } } } diff -Nru tupi-0.2+git04/src/components/library/tupitemmanager.h tupi-0.2+git05/src/components/library/tupitemmanager.h --- tupi-0.2+git04/src/components/library/tupitemmanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupitemmanager.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,17 +36,22 @@ #ifndef TUPITEMMANAGER_H #define TUPITEMMANAGER_H +#include "tglobal.h" #include "tuptreedelegate.h" #include "treelistwidget.h" #include "tapplicationproperties.h" #include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TupItemManager : public TreeListWidget +class TUPI_EXPORT TupItemManager : public TreeListWidget { Q_OBJECT @@ -113,7 +118,7 @@ QString parentNode; QString currentSelection; QList nodeChildren; - typedef QList Lists; + // typedef QList Lists; // QHash deepChildren; }; diff -Nru tupi-0.2+git04/src/components/library/tuplibrarydisplay.cpp tupi-0.2+git05/src/components/library/tuplibrarydisplay.cpp --- tupi-0.2+git04/src/components/library/tuplibrarydisplay.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tuplibrarydisplay.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,96 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tuplibrarydisplay.h" + +struct TupLibraryDisplay::Private +{ + TupItemPreview *previewPanel; + TupSoundPlayer *soundPlayer; +}; + +TupLibraryDisplay::TupLibraryDisplay() : QWidget(), k(new Private) +{ + k->previewPanel = new TupItemPreview(this); + k->soundPlayer = new TupSoundPlayer(this); + + QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); + layout->addWidget(k->previewPanel); + layout->addWidget(k->soundPlayer); + layout->setContentsMargins(0, 0, 0, 0); + + showDisplay(); +} + +TupLibraryDisplay::~TupLibraryDisplay() +{ + delete k; +} + +QSize TupLibraryDisplay::sizeHint() const +{ + return QWidget::sizeHint().expandedTo(QSize(100, 100)); +} + +void TupLibraryDisplay::reset() +{ + k->previewPanel->reset(); +} + +void TupLibraryDisplay::render(QGraphicsItem *item) +{ + k->previewPanel->render(item); +} + +void TupLibraryDisplay::showDisplay() +{ + if (!k->previewPanel->isVisible()) { + k->previewPanel->show(); + k->soundPlayer->hide(); + } +} + +void TupLibraryDisplay::setSoundObject(const QString &path) +{ + k->soundPlayer->setSoundObject(path); +} + +void TupLibraryDisplay::showSoundPlayer() +{ + if (!k->soundPlayer->isVisible()) { + k->previewPanel->hide(); + k->soundPlayer->show(); + } +} diff -Nru tupi-0.2+git04/src/components/library/tuplibrarydisplay.h tupi-0.2+git05/src/components/library/tuplibrarydisplay.h --- tupi-0.2+git04/src/components/library/tuplibrarydisplay.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tuplibrarydisplay.h 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,71 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPLIBRARYDISPLAY_H +#define TUPLIBRARYDISPLAY_H + +#include "tglobal.h" +#include "tupitempreview.h" +#include "tupsoundplayer.h" + +#include +#include +#include + +/** + * @author Gustav Gonzalez +**/ + +class TUPI_EXPORT TupLibraryDisplay : public QWidget +{ + Q_OBJECT + + public: + TupLibraryDisplay(); + ~TupLibraryDisplay(); + + QSize sizeHint() const; + void reset(); + void render(QGraphicsItem *item); + void showDisplay(); + void showSoundPlayer(); + void setSoundObject(const QString &path); + + private: + struct Private; + Private *const k; +}; + +#endif diff -Nru tupi-0.2+git04/src/components/library/tuplibrarywidget.cpp tupi-0.2+git05/src/components/library/tuplibrarywidget.cpp --- tupi-0.2+git04/src/components/library/tuplibrarywidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tuplibrarywidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,41 +34,6 @@ ***************************************************************************/ #include "tuplibrarywidget.h" -#include "tglobal.h" -#include "tapplication.h" -#include "toptionaldialog.h" -#include "tconfig.h" -#include "tuplibrary.h" -#include "tupproject.h" -#include "tupsymboleditor.h" -#include "tuprequestbuilder.h" -#include "tosd.h" -#include "talgorithm.h" -// #include "taudioplayer.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include #define RETURN_IF_NOT_LIBRARY if (!k->library) return; @@ -89,7 +54,7 @@ TupLibrary *library; TupProject *project; - TupItemPreview *display; + TupLibraryDisplay *display; TupItemManager *libraryTree; int childCount; QDir libraryDir; @@ -102,6 +67,7 @@ QTreeWidgetItem *lastItemEdited; QTreeWidgetItem *currentItemDisplayed; QFileSystemWatcher *watcher; + QList editorItems; struct Frame { @@ -114,7 +80,11 @@ TupLibraryWidget::TupLibraryWidget(QWidget *parent) : TupModuleWidgetBase(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupLibraryWidget()]"; + #else + TINIT; + #endif #endif k->childCount = 0; @@ -125,14 +95,14 @@ setWindowTitle(tr("Library")); k->libraryDir = QDir(CONFIG_DIR + "libraries"); - k->display = new TupItemPreview(this); + k->display = new TupLibraryDisplay(); k->libraryTree = new TupItemManager(this); connect(k->libraryTree, SIGNAL(itemSelected(QTreeWidgetItem *)), this, SLOT(previewItem(QTreeWidgetItem *))); connect(k->libraryTree, SIGNAL(itemRemoved()), this, - SLOT(removeCurrentGraphic())); + SLOT(removeCurrentItem())); connect(k->libraryTree, SIGNAL(itemCloned(QTreeWidgetItem*)), this, SLOT(cloneObject(QTreeWidgetItem*))); @@ -146,6 +116,9 @@ connect(k->libraryTree, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(refreshItem(QTreeWidgetItem*))); + connect(k->libraryTree, SIGNAL(editorClosed()), this, + SLOT(updateItemEditionState())); + connect(k->libraryTree, SIGNAL(itemMoved(QString, QString)), this, SLOT(updateLibrary(QString, QString))); @@ -190,13 +163,15 @@ k->itemType->addItem(QIcon(THEME_DIR + "icons/svg.png"), tr("Svg File")); k->itemType->addItem(QIcon(THEME_DIR + "icons/bitmap_array.png"), tr("Image Array")); k->itemType->addItem(QIcon(THEME_DIR + "icons/svg_array.png"), tr("Svg Array")); + k->itemType->addItem(QIcon(THEME_DIR + "icons/sound_object.png"), tr("Sound File")); + comboLayout->addWidget(k->itemType); - connect(k->itemType, SIGNAL(currentIndexChanged(int)), this, SLOT(importGraphicObject())); + connect(k->itemType, SIGNAL(currentIndexChanged(int)), this, SLOT(importLibraryObject())); TImageButton *addGC = new TImageButton(QPixmap(THEME_DIR + "icons/plus_sign.png"), 22, buttons); addGC->setToolTip(tr("Add an object to library")); - connect(addGC, SIGNAL(clicked()), this, SLOT(importGraphicObject())); + connect(addGC, SIGNAL(clicked()), this, SLOT(importLibraryObject())); comboLayout->addWidget(addGC); buttonLayout->addLayout(comboLayout); @@ -227,8 +202,13 @@ TupLibraryWidget::~TupLibraryWidget() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupLibraryWidget()]"; + #else + TEND; + #endif #endif + delete k; } @@ -256,6 +236,16 @@ k->mkdir = true; } +void TupLibraryWidget::updateItemEditionState() +{ + if (k->editorItems.count() == 2) { + TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Remove, k->editorItems.at(0), TupLibraryObject::Folder); + emit requestTriggered(&request); + } + + k->editorItems.clear(); +} + void TupLibraryWidget::activeRefresh(QTreeWidgetItem *item) { k->mkdir = true; @@ -265,16 +255,20 @@ void TupLibraryWidget::previewItem(QTreeWidgetItem *item) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupLibraryWidget::previewItem()]"; + #else + T_FUNCINFO; + #endif #endif RETURN_IF_NOT_LIBRARY; if (item) { - k->currentItemDisplayed = item; if (item->text(2).length() == 0) { + k->display->showDisplay(); QGraphicsTextItem *msg = new QGraphicsTextItem(tr("Directory")); k->display->render(static_cast(msg)); return; @@ -284,10 +278,17 @@ if (!object) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::previewItem() - Fatal Error: Cannot find the object: " << item->text(1) + "." + item->text(2).toLower(); + QString msg = "TupLibraryWidget::previewItem() - Fatal Error: Cannot find the object: " + item->text(1) + "." + item->text(2).toLower(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif - QGraphicsTextItem *msg = new QGraphicsTextItem(tr("No preview available")); - k->display->render(static_cast(msg)); + + k->display->showDisplay(); + QGraphicsTextItem *text = new QGraphicsTextItem(tr("No preview available")); + k->display->render(static_cast(text)); return; } @@ -295,15 +296,16 @@ switch (object->type()) { case TupLibraryObject::Svg: { + k->display->showDisplay(); QGraphicsSvgItem *svg = new QGraphicsSvgItem(object->dataPath()); - k->display->render(static_cast(svg)); + k->display->render(static_cast(svg)); } break; case TupLibraryObject::Image: case TupLibraryObject::Item: { if (object->data().canConvert()) { - + k->display->showDisplay(); k->display->render(qvariant_cast(object->data())); /* SQA: Just a test @@ -316,19 +318,19 @@ break; case TupLibraryObject::Sound: { - /* - TAudioPlayer::instance()->setCurrentPlayer(k->currentPlayerId); - TAudioPlayer::instance()->stop(); - - k->currentPlayerId = TAudioPlayer::instance()->load(object->dataPath()); - TAudioPlayer::instance()->play(0); - */ + k->display->setSoundObject(object->dataPath()); + k->display->showSoundPlayer(); } break; default: { #ifdef K_DEBUG - tDebug("library") << "Unknown symbol id: " << object->type(); + QString msg = "TupLibraryWidget::previewItem() - Unknown symbol id: " + QString::number(object->type()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError("library") << msg; + #endif #endif } break; @@ -342,54 +344,107 @@ void TupLibraryWidget::insertObjectInWorkspace() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupLibraryWidget::insertObjectInWorkspace()]"; + #else + T_FUNCINFO; + #endif #endif + if (k->libraryTree->topLevelItemCount() == 0) { + TOsd::self()->display(tr("Error"), tr("Library is empty!"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupLibraryWidget::insertObjectInWorkspace() - Library is empty!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + return; + } + if (!k->libraryTree->currentItem()) { + TOsd::self()->display(tr("Error"), tr("There's no current selection!"), TOsd::Error); #ifdef K_DEBUG - tFatal() << "TupLibraryWidget::insertObjectInWorkspace() - There's no current selection!"; + QString msg = "TupLibraryWidget::insertObjectInWorkspace() - There's no current selection!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + return; + } + + QString extension = k->libraryTree->currentItem()->text(2); + if (extension.length() == 0) { + TOsd::self()->display(tr("Error"), tr("It's a directory! Please, pick a graphic object"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupLibraryWidget::insertObjectInWorkspace() - It's a directory!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif return; - } else if (k->libraryTree->currentItem()->text(2).length() == 0) { - #ifdef K_DEBUG - tFatal() << "TupLibraryWidget::insertObjectInWorkspace() - It's a directory!"; - #endif - return; } - QString objectKey = k->libraryTree->currentItem()->text(1) + "." + k->libraryTree->currentItem()->text(2).toLower(); + if ((extension.compare("OGG") == 0) || (extension.compare("WAV") == 0) || (extension.compare("MP3") == 0)) { + TOsd::self()->display(tr("Error"), tr("It's a sound file! Please, pick a graphic object"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupLibraryWidget::insertObjectInWorkspace() - It's a sound file!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif + #endif + return; + } - TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::InsertSymbolIntoFrame, objectKey, + QString key = k->libraryTree->currentItem()->text(1) + "." + extension.toLower(); + + TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::InsertSymbolIntoFrame, key, TupLibraryObject::Type(k->libraryTree->currentItem()->data(1, 3216).toInt()), k->project->spaceContext(), 0, QString(), k->currentFrame.scene, k->currentFrame.layer, k->currentFrame.frame); emit requestTriggered(&request); } -void TupLibraryWidget::removeCurrentGraphic() +void TupLibraryWidget::removeCurrentItem() { if (!k->libraryTree->currentItem()) return; QString extension = k->libraryTree->currentItem()->text(2); - QString objectKey = k->libraryTree->currentItem()->text(1); TupLibraryObject::Type type = TupLibraryObject::Folder; // If it's NOT a directory if (extension.length() > 0) { objectKey = k->libraryTree->currentItem()->text(3); - if (extension.compare("JPG")==0 || extension.compare("PNG")==0 || extension.compare("GIF")==0) + if (extension.compare("JPEG") == 0 || extension.compare("JPG") == 0 || extension.compare("PNG") == 0 || extension.compare("GIF") == 0) type = TupLibraryObject::Image; if (extension.compare("SVG")==0) type = TupLibraryObject::Svg; if (extension.compare("OBJ")==0) type = TupLibraryObject::Item; + if ((extension.compare("OGG") == 0) || (extension.compare("WAV") == 0) || (extension.compare("MP3") == 0)) + type = TupLibraryObject::Sound; } + /* TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::RemoveSymbolFromFrame, objectKey, type, k->project->spaceContext(), 0, QString(), k->currentFrame.scene, k->currentFrame.layer, k->currentFrame.frame); + */ + + TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Remove, + objectKey, type, k->project->spaceContext(), 0, QString(), + k->currentFrame.scene, k->currentFrame.layer, k->currentFrame.frame); + emit requestTriggered(&request); } @@ -426,7 +481,12 @@ if (!isOk) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::cloneObject() - Fatal Error: Object file couldn't be cloned!"; + QString msg = "TupLibraryWidget::cloneObject() - Fatal Error: Object file couldn't be cloned!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -439,7 +499,12 @@ if (!isOk) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::cloneObject() - Fatal Error: Object file couldn't be loaded!"; + QString msg = "TupLibraryWidget::cloneObject() - Fatal Error: Object file couldn't be loaded!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -477,6 +542,7 @@ case TupLibraryObject::Sound: { item->setIcon(0, QIcon(THEME_DIR + "icons/sound_object.png")); + previewItem(item); } break; default: @@ -487,8 +553,14 @@ } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::cloneObject() - Fatal Error: Object doesn't exist! [ " << id << " ]"; + QString msg = "TupLibraryWidget::cloneObject() - Fatal Error: Object doesn't exist! [ " + id + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return; } } @@ -502,18 +574,29 @@ QString path = object->dataPath(); if (path.length() > 0) { QString fileExtension = object->extension(); - QString filter = tr("Images") + " "; + QString filter; - if (fileExtension.compare("PNG") == 0) - filter += "(*.png)"; - if ((fileExtension.compare("JPG") == 0) || (fileExtension.compare("JPEG") == 0)) - filter += "(*.jpg *.jpeg)"; - if (fileExtension.compare("GIF") == 0) - filter += "(*.gif)"; - if (fileExtension.compare("XPM") == 0) - filter += "(*.xpm)"; - if (fileExtension.compare("SVG") == 0) - filter += "(*.svg)"; + if (object->type() == TupLibraryObject::Image) { + filter = tr("Images") + " "; + if (fileExtension.compare("PNG") == 0) + filter += "(*.png)"; + if ((fileExtension.compare("JPG") == 0) || (fileExtension.compare("JPEG") == 0)) + filter += "(*.jpg *.jpeg)"; + if (fileExtension.compare("GIF") == 0) + filter += "(*.gif)"; + if (fileExtension.compare("XPM") == 0) + filter += "(*.xpm)"; + if (fileExtension.compare("SVG") == 0) + filter += "(*.svg)"; + } else if (object->type() == TupLibraryObject::Sound) { + filter = tr("Sounds") + " "; + if (fileExtension.compare("OGG") == 0) + filter += "(*.ogg)"; + if (fileExtension.compare("MP3") == 0) + filter += "(*.mp3)"; + if (fileExtension.compare("WAV") == 0) + filter += "(*.wav)"; + } QString target = QFileDialog::getSaveFileName(this, tr("Export object..."), QDir::homePath(), filter); if (target.isEmpty()) @@ -522,7 +605,12 @@ if (QFile::exists(target)) { if (!QFile::remove(target)) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::exportObject() - Fatal Error: destination path already exists! [ " << id << " ]"; + QString msg = "TupLibraryWidget::exportObject() - Fatal Error: destination path already exists! [ " + id + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -530,7 +618,12 @@ if (!QFile::copy(path, target)) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::exportObject() - Error: Object file couldn't be exported! [ " << id << " ]"; + QString msg = "TupLibraryWidget::exportObject() - Error: Object file couldn't be exported! [ " + id + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } else { @@ -538,13 +631,23 @@ } } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::exportObject() - Error: Object path is null! [ " << id << " ]"; + QString msg = "TupLibraryWidget::exportObject() - Error: Object path is null! [ " + id + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::exportObject() - Error: Object doesn't exist! [ " << id << " ]"; + QString msg = "TupLibraryWidget::exportObject() - Error: Object doesn't exist! [ " + id + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -591,7 +694,12 @@ QDir dir; if (!dir.mkpath(imagesDir)) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::createRasterObject() - Fatal Error: Couldn't create directory " << imagesDir; + QString msg = "TupLibraryWidget::createRasterObject() - Fatal Error: Couldn't create directory " + imagesDir; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif TOsd::self()->display(tr("Error"), tr("Couldn't create images directory!"), TOsd::Error); return; @@ -640,13 +748,23 @@ executeSoftware(editor, path); } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::createRasterObject() - Fatal Error: Object file couldn't be loaded from -> " << path; + QString msg = "TupLibraryWidget::createRasterObject() - Fatal Error: Object file couldn't be loaded from -> " + path; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::createRasterObject() - Fatal Error: Object file couldn't be saved at -> " << path; + QString msg = "TupLibraryWidget::createRasterObject() - Fatal Error: Object file couldn't be saved at -> " + path; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -684,8 +802,14 @@ QDir dir; if (!dir.mkpath(vectorDir)) { #ifdef K_DEBUG - tError() << "TupLibraryWidget::createVectorObject() - Fatal Error: Couldn't create directory " << vectorDir; + QString msg = "TupLibraryWidget::createVectorObject() - Fatal Error: Couldn't create directory " + vectorDir; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + TOsd::self()->display(tr("Error"), tr("Couldn't create vector directory!"), TOsd::Error); return; } @@ -733,13 +857,23 @@ executeSoftware(editor, path); } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::createVectorObject() - Fatal Error: Object file couldn't be loaded from -> " << path; + QString msg = "TupLibraryWidget::createVectorObject() - Fatal Error: Object file couldn't be loaded from -> " + path; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::createVectorObject() - Fatal Error: Object file couldn't be saved at -> " << path; + QString msg = "TupLibraryWidget::createVectorObject() - Fatal Error: Object file couldn't be saved at -> " + path; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -776,9 +910,15 @@ int projectHeight = k->project->dimension().height(); #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "TupLibraryWidget::importBitmap() - Image filename: " << key << " | Raw Size: " << data.size(); + qDebug() << "TupLibraryWidget::importBitmap() - Image Size: " << "[" << picWidth << ", " << picHeight << "]" + << " | Project Size: " << "[" << projectWidth << ", " << projectHeight << "]"; + #else tFatal() << "TupLibraryWidget::importBitmap() - Image filename: " << key << " | Raw Size: " << data.size(); - tFatal() << "TupLibraryWidget::importBitmap() - Image Size: " << "[" << picWidth << ", " << picHeight << "]" + tFatal() << "TupLibraryWidget::importBitmap() - Image Size: " << "[" << picWidth << ", " << picHeight << "]" << " | Project Size: " << "[" << projectWidth << ", " << projectHeight << "]"; + #endif #endif if (picWidth > projectWidth || picHeight > projectHeight) { @@ -799,7 +939,8 @@ if (answer == QMessageBox::Yes) { pixmap = new QPixmap(); QString extension = fileInfo.suffix().toUpper(); - QByteArray ba = extension.toAscii(); + // QByteArray ba = extension.toAscii(); + QByteArray ba = extension.toLatin1(); const char* ext = ba.data(); if (pixmap->loadFromData(data, ext)) { QPixmap newpix; @@ -857,12 +998,21 @@ file.close(); #ifdef K_DEBUG - tFatal() << "TupLibraryWidget::importSvg() - Inserting SVG into project: " << k->project->projectName(); - int projectWidth = k->project->dimension().width(); - int projectHeight = k->project->dimension().height(); - tFatal() << "TupLibraryWidget::importSvg() - Project Size: " << "[" << projectWidth << ", " << projectHeight << "]"; + QString msg1 = "TupLibraryWidget::importSvg() - Inserting SVG into project: " + k->project->projectName(); + int projectWidth = k->project->dimension().width(); + int projectHeight = k->project->dimension().height(); + QString msg2 = "TupLibraryWidget::importSvg() - Project Size: [" + QString::number(projectWidth) + QString(", ") + QString::number(projectHeight) + QString("]"); + + #ifdef Q_OS_WIN32 + qDebug() << msg1; + qDebug() << msg2; + #else + tFatal() << msg1; + tFatal() << msg2; + #endif #endif + int i = 0; int index = key.lastIndexOf("."); QString name = key.mid(0, index); @@ -900,14 +1050,13 @@ for (int i = 0; i < size; ++i) { if (photograms.at(i).isFile()) { QString extension = photograms.at(i).suffix().toUpper(); - if (extension.compare("JPG")==0 || extension.compare("PNG")==0 || extension.compare("GIF")==0 || + if (extension.compare("JPEG")==0 || extension.compare("JPG")==0 || extension.compare("PNG")==0 || extension.compare("GIF")==0 || extension.compare("XPM")==0) imagesCounter++; } } if (imagesCounter > 0) { - QString text = tr("Image files found: %1.").arg(imagesCounter); bool resize = false; @@ -965,7 +1114,7 @@ for (int i = 0; i < size; ++i) { if (photograms.at(i).isFile()) { QString extension = photograms.at(i).suffix().toUpper(); - if (extension.compare("JPG")==0 || extension.compare("PNG")==0 || extension.compare("GIF")==0 || + if (extension.compare("JPEG")==0 || extension.compare("JPG")==0 || extension.compare("PNG")==0 || extension.compare("GIF")==0 || extension.compare("XPM")==0) { QString path = photograms.at(i).absoluteFilePath(); QString symName = photograms.at(i).fileName().toLower(); @@ -980,7 +1129,8 @@ if (resize) { pixmap = new QPixmap(); QString extension = fileInfo.suffix().toUpper(); - QByteArray ba = extension.toAscii(); + // QByteArray ba = extension.toAscii(); + QByteArray ba = extension.toLatin1(); const char* ext = ba.data(); if (pixmap->loadFromData(data, ext)) { int width = projectWidth; @@ -996,7 +1146,6 @@ emit requestTriggered(&request); if (i < photograms.size()-1 && imagesCounter > 1) { - TupProjectRequest request = TupRequestBuilder::createFrameRequest(k->currentFrame.scene, k->currentFrame.layer, k->currentFrame.frame + 1, TupProjectRequest::Add, tr("Frame %1").arg(k->currentFrame.frame + 2)); emit requestTriggered(&request); @@ -1051,7 +1200,6 @@ } if (svgCounter > 0) { - QString testFile = photograms.at(0).absoluteFilePath(); QFile file(testFile); file.close(); @@ -1072,7 +1220,6 @@ int answer = msgBox.exec(); if (answer == QMessageBox::Ok) { - QString directory = source.dirName(); k->libraryTree->createFolder(directory); @@ -1104,7 +1251,6 @@ QFile f(path); if (f.open(QIODevice::ReadOnly)) { - QByteArray data = f.readAll(); f.close(); @@ -1146,25 +1292,25 @@ void TupLibraryWidget::importSound() { - QString sound = QFileDialog::getOpenFileName(this, tr("Import audio file..."), QDir::homePath(), + QString path = QFileDialog::getOpenFileName(this, tr("Import audio file..."), QDir::homePath(), tr("Sound file") + " (*.ogg *.wav *.mp3)"); - if (sound.isEmpty()) + if (path.isEmpty()) return; - QFile f(sound); - QFileInfo fileInfo(f); - QString symName = fileInfo.baseName(); + QFile file(path); + QFileInfo fileInfo(file); + QString key = fileInfo.fileName().toLower(); - if (f.open(QIODevice::ReadOnly)) { - QByteArray data = f.readAll(); - f.close(); + if (file.open(QIODevice::ReadOnly)) { + QByteArray data = file.readAll(); + file.close(); - TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Add, symName, + TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Add, key, TupLibraryObject::Sound, k->project->spaceContext(), data); emit requestTriggered(&request); } else { - TOsd::self()->display(tr("Error"), tr("Cannot open file: %1").arg(sound), TOsd::Error); + TOsd::self()->display(tr("Error"), tr("Error while opening file: %1").arg(path), TOsd::Error); } } @@ -1229,7 +1375,9 @@ item->setIcon(0, QIcon(THEME_DIR + "icons/bitmap.png")); k->libraryTree->setCurrentItem(item); previewItem(item); - if (!k->isNetworked && k->project->spaceContext() != TupProject::NONE && !k->library->loadingProject()) + // if (!k->isNetworked && k->project->spaceContext() != TupProject::NONE && !k->library->loadingProject()) + + if (!k->isNetworked && !folderName.endsWith(".pgo") && !k->library->loadingProject()) insertObjectInWorkspace(); } break; @@ -1238,7 +1386,8 @@ item->setIcon(0, QIcon(THEME_DIR + "icons/svg.png")); k->libraryTree->setCurrentItem(item); previewItem(item); - if (!k->isNetworked && k->project->spaceContext() != TupProject::NONE && !k->library->loadingProject()) + // if (!k->isNetworked && k->project->spaceContext() != TupProject::NONE && !k->library->loadingProject()) + if (!k->isNetworked && !k->library->loadingProject()) insertObjectInWorkspace(); } break; @@ -1255,7 +1404,12 @@ } else { #ifdef K_DEBUG - tFatal() << "TupLibraryWidget::libraryResponse() - No object found: " << id; + QString msg = "TupLibraryWidget::libraryResponse() - No object found: " + id; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } @@ -1263,12 +1417,27 @@ case TupProjectRequest::InsertSymbolIntoFrame: { #ifdef K_DEBUG - tFatal() << "*** TupLibraryWidget::libraryResponse() -> InsertSymbolIntoFrame : No action taken"; + QString msg = "TupLibraryWidget::libraryResponse() -> InsertSymbolIntoFrame : No action taken"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } break; case TupProjectRequest::RemoveSymbolFromFrame: { + #ifdef K_DEBUG + QString msg = "TupLibraryWidget::libraryResponse() -> RemoveSymbolFromFrame : No action taken"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif + #endif + + /* QString id = response->arg().toString(); QTreeWidgetItemIterator it(k->libraryTree); @@ -1277,7 +1446,6 @@ if ((*it)->text(2).length() > 0) { if (id == (*it)->text(3)) { delete (*it); - // k->library->removeObject(id, true); break; } } else { @@ -1292,19 +1460,49 @@ } previewItem(k->libraryTree->currentItem()); + */ } break; case TupProjectRequest::Remove: { - #ifdef K_DEBUG - tFatal() << "*** TupLibraryWidget::libraryResponse() -> Remove : No action taken"; - #endif + QString id = response->arg().toString(); + + QTreeWidgetItemIterator it(k->libraryTree); + while ((*it)) { + // If target is not a folder + if ((*it)->text(2).length() > 0) { + if (id == (*it)->text(3)) { + delete (*it); + break; + } + } else { + // If target is a folder + if (id == (*it)->text(1)) { + delete (*it); + k->library->removeFolder(id); + break; + } + } + ++it; + } + + if (k->libraryTree->topLevelItemCount() > 0) { + previewItem(k->libraryTree->currentItem()); + } else { + k->display->showDisplay(); + k->display->reset(); + } } break; default: { #ifdef K_DEBUG - tFatal() << "*** TupLibraryWidget::libraryResponse() - Unknown/Unhandled project action: " << response->action(); + QString msg = "TupLibraryWidget::libraryResponse() - Unknown/Unhandled project action: " + QString::number(response->action()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } break; @@ -1320,7 +1518,7 @@ } } -void TupLibraryWidget::importGraphicObject() +void TupLibraryWidget::importLibraryObject() { QString option = k->itemType->currentText(); @@ -1343,6 +1541,11 @@ importSvgArray(); return; } + + if (option.compare(tr("Sound File")) == 0) { + importSound(); + return; + } } void TupLibraryWidget::refreshItem(QTreeWidgetItem *item) @@ -1368,12 +1571,15 @@ } item->setText(1, tag); + TupLibraryFolder *folder = new TupLibraryFolder(tag, k->project); k->library->addFolder(folder); QGraphicsTextItem *msg = new QGraphicsTextItem(tr("Directory")); k->display->render(static_cast(msg)); + k->editorItems << tag; + return; } @@ -1484,12 +1690,22 @@ executeSoftware(software, path); } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::callExternalEditor() - Fatal Error: No object related to the current library item -" << id << "- was found!"; + QString msg = "TupLibraryWidget::callExternalEditor() - Fatal Error: No object related to the current library item -" + id + "- was found!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::callExternalEditor() - Error: Current library item is invalid!"; + QString msg = "TupLibraryWidget::callExternalEditor() - Error: Current library item is invalid!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -1509,7 +1725,12 @@ k->watcher->addPath(path); } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::executeSoftware() - Fatal Error: Item path either doesn't exist or is empty"; + QString msg = "TupLibraryWidget::executeSoftware() - Fatal Error: Item path either doesn't exist or is empty"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -1525,7 +1746,12 @@ updateItem(object->smallId(), object->extension().toLower(), object); } else { #ifdef K_DEBUG - tError() << "TupLibraryWidget::updateItemFromSaveAction() - Fatal Error: The library item modified was not found!"; + QString msg = "TupLibraryWidget::updateItemFromSaveAction() - Fatal Error: The library item modified was not found!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -1657,7 +1883,12 @@ } else { name = TAlgorithm::randomString(8); #ifdef K_DEBUG - tWarning() << "TupLibraryWidget::verifyNameAvailability() - Warning: error while processing item name!"; + QString msg = "TupLibraryWidget::verifyNameAvailability() - Warning: error while processing item name!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } } else { @@ -1674,7 +1905,12 @@ } else { name = TAlgorithm::randomString(8); #ifdef K_DEBUG - tWarning() << "TupLibraryWidget::verifyNameAvailability() - Warning: error while processing item name!"; + QString msg = "TupLibraryWidget::verifyNameAvailability() - Warning: error while processing item name!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } } diff -Nru tupi-0.2+git04/src/components/library/tuplibrarywidget.h tupi-0.2+git05/src/components/library/tuplibrarywidget.h --- tupi-0.2+git04/src/components/library/tuplibrarywidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tuplibrarywidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,27 +36,59 @@ #ifndef TUPLIBRARYWIDGET_H #define TUPLIBRARYWIDGET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" -#include "tupitempreview.h" +#include "tuplibrarydisplay.h" #include "timagebutton.h" #include "tupitemmanager.h" #include "tupnewitemdialog.h" #include "tuplibraryobject.h" +#include "tapplication.h" +#include "toptionaldialog.h" +#include "tconfig.h" +#include "tuplibrary.h" +#include "tupproject.h" +#include "tupsymboleditor.h" +#include "tuprequestbuilder.h" +#include "tosd.h" +#include "talgorithm.h" #include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class TupLibrary; +#include +#include + +// class TupLibrary; typedef QMap LibraryObjects; /** * @author David Cuadrado */ -class TupLibraryWidget : public TupModuleWidgetBase +class TUPI_EXPORT TupLibraryWidget : public TupModuleWidgetBase { Q_OBJECT @@ -75,13 +107,13 @@ private slots: void previewItem(QTreeWidgetItem *item); void insertObjectInWorkspace(); - void removeCurrentGraphic(); + void removeCurrentItem(); void cloneObject(QTreeWidgetItem *item); void exportObject(QTreeWidgetItem *item); void createRasterObject(); void createVectorObject(); void renameObject(QTreeWidgetItem *item); - void importGraphicObject(); + void importLibraryObject(); void refreshItem(QTreeWidgetItem *item); void updateLibrary(QString node, QString target); void activeRefresh(QTreeWidgetItem *item); @@ -90,6 +122,7 @@ void openKritaToEdit(QTreeWidgetItem *item); void openMyPaintToEdit(QTreeWidgetItem *item); void updateItemFromSaveAction(); + void updateItemEditionState(); public slots: void addFolder(const QString &folderName = QString()); diff -Nru tupi-0.2+git04/src/components/library/tupnewitemdialog.cpp tupi-0.2+git05/src/components/library/tupnewitemdialog.cpp --- tupi-0.2+git04/src/components/library/tupnewitemdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupnewitemdialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,16 +34,6 @@ ***************************************************************************/ #include "tupnewitemdialog.h" -#include "talgorithm.h" -#include "tapplicationproperties.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include struct TupNewItemDialog::Private { diff -Nru tupi-0.2+git04/src/components/library/tupnewitemdialog.h tupi-0.2+git05/src/components/library/tupnewitemdialog.h --- tupi-0.2+git04/src/components/library/tupnewitemdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupnewitemdialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,23 @@ #ifndef TUPNEWITEMDIALOG_H #define TUPNEWITEMDIALOG_H +#include "tglobal.h" +#include "talgorithm.h" +#include "tapplicationproperties.h" + #include +#include +#include +#include +#include +#include +#include /** * @author Gustav Gonzalez **/ -class TupNewItemDialog : public QDialog +class TUPI_EXPORT TupNewItemDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/library/tupsoundplayer.cpp tupi-0.2+git05/src/components/library/tupsoundplayer.cpp --- tupi-0.2+git04/src/components/library/tupsoundplayer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupsoundplayer.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,179 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tupsoundplayer.h" + +struct TupSoundPlayer::Private +{ + QMediaPlayer *player; + QSlider *slider; + QLabel *timer; + TImageButton *playButton; + bool playing; + qint64 duration; + QTime soundTotalTime; + QString totalTime; +}; + +TupSoundPlayer::TupSoundPlayer(QWidget *parent) : QFrame(parent), k(new Private) +{ + setFrameStyle(QFrame::StyledPanel | QFrame::Raised); + setMidLineWidth(2); + setLineWidth(1); + + k->playing = false; + k->player = new QMediaPlayer; + connect(k->player, SIGNAL(positionChanged(qint64)), SLOT(positionChanged(qint64))); + connect(k->player, SIGNAL(durationChanged(qint64)), SLOT(durationChanged(qint64))); + connect(k->player, SIGNAL(stateChanged(QMediaPlayer::State)), SLOT(stateChanged(QMediaPlayer::State))); + + k->timer = new QLabel(""); + QBoxLayout *timerLayout = new QBoxLayout(QBoxLayout::LeftToRight); + timerLayout->addStretch(); + timerLayout->addWidget(k->timer); + timerLayout->addStretch(); + timerLayout->setContentsMargins(0, 0, 0, 0); + + k->slider = new QSlider(Qt::Horizontal, this); + // k->slider->setRange(0, k->player->duration() / 1000); + connect(k->slider, SIGNAL(sliderMoved(int)), this, SLOT(updateSoundPos(int))); + + QBoxLayout *sliderLayout = new QBoxLayout(QBoxLayout::LeftToRight); + sliderLayout->addWidget(k->slider); + sliderLayout->setContentsMargins(0, 0, 0, 0); + + k->playButton = new TImageButton(QPixmap(THEME_DIR + "icons/play_small.png"), 33, this, true); + k->playButton->setToolTip(tr("Play")); + connect(k->playButton, SIGNAL(clicked()), this, SLOT(playFile())); + + QBoxLayout *buttonLayout = new QBoxLayout(QBoxLayout::LeftToRight); + buttonLayout->addStretch(); + buttonLayout->addWidget(k->playButton); + buttonLayout->addStretch(); + buttonLayout->setContentsMargins(0, 0, 0, 0); + + QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, this); + layout->addSpacing(5); + layout->addLayout(timerLayout); + layout->addLayout(sliderLayout); + layout->addLayout(buttonLayout); + layout->addSpacing(5); + layout->setContentsMargins(5, 5, 5, 5); +} + +TupSoundPlayer::~TupSoundPlayer() +{ + delete k; +} + +QSize TupSoundPlayer::sizeHint() const +{ + return QWidget::sizeHint().expandedTo(QSize(100, 100)); +} + +void TupSoundPlayer::setSoundObject(const QString &path) +{ + k->player->setMedia(QUrl::fromLocalFile(path)); +} + +void TupSoundPlayer::playFile() +{ + if (!k->playing) { + k->playButton->setIcon(QIcon(QPixmap(THEME_DIR + "icons/pause.png"))); + k->playing = true; + k->player->setVolume(60); + + QString initTime = "00:00"; + if (k->duration > 3600) + initTime = "00:00:00"; + initTime = initTime + " / " + k->totalTime; + k->timer->setText(initTime); + + k->player->play(); + } else { + k->playButton->setIcon(QIcon(QPixmap(THEME_DIR + "icons/play_small.png"))); + k->playing = false; + k->player->pause(); + } +} + +void TupSoundPlayer::positionChanged(qint64 value) +{ + qint64 currentInfo = value / 1000; + k->slider->setValue(currentInfo); + QString time; + + if (currentInfo || k->duration) { + QTime currentTime((currentInfo/3600)%60, (currentInfo/60)%60, currentInfo%60, (currentInfo*1000)%1000); + QString format = "mm:ss"; + if (k->duration > 3600) + format = "hh:mm:ss"; + time = currentTime.toString(format) + " / " + k->totalTime; + } + + k->timer->setText(time); +} + +void TupSoundPlayer::durationChanged(qint64 value) +{ + qDebug() << "TupSoundPlayer::durationChanged() - value: " << value; + k->duration = value/1000; + k->slider->setMinimum(0); + k->slider->setMaximum(k->duration); + + k->soundTotalTime = QTime((k->duration/3600)%60, (k->duration/60)%60, k->duration%60, (k->duration*1000)%1000); + QString format = "mm:ss"; + if (k->duration > 3600) + format = "hh:mm:ss"; + k->totalTime = k->soundTotalTime.toString(format); +} + +void TupSoundPlayer::stateChanged(QMediaPlayer::State state) +{ + if (state == QMediaPlayer::StoppedState) { + k->slider->setValue(0); + k->playButton->setIcon(QIcon(QPixmap(THEME_DIR + "icons/play_small.png"))); + k->playing = false; + QString init = "00:00"; + if (k->duration > 3600) + init = "00:00:00"; + k->timer->setText(init + " / " + k->totalTime); + } +} + +void TupSoundPlayer::updateSoundPos(int pos) +{ + k->player->setPosition(pos*1000); +} diff -Nru tupi-0.2+git04/src/components/library/tupsoundplayer.h tupi-0.2+git05/src/components/library/tupsoundplayer.h --- tupi-0.2+git04/src/components/library/tupsoundplayer.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupsoundplayer.h 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,80 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPSOUNDPLAYER_H +#define TUPSOUNDPLAYER_H + +#include "tglobal.h" +#include "timagebutton.h" +#include "tapplicationproperties.h" + +#include +#include +#include +#include +#include +#include +#include + +/** + * @author Gustav Gonzalez +**/ + +class TUPI_EXPORT TupSoundPlayer : public QFrame +{ + Q_OBJECT + + public: + TupSoundPlayer(QWidget *parent); + ~TupSoundPlayer(); + + QSize sizeHint() const; + void setSoundObject(const QString &path); + + private slots: + void playFile(); + void positionChanged(qint64 value); + void durationChanged(qint64 value); + void stateChanged(QMediaPlayer::State state); + void updateSoundPos(int pos); + + private: + struct Private; + Private *const k; +}; + +#endif + + diff -Nru tupi-0.2+git04/src/components/library/tupsymboleditor.cpp tupi-0.2+git05/src/components/library/tupsymboleditor.cpp --- tupi-0.2+git04/src/components/library/tupsymboleditor.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupsymboleditor.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tupsymboleditor.h" -#include "tuplibraryobject.h" -#include "tuppluginmanager.h" -#include "tuptoolplugin.h" -// Tupi Framework -#include "taction.h" -#include "tdebug.h" - -#include -#include -#include -#include /** * This class defines the toolbar at the left side of the paint area. @@ -52,7 +41,7 @@ * @author David Cuadrado */ -class View : public QGraphicsView +class TUPI_EXPORT View : public QGraphicsView { public: View(); @@ -135,7 +124,12 @@ for (it = keys.begin(); it != keys.end(); ++it) { #ifdef K_DEBUG - tDebug("plugins") << "*** Tool Loaded: " << *it; + QString msg = "TupSymbolEditor::loadTools() - *** Tool Loaded: " + *it; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug("plugins") << msg; + #endif #endif TAction *act = tool->actions()[*it]; @@ -176,7 +170,11 @@ void TupSymbolEditor::selectTool() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupSymbolEditor::selectTool()]"; + #else + T_FUNCINFO; + #endif #endif TAction *action = qobject_cast(sender()); diff -Nru tupi-0.2+git04/src/components/library/tupsymboleditor.h tupi-0.2+git05/src/components/library/tupsymboleditor.h --- tupi-0.2+git04/src/components/library/tupsymboleditor.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tupsymboleditor.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,7 +36,17 @@ #ifndef TUPSYMBOLEDITOR_H #define TUPSYMBOLEDITOR_H +#include "tglobal.h" +#include "tuplibraryobject.h" +#include "tuppluginmanager.h" +#include "tuptoolplugin.h" +#include "taction.h" + #include +#include +#include +#include +#include class TupLibraryObject; @@ -44,7 +54,7 @@ * @author David Cuadrado */ -class TupSymbolEditor : public QMainWindow +class TUPI_EXPORT TupSymbolEditor : public QMainWindow { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/library/tuptreedelegate.cpp tupi-0.2+git05/src/components/library/tuptreedelegate.cpp --- tupi-0.2+git04/src/components/library/tuptreedelegate.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tuptreedelegate.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,9 +34,6 @@ ***************************************************************************/ #include "tuptreedelegate.h" -#include "tdebug.h" - -#include TupTreeDelegate::TupTreeDelegate(QObject *parent) : QItemDelegate(parent) { diff -Nru tupi-0.2+git04/src/components/library/tuptreedelegate.h tupi-0.2+git05/src/components/library/tuptreedelegate.h --- tupi-0.2+git04/src/components/library/tuptreedelegate.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/library/tuptreedelegate.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,14 @@ #ifndef TUPTREEDELEGATE_H #define TUPTREEDELEGATE_H +#include "tglobal.h" + #include #include +#include +#include -class TupTreeDelegate : public QItemDelegate +class TUPI_EXPORT TupTreeDelegate : public QItemDelegate { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/paintarea.pri tupi-0.2+git05/src/components/paintarea/paintarea.pri --- tupi-0.2+git04/src/components/paintarea/paintarea.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/paintarea.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,6 +1,13 @@ -INCLUDEPATH += /usr/include/QtMobility /usr/include/QtMultimediaKit +INCLUDEPATH += /usr/include/qt5/QtMultimedia /usr/include/qt5/QtMultimediaWidgets INCLUDEPATH += $$PAINTAREA_DIR -LIBS += -L$$PAINTAREA_DIR -ltupipaintarea -lQtMultimediaKit + +unix { + LIBS += -L$$PAINTAREA_DIR -ltupipaintarea +} + +win32 { + LIBS += -L$$PAINTAREA_DIR/release/ -ltupipaintarea +} linux-g++ { PRE_TARGETDEPS += $$PAINTAREA_DIR/libtupipaintarea.so diff -Nru tupi-0.2+git04/src/components/paintarea/paintarea.pro tupi-0.2+git05/src/components/paintarea/paintarea.pro --- tupi-0.2+git04/src/components/paintarea/paintarea.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/paintarea.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,12 +1,10 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/paintarea -# Target is a library: paintarea +QT += opengl core gui svg xml network +QT += multimedia multimediawidgets printsupport INSTALLS += target target.path = /lib/ -INCLUDEPATH += /usr/include/QtMobility /usr/include/QtMultimediaKit +INCLUDEPATH += /usr/include/qt5/QtMultimedia /usr/include/qt5/QtMultimediaWidgets macx { CONFIG += staticlib warn_on @@ -37,7 +35,9 @@ tupbasiccamerainterface.h \ tupcameradialog.h \ tupcamerawindow.h \ - tupvideosurface.h + tupvideosurface.h \ + tuppapagayoimporter.h \ + tuppapagayodialog.h SOURCES += tuppaintarea.cpp \ tupconfigurationarea.cpp \ @@ -64,7 +64,9 @@ tupbasiccamerainterface.cpp \ tupcameradialog.cpp \ tupcamerawindow.cpp \ - tupvideosurface.cpp + tupvideosurface.cpp \ + tuppapagayoimporter.cpp \ + tuppapagayodialog.cpp *:!macx{ CONFIG += dll warn_on @@ -73,15 +75,51 @@ TEMPLATE = lib TARGET = tupipaintarea +SHELL_DIR = ../../shell/ +INCLUDEPATH += $$SHELL_DIR + PLUGIN_DIR = ../../plugins/export/genericexportplugin INCLUDEPATH += $$PLUGIN_DIR -SELECTION_DIR = ../../plugins/tools/selecttool +SELECTION_DIR = ../../plugins/tools/selection INCLUDEPATH += $$SELECTION_DIR -POLYLINE_DIR = ../../plugins/tools/polylinetool +POLYLINE_DIR = ../../plugins/tools/polyline INCLUDEPATH += $$POLYLINE_DIR FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/paintarea/tupbasiccamerainterface.cpp tupi-0.2+git05/src/components/paintarea/tupbasiccamerainterface.cpp --- tupi-0.2+git04/src/components/paintarea/tupbasiccamerainterface.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupbasiccamerainterface.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,18 +34,6 @@ ***************************************************************************/ #include "tupbasiccamerainterface.h" -#include "tupapplication.h" -#include "tapplicationproperties.h" -#include "tseparator.h" -#include "talgorithm.h" -#include "tosd.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include struct TupBasicCameraInterface::Private { @@ -63,7 +51,11 @@ const QSize cameraSize, int counter, QWidget *parent) : QFrame(parent), k(new Private) { #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupBasicCameraInterface()]"; + #else TINIT; + #endif #endif setWindowTitle(tr("Tupi Camera Manager") + " | " + tr("Current resolution:") + " " + title); @@ -150,9 +142,16 @@ menuLayout->addWidget(devicesCombo); } + QPushButton *exitButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "exit.png")), ""); + exitButton->setIconSize(QSize(20, 20)); + exitButton->setToolTip(tr("Close manager")); + exitButton->setShortcut(Qt::Key_Escape); + connect(exitButton, SIGNAL(clicked()), this, SLOT(close())); + devicesCombo->setCurrentIndex(cameraIndex); menuLayout->addWidget(new TSeparator(Qt::Horizontal)); menuLayout->addWidget(clickButton); + menuLayout->addWidget(exitButton); menuLayout->addStretch(2); connect(devicesCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCameraDevice(int))); @@ -169,7 +168,11 @@ TupBasicCameraInterface::~TupBasicCameraInterface() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupBasicCameraInterface()]"; + #else + TEND; + #endif #endif } @@ -185,7 +188,12 @@ if (! dir.rmdir(dir.absolutePath())) { #ifdef K_DEBUG - tError() << "TupBasicCameraInterface::closeEvent() - Fatal Error: Can't remove pictures directory -> " << dir.absolutePath(); + QString msg = "TupBasicCameraInterface::closeEvent() - Fatal Error: Can't remove pictures directory -> " + dir.absolutePath(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } @@ -199,8 +207,14 @@ QDir dir; if (!dir.mkdir(path)) { #ifdef K_DEBUG - tError() << "TupBasicCameraInterface::randomPath() - Fatal Error: Can't create pictures directory -> " << path; + QString msg = "TupBasicCameraInterface::randomPath() - Fatal Error: Can't create pictures directory -> " + path; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + path = ""; TOsd::self()->display(tr("Error"), tr("Can't create pictures directory"), TOsd::Error); } diff -Nru tupi-0.2+git04/src/components/paintarea/tupbasiccamerainterface.h tupi-0.2+git05/src/components/paintarea/tupbasiccamerainterface.h --- tupi-0.2+git04/src/components/paintarea/tupbasiccamerainterface.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupbasiccamerainterface.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,26 @@ #ifndef TUPBASICCAMERAINTERFACE_H #define TUPBASICCAMERAINTERFACE_H +#include "tglobal.h" +#include "tupapplication.h" +#include "tapplicationproperties.h" +#include "tseparator.h" +#include "talgorithm.h" +#include "tosd.h" + #include #include #include #include #include #include +#include +#include +#include +#include +#include -class TupBasicCameraInterface : public QFrame +class TUPI_EXPORT TupBasicCameraInterface : public QFrame { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupbrushstatus.cpp tupi-0.2+git05/src/components/paintarea/tupbrushstatus.cpp --- tupi-0.2+git04/src/components/paintarea/tupbrushstatus.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupbrushstatus.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tupbrushstatus.h" -#include "tseparator.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include TupBrushStatus::TupBrushStatus(const QString &label, const QPixmap &pix, bool bg) { diff -Nru tupi-0.2+git04/src/components/paintarea/tupbrushstatus.h tupi-0.2+git05/src/components/paintarea/tupbrushstatus.h --- tupi-0.2+git04/src/components/paintarea/tupbrushstatus.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupbrushstatus.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,16 +36,21 @@ #ifndef TUPBRUSHSTATUS_H #define TUPBRUSHSTATUS_H +#include "tglobal.h" #include "tupcolorwidget.h" +#include "tseparator.h" #include #include #include #include +#include +#include +#include class TupColorWidget; -class TupBrushStatus : public QWidget +class TUPI_EXPORT TupBrushStatus : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupcameradialog.cpp tupi-0.2+git05/src/components/paintarea/tupcameradialog.cpp --- tupi-0.2+git04/src/components/paintarea/tupcameradialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcameradialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,19 +34,6 @@ ***************************************************************************/ #include "tupcameradialog.h" -#include "tapplicationproperties.h" -#include "tglobal.h" -#include "tconfig.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include - -#include struct TupCameraDialog::Private { @@ -148,8 +135,20 @@ k->deviceIndex = k->devicesCombo->currentIndex(); setCamera(k->cameraReference); - QCameraImageCapture *imageCapture = new QCameraImageCapture(k->camera); - k->resolutions = imageCapture->supportedResolutions(); + // QCameraImageCapture *imageCapture = new QCameraImageCapture(k->camera); + // k->resolutions = imageCapture->supportedResolutions(); + + k->resolutions.clear(); + k->resolutions << QSize(1280, 1024); + k->resolutions << QSize(1280, 960); + k->resolutions << QSize(1224, 768); + k->resolutions << QSize(800, 600); + k->resolutions << QSize(640, 480); + k->resolutions << QSize(352, 288); + k->resolutions << QSize(320, 240); + k->resolutions << QSize(176, 144); + k->resolutions << QSize(160, 120); + k->resolutionCombo->clear(); for (int i=0; iresolutions.size(); i++) { diff -Nru tupi-0.2+git04/src/components/paintarea/tupcameradialog.h tupi-0.2+git05/src/components/paintarea/tupcameradialog.h --- tupi-0.2+git04/src/components/paintarea/tupcameradialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcameradialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,11 +36,22 @@ #ifndef TUPCAMERADIALOG_H #define TUPCAMERADIALOG_H +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "tconfig.h" + #include #include +#include +#include +#include +#include +#include +#include #include +#include -class TupCameraDialog : public QDialog +class TUPI_EXPORT TupCameraDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupcamerainterface.cpp tupi-0.2+git05/src/components/paintarea/tupcamerainterface.cpp --- tupi-0.2+git04/src/components/paintarea/tupcamerainterface.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcamerainterface.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,22 +34,6 @@ ***************************************************************************/ #include "tupcamerainterface.h" -#include "tupcamerawindow.h" -#include "tupapplication.h" -#include "tapplicationproperties.h" -#include "tseparator.h" -#include "talgorithm.h" -#include "tosd.h" -#include "tupcolorwidget.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include struct TupCameraInterface::Private { @@ -69,7 +53,11 @@ const QSize cameraSize, int counter, QWidget *parent) : QFrame(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupCameraInterface()]"; + #else + TINIT; + #endif #endif setWindowTitle(tr("Tupi Camera Manager") + " | " + tr("Current resolution:") + " " + title); @@ -113,7 +101,12 @@ QByteArray device = cameraDevices.at(i); QCamera *camera = new QCamera(device); QCameraImageCapture *imageCapture = new QCameraImageCapture(camera); - QSize camSize = setBestResolution(imageCapture->supportedResolutions(), cameraSize); + + // QSize camSize = setBestResolution(imageCapture->supportedResolutions(), cameraSize); + + QList resolutions; + resolutions << QSize(640, 480); + QSize camSize = setBestResolution(resolutions, cameraSize); TupCameraWindow *cameraWindow = new TupCameraWindow(camera, camSize, displaySize, imageCapture, path); connect(cameraWindow, SIGNAL(pictureHasBeenSelected(int, const QString)), this, SIGNAL(pictureHasBeenSelected(int, const QString))); @@ -233,6 +226,12 @@ menuLayout->addWidget(devicesCombo); } + QPushButton *exitButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "exit.png")), ""); + exitButton->setIconSize(QSize(20, 20)); + exitButton->setToolTip(tr("Close manager")); + exitButton->setShortcut(Qt::Key_Escape); + connect(exitButton, SIGNAL(clicked()), this, SLOT(close())); + devicesCombo->setCurrentIndex(cameraIndex); menuLayout->addWidget(new TSeparator(Qt::Horizontal)); menuLayout->addWidget(clickButton); @@ -241,6 +240,7 @@ menuLayout->addWidget(k->gridWidget); menuLayout->addWidget(k->historyButton); menuLayout->addWidget(k->historyWidget); + menuLayout->addWidget(exitButton); menuLayout->addStretch(2); connect(devicesCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCameraDevice(int))); @@ -255,7 +255,11 @@ TupCameraInterface::~TupCameraInterface() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupCameraInterface()]"; + #else + TEND; + #endif #endif } @@ -286,8 +290,14 @@ QDir dir; if (!dir.mkdir(path)) { #ifdef K_DEBUG - tError() << "TupCameraInterface::randomPath() - Fatal Error: Can't create pictures directory -> " << path; + QString msg = "TupCameraInterface::randomPath() - Fatal Error: Can't create pictures directory -> " + path; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + path = ""; TOsd::self()->display(tr("Error"), tr("Can't create pictures directory"), TOsd::Error); } diff -Nru tupi-0.2+git04/src/components/paintarea/tupcamerainterface.h tupi-0.2+git05/src/components/paintarea/tupcamerainterface.h --- tupi-0.2+git04/src/components/paintarea/tupcamerainterface.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcamerainterface.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,30 @@ #ifndef TUPCAMERAINTERFACE_H #define TUPCAMERAINTERFACE_H +#include "tglobal.h" +#include "tupcamerawindow.h" +#include "tupapplication.h" +#include "tapplicationproperties.h" +#include "tseparator.h" +#include "talgorithm.h" +#include "tosd.h" +#include "tupcolorwidget.h" + #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -class TupCameraInterface : public QFrame +class TUPI_EXPORT TupCameraInterface : public QFrame { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupcamerawindow.cpp tupi-0.2+git05/src/components/paintarea/tupcamerawindow.cpp --- tupi-0.2+git04/src/components/paintarea/tupcamerawindow.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcamerawindow.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ #include "tupcamerawindow.h" -#include "tdebug.h" - -#include struct TupCameraWindow::Private { @@ -28,10 +25,10 @@ QMediaService *service = k->camera->service(); - QVideoEncoderControl *encoderControl = service->requestControl(); - QVideoEncoderSettings settings = encoderControl->videoSettings(); - settings.setResolution(camSize); - encoderControl->setVideoSettings(settings); + // QVideoEncoderControl *encoderControl = service->requestControl(); + // QVideoEncoderSettings settings = encoderControl->videoSettings(); + // settings.setResolution(camSize); + // encoderControl->setVideoSettings(settings); QVideoRendererControl *rendererControl = service->requestControl(); @@ -70,8 +67,13 @@ if (! dir.rmdir(dir.absolutePath())) { #ifdef K_DEBUG - tError() << "TupCameraInterface::closeEvent() - Fatal Error: Can't remove pictures directory -> " << dir.absolutePath(); - #endif + QString msg = "TupCameraInterface::closeEvent() - Fatal Error: Can't remove pictures directory -> " + dir.absolutePath(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } if (k->videoSurface) @@ -90,22 +92,22 @@ } case QCamera::CameraError: { - QMessageBox::warning(this, "TupCameraWindow", "General Camera error"); + QMessageBox::warning(this, "TupCameraWindow", tr("General Camera error")); break; } case QCamera::InvalidRequestError: { - QMessageBox::warning(this, "TupCameraWindow", "Camera invalid request error"); + QMessageBox::warning(this, "TupCameraWindow", tr("Camera invalid request error")); break; } case QCamera::ServiceMissingError: { - QMessageBox::warning(this, "TupCameraWindow", "Camera service missing error"); + QMessageBox::warning(this, "TupCameraWindow", tr("Camera service missing error")); break; } case QCamera::NotSupportedFeatureError : { - QMessageBox::warning(this, "TupCameraWindow", "Camera not supported error"); + QMessageBox::warning(this, "TupCameraWindow", tr("Camera not supported error")); break; } }; diff -Nru tupi-0.2+git04/src/components/paintarea/tupcamerawindow.h tupi-0.2+git05/src/components/paintarea/tupcamerawindow.h --- tupi-0.2+git04/src/components/paintarea/tupcamerawindow.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcamerawindow.h 2014-12-15 14:21:32.000000000 +0000 @@ -1,13 +1,16 @@ #ifndef TUPCAMERAWINDOW_H #define TUPCAMERAWINDOW_H +#include "tglobal.h" #include "tupvideosurface.h" #include +#include +#include #include #include -class TupCameraWindow: public QWidget, public VideoIF +class TUPI_EXPORT TupCameraWindow: public QWidget, public VideoIF { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupcanvas.cpp tupi-0.2+git05/src/components/paintarea/tupcanvas.cpp --- tupi-0.2+git04/src/components/paintarea/tupcanvas.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcanvas.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,33 +34,6 @@ ***************************************************************************/ #include "tupcanvas.h" -#include "tupapplication.h" -#include "tapplicationproperties.h" -#include "tuptoolplugin.h" -#include "timagebutton.h" -#include "tdebug.h" -#include "tuppendialog.h" -#include "tuponionopacitydialog.h" -#include "tupexposuredialog.h" -#include "tuptoolsdialog.h" -#include "tupinfowidget.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include struct TupCanvas::Private { @@ -84,11 +57,15 @@ }; TupCanvas::TupCanvas(QWidget *parent, Qt::WindowFlags flags, TupGraphicsScene *scene, - const QPointF centerPoint, const QSize &screenSize, TupProject *project, double scaleFactor, + const QPointF centerPoint, const QSize &screenSize, TupProject *project, qreal scaleFactor, int angle, TupBrushManager *brushManager, bool isNetworked, const QStringList &onLineUsers) : QFrame(parent, flags), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupCanvas()]"; + #else + TINIT; + #endif #endif setWindowTitle(tr("Tupi: Open 2D Magic")); @@ -152,9 +129,9 @@ zoomOut->setToolTip(tr("Zoom Out")); connect(zoomOut, SIGNAL(clicked()), this, SLOT(wakeUpZoomOut())); - TImageButton *hand = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 60, this, true); - hand->setToolTip(tr("Hand")); - connect(hand, SIGNAL(clicked()), this, SLOT(wakeUpHand())); + TImageButton *shift = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 60, this, true); + shift->setToolTip(tr("Shift")); + connect(shift, SIGNAL(clicked()), this, SLOT(wakeUpShift())); TImageButton *penProperties = new TImageButton(QPixmap(THEME_DIR + "icons/color_palette_big.png"), 60, this, true); penProperties->setToolTip(tr("Pen Properties")); @@ -177,7 +154,7 @@ controls->addWidget(trash); controls->addWidget(zoomIn); controls->addWidget(zoomOut); - controls->addWidget(hand); + controls->addWidget(shift); controls->addWidget(penProperties); controls->addWidget(exposure); @@ -222,6 +199,7 @@ void TupCanvas::closeEvent(QCloseEvent *event) { + delete graphicsView; event->accept(); } @@ -497,7 +475,8 @@ if (answer == QMessageBox::Yes) { pixmap = new QPixmap(); QString extension = fileInfo.suffix().toUpper(); - QByteArray ba = extension.toAscii(); + // QByteArray ba = extension.toAscii(); + QByteArray ba = extension.toLatin1(); const char* ext = ba.data(); if (pixmap->loadFromData(data, ext)) { QPixmap newpix; @@ -533,27 +512,23 @@ void TupCanvas::wakeUpZoomIn() { updateMenuStates(); - // emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ZoomInTool); + graphicsView->scale(1.3, 1.3); - foreach (QGraphicsView * view, k->scene->views()) { - view->scale(1 + 0.3, 1 + 0.3); - } + emit updateZoomFactorFromFullScreen(1.3); } void TupCanvas::wakeUpZoomOut() { updateMenuStates(); - // emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ZoomOutTool); + graphicsView->scale(0.7, 0.7); - foreach (QGraphicsView * view, k->scene->views()) { - view->scale(1 - 0.3, 1 - 0.3); - } + emit updateZoomFactorFromFullScreen(0.7); } -void TupCanvas::wakeUpHand() +void TupCanvas::wakeUpShift() { updateMenuStates(); - emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::HandTool); + emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ShiftTool); } void TupCanvas::undo() @@ -653,7 +628,7 @@ TupProjectRequest request = TupRequestBuilder::createLayerRequest(sceneIndex, layerIndex, TupProjectRequest::Add, tr("Layer %1").arg(layerIndex + 1)); emit requestTriggered(&request); - tError() << "TupCanvas::createLayer() - Creating layer at [ " << sceneIndex << ", " << layerIndex << " ]"; + // tError() << "TupCanvas::createLayer() - Creating layer at [ " << sceneIndex << ", " << layerIndex << " ]"; int oneRow = k->scene->framesTotal(); for(int i=0; i #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class TupGraphicsScene; +// class TupGraphicsScene; -class TupCanvas : public QFrame +class TUPI_EXPORT TupCanvas : public QFrame { Q_OBJECT public: TupCanvas(QWidget *parent=0, Qt::WindowFlags f=0, TupGraphicsScene *scene=0, const QPointF centerPoint = QPoint(0, 0) , const QSize &size = QSize(0, 0), - TupProject *project = 0, double scaleFactor = 1, int angle=0, + TupProject *project = 0, qreal scaleFactor = 1, int angle=0, TupBrushManager *brushManager = 0, bool isNetworked = false, const QStringList &onLineUsers = QStringList()); ~TupCanvas(); void updateCursor(const QCursor &cursor); @@ -96,7 +118,7 @@ void wakeUpDeleteSelection(); void wakeUpZoomIn(); void wakeUpZoomOut(); - void wakeUpHand(); + void wakeUpShift(); void undo(); void redo(); @@ -118,6 +140,7 @@ void updateColorFromFullScreen(const QColor &color); void updatePenThicknessFromFullScreen(int size); void updateOnionOpacityFromFullScreen(double opacity); + void updateZoomFactorFromFullScreen(qreal factor); void callAction(int menu, int index); void goToFrame(int frame, int layer, int scene); void goToScene(int scene); diff -Nru tupi-0.2+git04/src/components/paintarea/tupcanvas.pc.cpp tupi-0.2+git05/src/components/paintarea/tupcanvas.pc.cpp --- tupi-0.2+git04/src/components/paintarea/tupcanvas.pc.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcanvas.pc.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -38,9 +38,7 @@ #include "tapplicationproperties.h" #include "tuptoolplugin.h" #include "timagebutton.h" -#include "tglobal.h" #include "tconfig.h" -#include "tdebug.h" #include "tuppendialog.h" #include "tupexposuredialog.h" @@ -124,7 +122,7 @@ connect(objects, SIGNAL(clicked()), this, SLOT(wakeUpObjectSelection())); TImageButton *nodes = new TImageButton(QPixmap(THEME_DIR + "icons/nodes_big.png"), 40, this, true); - nodes->setToolTip(tr("Line Selection")); + nodes->setToolTip(tr("Nodes Selection")); connect(nodes, SIGNAL(clicked()), this, SLOT(wakeUpNodeSelection())); TImageButton *trash = new TImageButton(QPixmap(THEME_DIR + "icons/delete_big.png"), 40, this, true); @@ -139,9 +137,9 @@ zoomOut->setToolTip(tr("Zoom Out")); connect(zoomOut, SIGNAL(clicked()), this, SLOT(wakeUpZoomOut())); - TImageButton *hand = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true); - hand->setToolTip(tr("Hand")); - connect(hand, SIGNAL(clicked()), this, SLOT(wakeUpHand())); + TImageButton *shift = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true); + shift->setToolTip(tr("Shift")); + connect(shift, SIGNAL(clicked()), this, SLOT(wakeUpShift())); TImageButton *undo = new TImageButton(QPixmap(THEME_DIR + "icons/undo_big.png"), 40, this, true); undo->setToolTip(tr("Undo")); @@ -404,9 +402,9 @@ emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ZoomOutTool); } -void TupCanvas::wakeUpHand() +void TupCanvas::wakeUpShift() { - emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::HandTool); + emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ShiftTool); } void TupCanvas::undo() diff -Nru tupi-0.2+git04/src/components/paintarea/tupcanvas.tablet.cpp tupi-0.2+git05/src/components/paintarea/tupcanvas.tablet.cpp --- tupi-0.2+git04/src/components/paintarea/tupcanvas.tablet.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcanvas.tablet.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -33,14 +33,13 @@ * along with this program. If not, see . * ***************************************************************************/ +#include "tglobal.h" #include "tupcanvas.h" #include "tupapplication.h" #include "tapplicationproperties.h" #include "tuptoolplugin.h" #include "timagebutton.h" -#include "tglobal.h" #include "tconfig.h" -#include "tdebug.h" #include "tuppendialog.h" #include "tupexposuredialog.h" @@ -124,7 +123,7 @@ connect(objects, SIGNAL(clicked()), this, SLOT(wakeUpObjectSelection())); TImageButton *nodes = new TImageButton(QPixmap(THEME_DIR + "icons/nodes_big.png"), 40, this, true); - nodes->setToolTip(tr("Line Selection")); + nodes->setToolTip(tr("Nodes Selection")); connect(nodes, SIGNAL(clicked()), this, SLOT(wakeUpNodeSelection())); TImageButton *trash = new TImageButton(QPixmap(THEME_DIR + "icons/delete_big.png"), 40, this, true); @@ -139,9 +138,9 @@ zoomOut->setToolTip(tr("Zoom Out")); connect(zoomOut, SIGNAL(clicked()), this, SLOT(wakeUpZoomOut())); - TImageButton *hand = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true); - hand->setToolTip(tr("Hand")); - connect(hand, SIGNAL(clicked()), this, SLOT(wakeUpHand())); + TImageButton *shift = new TImageButton(QPixmap(THEME_DIR + "icons/hand_big.png"), 40, this, true); + shift->setToolTip(tr("Shift")); + connect(shift, SIGNAL(clicked()), this, SLOT(wakeUpShift())); TImageButton *undo = new TImageButton(QPixmap(THEME_DIR + "icons/undo_big.png"), 40, this, true); undo->setToolTip(tr("Undo")); @@ -405,9 +404,9 @@ emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ZoomOutTool); } -void TupCanvas::wakeUpHand() +void TupCanvas::wakeUpShift() { - emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::HandTool); + emit callAction(TupToolPlugin::ZoomMenu, TupToolPlugin::ShiftTool); } void TupCanvas::undo() diff -Nru tupi-0.2+git04/src/components/paintarea/tupcanvasview.cpp tupi-0.2+git05/src/components/paintarea/tupcanvasview.cpp --- tupi-0.2+git04/src/components/paintarea/tupcanvasview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcanvasview.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupcanvasview.h" -#include "tdebug.h" struct TupCanvasView::Private { @@ -46,6 +45,7 @@ TupCanvasView::TupCanvasView(QWidget *parent, const QSize &screenSize, const QSize &projectSize, const QColor &bg) : QGraphicsView(parent), k(new Private) { + setAccessibleName("FULL_SCREEN"); k->screenSize = screenSize; k->projectSize = projectSize; k->bg = bg; diff -Nru tupi-0.2+git04/src/components/paintarea/tupcanvasview.h tupi-0.2+git05/src/components/paintarea/tupcanvasview.h --- tupi-0.2+git04/src/components/paintarea/tupcanvasview.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcanvasview.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,6 +36,7 @@ #ifndef TUPCANVASVIEW_H #define TUPCANVASVIEW_H +#include "tglobal.h" #include "tuppaintareabase.h" #include @@ -43,7 +44,7 @@ #include #include -class TupCanvasView : public QGraphicsView +class TUPI_EXPORT TupCanvasView : public QGraphicsView { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupcolorwidget.cpp tupi-0.2+git05/src/components/paintarea/tupcolorwidget.cpp --- tupi-0.2+git04/src/components/paintarea/tupcolorwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcolorwidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,9 +34,6 @@ ***************************************************************************/ #include "tupcolorwidget.h" -#include "tdebug.h" - -#include /** * This class defines the options panel in the bottom of the paint area. diff -Nru tupi-0.2+git04/src/components/paintarea/tupcolorwidget.h tupi-0.2+git05/src/components/paintarea/tupcolorwidget.h --- tupi-0.2+git04/src/components/paintarea/tupcolorwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupcolorwidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,13 @@ #ifndef TUPPAINTAREASTATUS_H #define TUPPAINTAREASTATUS_H +#include "tglobal.h" + #include #include #include #include +#include /** * This class defines the options panel in the bottom of the paint area. @@ -47,7 +50,7 @@ * @author David Cuadrado */ -class TupColorWidget : public QWidget +class TUPI_EXPORT TupColorWidget : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupconfigurationarea.cpp tupi-0.2+git05/src/components/paintarea/tupconfigurationarea.cpp --- tupi-0.2+git04/src/components/paintarea/tupconfigurationarea.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupconfigurationarea.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,21 +34,6 @@ ***************************************************************************/ #include "tupconfigurationarea.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include struct TupConfigurationArea::Private { @@ -112,13 +97,22 @@ void TupConfigurationArea::shrink() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupConfigurationArea::shrink()]"; + #else + T_FUNCINFO; + #endif #endif QMainWindow *mainWindow = dynamic_cast(parentWidget()); if (!mainWindow || !widget()) { #ifdef K_DEBUG - tError() << "TupConfigurationArea::shrink() - Fatal error!"; + QString msg = "TupConfigurationArea::shrink() - Fatal error!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -198,8 +192,16 @@ QPoint(x2, y2), Qt::LeftButton, 0, 0); - if (! QApplication::sendEvent(mainWindow, &move)) - qWarning("Fail moving"); + if (! QApplication::sendEvent(mainWindow, &move)) { + #ifdef K_DEBUG + QString msg = "TupConfigurationArea::shrink() - Error while moving!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + } qApp->processEvents(); @@ -207,8 +209,16 @@ QPoint(xRelease, yRelease), Qt::LeftButton, 0, 0); - if (! QApplication::sendEvent(mainWindow, &release)) - qWarning("Fail releasing"); + if (! QApplication::sendEvent(mainWindow, &release)) { + #ifdef K_DEBUG + QString msg = "TupConfigurationArea::shrink() - Error while releasing!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + } qApp->processEvents(); mainWindow->setMouseTracking(hmt); diff -Nru tupi-0.2+git04/src/components/paintarea/tupconfigurationarea.h tupi-0.2+git05/src/components/paintarea/tupconfigurationarea.h --- tupi-0.2+git04/src/components/paintarea/tupconfigurationarea.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupconfigurationarea.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,15 +36,28 @@ #ifndef TCONFIGURATIONAREA_H #define TCONFIGURATIONAREA_H -#include +#include "tglobal.h" -class QPushButton; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TupConfigurationArea : public QDockWidget +class TUPI_EXPORT TupConfigurationArea : public QDockWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupdocumentruler.cpp tupi-0.2+git05/src/components/paintarea/tupdocumentruler.cpp --- tupi-0.2+git04/src/components/paintarea/tupdocumentruler.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupdocumentruler.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tupdocumentruler.h" -#include "tdebug.h" - -#include -using namespace std; - -#include struct TupDocumentRuler::Private { diff -Nru tupi-0.2+git04/src/components/paintarea/tupdocumentruler.h tupi-0.2+git05/src/components/paintarea/tupdocumentruler.h --- tupi-0.2+git04/src/components/paintarea/tupdocumentruler.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupdocumentruler.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,18 @@ #ifndef TUPDOCUMENTRULER_H #define TUPDOCUMENTRULER_H +#include "tglobal.h" #include "trulerbase.h" +#include +#include +using namespace std; + /** * @author Jorge Cuadrado */ -class TupDocumentRuler : public TRulerBase +class TUPI_EXPORT TupDocumentRuler : public TRulerBase { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupdocumentview.cpp tupi-0.2+git05/src/components/paintarea/tupdocumentview.cpp --- tupi-0.2+git04/src/components/paintarea/tupdocumentview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupdocumentview.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -35,11 +35,7 @@ #include "tupdocumentview.h" #include "tupapplication.h" - -// Tupi Framework -#include "tdebug.h" #include "tconfig.h" - #include "tuprequestbuilder.h" #include "tuppaintareaproperties.h" #include "tuppluginmanager.h" @@ -49,14 +45,13 @@ #include "tuppaintareaevent.h" #include "tuppaintareacommand.h" #include "tupgraphicsscene.h" - #include "tupbrushmanager.h" #include "tupproject.h" #include "tupscene.h" #include "tuplayer.h" #include "tuppaintareastatus.h" #include "tupcanvas.h" -#include "polyline.h" +#include "polylinetool.h" #include "tupimagedialog.h" #include "tupstoryboarddialog.h" #include "tupruler.h" @@ -64,31 +59,8 @@ #include "tupbasiccamerainterface.h" #include "tupcameradialog.h" #include "tuplibrary.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include "tuppapagayoimporter.h" +#include "tuppapagayodialog.h" /** * This class defines all the environment for the Ilustration interface. @@ -99,15 +71,8 @@ struct TupDocumentView::Private { QSize wsDimension; - QActionGroup *gridGroup; - QActionGroup *editGroup; - QActionGroup *viewNextGroup; - QActionGroup *viewZoomGroup; - QActionGroup *viewPreviousGroup; - QMenu *brushesMenu; - QMenu *selectionMenu; - QMenu *fillMenu; - QMenu *viewToolMenu; + + QMenu *shapesMenu; QMenu *motionMenu; QMenu *filterMenu; @@ -120,7 +85,6 @@ QToolBar *toolbar; QToolBar *propertiesBar; - QDoubleSpinBox *zoomFactorSpin; QDoubleSpinBox *onionFactorSpin; QSpinBox *prevOnionSkinSpin; QSpinBox *nextOnionSkinSpin; @@ -157,12 +121,29 @@ QTimer *timer; TupExportInterface *imagePlugin; + + qreal nodesScaleFactor; + qreal cacheScaleFactor; + + TAction *pencilAction; + TAction *inkAction; + TAction *polyLineAction; + TAction *selectionAction; + TAction *nodesAction; + TAction *borderFillAction; + TAction *fillAction; + TAction *shiftAction; + TAction *papagayoAction; }; TupDocumentView::TupDocumentView(TupProject *project, QWidget *parent, bool isNetworked, const QStringList &users) : QMainWindow(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupDocumentView()]"; + #else + TINIT; + #endif #endif setWindowIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "animation_mode.png")); @@ -176,6 +157,7 @@ k->onLineUsers = users; k->dynamicFlag = false; k->photoCounter = 1; + k->nodesScaleFactor = 1; k->actionManager = new TActionManager(this); @@ -199,9 +181,11 @@ layout->addWidget(k->horizontalRuler, 0, 1); layout->addWidget(k->verticalRuler, 1, 0); - connect(k->paintArea, SIGNAL(scaled(double)), this, SLOT(updateScaleVars(double))); + connect(k->paintArea, SIGNAL(scaled(qreal)), this, SLOT(updateZoomVars(qreal))); connect(k->paintArea, SIGNAL(rotated(int)), this, SLOT(updateRotationVars(int))); connect(k->paintArea, SIGNAL(updateStatusBgColor(QColor)), this, SLOT(updateStatusBgColor(QColor))); + connect(k->paintArea, SIGNAL(zoomIn()), this, SLOT(applyZoomIn())); + connect(k->paintArea, SIGNAL(zoomOut()), this, SLOT(applyZoomOut())); Tupi::RenderType renderType = Tupi::RenderType(TCONFIG->value("RenderType").toInt()); @@ -216,7 +200,12 @@ default: #ifdef K_DEBUG - tWarning() << "Unsopported render, switching to native!"; + QString msg = "TupDocumentView() - Unsopported render, switching to native!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif k->paintArea->setUseOpenGL(false); break; @@ -234,7 +223,7 @@ setupDrawActions(); - createTools(); + createLateralToolBar(); createToolBar(); k->status = new TupPaintAreaStatus(this); @@ -250,7 +239,8 @@ connect(k->paintArea->brushManager(), SIGNAL(penChanged(const QPen&)), k->status, SLOT(setPen(const QPen &))); - QTimer::singleShot(1000, this, SLOT(loadPlugins())); + // SQA: Find out why this timer instruction is required? + QTimer::singleShot(500, this, SLOT(loadPlugins())); // SQA: Temporarily disabled // if (!k->isNetworked) @@ -260,7 +250,11 @@ TupDocumentView::~TupDocumentView() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupDocumentView()]"; + #else + TEND; + #endif #endif TCONFIG->beginGroup("General"); @@ -331,21 +325,56 @@ k->status->updateRotationAngle(angle); } -void TupDocumentView::setZoom(qreal factor) +void TupDocumentView::setZoomFactor(qreal factor) { k->paintArea->setZoom(factor); k->verticalRuler->setRulerZoom(factor); k->horizontalRuler->setRulerZoom(factor); + updateNodesScale(factor); +} + +void TupDocumentView::updateZoomVars(qreal factor) +{ + k->status->updateZoomFactor(factor); + k->verticalRuler->setRulerZoom(factor); + k->horizontalRuler->setRulerZoom(factor); + + updateNodesScale(factor); +} + +void TupDocumentView::applyZoomIn() +{ + qreal zoom = k->status->currentZoomFactor(); + if (zoom <= 495) { + zoom += 5; + k->status->setZoomPercent(QString::number(zoom)); + } +} + +void TupDocumentView::applyZoomOut() +{ + qreal zoom = k->status->currentZoomFactor(); + if (zoom >= 15) { + zoom -= 5; + k->status->setZoomPercent(QString::number(zoom)); + } +} + +void TupDocumentView::updateNodesScale(qreal factor) +{ if (k->currentTool) { - if (k->currentTool->name().compare(tr("Object Selection")) == 0) - k->currentTool->resizeNodes(factor); + k->nodesScaleFactor *= factor; + QString toolName = k->currentTool->name(); + if (toolName.compare(tr("Object Selection")) == 0 || toolName.compare(tr("Nodes Selection")) == 0 || toolName.compare(tr("PolyLine")) == 0) + k->currentTool->resizeNodes(1 / k->nodesScaleFactor); } } -void TupDocumentView::setZoomView(const QString &percent) +void TupDocumentView::setZoomPercent(const QString &percent) { - k->status->setZoomFactor(percent); + k->nodesScaleFactor = percent.toDouble() / 100; + k->status->setZoomPercent(percent); } void TupDocumentView::showPos(const QPointF &point) @@ -367,15 +396,19 @@ new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "delete.png"), tr("Delete"), QKeySequence(Qt::Key_Delete), k->paintArea, SLOT(deleteItems()), k->actionManager, "delete"); - + + /* TAction *group = new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "group.png"), tr("&Group"), QKeySequence(tr("Ctrl+G")), - k->paintArea, SLOT(groupItems()), k->actionManager, "group"); + k->paintArea, SLOT(groupItems()), k->actionManager, "group"); + // SQA: Enabled just for initial development group->setDisabled(true); TAction *ungroup = new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "ungroup.png"), tr("&Ungroup"), QKeySequence(tr("Ctrl+Shift+G")) , k->paintArea, SLOT(ungroupItems()), k->actionManager, "ungroup"); + // SQA: Enabled just for initial development ungroup->setDisabled(true); + */ new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "layer.png"), tr("Onion Skin"), QKeySequence(tr("Ctrl+Shift+O")), this, SLOT(enableOnionFeature()), k->actionManager, "onion"); @@ -397,11 +430,21 @@ new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "storyboard.png"), tr("Storyboard Settings"), QKeySequence(tr("Ctrl+Shift+S")), this, SLOT(storyboardSettings()), k->actionManager, "storyboard"); - new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "camera.png"), tr("Camera"), QKeySequence(tr("Ctrl+Shift+C")), - this, SLOT(cameraInterface()), k->actionManager, "camera"); + #ifdef Q_OS_WIN32 + if (QSysInfo::windowsVersion() != QSysInfo::WV_XP) { + new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "camera.png"), tr("Camera"), QKeySequence(tr("Ctrl+Shift+C")), + this, SLOT(cameraInterface()), k->actionManager, "camera"); + } + #else + new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "camera.png"), tr("Camera"), QKeySequence(tr("Ctrl+Shift+C")), + this, SLOT(cameraInterface()), k->actionManager, "camera"); + #endif + + new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "papagayo.png"), tr("Papagayo Lip-sync Files"), QKeySequence(tr("Ctrl+Shift+P")), + this, SLOT(papagayoManager()), k->actionManager, "papagayo"); } -void TupDocumentView::createTools() +void TupDocumentView::createLateralToolBar() { k->toolbar = new QToolBar(tr("Draw tools"), this); k->toolbar->setIconSize(QSize(16, 16)); @@ -410,39 +453,14 @@ connect(k->toolbar, SIGNAL(actionTriggered(QAction *)), this, SLOT(selectToolFromMenu(QAction *))); // Brushes menu - k->brushesMenu = new QMenu(tr("Brushes"), k->toolbar); - k->brushesMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "brush.png")); - connect(k->brushesMenu, SIGNAL(triggered(QAction *)), this, SLOT(selectToolFromMenu(QAction*))); - - k->toolbar->addAction(k->brushesMenu->menuAction()); - - // Selection menu - k->selectionMenu = new QMenu(tr("Selection"), k->toolbar); - k->selectionMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "selection.png")); - connect(k->selectionMenu, SIGNAL(triggered(QAction*)), this, SLOT(selectToolFromMenu(QAction*))); - - k->toolbar->addAction(k->selectionMenu->menuAction()); - - // Fill menu - k->fillMenu = new QMenu(tr("Fill"), k->toolbar); - k->fillMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "fillcolor.png")); - connect(k->fillMenu, SIGNAL(triggered(QAction *)), this, SLOT(selectToolFromMenu(QAction*))); - - k->toolbar->addAction(k->fillMenu->menuAction()); - - // View menu - k->viewToolMenu = new QMenu(tr("View"), k->toolbar); - k->viewToolMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "zoom.png")); - connect(k->fillMenu, SIGNAL(triggered(QAction *)), this, SLOT(selectToolFromMenu(QAction*))); - - k->toolbar->addAction(k->viewToolMenu->menuAction()); + k->shapesMenu = new QMenu(tr("Brushes"), k->toolbar); + k->shapesMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "square.png")); + connect(k->shapesMenu, SIGNAL(triggered(QAction *)), this, SLOT(selectToolFromMenu(QAction*))); // Motion Tween menu k->motionMenu = new QMenu(tr("Tweening"), k->toolbar); k->motionMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "tweening.png")); connect(k->motionMenu, SIGNAL(triggered(QAction *)), this, SLOT(selectToolFromMenu(QAction*))); - - k->toolbar->addAction(k->motionMenu->menuAction()); } void TupDocumentView::loadPlugins() @@ -452,6 +470,15 @@ if (plugin) { TupExportInterface *exporter = qobject_cast(plugin); if (exporter) { + #ifdef K_DEBUG + QString msg = "TupDocumentView::loadPlugins() - plugin: " + exporter->key(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + if (exporter->key().compare(tr("Image Array")) == 0) { k->imagePlugin = exporter; imagePluginLoaded = true; @@ -463,19 +490,22 @@ if (!imagePluginLoaded) { #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugins() - Fatal Error: Couldn't found the \"Image Array\" plugin!"; + QString msg = "TupDocumentView::loadPlugins() - Warning: Couldn't found plugin -> " + tr("Image Array"); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } - QVector brushTools(8); + QVector brushTools(3); QVector tweenTools(7); - TAction *pencil = 0; - foreach (QObject *plugin, TupPluginManager::instance()->tools()) { TupToolPlugin *tool = qobject_cast(plugin); - if (tool->toolType() != TupToolInterface::Tweener) { + if (tool->toolType() != TupToolInterface::Tweener && tool->toolType() != TupToolInterface::LipSync) { connect(tool, SIGNAL(closeHugeCanvas()), this, SLOT(closeFullScreen())); connect(tool, SIGNAL(callForPlugin(int, int)), this, SLOT(loadPlugin(int, int))); } @@ -485,13 +515,18 @@ for (it = keys.begin(); it != keys.end(); ++it) { #ifdef K_DEBUG - tWarning() << "TupDocumentView::loadPlugins() - Tool Loaded: " << *it; + QString msg = "TupDocumentView::loadPlugins() - Tool Loaded: " + *it; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif TAction *action = tool->actions()[*it]; - action->setIconVisibleInMenu(true); if (action) { + action->setIconVisibleInMenu(true); connect(action, SIGNAL(triggered()), this, SLOT(selectTool())); action->setParent(plugin); QString toolName = action->text(); @@ -499,7 +534,7 @@ switch (tool->toolType()) { case TupToolInterface::Brush: { - // SQA: Experimental plugin (disabled) + // SQA: Experimental plugin (enable it only for testing) /* if (toolName.compare(tr("Scheme")) == 0) { action->setDisabled(true); @@ -507,41 +542,49 @@ } */ - if (toolName.compare(tr("Pencil")) == 0) { - brushTools[0] = action; - pencil = action; - k->brushesMenu->setDefaultAction(action); - } + if (toolName.compare(tr("Pencil")) == 0) + k->pencilAction = action; - if (toolName.compare(tr("Ink")) == 0) { - brushTools[1] = action; - } + if (toolName.compare(tr("Ink")) == 0) + k->inkAction = action; + // SQA: This code has been disabled temporarily + /* if (toolName.compare(tr("Eraser")) == 0) { action->setDisabled(true); brushTools[2] = action; } + */ if (toolName.compare(tr("PolyLine")) == 0) { - brushTools[3] = action; + k->polyLineAction = action; TupToolPlugin *tool = qobject_cast(action->parent()); connect(k->paintArea, SIGNAL(closePolyLine()), tool, SLOT(initEnv())); connect(this, SIGNAL(closePolyLine()), tool, SLOT(initEnv())); } - if (toolName.compare(tr("Line")) == 0) - brushTools[4] = action; + if (toolName.compare(tr("Line")) == 0) { + brushTools[2] = action; + TupToolPlugin *tool = qobject_cast(action->parent()); + connect(k->paintArea, SIGNAL(closeLine()), tool, SLOT(endItem())); + connect(this, SIGNAL(closeLine()), tool, SLOT(endItem())); + } - if (toolName.compare(tr("Rectangle")) == 0) - brushTools[5] = action; + if (toolName.compare(tr("Rectangle")) == 0) { + brushTools[0] = action; + k->shapesMenu->setDefaultAction(action); + } if (toolName.compare(tr("Ellipse")) == 0) - brushTools[6] = action; + brushTools[1] = action; + // SQA: This code has been disabled temporarily + /* if (toolName.compare(tr("Text")) == 0) { action->setDisabled(true); brushTools[7] = action; } + */ } break; case TupToolInterface::Tweener: @@ -552,99 +595,130 @@ } if (toolName.compare(tr("Rotation Tween")) == 0) - // action->setDisabled(true); tweenTools[1] = action; - if (toolName.compare(tr("Scale Tween")) == 0) { - // action->setDisabled(true); + if (toolName.compare(tr("Scale Tween")) == 0) tweenTools[2] = action; - } - if (toolName.compare(tr("Shear Tween")) == 0) { - // action->setDisabled(true); + if (toolName.compare(tr("Shear Tween")) == 0) tweenTools[3] = action; - } - if (toolName.compare(tr("Opacity Tween")) == 0) { - // action->setDisabled(true); + if (toolName.compare(tr("Opacity Tween")) == 0) tweenTools[4] = action; - } - if (toolName.compare(tr("Coloring Tween")) == 0) { - // action->setDisabled(true); + if (toolName.compare(tr("Coloring Tween")) == 0) tweenTools[5] = action; - } - if (toolName.compare(tr("Compound Tween")) == 0) { + if (toolName.compare(tr("Compound Tween")) == 0) action->setDisabled(true); tweenTools[6] = action; - } } break; case TupToolInterface::Selection: { - k->selectionMenu->addAction(action); if (toolName.compare(tr("Object Selection")) == 0) - k->selectionMenu->setDefaultAction(action); + k->selectionAction = action; + + if (toolName.compare(tr("Nodes Selection")) == 0) + k->nodesAction = action; } break; case TupToolInterface::Fill: { - k->fillMenu->addAction(action); if (toolName.compare(tr("Internal fill")) == 0) - k->fillMenu->setDefaultAction(action); + k->fillAction = action; + + if (toolName.compare(tr("Line fill")) == 0) + k->borderFillAction = action; } break; case TupToolInterface::View: { - k->viewToolMenu->addAction(action); - if (toolName.compare(tr("Zoom In")) == 0) - k->viewToolMenu->setDefaultAction(action); - + if (toolName.compare(tr("Shift")) == 0) + k->shiftAction = action; + } + break; + case TupToolInterface::LipSync: + { + if (toolName.compare(tr("Papagayo Lip-sync")) == 0) + k->papagayoAction = action; } break; default: break; } + } else { + #ifdef K_DEBUG + QString msg = "TupDocumentView::loadPlugins() - Fatal Error: Tool action is NULL -> " + *it; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } } // end foreach - for (int i = 0; i < brushTools.size(); ++i) { - k->brushesMenu->addAction(brushTools.at(i)); - } + for (int i = 0; i < brushTools.size(); ++i) + k->shapesMenu->addAction(brushTools.at(i)); for (int i = 0; i < tweenTools.size(); ++i) k->motionMenu->addAction(tweenTools.at(i)); foreach (QObject *plugin, TupPluginManager::instance()->filters()) { - AFilterInterface *filter = qobject_cast(plugin); + AFilterInterface *filterInterface = qobject_cast(plugin); QStringList::iterator it; - QStringList keys = filter->keys(); + QStringList keys = filterInterface->keys(); for (it = keys.begin(); it != keys.end(); ++it) { #ifdef K_DEBUG - tDebug("plugins") << "*** Filter Loaded: " << *it; + QString msg = "TupDocumentView::loadPlugins() - Filter Loaded: " + *it; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug("plugins") << msg; + #endif #endif - TAction *act = filter->actions()[*it]; - if (act) { - connect(act, SIGNAL(triggered()), this, SLOT(applyFilter())); - k->filterMenu->addAction(act); + TAction *filter = filterInterface->actions()[*it]; + if (filter) { + connect(filter, SIGNAL(triggered()), this, SLOT(applyFilter())); + k->filterMenu->addAction(filter); } } } + k->toolbar->addAction(k->pencilAction); + k->toolbar->addAction(k->inkAction); + k->toolbar->addAction(k->polyLineAction); + k->toolbar->addSeparator(); + k->toolbar->addAction(k->shapesMenu->menuAction()); + k->toolbar->addSeparator(); + k->toolbar->addAction(k->selectionAction); + k->toolbar->addAction(k->nodesAction); + k->toolbar->addSeparator(); + k->toolbar->addAction(k->fillAction); + k->toolbar->addAction(k->borderFillAction); + k->toolbar->addSeparator(); + k->toolbar->addAction(k->shiftAction); + k->toolbar->addSeparator(); + k->toolbar->addAction(k->motionMenu->menuAction()); + brushTools.clear(); tweenTools.clear(); - pencil->trigger(); + k->pencilAction->trigger(); } void TupDocumentView::loadPlugin(int menu, int index) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupDocumentView::loadPlugin()]"; + #else + T_FUNCINFO; + #endif #endif TAction *action = 0; @@ -675,64 +749,86 @@ break; case TupToolPlugin::BrushesMenu: { - QList brushActions = k->brushesMenu->actions(); - if (index < brushActions.size()) { - action = (TAction *) brushActions[index]; - } else { - #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugin() - Error: Invalid Brush Index / No plugin loaded"; - #endif - return; + QList brushActions = k->shapesMenu->actions(); + + switch (index) { + case TupToolPlugin::PencilTool: + { + action = k->pencilAction; + } + break; + case TupToolPlugin::InkTool: + { + action = k->inkAction; + } + break; + case TupToolPlugin::PolyLineTool: + { + action = k->polyLineAction; + } + break; + case TupToolPlugin::RectangleTool: + { + action = (TAction *) brushActions[0]; + } + break; + case TupToolPlugin::EllipseTool: + { + action = (TAction *) brushActions[1]; + } + break; + case TupToolPlugin::LineTool: + { + action = (TAction *) brushActions[2]; + } + break; } } break; case TupToolPlugin::SelectionMenu: { - if (index == TupToolPlugin::Delete) { - k->paintArea->deleteItems(); - } else { - QList selectionActions = k->selectionMenu->actions(); - if (index < selectionActions.size()) { - action = (TAction *) selectionActions[index]; - } else { - #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugin() - Error: Invalid Selection Index / No plugin loaded"; - #endif - return; + switch (index) { + case TupToolPlugin::Delete: + { + k->paintArea->deleteItems(); + } + break; + case TupToolPlugin::NodesTool: + { + action = k->nodesAction; } + break; + case TupToolPlugin::ObjectsTool: + { + action = k->selectionAction; + } + break; } } break; case TupToolPlugin::FillMenu: { - QList fillActions = k->fillMenu->actions(); - if (index < fillActions.size()) { - action = (TAction *) fillActions[index]; - } else { - #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugin() - Error: Invalid Fill Index / No plugin loaded"; - #endif - return; - } + if (index == TupToolPlugin::InsideTool) + action = k->fillAction; + + if (index == TupToolPlugin::ContourTool) + action = k->borderFillAction; } break; case TupToolPlugin::ZoomMenu: { - QList viewActions = k->viewToolMenu->actions(); - if (index < viewActions.size()) { - action = (TAction *) viewActions[index]; - } else { - #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugin() - Error: Invalid Zoom Index (" << index << ") / No plugin loaded"; - #endif - return; - } + action = k->shiftAction; } break; default: { #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugin() - Error: Invalid Menu Index / No plugin loaded"; + QString msg = "TupDocumentView::loadPlugin() - Error: Invalid Menu Index / No plugin loaded"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -742,14 +838,7 @@ if (action) { QString toolName = tr("%1").arg(action->text()); - if (index == TupToolPlugin::ZoomInTool || index == TupToolPlugin::ZoomOutTool) { - if (k->fullScreenOn) { - action->trigger(); - k->fullScreen->updateCursor(action->cursor()); - TupToolPlugin *tool = qobject_cast(action->parent()); - tool->autoZoom(); - } - } else if (toolName.compare(k->currentTool->name()) != 0) { + if (toolName.compare(k->currentTool->name()) != 0) { if (k->fullScreenOn) { action->trigger(); k->fullScreen->updateCursor(action->cursor()); @@ -757,7 +846,12 @@ } } else { #ifdef K_DEBUG - tError() << "TupDocumentView::loadPlugin() - Error: Action pointer is NULL!"; + QString msg = "TupDocumentView::loadPlugin() - Error: Action pointer is NULL!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -766,7 +860,11 @@ void TupDocumentView::selectTool() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupDocumentView::selectTool()]"; + #else + T_FUNCINFO; + #endif #endif TAction *action = qobject_cast(sender()); @@ -797,42 +895,33 @@ switch (tool->toolType()) { case TupToolInterface::Brush: k->status->enableFullScreenFeature(true); - if (toolName.compare(tr("Pencil"))==0) { + if (toolName.compare(tr("Pencil"))==0 || toolName.compare(tr("PolyLine"))==0) { minWidth = 130; } else if (toolName.compare(tr("Text"))==0) { minWidth = 350; - } else if (toolName.compare(tr("PolyLine"))==0 - || toolName.compare(tr("Rectangle"))==0 - || toolName.compare(tr("Ellipse"))==0) { - minWidth = 130; - } + } - k->brushesMenu->setDefaultAction(action); - k->brushesMenu->setActiveAction(action); - if (!action->icon().isNull()) - k->brushesMenu->menuAction()->setIcon(action->icon()); + if (toolName.compare(tr("Rectangle"))==0 || toolName.compare(tr("Ellipse"))==0 || toolName.compare(tr("Line"))==0) { + minWidth = 130; + k->shapesMenu->setDefaultAction(action); + k->shapesMenu->setActiveAction(action); + if (!action->icon().isNull()) + k->shapesMenu->menuAction()->setIcon(action->icon()); + } break; + case TupToolInterface::Tweener: k->status->enableFullScreenFeature(false); minWidth = 220; - k->motionMenu->setDefaultAction(action); k->motionMenu->setActiveAction(action); if (!action->icon().isNull()) k->motionMenu->menuAction()->setIcon(action->icon()); break; case TupToolInterface::Fill: k->status->enableFullScreenFeature(true); - k->fillMenu->setDefaultAction(action); - k->fillMenu->setActiveAction(action); - if (!action->icon().isNull()) - k->fillMenu->menuAction()->setIcon(action->icon()); break; case TupToolInterface::Selection: k->status->enableFullScreenFeature(true); - k->selectionMenu->setDefaultAction(action); - k->selectionMenu->setActiveAction(action); - if (!action->icon().isNull()) - k->selectionMenu->menuAction()->setIcon(action->icon()); if (toolName.compare(tr("Object Selection"))==0) { minWidth = 130; connect(k->paintArea, SIGNAL(itemAddedOnSelection(TupGraphicsScene *)), @@ -841,17 +930,22 @@ break; case TupToolInterface::View: k->status->enableFullScreenFeature(true); - k->viewToolMenu->setDefaultAction(action); - k->viewToolMenu->setActiveAction(action); - if (!action->icon().isNull()) - k->viewToolMenu->menuAction()->setIcon(action->icon()); - if (toolName.compare(tr("Zoom In"))==0 || toolName.compare(tr("Zoom Out"))==0) - minWidth = 130; - if (toolName.compare(tr("Hand"))==0) { + if (toolName.compare(tr("Shift"))==0) { tool->setProjectSize(k->project->dimension()); + if (k->fullScreenOn) + tool->setActiveView("FULL_SCREEN"); + else + tool->setActiveView("WORKSPACE"); } break; + case TupToolInterface::LipSync: + k->status->enableFullScreenFeature(false); + minWidth = 220; + connect(k->currentTool, SIGNAL(importLipSync()), this, SLOT(importPapagayoLipSync())); + break; + default: + break; } QWidget *toolConfigurator = tool->configurator(); @@ -871,15 +965,16 @@ k->paintArea->setTool(tool); k->paintArea->viewport()->setCursor(action->cursor()); - if (toolName.compare(tr("Object Selection"))==0) { - qreal globalFactor = k->status->currentZoomFactor(); - qreal factor = globalFactor*0.01; - tool->updateZoomFactor(factor); - } - + if (toolName.compare(tr("Object Selection"))==0 || toolName.compare(tr("Nodes Selection"))==0 || toolName.compare(tr("PolyLine"))==0) + tool->updateZoomFactor(1 / k->nodesScaleFactor); } else { #ifdef K_DEBUG - tError() << "TupDocumentView::selectTool() - Fatal Error: Action from sender() is NULL"; + QString msg = "TupDocumentView::selectTool() - Fatal Error: Action from sender() is NULL"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -887,7 +982,11 @@ void TupDocumentView::selectToolFromMenu(QAction *action) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupDocumentView::selectToolFromMenu()]"; + #else + T_FUNCINFO; + #endif #endif QMenu *menu = qobject_cast(action->parent()); @@ -905,13 +1004,23 @@ tool->trigger(); } else { #ifdef K_DEBUG - tError() << "TupDocumentView::selectToolFromMenu() - Default action is NULL"; + QString msg = "TupDocumentView::selectToolFromMenu() - Default action is NULL"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } } else { #ifdef K_DEBUG - tFatal() << "TupDocumentView::selectToolFromMenu() - Error: Action with NO parent! Aborting..."; + QString msg = "TupDocumentView::selectToolFromMenu() - Error: Action with NO parent! Aborting..."; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } @@ -941,13 +1050,6 @@ } } -void TupDocumentView::updateZoomFactor(double factor) -{ - k->zoomFactorSpin->blockSignals(true); - k->zoomFactorSpin->setValue(factor*100); - k->zoomFactorSpin->blockSignals(false); -} - void TupDocumentView::createToolBar() { k->barGrid = new QToolBar(tr("Paint area actions"), this); @@ -974,11 +1076,8 @@ k->barGrid->addAction(k->actionManager->find("cut")); k->barGrid->addAction(k->actionManager->find("delete")); - // k->barGrid->addAction(k->actionManager->find("show_grid")); - // k->barGrid->addAction(k->actionManager->find("full_screen")); - - k->barGrid->addAction(k->actionManager->find("group")); - k->barGrid->addAction(k->actionManager->find("ungroup")); + // k->barGrid->addAction(k->actionManager->find("group")); + // k->barGrid->addAction(k->actionManager->find("ungroup")); TCONFIG->beginGroup("OnionParameters"); int preview = TCONFIG->value("PreviousFrames", -1).toInt(); @@ -1030,6 +1129,8 @@ k->barGrid->addAction(k->actionManager->find("camera")); + k->barGrid->addAction(k->actionManager->find("papagayo")); + addToolBarBreak(); QLabel *dirLabel = new QLabel(tr("Direction") + ": "); @@ -1109,25 +1210,6 @@ k->paintArea->setNextFramesOnionSkinCount(level); } -/* -void TupDocumentView::showGrid() -{ - k->paintArea->drawGrid(!k->paintArea->gridFlag()); -} -*/ - -void TupDocumentView::updateScaleVars(double factor) -{ - k->status->updateZoomFactor(factor); - k->verticalRuler->setRulerZoom(factor); - k->horizontalRuler->setRulerZoom(factor); - - if (k->currentTool) { - if (k->currentTool->name().compare(tr("Object Selection")) == 0) - k->currentTool->resizeNodes(factor); - } -} - void TupDocumentView::changeRulerOrigin(const QPointF &zero) { k->verticalRuler->setOrigin(zero.y()); @@ -1229,9 +1311,9 @@ if (k->currentTool) { k->currentTool->init(k->paintArea->graphicsScene()); - if ((k->currentTool->toolType() == TupToolInterface::Tweener) && (mode != TupProject::FRAMES_EDITION)) { - QAction *pencil = k->brushesMenu->actions().at(0); - pencil->trigger(); + if (((k->currentTool->toolType() == TupToolInterface::Tweener) || (k->currentTool->toolType() == TupToolInterface::LipSync)) + && (mode != TupProject::FRAMES_EDITION)) { + k->pencilAction->trigger(); } } @@ -1324,7 +1406,7 @@ void TupDocumentView::showFullScreen() { - if (k->fullScreenOn || k->currentTool->toolType() == TupToolInterface::Tweener) + if (k->fullScreenOn || k->currentTool->toolType() == TupToolInterface::Tweener || k->currentTool->toolType() == TupToolInterface::LipSync) return; k->fullScreenOn = true; @@ -1333,25 +1415,35 @@ int screenW = desktop.screenGeometry().width(); int screenH = desktop.screenGeometry().height(); - double scale = 1; + k->cacheScaleFactor = k->nodesScaleFactor; + + qreal scaleFactor = 1; QSize projectSize = k->project->dimension(); if (projectSize.width() < projectSize.height()) - scale = (double) (screenW - 50) / (double) projectSize.width(); + scaleFactor = (double) (screenW - 50) / (double) projectSize.width(); else - scale = (double) (screenH - 50) / (double) projectSize.height(); + scaleFactor = (double) (screenH - 50) / (double) projectSize.height(); k->fullScreen = new TupCanvas(this, Qt::Window|Qt::FramelessWindowHint, k->paintArea->graphicsScene(), - k->paintArea->centerPoint(), QSize(screenW, screenH), k->project, scale, + k->paintArea->centerPoint(), QSize(screenW, screenH), k->project, scaleFactor, k->viewAngle, brushManager(), k->isNetworked, k->onLineUsers); k->fullScreen->updateCursor(k->currentTool->cursor()); + + QString toolName = k->currentTool->name(); + if (toolName.compare(tr("Shift")) == 0) + k->currentTool->setActiveView("FULL_SCREEN"); + k->fullScreen->showFullScreen(); + k->nodesScaleFactor = 1; + updateNodesScale(scaleFactor); connect(this, SIGNAL(openColorDialog(const QColor &)), k->fullScreen, SLOT(colorDialog(const QColor &))); connect(k->fullScreen, SIGNAL(updateColorFromFullScreen(const QColor &)), this, SIGNAL(updateColorFromFullScreen(const QColor &))); connect(k->fullScreen, SIGNAL(updatePenThicknessFromFullScreen(int)), this, SLOT(updatePenThickness(int))); connect(k->fullScreen, SIGNAL(updateOnionOpacityFromFullScreen(double)), this, SLOT(updateOnionOpacity(double))); + connect(k->fullScreen, SIGNAL(updateZoomFactorFromFullScreen(qreal)), this, SLOT(updateNodesScale(qreal))); connect(k->fullScreen, SIGNAL(callAction(int, int)), this, SLOT(loadPlugin(int, int))); connect(k->fullScreen, SIGNAL(requestTriggered(const TupProjectRequest *)), this, SIGNAL(requestTriggered(const TupProjectRequest *))); connect(k->fullScreen, SIGNAL(localRequestTriggered(const TupProjectRequest *)), this, SIGNAL(localRequestTriggered(const TupProjectRequest *))); @@ -1381,6 +1473,7 @@ disconnect(k->fullScreen, SIGNAL(updateColorFromFullScreen(const QColor &)), this, SIGNAL(updateColorFromFullScreen(const QColor &))); disconnect(k->fullScreen, SIGNAL(updatePenThicknessFromFullScreen(int)), this, SLOT(updatePenThickness(int))); disconnect(k->fullScreen, SIGNAL(updateOnionOpacityFromFullScreen(double)), this, SLOT(updateOnionOpacity(double))); + disconnect(k->fullScreen, SIGNAL(updateZoomFactorFromFullScreen(qreal)), this, SLOT(updateNodesScale(qreal))); disconnect(k->fullScreen, SIGNAL(callAction(int, int)), this, SLOT(loadPlugin(int, int))); disconnect(k->fullScreen, SIGNAL(requestTriggered(const TupProjectRequest *)), this, SIGNAL(requestTriggered(const TupProjectRequest *))); disconnect(k->fullScreen, SIGNAL(localRequestTriggered(const TupProjectRequest *)), this, SIGNAL(localRequestTriggered(const TupProjectRequest *))); @@ -1391,7 +1484,15 @@ k->fullScreen->close(); k->fullScreenOn = false; k->currentTool->init(k->paintArea->graphicsScene()); + k->fullScreen = 0; + + QString toolName = k->currentTool->name(); + if (toolName.compare(tr("Shift")) == 0) + k->currentTool->setActiveView("WORKSPACE"); + + k->nodesScaleFactor = k->cacheScaleFactor; + updateNodesScale(1); } } @@ -1413,7 +1514,7 @@ QString fileName = QFileDialog::getSaveFileName(this, tr("Export Frame As"), QDir::homePath(), tr("Images") + " (*.png *.jpg)"); if (!fileName.isNull()) { - bool isOk = k->imagePlugin->exportFrame(frameIndex, k->project->bgColor(), fileName, k->project->scene(sceneIndex), k->project->dimension()); + bool isOk = k->imagePlugin->exportFrame(frameIndex, k->project->bgColor(), fileName, k->project->scene(sceneIndex), k->project->dimension(), k->project->library()); updatePaintArea(); if (isOk) TOsd::self()->display(tr("Information"), tr("Frame has been exported successfully")); @@ -1455,7 +1556,7 @@ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); TupStoryBoardDialog *storySettings = new TupStoryBoardDialog(k->isNetworked, k->imagePlugin, k->project->bgColor(), k->project->dimension(), - k->project->scene(sceneIndex), currentSceneIndex(), this); + k->project->scene(sceneIndex), currentSceneIndex(), k->project->library(), this); connect(storySettings, SIGNAL(updateStoryboard(TupStoryboard *, int)), this, SLOT(sendStoryboard(TupStoryboard *, int))); if (k->isNetworked) @@ -1472,7 +1573,12 @@ { if (k->isNetworked) { #ifdef K_DEBUG - tWarning() << "TupDocumentView::sendStoryboard() - Sending storyboard..."; + QString msg = "TupDocumentView::sendStoryboard() - Sending storyboard..."; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif emit updateStoryboard(storyboard, sceneIndex); } else { @@ -1536,6 +1642,9 @@ { if (k->currentTool->name().compare(tr("PolyLine")) == 0) emit closePolyLine(); + + if (k->currentTool->name().compare(tr("Line")) == 0) + emit closeLine(); } void TupDocumentView::cameraInterface() @@ -1561,10 +1670,25 @@ } } + /* SQA: This lines should be enabled in some point at the future QByteArray cameraDevice = cameraDevices[0]; QCamera *camera = new QCamera(cameraDevice); + camera->load(); + tError() << "TupDocumentView::cameraInterface() - Camera status: " << camera->status(); QCameraImageCapture *imageCapture = new QCameraImageCapture(camera); QList resolutions = imageCapture->supportedResolutions(); + */ + + QList resolutions; + resolutions << QSize(1280, 1024); + resolutions << QSize(1280, 960); + resolutions << QSize(1224, 768); + resolutions << QSize(800, 600); + resolutions << QSize(640, 480); + resolutions << QSize(352, 288); + resolutions << QSize(320, 240); + resolutions << QSize(176, 144); + resolutions << QSize(160, 120); QDesktopWidget desktop; QSize projectSize = k->project->dimension(); @@ -1623,13 +1747,13 @@ proportion = (double) height / (double) pHeight; if (proportion <= 0.5) { - setZoomView("20"); + setZoomPercent("20"); } else if (proportion > 0.5 && proportion <= 0.75) { - setZoomView("25"); + setZoomPercent("25"); } else if (proportion > 0.75 && proportion <= 1.5) { - setZoomView("50"); + setZoomPercent("50"); } else if (proportion > 1.5 && proportion < 2) { - setZoomView("75"); + setZoomPercent("75"); } emit projectSizeHasChanged(dimension); @@ -1696,3 +1820,191 @@ k->photoCounter = id + 1; } } + +void TupDocumentView::importPapagayoLipSync() +{ + TupPapagayoDialog *dialog = new TupPapagayoDialog(); + dialog->show(); + + if (dialog->exec() != QDialog::Rejected) { + QString file = dialog->getPGOFile(); + QFileInfo info(file); + QString folder = info.fileName().toLower(); + + int sceneIndex = k->paintArea->currentSceneIndex(); + TupScene *scene = k->project->scene(sceneIndex); + if (scene->lipSyncExists(folder)) { + TOsd::self()->display(tr("Error"), tr("Papagayo project already exists!\nPlease, rename the project's file"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupDocumentView::importPapagayoLipSync() - Fatal Error: Papagayo file is invalid!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + return; + } + + QString imagesDir = dialog->getImagesFile(); + QFile project(file); + if (project.exists()) { + if (project.size() > 0) { + QDir dir(imagesDir); + QStringList imagesList = dir.entryList(QStringList() << "*.png" << "*.jpg" << "*.jpeg" << "*.gif" << "*.svg"); + if (imagesList.count() > 0) { + QSize mouthSize; + QString extension = ".svg"; + QString firstImage = imagesList.at(0); + QString pic = imagesDir + QDir::separator() + firstImage; + if (firstImage.endsWith(".svg")) { + QSvgRenderer *renderer = new QSvgRenderer(pic); + QRect rect = renderer->viewBox(); + mouthSize = rect.size(); + } else { + QImage *image = new QImage(pic); + mouthSize = image->size(); + int dot = firstImage.lastIndexOf("."); + extension = firstImage.mid(dot); + } + + int currentIndex = k->paintArea->currentFrameIndex(); + TupPapagayoImporter *parser = new TupPapagayoImporter(file, k->project->dimension(), mouthSize, extension, currentIndex); + if (parser->fileIsValid()) { + int layerIndex = k->paintArea->currentLayerIndex(); + QString mouthPath = imagesDir; + QDir mouthDir = QDir(mouthPath); + + // Creating Papagayo folder in the library + TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Add, folder, TupLibraryObject::Folder); + emit requestTriggered(&request); + + // Adding mouth images in the library + foreach (QString fileName, imagesList) { + QString key = fileName.toLower(); + QFile f(mouthPath + QDir::separator() + fileName); + if (f.open(QIODevice::ReadOnly)) { + QByteArray data = f.readAll(); + f.close(); + request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Add, key, TupLibraryObject::Image, k->project->spaceContext(), data, folder, + sceneIndex, layerIndex, currentIndex); + emit requestTriggered(&request); + } + } + + // Adding lip-sync sound file + QString soundFile = dialog->getSoundFile(); + QFile f(soundFile); + QFileInfo info(soundFile); + QString soundKey = info.fileName().toLower(); + + if (f.open(QIODevice::ReadOnly)) { + QByteArray data = f.readAll(); + f.close(); + request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Add, soundKey, TupLibraryObject::Sound, k->project->spaceContext(), data, folder, + sceneIndex, layerIndex, currentIndex); + emit requestTriggered(&request); + } + + // Adding Papagayo project + parser->setSoundFile(soundKey); + QString xml = parser->file2Text(); + request = TupRequestBuilder::createLayerRequest(sceneIndex, layerIndex, TupProjectRequest::AddLipSync, xml); + emit requestTriggered(&request); + + // Adding frames if they are required + TupScene *scene = k->project->scene(sceneIndex); + if (scene) { + int sceneFrames = scene->framesTotal(); + int lipSyncFrames = currentIndex + parser->framesTotal(); + + if (lipSyncFrames > sceneFrames) { + int layersTotal = scene->layersTotal(); + for (int i = sceneFrames; i < lipSyncFrames; i++) { + for (int j = 0; j < layersTotal; j++) { + request = TupRequestBuilder::createFrameRequest(sceneIndex, j, i, TupProjectRequest::Add, tr("Frame %1").arg(i + 1)); + emit requestTriggered(&request); + } + } + request = TupRequestBuilder::createFrameRequest(sceneIndex, layerIndex, currentIndex, TupProjectRequest::Select, "1"); + emit requestTriggered(&request); + } + } + + if (k->currentTool->name().compare(tr("Papagayo Lip-sync")) != 0) + k->papagayoAction->trigger(); + + emit updateFPS(parser->fps()); + + TOsd::self()->display(tr("Information"), tr("Papagayo file has been imported successfully")); + } else { + TOsd::self()->display(tr("Error"), tr("Papagayo file is invalid!"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupDocumentView::importPapagayoLipSync() - Fatal Error: Papagayo file is invalid!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + } + } else { + TOsd::self()->display(tr("Error"), tr("Images directory is empty!"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupDocumentView::importPapagayoLipSync() - Fatal Error: Images directory is empty!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + } + } else { + TOsd::self()->display(tr("Error"), tr("Papagayo project is invalid!"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupDocumentView::importPapagayoLipSync() - Fatal Error: Papagayo file is invalid!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + } + } else { + TOsd::self()->display(tr("Error"), tr("Papagayo project is invalid!"), TOsd::Error); + #ifdef K_DEBUG + QString msg = "TupDocumentView::importPapagayoLipSync() - Fatal Error: Papagayo file doesn't exist!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + } + } +} + +void TupDocumentView::papagayoManager() +{ + if (k->currentTool->name().compare(tr("Papagayo Lip-sync")) != 0) { + TupProject::Mode mode = TupProject::Mode(k->spaceMode->currentIndex()); + if (mode != TupProject::FRAMES_EDITION) + k->spaceMode->setCurrentIndex(TupProject::FRAMES_EDITION); + k->papagayoAction->trigger(); + } +} + +void TupDocumentView::updatePerspective() +{ + if (k->currentTool) { + if (k->currentTool->name().compare(tr("Papagayo Lip-sync")) == 0) + k->currentTool->updateWorkSpaceContext(); + } +} + +void TupDocumentView::resetWorkSpaceTransformations() +{ + k->paintArea->resetWorkSpaceCenter(k->project->dimension()); + k->status->setRotationAngle("0"); + k->status->setZoomPercent("100"); +} diff -Nru tupi-0.2+git04/src/components/paintarea/tupdocumentview.h tupi-0.2+git05/src/components/paintarea/tupdocumentview.h --- tupi-0.2+git04/src/components/paintarea/tupdocumentview.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupdocumentview.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,16 +36,39 @@ #ifndef TUPDOCUMENTVIEW_H #define TUPDOCUMENTVIEW_H +#include "tglobal.h" #include "tupdocumentruler.h" #include "tactionmanager.h" #include "tosd.h" #include "tupfilterinterface.h" #include "tuptoolinterface.h" #include "tupconfigurationarea.h" -#include "tupglobal.h" #include "tupstoryboard.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include class TupProjectRequest; class TupProject; @@ -58,7 +81,7 @@ * @author Jorge Cuadrado */ -class TupDocumentView : public QMainWindow +class TUPI_EXPORT TupDocumentView : public QMainWindow { Q_OBJECT @@ -73,7 +96,7 @@ void setOpenGL(bool useIt); QPainter::RenderHints renderHints() const; - void setZoom(qreal factor); + void setZoomFactor(qreal factor); TupBrushManager *brushManager() const; TupPaintAreaCommand *createCommand(const TupPaintAreaEvent *event); @@ -82,17 +105,19 @@ TupProject *project(); int currentFramesTotal(); int currentSceneIndex(); - void setZoomView(const QString &percent); + void setZoomPercent(const QString &percent); void setRotationAngle(int angle); QSize workSpaceSize() const; void updateUsersOnLine(const QString &login, int state); void resizeProjectDimension(const QSize dimension); + void updatePerspective(); private slots: void setNextOnionSkin(int n); void setPreviousOnionSkin(int n); - // void setZoomFactor(int porcent); - void updateScaleVars(double factor); + void updateZoomVars(qreal factor); + void applyZoomIn(); + void applyZoomOut(); void updateRotationVars(int angle); void changeRulerOrigin(const QPointF &zero); void saveTimer(); @@ -108,6 +133,7 @@ void fullScreenRightClick(); void cameraInterface(); void insertPictureInFrame(int id, const QString path); + void papagayoManager(); private: struct Private; @@ -115,7 +141,7 @@ void setupDrawActions(); void createToolBar(); void createMenu(); - void createTools(); + void createLateralToolBar(); void updateRotationAngleFromRulers(int angle); private slots: @@ -135,7 +161,6 @@ private slots: void showPos(const QPointF &point); void setCursor(const QCursor &cursor); - void updateZoomFactor(double factor); void selectToolFromMenu(QAction *action); void callAutoSave(); void sendStoryboard(TupStoryboard *storyboard, int sceneIndex); @@ -148,6 +173,9 @@ void drawGrid(); void drawActionSafeArea(); bool handleProjectResponse(TupProjectResponse *event); + void updateNodesScale(qreal factor); + void importPapagayoLipSync(); + void resetWorkSpaceTransformations(); signals: void requestTriggered(const TupProjectRequest *event); @@ -163,7 +191,9 @@ void postStoryboard(int sceneIndex); // void projectHasChanged(); void closePolyLine(); + void closeLine(); void projectSizeHasChanged(const QSize dimension); + void updateFPS(int fps); // protected: // void closeEvent(QCloseEvent *e); diff -Nru tupi-0.2+git04/src/components/paintarea/tupexposuredialog.cpp tupi-0.2+git05/src/components/paintarea/tupexposuredialog.cpp --- tupi-0.2+git04/src/components/paintarea/tupexposuredialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupexposuredialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,23 +34,6 @@ ***************************************************************************/ #include "tupexposuredialog.h" -#include "tupexposurescene.h" -#include "tdebug.h" -#include "tapplicationproperties.h" -#include "tseparator.h" -#include "timagebutton.h" -#include "tupscene.h" -#include "tuplayer.h" -#include "tpushbutton.h" - -#include -#include -#include -#include -#include -#include -#include -#include struct TupExposureDialog::Private { @@ -127,7 +110,6 @@ k->sceneColumn = new QVBoxLayout; for (int i=0; i < k->project->scenesTotal(); i++) { - // List of scene buttons TPushButton *sceneButton = new TPushButton(this, tr("Scene") + " " + QString::number(i+1), 0, i); sceneButton->setFixedSize(100, 70); @@ -184,11 +166,16 @@ void TupExposureDialog::goToScene(int column, int sceneIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureDialog::goToScene()]"; + #else + T_FUNCINFO; + #endif #endif + Q_UNUSED(column); - tError() << "TupExposureDialog::goToScene() - sceneIndex: " << sceneIndex; + // tError() << "TupExposureDialog::goToScene() - sceneIndex: " << sceneIndex; TupExposureScene *oldScene = k->sceneGroupList.at(k->currentScene); oldScene->hide(); @@ -209,7 +196,7 @@ TupExposureScene *sceneTable = k->sceneGroupList.at(sceneIndex); sceneTable->show(); int newFramesTotal = sceneTable->framesTotal(); - int newLayersTotal = sceneTable->layersTotal(); + int newLayersTotal = sceneTable->layersTotal(); emit goToScene(k->currentScene); emit goToFrame(sceneTable->currentFrame(), sceneTable->currentLayer(), k->currentScene); @@ -226,7 +213,11 @@ void TupExposureDialog::refreshUI(int frame, int layer) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupExposureDialog::refreshUI()]"; + #else + T_FUNCINFO; + #endif #endif for(int i=0; isceneList.size(); i++) { @@ -235,7 +226,7 @@ k->currentLayer = layer; - tError() << "TupExposureDialog::refreshUI() - Going to frame -> " << frame; + // tError() << "TupExposureDialog::refreshUI() - Going to frame -> " << frame; emit goToFrame(frame, layer, k->currentScene); } @@ -282,8 +273,8 @@ k->sceneColumn->addWidget(sceneButton); k->sceneList << sceneButton; - tError() << "TupExposureDialog::createScene() - Scenes Total: " << scene; - tError() << "TupExposureDialog::createScene() - Last index: " << oldIndex; + // tError() << "TupExposureDialog::createScene() - Scenes Total: " << scene; + // tError() << "TupExposureDialog::createScene() - Last index: " << oldIndex; TupExposureScene *sceneGroup = new TupExposureScene(tr("Scene") + " " + QString::number(scene), k->project->scene(scene-1), 0, 0); connect(sceneGroup, SIGNAL(updateUI(int, int)), this, SLOT(refreshUI(int, int))); diff -Nru tupi-0.2+git04/src/components/paintarea/tupexposuredialog.h tupi-0.2+git05/src/components/paintarea/tupexposuredialog.h --- tupi-0.2+git04/src/components/paintarea/tupexposuredialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupexposuredialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,27 @@ #ifndef TUPEXPOSUREDIALOG_H #define TUPEXPOSUREDIALOG_H +#include "tglobal.h" #include "tupproject.h" +#include "tupexposurescene.h" +#include "tapplicationproperties.h" +#include "tseparator.h" +#include "timagebutton.h" +#include "tupscene.h" +#include "tuplayer.h" +#include "tpushbutton.h" + #include +#include +#include +#include +#include +#include +#include +#include +#include -class TupExposureDialog : public QDialog +class TUPI_EXPORT TupExposureDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupexposurescene.cpp tupi-0.2+git05/src/components/paintarea/tupexposurescene.cpp --- tupi-0.2+git04/src/components/paintarea/tupexposurescene.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupexposurescene.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,6 @@ #include "tupexposurescene.h" #include "tpushbutton.h" #include "tuplayer.h" -#include "tdebug.h" - -#include -#include struct TupExposureScene::Private { @@ -65,7 +61,6 @@ k->frameCounter = k->scene->framesTotal(); for (int j=0; j< scene->layersTotal(); j++) { - if (j < 4) { // SQA: Temporary condition QGroupBox *layerGroup = new QGroupBox(tr("Layer") + " " + QString::number(j+1)); QHBoxLayout *layerLayout = new QHBoxLayout; @@ -142,8 +137,8 @@ void TupExposureScene::addNewFrame() { - tError() << "TupExposureScene::addNewFrame() - frameList size: " << k->frameList.size(); - tError() << "TupExposureScene::addNewFrame() - current layer: " << k->currentLayer; + // tError() << "TupExposureScene::addNewFrame() - frameList size: " << k->frameList.size(); + // tError() << "TupExposureScene::addNewFrame() - current layer: " << k->currentLayer; for(int j=0; jframeList.size(); j++) { k->frameList.at(j)->setChecked(false); @@ -176,18 +171,18 @@ k->frameList.insert(position, frameButton); - tError() << "TupExposureScene::addNewFrame() -> inserting frame at position: " << position; + // tError() << "TupExposureScene::addNewFrame() -> inserting frame at position: " << position; } } void TupExposureScene::goToFrame(int frame, int layer) { - tError() << "TupExposureScene::goToFrame(int, int) - frame: " << frame << " - layer: " << layer; + // tError() << "TupExposureScene::goToFrame(int, int) - frame: " << frame << " - layer: " << layer; // int oneRow = k->scene->framesTotal(); int index = frame + k->frameCounter*layer; - tError() << "TupExposureScene::goToFrame(int, int) - index: " << index; + // tError() << "TupExposureScene::goToFrame(int, int) - index: " << index; for(int i=0; iframeList.size(); i++) { if (i == index) { diff -Nru tupi-0.2+git04/src/components/paintarea/tupexposurescene.h tupi-0.2+git05/src/components/paintarea/tupexposurescene.h --- tupi-0.2+git04/src/components/paintarea/tupexposurescene.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupexposurescene.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,9 +36,12 @@ #ifndef TUPEXPOSURESCENE_H #define TUPEXPOSURESCENE_H +#include "tglobal.h" #include "tupscene.h" #include +#include +#include class TupExposureScene : public QGroupBox { diff -Nru tupi-0.2+git04/src/components/paintarea/tupimagedevice.cpp tupi-0.2+git05/src/components/paintarea/tupimagedevice.cpp --- tupi-0.2+git04/src/components/paintarea/tupimagedevice.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupimagedevice.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,15 +34,15 @@ ***************************************************************************/ #include "tupimagedevice.h" -#include "tdebug.h" - -#include -#include TupImageDevice::TupImageDevice(QWidget *parent) : QWidget(parent) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupImageDevice()]"; + #else + TINIT; + #endif #endif m_image = QImage(300,300, QImage::Format_RGB32); @@ -57,20 +57,24 @@ TupImageDevice::~TupImageDevice() { #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[~TupImageDevice()]"; + #else TEND; + #endif #endif } QPaintEngine *TupImageDevice::paintEngine() const { - qDebug("TupImageDevice: paint engine *****************************************"); + // qDebug("TupImageDevice: paint engine *****************************************"); return QWidget::paintEngine(); } void TupImageDevice::paintEvent(QPaintEvent *) { - qDebug("TupImageDevice: Paint event #####################################################"); + // qDebug("TupImageDevice: Paint event #####################################################"); QPainter p(this); p.drawImage(0, 0, m_image); } diff -Nru tupi-0.2+git04/src/components/paintarea/tupimagedevice.h tupi-0.2+git05/src/components/paintarea/tupimagedevice.h --- tupi-0.2+git04/src/components/paintarea/tupimagedevice.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupimagedevice.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,18 @@ #ifndef TUPIMAGEDEVICE_H #define TUPIMAGEDEVICE_H +#include "tglobal.h" + #include #include +#include +#include /** * @author David Cuadrado */ -class TupImageDevice : public QWidget +class TUPI_EXPORT TupImageDevice : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupimagedialog.cpp tupi-0.2+git05/src/components/paintarea/tupimagedialog.cpp --- tupi-0.2+git04/src/components/paintarea/tupimagedialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupimagedialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,19 +34,6 @@ ***************************************************************************/ #include "tupimagedialog.h" -#include "tapplicationproperties.h" -#include "tglobal.h" -#include "tconfig.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include struct TupImageDialog::Private { diff -Nru tupi-0.2+git04/src/components/paintarea/tupimagedialog.h tupi-0.2+git05/src/components/paintarea/tupimagedialog.h --- tupi-0.2+git04/src/components/paintarea/tupimagedialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupimagedialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,9 +36,20 @@ #ifndef TUPIMAGEDIALOG_H #define TUPIMAGEDIALOG_H +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "tconfig.h" + #include +#include +#include +#include +#include +#include +#include +#include -class TupImageDialog : public QDialog +class TUPI_EXPORT TupImageDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupinfowidget.cpp tupi-0.2+git05/src/components/paintarea/tupinfowidget.cpp --- tupi-0.2+git04/src/components/paintarea/tupinfowidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupinfowidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,25 +34,6 @@ ***************************************************************************/ #include "tupinfowidget.h" -#include "tdebug.h" -#include "tapplicationproperties.h" -#include "tseparator.h" -#include "timagebutton.h" -#include "tpushbutton.h" -#include "tupwebhunter.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include struct TupInfoWidget::Private { @@ -130,8 +111,11 @@ k->table->setMaximumWidth(250); k->table->setMaximumHeight((k->currencyList.count() - 1)*30); - k->table->verticalHeader()->setResizeMode(QHeaderView::Stretch); - k->table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + + // k->table->verticalHeader()->setResizeMode(QHeaderView::Stretch); + // k->table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + k->table->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch); + k->table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); QBoxLayout *mainLayout = new QVBoxLayout; mainLayout->setContentsMargins(1, 1, 1, 1); diff -Nru tupi-0.2+git04/src/components/paintarea/tupinfowidget.h tupi-0.2+git05/src/components/paintarea/tupinfowidget.h --- tupi-0.2+git04/src/components/paintarea/tupinfowidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupinfowidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,9 +36,28 @@ #ifndef TUPINFOWIDGET_H #define TUPINFOWIDGET_H +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "tseparator.h" +#include "timagebutton.h" +#include "tpushbutton.h" +#include "tupwebhunter.h" + #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class TupInfoWidget : public QWidget +class TUPI_EXPORT TupInfoWidget : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tuplibrarydialog.cpp tupi-0.2+git05/src/components/paintarea/tuplibrarydialog.cpp --- tupi-0.2+git04/src/components/paintarea/tuplibrarydialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuplibrarydialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tuplibrarydialog.h" -#include "tupitempreview.h" -#include "tformfactory.h" -#include "tapplicationproperties.h" - -#include -#include -#include -#include -#include -#include -#include struct TupLibraryDialog::Private { diff -Nru tupi-0.2+git04/src/components/paintarea/tuplibrarydialog.h tupi-0.2+git05/src/components/paintarea/tuplibrarydialog.h --- tupi-0.2+git04/src/components/paintarea/tuplibrarydialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuplibrarydialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,25 @@ #ifndef TUPLIBRARYDIALOG_H #define TUPLIBRARYDIALOG_H +#include "tglobal.h" +#include "tupitempreview.h" +#include "tformfactory.h" +#include "tapplicationproperties.h" + #include -class QGraphicsItem; +#include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado **/ -class TupLibraryDialog : public QDialog +class TUPI_EXPORT TupLibraryDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tuponionopacitydialog.cpp tupi-0.2+git05/src/components/paintarea/tuponionopacitydialog.cpp --- tupi-0.2+git04/src/components/paintarea/tuponionopacitydialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuponionopacitydialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tuponionopacitydialog.h" -#include "tdebug.h" -#include "tapplicationproperties.h" -#include "tseparator.h" -#include "tuppenthicknesswidget.h" -#include "timagebutton.h" - -#include -#include -#include -#include -#include struct TupOnionOpacityDialog::Private { diff -Nru tupi-0.2+git04/src/components/paintarea/tuponionopacitydialog.h tupi-0.2+git05/src/components/paintarea/tuponionopacitydialog.h --- tupi-0.2+git04/src/components/paintarea/tuponionopacitydialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuponionopacitydialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,20 @@ #ifndef TUPONIONOPACITYDIALOG_H #define TUPONIONOPACITYDIALOG_H +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "tseparator.h" +#include "tuppenthicknesswidget.h" +#include "timagebutton.h" + #include #include +#include +#include +#include +#include -class TupOnionOpacityDialog : public QDialog +class TUPI_EXPORT TupOnionOpacityDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tuppaintareacommand.cpp tupi-0.2+git05/src/components/paintarea/tuppaintareacommand.cpp --- tupi-0.2+git04/src/components/paintarea/tuppaintareacommand.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppaintareacommand.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,13 +34,6 @@ ***************************************************************************/ #include "tuppaintareacommand.h" -#include "tuppaintarea.h" -#include "tuppaintareaevent.h" -#include "tupbrushmanager.h" - -#include "tdebug.h" - -#include /** * This class defines the undo/redo functions for the paint area diff -Nru tupi-0.2+git04/src/components/paintarea/tuppaintareacommand.h tupi-0.2+git05/src/components/paintarea/tuppaintareacommand.h --- tupi-0.2+git04/src/components/paintarea/tuppaintareacommand.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppaintareacommand.h 2014-12-15 14:21:32.000000000 +0000 @@ -33,19 +33,25 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef TUPAINTAREACOMMAND_H +#ifndef TUPPAINTAREACOMMAND_H #define TUPPAINTAREACOMMAND_H +#include "tglobal.h" +#include "tuppaintarea.h" +#include "tuppaintareaevent.h" +#include "tupbrushmanager.h" + #include +#include -class TupPaintArea; -class TupPaintAreaEvent; +// class TupPaintArea; +// class TupPaintAreaEvent; /** * @author David Cuadrado */ -class TupPaintAreaCommand : public QUndoCommand +class TUPI_EXPORT TupPaintAreaCommand : public QUndoCommand { public: TupPaintAreaCommand(TupPaintArea *area, const TupPaintAreaEvent *event); diff -Nru tupi-0.2+git04/src/components/paintarea/tuppaintarea.cpp tupi-0.2+git05/src/components/paintarea/tuppaintarea.cpp --- tupi-0.2+git04/src/components/paintarea/tuppaintarea.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppaintarea.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -1,4 +1,4 @@ -/*************************************************************************** +/*y************************************************************************** * Project TUPI: Magia 2D * * Project Contact: info@maefloresta.com * * Project Website: http://www.maefloresta.com * @@ -34,41 +34,6 @@ ***************************************************************************/ #include "tuppaintarea.h" -#include "tupbrushmanager.h" -#include "tupinputdeviceinformation.h" - -#include "tuppaintareaevent.h" -#include "tuppaintarearotator.h" -#include "tupimagedevice.h" -#include "tupgraphicsscene.h" -#include "tconfig.h" -#include "tapplication.h" -#include "tdebug.h" -#include "tuptextitem.h" -#include "tuplibrarydialog.h" -#include "tuplibraryobject.h" -#include "tuprequestbuilder.h" -#include "tupprojectrequest.h" -#include "tupprojectresponse.h" - -#include "tupscene.h" -#include "tuplayer.h" -#include "tupsvgitem.h" -#include "tuppixmapitem.h" -#include "node.h" -#include "tcontrolnode.h" -#include "tupproject.h" -#include "tosd.h" - -#include -#include -#include -#include -#include -// #include -#include -#include -#include /** * This class defines the behavior of the main paint area when ilustration module is on @@ -94,9 +59,15 @@ TupPaintArea::TupPaintArea(TupProject *project, QWidget * parent) : TupPaintAreaBase(parent, project->dimension()), k(new Private) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea()]"; + #else + TINIT; + #endif #endif + setAccessibleName("WORKSPACE"); + k->canvasEnabled = false; k->project = project; @@ -105,26 +76,39 @@ k->deleteMode = false; k->menuOn = false; - setCurrentScene(0); k->currentTool = tr("Pencil"); - if (graphicsScene()->scene()) + if (graphicsScene()->scene()) { graphicsScene()->setCurrentFrame(0, 0); + graphicsScene()->setLibrary(project->library()); + } + + setCurrentScene(0); } TupPaintArea::~TupPaintArea() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupPaintArea()]"; + #else + TEND; + #endif #endif + graphicsScene()->clear(); + delete k; } void TupPaintArea::setCurrentScene(int index) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::setCurrentScene()]"; + #else + T_FUNCINFO; + #endif #endif if (k->project->scenesTotal() > 0) { @@ -139,8 +123,15 @@ graphicsScene()->setCurrentScene(0); } else { #ifdef K_DEBUG - tError() << "TupPaintArea::setCurrentScene() - [ Fatal Error ] - No scenes available. Invalid index -> " << index; - tError() << "TupPaintArea::setCurrentScene() - Scenes total -> " << k->project->scenesTotal(); + QString msg1 = "TupPaintArea::setCurrentScene() - [ Fatal Error ] - No scenes available. Invalid index -> " + QString::number(index); + QString msg2 = "TupPaintArea::setCurrentScene() - Scenes total -> " + QString::number(k->project->scenesTotal()); + #ifdef Q_OS_WIN32 + qDebug() << msg1; + qDebug() << msg2; + #else + tError() << msg1; + tError() << msg2; + #endif #endif } } @@ -150,7 +141,11 @@ void TupPaintArea::mousePressEvent(QMouseEvent *event) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::mousePressEvent()]"; + #else + T_FUNCINFO; + #endif #endif if (!k->canvasEnabled) @@ -158,33 +153,46 @@ if (graphicsScene()->currentFrame()->isLocked()) { #ifdef K_DEBUG - tFatal() << "TupPaintArea::mousePressEvent() - Frame is locked!"; + QString msg = "TupPaintArea::mousePressEvent() - Frame is locked!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif return; } - if (k->currentTool.compare(tr("Line Selection")) == 0) { + if (k->currentTool.compare(tr("Nodes Selection")) == 0) { // If a node is the target... abort! if (event->buttons() == Qt::RightButton) { - if (qgraphicsitem_cast(scene()->itemAt(mapToScene(event->pos())))) + // if (qgraphicsitem_cast(scene()->itemAt(mapToScene(event->pos())))) + if (qgraphicsitem_cast(scene()->itemAt(mapToScene(event->pos()), QTransform()))) return; } } - if (k->currentTool.compare(tr("PolyLine")) == 0) { - if (event->buttons() == Qt::RightButton) { + if (event->buttons() == Qt::RightButton) { + if (k->currentTool.compare(tr("PolyLine")) == 0) { emit closePolyLine(); return; } + + if (k->currentTool.compare(tr("Line")) == 0) { + emit closeLine(); + return; + } } if (k->currentTool.compare(tr("Object Selection")) == 0) { if (event->buttons() == Qt::RightButton) { // If a node is the target... abort! - if (qgraphicsitem_cast(scene()->itemAt(mapToScene(event->pos())))) + // if (qgraphicsitem_cast(scene()->itemAt(mapToScene(event->pos())))) + if (qgraphicsitem_cast(scene()->itemAt(mapToScene(event->pos()), QTransform()))) return; - if (QGraphicsItem *item = scene()->itemAt(mapToScene(event->pos()))) { + // if (QGraphicsItem *item = scene()->itemAt(mapToScene(event->pos()))) { + if (QGraphicsItem *item = scene()->itemAt(mapToScene(event->pos()), QTransform())) { if (item->opacity() == 1) { item->setFlag(QGraphicsItem::ItemIsSelectable, true); // item->setSelected(true); @@ -282,7 +290,12 @@ void TupPaintArea::frameResponse(TupFrameResponse *event) { #ifdef K_DEBUG - tDebug() << "TupPaintArea::frameResponse() - [" << event->sceneIndex() << ", " << event->layerIndex() << ", " << event->frameIndex() << "]"; + QString msg = "TupPaintArea::frameResponse() - [" + QString::number(event->sceneIndex()) + ", " + QString::number(event->layerIndex()) + ", " + QString::number(event->frameIndex()) + "]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug() << msg; + #endif #endif TupGraphicsScene *guiScene = graphicsScene(); @@ -314,11 +327,12 @@ guiScene->drawPhotogram(event->frameIndex(), true); } else { guiScene->cleanWorkSpace(); - guiScene->drawBackground(guiScene->currentFrameIndex()); + guiScene->drawSceneBackground(guiScene->currentFrameIndex()); } if (guiScene->currentTool()->toolType() == TupToolInterface::Selection) - guiScene->currentTool()->init(graphicsScene()); + guiScene->resetCurrentTool(); + // guiScene->currentTool()->init(graphicsScene()); } break; case TupProjectRequest::Lock: @@ -340,7 +354,12 @@ } } else { #ifdef K_DEBUG - tFatal() << "TupPaintArea::frameResponse() - isDrawing() == true! - No action taken!"; + QString msg = "TupPaintArea::frameResponse() - isDrawing() == true! - No action taken!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } @@ -350,63 +369,102 @@ void TupPaintArea::layerResponse(TupLayerResponse *event) { #ifdef K_DEBUG - tDebug() << "TupPaintArea::layerResponse() - [" << event->sceneIndex() << ", " << event->layerIndex() << "]"; + QString msg = "TupPaintArea::layerResponse() - [" + QString::number(event->sceneIndex()) + ", " + QString::number(event->layerIndex()) + "]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug() << msg; + #endif #endif - if (event->action() == TupProjectRequest::Add) - return; - TupGraphicsScene *guiScene = graphicsScene(); - if (!guiScene->scene()) return; int frameIndex = guiScene->currentFrameIndex(); - if (event->action() == TupProjectRequest::View) - guiScene->setLayerVisible(event->layerIndex(), event->arg().toBool()); - - if (event->action() != TupProjectRequest::Add && event->action() != TupProjectRequest::Remove) { - if (k->spaceMode == TupProject::FRAMES_EDITION) { - guiScene->drawCurrentPhotogram(); - } else { - guiScene->cleanWorkSpace(); - guiScene->drawBackground(frameIndex); - } + switch (event->action()) { + case TupProjectRequest::Add: + { + return; + } + break; + /* + case TupProjectRequest::AddLipSync: + { + return; + } + break; + */ + case TupProjectRequest::Remove: + { + TupScene *scene = k->project->scene(k->currentSceneIndex); - viewport()->update(scene()->sceneRect().toRect()); - } else { - if (event->action() == TupProjectRequest::Remove) { - TupScene *scene = k->project->scene(k->currentSceneIndex); + if (scene->layersTotal() > 1) { + if (event->layerIndex() != 0) + guiScene->setCurrentFrame(event->layerIndex() - 1, frameIndex); + else + guiScene->setCurrentFrame(event->layerIndex() + 1, frameIndex); - if (scene->layersTotal() > 1) { - if (event->layerIndex() != 0) - guiScene->setCurrentFrame(event->layerIndex() - 1, frameIndex); - else - guiScene->setCurrentFrame(event->layerIndex() + 1, frameIndex); + if (k->spaceMode == TupProject::FRAMES_EDITION) { + guiScene->drawCurrentPhotogram(); + } else { + guiScene->cleanWorkSpace(); + guiScene->drawSceneBackground(frameIndex); + } + } else { + if (scene->layersTotal() == 1) { + // QList indexes = scene->layerIndexes(); + // guiScene->setCurrentFrame(indexes.at(0), frameIndex); + + guiScene->setCurrentFrame(0, frameIndex); + if (k->spaceMode == TupProject::FRAMES_EDITION) { + guiScene->drawCurrentPhotogram(); + } else { + guiScene->cleanWorkSpace(); + guiScene->drawSceneBackground(frameIndex); + } + } + } - if (k->spaceMode == TupProject::FRAMES_EDITION) { - guiScene->drawCurrentPhotogram(); - } else { - guiScene->cleanWorkSpace(); - guiScene->drawBackground(frameIndex); + viewport()->update(); } - } else { - if (scene->layersTotal() == 1) { - QList indexes = scene->layerIndexes(); - - guiScene->setCurrentFrame(indexes.at(0), frameIndex); + break; + case TupProjectRequest::TupProjectRequest::View: + { + guiScene->setLayerVisible(event->layerIndex(), event->arg().toBool()); if (k->spaceMode == TupProject::FRAMES_EDITION) { guiScene->drawCurrentPhotogram(); } else { guiScene->cleanWorkSpace(); - guiScene->drawBackground(frameIndex); + guiScene->drawSceneBackground(frameIndex); } - } - } - - viewport()->update(); - } + viewport()->update(scene()->sceneRect().toRect()); + } + break; + case TupProjectRequest::TupProjectRequest::Move: + { + guiScene->setCurrentFrame(event->arg().toInt(), frameIndex); + if (k->spaceMode == TupProject::FRAMES_EDITION) { + guiScene->drawCurrentPhotogram(); + } else { + guiScene->cleanWorkSpace(); + guiScene->drawSceneBackground(frameIndex); + } + viewport()->update(scene()->sceneRect().toRect()); + } + break; + default: + { + if (k->spaceMode == TupProject::FRAMES_EDITION) { + guiScene->drawCurrentPhotogram(); + } else { + guiScene->cleanWorkSpace(); + guiScene->drawSceneBackground(frameIndex); + } + viewport()->update(scene()->sceneRect().toRect()); + } + break; } guiScene->layerResponse(event); @@ -415,7 +473,12 @@ void TupPaintArea::sceneResponse(TupSceneResponse *event) { #ifdef K_DEBUG - tDebug() << "TupPaintArea::sceneResponse() - [" << event->sceneIndex() << "]"; + QString msg = "TupPaintArea::sceneResponse() - [" + QString::number(event->sceneIndex()) + "]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug() << msg; + #endif #endif TupGraphicsScene *guiScene = graphicsScene(); @@ -459,14 +522,24 @@ default: { #ifdef K_DEBUG - tFatal() << "TupPaintArea::sceneResponse <- TupProjectRequest::Default"; + QString msg = "TupPaintArea::sceneResponse <- TupProjectRequest::Default"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } break; } } else { #ifdef K_DEBUG - tFatal() << "TupPaintArea::sceneResponse() - isDrawing() == true! - No action taken!"; + QString msg = "TupPaintArea::sceneResponse() - isDrawing() == true! - No action taken!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } @@ -476,7 +549,12 @@ void TupPaintArea::itemResponse(TupItemResponse *event) { #ifdef K_DEBUG - tDebug() << "TupPaintArea::itemResponse() - [" << event->sceneIndex() << ", " << event->layerIndex() << ", " << event->frameIndex() << "]"; + QString msg = "TupPaintArea::itemResponse() - [" + QString::number(event->sceneIndex()) + ", " + QString::number(event->layerIndex()) + ", " + QString::number(event->frameIndex()) + "]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug() << msg; + #endif #endif TupGraphicsScene *guiScene = graphicsScene(); @@ -499,7 +577,7 @@ guiScene->drawCurrentPhotogram(); } else { guiScene->cleanWorkSpace(); - guiScene->drawBackground(guiScene->currentFrameIndex()); + guiScene->drawSceneBackground(guiScene->currentFrameIndex()); } viewport()->update(scene()->sceneRect().toRect()); @@ -507,25 +585,36 @@ } break; + case TupProjectRequest::Move: + { + // Do nothing + } + break; default: { if (k->spaceMode == TupProject::FRAMES_EDITION) { - guiScene->drawCurrentPhotogram(); + guiScene->drawCurrentPhotogram(); } else { guiScene->cleanWorkSpace(); - guiScene->drawBackground(guiScene->currentFrameIndex()); + guiScene->drawSceneBackground(guiScene->currentFrameIndex()); } viewport()->update(scene()->sceneRect().toRect()); if (guiScene->currentTool()->toolType() != TupToolInterface::Tweener && k->currentTool.compare(tr("PolyLine")) != 0) - guiScene->currentTool()->init(graphicsScene()); + guiScene->resetCurrentTool(); + // guiScene->currentTool()->init(graphicsScene()); } break; } } else { #ifdef K_DEBUG - tFatal() << "TupPaintArea::itemResponse() - isDrawing() == true! - No action taken!"; + QString msg = "TupPaintArea::itemResponse() - isDrawing() == true! - No action taken!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } @@ -539,7 +628,12 @@ void TupPaintArea::libraryResponse(TupLibraryResponse *request) { #ifdef K_DEBUG - tDebug() << "TupPaintArea::libraryResponse() - Request Action: " << request->action(); + QString msg = "TupPaintArea::libraryResponse() - Request Action: " + QString::number(request->action()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tDebug() << msg; + #endif #endif TupGraphicsScene *guiScene = graphicsScene(); @@ -556,7 +650,7 @@ guiScene->drawCurrentPhotogram(); } else { guiScene->cleanWorkSpace(); - guiScene->drawBackground(frameIndex); + guiScene->drawSceneBackground(frameIndex); } viewport()->update(scene()->sceneRect().toRect()); @@ -572,7 +666,7 @@ guiScene->drawCurrentPhotogram(); } else { guiScene->cleanWorkSpace(); - guiScene->drawBackground(frameIndex); + guiScene->drawSceneBackground(frameIndex); } viewport()->update(scene()->sceneRect().toRect()); @@ -581,7 +675,12 @@ } } else { #ifdef K_DEBUG - tFatal() << "TupPaintArea::libraryResponse() - isDrawing() == true! - No action taken!"; + QString msg = "TupPaintArea::libraryResponse() - isDrawing() == true! - No action taken!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } @@ -601,10 +700,14 @@ void TupPaintArea::deleteItems() { #ifdef K_DEBUG - T_FUNCINFOX("paintarea"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::deleteItems()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif - if (k->currentTool.compare(tr("Object Selection")) != 0 && k->currentTool.compare(tr("Line Selection")) != 0) + if (k->currentTool.compare(tr("Object Selection")) != 0 && k->currentTool.compare(tr("Nodes Selection")) != 0) return; QList selected = scene()->selectedItems(); @@ -637,12 +740,22 @@ itemIndex = frame->indexOf(svg); } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else if (k->spaceMode == TupProject::DYNAMIC_BACKGROUND_EDITION) { @@ -653,17 +766,32 @@ itemIndex = frame->indexOf(svg); } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: invalid spaceMode!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: invalid spaceMode!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { @@ -678,12 +806,22 @@ itemIndex = frame->indexOf(item); } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else if (k->spaceMode == TupProject::DYNAMIC_BACKGROUND_EDITION) { @@ -694,17 +832,32 @@ itemIndex = frame->indexOf(item); } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Background frame is NULL!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Scene has no background element!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::deleteItems() - Fatal Error: invalid spaceMode!"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: invalid spaceMode!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -718,7 +871,12 @@ emit requestTriggered(&event); } else { #ifdef K_DEBUG - tFatal() << "TupPaintArea::deleteItems() - Fatal Error: Invalid item index"; + QString msg = "TupPaintArea::deleteItems() - Fatal Error: Invalid item index"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } @@ -729,41 +887,7 @@ } } -void TupPaintArea::groupItems() -{ - // T_FUNCINFO; - QList selected = scene()->selectedItems(); - - if (!selected.isEmpty()) { - QString strItems= ""; - TupGraphicsScene *currentScene = graphicsScene(); - int firstItem = -1; - - if (currentScene) { - foreach (QGraphicsItem *item, selected) { - if (currentScene->currentFrame()->indexOf(item) != -1) { - if (strItems.isEmpty()) { - strItems +="("+ QString::number(currentScene->currentFrame()->indexOf(item)); - firstItem = currentScene->currentFrame()->indexOf(item); - } else { - strItems += " , " + - QString::number(currentScene->currentFrame()->indexOf(item)); - } - } - } - strItems+= ")"; - } - - if (strItems != ")") { - TupProjectRequest event = TupRequestBuilder::createItemRequest(currentScene->currentSceneIndex(), - currentScene->currentLayerIndex(), - currentScene->currentFrameIndex(), firstItem, QPointF(), k->spaceMode, - TupLibraryObject::Item, TupProjectRequest::Group, strItems); - emit requestTriggered(&event); - } - } -} - +/* void TupPaintArea::ungroupItems() { QList selected = scene()->selectedItems(); @@ -783,11 +907,16 @@ } } } +*/ void TupPaintArea::copyItems() { #ifdef K_DEBUG - T_FUNCINFOX("paintarea"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::copyItems()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif k->copiesXml.clear(); @@ -838,14 +967,17 @@ void TupPaintArea::pasteItems() { #ifdef K_DEBUG - T_FUNCINFOX("paintarea"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::pasteItems()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif TupGraphicsScene* currentScene = graphicsScene(); - if (!k->menuOn) { + if (!k->menuOn) k->position = viewPosition(); - } // QPointF point = k->position - k->oldPosition; @@ -889,7 +1021,11 @@ void TupPaintArea::multipasteObject(int pasteTotal) { #ifdef K_DEBUG - T_FUNCINFOX("paintarea"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::multipasteObject()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif TupGraphicsScene* currentScene = graphicsScene(); @@ -967,8 +1103,13 @@ void TupPaintArea::cutItems() { #ifdef K_DEBUG - T_FUNCINFOX("paintarea"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::cutItems()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif + copyItems(); deleteItems(); } @@ -976,7 +1117,11 @@ void TupPaintArea::setNextFramesOnionSkinCount(int n) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::setNextFramesOnionSkinCount()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif if (TupGraphicsScene* currentScene = graphicsScene()) @@ -986,7 +1131,11 @@ void TupPaintArea::setPreviousFramesOnionSkinCount(int n) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::setPreviousFramesOnionSkinCount()]"; + #else + T_FUNCINFO; + #endif #endif if (TupGraphicsScene* currentScene = graphicsScene()) @@ -996,7 +1145,11 @@ void TupPaintArea::addSelectedItemsToLibrary() { #ifdef K_DEBUG - tDebug("paintarea") << "Adding to library"; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::addSelectedItemsToLibrary()]"; + #else + tDebug("paintarea") << "TupPaintArea::addSelectedItemsToLibrary()"; + #endif #endif QList selected = scene()->selectedItems(); @@ -1021,7 +1174,7 @@ doc.appendChild(itemSerializable->toXml(doc)); TupProjectRequest request = TupRequestBuilder::createLibraryRequest(TupProjectRequest::Add, - symName, TupLibraryObject::Item, k->spaceMode, doc.toString().toLocal8Bit(), QString()); + symName, TupLibraryObject::Item, k->spaceMode, doc.toString().toLocal8Bit(), QString()); emit requestTriggered(&request); } } @@ -1030,7 +1183,11 @@ void TupPaintArea::requestItemMovement(QAction *action) { #ifdef K_DEBUG - T_FUNCINFOX("paintarea"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::requestItemMovement()]"; + #else + T_FUNCINFOX("paintarea"); + #endif #endif QList selected = scene()->selectedItems(); @@ -1067,12 +1224,22 @@ emit requestTriggered(&event); } else { #ifdef K_DEBUG - tError() << "TupPaintArea::requestItemMovement() - Fatal error: Invalid action [ " << moveType << " ]"; + QString msg = "TupPaintArea::requestItemMovement() - Fatal error: Invalid action [ " + QString::number(moveType) + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "TupPaintArea::requestItemMovement() - Fatal error: Invalid object index [ " << index << " ]"; + QString msg = "TupPaintArea::requestItemMovement() - Fatal error: Invalid object index [ " + QString::number(index) + " ]"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -1081,7 +1248,11 @@ void TupPaintArea::updatePaintArea() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::updatePaintArea()]"; + #else + T_FUNCINFO; + #endif #endif if (k->spaceMode == TupProject::FRAMES_EDITION) { @@ -1095,19 +1266,28 @@ void TupPaintArea::paintBackground() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::paintBackground()]"; + #else + T_FUNCINFO; + #endif #endif TupGraphicsScene* currentScene = graphicsScene(); currentScene->cleanWorkSpace(); - currentScene->drawBackground(currentScene->currentFrameIndex()); + currentScene->drawSceneBackground(currentScene->currentFrameIndex()); } void TupPaintArea::setCurrentTool(QString tool) { #ifdef K_DEBUG - T_FUNCINFO; - SHOW_VAR(tool); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::setCurrentTool()]"; + qDebug() << "SHOW_VAR : " << tool; + #else + T_FUNCINFO; + SHOW_VAR(tool); + #endif #endif k->currentTool = tool; @@ -1117,7 +1297,11 @@ void TupPaintArea::updateSpaceContext() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::updateSpaceContext()]"; + #else + T_FUNCINFO; + #endif #endif TupGraphicsScene* currentScene = graphicsScene(); @@ -1134,13 +1318,31 @@ void TupPaintArea::keyPressEvent(QKeyEvent *event) { #ifdef K_DEBUG - T_FUNCINFO; + QString msg1 = "TupPaintArea::keyPressEvent() - Current tool: " + k->currentTool; + QString msg2 = "TupPaintArea::keyPressEvent() - Key: " + QString::number(event->key()); + QString msg3 = "TupPaintArea::keyPressEvent() - Key: " + event->text(); + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintArea::keyPressEvent()]"; + qDebug() << msg1; + qDebug() << msg2; + qDebug() << msg3; + #else + T_FUNCINFO; + tDebug() << msg1; + tDebug() << msg2; + tDebug() << msg3; + #endif #endif - #ifdef K_DEBUG - tWarning() << "TupPaintArea::keyPressEvent() - Current tool: " << k->currentTool; - tWarning() << "TupPaintArea::keyPressEvent() - Key: " << event->key(); - #endif + if (event->key() == Qt::Key_1 || event->key() == Qt::Key_Plus) { + emit zoomIn(); + return; + } + + if (event->key() == Qt::Key_2 || event->key() == Qt::Key_Minus) { + emit zoomOut(); + return; + } if (k->currentTool.compare(tr("PolyLine")) == 0) { if (event->key() == Qt::Key_X) @@ -1305,3 +1507,14 @@ return graphicsScene()->currentFrameIndex(); } +void TupPaintArea::resetWorkSpaceCenter(const QSize projectSize) +{ + int centerX = projectSize.width()/2; + int centerY = projectSize.height()/2; + + foreach (QGraphicsView *view, graphicsScene()->views()) { + view->centerOn(QPointF(centerX, centerY)); + view->setSceneRect(0, 0, projectSize.width(), projectSize.height()); + } +} + diff -Nru tupi-0.2+git04/src/components/paintarea/tuppaintarea.h tupi-0.2+git05/src/components/paintarea/tuppaintarea.h --- tupi-0.2+git04/src/components/paintarea/tuppaintarea.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppaintarea.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,44 @@ #ifndef TUPPAINTAREA_H #define TUPPAINTAREA_H +#include "tglobal.h" #include "tuppaintareabase.h" #include "tupabstractprojectresponsehandler.h" #include "tupgraphicsscene.h" +#include "tupbrushmanager.h" +#include "tupinputdeviceinformation.h" +#include "tuppaintareaevent.h" +#include "tuppaintarearotator.h" +#include "tupimagedevice.h" +#include "tupgraphicsscene.h" +#include "tconfig.h" +#include "tapplication.h" +#include "tuptextitem.h" +#include "tuplibrarydialog.h" +#include "tuplibraryobject.h" +#include "tuprequestbuilder.h" +#include "tupprojectrequest.h" +#include "tupprojectresponse.h" +#include "tupscene.h" +#include "tuplayer.h" +#include "tupsvgitem.h" +#include "tuppixmapitem.h" +#include "node.h" +#include "tcontrolnode.h" +#include "tupproject.h" +#include "tosd.h" + +#include +#include +#include +#include +#include +// #include +#include +#include +#include -// #include - -class QGraphicsRectItem; +// class QGraphicsRectItem; class TupBrushManager; class TupInputDeviceInformation; class TupProject; @@ -53,7 +84,7 @@ * @author Jorge Cuadrado - David Cuadrado */ -class TupPaintArea : public TupPaintAreaBase, public TupAbstractProjectResponseHandler +class TUPI_EXPORT TupPaintArea : public TupPaintAreaBase, public TupAbstractProjectResponseHandler { Q_OBJECT @@ -78,6 +109,7 @@ int currentSceneIndex(); int currentLayerIndex(); int currentFrameIndex(); + void resetWorkSpaceCenter(const QSize projectSize); public slots: void setNextFramesOnionSkinCount(int n); @@ -90,12 +122,14 @@ void itemAddedOnSelection(TupGraphicsScene *); void frameChanged(int); void closePolyLine(); + void closeLine(); void updateStatusBgColor(const QColor color); + void zoomIn(); + void zoomOut(); public slots: void deleteItems(); - void groupItems(); - void ungroupItems(); + // void ungroupItems(); void copyItems(); void pasteItems(); void pasteNextFive(); diff -Nru tupi-0.2+git04/src/components/paintarea/tuppaintareastatus.cpp tupi-0.2+git05/src/components/paintarea/tuppaintareastatus.cpp --- tupi-0.2+git04/src/components/paintarea/tuppaintareastatus.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppaintareastatus.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,23 +34,6 @@ ***************************************************************************/ #include "tuppaintareastatus.h" -#include "tseparator.h" -#include "tdebug.h" -#include "tupglobal.h" -#include "tupbrushmanager.h" -#include "tupcolorwidget.h" -#include "tupbrushstatus.h" -#include "tuptoolstatus.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include //////////////// @@ -88,6 +71,14 @@ addPermanentWidget(k->positionLabel, 1); + QPushButton *resetWSButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "reset_workspace.png")), ""); + resetWSButton->setIconSize(QSize(16, 16)); + resetWSButton->setToolTip(tr("Reset WorkSpace")); + resetWSButton->setShortcut(QKeySequence(tr("+"))); + connect(resetWSButton, SIGNAL(clicked()), k->documentView, SLOT(resetWorkSpaceTransformations())); + + addPermanentWidget(resetWSButton); + QPushButton *actionSafeAreaButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "safe_area.png")), ""); actionSafeAreaButton->setIconSize(QSize(16, 16)); actionSafeAreaButton->setToolTip(tr("Action Safe Area")); @@ -225,6 +216,8 @@ k->toolStatus = new TupToolStatus; addPermanentWidget(k->toolStatus); + + setMinimumWidth(700); } TupPaintAreaStatus::~TupPaintAreaStatus() @@ -271,14 +264,20 @@ int input = text.toInt(); qreal factor = (qreal)input / (qreal)k->scaleFactor; - k->documentView->setZoom(factor); + k->documentView->setZoomFactor(factor); k->scaleFactor = input; } -void TupPaintAreaStatus::setZoomFactor(const QString &text) +void TupPaintAreaStatus::setZoomPercent(const QString &percent) +{ + updateZoomField(percent); + applyZoom(percent); +} + +void TupPaintAreaStatus::setRotationAngle(const QString &angle) { - updateZoomField(text); - applyZoom(text); + updateRotationField(angle); + applyRotation(angle); } void TupPaintAreaStatus::updateZoomField(const QString &text) @@ -290,6 +289,15 @@ k->zoom->setEditText(text); } +void TupPaintAreaStatus::updateRotationField(const QString &text) +{ + int index = k->rotation->findText(text); + if (index != -1) + k->rotation->setCurrentIndex(index); + else + k->rotation->setEditText(text); +} + qreal TupPaintAreaStatus::currentZoomFactor() { return k->scaleFactor; diff -Nru tupi-0.2+git04/src/components/paintarea/tuppaintareastatus.h tupi-0.2+git05/src/components/paintarea/tuppaintareastatus.h --- tupi-0.2+git04/src/components/paintarea/tuppaintareastatus.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppaintareastatus.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,30 @@ #ifndef TUPPAINTAREASTATUS_H #define TUPPAINTAREASTATUS_H +#include "tglobal.h" #include "tupdocumentview.h" +#include "tseparator.h" +#include "tupbrushmanager.h" +#include "tupcolorwidget.h" +#include "tupbrushstatus.h" +#include "tuptoolstatus.h" + #include +#include +#include +#include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TupPaintAreaStatus : public QStatusBar +class TUPI_EXPORT TupPaintAreaStatus : public QStatusBar { Q_OBJECT @@ -51,7 +67,8 @@ TupPaintAreaStatus(TupDocumentView *parent); ~TupPaintAreaStatus(); void updateTool(const QString &label, const QPixmap &pixmap); - void setZoomFactor(const QString &text); + void setZoomPercent(const QString &percent); + void setRotationAngle(const QString &angle); void updateZoomFactor(double factor); qreal currentZoomFactor(); void updateRotationAngle(int angle); @@ -62,11 +79,11 @@ public slots: void applyZoom(const QString &text); void setPen(const QPen &pen); + void applyRotation(const QString &text); private slots: void selectAntialiasingHint(); void selectRenderer(int id); - void applyRotation(const QString &text); void updateFrameIndex(int index); void updateFramePointer(); @@ -77,6 +94,7 @@ private: void updateZoomField(const QString &text); + void updateRotationField(const QString &angle); struct Private; Private *const k; }; diff -Nru tupi-0.2+git04/src/components/paintarea/tuppapagayodialog.cpp tupi-0.2+git05/src/components/paintarea/tuppapagayodialog.cpp --- tupi-0.2+git04/src/components/paintarea/tuppapagayodialog.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppapagayodialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,151 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tuppapagayodialog.h" + +struct TupPapagayoDialog::Private +{ + QLineEdit *filePath; + QLineEdit *imagesPath; + QLineEdit *soundPath; +}; + +TupPapagayoDialog::TupPapagayoDialog() : QDialog(), k(new Private) +{ + setWindowTitle(tr("Import Papagayo project")); + setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons/papagayo.png"))); + + QVBoxLayout *layout = new QVBoxLayout(this); + + QHBoxLayout *blockLayout = new QHBoxLayout; + QVBoxLayout *buttonsLayout = new QVBoxLayout; + QVBoxLayout *textLayout = new QVBoxLayout; + + QPushButton *fileButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "papagayo.png")), " " + tr("&Load PGO File"), this); + connect(fileButton, SIGNAL(clicked()), this, SLOT(openFileDialog())); + + QPushButton *imagesButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "bitmap_array.png")), " " + tr("Load &Images"), this); + connect(imagesButton, SIGNAL(clicked()), this, SLOT(openImagesDialog())); + + QPushButton *soundButton = new QPushButton(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "bitmap_array.png")), " " + tr("Load &Sound"), this); + connect(soundButton, SIGNAL(clicked()), this, SLOT(openSoundDialog())); + + buttonsLayout->addWidget(fileButton); + buttonsLayout->addWidget(imagesButton); + buttonsLayout->addWidget(soundButton); + + k->filePath = new QLineEdit(); + k->filePath->setReadOnly(true); + k->imagesPath = new QLineEdit(); + k->imagesPath->setReadOnly(true); + k->soundPath = new QLineEdit(); + k->soundPath->setReadOnly(true); + + textLayout->addWidget(k->filePath); + textLayout->addWidget(k->imagesPath); + textLayout->addWidget(k->soundPath); + + blockLayout->addLayout(buttonsLayout); + blockLayout->addLayout(textLayout); + + layout->addLayout(blockLayout); + + QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok + | QDialogButtonBox::Cancel, Qt::Horizontal); + connect(buttons, SIGNAL(accepted()), this, SLOT(checkRecords())); + connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); + + layout->addWidget(buttons, 0, Qt::AlignCenter); +} + +TupPapagayoDialog::~TupPapagayoDialog() +{ + delete k; +} + +void TupPapagayoDialog::openFileDialog() +{ + QString file = QFileDialog::getOpenFileName(this, tr("Load Papagayo project"), QDir::homePath(), tr("Papagayo Project (*.pgo)")); + k->filePath->setText(file); +} + +void TupPapagayoDialog::openImagesDialog() +{ + QString path = QFileDialog::getExistingDirectory(this, tr("Choose the images directory..."), getenv("HOME"), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + k->imagesPath->setText(path); +} + +void TupPapagayoDialog::openSoundDialog() +{ + QString file = QFileDialog::getOpenFileName(this, tr("Load sound file"), QDir::homePath(), tr("Sound file (*.ogg *.wav *.mp3)")); + k->soundPath->setText(file); +} + +void TupPapagayoDialog::checkRecords() +{ + if (k->filePath->text().length() == 0) { + TOsd::self()->display(tr("Error"), tr("PGO path is unset!"), TOsd::Error); + return; + } + + if (k->imagesPath->text().length() == 0) { + TOsd::self()->display(tr("Error"), tr("Images directory is unset!"), TOsd::Error); + return; + } + + if (k->soundPath->text().length() == 0) { + TOsd::self()->display(tr("Error"), tr("Sound path is unset!"), TOsd::Error); + return; + } + + accept(); +} + +QString TupPapagayoDialog::getPGOFile() const +{ + return k->filePath->text(); +} + +QString TupPapagayoDialog::getImagesFile() const +{ + return k->imagesPath->text(); +} + +QString TupPapagayoDialog::getSoundFile() const +{ + return k->soundPath->text(); +} + diff -Nru tupi-0.2+git04/src/components/paintarea/tuppapagayodialog.h tupi-0.2+git05/src/components/paintarea/tuppapagayodialog.h --- tupi-0.2+git04/src/components/paintarea/tuppapagayodialog.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppapagayodialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,77 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPPAPAGAYODIALOG_H +#define TUPPAPAGAYODIALOG_H + +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "tosd.h" + +#include +#include +#include +#include +#include +#include +#include + +/** + * @author David Cuadrado +**/ + +class TUPI_EXPORT TupPapagayoDialog : public QDialog +{ + Q_OBJECT + + public: + TupPapagayoDialog(); + ~TupPapagayoDialog(); + QString getPGOFile() const; + QString getImagesFile() const; + QString getSoundFile() const; + + private slots: + void openFileDialog(); + void openImagesDialog(); + void openSoundDialog(); + void checkRecords(); + + private: + struct Private; + Private *const k; +}; + +#endif diff -Nru tupi-0.2+git04/src/components/paintarea/tuppapagayoimporter.cpp tupi-0.2+git05/src/components/paintarea/tuppapagayoimporter.cpp --- tupi-0.2+git04/src/components/paintarea/tuppapagayoimporter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppapagayoimporter.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,222 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tuppapagayoimporter.h" + +struct TupPapagayoImporter::Private +{ + bool isValid; + int framesTotal; + int fps; + TupLipSync *lipsync; +}; + +TupPapagayoImporter::TupPapagayoImporter(const QString &file, const QSize &projectSize, + const QSize &mouthSize, const QString &extension, int initFrame) : QObject(), k(new Private) +{ + k->framesTotal = 0; + k->isValid = true; + QFile input(file); + + QFileInfo info(file); + QString name = info.fileName().toLower(); + k->lipsync = new TupLipSync(); + k->lipsync->setName(name); + k->lipsync->setInitFrame(initFrame); + k->lipsync->setPicsExtension(extension); + + if (input.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream stream(&input); + int i = 0; + int voicesNumber = 0; + QString line; + while (i < 5) { + line = stream.readLine(); + switch (i) { + case 0: + { + if (!line.startsWith("lipsync version")) { + k->isValid = false; + return; + } + } + break; + /* + case 1: + { + // Load audio file + k->lipsync->setSoundFile(line.trimmed()); + } + break; + */ + case 2: + { + // FPS + k->fps = line.trimmed().toInt(); + k->lipsync->setFPS(k->fps); + } + break; + case 4: + { + // Total of voices + voicesNumber = line.trimmed().toInt(); + } + break; + } + i++; + } + + int x = projectSize.width()/(voicesNumber+1) - (mouthSize.width()/2); + int y = projectSize.height()/2 - (mouthSize.height()/2); + + for(int j=1; j<=voicesNumber; j++) { + TupVoice *voice = new TupVoice(); + x = x*j; + voice->setMouthPos(QPoint(x, y)); + voice->setVoiceTitle(stream.readLine().trimmed()); + voice->setText(stream.readLine().trimmed()); + int numPhrases = stream.readLine().toInt(); + int numPhonemes = 0; + int numWords; + QString str; + for (int p = 0; p < numPhrases; p++) { + QString text = stream.readLine().trimmed(); + int initFrame = stream.readLine().toInt(); + // int endFrame = stream.readLine().toInt(); + stream.readLine(); + TupPhrase *phrase = new TupPhrase(initFrame); + numWords = stream.readLine().toInt(); + for (int w = 0; w < numWords; w++) { + QString str = stream.readLine().trimmed(); + QStringList strList = str.split(' ', QString::SkipEmptyParts); + QString strWord; + int firstFrame = 0; + int lastFrame = 0; + TupWord *word = 0; + if (strList.size() >= 4) { + strWord = strList.at(0); + firstFrame = strList.at(1).toInt(); + word = new TupWord(firstFrame); + lastFrame = strList.at(2).toInt(); + numPhonemes = strList.at(3).toInt(); + } + QList frames; + QList blocks; + for (int ph = 0; ph < numPhonemes; ph++) { + str = stream.readLine().trimmed(); + QStringList strList = str.split(' ', QString::SkipEmptyParts); + if (strList.size() >= 2) { + frames << strList.at(0).toInt(); + blocks << strList.at(1).toLower(); + } + } // for ph + + for (int ph = 0; ph < numPhonemes-1; ph++) { + int total = frames.at(ph+1) - frames.at(ph); + TupPhoneme *phoneme = new TupPhoneme(blocks.at(ph), total); + word->addPhoneme(phoneme); + } // for ph + + int total = (lastFrame - frames.at(numPhonemes-1)) + 1; + TupPhoneme *phoneme = new TupPhoneme(blocks.at(numPhonemes-1), total); + word->addPhoneme(phoneme); + + if (w == numWords - 1) { + if (lastFrame > k->framesTotal) + k->framesTotal = lastFrame; + } + phrase->addWord(word); + } // for w + voice->addPhrase(phrase); + } + k->lipsync->addVoice(voice); + } + k->framesTotal++; + k->lipsync->setFramesTotal(k->framesTotal); + } else { + k->isValid = false; + #ifdef K_DEBUG + QString msg = "TupPapagayoImporter() - Fatal Error: Insufficient permissions to load file! -> " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + return; + } + + input.close(); +} + +TupPapagayoImporter::~TupPapagayoImporter() +{ +} + +void TupPapagayoImporter::setSoundFile(const QString &soundFile) +{ + k->lipsync->setSoundFile(soundFile); +} + +bool TupPapagayoImporter::fileIsValid() +{ + return k->isValid; +} + +QString TupPapagayoImporter::file2Text() const +{ + QDomDocument document; + QDomElement root = k->lipsync->toXml(document); + + QString xml; + { + QTextStream ts(&xml); + ts << root; + } + + return xml; +} + +int TupPapagayoImporter::framesTotal() +{ + return k->framesTotal; +} + +int TupPapagayoImporter::fps() +{ + return k->fps; +} + + diff -Nru tupi-0.2+git04/src/components/paintarea/tuppapagayoimporter.h tupi-0.2+git05/src/components/paintarea/tuppapagayoimporter.h --- tupi-0.2+git04/src/components/paintarea/tuppapagayoimporter.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppapagayoimporter.h 2014-12-15 14:21:32.000000000 +0000 @@ -0,0 +1,65 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPPAPAGAYOIMPORTER_H +#define TUPPAPAGAYOIMPORTER_H + +#include "tglobal.h" +#include "tuplipsync.h" + +#include +#include +#include +#include + +class TUPI_EXPORT TupPapagayoImporter : public QObject +{ + Q_OBJECT + + public: + TupPapagayoImporter(const QString &file, const QSize &projectSize, const QSize &mouthSize, const QString &extension, int initFrame); + ~TupPapagayoImporter(); + void setSoundFile(const QString &soundFile); + bool fileIsValid(); + QString file2Text() const; + int framesTotal(); + int fps(); + + private: + struct Private; + Private *const k; +}; + +#endif diff -Nru tupi-0.2+git04/src/components/paintarea/tuppendialog.cpp tupi-0.2+git05/src/components/paintarea/tuppendialog.cpp --- tupi-0.2+git04/src/components/paintarea/tuppendialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppendialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,16 +34,6 @@ ***************************************************************************/ #include "tuppendialog.h" -#include "tdebug.h" -#include "tapplicationproperties.h" -#include "tseparator.h" -#include "tuppenthicknesswidget.h" -#include "timagebutton.h" - -#include -#include -#include -#include struct TupPenDialog::Private { diff -Nru tupi-0.2+git04/src/components/paintarea/tuppendialog.h tupi-0.2+git05/src/components/paintarea/tuppendialog.h --- tupi-0.2+git04/src/components/paintarea/tuppendialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuppendialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,20 @@ #ifndef TUPPENDIALOG_H #define TUPPENDIALOG_H +#include "tglobal.h" #include "tupbrushmanager.h" +#include "tapplicationproperties.h" +#include "tseparator.h" +#include "tuppenthicknesswidget.h" +#include "timagebutton.h" + #include +#include +#include +#include +#include -class TupPenDialog : public QDialog +class TUPI_EXPORT TupPenDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupruler.cpp tupi-0.2+git05/src/components/paintarea/tupruler.cpp --- tupi-0.2+git04/src/components/paintarea/tupruler.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupruler.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,9 +34,6 @@ ***************************************************************************/ #include "tupruler.h" -#include "tdebug.h" - -#include struct TupRuler::Private { @@ -222,6 +219,9 @@ int counter = fabs(k->origin)/step; + if (step < 0) + step *= -1; + for (qreal current = startMark + delta; current <= endMark; current += step) { startPosition = 16; if (counter % 5 == 0) diff -Nru tupi-0.2+git04/src/components/paintarea/tupruler.h tupi-0.2+git05/src/components/paintarea/tupruler.h --- tupi-0.2+git04/src/components/paintarea/tupruler.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupruler.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,6 +36,8 @@ #ifndef TUPRULER_H #define TUPRULER_H +#include "tglobal.h" + #include #include #include @@ -43,10 +45,11 @@ #include #include #include +#include #define RULER_BREADTH 20 -class TupRuler : public QWidget +class TUPI_EXPORT TupRuler : public QWidget { Q_OBJECT Q_PROPERTY(qreal origin READ origin WRITE setOrigin) diff -Nru tupi-0.2+git04/src/components/paintarea/tupstoryboarddialog.cpp tupi-0.2+git05/src/components/paintarea/tupstoryboarddialog.cpp --- tupi-0.2+git04/src/components/paintarea/tupstoryboarddialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupstoryboarddialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,36 +34,6 @@ ***************************************************************************/ #include "tupstoryboarddialog.h" -#include "tupstoryboard.h" -#include "tapplicationproperties.h" -#include "tglobal.h" -#include "tconfig.h" -#include "tseparator.h" -#include "tupscene.h" -#include "talgorithm.h" -#include "tosd.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include struct TupStoryBoardDialog::Private { @@ -99,10 +69,11 @@ QTextEdit *sceneDescriptionEdit; QLocale utf; + TupLibrary *library; }; TupStoryBoardDialog::TupStoryBoardDialog(bool isNetworked, TupExportInterface *imagePlugin, const QColor &color, - const QSize &size, TupScene *scene, int sceneIndex, QWidget *parent) : QDialog(parent), k(new Private) + const QSize &size, TupScene *scene, int sceneIndex, TupLibrary *library, QWidget *parent) : QDialog(parent), k(new Private) { k->isNetworked = isNetworked; k->imagePlugin = imagePlugin; @@ -111,6 +82,7 @@ k->scene = scene; k->sceneIndex = sceneIndex; k->storyboard = k->scene->storyboard(); + k->library = library; k->utf = QLocale(QLocale::AnyLanguage, QLocale::AnyCountry); QDesktopWidget desktop; @@ -372,7 +344,7 @@ for (int i=0; i < framesTotal; i++) { QString fileName = k->path + "scene" + QString::number(i); - bool isOk = k->imagePlugin->exportFrame(i, k->bgColor, fileName, k->scene, k->size); + bool isOk = k->imagePlugin->exportFrame(i, k->bgColor, fileName, k->scene, k->size, k->library); fileName += ".png"; QPixmap resized(fileName); resized = resized.scaledToWidth(k->scaledSize.width(), Qt::SmoothTransformation); @@ -465,7 +437,7 @@ k->screenLabel->setPixmap(pixmap); } -void TupStoryBoardDialog::createHTMLFiles(const QString &path) +void TupStoryBoardDialog::createHTMLFiles(const QString &path, DocType type) { if (k->scaledSize.width() <= 520) { QDir directory(k->path); @@ -497,8 +469,12 @@ } } - QFile::copy(kAppProp->shareDir() + "data" + QDir::separator() + "storyboard" + QDir::separator() + "tupi.css", - path + QDir::separator() + "tupi.css"); + QString base = kAppProp->shareDir() + "data" + QDir::separator() + "storyboard" + QDir::separator(); + + if (type == HTML) + QFile::copy(base + "tupi.html.css", path + QDir::separator() + "tupi.css"); + else + QFile::copy(base + "tupi.pdf.css", path + QDir::separator() + "tupi.css"); QString index = path + QDir::separator() + "index.html"; @@ -510,41 +486,78 @@ QTextStream out(&file); out << "\n"; out << "\n"; - out << "" << k->storyboard->storyTitle() << "\n"; + QString record = k->storyboard->storyTitle(); + if (record.length() == 0) + record = " "; + out << "" << record << "\n"; out << "\n"; out << "\n"; out << "\n"; out << "
\n"; out << "
Storyboard
\n"; - out << "
Title:
\n"; - out << "
" << k->storyboard->storyTitle() << "
\n"; - out << "
Author:
\n"; - out << "
" << k->storyboard->storyAuthor() << "
\n"; - out << "
Summary:
\n"; - out << "
" << k->storyboard->storySummary() << "
\n"; - out << "
Scenes Total:
\n"; - out << "
" << QString::number(k->storyboard->size()) << "
\n"; + out << "
\n"; + out << "
Title:
\n"; + out << "
" << record << "
\n"; + out << "
\n"; + out << "
\n"; + out << "
Author:
\n"; + record = k->storyboard->storyAuthor(); + if (record.length() == 0) + record = " "; + out << "
" << record << "
\n"; + out << "
\n"; + out << "
\n"; + out << "
Summary:
\n"; + record = k->storyboard->storySummary(); + if (record.length() == 0) + record = " "; + out << "
" << record << "
\n"; + out << "
\n"; + out << "
\n"; + out << "
Scenes Total:
\n"; + out << "
" << QString::number(k->storyboard->size()) << "
\n"; + out << "
\n"; out << "
\n"; + if (type == PDF) { + out << "
\n"; + out << "
\n"; + } - for (int i=0; i < k->storyboard->size(); i++) { + int scenes = k->storyboard->size(); + for (int i=0; i < scenes; i++) { out << "
\n"; QString image = "\n"; out << image; out << "
\n"; out << "
\n"; out << "
Title:
\n"; - out << "
" << k->storyboard->sceneTitle(i) << "
\n"; + record = k->storyboard->sceneTitle(i); + if (record.length() == 0) + record = " "; + out << "
" << record << "
\n"; out << "
\n"; out << "
\n"; out << "
Duration:
\n"; - out << "
" << k->storyboard->sceneDuration(i) << "
\n"; + record = k->storyboard->sceneDuration(i); + if (record.length() == 0) + record = " "; + out << "
" << record << "
\n"; out << "
\n"; out << "
\n"; out << "
Description:
\n"; - out << "
" << k->storyboard->sceneDescription(i) << "
\n"; + record = k->storyboard->sceneDescription(i); + if (record.length() == 0) + record = " "; + out << "
" << record << "
\n"; out << "
\n"; out << "
\n"; out << "
\n"; + if (type == PDF) { + if (i < (k->storyboard->size() - 1)) { + out << "
\n"; + out << "
\n"; + } + } } out << "\n"; out << ""; @@ -559,7 +572,7 @@ QString path = QFileDialog::getExistingDirectory(this, tr("Choose a directory..."), QDir::homePath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if (!path.isEmpty()) { - createHTMLFiles(path); + createHTMLFiles(path, HTML); TOsd::self()->display(tr("Info"), tr("Storyboard exported successfully!"), TOsd::Info); } } @@ -571,7 +584,7 @@ QString path = QDir::tempPath() + QDir::separator() + TAlgorithm::randomString(8) + QDir::separator(); QDir().mkpath(path); if (!path.isEmpty()) - createHTMLFiles(path); + createHTMLFiles(path, PDF); QString pdfPath = QFileDialog::getSaveFileName(this, tr("Save PDF file"), QDir::homePath(), tr("PDF file (*.pdf)")); @@ -605,7 +618,12 @@ void TupStoryBoardDialog::postStoryboardAtServer() { #ifdef K_DEBUG - tWarning() << "TupStoryBoardDialog::postStoryBoardAtServer() - Posting in Tupitube!"; + QString msg = "TupStoryBoardDialog::postStoryBoardAtServer() - Posting in Tupitube!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif saveLastComponent(); diff -Nru tupi-0.2+git04/src/components/paintarea/tupstoryboarddialog.h tupi-0.2+git05/src/components/paintarea/tupstoryboarddialog.h --- tupi-0.2+git04/src/components/paintarea/tupstoryboarddialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupstoryboarddialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,9 +36,15 @@ #ifndef TUPSTORYBOARDDIALOG_H #define TUPSTORYBOARDDIALOG_H +#include "tglobal.h" #include "tupscene.h" #include "tupstoryboard.h" #include "tupexportinterface.h" +#include "tapplicationproperties.h" +#include "tconfig.h" +#include "tseparator.h" +#include "talgorithm.h" +#include "tosd.h" #include #include @@ -46,15 +52,33 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class TupStoryBoardDialog : public QDialog +class TUPI_EXPORT TupStoryBoardDialog : public QDialog { Q_OBJECT public: TupStoryBoardDialog(bool isNetworked, TupExportInterface *imagePlugin, const QColor &color, - const QSize &size, TupScene *scene, int sceneIndex, QWidget *parent); + const QSize &size, TupScene *scene, int sceneIndex, TupLibrary *library, QWidget *parent); ~TupStoryBoardDialog(); + enum DocType { HTML = 1, PDF }; private slots: void updateForm(QListWidgetItem *current, QListWidgetItem *previous); @@ -87,7 +111,7 @@ QString getSceneTitle() const; QString getSceneDuration() const; QString getSceneDescription() const; - void createHTMLFiles(const QString &path); + void createHTMLFiles(const QString &path, DocType type); void cleanDirectory(const QString &path); struct Private; diff -Nru tupi-0.2+git04/src/components/paintarea/tuptoolsdialog.cpp tupi-0.2+git05/src/components/paintarea/tuptoolsdialog.cpp --- tupi-0.2+git04/src/components/paintarea/tuptoolsdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuptoolsdialog.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,13 +34,6 @@ ***************************************************************************/ #include "tuptoolsdialog.h" -#include "tapplicationproperties.h" -#include "tuptoolplugin.h" -#include "timagebutton.h" -#include "tdebug.h" - -#include -#include struct TupToolsDialog::Private { @@ -112,7 +105,7 @@ if (tools.at(i).compare("NodesTool") == 0) { TImageButton *nodes = new TImageButton(QPixmap(THEME_DIR + "icons/nodes_big.png"), 60, this, true); - nodes->setToolTip(tr("Line Selection")); + nodes->setToolTip(tr("Nodes Selection")); connect(nodes, SIGNAL(clicked()), this, SLOT(wakeUpNodeSelection())); k->layout->addWidget(nodes); diff -Nru tupi-0.2+git04/src/components/paintarea/tuptoolsdialog.h tupi-0.2+git05/src/components/paintarea/tuptoolsdialog.h --- tupi-0.2+git04/src/components/paintarea/tuptoolsdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuptoolsdialog.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,17 @@ #ifndef TUPTOOLSDIALOG_H #define TUPTOOLSDIALOG_H +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "tuptoolplugin.h" +#include "timagebutton.h" + #include #include +#include +#include -class TupToolsDialog : public QDialog +class TUPI_EXPORT TupToolsDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tuptoolstatus.cpp tupi-0.2+git05/src/components/paintarea/tuptoolstatus.cpp --- tupi-0.2+git04/src/components/paintarea/tuptoolstatus.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuptoolstatus.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tuptoolstatus.h" -#include "tdebug.h" -#include "tconfig.h" - -#include -#include -#include TupToolStatus::TupToolStatus() { diff -Nru tupi-0.2+git04/src/components/paintarea/tuptoolstatus.h tupi-0.2+git05/src/components/paintarea/tuptoolstatus.h --- tupi-0.2+git04/src/components/paintarea/tuptoolstatus.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tuptoolstatus.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,14 +36,19 @@ #ifndef TUPTOOLSTATUS_H #define TUPTOOLSTATUS_H +#include "tglobal.h" +#include "tconfig.h" #include "tupcolorwidget.h" #include "tapplicationproperties.h" #include +#include +#include +#include -class TupColorWidget; +// class TupColorWidget; -class TupToolStatus : public QWidget +class TUPI_EXPORT TupToolStatus : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/paintarea/tupvideosurface.cpp tupi-0.2+git05/src/components/paintarea/tupvideosurface.cpp --- tupi-0.2+git04/src/components/paintarea/tupvideosurface.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupvideosurface.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,4 @@ #include "tupvideosurface.h" -#include "tdebug.h" struct TupVideoSurface::Private { diff -Nru tupi-0.2+git04/src/components/paintarea/tupvideosurface.h tupi-0.2+git05/src/components/paintarea/tupvideosurface.h --- tupi-0.2+git04/src/components/paintarea/tupvideosurface.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/paintarea/tupvideosurface.h 2014-12-15 14:21:32.000000000 +0000 @@ -1,17 +1,20 @@ #ifndef TUPVIDEOSURFACE_H #define TUPVIDEOSURFACE_H +#include "tglobal.h" + #include +#include #include #include #include -class VideoIF { +class TUPI_EXPORT VideoIF { public: virtual void updateVideo() = 0; }; -class TupVideoSurface: public QAbstractVideoSurface +class TUPI_EXPORT TupVideoSurface: public QAbstractVideoSurface { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/pen/pen.pri tupi-0.2+git05/src/components/pen/pen.pri --- tupi-0.2+git04/src/components/pen/pen.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/pen/pen.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$PEN_DIR -LIBS += -L$$PEN_DIR -ltupipen + +unix { + LIBS += -L$$PEN_DIR -ltupipen +} + +win32 { + LIBS += -L$$PEN_DIR/release/ -ltupipen +} linux-g++ { PRE_TARGETDEPS += $$PEN_DIR/libtupipen.so diff -Nru tupi-0.2+git04/src/components/pen/pen.pro tupi-0.2+git05/src/components/pen/pen.pro --- tupi-0.2+git04/src/components/pen/pen.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/pen/pen.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/pen -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -18,9 +15,43 @@ *:!macx{ CONFIG += dll warn_on } + TEMPLATE = lib TARGET = tupipen FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/pen/tuppenwidget.cpp tupi-0.2+git05/src/components/pen/tuppenwidget.cpp --- tupi-0.2+git04/src/components/pen/tuppenwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/pen/tuppenwidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tuppenwidget.h" -#include "tglobal.h" -#include "tdebug.h" -#include "tconfig.h" - -#include "tuppaintareaevent.h" -#include "tuppenthicknesswidget.h" - -#include struct TupPenWidget::Private { @@ -86,12 +78,25 @@ k->style = new QComboBox(); k->style->setIconSize(QSize(140, 13)); - + + int flag = Qt::SolidLine; + k->style->addItem(QIcon(THEME_DIR + "icons/line_style01.png"), tr("Solid"), QVariant(flag)); + flag = Qt::DashLine; + k->style->addItem(QIcon(THEME_DIR + "icons/line_style02.png"), tr("Dash"), QVariant(flag)); + flag = Qt::DotLine; + k->style->addItem(QIcon(THEME_DIR + "icons/line_style03.png"), tr("Dot"), QVariant(flag)); + flag = Qt::DashDotLine; + k->style->addItem(QIcon(THEME_DIR + "icons/line_style04.png"), tr("Dash dot"), QVariant(flag)); + flag = Qt::DashDotDotLine; + k->style->addItem(QIcon(THEME_DIR + "icons/line_style05.png"), tr("Dash dot dot"), QVariant(flag)); + +/* k->style->addItem(QIcon(THEME_DIR + "icons/line_style01.png"), tr("Solid"), Qt::SolidLine); k->style->addItem(QIcon(THEME_DIR + "icons/line_style02.png"), tr("Dash"), Qt::DashLine); k->style->addItem(QIcon(THEME_DIR + "icons/line_style03.png"), tr("Dot"), Qt::DotLine); k->style->addItem(QIcon(THEME_DIR + "icons/line_style04.png"), tr("Dash dot"), Qt::DashDotLine); k->style->addItem(QIcon(THEME_DIR + "icons/line_style05.png"), tr("Dash dot dot"), Qt::DashDotDotLine); +*/ addChild(k->style); connect(k->style, SIGNAL(currentIndexChanged(int)), this, SLOT(setStyle(int))); @@ -146,9 +151,13 @@ TupPenWidget::~TupPenWidget() { #ifdef K_DEBUG - TEND; - #endif - + #ifdef Q_OS_WIN32 + qDebug() << "[~TupPenWidget()]"; + #else + TEND; + #endif + #endif + delete k; } diff -Nru tupi-0.2+git04/src/components/pen/tuppenwidget.h tupi-0.2+git05/src/components/pen/tuppenwidget.h --- tupi-0.2+git04/src/components/pen/tuppenwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/pen/tuppenwidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,13 +36,18 @@ #ifndef TUPPENWIDGET_H #define TUPPENWIDGET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "teditspinbox.h" +#include "tconfig.h" +#include "tuppaintareaevent.h" +#include "tuppenthicknesswidget.h" #include #include #include #include +#include class TupPaintAreaEvent; @@ -50,7 +55,7 @@ * @author David Cuadrado */ -class TupPenWidget : public TupModuleWidgetBase +class TUPI_EXPORT TupPenWidget : public TupModuleWidgetBase { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/scenes/scenes.pri tupi-0.2+git05/src/components/scenes/scenes.pri --- tupi-0.2+git04/src/components/scenes/scenes.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/scenes.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$SCENES_DIR -LIBS += -L$$SCENES_DIR -ltupiscenes + +unix { + LIBS += -L$$SCENES_DIR -ltupiscenes +} + +win32 { + LIBS += -L$$SCENES_DIR/release/ -ltupiscenes +} linux-g++ { PRE_TARGETDEPS += $$SCENES_DIR/libtupiscenes.so diff -Nru tupi-0.2+git04/src/components/scenes/scenes.pro tupi-0.2+git05/src/components/scenes/scenes.pro --- tupi-0.2+git04/src/components/scenes/scenes.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/scenes.pro 2014-12-15 14:21:32.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/scenes -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -26,4 +23,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/ -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/scenes/tupscenesdelegate.cpp tupi-0.2+git05/src/components/scenes/tupscenesdelegate.cpp --- tupi-0.2+git04/src/components/scenes/tupscenesdelegate.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/tupscenesdelegate.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,9 +34,6 @@ ***************************************************************************/ #include "tupscenesdelegate.h" -#include "tdebug.h" - -#include TupScenesDelegate::TupScenesDelegate(QObject *parent) : QItemDelegate(parent) diff -Nru tupi-0.2+git04/src/components/scenes/tupscenesdelegate.h tupi-0.2+git05/src/components/scenes/tupscenesdelegate.h --- tupi-0.2+git04/src/components/scenes/tupscenesdelegate.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/tupscenesdelegate.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,10 +36,14 @@ #ifndef TUPSCENESDELEGATE_H #define TUPSCENESDELEGATE_H +#include "tglobal.h" + +#include +#include #include #include -class TupScenesDelegate : public QItemDelegate +class TUPI_EXPORT TupScenesDelegate : public QItemDelegate { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/scenes/tupsceneslist.cpp tupi-0.2+git05/src/components/scenes/tupsceneslist.cpp --- tupi-0.2+git04/src/components/scenes/tupsceneslist.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/tupsceneslist.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tupsceneslist.h" -#include "tdebug.h" - -#include -#include // SQA: Add support for renaming and moving objects from the list @@ -50,7 +46,8 @@ { k->scenesTotal = 0; setHeaderLabels(QStringList() << ""); - header()->setResizeMode(QHeaderView::ResizeToContents); + // header()->setResizeMode(QHeaderView::ResizeToContents); + header()->setSectionResizeMode(QHeaderView::ResizeToContents); setColumnCount(1); setItemDelegate(new TupScenesDelegate(this)); @@ -181,7 +178,11 @@ void TupScenesList::resetUI() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesList::resetUI()]"; + #else + T_FUNCINFO; + #endif #endif blockSignals(true); diff -Nru tupi-0.2+git04/src/components/scenes/tupsceneslist.h tupi-0.2+git05/src/components/scenes/tupsceneslist.h --- tupi-0.2+git04/src/components/scenes/tupsceneslist.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/tupsceneslist.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,18 +36,20 @@ #ifndef TUPSCENESLIST_H #define TUPSCENESLIST_H +#include "tglobal.h" #include "treelistwidget.h" #include "tupscenesdelegate.h" #include #include #include +#include /** * @author Jorge Cuadrado */ -class TupScenesList : public TreeListWidget +class TUPI_EXPORT TupScenesList : public TreeListWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/scenes/tupsceneswidget.cpp tupi-0.2+git05/src/components/scenes/tupsceneswidget.cpp --- tupi-0.2+git04/src/components/scenes/tupsceneswidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/tupsceneswidget.cpp 2014-12-15 14:21:32.000000000 +0000 @@ -34,22 +34,6 @@ ***************************************************************************/ #include "tupsceneswidget.h" -#include "tupprojectrequest.h" -#include "tupprojectactionbar.h" -#include "tuprequestbuilder.h" - -#include "tglobal.h" -#include "tdebug.h" -#include "timagebutton.h" -#include "toptionaldialog.h" -#include "tconfig.h" - -#include -#include -#include -#include -#include -#include struct TupScenesWidget::Private { @@ -63,7 +47,11 @@ TupScenesWidget::TupScenesWidget(QWidget *parent) : TupModuleWidgetBase(parent, "TupScenesWidget"), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesWidget()]"; + #else + TINIT; + #endif #endif setWindowTitle(tr("Scenes Manager")); @@ -75,8 +63,13 @@ TupScenesWidget::~TupScenesWidget() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupScenesWidget()]"; + #else + TEND; + #endif #endif + delete k; } @@ -135,7 +128,11 @@ void TupScenesWidget::selectScene(int index) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesWidget::selectScene()]"; + #else + T_FUNCINFO; + #endif #endif TupProjectRequest event = TupRequestBuilder::createSceneRequest(index, TupProjectRequest::Select); @@ -146,7 +143,11 @@ void TupScenesWidget::emitRequestInsertScene() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesWidget::emitRequestInsertScene()]"; + #else + T_FUNCINFO; + #endif #endif int index = k->scenesTable->scenesCount(); @@ -175,7 +176,11 @@ void TupScenesWidget::emitRequestRemoveScene() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesWidget::emitRequestRemoveScene()]"; + #else + T_FUNCINFO; + #endif #endif int index = k->scenesTable->currentSceneIndex(); @@ -202,7 +207,11 @@ void TupScenesWidget::closeAllScenes() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesWidget::closeAllScenes()]"; + #else + T_FUNCINFO; + #endif #endif k->scenesTable->resetUI(); @@ -211,8 +220,13 @@ void TupScenesWidget::sceneResponse(TupSceneResponse *e) { #ifdef K_DEBUG - T_FUNCINFOX("scenes"); - SHOW_VAR(e->action()); + #ifdef Q_OS_WIN32 + qDebug() << "[TupScenesWidget::sceneResponse()]"; + qDebug() << "SHOW_VAR: " << e->action(); + #else + T_FUNCINFOX("scenes"); + SHOW_VAR(e->action()); + #endif #endif int index = e->sceneIndex(); diff -Nru tupi-0.2+git04/src/components/scenes/tupsceneswidget.h tupi-0.2+git05/src/components/scenes/tupsceneswidget.h --- tupi-0.2+git04/src/components/scenes/tupsceneswidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/scenes/tupsceneswidget.h 2014-12-15 14:21:32.000000000 +0000 @@ -36,9 +36,16 @@ #ifndef TUPSCENESWIDGET_H #define TUPSCENESWIDGET_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "tupsceneslist.h" #include "treewidgetsearchline.h" +#include "tupprojectrequest.h" +#include "tupprojectactionbar.h" +#include "tuprequestbuilder.h" +#include "timagebutton.h" +#include "toptionaldialog.h" +#include "tconfig.h" #include #include @@ -47,10 +54,14 @@ #include #include #include +#include +#include +#include +#include class TupSceneResponse; -class TupScenesWidget : public TupModuleWidgetBase +class TUPI_EXPORT TupScenesWidget : public TupModuleWidgetBase { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/timeline/timeline.pri tupi-0.2+git05/src/components/timeline/timeline.pri --- tupi-0.2+git04/src/components/timeline/timeline.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/timeline.pri 2014-12-15 14:21:32.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$TIMELINE_DIR -LIBS += -L$$TIMELINE_DIR -ltupitimeline + +unix { + LIBS += -L$$TIMELINE_DIR -ltupitimeline +} + +win32 { + LIBS += -L$$TIMELINE_DIR\release -ltupitimeline +} linux-g++ { PRE_TARGETDEPS += $$TIMELINE_DIR/libtupitimeline.so diff -Nru tupi-0.2+git04/src/components/timeline/timeline.pro tupi-0.2+git05/src/components/timeline/timeline.pro --- tupi-0.2+git04/src/components/timeline/timeline.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/timeline.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/timeline -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -11,18 +8,17 @@ } HEADERS += tuptimeline.h \ - tuplayermanager.h \ - tuptlruler.h \ - tupframestable.h \ - tuplayerindex.h \ - tuplayercontrols.h + tuptimelineruler.h \ + tuptimelinetable.h \ + # tuplayerindex.h \ + tuptimelineheader.h SOURCES += tuptimeline.cpp \ - tuplayermanager.cpp \ - tuptlruler.cpp \ - tupframestable.cpp \ - tuplayerindex.cpp \ - tuplayercontrols.cpp + tuptimelineruler.cpp \ + tuptimelinetable.cpp \ + # tuplayerindex.cpp \ + tuptimelineheader.cpp + *:!macx{ CONFIG += dll warn_on } @@ -32,4 +28,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) + +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/components/timeline/tupframestable.cpp tupi-0.2+git05/src/components/timeline/tupframestable.cpp --- tupi-0.2+git04/src/components/timeline/tupframestable.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tupframestable.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,514 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "tupframestable.h" - -#include -#include -#include -#include -#include -#include - -#include "tdebug.h" -#include "tuptlruler.h" -//#include "tupprojectrequest.h" -#include "tupprojectactionbar.h" - -////////// TupFramesTableItemDelegate /////////// - -class TupFramesTableItemDelegate : public QAbstractItemDelegate -{ - public: - TupFramesTableItemDelegate(QObject * parent = 0); - ~TupFramesTableItemDelegate(); - virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; - virtual QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; -}; - -TupFramesTableItemDelegate::TupFramesTableItemDelegate(QObject * parent) : QAbstractItemDelegate(parent) -{ -} - -TupFramesTableItemDelegate::~TupFramesTableItemDelegate() -{ -} - -void TupFramesTableItemDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const -{ - Q_ASSERT(index.isValid()); - - TupFramesTable *table = qobject_cast(index.model()->parent()); - TupFramesTableItem *item = dynamic_cast(table->itemFromIndex(index)); - - QVariant value; - QStyleOptionViewItem opt = option; - - // draw the background color - value = index.data(Qt::BackgroundColorRole); - - if (value.isValid()) { - - painter->save(); - - bool sound = table->isSoundLayer(index.row()); - - if (!sound) - painter->fillRect(option.rect, value.value()); - - painter->restore(); - - } else { - - painter->save(); - - bool sound = table->isSoundLayer(index.row()); - - if (!sound) { - int counter = index.column() + 1; - if (counter == 1 || counter % 5 == 0) - painter->fillRect(option.rect, QColor(230, 230, 230)); - else - painter->fillRect(option.rect, Qt::white); - } else { - - } - - painter->restore(); - } - - // Selection! - if (option.showDecorationSelected && (option.state & QStyle::State_Selected)) { - - QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; - painter->save(); - painter->setPen(QPen(option.palette.brush(cg, QPalette::Highlight), 3)); - painter->fillRect(option.rect, QColor(250, 209, 132, 255)); - painter->restore(); - - } - - // Draw attributes - - int offset = option.rect.width() - 5; - - if (item && index.isValid()) { - - if (item->isUsed()) { - painter->save(); - painter->setBrush(Qt::black); - painter->setRenderHint(QPainter::Antialiasing, true); - - if (!item->isSound()) { - painter->drawEllipse(option.rect.x() + ((option.rect.width() - offset)/2), - option.rect.y() + ((option.rect.height() + offset)/2), - offset, offset); - } else { - painter->setBrush(Qt::blue); - painter->drawRect(option.rect.left(), option.rect.bottom() - offset, offset - 2, offset - 2); - } - - painter->restore(); - } - - if (item->isLocked()) { - painter->save(); - painter->setBrush(Qt::red); - painter->drawEllipse(option.rect.left(), option.rect.bottom() - offset, offset, offset); - painter->restore(); - } - } -} - -QSize TupFramesTableItemDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const -{ - Q_ASSERT(index.isValid()); - const QAbstractItemModel *model = index.model(); - Q_ASSERT(model); - - QVariant value = model->data(index, Qt::FontRole); - QFont fnt = value.isValid() ? qvariant_cast(value) : option.font; - QString text = model->data(index, Qt::DisplayRole).toString(); - QRect pixmapRect; - if (model->data(index, Qt::DecorationRole).isValid()) - pixmapRect = QRect(0, 0, option.decorationSize.width(), option.decorationSize.height()); - - QFontMetrics fontMetrics(fnt); - - return (pixmapRect).size(); -} - -////////// TupFramesTableItem //////// - -TupFramesTableItem::TupFramesTableItem() -{ -} - -TupFramesTableItem::~TupFramesTableItem() -{ -} - -bool TupFramesTableItem::isUsed() -{ - return data(IsUsed).toBool(); -} - -bool TupFramesTableItem::isLocked() -{ - return data(IsLocked).toBool(); -} - -bool TupFramesTableItem::isSound() -{ - QVariant data = this->data(IsSound); - - if (data.canConvert()) { - return data.toBool(); - } - - return false; -} - -//// TupFramesTable - -struct TupFramesTable::Private -{ - struct LayerItem { - LayerItem() : lastItem(-1), sound(false) {}; - int lastItem; - bool sound; - }; - - int rectWidth; - int rectHeight; - int sceneIndex; - int layerIndex; - int frameIndex; - QList layers; - TupTLRuler *ruler; -}; - -TupFramesTable::TupFramesTable(int sceneIndex, QWidget *parent) : QTableWidget(0, 100, parent), k(new Private) -{ - k->sceneIndex = sceneIndex; - k->frameIndex = 0; - k->layerIndex = 0; - k->ruler = new TupTLRuler; - setup(); -} - -TupFramesTable::~TupFramesTable() -{ - delete k; -} - -void TupFramesTable::setup() -{ - setItemDelegate(new TupFramesTableItemDelegate(this)); - setSelectionBehavior(QAbstractItemView::SelectItems); - setSelectionMode(QAbstractItemView::SingleSelection); - - setHorizontalHeader(k->ruler); - - connect(this, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(emitRequestSelectFrame(int, int, int, int))); - - connect(k->ruler, SIGNAL(logicalSectionSelected(int)), this, SLOT(emitFrameSelected(int))); - - // connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(emitFrameSelectionChanged())); - - connect(this, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, - SLOT(emitFrameSelected(QTableWidgetItem *, QTableWidgetItem *))); - - verticalHeader()->hide(); - - setItemSize(10, 25); - - horizontalHeader()->setResizeMode(QHeaderView::Custom); - verticalHeader()->setResizeMode(QHeaderView::Custom); - - // horizontalHeader()->setSectionResizeMode(QHeaderView::Custom); - // verticalHeader()->setSectionResizeMode(QHeaderView::Custom); -} - -void TupFramesTable::emitFrameSelected(int col) -{ - selectColumn(col); - - TupFramesTableItem *item = dynamic_cast(this->item(currentRow(), col)); - - if (item) { - if (item->isUsed()) - emit emitRequestChangeFrame(k->sceneIndex, verticalHeader()->visualIndex(this->row(item)), this->column(item)); - //emit frameRequest(TupProjectActionBar::SelectFrame, this->column(item), verticalHeader()->visualIndex(this->row(item)), -1); - } -} - -/* -void TupFramesTable::emitFrameSelectionChanged() -{ - TupFramesTableItem *item = dynamic_cast(this->item(currentRow(), currentColumn())); - - if (!item) - emit frameRequest(TupProjectActionBar::InsertFrame, currentColumn(), currentRow(), k->sceneIndex); -} -*/ - -void TupFramesTable::emitFrameSelected(QTableWidgetItem *current, QTableWidgetItem *prev) -{ - Q_UNUSED(prev); - - TupFramesTableItem *item = dynamic_cast(current); - - if (item) { - if (item->isUsed()) - emit emitRequestChangeFrame(k->sceneIndex, verticalHeader()->visualIndex(this->row(item)), this->column(item)); - // emit frameRequest(TupProjectActionBar::SelectFrame, this->column(item), verticalHeader()->visualIndex(this->row(item)), -1); - else - tFatal() << "TupFramesTable::emitFrameSelected <- item exists but isn't used right now"; - } else { - emit frameRequest(TupProjectActionBar::InsertFrame, currentColumn(), currentRow(), k->sceneIndex); - } -} - -void TupFramesTable::setItemSize(int w, int h) -{ - k->rectHeight = h; - k->rectWidth = w; - - fixSize(); -} - -bool TupFramesTable::isSoundLayer(int row) -{ - if (row < 0 && row >= k->layers.count()) - return false; - - return k->layers[row].sound; -} - -void TupFramesTable::insertLayer(int pos, const QString &name) -{ - Q_UNUSED(name); - - insertRow(pos); - - Private::LayerItem layer; - layer.sound = false; - k->layers.insert(pos, layer); - - fixSize(); -} - -void TupFramesTable::insertSoundLayer(int layerPos, const QString &name) -{ - Q_UNUSED(name); - - insertRow(layerPos); - - Private::LayerItem layer; - layer.sound = true; - k->layers.insert(layerPos, layer); - - fixSize(); -} - -void TupFramesTable::removeCurrentLayer() -{ - int pos = verticalHeader()->logicalIndex(currentRow()); - removeLayer(pos); -} - -void TupFramesTable::removeLayer(int pos) -{ - pos = verticalHeader()->logicalIndex(pos); - removeRow( pos ); - k->layers.removeAt(pos); -} - -void TupFramesTable::moveLayer(int position, int newPosition) -{ - if (position < 0 || position >= rowCount() || newPosition < 0 || newPosition >= rowCount()) - return; - - blockSignals(true); - - verticalHeader()->moveSection(position, newPosition); - - blockSignals(false); - - /* - - TupFramesTableItem *item1 = takeItem(position, 0); - - bool up = true; - if (position > newPosition) { - up = false; // down - } - - if (up) { - for (int i = position+1; i <= newPosition; i++) { - setItem(i-1, 0, takeItem(i, 0)); - } - } else { - for (int i = position-1;i >= newPosition;i--) { - setItem(i+1, 0, takeItem(i, 0)); - } - } - - setItem(newPosition, 0, item1); - - setCurrentItem(item1); - */ -} - -int TupFramesTable::lastFrameByLayer(int layerPos) -{ - int pos = verticalHeader()->logicalIndex(layerPos); - - if (pos < 0 || pos > k->layers.count()) { - return -1; - } - - return k->layers[pos].lastItem; -} - -// FRAMES - - -void TupFramesTable::insertFrame(int layerPos, const QString &name) -{ - Q_UNUSED(name); - - if (layerPos < 0 || layerPos >= k->layers.count()) - return; - - layerPos = verticalHeader()->logicalIndex(layerPos); - - k->layers[layerPos].lastItem++; - - if (k->layers[layerPos].lastItem >= columnCount()) - insertColumn(k->layers[layerPos].lastItem); - - setAttribute(layerPos, k->layers[layerPos].lastItem, TupFramesTableItem::IsUsed, true); - setAttribute(layerPos, k->layers[layerPos].lastItem, TupFramesTableItem::IsSound, k->layers[layerPos].sound); - - viewport()->update(); -} - -void TupFramesTable::setCurrentFrame(TupFramesTableItem *item) -{ - setCurrentItem(item); -} - -void TupFramesTable::setCurrentLayer(int layerPos) -{ - setCurrentItem(item(verticalHeader()->logicalIndex(layerPos), 0)); -} - -void TupFramesTable::selectFrame(int index) -{ - setCurrentItem(item(currentRow(), index)); -} - -void TupFramesTable::removeFrame(int layerPos, int position) -{ - Q_UNUSED(position); - - /* - for (int frameIndex = position; frameIndex < columnCount(); frameIndex++) - setAttribute( layerPos, position, TupFramesTableItem::IsUsed, false); - */ - - if (layerPos < 0 || layerPos >= k->layers.count()) - return; - - layerPos = verticalHeader()->logicalIndex(layerPos); - setAttribute(layerPos, k->layers[layerPos].lastItem, TupFramesTableItem::IsUsed, false); - k->layers[layerPos].lastItem--; - viewport()->update(); -} - -void TupFramesTable::lockFrame(int layerPos, int position, bool lock) -{ - if (layerPos < 0 || layerPos >= k->layers.count()) - return; - - layerPos = verticalHeader()->logicalIndex(layerPos); - setAttribute(layerPos, position, TupFramesTableItem::IsLocked, lock); - viewport()->update(); -} - -void TupFramesTable::setAttribute(int row, int col, TupFramesTableItem::Attributes att, bool value) -{ - QTableWidgetItem *item = this->item(row, col); - - if (!item) { - item = new TupFramesTableItem; - setItem(row, col, item); - } - - item->setData(att, value); -} - -void TupFramesTable::fixSize() -{ - for (int column = 0; column < columnCount(); column++) { - horizontalHeader()->resizeSection(column, k->rectWidth); - } - - for (int row = 0; row < rowCount(); row++) { - verticalHeader()->resizeSection(row, k->rectHeight); - } -} - -/* -void TupFramesTable::fixSectionMoved(int logical, int visual, int newVisual) -{ - verticalHeader()->moveSection(newVisual, visual); -} -*/ - -void TupFramesTable::emitRequestSelectFrame(int currentRow, int currentColumn, int previousRow, int previousColumn) -{ - Q_UNUSED(previousRow); - Q_UNUSED(previousColumn); - - if (k->frameIndex != currentColumn || k->layerIndex != currentRow) { - k->frameIndex = currentColumn; - k->layerIndex = currentRow; - emit emitSelection(currentRow, currentColumn); - } -} - diff -Nru tupi-0.2+git04/src/components/timeline/tupframestable.h tupi-0.2+git05/src/components/timeline/tupframestable.h --- tupi-0.2+git04/src/components/timeline/tupframestable.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tupframestable.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPFRAMESTABLE_H -#define TUPFRAMESTABLE_H - -#include -#include -#include - -class TupFramesTable; -class TupFramesTableItemDelegate; - -class TupFramesTableItem : public QTableWidgetItem -{ - public: - enum Attributes - { - IsUsed = 0x01, - IsLocked, - IsSound - }; - - TupFramesTableItem(); - virtual ~TupFramesTableItem(); - - bool isUsed(); - bool isLocked(); - bool isSound(); -}; - -class TupTLRuler; - -/** - * @author David Cuadrado -*/ -class TupFramesTable : public QTableWidget -{ - Q_OBJECT; - - friend class TupFramesTableItemDelegate; - - public: - TupFramesTable(int sceneIndex = 0, QWidget *parent = 0); - ~TupFramesTable(); - - bool isSoundLayer(int row); - - public slots: - // Layers - void insertLayer(int layerPos, const QString &name); - void insertSoundLayer(int layerPos, const QString &name); - - void removeCurrentLayer(); - void removeLayer(int pos); - void moveLayer(int pos, int newPos); - - int lastFrameByLayer(int layerPos); - - // Frames - void insertFrame(int layerPos, const QString &name); - - void setCurrentFrame(TupFramesTableItem *); - void setCurrentLayer(int layerPos); - void selectFrame(int index); - - void setAttribute(int row, int col, TupFramesTableItem::Attributes att, bool value); - - void removeFrame(int layerPos, int position); - - void lockFrame(int layerPosition, int position, bool lock); - - void setItemSize(int w, int h); - - private: - void setup(); - - protected: - void fixSize(); - - private slots: - void emitFrameSelected(int col); - // void emitFrameSelectionChanged(); - void emitFrameSelected(QTableWidgetItem *curr, QTableWidgetItem *prev); - void emitRequestSelectFrame(int currentRow, int currentColumn, int previousRow, int previousColumn); - - signals: - void frameRequest(int action, int frame, int layer, int scene, const QVariant &argument = QVariant()); - void emitRequestChangeFrame(int sceneIndex, int layerIndex, int frameIndex); - void emitSelection(int currentRow, int currentColumn); - - private: - struct Private; - Private *const k; -}; - -#endif diff -Nru tupi-0.2+git04/src/components/timeline/tuplayercontrols.cpp tupi-0.2+git05/src/components/timeline/tuplayercontrols.cpp --- tupi-0.2+git04/src/components/timeline/tuplayercontrols.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuplayercontrols.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,335 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "tuplayercontrols.h" -#include "tuprequestbuilder.h" - -#include -#include - -#include -#include -#include -#include - -#include "tseparator.h" -#include "tapplication.h" -#include "tdebug.h" - -const int LOCK_COLUMN = 0; -const int VIEW_COLUMN = 1; - -// Header - -class TupLayerControlsHeader : public QHeaderView -{ - public: - TupLayerControlsHeader(QWidget * parent = 0); - ~TupLayerControlsHeader(); - void paintSection(QPainter *painter, const QRect & rect, int logicalIndex) const; - - private: - QPixmap m_lockIcon; - QPixmap m_viewIcon; -}; - -TupLayerControlsHeader::TupLayerControlsHeader(QWidget * parent) : QHeaderView(Qt::Horizontal , parent) -{ - // setClickable(true); - setCascadingSectionResizes(true); - setFixedHeight(26); - - m_lockIcon = QPixmap(THEME_DIR + "icons/padlock.png"); - m_viewIcon = QPixmap(THEME_DIR + "icons/show_hide_all_layers.png"); -} - -TupLayerControlsHeader::~TupLayerControlsHeader() -{ -} - -void TupLayerControlsHeader::paintSection(QPainter * painter, const QRect & rect, int logicalIndex) const -{ - if (!rect.isValid()) - return; - - QStyleOptionHeader headerOption; - headerOption.rect = rect; - headerOption.orientation = Qt::Horizontal; - headerOption.position = QStyleOptionHeader::Middle; - - QStyle::State state = QStyle::State_None; - - if (isEnabled()) - state |= QStyle::State_Enabled; - - if (window()->isActiveWindow()) - state |= QStyle::State_Active; - - style()->drawControl(QStyle::CE_HeaderSection, &headerOption, painter); - - switch (logicalIndex) { - case LOCK_COLUMN: - { - painter->drawPixmap(QPointF(rect.x() + (rect.width()-10)/2, rect.y() + 6), m_lockIcon, QRectF(0, 0, 10, 13)); - } - break; - case VIEW_COLUMN: - { - painter->drawPixmap(QPointF(rect.x() + (rect.width()-16)/2, rect.y() + 5), m_viewIcon, QRectF(0, 0, 16, 16)); - } - break; - } -} - -// DELEGATE - -class TupLayerControlsItemDelegate : public QItemDelegate -{ - public: - TupLayerControlsItemDelegate(QObject * parent = 0); - ~TupLayerControlsItemDelegate(); - virtual void drawCheck(QPainter *painter, const QStyleOptionViewItem &option, const QRect &, Qt::CheckState state) const; - virtual void drawFocus(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) const; - virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; -}; - -TupLayerControlsItemDelegate::TupLayerControlsItemDelegate(QObject * parent) : QItemDelegate(parent) -{ -} - -TupLayerControlsItemDelegate::~TupLayerControlsItemDelegate() -{ -} - -void TupLayerControlsItemDelegate::drawCheck(QPainter *painter, const QStyleOptionViewItem &option, - const QRect &, Qt::CheckState state) const -{ - Q_UNUSED(painter); - Q_UNUSED(option); - Q_UNUSED(state); - - // const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1; - - /* - QRect checkRect = QStyle::alignedRect(option.direction, Qt::AlignCenter, - check(option, option.rect, Qt::Checked).size(), - QRect(option.rect.x() + textMargin, option.rect.y(), - option.rect.width() - (textMargin * 2), option.rect.height())); - QItemDelegate::drawCheck(painter, option, checkRect, state); - */ -} - -void TupLayerControlsItemDelegate::drawFocus(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) const -{ - Q_UNUSED(painter); - Q_UNUSED(option); - Q_UNUSED(rect); -} - -void TupLayerControlsItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex & index) const -{ - QItemDelegate::paint(painter, option, index); -} - -//////////////////////////////// - -struct TupLayerControls::Private -{ - Private() : allSelected(false), allVisible(true), allLock(false), rowHeight(20), sceneIndex(0) {} - - bool allSelected, allVisible, allLock; - int rowHeight; - int sceneIndex; -}; - -TupLayerControls::TupLayerControls(int sceneIndex, QWidget *parent) : QTableWidget(0, 2, parent), k(new Private) -{ - #ifdef K_DEBUG - TINIT; - #endif - - setItemDelegate(new TupLayerControlsItemDelegate(this)); - - k->sceneIndex = sceneIndex; - setSelectionMode(QAbstractItemView::SingleSelection); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - - QTableWidgetItem *prototype = new QTableWidgetItem; - prototype->setTextAlignment(Qt::AlignCenter); - prototype->setBackgroundColor(palette().text().color()); - prototype->setTextColor(palette().background().color()); - - setItemPrototype(prototype); - setHorizontalHeader(new TupLayerControlsHeader(this)); - setHorizontalHeaderLabels(QStringList() << tr("") << tr("")); - verticalHeader()->hide(); - - setHorizontalHeader(new TupLayerControlsHeader(this)); - - connect(this, SIGNAL(cellClicked(int, int)), this, SLOT(setLocalRequest(int, int))); -} - -TupLayerControls::~TupLayerControls() -{ - #ifdef K_DEBUG - TEND; - #endif - - delete k; -} - -void TupLayerControls::insertLayer(int position) -{ - if (position >= 0 && position <= rowCount()) { - - insertRow(position); - - QTableWidgetItem *lockItem = new QTableWidgetItem; - lockItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); - lockItem->setCheckState(Qt::Unchecked); - - setItem(position, 0, lockItem); - - QTableWidgetItem *viewItem = new QTableWidgetItem; - viewItem->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); - viewItem->setCheckState(Qt::Checked); - - setItem(position, 1, viewItem); - - fixSize(); - } -} - -void TupLayerControls::insertSoundLayer(int position, const QString &name) -{ - Q_UNUSED(name); - - if (position >= 0 && position <= rowCount()) { - fixSize(); - } -} - -void TupLayerControls::removeLayer(int position) -{ - removeRow(verticalHeader()->logicalIndex(position)); -} - -void TupLayerControls::renameLayer(int position, const QString &name) -{ - QTableWidgetItem *item = this->item(0, verticalHeader()->logicalIndex(position)); - - if (item) - item->setText(name); -} - -void TupLayerControls::resizeEvent(QResizeEvent *) -{ - fixSize(); -} - -void TupLayerControls::fixSize() -{ - /* - int offset = 0; - - if (verticalScrollBar()->isVisible()) - offset = verticalScrollBar()->width()-2; - else - offset = -2; - */ - - // int width = this->width() - offset; - horizontalHeader()->resizeSection(0, 20); - horizontalHeader()->resizeSection(1, 20); - - for (int row = 0; row < rowCount(); row++) - verticalHeader()->resizeSection(row, k->rowHeight); -} - -void TupLayerControls::setRowHeight(int rowHeight) -{ - k->rowHeight = rowHeight; -} - -void TupLayerControls::commitData(QWidget *editor) -{ - Q_UNUSED(editor); -} - -void TupLayerControls::moveLayer(int position, int newPosition) -{ - if (position < 0 || position >= rowCount() || newPosition < 0 || newPosition >= rowCount()) - return; - - verticalHeader()->moveSection((position), (newPosition)); -} - -void TupLayerControls::lockLayer(int position, bool locked) -{ - Q_UNUSED(locked); - - if (position < 0 || position >= rowCount()) - return; -} - -void TupLayerControls::setLocalRequest(int layerIndex, int column) -{ - if (column == 0) { - tFatal() << "TupLayerControls::setLocalRequest -> Column 0!"; - } - - if (column == 1) { - QTableWidgetItem *item = this->item(verticalHeader()->logicalIndex(layerIndex), 1); - - bool checked = false; - if (item->checkState() == Qt::Checked) - checked = true; - - emit layerVisibility(k->sceneIndex, layerIndex, checked); - } - - emit localRequest(); -} - -void TupLayerControls::setLayerVisibility(int layerIndex, const QString &isChecked) -{ - QTableWidgetItem *item = this->item(verticalHeader()->logicalIndex(layerIndex), 1); - - if (isChecked.compare("true")==0) - item->setCheckState(Qt::Checked); - else - item->setCheckState(Qt::Unchecked); -} diff -Nru tupi-0.2+git04/src/components/timeline/tuplayercontrols.h tupi-0.2+git05/src/components/timeline/tuplayercontrols.h --- tupi-0.2+git04/src/components/timeline/tuplayercontrols.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuplayercontrols.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPLAYERCONTROLS_H -#define TUPLAYERCONTROLS_H - -#include -#include -#include -#include -#include -#include - -#include "timagebutton.h" -#include "tupprojectrequest.h" -#include "tapplicationproperties.h" - -/** - * @author David Cuadrado -**/ - -class TupLayerControls : public QTableWidget -{ - Q_OBJECT - - friend class TupLayerControlsItemDelegate; - - public: - enum Actions - { - NoAction = 0, - ShowOutlines, - LockLayers, - ToggleLayerView, - InsertLayer, - RemoveLayer, - MoveLayerUp, - MoveLayerDown - }; - - /** - * Default constructor - * @param parent - * @return - */ - TupLayerControls(int sceneIndex=0, QWidget *parent = 0); - ~TupLayerControls(); - - void insertLayer(int position); - void insertSoundLayer(int position, const QString &name); - void removeLayer(int position); - void renameLayer(int position, const QString &name); - void moveLayer(int position, int newPosition); - void lockLayer(int position, bool locked); - void setRowHeight(int rowHeight); - void setLayerVisibility(int layerIndex, const QString &isChecked); - - protected: - void resizeEvent(QResizeEvent *e); - virtual void fixSize(); - - protected slots: - void commitData(QWidget * editor); - void setLocalRequest(int row, int column); - - //void emitSelectionSignal(); - - signals: - void requestRenameEvent(int layerPosition, const QString &newName); - void localRequest(); - void layerVisibility(int sceneIndex, int layerIndex, bool checked); - - // void requestTriggered(const TupProjectRequest *event); - - private: - struct Private; - Private *const k; -}; - -#endif diff -Nru tupi-0.2+git04/src/components/timeline/tuplayerindex.cpp tupi-0.2+git05/src/components/timeline/tuplayerindex.cpp --- tupi-0.2+git04/src/components/timeline/tuplayerindex.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuplayerindex.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,25 +34,12 @@ ***************************************************************************/ #include "tuplayerindex.h" -#include "tuprequestbuilder.h" -#include -#include - -#include -#include -#include -#include - -#include "tseparator.h" -#include "tapplication.h" -#include "tdebug.h" - -const int LAYER_COLUMN = 0; +// const int LAYER_COLUMN = 0; // Header -class TupLayerIndexHeader : public QHeaderView +class TUPI_EXPORT TupLayerIndexHeader : public QHeaderView { public: TupLayerIndexHeader(QWidget * parent = 0); @@ -160,7 +147,11 @@ TupLayerIndex::TupLayerIndex(int sceneIndex, QWidget *parent) : QTableWidget(0, 1, parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupLayerIndex()]"; + #else + TINIT; + #endif #endif k->sceneIndex = sceneIndex; @@ -187,7 +178,11 @@ TupLayerIndex::~TupLayerIndex() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupLayerIndex()]"; + #else + TEND; + #endif #endif delete k; @@ -196,7 +191,6 @@ void TupLayerIndex::insertLayer(int position, const QString &name) { if (position >= 0 && position <= rowCount()) { - QTableWidgetItem *newLayer = new QTableWidgetItem(name); newLayer->setFont(QFont("Arial", 8, QFont::Normal, false)); newLayer->setTextAlignment(Qt::AlignCenter); diff -Nru tupi-0.2+git04/src/components/timeline/tuplayerindex.h tupi-0.2+git05/src/components/timeline/tuplayerindex.h --- tupi-0.2+git04/src/components/timeline/tuplayerindex.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuplayerindex.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,6 +36,10 @@ #ifndef TUPLAYERINDEX_H #define TUPLAYERINDEX_H +#include "tglobal.h" +#include "tuprequestbuilder.h" +#include "tseparator.h" +#include "tapplication.h" #include "timagebutton.h" #include "tupprojectrequest.h" @@ -45,12 +49,17 @@ #include #include #include +#include +#include +#include +#include +#include /** * @author David Cuadrado **/ -class TupLayerIndex : public QTableWidget +class TUPI_EXPORT TupLayerIndex : public QTableWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/components/timeline/tuplayermanager.cpp tupi-0.2+git05/src/components/timeline/tuplayermanager.cpp --- tupi-0.2+git04/src/components/timeline/tuplayermanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuplayermanager.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,134 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "tuplayermanager.h" -#include "tapplication.h" -#include "tdebug.h" - -//////////////////////////////// - -struct TupLayerManager::Private -{ - Private() : allSelected(false), allVisible(true), allLock(false), rowHeight(20), sceneIndex(0) {} - - bool allSelected, allVisible, allLock; - int rowHeight; - int sceneIndex; - TupLayerIndex *layerIndex; - TupLayerControls *layerControls; -}; - -TupLayerManager::TupLayerManager(int sceneIndex, QWidget *parent) : QWidget(parent), k(new Private) -{ - #ifdef K_DEBUG - TINIT; - #endif - - k->layerIndex = new TupLayerIndex(sceneIndex); - k->layerIndex->setFixedWidth(200); - k->layerControls = new TupLayerControls(sceneIndex); - k->layerControls->setFixedWidth(44); - - QHBoxLayout *layout = new QHBoxLayout(this); - layout->setContentsMargins(0, 0, 0, 16); - layout->setSpacing(0); - layout->addWidget(k->layerIndex); - layout->addWidget(k->layerControls); - - setLayout(layout); - - -} - -TupLayerManager::~TupLayerManager() -{ - #ifdef K_DEBUG - TEND; - #endif - - delete k; -} - -TupLayerIndex* TupLayerManager::getLayerIndex() -{ - return k->layerIndex; -} - -TupLayerControls* TupLayerManager::getLayerControls() -{ - return k->layerControls; -} - -void TupLayerManager::insertLayer(int position, const QString &name) -{ - k->layerIndex->insertLayer(position, name); - k->layerControls->insertLayer(position); -} - -void TupLayerManager::insertSoundLayer(int position, const QString &name) -{ - Q_UNUSED(position); - Q_UNUSED(name); -} - -void TupLayerManager::removeLayer(int position) -{ - Q_UNUSED(position); -} - -void TupLayerManager::renameLayer(int position, const QString &name) -{ - Q_UNUSED(position); - Q_UNUSED(name); -} - -void TupLayerManager::resizeEvent(QResizeEvent *event) -{ - Q_UNUSED(event); - - k->layerIndex->refresh(); -} - -void TupLayerManager::moveLayer(int position, int newPosition) -{ - Q_UNUSED(position); - Q_UNUSED(newPosition); -} - -void TupLayerManager::lockLayer(int position, bool locked) -{ - Q_UNUSED(position); - Q_UNUSED(locked); -} diff -Nru tupi-0.2+git04/src/components/timeline/tuplayermanager.h tupi-0.2+git05/src/components/timeline/tuplayermanager.h --- tupi-0.2+git04/src/components/timeline/tuplayermanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuplayermanager.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPLAYERMANAGER_H -#define TUPLAYERMANAGER_H - -#include "tuplayerindex.h" -#include "tuplayercontrols.h" - -/** - * @author David Cuadrado -**/ - -class TupLayerManager : public QWidget -{ - Q_OBJECT - - public: - - /** - * Default constructor - * @param parent - * @return - */ - TupLayerManager(int sceneIndex = 0, QWidget *parent = 0); - ~TupLayerManager(); - TupLayerIndex* getLayerIndex(); - TupLayerControls* getLayerControls(); - - void insertLayer(int position, const QString &name); - void insertSoundLayer(int position, const QString &name); - void removeLayer(int position); - void renameLayer(int position, const QString &name); - void moveLayer(int position, int newPosition); - void lockLayer(int position, bool locked); - - protected: - void resizeEvent(QResizeEvent *event); - - private: - struct Private; - Private *const k; -}; - -#endif diff -Nru tupi-0.2+git04/src/components/timeline/tuptimeline.cpp tupi-0.2+git05/src/components/timeline/tuptimeline.cpp --- tupi-0.2+git04/src/components/timeline/tuptimeline.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimeline.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,27 +33,8 @@ * along with this program. If not, see . * ***************************************************************************/ -#include -#include - #include "tuptimeline.h" -// Tupi Framework -#include "tapplication.h" -#include "tdebug.h" - -#include "tupprojectrequest.h" -#include "tuplibraryobject.h" - -#include "tupframestable.h" -#include "tuplayermanager.h" - -#include "tupprojectactionbar.h" - -#include "tuprequestbuilder.h" - -#include "tuplibrary.h" - #define RETURN_IF_NOT_LIBRARY if (!k->library) return; struct TupTimeLine::Private @@ -63,27 +44,33 @@ TTabWidget *container; TupProjectActionBar *actionBar; int selectedLayer; - const TupLibrary *library; + TupProject *project; + TupLibrary *library; }; -TupTimeLine::TupTimeLine(QWidget *parent) : TupModuleWidgetBase(parent, "TupTimeLine"), k(new Private) +TupTimeLine::TupTimeLine(TupProject *project, QWidget *parent) : TupModuleWidgetBase(parent, "TupTimeLine"), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine()]"; + #else + TINIT; + #endif #endif setWindowTitle(tr("Time Line")); setWindowIcon(QPixmap(THEME_DIR + "icons/time_line.png")); + + k->project = project; + k->library = k->project->library(); k->actionBar = new TupProjectActionBar(QString("TimeLine"), TupProjectActionBar::InsertLayer | TupProjectActionBar::RemoveLayer | - // TupProjectActionBar::MoveLayerUp | - // TupProjectActionBar::MoveLayerDown | TupProjectActionBar::Separator | TupProjectActionBar::InsertFrame | TupProjectActionBar::RemoveFrame | - TupProjectActionBar::MoveFrameUp | - TupProjectActionBar::MoveFrameDown | + TupProjectActionBar::MoveFrameBackward | + TupProjectActionBar::MoveFrameForward | TupProjectActionBar::LockFrame); addChild(k->actionBar, Qt::AlignCenter); @@ -92,92 +79,52 @@ addChild(k->container); connect(k->actionBar, SIGNAL(actionSelected(int)), this, SLOT(requestCommand(int))); - connect(k->container, SIGNAL(currentChanged(int)), this, SLOT(emitRequestChangeScene(int))); - + connect(k->container, SIGNAL(currentChanged(int)), this, SLOT(requestSceneSelection(int))); } TupTimeLine::~TupTimeLine() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupTimeLine()]"; + #else + TEND; + #endif #endif - delete k; -} -TupLayerManager *TupTimeLine::layerManager(int sceneIndex) -{ - QSplitter *splitter = qobject_cast(k->container->widget(sceneIndex)); - splitter->setMinimumHeight(146); - - if (splitter) - return qobject_cast(splitter->widget(0)); - - return 0; + delete k; } -TupFramesTable *TupTimeLine::framesTable(int sceneIndex) +TupTimeLineTable *TupTimeLine::framesTable(int sceneIndex) { - QSplitter *splitter = qobject_cast(k->container->widget(sceneIndex)); - - if (splitter) - return qobject_cast(splitter->widget(1)); - + TupTimeLineTable *framesTable = qobject_cast(k->container->widget(sceneIndex)); + if (framesTable) + return framesTable; + return 0; } -void TupTimeLine::insertScene(int position, const QString &name) +void TupTimeLine::insertScene(int sceneIndex, const QString &name) { - if (position < 0 || position > k->container->count()) + if (sceneIndex < 0 || sceneIndex > k->container->count()) return; - - QSplitter *splitter = new QSplitter(k->container); - splitter->setContentsMargins(1, 1, 1, 1); - - TupLayerManager *layerManager = new TupLayerManager(position, splitter); - layerManager->setFixedWidth(244); - - splitter->addWidget(layerManager); - - connect(layerManager->getLayerIndex(), SIGNAL(localRequest()), this, SLOT(emitSelectionSignal())); - - // connect(layerManager, SIGNAL(requestRenameEvent(int, const QString&)), this, - // SLOT(emitRequestRenameLayer(int, const QString &))); // FIXME - connect(layerManager->getLayerControls(), SIGNAL(layerVisibility(int, int, bool)), this, - SLOT(emitLayerVisibility(int, int, bool))); - - TupFramesTable *framesTable = new TupFramesTable(position, splitter); - splitter->addWidget(framesTable); - + TupTimeLineTable *framesTable = new TupTimeLineTable(sceneIndex, k->container); framesTable->setItemSize(10, 20); - connect(layerManager->getLayerIndex()->verticalScrollBar(), SIGNAL(valueChanged(int)), framesTable->verticalScrollBar(), - SLOT(setValue(int))); - - connect(layerManager->getLayerControls()->verticalScrollBar(), SIGNAL(valueChanged(int)), framesTable->verticalScrollBar(), - SLOT(setValue(int))); - - connect(framesTable, SIGNAL(frameRequest(int, int, int, int, const QVariant&)), this, - SLOT(requestFrameAction(int, int, int, int, const QVariant&))); - - connect(framesTable->verticalScrollBar(), SIGNAL(valueChanged(int)), layerManager->getLayerIndex()->verticalScrollBar(), - SLOT(setValue(int))); - - connect(framesTable->verticalScrollBar(), SIGNAL(valueChanged(int)), layerManager->getLayerControls()->verticalScrollBar(), - SLOT(setValue(int))); - - //connect(framesTable, SIGNAL(emitSelection(int, int)), this, SLOT(selectFrame(int, int))); + connect(framesTable, SIGNAL(frameSelected(int, int)), this, SLOT(selectFrame(int, int))); + connect(framesTable, SIGNAL(visibilityChanged(int, bool)), this, SLOT(requestLayerVisibilityAction(int, bool))); + connect(framesTable, SIGNAL(layerNameChanged(int, const QString &)), this, SLOT(requestLayerRenameAction(int, const QString &))); + connect(framesTable, SIGNAL(layerMoved(int, int)), this, SLOT(requestLayerMove(int, int))); - k->container->insertTab(position, splitter, name); + k->container->insertTab(sceneIndex, framesTable, name); } -void TupTimeLine::removeScene(int position) +void TupTimeLine::removeScene(int sceneIndex) { - if (position >= 0 && position < k->container->count()) { - QWidget *w = k->container->widget(position); - // k->container->removeWidget(w); - k->container->removeTab(position); - + if (sceneIndex >= 0 && sceneIndex < k->container->count()) { + QWidget *w = k->container->widget(sceneIndex); + k->container->removeTab(sceneIndex); delete w; } } @@ -188,18 +135,16 @@ delete k->container->currentWidget(); } -void TupTimeLine::setLibrary(const TupLibrary *library) -{ - k->library = library; -} - void TupTimeLine::sceneResponse(TupSceneResponse *response) { Q_UNUSED(response); - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::sceneResponse()]"; + #else + T_FUNCINFO; + #endif #endif switch (response->action()) { @@ -234,207 +179,247 @@ } break; default: - tFatal() << "TupTimeLine::sceneResponse : Unknown action :/"; + #ifdef K_DEBUG + QString msg = "TupTimeLine::sceneResponse : Unknown action :/"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif + #endif break; } - */ } void TupTimeLine::layerResponse(TupLayerResponse *response) { Q_UNUSED(response); - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::layerResponse()]"; + #else + T_FUNCINFO; + #endif #endif - switch (response->action()) { - case TupProjectRequest::Add: - { - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - if (layerManager) - layerManager->insertLayer(response->layerIndex(), response->arg().toString()); - - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - if (framesTable) - framesTable->insertLayer(response->layerIndex(), response->arg().toString()); - } - - break; - case TupProjectRequest::Remove: - { - tFatal() << "TupTimeLine::layerResponse -> Removing layer!"; - - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - if (layerManager) - layerManager->removeLayer(response->layerIndex()); - - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - if (framesTable) + TupTimeLineTable *framesTable = this->framesTable(response->sceneIndex()); + if (framesTable) { + switch (response->action()) { + case TupProjectRequest::Add: + { + framesTable->insertLayer(response->layerIndex(), response->arg().toString()); + } + break; + case TupProjectRequest::Remove: + { framesTable->removeLayer(response->layerIndex()); - } - break; - case TupProjectRequest::Move: - { - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - if (layerManager) - layerManager->moveLayer(response->layerIndex(), response->arg().toInt()); - - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - if (framesTable) + if (framesTable->layersTotal() == 0) { + TupProjectRequest request = TupRequestBuilder::createLayerRequest(0, 0, TupProjectRequest::Add, tr("Layer %1").arg(1)); + emit requestTriggered(&request); + + request = TupRequestBuilder::createFrameRequest(0, 0, 0, TupProjectRequest::Add, tr("Frame %1").arg(1)); + emit requestTriggered(&request); + } + } + break; + case TupProjectRequest::Move: + { framesTable->moveLayer(response->layerIndex(), response->arg().toInt()); - } - break; - case TupProjectRequest::Lock: - { - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - - if (layerManager) - layerManager->lockLayer(response->layerIndex(), response->arg().toBool()); - } - break; - case TupProjectRequest::Rename: - { - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - - if (layerManager) - layerManager->renameLayer(response->layerIndex(), response->arg().toString()); - } - break; - case TupProjectRequest::View: - { - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - layerManager->getLayerControls()->setLayerVisibility(response->layerIndex(), response->arg().toString()); - } - break; + } + break; + case TupProjectRequest::Lock: + { + // SQA: Pending for implementation + } + break; + case TupProjectRequest::Rename: + { + framesTable->setLayerName(response->layerIndex(), response->arg().toString()); + } + break; + case TupProjectRequest::View: + { + framesTable->setLayerVisibility(response->layerIndex(), response->arg().toBool()); + } + break; + } } - - */ } void TupTimeLine::frameResponse(TupFrameResponse *response) { Q_UNUSED(response); - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::frameResponse()]"; + #else + T_FUNCINFO; + #endif #endif - switch (response->action()) { - case TupProjectRequest::Add: - { - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - - if (framesTable) + TupTimeLineTable *framesTable = this->framesTable(response->sceneIndex()); + if (framesTable) { + switch (response->action()) { + case TupProjectRequest::Add: + { framesTable->insertFrame(response->layerIndex(), response->arg().toString()); - else - tFatal() << "TupTimeLine::frameResponse -> NO FRAME TABLE AVAILABLE!"; - } - break; - case TupProjectRequest::Remove: - { - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - - if (framesTable) + } + break; + case TupProjectRequest::Remove: + { framesTable->removeFrame(response->layerIndex(), response->frameIndex()); - } - break; - case TupProjectRequest::Move: - { - } - break; - case TupProjectRequest::Lock: - { - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - - if (framesTable) + } + break; + case TupProjectRequest::Move: + { + // No action taken + } + break; + case TupProjectRequest::Exchange: + { + framesTable->exchangeFrame(response->frameIndex(), response->layerIndex(), response->arg().toInt(), response->layerIndex()); + } + break; + case TupProjectRequest::Lock: + { framesTable->lockFrame(response->layerIndex(), response->frameIndex(), response->arg().toBool()); - } - break; - case TupProjectRequest::Rename: - { - } - break; - case TupProjectRequest::Select: - { - tFatal() << "TupTimeLine::frameResponse() - Just tracing Selection!"; - - int layerIndex = response->layerIndex(); - - if (k->selectedLayer != layerIndex) { - layerManager(response->sceneIndex())->getLayerIndex()->setCurrentCell(layerIndex, 0); - k->selectedLayer = layerIndex; - } - - framesTable(response->sceneIndex())->blockSignals(true); - framesTable(response->sceneIndex())->setCurrentCell(layerIndex, response->frameIndex()); - framesTable(response->sceneIndex())->blockSignals(false); - } - break; + } + break; + case TupProjectRequest::Rename: + { + } + break; + case TupProjectRequest::Select: + { + int layerIndex = response->layerIndex(); + k->selectedLayer = layerIndex; + framesTable->selectFrame(layerIndex, response->frameIndex()); + } + break; + } } - */ } void TupTimeLine::libraryResponse(TupLibraryResponse *response) { Q_UNUSED(response); - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::libraryResponse()]"; + #else + T_FUNCINFO; + #endif #endif if (response->action() == TupProjectRequest::InsertSymbolIntoFrame) { switch (response->symbolType()) { case TupLibraryObject::Sound: { - TupLayerManager *layerManager = this->layerManager(response->sceneIndex()); - if (layerManager) { - layerManager->insertSoundLayer(response->layerIndex()+1, - response->arg().toString()); - - TupFramesTable *framesTable = this->framesTable(response->sceneIndex()); - if (framesTable) { - framesTable->insertSoundLayer(response->layerIndex()+1, - response->arg().toString()); - framesTable->insertFrame(response->layerIndex()+1,""); - } + TupTimeLineTable *framesTable = this->framesTable(response->sceneIndex()); + if (framesTable) { + framesTable->insertSoundLayer(response->layerIndex() + 1, response->arg().toString()); + framesTable->insertFrame(response->layerIndex() + 1, ""); } } break; + default: + // Do nothing + break; }; } - - */ } void TupTimeLine::requestCommand(int action) { int scenePos = k->container->currentIndex(); - if (scenePos < 0) + if (scenePos < 0) { + #ifdef K_DEBUG + QString msg = "TupTimeLine::requestCommand() - Fatal Error: Scene index is invalid -> " + QString::number(scenePos); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal("timeline") << msg; + #endif + #endif + return; - - int layerPos = layerManager(scenePos)->getLayerIndex()->verticalHeader()->visualIndex( - layerManager(scenePos)->getLayerIndex()->currentRow()); + } - int framePos = framesTable(scenePos)->lastFrameByLayer(layerPos) + 1; + int layerPos = framesTable(scenePos)->currentLayer(); + + if (layerPos < 0) { + #ifdef K_DEBUG + QString msg = "TupTimeLine::requestCommand() - Fatal Error: Layer index is invalid -> " + QString::number(layerPos); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal("timeline") << msg; + #endif + #endif + + return; + } + + int framePos = framesTable(scenePos)->lastFrameByLayer(layerPos); + + if (framePos < 0) { + #ifdef K_DEBUG + QString msg = "TupTimeLine::requestCommand() - Fatal Error: Frame index is invalid -> " + QString::number(framePos); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal("timeline") << msg; + #endif + #endif + + return; + } + + if (TupProjectActionBar::FrameActions & action) { + if (!requestFrameAction(action, framePos, layerPos, scenePos)) { + #ifdef K_DEBUG + QString msg = "TupTimeLine::requestCommand() - Fatal Error: Frame action has failed!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal("timeline") << msg; + #endif + #endif + } + return; + } - if (!requestFrameAction(action, framePos, layerPos, scenePos)) { - tFatal() << "TupTimeLine::requestCommand -> It isn't frame action"; - layerPos = layerManager(scenePos)->getLayerIndex()->rowCount(); - framePos = framesTable(scenePos)->lastFrameByLayer(layerPos); + if (TupProjectActionBar::LayerActions & action) { if (!requestLayerAction(action, layerPos, scenePos)) { - tFatal() << "TupTimeLine::requestCommand -> It isn't layer action"; - if (!requestSceneAction(action, scenePos)) { - #ifdef K_DEBUG - tFatal("timeline") << "Can't handle action"; + #ifdef K_DEBUG + QString msg = "TupTimeLine::requestCommand() - Fatal Error: Layer action has failed!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal("timeline") << msg; #endif - } + #endif } + return; + } + + if (TupProjectActionBar::SceneActions & action) { + if (!requestSceneAction(action, scenePos)) { + #ifdef K_DEBUG + QString msg = "TupTimeLine::requestCommand() - Fatal Error: Scene action has failed!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal("timeline") << msg; + #endif + #endif + } + return; } } @@ -442,79 +427,115 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::requestFrameAction()]"; + #else + T_FUNCINFO; + #endif #endif */ - if (scenePos < 0) - scenePos = k->container->currentIndex(); + Q_UNUSED(framePos); + + TupProjectRequest request; switch (action) { case TupProjectActionBar::InsertFrame: { - int layersTotal = layerManager(scenePos)->getLayerIndex()->rowCount(); - int usedFrames = framesTable(scenePos)->lastFrameByLayer(layerPos); - - if (layersTotal == 1) { - for (int frame = usedFrames; frame < framePos; frame++) { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, frame + 1, - TupProjectRequest::Add, tr("Frame %1").arg(frame + 2)); - emit requestTriggered(&event); - } + int lastFrame = framesTable(scenePos)->lastFrameByLayer(layerPos); + int currentFrame = framesTable(scenePos)->currentColumn(); + if (currentFrame == lastFrame) { + request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, lastFrame + 1, + TupProjectRequest::Add, tr("Frame %1").arg(lastFrame + 2)); + emit requestTriggered(&request); } else { - usedFrames++; - - for (int layer=0; layer < layersTotal; layer++) { - for (int frame = usedFrames; frame <= framePos; frame++) { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scenePos, layer, frame, - TupProjectRequest::Add, tr("Frame %1").arg(frame + 1)); - emit requestTriggered(&event); - } + request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, currentFrame + 1, + TupProjectRequest::Add, tr("Frame %1").arg(currentFrame + 2)); + emit requestTriggered(&request); + int target = currentFrame + 2; + for (int index=target; index <= lastFrame+1; index++) { + target++; + request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, index, TupProjectRequest::Rename, tr("Frame %1").arg(target)); + emit requestTriggered(&request); } } - + return true; } break; case TupProjectActionBar::RemoveFrame: { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, framePos - 1, - TupProjectRequest::Remove, arg); - emit requestTriggered(&event); + int lastFrame = framesTable(scenePos)->lastFrameByLayer(layerPos); + int currentFrame = framesTable(scenePos)->currentColumn(); + + if (currentFrame > lastFrame) + return false; + + if (lastFrame == 0) { + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, 0, TupProjectRequest::Reset); + emit requestTriggered(&request); + return true; + } + + if (currentFrame == lastFrame) { + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, currentFrame, TupProjectRequest::Remove); + emit requestTriggered(&request); + + if (currentFrame > 0) + selectFrame(layerPos, currentFrame-1); + else + framesTable(scenePos)->clearSelection(); + } else { + request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, currentFrame, TupProjectRequest::Remove, arg); + emit requestTriggered(&request); + + selectFrame(layerPos, currentFrame); + } return true; } break; - case TupProjectActionBar::MoveFrameUp: + case TupProjectActionBar::MoveFrameBackward: { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, framePos, - TupProjectRequest::Move, framePos-1); - emit requestTriggered(&event); + int currentFrame = framesTable(scenePos)->currentColumn(); + + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, currentFrame, TupProjectRequest::Exchange, currentFrame - 1); + emit requestTriggered(&request); return true; } break; - case TupProjectActionBar::MoveFrameDown: + case TupProjectActionBar::MoveFrameForward: { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, framePos, - TupProjectRequest::Move, framePos+1); - emit requestTriggered(&event); + int currentFrame = framesTable(scenePos)->currentColumn(); + int lastFrame = framesTable(scenePos)->lastFrameByLayer(layerPos); + + if (currentFrame == lastFrame) { + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, lastFrame + 1, TupProjectRequest::Add, tr("Frame %1").arg(lastFrame + 2)); + emit requestTriggered(&request); + } + + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, currentFrame, TupProjectRequest::Exchange, currentFrame + 1); + emit requestTriggered(&request); return true; } break; - /* - case TupProjectActionBar::SelectFrame: + case TupProjectActionBar::LockFrame: { - TupProjectRequest event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, framePos, - TupProjectRequest::Select, arg); - emit localRequestTriggered(&event); + int currentFrame = framesTable(scenePos)->currentColumn(); + bool locked = framesTable(scenePos)->frameIsLocked(layerPos, currentFrame); + + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layerPos, currentFrame, TupProjectRequest::Lock, !locked); + emit requestTriggered(&request); return true; } break; - */ + default: + // Do nothing + break; } return false; @@ -522,32 +543,23 @@ bool TupTimeLine::requestLayerAction(int action, int layerPos, int scenePos, const QVariant &arg) { - if (scenePos < 0) - scenePos = k->container->currentIndex(); - - if (scenePos >= 0) { - if (layerPos < 0) - layerPos = layerManager(scenePos)->getLayerIndex()->verticalHeader()->visualIndex( - layerManager(scenePos)->getLayerIndex()->currentRow()); - } + TupProjectRequest request; switch (action) { case TupProjectActionBar::InsertLayer: { - TupProjectRequest event = TupRequestBuilder::createLayerRequest(scenePos, layerPos, - TupProjectRequest::Add, tr("Layer %1").arg(layerPos + 1)); - emit requestTriggered(&event); - - if (layerPos == 0) { - event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, 0, - TupProjectRequest::Add, tr("Frame %1").arg(1)); - emit requestTriggered(&event); + int layerIndex = framesTable(scenePos)->layersTotal(); + request = TupRequestBuilder::createLayerRequest(scenePos, layerIndex, TupProjectRequest::Add, tr("Layer %1").arg(layerIndex + 1)); + emit requestTriggered(&request); + + if (layerIndex == 0) { + request = TupRequestBuilder::createFrameRequest(scenePos, layerIndex, 0, TupProjectRequest::Add, tr("Frame %1").arg(1)); + emit requestTriggered(&request); } else { - int total = framesTable(scenePos)->lastFrameByLayer(layerPos-1); + int total = framesTable(scenePos)->lastFrameByLayer(layerIndex - 1); for (int j=0; j <= total; j++) { - event = TupRequestBuilder::createFrameRequest(scenePos, layerPos, j, - TupProjectRequest::Add, tr("Frame %1").arg(j + 1)); - emit requestTriggered(&event); + request = TupRequestBuilder::createFrameRequest(scenePos, layerIndex, j, TupProjectRequest::Add, tr("Frame %1").arg(j + 1)); + emit requestTriggered(&request); } } @@ -556,31 +568,12 @@ break; case TupProjectActionBar::RemoveLayer: { - TupProjectRequest event = TupRequestBuilder::createLayerRequest(scenePos, layerPos-1, - TupProjectRequest::Remove, arg); - - emit requestTriggered(&event); - - return true; - } - break; - case TupProjectActionBar::MoveLayerUp: - { - TupProjectRequest event = TupRequestBuilder::createLayerRequest(scenePos, layerPos, - TupProjectRequest::Move, layerPos - 1); - emit requestTriggered(&event); + request = TupRequestBuilder::createLayerRequest(scenePos, layerPos, TupProjectRequest::Remove, arg); + emit requestTriggered(&request); return true; } break; - case TupProjectActionBar::MoveLayerDown: - { - TupProjectRequest event = TupRequestBuilder::createLayerRequest(scenePos, layerPos, - TupProjectRequest::Move, layerPos + 1); - emit requestTriggered(&event); - return true; - } - break; } return false; @@ -588,101 +581,128 @@ bool TupTimeLine::requestSceneAction(int action, int scenePos, const QVariant &arg) { - if (scenePos < 0) - scenePos = k->container->currentIndex(); - + TupProjectRequest request; + switch (action) { case TupProjectActionBar::InsertScene: { - TupProjectRequest event = TupRequestBuilder::createSceneRequest(scenePos + 1, - TupProjectRequest::Add, tr("Scene %1").arg(scenePos + 2)); - - emit requestTriggered(&event); + request = TupRequestBuilder::createSceneRequest(scenePos + 1, TupProjectRequest::Add, tr("Scene %1").arg(scenePos + 2)); + emit requestTriggered(&request); return true; } break; case TupProjectActionBar::RemoveScene: { - TupProjectRequest event = TupRequestBuilder::createSceneRequest(scenePos, - TupProjectRequest::Remove, arg); - - emit requestTriggered(&event); + request = TupRequestBuilder::createSceneRequest(scenePos, TupProjectRequest::Remove, arg); + emit requestTriggered(&request); return true; } break; case TupProjectActionBar::MoveSceneUp: { - TupProjectRequest event = TupRequestBuilder::createSceneRequest(scenePos, TupProjectRequest::Move, - scenePos + 1); - emit requestTriggered(&event); + request = TupRequestBuilder::createSceneRequest(scenePos, TupProjectRequest::Move, scenePos + 1); + emit requestTriggered(&request); return true; } break; case TupProjectActionBar::MoveSceneDown: { - TupProjectRequest event = TupRequestBuilder::createSceneRequest(scenePos, TupProjectRequest::Move, - scenePos - 1); - emit requestTriggered(&event); + request = TupRequestBuilder::createSceneRequest(scenePos, TupProjectRequest::Move, scenePos - 1); + emit requestTriggered(&request); + return true; } break; + default: + // Do nothing + break; } return false; } -void TupTimeLine::emitRequestRenameLayer(int layer, const QString &name) +void TupTimeLine::requestLayerVisibilityAction(int layer, bool isVisible) { /* #ifdef K_DEBUG - T_FUNCINFO << name; + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::requestLayerVisibilityAction()]"; + #else + T_FUNCINFO; + #endif #endif */ int scenePos = k->container->currentIndex(); - - TupProjectRequest event = TupRequestBuilder::createLayerRequest(scenePos, layer, TupProjectRequest::Rename, name); - - emit requestTriggered(&event); + + TupProjectRequest request = TupRequestBuilder::createLayerRequest(scenePos, layer, TupProjectRequest::View, isVisible); + emit requestTriggered(&request); } -void TupTimeLine::emitSelectionSignal() +void TupTimeLine::requestLayerRenameAction(int layer, const QString &name) { - // tFatal() << "TupTimeLine::emitSelectionSignal() - Just tracing!"; + /* + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLine::requestLayerRenameAction()]"; + qDebug() << "name: " << name; + #else + T_FUNCINFO << name; + #endif + #endif + */ int scenePos = k->container->currentIndex(); - int layerPos = layerManager(scenePos)->getLayerIndex()->currentRow(); - k->selectedLayer = layerPos; - int frame = framesTable(scenePos)->currentColumn(); - - requestFrameAction(TupProjectRequest::Select, frame, layerPos, scenePos); -} - -void TupTimeLine::emitLayerVisibility(int sceneIndex, int layerIndex, bool checked) -{ - TupProjectRequest event = TupRequestBuilder::createLayerRequest(sceneIndex, - layerIndex, TupProjectRequest::View, checked); - emit requestTriggered(&event); + + TupProjectRequest request = TupRequestBuilder::createLayerRequest(scenePos, layer, TupProjectRequest::Rename, name); + emit requestTriggered(&request); } void TupTimeLine::selectFrame(int indexLayer, int indexFrame) { int scenePos = k->container->currentIndex(); + TupScene *scene = k->project->scene(scenePos); + if (scene) { + int lastFrame = framesTable(scenePos)->lastFrameByLayer(indexLayer); + + if (indexFrame > lastFrame) { + int totalFrames = scene->framesTotal(); + + if (indexFrame > (totalFrames-1)) { + int layersTotal = scene->layersTotal(); + for (int layer=0; layer < layersTotal; layer++) { + int currentLimit = framesTable(scenePos)->lastFrameByLayer(layer); + for (int frame = currentLimit + 1; frame <= indexFrame; frame++) { + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, layer, frame, + TupProjectRequest::Add, tr("Frame %1").arg(frame + 1)); + emit requestTriggered(&request); + } + } + } else { + for (int frame = lastFrame + 1; frame <= indexFrame; frame++) { + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, indexLayer, frame, + TupProjectRequest::Add, tr("Frame %1").arg(frame + 1)); + emit requestTriggered(&request); + } + } - // tFatal() << "TupTimeLine::selectFrame() - Just tracing!"; - TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, indexLayer, - indexFrame, TupProjectRequest::Select, "1"); - emit requestTriggered(&request); + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, indexLayer, + indexFrame, TupProjectRequest::Select, "1"); + emit requestTriggered(&request); + } + TupProjectRequest request = TupRequestBuilder::createFrameRequest(scenePos, indexLayer, + indexFrame, TupProjectRequest::Select, "1"); + emit requestTriggered(&request); + } } -void TupTimeLine::emitRequestChangeScene(int sceneIndex) +void TupTimeLine::requestSceneSelection(int sceneIndex) { if (k->container->count() > 1) { - // tFatal() << "TupTimeLine::emitRequestChangeScene - Just tracing!"; TupProjectRequest request = TupRequestBuilder::createSceneRequest(sceneIndex, TupProjectRequest::Select); emit localRequestTriggered(&request); } @@ -690,9 +710,14 @@ void TupTimeLine::emitRequestChangeFrame(int sceneIndex, int layerIndex, int frameIndex) { - // tFatal() << "TupTimeLine::emitRequestChangeFrame - Just tracing!"; - TupProjectRequest event = TupRequestBuilder::createFrameRequest(sceneIndex, layerIndex, frameIndex, - TupProjectRequest::Select, "1"); - emit requestTriggered(&event); + TupProjectRequest request = TupRequestBuilder::createFrameRequest(sceneIndex, layerIndex, frameIndex, + TupProjectRequest::Select, "1"); + emit requestTriggered(&request); } +void TupTimeLine::requestLayerMove(int oldIndex, int newIndex) +{ + TupProjectRequest request = TupRequestBuilder::createLayerRequest(k->container->currentIndex(), oldIndex, + TupProjectRequest::Move, newIndex); + emit requestTriggered(&request); +} diff -Nru tupi-0.2+git04/src/components/timeline/tuptimeline.h tupi-0.2+git05/src/components/timeline/tuptimeline.h --- tupi-0.2+git04/src/components/timeline/tuptimeline.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimeline.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,46 +36,46 @@ #ifndef TUPTIMELINE_H #define TUPTIMELINE_H +#include "tglobal.h" #include "tupmodulewidgetbase.h" #include "ttabwidget.h" +#include "tupprojectrequest.h" +#include "tuplibraryobject.h" +#include "tuptimelinetable.h" +#include "tupprojectactionbar.h" +#include "tuprequestbuilder.h" +#include "tupproject.h" +#include "tuplibrary.h" -#include #include - -class TupLayerManager; -class TupFramesTable; -class TupProjectActionBar; -class TupFramesTableItem; -class TupLibrary; +#include +#include /** * @author David Cuadrado **/ -class TupTimeLine : public TupModuleWidgetBase +class TUPI_EXPORT TupTimeLine : public TupModuleWidgetBase { Q_OBJECT public: - TupTimeLine(QWidget *parent = 0); + TupTimeLine(TupProject *project, QWidget *parent = 0); ~TupTimeLine(); void closeAllScenes(); - void setLibrary(const TupLibrary *library); - private: - TupLayerManager *layerManager(int sceneIndex); - TupFramesTable *framesTable(int sceneIndex); + TupTimeLineTable *framesTable(int sceneIndex); protected: - void sceneResponse(TupSceneResponse *e); - void layerResponse(TupLayerResponse *e); - void frameResponse(TupFrameResponse *e); + void sceneResponse(TupSceneResponse *response); + void layerResponse(TupLayerResponse *response); + void frameResponse(TupFrameResponse *response); void libraryResponse(TupLibraryResponse *response); public slots: - void insertScene(int position, const QString &name); - void removeScene(int position); + void insertScene(int sceneIndex, const QString &name); + void removeScene(int sceneIndex); void emitRequestChangeFrame(int sceneIndex, int layerIndex, int frameIndex); private slots: @@ -84,11 +84,11 @@ bool requestLayerAction(int action, int layerPos = -1, int scenePos = -1, const QVariant &arg = QVariant()); bool requestSceneAction(int action, int scenePos = -1, const QVariant &arg = QVariant()); void selectFrame(int indexLayer, int indexFrame); - - void emitRequestRenameLayer(int layer, const QString &name); - void emitSelectionSignal(); - void emitLayerVisibility(int sceneIndex, int layerIndex, bool checked); - void emitRequestChangeScene(int sceneIndex); + void requestLayerMove(int oldIndex, int newIndex); + + void requestLayerVisibilityAction(int layer, bool isVisible); + void requestLayerRenameAction(int layer, const QString &name); + void requestSceneSelection(int sceneIndex); private: struct Private; diff -Nru tupi-0.2+git04/src/components/timeline/tuptimelineheader.cpp tupi-0.2+git05/src/components/timeline/tuptimelineheader.cpp --- tupi-0.2+git04/src/components/timeline/tuptimelineheader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimelineheader.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,251 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tuptimelineheader.h" + +struct TupTimeLineHeader::Private +{ + QPixmap lockIcon; + QPixmap viewIconOn; + QPixmap viewIconOff; + int currentLayer; + QList layers; + QLineEdit *editor; + int editorSection; + bool sectionOnMotion; +}; + +TupTimeLineHeader::TupTimeLineHeader(QWidget * parent) : QHeaderView(Qt::Vertical, parent), k(new Private) +{ + setSectionsClickable(true); + setSectionsMovable(true); + + setFixedWidth(115); + // SQA: This code will be disabled until the "Lock layer" feature is implemented + // setFixedWidth(140); + // k->lockIcon = QPixmap(THEME_DIR + "icons/padlock.png"); + k->viewIconOn = QPixmap(THEME_DIR + "icons/show_layer.png"); + k->viewIconOff = QPixmap(THEME_DIR + "icons/hide_layer.png"); + + connect(this, SIGNAL(sectionDoubleClicked(int)), this, SLOT(showTitleEditor(int))); + + k->editorSection = -1; + + k->editor = new QLineEdit(this); + k->editor->setFocusPolicy(Qt::ClickFocus); + k->editor->setInputMask(""); + connect(k->editor, SIGNAL(editingFinished()), this, SLOT(hideTitleEditor())); + k->editor->hide(); +} + +TupTimeLineHeader::~TupTimeLineHeader() +{ +} + +void TupTimeLineHeader::paintSection(QPainter * painter, const QRect & rect, int index) const +{ + if (!model() || !rect.isValid()) + return; + + painter->save(); + + QStyleOptionHeader headerOption; + headerOption.rect = rect; + headerOption.orientation = Qt::Vertical; + headerOption.position = QStyleOptionHeader::Middle; + headerOption.text = ""; + + style()->drawControl(QStyle::CE_HeaderSection, &headerOption, painter); + + if (k->currentLayer == index) { + QColor color(0, 136, 0, 40); + painter->fillRect(rect, color); + } + + QFont font("Arial", 7, QFont::Normal, false); + QFontMetrics fm(font); + + int y = rect.normalized().bottomLeft().y() - (1 + (rect.normalized().height() - fm.height())/2); + painter->setFont(font); + painter->setPen(QPen(Qt::black, 1, Qt::SolidLine)); + painter->drawText(10, y, k->layers[index].title); + + y = rect.y(); + + // SQA: This code will be disabled until the "Lock layer" feature is implemented + /* + QRectF lockRect = QRectF(0, 0, 11, 12); + int lockY = (rect.height() - lockRect.height())/2; + painter->drawPixmap(QPointF(rect.x() + 90, lockY + y), k->lockIcon, lockRect); + */ + + QRectF viewRect = QRectF(0, 0, 13, 7); + int viewY = (rect.height() - viewRect.height())/2; + if (k->layers[index].isVisible) + painter->drawPixmap(QPointF(rect.x() + 90, viewY + y), k->viewIconOn, viewRect); + else + painter->drawPixmap(QPointF(rect.x() + 90, viewY + y), k->viewIconOff, viewRect); + + painter->restore(); +} + +void TupTimeLineHeader::mousePressEvent(QMouseEvent *event) +{ + QPoint point = event->pos(); + int section = logicalIndexAt(point); + + if (section != k->currentLayer) + emit selectionChanged(section); + + int y = sectionViewportPosition(section); + QRect rect(90, y, 20, sectionSize(section)); + if (rect.contains(point)) + emit visibilityChanged(section, !k->layers[section].isVisible); + + QHeaderView::mousePressEvent(event); +} + +void TupTimeLineHeader::updateSelection(int index) +{ + if (k->currentLayer != index) { + k->currentLayer = index; + updateSection(index); + } +} + +void TupTimeLineHeader::insertSection(int index, const QString &name) +{ + TimeLineLayerItem layer; + layer.title = name; + layer.lastFrame = -1; + layer.isVisible = true; + layer.isLocked = false; + layer.isSound = false; + + k->layers.insert(index, layer); +} + +void TupTimeLineHeader::setSectionVisibility(int index, bool visibility) +{ + k->layers[index].isVisible = visibility; + updateSection(index); +} + +void TupTimeLineHeader::setSectionTitle(int index, const QString &name) +{ + k->layers[index].title = name; + updateSection(index); +} + +void TupTimeLineHeader::showTitleEditor(int index) +{ + if (index >= 0) { + QFont font("Arial", 7, QFont::Normal, false); + k->editor->setFont(font); + int x = sectionViewportPosition(index); + k->editor->setGeometry(0, x, width(), sectionSize(index)); + k->editorSection = index; + k->editor->setText(k->layers[index].title); + k->editor->show(); + k->editor->setFocus(); + } +} + +void TupTimeLineHeader::hideTitleEditor() +{ + k->editor->hide(); + + if (k->editorSection != -1 && k->editor->isModified()) + emit nameChanged(k->editorSection, k->editor->text()); + + k->editorSection = -1; +} + +void TupTimeLineHeader::removeSection(int index) +{ + k->layers.removeAt(index); +} + +int TupTimeLineHeader::lastFrame(int index) +{ + return k->layers[index].lastFrame; +} + +void TupTimeLineHeader::updateLastFrame(int index, bool addition) +{ + if (addition) + k->layers[index].lastFrame++; + else + k->layers[index].lastFrame--; +} + +void TupTimeLineHeader::resetLastFrame(int index) +{ + k->layers[index].lastFrame = -1; +} + +bool TupTimeLineHeader::isSound(int index) +{ + return k->layers[index].isSound; +} + +void TupTimeLineHeader::setSoundFlag(int index, bool flag) +{ + k->layers[index].isSound = flag; +} + +int TupTimeLineHeader::currentSectionIndex() +{ + return k->currentLayer; +} + +void TupTimeLineHeader::moveHeaderSection(int position, int newPosition, bool isLocalRequest) +{ + if (isLocalRequest) { + k->sectionOnMotion = true; + moveSection(visualIndex(position), visualIndex(newPosition)); + k->layers.swap(position, newPosition); + k->sectionOnMotion = false; + } else { + k->layers.swap(position, newPosition); + } +} + +bool TupTimeLineHeader::sectionIsMoving() +{ + return k->sectionOnMotion; +} + + diff -Nru tupi-0.2+git04/src/components/timeline/tuptimelineheader.h tupi-0.2+git05/src/components/timeline/tuptimelineheader.h --- tupi-0.2+git04/src/components/timeline/tuptimelineheader.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimelineheader.h 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,98 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPTIMELINEHEADER_H +#define TUPTIMELINEHEADER_H + +#include "tglobal.h" +#include "tapplicationproperties.h" + +#include +#include +#include +#include +#include + +struct TimeLineLayerItem +{ + QString title; + int lastFrame; + bool isVisible; + bool isLocked; + bool isSound; +}; + +class TUPI_EXPORT TupTimeLineHeader : public QHeaderView +{ + Q_OBJECT + + public: + TupTimeLineHeader(QWidget * parent = 0); + ~TupTimeLineHeader(); + void insertSection(int index, const QString &name); + void setSectionVisibility(int index, bool visibility); + void setSectionTitle(int index, const QString &name); + void removeSection(int index); + int lastFrame(int index); + void updateLastFrame(int index, bool addition); + void resetLastFrame(int index); + bool isSound(int index); + void setSoundFlag(int index, bool flag); + int currentSectionIndex(); + void moveHeaderSection(int position, int newPosition, bool isLocalRequest); + bool sectionIsMoving(); + + protected: + void paintSection(QPainter *painter, const QRect & rect, int index) const; + virtual void mousePressEvent(QMouseEvent *event); + + public slots: + void updateSelection(int index); + + private slots: + void showTitleEditor(int section); + void hideTitleEditor(); + + signals: + void selectionChanged(int section); + void visibilityChanged(int section, bool isVisible); + void nameChanged(int section, const QString &name); + + private: + struct Private; + Private *const k; +}; + +#endif diff -Nru tupi-0.2+git04/src/components/timeline/tuptimelineruler.cpp tupi-0.2+git05/src/components/timeline/tuptimelineruler.cpp --- tupi-0.2+git04/src/components/timeline/tuptimelineruler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimelineruler.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,113 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tuptimelineruler.h" + +TupTimeLineRuler::TupTimeLineRuler(QWidget *parent) : QHeaderView(Qt::Horizontal, parent) +{ + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupTimeLineRuler()]"; + #else + TINIT; + #endif + #endif + + setHighlightSections(true); + setStyleSheet("QHeaderView { background-color: #CCCCCC; }"); +} + +TupTimeLineRuler::~TupTimeLineRuler() +{ + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[~TupTimeLineRuler()]"; + #else + TEND; + #endif + #endif +} + +void TupTimeLineRuler::paintSection(QPainter *painter, const QRect & rect, int logicalIndex) const +{ + if (!model() || !rect.isValid()) + return; + + painter->save(); + + QModelIndex currentSelection = currentIndex(); + int column = currentSelection.row(); + + if (selectionModel()->isSelected(model()->index(column, logicalIndex))) { + QBrush brush(QColor(0, 135, 0, 80)); + painter->fillRect(rect, brush); + } else { + if ((logicalIndex + 1) == 1 || (logicalIndex+1) % 5 == 0) { + QBrush brush(QColor(150, 150, 150, 255)); + painter->fillRect(rect, brush); + } + } + + logicalIndex++; + + int x = rect.bottomRight().x(); + int topY = rect.topRight().y(); + int bottomY = rect.bottomRight().y(); + painter->drawLine(x, bottomY, x, bottomY - 6); + painter->drawLine(x, topY, x, topY + 4); + + if (logicalIndex == 1 || logicalIndex % 5 == 0) { + QFont label("Arial", 7, QFont::Normal, false); + QFontMetrics fm(label); + + QString number = QString::number(logicalIndex); + + painter->setFont(label); + painter->drawText((int)(rect.center().x() - (fm.width(number)/2)), + (int)(rect.center().y() + (fm.height()/2)) - 2, number); + } + + QPen pen = painter->pen(); + pen.setWidth(4); + painter->setPen(pen); + painter->drawLine(rect.bottomLeft(), rect.bottomRight()); + + painter->restore(); +} + +void TupTimeLineRuler::mousePressEvent(QMouseEvent *event) +{ + emit selectionChanged(logicalIndexAt(event->pos())); +} diff -Nru tupi-0.2+git04/src/components/timeline/tuptimelineruler.h tupi-0.2+git05/src/components/timeline/tuptimelineruler.h --- tupi-0.2+git04/src/components/timeline/tuptimelineruler.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimelineruler.h 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,65 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPTIMELINERULER_H +#define TUPTIMELINERULER_H + +#include "tglobal.h" + +#include +#include +#include + +/** + * @author David Cuadrado +**/ + +class TUPI_EXPORT TupTimeLineRuler : public QHeaderView +{ + Q_OBJECT + + public: + TupTimeLineRuler(QWidget *parent = 0); + ~TupTimeLineRuler(); + + protected: + void paintSection(QPainter *painter, const QRect & rect, int logicalIndex) const; + virtual void mousePressEvent(QMouseEvent *event); + + signals: + void selectionChanged(int section); +}; + +#endif diff -Nru tupi-0.2+git04/src/components/timeline/tuptimelinetable.cpp tupi-0.2+git05/src/components/timeline/tuptimelinetable.cpp --- tupi-0.2+git04/src/components/timeline/tuptimelinetable.cpp 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimelinetable.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,529 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#include "tuptimelinetable.h" + +////////// TupTimeLineTableItemDelegate /////////// + +class TupTimeLineTableItemDelegate : public QItemDelegate +{ + public: + TupTimeLineTableItemDelegate(QObject * parent = 0); + ~TupTimeLineTableItemDelegate(); + virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; +}; + +TupTimeLineTableItemDelegate::TupTimeLineTableItemDelegate(QObject * parent) : QItemDelegate(parent) // QAbstractItemDelegate(parent) +{ +} + +TupTimeLineTableItemDelegate::~TupTimeLineTableItemDelegate() +{ +} + +void TupTimeLineTableItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const +{ + Q_ASSERT(index.isValid()); + + QItemDelegate::paint(painter, option, index); + TupTimeLineTable *table = qobject_cast(index.model()->parent()); + TupTimeLineTableItem *item = dynamic_cast(table->itemFromIndex(index)); + + // draw the background color + QVariant value = index.data(Qt::BackgroundColorRole); + + if (value.isValid()) { + painter->save(); + + bool sound = table->isSoundLayer(index.row()); + if (!sound) + painter->fillRect(option.rect, value.value()); + + painter->restore(); + } else { + painter->save(); + + bool sound = table->isSoundLayer(index.row()); + + if (!sound) { + int counter = index.column() + 1; + if (counter == 1 || counter % 5 == 0) + painter->fillRect(option.rect, QColor(230, 230, 230)); + else + painter->fillRect(option.rect, Qt::white); + } + + painter->restore(); + } + + // Selection! + if (option.showDecorationSelected && (option.state & QStyle::State_Selected)) { + painter->save(); + painter->fillRect(option.rect, QColor(0, 136, 0, 180)); + painter->restore(); + } + + // Draw attributes + int offset = option.rect.width() - 5; + + if (item && index.isValid()) { + if (item->isUsed()) { + painter->save(); + painter->setBrush(Qt::black); + painter->setRenderHint(QPainter::Antialiasing, true); + + if (!item->isSound()) { + if (item->isLocked()) { + painter->setPen(QPen(Qt::red, 1, Qt::SolidLine)); + painter->setBrush(Qt::red); + } + painter->drawEllipse(option.rect.x() + ((option.rect.width() - offset)/2), + option.rect.y() + ((option.rect.height() + offset)/2), + offset, offset); + } else { + painter->setBrush(QColor(0, 136, 0)); + painter->drawRect(option.rect.x() + ((option.rect.width() - offset)/2), + option.rect.y() + ((option.rect.height() + offset)/2), + offset, offset); + } + + painter->restore(); + } + } +} + +////////// TupTimeLineTableItem //////// + +TupTimeLineTableItem::TupTimeLineTableItem() +{ +} + +TupTimeLineTableItem::~TupTimeLineTableItem() +{ +} + +bool TupTimeLineTableItem::isUsed() +{ + return data(IsUsed).toBool(); +} + +bool TupTimeLineTableItem::isLocked() +{ + return data(IsLocked).toBool(); +} + +bool TupTimeLineTableItem::isSound() +{ + QVariant data = this->data(IsSound); + + if (data.canConvert()) + return data.toBool(); + + return false; +} + +//// TupTimeLineTable + +struct TupTimeLineTable::Private +{ + int rectWidth; + int rectHeight; + + int sceneIndex; + int layerIndex; + int frameIndex; + + TupTimeLineRuler *ruler; + TupTimeLineHeader *layerColumn; + + bool removingLayer; + bool removingFrame; + bool isLocalRequest; +}; + +TupTimeLineTable::TupTimeLineTable(int sceneIndex, QWidget *parent) : QTableWidget(0, 200, parent), k(new Private) +{ + k->isLocalRequest = false; + k->sceneIndex = sceneIndex; + k->frameIndex = 0; + k->layerIndex = 0; + + k->ruler = new TupTimeLineRuler; + connect(k->ruler, SIGNAL(selectionChanged(int)), this, SLOT(frameSelectionFromRuler(int))); + + k->removingLayer = false; + k->removingFrame = false; + + k->layerColumn = new TupTimeLineHeader; + connect(k->layerColumn, SIGNAL(nameChanged(int, const QString &)), this, SIGNAL(layerNameChanged(int, const QString &))); + connect(k->layerColumn, SIGNAL(selectionChanged(int)), this, SLOT(frameSelectionFromLayerHeader(int))); + connect(k->layerColumn, SIGNAL(visibilityChanged(int, bool)), this, SIGNAL(visibilityChanged(int, bool))); + connect(k->layerColumn, SIGNAL(sectionMoved(int, int, int)), this, SLOT(requestLayerMove(int, int, int))); + + setup(); +} + +TupTimeLineTable::~TupTimeLineTable() +{ + delete k; +} + +void TupTimeLineTable::setup() +{ + setItemDelegate(new TupTimeLineTableItemDelegate(this)); + setSelectionBehavior(QAbstractItemView::SelectItems); + setSelectionMode(QAbstractItemView::SingleSelection); + setEditTriggers(QAbstractItemView::NoEditTriggers); + + connect(this, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(requestFrameSelection(int, int, int, int))); + + setHorizontalHeader(k->ruler); + setVerticalHeader(k->layerColumn); + + setItemSize(10, 25); + + k->ruler->setSectionResizeMode(QHeaderView::Custom); + k->layerColumn->setSectionResizeMode(QHeaderView::Custom); +} + +void TupTimeLineTable::frameSelectionFromRuler(int frameIndex) +{ + emit frameSelected(0, frameIndex); +} + +void TupTimeLineTable::frameSelectionFromLayerHeader(int layerIndex) +{ + if (k->layerColumn->currentSectionIndex() != layerIndex) + k->layerColumn->updateSelection(layerIndex); + + emit frameSelected(layerIndex, currentColumn()); +} + +void TupTimeLineTable::requestLayerMove(int logicalIndex, int oldVisualIndex, int newVisualIndex) +{ + Q_UNUSED(logicalIndex); + + if (!k->layerColumn->sectionIsMoving()) { + int distance = newVisualIndex - oldVisualIndex; + if (distance > 0) { + if (distance > 1) + newVisualIndex = oldVisualIndex + 1; + } else { + distance = abs(distance); + if (distance > 1) + newVisualIndex = oldVisualIndex - 1; + } + + k->isLocalRequest = true; + emit layerMoved(oldVisualIndex, newVisualIndex); + } +} + +void TupTimeLineTable::setItemSize(int w, int h) +{ + k->rectHeight = h; + k->rectWidth = w; + + fixSize(); +} + +bool TupTimeLineTable::isSoundLayer(int index) +{ + if (index < 0 && index >= rowCount()) + return false; + + return k->layerColumn->isSound(index); +} + +void TupTimeLineTable::insertLayer(int index, const QString &name) +{ + insertRow(index); + k->layerColumn->insertSection(index, name); + fixSize(); +} + +void TupTimeLineTable::insertSoundLayer(int index, const QString &name) +{ + insertRow(index); + k->layerColumn->insertSection(index, name); + fixSize(); +} + +void TupTimeLineTable::removeLayer(int index) +{ + k->removingLayer = true; + removeRow(index); + k->layerColumn->removeSection(index); +} + +void TupTimeLineTable::moveLayer(int index, int newIndex) +{ + if (index < 0 || index >= rowCount() || newIndex < 0 || newIndex >= rowCount()) + return; + + k->layerColumn->moveHeaderSection(index, newIndex, k->isLocalRequest); + if (k->isLocalRequest) + k->isLocalRequest = false; + + for (int frameIndex = 0; frameIndex <= k->layerColumn->lastFrame(index); frameIndex++) + exchangeFrame(frameIndex, index, frameIndex, newIndex); + + blockSignals(true); + selectFrame(newIndex, currentColumn()); + blockSignals(false); +} + +void TupTimeLineTable::exchangeFrame(int currentFrame, int currentLayer, int newFrame, int newLayer) +{ + QTableWidgetItem *oldItem = takeItem(currentLayer, currentFrame); + QTableWidgetItem *newItem = takeItem(newLayer, newFrame); + + setItem(newLayer, newFrame, oldItem); + setItem(currentLayer, currentFrame, newItem); +} + +void TupTimeLineTable::setLayerVisibility(int layerIndex, bool isVisible) +{ + k->layerColumn->setSectionVisibility(layerIndex, isVisible); +} + +void TupTimeLineTable::setLayerName(int layerIndex, const QString &name) +{ + k->layerColumn->setSectionTitle(layerIndex, name); +} + +int TupTimeLineTable::currentLayer() +{ + return currentRow(); +} + +int TupTimeLineTable::layersTotal() +{ + return rowCount(); +} + +int TupTimeLineTable::lastFrameByLayer(int index) +{ + if (index < 0 || index >= rowCount()) + return -1; + + return k->layerColumn->lastFrame(index); +} + +// FRAMES + +void TupTimeLineTable::insertFrame(int layerIndex, const QString &name) +{ + Q_UNUSED(name); + + if (layerIndex < 0 || layerIndex >= rowCount()) + return; + + k->layerColumn->updateLastFrame(layerIndex, true); + + int lastFrame = k->layerColumn->lastFrame(layerIndex); + + setAttribute(layerIndex, lastFrame, TupTimeLineTableItem::IsUsed, true); + setAttribute(layerIndex, lastFrame, TupTimeLineTableItem::IsSound, false); +} + +void TupTimeLineTable::updateLayerHeader(int layerIndex) +{ + k->layerColumn->updateSelection(layerIndex); +} + +void TupTimeLineTable::selectFrame(int index) +{ + setCurrentItem(item(currentRow(), index)); +} + +void TupTimeLineTable::removeFrame(int index, int position) +{ + Q_UNUSED(position); + + if (index < 0 || index >= rowCount()) + return; + + k->removingFrame = true; + + setAttribute(index, k->layerColumn->lastFrame(index), TupTimeLineTableItem::IsUsed, false); + + k->layerColumn->updateLastFrame(index, false); + viewport()->update(); +} + +void TupTimeLineTable::lockFrame(int index, int position, bool lock) +{ + if (index < 0 || index >= rowCount()) + return; + + setAttribute(index, position, TupTimeLineTableItem::IsLocked, lock); + viewport()->update(); +} + +bool TupTimeLineTable::frameIsLocked(int layerIndex, int frameIndex) +{ + TupTimeLineTableItem *frame = dynamic_cast(item(layerIndex, frameIndex)); + + if (frame) { + return frame->isLocked(); + } else { + #ifdef K_DEBUG + QString msg = "TupTimeLineTable::frameIsLocked() - Layer: " + QString::number(layerIndex) + QString(", Frame: ") + QString::number(frameIndex) + QString(" doesn't exist"); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + } + + return false; +} + +void TupTimeLineTable::setAttribute(int row, int col, TupTimeLineTableItem::Attributes att, bool value) +{ + QTableWidgetItem *item = this->item(row, col); + + if (!item) { + item = new TupTimeLineTableItem; + setItem(row, col, item); + } + + item->setData(att, value); +} + +void TupTimeLineTable::fixSize() +{ + for (int column = 0; column < columnCount(); column++) + horizontalHeader()->resizeSection(column, k->rectWidth); + + for (int row = 0; row < rowCount(); row++) + k->layerColumn->resizeSection(row, k->rectHeight); +} + +void TupTimeLineTable::requestFrameSelection(int currentSelectedRow, int currentSelectedColumn, int previousRow, int previousColumn) +{ + if (!k->removingLayer) { + if (k->removingFrame) { + k->removingFrame = false; + emit frameSelected(currentRow(), currentColumn()); + return; + } else { + if (previousColumn != currentSelectedColumn || previousRow != currentSelectedRow) + emit frameSelected(currentRow(), currentColumn()); + } + } else { // A layer is being removed + k->removingLayer = false; + + if (previousRow != 0) { + if (previousRow != rowCount() - 1) { + blockSignals(true); + setCurrentItem(item(previousRow - 1, currentColumn())); + k->layerColumn->updateSelection(previousRow - 1); + blockSignals(false); + } + } + } +} + +void TupTimeLineTable::mousePressEvent(QMouseEvent *event) +{ + int frameIndex = columnAt(event->x()); + + int total = columnCount(); + if ((frameIndex >= total - 11) && (frameIndex <= total - 1)) { + int newTotal = total + 100; + for (int i=total; i < newTotal; i++) { + insertColumn(i); + } + fixSize(); + } + + QTableWidget::mousePressEvent(event); +} + +void TupTimeLineTable::keyPressEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Right) { + int limit = columnCount()-1; + int next = currentColumn()+1; + if (next <= limit) + setCurrentCell(currentRow(), next); + } + + if (event->key() == Qt::Key_Left) { + int next = currentColumn()-1; + if (next >= 0) + setCurrentCell(currentRow(), next); + } + + if (event->key() == Qt::Key_Up) { + int next = currentRow()-1; + if (next >= 0) + setCurrentCell(next, currentColumn()); + } + + if (event->key() == Qt::Key_Down) { + int limit = rowCount()-1; + int next = currentRow()+1; + if (next <= limit) + setCurrentCell(next, currentColumn()); + } +} + +void TupTimeLineTable::enterEvent(QEvent *event) +{ + if (!hasFocus()) + setFocus(); + + QTableWidget::enterEvent(event); +} + +void TupTimeLineTable::leaveEvent(QEvent *event) +{ + if (hasFocus()) + clearFocus(); + + QTableWidget::leaveEvent(event); +} + +void TupTimeLineTable::selectFrame(int layerIndex, int frameIndex) +{ + blockSignals(true); + setCurrentCell(layerIndex, frameIndex); + updateLayerHeader(layerIndex); + blockSignals(false); +} diff -Nru tupi-0.2+git04/src/components/timeline/tuptimelinetable.h tupi-0.2+git05/src/components/timeline/tuptimelinetable.h --- tupi-0.2+git04/src/components/timeline/tuptimelinetable.h 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptimelinetable.h 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,140 @@ +/*************************************************************************** + * Project TUPI: Magia 2D * + * Project Contact: info@maefloresta.com * + * Project Website: http://www.maefloresta.com * + * Project Leader: Gustav Gonzalez * + * * + * Developers: * + * 2010: * + * Gustavo Gonzalez / xtingray * + * * + * KTooN's versions: * + * * + * 2006: * + * David Cuadrado * + * Jorge Cuadrado * + * 2003: * + * Fernado Roldan * + * Simena Dinas * + * * + * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * + * License: * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + ***************************************************************************/ + +#ifndef TUPTIMELINETABLE_H +#define TUPTIMELINETABLE_H + +#include "tglobal.h" +#include "tuptimelineruler.h" +#include "tuptimelineheader.h" +#include "tupprojectactionbar.h" + +#include +#include +#include +#include +#include + +class TupTimeLineTable; +class TupTimeLineTableItemDelegate; + +class TUPI_EXPORT TupTimeLineTableItem : public QTableWidgetItem +{ + public: + enum Attributes + { + IsUsed = 0x0100, + IsLocked, + IsSound + }; + + TupTimeLineTableItem(); + virtual ~TupTimeLineTableItem(); + + bool isUsed(); + bool isLocked(); + bool isSound(); +}; + +class TupTimeLineRuler; + +/** + * @author David Cuadrado +*/ +class TUPI_EXPORT TupTimeLineTable : public QTableWidget +{ + Q_OBJECT; + + friend class TupTimeLineTableItemDelegate; + + public: + TupTimeLineTable(int sceneIndex = 0, QWidget *parent = 0); + ~TupTimeLineTable(); + + bool isSoundLayer(int row); + void setLayerVisibility(int layerIndex, bool isVisible); + void setLayerName(int layerIndex, const QString &name); + void selectFrame(int layerIndex, int frameIndex); + bool frameIsLocked(int layerIndex, int frameIndex); + + public slots: + // Layers + void insertLayer(int index, const QString &name); + void insertSoundLayer(int layerPos, const QString &name); + void removeLayer(int pos); + void moveLayer(int pos, int newPos); + int lastFrameByLayer(int layerPos); + void updateLayerHeader(int layerIndex); + int currentLayer(); + int layersTotal(); + + // Frames + void insertFrame(int layerPos, const QString &name); + void selectFrame(int index); + void setAttribute(int row, int col, TupTimeLineTableItem::Attributes att, bool value); + void removeFrame(int layerPos, int position); + void lockFrame(int layerPosition, int position, bool lock); + void setItemSize(int w, int h); + void exchangeFrame(int currentFrame, int currentLayer, int newFrame, int newLayer); + + private: + void setup(); + + protected: + void fixSize(); + void mousePressEvent(QMouseEvent * event); + void keyPressEvent(QKeyEvent * event); + void enterEvent(QEvent *event); + void leaveEvent(QEvent *event); + + private slots: + void frameSelectionFromRuler(int frameIndex); + void frameSelectionFromLayerHeader(int layerIndex); + void requestFrameSelection(int currentSelectedRow, int currentSelectedColumn, int previousRow, int previousColumn); + void requestLayerMove(int logicalIndex, int oldVisualIndex, int newVisualIndex); + + signals: + void frameChanged(int sceneIndex, int layerIndex, int frameIndex); + void frameSelected(int layer, int frame); + void visibilityChanged(int layer, bool isVisible); + void layerNameChanged(int layer, const QString &name); + void layerMoved(int oldVisualIndex, int newVisualIndex); + + private: + struct Private; + Private *const k; +}; + +#endif diff -Nru tupi-0.2+git04/src/components/timeline/tuptlruler.cpp tupi-0.2+git05/src/components/timeline/tuptlruler.cpp --- tupi-0.2+git04/src/components/timeline/tuptlruler.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptlruler.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "tuptlruler.h" -#include "tdebug.h" - -#include -#include - -TupTLRuler::TupTLRuler(QWidget *parent) : QHeaderView(Qt::Horizontal, parent) -{ - #ifdef K_DEBUG - TINIT; - #endif - - setHighlightSections(true); - - // setClickable(true); - connect(this, SIGNAL(sectionClicked(int)), this, SLOT(updateSelected(int))); -} - -TupTLRuler::~TupTLRuler() -{ - #ifdef K_DEBUG - TEND; - #endif -} - -void TupTLRuler::paintSection(QPainter * painter, const QRect & rect, int logicalIndex) const -{ - if (!model() || !rect.isValid()) - return; - - painter->save(); - - QModelIndex currentSelection = currentIndex(); - int column = currentSelection.row(); - - if (selectionModel()->isSelected(model()->index(column, logicalIndex))) { - QBrush brush(QColor(255, 100, 100, 150)); - brush.setStyle(Qt::Dense5Pattern); - painter->fillRect(rect, brush); - } - - logicalIndex++; - - if (logicalIndex == 1 || logicalIndex % 5 == 0) { - QFont label("Arial", 7, QFont::Normal, false); - QFontMetrics fm(label); - - QString number = QString::number(logicalIndex); - - painter->setFont(label); - painter->drawText((int)(rect.center().x() - (fm.width(number)/2)), - (int)(rect.center().y() + (fm.height()/2)) - 2, number); - } - - int x = rect.bottomLeft().x() - 1; - int topY = rect.topLeft().y(); - int bottomY = rect.bottomLeft().y(); - painter->drawLine(x, bottomY, x, bottomY - 6); - painter->drawLine(x, topY, x, topY + 4); - - QPen pen = painter->pen(); - pen.setWidth(4); - painter->setPen(pen); - painter->drawLine(rect.bottomLeft(), rect.bottomRight()); - painter->restore(); - -} - -void TupTLRuler::updateSelected(int logical) -{ - select(logical); - - emit logicalSectionSelected(logical); -} - -void TupTLRuler::select(int logical) -{ - selectionModel()->select(model()->index(0, logical), QItemSelectionModel::ClearAndSelect); - viewport()->update(QRect(sectionViewportPosition(logical), 0, sectionSize(logical),viewport()->height())); -} - -void TupTLRuler::mouseMoveEvent(QMouseEvent *e) -{ - if (e->buttons() & Qt::LeftButton) - updateSelected(logicalIndexAt(e->pos())); - - QHeaderView::mouseMoveEvent(e); -} diff -Nru tupi-0.2+git04/src/components/timeline/tuptlruler.h tupi-0.2+git05/src/components/timeline/tuptlruler.h --- tupi-0.2+git04/src/components/timeline/tuptlruler.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/timeline/tuptlruler.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPTLRULER_H -#define TUPTLRULER_H - -#include - -/** - * @author David Cuadrado -**/ - -class TupTLRuler : public QHeaderView -{ - Q_OBJECT - - public: - TupTLRuler(QWidget *parent = 0); - ~TupTLRuler(); - void select(int logical); - - protected: - void paintSection(QPainter *painter, const QRect & rect, int logicalIndex) const; - void mouseMoveEvent(QMouseEvent *e); - - private slots: - void updateSelected(int logical); - - signals: - void logicalSectionSelected(int logical); -}; - -#endif diff -Nru tupi-0.2+git04/src/components/twitter/tuptwitter.cpp tupi-0.2+git05/src/components/twitter/tuptwitter.cpp --- tupi-0.2+git04/src/components/twitter/tuptwitter.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/twitter/tuptwitter.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,23 +33,15 @@ * along with this program. If not, see . * ***************************************************************************/ -#include -#include -#include -#include -#include -#include - #include "tuptwitter.h" -#include "tdebug.h" -QString Tupwitter::TWITTER_HOST = QString("http://twitter.com"); -QString Tupwitter::IS_TWITTER_UP_URL = QString("/help/test.xml"); -QString Tupwitter::USER_TIMELINE_URL = QString("/statuses/user_timeline/maefloresta.xml"); -QString Tupwitter::TUPI_VERSION_URL = QString("http://www.maefloresta.com/updates/current_version.xml"); -QString Tupwitter::BROWSER_FINGERPRINT = QString("Tupi_Browser 1.0"); +QString TupTwitter::NEWS_HOST = QString("http://www.maefloresta.com"); +QString TupTwitter::IS_HOST_UP_URL = QString("/updates/test.xml"); +QString TupTwitter::USER_TIMELINE_URL = QString("/updates/tweets.html"); +QString TupTwitter::TUPI_VERSION_URL = QString("/updates/current_version.xml"); +QString TupTwitter::BROWSER_FINGERPRINT = QString("Tupi_Browser 1.0"); -struct Tupwitter::Private +struct TupTwitter::Private { QNetworkAccessManager *manager; QNetworkRequest request; @@ -59,108 +51,156 @@ QString revision; QString codeName; QString word; - QString reference; QString url; - QString meaning; bool update; }; -Tupwitter::Tupwitter(QWidget *parent) : QWidget(parent), k(new Private) +TupTwitter::TupTwitter(QWidget *parent) : QWidget(parent), k(new Private) { k->update = false; } -void Tupwitter::start() +void TupTwitter::start() { - loadTwitterMeaning(); - QString url = TWITTER_HOST + IS_TWITTER_UP_URL; + QString url = NEWS_HOST + IS_HOST_UP_URL; + + #ifdef K_DEBUG + QString msg = "TupTwitter::start() - Requesting url -> " + url; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif k->manager = new QNetworkAccessManager(this); - connect(k->manager, SIGNAL(finished(QNetworkReply*)), - this, SLOT(closeRequest(QNetworkReply*))); + connect(k->manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(closeRequest(QNetworkReply*))); k->request.setUrl(QUrl(url)); - k->request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toAscii()); + k->request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toLatin1()); k->reply = k->manager->get(k->request); connect(k->reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotError(QNetworkReply::NetworkError))); } -Tupwitter::~Tupwitter() +TupTwitter::~TupTwitter() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupTwitter()]"; + #else + TEND; + #endif #endif delete k; } -void Tupwitter::requestFile(QString target) +void TupTwitter::requestFile(QString target) { + #ifdef K_DEBUG + QString msg = "TupTwitter::requestFile() - Requesting url -> " + target; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + k->request.setUrl(QUrl(target)); - k->request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toAscii()); + k->request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toLatin1()); k->reply = k->manager->get(k->request); } -void Tupwitter::closeRequest(QNetworkReply *reply) +void TupTwitter::closeRequest(QNetworkReply *reply) { QByteArray array = reply->readAll(); QString answer(array); + answer.chop(1); if (answer.length() > 0) { if (answer.compare("true") == 0) { - requestFile(TUPI_VERSION_URL); + requestFile(NEWS_HOST + TUPI_VERSION_URL); } else { if (answer.contains("branch", Qt::CaseSensitive)) { checkSoftwareUpdates(array); - requestFile(TWITTER_HOST + USER_TIMELINE_URL); + requestFile(NEWS_HOST + USER_TIMELINE_URL); } else { - if (answer.contains("status", Qt::CaseSensitive) && (!answer.contains("Twitter is over capacity") - && !answer.contains("whale_error.gif") && !answer.contains("503 Error"))) { + if (answer.startsWith("= 0) { - int end = text.indexOf(" ", init); - if (end < 0) - end = text.length(); - QString www = text.mid(init, end-init); - QString link = ""; - text.insert(end, ""); - text.insert(init, link); - } - } else { - if (counter == 0) { - if (e1.tagName() == "user") { - QDomNode n2 = e1.firstChild(); - while (!n2.isNull()) { - QDomElement e2 = n2.toElement(); - if (!e2.isNull()) { - if (e2.tagName() == "name") { - name = e2.text(); - } else if (e2.tagName() == "description") { - description = e2.text(); - description.replace("-", "
-"); - } else if (e2.tagName() == "profile_image_url") { - image = e2.text(); - } else if (e2.tagName() == "url") { - website = ""; - website += e2.text(); - website += ""; - } else if (e2.tagName() == "followers_count") { - followers = e2.text(); - } - } - n2 = n2.nextSibling(); - } - counter = 1; - } - } - } - } - } - - n1 = n1.nextSibling(); - } - - output += "

\n"; - output += "

[ " + date + " ]

\n"; - output += " MaeFloresta: "; - output += text + "\n"; - output += "

\n"; - } - } - - n = n.nextSibling(); - } - } - - QString html = ""; - - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += "\n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += "
\n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - - QString css = "tupi_version"; - if (k->update) - css = "tupi_update"; - - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += " \n"; - html += "
\n"; - html += "   \n"; - html += " \"maefloresta\"/\n"; - html += "   maefloresta\n"; - html += "
\n"; - html += "
\n"; - html += "
" + tr("Latest version") + ": " + k->version + "    " + tr("Revision") + ": " + k->revision + "    " + tr("Code Name") + ": " + k->codeName + ""; - - if (k->update) - html += "
[ " + tr("Update here!") + " ]"; - - html += "
\n"; - - html += "
\n"; - html += " " + tr("This is what's happening") + ":\n"; - html += "
\n"; - - html += output; - - html += "
\n"; - html += "
\n"; - html += " \n"; - html += " \n"; - html += "
\n"; - html += " " + tr("Name") + ": " + name + "
\n"; - html += " " + tr("Description") + ": " + description + "
\n"; - html += " " + tr("Website") + ": " + website + "
\n"; - html += " " + tr("Followers") + ": " + followers + "
\n"; - html += "
\n"; - html += " \n"; - html += " \n"; - html += "
\n"; - html += "

\n"; - html += "  
\n"; - html += " url.simplified() + "\">" + k->reference + "
\n"; - html += " " + k->word + ": " + k->meaning + "
\n"; - html += "

"; - html += "
\n"; - html += "
\n"; - html += "\n"; - html += ""; - - QString twitterPath = QDir::homePath() + "/." + QCoreApplication::applicationName() + "/twitter.html"; - QFile file(twitterPath); - file.open(QIODevice::WriteOnly); - - QByteArray data = html.toUtf8(); - file.write(data, qstrlen(data)); - file.close(); - - // FIXME: This class doesn't close its network request correctly / refactoring required - // delete k->reply; - // delete k->manager; - - emit pageReady(); -} - -void Tupwitter::loadTwitterMeaning() +void TupTwitter::formatStatus(QByteArray array) { - QDomDocument doc; - QString twitterFile = DATA_DIR + "twitter.xml"; - QFile file(twitterFile); + QString tweets = QString(array); + QString html = ""; - if (!file.open(QIODevice::ReadOnly)) - return; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "\n"; + html += "

"; + html += "
\"maefloresta\"/
\n"; + html += "
  @maefloresta
\n"; + QString css = "twitter_tupi_version"; + if (k->update) + css = "twitter_tupi_update"; + + html += "
\n"; + html += tr("Latest version") + ": " + k->version + "    "; + html += tr("Revision") + ": " + k->revision + "    "; + html += tr("Code Name") + ": " + k->codeName + ""; + + if (k->update) + html += "   [ " + tr("It's time to upgrade! Click here!") + " ]"; + + html += "
\n"; + html += "\n"; + html += tweets; + html += "\n"; + html += ""; + + QString twitterPath = QDir::homePath() + "/." + QCoreApplication::applicationName() + "/twitter.html"; + QFile file(twitterPath); + file.open(QIODevice::WriteOnly); - if (!doc.setContent(&file)) { - file.close(); - return; - } + QByteArray data = html.toUtf8(); + file.write(data, qstrlen(data)); file.close(); - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + k->reply->deleteLater(); + k->manager->deleteLater(); - while (!n.isNull()) { - QDomElement e = n.toElement(); - if (!e.isNull()) { - if (e.tagName() == "word") - k->word = e.text(); - else if (e.tagName() == "ref") - k->reference = e.text(); - else if (e.tagName() == "url") - k->url = e.text(); - else if (e.tagName() == "meaning") - k->meaning = e.text(); - } - n = n.nextSibling(); - } + #ifdef K_DEBUG + QString msg = "TupTwitter::formatStatus() - Saving file -> " + twitterPath; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + emit pageReady(); } diff -Nru tupi-0.2+git04/src/components/twitter/tuptwitter.h tupi-0.2+git05/src/components/twitter/tuptwitter.h --- tupi-0.2+git04/src/components/twitter/tuptwitter.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/twitter/tuptwitter.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,25 +33,30 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef TUPWITTER_H -#define TUPWITTER_H +#ifndef TUPTWITTER_H +#define TUPTWITTER_H +#include "tglobal.h" #include "tapplicationproperties.h" #include -#include #include #include #include #include +#include +#include +#include +#include +#include -class Tupwitter : public QWidget +class TUPI_EXPORT TupTwitter : public QWidget { Q_OBJECT public: - Tupwitter(QWidget *parent=0); - ~Tupwitter(); + TupTwitter(QWidget *parent=0); + ~TupTwitter(); void start(); private slots: @@ -65,10 +70,9 @@ void requestFile(QString target); void checkSoftwareUpdates(QByteArray array); void formatStatus(QByteArray array); - void loadTwitterMeaning(); - static QString TWITTER_HOST; - static QString IS_TWITTER_UP_URL; + static QString NEWS_HOST; + static QString IS_HOST_UP_URL; static QString USER_TIMELINE_URL; static QString TUPI_VERSION_URL; static QString BROWSER_FINGERPRINT; diff -Nru tupi-0.2+git04/src/components/twitter/tuptwitterwidget.cpp tupi-0.2+git05/src/components/twitter/tuptwitterwidget.cpp --- tupi-0.2+git04/src/components/twitter/tuptwitterwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/twitter/tuptwitterwidget.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,52 +34,54 @@ ***************************************************************************/ #include "tuptwitterwidget.h" -#include "tuptwitter.h" -#include "tglobal.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include - -// Twitter Widget +struct TupTwitterWidget::Private +{ + QSplitter *separator; + QTextBrowser *pageArea; + QTextDocument *document; +}; -TupTwitterWidget::TupTwitterWidget(QWidget *parent) : QWidget(parent) +TupTwitterWidget::TupTwitterWidget(QWidget *parent) : QWidget(parent), k(new Private) { setWindowTitle(tr("News!")); setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons/news_mode.png"))); QHBoxLayout *layout = new QHBoxLayout(this); layout->setMargin(15); - m_separator = new QSplitter(this); - layout->addWidget(m_separator); - - m_pageArea = new QTextBrowser(m_separator); - m_pageArea->setOpenExternalLinks(true); + k->separator = new QSplitter(this); + layout->addWidget(k->separator); - m_document = new QTextDocument(m_pageArea); - - m_pageArea->setDocument(m_document); + k->pageArea = new QTextBrowser(k->separator); + k->document = new QTextDocument(k->pageArea); + k->pageArea->setDocument(k->document); } TupTwitterWidget::~TupTwitterWidget() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupTwitterWidget()]"; + #else + TEND; + #endif #endif } -void TupTwitterWidget::setDocument(const QString &doc) -{ - m_document->setHtml(doc); -} - void TupTwitterWidget::setSource(const QString &filePath) { - m_pageArea->setSource(filePath); + QStringList path; +#ifdef Q_OS_WIN32 + QString resources = SHARE_DIR + "help" + QDir::separator(); +#else + QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); +#endif + + path << resources + "css"; + path << resources + "images"; + k->pageArea->setSearchPaths(path); + k->pageArea->setOpenExternalLinks(true); + k->pageArea->setSource(QUrl::fromLocalFile(filePath)); } void TupTwitterWidget::keyPressEvent(QKeyEvent * event) { @@ -94,12 +96,12 @@ void TupTwitterWidget::downLoadNews() { // Downloading maefloresta Twitter status - Tupwitter *tuptwitter = new Tupwitter(); - connect(tuptwitter, SIGNAL(pageReady()), this, SLOT(reload())); - tuptwitter->start(); + TupTwitter *twitter = new TupTwitter(); + connect(twitter, SIGNAL(pageReady()), this, SLOT(reload())); + twitter->start(); } void TupTwitterWidget::reload() { - m_pageArea->reload(); + k->pageArea->reload(); } diff -Nru tupi-0.2+git04/src/components/twitter/tuptwitterwidget.h tupi-0.2+git05/src/components/twitter/tuptwitterwidget.h --- tupi-0.2+git04/src/components/twitter/tuptwitterwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/twitter/tuptwitterwidget.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,16 +36,23 @@ #ifndef TUPTWITTERWIDGET_H #define TUPTWITTERWIDGET_H +#include "tglobal.h" +#include "tuptwitter.h" + #include #include #include #include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TupTwitterWidget : public QWidget +class TUPI_EXPORT TupTwitterWidget : public QWidget { Q_OBJECT @@ -54,7 +61,6 @@ ~TupTwitterWidget(); public slots: - void setDocument(const QString &doc); void setSource(const QString &filePath); private slots: @@ -65,10 +71,8 @@ private: void downLoadNews(); - - QSplitter *m_separator; - QTextBrowser *m_pageArea; - QTextDocument *m_document; + struct Private; + Private *const k; }; #endif diff -Nru tupi-0.2+git04/src/components/twitter/twitter.pri tupi-0.2+git05/src/components/twitter/twitter.pri --- tupi-0.2+git04/src/components/twitter/twitter.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/twitter/twitter.pri 2014-12-15 14:21:33.000000000 +0000 @@ -1,5 +1,12 @@ INCLUDEPATH += $$TWITTER_DIR -LIBS += -L$$TWITTER_DIR -ltupitwitter + +unix { + LIBS += -L$$TWITTER_DIR -ltupitwitter +} + +win32 { + LIBS += -L$$TWITTER_DIR/release/ -ltupitwitter +} linux-g++ { PRE_TARGETDEPS += $$TWITTER_DIR/libtupitwitter.so diff -Nru tupi-0.2+git04/src/components/twitter/twitter.pro tupi-0.2+git05/src/components/twitter/twitter.pro --- tupi-0.2+git04/src/components/twitter/twitter.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/components/twitter/twitter.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,7 +1,4 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/components/pen -# Target is a library: +QT += opengl core gui svg xml network INSTALLS += target target.path = /lib/ @@ -15,6 +12,7 @@ SOURCES += tuptwitter.cpp \ tuptwitterwidget.cpp + *:!macx{ CONFIG += dll warn_on } @@ -24,5 +22,37 @@ FRAMEWORK_DIR = "../../framework" include($$FRAMEWORK_DIR/framework.pri) -include(../components_config.pri) +unix { + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi + + !include(../../../tupiglobal.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) + + STORE_DIR = ../../store/ + INCLUDEPATH += $$STORE_DIR + LIBS += -L$$STORE_DIR/release/ -ltupistore + + LIBBASE_DIR = ../../libbase/ + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase + + LIBTUPI_DIR = ../../libtupi/ + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} diff -Nru tupi-0.2+git04/src/framework/framework.pri tupi-0.2+git05/src/framework/framework.pri --- tupi-0.2+git04/src/framework/framework.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/framework.pri 2014-12-15 14:21:33.000000000 +0000 @@ -1,6 +1,9 @@ - -#INCLUDEPATH += $$FRAMEWORK_DIR $$FRAMEWORK_DIR/tcore $$FRAMEWORK_DIR/tgui $$FRAMEWORK_DIR/tsound +unix { INCLUDEPATH += $$FRAMEWORK_DIR $$FRAMEWORK_DIR/tcore $$FRAMEWORK_DIR/tgui - -#LIBS += -L$$FRAMEWORK_DIR/tcore -L$$FRAMEWORK_DIR/tgui -L$$FRAMEWORK_DIR/tsound -ltupifwcore -ltupifwgui -ltupifwsound LIBS += -L$$FRAMEWORK_DIR/tcore -L$$FRAMEWORK_DIR/tgui -ltupifwcore -ltupifwgui +} + +win32 { +INCLUDEPATH += $$FRAMEWORK_DIR $$FRAMEWORK_DIR/tcore $$FRAMEWORK_DIR/tgui +LIBS += -L$$FRAMEWORK_DIR/tcore/release/ -L$$FRAMEWORK_DIR/tgui/release/ -ltupifwcore -ltupifwgui +} \ No newline at end of file diff -Nru tupi-0.2+git04/src/framework/framework.pro tupi-0.2+git05/src/framework/framework.pro --- tupi-0.2+git04/src/framework/framework.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/framework.pro 2014-12-15 14:21:33.000000000 +0000 @@ -7,4 +7,3 @@ SUBDIRS += tcore tgui CONFIG += ordered warn_on TEMPLATE = subdirs - diff -Nru tupi-0.2+git04/src/framework/tcore/talgorithm.cpp tupi-0.2+git05/src/framework/tcore/talgorithm.cpp --- tupi-0.2+git04/src/framework/tcore/talgorithm.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/talgorithm.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,17 +35,6 @@ #include "talgorithm.h" -#include -#include -#include -#include - -#ifdef Q_OS_LINUX -#include -#include -#include -#endif - int TAlgorithm::random() { static bool init = false; diff -Nru tupi-0.2+git04/src/framework/tcore/talgorithm.h tupi-0.2+git05/src/framework/tcore/talgorithm.h --- tupi-0.2+git04/src/framework/tcore/talgorithm.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/talgorithm.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,10 +36,22 @@ #ifndef TALGORITHM_H #define TALGORITHM_H +#include "tglobal.h" + #include #include -#include "tglobal.h" +#include +#include +#include +#include + +#ifdef Q_OS_LINUX +#include +#include +#include +#endif + /** * Class containing generic useful algorithms about random values diff -Nru tupi-0.2+git04/src/framework/tcore/tapplicationproperties.cpp tupi-0.2+git05/src/framework/tcore/tapplicationproperties.cpp --- tupi-0.2+git04/src/framework/tcore/tapplicationproperties.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tapplicationproperties.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,10 +35,6 @@ #include "tapplicationproperties.h" -#include -#include -#include - TApplicationProperties *TApplicationProperties::s_instance = 0; struct TApplicationProperties::Private @@ -97,7 +93,7 @@ void TApplicationProperties::setCacheDir(const QString &path) { - k->cacheDir = path; + k->cacheDir = path; } void TApplicationProperties::setRepositoryDir(const QString &path) @@ -145,7 +141,7 @@ if (locale.length() < 2) locale = "en"; - return k->shareDir + QDir::separator() + "data" + QDir::separator() + locale + QDir::separator(); + return k->shareDir + QDir::separator() + "data" + QDir::separator() + "xml" + QDir::separator() + locale + QDir::separator(); } return k->dataDir; diff -Nru tupi-0.2+git04/src/framework/tcore/tapplicationproperties.h tupi-0.2+git05/src/framework/tcore/tapplicationproperties.h --- tupi-0.2+git04/src/framework/tcore/tapplicationproperties.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tapplicationproperties.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,11 +33,15 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef KAPPLICATIONPROPERTIES_H -#define KAPPLICATIONPROPERTIES_H +#ifndef TAPPLICATIONPROPERTIES_H +#define TAPPLICATIONPROPERTIES_H #include "tglobal.h" + #include +#include +#include +#include /** * @author David Cuadrado @@ -85,5 +89,14 @@ }; #define kAppProp TApplicationProperties::instance() +#define HOME_DIR kAppProp->homeDir() +#define BIN_DIR kAppProp->binDir() +#define SHARE_DIR kAppProp->shareDir() +#define DATA_DIR kAppProp->dataDir() +#define THEME_DIR kAppProp->themeDir() +#define CONFIG_DIR kAppProp->configDir() +#define PLUGINS_DIR kAppProp->pluginDir() +#define CACHE_DIR kAppProp->cacheDir() +#define REPOSITORY_DIR kAppProp->repositoryDir() #endif diff -Nru tupi-0.2+git04/src/framework/tcore/tconfig.cpp tupi-0.2+git05/src/framework/tcore/tconfig.cpp --- tupi-0.2+git04/src/framework/tcore/tconfig.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tconfig.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tconfig.h" -#include "tdebug.h" - -#include -#include -#include -#include class TConfig::Private { @@ -61,40 +55,62 @@ TConfig::TConfig() : QObject(), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TConfig()]"; + #else + TINIT; + #endif #endif - - #ifdef Q_WS_X11 - k->configDirectory.setPath(QDir::homePath() + "/." + QCoreApplication::applicationName()); - #elif defined(Q_WS_WIN) - k->configDirectory.setPath(QDir::homePath() + "/" + QCoreApplication::applicationName()); - #elif defined(Q_WS_MAC) - k->configDirectory.setPath(QDir::homePath() + "/." + QCoreApplication::applicationName()); + + QString base = QDir::homePath() + QDir::separator(); + + /* + #ifdef Q_OS_WIN32 + k->configDirectory.setPath(base + QCoreApplication::applicationName()); + #else + k->configDirectory.setPath(base + "." + QCoreApplication::applicationName()); #endif + */ + + k->configDirectory.setPath(base + "." + QCoreApplication::applicationName()); if (!k->configDirectory.exists()) { k->firstTime = true; #ifdef K_DEBUG - tWarning() << "*** TConfig::TConfig() - Config file doesn't exist. Creating path: " << k->configDirectory.path(); + QString msg = "TConfig::TConfig() - Config file doesn't exist. Creating path: " + k->configDirectory.path(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif if (!k->configDirectory.mkdir(k->configDirectory.path())) { #ifdef K_DEBUG - tError() << "TConfig::TConfig() - Fatal Error: Can't create path -> " << k->configDirectory.path(); + QString msg = "TConfig::TConfig() - Fatal Error: Can't create path -> " + k->configDirectory.path(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { k->firstTime = false; } - k->path = k->configDirectory.path() + "/" + QCoreApplication::applicationName().toLower() + ".cfg"; + k->path = k->configDirectory.path() + QDir::separator() + QCoreApplication::applicationName().toLower() + ".cfg"; init(); } TConfig::~TConfig() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TConfig()]"; + #else + TEND; + #endif #endif if (m_instance) @@ -122,9 +138,16 @@ k->isOk = k->document.setContent(&config, &errorMsg, &errorLine, &errorColumn); if (!k->isOk) { - #ifdef K_DEBUG - tError() << "TConfig::init() - Fatal Error: Configuration file is corrupted - Line: " << errorLine << " - Column: " << errorColumn; - tError() << "TConfig::init() - Message: " << errorMsg; + #ifdef K_DEBUG + QString msg1 = "TConfig::init() - Fatal Error: Configuration file is corrupted - Line: " + QString::number(errorLine) + " - Column: " + QString::number(errorColumn); + QString msg2 = "TConfig::init() - Message: " + errorMsg; + #ifdef Q_OS_WIN32 + qDebug() << msg1; + qDebug() << msg2; + #else + tError() << msg1; + tError() << msg2; + #endif #endif } @@ -173,7 +196,8 @@ void TConfig::beginGroup(const QString & prefix) { - QString stripped = Qt::escape(prefix); + // QString stripped = Qt::escape(prefix); + QString stripped = QString(prefix).toHtmlEscaped(); stripped.replace(' ', "_"); stripped.replace('\n', ""); diff -Nru tupi-0.2+git04/src/framework/tcore/tconfig.h tupi-0.2+git05/src/framework/tcore/tconfig.h --- tupi-0.2+git04/src/framework/tcore/tconfig.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tconfig.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,17 @@ #ifndef TCONFIG_H #define TCONFIG_H -#include +#include "tglobal.h" + #include -#include +#include +#include +#include #include +#include +#include #include -#include "tglobal.h" - class TConfig; /** diff -Nru tupi-0.2+git04/src/framework/tcore/tcore.pro tupi-0.2+git05/src/framework/tcore/tcore.pro --- tupi-0.2+git04/src/framework/tcore/tcore.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tcore.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,10 +1,13 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/framework/tcore -# Target is a library: tupifwcore +QT += opengl core gui svg xml network -!include(../tupconfig.pri) { - error("Run ./configure first") +unix { + !include(../tupconfig.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) } INSTALLS += target @@ -23,7 +26,6 @@ HEADERS += talgorithm.h \ tapplicationproperties.h \ tconfig.h \ - tdebug.h \ tglobal.h \ tipdatabase.h \ txmlparserbase.h @@ -31,10 +33,16 @@ SOURCES += talgorithm.cpp \ tapplicationproperties.cpp \ tconfig.cpp \ - tdebug.cpp \ tipdatabase.cpp \ txmlparserbase.cpp +unix { + contains(DEFINES, K_DEBUG) { + HEADERS += tdebug.h + SOURCES += tdebug.cpp + } +} + *:!macx{ CONFIG += warn_on dll } diff -Nru tupi-0.2+git04/src/framework/tcore/tdebug.cpp tupi-0.2+git05/src/framework/tcore/tdebug.cpp --- tupi-0.2+git04/src/framework/tcore/tdebug.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tdebug.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,41 +33,8 @@ * along with this program. If not, see . * ***************************************************************************/ -#if !defined(K_NODEBUG) #include "tdebug.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// #include - -#ifdef QT_GUI_LIB - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - -// #include - #if defined(Q_OS_UNIX) # define SHOW_ERROR "*** \033[0;31m%s\033[0;0m ***\n" # define SHOW_WARNING "-> \033[10;33m%s\033[0;0m\n" @@ -78,10 +45,10 @@ # define SHOW_FATAL "***** %s *****\n" #endif -#ifdef QT_GUI_LIB - static QTextEdit *debugBrowser = 0; -#endif - +// #ifdef QT_GUI_LIB +static QTextEdit *debugBrowser = 0; +static bool projectIsOpen = false; +// #endif #ifdef Q_OS_UNIX @@ -145,7 +112,7 @@ { } -#ifdef QT_GUI_LIB +// #ifdef QT_GUI_LIB class DebugBrowserHighlighter : public QSyntaxHighlighter { @@ -201,7 +168,7 @@ setFormat(0, sepIndex, format); } -#endif // QT_GUI_LIB +// #endif // QT_GUI_LIB static void tDebugOutput(DebugType t, DebugOutput o, const char *data) { @@ -253,7 +220,7 @@ } break; - #ifdef QT_GUI_LIB + // #ifdef QT_GUI_LIB case TBoxOutput: { switch (t) { @@ -285,17 +252,19 @@ break; case TBrowserOutput: { - if (debugBrowser) { - if (data) { + if (projectIsOpen) { + if (debugBrowser) { + if (data) { debugBrowser->append(QString(data)); QScrollBar *bar = debugBrowser->verticalScrollBar(); bar->setValue(bar->maximum()); - fprintf(stderr, output, data); - } - } + } + } + } + fprintf(stderr, output, data); } break; - #endif + // #endif default: break; @@ -332,7 +301,6 @@ TDebug::~TDebug() { ::tDebugOutput(m_type, configReader.outputType, streamer->buffer.toLocal8Bit().data()); - delete streamer; } @@ -417,7 +385,6 @@ return *this; } -#ifdef QT_GUI_LIB TDebug& TDebug::operator<<( const QPixmap& p ) { *this << "(" << p.width() << ", " << p.height() << ")"; @@ -610,6 +577,8 @@ return debugBrowser; } -#endif // QT_GUI_LIB +void TDebug::setProjectStatus(bool status) +{ + projectIsOpen = status; +} -#endif // K_NODEBUG diff -Nru tupi-0.2+git04/src/framework/tcore/tdebug.h tupi-0.2+git05/src/framework/tcore/tdebug.h --- tupi-0.2+git04/src/framework/tcore/tdebug.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tdebug.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,41 @@ #ifndef TDEBUG_H #define TDEBUG_H -#include "tglobal.h" +// #include "tglobal.h" + +#if defined(QT_SHARED) || defined(QT_PLUGIN) +#define T_CORE_EXPORT Q_DECL_EXPORT +#else +#define T_CORE_EXPORT +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef QT_GUI_LIB + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif #include #include @@ -345,7 +379,7 @@ // static QTextBrowser *browser(QWidget *parent, int width); static QTextEdit *browser(QWidget *parent, int width); - + static void setProjectStatus(bool status); #endif template TDebug& operator << ( const QList &list ); diff -Nru tupi-0.2+git04/src/framework/tcore/tglobal.h tupi-0.2+git05/src/framework/tcore/tglobal.h --- tupi-0.2+git04/src/framework/tcore/tglobal.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tglobal.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,26 +36,54 @@ #ifndef TGLOBAL_H #define TGLOBAL_H +/** + * This class defines enumerations used in the whole code of the project. + * + * @author David Cuadrado +*/ + #if defined(QT_SHARED) || defined(QT_PLUGIN) -# define T_GUI_EXPORT Q_GUI_EXPORT -# define T_CORE_EXPORT Q_DECL_EXPORT -# define T_SOUND_EXPORT Q_DECL_EXPORT +#define T_GUI_EXPORT Q_GUI_EXPORT +#define T_CORE_EXPORT Q_DECL_EXPORT +#define T_SOUND_EXPORT Q_DECL_EXPORT +#define TUPI_EXPORT Q_GUI_EXPORT +#define TUPI_PLUGIN Q_DECL_EXPORT +#else +#define T_GUI_EXPORT +#define T_CORE_EXPORT +#define T_SOUND_EXPORT +#define TUPI_EXPORT +#define TUPI_PLUGIN +#endif + +#ifdef K_DEBUG + +#ifdef Q_OS_WIN32 +#include #else -# define T_GUI_EXPORT -# define T_CORE_EXPORT -# define T_SOUND_EXPORT +#include "tdebug.h" +#endif + #endif -// #include "tapplicationproperties.h" +#define LIBRARY_DIR CONFIG_DIR+"/libraries" + +namespace Tupi +{ + enum RenderType + { + Image = 0, + OpenGL, + Native + }; -#define HOME_DIR kAppProp->homeDir() -#define BIN_DIR kAppProp->binDir() -#define SHARE_DIR kAppProp->shareDir() -#define DATA_DIR kAppProp->dataDir() -#define THEME_DIR kAppProp->themeDir() -#define CONFIG_DIR kAppProp->configDir() -#define PLUGINS_DIR kAppProp->pluginDir() -#define CACHE_DIR kAppProp->cacheDir() -#define REPOSITORY_DIR kAppProp->repositoryDir() + enum MessageType + { + Information = 0, + Warning, + Error, + Critical + }; +}; #endif diff -Nru tupi-0.2+git04/src/framework/tcore/tipdatabase.cpp tupi-0.2+git05/src/framework/tcore/tipdatabase.cpp --- tupi-0.2+git04/src/framework/tcore/tipdatabase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tipdatabase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "tipdatabase.h" -#include "talgorithm.h" -#include "tdebug.h" - -#include -#include struct TipDatabase::Private { diff -Nru tupi-0.2+git04/src/framework/tcore/tipdatabase.h tupi-0.2+git05/src/framework/tcore/tipdatabase.h --- tupi-0.2+git04/src/framework/tcore/tipdatabase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/tipdatabase.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,7 +37,10 @@ #define TIPDATABASE_H #include "tglobal.h" +#include "talgorithm.h" +#include +#include #include #include #include diff -Nru tupi-0.2+git04/src/framework/tcore/txmlparserbase.cpp tupi-0.2+git05/src/framework/tcore/txmlparserbase.cpp --- tupi-0.2+git04/src/framework/tcore/txmlparserbase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/txmlparserbase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,8 +35,6 @@ #include "txmlparserbase.h" -#include "tdebug.h" - struct TXmlParserBase::Private { QString currentTag; @@ -116,16 +114,34 @@ bool TXmlParserBase::error(const QXmlParseException & exception) { - tWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); - tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; +#ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); + qWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; + #else + tWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); + tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; + #endif +#else + Q_UNUSED(exception); +#endif return true; } bool TXmlParserBase::fatalError(const QXmlParseException & exception) { - tFatal() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); - tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; +#ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); + qWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; + #else + tWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); + tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; + #endif +#else + Q_UNUSED(exception); +#endif return true; } @@ -169,7 +185,15 @@ { if (!file->isOpen()) { if (! file->open(QIODevice::ReadOnly | QIODevice::Text)) { - tWarning() << "Cannot open file " << file->fileName(); +#ifdef K_DEBUG + QString msg = "TXmlParserBase::parse() - Error: Cannot open file -> " + file->fileName(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif +#endif + return false; } } diff -Nru tupi-0.2+git04/src/framework/tcore/txmlparserbase.h tupi-0.2+git05/src/framework/tcore/txmlparserbase.h --- tupi-0.2+git04/src/framework/tcore/txmlparserbase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tcore/txmlparserbase.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,6 +37,7 @@ #define TXMLPARSERBASE_H #include "tglobal.h" + #include /** diff -Nru tupi-0.2+git04/src/framework/tgui/tabbedmainwindow.cpp tupi-0.2+git05/src/framework/tgui/tabbedmainwindow.cpp --- tupi-0.2+git04/src/framework/tgui/tabbedmainwindow.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tabbedmainwindow.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,13 +35,6 @@ #include "tabbedmainwindow.h" -#include -#include -#include -#include -#include -#include - #ifndef TUPI_GUI class TabWidgetPrivate : public QTabWidget diff -Nru tupi-0.2+git04/src/framework/tgui/tabbedmainwindow.h tupi-0.2+git05/src/framework/tgui/tabbedmainwindow.h --- tupi-0.2+git04/src/framework/tgui/tabbedmainwindow.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tabbedmainwindow.h 2014-12-15 14:21:33.000000000 +0000 @@ -38,6 +38,12 @@ #include "tmainwindow.h" +#include +#include +#include +#include +#include + class QTabWidget; /** @@ -45,7 +51,7 @@ * @author David Cuadrado */ -class T_IDEAL_EXPORT TabbedMainWindow : public TMainWindow +class T_GUI_EXPORT TabbedMainWindow : public TMainWindow { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tabdialog.cpp tupi-0.2+git05/src/framework/tgui/tabdialog.cpp --- tupi-0.2+git04/src/framework/tgui/tabdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tabdialog.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,10 +35,6 @@ #include "tabdialog.h" -#include -#include -#include - TabDialog::TabDialog(QWidget *parent, bool modal) : QDialog(parent) { QVBoxLayout *mainLayout = new QVBoxLayout; diff -Nru tupi-0.2+git04/src/framework/tgui/tabdialog.h tupi-0.2+git05/src/framework/tgui/tabdialog.h --- tupi-0.2+git04/src/framework/tgui/tabdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tabdialog.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,6 +40,9 @@ #include #include +#include +#include +#include typedef QHash Buttons; diff -Nru tupi-0.2+git04/src/framework/tgui/taction.cpp tupi-0.2+git05/src/framework/tgui/taction.cpp --- tupi-0.2+git04/src/framework/tgui/taction.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/taction.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,8 +34,6 @@ ***************************************************************************/ #include "taction.h" -#include "tactionmanager.h" -#include "tdebug.h" TAction::TAction(QObject * parent, const QString &id) : QAction(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/taction.h tupi-0.2+git05/src/framework/tgui/taction.h --- tupi-0.2+git04/src/framework/tgui/taction.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/taction.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,11 +36,12 @@ #ifndef TACTION_H #define TACTION_H +#include "tglobal.h" +#include "tactionmanager.h" + #include #include -#include "tglobal.h" - class TActionManager; /** diff -Nru tupi-0.2+git04/src/framework/tgui/tactionmanager.cpp tupi-0.2+git05/src/framework/tgui/tactionmanager.cpp --- tupi-0.2+git04/src/framework/tgui/tactionmanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tactionmanager.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tactionmanager.h" -#include "tdebug.h" - -#include -#include /** * Construye un manejador de acciones. @@ -69,8 +65,14 @@ QAction *a = (m_actionContainer[container])[id]; if (a == action) { #ifdef K_DEBUG - tError() << "TActionManager::insert() - Fatal Error: Cannot insert action with id: " << id; + QString msg = "TActionManager::insert() - Fatal Error: Cannot insert action with id -> " + id;; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } @@ -141,7 +143,12 @@ if (action == 0) { #ifdef K_DEBUG - tError() << "TActionManager::find() - Fatal Error: Returning NULL action: " << id << " in " << container; + QString msg = "TActionManager::find() - Fatal Error: Returning NULL action: " + id + " in " + container; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } diff -Nru tupi-0.2+git04/src/framework/tgui/tactionmanager.h tupi-0.2+git05/src/framework/tgui/tactionmanager.h --- tupi-0.2+git04/src/framework/tgui/tactionmanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tactionmanager.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,17 +36,20 @@ #ifndef TACTIONMANAGER_H #define TACTIONMANAGER_H -#include "taction.h" #include "tglobal.h" +#include "taction.h" +#include #include #include #include #include +#include +#include -typedef QList KActionList; -typedef QHash KActionDict; -typedef QHash KActionContainer; +typedef QList TActionList; +typedef QHash TActionDict; +typedef QHash TActionContainer; class QToolBar; class QMenuBar; @@ -78,7 +81,7 @@ QToolBar *setupToolBar(QToolBar *toolBar, const QString &container, bool clear = true); private: - KActionContainer m_actionContainer; + TActionContainer m_actionContainer; }; #endif diff -Nru tupi-0.2+git04/src/framework/tgui/tanimwidget.cpp tupi-0.2+git05/src/framework/tgui/tanimwidget.cpp --- tupi-0.2+git04/src/framework/tgui/tanimwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tanimwidget.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tanimwidget.h" -#include "tapplication.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include class TAnimWidget::Controller { diff -Nru tupi-0.2+git04/src/framework/tgui/tanimwidget.h tupi-0.2+git05/src/framework/tgui/tanimwidget.h --- tupi-0.2+git04/src/framework/tgui/tanimwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tanimwidget.h 2014-12-15 14:21:33.000000000 +0000 @@ -35,19 +35,23 @@ #ifndef TANIMWIDGET_H #define TANIMWIDGET_H + /** * @file tanimwidget.h * @brief Include this file if you need the class TAnimWidget */ +#include "tglobal.h" +#include "tapplication.h" + #include #include #include +#include +#include #include #include -#include "tglobal.h" - typedef QList ListOfPixmaps; /** diff -Nru tupi-0.2+git04/src/framework/tgui/tapplication.cpp tupi-0.2+git05/src/framework/tgui/tapplication.cpp --- tupi-0.2+git04/src/framework/tgui/tapplication.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tapplication.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,24 +34,18 @@ ***************************************************************************/ #include "tapplication.h" -#include "tdebug.h" -#include "tactionmanager.h" - -#include -#include -#include -#include -#include -#include - -#include -#include TApplication::TApplication(int & argc, char ** argv) : QApplication(argc, argv) { + /* #ifdef K_DEBUG - TINIT; - #endif + #ifdef Q_OS_WIN32 + qDebug() << "[TApplication()]"; + #else + TINIT; + #endif + #endif + */ QApplication::setEffectEnabled(Qt::UI_AnimateMenu, true); QApplication::setEffectEnabled(Qt::UI_AnimateCombo, true); @@ -67,9 +61,15 @@ { TCONFIG->sync(); + /* #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TApplication()]"; + #else + TEND; + #endif #endif + */ } void TApplication::applyTheme(const QString &file) diff -Nru tupi-0.2+git04/src/framework/tgui/tapplication.h tupi-0.2+git05/src/framework/tgui/tapplication.h --- tupi-0.2+git04/src/framework/tgui/tapplication.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tapplication.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,28 +36,33 @@ #ifndef TAPPLICATION_H #define TAPPLICATION_H +#include "tglobal.h" +#include "themedocument.h" #include "thememanager.h" #include "tvhbox.h" #include "twizard.h" #include "tconfig.h" -#include "tglobal.h" +#include "tactionmanager.h" #include #include -#include - #include #include #include #include #include +#include +#include +#include +#include +#include +#include class QApplication; class QString; -class ThemeDocument; class QPalette; -class TActionManager; -class TAction; +// class TActionManager; +// class TAction; typedef QMap ParseArgs; diff -Nru tupi-0.2+git04/src/framework/tgui/tbuttonbar.cpp tupi-0.2+git05/src/framework/tgui/tbuttonbar.cpp --- tupi-0.2+git04/src/framework/tgui/tbuttonbar.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tbuttonbar.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,18 +34,6 @@ ***************************************************************************/ #include "tbuttonbar.h" -#include "tviewbutton.h" -#include "toolview.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include - -#include TButtonBar::TButtonBar(Qt::ToolBarArea area, QWidget *parent) : QToolBar(parent), m_autoHide(false), m_blockHider(false), m_shouldBeVisible(true) { diff -Nru tupi-0.2+git04/src/framework/tgui/tbuttonbar.h tupi-0.2+git05/src/framework/tgui/tbuttonbar.h --- tupi-0.2+git04/src/framework/tgui/tbuttonbar.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tbuttonbar.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,12 +36,20 @@ #ifndef TBUTTONBAR_H #define TBUTTONBAR_H -#include "tideality.h" +#include "tglobal.h" +#include "tviewbutton.h" +#include "toolview.h" #include #include #include #include +#include +#include +#include +#include +#include +#include class TViewButton; class ToolView; @@ -52,7 +60,7 @@ * @author David Cuadrado */ -class T_IDEAL_EXPORT TButtonBar : public QToolBar +class T_GUI_EXPORT TButtonBar : public QToolBar { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tcellview.cpp tupi-0.2+git05/src/framework/tgui/tcellview.cpp --- tupi-0.2+git04/src/framework/tgui/tcellview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcellview.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,15 +34,6 @@ ***************************************************************************/ #include "tcellview.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include ////////// TCellViewItemDelegate /////////// @@ -173,8 +164,11 @@ setItemSize(18, 18); - horizontalHeader()->setResizeMode(QHeaderView::Custom); - verticalHeader()->setResizeMode(QHeaderView::Custom); + // horizontalHeader()->setResizeMode(QHeaderView::Custom); + // verticalHeader()->setResizeMode(QHeaderView::Custom); + + horizontalHeader()->setSectionResizeMode(QHeaderView::Custom); + verticalHeader()->setSectionResizeMode(QHeaderView::Custom); } void TCellView::setItemSize(int w, int h) @@ -226,7 +220,7 @@ } m_countColor++; - setItem(m_row-1 , m_col , item); + setItem(m_row-1, m_col, item); fixSize(); } @@ -250,7 +244,13 @@ void TCellView::wheelEvent(QWheelEvent *event) { if (event->modifiers() == Qt::ControlModifier) { - SHOW_VAR(event->delta()); + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TCellView::wheelEvent()] - event->delta(): " << event->delta(); + #else + SHOW_VAR(event->delta()); + #endif + #endif } else { QTableWidget::wheelEvent(event); } diff -Nru tupi-0.2+git04/src/framework/tgui/tcellview.h tupi-0.2+git05/src/framework/tgui/tcellview.h --- tupi-0.2+git04/src/framework/tgui/tcellview.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcellview.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,6 +40,13 @@ #include #include +#include +#include +#include +#include +#include +#include +#include class TCellViewItemDelegate; @@ -48,7 +55,7 @@ * @brief Include this file if you need the class TCellView, TCellViewItem, TCellViewItemDelegate or TCellViewModel */ -class TCellViewItem : public QTableWidgetItem +class T_GUI_EXPORT TCellViewItem : public QTableWidgetItem { public: TCellViewItem(); @@ -61,7 +68,7 @@ /** * @author David Cuadrado */ -class TCellView : public QTableWidget +class T_GUI_EXPORT TCellView : public QTableWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tcirclebuttonbar.cpp tupi-0.2+git05/src/framework/tgui/tcirclebuttonbar.cpp --- tupi-0.2+git04/src/framework/tgui/tcirclebuttonbar.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcirclebuttonbar.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,8 +35,6 @@ #include "tcirclebuttonbar.h" -#include - TCircleButtonBar::TCircleButtonBar(int radio, QWidget *parent) : QFrame(parent), m_radio(radio), m_buttonCount(0), m_offset(30) { m_layout = new QBoxLayout(QBoxLayout::LeftToRight, this); diff -Nru tupi-0.2+git04/src/framework/tgui/tcirclebuttonbar.h tupi-0.2+git05/src/framework/tgui/tcirclebuttonbar.h --- tupi-0.2+git04/src/framework/tgui/tcirclebuttonbar.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcirclebuttonbar.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,14 +33,18 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef CCBAR_H -#define CCBAR_H +#ifndef TCIRCLEBUTTONBAR_H +#define TCIRCLEBUTTONBAR_H /** * @file tcirclebuttonbar.h * Include this file if you need the class TCircleButtonBar */ +#include "tcirclebutton.h" +#include "tglobal.h" + +#include #include #include #include @@ -50,9 +54,6 @@ #include #include -#include "tcirclebutton.h" -#include "tglobal.h" - class QPainterPath; /** diff -Nru tupi-0.2+git04/src/framework/tgui/tcirclebutton.cpp tupi-0.2+git05/src/framework/tgui/tcirclebutton.cpp --- tupi-0.2+git04/src/framework/tgui/tcirclebutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcirclebutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,18 +35,6 @@ #include "tcirclebutton.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - static const char * new_xpm[] = { "12 16 6 1", " c #040404", diff -Nru tupi-0.2+git04/src/framework/tgui/tcirclebutton.h tupi-0.2+git05/src/framework/tgui/tcirclebutton.h --- tupi-0.2+git04/src/framework/tgui/tcirclebutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcirclebutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,8 +33,8 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef CCBUTTON_H -#define CCBUTTON_H +#ifndef TCIRCLEBUTTON_H +#define TCIRCLEBUTTON_H /** * @file tcirclebutton.h * Include this file if you need the class TCircleButton @@ -44,6 +44,17 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /** * @short The TCircleButton class provides a circular button diff -Nru tupi-0.2+git04/src/framework/tgui/tclicklineedit.cpp tupi-0.2+git05/src/framework/tgui/tclicklineedit.cpp --- tupi-0.2+git04/src/framework/tgui/tclicklineedit.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tclicklineedit.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,8 +35,6 @@ #include "tclicklineedit.h" -#include - struct TClickLineEdit::Private { QString clickMessage; @@ -76,9 +74,9 @@ QLineEdit::setText(txt); } -void TClickLineEdit::paintEvent(QPaintEvent *e) +void TClickLineEdit::paintEvent(QPaintEvent *event) { - QLineEdit::paintEvent(e); + QLineEdit::paintEvent(event); QPainter p(this); if (k->drawClickMsg == true && !hasFocus()) { @@ -88,24 +86,24 @@ cr.adjust(3, 0, 0 ,0); p.drawText(cr, Qt::AlignVCenter, k->clickMessage); - p.setPen( tmp ); + p.setPen(tmp); } } -void TClickLineEdit::focusInEvent(QFocusEvent *ev) +void TClickLineEdit::focusInEvent(QFocusEvent *event) { if (k->drawClickMsg == true) { k->drawClickMsg = false; repaint(); } - QLineEdit::focusInEvent(ev); + QLineEdit::focusInEvent(event); } -void TClickLineEdit::focusOutEvent(QFocusEvent *ev) +void TClickLineEdit::focusOutEvent(QFocusEvent *event) { if (text().isEmpty()) { k->drawClickMsg = true; repaint(); } - QLineEdit::focusOutEvent(ev); + QLineEdit::focusOutEvent(event); } diff -Nru tupi-0.2+git04/src/framework/tgui/tclicklineedit.h tupi-0.2+git05/src/framework/tgui/tclicklineedit.h --- tupi-0.2+git04/src/framework/tgui/tclicklineedit.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tclicklineedit.h 2014-12-15 14:21:33.000000000 +0000 @@ -39,6 +39,7 @@ #include "tglobal.h" #include +#include class T_GUI_EXPORT TClickLineEdit : public QLineEdit { diff -Nru tupi-0.2+git04/src/framework/tgui/tcollapsiblewidget.cpp tupi-0.2+git05/src/framework/tgui/tcollapsiblewidget.cpp --- tupi-0.2+git04/src/framework/tgui/tcollapsiblewidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcollapsiblewidget.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,21 +34,6 @@ ***************************************************************************/ #include "tcollapsiblewidget.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /****************************************************************** * Helper classes diff -Nru tupi-0.2+git04/src/framework/tgui/tcollapsiblewidget.h tupi-0.2+git05/src/framework/tgui/tcollapsiblewidget.h --- tupi-0.2+git04/src/framework/tgui/tcollapsiblewidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcollapsiblewidget.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,7 +40,20 @@ #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include class QScrollArea; class QTextDocument; diff -Nru tupi-0.2+git04/src/framework/tgui/tcolorbutton.cpp tupi-0.2+git05/src/framework/tgui/tcolorbutton.cpp --- tupi-0.2+git04/src/framework/tgui/tcolorbutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcolorbutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,23 +35,6 @@ #include "tcolorbutton.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - TColorButton::TColorButton(QWidget* parent) : QAbstractButton(parent) { setMinimumSize(minimumSizeHint()); diff -Nru tupi-0.2+git04/src/framework/tgui/tcolorbutton.h tupi-0.2+git05/src/framework/tgui/tcolorbutton.h --- tupi-0.2+git04/src/framework/tgui/tcolorbutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcolorbutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -44,6 +44,18 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include class QColor; diff -Nru tupi-0.2+git04/src/framework/tgui/tcommandhistory.cpp tupi-0.2+git05/src/framework/tgui/tcommandhistory.cpp --- tupi-0.2+git04/src/framework/tgui/tcommandhistory.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcommandhistory.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tcommandhistory.h" -#include "tdebug.h" - -#include -#include TCommandHistory::TCommandHistory(QUndoStack *stack, QObject *parent) : QObject(parent), m_stack(stack), m_currentIndex(0), m_isLastRedo(false) @@ -93,19 +89,22 @@ void TCommandHistory::updateFromIndex(int idx) { - qDebug("*** TCommandHistory::updateFromIndex"); - - tfDebug << idx << " == " << m_stack->count() << " == " << m_currentIndex; - tDebug() << m_stack->text(idx-1); + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << idx << " == " << m_stack->count() << " == " << m_currentIndex; + qDebug() << m_stack->text(idx-1); + #else + tDebug() << idx << " == " << m_stack->count() << " == " << m_currentIndex; + tDebug() << m_stack->text(idx-1); + #endif + #endif if (idx > m_stack->count()) { - qDebug("*** Exiting..."); m_stack->setIndex(m_stack->count()); return; } if (idx == m_stack->count() && !m_isLastRedo) { // Added - QAction *a = m_undoMenu->addAction(m_stack->text(idx-1)); a->setData(idx); a->setText(QString::number(idx)+": "+m_stack->text(idx-1)); @@ -117,33 +116,44 @@ m_undoMenu->setActiveAction(a); m_redoMenu->clear(); - } else if (idx > m_currentIndex) { // redo clicked - qDebug("REDO"); - tDebug() << idx << " " << m_currentIndex; + // qDebug("REDO"); + // tDebug() << idx << " " << m_currentIndex; if (m_actions.contains(idx)) { m_redoMenu->removeAction(m_actions[idx]); m_undoMenu->addAction(m_actions[idx]); m_undoMenu->menuAction()->setEnabled(true); } else { - tError() << "Error!"; + #ifdef K_DEBUG + QString msg = "TCommandHistory::updateFromIndex() - Error: invalid id " + QString::number(idx); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } else if (idx < m_currentIndex) { - // Undo clicked - qDebug("UNDO"); - tDebug() << idx << " " << m_currentIndex; + // qDebug("UNDO"); + // tDebug() << idx << " " << m_currentIndex; if (m_actions.contains(idx-1)) { m_undoMenu->removeAction(m_actions[idx-1]); m_redoMenu->addAction(m_actions[idx-1]); m_redoMenu->menuAction()->setEnabled(true); } else { - tError() << "Error!"; + #ifdef K_DEBUG + QString msg = "TCommandHistory::updateFromIndex() - Error: invalid id " + QString::number(idx); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } - } m_currentIndex = m_stack->index(); @@ -156,7 +166,14 @@ for (int i = qMin(idx, m_currentIndex); i < qMax(idx, m_currentIndex); i++) { if (!m_stack->canUndo()) { - tError() << "Cannot undo!!!"; + #ifdef K_DEBUG + QString msg = "TCommandHistory::undoFromAction() - Error: Cannot undo!!!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif break; } @@ -166,7 +183,14 @@ m_undoMenu->removeAction(m_actions[i]); m_redoMenu->addAction(m_actions[i]); } else { - qDebug("History item not found!"); + #ifdef K_DEBUG + QString msg = "TCommandHistory::undoFromAction() - Error: History item not found!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } @@ -188,9 +212,25 @@ m_stack->blockSignals(true); for (int i = qMax(idx, m_currentIndex)-1; i >= qMin(idx, m_currentIndex)-1; i--) { - SHOW_VAR(i); + #ifdef K_DEBUG + QString msg = "TupCommandExecutor::createItem() - Error: Invalid scene index!"; + #ifdef Q_OS_WIN32 + qDebug() << "SHOW_VAR: " << i; + #else + SHOW_VAR(i); + #endif + #endif + if (!m_stack->canRedo()) { - tError() << "Cannot redo!!!"; + #ifdef K_DEBUG + QString msg = "TCommandHistory::redoFromAction() - Error: Cannot redo!!!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + break; } @@ -200,7 +240,14 @@ m_redoMenu->removeAction(m_actions[i]); m_undoMenu->addAction(m_actions[i]); } else { - qDebug("ERROR REDO"); + #ifdef K_DEBUG + QString msg = "TCommandHistory::redoFromAction() - Error while doing REDO"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } @@ -220,13 +267,27 @@ void TCommandHistory::enableRedoMenu(bool e) { - T_FUNCINFO; + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TCommandHistory::enableRedoMenu()]"; + #else + T_FUNCINFO; + #endif + #endif + m_redoMenu->menuAction()->setEnabled(e); } void TCommandHistory::enableUndoMenu(bool e) { - T_FUNCINFO; + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TCommandHistory::enableUndoMenu()]"; + #else + T_FUNCINFO; + #endif + #endif + m_undoMenu->menuAction()->setEnabled(e); } diff -Nru tupi-0.2+git04/src/framework/tgui/tcommandhistory.h tupi-0.2+git05/src/framework/tgui/tcommandhistory.h --- tupi-0.2+git04/src/framework/tgui/tcommandhistory.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcommandhistory.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,12 @@ #ifndef TCOMMANDHISTORY_H #define TCOMMANDHISTORY_H +#include "tglobal.h" + #include #include +#include +#include class QUndoStack; class QMenu; @@ -47,7 +51,7 @@ * @author David Cuadrado */ -class TCommandHistory : public QObject +class T_GUI_EXPORT TCommandHistory : public QObject { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tconfigurationdialog.cpp tupi-0.2+git05/src/framework/tgui/tconfigurationdialog.cpp --- tupi-0.2+git04/src/framework/tgui/tconfigurationdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tconfigurationdialog.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tconfigurationdialog.h" -#include "tseparator.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include //////////////// diff -Nru tupi-0.2+git04/src/framework/tgui/tconfigurationdialog.h tupi-0.2+git05/src/framework/tgui/tconfigurationdialog.h --- tupi-0.2+git04/src/framework/tgui/tconfigurationdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tconfigurationdialog.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,22 @@ #ifndef TCONFIGURATIONDIALOG_H #define TCONFIGURATIONDIALOG_H -#include -#include -#include - +#include "tglobal.h" #include "twidgetlistview.h" #include "tflatbutton.h" +#include "tseparator.h" -#include "tglobal.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include class QStackedWidget; class QListWidget; diff -Nru tupi-0.2+git04/src/framework/tgui/tcontrolnode.cpp tupi-0.2+git05/src/framework/tgui/tcontrolnode.cpp --- tupi-0.2+git04/src/framework/tgui/tcontrolnode.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcontrolnode.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,17 +35,6 @@ #include "tcontrolnode.h" #include "tnodegroup.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include struct TControlNode::Private { @@ -61,7 +50,8 @@ TControlNode::TControlNode(int index, TNodeGroup *nodeGroup, const QPointF & pos, QGraphicsItem *graphicParent, QGraphicsScene *scene, int level) : - QGraphicsItem(0, scene), k(new Private) + QGraphicsItem(), k(new Private) + // QGraphicsItem(0, scene), k(new Private) { k->index = index; k->graphicParent = 0; @@ -78,13 +68,6 @@ setFlag(ItemSendsGeometryChanges, true); setPos(pos); - /* - if (level > 0) - setZValue(level + 1); - else - setZValue(graphicParent->zValue() + 1); - */ - setZValue(level); setGraphicParent(graphicParent); } @@ -102,15 +85,16 @@ // bool antialiasing = painter->renderHints() & QPainter::Antialiasing; // painter->setRenderHint(QPainter::Antialiasing, antialiasing); - QColor c; + QColor color; if (k->centralNode) { - c = QColor("white"); + color = QColor("white"); } else { - c = QColor(55, 155, 55); + color = QColor(55, 155, 55); + color.setAlpha(200); } - painter->setBrush(c); + painter->setBrush(color); paintLinesToChildNodes(painter); painter->drawRoundRect(boundingRect()); } @@ -138,17 +122,17 @@ QRectF TControlNode::boundingRect() const { - QSizeF size(8, 8); + QSizeF size(10, 10); QRectF rect(QPointF(-size.width()/2, -size.height()/2), size); if (k->rightNode) { if (k->rightNode->isVisible()) - rect.unite(k->rightNode->boundingRect()); + rect.united(k->rightNode->boundingRect()); } if (k->leftNode) { if (k->leftNode->isVisible()) - rect.unite(k->leftNode->boundingRect()); + rect.united(k->leftNode->boundingRect()); } return rect; @@ -202,7 +186,6 @@ void TControlNode::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (k->centralNode) { - setSelected(true); k->centralNode->setSelected(true); @@ -234,7 +217,11 @@ void TControlNode::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TControlNode::mouseReleaseEvent()]"; + #else T_FUNCINFO; + #endif #endif Q_UNUSED(event); @@ -340,3 +327,9 @@ { k->unchanged = unchanged; } + +void TControlNode::resize(qreal factor) +{ + setScale(factor); +} + diff -Nru tupi-0.2+git04/src/framework/tgui/tcontrolnode.h tupi-0.2+git05/src/framework/tgui/tcontrolnode.h --- tupi-0.2+git04/src/framework/tgui/tcontrolnode.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tcontrolnode.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,13 +33,23 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef CONTROLNODE_H -#define CONTROLNODE_H +#ifndef TCONTROLNODE_H +#define TCONTROLNODE_H +#include "tglobal.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include /** * @author Jorge Cuadrado @@ -47,15 +57,10 @@ class TNodeGroup; -// class TControlNode : public QObject, public QGraphicsItem -class TControlNode : public QGraphicsItem +class T_GUI_EXPORT TControlNode : public QGraphicsItem { - // Q_OBJECT - public: - enum State { Pressed = 1, Released }; - TControlNode(int index, TNodeGroup *nodeGroup, const QPointF & pos = QPoint(0,0), QGraphicsItem * parent = 0, QGraphicsScene * scene = 0, int level = 0); @@ -79,6 +84,7 @@ TControlNode *centralNode(); void hasChanged(bool notChange); + void resize(qreal factor); protected: QVariant itemChange(GraphicsItemChange change, const QVariant &value); diff -Nru tupi-0.2+git04/src/framework/tgui/tdoublecombobox.cpp tupi-0.2+git05/src/framework/tgui/tdoublecombobox.cpp --- tupi-0.2+git04/src/framework/tgui/tdoublecombobox.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tdoublecombobox.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,11 +35,6 @@ #include "tdoublecombobox.h" -#include -#include - -#include - #define PERCENT(v) (v * 100.0) / maximum() #define VALUE(p) (p * maximum()) / 100.0 diff -Nru tupi-0.2+git04/src/framework/tgui/tdoublecombobox.h tupi-0.2+git05/src/framework/tgui/tdoublecombobox.h --- tupi-0.2+git04/src/framework/tgui/tdoublecombobox.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tdoublecombobox.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,15 +36,20 @@ #ifndef TDOUBLECOMBOBOX_H #define TDOUBLECOMBOBOX_H +#include "tglobal.h" + #include +#include +#include +#include /** * @author David Cuadrado */ -class TDoubleComboBox : public QComboBox +class T_GUI_EXPORT TDoubleComboBox : public QComboBox { - Q_OBJECT; + Q_OBJECT public: TDoubleComboBox(double min, double max, QWidget *parent = 0); diff -Nru tupi-0.2+git04/src/framework/tgui/tdualcolorbutton.cpp tupi-0.2+git05/src/framework/tgui/tdualcolorbutton.cpp --- tupi-0.2+git04/src/framework/tgui/tdualcolorbutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tdualcolorbutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,21 +34,10 @@ ***************************************************************************/ #include "tdualcolorbutton.h" -#include "tdebug.h" #include "tcolorarrow.xpm" #include "tcolorreset.xpm" -#include -#include -#include -#include -#include -#include -#include -#include -#include - struct TDualColorButton::Private { QPixmap arrowBitmap; @@ -183,11 +172,11 @@ if (fgRect.contains(mPos)) { k->currentSpace = Foreground; - tFatal() << "TDualColorButton::mousePressEvent() - emitting foreground signal!"; + // tFatal() << "TDualColorButton::mousePressEvent() - emitting foreground signal!"; emit selectionChanged(Foreground); } else if (bgRect.contains(mPos)) { k->currentSpace = Background; - tFatal() << "TDualColorButton::mousePressEvent() - emitting background signal!"; + // tFatal() << "TDualColorButton::mousePressEvent() - emitting background signal!"; emit selectionChanged(Background); } else if (event->pos().x() > fgRect.width()) { // We handle the swap and reset controls as soon as the mouse is diff -Nru tupi-0.2+git04/src/framework/tgui/tdualcolorbutton.h tupi-0.2+git05/src/framework/tgui/tdualcolorbutton.h --- tupi-0.2+git04/src/framework/tgui/tdualcolorbutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tdualcolorbutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,9 @@ #ifndef TDUALCOLORBUTTON_H #define TDUALCOLORBUTTON_H -class QBitmap; +#include "tglobal.h" + +// class QBitmap; #include #include @@ -45,8 +47,10 @@ #include #include #include - -#include "tglobal.h" +#include +#include +#include +#include /** * @note This class was adapted to Tupi by David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/teditspinbox.cpp tupi-0.2+git05/src/framework/tgui/teditspinbox.cpp --- tupi-0.2+git04/src/framework/tgui/teditspinbox.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/teditspinbox.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,8 +35,6 @@ #include "teditspinbox.h" -#include - TEditSpinBox::TEditSpinBox(int value, int minValue, int maxValue, int step, QString text, QWidget *parent, const char *name) :QGroupBox(parent) { setObjectName(name); diff -Nru tupi-0.2+git04/src/framework/tgui/teditspinbox.h tupi-0.2+git05/src/framework/tgui/teditspinbox.h --- tupi-0.2+git04/src/framework/tgui/teditspinbox.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/teditspinbox.h 2014-12-15 14:21:33.000000000 +0000 @@ -38,6 +38,7 @@ #include "tglobal.h" +#include #include #include #include diff -Nru tupi-0.2+git04/src/framework/tgui/tflatbutton.cpp tupi-0.2+git05/src/framework/tgui/tflatbutton.cpp --- tupi-0.2+git04/src/framework/tgui/tflatbutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tflatbutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tflatbutton.h" -#include TFlatButton::TFlatButton(QWidget *parent) : QAbstractButton(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/tflatbutton.h tupi-0.2+git05/src/framework/tgui/tflatbutton.h --- tupi-0.2+git04/src/framework/tgui/tflatbutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tflatbutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -38,6 +38,7 @@ #include "tglobal.h" #include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/tfontchooser.cpp tupi-0.2+git05/src/framework/tgui/tfontchooser.cpp --- tupi-0.2+git04/src/framework/tgui/tfontchooser.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tfontchooser.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,13 +34,6 @@ ***************************************************************************/ #include "tfontchooser.h" -#include "tformfactory.h" -#include "tdebug.h" - -#include -#include -#include -#include TFontChooser::TFontChooser(QWidget *parent) : QFrame(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/tfontchooser.h tupi-0.2+git05/src/framework/tgui/tfontchooser.h --- tupi-0.2+git04/src/framework/tgui/tfontchooser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tfontchooser.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,7 +37,13 @@ #define TFONTCHOOSER_H #include "tglobal.h" +#include "tformfactory.h" + #include +#include +#include +#include +#include class QComboBox; class QFontComboBox; diff -Nru tupi-0.2+git04/src/framework/tgui/tformfactory.cpp tupi-0.2+git05/src/framework/tgui/tformfactory.cpp --- tupi-0.2+git04/src/framework/tgui/tformfactory.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tformfactory.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,12 +35,6 @@ #include "tformfactory.h" -#include -#include -#include - -#include - TFormFactory::TFormFactory() { } diff -Nru tupi-0.2+git04/src/framework/tgui/tformfactory.h tupi-0.2+git05/src/framework/tgui/tformfactory.h --- tupi-0.2+git04/src/framework/tgui/tformfactory.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tformfactory.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,11 +37,17 @@ #define TFORMFACTORY_H #include "tglobal.h" + #include #include +#include +// #include +// #include +#include +#include -class QBoxLayout; -class QGridLayout; +// class QBoxLayout; +// class QGridLayout; /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/tformvalidator.cpp tupi-0.2+git05/src/framework/tgui/tformvalidator.cpp --- tupi-0.2+git04/src/framework/tgui/tformvalidator.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tformvalidator.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,15 +34,6 @@ ***************************************************************************/ #include "tformvalidator.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include TFormValidator::TFormValidator(QWidget *form) : m_parent(form) { diff -Nru tupi-0.2+git04/src/framework/tgui/tformvalidator.h tupi-0.2+git05/src/framework/tgui/tformvalidator.h --- tupi-0.2+git04/src/framework/tgui/tformvalidator.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tformvalidator.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,11 +33,20 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef TVALIDATES_H -#define TVALIDATES_H +#ifndef TFORMVALIDATOR_H +#define TFORMVALIDATOR_H + +#include "tglobal.h" #include -class QLineEdit; +#include +#include +#include +#include +#include +#include + +// class QLineEdit; #define K_GIVE_NAME(obj) obj->setObjectName(#obj); @@ -45,7 +54,7 @@ * @author David Cuadrado */ -class TFormValidator +class T_GUI_EXPORT TFormValidator { public: TFormValidator(QWidget *form); diff -Nru tupi-0.2+git04/src/framework/tgui/tgui.pro tupi-0.2+git05/src/framework/tgui/tgui.pro --- tupi-0.2+git04/src/framework/tgui/tgui.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tgui.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,10 +1,13 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/framework/tgui -# Target is a library: tupifwgui +QT += opengl core gui svg xml network -!include(../tupconfig.pri) { - error("Run ./configure first!") +unix { + !include(../tupconfig.pri) { + error("Run ./configure first!") + } +} + +win32 { + include(../../../win.pri) } INSTALLS += target @@ -42,7 +45,7 @@ tformfactory.h \ tformvalidator.h \ ticon.h \ - tideality.h \ + # tideality.h \ timagebutton.h \ titemselector.h \ tmainwindow.h \ @@ -72,7 +75,7 @@ treewidgetsearchline.h \ tvhbox.h \ tviewbutton.h \ - twaitstyle.h \ + # twaitstyle.h \ twidgetlistview.h \ twizard.h \ tworkspacemainwindow.h \ @@ -129,7 +132,7 @@ treewidgetsearchline.cpp \ tvhbox.cpp \ tviewbutton.cpp \ - twaitstyle.cpp \ + # twaitstyle.cpp \ twidgetlistview.cpp \ twizard.cpp \ tworkspacemainwindow.cpp \ @@ -147,14 +150,21 @@ RESOURCES += tgui_images.qrc -linux-g{ +linux-g { TARGETDEPS += ../tcore/libtupifwcore.so } -# include(../../../tupiglobal.pri) - -LIBS += -L../tcore -ltupifwcore +unix { + LIBS += -L../tcore -ltupifwcore + # INCLUDEPATH += ../tcore ../ ../../libbase + INCLUDEPATH += ../tcore +} -macx { - LIBS += -lavcodec -lavformat -lavutil +win32 { + LIBS += -L..\tcore\release\ -ltupifwcore + INCLUDEPATH += ..\tcore } + +# macx { +# LIBS += -lavcodec -lavformat -lavutil +# } diff -Nru tupi-0.2+git04/src/framework/tgui/themedocument.h tupi-0.2+git05/src/framework/tgui/themedocument.h --- tupi-0.2+git04/src/framework/tgui/themedocument.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/themedocument.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,7 +40,7 @@ #include #include -#include +#include typedef QMap ThemeKey; diff -Nru tupi-0.2+git04/src/framework/tgui/thememanager.cpp tupi-0.2+git05/src/framework/tgui/thememanager.cpp --- tupi-0.2+git04/src/framework/tgui/thememanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/thememanager.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,13 +34,8 @@ ***************************************************************************/ #include "thememanager.h" -#include "themedocument.h" -#include "tdebug.h" -#include "tglobal.h" #include "tapplication.h" -#include - ThemeManager::ThemeManager() : QXmlDefaultHandler() { m_palette = QApplication::palette(); @@ -63,8 +58,14 @@ ok = true; } else { #ifdef K_DEBUG - tError() << "ThemeManager::applyTheme() - Fatal Error: Can't process the theme file: " << file; + QString msg = "ThemeManager::applyTheme() - Fatal Error: Can't process the theme file: " + file; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + ok = false; } @@ -86,8 +87,14 @@ ok = true; } else { #ifdef K_DEBUG - tError() << "ThemeManager::applyTheme() - Fatal Error: Can't process theme document"; + QString msg = "ThemeManager::applyTheme() - Fatal Error: Can't process theme document"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + ok = false; } @@ -185,10 +192,16 @@ bool ThemeManager::error(const QXmlParseException &exception) { #ifdef K_DEBUG - tError() << "ThemeManager::error() - Fatal Error: Can't process theme!"; - tError() << "ThemeManager::error() - Message: " << exception.message(); + QString msg = "ThemeManager::error() - Fatal Error: Can't process theme!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + qDebug() << "ThemeManager::error() - Message: " << exception.message(); + #else + tError() << msg; + tError() << "ThemeManager::error() - Message: " << exception.message(); + #endif #else - Q_UNUSED(exception); + Q_UNUSED(exception); #endif return false; @@ -197,9 +210,18 @@ bool ThemeManager::fatalError(const QXmlParseException &exception) { #ifdef K_DEBUG - tError() << "ThemeManager::error() - Fatal Error: Can't load theme..."; - tError() << "ThemeManager::error() - Line: " << exception.lineNumber() << " Column: " << exception.columnNumber(); - tError() << "ThemeManager::error() - Message: " << exception.message(); + QString msg1 = "ThemeManager::error() - Fatal Error: Can't load theme..."; + QString msg2 = "ThemeManager::error() - Line: " + QString::number(exception.lineNumber()) + " Column: " + QString::number(exception.columnNumber()); + QString msg3 = "ThemeManager::error() - Message: " + exception.message(); + #ifdef Q_OS_WIN32 + qDebug() << msg1; + qDebug() << msg2; + qDebug() << msg3; + #else + tError() << msg1; + tError() << msg2; + tError() << msg3; + #endif #else Q_UNUSED(exception); #endif diff -Nru tupi-0.2+git04/src/framework/tgui/thememanager.h tupi-0.2+git05/src/framework/tgui/thememanager.h --- tupi-0.2+git04/src/framework/tgui/thememanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/thememanager.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,11 +37,13 @@ #define THEMEMANAGER_H #include "tglobal.h" +#include "themedocument.h" #include #include +#include -class ThemeDocument; +// class ThemeDocument; /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/ticon.cpp tupi-0.2+git05/src/framework/tgui/ticon.cpp --- tupi-0.2+git04/src/framework/tgui/ticon.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/ticon.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "ticon.h" -#include "tdebug.h" - -#include -#include struct TIcon::Private { diff -Nru tupi-0.2+git04/src/framework/tgui/ticon.h tupi-0.2+git05/src/framework/tgui/ticon.h --- tupi-0.2+git04/src/framework/tgui/ticon.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/ticon.h 2014-12-15 14:21:33.000000000 +0000 @@ -41,6 +41,8 @@ #include #include #include +#include +#include class T_GUI_EXPORT TIcon : public QIcon { diff -Nru tupi-0.2+git04/src/framework/tgui/tideality.h tupi-0.2+git05/src/framework/tgui/tideality.h --- tupi-0.2+git04/src/framework/tgui/tideality.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tideality.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TIDEALITY_H -#define TIDEALTIY_H - -#include - -#if defined(QT_SHARED) || defined(QT_PLUGIN) -# define T_IDEAL_EXPORT Q_GUI_EXPORT -#else -# define T_IDEAL_EXPORT -#endif - -#endif // TIDEALITY_H diff -Nru tupi-0.2+git04/src/framework/tgui/timagebutton.cpp tupi-0.2+git05/src/framework/tgui/timagebutton.cpp --- tupi-0.2+git04/src/framework/tgui/timagebutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/timagebutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,15 +34,6 @@ ***************************************************************************/ #include "timagebutton.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include class TImageButton::Animation { @@ -109,12 +100,10 @@ // setIconSize(QSize(m_imageSize-10,m_imageSize-10)); if (m_isAnimated) { - m_animator->begin(); m_animator->aBeginning = true; if (m_animator->aSize >= m_imageSize + 10) m_animator->aSize = m_imageSize; - } else { setFlat(false); } @@ -123,12 +112,10 @@ void TImageButton::leaveEvent(QEvent *) { if (m_isAnimated && !isDown()) { - m_animator->aBeginning = false; m_animator->aSize = m_imageSize; m_animator->end(); setIconSize(QSize(m_imageSize,m_imageSize)); - } else { setFlat(true); } diff -Nru tupi-0.2+git04/src/framework/tgui/timagebutton.h tupi-0.2+git05/src/framework/tgui/timagebutton.h --- tupi-0.2+git04/src/framework/tgui/timagebutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/timagebutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -43,6 +43,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include /** * A image pressable diff -Nru tupi-0.2+git04/src/framework/tgui/tipdialog.cpp tupi-0.2+git05/src/framework/tgui/tipdialog.cpp --- tupi-0.2+git04/src/framework/tgui/tipdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tipdialog.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,20 +34,6 @@ ***************************************************************************/ #include "tipdialog.h" -#include "tseparator.h" -#include "tconfig.h" -#include "tdebug.h" -#include "tapplicationproperties.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include TipDialog::TipDialog(QStringList &labels, const QString &file, QWidget *parent) : QDialog(parent) { @@ -83,7 +69,12 @@ textBrowser->setOpenExternalLinks(true); QStringList path; - QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); +#ifdef Q_OS_WIN32 + QString resources = SHARE_DIR + "help" + QDir::separator(); +#else + QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); +#endif + path << resources + "css"; path << resources + "images"; textBrowser->setSearchPaths(path); diff -Nru tupi-0.2+git04/src/framework/tgui/tipdialog.h tupi-0.2+git05/src/framework/tgui/tipdialog.h --- tupi-0.2+git04/src/framework/tgui/tipdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tipdialog.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,15 +33,27 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef TUPIP_H -#define TUPIP_H +#ifndef TIPDIALOG_H +#define TIPDIALOG_H + +#include "tglobal.h" +#include "tipdatabase.h" +#include "tseparator.h" +#include "tconfig.h" +#include "tapplicationproperties.h" #include #include #include - -#include "tglobal.h" -#include "tipdatabase.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include class QCheckBox; class QTextBrowser; diff -Nru tupi-0.2+git04/src/framework/tgui/titemselector.cpp tupi-0.2+git05/src/framework/tgui/titemselector.cpp --- tupi-0.2+git04/src/framework/tgui/titemselector.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/titemselector.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,14 +33,8 @@ * along with this program. If not, see . * ***************************************************************************/ -#include "tglobal.h" #include "titemselector.h" -#include -#include -#include -#include - struct TItemSelector::Private { QListWidget *available; diff -Nru tupi-0.2+git04/src/framework/tgui/titemselector.h tupi-0.2+git05/src/framework/tgui/titemselector.h --- tupi-0.2+git04/src/framework/tgui/titemselector.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/titemselector.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,19 @@ #ifndef TITEMSELECTOR_H #define TITEMSELECTOR_H +#include "tglobal.h" #include "tapplicationproperties.h" + #include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TItemSelector : public QWidget +class T_GUI_EXPORT TItemSelector : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tmainwindowabstractsettings.h tupi-0.2+git05/src/framework/tgui/tmainwindowabstractsettings.h --- tupi-0.2+git04/src/framework/tgui/tmainwindowabstractsettings.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmainwindowabstractsettings.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,7 @@ #ifndef TMAINWINDOWABSTRACTSETTINGS_H #define TMAINWINDOWABSTRACTSETTINGS_H -#include "tideality.h" +#include "tglobal.h" #include class ToolView; @@ -46,7 +46,7 @@ * @author David Cuadrado */ -class T_IDEAL_EXPORT TMainWindowAbstractSettings : public QObject +class T_GUI_EXPORT TMainWindowAbstractSettings : public QObject { public: TMainWindowAbstractSettings(QObject *parent = 0) : QObject(parent) {} @@ -54,7 +54,6 @@ virtual void save(TMainWindow *w) = 0; virtual void restore(TMainWindow *w) = 0; - }; #endif diff -Nru tupi-0.2+git04/src/framework/tgui/tmainwindow.cpp tupi-0.2+git05/src/framework/tgui/tmainwindow.cpp --- tupi-0.2+git04/src/framework/tgui/tmainwindow.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmainwindow.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,25 +34,8 @@ ***************************************************************************/ #include "tmainwindow.h" -#include "tbuttonbar.h" -#include "toolview.h" -#include "tviewbutton.h" -#include "tmainwindowabstractsettings.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class DefaultSettings : public TMainWindowAbstractSettings +class T_GUI_EXPORT DefaultSettings : public TMainWindowAbstractSettings { public: DefaultSettings(QObject *parent); @@ -71,6 +54,15 @@ void DefaultSettings::save(TMainWindow *w) { + #ifdef K_DEBUG + QString msg = "DefaultSettings::save() - Saving UI settings..."; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + QSettings settings(qApp->applicationName(), "ideality", this); QHash buttonBars = w->buttonBars(); @@ -110,7 +102,12 @@ void DefaultSettings::restore(TMainWindow *w) { #ifdef K_DEBUG - tFatal() << "Restoring Interface..."; + QString msg = "DefaultSettings::restore() - Restoring UI settings..."; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif QSettings settings(qApp->applicationName(), "ideality", this); @@ -130,6 +127,7 @@ Qt::DockWidgetArea area = Qt::DockWidgetArea(settings.value("area", 0).toInt()); w->moveToolView(view, area); view->setFixedSize(settings.value("size").toInt()); + view->button()->setToolButtonStyle(Qt::ToolButtonStyle(settings.value("style", int(view->button()->toolButtonStyle())).toInt())); view->button()->setSensible(settings.value("sensibility", view->button()->isSensible()).toBool()); @@ -293,13 +291,7 @@ while (it != views.end()) { ToolView *v = *it; - - // SQA: Temporary code while Time Line components are fixed - if (v->getObjectID().compare("ToolView-Time Line")==0) - v->enableButton(false); - else - v->enableButton(flag); - + v->enableButton(flag); ++it; } } @@ -408,8 +400,17 @@ } break; default: - qWarning("toDockWidgetArea: Floating... %d", area); - break; + { + #ifdef K_DEBUG + QString msg = "TMainWindow::toDockWidgetArea() - Floating -> " + QString::number(area); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + } + break; } return Qt::LeftDockWidgetArea; @@ -439,8 +440,17 @@ } break; default: - qWarning("toToolBarArea: Floating... %d", area); - break; + { + #ifdef K_DEBUG + QString msg = "TMainWindow::toToolBarArea() - Floating -> " + QString::number(area); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif + } + break; } return Qt::LeftToolBarArea; @@ -551,16 +561,7 @@ view->setUpdatesEnabled(false); if (view->perspective() & workspace) { - - // SQA: Temporary code while Library and Time Line components are fixed - if (view->getObjectID().compare("ToolView-Time Line")==0) { - bar->enable(view->button()); - view->enableButton(false); - } else { - bar->enable(view->button()); - } - - // bar->enable(view->button()); + bar->enable(view->button()); if (view->button()->isChecked() && (workspace != 4) && view->getObjectID().compare("ToolView-Help")!=0) { view->show(); diff -Nru tupi-0.2+git04/src/framework/tgui/tmainwindowfactory.cpp tupi-0.2+git05/src/framework/tgui/tmainwindowfactory.cpp --- tupi-0.2+git04/src/framework/tgui/tmainwindowfactory.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmainwindowfactory.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -37,16 +37,8 @@ #include "tabbedmainwindow.h" #include "tstackedmainwindow.h" #include "tworkspacemainwindow.h" -#include "tdebug.h" -#include -#include -#include -#include -#include -#include - -class EventFilter : public QObject +class T_GUI_EXPORT EventFilter : public QObject { public: EventFilter(TMainWindow *mw, QObject *parent = 0); @@ -115,8 +107,14 @@ if (other->inherits("TMainWindow")) { #ifdef K_DEBUG - tError() << "TMainWindowFactory::create() - Fatal Error: Can't create a TMainWindow!"; + QString msg = "TMainWindowFactory::create() - Fatal Error: Can't create a TMainWindow!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return static_cast(other); } diff -Nru tupi-0.2+git04/src/framework/tgui/tmainwindowfactory.h tupi-0.2+git05/src/framework/tgui/tmainwindowfactory.h --- tupi-0.2+git04/src/framework/tgui/tmainwindowfactory.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmainwindowfactory.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,14 @@ #ifndef TMAINWINDOWFACTORY_H #define TMAINWINDOWFACTORY_H -#include "tideality.h" +#include "tglobal.h" + +#include +#include +#include +#include +#include +#include class TMainWindow; class QMainWindow; @@ -46,7 +53,7 @@ * @author David Cuadrado */ -class T_IDEAL_EXPORT TMainWindowFactory +class T_GUI_EXPORT TMainWindowFactory { public: TMainWindowFactory(); diff -Nru tupi-0.2+git04/src/framework/tgui/tmainwindow.h tupi-0.2+git05/src/framework/tgui/tmainwindow.h --- tupi-0.2+git04/src/framework/tgui/tmainwindow.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmainwindow.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,24 @@ #ifndef TMAINWINDOW_H #define TMAINWINDOW_H -#include "tideality.h" - -// Project begin: Aug 4 2006 +#include "tglobal.h" +#include "tbuttonbar.h" +#include "toolview.h" +#include "tviewbutton.h" +#include "tmainwindowabstractsettings.h" #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include class TButtonBar; class ToolView; @@ -54,9 +64,10 @@ * @author David Cuadrado */ -class T_IDEAL_EXPORT TMainWindow : public QMainWindow +class T_GUI_EXPORT TMainWindow : public QMainWindow { - Q_OBJECT; + Q_OBJECT + public: enum { diff -Nru tupi-0.2+git04/src/framework/tgui/tmoviegenerator.cpp tupi-0.2+git05/src/framework/tgui/tmoviegenerator.cpp --- tupi-0.2+git04/src/framework/tgui/tmoviegenerator.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmoviegenerator.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,8 @@ ***************************************************************************/ #include "tmoviegenerator.h" -#include "tdebug.h" -TMovieGenerator::TMovieGenerator(int width, int height) - : QImage(width, height, QImage::Format_RGB32) +TMovieGenerator::TMovieGenerator(int width, int height) : QImage(width, height, QImage::Format_RGB32) { reset(); } diff -Nru tupi-0.2+git04/src/framework/tgui/tmoviegenerator.h tupi-0.2+git05/src/framework/tgui/tmoviegenerator.h --- tupi-0.2+git04/src/framework/tgui/tmoviegenerator.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmoviegenerator.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,15 +36,14 @@ #ifndef TMOVIEGENERATOR_H #define TMOVIEGENERATOR_H -#include - +#include "tglobal.h" #include "tmoviegeneratorinterface.h" /** * @author David Cuadrado */ -class TMovieGenerator : public QImage, public TMovieGeneratorInterface +class T_GUI_EXPORT TMovieGenerator : public QImage, public TMovieGeneratorInterface { public: TMovieGenerator(int width, int height); diff -Nru tupi-0.2+git04/src/framework/tgui/tmoviegeneratorinterface.h tupi-0.2+git05/src/framework/tgui/tmoviegeneratorinterface.h --- tupi-0.2+git04/src/framework/tgui/tmoviegeneratorinterface.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tmoviegeneratorinterface.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,11 +36,13 @@ #ifndef TMOVIEGENERATORINTERFACE_H #define TMOVIEGENERATORINTERFACE_H +#include + /** * @author David Cuadrado */ -class TMovieGeneratorInterface +class T_GUI_EXPORT TMovieGeneratorInterface { public: enum Format diff -Nru tupi-0.2+git04/src/framework/tgui/tnodegroup.cpp tupi-0.2+git05/src/framework/tgui/tnodegroup.cpp --- tupi-0.2+git04/src/framework/tgui/tnodegroup.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tnodegroup.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tnodegroup.h" -#include "tdebug.h" - -#include -#include struct TNodeGroup::Private { @@ -54,7 +50,11 @@ TNodeGroup::TNodeGroup(QGraphicsItem *parent, QGraphicsScene *scene, GroupType type, int level): k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup()]"; + #else + TINIT; + #endif #endif k->parentItem = parent; @@ -74,25 +74,37 @@ TNodeGroup::~TNodeGroup() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TNodeGroup()]"; + #else + TEND; + #endif #endif - // clear(); delete k; } void TNodeGroup::clear() { - // SQA: Check if exists a better way to clean nodes - qDeleteAll(k->nodes); + // qDeleteAll(k->nodes); + + foreach (TControlNode *node, k->nodes) { + if (node) + k->scene->removeItem(node); + } + k->nodes.clear(); k->parentItem->update(); } void TNodeGroup::syncNodes(const QPainterPath &path) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup::syncNodes()]"; + #else + T_FUNCINFO; + #endif #endif if (k->nodes.isEmpty()) @@ -109,7 +121,11 @@ void TNodeGroup::syncNodesFromParent() { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup::syncNodesFromParent()]"; + #else + T_FUNCINFO; + #endif #endif if (k->parentItem) { @@ -121,7 +137,11 @@ void TNodeGroup::setParentItem(QGraphicsItem *newParent) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup::setParentItem()]"; + #else + T_FUNCINFO; + #endif #endif k->parentItem = newParent; @@ -133,9 +153,15 @@ void TNodeGroup::moveElementTo(int index, const QPointF& pos) { + /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup::moveElementTo()]"; + #else + T_FUNCINFO; + #endif #endif + */ QPainterPath path = qgraphicsitem_cast(k->parentItem)->path(); path.setElementPositionAt(index, pos.x(), pos.y()); @@ -202,7 +228,11 @@ void TNodeGroup::createNodes(QGraphicsPathItem *pathItem) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup::createNodes()]"; + #else + T_FUNCINFO; + #endif #endif if (pathItem) { @@ -267,7 +297,12 @@ } } else { #ifdef K_DEBUG - tError() << "TNodeGroup::createNodes() - Fatal Error: Item is NULL!"; + QString msg = "TNodeGroup::createNodes() - Fatal Error: Item is NULL!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -279,7 +314,11 @@ void TNodeGroup::emitNodeClicked(TControlNode::State state) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TNodeGroup::emitNodeClicked()]"; + #else + T_FUNCINFO; + #endif #endif /* SQA: Possible code for the future @@ -313,3 +352,11 @@ { return k->nodes.count(); } + +void TNodeGroup::resizeNodes(qreal scaleFactor) +{ + foreach (TControlNode *node, k->nodes) { + if (node) + node->resize(scaleFactor); + } +} diff -Nru tupi-0.2+git04/src/framework/tgui/tnodegroup.h tupi-0.2+git05/src/framework/tgui/tnodegroup.h --- tupi-0.2+git04/src/framework/tgui/tnodegroup.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tnodegroup.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,17 +36,20 @@ #ifndef NODEGROUP_H #define NODEGROUP_H +#include "tglobal.h" #include "tcontrolnode.h" #include #include #include +#include +#include /** * @author Jorge Cuadrado */ -class TNodeGroup : public QObject +class T_GUI_EXPORT TNodeGroup : public QObject { Q_OBJECT @@ -84,6 +87,7 @@ void expandAllNodes(); bool isSelected(); int size(); + void resizeNodes(qreal scaleFactor); private: struct Private; diff -Nru tupi-0.2+git04/src/framework/tgui/toolview.cpp tupi-0.2+git05/src/framework/tgui/toolview.cpp --- tupi-0.2+git04/src/framework/tgui/toolview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/toolview.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,16 +34,6 @@ ***************************************************************************/ #include "toolview.h" -#include "tviewbutton.h" -#include "tmainwindow.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include ToolView::ToolView(const QString &title, const QIcon &icon, const QString &code, QWidget * parent) : QDockWidget(title, parent), m_size(-1), m_perspective(0) diff -Nru tupi-0.2+git04/src/framework/tgui/toolview.h tupi-0.2+git05/src/framework/tgui/toolview.h --- tupi-0.2+git04/src/framework/tgui/toolview.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/toolview.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,19 +36,24 @@ #ifndef TOOLVIEW_H #define TOOLVIEW_H -#include "tideality.h" +#include "tglobal.h" +#include "tviewbutton.h" +#include "tmainwindow.h" #include #include #include - -class TViewButton; +#include +#include +#include +#include +#include /** * @author David Cuadrado */ -class T_IDEAL_EXPORT ToolView : public QDockWidget +class T_GUI_EXPORT ToolView : public QDockWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/toptionaldialog.cpp tupi-0.2+git05/src/framework/tgui/toptionaldialog.cpp --- tupi-0.2+git04/src/framework/tgui/toptionaldialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/toptionaldialog.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "toptionaldialog.h" -#include "tseparator.h" - -#include -#include TOptionalDialog::TOptionalDialog(const QString &text,const QString &title,QWidget *parent) : QDialog(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/toptionaldialog.h tupi-0.2+git05/src/framework/tgui/toptionaldialog.h --- tupi-0.2+git04/src/framework/tgui/toptionaldialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/toptionaldialog.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,11 +37,13 @@ #define TOPTIONALDIALOG_H #include "tglobal.h" +#include "tseparator.h" +#include +#include #include #include #include -#include /** * @if english diff -Nru tupi-0.2+git04/src/framework/tgui/tosd.cpp tupi-0.2+git05/src/framework/tgui/tosd.cpp --- tupi-0.2+git04/src/framework/tgui/tosd.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tosd.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tosd.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include TOsd *TOsd::s_osd = 0; diff -Nru tupi-0.2+git04/src/framework/tgui/tosd.h tupi-0.2+git05/src/framework/tgui/tosd.h --- tupi-0.2+git04/src/framework/tgui/tosd.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tosd.h 2014-12-15 14:21:33.000000000 +0000 @@ -44,6 +44,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/tpathhelper.cpp tupi-0.2+git05/src/framework/tgui/tpathhelper.cpp --- tupi-0.2+git04/src/framework/tgui/tpathhelper.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tpathhelper.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tpathhelper.h" -#include "tdebug.h" TPathHelper::TPathHelper() { @@ -138,7 +137,12 @@ Q_UNUSED(svgpath); #ifdef K_DEBUG - tWarning() << "TPathHelper::buildPath() - Warning: method pending for implementation"; + QString msg = "TPathHelper::buildPath() - Warning: method pending for implementation"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return QPainterPath(); diff -Nru tupi-0.2+git04/src/framework/tgui/tpushbutton.cpp tupi-0.2+git05/src/framework/tgui/tpushbutton.cpp --- tupi-0.2+git04/src/framework/tgui/tpushbutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tpushbutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,9 +35,6 @@ #include "tpushbutton.h" -#include -#include - TPushButton::TPushButton(QWidget *parent, const QString &name, int column, int row) : QPushButton(parent) { setText(name); diff -Nru tupi-0.2+git04/src/framework/tgui/tpushbutton.h tupi-0.2+git05/src/framework/tgui/tpushbutton.h --- tupi-0.2+git04/src/framework/tgui/tpushbutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tpushbutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,7 +37,10 @@ #define TPUSHBUTTON_H #include "tglobal.h" + #include +#include +#include /** * @author Gustav Gonzalez diff -Nru tupi-0.2+git04/src/framework/tgui/tradiobuttongroup.cpp tupi-0.2+git05/src/framework/tgui/tradiobuttongroup.cpp --- tupi-0.2+git04/src/framework/tgui/tradiobuttongroup.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tradiobuttongroup.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tradiobuttongroup.h" -#include "tdebug.h" - -#include -#include TRadioButtonGroup::TRadioButtonGroup(const QString &title, Qt::Orientation orientation, QWidget *parent) : QGroupBox(title, parent), m_orientation(orientation) { diff -Nru tupi-0.2+git04/src/framework/tgui/tradiobuttongroup.h tupi-0.2+git05/src/framework/tgui/tradiobuttongroup.h --- tupi-0.2+git04/src/framework/tgui/tradiobuttongroup.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tradiobuttongroup.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,8 +40,8 @@ #include #include -#include #include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/treelistwidget.cpp tupi-0.2+git05/src/framework/tgui/treelistwidget.cpp --- tupi-0.2+git04/src/framework/tgui/treelistwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/treelistwidget.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "treelistwidget.h" -#include "tdebug.h" - -#include -#include -#include -#include class TreeListWidgetDelegate : public QItemDelegate { @@ -120,16 +114,17 @@ void TreeListWidget::closeEditor(QWidget * editor, QAbstractItemDelegate::EndEditHint hint) { #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupCommandExecutor::removeItem()]"; + #else T_FUNCINFO; + #endif #endif QLineEdit *edit = qobject_cast(editor); - if (edit) { - QTreeWidgetItem *item = currentItem(); - if (item) - emit itemRenamed(item); - } + if (edit) + emit editorClosed(); QTreeWidget::closeEditor(editor, hint); } diff -Nru tupi-0.2+git04/src/framework/tgui/treelistwidget.h tupi-0.2+git05/src/framework/tgui/treelistwidget.h --- tupi-0.2+git04/src/framework/tgui/treelistwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/treelistwidget.h 2014-12-15 14:21:33.000000000 +0000 @@ -39,6 +39,10 @@ #include "tglobal.h" #include +#include +#include +#include +#include /** * @author David Cuadrado @@ -67,7 +71,8 @@ virtual void closeEditor(QWidget * editor, QAbstractItemDelegate::EndEditHint hint); signals: - void itemRenamed(QTreeWidgetItem *item); + // void itemRenamed(QTreeWidgetItem *item); + void editorClosed(); private: bool m_isEditable; diff -Nru tupi-0.2+git04/src/framework/tgui/treewidgetsearchline.cpp tupi-0.2+git05/src/framework/tgui/treewidgetsearchline.cpp --- tupi-0.2+git04/src/framework/tgui/treewidgetsearchline.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/treewidgetsearchline.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,17 +35,6 @@ #include "treewidgetsearchline.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - class TreeWidgetSearchLine::TreeWidgetSearchLinePrivate { public: diff -Nru tupi-0.2+git04/src/framework/tgui/treewidgetsearchline.h tupi-0.2+git05/src/framework/tgui/treewidgetsearchline.h --- tupi-0.2+git04/src/framework/tgui/treewidgetsearchline.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/treewidgetsearchline.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,10 +40,17 @@ #include "tglobal.h" #include - -class QTreeWidget; -class QTreeWidgetItem; -class QToolButton; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /** * This class provides a search line for filtering the items in diff -Nru tupi-0.2+git04/src/framework/tgui/trulerbase.cpp tupi-0.2+git05/src/framework/tgui/trulerbase.cpp --- tupi-0.2+git04/src/framework/tgui/trulerbase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/trulerbase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,13 +34,6 @@ ***************************************************************************/ #include "trulerbase.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include struct TRulerBase::Private { @@ -119,7 +112,7 @@ delete k; } -void TRulerBase::paintEvent ( QPaintEvent * ) +void TRulerBase::paintEvent(QPaintEvent *) { QPainter p(this); @@ -207,15 +200,15 @@ update(); } -void TRulerBase::mouseMoveEvent(QMouseEvent * e) +void TRulerBase::mouseMoveEvent(QMouseEvent *event) { if (k->drawPointer) - movePointers(e->pos()); + movePointers(event->pos()); } -void TRulerBase::setDrawPointer(bool yes) +void TRulerBase::setDrawPointer(bool flag) { - k->drawPointer = yes; + k->drawPointer = flag; update(); } @@ -225,14 +218,21 @@ k->separation = sep; update(); } else { - tError() << "I can't assign separation : " << sep << endl; + #ifdef K_DEBUG + QString msg = "TRulerBase::setSeparation() - Error: Can't assign separation : " + QString::number(sep); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } -void TRulerBase::mousePressEvent(QMouseEvent *e) +void TRulerBase::mousePressEvent(QMouseEvent *event) { - if (e->button() == Qt::RightButton) - emit displayMenu(this, e->globalPos()); + if (event->button() == Qt::RightButton) + emit displayMenu(this, event->globalPos()); } Qt::Orientation TRulerBase::orientation() diff -Nru tupi-0.2+git04/src/framework/tgui/trulerbase.h tupi-0.2+git05/src/framework/tgui/trulerbase.h --- tupi-0.2+git04/src/framework/tgui/trulerbase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/trulerbase.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,8 +33,8 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef RULER_H -#define RULER_H +#ifndef RULERBASE_H +#define RULERBASE_H #include "tglobal.h" @@ -44,6 +44,7 @@ #include #include #include +#include #define UNITCOUNT 5 diff -Nru tupi-0.2+git04/src/framework/tgui/tseparator.cpp tupi-0.2+git05/src/framework/tgui/tseparator.cpp --- tupi-0.2+git04/src/framework/tgui/tseparator.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tseparator.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,8 +34,6 @@ ***************************************************************************/ #include "tseparator.h" -#include -#include TSeparator::TSeparator(QWidget* parent) : QFrame(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/tseparator.h tupi-0.2+git05/src/framework/tgui/tseparator.h --- tupi-0.2+git04/src/framework/tgui/tseparator.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tseparator.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,9 +36,12 @@ #ifndef TSEPARATOR_H #define TSEPARATOR_H -#include #include "tglobal.h" +#include +#include +#include + /** * Standard horizontal or vertical separator. * diff -Nru tupi-0.2+git04/src/framework/tgui/tstackedmainwindow.cpp tupi-0.2+git05/src/framework/tgui/tstackedmainwindow.cpp --- tupi-0.2+git04/src/framework/tgui/tstackedmainwindow.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tstackedmainwindow.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,8 +35,6 @@ #include "tstackedmainwindow.h" -#include - TStackedMainWindow::TStackedMainWindow(QWidget *parent) : TMainWindow(parent) { m_stack = new QStackedWidget; diff -Nru tupi-0.2+git04/src/framework/tgui/tstackedmainwindow.h tupi-0.2+git05/src/framework/tgui/tstackedmainwindow.h --- tupi-0.2+git04/src/framework/tgui/tstackedmainwindow.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tstackedmainwindow.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,17 +36,17 @@ #ifndef TSTACKEDMAINWINDOW_H #define TSTACKEDMAINWINDOW_H +#include "tglobal.h" #include "tmainwindow.h" +#include #include -class QStackedWidget; - /** * @author David Cuadrado */ -class T_IDEAL_EXPORT TStackedMainWindow : public TMainWindow +class T_GUI_EXPORT TStackedMainWindow : public TMainWindow { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tstylecombobox.cpp tupi-0.2+git05/src/framework/tgui/tstylecombobox.cpp --- tupi-0.2+git04/src/framework/tgui/tstylecombobox.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tstylecombobox.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tstylecombobox.h" -#include "tdebug.h" - -#include -#include TStyleComboBox::TStyleComboBox(QWidget *parent) : QComboBox(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/tstylecombobox.h tupi-0.2+git05/src/framework/tgui/tstylecombobox.h --- tupi-0.2+git04/src/framework/tgui/tstylecombobox.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tstylecombobox.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,7 +37,10 @@ #define TSTYLECOMBOBOX_H #include "tglobal.h" + #include +#include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/ttabwidget.cpp tupi-0.2+git05/src/framework/tgui/ttabwidget.cpp --- tupi-0.2+git04/src/framework/tgui/ttabwidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/ttabwidget.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "ttabwidget.h" -#include "tdebug.h" - -#include -#include TTabWidget::TTabWidget(QWidget *parent) : QTabWidget(parent) { diff -Nru tupi-0.2+git04/src/framework/tgui/ttabwidget.h tupi-0.2+git05/src/framework/tgui/ttabwidget.h --- tupi-0.2+git04/src/framework/tgui/ttabwidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/ttabwidget.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,9 +36,12 @@ #ifndef TTABWIDGET_H #define TTABWIDGET_H -#include #include "tglobal.h" +#include +#include +#include + /** * @author David Cuadrado */ diff -Nru tupi-0.2+git04/src/framework/tgui/ttoolbox.cpp tupi-0.2+git05/src/framework/tgui/ttoolbox.cpp --- tupi-0.2+git04/src/framework/tgui/ttoolbox.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/ttoolbox.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,9 +35,6 @@ #include "ttoolbox.h" -#include -#include - TToolBox::TToolBox(QWidget *parent) : QToolBox(parent), m_lastIndex(0) { setFrameStyle(QFrame::StyledPanel); diff -Nru tupi-0.2+git04/src/framework/tgui/ttoolbox.h tupi-0.2+git05/src/framework/tgui/ttoolbox.h --- tupi-0.2+git04/src/framework/tgui/ttoolbox.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/ttoolbox.h 2014-12-15 14:21:33.000000000 +0000 @@ -37,7 +37,10 @@ #define TTOOLBOX_H #include "tglobal.h" + #include +#include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/tvhbox.cpp tupi-0.2+git05/src/framework/tgui/tvhbox.cpp --- tupi-0.2+git04/src/framework/tgui/tvhbox.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tvhbox.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tvhbox.h" -#include "tdebug.h" - -#include -#include -#include -#include TVHBox::TVHBox(QWidget *parent, Qt::Orientation o) : QFrame(parent) { @@ -78,16 +72,20 @@ void TVHBox::moveWidgetUp(QWidget *widget) { - // dDebug() << "Childs " << children ().count() << endl; int position = m_pLayout->indexOf(widget); - // dDebug() << "Position: " << position << endl; - if (position > 0) { m_pLayout->removeWidget(widget); m_pLayout->insertWidget(position-1, widget); } else { - tError() << "The widget isn't in the layout" << endl; + #ifdef K_DEBUG + QString msg = "TVHBox::moveWidgetUp() - Error: The widget isn't in the layout"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } } @@ -160,9 +158,8 @@ void TVHBox::mouseMoveEvent(QMouseEvent *e) { - if (hasMouseTracking()) { + if (hasMouseTracking()) emit mouseAt(e->pos()); - } } QBoxLayout *TVHBox::boxLayout() diff -Nru tupi-0.2+git04/src/framework/tgui/tvhbox.h tupi-0.2+git05/src/framework/tgui/tvhbox.h --- tupi-0.2+git04/src/framework/tgui/tvhbox.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tvhbox.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,6 @@ #ifndef TVHBOX_H #define TVHBOX_H -class TVHBox; - #include "tglobal.h" #include @@ -45,6 +43,8 @@ #include #include #include +#include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tgui/tviewbutton.cpp tupi-0.2+git05/src/framework/tgui/tviewbutton.cpp --- tupi-0.2+git04/src/framework/tgui/tviewbutton.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tviewbutton.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,16 +35,6 @@ #include "tviewbutton.h" #include "toolview.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include class TViewButton::Animator { diff -Nru tupi-0.2+git04/src/framework/tgui/tviewbutton.h tupi-0.2+git05/src/framework/tgui/tviewbutton.h --- tupi-0.2+git04/src/framework/tgui/tviewbutton.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tviewbutton.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,10 +36,17 @@ #ifndef TVIEWBUTTON_H #define TVIEWBUTTON_H -#include "tideality.h" +#include "tglobal.h" #include #include +#include +#include +#include +#include +#include +#include +#include class ToolView; @@ -47,7 +54,7 @@ * @author David Cuadrado */ -class T_IDEAL_EXPORT TViewButton : public QToolButton +class T_GUI_EXPORT TViewButton : public QToolButton { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/twaitstyle.cpp tupi-0.2+git05/src/framework/tgui/twaitstyle.cpp --- tupi-0.2+git04/src/framework/tgui/twaitstyle.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/twaitstyle.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,571 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#include "twaitstyle.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QPixmap cached(const QString &img, const QColor &color) -{ - Q_UNUSED(color); - - if (QPixmap *p = QPixmapCache::find(img)) - return *p; - - QPixmap pm; - QImage original(img); - - // SQA: Replace the method fade with a native Qt function - // pm = QPixmap::fromImage(TImageEffect::fade(original, 0.7, color), Qt::OrderedDither | Qt::OrderedAlphaDither); - - pm = QPixmap::fromImage(original, Qt::OrderedDither | Qt::OrderedAlphaDither); - if (pm.isNull()) - return QPixmap(); - - QPixmapCache::insert(img, pm); - return pm; -} - -TWaitStyle::TWaitStyle() - : QPlastiqueStyle() -{ - Q_INIT_RESOURCE(tgui_images); -} - -void TWaitStyle::drawHoverRect(QPainter *painter, const QRect &r, const QBrush &brush) const -{ - double h = r.height(); - double h2 = r.height() / 2.0; - QPainterPath path; - path.addRect(r.x() + h2, r.y() + 0, r.width() - h2 * 2, r.height()); - path.addEllipse(r.x(), r.y(), h, h); - path.addEllipse(r.x() + r.width() - h, r.y(), h, h); - path.setFillRule(Qt::WindingFill); - painter->setPen(Qt::NoPen); - painter->setBrush(brush); - painter->setRenderHint(QPainter::Antialiasing); - painter->drawPath(path); -} - -void TWaitStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option,QPainter *painter, const QWidget *widget) const -{ - Q_ASSERT(option); - - switch (element) { - case PE_FrameFocusRect: break; - case PE_IndicatorRadioButton: - { - if (const QStyleOptionButton *button = qstyleoption_cast(option)) { - bool hover = (button->state & State_Enabled) && (button->state & State_MouseOver); - painter->save(); - QPixmap radio; - if (hover) - drawHoverRect(painter, widget->rect(), option->palette.background() ); - - if (button->state & State_Sunken) - radio = cached(":dwaitstyle/images/radiobutton-on.png", option->palette.color(QPalette::Background) ); - else if (button->state & State_On) - radio = cached(":dwaitstyle/images/radiobutton_on.png", option->palette.color(QPalette::Background)); - else - radio = cached(":dwaitstyle/images/radiobutton_off.png", option->palette.color(QPalette::Background)); - painter->drawPixmap(button->rect.topLeft(), radio); - - painter->restore(); - } - else - { - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - } - break; - } - case PE_PanelButtonCommand: - { - const QStyleOptionButton *button = qstyleoption_cast(option); - if (button) { - bool hover = (button->state & State_Enabled) && (button->state & State_MouseOver); - - const QPushButton *pushButton = qobject_cast(widget); - - if (! pushButton ) { - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - break; - } - - painter->save(); - QWidget *parent = pushButton->parentWidget(); - - if (parent && qobject_cast(parent)) { - QLinearGradient lg(0, 0, 0, parent->height()); - lg.setColorAt(0, QColor(224,224,224)); - lg.setColorAt(1, QColor(255,255,255)); - painter->setPen(Qt::NoPen); - painter->setBrush(lg); - painter->setBrushOrigin(-widget->mapToParent(QPoint(0,0))); - painter->drawRect(button->rect); - painter->setBrushOrigin(0,0); - } - - bool down = pushButton && ((button->state & State_Sunken) || (button->state & State_On)); - - bool goodSize = pushButton && pushButton->height() > 22; - - QPixmap left, right, mid; - - if (down && goodSize) { - left = cached(":dwaitstyle/images/button_pressed_cap_left.png", - option->palette.color(QPalette::Background)); - - right = cached(":dwaitstyle/images/button_pressed_cap_right.png", - option->palette.color(QPalette::Background)); - - mid = cached(":dwaitstyle/images/button_pressed_stretch.png", - option->palette.color(QPalette::Background)); - } else if (goodSize) { - left = cached(":dwaitstyle/images/button_normal_cap_left.png", - option->palette.color(QPalette::Background)); - right = cached(":dwaitstyle/images/button_normal_cap_right.png", - option->palette.color(QPalette::Background)); - mid = cached(":dwaitstyle/images/button_normal_stretch.png", - option->palette.color(QPalette::Background)); - } - - if (goodSize) { - painter->drawPixmap(button->rect.topLeft(), left); - painter->drawTiledPixmap(QRect(button->rect.x() + left.width(),button->rect.y(), - button->rect.width() - left.width() - right.width(), - left.height()), mid); - painter->drawPixmap(button->rect.x() + button->rect.width() - right.width(), - button->rect.y(), right); - } - - if (hover) - painter->fillRect(widget->rect().adjusted(3,5,-3,-5), QColor(41,57,127,63)); - - painter->restore(); - - if (!goodSize) - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - - } else { - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - } - break; - } - case PE_Frame: - { - - } - break; - case PE_FrameGroupBox: - { - const QStyleOptionFrameV2 *group = qstyleoption_cast(option); - - if (group) { - const QRect &r = group->rect; - - if (r.height() < 14) { // FIXME FIXME FIXME - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - return; - } - - painter->save(); - int radius = 14; - int radius2 = radius*2; - QPainterPath clipPath; - clipPath.moveTo(radius, 0); - clipPath.arcTo(r.right() - radius2, 0, radius2, radius2, 90, -90); - clipPath.arcTo(r.right() - radius2, r.bottom() - radius2, radius2, radius2, 0, -90); - clipPath.arcTo(r.left(), r.bottom() - radius2, radius2, radius2, 270, -90); - clipPath.arcTo(r.left(), r.top(), radius2, radius2, 180, -90); - painter->setClipPath(clipPath); - QPixmap titleStretch = cached(":dwaitstyle/images/title_stretch.png", - option->palette.color(QPalette::Background)); - QPixmap topLeft = cached(":dwaitstyle/images/groupframe_topleft.png", - option->palette.color(QPalette::Background)); - QPixmap topRight = cached(":dwaitstyle/images/groupframe_topright.png", - option->palette.color(QPalette::Background)); - QPixmap bottomLeft = cached(":dwaitstyle/images/groupframe_bottom_left.png", - option->palette.color(QPalette::Background)); - QPixmap bottomRight = cached(":dwaitstyle/images/groupframe_bottom_right.png", - option->palette.color(QPalette::Background)); - QPixmap leftStretch = cached(":dwaitstyle/images/groupframe_left_stretch.png", - option->palette.color(QPalette::Background)); - QPixmap topStretch = cached(":dwaitstyle/images/groupframe_top_stretch.png", - option->palette.color(QPalette::Background)); - QPixmap rightStretch = cached(":dwaitstyle/images/groupframe_right_stretch.png", - option->palette.color(QPalette::Background)); - QPixmap bottomStretch = cached(":dwaitstyle/images/groupframe_bottom_stretch.png", - option->palette.color(QPalette::Background)); - - QLinearGradient lg(0, 0, 0, r.height()); - - lg.setColorAt(0, widget->palette().color(QPalette::Background)); - lg.setColorAt(1, widget->palette().color(QPalette::Light)); - - painter->setPen(Qt::NoPen); - painter->setBrush(lg); - painter->drawRect(r.adjusted(0, titleStretch.height()/2, 0, 0)); - painter->setClipping(false); - - int topFrameOffset = titleStretch.height()/2 - 2; - painter->drawPixmap(r.topLeft() + QPoint(0, topFrameOffset), topLeft); - painter->drawPixmap(r.topRight() - QPoint(topRight.width()-1, 0) - + QPoint(0, topFrameOffset), topRight); - painter->drawPixmap(r.bottomLeft() - QPoint(0, bottomLeft.height()-1), bottomLeft); - painter->drawPixmap(r.bottomRight() - QPoint(bottomRight.width()-1, - bottomRight.height()-1), bottomRight); - - QRect left = r; - left.setY(r.y() + topLeft.height() + topFrameOffset); - left.setWidth(leftStretch.width()); - left.setHeight(r.height() - topLeft.height() - bottomLeft.height() - topFrameOffset); - painter->drawTiledPixmap(left, leftStretch); - - QRect top = r; - top.setX(r.x() + topLeft.width()); - top.setY(r.y() + topFrameOffset); - top.setWidth(r.width() - topLeft.width() - topRight.width()); - top.setHeight(topLeft.height()); - painter->drawTiledPixmap(top, topStretch); - - QRect right = r; - right.setX(r.right() - rightStretch.width()+1); - right.setY(r.y() + topRight.height() + topFrameOffset); - right.setWidth(rightStretch.width()); - right.setHeight(r.height() - topRight.height() - bottomRight.height() - topFrameOffset); - painter->drawTiledPixmap(right, rightStretch); - - QRect bottom = r; - bottom.setX(r.x() + bottomLeft.width()); - bottom.setY(r.bottom() - bottomStretch.height()+1); - bottom.setWidth(r.width() - bottomLeft.width() - bottomRight.width()); - bottom.setHeight(bottomLeft.height()); - painter->drawTiledPixmap(bottom, bottomStretch); - painter->restore(); - } - else - { - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - } - break; - } - default: - QPlastiqueStyle::drawPrimitive(element, option, painter, widget); - break; - } - - - return; -} - -void TWaitStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const -{ - switch (element) { - default: - { - QPlastiqueStyle::drawControl(element, option, painter, widget); - } - break; - } -} - -void TWaitStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const -{ - switch (control) { - case CC_Slider: - { - if (const QStyleOptionSlider *slider = qstyleoption_cast(option)) { - QRect groove = subControlRect(CC_Slider, option, SC_SliderGroove, widget); - QRect handle = subControlRect(CC_Slider, option, SC_SliderHandle, widget); - - painter->save(); - - bool hover = (slider->state & State_Enabled) && (slider->state & State_MouseOver); - if (hover) { - QRect moderated = widget->rect().adjusted(0, 4, 0, -4); - drawHoverRect(painter, moderated, option->palette.background()); - } - - if ((option->subControls & SC_SliderGroove) && groove.isValid()) { - QPixmap grv = cached(":dwaitstyle/images/slider_bar.png", - option->palette.color(QPalette::Background)); - painter->drawPixmap(QRect(groove.x() + 5, groove.y(), - groove.width() - 10, grv.height()), grv); - } - - if ((option->subControls & SC_SliderHandle) && handle.isValid()) { - QPixmap hndl = cached(":dwaitstyle/images/slider_thumb_on.png", - option->palette.color(QPalette::Background)); - painter->drawPixmap(handle.topLeft(), hndl); - } - - painter->restore(); - - } else { - QPlastiqueStyle::drawComplexControl(control, option, painter, widget); - } - - break; - } - case CC_GroupBox: - { - const QStyleOptionGroupBox *groupBox = qstyleoption_cast(option); - if (groupBox) { - QStyleOptionGroupBox groupBoxCopy(*groupBox); - groupBoxCopy.subControls &= ~SC_GroupBoxLabel; - QPlastiqueStyle::drawComplexControl(control, &groupBoxCopy, painter, widget); - - if (groupBox->subControls & SC_GroupBoxLabel) { - const QRect &r = groupBox->rect; - QPixmap titleLeft = cached(":dwaitstyle/images/title_cap_left.png", - option->palette.color(QPalette::Background)); - QPixmap titleRight = cached(":dwaitstyle/images/title_cap_right.png", - option->palette.color(QPalette::Background)); - QPixmap titleStretch = cached(":dwaitstyle/images/title_stretch.png", - option->palette.color(QPalette::Background)); - int txt_width = groupBox->fontMetrics.width(groupBox->text) + 20; - painter->drawPixmap(r.center().x() - txt_width/2, 0, titleLeft); - QRect tileRect = subControlRect(control, groupBox, SC_GroupBoxLabel, widget); - painter->drawTiledPixmap(tileRect, titleStretch); - painter->drawPixmap(tileRect.x() + tileRect.width(), 0, titleRight); - int opacity = 31; - painter->setPen(QColor(0, 0, 0, opacity)); - painter->drawText(tileRect.translated(0, 1), - Qt::AlignVCenter | Qt::AlignHCenter, groupBox->text); - painter->drawText(tileRect.translated(2, 1), - Qt::AlignVCenter | Qt::AlignHCenter, groupBox->text); - painter->setPen(QColor(0, 0, 0, opacity * 2)); - painter->drawText(tileRect.translated(1, 1), - Qt::AlignVCenter | Qt::AlignHCenter, groupBox->text); - painter->setPen(Qt::white); - painter->drawText(tileRect, Qt::AlignVCenter | Qt::AlignHCenter, groupBox->text); - } - } else { - QPlastiqueStyle::drawComplexControl(control, option, painter, widget); - } - break; - } - default: - QPlastiqueStyle::drawComplexControl(control, option, painter, widget); - break; - } - return; -} - -QRect TWaitStyle::subControlRect(ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const -{ - QRect rect; - - switch (control) { - default: - { - rect = QPlastiqueStyle::subControlRect(control, option, subControl, widget); - break; - } -#if QT_VERSION >= 0x040100 - case CC_GroupBox: - { - if (const QStyleOptionGroupBox *group = qstyleoption_cast(option)) { - switch (subControl) { - default: - rect = QPlastiqueStyle::subControlRect(control, option, subControl, widget); - break; -#if QT_VERSION >= 0x040100 - case SC_GroupBoxContents: - rect = QPlastiqueStyle::subControlRect(control, option, subControl, widget); - if (group->text.length() < 4) { - rect.adjust(0, 4, 0, 0); - } else { - rect.adjust(0, -10, 0, 0); - } - break; -#endif - case SC_GroupBoxFrame: - rect = group->rect; - break; - case SC_GroupBoxLabel: - QPixmap titleLeft = cached(":dwaitstyle/images/title_cap_left.png", - option->palette.color(QPalette::Background)); - QPixmap titleRight = cached(":dwaitstyle/images/title_cap_right.png", - option->palette.color(QPalette::Background)); - QPixmap titleStretch = cached(":dwaitstyle/images/title_stretch.png", - option->palette.color(QPalette::Background)); - int txt_width = group->fontMetrics.width(group->text) + 20; - rect = QRect(group->rect.center().x() - txt_width/2 + titleLeft.width(), 0, - txt_width - titleLeft.width() - titleRight.width(), - titleStretch.height()); - break; - } - } - break; - } -#endif - } - - if (control == CC_Slider && subControl == SC_SliderHandle) { - rect.setWidth(13); - rect.setHeight(27); - } else if (control == CC_Slider && subControl == SC_SliderGroove) { - rect.setHeight(9); - rect.moveTop(27/2 - 9/2); - } - - return rect; -} - -QSize TWaitStyle::sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const -{ - QSize newSize = QPlastiqueStyle::sizeFromContents(type, option, size, widget); - - switch (type) { - - /* - case CT_PushButton: - newSize.boundedTo (QSize(27, 20)); - break; - */ - - case CT_Slider: - newSize.setHeight(20); - break; - - default: - break; - } - - return newSize; -} - -int TWaitStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QWidget *widget) const -{ - if (pm == PM_SliderLength) - return 13; - - switch (pm) { - case QStyle::PM_DockWidgetSeparatorExtent: - { - return 1; - } - break; - - /* - case QStyle::PM_DockWidgetHandleExtent: - { - return 0; - } - break; - case QStyle::PM_DockWidgetFrameWidth: - { - return 0; - } - break; - case QStyle::PM_DockWidgetTitleMargin: - { - return 0; - } - break; - */ - - default: - break; - } - - return QPlastiqueStyle::pixelMetric(pm, opt, widget); -} - -void TWaitStyle::polish(QWidget *widget) -{ - QPlastiqueStyle::polish(widget); - - if (widget->layout() && qobject_cast(widget)) { - if (qFindChildren(widget).size() == 0) { - widget->layout()->setSpacing(0); - } else { - widget->layout()->setMargin(10); - // widget->layout()->setSpacing(0); - } - } - - if (qobject_cast(widget) - || qobject_cast(widget) - || qobject_cast(widget)) { - widget->setAttribute(Qt::WA_Hover); - } -} - -void TWaitStyle::unpolish(QWidget *widget) -{ - if (qobject_cast(widget) - || qobject_cast(widget) - || qobject_cast(widget)) { - widget->setAttribute(Qt::WA_Hover, false); - } -} - -void TWaitStyle::polish(QPalette &palette) -{ - Q_UNUSED(palette); - // palette.setColor(QPalette::Background, QColor(241, 241, 241)); -} - -QRect TWaitStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const -{ - QRect r; - switch (element) { - case SE_RadioButtonClickRect: - r = widget->rect(); - break; - case SE_RadioButtonContents: - r = widget->rect().adjusted(20, 0, 0, 0); - break; - default: - r = QPlastiqueStyle::subElementRect(element, option, widget); - break; - } - - if (qobject_cast(widget)) - r = r.adjusted(5, 0, -5, 0); - - return r; -} diff -Nru tupi-0.2+git04/src/framework/tgui/twaitstyle.h tupi-0.2+git05/src/framework/tgui/twaitstyle.h --- tupi-0.2+git04/src/framework/tgui/twaitstyle.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/twaitstyle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPISTYLE_H -#define TUPISTYLE_H - -#include "tglobal.h" - -#include - -/** - * @if english - * Tupi style - * @elseif spanish - * Estilo Tupi - * @endif - */ - -class T_GUI_EXPORT TWaitStyle : public QPlastiqueStyle -{ - public: - TWaitStyle(); - - void drawHoverRect(QPainter *painter, const QRect &rect, const QBrush &brush) const; - - void drawPrimitive(PrimitiveElement element, const QStyleOption *option, - QPainter *painter, const QWidget *widget = 0) const; - void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const; - void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, - QPainter *painter, const QWidget *widget) const; - QSize sizeFromContents(ContentsType type, const QStyleOption *option, - const QSize &size, const QWidget *widget) const; - - QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const; - QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, - SubControl sc, const QWidget *widget) const; - - int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const; - - void polish(QPalette &palette); - void polish(QWidget *widget); - void unpolish(QWidget *widget); -}; - -#endif diff -Nru tupi-0.2+git04/src/framework/tgui/twidgetlistview.cpp tupi-0.2+git05/src/framework/tgui/twidgetlistview.cpp --- tupi-0.2+git04/src/framework/tgui/twidgetlistview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/twidgetlistview.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,16 +34,13 @@ ***************************************************************************/ #include "twidgetlistview.h" -#include "tdebug.h" - -#include -#include TWidgetListView::TWidgetListView(QWidget * parent) : QTableWidget(0,1,parent) { verticalHeader()->hide(); horizontalHeader()->hide(); - horizontalHeader()->setResizeMode(QHeaderView::Custom); + // horizontalHeader()->setResizeMode(QHeaderView::Custom); + horizontalHeader()->setSectionResizeMode(QHeaderView::Custom); } TWidgetListView::~TWidgetListView() diff -Nru tupi-0.2+git04/src/framework/tgui/twidgetlistview.h tupi-0.2+git05/src/framework/tgui/twidgetlistview.h --- tupi-0.2+git04/src/framework/tgui/twidgetlistview.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/twidgetlistview.h 2014-12-15 14:21:33.000000000 +0000 @@ -40,6 +40,8 @@ #include #include +#include +#include /** * @if spanish diff -Nru tupi-0.2+git04/src/framework/tgui/twizard.cpp tupi-0.2+git05/src/framework/tgui/twizard.cpp --- tupi-0.2+git04/src/framework/tgui/twizard.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/twizard.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,14 +35,6 @@ #include "twizard.h" -#include "tvhbox.h" -#include "tseparator.h" -#include "tdebug.h" - -// Qt -#include -#include - TWizard::TWizard(QWidget *parent) : QDialog(parent) { m_cancelButton = new QPushButton(tr("Cancel")); diff -Nru tupi-0.2+git04/src/framework/tgui/twizard.h tupi-0.2+git05/src/framework/tgui/twizard.h --- tupi-0.2+git04/src/framework/tgui/twizard.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/twizard.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,17 +33,20 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef KWIZARD_H -#define KWIZARD_H +#ifndef TWIZARD_H +#define TWIZARD_H + +#include "tglobal.h" +#include "tvhbox.h" +#include "tseparator.h" #include #include #include #include #include - -#include "tvhbox.h" -#include "tglobal.h" +#include +#include class TWizardPage; @@ -82,7 +85,7 @@ #include #include -class TWizardPage : public TVHBox +class T_GUI_EXPORT TWizardPage : public TVHBox { Q_OBJECT diff -Nru tupi-0.2+git04/src/framework/tgui/tworkspacemainwindow.cpp tupi-0.2+git05/src/framework/tgui/tworkspacemainwindow.cpp --- tupi-0.2+git04/src/framework/tgui/tworkspacemainwindow.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tworkspacemainwindow.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,12 +34,11 @@ ***************************************************************************/ #include "tworkspacemainwindow.h" -#include TWorkspaceMainWindow::TWorkspaceMainWindow(QWidget *parent) : TMainWindow(parent) { - m_workspace = new QWorkspace; - setCentralWidget(m_workspace); + mdiArea = new QMdiArea; + setCentralWidget(mdiArea); } TWorkspaceMainWindow::~TWorkspaceMainWindow() @@ -49,7 +48,7 @@ void TWorkspaceMainWindow::addWidget(QWidget *widget, int perspective) { addToPerspective(widget, perspective); - m_workspace->addWindow(widget); + mdiArea->addSubWindow(widget); widget->show(); } diff -Nru tupi-0.2+git04/src/framework/tgui/tworkspacemainwindow.h tupi-0.2+git05/src/framework/tgui/tworkspacemainwindow.h --- tupi-0.2+git04/src/framework/tgui/tworkspacemainwindow.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/tworkspacemainwindow.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,16 @@ #ifndef TWORKSPACEMAINWINDOW_H #define TWORKSPACEMAINWINDOW_H +#include "tglobal.h" #include "tmainwindow.h" -#include + +#include /** * @author David Cuadrado */ -class T_IDEAL_EXPORT TWorkspaceMainWindow : public TMainWindow +class T_GUI_EXPORT TWorkspaceMainWindow : public TMainWindow { Q_OBJECT @@ -54,7 +56,8 @@ void removeWidget(QWidget *widget); private: - QWorkspace *m_workspace; + // QWorkspace *m_workspace; + QMdiArea *mdiArea; }; #endif diff -Nru tupi-0.2+git04/src/framework/tgui/txyspinbox.cpp tupi-0.2+git05/src/framework/tgui/txyspinbox.cpp --- tupi-0.2+git04/src/framework/tgui/txyspinbox.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/txyspinbox.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "txyspinbox.h" -#include "tapplication.h" -#include "tdebug.h" - -#include -#include TXYSpinBox::TXYSpinBox(const QString &title, QWidget *parent) : QGroupBox(title, parent), m_modifyTogether(false) { diff -Nru tupi-0.2+git04/src/framework/tgui/txyspinbox.h tupi-0.2+git05/src/framework/tgui/txyspinbox.h --- tupi-0.2+git04/src/framework/tgui/txyspinbox.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tgui/txyspinbox.h 2014-12-15 14:21:33.000000000 +0000 @@ -38,11 +38,14 @@ #include "tglobal.h" #include "tapplicationproperties.h" +#include "tapplication.h" #include #include #include #include +#include +#include /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/framework/tplugins/tgstengine/tgstengine.cpp tupi-0.2+git05/src/framework/tplugins/tgstengine/tgstengine.cpp --- tupi-0.2+git04/src/framework/tplugins/tgstengine/tgstengine.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tplugins/tgstengine/tgstengine.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,7 +35,6 @@ #include "tgstengine.h" #include "talgorithm.h" -#include "tdebug.h" #include #include diff -Nru tupi-0.2+git04/src/framework/tsound/taudioplayer.cpp tupi-0.2+git05/src/framework/tsound/taudioplayer.cpp --- tupi-0.2+git04/src/framework/tsound/taudioplayer.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/framework/tsound/taudioplayer.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,9 +33,9 @@ * along with this program. If not, see . * ***************************************************************************/ +#include "tglobal.h" #include "taudioplayer.h" #include "tglobal.h" -#include "tdebug.h" #include #include diff -Nru tupi-0.2+git04/src/framework/tupconfig.pri tupi-0.2+git05/src/framework/tupconfig.pri --- tupi-0.2+git04/src/framework/tupconfig.pri 1970-01-01 00:00:00.000000000 +0000 +++ tupi-0.2+git05/src/framework/tupconfig.pri 2014-12-15 14:21:33.000000000 +0000 @@ -0,0 +1,2 @@ + +DEFINES += HAVE_THEORA HAVE_LIBAV HAVE_QUAZIP HAVE_MULTIMEDIA HAVE_ZLIB VERSION=\\\"0.2\\\" CODE_NAME=\\\"Amandy\\\" REVISION=\\\"git05\\\" K_DEBUG diff -Nru tupi-0.2+git04/src/libbase/libbase.pri tupi-0.2+git05/src/libbase/libbase.pri --- tupi-0.2+git04/src/libbase/libbase.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/libbase.pri 2014-12-15 14:21:33.000000000 +0000 @@ -1,5 +1,9 @@ +unix { + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR -ltupibase +} -INCLUDEPATH += $$LIBBASE_DIR - -LIBS += -L$$LIBBASE_DIR -ltupibase - +win32 { + INCLUDEPATH += $$LIBBASE_DIR + LIBS += -L$$LIBBASE_DIR/release/ -ltupibase +} \ No newline at end of file diff -Nru tupi-0.2+git04/src/libbase/libbase.pro tupi-0.2+git05/src/libbase/libbase.pro --- tupi-0.2+git04/src/libbase/libbase.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/libbase.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,10 +1,13 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/libbase -# Target is a library: tupibase +QT += opengl core gui svg xml network -!include(../../tupiglobal.pri) { - error("Please configure first") +unix { + !include(../../tupiglobal.pri) { + error("Please configure first") + } +} + +win32 { + include(../../win.pri) } INSTALLS += target @@ -53,8 +56,6 @@ FRAMEWORK_DIR = "../framework" include($$FRAMEWORK_DIR/framework.pri) -# QUAZIP_DIR = ../../3rdparty/quazip/ -# include($$QUAZIP_DIR/quazip.pri) LIBTUPI_DIR = ../libtupi include($$LIBTUPI_DIR/libtupi.pri) STORE_DIR = ../store diff -Nru tupi-0.2+git04/src/libbase/tupanimationrenderer.cpp tupi-0.2+git05/src/libbase/tupanimationrenderer.cpp --- tupi-0.2+git04/src/libbase/tupanimationrenderer.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupanimationrenderer.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -39,9 +39,6 @@ #include "tupframe.h" #include "tupscene.h" #include "tupgraphicobject.h" -#include "tdebug.h" - -#include struct TupAnimationRenderer::Private { @@ -59,43 +56,50 @@ int calculateTotalPhotograms(TupScene *scene); }; +TupAnimationRenderer::TupAnimationRenderer(const QColor color, TupLibrary *library) : k(new Private) +{ + k->bgColor = color; + k->scene = new TupGraphicsScene; + k->scene->setLibrary(library); + k->scene->setBackgroundBrush(k->bgColor); +} + +TupAnimationRenderer::~TupAnimationRenderer() +{ + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[~TupAnimationRenderer()]"; + #else + TEND; + #endif + #endif + + // SQA: Check why this instruction crashes the application + // delete k; +} + int TupAnimationRenderer::Private::calculateTotalPhotograms(TupScene *scene) { Layers layers = scene->layers(); int total = 0; - foreach (TupLayer *layer, layers.values()) { - if (layer) - total = qMax(total, layer->frames().count()); + int totalLayers = layers.size(); + for (int i = 0; i < totalLayers; i++) { + TupLayer *layer = layers.at(i); + if (layer) + total = qMax(total, layer->frames().count()); } return total; } -TupAnimationRenderer::TupAnimationRenderer(const QColor color) : k(new Private) -{ - k->bgColor = color; - k->scene = new TupGraphicsScene; - - int alpha = color.alpha(); - if (alpha == 0) - k->scene->setBackgroundBrush(Qt::NoBrush); - else - k->scene->setBackgroundBrush(k->bgColor); -} - -TupAnimationRenderer::~TupAnimationRenderer() -{ - delete k; -} - void TupAnimationRenderer::setScene(TupScene *scene, QSize dimension) { k->scene->setCurrentScene(scene); k->scene->setSceneRect(QRectF(QPointF(0,0), dimension)); - k->scene->drawPhotogram(0, false); // ### SQA: Why whithout this doesn't work? + // k->scene->drawPhotogram(0, false); // ### SQA: Why whithout this doesn't work? k->currentPhotogram = -1; k->totalPhotograms = k->calculateTotalPhotograms(scene); @@ -123,9 +127,6 @@ void TupAnimationRenderer::render(QPainter *painter) { - // k->scene->render(painter, QRect(0, 0, painter->device()->width(), painter->device()->height()), - // k->scene->sceneRect().toRect(), Qt::IgnoreAspectRatio); - k->scene->render(painter, k->scene->sceneRect().toRect(), k->scene->sceneRect().toRect(), Qt::IgnoreAspectRatio); } diff -Nru tupi-0.2+git04/src/libbase/tupanimationrenderer.h tupi-0.2+git05/src/libbase/tupanimationrenderer.h --- tupi-0.2+git04/src/libbase/tupanimationrenderer.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupanimationrenderer.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,20 +36,24 @@ #ifndef TUPANIMATIONRENDERER_H #define TUPANIMATIONRENDERER_H +#include "tglobal.h" + #include #include +#include class QPainter; class TupScene; +class TupLibrary; /** * @author David Cuadrado */ -class TupAnimationRenderer +class TUPI_EXPORT TupAnimationRenderer { public: - TupAnimationRenderer(const QColor color); + TupAnimationRenderer(const QColor color, TupLibrary *library); ~TupAnimationRenderer(); void setScene(TupScene *scene, QSize dimension); diff -Nru tupi-0.2+git04/src/libbase/tupexportinterface.h tupi-0.2+git05/src/libbase/tupexportinterface.h --- tupi-0.2+git04/src/libbase/tupexportinterface.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupexportinterface.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,10 @@ #ifndef TUPEXPORTINTERFACE_H #define TUPEXPORTINTERFACE_H +#include "tglobal.h" #include "tupscene.h" #include "qplugin.h" // Q_EXPORT_PLUGIN +#include "tuplibrary.h" #include #include @@ -73,8 +75,8 @@ virtual ~TupExportInterface() {}; virtual QString key() const = 0; virtual Formats availableFormats() = 0; - virtual bool exportToFormat(const QColor color, const QString &filePath, const QList &scenes, Format format, const QSize &size, int fps) = 0; - virtual bool exportFrame(int frameIndex, const QColor color, const QString &filePath, TupScene *scene, const QSize &size) = 0; + virtual bool exportToFormat(const QColor color, const QString &filePath, const QList &scenes, Format format, const QSize &size, int fps, TupLibrary *library) = 0; + virtual bool exportFrame(int frameIndex, const QColor color, const QString &filePath, TupScene *scene, const QSize &size, TupLibrary *library) = 0; virtual const char* getExceptionMsg() = 0; }; diff -Nru tupi-0.2+git04/src/libbase/tupexportpluginobject.h tupi-0.2+git05/src/libbase/tupexportpluginobject.h --- tupi-0.2+git04/src/libbase/tupexportpluginobject.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupexportpluginobject.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,7 @@ #ifndef TUPEXPORTPLUGINOBJECT_H #define TUPEXPORTPLUGINOBJECT_H -#include "tupglobal.h" +#include "tglobal.h" #include "tupexportinterface.h" #include diff -Nru tupi-0.2+git04/src/libbase/tupgraphicsscene.cpp tupi-0.2+git05/src/libbase/tupgraphicsscene.cpp --- tupi-0.2+git04/src/libbase/tupgraphicsscene.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupgraphicsscene.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,6 @@ #include "tupgraphicsscene.h" #include "tupscene.h" #include "tuplayer.h" - #include "tupgraphicobject.h" #include "tupitemgroup.h" #include "tupprojectloader.h" @@ -52,17 +51,8 @@ #include "tuplineitem.h" #include "tuprectitem.h" #include "tupellipseitem.h" - -#include "tdebug.h" #include "tupguideline.h" - -#include -#include -#include -#include -#include -#include -#include +#include "tuplibrary.h" /** * This class defines the data structure and methods for handling animation scenes. @@ -98,12 +88,17 @@ QList lines; TupProject::Mode spaceMode; + TupLibrary *library; }; TupGraphicsScene::TupGraphicsScene() : QGraphicsScene(), k(new Private) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene()]"; + #else + T_FUNCINFO; + #endif #endif setItemIndexMethod(QGraphicsScene::NoIndex); @@ -128,17 +123,23 @@ TupGraphicsScene::~TupGraphicsScene() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupGraphicsScene()]"; + #else + TEND; + #endif #endif clearFocus(); clearSelection(); - foreach (QGraphicsView *view, this->views()) - view->setScene(0); - - foreach (QGraphicsItem *item, items()) - removeItem(item); + // SQA: Check if these instructions are actually required + // foreach (QGraphicsView *view, this->views()) + // view->setScene(0); + + // SQA: Check if these instructions are actually required + // foreach (QGraphicsItem *item, items()) + // removeItem(item); delete k; } @@ -146,7 +147,11 @@ void TupGraphicsScene::setCurrentFrame(int layer, int frame) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::setCurrentFrame()]"; + #else + T_FUNCINFO; + #endif #endif if ((frame != k->framePosition.frame && k->framePosition.frame >= 0) || @@ -166,7 +171,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::drawCurrentPhotogram()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -178,10 +187,9 @@ if (k->spaceMode == TupProject::FRAMES_EDITION) { drawPhotogram(k->framePosition.frame, true); - // } else if (k->spaceMode == TupProject::STATIC_BACKGROUND_EDITION) { } else { cleanWorkSpace(); - drawBackground(k->framePosition.frame); + drawSceneBackground(k->framePosition.frame); } } @@ -189,27 +197,29 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::drawPhotogram()]"; + #else + T_FUNCINFO; + #endif #endif */ - // Q_CHECK_PTR(k->scene); - if (photogram < 0 || !k->scene) return; cleanWorkSpace(); + // Painting the background + drawSceneBackground(photogram); bool valid = false; // Drawing frames from every layer for (int i=0; i < k->scene->layersTotal(); i++) { - TupLayer *layer = k->scene->layer(i); if (layer->framesTotal() > 0 && photogram < layer->framesTotal()) { - TupFrame *mainFrame = layer->frame(photogram); QString currentFrame = ""; @@ -219,14 +229,9 @@ if (layer) { if (layer->isVisible()) { - - // Painting the background - drawBackground(photogram); - // Painting previews frames if (drawContext) { if (k->onionSkin.previous > 0 && photogram > 0) { - double opacity = k->opacity; double opacityFactor = opacity / (double)qMin(layer->frames().count(), k->onionSkin.previous); @@ -250,9 +255,6 @@ } } - // valid = true; - // k->layerCounter = i; - // addFrame(mainFrame, Current); addFrame(mainFrame); // Painting next frames @@ -280,6 +282,8 @@ } } + addLipSyncObjects(layer, photogram, mainFrame->getTopZLevel()); + // SQA: Crashpoint when layers are deleted valid = true; @@ -296,7 +300,6 @@ if (valid) { addTweeningObjects(photogram); addSvgTweeningObjects(photogram); - update(); } @@ -304,18 +307,29 @@ k->tool->updateScene(this); } -void TupGraphicsScene::drawBackground(int photogram) +void TupGraphicsScene::drawSceneBackground(int photogram) { - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::drawSceneBackground()]"; + #else + T_FUNCINFO; + #endif #endif - */ Q_CHECK_PTR(k->scene); - if (!k->scene) + if (!k->scene) { + #ifdef K_DEBUG + QString msg = "TupGraphicsScene::drawSceneBackground() - Warning: k->scene is NULL!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif + #endif return; + } TupBackground *bg = k->scene->background(); if (bg) { @@ -326,7 +340,12 @@ addFrame(frame, 1.0); } else { #ifdef K_DEBUG - tWarning() << "TupGraphicsScene::drawBackground() - Dynamic background frame is empty"; + QString msg = "TupGraphicsScene::drawSceneBackground() - Dynamic background frame is empty"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } } else if (k->spaceMode == TupProject::FRAMES_EDITION) { @@ -339,7 +358,12 @@ addItem(item); } else { #ifdef K_DEBUG - tWarning() << "TupGraphicsScene::drawBackground() - Dynamic background frame is empty"; + QString msg = "TupGraphicsScene::drawSceneBackground() - Dynamic background frame is empty"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } } @@ -362,7 +386,12 @@ addFrame(frame, 1.0); } else { #ifdef K_DEBUG - tWarning() << "TupGraphicsScene::drawBackground() - Static background frame is empty"; + QString msg = "TupGraphicsScene::drawSceneBackground() - Static background frame is empty"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } } @@ -373,7 +402,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::addFrame()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -431,11 +464,13 @@ void TupGraphicsScene::addGraphicObject(TupGraphicObject *object, double opacity) { - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::addGraphicObject()]"; + #else + T_FUNCINFO; + #endif #endif - */ QGraphicsItem *item = object->item(); k->onionSkin.opacityMap.insert(item, opacity); @@ -444,17 +479,14 @@ group->recoverChilds(); if (! qgraphicsitem_cast(item->parentItem())) { - item->setSelected(false); TupLayer *layer = k->scene->layer(k->framePosition.layer); if (layer) { - TupFrame *frame = layer->frame(k->framePosition.frame); if (frame) { item->setOpacity(opacity); - // k->objectCounter++; addItem(item); } } @@ -465,7 +497,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::addSvgObject()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -489,18 +525,33 @@ addItem(svgItem); } else { #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::addSvgObject() - Error: Frame #" << k->framePosition.frame << " NO available!"; + QString msg = "TupGraphicsScene::addSvgObject() - Error: Frame #" + QString::number(k->framePosition.frame) + " NO available!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::addSvgObject() - Error: Layer #" << k->framePosition.layer << " NO available!"; + QString msg = "TupGraphicsScene::addSvgObject() - Error: Layer #" + QString::number(k->framePosition.layer) + " NO available!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::addSvgObject() - Error: No SVG item!"; + QString msg = "TupGraphicsScene::addSvgObject() - Error: No SVG item!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } @@ -509,26 +560,27 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::addTweeningObjects()]"; + #else + T_FUNCINFO; + #endif #endif */ QList tweenList = k->scene->tweeningGraphicObjects(); for (int i=0; i < tweenList.count(); i++) { - TupGraphicObject *object = tweenList.at(i); if (object->frame()->layer()->isVisible()) { int origin = object->frame()->index(); if (TupItemTweener *tween = object->tween()) { - int adjustX = object->item()->boundingRect().width()/2; int adjustY = object->item()->boundingRect().height()/2; if (origin == photogram) { - TupTweenerStep *stepItem = tween->stepAt(0); object->item()->setToolTip(tween->tweenType() + ": " + tween->name() + tr("/Step: 0")); @@ -536,7 +588,6 @@ object->item()->setTransformOriginPoint(tween->transformOriginPoint()); if (stepItem->has(TupTweenerStep::Position)) { - // tFatal() << "TupGraphicsScene::addTweeningObjects() - Applying position..."; QPointF point = QPoint(-adjustX, -adjustY); object->setLastTweenPos(stepItem->position() + point); object->item()->setPos(tween->transformOriginPoint()); @@ -547,13 +598,8 @@ object->item()->setTransformOriginPoint(rect.center()); double angle = stepItem->rotation(); object->item()->setRotation(angle); - // tFatal() << "TupGraphicsScene::addTweeningObjects() - Applying rotation - Angle: " << angle; - } else { - // tFatal() << "TupGraphicsScene::addTweeningObjects() - No rotation parameter!"; - } - + } } else { - if (stepItem->has(TupTweenerStep::Position)) { QPointF point = QPoint(-adjustX, -adjustY); object->setLastTweenPos(stepItem->position() + point); @@ -604,7 +650,6 @@ } } else if ((origin < photogram) && (photogram < origin + tween->frames())) { - int step = photogram - origin; TupTweenerStep *stepItem = tween->stepAt(step); object->item()->setToolTip(tween->tweenType() + ": " + tween->name() + tr("/Step: ") + QString::number(step)); @@ -703,26 +748,27 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::addSvgTweeningObjects()]"; + #else + T_FUNCINFO; + #endif #endif */ QList svgList = k->scene->tweeningSvgObjects(); for (int i=0; i < svgList.count(); i++) { - TupSvgItem *object = svgList.at(i); if (object->frame()->layer()->isVisible()) { int origin = object->frame()->index(); if (TupItemTweener *tween = object->tween()) { - int adjustX = object->boundingRect().width()/2; int adjustY = object->boundingRect().height()/2; if (origin == photogram) { - TupTweenerStep *stepItem = tween->stepAt(0); object->setToolTip(tween->tweenType() + ": " + tween->name() + tr("/Step: 0")); @@ -804,18 +850,65 @@ } } else { #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::addSvgTweeningObjects() - No tween found!"; + QString msg = "TupGraphicsScene::addSvgTweeningObjects() - No tween found!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } } } +void TupGraphicsScene::addLipSyncObjects(TupLayer *layer, int photogram, int zLevel) +{ + if (layer->lipSyncCount() > 0) { + Mouths mouths = layer->lipSyncList(); + for (int i=0; iinitFrame(); + + if ((photogram >= initFrame) && (photogram <= initFrame + lipSync->framesTotal())) { + QString name = lipSync->name(); + TupLibraryFolder *folder = k->library->getFolder(name); + if (folder) { + QList voices = lipSync->voices(); + int total = voices.count(); + for(int i=0; i < total; i++) { + TupVoice *voice = voices.at(i); + int index = photogram - initFrame; + if (voice->contains(index)) { + // Add image here + QString phoneme = voice->getPhoneme(index); + TupLibraryObject *image = folder->getObject(phoneme + lipSync->picExtension()); + if (image) { + TupGraphicLibraryItem *item = new TupGraphicLibraryItem(image); + if (item) { + item->setPos(voice->mouthPos()); + item->setToolTip(tr("lipsync:") + name + ":" + QString::number(i)); + item->setZValue(zLevel); + addItem(item); + } + } + } + } + } + } + } + } +} + void TupGraphicsScene::cleanWorkSpace() { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::cleanWorkSpace()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -834,7 +927,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::currentFrameIndex()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -845,7 +942,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::currentLayerIndex()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -856,13 +957,22 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::currentSceneIndex()]"; + #else + T_FUNCINFO; + #endif #endif */ if (!k->scene) { #ifdef K_DEBUG - tError() << "TupGraphicsScene::currentSceneIndex() - Error: Scene index is -1"; + QString msg = "TupGraphicsScene::currentSceneIndex() - Error: Scene index is -1"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return -1; } @@ -874,7 +984,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::setNextOnionSkinCount()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -887,7 +1001,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::setPreviousOnionSkinCount()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -900,30 +1018,30 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::currentFrame()]"; + #else + T_FUNCINFO; + #endif #endif */ if (k->scene) { - if (k->scene->layersTotal() > 0) { - if (k->framePosition.layer < k->scene->layersTotal()) { - - if (k->scene->layers().contains(k->framePosition.layer)) { - TupLayer *layer = k->scene->layer(k->framePosition.layer); - Q_CHECK_PTR(layer); - if (layer) { - if (!layer->frames().isEmpty()) - return layer->frame(k->framePosition.frame); - } else { - #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::currentFrame - No layer available: " << k->framePosition.frame; - #endif - } + TupLayer *layer = k->scene->layer(k->framePosition.layer); + Q_CHECK_PTR(layer); + if (layer) { + if (!layer->frames().isEmpty()) + return layer->frame(k->framePosition.frame); } else { #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::currentFrame - Layer index incorrect!"; + QString msg = "TupGraphicsScene::currentFrame - No layer available at -> " + QString::number(k->framePosition.frame); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } else { @@ -943,13 +1061,15 @@ void TupGraphicsScene::setCurrentScene(TupScene *scene) { - Q_CHECK_PTR(scene); - - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::setCurrentScene()]"; + #else + T_FUNCINFO; + #endif #endif - */ + + Q_CHECK_PTR(scene); setCurrentFrame(0, 0); @@ -965,7 +1085,7 @@ if (k->spaceMode == TupProject::FRAMES_EDITION) { drawCurrentPhotogram(); } else if (k->spaceMode == TupProject::STATIC_BACKGROUND_EDITION) { - drawBackground(k->framePosition.frame); + drawSceneBackground(k->framePosition.frame); } } @@ -973,7 +1093,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::setLayerVisible()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -988,7 +1112,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::scene()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1000,20 +1128,23 @@ void TupGraphicsScene::setTool(TupToolPlugin *tool) { - /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::setTool()]"; + #else + T_FUNCINFO; + #endif #endif - */ + // SQA: Check if this code is really required if (k->spaceMode == TupProject::FRAMES_EDITION) { drawCurrentPhotogram(); } else { cleanWorkSpace(); - drawBackground(k->framePosition.frame); + drawSceneBackground(k->framePosition.frame); } - /* SQA: Code under revision + /* SQA: Code under revision (related to Line Guides) if (k->tool) { if (k->tool->toolType() == TupToolPlugin::Selection) { foreach (TupLineGuide *line, k->lines) { @@ -1046,7 +1177,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::currentTool()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1057,7 +1192,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::mousePressEvent()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1073,7 +1212,7 @@ return; if (k->tool->toolType() == TupToolPlugin::Tweener && event->isAccepted()) { - tFatal() << "TupGraphicsScene::mousePressEvent() - Tracing!"; + // tFatal() << "TupGraphicsScene::mousePressEvent() - Tracing!"; if (k->tool->currentEditMode() == TupToolPlugin::Properties) return; } @@ -1097,7 +1236,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::mouseMoveEvent()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1114,7 +1257,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::mouseMoved()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1128,7 +1275,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::mouseReleaseEvent()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1145,7 +1296,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::mouseReleased()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1158,7 +1313,12 @@ if (currentFrame()) { if (currentFrame()->isLocked()) { #ifdef K_DEBUG - tFatal() << "TupGraphicsScene::mouseReleased() - Frame is locked!"; + QString msg = "TupGraphicsScene::mouseReleased() - Frame is locked!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif return; } @@ -1171,14 +1331,7 @@ k->tool->release(k->inputInformation, k->brushManager, this); k->tool->end(); } - } else { - if (k->tool) { - if (k->tool->name().compare(tr("Zoom In")) == 0 || k->tool->name().compare(tr("Zoom Out")) == 0) { - if (event->button() != Qt::RightButton) - k->tool->release(k->inputInformation, k->brushManager, this); - } - } - } + } k->isDrawing = false; } @@ -1187,7 +1340,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::mouseDoubleClickEvent()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1225,14 +1382,10 @@ /* -// TODO: Check this code, not sure whether it does something or it's handy :S +// SQA: Check this code, not sure whether it does something or it's handy :S void TupGraphicsScene::dragEnterEvent(QGraphicsSceneDragDropEvent * event) { - #ifdef K_DEBUG - T_FUNCINFO; - #endif - if (event->mimeData()->hasFormat("tupi-ruler")) event->acceptProposedAction(); @@ -1292,7 +1445,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFOX("scene"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::sceneResponse()]"; + #else + T_FUNCINFOX("scene"); + #endif #endif */ @@ -1304,7 +1461,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFOX("scene"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::layerResponse()]"; + #else + T_FUNCINFOX("layer"); + #endif #endif */ @@ -1316,7 +1477,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFOX("scene"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::frameResponse()]"; + #else + T_FUNCINFOX("frame"); + #endif #endif */ @@ -1328,7 +1493,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFOX("scene"); + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::itemResponse()]"; + #else + T_FUNCINFOX("item"); + #endif #endif */ @@ -1366,7 +1535,11 @@ { /* #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupGraphicsScene::includeObject()]"; + #else + T_FUNCINFO; + #endif #endif */ @@ -1438,3 +1611,13 @@ else return -1; } + +void TupGraphicsScene::setLibrary(TupLibrary *library) +{ + k->library = library; +} + +void TupGraphicsScene::resetCurrentTool() +{ + k->tool->init(this); +} diff -Nru tupi-0.2+git04/src/libbase/tupgraphicsscene.h tupi-0.2+git05/src/libbase/tupgraphicsscene.h --- tupi-0.2+git04/src/libbase/tupgraphicsscene.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupgraphicsscene.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,12 +36,19 @@ #ifndef TUPGRAPHICSSCENE_H #define TUPGRAPHICSSCENE_H -#include "tupglobal.h" +#include "tglobal.h" #include "tupsvgitem.h" #include "tupproject.h" #include "tupprojectresponse.h" #include +#include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado @@ -72,7 +79,7 @@ void drawCurrentPhotogram(); void drawPhotogram(int photogram, bool drawContext); - void drawBackground(int photogram); + void drawSceneBackground(int photogram); void cleanWorkSpace(); void removeScene(); @@ -116,6 +123,10 @@ int framesTotal(); + void setLibrary(TupLibrary *library); + + void resetCurrentTool(); + // private slots: // void updateObjectInformation(const QString &value); // void showInfoWidget(); @@ -130,6 +141,7 @@ void addSvgObject(TupSvgItem *svgItem, double opacity = 1.0); void addTweeningObjects(int photogram); void addSvgTweeningObjects(int photogram); + void addLipSyncObjects(TupLayer *layer, int photogram, int zLevel); protected: virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); diff -Nru tupi-0.2+git04/src/libbase/tupguideline.cpp tupi-0.2+git05/src/libbase/tupguideline.cpp --- tupi-0.2+git04/src/libbase/tupguideline.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupguideline.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,23 +35,15 @@ #include "tupguideline.h" -#include -#include -#include -#include -#include -#include -#include - struct TupLineGuide::Private { Qt::Orientation orientation; bool enabled; }; -TupLineGuide::TupLineGuide(Qt::Orientation o ,QGraphicsScene *scene): QGraphicsItem(0, scene), k(new Private) +TupLineGuide::TupLineGuide(Qt::Orientation orientation): QGraphicsItem(0), k(new Private) { - k->orientation = o; + k->orientation = orientation; k->enabled = true; // setAcceptsHoverEvents(true); // setAcceptedMouseButtons(0); diff -Nru tupi-0.2+git04/src/libbase/tupguideline.h tupi-0.2+git05/src/libbase/tupguideline.h --- tupi-0.2+git04/src/libbase/tupguideline.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupguideline.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,15 @@ #ifndef TUPLINEGUIDE_H #define TUPLINEGUIDE_H -#include "tupglobal.h" +#include "tglobal.h" + #include +#include +#include +#include +#include +#include +#include /** * @author Jorge Cuadrado @@ -46,7 +53,7 @@ class TUPI_EXPORT TupLineGuide : public QGraphicsItem { public: - TupLineGuide(Qt::Orientation o, QGraphicsScene *scene); + TupLineGuide(Qt::Orientation orientation); ~TupLineGuide(); QRectF boundingRect() const; diff -Nru tupi-0.2+git04/src/libbase/tupmodulewidgetbase.cpp tupi-0.2+git05/src/libbase/tupmodulewidgetbase.cpp --- tupi-0.2+git04/src/libbase/tupmodulewidgetbase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupmodulewidgetbase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "tupmodulewidgetbase.h" -#include "tdebug.h" - -#include -#include -#include struct TupModuleWidgetBase::Private { diff -Nru tupi-0.2+git04/src/libbase/tupmodulewidgetbase.h tupi-0.2+git05/src/libbase/tupmodulewidgetbase.h --- tupi-0.2+git04/src/libbase/tupmodulewidgetbase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupmodulewidgetbase.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,17 +36,19 @@ #ifndef TUPMODULEWIDGETBASE_H #define TUPMODULEWIDGETBASE_H +#include "tglobal.h" #include "tosd.h" #include "tupprojectresponse.h" #include "tupabstractprojectresponsehandler.h" -#include "tupglobal.h" #include #include #include #include -#include #include +#include +#include +#include /** * @author Jorge Cuadrado diff -Nru tupi-0.2+git04/src/libbase/tuppaintareabase.cpp tupi-0.2+git05/src/libbase/tuppaintareabase.cpp --- tupi-0.2+git04/src/libbase/tuppaintareabase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuppaintareabase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -44,22 +44,9 @@ // Tupi Framework #include "tupscene.h" #include "tconfig.h" -#include "tdebug.h" #include "tapplication.h" #include "tosd.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - #ifdef QT_OPENGL_LIB #include @@ -112,9 +99,10 @@ QPen blackPen; }; -TupPaintAreaBase::TupPaintAreaBase(QWidget *parent, QSize dimension) : QGraphicsView(parent), k(new Private) +TupPaintAreaBase::TupPaintAreaBase(QWidget *parent, QSize dimension, TupLibrary *library) : QGraphicsView(parent), k(new Private) { k->scene = new TupGraphicsScene(); + k->scene->setLibrary(library); k->grid = 0; k->greenThickPen = QPen(QColor(0, 135, 0, 255), 2); @@ -184,7 +172,13 @@ void TupPaintAreaBase::setUseOpenGL(bool opengl) { - T_FUNCINFO << opengl; + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintAreaBase::setUseOpenGL()] - opengl: " << opengl; + #else + T_FUNCINFO << opengl; + #endif + #endif QCursor cursor(Qt::ArrowCursor); if (viewport()) @@ -198,7 +192,14 @@ } #else Q_UNUSED(opengl); - kWarning() << tr("OpenGL isn't supported"); + #ifdef K_DEBUG + QString msg = "OpenGL isn't supported"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + kWarning() << msg; + #endif + #endif #endif // to restore the cursor. @@ -224,7 +225,12 @@ { if (!scene()) { #ifdef K_DEBUG - tDebug() << "TupPaintAreaBase::setTool() - Fatal Error: No scene available"; + QString msg = "TupPaintAreaBase::setTool() - Fatal Error: No scene available"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } @@ -251,13 +257,23 @@ void TupPaintAreaBase::mousePressEvent(QMouseEvent * event) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintAreaBase::mousePressEvent()]"; + #else + T_FUNCINFO; + #endif #endif if (!canPaint()) { #ifdef K_DEBUG - tDebug() << "TupPaintAreaBase::mousePressEvent -> I can't paint right now!"; + QString msg = "TupPaintAreaBase::mousePressEvent() -> I can't paint right now!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif + return; } @@ -269,8 +285,14 @@ { if (!canPaint()) { #ifdef K_DEBUG - tWarning() << "TupPaintAreaBase::mouseMoveEvent() - The canvas is busy. Can't paint!"; + QString msg = "TupPaintAreaBase::mouseMoveEvent() - Canvas is busy. Can't paint!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif + return; } @@ -482,7 +504,11 @@ bool TupPaintAreaBase::canPaint() const { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupPaintAreaBase::canPaint()]"; + #else + T_FUNCINFO; + #endif #endif if (k->scene) { @@ -492,7 +518,12 @@ } } else { #ifdef K_DEBUG - tWarning() << "TupPaintAreaBase::canPaint() - Warning: Scene is NULL!"; + QString msg = "TupPaintAreaBase::canPaint() - Warning: Scene is NULL!"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif } @@ -512,13 +543,6 @@ void TupPaintAreaBase::wheelEvent(QWheelEvent *event) { scaleView(pow((double)2, event->delta() / 520.0)); - - /* - if (event->modifiers() == Qt::ControlModifier) - scaleView(pow((double)2, -event->delta() / 240.0)); - else - QGraphicsView::wheelEvent(event); - */ } bool TupPaintAreaBase::viewportEvent(QEvent *event) @@ -535,8 +559,6 @@ void TupPaintAreaBase::scaleView(qreal scaleFactor) { - // SQA: Check if this method is called for some class - qreal factor = matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width(); if (factor < 0.07 || factor > 100) diff -Nru tupi-0.2+git04/src/libbase/tuppaintareabase.h tupi-0.2+git05/src/libbase/tuppaintareabase.h --- tupi-0.2+git04/src/libbase/tuppaintareabase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuppaintareabase.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,10 +36,21 @@ #ifndef TUPPAINTAREABASE_H #define TUPPAINTAREABASE_H +#include "tglobal.h" #include "tuptoolplugin.h" -#include "tupglobal.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include class QGraphicsRectItem; class TupBrushManager; @@ -57,7 +68,7 @@ Q_OBJECT public: - TupPaintAreaBase(QWidget * parent = 0, QSize dimension = QSize(0, 0)); + TupPaintAreaBase(QWidget * parent = 0, QSize dimension = QSize(0, 0), TupLibrary *library = 0); ~TupPaintAreaBase(); void setBgColor(const QColor color); @@ -103,7 +114,7 @@ void cursorPosition(const QPointF &pos); void requestTriggered(const TupProjectRequest *event); void changedZero(const QPointF &zero); - void scaled(double scaleFactor); + void scaled(qreal scaleFactor); void rotated(int angle); public slots: diff -Nru tupi-0.2+git04/src/libbase/tuppaintarearotator.cpp tupi-0.2+git05/src/libbase/tuppaintarearotator.cpp --- tupi-0.2+git04/src/libbase/tuppaintarearotator.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuppaintarearotator.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,9 +35,6 @@ #include "tuppaintarearotator.h" #include "tuppaintareabase.h" -#include "tdebug.h" - -#include struct TupPaintAreaRotator::Private { diff -Nru tupi-0.2+git04/src/libbase/tuppaintarearotator.h tupi-0.2+git05/src/libbase/tuppaintarearotator.h --- tupi-0.2+git04/src/libbase/tuppaintarearotator.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuppaintarearotator.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,10 @@ #ifndef TUPPAINTAREAROTATOR_H #define TUPPAINTAREAROTATOR_H -#include "tupglobal.h" +#include "tglobal.h" + #include +#include class TupPaintAreaBase; diff -Nru tupi-0.2+git04/src/libbase/tuppluginmanager.cpp tupi-0.2+git05/src/libbase/tuppluginmanager.cpp --- tupi-0.2+git04/src/libbase/tuppluginmanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuppluginmanager.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -37,11 +37,6 @@ #include "tupfilterinterface.h" #include "tuptoolinterface.h" #include "tupexportinterface.h" -#include "tglobal.h" -#include "tdebug.h" - -#include -#include TupPluginManager *TupPluginManager::s_instance = 0; @@ -73,7 +68,12 @@ void TupPluginManager::loadPlugins() { #ifdef K_DEBUG - tWarning("plugins") << "TupPluginManager::loadPlugins() - Loading plugins..."; + QString msg = "TupPluginManager::loadPlugins() - Loading plugins..."; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif k->filters.clear(); @@ -87,7 +87,11 @@ QObject *plugin = qobject_cast(loader->instance()); #ifdef K_DEBUG - tDebug("plugins") << "*** Trying to load plugin from: " << fileName; + #ifdef Q_OS_WIN32 + qWarning() << "TupPluginManager::loadPlugins() - Trying to load plugin from: " << fileName; + #else + tWarning("plugins") << "*** Trying to load plugin from: " << fileName; + #endif #endif if (plugin) { @@ -110,7 +114,12 @@ k->loaders << loader; } else { #ifdef K_DEBUG - tError("plugins") << "TupPluginManager::loadPlugins() - Cannot load plugin, error was: " << loader->errorString(); + QString msg = "TupPluginManager::loadPlugins() - Cannot load plugin, error was: " + loader->errorString(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -119,7 +128,12 @@ void TupPluginManager::unloadPlugins() { #ifdef K_DEBUG - tWarning("plugins") << "TupPluginManager::unloadPlugins() - Unloading plugins..."; + QString msg = "TupPluginManager::unloadPlugins() - Unloading plugins..."; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif foreach (QPluginLoader *loader, k->loaders) { diff -Nru tupi-0.2+git04/src/libbase/tuppluginmanager.h tupi-0.2+git05/src/libbase/tuppluginmanager.h --- tupi-0.2+git04/src/libbase/tuppluginmanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuppluginmanager.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,11 @@ #ifndef TUPPLUGINMANAGER_H #define TUPPLUGINMANAGER_H -#include "tupglobal.h" +#include "tglobal.h" + #include +#include +#include class QPluginLoader; diff -Nru tupi-0.2+git04/src/libbase/tuptoolinterface.h tupi-0.2+git05/src/libbase/tuptoolinterface.h --- tupi-0.2+git04/src/libbase/tuptoolinterface.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuptoolinterface.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,13 +33,13 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef ATOOLINTERFACE_H -#define ATOOLINTERFACE_H +#ifndef TUPTOOLINTERFACE_H +#define TUPTOOLINTERFACE_H +#include "tglobal.h" #include "tupframe.h" #include "taction.h" #include "qplugin.h" // Q_EXPORT_PLUGIN -#include "tupglobal.h" #include #include @@ -69,7 +69,8 @@ Fill, Selection, View, - Tweener + Tweener, + LipSync }; virtual ~TupToolInterface() {}; diff -Nru tupi-0.2+git04/src/libbase/tuptoolplugin.cpp tupi-0.2+git05/src/libbase/tuptoolplugin.cpp --- tupi-0.2+git04/src/libbase/tuptoolplugin.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuptoolplugin.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -1,4 +1,5 @@ /*************************************************************************** + * Project TUPI: Magia 2D * * Project Contact: info@maefloresta.com * * Project Website: http://www.maefloresta.com * @@ -38,12 +39,6 @@ #include "tupinputdeviceinformation.h" #include "tupgraphicsscene.h" -#include "tdebug.h" - -#include -#include -#include - struct TupToolPlugin::Private { QString currentTool; @@ -80,12 +75,26 @@ void TupToolPlugin::begin() { - tDebug("tools") << "Begin: " << k->currentTool; +#ifdef K_DEBUG + QString msg = "TupToolPlugin::begin() - Begin: " + k->currentTool; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif +#endif } void TupToolPlugin::end() { - tDebug("tools") << "End: " << k->currentTool; +#ifdef K_DEBUG + QString msg = "TupToolPlugin::end() - End: " + k->currentTool; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("tools") << msg; + #endif +#endif } void TupToolPlugin::sceneResponse(const TupSceneResponse *event) @@ -157,9 +166,11 @@ Q_UNUSED(factor); } +/* void TupToolPlugin::autoZoom() { } +*/ void TupToolPlugin::setProjectSize(const QSize size) { @@ -233,6 +244,7 @@ tool = TupToolPlugin::ContourTool; break; + /* case Qt::Key_Z: menu = TupToolPlugin::ZoomMenu; if (modifiers == Qt::ShiftModifier) @@ -240,10 +252,11 @@ else tool = TupToolPlugin::ZoomInTool; break; + */ case Qt::Key_H: menu = TupToolPlugin::ZoomMenu; - tool = TupToolPlugin::HandTool; + tool = TupToolPlugin::ShiftTool; break; case Qt::Key_Right: @@ -288,3 +301,23 @@ return TupToolPlugin::None; } +void TupToolPlugin::setActiveView(const QString &viewID) +{ + Q_UNUSED(viewID); +} + +/* +void TupToolPlugin::addNewItem(const QString &id) +{ + Q_UNUSED(id); +} +*/ + +void TupToolPlugin::setCurrentItem(const QString &id) +{ + Q_UNUSED(id); +} + +void TupToolPlugin::updateWorkSpaceContext() +{ +} diff -Nru tupi-0.2+git04/src/libbase/tuptoolplugin.h tupi-0.2+git05/src/libbase/tuptoolplugin.h --- tupi-0.2+git04/src/libbase/tuptoolplugin.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tuptoolplugin.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,12 +36,15 @@ #ifndef TUPTOOLPLUGIN_H #define TUPTOOLPLUGIN_H +#include "tglobal.h" #include "tuptoolinterface.h" -#include "tupglobal.h" #include "tupprojectresponse.h" #include #include +#include +#include +#include class TupGraphicsScene; class QGraphicsView; @@ -63,7 +66,8 @@ enum BrushTools { InvalidBrush = -1, PencilTool = 0, InkTool, EraserTool, PolyLineTool, LineTool, RectangleTool, EllipseTool, TextTool, FrameBack, FrameForward, QuickCopy, Delete }; enum SelectTools { InvalidSelection = -1, NodesTool = 0, ObjectsTool }; enum FillTools { InvalidFill = -1, InsideTool = 0, ContourTool }; - enum ViewTools { InvalidView = -1, ZoomInTool = 0, ZoomOutTool, HandTool }; + // enum ViewTools { InvalidView = -1, ZoomInTool = 0, ZoomOutTool, ShiftTool }; + enum ViewTools { InvalidView = -1, ShiftTool }; enum ColorTools { InvalidColor = -1, ColorTool = 0 }; enum Mode { Add = 1, Edit, View }; @@ -107,11 +111,17 @@ virtual void resizeNodes(qreal factor); virtual void updateZoomFactor(qreal factor); - virtual void autoZoom(); + // virtual void autoZoom(); virtual void setProjectSize(const QSize size); virtual TupToolPlugin::Mode currentMode(); virtual TupToolPlugin::EditMode currentEditMode(); + + virtual void setActiveView(const QString &viewID); + // virtual void addNewItem(const QString &id); + virtual void setCurrentItem(const QString &id); + + virtual void updateWorkSpaceContext(); signals: void requested(const TupProjectRequest *request); diff -Nru tupi-0.2+git04/src/libbase/tupwebhunter.cpp tupi-0.2+git05/src/libbase/tupwebhunter.cpp --- tupi-0.2+git04/src/libbase/tupwebhunter.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupwebhunter.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,15 +33,7 @@ * along with this program. If not, see . * ***************************************************************************/ -#include -#include -#include -#include -#include -#include - #include "tupwebhunter.h" -#include "tdebug.h" QString TupWebHunter::BROWSER_FINGERPRINT = QString("Tupi_Browser 1.0"); @@ -73,7 +65,8 @@ QNetworkRequest request; request.setUrl(QUrl(k->url)); - request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toAscii()); + // request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toAscii()); + request.setRawHeader("User-Agent", BROWSER_FINGERPRINT.toLatin1()); QNetworkReply *reply = manager->get(request); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(slotError(QNetworkReply::NetworkError))); @@ -110,28 +103,63 @@ switch (error) { case QNetworkReply::HostNotFoundError: { - tError() << "TupWebHunter::slotError() - Network Error: Host not found"; + #ifdef K_DEBUG + QString msg = "TupWebHunter::slotError() - Network Error: Host not found"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } break; case QNetworkReply::TimeoutError: { - tError() << "TupWebHunter::slotError() - Network Error: Time out!"; + #ifdef K_DEBUG + QString msg = "TupWebHunter::slotError() - Network Error: Time out!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } break; case QNetworkReply::ConnectionRefusedError: { - tError() << "TupWebHunter::slotError() - Network Error: Connection Refused!"; + #ifdef K_DEBUG + QString msg = "TupWebHunter::slotError() - Network Error: Connection Refused!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } break; case QNetworkReply::ContentNotFoundError: { - tError() << "TupWebHunter::slotError() - Network Error: Content not found!"; + #ifdef K_DEBUG + QString msg = "TupWebHunter::slotError() - Network Error: Content not found!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } break; case QNetworkReply::UnknownNetworkError: default: { - tError() << "TupWebHunter::slotError() - Network Error: Unknown Network error!"; + #ifdef K_DEBUG + QString msg = "TupWebHunter::slotError() - Network Error: Unknown Network error!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif } break; } diff -Nru tupi-0.2+git04/src/libbase/tupwebhunter.h tupi-0.2+git05/src/libbase/tupwebhunter.h --- tupi-0.2+git04/src/libbase/tupwebhunter.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libbase/tupwebhunter.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,18 +36,23 @@ #ifndef TUPWEBHUNTER_H #define TUPWEBHUNTER_H +#include "tglobal.h" #include "tapplicationproperties.h" #include "tupsvgitem.h" -#include +#include +#include #include #include #include #include #include #include +#include +#include +#include -class TupWebHunter : public QObject +class TUPI_EXPORT TupWebHunter : public QObject { Q_OBJECT diff -Nru tupi-0.2+git04/src/libtupi/libtupi.pri tupi-0.2+git05/src/libtupi/libtupi.pri --- tupi-0.2+git04/src/libtupi/libtupi.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/libtupi.pri 2014-12-15 14:21:33.000000000 +0000 @@ -1,4 +1,9 @@ -INCLUDEPATH += $$LIBTUPI_DIR - -LIBS += -L$$LIBTUPI_DIR -ltupi +unix { + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR -ltupi +} +win32 { + INCLUDEPATH += $$LIBTUPI_DIR + LIBS += -L$$LIBTUPI_DIR/release/ -ltupi +} \ No newline at end of file diff -Nru tupi-0.2+git04/src/libtupi/libtupi.pro tupi-0.2+git05/src/libtupi/libtupi.pro --- tupi-0.2+git04/src/libtupi/libtupi.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/libtupi.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,10 +1,14 @@ -# File generated by kdevelop\'s qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/libtupi -# Target is a library: tupi +QT += opengl core gui svg xml network -!include(../../tupiglobal.pri) { - error("Please configure first") +unix { + !include(../../tupiglobal.pri) { + error("Please configure first") + } +} + +win32 { + include(../../quazip.win.pri) + include(../../win.pri) } INSTALLS += target @@ -22,7 +26,7 @@ } HEADERS += tupgraphicalgorithm.h \ - tupglobal.h \ + # tupglobal.h \ tuppaintareaproperties.h \ tupgradientcreator.h \ tupgradientselector.h \ @@ -37,7 +41,7 @@ tupsocketbase.h \ tupxmlparserbase.h \ tupproxyitem.h \ - tupinthash.h \ + # tupinthash.h \ tuppenthicknesswidget.h SOURCES += tupgraphicalgorithm.cpp \ @@ -66,6 +70,3 @@ FRAMEWORK_DIR = "../framework" include($$FRAMEWORK_DIR/framework.pri) - -# QUAZIP_DIR = "../../3rdparty/quazip/" -# include($$QUAZIP_DIR/quazip.pri) diff -Nru tupi-0.2+git04/src/libtupi/tupbrushmanager.cpp tupi-0.2+git05/src/libtupi/tupbrushmanager.cpp --- tupi-0.2+git04/src/libtupi/tupbrushmanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupbrushmanager.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupbrushmanager.h" -#include "tdebug.h" /** * This class handles the set of brushes for painting. diff -Nru tupi-0.2+git04/src/libtupi/tupbrushmanager.h tupi-0.2+git05/src/libtupi/tupbrushmanager.h --- tupi-0.2+git04/src/libtupi/tupbrushmanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupbrushmanager.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,10 +36,11 @@ #ifndef TUPBRUSHMANAGER_H #define TUPBRUSHMANAGER_H +#include "tglobal.h" + #include #include #include -#include "tupglobal.h" /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/libtupi/tupcompress.cpp tupi-0.2+git05/src/libtupi/tupcompress.cpp --- tupi-0.2+git04/src/libtupi/tupcompress.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupcompress.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupcompress.h" -#include TupCompress::TupCompress() { diff -Nru tupi-0.2+git04/src/libtupi/tupcompress.h tupi-0.2+git05/src/libtupi/tupcompress.h --- tupi-0.2+git04/src/libtupi/tupcompress.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupcompress.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,17 @@ #ifndef TUPCOMPRESS_H #define TUPCOMPRESS_H +#include "tglobal.h" + #include +#include /** * This class (un)compress and (un)hash a string * @author David Cuadrado */ -class TupCompress +class TUPI_EXPORT TupCompress { public: TupCompress(); diff -Nru tupi-0.2+git04/src/libtupi/tupglobal.h tupi-0.2+git05/src/libtupi/tupglobal.h --- tupi-0.2+git04/src/libtupi/tupglobal.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupglobal.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez / xtingray * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPGLOBAL_H -#define TUPGLOBAL_H - -#include "tglobal.h" - -#define TUPI_EXPORT T_GUI_EXPORT - -#define LIBRARY_DIR CONFIG_DIR+"/libraries" - -/** - * This class defines enumerations used in the whole code of the project. - * - * @author David Cuadrado -*/ - -namespace Tupi -{ - enum RenderType - { - Image = 0, - OpenGL, - Native - }; - - enum MessageType - { - Information = 0, - Warning, - Error, - Critical - }; -}; - -#endif - diff -Nru tupi-0.2+git04/src/libtupi/tupgradientcreator.cpp tupi-0.2+git05/src/libtupi/tupgradientcreator.cpp --- tupi-0.2+git04/src/libtupi/tupgradientcreator.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgradientcreator.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tupgradientcreator.h" -#include "tdebug.h" -#include "tapplication.h" - -#include struct TupGradientCreator::Private { @@ -166,7 +162,12 @@ } } else { #ifdef K_DEBUG - tError() << "TupGradientCreator::setGradient() - Error: Brush has no gradient (null)"; + QString msg = "TupGradientCreator::setGradient() - Error: Brush has no gradient (null)"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } diff -Nru tupi-0.2+git04/src/libtupi/tupgradientcreator.h tupi-0.2+git05/src/libtupi/tupgradientcreator.h --- tupi-0.2+git04/src/libtupi/tupgradientcreator.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgradientcreator.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPGRADIENTMANAGER_H #define TUPGRADIENTMANAGER_H +#include "tglobal.h" + +#include "tapplication.h" #include "tupgradientselector.h" #include "tupgradientviewer.h" - #include "timagebutton.h" #include "tcirclebutton.h" #include "txyspinbox.h" -#include "tupglobal.h" #include #include diff -Nru tupi-0.2+git04/src/libtupi/tupgradientselector.cpp tupi-0.2+git05/src/libtupi/tupgradientselector.cpp --- tupi-0.2+git04/src/libtupi/tupgradientselector.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgradientselector.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,17 +34,16 @@ ***************************************************************************/ #include "tupgradientselector.h" -#include "tdebug.h" - -#include -#include -#include TupGradientSelector::TupGradientSelector(QWidget *parent) : QAbstractSlider(parent), m_currentArrowIndex(0), m_gradient(0,0,1,1), m_update(true), m_maxArrows(10), m_currentColor(Qt::black) -{ - #ifdef K_DEBUG - TINIT; +{ + #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qDebug() << "[TupGradientSelector()]"; + #else + TINIT; + #endif #endif _orientation = Qt::Horizontal; @@ -74,7 +73,11 @@ TupGradientSelector::~TupGradientSelector() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupGradientSelector()]"; + #else + TEND; + #endif #endif } diff -Nru tupi-0.2+git04/src/libtupi/tupgradientselector.h tupi-0.2+git05/src/libtupi/tupgradientselector.h --- tupi-0.2+git04/src/libtupi/tupgradientselector.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgradientselector.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,7 @@ #ifndef TUPGRADIENTSELECTOR_H #define TUPGRADIENTSELECTOR_H -#include "tupglobal.h" +#include "tglobal.h" #include #include @@ -49,7 +49,9 @@ #include #include #include - +#include +#include +#include #include /** @@ -67,7 +69,7 @@ private: - class TupGradientArrow : public QObject + class TUPI_EXPORT TupGradientArrow : public QObject { public: diff -Nru tupi-0.2+git04/src/libtupi/tupgradientviewer.cpp tupi-0.2+git05/src/libtupi/tupgradientviewer.cpp --- tupi-0.2+git04/src/libtupi/tupgradientviewer.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgradientviewer.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "tupgradientviewer.h" -#include "tdebug.h" - -#include -#include -#include class TupGradientViewer::ControlPoint { @@ -152,7 +147,12 @@ default: { #ifdef K_DEBUG - tError() << "TupGradientViewer::createGradient() - Fatal Error: the gradient type doesn't exists!"; + QString msg = "TupGradientViewer::createGradient() - Fatal Error: the gradient type doesn't exists!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -205,9 +205,14 @@ default: { #ifdef K_DEBUG - tError() << "TupGradientViewer::gradient() - Fatal error: the gradient type doesn't exists!"; + QString msg = "TupGradientViewer::gradient() - Fatal error: the gradient type doesn't exists!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif - } +} } gradientNormalized.setStops(m_gradientStops); @@ -274,9 +279,14 @@ break; } default: - { + { #ifdef K_DEBUG - tError() << "TupGradientViewer::setGradient() - Fatal Error: the gradient type doesn't exists!"; + QString msg = "TupGradientViewer::setGradient() - Fatal Error: the gradient type doesn't exists!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } diff -Nru tupi-0.2+git04/src/libtupi/tupgradientviewer.h tupi-0.2+git05/src/libtupi/tupgradientviewer.h --- tupi-0.2+git04/src/libtupi/tupgradientviewer.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgradientviewer.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,11 +36,14 @@ #ifndef TUPGRADIENTVIEWER_H #define TUPGRADIENTVIEWER_H -#include "tupglobal.h" +#include "tglobal.h" #include #include #include +#include +#include +#include /** * @if english diff -Nru tupi-0.2+git04/src/libtupi/tupgraphicalgorithm.cpp tupi-0.2+git05/src/libtupi/tupgraphicalgorithm.cpp --- tupi-0.2+git04/src/libtupi/tupgraphicalgorithm.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgraphicalgorithm.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -44,15 +44,10 @@ #include "tupgraphicalgorithm.h" -#include - #ifndef M_PI #define M_PI 3.14159265358979323846 #endif -#include "tdebug.h" -#include - #define MAXPOINTS 1000 /* The most points you can have */ class FitVector diff -Nru tupi-0.2+git04/src/libtupi/tupgraphicalgorithm.h tupi-0.2+git05/src/libtupi/tupgraphicalgorithm.h --- tupi-0.2+git04/src/libtupi/tupgraphicalgorithm.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupgraphicalgorithm.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,17 +33,15 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef __TUPGRAPHICALGORITHM_H__ -#define __TUPGRAPHICALGORITHM_H__ +#ifndef TUPGRAPHICALGORITHM_H +#define TUPGRAPHICALGORITHM_H +#include "tglobal.h" + +#include #include #include #include -#include "tupglobal.h" - -/** - * @author Jorge Cuadrado - */ class TUPI_EXPORT TupGraphicalAlgorithm { diff -Nru tupi-0.2+git04/src/libtupi/tupinputdeviceinformation.cpp tupi-0.2+git05/src/libtupi/tupinputdeviceinformation.cpp --- tupi-0.2+git04/src/libtupi/tupinputdeviceinformation.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupinputdeviceinformation.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "tupinputdeviceinformation.h" -#include "tdebug.h" - -#include -#include -#include /** * This class captures and process all the mouse/tablet events. @@ -112,7 +107,7 @@ void TupInputDeviceInformation::updateFromTabletEvent(QTabletEvent *event) { - tError() << "updateFromTabletEvent() - Pressure: " << event->pressure(); + // tError() << "updateFromTabletEvent() - Pressure: " << event->pressure(); k->tabletInfo.pressure = event->pressure(); k->tabletInfo.rotation = event->rotation(); @@ -125,7 +120,7 @@ double TupInputDeviceInformation::pressure() const { - tError() << "TupInputDeviceInformation::pressure() - Testing pressure: " << k->tabletInfo.pressure; + //tError() << "TupInputDeviceInformation::pressure() - Testing pressure: " << k->tabletInfo.pressure; return k->tabletInfo.pressure; } diff -Nru tupi-0.2+git04/src/libtupi/tupinputdeviceinformation.h tupi-0.2+git05/src/libtupi/tupinputdeviceinformation.h --- tupi-0.2+git04/src/libtupi/tupinputdeviceinformation.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupinputdeviceinformation.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,10 +36,13 @@ #ifndef TUPINPUTDEVICEINFORMATION_H #define TUPINPUTDEVICEINFORMATION_H -#include "tupglobal.h" +#include "tglobal.h" #include #include +#include +#include +#include class QGraphicsSceneMouseEvent; class QMouseEvent; diff -Nru tupi-0.2+git04/src/libtupi/tupinthash.h tupi-0.2+git05/src/libtupi/tupinthash.h --- tupi-0.2+git04/src/libtupi/tupinthash.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupinthash.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,263 +0,0 @@ -/*************************************************************************** - * Project TUPI: Magia 2D * - * Project Contact: info@maefloresta.com * - * Project Website: http://www.maefloresta.com * - * Project Leader: Gustav Gonzalez * - * * - * Developers: * - * 2010: * - * Gustavo Gonzalez * - * * - * KTooN's versions: * - * * - * 2006: * - * David Cuadrado * - * Jorge Cuadrado * - * 2003: * - * Fernado Roldan * - * Simena Dinas * - * * - * Copyright (C) 2010 Gustav Gonzalez - http://www.maefloresta.com * - * License: * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - ***************************************************************************/ - -#ifndef TUPINTHASH_H -#define TUPINTHASH_H - -#include - -/** - * @author David Cuadrado -*/ - -template -class TupIntHash -{ - public: - TupIntHash(); - TupIntHash(const TupIntHash &other); - ~TupIntHash(); - - void removeObject(int pos); - void remove(int pos); - void copyObject(int from, int to); - void exchangeObject(int from, int to); - - int objectIndex(T val); - - T value(int pos); - T takeObject(int pos); - - void clear(bool alsoDelete = false) - { - k->dataHash.clear(); - - if (alsoDelete) - qDeleteAll(k->dataHash); - - k->counter = 0; - } - - int count() const - { - return k->dataHash.count(); - } - - bool contains(int pos); - - void insert(int pos, T value); - void add(T value); - - void expandValue(int index, int times); - - T operator[](int index) const; - QList values() const; - - QList indexes() const; - - bool isEmpty(); - - public: - TupIntHash &operator=(const TupIntHash &other); - - private: - struct Private; - Private *const k; -}; - -template -struct TupIntHash::Private -{ - Private() : counter(0) {} - QHash dataHash; - int counter; -}; - -template -TupIntHash::TupIntHash() : k(new Private) -{ -} - -template -TupIntHash::TupIntHash(const TupIntHash &other) : k(new Private) -{ - k->dataHash = other.k->dataHash; - k->counter = other.k->counter; -} - -template -TupIntHash::~TupIntHash() -{ - delete k; -} - -template -void TupIntHash::removeObject(int pos) -{ - if (contains(pos)) { - k->dataHash.remove(pos); - k->counter--; - } -} - -template -bool TupIntHash::contains(int pos) -{ - return k->dataHash.contains(pos); -} - -template -void TupIntHash::copyObject(int from, int to) -{ - if (contains(from) && contains(to)) { - T fromValue = this->value(from); - this->insert(to, fromValue); - } -} - -template -void TupIntHash::exchangeObject(int from, int to) -{ - if (contains(from) && contains(to)) { - T fromValue = this->value(from); - T toValue = this->value(to); - this->insert(to, fromValue); - this->insert(from, toValue); - } -} - -template -TupIntHash &TupIntHash::operator=(const TupIntHash &other) -{ - k->dataHash = other.k->dataHash; - k->counter = other.k->counter; - - return *this; -} - -template -int TupIntHash::objectIndex(T val) -{ - return k->dataHash.key(val); -} - -template -T TupIntHash::value(int pos) -{ - if (contains(pos)) - return k->dataHash.value(pos); - - return k->dataHash.value(-1); -} - -template -T TupIntHash::takeObject(int pos) -{ - if (contains(pos)) - return k->dataHash.take(pos); - - return k->dataHash.take(-1); -} - -template -void TupIntHash::insert(int pos, T value) -{ - if (k->dataHash.contains(pos)) - qDebug("###### OVERRIDING!! %d", pos); - else - k->counter++; - - k->dataHash.insert(pos, value); -} - -template -void TupIntHash::remove(int pos) -{ - if (contains(pos)) { - if (pos == count()-1) { - k->dataHash.remove(pos); - } else { - int total = count() - 1; - for (int i=pos+1;i<=total;i++) { - T value = this->takeObject(i); - int index = i - 1; - k->dataHash.insert(index, value); - } - } - k->counter--; - } -} - -template -void TupIntHash::add(T value) -{ - this->insert(k->counter, value); -} - -template -void TupIntHash::expandValue(int index, int times) -{ - int limit = index + times; - T value = this->value(index); - - for (int i=index+1; i<=limit; i++) - k->dataHash.insert(i, value); -} - -template -T TupIntHash::operator[](int index) const -{ - return k->dataHash.value(index); -} - -template -QList TupIntHash::values() const -{ - return k->dataHash.values(); -} - -template -QList TupIntHash::indexes() const -{ - return k->dataHash.keys(); -} - -template -bool TupIntHash::isEmpty() -{ - return k->dataHash.isEmpty(); -} - -#endif diff -Nru tupi-0.2+git04/src/libtupi/tupitempreview.cpp tupi-0.2+git05/src/libtupi/tupitempreview.cpp --- tupi-0.2+git04/src/libtupi/tupitempreview.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupitempreview.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tupitempreview.h" -#include "tupproxyitem.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include struct TupItemPreview::Private { @@ -67,15 +59,17 @@ QSize TupItemPreview::sizeHint() const { + /* if (k->proxy) { int maxY = k->proxy->boundingRect().size().height(); if (maxY < 100) return k->proxy->boundingRect().size().toSize() + QSize(10, 110 - maxY); else - return k->proxy->boundingRect().size().toSize() + QSize(10,10); + return k->proxy->boundingRect().size().toSize() + QSize(10, 10); } + */ - return QWidget::sizeHint().expandedTo(QSize(100,100)); + return QWidget::sizeHint().expandedTo(QSize(100, 100)); } void TupItemPreview::render(QGraphicsItem *item) @@ -114,7 +108,6 @@ // If preview is for a "path" object if (QGraphicsPathItem *path = qgraphicsitem_cast(k->proxy->item())) { - int pathWidth = path->path().boundingRect().width(); int pathHeight = path->path().boundingRect().height(); @@ -151,16 +144,12 @@ newPosX = -path->path().boundingRect().topLeft().x(); newPosY = -path->path().boundingRect().topLeft().y(); painter.translate(newPosX, newPosY); - } else { // if object is smaller than canvas, just show it - painter.translate((rect().width() - pathWidth)/2, (rect().height() - pathHeight)/2); painter.translate(-path->path().boundingRect().topLeft().x(), -path->path().boundingRect().topLeft().y()); - } - - } else { // if preview is for images or svg objects - + } else { + // if preview is for images or svg objects // if object is bigger than canvas, resize if (opt.exposedRect.width() > rect().width() || opt.exposedRect.height() > rect().height()) { float distance = 0; diff -Nru tupi-0.2+git04/src/libtupi/tupitempreview.h tupi-0.2+git05/src/libtupi/tupitempreview.h --- tupi-0.2+git04/src/libtupi/tupitempreview.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupitempreview.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,15 @@ #ifndef TUPITEMPREVIEW_H #define TUPITEMPREVIEW_H +#include "tglobal.h" +#include "tupproxyitem.h" + #include +#include +#include +#include +#include +#include class QGraphicsItem; @@ -45,7 +53,7 @@ * @author David Cuadrado */ -class TupItemPreview : public QWidget +class TUPI_EXPORT TupItemPreview : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/libtupi/tuppackagehandler.cpp tupi-0.2+git05/src/libtupi/tuppackagehandler.cpp --- tupi-0.2+git04/src/libtupi/tuppackagehandler.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tuppackagehandler.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,15 +34,6 @@ ***************************************************************************/ #include "tuppackagehandler.h" -#include "quazip.h" -#include "quazipfile.h" -#include "tdebug.h" -#include "tglobal.h" -#include "tapplicationproperties.h" - -#include -#include -#include /** * This class manages the file format for Tupi projects. @@ -66,27 +57,48 @@ bool TupPackageHandler::makePackage(const QString &projectPath, const QString &packagePath) { - if (!QFile::exists(projectPath)) { + if (!QFile::exists(projectPath)) { #ifdef K_DEBUG - tError() << "TupPackageHandler::makePackage() - Project path doesn't exist -> " << projectPath; + QString msg = "TupPackageHandler::makePackage() - Project path doesn't exist -> " + projectPath; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } + + // SQA: This code will be enabled in the future + // return JlCompress::compressDir(packagePath, projectPath, true); QFileInfo packageInfo(packagePath); QuaZip zip(packagePath); if (!zip.open(QuaZip::mdCreate)) { #ifdef K_DEBUG - tError() << "TupPackageHandler::makePackage() - Error while create package: " << zip.getZipError(); + QString msg = "TupPackageHandler::makePackage() - Error while create package: " + QString::number(zip.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } if (! compress(&zip, projectPath)) { #ifdef K_DEBUG - tError() << "TupPackageHandler::makePackage() - Error while compress project" << zip.getZipError(); + QString msg = "TupPackageHandler::makePackage() - Error while compress project: " + QString::number(zip.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } @@ -94,8 +106,14 @@ if (zip.getZipError() != 0) { #ifdef K_DEBUG - tError() << "TupPackageHandler::makePackage() - Error: " << zip.getZipError(); + QString msg = "TupPackageHandler::makePackage() - Error: " + QString::number(zip.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } @@ -128,8 +146,14 @@ if (!inFile.open(QIODevice::ReadOnly)) { #ifdef K_DEBUG - tError() << "Error opening file " << inFile.fileName() << " : " << inFile.errorString(); + QString msg = "Error opening file " + inFile.fileName() + " : " + inFile.errorString(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } @@ -161,12 +185,36 @@ bool TupPackageHandler::importPackage(const QString &packagePath) { + /* SQA: Handy code to include in the future + QFileInfo file(packagePath); + k->importedProjectPath = CACHE_DIR + file.baseName(); + QStringList list = JlCompress::extractDir(packagePath, k->importedProjectPath); + if (list.size() == 0) { + #ifdef K_DEBUG + QString msg = "TupPackageHandler::importPackage() - Project file is empty! -> " + packagePath; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + + return false; + } + */ + QuaZip zip(packagePath); if (!zip.open(QuaZip::mdUnzip)) { #ifdef K_DEBUG - tDebug() << "TupPackageHandler::importPackage() - Error while open package: " << zip.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Error while open package: " + QString::number(zip.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } @@ -180,22 +228,39 @@ bool next = zip.goToFirstFile(); while (next) { - if (!zip.getCurrentFileInfo(&info)) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Can't get current file: " << zip.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Can't get current file: " + QString::number(zip.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } if (!file.open(QIODevice::ReadOnly)) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Can't open file "<< file.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Can't open file " + QString::number(file.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } - - name = CACHE_DIR + file.getActualFileName(); + + #ifdef Q_OS_WIN32 + name = file.getActualFileName(); + #else + name = CACHE_DIR + file.getActualFileName(); + #endif + + // name = CACHE_DIR + file.getActualFileName(); if (name.endsWith(QDir::separator())) name.remove(name.count()-1, 1); @@ -203,23 +268,38 @@ if (name.endsWith(".tpp")) k->importedProjectPath = QFileInfo(name).path(); - if (file.getZipError() != UNZ_OK) { + if (file.getZipError() != UNZ_OK) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Error while open package " << file.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Error while open package " + QString::number(file.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } if (createPath(name)) { - out.setFileName(name); - if (! out.open(QIODevice::WriteOnly)) { + if (! out.open(QIODevice::WriteOnly)) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Error while open file: " << out.fileName(); - tError() << "TupPackageHandler::importPackage() - Error Description: " << out.errorString(); - tError() << "TupPackageHandler::importPackage() - Error type: " << out.error(); - #endif + QString msg1 = "TupPackageHandler::importPackage() - Error while open file: " + out.fileName(); + QString msg2 = "TupPackageHandler::importPackage() - Error Description: " + out.errorString(); + QString msg3 = "TupPackageHandler::importPackage() - Error type: " + QString::number(out.error()); + #ifdef Q_OS_WIN32 + qDebug() << msg1; + qDebug() << msg2; + qDebug() << msg3; + #else + tError() << msg1; + tError() << msg2; + tError() << msg3; + #endif + #endif + return false; } @@ -227,23 +307,39 @@ out.putChar(c); out.close(); - } else { + } else { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Error creating path: " << name; + QString msg = "TupPackageHandler::importPackage() - Error creating path: " + name; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + return false; } if (file.getZipError()!=UNZ_OK) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Error while open package " << file.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Error while open package " + QString::number(file.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } if (!file.atEnd()) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Not EOF Error"; + QString msg = "TupPackageHandler::importPackage() - Not EOF Error"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -252,7 +348,12 @@ if (file.getZipError()!=UNZ_OK) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Error while open package " << file.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Error while open package " + QString::number(file.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -264,7 +365,12 @@ if (zip.getZipError() != UNZ_OK) { #ifdef K_DEBUG - tError() << "TupPackageHandler::importPackage() - Error while open package " << file.getZipError(); + QString msg = "TupPackageHandler::importPackage() - Error while open package " + QString::number(file.getZipError()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return false; } @@ -277,7 +383,7 @@ QFileInfo info(filePath); QDir path = info.dir(); QString target = path.path(); - + if (!path.exists()) return path.mkpath(target); else diff -Nru tupi-0.2+git04/src/libtupi/tuppackagehandler.h tupi-0.2+git05/src/libtupi/tuppackagehandler.h --- tupi-0.2+git04/src/libtupi/tuppackagehandler.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tuppackagehandler.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,11 +36,20 @@ #ifndef TUPPACKAGEHANDLER_H #define TUPPACKAGEHANDLER_H -#include "tupglobal.h" +#include "tglobal.h" +#include "tapplicationproperties.h" +#include "quazip.h" +#include "quazipfile.h" + +// SQA: Pending to enable in the future +// #include #include +#include +#include +#include -class QuaZip; +// class QuaZip; /** * @author David Cuadrado diff -Nru tupi-0.2+git04/src/libtupi/tuppaintareaproperties.h tupi-0.2+git05/src/libtupi/tuppaintareaproperties.h --- tupi-0.2+git04/src/libtupi/tuppaintareaproperties.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tuppaintareaproperties.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,7 @@ #ifndef TUPPAINTAREAPROPERTIES_H #define TUPPAINTAREAPROPERTIES_H -#include "tupglobal.h" +#include "tglobal.h" #include /** diff -Nru tupi-0.2+git04/src/libtupi/tuppenthicknesswidget.cpp tupi-0.2+git05/src/libtupi/tuppenthicknesswidget.cpp --- tupi-0.2+git04/src/libtupi/tuppenthicknesswidget.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tuppenthicknesswidget.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tuppenthicknesswidget.h" -#include "tdebug.h" struct TupPenThicknessWidget::Private { @@ -104,7 +103,8 @@ painter.fillRect(0, 0, width(), height(), QColor(255, 255, 255)); QPen border(QColor(0, 0, 0)); - border.setWidth(0.5); + // border.setWidth(0.5); + border.setWidth(1); painter.setPen(border); painter.drawRect(0, 0, width(), height()); @@ -123,7 +123,15 @@ // tFatal() << "TupPenThicknessWidget::paintEvent() - Setting gradient brush"; brush = k->currentBrush; } else { - // tFatal() << "TupPenThicknessWidget::paintEvent() - Warning! NO gradient!"; + #ifdef K_DEBUG + QString msg = "TupPenThicknessWidget::paintEvent() - Warning! NO gradient!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif + #endif + return; } } QPen pen(Qt::NoPen); diff -Nru tupi-0.2+git04/src/libtupi/tuppenthicknesswidget.h tupi-0.2+git05/src/libtupi/tuppenthicknesswidget.h --- tupi-0.2+git04/src/libtupi/tuppenthicknesswidget.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tuppenthicknesswidget.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,6 +36,7 @@ #ifndef TUPPENTHICKNESSWIDGET_H #define TUPPENTHICKNESSWIDGET_H +#include "tglobal.h" #include "tapplicationproperties.h" #include @@ -49,7 +50,7 @@ * @author Gustav Gonzalez **/ -class TupPenThicknessWidget : public QWidget +class TUPI_EXPORT TupPenThicknessWidget : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/libtupi/tupprojectactionbar.cpp tupi-0.2+git05/src/libtupi/tupprojectactionbar.cpp --- tupi-0.2+git04/src/libtupi/tupprojectactionbar.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupprojectactionbar.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tupprojectactionbar.h" -#include "tupglobal.h" -#include "tdebug.h" -#include "tseparator.h" -#include "tconfig.h" -#include "toptionaldialog.h" -#include "timagebutton.h" - -#include -#include -#include -#include struct TupProjectActionBar::Private { @@ -105,9 +94,8 @@ if (actions & InsertLayer) { TImageButton *button = new TImageButton(QIcon(THEME_DIR + "icons/add_layer.png"), size); - button->setToolTip(tr("Insert a layer")); + button->setToolTip(tr("Insert layer")); button->setShortcut(QKeySequence(tr("F5"))); - //button->setEnabled(false); k->actions.addButton(button, InsertLayer); @@ -117,9 +105,8 @@ if (actions & RemoveLayer) { TImageButton *button = new TImageButton(QIcon(THEME_DIR + "icons/remove_layer.png"), size); - button->setToolTip(tr("Remove the layer")); + button->setToolTip(tr("Remove layer")); button->setShortcut(QKeySequence(tr("F6"))); - //button->setEnabled(false); k->actions.addButton(button, RemoveLayer); @@ -157,7 +144,8 @@ if (actions & InsertFrame) { TImageButton *button = new TImageButton(QIcon(THEME_DIR + "icons/add_frame.png"), size); button->setToolTip(tr("Insert frame")); - button->setShortcut(QKeySequence(Qt::Key_Plus)); + // SQA: This short-cut has been moved to Zoom In feature + // button->setShortcut(QKeySequence(Qt::Key_Plus)); k->actions.addButton(button, InsertFrame); @@ -167,8 +155,9 @@ if (actions & RemoveFrame) { TImageButton *button = new TImageButton(QIcon(THEME_DIR + "icons/remove_frame.png"), size); - button->setToolTip(tr("Remove the frame")); - button->setShortcut(QKeySequence(Qt::Key_Minus)); + button->setToolTip(tr("Remove frame")); + // SQA: This short-cut has been moved to Zoom Out feature + // button->setShortcut(QKeySequence(Qt::Key_Minus)); k->actions.addButton(button, RemoveFrame); @@ -176,7 +165,7 @@ button->setAnimated(k->isAnimated); } - if (actions & MoveFrameUp) { + if (actions & MoveFrameBackward) { TImageButton *button = 0; if (k->container.compare("Exposure") == 0) { button = new TImageButton(QIcon(THEME_DIR + "icons/move_frame_up.png"), size); @@ -185,16 +174,16 @@ button = new TImageButton(QIcon(THEME_DIR + "icons/move_frame_backward.png"), size); } - button->setToolTip(tr("Move frame up")); + button->setToolTip(tr("Move frame backward")); button->setShortcut(QKeySequence(tr("F8"))); - k->actions.addButton(button, MoveFrameUp); + k->actions.addButton(button, MoveFrameBackward); k->buttonLayout->addWidget(button); button->setAnimated(k->isAnimated); } - if (actions & MoveFrameDown) { + if (actions & MoveFrameForward) { TImageButton *button = 0; if (k->container.compare("Exposure") == 0) { @@ -204,10 +193,10 @@ button = new TImageButton(QIcon(THEME_DIR + "icons/move_frame_forward.png"), size); } - button->setToolTip(tr("Move frame down")); + button->setToolTip(tr("Move frame forward")); button->setShortcut(QKeySequence(tr("F9"))); - k->actions.addButton(button, MoveFrameDown); + k->actions.addButton(button, MoveFrameForward); k->buttonLayout->addWidget(button); button->setAnimated(k->isAnimated); @@ -236,7 +225,7 @@ if (actions & InsertScene) { TImageButton *button = new TImageButton(QIcon(THEME_DIR + "icons/add_scene.png"), size); // TODO - button->setToolTip(tr("Insert a scene")); + button->setToolTip(tr("Insert scene")); k->actions.addButton(button, InsertScene); @@ -246,7 +235,7 @@ if (actions & RemoveScene) { TImageButton *button = new TImageButton(QIcon(THEME_DIR + "icons/remove_scene.png"), size); // TODO - button->setToolTip(tr("Remove the scene")); + button->setToolTip(tr("Remove scene")); k->actions.addButton(button, RemoveScene); diff -Nru tupi-0.2+git04/src/libtupi/tupprojectactionbar.h tupi-0.2+git05/src/libtupi/tupprojectactionbar.h --- tupi-0.2+git04/src/libtupi/tupprojectactionbar.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupprojectactionbar.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,11 +36,19 @@ #ifndef TUPPROJECTACTIONBAR_H #define TUPPROJECTACTIONBAR_H -#include "tupglobal.h" +#include "tglobal.h" #include "tapplicationproperties.h" +#include "tseparator.h" +#include "tconfig.h" +#include "toptionaldialog.h" +#include "timagebutton.h" #include #include +#include +#include +#include +#include class TImageButton; class QBoxLayout; @@ -60,8 +68,8 @@ InsertFrame = 1 << 1, RemoveFrame = 1 << 2, - MoveFrameUp = 1 << 3, - MoveFrameDown = 1 << 4, + MoveFrameBackward = 1 << 3, + MoveFrameForward = 1 << 4, LockFrame = 1 << 5, InsertLayer = 1 << 6, @@ -77,11 +85,11 @@ LockScene = 1 << 15, Separator = 1 << 16, - AllActions = InsertFrame | RemoveFrame | MoveFrameUp | MoveFrameDown | LockFrame | InsertLayer | RemoveLayer + AllActions = InsertFrame | RemoveFrame | MoveFrameBackward | MoveFrameForward | LockFrame | InsertLayer | RemoveLayer | MoveLayerUp | MoveLayerDown | InsertScene | RemoveScene | MoveSceneUp | MoveSceneDown, - FrameActions = InsertFrame | RemoveFrame | MoveFrameUp | MoveFrameDown, - LayerActions = InsertLayer | RemoveLayer | MoveLayerUp | MoveLayerDown, + FrameActions = InsertFrame | RemoveFrame | MoveFrameBackward | MoveFrameForward | LockFrame, + LayerActions = InsertLayer | RemoveLayer | MoveLayerUp | MoveLayerDown | LockLayer, SceneActions = InsertScene | RemoveScene | MoveSceneUp | MoveSceneDown }; diff -Nru tupi-0.2+git04/src/libtupi/tupproxyitem.cpp tupi-0.2+git05/src/libtupi/tupproxyitem.cpp --- tupi-0.2+git04/src/libtupi/tupproxyitem.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupproxyitem.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,9 +34,6 @@ ***************************************************************************/ #include "tupproxyitem.h" -#include "tdebug.h" - -#include /** * This class defines a copy of a graphic object. @@ -87,7 +84,7 @@ return QRectF(0, 0, 0, 0); } -void TupProxyItem::paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) +void TupProxyItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * option, QWidget * widget) { if (k->realItem) k->realItem->paint(painter, option, widget); diff -Nru tupi-0.2+git04/src/libtupi/tupproxyitem.h tupi-0.2+git05/src/libtupi/tupproxyitem.h --- tupi-0.2+git04/src/libtupi/tupproxyitem.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupproxyitem.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,16 @@ #ifndef TUPPROXYITEM_H #define TUPPROXYITEM_H +#include "tglobal.h" + #include +#include /** * @author David Cuadrado */ -class TupProxyItem : public QGraphicsItem +class TUPI_EXPORT TupProxyItem : public QGraphicsItem { public: TupProxyItem(QGraphicsItem *item = 0); diff -Nru tupi-0.2+git04/src/libtupi/tupsocketbase.cpp tupi-0.2+git05/src/libtupi/tupsocketbase.cpp --- tupi-0.2+git04/src/libtupi/tupsocketbase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupsocketbase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,10 +34,6 @@ ***************************************************************************/ #include "tupsocketbase.h" -#include "tdebug.h" - -#include -#include struct TupSocketBase::Private { @@ -73,8 +69,6 @@ void TupSocketBase::send(const QString &message) { - tError() << "TupSocketBase::send() - message: " << message; - if (state() == QAbstractSocket::ConnectedState) { QTextStream stream(this); stream.setCodec("UTF-8"); diff -Nru tupi-0.2+git04/src/libtupi/tupsocketbase.h tupi-0.2+git05/src/libtupi/tupsocketbase.h --- tupi-0.2+git04/src/libtupi/tupsocketbase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupsocketbase.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,8 +36,10 @@ #ifndef TUPSOCKETBASE_H #define TUPSOCKETBASE_H -#include "tupglobal.h" +#include "tglobal.h" +#include +#include #include #include diff -Nru tupi-0.2+git04/src/libtupi/tupsvg2qt.cpp tupi-0.2+git05/src/libtupi/tupsvg2qt.cpp --- tupi-0.2+git04/src/libtupi/tupsvg2qt.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupsvg2qt.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,14 +34,11 @@ ***************************************************************************/ #include "tupsvg2qt.h" -#include #ifndef M_PI #define M_PI 3.14159265358979323846 #endif -#include "tdebug.h" - TupSvg2Qt::TupSvg2Qt() { } @@ -198,9 +195,8 @@ QList points; QString temp; - while ((*itr).isSpace()) { - ++itr; - } + while ((*itr).isSpace()) + ++itr; while ((*itr).isNumber() || (*itr) == QLatin1Char('-') || (*itr) == QLatin1Char('+') || (*itr) == QLatin1Char('.')) { @@ -233,9 +229,8 @@ while ((*itr).isSpace()) ++itr; - if ((*itr) == QLatin1Char(',')) { + if ((*itr) == QLatin1Char(',')) ++itr; - } bool ok = false; qreal number = temp.toDouble(&ok); @@ -246,9 +241,47 @@ points.append(0.0f); // eat the rest of space - while ((*itr).isSpace()) { + while ((*itr).isSpace()) ++itr; - } + } + + return points; +} + +QList TupSvg2Qt::parseIntList(QString::const_iterator &itr) +{ + QList points; + QString temp; + + while ((*itr).isSpace()) + ++itr; + + while ((*itr).isNumber()) { + temp = QString(); + + while ((*itr).isDigit()) + temp += *itr++; + + while ((*itr).isDigit()) + temp += *itr++; + + while ((*itr).isSpace()) + ++itr; + + if ((*itr) == QLatin1Char(',')) + ++itr; + + bool ok = false; + int number = temp.toInt(&ok); + + if (ok) + points.append(number); + else + points.append(0); + + // eat the rest of space + while ((*itr).isSpace()) + ++itr; } return points; @@ -278,7 +311,8 @@ qreal offsetX = x; // correction offsets qreal offsetY = y; // for relative commands - switch (pathElem.toAscii()) { + // switch (pathElem.toAscii()) { + switch (pathElem.toLatin1()) { case 'm': { x = x0 = arg[0] + offsetX; @@ -500,7 +534,8 @@ break; } - lastMode = pathElem.toAscii(); + // lastMode = pathElem.toAscii(); + lastMode = pathElem.toLatin1(); } } diff -Nru tupi-0.2+git04/src/libtupi/tupsvg2qt.h tupi-0.2+git05/src/libtupi/tupsvg2qt.h --- tupi-0.2+git04/src/libtupi/tupsvg2qt.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupsvg2qt.h 2014-12-15 14:21:33.000000000 +0000 @@ -32,15 +32,18 @@ * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ + #ifndef TUPSVG2QT_H #define TUPSVG2QT_H +#include "tglobal.h" + +#include #include #include #include #include #include -#include "tupglobal.h" /** * @author David Cuadrado @@ -61,6 +64,7 @@ static bool parseBrush(QBrush &brush, const QXmlAttributes &attributes); static QList parseNumbersList(QString::const_iterator &itr); + static QList parseIntList(QString::const_iterator &itr); }; #endif diff -Nru tupi-0.2+git04/src/libtupi/tupxmlparserbase.cpp tupi-0.2+git05/src/libtupi/tupxmlparserbase.cpp --- tupi-0.2+git04/src/libtupi/tupxmlparserbase.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupxmlparserbase.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupxmlparserbase.h" -#include "tdebug.h" struct TupXmlParserBase::Private { @@ -111,15 +110,34 @@ bool TupXmlParserBase::error(const QXmlParseException & exception) { - tWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); - tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; +#ifdef K_DEBUG + #ifdef Q_OS_WIN32 + QString msg1 = exception.lineNumber() + QString("x") + exception.columnNumber() + QString(": ") + exception.message(); + qDebug() << msg1; + #else + tWarning() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); + tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; + #endif +#else + Q_UNUSED(exception); +#endif return true; } bool TupXmlParserBase::fatalError(const QXmlParseException & exception) { - tFatal() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); - tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; +#ifdef K_DEBUG + #ifdef Q_OS_WIN32 + QString msg1 = exception.lineNumber() + QString("x") + exception.columnNumber() + QString(": ") + exception.message(); + qDebug() << msg1; + #else + tFatal() << exception.lineNumber() << "x" << exception.columnNumber() << ": " << exception.message(); + tWarning() << __PRETTY_FUNCTION__ << " Document: " << k->document; + #endif +#else + Q_UNUSED(exception); +#endif + return true; } @@ -139,6 +157,7 @@ } QString TupXmlParserBase::root() const + { return k->root; } @@ -158,12 +177,18 @@ return reader.parse(&xmlsource); } - bool TupXmlParserBase::parse(QFile *file) { if (!file->isOpen()) { if (! file->open(QIODevice::ReadOnly | QIODevice::Text)) { - tWarning() << "Cannot open file " << file->fileName(); +#ifdef K_DEBUG + QString msg = "TupXmlParserBase::parse() - Cannot open file " + file->fileName(); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tWarning() << msg; + #endif +#endif return false; } } diff -Nru tupi-0.2+git04/src/libtupi/tupxmlparserbase.h tupi-0.2+git05/src/libtupi/tupxmlparserbase.h --- tupi-0.2+git04/src/libtupi/tupxmlparserbase.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libtupi/tupxmlparserbase.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPXMLPARSERBASE_H #define TUPXMLPARSERBASE_H +#include "tglobal.h" + #include /** * @author David Cuadrado */ -class TupXmlParserBase : public QXmlDefaultHandler +class TUPI_EXPORT TupXmlParserBase : public QXmlDefaultHandler { public: ~TupXmlParserBase(); diff -Nru tupi-0.2+git04/src/libui/libui.pri tupi-0.2+git05/src/libui/libui.pri --- tupi-0.2+git04/src/libui/libui.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/libui.pri 2014-12-15 14:21:33.000000000 +0000 @@ -1,9 +1,14 @@ ANIMATION_DIR = ../components/animation - INCLUDEPATH += $$LIBUI_DIR INCLUDEPATH += $$ANIMATION_DIR -LIBS += -L$$LIBUI_DIR -ltupigui +unix { + LIBS += -L$$LIBUI_DIR -ltupigui +} + +win32 { + LIBS += -L$$LIBUI_DIR/release/ -ltupigui +} linux-g++ { PRE_TARGETDEPS += $$LIBUI_DIR/libtupigui.so diff -Nru tupi-0.2+git04/src/libui/libui.pro tupi-0.2+git05/src/libui/libui.pro --- tupi-0.2+git04/src/libui/libui.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/libui.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,10 +1,14 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/libui -# Target is a library: ui +QT += opengl core gui svg xml network -!include(../../tupiglobal.pri) { - error("Please configure first") +unix { + !include(../../tupiglobal.pri) { + error("Please configure first") + } +} + +win32 { + include(../../quazip.win.pri) + include(../../win.pri) } INSTALLS += images images-en diff -Nru tupi-0.2+git04/src/libui/tupabout.cpp tupi-0.2+git05/src/libui/tupabout.cpp --- tupi-0.2+git04/src/libui/tupabout.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tupabout.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,17 +34,6 @@ ***************************************************************************/ #include "tupabout.h" -#include "tglobal.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include -#include -#include /** * This class defines the About dialog of Tupi. @@ -54,15 +43,20 @@ TupAbout::TupAbout(QWidget *parent) : TabDialog(Cancel, parent) { + // SQA: Check if these instructions are doing something for real setWindowIcon(QIcon(THEME_DIR + "icons" + QDir::separator() + "about.png")); - setWindowTitle(tr("About Tupi")); + setWindowTitle(tr("About Tupi")); setFixedSize(525, 458); QStringList path; - QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); +#ifdef Q_OS_WIN32 + QString resources = SHARE_DIR + "help" + QDir::separator(); +#else + QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator(); +#endif path << resources + "css"; path << resources + "images"; - + QString lang = "en"; if (QString(QLocale::system().name()).length() > 1) lang = QString(QLocale::system().name()).left(2); @@ -81,14 +75,24 @@ if (!file.open(QIODevice::ReadOnly)) { #ifdef K_DEBUG - tError() << "TupAbout::TupAbout() - Fatal Error: Can't open \"credits.xml\" file"; + QString msg = "TupAbout::TupAbout() - Fatal Error: Can't open \"credits.xml\" file"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif return; } if (!doc.setContent(&file)) { #ifdef K_DEBUG - tError() << "TupAbout::TupAbout() - Fatal Error: File \"credits.xml\" is corrupt!"; + QString msg = "TupAbout::TupAbout() - Fatal Error: File \"credits.xml\" is corrupt!"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif file.close(); return; @@ -117,32 +121,49 @@ // Acknowledgment Tab + QString sponsorFile = QString() + "help" + QDir::separator() + lang + QDir::separator() + "thanks.html"; +#ifdef Q_OS_WIN32 + QString sponsorPath = SHARE_DIR + sponsorFile; +#else + QString sponsorPath = SHARE_DIR + "data" + QDir::separator() + sponsorFile; +#endif QTextBrowser *sponsorsText = new QTextBrowser; sponsorsText->setSearchPaths(path); sponsorsText->setOpenExternalLinks(true); - sponsorsText->setSource(SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator() + lang + QDir::separator() + "thanks.html"); + sponsorsText->setSource(QUrl::fromLocalFile(sponsorPath)); sponsorsText->moveCursor(QTextCursor::Start); addTab(sponsorsText, tr("Thanks")); // Tupi Description Tab + QString tupiFile = QString() + "help" + QDir::separator() + lang + QDir::separator() + "tupi_short.html"; +#ifdef Q_OS_WIN32 + QString tupiPath = SHARE_DIR + tupiFile; +#else + QString tupiPath = SHARE_DIR + "data" + QDir::separator() + tupiFile; +#endif QTextBrowser *tupiText = new QTextBrowser; tupiText->setSearchPaths(path); tupiText->setOpenExternalLinks(true); - tupiText->setSource(SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator() + lang + QDir::separator() + "tupi_short.html"); + tupiText->setSource(QUrl::fromLocalFile(tupiPath)); tupiText->moveCursor(QTextCursor::Start); addTab(tupiText, tr("About")); // 4: License Terms Tab + QString licenseFile = QString() + "help" + QDir::separator() + lang + QDir::separator() + "philosophy.html"; +#ifdef Q_OS_WIN32 + QString licensePath = SHARE_DIR + licenseFile; +#else + QString licensePath = SHARE_DIR + "data" + QDir::separator() + licenseFile; +#endif QTextBrowser *licenseText = new QTextBrowser; licenseText->setSearchPaths(path); licenseText->setOpenExternalLinks(true); - licenseText->setSource(SHARE_DIR + "data" + QDir::separator() + "help" + QDir::separator() + lang + QDir::separator() + "philosophy.html"); + licenseText->setSource(QUrl::fromLocalFile(licensePath)); licenseText->moveCursor(QTextCursor::Start); - addTab(licenseText, tr("License Agreement")); setButtonText(Cancel, tr("Close")); } diff -Nru tupi-0.2+git04/src/libui/tupabout.h tupi-0.2+git05/src/libui/tupabout.h --- tupi-0.2+git04/src/libui/tupabout.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tupabout.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,19 @@ #ifndef TUPABOUT_H #define TUPABOUT_H +#include "tglobal.h" +#include "tapplicationproperties.h" #include "tabdialog.h" #include "tanimwidget.h" -#include "tapplicationproperties.h" #include #include #include +#include +#include +#include +#include +#include /** * @brief Class that handles the about dialog box @@ -62,7 +68,7 @@ * Moreover, it provides an OK Button and a Cancel Button. */ -class TupAbout : public TabDialog +class TUPI_EXPORT TupAbout : public TabDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/libui/tuppaintareaconfig.cpp tupi-0.2+git05/src/libui/tuppaintareaconfig.cpp --- tupi-0.2+git04/src/libui/tuppaintareaconfig.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tuppaintareaconfig.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,14 +34,6 @@ ***************************************************************************/ #include "tuppaintareaconfig.h" -#include "tcolorbutton.h" -#include "tconfig.h" -#include "tdebug.h" - -#include -#include -#include -#include /** * This class handles the preferences dialog for the paint area settings. diff -Nru tupi-0.2+git04/src/libui/tuppaintareaconfig.h tupi-0.2+git05/src/libui/tuppaintareaconfig.h --- tupi-0.2+git04/src/libui/tuppaintareaconfig.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tuppaintareaconfig.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,15 +36,23 @@ #ifndef TUPPAINTAREACONFIG_H #define TUPPAINTAREACONFIG_H +#include "tglobal.h" +#include "tcolorbutton.h" +#include "tconfig.h" + #include #include +#include +#include +#include +#include class TColorButton; /** * @author David Cuadrado */ -class TupPaintAreaConfig : public QWidget +class TUPI_EXPORT TupPaintAreaConfig : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/libui/tuppreferences.cpp tupi-0.2+git05/src/libui/tuppreferences.cpp --- tupi-0.2+git04/src/libui/tuppreferences.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tuppreferences.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,15 +35,12 @@ #include "tuppreferences.h" #include "tuppaintareaconfig.h" -#include "tglobal.h" -#include "tdebug.h" #include "tapplication.h" #include "tformfactory.h" #include #include #include - #include #include #include diff -Nru tupi-0.2+git04/src/libui/tuppreferences.h tupi-0.2+git05/src/libui/tuppreferences.h --- tupi-0.2+git04/src/libui/tuppreferences.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tuppreferences.h 2014-12-15 14:21:33.000000000 +0000 @@ -41,23 +41,22 @@ * @brief Include this file if you need the class TupPreferences */ -#include -#include -#include - +#include "tglobal.h" #include "tfontchooser.h" #include "tabdialog.h" #include "tconfigurationdialog.h" - #include "tupthemeselector.h" -#include "tupglobal.h" + +#include +#include +#include class ColorSchemePref; class TupPaintAreaConfig; -class TupPreferences : public TConfigurationDialog +class TUPI_EXPORT TupPreferences : public TConfigurationDialog { - Q_OBJECT; + Q_OBJECT public: TupPreferences(QWidget *parent); diff -Nru tupi-0.2+git04/src/libui/tupthemeselector.cpp tupi-0.2+git05/src/libui/tupthemeselector.cpp --- tupi-0.2+git04/src/libui/tupthemeselector.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tupthemeselector.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,8 +34,6 @@ ***************************************************************************/ #include "tupthemeselector.h" -#include "tglobal.h" -#include "tdebug.h" #include "tseparator.h" #include "tcolorbutton.h" #include "tapplication.h" @@ -173,7 +171,8 @@ m_allSchemes = new QTreeWidget; m_allSchemes->setHeaderLabels(QStringList() << tr("Schema") << tr("Owner") << tr("Date")); - m_allSchemes->header()->setResizeMode(QHeaderView::Stretch); + // m_allSchemes->header()->setResizeMode(QHeaderView::Stretch); + m_allSchemes->header()->setSectionResizeMode(QHeaderView::Stretch); schemaLayout->addWidget(m_allSchemes); @@ -308,8 +307,12 @@ if (! item->text(0).isEmpty()) { #ifdef K_DEBUG - T_FUNCINFO; - #endif + #ifdef Q_OS_WIN32 + qDebug() << "[TupThemeSelector::loadSchemaFromListView()]"; + #else + T_FUNCINFO; + #endif + #endif TCONFIG->beginGroup("General"); TCONFIG->setValue("ThemeFile", SHARE_DIR + "themes/" + item->text(0)); m_lastFile = SHARE_DIR + "themes/" + item->text(0); diff -Nru tupi-0.2+git04/src/libui/tupthemeselector.h tupi-0.2+git05/src/libui/tupthemeselector.h --- tupi-0.2+git04/src/libui/tupthemeselector.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/libui/tupthemeselector.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,6 +36,11 @@ #ifndef TUPTHEMESELECTOR_H #define TUPTHEMESELECTOR_H +#include "tglobal.h" +#include "themedocument.h" +#include "tvhbox.h" +#include "tapplicationproperties.h" + #include #include #include @@ -48,17 +53,13 @@ #include #include -#include "themedocument.h" -#include "tvhbox.h" -#include "tapplicationproperties.h" - class QCheckBox; /** * @author David Cuadrado */ -class TupThemeSelector : public TVHBox +class TUPI_EXPORT TupThemeSelector : public TVHBox { Q_OBJECT diff -Nru tupi-0.2+git04/src/net/net.pri tupi-0.2+git05/src/net/net.pri --- tupi-0.2+git04/src/net/net.pri 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/net.pri 2014-12-15 14:21:33.000000000 +0000 @@ -1,6 +1,12 @@ - +# QT += network INCLUDEPATH += $$NET_DIR -LIBS += -L$$NET_DIR -ltupinet +unix { + LIBS += -L$$NET_DIR -ltupinet +} + +win32 { + LIBS += -L$$NET_DIR/release/ -ltupinet +} + -QT += network diff -Nru tupi-0.2+git04/src/net/net.pro tupi-0.2+git05/src/net/net.pro --- tupi-0.2+git04/src/net/net.pro 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/net.pro 2014-12-15 14:21:33.000000000 +0000 @@ -1,10 +1,13 @@ -# File generated by kdevelop's qmake manager. -# ------------------------------------------- -# Subdir relative project main directory: ./src/net -# Target is a library: net +QT += opengl core gui svg xml network -!include(../../tupiglobal.pri) { - error("Please configure first") +unix { + !include(../../tupiglobal.pri) { + error("Please configure first") + } +} + +win32 { + include(../../win.pri) } INSTALLS += target diff -Nru tupi-0.2+git04/src/net/tupackparser.h tupi-0.2+git05/src/net/tupackparser.h --- tupi-0.2+git04/src/net/tupackparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupackparser.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPACKPARSER_H #define TUPACKPARSER_H +#include "tglobal.h" #include "tupxmlparserbase.h" /** * @author David Cuadrado */ -class TupAckParser : public TupXmlParserBase +class TUPI_EXPORT TupAckParser : public TupXmlParserBase { public: TupAckParser(); diff -Nru tupi-0.2+git04/src/net/tupchat.cpp tupi-0.2+git05/src/net/tupchat.cpp --- tupi-0.2+git04/src/net/tupchat.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupchat.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,18 +34,8 @@ ***************************************************************************/ #include "tupchat.h" -#include "tdebug.h" -#include -#include -#include -#include -#include -#include -#include -#include - -class TupChat::Private +struct TupChat::Private { public: Private() diff -Nru tupi-0.2+git04/src/net/tupchat.h tupi-0.2+git05/src/net/tupchat.h --- tupi-0.2+git04/src/net/tupchat.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupchat.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,23 @@ #ifndef TUPCHAT_H #define TUPCHAT_H +#include "tglobal.h" + #include #include +#include +#include +#include +#include +#include +#include +#include /** * @author David Cuadrado */ -class TupChat : public QWidget +class TUPI_EXPORT TupChat : public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/net/tupchatpackage.h tupi-0.2+git05/src/net/tupchatpackage.h --- tupi-0.2+git04/src/net/tupchatpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupchatpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPCHATPACKAGE_H #define TUPCHATPACKAGE_H +#include "tglobal.h" + #include /** * @author Jorge Cuadrado */ -class TupChatPackage: public QDomDocument +class TUPI_EXPORT TupChatPackage: public QDomDocument { public: TupChatPackage(const QString &text); diff -Nru tupi-0.2+git04/src/net/tupcommunicationparser.h tupi-0.2+git05/src/net/tupcommunicationparser.h --- tupi-0.2+git04/src/net/tupcommunicationparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupcommunicationparser.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPCOMMUNICATIONPARSER_H #define TUPCOMMUNICATIONPARSER_H +#include "tglobal.h" #include "tupxmlparserbase.h" /** * @author Jorge Cuadrado */ -class TupCommunicationParser : public TupXmlParserBase +class TUPI_EXPORT TupCommunicationParser : public TupXmlParserBase { public: TupCommunicationParser(); diff -Nru tupi-0.2+git04/src/net/tupconnectdialog.cpp tupi-0.2+git05/src/net/tupconnectdialog.cpp --- tupi-0.2+git04/src/net/tupconnectdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupconnectdialog.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,18 +34,6 @@ ***************************************************************************/ #include "tupconnectdialog.h" -#include "tupnetprojectmanagerparams.h" -#include "tconfig.h" -#include "tformfactory.h" -#include "tosd.h" - -#include -#include -#include -#include -#include -#include -#include struct TupConnectDialog::Private { diff -Nru tupi-0.2+git04/src/net/tupconnectdialog.h tupi-0.2+git05/src/net/tupconnectdialog.h --- tupi-0.2+git04/src/net/tupconnectdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupconnectdialog.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,15 +36,28 @@ #ifndef TUPCONNECTDIALOG_H #define TUPCONNECTDIALOG_H +#include "tglobal.h" +#include "tupnetprojectmanagerparams.h" +#include "tconfig.h" +#include "tformfactory.h" +#include "tosd.h" + #include +#include +#include +#include +#include +#include +#include +#include -class TupNetProjectManagerParams; +// class TupNetProjectManagerParams; /** * @author David Cuadrado */ -class TupConnectDialog : public QDialog +class TUPI_EXPORT TupConnectDialog : public QDialog { Q_OBJECT @@ -68,7 +81,7 @@ void saveSettings(); private: - class Private; + struct Private; Private *const k; }; diff -Nru tupi-0.2+git04/src/net/tupconnectpackage.cpp tupi-0.2+git05/src/net/tupconnectpackage.cpp --- tupi-0.2+git04/src/net/tupconnectpackage.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupconnectpackage.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,11 +34,6 @@ ***************************************************************************/ #include "tupconnectpackage.h" -#include "talgorithm.h" -#include "tdebug.h" - -#include -#include /* diff -Nru tupi-0.2+git04/src/net/tupconnectpackage.h tupi-0.2+git05/src/net/tupconnectpackage.h --- tupi-0.2+git04/src/net/tupconnectpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupconnectpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,18 @@ #ifndef TUPCONNECTPACKAGE_H #define TUPCONNECTPACKAGE_H +#include "tglobal.h" +#include "talgorithm.h" + #include +#include +#include /** * @author Jorge Cuadrado */ -class TupConnectPackage : public QDomDocument +class TUPI_EXPORT TupConnectPackage : public QDomDocument { public: TupConnectPackage(const QString &server, const QString &username, const QString &passwd); diff -Nru tupi-0.2+git04/src/net/tupimageexportpackage.h tupi-0.2+git05/src/net/tupimageexportpackage.h --- tupi-0.2+git04/src/net/tupimageexportpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupimageexportpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPIMAGEEXPORTPACKAGE_H #define TUPIMAGEEXPORTPACKAGE_H +#include "tglobal.h" + +#include + /** * @author Gustav Gonzalez */ -#include - -class TupImageExportPackage : public QDomDocument +class TUPI_EXPORT TupImageExportPackage : public QDomDocument { public: TupImageExportPackage(int frameIndex, int sceneIndex, const QString &title, const QString &topics, const QString &description); diff -Nru tupi-0.2+git04/src/net/tupimportprojectpackage.cpp tupi-0.2+git05/src/net/tupimportprojectpackage.cpp --- tupi-0.2+git04/src/net/tupimportprojectpackage.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupimportprojectpackage.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupimportprojectpackage.h" -#include TupImportProjectPackage::TupImportProjectPackage(const QString &projectPath) { diff -Nru tupi-0.2+git04/src/net/tupimportprojectpackage.h tupi-0.2+git05/src/net/tupimportprojectpackage.h --- tupi-0.2+git04/src/net/tupimportprojectpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupimportprojectpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,16 @@ #ifndef TUPIMPORTPROJECTPACKAGE_H #define TUPIMPORTPROJECTPACKAGE_H +#include "tglobal.h" + #include +#include /** * @author Jorge Cuadrado */ -class TupImportProjectPackage : public QDomDocument +class TUPI_EXPORT TupImportProjectPackage : public QDomDocument { public: TupImportProjectPackage(const QString &projectPath); diff -Nru tupi-0.2+git04/src/net/tuplistpackage.h tupi-0.2+git05/src/net/tuplistpackage.h --- tupi-0.2+git04/src/net/tuplistpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tuplistpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPLISTPACKAGE_H #define TUPLISTPACKAGE_H +#include "tglobal.h" + #include /** * @author Jorge Cuadrado */ -class TupListPackage : public QDomDocument +class TUPI_EXPORT TupListPackage : public QDomDocument { public: enum Type { diff -Nru tupi-0.2+git04/src/net/tuplistprojectdialog.cpp tupi-0.2+git05/src/net/tuplistprojectdialog.cpp --- tupi-0.2+git04/src/net/tuplistprojectdialog.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tuplistprojectdialog.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,16 +34,6 @@ ***************************************************************************/ #include "tuplistprojectdialog.h" -#include "treelistwidget.h" -#include "treewidgetsearchline.h" -#include "tdebug.h" - -#include -#include -#include -#include -#include -#include struct TupListProjectDialog::Private { diff -Nru tupi-0.2+git04/src/net/tuplistprojectdialog.h tupi-0.2+git05/src/net/tuplistprojectdialog.h --- tupi-0.2+git04/src/net/tuplistprojectdialog.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tuplistprojectdialog.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,18 +36,28 @@ #ifndef TUPLISTPROJECTDIALOG_H #define TUPLISTPROJECTDIALOG_H +#include "tglobal.h" #include "tapplicationproperties.h" +#include "treelistwidget.h" +#include "treewidgetsearchline.h" #include #include +#include +#include +#include +#include +#include +#include +#include /** * @author Jorge Cuadrado */ -class QTreeWidgetItem; +// class QTreeWidgetItem; -class TupListProjectDialog : public QDialog +class TUPI_EXPORT TupListProjectDialog : public QDialog { Q_OBJECT diff -Nru tupi-0.2+git04/src/net/tuplistprojectspackage.h tupi-0.2+git05/src/net/tuplistprojectspackage.h --- tupi-0.2+git04/src/net/tuplistprojectspackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tuplistprojectspackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPLISTPROJECTSPACKAGE_H #define TUPLISTPROJECTSPACKAGE_H +#include "tglobal.h" + #include /** * @author David Cuadrado */ -class TupListProjectsPackage : public QDomDocument +class TUPI_EXPORT TupListProjectsPackage : public QDomDocument { public: TupListProjectsPackage(); diff -Nru tupi-0.2+git04/src/net/tupnetfilemanager.cpp tupi-0.2+git05/src/net/tupnetfilemanager.cpp --- tupi-0.2+git04/src/net/tupnetfilemanager.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetfilemanager.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -33,14 +33,7 @@ * along with this program. If not, see . * ***************************************************************************/ -#include -#include -#include -#include - #include "tupnetfilemanager.h" -#include "tupproject.h" -#include "tupnetprojectmanagerparams.h" TupNetFileManager::TupNetFileManager() : TupFileManager() { @@ -54,7 +47,7 @@ { } -bool TupNetFileManager::save(const QString &_filename, const TupProject *project) +bool TupNetFileManager::save(const QString &_filename, TupProject *project) { QString filename = _filename; diff -Nru tupi-0.2+git04/src/net/tupnetfilemanager.h tupi-0.2+git05/src/net/tupnetfilemanager.h --- tupi-0.2+git04/src/net/tupnetfilemanager.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetfilemanager.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,17 +36,24 @@ #ifndef TUPNETFILEMANAGER_H #define TUPNETFILEMANAGER_H +#include "tglobal.h" #include "tupfilemanager.h" +#include "tupproject.h" +#include "tupnetprojectmanagerparams.h" #include +#include +#include +#include +#include -class TupNetProjectManagerParams; +// class TupNetProjectManagerParams; /** * @author David Cuadrado */ -class TupNetFileManager : public TupFileManager +class TUPI_EXPORT TupNetFileManager : public TupFileManager { public: @@ -54,7 +61,8 @@ TupNetFileManager(const QString &server, int port); ~TupNetFileManager(); - virtual bool save(const QString &filename, const TupProject *project); + // virtual bool save(const QString &filename, const TupProject *project); + virtual bool save(const QString &filename, TupProject *project); virtual bool load(const QString &filename, TupProject *project); TupNetProjectManagerParams *params(const QString &filename); diff -Nru tupi-0.2+git04/src/net/tupnetprojectmanagerhandler.cpp tupi-0.2+git05/src/net/tupnetprojectmanagerhandler.cpp --- tupi-0.2+git04/src/net/tupnetprojectmanagerhandler.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetprojectmanagerhandler.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,41 +34,6 @@ ***************************************************************************/ #include "tupnetprojectmanagerhandler.h" -#include "tupnetprojectmanagerparams.h" -#include "tupprojectresponse.h" -#include "tdebug.h" -#include "tosd.h" - -#include "tupprojectcommand.h" -#include "tupcommandexecutor.h" -#include "tupnetsocket.h" -#include "tupprojectrequest.h" -#include "tupnewprojectpackage.h" -#include "tupconnectpackage.h" -#include "tupimageexportpackage.h" -#include "tupvideoexportpackage.h" -#include "tupstoryboardupdatepackage.h" -#include "tupstoryboardexportpackage.h" -#include "tupstoryboardparser.h" -#include "tupnetfilemanager.h" -#include "tupopenpackage.h" -#include "tupchatpackage.h" -#include "tupnotificationparser.h" -#include "tupprojectlistparser.h" -#include "tupprojectparser.h" -#include "tuprequestparser.h" -#include "tupackparser.h" -#include "tupcommunicationparser.h" -#include "tuprequestbuilder.h" -#include "tupproject.h" -#include "tuplistprojectdialog.h" -#include "tupchat.h" -#include "tupnotice.h" - -#include -#include -#include -#include struct TupNetProjectManagerHandler::Private { @@ -94,7 +59,11 @@ TupNetProjectManagerHandler::TupNetProjectManagerHandler(QObject *parent) : TupAbstractProjectHandler(parent), k(new Private) { #ifdef K_DEBUG - TINIT; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler()]"; + #else + TINIT; + #endif #endif k->socket = new TupNetSocket(this); @@ -125,9 +94,14 @@ TupNetProjectManagerHandler::~TupNetProjectManagerHandler() { #ifdef K_DEBUG - TEND; + #ifdef Q_OS_WIN32 + qDebug() << "[~TupNetProjectManagerHandler()]"; + #else + TEND; + #endif #endif + k->chat->close(); delete k; } @@ -135,7 +109,11 @@ void TupNetProjectManagerHandler::handleProjectRequest(const TupProjectRequest* request) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::handleProjectRequest()]"; + #else + T_FUNCINFO; + #endif #endif // This comes from the project before the command execution @@ -144,7 +122,12 @@ if (k->socket->state() == QAbstractSocket::ConnectedState) { #ifdef K_DEBUG - tWarning() << "TupNetProjectManagerHandler::handleProjectRequest() - SENDING PACKAGE: " << request->xml(); + QString msg = "TupNetProjectManagerHandler::handleProjectRequest() - SENDING PACKAGE: " + request->xml(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif if (request->isValid()) { @@ -152,7 +135,12 @@ k->socket->send(request->xml()); } else { #ifdef K_DEBUG - tFatal() << "TupNetProjectManagerHandler::handleProjectRequest() - INVALID REQUEST! ID: " << request->id(); + QString msg = "TupNetProjectManagerHandler::handleProjectRequest() - INVALID REQUEST! ID: " + QString::number(request->id()); + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tFatal() << msg; + #endif #endif } } @@ -161,7 +149,11 @@ bool TupNetProjectManagerHandler::commandExecuted(TupProjectResponse *response) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::commandExecuted()]"; + #else + T_FUNCINFO; + #endif #endif if (response->mode() == TupProjectResponse::Do) { @@ -187,7 +179,11 @@ bool TupNetProjectManagerHandler::saveProject(const QString &fileName, TupProject *project) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::saveProject()]"; + #else + T_FUNCINFO; + #endif #endif Q_UNUSED(fileName); @@ -227,14 +223,19 @@ { TupNetProjectManagerParams *netparams = dynamic_cast(params); - if (! netparams) + if (!netparams) return; k->params = netparams; #ifdef K_DEBUG - tDebug("net") << "TupNetProjectManagerHandler::initialize() - Connecting to " << netparams->server() << ":" << netparams->port(); - #endif + QString msg = "TupNetProjectManagerHandler::initialize() - Connecting to " + netparams->server() + ":" + QString::number(netparams->port()); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning("net") << msg; + #endif + #endif k->socket->connectToHost(k->params->server(), k->params->port()); bool connected = k->socket->waitForConnected(1000); @@ -252,11 +253,15 @@ { TupNetProjectManagerParams *netparams = dynamic_cast(params); - if (! netparams) + if (!netparams) return false; #ifdef K_DEBUG + #ifdef Q_OS_WIN32 + qWarning() << "netparams->projectName() : " << netparams->projectName(); + #else SHOW_VAR(netparams->projectName()); + #endif #endif k->projectName = netparams->projectName(); @@ -296,12 +301,16 @@ void TupNetProjectManagerHandler::handlePackage(const QString &root, const QString &package) { #ifdef K_DEBUG + QString msg = "TupNetProjectManagerHandler::handlePackage() - PKG:"; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::handlePackage()]"; + qDebug() << msg; + qWarning() << package; + #else T_FUNCINFOX("net"); - #endif - - #ifdef K_DEBUG - tDebug() << "TupNetProjectManagerHandler::handlePackage() - PKG:"; + tDebug() << msg; tWarning() << package; + #endif #endif if (root == "user_denied") { @@ -337,11 +346,16 @@ } else { // SQA: show error #ifdef K_DEBUG - tError() << "TupNetProjectManagerHandler::handlePackage() - Error parsing net request"; + QString msg = "TupNetProjectManagerHandler::handlePackage() - Error parsing net request"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else if (root == "project_storyboard_update") { - tError() << "TupNetProjectManagerHandler::handlePackage() - Updating the storyboard..."; + // tError() << "TupNetProjectManagerHandler::handlePackage() - Updating the storyboard..."; TupStoryboardParser parser(package); if (parser.checksum()) { @@ -351,13 +365,24 @@ k->project->scene(parser.sceneIndex())->setStoryboard(storyboard); } else { #ifdef K_DEBUG - tError() << "ProjectManager::handlePackage() - [ Fatal Error ] - Can't parse project_storyboard package"; + QString msg = "ProjectManager::handlePackage() - [ Fatal Error ] - Can't parse project_storyboard package"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } else { #ifdef K_DEBUG - tError() << "ProjectManager::handlePackage() - [ Fatal Error ] - Can't parse project_storyboard package"; + QString msg = "ProjectManager::handlePackage() - [ Fatal Error ] - Can't parse project_storyboard package"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif + } } else if (root == "server_ack") { // Checking the package @@ -384,13 +409,23 @@ emit openNewArea(k->project->projectName(), parser.partners()); } else { #ifdef K_DEBUG - tError() << "TupNetProjectManagerHandler::handlePackage() - Error: Net project can't be opened"; + QString msg = "TupNetProjectManagerHandler::handlePackage() - Error: Net project can't be opened"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } delete manager; } else { #ifdef K_DEBUG - tError() << "TupNetProjectManagerHandler::handlePackage() - Error: Can't open project"; + QString msg = "TupNetProjectManagerHandler::handlePackage() - Error: Can't open project"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -416,7 +451,12 @@ if (k->dialog->exec() == QDialog::Accepted && !k->dialog->projectID().isEmpty()) { #ifdef K_DEBUG - tDebug() << "TupNetProjectManagerHandler::handlePackage() - opening project " << k->dialog->projectID(); + QString msg = "TupNetProjectManagerHandler::handlePackage() - opening project -> " + k->dialog->projectID(); + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif k->dialogIsOpen = false; if (k->dialog->workIsMine()) @@ -430,7 +470,12 @@ } else { TOsd::self()->display(tr("Information"), tr("User has no available projects in the server"), TOsd::Warning); #ifdef K_DEBUG - tError() << "TupNetProjectManagerHandler::handlePackage() - Info: User has no available projects in the server"; + QString msg = "TupNetProjectManagerHandler::handlePackage() - Info: User has no available projects in the server"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif closeConnection(); } @@ -494,7 +539,12 @@ // SQA: storyboard package must be parsed and the related scene must be updated } else { #ifdef K_DEBUG - tError("net") << "TupNetProjectManagerHandler::handlePackage() - Error: Unknown package: " << root; + QString msg = "TupNetProjectManagerHandler::handlePackage() - Error: Unknown package: " + root; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } @@ -506,7 +556,7 @@ void TupNetProjectManagerHandler::sendPackage(const QDomDocument &doc) { - tError() << "TupNetProjectManagerHandler::sendPackage() - xml: " << doc.toString(); + // tError() << "TupNetProjectManagerHandler::sendPackage() - xml: " << doc.toString(); k->socket->send(doc); } @@ -529,9 +579,15 @@ void TupNetProjectManagerHandler::connectionLost() { #ifdef K_DEBUG - tWarning() << "TupNetProjectManagerHandler::connectionLost() - The socket has been closed"; + QString msg = "TupNetProjectManagerHandler::connectionLost() - The socket has been closed"; + #ifdef Q_OS_WIN32 + qWarning() << msg; + #else + tWarning() << msg; + #endif #endif + if (k->dialogIsOpen) { if (k->dialog) { if (k->dialog->isVisible()) @@ -553,7 +609,11 @@ const QString &title, const QString &topics, const QString &description) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::sendExportImageRequest()]"; + #else + T_FUNCINFO; + #endif #endif TupImageExportPackage package(frameIndex, sceneIndex, title, topics, description); @@ -563,7 +623,11 @@ void TupNetProjectManagerHandler::sendVideoRequest(const QString &title, const QString &topics, const QString &description, int fps, const QList sceneIndexes) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::sendVideoRequest()]"; + #else + T_FUNCINFO; + #endif #endif TupVideoExportPackage package(title, topics, description, fps, sceneIndexes); @@ -573,7 +637,11 @@ void TupNetProjectManagerHandler::updateStoryboardRequest(TupStoryboard *storyboard, int sceneIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::updateStoryboardRequest()]"; + #else + T_FUNCINFO; + #endif #endif QDomDocument doc; @@ -585,7 +653,11 @@ void TupNetProjectManagerHandler::postStoryboardRequest(int sceneIndex) { #ifdef K_DEBUG - T_FUNCINFO; + #ifdef Q_OS_WIN32 + qDebug() << "[TupNetProjectManagerHandler::postStoryboardRequest()]"; + #else + T_FUNCINFO; + #endif #endif TupStoryboardExportPackage package(sceneIndex); diff -Nru tupi-0.2+git04/src/net/tupnetprojectmanagerhandler.h tupi-0.2+git05/src/net/tupnetprojectmanagerhandler.h --- tupi-0.2+git04/src/net/tupnetprojectmanagerhandler.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetprojectmanagerhandler.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,25 +33,61 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef TUPNETPROJECTMANAGER_H -#define TUPNETPROJECTMANAGER_H +#ifndef TUPNETPROJECTMANAGERHANDLER_H +#define TUPNETPROJECTMANAGERHANDLER_H +#include "tglobal.h" #include "tupabstractprojectmanagerhandler.h" #include "tupstoryboard.h" +#include "tupnetprojectmanagerparams.h" +#include "tupprojectresponse.h" +#include "tosd.h" +#include "tupprojectcommand.h" +#include "tupcommandexecutor.h" +#include "tupnetsocket.h" +#include "tupprojectrequest.h" +#include "tupnewprojectpackage.h" +#include "tupconnectpackage.h" +#include "tupimageexportpackage.h" +#include "tupvideoexportpackage.h" +#include "tupstoryboardupdatepackage.h" +#include "tupstoryboardexportpackage.h" +#include "tupstoryboardparser.h" +#include "tupnetfilemanager.h" +#include "tupopenpackage.h" +#include "tupchatpackage.h" +#include "tupnotificationparser.h" +#include "tupprojectlistparser.h" +#include "tupprojectparser.h" +#include "tuprequestparser.h" +#include "tupackparser.h" +#include "tupcommunicationparser.h" +#include "tuprequestbuilder.h" +#include "tupproject.h" +#include "tuplistprojectdialog.h" +#include "tupchat.h" +#include "tupnotice.h" + #include #include +#include +#include +#include +#include +/* class TupChat; class TupProjectCommand; class TupNetSocket; class TupNetProjectManagerParams; +*/ /** * @author David Cuadrado */ -class TupNetProjectManagerHandler : public TupAbstractProjectHandler +class TUPI_EXPORT TupNetProjectManagerHandler : public TupAbstractProjectHandler { Q_OBJECT diff -Nru tupi-0.2+git04/src/net/tupnetprojectmanagerparams.h tupi-0.2+git05/src/net/tupnetprojectmanagerparams.h --- tupi-0.2+git04/src/net/tupnetprojectmanagerparams.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetprojectmanagerparams.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPNETPROJECTMANAGERPARAMS_H #define TUPNETPROJECTMANAGERPARAMS_H +#include "tglobal.h" #include "tupprojectmanagerparams.h" /** * @author David Cuadrado */ -class TupNetProjectManagerParams : public TupProjectManagerParams +class TUPI_EXPORT TupNetProjectManagerParams : public TupProjectManagerParams { public: TupNetProjectManagerParams(); diff -Nru tupi-0.2+git04/src/net/tupnetsocket.cpp tupi-0.2+git05/src/net/tupnetsocket.cpp --- tupi-0.2+git04/src/net/tupnetsocket.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetsocket.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,12 +34,6 @@ ***************************************************************************/ #include "tupnetsocket.h" -#include "tupnetprojectmanagerhandler.h" -#include "tupcompress.h" -#include "tdebug.h" - -#include -#include TupNetSocket::TupNetSocket(TupNetProjectManagerHandler *handler) : TupSocketBase(handler), m_handler(handler) { @@ -52,8 +46,14 @@ void TupNetSocket::readed(const QString &readed) { #ifdef K_DEBUG - tDebug("net") << "TupNetSocket::readed() - PACKAGE ARRIVING: "; - tWarning("net") << readed; + QString msg = "TupNetSocket::readed() - PACKAGE ARRIVING: "; + #ifdef Q_OS_WIN32 + qWarning() << msg; + qWarning() << readed; + #else + tWarning() << msg; + tWarning("net") << readed; + #endif #endif QDomDocument doc; @@ -63,8 +63,12 @@ m_handler->handlePackage(root, readed); } else { #ifdef K_DEBUG - tError() << "TupNetSocket::readed() - Error: Package isn't a DOM document"; + QString msg = "TupNetSocket::readed() - Error: Package isn't a DOM document"; + #ifdef Q_OS_WIN32 + qDebug() << msg; + #else + tError() << msg; + #endif #endif } } - diff -Nru tupi-0.2+git04/src/net/tupnetsocket.h tupi-0.2+git05/src/net/tupnetsocket.h --- tupi-0.2+git04/src/net/tupnetsocket.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnetsocket.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,7 +36,13 @@ #ifndef TUPNETSOCKET_H #define TUPNETSOCKET_H +#include "tglobal.h" +#include "tupnetprojectmanagerhandler.h" #include "tupsocketbase.h" +#include "tupcompress.h" + +#include +#include class TupNetProjectManagerHandler; @@ -44,7 +50,7 @@ * @author David Cuadrado */ -class TupNetSocket : public TupSocketBase +class TUPI_EXPORT TupNetSocket : public TupSocketBase { Q_OBJECT diff -Nru tupi-0.2+git04/src/net/tupnewprojectpackage.h tupi-0.2+git05/src/net/tupnewprojectpackage.h --- tupi-0.2+git04/src/net/tupnewprojectpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnewprojectpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPNEWPROJECTPACKAGE_H #define TUPNEWPROJECTPACKAGE_H +#include "tglobal.h" + #include /** * @author Jorge Cuadrado */ -class TupNewProjectPackage : public QDomDocument +class TUPI_EXPORT TupNewProjectPackage : public QDomDocument { public: TupNewProjectPackage(const QString & name, const QString & author, const QString & description, diff -Nru tupi-0.2+git04/src/net/tupnotice.cpp tupi-0.2+git05/src/net/tupnotice.cpp --- tupi-0.2+git04/src/net/tupnotice.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnotice.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -35,14 +35,7 @@ #include "tupnotice.h" -#include -#include -#include -#include -#include -#include - -class TupNotice::Private +struct TupNotice::Private { public: Private() diff -Nru tupi-0.2+git04/src/net/tupnotice.h tupi-0.2+git05/src/net/tupnotice.h --- tupi-0.2+git04/src/net/tupnotice.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnotice.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,21 @@ #ifndef TUPNOTICE_H #define TUPNOTICE_H +#include "tglobal.h" + #include +#include +#include +#include +#include +#include +#include /** * @author Jorge Cuadrado */ -class TupNotice: public QWidget +class TUPI_EXPORT TupNotice: public QWidget { Q_OBJECT diff -Nru tupi-0.2+git04/src/net/tupnoticepackage.h tupi-0.2+git05/src/net/tupnoticepackage.h --- tupi-0.2+git04/src/net/tupnoticepackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnoticepackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPNOTICEPACKAGE_H #define TUPNOTICEPACKAGE_H +#include "tglobal.h" + #include /** * @author Jorge Cuadrado */ -class TupNoticePackage : public QDomDocument +class TUPI_EXPORT TupNoticePackage : public QDomDocument { public: TupNoticePackage(const QString &text); diff -Nru tupi-0.2+git04/src/net/tupnotificationparser.h tupi-0.2+git05/src/net/tupnotificationparser.h --- tupi-0.2+git04/src/net/tupnotificationparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupnotificationparser.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPERRORPARSER_H #define TUPERRORPARSER_H +#include "tglobal.h" +#include "tupxmlparserbase.h" + /** * @author Jorge Cuadrado */ -#include "tupxmlparserbase.h" - -class TupNotificationParser : public TupXmlParserBase +class TUPI_EXPORT TupNotificationParser : public TupXmlParserBase { public: diff -Nru tupi-0.2+git04/src/net/tupopenpackage.h tupi-0.2+git05/src/net/tupopenpackage.h --- tupi-0.2+git04/src/net/tupopenpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupopenpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPOPENPACKAGE_H #define TUPOPENPACKAGE_H +#include "tglobal.h" +#include + /** - * @author Jorge Cuadrado + * @author Jorge Cuadrado */ -#include - -class TupOpenPackage: public QDomDocument +class TUPI_EXPORT TupOpenPackage: public QDomDocument { public: TupOpenPackage(const QString &projectID, const QString &owner); diff -Nru tupi-0.2+git04/src/net/tupprojectlistparser.cpp tupi-0.2+git05/src/net/tupprojectlistparser.cpp --- tupi-0.2+git04/src/net/tupprojectlistparser.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupprojectlistparser.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupprojectlistparser.h" -#include "tdebug.h" struct TupProjectListParser::Private { @@ -54,7 +53,6 @@ bool TupProjectListParser::startTag(const QString &tag, const QXmlAttributes &atts) { if (root() == "server_projectlist") { - if (tag == "works") { k->pivot = false; } else if (tag == "contributions") { diff -Nru tupi-0.2+git04/src/net/tupprojectlistparser.h tupi-0.2+git05/src/net/tupprojectlistparser.h --- tupi-0.2+git04/src/net/tupprojectlistparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupprojectlistparser.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,14 @@ #ifndef TUPPROJECTLISTPARSER_H #define TUPPROJECTLISTPARSER_H +#include "tglobal.h" #include "tupxmlparserbase.h" /** * @author Jorge Cuadrado */ -class TupProjectListParser : public TupXmlParserBase +class TUPI_EXPORT TupProjectListParser : public TupXmlParserBase { public: struct ProjectInfo diff -Nru tupi-0.2+git04/src/net/tupprojectparser.cpp tupi-0.2+git05/src/net/tupprojectparser.cpp --- tupi-0.2+git04/src/net/tupprojectparser.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupprojectparser.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupprojectparser.h" -#include "tdebug.h" struct TupProjectParser::Private { diff -Nru tupi-0.2+git04/src/net/tupprojectparser.h tupi-0.2+git05/src/net/tupprojectparser.h --- tupi-0.2+git04/src/net/tupprojectparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupprojectparser.h 2014-12-15 14:21:33.000000000 +0000 @@ -33,16 +33,17 @@ * along with this program. If not, see . * ***************************************************************************/ -#ifndef TUPROJECTPARSER_H +#ifndef TUPPROJECTPARSER_H #define TUPPROJECTPARSER_H /** * @author Jorge Cuadrado */ +#include "tglobal.h" #include "tupxmlparserbase.h" -class TupProjectParser : public TupXmlParserBase +class TUPI_EXPORT TupProjectParser : public TupXmlParserBase { public: TupProjectParser(); diff -Nru tupi-0.2+git04/src/net/tupsavepackage.h tupi-0.2+git05/src/net/tupsavepackage.h --- tupi-0.2+git04/src/net/tupsavepackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupsavepackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPSAVEPACKAGE_H #define TUPSAVEPACKAGE_H -/** - * @author Gustav Gonzalez -*/ +#include "tglobal.h" #include -class TupSavePackage: public QDomDocument +/** + * @author Gustav Gonzalez +*/ + +class TUPI_EXPORT TupSavePackage: public QDomDocument { public: TupSavePackage(bool exitFlag); diff -Nru tupi-0.2+git04/src/net/tupstoryboardexportpackage.h tupi-0.2+git05/src/net/tupstoryboardexportpackage.h --- tupi-0.2+git04/src/net/tupstoryboardexportpackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupstoryboardexportpackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,13 +36,15 @@ #ifndef TUPSTORYBOARDEXPORTPACKAGE_H #define TUPSTORYBOARDEXPORTPACKAGE_H +#include "tglobal.h" + +#include + /** * @author Gustav Gonzalez */ -#include - -class TupStoryboardExportPackage : public QDomDocument +class TUPI_EXPORT TupStoryboardExportPackage : public QDomDocument { public: TupStoryboardExportPackage(int sceneIndex); diff -Nru tupi-0.2+git04/src/net/tupstoryboardparser.cpp tupi-0.2+git05/src/net/tupstoryboardparser.cpp --- tupi-0.2+git04/src/net/tupstoryboardparser.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupstoryboardparser.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupstoryboardparser.h" -#include struct TupStoryboardParser::Private { diff -Nru tupi-0.2+git04/src/net/tupstoryboardparser.h tupi-0.2+git05/src/net/tupstoryboardparser.h --- tupi-0.2+git04/src/net/tupstoryboardparser.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupstoryboardparser.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,26 +36,29 @@ #ifndef TUPSTORYBOARDPARSER_H #define TUPSTORYBOARDPARSER_H +#include "tglobal.h" + #include #include +#include /** @author Gustav Gonzalez **/ -class TupStoryboardParser +class TUPI_EXPORT TupStoryboardParser { - public: - TupStoryboardParser(const QString &package); - ~TupStoryboardParser(); - bool checksum(); - int sceneIndex(); - QString storyboardXml() const; - QDomDocument request() const; - - private: - struct Private; - Private *const k; + public: + TupStoryboardParser(const QString &package); + ~TupStoryboardParser(); + bool checksum(); + int sceneIndex(); + QString storyboardXml() const; + QDomDocument request() const; + + private: + struct Private; + Private *const k; }; #endif diff -Nru tupi-0.2+git04/src/net/tupstoryboardupdatepackage.h tupi-0.2+git05/src/net/tupstoryboardupdatepackage.h --- tupi-0.2+git04/src/net/tupstoryboardupdatepackage.h 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupstoryboardupdatepackage.h 2014-12-15 14:21:33.000000000 +0000 @@ -36,14 +36,16 @@ #ifndef TUPSTORYBOARDUPDATEPACKAGE_H #define TUPSTORYBOARDUPDATEPACKAGE_H -/** - * @author Gustav Gonzalez -*/ +#include "tglobal.h" #include #include -class TupStoryboardUpdatePackage : public QDomDocument +/** + * @author Gustav Gonzalez +*/ + +class TUPI_EXPORT TupStoryboardUpdatePackage : public QDomDocument { public: TupStoryboardUpdatePackage(const QDomElement storyboard, int sceneIndex); diff -Nru tupi-0.2+git04/src/net/tupvideoexportpackage.cpp tupi-0.2+git05/src/net/tupvideoexportpackage.cpp --- tupi-0.2+git04/src/net/tupvideoexportpackage.cpp 2014-04-19 13:45:41.000000000 +0000 +++ tupi-0.2+git05/src/net/tupvideoexportpackage.cpp 2014-12-15 14:21:33.000000000 +0000 @@ -34,7 +34,6 @@ ***************************************************************************/ #include "tupvideoexportpackage.h" -#include "tdebug.h" // //